var aliaCustomerApp=function(exports){"use strict";var dd=Object.defineProperty;var fd=(e,t,r)=>t in e?dd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var wt=(e,t,r)=>fd(e,typeof t!="symbol"?t+"":t,r);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function getAugmentedNamespace(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var auto={},isArguments,hasRequiredIsArguments;function requireIsArguments(){if(hasRequiredIsArguments)return isArguments;hasRequiredIsArguments=1;var e=Object.prototype.toString;return isArguments=function(r){var n=e.call(r),i=n==="[object Arguments]";return i||(i=n!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&e.call(r.callee)==="[object Function]"),i},isArguments}var implementation$3,hasRequiredImplementation$3;function requireImplementation$3(){if(hasRequiredImplementation$3)return implementation$3;hasRequiredImplementation$3=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=requireIsArguments(),i=Object.prototype.propertyIsEnumerable,s=!i.call({toString:null},"toString"),l=i.call(function(){},"prototype"),d=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(S){var $=S.constructor;return $&&$.prototype===S},m={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},v=function(){if(typeof window>"u")return!1;for(var S in window)try{if(!m["$"+S]&&t.call(window,S)&&window[S]!==null&&typeof window[S]=="object")try{p(window[S])}catch{return!0}}catch{return!0}return!1}(),b=function(S){if(typeof window>"u"||!v)return p(S);try{return p(S)}catch{return!1}};e=function($){var N=$!==null&&typeof $=="object",D=r.call($)==="[object Function]",P=n($),F=N&&r.call($)==="[object String]",q=[];if(!N&&!D&&!P)throw new TypeError("Object.keys called on a non-object");var H=l&&D;if(F&&$.length>0&&!t.call($,0))for(var f=0;f<$.length;++f)q.push(String(f));if(P&&$.length>0)for(var w=0;w<$.length;++w)q.push(String(w));else for(var g in $)!(H&&g==="prototype")&&t.call($,g)&&q.push(String(g));if(s)for(var C=b($),_=0;_3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var p=arguments.length>3?arguments[3]:null,m=arguments.length>4?arguments[4]:null,v=arguments.length>5?arguments[5]:null,b=arguments.length>6?arguments[6]:!1,S=!!n&&n(s,l);if(e)e(s,l,{configurable:v===null&&S?S.configurable:!v,enumerable:p===null&&S?S.enumerable:!p,value:d,writable:m===null&&S?S.writable:!m});else if(b||!p&&!m&&!v)s[l]=d;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},defineDataProperty}var hasPropertyDescriptors_1,hasRequiredHasPropertyDescriptors;function requireHasPropertyDescriptors(){if(hasRequiredHasPropertyDescriptors)return hasPropertyDescriptors_1;hasRequiredHasPropertyDescriptors=1;var e=requireEsDefineProperty(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},hasPropertyDescriptors_1=t,hasPropertyDescriptors_1}var defineProperties_1,hasRequiredDefineProperties;function requireDefineProperties(){if(hasRequiredDefineProperties)return defineProperties_1;hasRequiredDefineProperties=1;var e=requireObjectKeys(),t=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",r=Object.prototype.toString,n=Array.prototype.concat,i=requireDefineDataProperty(),s=function(m){return typeof m=="function"&&r.call(m)==="[object Function]"},l=requireHasPropertyDescriptors()(),d=function(m,v,b,S){if(v in m){if(S===!0){if(m[v]===b)return}else if(!s(S)||!S())return}l?i(m,v,b,!0):i(m,v,b)},p=function(m,v){var b=arguments.length>2?arguments[2]:{},S=e(v);t&&(S=n.call(S,Object.getOwnPropertySymbols(v)));for(var $=0;$-1e3&&T<1e3||g.call(/e/,j))return j;var pe=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof T=="number"){var ye=T<0?-k(-T):k(T);if(ye!==T){var Te=String(ye),we=q.call(j,Te.length+1);return H.call(Te,pe,"$&_")+"."+H.call(H.call(we,/([0-9]{3})/g,"$&_"),/_$/,"")}}return H.call(j,pe,"$&_")}var oe=require$$0,ae=oe.custom,O=Be(ae)?ae:null,ne={__proto__:null,double:'"',single:"'"},xe={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};objectInspect=function T(j,pe,ye,Te){var we=pe||{};if(M(we,"quoteStyle")&&!M(ne,we.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(M(we,"maxStringLength")&&(typeof we.maxStringLength=="number"?we.maxStringLength<0&&we.maxStringLength!==1/0:we.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Fe=M(we,"customInspect")?we.customInspect:!0;if(typeof Fe!="boolean"&&Fe!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(M(we,"indent")&&we.indent!==null&&we.indent!==" "&&!(parseInt(we.indent,10)===we.indent&&we.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(M(we,"numericSeparator")&&typeof we.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Le=we.numericSeparator;if(typeof j>"u")return"undefined";if(j===null)return"null";if(typeof j=="boolean")return j?"true":"false";if(typeof j=="string")return at(j,we);if(typeof j=="number"){if(j===0)return 1/0/j>0?"0":"-0";var ze=String(j);return Le?W(j,ze):ze}if(typeof j=="bigint"){var Ke=String(j)+"n";return Le?W(j,Ke):Ke}var kt=typeof we.depth>"u"?5:we.depth;if(typeof ye>"u"&&(ye=0),ye>=kt&&kt>0&&typeof j=="object")return be(j)?"[Array]":"[Object]";var qt=I(we,ye);if(typeof Te>"u")Te=[];else if(ue(Te,j)>=0)return"[Circular]";function _t(yr,Fr,uo){if(Fr&&(Te=A.call(Te),Te.push(Fr)),uo){var Pn={depth:we.depth};return M(we,"quoteStyle")&&(Pn.quoteStyle=we.quoteStyle),T(yr,Pn,ye+1,Te)}return T(yr,we,ye+1,Te)}if(typeof j=="function"&&!ve(j)){var Qr=G(j),Cn=se(j,_t);return"[Function"+(Qr?": "+Qr:" (anonymous)")+"]"+(Cn.length>0?" { "+_.call(Cn,", ")+" }":"")}if(Be(j)){var hr=J?H.call(String(j),/^(Symbol\(.*\))_[^)]*$/,"$1"):K.call(j);return typeof j=="object"&&!J?dt(hr):hr}if(Je(j)){for(var nr="<"+w.call(String(j.nodeName)),or=j.attributes||[],Yr=0;Yr",nr}if(be(j)){if(j.length===0)return"[]";var ar=se(j,_t);return qt&&!Dt(ar)?"["+V(ar,qt)+"]":"[ "+_.call(ar,", ")+" ]"}if(Ie(j)){var mr=se(j,_t);return!("cause"in Error.prototype)&&"cause"in j&&!E.call(j,"cause")?"{ ["+String(j)+"] "+_.call(C.call("[cause]: "+_t(j.cause),mr),", ")+" }":mr.length===0?"["+String(j)+"]":"{ ["+String(j)+"] "+_.call(mr,", ")+" }"}if(typeof j=="object"&&Fe){if(O&&typeof j[O]=="function"&&oe)return oe(j,{depth:kt-ye});if(Fe!=="symbol"&&typeof j.inspect=="function")return j.inspect()}if(le(j)){var jr=[];return n&&n.call(j,function(yr,Fr){jr.push(_t(Fr,j,!0)+" => "+_t(yr,j))}),nt("Map",r.call(j),jr,qt)}if(Ne(j)){var Xr=[];return d&&d.call(j,function(yr){Xr.push(_t(yr,j))}),nt("Set",l.call(j),Xr,qt)}if(ie(j))return Bt("WeakMap");if(je(j))return Bt("WeakSet");if(me(j))return Bt("WeakRef");if(Ve(j))return dt(_t(Number(j)));if(ht(j))return dt(_t(L.call(j)));if(Xe(j))return dt(N.call(j));if(De(j))return dt(_t(String(j)));if(typeof window<"u"&&j===window)return"{ [object Window] }";if(typeof globalThis<"u"&&j===globalThis||typeof commonjsGlobal<"u"&&j===commonjsGlobal)return"{ [object globalThis] }";if(!ge(j)&&!ve(j)){var _n=se(j,_t),io=Y?Y(j)===Object.prototype:j instanceof Object||j.constructor===Object,$n=j instanceof Object?"":"null prototype",Yt=!io&&ee&&Object(j)===j&&ee in j?q.call(B(j),8,-1):$n?"Object":"",so=io||typeof j.constructor!="function"?"":j.constructor.name?j.constructor.name+" ":"",Jr=so+(Yt||$n?"["+_.call(C.call([],Yt||[],$n||[]),": ")+"] ":"");return _n.length===0?Jr+"{}":qt?Jr+"{"+V(_n,qt)+"}":Jr+"{ "+_.call(_n,", ")+" }"}return String(j)};function $e(T,j,pe){var ye=pe.quoteStyle||j,Te=ne[ye];return Te+T+Te}function Ee(T){return H.call(String(T),/"/g,""")}function be(T){return B(T)==="[object Array]"&&(!ee||!(typeof T=="object"&&ee in T))}function ge(T){return B(T)==="[object Date]"&&(!ee||!(typeof T=="object"&&ee in T))}function ve(T){return B(T)==="[object RegExp]"&&(!ee||!(typeof T=="object"&&ee in T))}function Ie(T){return B(T)==="[object Error]"&&(!ee||!(typeof T=="object"&&ee in T))}function De(T){return B(T)==="[object String]"&&(!ee||!(typeof T=="object"&&ee in T))}function Ve(T){return B(T)==="[object Number]"&&(!ee||!(typeof T=="object"&&ee in T))}function Xe(T){return B(T)==="[object Boolean]"&&(!ee||!(typeof T=="object"&&ee in T))}function Be(T){if(J)return T&&typeof T=="object"&&T instanceof Symbol;if(typeof T=="symbol")return!0;if(!T||typeof T!="object"||!K)return!1;try{return K.call(T),!0}catch{}return!1}function ht(T){if(!T||typeof T!="object"||!L)return!1;try{return L.call(T),!0}catch{}return!1}var bt=Object.prototype.hasOwnProperty||function(T){return T in this};function M(T,j){return bt.call(T,j)}function B(T){return D.call(T)}function G(T){if(T.name)return T.name;var j=F.call(P.call(T),/^function\s*([\w$]+)/);return j?j[1]:null}function ue(T,j){if(T.indexOf)return T.indexOf(j);for(var pe=0,ye=T.length;pej.maxStringLength){var pe=T.length-j.maxStringLength,ye="... "+pe+" more character"+(pe>1?"s":"");return at(q.call(T,0,j.maxStringLength),j)+ye}var Te=xe[j.quoteStyle||"single"];Te.lastIndex=0;var we=H.call(H.call(T,Te,"\\$1"),/[\x00-\x1f]/g,St);return $e(we,"single",j)}function St(T){var j=T.charCodeAt(0),pe={8:"b",9:"t",10:"n",12:"f",13:"r"}[j];return pe?"\\"+pe:"\\x"+(j<16?"0":"")+f.call(j.toString(16))}function dt(T){return"Object("+T+")"}function Bt(T){return T+" { ? }"}function nt(T,j,pe,ye){var Te=ye?V(pe,ye):_.call(pe,", ");return T+" ("+j+") {"+Te+"}"}function Dt(T){for(var j=0;j=0)return!1;return!0}function I(T,j){var pe;if(T.indent===" ")pe=" ";else if(typeof T.indent=="number"&&T.indent>0)pe=_.call(Array(T.indent+1)," ");else return null;return{base:pe,prev:_.call(Array(j+1),pe)}}function V(T,j){if(T.length===0)return"";var pe=` `+j.prev+j.base;return pe+_.call(T,","+pe)+` `+j.prev}function se(T,j){var pe=be(T),ye=[];if(pe){ye.length=T.length;for(var Te=0;Te"u")return"Undefined";if(typeof t=="function"||typeof t=="object")return"Object";if(typeof t=="number")return"Number";if(typeof t=="boolean")return"Boolean";if(typeof t=="string")return"String"}),Type$2}var Type$1,hasRequiredType;function requireType(){if(hasRequiredType)return Type$1;hasRequiredType=1;var e=requireType$1();return Type$1=function(r){return typeof r=="symbol"?"Symbol":typeof r=="bigint"?"BigInt":e(r)},Type$1}var Get,hasRequiredGet$1;function requireGet$1(){if(hasRequiredGet$1)return Get;hasRequiredGet$1=1;var e=requireType$2(),t=requireObjectInspect(),r=requireIsPropertyKey(),n=requireType();return Get=function(s,l){if(n(s)!=="Object")throw new e("Assertion failed: Type(O) is not Object");if(!r(l))throw new e("Assertion failed: IsPropertyKey(P) is not true, got "+t(l));return s[l]},Get}var maxSafeInteger,hasRequiredMaxSafeInteger;function requireMaxSafeInteger(){return hasRequiredMaxSafeInteger||(hasRequiredMaxSafeInteger=1,maxSafeInteger=Number.MAX_SAFE_INTEGER||9007199254740991),maxSafeInteger}var esObjectAtoms,hasRequiredEsObjectAtoms;function requireEsObjectAtoms(){return hasRequiredEsObjectAtoms||(hasRequiredEsObjectAtoms=1,esObjectAtoms=Object),esObjectAtoms}var esErrors,hasRequiredEsErrors;function requireEsErrors(){return hasRequiredEsErrors||(hasRequiredEsErrors=1,esErrors=Error),esErrors}var _eval,hasRequired_eval;function require_eval(){return hasRequired_eval||(hasRequired_eval=1,_eval=EvalError),_eval}var range,hasRequiredRange;function requireRange(){return hasRequiredRange||(hasRequiredRange=1,range=RangeError),range}var ref,hasRequiredRef;function requireRef(){return hasRequiredRef||(hasRequiredRef=1,ref=ReferenceError),ref}var uri,hasRequiredUri;function requireUri(){return hasRequiredUri||(hasRequiredUri=1,uri=URIError),uri}var abs,hasRequiredAbs;function requireAbs(){return hasRequiredAbs||(hasRequiredAbs=1,abs=Math.abs),abs}var floor$1,hasRequiredFloor$1;function requireFloor$1(){return hasRequiredFloor$1||(hasRequiredFloor$1=1,floor$1=Math.floor),floor$1}var max,hasRequiredMax;function requireMax(){return hasRequiredMax||(hasRequiredMax=1,max=Math.max),max}var min,hasRequiredMin;function requireMin(){return hasRequiredMin||(hasRequiredMin=1,min=Math.min),min}var pow,hasRequiredPow;function requirePow(){return hasRequiredPow||(hasRequiredPow=1,pow=Math.pow),pow}var shams$1,hasRequiredShams$1;function requireShams$1(){return hasRequiredShams$1||(hasRequiredShams$1=1,shams$1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(t,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0}),shams$1}var hasSymbols,hasRequiredHasSymbols;function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols;hasRequiredHasSymbols=1;var e=typeof Symbol<"u"&&Symbol,t=requireShams$1();return hasSymbols=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},hasSymbols}var functionCall,hasRequiredFunctionCall;function requireFunctionCall(){return hasRequiredFunctionCall||(hasRequiredFunctionCall=1,functionCall=Function.prototype.call),functionCall}var functionApply,hasRequiredFunctionApply;function requireFunctionApply(){return hasRequiredFunctionApply||(hasRequiredFunctionApply=1,functionApply=Function.prototype.apply),functionApply}var reflectApply,hasRequiredReflectApply;function requireReflectApply(){return hasRequiredReflectApply||(hasRequiredReflectApply=1,reflectApply=typeof Reflect<"u"&&Reflect&&Reflect.apply),reflectApply}var actualApply,hasRequiredActualApply;function requireActualApply(){if(hasRequiredActualApply)return actualApply;hasRequiredActualApply=1;var e=requireFunctionBind(),t=requireFunctionApply(),r=requireFunctionCall(),n=requireReflectApply();return actualApply=n||e.call(r,t),actualApply}var callBindApplyHelpers,hasRequiredCallBindApplyHelpers;function requireCallBindApplyHelpers(){if(hasRequiredCallBindApplyHelpers)return callBindApplyHelpers;hasRequiredCallBindApplyHelpers=1;var e=requireFunctionBind(),t=requireType$2(),r=requireFunctionCall(),n=requireActualApply();return callBindApplyHelpers=function(s){if(s.length<1||typeof s[0]!="function")throw new t("a function is required");return n(e,r,s)},callBindApplyHelpers}var get$1,hasRequiredGet;function requireGet(){if(hasRequiredGet)return get$1;hasRequiredGet=1;var e=requireCallBindApplyHelpers(),t=requireGopd(),r=[].__proto__===Array.prototype,n=r&&t&&t(Object.prototype,"__proto__"),i=Object,s=i.getPrototypeOf;return get$1=n&&typeof n.get=="function"?e([n.get]):typeof s=="function"?function(d){return s(d==null?d:i(d))}:!1,get$1}var getIntrinsic,hasRequiredGetIntrinsic;function requireGetIntrinsic(){if(hasRequiredGetIntrinsic)return getIntrinsic;hasRequiredGetIntrinsic=1;var e,t=requireEsObjectAtoms(),r=requireEsErrors(),n=require_eval(),i=requireRange(),s=requireRef(),l=requireSyntax(),d=requireType$2(),p=requireUri(),m=requireAbs(),v=requireFloor$1(),b=requireMax(),S=requireMin(),$=requirePow(),N=Function,D=function(be){try{return N('"use strict"; return ('+be+").constructor;")()}catch{}},P=requireGopd(),F=requireEsDefineProperty(),q=function(){throw new d},H=P?function(){try{return arguments.callee,q}catch{try{return P(arguments,"callee").get}catch{return q}}}():q,f=requireHasSymbols()(),w=requireGet(),g=typeof Reflect=="function"&&Reflect.getPrototypeOf||t.getPrototypeOf||w,C=requireFunctionApply(),_=requireFunctionCall(),A={},k=typeof Uint8Array>"u"||!g?e:g(Uint8Array),L={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":f&&g?g([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":A,"%AsyncGenerator%":A,"%AsyncGeneratorFunction%":A,"%AsyncIteratorPrototype%":A,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":N,"%GeneratorFunction%":A,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f&&g?g(g([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!f||!g?e:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":P,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":i,"%ReferenceError%":s,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!f||!g?e:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f&&g?g(""[Symbol.iterator]()):e,"%Symbol%":f?Symbol:e,"%SyntaxError%":l,"%ThrowTypeError%":H,"%TypedArray%":k,"%TypeError%":d,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":p,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":_,"%Function.prototype.apply%":C,"%Object.defineProperty%":F,"%Math.abs%":m,"%Math.floor%":v,"%Math.max%":b,"%Math.min%":S,"%Math.pow%":$};if(g)try{null.error}catch(be){var re=g(g(be));L["%Error.prototype%"]=re}var K=function be(ge){var ve;if(ge==="%AsyncFunction%")ve=D("async function () {}");else if(ge==="%GeneratorFunction%")ve=D("function* () {}");else if(ge==="%AsyncGeneratorFunction%")ve=D("async function* () {}");else if(ge==="%AsyncGenerator%"){var Ie=be("%AsyncGeneratorFunction%");Ie&&(ve=Ie.prototype)}else if(ge==="%AsyncIteratorPrototype%"){var De=be("%AsyncGenerator%");De&&g&&(ve=g(De.prototype))}return L[ge]=ve,ve},J={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ee=requireFunctionBind(),E=requireHasown(),Y=ee.call(_,Array.prototype.concat),W=ee.call(C,Array.prototype.splice),oe=ee.call(_,String.prototype.replace),ae=ee.call(_,String.prototype.slice),O=ee.call(_,RegExp.prototype.exec),ne=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,xe=/\\(\\)?/g,$e=function(ge){var ve=ae(ge,0,1),Ie=ae(ge,-1);if(ve==="%"&&Ie!=="%")throw new l("invalid intrinsic syntax, expected closing `%`");if(Ie==="%"&&ve!=="%")throw new l("invalid intrinsic syntax, expected opening `%`");var De=[];return oe(ge,ne,function(Ve,Xe,Be,ht){De[De.length]=Be?oe(ht,xe,"$1"):Xe||Ve}),De},Ee=function(ge,ve){var Ie=ge,De;if(E(J,Ie)&&(De=J[Ie],Ie="%"+De[0]+"%"),E(L,Ie)){var Ve=L[Ie];if(Ve===A&&(Ve=K(Ie)),typeof Ve>"u"&&!ve)throw new d("intrinsic "+ge+" exists, but is not available. Please file an issue!");return{alias:De,name:Ie,value:Ve}}throw new l("intrinsic "+ge+" does not exist!")};return getIntrinsic=function(ge,ve){if(typeof ge!="string"||ge.length===0)throw new d("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ve!="boolean")throw new d('"allowMissing" argument must be a boolean');if(O(/^%?[^%]*%?$/,ge)===null)throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Ie=$e(ge),De=Ie.length>0?Ie[0]:"",Ve=Ee("%"+De+"%",ve),Xe=Ve.name,Be=Ve.value,ht=!1,bt=Ve.alias;bt&&(De=bt[0],W(Ie,Y([0,1],bt)));for(var M=1,B=!0;M=Ie.length){var ie=P(Be,G);B=!!ie,B&&"get"in ie&&!("originalValue"in ie.get)?Be=ie.get:Be=Be[G]}else B=E(Be,G),Be=Be[G];B&&!ht&&(L[Xe]=Be)}}return Be},getIntrinsic}var isPrimitive$2,hasRequiredIsPrimitive$1;function requireIsPrimitive$1(){return hasRequiredIsPrimitive$1||(hasRequiredIsPrimitive$1=1,isPrimitive$2=function(t){return t===null||typeof t!="function"&&typeof t!="object"}),isPrimitive$2}var isPrimitive$1,hasRequiredIsPrimitive;function requireIsPrimitive(){return hasRequiredIsPrimitive||(hasRequiredIsPrimitive=1,isPrimitive$1=function(t){return t===null||typeof t!="function"&&typeof t!="object"}),isPrimitive$1}var isCallable,hasRequiredIsCallable;function requireIsCallable(){if(hasRequiredIsCallable)return isCallable;hasRequiredIsCallable=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},t(function(){throw 42},null,r)}catch(q){q!==n&&(t=null)}else t=null;var i=/^\s*class\b/,s=function(H){try{var f=e.call(H);return i.test(f)}catch{return!1}},l=function(H){try{return s(H)?!1:(e.call(H),!0)}catch{return!1}},d=Object.prototype.toString,p="[object Object]",m="[object Function]",v="[object GeneratorFunction]",b="[object HTMLAllCollection]",S="[object HTML document.all class]",$="[object HTMLCollection]",N=typeof Symbol=="function"&&!!Symbol.toStringTag,D=!(0 in[,]),P=function(){return!1};if(typeof document=="object"){var F=document.all;d.call(F)===d.call(document.all)&&(P=function(H){if((D||!H)&&(typeof H>"u"||typeof H=="object"))try{var f=d.call(H);return(f===b||f===S||f===$||f===p)&&H("")==null}catch{}return!1})}return isCallable=t?function(H){if(P(H))return!0;if(!H||typeof H!="function"&&typeof H!="object")return!1;try{t(H,null,r)}catch(f){if(f!==n)return!1}return!s(H)&&l(H)}:function(H){if(P(H))return!0;if(!H||typeof H!="function"&&typeof H!="object")return!1;if(N)return l(H);if(s(H))return!1;var f=d.call(H);return f!==m&&f!==v&&!/^\[object HTML/.test(f)?!1:l(H)},isCallable}var shams,hasRequiredShams;function requireShams(){if(hasRequiredShams)return shams;hasRequiredShams=1;var e=requireShams$1();return shams=function(){return e()&&!!Symbol.toStringTag},shams}var isDateObject$1,hasRequiredIsDateObject;function requireIsDateObject(){if(hasRequiredIsDateObject)return isDateObject$1;hasRequiredIsDateObject=1;var e=Date.prototype.getDay,t=function(l){try{return e.call(l),!0}catch{return!1}},r=Object.prototype.toString,n="[object Date]",i=requireShams()();return isDateObject$1=function(l){return typeof l!="object"||l===null?!1:i?t(l):r.call(l)===n},isDateObject$1}var isSymbol={exports:{}},hasRequiredIsSymbol;function requireIsSymbol(){if(hasRequiredIsSymbol)return isSymbol.exports;hasRequiredIsSymbol=1;var e=Object.prototype.toString,t=requireHasSymbols()();if(t){var r=Symbol.prototype.toString,n=/^Symbol\(.*\)$/,i=function(l){return typeof l.valueOf()!="symbol"?!1:n.test(r.call(l))};isSymbol.exports=function(l){if(typeof l=="symbol")return!0;if(e.call(l)!=="[object Symbol]")return!1;try{return i(l)}catch{return!1}}}else isSymbol.exports=function(l){return!1};return isSymbol.exports}var es2015,hasRequiredEs2015;function requireEs2015(){if(hasRequiredEs2015)return es2015;hasRequiredEs2015=1;var e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol",t=requireIsPrimitive(),r=requireIsCallable(),n=requireIsDateObject(),i=requireIsSymbol(),s=function(p,m){if(typeof p>"u"||p===null)throw new TypeError("Cannot call method on "+p);if(typeof m!="string"||m!=="number"&&m!=="string")throw new TypeError('hint must be "string" or "number"');var v=m==="string"?["toString","valueOf"]:["valueOf","toString"],b,S,$;for($=0;$1&&(arguments[1]===String?m="string":arguments[1]===Number&&(m="number"));var v;if(e&&(Symbol.toPrimitive?v=l(p,Symbol.toPrimitive):i(p)&&(v=Symbol.prototype.valueOf)),typeof v<"u"){var b=v.call(p,m);if(t(b))return b;throw new TypeError("unable to convert exotic object to primitive")}return m==="default"&&(n(p)||i(p))&&(m="string"),s(p,m==="default"?"number":m)},es2015}var ToPrimitive,hasRequiredToPrimitive;function requireToPrimitive(){if(hasRequiredToPrimitive)return ToPrimitive;hasRequiredToPrimitive=1;var e=requireEs2015();return ToPrimitive=function(r){return arguments.length>1?e(r,arguments[1]):e(r)},ToPrimitive}var callBind={exports:{}},setFunctionLength,hasRequiredSetFunctionLength;function requireSetFunctionLength(){if(hasRequiredSetFunctionLength)return setFunctionLength;hasRequiredSetFunctionLength=1;var e=requireGetIntrinsic(),t=requireDefineDataProperty(),r=requireHasPropertyDescriptors()(),n=requireGopd(),i=requireType$2(),s=e("%Math.floor%");return setFunctionLength=function(d,p){if(typeof d!="function")throw new i("`fn` is not a function");if(typeof p!="number"||p<0||p>4294967295||s(p)!==p)throw new i("`length` must be a positive 32-bit integer");var m=arguments.length>2&&!!arguments[2],v=!0,b=!0;if("length"in d&&n){var S=n(d,"length");S&&!S.configurable&&(v=!1),S&&!S.writable&&(b=!1)}return(v||b||!m)&&(r?t(d,"length",p,!0,!0):t(d,"length",p)),d},setFunctionLength}var applyBind,hasRequiredApplyBind;function requireApplyBind(){if(hasRequiredApplyBind)return applyBind;hasRequiredApplyBind=1;var e=requireFunctionBind(),t=requireFunctionApply(),r=requireActualApply();return applyBind=function(){return r(e,t,arguments)},applyBind}var hasRequiredCallBind;function requireCallBind(){return hasRequiredCallBind||(hasRequiredCallBind=1,function(e){var t=requireSetFunctionLength(),r=requireEsDefineProperty(),n=requireCallBindApplyHelpers(),i=requireApplyBind();e.exports=function(l){var d=n(arguments),p=l.length-(arguments.length-1);return t(d,1+(p>0?p:0),!0)},r?r(e.exports,"apply",{value:i}):e.exports.apply=i}(callBind)),callBind.exports}var callBound,hasRequiredCallBound;function requireCallBound(){if(hasRequiredCallBound)return callBound;hasRequiredCallBound=1;var e=requireGetIntrinsic(),t=requireCallBind(),r=t(e("String.prototype.indexOf"));return callBound=function(i,s){var l=e(i,!!s);return typeof l=="function"&&r(i,".prototype.")>-1?t(l):l},callBound}var isRegex$1,hasRequiredIsRegex;function requireIsRegex(){if(hasRequiredIsRegex)return isRegex$1;hasRequiredIsRegex=1;var e=requireCallBound(),t=requireShams()(),r,n,i,s;if(t){r=e("Object.prototype.hasOwnProperty"),n=e("RegExp.prototype.exec"),i={};var l=function(){throw i};s={toString:l,valueOf:l},typeof Symbol.toPrimitive=="symbol"&&(s[Symbol.toPrimitive]=l)}var d=e("Object.prototype.toString"),p=Object.getOwnPropertyDescriptor,m="[object RegExp]";return isRegex$1=t?function(b){if(!b||typeof b!="object")return!1;var S=p(b,"lastIndex"),$=S&&r(S,"value");if(!$)return!1;try{n(b,s)}catch(N){return N===i}}:function(b){return!b||typeof b!="object"&&typeof b!="function"?!1:d(b)===m},isRegex$1}var safeRegexTest,hasRequiredSafeRegexTest;function requireSafeRegexTest(){if(hasRequiredSafeRegexTest)return safeRegexTest;hasRequiredSafeRegexTest=1;var e=requireCallBound(),t=requireIsRegex(),r=e("RegExp.prototype.exec"),n=requireType$2();return safeRegexTest=function(s){if(!t(s))throw new n("`regex` must be a RegExp");return function(d){return r(s,d)!==null}},safeRegexTest}var RequireObjectCoercible,hasRequiredRequireObjectCoercible;function requireRequireObjectCoercible(){if(hasRequiredRequireObjectCoercible)return RequireObjectCoercible;hasRequiredRequireObjectCoercible=1;var e=requireType$2();return RequireObjectCoercible=function(r){if(r==null)throw new e(arguments.length>0&&arguments[1]||"Cannot call method on "+r);return r},RequireObjectCoercible}var ToString,hasRequiredToString;function requireToString(){if(hasRequiredToString)return ToString;hasRequiredToString=1;var e=requireGetIntrinsic(),t=e("%String%"),r=requireType$2();return ToString=function(i){if(typeof i=="symbol")throw new r("Cannot convert a Symbol value to a string");return t(i)},ToString}var implementation$1,hasRequiredImplementation$1;function requireImplementation$1(){if(hasRequiredImplementation$1)return implementation$1;hasRequiredImplementation$1=1;var e=requireRequireObjectCoercible(),t=requireToString(),r=requireCallBound(),n=r("String.prototype.replace"),i=/^\s$/.test("᠎"),s=i?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,l=i?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;return implementation$1=function(){var p=t(e(this));return n(n(p,s,""),l,"")},implementation$1}var polyfill$1,hasRequiredPolyfill$1;function requirePolyfill$1(){if(hasRequiredPolyfill$1)return polyfill$1;hasRequiredPolyfill$1=1;var e=requireImplementation$1(),t="​",r="᠎";return polyfill$1=function(){return String.prototype.trim&&t.trim()===t&&r.trim()===r&&("_"+r).trim()==="_"+r&&(r+"_").trim()===r+"_"?String.prototype.trim:e},polyfill$1}var shim$2,hasRequiredShim$2;function requireShim$2(){if(hasRequiredShim$2)return shim$2;hasRequiredShim$2=1;var e=requireDefineProperties(),t=requirePolyfill$1();return shim$2=function(){var n=t();return e(String.prototype,{trim:n},{trim:function(){return String.prototype.trim!==n}}),n},shim$2}var string_prototype_trim,hasRequiredString_prototype_trim;function requireString_prototype_trim(){if(hasRequiredString_prototype_trim)return string_prototype_trim;hasRequiredString_prototype_trim=1;var e=requireCallBind(),t=requireDefineProperties(),r=requireRequireObjectCoercible(),n=requireImplementation$1(),i=requirePolyfill$1(),s=requireShim$2(),l=e(i()),d=function(m){return r(m),l(m)};return t(d,{getPolyfill:i,implementation:n,shim:s}),string_prototype_trim=d,string_prototype_trim}var StringToNumber,hasRequiredStringToNumber;function requireStringToNumber(){if(hasRequiredStringToNumber)return StringToNumber;hasRequiredStringToNumber=1;var e=requireGetIntrinsic(),t=e("%Number%"),r=e("%RegExp%"),n=requireType$2(),i=e("%parseInt%"),s=requireCallBound(),l=requireSafeRegexTest(),d=s("String.prototype.slice"),p=l(/^0b[01]+$/i),m=l(/^0o[0-7]+$/i),v=l(/^[-+]0x[0-9a-f]+$/i),b=["…","​","￾"].join(""),S=new r("["+b+"]","g"),$=l(S),N=requireString_prototype_trim();return StringToNumber=function D(P){if(typeof P!="string")throw new n("Assertion failed: `argument` is not a String");if(p(P))return t(i(d(P,2),2));if(m(P))return t(i(d(P,2),8));if($(P)||v(P))return NaN;var F=N(P);return F!==P?D(F):t(P)},StringToNumber}var ToNumber,hasRequiredToNumber;function requireToNumber(){if(hasRequiredToNumber)return ToNumber;hasRequiredToNumber=1;var e=requireGetIntrinsic(),t=requireType$2(),r=e("%Number%"),n=requireIsPrimitive$1(),i=requireToPrimitive(),s=requireStringToNumber();return ToNumber=function(d){var p=n(d)?d:i(d,r);if(typeof p=="symbol")throw new t("Cannot convert a Symbol value to a number");if(typeof p=="bigint")throw new t("Conversion from 'BigInt' to 'number' is not allowed.");return typeof p=="string"?s(p):r(p)},ToNumber}var floor,hasRequiredFloor;function requireFloor(){if(hasRequiredFloor)return floor;hasRequiredFloor=1;var e=Math.floor;return floor=function(r){return typeof r=="bigint"?r:e(r)},floor}var truncate,hasRequiredTruncate;function requireTruncate(){if(hasRequiredTruncate)return truncate;hasRequiredTruncate=1;var e=requireFloor(),t=requireType$2();return truncate=function(n){if(typeof n!="number"&&typeof n!="bigint")throw new t("argument must be a Number or a BigInt");var i=n<0?-e(-n):e(n);return i===0?0:i},truncate}var _isNaN,hasRequired_isNaN;function require_isNaN(){return hasRequired_isNaN||(hasRequired_isNaN=1,_isNaN=Number.isNaN||function(t){return t!==t}),_isNaN}var _isFinite,hasRequired_isFinite;function require_isFinite(){if(hasRequired_isFinite)return _isFinite;hasRequired_isFinite=1;var e=require_isNaN();return _isFinite=function(t){return(typeof t=="number"||typeof t=="bigint")&&!e(t)&&t!==1/0&&t!==-1/0},_isFinite}var ToIntegerOrInfinity,hasRequiredToIntegerOrInfinity;function requireToIntegerOrInfinity(){if(hasRequiredToIntegerOrInfinity)return ToIntegerOrInfinity;hasRequiredToIntegerOrInfinity=1;var e=requireToNumber(),t=requireTruncate(),r=require_isNaN(),n=require_isFinite();return ToIntegerOrInfinity=function(s){var l=e(s);return r(l)||l===0?0:n(l)?t(l):l},ToIntegerOrInfinity}var ToLength,hasRequiredToLength;function requireToLength(){if(hasRequiredToLength)return ToLength;hasRequiredToLength=1;var e=requireMaxSafeInteger(),t=requireToIntegerOrInfinity();return ToLength=function(n){var i=t(n);return i<=0?0:i>e?e:i},ToLength}var LengthOfArrayLike,hasRequiredLengthOfArrayLike;function requireLengthOfArrayLike(){if(hasRequiredLengthOfArrayLike)return LengthOfArrayLike;hasRequiredLengthOfArrayLike=1;var e=requireType$2(),t=requireGet$1(),r=requireToLength(),n=requireType();return LengthOfArrayLike=function(s){if(n(s)!=="Object")throw new e("Assertion failed: `obj` must be an Object");return r(t(s,"length"))},LengthOfArrayLike}var ToObject,hasRequiredToObject;function requireToObject(){if(hasRequiredToObject)return ToObject;hasRequiredToObject=1;var e=requireEsObjectAtoms(),t=requireRequireObjectCoercible();return ToObject=function(n){return t(n),e(n)},ToObject}var implementation,hasRequiredImplementation;function requireImplementation(){if(hasRequiredImplementation)return implementation;hasRequiredImplementation=1;var e=requireGet$1(),t=requireLengthOfArrayLike(),r=requireToIntegerOrInfinity(),n=requireToObject(),i=requireToString();return implementation=function(l){var d=n(this),p=t(d),m=r(l),v=m>=0?m:p+m;if(!(v<0||v>=p))return e(d,i(v))},implementation}var polyfill,hasRequiredPolyfill;function requirePolyfill(){if(hasRequiredPolyfill)return polyfill;hasRequiredPolyfill=1;var e=requireImplementation();return polyfill=function(){return Array.prototype.at||e},polyfill}var shim$1,hasRequiredShim$1;function requireShim$1(){if(hasRequiredShim$1)return shim$1;hasRequiredShim$1=1;var e=requireDefineProperties(),t=requireEsShimUnscopables(),r=requirePolyfill();return shim$1=function(){var i=r();return e(Array.prototype,{at:i},{at:function(){return Array.prototype.at!==i}}),t("at"),i},shim$1}var hasRequiredAuto;function requireAuto(){return hasRequiredAuto||(hasRequiredAuto=1,requireShim$1()()),auto}requireAuto();var client={},reactDom={exports:{}},reactDom_production_min={},react={exports:{}},react_production_min={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hasRequiredReact_production_min;function requireReact_production_min(){if(hasRequiredReact_production_min)return react_production_min;hasRequiredReact_production_min=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.iterator;function S(O){return O===null||typeof O!="object"?null:(O=b&&O[b]||O["@@iterator"],typeof O=="function"?O:null)}var $={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,D={};function P(O,ne,xe){this.props=O,this.context=ne,this.refs=D,this.updater=xe||$}P.prototype.isReactComponent={},P.prototype.setState=function(O,ne){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,ne,"setState")},P.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function F(){}F.prototype=P.prototype;function q(O,ne,xe){this.props=O,this.context=ne,this.refs=D,this.updater=xe||$}var H=q.prototype=new F;H.constructor=q,N(H,P.prototype),H.isPureReactComponent=!0;var f=Array.isArray,w=Object.prototype.hasOwnProperty,g={current:null},C={key:!0,ref:!0,__self:!0,__source:!0};function _(O,ne,xe){var $e,Ee={},be=null,ge=null;if(ne!=null)for($e in ne.ref!==void 0&&(ge=ne.ref),ne.key!==void 0&&(be=""+ne.key),ne)w.call(ne,$e)&&!C.hasOwnProperty($e)&&(Ee[$e]=ne[$e]);var ve=arguments.length-2;if(ve===1)Ee.children=xe;else if(1>>1,ne=W[O];if(0>>1;Oi(Ee,ae))bei(ge,Ee)?(W[O]=ge,W[be]=ae,O=be):(W[O]=Ee,W[$e]=ae,O=$e);else if(bei(ge,ae))W[O]=ge,W[be]=ae,O=be;else break e}}return oe}function i(W,oe){var ae=W.sortIndex-oe.sortIndex;return ae!==0?ae:W.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,d=l.now();e.unstable_now=function(){return l.now()-d}}var p=[],m=[],v=1,b=null,S=3,$=!1,N=!1,D=!1,P=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function H(W){for(var oe=r(m);oe!==null;){if(oe.callback===null)n(m);else if(oe.startTime<=W)n(m),oe.sortIndex=oe.expirationTime,t(p,oe);else break;oe=r(m)}}function f(W){if(D=!1,H(W),!N)if(r(p)!==null)N=!0,E(w);else{var oe=r(m);oe!==null&&Y(f,oe.startTime-W)}}function w(W,oe){N=!1,D&&(D=!1,F(_),_=-1),$=!0;var ae=S;try{for(H(oe),b=r(p);b!==null&&(!(b.expirationTime>oe)||W&&!L());){var O=b.callback;if(typeof O=="function"){b.callback=null,S=b.priorityLevel;var ne=O(b.expirationTime<=oe);oe=e.unstable_now(),typeof ne=="function"?b.callback=ne:b===r(p)&&n(p),H(oe)}else n(p);b=r(p)}if(b!==null)var xe=!0;else{var $e=r(m);$e!==null&&Y(f,$e.startTime-oe),xe=!1}return xe}finally{b=null,S=ae,$=!1}}var g=!1,C=null,_=-1,A=5,k=-1;function L(){return!(e.unstable_now()-kW||125O?(W.sortIndex=ae,t(m,W),r(p)===null&&W===r(m)&&(D?(F(_),_=-1):D=!0,Y(f,ae-O))):(W.sortIndex=ne,t(p,W),N||$||(N=!0,E(w))),W},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(W){var oe=S;return function(){var ae=S;S=oe;try{return W.apply(this,arguments)}finally{S=ae}}}}(scheduler_production_min)),scheduler_production_min}var hasRequiredScheduler;function requireScheduler(){return hasRequiredScheduler||(hasRequiredScheduler=1,scheduler.exports=requireScheduler_production_min()),scheduler.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hasRequiredReactDom_production_min;function requireReactDom_production_min(){if(hasRequiredReactDom_production_min)return reactDom_production_min;hasRequiredReactDom_production_min=1;var e=requireReact(),t=requireScheduler();function r(o){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+o,u=1;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,m=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v={},b={};function S(o){return p.call(b,o)?!0:p.call(v,o)?!1:m.test(o)?b[o]=!0:(v[o]=!0,!1)}function $(o,a,u,c){if(u!==null&&u.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return c?!1:u!==null?!u.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function N(o,a,u,c){if(a===null||typeof a>"u"||$(o,a,u,c))return!0;if(c)return!1;if(u!==null)switch(u.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function D(o,a,u,c,h,y,x){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=c,this.attributeNamespace=h,this.mustUseProperty=u,this.propertyName=o,this.type=a,this.sanitizeURL=y,this.removeEmptyString=x}var P={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){P[o]=new D(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var a=o[0];P[a]=new D(a,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){P[o]=new D(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){P[o]=new D(o,2,!1,o,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){P[o]=new D(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){P[o]=new D(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){P[o]=new D(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){P[o]=new D(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){P[o]=new D(o,5,!1,o.toLowerCase(),null,!1,!1)});var F=/[\-:]([a-z])/g;function q(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var a=o.replace(F,q);P[a]=new D(a,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var a=o.replace(F,q);P[a]=new D(a,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var a=o.replace(F,q);P[a]=new D(a,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){P[o]=new D(o,1,!1,o.toLowerCase(),null,!1,!1)}),P.xlinkHref=new D("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){P[o]=new D(o,1,!1,o.toLowerCase(),null,!0,!0)});function H(o,a,u,c){var h=P.hasOwnProperty(a)?P[a]:null;(h!==null?h.type!==0:c||!(2R||h[x]!==y[R]){var U=` `+h[x].replace(" at new "," at ");return o.displayName&&U.includes("")&&(U=U.replace("",o.displayName)),U}while(1<=x&&0<=R);break}}}finally{xe=!1,Error.prepareStackTrace=u}return(o=o?o.displayName||o.name:"")?ne(o):""}function Ee(o){switch(o.tag){case 5:return ne(o.type);case 16:return ne("Lazy");case 13:return ne("Suspense");case 19:return ne("SuspenseList");case 0:case 2:case 15:return o=$e(o.type,!1),o;case 11:return o=$e(o.type.render,!1),o;case 1:return o=$e(o.type,!0),o;default:return""}}function be(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case C:return"Fragment";case g:return"Portal";case A:return"Profiler";case _:return"StrictMode";case K:return"Suspense";case J:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case L:return(o.displayName||"Context")+".Consumer";case k:return(o._context.displayName||"Context")+".Provider";case re:var a=o.render;return o=o.displayName,o||(o=a.displayName||a.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case ee:return a=o.displayName||null,a!==null?a:be(o.type)||"Memo";case E:a=o._payload,o=o._init;try{return be(o(a))}catch{}}return null}function ge(o){var a=o.type;switch(o.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=a.render,o=o.displayName||o.name||"",a.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return be(a);case 8:return a===_?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function ve(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Ie(o){var a=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function De(o){var a=Ie(o)?"checked":"value",u=Object.getOwnPropertyDescriptor(o.constructor.prototype,a),c=""+o[a];if(!o.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var h=u.get,y=u.set;return Object.defineProperty(o,a,{configurable:!0,get:function(){return h.call(this)},set:function(x){c=""+x,y.call(this,x)}}),Object.defineProperty(o,a,{enumerable:u.enumerable}),{getValue:function(){return c},setValue:function(x){c=""+x},stopTracking:function(){o._valueTracker=null,delete o[a]}}}}function Ve(o){o._valueTracker||(o._valueTracker=De(o))}function Xe(o){if(!o)return!1;var a=o._valueTracker;if(!a)return!0;var u=a.getValue(),c="";return o&&(c=Ie(o)?o.checked?"true":"false":o.value),o=c,o!==u?(a.setValue(o),!0):!1}function Be(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function ht(o,a){var u=a.checked;return ae({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??o._wrapperState.initialChecked})}function bt(o,a){var u=a.defaultValue==null?"":a.defaultValue,c=a.checked!=null?a.checked:a.defaultChecked;u=ve(a.value!=null?a.value:u),o._wrapperState={initialChecked:c,initialValue:u,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function M(o,a){a=a.checked,a!=null&&H(o,"checked",a,!1)}function B(o,a){M(o,a);var u=ve(a.value),c=a.type;if(u!=null)c==="number"?(u===0&&o.value===""||o.value!=u)&&(o.value=""+u):o.value!==""+u&&(o.value=""+u);else if(c==="submit"||c==="reset"){o.removeAttribute("value");return}a.hasOwnProperty("value")?ue(o,a.type,u):a.hasOwnProperty("defaultValue")&&ue(o,a.type,ve(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(o.defaultChecked=!!a.defaultChecked)}function G(o,a,u){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var c=a.type;if(!(c!=="submit"&&c!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+o._wrapperState.initialValue,u||a===o.value||(o.value=a),o.defaultValue=a}u=o.name,u!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,u!==""&&(o.name=u)}function ue(o,a,u){(a!=="number"||Be(o.ownerDocument)!==o)&&(u==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+u&&(o.defaultValue=""+u))}var le=Array.isArray;function ie(o,a,u,c){if(o=o.options,a){a={};for(var h=0;h"+a.valueOf().toString()+"",a=dt.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;a.firstChild;)o.appendChild(a.firstChild)}});function nt(o,a){if(a){var u=o.firstChild;if(u&&u===o.lastChild&&u.nodeType===3){u.nodeValue=a;return}}o.textContent=a}var Dt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},I=["Webkit","ms","Moz","O"];Object.keys(Dt).forEach(function(o){I.forEach(function(a){a=a+o.charAt(0).toUpperCase()+o.substring(1),Dt[a]=Dt[o]})});function V(o,a,u){return a==null||typeof a=="boolean"||a===""?"":u||typeof a!="number"||a===0||Dt.hasOwnProperty(o)&&Dt[o]?(""+a).trim():a+"px"}function se(o,a){o=o.style;for(var u in a)if(a.hasOwnProperty(u)){var c=u.indexOf("--")===0,h=V(u,a[u],c);u==="float"&&(u="cssFloat"),c?o.setProperty(u,h):o[u]=h}}var T=ae({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function j(o,a){if(a){if(T[o]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(r(137,o));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(r(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(r(61))}if(a.style!=null&&typeof a.style!="object")throw Error(r(62))}}function pe(o,a){if(o.indexOf("-")===-1)return typeof a.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ye=null;function Te(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var we=null,Fe=null,Le=null;function ze(o){if(o=Zn(o)){if(typeof we!="function")throw Error(r(280));var a=o.stateNode;a&&(a=ko(a),we(o.stateNode,o.type,a))}}function Ke(o){Fe?Le?Le.push(o):Le=[o]:Fe=o}function kt(){if(Fe){var o=Fe,a=Le;if(Le=Fe=null,ze(o),a)for(o=0;o>>=0,o===0?32:31-(El(o)/Il|0)|0}var fo=64,po=4194304;function En(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function ho(o,a){var u=o.pendingLanes;if(u===0)return 0;var c=0,h=o.suspendedLanes,y=o.pingedLanes,x=u&268435455;if(x!==0){var R=x&~h;R!==0?c=En(R):(y&=x,y!==0&&(c=En(y)))}else x=u&~h,x!==0?c=En(x):y!==0&&(c=En(y));if(c===0)return 0;if(a!==0&&a!==c&&(a&h)===0&&(h=c&-c,y=a&-a,h>=y||h===16&&(y&4194240)!==0))return a;if((c&4)!==0&&(c|=u&16),a=o.entangledLanes,a!==0)for(o=o.entanglements,a&=c;0u;u++)a.push(o);return a}function In(o,a,u){o.pendingLanes|=a,a!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,a=31-Vt(a),o[a]=u}function Al(o,a){var u=o.pendingLanes&~a;o.pendingLanes=a,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=a,o.mutableReadLanes&=a,o.entangledLanes&=a,a=o.entanglements;var c=o.eventTimes;for(o=o.expirationTimes;0=jn),hs=" ",ms=!1;function ys(o,a){switch(o){case"keyup":return ic.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gs(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var rn=!1;function uc(o,a){switch(o){case"compositionend":return gs(a);case"keypress":return a.which!==32?null:(ms=!0,hs);case"textInput":return o=a.data,o===hs&&ms?null:o;default:return null}}function lc(o,a){if(rn)return o==="compositionend"||!Ta&&ys(o,a)?(o=us(),wo=Ca=Sr=null,rn=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1=a)return{node:u,offset:a-o};o=c}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=_s(u)}}function Ps(o,a){return o&&a?o===a?!0:o&&o.nodeType===3?!1:a&&a.nodeType===3?Ps(o,a.parentNode):"contains"in o?o.contains(a):o.compareDocumentPosition?!!(o.compareDocumentPosition(a)&16):!1:!1}function Es(){for(var o=window,a=Be();a instanceof o.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)o=a.contentWindow;else break;a=Be(o.document)}return a}function Aa(o){var a=o&&o.nodeName&&o.nodeName.toLowerCase();return a&&(a==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||a==="textarea"||o.contentEditable==="true")}function vc(o){var a=Es(),u=o.focusedElem,c=o.selectionRange;if(a!==u&&u&&u.ownerDocument&&Ps(u.ownerDocument.documentElement,u)){if(c!==null&&Aa(u)){if(a=c.start,o=c.end,o===void 0&&(o=a),"selectionStart"in u)u.selectionStart=a,u.selectionEnd=Math.min(o,u.value.length);else if(o=(a=u.ownerDocument||document)&&a.defaultView||window,o.getSelection){o=o.getSelection();var h=u.textContent.length,y=Math.min(c.start,h);c=c.end===void 0?y:Math.min(c.end,h),!o.extend&&y>c&&(h=c,c=y,y=h),h=$s(u,y);var x=$s(u,c);h&&x&&(o.rangeCount!==1||o.anchorNode!==h.node||o.anchorOffset!==h.offset||o.focusNode!==x.node||o.focusOffset!==x.offset)&&(a=a.createRange(),a.setStart(h.node,h.offset),o.removeAllRanges(),y>c?(o.addRange(a),o.extend(x.node,x.offset)):(a.setEnd(x.node,x.offset),o.addRange(a)))}}for(a=[],o=u;o=o.parentNode;)o.nodeType===1&&a.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u=document.documentMode,nn=null,Ra=null,zn=null,Oa=!1;function Is(o,a,u){var c=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Oa||nn==null||nn!==Be(c)||(c=nn,"selectionStart"in c&&Aa(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),zn&&Mn(zn,c)||(zn=c,c=Eo(Ra,"onSelect"),0ln||(o.current=Ha[ln],Ha[ln]=null,ln--)}function Ze(o,a){ln++,Ha[ln]=o.current,o.current=a}var $r={},mt=_r($r),$t=_r(!1),Mr=$r;function cn(o,a){var u=o.type.contextTypes;if(!u)return $r;var c=o.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===a)return c.__reactInternalMemoizedMaskedChildContext;var h={},y;for(y in u)h[y]=a[y];return c&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=a,o.__reactInternalMemoizedMaskedChildContext=h),h}function Pt(o){return o=o.childContextTypes,o!=null}function No(){Ge($t),Ge(mt)}function qs(o,a,u){if(mt.current!==$r)throw Error(r(168));Ze(mt,a),Ze($t,u)}function Vs(o,a,u){var c=o.stateNode;if(a=a.childContextTypes,typeof c.getChildContext!="function")return u;c=c.getChildContext();for(var h in c)if(!(h in a))throw Error(r(108,ge(o)||"Unknown",h));return ae({},u,c)}function Ao(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||$r,Mr=mt.current,Ze(mt,o),Ze($t,$t.current),!0}function Zs(o,a,u){var c=o.stateNode;if(!c)throw Error(r(169));u?(o=Vs(o,a,Mr),c.__reactInternalMemoizedMergedChildContext=o,Ge($t),Ge(mt),Ze(mt,o)):Ge($t),Ze($t,u)}var sr=null,Ro=!1,Ga=!1;function Hs(o){sr===null?sr=[o]:sr.push(o)}function kc(o){Ro=!0,Hs(o)}function Pr(){if(!Ga&&sr!==null){Ga=!0;var o=0,a=qe;try{var u=sr;for(qe=1;o>=x,h-=x,ur=1<<32-Vt(a)+h|u<Oe?(ct=Re,Re=null):ct=Re.sibling;var Ue=ce(Q,Re,X[Oe],he);if(Ue===null){Re===null&&(Re=ct);break}o&&Re&&Ue.alternate===null&&a(Q,Re),Z=y(Ue,Z,Oe),Ae===null?ke=Ue:Ae.sibling=Ue,Ae=Ue,Re=ct}if(Oe===X.length)return u(Q,Re),We&&Ur(Q,Oe),ke;if(Re===null){for(;OeOe?(ct=Re,Re=null):ct=Re.sibling;var Dr=ce(Q,Re,Ue.value,he);if(Dr===null){Re===null&&(Re=ct);break}o&&Re&&Dr.alternate===null&&a(Q,Re),Z=y(Dr,Z,Oe),Ae===null?ke=Dr:Ae.sibling=Dr,Ae=Dr,Re=ct}if(Ue.done)return u(Q,Re),We&&Ur(Q,Oe),ke;if(Re===null){for(;!Ue.done;Oe++,Ue=X.next())Ue=fe(Q,Ue.value,he),Ue!==null&&(Z=y(Ue,Z,Oe),Ae===null?ke=Ue:Ae.sibling=Ue,Ae=Ue);return We&&Ur(Q,Oe),ke}for(Re=c(Q,Re);!Ue.done;Oe++,Ue=X.next())Ue=Se(Re,Q,Oe,Ue.value,he),Ue!==null&&(o&&Ue.alternate!==null&&Re.delete(Ue.key===null?Oe:Ue.key),Z=y(Ue,Z,Oe),Ae===null?ke=Ue:Ae.sibling=Ue,Ae=Ue);return o&&Re.forEach(function(cd){return a(Q,cd)}),We&&Ur(Q,Oe),ke}function rt(Q,Z,X,he){if(typeof X=="object"&&X!==null&&X.type===C&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case w:e:{for(var ke=X.key,Ae=Z;Ae!==null;){if(Ae.key===ke){if(ke=X.type,ke===C){if(Ae.tag===7){u(Q,Ae.sibling),Z=h(Ae,X.props.children),Z.return=Q,Q=Z;break e}}else if(Ae.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===E&&iu(ke)===Ae.type){u(Q,Ae.sibling),Z=h(Ae,X.props),Z.ref=Hn(Q,Ae,X),Z.return=Q,Q=Z;break e}u(Q,Ae);break}else a(Q,Ae);Ae=Ae.sibling}X.type===C?(Z=Kr(X.props.children,Q.mode,he,X.key),Z.return=Q,Q=Z):(he=sa(X.type,X.key,X.props,null,Q.mode,he),he.ref=Hn(Q,Z,X),he.return=Q,Q=he)}return x(Q);case g:e:{for(Ae=X.key;Z!==null;){if(Z.key===Ae)if(Z.tag===4&&Z.stateNode.containerInfo===X.containerInfo&&Z.stateNode.implementation===X.implementation){u(Q,Z.sibling),Z=h(Z,X.children||[]),Z.return=Q,Q=Z;break e}else{u(Q,Z);break}else a(Q,Z);Z=Z.sibling}Z=Vi(X,Q.mode,he),Z.return=Q,Q=Z}return x(Q);case E:return Ae=X._init,rt(Q,Z,Ae(X._payload),he)}if(le(X))return _e(Q,Z,X,he);if(oe(X))return Pe(Q,Z,X,he);Bo(Q,X)}return typeof X=="string"&&X!==""||typeof X=="number"?(X=""+X,Z!==null&&Z.tag===6?(u(Q,Z.sibling),Z=h(Z,X),Z.return=Q,Q=Z):(u(Q,Z),Z=qi(X,Q.mode,he),Z.return=Q,Q=Z),x(Q)):u(Q,Z)}return rt}var yn=su(!0),uu=su(!1),Gn={},er=_r(Gn),Wn=_r(Gn),Kn=_r(Gn);function qr(o){if(o===Gn)throw Error(r(174));return o}function si(o,a){switch(Ze(Kn,a),Ze(Wn,o),Ze(er,Gn),o=a.nodeType,o){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:St(null,"");break;default:o=o===8?a.parentNode:a,a=o.namespaceURI||null,o=o.tagName,a=St(a,o)}Ge(er),Ze(er,a)}function gn(){Ge(er),Ge(Wn),Ge(Kn)}function lu(o){qr(Kn.current);var a=qr(er.current),u=St(a,o.type);a!==u&&(Ze(Wn,o),Ze(er,u))}function ui(o){Wn.current===o&&(Ge(er),Ge(Wn))}var Qe=_r(0);function qo(o){for(var a=o;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var li=[];function ci(){for(var o=0;ou?u:4,o(!0);var c=di.transition;di.transition={};try{o(!1),a()}finally{qe=u,di.transition=c}}function Eu(){return Mt().memoizedState}function Oc(o,a,u){var c=Ar(o);if(u={lane:c,action:u,hasEagerState:!1,eagerState:null,next:null},Iu(o))Tu(a,u);else if(u=Xs(o,a,u,c),u!==null){var h=Ct();Qt(u,o,c,h),ku(u,a,c)}}function Dc(o,a,u){var c=Ar(o),h={lane:c,action:u,hasEagerState:!1,eagerState:null,next:null};if(Iu(o))Tu(a,h);else{var y=o.alternate;if(o.lanes===0&&(y===null||y.lanes===0)&&(y=a.lastRenderedReducer,y!==null))try{var x=a.lastRenderedState,R=y(x,u);if(h.hasEagerState=!0,h.eagerState=R,Zt(R,x)){var U=a.interleaved;U===null?(h.next=h,ni(a)):(h.next=U.next,U.next=h),a.interleaved=h;return}}catch{}finally{}u=Xs(o,a,h,c),u!==null&&(h=Ct(),Qt(u,o,c,h),ku(u,a,c))}}function Iu(o){var a=o.alternate;return o===Ye||a!==null&&a===Ye}function Tu(o,a){Qn=Zo=!0;var u=o.pending;u===null?a.next=a:(a.next=u.next,u.next=a),o.pending=a}function ku(o,a,u){if((u&4194240)!==0){var c=a.lanes;c&=o.pendingLanes,u|=c,a.lanes=u,va(o,u)}}var Wo={readContext:Lt,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useInsertionEffect:yt,useLayoutEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useMutableSource:yt,useSyncExternalStore:yt,useId:yt,unstable_isNewReconciler:!1},jc={readContext:Lt,useCallback:function(o,a){return tr().memoizedState=[o,a===void 0?null:a],o},useContext:Lt,useEffect:wu,useImperativeHandle:function(o,a,u){return u=u!=null?u.concat([o]):null,Ho(4194308,4,xu.bind(null,a,o),u)},useLayoutEffect:function(o,a){return Ho(4194308,4,o,a)},useInsertionEffect:function(o,a){return Ho(4,2,o,a)},useMemo:function(o,a){var u=tr();return a=a===void 0?null:a,o=o(),u.memoizedState=[o,a],o},useReducer:function(o,a,u){var c=tr();return a=u!==void 0?u(a):a,c.memoizedState=c.baseState=a,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:a},c.queue=o,o=o.dispatch=Oc.bind(null,Ye,o),[c.memoizedState,o]},useRef:function(o){var a=tr();return o={current:o},a.memoizedState=o},useState:gu,useDebugValue:vi,useDeferredValue:function(o){return tr().memoizedState=o},useTransition:function(){var o=gu(!1),a=o[0];return o=Rc.bind(null,o[1]),tr().memoizedState=o,[a,o]},useMutableSource:function(){},useSyncExternalStore:function(o,a,u){var c=Ye,h=tr();if(We){if(u===void 0)throw Error(r(407));u=u()}else{if(u=a(),lt===null)throw Error(r(349));(Vr&30)!==0||fu(c,a,u)}h.memoizedState=u;var y={value:u,getSnapshot:a};return h.queue=y,wu(hu.bind(null,c,y,o),[o]),c.flags|=2048,Jn(9,pu.bind(null,c,y,u,a),void 0,null),u},useId:function(){var o=tr(),a=lt.identifierPrefix;if(We){var u=lr,c=ur;u=(c&~(1<<32-Vt(c)-1)).toString(32)+u,a=":"+a+"R"+u,u=Yn++,0<\/script>",o=o.removeChild(o.firstChild)):typeof c.is=="string"?o=x.createElement(u,{is:c.is}):(o=x.createElement(u),u==="select"&&(x=o,c.multiple?x.multiple=!0:c.size&&(x.size=c.size))):o=x.createElementNS(o,u),o[Jt]=a,o[Vn]=c,Gu(o,a,!1,!1),a.stateNode=o;e:{switch(x=pe(u,c),u){case"dialog":He("cancel",o),He("close",o),h=c;break;case"iframe":case"object":case"embed":He("load",o),h=c;break;case"video":case"audio":for(h=0;hSn&&(a.flags|=128,c=!0,eo(y,!1),a.lanes=4194304)}else{if(!c)if(o=qo(x),o!==null){if(a.flags|=128,c=!0,u=o.updateQueue,u!==null&&(a.updateQueue=u,a.flags|=4),eo(y,!0),y.tail===null&&y.tailMode==="hidden"&&!x.alternate&&!We)return gt(a),null}else 2*tt()-y.renderingStartTime>Sn&&u!==1073741824&&(a.flags|=128,c=!0,eo(y,!1),a.lanes=4194304);y.isBackwards?(x.sibling=a.child,a.child=x):(u=y.last,u!==null?u.sibling=x:a.child=x,y.last=x)}return y.tail!==null?(a=y.tail,y.rendering=a,y.tail=a.sibling,y.renderingStartTime=tt(),a.sibling=null,u=Qe.current,Ze(Qe,c?u&1|2:u&1),a):(gt(a),null);case 22:case 23:return zi(),c=a.memoizedState!==null,o!==null&&o.memoizedState!==null!==c&&(a.flags|=8192),c&&(a.mode&1)!==0?(Ot&1073741824)!==0&&(gt(a),a.subtreeFlags&6&&(a.flags|=8192)):gt(a),null;case 24:return null;case 25:return null}throw Error(r(156,a.tag))}function Vc(o,a){switch(Ka(a),a.tag){case 1:return Pt(a.type)&&No(),o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 3:return gn(),Ge($t),Ge(mt),ci(),o=a.flags,(o&65536)!==0&&(o&128)===0?(a.flags=o&-65537|128,a):null;case 5:return ui(a),null;case 13:if(Ge(Qe),o=a.memoizedState,o!==null&&o.dehydrated!==null){if(a.alternate===null)throw Error(r(340));pn()}return o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 19:return Ge(Qe),null;case 4:return gn(),null;case 10:return ti(a.type._context),null;case 22:case 23:return zi(),null;case 24:return null;default:return null}}var Yo=!1,vt=!1,Zc=typeof WeakSet=="function"?WeakSet:Set,Ce=null;function wn(o,a){var u=o.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(c){et(o,a,c)}else u.current=null}function Ii(o,a,u){try{u()}catch(c){et(o,a,c)}}var Qu=!1;function Hc(o,a){if(za=go,o=Es(),Aa(o)){if("selectionStart"in o)var u={start:o.selectionStart,end:o.selectionEnd};else e:{u=(u=o.ownerDocument)&&u.defaultView||window;var c=u.getSelection&&u.getSelection();if(c&&c.rangeCount!==0){u=c.anchorNode;var h=c.anchorOffset,y=c.focusNode;c=c.focusOffset;try{u.nodeType,y.nodeType}catch{u=null;break e}var x=0,R=-1,U=-1,te=0,de=0,fe=o,ce=null;t:for(;;){for(var Se;fe!==u||h!==0&&fe.nodeType!==3||(R=x+h),fe!==y||c!==0&&fe.nodeType!==3||(U=x+c),fe.nodeType===3&&(x+=fe.nodeValue.length),(Se=fe.firstChild)!==null;)ce=fe,fe=Se;for(;;){if(fe===o)break t;if(ce===u&&++te===h&&(R=x),ce===y&&++de===c&&(U=x),(Se=fe.nextSibling)!==null)break;fe=ce,ce=fe.parentNode}fe=Se}u=R===-1||U===-1?null:{start:R,end:U}}else u=null}u=u||{start:0,end:0}}else u=null;for(Ua={focusedElem:o,selectionRange:u},go=!1,Ce=a;Ce!==null;)if(a=Ce,o=a.child,(a.subtreeFlags&1028)!==0&&o!==null)o.return=a,Ce=o;else for(;Ce!==null;){a=Ce;try{var _e=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if(_e!==null){var Pe=_e.memoizedProps,rt=_e.memoizedState,Q=a.stateNode,Z=Q.getSnapshotBeforeUpdate(a.elementType===a.type?Pe:Gt(a.type,Pe),rt);Q.__reactInternalSnapshotBeforeUpdate=Z}break;case 3:var X=a.stateNode.containerInfo;X.nodeType===1?X.textContent="":X.nodeType===9&&X.documentElement&&X.removeChild(X.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(he){et(a,a.return,he)}if(o=a.sibling,o!==null){o.return=a.return,Ce=o;break}Ce=a.return}return _e=Qu,Qu=!1,_e}function to(o,a,u){var c=a.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var h=c=c.next;do{if((h.tag&o)===o){var y=h.destroy;h.destroy=void 0,y!==void 0&&Ii(a,u,y)}h=h.next}while(h!==c)}}function Xo(o,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var u=a=a.next;do{if((u.tag&o)===o){var c=u.create;u.destroy=c()}u=u.next}while(u!==a)}}function Ti(o){var a=o.ref;if(a!==null){var u=o.stateNode;switch(o.tag){case 5:o=u;break;default:o=u}typeof a=="function"?a(o):a.current=o}}function Yu(o){var a=o.alternate;a!==null&&(o.alternate=null,Yu(a)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(a=o.stateNode,a!==null&&(delete a[Jt],delete a[Vn],delete a[Za],delete a[Ic],delete a[Tc])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Xu(o){return o.tag===5||o.tag===3||o.tag===4}function Ju(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Xu(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function ki(o,a,u){var c=o.tag;if(c===5||c===6)o=o.stateNode,a?u.nodeType===8?u.parentNode.insertBefore(o,a):u.insertBefore(o,a):(u.nodeType===8?(a=u.parentNode,a.insertBefore(o,u)):(a=u,a.appendChild(o)),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=To));else if(c!==4&&(o=o.child,o!==null))for(ki(o,a,u),o=o.sibling;o!==null;)ki(o,a,u),o=o.sibling}function Ni(o,a,u){var c=o.tag;if(c===5||c===6)o=o.stateNode,a?u.insertBefore(o,a):u.appendChild(o);else if(c!==4&&(o=o.child,o!==null))for(Ni(o,a,u),o=o.sibling;o!==null;)Ni(o,a,u),o=o.sibling}var ft=null,Wt=!1;function Tr(o,a,u){for(u=u.child;u!==null;)el(o,a,u),u=u.sibling}function el(o,a,u){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(co,u)}catch{}switch(u.tag){case 5:vt||wn(u,a);case 6:var c=ft,h=Wt;ft=null,Tr(o,a,u),ft=c,Wt=h,ft!==null&&(Wt?(o=ft,u=u.stateNode,o.nodeType===8?o.parentNode.removeChild(u):o.removeChild(u)):ft.removeChild(u.stateNode));break;case 18:ft!==null&&(Wt?(o=ft,u=u.stateNode,o.nodeType===8?Va(o.parentNode,u):o.nodeType===1&&Va(o,u),Rn(o)):Va(ft,u.stateNode));break;case 4:c=ft,h=Wt,ft=u.stateNode.containerInfo,Wt=!0,Tr(o,a,u),ft=c,Wt=h;break;case 0:case 11:case 14:case 15:if(!vt&&(c=u.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){h=c=c.next;do{var y=h,x=y.destroy;y=y.tag,x!==void 0&&((y&2)!==0||(y&4)!==0)&&Ii(u,a,x),h=h.next}while(h!==c)}Tr(o,a,u);break;case 1:if(!vt&&(wn(u,a),c=u.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=u.memoizedProps,c.state=u.memoizedState,c.componentWillUnmount()}catch(R){et(u,a,R)}Tr(o,a,u);break;case 21:Tr(o,a,u);break;case 22:u.mode&1?(vt=(c=vt)||u.memoizedState!==null,Tr(o,a,u),vt=c):Tr(o,a,u);break;default:Tr(o,a,u)}}function tl(o){var a=o.updateQueue;if(a!==null){o.updateQueue=null;var u=o.stateNode;u===null&&(u=o.stateNode=new Zc),a.forEach(function(c){var h=td.bind(null,o,c);u.has(c)||(u.add(c),c.then(h,h))})}}function Kt(o,a){var u=a.deletions;if(u!==null)for(var c=0;ch&&(h=x),c&=~y}if(c=h,c=tt()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*Wc(c/1960))-c,10o?16:o,Nr===null)var c=!1;else{if(o=Nr,Nr=null,na=0,(Me&6)!==0)throw Error(r(331));var h=Me;for(Me|=4,Ce=o.current;Ce!==null;){var y=Ce,x=y.child;if((Ce.flags&16)!==0){var R=y.deletions;if(R!==null){for(var U=0;Utt()-Oi?Gr(o,0):Ri|=u),Tt(o,a)}function hl(o,a){a===0&&((o.mode&1)===0?a=1:(a=po,po<<=1,(po&130023424)===0&&(po=4194304)));var u=Ct();o=cr(o,a),o!==null&&(In(o,a,u),Tt(o,u))}function ed(o){var a=o.memoizedState,u=0;a!==null&&(u=a.retryLane),hl(o,u)}function td(o,a){var u=0;switch(o.tag){case 13:var c=o.stateNode,h=o.memoizedState;h!==null&&(u=h.retryLane);break;case 19:c=o.stateNode;break;default:throw Error(r(314))}c!==null&&c.delete(a),hl(o,u)}var ml;ml=function(o,a,u){if(o!==null)if(o.memoizedProps!==a.pendingProps||$t.current)Et=!0;else{if((o.lanes&u)===0&&(a.flags&128)===0)return Et=!1,Bc(o,a,u);Et=(o.flags&131072)!==0}else Et=!1,We&&(a.flags&1048576)!==0&&Gs(a,Do,a.index);switch(a.lanes=0,a.tag){case 2:var c=a.type;Qo(o,a),o=a.pendingProps;var h=cn(a,mt.current);mn(a,u),h=pi(null,a,c,o,h,u);var y=hi();return a.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,Pt(c)?(y=!0,Ao(a)):y=!1,a.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,oi(a),h.updater=Uo,a.stateNode=h,h._reactInternals=a,ii(a,c,o,u),a=xi(null,a,c,!0,y,u)):(a.tag=0,We&&y&&Wa(a),xt(null,a,h,u),a=a.child),a;case 16:c=a.elementType;e:{switch(Qo(o,a),o=a.pendingProps,h=c._init,c=h(c._payload),a.type=c,h=a.tag=nd(c),o=Gt(c,o),h){case 0:a=Si(null,a,c,o,u);break e;case 1:a=Uu(null,a,c,o,u);break e;case 11:a=ju(null,a,c,o,u);break e;case 14:a=Fu(null,a,c,Gt(c.type,o),u);break e}throw Error(r(306,c,""))}return a;case 0:return c=a.type,h=a.pendingProps,h=a.elementType===c?h:Gt(c,h),Si(o,a,c,h,u);case 1:return c=a.type,h=a.pendingProps,h=a.elementType===c?h:Gt(c,h),Uu(o,a,c,h,u);case 3:e:{if(Bu(a),o===null)throw Error(r(387));c=a.pendingProps,y=a.memoizedState,h=y.element,Js(o,a),zo(a,c,null,u);var x=a.memoizedState;if(c=x.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:x.cache,pendingSuspenseBoundaries:x.pendingSuspenseBoundaries,transitions:x.transitions},a.updateQueue.baseState=y,a.memoizedState=y,a.flags&256){h=vn(Error(r(423)),a),a=qu(o,a,c,u,h);break e}else if(c!==h){h=vn(Error(r(424)),a),a=qu(o,a,c,u,h);break e}else for(Rt=Cr(a.stateNode.containerInfo.firstChild),At=a,We=!0,Ht=null,u=uu(a,null,c,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(pn(),c===h){a=fr(o,a,u);break e}xt(o,a,c,u)}a=a.child}return a;case 5:return lu(a),o===null&&Ya(a),c=a.type,h=a.pendingProps,y=o!==null?o.memoizedProps:null,x=h.children,Ba(c,h)?x=null:y!==null&&Ba(c,y)&&(a.flags|=32),zu(o,a),xt(o,a,x,u),a.child;case 6:return o===null&&Ya(a),null;case 13:return Vu(o,a,u);case 4:return si(a,a.stateNode.containerInfo),c=a.pendingProps,o===null?a.child=yn(a,null,c,u):xt(o,a,c,u),a.child;case 11:return c=a.type,h=a.pendingProps,h=a.elementType===c?h:Gt(c,h),ju(o,a,c,h,u);case 7:return xt(o,a,a.pendingProps,u),a.child;case 8:return xt(o,a,a.pendingProps.children,u),a.child;case 12:return xt(o,a,a.pendingProps.children,u),a.child;case 10:e:{if(c=a.type._context,h=a.pendingProps,y=a.memoizedProps,x=h.value,Ze(Fo,c._currentValue),c._currentValue=x,y!==null)if(Zt(y.value,x)){if(y.children===h.children&&!$t.current){a=fr(o,a,u);break e}}else for(y=a.child,y!==null&&(y.return=a);y!==null;){var R=y.dependencies;if(R!==null){x=y.child;for(var U=R.firstContext;U!==null;){if(U.context===c){if(y.tag===1){U=dr(-1,u&-u),U.tag=2;var te=y.updateQueue;if(te!==null){te=te.shared;var de=te.pending;de===null?U.next=U:(U.next=de.next,de.next=U),te.pending=U}}y.lanes|=u,U=y.alternate,U!==null&&(U.lanes|=u),ri(y.return,u,a),R.lanes|=u;break}U=U.next}}else if(y.tag===10)x=y.type===a.type?null:y.child;else if(y.tag===18){if(x=y.return,x===null)throw Error(r(341));x.lanes|=u,R=x.alternate,R!==null&&(R.lanes|=u),ri(x,u,a),x=y.sibling}else x=y.child;if(x!==null)x.return=y;else for(x=y;x!==null;){if(x===a){x=null;break}if(y=x.sibling,y!==null){y.return=x.return,x=y;break}x=x.return}y=x}xt(o,a,h.children,u),a=a.child}return a;case 9:return h=a.type,c=a.pendingProps.children,mn(a,u),h=Lt(h),c=c(h),a.flags|=1,xt(o,a,c,u),a.child;case 14:return c=a.type,h=Gt(c,a.pendingProps),h=Gt(c.type,h),Fu(o,a,c,h,u);case 15:return Lu(o,a,a.type,a.pendingProps,u);case 17:return c=a.type,h=a.pendingProps,h=a.elementType===c?h:Gt(c,h),Qo(o,a),a.tag=1,Pt(c)?(o=!0,Ao(a)):o=!1,mn(a,u),ou(a,c,h),ii(a,c,h,u),xi(null,a,c,!0,o,u);case 19:return Hu(o,a,u);case 22:return Mu(o,a,u)}throw Error(r(156,a.tag))};function yl(o,a){return Pn(o,a)}function rd(o,a,u,c){this.tag=o,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ut(o,a,u,c){return new rd(o,a,u,c)}function Bi(o){return o=o.prototype,!(!o||!o.isReactComponent)}function nd(o){if(typeof o=="function")return Bi(o)?1:0;if(o!=null){if(o=o.$$typeof,o===re)return 11;if(o===ee)return 14}return 2}function Or(o,a){var u=o.alternate;return u===null?(u=Ut(o.tag,a,o.key,o.mode),u.elementType=o.elementType,u.type=o.type,u.stateNode=o.stateNode,u.alternate=o,o.alternate=u):(u.pendingProps=a,u.type=o.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=o.flags&14680064,u.childLanes=o.childLanes,u.lanes=o.lanes,u.child=o.child,u.memoizedProps=o.memoizedProps,u.memoizedState=o.memoizedState,u.updateQueue=o.updateQueue,a=o.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=o.sibling,u.index=o.index,u.ref=o.ref,u}function sa(o,a,u,c,h,y){var x=2;if(c=o,typeof o=="function")Bi(o)&&(x=1);else if(typeof o=="string")x=5;else e:switch(o){case C:return Kr(u.children,h,y,a);case _:x=8,h|=8;break;case A:return o=Ut(12,u,a,h|2),o.elementType=A,o.lanes=y,o;case K:return o=Ut(13,u,a,h),o.elementType=K,o.lanes=y,o;case J:return o=Ut(19,u,a,h),o.elementType=J,o.lanes=y,o;case Y:return ua(u,h,y,a);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case k:x=10;break e;case L:x=9;break e;case re:x=11;break e;case ee:x=14;break e;case E:x=16,c=null;break e}throw Error(r(130,o==null?o:typeof o,""))}return a=Ut(x,u,a,h),a.elementType=o,a.type=c,a.lanes=y,a}function Kr(o,a,u,c){return o=Ut(7,o,c,a),o.lanes=u,o}function ua(o,a,u,c){return o=Ut(22,o,c,a),o.elementType=Y,o.lanes=u,o.stateNode={isHidden:!1},o}function qi(o,a,u){return o=Ut(6,o,null,a),o.lanes=u,o}function Vi(o,a,u){return a=Ut(4,o.children!==null?o.children:[],o.key,a),a.lanes=u,a.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},a}function od(o,a,u,c,h){this.tag=a,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ga(0),this.expirationTimes=ga(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ga(0),this.identifierPrefix=c,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function Zi(o,a,u,c,h,y,x,R,U){return o=new od(o,a,u,R,U),a===1?(a=1,y===!0&&(a|=8)):a=0,y=Ut(3,null,null,a),o.current=y,y.stateNode=o,y.memoizedState={element:c,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},oi(y),o}function ad(o,a,u){var c=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),reactDom.exports=requireReactDom_production_min(),reactDom.exports}var hasRequiredClient;function requireClient(){if(hasRequiredClient)return client;hasRequiredClient=1;var e=requireReactDom();return client.createRoot=e.createRoot,client.hydrateRoot=e.hydrateRoot,client}var clientExports=requireClient();const ReactDOM=getDefaultExportFromCjs(clientExports);class Subscribable{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){const r={listener:t};return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const isServer=typeof window>"u"||"Deno"in window;function noop$2(){}function functionalUpdate(e,t){return typeof e=="function"?e(t):e}function isValidTimeout(e){return typeof e=="number"&&e>=0&&e!==1/0}function timeUntilStale(e,t){return Math.max(e+(t||0)-Date.now(),0)}function parseQueryArgs(e,t,r){return isQueryKey(e)?typeof t=="function"?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function parseMutationArgs(e,t,r){return isQueryKey(e)?{...t,mutationKey:e}:typeof e=="function"?{...t,mutationFn:e}:{...e}}function parseFilterArgs(e,t,r){return isQueryKey(e)?[{...t,queryKey:e},r]:[e||{},t]}function matchQuery(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:l,stale:d}=e;if(isQueryKey(l)){if(n){if(t.queryHash!==hashQueryKeyByOptions(l,t.options))return!1}else if(!partialMatchKey(t.queryKey,l))return!1}if(r!=="all"){const p=t.isActive();if(r==="active"&&!p||r==="inactive"&&p)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||typeof i<"u"&&i!==t.state.fetchStatus||s&&!s(t))}function matchMutation(e,t){const{exact:r,fetching:n,predicate:i,mutationKey:s}=e;if(isQueryKey(s)){if(!t.options.mutationKey)return!1;if(r){if(hashQueryKey(t.options.mutationKey)!==hashQueryKey(s))return!1}else if(!partialMatchKey(t.options.mutationKey,s))return!1}return!(typeof n=="boolean"&&t.state.status==="loading"!==n||i&&!i(t))}function hashQueryKeyByOptions(e,t){return((t==null?void 0:t.queryKeyHashFn)||hashQueryKey)(e)}function hashQueryKey(e){return JSON.stringify(e,(t,r)=>isPlainObject$1(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function partialMatchKey(e,t){return partialDeepEqual(e,t)}function partialDeepEqual(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!partialDeepEqual(e[r],t[r])):!1}function replaceEqualDeep(e,t){if(e===t)return e;const r=isPlainArray(e)&&isPlainArray(t);if(r||isPlainObject$1(e)&&isPlainObject$1(t)){const n=r?e.length:Object.keys(e).length,i=r?t:Object.keys(t),s=i.length,l=r?[]:{};let d=0;for(let p=0;p"u")return!0;const r=t.prototype;return!(!hasObjectPrototype(r)||!r.hasOwnProperty("isPrototypeOf"))}function hasObjectPrototype(e){return Object.prototype.toString.call(e)==="[object Object]"}function isQueryKey(e){return Array.isArray(e)}function sleep(e){return new Promise(t=>{setTimeout(t,e)})}function scheduleMicrotask(e){sleep(0).then(e)}function getAbortController(){if(typeof AbortController=="function")return new AbortController}function replaceData(e,t,r){return r.isDataEqual!=null&&r.isDataEqual(e,t)?e:typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?replaceEqualDeep(e,t):t}class FocusManager extends Subscribable{constructor(){super(),this.setup=t=>{if(!isServer&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),window.addEventListener("focus",r,!1),()=>{window.removeEventListener("visibilitychange",r),window.removeEventListener("focus",r)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var r;this.setup=t,(r=this.cleanup)==null||r.call(this),this.cleanup=t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(t){this.focused!==t&&(this.focused=t,this.onFocus())}onFocus(){this.listeners.forEach(({listener:t})=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const focusManager=new FocusManager,onlineEvents=["online","offline"];class OnlineManager extends Subscribable{constructor(){super(),this.setup=t=>{if(!isServer&&window.addEventListener){const r=()=>t();return onlineEvents.forEach(n=>{window.addEventListener(n,r,!1)}),()=>{onlineEvents.forEach(n=>{window.removeEventListener(n,r)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var r;this.setup=t,(r=this.cleanup)==null||r.call(this),this.cleanup=t(n=>{typeof n=="boolean"?this.setOnline(n):this.onOnline()})}setOnline(t){this.online!==t&&(this.online=t,this.onOnline())}onOnline(){this.listeners.forEach(({listener:t})=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const onlineManager=new OnlineManager;function defaultRetryDelay(e){return Math.min(1e3*2**e,3e4)}function canFetch(e){return(e??"online")==="online"?onlineManager.isOnline():!0}class CancelledError{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function isCancelledError(e){return e instanceof CancelledError}function createRetryer(e){let t=!1,r=0,n=!1,i,s,l;const d=new Promise((P,F)=>{s=P,l=F}),p=P=>{n||($(new CancelledError(P)),e.abort==null||e.abort())},m=()=>{t=!0},v=()=>{t=!1},b=()=>!focusManager.isFocused()||e.networkMode!=="always"&&!onlineManager.isOnline(),S=P=>{n||(n=!0,e.onSuccess==null||e.onSuccess(P),i==null||i(),s(P))},$=P=>{n||(n=!0,e.onError==null||e.onError(P),i==null||i(),l(P))},N=()=>new Promise(P=>{i=F=>{const q=n||!b();return q&&P(F),q},e.onPause==null||e.onPause()}).then(()=>{i=void 0,n||e.onContinue==null||e.onContinue()}),D=()=>{if(n)return;let P;try{P=e.fn()}catch(F){P=Promise.reject(F)}Promise.resolve(P).then(S).catch(F=>{var q,H;if(n)return;const f=(q=e.retry)!=null?q:3,w=(H=e.retryDelay)!=null?H:defaultRetryDelay,g=typeof w=="function"?w(r,F):w,C=f===!0||typeof f=="number"&&r{if(b())return N()}).then(()=>{t?$(F):D()})})};return canFetch(e.networkMode)?D():N().then(D),{promise:d,cancel:p,continue:()=>(i==null?void 0:i())?d:Promise.resolve(),cancelRetry:m,continueRetry:v}}const defaultLogger=console;function createNotifyManager(){let e=[],t=0,r=v=>{v()},n=v=>{v()};const i=v=>{let b;t++;try{b=v()}finally{t--,t||d()}return b},s=v=>{t?e.push(v):scheduleMicrotask(()=>{r(v)})},l=v=>(...b)=>{s(()=>{v(...b)})},d=()=>{const v=e;e=[],v.length&&scheduleMicrotask(()=>{n(()=>{v.forEach(b=>{r(b)})})})};return{batch:i,batchCalls:l,schedule:s,setNotifyFunction:v=>{r=v},setBatchNotifyFunction:v=>{n=v}}}const notifyManager=createNotifyManager();class Removable{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(isServer?1/0:3e5))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class Query extends Removable{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||defaultLogger,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||getDefaultState$1(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,r){const n=replaceData(this.state.data,t,this.options);return this.dispatch({data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){this.dispatch({type:"setState",state:t,setStateOptions:r})}cancel(t){var r;const n=this.promise;return(r=this.retryer)==null||r.cancel(t),n?n.then(noop$2).catch(noop$2):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!timeUntilStale(this.state.dataUpdatedAt,t)}onFocus(){var t;const r=this.observers.find(n=>n.shouldFetchOnWindowFocus());r&&r.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const r=this.observers.find(n=>n.shouldFetchOnReconnect());r&&r.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,r){var n,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&r!=null&&r.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var s;return(s=this.retryer)==null||s.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const $=this.observers.find(N=>N.options.queryFn);$&&this.setOptions($.options)}Array.isArray(this.options.queryKey);const l=getAbortController(),d={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},p=$=>{Object.defineProperty($,"signal",{enumerable:!0,get:()=>{if(l)return this.abortSignalConsumed=!0,l.signal}})};p(d);const m=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(d)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),v={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:m};if(p(v),(n=this.options.behavior)==null||n.onFetch(v),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=v.fetchOptions)==null?void 0:i.meta)){var b;this.dispatch({type:"fetch",meta:(b=v.fetchOptions)==null?void 0:b.meta})}const S=$=>{if(isCancelledError($)&&$.silent||this.dispatch({type:"error",error:$}),!isCancelledError($)){var N,D,P,F;(N=(D=this.cache.config).onError)==null||N.call(D,$,this),(P=(F=this.cache.config).onSettled)==null||P.call(F,this.state.data,$,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=createRetryer({fn:v.fetchFn,abort:l==null?void 0:l.abort.bind(l),onSuccess:$=>{var N,D,P,F;if(typeof $>"u"){S(new Error(this.queryHash+" data is undefined"));return}this.setData($),(N=(D=this.cache.config).onSuccess)==null||N.call(D,$,this),(P=(F=this.cache.config).onSettled)==null||P.call(F,$,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:S,onFail:($,N)=>{this.dispatch({type:"failed",failureCount:$,error:N})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:v.options.retry,retryDelay:v.options.retryDelay,networkMode:v.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const r=n=>{var i,s;switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=t.meta)!=null?i:null,fetchStatus:canFetch(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:(s=t.dataUpdatedAt)!=null?s:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const l=t.error;return isCancelledError(l)&&l.revert&&this.revertState?{...this.revertState}:{...n,error:l,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),notifyManager.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function getDefaultState$1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=typeof t<"u",n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}class QueryCache extends Subscribable{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,r,n){var i;const s=r.queryKey,l=(i=r.queryHash)!=null?i:hashQueryKeyByOptions(s,r);let d=this.get(l);return d||(d=new Query({cache:this,logger:t.getLogger(),queryKey:s,queryHash:l,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(d)),d}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const r=this.queriesMap[t.queryHash];r&&(t.destroy(),this.queries=this.queries.filter(n=>n!==t),r===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){notifyManager.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,r){const[n]=parseFilterArgs(t,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(i=>matchQuery(n,i))}findAll(t,r){const[n]=parseFilterArgs(t,r);return Object.keys(n).length>0?this.queries.filter(i=>matchQuery(n,i)):this.queries}notify(t){notifyManager.batch(()=>{this.listeners.forEach(({listener:r})=>{r(t)})})}onFocus(){notifyManager.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class Mutation extends Removable{constructor(t){super(),this.defaultOptions=t.defaultOptions,this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||defaultLogger,this.observers=[],this.state=t.state||getDefaultState(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(r=>r!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,r;return(t=(r=this.retryer)==null?void 0:r.continue())!=null?t:this.execute()}async execute(){const t=()=>{var C;return this.retryer=createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(_,A)=>{this.dispatch({type:"failed",failureCount:_,error:A})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(C=this.options.retry)!=null?C:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},r=this.state.status==="loading";try{var n,i,s,l,d,p,m,v;if(!r){var b,S,$,N;this.dispatch({type:"loading",variables:this.options.variables}),await((b=(S=this.mutationCache.config).onMutate)==null?void 0:b.call(S,this.state.variables,this));const _=await(($=(N=this.options).onMutate)==null?void 0:$.call(N,this.state.variables));_!==this.state.context&&this.dispatch({type:"loading",context:_,variables:this.state.variables})}const C=await t();return await((n=(i=this.mutationCache.config).onSuccess)==null?void 0:n.call(i,C,this.state.variables,this.state.context,this)),await((s=(l=this.options).onSuccess)==null?void 0:s.call(l,C,this.state.variables,this.state.context)),await((d=(p=this.mutationCache.config).onSettled)==null?void 0:d.call(p,C,null,this.state.variables,this.state.context,this)),await((m=(v=this.options).onSettled)==null?void 0:m.call(v,C,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:C}),C}catch(C){try{var D,P,F,q,H,f,w,g;throw await((D=(P=this.mutationCache.config).onError)==null?void 0:D.call(P,C,this.state.variables,this.state.context,this)),await((F=(q=this.options).onError)==null?void 0:F.call(q,C,this.state.variables,this.state.context)),await((H=(f=this.mutationCache.config).onSettled)==null?void 0:H.call(f,void 0,C,this.state.variables,this.state.context,this)),await((w=(g=this.options).onSettled)==null?void 0:w.call(g,void 0,C,this.state.variables,this.state.context)),C}finally{this.dispatch({type:"error",error:C})}}}dispatch(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"loading":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!canFetch(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...n,...t.state}}};this.state=r(this.state),notifyManager.batch(()=>{this.observers.forEach(n=>{n.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class MutationCache extends Subscribable{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,r,n){const i=new Mutation({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(r),state:n,defaultOptions:r.mutationKey?t.getMutationDefaults(r.mutationKey):void 0});return this.add(i),i}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(r=>r!==t),this.notify({type:"removed",mutation:t})}clear(){notifyManager.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(r=>matchMutation(t,r))}findAll(t){return this.mutations.filter(r=>matchMutation(t,r))}notify(t){notifyManager.batch(()=>{this.listeners.forEach(({listener:r})=>{r(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const r=this.mutations.filter(n=>n.state.isPaused);return notifyManager.batch(()=>r.reduce((n,i)=>n.then(()=>i.continue().catch(noop$2)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function infiniteQueryBehavior(){return{onFetch:e=>{e.fetchFn=()=>{var t,r,n,i,s,l;const d=(t=e.fetchOptions)==null||(r=t.meta)==null?void 0:r.refetchPage,p=(n=e.fetchOptions)==null||(i=n.meta)==null?void 0:i.fetchMore,m=p==null?void 0:p.pageParam,v=(p==null?void 0:p.direction)==="forward",b=(p==null?void 0:p.direction)==="backward",S=((s=e.state.data)==null?void 0:s.pages)||[],$=((l=e.state.data)==null?void 0:l.pageParams)||[];let N=$,D=!1;const P=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>{var C;if((C=e.signal)!=null&&C.aborted)D=!0;else{var _;(_=e.signal)==null||_.addEventListener("abort",()=>{D=!0})}return e.signal}})},F=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),q=(g,C,_,A)=>(N=A?[C,...N]:[...N,C],A?[_,...g]:[...g,_]),H=(g,C,_,A)=>{if(D)return Promise.reject("Cancelled");if(typeof _>"u"&&!C&&g.length)return Promise.resolve(g);const k={queryKey:e.queryKey,pageParam:_,meta:e.options.meta};P(k);const L=F(k);return Promise.resolve(L).then(K=>q(g,_,K,A))};let f;if(!S.length)f=H([]);else if(v){const g=typeof m<"u",C=g?m:getNextPageParam(e.options,S);f=H(S,g,C)}else if(b){const g=typeof m<"u",C=g?m:getPreviousPageParam(e.options,S);f=H(S,g,C,!0)}else{N=[];const g=typeof e.options.getNextPageParam>"u";f=(d&&S[0]?d(S[0],0,S):!0)?H([],g,$[0]):Promise.resolve(q([],$[0],S[0]));for(let _=1;_{if(d&&S[_]?d(S[_],_,S):!0){const L=g?$[_]:getNextPageParam(e.options,A);return H(A,g,L)}return Promise.resolve(q(A,$[_],S[_]))})}return f.then(g=>({pages:g,pageParams:N}))}}}}function getNextPageParam(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function getPreviousPageParam(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class QueryClient{constructor(t={}){this.queryCache=t.queryCache||new QueryCache,this.mutationCache=t.mutationCache||new MutationCache,this.logger=t.logger||defaultLogger,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=focusManager.subscribe(()=>{focusManager.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=onlineManager.subscribe(()=>{onlineManager.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,r;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(r=this.unsubscribeOnline)==null||r.call(this),this.unsubscribeOnline=void 0)}isFetching(t,r){const[n]=parseFilterArgs(t,r);return n.fetchStatus="fetching",this.queryCache.findAll(n).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,r){var n;return(n=this.queryCache.find(t,r))==null?void 0:n.state.data}ensureQueryData(t,r,n){const i=parseQueryArgs(t,r,n),s=this.getQueryData(i.queryKey);return s?Promise.resolve(s):this.fetchQuery(i)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:r,state:n})=>{const i=n.data;return[r,i]})}setQueryData(t,r,n){const i=this.queryCache.find(t),s=i==null?void 0:i.state.data,l=functionalUpdate(r,s);if(typeof l>"u")return;const d=parseQueryArgs(t),p=this.defaultQueryOptions(d);return this.queryCache.build(this,p).setData(l,{...n,manual:!0})}setQueriesData(t,r,n){return notifyManager.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,r,n)]))}getQueryState(t,r){var n;return(n=this.queryCache.find(t,r))==null?void 0:n.state}removeQueries(t,r){const[n]=parseFilterArgs(t,r),i=this.queryCache;notifyManager.batch(()=>{i.findAll(n).forEach(s=>{i.remove(s)})})}resetQueries(t,r,n){const[i,s]=parseFilterArgs(t,r,n),l=this.queryCache,d={type:"active",...i};return notifyManager.batch(()=>(l.findAll(i).forEach(p=>{p.reset()}),this.refetchQueries(d,s)))}cancelQueries(t,r,n){const[i,s={}]=parseFilterArgs(t,r,n);typeof s.revert>"u"&&(s.revert=!0);const l=notifyManager.batch(()=>this.queryCache.findAll(i).map(d=>d.cancel(s)));return Promise.all(l).then(noop$2).catch(noop$2)}invalidateQueries(t,r,n){const[i,s]=parseFilterArgs(t,r,n);return notifyManager.batch(()=>{var l,d;if(this.queryCache.findAll(i).forEach(m=>{m.invalidate()}),i.refetchType==="none")return Promise.resolve();const p={...i,type:(l=(d=i.refetchType)!=null?d:i.type)!=null?l:"active"};return this.refetchQueries(p,s)})}refetchQueries(t,r,n){const[i,s]=parseFilterArgs(t,r,n),l=notifyManager.batch(()=>this.queryCache.findAll(i).filter(p=>!p.isDisabled()).map(p=>{var m;return p.fetch(void 0,{...s,cancelRefetch:(m=s==null?void 0:s.cancelRefetch)!=null?m:!0,meta:{refetchPage:i.refetchPage}})}));let d=Promise.all(l).then(noop$2);return s!=null&&s.throwOnError||(d=d.catch(noop$2)),d}fetchQuery(t,r,n){const i=parseQueryArgs(t,r,n),s=this.defaultQueryOptions(i);typeof s.retry>"u"&&(s.retry=!1);const l=this.queryCache.build(this,s);return l.isStaleByTime(s.staleTime)?l.fetch(s):Promise.resolve(l.state.data)}prefetchQuery(t,r,n){return this.fetchQuery(t,r,n).then(noop$2).catch(noop$2)}fetchInfiniteQuery(t,r,n){const i=parseQueryArgs(t,r,n);return i.behavior=infiniteQueryBehavior(),this.fetchQuery(i)}prefetchInfiniteQuery(t,r,n){return this.fetchInfiniteQuery(t,r,n).then(noop$2).catch(noop$2)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,r){const n=this.queryDefaults.find(i=>hashQueryKey(t)===hashQueryKey(i.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:t,defaultOptions:r})}getQueryDefaults(t){if(!t)return;const r=this.queryDefaults.find(n=>partialMatchKey(t,n.queryKey));return r==null?void 0:r.defaultOptions}setMutationDefaults(t,r){const n=this.mutationDefaults.find(i=>hashQueryKey(t)===hashQueryKey(i.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:t,defaultOptions:r})}getMutationDefaults(t){if(!t)return;const r=this.mutationDefaults.find(n=>partialMatchKey(t,n.mutationKey));return r==null?void 0:r.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const r={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!r.queryHash&&r.queryKey&&(r.queryHash=hashQueryKeyByOptions(r.queryKey,r)),typeof r.refetchOnReconnect>"u"&&(r.refetchOnReconnect=r.networkMode!=="always"),typeof r.useErrorBoundary>"u"&&(r.useErrorBoundary=!!r.suspense),r}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class QueryObserver extends Subscribable{constructor(t,r){super(),this.client=t,this.options=r,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(r)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),shouldFetchOnMount(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,r){const n=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),shallowEqualObjects(n,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),this.updateQuery();const s=this.hasListeners();s&&shouldFetchOptionally(this.currentQuery,i,this.options,n)&&this.executeFetch(),this.updateResult(r),s&&(this.currentQuery!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&this.updateStaleTimeout();const l=this.computeRefetchInterval();s&&(this.currentQuery!==i||this.options.enabled!==n.enabled||l!==this.currentRefetchInterval)&&this.updateRefetchInterval(l)}getOptimisticResult(t){const r=this.client.getQueryCache().build(this.client,t),n=this.createResult(r,t);return shouldAssignObserverCurrentProperties(this,n,t)&&(this.currentResult=n,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),n}getCurrentResult(){return this.currentResult}trackResult(t){const r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(n),t[n])})}),r}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...r}={}){return this.fetch({...r,meta:{refetchPage:t}})}fetchOptimistic(t){const r=this.client.defaultQueryOptions(t),n=this.client.getQueryCache().build(this.client,r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(t){var r;return this.executeFetch({...t,cancelRefetch:(r=t.cancelRefetch)!=null?r:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let r=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(noop$2)),r}updateStaleTimeout(){if(this.clearStaleTimeout(),isServer||this.currentResult.isStale||!isValidTimeout(this.options.staleTime))return;const r=timeUntilStale(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},r)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(isServer||this.options.enabled===!1||!isValidTimeout(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,r){const n=this.currentQuery,i=this.options,s=this.currentResult,l=this.currentResultState,d=this.currentResultOptions,p=t!==n,m=p?t.state:this.currentQueryInitialState,v=p?this.currentResult:this.previousQueryResult,{state:b}=t;let{dataUpdatedAt:S,error:$,errorUpdatedAt:N,fetchStatus:D,status:P}=b,F=!1,q=!1,H;if(r._optimisticResults){const _=this.hasListeners(),A=!_&&shouldFetchOnMount(t,r),k=_&&shouldFetchOptionally(t,n,r,i);(A||k)&&(D=canFetch(t.options.networkMode)?"fetching":"paused",S||(P="loading")),r._optimisticResults==="isRestoring"&&(D="idle")}if(r.keepPreviousData&&!b.dataUpdatedAt&&v!=null&&v.isSuccess&&P!=="error")H=v.data,S=v.dataUpdatedAt,P=v.status,F=!0;else if(r.select&&typeof b.data<"u")if(s&&b.data===(l==null?void 0:l.data)&&r.select===this.selectFn)H=this.selectResult;else try{this.selectFn=r.select,H=r.select(b.data),H=replaceData(s==null?void 0:s.data,H,r),this.selectResult=H,this.selectError=null}catch(_){this.selectError=_}else H=b.data;if(typeof r.placeholderData<"u"&&typeof H>"u"&&P==="loading"){let _;if(s!=null&&s.isPlaceholderData&&r.placeholderData===(d==null?void 0:d.placeholderData))_=s.data;else if(_=typeof r.placeholderData=="function"?r.placeholderData():r.placeholderData,r.select&&typeof _<"u")try{_=r.select(_),this.selectError=null}catch(A){this.selectError=A}typeof _<"u"&&(P="success",H=replaceData(s==null?void 0:s.data,_,r),q=!0)}this.selectError&&($=this.selectError,H=this.selectResult,N=Date.now(),P="error");const f=D==="fetching",w=P==="loading",g=P==="error";return{status:P,fetchStatus:D,isLoading:w,isSuccess:P==="success",isError:g,isInitialLoading:w&&f,data:H,dataUpdatedAt:S,error:$,errorUpdatedAt:N,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:b.dataUpdateCount>0||b.errorUpdateCount>0,isFetchedAfterMount:b.dataUpdateCount>m.dataUpdateCount||b.errorUpdateCount>m.errorUpdateCount,isFetching:f,isRefetching:f&&!w,isLoadingError:g&&b.dataUpdatedAt===0,isPaused:D==="paused",isPlaceholderData:q,isPreviousData:F,isRefetchError:g&&b.dataUpdatedAt!==0,isStale:isStale(t,r),refetch:this.refetch,remove:this.remove}}updateResult(t){const r=this.currentResult,n=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,shallowEqualObjects(n,r))return;this.currentResult=n;const i={cache:!0},s=()=>{if(!r)return!0;const{notifyOnChangeProps:l}=this.options,d=typeof l=="function"?l():l;if(d==="all"||!d&&!this.trackedProps.size)return!0;const p=new Set(d??this.trackedProps);return this.options.useErrorBoundary&&p.add("error"),Object.keys(this.currentResult).some(m=>{const v=m;return this.currentResult[v]!==r[v]&&p.has(v)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),this.notify({...i,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const r=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const r={};t.type==="success"?r.onSuccess=!t.manual:t.type==="error"&&!isCancelledError(t.error)&&(r.onError=!0),this.updateResult(r),this.hasListeners()&&this.updateTimers()}notify(t){notifyManager.batch(()=>{if(t.onSuccess){var r,n,i,s;(r=(n=this.options).onSuccess)==null||r.call(n,this.currentResult.data),(i=(s=this.options).onSettled)==null||i.call(s,this.currentResult.data,null)}else if(t.onError){var l,d,p,m;(l=(d=this.options).onError)==null||l.call(d,this.currentResult.error),(p=(m=this.options).onSettled)==null||p.call(m,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(({listener:v})=>{v(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function shouldLoadOnMount(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function shouldFetchOnMount(e,t){return shouldLoadOnMount(e,t)||e.state.dataUpdatedAt>0&&shouldFetchOn(e,t,t.refetchOnMount)}function shouldFetchOn(e,t,r){if(t.enabled!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&isStale(e,t)}return!1}function shouldFetchOptionally(e,t,r,n){return r.enabled!==!1&&(e!==t||n.enabled===!1)&&(!r.suspense||e.state.status!=="error")&&isStale(e,r)}function isStale(e,t){return e.isStaleByTime(t.staleTime)}function shouldAssignObserverCurrentProperties(e,t,r){return r.keepPreviousData?!1:r.placeholderData!==void 0?t.isPlaceholderData:e.getCurrentResult()!==t}class MutationObserver extends Subscribable{constructor(t,r){super(),this.client=t,this.setOptions(r),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=this.client.defaultMutationOptions(t),shallowEqualObjects(n,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),(r=this.currentMutation)==null||r.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.currentMutation)==null||t.removeObserver(this)}}onMutationUpdate(t){this.updateResult();const r={listeners:!0};t.type==="success"?r.onSuccess=!0:t.type==="error"&&(r.onError=!0),this.notify(r)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,r){return this.mutateOptions=r,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof t<"u"?t:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const t=this.currentMutation?this.currentMutation.state:getDefaultState(),r={...t,isLoading:t.status==="loading",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=r}notify(t){notifyManager.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(t.onSuccess){var r,n,i,s;(r=(n=this.mutateOptions).onSuccess)==null||r.call(n,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(i=(s=this.mutateOptions).onSettled)==null||i.call(s,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(t.onError){var l,d,p,m;(l=(d=this.mutateOptions).onError)==null||l.call(d,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(p=(m=this.mutateOptions).onSettled)==null||p.call(m,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}t.listeners&&this.listeners.forEach(({listener:v})=>{v(this.currentResult)})})}}var reactDomExports=requireReactDom(),reactExports=requireReact();const React=getDefaultExportFromCjs(reactExports);var shim={exports:{}},useSyncExternalStoreShim_production_min={};/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hasRequiredUseSyncExternalStoreShim_production_min;function requireUseSyncExternalStoreShim_production_min(){if(hasRequiredUseSyncExternalStoreShim_production_min)return useSyncExternalStoreShim_production_min;hasRequiredUseSyncExternalStoreShim_production_min=1;var e=requireReact();function t(b,S){return b===S&&(b!==0||1/b===1/S)||b!==b&&S!==S}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,s=e.useLayoutEffect,l=e.useDebugValue;function d(b,S){var $=S(),N=n({inst:{value:$,getSnapshot:S}}),D=N[0].inst,P=N[1];return s(function(){D.value=$,D.getSnapshot=S,p(D)&&P({inst:D})},[b,$,S]),i(function(){return p(D)&&P({inst:D}),b(function(){p(D)&&P({inst:D})})},[b]),l($),$}function p(b){var S=b.getSnapshot;b=b.value;try{var $=S();return!r(b,$)}catch{return!0}}function m(b,S){return S()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:d;return useSyncExternalStoreShim_production_min.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,useSyncExternalStoreShim_production_min}var hasRequiredShim;function requireShim(){return hasRequiredShim||(hasRequiredShim=1,shim.exports=requireUseSyncExternalStoreShim_production_min()),shim.exports}var shimExports=requireShim();const useSyncExternalStore=shimExports.useSyncExternalStore,defaultContext=reactExports.createContext(void 0),QueryClientSharingContext=reactExports.createContext(!1);function getQueryClientContext(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=defaultContext),window.ReactQueryClientContext):defaultContext)}const useQueryClient=({context:e}={})=>{const t=reactExports.useContext(getQueryClientContext(e,reactExports.useContext(QueryClientSharingContext)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},QueryClientProvider=({client:e,children:t,context:r,contextSharing:n=!1})=>{reactExports.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=getQueryClientContext(r,n);return reactExports.createElement(QueryClientSharingContext.Provider,{value:!r&&n},reactExports.createElement(i.Provider,{value:e},t))},IsRestoringContext=reactExports.createContext(!1),useIsRestoring=()=>reactExports.useContext(IsRestoringContext);IsRestoringContext.Provider;function createValue(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const QueryErrorResetBoundaryContext=reactExports.createContext(createValue()),useQueryErrorResetBoundary=()=>reactExports.useContext(QueryErrorResetBoundaryContext);function shouldThrowError(e,t){return typeof e=="function"?e(...t):!!e}const ensurePreventErrorBoundaryRetry=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},useClearResetErrorBoundary=e=>{reactExports.useEffect(()=>{e.clearReset()},[e])},getHasError=({result:e,errorResetBoundary:t,useErrorBoundary:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&shouldThrowError(r,[e.error,n]),ensureStaleTime=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},willFetch=(e,t)=>e.isLoading&&e.isFetching&&!t,shouldSuspend=(e,t,r)=>(e==null?void 0:e.suspense)&&willFetch(t,r),fetchOptimistic=(e,t,r)=>t.fetchOptimistic(e).then(({data:n})=>{e.onSuccess==null||e.onSuccess(n),e.onSettled==null||e.onSettled(n,null)}).catch(n=>{r.clearReset(),e.onError==null||e.onError(n),e.onSettled==null||e.onSettled(void 0,n)});function useBaseQuery(e,t){const r=useQueryClient({context:e.context}),n=useIsRestoring(),i=useQueryErrorResetBoundary(),s=r.defaultQueryOptions(e);s._optimisticResults=n?"isRestoring":"optimistic",s.onError&&(s.onError=notifyManager.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=notifyManager.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=notifyManager.batchCalls(s.onSettled)),ensureStaleTime(s),ensurePreventErrorBoundaryRetry(s,i),useClearResetErrorBoundary(i);const[l]=reactExports.useState(()=>new t(r,s)),d=l.getOptimisticResult(s);if(useSyncExternalStore(reactExports.useCallback(p=>{const m=n?()=>{}:l.subscribe(notifyManager.batchCalls(p));return l.updateResult(),m},[l,n]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),reactExports.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),shouldSuspend(s,d,n))throw fetchOptimistic(s,l,i);if(getHasError({result:d,errorResetBoundary:i,useErrorBoundary:s.useErrorBoundary,query:l.getCurrentQuery()}))throw d.error;return s.notifyOnChangeProps?d:l.trackResult(d)}function useQuery(e,t,r){const n=parseQueryArgs(e,t,r);return useBaseQuery(n,QueryObserver)}function useMutation(e,t,r){const n=parseMutationArgs(e,t),i=useQueryClient({context:n.context}),[s]=reactExports.useState(()=>new MutationObserver(i,n));reactExports.useEffect(()=>{s.setOptions(n)},[s,n]);const l=useSyncExternalStore(reactExports.useCallback(p=>s.subscribe(notifyManager.batchCalls(p)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),d=reactExports.useCallback((p,m)=>{s.mutate(p,m).catch(noop$1)},[s]);if(l.error&&shouldThrowError(s.options.useErrorBoundary,[l.error]))throw l.error;return{...l,mutate:d,mutateAsync:l.mutate}}function noop$1(){}function assertNever(e,t){throw new Error(`Unhandled discriminated union member: ${JSON.stringify(e)}`)}function hexToRGB(e){if(!e)return;const[t,r,n]=e.match(/[a-fA-F\d]{2}/g).map(i=>parseInt(i,16));return`${t} ${r} ${n}`}const JWT_HEADER="x-alia-jwt",FLOW_ID_HEADER="x-alia-flow-id";var util;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{const s={};for(const l of i)s[l]=l;return s},e.getValidEnumValues=i=>{const s=e.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),l={};for(const d of s)l[d]=i[d];return e.objectValues(l)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const l in i)Object.prototype.hasOwnProperty.call(i,l)&&s.push(l);return s},e.find=(i,s)=>{for(const l of i)if(s(l))return l},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(l=>typeof l=="string"?`'${l}'`:l).join(s)}e.joinValues=n,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(util||(util={}));var objectUtil;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=e=>{switch(typeof e){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(e)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(e)?ZodParsedType.array:e===null?ZodParsedType.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&e instanceof Map?ZodParsedType.map:typeof Set<"u"&&e instanceof Set?ZodParsedType.set:typeof Date<"u"&&e instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(s){return s.message},n={_errors:[]},i=s=>{for(const l of s.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)n._errors.push(r(l));else{let d=n,p=0;for(;pr.message){const r={},n=[];for(const i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}ZodError.create=e=>new ZodError(e);const errorMap=(e,t)=>{let r;switch(e.code){case ZodIssueCode.invalid_type:e.received===ZodParsedType.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${util.joinValues(e.keys,", ")}`;break;case ZodIssueCode.invalid_union:r="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${util.joinValues(e.options)}`;break;case ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${util.joinValues(e.options)}, received '${e.received}'`;break;case ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case ZodIssueCode.invalid_date:r="Invalid date";break;case ZodIssueCode.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:util.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ZodIssueCode.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ZodIssueCode.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ZodIssueCode.custom:r="Invalid input";break;case ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError,util.assertNever(e)}return{message:r}};let overrideErrorMap=errorMap;function setErrorMap(e){overrideErrorMap=e}function getErrorMap(){return overrideErrorMap}const makeIssue=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,s=[...r,...i.path||[]],l={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let d="";const p=n.filter(m=>!!m).slice().reverse();for(const m of p)d=m(l,{data:t,defaultError:d}).message;return{...i,path:s,message:d}},EMPTY_PATH=[];function addIssueToContext(e,t){const r=getErrorMap(),n=makeIssue({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===errorMap?void 0:errorMap].filter(i=>!!i)});e.common.issues.push(n)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const i of r){if(i.status==="aborted")return INVALID;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const i of r){const s=await i.key,l=await i.value;n.push({key:s,value:l})}return ParseStatus.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const i of r){const{key:s,value:l}=i;if(s.status==="aborted"||l.status==="aborted")return INVALID;s.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(n[s.value]=l.value)}return{status:t.value,value:n}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=e=>({status:"dirty",value:e}),OK=e=>({status:"valid",value:e}),isAborted=e=>e.status==="aborted",isDirty=e=>e.status==="dirty",isValid=e=>e.status==="valid",isAsync=e=>typeof Promise<"u"&&e instanceof Promise;function __classPrivateFieldGet(e,t,r,n){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function __classPrivateFieldSet(e,t,r,n,i){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}typeof SuppressedError=="function"&&SuppressedError;var errorUtil;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;class ParseInputLazyPath{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(e,t)=>{if(isValid(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new ZodError(e.common.issues);return this._error=r,this._error}}};function processCreateParams(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(l,d)=>{var p,m;const{message:v}=e;return l.code==="invalid_enum_value"?{message:v??d.defaultError}:typeof d.data>"u"?{message:(p=v??n)!==null&&p!==void 0?p:d.defaultError}:l.code!=="invalid_type"?{message:d.defaultError}:{message:(m=v??r)!==null&&m!==void 0?m:d.defaultError}},description:i}}class ZodType{get description(){return this._def.description}_getType(t){return getParsedType(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:getParsedType(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ParseStatus,ctx:{common:t.parent.common,data:t.data,parsedType:getParsedType(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(isAsync(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:getParsedType(t)},s=this._parseSync({data:t,path:i.path,parent:i});return handleResult(i,s)}"~validate"(t){var r,n;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:getParsedType(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:i});return isValid(s)?{value:s.value}:{issues:i.common.issues}}catch(s){!((n=(r=s==null?void 0:s.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:i}).then(s=>isValid(s)?{value:s.value}:{issues:i.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:getParsedType(t)},i=this._parse({data:t,path:n.path,parent:n}),s=await(isAsync(i)?i:Promise.resolve(i));return handleResult(n,s)}refine(t,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{const l=t(i),d=()=>s.addIssue({code:ZodIssueCode.custom,...n(i)});return typeof Promise<"u"&&l instanceof Promise?l.then(p=>p?!0:(d(),!1)):l?!0:(d(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(t){return ZodUnion.create([this,t],this._def)}and(t){return ZodIntersection.create(this,t,this._def)}transform(t){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:r,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:r,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ZodPipeline.create(this,t)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function timeRegex(e){return new RegExp(`^${timeRegexSource(e)}$`)}function datetimeRegex(e){let t=`${dateRegexSource}T${timeRegexSource(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function isValidIP(e,t){return!!((t==="v4"||!t)&&ipv4Regex.test(e)||(t==="v6"||!t)&&ipv6Regex.test(e))}function isValidJWT(e,t){if(!jwtRegex.test(e))return!1;try{const[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||!i.typ||!i.alg||t&&i.alg!==t)}catch{return!1}}function isValidCidr(e,t){return!!((t==="v4"||!t)&&ipv4CidrRegex.test(e)||(t==="v6"||!t)&&ipv6CidrRegex.test(e))}class ZodString extends ZodType{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ZodParsedType.string){const s=this._getOrReturnCtx(t);return addIssueToContext(s,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:s.parsedType}),INVALID}const n=new ParseStatus;let i;for(const s of this._def.checks)if(s.kind==="min")t.data.lengths.value&&(i=this._getOrReturnCtx(t,i),addIssueToContext(i,{code:ZodIssueCode.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const l=t.data.length>s.value,d=t.data.lengtht.test(i),{validation:r,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(n)})}_addCheck(t){return new ZodString({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...errorUtil.errToObj(t)})}url(t){return this._addCheck({kind:"url",...errorUtil.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...errorUtil.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...errorUtil.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...errorUtil.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...errorUtil.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...errorUtil.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...errorUtil.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...errorUtil.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...errorUtil.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...errorUtil.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...errorUtil.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...errorUtil.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...errorUtil.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...errorUtil.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...errorUtil.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...errorUtil.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...errorUtil.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...errorUtil.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...errorUtil.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...errorUtil.errToObj(r)})}nonempty(t){return this.min(1,errorUtil.errToObj(t))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...processCreateParams(e)})};function floatSafeRemainder(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(e.toFixed(i).replace(".","")),l=parseInt(t.toFixed(i).replace(".",""));return s%l/Math.pow(10,i)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ZodParsedType.number){const s=this._getOrReturnCtx(t);return addIssueToContext(s,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:s.parsedType}),INVALID}let n;const i=new ParseStatus;for(const s of this._def.checks)s.kind==="int"?util.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?floatSafeRemainder(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.not_finite,message:s.message}),i.dirty()):util.assertNever(s);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,errorUtil.toString(r))}gt(t,r){return this.setLimit("min",t,!1,errorUtil.toString(r))}lte(t,r){return this.setLimit("max",t,!0,errorUtil.toString(r))}lt(t,r){return this.setLimit("max",t,!1,errorUtil.toString(r))}setLimit(t,r,n,i){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:errorUtil.toString(i)}]})}_addCheck(t){return new ZodNumber({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:errorUtil.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:errorUtil.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:errorUtil.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&util.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ZodParsedType.bigint)return this._getInvalidInput(t);let n;const i=new ParseStatus;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),addIssueToContext(n,{code:ZodIssueCode.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):util.assertNever(s);return{status:i.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:r.parsedType}),INVALID}gte(t,r){return this.setLimit("min",t,!0,errorUtil.toString(r))}gt(t,r){return this.setLimit("min",t,!1,errorUtil.toString(r))}lte(t,r){return this.setLimit("max",t,!0,errorUtil.toString(r))}lt(t,r){return this.setLimit("max",t,!1,errorUtil.toString(r))}setLimit(t,r,n,i){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:errorUtil.toString(i)}]})}_addCheck(t){return new ZodBigInt({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:errorUtil.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...processCreateParams(e)})};class ZodBoolean extends ZodType{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ZodParsedType.boolean){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:n.parsedType}),INVALID}return OK(t.data)}}ZodBoolean.create=e=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodDate extends ZodType{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ZodParsedType.date){const s=this._getOrReturnCtx(t);return addIssueToContext(s,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:s.parsedType}),INVALID}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return addIssueToContext(s,{code:ZodIssueCode.invalid_date}),INVALID}const n=new ParseStatus;let i;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()s.value&&(i=this._getOrReturnCtx(t,i),addIssueToContext(i,{code:ZodIssueCode.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):util.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ZodDate({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:errorUtil.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:errorUtil.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew ZodDate({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(e)});class ZodSymbol extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.symbol){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:n.parsedType}),INVALID}return OK(t.data)}}ZodSymbol.create=e=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(e)});class ZodUndefined extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.undefined){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:n.parsedType}),INVALID}return OK(t.data)}}ZodUndefined.create=e=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(e)});class ZodNull extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.null){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:n.parsedType}),INVALID}return OK(t.data)}}ZodNull.create=e=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(e)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(t){return OK(t.data)}}ZodAny.create=e=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(t){return OK(t.data)}}ZodUnknown.create=e=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(e)});class ZodNever extends ZodType{_parse(t){const r=this._getOrReturnCtx(t);return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:r.parsedType}),INVALID}}ZodNever.create=e=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(e)});class ZodVoid extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.undefined){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:n.parsedType}),INVALID}return OK(t.data)}}ZodVoid.create=e=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(e)});class ZodArray extends ZodType{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==ZodParsedType.array)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:r.parsedType}),INVALID;if(i.exactLength!==null){const l=r.data.length>i.exactLength.value,d=r.data.lengthi.maxLength.value&&(addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((l,d)=>i.type._parseAsync(new ParseInputLazyPath(r,l,r.path,d)))).then(l=>ParseStatus.mergeArray(n,l));const s=[...r.data].map((l,d)=>i.type._parseSync(new ParseInputLazyPath(r,l,r.path,d)));return ParseStatus.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new ZodArray({...this._def,minLength:{value:t,message:errorUtil.toString(r)}})}max(t,r){return new ZodArray({...this._def,maxLength:{value:t,message:errorUtil.toString(r)}})}length(t,r){return new ZodArray({...this._def,exactLength:{value:t,message:errorUtil.toString(r)}})}nonempty(t){return this.min(1,t)}}ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(t)});function deepPartialify(e){if(e instanceof ZodObject){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=ZodOptional.create(deepPartialify(n))}return new ZodObject({...e._def,shape:()=>t})}else return e instanceof ZodArray?new ZodArray({...e._def,type:deepPartialify(e.element)}):e instanceof ZodOptional?ZodOptional.create(deepPartialify(e.unwrap())):e instanceof ZodNullable?ZodNullable.create(deepPartialify(e.unwrap())):e instanceof ZodTuple?ZodTuple.create(e.items.map(t=>deepPartialify(t))):e}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=util.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==ZodParsedType.object){const m=this._getOrReturnCtx(t);return addIssueToContext(m,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:m.parsedType}),INVALID}const{status:n,ctx:i}=this._processInputParams(t),{shape:s,keys:l}=this._getCached(),d=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const m in i.data)l.includes(m)||d.push(m);const p=[];for(const m of l){const v=s[m],b=i.data[m];p.push({key:{status:"valid",value:m},value:v._parse(new ParseInputLazyPath(i,b,i.path,m)),alwaysSet:m in i.data})}if(this._def.catchall instanceof ZodNever){const m=this._def.unknownKeys;if(m==="passthrough")for(const v of d)p.push({key:{status:"valid",value:v},value:{status:"valid",value:i.data[v]}});else if(m==="strict")d.length>0&&(addIssueToContext(i,{code:ZodIssueCode.unrecognized_keys,keys:d}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const v of d){const b=i.data[v];p.push({key:{status:"valid",value:v},value:m._parse(new ParseInputLazyPath(i,b,i.path,v)),alwaysSet:v in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const m=[];for(const v of p){const b=await v.key,S=await v.value;m.push({key:b,value:S,alwaysSet:v.alwaysSet})}return m}).then(m=>ParseStatus.mergeObjectSync(n,m)):ParseStatus.mergeObjectSync(n,p)}get shape(){return this._def.shape()}strict(t){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,s,l,d;const p=(l=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&l!==void 0?l:n.defaultError;return r.code==="unrecognized_keys"?{message:(d=errorUtil.errToObj(t).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(t){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ZodObject({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new ZodObject({...this._def,catchall:t})}pick(t){const r={};return util.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new ZodObject({...this._def,shape:()=>r})}omit(t){const r={};return util.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new ZodObject({...this._def,shape:()=>r})}deepPartial(){return deepPartialify(this)}partial(t){const r={};return util.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}),new ZodObject({...this._def,shape:()=>r})}required(t){const r={};return util.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof ZodOptional;)s=s._def.innerType;r[n]=s}}),new ZodObject({...this._def,shape:()=>r})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)}),ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(t)});class ZodUnion extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function i(s){for(const d of s)if(d.result.status==="valid")return d.result;for(const d of s)if(d.result.status==="dirty")return r.common.issues.push(...d.ctx.common.issues),d.result;const l=s.map(d=>new ZodError(d.ctx.common.issues));return addIssueToContext(r,{code:ZodIssueCode.invalid_union,unionErrors:l}),INVALID}if(r.common.async)return Promise.all(n.map(async s=>{const l={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(i);{let s;const l=[];for(const p of n){const m={...r,common:{...r.common,issues:[]},parent:null},v=p._parseSync({data:r.data,path:r.path,parent:m});if(v.status==="valid")return v;v.status==="dirty"&&!s&&(s={result:v,ctx:m}),m.common.issues.length&&l.push(m.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const d=l.map(p=>new ZodError(p));return addIssueToContext(r,{code:ZodIssueCode.invalid_union,unionErrors:d}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(t)});const getDiscriminator=e=>e instanceof ZodLazy?getDiscriminator(e.schema):e instanceof ZodEffects?getDiscriminator(e.innerType()):e instanceof ZodLiteral?[e.value]:e instanceof ZodEnum?e.options:e instanceof ZodNativeEnum?util.objectValues(e.enum):e instanceof ZodDefault?getDiscriminator(e._def.innerType):e instanceof ZodUndefined?[void 0]:e instanceof ZodNull?[null]:e instanceof ZodOptional?[void 0,...getDiscriminator(e.unwrap())]:e instanceof ZodNullable?[null,...getDiscriminator(e.unwrap())]:e instanceof ZodBranded||e instanceof ZodReadonly?getDiscriminator(e.unwrap()):e instanceof ZodCatch?getDiscriminator(e._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ZodParsedType.object)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:r.parsedType}),INVALID;const n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(addIssueToContext(r,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const i=new Map;for(const s of r){const l=getDiscriminator(s.shape[t]);if(!l.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const d of l){if(i.has(d))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(d)}`);i.set(d,s)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...processCreateParams(n)})}}function mergeValues(e,t){const r=getParsedType(e),n=getParsedType(t);if(e===t)return{valid:!0,data:e};if(r===ZodParsedType.object&&n===ZodParsedType.object){const i=util.objectKeys(t),s=util.objectKeys(e).filter(d=>i.indexOf(d)!==-1),l={...e,...t};for(const d of s){const p=mergeValues(e[d],t[d]);if(!p.valid)return{valid:!1};l[d]=p.data}return{valid:!0,data:l}}else if(r===ZodParsedType.array&&n===ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s{if(isAborted(s)||isAborted(l))return INVALID;const d=mergeValues(s.value,l.value);return d.valid?((isDirty(s)||isDirty(l))&&r.dirty(),{status:r.value,value:d.data}):(addIssueToContext(n,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,l])=>i(s,l)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ZodIntersection.create=(e,t,r)=>new ZodIntersection({left:e,right:t,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(r)});class ZodTuple extends ZodType{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.array)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:n.parsedType}),INVALID;if(n.data.lengththis._def.items.length&&(addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const s=[...n.data].map((l,d)=>{const p=this._def.items[d]||this._def.rest;return p?p._parse(new ParseInputLazyPath(n,l,n.path,d)):null}).filter(l=>!!l);return n.common.async?Promise.all(s).then(l=>ParseStatus.mergeArray(r,l)):ParseStatus.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new ZodTuple({...this._def,rest:t})}}ZodTuple.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:e,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(t)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.object)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:n.parsedType}),INVALID;const i=[],s=this._def.keyType,l=this._def.valueType;for(const d in n.data)i.push({key:s._parse(new ParseInputLazyPath(n,d,n.path,d)),value:l._parse(new ParseInputLazyPath(n,n.data[d],n.path,d)),alwaysSet:d in n.data});return n.common.async?ParseStatus.mergeObjectAsync(r,i):ParseStatus.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof ZodType?new ZodRecord({keyType:t,valueType:r,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(n)}):new ZodRecord({keyType:ZodString.create(),valueType:t,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(r)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.map)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:n.parsedType}),INVALID;const i=this._def.keyType,s=this._def.valueType,l=[...n.data.entries()].map(([d,p],m)=>({key:i._parse(new ParseInputLazyPath(n,d,n.path,[m,"key"])),value:s._parse(new ParseInputLazyPath(n,p,n.path,[m,"value"]))}));if(n.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of l){const m=await p.key,v=await p.value;if(m.status==="aborted"||v.status==="aborted")return INVALID;(m.status==="dirty"||v.status==="dirty")&&r.dirty(),d.set(m.value,v.value)}return{status:r.value,value:d}})}else{const d=new Map;for(const p of l){const m=p.key,v=p.value;if(m.status==="aborted"||v.status==="aborted")return INVALID;(m.status==="dirty"||v.status==="dirty")&&r.dirty(),d.set(m.value,v.value)}return{status:r.value,value:d}}}}ZodMap.create=(e,t,r)=>new ZodMap({valueType:t,keyType:e,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(r)});class ZodSet extends ZodType{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ZodParsedType.set)return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:n.parsedType}),INVALID;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const s=this._def.valueType;function l(p){const m=new Set;for(const v of p){if(v.status==="aborted")return INVALID;v.status==="dirty"&&r.dirty(),m.add(v.value)}return{status:r.value,value:m}}const d=[...n.data.values()].map((p,m)=>s._parse(new ParseInputLazyPath(n,p,n.path,m)));return n.common.async?Promise.all(d).then(p=>l(p)):l(d)}min(t,r){return new ZodSet({...this._def,minSize:{value:t,message:errorUtil.toString(r)}})}max(t,r){return new ZodSet({...this._def,maxSize:{value:t,message:errorUtil.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(t)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ZodParsedType.function)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:r.parsedType}),INVALID;function n(d,p){return makeIssue({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,getErrorMap(),errorMap].filter(m=>!!m),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:p}})}function i(d,p){return makeIssue({data:d,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,getErrorMap(),errorMap].filter(m=>!!m),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:p}})}const s={errorMap:r.common.contextualErrorMap},l=r.data;if(this._def.returns instanceof ZodPromise){const d=this;return OK(async function(...p){const m=new ZodError([]),v=await d._def.args.parseAsync(p,s).catch($=>{throw m.addIssue(n(p,$)),m}),b=await Reflect.apply(l,this,v);return await d._def.returns._def.type.parseAsync(b,s).catch($=>{throw m.addIssue(i(b,$)),m})})}else{const d=this;return OK(function(...p){const m=d._def.args.safeParse(p,s);if(!m.success)throw new ZodError([n(p,m.error)]);const v=Reflect.apply(l,this,m.data),b=d._def.returns.safeParse(v,s);if(!b.success)throw new ZodError([i(v,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ZodFunction({...this._def,args:ZodTuple.create(t).rest(ZodUnknown.create())})}returns(t){return new ZodFunction({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new ZodFunction({args:t||ZodTuple.create([]).rest(ZodUnknown.create()),returns:r||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(n)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(t)});class ZodLiteral extends ZodType{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return addIssueToContext(r,{received:r.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:t.data}}get value(){return this._def.value}}ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(t)});function createZodEnum(e,t){return new ZodEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(t)})}class ZodEnum extends ZodType{constructor(){super(...arguments),_ZodEnum_cache.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return addIssueToContext(r,{expected:util.joinValues(n),received:r.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodEnum_cache)||__classPrivateFieldSet(this,_ZodEnum_cache,new Set(this._def.values)),!__classPrivateFieldGet(this,_ZodEnum_cache).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return addIssueToContext(r,{received:r.data,code:ZodIssueCode.invalid_enum_value,options:n}),INVALID}return OK(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ZodEnum.create(t,{...this._def,...r})}exclude(t,r=this._def){return ZodEnum.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}_ZodEnum_cache=new WeakMap,ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),_ZodNativeEnum_cache.set(this,void 0)}_parse(t){const r=util.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ZodParsedType.string&&n.parsedType!==ZodParsedType.number){const i=util.objectValues(r);return addIssueToContext(n,{expected:util.joinValues(i),received:n.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(__classPrivateFieldGet(this,_ZodNativeEnum_cache)||__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util.getValidEnumValues(this._def.values))),!__classPrivateFieldGet(this,_ZodNativeEnum_cache).has(t.data)){const i=util.objectValues(r);return addIssueToContext(n,{received:n.data,code:ZodIssueCode.invalid_enum_value,options:i}),INVALID}return OK(t.data)}get enum(){return this._def.values}}_ZodNativeEnum_cache=new WeakMap,ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(t)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ZodParsedType.promise&&r.common.async===!1)return addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:r.parsedType}),INVALID;const n=r.parsedType===ZodParsedType.promise?r.data:Promise.resolve(r.data);return OK(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(t)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:l=>{addIssueToContext(n,l),l.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const l=i.transform(n.data,s);if(n.common.async)return Promise.resolve(l).then(async d=>{if(r.value==="aborted")return INVALID;const p=await this._def.schema._parseAsync({data:d,path:n.path,parent:n});return p.status==="aborted"?INVALID:p.status==="dirty"||r.value==="dirty"?DIRTY(p.value):p});{if(r.value==="aborted")return INVALID;const d=this._def.schema._parseSync({data:l,path:n.path,parent:n});return d.status==="aborted"?INVALID:d.status==="dirty"||r.value==="dirty"?DIRTY(d.value):d}}if(i.type==="refinement"){const l=d=>{const p=i.refinement(d,s);if(n.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(n.common.async===!1){const d=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return d.status==="aborted"?INVALID:(d.status==="dirty"&&r.dirty(),l(d.value),{status:r.value,value:d.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(d=>d.status==="aborted"?INVALID:(d.status==="dirty"&&r.dirty(),l(d.value).then(()=>({status:r.value,value:d.value}))))}if(i.type==="transform")if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!isValid(l))return l;const d=i.transform(l.value,s);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:d}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>isValid(l)?Promise.resolve(i.transform(l.value,s)).then(d=>({status:r.value,value:d})):l);util.assertNever(i)}}ZodEffects.create=(e,t,r)=>new ZodEffects({schema:e,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:t,...processCreateParams(r)}),ZodEffects.createWithPreprocess=(e,t,r)=>new ZodEffects({schema:t,effect:{type:"preprocess",transform:e},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(r)});class ZodOptional extends ZodType{_parse(t){return this._getType(t)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(t)});class ZodNullable extends ZodType{_parse(t){return this._getType(t)===ZodParsedType.null?OK(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(t)});class ZodDefault extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...processCreateParams(t)});class ZodCatch extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return isAsync(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...processCreateParams(t)});class ZodNaN extends ZodType{_parse(t){if(this._getType(t)!==ZodParsedType.nan){const n=this._getOrReturnCtx(t);return addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:n.parsedType}),INVALID}return{status:"valid",value:t.data}}}ZodNaN.create=e=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(e)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?INVALID:s.status==="dirty"?(r.dirty(),DIRTY(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?INVALID:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new ZodPipeline({in:t,out:r,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(t){const r=this._def.innerType._parse(t),n=i=>(isValid(i)&&(i.value=Object.freeze(i.value)),i);return isAsync(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}ZodReadonly.create=(e,t)=>new ZodReadonly({innerType:e,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(t)});function cleanParams(e,t){const r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function custom(e,t={},r){return e?ZodAny.create().superRefine((n,i)=>{var s,l;const d=e(n);if(d instanceof Promise)return d.then(p=>{var m,v;if(!p){const b=cleanParams(t,n),S=(v=(m=b.fatal)!==null&&m!==void 0?m:r)!==null&&v!==void 0?v:!0;i.addIssue({code:"custom",...b,fatal:S})}});if(!d){const p=cleanParams(t,n),m=(l=(s=p.fatal)!==null&&s!==void 0?s:r)!==null&&l!==void 0?l:!0;i.addIssue({code:"custom",...p,fatal:m})}}):ZodAny.create()}const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(e,t={message:`Input not instance of ${e.name}`})=>custom(r=>r instanceof e,t),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:e=>ZodString.create({...e,coerce:!0}),number:e=>ZodNumber.create({...e,coerce:!0}),boolean:e=>ZodBoolean.create({...e,coerce:!0}),bigint:e=>ZodBigInt.create({...e,coerce:!0}),date:e=>ZodDate.create({...e,coerce:!0})},NEVER=INVALID;var z=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID,DIRTY,OK,isAborted,isDirty,isValid,isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,datetimeRegex,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER,ZodIssueCode,quotelessJson,ZodError});const countryCodeSchema=z.string().brand();function dumpCSSVariable(e){return`var(${e})`}function glob(e,t){return new RegExp("^"+e.replace(/([.?+^$[\]\\(){}|/-])/g,"\\$1").replace(/\*/g,".*")+"$").test(t)}function anyGlob(e,t){return e.some(r=>glob(r,t))}const ICONS=["checkmark","arrowRight","arrowLeft","user","favorite","chevronUp","chevronDown","chevronRight","chevronLeft","home","fire","lock","trophy","close","help","helpOutline","shop","copy","radioOn","radioOff","unchecked","checked","discount","info","redeem","clock","external","warning","leave","error"];class RateLimiter{constructor(t){wt(this,"reqTimestamps",[]);wt(this,"window");wt(this,"numRequests");this.window=t.window,this.numRequests=t.numRequests}check(t=!1){const r=this.reqTimestamps.findIndex(n=>n>=Date.now()-this.window);return r===-1?this.reqTimestamps.length=0:this.reqTimestamps.splice(0,r),this.reqTimestamps.length>=this.numRequests&&!t?!1:(this.reqTimestamps.push(Date.now()),!0)}}const getStorage=e=>localStorage;function getFromStorage(e,t){try{const n=getStorage(e).getItem(t);return n?JSON.parse(n):null}catch(r){return console.error(`Error getting ${t} from ${e}Storage:`,r),null}}function setInStorage(e,t,r){try{getStorage(e).setItem(t,JSON.stringify(r))}catch(n){console.error(`Error setting ${t} in ${e}Storage:`,n)}}function joinWithAnd(e,t="and"){return e.length===1?e[0]:e.slice(0,-1).join(", ")+` ${t} `+e.slice(-1)[0]}function lowerFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}function getTimeRemainingStr(e){const t=Math.floor(e/86400),r=Math.floor(e%(3600*24)/3600),n=Math.floor(e%3600/60),i=Math.floor(e%60);return t>0?`${t}d ${r}h`:r>0?`${r}:${n<10?"0":""}${n}:${i<10?"0":""}${i}`:`${n}:${i<10?"0":""}${i}`}function unknownErrToStr(e){return typeof e=="string"?e:e instanceof Error?e.message:typeof e=="object"&&e!==null&&"error"in e&&typeof e.error=="string"?e.error:"An unknown error occurred"}async function wait(e){return new Promise(t=>setTimeout(t,e))}async function timeout(e,t){return Promise.race([wait(e),t()])}function buildServicePath(e,t,r,n){if(!e)throw new Error("Shop is not set");const i=new URL("https://backend.alia-cloudflare.com");for(const[s,l]of Object.entries(r))t=t.replace(`:${s}`,String(l));i.pathname=`/user${t}`,i.searchParams.set("shop",e);for(const[s,l]of Object.entries(n))l!=null&&i.searchParams.set(s,String(l));return i.toString()}let hasLoggedRateLimitExceeded=!1;const rateLimiter=new RateLimiter({window:5e3,numRequests:30});async function serviceFetch({shop:e,method:t,path:r,args:n,ignoreRateLimit:i,headers:s,keepAlive:l}){const d=t!=="GET"&&"body"in n;if(!rateLimiter.check(i))throw hasLoggedRateLimitExceeded||(hasLoggedRateLimitExceeded=!0,await serviceFetch({shop:e,method:"POST",path:"/errors",headers:s,args:{body:{message:"Customer app rate limit exceeded",data:{method:t,path:r,args:n}}},ignoreRateLimit:!0})),new Error("Please try again");const p=await fetch(buildServicePath(e,r,"params"in n&&n.params,"query"in n&&n.query),{method:t,keepalive:l,headers:{...d?{"Content-Type":"application/json"}:{},...s},...d?{body:JSON.stringify("body"in n?n.body:void 0)}:{}});if(p.status===204)return;const m=await p.json();if(p.ok)return m;throw typeof m!="object"||m==null?new Error("An unknown error occurred"):"error"in m&&typeof m.error=="string"?new Error(m.error):new Error("An unknown error occurred")}function useSuspenseQuery(e){return useQuery(e)}function useServiceFetch(){var i;const{shop:e,jwt:t,initialData:r}=useCustomerAppContext(),n=(i=r.userFlow)==null?void 0:i.flowID;return reactExports.useCallback((s,l,d,p)=>serviceFetch({shop:e,method:s,path:l,args:d,headers:{[JWT_HEADER]:t,...n?{[FLOW_ID_HEADER]:String(n)}:{}},...p}),[e,t,n])}function useLogError(){const e=useServiceFetch();return useMutation({mutationKey:["errors","logError"],mutationFn:t=>e("POST","/errors",{body:t})})}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var hasRequiredReactJsxRuntime_production_min;function requireReactJsxRuntime_production_min(){if(hasRequiredReactJsxRuntime_production_min)return reactJsxRuntime_production_min;hasRequiredReactJsxRuntime_production_min=1;var e=requireReact(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(d,p,m){var v,b={},S=null,$=null;m!==void 0&&(S=""+m),p.key!==void 0&&(S=""+p.key),p.ref!==void 0&&($=p.ref);for(v in p)n.call(p,v)&&!s.hasOwnProperty(v)&&(b[v]=p[v]);if(d&&d.defaultProps)for(v in p=d.defaultProps,p)b[v]===void 0&&(b[v]=p[v]);return{$$typeof:t,type:d,key:S,ref:$,props:b,_owner:i.current}}return reactJsxRuntime_production_min.Fragment=r,reactJsxRuntime_production_min.jsx=l,reactJsxRuntime_production_min.jsxs=l,reactJsxRuntime_production_min}var hasRequiredJsxRuntime;function requireJsxRuntime(){return hasRequiredJsxRuntime||(hasRequiredJsxRuntime=1,jsxRuntime.exports=requireReactJsxRuntime_production_min()),jsxRuntime.exports}var jsxRuntimeExports=requireJsxRuntime();const jsx=jsxRuntimeExports.jsx,jsxs=jsxRuntimeExports.jsxs,Fragment=jsxRuntimeExports.Fragment;class CommonErrorBoundaryImpl extends React.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,r){var n,i;(i=(n=this.props).onError)==null||i.call(n,t)}render(){return this.state.hasError?this.props.fallback??null:this.props.children}}const CommonErrorBoundary=({children:e,onError:t,fallback:r})=>{const n=reactExports.useRef(!1),i=useLogError();return jsx(CommonErrorBoundaryImpl,{onError:s=>{t==null||t(s),!n.current&&(n.current=!0,i.mutate({message:s.message,data:{stack:s.stack}}))},fallback:r,children:e})};var define_process_env_default={};const ENCRYPTION_KEY=define_process_env_default.ENCRYPTION_KEY;function encrypt(e,t=ENCRYPTION_KEY){if(!t)throw new Error("ENCRYPTION_KEY environment variable not set");const r="aes-256-cbc",n=crypto.randomBytes(16),i=crypto.createCipheriv(r,Buffer.from(t,"hex"),n);let s=i.update(e,"utf8","hex");return s+=i.final("hex"),n.toString("hex")+":"+s}const encryptableSchema=z.object({__encrypted:z.boolean(),value:z.string(),updated:z.boolean().optional()}).transform(e=>e.__encrypted?e:{__encrypted:!0,value:encrypt(e.value),updated:e.updated});function encrypted(e){return encryptableSchema.parse({__encrypted:!1,value:e})}const backCompatEncryptableSchema=encryptableSchema.or(z.string().transform(e=>encrypted(e))),MAX_INACTIVE_SUBSCRIBE_THRESHOLD=10*60*1e3,attentiveUserConfigSchema=z.object({signUpSourceId:z.string().optional(),singleOptIn:z.boolean().optional(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),attentiveConfigSchema=z.object({type:z.literal("ATTENTIVE"),accessToken:backCompatEncryptableSchema,userDefaults:attentiveUserConfigSchema}),attentiveEventSchema=z.object({type:z.enum(["Alia Poll Answered","Alia Reward Claimed"]),properties:z.record(z.string(),z.string().optional())}),attentiveUserDataSchema=z.object({type:z.literal("ATTENTIVE"),created:z.boolean(),events:z.array(attentiveEventSchema),attributes:z.record(z.string(),z.string().optional()),configOverrides:attentiveUserConfigSchema.deepPartial().optional()}),attentiveSubscriptionResultSchema=z.enum(["smsAlreadySubscribed","emailAlreadySubscribed"]),contloUserConfigSchema=z.object({inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),contloConfigSchema=z.object({type:z.literal("CONTLO"),apiKey:backCompatEncryptableSchema,userDefaults:contloUserConfigSchema}),contloUserDataSchema=z.object({type:z.literal("CONTLO"),properties:z.record(z.string(),z.string().optional()),configOverrides:contloUserConfigSchema.deepPartial().optional(),created:z.boolean()}),klaviyoOAuthUserConfigSchema=z.object({emailListID:z.string().optional(),smsListID:z.string().optional(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),klaviyoOAuthConfigSchema=z.object({type:z.literal("KLAVIYO_OAUTH"),accessToken:backCompatEncryptableSchema,refreshToken:backCompatEncryptableSchema,scope:z.array(z.string()),userDefaults:klaviyoOAuthUserConfigSchema}),klaviyoOAuthPropertyValueSchema=z.union([z.string(),z.number(),z.boolean(),z.array(z.string()),z.undefined()]),klaviyoOAuthEventSchema=z.object({name:z.enum(["Alia Poll Answered","Alia Reward Claimed"]),uniqueID:z.number().optional(),properties:z.record(z.string(),klaviyoOAuthPropertyValueSchema.optional())}),klaviyoOAuthUserDataSchema=z.object({type:z.literal("KLAVIYO_OAUTH"),profileID:z.string().optional(),subscribedLists:z.array(z.string()).optional(),events:z.array(klaviyoOAuthEventSchema),properties:z.record(z.string(),klaviyoOAuthPropertyValueSchema.optional()),configOverrides:klaviyoOAuthUserConfigSchema.deepPartial().optional()}),klaviyoOAuthSubscriptionResultSchema=z.enum(["smsAlreadySubscribed","emailAlreadySubscribed"]),klaviyoUserConfigSchema=z.object({emailListID:z.string().optional(),smsListID:z.string().optional(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),klaviyoConfigSchema=z.object({type:z.literal("KLAVIYO"),key:backCompatEncryptableSchema,userDefaults:klaviyoUserConfigSchema}),klaviyoPropertyValueSchema=z.union([z.string(),z.number(),z.boolean(),z.array(z.string()),z.undefined()]),klaviyoEventSchema=z.object({name:z.enum(["Alia Poll Answered","Alia Reward Claimed"]),uniqueID:z.number().optional(),properties:z.record(z.string(),klaviyoPropertyValueSchema.optional())}),klaviyoUserDataSchema=z.object({type:z.literal("KLAVIYO"),profileID:z.string().optional(),subscribedLists:z.array(z.string()).optional(),events:z.array(klaviyoEventSchema),properties:z.record(z.string(),klaviyoPropertyValueSchema.optional()),configOverrides:klaviyoUserConfigSchema.deepPartial().optional()}),klaviyoSubscriptionResultSchema=z.enum(["smsAlreadySubscribed","emailAlreadySubscribed"]),listrakEmailUserConfigSchema=z.object({listId:z.number().optional(),segmentationFieldGroupId:z.number().optional(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD),doubleOptIn:z.boolean().optional(),eventIds:z.string().optional()}),listrakEmailConfigSchema=z.object({type:z.literal("LISTRAK_EMAIL"),clientId:z.string(),clientSecret:backCompatEncryptableSchema,token:backCompatEncryptableSchema,userDefaults:listrakEmailUserConfigSchema}),listrakEmailUserDataSchema=z.object({type:z.literal("LISTRAK_EMAIL"),contactId:z.number().optional(),properties:z.record(z.string(),z.string().optional()),configOverrides:listrakEmailUserConfigSchema.deepPartial().optional()}),omnisendUserConfigSchema=z.object({sendWelcomeEmail:z.boolean(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),omnisendConfigSchema=z.object({type:z.literal("OMNISEND"),key:backCompatEncryptableSchema,userDefaults:omnisendUserConfigSchema}),omnisendEventSchema=z.object({name:z.string(),systemName:z.enum(["alia_reward_claimed","alia_poll_answer"]),fields:z.record(z.string(),z.string().optional())}),omnisendUserDataSchema=z.object({type:z.literal("OMNISEND"),created:z.boolean(),events:z.array(omnisendEventSchema),configOverrides:omnisendUserConfigSchema.deepPartial().optional(),properties:z.record(z.string(),z.string().optional()).optional()}),onetextUserConfigSchema=z.object({inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),onetextConfigSchema=z.object({type:z.literal("ONETEXT"),apiKey:z.string(),userDefaults:onetextUserConfigSchema}),onetextUserDataSchema=z.object({type:z.literal("ONETEXT"),configOverrides:onetextUserConfigSchema.deepPartial().optional()}),postscriptUserConfigSchema=z.object({keywordID:z.string(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),postscriptConfigSchema=z.object({type:z.literal("POSTSCRIPT"),key:backCompatEncryptableSchema,userDefaults:postscriptUserConfigSchema,webhookToken:backCompatEncryptableSchema.optional()}),postscriptEventSchema=z.object({type:z.enum(["poll_answered","reward_claimed"]),properties:z.record(z.string(),z.string().optional())}),postscriptPropertyValueSchema=z.union([z.string(),z.number(),z.array(z.string())]),postscriptUserDataSchema=z.object({type:z.literal("POSTSCRIPT"),profileID:z.string().optional(),created:z.boolean(),events:z.array(postscriptEventSchema),properties:z.record(z.string(),postscriptPropertyValueSchema).optional(),configOverrides:postscriptUserConfigSchema.deepPartial().optional()}),postscriptSubscriptionResultSchema=z.enum(["smsAlreadySubscribed"]),recartUserConfigSchema=z.object({inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),recartConfigSchema=z.object({type:z.literal("RECART"),apiKey:encryptableSchema,userDefaults:recartUserConfigSchema}),recartUserDataSchema=z.object({type:z.literal("RECART"),configOverrides:recartUserConfigSchema.deepPartial().optional()}),sendlaneUserConfigSchema=z.object({listID:z.string().optional(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),sendlaneConfigSchema=z.object({type:z.literal("SENDLANE"),key:backCompatEncryptableSchema,personalizations:z.object({discount_code_id:z.number().optional(),discount_text_id:z.number().optional(),discount_expiration_id:z.number().optional()}).optional(),userDefaults:sendlaneUserConfigSchema}),sendlanePropertySchema=z.object({personalizationID:z.number().optional(),value:z.string().nullish()}),sendlaneUserDataSchema=z.object({type:z.literal("SENDLANE"),contactID:z.number().optional(),properties:z.array(sendlanePropertySchema),configOverrides:sendlaneUserConfigSchema.deepPartial().optional()}),shopifyUserConfigSchema=z.object({inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD),tagsDisabled:z.boolean().optional()}),shopifyIntegrationConfigSchema=z.object({type:z.literal("SHOPIFY"),userDefaults:shopifyUserConfigSchema}),shopifyUserDataSchema=z.object({type:z.literal("SHOPIFY"),tags:z.array(z.string()).optional(),configOverrides:shopifyUserConfigSchema.deepPartial().optional()}),shopifySubscriptionResultSchema=z.enum(["alreadySignedUp","hasMadeOrder"]);z.object({type:z.literal("TCPA")});const tcpaUserDataSchema=z.object({type:z.literal("TCPA")}),profileCreatedSourceSchema=z.union([z.object({type:z.literal("widget")}),z.object({type:z.literal("popup")})]),yotpoUserConfigSchema=z.object({emailListID:z.number().optional(),smsListID:z.number().optional(),inactiveSubscribeThreshold:z.number().max(MAX_INACTIVE_SUBSCRIBE_THRESHOLD)}),yotpoConfigSchema=z.object({type:z.literal("YOTPO"),appKey:z.string(),token:backCompatEncryptableSchema,userDefaults:yotpoUserConfigSchema}),yotpoEventSchema=z.object({type:z.enum(["alia_poll_answered","alia_reward_claimed"]),properties:z.record(z.string(),z.string().optional())}),yotpoUserDataSchema=z.object({type:z.literal("YOTPO"),created:z.boolean(),source:profileCreatedSourceSchema.optional(),events:z.array(yotpoEventSchema),configOverrides:yotpoUserConfigSchema.deepPartial().optional()}),zerobounceConfigSchema=z.object({type:z.literal("ZEROBOUNCE"),apiKey:backCompatEncryptableSchema}),zerobounceUserDataSchema=z.object({type:z.literal("ZEROBOUNCE")});z.discriminatedUnion("type",[attentiveConfigSchema,contloConfigSchema,klaviyoConfigSchema,omnisendConfigSchema,onetextConfigSchema,postscriptConfigSchema,sendlaneConfigSchema,shopifyIntegrationConfigSchema,yotpoConfigSchema,klaviyoOAuthConfigSchema,listrakEmailConfigSchema,zerobounceConfigSchema,recartConfigSchema]);const integrationOverridesSchema=z.object({attentive:attentiveUserConfigSchema,contlo:contloUserConfigSchema,klaviyo:klaviyoUserConfigSchema,omnisend:omnisendUserConfigSchema,onetext:onetextUserConfigSchema,postscript:postscriptUserConfigSchema,sendlane:sendlaneUserConfigSchema,shopify:shopifyUserConfigSchema,yotpo:yotpoUserConfigSchema,klaviyoOAuth:klaviyoOAuthUserConfigSchema,listrakEmail:listrakEmailUserConfigSchema,recart:recartUserConfigSchema}).deepPartial();z.discriminatedUnion("type",[attentiveUserDataSchema,contloUserDataSchema,klaviyoUserDataSchema,omnisendUserDataSchema,onetextUserDataSchema,postscriptUserDataSchema,sendlaneUserDataSchema,shopifyUserDataSchema,yotpoUserDataSchema,klaviyoOAuthUserDataSchema,listrakEmailUserDataSchema,zerobounceUserDataSchema,tcpaUserDataSchema,recartUserDataSchema]);const subscriptionResultSchema=z.discriminatedUnion("type",[z.object({type:z.literal("shopify"),result:shopifySubscriptionResultSchema}),z.object({type:z.literal("postscript"),result:postscriptSubscriptionResultSchema}),z.object({type:z.literal("attentive"),result:attentiveSubscriptionResultSchema}),z.object({type:z.literal("klaviyo"),result:klaviyoSubscriptionResultSchema}),z.object({type:z.literal("klaviyo-oauth"),result:klaviyoOAuthSubscriptionResultSchema})]),typeValues=subscriptionResultSchema.options.map(e=>e.shape.type.value);z.enum([typeValues[0],...typeValues.slice(1)]);const merchantSettingsSchema=z.object({onSignupHook:z.string(),deleteOldDiscounts:z.boolean(),customCodeFilter:z.string(),primaryDomain:z.string(),otherDomains:z.array(z.string()),useShadowDOM:z.boolean()}),deepPartialMerchantSettingsSchema=merchantSettingsSchema.deepPartial();var LogBucket=(e=>(e.SYSTEM_ERROR="system_error",e.MERCHANT_ERROR="merchant_error",e.USER_OR_OTHER_ERROR="user_error",e.DEBUG="debug",e.MONITORING="monitoring",e))(LogBucket||{});function ok(e){return{ok:!0,data:e}}const customError=({error:e,message:t="An error occurred",httpStatus:r=500,bucket:n=LogBucket.SYSTEM_ERROR,data:i})=>({ok:!1,error:e,data:i,message:t,httpStatus:r,bucket:n}),internalZodParseError=(e="Zod parse error",t,r)=>customError({error:"zodParseError",message:e,data:{raw:t,error:r},httpStatus:500,bucket:LogBucket.SYSTEM_ERROR}),INITIAL_SCHEMA_VERSION=1,invalidSchemaVersionError=(e,t)=>customError({error:"invalidSchemaVersion",message:e,data:t,httpStatus:500,bucket:LogBucket.SYSTEM_ERROR});class SchemaVersion{constructor(t){this.schema=t.schema,"number"in t?(this.number=t.number,this.migrate=t.migrate,this.prevVersion=t.prevVersion):this.number=t.initialVersionOverride??INITIAL_SCHEMA_VERSION}next({schema:t,migrate:r}){return new SchemaVersion({schema:t,number:this.number+1,migrate:r,prevVersion:this})}parseDocumentVersion(t){if(t._version===this.number){const r=this.schema.safeParse(t);return r.success?ok(r.data):internalZodParseError("Failed to parse document against schema",t,r)}if(t._version{const n=e.parseDocumentVersion(t);return n.ok?{_version:e.number,...n.data}:(n.error==="zodParseError"?n.data.error.error.issues.forEach(r.addIssue):n.error==="invalidSchemaVersion"?r.addIssue({code:"custom",message:n.message}):assertNever(n),z.NEVER)})}const classSchema=z.enum(["shiny","pulse","focus-within:ring-2","animate-fade-in","animate-fade-in-left","animate-fade-in-right","animate-fade-in-up","animate-fade-in-down","animate-slide-up","animate-slide-down","animate-slide-left","animate-slide-right","placeholder-primary-400","placeholder-accent-foreground-400","placeholder-accent-400","placeholder-background-400"]),cssSchema=z.record(z.string().optional()),stylesByStateSchema=z.object({default:cssSchema.optional(),hover:cssSchema.optional(),focusWithin:cssSchema.optional(),disabled:cssSchema.optional(),error:cssSchema.optional(),placeholder:cssSchema.optional()}),ERROR_CLASSNAME="alia-error",stylesByBreakpointSchema=z.object({classes:z.array(classSchema).optional(),default:stylesByStateSchema.optional(),1024:stylesByStateSchema.optional()}),DEFAULT_STYLES={classes:[],default:{default:{}}};function buildDefaultStyles(e,t=[]){return{classes:t,default:{default:e}}}const sharedStyleHandleSchema=z.string().brand("SharedStyleHandle"),sharedStyleSchema=z.object({handle:sharedStyleHandleSchema,title:z.string(),styles:stylesByBreakpointSchema});function SHARED_STYLE_CLASSNAME(e){return e?`alia-style-${e}`:void 0}function buildSharedStyle(e,t,r=DEFAULT_STYLES){return{handle:t,title:e,styles:r}}const ADDITIONAL_PREFIX$1="--additional-color-";function dumpColorVariable(e){return typeof e=="number"?`${ADDITIONAL_PREFIX$1}${e}`:e}const fontsSchema=z.object({body:z.string(),display:z.string(),additional:z.array(z.string())}),ADDITIONAL_PREFIX="--additional-font-";function dumpFontVariable(e){return typeof e=="number"?`${ADDITIONAL_PREFIX}${e}`:e}const stylesSchema=z.object({text:z.array(sharedStyleSchema),button:z.array(sharedStyleSchema),input:z.array(sharedStyleSchema)}),stylesOverrideSchema=z.object({text:z.array(sharedStyleSchema).optional(),button:z.array(sharedStyleSchema).optional(),input:z.array(sharedStyleSchema).optional()}),HEADING_1_HANDLE="heading-1",HEADING_2_HANDLE="heading-2",HEADING_DEFAULT_HANDLE="heading-default",BODY_1_HANDLE="body-1",BODY_2_HANDLE="body-2",BODY_DEFAULT_HANDLE="body-default",COMPLIANCE_HANDLE="compliance",LINK_HANDLE="link",PRIMARY_BUTTON_HANDLE="button-primary",SECONDARY_BUTTON_HANDLE="button-secondary",PLAIN_BUTTON_HANDLE="button-plain",ICON_BUTTON_HANDLE="button-icon",DEFAULT_INPUT_HANDLE="input",hexSchema=z.string().regex(/^#([0-9a-fA-F]{6})$/),colorsSchema=z.object({primary:hexSchema,accent:hexSchema,background:hexSchema,accentForeground:hexSchema,additional:z.array(hexSchema)}),borderRadiusSchema=z.number().min(0),schema=z.object({fonts:fontsSchema,colors:colorsSchema,borderRadius:borderRadiusSchema,styles:stylesSchema}),v1$4=new SchemaVersion({schema}),overrideSchema=z.object({fonts:fontsSchema.optional(),colors:colorsSchema.optional(),borderRadius:borderRadiusSchema.optional(),styles:stylesOverrideSchema.optional()}),overrideV1=new SchemaVersion({schema:overrideSchema}),BORDER_RADIUS_VARIABLE="--border-radius-lg";function dumpThemeVariable(e){if(e.type==="font")return dumpFontVariable(e.font);if(e.type==="color")return dumpColorVariable(e.color);if(e.type==="borderRadius")return BORDER_RADIUS_VARIABLE;assertNever(e)}function overrideThemeConfig(e,t){var r,n,i,s,l,d;return{_version:e._version,colors:(t==null?void 0:t.colors)??e.colors,fonts:(t==null?void 0:t.fonts)??e.fonts,borderRadius:(t==null?void 0:t.borderRadius)??e.borderRadius,styles:{text:((r=t==null?void 0:t.styles)==null?void 0:r.text)??((n=e.styles)==null?void 0:n.text),button:((i=t==null?void 0:t.styles)==null?void 0:i.button)??((s=e.styles)==null?void 0:s.button),input:((l=t==null?void 0:t.styles)==null?void 0:l.input)??((d=e.styles)==null?void 0:d.input)}}}createVersionedSchema(v1$4);const themeOverrideConfigSchema=createVersionedSchema(overrideV1);overrideV1.literal({}),v1$4.literal({fonts:{body:"DM Sans",display:"DM Serif Display",additional:[]},colors:{primary:"#000000",accent:"#3D5A80",background:"#FAFAFA",accentForeground:"#FFFFFF",additional:[]},borderRadius:8,styles:{text:[buildSharedStyle("Heading 1",HEADING_1_HANDLE,buildDefaultStyles({fontFamily:dumpCSSVariable(dumpFontVariable("--display-font")),fontSize:"64px",fontWeight:"700",letterSpacing:"-2px"})),buildSharedStyle("Heading 2",HEADING_2_HANDLE,buildDefaultStyles({fontFamily:dumpCSSVariable(dumpFontVariable("--display-font")),fontSize:"48px",fontWeight:"600",letterSpacing:"-1px"})),buildSharedStyle("Heading (education)",HEADING_DEFAULT_HANDLE,buildDefaultStyles({fontFamily:dumpCSSVariable(dumpFontVariable("--display-font")),fontSize:"32px",fontWeight:"600"})),buildSharedStyle("Body 1",BODY_1_HANDLE,buildDefaultStyles({fontSize:"24px",fontWeight:"500"})),buildSharedStyle("Body 2",BODY_2_HANDLE,buildDefaultStyles({fontSize:"20px",fontWeight:"500"})),buildSharedStyle("Body (default)",BODY_DEFAULT_HANDLE,buildDefaultStyles({fontSize:"16px",color:`rgb(${dumpCSSVariable(dumpColorVariable("--primary-color"))})`,fontFamily:dumpCSSVariable(dumpFontVariable("--body-font")),lineHeight:"1.2"})),buildSharedStyle("Compliance",COMPLIANCE_HANDLE,buildDefaultStyles({fontSize:"10px",color:`rgb(${dumpCSSVariable(dumpColorVariable("--primary-color"))} / 0.5)`}))],button:[buildSharedStyle("Primary button",PRIMARY_BUTTON_HANDLE,{classes:["shiny"],default:{default:{borderWidth:"2px",borderColor:`rgb(${dumpCSSVariable(dumpColorVariable("--accent-color"))})`,borderRadius:dumpCSSVariable(dumpThemeVariable({type:"borderRadius"})),color:`rgb(${dumpCSSVariable(dumpColorVariable("--accent-foreground"))})`,backgroundColor:`rgb(${dumpCSSVariable(dumpColorVariable("--accent-color"))})`,padding:"1rem",fontSize:"18px"},disabled:{opacity:"0.5"}}}),buildSharedStyle("Secondary button",SECONDARY_BUTTON_HANDLE,{default:{default:{borderWidth:"2px",borderColor:`rgb(${dumpCSSVariable(dumpColorVariable("--accent-color"))})`,borderRadius:dumpCSSVariable(dumpThemeVariable({type:"borderRadius"})),color:`rgb(${dumpCSSVariable(dumpColorVariable("--accent-color"))})`,padding:"0.625rem",fontSize:"18px"},disabled:{opacity:"0.5"}}}),buildSharedStyle("Plain button",PLAIN_BUTTON_HANDLE,{default:{default:{color:`rgb(${dumpCSSVariable(dumpColorVariable("--primary-color"))} / 0.7)`,borderColor:`rgb(${dumpCSSVariable(dumpColorVariable("--primary-color"))} / 0.8)`,textDecoration:"underline",fontSize:"16px"},disabled:{opacity:"0.5"}}}),buildSharedStyle("Icon button",ICON_BUTTON_HANDLE,{default:{default:{borderRadius:dumpCSSVariable(dumpThemeVariable({type:"borderRadius"})),fontFamily:dumpCSSVariable(dumpFontVariable("--display-font")),fontSize:"18px",color:`rgb(${dumpCSSVariable(dumpColorVariable("--accent-foreground"))})`,fontWeight:"600",backgroundColor:`rgb(${dumpCSSVariable(dumpColorVariable("--accent-color"))})`,padding:"0.75rem"},disabled:{opacity:"0.5"}}})],input:[buildSharedStyle("Input",DEFAULT_INPUT_HANDLE,{classes:["focus-within:ring-2"],default:{default:{padding:"1rem",borderWidth:"1px",borderRadius:dumpCSSVariable(dumpThemeVariable({type:"borderRadius"})),fontSize:"18px",color:"rgb(0 0 0 / 1)",backgroundColor:"rgb(255 255 255 / 1)",borderColor:`rgb(${dumpCSSVariable(dumpColorVariable("--primary-color"))} / 0.4)`},focusWithin:{borderColor:`rgb(${dumpCSSVariable(dumpColorVariable("--accent-color"))})`,"--tw-ring-color":`rgb(${dumpCSSVariable(dumpColorVariable("--accent-color"))} / 0.5)`},error:{"--tw-ring-color":"#fca5a5"}}})]}});const pathGlob=z.string().transform(e=>removePrecedingSlash(e)).brand("pathGlob"),pathGlobsSchema=z.array(pathGlob);function removePrecedingSlash(e){return e.startsWith("/")?e.slice(1):e}function anyPathGlob(e,t){return anyGlob(e,removePrecedingSlash(t))}const redirectOnApplySchema=z.object({path:z.string(),exceptIfOnPaths:pathGlobsSchema}),DEFAULT_EXCEPT_IF_ON_PATHS=["/products/*","/collections/*"],commonRewardSchema=z.object({redirectOnApply:redirectOnApplySchema.optional(),integrationOverrides:integrationOverridesSchema.optional(),hideDiscountCode:z.enum(["email","sms"]).optional(),disableAutoApply:z.boolean().optional()}),urlParamSchema=z.object({name:z.string(),value:z.string()}),appendParamsSchema=z.array(urlParamSchema);function appendParamsToRedirectOnApply(e){const t=new URLSearchParams;return e.forEach(({name:r,value:n})=>{t.append(r,n)}),{path:`/#?${t.toString()}`,exceptIfOnPaths:[]}}const closePopupAction=createVersionedSchema(new SchemaVersion({schema:z.object({type:z.literal("closePopup"),appendParams:appendParamsSchema.optional()})}).next({schema:z.object({type:z.literal("closePopup"),redirect:redirectOnApplySchema.optional()}),migrate:e=>({...e,redirect:e.appendParams?appendParamsToRedirectOnApply(e.appendParams):void 0})})),DEFAULT_CLOSE_POPUP_ACTION={_version:2,type:"closePopup"},stepAction=z.object({type:z.literal("step"),step:z.discriminatedUnion("type",[z.object({type:z.literal("next")}),z.object({type:z.literal("mostRecent"),otherwise:z.string()}),z.object({type:z.literal("step"),stepID:z.string()})])}),floatingButtonAction=z.object({type:z.literal("floatingButton"),stepID:z.string()}),rewardAction=z.object({type:z.literal("reward"),rewardID:z.number(),applyImmediately:z.boolean().optional()}),pollAnswerAction=z.object({type:z.literal("pollAnswer"),questionUUID:z.string(),questionText:z.string(),answerUUID:z.string(),answer:z.string()}),addToCartAction=z.object({type:z.literal("addToCart"),variantIDs:z.array(z.string())}),openURLAction=z.object({type:z.literal("tapToText"),url:z.string(),newTab:z.boolean().optional(),tapToText:z.boolean().optional()}),customCodeAction=z.object({type:z.literal("customCode"),code:z.string()}),popupActionSchema=z.union([closePopupAction,stepAction,floatingButtonAction,rewardAction,pollAnswerAction,addToCartAction,openURLAction,customCodeAction]),iconNameSchema=z.enum(ICONS),iconNodeSchema=z.object({type:z.literal("icon"),icon:iconNameSchema,actions:z.array(popupActionSchema),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),textNodeSchema=z.object({type:z.literal("text"),markdown:z.string().optional(),variant:z.string().optional(),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),spanNodeSchema=z.object({type:z.literal("span"),text:z.string(),variant:z.string().optional(),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),breakNodeSchema=z.object({type:z.literal("break")}),imgNodeSchema=z.object({type:z.literal("image"),alt:z.string(),source:z.string(),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),rootOptionsSchema=z.object({modal:z.object({hideOverflow:z.boolean()}).optional()}),DEFAULT_ROOT_OPTIONS={modal:{hideOverflow:!0}},divNodeSchema=z.object({type:z.literal("div"),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional(),onClickActions:z.array(popupActionSchema).optional(),rootOptions:rootOptionsSchema.optional()}),copyNodeSchema=z.object({type:z.literal("copy"),text:z.string(),rewardID:z.number().optional(),applyImmediately:z.boolean().optional(),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),buttonNodeSchema=z.object({type:z.literal("button"),icon:iconNameSchema.optional(),iconActions:z.array(popupActionSchema).optional(),rightIcon:iconNameSchema.optional(),rightIconActions:z.array(popupActionSchema).optional(),text:z.string().optional(),variant:z.enum(["primary","secondary","plain","icon","none"]),submit:z.boolean().optional(),actions:z.array(popupActionSchema),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),validationMessageSchema=z.object({required:z.string().optional(),invalid:z.string().optional()}),questionSchema=z.object({type:z.literal("question"),uuid:z.string(),questionText:z.string()}),questionAnswerSchema=z.object({type:z.literal("questionAnswer"),uuid:z.string(),answerText:z.string(),button:buttonNodeSchema}),questionAnswerCheckboxSchema=z.object({type:z.literal("questionAnswerCheckbox"),uuid:z.string(),answerText:z.string(),styles:stylesByBreakpointSchema.optional()}),questionAnswerDropdownSchema=z.object({type:z.literal("questionAnswerDropdown"),answers:z.array(z.object({uuid:z.string(),text:z.string(),value:z.string().optional()})),placeholder:z.string().optional(),styles:stylesByBreakpointSchema.optional(),validationMessages:validationMessageSchema.optional()}),DEFAULT_NAME_INPUT={required:!0},nameInputNodeSchema=z.object({type:z.literal("nameInput"),required:z.boolean().default(DEFAULT_NAME_INPUT.required),validationMessages:validationMessageSchema.optional(),placeholder:z.string().optional(),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),DEFAULT_EMAIL_INPUT={required:!0},emailInputNodeSchema=z.object({type:z.literal("emailInput"),required:z.boolean().default(DEFAULT_EMAIL_INPUT.required),validationMessages:validationMessageSchema.optional(),placeholder:z.string().optional(),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),DEFAULT_PHONE_INPUT={required:!0},phoneInputNodeSchema=z.object({type:z.literal("phoneInput"),required:z.boolean().default(DEFAULT_PHONE_INPUT.required),validationMessages:validationMessageSchema.optional(),defaultCountryCode:countryCodeSchema.optional(),placeholder:z.string().optional(),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),freeTextFormatSchema=z.enum(["DD-MM","MM-DD","DD-MM-YYYY","MM-DD-YYYY","YYYY-MM-DD","DD/MM","MM/DD","DD/MM/YYYY","MM/DD/YYYY","YYYY/MM/DD","ZIP-5"]),freeTextNodeSchema=z.object({type:z.literal("freeText"),name:z.string(),label:z.string(),validationMessages:validationMessageSchema.extend({minAge:z.object({age:z.number(),message:z.string()}).optional()}).optional(),placeholder:z.string().optional(),format:freeTextFormatSchema.optional(),multiline:z.boolean().optional(),optional:z.boolean().optional(),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional()}),afterSubmitBranchSchema=z.object({if:subscriptionResultSchema,then:z.array(popupActionSchema)}),formSubmitPropertySchema=z.object({key:z.string(),value:z.string()}),formSchema=z.object({type:z.literal("form"),sharedStyle:sharedStyleHandleSchema.optional(),styles:stylesByBreakpointSchema.optional(),integrationOverrides:integrationOverridesSchema.optional(),subscribeImmediately:z.boolean().default(!0),afterSubmitBranches:z.array(afterSubmitBranchSchema).optional(),afterSubmit:z.array(popupActionSchema),submitProperties:z.array(formSubmitPropertySchema).optional(),errorMessage:z.string().optional()}),nodeIdSchema=z.string().brand("NodeId"),customCodeNodeSchema=z.object({type:z.literal("customCode"),code:z.string()}),CUSTOM_CODE_ARGS_KEYS=["document","mainDocument","hooks.nextStep","$alia"],educationSignUpSettingsSchema=z.object({name:z.enum(["disabled","required","optional"]),email:z.enum(["disabled","required","optional"]),phone:z.enum(["disabled","required","optional"]),defaultCountryCode:countryCodeSchema.optional(),splitSignUp:z.boolean(),namePlaceholder:z.string().optional(),nameValidationMessages:validationMessageSchema.optional(),emailConsentText:z.string().optional(),emailPlaceholder:z.string().optional(),emailValidationMessages:validationMessageSchema.optional(),smsConsentText:z.string().optional(),smsPlaceholder:z.string().optional(),smsValidationMessages:validationMessageSchema.optional()}),DEFAULT_SIGN_UP_SETTINGS={name:"disabled",email:"required",phone:"required",splitSignUp:!1,defaultCountryCode:"US",namePlaceholder:"Your name",emailConsentText:void 0,emailPlaceholder:"Your email address",smsConsentText:void 0,smsPlaceholder:"Your phone number"},lessonsNodeSchema=z.object({type:z.literal("lessons"),config:z.object({tiers:z.array(z.object({lessonID:z.number(),rewardID:z.number()})),skipHomeScreen:z.boolean().optional(),showPollResults:z.boolean().optional()}),signUp:educationSignUpSettingsSchema.default(DEFAULT_SIGN_UP_SETTINGS),preview:z.object({lessonID:z.number(),slideIndex:z.number()}).optional()}),tracksNodeSchema=z.object({type:z.literal("tracks"),config:z.object({tracksID:z.number(),startingTrack:z.string().optional(),showPollResults:z.boolean().optional()}).optional(),signUp:educationSignUpSettingsSchema.default(DEFAULT_SIGN_UP_SETTINGS),preview:z.object({trackUUID:z.string().uuid(),slideUUID:z.string().uuid()}).optional()}),layoutIDSchema=z.string().brand("LayoutID"),outletNodeSchema=z.object({type:z.literal("outlet"),id:z.literal("_default")}),baseNodeSchema=z.object({id:nodeIdSchema,node:z.discriminatedUnion("type",[buttonNodeSchema,iconNodeSchema,textNodeSchema,spanNodeSchema,breakNodeSchema,imgNodeSchema,divNodeSchema,copyNodeSchema,nameInputNodeSchema,emailInputNodeSchema,phoneInputNodeSchema,freeTextNodeSchema,formSchema,questionSchema,questionAnswerSchema,questionAnswerCheckboxSchema,questionAnswerDropdownSchema,customCodeNodeSchema,outletNodeSchema,lessonsNodeSchema,tracksNodeSchema])}),templateV6NodeSchema=baseNodeSchema.extend({children:z.array(z.lazy(()=>templateV6NodeSchema)).optional()});function getSteps(e){return(e==null?void 0:e.steps.filter(t=>!t.isFloatingButton))??[]}function getFloatingButtons(e){return(e==null?void 0:e.steps.filter(t=>t.isFloatingButton))??[]}function getAllNodesInNode(e,t=[]){var r;return t.push(e),(r=e.children)==null||r.forEach(n=>getAllNodesInNode(n,t)),t}function getSMSConsentText({termsURL:e,privacyURL:t,legalName:r}){return`By clicking this button, you agree to receive recurring automated marketing text messages (e.g. AI content, cart reminders) from ${r} at the number you provide. Consent not a condition of purchase. We may share info with service providers. Reply HELP for help & STOP to cancel. Msg frequency varies. Msg & data rates may apply. By clicking this button, you also agree to our [Terms](${e}) & [Privacy Policy](${t}).`}const layout=z.object({id:layoutIDSchema,title:z.string(),template:z.string().optional(),children:templateV6NodeSchema}),stepLayoutsSchema=z.object({default:layoutIDSchema,1024:layoutIDSchema}),step=z.object({id:z.string(),title:z.string(),builderLabel:z.string().optional(),layouts:stepLayoutsSchema,isFloatingButton:z.boolean().optional(),children:z.array(templateV6NodeSchema)}),v6Schema=z.object({steps:z.array(step),sharedStyles:z.array(sharedStyleSchema).default([]),layouts:z.array(layout).default([]),themeOverride:themeOverrideConfigSchema.optional()}),v6=new SchemaVersion({initialVersionOverride:6,schema:v6Schema}),popupTemplateSchema=createVersionedSchema(v6);v6.literal.bind(v6);const targetingRuleIDSchema=z.string().brand("TargetingRuleUUID"),targetingRuleResourceSchema=z.discriminatedUnion("type",[z.object({type:z.literal("targetingRule"),id:targetingRuleIDSchema}),z.object({type:z.literal("segment"),id:z.number().int()})]),targetingRuleCond=z.object({type:z.enum(["inTargetingRule","notInTargetingRule"]),resource:targetingRuleResourceSchema}),customCodeCond=z.object({type:z.literal("customCode"),code:z.string()}),ALL_COOKIES=["klaviyo","smsbump","unveild","upstack"],cookieSchema=z.enum(ALL_COOKIES),cookieIdentificationCond=z.object({type:z.enum(["cookie.identified","cookie.notIdentified"]),exclude:z.array(cookieSchema)}),klaviyoIdentifiedCond=z.object({type:z.enum(["klaviyo.identified","klaviyo.notIdentified"])}),klaviyoListCond=z.object({type:z.enum(["klaviyo.inList","klaviyo.notInList"]),listID:z.string().optional()}),klaviyoSegmentCond=z.object({type:z.enum(["klaviyo.inSegment","klaviyo.notInSegment"]),segmentID:z.string().optional()}),numFilterSchema=z.object({operator:z.enum(["eq","neq","gt","gte","lt","lte"]),value:z.number()}),relativeDateSchema=z.object({unit:z.enum(["seconds","minutes","hours","days","weeks","months","years"]),value:z.number()}),relativeDateFilterSchema=relativeDateSchema.extend({operator:z.enum(["gt","lt"])}),pagesCond=z.object({type:z.enum(["isOnPage","isNotOnPage","hasVisitedPage","hasNotVisitedPage"]),pageType:z.enum(["url","path"]),matchType:z.enum(["exact","contains"]),values:z.array(z.string())}),numPagesViewedCond=z.object({type:z.literal("pages.numPagesViewed"),scope:z.enum(["session"]),value:numFilterSchema}),numSessionsCond=z.object({type:z.literal("pages.numSessions"),scope:z.enum(["session"]),value:numFilterSchema}),shopifyNumOrdersCond=z.object({type:z.literal("shopify.numOrders"),value:numFilterSchema}),shopifyMarketsCond=z.object({type:z.enum(["shopify.inMarkets","shopify.notInMarkets"]),markets:z.array(z.string())}),shopifyCountriesCond=z.object({type:z.enum(["shopify.inCountries","shopify.notInCountries"]),countries:z.array(z.string())}),shopifyLocalesCond=z.object({type:z.enum(["shopify.inLocales","shopify.notInLocales"]),locales:z.array(z.string())}),utmSourceCond=z.object({type:z.enum(["traffic.utmSourceIsIn","traffic.utmSourceIsNotIn"]),values:z.array(z.string().nullable())}),utmMediumCond=z.object({type:z.enum(["traffic.utmMediumIsIn","traffic.utmMediumIsNotIn"]),values:z.array(z.string().nullable())}),userCreatedAtCond=z.object({type:z.literal("user.createdAt"),value:relativeDateFilterSchema}),userDeviceCond=z.object({type:z.literal("user.device"),device:z.enum(["mobile","desktop"])}),userCountriesCond=z.object({type:z.enum(["user.inCountries","user.notInCountries"]),countries:z.array(countryCodeSchema)}),userRegionsCond=z.object({type:z.enum(["user.inRegions","user.notInRegions"]),regions:z.array(z.string())}),userActionDateFilterSchema=z.object({type:z.literal("userAction.date"),value:relativeDateFilterSchema}),userActionSegmentsFilterSchema=z.object({type:z.enum(["userAction.inSegments","userAction.notInSegments"]),segmentIDs:z.array(z.number().int())}),userActionFilterSchema=z.discriminatedUnion("type",[userActionDateFilterSchema,userActionSegmentsFilterSchema]),actionSchema=z.object({type:z.enum(["popupStep","popupClose","emailSignUp","smsSignUp","emailOptIn","smsOptIn","pollAnswer","claimedReward","attributedOrder"])}),userActionCond=z.object({type:z.enum(["user.hasDoneAction","user.hasNotDoneAction"]),action:actionSchema,filters:z.array(userActionFilterSchema).optional()}),targetingCondSchema=z.discriminatedUnion("type",[pagesCond,numPagesViewedCond,numSessionsCond,userActionCond,userCountriesCond,userRegionsCond,userDeviceCond,userCreatedAtCond,shopifyNumOrdersCond,shopifyMarketsCond,shopifyLocalesCond,shopifyCountriesCond,klaviyoIdentifiedCond,klaviyoListCond,klaviyoSegmentCond,targetingRuleCond,customCodeCond,utmSourceCond,utmMediumCond,cookieIdentificationCond]),andRuleSchema=z.object({type:z.literal("and"),conds:z.array(targetingCondSchema)}),orRuleSchema=z.object({type:z.literal("or"),conds:z.array(targetingCondSchema)}),targetingRuleSchema=z.discriminatedUnion("type",[andRuleSchema,orRuleSchema]),targetingRuleItemSchema=z.object({id:targetingRuleIDSchema,title:z.string(),description:z.string().optional(),config:targetingRuleSchema});function findCycles(e){var r;for(const n of e){const i=t(n);if(i)return`${(r=i.at(0))==null?void 0:r.title} references ${i.slice(1).map(s=>s.title).join(", which references ")}`}return!1;function t(n,i=[]){if(i.some(s=>s.id===n.id))return[...i,n];for(const s of n.config.conds)if(s.type==="inTargetingRule"||s.type==="notInTargetingRule"){const l=e.find(p=>p.id===s.resource.id);if(!l)continue;const d=t(l,[...i,n]);if(d)return d}return!1}}const targetingRulesConfigSchema=z.object({rules:z.array(targetingRuleItemSchema)});targetingRulesConfigSchema.superRefine((e,t)=>{const r=findCycles(e.rules);return r&&t.addIssue({code:z.ZodIssueCode.custom,message:`Circular targeting rule logic: ${r}`}),e});const stepSchema=z.string().or(z.number().int().default(0)),SMART_TRIGGER_PARAMETERS=[{key:"organicTraffic",title:"Organic traffic",description:"Whether the user is coming from organic search",defaultCoefficient:30},{key:"productPage",title:"Distance from product page",description:"Highest value if on a product page, lowest value if never visited",defaultCoefficient:40},{key:"itemsInCart",title:"Items in cart",description:"How many items are in the user's cart",defaultCoefficient:20},{key:"mobile",title:"Mobile",description:"Whether the user is on a mobile device",defaultCoefficient:10},{key:"scrollDepth",title:"Scroll depth",description:"How much (%) the user has scrolled down the page",defaultCoefficient:30},{key:"timeSinceLastTrigger",title:"Time since last trigger (penalty)",description:"Penalty for how recent the last trigger was",defaultCoefficient:100},{key:"numSessions",title:"Number of sessions",description:"How many sessions the user has had",defaultCoefficient:40},{key:"numPagesViewed",title:"Number of pages viewed",description:"How many pages the user has viewed in the current session",defaultCoefficient:20},{key:"timeOnPage",title:"Time on page",description:"How much time the user has spent on the page",defaultCoefficient:40},{key:"exitIntent",title:"Exit intent",description:"Whether the user has scrolled up quickly or moved their mouse off the screen",defaultCoefficient:30}],smartTriggerParameterSchema=z.object({key:z.string(),coefficient:z.number()});SMART_TRIGGER_PARAMETERS.map(e=>({key:e.key,coefficient:e.defaultCoefficient}));const smartTriggerSchema$1=z.object({type:z.literal("smart"),parameters:z.array(smartTriggerParameterSchema),delayFromLastTrigger:z.number(),step:stepSchema}),timeOnPageCondSchema=z.object({type:z.literal("timeOnPage"),delay:z.number().optional()}),mouseLeaveCondSchema=z.object({type:z.literal("mouseLeave")}),idleCondSchema=z.object({type:z.literal("idle"),seconds:z.number().int()}),quickScrollUpCondSchema=z.object({type:z.literal("quickScrollUp")}),scrollDepthCondSchema=z.object({type:z.literal("scrollDepth"),depth:z.number().int()}),addToCartCondSchema=z.object({type:z.literal("addToCart"),onlyVariantIds:z.array(z.string()).optional()}),triggeringCondSchema=z.discriminatedUnion("type",[timeOnPageCondSchema,mouseLeaveCondSchema,idleCondSchema,quickScrollUpCondSchema,scrollDepthCondSchema,addToCartCondSchema]),triggerIDSchema=z.string().brand("triggerID"),basicTriggerSchema=z.object({type:z.literal("basic"),id:triggerIDSchema,conds:z.array(triggeringCondSchema),requireAllConds:z.boolean().optional(),step:z.string().optional(),device:z.enum(["mobile","desktop"]).optional()}),smartTriggerSchema=z.object({type:z.literal("smart"),id:triggerIDSchema,parameters:z.array(smartTriggerParameterSchema),delayFromLastTrigger:z.number(),step:z.string().optional()}),triggerSchema$1=z.discriminatedUnion("type",[basicTriggerSchema,smartTriggerSchema]),bailOfferSchema$1=z.object({rewardID:z.number().int().optional()}),exitIntentSchema=z.object({popupID:z.number().int()}),lessonsSchema$1=z.array(z.object({lessonID:z.number().int(),rewardID:z.number().int()})),lessonsContentSchema$1=z.object({type:z.literal("lessons"),skipHomeScreen:z.boolean().optional(),data:lessonsSchema$1,bailOffer:bailOfferSchema$1.optional()}),tracksSchema$1=z.object({tracksID:z.number().int(),startingTrack:z.string().uuid()}),tracksContentSchema$1=z.object({type:z.literal("tracks"),data:tracksSchema$1,bailOffer:bailOfferSchema$1.optional()}),contentSchema$1=z.union([lessonsContentSchema$1,tracksContentSchema$1]),v1$3=new SchemaVersion({schema:z.object({popupID:z.number().int().optional(),exitIntent:exitIntentSchema.optional(),content:contentSchema$1.optional(),settings:deepPartialMerchantSettingsSchema.optional()})}),immediateTriggerSchema$1=z.object({type:z.literal("immediate"),delay:z.number().optional()}),exitIntentTriggerSchema$1=z.object({type:z.literal("exitIntent")}),idleTriggerSchema$1=z.object({type:z.literal("idle"),seconds:z.number().int()}),addToCartTriggerSchema$1=z.object({type:z.literal("addToCart"),onlyVariantIds:z.array(z.string()).optional()}),triggerSchema=z.union([immediateTriggerSchema$1,exitIntentTriggerSchema$1,idleTriggerSchema$1,addToCartTriggerSchema$1]),DEFAULT_HIDE_AFTER_FUNNEL_STEP$1="signedUp",hideAfterFunnelStepSchema$1=z.enum(["signedUp","claimedReward","never"]).default(DEFAULT_HIDE_AFTER_FUNNEL_STEP$1),popupSchema$1=z.object({id:z.number().int(),triggers:z.array(triggerSchema).optional(),desktopTriggers:z.array(triggerSchema).optional(),hideAfterFunnelStep:hideAfterFunnelStepSchema$1}),bailOfferSchema=z.object({rewardID:z.number().int().optional()}),lessonsSchema=z.array(z.object({lessonID:z.number().int(),rewardID:z.number().int()})),lessonsContentSchema=z.object({type:z.literal("lessons"),skipHomeScreen:z.boolean().optional(),data:lessonsSchema,bailOffer:bailOfferSchema.optional()}),tracksSchema=z.object({tracksID:z.number().int(),startingTrack:z.string().uuid()}),tracksContentSchema=z.object({type:z.literal("tracks"),data:tracksSchema,bailOffer:bailOfferSchema.optional()}),contentSchema=z.union([lessonsContentSchema,tracksContentSchema]),v2$3=v1$3.next({schema:z.object({popups:z.array(popupSchema$1),content:contentSchema.optional(),settings:deepPartialMerchantSettingsSchema.optional()}),migrate:e=>{const t=[];return e.popupID&&t.push({id:e.popupID,hideAfterFunnelStep:DEFAULT_HIDE_AFTER_FUNNEL_STEP$1}),e.exitIntent&&t.push({id:e.exitIntent.popupID,triggers:[{type:"exitIntent"},{type:"idle",seconds:30}],hideAfterFunnelStep:DEFAULT_HIDE_AFTER_FUNNEL_STEP$1}),{content:e.content,settings:e.settings,popups:t}}}),immediateTriggerSchema=z.object({type:z.literal("immediate"),delay:z.number().optional(),step:stepSchema}),exitIntentTriggerSchema=z.object({type:z.literal("exitIntent"),step:stepSchema}),idleTriggerSchema=z.object({type:z.literal("idle"),seconds:z.number().int(),step:stepSchema}),scrollUpTriggerSchema=z.object({type:z.literal("scrollUp"),step:stepSchema}),scrollDepthTriggerSchema=z.object({type:z.literal("scrollDepth"),depth:z.number().int().min(0,"Scroll depth must be at least 0").max(100,"Scroll depth must be at most 100"),step:stepSchema}),addToCartTriggerSchema=z.object({type:z.literal("addToCart"),onlyVariantIds:z.array(z.string()).optional(),step:stepSchema}),oldTriggerSchema=z.discriminatedUnion("type",[immediateTriggerSchema,exitIntentTriggerSchema,idleTriggerSchema,scrollUpTriggerSchema,scrollDepthTriggerSchema,addToCartTriggerSchema,smartTriggerSchema$1]),DEFAULT_HIDE_AFTER_FUNNEL_STEP="signedUp",hideAfterFunnelStepSchema=z.enum(["signedUp","claimedReward","never"]).default(DEFAULT_HIDE_AFTER_FUNNEL_STEP),popupSchema=z.object({config:popupTemplateSchema,triggerID:z.number().optional(),triggers:z.array(oldTriggerSchema).default([]),desktopTriggers:z.array(oldTriggerSchema).optional(),hideAfterFunnelStep:hideAfterFunnelStepSchema,preloadImages:z.boolean().default(!1),daysBetweenTriggers:z.number().optional(),waitAfterLastTrigger:z.number().optional()}).refine(({config:e})=>e!==void 0,{message:"Either id or config must be provided"}),popupTriggerSchema=z.object({triggers:z.array(triggerSchema$1),triggerAgainAfter:relativeDateSchema.optional(),notIfAnyPopupShownInLast:relativeDateSchema.optional(),preloadImages:z.boolean().optional()});function getNewPopupID(e){return e*2}v2$3.next({schema:z.object({popup:popupSchema.optional(),settings:deepPartialMerchantSettingsSchema.optional(),integrationOverrides:integrationOverridesSchema.optional(),triggers:popupTriggerSchema.optional()}),migrate:()=>{throw new Error("No older versions remaining")}});function queryManager(e){return()=>{const t=useQueryClient();return reactExports.useMemo(()=>({getQueryKey:e,invalidateQuery:r=>{t.invalidateQueries(e(r))},updateQuery:(r,n)=>{t.cancelQueries(e(r)),t.setQueryData(e(r),n)},getData:r=>t.getQueryData(e(r))}),[t])}}function mergeOneIntoMany(e,t){if(!e)return[t];const r=e.findIndex(i=>i.id===t.id);if(r===-1)return[...e,t];const n=[...e];return n[r]=t,n}const useGetUserFlowQuery=queryManager(()=>["userFlows","getUserFlow"]);function useGetUserFlow(){const{initialData:e}=useCustomerAppContext(),{getQueryKey:t}=useGetUserFlowQuery(),r=useServiceFetch();return useSuspenseQuery({queryKey:t(),queryFn:()=>r("GET","/user-flows",{}),initialData:e.userFlow})}const useGetOtherUserFlowsQuery=queryManager(()=>["userFlows","getOther"]);function useGetOtherUserFlows(){const e=useServiceFetch(),{getQueryKey:t}=useGetOtherUserFlowsQuery(),{initialData:r}=useCustomerAppContext();return useSuspenseQuery({queryKey:t(),queryFn:()=>e("GET","/user-flows/other",{}),initialData:r.otherUserFlows})}function useUpdateOtherUserFlow(){const{updateQuery:e}=useGetOtherUserFlowsQuery();return reactExports.useCallback(t=>{e(void 0,r=>r?r.map(n=>n.flowID===t.flowID?t:n):[])},[e])}function useUpdateUserFlow(){const e=useServiceFetch(),{updateQuery:t}=useGetUserFlowQuery();return useMutation({mutationKey:["userFlows","update"],mutationFn:r=>e("PUT","/user-flows",{body:r}),onSuccess:r=>t(void 0,()=>r)})}function useMediatorEvent(e,t){const r=reactExports.useRef(t);reactExports.useEffect(()=>{r.current=t},[t]);const{mediator:n}=useCustomerAppContext();reactExports.useEffect(()=>n==null?void 0:n.on(e,i=>r.current(i)),[e,n])}function useMediatorState(){const{mediator:e}=useCustomerAppContext();return reactExports.useSyncExternalStore(t=>(e==null?void 0:e.subscribe(t))??(()=>{}),()=>e==null?void 0:e.state)}const getDocument=()=>document;function getWindowProperty(e){return window[e]}function setWindowProperty(e,t){window[e]=t}const BLACKCROW="blackcrow";function sendBlackCrowEvent(e){setWindowProperty(BLACKCROW,getWindowProperty(BLACKCROW)||[]),getWindowProperty(BLACKCROW).push(e)}const blackCrowIntegration={onView:e=>{sendBlackCrowEvent({app_name:"predictive_offer",trigger:"impression",data:{form_id:e.toString()}})},onSignup:(e,t)=>{t.email&&sendBlackCrowEvent({app_name:"predictive_offer",trigger:"submit",data:{form_id:e.toString(),type:"email",email:t.email}}),t.phone&&sendBlackCrowEvent({app_name:"predictive_offer",trigger:"submit",data:{form_id:e.toString(),type:"sms",phone_number:t.phone}})},onClose:e=>{sendBlackCrowEvent({app_name:"predictive_offer",trigger:"close",data:{form_id:e.toString()}})}},EVENT_PREFIX="alia:";function fireDOMEvent(e){const t=EVENT_PREFIX+e.type,r=new CustomEvent(t,{detail:e});getDocument().dispatchEvent(r)}function useOnPopupView(){const e=useCommonArgs();return reactExports.useCallback(()=>{blackCrowIntegration.onView(e.popupID),fireDOMEvent({type:"popupView",...e})},[e])}function useOnPopupClose(){const e=useCommonArgs();return reactExports.useCallback(()=>{blackCrowIntegration.onClose(e.popupID),fireDOMEvent({type:"popupClose",...e})},[e])}function useOnPollAnswered(){const e=useCommonArgs();return reactExports.useCallback(t=>{fireDOMEvent({...e,type:"pollAnswered",...t})},[e])}function useOnSignup(){const e=useCommonArgs();return reactExports.useCallback(t=>{blackCrowIntegration.onSignup(e.popupID,t),fireDOMEvent({...e,type:"signup",email:t.email??void 0,phone:t.phone??void 0})},[e])}function useOnRewardClaimed(){const e=useCommonArgs();return reactExports.useCallback(t=>{fireDOMEvent({...e,type:"rewardClaimed",...t})},[e])}function useCommonArgs(){const e=useIntegrationPopupID(),{initialData:t}=useCustomerAppContext();return reactExports.useMemo(()=>{var r,n,i;return{popupID:e,popupTitle:(r=t.userFlow)==null?void 0:r.flowTitle,campaignID:(n=t.userFlow)==null?void 0:n.segmentID,campaignTitle:(i=t.userFlow)==null?void 0:i.segmentTitle}},[e,t])}function useClientIntegrations(){return{onPopupView:useOnPopupView(),onPopupClose:useOnPopupClose(),onPollAnswered:useOnPollAnswered(),onSignup:useOnSignup(),onRewardClaimed:useOnRewardClaimed()}}function useCreateUserAction(){const{mediator:e,initialData:t}=useCustomerAppContext();return reactExports.useCallback(async r=>{var n;t.userFlow&&await((n=e==null?void 0:e.userActionsStore)==null?void 0:n.createAction({userID:t.user.id,merchantID:t.user.merchantID,flowID:t.userFlow.flowID,segmentID:t.userFlow.segmentID,userFlowID:t.userFlow.id,data:r}))},[e,t])}function createContextWithoutDefault(e){const t=reactExports.createContext(void 0);return{useContext:()=>{const r=reactExports.useContext(t);if(r===void 0)throw new Error(`Context "${e}" must be used inside a Provider`);return r},useOptionalContext:()=>reactExports.useContext(t),Provider:t.Provider}}function createContextWithDefault(e){const t=reactExports.createContext(e);return{useContext:()=>reactExports.useContext(t),Provider:t.Provider}}class Logger{constructor(){wt(this,"debugExtensionEnabled",!1);wt(this,"appName","app");window.postMessage({type:"alia:loaded"},"*"),window.addEventListener("message",t=>{t.data&&t.data.type==="alia:debug_extension_enabled"&&(this.debugExtensionEnabled=!0)})}log(...t){console.log(`[Alia ${this.appName}]`,...t)}debug(...t){this.debugExtensionEnabled&&console.log(`%c[Alia ${this.appName} debug]`,"color: cyan",...t)}error(...t){console.error(`[Alia ${this.appName}]`,...t)}}const logger=new Logger;class ShopifyUtils{constructor(){wt(this,"shopify");this.shopify=getWindowProperty("Shopify")}redirect(t){this.shopify&&(t.startsWith("/")&&(t=t.substring(1)),window.location.href=this.shopify.routes.root+t)}applyCode(t){fetch(`/discount/${t}`)}async addToCart(t){if(this.shopify)try{const r={items:t.map(n=>({id:n,quantity:1}))};await fetch(this.shopify.routes.root+"cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}catch(r){logger.error("Failed to add to cart",r)}}}const v1$2=new SchemaVersion({schema:z.object({title:z.string(),subtitle:z.string(),expirationMins:z.number().min(0).optional(),shopifyCode:z.string().optional(),redirectPathOnApply:z.string().optional(),cta:z.object({text:z.string(),url:z.string()}).optional()})}),v2$2=v1$2.next({schema:z.object({title:z.string(),subtitle:z.string(),expirationMins:z.number().min(0).optional(),shopifyCode:z.string().optional(),cta:z.object({text:z.string(),url:z.string()}).optional(),isUniqueToAlia:z.boolean().default(!0)}).extend(commonRewardSchema.shape),migrate:e=>({...e,redirectOnApply:e.redirectPathOnApply?{path:e.redirectPathOnApply,exceptIfOnPaths:DEFAULT_EXCEPT_IF_ON_PATHS}:void 0})}),customRewardConfigSchema=createVersionedSchema(v2$2),customDiscountDescriptorSchema=z.object({descriptor:z.string(),url:z.string().optional()}),collectionsSchema=z.object({type:z.enum(["collections"]),customDescriptor:customDiscountDescriptorSchema.optional(),collections:z.array(z.object({id:z.string(),title:z.string()}))}),productsSchema=z.object({type:z.enum(["products"]),customDescriptor:customDiscountDescriptorSchema.optional(),products:z.array(z.object({id:z.string(),title:z.string(),variants:z.array(z.object({id:z.string(),title:z.string()})).optional()}))}),itemsSchema=z.union([z.object({type:z.enum(["all"])}),collectionsSchema,productsSchema]),v1$1=new SchemaVersion({schema:z.object({value:z.union([z.object({type:z.enum(["percent"]),percent:z.number().min(0).max(100)}),z.object({type:z.enum(["amount"]),amount:z.number().min(0)})]),expirationMins:z.number().min(0).optional(),minimumRequirement:z.number().min(0).optional(),items:itemsSchema,appliesOnSubscription:z.boolean().optional(),stackable:z.boolean().optional(),customQualifierText:z.string().optional(),redirectPathOnApply:z.string().optional()})}),v2$1=v1$1.next({schema:z.object({value:z.union([z.object({type:z.enum(["percent"]),percent:z.number().min(0).max(100)}),z.object({type:z.enum(["amount"]),amount:z.number().min(0)})]),expirationMins:z.number().min(0).optional(),minimumRequirement:z.number().min(0).optional(),items:itemsSchema,appliesOnSubscription:z.boolean().optional(),stackable:z.boolean().optional(),customQualifierText:z.string().optional(),redirectOnApply:redirectOnApplySchema.optional()}),migrate:e=>({...e,redirectOnApply:e.redirectPathOnApply?{path:e.redirectPathOnApply,exceptIfOnPaths:DEFAULT_EXCEPT_IF_ON_PATHS}:void 0})}),v3=v2$1.next({schema:z.object({value:z.union([z.object({type:z.enum(["percent"]),percent:z.number().min(0).max(100)}),z.object({type:z.enum(["amount"]),amount:z.number().min(0)})]),limitToCustomer:z.boolean().optional(),expirationMins:z.number().min(0).optional(),minimumRequirement:z.number().min(0).optional(),items:itemsSchema,appliesOnSubscription:z.boolean().optional(),combinesWith:z.object({orderDiscounts:z.boolean().optional(),productDiscounts:z.boolean().optional(),shippingDiscounts:z.boolean().optional()}),customQualifierText:z.string().optional()}).extend(commonRewardSchema.shape),migrate:e=>({...e,combinesWith:{orderDiscounts:e.stackable,productDiscounts:e.stackable,shippingDiscounts:e.stackable}})}),discountConfigSchema=createVersionedSchema(v3),v1=new SchemaVersion({schema:z.object({appliesOnSubscription:z.boolean().optional(),stackable:z.boolean().optional(),expirationMins:z.number().min(0).optional(),maximumShippingPrice:z.number().min(0).optional(),minimumRequirement:z.number().min(0).optional(),redirectPathOnApply:z.string().optional()})}),v2=v1.next({schema:z.object({appliesOnSubscription:z.boolean().optional(),stackable:z.boolean().optional(),expirationMins:z.number().min(0).optional(),maximumShippingPrice:z.number().min(0).optional(),minimumRequirement:z.number().min(0).optional(),limitToCustomer:z.boolean().optional(),countries:z.array(z.string()).min(1,"At least one country is required").optional()}).extend(commonRewardSchema.shape),migrate:e=>({...e,redirectOnApply:e.redirectPathOnApply?{path:e.redirectPathOnApply,exceptIfOnPaths:DEFAULT_EXCEPT_IF_ON_PATHS}:void 0})}),freeShippingConfigSchema=createVersionedSchema(v2);z.union([z.object({type:z.literal("discount"),discount:discountConfigSchema}),z.object({type:z.literal("freeShipping"),freeShipping:freeShippingConfigSchema}),z.object({type:z.literal("custom"),custom:customRewardConfigSchema})]);function getRewardConfigProperty(e,t){if(e.type==="discount")return e.discount[t];if(e.type==="freeShipping")return e.freeShipping[t];if(e.type==="custom")return e.custom[t];assertNever(e)}var classnames={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */var hasRequiredClassnames;function requireClassnames(){return hasRequiredClassnames||(hasRequiredClassnames=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var s="",l=0;l["merchants","getMerchant"]);function useGetMerchant(){const{initialData:e}=useCustomerAppContext(),{getQueryKey:t}=useGetMerchantQuery(),r=useServiceFetch();return useSuspenseQuery({queryKey:t(),queryFn:()=>r("GET","/merchants",{}),initialData:e.merchant,staleTime:1/0})}const useGetSettingsQuery=queryManager(()=>["merchants","getSettings"]);function useGetSettings(){const{initialData:e}=useCustomerAppContext(),{getQueryKey:t}=useGetSettingsQuery(),r=useServiceFetch();return useSuspenseQuery({queryKey:t(),queryFn:()=>r("GET","/merchants/settings",{}),initialData:e.settings,staleTime:1/0})}const useGetProductUrlQuery=queryManager(e=>["merchants","getProductUrl",e]);function useGetProductUrl(e){const{getQueryKey:t}=useGetProductUrlQuery(),r=useServiceFetch();return useSuspenseQuery({queryKey:t(e),queryFn:()=>r("GET","/merchants/product-url",{query:e})})}const{Provider:WindowSizeProvider,useContext:useWindowSizeContext}=createContextWithoutDefault("windowSize"),getWidth=()=>Math.min(window.innerWidth,window.outerWidth),getHeight=()=>window.innerHeight,DefaultWindowSizeProvider=({children:e})=>{const[t,r]=reactExports.useState(getWidth()),[n,i]=reactExports.useState(getHeight());return reactExports.useEffect(()=>{const s=()=>{r(getWidth()),i(getHeight())};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),jsx(WindowSizeProvider,{value:{width:t,height:n},children:e})};function useBreakpoint(){const{width:e}=useWindowSizeContext();return e>=1024?"1024":"default"}function useStepLayout(e){const{width:t}=useWindowSizeContext();if(e)return t>=1024?e.layouts[1024]:e.layouts.default}const PREVIEW_POPUP_PORTAL_ID="preview-popup-portal",{Provider:PopupPreviewContextProvider,useOptionalContext:useOptionalContext$3}=createContextWithoutDefault("popup-preview"),usePopupPreviewContext=()=>useOptionalContext$3()??{},PopupPreview=()=>{var v;const e=useWindowSizeContext(),{preview:t}=useCustomerAppContext();if(!t)throw new Error("Preview context not found");const{toParentEvents:r,template:n}=t;reactExports.useEffect(()=>{r==null||r.emit("onLoad")},[r]);const[i]=useMittState("updateTemplate",n),[s,l]=useMittState("onNodeHover",null),[d]=useMittState("onNodeSelect"),[p]=useMittState("setWindowSize",e),m=reactExports.useCallback(b=>r==null?void 0:r.emit("onNodeSelect",b),[r]);return jsx(WindowSizeProvider,{value:p,children:jsx(PopupPreviewContextProvider,{value:{isPreview:!0,highlightedNode:s,setHighlightedNode:l,selectedNode:d,onNodeSelect:m,sizeOverride:p},children:jsx(CommonErrorBoundary,{fallback:jsx(Fragment,{children:"An error occurred"}),children:jsx(Popup,{stepID:(v=i.steps.at(0))==null?void 0:v.id,setStepID:()=>{},history:[],onClosePopup:()=>{},template:i,children:jsx(PreviewPortal,{})})})})})},PreviewPortal=()=>{const e=usePopupThemeConfig();return jsx("div",{style:{[dumpColorVariable("--accent-color")]:hexToRGB(e.colors.accent),[dumpColorVariable("--accent-foreground")]:hexToRGB(e.colors.accentForeground)},className:"relative",id:PREVIEW_POPUP_PORTAL_ID})};function useMittState(e,t=null){const{preview:r}=useCustomerAppContext();if(!r)throw new Error("Preview context not found");const{toChildEvents:n}=r,[i,s]=reactExports.useState((n==null?void 0:n.latest(e))??t);return reactExports.useEffect(()=>(n==null||n.on(e,s),()=>{n==null||n.off(e,s)}),[n,e]),[i,s]}const{useOptionalContext:useOptionalContext$2,Provider:Provider$a}=createContextWithoutDefault("outlet-node"),useOutletNodeContext=useOptionalContext$2,OutletNode=({parentId:e})=>{var r;const t=(r=useLayoutContext())==null?void 0:r.children;return!t||!e?null:jsx(Provider$a,{value:{rootId:e},children:t})},ClickableDiv=reactExports.forwardRef(({onClick:e,disabled:t=!1,className:r,...n},i)=>{const s=()=>{t||e==null||e()},{styles:l,onClick:d,onMouseEnter:p,onMouseLeave:m}=usePreviewNodeContext();return jsx("div",{ref:i,onClick:d??s,tabIndex:0,role:"button",onKeyDown:v=>{v.key==="Enter"&&s()},onMouseEnter:p,onMouseLeave:m,"aria-disabled":t,...n,className:classNames(r),style:l})});ClickableDiv.displayName="ClickableDiv";var DefaultContext={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},IconContext=React.createContext&&React.createContext(DefaultContext),_excluded$9=["attr","size","title"];function _objectWithoutProperties$9(e,t){if(e==null)return{};var r=_objectWithoutPropertiesLoose$9(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$9(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _extends$5(){return _extends$5=Object.assign?Object.assign.bind():function(e){for(var t=1;tReact.createElement(t.tag,_objectSpread$8({key:r},t.attr),Tree2Element(t.child)))}function GenIcon(e){return t=>React.createElement(IconBase,_extends$5({attr:_objectSpread$8({},e.attr)},t),Tree2Element(e.child))}function IconBase(e){var t=r=>{var{attr:n,size:i,title:s}=e,l=_objectWithoutProperties$9(e,_excluded$9),d=i||r.size||"1em",p;return r.className&&(p=r.className),e.className&&(p=(p?p+" ":"")+e.className),React.createElement("svg",_extends$5({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,l,{className:p,style:_objectSpread$8(_objectSpread$8({color:e.color||r.color},r.style),e.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),s&&React.createElement("title",null,s),e.children)};return IconContext!==void 0?React.createElement(IconContext.Consumer,null,r=>t(r)):t(DefaultContext)}function MdAccountCircle(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6zm0 14c-2.03 0-4.43-.82-6.14-2.88a9.947 9.947 0 0 1 12.28 0C16.43 19.18 14.03 20 12 20z"},child:[]}]})(e)}function MdFavorite(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"},child:[]}]})(e)}function MdHelpOutline(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"},child:[]}]})(e)}function MdHelp(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"},child:[]}]})(e)}function MdHome(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"},child:[]}]})(e)}function MdInfo(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"},child:[]}]})(e)}function MdLock(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"},child:[]}]})(e)}function MdLogout(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"},child:[]}]})(e)}function MdOpenInNew(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"},child:[]}]})(e)}function MdRedeem(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20 6h-2.18c.11-.31.18-.65.18-1a2.996 2.996 0 0 0-5.5-1.65l-.5.67-.5-.68C10.96 2.54 10.05 2 9 2 7.34 2 6 3.34 6 5c0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM9 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm11 15H4v-2h16v2zm0-5H4V8h5.08L7 10.83 8.62 12 11 8.76l1-1.36 1 1.36L15.38 12 17 10.83 14.92 8H20v6z"},child:[]}]})(e)}function MdShoppingCart(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49A1.003 1.003 0 0 0 20 4H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"},child:[]}]})(e)}function MdVisibility(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"},child:[]}]})(e)}function MdError(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"},child:[]}]})(e)}function MdContentCopy(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"},child:[]}]})(e)}function MdAccessTime(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]},{tag:"path",attr:{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},child:[]}]})(e)}function MdDiscount(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12.79 21 3 11.21v2c0 .53.21 1.04.59 1.41l7.79 7.79c.78.78 2.05.78 2.83 0l6.21-6.21c.78-.78.78-2.05 0-2.83L12.79 21z"},child:[]},{tag:"path",attr:{d:"M11.38 17.41c.78.78 2.05.78 2.83 0l6.21-6.21c.78-.78.78-2.05 0-2.83L12.63.58A2.04 2.04 0 0 0 11.21 0H5C3.9 0 3 .9 3 2v6.21c0 .53.21 1.04.59 1.41l7.79 7.79zM7.25 3a1.25 1.25 0 1 1 0 2.5 1.25 1.25 0 0 1 0-2.5z"},child:[]}]})(e)}function MdKeyboardArrowDown(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},child:[]}]})(e)}function MdKeyboardArrowLeft(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"},child:[]}]})(e)}function MdKeyboardArrowRight(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"},child:[]}]})(e)}function MdKeyboardArrowUp(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"},child:[]}]})(e)}function MdClose(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"},child:[]}]})(e)}function MdEast(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m15 5-1.41 1.41L18.17 11H2v2h16.17l-4.59 4.59L15 19l7-7-7-7z"},child:[]}]})(e)}function MdWest(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m9 19 1.41-1.41L5.83 13H22v-2H5.83l4.59-4.59L9 5l-7 7 7 7z"},child:[]}]})(e)}function MdEmojiEvents(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94A5.01 5.01 0 0 0 11 15.9V19H7v2h10v-2h-4v-3.1a5.01 5.01 0 0 0 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2zM5 8V7h2v3.82C5.84 10.4 5 9.3 5 8zm14 0c0 1.3-.84 2.4-2 2.82V7h2v1z"},child:[]}]})(e)}function MdWhatshot(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M13.5.67s.74 2.65.74 4.8c0 2.06-1.35 3.73-3.41 3.73-2.07 0-3.63-1.67-3.63-3.73l.03-.36C5.21 7.51 4 10.62 4 14c0 4.42 3.58 8 8 8s8-3.58 8-8C20 8.61 17.41 3.8 13.5.67zM11.71 19c-1.78 0-3.22-1.4-3.22-3.14 0-1.62 1.05-2.76 2.81-3.12 1.77-.36 3.6-1.21 4.62-2.58.39 1.29.59 2.65.59 4.04 0 2.65-2.15 4.8-4.8 4.8z"},child:[]}]})(e)}function MdCheckBoxOutlineBlank(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"},child:[]}]})(e)}function MdCheckBox(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"},child:[]}]})(e)}function MdRadioButtonChecked(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function MdRadioButtonUnchecked(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function MdOutlineCheck(e){return GenIcon({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"},child:[]}]})(e)}const icons={checkmark:MdOutlineCheck,arrowRight:MdEast,arrowLeft:MdWest,user:MdAccountCircle,favorite:MdFavorite,chevronUp:MdKeyboardArrowUp,chevronDown:MdKeyboardArrowDown,chevronRight:MdKeyboardArrowRight,chevronLeft:MdKeyboardArrowLeft,home:MdHome,fire:MdWhatshot,lock:MdLock,trophy:MdEmojiEvents,close:MdClose,help:MdHelp,helpOutline:MdHelpOutline,shop:MdShoppingCart,copy:MdContentCopy,radioOn:MdRadioButtonChecked,radioOff:MdRadioButtonUnchecked,unchecked:MdCheckBoxOutlineBlank,checked:MdCheckBox,discount:MdDiscount,info:MdInfo,redeem:MdRedeem,clock:MdAccessTime,external:MdOpenInNew,warning:MdVisibility,leave:MdLogout,error:MdError},Icon=({icon:e,className:t,onClick:r,style:n,inline:i=!1,inButton:s=!1})=>{const l=icons[e];return s?jsx("span",{className:classNames(t,i?"inline-flex items-center":"flex flex-col justify-center"),style:{...n},onClick:r,children:jsx(l,{fontSize:"inherit"})}):r?jsx("button",{className:classNames(t,i?"inline-flex items-center":"flex flex-col justify-center"),onClick:r,style:{...n},children:jsx(l,{fontSize:"inherit"})}):jsx("div",{className:classNames(t,i?"inline-flex items-center":"flex flex-col justify-center"),style:{...n},children:jsx(l,{fontSize:"inherit"})})};var showdown$2={exports:{}},showdown$1=showdown$2.exports,hasRequiredShowdown;function requireShowdown(){return hasRequiredShowdown||(hasRequiredShowdown=1,function(e){(function(){function t(f){var w={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:`Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`,type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as
(GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex:
foo
",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{defaultValue:!1,describe:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,describe:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,describe:"Split adjacent blockquote blocks",type:"boolean"}};if(f===!1)return JSON.parse(JSON.stringify(w));var g={};for(var C in w)w.hasOwnProperty(C)&&(g[C]=w[C].defaultValue);return g}function r(){var f=t(!0),w={};for(var g in f)f.hasOwnProperty(g)&&(w[g]=!0);return w}var n={},i={},s={},l=t(!0),d="vanilla",p={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:t(!0),allOn:r()};n.helper={},n.extensions={},n.setOption=function(f,w){return l[f]=w,this},n.getOption=function(f){return l[f]},n.getOptions=function(){return l},n.resetOptions=function(){l=t(!0)},n.setFlavor=function(f){if(!p.hasOwnProperty(f))throw Error(f+" flavor was not found");n.resetOptions();var w=p[f];d=f;for(var g in w)w.hasOwnProperty(g)&&(l[g]=w[g])},n.getFlavor=function(){return d},n.getFlavorOptions=function(f){if(p.hasOwnProperty(f))return p[f]},n.getDefaultOptions=function(f){return t(f)},n.subParser=function(f,w){if(n.helper.isString(f))if(typeof w<"u")i[f]=w;else{if(i.hasOwnProperty(f))return i[f];throw Error("SubParser named "+f+" not registered!")}},n.extension=function(f,w){if(!n.helper.isString(f))throw Error("Extension 'name' must be a string");if(f=n.helper.stdExtName(f),n.helper.isUndefined(w)){if(!s.hasOwnProperty(f))throw Error("Extension named "+f+" is not registered!");return s[f]}else{typeof w=="function"&&(w=w()),n.helper.isArray(w)||(w=[w]);var g=m(w,f);if(g.valid)s[f]=w;else throw Error(g.error)}},n.getAllExtensions=function(){return s},n.removeExtension=function(f){delete s[f]},n.resetExtensions=function(){s={}};function m(f,w){var g=w?"Error in "+w+" extension->":"Error in unnamed extension",C={valid:!0,error:""};n.helper.isArray(f)||(f=[f]);for(var _=0;_"u"},n.helper.forEach=function(f,w){if(n.helper.isUndefined(f))throw new Error("obj param is required");if(n.helper.isUndefined(w))throw new Error("callback param is required");if(!n.helper.isFunction(w))throw new Error("callback param must be a function/closure");if(typeof f.forEach=="function")f.forEach(w);else if(n.helper.isArray(f))for(var g=0;g").replace(/&/g,"&")};var b=function(f,w,g,C){var _=C||"",A=_.indexOf("g")>-1,k=new RegExp(w+"|"+g,"g"+_.replace(/g/g,"")),L=new RegExp(w,_.replace(/g/g,"")),re=[],K,J,ee,E,Y;do for(K=0;ee=k.exec(f);)if(L.test(ee[0]))K++||(J=k.lastIndex,E=J-ee[0].length);else if(K&&!--K){Y=ee.index+ee[0].length;var W={left:{start:E,end:J},match:{start:J,end:ee.index},right:{start:ee.index,end:Y},wholeMatch:{start:E,end:Y}};if(re.push(W),!A)return re}while(K&&(k.lastIndex=J));return re};n.helper.matchRecursiveRegExp=function(f,w,g,C){for(var _=b(f,w,g,C),A=[],k=0;k<_.length;++k)A.push([f.slice(_[k].wholeMatch.start,_[k].wholeMatch.end),f.slice(_[k].match.start,_[k].match.end),f.slice(_[k].left.start,_[k].left.end),f.slice(_[k].right.start,_[k].right.end)]);return A},n.helper.replaceRecursiveRegExp=function(f,w,g,C,_){if(!n.helper.isFunction(w)){var A=w;w=function(){return A}}var k=b(f,g,C,_),L=f,re=k.length;if(re>0){var K=[];k[0].wholeMatch.start!==0&&K.push(f.slice(0,k[0].wholeMatch.start));for(var J=0;J=0?C+(g||0):C},n.helper.splitAtIndex=function(f,w){if(!n.helper.isString(f))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[f.substring(0,w),f.substring(w)]},n.helper.encodeEmailAddress=function(f){var w=[function(g){return"&#"+g.charCodeAt(0)+";"},function(g){return"&#x"+g.charCodeAt(0).toString(16)+";"},function(g){return g}];return f=f.replace(/./g,function(g){if(g==="@")g=w[Math.floor(Math.random()*2)](g);else{var C=Math.random();g=C>.9?w[2](g):C>.45?w[1](g):w[0](g)}return g}),f},n.helper.padEnd=function(w,g,C){return g=g>>0,C=String(C||" "),w.length>g?String(w):(g=g-w.length,g>C.length&&(C+=C.repeat(g/C.length)),String(w)+C.slice(0,g))},typeof console>"u"&&(console={warn:function(f){alert(f)},log:function(f){alert(f)},error:function(f){throw f}}),n.helper.regexes={asteriskDashAndColon:/([*_:~])/g},n.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:':octocat:',showdown:`S`},n.Converter=function(f){var w={},g=[],C=[],_={},A=d,k={parsed:{},raw:"",format:""};L();function L(){f=f||{};for(var E in l)l.hasOwnProperty(E)&&(w[E]=l[E]);if(typeof f=="object")for(var Y in f)f.hasOwnProperty(Y)&&(w[Y]=f[Y]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof f+" was passed instead.");w.extensions&&n.helper.forEach(w.extensions,re)}function re(E,Y){if(Y=Y||null,n.helper.isString(E))if(E=n.helper.stdExtName(E),Y=E,n.extensions[E]){console.warn("DEPRECATION WARNING: "+E+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),K(n.extensions[E],E);return}else if(!n.helper.isUndefined(s[E]))E=s[E];else throw Error('Extension "'+E+'" could not be loaded. It was either not found or is not a valid extension.');typeof E=="function"&&(E=E()),n.helper.isArray(E)||(E=[E]);var W=m(E,Y);if(!W.valid)throw Error(W.error);for(var oe=0;oe[ \t]+¨NBSP;<"),!Y)if(window&&window.document)Y=window.document;else throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");var W=Y.createElement("div");W.innerHTML=E;var oe={preList:$e(W)};xe(W);for(var ae=W.childNodes,O="",ne=0;ne'}else ge.push(be[ve].innerHTML),be[ve].innerHTML="",be[ve].setAttribute("prenum",ve.toString());return ge}return O},this.setOption=function(E,Y){w[E]=Y},this.getOption=function(E){return w[E]},this.getOptions=function(){return w},this.addExtension=function(E,Y){Y=Y||null,re(E,Y)},this.useExtension=function(E){re(E)},this.setFlavor=function(E){if(!p.hasOwnProperty(E))throw Error(E+" flavor was not found");var Y=p[E];A=E;for(var W in Y)Y.hasOwnProperty(W)&&(w[W]=Y[W])},this.getFlavor=function(){return A},this.removeExtension=function(E){n.helper.isArray(E)||(E=[E]);for(var Y=0;Y? ?(['"].*['"])?\)$/m)>-1)L="";else if(!L)if(k||(k=A.toLowerCase().replace(/ ?\n/g," ")),L="#"+k,!n.helper.isUndefined(g.gUrls[k]))L=g.gUrls[k],n.helper.isUndefined(g.gTitles[k])||(J=g.gTitles[k]);else return _;L=L.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback);var ee='",ee};return f=f.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,C),f=f.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,C),f=f.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]??(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,C),f=f.replace(/\[([^\[\]]+)]()()()()()/g,C),w.ghMentions&&(f=f.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function(_,A,k,L,re){if(k==="\\")return A+L;if(!n.helper.isString(w.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var K=w.ghMentionsLink.replace(/\{u}/g,re),J="";return w.openLinksInNewWindow&&(J=' rel="noopener noreferrer" target="¨E95Eblank"'),A+'"+L+""})),f=g.converter._dispatch("anchors.after",f,w,g),f});var S=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,$=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,N=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,D=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,P=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,F=function(f){return function(w,g,C,_,A,k,L){C=C.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback);var re=C,K="",J="",ee=g||"",E=L||"";return/^www\./i.test(C)&&(C=C.replace(/^www\./i,"http://www.")),f.excludeTrailingPunctuationFromURLs&&k&&(K=k),f.openLinksInNewWindow&&(J=' rel="noopener noreferrer" target="¨E95Eblank"'),ee+'"+re+""+K+E}},q=function(f,w){return function(g,C,_){var A="mailto:";return C=C||"",_=n.subParser("unescapeSpecialChars")(_,f,w),f.encodeEmails?(A=n.helper.encodeEmailAddress(A+_),_=n.helper.encodeEmailAddress(_)):A=A+_,C+''+_+""}};n.subParser("autoLinks",function(f,w,g){return f=g.converter._dispatch("autoLinks.before",f,w,g),f=f.replace(N,F(w)),f=f.replace(P,q(w,g)),f=g.converter._dispatch("autoLinks.after",f,w,g),f}),n.subParser("simplifiedAutoLinks",function(f,w,g){return w.simplifiedAutoLink&&(f=g.converter._dispatch("simplifiedAutoLinks.before",f,w,g),w.excludeTrailingPunctuationFromURLs?f=f.replace($,F(w)):f=f.replace(S,F(w)),f=f.replace(D,q(w,g)),f=g.converter._dispatch("simplifiedAutoLinks.after",f,w,g)),f}),n.subParser("blockGamut",function(f,w,g){return f=g.converter._dispatch("blockGamut.before",f,w,g),f=n.subParser("blockQuotes")(f,w,g),f=n.subParser("headers")(f,w,g),f=n.subParser("horizontalRule")(f,w,g),f=n.subParser("lists")(f,w,g),f=n.subParser("codeBlocks")(f,w,g),f=n.subParser("tables")(f,w,g),f=n.subParser("hashHTMLBlocks")(f,w,g),f=n.subParser("paragraphs")(f,w,g),f=g.converter._dispatch("blockGamut.after",f,w,g),f}),n.subParser("blockQuotes",function(f,w,g){f=g.converter._dispatch("blockQuotes.before",f,w,g),f=f+` `;var C=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return w.splitAdjacentBlockquotes&&(C=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),f=f.replace(C,function(_){return _=_.replace(/^[ \t]*>[ \t]?/gm,""),_=_.replace(/¨0/g,""),_=_.replace(/^[ \t]+$/gm,""),_=n.subParser("githubCodeBlocks")(_,w,g),_=n.subParser("blockGamut")(_,w,g),_=_.replace(/(^|\n)/g,"$1 "),_=_.replace(/(\s*
[^\r]+?<\/pre>)/gm,function(A,k){var L=k;return L=L.replace(/^  /mg,"¨0"),L=L.replace(/¨0/g,""),L}),n.subParser("hashBlock")(`
`+_+`
`,w,g)}),f=g.converter._dispatch("blockQuotes.after",f,w,g),f}),n.subParser("codeBlocks",function(f,w,g){f=g.converter._dispatch("codeBlocks.before",f,w,g),f+="¨0";var C=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;return f=f.replace(C,function(_,A,k){var L=A,re=k,K=` `;return L=n.subParser("outdent")(L,w,g),L=n.subParser("encodeCode")(L,w,g),L=n.subParser("detab")(L,w,g),L=L.replace(/^\n+/g,""),L=L.replace(/\n+$/g,""),w.omitExtraWLInCodeBlocks&&(K=""),L="
"+L+K+"
",n.subParser("hashBlock")(L,w,g)+re}),f=f.replace(/¨0/,""),f=g.converter._dispatch("codeBlocks.after",f,w,g),f}),n.subParser("codeSpans",function(f,w,g){return f=g.converter._dispatch("codeSpans.before",f,w,g),typeof f>"u"&&(f=""),f=f.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(C,_,A,k){var L=k;return L=L.replace(/^([ \t]*)/g,""),L=L.replace(/[ \t]*$/g,""),L=n.subParser("encodeCode")(L,w,g),L=_+""+L+"",L=n.subParser("hashHTMLSpans")(L,w,g),L}),f=g.converter._dispatch("codeSpans.after",f,w,g),f}),n.subParser("completeHTMLDocument",function(f,w,g){if(!w.completeHTMLDocument)return f;f=g.converter._dispatch("completeHTMLDocument.before",f,w,g);var C="html",_=` `,A="",k=` `,L="",re="";typeof g.metadata.parsed.doctype<"u"&&(_=" `,C=g.metadata.parsed.doctype.toString().toLowerCase(),(C==="html"||C==="html5")&&(k=''));for(var K in g.metadata.parsed)if(g.metadata.parsed.hasOwnProperty(K))switch(K.toLowerCase()){case"doctype":break;case"title":A=""+g.metadata.parsed.title+` `;break;case"charset":C==="html"||C==="html5"?k=' `:k=' `;break;case"language":case"lang":L=' lang="'+g.metadata.parsed[K]+'"',re+=' `;break;default:re+=' `}return f=_+" `+A+k+re+` `+f.trim()+` `,f=g.converter._dispatch("completeHTMLDocument.after",f,w,g),f}),n.subParser("detab",function(f,w,g){return f=g.converter._dispatch("detab.before",f,w,g),f=f.replace(/\t(?=\t)/g," "),f=f.replace(/\t/g,"¨A¨B"),f=f.replace(/¨B(.+?)¨A/g,function(C,_){for(var A=_,k=4-A.length%4,L=0;L/g,">"),f=g.converter._dispatch("encodeAmpsAndAngles.after",f,w,g),f}),n.subParser("encodeBackslashEscapes",function(f,w,g){return f=g.converter._dispatch("encodeBackslashEscapes.before",f,w,g),f=f.replace(/\\(\\)/g,n.helper.escapeCharactersCallback),f=f.replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g,n.helper.escapeCharactersCallback),f=g.converter._dispatch("encodeBackslashEscapes.after",f,w,g),f}),n.subParser("encodeCode",function(f,w,g){return f=g.converter._dispatch("encodeCode.before",f,w,g),f=f.replace(/&/g,"&").replace(//g,">").replace(/([*_{}\[\]\\=~-])/g,n.helper.escapeCharactersCallback),f=g.converter._dispatch("encodeCode.after",f,w,g),f}),n.subParser("escapeSpecialCharsWithinTagAttributes",function(f,w,g){f=g.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",f,w,g);var C=/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,_=/-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;return f=f.replace(C,function(A){return A.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,n.helper.escapeCharactersCallback)}),f=f.replace(_,function(A){return A.replace(/([\\`*_~=|])/g,n.helper.escapeCharactersCallback)}),f=g.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",f,w,g),f}),n.subParser("githubCodeBlocks",function(f,w,g){return w.ghCodeBlocks?(f=g.converter._dispatch("githubCodeBlocks.before",f,w,g),f+="¨0",f=f.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(C,_,A,k){var L=w.omitExtraWLInCodeBlocks?"":` `;return k=n.subParser("encodeCode")(k,w,g),k=n.subParser("detab")(k,w,g),k=k.replace(/^\n+/g,""),k=k.replace(/\n+$/g,""),k="
"+k+L+"
",k=n.subParser("hashBlock")(k,w,g),` ¨G`+(g.ghCodeBlocks.push({text:C,codeblock:k})-1)+`G `}),f=f.replace(/¨0/,""),g.converter._dispatch("githubCodeBlocks.after",f,w,g)):f}),n.subParser("hashBlock",function(f,w,g){return f=g.converter._dispatch("hashBlock.before",f,w,g),f=f.replace(/(^\n+|\n+$)/g,""),f=` ¨K`+(g.gHtmlBlocks.push(f)-1)+`K `,f=g.converter._dispatch("hashBlock.after",f,w,g),f}),n.subParser("hashCodeTags",function(f,w,g){f=g.converter._dispatch("hashCodeTags.before",f,w,g);var C=function(_,A,k,L){var re=k+n.subParser("encodeCode")(A,w,g)+L;return"¨C"+(g.gHtmlSpans.push(re)-1)+"C"};return f=n.helper.replaceRecursiveRegExp(f,C,"]*>","","gim"),f=g.converter._dispatch("hashCodeTags.after",f,w,g),f}),n.subParser("hashElement",function(f,w,g){return function(C,_){var A=_;return A=A.replace(/\n\n/g,` `),A=A.replace(/^\n/,""),A=A.replace(/\n+$/g,""),A=` ¨K`+(g.gHtmlBlocks.push(A)-1)+`K `,A}}),n.subParser("hashHTMLBlocks",function(f,w,g){f=g.converter._dispatch("hashHTMLBlocks.before",f,w,g);var C=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],_=function(E,Y,W,oe){var ae=E;return W.search(/\bmarkdown\b/)!==-1&&(ae=W+g.converter.makeHtml(Y)+oe),` ¨K`+(g.gHtmlBlocks.push(ae)-1)+`K `};w.backslashEscapesHTMLTags&&(f=f.replace(/\\<(\/?[^>]+?)>/g,function(E,Y){return"<"+Y+">"}));for(var A=0;A]*>)","im"),re="<"+C[A]+"\\b[^>]*>",K="";(k=n.helper.regexIndexOf(f,L))!==-1;){var J=n.helper.splitAtIndex(f,k),ee=n.helper.replaceRecursiveRegExp(J[1],_,re,K,"im");if(ee===J[1])break;f=J[0].concat(ee)}return f=f.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,n.subParser("hashElement")(f,w,g)),f=n.helper.replaceRecursiveRegExp(f,function(E){return` ¨K`+(g.gHtmlBlocks.push(E)-1)+`K `},"^ {0,3}","gm"),f=f.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,n.subParser("hashElement")(f,w,g)),f=g.converter._dispatch("hashHTMLBlocks.after",f,w,g),f}),n.subParser("hashHTMLSpans",function(f,w,g){f=g.converter._dispatch("hashHTMLSpans.before",f,w,g);function C(_){return"¨C"+(g.gHtmlSpans.push(_)-1)+"C"}return f=f.replace(/<[^>]+?\/>/gi,function(_){return C(_)}),f=f.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(_){return C(_)}),f=f.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(_){return C(_)}),f=f.replace(/<[^>]+?>/gi,function(_){return C(_)}),f=g.converter._dispatch("hashHTMLSpans.after",f,w,g),f}),n.subParser("unhashHTMLSpans",function(f,w,g){f=g.converter._dispatch("unhashHTMLSpans.before",f,w,g);for(var C=0;C]*>\\s*]*>","^ {0,3}\\s*
","gim"),f=g.converter._dispatch("hashPreCodeTags.after",f,w,g),f}),n.subParser("headers",function(f,w,g){f=g.converter._dispatch("headers.before",f,w,g);var C=isNaN(parseInt(w.headerLevelStart))?1:parseInt(w.headerLevelStart),_=w.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,A=w.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;f=f.replace(_,function(re,K){var J=n.subParser("spanGamut")(K,w,g),ee=w.noHeaderId?"":' id="'+L(K)+'"',E=C,Y=""+J+"";return n.subParser("hashBlock")(Y,w,g)}),f=f.replace(A,function(re,K){var J=n.subParser("spanGamut")(K,w,g),ee=w.noHeaderId?"":' id="'+L(K)+'"',E=C+1,Y=""+J+"";return n.subParser("hashBlock")(Y,w,g)});var k=w.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;f=f.replace(k,function(re,K,J){var ee=J;w.customizedHeaderId&&(ee=J.replace(/\s?\{([^{]+?)}\s*$/,""));var E=n.subParser("spanGamut")(ee,w,g),Y=w.noHeaderId?"":' id="'+L(J)+'"',W=C-1+K.length,oe=""+E+"";return n.subParser("hashBlock")(oe,w,g)});function L(re){var K,J;if(w.customizedHeaderId){var ee=re.match(/\{([^{]+?)}\s*$/);ee&&ee[1]&&(re=ee[1])}return K=re,n.helper.isString(w.prefixHeaderId)?J=w.prefixHeaderId:w.prefixHeaderId===!0?J="section-":J="",w.rawPrefixHeaderId||(K=J+K),w.ghCompatibleHeaderId?K=K.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():w.rawHeaderId?K=K.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():K=K.replace(/[^\w]/g,"").toLowerCase(),w.rawPrefixHeaderId&&(K=J+K),g.hashLinkCounts[K]?K=K+"-"+g.hashLinkCounts[K]++:g.hashLinkCounts[K]=1,K}return f=g.converter._dispatch("headers.after",f,w,g),f}),n.subParser("horizontalRule",function(f,w,g){f=g.converter._dispatch("horizontalRule.before",f,w,g);var C=n.subParser("hashBlock")("
",w,g);return f=f.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,C),f=f.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,C),f=f.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,C),f=g.converter._dispatch("horizontalRule.after",f,w,g),f}),n.subParser("images",function(f,w,g){f=g.converter._dispatch("images.before",f,w,g);var C=/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,_=/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,A=/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,k=/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,L=/!\[([^\[\]]+)]()()()()()/g;function re(J,ee,E,Y,W,oe,ae,O){return Y=Y.replace(/\s/g,""),K(J,ee,E,Y,W,oe,ae,O)}function K(J,ee,E,Y,W,oe,ae,O){var ne=g.gUrls,xe=g.gTitles,$e=g.gDimensions;if(E=E.toLowerCase(),O||(O=""),J.search(/\(? ?(['"].*['"])?\)$/m)>-1)Y="";else if(Y===""||Y===null)if((E===""||E===null)&&(E=ee.toLowerCase().replace(/ ?\n/g," ")),Y="#"+E,!n.helper.isUndefined(ne[E]))Y=ne[E],n.helper.isUndefined(xe[E])||(O=xe[E]),n.helper.isUndefined($e[E])||(W=$e[E].width,oe=$e[E].height);else return J;ee=ee.replace(/"/g,""").replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback),Y=Y.replace(n.helper.regexes.asteriskDashAndColon,n.helper.escapeCharactersCallback);var Ee=''+ee+'","
")}),f=f.replace(/\b__(\S[\s\S]*?)__\b/g,function(_,A){return C(A,"","")}),f=f.replace(/\b_(\S[\s\S]*?)_\b/g,function(_,A){return C(A,"","")})):(f=f.replace(/___(\S[\s\S]*?)___/g,function(_,A){return/\S$/.test(A)?C(A,"",""):_}),f=f.replace(/__(\S[\s\S]*?)__/g,function(_,A){return/\S$/.test(A)?C(A,"",""):_}),f=f.replace(/_([^\s_][\s\S]*?)_/g,function(_,A){return/\S$/.test(A)?C(A,"",""):_})),w.literalMidWordAsterisks?(f=f.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(_,A,k){return C(k,A+"","")}),f=f.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(_,A,k){return C(k,A+"","")}),f=f.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(_,A,k){return C(k,A+"","")})):(f=f.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(_,A){return/\S$/.test(A)?C(A,"",""):_}),f=f.replace(/\*\*(\S[\s\S]*?)\*\*/g,function(_,A){return/\S$/.test(A)?C(A,"",""):_}),f=f.replace(/\*([^\s*][\s\S]*?)\*/g,function(_,A){return/\S$/.test(A)?C(A,"",""):_})),f=g.converter._dispatch("italicsAndBold.after",f,w,g),f}),n.subParser("lists",function(f,w,g){function C(k,L){g.gListLevel++,k=k.replace(/\n{2,}$/,` `),k+="¨0";var re=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,K=/\n[ \t]*\n(?!¨0)/.test(k);return w.disableForced4SpacesIndentedSublists&&(re=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),k=k.replace(re,function(J,ee,E,Y,W,oe,ae){ae=ae&&ae.trim()!=="";var O=n.subParser("outdent")(W,w,g),ne="";return oe&&w.tasklists&&(ne=' class="task-list-item" style="list-style-type: none;"',O=O.replace(/^[ \t]*\[(x|X| )?]/m,function(){var xe='-1?(O=n.subParser("githubCodeBlocks")(O,w,g),O=n.subParser("blockGamut")(O,w,g)):(O=n.subParser("lists")(O,w,g),O=O.replace(/\n$/,""),O=n.subParser("hashHTMLBlocks")(O,w,g),O=O.replace(/\n\n+/g,` `),K?O=n.subParser("paragraphs")(O,w,g):O=n.subParser("spanGamut")(O,w,g)),O=O.replace("¨A",""),O=""+O+` `,O}),k=k.replace(/¨0/g,""),g.gListLevel--,L&&(k=k.replace(/\s+$/,"")),k}function _(k,L){if(L==="ol"){var re=k.match(/^ *(\d+)\./);if(re&&re[1]!=="1")return' start="'+re[1]+'"'}return""}function A(k,L,re){var K=w.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,J=w.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,ee=L==="ul"?K:J,E="";if(k.search(ee)!==-1)(function W(oe){var ae=oe.search(ee),O=_(k,L);ae!==-1?(E+=` <`+L+O+`> `+C(oe.slice(0,ae),!!re)+" `,L=L==="ul"?"ol":"ul",ee=L==="ul"?K:J,W(oe.slice(ae))):E+=` <`+L+O+`> `+C(oe,!!re)+" `})(k);else{var Y=_(k,L);E=` <`+L+Y+`> `+C(k,!!re)+" `}return E}return f=g.converter._dispatch("lists.before",f,w,g),f+="¨0",g.gListLevel?f=f.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(k,L,re){var K=re.search(/[*+-]/g)>-1?"ul":"ol";return A(L,K,!0)}):f=f.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(k,L,re,K){var J=K.search(/[*+-]/g)>-1?"ul":"ol";return A(re,J,!1)}),f=f.replace(/¨0/,""),f=g.converter._dispatch("lists.after",f,w,g),f}),n.subParser("metadata",function(f,w,g){if(!w.metadata)return f;f=g.converter._dispatch("metadata.before",f,w,g);function C(_){g.metadata.raw=_,_=_.replace(/&/g,"&").replace(/"/g,"""),_=_.replace(/\n {4}/g," "),_.replace(/^([\S ]+): +([\s\S]+?)$/gm,function(A,k,L){return g.metadata.parsed[k]=L,""})}return f=f.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function(_,A,k){return C(k),"¨M"}),f=f.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function(_,A,k){return A&&(g.metadata.format=A),C(k),"¨M"}),f=f.replace(/¨M/g,""),f=g.converter._dispatch("metadata.after",f,w,g),f}),n.subParser("outdent",function(f,w,g){return f=g.converter._dispatch("outdent.before",f,w,g),f=f.replace(/^(\t|[ ]{1,4})/gm,"¨0"),f=f.replace(/¨0/g,""),f=g.converter._dispatch("outdent.after",f,w,g),f}),n.subParser("paragraphs",function(f,w,g){f=g.converter._dispatch("paragraphs.before",f,w,g),f=f.replace(/^\n+/g,""),f=f.replace(/\n+$/g,"");for(var C=f.split(/\n{2,}/g),_=[],A=C.length,k=0;k=0?_.push(L):L.search(/\S/)>=0&&(L=n.subParser("spanGamut")(L,w,g),L=L.replace(/^([ \t]*)/g,"

"),L+="

",_.push(L))}for(A=_.length,k=0;k]*>\s*]*>/.test(K)&&(J=!0)}_[k]=K}return f=_.join(` `),f=f.replace(/^\n+/g,""),f=f.replace(/\n+$/g,""),g.converter._dispatch("paragraphs.after",f,w,g)}),n.subParser("runExtension",function(f,w,g,C){if(f.filter)w=f.filter(w,C.converter,g);else if(f.regex){var _=f.regex;_ instanceof RegExp||(_=new RegExp(_,"g")),w=w.replace(_,f.replace)}return w}),n.subParser("spanGamut",function(f,w,g){return f=g.converter._dispatch("spanGamut.before",f,w,g),f=n.subParser("codeSpans")(f,w,g),f=n.subParser("escapeSpecialCharsWithinTagAttributes")(f,w,g),f=n.subParser("encodeBackslashEscapes")(f,w,g),f=n.subParser("images")(f,w,g),f=n.subParser("anchors")(f,w,g),f=n.subParser("autoLinks")(f,w,g),f=n.subParser("simplifiedAutoLinks")(f,w,g),f=n.subParser("emoji")(f,w,g),f=n.subParser("underline")(f,w,g),f=n.subParser("italicsAndBold")(f,w,g),f=n.subParser("strikethrough")(f,w,g),f=n.subParser("ellipsis")(f,w,g),f=n.subParser("hashHTMLSpans")(f,w,g),f=n.subParser("encodeAmpsAndAngles")(f,w,g),w.simpleLineBreaks?/\n\n¨K/.test(f)||(f=f.replace(/\n+/g,`
`)):f=f.replace(/ +\n/g,`
`),f=g.converter._dispatch("spanGamut.after",f,w,g),f}),n.subParser("strikethrough",function(f,w,g){function C(_){return w.simplifiedAutoLink&&(_=n.subParser("simplifiedAutoLinks")(_,w,g)),""+_+""}return w.strikethrough&&(f=g.converter._dispatch("strikethrough.before",f,w,g),f=f.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(_,A){return C(A)}),f=g.converter._dispatch("strikethrough.after",f,w,g)),f}),n.subParser("stripLinkDefinitions",function(f,w,g){var C=/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,_=/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;f+="¨0";var A=function(k,L,re,K,J,ee,E){return L=L.toLowerCase(),f.toLowerCase().split(L).length-1<2?k:(re.match(/^data:.+?\/.+?;base64,/)?g.gUrls[L]=re.replace(/\s/g,""):g.gUrls[L]=n.subParser("encodeAmpsAndAngles")(re,w,g),ee?ee+E:(E&&(g.gTitles[L]=E.replace(/"|'/g,""")),w.parseImgDimensions&&K&&J&&(g.gDimensions[L]={width:K,height:J}),""))};return f=f.replace(_,A),f=f.replace(C,A),f=f.replace(/¨0/,""),f}),n.subParser("tables",function(f,w,g){if(!w.tables)return f;var C=/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,_=/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;function A(J){return/^:[ \t]*--*$/.test(J)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(J)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(J)?' style="text-align:center;"':""}function k(J,ee){var E="";return J=J.trim(),(w.tablesHeaderId||w.tableHeaderId)&&(E=' id="'+J.replace(/ /g,"_").toLowerCase()+'"'),J=n.subParser("spanGamut")(J,w,g),""+J+` `}function L(J,ee){var E=n.subParser("spanGamut")(J,w,g);return""+E+` `}function re(J,ee){for(var E=` `,Y=J.length,W=0;W `,W=0;W `;for(var oe=0;oe `}return E+=`
`,E}function K(J){var ee,E=J.split(` `);for(ee=0;ee"+_+""}),f=f.replace(/\b__(\S[\s\S]*?)__\b/g,function(C,_){return""+_+""})):(f=f.replace(/___(\S[\s\S]*?)___/g,function(C,_){return/\S$/.test(_)?""+_+"":C}),f=f.replace(/__(\S[\s\S]*?)__/g,function(C,_){return/\S$/.test(_)?""+_+"":C})),f=f.replace(/(_)/g,n.helper.escapeCharactersCallback),f=g.converter._dispatch("underline.after",f,w,g)),f}),n.subParser("unescapeSpecialChars",function(f,w,g){return f=g.converter._dispatch("unescapeSpecialChars.before",f,w,g),f=f.replace(/¨E(\d+)E/g,function(C,_){var A=parseInt(_);return String.fromCharCode(A)}),f=g.converter._dispatch("unescapeSpecialChars.after",f,w,g),f}),n.subParser("makeMarkdown.blockquote",function(f,w){var g="";if(f.hasChildNodes())for(var C=f.childNodes,_=C.length,A=0;A<_;++A){var k=n.subParser("makeMarkdown.node")(C[A],w);k!==""&&(g+=k)}return g=g.trim(),g="> "+g.split(` `).join(` > `),g}),n.subParser("makeMarkdown.codeBlock",function(f,w){var g=f.getAttribute("language"),C=f.getAttribute("precodenum");return"```"+g+` `+w.preList[C]+"\n```"}),n.subParser("makeMarkdown.codeSpan",function(f){return"`"+f.innerHTML+"`"}),n.subParser("makeMarkdown.emphasis",function(f,w){var g="";if(f.hasChildNodes()){g+="*";for(var C=f.childNodes,_=C.length,A=0;A<_;++A)g+=n.subParser("makeMarkdown.node")(C[A],w);g+="*"}return g}),n.subParser("makeMarkdown.header",function(f,w,g){var C=new Array(g+1).join("#"),_="";if(f.hasChildNodes()){_=C+" ";for(var A=f.childNodes,k=A.length,L=0;L",f.hasAttribute("width")&&f.hasAttribute("height")&&(w+=" ="+f.getAttribute("width")+"x"+f.getAttribute("height")),f.hasAttribute("title")&&(w+=' "'+f.getAttribute("title")+'"'),w+=")"),w}),n.subParser("makeMarkdown.links",function(f,w){var g="";if(f.hasChildNodes()&&f.hasAttribute("href")){var C=f.childNodes,_=C.length;g="[";for(var A=0;A<_;++A)g+=n.subParser("makeMarkdown.node")(C[A],w);g+="](",g+="<"+f.getAttribute("href")+">",f.hasAttribute("title")&&(g+=' "'+f.getAttribute("title")+'"'),g+=")"}return g}),n.subParser("makeMarkdown.list",function(f,w,g){var C="";if(!f.hasChildNodes())return"";for(var _=f.childNodes,A=_.length,k=f.getAttribute("start")||1,L=0;L"u"||_[L].tagName.toLowerCase()!=="li")){var re="";g==="ol"?re=k.toString()+". ":re="- ",C+=re+n.subParser("makeMarkdown.listItem")(_[L],w),++k}return C+=` `,C.trim()}),n.subParser("makeMarkdown.listItem",function(f,w){for(var g="",C=f.childNodes,_=C.length,A=0;A<_;++A)g+=n.subParser("makeMarkdown.node")(C[A],w);return/\n$/.test(g)?g=g.split(` `).join(` `).replace(/^ {4}$/gm,"").replace(/\n\n+/g,` `):g+=` `,g}),n.subParser("makeMarkdown.node",function(f,w,g){g=g||!1;var C="";if(f.nodeType===3)return n.subParser("makeMarkdown.txt")(f,w);if(f.nodeType===8)return" `;if(f.nodeType!==1)return"";var _=f.tagName.toLowerCase();switch(_){case"h1":g||(C=n.subParser("makeMarkdown.header")(f,w,1)+` `);break;case"h2":g||(C=n.subParser("makeMarkdown.header")(f,w,2)+` `);break;case"h3":g||(C=n.subParser("makeMarkdown.header")(f,w,3)+` `);break;case"h4":g||(C=n.subParser("makeMarkdown.header")(f,w,4)+` `);break;case"h5":g||(C=n.subParser("makeMarkdown.header")(f,w,5)+` `);break;case"h6":g||(C=n.subParser("makeMarkdown.header")(f,w,6)+` `);break;case"p":g||(C=n.subParser("makeMarkdown.paragraph")(f,w)+` `);break;case"blockquote":g||(C=n.subParser("makeMarkdown.blockquote")(f,w)+` `);break;case"hr":g||(C=n.subParser("makeMarkdown.hr")(f,w)+` `);break;case"ol":g||(C=n.subParser("makeMarkdown.list")(f,w,"ol")+` `);break;case"ul":g||(C=n.subParser("makeMarkdown.list")(f,w,"ul")+` `);break;case"precode":g||(C=n.subParser("makeMarkdown.codeBlock")(f,w)+` `);break;case"pre":g||(C=n.subParser("makeMarkdown.pre")(f,w)+` `);break;case"table":g||(C=n.subParser("makeMarkdown.table")(f,w)+` `);break;case"code":C=n.subParser("makeMarkdown.codeSpan")(f,w);break;case"em":case"i":C=n.subParser("makeMarkdown.emphasis")(f,w);break;case"strong":case"b":C=n.subParser("makeMarkdown.strong")(f,w);break;case"del":C=n.subParser("makeMarkdown.strikethrough")(f,w);break;case"a":C=n.subParser("makeMarkdown.links")(f,w);break;case"img":C=n.subParser("makeMarkdown.image")(f,w);break;default:C=f.outerHTML+` `}return C}),n.subParser("makeMarkdown.paragraph",function(f,w){var g="";if(f.hasChildNodes())for(var C=f.childNodes,_=C.length,A=0;A<_;++A)g+=n.subParser("makeMarkdown.node")(C[A],w);return g=g.trim(),g}),n.subParser("makeMarkdown.pre",function(f,w){var g=f.getAttribute("prenum");return"
"+w.preList[g]+"
"}),n.subParser("makeMarkdown.strikethrough",function(f,w){var g="";if(f.hasChildNodes()){g+="~~";for(var C=f.childNodes,_=C.length,A=0;A<_;++A)g+=n.subParser("makeMarkdown.node")(C[A],w);g+="~~"}return g}),n.subParser("makeMarkdown.strong",function(f,w){var g="";if(f.hasChildNodes()){g+="**";for(var C=f.childNodes,_=C.length,A=0;A<_;++A)g+=n.subParser("makeMarkdown.node")(C[A],w);g+="**"}return g}),n.subParser("makeMarkdown.table",function(f,w){var g="",C=[[],[]],_=f.querySelectorAll("thead>tr>th"),A=f.querySelectorAll("tbody>tr"),k,L;for(k=0;k<_.length;++k){var re=n.subParser("makeMarkdown.tableCell")(_[k],w),K="---";if(_[k].hasAttribute("style")){var J=_[k].getAttribute("style").toLowerCase().replace(/\s/g,"");switch(J){case"text-align:left;":K=":---";break;case"text-align:right;":K="---:";break;case"text-align:center;":K=":---:";break}}C[0][k]=re.trim(),C[1][k]=K}for(k=0;kW&&(W=oe)}for(k=0;k/g,"\\$1>"),w=w.replace(/^#/gm,"\\#"),w=w.replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3"),w=w.replace(/^( {0,3}\d+)\./gm,"$1\\."),w=w.replace(/^( {0,3})([+-])/gm,"$1\\$2"),w=w.replace(/]([\s]*)\(/g,"\\]$1\\("),w=w.replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:"),w});var H=this;e.exports?e.exports=n:H.showdown=n}).call(showdown$1)}(showdown$2)),showdown$2.exports}var showdownExports=requireShowdown();const showdown=getDefaultExportFromCjs(showdownExports);function useHTMLFromMarkdown(e){const t=usePopupThemeConfig(),r=t==null?void 0:t.styles.text.find(n=>n.handle===LINK_HANDLE);return e?transformAnchorTags(markdownToHTML(e),{target:"_blank",rel:"noopener noreferrer",className:classNames(SHARED_STYLE_CLASSNAME(r==null?void 0:r.handle),r==null?void 0:r.styles.classes,"underline")}):""}const PROSE_CLASSNAME=` prose prose-img:rounded-lg prose-img:my-3 prose-p:mt-1.5 prose-p:mb-2 prose-p:text-lg prose-p:leading-6 prose-h1:mt-3.5 prose-h1:mb-3 prose-h1:text-display-xl prose-h2:mt-2.5 prose-h2:mb-2 prose-h2:text-display-lg prose-h3:mt-2 prose-h3:mb-1.5 prose-h3:text-display prose-h4:my-1.5 prose-h4:text-display-sm prose-h5:my-1.5 prose-h5:text-display-xs prose-h6:my-1.5 prose-h6:text-display-xs prose-ul:my-2 prose-ul:ml-6 prose-ul:text-lg prose-ul:list-disc prose-ol:my-2 prose-ol:text-lg prose-ol:ml-6 prose-ol:list-decimal prose-li:my-1 prose-li:leading-6 prose-a:underline `,Markdown=({markdown:e,prose:t=!1})=>{const r=useHTMLFromMarkdown(e);return jsx("div",{className:t?PROSE_CLASSNAME:"",dangerouslySetInnerHTML:{__html:r}})};function transformAnchorTags(e,t={}){return e.replace(/]*)>/g,(r,n)=>{const i=Object.entries(t).map(([s,l])=>s==="className"?`class="${l}"`:`${s}="${l}"`).join(" ");return``})}function markdownToHTML(e){const t=new showdown.Converter({noHeaderId:!0});return t.setFlavor("github"),t.makeHtml(e)}const useGetLessonStatusesQuery=queryManager(()=>["lessonStatuses","getLessonStatuses"]);function useGetLessonStatuses(){const e=useServiceFetch(),{getQueryKey:t}=useGetLessonStatusesQuery();return useSuspenseQuery({queryKey:t(),queryFn:()=>e("GET","/lesson-status",{})})}const useGetLessonStatusQuery=queryManager(e=>["lessonStatuses","getLessonStatus",e]);function useGetLessonStatus(e){const t=useServiceFetch(),{getQueryKey:r}=useGetLessonStatusQuery(),{getData:n}=useGetLessonStatusesQuery();return useSuspenseQuery({queryKey:r(e),queryFn:()=>t("GET","/lesson-status/:lessonID",e),initialData:n().find(i=>i.lessonID===e.params.lessonID)})}function useAnswerQuestion(){const e=useServiceFetch(),{updateQuery:t}=useGetLessonStatusQuery(),{updateQuery:r}=useGetLessonStatusesQuery(),{invalidateQuery:n}=useGetUserFlowQuery();return useMutation({mutationKey:["answerQuestion"],mutationFn:i=>e("POST","/lesson-status/answer",{body:i}),onSuccess:i=>{t({params:{lessonID:i.lessonID}},()=>i),r(void 0,s=>mergeOneIntoMany(s,i)),n()}})}const Toast=()=>{const{message:e}=useToastContext();return jsx("div",{className:"fixed top-4 w-80 max-h-16 overflow-hidden p-4 bg-accent-900 text-accent-foreground rounded-lg transition-all duration-200 ease-in shadow-lg pointer-events-none",style:{zIndex:2147483647,left:"50%",transform:`translateX(-50%) translateY(${e?"0":"-8rem"})`,opacity:e?1:0},children:e})},{useContext:useToastContext,Provider:Provider$9}=createContextWithoutDefault("toast"),useToast=()=>{const{setMessage:e}=useToastContext();return reactExports.useCallback(t=>{e(t),setTimeout(()=>{e(null)},4e3)},[e])},ToastProvider=({children:e})=>{const[t,r]=reactExports.useState(null);return jsx(Provider$9,{value:{message:t,setMessage:r},children:e})};function safeEval(code){try{return eval(code)}catch(e){return logger.error("Error evaluating code",{code,error:unknownErrToStr(e)}),null}}const GROUND_LOCALSTORAGE_KEY="alia-popup-ground";function getGroundIntegrationData(e){var s;const t=[...e.steps].reverse().findIndex(({step:l})=>l==="popup");if(t===-1)return{};const r=e.steps.length-t-1,n=e.steps[r].timestamp;return{lastCloseTime:(s=e.steps[r+1])==null?void 0:s.timestamp,lastTriggerTime:n}}function useGroundIntegration(){const{state:e}=useFlowStateContext();reactExports.useEffect(()=>{const t=getGroundIntegrationData(e);try{localStorage.setItem(GROUND_LOCALSTORAGE_KEY,JSON.stringify(t))}catch{}},[e])}function getGroundProfileProperties(){try{const t=safeEval("window.ALIA_PROFILE_PROPERTIES");return t&&typeof t=="object"&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).filter(([,r])=>r!=null).map(([r,n])=>[r,String(n)])):void 0}catch{return}}function onSignUp({profile,hook,properties,initialData}){var e,t;const{name,email,phone,smsOptIn}=profile;if(hook&&typeof hook=="string")try{eval(hook)}catch(r){logger.error("Error in Alia onSignup hook",r)}try{getWindowProperty("klaviyo")&&getWindowProperty("klaviyo").identify({email,first_name:name,phone_number:phone}),getWindowProperty("attentive")&&getWindowProperty("attentive").analytics.identify({phone,email}),getWindowProperty("postscript")&&getWindowProperty("postscript").identify({phone}),getWindowProperty("_aimTrack")&&getWindowProperty("_aimTrack").push(["aim_user_data",{email,phone}]),getWindowProperty("omnisend")&&getWindowProperty("omnisend").identifyContact({email,phone});const r=getWindowProperty("Shopify");r&&r.analytics&&r.analytics.publish("yotpo_identify_customer",{phone,email}),getWindowProperty("onetext")&&phone&&smsOptIn!==!1&&getWindowProperty("onetext").optin.submit({email,phone,customerProperties:{...properties,alia_campaign:(e=initialData.userFlow)==null?void 0:e.segmentTitle,alia_popup:(t=initialData.userFlow)==null?void 0:t.flowTitle}}),getWindowProperty("smsbump")&&getWindowProperty("smsbump").identify({phone,email}).then(),getWindowProperty("pushowl")&&getWindowProperty("pushowl").identify({email,properties})}catch(r){logger.error("Error in Alia onSignup integrations",r)}}function useGetAllPollAnswersNoSuspense(){const e=useServiceFetch();return useQuery({queryKey:["pollAnswers","getAll"],queryFn:()=>e("GET","/poll-answers",{}),suspense:!1})}function useGetPollAnswersForQuestionNoSuspense(e){const t=useServiceFetch();return useQuery({queryKey:["pollAnswers","getPollAnswersForQuestion"],queryFn:()=>t("GET",`/poll-answers/${e.questionUUID}`,{params:e}),suspense:!1})}function useAnswerTracksPoll(){const e=useServiceFetch(),{mediator:t}=useCustomerAppContext();return useMutation({mutationKey:["pollAnswers","answerTracksPoll"],mutationFn:r=>e("POST","/poll-answers/tracks",{body:r}),onSuccess:r=>{var n;r&&((n=t==null?void 0:t.userActionsStore)==null||n.addActions(r.userAction))}})}function useCreatePollAnswer(){const{onPollAnswered:e}=useClientIntegrations(),t=useServiceFetch(),r=useUpdateUserQuery(),{mediator:n}=useCustomerAppContext(),{mutateAsync:i}=useMutation({mutationKey:["pollAnswers","create"],mutationFn:s=>t("POST","/poll-answers",{body:s}),onSuccess:s=>{var l;r(s.user),(l=n==null?void 0:n.userActionsStore)==null||l.addActions(s.userAction)}});return reactExports.useCallback(async s=>{await i(s),e({answers:[{questionID:s.questionUUID,questionText:s.questionText,answerID:s.answerUUID,answerText:s.answer}]})},[i,e])}function useCreateManyPollAnswers(){const{onPollAnswered:e}=useClientIntegrations(),t=useUpdateUserQuery(),r=useServiceFetch(),{mediator:n}=useCustomerAppContext(),{mutateAsync:i}=useMutation({mutationKey:["pollAnswers","createMany"],mutationFn:s=>r("POST","/poll-answers/many-v2",{body:s}),onSuccess:s=>{var l;t(s.user),(l=n==null?void 0:n.userActionsStore)==null||l.addActions(...s.userActions)}});return reactExports.useCallback(async s=>{await i(s),e({answers:s.answers.map(l=>({questionID:l.questionUUID,questionText:l.questionText,answerID:l.answerUUID,answerText:l.answer}))})},[i,e])}const getUserQuery=queryManager(()=>["users","getUser"]);function useGetUser(e=!1){const{initialData:t}=useCustomerAppContext(),{getQueryKey:r}=getUserQuery(),n=useServiceFetch();return useSuspenseQuery({queryKey:r(),queryFn:()=>n("GET","/users",{}),refetchInterval:e?5e3:void 0,initialData:t.user})}function useUpdateUserQuery(){const{updateQuery:e}=getUserQuery(),{mediator:t}=useCustomerAppContext();return reactExports.useCallback(r=>{e(void 0,()=>r),t==null||t.update(()=>({user:r}))},[e,t])}function useSetProfile(){const{data:e}=useGetSettings(),{data:t}=useGetAllPollAnswersNoSuspense(),{onSignup:r}=useClientIntegrations(),n=useServiceFetch(),i=useUpdateUserQuery(),s=useToast(),{mediator:l,initialData:d}=useCustomerAppContext();return useMutation({mutationKey:["setProfile"],mutationFn:async p=>{const m=getGroundProfileProperties();return await n("POST","/users/profile",{body:{...p,properties:{...m,...p.properties}}})},onSuccess:(p,{properties:m})=>{var v;i(p),(v=l==null?void 0:l.userActionsStore)==null||v.addActions(...p.userActions),onSignUp({profile:p,properties:t?Object.values(t).reduce((b,S)=>S.questionText?{...b,[S.questionText]:S.answer}:b,m??{}):m??{},hook:e.onSignupHook,initialData:d}),r(p)},onError:p=>{s(unknownErrToStr(p))}})}function useGetIsOptedIn(e){const[t,r]=reactExports.useState(2),n=useServiceFetch();return useQuery({enabled:!!e,queryKey:["getIsOptedIn",e],queryFn:async()=>(r(i=>i+=4),await n("GET","/users/opted-in",{query:{type:e??"email"}})),refetchOnMount:!0,refetchOnWindowFocus:!0,refetchInterval:t*1e3,staleTime:4e3})}const Layout$1=({left:e,right:t,children:r,reverse:n=!1})=>jsxs(Fragment,{children:[jsxs("div",{className:classNames("w-full flex justify-between items-center gap-2 -my-1",{"flex-row-reverse":n}),children:[e,t]}),r]}),LayoutBack=({text:e="Back",onClick:t})=>jsxs(ClickableDiv,{className:"flex space-x-1 cursor-pointer",onClick:t,children:[jsx(Icon,{icon:"arrowLeft",className:"text-lg"}),jsx("p",{className:"font-medium",children:e})]});function formatShopifyCurrency(e,t){function r(n){const{separator:i=",",decimalSeparator:s=".",includeDecimals:l=!0}=n||{},d=l&&e%1!==0,[p,m]=e.toFixed(2).split(".");return p.split("").reverse().map((S,$)=>$>0&&$%3===0?S+i:S).reverse().join("")+(d?s+m:"")}return t.replace(/{{\s*amount\s*}}/g,r()).replace(/{{\s*amount_no_decimals\s*}}/g,r({includeDecimals:!1})).replace(/{{\s*amount_with_comma_separator\s*}}/g,r({separator:".",decimalSeparator:","})).replace(/{{\s*amount_no_decimals_with_comma_separator\s*}}/g,r({separator:".",decimalSeparator:",",includeDecimals:!1})).replace(/{{\s*amount_with_apostrophe_separator\s*}}/g,r({separator:"'"}))}function getProductsDescriptor(e,t=!1){return!t&&e.customDescriptor?e.customDescriptor.descriptor:joinWithAnd(e.products.map(r=>r.title))}function getCollectionsDescriptor(e,t=!1){return!t&&e.customDescriptor?e.customDescriptor.descriptor:joinWithAnd(e.collections.map(r=>r.title))}function getItemsDescriptor(e,t=!1){if(e.items.type==="all")return"all products";if(e.items.type==="products")return getProductsDescriptor(e.items,t);if(e.items.type==="collections")return getCollectionsDescriptor(e.items,t);assertNever(e.items)}function getDiscountValueText(e,t){return e.value.type==="percent"?`${e.value.percent}%`:`${formatShopifyCurrency(e.value.amount,t.currencyFormats.moneyFormat)}`}function getDiscountPriceQualifiers(e,t){return e.minimumRequirement!==void 0?`On orders over ${formatShopifyCurrency(e.minimumRequirement,t.currencyFormats.moneyFormat)}`:""}function getDiscountStackingQualifiers(e){const t=(()=>{if(!Object.values(e.combinesWith).some(l=>l))return"combined with other discounts";const s=[];if(e.combinesWith.orderDiscounts===!1&&s.push("order"),e.combinesWith.productDiscounts===!1&&s.push("product"),e.combinesWith.shippingDiscounts===!1&&s.push("shipping"),s.length!==0)return`combined with ${joinWithAnd(s,"or")} discounts`})(),r=e.appliesOnSubscription?void 0:"used on subscription purchases",n=[];return r&&n.push(r),t&&n.push(t),n.length>0?`Cannot be ${joinWithAnd(n,"or")}`:void 0}function getFreeShippingQualifiers(e,t){return e.maximumShippingPrice!==void 0&&e.minimumRequirement!==void 0?`On orders over ${formatShopifyCurrency(e.minimumRequirement,t.currencyFormats.moneyFormat)} (up to ${formatShopifyCurrency(e.maximumShippingPrice,t.currencyFormats.moneyFormat)} value)`:e.maximumShippingPrice!==void 0?`Up to ${formatShopifyCurrency(e.maximumShippingPrice,t.currencyFormats.moneyFormat)} value`:e.minimumRequirement!==void 0?`On orders over ${formatShopifyCurrency(e.minimumRequirement,t.currencyFormats.moneyFormat)}`:""}function getRewardText(e,t){if(e.type==="discount")return getDiscountValueText(e.discount,t)+" off";if(e.type==="freeShipping")return"Free shipping";if(e.type==="custom")return e.custom.title;assertNever(e)}function getFullRewardText(e,t,r=!0){if(e.type==="discount"){const n=getDiscountPriceQualifiers(e.discount,t);return`${getDiscountValueText(e.discount,t)} off ${getItemsDescriptor(e.discount)}${n&&r?` (${n.toLowerCase()})`:""}`}else{if(e.type==="freeShipping")return`Free shipping ${lowerFirst(getFreeShippingQualifiers(e.freeShipping,t))}`;if(e.type==="custom")return e.custom.title}}const Label=({children:e})=>jsx("div",{className:"w-max bg-accent h-5 text-accent-foreground px-2 py-px rounded uppercase font-semibold text-sm",children:e}),useGetLessonsQuery=queryManager(()=>["lessons","getLessons"]);function useGetAllLessons(){const e=useServiceFetch(),{getQueryKey:t}=useGetLessonsQuery();return useSuspenseQuery({queryKey:t(),queryFn:()=>e("GET","/lessons",{}),staleTime:1/0})}const useGetAllRewardsQuery=queryManager(()=>["rewards","getRewards"]);function useGetAllRewards(){const e=useServiceFetch(),{getQueryKey:t}=useGetAllRewardsQuery();return useSuspenseQuery({queryKey:t(),queryFn:()=>e("GET","/rewards",{}),staleTime:1/0})}function useLessons(){const{data:e}=useGetAllLessons(),{config:t}=useLessonsContext();return t.tiers.map(r=>e.find(n=>n.id===r.lessonID)).filter(Boolean)}function useRewards(){const{data:e}=useGetAllRewards(),{config:t}=useLessonsContext();return t.tiers.map(r=>e.find(n=>n.id===r.rewardID)).filter(Boolean)}const{Provider:LessonContextProvider,useContext:useLessonContext}=createContextWithoutDefault("lessonContext");function useSlideIndex(){const{slideIndex:e,setSlideIndex:t,maxSlideIndex:r,setMaxSlideIndex:n}=useLessonContext();return[e,i=>{const s=i(e);t(s),n(Math.max(s,r))}]}function useMaxSlideIndex(){const{maxSlideIndex:e}=useLessonContext();return e}function useLesson(e){return useLessons().find(r=>r.id===e)}function useLoadSlideIndex(e,t){const{setSlideIndex:r,setMaxSlideIndex:n,lastLoadedLesson:i,setLastLoadedLesson:s}=useLessonContext();reactExports.useEffect(()=>{if(i!==e.id){s(e.id);const l=getInitialSlideIndex(e.publicData,t.data);r(l),n(l)}},[n,e,t,i,s,r])}function getInitialSlideIndex(e,t){var r;for(let n=e.slides.length-1;n>=0;n--){const i=e.slides[n];if(i.type==="question"&&((r=t[i.uuid])!=null&&r.complete))return Math.min(n+1,e.slides.length-1)}return 0}function useRewardsInTier(e){const t=useRewards(),{config:r}=useLessonsContext();return reactExports.useMemo(()=>{var n;if(e){const i=(n=r.tiers[e-1])==null?void 0:n.rewardID;return i?t.filter(s=>s.id===i):[]}return[]},[t,e,r])}function useUserTier(){const{config:e}=useLessonsContext(),{data:t}=useGetLessonStatuses();return reactExports.useMemo(()=>{const r=e.tiers.map(i=>i.lessonID),n=r.filter(i=>t.some(s=>s.lessonID===i&&s.completed)).length;return{tier:n,lastRewardTier:n>0?n:void 0,nextRewardTier:n{const{data:r}=useGetLessonStatuses(),{tier:n,nextRewardTier:i}=useUserTier(),s=useRewardsInTier(i)[0],l=i?i-n:0,d=e.publicData,{data:p}=useGetMerchant(),{setState:m}=useLessonsContext(),v=reactExports.useMemo(()=>r.find(D=>D.lessonID===e.id),[r,e]),b=reactExports.useMemo(()=>v?getInitialSlideIndex(d,v.data):0,[v,d]),S=d.slides.length-b,$=Math.ceil(S/3),N=()=>{t&&(v!=null&&v.completed||m({type:"lesson",lessonID:e.id}))};return jsxs(ClickableDiv,{className:classNames("box theme flex flex-col space-y-2 border-accent group",t?"clickable hover:scale-[1.01]":"disabled"),onClick:N,children:[!!e.imageURL&&t&&jsx("img",{className:"rounded-lg max-h-40 object-cover mb-1",src:e.imageURL,alt:e.name}),jsxs("div",{className:classNames("flex gap-2 border-accent justify-between items-center"),children:[jsxs("div",{className:"flex-1 flex flex-col space-y-2",children:[t&&l===1&&jsxs(Label,{children:["Get ",getRewardText(s.config,p.shopInfo)]}),jsx("div",{className:"flex flex-col gap-2",children:jsxs("div",{className:"flex flex-col gap-1 flex-wrap",children:[jsx("div",{className:classNames("font-medium",t?"text-display-sm leading-6":"text-display-xs leading-5"),children:e.name}),jsxs("div",{className:"flex items-center space-x-1 text-sm font-semibold text-primary-500",children:[jsx(Icon,{icon:"clock",inline:!0}),jsxs("div",{children:[$," min",b>0?" left":""]})]})]})})]}),v!=null&&v.completed?jsx(Icon,{icon:"checkmark",className:"text-2xl text-accent"}):t?jsx(Icon,{icon:"arrowRight",className:classNames("text-accent group-hover:translate-x-1 duration-300 text-display-lg")}):jsx(Icon,{icon:"lock",className:classNames("text-accent duration-300 text-display")})]})]})},LessonCardSkeleton=()=>jsxs("div",{className:"box flex flex-col space-y-2",children:[jsx("div",{className:"skeleton text-lg leading-7 font-medium w-max",children:"Lorem Ipsum Dolor Sit Amet"}),jsx("span",{className:"skeleton font-medium text-sm w-max",children:"Sit amet"})]});function useIncompleteLessons(){const e=useLessons(),{data:t}=useGetLessonStatuses();return reactExports.useMemo(()=>e.filter(r=>{const n=t.find(i=>i.lessonID===r.id);return!(n!=null&&n.completed)}),[e,t])}const MAX_NUM_INCOMPLETE_LESSONS_TO_SHOW=3,EarnPoints=()=>{const e=useIncompleteLessons(),{remainingTiers:t}=useUserTier(),r=Math.min(MAX_NUM_INCOMPLETE_LESSONS_TO_SHOW,t);return jsx(reactExports.Suspense,{fallback:jsx(EarnPointsSkeleton,{}),children:jsxs("div",{className:"flex-1 flex flex-col gap-1 min-h-0 -mt-1",children:[jsx("div",{children:jsx("p",{className:"text-display-xl leading-5",children:"Learn and Earn"})}),e.length===0?jsxs("div",{className:"flex-1 flex flex-col gap-0.5 pt-2",children:[jsx("p",{children:"You've completed every lesson. Nice work!"}),jsx("p",{className:"text-primary-500 leading-5 text-sm",children:"Claim rewards by clicking the button below, or check back later for more opportunities to earn rewards."})]}):jsx("div",{className:"flex flex-col gap-4 overflow-scroll scrollbar-hide pb-8 px-5 pt-2 -mx-5",children:jsxs(CommonErrorBoundary,{children:[jsx(LessonCard,{lesson:e[0],suggested:!0}),e.length>1&&r>1&&jsxs("div",{className:"flex flex-col space-y-2",children:[jsxs("div",{className:"font-medium flex items-center text-sm gap-2",children:[jsx("div",{className:"h-px w-3 bg-accent-100"}),jsx("span",{children:"More lessons"}),jsx("div",{className:"h-px flex-1 bg-accent-100"})]}),jsx("div",{className:"flex flex-col space-y-3",children:e.slice(1,r).map((n,i)=>jsx(LessonCard,{lesson:n,suggested:!1},i))})]})]})})]})})},EarnPointsSkeleton=()=>jsxs("div",{className:"flex-1 space-y-3",children:[jsx("div",{className:"skeleton text-3xl leading-7 w-max",children:"Learn and Earn"}),jsx("div",{className:"skeleton leading-5",children:"Lorem ipsum dolor sit amet"}),jsxs("div",{className:"space-y-3",children:[jsx(LessonCardSkeleton,{}),jsx(LessonCardSkeleton,{})]})]}),HowItWorks=()=>{const{setState:e,goBack:t}=useLessonsContext(),{data:r}=useGetMerchant(),n=reactExports.useMemo(()=>[jsxs("span",{children:[jsxs("strong",{children:["Learn about ",r.title]})," through quick, engaging lessons"]},1),jsxs("span",{children:[jsx("strong",{children:"Claim your discount code"})," once you've finished a lesson"]},2),jsx("span",{children:jsxs("span",{children:[jsx("strong",{children:"The more lessons you complete,"})," the more you'll save!"]})},3)],[r]);return jsxs(Layout$1,{left:jsx(LayoutBack,{onClick:t}),children:[jsxs("div",{className:"flex-1 flex flex-col space-y-6",children:[jsx("p",{className:"text-display-xl",children:"How it works"}),jsx("div",{className:"flex flex-col space-y-6",children:n.map((i,s)=>jsxs("div",{className:"flex space-x-4",children:[jsx("div",{className:"bg-accent-100 text-accent text-display-xs w-10 h-10 flex-shrink-0 rounded-full flex justify-center items-center",children:s+1}),jsx("div",{className:"text-lg",children:i})]},s))})]}),jsx(Button,{variant:"primary",onClick:()=>e({type:"home"}),children:"Got it!"})]})};var isCheckBoxInput=e=>e.type==="checkbox",isDateObject=e=>e instanceof Date,isNullOrUndefined=e=>e==null;const isObjectType=e=>typeof e=="object";var isObject$1=e=>!isNullOrUndefined(e)&&!Array.isArray(e)&&isObjectType(e)&&!isDateObject(e),getEventValue=e=>isObject$1(e)&&e.target?isCheckBoxInput(e.target)?e.target.checked:e.target.value:e,getNodeParentName=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,isNameInFieldArray=(e,t)=>e.has(getNodeParentName(t)),isPlainObject=e=>{const t=e.constructor&&e.constructor.prototype;return isObject$1(t)&&t.hasOwnProperty("isPrototypeOf")},isWeb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cloneObject(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(!(isWeb&&(e instanceof Blob||e instanceof FileList))&&(r||isObject$1(e)))if(t=r?[]:{},!r&&!isPlainObject(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=cloneObject(e[n]));else return e;return t}var compact=e=>Array.isArray(e)?e.filter(Boolean):[],isUndefined=e=>e===void 0,get=(e,t,r)=>{if(!t||!isObject$1(e))return r;const n=compact(t.split(/[,[\].]+?/)).reduce((i,s)=>isNullOrUndefined(i)?i:i[s],e);return isUndefined(n)||n===e?isUndefined(e[t])?r:e[t]:n};const EVENTS={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},VALIDATION_MODE={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},INPUT_VALIDATION_RULES={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},HookFormContext=React.createContext(null),useFormContext=()=>React.useContext(HookFormContext),FormProvider=e=>{const{children:t,...r}=e;return React.createElement(HookFormContext.Provider,{value:r},t)};var getProxyFormState=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(i,s,{get:()=>{const l=s;return t._proxyFormState[l]!==VALIDATION_MODE.all&&(t._proxyFormState[l]=!n||VALIDATION_MODE.all),r&&(r[l]=!0),e[l]}});return i},isEmptyObject=e=>isObject$1(e)&&!Object.keys(e).length,shouldRenderFormState=(e,t,r,n)=>{r(e);const{name:i,...s}=e;return isEmptyObject(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(l=>t[l]===(!n||VALIDATION_MODE.all))},convertToArrayPayload=e=>Array.isArray(e)?e:[e],shouldSubscribeByName=(e,t,r)=>r&&t?e===t:!e||!t||e===t||convertToArrayPayload(e).some(n=>n&&(n.startsWith(t)||t.startsWith(n)));function useSubscribe(e){const t=React.useRef(e);t.current=e,React.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function useFormState(e){const t=useFormContext(),{control:r=t.control,disabled:n,name:i,exact:s}=e||{},[l,d]=React.useState(r._formState),p=React.useRef(!0),m=React.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),v=React.useRef(i);return v.current=i,useSubscribe({disabled:n,next:b=>p.current&&shouldSubscribeByName(v.current,b.name,s)&&shouldRenderFormState(b,m.current,r._updateFormState)&&d({...r._formState,...b}),subject:r._subjects.state}),React.useEffect(()=>(p.current=!0,m.current.isValid&&r._updateValid(!0),()=>{p.current=!1}),[r]),getProxyFormState(l,r,m.current,!1)}var isString=e=>typeof e=="string",generateWatchOutput=(e,t,r,n,i)=>isString(e)?(n&&t.watch.add(e),get(r,e,i)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),get(r,s))):(n&&(t.watchAll=!0),r);function useWatch(e){const t=useFormContext(),{control:r=t.control,name:n,defaultValue:i,disabled:s,exact:l}=e||{},d=React.useRef(n);d.current=n,useSubscribe({disabled:s,subject:r._subjects.values,next:v=>{shouldSubscribeByName(d.current,v.name,l)&&m(cloneObject(generateWatchOutput(d.current,r._names,v.values||r._formValues,!1,i)))}});const[p,m]=React.useState(r._getWatch(n,i));return React.useEffect(()=>r._removeUnmounted()),p}var isKey=e=>/^\w*$/.test(e),stringToPath=e=>compact(e.replace(/["|']|\]/g,"").split(/\.|\[/));function set(e,t,r){let n=-1;const i=isKey(t)?[t]:stringToPath(t),s=i.length,l=s-1;for(;++n{const m=n._options.shouldUnregister||i,v=(b,S)=>{const $=get(n._fields,b);$&&($._f.mount=S)};if(v(r,!0),m){const b=cloneObject(get(n._options.defaultValues,r));set(n._defaultValues,r,b),isUndefined(get(n._formValues,r))&&set(n._formValues,r,b)}return()=>{(s?m&&!n._state.action:m)?n.unregister(r):v(r,!1)}},[r,n,s,i]),{field:{name:r,value:l,onChange:React.useCallback(m=>p.current.onChange({target:{value:getEventValue(m),name:r},type:EVENTS.CHANGE}),[r]),onBlur:React.useCallback(()=>p.current.onBlur({target:{value:get(n._formValues,r),name:r},type:EVENTS.BLUR}),[r,n]),ref:m=>{const v=get(n._fields,r);v&&m&&(v._f.ref={focus:()=>m.focus(),select:()=>m.select(),setCustomValidity:b=>m.setCustomValidity(b),reportValidity:()=>m.reportValidity()})}},formState:d,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!get(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!get(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!get(d.touchedFields,r)},error:{enumerable:!0,get:()=>get(d.errors,r)}})}}const Controller=e=>e.render(useController(e));var appendErrors=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{};const focusFieldBy=(e,t,r)=>{for(const n of r||Object.keys(e)){const i=get(e,n);if(i){const{_f:s,...l}=i;if(s&&t(s.name)){if(s.ref.focus){s.ref.focus();break}else if(s.refs&&s.refs[0].focus){s.refs[0].focus();break}}else isObject$1(l)&&focusFieldBy(l,t)}}};var getValidationModes=e=>({isOnSubmit:!e||e===VALIDATION_MODE.onSubmit,isOnBlur:e===VALIDATION_MODE.onBlur,isOnChange:e===VALIDATION_MODE.onChange,isOnAll:e===VALIDATION_MODE.all,isOnTouch:e===VALIDATION_MODE.onTouched}),isWatched=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length)))),updateFieldArrayRootError=(e,t,r)=>{const n=compact(get(e,r));return set(n,"root",t[r]),set(e,r,n),e},isBoolean=e=>typeof e=="boolean",isFileInput=e=>e.type==="file",isFunction=e=>typeof e=="function",isHTMLElement=e=>{if(!isWeb)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},isMessage=e=>isString(e),isRadioInput=e=>e.type==="radio",isRegex=e=>e instanceof RegExp;const defaultResult={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!isUndefined(e[0].attributes.value)?isUndefined(e[0].value)||e[0].value===""?validResult:{value:e[0].value,isValid:!0}:validResult:defaultResult}return defaultResult};const defaultReturn={isValid:!1,value:null};var getRadioValue=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,defaultReturn):defaultReturn;function getValidateError(e,t,r="validate"){if(isMessage(e)||Array.isArray(e)&&e.every(isMessage)||isBoolean(e)&&!e)return{type:r,message:isMessage(e)?e:"",ref:t}}var getValueAndMessage=e=>isObject$1(e)&&!isRegex(e)?e:{value:e,message:""},validateField=async(e,t,r,n,i)=>{const{ref:s,refs:l,required:d,maxLength:p,minLength:m,min:v,max:b,pattern:S,validate:$,name:N,valueAsNumber:D,mount:P,disabled:F}=e._f,q=get(t,N);if(!P||F)return{};const H=l?l[0]:s,f=re=>{n&&H.reportValidity&&(H.setCustomValidity(isBoolean(re)?"":re||""),H.reportValidity())},w={},g=isRadioInput(s),C=isCheckBoxInput(s),_=g||C,A=(D||isFileInput(s))&&isUndefined(s.value)&&isUndefined(q)||isHTMLElement(s)&&s.value===""||q===""||Array.isArray(q)&&!q.length,k=appendErrors.bind(null,N,r,w),L=(re,K,J,ee=INPUT_VALIDATION_RULES.maxLength,E=INPUT_VALIDATION_RULES.minLength)=>{const Y=re?K:J;w[N]={type:re?ee:E,message:Y,ref:s,...k(re?ee:E,Y)}};if(i?!Array.isArray(q)||!q.length:d&&(!_&&(A||isNullOrUndefined(q))||isBoolean(q)&&!q||C&&!getCheckboxValue(l).isValid||g&&!getRadioValue(l).isValid)){const{value:re,message:K}=isMessage(d)?{value:!!d,message:d}:getValueAndMessage(d);if(re&&(w[N]={type:INPUT_VALIDATION_RULES.required,message:K,ref:H,...k(INPUT_VALIDATION_RULES.required,K)},!r))return f(K),w}if(!A&&(!isNullOrUndefined(v)||!isNullOrUndefined(b))){let re,K;const J=getValueAndMessage(b),ee=getValueAndMessage(v);if(!isNullOrUndefined(q)&&!isNaN(q)){const E=s.valueAsNumber||q&&+q;isNullOrUndefined(J.value)||(re=E>J.value),isNullOrUndefined(ee.value)||(K=Enew Date(new Date().toDateString()+" "+ae),W=s.type=="time",oe=s.type=="week";isString(J.value)&&q&&(re=W?Y(q)>Y(J.value):oe?q>J.value:E>new Date(J.value)),isString(ee.value)&&q&&(K=W?Y(q)+re.value,ee=!isNullOrUndefined(K.value)&&q.length<+K.value;if((J||ee)&&(L(J,re.message,K.message),!r))return f(w[N].message),w}if(S&&!A&&isString(q)){const{value:re,message:K}=getValueAndMessage(S);if(isRegex(re)&&!q.match(re)&&(w[N]={type:INPUT_VALIDATION_RULES.pattern,message:K,ref:s,...k(INPUT_VALIDATION_RULES.pattern,K)},!r))return f(K),w}if($){if(isFunction($)){const re=await $(q,t),K=getValidateError(re,H);if(K&&(w[N]={...K,...k(INPUT_VALIDATION_RULES.validate,K.message)},!r))return f(K.message),w}else if(isObject$1($)){let re={};for(const K in $){if(!isEmptyObject(re)&&!r)break;const J=getValidateError(await $[K](q,t),H,K);J&&(re={...J,...k(K,J.message)},f(J.message),r&&(w[N]=re))}if(!isEmptyObject(re)&&(w[N]={ref:H,...re},!r))return w}}return f(!0),w};function baseGet(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{for(const s of e)s.next&&s.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(s=>s!==i)}}),unsubscribe:()=>{e=[]}}}var isPrimitive=e=>isNullOrUndefined(e)||!isObjectType(e);function deepEqual(e,t){if(isPrimitive(e)||isPrimitive(t))return e===t;if(isDateObject(e)&&isDateObject(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const i of r){const s=e[i];if(!n.includes(i))return!1;if(i!=="ref"){const l=t[i];if(isDateObject(s)&&isDateObject(l)||isObject$1(s)&&isObject$1(l)||Array.isArray(s)&&Array.isArray(l)?!deepEqual(s,l):s!==l)return!1}}return!0}var isMultipleSelect=e=>e.type==="select-multiple",isRadioOrCheckbox=e=>isRadioInput(e)||isCheckBoxInput(e),live=e=>isHTMLElement(e)&&e.isConnected,objectHasFunction=e=>{for(const t in e)if(isFunction(e[t]))return!0;return!1};function markFieldsDirty(e,t={}){const r=Array.isArray(e);if(isObject$1(e)||r)for(const n in e)Array.isArray(e[n])||isObject$1(e[n])&&!objectHasFunction(e[n])?(t[n]=Array.isArray(e[n])?[]:{},markFieldsDirty(e[n],t[n])):isNullOrUndefined(e[n])||(t[n]=!0);return t}function getDirtyFieldsFromDefaultValues(e,t,r){const n=Array.isArray(e);if(isObject$1(e)||n)for(const i in e)Array.isArray(e[i])||isObject$1(e[i])&&!objectHasFunction(e[i])?isUndefined(t)||isPrimitive(r[i])?r[i]=Array.isArray(e[i])?markFieldsDirty(e[i],[]):{...markFieldsDirty(e[i])}:getDirtyFieldsFromDefaultValues(e[i],isNullOrUndefined(t)?{}:t[i],r[i]):r[i]=!deepEqual(e[i],t[i]);return r}var getDirtyFields=(e,t)=>getDirtyFieldsFromDefaultValues(e,t,markFieldsDirty(t)),getFieldValueAs=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>isUndefined(e)?e:t?e===""?NaN:e&&+e:r&&isString(e)?new Date(e):n?n(e):e;function getFieldValue(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return isFileInput(t)?t.files:isRadioInput(t)?getRadioValue(e.refs).value:isMultipleSelect(t)?[...t.selectedOptions].map(({value:r})=>r):isCheckBoxInput(t)?getCheckboxValue(e.refs).value:getFieldValueAs(isUndefined(t.value)?e.ref.value:t.value,e)}var getResolverOptions=(e,t,r,n)=>{const i={};for(const s of e){const l=get(t,s);l&&set(i,s,l._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},getRuleValue=e=>isUndefined(e)?e:isRegex(e)?e.source:isObject$1(e)?isRegex(e.value)?e.value.source:e.value:e,hasValidation=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function schemaErrorLookup(e,t,r){const n=get(e,r);if(n||isKey(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const s=i.join("."),l=get(t,s),d=get(e,s);if(l&&!Array.isArray(l)&&r!==s)return{name:r};if(d&&d.type)return{name:s,error:d};i.pop()}return{name:r}}var skipValidation=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,unsetEmptyArray=(e,t)=>!compact(get(e,t)).length&&unset(e,t);const defaultOptions={mode:VALIDATION_MODE.onSubmit,reValidateMode:VALIDATION_MODE.onChange,shouldFocusError:!0};function createFormControl(e={},t){let r={...defaultOptions,...e},n={submitCount:0,isDirty:!1,isLoading:isFunction(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},i={},s=isObject$1(r.defaultValues)||isObject$1(r.values)?cloneObject(r.defaultValues||r.values)||{}:{},l=r.shouldUnregister?{}:cloneObject(s),d={action:!1,mount:!1,watch:!1},p={mount:new Set,unMount:new Set,array:new Set,watch:new Set},m,v=0;const b={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},S={values:createSubject(),array:createSubject(),state:createSubject()},$=e.resetOptions&&e.resetOptions.keepDirtyValues,N=getValidationModes(r.mode),D=getValidationModes(r.reValidateMode),P=r.criteriaMode===VALIDATION_MODE.all,F=M=>B=>{clearTimeout(v),v=setTimeout(M,B)},q=async M=>{if(b.isValid||M){const B=r.resolver?isEmptyObject((await A()).errors):await L(i,!0);B!==n.isValid&&S.state.next({isValid:B})}},H=M=>b.isValidating&&S.state.next({isValidating:M}),f=(M,B=[],G,ue,le=!0,ie=!0)=>{if(ue&&G){if(d.action=!0,ie&&Array.isArray(get(i,M))){const me=G(get(i,M),ue.argA,ue.argB);le&&set(i,M,me)}if(ie&&Array.isArray(get(n.errors,M))){const me=G(get(n.errors,M),ue.argA,ue.argB);le&&set(n.errors,M,me),unsetEmptyArray(n.errors,M)}if(b.touchedFields&&ie&&Array.isArray(get(n.touchedFields,M))){const me=G(get(n.touchedFields,M),ue.argA,ue.argB);le&&set(n.touchedFields,M,me)}b.dirtyFields&&(n.dirtyFields=getDirtyFields(s,l)),S.state.next({name:M,isDirty:K(M,B),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else set(l,M,B)},w=(M,B)=>{set(n.errors,M,B),S.state.next({errors:n.errors})},g=(M,B,G,ue)=>{const le=get(i,M);if(le){const ie=get(l,M,isUndefined(G)?get(s,M):G);isUndefined(ie)||ue&&ue.defaultChecked||B?set(l,M,B?ie:getFieldValue(le._f)):E(M,ie),d.mount&&q()}},C=(M,B,G,ue,le)=>{let ie=!1,me=!1;const Ne={name:M};if(!G||ue){b.isDirty&&(me=n.isDirty,n.isDirty=Ne.isDirty=K(),ie=me!==Ne.isDirty);const je=deepEqual(get(s,M),B);me=get(n.dirtyFields,M),je?unset(n.dirtyFields,M):set(n.dirtyFields,M,!0),Ne.dirtyFields=n.dirtyFields,ie=ie||b.dirtyFields&&me!==!je}if(G){const je=get(n.touchedFields,M);je||(set(n.touchedFields,M,G),Ne.touchedFields=n.touchedFields,ie=ie||b.touchedFields&&je!==G)}return ie&&le&&S.state.next(Ne),ie?Ne:{}},_=(M,B,G,ue)=>{const le=get(n.errors,M),ie=b.isValid&&isBoolean(B)&&n.isValid!==B;if(e.delayError&&G?(m=F(()=>w(M,G)),m(e.delayError)):(clearTimeout(v),m=null,G?set(n.errors,M,G):unset(n.errors,M)),(G?!deepEqual(le,G):le)||!isEmptyObject(ue)||ie){const me={...ue,...ie&&isBoolean(B)?{isValid:B}:{},errors:n.errors,name:M};n={...n,...me},S.state.next(me)}H(!1)},A=async M=>r.resolver(l,r.context,getResolverOptions(M||p.mount,i,r.criteriaMode,r.shouldUseNativeValidation)),k=async M=>{const{errors:B}=await A();if(M)for(const G of M){const ue=get(B,G);ue?set(n.errors,G,ue):unset(n.errors,G)}else n.errors=B;return B},L=async(M,B,G={valid:!0})=>{for(const ue in M){const le=M[ue];if(le){const{_f:ie,...me}=le;if(ie){const Ne=p.array.has(ie.name),je=await validateField(le,l,P,r.shouldUseNativeValidation&&!B,Ne);if(je[ie.name]&&(G.valid=!1,B))break;!B&&(get(je,ie.name)?Ne?updateFieldArrayRootError(n.errors,je,ie.name):set(n.errors,ie.name,je[ie.name]):unset(n.errors,ie.name))}me&&await L(me,B,G)}}return G.valid},re=()=>{for(const M of p.unMount){const B=get(i,M);B&&(B._f.refs?B._f.refs.every(G=>!live(G)):!live(B._f.ref))&&be(M)}p.unMount=new Set},K=(M,B)=>(M&&B&&set(l,M,B),!deepEqual(O(),s)),J=(M,B,G)=>generateWatchOutput(M,p,{...d.mount?l:isUndefined(B)?s:isString(M)?{[M]:B}:B},G,B),ee=M=>compact(get(d.mount?l:s,M,e.shouldUnregister?get(s,M,[]):[])),E=(M,B,G={})=>{const ue=get(i,M);let le=B;if(ue){const ie=ue._f;ie&&(!ie.disabled&&set(l,M,getFieldValueAs(B,ie)),le=isHTMLElement(ie.ref)&&isNullOrUndefined(B)?"":B,isMultipleSelect(ie.ref)?[...ie.ref.options].forEach(me=>me.selected=le.includes(me.value)):ie.refs?isCheckBoxInput(ie.ref)?ie.refs.length>1?ie.refs.forEach(me=>(!me.defaultChecked||!me.disabled)&&(me.checked=Array.isArray(le)?!!le.find(Ne=>Ne===me.value):le===me.value)):ie.refs[0]&&(ie.refs[0].checked=!!le):ie.refs.forEach(me=>me.checked=me.value===le):isFileInput(ie.ref)?ie.ref.value="":(ie.ref.value=le,ie.ref.type||S.values.next({name:M,values:{...l}})))}(G.shouldDirty||G.shouldTouch)&&C(M,le,G.shouldTouch,G.shouldDirty,!0),G.shouldValidate&&ae(M)},Y=(M,B,G)=>{for(const ue in B){const le=B[ue],ie=`${M}.${ue}`,me=get(i,ie);(p.array.has(M)||!isPrimitive(le)||me&&!me._f)&&!isDateObject(le)?Y(ie,le,G):E(ie,le,G)}},W=(M,B,G={})=>{const ue=get(i,M),le=p.array.has(M),ie=cloneObject(B);set(l,M,ie),le?(S.array.next({name:M,values:{...l}}),(b.isDirty||b.dirtyFields)&&G.shouldDirty&&S.state.next({name:M,dirtyFields:getDirtyFields(s,l),isDirty:K(M,ie)})):ue&&!ue._f&&!isNullOrUndefined(ie)?Y(M,ie,G):E(M,ie,G),isWatched(M,p)&&S.state.next({...n}),S.values.next({name:M,values:{...l}}),!d.mount&&t()},oe=async M=>{const B=M.target;let G=B.name,ue=!0;const le=get(i,G),ie=()=>B.type?getFieldValue(le._f):getEventValue(M);if(le){let me,Ne;const je=ie(),Je=M.type===EVENTS.BLUR||M.type===EVENTS.FOCUS_OUT,at=!hasValidation(le._f)&&!r.resolver&&!get(n.errors,G)&&!le._f.deps||skipValidation(Je,get(n.touchedFields,G),n.isSubmitted,D,N),St=isWatched(G,p,Je);set(l,G,je),Je?(le._f.onBlur&&le._f.onBlur(M),m&&m(0)):le._f.onChange&&le._f.onChange(M);const dt=C(G,je,Je,!1),Bt=!isEmptyObject(dt)||St;if(!Je&&S.values.next({name:G,type:M.type,values:{...l}}),at)return b.isValid&&q(),Bt&&S.state.next({name:G,...St?{}:dt});if(!Je&&St&&S.state.next({...n}),H(!0),r.resolver){const{errors:nt}=await A([G]),Dt=schemaErrorLookup(n.errors,i,G),I=schemaErrorLookup(nt,i,Dt.name||G);me=I.error,G=I.name,Ne=isEmptyObject(nt)}else me=(await validateField(le,l,P,r.shouldUseNativeValidation))[G],ue=isNaN(je)||je===get(l,G,je),ue&&(me?Ne=!1:b.isValid&&(Ne=await L(i,!0)));ue&&(le._f.deps&&ae(le._f.deps),_(G,Ne,me,dt))}},ae=async(M,B={})=>{let G,ue;const le=convertToArrayPayload(M);if(H(!0),r.resolver){const ie=await k(isUndefined(M)?M:le);G=isEmptyObject(ie),ue=M?!le.some(me=>get(ie,me)):G}else M?(ue=(await Promise.all(le.map(async ie=>{const me=get(i,ie);return await L(me&&me._f?{[ie]:me}:me)}))).every(Boolean),!(!ue&&!n.isValid)&&q()):ue=G=await L(i);return S.state.next({...!isString(M)||b.isValid&&G!==n.isValid?{}:{name:M},...r.resolver||!M?{isValid:G}:{},errors:n.errors,isValidating:!1}),B.shouldFocus&&!ue&&focusFieldBy(i,ie=>ie&&get(n.errors,ie),M?le:p.mount),ue},O=M=>{const B={...s,...d.mount?l:{}};return isUndefined(M)?B:isString(M)?get(B,M):M.map(G=>get(B,G))},ne=(M,B)=>({invalid:!!get((B||n).errors,M),isDirty:!!get((B||n).dirtyFields,M),isTouched:!!get((B||n).touchedFields,M),error:get((B||n).errors,M)}),xe=M=>{M&&convertToArrayPayload(M).forEach(B=>unset(n.errors,B)),S.state.next({errors:M?n.errors:{}})},$e=(M,B,G)=>{const ue=(get(i,M,{_f:{}})._f||{}).ref;set(n.errors,M,{...B,ref:ue}),S.state.next({name:M,errors:n.errors,isValid:!1}),G&&G.shouldFocus&&ue&&ue.focus&&ue.focus()},Ee=(M,B)=>isFunction(M)?S.values.subscribe({next:G=>M(J(void 0,B),G)}):J(M,B,!0),be=(M,B={})=>{for(const G of M?convertToArrayPayload(M):p.mount)p.mount.delete(G),p.array.delete(G),B.keepValue||(unset(i,G),unset(l,G)),!B.keepError&&unset(n.errors,G),!B.keepDirty&&unset(n.dirtyFields,G),!B.keepTouched&&unset(n.touchedFields,G),!r.shouldUnregister&&!B.keepDefaultValue&&unset(s,G);S.values.next({values:{...l}}),S.state.next({...n,...B.keepDirty?{isDirty:K()}:{}}),!B.keepIsValid&&q()},ge=(M,B={})=>{let G=get(i,M);const ue=isBoolean(B.disabled);return set(i,M,{...G||{},_f:{...G&&G._f?G._f:{ref:{name:M}},name:M,mount:!0,...B}}),p.mount.add(M),isUndefined(B.value)||set(l,M,B.value),G?ue&&set(l,M,B.disabled?void 0:get(l,M,getFieldValue(G._f))):g(M,!0,B.value),{...ue?{disabled:B.disabled}:{},...r.progressive?{required:!!B.required,min:getRuleValue(B.min),max:getRuleValue(B.max),minLength:getRuleValue(B.minLength),maxLength:getRuleValue(B.maxLength),pattern:getRuleValue(B.pattern)}:{},name:M,onChange:oe,onBlur:oe,ref:le=>{if(le){ge(M,B),G=get(i,M);const ie=isUndefined(le.value)&&le.querySelectorAll&&le.querySelectorAll("input,select,textarea")[0]||le,me=isRadioOrCheckbox(ie),Ne=G._f.refs||[];if(me?Ne.find(je=>je===ie):ie===G._f.ref)return;set(i,M,{_f:{...G._f,...me?{refs:[...Ne.filter(live),ie,...Array.isArray(get(s,M))?[{}]:[]],ref:{type:ie.type,name:M}}:{ref:ie}}}),g(M,!1,void 0,ie)}else G=get(i,M,{}),G._f&&(G._f.mount=!1),(r.shouldUnregister||B.shouldUnregister)&&!(isNameInFieldArray(p.array,M)&&d.action)&&p.unMount.add(M)}}},ve=()=>r.shouldFocusError&&focusFieldBy(i,M=>M&&get(n.errors,M),p.mount),Ie=(M,B)=>async G=>{G&&(G.preventDefault&&G.preventDefault(),G.persist&&G.persist());let ue=cloneObject(l);if(S.state.next({isSubmitting:!0}),r.resolver){const{errors:le,values:ie}=await A();n.errors=le,ue=ie}else await L(i);unset(n.errors,"root"),isEmptyObject(n.errors)?(S.state.next({errors:{}}),await M(ue,G)):(B&&await B({...n.errors},G),ve(),setTimeout(ve)),S.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(n.errors),submitCount:n.submitCount+1,errors:n.errors})},De=(M,B={})=>{get(i,M)&&(isUndefined(B.defaultValue)?W(M,get(s,M)):(W(M,B.defaultValue),set(s,M,B.defaultValue)),B.keepTouched||unset(n.touchedFields,M),B.keepDirty||(unset(n.dirtyFields,M),n.isDirty=B.defaultValue?K(M,get(s,M)):K()),B.keepError||(unset(n.errors,M),b.isValid&&q()),S.state.next({...n}))},Ve=(M,B={})=>{const G=M||s,ue=cloneObject(G),le=M&&!isEmptyObject(M)?ue:s;if(B.keepDefaultValues||(s=G),!B.keepValues){if(B.keepDirtyValues||$)for(const ie of p.mount)get(n.dirtyFields,ie)?set(le,ie,get(l,ie)):W(ie,get(le,ie));else{if(isWeb&&isUndefined(M))for(const ie of p.mount){const me=get(i,ie);if(me&&me._f){const Ne=Array.isArray(me._f.refs)?me._f.refs[0]:me._f.ref;if(isHTMLElement(Ne)){const je=Ne.closest("form");if(je){je.reset();break}}}}i={}}l=e.shouldUnregister?B.keepDefaultValues?cloneObject(s):{}:cloneObject(le),S.array.next({values:{...le}}),S.values.next({values:{...le}})}p={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!d.mount&&t(),d.mount=!b.isValid||!!B.keepIsValid,d.watch=!!e.shouldUnregister,S.state.next({submitCount:B.keepSubmitCount?n.submitCount:0,isDirty:B.keepDirty?n.isDirty:!!(B.keepDefaultValues&&!deepEqual(M,s)),isSubmitted:B.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:B.keepDirtyValues?n.dirtyFields:B.keepDefaultValues&&M?getDirtyFields(s,M):{},touchedFields:B.keepTouched?n.touchedFields:{},errors:B.keepErrors?n.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},Xe=(M,B)=>Ve(isFunction(M)?M(l):M,B);return{control:{register:ge,unregister:be,getFieldState:ne,handleSubmit:Ie,setError:$e,_executeSchema:A,_getWatch:J,_getDirty:K,_updateValid:q,_removeUnmounted:re,_updateFieldArray:f,_getFieldArray:ee,_reset:Ve,_resetDefaultValues:()=>isFunction(r.defaultValues)&&r.defaultValues().then(M=>{Xe(M,r.resetOptions),S.state.next({isLoading:!1})}),_updateFormState:M=>{n={...n,...M}},_subjects:S,_proxyFormState:b,get _fields(){return i},get _formValues(){return l},get _state(){return d},set _state(M){d=M},get _defaultValues(){return s},get _names(){return p},set _names(M){p=M},get _formState(){return n},set _formState(M){n=M},get _options(){return r},set _options(M){r={...r,...M}}},trigger:ae,register:ge,handleSubmit:Ie,watch:Ee,setValue:W,getValues:O,reset:Xe,resetField:De,clearErrors:xe,unregister:be,setError:$e,setFocus:(M,B={})=>{const G=get(i,M),ue=G&&G._f;if(ue){const le=ue.refs?ue.refs[0]:ue.ref;le.focus&&(le.focus(),B.shouldSelect&&le.select())}},getFieldState:ne}}function useForm(e={}){const t=React.useRef(),r=React.useRef(),[n,i]=React.useState({isDirty:!1,isValidating:!1,isLoading:isFunction(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:isFunction(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...createFormControl(e,()=>i(l=>({...l}))),formState:n});const s=t.current.control;return s._options=e,useSubscribe({subject:s._subjects.state,next:l=>{shouldRenderFormState(l,s._proxyFormState,s._updateFormState,!0)&&i({...s._formState})}}),React.useEffect(()=>{e.values&&!deepEqual(e.values,r.current)?(s._reset(e.values,s._options.resetOptions),r.current=e.values):s._resetDefaultValues()},[e.values,s]),React.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=getProxyFormState(n,s),t.current}const{Provider:EducationSignUpSettingsProvider,useContext:useEducationSignUpSettings,useOptionalContext:useOptionalEducationSignUpSettings}=createContextWithoutDefault("education-sign-up-settings");var __spreadArray=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ReactNativeInfo:typeof navigator<"u"?parseUserAgent(navigator.userAgent):getNodeVersion()}function matchUserAgent(e){return e!==""&&userAgentRules.reduce(function(t,r){var n=r[0],i=r[1];if(t)return t;var s=i.exec(e);return!!s&&[n,s]},!1)}function parseUserAgent(e){var t=matchUserAgent(e);if(!t)return null;var r=t[0],n=t[1];if(r==="searchbot")return new BotInfo;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length254)return!1;var r=e.test(t);if(!r)return!1;var n=t.split("@");if(n[0].length>64)return!1;var i=n[1].split(".");return!i.some(function(s){return s.length>63})},emailValidator}var emailValidatorExports=requireEmailValidator();const metadata$1={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|7(?:[013-57-9]\\d|2[0-8]))\\d|3(?:(?:[0-3589]\\d|6[1-9]|7[0-35-9])\\d|4(?:[0-578]\\d|90)))\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|3\\d\\d)|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|[24-689])\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|33|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|91"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-389]|94[0-4])\\d{5}|4(?:[0-36]\\d|4[047-9]|5[0-25-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|31)"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-35])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:[56]94\\d|7093)\\d{5}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","(?:[2-489]\\d|55)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}",[6,7,8,9,10,11]],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[259]\\d{6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[0135-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[245]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-467]|5[0-3]|8[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","(?:596\\d|7091)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","38\\d{6}|[78]\\d{9,13}|(?:20|9\\d)\\d{8}",[8,10,11,12,13,14],[["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["3"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|8\\d\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[16]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-5]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|7[67]|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","[0-57-9]\\d{8}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[468]))\\d{4}|(?:2742|305[3-9]|472[247-9]|505[2-57-9]|983[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[0135-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["305209\\d{4}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[6,7,8,9,10,11,12,13],[["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|63|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};var propTypes={exports:{}},ReactPropTypesSecret_1,hasRequiredReactPropTypesSecret;function requireReactPropTypesSecret(){if(hasRequiredReactPropTypesSecret)return ReactPropTypesSecret_1;hasRequiredReactPropTypesSecret=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ReactPropTypesSecret_1=e,ReactPropTypesSecret_1}var factoryWithThrowingShims,hasRequiredFactoryWithThrowingShims;function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var e=requireReactPropTypesSecret();function t(){}function r(){}return r.resetWarningCache=t,factoryWithThrowingShims=function(){function n(l,d,p,m,v,b){if(b!==e){var S=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 S.name="Invariant Violation",S}}n.isRequired=n;function i(){return n}var s={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:t};return s.PropTypes=s,s},factoryWithThrowingShims}var hasRequiredPropTypes;function requirePropTypes(){return hasRequiredPropTypes||(hasRequiredPropTypes=1,propTypes.exports=requireFactoryWithThrowingShims()()),propTypes.exports}var propTypesExports=requirePropTypes();const PropTypes=getDefaultExportFromCjs(propTypesExports);function edit(e,t,r){switch(r){case"Backspace":t>0&&(e=e.slice(0,t-1)+e.slice(t),t--);break;case"Delete":e=e.slice(0,t)+e.slice(t+1);break}return{value:e,caret:t}}function parse$1(e,t,r){for(var n={},i="",s=0,l=0;ll&&(s=i.length))),l++}t===void 0&&(s=i.length);var p={value:i,caret:s};return p}function _createForOfIteratorHelperLoose$c(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray$f(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$f(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$f(e,t)}}function _arrayLikeToArray$f(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:"x",n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:" ",i=e.length,s=count_occurences("(",e),l=count_occurences(")",e),d=s-l;d>0&&i=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$e(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$e(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$e(e,t)}}function _arrayLikeToArray$e(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:"x",r=arguments.length>2?arguments[2]:void 0;if(!e)return function(i){return{text:i}};var n=count_occurences(t,e);return function(i){if(!i)return{text:"",template:e};for(var s=0,l="",d=_createForOfIteratorHelperLoose$b(e.split("")),p;!(p=d()).done;){var m=p.value;if(m!==t){l+=m;continue}if(l+=i[s],s++,s===i.length&&i.length=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$8(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function Input$1(e,t){var r=e.value,n=e.parse,i=e.format,s=e.inputComponent,l=e.onChange,d=e.onKeyDown,p=_objectWithoutProperties$8(e,_excluded$8),m=reactExports.useRef(),v=reactExports.useCallback(function($){m.current=$,t&&(typeof t=="function"?t($):t.current=$)},[t]),b=reactExports.useCallback(function($){return onChange($,m.current,n,i,l)},[m,n,i,l]),S=reactExports.useCallback(function($){if(d&&d($),!$.defaultPrevented)return onKeyDown($,m.current,n,i,l)},[m,n,i,l,d]);return jsx(s,{...p,ref:v,value:i(isEmptyValue(r)?"":r).text,onKeyDown:S,onChange:b})}Input$1=React.forwardRef(Input$1),Input$1.propTypes={parse:PropTypes.func.isRequired,format:PropTypes.func.isRequired,inputComponent:PropTypes.elementType.isRequired,type:PropTypes.string.isRequired,value:PropTypes.string,onChange:PropTypes.func.isRequired,onKeyDown:PropTypes.func,onCut:PropTypes.func,onPaste:PropTypes.func},Input$1.defaultProps={inputComponent:"input",type:"text"};function isEmptyValue(e){return e==null}function _typeof$3(e){"@babel/helpers - typeof";return _typeof$3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$3(e)}function _createClass$9(e,t,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function _classCallCheck$9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits$1(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf$1(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct$1();return function(){var n=_getPrototypeOf$1(e),i;if(t){var s=_getPrototypeOf$1(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return _possibleConstructorReturn$1(this,i)}}function _possibleConstructorReturn$1(e,t){if(t&&(_typeof$3(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(e)}function _assertThisInitialized$1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _wrapNativeSuper(e){var t=typeof Map=="function"?new Map:void 0;return _wrapNativeSuper=function(n){if(n===null||!_isNativeFunction(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return _construct(n,arguments,_getPrototypeOf$1(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf$1(i,n)},_wrapNativeSuper(e)}function _construct(e,t,r){return _isNativeReflectConstruct$1()?_construct=Reflect.construct:_construct=function(i,s,l){var d=[null];d.push.apply(d,s);var p=Function.bind.apply(i,d),m=new p;return l&&_setPrototypeOf$1(m,l.prototype),m},_construct.apply(null,arguments)}function _isNativeReflectConstruct$1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf$1(e,t){return _setPrototypeOf$1=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},_setPrototypeOf$1(e,t)}function _getPrototypeOf$1(e){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},_getPrototypeOf$1(e)}var ParseError=function(e){_inherits$1(r,e);var t=_createSuper(r);function r(n){var i;return _classCallCheck$9(this,r),i=t.call(this,n),Object.setPrototypeOf(_assertThisInitialized$1(i),r.prototype),i.name=i.constructor.name,i}return _createClass$9(r)}(_wrapNativeSuper(Error)),MIN_LENGTH_FOR_NSN=2,MAX_LENGTH_FOR_NSN=17,MAX_LENGTH_COUNTRY_CODE=3,VALID_DIGITS="0-90-9٠-٩۰-۹",DASHES="-‐-―−ー-",SLASHES="//",DOTS="..",WHITESPACE="  ­​⁠ ",BRACKETS="()()[]\\[\\]",TILDES="~⁓∼~",VALID_PUNCTUATION="".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES),PLUS_CHARS="++";function compare(e,t){e=e.split("-"),t=t.split("-");for(var r=e[0].split("."),n=t[0].split("."),i=0;i<3;i++){var s=Number(r[i]),l=Number(n[i]);if(s>l)return 1;if(l>s)return-1;if(!isNaN(s)&&isNaN(l))return 1;if(isNaN(s)&&!isNaN(l))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]=MIN_LENGTH_FOR_NSN&&VALID_PHONE_NUMBER_PATTERN.test(e)}function isViablePhoneNumberStart(e){return VALID_PHONE_NUMBER_START_REG_EXP.test(e)}var EXTN_PATTERN=new RegExp("(?:"+createExtensionPattern()+")$","i");function extractExtension(e){var t=e.search(EXTN_PATTERN);if(t<0)return{};for(var r=e.slice(0,t),n=e.match(EXTN_PATTERN),i=1;i=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$d(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$d(e,t)}}function _arrayLikeToArray$d(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$c(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$c(e,t)}}function _arrayLikeToArray$c(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);rs?"TOO_SHORT":i[i.length-1]=0?"IS_POSSIBLE":"INVALID_LENGTH"}function isPossiblePhoneNumber(e,t,r){if(t===void 0&&(t={}),r=new Metadata(r),t.v2){if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!r.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));r.country(e.country)}else{if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}}if(r.possibleLengths())return isPossibleNumber(e.phone||e.nationalNumber,r);if(e.countryCallingCode&&r.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function isPossibleNumber(e,t){switch(checkNumberLength(e,t)){case"IS_POSSIBLE":return!0;default:return!1}}function matchesEntirely(e,t){return e=e||"",new RegExp("^(?:"+t+")$").test(e)}function _createForOfIteratorHelperLoose$8(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray$b(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$b(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$b(e,t)}}function _arrayLikeToArray$b(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0}function applyInternationalSeparatorStyle(e){return e.replace(new RegExp("[".concat(VALID_PUNCTUATION,"]+"),"g")," ").trim()}var FIRST_GROUP_PATTERN=/(\$\d)/;function formatNationalNumberUsingFormat(e,t,r){var n=r.useInternationalFormat,i=r.withNationalPrefix;r.carrierCode,r.metadata;var s=e.replace(new RegExp(t.pattern()),n?t.internationalFormat():i&&t.nationalPrefixFormattingRule()?t.format().replace(FIRST_GROUP_PATTERN,t.nationalPrefixFormattingRule()):t.format());return n?applyInternationalSeparatorStyle(s):s}var SINGLE_IDD_PREFIX_REG_EXP=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function getIddPrefix(e,t,r){var n=new Metadata(r);if(n.selectNumberingPlan(e,t),n.defaultIDDPrefix())return n.defaultIDDPrefix();if(SINGLE_IDD_PREFIX_REG_EXP.test(n.IDDPrefix()))return n.IDDPrefix()}function formatRFC3966(e){var t=e.number,r=e.ext;if(!t)return"";if(t[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(r?";ext="+r:"")}function _createForOfIteratorHelperLoose$7(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray$a(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$a(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$a(e,t)}}function _arrayLikeToArray$a(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0){var s=i.leadingDigitsPatterns()[i.leadingDigitsPatterns().length-1];if(t.search(s)!==0)continue}if(matchesEntirely(t,i.pattern()))return i}}function addExtension(e,t,r,n){return t?n(e,t,r):e}function formatIDD(e,t,r,n,i){var s=getCountryCallingCode(n,i.metadata);if(s===r){var l=formatNationalNumber$1(e,t,"NATIONAL",i);return r==="1"?r+" "+l:l}var d=getIddPrefix(n,void 0,i.metadata);if(d)return"".concat(d," ").concat(r," ").concat(formatNationalNumber$1(e,null,"INTERNATIONAL",i))}function ownKeys$6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _objectSpread$6(e){for(var t=1;t0&&l[1]==="0"))return e}}}function extractNationalNumberFromPossiblyIncompleteNumber(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var r=new RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(e);if(n){var i,s,l=n.length-1,d=l>0&&n[l];if(t.nationalPrefixTransformRule()&&d)i=e.replace(r,t.nationalPrefixTransformRule()),l>1&&(s=n[1]);else{var p=n[0];i=e.slice(p.length),d&&(s=n[1])}var m;if(d){var v=e.indexOf(n[1]),b=e.slice(0,v);b===t.numberingPlan.nationalPrefix()&&(m=t.numberingPlan.nationalPrefix())}else m=n[0];return{nationalNumber:i,nationalPrefix:m,carrierCode:s}}}return{nationalNumber:e}}function extractNationalNumber(e,t){var r=extractNationalNumberFromPossiblyIncompleteNumber(e,t),n=r.carrierCode,i=r.nationalNumber;if(i!==e){if(!shouldHaveExtractedNationalPrefix(e,i,t))return{nationalNumber:e};if(t.possibleLengths()&&!isPossibleIncompleteNationalNumber(i,t))return{nationalNumber:e}}return{nationalNumber:i,carrierCode:n}}function shouldHaveExtractedNationalPrefix(e,t,r){return!(matchesEntirely(e,r.nationalNumberPattern())&&!matchesEntirely(t,r.nationalNumberPattern()))}function isPossibleIncompleteNationalNumber(e,t){switch(checkNumberLength(e,t)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(e,t,r,n){var i=t?getCountryCallingCode(t,n):r;if(e.indexOf(i)===0){n=new Metadata(n),n.selectNumberingPlan(t,r);var s=e.slice(i.length),l=extractNationalNumber(s,n),d=l.nationalNumber,p=extractNationalNumber(e,n),m=p.nationalNumber;if(!matchesEntirely(m,n.nationalNumberPattern())&&matchesEntirely(d,n.nationalNumberPattern())||checkNumberLength(m,n)==="TOO_LONG")return{countryCallingCode:i,number:s}}return{number:e}}function extractCountryCallingCode(e,t,r,n){if(!e)return{};var i;if(e[0]!=="+"){var s=stripIddPrefix(e,t,r,n);if(s&&s!==e)i=!0,e="+"+s;else{if(t||r){var l=extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(e,t,r,n),d=l.countryCallingCode,p=l.number;if(d)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:d,number:p}}return{number:e}}}if(e[1]==="0")return{};n=new Metadata(n);for(var m=2;m-1<=MAX_LENGTH_COUNTRY_CODE&&m<=e.length;){var v=e.slice(1,m);if(n.hasCallingCode(v))return n.selectNumberingPlan(v),{countryCallingCodeSource:i?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:v,number:e.slice(m)};m++}return{}}function _createForOfIteratorHelperLoose$6(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray$9(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$9(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$9(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$9(e,t)}}function _arrayLikeToArray$9(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length)return"";var n=e.indexOf(";",r);return n>=0?e.substring(r,n):e.substring(r)}function isPhoneContextValid(e){return e===null?!0:e.length===0?!1:RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_.test(e)||RFC3966_DOMAINNAME_PATTERN_.test(e)}function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(e,t){var r=t.extractFormattedPhoneNumber,n=extractPhoneContext(e);if(!isPhoneContextValid(n))throw new ParseError("NOT_A_NUMBER");var i;if(n===null)i=r(e)||"";else{i="",n.charAt(0)===PLUS_SIGN&&(i+=n);var s=e.indexOf(RFC3966_PREFIX_),l;s>=0?l=s+RFC3966_PREFIX_.length:l=0;var d=e.indexOf(RFC3966_PHONE_CONTEXT_);i+=e.substring(l,d)}var p=i.indexOf(RFC3966_ISDN_SUBADDRESS_);if(p>0&&(i=i.substring(0,p)),i!=="")return i}var MAX_INPUT_STRING_LENGTH=250,PHONE_NUMBER_START_PATTERN=new RegExp("["+PLUS_CHARS+VALID_DIGITS+"]"),AFTER_PHONE_NUMBER_END_PATTERN=new RegExp("[^"+VALID_DIGITS+"#]+$");function parse(e,t,r){if(t=t||{},r=new Metadata(r),t.defaultCountry&&!r.hasCountry(t.defaultCountry))throw t.v2?new ParseError("INVALID_COUNTRY"):new Error("Unknown country: ".concat(t.defaultCountry));var n=parseInput(e,t.v2,t.extract),i=n.number,s=n.ext,l=n.error;if(!i){if(t.v2)throw l==="TOO_SHORT"?new ParseError("TOO_SHORT"):new ParseError("NOT_A_NUMBER");return{}}var d=parsePhoneNumber$3(i,t.defaultCountry,t.defaultCallingCode,r),p=d.country,m=d.nationalNumber,v=d.countryCallingCode,b=d.countryCallingCodeSource,S=d.carrierCode;if(!r.hasSelectedNumberingPlan()){if(t.v2)throw new ParseError("INVALID_COUNTRY");return{}}if(!m||m.lengthMAX_LENGTH_FOR_NSN){if(t.v2)throw new ParseError("TOO_LONG");return{}}if(t.v2){var $=new PhoneNumber(v,m,r.metadata);return p&&($.country=p),S&&($.carrierCode=S),s&&($.ext=s),$.__countryCallingCodeSource=b,$}var N=(t.extended?r.hasSelectedNumberingPlan():p)?matchesEntirely(m,r.nationalNumberPattern()):!1;return t.extended?{country:p,countryCallingCode:v,carrierCode:S,valid:N,possible:N?!0:!!(t.extended===!0&&r.possibleLengths()&&isPossibleNumber(m,r)),phone:m,ext:s}:N?result(p,m,s):{}}function _extractFormattedPhoneNumber(e,t,r){if(e){if(e.length>MAX_INPUT_STRING_LENGTH){if(r)throw new ParseError("TOO_LONG");return}if(t===!1)return e;var n=e.search(PHONE_NUMBER_START_PATTERN);if(!(n<0))return e.slice(n).replace(AFTER_PHONE_NUMBER_END_PATTERN,"")}}function parseInput(e,t,r){var n=extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(e,{extractFormattedPhoneNumber:function(l){return _extractFormattedPhoneNumber(l,r,t)}});if(!n)return{};if(!isViablePhoneNumber(n))return isViablePhoneNumberStart(n)?{error:"TOO_SHORT"}:{};var i=extractExtension(n);return i.ext?i:{number:n}}function result(e,t,r){var n={country:e,phone:t};return r&&(n.ext=r),n}function parsePhoneNumber$3(e,t,r,n){var i=extractCountryCallingCode(parseIncompletePhoneNumber(e),t,r,n.metadata),s=i.countryCallingCodeSource,l=i.countryCallingCode,d=i.number,p;if(l)n.selectNumberingPlan(l);else if(d&&(t||r))n.selectNumberingPlan(t,r),t&&(p=t),l=r||getCountryCallingCode(t,n.metadata);else return{};if(!d)return{countryCallingCodeSource:s,countryCallingCode:l};var m=extractNationalNumber(parseIncompletePhoneNumber(d),n),v=m.nationalNumber,b=m.carrierCode,S=getCountryByCallingCode(l,{nationalNumber:v,defaultCountry:t,metadata:n});return S&&(p=S,S==="001"||n.country(p)),{country:p,countryCallingCode:l,countryCallingCodeSource:s,nationalNumber:v,carrierCode:b}}function ownKeys$5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _objectSpread$5(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$7(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$7(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$7(e,t)}}function _arrayLikeToArray$7(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1;)t&1&&(r+=e),t>>=1,e+=e;return r+e}function cutAndStripNonPairedParens(e,t){return e[t]===")"&&t++,stripNonPairedParens(e.slice(0,t))}function stripNonPairedParens(e){for(var t=[],r=0;r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$6(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$6(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$6(e,t)}}function _arrayLikeToArray$6(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:{},i=n.allowOverflow;if(!r)throw new Error("String is required");var s=_match(r.split(""),this.matchTree,!0);if(s&&s.match&&delete s.matchedChars,!(s&&s.overflow&&!i))return s}}]),e}();function _match(e,t,r){if(typeof t=="string"){var n=e.join("");return t.indexOf(n)===0?e.length===t.length?{match:!0,matchedChars:e}:{partialMatch:!0}:n.indexOf(t)===0?r&&e.length>t.length?{overflow:!0}:{match:!0,matchedChars:e.slice(0,t.length)}:void 0}if(Array.isArray(t)){for(var i=e.slice(),s=0;s=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$5(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$5(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$5(e,t)}}function _arrayLikeToArray$5(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)){var i=this.getTemplateForFormat(r,n);if(i)return this.setNationalNumberTemplate(i,n),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(r){return this.isNANP||r&&r.nationalPrefixFormattingRule()&&NATIONAL_PREFIX_SEPARATORS_PATTERN.test(r.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(r,n){var i=r.IDDPrefix,s=r.missingPlus;return i?n&&n.spacing===!1?i:i+" ":s?"":"+"}},{key:"getTemplate",value:function(r){if(this.template){for(var n=-1,i=0,s=r.international?this.getInternationalPrefixBeforeCountryCallingCode(r,{spacing:!1}):"";im.length)){var v=new RegExp("^"+p+"$"),b=i.replace(/\d/g,DUMMY_DIGIT);v.test(b)&&(m=b);var S=this.getFormatFormat(r,s),$;if(this.shouldTryNationalPrefixFormattingRule(r,{international:s,nationalPrefix:l})){var N=S.replace(FIRST_GROUP_PATTERN,r.nationalPrefixFormattingRule());if(parseDigits(r.nationalPrefixFormattingRule())===(l||"")+parseDigits("$1")&&(S=N,$=!0,l))for(var D=l.length;D>0;)S=S.replace(/\d/,DIGIT_PLACEHOLDER),D--}var P=m.replace(new RegExp(p),S).replace(new RegExp(DUMMY_DIGIT,"g"),DIGIT_PLACEHOLDER);return $||(d?P=repeat$1(DIGIT_PLACEHOLDER,d.length)+" "+P:l&&(P=repeat$1(DIGIT_PLACEHOLDER,l.length)+this.getSeparatorAfterNationalPrefix(r)+P)),s&&(P=applyInternationalSeparatorStyle(P)),P}}},{key:"formatNextNationalNumberDigits",value:function(r){var n=populateTemplateWithDigits(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,r);if(!n){this.resetFormat();return}return this.populatedNationalNumberTemplate=n[0],this.populatedNationalNumberTemplatePosition=n[1],cutAndStripNonPairedParens(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(r,n){var i=n.international,s=n.nationalPrefix;if(r.nationalPrefixFormattingRule()){var l=r.usesNationalPrefix();if(l&&s||!l&&!i)return!0}}}]),e}();function _slicedToArray$1(e,t){return _arrayWithHoles$1(e)||_iterableToArrayLimit$1(e,t)||_unsupportedIterableToArray$4(e,t)||_nonIterableRest$1()}function _nonIterableRest$1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$4(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$4(e,t)}}function _arrayLikeToArray$4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=3;if(n.appendDigits(r),s&&this.extractIddPrefix(n),this.isWaitingForCountryCallingCode(n)){if(!this.extractCountryCallingCode(n))return}else n.appendNationalSignificantNumberDigits(r);n.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(n.getNationalDigits(),function(l){return n.update(l)})}},{key:"isWaitingForCountryCallingCode",value:function(r){var n=r.international,i=r.callingCode;return n&&!i}},{key:"extractCountryCallingCode",value:function(r){var n=extractCountryCallingCode("+"+r.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=n.countryCallingCode,s=n.number;if(i)return r.setCallingCode(i),r.update({nationalSignificantNumber:s}),!0}},{key:"reset",value:function(r){if(r){this.hasSelectedNumberingPlan=!0;var n=r._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=n&&COMPLEX_NATIONAL_PREFIX.test(n)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(r,n){if(this.hasSelectedNumberingPlan){var i=extractNationalNumberFromPossiblyIncompleteNumber(r,this.metadata),s=i.nationalPrefix,l=i.nationalNumber,d=i.carrierCode;if(l!==r)return this.onExtractedNationalNumber(s,d,l,r,n),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(r,n,i){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(r,i);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var s=extractNationalNumberFromPossiblyIncompleteNumber(r,this.metadata),l=s.nationalPrefix,d=s.nationalNumber,p=s.carrierCode;if(d!==n)return this.onExtractedNationalNumber(l,p,d,r,i),!0}}},{key:"onExtractedNationalNumber",value:function(r,n,i,s,l){var d,p,m=s.lastIndexOf(i);if(m>=0&&m===s.length-i.length){p=!0;var v=s.slice(0,m);v!==r&&(d=v)}l({nationalPrefix:r,carrierCode:n,nationalSignificantNumber:i,nationalSignificantNumberMatchesInput:p,complexPrefixBeforeNationalSignificantNumber:d}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(r){if(this.extractAnotherNationalSignificantNumber(r.getNationalDigits(),r.nationalSignificantNumber,function(n){return r.update(n)}))return!0;if(this.extractIddPrefix(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0;if(this.fixMissingPlus(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0}},{key:"extractIddPrefix",value:function(r){var n=r.international,i=r.IDDPrefix,s=r.digits;if(r.nationalSignificantNumber,!(n||i)){var l=stripIddPrefix(s,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(l!==void 0&&l!==s)return r.update({IDDPrefix:s.slice(0,s.length-l.length)}),this.startInternationalNumber(r,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(r){if(!r.international){var n=extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(r.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=n.countryCallingCode;if(n.number,i)return r.update({missingPlus:!0}),this.startInternationalNumber(r,{country:r.country,callingCode:i}),!0}}},{key:"startInternationalNumber",value:function(r,n){var i=n.country,s=n.callingCode;r.startInternationalNumber(i,s),r.nationalSignificantNumber&&(r.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(r){this.extractCountryCallingCode(r)&&this.extractNationalSignificantNumber(r.getNationalDigits(),function(n){return r.update(n)})}}]),e}();function extractFormattedPhoneNumber(e){var t=e.search(VALID_FORMATTED_PHONE_NUMBER_PART);if(!(t<0)){e=e.slice(t);var r;return e[0]==="+"&&(r=!0,e=e.slice(1)),e=e.replace(AFTER_PHONE_NUMBER_DIGITS_END_PATTERN,""),r&&(e="+"+e),e}}function _extractFormattedDigitsAndPlus(e){var t=extractFormattedPhoneNumber(e)||"";return t[0]==="+"?[t.slice(1),!0]:[t]}function extractFormattedDigitsAndPlus(e){var t=_extractFormattedDigitsAndPlus(e),r=_slicedToArray$1(t,2),n=r[0],i=r[1];return VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN.test(n)||(n=""),[n,i]}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray$3(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$3(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$3(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$3(e,t)}}function _arrayLikeToArray$3(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1}},{key:"determineTheCountry",value:function(){this.state.setCountry(getCountryByCallingCode(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,defaultCountry:this.defaultCountry,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var r=this.state,n=r.digits,i=r.callingCode,s=r.country,l=r.nationalSignificantNumber;if(n){if(this.isInternational())return i?"+"+i+l:"+"+n;if(s||i){var d=s?this.metadata.countryCallingCode():i;return"+"+d+l}}}},{key:"getNumber",value:function(){var r=this.state,n=r.nationalSignificantNumber,i=r.carrierCode,s=r.callingCode,l=this._getCountry();if(n&&!(!l&&!s)){if(l&&l===this.defaultCountry){var d=new Metadata(this.metadata.metadata);d.selectNumberingPlan(l);var p=d.numberingPlan.callingCode(),m=this.metadata.getCountryCodesForCallingCode(p);if(m.length>1){var v=getCountryByNationalNumber(n,{countries:m,defaultCountry:this.defaultCountry,metadata:this.metadata.metadata});v&&(l=v)}}var b=new PhoneNumber(l||s,n,this.metadata.metadata);return i&&(b.carrierCode=i),b}}},{key:"isPossible",value:function(){var r=this.getNumber();return r?r.isPossible():!1}},{key:"isValid",value:function(){var r=this.getNumber();return r?r.isValid():!1}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}]),e}();function getCountries(e){return new Metadata(e).getCountries()}function formatIncompletePhoneNumber(e,t,r){return r||(r=t,t=void 0),new AsYouType(t,r).input(e)}function getInputValuePrefix(e){var t=e.country,r=e.international,n=e.withCountryCallingCode,i=e.metadata;return t&&r&&!n?"+".concat(getCountryCallingCode(t,i)):""}function removeInputValuePrefix(e,t){return t&&(e=e.slice(t.length),e[0]===" "&&(e=e.slice(1))),e}function parsePhoneNumberCharacter_(e,t,r){if(!(r&&r.ignoreRest)){var n=function(s){if(r)switch(s){case"end":r.ignoreRest=!0;break}};return parsePhoneNumberCharacter(e,t,n)}}function useInputKeyDownHandler(e){var t=e.onKeyDown,r=e.international;return reactExports.useCallback(function(n){if(n.keyCode===BACKSPACE_KEY_CODE&&r&&n.target instanceof HTMLInputElement&&getCaretPosition$1(n.target)===AFTER_LEADING_PLUS_CARET_POSITION){n.preventDefault();return}t&&t(n)},[t,r])}var BACKSPACE_KEY_CODE=8;function getCaretPosition$1(e){return e.selectionStart}var AFTER_LEADING_PLUS_CARET_POSITION=1,_excluded$7=["onKeyDown","country","international","withCountryCallingCode","metadata"];function _objectWithoutProperties$7(e,t){if(e==null)return{};var r=_objectWithoutPropertiesLoose$7(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$7(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function createInput$1(e){function t(r,n){var i=r.onKeyDown,s=r.country,l=r.international,d=r.withCountryCallingCode,p=r.metadata,m=p===void 0?e:p,v=_objectWithoutProperties$7(r,_excluded$7),b=reactExports.useCallback(function($){var N=new AsYouType(s,m),D=getInputValuePrefix({country:s,international:l,withCountryCallingCode:d,metadata:m}),P=N.input(D+$),F=N.getTemplate();return D&&(P=removeInputValuePrefix(P,D),F&&(F=removeInputValuePrefix(F,D))),{text:P,template:F}},[s,m]),S=useInputKeyDownHandler({onKeyDown:i,international:l});return jsx(Input$1,{...v,ref:n,parse:parsePhoneNumberCharacter_,format:b,onKeyDown:S})}return t=React.forwardRef(t),t.propTypes={value:PropTypes.string.isRequired,onChange:PropTypes.func.isRequired,onKeyDown:PropTypes.func,country:PropTypes.string,international:PropTypes.bool,withCountryCallingCode:PropTypes.bool,metadata:PropTypes.object},t}const InputSmart=createInput$1();var _excluded$6=["value","onChange","onKeyDown","country","international","withCountryCallingCode","metadata","inputComponent"];function _objectWithoutProperties$6(e,t){if(e==null)return{};var r=_objectWithoutPropertiesLoose$6(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$6(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function createInput(e){function t(r,n){var i=r.value,s=r.onChange,l=r.onKeyDown,d=r.country,p=r.international,m=r.withCountryCallingCode,v=r.metadata,b=v===void 0?e:v,S=r.inputComponent,$=S===void 0?"input":S,N=_objectWithoutProperties$6(r,_excluded$6),D=getInputValuePrefix({country:d,international:p,withCountryCallingCode:m,metadata:b}),P=reactExports.useCallback(function(q){var H=parseIncompletePhoneNumber(q.target.value);if(H===i){var f=format(D,H,d,b);f.indexOf(q.target.value)===0&&(H=H.slice(0,-1))}s(H)},[D,i,s,d,b]),F=useInputKeyDownHandler({onKeyDown:l,international:p});return jsx($,{...N,ref:n,value:format(D,i,d,b),onChange:P,onKeyDown:F})}return t=React.forwardRef(t),t.propTypes={value:PropTypes.string.isRequired,onChange:PropTypes.func.isRequired,onKeyDown:PropTypes.func,country:PropTypes.string,international:PropTypes.bool,withCountryCallingCode:PropTypes.bool,metadata:PropTypes.object,inputComponent:PropTypes.elementType},t}const InputBasic=createInput();function format(e,t,r,n){return removeInputValuePrefix(formatIncompletePhoneNumber(e+t,r,n),e)}function getCountryFlag(e){return getRegionalIndicatorSymbol(e[0])+getRegionalIndicatorSymbol(e[1])}function getRegionalIndicatorSymbol(e){return String.fromCodePoint(127397+e.toUpperCase().charCodeAt(0))}var _excluded$5=["value","onChange","options","disabled","readOnly"],_excluded2$1=["value","options","className","iconComponent","getIconAspectRatio","arrowComponent","unicodeFlags"];function _createForOfIteratorHelperLoose$2(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray$2(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$2(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$2(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$2(e,t)}}function _arrayLikeToArray$2(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$5(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function CountrySelect(e){var t=e.value,r=e.onChange,n=e.options,i=e.disabled,s=e.readOnly,l=_objectWithoutProperties$5(e,_excluded$5),d=reactExports.useCallback(function(p){var m=p.target.value;r(m==="ZZ"?void 0:m)},[r]);return reactExports.useMemo(function(){return getSelectedOption(n,t)},[n,t]),jsx("select",{...l,disabled:i||s,readOnly:s,value:t||"ZZ",onChange:d,children:n.map(function(p){var m=p.value,v=p.label,b=p.divider;return jsx("option",{value:b?"|":m||"ZZ",disabled:!!b,style:b?DIVIDER_STYLE:void 0,children:v},b?"|":m||"ZZ")})})}CountrySelect.propTypes={value:PropTypes.string,onChange:PropTypes.func.isRequired,options:PropTypes.arrayOf(PropTypes.shape({value:PropTypes.string,label:PropTypes.string,divider:PropTypes.bool})).isRequired,disabled:PropTypes.bool,readOnly:PropTypes.bool};var DIVIDER_STYLE={fontSize:"1px",backgroundColor:"currentColor",color:"inherit"};function CountrySelectWithIcon(e){var t=e.value,r=e.options,n=e.className,i=e.iconComponent;e.getIconAspectRatio;var s=e.arrowComponent,l=s===void 0?DefaultArrowComponent:s,d=e.unicodeFlags,p=_objectWithoutProperties$5(e,_excluded2$1),m=reactExports.useMemo(function(){return getSelectedOption(r,t)},[r,t]);return jsxs("div",{className:"PhoneInputCountry",children:[jsx(CountrySelect,{...p,value:t,options:r,className:classNames("PhoneInputCountrySelect",n)}),d&&t&&jsx("div",{className:"PhoneInputCountryIconUnicode",children:getCountryFlag(t)}),!(d&&t)&&jsx(i,{"aria-hidden":!0,country:t,label:m&&m.label,aspectRatio:d?1:void 0}),jsx(l,{})]})}CountrySelectWithIcon.propTypes={iconComponent:PropTypes.elementType,arrowComponent:PropTypes.elementType,unicodeFlags:PropTypes.bool};function DefaultArrowComponent(){return jsx("div",{className:"PhoneInputCountrySelectArrow"})}function getSelectedOption(e,t){for(var r=_createForOfIteratorHelperLoose$2(e),n;!(n=r()).done;){var i=n.value;if(!i.divider&&i.value===t)return i}}var _excluded$4=["country","countryName","flags","flagUrl"];function _extends$4(){return _extends$4=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$4(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function FlagComponent(e){var t=e.country,r=e.countryName,n=e.flags,i=e.flagUrl,s=_objectWithoutProperties$4(e,_excluded$4);return n&&n[t]?n[t]({title:r}):React.createElement("img",_extends$4({},s,{alt:r,role:r?void 0:"presentation",src:i.replace("{XX}",t).replace("{xx}",t.toLowerCase())}))}FlagComponent.propTypes={country:PropTypes.string.isRequired,countryName:PropTypes.string.isRequired,flags:PropTypes.objectOf(PropTypes.elementType),flagUrl:PropTypes.string.isRequired};var _excluded$3=["aspectRatio"],_excluded2=["title"],_excluded3=["title"];function _extends$3(){return _extends$3=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$3(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function InternationalIcon(e){var t=e.aspectRatio,r=_objectWithoutProperties$3(e,_excluded$3);return t===1?React.createElement(InternationalIcon1x1,r):React.createElement(InternationalIcon3x2,r)}InternationalIcon.propTypes={title:PropTypes.string.isRequired,aspectRatio:PropTypes.number};function InternationalIcon3x2(e){var t=e.title,r=_objectWithoutProperties$3(e,_excluded2);return React.createElement("svg",_extends$3({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 75 50"}),React.createElement("title",null,t),React.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeMiterlimit:"10"},React.createElement("path",{strokeLinecap:"round",d:"M47.2,36.1C48.1,36,49,36,50,36c7.4,0,14,1.7,18.5,4.3"}),React.createElement("path",{d:"M68.6,9.6C64.2,12.3,57.5,14,50,14c-7.4,0-14-1.7-18.5-4.3"}),React.createElement("line",{x1:"26",y1:"25",x2:"74",y2:"25"}),React.createElement("line",{x1:"50",y1:"1",x2:"50",y2:"49"}),React.createElement("path",{strokeLinecap:"round",d:"M46.3,48.7c1.2,0.2,2.5,0.3,3.7,0.3c13.3,0,24-10.7,24-24S63.3,1,50,1S26,11.7,26,25c0,2,0.3,3.9,0.7,5.8"}),React.createElement("path",{strokeLinecap:"round",d:"M46.8,48.2c1,0.6,2.1,0.8,3.2,0.8c6.6,0,12-10.7,12-24S56.6,1,50,1S38,11.7,38,25c0,1.4,0.1,2.7,0.2,4c0,0.1,0,0.2,0,0.2"})),React.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"none",fill:"currentColor",d:"M12.4,17.9c2.9-2.9,5.4-4.8,0.3-11.2S4.1,5.2,1.3,8.1C-2,11.4,1.1,23.5,13.1,35.6s24.3,15.2,27.5,11.9c2.8-2.8,7.8-6.3,1.4-11.5s-8.3-2.6-11.2,0.3c-2,2-7.2-2.2-11.7-6.7S10.4,19.9,12.4,17.9z"}))}InternationalIcon3x2.propTypes={title:PropTypes.string.isRequired};function InternationalIcon1x1(e){var t=e.title,r=_objectWithoutProperties$3(e,_excluded3);return React.createElement("svg",_extends$3({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"}),React.createElement("title",null,t),React.createElement("g",{className:"PhoneInputInternationalIconGlobe",stroke:"currentColor",fill:"none",strokeWidth:"2",strokeLinecap:"round"},React.createElement("path",{d:"M8.45,13A21.44,21.44,0,1,1,37.08,41.56"}),React.createElement("path",{d:"M19.36,35.47a36.9,36.9,0,0,1-2.28-13.24C17.08,10.39,21.88.85,27.8.85s10.72,9.54,10.72,21.38c0,6.48-1.44,12.28-3.71,16.21"}),React.createElement("path",{d:"M17.41,33.4A39,39,0,0,1,27.8,32.06c6.62,0,12.55,1.5,16.48,3.86"}),React.createElement("path",{d:"M44.29,8.53c-3.93,2.37-9.86,3.88-16.49,3.88S15.25,10.9,11.31,8.54"}),React.createElement("line",{x1:"27.8",y1:"0.85",x2:"27.8",y2:"34.61"}),React.createElement("line",{x1:"15.2",y1:"22.23",x2:"49.15",y2:"22.23"})),React.createElement("path",{className:"PhoneInputInternationalIconPhone",stroke:"transparent",fill:"currentColor",d:"M9.42,26.64c2.22-2.22,4.15-3.59.22-8.49S3.08,17,.93,19.17c-2.49,2.48-.13,11.74,9,20.89s18.41,11.5,20.89,9c2.15-2.15,5.91-4.77,1-8.71s-6.27-2-8.49.22c-1.55,1.55-5.48-1.69-8.86-5.08S7.87,28.19,9.42,26.64Z"}))}InternationalIcon1x1.propTypes={title:PropTypes.string.isRequired};function _createForOfIteratorHelperLoose$1(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray$1(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$1(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray$1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray$1(e,t)}}function _arrayLikeToArray$1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0))return e}function isCountrySupportedWithError(e,t){return isSupportedCountry$1(e,t)?!0:(console.error("Country not found: ".concat(e)),!1)}function getSupportedCountries(e,t){return e&&(e=e.filter(function(r){return isCountrySupportedWithError(r,t)}),e.length===0&&(e=void 0)),e}var _excluded$2=["country","label","aspectRatio"];function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$2(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function createCountryIconComponent(e){var t=e.flags,r=e.flagUrl,n=e.flagComponent,i=e.internationalIcon;function s(l){var d=l.country,p=l.label,m=l.aspectRatio,v=_objectWithoutProperties$2(l,_excluded$2),b=i===InternationalIcon?m:void 0;return React.createElement("div",_extends$2({},v,{className:classNames("PhoneInputCountryIcon",{"PhoneInputCountryIcon--square":b===1,"PhoneInputCountryIcon--border":d})}),d?React.createElement(n,{country:d,countryName:p,flags:t,flagUrl:r,className:"PhoneInputCountryIconImg"}):React.createElement(i,{title:p,aspectRatio:b,className:"PhoneInputCountryIconImg"}))}return s.propTypes={country:PropTypes.string,label:PropTypes.string.isRequired,aspectRatio:PropTypes.number},s}createCountryIconComponent({flagUrl:"https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg",flagComponent:FlagComponent,internationalIcon:InternationalIcon});function _createForOfIteratorHelperLoose(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray(e,t){if(e){if(typeof e=="string")return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray(e,t)}}function _arrayLikeToArray(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(p=i()),p}function getCountrySelectOptions(e){var t=e.countries,r=e.countryNames,n=e.addInternationalOption,i=e.compareStringsLocales,s=e.compareStrings;s||(s=compareStrings);var l=t.map(function(d){return{value:d,label:r[d]||d}});return l.sort(function(d,p){return s(d.label,p.label,i)}),n&&l.unshift({label:r.ZZ}),l}function parsePhoneNumber(e,t){return parsePhoneNumber$1(e||"",t)}function generateNationalNumberDigits(e){return e.formatNational().replace(/\D/g,"")}function getPhoneDigitsForNewCountry(e,t){var r=t.prevCountry,n=t.newCountry,i=t.metadata,s=t.useNationalFormat;if(r===n)return e;if(!e)return s?"":n?getInternationalPhoneNumberPrefix(n,i):"";if(n){if(e[0]==="+"){if(s)return e.indexOf("+"+getCountryCallingCode(n,i))===0?stripCountryCallingCode(e,n,i):"";if(r){var l=getInternationalPhoneNumberPrefix(n,i);return e.indexOf(l)===0?e:l}else{var d=getInternationalPhoneNumberPrefix(n,i);return e.indexOf(d)===0?e:d}}}else if(e[0]!=="+")return e164(e,r,i)||"";return e}function e164(e,t,r){if(e){if(e[0]==="+"){if(e==="+")return;var n=new AsYouType(t,r);return n.input(e),n.getNumberValue()}if(t){var i=getNationalSignificantNumberDigits(e,t,r);return"+".concat(getCountryCallingCode(t,r)).concat(i||"")}}}function trimNumber(e,t,r){var n=getNationalSignificantNumberDigits(e,t,r);if(n){var i=n.length-getMaxNumberLength(t,r);if(i>0)return e.slice(0,e.length-i)}return e}function getMaxNumberLength(e,t){return t=new Metadata(t),t.selectNumberingPlan(e),t.numberingPlan.possibleLengths()[t.numberingPlan.possibleLengths().length-1]}function getCountryForPartialE164Number(e,t){var r=t.country,n=t.countries,i=t.defaultCountry,s=t.latestCountrySelectedByUser,l=t.required,d=t.metadata;if(e==="+")return r;var p=getCountryFromPossiblyIncompleteInternationalPhoneNumber(e,d);if(p)return!n||n.indexOf(p)>=0?p:void 0;if(r){if(couldNumberBelongToCountry(e,r,d)){if(s&&couldNumberBelongToCountry(e,s,d))return s;if(i&&couldNumberBelongToCountry(e,i,d))return i;if(!l)return}else if(!l)return}return r}function onPhoneDigitsChange(e,t){var r=t.prevPhoneDigits,n=t.country,i=t.defaultCountry,s=t.latestCountrySelectedByUser,l=t.countryRequired,d=t.getAnyCountry,p=t.countries,m=t.international,v=t.limitMaxLength,b=t.countryCallingCodeEditable,S=t.metadata;if(m&&b===!1&&n){var $=getInternationalPhoneNumberPrefix(n,S);if(e.indexOf($)!==0){var N,D=e&&e[0]!=="+";return D?(e=$+e,N=e164(e,n,S)):e=$,{phoneDigits:e,value:N,country:n}}}m===!1&&n&&e&&e[0]==="+"&&(e=convertInternationalPhoneDigitsToNational(e,n,S)),e&&n&&v&&(e=trimNumber(e,n,S)),e&&e[0]!=="+"&&(!n||m)&&(e="+"+e),!e&&r&&r[0]==="+"&&(m?n=void 0:n=i),e==="+"&&r&&r[0]==="+"&&r.length>1&&(n=void 0);var P;return e&&(e[0]==="+"&&(e==="+"||n&&getInternationalPhoneNumberPrefix(n,S).indexOf(e)===0)?P=void 0:P=e164(e,n,S)),P&&(n=getCountryForPartialE164Number(P,{country:n,countries:p,defaultCountry:i,latestCountrySelectedByUser:s,required:!1,metadata:S}),m===!1&&n&&e&&e[0]==="+"&&(e=convertInternationalPhoneDigitsToNational(e,n,S),P=e164(e,n,S))),!n&&l&&(n=i||d()),{phoneDigits:e,country:n,value:P}}function convertInternationalPhoneDigitsToNational(e,t,r){if(e.indexOf(getInternationalPhoneNumberPrefix(t,r))===0){var n=new AsYouType(t,r);n.input(e);var i=n.getNumber();return i?i.formatNational().replace(/\D/g,""):""}else return e.replace(/\D/g,"")}function getCountryFromPossiblyIncompleteInternationalPhoneNumber(e,t){var r=new AsYouType(null,t);return r.input(e),r.getCountry()}function compareStrings(e,t,r){return String.prototype.localeCompare?e.localeCompare(t,r):et?1:0}function stripCountryCallingCode(e,t,r){if(t){var n="+"+getCountryCallingCode(t,r);if(e.length=0)&&(g=w.country):(g=getCountryForPartialE164Number(l,{country:void 0,countries:C,metadata:n}),g||s&&l.indexOf(getInternationalPhoneNumberPrefix(s,n))===0&&(g=s))}var _;if(l){if(P){var A=g?P===g:couldNumberBelongToCountry(l,P,n);A?g||(g=P):_={latestCountrySelectedByUser:void 0}}}else _={latestCountrySelectedByUser:void 0,hasUserSelectedACountry:void 0};return _objectSpread$1(_objectSpread$1({},_),{},{phoneDigits:F({phoneNumber:w,value:l,defaultCountry:s}),value:l,country:l?g:s})}}function valuesAreEqual(e,t){return e===null&&(e=void 0),t===null&&(t=void 0),e===t}var _excluded$1=["name","disabled","readOnly","autoComplete","style","className","inputRef","inputComponent","numberInputProps","smartCaret","countrySelectComponent","countrySelectProps","containerComponent","containerComponentProps","defaultCountry","countries","countryOptionsOrder","labels","flags","flagComponent","flagUrl","addInternationalOption","internationalIcon","displayInitialValueAsLocalNumber","initialValueFormat","onCountryChange","limitMaxLength","countryCallingCodeEditable","focusInputOnCountrySelection","reset","metadata","international","locales"];function _typeof(e){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(e)}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose$1(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _objectWithoutPropertiesLoose(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s=0)&&(r[i]=e[i]);return r}function createPhoneInput(e){var t=React.forwardRef(function(r,n){var i=r.metadata,s=i===void 0?e:i,l=r.labels,d=l===void 0?defaultLabels:l,p=_objectWithoutProperties(r,_excluded);return React.createElement(PhoneNumberInput,_extends({},p,{ref:n,metadata:s,labels:d}))});return t.propTypes={metadata,labels},t}createPhoneInput();function call(e,t){var r=Array.prototype.slice.call(t);return r.push(metadata$1),e.apply(this,r)}const NativePhoneInput=createPhoneInput(metadata$1);function isValidPhoneNumber(){return call(isValidPhoneNumber$1,arguments)}function isSupportedCountry(){return call(isSupportedCountry$1,arguments)}const MISSPELL_EMAILS=["gmail.cim","gmail.cpm","gmail.clm","gmail.con","gmai.lcom","gmailc.om","gmail.xom","gmail.vom","gmail.dom","gmail.fom","gmail,com"];function validateEmail(e){return MISSPELL_EMAILS.some(t=>e.includes(t))||!emailValidatorExports.validate(e)?"Invalid email":!0}function validatePhone(e){return!e||!isValidPhoneNumber(e)?"Invalid phone":!0}const shouldDisableValidation=()=>{var e;return((e=detect())==null?void 0:e.name)==="safari"},isInstagram=()=>{var e;return((e=detect())==null?void 0:e.name)==="instagram"},FormItem=reactExports.forwardRef(({label:e,error:t,validationMessages:r,children:n},i)=>{const s=reactExports.useMemo(()=>t?t.type==="required"?(r==null?void 0:r.required)||`${e} is required`:r!=null&&r.invalid?r.invalid:t.type==="minLength"?`${e} is too short`:typeof t.message=="string"?t.message:`${e} is invalid`:"",[t,e,r]);return jsxs("label",{ref:i,className:"text-primary-500 focus-within:text-accent transition duration-150 flex flex-col gap-0.5 items-stretch",children:[n,t&&jsx("p",{className:"text-red-700 text-xs",children:s})]})});FormItem.displayName="FormItem";function __rest(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=d?i=i+repeat("0",l-d):i=(i.substring(0,l)||"0")+"."+i.substring(l),r+i}function setCaretPosition(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var findChangeRange=memoizeOnce(function(e,t){for(var r=0,n=0,i=e.length,s=t.length;e[r]===t[r]&&rr&&i-n>r;)n++;return{from:{start:r,end:i-n},to:{start:r,end:s-n}}}),findChangedRangeFromCaretPositions=function(e,t){var r=Math.min(e.selectionStart,t);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:t}}};function clamp(e,t,r){return Math.min(Math.max(e,t),r)}function geInputCaretPosition(e){return Math.max(e.selectionStart,e.selectionEnd)}function addInputMode(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function getDefaultChangeMeta(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function getMaskAtIndex(e,t){return e===void 0&&(e=" "),typeof e=="string"?e:e[t]||" "}function defaultIsCharacterSame(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,i=e.formattedValueIndex;return t[n]===r[i]}function getCaretPosition(e,t,r,n,i,s,l){l===void 0&&(l=defaultIsCharacterSame);var d=i.findIndex(function(f){return f}),p=e.slice(0,d);!t&&!r.startsWith(p)&&(t=p,r=p+r,n=n+p.length);for(var m=r.length,v=e.length,b={},S=new Array(m),$=0;$0&&S[F]===-1;)F--;var H=F===-1||S[F]===-1?0:S[F]+1;return H>q?q:n-H=0&&!r[t];)t--;t===-1&&(t=r.indexOf(!0))}else{for(;t<=i&&!r[t];)t++;t>i&&(t=r.lastIndexOf(!0))}return t===-1&&(t=i),t}function caretUnknownFormatBoundary(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r0&&t[f-1]!==i;)f--;w="left"}else{for(var g=t.length;fl.handle===(r??DEFAULT_INPUT_HANDLE)),s=classNames(SHARED_STYLE_CLASSNAME(i==null?void 0:i.handle),i==null?void 0:i.styles.classes);return classNames("transition duration-150",s,e&&ERROR_CLASSNAME,t)}const Input=reactExports.forwardRef(({error:e=!1,className:t,sharedStyle:r,required:n,...i},s)=>{const l=useInputClassName({error:e,className:t,sharedStyle:r}),{styles:d,onClick:p,onMouseEnter:m,onMouseLeave:v}=usePreviewNodeContext();return jsx("input",{ref:s,className:classNames(l,"outline-none !normal-case"),style:d,...i,onClick:p,onMouseEnter:m,onMouseLeave:v,"aria-required":n})});Input.displayName="Input";const TextArea=reactExports.forwardRef(({error:e=!1,className:t,sharedStyle:r,required:n,...i},s)=>{const l=useInputClassName({error:e,className:t,sharedStyle:r}),{styles:d,onClick:p,onMouseEnter:m,onMouseLeave:v}=usePreviewNodeContext();return jsx("textarea",{ref:s,className:classNames(l,"outline-none !normal-case"),style:d,...i,onClick:p,onMouseEnter:m,onMouseLeave:v,"aria-required":n})});TextArea.displayName="TextArea";const FormattedInput=reactExports.forwardRef(({error:e=!1,className:t,format:r,sharedStyle:n,...i},s)=>{const l=useInputClassName({error:e,className:t,sharedStyle:n}),{styles:d,onClick:p,onMouseEnter:m,onMouseLeave:v}=usePreviewNodeContext();return jsx(PatternFormat,{getInputRef:s,format:r,type:"text",className:classNames(l,"outline-none !normal-case"),style:d,...i,onClick:p,onMouseEnter:m,onMouseLeave:v})});FormattedInput.displayName="FormattedInput";const EmailInput=reactExports.forwardRef(({id:e,required:t,placeholder:r,validationMessages:n,className:i,sharedStyle:s},l)=>{const{register:d,formState:{errors:p}}=useProfileFormContext();return jsx(FormItem,{label:"Email",required:t,validationMessages:n,error:p.email,ref:l,children:jsx(Input,{id:e,placeholder:r??"Your email",autoComplete:"email",...d("email",{required:t,...!shouldDisableValidation()&&{validate:m=>!t&&!m?!0:validateEmail(m??"")}}),error:!!p.email,required:t,className:i,sharedStyle:s})})});EmailInput.displayName="EmailInput";const FirstNameInput=reactExports.forwardRef(({id:e,required:t,placeholder:r,validationMessages:n,className:i,sharedStyle:s},l)=>{const{register:d,formState:{errors:p}}=useProfileFormContext();return jsx(FormItem,{label:"First name",required:t,error:p.name,validationMessages:n,ref:l,children:jsx(Input,{id:e,placeholder:r??"Your first name",autoComplete:"given-name",...d("name",{required:t,minLength:2}),error:!!p.name,required:t,className:i,sharedStyle:s})})});FirstNameInput.displayName="FirstNameInput";const rawCSS=':host,#alia-root{--PhoneInput-color--focus: #03b2cb;--PhoneInputInternationalIconPhone-opacity: .8;--PhoneInputInternationalIconGlobe-opacity: .65;--PhoneInputCountrySelect-marginRight: .35em;--PhoneInputCountrySelectArrow-width: .3em;--PhoneInputCountrySelectArrow-marginLeft: var(--PhoneInputCountrySelect-marginRight);--PhoneInputCountrySelectArrow-borderWidth: 1px;--PhoneInputCountrySelectArrow-opacity: .45;--PhoneInputCountrySelectArrow-color: currentColor;--PhoneInputCountrySelectArrow-color--focus: var(--PhoneInput-color--focus);--PhoneInputCountrySelectArrow-transform: rotate(45deg);--PhoneInputCountryFlag-aspectRatio: 1.5;--PhoneInputCountryFlag-height: 1em;--PhoneInputCountryFlag-borderWidth: 1px;--PhoneInputCountryFlag-borderColor: rgba(0,0,0,.5);--PhoneInputCountryFlag-borderColor--focus: var(--PhoneInput-color--focus);--PhoneInputCountryFlag-backgroundColor--loading: rgba(0,0,0,.1)}:host .PhoneInput,#alia-root .PhoneInput{display:flex;align-items:center}:host .PhoneInputInput,#alia-root .PhoneInputInput{flex:1;min-width:0}:host .PhoneInputCountryIcon,#alia-root .PhoneInputCountryIcon{width:calc(var(--PhoneInputCountryFlag-height) * var(--PhoneInputCountryFlag-aspectRatio));height:var(--PhoneInputCountryFlag-height)}:host .PhoneInputCountryIcon--square,#alia-root .PhoneInputCountryIcon--square{width:var(--PhoneInputCountryFlag-height)}:host .PhoneInputCountryIcon--border,#alia-root .PhoneInputCountryIcon--border{background-color:var(--PhoneInputCountryFlag-backgroundColor--loading);box-shadow:0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor),inset 0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor)}:host .PhoneInputCountryIconImg,#alia-root .PhoneInputCountryIconImg{display:block;width:100%;height:100%}:host .PhoneInputInternationalIconPhone,#alia-root .PhoneInputInternationalIconPhone{opacity:var(--PhoneInputInternationalIconPhone-opacity)}:host .PhoneInputInternationalIconGlobe,#alia-root .PhoneInputInternationalIconGlobe{opacity:var(--PhoneInputInternationalIconGlobe-opacity)}:host .PhoneInputCountry,#alia-root .PhoneInputCountry{position:relative;align-self:stretch;display:flex;align-items:center;margin-right:var(--PhoneInputCountrySelect-marginRight)}:host .PhoneInputCountrySelect,#alia-root .PhoneInputCountrySelect{position:absolute;top:0;left:0;height:100%;width:100%;z-index:1;border:0;opacity:0;cursor:pointer}:host .PhoneInputCountrySelect[disabled],#alia-root .PhoneInputCountrySelect[disabled],:host .PhoneInputCountrySelect[readonly],#alia-root .PhoneInputCountrySelect[readonly]{cursor:default}:host .PhoneInputCountrySelectArrow,#alia-root .PhoneInputCountrySelectArrow{display:block;content:"";width:var(--PhoneInputCountrySelectArrow-width);height:var(--PhoneInputCountrySelectArrow-width);margin-left:var(--PhoneInputCountrySelectArrow-marginLeft);border-style:solid;border-color:var(--PhoneInputCountrySelectArrow-color);border-top-width:0;border-bottom-width:var(--PhoneInputCountrySelectArrow-borderWidth);border-left-width:0;border-right-width:var(--PhoneInputCountrySelectArrow-borderWidth);transform:var(--PhoneInputCountrySelectArrow-transform);opacity:var(--PhoneInputCountrySelectArrow-opacity)}:host .PhoneInputCountrySelect:focus+.PhoneInputCountryIcon+.PhoneInputCountrySelectArrow,#alia-root .PhoneInputCountrySelect:focus+.PhoneInputCountryIcon+.PhoneInputCountrySelectArrow{opacity:1;color:var(--PhoneInputCountrySelectArrow-color--focus)}:host .PhoneInputCountrySelect:focus+.PhoneInputCountryIcon--border,#alia-root .PhoneInputCountrySelect:focus+.PhoneInputCountryIcon--border{box-shadow:0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor--focus),inset 0 0 0 var(--PhoneInputCountryFlag-borderWidth) var(--PhoneInputCountryFlag-borderColor--focus)}:host .PhoneInputCountrySelect:focus+.PhoneInputCountryIcon .PhoneInputInternationalIconGlobe,#alia-root .PhoneInputCountrySelect:focus+.PhoneInputCountryIcon .PhoneInputInternationalIconGlobe{opacity:1;color:var(--PhoneInputCountrySelectArrow-color--focus)}';function useStylesheet(e){const{root:t}=useCustomerAppContext(),{sizeOverride:r}=usePopupPreviewContext(),n=useBreakpoint(),{rootSelector:i}=useCustomerAppContext(),[s,l]=reactExports.useState(!1);return reactExports.useLayoutEffect(()=>{s||setTimeout(()=>l(!0),0);const d=new StylesheetBuilder(n,r,i);e(d);const p=getDocument().createElement("style");return p.innerHTML=d.print(),t.appendChild(p),()=>{t.removeChild(p)}},[e,r,t,n,i,s]),s}function useCSS(e){const t=reactExports.useRef(e),{rootSelector:r}=useCustomerAppContext();return reactExports.useMemo(()=>t.current.replaceAll("#alia-root",r),[r])}class StylesheetBuilder{constructor(t,r={},n){wt(this,"default");wt(this,"_1024");wt(this,"hover");wt(this,"viewportOverride");wt(this,"breakpoint");this.breakpoint=t,this.viewportOverride=r,this.default=new CSSBuilder(r,n),this._1024=new CSSBuilder(r,n),this.hover=new CSSBuilder(r,n)}print(){let t=this.default.print();return this.breakpoint==="1024"&&(t+=` `+this._1024.print()),t+=` @media (hover: hover) { ${this.hover.print()} }`,t}appendNode({node:t,id:r,children:n}){this.appendNodeContent({node:t,id:r}),t.type==="questionAnswer"&&this.appendNode({id:r,node:t.button}),n&&n.forEach(i=>this.appendNode(i))}appendNodeContent({node:t,id:r}){const n="styles"in t?t.styles:void 0;this.appendBreakpoint(`#${r}`,n)}appendClass(t,r){this.appendBreakpoint(`.${t}`,r)}appendBreakpoint(t,r){r&&(r.default&&this.appendStates(t,r.default,this.default),r[1024]&&this.appendStates(t,r[1024],this._1024))}appendStates(t,{default:r,hover:n,focusWithin:i,disabled:s,error:l,placeholder:d},p){p.appendStyles(t,r),p.appendStyles(`${t}:focus-within`,i),p.appendStyles(`${t}:disabled`,s),p.appendStyles(`${t}.${ERROR_CLASSNAME}`,l),p.appendStyles(`${t}::placeholder`,d),p.appendStyles(`${t} input::placeholder`,d),this.hover.appendStyles(`${t}:hover`,n)}}class CSSBuilder{constructor(t={},r){wt(this,"blocks",{});this.viewportOverride=t,this.selectorScope=r}appendStyles(t,r){r&&(this.blocks[t]?this.blocks[t]={...this.blocks[t],...r}:this.blocks[t]=r)}print(){return Object.keys(this.blocks).map(t=>this.buildRuleSet(t,this.blocks[t])).filter(Boolean).join(` `)}buildRuleSet(t,r){if(Object.keys(r).length!==0)return this.selectorScope&&!t.includes(this.selectorScope)&&(t=addScopeToSelector(t,this.selectorScope)),t+` { `+this.buildDeclaration(r)+` }`}buildDeclaration(t){return Object.keys(t).map(r=>`${this.hyphenate(r)}: ${transformCSSValue(t[r]??"",this.viewportOverride)};`).join(` `)}hyphenate(t){return t.replace(/[A-Z]/g,function(r){return"-"+r.toLowerCase()})}}function transformCSSValue(e,t){return!e||e.startsWith("url(")||((t!=null&&t.width||t!=null&&t.height)&&(e=replaceViewportVariables(e,t)),e=replaceRem(e)),e}function replaceViewportVariables(e,t){return t?e.replace(/([0-9]+)(vw|svw|lvw|dvw|vh|svh|lvh|dvh)/g,(r,n,i)=>{const s=+n/100,l=i.endsWith("h")?t.height:t.width;return l?`${l*s}px`:e}):e}function replaceRem(e){return e.replace(/(\d*\.?\d+\s?)(rem)/gi,(t,r)=>isNaN(+r)?e:`${+r*16}px`)}function addScopeToSelector(e,t){return t?e.split(",").map(r=>t+" "+r.trim()).join(","):e}const PhoneInput=reactExports.forwardRef(({id:e,onEnter:t,required:r,defaultCountryCode:n,placeholder:i,validationMessages:s,className:l,sharedStyle:d},p)=>{var f;const m=(f=useOptionalEducationSignUpSettings())==null?void 0:f.defaultCountryCode,v=n??m??"US",b=isSupportedCountry(v)?v:"US",{formState:{errors:S},control:$}=useProfileFormContext(),N=useInputClassName({error:!!S.phone,className:l,sharedStyle:d}),{styles:D,onClick:P,onMouseEnter:F,onMouseLeave:q}=usePreviewNodeContext(),H=useCSS(rawCSS);return jsx(FormItem,{label:"Phone",required:r,error:S.phone,validationMessages:s,ref:p,children:jsx(Controller,{control:$,name:"phone",rules:{required:r,...!shouldDisableValidation()&&{validate:w=>!r&&!w?!0:validatePhone(w)}},render:({field:w})=>jsxs("div",{onKeyDown:g=>{g.key==="Enter"&&(t==null||t())},onClick:P,onMouseEnter:F,onMouseLeave:q,children:[jsx("style",{id:"customer-app-phone-input-css",children:H}),jsx(NativePhoneInput,{id:e,className:classNames(N,"overflow-hidden flex items-center gap-1"),style:D,placeholder:i??"Your phone number",defaultCountry:b,...w})]})})})});PhoneInput.displayName="PhoneInput";const ConsentText=({text:e})=>jsx("div",{className:"space-y-2",children:jsx("div",{className:"text-xs text-primary-500",children:e?jsx(Markdown,{markdown:e}):jsx(DefaultConsentText,{})})}),DefaultConsentText=()=>{const{data:e}=useGetMerchant(),t=(e==null?void 0:e.privacyURL)??"https://www.alialearn.com/privacy",r=useEducationSignUpSettings(),n=reactExports.useMemo(()=>{if(!(r.email==="disabled"&&r.phone==="disabled"))return r.email!=="disabled"&&r.phone!=="disabled"?"By submitting this information, you consent to receiving emails and SMS messages. Message and data rates may apply. You can unsubscribe at any time.":r.email!=="disabled"?"By submitting this information, you consent to receiving marketing emails. You can unsubscribe at any time.":"By submitting this information, you consent to receiving SMS messages. Message and data rates may apply. You can unsubscribe at any time."},[r.email,r.phone]);return jsxs(Fragment,{children:[n?n+" ":"",n?"Learn more about our ":"By submitting this information, you agree to our ",jsx("a",{className:"underline",target:"_blank",href:t,rel:"noreferrer",children:"Privacy Policy"}),"."]})},useProfileForm=()=>useForm({mode:"onSubmit"}),useProfileFormContext=useFormContext,FullForm=()=>{const{onComplete:e,source:t}=useSetProfileContext(),r=useProfileForm(),{name:n,email:i,phone:s,emailPlaceholder:l,smsPlaceholder:d,namePlaceholder:p,emailValidationMessages:m,nameValidationMessages:v,smsValidationMessages:b}=useEducationSignUpSettings(),{handleSubmit:S,formState:{isSubmitting:$}}=r,N=useSetProfile(),D=async P=>{try{const F=await N.mutateAsync({...P,source:t,shouldSubscribe:!0});await e(F)}catch{}};return jsxs(Fragment,{children:[jsx("div",{className:"flex flex-col gap-1",children:jsx("p",{className:"text-display-lg",children:"Unlock your discount"})}),jsx(FormProvider,{...r,children:jsxs("form",{onSubmit:S(D),className:"flex flex-col gap-3",children:[n!=="disabled"&&jsx(FirstNameInput,{required:n==="required",placeholder:p,validationMessages:v}),i!=="disabled"&&jsx(EmailInput,{required:i==="required",placeholder:l,validationMessages:m}),s!=="disabled"&&jsx(PhoneInput,{onEnter:S(D),required:s==="required",placeholder:d,validationMessages:b}),jsxs(Button,{variant:"primary",type:"submit",disabled:$,children:["Continue",jsx(Icon,{icon:"arrowRight",className:"ml-2"})]}),jsx(ConsentText,{})]})})]})},EmailForm=()=>{const{source:e}=useSetProfileContext(),{name:t,email:r,emailConsentText:n,emailPlaceholder:i,namePlaceholder:s,emailValidationMessages:l,nameValidationMessages:d}=useEducationSignUpSettings(),p=useSetProfile(),m=useProfileForm(),{handleSubmit:v,formState:{isSubmitting:b}}=m;return jsxs(Fragment,{children:[jsx("div",{className:"flex flex-col gap-1",children:jsx("p",{className:"text-display-lg",children:"Unlock your discount"})}),jsx(FormProvider,{...m,children:jsxs("form",{onSubmit:v(async S=>{await p.mutateAsync({...S,source:e,shouldSubscribe:!0})}),className:"flex flex-col gap-3",children:[t!=="disabled"&&jsx(FirstNameInput,{required:t==="required",placeholder:s,validationMessages:d}),r!=="disabled"&&jsx(EmailInput,{required:r==="required",placeholder:i,validationMessages:l}),jsxs(Button,{variant:"primary",type:"submit",disabled:b,children:["Next",jsx(Icon,{icon:"arrowRight",className:"ml-2"})]}),jsx(ConsentText,{text:n})]})})]})},PhoneForm=()=>{const{source:e,onComplete:t}=useSetProfileContext(),{phone:r,smsConsentText:n,smsPlaceholder:i,smsValidationMessages:s}=useEducationSignUpSettings(),l=useSetProfile(),d=useProfileForm(),{handleSubmit:p,formState:{isSubmitting:m}}=d,v=async b=>{const S=await l.mutateAsync({...b,source:e,shouldSubscribe:!0});await t(S)};return jsxs(Fragment,{children:[jsxs("div",{className:"flex flex-col gap-1",children:[jsx("p",{className:"text-display-lg",children:"One last step"}),jsx("p",{className:"text-primary-500 text-sm",children:r==="optional"?"If you'd like to receive special discounts and promotions by text, enter your phone number below.":"Enter your phone number to receive special discounts and promotions by text."})]}),jsx(FormProvider,{...d,children:jsxs("form",{onSubmit:p(v),className:"flex flex-col gap-3",children:[jsx(PhoneInput,{onEnter:p(v),required:r==="required",placeholder:i,validationMessages:s}),jsxs(Button,{variant:"primary",type:"submit",disabled:m,children:["Reveal discount code",jsx(Icon,{icon:"arrowRight",className:"ml-2"})]}),jsx(ConsentText,{text:n})]})})]})},SplitForm=()=>{const{data:e}=useGetUser(),{email:t,phone:r}=useEducationSignUpSettings(),n=e.hasEmail?"phone":"email";if(t==="disabled"||r==="disabled")return jsx(FullForm,{});if(n==="email")return jsx(EmailForm,{});if(n==="phone")return jsx(PhoneForm,{});assertNever(n)},{useContext:useSetProfileContext,Provider:SetProfileContextProvider}=createContextWithoutDefault("set-profile"),SetProfileForm=({split:e,...t})=>jsx(SetProfileContextProvider,{value:t,children:e?jsx(SplitForm,{}):jsx(FullForm,{})}),useGetClaimedRewardsQuery=queryManager(()=>["claimedRewards","getClaimedRewards"]);function useGetClaimedRewards(){const{initialData:e}=useCustomerAppContext(),t=useServiceFetch(),{getQueryKey:r}=useGetClaimedRewardsQuery();return useSuspenseQuery({queryKey:r(),queryFn:()=>t("GET","/claimed-rewards",{}),initialData:e.claimedRewards})}function useClaimedReward(){const{data:e}=useGetClaimedRewards();return e.length>0?e[0]:void 0}function useClaimReward(){const{onRewardClaimed:e}=useClientIntegrations(),{data:t}=useGetMerchant(),r=useServiceFetch(),{updateQuery:n}=useGetClaimedRewardsQuery(),i=useToast(),{mediator:s}=useCustomerAppContext(),{mutateAsync:l,isLoading:d}=useMutation({mutationKey:["claimReward"],mutationFn:m=>r("POST","/claimed-rewards/v2",{body:m}),onSuccess:(m,{updateCache:v=!0})=>{var b;v&&(n(void 0,S=>mergeOneIntoMany(S,m.claimedReward)),(b=s==null?void 0:s.userActionsStore)==null||b.addActions(m.userAction))},onError:m=>{i(unknownErrToStr(m))}}),p=reactExports.useCallback(async m=>{const{claimedReward:v}=await l(m);return e({rewardID:v.rewardID??void 0,rewardText:getRewardText(v.config,t.shopInfo),discountCode:v.shopifyCode??void 0}),v},[l,e,t.shopInfo]);return{mutateAsync:p,mutate:p,isLoading:d}}function useIsSignedUp(){const{name:e,email:t,phone:r}=useEducationSignUpSettings(),{data:n}=useGetUser();return!(e!=="disabled"&&!n.name||t!=="disabled"&&!n.hasEmail||r!=="disabled"&&!n.hasPhone)}function useRedeemReward(e){const r=useRewards().find(i=>i.id===e),n=useClaimReward();return reactExports.useCallback(async()=>{!e||!r||await n.mutateAsync({type:"lessons",rewardID:r.id})},[e,r,n])}function useRedeemRewardIfSignedUp(e){const{setState:t}=useLessonsContext(),n=useRewards().find(l=>l.id===e),i=useRedeemReward(e),s=useIsSignedUp();return reactExports.useCallback(async()=>{n&&(s?await i():t({type:"setProfile",rewardID:n.id}))},[n,s,t,i])}const LessonsSetProfile=({rewardID:e})=>{const t=useRedeemReward(e),{splitSignUp:r}=useEducationSignUpSettings(),{goBack:n}=useLessonsContext();return jsx(Layout$1,{left:jsx(LayoutBack,{onClick:n}),children:jsx(CommonErrorBoundary,{children:jsx("div",{className:"flex-1 flex flex-col space-y-3",children:jsx(SetProfileForm,{onComplete:t,source:{type:"widget"},split:r})})})})};function useGoToNextLesson(){const t=useIncompleteLessons()[0],{setState:r}=useLessonsContext();return reactExports.useCallback(()=>{r(t?{type:"lesson",lessonID:t.id}:{type:"home"})},[t,r])}const ErrorMsg=({errorMessage:e})=>{const[t,r]=reactExports.useMemo(()=>{const n="If this issue persists, please contact help@alialearn.com";return e?[e,n]:["An unknown error occurred",n]},[e]);return jsxs("div",{className:"absolute top-0 right-0 bottom-0 left-0 m-auto flex flex-col justify-center items-center text-accent",children:[jsx("div",{className:"text-black text-lg font-bold",children:t}),jsx("div",{className:"text-primary-500 text-md text-center leading-5",children:r})]})};function useRegisterEvent(){const{data:{isMerchantPreview:e}}=useGetUser(),t=useServiceFetch();return useMutation({mutationKey:["events","registerEvent"],mutationFn:async r=>{if(!e)return await t("POST","/events",{query:r},{keepAlive:!0})}})}function useRegisterEventOnMount(e,t=!0){const r=useRegisterEvent(),n=reactExports.useRef(!1);reactExports.useEffect(()=>{n.current||!t||(n.current=!0,r.mutate({metric:e,once:!0}))},[e,r,t])}const LessonProgress=()=>{const[e]=useSlideIndex(),t=useMaxSlideIndex(),{lesson:r}=useLessonContext(),n=r.publicData.slides[e],i=reactExports.useRef(null);return reactExports.useEffect(()=>{if(i.current&&e===t&&(n==null?void 0:n.type)==="content"){const s=i.current.children[e],l=s.children[0];if(!l)return;const d=n.minDurationSec*1e3;return l.style.transitionDuration=`${d}ms`,l.style.width=`${s.clientWidth}px`,()=>{l.style.width="0px",l.style.transitionDuration="0ms"}}},[e,t,n]),jsx("div",{ref:i,className:"flex items-center space-x-2 h-2",children:r.publicData.slides.map((s,l)=>s.type==="content"?jsx("div",{className:classNames("flex-1 h-2 rounded-lg relative overflow-hidden",{"bg-accent":l===e&&l!==t,"bg-accent-600":l=t}),children:e===t&&jsx("div",{className:"absolute left-0 top-0 bottom-0 bg-accent transition-all ease-in",style:{width:0}})},l):jsx("div",{className:classNames("h-2 w-2 rounded-lg",{"bg-accent":l===e,"bg-accent-600":l<=t&&l!==e,"bg-accent-100":l>t&&l!==e})},l))})},SlideController=({primaryAction:e,primaryText:t="Continue",primaryDisabled:r=!1,delayPrimarySec:n=0})=>{const[i,s]=useSlideIndex(),l=useMaxSlideIndex(),[d,p]=reactExports.useState(!1),m=n*1e3;return reactExports.useEffect(()=>{if(i===l){p(!0);const v=setTimeout(()=>{p(!1)},m);return()=>{p(!1),clearTimeout(v)}}else p(!1)},[m,i,l]),jsx("div",{className:"-mx-1 px-1",children:jsxs(Button,{disabled:r||d,variant:"primary",onClick:()=>{e?e():s(v=>v+1)},children:[jsx("div",{className:"z-10",children:t}),jsx(Icon,{className:"z-10",icon:"arrowRight"})]})})},Content=({slideIndex:e,contentData:t,elementsToAnimateRef:r,isPreview:n})=>{const i=reactExports.useRef(null),s=()=>{if(!i.current)return[];const l=i.current.querySelector(".prose"),d=[];return l&&d.push(...Array.from(l.children)),d.push(...Array.from(i.current.children).slice(1)),d};return reactExports.useLayoutEffect(()=>{if(r===void 0)return;const l=s();return r.current.push(...l),()=>{r.current=r.current.filter(d=>!l.includes(d))}}),reactExports.useLayoutEffect(()=>{var l;(l=i.current)==null||l.scrollTo(0,0)},[e]),jsx(CommonErrorBoundary,{children:jsxs("div",{className:"flex-1 min-h-0 flex flex-col justify-between space-y-4",children:[jsxs("div",{ref:i,className:"flex-1 overflow-scroll scrollbar-hide flex flex-col space-y-4",children:[jsx(Markdown,{markdown:t.text,prose:!0}),t.videoUrl&&jsx("iframe",{title:"video",className:"min-h-[200px]",src:t.videoUrl,allow:"autoplay"})]}),!n&&jsx(SlideController,{delayPrimarySec:t.minDurationSec})]})})},RewardBubble=({reward:e,isFilled:t=!0,opacity:r=1,onClick:n})=>{const{data:i}=useGetMerchant();return jsx(ClickableDiv,{className:classNames("h-[4.5rem] w-[4.5rem] flex-shrink-0 rounded-full text-display-sm flex flex-col justify-center items-center border-[2px] transition-all duration-300 border-accent text-accent cursor-default",{"bg-accent text-accent-foreground":t,"cursor-pointer":!!n}),style:{opacity:r},onClick:n,children:e.type==="discount"?jsxs(Fragment,{children:[jsx("div",{className:"text-xl font-semibold",children:getDiscountValueText(e.discount,i.shopInfo)}),jsx("div",{className:"text-sm uppercase",children:"off"})]}):e.type==="freeShipping"?jsxs(Fragment,{children:[jsx("div",{className:"leading-5",children:"FREE"}),jsx("div",{className:"text-sm",children:"SHIPPING"})]}):e.type==="custom"?jsx(Fragment,{children:jsx("div",{className:"text-lg w-16 leading-5 text-center",children:e.custom.title})}):assertNever(e)})},NUM_TIERS=4,RewardsPath=()=>{const{tier:e,lastRewardTier:t,nextRewardTier:r,maxTier:n}=useUserTier(),i=useLessons(),s=reactExports.useMemo(()=>i?r===void 0?t??e:e+NUM_TIERS-1>r?Math.min(i.length,e+NUM_TIERS-1,n):Math.min(r,n):0,[i,t,r,e,n]),l=reactExports.useMemo(()=>{const d=t??1,p=s;return Array.from({length:p-d+1}).map((m,v)=>v+d)},[t,s]);return jsx(reactExports.Suspense,{fallback:jsx(RewardsPathSkeleton,{}),children:jsx("div",{className:"flex justify-center overflow-scroll scrollbar-hide items-center gap-2",children:l.map((d,p)=>{const m=d===t,v=t&&d=r?.5:1;return jsxs(React.Fragment,{children:[d===e+1&&e!==t&&jsx("div",{className:"w-2 h-2 bg-accent rounded-full"}),(p>0||e===0)&&jsxs("div",{className:"flex transition-opacity duration-1000",style:{opacity:v},children:[jsx(Icon,{icon:"chevronRight",className:classNames("text-display text-accent -mx-2")}),jsx(Icon,{icon:"chevronRight",className:classNames("text-display text-accent -mx-2")})]}),jsx(RewardBubbleWrapper,{tier:d,isFilled:m,opacity:v})]},d)})})})},RewardBubbleWrapper=({tier:e,isFilled:t,opacity:r})=>{const{lastRewardTier:n}=useUserTier(),i=useIncompleteLessons(),{setState:s}=useLessonsContext(),l=useRewardsInTier(e)[0],d=()=>{e===n?s({type:"rewards"}):i.length>0&&s({type:"lesson",lessonID:i[0].id})};return l?jsx(RewardBubble,{reward:l.config,opacity:r,isFilled:t,onClick:d}):null},RewardBubbleSkeleton=()=>jsx("div",{className:"w-20 h-20 rounded-full bg-gray-200"}),RewardsPathSkeleton=()=>jsxs("div",{className:"flex justify-center items-center gap-2",children:[jsx(RewardBubbleSkeleton,{}),jsx(Icon,{icon:"chevronRight",className:classNames("text-2xl text-primary-300 -mx-2")}),jsx(Icon,{icon:"chevronRight",className:classNames("text-2xl text-primary-300 -mx-2")}),jsx(RewardBubbleSkeleton,{}),jsx(Icon,{icon:"chevronRight",className:classNames("text-2xl text-primary-300 -mx-2")}),jsx(Icon,{icon:"chevronRight",className:classNames("text-2xl text-primary-300 -mx-2")}),jsx(RewardBubbleSkeleton,{})]}),LessonComplete=()=>{var F,q,H;const{tier:e,lastRewardTier:t,nextRewardTier:r,maxTier:n}=useUserTier(),i=useRewardsInTier(r),{data:s}=useGetMerchant(),[,l]=useSlideIndex(),[d,p]=reactExports.useState(!1);useRegisterEventOnMount("LEARNING_COMPLETE",!r);const{setState:m}=useLessonsContext(),v=useGoToNextLesson(),b=f=>{l(()=>0),m(f)},S=useRewardsInTier(t),$=useRedeemRewardIfSignedUp((F=S[0])==null?void 0:F.id),N=async()=>{S.length===1?(p(!0),await $(),p(!1)):b({type:"rewards"})},D=(q=S[0])==null?void 0:q.config,P=r?r-e:0;return jsxs("div",{className:"flex-1 flex flex-col",children:[jsxs("div",{className:"flex-1 flex flex-col space-y-4 justify-center items-center",children:[jsx(RewardsPath,{}),jsxs("div",{className:"flex flex-col gap-3 items-center",children:[jsx("p",{className:"text-display-xl",children:"Congrats!"}),jsxs("p",{className:"text-center",children:[!!S.length&&jsxs("span",{children:["You just earned"," ",(H=getFullRewardText(S[0].config,s.shopInfo))==null?void 0:H.trim(),"."," "]}),!!r&&jsxs("span",{children:["Complete ",P," ",e===0?"":"more"," ","lesson",P!==1?"s":""," to get"," ",jsx("span",{className:"font-bold",children:getRewardText(i[0].config,s.shopInfo)}),!!t&&", or claim your reward now","."]})]})]})]}),jsxs("div",{className:"flex flex-col space-y-2",children:[!!D&&jsx(Button,{onClick:N,variant:r?"secondary":"primary",disabled:d,children:d?"Claiming...":`Claim ${getRewardText(D,s.shopInfo)} now`}),!!r&&jsxs(Button,{onClick:()=>e===n-1?v():b({type:"home"}),variant:"primary",disabled:d,children:["Keep going"," ",i.length>0&&t!==void 0?`for ${getRewardText(i[0].config,s.shopInfo)}`:""]})]})]})},Checkbox$1=({value:e=!1,text:t,onChange:r,disabled:n=!1,size:i="md"})=>{const s=i==="md"?"w-[18px] h-[18px]":"w-5 h-5";return jsxs("label",{className:classNames(i==="md"?"gap-1.5":"gap-2","flex items-start relative"),children:[jsx("input",{type:"checkbox",className:classNames(s,"appearance-none rounded border-2 border-accent-200 checked:border-accent-400 cursor-pointer disabled:cursor-default disabled:opacity-50","peer text-accent outline-none checked:bg-accent-800 transition-all duration-150 focus:ring-2 ring-accent-300"),disabled:n,checked:e,onChange:l=>{r(l.target.checked)}}),jsx(Icon,{icon:"checkmark",className:classNames(s,i==="lg"?"text-lg":"text-base","hidden peer-checked:flex absolute justify-center items-center text-white cursor-pointer")}),t]})},ProgressBar=({progress:e,total:t,showPercentage:r,small:n})=>{const i=reactExports.useRef(null),s=reactExports.useRef(null);reactExports.useEffect(()=>{if(i.current&&s.current){const d=e/Math.max(t,1)*100;s.current.style.width=`${d}%`}},[e,t]);const l=r?`${Math.round(e/Math.max(t,1)*100)}%`:`${e} / ${t}`;return jsx("div",{className:classNames("w-full bg-background rounded-lg shadow overflow-hidden",{"h-1.5":n,"h-6":!n}),children:jsxs("div",{ref:i,className:classNames("w-full bg-accent-200 flex justify-center items-center relative",{"h-1.5":n,"h-6":!n}),children:[jsx("div",{ref:s,className:"absolute left-0 top-0 bottom-0 bg-accent rounded-lg z-10 transition-all duration-300"}),!n&&jsx("span",{className:"text-accent-foreground font-semibold z-20",children:l})]})})},RadioButton=({value:e=!1,text:t,onChange:r,disabled:n=!1,align:i="start"})=>jsxs("label",{className:classNames("flex gap-2 relative",i==="start"?"items-start":"items-center"),children:[jsx("input",{type:"radio",className:classNames("appearance-none w-5 h-5 rounded-full border-2 border-accent-200 checked:border-accent-800 cursor-pointer disabled:cursor-default disabled:opacity-50","peer text-accent outline-none transition-all duration-150 focus:ring-2 ring-accent-300"),disabled:n,checked:e,onChange:s=>{r(s.target.checked)}}),jsx("div",{className:"invisible peer-checked:visible flex justify-center items-center absolute w-5 h-5 cursor-pointer peer-disabled:cursor-default",children:jsx("div",{className:"w-2.5 h-2.5 bg-accent-800 rounded-full"})}),t]}),QuestionBody=({questionData:e,questionStatus:t,answersContainerRef:r,pollAnswerData:n,onSelectedAnswersChange:i})=>{const[s,l]=reactExports.useState([]);reactExports.useEffect(()=>{l([])},[e.uuid]);const d=reactExports.useCallback(p=>{const m=e.multi?s.includes(p)?s.filter(v=>v!==p):[...s,p]:[p];l(m),i==null||i(m)},[i,e,s]);return jsxs(Fragment,{children:[jsxs("div",{className:"flex flex-col space-y-1",children:[jsx("p",{className:"leading-6 text-lg",children:e.text}),e.multi&&jsx("p",{className:"text-primary-500 text-sm",children:"Select all that apply"})]}),jsx("div",{ref:r,className:"flex flex-col gap-3 pl-0.5",children:e.multi?e.answers.map((p,m)=>jsx(Checkbox$1,{size:"lg",text:jsx(AnswerChoiceWithPollAnswer,{text:p.text,questionStatus:t,pollAnswerData:n}),value:s.includes(m)||(t==null?void 0:t.attemptedAnswers.includes(m)),onChange:()=>d(m)},m)):e.answers.map((p,m)=>jsx(RadioButton,{text:jsx(AnswerChoiceWithPollAnswer,{text:p.text,questionStatus:t,pollAnswerData:n}),value:s.includes(m)||(t==null?void 0:t.attemptedAnswers.includes(m)),disabled:t==null?void 0:t.complete,onChange:()=>d(m)},m))})]})},AnswerChoiceWithPollAnswer=({text:e,questionStatus:t,pollAnswerData:r})=>{const n=Object.values(r??{}).reduce((i,s)=>i+s,0);return jsxs("div",{className:"flex-1",children:[jsx("div",{className:"text-lg",children:e}),!!r&&(t==null?void 0:t.complete)&&jsx(ProgressBar,{progress:r[e]??0,total:n,showPercentage:!0})]})},Question=({questionData:e,questionStatus:t,elementsToAnimateRef:r,pollAnswerData:n})=>{const{lesson:i}=useLessonContext(),[s,l]=useSlideIndex(),[d,p]=reactExports.useState([]),m=useAnswerQuestion(),v=reactExports.useRef(null),b=reactExports.useRef(null),{nextRewardTier:S}=useUserTier(),$=useRewardsInTier(S),{data:N}=useGetMerchant(),D=()=>{var f;const q=Array.from(((f=v.current)==null?void 0:f.children)??[]),H=[...q.slice(0,q.length-1),...b.current?[b.current]:[]];return Array.from(new Set(H))};reactExports.useLayoutEffect(()=>{if(r===void 0)return;const q=D();return r.current.push(...q),()=>{r.current=r.current.filter(H=>!q.includes(H))}});const P=async()=>{const q=await m.mutateAsync({questionUUID:e.uuid,answers:d,lessonID:i.id});p([]);const H=q.data[e.uuid];H!=null&&H.complete&&!n&&l(f=>f+1)},F=reactExports.useMemo(()=>{const q=i.publicData.slides.slice(s+1).filter(H=>H.type==="question").length;return q===0||!$.length?"":`${q} question${q>1?"s":""} left to get ${getRewardText($[0].config,N.shopInfo)}.`},[i,$,s,N]);return jsxs(Fragment,{children:[jsx("div",{ref:v,className:"flex-1 overflow-scroll scrollbar-hide flex flex-col space-y-3",children:jsx(QuestionBody,{questionData:e,questionStatus:t,onSelectedAnswersChange:p,answersContainerRef:b,pollAnswerData:n})}),jsx("div",{className:"flex flex-col space-y-2 pt-2",children:t.complete?jsxs(Fragment,{children:[jsxs("p",{className:"text-center text-sm text-primary-600 leading-5",children:["Thanks for answering! ",F]}),jsx(SlideController,{})]}):jsx(SlideController,{primaryAction:P,primaryDisabled:m.isLoading||d.length===0,primaryText:"Submit"})})]})},defaultQuestionStatus={attemptedAnswers:[],correctAnswers:[],complete:!1},QuestionWrapper=({questionData:e,elementsToAnimateRef:t})=>{const[r]=useSlideIndex(),{lesson:n,lessonStatus:i}=useLessonContext(),{config:s}=useLessonsContext(),l=n.publicData.slides[r],d=i.data[l.uuid]??defaultQuestionStatus,{data:p}=useGetPollAnswersForQuestionNoSuspense({questionUUID:e.uuid}),m=s.showPollResults,v=reactExports.useMemo(()=>{if(!p||!m)return;const b=d.attemptedAnswers[0],S=e.answers.at(b);if(!S)return p;const $=p[S.text]??0;return{...p,[S.text]:$+1}},[p,m,e,d]);return jsx(CommonErrorBoundary,{children:jsx(Question,{questionData:e,questionStatus:d,elementsToAnimateRef:t,pollAnswerData:v})})},ENTRANCE_INTERVAL=600,ENTRANCE_DURATION=300,Slide=()=>{const{preview:e}=useLessonsContext(),[t]=useSlideIndex(),r=(e==null?void 0:e.slideIndex)??t,n=useMaxSlideIndex(),{data:i}=useLessonContext(),s=reactExports.useRef(null),l=reactExports.useRef([]);if(reactExports.useLayoutEffect(()=>{if(!s.current)return;const p=s.current;r===n&&(p.classList.add("opacity-0"),l.current.forEach((m,v)=>{m.classList.add("animatable"),m.classList.add("pending-entrance"),setTimeout(()=>{m.classList.remove("pending-entrance")},ENTRANCE_DURATION+v*ENTRANCE_INTERVAL)}),setTimeout(()=>{p.classList.remove("opacity-0")},ENTRANCE_DURATION))},[r,n]),r>i.slides.length-1)return jsx(LessonComplete,{});const d=i.slides[r];return jsx("div",{id:"test-id",ref:s,className:classNames("flex flex-col flex-1 min-h-0"),children:d.type==="content"?jsx(Content,{slideIndex:r,contentData:d,elementsToAnimateRef:l}):jsx(QuestionWrapper,{questionData:d,elementsToAnimateRef:l})})},Lesson=()=>{useRegisterEventOnMount("LEARNING_STARTED");const{lesson:e,lessonStatus:t}=useLessonContext(),[r,n]=useSlideIndex();useLoadSlideIndex(e,t);const{tier:i,nextRewardTier:s}=useUserTier(),l=useRewardsInTier(s),{data:d}=useGetMerchant(),{setState:p}=useLessonsContext(),m=()=>{r>0?n(v=>v-1):p({type:"home"})};return jsxs("div",{className:"flex flex-col flex-1 min-h-0 gap-1",children:[jsxs("div",{className:"flex flex-col space-y-2 pb-2",children:[jsxs("div",{className:"flex space-x-2 justify-between items-center",children:[jsx(LayoutBack,{text:e.name,onClick:m}),r{const t=useLesson(e),{data:r}=useGetLessonStatus({params:{lessonID:e}}),[n,i]=reactExports.useState(void 0),[s,l]=reactExports.useState(0),[d,p]=reactExports.useState(0);return t?jsx(LessonContextProvider,{value:{lesson:t,data:t.publicData,lessonStatus:r,lastLoadedLesson:n,setLastLoadedLesson:i,slideIndex:s,setSlideIndex:l,maxSlideIndex:d,setMaxSlideIndex:p},children:jsx(CommonErrorBoundary,{children:jsx(Lesson,{})})}):jsx(ErrorMsg,{errorMessage:"Lesson not found"})},LessonV2Skeleton=()=>jsxs(Layout$1,{reverse:!0,right:jsx("p",{className:"skeleton leading-5",children:"Welcome"}),left:jsx("div",{className:"skeleton leading-5",children:"Icons"}),children:[jsx("div",{className:"skeleton w-full rounded-lg h-3"}),jsx("div",{className:"skeleton text-3xl leading-7 w-max",children:"Learn and Earn"}),jsxs("div",{className:"space-y-0.5",children:[jsx("div",{className:"skeleton leading-5",children:"Lorem ipsum dolor sit amet"}),jsx("div",{className:"skeleton leading-5",children:"Lorem ipsum dolor sit amet"})]})]}),Loading=()=>jsx("div",{className:"text-accent w-full h-full flex justify-center items-center bg-background"}),RewardItem=({reward:e})=>{const t=useRedeemRewardIfSignedUp(e.id),{lastRewardTier:r}=useUserTier(),i=useRewardsInTier(r).some(v=>v.id===e.id),[s,l]=reactExports.useState(!1),{data:d}=useGetMerchant(),p=reactExports.useMemo(()=>s?"Unlocking...":i?"Click to unlock":"Complete more lessons to unlock",[i,s]);return jsxs(ClickableDiv,{onClick:async()=>{i&&(l(!0),await t(),l(!1))},disabled:!i,className:classNames("box flex space-x-3 items-center",{clickable:i,"opacity-60 cursor-default":!i}),children:[jsx(Icon,{className:"text-2xl",icon:"discount"}),jsxs("div",{className:"flex-1 flex flex-col space-y-1",children:[jsx("p",{className:"leading-4 text-display-xs",children:getRewardText(e.config,d.shopInfo)}),jsx("div",{className:"leading-4 text-sm text-primary-400 font-medium",children:p})]})]})},AllRewards=()=>{const{lastRewardTier:e}=useUserTier(),t=useRewardsInTier(e);return jsxs(CommonErrorBoundary,{children:[t.map(r=>jsx(RewardItem,{reward:r},r.id)),t.length===0&&jsx("p",{className:"text-primary-600 text-sm leading-5 text-center",children:"There's currently no rewards available, check back later!"})]})},RewardsPage=()=>{const{goBack:e}=useLessonsContext();return jsx(Layout$1,{left:jsx(LayoutBack,{onClick:e}),children:jsx(reactExports.Suspense,{fallback:jsx(Loading,{}),children:jsx(CommonErrorBoundary,{children:jsxs("div",{className:"flex-1 flex flex-col gap-2",children:[jsx("div",{className:"text-display-lg",children:"Rewards for you"}),jsx("div",{className:"flex-1 flex flex-col gap-2 pt-1 overflow-scroll scrollbar-hide -mx-5 px-5",children:jsx(AllRewards,{})})]})})})})},{useContext:useContext$7,Provider:Provider$8}=createContextWithoutDefault("lessons"),useLessonsContext=useContext$7,Lessons=({config:e,preview:t})=>{useGetLessonStatuses();const[r,n]=reactExports.useState([{type:"home"}]),i=t?{type:"lesson",lessonID:t.lessonID}:r[r.length-1];return jsx(Provider$8,{value:{config:e,preview:t,setState:s=>n([...r,s]),goBack:()=>n(r.slice(0,-1))},children:i.type==="lesson"?jsx(reactExports.Suspense,{fallback:jsx(LessonV2Skeleton,{}),children:jsx(LessonV2Page,{lessonID:i.lessonID})}):i.type==="rewards"?jsx(RewardsPage,{}):i.type==="howItWorks"?jsx(HowItWorks,{}):i.type==="setProfile"?jsx(LessonsSetProfile,{rewardID:i.rewardID}):jsx(LessonsHome,{})})},LessonsHome=()=>{const{data:e}=useGetUser(),{data:t}=useGetMerchant(),{setState:r,config:n}=useLessonsContext(),i=useGoToNextLesson();return reactExports.useEffect(()=>{n.skipHomeScreen&&i()},[n.skipHomeScreen,i]),jsx(Layout$1,{reverse:!0,right:jsx("p",{className:"font-medium text-accent leading-5",children:e.name?`Welcome, ${e.name}`:`Welcome to ${t.title}`}),left:jsx("div",{className:"flex space-x-1 text-accent",children:jsx(Icon,{icon:"helpOutline",className:"text-display cursor-pointer",onClick:()=>r({type:"howItWorks"})})}),children:jsxs(CommonErrorBoundary,{children:[jsx(EarnPoints,{}),jsx("div",{className:"flex flex-col space-y-4",children:jsx(reactExports.Suspense,{fallback:jsx(RewardsPathSkeleton,{}),children:jsx(RewardsPath,{})})})]})})},useGetTracksByIDQuery=queryManager(e=>["tracks","getTracksByID",e]);function useGetTracksByID(e){var i;const t=useServiceFetch(),{getQueryKey:r}=useGetTracksByIDQuery(),{initialData:n}=useCustomerAppContext();return useSuspenseQuery({queryKey:r(e??0),queryFn:()=>t("GET","/tracks/:id",{params:{id:e??0}}),enabled:!!e,staleTime:1/0,initialData:(i=n.allTracks)==null?void 0:i.find(s=>s.id===e)})}const DelayButton=({delay:e,onClick:t,children:r,disabled:n=!1})=>{var m;const[i,s]=reactExports.useState(!1),l=reactExports.useRef(null),d=reactExports.useRef(null),p=(m=l.current)==null?void 0:m.offsetWidth;return reactExports.useEffect(()=>{if(d.current){const v=d.current;v.style.transition=`left ${e}ms ease-in`,v.style.left=`${p}px`,setTimeout(()=>{s(!0)},e)}},[e,p]),jsxs("div",{className:"w-full relative",ref:l,children:[jsx("div",{ref:d,style:{backgroundColor:`rgb(${dumpCSSVariable(dumpColorVariable("--background-color"))} / 0.4)`},className:classNames("z-10 absolute right-0 bottom-0 top-0 left-0 bg-background-300",(!i||n)&&"pointer-events-none")}),jsx(Button,{variant:"primary",disabled:n||!i,onClick:()=>{i&&!n&&t()},children:r})]})},useGetTracksStateQuery=queryManager(e=>["tracksState","getTracksState",e]);function useGetTracksState(e){const t=useServiceFetch(),{getQueryKey:r}=useGetTracksStateQuery();return useSuspenseQuery({queryKey:r(e),queryFn:()=>t("GET","/tracks-state/:tracksID",{params:e})})}function useUpsertTracksState(e){const t=useServiceFetch(),{updateQuery:r}=useGetTracksStateQuery();return useMutation({mutationKey:["tracksState","upsertTracksState"],mutationFn:n=>t("PUT","/tracks-state/:tracksID",{params:e,body:n}),onSuccess:n=>{r(e,()=>n)}})}function useSyncTracksState(){const{preview:e}=useCustomerAppContext(),{tracksState:t,setTracksState:r}=useTracksContext(),{id:n}=useTracksContext(),{data:i}=useGetTracksState({tracksID:n}),s=useUpsertTracksState({tracksID:n}),l=reactExports.useRef(!1);reactExports.useEffect(()=>{l.current||(l.current=!0,i&&r(i.data))},[i,r]),reactExports.useEffect(()=>{!e&&!isTracksStateEqual(i==null?void 0:i.data,t)&&!s.isLoading&&s.mutate({data:t})},[t,s,i,e])}function isTracksStateEqual(e,t){if(!e)return!1;const r=Object.entries(e.slides).sort(([i],[s])=>i.localeCompare(s)),n=Object.entries(t.slides).sort(([i],[s])=>i.localeCompare(s));if(r.length!==n.length)return!1;for(let i=0;i{const{config:e,tracksData:t,preview:r,tracksState:n}=useTracksContext();if(r){const m=t.tracks.find(v=>v.uuid===r.trackUUID);if(m){const v=m.slides.find(b=>b.uuid===r.slideUUID);if(v)return{type:"slide",slide:v}}}const i=m=>{const v=t.rewards[m];return v?{type:"reward",uuid:m,reward:v}:{type:"error",message:"Reward not found"}},s=t.tracks.find(m=>m.uuid===(e==null?void 0:e.startingTrack));if(!s)return{type:"error",message:"No starting track"};let l=s,d=l.slides[0],p=0;for(;d;){p++;const m=l.slides.findIndex(S=>S.uuid===d.uuid);if(m===-1)return{type:"slide",slide:l.slides[0]};const v=mD.uuid===$);if(!N)return{type:"slide",slide:d};S=N.next}if(S.type==="reward")return i(S.uuid);if(S.type==="track"){const $=S.uuid,N=t.tracks.find(D=>D.uuid===$);if(!N)return{type:"slide",slide:d};l=N,d=l.slides[0];continue}}if(v)d=l.slides[m+1];else return l.reward?i(l.reward):{type:"error",message:"No next slide"}}return{type:"slide",slide:l.slides[0]}};function useCompleteSlide(){const{tracksState:e,setTracksState:t}=useTracksContext();return reactExports.useCallback((r,n)=>{t({...e,slides:{...e.slides,[r]:n}})},[t,e])}function useTracksRewardText(){const{tracksData:e}=useTracksContext(),{data:t}=useGetMerchant();return reactExports.useMemo(()=>{if(!e)return;let r;for(const n of Object.values(e.rewards)){const i=getRewardText(n,t.shopInfo);if(r!==void 0&&i!==r)return;r=i}return r},[e,t])}const TrackContentSlide=({slide:e,elementsToAnimateRef:t,preview:r=!1})=>{const n=useCompleteSlide(),i=reactExports.useRef(null),s=()=>{if(!i.current)return[];const l=i.current.querySelector(".prose"),d=[];return l&&d.push(...Array.from(l.children)),d.push(...Array.from(i.current.children).slice(1)),d};return reactExports.useLayoutEffect(()=>{if(t===void 0)return;const l=s();return t.current.push(...l),()=>{t.current=t.current.filter(d=>!l.includes(d))}}),jsxs("div",{className:"flex-1 flex flex-col justify-between min-h-0 space-y-4",children:[jsxs("div",{ref:i,className:"flex flex-col flex-1 overflow-scroll scrollbar-hide space-y-4",children:[jsx(Markdown,{markdown:e.text,prose:!0}),e.videoUrl&&jsx("iframe",{title:"video",src:e.videoUrl,allow:"autoplay"})]}),jsxs(DelayButton,{delay:e.minDurationSec*1e3,onClick:()=>n(e.uuid,{type:"content"}),disabled:r,children:["Continue",jsx(Icon,{icon:"arrowRight"})]},e.uuid)]})},TrackQuestionSlide=({slide:e,elementsToAnimateRef:t,preview:r=!1})=>{const[n,i]=reactExports.useState(),[s,l]=reactExports.useState(!1),d=useCompleteSlide(),p=reactExports.useRef(null),m=reactExports.useRef(null),[v,b]=reactExports.useState(""),S=useAnswerTracksPoll(),{data:$}=useGetPollAnswersForQuestionNoSuspense({questionUUID:e.uuid}),{id:N,config:D}=useTracksContext(),P=()=>{const g=[...p.current?[p.current]:[],...m.current?[m.current]:[]];return Array.from(new Set(g))};reactExports.useLayoutEffect(()=>{if(t===void 0)return;const g=P();return t.current.push(...g),()=>{t.current=t.current.filter(C=>!g.includes(C))}});const F=reactExports.useMemo(()=>{var g;return n==="other"?v:(g=e.answers.find(C=>C.uuid===n))==null?void 0:g.text},[n,v,e]),q=()=>{if(r||!n)return;const g=n==="other"?{other:!0}:{other:!1,uuid:n};d(e.uuid,{type:"question",answer:g}),F&&S.mutate({tracksID:N,questionUUID:e.uuid,answerUUID:"uuid"in g?g.uuid:void 0,answer:F})},H=D==null?void 0:D.showPollResults,f=reactExports.useMemo(()=>{if(!(!$||!H))return!F||n!=="other"?$:{...$,[F]:($[F]??0)+1}},[$,H,n,F]),w=Object.values(f??{}).reduce((g,C)=>g+C,0);return jsxs(CommonErrorBoundary,{children:[jsxs("div",{className:"flex-1 flex flex-col space-y-3 overflow-scroll scrollbar-hide",children:[jsx("p",{ref:p,className:"text-lg",children:e.question}),jsxs("div",{ref:m,className:"flex flex-col gap-3 pl-0.5",children:[e.answers.map((g,C)=>jsx(RadioButton,{value:n===g.uuid,onChange:()=>!s&&i(g.uuid),disabled:s,text:jsxs("div",{className:"flex-1",children:[jsx("div",{className:"text-lg",children:g.text}),s&&f?jsx(ProgressBar,{progress:f[g.text]??0,total:w,showPercentage:!0}):null]})},C)),e.other&&jsx(RadioButton,{value:n==="other",onChange:()=>!s&&i("other"),align:"center",text:jsx(Input,{placeholder:"Other...",value:v,disabled:s,onChange:g=>b(g.target.value),onFocus:()=>i("other")})})]})]}),s?jsxs(Button,{disabled:r,variant:"primary",onClick:q,children:["Continue",jsx(Icon,{icon:"arrowRight"})]}):jsxs(Button,{variant:"primary",disabled:!n||n==="other"&&!v,onClick:()=>f?l(!0):q(),children:["Submit",jsx(Icon,{icon:"arrowRight"})]})]})},TracksHelp=({onClose:e})=>{const{data:t}=useGetMerchant(),r=reactExports.useMemo(()=>[jsxs("span",{children:[jsxs("strong",{children:["Learn about ",t.title]})," through short, engaging slides"]},1),jsxs("span",{children:[jsx("strong",{children:"Answer some questions"})," so we can direct you toward the right product for you"]},2),jsxs("span",{children:[jsx("strong",{children:"Earn a discount"})," off your next purchase at"," ",t.title,"!"]},3)],[t]);return jsxs(Layout$1,{left:jsx(LayoutBack,{onClick:e}),children:[jsxs("div",{className:"flex-1 flex flex-col space-y-6",children:[jsxs("div",{className:"space-y-1",children:[jsx("div",{className:"text-display-lg",children:"How it works"}),jsxs("div",{className:"text-primary-500 text-sm flex gap-1",children:[jsx(Icon,{icon:"clock"}),"Total time: 1 min"]})]}),jsx("div",{className:"flex flex-col space-y-6",children:r.map((n,i)=>jsxs("div",{className:"flex space-x-4",children:[jsx("div",{className:"bg-accent-100 text-accent text-display-xs w-10 h-10 flex-shrink-0 rounded-full flex justify-center items-center",children:i+1}),jsx("div",{className:"text-lg",children:n})]},i))})]}),jsx(Button,{variant:"primary",onClick:e,children:"Got it!"})]})};function assert(e,t){if(!e)throw new Error(t)}const useTracksMap=()=>{var r;const{tracksData:e}=useTracksContext(),t={tracks:new Map,slides:new Map};if(!e)return t;for(const n of e.tracks){for(let i=0;im.next),...s.slide.other?[s.slide.other.next]:[]];for(const m of p)if(m.type==="continue"&&s.nextSlide)l.push(s.nextSlide);else if(m.type==="track"){const v=e.tracks.get(m.uuid);v&&l.push(v.firstSlide)}}const d=l.length===0?0:1+Math.min(...l.map(p=>getMinSlidesRemaining(e,p,r,n)));return r.set(t,d),d}function useTracksProgress(e){const t=useTracksMap(),{tracksState:r}=useTracksContext();return reactExports.useMemo(()=>{const n=getMinSlidesRemaining(t,e);return{numCompleted:Object.keys(r.slides).length,minSlidesRemaining:n}},[e,t,r.slides])}const TrackSlide=reactExports.forwardRef(({slide:e},t)=>{const r=reactExports.useRef(null),n=reactExports.useRef([]),{numCompleted:i,minSlidesRemaining:s}=useTracksProgress(e.uuid),{tracksData:l}=useTracksContext(),d=useTracksRewardText(),[p,m]=reactExports.useState(!1),{styles:v,onClick:b,onMouseEnter:S,onMouseLeave:$}=usePreviewNodeContext(),N=reactExports.useMemo(()=>l==null?void 0:l.tracks.find(D=>D.slides.some(P=>P.uuid===e.uuid)),[l,e.uuid]);return reactExports.useLayoutEffect(()=>{if(!r.current)return;const D=r.current;D.classList.add("opacity-0"),n.current.forEach((P,F)=>{P.classList.add("animatable"),P.classList.add("pending-entrance"),setTimeout(()=>{P.classList.remove("pending-entrance")},ENTRANCE_DURATION+F*ENTRANCE_INTERVAL)}),setTimeout(()=>{D.classList.remove("opacity-0")},ENTRANCE_DURATION)},[e]),p?jsx(TracksHelp,{onClose:()=>m(!1)}):jsxs("div",{className:"flex flex-col flex-1 gap-3 min-h-0",style:v,onClick:b,onMouseEnter:S,onMouseLeave:$,ref:t,children:[jsxs("div",{className:"space-y-1",children:[jsxs("div",{className:"flex justify-between items-center",children:[jsx("div",{className:"line-clamp-1 text-display-xs flex-shrink",children:(N==null?void 0:N.displayName)??(N==null?void 0:N.name)}),jsx("div",{children:jsx(Icon,{className:"text-display text-accent cursor-pointer",onClick:()=>m(!0),icon:"helpOutline"})})]}),jsx(ProgressBar,{progress:i,total:i+s+1,small:!0}),jsxs("div",{className:"flex justify-between items-center text-primary-500 text-sm",children:[jsxs("div",{className:"flex gap-1",children:[jsx(Icon,{icon:"clock"}),"1 min"]}),jsxs("div",{children:["Complete for ",d??"a reward"]})]})]}),jsx("div",{ref:r,className:classNames("flex flex-col gap-2 flex-1 min-h-0"),children:e.type==="content"?jsx(TrackContentSlide,{slide:e,elementsToAnimateRef:n},e.uuid):jsx(TrackQuestionSlide,{slide:e,elementsToAnimateRef:n},e.uuid)})]})});TrackSlide.displayName="TrackSlide";const TracksReward=({uuid:e,reward:t})=>{useRegisterEventOnMount("LEARNING_COMPLETE");const{data:r}=useGetMerchant(),{splitSignUp:n}=useEducationSignUpSettings(),[i,s]=reactExports.useState(!1),l=useClaimReward(),{id:d}=useTracksContext(),p=useIsSignedUp(),m=async()=>{await l.mutateAsync({type:"tracks",tracksID:d,uuid:e})},v=()=>{p?m():s(!0)},b=reactExports.useMemo(()=>{if(t.type==="discount")return t.discount.customQualifierText?null:getDiscountPriceQualifiers(t.discount,r.shopInfo);if(t.type==="freeShipping")return getFreeShippingQualifiers(t.freeShipping,r.shopInfo);if(t.type==="custom")return t.custom.subtitle;assertNever(t)},[t,r.shopInfo]),S=isInstagram();return jsx(Layout$1,{left:jsx("div",{children:"You earned a reward!"}),children:i?jsx("div",{className:classNames("flex-1 flex flex-col",S?"justify-end space-y-3":"space-y-3"),children:jsx(SetProfileForm,{onComplete:async()=>{await m(),s(!1)},source:{type:"widget"},split:n})}):jsxs("div",{className:"flex flex-col justify-center items-center gap-5 flex-1",children:[jsx("div",{className:"text-display-xs text-center leading-5",children:"Congrats! You've earned"}),jsxs("div",{className:"flex flex-col gap-1",children:[jsx("div",{className:"text-display-xl text-center",children:getRewardText(t,r.shopInfo)}),jsxs("div",{className:"flex flex-col gap-0.5",children:[t.type==="discount"&&jsxs("div",{className:"text-center font-medium",children:[" ",getItemsDescriptor(t.discount)]}),b&&jsx("div",{className:"text-primary-500 text-sm text-center",children:b})]})]}),jsxs(Button,{variant:"primary",onClick:v,disabled:l.isLoading,children:["Claim my reward",jsx(Icon,{icon:"arrowRight"})]}),jsx("div",{className:"h-8"})]})})},{useContext:useTracksContext,Provider:TracksProvider}=createContextWithoutDefault("tracks"),Tracks=reactExports.forwardRef(({config:e,preview:t},r)=>{useRegisterEventOnMount("LEARNING_STARTED");const{data:n}=useGetUser(),{data:i}=useGetTracksByID(e==null?void 0:e.tracksID),[s,l]=reactExports.useState({slides:{}}),d=n.isMerchantPreview?i==null?void 0:i.data:i==null?void 0:i.publicData;return!i||!d?jsx("div",{children:"No Tracks found"}):jsx(TracksProvider,{value:{id:i.id,config:e,preview:t,tracksData:d,tracksState:s,setTracksState:l},children:jsx(TracksPosition,{ref:r})})});Tracks.displayName="Tracks";const TracksPosition=reactExports.forwardRef((e,t)=>{const{tracksState:r,setTracksState:n}=useTracksContext(),i=useTracksPosition();return useSyncTracksState(),reactExports.useEffect(()=>{(i==null?void 0:i.type)==="error"&&Object.keys(r.slides).length>0&&(logger.log("Error in tracks:",i.message),n({slides:{}}))},[n,i,r]),i?i.type==="error"?jsx("div",{children:i.message}):i.type==="reward"?jsx(TracksReward,{reward:i.reward,uuid:i.uuid}):jsx(TrackSlide,{ref:t,slide:i.slide}):jsx(Loading,{})});TracksPosition.displayName="TracksPosition";const CopyNode=reactExports.forwardRef(({id:e,node:t},r)=>{var D;const{isPreview:n}=usePopupPreviewContext(),i=useClaimReward(),s=useClaimedReward(),{data:l}=useGetAllRewards(),d=l==null?void 0:l.find(P=>P.id===t.rewardID),p=reactExports.useRef(!1);reactExports.useEffect(()=>{n||!t.rewardID||s||p.current||(p.current=!0,i.mutate({type:"popupTemplate",rewardID:t.rewardID,showModal:!1,step:"popup"}))},[n,t.rewardID,i,s]);const[m,v]=reactExports.useState(!1),b=(()=>{if(!t.rewardID)return t.text;if(s)return s.shopifyCode;if((d==null?void 0:d.config.type)==="custom")return d.config.custom.shopifyCode})(),$=b??(n?"ALXXXXXXXX...":"GENERATING..."),N=reactExports.useCallback(()=>{b&&new ShopifyUtils().applyCode(b)},[b]);return reactExports.useEffect(()=>{t.applyImmediately&&N()},[t.applyImmediately,N]),jsxs(ClickableDiv,{id:e,ref:r,onClick:()=>{b&&(navigator.clipboard.writeText(b),v(!0),N())},className:classNames((D=t.styles)==null?void 0:D.classes),children:[$,jsx(Icon,{icon:m?"checkmark":"copy"})]})});CopyNode.displayName="CopyNode";function parseShopifyGqlID(e){return t=>{const r=t.split("/"),n=r.pop(),i=r.pop();if(n){if(i!==e)throw new Error(`Expected Shopify GQL ID of type ${e}, got ${i}`);return t}else throw new Error(`Invalid Shopify GQL ID ${t}`)}}function gqlToRestID(e){return t=>{const r=t.split("/"),n=r.pop(),i=r.pop();if(!n||!i||i!==e)throw new Error(`Invalid Shopify GQL ID ${t}`);return n}}const useClosePopupAction=()=>{const{onClosePopup:e}=usePopupContext();return t=>{e==null||e({type:"action",action:t})}},usePopupStepAction=()=>{const{setStepID:e,stepID:t,history:r,template:n}=usePopupContext();return i=>{if(n)if(i.step.type==="step")e==null||e(i.step.stepID,{type:"action",action:i});else if(i.step.type==="mostRecent"){const s=r==null?void 0:r.reverse().find(l=>l!==t&&getSteps(n).some(({id:d})=>d===l));e==null||e(s??i.step.otherwise,{type:"action",action:i})}else if(i.step.type==="next"){if(t&&n){const s=getSteps(n).findIndex(d=>d.id===t),l=getSteps(n).at(s+1);l&&(e==null||e(l.id,{type:"action",action:i}))}}else assertNever(i.step)}},usePopupFloatingButtonAction=()=>{const e=useClosePopupAction(),{setStepID:t,template:r}=usePopupContext();return n=>{if(!r)return;const i=n.stepID,s=getFloatingButtons(r);s.find(d=>d.id===i)?t==null||t(i,{type:"action",action:n}):s.length>0?t==null||t(s[0].id,{type:"action",action:n}):e(DEFAULT_CLOSE_POPUP_ACTION)}},usePopupRewardAction=()=>{const{onClosePopup:e}=usePopupContext(),t=useClaimReward(),r=useApplyCode({onRedirected:()=>e==null?void 0:e({type:"redirect"})});return async n=>{const i=await t.mutateAsync({type:"popupTemplate",step:"popup",rewardID:n.rewardID,updateCache:n!=null&&n.applyImmediately?!1:void 0,showModal:!0});n.applyImmediately&&(r(i),e==null||e({type:"action",action:n}))}},usePopupPollAnswerAction=()=>{const e=useCreatePollAnswer();return async t=>{await e({questionUUID:t.questionUUID,questionText:t.questionText,answerUUID:t.answerUUID,answer:t.answer})}},useAddToCartAction=()=>e=>{new ShopifyUtils().addToCart(e.variantIDs.map(t=>{const r=parseShopifyGqlID("ProductVariant")(t);return gqlToRestID("ProductVariant")(r)}))},usePopupTapToTextAction=()=>{const{mutateAsync:e}=useRegisterEvent();return t=>{t.tapToText&&e({metric:"SIGNUP_PHONE",once:!0}),openLink(t.url,t.newTab?"_blank":"_parent")}},openLink=(e,t)=>{const r=getDocument().createElement("a");r.href=e,r.target=t,r.rel="noopener noreferrer",getDocument().body.appendChild(r),r.click(),getDocument().body.removeChild(r)},usePopupCustomCodeAction=()=>{const e=useEvaluateWithAliaObject();return async t=>{await e(t.code)}};function useExecutePopupActions(e){const t=useClosePopupAction(),r=usePopupStepAction(),n=usePopupFloatingButtonAction(),i=usePopupRewardAction(),s=usePopupPollAnswerAction(),l=useAddToCartAction(),d=usePopupTapToTextAction(),p=usePopupCustomCodeAction();return async m=>{const v=e??m;if(v)for(const b of v)b.type==="closePopup"?t(b):b.type==="step"?r(b):b.type==="floatingButton"?n(b):b.type==="reward"?await i(b):b.type==="pollAnswer"?await s(b):b.type==="addToCart"?l(b):b.type==="tapToText"?d(b):b.type==="customCode"?p(b):assertNever(b)}}function useAliaObject(){const e=usePopupStepAction(),t=useClosePopupAction(),{data:r}=useGetUser(),n=useMediatorState();return reactExports.useMemo(()=>({$alia:{user:{...r,...n==null?void 0:n.user},popup:{step:i=>e(i?{type:"step",step:{type:"step",stepID:i}}:{type:"step",step:{type:"next"}}),closePopup:()=>t(DEFAULT_CLOSE_POPUP_ACTION)}}}),[e,t,r,n])}function useEvaluateWithAliaObject(){const{$alia:e}=useAliaObject(),{mediator:t}=useCustomerAppContext(),{mutateAsync:r}=useLogError();return reactExports.useCallback(async n=>{const i=safeEval(`(async ($alia) => { ${n} })`);try{await i({...e,user:{...e.user,...t==null?void 0:t.state.user}})}catch(s){r({message:"Error evaluating code with $alia object",data:{code:n,error:unknownErrToStr(s)}})}},[e,t,r])}function useCustomCodeScriptArgs(){const{root:e}=useCustomerAppContext(),t=useExecutePopupActions(),{$alia:r}=useAliaObject(),n=reactExports.useMemo(()=>({document:e,mainDocument:getDocument(),hooks:{nextStep:()=>{t([{type:"step",step:{type:"next"}}])}},$alia:r}),[t,e,r]),i=reactExports.useCallback((s,l)=>{for(const d of CUSTOM_CODE_ARGS_KEYS)l=l.replaceAll(d,`window["${s}"].${d}`);return l},[]);return{args:n,replaceArgsReferences:i}}const CustomCodeNode=reactExports.forwardRef(({id:e,node:t},r)=>{const{isPreview:n,sizeOverride:i}=usePopupPreviewContext(),{root:s}=useCustomerAppContext(),{styles:l,onClick:d,onMouseEnter:p,onMouseLeave:m}=usePreviewNodeContext(),{args:v,replaceArgsReferences:b}=useCustomCodeScriptArgs(),S=`alia-custom-code-args-${e}`;reactExports.useEffect(()=>(window[S]=v,()=>{delete window[S]}),[v,S]),reactExports.useEffect(()=>{if(n)return;const D=getDocument().createElement("div");D.innerHTML=t.code;const P=D.querySelectorAll("script"),F=Array.from(P).map(q=>{const H=getDocument().createElement("script");return H.textContent=b(S,q.textContent??""),Array.from(q.attributes).forEach(f=>{H.setAttribute(f.name,f.value)}),s.appendChild(H),q.remove(),()=>H.remove()});return()=>F.forEach(q=>q())},[n,s,b,S,t.code]);const{rootSelector:$}=useCustomerAppContext();reactExports.useEffect(()=>{const D=getDocument().createElement("div");D.innerHTML=transformCSSValue(t.code,i)??"";const P=D.querySelectorAll("style"),F=Array.from(P).map(q=>{var w;if(getDocument().head.appendChild(q),!((w=q.sheet)==null?void 0:w.cssRules))return;const f=getDocument().createElement("style");if(s.appendChild(f),!!f.sheet)return copyAndScopeStyles(q.sheet,f.sheet,$),q.remove(),()=>f.remove()});return()=>F.forEach(q=>q==null?void 0:q())},[$,t.code,s,i]);const N=reactExports.useMemo(()=>t.code.replaceAll(/)<[^<]*)*<\/script>/gi,"").replaceAll(/)<[^<]*)*<\/style>/gi,""),[t.code]);return jsx("div",{id:e,ref:r,dangerouslySetInnerHTML:{__html:N},style:l,onClick:d,onMouseEnter:p,onMouseLeave:m})});CustomCodeNode.displayName="CustomCodeNode";function copyAndScopeStyles(e,t,r){for(const n of e.cssRules)if(n instanceof CSSStyleRule){const i=addScopeToSelector(n.selectorText,r);t.insertRule(`${i} { ${n.style.cssText} }`,t.cssRules.length)}else t.insertRule(n.cssText)}var webfontloader={exports:{}},hasRequiredWebfontloader;function requireWebfontloader(){return hasRequiredWebfontloader||(hasRequiredWebfontloader=1,function(e){(function(){function t(I,V,se){return I.call.apply(I.bind,arguments)}function r(I,V,se){if(!I)throw Error();if(2=V.f?Te():I.fonts.load(w(V.a),V.h).then(function(Fe){1<=Fe.length?ye():setTimeout(we,25)},function(){Te()})}we()}),j=null,pe=new Promise(function(ye,Te){j=setTimeout(Te,V.f)});Promise.race([pe,T]).then(function(){j&&(clearTimeout(j),j=null),V.g(V.a)},function(){V.j(V.a)})};function ae(I,V,se,T,j,pe,ye){this.v=I,this.B=V,this.c=se,this.a=T,this.s=ye||"BESbswy",this.f={},this.w=j||3e3,this.u=pe||null,this.m=this.j=this.h=this.g=null,this.g=new E(this.c,this.s),this.h=new E(this.c,this.s),this.j=new E(this.c,this.s),this.m=new E(this.c,this.s),I=new f(this.a.c+",serif",C(this.a)),I=W(I),this.g.a.style.cssText=I,I=new f(this.a.c+",sans-serif",C(this.a)),I=W(I),this.h.a.style.cssText=I,I=new f("serif",C(this.a)),I=W(I),this.j.a.style.cssText=I,I=new f("sans-serif",C(this.a)),I=W(I),this.m.a.style.cssText=I,Y(this.g),Y(this.h),Y(this.j),Y(this.m)}var O={D:"serif",C:"sans-serif"},ne=null;function xe(){if(ne===null){var I=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);ne=!!I&&(536>parseInt(I[1],10)||parseInt(I[1],10)===536&&11>=parseInt(I[2],10))}return ne}ae.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=i(),Ee(this)};function $e(I,V,se){for(var T in O)if(O.hasOwnProperty(T)&&V===I.f[O[T]]&&se===I.f[O[T]])return!0;return!1}function Ee(I){var V=I.g.a.offsetWidth,se=I.h.a.offsetWidth,T;(T=V===I.f.serif&&se===I.f["sans-serif"])||(T=xe()&&$e(I,V,se)),T?i()-I.A>=I.w?xe()&&$e(I,V,se)&&(I.u===null||I.u.hasOwnProperty(I.a.c))?ge(I,I.v):ge(I,I.B):be(I):ge(I,I.v)}function be(I){setTimeout(n(function(){Ee(this)},I),50)}function ge(I,V){setTimeout(n(function(){m(this.g.a),m(this.h.a),m(this.j.a),m(this.m.a),V(this.a)},I),0)}function ve(I,V,se){this.c=I,this.a=V,this.f=0,this.m=this.j=!1,this.s=se}var Ie=null;ve.prototype.g=function(I){var V=this.a;V.g&&v(V.f,[V.a.c("wf",I.c,C(I).toString(),"active")],[V.a.c("wf",I.c,C(I).toString(),"loading"),V.a.c("wf",I.c,C(I).toString(),"inactive")]),K(V,"fontactive",I),this.m=!0,De(this)},ve.prototype.h=function(I){var V=this.a;if(V.g){var se=b(V.f,V.a.c("wf",I.c,C(I).toString(),"active")),T=[],j=[V.a.c("wf",I.c,C(I).toString(),"loading")];se||T.push(V.a.c("wf",I.c,C(I).toString(),"inactive")),v(V.f,T,j)}K(V,"fontinactive",I),De(this)};function De(I){--I.f==0&&I.j&&(I.m?(I=I.a,I.g&&v(I.f,[I.a.c("wf","active")],[I.a.c("wf","loading"),I.a.c("wf","inactive")]),K(I,"active")):re(I.a))}function Ve(I){this.j=I,this.a=new J,this.h=0,this.f=this.g=!0}Ve.prototype.load=function(I){this.c=new s(this.j,I.context||this.j),this.g=I.events!==!1,this.f=I.classes!==!1,Be(this,new k(this.c,I),I)};function Xe(I,V,se,T,j){var pe=--I.h==0;(I.f||I.g)&&setTimeout(function(){var ye=j||null,Te=T||null||{};if(se.length===0&&pe)re(V.a);else{V.f+=se.length,pe&&(V.j=pe);var we,Fe=[];for(we=0;wet("GET","/fonts",{}),initialData:e.fonts,staleTime:1/0})}function loadGoogleFont(e){return webfontloaderExports.load({google:{families:[`${e}:400,500,600,700,800,900`]}}),e}const fontVariantMap={normal300:{style:"normal",weight:"300"},normal400:{style:"normal",weight:"400"},normal500:{style:"normal",weight:"500"},normal600:{style:"normal",weight:"600"},normal700:{style:"normal",weight:"700"},normal800:{style:"normal",weight:"800"},normal900:{style:"normal",weight:"900"},italic300:{style:"italic",weight:"300"},italic400:{style:"italic",weight:"400"},italic500:{style:"italic",weight:"500"},italic600:{style:"italic",weight:"600"},italic700:{style:"italic",weight:"700"},italic800:{style:"italic",weight:"800"},italic900:{style:"italic",weight:"900"}};function loadCustomFont(e){const t=`Alia-${e.name.replace(/ /g,"-")}`;return n(t,e).forEach(async i=>{try{await i.load().catch(),getDocument().fonts.add(i)}catch(s){console.error(`Alia failed to load ${e.name} ${i.weight} (${i.style}): ${s}`)}}),t;function n(i,s){const l=[];for(const d in fontVariantMap){const p=s[d],m=fontVariantMap[d];p&&l.push(new FontFace(i,p,m))}return l}}function useLoadFonts(e){const{data:t}=useGetAllFonts(),r=reactExports.useCallback((n,i,s)=>{const l=t==null?void 0:t.find(p=>p.name===n),d=l?loadCustomFont(l):loadGoogleFont(n);s.default.appendStyles(e,{[i]:`${d}, sans-serif`})},[t,e]);return reactExports.useCallback((n,i)=>{r(n.body,dumpFontVariable("--body-font"),i),r(n.display,dumpFontVariable("--display-font"),i);for(let s=0;s{var v,b,S;if(!i)return;loadColors((t==null?void 0:t.colors)??i.colors,n,l),loadBorderRadius((t==null?void 0:t.borderRadius)??i.borderRadius,n,l),s((t==null?void 0:t.fonts)??i.fonts,l);const d={text:((v=t==null?void 0:t.styles)==null?void 0:v.text)??i.styles.text,button:((b=t==null?void 0:t.styles)==null?void 0:b.button)??i.styles.button,input:((S=t==null?void 0:t.styles)==null?void 0:S.input)??i.styles.input};loadStyles(d,n,l);const m=($=>$.text.find(N=>N.handle===BODY_DEFAULT_HANDLE))(d);m&&l.appendBreakpoint(n,m.styles)},[t,n,s,i]))}function loadColors(e,t,r){const{primary:n,accent:i,background:s,accentForeground:l}=e;r.default.appendStyles(t,{"--accent-foreground":hexToRGB(l),"--accent-color":hexToRGB(i),"--primary-color":hexToRGB(n),"--background-color":hexToRGB(s)});for(let d=0;d(parseInt(P)+q).toString();D==="body"?r.default.appendStyles(t,{[`--${D}-font-weight-normal`]:P,[`--${D}-font-weight-medium`]:P,[`--${D}-font-weight-semibold`]:F(100),[`--${D}-font-weight-bold`]:F(200)}):r.default.appendStyles(t,{[`--${D}-font-weight-normal`]:F(-100),[`--${D}-font-weight-medium`]:F(-100),[`--${D}-font-weight-semibold`]:P,[`--${D}-font-weight-bold`]:F(100)})}function S(D,P="1.1"){r.default.appendStyles(t,{[`--${D}-line-height-xs`]:P,[`--${D}-line-height-sm`]:P,[`--${D}-line-height-base`]:P,[`--${D}-line-height-lg`]:P,[`--${D}-line-height-xl`]:P})}function $(D,P="0px"){r.default.appendStyles(t,{[`--${D}-letter-spacing`]:P})}}}const{Provider:Provider$7,useContext:useContext$6}=createContextWithDefault({modal:!1}),useModalContext=useContext$6,Modal=({show:e,onClose:t,children:r,title:n,showCloseButton:i=!0})=>e?jsx(Provider$7,{value:{modal:!0},children:jsx("div",{className:"absolute top-0 right-0 bottom-0 left-0 backdrop-blur-sm backdrop-brightness-75 rounded-lg flex flex-col justify-center items-center z-50",children:jsxs("div",{className:"w-5/6 animate-fade-in-up animation-duration-150 max-w-sm p-5 bg-background shadow-2xl rounded-lg flex flex-col",children:[jsxs("div",{className:"w-full flex justify-between items-start gap-2 mb-2",children:[jsx("p",{className:"text-lg font-medium leading-6",children:n}),i&&jsx(Icon,{icon:"close",className:"text-display-sm cursor-pointer leading-4",onClick:t})]}),jsx("div",{className:"w-full flex flex-col flex-1",children:r})]})})}):null,CustomRewardCTA=({config:e})=>{var r,n;const t=(r=e.cta)==null?void 0:r.url;return t?jsx(Button,{onClick:()=>window.open(t,"_parent"),variant:"primary",children:(n=e.cta)==null?void 0:n.text}):null},ClaimedRewardProduct=({id:e,title:t})=>{const{data:r}=useGetProductUrl({id:e});return jsx(Button,{inline:!0,variant:"plain",onClick:()=>window.open(r,"_blank"),children:t})},DiscountItems=({items:e})=>e.type==="all"?null:e.customDescriptor?jsx(CustomDescriptor,{descriptor:e.customDescriptor}):e.type==="products"?jsxs("div",{className:"text-center",children:[e.products.slice(0,2).map((t,r)=>jsxs(reactExports.Fragment,{children:[r>0&&e.products.length>2&&", ",e.products.length>1&&r===e.products.length-1&&" and ",jsx(CommonErrorBoundary,{fallback:jsx("span",{children:t.title}),children:jsx(reactExports.Suspense,{fallback:jsx("span",{children:t.title}),children:jsx(ClaimedRewardProduct,{...t})})})]},t.id)),e.products.length>2&&jsxs("span",{children:[" ","and ",e.products.length-2," more"," ",e.products.length===1?"product":"products"]})]}):jsx(Fragment,{children:getCollectionsDescriptor(e)}),CustomDescriptor=({descriptor:{url:e,descriptor:t}})=>e?jsx(Button,{inline:!0,variant:"plain",onClick:()=>window.open(e,"_parent"),children:t}):jsx("span",{children:t});function useRewardExpirationTimer(e){const t=reactExports.useMemo(()=>{if(!e)return;const s=(new Date(e).getTime()-Date.now())/1e3;return Math.max(0,Math.floor(s))},[e]),[r,n]=reactExports.useState(t??0);return reactExports.useEffect(()=>{t!==void 0&&n(t)},[t]),reactExports.useEffect(()=>{if(!e)return;const i=setInterval(()=>{n(s=>Math.max(0,s-1))},1e3);return()=>clearInterval(i)},[e]),r}const DANGER_THRESHOLD_SECS=5*60,ExpirationCountDown=({expiresAt:e})=>{const t=useRewardExpirationTimer(e),r=getTimeRemainingStr(t);return e?jsxs("div",{className:classNames("flex flex-col items-center gap-2",t{const{data:r}=useGetMerchant(),{data:n}=useGetUser(),i=getRewardConfigProperty(e.config,"hideDiscountCode"),{data:s}=useGetIsOptedIn(i==="email"&&n.hasEmail?"email":i==="sms"&&n.hasPhone?"phone":void 0),l=s===!1,d=e.config.type==="discount"?e.config.discount.items.type==="all"?null:jsx(DiscountItems,{items:e.config.discount.items}):e.config.type==="freeShipping"?getFreeShippingQualifiers(e.config.freeShipping,r.shopInfo).toLowerCase():e.config.type==="custom"?null:assertNever(e.config),p=e.config.type==="discount"?e.config.discount.customQualifierText?null:getDiscountPriceQualifiers(e.config.discount,r.shopInfo):e.config.type==="custom"?e.config.custom.subtitle:null,m=e.config.type==="discount"?e.config.discount.customQualifierText||getDiscountStackingQualifiers(e.config.discount):void 0;return jsx(Modal,{show:!0,showCloseButton:!!t,onClose:t,children:jsxs("div",{className:"flex flex-col gap-6 mt-2 justify-center items-center flex-1",children:[jsxs("div",{className:"flex flex-col gap-2.5",children:[jsx("div",{className:"text-center",children:"Congrats! You've earned"}),jsxs("div",{className:"space-y-2",children:[jsx("div",{className:"text-center text-display-xl",children:getRewardText(e.config,r.shopInfo)}),d&&jsx("div",{className:"text-center text-sm",children:d}),p&&jsx("div",{className:"text-primary-500 text-sm text-center",children:p})]})]}),l?jsxs(Fragment,{children:[jsx(ClaimedRewardDivider,{}),jsx("div",{className:"text-center flex flex-col gap-1.5",children:i==="email"?jsxs(Fragment,{children:[jsx("div",{children:"We've sent your discount code to the email you provided"}),jsx("div",{className:"text-primary-500 text-xs",children:"If you don't see it, check your spam folder"})]}):jsxs(Fragment,{children:[jsx("div",{className:"text-display",children:"Check your texts"}),jsxs("div",{className:"text-sm font-normal",children:[jsx("span",{className:"font-bold",children:'Reply "Y"'})," to receive your discount code"]})]})}),jsx(ClaimedRewardDivider,{})]}):e.used?jsx("div",{className:"text-center",children:"You've already used this reward."}):jsx(Fragment,{children:jsx(ShopifyCode,{claimedReward:e,onClose:t})}),e.config.type==="custom"&&jsx(CustomRewardCTA,{config:e.config.custom}),jsx(ExpirationCountDown,{expiresAt:e.expiresAt}),m&&jsx("div",{className:"text-primary-400 text-xs leading-4 text-center",children:m})]})})},ClaimedRewardDivider=()=>jsx("div",{className:"self-center w-2/3 h-px bg-accent-100 -my-1"}),DivNode=reactExports.forwardRef(({id:e,node:t,children:r},n)=>useIsRootNode()?jsx(PopupRoot,{node:t,id:e,ref:n,children:r}):jsx(DivNodeInner,{id:e,node:t,ref:n,children:r}));DivNode.displayName="DivNode";const DivNodeInner=reactExports.forwardRef(({id:e,node:t,children:r,styles:n},i)=>{var v;const{styles:s,onClick:l,onMouseEnter:d,onMouseLeave:p}=usePreviewNodeContext(),m=useExecutePopupActions(t.onClickActions);return jsx("div",{id:e,ref:i,className:classNames((v=t.styles)==null?void 0:v.classes),style:{...s,...n},onClick:l??(b=>{var S;(S=t.onClickActions)!=null&&S.length&&b.target instanceof HTMLDivElement&&b.target.id===e&&(m(),b.stopPropagation())}),onMouseEnter:d,onMouseLeave:p,children:r})});DivNodeInner.displayName="DivNodeInner";const rootNodeStyles={inset:"unset",top:"unset",left:"unset",right:"unset",bottom:"unset",zIndex:"unset",width:"100%",height:"100%",maxWidth:"unset",maxHeight:"unset",minWidth:"unset",minHeight:"unset",rotate:"unset",transform:"unset",transformOrigin:"unset"},PopupRoot=reactExports.forwardRef(({node:e,id:t,children:r},n)=>{const{template:i,onClosePopup:s}=usePopupContext(),{setFrameStyles:l,setVisible:d}=useCustomerAppContext(),{sizeOverride:p}=usePopupPreviewContext(),m=`alia-popup-root-${t}`;useNewTheme(`#${m}`,i.themeOverride);const v=useClaimedReward(),b=useBreakpoint(),{preview:S}=useCustomerAppContext(),$=reactExports.useMemo(()=>{var H,f,w,g;const N=((f=(H=e.styles)==null?void 0:H.default)==null?void 0:f.default)??{},D=((g=(w=e.styles)==null?void 0:w[1024])==null?void 0:g.default)??{},P=b==="default"?N:{...N,...D},F=Object.keys(rootNodeStyles),q=Object.fromEntries(Object.entries(P).filter(([C])=>F.includes(C)));return Object.fromEntries(Object.entries(q).map(([C,_])=>[C,transformCSSValue(_,p)]))},[b,e.styles,p]);return reactExports.useEffect(()=>{const{modal:N}=e.rootOptions??DEFAULT_ROOT_OPTIONS,D=N!=null&&N.hideOverflow?{overflow:"hidden"}:{};return l({modal:!!N,styles:{...$,zIndex:S?void 0:$.zIndex},bodyStyles:D})},[l,$,e,S]),reactExports.useEffect(()=>(d(!0),()=>d(!1)),[d]),jsxs("div",{id:m,className:"w-full h-full",children:[jsx(CommonErrorBoundary,{children:jsxs(reactExports.Suspense,{children:[v&&v.config.showModal!==!1&&jsx(ClaimedReward,{claimedReward:v,onClose:()=>s({type:"oldClaimedRewardModal"})}),jsx(Toast,{})]})}),jsx(DivNodeInner,{id:t,node:e,ref:n,styles:rootNodeStyles,children:r})]})});PopupRoot.displayName="PopupRoot";function evalTemplateStrings({text:e,values:t,$alia:r,countdown:n}){if(!e)return"";const i=Object.entries(t).filter(([s])=>/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s)).map(([s,l])=>l==null?`const ${s} = null;`:`const ${s} = ${JSON.stringify(String(l))};`).join(` `);return e.replace(/\{\{(.*?)\}\}/g,(s,l)=>{const p=l.trim().replace(/\\_/g,"_").replace(/\\\[/g,"["),m=safeEval(`({ $alia, countdown }) => { ${i} return ${p} }`);try{const v=m({$alia:r,countdown:n});return v==null?"":String(v)}catch(v){return logger.error("Error evaluating template string",v),oldInject(e,t)}})}function oldInject(e,t){return e.replace(/{{([^}]+)}}/g,(r,n)=>{const i=n.trim(),s=i.replace(/\\_/g,"_"),l=t[i]??t[s];return(l==null?void 0:l.toString())??""})}const{Provider:Provider$6,useContext:useContext$5}=createContextWithDefault({});function useEvalTemplateStrings(){const{isPreview:e}=usePopupPreviewContext(),t=useClaimedReward(),r=useRewardExpirationTimer((t==null?void 0:t.expiresAt)??null),{$alia:n}=useAliaObject(),i=useContext$5(),s=useCountdown(),l=reactExports.useMemo(()=>{const d=p=>e?p:"";return{question_text:d("question_text"),answer_text:d("answer_text"),sms_consent:d("sms_consent"),...i,discount_code:(t==null?void 0:t.shopifyCode)??d("discount_code"),discount_expiration:t?getTimeRemainingStr(r):d("discount_expiration")}},[e,i,t,r]);return reactExports.useCallback(d=>evalTemplateStrings({text:d,values:l,$alia:n,countdown:s}),[l,n,s])}let start=null;function useCountdown(){const{isPreview:e}=usePopupPreviewContext(),[,t]=reactExports.useState(0),r=reactExports.useRef(null);return reactExports.useEffect(()=>{if(start)return r.current=setInterval(()=>{t(n=>n+1)},1e3),()=>{r.current&&clearInterval(r.current)}},[]),reactExports.useCallback(n=>{const i=(n.hours??0)*3600+(n.mins??0)*60+(n.secs??0);if(e)return formatCountdown(i);if(!start)return start=Date.now(),t(l=>l+1),formatCountdown(i);const s=i-Math.round((Date.now()-start)/1e3);return s<0?formatCountdown(0):formatCountdown(s)},[e])}function formatCountdown(e){const t=Math.floor(e/3600);e%=3600;const r=Math.floor(e/60);return e%=60,t>0?`${t}h ${r}m`:`${r}:${e.toString().padStart(2,"0")}`}const TextVariablesProvider=({children:e,...t})=>{const r=useContext$5();return jsx(Provider$6,{value:{...r,...t},children:e})},{Provider:Provider$5,useContext:useContext$4}=createContextWithoutDefault("question-node"),useQuestionNodeContext=useContext$4,QuestionNode=({node:e,children:t})=>jsx(TextVariablesProvider,{question_text:e.questionText,children:jsx(Provider$5,{value:{uuid:e.uuid,questionText:e.questionText},children:t})}),CHECKABLE_PREFIX="checkable_";function getCheckableAnswerName({questionUUID:e,answerUUID:t}){return`${CHECKABLE_PREFIX}${e}_${t}`}function getCheckableAnswerNameData(e){if(!e.startsWith(CHECKABLE_PREFIX))return;const[t,r]=e.split("_").slice(1);return{questionUUID:t,answerUUID:r}}function getAllCheckedAnswersInForm(e){const t=Object.entries(e).map(([i,s])=>r(i,s)).filter(Boolean);return{error:n(e),answers:t};function r(i,s){const l=getCheckableAnswerNameData(i);if(!l||!s)return;const{questionText:d,answer:p,checked:m}=s;if(m)return{questionUUID:l.questionUUID,questionText:d,answerUUID:l.answerUUID,answer:p}}function n(i){const s=Array.from(new Set(Object.keys(i).map(l=>getCheckableAnswerNameData(l)).filter(Boolean).map(l=>l.questionUUID)));if(s.some(l=>!t.some(d=>d.questionUUID===l)))return s.length===1?"Please choose an answer":"Please answer all questions"}}const CheckableAnswerController=({answerUUID:e,answer:t,render:r})=>{const{uuid:n,questionText:i}=useQuestionNodeContext(),s=getCheckableAnswerName({questionUUID:n,answerUUID:e}),{control:l}=useFormContext();return jsx(Controller,{name:s,control:l,shouldUnregister:!0,render:({field:d,fieldState:p,formState:m})=>{var v;return r({field:{...d,value:((v=d.value)==null?void 0:v.checked)??!1,onChange:b=>{typeof b=="boolean"&&d.onChange({questionText:i,answer:t,checked:b})}},fieldState:p,formState:m})}})},SINGLE_ANSWER_PREFIX="single_answer_";function getSingleAnswerName({questionUUID:e}){return`${SINGLE_ANSWER_PREFIX}${e}`}function getSingleAnswerNameData(e){return e.startsWith(SINGLE_ANSWER_PREFIX)?{questionUUID:e.slice(SINGLE_ANSWER_PREFIX.length)}:void 0}function getAllSingleAnswersInForm(e){return{error:void 0,answers:Object.entries(e).map(([n,i])=>r(n,i)).filter(Boolean)};function r(n,i){const s=getSingleAnswerNameData(n);if(!(!s||i==null||i===""))return{questionUUID:s.questionUUID,...i}}}const SingleAnswerController=({answerUUIDFactory:e,render:t,validationMessages:r})=>{const{uuid:n,questionText:i}=useQuestionNodeContext(),s=getSingleAnswerName({questionUUID:n}),{control:l,formState:{errors:d}}=useFormContext();return jsx(Controller,{name:s,control:l,rules:{required:!0},render:({field:p,fieldState:m,formState:v})=>{var b;return jsx(FormItem,{label:"",error:d[s],validationMessages:r,children:t({field:{...p,value:((b=p.value)==null?void 0:b.answer)??"",onChange:S=>{p.onChange({questionText:i,answer:S,answerUUID:e==null?void 0:e(S)})}},fieldState:m,formState:v})})}})};function getAllAnswersInForm(e){try{const{error:t,answers:r}=getAllCheckedAnswersInForm(e),{error:n,answers:i}=getAllSingleAnswersInForm(e);return t||n?{error:t||n,answers:[]}:{error:void 0,answers:[...r,...i]}}catch(t){return console.error(t),{error:void 0,answers:[]}}}const FORMATS={"DD-MM":{name:"date",regex:new RegExp(/^(0[1-9]|[12][0-9]|3[01])-(0[1-9]|1[0-2])$/),pattern:"##-##",autoComplete:"bday"},"MM-DD":{name:"date",regex:new RegExp(/^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/),pattern:"##-##",autoComplete:"bday"},"DD-MM-YYYY":{name:"date",regex:new RegExp(/^(0[1-9]|[12][0-9]|3[01])-(0[1-9]|1[0-2])-(19|20)\d{2}$/),pattern:"##-##-####",autoComplete:"bday"},"MM-DD-YYYY":{name:"date",regex:new RegExp(/^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])-(19|20)\d{2}$/),pattern:"##-##-####",autoComplete:"bday"},"YYYY-MM-DD":{name:"date",regex:new RegExp(/^(19|20)\d{2}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/),pattern:"####-##-##",autoComplete:"bday"},"DD/MM":{name:"date",regex:new RegExp(/^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])$/),pattern:"##/##",autoComplete:"bday"},"MM/DD":{name:"date",regex:new RegExp(/^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])$/),pattern:"##/##",autoComplete:"bday"},"DD/MM/YYYY":{name:"date",regex:new RegExp(/^(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[0-2])\/(19|20)\d{2}$/),pattern:"##/##/####",autoComplete:"bday"},"MM/DD/YYYY":{name:"date",regex:new RegExp(/^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/(19|20)\d{2}$/),pattern:"##/##/####",autoComplete:"bday"},"YYYY/MM/DD":{name:"date",regex:new RegExp(/^(19|20)\d{2}\/(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])$/),pattern:"####/##/##",autoComplete:"bday"},"ZIP-5":{name:"ZIP code",regex:new RegExp(/^\d{5}$/),pattern:"#####",autoComplete:"postal-code"}},FreeTextNode=reactExports.forwardRef(({id:e,className:t,node:r,sharedStyle:n},i)=>{const s=r.format?FORMATS[r.format]:void 0,{register:l,formState:{errors:d}}=useFormContext(),p=getFieldName(r.name),m=!r.optional;return jsx(FormItem,{label:r.label,required:m,error:d[p],validationMessages:r.validationMessages,ref:i,children:r.multiline?reactExports.createElement(TextArea,{id:e,className:t,...l(p,{required:m,shouldUnregister:!0}),key:p,placeholder:r.placeholder,error:!!d[p],sharedStyle:n}):s?reactExports.createElement(FormattedInput,{id:e,className:t,format:s.pattern,placeholder:r.placeholder,autoComplete:s.autoComplete,...l(p,{required:m,shouldUnregister:!0,pattern:{value:s.regex,message:`Invalid ${s.name}`},validate:v=>{var b;return validateAge((b=r.validationMessages)==null?void 0:b.minAge,v)}}),key:p,error:!!d[p],sharedStyle:n}):reactExports.createElement(Input,{id:e,className:t,...l(p,{required:m,shouldUnregister:!0}),key:p,placeholder:r.placeholder,error:!!d[p],sharedStyle:n})})});FreeTextNode.displayName="FirstNameInput";const PROPERTY_NAME_PREFIX="property_",getFieldName=e=>PROPERTY_NAME_PREFIX+encodeForRHF(e),getPropertyName=e=>decodeForRHF(e.replace(PROPERTY_NAME_PREFIX,""));function encodeForRHF(e){return encodeURIComponent(e).replace(/[']/g,"%27").replace(/["]/g,"%22").replace(/[`]/g,"%60")}function decodeForRHF(e){return decodeURIComponent(e).replace(/%27/g,"'").replace(/%22/g,'"').replace(/%60/g,"`")}function getAllProperties(e){return Object.entries(e).reduce((t,[r,n])=>(r.startsWith(PROPERTY_NAME_PREFIX)&&(t[getPropertyName(r)]=n),t),{})}function validateAge(e,t){if(!e)return;const{age:r,message:n}=e,i=new Date(t.replace(/-/g,"/"));if(isNaN(i.getTime()))return"Invalid date";const s=new Date,l=s.getFullYear()-i.getFullYear(),d=s.getMonth()-i.getMonth(),p=s.getDate()-i.getDate();if(l{var f;const i=reactExports.useRef(null);reactExports.useImperativeHandle(n,()=>i.current,[]);const s=useForm(),{handleSubmit:l,formState:{isSubmitting:d,errors:p},setError:m}=s,v=useSetProfile(),{data:b}=useGetUser(),S=useExecutePopupActions(),$=useCreateManyPollAnswers(),N=useCustomerAppContext().preview!==void 0,{onClick:D,styles:P,onMouseEnter:F,onMouseLeave:q}=usePreviewNodeContext();return jsx(Provider$4,{value:{isSubmitting:d,submit:()=>{var w,g;return(g=(w=i.current)==null?void 0:w.requestSubmit)==null?void 0:g.call(w)}},children:jsx(FormProvider,{...s,children:jsxs("form",{id:e,onSubmit:l(async w=>{var g,C;if(!N)try{const{error:_,answers:A}=getAllAnswersInForm(w);if(_){m("root",{message:t.errorMessage||_});return}A&&A.length>0&&await $({answers:A});const k=w.name||b.name,L=w.email,re=w.phone,K={...getAllProperties(w),...Object.fromEntries(((g=t.submitProperties)==null?void 0:g.map(E=>[E.key,E.value]))??[])};if(!k&&!L&&!re&&Object.keys(K).length===0){await S(t.afterSubmit);return}const{validationError:J,results:ee}=await v.mutateAsync({shouldSubscribe:t.subscribeImmediately,name:k,email:L,phone:re,source:{type:"popup"},properties:K,integrationOverrides:t.integrationOverrides,resultTypes:(C=t.afterSubmitBranches)==null?void 0:C.map(E=>E.if.type)});if(J){m(J.field,{message:J.message});return}for(const{if:E,then:Y}of t.afterSubmitBranches??[])if(Y.length>0&&ee.some(W=>W.type===E.type&&W.result===E.result)){await S(Y);return}await S(t.afterSubmit)}catch(_){console.error(_)}}),className:classNames("flex flex-col gap-3",(f=t.styles)==null?void 0:f.classes),ref:i,style:P,onClick:D,onMouseEnter:F,onMouseLeave:q,children:[p.root&&jsxs("div",{className:"bg-accent-900 text-accent-foreground p-3 rounded-lg flex items-center gap-2",children:[jsx(Icon,{icon:"error"}),p.root.message]}),r]})})})});FormNode.displayName="PopupForm";const Checkbox=reactExports.forwardRef(({value:e=!1,text:t,onChange:r,disabled:n=!1,...i},s)=>jsxs("label",{className:"gap-2 flex items-center relative",ref:s,...i,children:[jsx("input",{type:"checkbox",style:{width:"1em",height:"1em"},className:classNames("flex-shrink-0 appearance-none rounded border-2 border-accent-200 checked:border-accent-400 cursor-pointer disabled:cursor-default disabled:opacity-50","peer text-accent outline-none checked:bg-accent-800 transition-all duration-150 focus:ring-2 ring-accent-300"),disabled:n,checked:e,onChange:l=>{r(l.target.checked)}}),jsx(Icon,{icon:"checkmark",style:{width:"1em",height:"1em"},className:"invisible peer-checked:visible flex absolute justify-center items-center text-white cursor-pointer"}),t]}));Checkbox.displayName="Checkbox";const QuestionAnswerCheckboxNode=reactExports.forwardRef(({id:e,node:t},r)=>jsx(CheckableAnswerController,{answerUUID:t.uuid,answer:t.answerText,render:({field:n})=>jsx(Checkbox,{id:e,text:t.answerText,...n,ref:r})},e));QuestionAnswerCheckboxNode.displayName="QuestionAnswerCheckboxNode";const QuestionAnswerDropdownNode=reactExports.forwardRef(({id:e,node:t},r)=>{var m,v,b;const{styles:n,onClick:i,onMouseEnter:s,onMouseLeave:l}=usePreviewNodeContext(),d=(b=(v=(m=t.styles)==null?void 0:m.default)==null?void 0:v.default)==null?void 0:b.padding,p=reactExports.useRef(null);return jsx(SingleAnswerController,{validationMessages:t.validationMessages??{required:"Please choose an answer",invalid:"Please choose a valid answer"},answerUUIDFactory:S=>{var $;return($=t.answers.find(N=>N.text===S))==null?void 0:$.uuid},render:({field:S})=>{const $=t.answers.find(N=>(N.value??N.text)===S.value);return jsxs("button",{type:"button",id:e,ref:r,style:n,onClick:i,onMouseEnter:s,onMouseLeave:l,className:"relative","aria-controls":"dropdown-menu","aria-haspopup":"listbox",onKeyDown:N=>{var D;N.key===" "&&((D=p.current)==null||D.showPicker())},children:[jsx("div",{className:"flex-1 text-start",children:($==null?void 0:$.text)??t.placeholder??"Select an answer"}),jsx("div",{className:"flex items-center justify-center",children:jsx(Icon,{icon:"chevronDown"})}),jsxs("select",{...S,ref:N=>{p.current=N,S.ref(N)},onChange:N=>{S.onChange(N.target.value)},className:"opacity-0 absolute top-0 right-0 bottom-0 left-0 cursor-pointer",style:{padding:d},children:[jsx("option",{value:"",disabled:!0,children:t.placeholder??"Select an answer"}),t.answers.map(N=>jsx("option",{value:N.value??N.text,children:N.text},N.uuid))]})]})}})});QuestionAnswerDropdownNode.displayName="QuestionAnswerCheckboxNode";const QuestionAnswerNode=reactExports.forwardRef(({id:e,node:t},r)=>{const{uuid:n,questionText:i}=useQuestionNodeContext(),s=useCreatePollAnswer();return jsx(TextVariablesProvider,{answer_text:t.answerText,children:jsx(ButtonNode,{ref:r,id:e,node:t.button,onClick:async()=>(await s({questionUUID:n,questionText:i,answer:t.answerText,answerUUID:t.uuid}),!0)})})});QuestionAnswerNode.displayName="QuestionAnswerNode";const{Provider:Provider$3,useContext:useContext$3}=createContextWithDefault({}),usePreviewNodeContext=()=>useContext$3(),TemplateNodeContent=reactExports.forwardRef(({id:e,node:t,children:r,parentId:n},i)=>{var S,$,N,D,P;const{onNodeSelect:s,setHighlightedNode:l,isPreview:d}=usePopupPreviewContext(),{styles:p,onClick:m,onMouseEnter:v,onMouseLeave:b}=reactExports.useMemo(()=>({styles:s?{cursor:"default",pointerEvents:"all"}:{},onClick:F=>{e&&(F.stopPropagation(),s==null||s(e))},onMouseEnter:()=>{e&&(l==null||l(e))},onMouseLeave:()=>{e&&(l==null||l(n))}}),[e,s,n,l]);return jsx(Provider$3,{value:d?{styles:p,onClick:m,onMouseEnter:v,onMouseLeave:b}:{},children:t.type==="div"?jsx(DivNode,{id:e,node:t,ref:i,children:r}):t.type==="image"?jsx("img",{id:e,ref:i,src:t.source,alt:t.alt,className:classNames((S=t.styles)==null?void 0:S.classes),style:p,onClick:m,onMouseEnter:v,onMouseLeave:b}):t.type==="nameInput"?jsx(FirstNameInput,{id:e,ref:i,required:t.required,placeholder:t.placeholder,validationMessages:t.validationMessages,className:classNames(($=t.styles)==null?void 0:$.classes),sharedStyle:t.sharedStyle}):t.type==="emailInput"?jsx(EmailInput,{id:e,ref:i,required:t.required,placeholder:t.placeholder,validationMessages:t.validationMessages,className:classNames((N=t.styles)==null?void 0:N.classes),sharedStyle:t.sharedStyle}):t.type==="phoneInput"?jsx(PhoneInput,{id:e,ref:i,required:t.required,defaultCountryCode:t.defaultCountryCode,placeholder:t.placeholder,validationMessages:t.validationMessages,className:classNames((D=t.styles)==null?void 0:D.classes),sharedStyle:t.sharedStyle}):t.type==="freeText"?jsx(FreeTextNode,{id:e,node:t,ref:i,className:classNames((P=t.styles)==null?void 0:P.classes),sharedStyle:t.sharedStyle}):t.type==="form"?jsx(FormNode,{id:e,node:t,ref:i,children:r}):t.type==="text"?jsx(TextNode,{id:e,node:t,ref:i}):t.type==="button"?jsx(ButtonNode,{id:e,node:t,ref:i}):t.type==="icon"?jsx(IconNode,{id:e,node:t,ref:i}):t.type==="span"?jsx(SpanNode,{id:e,node:t,ref:i}):t.type==="break"?jsx("br",{}):t.type==="copy"?jsx(CopyNode,{id:e,node:t,ref:i}):t.type==="question"?jsx(QuestionNode,{node:t,children:r}):t.type==="questionAnswer"?jsx(QuestionAnswerNode,{id:e,node:t,ref:i}):t.type==="questionAnswerCheckbox"?jsx(QuestionAnswerCheckboxNode,{id:e,node:t,ref:i}):t.type==="questionAnswerDropdown"?jsx(QuestionAnswerDropdownNode,{id:e,node:t,ref:i}):t.type==="customCode"?jsx(CustomCodeNode,{id:e,node:t}):t.type==="outlet"?jsx(OutletNode,{parentId:n}):t.type==="lessons"?jsx(EducationSignUpSettingsProvider,{value:t.signUp,children:jsx(Lessons,{config:t.config,preview:t.preview})}):t.type==="tracks"?jsx(EducationSignUpSettingsProvider,{value:t.signUp,children:jsx(Tracks,{ref:i,config:t.config,preview:t.preview})}):assertNever(t)})});TemplateNodeContent.displayName="TemplateNodeV2";const TextNode=reactExports.forwardRef(({id:e,node:t},r)=>{var v;const n=useEvalTemplateStrings(),{styles:i,onClick:s,onMouseEnter:l,onMouseLeave:d}=usePreviewNodeContext(),p=t.markdown?n(t.markdown):"",m=useHTMLFromMarkdown(p);return jsx("div",{id:e,ref:r,className:classNames(SHARED_STYLE_CLASSNAME(t.sharedStyle),(v=t.styles)==null?void 0:v.classes),style:i,onClick:s,onMouseEnter:l,onMouseLeave:d,dangerouslySetInnerHTML:{__html:m}})});TextNode.displayName="TextNode";const SpanNode=reactExports.forwardRef(({id:e,node:t},r)=>{var p;const n=useEvalTemplateStrings(),{styles:i,onClick:s,onMouseEnter:l,onMouseLeave:d}=usePreviewNodeContext();return jsx("span",{id:e,ref:r,className:classNames((p=t.styles)==null?void 0:p.classes),style:i,onClick:s,onMouseEnter:l,onMouseLeave:d,children:n(t.text)})});SpanNode.displayName="SpanNode";const IconNode=reactExports.forwardRef(({id:e,node:t},r)=>{var s;const n=useExecutePopupActions(t.actions),i=t.actions.some(l=>l.type==="closePopup"||l.type==="floatingButton")?"Close popup":void 0;return jsx(ClickableDiv,{id:e,ref:r,onClick:n,className:classNames((s=t.styles)==null?void 0:s.classes),"aria-label":i,children:jsx(Icon,{icon:t.icon})})});IconNode.displayName="IconNode";const ButtonNode=reactExports.forwardRef(({id:e,node:t,children:r,...n},i)=>{var b;const[s,l]=reactExports.useState(!1),d=useExecutePopupActions(),p=useEvalTemplateStrings(),{isSubmitting:m,submit:v}=useFormNodeContext()??{};return jsx(Button,{...n,className:classNames((b=t.styles)==null?void 0:b.classes),sharedStyle:t.sharedStyle,id:e,type:t.submit?"submit":"button",onClick:async()=>{var $;l(!0),await(($=n.onClick)==null?void 0:$.call(n))!==!1&&await d(t.actions),l(!1),t.submit&&(v==null||v())},disabled:s||n.disabled||m,variant:t.variant,ref:i,children:r??jsxs(Fragment,{children:[t.icon&&jsx(Icon,{icon:t.icon,inButton:!0,onClick:S=>{var $;($=t.iconActions)!=null&&$.length&&(d(t.iconActions),S.stopPropagation())}}),p(t.text),t.rightIcon&&jsx(Icon,{icon:t.rightIcon,inButton:!0,onClick:S=>{var $;($=t.rightIconActions)!=null&&$.length&&(d(t.rightIconActions),S.stopPropagation())}})]})})});ButtonNode.displayName="ButtonNode";function getPositionRelativeToAncestor(e,t){let r=0,n=0,i=e;for(;i&&t.contains(i);){if(r+=i.offsetLeft,n+=i.offsetTop,!i.offsetParent)return{x:0,y:0};i=i.offsetParent}return{x:r,y:n}}const TemplateNode=({node:{id:e,node:t,children:r},parentId:n})=>{const i=reactExports.useRef(null),s=reactExports.useRef(null),l=useOutletNodeContext(),d=useCustomerAppContext().root,p=d.querySelector(`#${PREVIEW_POPUP_PORTAL_ID}`),{highlightedNode:m,selectedNode:v,isPreview:b}=usePopupPreviewContext();reactExports.useEffect(()=>{if(!s.current||!b)return;let N=!1;if(i.current){const{x:P,y:F}=getPositionRelativeToAncestor(i.current,d),{offsetWidth:q,offsetHeight:H}=i.current;(q||H)&&(N=!0,s.current.style.top=`${F-4}px`,s.current.style.left=`${P-4}px`,s.current.style.width=`${q+4*2}px`,s.current.style.height=`${H+4*2}px`)}const D=N?v===e?1:m===e?.6:0:0;s.current.style.zIndex=D>0?"50":"0",s.current.style.opacity=D.toString(),s.current.style.borderRadius="4px"},[b,v,m,e,d]);const S=!l,$=jsxs(reactExports.Suspense,{children:[b&&p&&reactDomExports.createPortal(jsx("div",{className:"absolute border border-accent-foreground ring-2 ring-accent-900 pointer-events-none transition-opacity duration-100 opacity-0",ref:s}),p),jsx(TemplateNodeContent,{id:e,node:t,ref:i,parentId:n,children:jsx(TemplateV2NodeChildren,{nodes:r,id:e})})]});return S?$:jsx(CommonErrorBoundary,{children:$})},{useContext:useContext$2,Provider:RootNodeProvider}=createContextWithDefault(!0),useIsRootNode=useContext$2,TemplateV2NodeChildren=({id:e,nodes:t})=>{var i;const r=(i=useOutletNodeContext())==null?void 0:i.rootId,n=e??r??null;return jsx(RootNodeProvider,{value:!1,children:t!=null&&t.length?t.map((s,l)=>jsx(TemplateNode,{parentId:n,node:s},l)):null})},{useOptionalContext,Provider:Provider$2}=createContextWithoutDefault("layout"),useLayoutContext=useOptionalContext,Layout=({id:e,children:t})=>{const{template:r}=usePopupContext(),n=r.layouts.find(i=>i.id===e);if(!n)throw new Error(`Layout ${e} not found`);return jsx(Provider$2,{value:{children:t},children:jsx(TemplateNode,{parentId:null,node:n.children})})};let hasRecordedView=!1;function useRecordOldPopupView(e=!0){const{mutate:t}=useRegisterEvent();reactExports.useEffect(()=>{const r=()=>{hasRecordedView||!e||(hasRecordedView=!0,t({metric:"POPUP_VIEW",once:!0}))};return window.addEventListener("mousemove",r),window.addEventListener("touchstart",r),()=>{window.removeEventListener("mousemove",r),window.removeEventListener("touchstart",r)}},[t,e])}function useRecordNewPopupView(e=!0){const{onPopupView:t}=useClientIntegrations(),{mutate:r}=useRegisterEvent(),n=reactExports.useRef(!1);reactExports.useEffect(()=>{if(!e)return;const i=()=>{n.current||(n.current=!0,t(),r({metric:"POPUP",once:!0}))};if(n.current)return;window.addEventListener("pointermove",i),window.addEventListener("pointerdown",i);const s=setTimeout(i,7e3);return()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerdown",i),clearTimeout(s)}},[t,r,e])}const{useContext:useContext$1,Provider:Provider$1}=createContextWithoutDefault("popup"),usePopupContext=useContext$1,Popup=reactExports.memo(({template:e,stepID:t=(i=>(i=getSteps(e).at(0))==null?void 0:i.id)(),children:r,...n})=>{const{data:s}=useGetMerchant(),l=e.steps.find(b=>b.id===t),p=!!(l!=null&&l.builderLabel)?t:void 0;useRecordOldPopupView(l&&!l.isFloatingButton),useRecordNewPopupView(l&&!l.isFloatingButton);const m=useStylesheet(reactExports.useCallback(b=>{[...e.steps.flatMap(S=>S.children),...e.layouts.map(S=>S.children)].forEach(S=>b.appendNode(S));for(const S of e.sharedStyles)b.appendClass(SHARED_STYLE_CLASSNAME(S.handle),S.styles)},[e])),v=useStepLayout(l);if(!v)throw new Error("Layout ID is required");return m?jsx(TextVariablesProvider,{sms_consent:getSMSConsentText(s),children:jsxs(Provider$1,{value:{template:e,stepID:t,...n},children:[r,jsx(Layout,{id:v,children:jsx(TemplateV2NodeChildren,{id:null,nodes:l==null?void 0:l.children},p)})]})}):null});Popup.displayName="Popup";const useGetThemeQuery=queryManager(()=>["themes","get"]);function useGetTheme(){const{initialData:e}=useCustomerAppContext(),t=useServiceFetch(),{getQueryKey:r}=useGetThemeQuery();return useSuspenseQuery({queryKey:r(),queryFn:()=>t("GET","/themes",{}),initialData:e.theme,staleTime:1/0})}function useBaseThemeConfig(){var i;const{data:e}=useGetTheme(),t=(i=useCustomerAppContext().preview)==null?void 0:i.toChildEvents,[r,n]=reactExports.useState(null);return reactExports.useEffect(()=>(t==null||t.on("updateTheme",n),()=>{t==null||t.off("updateTheme",n)}),[t]),r??(e==null?void 0:e.config)}function usePopupThemeConfig(){const{template:{themeOverride:e}}=usePopupContext(),t=useBaseThemeConfig();return overrideThemeConfig(t,e)}const Button=reactExports.forwardRef(({onClick:e,children:t,variant:r="secondary",disabled:n=!1,className:i,inline:s=!1,fullWidth:l=r!=="plain",sharedStyle:d,...p},m)=>{const v=usePopupThemeConfig(),b=r==="primary"?PRIMARY_BUTTON_HANDLE:r==="secondary"?SECONDARY_BUTTON_HANDLE:r==="plain"?PLAIN_BUTTON_HANDLE:r==="icon"?ICON_BUTTON_HANDLE:void 0,S=v==null?void 0:v.styles.button.find(w=>w.handle===(d??b)),$=classNames(SHARED_STYLE_CLASSNAME(S==null?void 0:S.handle),S==null?void 0:S.styles.classes),N=classNames(S==null?void 0:S.styles.classes,$),{styles:D,onClick:P,onMouseEnter:F,onMouseLeave:q}=usePreviewNodeContext(),{modal:H}=useModalContext(),f=classNames(s?"inline-flex":"flex","text-center duration-200 gap-2 justify-center items-center line-clamp-1 transition-[transform,color,background-color,opacity,box-shadow] cursor-pointer disabled:pointer-events-none",i,l&&"w-full",N,H&&"shiny-disabled");return jsx("button",{className:f,style:D,"aria-disabled":n,disabled:n,...p,onClick:P??(w=>!n&&(e==null?void 0:e(w))),onMouseEnter:F,onMouseLeave:q,ref:m,children:t})});Button.displayName="Button";const WILL_AUTO_APPLY_CODE_STORAGE_KEY="alia-will-auto-apply-code";function getRedirectPath({path:e,exceptIfOnPaths:t}){const r=window.location.pathname+window.location.search;if(!anyPathGlob(t,r)){if(e.startsWith("/#")){const[n,i]=r.split("?"),s=new URLSearchParams(i);new URLSearchParams(e.slice(2)).forEach((p,m)=>{s.append(m,p)});const d=s.toString();return`${n}${d?`?${d}`:""}`}return e}}function useApplyCode({setIsLoading:e,setApplied:t,onRedirected:r}){return async n=>{localStorage.setItem(WILL_AUTO_APPLY_CODE_STORAGE_KEY,n.id.toString());const i=n.shopifyCode;i&&navigator.clipboard.writeText(i);const s=getRewardConfigProperty(n.config,"redirectOnApply"),l=s?getRedirectPath(s):void 0;e==null||e(!0),l?(r==null||r(),new ShopifyUtils().redirect(i?`/discount/${i}?redirect=${l}`:l)):i&&(await wait(500),e==null||e(!1),t==null||t(!0),new ShopifyUtils().applyCode(i))}}const ShopifyCode=({claimedReward:e,onClose:t})=>{const[r,n]=reactExports.useState(!1),i=e.shopifyCode,[s,l]=reactExports.useState(localStorage.getItem(WILL_AUTO_APPLY_CODE_STORAGE_KEY)===e.id.toString()),d=useApplyCode({setIsLoading:n,setApplied:l,onRedirected:t}),p=getRewardConfigProperty(e.config,"redirectOnApply"),m=getRewardConfigProperty(e.config,"disableAutoApply"),v=!m&&(!!i||!!p),b=i?jsxs(ClickableDiv,{className:"w-3/4 cursor-pointer flex text-xl tracking-wide justify-between bg-primary-50 rounded-lg px-2.5 py-2 font-mono",onClick:()=>{m?(navigator.clipboard.writeText(i),l(!0)):d(e)},children:[jsx("span",{className:"select-all",children:i}),jsx(Icon,{icon:s?"checkmark":"copy"})]}):p?jsx(Button,{disabled:r,variant:"primary",onClick:()=>d(e),children:"Activate"}):null;return v?s?jsxs("div",{className:"flex flex-col items-center gap-6",children:[jsx(ClaimedRewardDivider,{}),jsxs("div",{className:"flex flex-col items-center gap-4",children:[b,jsx("div",{className:"text-center",children:"We've applied this discount code to your cart."})]}),jsx(ClaimedRewardDivider,{})]}):jsx("div",{className:"w-4/5",children:jsx(Button,{disabled:r,variant:"primary",onClick:()=>d(e),children:r?"Applying...":"Apply my discount"})}):b};function useIsFirstRender(){const e=reactExports.useRef(!0);return reactExports.useEffect(()=>{e.current=!1},[]),e.current}function useOnSDKMessage(e,t){const{messages:r}=useCustomerAppContext(),n=useIsFirstRender();reactExports.useEffect(()=>r==null?void 0:r.listen({type:e,callback:t,retroactive:n}),[e,t,r,n])}async function evaluateKlaviyoIdentifiedCond(e){const t=await klaviyoIsIdentified();return t===void 0?"skip":e.type==="klaviyo.identified"?t:!t}async function klaviyoIsIdentified(){try{const{klaviyo:e}=await klaviyoObject(),t=await timeout(1e3,async()=>await(e==null?void 0:e.isIdentified()));return t===void 0?void 0:t===!0}catch{return}}async function evaluateKlaviyoListCond(e,{integrationUsers:t}){if(!e.listID)return!0;const r=e.listID;if(s()===!0||await getKDPResult(r)===!0)return e.type==="klaviyo.inList";return e.type!=="klaviyo.inList";function s(){var l,d;for(const p of t){if(p.data.type==="KLAVIYO")return((l=p.data.subscribedLists)==null?void 0:l.includes(r))??!1;if(p.data.type==="KLAVIYO_OAUTH")return((d=p.data.subscribedLists)==null?void 0:d.includes(r))??!1}return!1}}async function evaluateKlaviyoSegmentCond(e){if(!e.segmentID)return!0;const t=e.segmentID;return await getKDPResult(t)===!0?e.type==="klaviyo.inSegment":e.type!=="klaviyo.inSegment"}const kdpResults=new Map;async function getKDPResult(e){try{if(kdpResults.has(e))return kdpResults.get(e);const{klaviyo:t}=await klaviyoObject();if(!(t!=null&&t.getGroupMembership))return;const r=await timeout(1e3,async()=>await(t==null?void 0:t.getGroupMembership([e])));if(!Array.isArray(r))return;const n=r.includes(e);return kdpResults.set(e,n),n}catch{return}}async function klaviyoObject(){try{if(!Array.from(getDocument().scripts).find(n=>n.src.includes("klaviyo.js")))return{klaviyo:void 0};const t=()=>getWindowProperty("klaviyo");return t()?{klaviyo:t()}:await timeout(1e3,async()=>await new Promise(n=>{const i=setInterval(()=>{t()&&(n({klaviyo:t()}),clearInterval(i))},100)}))??{klaviyo:void 0}}catch{return{klaviyo:void 0}}}async function evaluateTargetingRuleCond(e,t){var i,s,l,d;if(t.evaluated.includes(e.resource.id))return"skip";const r=e.resource.type==="targetingRule"?(s=(i=t.targetingRules)==null?void 0:i.rules.find(p=>p.id===e.resource.id))==null?void 0:s.config:(d=(l=t.segments.find(p=>p.id===e.resource.id))==null?void 0:l.targeting)==null?void 0:d.rule;if(!r)return"skip";const n=await evaluateTargetingRule(r,{...t,evaluated:[...t.evaluated,e.resource.id]});return n!=="skip"?e.type==="inTargetingRule"?n:!n:e.resource.type==="segment"&&e.type==="notInTargetingRule"?!1:"skip"}async function evaluateCustomCodeCond(e,t){return await Promise.race([safeEval(`(async ({ campaignID, profile: { user, actions } }) => { ${e.code} })(${JSON.stringify({campaignID:t.segmentID,profile:t})})`),wait(1e3)])===!0}const checkCookieMap={klaviyo:async()=>await klaviyoIsIdentified(),smsbump:async()=>{var e,t;return(t=(e=getWindowProperty("smsbump"))==null?void 0:e.isIdentified)==null?void 0:t.call(e)},unveild:async()=>{var e,t;return(t=(e=getWindowProperty("unveild"))==null?void 0:e.checkIfUserIdentified)==null?void 0:t.call(e)},upstack:async()=>{var e,t;return await((t=(e=getWindowProperty("_upsShopifyClient"))==null?void 0:e.isKnown)==null?void 0:t.call(e))}};async function evaluateCookieIdentificationCond(e,t){const n=(await Promise.all(Object.keys(checkCookieMap).filter(i=>!e.exclude.includes(i)).map(async i=>{try{const s=await checkCookieMap[i](t);return s===!0?!0:s===!1?!1:"skip"}catch{return"skip"}}))).some(i=>i===!0);return e.type==="cookie.identified"?n:!n}function evaluateNumFilter(e,t){switch(e.operator){case"eq":return t===e.value;case"neq":return t!==e.value;case"gt":return t>e.value;case"gte":return t>=e.value;case"lt":return tr;case"lt":return nnew URL(p)):[new URL(window.location.href)],l=(e.matchType==="exact"?e.values:e.matchType==="contains"?e.values.map(p=>`*${p}*`):assertNever(e.matchType)).some(p=>i.some(m=>d(e.pageType,m,p)));return e.type==="hasVisitedPage"||e.type==="isOnPage"?l:!l;function d(p,m,v){const b=p==="url"?m.toString():p==="path"?m.pathname+m.search:assertNever(p);return glob(S(v),S(b));function S($){return $.replace(/\/$/,"")}}}function evaluateNumPagesViewedCond(e,{user:t}){var n;const r=(n=t.profile.history)==null?void 0:n.at(-1);return r?evaluateNumFilter(e.value,r.length):!1}function evaluateNumSessionsCond(e,{user:t}){var r;return evaluateNumFilter(e.value,((r=t.profile.history)==null?void 0:r.length)??0)}function evaluateShopifyNumOrdersCond(e,t){return evaluateNumFilter(e.value,t.user.shopifyNumOrders??0)}function evaluateShopifyCountriesCond(e,t){const r=t.user.country;return r===null?!0:e.type==="shopify.inCountries"?e.countries.includes(r):!e.countries.includes(r)}function evaluateMarketsCond(e,t){const r=t.user.market;return r===null?!0:e.type==="shopify.inMarkets"?e.markets.includes(r):!e.markets.includes(r)}function evaluateLocalesCond(e,t){const r=t.user.language;return r===null?!0:e.type==="shopify.inLocales"?e.locales.includes(r):!e.locales.includes(r)}function evaluateUtmSourceCond(e,t){const r=getLatestParamValue("utm_source",t.user),n=e.values.includes(r);return e.type==="traffic.utmSourceIsIn"?n:!n}function evaluateUtmMediumCond(e,t){const r=getLatestParamValue("utm_medium",t.user),n=e.values.includes(r);return e.type==="traffic.utmMediumIsIn"?n:!n}function getLatestParamValue(e,{profile:t}){const r=t.history.flat();for(const n of r.reverse()){const s=new URL(n).searchParams.get(e);if(s)return s}return null}function evaluateUserCreatedAtCond(e,t){return evaluateRelativeDateFilter(e.value,new Date(t.user.createdAt))}function evaluateUserDeviceCond(e,t){const r=t.user.isMobile;return r===null?!0:e.device==="mobile"?r:!r}function evaluateUserCountriesCond(e,t){const r=t.user.ipCountry;return r===null?"skip":e.type==="user.inCountries"?e.countries.includes(r):!e.countries.includes(r)}function evaluateUserRegionsCond(e,t){const r=t.user.ipRegion;return r===null?"skip":e.type==="user.inRegions"?e.regions.includes(r):!e.regions.includes(r)}function evaluateUserActionCond(e,t){const r=t.actions.some(n=>n.data.type!==e.action.type?!1:e.filters?evaluateUserActionFilters(n,e.filters):!0);return e.type==="user.hasDoneAction"?!!r:!r}function evaluateUserActionFilters(e,t){return t.every(i=>{switch(i.type){case"userAction.date":return r(i);case"userAction.inSegments":case"userAction.notInSegments":return n(i)}});function r(i){return evaluateRelativeDateFilter(i.value,new Date(e.createdAt))}function n(i){const s=i.segmentIDs.some(l=>e.segmentID===l);return i.type==="userAction.inSegments"?s:!s}}async function evaluateCond(e,t){switch(e.type){case"inTargetingRule":case"notInTargetingRule":return evaluateTargetingRuleCond(e,t);case"customCode":return await evaluateCustomCodeCond(e,t);case"klaviyo.identified":case"klaviyo.notIdentified":return await evaluateKlaviyoIdentifiedCond(e);case"klaviyo.inList":case"klaviyo.notInList":return await evaluateKlaviyoListCond(e,t);case"klaviyo.inSegment":case"klaviyo.notInSegment":return await evaluateKlaviyoSegmentCond(e);case"isOnPage":case"isNotOnPage":case"hasVisitedPage":case"hasNotVisitedPage":return evaluatePagesCond(e,t);case"pages.numPagesViewed":return evaluateNumPagesViewedCond(e,t);case"pages.numSessions":return evaluateNumSessionsCond(e,t);case"shopify.numOrders":return evaluateShopifyNumOrdersCond(e,t);case"shopify.inMarkets":case"shopify.notInMarkets":return evaluateMarketsCond(e,t);case"shopify.inLocales":case"shopify.notInLocales":return evaluateLocalesCond(e,t);case"shopify.inCountries":case"shopify.notInCountries":return evaluateShopifyCountriesCond(e,t);case"user.createdAt":return evaluateUserCreatedAtCond(e,t);case"user.device":return evaluateUserDeviceCond(e,t);case"user.inCountries":case"user.notInCountries":return evaluateUserCountriesCond(e,t);case"user.inRegions":case"user.notInRegions":return evaluateUserRegionsCond(e,t);case"user.hasDoneAction":case"user.hasNotDoneAction":return evaluateUserActionCond(e,t);case"traffic.utmSourceIsIn":case"traffic.utmSourceIsNotIn":return evaluateUtmSourceCond(e,t);case"traffic.utmMediumIsIn":case"traffic.utmMediumIsNotIn":return evaluateUtmMediumCond(e,t);case"cookie.identified":case"cookie.notIdentified":return evaluateCookieIdentificationCond(e,t)}}async function evaluateTargetingRule(e,t){switch(e.type){case"and":return evaluateAndRule(e,t);case"or":return evaluateOrRule(e,t)}}async function evaluateAndRule(e,t){const r=await Promise.all(e.conds.map(n=>evaluateCond(n,t)));return r.some(n=>n===!1)?!1:r.some(n=>n==="skip")?"skip":!0}async function evaluateOrRule(e,t){const r=await Promise.all(e.conds.map(n=>evaluateCond(n,t)));return r.some(n=>n===!0)?!0:r.some(n=>n==="skip")?"skip":!1}function useTargetingArgs(){const{targetingArgs:e}=useCustomerAppContext(),t=useMediatorState();return reactExports.useMemo(()=>{if(e)return{...e,...t!=null&&t.actions?{actions:t.actions}:{},...t!=null&&t.user?{user:t.user}:{}}},[e,t])}const STALE_TIME=1e3;function useReEvaluateTargeting(){var l;const{initialData:e}=useCustomerAppContext(),t=useTargetingArgs(),r=reactExports.useRef(!0);reactExports.useEffect(()=>{r.current=!0},[t]);const n=reactExports.useRef(void 0),i=reactExports.useCallback(d=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r.current=!0},d)},[]),s=reactExports.useRef(void 0);return reactExports.useCallback(async()=>{if(!r.current&&s.current!==void 0)return s.current;r.current=!1,i(STALE_TIME);const d=await p();return s.current=d,d;function p(){var b;const m=(b=e.userFlow)==null?void 0:b.segmentID,v=t==null?void 0:t.segments.find(S=>S.id===m);return!t||!v?"skip":evaluateTargetingRule(v.targeting.rule,{...t,evaluated:[],segmentID:v.id})}},[r,i,(l=e.userFlow)==null?void 0:l.segmentID,t])}function usePreloadImages(e){var l,d;const{initialData:t}=useCustomerAppContext(),r=(d=(l=t.userFlow)==null?void 0:l.config.popup)==null?void 0:d.config,{width:n}=useWindowSizeContext(),s=((r==null?void 0:r.steps.map(p=>n>=1024?p.layouts[1024]:p.layouts.default))??[]).map(p=>{var m;return(m=r==null?void 0:r.layouts.find(v=>v.id===p))==null?void 0:m.children}).filter(Boolean).flatMap(p=>getAllNodesInNode(p)).map(p=>p.node.type==="image"?p.node.source:"styles"in p.node?getBGImageFromStyles(p.node.styles):null).filter(Boolean);useQuery({queryKey:["preloadImages",s],queryFn:async()=>(await Promise.all(s.map(preloadImage)),!0),suspense:!0,staleTime:1/0,enabled:e})}async function preloadImage(e){return new Promise(t=>{const r=new Image;r.onload=t,r.onerror=t,r.src=e})}function getBGImageFromStyles(e){return getBGImageFromStylesV2(e==null?void 0:e[1024])??getBGImageFromStylesV2(e==null?void 0:e.default)}function getBGImageFromStylesV2(e){var n;const t=(n=e==null?void 0:e.default)==null?void 0:n.backgroundImage;if(!t)return null;const r=t.match(/url\((['"]?)(.*?)\1\)/);return(r==null?void 0:r[2])??null}function useOnAddToCart(e,t=!0){const r=reactExports.useRef(null);reactExports.useEffect(()=>{if(t)return r.current||(r.current=new AliaCartWatcher),r.current.listen(e)},[e,t])}class AliaCartWatcher{constructor(){wt(this,"cart",null);wt(this,"listeners",[]);wt(this,"cartResourceObserver",null);try{this.restoreCart(),this.emitCartChanges().then(()=>this.observeCartChanges())}catch(t){console.error("Error instantiating cart watcher",t)}}restoreCart(){const t=localStorage.getItem("alia-cart");t&&(this.cart=JSON.parse(t))}saveCart(){localStorage.setItem("alia-cart",JSON.stringify(this.cart))}listen(t){return this.listeners.push(t),()=>{this.listeners=this.listeners.filter(r=>r!==t)}}async fetchCartData(){try{return await(await fetch("/cart.js")).json()}catch{return{items:[]}}}findCartDifferences(t){if(!this.cart)return{added:t.items,removed:[]};const n={added:((i,s)=>i.filter(l=>!s.some(d=>l.key===d.key)))(t.items,this.cart.items)};return this.cart.items.forEach(i=>{const s=t.items.find(p=>p.key===i.key&&p.quantity!==i.quantity);if(!s)return;const l=s.quantity-i.quantity,d={...s};d.quantity=Math.abs(l),l>0&&n.added.push(d)}),n}async emitCartChanges(){const t=await this.fetchCartData(),r=this.findCartDifferences(t);this.cart=t,this.saveCart(),r.added.length&&this.listeners.forEach(n=>n(r))}observeCartChanges(){this.cartResourceObserver=new PerformanceObserver(t=>{t.getEntries().forEach(r=>{const n=r.initiatorType;n&&["xmlhttprequest","fetch"].includes(n)&&/\/cart\//.test(r.name)&&this.emitCartChanges()})}),this.cartResourceObserver.observe({entryTypes:["resource"]})}}function useAddToCartCond(){const[e,t]=reactExports.useState([]),r=reactExports.useMemo(()=>new AliaCartWatcher,[]);return reactExports.useEffect(()=>{const n=()=>{const i=r.cart;i&&t(i.items.map(s=>s.variant_id.toString()))};return r.emitCartChanges().then(n),r.listen(n)},[r]),reactExports.useCallback(n=>e.length===0?!1:n.onlyVariantIds?n.onlyVariantIds.map(s=>gqlToRestID("ProductVariant")(parseShopifyGqlID("ProductVariant")(s))).some(s=>e.includes(s)):!0,[e])}function useIdleCond(){const[e,t]=reactExports.useState(0),r=reactExports.useRef(e),n=reactExports.useCallback(i=>{r.current!==i&&(r.current=i,t(i))},[]);return reactExports.useEffect(()=>{const i=setInterval(()=>{n(r.current+1)},1e3);return()=>clearInterval(i)},[n]),reactExports.useEffect(()=>{const i=()=>n(0);return getDocument().addEventListener("mousemove",i),getDocument().addEventListener("scroll",i),getDocument().addEventListener("touchstart",i),()=>{getDocument().removeEventListener("mousemove",i),getDocument().removeEventListener("scroll",i),getDocument().removeEventListener("touchstart",i)}},[n]),reactExports.useCallback(i=>e>=i.seconds,[e])}function useMouseLeaveCond(){const[e,t]=reactExports.useState(!1),r=reactExports.useRef(!1),n=reactExports.useCallback(i=>{r.current!==i&&(r.current=i,t(i))},[]);return reactExports.useEffect(()=>{const i=()=>n(!1),s=()=>n(!0);return getDocument().addEventListener("mouseleave",s),getDocument().addEventListener("mouseenter",i),()=>{getDocument().removeEventListener("mouseleave",s),getDocument().removeEventListener("mouseenter",i)}},[n]),reactExports.useCallback(()=>e,[e])}const SCROLL_INTERVAL$1=200;function useQuickScrollUpCond(){const[e,t]=reactExports.useState(!1),r=reactExports.useRef(!1),n=reactExports.useCallback(s=>{r.current!==s&&(r.current=s,t(s))},[]),i=reactExports.useRef(window.scrollY);return reactExports.useEffect(()=>{const s=setInterval(()=>{window.scrollY-i.current<-500&&n(!0),i.current=window.scrollY},SCROLL_INTERVAL$1);return()=>clearInterval(s)},[n]),reactExports.useCallback(()=>e,[e])}const DEBOUNCE_INTERVAL=100;function useScrollDepth(){const[e,t]=reactExports.useState(0),r=reactExports.useRef(e),n=reactExports.useRef(Date.now()),i=reactExports.useRef(null);return reactExports.useEffect(()=>{const s=()=>{const d=getDocument().body.scrollHeight-window.innerHeight,p=window.scrollY/d,m=Math.round(p*100);m!==r.current&&(t(m),r.current=m,n.current=Date.now())},l=()=>{Date.now()-n.current{s()},DEBOUNCE_INTERVAL)):s()};return getDocument().addEventListener("scroll",l),()=>getDocument().removeEventListener("scroll",l)},[]),e}function useScrollDepthCond(){const e=useScrollDepth();return reactExports.useCallback(t=>e>=t.depth,[e])}function useTimeOnPageCond(){const[e,t]=reactExports.useState(0);return reactExports.useEffect(()=>{const r=setInterval(()=>{const n=Date.now()-window.performance.timeOrigin,i=Math.floor(n/1e3);t(i)},1e3);return()=>clearInterval(r)},[]),reactExports.useCallback(r=>r.delay?e>=r.delay:!0,[e])}function useBasicTriggers$1({value:e,triggerStep:t}){var P;const r=reactExports.useMemo(()=>(e==null?void 0:e.triggers.filter(F=>F.type==="basic"))??[],[e]),n=(P=useMediatorState())==null?void 0:P.actions,[i,s]=reactExports.useState(!1);reactExports.useEffect(()=>{const F=()=>{const H=getLastShown(n),f=e==null?void 0:e.notIfAnyPopupShownInLast;if(!f)return s(!0);s(typeof H=="number"?evaluateRelativeDateFilter({...f,operator:"gt"},new Date(H)):H==="never")};F();const q=setInterval(F,1e3);return()=>clearInterval(q)},[n,e]);const l=useBreakpoint(),d=useGetTriggerStep(),p=reactExports.useCallback(F=>{const q=d(F.step);if(q){if(!i){logger.debug("Trigger aborted because popup was shown recently");return}t(q,F)}},[t,d,i]),m=useTimeOnPageCond(),v=useMouseLeaveCond(),b=useIdleCond(),S=useQuickScrollUpCond(),$=useScrollDepthCond(),N=useAddToCartCond(),D=reactExports.useCallback(F=>{switch(F.type){case"timeOnPage":return m(F);case"mouseLeave":return v();case"idle":return b(F);case"quickScrollUp":return S();case"scrollDepth":return $(F);case"addToCart":return N(F)}},[m,v,b,S,$,N]);reactExports.useEffect(()=>{const F=r.filter(f=>f.device==="mobile"&&l!=="default"||f.device==="desktop"&&l!=="1024"?!1:f.requireAllConds?f.conds.every(D):f.conds.some(D)),q=F.find(f=>{var w;return!((w=d(f.step))!=null&&w.isFloatingButton)});if(q){p(q);return}const H=F.at(0);H&&p(H)},[D,p,l,r,d])}function getLastShown(e){if(!e)return Number.NEGATIVE_INFINITY;const t=[...e].sort((i,s)=>new Date(s.createdAt).getTime()-new Date(i.createdAt).getTime()),r=t.find(i=>!(i.data.type!=="popupStep"||i.data.isFloatingButton));if(!r)return"never";const n=t.find(i=>i.segmentID!==r.segmentID||i.createdAtp.type==="smart"),n=useTargetingArgs(),i=useGetTriggerStep(),s=reactExports.useRef(new Map),l=reactExports.useCallback((p,m)=>{s.current.set(p,m);const v=[...s.current.values()].reduce((S,$)=>S+$,0);if(!r||v{if(n)return d(n)},[d,n])}function useEvaluateScore$1(e,t){const r=reactExports.useMemo(()=>new AliaCartWatcher,[]),n=useQuickScrollUpCond(),i=useMouseLeaveCond(),s=useScrollDepth(),l=reactExports.useMemo(()=>({organicTraffic:(m,v)=>{const b=getLatestParamValue("utm_source",m.user),S=!b||["google","bing"].some($=>b.includes($));v(S?1:0)},productPage:(m,v)=>{const b=m.user.profile.history.flat();if(!b.length)return;const S=b.reverse().findIndex(N=>N.includes("/products")||N.includes("/collections"));if(S===-1){v(0);return}const $=1-S/b.length;v($)},itemsInCart:(m,v)=>{const b=()=>{const S=r.cart;S&&v(d(S.items.length))};return r.emitCartChanges().then(b),r.listen(b)},mobile:(m,v)=>{v(m.user.isMobile?1:0)},scrollDepth:(m,v)=>{v(s/100)},timeSinceLastTrigger:(m,v)=>{const b=()=>{const $=getLastShown(m.actions),N=typeof $=="number"?$:$==="now"?Date.now():-1/0,D=(Date.now()-N)/1e3,P=1-p(D,.5,(e==null?void 0:e.delayFromLastTrigger)??15);v(-P)};b();const S=setInterval(b,1e3);return()=>clearInterval(S)},numSessions:(m,v)=>{v(d(m.user.profile.history.length-1))},numPagesViewed:(m,v)=>{var S;const b=((S=m.user.profile.history.at(-1))==null?void 0:S.length)??1;v(d(b-1))},timeOnPage:(m,v)=>{const b=window.performance.timeOrigin+1e3,S=setInterval(()=>{const $=Date.now()-b;v(d($/1e3))},1e3);return()=>clearInterval(S)},exitIntent:(m,v)=>{v(n()||i()?1:0)}}),[n,i,s,e==null?void 0:e.delayFromLastTrigger,r]);return reactExports.useCallback(m=>{const v=[];for(const b of(e==null?void 0:e.parameters)??[]){const S=l[b.key];if(!S)continue;const $=S(m,N=>{const D=Math.min(Math.max(N,-1),1);t(b.key,b.coefficient*D)});$&&v.push($)}return()=>v.forEach(b=>b())},[l,e,t]);function d(m){return m<0?0:m/(m+1)}function p(m,v,b){return 1/(1+Math.exp(-.5*(m-b)))}}function usePopupTrigger({goToPopupStep:e}){var p,m;const{currentStep:t}=useFlowStateContext(),{initialData:r}=useCustomerAppContext(),n=(p=r.userFlow)==null?void 0:p.config,i=n==null?void 0:n.triggers;usePreloadImages((i==null?void 0:i.preloadImages)??!1);const s=useReEvaluateTargeting(),l=(m=useMediatorState())==null?void 0:m.actions,d=reactExports.useCallback(async(v,b)=>{var N,D;if(!i||!r.userFlow)return;const S=getLastStepAction(l==null?void 0:l.filter(P=>{var F;return P.segmentID===((F=r.userFlow)==null?void 0:F.segmentID)}),P=>!v.isFloatingButton&&P.isFloatingButton?!1:b.type==="basic"?!0:P.reason.type==="trigger"&&P.reason.triggerType==="smart");if(S!=="never"&&!(i.triggerAgainAfter&&evaluateRelativeDateFilter({value:i.triggerAgainAfter.value||1,unit:i.triggerAgainAfter.unit,operator:"gt"},new Date(S)))){logger.debug(`Trigger aborted because trigger again after not passed for ${b.type} trigger`);return}if(t.step==="popup"){if(v.isFloatingButton){logger.debug("Floating button trigger aborted because popup is open");return}const P=t.popupStepID,F=(D=(N=n==null?void 0:n.popup)==null?void 0:N.config)==null?void 0:D.steps.find(q=>q.id===P);if(F&&!F.isFloatingButton){logger.debug("Trigger aborted because modal is already open");return}}if(await s()===!1){logger.debug("Trigger aborted because targeting rule returned false");return}e(v.id,{type:"trigger",triggerType:b.type,triggerID:b.id})},[e,i,t,n,l,r.userFlow,s]);useBasicTriggers$1({value:i,triggerStep:d}),useSmartTrigger$1({value:i,triggerStep:d})}function useGetTriggerStep(){var r,n;const{initialData:e}=useCustomerAppContext(),t=(n=(r=e.userFlow)==null?void 0:r.config.popup)==null?void 0:n.config;return reactExports.useCallback(i=>i?t==null?void 0:t.steps.find(s=>s.id===i):getSteps(t).at(0),[t])}function getLastStepAction(e=[],t){const r=[...e].sort((n,i)=>new Date(i.createdAt).getTime()-new Date(n.createdAt).getTime());for(const{data:n,createdAt:i}of r)if(n.type==="popupStep"&&t(n))return new Date(i).getTime();return"never"}function useRunCustomCodeFilter(e){const{data:t}=useGetSettings();return reactExports.useCallback(async()=>{if(!t.customCodeFilter||!e)return!0;const r=await Promise.race([safeEval(`(async (popupID) => { ${t.customCodeFilter} })(${e?`${e}`:"undefined"})`),wait(1e3)]).catch(n=>(logger.error("Error in custom code filter",n),!0));return r===!1&&logger.debug("Alia custom code filter returned false"),r!==!1},[t,e])}function useCanTriggerStep({flowPopupConfig:{waitAfterLastTrigger:e,daysBetweenTriggers:t,config:r}}){const{currentStep:n,state:i}=useFlowStateContext(),{data:s}=useGetOtherUserFlows(),l=n.step!=="popup"&&n.step!=="extraPopup"?void 0:n.floatingButton?"floatingButton":"fullScreen",d=reactExports.useCallback(()=>{const m=[i,...s.map(({state:$})=>$)],v=getLastExited(m);if(!e||v===-1/0)return!0;const b=Date.now()-v;return e*1e3-b<=0},[e,s,i]),p=reactExports.useCallback(m=>{const v=Math.max(...i.steps.filter($=>!($.step!=="popup"||!m.isFloatingButton&&$.floatingButton)).map(({timestamp:$})=>$));return v===-1/0?!0:t===void 0?!1:(Date.now()-v)/(1e3*60*60*24)>=(t||1)},[t,i]);return reactExports.useCallback(m=>{if(!d())return valueWithLog(!1,"Trigger aborted because popup was shown recently");if(!p(m))return valueWithLog(!1,"Trigger aborted because days between triggers not passed");if(m.isFloatingButton)return l!==void 0?valueWithLog(!1,"Trigger aborted because another popup is open"):!0;{if(l==="fullScreen")return valueWithLog(!1,"Trigger aborted because another full screen popup is open");const v=n.step==="popup"?n.popupStepID:void 0,b=r.steps.findIndex($=>$.id===v),S=b!==-1?r.steps[b]:null;return S?m.id===S.id?valueWithLog(!1,"Trigger aborted because popup step is already open"):S.isFloatingButton:!0}},[r,l,d,p,n])}function getLastExited(e){return Math.max(...e.map(({steps:t})=>{const r=[...t].reverse().findIndex(i=>!(i.step!=="popup"&&i.step!=="extraPopup"||i.floatingButton));return r===-1?-1/0:r===0?Date.now():t[t.length-r].timestamp}))}function valueWithLog(e,t){return logger.debug(t),e}function useOnExitIntent(e){const t=useOnExitIntentListener();reactExports.useEffect(()=>t(e),[e,t])}function useOnExitIntentListener(){return reactExports.useCallback(e=>(getDocument().addEventListener("mouseleave",e),()=>getDocument().removeEventListener("mouseleave",e)),[])}function useOnScrollDepth(e){const t=useOnScrollDepthListener();reactExports.useEffect(()=>t(e),[e,t])}function useOnScrollDepthListener(){const e=reactExports.useRef(window.scrollY);return reactExports.useCallback(t=>{const r=()=>{const n=window.scrollY-e.current;if(e.current=window.scrollY,n<0)return;const i=getDocument().body.scrollHeight-window.innerHeight,s=window.scrollY/i;t(s)};return getDocument().addEventListener("scroll",r),()=>getDocument().removeEventListener("scroll",r)},[])}const SCROLL_INTERVAL=200;function useOnScrollUp(e){const t=useOnScrollUpListener();reactExports.useEffect(()=>t(e),[e,t])}function useOnScrollUpListener(){const e=reactExports.useRef(window.scrollY);return reactExports.useCallback(t=>{const r=setInterval(()=>{window.scrollY-e.current<-500&&t(),e.current=window.scrollY},SCROLL_INTERVAL);return()=>clearInterval(r)},[])}function useOnIdle(e){const t=reactExports.useRef(Date.now());reactExports.useEffect(()=>{const r=()=>t.current=Date.now();getDocument().addEventListener("mousemove",r),getDocument().addEventListener("scroll",r),getDocument().addEventListener("touchstart",r);const n=setInterval(()=>{const i=Math.round((Date.now()-t.current)/1e3);i>0&&e(i)},1e3);return()=>{clearInterval(n),getDocument().removeEventListener("mousemove",r),getDocument().removeEventListener("scroll",r),getDocument().removeEventListener("touchstart",r)}},[e])}const INIT_TIME=Date.now();function useBasicTriggers({triggers:e,config:t,triggerStep:r}){const n=useCanTriggerStep({flowPopupConfig:t}),i=reactExports.useCallback(d=>{const p=getStepByIDOrIndex(t.config,d);p&&n(p)&&r(p,"basic")},[n,r,t]),s=reactExports.useRef(null);reactExports.useEffect(()=>{const d=setInterval(()=>{const p=s.current===null?Math.floor((Date.now()-INIT_TIME)/1e3):s.current+1,m=e.filter(S=>{if(S.type!=="immediate")return!1;const $=Math.floor(S.delay??0);return s.current===null?$<=p:$===p});s.current=p;const b=m.find(({step:S})=>{const $=getStepByIDOrIndex(t.config,S);return $&&!$.isFloatingButton})??m.at(0);b&&i(b.step)},1e3);return()=>clearInterval(d)},[i,e,t]),useOnExitIntent(reactExports.useCallback(()=>{const d=e.find(p=>p.type==="exitIntent");d&&i(d.step)},[i,e])),useOnIdle(reactExports.useCallback(d=>{const p=e.find(m=>m.type==="idle"&&d>=m.seconds);p&&i(p.step)},[i,e])),useOnScrollUp(reactExports.useCallback(()=>{const d=e.find(p=>p.type==="scrollUp");d&&i(d.step)},[i,e])),useOnScrollDepth(reactExports.useCallback(d=>{const p=e.find(m=>m.type==="scrollDepth"&&d*100>=m.depth);p&&i(p.step)},[i,e]));const l=e.some(d=>d.type==="addToCart");useOnAddToCart(reactExports.useCallback(({added:d})=>{const p=d.map(v=>v.variant_id.toString()),m=e.find(v=>v.type!=="addToCart"?!1:v.onlyVariantIds?v.onlyVariantIds.map(S=>gqlToRestID("ProductVariant")(parseShopifyGqlID("ProductVariant")(S))).some(S=>p.includes(S)):!0);m&&i(m.step)},[i,e]),l)}function getStepByIDOrIndex(e,t){return typeof t=="number"?e.steps.at(t):e.steps.find(r=>r.id===t)}const SCORE_THRESHOLD=100;function useSmartTrigger({triggers:e,triggerStep:t,config:r}){const{state:n}=useFlowStateContext(),{data:i}=useGetOtherUserFlows(),s=e.find(v=>v.type==="smart"),{targetingArgs:l}=useCustomerAppContext(),d=reactExports.useRef(new Map),p=reactExports.useCallback((v,b)=>{d.current.set(v,b);const S=[...d.current.values()].reduce((D,P)=>D+P,0);if(!s||SD.step==="popup"&&D.triggerType==="smart"))return;const N=getStepByIDOrIndex(r.config,s.step);N&&t(N,"smart")},[s,n,r,t]),m=useEvaluateScore(s,p);reactExports.useEffect(()=>{if(!l)return;const v=[n,...(i==null?void 0:i.map(b=>b.state))??[]];return m({...l,allFlowStates:v})},[l,i,n,m])}function useEvaluateScore(e,t){const r=reactExports.useMemo(()=>new AliaCartWatcher,[]),n=useOnScrollUpListener(),i=useOnExitIntentListener(),s=useOnScrollDepthListener(),l=reactExports.useMemo(()=>({organicTraffic:(m,v)=>{const b=getLatestParamValue("utm_source",m.user),S=!b||["google","bing"].some($=>b.includes($));v(S?1:0)},productPage:(m,v)=>{const b=m.user.profile.history.flat();if(!b.length)return;const S=b.reverse().findIndex(N=>N.includes("/products")||N.includes("/collections"));if(S===-1){v(0);return}const $=1-S/b.length;v($)},itemsInCart:(m,v)=>{const b=()=>{const S=r.cart;S&&v(d(S.items.length))};r.emitCartChanges().then(b),r.listen(b)},mobile:(m,v)=>{v(m.user.isMobile?1:0)},scrollDepth:(m,v)=>s(b=>v(b)),timeSinceLastTrigger:(m,v)=>{const b=()=>{const $=getLastExited(m.allFlowStates),N=(Date.now()-$)/1e3,D=1-p(N,.5,(e==null?void 0:e.delayFromLastTrigger)??15);v(-D)};b();const S=setInterval(b,1e3);return()=>clearInterval(S)},numSessions:(m,v)=>{v(d(m.user.profile.history.length-1))},numPagesViewed:(m,v)=>{var S;const b=((S=m.user.profile.history.at(-1))==null?void 0:S.length)??1;v(d(b-1))},timeOnPage:(m,v)=>{const b=window.performance.timeOrigin+1e3,S=setInterval(()=>{const $=Date.now()-b;v(d($/1e3))},1e3);return()=>clearInterval(S)},exitIntent:(m,v)=>{const b=[];return b.push(n(()=>v(1))),b.push(i(()=>v(1))),()=>b.forEach(S=>S())}}),[n,i,s,e==null?void 0:e.delayFromLastTrigger,r]);return reactExports.useCallback(m=>{const v=[];for(const b of(e==null?void 0:e.parameters)??[]){const S=l[b.key];if(!S)continue;const $=S(m,N=>{const D=Math.min(Math.max(N,-1),1);t(b.key,b.coefficient*D)});$&&v.push($)}return()=>v.forEach(b=>b())},[e,t,l]);function d(m){return m<0?0:m/(m+1)}function p(m,v,b){return 1/(1+Math.exp(-.5*(m-b)))}}function useOldPopupTriggers({value:e,goToPopupStep:t}){usePreloadImages(e.preloadImages);const{data:r}=useGetUser(),n=useClaimedReward(),i=useIntegrationPopupID(),s=useRunCustomCodeFilter(i),l=useBreakpoint(),d=e.hideAfterFunnelStep==="signedUp"?!(r.hasEmail||r.hasPhone):e.hideAfterFunnelStep==="claimedReward"?!n:e.hideAfterFunnelStep==="never"?!0:assertNever(e.hideAfterFunnelStep),p=reactExports.useCallback(async(v,b)=>{!d||!await s()||t(v.id,{type:"trigger",triggerType:b})},[t,s,d]),m=l==="default"?e.triggers:e.desktopTriggers??e.triggers;useBasicTriggers({triggers:m,config:e,triggerStep:p}),useSmartTrigger({triggers:m,config:e,triggerStep:p})}const PopupTriggers=({value:e,goToPopupStep:t})=>{var i;const{initialData:r}=useCustomerAppContext();return(i=r.userFlow)!=null&&i.config.triggers?jsx(NewPopupTriggers,{goToPopupStep:t}):jsx(OldPopupTriggers,{value:e,goToPopupStep:t})},OldPopupTriggers=({value:e,goToPopupStep:t})=>(useOldPopupTriggers({value:e,goToPopupStep:t}),null),NewPopupTriggers=({goToPopupStep:e})=>(usePopupTrigger({goToPopupStep:e}),null),FlowPopup=({value:e})=>{var F;const t=e.config;useGroundIntegration();const r=useIntegrationPopupID(),n=(F=t.steps.find(q=>!q.isFloatingButton))==null?void 0:F.id,{initialData:i}=useCustomerAppContext(),s=useCreateUserAction(),{currentStep:l,pushStep:d,state:p,closePopup:m}=useFlowStateContext(),v=reactExports.useCallback((q=n,H)=>{const f=t.steps.find(g=>g.id===q);if(!f||!q)return;d({step:"popup",popupStepID:q,floatingButton:f.isFloatingButton,triggerType:H.type==="trigger"&&H.triggerType==="smart"?"smart":void 0})&&s({type:"popupStep",stepID:q,isFloatingButton:f.isFloatingButton===!0,reason:H})},[d,t,n,s]),b=reactExports.useCallback(()=>{logger.debug("Triggered programatically"),v(void 0,{type:"programmatic"})},[v]),{segmentID:S,flowID:$}=i.userFlow??{};useOnSDKMessage("open",reactExports.useCallback(({triggerID:q,campaignID:H})=>{if(H)H.toString()===(S==null?void 0:S.toString())&&b();else if(!q)b();else{const f=Number(q);if(!isNaN(f)){const w=getNewPopupID($??0);[r,w].includes(f)&&b()}}},[b,r,$,S]));const N=useIsFirstRender();reactExports.useEffect(()=>{if(!N)return;const q=["alia","alia_popup"],H=new URLSearchParams(window.location.search);q.some(w=>H.get(w)==="1")&&(logger.debug("Triggered by alia=1 param"),b())},[N,b]),reactExports.useEffect(()=>{const q=H=>{H.key==="Escape"&&l.step==="popup"&&m({type:"escapeKey"})};return getDocument().addEventListener("keydown",q),()=>getDocument().removeEventListener("keydown",q)}),useOnSDKMessage("close",reactExports.useCallback(()=>m({type:"programmatic"}),[m]));const D=reactExports.useMemo(()=>p==null?void 0:p.steps.filter(q=>q.step==="popup").map(q=>q.popupStepID).filter(Boolean),[p]),P=D.at(-1);return jsxs(reactExports.Suspense,{children:[jsx(PopupTriggers,{value:e,goToPopupStep:v}),l.step==="popup"&&jsx(CommonErrorBoundary,{onError:()=>m({type:"error"}),children:jsx(Popup,{stepID:P,setStepID:v,history:D,onClosePopup:m,template:t})})]})},{Provider:FlowStateContextProvider,useContext:useFlowStateContext}=createContextWithoutDefault("flow"),moreRecentOf=(e,t)=>e&&new Date(e.updatedAt)>new Date(t.updatedAt)?e:t;function useFlowState(){const{data:e}=useGetUserFlow();if(!e)throw new Error("Flow not found");const t=`user-flow-v2-${e.id}`,r=getFromStorage("local",t),n=moreRecentOf(r,e),[i,s]=reactExports.useState(n.state),{mediator:l}=useCustomerAppContext(),d=useUpdateOtherUserFlow(),{onPopupClose:p}=useClientIntegrations();useMediatorEvent("userFlowUpdate",({userFlow:P})=>d(P));const{mutateAsync:m}=useUpdateUserFlow(),v=reactExports.useCallback(async P=>{var F;s(P),setInStorage("local",t,{state:P,updatedAt:new Date().toISOString()}),await m(P),(F=l==null?void 0:l.emit)==null||F.call(l,{type:"userFlowUpdate",userFlow:{flowID:e.flowID,state:P}})},[m,t,l,e.flowID]),b=i.steps[i.steps.length-1],S=reactExports.useMemo(()=>[...i.steps].reverse().slice(1).find(P=>P.step!=="minimized")??{step:"popup"},[i.steps]),$=reactExports.useCallback(P=>{const F=l==null?void 0:l.state.modalFlowID;if(P.step==="popup"&&!P.floatingButton){if(F&&F!==e.flowID)return logger.debug("Not opening modal because another modal is open"),!1;l==null||l.update(()=>({modalFlowID:e.flowID}))}else F===e.flowID&&(l==null||l.update(()=>({modalFlowID:null})));return(b==null?void 0:b.step)==="popup"&&!b.floatingButton&&(P.step!=="popup"||P.floatingButton)&&p(),v({...i,steps:[...i.steps,{...P,timestamp:Date.now()}]}),!0},[i,v,l,e.flowID,p,b]),N=useCreateUserAction(),D=reactExports.useCallback(P=>{var F;if($({step:"minimized"}),N({type:"popupClose",reason:P}),P.type==="action"&&P.action.type==="closePopup"&&((F=P.action)!=null&&F.redirect)){const q=getRedirectPath(P.action.redirect);q&&new ShopifyUtils().redirect(q)}},[$,N]);return{state:i,currentStep:b??{step:"minimized"},lastStep:S,pushStep:$,closePopup:D}}function useIntegrationPopupID(){var t,r,n;const{initialData:e}=useCustomerAppContext();return((r=(t=e.userFlow)==null?void 0:t.config.popup)==null?void 0:r.triggerID)??getNewPopupID(((n=e.userFlow)==null?void 0:n.flowID)??0)}const UserFlow=()=>{var d;const{state:e,currentStep:t,lastStep:r,pushStep:n,closePopup:i}=useFlowState(),{initialData:s}=useCustomerAppContext(),l=(d=s.userFlow)==null?void 0:d.config.popup;return l?jsx(FlowStateContextProvider,{value:{state:e,currentStep:t,lastStep:r,pushStep:n,closePopup:i},children:jsx(FlowPopup,{value:l})}):null},appCSSRaw='@import"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap";#alia-root *:where(:not(html,body,svg,path)){all:revert}:host,#alia-root{--app-width: 360px;--body-font: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue";--display-font: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue";--border-radius-lg: 8px;--toastify-icon-color-info: white;--toastify-icon-color-success: white;--toastify-icon-color-warning: white;--toastify-icon-color-error: white;all:initial;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:host *,#alia-root *,:host :before,#alia-root :before,:host :after,#alia-root :after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }:host ::backdrop,#alia-root ::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }:host *,#alia-root *,:host :before,#alia-root :before,:host :after,#alia-root :after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:host :before,#alia-root :before,:host :after,#alia-root :after{--tw-content: ""}#alia-iframe-html,:host :host,#alia-root :host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}#alia-iframe-body{margin:0;line-height:inherit}:host hr,#alia-root hr{height:0;color:inherit;border-top-width:1px}:host abbr:where([title]),#alia-root abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}:host h1,#alia-root h1,:host h2,#alia-root h2,:host h3,#alia-root h3,:host h4,#alia-root h4,:host h5,#alia-root h5,:host h6,#alia-root h6{font-size:inherit;font-weight:inherit}:host a,#alia-root a{color:inherit;text-decoration:inherit}:host b,#alia-root b,:host strong,#alia-root strong{font-weight:bolder}:host code,#alia-root code,:host kbd,#alia-root kbd,:host samp,#alia-root samp,:host pre,#alia-root pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}:host small,#alia-root small{font-size:80%}:host sub,#alia-root sub,:host sup,#alia-root sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}:host sub,#alia-root sub{bottom:-.25em}:host sup,#alia-root sup{top:-.5em}:host table,#alia-root table{text-indent:0;border-color:inherit;border-collapse:collapse}:host button,#alia-root button,:host input,#alia-root input,:host optgroup,#alia-root optgroup,:host select,#alia-root select,:host textarea,#alia-root textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}:host button,#alia-root button,:host select,#alia-root select{text-transform:none}:host button,#alia-root button,:host input:where([type=button]),#alia-root input:where([type=button]),:host input:where([type=reset]),#alia-root input:where([type=reset]),:host input:where([type=submit]),#alia-root input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:host :-moz-focusring,#alia-root :-moz-focusring{outline:auto}:host :-moz-ui-invalid,#alia-root :-moz-ui-invalid{box-shadow:none}:host progress,#alia-root progress{vertical-align:baseline}:host ::-webkit-inner-spin-button,#alia-root ::-webkit-inner-spin-button,:host ::-webkit-outer-spin-button,#alia-root ::-webkit-outer-spin-button{height:auto}:host [type=search],#alia-root [type=search]{-webkit-appearance:textfield;outline-offset:-2px}:host ::-webkit-search-decoration,#alia-root ::-webkit-search-decoration{-webkit-appearance:none}:host ::-webkit-file-upload-button,#alia-root ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}:host summary,#alia-root summary{display:list-item}:host blockquote,#alia-root blockquote,:host dl,#alia-root dl,:host dd,#alia-root dd,:host h1,#alia-root h1,:host h2,#alia-root h2,:host h3,#alia-root h3,:host h4,#alia-root h4,:host h5,#alia-root h5,:host h6,#alia-root h6,:host hr,#alia-root hr,:host figure,#alia-root figure,:host p,#alia-root p,:host pre,#alia-root pre{margin:0}:host fieldset,#alia-root fieldset{margin:0;padding:0}:host legend,#alia-root legend{padding:0}:host ol,#alia-root ol,:host ul,#alia-root ul,:host menu,#alia-root menu{list-style:none;margin:0;padding:0}:host dialog,#alia-root dialog{padding:0}:host textarea,#alia-root textarea{resize:vertical}:host input::-moz-placeholder,#alia-root input::-moz-placeholder,:host textarea::-moz-placeholder,#alia-root textarea::-moz-placeholder{opacity:1;color:#9ca3af}:host input::placeholder,#alia-root input::placeholder,:host textarea::placeholder,#alia-root textarea::placeholder{opacity:1;color:#9ca3af}:host button,#alia-root button,:host [role=button],#alia-root [role=button]{cursor:pointer}:host :disabled,#alia-root :disabled{cursor:default}:host img,#alia-root img,:host svg,#alia-root svg,:host video,#alia-root video,:host canvas,#alia-root canvas,:host audio,#alia-root audio,:host iframe,#alia-root iframe,:host embed,#alia-root embed,:host object,#alia-root object{display:block;vertical-align:middle}:host img,#alia-root img,:host video,#alia-root video{max-width:100%;height:auto}:host [hidden]:where(:not([hidden=until-found])),#alia-root [hidden]:where(:not([hidden=until-found])){display:none}:host .container,#alia-root .container{width:100%}@media (min-width: 550px){:host .container,#alia-root .container{max-width:550px}}@media (min-width: 640px){:host .container,#alia-root .container{max-width:640px}}@media (min-width: 768px){:host .container,#alia-root .container{max-width:768px}}@media (min-width: 1024px){:host .container,#alia-root .container{max-width:1024px}}@media (min-width: 1280px){:host .container,#alia-root .container{max-width:1280px}}@media (min-width: 1536px){:host .container,#alia-root .container{max-width:1536px}}:host .prose,#alia-root .prose{color:var(--primary-color)}:host .pointer-events-none,#alia-root .pointer-events-none{pointer-events:none}:host .visible,#alia-root .visible{visibility:visible}:host .invisible,#alia-root .invisible{visibility:hidden}:host .static,#alia-root .static{position:static}:host .fixed,#alia-root .fixed{position:fixed}:host .absolute,#alia-root .absolute{position:absolute}:host .relative,#alia-root .relative{position:relative}:host .bottom-0,#alia-root .bottom-0{bottom:0}:host .left-0,#alia-root .left-0{left:0}:host .right-0,#alia-root .right-0{right:0}:host .top-0,#alia-root .top-0{top:0}:host .top-4,#alia-root .top-4{top:16px}:host .z-10,#alia-root .z-10{z-index:10}:host .z-20,#alia-root .z-20{z-index:20}:host .z-50,#alia-root .z-50{z-index:50}:host .m-auto,#alia-root .m-auto{margin:auto}:host .-mx-1,#alia-root .-mx-1{margin-left:-4px;margin-right:-4px}:host .-mx-2,#alia-root .-mx-2{margin-left:-8px;margin-right:-8px}:host .-mx-5,#alia-root .-mx-5{margin-left:-20px;margin-right:-20px}:host .-my-1,#alia-root .-my-1{margin-top:-4px;margin-bottom:-4px}:host .-mt-1,#alia-root .-mt-1{margin-top:-4px}:host .mb-1,#alia-root .mb-1{margin-bottom:4px}:host .mb-2,#alia-root .mb-2{margin-bottom:8px}:host .ml-2,#alia-root .ml-2{margin-left:8px}:host .mt-2,#alia-root .mt-2{margin-top:8px}:host .line-clamp-1,#alia-root .line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}:host .block,#alia-root .block{display:block}:host .inline,#alia-root .inline{display:inline}:host .flex,#alia-root .flex{display:flex}:host .inline-flex,#alia-root .inline-flex{display:inline-flex}:host .hidden,#alia-root .hidden{display:none}:host .h-1\\.5,#alia-root .h-1\\.5{height:6px}:host .h-10,#alia-root .h-10{height:40px}:host .h-2,#alia-root .h-2{height:8px}:host .h-2\\.5,#alia-root .h-2\\.5{height:10px}:host .h-20,#alia-root .h-20{height:80px}:host .h-3,#alia-root .h-3{height:12px}:host .h-5,#alia-root .h-5{height:20px}:host .h-6,#alia-root .h-6{height:24px}:host .h-8,#alia-root .h-8{height:32px}:host .h-\\[18px\\],#alia-root .h-\\[18px\\]{height:18px}:host .h-\\[4\\.5rem\\],#alia-root .h-\\[4\\.5rem\\]{height:72px}:host .h-full,#alia-root .h-full{height:100%}:host .h-px,#alia-root .h-px{height:1px}:host .max-h-16,#alia-root .max-h-16{max-height:64px}:host .max-h-40,#alia-root .max-h-40{max-height:160px}:host .min-h-0,#alia-root .min-h-0{min-height:0px}:host .min-h-\\[200px\\],#alia-root .min-h-\\[200px\\]{min-height:200px}:host .w-10,#alia-root .w-10{width:40px}:host .w-16,#alia-root .w-16{width:64px}:host .w-2,#alia-root .w-2{width:8px}:host .w-2\\.5,#alia-root .w-2\\.5{width:10px}:host .w-2\\/3,#alia-root .w-2\\/3{width:66.666667%}:host .w-20,#alia-root .w-20{width:80px}:host .w-3,#alia-root .w-3{width:12px}:host .w-3\\/4,#alia-root .w-3\\/4{width:75%}:host .w-4\\/5,#alia-root .w-4\\/5{width:80%}:host .w-5,#alia-root .w-5{width:20px}:host .w-5\\/6,#alia-root .w-5\\/6{width:83.333333%}:host .w-80,#alia-root .w-80{width:320px}:host .w-\\[18px\\],#alia-root .w-\\[18px\\]{width:18px}:host .w-\\[4\\.5rem\\],#alia-root .w-\\[4\\.5rem\\]{width:72px}:host .w-full,#alia-root .w-full{width:100%}:host .w-max,#alia-root .w-max{width:-moz-max-content;width:max-content}:host .max-w-sm,#alia-root .max-w-sm{max-width:384px}:host .flex-1,#alia-root .flex-1{flex:1 1 0%}:host .flex-shrink,#alia-root .flex-shrink{flex-shrink:1}:host .flex-shrink-0,#alia-root .flex-shrink-0{flex-shrink:0}:host .transform,#alia-root .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:host .cursor-default,#alia-root .cursor-default{cursor:default}:host .cursor-pointer,#alia-root .cursor-pointer{cursor:pointer}:host .select-all,#alia-root .select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}:host .resize,#alia-root .resize{resize:both}:host .appearance-none,#alia-root .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .flex-row-reverse,#alia-root .flex-row-reverse{flex-direction:row-reverse}:host .flex-col,#alia-root .flex-col{flex-direction:column}:host .flex-wrap,#alia-root .flex-wrap{flex-wrap:wrap}:host .items-start,#alia-root .items-start{align-items:flex-start}:host .items-center,#alia-root .items-center{align-items:center}:host .items-stretch,#alia-root .items-stretch{align-items:stretch}:host .justify-end,#alia-root .justify-end{justify-content:flex-end}:host .justify-center,#alia-root .justify-center{justify-content:center}:host .justify-between,#alia-root .justify-between{justify-content:space-between}:host .gap-0\\.5,#alia-root .gap-0\\.5{gap:2px}:host .gap-1,#alia-root .gap-1{gap:4px}:host .gap-1\\.5,#alia-root .gap-1\\.5{gap:6px}:host .gap-2,#alia-root .gap-2{gap:8px}:host .gap-2\\.5,#alia-root .gap-2\\.5{gap:10px}:host .gap-3,#alia-root .gap-3{gap:12px}:host .gap-4,#alia-root .gap-4{gap:16px}:host .gap-5,#alia-root .gap-5{gap:20px}:host .gap-6,#alia-root .gap-6{gap:24px}:host .space-x-1>:not([hidden])~:not([hidden]),#alia-root .space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(4px * var(--tw-space-x-reverse));margin-left:calc(4px * calc(1 - var(--tw-space-x-reverse)))}:host .space-x-2>:not([hidden])~:not([hidden]),#alia-root .space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}:host .space-x-3>:not([hidden])~:not([hidden]),#alia-root .space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(12px * var(--tw-space-x-reverse));margin-left:calc(12px * calc(1 - var(--tw-space-x-reverse)))}:host .space-x-4>:not([hidden])~:not([hidden]),#alia-root .space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(16px * var(--tw-space-x-reverse));margin-left:calc(16px * calc(1 - var(--tw-space-x-reverse)))}:host .space-y-0\\.5>:not([hidden])~:not([hidden]),#alia-root .space-y-0\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2px * var(--tw-space-y-reverse))}:host .space-y-1>:not([hidden])~:not([hidden]),#alia-root .space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4px * var(--tw-space-y-reverse))}:host .space-y-2>:not([hidden])~:not([hidden]),#alia-root .space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(8px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(8px * var(--tw-space-y-reverse))}:host .space-y-3>:not([hidden])~:not([hidden]),#alia-root .space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(12px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(12px * var(--tw-space-y-reverse))}:host .space-y-4>:not([hidden])~:not([hidden]),#alia-root .space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(16px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(16px * var(--tw-space-y-reverse))}:host .space-y-6>:not([hidden])~:not([hidden]),#alia-root .space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(24px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(24px * var(--tw-space-y-reverse))}:host .self-center,#alia-root .self-center{align-self:center}:host .overflow-hidden,#alia-root .overflow-hidden{overflow:hidden}:host .overflow-scroll,#alia-root .overflow-scroll{overflow:scroll}:host .rounded,#alia-root .rounded{border-radius:4px}:host .rounded-full,#alia-root .rounded-full{border-radius:9999px}:host .rounded-lg,#alia-root .rounded-lg{border-radius:var(--border-radius-lg)}:host .border,#alia-root .border{border-width:1px}:host .border-2,#alia-root .border-2{border-width:2px}:host .border-\\[2px\\],#alia-root .border-\\[2px\\]{border-width:2px}:host .border-accent,#alia-root .border-accent{border-color:rgb(var(--accent-color) / 1)}:host .border-accent-200,#alia-root .border-accent-200{border-color:rgb(var(--accent-color) / .3)}:host .border-accent-foreground,#alia-root .border-accent-foreground{border-color:rgb(var(--accent-foreground) / 1)}:host .bg-accent,#alia-root .bg-accent{background-color:rgb(var(--accent-color) / 1)}:host .bg-accent-100,#alia-root .bg-accent-100{background-color:rgb(var(--accent-color) / .2)}:host .bg-accent-200,#alia-root .bg-accent-200{background-color:rgb(var(--accent-color) / .3)}:host .bg-accent-600,#alia-root .bg-accent-600{background-color:rgb(var(--accent-color) / .7)}:host .bg-accent-800,#alia-root .bg-accent-800{background-color:rgb(var(--accent-color) / .9)}:host .bg-accent-900,#alia-root .bg-accent-900{background-color:rgb(var(--accent-color) / 1)}:host .bg-background,#alia-root .bg-background{background-color:rgb(var(--background-color) / 1)}:host .bg-background-300,#alia-root .bg-background-300{background-color:rgb(var(--background-color) / .4)}:host .bg-gray-200,#alia-root .bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}:host .bg-primary-50,#alia-root .bg-primary-50{background-color:rgb(var(--primary-color) / .1)}:host .object-cover,#alia-root .object-cover{-o-object-fit:cover;object-fit:cover}:host .p-3,#alia-root .p-3{padding:12px}:host .p-4,#alia-root .p-4{padding:16px}:host .p-5,#alia-root .p-5{padding:20px}:host .px-1,#alia-root .px-1{padding-left:4px;padding-right:4px}:host .px-2,#alia-root .px-2{padding-left:8px;padding-right:8px}:host .px-2\\.5,#alia-root .px-2\\.5{padding-left:10px;padding-right:10px}:host .px-5,#alia-root .px-5{padding-left:20px;padding-right:20px}:host .py-2,#alia-root .py-2{padding-top:8px;padding-bottom:8px}:host .py-px,#alia-root .py-px{padding-top:1px;padding-bottom:1px}:host .pb-2,#alia-root .pb-2{padding-bottom:8px}:host .pb-8,#alia-root .pb-8{padding-bottom:32px}:host .pl-0\\.5,#alia-root .pl-0\\.5{padding-left:2px}:host .pt-1,#alia-root .pt-1{padding-top:4px}:host .pt-2,#alia-root .pt-2{padding-top:8px}:host .text-center,#alia-root .text-center{text-align:center}:host .font-mono,#alia-root .font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}:host .text-\\[28px\\],#alia-root .text-\\[28px\\]{font-size:28px}:host .text-base,#alia-root .text-base{font-size:var(--body-text-size-base);line-height:var(--body-line-height-base);letter-spacing:var(--body-letter-spacing);font-weight:var(--body-font-weight-normal)}:host .text-lg,#alia-root .text-lg{font-size:var(--body-text-size-lg);line-height:var(--body-line-height-lg);letter-spacing:var(--body-letter-spacing);font-weight:var(--body-font-weight-normal)}:host .text-sm,#alia-root .text-sm{font-size:var(--body-text-size-sm);line-height:var(--body-line-height-sm);letter-spacing:var(--body-letter-spacing);font-weight:var(--body-font-weight-medium)}:host .text-xl,#alia-root .text-xl{font-size:var(--body-text-size-xl);line-height:var(--body-line-height-xl);letter-spacing:var(--body-letter-spacing);font-weight:var(--body-font-weight-medium)}:host .text-xs,#alia-root .text-xs{font-size:var(--body-text-size-xs);line-height:var(--body-line-height-xs);letter-spacing:var(--body-letter-spacing);font-weight:500}:host .font-bold,#alia-root .font-bold{font-weight:var(--body-font-weight-bold)}:host .font-medium,#alia-root .font-medium{font-weight:var(--body-font-weight-medium)}:host .font-normal,#alia-root .font-normal{font-weight:var(--body-font-weight-normal)}:host .font-semibold,#alia-root .font-semibold{font-weight:var(--body-font-weight-semibold)}:host .uppercase,#alia-root .uppercase{text-transform:uppercase}:host .\\!normal-case,#alia-root .\\!normal-case{text-transform:none!important}:host .italic,#alia-root .italic{font-style:italic}:host .leading-4,#alia-root .leading-4{line-height:16px}:host .leading-5,#alia-root .leading-5{line-height:20px}:host .leading-6,#alia-root .leading-6{line-height:24px}:host .leading-7,#alia-root .leading-7{line-height:28px}:host .tracking-tight,#alia-root .tracking-tight{letter-spacing:-.025em}:host .tracking-wide,#alia-root .tracking-wide{letter-spacing:.025em}:host .text-accent,#alia-root .text-accent{color:rgb(var(--accent-color) / 1)}:host .text-accent-foreground,#alia-root .text-accent-foreground{color:rgb(var(--accent-foreground) / 1)}:host .text-black,#alia-root .text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}:host .text-primary-300,#alia-root .text-primary-300{color:rgb(var(--primary-color) / .4)}:host .text-primary-400,#alia-root .text-primary-400{color:rgb(var(--primary-color) / .5)}:host .text-primary-500,#alia-root .text-primary-500{color:rgb(var(--primary-color) / .6)}:host .text-primary-600,#alia-root .text-primary-600{color:rgb(var(--primary-color) / .7)}:host .text-red-600,#alia-root .text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}:host .text-red-700,#alia-root .text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}:host .text-white,#alia-root .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}:host .underline,#alia-root .underline{text-decoration-line:underline}:host .opacity-0,#alia-root .opacity-0{opacity:0}:host .opacity-60,#alia-root .opacity-60{opacity:.6}:host .shadow,#alia-root .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:host .shadow-2xl,#alia-root .shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:host .shadow-lg,#alia-root .shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:host .outline-none,#alia-root .outline-none{outline:2px solid transparent;outline-offset:2px}:host .outline,#alia-root .outline{outline-style:solid}:host .ring-2,#alia-root .ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}:host .ring-accent-300,#alia-root .ring-accent-300{--tw-ring-color: rgb(var(--accent-color) / .4)}:host .ring-accent-900,#alia-root .ring-accent-900{--tw-ring-color: rgb(var(--accent-color) / 1)}:host .\\!filter,#alia-root .\\!filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}:host .filter,#alia-root .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:host .backdrop-blur-sm,#alia-root .backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}:host .backdrop-brightness-75,#alia-root .backdrop-brightness-75{--tw-backdrop-brightness: brightness(.75);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}:host .transition,#alia-root .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:host .transition-\\[transform\\,color\\,background-color\\,opacity\\,box-shadow\\],#alia-root .transition-\\[transform\\,color\\,background-color\\,opacity\\,box-shadow\\]{transition-property:transform,color,background-color,opacity,box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:host .transition-all,#alia-root .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:host .transition-opacity,#alia-root .transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:host .duration-100,#alia-root .duration-100{transition-duration:.1s}:host .duration-1000,#alia-root .duration-1000{transition-duration:1s}:host .duration-150,#alia-root .duration-150{transition-duration:.15s}:host .duration-200,#alia-root .duration-200{transition-duration:.2s}:host .duration-300,#alia-root .duration-300{transition-duration:.3s}:host .ease-in,#alia-root .ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}:host .scrollbar-hide,#alia-root .scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}:host .scrollbar-hide::-webkit-scrollbar,#alia-root .scrollbar-hide::-webkit-scrollbar{display:none}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}:host .duration-100,#alia-root .duration-100{animation-duration:.1s}:host .duration-1000,#alia-root .duration-1000{animation-duration:1s}:host .duration-150,#alia-root .duration-150{animation-duration:.15s}:host .duration-200,#alia-root .duration-200{animation-duration:.2s}:host .duration-300,#alia-root .duration-300{animation-duration:.3s}:host .ease-in,#alia-root .ease-in{animation-timing-function:cubic-bezier(.4,0,1,1)}:host .animation-duration-150,#alia-root .animation-duration-150{animation-duration:.15s}:host .text-start,#alia-root .text-start{text-align:start}:host .text-display-xs,#alia-root .text-display-xs{font-family:var(--display-font);font-size:var(--display-text-size-xs);line-height:var(--display-line-height-xs);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .text-display-sm,#alia-root .text-display-sm{font-family:var(--display-font);font-size:var(--display-text-size-sm);line-height:var(--display-line-height-sm);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .text-display,#alia-root .text-display{font-family:var(--display-font);font-size:var(--display-text-size-base);line-height:var(--display-line-height-base);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .text-display-lg,#alia-root .text-display-lg{font-family:var(--display-font);font-size:var(--display-text-size-lg);line-height:var(--display-line-height-lg);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .text-display-xl,#alia-root .text-display-xl{font-family:var(--display-font);font-size:var(--display-text-size-xl);line-height:var(--display-line-height-xl);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host code,#alia-root code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}:host .main,#alia-root .main{transition-property:opacity,transform}:host .main.animate-dimensions,#alia-root .main.animate-dimensions{transition-property:opacity,transform,width,height}:host .bulge:hover,#alia-root .bulge:hover{transform:scale(1.02)}:host .box,#alia-root .box{border-radius:var(--border-radius-lg);background-color:rgb(var(--primary-color) / .1);padding:16px;--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s;animation-duration:.3s}:host .box.theme,#alia-root .box.theme{background-color:rgb(var(--accent-color) / .2);--tw-shadow-color: rgb(var(--accent-color) / .1);--tw-shadow: var(--tw-shadow-colored)}:host .box.theme:hover,#alia-root .box.theme:hover{--tw-shadow-color: rgb(var(--accent-color) / .1);--tw-shadow: var(--tw-shadow-colored)}:host .box.disabled,#alia-root .box.disabled{pointer-events:none;opacity:.7}:host .box.clickable,#alia-root .box.clickable{cursor:pointer}:host .box.clickable:hover,#alia-root .box.clickable:hover{--tw-scale-x: 1.01;--tw-scale-y: 1.01;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);--tw-shadow-color: rgb(var(--accent-color) / .1);--tw-shadow: var(--tw-shadow-colored)}:host .fade-bottom,#alia-root .fade-bottom{position:relative}:host .fade-bottom:after,#alia-root .fade-bottom:after{content:"";position:absolute;z-index:1;bottom:0;left:0;pointer-events:none;background-image:linear-gradient(to bottom,#fff0,#f9fafb 95%);width:100%;height:2em}:host .prose>:first-child,#alia-root .prose>:first-child{margin-top:0}:host .prose>:has(>img),#alia-root .prose>:has(>img){display:flex;justify-content:center}:host .prose li::marker,#alia-root .prose li::marker{margin-right:0;color:rgb(var(--primary-color) / .5)}:host .shadow-bottom,#alia-root .shadow-bottom{box-shadow:0 6px 4px -4px #ddd}:host .pulse,#alia-root .pulse{animation:pulse 1.5s infinite}@keyframes pulse{0%{transform:scale(1)}40%{transform:scale(1.02)}to{transform:scale(1)}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-up{0%{translate:0 12px}to{translate:0 0}}@keyframes fade-down{0%{translate:0 -12px}to{translate:0 0}}@keyframes fade-left{0%{translate:12px}to{translate:0}}@keyframes fade-right{0%{translate:-12px}to{translate:0}}@keyframes slide-up{0%{translate:0 100%}to{translate:0 0}}@keyframes slide-down{0%{translate:0 -100%}to{translate:0 0}}@keyframes slide-left{0%{translate:100%}to{translate:0}}@keyframes slide-right{0%{translate:-100%}to{translate:0}}:host .animate-fade-in,#alia-root .animate-fade-in{animation-name:fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .animate-fade-in-up,#alia-root .animate-fade-in-up{animation-name:fade-up,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .animate-fade-in-down,#alia-root .animate-fade-in-down{animation-name:fade-down,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .animate-fade-in-left,#alia-root .animate-fade-in-left{animation-name:fade-left,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .animate-fade-in-right,#alia-root .animate-fade-in-right{animation-name:fade-right,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .animate-slide-up,#alia-root .animate-slide-up{animation-name:slide-up,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .animate-slide-down,#alia-root .animate-slide-down{animation-name:slide-down,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .animate-slide-left,#alia-root .animate-slide-left{animation-name:slide-left,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .animate-slide-right,#alia-root .animate-slide-right{animation-name:slide-right,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-500,#alia-root .slide-in-500{animation-duration:.5s;animation-name:fade-up,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-down-500,#alia-root .slide-in-down-500{animation-duration:.5s;animation-name:fade-down,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-left-500,#alia-root .slide-in-left-500{animation-duration:.5s;animation-name:fade-left,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-right-500,#alia-root .slide-in-right-500{animation-duration:.5s;animation-name:fade-right,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-500-delay-1000,#alia-root .slide-in-500-delay-1000{animation-delay:1s;animation-duration:.5s;animation-name:fade-up,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-down-500-delay-1000,#alia-root .slide-in-down-500-delay-1000{animation-delay:1s;animation-duration:.5s;animation-name:fade-down,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-left-500-delay-1000,#alia-root .slide-in-left-500-delay-1000{animation-delay:1s;animation-duration:.5s;animation-name:fade-left,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-right-500-delay-1000,#alia-root .slide-in-right-500-delay-1000{animation-delay:1s;animation-duration:.5s;animation-name:fade-right,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-full-1000,#alia-root .slide-in-full-1000{animation-duration:1s;animation-name:slide-up,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-down-full-1000,#alia-root .slide-in-down-full-1000{animation-duration:1s;animation-name:slide-down,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-left-full-1000,#alia-root .slide-in-left-full-1000{animation-duration:1s;animation-name:slide-left,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .slide-in-right-full-1000,#alia-root .slide-in-right-full-1000{animation-duration:1s;animation-name:slide-right,fade-in;animation-fill-mode:forwards;opacity:var(--initial-opacity, 0)}:host .fade-in-90-2000,#alia-root .fade-in-90-2000{opacity:0;animation-fill-mode:forwards;animation-name:fade-in;animation-delay:1.8s;animation-duration:.2s}:host .animatable,#alia-root .animatable{transition:all .3s ease-in-out}:host .pending-entrance,#alia-root .pending-entrance{--tw-translate-y: -4px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:0}:host .skeleton,#alia-root .skeleton{border-radius:var(--border-radius-lg);background-color:rgb(var(--accent-color) / 1);color:rgb(var(--accent-color) / 1);opacity:.3}@media (hover: hover){:host .shiny,#alia-root .shiny{position:relative;overflow:hidden}:host .shiny:before,#alia-root .shiny:before{z-index:100;content:"";position:absolute;display:block;width:50%;height:100%;background:linear-gradient(90deg,transparent,#ffffff20,transparent);transform:translate(-240px) skew(-20deg);transition:transform .5s ease-in-out;pointer-events:none}:host .shiny:hover:before,#alia-root .shiny:hover:before{transform:translate(30%) skew(-20deg)}:host .shiny-disabled:before,#alia-root .shiny-disabled:before{display:none!important}}:host .popup,#alia-root .popup{display:none}@media (min-width: 600px){:host .popup,#alia-root .popup{display:block}}:host .PhoneInputInput,#alia-root .PhoneInputInput{outline:none;background:none}:host .checked\\:border-accent-400:checked,#alia-root .checked\\:border-accent-400:checked{border-color:rgb(var(--accent-color) / .5)}:host .checked\\:border-accent-800:checked,#alia-root .checked\\:border-accent-800:checked{border-color:rgb(var(--accent-color) / .9)}:host .checked\\:bg-accent-800:checked,#alia-root .checked\\:bg-accent-800:checked{background-color:rgb(var(--accent-color) / .9)}:host .focus-within\\:text-accent:focus-within,#alia-root .focus-within\\:text-accent:focus-within{color:rgb(var(--accent-color) / 1)}:host .hover\\:scale-\\[1\\.01\\]:hover,#alia-root .hover\\:scale-\\[1\\.01\\]:hover{--tw-scale-x: 1.01;--tw-scale-y: 1.01;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:host .focus\\:ring-2:focus,#alia-root .focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}:host .disabled\\:pointer-events-none:disabled,#alia-root .disabled\\:pointer-events-none:disabled{pointer-events:none}:host .disabled\\:cursor-default:disabled,#alia-root .disabled\\:cursor-default:disabled{cursor:default}:host .disabled\\:opacity-50:disabled,#alia-root .disabled\\:opacity-50:disabled{opacity:.5}:host .group:hover .group-hover\\:translate-x-1,#alia-root .group:hover .group-hover\\:translate-x-1{--tw-translate-x: 4px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:host .peer:checked~.peer-checked\\:visible,#alia-root .peer:checked~.peer-checked\\:visible{visibility:visible}:host .peer:checked~.peer-checked\\:flex,#alia-root .peer:checked~.peer-checked\\:flex{display:flex}:host .peer:disabled~.peer-disabled\\:cursor-default,#alia-root .peer:disabled~.peer-disabled\\:cursor-default{cursor:default}:host .prose-h1\\:mb-3 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h1\\:mb-3 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){margin-bottom:12px}:host .prose-h1\\:mt-3\\.5 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h1\\:mt-3\\.5 :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:14px}:host .prose-h1\\:text-display-xl :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h1\\:text-display-xl :is(:where(h1):not(:where([class~=not-prose],[class~=not-prose] *))){font-family:var(--display-font);font-size:var(--display-text-size-xl);line-height:var(--display-line-height-xl);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .prose-h2\\:mb-2 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h2\\:mb-2 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){margin-bottom:8px}:host .prose-h2\\:mt-2\\.5 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h2\\:mt-2\\.5 :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:10px}:host .prose-h2\\:text-display-lg :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h2\\:text-display-lg :is(:where(h2):not(:where([class~=not-prose],[class~=not-prose] *))){font-family:var(--display-font);font-size:var(--display-text-size-lg);line-height:var(--display-line-height-lg);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .prose-h3\\:mb-1\\.5 :is(:where(h3):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h3\\:mb-1\\.5 :is(:where(h3):not(:where([class~=not-prose],[class~=not-prose] *))){margin-bottom:6px}:host .prose-h3\\:mt-2 :is(:where(h3):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h3\\:mt-2 :is(:where(h3):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:8px}:host .prose-h3\\:text-display :is(:where(h3):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h3\\:text-display :is(:where(h3):not(:where([class~=not-prose],[class~=not-prose] *))){font-family:var(--display-font);font-size:var(--display-text-size-base);line-height:var(--display-line-height-base);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .prose-h4\\:my-1\\.5 :is(:where(h4):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h4\\:my-1\\.5 :is(:where(h4):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:6px;margin-bottom:6px}:host .prose-h4\\:text-display-sm :is(:where(h4):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h4\\:text-display-sm :is(:where(h4):not(:where([class~=not-prose],[class~=not-prose] *))){font-family:var(--display-font);font-size:var(--display-text-size-sm);line-height:var(--display-line-height-sm);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .prose-h5\\:my-1\\.5 :is(:where(h5):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h5\\:my-1\\.5 :is(:where(h5):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:6px;margin-bottom:6px}:host .prose-h5\\:text-display-xs :is(:where(h5):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h5\\:text-display-xs :is(:where(h5):not(:where([class~=not-prose],[class~=not-prose] *))){font-family:var(--display-font);font-size:var(--display-text-size-xs);line-height:var(--display-line-height-xs);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .prose-h6\\:my-1\\.5 :is(:where(h6):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h6\\:my-1\\.5 :is(:where(h6):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:6px;margin-bottom:6px}:host .prose-h6\\:text-display-xs :is(:where(h6):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-h6\\:text-display-xs :is(:where(h6):not(:where([class~=not-prose],[class~=not-prose] *))){font-family:var(--display-font);font-size:var(--display-text-size-xs);line-height:var(--display-line-height-xs);letter-spacing:var(--display-letter-spacing);font-weight:var(--display-font-weight-semibold);text-transform:var(--display-font-transform)}:host .prose-p\\:mb-2 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-p\\:mb-2 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-bottom:8px}:host .prose-p\\:mt-1\\.5 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-p\\:mt-1\\.5 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:6px}:host .prose-p\\:text-lg :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-p\\:text-lg :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:var(--body-text-size-lg);line-height:var(--body-line-height-lg);letter-spacing:var(--body-letter-spacing);font-weight:var(--body-font-weight-normal)}:host .prose-p\\:leading-6 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-p\\:leading-6 :is(:where(p):not(:where([class~=not-prose],[class~=not-prose] *))){line-height:24px}:host .prose-a\\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-a\\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:underline}:host .prose-ol\\:my-2 :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-ol\\:my-2 :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:8px;margin-bottom:8px}:host .prose-ol\\:ml-6 :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-ol\\:ml-6 :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))){margin-left:24px}:host .prose-ol\\:list-decimal :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-ol\\:list-decimal :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))){list-style-type:decimal}:host .prose-ol\\:text-lg :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-ol\\:text-lg :is(:where(ol):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:var(--body-text-size-lg);line-height:var(--body-line-height-lg);letter-spacing:var(--body-letter-spacing);font-weight:var(--body-font-weight-normal)}:host .prose-ul\\:my-2 :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-ul\\:my-2 :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:8px;margin-bottom:8px}:host .prose-ul\\:ml-6 :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-ul\\:ml-6 :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))){margin-left:24px}:host .prose-ul\\:list-disc :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-ul\\:list-disc :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))){list-style-type:disc}:host .prose-ul\\:text-lg :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-ul\\:text-lg :is(:where(ul):not(:where([class~=not-prose],[class~=not-prose] *))){font-size:var(--body-text-size-lg);line-height:var(--body-line-height-lg);letter-spacing:var(--body-letter-spacing);font-weight:var(--body-font-weight-normal)}:host .prose-li\\:my-1 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-li\\:my-1 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:4px;margin-bottom:4px}:host .prose-li\\:leading-6 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-li\\:leading-6 :is(:where(li):not(:where([class~=not-prose],[class~=not-prose] *))){line-height:24px}:host .prose-img\\:my-3 :is(:where(img):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-img\\:my-3 :is(:where(img):not(:where([class~=not-prose],[class~=not-prose] *))){margin-top:12px;margin-bottom:12px}:host .prose-img\\:rounded-lg :is(:where(img):not(:where([class~=not-prose],[class~=not-prose] *))),#alia-root .prose-img\\:rounded-lg :is(:where(img):not(:where([class~=not-prose],[class~=not-prose] *))){border-radius:var(--border-radius-lg)}',App=()=>{const{preview:e}=useCustomerAppContext(),[t,r]=reactExports.useState(0);reactExports.useEffect(()=>{const s=l=>{l.persisted&&r(d=>d+1)};return window.addEventListener("pageshow",s),()=>{window.removeEventListener("pageshow",s)}},[]);const n=reactExports.useRef(new QueryClient({defaultOptions:{queries:{suspense:!0,useErrorBoundary:!0,staleTime:e?1/0:30*1e3,enabled:e?!1:void 0}}})),i=useCSS(appCSSRaw);return jsx(DefaultWindowSizeProvider,{children:jsxs(ToastProvider,{children:[jsx("style",{id:"customer-app-css",children:i}),jsx(QueryClientProvider,{client:n.current,children:jsx(reactExports.Suspense,{fallback:null,children:jsx(CommonErrorBoundary,{children:e?jsx(PopupPreview,{}):jsx(UserFlow,{})})})})]})},t)};function polyfillLocalstorage(){try{window.localStorage.setItem("alia-test","test")}catch{Object.defineProperty(window,"localStorage",{value:{_data:{},setItem:function(t,r){return this._data[t]=String(r)},getItem:function(t){return Object.prototype.hasOwnProperty.call(this._data,t)?this._data[t]:void 0},removeItem:function(t){return delete this._data[t]},clear:function(){return this._data={}}}})}}polyfillLocalstorage();const{Provider,useContext}=createContextWithoutDefault("customer-app"),useCustomerAppContext=useContext,CustomerAppContextProvider=Provider;window.mountAliaCustomerApp=mount;function mount({target:e,messages:t,shop:r,jwt:n,useShadowDOM:i,initialData:s,targetingArgs:l,preview:d,mediator:p}){var D;e.style.outline="none",e.style.display="none";const m=`alia-root-${((D=s.userFlow)==null?void 0:D.flowID)??0}`;e.id=m;let v,b;i?(v=e.shadowRoot??e.attachShadow({mode:"open"}),b=":host"):(v=e,b=`#${m}`);const S=ReactDOM.createRoot(v),$=P=>{e.style.display=P?"block":"none"};return S.render(jsx(CustomerAppContextProvider,{value:{messages:t,root:v,rootSelector:b,shop:r,jwt:n,setFrameStyles:N,setVisible:$,preview:d,initialData:s,targetingArgs:l,mediator:p},children:jsx(App,{})})),()=>{S.unmount(),Array.from(v.children).forEach(P=>{v.removeChild(P)})};function N({modal:P,styles:F,bodyStyles:q}){const H=[];return f(e,F),d||(f(getDocument().body,q),P&&w(e)),()=>H.forEach(g=>g());function f(g,C){const _=A=>A.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();for(const[A,k]of Object.entries(C))k===void 0?g.style.removeProperty(_(A)):g.style.setProperty(_(A),k);H.push(()=>{f(g,Object.fromEntries(Object.entries(C).map(([A])=>[A,void 0])))})}function w(g){g.setAttribute("tabindex","-1"),g.focus(),g.setAttribute("aria-modal","true"),g.setAttribute("role","dialog"),g.setAttribute("aria-label","Alia popup"),C(g),H.push(()=>{g.removeAttribute("aria-modal"),g.removeAttribute("role"),g.removeAttribute("aria-label")});function C(_){const A=setTimeout(()=>{const L=getDocument().activeElement;_.contains(L)||_.focus()},500),k=L=>{if(L.key==="Tab"){const re=getDocument().activeElement;if(re instanceof HTMLElement&&_.contains(re)){const K=_.querySelectorAll("a[href], button, input, textarea, select, details, [tabindex]:not([tabindex='-1'])"),ee=[_,...Array.from(K)].indexOf(re)%K.length,E=K[ee];E&&E instanceof HTMLElement&&(E.focus(),L.preventDefault())}}};getDocument().addEventListener("keydown",k),H.push(()=>{clearTimeout(A),getDocument().removeEventListener("keydown",k)})}}}}return exports.CustomerAppContextProvider=CustomerAppContextProvider,exports.useCustomerAppContext=useCustomerAppContext,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports}({});