!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="94ba920c-f16b-4826-9f19-29336365564a",e._sentryDebugIdIdentifier="sentry-dbid-94ba920c-f16b-4826-9f19-29336365564a")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2888],{8417:function(e,t,n){"use strict";n.d(t,{Z:function(){return V}});var r=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t;this._insertTag(((t=document.createElement("style")).setAttribute("data-emotion",this.key),void 0!==this.nonce&&t.setAttribute("nonce",this.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t))}var n=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(n);try{r.insertRule(e,r.cssRules.length)}catch(e){}}else n.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){return e.parentNode&&e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0},e}(),i=Math.abs,o=String.fromCharCode,s=Object.assign;function a(e,t,n){return e.replace(t,n)}function u(e,t){return e.indexOf(t)}function l(e,t){return 0|e.charCodeAt(t)}function c(e,t,n){return e.slice(t,n)}function d(e){return e.length}function h(e,t){return t.push(e),e}var f=1,p=1,g=0,m=0,y=0,v="";function _(e,t,n,r,i,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:f,column:p,length:s,return:""}}function b(e,t){return s(_("",null,null,"",null,null,0),e,{length:-e.length},t)}function w(){return y=m<g?l(v,m++):0,p++,10===y&&(p=1,f++),y}function S(){return l(v,m)}function E(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function k(e){return f=p=1,g=d(v=e),m=0,[]}function I(e){var t,n;return(t=m-1,n=function e(t){for(;w();)switch(y){case t:return m;case 34:case 39:34!==t&&39!==t&&e(y);break;case 40:41===t&&e(t);break;case 92:w()}return m}(91===e?e+2:40===e?e+1:e),c(v,t,n)).trim()}var T="-ms-",x="-moz-",C="-webkit-",A="comm",O="rule",N="decl",R="@keyframes";function D(e,t){for(var n="",r=e.length,i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function P(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case N:return e.return=e.return||e.value;case A:return"";case R:return e.return=e.value+"{"+D(e.children,r)+"}";case O:e.value=e.props.join(",")}return d(n=D(e.children,r))?e.return=e.value+"{"+n+"}":""}function M(e,t,n,r,o,s,u,l,d,h,f){for(var p=o-1,g=0===o?s:[""],m=g.length,y=0,v=0,b=0;y<r;++y)for(var w=0,S=c(e,p+1,p=i(v=u[y])),E=e;w<m;++w)(E=(v>0?g[w]+" "+S:a(S,/&\f/g,g[w])).trim())&&(d[b++]=E);return _(e,t,n,0===o?O:l,d,h,f)}function L(e,t,n,r){return _(e,t,n,N,c(e,0,r),c(e,r+1,-1),r)}var U=function(e,t,n){for(var r=0,i=0;r=i,i=S(),38===r&&12===i&&(t[n]=1),!E(i);)w();return c(v,e,m)},j=function(e,t){var n=-1,r=44;do switch(E(r)){case 0:38===r&&12===S()&&(t[n]=1),e[n]+=U(m-1,t,n);break;case 2:e[n]+=I(r);break;case 4:if(44===r){e[++n]=58===S()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=o(r)}while(r=w());return e},q=function(e,t){var n;return n=j(k(e),t),v="",n},F=new WeakMap,$=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||F.get(n))&&!r){F.set(e,!0);for(var i=[],o=q(t,i),s=n.props,a=0,u=0;a<o.length;a++)for(var l=0;l<s.length;l++,u++)e.props[u]=i[a]?o[a].replace(/&\f/g,s[l]):s[l]+" "+o[a]}}},B=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}},z=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case N:e.return=function e(t,n){switch(45^l(t,0)?(((n<<2^l(t,0))<<2^l(t,1))<<2^l(t,2))<<2^l(t,3):0){case 5103:return C+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return C+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return C+t+x+t+T+t+t;case 6828:case 4268:return C+t+T+t+t;case 6165:return C+t+T+"flex-"+t+t;case 5187:return C+t+a(t,/(\w+).+(:[^]+)/,C+"box-$1$2"+T+"flex-$1$2")+t;case 5443:return C+t+T+"flex-item-"+a(t,/flex-|-self/,"")+t;case 4675:return C+t+T+"flex-line-pack"+a(t,/align-content|flex-|-self/,"")+t;case 5548:return C+t+T+a(t,"shrink","negative")+t;case 5292:return C+t+T+a(t,"basis","preferred-size")+t;case 6060:return C+"box-"+a(t,"-grow","")+C+t+T+a(t,"grow","positive")+t;case 4554:return C+a(t,/([^-])(transform)/g,"$1"+C+"$2")+t;case 6187:return a(a(a(t,/(zoom-|grab)/,C+"$1"),/(image-set)/,C+"$1"),t,"")+t;case 5495:case 3959:return a(t,/(image-set\([^]*)/,C+"$1$`$1");case 4968:return a(a(t,/(.+:)(flex-)?(.*)/,C+"box-pack:$3"+T+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+C+t+t;case 4095:case 3583:case 4068:case 2532:return a(t,/(.+)-inline(.+)/,C+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(d(t)-1-n>6)switch(l(t,n+1)){case 109:if(45!==l(t,n+4))break;case 102:return a(t,/(.+:)(.+)-([^]+)/,"$1"+C+"$2-$3$1"+x+(108==l(t,n+3)?"$3":"$2-$3"))+t;case 115:return~u(t,"stretch")?e(a(t,"stretch","fill-available"),n)+t:t}break;case 4949:if(115!==l(t,n+1))break;case 6444:switch(l(t,d(t)-3-(~u(t,"!important")&&10))){case 107:return a(t,":",":"+C)+t;case 101:return a(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+C+(45===l(t,14)?"inline-":"")+"box$3$1"+C+"$2$3$1"+T+"$2box$3")+t}break;case 5936:switch(l(t,n+11)){case 114:return C+t+T+a(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return C+t+T+a(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return C+t+T+a(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return C+t+T+t+t}return t}(e.value,e.length);break;case R:return D([b(e,{value:a(e.value,"@","@"+C)})],r);case O:if(e.length)return e.props.map(function(t){var n;switch(n=t,(n=/(::plac\w+|:read-\w+)/.exec(n))?n[0]:n){case":read-only":case":read-write":return D([b(e,{props:[a(t,/:(read-\w+)/,":"+x+"$1")]})],r);case"::placeholder":return D([b(e,{props:[a(t,/:(plac\w+)/,":"+C+"input-$1")]}),b(e,{props:[a(t,/:(plac\w+)/,":"+x+"$1")]}),b(e,{props:[a(t,/:(plac\w+)/,T+"input-$1")]})],r)}return""}).join("")}}],V=function(e){var t,n,i,s,g,b=e.key;if("css"===b){var T=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(T,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var x=e.stylisPlugins||z,C={},O=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+b+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)C[t[n]]=!0;O.push(e)});var N=(n=(t=[$,B].concat(x,[P,(i=function(e){g.insert(e)},function(e){!e.root&&(e=e.return)&&i(e)})])).length,function(e,r,i,o){for(var s="",a=0;a<n;a++)s+=t[a](e,r,i,o)||"";return s}),R=function(e){var t,n;return D((n=function e(t,n,r,i,s,g,b,k,T){for(var x,C=0,O=0,N=b,R=0,D=0,P=0,U=1,j=1,q=1,F=0,$="",B=s,z=g,V=i,G=$;j;)switch(P=F,F=w()){case 40:if(108!=P&&58==l(G,N-1)){-1!=u(G+=a(I(F),"&","&\f"),"&\f")&&(q=-1);break}case 34:case 39:case 91:G+=I(F);break;case 9:case 10:case 13:case 32:G+=function(e){for(;y=S();)if(y<33)w();else break;return E(e)>2||E(y)>3?"":" "}(P);break;case 92:G+=function(e,t){for(var n;--t&&w()&&!(y<48)&&!(y>102)&&(!(y>57)||!(y<65))&&(!(y>70)||!(y<97)););return n=m+(t<6&&32==S()&&32==w()),c(v,e,n)}(m-1,7);continue;case 47:switch(S()){case 42:case 47:h(_(x=function(e,t){for(;w();)if(e+y===57)break;else if(e+y===84&&47===S())break;return"/*"+c(v,t,m-1)+"*"+o(47===e?e:w())}(w(),m),n,r,A,o(y),c(x,2,-2),0),T);break;default:G+="/"}break;case 123*U:k[C++]=d(G)*q;case 125*U:case 59:case 0:switch(F){case 0:case 125:j=0;case 59+O:-1==q&&(G=a(G,/\f/g,"")),D>0&&d(G)-N&&h(D>32?L(G+";",i,r,N-1):L(a(G," ","")+";",i,r,N-2),T);break;case 59:G+=";";default:if(h(V=M(G,n,r,C,O,s,k,$,B=[],z=[],N),g),123===F){if(0===O)e(G,n,V,V,B,g,N,k,z);else switch(99===R&&110===l(G,3)?100:R){case 100:case 108:case 109:case 115:e(t,V,V,i&&h(M(t,V,V,0,0,s,k,$,s,B=[],N),z),s,z,N,k,i?B:z);break;default:e(G,V,V,V,[""],z,0,k,z)}}}C=O=D=0,U=q=1,$=G="",N=b;break;case 58:N=1+d(G),D=P;default:if(U<1){if(123==F)--U;else if(125==F&&0==U++&&125==(y=m>0?l(v,--m):0,p--,10===y&&(p=1,f--),y))continue}switch(G+=o(F),F*U){case 38:q=O>0?1:(G+="\f",-1);break;case 44:k[C++]=(d(G)-1)*q,q=1;break;case 64:45===S()&&(G+=I(w())),R=S(),O=N=d($=G+=function(e){for(;!E(S());)w();return c(v,e,m)}(m)),F++;break;case 45:45===P&&2==d(G)&&(U=0)}}return g}("",null,null,null,[""],t=k(t=e),0,[0],t),v="",n),N)},U={key:b,sheet:new r({key:b,container:s,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:C,registered:{},insert:function(e,t,n,r){g=n,R(e?e+"{"+t.styles+"}":t.styles),r&&(U.inserted[t.name]=!0)}};return U.sheet.hydrate(O),U}},45042:function(e,t,n){"use strict";function r(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}n.d(t,{Z:function(){return r}})},48137:function(e,t,n){"use strict";n.d(t,{O:function(){return p}});var r,i={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},o=n(45042),s=/[A-Z]|^ms/g,a=/_EMO_([^_]+?)_([^]*?)_EMO_/g,u=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!=typeof e},c=(0,o.Z)(function(e){return u(e)?e:e.replace(s,"-$&").toLowerCase()}),d=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(a,function(e,t,n){return r={name:t,styles:n,next:r},t})}return 1===i[e]||u(e)||"number"!=typeof t||0===t?t:t+"px"};function h(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return r={name:n.name,styles:n.styles,next:r},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)r={name:i.name,styles:i.styles,next:r},i=i.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=h(e,t,n[i])+";";else for(var o in n){var s=n[o];if("object"!=typeof s)null!=t&&void 0!==t[s]?r+=o+"{"+t[s]+"}":l(s)&&(r+=c(o)+":"+d(o,s)+";");else if(Array.isArray(s)&&"string"==typeof s[0]&&(null==t||void 0===t[s[0]]))for(var a=0;a<s.length;a++)l(s[a])&&(r+=c(o)+":"+d(o,s[a])+";");else{var u=h(e,t,s);switch(o){case"animation":case"animationName":r+=c(o)+":"+u+";";break;default:r+=o+"{"+u+"}"}}}return r}(e,t,n);case"function":if(void 0!==e){var o=r,s=n(e);return r=o,h(e,t,s)}}if(null==t)return n;var a=t[n];return void 0!==a?a:n}var f=/label:\s*([^\s;\n{]+)\s*(;|$)/g,p=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var i,o=!0,s="";r=void 0;var a=e[0];null==a||void 0===a.raw?(o=!1,s+=h(n,t,a)):s+=a[0];for(var u=1;u<e.length;u++)s+=h(n,t,e[u]),o&&(s+=a[u]);f.lastIndex=0;for(var l="";null!==(i=f.exec(s));)l+="-"+i[1];return{name:function(e){for(var t,n=0,r=0,i=e.length;i>=4;++r,i-=4)t=(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))*1540483477+((t>>>16)*59797<<16),t^=t>>>24,n=(65535&t)*1540483477+((t>>>16)*59797<<16)^(65535&n)*1540483477+((n>>>16)*59797<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n^=255&e.charCodeAt(r),n=(65535&n)*1540483477+((n>>>16)*59797<<16)}return n^=n>>>13,(((n=(65535&n)*1540483477+((n>>>16)*59797<<16))^n>>>15)>>>0).toString(36)}(s)+l,styles:s,next:r}}},27278:function(e,t,n){"use strict";n.d(t,{L:function(){return s},j:function(){return a}});var r,i=n(67294),o=!!(r||(r=n.t(i,2))).useInsertionEffect&&(r||(r=n.t(i,2))).useInsertionEffect,s=o||function(e){return e()},a=o||i.useLayoutEffect},70444:function(e,t,n){"use strict";function r(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "}),r}n.d(t,{My:function(){return o},fp:function(){return r},hC:function(){return i}});var i=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},o=function(e,t,n){i(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next;while(void 0!==o)}}},74444:function(e,t,n){"use strict";n.d(t,{$s:function(){return $},BH:function(){return _},L:function(){return l},LL:function(){return O},P0:function(){return m},Pz:function(){return v},Sg:function(){return b},ZR:function(){return A},aH:function(){return y},b$:function(){return k},eu:function(){return x},hl:function(){return T},k$:function(){return F},m9:function(){return B},ne:function(){return U},pd:function(){return L},q4:function(){return g},ru:function(){return E},tV:function(){return c},uI:function(){return S},vZ:function(){return function e(t,n){if(t===n)return!0;let r=Object.keys(t),i=Object.keys(n);for(let o of r){if(!i.includes(o))return!1;let r=t[o],s=n[o];if(D(r)&&D(s)){if(!e(r,s))return!1}else if(r!==s)return!1}for(let e of i)if(!r.includes(e))return!1;return!0}},w1:function(){return I},xO:function(){return P},xb:function(){return R},z$:function(){return w},zI:function(){return C},zd:function(){return M}});var r=n(83454);/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let i=function(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:(i<2048?t[n++]=i>>6|192:((64512&i)==55296&&r+1<e.length&&(64512&e.charCodeAt(r+1))==56320?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128):t[n++]=i>>12|224,t[n++]=i>>6&63|128),t[n++]=63&i|128)}return t},o=function(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){let o=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){let o=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(o>>10)),t[r++]=String.fromCharCode(56320+(1023&o))}else{let o=e[n++],s=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return t.join("")},s={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();let n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let t=0;t<e.length;t+=3){let i=e[t],o=t+1<e.length,s=o?e[t+1]:0,a=t+2<e.length,u=a?e[t+2]:0,l=i>>2,c=(3&i)<<4|s>>4,d=(15&s)<<2|u>>6,h=63&u;a||(h=64,o||(d=64)),r.push(n[l],n[c],n[d],n[h])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(i(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):o(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();let n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let t=0;t<e.length;){let i=n[e.charAt(t++)],o=t<e.length?n[e.charAt(t)]:0,s=++t<e.length?n[e.charAt(t)]:64,u=++t<e.length?n[e.charAt(t)]:64;if(++t,null==i||null==o||null==s||null==u)throw new a;let l=i<<2|o>>4;if(r.push(l),64!==s){let e=o<<4&240|s>>2;if(r.push(e),64!==u){let e=s<<6&192|u;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class a extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}let u=function(e){let t=i(e);return s.encodeByteArray(t,!0)},l=function(e){return u(e).replace(/\./g,"")},c=function(e){try{return s.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null},d=()=>/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw Error("Unable to locate global object.")})().__FIREBASE_DEFAULTS__,h=()=>{if(void 0===r||void 0===r.env)return;let e=r.env.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},f=()=>{let e;if("undefined"==typeof document)return;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}let t=e&&c(e[1]);return t&&JSON.parse(t)},p=()=>{try{return d()||h()||f()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},g=e=>{var t,n;return null===(n=null===(t=p())||void 0===t?void 0:t.emulatorHosts)||void 0===n?void 0:n[e]},m=e=>{let t=g(e);if(!t)return;let n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw Error(`Invalid host ${t} with no separate hostname and port!`);let r=parseInt(t.substring(n+1),10);return"["===t[0]?[t.substring(1,n-1),r]:[t.substring(0,n),r]},y=()=>{var e;return null===(e=p())||void 0===e?void 0:e.config},v=e=>{var t;return null===(t=p())||void 0===t?void 0:t[`_${e}`]};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class _{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,n))}}}/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function b(e,t){if(e.uid)throw Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');let n=t||"demo-project",r=e.iat||0,i=e.sub||e.user_id;if(!i)throw Error("mockUserToken must contain 'sub' or 'user_id' field!");let o=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:r,exp:r+3600,auth_time:r,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},e);return[l(JSON.stringify({alg:"none",type:"JWT"})),l(JSON.stringify(o)),""].join(".")}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function w(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function S(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(w())}function E(){let e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function k(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function I(){let e=w();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function T(){try{return"object"==typeof indexedDB}catch(e){return!1}}function x(){return new Promise((e,t)=>{try{let n=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}})}function C(){return"undefined"!=typeof navigator&&!!navigator.cookieEnabled}class A extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,A.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,O.prototype.create)}}class O{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){let n=t[0]||{},r=`${this.service}/${e}`,i=this.errors[e],o=i?i.replace(N,(e,t)=>{let r=n[t];return null!=r?String(r):`<${t}?>`}):"Error",s=`${this.serviceName}: ${o} (${r}).`;return new A(r,s,n)}}let N=/\{\$([^}]+)}/g;function R(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function D(e){return null!==e&&"object"==typeof e}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function P(e){let t=[];for(let[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function M(e){let t={};return e.replace(/^\?/,"").split("&").forEach(e=>{if(e){let[n,r]=e.split("=");t[decodeURIComponent(n)]=decodeURIComponent(r)}}),t}function L(e){let t=e.indexOf("?");if(!t)return"";let n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}function U(e,t){let n=new j(e,t);return n.subscribe.bind(n)}class j{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,n){let r;if(void 0===e&&void 0===t&&void 0===n)throw Error("Missing Observer.");void 0===(r=!function(e,t){if("object"!=typeof e||null===e)return!1;for(let n of t)if(n in e&&"function"==typeof e[n])return!0;return!1}(e,["next","error","complete"])?{next:e,error:t,complete:n}:e).next&&(r.next=q),void 0===r.error&&(r.error=q),void 0===r.complete&&(r.complete=q);let i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(e){}}),this.observers.push(r),i}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function q(){}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let F=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})};function $(e,t=1e3,n=2){let r=t*Math.pow(n,e);return Math.min(144e5,r+Math.round(.5*r*(Math.random()-.5)*2))}/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function B(e){return e&&e._delegate?e._delegate:e}},95408:function(e,t,n){"use strict";n.d(t,{L7:function(){return u},P$:function(){return c},VO:function(){return i},W8:function(){return a},dt:function(){return l},k9:function(){return s}});var r=n(59766);let i={xs:0,sm:600,md:900,lg:1200,xl:1536},o={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${i[e]}px)`};function s(e,t,n){let r=e.theme||{};if(Array.isArray(t)){let e=r.breakpoints||o;return t.reduce((r,i,o)=>(r[e.up(e.keys[o])]=n(t[o]),r),{})}if("object"==typeof t){let e=r.breakpoints||o;return Object.keys(t).reduce((r,o)=>(-1!==Object.keys(e.values||i).indexOf(o)?r[e.up(o)]=n(t[o],o):r[o]=t[o],r),{})}return n(t)}function a(e={}){var t;return(null==(t=e.keys)?void 0:t.reduce((t,n)=>(t[e.up(n)]={},t),{}))||{}}function u(e,t){return e.reduce((e,t)=>{let n=e[t];return n&&0!==Object.keys(n).length||delete e[t],e},t)}function l(e,...t){let n=a(e),i=[n,...t].reduce((e,t)=>(0,r.Z)(e,t),{});return u(Object.keys(n),i)}function c({values:e,breakpoints:t,base:n}){let r;let i=Object.keys(n||function(e,t){if("object"!=typeof e)return{};let n={},r=Object.keys(t);return Array.isArray(e)?r.forEach((t,r)=>{r<e.length&&(n[t]=!0)}):r.forEach(t=>{null!=e[t]&&(n[t]=!0)}),n}(e,t));return 0===i.length?e:i.reduce((t,n,i)=>(Array.isArray(e)?(t[n]=null!=e[i]?e[i]:e[r],r=i):"object"==typeof e?(t[n]=null!=e[n]?e[n]:e[r],r=n):t[n]=e,t),{})}},41796:function(e,t,n){"use strict";n.d(t,{$n:function(){return d},Fq:function(){return l},_j:function(){return c},mi:function(){return u}});var r=n(71387);function i(e,t=0,n=1){return Math.min(Math.max(t,e),n)}function o(e){let t;if(e.type)return e;if("#"===e.charAt(0))return o(function(e){e=e.slice(1);let t=RegExp(`.{1,${e.length>=6?2:1}}`,"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map(e=>e+e)),n?`rgb${4===n.length?"a":""}(${n.map((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3).join(", ")})`:""}(e));let n=e.indexOf("("),i=e.substring(0,n);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(i))throw Error((0,r.Z)(9,e));let s=e.substring(n+1,e.length-1);if("color"===i){if(t=(s=s.split(" ")).shift(),4===s.length&&"/"===s[3].charAt(0)&&(s[3]=s[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(t))throw Error((0,r.Z)(10,t))}else s=s.split(",");return{type:i,values:s=s.map(e=>parseFloat(e)),colorSpace:t}}function s(e){let{type:t,colorSpace:n}=e,{values:r}=e;return -1!==t.indexOf("rgb")?r=r.map((e,t)=>t<3?parseInt(e,10):e):-1!==t.indexOf("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),r=-1!==t.indexOf("color")?`${n} ${r.join(" ")}`:`${r.join(", ")}`,`${t}(${r})`}function a(e){let t="hsl"===(e=o(e)).type||"hsla"===e.type?o(function(e){let{values:t}=e=o(e),n=t[0],r=t[1]/100,i=t[2]/100,a=r*Math.min(i,1-i),u=(e,t=(e+n/30)%12)=>i-a*Math.max(Math.min(t-3,9-t,1),-1),l="rgb",c=[Math.round(255*u(0)),Math.round(255*u(8)),Math.round(255*u(4))];return"hsla"===e.type&&(l+="a",c.push(t[3])),s({type:l,values:c})}(e)).values:e.values;return Number((.2126*(t=t.map(t=>("color"!==e.type&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4)))[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function u(e,t){let n=a(e),r=a(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function l(e,t){return e=o(e),t=i(t),("rgb"===e.type||"hsl"===e.type)&&(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,s(e)}function c(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return s(e)}function d(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return s(e)}},66500:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(87462),i=n(63366),o=n(59766);let s=["values","unit","step"],a=e=>{let t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>(0,r.Z)({},e,{[t.key]:t.val}),{})};var u={borderRadius:4},l=n(98700),c=n(86523),d=n(44920);let h=["breakpoints","palette","spacing","shape"];var f=function(e={},...t){let{breakpoints:n={},palette:f={},spacing:p,shape:g={}}=e,m=(0,i.Z)(e,h),y=function(e){let{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:o=5}=e,u=(0,i.Z)(e,s),l=a(t),c=Object.keys(l);function d(e){let r="number"==typeof t[e]?t[e]:e;return`@media (min-width:${r}${n})`}function h(e){let r="number"==typeof t[e]?t[e]:e;return`@media (max-width:${r-o/100}${n})`}function f(e,r){let i=c.indexOf(r);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${n}) and (max-width:${(-1!==i&&"number"==typeof t[c[i]]?t[c[i]]:r)-o/100}${n})`}return(0,r.Z)({keys:c,values:l,up:d,down:h,between:f,only:function(e){return c.indexOf(e)+1<c.length?f(e,c[c.indexOf(e)+1]):d(e)},not:function(e){let t=c.indexOf(e);return 0===t?d(c[1]):t===c.length-1?h(c[t]):f(e,c[c.indexOf(e)+1]).replace("@media","@media not all and")},unit:n},u)}(n),v=function(e=8){if(e.mui)return e;let t=(0,l.hB)({spacing:e}),n=(...e)=>(0===e.length?[1]:e).map(e=>{let n=t(e);return"number"==typeof n?`${n}px`:n}).join(" ");return n.mui=!0,n}(p),_=(0,o.Z)({breakpoints:y,direction:"ltr",components:{},palette:(0,r.Z)({mode:"light"},f),spacing:v,shape:(0,r.Z)({},u,g)},m);return(_=t.reduce((e,t)=>(0,o.Z)(e,t),_)).unstable_sxConfig=(0,r.Z)({},d.Z,null==m?void 0:m.unstable_sxConfig),_.unstable_sx=function(e){return(0,c.Z)({sx:e,theme:this})},_}},47730:function(e,t,n){"use strict";var r=n(59766);t.Z=function(e,t){return t?(0,r.Z)(e,t,{clone:!1}):e}},98700:function(e,t,n){"use strict";n.d(t,{hB:function(){return p},eI:function(){return f},NA:function(){return g},e6:function(){return y},o3:function(){return v}});var r=n(95408),i=n(54844),o=n(47730);let s={m:"margin",p:"padding"},a={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},u={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},l=function(e){let t={};return n=>(void 0===t[n]&&(t[n]=e(n)),t[n])}(e=>{if(e.length>2){if(!u[e])return[e];e=u[e]}let[t,n]=e.split(""),r=s[t],i=a[n]||"";return Array.isArray(i)?i.map(e=>r+e):[r+i]}),c=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],d=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],h=[...c,...d];function f(e,t,n,r){var o;let s=null!=(o=(0,i.DW)(e,t,!1))?o:n;return"number"==typeof s?e=>"string"==typeof e?e:s*e:Array.isArray(s)?e=>"string"==typeof e?e:s[e]:"function"==typeof s?s:()=>void 0}function p(e){return f(e,"spacing",8,"spacing")}function g(e,t){if("string"==typeof t||null==t)return t;let n=e(Math.abs(t));return t>=0?n:"number"==typeof n?-n:`-${n}`}function m(e,t){let n=p(e.theme);return Object.keys(e).map(i=>(function(e,t,n,i){var o;if(-1===t.indexOf(n))return null;let s=(o=l(n),e=>o.reduce((t,n)=>(t[n]=g(i,e),t),{})),a=e[n];return(0,r.k9)(e,a,s)})(e,t,i,n)).reduce(o.Z,{})}function y(e){return m(e,c)}function v(e){return m(e,d)}function _(e){return m(e,h)}y.propTypes={},y.filterProps=c,v.propTypes={},v.filterProps=d,_.propTypes={},_.filterProps=h},54844:function(e,t,n){"use strict";n.d(t,{DW:function(){return o},Jq:function(){return s}});var r=n(59182),i=n(95408);function o(e,t,n=!0){if(!t||"string"!=typeof t)return null;if(e&&e.vars&&n){let n=`vars.${t}`.split(".").reduce((e,t)=>e&&e[t]?e[t]:null,e);if(null!=n)return n}return t.split(".").reduce((e,t)=>e&&null!=e[t]?e[t]:null,e)}function s(e,t,n,r=n){let i;return i="function"==typeof e?e(n):Array.isArray(e)?e[n]||r:o(e,n)||r,t&&(i=t(i,r,e)),i}t.ZP=function(e){let{prop:t,cssProperty:n=e.prop,themeKey:a,transform:u}=e,l=e=>{if(null==e[t])return null;let l=e[t],c=o(e.theme,a)||{};return(0,i.k9)(e,l,e=>{let i=s(c,u,e);return(e===i&&"string"==typeof e&&(i=s(c,u,`${t}${"default"===e?"":(0,r.Z)(e)}`,e)),!1===n)?i:{[n]:i}})};return l.propTypes={},l.filterProps=[t],l}},44920:function(e,t,n){"use strict";n.d(t,{Z:function(){return U}});var r=n(98700),i=n(54844),o=n(47730),s=function(...e){let t=e.reduce((e,t)=>(t.filterProps.forEach(n=>{e[n]=t}),e),{}),n=e=>Object.keys(e).reduce((n,r)=>t[r]?(0,o.Z)(n,t[r](e)):n,{});return n.propTypes={},n.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),n},a=n(95408);function u(e){return"number"!=typeof e?e:`${e}px solid`}let l=(0,i.ZP)({prop:"border",themeKey:"borders",transform:u}),c=(0,i.ZP)({prop:"borderTop",themeKey:"borders",transform:u}),d=(0,i.ZP)({prop:"borderRight",themeKey:"borders",transform:u}),h=(0,i.ZP)({prop:"borderBottom",themeKey:"borders",transform:u}),f=(0,i.ZP)({prop:"borderLeft",themeKey:"borders",transform:u}),p=(0,i.ZP)({prop:"borderColor",themeKey:"palette"}),g=(0,i.ZP)({prop:"borderTopColor",themeKey:"palette"}),m=(0,i.ZP)({prop:"borderRightColor",themeKey:"palette"}),y=(0,i.ZP)({prop:"borderBottomColor",themeKey:"palette"}),v=(0,i.ZP)({prop:"borderLeftColor",themeKey:"palette"}),_=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){let t=(0,r.eI)(e.theme,"shape.borderRadius",4,"borderRadius");return(0,a.k9)(e,e.borderRadius,e=>({borderRadius:(0,r.NA)(t,e)}))}return null};_.propTypes={},_.filterProps=["borderRadius"],s(l,c,d,h,f,p,g,m,y,v,_);let b=e=>{if(void 0!==e.gap&&null!==e.gap){let t=(0,r.eI)(e.theme,"spacing",8,"gap");return(0,a.k9)(e,e.gap,e=>({gap:(0,r.NA)(t,e)}))}return null};b.propTypes={},b.filterProps=["gap"];let w=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){let t=(0,r.eI)(e.theme,"spacing",8,"columnGap");return(0,a.k9)(e,e.columnGap,e=>({columnGap:(0,r.NA)(t,e)}))}return null};w.propTypes={},w.filterProps=["columnGap"];let S=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){let t=(0,r.eI)(e.theme,"spacing",8,"rowGap");return(0,a.k9)(e,e.rowGap,e=>({rowGap:(0,r.NA)(t,e)}))}return null};S.propTypes={},S.filterProps=["rowGap"];let E=(0,i.ZP)({prop:"gridColumn"}),k=(0,i.ZP)({prop:"gridRow"}),I=(0,i.ZP)({prop:"gridAutoFlow"}),T=(0,i.ZP)({prop:"gridAutoColumns"}),x=(0,i.ZP)({prop:"gridAutoRows"}),C=(0,i.ZP)({prop:"gridTemplateColumns"});function A(e,t){return"grey"===t?t:e}function O(e){return e<=1&&0!==e?`${100*e}%`:e}s(b,w,S,E,k,I,T,x,C,(0,i.ZP)({prop:"gridTemplateRows"}),(0,i.ZP)({prop:"gridTemplateAreas"}),(0,i.ZP)({prop:"gridArea"})),s((0,i.ZP)({prop:"color",themeKey:"palette",transform:A}),(0,i.ZP)({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:A}),(0,i.ZP)({prop:"backgroundColor",themeKey:"palette",transform:A}));let N=(0,i.ZP)({prop:"width",transform:O}),R=e=>void 0!==e.maxWidth&&null!==e.maxWidth?(0,a.k9)(e,e.maxWidth,t=>{var n,r;let i=(null==(n=e.theme)||null==(n=n.breakpoints)||null==(n=n.values)?void 0:n[t])||a.VO[t];return i?(null==(r=e.theme)||null==(r=r.breakpoints)?void 0:r.unit)!=="px"?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:O(t)}}):null;R.filterProps=["maxWidth"];let D=(0,i.ZP)({prop:"minWidth",transform:O}),P=(0,i.ZP)({prop:"height",transform:O}),M=(0,i.ZP)({prop:"maxHeight",transform:O}),L=(0,i.ZP)({prop:"minHeight",transform:O});(0,i.ZP)({prop:"size",cssProperty:"width",transform:O}),(0,i.ZP)({prop:"size",cssProperty:"height",transform:O}),s(N,R,D,P,M,L,(0,i.ZP)({prop:"boxSizing"}));var U={border:{themeKey:"borders",transform:u},borderTop:{themeKey:"borders",transform:u},borderRight:{themeKey:"borders",transform:u},borderBottom:{themeKey:"borders",transform:u},borderLeft:{themeKey:"borders",transform:u},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:_},color:{themeKey:"palette",transform:A},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:A},backgroundColor:{themeKey:"palette",transform:A},p:{style:r.o3},pt:{style:r.o3},pr:{style:r.o3},pb:{style:r.o3},pl:{style:r.o3},px:{style:r.o3},py:{style:r.o3},padding:{style:r.o3},paddingTop:{style:r.o3},paddingRight:{style:r.o3},paddingBottom:{style:r.o3},paddingLeft:{style:r.o3},paddingX:{style:r.o3},paddingY:{style:r.o3},paddingInline:{style:r.o3},paddingInlineStart:{style:r.o3},paddingInlineEnd:{style:r.o3},paddingBlock:{style:r.o3},paddingBlockStart:{style:r.o3},paddingBlockEnd:{style:r.o3},m:{style:r.e6},mt:{style:r.e6},mr:{style:r.e6},mb:{style:r.e6},ml:{style:r.e6},mx:{style:r.e6},my:{style:r.e6},margin:{style:r.e6},marginTop:{style:r.e6},marginRight:{style:r.e6},marginBottom:{style:r.e6},marginLeft:{style:r.e6},marginX:{style:r.e6},marginY:{style:r.e6},marginInline:{style:r.e6},marginInlineStart:{style:r.e6},marginInlineEnd:{style:r.e6},marginBlock:{style:r.e6},marginBlockStart:{style:r.e6},marginBlockEnd:{style:r.e6},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:b},rowGap:{style:S},columnGap:{style:w},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:O},maxWidth:{style:R},minWidth:{transform:O},height:{transform:O},maxHeight:{transform:O},minHeight:{transform:O},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}}},86523:function(e,t,n){"use strict";var r=n(59182),i=n(47730),o=n(54844),s=n(95408),a=n(44920);let u=function(){function e(e,t,n,i){let a={[e]:t,theme:n},u=i[e];if(!u)return{[e]:t};let{cssProperty:l=e,themeKey:c,transform:d,style:h}=u;if(null==t)return null;if("typography"===c&&"inherit"===t)return{[e]:t};let f=(0,o.DW)(n,c)||{};return h?h(a):(0,s.k9)(a,t,t=>{let n=(0,o.Jq)(f,d,t);return(t===n&&"string"==typeof t&&(n=(0,o.Jq)(f,d,`${e}${"default"===t?"":(0,r.Z)(t)}`,t)),!1===l)?n:{[l]:n}})}return function t(n){var r;let{sx:o,theme:u={}}=n||{};if(!o)return null;let l=null!=(r=u.unstable_sxConfig)?r:a.Z;function c(n){let r=n;if("function"==typeof n)r=n(u);else if("object"!=typeof n)return n;if(!r)return null;let o=(0,s.W8)(u.breakpoints),a=Object.keys(o),c=o;return Object.keys(r).forEach(n=>{var o;let a="function"==typeof(o=r[n])?o(u):o;if(null!=a){if("object"==typeof a){if(l[n])c=(0,i.Z)(c,e(n,a,u,l));else{let e=(0,s.k9)({theme:u},a,e=>({[n]:e}));(function(...e){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]),n=new Set(t);return e.every(e=>n.size===Object.keys(e).length)})(e,a)?c[n]=t({sx:a,theme:u}):c=(0,i.Z)(c,e)}}else c=(0,i.Z)(c,e(n,a,u,l))}}),(0,s.L7)(a,c)}return Array.isArray(o)?o.map(c):c(o)}}();u.filterProps=["sx"],t.Z=u},96682:function(e,t,n){"use strict";var r=n(66500),i=n(34168);let o=(0,r.Z)();t.Z=function(e=o){return(0,i.Z)(e)}},20539:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(47925);function i(e){let{theme:t,name:n,props:i}=e;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?(0,r.Z)(t.components[n].defaultProps,i):i}},29628:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(20539),i=n(96682);function o({props:e,name:t,defaultTheme:n,themeId:o}){let s=(0,i.Z)(n);return o&&(s=s[o]||s),(0,r.Z)({theme:s,name:t,props:e})}},34168:function(e,t,n){"use strict";var r=n(67294),i=n(40712);t.Z=function(e=null){let t=r.useContext(i.T);return t&&0!==Object.keys(t).length?t:e}},59182:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(71387);function i(e){if("string"!=typeof e)throw Error((0,r.Z)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},59766:function(e,t,n){"use strict";n.d(t,{P:function(){return i},Z:function(){return function e(t,n,o={clone:!0}){let s=o.clone?(0,r.Z)({},t):t;return i(t)&&i(n)&&Object.keys(n).forEach(r=>{"__proto__"!==r&&(i(n[r])&&r in t&&i(t[r])?s[r]=e(t[r],n[r],o):o.clone?s[r]=i(n[r])?function e(t){if(!i(t))return t;let n={};return Object.keys(t).forEach(r=>{n[r]=e(t[r])}),n}(n[r]):n[r]:s[r]=n[r])}),s}}});var r=n(87462);function i(e){return null!==e&&"object"==typeof e&&e.constructor===Object}},71387:function(e,t,n){"use strict";function r(e){let t="https://mui.com/production-error/?code="+e;for(let e=1;e<arguments.length;e+=1)t+="&args[]="+encodeURIComponent(arguments[e]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}n.d(t,{Z:function(){return r}})},47925:function(e,t,n){"use strict";n.d(t,{Z:function(){return function e(t,n){let i=(0,r.Z)({},n);return Object.keys(t).forEach(o=>{if(o.toString().match(/^(components|slots)$/))i[o]=(0,r.Z)({},t[o],i[o]);else if(o.toString().match(/^(componentsProps|slotProps)$/)){let s=t[o]||{},a=n[o];i[o]={},a&&Object.keys(a)?s&&Object.keys(s)?(i[o]=(0,r.Z)({},a),Object.keys(s).forEach(t=>{i[o][t]=e(s[t],a[t])})):i[o]=a:i[o]=s}else void 0===i[o]&&(i[o]=t[o])}),i}}});var r=n(87462)},8679:function(e,t,n){"use strict";var r=n(21296),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function u(e){return r.isMemo(e)?s:a[e.$$typeof]||i}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=s;var l=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var i=f(n);i&&i!==p&&e(t,i,r)}var s=c(n);d&&(s=s.concat(d(n)));for(var a=u(t),g=u(n),m=0;m<s.length;++m){var y=s[m];if(!o[y]&&!(r&&r[y])&&!(g&&g[y])&&!(a&&a[y])){var v=h(n,y);try{l(t,y,v)}catch(e){}}}}return t}},96103:function(e,t){"use strict";/** @license React v16.13.1
 * react-is.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 n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,_=n?Symbol.for("react.responder"):60118,b=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case d:case o:case a:case s:case f:return e;default:switch(e=e&&e.$$typeof){case l:case h:case m:case g:case u:return e;default:return t}}case i:return t}}}function S(e){return w(e)===d}t.AsyncMode=c,t.ConcurrentMode=d,t.ContextConsumer=l,t.ContextProvider=u,t.Element=r,t.ForwardRef=h,t.Fragment=o,t.Lazy=m,t.Memo=g,t.Portal=i,t.Profiler=a,t.StrictMode=s,t.Suspense=f,t.isAsyncMode=function(e){return S(e)||w(e)===c},t.isConcurrentMode=S,t.isContextConsumer=function(e){return w(e)===l},t.isContextProvider=function(e){return w(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===h},t.isFragment=function(e){return w(e)===o},t.isLazy=function(e){return w(e)===m},t.isMemo=function(e){return w(e)===g},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===a},t.isStrictMode=function(e){return w(e)===s},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===a||e===s||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===u||e.$$typeof===l||e.$$typeof===h||e.$$typeof===v||e.$$typeof===_||e.$$typeof===b||e.$$typeof===y)},t.typeOf=w},21296:function(e,t,n){"use strict";e.exports=n(96103)},18552:function(e,t,n){var r=n(10852)(n(55639),"DataView");e.exports=r},1989:function(e,t,n){var r=n(51789),i=n(80401),o=n(57667),s=n(21327),a=n(81866);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=s,u.prototype.set=a,e.exports=u},38407:function(e,t,n){var r=n(27040),i=n(14125),o=n(82117),s=n(67518),a=n(54705);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=s,u.prototype.set=a,e.exports=u},57071:function(e,t,n){var r=n(10852)(n(55639),"Map");e.exports=r},83369:function(e,t,n){var r=n(24785),i=n(11285),o=n(96e3),s=n(49916),a=n(95265);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=s,u.prototype.set=a,e.exports=u},53818:function(e,t,n){var r=n(10852)(n(55639),"Promise");e.exports=r},58525:function(e,t,n){var r=n(10852)(n(55639),"Set");e.exports=r},88668:function(e,t,n){var r=n(83369),i=n(90619),o=n(72385);function s(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}s.prototype.add=s.prototype.push=i,s.prototype.has=o,e.exports=s},46384:function(e,t,n){var r=n(38407),i=n(37465),o=n(63779),s=n(67599),a=n(44758),u=n(34309);function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=i,l.prototype.delete=o,l.prototype.get=s,l.prototype.has=a,l.prototype.set=u,e.exports=l},62705:function(e,t,n){var r=n(55639).Symbol;e.exports=r},11149:function(e,t,n){var r=n(55639).Uint8Array;e.exports=r},70577:function(e,t,n){var r=n(10852)(n(55639),"WeakMap");e.exports=r},34963:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}},14636:function(e,t,n){var r=n(22545),i=n(35694),o=n(1469),s=n(44144),a=n(65776),u=n(36719),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),c=!n&&i(e),d=!n&&!c&&s(e),h=!n&&!c&&!d&&u(e),f=n||c||d||h,p=f?r(e.length,String):[],g=p.length;for(var m in e)(t||l.call(e,m))&&!(f&&("length"==m||d&&("offset"==m||"parent"==m)||h&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,g)))&&p.push(m);return p}},29932:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},62488:function(e){e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},82908:function(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},34865:function(e,t,n){var r=n(89465),i=n(77813),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var s=e[t];o.call(e,t)&&i(s,n)&&(void 0!==n||t in e)||r(e,t,n)}},18470:function(e,t,n){var r=n(77813);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return -1}},89465:function(e,t,n){var r=n(38777);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},97786:function(e,t,n){var r=n(71811),i=n(40327);e.exports=function(e,t){t=r(t,e);for(var n=0,o=t.length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},68866:function(e,t,n){var r=n(62488),i=n(1469);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},44239:function(e,t,n){var r=n(62705),i=n(89607),o=n(2333),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},13:function(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},9454:function(e,t,n){var r=n(44239),i=n(37005);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},90939:function(e,t,n){var r=n(2492),i=n(37005);e.exports=function e(t,n,o,s,a){return t===n||(null!=t&&null!=n&&(i(t)||i(n))?r(t,n,o,s,e,a):t!=t&&n!=n)}},2492:function(e,t,n){var r=n(46384),i=n(67114),o=n(18351),s=n(16096),a=n(64160),u=n(1469),l=n(44144),c=n(36719),d="[object Arguments]",h="[object Array]",f="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,m,y){var v=u(e),_=u(t),b=v?h:a(e),w=_?h:a(t);b=b==d?f:b,w=w==d?f:w;var S=b==f,E=w==f,k=b==w;if(k&&l(e)){if(!l(t))return!1;v=!0,S=!1}if(k&&!S)return y||(y=new r),v||c(e)?i(e,t,n,g,m,y):o(e,t,b,n,g,m,y);if(!(1&n)){var I=S&&p.call(e,"__wrapped__"),T=E&&p.call(t,"__wrapped__");if(I||T){var x=I?e.value():e,C=T?t.value():t;return y||(y=new r),m(x,C,n,g,y)}}return!!k&&(y||(y=new r),s(e,t,n,g,m,y))}},2958:function(e,t,n){var r=n(46384),i=n(90939);e.exports=function(e,t,n,o){var s=n.length,a=s,u=!o;if(null==e)return!a;for(e=Object(e);s--;){var l=n[s];if(u&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++s<a;){var c=(l=n[s])[0],d=e[c],h=l[1];if(u&&l[2]){if(void 0===d&&!(c in e))return!1}else{var f=new r;if(o)var p=o(d,h,c,e,t,f);if(!(void 0===p?i(h,d,3,o,f):p))return!1}}return!0}},28458:function(e,t,n){var r=n(23560),i=n(15346),o=n(13218),s=n(80346),a=/^\[object .+?Constructor\]$/,u=Object.prototype,l=Function.prototype.toString,c=u.hasOwnProperty,d=RegExp("^"+l.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?d:a).test(s(e))}},38749:function(e,t,n){var r=n(44239),i=n(41780),o=n(37005),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!s[r(e)]}},67206:function(e,t,n){var r=n(91573),i=n(16432),o=n(6557),s=n(1469),a=n(39601);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?s(e)?i(e[0],e[1]):r(e):a(e)}},280:function(e,t,n){var r=n(25726),i=n(86916),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},10313:function(e,t,n){var r=n(13218),i=n(25726),o=n(33498),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var a in e)"constructor"==a&&(t||!s.call(e,a))||n.push(a);return n}},91573:function(e,t,n){var r=n(2958),i=n(1499),o=n(42634);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},16432:function(e,t,n){var r=n(90939),i=n(27361),o=n(79095),s=n(15403),a=n(89162),u=n(42634),l=n(40327);e.exports=function(e,t){return s(e)&&a(t)?u(l(e),t):function(n){var s=i(n,e);return void 0===s&&s===t?o(n,e):r(t,s,3)}}},63012:function(e,t,n){var r=n(97786),i=n(10611),o=n(71811);e.exports=function(e,t,n){for(var s=-1,a=t.length,u={};++s<a;){var l=t[s],c=r(e,l);n(c,l)&&i(u,o(l,e),c)}return u}},40371:function(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},79152:function(e,t,n){var r=n(97786);e.exports=function(e){return function(t){return r(t,e)}}},10611:function(e,t,n){var r=n(34865),i=n(71811),o=n(65776),s=n(13218),a=n(40327);e.exports=function(e,t,n,u){if(!s(e))return e;t=i(t,e);for(var l=-1,c=t.length,d=c-1,h=e;null!=h&&++l<c;){var f=a(t[l]),p=n;if("__proto__"===f||"constructor"===f||"prototype"===f)break;if(l!=d){var g=h[f];void 0===(p=u?u(g,f,h):void 0)&&(p=s(g)?g:o(t[l+1])?[]:{})}r(h,f,p),h=h[f]}return e}},22545:function(e){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},80531:function(e,t,n){var r=n(62705),i=n(29932),o=n(1469),s=n(33448),a=1/0,u=r?r.prototype:void 0,l=u?u.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(s(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-a?"-0":n}},7518:function(e){e.exports=function(e){return function(t){return e(t)}}},74757:function(e){e.exports=function(e,t){return e.has(t)}},71811:function(e,t,n){var r=n(1469),i=n(15403),o=n(55514),s=n(79833);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(s(e))}},14429:function(e,t,n){var r=n(55639)["__core-js_shared__"];e.exports=r},38777:function(e,t,n){var r=n(10852),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},67114:function(e,t,n){var r=n(88668),i=n(82908),o=n(74757);e.exports=function(e,t,n,s,a,u){var l=1&n,c=e.length,d=t.length;if(c!=d&&!(l&&d>c))return!1;var h=u.get(e),f=u.get(t);if(h&&f)return h==t&&f==e;var p=-1,g=!0,m=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++p<c;){var y=e[p],v=t[p];if(s)var _=l?s(v,y,p,t,e,u):s(y,v,p,e,t,u);if(void 0!==_){if(_)continue;g=!1;break}if(m){if(!i(t,function(e,t){if(!o(m,t)&&(y===e||a(y,e,n,s,u)))return m.push(t)})){g=!1;break}}else if(!(y===v||a(y,v,n,s,u))){g=!1;break}}return u.delete(e),u.delete(t),g}},18351:function(e,t,n){var r=n(62705),i=n(11149),o=n(77813),s=n(67114),a=n(68776),u=n(21814),l=r?r.prototype:void 0,c=l?l.valueOf:void 0;e.exports=function(e,t,n,r,l,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!d(new i(e),new i(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=a;case"[object Set]":var p=1&r;if(f||(f=u),e.size!=t.size&&!p)break;var g=h.get(e);if(g)return g==t;r|=2,h.set(e,t);var m=s(f(e),f(t),r,l,d,h);return h.delete(e),m;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},16096:function(e,t,n){var r=n(58234),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,s,a){var u=1&n,l=r(e),c=l.length;if(c!=r(t).length&&!u)return!1;for(var d=c;d--;){var h=l[d];if(!(u?h in t:i.call(t,h)))return!1}var f=a.get(e),p=a.get(t);if(f&&p)return f==t&&p==e;var g=!0;a.set(e,t),a.set(t,e);for(var m=u;++d<c;){var y=e[h=l[d]],v=t[h];if(o)var _=u?o(v,y,h,t,e,a):o(y,v,h,e,t,a);if(!(void 0===_?y===v||s(y,v,n,o,a):_)){g=!1;break}m||(m="constructor"==h)}if(g&&!m){var b=e.constructor,w=t.constructor;b!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(g=!1)}return a.delete(e),a.delete(t),g}},31957:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},58234:function(e,t,n){var r=n(68866),i=n(99551),o=n(3674);e.exports=function(e){return r(e,o,i)}},46904:function(e,t,n){var r=n(68866),i=n(51442),o=n(81704);e.exports=function(e){return r(e,o,i)}},45050:function(e,t,n){var r=n(37019);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},1499:function(e,t,n){var r=n(89162),i=n(3674);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],s=e[o];t[n]=[o,s,r(s)]}return t}},10852:function(e,t,n){var r=n(28458),i=n(47801);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},85924:function(e,t,n){var r=n(5569)(Object.getPrototypeOf,Object);e.exports=r},89607:function(e,t,n){var r=n(62705),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[a]=n:delete e[a]),i}},99551:function(e,t,n){var r=n(34963),i=n(70479),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(e){return null==e?[]:r(s(e=Object(e)),function(t){return o.call(e,t)})}:i;e.exports=a},51442:function(e,t,n){var r=n(62488),i=n(85924),o=n(99551),s=n(70479),a=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:s;e.exports=a},64160:function(e,t,n){var r=n(18552),i=n(57071),o=n(53818),s=n(58525),a=n(70577),u=n(44239),l=n(80346),c="[object Map]",d="[object Promise]",h="[object Set]",f="[object WeakMap]",p="[object DataView]",g=l(r),m=l(i),y=l(o),v=l(s),_=l(a),b=u;(r&&b(new r(new ArrayBuffer(1)))!=p||i&&b(new i)!=c||o&&b(o.resolve())!=d||s&&b(new s)!=h||a&&b(new a)!=f)&&(b=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case g:return p;case m:return c;case y:return d;case v:return h;case _:return f}return t}),e.exports=b},47801:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},222:function(e,t,n){var r=n(71811),i=n(35694),o=n(1469),s=n(65776),a=n(41780),u=n(40327);e.exports=function(e,t,n){t=r(t,e);for(var l=-1,c=t.length,d=!1;++l<c;){var h=u(t[l]);if(!(d=null!=e&&n(e,h)))break;e=e[h]}return d||++l!=c?d:!!(c=null==e?0:e.length)&&a(c)&&s(h,c)&&(o(e)||i(e))}},51789:function(e,t,n){var r=n(94536);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},80401:function(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},57667:function(e,t,n){var r=n(94536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},21327:function(e,t,n){var r=n(94536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},81866:function(e,t,n){var r=n(94536);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},65776:function(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},15403:function(e,t,n){var r=n(1469),i=n(33448),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||i(e))||s.test(e)||!o.test(e)||null!=t&&e in Object(t)}},37019:function(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},15346:function(e,t,n){var r,i=n(14429),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},25726:function(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},89162:function(e,t,n){var r=n(13218);e.exports=function(e){return e==e&&!r(e)}},27040:function(e){e.exports=function(){this.__data__=[],this.size=0}},14125:function(e,t,n){var r=n(18470),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},82117:function(e,t,n){var r=n(18470);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},67518:function(e,t,n){var r=n(18470);e.exports=function(e){return r(this.__data__,e)>-1}},54705:function(e,t,n){var r=n(18470);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},24785:function(e,t,n){var r=n(1989),i=n(38407),o=n(57071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},11285:function(e,t,n){var r=n(45050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},96e3:function(e,t,n){var r=n(45050);e.exports=function(e){return r(this,e).get(e)}},49916:function(e,t,n){var r=n(45050);e.exports=function(e){return r(this,e).has(e)}},95265:function(e,t,n){var r=n(45050);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},68776:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},42634:function(e){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},24523:function(e,t,n){var r=n(88306);e.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},94536:function(e,t,n){var r=n(10852)(Object,"create");e.exports=r},86916:function(e,t,n){var r=n(5569)(Object.keys,Object);e.exports=r},33498:function(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},31167:function(e,t,n){e=n.nmd(e);var r=n(31957),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,s=o&&o.exports===i&&r.process,a=function(){try{var e=o&&o.require&&o.require("util").types;if(e)return e;return s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},55639:function(e,t,n){var r=n(31957),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},90619:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},72385:function(e){e.exports=function(e){return this.__data__.has(e)}},21814:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},37465:function(e,t,n){var r=n(38407);e.exports=function(){this.__data__=new r,this.size=0}},63779:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},67599:function(e){e.exports=function(e){return this.__data__.get(e)}},44758:function(e){e.exports=function(e){return this.__data__.has(e)}},34309:function(e,t,n){var r=n(38407),i=n(57071),o=n(83369);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(s)}return n.set(e,t),this.size=n.size,this}},55514:function(e,t,n){var r=n(24523),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,s=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)}),t});e.exports=s},40327:function(e,t,n){var r=n(33448),i=1/0;e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-i?"-0":t}},80346:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},77813:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},27361:function(e,t,n){var r=n(97786);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},79095:function(e,t,n){var r=n(13),i=n(222);e.exports=function(e,t){return null!=e&&i(e,t,r)}},6557:function(e){e.exports=function(e){return e}},35694:function(e,t,n){var r=n(9454),i=n(37005),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=u},1469:function(e){var t=Array.isArray;e.exports=t},98612:function(e,t,n){var r=n(23560),i=n(41780);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},44144:function(e,t,n){e=n.nmd(e);var r=n(55639),i=n(95062),o=t&&!t.nodeType&&t,s=o&&e&&!e.nodeType&&e,a=s&&s.exports===o?r.Buffer:void 0,u=a?a.isBuffer:void 0;e.exports=u||i},23560:function(e,t,n){var r=n(44239),i=n(13218);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},41780:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},13218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},37005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},33448:function(e,t,n){var r=n(44239),i=n(37005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},36719:function(e,t,n){var r=n(38749),i=n(7518),o=n(31167),s=o&&o.isTypedArray,a=s?i(s):r;e.exports=a},3674:function(e,t,n){var r=n(14636),i=n(280),o=n(98612);e.exports=function(e){return o(e)?r(e):i(e)}},81704:function(e,t,n){var r=n(14636),i=n(10313),o=n(98612);e.exports=function(e){return o(e)?r(e,!0):i(e)}},96486:function(e,t,n){var r;e=n.nmd(e),(function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",u=1/0,l=0/0,c=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],d="[object Arguments]",h="[object Array]",f="[object Boolean]",p="[object Date]",g="[object Error]",m="[object Function]",y="[object GeneratorFunction]",v="[object Map]",_="[object Number]",b="[object Object]",w="[object Promise]",S="[object RegExp]",E="[object Set]",k="[object String]",I="[object Symbol]",T="[object WeakMap]",x="[object ArrayBuffer]",C="[object DataView]",A="[object Float32Array]",O="[object Float64Array]",N="[object Int8Array]",R="[object Int16Array]",D="[object Int32Array]",P="[object Uint8Array]",M="[object Uint8ClampedArray]",L="[object Uint16Array]",U="[object Uint32Array]",j=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,F=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,B=/[&<>"']/g,z=RegExp($.source),V=RegExp(B.source),G=/<%-([\s\S]+?)%>/g,W=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,X=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q=/[\\^$.*+?()[\]{}|]/g,Z=RegExp(Q.source),Y=/^\s+/,ee=/\s/,et=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,en=/\{\n\/\* \[wrapped with (.+)\] \*/,er=/,? & /,ei=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,eo=/[()=,{}\[\]\/\s]/,es=/\\(\\)?/g,ea=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,eu=/\w*$/,el=/^[-+]0x[0-9a-f]+$/i,ec=/^0b[01]+$/i,ed=/^\[object .+?Constructor\]$/,eh=/^0o[0-7]+$/i,ef=/^(?:0|[1-9]\d*)$/,ep=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,eg=/($^)/,em=/['\n\r\u2028\u2029\\]/g,ey="\ud800-\udfff",ev="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",e_="\\u2700-\\u27bf",eb="a-z\\xdf-\\xf6\\xf8-\\xff",ew="A-Z\\xc0-\\xd6\\xd8-\\xde",eS="\\ufe0e\\ufe0f",eE="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ek="['’]",eI="["+eE+"]",eT="["+ev+"]",ex="["+eb+"]",eC="[^"+ey+eE+"\\d+"+e_+eb+ew+"]",eA="\ud83c[\udffb-\udfff]",eO="[^"+ey+"]",eN="(?:\ud83c[\udde6-\uddff]){2}",eR="[\ud800-\udbff][\udc00-\udfff]",eD="["+ew+"]",eP="\\u200d",eM="(?:"+ex+"|"+eC+")",eL="(?:"+ek+"(?:d|ll|m|re|s|t|ve))?",eU="(?:"+ek+"(?:D|LL|M|RE|S|T|VE))?",ej="(?:"+eT+"|"+eA+")?",eq="["+eS+"]?",eF="(?:"+eP+"(?:"+[eO,eN,eR].join("|")+")"+eq+ej+")*",e$=eq+ej+eF,eB="(?:"+["["+e_+"]",eN,eR].join("|")+")"+e$,ez="(?:"+[eO+eT+"?",eT,eN,eR,"["+ey+"]"].join("|")+")",eV=RegExp(ek,"g"),eG=RegExp(eT,"g"),eW=RegExp(eA+"(?="+eA+")|"+ez+e$,"g"),eH=RegExp([eD+"?"+ex+"+"+eL+"(?="+[eI,eD,"$"].join("|")+")","(?:"+eD+"|"+eC+")+"+eU+"(?="+[eI,eD+eM,"$"].join("|")+")",eD+"?"+eM+"+"+eL,eD+"+"+eU,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",eB].join("|"),"g"),eK=RegExp("["+eP+ey+ev+eS+"]"),eJ=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,eX=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],eQ=-1,eZ={};eZ[A]=eZ[O]=eZ[N]=eZ[R]=eZ[D]=eZ[P]=eZ[M]=eZ[L]=eZ[U]=!0,eZ[d]=eZ[h]=eZ[x]=eZ[f]=eZ[C]=eZ[p]=eZ[g]=eZ[m]=eZ[v]=eZ[_]=eZ[b]=eZ[S]=eZ[E]=eZ[k]=eZ[T]=!1;var eY={};eY[d]=eY[h]=eY[x]=eY[C]=eY[f]=eY[p]=eY[A]=eY[O]=eY[N]=eY[R]=eY[D]=eY[v]=eY[_]=eY[b]=eY[S]=eY[E]=eY[k]=eY[I]=eY[P]=eY[M]=eY[L]=eY[U]=!0,eY[g]=eY[m]=eY[T]=!1;var e0={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},e1=parseFloat,e2=parseInt,e3="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,e4="object"==typeof self&&self&&self.Object===Object&&self,e5=e3||e4||Function("return this")(),e6=t&&!t.nodeType&&t,e9=e6&&e&&!e.nodeType&&e,e8=e9&&e9.exports===e6,e7=e8&&e3.process,te=function(){try{var e=e9&&e9.require&&e9.require("util").types;if(e)return e;return e7&&e7.binding&&e7.binding("util")}catch(e){}}(),tt=te&&te.isArrayBuffer,tn=te&&te.isDate,tr=te&&te.isMap,ti=te&&te.isRegExp,to=te&&te.isSet,ts=te&&te.isTypedArray;function ta(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function tu(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function tl(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function tc(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function td(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function th(e,t){return!!(null==e?0:e.length)&&tS(e,t,0)>-1}function tf(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function tp(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function tg(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function tm(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function ty(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function tv(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var t_=tT("length");function tb(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function tw(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return -1}function tS(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return -1}(e,t,n):tw(e,tk,n)}function tE(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return -1}function tk(e){return e!=e}function tI(e,t){var n=null==e?0:e.length;return n?tA(e,t)/n:l}function tT(e){return function(t){return null==t?i:t[e]}}function tx(e){return function(t){return null==e?i:e[t]}}function tC(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}function tA(e,t){for(var n,r=-1,o=e.length;++r<o;){var s=t(e[r]);i!==s&&(n=i===n?s:n+s)}return n}function tO(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function tN(e){return e?e.slice(0,tH(e)+1).replace(Y,""):e}function tR(e){return function(t){return e(t)}}function tD(e,t){return tp(t,function(t){return e[t]})}function tP(e,t){return e.has(t)}function tM(e,t){for(var n=-1,r=e.length;++n<r&&tS(t,e[n],0)>-1;);return n}function tL(e,t){for(var n=e.length;n--&&tS(t,e[n],0)>-1;);return n}var tU=tx({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",Ĳ:"IJ",ĳ:"ij",Œ:"Oe",œ:"oe",ŉ:"'n",ſ:"s"}),tj=tx({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function tq(e){return"\\"+e0[e]}function tF(e){return eK.test(e)}function t$(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function tB(e,t){return function(n){return e(t(n))}}function tz(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];(s===t||s===a)&&(e[n]=a,o[i++]=n)}return o}function tV(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function tG(e){return tF(e)?function(e){for(var t=eW.lastIndex=0;eW.test(e);)++t;return t}(e):t_(e)}function tW(e){return tF(e)?e.match(eW)||[]:e.split("")}function tH(e){for(var t=e.length;t--&&ee.test(e.charAt(t)););return t}var tK=tx({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),tJ=function e(t){var n,r,ee,ey,ev=(t=null==t?e5:tJ.defaults(e5.Object(),t,tJ.pick(e5,eX))).Array,e_=t.Date,eb=t.Error,ew=t.Function,eS=t.Math,eE=t.Object,ek=t.RegExp,eI=t.String,eT=t.TypeError,ex=ev.prototype,eC=ew.prototype,eA=eE.prototype,eO=t["__core-js_shared__"],eN=eC.toString,eR=eA.hasOwnProperty,eD=0,eP=(n=/[^.]+$/.exec(eO&&eO.keys&&eO.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",eM=eA.toString,eL=eN.call(eE),eU=e5._,ej=ek("^"+eN.call(eR).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),eq=e8?t.Buffer:i,eF=t.Symbol,e$=t.Uint8Array,eB=eq?eq.allocUnsafe:i,ez=tB(eE.getPrototypeOf,eE),eW=eE.create,eK=eA.propertyIsEnumerable,e0=ex.splice,e3=eF?eF.isConcatSpreadable:i,e4=eF?eF.iterator:i,e6=eF?eF.toStringTag:i,e9=function(){try{var e=ip(eE,"defineProperty");return e({},"",{}),e}catch(e){}}(),e7=t.clearTimeout!==e5.clearTimeout&&t.clearTimeout,te=e_&&e_.now!==e5.Date.now&&e_.now,t_=t.setTimeout!==e5.setTimeout&&t.setTimeout,tx=eS.ceil,tX=eS.floor,tQ=eE.getOwnPropertySymbols,tZ=eq?eq.isBuffer:i,tY=t.isFinite,t0=ex.join,t1=tB(eE.keys,eE),t2=eS.max,t3=eS.min,t4=e_.now,t5=t.parseInt,t6=eS.random,t9=ex.reverse,t8=ip(t,"DataView"),t7=ip(t,"Map"),ne=ip(t,"Promise"),nt=ip(t,"Set"),nn=ip(t,"WeakMap"),nr=ip(eE,"create"),ni=nn&&new nn,no={},ns=iq(t8),na=iq(t7),nu=iq(ne),nl=iq(nt),nc=iq(nn),nd=eF?eF.prototype:i,nh=nd?nd.valueOf:i,nf=nd?nd.toString:i;function np(e){if(oW(e)&&!oM(e)&&!(e instanceof nv)){if(e instanceof ny)return e;if(eR.call(e,"__wrapped__"))return iF(e)}return new ny(e)}var ng=function(){function e(){}return function(t){if(!oG(t))return{};if(eW)return eW(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function nm(){}function ny(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function nv(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function n_(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function nb(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function nw(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function nS(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new nw;++t<n;)this.add(e[t])}function nE(e){var t=this.__data__=new nb(e);this.size=t.size}function nk(e,t){var n=oM(e),r=!n&&oP(e),i=!n&&!r&&oq(e),o=!n&&!r&&!i&&o0(e),s=n||r||i||o,a=s?tO(e.length,eI):[],u=a.length;for(var l in e)(t||eR.call(e,l))&&!(s&&("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||iw(l,u)))&&a.push(l);return a}function nI(e){var t=e.length;return t?e[rl(0,t-1)]:i}function nT(e,t,n){(i===n||oN(e[t],n))&&(i!==n||t in e)||nN(e,t,n)}function nx(e,t,n){var r=e[t];eR.call(e,t)&&oN(r,n)&&(i!==n||t in e)||nN(e,t,n)}function nC(e,t){for(var n=e.length;n--;)if(oN(e[n][0],t))return n;return -1}function nA(e,t,n,r){return nj(e,function(e,i,o){t(r,e,n(e),o)}),r}function nO(e,t){return e&&r$(t,sh(t),e)}function nN(e,t,n){"__proto__"==t&&e9?e9(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function nR(e,t){for(var n=-1,r=t.length,o=ev(r),s=null==e;++n<r;)o[n]=s?i:sa(e,t[n]);return o}function nD(e,t,n){return e==e&&(i!==n&&(e=e<=n?e:n),i!==t&&(e=e>=t?e:t)),e}function nP(e,t,n,r,o,s){var a,u=1&t,l=2&t,c=4&t;if(n&&(a=o?n(e,r,o,s):n(e)),i!==a)return a;if(!oG(e))return e;var h=oM(e);if(h){if(g=e.length,w=new e.constructor(g),g&&"string"==typeof e[0]&&eR.call(e,"index")&&(w.index=e.index,w.input=e.input),a=w,!u)return rF(e,a)}else{var g,w,T,j,q,F=iy(e),$=F==m||F==y;if(oq(e))return rP(e,u);if(F==b||F==d||$&&!o){if(a=l||$?{}:i_(e),!u)return l?(T=(q=a)&&r$(e,sf(e),q),r$(e,im(e),T)):(j=nO(a,e),r$(e,ig(e),j))}else{if(!eY[F])return o?e:{};a=function(e,t,n){var r,i,o=e.constructor;switch(t){case x:return rM(e);case f:case p:return new o(+e);case C:return r=n?rM(e.buffer):e.buffer,new e.constructor(r,e.byteOffset,e.byteLength);case A:case O:case N:case R:case D:case P:case M:case L:case U:return rL(e,n);case v:return new o;case _:case k:return new o(e);case S:return(i=new e.constructor(e.source,eu.exec(e))).lastIndex=e.lastIndex,i;case E:return new o;case I:return nh?eE(nh.call(e)):{}}}(e,F,u)}}s||(s=new nE);var B=s.get(e);if(B)return B;s.set(e,a),oQ(e)?e.forEach(function(r){a.add(nP(r,t,n,r,e,s))}):oH(e)&&e.forEach(function(r,i){a.set(i,nP(r,t,n,i,e,s))});var z=c?l?is:io:l?sf:sh,V=h?i:z(e);return tl(V||e,function(r,i){V&&(r=e[i=r]),nx(a,i,nP(r,t,n,i,e,s))}),a}function nM(e,t,n){var r=n.length;if(null==e)return!r;for(e=eE(e);r--;){var o=n[r],s=t[o],a=e[o];if(i===a&&!(o in e)||!s(a))return!1}return!0}function nL(e,t,n){if("function"!=typeof e)throw new eT(o);return iR(function(){e.apply(i,n)},t)}function nU(e,t,n,r){var i=-1,o=th,s=!0,a=e.length,u=[],l=t.length;if(!a)return u;n&&(t=tp(t,tR(n))),r?(o=tf,s=!1):t.length>=200&&(o=tP,s=!1,t=new nS(t));e:for(;++i<a;){var c=e[i],d=null==n?c:n(c);if(c=r||0!==c?c:0,s&&d==d){for(var h=l;h--;)if(t[h]===d)continue e;u.push(c)}else o(t,d,r)||u.push(c)}return u}np.templateSettings={escape:G,evaluate:W,interpolate:H,variable:"",imports:{_:np}},np.prototype=nm.prototype,np.prototype.constructor=np,ny.prototype=ng(nm.prototype),ny.prototype.constructor=ny,nv.prototype=ng(nm.prototype),nv.prototype.constructor=nv,n_.prototype.clear=function(){this.__data__=nr?nr(null):{},this.size=0},n_.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},n_.prototype.get=function(e){var t=this.__data__;if(nr){var n=t[e];return n===s?i:n}return eR.call(t,e)?t[e]:i},n_.prototype.has=function(e){var t=this.__data__;return nr?i!==t[e]:eR.call(t,e)},n_.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=nr&&i===t?s:t,this},nb.prototype.clear=function(){this.__data__=[],this.size=0},nb.prototype.delete=function(e){var t=this.__data__,n=nC(t,e);return!(n<0)&&(n==t.length-1?t.pop():e0.call(t,n,1),--this.size,!0)},nb.prototype.get=function(e){var t=this.__data__,n=nC(t,e);return n<0?i:t[n][1]},nb.prototype.has=function(e){return nC(this.__data__,e)>-1},nb.prototype.set=function(e,t){var n=this.__data__,r=nC(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},nw.prototype.clear=function(){this.size=0,this.__data__={hash:new n_,map:new(t7||nb),string:new n_}},nw.prototype.delete=function(e){var t=id(this,e).delete(e);return this.size-=t?1:0,t},nw.prototype.get=function(e){return id(this,e).get(e)},nw.prototype.has=function(e){return id(this,e).has(e)},nw.prototype.set=function(e,t){var n=id(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},nS.prototype.add=nS.prototype.push=function(e){return this.__data__.set(e,s),this},nS.prototype.has=function(e){return this.__data__.has(e)},nE.prototype.clear=function(){this.__data__=new nb,this.size=0},nE.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},nE.prototype.get=function(e){return this.__data__.get(e)},nE.prototype.has=function(e){return this.__data__.has(e)},nE.prototype.set=function(e,t){var n=this.__data__;if(n instanceof nb){var r=n.__data__;if(!t7||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new nw(r)}return n.set(e,t),this.size=n.size,this};var nj=rV(nW),nq=rV(nH,!0);function nF(e,t){var n=!0;return nj(e,function(e,r,i){return n=!!t(e,r,i)}),n}function n$(e,t,n){for(var r=-1,o=e.length;++r<o;){var s=e[r],a=t(s);if(null!=a&&(i===u?a==a&&!oY(a):n(a,u)))var u=a,l=s}return l}function nB(e,t){var n=[];return nj(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function nz(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=ib),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?nz(a,t-1,n,r,i):tg(i,a):r||(i[i.length]=a)}return i}var nV=rG(),nG=rG(!0);function nW(e,t){return e&&nV(e,t,sh)}function nH(e,t){return e&&nG(e,t,sh)}function nK(e,t){return td(t,function(t){return oB(e[t])})}function nJ(e,t){t=rN(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[ij(t[n++])];return n&&n==r?e:i}function nX(e,t,n){var r=t(e);return oM(e)?r:tg(r,n(e))}function nQ(e){return null==e?i===e?"[object Undefined]":"[object Null]":e6&&e6 in eE(e)?function(e){var t=eR.call(e,e6),n=e[e6];try{e[e6]=i;var r=!0}catch(e){}var o=eM.call(e);return r&&(t?e[e6]=n:delete e[e6]),o}(e):eM.call(e)}function nZ(e,t){return e>t}function nY(e,t){return null!=e&&eR.call(e,t)}function n0(e,t){return null!=e&&t in eE(e)}function n1(e,t,n){for(var r=n?tf:th,o=e[0].length,s=e.length,a=s,u=ev(s),l=1/0,c=[];a--;){var d=e[a];a&&t&&(d=tp(d,tR(t))),l=t3(d.length,l),u[a]=!n&&(t||o>=120&&d.length>=120)?new nS(a&&d):i}d=e[0];var h=-1,f=u[0];e:for(;++h<o&&c.length<l;){var p=d[h],g=t?t(p):p;if(p=n||0!==p?p:0,!(f?tP(f,g):r(c,g,n))){for(a=s;--a;){var m=u[a];if(!(m?tP(m,g):r(e[a],g,n)))continue e}f&&f.push(g),c.push(p)}}return c}function n2(e,t,n){t=rN(t,e);var r=null==(e=iA(e,t))?e:e[ij(iQ(t))];return null==r?i:ta(r,e,n)}function n3(e){return oW(e)&&nQ(e)==d}function n4(e,t,n,r,o){return e===t||(null!=e&&null!=t&&(oW(e)||oW(t))?function(e,t,n,r,o,s){var a=oM(e),u=oM(t),l=a?h:iy(e),c=u?h:iy(t);l=l==d?b:l,c=c==d?b:c;var m=l==b,y=c==b,w=l==c;if(w&&oq(e)){if(!oq(t))return!1;a=!0,m=!1}if(w&&!m)return s||(s=new nE),a||o0(e)?ir(e,t,n,r,o,s):function(e,t,n,r,i,o,s){switch(n){case C:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case x:if(e.byteLength!=t.byteLength||!o(new e$(e),new e$(t)))break;return!0;case f:case p:case _:return oN(+e,+t);case g:return e.name==t.name&&e.message==t.message;case S:case k:return e==t+"";case v:var a=t$;case E:var u=1&r;if(a||(a=tV),e.size!=t.size&&!u)break;var l=s.get(e);if(l)return l==t;r|=2,s.set(e,t);var c=ir(a(e),a(t),r,i,o,s);return s.delete(e),c;case I:if(nh)return nh.call(e)==nh.call(t)}return!1}(e,t,l,n,r,o,s);if(!(1&n)){var T=m&&eR.call(e,"__wrapped__"),A=y&&eR.call(t,"__wrapped__");if(T||A){var O=T?e.value():e,N=A?t.value():t;return s||(s=new nE),o(O,N,n,r,s)}}return!!w&&(s||(s=new nE),function(e,t,n,r,o,s){var a=1&n,u=io(e),l=u.length;if(l!=io(t).length&&!a)return!1;for(var c=l;c--;){var d=u[c];if(!(a?d in t:eR.call(t,d)))return!1}var h=s.get(e),f=s.get(t);if(h&&f)return h==t&&f==e;var p=!0;s.set(e,t),s.set(t,e);for(var g=a;++c<l;){var m=e[d=u[c]],y=t[d];if(r)var v=a?r(y,m,d,t,e,s):r(m,y,d,e,t,s);if(!(i===v?m===y||o(m,y,n,r,s):v)){p=!1;break}g||(g="constructor"==d)}if(p&&!g){var _=e.constructor,b=t.constructor;_!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof _&&_ instanceof _&&"function"==typeof b&&b instanceof b)&&(p=!1)}return s.delete(e),s.delete(t),p}(e,t,n,r,o,s))}(e,t,n,r,n4,o):e!=e&&t!=t)}function n5(e,t,n,r){var o=n.length,s=o,a=!r;if(null==e)return!s;for(e=eE(e);o--;){var u=n[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<s;){var l=(u=n[o])[0],c=e[l],d=u[1];if(a&&u[2]){if(i===c&&!(l in e))return!1}else{var h=new nE;if(r)var f=r(c,d,l,e,t,h);if(!(i===f?n4(d,c,3,r,h):f))return!1}}return!0}function n6(e){return!(!oG(e)||eP&&eP in e)&&(oB(e)?ej:ed).test(iq(e))}function n9(e){return"function"==typeof e?e:null==e?sj:"object"==typeof e?oM(e)?rn(e[0],e[1]):rt(e):sH(e)}function n8(e){if(!iT(e))return t1(e);var t=[];for(var n in eE(e))eR.call(e,n)&&"constructor"!=n&&t.push(n);return t}function n7(e,t){return e<t}function re(e,t){var n=-1,r=oU(e)?ev(e.length):[];return nj(e,function(e,i,o){r[++n]=t(e,i,o)}),r}function rt(e){var t=ih(e);return 1==t.length&&t[0][2]?ix(t[0][0],t[0][1]):function(n){return n===e||n5(n,e,t)}}function rn(e,t){var n;return iE(e)&&(n=t)==n&&!oG(n)?ix(ij(e),t):function(n){var r=sa(n,e);return i===r&&r===t?su(n,e):n4(t,r,3)}}function rr(e,t,n,r,o){e!==t&&nV(t,function(s,a){if(o||(o=new nE),oG(s))(function(e,t,n,r,o,s,a){var u=iO(e,n),l=iO(t,n),c=a.get(l);if(c){nT(e,n,c);return}var d=s?s(u,l,n+"",e,t,a):i,h=i===d;if(h){var f=oM(l),p=!f&&oq(l),g=!f&&!p&&o0(l);d=l,f||p||g?oM(u)?d=u:oj(u)?d=rF(u):p?(h=!1,d=rP(l,!0)):g?(h=!1,d=rL(l,!0)):d=[]:oJ(l)||oP(l)?(d=u,oP(u)?d=o8(u):(!oG(u)||oB(u))&&(d=i_(l))):h=!1}h&&(a.set(l,d),o(d,l,r,s,a),a.delete(l)),nT(e,n,d)})(e,t,a,n,rr,r,o);else{var u=r?r(iO(e,a),s,a+"",e,t,o):i;i===u&&(u=s),nT(e,a,u)}},sf)}function ri(e,t){var n=e.length;if(n)return iw(t+=t<0?n:0,n)?e[t]:i}function ro(e,t,n){t=t.length?tp(t,function(e){return oM(e)?function(t){return nJ(t,1===e.length?e[0]:e)}:e}):[sj];var r=-1;return t=tp(t,tR(ic())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(re(e,function(e,n,i){return{criteria:tp(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var u=rU(i[r],o[r]);if(u){if(r>=a)return u;return u*("desc"==n[r]?-1:1)}}return e.index-t.index}(e,t,n)})}function rs(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=nJ(e,s);n(a,s)&&rh(o,rN(s,e),a)}return o}function ra(e,t,n,r){var i=r?tE:tS,o=-1,s=t.length,a=e;for(e===t&&(t=rF(t)),n&&(a=tp(e,tR(n)));++o<s;)for(var u=0,l=t[o],c=n?n(l):l;(u=i(a,c,u,r))>-1;)a!==e&&e0.call(a,u,1),e0.call(e,u,1);return e}function ru(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;iw(i)?e0.call(e,i,1):rE(e,i)}}return e}function rl(e,t){return e+tX(t6()*(t-e+1))}function rc(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do t%2&&(n+=e),(t=tX(t/2))&&(e+=e);while(t);return n}function rd(e,t){return iD(iC(e,t,sj),e+"")}function rh(e,t,n,r){if(!oG(e))return e;t=rN(t,e);for(var o=-1,s=t.length,a=s-1,u=e;null!=u&&++o<s;){var l=ij(t[o]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)break;if(o!=a){var d=u[l];c=r?r(d,l,u):i,i===c&&(c=oG(d)?d:iw(t[o+1])?[]:{})}nx(u,l,c),u=u[l]}return e}var rf=ni?function(e,t){return ni.set(e,t),e}:sj,rp=e9?function(e,t){return e9(e,"toString",{configurable:!0,enumerable:!1,value:sM(t),writable:!0})}:sj;function rg(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=ev(i);++r<i;)o[r]=e[r+t];return o}function rm(e,t){var n;return nj(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function ry(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!oY(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return rv(e,t,sj,n)}function rv(e,t,n,r){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=n(t))!=t,u=null===t,l=oY(t),c=i===t;o<s;){var d=tX((o+s)/2),h=n(e[d]),f=i!==h,p=null===h,g=h==h,m=oY(h);if(a)var y=r||g;else y=c?g&&(r||f):u?g&&f&&(r||!p):l?g&&f&&!p&&(r||!m):!p&&!m&&(r?h<=t:h<t);y?o=d+1:s=d}return t3(s,4294967294)}function r_(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n],a=t?t(s):s;if(!n||!oN(a,u)){var u=a;o[i++]=0===s?0:s}}return o}function rb(e){return"number"==typeof e?e:oY(e)?l:+e}function rw(e){if("string"==typeof e)return e;if(oM(e))return tp(e,rw)+"";if(oY(e))return nf?nf.call(e):"";var t=e+"";return"0"==t&&1/e==-u?"-0":t}function rS(e,t,n){var r=-1,i=th,o=e.length,s=!0,a=[],u=a;if(n)s=!1,i=tf;else if(o>=200){var l=t?null:r6(e);if(l)return tV(l);s=!1,i=tP,u=new nS}else u=t?[]:a;e:for(;++r<o;){var c=e[r],d=t?t(c):c;if(c=n||0!==c?c:0,s&&d==d){for(var h=u.length;h--;)if(u[h]===d)continue e;t&&u.push(d),a.push(c)}else i(u,d,n)||(u!==a&&u.push(d),a.push(c))}return a}function rE(e,t){return t=rN(t,e),null==(e=iA(e,t))||delete e[ij(iQ(t))]}function rk(e,t,n,r){return rh(e,t,n(nJ(e,t)),r)}function rI(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?rg(e,r?0:o,r?o+1:i):rg(e,r?o+1:0,r?i:o)}function rT(e,t){var n=e;return n instanceof nv&&(n=n.value()),tm(t,function(e,t){return t.func.apply(t.thisArg,tg([e],t.args))},n)}function rx(e,t,n){var r=e.length;if(r<2)return r?rS(e[0]):[];for(var i=-1,o=ev(r);++i<r;)for(var s=e[i],a=-1;++a<r;)a!=i&&(o[i]=nU(o[i]||s,e[a],t,n));return rS(nz(o,1),t,n)}function rC(e,t,n){for(var r=-1,o=e.length,s=t.length,a={};++r<o;){var u=r<s?t[r]:i;n(a,e[r],u)}return a}function rA(e){return oj(e)?e:[]}function rO(e){return"function"==typeof e?e:sj}function rN(e,t){return oM(e)?e:iE(e,t)?[e]:iU(o7(e))}function rR(e,t,n){var r=e.length;return n=i===n?r:n,!t&&n>=r?e:rg(e,t,n)}var rD=e7||function(e){return e5.clearTimeout(e)};function rP(e,t){if(t)return e.slice();var n=e.length,r=eB?eB(n):new e.constructor(n);return e.copy(r),r}function rM(e){var t=new e.constructor(e.byteLength);return new e$(t).set(new e$(e)),t}function rL(e,t){var n=t?rM(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function rU(e,t){if(e!==t){var n=i!==e,r=null===e,o=e==e,s=oY(e),a=i!==t,u=null===t,l=t==t,c=oY(t);if(!u&&!c&&!s&&e>t||s&&a&&l&&!u&&!c||r&&a&&l||!n&&l||!o)return 1;if(!r&&!s&&!c&&e<t||c&&n&&o&&!r&&!s||u&&n&&o||!a&&o||!l)return -1}return 0}function rj(e,t,n,r){for(var i=-1,o=e.length,s=n.length,a=-1,u=t.length,l=t2(o-s,0),c=ev(u+l),d=!r;++a<u;)c[a]=t[a];for(;++i<s;)(d||i<o)&&(c[n[i]]=e[i]);for(;l--;)c[a++]=e[i++];return c}function rq(e,t,n,r){for(var i=-1,o=e.length,s=-1,a=n.length,u=-1,l=t.length,c=t2(o-a,0),d=ev(c+l),h=!r;++i<c;)d[i]=e[i];for(var f=i;++u<l;)d[f+u]=t[u];for(;++s<a;)(h||i<o)&&(d[f+n[s]]=e[i++]);return d}function rF(e,t){var n=-1,r=e.length;for(t||(t=ev(r));++n<r;)t[n]=e[n];return t}function r$(e,t,n,r){var o=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var u=t[s],l=r?r(n[u],e[u],u,n,e):i;i===l&&(l=e[u]),o?nN(n,u,l):nx(n,u,l)}return n}function rB(e,t){return function(n,r){var i=oM(n)?tu:nA,o=t?t():{};return i(n,e,ic(r,2),o)}}function rz(e){return rd(function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:i,a=o>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&iS(n[0],n[1],a)&&(s=o<3?i:s,o=1),t=eE(t);++r<o;){var u=n[r];u&&e(t,u,r,s)}return t})}function rV(e,t){return function(n,r){if(null==n)return n;if(!oU(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=eE(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function rG(e){return function(t,n,r){for(var i=-1,o=eE(t),s=r(t),a=s.length;a--;){var u=s[e?a:++i];if(!1===n(o[u],u,o))break}return t}}function rW(e){return function(t){var n=tF(t=o7(t))?tW(t):i,r=n?n[0]:t.charAt(0),o=n?rR(n,1).join(""):t.slice(1);return r[e]()+o}}function rH(e){return function(t){return tm(sR(sk(t).replace(eV,"")),e,"")}}function rK(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=ng(e.prototype),r=e.apply(n,t);return oG(r)?r:n}}function rJ(e){return function(t,n,r){var o=eE(t);if(!oU(t)){var s=ic(n,3);t=sh(t),n=function(e){return s(o[e],e,o)}}var a=e(t,n,r);return a>-1?o[s?t[a]:a]:i}}function rX(e){return ii(function(t){var n=t.length,r=n,s=ny.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new eT(o);if(s&&!u&&"wrapper"==iu(a))var u=new ny([],!0)}for(r=u?r:n;++r<n;){var l=iu(a=t[r]),c="wrapper"==l?ia(a):i;u=c&&ik(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?u[iu(c[0])].apply(u,c[3]):1==a.length&&ik(a)?u[l]():u.thru(a)}return function(){var e=arguments,r=e[0];if(u&&1==e.length&&oM(r))return u.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}})}function rQ(e,t,n,r,o,s,a,u,l,c){var d=128&t,h=1&t,f=2&t,p=24&t,g=512&t,m=f?i:rK(e);return function y(){for(var v=arguments.length,_=ev(v),b=v;b--;)_[b]=arguments[b];if(p)var w=il(y),S=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(_,w);if(r&&(_=rj(_,r,o,p)),s&&(_=rq(_,s,a,p)),v-=S,p&&v<c){var E=tz(_,w);return r4(e,t,rQ,y.placeholder,n,_,E,u,l,c-v)}var k=h?n:this,I=f?k[e]:e;return v=_.length,u?_=function(e,t){for(var n=e.length,r=t3(t.length,n),o=rF(e);r--;){var s=t[r];e[r]=iw(s,n)?o[s]:i}return e}(_,u):g&&v>1&&_.reverse(),d&&l<v&&(_.length=l),this&&this!==e5&&this instanceof y&&(I=m||rK(I)),I.apply(k,_)}}function rZ(e,t){return function(n,r){var i,o;return i=t(r),o={},nW(n,function(t,n,r){e(o,i(t),n,r)}),o}}function rY(e,t){return function(n,r){var o;if(i===n&&i===r)return t;if(i!==n&&(o=n),i!==r){if(i===o)return r;"string"==typeof n||"string"==typeof r?(n=rw(n),r=rw(r)):(n=rb(n),r=rb(r)),o=e(n,r)}return o}}function r0(e){return ii(function(t){return t=tp(t,tR(ic())),rd(function(n){var r=this;return e(t,function(e){return ta(e,r,n)})})})}function r1(e,t){var n=(t=i===t?" ":rw(t)).length;if(n<2)return n?rc(t,e):t;var r=rc(t,tx(e/tG(t)));return tF(t)?rR(tW(r),0,e).join(""):r.slice(0,e)}function r2(e){return function(t,n,r){return r&&"number"!=typeof r&&iS(t,n,r)&&(n=r=i),t=o4(t),i===n?(n=t,t=0):n=o4(n),r=i===r?t<n?1:-1:o4(r),function(e,t,n,r){for(var i=-1,o=t2(tx((t-e)/(n||1)),0),s=ev(o);o--;)s[r?o:++i]=e,e+=n;return s}(t,n,r,e)}}function r3(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=o9(t),n=o9(n)),e(t,n)}}function r4(e,t,n,r,o,s,a,u,l,c){var d=8&t,h=d?a:i,f=d?i:a,p=d?s:i,g=d?i:s;t|=d?32:64,4&(t&=~(d?64:32))||(t&=-4);var m=[e,t,o,p,h,g,f,u,l,c],y=n.apply(i,m);return ik(e)&&iN(y,m),y.placeholder=r,iP(y,e,t)}function r5(e){var t=eS[e];return function(e,n){if(e=o9(e),(n=null==n?0:t3(o5(n),292))&&tY(e)){var r=(o7(e)+"e").split("e");return+((r=(o7(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var r6=nt&&1/tV(new nt([,-0]))[1]==u?function(e){return new nt(e)}:sz;function r9(e){return function(t){var n,r,i=iy(t);return i==v?t$(t):i==E?(n=-1,r=Array(t.size),t.forEach(function(e){r[++n]=[e,e]}),r):tp(e(t),function(e){return[e,t[e]]})}}function r8(e,t,n,r,s,u,l,c){var d=2&t;if(!d&&"function"!=typeof e)throw new eT(o);var h=r?r.length:0;if(h||(t&=-97,r=s=i),l=i===l?l:t2(o5(l),0),c=i===c?c:o5(c),h-=s?s.length:0,64&t){var f=r,p=s;r=s=i}var g=d?i:ia(e),m=[e,t,n,r,s,f,p,u,l,c];if(g&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,s=128==r&&8==n||128==r&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(o||s){1&r&&(e[2]=t[2],i|=1&n?0:4);var u=t[3];if(u){var l=e[3];e[3]=l?rj(l,u,t[4]):u,e[4]=l?tz(e[3],a):t[4]}(u=t[5])&&(l=e[5],e[5]=l?rq(l,u,t[6]):u,e[6]=l?tz(e[5],a):t[6]),(u=t[7])&&(e[7]=u),128&r&&(e[8]=null==e[8]?t[8]:t3(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}}(m,g),e=m[0],t=m[1],n=m[2],r=m[3],s=m[4],(c=m[9]=i===m[9]?d?0:e.length:t2(m[9]-h,0))||!(24&t)||(t&=-25),t&&1!=t)8==t||16==t?(y=e,v=t,_=c,b=rK(y),R=function e(){for(var t=arguments.length,n=ev(t),r=t,o=il(e);r--;)n[r]=arguments[r];var s=t<3&&n[0]!==o&&n[t-1]!==o?[]:tz(n,o);return(t-=s.length)<_?r4(y,v,rQ,e.placeholder,i,n,s,i,i,_-t):ta(this&&this!==e5&&this instanceof e?b:y,this,n)}):32!=t&&33!=t||s.length?R=rQ.apply(i,m):(w=e,S=t,E=n,k=r,I=1&S,T=rK(w),R=function e(){for(var t=-1,n=arguments.length,r=-1,i=k.length,o=ev(i+n),s=this&&this!==e5&&this instanceof e?T:w;++r<i;)o[r]=k[r];for(;n--;)o[r++]=arguments[++t];return ta(s,I?E:this,o)});else var y,v,_,b,w,S,E,k,I,T,x,C,A,O,N,R=(x=e,C=t,A=n,O=1&C,N=rK(x),function e(){return(this&&this!==e5&&this instanceof e?N:x).apply(O?A:this,arguments)});return iP((g?rf:iN)(R,m),e,t)}function r7(e,t,n,r){return i===e||oN(e,eA[n])&&!eR.call(r,n)?t:e}function ie(e,t,n,r,o,s){return oG(e)&&oG(t)&&(s.set(t,e),rr(e,t,i,ie,s),s.delete(t)),e}function it(e){return oJ(e)?i:e}function ir(e,t,n,r,o,s){var a=1&n,u=e.length,l=t.length;if(u!=l&&!(a&&l>u))return!1;var c=s.get(e),d=s.get(t);if(c&&d)return c==t&&d==e;var h=-1,f=!0,p=2&n?new nS:i;for(s.set(e,t),s.set(t,e);++h<u;){var g=e[h],m=t[h];if(r)var y=a?r(m,g,h,t,e,s):r(g,m,h,e,t,s);if(i!==y){if(y)continue;f=!1;break}if(p){if(!tv(t,function(e,t){if(!tP(p,t)&&(g===e||o(g,e,n,r,s)))return p.push(t)})){f=!1;break}}else if(!(g===m||o(g,m,n,r,s))){f=!1;break}}return s.delete(e),s.delete(t),f}function ii(e){return iD(iC(e,i,iW),e+"")}function io(e){return nX(e,sh,ig)}function is(e){return nX(e,sf,im)}var ia=ni?function(e){return ni.get(e)}:sz;function iu(e){for(var t=e.name+"",n=no[t],r=eR.call(no,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function il(e){return(eR.call(np,"placeholder")?np:e).placeholder}function ic(){var e=np.iteratee||sq;return e=e===sq?n9:e,arguments.length?e(arguments[0],arguments[1]):e}function id(e,t){var n,r=e.__data__;return("string"==(n=typeof t)||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==t:null===t)?r["string"==typeof t?"string":"hash"]:r.map}function ih(e){for(var t=sh(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,i==i&&!oG(i)]}return t}function ip(e,t){var n=null==e?i:e[t];return n6(n)?n:i}var ig=tQ?function(e){return null==e?[]:td(tQ(e=eE(e)),function(t){return eK.call(e,t)})}:sX,im=tQ?function(e){for(var t=[];e;)tg(t,ig(e)),e=ez(e);return t}:sX,iy=nQ;function iv(e,t,n){t=rN(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=ij(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&oV(i)&&iw(s,i)&&(oM(e)||oP(e))}function i_(e){return"function"!=typeof e.constructor||iT(e)?{}:ng(ez(e))}function ib(e){return oM(e)||oP(e)||!!(e3&&e&&e[e3])}function iw(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ef.test(e))&&e>-1&&e%1==0&&e<t}function iS(e,t,n){if(!oG(n))return!1;var r=typeof t;return("number"==r?!!(oU(n)&&iw(t,n.length)):"string"==r&&t in n)&&oN(n[t],e)}function iE(e,t){if(oM(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||oY(e))||J.test(e)||!K.test(e)||null!=t&&e in eE(t)}function ik(e){var t=iu(e),n=np[t];if("function"!=typeof n||!(t in nv.prototype))return!1;if(e===n)return!0;var r=ia(n);return!!r&&e===r[0]}(t8&&iy(new t8(new ArrayBuffer(1)))!=C||t7&&iy(new t7)!=v||ne&&iy(ne.resolve())!=w||nt&&iy(new nt)!=E||nn&&iy(new nn)!=T)&&(iy=function(e){var t=nQ(e),n=t==b?e.constructor:i,r=n?iq(n):"";if(r)switch(r){case ns:return C;case na:return v;case nu:return w;case nl:return E;case nc:return T}return t});var iI=eO?oB:sQ;function iT(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||eA)}function ix(e,t){return function(n){return null!=n&&n[e]===t&&(i!==t||e in eE(n))}}function iC(e,t,n){return t=t2(i===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=t2(r.length-t,0),s=ev(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=ev(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),ta(e,this,a)}}function iA(e,t){return t.length<2?e:nJ(e,rg(t,0,-1))}function iO(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var iN=iM(rf),iR=t_||function(e,t){return e5.setTimeout(e,t)},iD=iM(rp);function iP(e,t,n){var r,i,o=t+"";return iD(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(et,"{\n/* [wrapped with "+t+"] */\n")}(o,(r=(i=o.match(en))?i[1].split(er):[],tl(c,function(e){var t="_."+e[0];n&e[1]&&!th(r,t)&&r.push(t)}),r.sort())))}function iM(e){var t=0,n=0;return function(){var r=t4(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function iL(e,t){var n=-1,r=e.length,o=r-1;for(t=i===t?r:t;++n<t;){var s=rl(n,o),a=e[s];e[s]=e[n],e[n]=a}return e.length=t,e}var iU=(ee=(r=oI(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(X,function(e,n,r,i){t.push(r?i.replace(es,"$1"):n||e)}),t},function(e){return 500===ee.size&&ee.clear(),e})).cache,r);function ij(e){if("string"==typeof e||oY(e))return e;var t=e+"";return"0"==t&&1/e==-u?"-0":t}function iq(e){if(null!=e){try{return eN.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function iF(e){if(e instanceof nv)return e.clone();var t=new ny(e.__wrapped__,e.__chain__);return t.__actions__=rF(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var i$=rd(function(e,t){return oj(e)?nU(e,nz(t,1,oj,!0)):[]}),iB=rd(function(e,t){var n=iQ(t);return oj(n)&&(n=i),oj(e)?nU(e,nz(t,1,oj,!0),ic(n,2)):[]}),iz=rd(function(e,t){var n=iQ(t);return oj(n)&&(n=i),oj(e)?nU(e,nz(t,1,oj,!0),i,n):[]});function iV(e,t,n){var r=null==e?0:e.length;if(!r)return -1;var i=null==n?0:o5(n);return i<0&&(i=t2(r+i,0)),tw(e,ic(t,3),i)}function iG(e,t,n){var r=null==e?0:e.length;if(!r)return -1;var o=r-1;return i!==n&&(o=o5(n),o=n<0?t2(r+o,0):t3(o,r-1)),tw(e,ic(t,3),o,!0)}function iW(e){return(null==e?0:e.length)?nz(e,1):[]}function iH(e){return e&&e.length?e[0]:i}var iK=rd(function(e){var t=tp(e,rA);return t.length&&t[0]===e[0]?n1(t):[]}),iJ=rd(function(e){var t=iQ(e),n=tp(e,rA);return t===iQ(n)?t=i:n.pop(),n.length&&n[0]===e[0]?n1(n,ic(t,2)):[]}),iX=rd(function(e){var t=iQ(e),n=tp(e,rA);return(t="function"==typeof t?t:i)&&n.pop(),n.length&&n[0]===e[0]?n1(n,i,t):[]});function iQ(e){var t=null==e?0:e.length;return t?e[t-1]:i}var iZ=rd(iY);function iY(e,t){return e&&e.length&&t&&t.length?ra(e,t):e}var i0=ii(function(e,t){var n=null==e?0:e.length,r=nR(e,t);return ru(e,tp(t,function(e){return iw(e,n)?+e:e}).sort(rU)),r});function i1(e){return null==e?e:t9.call(e)}var i2=rd(function(e){return rS(nz(e,1,oj,!0))}),i3=rd(function(e){var t=iQ(e);return oj(t)&&(t=i),rS(nz(e,1,oj,!0),ic(t,2))}),i4=rd(function(e){var t=iQ(e);return t="function"==typeof t?t:i,rS(nz(e,1,oj,!0),i,t)});function i5(e){if(!(e&&e.length))return[];var t=0;return e=td(e,function(e){if(oj(e))return t=t2(e.length,t),!0}),tO(t,function(t){return tp(e,tT(t))})}function i6(e,t){if(!(e&&e.length))return[];var n=i5(e);return null==t?n:tp(n,function(e){return ta(t,i,e)})}var i9=rd(function(e,t){return oj(e)?nU(e,t):[]}),i8=rd(function(e){return rx(td(e,oj))}),i7=rd(function(e){var t=iQ(e);return oj(t)&&(t=i),rx(td(e,oj),ic(t,2))}),oe=rd(function(e){var t=iQ(e);return t="function"==typeof t?t:i,rx(td(e,oj),i,t)}),ot=rd(i5),on=rd(function(e){var t=e.length,n=t>1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,i6(e,n)});function or(e){var t=np(e);return t.__chain__=!0,t}function oi(e,t){return t(e)}var oo=ii(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return nR(t,e)};return!(t>1)&&!this.__actions__.length&&r instanceof nv&&iw(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:oi,args:[o],thisArg:i}),new ny(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(i),e})):this.thru(o)}),os=rB(function(e,t,n){eR.call(e,n)?++e[n]:nN(e,n,1)}),oa=rJ(iV),ou=rJ(iG);function ol(e,t){return(oM(e)?tl:nj)(e,ic(t,3))}function oc(e,t){return(oM(e)?function(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}:nq)(e,ic(t,3))}var od=rB(function(e,t,n){eR.call(e,n)?e[n].push(t):nN(e,n,[t])}),oh=rd(function(e,t,n){var r=-1,i="function"==typeof t,o=oU(e)?ev(e.length):[];return nj(e,function(e){o[++r]=i?ta(t,e,n):n2(e,t,n)}),o}),of=rB(function(e,t,n){nN(e,n,t)});function op(e,t){return(oM(e)?tp:re)(e,ic(t,3))}var og=rB(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),om=rd(function(e,t){if(null==e)return[];var n=t.length;return n>1&&iS(e,t[0],t[1])?t=[]:n>2&&iS(t[0],t[1],t[2])&&(t=[t[0]]),ro(e,nz(t,1),[])}),oy=te||function(){return e5.Date.now()};function ov(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,r8(e,128,i,i,i,i,t)}function o_(e,t){var n;if("function"!=typeof t)throw new eT(o);return e=o5(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var ob=rd(function(e,t,n){var r=1;if(n.length){var i=tz(n,il(ob));r|=32}return r8(e,r,t,n,i)}),ow=rd(function(e,t,n){var r=3;if(n.length){var i=tz(n,il(ow));r|=32}return r8(t,r,e,n,i)});function oS(e,t,n){var r,s,a,u,l,c,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new eT(o);function g(t){var n=r,o=s;return r=s=i,d=t,u=e.apply(o,n)}function m(e){var n=e-c,r=e-d;return i===c||n>=t||n<0||f&&r>=a}function y(){var e,n,r,i=oy();if(m(i))return v(i);l=iR(y,(e=i-c,n=i-d,r=t-e,f?t3(r,a-n):r))}function v(e){return(l=i,p&&r)?g(e):(r=s=i,u)}function _(){var e,n=oy(),o=m(n);if(r=arguments,s=this,c=n,o){if(i===l)return d=e=c,l=iR(y,t),h?g(e):u;if(f)return rD(l),l=iR(y,t),g(c)}return i===l&&(l=iR(y,t)),u}return t=o9(t)||0,oG(n)&&(h=!!n.leading,a=(f="maxWait"in n)?t2(o9(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),_.cancel=function(){i!==l&&rD(l),d=0,r=c=s=l=i},_.flush=function(){return i===l?u:v(oy())},_}var oE=rd(function(e,t){return nL(e,1,t)}),ok=rd(function(e,t,n){return nL(e,o9(t)||0,n)});function oI(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new eT(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(oI.Cache||nw),n}function oT(e){if("function"!=typeof e)throw new eT(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}oI.Cache=nw;var ox=rd(function(e,t){var n=(t=1==t.length&&oM(t[0])?tp(t[0],tR(ic())):tp(nz(t,1),tR(ic()))).length;return rd(function(r){for(var i=-1,o=t3(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return ta(e,this,r)})}),oC=rd(function(e,t){var n=tz(t,il(oC));return r8(e,32,i,t,n)}),oA=rd(function(e,t){var n=tz(t,il(oA));return r8(e,64,i,t,n)}),oO=ii(function(e,t){return r8(e,256,i,i,i,t)});function oN(e,t){return e===t||e!=e&&t!=t}var oR=r3(nZ),oD=r3(function(e,t){return e>=t}),oP=n3(function(){return arguments}())?n3:function(e){return oW(e)&&eR.call(e,"callee")&&!eK.call(e,"callee")},oM=ev.isArray,oL=tt?tR(tt):function(e){return oW(e)&&nQ(e)==x};function oU(e){return null!=e&&oV(e.length)&&!oB(e)}function oj(e){return oW(e)&&oU(e)}var oq=tZ||sQ,oF=tn?tR(tn):function(e){return oW(e)&&nQ(e)==p};function o$(e){if(!oW(e))return!1;var t=nQ(e);return t==g||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!oJ(e)}function oB(e){if(!oG(e))return!1;var t=nQ(e);return t==m||t==y||"[object AsyncFunction]"==t||"[object Proxy]"==t}function oz(e){return"number"==typeof e&&e==o5(e)}function oV(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function oG(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function oW(e){return null!=e&&"object"==typeof e}var oH=tr?tR(tr):function(e){return oW(e)&&iy(e)==v};function oK(e){return"number"==typeof e||oW(e)&&nQ(e)==_}function oJ(e){if(!oW(e)||nQ(e)!=b)return!1;var t=ez(e);if(null===t)return!0;var n=eR.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&eN.call(n)==eL}var oX=ti?tR(ti):function(e){return oW(e)&&nQ(e)==S},oQ=to?tR(to):function(e){return oW(e)&&iy(e)==E};function oZ(e){return"string"==typeof e||!oM(e)&&oW(e)&&nQ(e)==k}function oY(e){return"symbol"==typeof e||oW(e)&&nQ(e)==I}var o0=ts?tR(ts):function(e){return oW(e)&&oV(e.length)&&!!eZ[nQ(e)]},o1=r3(n7),o2=r3(function(e,t){return e<=t});function o3(e){if(!e)return[];if(oU(e))return oZ(e)?tW(e):rF(e);if(e4&&e[e4])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[e4]());var t=iy(e);return(t==v?t$:t==E?tV:sw)(e)}function o4(e){return e?(e=o9(e))===u||e===-u?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}function o5(e){var t=o4(e),n=t%1;return t==t?n?t-n:t:0}function o6(e){return e?nD(o5(e),0,4294967295):0}function o9(e){if("number"==typeof e)return e;if(oY(e))return l;if(oG(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=oG(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=tN(e);var n=ec.test(e);return n||eh.test(e)?e2(e.slice(2),n?2:8):el.test(e)?l:+e}function o8(e){return r$(e,sf(e))}function o7(e){return null==e?"":rw(e)}var se=rz(function(e,t){if(iT(t)||oU(t)){r$(t,sh(t),e);return}for(var n in t)eR.call(t,n)&&nx(e,n,t[n])}),st=rz(function(e,t){r$(t,sf(t),e)}),sn=rz(function(e,t,n,r){r$(t,sf(t),e,r)}),sr=rz(function(e,t,n,r){r$(t,sh(t),e,r)}),si=ii(nR),so=rd(function(e,t){e=eE(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&iS(t[0],t[1],o)&&(r=1);++n<r;)for(var s=t[n],a=sf(s),u=-1,l=a.length;++u<l;){var c=a[u],d=e[c];(i===d||oN(d,eA[c])&&!eR.call(e,c))&&(e[c]=s[c])}return e}),ss=rd(function(e){return e.push(i,ie),ta(sg,i,e)});function sa(e,t,n){var r=null==e?i:nJ(e,t);return i===r?n:r}function su(e,t){return null!=e&&iv(e,t,n0)}var sl=rZ(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=eM.call(t)),e[t]=n},sM(sj)),sc=rZ(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=eM.call(t)),eR.call(e,t)?e[t].push(n):e[t]=[n]},ic),sd=rd(n2);function sh(e){return oU(e)?nk(e):n8(e)}function sf(e){return oU(e)?nk(e,!0):function(e){if(!oG(e))return function(e){var t=[];if(null!=e)for(var n in eE(e))t.push(n);return t}(e);var t=iT(e),n=[];for(var r in e)"constructor"==r&&(t||!eR.call(e,r))||n.push(r);return n}(e)}var sp=rz(function(e,t,n){rr(e,t,n)}),sg=rz(function(e,t,n,r){rr(e,t,n,r)}),sm=ii(function(e,t){var n={};if(null==e)return n;var r=!1;t=tp(t,function(t){return t=rN(t,e),r||(r=t.length>1),t}),r$(e,is(e),n),r&&(n=nP(n,7,it));for(var i=t.length;i--;)rE(n,t[i]);return n}),sy=ii(function(e,t){return null==e?{}:rs(e,t,function(t,n){return su(e,n)})});function sv(e,t){if(null==e)return{};var n=tp(is(e),function(e){return[e]});return t=ic(t),rs(e,n,function(e,n){return t(e,n[0])})}var s_=r9(sh),sb=r9(sf);function sw(e){return null==e?[]:tD(e,sh(e))}var sS=rH(function(e,t,n){return t=t.toLowerCase(),e+(n?sE(t):t)});function sE(e){return sN(o7(e).toLowerCase())}function sk(e){return(e=o7(e))&&e.replace(ep,tU).replace(eG,"")}var sI=rH(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),sT=rH(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),sx=rW("toLowerCase"),sC=rH(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),sA=rH(function(e,t,n){return e+(n?" ":"")+sN(t)}),sO=rH(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),sN=rW("toUpperCase");function sR(e,t,n){if(e=o7(e),t=n?i:t,i===t){var r;return(r=e,eJ.test(r))?e.match(eH)||[]:e.match(ei)||[]}return e.match(t)||[]}var sD=rd(function(e,t){try{return ta(e,i,t)}catch(e){return o$(e)?e:new eb(e)}}),sP=ii(function(e,t){return tl(t,function(t){nN(e,t=ij(t),ob(e[t],e))}),e});function sM(e){return function(){return e}}var sL=rX(),sU=rX(!0);function sj(e){return e}function sq(e){return n9("function"==typeof e?e:nP(e,1))}var sF=rd(function(e,t){return function(n){return n2(n,e,t)}}),s$=rd(function(e,t){return function(n){return n2(e,n,t)}});function sB(e,t,n){var r=sh(t),i=nK(t,r);null!=n||oG(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=nK(t,sh(t)));var o=!(oG(n)&&"chain"in n)||!!n.chain,s=oB(e);return tl(i,function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=rF(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,tg([this.value()],arguments))})}),e}function sz(){}var sV=r0(tp),sG=r0(tc),sW=r0(tv);function sH(e){return iE(e)?tT(ij(e)):function(t){return nJ(t,e)}}var sK=r2(),sJ=r2(!0);function sX(){return[]}function sQ(){return!1}var sZ=rY(function(e,t){return e+t},0),sY=r5("ceil"),s0=rY(function(e,t){return e/t},1),s1=r5("floor"),s2=rY(function(e,t){return e*t},1),s3=r5("round"),s4=rY(function(e,t){return e-t},0);return np.after=function(e,t){if("function"!=typeof t)throw new eT(o);return e=o5(e),function(){if(--e<1)return t.apply(this,arguments)}},np.ary=ov,np.assign=se,np.assignIn=st,np.assignInWith=sn,np.assignWith=sr,np.at=si,np.before=o_,np.bind=ob,np.bindAll=sP,np.bindKey=ow,np.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return oM(e)?e:[e]},np.chain=or,np.chunk=function(e,t,n){t=(n?iS(e,t,n):i===t)?1:t2(o5(t),0);var r=null==e?0:e.length;if(!r||t<1)return[];for(var o=0,s=0,a=ev(tx(r/t));o<r;)a[s++]=rg(e,o,o+=t);return a},np.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},np.concat=function(){var e=arguments.length;if(!e)return[];for(var t=ev(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return tg(oM(n)?rF(n):[n],nz(t,1))},np.cond=function(e){var t=null==e?0:e.length,n=ic();return e=t?tp(e,function(e){if("function"!=typeof e[1])throw new eT(o);return[n(e[0]),e[1]]}):[],rd(function(n){for(var r=-1;++r<t;){var i=e[r];if(ta(i[0],this,n))return ta(i[1],this,n)}})},np.conforms=function(e){var t,n;return n=sh(t=nP(e,1)),function(e){return nM(e,t,n)}},np.constant=sM,np.countBy=os,np.create=function(e,t){var n=ng(e);return null==t?n:nO(n,t)},np.curry=function e(t,n,r){n=r?i:n;var o=r8(t,8,i,i,i,i,i,n);return o.placeholder=e.placeholder,o},np.curryRight=function e(t,n,r){n=r?i:n;var o=r8(t,16,i,i,i,i,i,n);return o.placeholder=e.placeholder,o},np.debounce=oS,np.defaults=so,np.defaultsDeep=ss,np.defer=oE,np.delay=ok,np.difference=i$,np.differenceBy=iB,np.differenceWith=iz,np.drop=function(e,t,n){var r=null==e?0:e.length;return r?rg(e,(t=n||i===t?1:o5(t))<0?0:t,r):[]},np.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?rg(e,0,(t=r-(t=n||i===t?1:o5(t)))<0?0:t):[]},np.dropRightWhile=function(e,t){return e&&e.length?rI(e,ic(t,3),!0,!0):[]},np.dropWhile=function(e,t){return e&&e.length?rI(e,ic(t,3),!0):[]},np.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&iS(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=o5(n))<0&&(n=-n>o?0:o+n),(r=i===r||r>o?o:o5(r))<0&&(r+=o),r=n>r?0:o6(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},np.filter=function(e,t){return(oM(e)?td:nB)(e,ic(t,3))},np.flatMap=function(e,t){return nz(op(e,t),1)},np.flatMapDeep=function(e,t){return nz(op(e,t),u)},np.flatMapDepth=function(e,t,n){return n=i===n?1:o5(n),nz(op(e,t),n)},np.flatten=iW,np.flattenDeep=function(e){return(null==e?0:e.length)?nz(e,u):[]},np.flattenDepth=function(e,t){return(null==e?0:e.length)?nz(e,t=i===t?1:o5(t)):[]},np.flip=function(e){return r8(e,512)},np.flow=sL,np.flowRight=sU,np.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},np.functions=function(e){return null==e?[]:nK(e,sh(e))},np.functionsIn=function(e){return null==e?[]:nK(e,sf(e))},np.groupBy=od,np.initial=function(e){return(null==e?0:e.length)?rg(e,0,-1):[]},np.intersection=iK,np.intersectionBy=iJ,np.intersectionWith=iX,np.invert=sl,np.invertBy=sc,np.invokeMap=oh,np.iteratee=sq,np.keyBy=of,np.keys=sh,np.keysIn=sf,np.map=op,np.mapKeys=function(e,t){var n={};return t=ic(t,3),nW(e,function(e,r,i){nN(n,t(e,r,i),e)}),n},np.mapValues=function(e,t){var n={};return t=ic(t,3),nW(e,function(e,r,i){nN(n,r,t(e,r,i))}),n},np.matches=function(e){return rt(nP(e,1))},np.matchesProperty=function(e,t){return rn(e,nP(t,1))},np.memoize=oI,np.merge=sp,np.mergeWith=sg,np.method=sF,np.methodOf=s$,np.mixin=sB,np.negate=oT,np.nthArg=function(e){return e=o5(e),rd(function(t){return ri(t,e)})},np.omit=sm,np.omitBy=function(e,t){return sv(e,oT(ic(t)))},np.once=function(e){return o_(2,e)},np.orderBy=function(e,t,n,r){return null==e?[]:(oM(t)||(t=null==t?[]:[t]),oM(n=r?i:n)||(n=null==n?[]:[n]),ro(e,t,n))},np.over=sV,np.overArgs=ox,np.overEvery=sG,np.overSome=sW,np.partial=oC,np.partialRight=oA,np.partition=og,np.pick=sy,np.pickBy=sv,np.property=sH,np.propertyOf=function(e){return function(t){return null==e?i:nJ(e,t)}},np.pull=iZ,np.pullAll=iY,np.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?ra(e,t,ic(n,2)):e},np.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?ra(e,t,i,n):e},np.pullAt=i0,np.range=sK,np.rangeRight=sJ,np.rearg=oO,np.reject=function(e,t){return(oM(e)?td:nB)(e,oT(ic(t,3)))},np.remove=function(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,i=[],o=e.length;for(t=ic(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return ru(e,i),n},np.rest=function(e,t){if("function"!=typeof e)throw new eT(o);return rd(e,t=i===t?t:o5(t))},np.reverse=i1,np.sampleSize=function(e,t,n){return t=(n?iS(e,t,n):i===t)?1:o5(t),(oM(e)?function(e,t){return iL(rF(e),nD(t,0,e.length))}:function(e,t){var n=sw(e);return iL(n,nD(t,0,n.length))})(e,t)},np.set=function(e,t,n){return null==e?e:rh(e,t,n)},np.setWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:rh(e,t,n,r)},np.shuffle=function(e){return(oM(e)?function(e){return iL(rF(e))}:function(e){return iL(sw(e))})(e)},np.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&iS(e,t,n)?(t=0,n=r):(t=null==t?0:o5(t),n=i===n?r:o5(n)),rg(e,t,n)):[]},np.sortBy=om,np.sortedUniq=function(e){return e&&e.length?r_(e):[]},np.sortedUniqBy=function(e,t){return e&&e.length?r_(e,ic(t,2)):[]},np.split=function(e,t,n){return(n&&"number"!=typeof n&&iS(e,t,n)&&(t=n=i),n=i===n?4294967295:n>>>0)?(e=o7(e))&&("string"==typeof t||null!=t&&!oX(t))&&!(t=rw(t))&&tF(e)?rR(tW(e),0,n):e.split(t,n):[]},np.spread=function(e,t){if("function"!=typeof e)throw new eT(o);return t=null==t?0:t2(o5(t),0),rd(function(n){var r=n[t],i=rR(n,0,t);return r&&tg(i,r),ta(e,this,i)})},np.tail=function(e){var t=null==e?0:e.length;return t?rg(e,1,t):[]},np.take=function(e,t,n){return e&&e.length?rg(e,0,(t=n||i===t?1:o5(t))<0?0:t):[]},np.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?rg(e,(t=r-(t=n||i===t?1:o5(t)))<0?0:t,r):[]},np.takeRightWhile=function(e,t){return e&&e.length?rI(e,ic(t,3),!1,!0):[]},np.takeWhile=function(e,t){return e&&e.length?rI(e,ic(t,3)):[]},np.tap=function(e,t){return t(e),e},np.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new eT(o);return oG(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),oS(e,t,{leading:r,maxWait:t,trailing:i})},np.thru=oi,np.toArray=o3,np.toPairs=s_,np.toPairsIn=sb,np.toPath=function(e){return oM(e)?tp(e,ij):oY(e)?[e]:rF(iU(o7(e)))},np.toPlainObject=o8,np.transform=function(e,t,n){var r=oM(e),i=r||oq(e)||o0(e);if(t=ic(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:oG(e)&&oB(o)?ng(ez(e)):{}}return(i?tl:nW)(e,function(e,r,i){return t(n,e,r,i)}),n},np.unary=function(e){return ov(e,1)},np.union=i2,np.unionBy=i3,np.unionWith=i4,np.uniq=function(e){return e&&e.length?rS(e):[]},np.uniqBy=function(e,t){return e&&e.length?rS(e,ic(t,2)):[]},np.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?rS(e,i,t):[]},np.unset=function(e,t){return null==e||rE(e,t)},np.unzip=i5,np.unzipWith=i6,np.update=function(e,t,n){return null==e?e:rk(e,t,rO(n))},np.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:rk(e,t,rO(n),r)},np.values=sw,np.valuesIn=function(e){return null==e?[]:tD(e,sf(e))},np.without=i9,np.words=sR,np.wrap=function(e,t){return oC(rO(t),e)},np.xor=i8,np.xorBy=i7,np.xorWith=oe,np.zip=ot,np.zipObject=function(e,t){return rC(e||[],t||[],nx)},np.zipObjectDeep=function(e,t){return rC(e||[],t||[],rh)},np.zipWith=on,np.entries=s_,np.entriesIn=sb,np.extend=st,np.extendWith=sn,sB(np,np),np.add=sZ,np.attempt=sD,np.camelCase=sS,np.capitalize=sE,np.ceil=sY,np.clamp=function(e,t,n){return i===n&&(n=t,t=i),i!==n&&(n=(n=o9(n))==n?n:0),i!==t&&(t=(t=o9(t))==t?t:0),nD(o9(e),t,n)},np.clone=function(e){return nP(e,4)},np.cloneDeep=function(e){return nP(e,5)},np.cloneDeepWith=function(e,t){return nP(e,5,t="function"==typeof t?t:i)},np.cloneWith=function(e,t){return nP(e,4,t="function"==typeof t?t:i)},np.conformsTo=function(e,t){return null==t||nM(e,t,sh(t))},np.deburr=sk,np.defaultTo=function(e,t){return null==e||e!=e?t:e},np.divide=s0,np.endsWith=function(e,t,n){e=o7(e),t=rw(t);var r=e.length,o=n=i===n?r:nD(o5(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},np.eq=oN,np.escape=function(e){return(e=o7(e))&&V.test(e)?e.replace(B,tj):e},np.escapeRegExp=function(e){return(e=o7(e))&&Z.test(e)?e.replace(Q,"\\$&"):e},np.every=function(e,t,n){var r=oM(e)?tc:nF;return n&&iS(e,t,n)&&(t=i),r(e,ic(t,3))},np.find=oa,np.findIndex=iV,np.findKey=function(e,t){return tb(e,ic(t,3),nW)},np.findLast=ou,np.findLastIndex=iG,np.findLastKey=function(e,t){return tb(e,ic(t,3),nH)},np.floor=s1,np.forEach=ol,np.forEachRight=oc,np.forIn=function(e,t){return null==e?e:nV(e,ic(t,3),sf)},np.forInRight=function(e,t){return null==e?e:nG(e,ic(t,3),sf)},np.forOwn=function(e,t){return e&&nW(e,ic(t,3))},np.forOwnRight=function(e,t){return e&&nH(e,ic(t,3))},np.get=sa,np.gt=oR,np.gte=oD,np.has=function(e,t){return null!=e&&iv(e,t,nY)},np.hasIn=su,np.head=iH,np.identity=sj,np.includes=function(e,t,n,r){e=oU(e)?e:sw(e),n=n&&!r?o5(n):0;var i=e.length;return n<0&&(n=t2(i+n,0)),oZ(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&tS(e,t,n)>-1},np.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return -1;var i=null==n?0:o5(n);return i<0&&(i=t2(r+i,0)),tS(e,t,i)},np.inRange=function(e,t,n){var r,o,s;return t=o4(t),i===n?(n=t,t=0):n=o4(n),(r=e=o9(e))>=t3(o=t,s=n)&&r<t2(o,s)},np.invoke=sd,np.isArguments=oP,np.isArray=oM,np.isArrayBuffer=oL,np.isArrayLike=oU,np.isArrayLikeObject=oj,np.isBoolean=function(e){return!0===e||!1===e||oW(e)&&nQ(e)==f},np.isBuffer=oq,np.isDate=oF,np.isElement=function(e){return oW(e)&&1===e.nodeType&&!oJ(e)},np.isEmpty=function(e){if(null==e)return!0;if(oU(e)&&(oM(e)||"string"==typeof e||"function"==typeof e.splice||oq(e)||o0(e)||oP(e)))return!e.length;var t=iy(e);if(t==v||t==E)return!e.size;if(iT(e))return!n8(e).length;for(var n in e)if(eR.call(e,n))return!1;return!0},np.isEqual=function(e,t){return n4(e,t)},np.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:i)?n(e,t):i;return i===r?n4(e,t,i,n):!!r},np.isError=o$,np.isFinite=function(e){return"number"==typeof e&&tY(e)},np.isFunction=oB,np.isInteger=oz,np.isLength=oV,np.isMap=oH,np.isMatch=function(e,t){return e===t||n5(e,t,ih(t))},np.isMatchWith=function(e,t,n){return n="function"==typeof n?n:i,n5(e,t,ih(t),n)},np.isNaN=function(e){return oK(e)&&e!=+e},np.isNative=function(e){if(iI(e))throw new eb("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return n6(e)},np.isNil=function(e){return null==e},np.isNull=function(e){return null===e},np.isNumber=oK,np.isObject=oG,np.isObjectLike=oW,np.isPlainObject=oJ,np.isRegExp=oX,np.isSafeInteger=function(e){return oz(e)&&e>=-9007199254740991&&e<=9007199254740991},np.isSet=oQ,np.isString=oZ,np.isSymbol=oY,np.isTypedArray=o0,np.isUndefined=function(e){return i===e},np.isWeakMap=function(e){return oW(e)&&iy(e)==T},np.isWeakSet=function(e){return oW(e)&&"[object WeakSet]"==nQ(e)},np.join=function(e,t){return null==e?"":t0.call(e,t)},np.kebabCase=sI,np.last=iQ,np.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return -1;var o=r;return i!==n&&(o=(o=o5(n))<0?t2(r+o,0):t3(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--&&e[r]!==t;);return r}(e,t,o):tw(e,tk,o,!0)},np.lowerCase=sT,np.lowerFirst=sx,np.lt=o1,np.lte=o2,np.max=function(e){return e&&e.length?n$(e,sj,nZ):i},np.maxBy=function(e,t){return e&&e.length?n$(e,ic(t,2),nZ):i},np.mean=function(e){return tI(e,sj)},np.meanBy=function(e,t){return tI(e,ic(t,2))},np.min=function(e){return e&&e.length?n$(e,sj,n7):i},np.minBy=function(e,t){return e&&e.length?n$(e,ic(t,2),n7):i},np.stubArray=sX,np.stubFalse=sQ,np.stubObject=function(){return{}},np.stubString=function(){return""},np.stubTrue=function(){return!0},np.multiply=s2,np.nth=function(e,t){return e&&e.length?ri(e,o5(t)):i},np.noConflict=function(){return e5._===this&&(e5._=eU),this},np.noop=sz,np.now=oy,np.pad=function(e,t,n){e=o7(e);var r=(t=o5(t))?tG(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return r1(tX(i),n)+e+r1(tx(i),n)},np.padEnd=function(e,t,n){e=o7(e);var r=(t=o5(t))?tG(e):0;return t&&r<t?e+r1(t-r,n):e},np.padStart=function(e,t,n){e=o7(e);var r=(t=o5(t))?tG(e):0;return t&&r<t?r1(t-r,n)+e:e},np.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),t5(o7(e).replace(Y,""),t||0)},np.random=function(e,t,n){if(n&&"boolean"!=typeof n&&iS(e,t,n)&&(t=n=i),i===n&&("boolean"==typeof t?(n=t,t=i):"boolean"==typeof e&&(n=e,e=i)),i===e&&i===t?(e=0,t=1):(e=o4(e),i===t?(t=e,e=0):t=o4(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=t6();return t3(e+o*(t-e+e1("1e-"+((o+"").length-1))),t)}return rl(e,t)},np.reduce=function(e,t,n){var r=oM(e)?tm:tC,i=arguments.length<3;return r(e,ic(t,4),n,i,nj)},np.reduceRight=function(e,t,n){var r=oM(e)?ty:tC,i=arguments.length<3;return r(e,ic(t,4),n,i,nq)},np.repeat=function(e,t,n){return t=(n?iS(e,t,n):i===t)?1:o5(t),rc(o7(e),t)},np.replace=function(){var e=arguments,t=o7(e[0]);return e.length<3?t:t.replace(e[1],e[2])},np.result=function(e,t,n){t=rN(t,e);var r=-1,o=t.length;for(o||(o=1,e=i);++r<o;){var s=null==e?i:e[ij(t[r])];i===s&&(r=o,s=n),e=oB(s)?s.call(e):s}return e},np.round=s3,np.runInContext=e,np.sample=function(e){return(oM(e)?nI:function(e){return nI(sw(e))})(e)},np.size=function(e){if(null==e)return 0;if(oU(e))return oZ(e)?tG(e):e.length;var t=iy(e);return t==v||t==E?e.size:n8(e).length},np.snakeCase=sC,np.some=function(e,t,n){var r=oM(e)?tv:rm;return n&&iS(e,t,n)&&(t=i),r(e,ic(t,3))},np.sortedIndex=function(e,t){return ry(e,t)},np.sortedIndexBy=function(e,t,n){return rv(e,t,ic(n,2))},np.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ry(e,t);if(r<n&&oN(e[r],t))return r}return -1},np.sortedLastIndex=function(e,t){return ry(e,t,!0)},np.sortedLastIndexBy=function(e,t,n){return rv(e,t,ic(n,2),!0)},np.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=ry(e,t,!0)-1;if(oN(e[n],t))return n}return -1},np.startCase=sA,np.startsWith=function(e,t,n){return e=o7(e),n=null==n?0:nD(o5(n),0,e.length),t=rw(t),e.slice(n,n+t.length)==t},np.subtract=s4,np.sum=function(e){return e&&e.length?tA(e,sj):0},np.sumBy=function(e,t){return e&&e.length?tA(e,ic(t,2)):0},np.template=function(e,t,n){var r=np.templateSettings;n&&iS(e,t,n)&&(t=i),e=o7(e),t=sn({},t,r,r7);var o,s,a=sn({},t.imports,r.imports,r7),u=sh(a),l=tD(a,u),c=0,d=t.interpolate||eg,h="__p += '",f=ek((t.escape||eg).source+"|"+d.source+"|"+(d===H?ea:eg).source+"|"+(t.evaluate||eg).source+"|$","g"),p="//# sourceURL="+(eR.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++eQ+"]")+"\n";e.replace(f,function(t,n,r,i,a,u){return r||(r=i),h+=e.slice(c,u).replace(em,tq),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+t.length,t}),h+="';\n";var g=eR.call(t,"variable")&&t.variable;if(g){if(eo.test(g))throw new eb("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(j,""):h).replace(q,"$1").replace(F,"$1;"),h="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=sD(function(){return ew(u,p+"return "+h).apply(i,l)});if(m.source=h,o$(m))throw m;return m},np.times=function(e,t){if((e=o5(e))<1||e>9007199254740991)return[];var n=4294967295,r=t3(e,4294967295);t=ic(t),e-=4294967295;for(var i=tO(r,t);++n<e;)t(n);return i},np.toFinite=o4,np.toInteger=o5,np.toLength=o6,np.toLower=function(e){return o7(e).toLowerCase()},np.toNumber=o9,np.toSafeInteger=function(e){return e?nD(o5(e),-9007199254740991,9007199254740991):0===e?e:0},np.toString=o7,np.toUpper=function(e){return o7(e).toUpperCase()},np.trim=function(e,t,n){if((e=o7(e))&&(n||i===t))return tN(e);if(!e||!(t=rw(t)))return e;var r=tW(e),o=tW(t),s=tM(r,o),a=tL(r,o)+1;return rR(r,s,a).join("")},np.trimEnd=function(e,t,n){if((e=o7(e))&&(n||i===t))return e.slice(0,tH(e)+1);if(!e||!(t=rw(t)))return e;var r=tW(e),o=tL(r,tW(t))+1;return rR(r,0,o).join("")},np.trimStart=function(e,t,n){if((e=o7(e))&&(n||i===t))return e.replace(Y,"");if(!e||!(t=rw(t)))return e;var r=tW(e),o=tM(r,tW(t));return rR(r,o).join("")},np.truncate=function(e,t){var n=30,r="...";if(oG(t)){var o="separator"in t?t.separator:o;n="length"in t?o5(t.length):n,r="omission"in t?rw(t.omission):r}var s=(e=o7(e)).length;if(tF(e)){var a=tW(e);s=a.length}if(n>=s)return e;var u=n-tG(r);if(u<1)return r;var l=a?rR(a,0,u).join(""):e.slice(0,u);if(i===o)return l+r;if(a&&(u+=l.length-u),oX(o)){if(e.slice(u).search(o)){var c,d=l;for(o.global||(o=ek(o.source,o7(eu.exec(o))+"g")),o.lastIndex=0;c=o.exec(d);)var h=c.index;l=l.slice(0,i===h?u:h)}}else if(e.indexOf(rw(o),u)!=u){var f=l.lastIndexOf(o);f>-1&&(l=l.slice(0,f))}return l+r},np.unescape=function(e){return(e=o7(e))&&z.test(e)?e.replace($,tK):e},np.uniqueId=function(e){var t=++eD;return o7(e)+t},np.upperCase=sO,np.upperFirst=sN,np.each=ol,np.eachRight=oc,np.first=iH,sB(np,(ey={},nW(np,function(e,t){eR.call(np.prototype,t)||(ey[t]=e)}),ey),{chain:!1}),np.VERSION="4.17.21",tl(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){np[e].placeholder=np}),tl(["drop","take"],function(e,t){nv.prototype[e]=function(n){n=i===n?1:t2(o5(n),0);var r=this.__filtered__&&!t?new nv(this):this.clone();return r.__filtered__?r.__takeCount__=t3(n,r.__takeCount__):r.__views__.push({size:t3(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},nv.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),tl(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;nv.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ic(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),tl(["head","last"],function(e,t){var n="take"+(t?"Right":"");nv.prototype[e]=function(){return this[n](1).value()[0]}}),tl(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");nv.prototype[e]=function(){return this.__filtered__?new nv(this):this[n](1)}}),nv.prototype.compact=function(){return this.filter(sj)},nv.prototype.find=function(e){return this.filter(e).head()},nv.prototype.findLast=function(e){return this.reverse().find(e)},nv.prototype.invokeMap=rd(function(e,t){return"function"==typeof e?new nv(this):this.map(function(n){return n2(n,e,t)})}),nv.prototype.reject=function(e){return this.filter(oT(ic(e)))},nv.prototype.slice=function(e,t){e=o5(e);var n=this;return n.__filtered__&&(e>0||t<0)?new nv(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),i!==t&&(n=(t=o5(t))<0?n.dropRight(-t):n.take(t-e)),n)},nv.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},nv.prototype.toArray=function(){return this.take(4294967295)},nW(nv.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=np[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);o&&(np.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,u=t instanceof nv,l=a[0],c=u||oM(t),d=function(e){var t=o.apply(np,tg([e],a));return r&&h?t[0]:t};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var h=this.__chain__,f=!!this.__actions__.length,p=s&&!h,g=u&&!f;if(!s&&c){t=g?t:new nv(this);var m=e.apply(t,a);return m.__actions__.push({func:oi,args:[d],thisArg:i}),new ny(m,h)}return p&&g?e.apply(this,a):(m=this.thru(d),p?r?m.value()[0]:m.value():m)})}),tl(["pop","push","shift","sort","splice","unshift"],function(e){var t=ex[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);np.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(oM(i)?i:[],e)}return this[n](function(n){return t.apply(oM(n)?n:[],e)})}}),nW(nv.prototype,function(e,t){var n=np[t];if(n){var r=n.name+"";eR.call(no,r)||(no[r]=[]),no[r].push({name:t,func:n})}}),no[rQ(i,2).name]=[{name:"wrapper",func:i}],nv.prototype.clone=function(){var e=new nv(this.__wrapped__);return e.__actions__=rF(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=rF(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=rF(this.__views__),e},nv.prototype.reverse=function(){if(this.__filtered__){var e=new nv(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e},nv.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=oM(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=t3(t,e+s);break;case"takeRight":e=t2(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,u=a-s,l=r?a:s-1,c=this.__iteratees__,d=c.length,h=0,f=t3(u,this.__takeCount__);if(!n||!r&&i==u&&f==u)return rT(e,this.__actions__);var p=[];e:for(;u--&&h<f;){for(var g=-1,m=e[l+=t];++g<d;){var y=c[g],v=y.iteratee,_=y.type,b=v(m);if(2==_)m=b;else if(!b){if(1==_)continue e;break e}}p[h++]=m}return p},np.prototype.at=oo,np.prototype.chain=function(){return or(this)},np.prototype.commit=function(){return new ny(this.value(),this.__chain__)},np.prototype.next=function(){i===this.__values__&&(this.__values__=o3(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}},np.prototype.plant=function(e){for(var t,n=this;n instanceof nm;){var r=iF(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},np.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof nv){var t=e;return this.__actions__.length&&(t=new nv(this)),(t=t.reverse()).__actions__.push({func:oi,args:[i1],thisArg:i}),new ny(t,this.__chain__)}return this.thru(i1)},np.prototype.toJSON=np.prototype.valueOf=np.prototype.value=function(){return rT(this.__wrapped__,this.__actions__)},np.prototype.first=np.prototype.head,e4&&(np.prototype[e4]=function(){return this}),np}();e5._=tJ,i!==(r=(function(){return tJ}).call(t,n,t,e))&&(e.exports=r)}).call(this)},88306:function(e,t,n){var r=n(83369);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},35937:function(e,t,n){var r=n(29932),i=n(67206),o=n(63012),s=n(46904);e.exports=function(e,t){if(null==e)return{};var n=r(s(e),function(e){return[e]});return t=i(t),o(e,n,function(e,n){return t(e,n[0])})}},39601:function(e,t,n){var r=n(40371),i=n(79152),o=n(15403),s=n(40327);e.exports=function(e){return o(e)?r(s(e)):i(e)}},70479:function(e){e.exports=function(){return[]}},95062:function(e){e.exports=function(){return!1}},79833:function(e,t,n){var r=n(80531);e.exports=function(e){return null==e?"":r(e)}},8891:function(e){"use strict";var t,n,r,i,o,s,a,u,l,c,d,h,f,p,g,m,y,v,_={DEBUG:!1,LIB_VERSION:"2.45.0"};if("undefined"==typeof window){var b={hostname:""};m={navigator:{userAgent:""},document:{location:b,referrer:""},screen:{width:0,height:0},location:b}}else m=window;var w=Array.prototype,S=Function.prototype,E=Object.prototype,k=w.slice,I=E.toString,T=E.hasOwnProperty,x=m.console,C=m.navigator,A=m.document,O=m.opera,N=m.screen,R=C.userAgent,D=S.bind,P=w.forEach,M=w.indexOf,L=w.map,U=Array.isArray,j={},q={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},F={log:function(){if(_.DEBUG&&!q.isUndefined(x)&&x)try{x.log.apply(x,arguments)}catch(e){q.each(arguments,function(e){x.log(e)})}},warn:function(){if(_.DEBUG&&!q.isUndefined(x)&&x){var e=["Mixpanel warning:"].concat(q.toArray(arguments));try{x.warn.apply(x,e)}catch(t){q.each(e,function(e){x.warn(e)})}}},error:function(){if(_.DEBUG&&!q.isUndefined(x)&&x){var e=["Mixpanel error:"].concat(q.toArray(arguments));try{x.error.apply(x,e)}catch(t){q.each(e,function(e){x.error(e)})}}},critical:function(){if(!q.isUndefined(x)&&x){var e=["Mixpanel error:"].concat(q.toArray(arguments));try{x.error.apply(x,e)}catch(t){q.each(e,function(e){x.error(e)})}}}},$=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(F,arguments)}},B=function(e){return{log:$(F.log,e),error:$(F.error,e),critical:$(F.critical,e)}};q.bind=function(e,t){var n,r;if(D&&e.bind===D)return D.apply(e,k.call(arguments,1));if(!q.isFunction(e))throw TypeError();return n=k.call(arguments,2),r=function(){if(!(this instanceof r))return e.apply(t,n.concat(k.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var s=e.apply(o,n.concat(k.call(arguments)));return Object(s)===s?s:o}},q.each=function(e,t,n){if(null!=e){if(P&&e.forEach===P)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r,e)===j)return}else for(var o in e)if(T.call(e,o)&&t.call(n,e[o],o,e)===j)return}},q.extend=function(e){return q.each(k.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},q.isArray=U||function(e){return"[object Array]"===I.call(e)},q.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}},q.isArguments=function(e){return!!(e&&T.call(e,"callee"))},q.toArray=function(e){return e?e.toArray?e.toArray():q.isArray(e)||q.isArguments(e)?k.call(e):q.values(e):[]},q.map=function(e,t,n){if(L&&e.map===L)return e.map(t,n);var r=[];return q.each(e,function(e){r.push(t.call(n,e))}),r},q.keys=function(e){var t=[];return null===e||q.each(e,function(e,n){t[t.length]=n}),t},q.values=function(e){var t=[];return null===e||q.each(e,function(e){t[t.length]=e}),t},q.include=function(e,t){var n=!1;return null===e?n:M&&e.indexOf===M?-1!=e.indexOf(t):(q.each(e,function(e){if(n||(n=e===t))return j}),n)},q.includes=function(e,t){return -1!==e.indexOf(t)},q.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},q.isObject=function(e){return e===Object(e)&&!q.isArray(e)},q.isEmptyObject=function(e){if(q.isObject(e)){for(var t in e)if(T.call(e,t))return!1;return!0}return!1},q.isUndefined=function(e){return void 0===e},q.isString=function(e){return"[object String]"==I.call(e)},q.isDate=function(e){return"[object Date]"==I.call(e)},q.isNumber=function(e){return"[object Number]"==I.call(e)},q.isElement=function(e){return!!(e&&1===e.nodeType)},q.encodeDates=function(e){return q.each(e,function(t,n){q.isDate(t)?e[n]=q.formatDate(t):q.isObject(t)&&(e[n]=q.encodeDates(t))}),e},q.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},q.formatDate=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},q.strip_empty_properties=function(e){var t={};return q.each(e,function(e,n){q.isString(e)&&e.length>0&&(t[n]=e)}),t},q.truncate=function(e,t){var n;return"string"==typeof e?n=e.slice(0,t):q.isArray(e)?(n=[],q.each(e,function(e){n.push(q.truncate(e,t))})):q.isObject(e)?(n={},q.each(e,function(e,r){n[r]=q.truncate(e,t)})):n=e,n},q.JSONEncode=function(e){var t=function(e){var t=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,function(e){var t=n[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'},n=function(e,r){var i="",o=0,s="",a="",u=0,l=i,c=[],d=r[e];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(e)),typeof d){case"string":return t(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(i+="    ",c=[],"[object Array]"===I.apply(d)){for(o=0,u=d.length;o<u;o+=1)c[o]=n(o,d)||"null";return a=0===c.length?"[]":i?"[\n"+i+c.join(",\n"+i)+"\n"+l+"]":"["+c.join(",")+"]",i=l,a}for(s in d)T.call(d,s)&&(a=n(s,d))&&c.push(t(s)+(i?": ":":")+a);return a=0===c.length?"{}":i?"{"+c.join(",")+l+"}":"{"+c.join(",")+"}",i=l,a}};return n("",{"":e})},q.JSONDecode=(o={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"	"},s=function(e){var n=SyntaxError(e);throw n.at=t,n.text=r,n},a=function(e){return e&&e!==n&&s("Expected '"+e+"' instead of '"+n+"'"),n=r.charAt(t),t+=1,n},u=function(){var e,t="";for("-"===n&&(t="-",a("-"));n>="0"&&n<="9";)t+=n,a();if("."===n)for(t+=".";a()&&n>="0"&&n<="9";)t+=n;if("e"===n||"E"===n)for(t+=n,a(),("-"===n||"+"===n)&&(t+=n,a());n>="0"&&n<="9";)t+=n,a();if(isFinite(e=+t))return e;s("Bad number")},l=function(){var e,t,r,i="";if('"'===n)for(;a();){if('"'===n)return a(),i;if("\\"===n){if(a(),"u"===n){for(t=0,r=0;t<4&&isFinite(e=parseInt(a(),16));t+=1)r=16*r+e;i+=String.fromCharCode(r)}else if("string"==typeof o[n])i+=o[n];else break}else i+=n}s("Bad string")},c=function(){for(;n&&n<=" ";)a()},d=function(){switch(n){case"t":return a("t"),a("r"),a("u"),a("e"),!0;case"f":return a("f"),a("a"),a("l"),a("s"),a("e"),!1;case"n":return a("n"),a("u"),a("l"),a("l"),null}s('Unexpected "'+n+'"')},h=function(){var e=[];if("["===n){if(a("["),c(),"]"===n)return a("]"),e;for(;n;){if(e.push(i()),c(),"]"===n)return a("]"),e;a(","),c()}}s("Bad array")},f=function(){var e,t={};if("{"===n){if(a("{"),c(),"}"===n)return a("}"),t;for(;n;){if(e=l(),c(),a(":"),Object.hasOwnProperty.call(t,e)&&s('Duplicate key "'+e+'"'),t[e]=i(),c(),"}"===n)return a("}"),t;a(","),c()}}s("Bad object")},i=function(){switch(c(),n){case"{":return f();case"[":return h();case'"':return l();case"-":return u();default:return n>="0"&&n<="9"?u():d()}},function(e){var o;return r=e,t=0,n=" ",o=i(),c(),n&&s("Syntax error"),o}),q.base64Encode=function(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,l="",c=[];if(!e)return e;e=q.utf8Encode(e);do t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,c[u++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i);while(a<e.length);switch(l=c.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l},q.utf8Encode=function(e){e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n");var t,n,r,i="",o=0;for(r=0,t=n=0,o=e.length;r<o;r++){var s=e.charCodeAt(r),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(n>t&&(i+=e.substring(t,n)),i+=a,t=n=r+1)}return n>t&&(i+=e.substring(t,e.length)),i},q.UUID=(p=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)},g=function(){var e,t,n=[],r=0;function i(e,t){var r,i=0;for(r=0;r<t.length;r++)i|=n[r]<<8*r;return e^i}for(e=0;e<R.length;e++)t=R.charCodeAt(e),n.unshift(255&t),n.length>=4&&(r=i(r,n),n=[]);return n.length>0&&(r=i(r,n)),r.toString(16)},function(){var e=(N.height*N.width).toString(16);return p()+"-"+Math.random().toString(16).replace(".","")+"-"+g()+"-"+e+"-"+p()});var z=["ahrefsbot","baiduspider","bingbot","bingpreview","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];q.isBlockedUA=function(e){var t;for(t=0,e=e.toLowerCase();t<z.length;t++)if(-1!==e.indexOf(z[t]))return!0;return!1},q.HTTPBuildQuery=function(e,t){var n,r,i=[];return q.isUndefined(t)&&(t="&"),q.each(e,function(e,t){n=encodeURIComponent(e.toString()),r=encodeURIComponent(t),i[i.length]=r+"="+n}),i.join(t)},q.getQueryParam=function(e,t){var n=RegExp("[\\?&]"+(t=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"))+"=([^&#]*)").exec(e);if(null===n||n&&"string"!=typeof n[1]&&n[1].length)return"";var r=n[1];try{r=decodeURIComponent(r)}catch(e){F.error("Skipping decoding for malformed query param: "+r)}return r.replace(/\+/g," ")},q.cookie={get:function(e){for(var t=e+"=",n=A.cookie.split(";"),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}return null},parse:function(e){var t;try{t=q.JSONDecode(q.cookie.get(e))||{}}catch(e){}return t},set_seconds:function(e,t,n,r,i,o,s){var a="",u="",l="";if(s)a="; domain="+s;else if(r){var c=X(A.location.hostname);a=c?"; domain=."+c:""}if(n){var d=new Date;d.setTime(d.getTime()+1e3*n),u="; expires="+d.toGMTString()}o&&(i=!0,l="; SameSite=None"),i&&(l+="; secure"),A.cookie=e+"="+encodeURIComponent(t)+u+"; path=/"+a+l},set:function(e,t,n,r,i,o,s){var a="",u="",l="";if(s)a="; domain="+s;else if(r){var c=X(A.location.hostname);a=c?"; domain=."+c:""}if(n){var d=new Date;d.setTime(d.getTime()+864e5*n),u="; expires="+d.toGMTString()}o&&(i=!0,l="; SameSite=None"),i&&(l+="; secure");var h=e+"="+encodeURIComponent(t)+u+"; path=/"+a+l;return A.cookie=h,h},remove:function(e,t,n){q.cookie.set(e,"",-1,t,!1,!1,n)}};var V=null,G=function(e,t){if(null!==V&&!t)return V;var n=!0;try{e=e||window.localStorage;var r="__mplss_"+H(8);e.setItem(r,"xyz"),"xyz"!==e.getItem(r)&&(n=!1),e.removeItem(r)}catch(e){n=!1}return V=n,n};q.localStorage={is_supported:function(e){var t=G(null,e);return t||F.error("localStorage unsupported; falling back to cookie store"),t},error:function(e){F.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(e){q.localStorage.error(e)}return null},parse:function(e){try{return q.JSONDecode(q.localStorage.get(e))||{}}catch(e){}return null},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(e){q.localStorage.error(e)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(e){q.localStorage.error(e)}}},q.register_event=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(!t){F.error("No valid element provided to register_event");return}if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var s="on"+n,a=t[s];t[s]=function(n){if(n=n||e(window.event)){var i,o,s=!0;return q.isFunction(a)&&(i=a(n)),o=r.call(t,n),(!1===i||!1===o)&&(s=!1),s}}}}}();var W=RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');q.dom_query=function(){function e(e){return e.all?e.all:e.getElementsByTagName("*")}var t=/[\t\r\n]/g;function n(n){if(!A.getElementsByTagName)return[];var r=n.split(" "),i=[A];for(p=0;p<r.length;p++){if((l=r[p].replace(/^\s+/,"").replace(/\s+$/,"")).indexOf("#")>-1){d=(c=l.split("#"))[0];var o=c[1],s=A.getElementById(o);if(!s||d&&s.nodeName.toLowerCase()!=d)return[];i=[s];continue}if(l.indexOf(".")>-1){d=(c=l.split("."))[0];var a=c[1];for(d||(d="*"),h=[],f=0,g=0;g<i.length;g++)for(m=0,y="*"==d?e(i[g]):i[g].getElementsByTagName(d);m<y.length;m++)h[f++]=y[m];for(g=0,i=[],v=0;g<h.length;g++)h[g].className&&q.isString(h[g].className)&&(" "+h[g].className+" ").replace(t," ").indexOf(" "+a+" ")>=0&&(i[v++]=h[g]);continue}var u=l.match(W);if(u){d=u[1];var l,c,d,h,f,p,g,m,y,v,_,b=u[2],w=u[3],S=u[4];for(d||(d="*"),h=[],f=0,g=0;g<i.length;g++)for(m=0,y="*"==d?e(i[g]):i[g].getElementsByTagName(d);m<y.length;m++)h[f++]=y[m];switch(i=[],v=0,w){case"=":_=function(e){return e.getAttribute(b)==S};break;case"~":_=function(e){return e.getAttribute(b).match(RegExp("\\b"+S+"\\b"))};break;case"|":_=function(e){return e.getAttribute(b).match(RegExp("^"+S+"-?"))};break;case"^":_=function(e){return 0===e.getAttribute(b).indexOf(S)};break;case"$":_=function(e){return e.getAttribute(b).lastIndexOf(S)==e.getAttribute(b).length-S.length};break;case"*":_=function(e){return e.getAttribute(b).indexOf(S)>-1};break;default:_=function(e){return e.getAttribute(b)}}for(g=0,i=[],v=0;g<h.length;g++)_(h[g])&&(i[v++]=h[g]);continue}for(g=0,d=l,h=[],f=0;g<i.length;g++)for(m=0,y=i[g].getElementsByTagName(d);m<y.length;m++)h[f++]=y[m];i=h}return i}return function(e){return q.isElement(e)?[e]:q.isObject(e)&&!q.isUndefined(e.length)?e:n.call(this,e)}}(),q.info={campaignParams:function(){var e="",t={};return q.each("utm_source utm_medium utm_campaign utm_content utm_term".split(" "),function(n){(e=q.getQueryParam(A.URL,n)).length&&(t[n]=e)}),t},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=q.info.searchEngine(e),n={};if(null!==t){n.$search_engine=t;var r=q.getQueryParam(e,"yahoo"!=t?"q":"p");r.length&&(n.mp_keyword=r)}return n},browser:function(e,t,n){if(t=t||"",n||q.includes(e," OPR/"))return q.includes(e,"Mini")?"Opera Mini":"Opera";if(/(BlackBerry|PlayBook|BB10)/i.test(e))return"BlackBerry";if(q.includes(e,"IEMobile")||q.includes(e,"WPDesktop"))return"Internet Explorer Mobile";if(q.includes(e,"SamsungBrowser/"))return"Samsung Internet";if(q.includes(e,"Edge")||q.includes(e,"Edg/"))return"Microsoft Edge";if(q.includes(e,"FBIOS"))return"Facebook Mobile";if(q.includes(e,"Chrome"))return"Chrome";else if(q.includes(e,"CriOS"))return"Chrome iOS";else if(q.includes(e,"UCWEB")||q.includes(e,"UCBrowser"))return"UC Browser";else if(q.includes(e,"FxiOS"))return"Firefox iOS";else if(q.includes(t,"Apple"))return q.includes(e,"Mobile")?"Mobile Safari":"Safari";else if(q.includes(e,"Android"))return"Android Mobile";else if(q.includes(e,"Konqueror"))return"Konqueror";else if(q.includes(e,"Firefox"))return"Firefox";else if(q.includes(e,"MSIE")||q.includes(e,"Trident/"))return"Internet Explorer";else if(q.includes(e,"Gecko"))return"Mozilla";else return""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[q.info.browser(e,t,n)];if(void 0===r)return null;var i=e.match(r);return i?parseFloat(i[i.length-2]):null},os:function(){if(/Windows/i.test(R))return/Phone/.test(R)||/WPDesktop/.test(R)?"Windows Phone":"Windows";if(/(iPhone|iPad|iPod)/.test(R))return"iOS";if(/Android/.test(R))return"Android";if(/(BlackBerry|PlayBook|BB10)/i.test(R))return"BlackBerry";if(/Mac/i.test(R))return"Mac OS X";if(/Linux/.test(R))return"Linux";if(/CrOS/.test(R))return"Chrome OS";else return""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},properties:function(){return q.extend(q.strip_empty_properties({$os:q.info.os(),$browser:q.info.browser(R,C.vendor,O),$referrer:A.referrer,$referring_domain:q.info.referringDomain(A.referrer),$device:q.info.device(R)}),{$current_url:m.location.href,$browser_version:q.info.browserVersion(R,C.vendor,O),$screen_height:N.height,$screen_width:N.width,mp_lib:"web",$lib_version:_.LIB_VERSION,$insert_id:H(),time:q.timestamp()/1e3})},people_properties:function(){return q.extend(q.strip_empty_properties({$os:q.info.os(),$browser:q.info.browser(R,C.vendor,O)}),{$browser_version:q.info.browserVersion(R,C.vendor,O)})},pageviewInfo:function(e){return q.strip_empty_properties({mp_page:e,mp_referrer:A.referrer,mp_browser:q.info.browser(R,C.vendor,O),mp_platform:q.info.os()})}};var H=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},K=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,J=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,X=function(e){var t=J,n=e.split("."),r=n[n.length-1];(r.length>4||"com"===r||"org"===r)&&(t=K);var i=e.match(t);return i?i[0]:""},Q=null,Z=null;"undefined"!=typeof JSON&&(Q=JSON.stringify,Z=JSON.parse),Q=Q||q.JSONEncode,Z=Z||q.JSONDecode,q.toArray=q.toArray,q.isObject=q.isObject,q.JSONEncode=q.JSONEncode,q.JSONDecode=q.JSONDecode,q.isBlockedUA=q.isBlockedUA,q.isEmptyObject=q.isEmptyObject,q.info=q.info,q.info.device=q.info.device,q.info.browser=q.info.browser,q.info.browserVersion=q.info.browserVersion,q.info.properties=q.info.properties;var Y=function(){};Y.prototype.create_properties=function(){},Y.prototype.event_handler=function(){},Y.prototype.after_track_handler=function(){},Y.prototype.init=function(e){return this.mp=e,this},Y.prototype.track=function(e,t,n,r){var i=this,o=q.dom_query(e);if(0===o.length){F.error("The DOM query ("+e+") returned 0 elements");return}return q.each(o,function(e){q.register_event(e,this.override_event,function(e){var o={},s=i.create_properties(n,this),a=i.mp.get_config("track_links_timeout");i.event_handler(e,this,o),window.setTimeout(i.track_callback(r,s,o,!0),a),i.mp.track(t,s,i.track_callback(r,s,o))})},this),!0},Y.prototype.track_callback=function(e,t,n,r){r=r||!1;var i=this;return function(){!n.callback_fired&&(n.callback_fired=!0,e&&!1===e(r,t)||i.after_track_handler(t,n,r))}},Y.prototype.create_properties=function(e,t){return"function"==typeof e?e(t):q.extend({},e)};var ee=function(){this.override_event="click"};q.inherit(ee,Y),ee.prototype.create_properties=function(e,t){var n=ee.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},ee.prototype.event_handler=function(e,t,n){n.new_tab=2===e.which||e.metaKey||e.ctrlKey||"_blank"===t.target,n.href=t.href,n.new_tab||e.preventDefault()},ee.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout(function(){window.location=t.href},0)};var et=function(){this.override_event="submit"};q.inherit(et,Y),et.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()},et.prototype.after_track_handler=function(e,t){setTimeout(function(){t.element.submit()},0)};var en=B("lock"),er=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};er.prototype.withLock=function(e,t,n){n||"function"==typeof t||(n=t,t=null);var r=n||new Date().getTime()+"|"+Math.random(),i=new Date().getTime(),o=this.storageKey,s=this.pollIntervalMS,a=this.timeoutMS,u=this.storage,l=o+":X",c=o+":Y",d=o+":Z",h=function(e){t&&t(e)},f=function(e){if(new Date().getTime()-i>a){en.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+r+"]"),u.removeItem(d),u.removeItem(c),m();return}setTimeout(function(){try{e()}catch(e){h(e)}},s*(Math.random()+.1))},p=function(e,t){e()?t():f(function(){p(e,t)})},g=function(){var e=u.getItem(c);if(e&&e!==r)return!1;if(u.setItem(c,r),u.getItem(c)===r)return!0;if(!G(u,!0))throw Error("localStorage support dropped while acquiring lock");return!1},m=function(){u.setItem(l,r),p(g,function(){if(u.getItem(l)===r){y();return}f(function(){if(u.getItem(c)!==r){m();return}p(function(){return!u.getItem(d)},y)})})},y=function(){u.setItem(d,"1");try{e()}finally{u.removeItem(d),u.getItem(c)===r&&u.removeItem(c),u.getItem(l)===r&&u.removeItem(l)}};try{if(G(u,!0))m();else throw Error("localStorage support check failed")}catch(e){h(e)}};var ei=B("batch"),eo=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||q.bind(ei.error,ei),this.lock=new er(e,{storage:this.storage}),this.pid=t.pid||null,this.memQueue=[]};eo.prototype.enqueue=function(e,t,n){var r={id:H(),flushAfter:new Date().getTime()+2*t,payload:e};this.lock.withLock(q.bind(function(){var t;try{var i=this.readFromStorage();i.push(r),(t=this.saveToStorage(i))&&this.memQueue.push(r)}catch(n){this.reportError("Error enqueueing item",e),t=!1}n&&n(t)},this),q.bind(function(e){this.reportError("Error acquiring storage lock",e),n&&n(!1)},this),this.pid)},eo.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(t.length<e){var n=this.readFromStorage();if(n.length){var r={};q.each(t,function(e){r[e.id]=!0});for(var i=0;i<n.length;i++){var o=n[i];if(new Date().getTime()>o.flushAfter&&!r[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}}return t};var es=function(e,t){var n=[];return q.each(e,function(e){e.id&&!t[e.id]&&n.push(e)}),n};eo.prototype.removeItemsByID=function(e,t){var n={};q.each(e,function(e){n[e]=!0}),this.memQueue=es(this.memQueue,n);var r=q.bind(function(){var t;try{var r=this.readFromStorage();if(r=es(r,n),t=this.saveToStorage(r)){r=this.readFromStorage();for(var i=0;i<r.length;i++){var o=r[i];if(o.id&&n[o.id])return this.reportError("Item not removed from storage"),!1}}}catch(n){this.reportError("Error removing items",e),t=!1}return t},this);this.lock.withLock(function(){var e=r();t&&t(e)},q.bind(function(e){var n=!1;if(this.reportError("Error acquiring storage lock",e),!G(this.storage,!0)&&!(n=r()))try{this.storage.removeItem(this.storageKey)}catch(e){this.reportError("Error clearing queue",e)}t&&t(n)},this),this.pid)};var ea=function(e,t){var n=[];return q.each(e,function(e){var r=e.id;if(r in t){var i=t[r];null!==i&&(e.payload=i,n.push(e))}else n.push(e)}),n};eo.prototype.updatePayloads=function(e,t){this.memQueue=ea(this.memQueue,e),this.lock.withLock(q.bind(function(){var n;try{var r=this.readFromStorage();r=ea(r,e),n=this.saveToStorage(r)}catch(t){this.reportError("Error updating items",e),n=!1}t&&t(n)},this),q.bind(function(e){this.reportError("Error acquiring storage lock",e),t&&t(!1)},this),this.pid)},eo.prototype.readFromStorage=function(){var e;try{(e=this.storage.getItem(this.storageKey))&&(e=Z(e),q.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null))}catch(t){this.reportError("Error retrieving queue",t),e=null}return e||[]},eo.prototype.saveToStorage=function(e){try{return this.storage.setItem(this.storageKey,Q(e)),!0}catch(e){return this.reportError("Error saving queue",e),!1}},eo.prototype.clear=function(){this.memQueue=[],this.storage.removeItem(this.storageKey)};var eu=B("batch"),el=function(e,t){this.errorReporter=t.errorReporter,this.queue=new eo(e,{errorReporter:q.bind(this.reportError,this),storage:t.storage}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0};function ec(e,t){ew(!0,e,t)}function ed(e,t){ew(!1,e,t)}function eh(e,t){return"1"===eb(e,t)}function ef(e,t){if(function(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||m,n=t.navigator||{},r=!1;return q.each([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],function(e){q.includes([!0,1,"1","yes"],e)&&(r=!0)}),r}(t))return F.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var n="0"===eb(e,t);return n&&F.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function ep(e){return eS(e,function(e){return this.get_config(e)})}function eg(e){return eS(e,function(e){return this._get_config(e)})}function em(e){return eS(e,function(e){return this._get_config(e)})}function ey(e,t){ev(t=t||{}).remove(e_(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function ev(e){return"localStorage"===(e=e||{}).persistenceType?q.localStorage:q.cookie}function e_(e,t){return((t=t||{}).persistencePrefix||"__mp_opt_in_out_")+e}function eb(e,t){return ev(t).get(e_(e,t))}function ew(e,t,n){if(!q.isString(t)||!t.length){F.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token");return}ev(n=n||{}).set(e_(t,n),e?1:0,q.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})}function eS(e,t){return function(){var n=!1;try{var r=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),s=t.call(this,"opt_out_tracking_cookie_prefix"),a=t.call(this,"window");r&&(n=ef(r,{ignoreDnt:i,persistenceType:o,persistencePrefix:s,window:a}))}catch(e){F.error("Unexpected error when checking tracking opt-out status: "+e)}if(!n)return e.apply(this,arguments);var u=arguments[arguments.length-1];"function"==typeof u&&u(0)}}el.prototype.enqueue=function(e,t){this.queue.enqueue(e,this.flushInterval,t)},el.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},el.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},el.prototype.clear=function(){this.queue.clear()},el.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},el.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},el.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(q.bind(this.flush,this),this.flushInterval))},el.prototype.flush=function(e){try{if(this.requestInProgress){eu.log("Flush: Request already in progress");return}e=e||{};var t=this.libConfig.batch_request_timeout_ms,n=new Date().getTime(),r=this.batchSize,i=this.queue.fillBatch(r),o=[],s={};if(q.each(i,function(e){var t=e.payload;this.beforeSendHook&&!e.orphaned&&(t=this.beforeSendHook(t)),t&&o.push(t),s[e.id]=t},this),o.length<1){this.resetFlush();return}this.requestInProgress=!0;var a=q.bind(function(o){this.requestInProgress=!1;try{var a=!1;if(e.unloading)this.queue.updatePayloads(s);else if(q.isObject(o)&&"timeout"===o.error&&new Date().getTime()-n>=t)this.reportError("Network timeout; retrying"),this.flush();else if(q.isObject(o)&&o.xhr_req&&(o.xhr_req.status>=500||429===o.xhr_req.status||"timeout"===o.error)){var u=2*this.flushInterval,l=o.xhr_req.responseHeaders;if(l){var c=l["Retry-After"];c&&(u=1e3*parseInt(c,10)||u)}u=Math.min(6e5,u),this.reportError("Error; retry in "+u+" ms"),this.scheduleFlush(u)}else if(q.isObject(o)&&o.xhr_req&&413===o.xhr_req.status){if(i.length>1){var d=Math.max(1,Math.floor(r/2));this.batchSize=Math.min(this.batchSize,d,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),a=!0}else a=!0;a&&this.queue.removeItemsByID(q.map(i,function(e){return e.id}),q.bind(function(e){e?(this.consecutiveRemovalFailures=0,this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())},this))}catch(e){this.reportError("Error handling API response",e),this.resetFlush()}},this),u={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(u.transport="sendBeacon"),eu.log("MIXPANEL REQUEST:",o),this.sendRequest(o,u,a)}catch(e){this.reportError("Error flushing request queue",e),this.resetFlush()}},el.prototype.reportError=function(e,t){if(eu.error.apply(eu.error,arguments),this.errorReporter)try{t instanceof Error||(t=Error(e)),this.errorReporter(e,t)}catch(e){eu.error(e)}};var eE="$set",ek="$set_once",eI="$unset",eT="$add",ex="$append",eC="$union",eA="$remove",eO={set_action:function(e,t){var n={},r={};return q.isObject(e)?q.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this):r[e]=t,n[eE]=r,n},unset_action:function(e){var t={},n=[];return q.isArray(e)||(e=[e]),q.each(e,function(e){this._is_reserved_property(e)||n.push(e)},this),t[eI]=n,t},set_once_action:function(e,t){var n={},r={};return q.isObject(e)?q.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this):r[e]=t,n[ek]=r,n},union_action:function(e,t){var n={},r={};return q.isObject(e)?q.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=q.isArray(e)?e:[e])},this):r[e]=q.isArray(t)?t:[t],n[eC]=r,n},append_action:function(e,t){var n={},r={};return q.isObject(e)?q.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this):r[e]=t,n[ex]=r,n},remove_action:function(e,t){var n={},r={};return q.isObject(e)?q.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this):r[e]=t,n[eA]=r,n},delete_action:function(){var e={};return e.$delete="",e}},eN=function(){};q.extend(eN.prototype,eO),eN.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n},eN.prototype.set=em(function(e,t,n){var r=this.set_action(e,t);return q.isObject(e)&&(n=t),this._send_request(r,n)}),eN.prototype.set_once=em(function(e,t,n){var r=this.set_once_action(e,t);return q.isObject(e)&&(n=t),this._send_request(r,n)}),eN.prototype.unset=em(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)}),eN.prototype.union=em(function(e,t,n){q.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)}),eN.prototype.delete=em(function(e){var t=this.delete_action();return this._send_request(t,e)}),eN.prototype.remove=em(function(e,t,n){var r=this.remove_action(e,t);return this._send_request(r,n)}),eN.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var n=q.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._get_config("api_host")+"/groups/",batcher:this._mixpanel.request_batchers.groups},t)},eN.prototype._is_reserved_property=function(e){return"$group_key"===e||"$group_id"===e},eN.prototype._get_config=function(e){return this._mixpanel.get_config(e)},eN.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},eN.prototype.remove=eN.prototype.remove,eN.prototype.set=eN.prototype.set,eN.prototype.set_once=eN.prototype.set_once,eN.prototype.union=eN.prototype.union,eN.prototype.unset=eN.prototype.unset,eN.prototype.toString=eN.prototype.toString;var eR=function(){};q.extend(eR.prototype,eO),eR.prototype._init=function(e){this._mixpanel=e},eR.prototype.set=eg(function(e,t,n){var r=this.set_action(e,t);return q.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r[eE]=q.extend({},q.info.people_properties(),this._mixpanel.persistence.get_referrer_info(),r[eE]),this._send_request(r,n)}),eR.prototype.set_once=eg(function(e,t,n){var r=this.set_once_action(e,t);return q.isObject(e)&&(n=t),this._send_request(r,n)}),eR.prototype.unset=eg(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)}),eR.prototype.increment=eg(function(e,t,n){var r={},i={};return q.isObject(e)?(q.each(e,function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e))){F.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}i[t]=e}},this),n=t):(q.isUndefined(t)&&(t=1),i[e]=t),r[eT]=i,this._send_request(r,n)}),eR.prototype.append=eg(function(e,t,n){q.isObject(e)&&(n=t);var r=this.append_action(e,t);return this._send_request(r,n)}),eR.prototype.remove=eg(function(e,t,n){q.isObject(e)&&(n=t);var r=this.remove_action(e,t);return this._send_request(r,n)}),eR.prototype.union=eg(function(e,t,n){q.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)}),eR.prototype.track_charge=eg(function(e,t,n){if(!q.isNumber(e)&&isNaN(e=parseFloat(e))){F.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",q.extend({$amount:e},t),n)}),eR.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},eR.prototype.delete_user=function(){if(!this._identify_called()){F.error("mixpanel.people.delete_user() requires you to call identify() first");return}var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)},eR.prototype.toString=function(){return this._mixpanel.toString()+".people"},eR.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),r=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),i&&(e.$had_persisted_distinct_id=i);var o=q.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._get_config("api_host")+"/engage/",batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),q.isUndefined(t)||t(this._get_config("verbose")?{status:-1,error:null}:-1),q.truncate(o,255))},eR.prototype._get_config=function(e){return this._mixpanel.get_config(e)},eR.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},eR.prototype._enqueue=function(e){eE in e?this._mixpanel.persistence._add_to_people_queue(eE,e):ek in e?this._mixpanel.persistence._add_to_people_queue(ek,e):eI in e?this._mixpanel.persistence._add_to_people_queue(eI,e):eT in e?this._mixpanel.persistence._add_to_people_queue(eT,e):ex in e?this._mixpanel.persistence._add_to_people_queue(ex,e):eA in e?this._mixpanel.persistence._add_to_people_queue(eA,e):eC in e?this._mixpanel.persistence._add_to_people_queue(eC,e):F.error("Invalid call to _enqueue():",e)},eR.prototype._flush_one_queue=function(e,t,n,r){var i=this,o=q.extend({},this._mixpanel.persistence._get_queue(e)),s=o;!q.isUndefined(o)&&q.isObject(o)&&!q.isEmptyObject(o)&&(i._mixpanel.persistence._pop_from_people_queue(e,o),r&&(s=r(o)),t.call(i,s,function(t,r){0===t&&i._mixpanel.persistence._add_to_people_queue(e,o),q.isUndefined(n)||n(t,r)}))},eR.prototype._flush=function(e,t,n,r,i,o,s){var a=this,u=this._mixpanel.persistence._get_queue(ex),l=this._mixpanel.persistence._get_queue(eA);if(this._flush_one_queue(eE,this.set,e),this._flush_one_queue(ek,this.set_once,r),this._flush_one_queue(eI,this.unset,o,function(e){return q.keys(e)}),this._flush_one_queue(eT,this.increment,t),this._flush_one_queue(eC,this.union,i),!q.isUndefined(u)&&q.isArray(u)&&u.length){for(var c,d=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(ex,c),q.isUndefined(n)||n(e,t)},h=u.length-1;h>=0;h--)c=u.pop(),q.isEmptyObject(c)||a.append(c,d);a._mixpanel.persistence.save()}if(!q.isUndefined(l)&&q.isArray(l)&&l.length){for(var f,p=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(eA,f),q.isUndefined(s)||s(e,t)},g=l.length-1;g>=0;g--)f=l.pop(),q.isEmptyObject(f)||a.remove(f,p);a._mixpanel.persistence.save()}},eR.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},eR.prototype.set=eR.prototype.set,eR.prototype.set_once=eR.prototype.set_once,eR.prototype.unset=eR.prototype.unset,eR.prototype.increment=eR.prototype.increment,eR.prototype.append=eR.prototype.append,eR.prototype.remove=eR.prototype.remove,eR.prototype.union=eR.prototype.union,eR.prototype.track_charge=eR.prototype.track_charge,eR.prototype.clear_charges=eR.prototype.clear_charges,eR.prototype.delete_user=eR.prototype.delete_user,eR.prototype.toString=eR.prototype.toString;var eD="__mps",eP="__mpso",eM="__mpus",eL="__mpa",eU="__mpap",ej="__mpr",eq="__mpu",eF="$people_distinct_id",e$="__alias",eB="__timers",ez=[eD,eP,eM,eL,eU,ej,eq,eF,e$,eB],eV=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;"cookie"!==t&&"localStorage"!==t&&(F.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&q.localStorage.is_supported()?this.storage=q.localStorage:this.storage=q.cookie,this.load(),this.update_config(e),this.upgrade(e),this.save()};eV.prototype.properties=function(){var e={};return q.each(this.props,function(t,n){q.include(ez,n)||(e[n]=t)}),e},eV.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=q.extend({},e))}},eV.prototype.upgrade=function(e){var t,n,r=e.upgrade;r&&(t="mp_super_properties","string"==typeof r&&(t=r),n=this.storage.parse(t),this.storage.remove(t),this.storage.remove(t,!0),n&&(this.props=q.extend(this.props,n.all,n.events))),!e.cookie_name&&"mixpanel"!==e.name&&(t="mp_"+e.token+"_"+e.name,(n=this.storage.parse(t))&&(this.storage.remove(t),this.storage.remove(t,!0),this.register_once(n))),this.storage===q.localStorage&&(n=q.cookie.parse(this.name),q.cookie.remove(this.name),q.cookie.remove(this.name,!0),n&&this.register_once(n))},eV.prototype.save=function(){this.disabled||this.storage.set(this.name,q.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},eV.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},eV.prototype.clear=function(){this.remove(),this.props={}},eV.prototype.register_once=function(e,t,n){return!!q.isObject(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n,q.each(e,function(e,n){this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e)},this),this.save(),!0)},eV.prototype.register=function(e,t){return!!q.isObject(e)&&(this.expire_days=void 0===t?this.default_expiry:t,q.extend(this.props,e),this.save(),!0)},eV.prototype.unregister=function(e){e in this.props&&(delete this.props[e],this.save())},eV.prototype.update_campaign_params=function(){this.campaign_params_saved||(this.register_once(q.info.campaignParams()),this.campaign_params_saved=!0)},eV.prototype.update_search_keyword=function(e){this.register(q.info.searchInfo(e))},eV.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:q.info.referringDomain(e)||"$direct"},"")},eV.prototype.get_referrer_info=function(){return q.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},eV.prototype.safe_merge=function(e){return q.each(this.props,function(t,n){n in e||(e[n]=t)}),e},eV.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},eV.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},eV.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},eV.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},eV.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},eV.prototype.get_cross_subdomain=function(){return this.cross_subdomain},eV.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},eV.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),r=t[e],i=this._get_or_create_queue(eE),o=this._get_or_create_queue(ek),s=this._get_or_create_queue(eI),a=this._get_or_create_queue(eT),u=this._get_or_create_queue(eC),l=this._get_or_create_queue(eA,[]),c=this._get_or_create_queue(ex,[]);n===eD?(q.extend(i,r),this._pop_from_people_queue(eT,r),this._pop_from_people_queue(eC,r),this._pop_from_people_queue(eI,r)):n===eP?(q.each(r,function(e,t){t in o||(o[t]=e)}),this._pop_from_people_queue(eI,r)):n===eM?q.each(r,function(e){q.each([i,o,a,u],function(t){e in t&&delete t[e]}),q.each(c,function(t){e in t&&delete t[e]}),s[e]=!0}):n===eL?(q.each(r,function(e,t){t in i?i[t]+=e:(t in a||(a[t]=0),a[t]+=e)},this),this._pop_from_people_queue(eI,r)):n===eq?(q.each(r,function(e,t){q.isArray(e)&&(t in u||(u[t]=[]),u[t]=u[t].concat(e))}),this._pop_from_people_queue(eI,r)):n===ej?(l.push(r),this._pop_from_people_queue(ex,r)):n===eU&&(c.push(r),this._pop_from_people_queue(eI,r)),F.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),F.log(t),this.save()},eV.prototype._pop_from_people_queue=function(e,t){var n=this._get_queue(e);q.isUndefined(n)||(q.each(t,function(t,r){e===ex||e===eA?q.each(n,function(e){e[r]===t&&delete e[r]}):delete n[r]},this),this.save())},eV.prototype._get_queue_key=function(e){return e===eE?eD:e===ek?eP:e===eI?eM:e===eT?eL:e===ex?eU:e===eA?ej:e===eC?eq:void F.error("Invalid queue:",e)},eV.prototype._get_queue=function(e){return this.props[this._get_queue_key(e)]},eV.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=q.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},eV.prototype.set_event_timer=function(e,t){var n=this.props[eB]||{};n[e]=t,this.props[eB]=n,this.save()},eV.prototype.remove_event_timer=function(e){var t=(this.props[eB]||{})[e];return q.isUndefined(t)||(delete this.props[eB][e],this.save()),t};var eG=function(e){return e},eW=function(){},eH="mixpanel",eK="base64",eJ=m.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,eX=!eJ&&-1===R.indexOf("MSIE")&&-1===R.indexOf("Mozilla"),eQ=null;C.sendBeacon&&(eQ=function(){return C.sendBeacon.apply(C,arguments)});var eZ={api_host:"https://api-js.mixpanel.com",api_method:"POST",api_transport:"XHR",api_payload_format:eK,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:eW,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:eW,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{}},eY=!1,e0=function(){},e1=function(e,t,n){var r,i=n===eH?v:v[n];if(i&&0===y)r=i;else{if(i&&!q.isArray(i)){F.error("You have already initialized "+n);return}r=new e0}return r._cached_groups={},r._init(e,t,n),r.people=new eR,r.people._init(r),_.DEBUG=_.DEBUG||r.get_config("debug"),!q.isUndefined(i)&&q.isArray(i)&&(r._execute_array.call(r.people,i.people),r._execute_array(i)),r};e0.prototype.init=function(e,t,n){if(q.isUndefined(n)){this.report_error("You must name your new library: init(token, config, name)");return}if(n===eH){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var r=e1(e,t,n);return v[n]=r,r._loaded(),r},e0.prototype._init=function(e,t,n){t=t||{},this.__loaded=!0,this.config={};var r={};if(!("api_payload_format"in t)&&(t.api_host||eZ.api_host).match(/\.mixpanel\.com$/)&&(r.api_payload_format="json"),this.set_config(q.extend({},eZ,r,t,{name:n,token:e,callback_fn:(n===eH?n:eH+"."+n)+"._jsc"})),this._jsc=eW,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(q.localStorage.is_supported(!0)&&eJ){if(this.init_batchers(),eQ&&m.addEventListener){var i=q.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);m.addEventListener("pagehide",function(e){e.persisted&&i()}),m.addEventListener("visibilitychange",function(){"hidden"===A.visibilityState&&i()})}}else this._batch_requests=!1,F.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support")}this.persistence=this.cookie=new eV(this.config),this.unpersisted_superprops={},this._gdpr_init();var o=q.UUID();this.get_distinct_id()||this.register_once({distinct_id:o,$device_id:o},"")},e0.prototype._loaded=function(){this.get_config("loaded")(this),this._set_default_superprops()},e0.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(A.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(A.referrer)},e0.prototype._dom_loaded=function(){q.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),this.has_opted_out_tracking()||q.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue},e0.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!eY)return this.__dom_loaded_queue.push([e,t]),!1;var n=new e().init(this);return n.track.apply(n,t)},e0.prototype._prepare_callback=function(e,t){if(q.isUndefined(e))return null;if(eJ)return function(n){e(n,t)};var n=this._jsc,r=""+Math.floor(1e8*Math.random()),i=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(i){delete n[r],e(i,t)},i},e0.prototype._send_request=function(e,t,n,r){var i=!0;if(eX)return this.__request_queue.push(arguments),i;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;!r&&(q.isFunction(n)||"string"==typeof n)&&(r=n,n=null),n=q.extend(o,n||{}),eJ||(n.method="GET");var a="POST"===n.method,u=eQ&&a&&"sendbeacon"===n.transport.toLowerCase(),l=n.verbose;t.verbose&&(l=!0),this.get_config("test")&&(t.test=1),l&&(t.verbose=1),this.get_config("img")&&(t.img=1),!eJ&&(r?t.callback=r:(l||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=new Date().getTime().toString(),a&&(s="data="+encodeURIComponent(t.data),delete t.data),e+="?"+q.HTTPBuildQuery(t);var c=this;if("img"in t){var d=A.createElement("img");d.src=e,A.body.appendChild(d)}else if(u){try{i=eQ(e,s)}catch(e){c.report_error(e),i=!1}try{r&&r(i?1:0)}catch(e){c.report_error(e)}}else if(eJ)try{var h=new XMLHttpRequest;h.open(n.method,e,!0);var f=this.get_config("xhr_headers");if(a&&(f["Content-Type"]="application/x-www-form-urlencoded"),q.each(f,function(e,t){h.setRequestHeader(t,e)}),n.timeout_ms&&void 0!==h.timeout){h.timeout=n.timeout_ms;var p=new Date().getTime()}h.withCredentials=!0,h.onreadystatechange=function(){if(4===h.readyState){var e,t;if(200===h.status){if(r){if(l){try{e=q.JSONDecode(h.responseText)}catch(t){if(c.report_error(t),!n.ignore_json_errors)return;e=h.responseText}r(e)}else r(Number(h.responseText))}}else t=h.timeout&&!h.status&&new Date().getTime()-p>=h.timeout?"timeout":"Bad HTTP status: "+h.status+" "+h.statusText,c.report_error(t),r&&(l?r({status:0,error:t,xhr_req:h}):r(0))}},h.send(s)}catch(e){c.report_error(e),i=!1}else{var g=A.createElement("script");g.type="text/javascript",g.async=!0,g.defer=!0,g.src=e;var m=A.getElementsByTagName("script")[0];m.parentNode.insertBefore(g,m)}return i},e0.prototype._execute_array=function(e){var t,n=[],r=[],i=[];q.each(e,function(e){e&&(t=e[0],q.isArray(t)?i.push(e):"function"==typeof e?e.call(this):q.isArray(e)&&"alias"===t?n.push(e):q.isArray(e)&&-1!==t.indexOf("track")&&"function"==typeof this[t]?i.push(e):r.push(e))},this);var o=function(e,t){q.each(e,function(e){if(q.isArray(e[0])){var n=t;q.each(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};o(n,this),o(r,this),o(i,this)},e0.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},e0.prototype.init_batchers=function(){var e=this.get_config("token");if(!this.are_batchers_initialized()){var t=q.bind(function(t){return new el("__mpq_"+e+t.queue_suffix,{libConfig:this.config,sendRequestFunc:q.bind(function(e,n,r){this._send_request(this.get_config("api_host")+t.endpoint,this._encode_data_for_request(e),n,this._prepare_callback(r,e))},this),beforeSendHook:q.bind(function(e){return this._run_hook("before_send_"+t.type,e)},this),errorReporter:this.get_config("error_reporter"),stopAllBatchingFunc:q.bind(this.stop_batch_senders,this)})},this);this.request_batchers={events:t({type:"events",endpoint:"/track/",queue_suffix:"_ev"}),people:t({type:"people",endpoint:"/engage/",queue_suffix:"_pp"}),groups:t({type:"groups",endpoint:"/groups/",queue_suffix:"_gr"})}}this.get_config("batch_autostart")&&this.start_batch_senders()},e0.prototype.start_batch_senders=function(){this.are_batchers_initialized()&&(this._batch_requests=!0,q.each(this.request_batchers,function(e){e.start()}))},e0.prototype.stop_batch_senders=function(){this._batch_requests=!1,q.each(this.request_batchers,function(e){e.stop(),e.clear()})},e0.prototype.push=function(e){this._execute_array([e])},e0.prototype.disable=function(e){void 0===e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},e0.prototype._encode_data_for_request=function(e){var t=q.JSONEncode(e);return this.get_config("api_payload_format")===eK&&(t=q.base64Encode(t)),{data:t}},e0.prototype._track_or_batch=function(e,t){var n=q.truncate(e.data,255),r=e.endpoint,i=e.batcher,o=e.should_send_immediately,s=e.send_request_options||{};t=t||eW;var a=!0,u=q.bind(function(){return(s.skip_hooks||(n=this._run_hook("before_send_"+e.type,n)),n)?(F.log("MIXPANEL REQUEST:"),F.log(n),this._send_request(r,this._encode_data_for_request(n),s,this._prepare_callback(t,n))):null},this);return this._batch_requests&&!o?i.enqueue(n,function(e){e?t(1,n):u()}):a=u(),a&&n},e0.prototype.track=ep(function(e,t,n,r){r||"function"!=typeof n||(r=n,n=null);var i=(n=n||{}).transport;i&&(n.transport=i);var o=n.send_immediately;if("function"!=typeof r&&(r=eW),q.isUndefined(e)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(e)){r(0);return}(t=t||{}).token=this.get_config("token");var s=this.persistence.remove_event_timer(e);if(!q.isUndefined(s)){var a=new Date().getTime()-s;t.$duration=parseFloat((a/1e3).toFixed(3))}this._set_default_superprops(),t=q.extend({},q.info.properties(),this.persistence.properties(),this.unpersisted_superprops,t);var u=this.get_config("property_blacklist");q.isArray(u)?q.each(u,function(e){delete t[e]}):this.report_error("Invalid value for property_blacklist config: "+u);var l={event:e,properties:t};return this._track_or_batch({type:"events",data:l,endpoint:this.get_config("api_host")+"/track/",batcher:this.request_batchers.events,should_send_immediately:o,send_request_options:n},r)}),e0.prototype.set_group=ep(function(e,t,n){q.isArray(t)||(t=[t]);var r={};return r[e]=t,this.register(r),this.people.set(e,t,n)}),e0.prototype.add_group=ep(function(e,t,n){var r=this.get_property(e);if(void 0===r){var i={};i[e]=[t],this.register(i)}else -1===r.indexOf(t)&&(r.push(t),this.register(i));return this.people.union(e,t,n)}),e0.prototype.remove_group=ep(function(e,t,n){var r=this.get_property(e);if(void 0!==r){var i=r.indexOf(t);i>-1&&(r.splice(i,1),this.register({group_key:r})),0===r.length&&this.unregister(e)}return this.people.remove(e,t,n)}),e0.prototype.track_with_groups=ep(function(e,t,n,r){var i=q.extend({},t||{});return q.each(n,function(e,t){null!=e&&(i[t]=e)}),this.track(e,i,r)}),e0.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},e0.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},e0.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),r=this._cached_groups[n];return(void 0===r||r._group_key!==e||r._group_id!==t)&&((r=new eN)._init(this,e,t),this._cached_groups[n]=r),r},e0.prototype.track_pageview=function(e){q.isUndefined(e)&&(e=A.location.href),this.track("mp_page_view",q.info.pageviewInfo(e))},e0.prototype.track_links=function(){return this._track_dom.call(this,ee,arguments)},e0.prototype.track_forms=function(){return this._track_dom.call(this,et,arguments)},e0.prototype.time_event=function(e){if(q.isUndefined(e)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(e)||this.persistence.set_event_timer(e,new Date().getTime())};var e2={persistent:!0},e3=function(e){var t;return t=q.isObject(e)?e:q.isUndefined(e)?{}:{days:e},q.extend({},e2,t)};e0.prototype.register=function(e,t){var n=e3(t);n.persistent?this.persistence.register(e,n.days):q.extend(this.unpersisted_superprops,e)},e0.prototype.register_once=function(e,t,n){var r=e3(n);r.persistent?this.persistence.register_once(e,t,r.days):(void 0===t&&(t="None"),q.each(e,function(e,n){this.unpersisted_superprops.hasOwnProperty(n)&&this.unpersisted_superprops[n]!==t||(this.unpersisted_superprops[n]=e)},this))},e0.prototype.unregister=function(e,t){(t=e3(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]},e0.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},e0.prototype.identify=function(e,t,n,r,i,o,s,a){var u=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:u},""),e!==u&&e!==this.get_property(e$)&&(this.unregister(e$),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,r,i,o,s,a),e!==u&&this.track("$identify",{distinct_id:e,$anon_distinct_id:u},{skip_hooks:!0})},e0.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=q.UUID();this.register_once({distinct_id:e,$device_id:e},"")},e0.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},e0.prototype.alias=function(e,t){if(e===this.get_property(eF))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return(q.isUndefined(t)&&(t=this.get_distinct_id()),e!==t)?(this._register_single(e$,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},function(){n.identify(e)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},e0.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},e0.prototype.set_config=function(e){q.isObject(e)&&(q.extend(this.config,e),e.batch_size&&q.each(this.request_batchers,function(e){e.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),_.DEBUG=_.DEBUG||this.get_config("debug"))},e0.prototype.get_config=function(e){return this.config[e]},e0.prototype._run_hook=function(e){var t=(this.config.hooks[e]||eG).apply(this,k.call(arguments,1));return void 0===t&&(this.report_error(e+" hook did not return a value"),t=null),t},e0.prototype.get_property=function(e){return this.persistence.props[e]},e0.prototype.toString=function(){var e=this.get_config("name");return e!==eH&&(e=eH+"."+e),e},e0.prototype._event_is_disabled=function(e){return q.isBlockedUA(R)||this._flags.disable_all_events||q.include(this.__disabled_events,e)},e0.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&q.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||q.cookie.get("mp_optout"))&&(q.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},e0.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t),t&&q.each(this.request_batchers,function(e){e.clear()})},e0.prototype._gdpr_call_func=function(e,t){return t=q.extend({track:q.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),q.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})},e0.prototype.opt_in_tracking=function(e){e=q.extend({enable_persistence:!0},e),this._gdpr_call_func(ec,e),this._gdpr_update_persistence(e)},e0.prototype.opt_out_tracking=function(e){(e=q.extend({clear_persistence:!0,delete_user:!0},e)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(ed,e),this._gdpr_update_persistence(e)},e0.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(eh,e)},e0.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(ef,e)},e0.prototype.clear_opt_in_out_tracking=function(e){e=q.extend({enable_persistence:!0},e),this._gdpr_call_func(ey,e),this._gdpr_update_persistence(e)},e0.prototype.report_error=function(e,t){F.error.apply(F.error,arguments);try{t||e instanceof Error||(e=Error(e)),this.get_config("error_reporter")(e,t)}catch(e){F.error(e)}},e0.prototype.init=e0.prototype.init,e0.prototype.reset=e0.prototype.reset,e0.prototype.disable=e0.prototype.disable,e0.prototype.time_event=e0.prototype.time_event,e0.prototype.track=e0.prototype.track,e0.prototype.track_links=e0.prototype.track_links,e0.prototype.track_forms=e0.prototype.track_forms,e0.prototype.track_pageview=e0.prototype.track_pageview,e0.prototype.register=e0.prototype.register,e0.prototype.register_once=e0.prototype.register_once,e0.prototype.unregister=e0.prototype.unregister,e0.prototype.identify=e0.prototype.identify,e0.prototype.alias=e0.prototype.alias,e0.prototype.name_tag=e0.prototype.name_tag,e0.prototype.set_config=e0.prototype.set_config,e0.prototype.get_config=e0.prototype.get_config,e0.prototype.get_property=e0.prototype.get_property,e0.prototype.get_distinct_id=e0.prototype.get_distinct_id,e0.prototype.toString=e0.prototype.toString,e0.prototype.opt_out_tracking=e0.prototype.opt_out_tracking,e0.prototype.opt_in_tracking=e0.prototype.opt_in_tracking,e0.prototype.has_opted_out_tracking=e0.prototype.has_opted_out_tracking,e0.prototype.has_opted_in_tracking=e0.prototype.has_opted_in_tracking,e0.prototype.clear_opt_in_out_tracking=e0.prototype.clear_opt_in_out_tracking,e0.prototype.get_group=e0.prototype.get_group,e0.prototype.set_group=e0.prototype.set_group,e0.prototype.add_group=e0.prototype.add_group,e0.prototype.remove_group=e0.prototype.remove_group,e0.prototype.track_with_groups=e0.prototype.track_with_groups,e0.prototype.start_batch_senders=e0.prototype.start_batch_senders,e0.prototype.stop_batch_senders=e0.prototype.stop_batch_senders,eV.prototype.properties=eV.prototype.properties,eV.prototype.update_search_keyword=eV.prototype.update_search_keyword,eV.prototype.update_referrer_info=eV.prototype.update_referrer_info,eV.prototype.get_cross_subdomain=eV.prototype.get_cross_subdomain,eV.prototype.clear=eV.prototype.clear;var e4={},e5=function(){q.each(e4,function(e,t){t!==eH&&(v[t]=e)}),v._=q},e6=(y=0,(v=new e0).init=function(e,t,n){if(n)return v[n]||(v[n]=e4[n]=e1(e,t,n),v[n]._loaded()),v[n];var r=v;e4[eH]?r=e4[eH]:e&&((r=e1(e,t,eH))._loaded(),e4[eH]=r),v=r,1===y&&(m[eH]=v),e5()},v.init(),function(){function e(){e.done||(e.done=!0,eY=!0,eX=!1,q.each(e4,function(e){e._dom_loaded()}))}if(A.addEventListener)"complete"===A.readyState?e():A.addEventListener("DOMContentLoaded",e,!1);else if(A.attachEvent){A.attachEvent("onreadystatechange",e);var t=!1;try{t=null===m.frameElement}catch(e){}A.documentElement.doScroll&&t&&function t(){try{A.documentElement.doScroll("left")}catch(e){setTimeout(t,1);return}e()}()}q.register_event(m,"load",e,!0)}(),v);e.exports=e6},83454:function(e,t,n){"use strict";var r,i;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(i=n.g.process)?void 0:i.env)?n.g.process:n(77663)},6840:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return n(56518)}])},99846:function(e,t,n){"use strict";n.d(t,{$A:function(){return p},AF:function(){return E},Ff:function(){return m},Kz:function(){return w},Pk:function(){return y},SI:function(){return b},XY:function(){return v},nc:function(){return S},zb:function(){return g}});var r=n(8891),i=n.n(r),o=n(49636),s=n(19781);n(53059);var a=n(31514);n(15661);var u=n(73076),l=n(39424),c=n(92287),d=n(6713),h=n(83454);let f=o.TQ?"fab8a96ca0946744d109ed81ef934973":"c28fbb466cb5df98b9f5c7022fdb92d7",p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(o.cN||!e||(i().identify(e),!Object.keys(t).length))return;let n=t;"firstName"in t&&t.firstName&&(n={...t,$name:t.firstName}),i().people.set_once(n)},g=()=>{i().reset()};f&&!o.cN&&(i().init(f),i().set_config({debug:o.TQ}));let m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o.cN||u.$e(r=>{r.setExtras(t),l.uT(e),n||h.env.SENTRY_URL||console.warn(e,t)})},y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="string"==typeof e?Error(e):e;console.error(n),u.$e(e=>{e.setExtras(t),l.Tb(n)})},v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{i().track(e,{...t,platform:"webapp"})}catch(n){console.error("error logging to Mixpanel",n),y(n,{function:"logMixpanelEvent",name:e,params:t})}},_=e=>e.toLowerCase().includes("success")||e.toLowerCase().includes("succeeded")||e.toLowerCase().includes("failed"),b=e=>c.CE.includes(e.trim()),w=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((null==t?void 0:t.userId)!=="plugin")try{let n={...t,name:e,platform:"webapp"};if(n=(0,a.sW)(n),_(e)||v(e,n),(0,s.H_)("events",n),e.toLowerCase().includes("fail")){let{error:r="",...i}=t;b(r)||m(e,n)}}catch(e){console.error("error logging",e)}},S=e=>{console.error("Firestore request failed",e),y(e,{function:"logFirestoreRequestError"})},E=(e,t,n)=>{w((0,d.vH)(e,t),(0,a.Fp)(n))}},92287:function(e,t,n){"use strict";n.d(t,{CE:function(){return r}});let r=["We couldn't find English subtitles for this video.","We couldn't find subtitles for this video.","Missing or insufficient permissions.","This text set off our toxicity detector. Try something a little more vanilla","We couldn't find this lesson.","auth/email-already-in-use","auth/popup-closed-by-user","Text analysis is currently only available for English","Roshi only supports English for now","Text is too long. Maximum word count is 100","Text is too long. Maximum word count is 250","Text is too long. Maximum word count is 3000","Sorry but we couldn't manage to load text from this page. It might be blocked or behind a paywall, or it might be a PDF.","Illegal invocation","The internet connection appears to be offline.","Load failed","require is not defined","auth/popup-closed-by-user","Unexpected state","INTERNAL ASSERTION FAILED","INTERNAL UNHANDLED ERROR","Failed to fetch","hard navigate","undefined is not an object","client is offline","already exists","Route did not complete","Could not reach Cloud Firestore backend","zaloJSV2","auth/logInWithEmailAsync__failure","auth/","globalThis is not defined","lessons subscription failed"]},6713:function(e,t,n){"use strict";n.d(t,{Kq:function(){return s},og:function(){return u},vH:function(){return a},wV:function(){return o},xr:function(){return i}});var r=n(92287);let i=e=>"".concat(e,"__start"),o=e=>"".concat(e,"__success"),s=e=>"".concat(e,"__failure"),a=(e,t)=>{switch(t){case"started":return i(e);case"successful":return o(e);case"failed":return s(e);default:return"unknownStatus"}},u=(e,t)=>{let n=t.originalException;if(n&&n.message){for(let e of r.CE)if(n.message.match(RegExp(e,"i")))return null}return e}},33680:function(e,t,n){"use strict";n.d(t,{So:function(){return o},bV:function(){return g},mM:function(){return m},pU:function(){return a},pq:function(){return i},sx:function(){return s}});var r=n(49636);let i=r.TQ||r.rv?{apiKey:"AIzaSyB0KLkpYXhrxZX6FfeNf8W_82p9FVqHf-o",authDomain:"roshi-dev.firebaseapp.com",projectId:"roshi-dev",storageBucket:"roshi-dev.appspot.com",messagingSenderId:"430630546119",appId:"1:430630546119:web:569b7c6d8c81bac1bd2ce2",measurementId:"G-VHKTGFCCQ7"}:{apiKey:"AIzaSyBc1p1_re1CXnzPOAqRV-QPPrjKcs-PYYE",authDomain:"roshi-prod.firebaseapp.com",projectId:"roshi-prod",storageBucket:"roshi-prod.appspot.com",messagingSenderId:"754264780069",appId:"1:754264780069:web:41cf18bd5bf3d33f5c3ecc",measurementId:"G-8WMVRVPTRZ"},o=["organization","admin","pro","premium"],s=[...o,"pro-trial","trial"],a=[...s,"basic"],u=["premium","admin"],l=["pro","trial","pro-trial","organization"],c=["basic","plugin"],d=["anonymous"],h=[...u,...l,...c,...d],f=["anonymousGroup","basicGroup","proGroup","premiumGroup"],p={anonymousGroup:d,basicGroup:c,proGroup:l,premiumGroup:u},g=h.reduce((e,t)=>{let n=f.find(e=>p[e].includes(t));return n&&(e[t]=n),e},{}),m=7},15661:function(e,t,n){"use strict";n.d(t,{lX:function(){return g},mz:function(){return p}});var r=n(32238);/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(0,r.KN)("firebase","9.19.1","app");var i=n(13247),o=n(53059),s=n(86650),a=n(33680),u=n(83640),l=n(49635);let c=null,d=null,h=null,f=null;try{c=(0,r.ZF)(a.pq),d=(0,i.ad)(c),h=(0,s.cF)(c),f=(0,l.v0)(c),u.GE?((0,l.S$)(f,"http://localhost:9099"),(0,i.at)(d,"localhost",8081),(0,s.a1)(h,"localhost",9199)):o.Gb&&c&&(0,o.Gb)().then(e=>{e&&(0,o.IH)(c||void 0)})}catch(e){console.error("Failed to initialize firebase")}let p=d,g=f},19781:function(e,t,n){"use strict";n.d(t,{H_:function(){return m},JB:function(){return k},M:function(){return _},Me:function(){return f},Nq:function(){return v},QZ:function(){return b},VX:function(){return E},bo:function(){return p},xg:function(){return w},zz:function(){return S}});var r=n(15661),i=n(13247),o=n(99846),s=n(17477),a=n(40608),u=n(31514),l=n(49636);let c=async e=>{try{await e}catch(e){(0,o.nc)(e)}};function d(e){return async t=>{try{return await e(t)}catch(e){return(0,o.nc)(e),{success:!1,error:e.message}}}}async function h(e){try{return await e}catch(e){return console.error(e),(0,o.nc)(e),null}}let f=async(e,t)=>{if(!r.mz)return null;try{let n=(0,i.JU)(r.mz,e,t),o=await (0,i.QT)(n);if(o.exists())return o.data();return null}catch(e){return(0,o.nc)(e),null}},p=async(e,t,n)=>{if(!r.mz)return;let o={},s={};for(let[e,t]of Object.entries(n))t===l.GC?s[e]=(0,i.Bt)():o[e]=t;await c((0,i.pl)((0,i.JU)(r.mz,e,t),{...(0,u.Nq)(o),...s,createdAt:(0,i.Bt)(),updatedAt:(0,i.Bt)()}))},g=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,s.MJ)(e,t);await p("users",e,{...n,createdAt:(0,i.Bt)(),updatedAt:(0,i.Bt)()})},m=async(e,t)=>{r.mz&&await c((0,i.ET)((0,i.hJ)(r.mz,e),{...t,createdAt:(0,i.Bt)(),updatedAt:(0,i.Bt)()}))},y=async(e,t,n)=>{if(!r.mz)return;let o=(0,i.JU)(r.mz,e,t),s=await h((0,i.QT)(o));if(!(null==s?void 0:s.exists()))return;let a={},d={};for(let[e,t]of Object.entries(n))t===l.GC?d[e]=(0,i.Bt)():a[e]=t;let f={...(0,u.Nq)(a),...d,updatedAt:(0,i.Bt)()};await c((0,i.r7)((0,i.JU)(r.mz,e,t),f))},v=async(e,t)=>e!==a.xh&&(await y("users",e,t),!0),_=async(e,t)=>{e!==a.xh&&await p("users",e,(0,s.MJ)(e,t))},b=async e=>{if(!e)return[];try{if(!r.mz)return[];let t=(0,i.IO)((0,i.hJ)(r.mz,"users"),(0,i.ar)("teamId","==",e)),n=await (0,i.PL)(t),o=[];return n.forEach(e=>{let t=(0,s.eo)(e.data());o.push(t)}),o}catch(e){return(0,o.Pk)(e),[]}},w=async e=>{let{userId:t,callbackIfUserExists:n,additionalProperties:s={},firebaseUserFirstName:a=""}=e;if(t&&r.mz)try{let e=(0,i.JU)(r.mz,"users",t),o=await (0,i.QT)(e),u={...s},l=a||u.firstName,c=o.data();if((null==c?void 0:c.firstName)||!l||v(t,{firstName:l}),null==o?void 0:o.exists()){null==n||n({...c,id:t,firstName:l});return}await g(t,u)}catch(e){(0,o.nc)(e)}};async function S(e,t,n){return r.mz?{unsubscribe:function(e,t){try{let n=(0,i.cf)(e,e=>{try{t({data:e.data(),error:""})}catch(e){(0,o.Pk)(e)}},e=>{(0,o.Pk)(e),t({data:null,error:e.message})});return()=>{n()}}catch(e){return(0,o.Pk)(e),null}}((0,i.JU)(r.mz,e,t),n),error:""}:{unsubscribe:null,error:""}}let E=d(async e=>{let{collection:t,docId:n,property:o,values:s}=e;return r.mz?(await (0,i.r7)((0,i.JU)(r.mz,t,n),{[o]:(0,i.vr)(...s)}),{success:!0,error:""}):{success:!1,error:"No firestoreDB"}}),k=d(async e=>{let{collection:t,docId:n,property:o,values:s}=e;return r.mz?(await (0,i.r7)((0,i.JU)(r.mz,t,n),{[o]:(0,i.Ab)(...s)}),{success:!0,error:""}):{success:!1,error:"No firestoreDB"}})},40608:function(e,t,n){"use strict";n.d(t,{Xq:function(){return i},xh:function(){return r}});let r="default-web",i={id:"test",email:"",userType:"basic",featureFlags:{}}},62519:function(e,t,n){"use strict";n.d(t,{tl:function(){return J},ZP:function(){return el},dO:function(){return N},cl:function(){return R},c4:function(){return z},rj:function(){return K},av:function(){return V}});var r=n(64514),i=n(31514),o=n(49635),s=n(13247),a=n(15661),u=n(19781),l=n(17477),c=n(99846),d=n(94);let h=new o.hJ,f=async(e,t,n)=>{if(!a.lX)return{user:null,error:"Failed to sign up"};let{user:r}=await (0,o.Xb)(a.lX,e,t),i=(0,l.eQ)(r)||n.firstName||"",s={...n,firstName:i};return await (0,u.M)(r.uid,s),{user:{...(0,l.Zj)(r),...s},error:""}},p=async e=>{let{email:t,password:n,presetProperties:r={}}=e;try{return await f(t,n,r)}catch(e){return console.error("Failed to sign up",e),{user:null,error:null==e?void 0:e.code}}},g=async e=>{let{email:t,password:n}=e;if(!a.lX)return{user:null,error:"Failed to log in"};try{let{user:e}=await (0,o.e5)(a.lX,t,n);return{user:(0,l.Zj)(e),error:""}}catch(e){return console.error("Error logging in",e),{user:null,error:null==e?void 0:e.code}}},m=async(e,t)=>{if(!a.lX)return{user:null,error:"Failed to log in"};let{user:n}=await (0,o.rh)(a.lX,h),r=await (0,u.Me)("users",n.uid);return r?{user:{...(0,l.Zj)(n),userType:(null==r?void 0:r.userType)||"basic"},error:""}:(await (0,u.M)(n.uid,t),{user:{...(0,l.Zj)(n),userType:e},error:""})},y=async e=>{if(!a.lX)return{user:null,error:"Failed to log in"};try{return{user:await (0,u.Me)("users",e),error:""}}catch(e){return console.error("Error refreshing user data",e),{user:null,error:null==e?void 0:e.code}}},v=async e=>{let{presetProperties:t={}}=e;try{return await m("basic",t)}catch(e){return console.error("Failed to authenticate with Google",e),{user:null,error:null==e?void 0:e.code}}},_=async()=>{if(!a.lX)return{error:"Failed to log out"};try{return await (0,o.w7)(a.lX),(0,c.zb)(),{error:""}}catch(e){return console.error("Failed to sign out",e),{error:null==e?void 0:e.code}}},b=async e=>{if(!a.lX)return{email:e,error:"Failed to log in"};try{return await (0,o.LS)(a.lX,e),{error:"",email:e}}catch(t){return console.error("Failed to send password reset email",t),{error:null==t?void 0:t.code,email:e}}},w=async e=>{if(!a.mz)return null;try{let t=(0,s.JU)(a.mz,"organizations",e),n=await (0,s.QT)(t);if(n.exists()){let e=n.data();return{...e,createdAt:(0,d.UG)((null==e?void 0:e.createdAt)||""),updatedAt:(0,d.UG)((null==e?void 0:e.updatedAt)||"")}}return null}catch(t){return console.error("Failed to get team: ",e),console.error(t),null}},S=async e=>{if(!a.mz)return{};let t=(0,s.JU)(a.mz,"accountPresets",e),n=await (0,s.QT)(t);return n.exists()?n.data():{}};var E=n(71842),k=n(6713);let I="auth",T=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{rootState:r,...o}=n,s=(0,k.vH)(e,t),a=(0,i.Fp)({...o,...r?(0,E.Sb)(r):{}});(0,c.Kz)(s,a)},x=(0,r.hg)("".concat(I,"/signUpWithEmailAsync"),async(e,t)=>{let{rejectWithValue:n,getState:r}=t,i=r(),o={};(0,E.$Y)(i)&&(o=await S(e.email.toLowerCase()));let s=await p({...e,presetProperties:{...o,...e.presetProperties}});return s.user?{...s,user:{...s.user,...e.presetProperties,...o}}:n(s)}),C=(0,r.hg)("".concat(I,"/authenticateWithGoogleAsync"),async(e,t)=>{let{rejectWithValue:n}=t,r=await v(e);return r.user?{...r,user:{...r.user,...e.presetProperties}}:n(r)}),A=(0,r.hg)("".concat(I,"/logInWithEmailAsync"),async(e,t)=>{let{rejectWithValue:n}=t,r=await g(e);return r.user?r:n(r)}),O="".concat(I,"/logOutAsync"),N=(0,r.hg)(O,async(e,t)=>{let{rejectWithValue:n}=t,r=await _();return r.error?n(r):r}),R=(0,r.hg)("".concat(I,"/resetPasswordAsync"),async(e,t)=>{let{rejectWithValue:n}=t,r=await b(e);return r.error?n({email:"",error:r.error}):r}),D=(0,r.hg)("lessonEditor/updateUserAsync",async(e,t)=>{let{getState:n,dispatch:r}=t,i=n(),o=(0,E.c7)(i);return(0,E.Qb)(i)?(r(G(e)),await (0,u.Nq)(o,e)):r(ee(e)),!0});(0,r.hg)("lessonEditor/addUserToTeamAsync",async(e,t)=>{let{dispatch:n,getState:r,rejectWithValue:i}=t,o=r(),s=(0,E.c7)(o),a=(0,E.oB)(o),l=(0,E.dt)(o),c=(0,E.k7)(o),d=(0,E.Tz)(o);if(a)return console.error("User already in team"),i({success:!1,error:"User already in team"});if(!s)return console.error("User not found"),i({success:!1,error:"User not found"});if(!l)return console.error("Team not found"),i({success:!1,error:"Team not found"});if((await (0,u.QZ)(l)).length>=c&&!d)return console.error("Team is full"),i({error:"Team is full",success:!1});let h=await n(D({teamId:l,userType:d?"basic":"organization"}));return"fulfilled"===h.meta.requestStatus&&h.payload?{success:!0,error:""}:(console.error("Failed to join team for some reason"),i({error:"Failed to join team",success:!1}))});let P="lessonEditor/attachPromotionAsync",M=(0,r.hg)(P,async(e,t)=>{let{getState:n}=t,r=n(),i=(0,E.c7)(r);return!!i&&(await (0,u.VX)({docId:i,property:"attachedPromotionIds",values:e,collection:"users"}),!0)}),L=(0,r.hg)("lessonEditor/getOrganizationAsync",async e=>await w(e)),U=(0,r.hg)("lessonEditor/getOrganizationMembersAsync",async e=>await (0,u.QZ)(e));(0,r.hg)("lessonEditor/syncUserDataAsync",async(e,t)=>{let{getState:n,dispatch:r}=t,i=n(),o=(0,E.c7)(i);if(!o)return;let{user:s,error:a}=await y(o);s&&r(V((0,l.eo)(s)))}),(0,r.hg)("lessonEditor/removeFromTeamAsync",async(e,t)=>{let{dispatch:n,getState:r}=t,i=await (0,u.Nq)(e,{userType:"basic",teamId:""}),o=(0,E.oB)(r());return await (0,u.JB)({docId:o,property:"adminIds",values:[e],collection:"organizations"}),!!i&&(n(H(e)),!0)});let j=(0,r.oM)({name:"auth",initialState:{errorMessage:"",queryStatus:"not-started",user:null,isInitialized:!1,passwordResetLinkSent:!1,organizationUsers:[],authReferrerPath:"",product:"year",team:null,newUserProperties:{},presetEnabled:!1,promotions:[]},reducers:{setPresetEnabled:(e,t)=>{e.presetEnabled=t.payload},setAuthReferrerPath:(e,t)=>{e.authReferrerPath=t.payload},clearAuthReferrerPath:e=>{e.authReferrerPath=""},setErrorMessage:(e,t)=>{e.errorMessage=t.payload},clearAuthErrors:e=>{e.errorMessage=""},setUser:(e,t)=>{t.payload&&(e.user=t.payload)},updateUserInState:(e,t)=>{e.user&&(e.user=(0,i.Zr)(e.user,t.payload))},clearUser:e=>{e.user=null,e.organizationUsers=[]},incrementUserPropertyInState:(e,t)=>{(0,l.yj)(e,t.payload)},setIsAuthInitialized:(e,t)=>{e.isInitialized=t.payload},setTeamUsers:(e,t)=>{e.organizationUsers=t.payload},removeTeamUser:(e,t)=>{e.organizationUsers=e.organizationUsers.filter(e=>e.id!==t.payload)},upgradeUser:e=>{e.user&&(e.user.userType="pro")},setAuthQueryStatus:(e,t)=>{e.queryStatus=t.payload},setProduct:(e,t)=>{e.product=t.payload},setTeam:(e,t)=>{e.team=t.payload},setNewUserProperties:(e,t)=>{e.newUserProperties=t.payload},addNewUserProperties:(e,t)=>{e.newUserProperties={...e.newUserProperties,...t.payload}},removeNewUserProperties:(e,t)=>{let n=e.newUserProperties;t.payload.forEach(e=>{delete n[e]}),e.newUserProperties=n},setPromotions:(e,t)=>{e.promotions=t.payload.map(i.mN)},addPromotion:(e,t)=>{e.promotions.find(e=>e.id===t.payload.id)||(e.promotions=[...e.promotions,(0,i.mN)(t.payload)])},addPromotions:(e,t)=>{let n=t.payload.filter(t=>!e.promotions.find(e=>e.id===t.id)).map(i.mN);e.promotions=[...e.promotions,...n]},removePromotion:(e,t)=>{e.promotions=e.promotions.filter(e=>e.id!==t.payload.id)},clearPromotions:e=>{e.promotions=[]}},extraReducers:e=>{e.addCase(x.pending,e=>{e.queryStatus="pending"}).addCase(x.rejected,(e,t)=>{var n;e.queryStatus="failed";let r=(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong";e.errorMessage=r}).addCase(x.fulfilled,(e,t)=>{e.queryStatus="successful";let{user:n}=t.payload;n&&(e.user=n,e.errorMessage="",(0,u.Nq)(n.id,n))}).addCase(C.pending,e=>{e.queryStatus="pending"}).addCase(C.rejected,(e,t)=>{var n;e.queryStatus="failed";let r=(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong";e.errorMessage=r}).addCase(C.fulfilled,(e,t)=>{e.queryStatus="successful";let{user:n}=t.payload;n&&(e.user=n,e.errorMessage="",(0,u.Nq)(n.id,n))}).addCase(A.pending,e=>{e.queryStatus="pending"}).addCase(A.rejected,(e,t)=>{var n;e.queryStatus="failed";let r=(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong";e.errorMessage=r}).addCase(A.fulfilled,(e,t)=>{e.queryStatus="successful";let{user:n}=t.payload;e.user=n,e.errorMessage=""}).addCase(N.pending,e=>{T(O,"started"),e.queryStatus="pending"}).addCase(N.rejected,(e,t)=>{var n;e.queryStatus="failed";let r=(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong";e.errorMessage=r}).addCase(N.fulfilled,(e,t)=>{e.queryStatus="successful",e.user,e.user=null,e.errorMessage=""}).addCase(R.pending,e=>{e.queryStatus="pending"}).addCase(R.rejected,(e,t)=>{var n;e.queryStatus="failed";let r=(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong";e.errorMessage=r}).addCase(R.fulfilled,(e,t)=>{e.queryStatus="successful",t.payload.email,e.passwordResetLinkSent=!0,e.user=null,e.errorMessage=""}).addCase(L.pending,e=>{e.queryStatus="pending"}).addCase(L.rejected,(e,t)=>{e.queryStatus="failed"}).addCase(L.fulfilled,(e,t)=>{e.queryStatus="successful",e.team=t.payload}).addCase(U.pending,e=>{e.queryStatus="pending"}).addCase(U.rejected,(e,t)=>{e.queryStatus="failed"}).addCase(U.fulfilled,(e,t)=>{e.queryStatus="successful",e.organizationUsers=t.payload}).addCase(M.pending,(e,t)=>{(0,c.AF)(P,"started",t),e.queryStatus="pending";let{user:n,newUserProperties:r}=e;if(!n){r.attachedPromotionIds=(0,i.Ho)(r.attachedPromotionIds||[],t.meta.arg);return}n.attachedPromotionIds=(0,i.Ho)(n.attachedPromotionIds||[],t.meta.arg)}).addCase(M.rejected,(e,t)=>{(0,c.AF)(P,"failed",t),e.queryStatus="failed"}).addCase(M.fulfilled,(e,t)=>{(0,c.AF)(P,"successful",t),e.queryStatus="successful"})}}),{setErrorMessage:q,clearAuthErrors:F,clearUser:$,setIsAuthInitialized:B,setAuthQueryStatus:z,setUser:V,updateUserInState:G,setTeamUsers:W,removeTeamUser:H,setAuthReferrerPath:K,clearAuthReferrerPath:J,incrementUserPropertyInState:X,upgradeUser:Q,setProduct:Z,setTeam:Y,setNewUserProperties:ee,addNewUserProperties:et,removeNewUserProperties:en,setPresetEnabled:er,setPromotions:ei,addPromotion:eo,removePromotion:es,addPromotions:ea,clearPromotions:eu}=j.actions;var el=j.reducer},71842:function(e,t,n){"use strict";n.d(t,{T$:function(){return f},rP:function(){return T},Sb:function(){return F},bB:function(){return N},To:function(){return p},vN:function(){return _},bA:function(){return b},Qb:function(){return S},UK:function(){return A},Tz:function(){return O},LN:function(){return w},n2:function(){return U},k7:function(){return B},dt:function(){return h},en:function(){return k},$Y:function(){return c},oB:function(){return I},Dw:function(){return es},vm:function(){return $},oD:function(){return eo},dy:function(){return m},W2:function(){return R},c7:function(){return v},$m:function(){return q},W$:function(){return y}});var r=n(19119);n(83640);var i=n(33680),o=n(40608),s=n(17477);let a={month:"price_1OX7ALBeCjjtfimPgqx0aDWl",year:"price_1MaWdzBeCjjtfimPbqQkvW4l",LEGACY_month:n(83454).env.NEXT_PUBLIC_LEGACY_MONTHLY_PRICE_ID||""},u=e=>e.includes("promo_");var l=n(49636);let c=e=>e.auth.presetEnabled,d=e=>e.auth.team,h=e=>{var t;return(null===(t=e.auth.team)||void 0===t?void 0:t.id)||""},f=e=>e.auth.errorMessage,p=(0,r.P1)(e=>e.auth.queryStatus,e=>"pending"===e);(0,r.P1)(p,e=>!e);let g=e=>{var t;return(null===(t=e.auth.user)||void 0===t?void 0:t.email)||""},m=e=>e.auth.user,y=e=>{let{user:t}=e.auth;return(null==t?void 0:t.userType)||"anonymous"},v=(0,r.P1)(m,e=>(null==e?void 0:e.id)||o.xh),_=(0,r.P1)(m,e=>!!e),b=(0,r.P1)(y,e=>"basic"===e);(0,r.P1)(y,e=>i.So.includes(e)),(0,r.P1)(y,e=>"pro"===e);let w=(0,r.P1)(y,e=>i.sx.includes(e));(0,r.P1)(y,e=>i.pU.includes(e)),(0,r.P1)(y,e=>"organization"===e);let S=(0,r.P1)(m,e=>!!e),E=(0,r.P1)(S,w,(e,t)=>e&&!t);(0,r.P1)(y,e=>"trial"===e);let k=e=>e.auth.passwordResetLinkSent,I=e=>{var t;return(null===(t=e.auth.user)||void 0===t?void 0:t.teamId)||""},T=e=>e.auth.authReferrerPath;(0,r.P1)(T,e=>!!e);let x=(0,r.P1)(e=>e.auth.organizationUsers,e=>e.filter(e=>"basic"!==e.userType));(0,r.P1)(x,e=>e.length);let C=e=>{var t;return(null===(t=e.auth.team)||void 0===t?void 0:t.basicAdminEmails)||null},A=(0,r.P1)(e=>{var t;return(null===(t=e.auth.team)||void 0===t?void 0:t.adminIds)||null},e=>{var t;return(null===(t=e.auth.team)||void 0===t?void 0:t.adminEmails)||null},C,v,g,(e,t,n,r,i)=>(null==e?void 0:e.includes(r))||(null==t?void 0:t.includes(i))||(null==n?void 0:n.includes(i))||!1),O=(0,r.P1)(C,v,g,(e,t,n)=>(null==e?void 0:e.includes(n))||!1),N=(0,r.P1)(p,S,(e,t)=>!e&&!t),R=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(0,r.P1)(m,r=>(0,s.$y)(r,e)||t||(0,s.by)(r,n))},D=(0,r.P1)(m,e=>(null==e?void 0:e.customerId)||""),P=(0,r.P1)(y,e=>"trial"===e),M=e=>e.auth.product,L=(0,r.P1)(M,e=>a[e]),U=(0,r.P1)(w,g,(e,t)=>e&&t.endsWith("@ubc.ca")),j=(0,r.P1)(m,e=>{let t=(0,s.Ce)([]);return(0,s.by)(e,[t])?"pro":(null==e?void 0:e.userType)||"anonymous"}),q=(0,r.zB)({userId:v,userType:j});(0,r.P1)(m,e=>(0,s.by)(e,[]));let F=(0,r.P1)(m,e=>e||{}),$=(0,r.P1)(m,e=>e?(0,s.uZ)(e):0),B=(0,r.P1)(d,e=>(null==e?void 0:e.maxSeats)||0),z=(0,r.P1)(m,e=>!!(null==e?void 0:e.hasPaymentInfo)),V=(0,r.P1)(m,e=>!!(null==e?void 0:e.trialStartedAt)),G=(0,r.P1)(m,e=>!!(null==e?void 0:e.trialStart)),W=(0,r.P1)(V,G,(e,t)=>e||t),H=(0,r.P1)(m,e=>(null==e?void 0:e.subscriptionId)||""),K=(0,r.P1)(m,e=>(null==e?void 0:e.subscriptionPriceId)||""),J=(0,r.P1)(e=>e.auth.promotions||l.LZ,e=>[...e].sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime())),X=(0,r.P1)(J,S,b,K,(e,t,n,r)=>e.length?e.filter(e=>{let{active:i,priceId:o}=e;return!!i&&o!==r&&!!t&&(!!n||!!K)}):null),Q=(0,r.P1)(X,e=>(null==e?void 0:e[0])||null),Z=(0,r.P1)(Q,e=>!!e&&!!e.trialDays&&"unrestricted"===e.eligibility),Y=(0,r.P1)(Q,W,Z,(e,t,n)=>{if(!e)return!1;let{trialDays:r,ccSkipEnabled:i}=e;return!!r&&!!i&&(n||!t)}),ee=(0,r.P1)(L,Q,(e,t)=>{if(!t)return"";let{priceId:n,id:r,stripeId:i}=t;return e!==n?"":u(r)?r:i||""});(0,r.P1)(Q,e=>{if(!e)return!0;let{paymentMethodRequired:t=!0}=e;return t});let et=(0,r.P1)(Q,e=>(null==e?void 0:e.trialDays)||i.mM),en=(0,r.P1)(Z,S,E,W,(e,t,n,r)=>!!t&&!!n&&(!!e||!r));(0,r.P1)(D,v,M,en,Y,et,ee,g,e=>{var t;return(null===(t=e.auth.user)||void 0===t?void 0:t.firstName)||""},(e,t,n,r,i,o,s,a,u)=>({customerId:e,userId:t,product:n,trialEnabled:r,paymentMethodRequired:!i,trialDays:o,promoCode:s,email:a,name:u})),(0,r.P1)(D,e=>!!e);let er=(0,r.P1)(P,z,(e,t)=>e&&!t),ei=(0,r.P1)(e=>{var t;return(null===(t=e.auth.user)||void 0===t?void 0:t.attachedPromotionIds)||null},e=>!!(null==e?void 0:e.length));(0,r.P1)(er,ei,(e,t)=>e?t?"Add payment method to claim discount":"Add Payment Method":"Manage Subscription");let eo=(0,r.P1)(en,e=>e?"Try Pro for Free":"Upgrade"),es=(0,r.P1)(d,e=>(null==e?void 0:e.name)||"");(0,r.P1)(H,e=>!!e)},17477:function(e,t,n){"use strict";n.d(t,{$y:function(){return c},Ce:function(){return f},MJ:function(){return u},Zj:function(){return s},by:function(){return d},eQ:function(){return h},eo:function(){return a},uZ:function(){return p},yj:function(){return l}}),n(33680);var r=n(94),i=n(49636);let o=e=>{if(!("userType"in e))return"basic";let{userType:t="basic",email:n}=e;return i.TQ&&"pro@test.com"===n?"pro":t},s=e=>({id:e.uid,email:e.email||"",userType:o(e),teamId:"",featureFlags:{}}),a=e=>({id:(null==e?void 0:e.id)||"",email:(null==e?void 0:e.email)||"",userType:o(e),teamId:(null==e?void 0:e.teamId)||"",monthlyLessonGenerationCount:(null==e?void 0:e.monthlyLessonGenerationCount)||0,monthlyUnitGenerationCount:(null==e?void 0:e.monthlyUnitGenerationCount)||0,featureFlags:(null==e?void 0:e.featureFlags)||{},customerId:(null==e?void 0:e.customerId)||"",tags:(null==e?void 0:e.tags)||[],firstName:(null==e?void 0:e.firstName)||"",trialStart:(0,r.UG)((null==e?void 0:e.trialStart)||""),trialEnd:(0,r.UG)((null==e?void 0:e.trialEnd)||""),trialStartedAt:(0,r.UG)((null==e?void 0:e.trialStartedAt)||""),subscriptionPriceId:(null==e?void 0:e.subscriptionPriceId)||"",subscriptionId:(null==e?void 0:e.subscriptionId)||"",hasPaymentInfo:(null==e?void 0:e.hasPaymentInfo)||!1,attachedPromotionIds:(null==e?void 0:e.attachedPromotionIds)||[],lessonGenerationCount:(null==e?void 0:e.lessonGenerationCount)||0,unitGenerationCount:(null==e?void 0:e.lessonGenerationCount)||0,createdAt:(0,r.UG)((null==e?void 0:e.createdAt)||""),updatedAt:(0,r.UG)((null==e?void 0:e.updatedAt)||"")}),u=(e,t)=>({id:e,email:"",monthlyLessonGenerationCount:0,monthlyUnitGenerationCount:0,userType:"basic",featureFlags:{},teamId:"",lessonGenerationCount:0,unitGenerationCount:0,tags:[],attachedPromotionIds:[],...t}),l=(e,t)=>{if(!e.user)return;let n=e.user[t]||0;n&&"number"!=typeof n||(e.user={...e.user,[t]:(n||0)+1})},c=(e,t)=>{var n;return(null==e?void 0:null===(n=e.featureFlags)||void 0===n?void 0:n[t])||!1},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return 0!==t.length&&t.some(t=>t(e))},h=e=>{var t;return(null==e?void 0:null===(t=e.displayName)||void 0===t?void 0:t.split(" ")[0])||""},f=e=>t=>e.some(e=>{var n;return(null==t?void 0:null===(n=t.tags)||void 0===n?void 0:n.includes(e))||!1}),p=e=>{let{trialEnd:t}=e;return t?Math.ceil(Math.max(0,(new Date(t.toString()).getTime()-new Date().getTime())/864e5)):0}},53650:function(e,t,n){"use strict";n.d(t,{Mn:function(){return i},QH:function(){return s},fC:function(){return r},rS:function(){return o}});let r={anonymousGroup:100,basicGroup:500,proGroup:3e3,premiumGroup:1e4},i=["summary","easy-summary","vocabulary","sentence-split","active-voice"],o=6e4,s="B2"},84179:function(e,t,n){"use strict";n.d(t,{AE:function(){return s},P2:function(){return i},zS:function(){return o}});var r=n(40608);let i={"Avg. Sentence Length":26.3,"CEFR Level":"C1","CLB Level":"10-11","Difficult Word Count":8,"Difficult Words":["periodically","ridley","loggerhead"],Difficulty:"Fairly Difficult","Flesh Reading Ease":53.24,"Grade Level":"Grade 10-12","Gunning Fog Index":14.57},o={"Avg. Sentence Length":17.7,"CEFR Level":"A2","CLB Level":"3-4","Difficult Words":["ridley","loggerhead"],"Difficult Word Count":2,Difficulty:"Easy","Flesh Reading Ease":87.35,"Grade Level":"Grade 6","Gunning Fog Index":8.59},s={error:"",text_stats:i,userId:r.xh};r.xh,r.xh},60943:function(e,t,n){"use strict";n.d(t,{ZP:function(){return I},hv:function(){return E}});var r=n(64514),i=n(99846),o=n(49636),s=n(31514),a=n(83640);let u={id:"1",type:"article",url:"https://toronto.ctvnews.ca/young-scouts-stuck-in-zurich-after-missing-air-canada-flight-to-toronto-1.5990547",text:"",title:"Explore Item",snippet:"",dateCreated:"",sourceName:"Toronto CTV News",textStats:{},thumbnailUrl:""},l=[u,u,u,u,u,u,u,u,u,u,u];var c=n(25019);let d=async e=>{let{}=e;return await (0,c.l_)({input:{},endpoint:"explore",failureResponse:{items:[],error:"Failed to retrieve articles"},method:"GET"})},h=async()=>(await (0,s.Dc)(o.uR),{error:"",items:l}),f=async e=>{if(a.xR)return h();try{return await d(e)}catch(e){return console.error("Failed to get Explore Items"),{error:"Failed to get News Articles",items:[]}}},p={errorMessage:"",requestStatus:"not-started",searchText:"",items:[],lessonView:"start"},g=(0,r.hg)("search/getExploreItems",async(e,t)=>{let{rejectWithValue:n}=t,r=await f(e);return r.items.length?r:n(r)}),m=(e,t)=>e,y=(0,r.oM)({name:"explore",initialState:p,reducers:{setExploreErrorMessage:(e,t)=>{e.errorMessage=t.payload},clearExploreErrorMessage:(e,t)=>{e.errorMessage=""},setExploreSearchText:(e,t)=>{e.errorMessage=t.payload},clearExploreSearchText:(e,t)=>{e.errorMessage=""},setLessonView:(e,t)=>{e.lessonView=t.payload},returnToLessonHome:e=>{e.lessonView="start"},resetExploreState:()=>p},extraReducers:e=>{e.addCase(g.pending,e=>{(0,i.Kz)("getExploreItemsAsyncStarted",{...m(e,{})}),e.requestStatus="pending"}).addCase(g.rejected,(e,t)=>{var n,r;e.requestStatus="failed",e.errorMessage=(null===(n=t.payload)||void 0===n?void 0:n.error)||"Failed to get items",(0,i.Kz)("getExploreItemsFailed",{...m(e,{}),error:null===(r=t.payload)||void 0===r?void 0:r.error})}).addCase(g.fulfilled,(e,t)=>{e.requestStatus="successful",e.items=t.payload.items,(0,i.Kz)("getExploreItemsSucceeded")})}}),{setExploreErrorMessage:v,clearExploreErrorMessage:_,resetExploreState:b,setExploreSearchText:w,clearExploreSearchText:S,setLessonView:E,returnToLessonHome:k}=y.actions;var I=y.reducer},49636:function(e,t,n){"use strict";n.d(t,{GC:function(){return b},KF:function(){return g},LB:function(){return a},LZ:function(){return w},N$:function(){return h},Qg:function(){return l},Qm:function(){return _},TQ:function(){return r},XK:function(){return i},bV:function(){return y},cN:function(){return c},dd:function(){return m},ex:function(){return s},k8:function(){return f},l3:function(){return u},mU:function(){return d},pi:function(){return v},rv:function(){return o},uR:function(){return p}});let r=!1,i=!0,o=!1,s=!0,a="https://www.roshi-server.com",u="/api",l=!0,c=!1,d="https://roshi.freshdesk.com/support/tickets/new",h="https://twitter.com/LearnWithRoshi",f={en:"English",fr:"French",es:"Spanish",ja:"Japanese",zh:"Chinese",de:"German",it:"Italian",ko:"Korean",pt:"Portuguese",ru:"Russian",id:"Indonesian",bg:"Bulgarian",cs:"Czech",da:"Danish",el:"Greek",et:"Estonian",fi:"Finnish",hu:"Hungarian",lt:"Lithuanian",lv:"Latvian",nb:"Norwegian",nl:"Dutch",pl:"Polish",ro:"Romanian",sk:"Slovak",sl:"Slovenian",sv:"Swedish",tr:"Turkish",uk:"Ukrainian",ar:"Arabic",hi:"Hindi",ms:"Malay",th:"Thai",vi:"Vietnamese"},p=2e3;void 0!==window.document&&void 0!==window.document.createElement&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);let g=1e3,m="Something went wrong",y="</END OF STREAM UPDATE>",v=100,_=10,b="SERVER_TIMESTAMP_PLACEHOLDER",w=[]},25019:function(e,t,n){"use strict";n.d(t,{$w:function(){return f},MU:function(){return p},UL:function(){return w},a_:function(){return m},l_:function(){return d},sg:function(){return b}});var r=n(99846),i=n(49636),o=n(31514),s=n(50711),a=n(83640);let u=async e=>await e.json();async function l(e,t,n){try{return await e}catch(i){let e;if(i instanceof Response){let{status:t,statusText:r,headers:o}=i,s=await i.text();e=Error("HTTP error! status: ".concat(t," ").concat(r)),n={...n,status:t,statusText:r,headers:[...o],errorText:s}}else e=i;return(0,r.Pk)(e,n),t}}async function c(e){let t={method:"POST",body:JSON.stringify(e)};try{var n;let o=await fetch("".concat(i.l3,"/pseudo_stream_proxy"),t),s=null===(n=o.body)||void 0===n?void 0:n.getReader(),a=[];if(!s)return(0,r.Pk)(Error("Stream body is not readable")),e.failureResponse;{for(;;){let{done:e,value:t}=await s.read();if(e)break;a.push(t)}let t=new TextDecoder().decode(new Uint8Array(a.reduce((e,t)=>e.concat(Array.from(t)),[])));try{return JSON.parse(t)}catch(n){return(0,r.Ff)("Failed to parse streaming response",{responseString:t,input:JSON.stringify((null==e?void 0:e.input)||{}),endpoint:null==e?void 0:e.endpoint}),(0,r.Pk)(n,{options:e,requestType:"stream",responseString:t}),e.failureResponse}}}catch(t){return(0,r.Pk)(t,{options:e,requestType:"stream"}),e.failureResponse}}async function d(e){let{endpoint:t,method:n="POST",input:r,failureResponse:o}=e,s={credentials:"same-origin",headers:{"Content-Type":"application/json"},method:n};return"GET"!==n&&(s={...s,body:JSON.stringify(r)}),l(fetch("".concat(i.l3,"/").concat(t),s).then(u),o,{...s,url:"".concat(i.l3,"/").concat(t)})}async function h(e){let{endpoint:t,method:n="POST",input:r,failureResponse:o}=e,s={credentials:"include",headers:{"Content-Type":"application/json"},method:n};return"GET"!==n&&(s={...s,body:JSON.stringify(r)}),l(fetch("".concat(i.LB,"/").concat(t),s).then(u),o,{...s,url:"".concat(i.LB,"/").concat(t)})}async function f(e){let{endpoint:t,method:n="POST",input:r,failureResponse:o}=e,s=new FormData;for(let e in r)s.append(e,r[e]);let a={credentials:"include",method:n,body:s};return l(fetch("".concat(i.LB,"/").concat(t),a).then(u),o,{...a,url:"".concat(i.LB,"/").concat(t)})}async function p(e){let t=await h(e);return(0,o.LN)(t,e.failureResponse)?t:t=await d(e)}async function g(e){let{endpoint:t,method:n="POST",input:r}=e,o=0,a=s.qW;return(null==r?void 0:r.sourceType)==="youtube"&&(a=s.oY),new ReadableStream({start(e){let t=setInterval(()=>{let n=(o+=i.Qm)>=a.length,r=JSON.stringify({modifiedText:a.substring(0,o),status:n?"successful":"pending",message:"",warning:"",error:""})+i.bV,s=new TextEncoder().encode(r);e.enqueue(s),n&&(e.close(),clearInterval(t))},i.pi)}}).pipeThrough(new TextDecoderStream).getReader()}async function m(e){let t=await p(e);return(0,o.LN)(t,e.failureResponse)?t:t=await c(e)}async function y(e){let{endpoint:t,method:n="POST",input:r}=e,o=await fetch("".concat(i.LB,"/").concat(t),{method:n,body:JSON.stringify(r),headers:{"Content-Type":"application/json"}});if(!o.ok||!o.body)throw Error("HTTP error! status: ".concat(o.status));return o.body.pipeThrough(new TextDecoderStream).getReader()}async function v(e){let{endpoint:t,method:n="POST",input:r}=e,o=await fetch("".concat(i.l3,"/stream_proxy"),{method:"POST",body:JSON.stringify({endpoint:t,method:n,input:r}),headers:{"Content-Type":"application/json"}});if(!o.ok||!o.body)throw Error("HTTP error! status: ".concat(o.status));let s=o.body.pipeThrough(new TextDecoderStream).getReader();if(!s)throw Error("Unable to create reader for stream");return s}async function _(e,t){let{onDataReceived:n,onError:o}=t,s="";if(e)for(;;){let{value:t,done:a}=await e.read().catch(e=>{null==o||o(e),(0,r.Pk)(e,{function:"handleStream"})});if(a)break;let u=(s+=t).split(i.bV);for(;u.length>1;){let e=u.shift();try{let t=JSON.parse(e||"{");n(t)}catch(e){o(e),(0,r.Pk)(e,{requestType:"stream-with-update"})}}s=u[0]}}async function b(e){let t=new AbortController,n=t.signal,{endpoint:o,method:s="POST",input:a,onDataReceived:u,onError:l}=e;try{let t=await fetch("".concat(i.LB,"/").concat(o),{method:s,body:JSON.stringify(a),headers:{"Content-Type":"application/json"},signal:n});if(!t.ok||!t.body)throw null==l||l(t),Error("HTTP error! status: ".concat(t.status));let c=t.body.pipeThrough(new TextDecoderStream).getReader(),d="";if(!c)return()=>{};for(;;){let{value:t,done:n}=await c.read();if(n)break;let o=(d+=t).split(i.bV);for(;o.length>1;){let t=o.shift();try{let e=JSON.parse(t||"{}");u(e)}catch(t){null==l||l(t),(0,r.Pk)(t,{options:e,requestType:"stream-with-update"})}}d=o[0]}}catch(t){(0,r.Pk)(t,{options:e,requestType:"stream-with-update"}),null==l||l(t)}return()=>{t.abort()}}async function w(e){let t=new AbortController;t.signal;let{endpoint:n,method:i="POST",input:o,onDataReceived:s,onError:u}=e;try{let t=null;if(a.xR)t=await g({endpoint:n,method:i,input:o});else{try{t=await v({endpoint:n,method:i,input:o})}catch(t){(0,r.Pk)(t,{options:e,requestType:"edge-stream-with-update"})}t||(t=await y({endpoint:n,method:i,input:o}))}await _(t,{onDataReceived:s,onError:u})}catch(t){(0,r.Pk)(t,{options:e,requestType:"cors-stream-with-update"}),null==u||u(t)}return()=>{t.abort()}}},31514:function(e,t,n){"use strict";n.d(t,{Dc:function(){return m},Fp:function(){return T},Ho:function(){return N},Ht:function(){return f},Ie:function(){return v},KS:function(){return E},LN:function(){return A},Nq:function(){return O},Ox:function(){return k},Qj:function(){return x},Qr:function(){return b},Sy:function(){return S},Zr:function(){return g},ez:function(){return w},mN:function(){return D},sW:function(){return p},uO:function(){return U},vl:function(){return y},vr:function(){return _}});var r=n(35937),i=n.n(r),o=n(6557),s=n.n(o),a=n(74444),u=n(96486),l=n.n(u),c=n(49636),d=n(36850),h=n.n(d);let f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return h()(e)},p=e=>i()(e,s());function g(e,t){let n={...e};return Object.keys(t).forEach(e=>{t[e]&&(n[e]=t[e])}),n}let m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise(t=>setTimeout(t,e))},y=()=>{var e;return new Proxy(new URLSearchParams(null===(e=window)||void 0===e?void 0:e.location.search),{get:(e,t)=>e.get(t)})},v=()=>{c.Qg&&window.history.replaceState(null,"",window.location.pathname)},_=e=>{c.Qg&&window.history.replaceState(null,"",window.location.pathname+"?".concat(e))},b=e=>!e||!Object.keys(e).length,w=e=>!b(e);function S(e){return[...e].sort(()=>.5-Math.random())}function E(e,t){return S(e).slice(0,t)}let k=e=>{let t=(0,a.k$)();return e?t.slice(0,e):t},I=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(t){return e.toString()}},T=e=>{let t={};for(let n in e){let r=e[n];void 0!==r&&(t[n]=I(r))}return t},x=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(null==e?void 0:e.message)||(null==e?void 0:e.code)||t},C=(e,t)=>l().isEqual(e,t),A=(e,t)=>!C(e,t);function O(e){return Object.fromEntries(Object.entries(e).filter(e=>{let[t,n]=e;return void 0!==n}))}let N=(e,t)=>l().uniq([...e,...t]),R=e=>{if(e)return e.seconds};function D(e){for(let t of["createdAt","updatedAt"])e[t]&&(e[t]=R(e[t]));return e}let P=(e,t)=>{let n=new Date(e);return Math.abs((new Date(t).getTime()-n.getTime())/1e3)},M=(e,t,n)=>P(e,t)>=n,L=(e,t)=>M(e,new Date().toISOString(),t),U=(e,t)=>!L(e,t)},42122:function(e,t,n){"use strict";n.d(t,{Z:function(){return h},D:function(){return d}});var r=n(85893),i=n(61759),o=n(9669),s=n(87462),a=n(71387);function u(e){return String(parseFloat(e)).length===String(e).length}function l(e){return parseFloat(e)}var c=n(53042);let d=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{breakpoints:r=["sm","md","lg"],disableAlign:i=!1,factor:o=2,variants:c=["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","caption","button","overline"]}=n,d=(0,s.Z)({},e);d.typography=(0,s.Z)({},d.typography);let h=d.typography,f=(t=h.htmlFontSize,(e,n)=>{let r=String(e).match(/[\d.\-+]*\s*(.*)/)[1]||"";if(r===n)return e;let i=l(e);"px"!==r&&("em"===r?i=l(e)*l(t):"rem"===r&&(i=l(e)*l(t)));let o=i;if("px"!==n){if("em"===n)o=i/l(t);else{if("rem"!==n)return e;o=i/l(t)}}return parseFloat(o.toFixed(5))+n}),p=r.map(e=>d.breakpoints.values[e]);return c.forEach(e=>{let t=h[e],n=parseFloat(f(t.fontSize,"rem"));if(n<=1)return;let{lineHeight:r}=t;if(!u(r)&&!i)throw Error((0,a.Z)(6));u(r)||(r=parseFloat(f(r,"rem"))/parseFloat(n));let l=null;i||(l=e=>(function(e){let{size:t,grid:n}=e,r=t-t%n,i=r+n;return t-r<i-t?r:i})({size:e,grid:function(e){let{lineHeight:t,pixels:n,htmlFontSize:r}=e;return n/(t*r)}({pixels:4,lineHeight:r,htmlFontSize:h.htmlFontSize})})),h[e]=(0,s.Z)({},t,function(e){let{cssProperty:t,min:n,max:r,unit:i="rem",breakpoints:o=[600,900,1200],transform:s=null}=e,a={[t]:"".concat(n).concat(i)},u=(r-n)/o[o.length-1];return o.forEach(e=>{let r=n+u*e;null!==s&&(r=s(r)),a["@media (min-width:".concat(e,"px)")]={[t]:"".concat(Math.round(1e4*r)/1e4).concat(i)}}),a}({cssProperty:"fontSize",min:1+(n-1)/o,max:n,unit:"rem",breakpoints:p,transform:l}))}),d}((0,o.Z)({palette:{primary:{main:"#3f51b5"},success:{contrastText:"#fff",main:i.Z[500]}},typography:{fontFamily:'Roboto Condensed,-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"'}}));var h=e=>{let{children:t}=e;return(0,r.jsx)(c.Z,{theme:d,children:t})}},15384:function(e,t,n){"use strict";n.d(t,{E9:function(){return s},EG:function(){return v},Ec:function(){return d},GA:function(){return f},MK:function(){return a},Nu:function(){return g},Qw:function(){return b},TC:function(){return h},To:function(){return o},Ve:function(){return u},gA:function(){return l},gJ:function(){return c},jB:function(){return _},kT:function(){return i},qm:function(){return y},vC:function(){return m},w9:function(){return p}});var r=n(49636);let i="{_$$_}",o={anonymousGroup:3,basicGroup:3,proGroup:5,premiumGroup:100},s={anonymousGroup:3,basicGroup:10,proGroup:100,premiumGroup:100},a=["vocabulary"];["fr","es","ja","zh","de","it","ko","pt","ru","ar","hi","id","ms","th","vi","bg","cs","da","el","et","fi","hu","lt","lv","nb","nl","pl","ro","sk","sl","sv","tr","uk"].sort((e,t)=>r.k8[e].localeCompare(r.k8[t])),"".concat(3,"-").concat(4);let u="B1",l="cefr",c={anonymousGroup:1,basicGroup:3,proGroup:7,premiumGroup:100},d="lessonTasks",h="unitTasks",f="lessonUpdateTasks",p="templateTasks",g="lessons",m="lesson_id",y=5,v="key words",_="alloy",b={titleFontSize:"large",headerFontSize:"medium"}},50711:function(e,t,n){"use strict";n.d(t,{qW:function(){return x},oY:function(){return T},$e:function(){return k},gg:function(){return I},Tm:function(){return E},I8:function(){return _},m7:function(){return S}});var r=n(84179),i=n(50135),o=n(15384),s=n(94);n(75526);var a=n(49636),u=n(31514);let l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{...i.P5,...e,id:(0,u.Ox)()}},c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{...i.d9,...e,id:(0,u.Ox)()}},d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{...i.Qq,...e,id:(0,u.Ox)()}},h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{...i.Tq,...e,id:(0,u.Ox)()}},f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{...i.wK,...e,id:(0,u.Ox)()}},p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e){case"multiple-choice":default:return l(t);case"cloze":return d(t);case"multi-select":return c(t);case"open-ended":return h(t);case"task":return f(t)}};var g=n(97573);let m={medium:"text",url:"",title:"",textVersions:[{id:"original",title:"original",text:"This is the original version",description:"",textStats:r.P2,audioUrl:"",markdown:""},{id:"simplified",title:"simplified",text:"This is the simplified version",description:"",textStats:r.zS,audioUrl:"",markdown:""}]},y={createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},v={id:"mock-text-unit",title:"Text Unit",type:"text",versions:m.textVersions,selectedVersionId:m.textVersions[0].id,sourceUrl:m.url,...y,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),hideText:!1},_={id:"",title:"",text:"",description:"",textStats:{},markdown:"",audioUrl:""},b={id:"mock-vocabulary-unit",title:"Vocabulary Unit",type:"vocabulary",vocabularyItems:[{definition:"The parent company of Facebook",id:"00e3e1c6-6461-11ed-9d51-acde48001122",term:"Meta",audioUrl:""},{definition:"To stop employing someone",id:"00e3e39c-6461-11ed-9d51-acde48001122",term:"lay off",audioUrl:""},{definition:"All the people employed by a particular company or organization",id:"00e3e400-6461-11ed-9d51-acde48001122",term:"workforce",audioUrl:""},{definition:"An enhanced version of reality created by the use of technology to overlay digital information on an image of something being viewed through a device",id:"00e3e43c-6461-11ed-9d51-acde48001122",term:"augmented reality",audioUrl:""}],shuffledDefinitionsOrder:[],shuffledTermsOrder:[],...y},w={id:"mock-activity-unit-1",title:"Activity Unit 1",type:"activity",content:"\n<ol>\n    <li>What is the main idea of the text?</li>\n    <li>What is the author's opinion on the topic?</li>\n    <li>What is the author's purpose in writing this text?</li>\n</ol>\n",...y};({questions:[i.P5],...y});let S={id:"",title:"Mock Lesson",description:"This is a mock lesson",authorId:"anon",visibility:"team",teamId:"",targetLevel:"B1",units:[v,b,w],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},E={id:"",title:"",description:"",targetLevel:"",authorId:"",visibility:"private",teamId:"",units:a.LZ,createdAt:"",updatedAt:"",saveKey:"",h5pSaveKey:"",showH5pUrl:!1,h5pUrl:""},k="ADJUST_LEVEL".concat(o.kT,"A1"),I={text:"",html:"",markdown:""},T="\nClimate change is a real and serious issue that has been caused by human activities. Since the Industrial Revolution, humans have increased their consumption of natural resources and released more greenhouse gases into the atmosphere. This has caused the Earth's temperature to increase abruptly, with 10 out of the last 13 years being the warmest on record. The increased temperature has had a number of consequences, including ocean acidification, rising sea levels, and more extreme weather events. \n\nOcean acidification is a direct result of increased dissolved CO2, and has increased by 30% since the late 18th century. This higher acid content puts calcifying species like oysters and clams at risk, and puts the entire ocean food web in danger. Sea levels have also risen, with six point seven inches in the last century and a rate that has nearly doubled in the last decade. This is due to the ocean swelling as it gets warmer, as well as the melting of glaciers and ice sheets. \n\nAlthough the consequences of climate change can be planet-threatening, there are still things we can do on a personal level to help. We can recycle and reuse things, use public transportation, turn off electronics when not in use, eat less meat and more locally grown vegetables, and spread knowledge and concerns about climate change. By doing these things, we can be part of the solution to climate change.\n".trim();p("multiple-choice",{prompt:(0,g.Xt)("What has caused the Earth's temperature to increase abruptly?"),choices:[(0,g.Xt)("A decrease in greenhouse gas emissions"),(0,g.Xt)("Decreased consumption of natural resources"),(0,g.Xt)("Human activities and increased greenhouse gas emissions")],correctChoiceId:"Human activities and increased greenhouse gas emissions"}),p("multiple-choice",{prompt:(0,g.Xt)("What is a consequence of ocean acidification?"),choices:[(0,g.Xt)("It lowers sea levels"),(0,g.Xt)("It puts calcifying species like oysters and clams at risk"),(0,g.Xt)("It causes a decrease in dissolved CO2")],correctChoiceId:"It puts calcifying species like oysters and clams at risk"}),p("multiple-choice",{prompt:(0,g.Xt)("What is one way we can help combat climate change on a personal level?"),choices:[(0,g.Xt)("Use more electronics"),(0,g.Xt)("Increase meat consumption"),(0,g.Xt)("Use public transportation")],correctChoiceId:"Use public transportation"}),p("open-ended",{prompt:(0,g.Xt)("What are some ways you can help combat climate change?")}),p("open-ended",{prompt:(0,g.Xt)("What role should governments and corporations play in addressing climate change?")}),p("open-ended",{prompt:(0,g.Xt)("How do you think climate change will impact future generations?")});let x="\nClimate change is a big problem. It is caused by people. People use more things from nature and make more gases. This makes the Earth hotter. The last 13 years have been very warm. The hot Earth makes the ocean more acid, the sea level go up, and the weather change a lot.\n\nThe ocean is more acid because of more CO2. This started in the 18th century. The acid is bad for animals like oysters and clams. It is also bad for all ocean animals. The sea level has gone up a lot. This is because the ocean gets bigger when it is warm. It is also because ice is melting.\n\nWe can do things to help stop climate change. We can use things again, take buses and trains, turn off things we don't use, eat less meat and more vegetables from close by, and tell people about climate change. If we do these things, we can help fix climate change.\n".trim(),C=[{id:"amy",name:"Amy",imageUrl:"https://storage.googleapis.com/roshi-assets/dialogue-avatars/amy.png",voice:"alloy",gender:"f"},{id:"oscar",name:"Oscar",imageUrl:"https://storage.googleapis.com/roshi-assets/dialogue-avatars/oscar.png",voice:"onyx",gender:"m"},{id:"nina",name:"Nina",imageUrl:"https://storage.googleapis.com/roshi-assets/dialogue-avatars/nina.png",voice:"nova",gender:"f"},{id:"edward",name:"Edward",imageUrl:"https://storage.googleapis.com/roshi-assets/dialogue-avatars/edward.png",voice:"echo",gender:"m"},{id:"fiona",name:"Fiona",imageUrl:"https://storage.googleapis.com/roshi-assets/dialogue-avatars/fiona.png",voice:"fable",gender:"f"},{id:"sam",name:"Sam",imageUrl:"https://storage.googleapis.com/roshi-assets/dialogue-avatars/sam.png",voice:"shimmer",gender:"f"}];C.slice(0,2),C[0].id,C[1].id,C[0].id,C[1].id,C[0].id,C[1].id,C[0].id,C[1].id,(0,s.bs)({text:"Once upon a time, there was a curious raccoon named Roxy who lived in the forest.",translation:{language:"es",text:"\xc9rase una vez una curiosa mapache llamada Roxy que viv\xeda en el bosque."},sourceUrl:"https://firebasestorage.googleapis.com/v0/b/roshi-dev.appspot.com/o/files%2F5d836f0f-3549-4391-ab91-74e3b17b8de7?alt=media&token=81b0bcf5-5905-4cb9-8a5b-a6be58c32bc5"}),(0,s.bs)({text:"One day, Roxy found a plastic bottle in the forest and was curious about what it was.",translation:{language:"es",text:"Un d\xeda, Roxy encontr\xf3 una botella de pl\xe1stico en el bosque y sinti\xf3 curiosidad por saber qu\xe9 era."},sourceUrl:"https://firebasestorage.googleapis.com/v0/b/roshi-dev.appspot.com/o/files%2Ff2629ffa-e122-40fe-8dd8-1474e7479199?alt=media&token=8ddd91ba-d0e4-430c-b3f3-8a41c901a887"}),(0,s.bs)({text:"Roxy asked her friends what it was, and they told her it was trash and that it should be recycled.",translation:{language:"es",text:"Roxy pregunt\xf3 a sus amigas qu\xe9 era y le dijeron que era basura y que deb\xeda reciclarse."},sourceUrl:"https://firebasestorage.googleapis.com/v0/b/roshi-dev.appspot.com/o/files%2Fca1e91f2-72d0-4cd6-9b51-456f8547a5e5?alt=media&token=53c61d06-e0b8-4ac2-8b43-a35c676ae469"}),["Simile","Metaphor","Personification","Hyperbole","Onomatopoeia"].map(e=>({id:e,text:e,audioUrl:""})),(0,g.Xt)("Choose the correct answer to indicate the type of figurative language given in each sentence.")},99092:function(e,t,n){"use strict";n.d(t,{t5:function(){return tR},mc:function(){return nr},TG:function(){return tJ},By:function(){return tE},lb:function(){return eG},ZP:function(){return nE},Fe:function(){return ep},Rs:function(){return em},Uc:function(){return eV},wq:function(){return ez},SH:function(){return eD},Rq:function(){return eh},zT:function(){return tB},nI:function(){return eA},t_:function(){return tO},bQ:function(){return e3},jp:function(){return tg},i$:function(){return ts},YH:function(){return nS},jE:function(){return np},Xb:function(){return nn},dJ:function(){return ng},fL:function(){return tc},BH:function(){return nm},Zr:function(){return tX},kx:function(){return tQ},d9:function(){return tK},VH:function(){return tL},ux:function(){return eQ},lx:function(){return ta},mW:function(){return eY},dv:function(){return tV},T4:function(){return tS},t3:function(){return tj}});var r=n(64514),i=n(6713),o=n(71842),s=n(53650),a=n(84179),u=n(31514),l=n(49636),c=n(83640),d=n(25019);let h=async e=>{let{text:t,userId:n,vocabCefrLevel:r,isMarkdown:i}=e;return await (0,d.l_)({input:{text:t,user_id:n,vocabCefrLevel:r,isMarkdown:i},endpoint:"analyze_text",failureResponse:{text_stats:{},error:"Failed to analyze text",userId:n},method:"POST"})},f=async()=>(await (0,u.Dc)(l.uR),a.AE),p=async e=>{if(c.xR)return await f();let t=await h(e);return{text_stats:t.text_stats,error:t.error,userId:e.userId}};n(86650),n(15661);var g=n(50135);let m=async e=>{let t={error:l.dd,imageUrl:""};return await (0,d.MU)({input:e,endpoint:"generate_image",failureResponse:t})},y=async()=>(await (0,u.Dc)(l.uR),{error:"",imageUrl:"https://images.ctfassets.net/cnu0m8re1exe/5Tvq3ZONr0ulzblJtrdcGd/e0ec47b7e483b298a45f9b4c6b968fb1/shutterstock_353816774.jpg"}),v=async e=>c.xR?y():m(e),_=async e=>{let t={error:l.dd,audioUrl:""};return await (0,d.MU)({endpoint:"generate_speech_from_text",method:"POST",input:e,failureResponse:t})},b=async()=>(await (0,u.Dc)(l.uR),{error:"",audioUrl:g.H6}),w=async e=>c.xR?b():_(e);var S=n(75526),E=n(99846),k=n(15384),I=n(50711);let T=async e=>{let t={error:l.dd,text:"",warning:""};return await (0,d.a_)({input:e,endpoint:"get_text_from_url",failureResponse:t})};l.dd;let x=async e=>await T(e),C=async e=>{let t={error:l.dd,slideTranslations:[]};return await (0,d.MU)({input:e,endpoint:"translate_slides",failureResponse:t})},A=async e=>(await (0,u.Dc)(l.uR),{error:"",slideTranslations:e.slidesToTranslate.map(e=>({id:e.id,text:e.text.toUpperCase()}))}),O=async e=>c.xR?A(e):C(e),N=async e=>{let t={error:l.dd,h5pUrl:""};return await (0,d.l_)({input:e,endpoint:"generate_h5p_url",failureResponse:t})},R=async e=>(await (0,u.Dc)(l.uR),{error:"",h5pUrl:""}),D=async e=>c.xR?await R(e):await N(e),P=async e=>{let t={text:"",error:l.dd};return await (0,d.$w)({input:e,endpoint:"extract_pdf_text",failureResponse:t})},M=async e=>(await (0,u.Dc)(l.uR),{text:"This is a mock summary",error:""}),L=async e=>c.xR?M(e):P(e),U=async e=>{let t={url:"",error:l.dd};return await (0,d.$w)({input:e,endpoint:"upload_file",failureResponse:t})},j=async e=>(await (0,u.Dc)(l.uR),{url:"",error:""}),q=async e=>c.xR?j(e):U(e),F=async e=>{let t={text:"",error:l.dd,warning:""};return await (0,d.MU)({input:e,endpoint:"transcribe_audio_from_url",failureResponse:t})},$=async e=>(await (0,u.Dc)(l.uR),{text:"This is a mock transcription",warning:"",error:""}),B=async e=>c.xR?$(e):F(e),z=async e=>{let t={error:l.dd,warning:"",taskId:""};return await (0,d.MU)({input:e,endpoint:"create_unit",failureResponse:t})},V=async e=>{let t={error:l.dd,warning:"",taskId:""};return await (0,d.MU)({input:e,endpoint:"generate_template",failureResponse:t})},G=async e=>{let t={error:l.dd,warning:"",taskId:""};return await (0,d.MU)({input:e,endpoint:"create_lesson_update",failureResponse:t})},W=async e=>{let t={error:l.dd,vocabularyItems:[]};return await (0,d.MU)({endpoint:"generate_vocabulary_audio",method:"POST",input:e,failureResponse:t})},H=async()=>(await (0,u.Dc)(l.uR),{error:"",vocabularyItems:[]}),K=async e=>c.xR?H():W(e),J=async e=>{let t={error:l.dd,dialogueLines:[]};return await (0,d.MU)({endpoint:"generate_dialogue_audio",method:"POST",input:e,failureResponse:t})},X=async()=>(await (0,u.Dc)(l.uR),{error:"",dialogueLines:[]}),Q=async e=>c.xR?X():J(e),Z=async e=>(0,d.MU)({input:e,endpoint:"update_unit_in_background",failureResponse:{error:l.dd,successful:!1}}),Y=async e=>Z(e),ee=async e=>(0,d.MU)({input:e,endpoint:"update_lesson",failureResponse:{error:l.dd,successful:!1}}),et=async e=>ee(e),en=async e=>{let{options:t,...n}=e;return(0,d.$w)({input:{...n,options:JSON.stringify(t),instructions:"import-worksheet"},endpoint:"update_lesson_with_file",failureResponse:{error:l.dd,successful:!1}})},er=async e=>en(e);var ei=n(31935),eo=n(94),es=n(13041);k.Ve,k.gA;let ea={include:!1,includeAudio:!1,termCount:k.qm,directive:k.EG,includeDefinitions:!0,audioVoice:k.jB},eu=e=>{var t;let n=null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase();return"mp4"===n||"mov"===n||"webm"===n?"videos":"mp3"===n||"wav"===n||"m4a"===n?"audio":"png"===n||"jpg"===n||"jpeg"===n||"heic"===n||"gif"===n?"images":"documents"},el={...c.w1?I.m7:I.Tm,unitAssistantOptions:null,lessonUpdateTask:null,autoUpdatesEnabled:!1,elementToScrollIntoViewId:"",suggestions:[],unitContentInitializer:null,lessonContentInitializer:null,lessonStyles:{},selectedVoice:k.jB,lessonCreatorSelectedSection:"info",pdfImported:!1,startingTextGenerated:!1,lessonGenerationContextInput:null,lessonGenerationVocabInput:ea,lessonGenerationActivityInputs:[],isLessonGenerationComplete:!0,unitPendingUpdateId:"",lessonCreatorTextView:"selection",editorTab:"editor",selectedUnitId:"",errorMessage:"",warningMessage:"",infoMessage:"",editorMode:"interactive",lessonGenerationStatus:"not-started",userLessons:[],teamLessons:[],modificationTemplate:"ADJUST_LEVEL",miscQueryStatus:"not-started",inputContent:I.gg,outputContent:I.gg,isFurtherModified:!1,inputTextStats:{},modifiedTextStats:{},textModificationStatus:"not-started",textModificationInstructions:I.$e,vocabCefrLevel:s.QH,textAnalysisStatus:"not-started",vocabularyGeneratorStatus:"not-started",statusMessage:"",timerStatus:"stopped",currentTime:Date.now(),timerDuration:s.rS,timerExpireTime:null,timerStartedTime:null,timerStoppedTime:null,h5pUrl:"",mediaGenerationStatus:"not-started",storyGenerationStatus:"not-started",translationStatus:"not-started",h5pGenerationStatus:"not-started",pdfSummarizationStatus:"not-started",isAnswerKeyEnabled:!0,isReferredFromPlugin:!1,inputSourceType:"text",inputSkipModification:!0,inputSourceUrl:"",isListeningForUpdates:!0,templateTask:null},ec=(e,t)=>{let{rootState:n,...r}=t,i=(0,u.Fp)({...r,...n?(0,es.Obx)(n):{}});(0,E.Kz)(e,i)},ed="lessonEditor/modifyTextStream",eh=(0,r.hg)(ed,async e=>(ec((0,i.xr)(ed),e),e)),ef="lessonEditor/formatDocumentTextStream",ep=(0,r.hg)(ef,async e=>(ec((0,i.xr)(ef),e),e)),eg="lessonEditor/generateCanvasStream",em=(0,r.hg)(eg,async e=>(ec((0,i.xr)(eg),e),e)),ey="lessonEditor/transcribeAudioAsync",ev=(0,r.hg)(ey,async(e,t)=>{let{getState:n,rejectWithValue:r}=t,i=await B(e),o=n();return i.text?{...i,rootState:o}:r({text:"",warning:"",error:(null==i?void 0:i.error)||"Failed to save audio",rootState:o})}),e_="lessonEditor/extractPdfText",eb=(0,r.hg)(e_,async(e,t)=>{var n;let{rejectWithValue:r,getState:i}=t,o=await L(e),s=i();return(null==o?void 0:null===(n=o.text)||void 0===n?void 0:n.trim())?{...o,rootState:s}:r({...o,rootState:s})}),ew="lessonEditor/generateH5P",eS=(0,r.hg)(ew,async(e,t)=>{let{rejectWithValue:n,getState:r}=t,i=await D(e),o=r();return(null==i?void 0:i.h5pUrl)?{...i,rootState:o}:n({...i,rootState:o})}),eE="lessonEditor/modifyLessonText",ek=(0,r.hg)(eE,async(e,t)=>{let{rejectWithValue:n,getState:r}=t,i=await x(e),o=r();return i.text?{...i,rootState:o}:n({...i,rootState:o})}),eI="lessonEditor/analyzeLessonText",eT=(0,r.hg)(eI,async(e,t)=>{let{rejectWithValue:n,getState:r}=t,i=await p(e),o=r();return!i.text_stats||(0,u.Qr)(i.text_stats)?n({...i,rootState:o}):{...i,rootState:o}}),ex="lessonEditor/analyzeTextVersionAsync",eC=(0,r.hg)(ex,async(e,t)=>{let{rejectWithValue:n,getState:r}=t,i=await p({...e}),o=r();return!i.text_stats||(0,u.Qr)(i.text_stats)?n({...i,rootState:o}):{...i,rootState:o}}),eA=(0,r.hg)("lessonEditor/saveNewLesson",async(e,t)=>{let{rejectWithValue:n,getState:r,dispatch:i}=t,o=(0,u.Ox)(),s=await (0,ei.P6)(o,{...e,id:o}),a=r();if((0,es.Ck)(a),!s.lesson)return n({...s,rootState:a});let l=s.lesson.id;return(0,u.vr)("".concat(k.vC,"=").concat(l)),{...s,rootState:a}}),eO="lessonEditor/deleteSavedLesson",eN=(0,r.hg)(eO,async(e,t)=>{let{rejectWithValue:n,dispatch:r,getState:i}=t,o=await (0,ei.Ry)(e),s=i();return o.id?{...o,rootState:s}:n({...o,rootState:s})});(0,r.hg)("lessonEditor/deleteCurrentLessonAndResetEditor",async(e,t)=>{let{dispatch:n,getState:r}=t,i=r(),o=(0,es.EoL)(i);o&&(n(tx()),await n(eN(o))),(0,u.Ie)()});let eR=(0,r.hg)("lessonEditor/updateLessonAsync",async(e,t)=>{let{rejectWithValue:n,getState:r,dispatch:i}=t,{update:s,saveNewKey:a,userId:u,lessonId:l}=e,c=r(),d=(0,o.c7)(c);if(d!==u)return n({success:!1,newSaveKey:"",error:"You are not authorized to update this lesson",rootState:c});let h=await (0,ei.sI)({...e,lessonId:l,userId:d});return(c=r(),h.success)?{...h,rootState:c}:n({...h,rootState:c})});(0,r.hg)("lessonEditor/updateCurrentLessonAsync",async(e,t)=>{var n;let{rejectWithValue:r,getState:i,dispatch:s}=t,a=i(),u=(0,o.c7)(a),l=(0,es.EoL)(a);if(u!==(0,es.N43)(a).authorId)return r({success:!1,newSaveKey:"",error:"You are not authorized to update this lesson",rootState:a});let c=await s(eR({...e,lessonId:l,userId:u}));if("fulfilled"===c.meta.requestStatus&&(null==c?void 0:null===(n=c.payload)||void 0===n?void 0:n.success)){let{payload:e}=c;return{...e,rootState:a}}return{success:!1,newSaveKey:"",error:"Failed to update lesson",rootState:a}});let eD=(0,r.hg)("lessonEditor/loadSavedLesson",async(e,t)=>{let{rejectWithValue:n,getState:r}=t,i=await (0,ei.G7)(e),o=r();return i.lesson?{...i,rootState:o}:n({...i,rootState:o})});(0,r.hg)("lessonEditor/uploadFileAsync",async(e,t)=>{let{getState:n,rejectWithValue:r}=t,i=(0,o.$m)(n()),s=eu(e),a=await q({file:e,category:s,aspectRatio:"images"===s?"1:1":"",...i}),u=n();return a.url?{...a,rootState:u}:r({url:"",error:(null==a?void 0:a.error)||"Failed to save file",rootState:u})}),(0,r.hg)("lessonEditor/uploadDocumentAsync",async(e,t)=>{let{getState:n,rejectWithValue:r}=t,i=(0,o.$m)(n()),s=eu(e),a=await q({file:e,category:s,...i}),u=n();return a.url?{...a,rootState:u}:r({url:"",error:(null==a?void 0:a.error)||"Failed to save file",rootState:u})});let eP="lessonEditor/generateImageAsync",eM=(0,r.hg)(eP,async e=>await v(e)),eL="lessonEditor/generateVocabularyListAudioAsync",eU=(0,r.hg)(eL,async(e,t)=>{let{getState:n,rejectWithValue:r,dispatch:i}=t,o=await K(e),s=n();return o.vocabularyItems.length?{...o,rootState:s}:r({vocabularyItems:[],error:(null==o?void 0:o.error)||"Failed to generate audio",rootState:s})});(0,r.hg)("lessonEditor/generateDialogueAudioAsync",async(e,t)=>{let{getState:n,rejectWithValue:r,dispatch:i}=t,o=await Q(e),s=n();return o.dialogueLines.length?{...o,rootState:s}:r({dialogueLines:[],error:(null==o?void 0:o.error)||"Failed to generate audio",rootState:s})});let ej="lessonEditor/generateAudioAsync",eq=(0,r.hg)(ej,async(e,t)=>{let{getState:n,rejectWithValue:r,dispatch:i}=t;i(tS(e.unitId));let o=await w(e),s=n();return o.audioUrl?{...o,rootState:s}:r({audioUrl:"",error:(null==o?void 0:o.error)||"Failed to generate audio",rootState:s})}),eF="lessonEditor/translateSlidesAsync",e$=(0,r.hg)(eF,async(e,t)=>{let{rejectWithValue:n,getState:r}=t,i=await O(e),o=r();return i.slideTranslations.length?{...i,rootState:o}:n({slideTranslations:[],error:(null==i?void 0:i.error)||"Failed to translate slides",rootState:o})});(0,r.hg)("lessonEditor/deleteUnitAsync",async(e,t)=>{let{getState:n,dispatch:r}=t;await r(t8(e));let i=n(),s=(0,o.c7)(i),a=(0,es.N43)(i),u=a.authorId;if((0,es.NEW)(i)&&s===u){let{units:e,authorId:t,id:n}=a;r(eR({update:{units:e},lessonId:n,saveNewKey:!1,userId:t}))}}),(0,r.hg)("lessonEditor/duplicateUnitAsync",async(e,t)=>{let{getState:n,dispatch:r}=t;await r(t7(e));let i=n(),s=(0,o.c7)(i),a=(0,es.N43)(i),u=a.authorId;if((0,es.NEW)(i)&&s===u){let{units:e,authorId:t,id:n}=a;r(eR({update:{units:e},lessonId:n,saveNewKey:!1,userId:t}))}}),(0,r.hg)("lessonEditor/disableAutoUpdatesAsync",async(e,t)=>{let{dispatch:n}=t;n(e2(!0)),await (0,u.Dc)(e),n(e2(!1))}),(0,r.hg)("lessonEditor/addUnitAsync",async(e,t)=>{let{getState:n,dispatch:r}=t;await r(t9(e));let i=n(),s=(0,o.c7)(i),a=(0,es.N43)(i),u=a.authorId;if((0,es.NEW)(i)&&s===u){let{units:e,authorId:t,id:n}=a;r(eR({update:{units:e},lessonId:n,saveNewKey:!1,userId:t}))}});let eB="lessonEditor/rearrangeUnitAsync";(0,r.hg)(eB,async(e,t)=>{let{getState:n,dispatch:r}=t;await r(ne(e));let i=n(),s=(0,o.c7)(i),a=(0,es.N43)(i),u=a.authorId;if((0,es.NEW)(i)&&s===u){let{units:e,authorId:t,id:n}=a;r(eR({update:{units:e},lessonId:n,saveNewKey:!1,userId:t}))}}),(0,r.hg)(eB,async(e,t)=>{let{getState:n,dispatch:r}=t;await r(tT());let i=n(),s=(0,o.c7)(i),a=(0,es.N43)(i),u=a.authorId;if((0,es.NEW)(i)&&s===u){let{units:e,authorId:t,id:n}=a;r(eR({update:{statusUpdate:null},lessonId:n,saveNewKey:!1,userId:t}))}}),(0,r.hg)("lessonEditor/saveLessonAsync",async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{getState:t,dispatch:n}=arguments.length>1?arguments[1]:void 0,r=t(),i=(0,o.Qb)(r),s=(0,es.zfd)(r);if(!i||s)return;let a=(0,es.NEW)(r),u=(0,es.avg)(r);if(a&&u){let e=(0,es.N43)(r),{id:t,authorId:i}=e;await n(eR({lessonId:t,update:e,saveNewKey:!1,userId:i}))}else{let t=(0,es.JFE)(r);await n(eA({...t,...e}))}});let ez=(0,r.hg)("lessonEditor/generateUnitAsync",async(e,t)=>{let{dispatch:n,rejectWithValue:r}=t,i=await z(e);return i.taskId?(n(tS(e.unitId)),i):r({taskId:"",error:i.error,warning:""})}),eV=(0,r.hg)("lessonEditor/generateTemplateAsync",async(e,t)=>{let{dispatch:n,rejectWithValue:r}=t,i=await V(e);return i.taskId?i:r({taskId:"",error:i.error,warning:""})}),eG=(0,r.hg)("lessonEditor/createLessonUpdateTaskAsync",async(e,t)=>{let{rejectWithValue:n}=t,r=await G(e);return r.taskId?r:n({taskId:"",error:r.error,warning:""})});(0,r.hg)("lessonEditor/updateUnitInBackgroundAsync",async(e,t)=>{let{dispatch:n}=t,r=await Y(e);return n(tS(e.unitId)),r}),(0,r.hg)("lessonEditor/updateLessonInBAckgroundAsync",async(e,t)=>{let{dispatch:n}=t;return await et(e)}),(0,r.hg)("lessonEditor/importWorksheetAsync",async(e,t)=>{let{dispatch:n}=t;return await er(e)}),(0,r.hg)("lessonEditor/muteRemoteUpdatesAsync",async(e,t)=>{let{dispatch:n}=t;n(nw(!1)),await (0,u.Dc)(e),n(nw(!0))});let eW=(0,r.oM)({name:"lessonEditor",initialState:el,reducers:{setStatusUpdate:(e,t)=>{e.statusUpdate=t.payload},clearStatusUpdate:e=>{e.statusUpdate=null},setUnitAssistantOptions:(e,t)=>{e.unitAssistantOptions=t.payload},clearUnitAssistantOptions:e=>{e.unitAssistantOptions=null},setLessonUpdateTask:(e,t)=>{e.lessonUpdateTask=t.payload},clearLessonUpdateTask:e=>{e.lessonUpdateTask=null},setTemplateTask:(e,t)=>{e.templateTask=t.payload},updateTemplateTask:(e,t)=>{e.templateTask&&(e.templateTask={...e.templateTask,...t.payload})},clearTemplateTask:e=>{e.templateTask=null},setAutoUpdatesEnabled:(e,t)=>{e.autoUpdatesEnabled=t.payload},setElementToScrollIntoViewId:(e,t)=>{e.elementToScrollIntoViewId=t.payload},clearElementToScrollIntoViewId:e=>{e.elementToScrollIntoViewId=""},updateLessonStyles:(e,t)=>{e.lessonStyles={...e.lessonStyles,...t.payload}},setSuggestions:(e,t)=>{e.suggestions=t.payload},clearSuggestions:e=>{e.suggestions=[]},removeSuggestionByUnitType:(e,t)=>{e.suggestions=e.suggestions.filter(e=>e.unitType!==t.payload)},addSuggestion:(e,t)=>{e.suggestions=[...e.suggestions,t.payload]},setUnitContentInitializer:(e,t)=>{e.unitContentInitializer=t.payload},clearUnitContentInitializer:e=>{e.unitContentInitializer=null},setLessonContentInitializer:(e,t)=>{e.lessonContentInitializer=t.payload},clearLessonContentInitializer:e=>{e.lessonContentInitializer=null},setSelectedVoice:(e,t)=>{e.selectedVoice=t.payload},setLessonCreatorSelectedSection:(e,t)=>{e.lessonCreatorSelectedSection=t.payload},setLessonCreatorTextView:(e,t)=>{e.lessonCreatorTextView=t.payload},setPdfImported:(e,t)=>{e.pdfImported=t.payload},setStartingTextGenerated:(e,t)=>{e.startingTextGenerated=t.payload},updateLessonGenerationContextInput:(e,t)=>{e.lessonGenerationContextInput&&(e.lessonGenerationContextInput={...e.lessonGenerationContextInput,...t.payload})},setLessonGenerationContextInput:(e,t)=>{e.lessonGenerationContextInput=t.payload},clearLessonGenerationContextInput:e=>{e.lessonGenerationContextInput=null},clearLessonGenerationContextInputText:e=>{e.lessonGenerationContextInput&&(e.lessonGenerationContextInput.payload.text="")},updateLessonGenerationVocabInput:(e,t)=>{e.lessonGenerationVocabInput={...e.lessonGenerationVocabInput,...t.payload}},setLessonActivityInputs:(e,t)=>{e.lessonGenerationActivityInputs=t.payload},addLessonGenerationActivityInput:(e,t)=>{e.lessonGenerationActivityInputs=[...e.lessonGenerationActivityInputs,t.payload]},removeLessonGenerationActivityInput:(e,t)=>{e.lessonGenerationActivityInputs=e.lessonGenerationActivityInputs.filter(e=>e.id!==t.payload)},clearLessonGenerationActivityInputs:e=>{e.lessonGenerationActivityInputs=[]},updateLessonGenerationActivityInput:(e,t)=>{e.lessonGenerationActivityInputs=e.lessonGenerationActivityInputs.map(e=>e.id===t.payload.id?{...e,...t.payload}:e)},toggleLessonGenerationActivityAudio:(e,t)=>{e.lessonGenerationActivityInputs=e.lessonGenerationActivityInputs.map(e=>({...e,includeAudio:t.payload}))},selectLessonGenerationActivitiesAudioVoice:(e,t)=>{e.lessonGenerationActivityInputs=e.lessonGenerationActivityInputs.map(e=>({...e,voice:t.payload}))},loadLessonTemplate:(e,t)=>{let{text:n,vocabulary:r,activities:i}=t.payload;e.lessonGenerationContextInput=n,e.lessonGenerationVocabInput=r,e.lessonGenerationActivityInputs=i},setLessonGenerationStatus:(e,t)=>{e.lessonGenerationStatus=t.payload},setLessonEditorTab:(e,t)=>{e.editorTab=t.payload},setH5PDownloadUrl:(e,t)=>{e.h5pUrl=t.payload},clearH5PDownloadUrl:e=>{e.h5pUrl=""},setUnitPendingUpdateId:(e,t)=>{e.unitPendingUpdateId=t.payload},clearUnitPendingUpdateId:e=>{e.unitPendingUpdateId=""},setEditorMode:(e,t)=>{e.editorMode=t.payload},setLessonErrorMessage:(e,t)=>{e.errorMessage=t.payload},setLessonWarningMessage:(e,t)=>{e.warningMessage=t.payload},clearLessonErrorMessage:e=>{e.errorMessage="",e.miscQueryStatus="not-started",e.vocabularyGeneratorStatus="not-started",e.textModificationStatus="not-started",e.lessonGenerationStatus="not-started",e.textModificationStatus="not-started",e.h5pGenerationStatus="not-started",e.warningMessage="",e.statusMessage="",e.unitPendingUpdateId="",e.statusUpdate=null},setLessonInfoMessage:(e,t)=>{e.infoMessage=t.payload},clearLessonInfoMessage:e=>{e.infoMessage=""},openNewLesson:e=>({...e,...I.Tm}),setShowH5pUrl:(e,t)=>{e.showH5pUrl=t.payload},setLessonTitle:(e,t)=>{e.title=t.payload},setLessonTeamId:(e,t)=>{e.teamId=t.payload},setLessonAuthorId:(e,t)=>{e.authorId=t.payload},setLessonVisibility:(e,t)=>{e.visibility=t.payload},setUserLessons:(e,t)=>{e.userLessons=t.payload},setTeamLessons:(e,t)=>{e.teamLessons=t.payload},setLessonDetails:(e,t)=>{e.details=t.payload},openSavedLesson:(e,t)=>({...e,...t.payload,miscQueryStatus:"successful"}),openUpdatedLesson:(e,t)=>{let n=t.payload,{units:r,saveKey:i,statusUpdate:o,template:s=null,details:a={}}=e,{units:u,saveKey:l,statusUpdate:c,template:d=null,details:h={}}=n,f={updatedAt:n.updatedAt,saveKey:n.saveKey||i},p=JSON.stringify(r)!==JSON.stringify(u),g=JSON.stringify(o)!==JSON.stringify(c),m=JSON.stringify(s)!==JSON.stringify(d);JSON.stringify(a)!==JSON.stringify(h)&&(f.details=h),m&&(f.template=d),g&&(f.statusUpdate=c,(null==o?void 0:o.unitId)&&!(null==c?void 0:c.unitId)&&(f.unitPendingUpdateId=""));let y=e.title!==n.title;return(null==l?void 0:l.includes("meta"))||(p&&(f.units=u),y&&(f.title=n.title)),{...e,...f,miscQueryStatus:"successful"}},setLessonSaveKey:(e,t)=>{e.saveKey=t.payload},setIsLessonGenerationComplete:(e,t)=>{e.isLessonGenerationComplete=t.payload},setTextModificationStatus:(e,t)=>{e.textModificationStatus=t.payload},moveOutputToInput:e=>{let{outputContent:t,modifiedTextStats:n}=e;e.inputContent=t,e.outputContent=I.gg,e.inputTextStats=n,e.modifiedTextStats={}},setLessonInputContent:(e,t)=>{e.inputContent=t.payload},clearLessonInputContent:e=>{e.inputContent=I.gg},clearLessonCurrentTextStats:e=>{},setLessonOutputContent:(e,t)=>{e.outputContent=t.payload},clearLessonOutputContent:e=>{e.outputContent=I.gg},setLessonInputTextStats:(e,t)=>{(0,u.Qr)(e.inputTextStats)&&(e.inputTextStats=t.payload)},setLessonModifiedTextStats:(e,t)=>{e.modifiedTextStats=t.payload},clearLessonTextStats:e=>{e.inputTextStats={},e.modifiedTextStats={}},resetLessonModification:e=>{e.inputTextStats={},e.modifiedTextStats={},e.outputContent=I.gg,e.isFurtherModified=!1,e.textModificationStatus="not-started",e.errorMessage=""},clearLessonModification:e=>{e.inputTextStats={},e.modifiedTextStats={},e.outputContent=I.gg,e.isFurtherModified=!1,e.textModificationStatus="not-started",e.errorMessage="",e.inputContent=I.gg},setTextModificationInstructions:(e,t)=>{e.textModificationInstructions=t.payload},clearTextModificationInstructions:e=>{e.textModificationInstructions=""},setLessonVocabularyGenerationStatus:(e,t)=>{e.vocabularyGeneratorStatus=t.payload},setSelectedUnitId:(e,t)=>{e.selectedUnitId=t.payload},clearSelectedUnitId:e=>{e.selectedUnitId=""},updateLessonUnit:(e,t)=>{(0,eo.iW)(e,t.payload)},addLessonUnit:(e,t)=>{(0,eo.R6)(e,t.payload)},deleteLessonUnit:(e,t)=>{(0,eo.hj)(e,t.payload)},duplicateLessonUnit:(e,t)=>{(0,eo.x6)(e,t.payload)},rearrangeLessonUnit:(e,t)=>{(0,eo.MT)(e,t.payload)},setLessonEditorStatusMessage:(e,t)=>{e.statusMessage=t.payload},setLessonEditorErrorMessage:(e,t)=>{e.errorMessage=t.payload},setLessonEditorWarningMessage:(e,t)=>{e.warningMessage=t.payload},clearLessonEditorStatusMessage:e=>{e.statusMessage=""},clearLessonEditorTimer:e=>{e.timerStatus="stopped";let t=Date.now();e.currentTime=t,e.timerExpireTime=null,e.timerStartedTime=null,e.timerStoppedTime=null},stopLessonEditorTimer:e=>{e.timerStatus="stopped"},startLessonEditorTimer:e=>{let t=Date.now();e.timerStatus="running",e.currentTime=t,e.timerExpireTime=t+1e3*(e.timerDuration||S.WS),e.timerStartedTime=null,e.timerStoppedTime=null},tickLessonEditorTimer:e=>{},setMediaGenerationStatus:(e,t)=>{e.mediaGenerationStatus=t.payload},setTranslationStatus:(e,t)=>{e.translationStatus=t.payload},setIsAnswerKeyEnabled:(e,t)=>{e.isAnswerKeyEnabled=t.payload},clearLesson:e=>({...e,...I.Tm,mediaGenerationStatus:"not-started",storyGenerationStatus:"not-started",lessonGenerationStatus:"not-started",textModificationStatus:"not-started",miscQueryStatus:"not-started",activityGeneratorStatus:"not-started",vocabularyGeneratorStatus:"not-started",textAnalysisStatus:"not-started"}),setIsReferredFromPlugin:(e,t)=>{e.isReferredFromPlugin=t.payload},setInputSourceType:(e,t)=>{e.inputSourceType=t.payload},setInputSkipModification:(e,t)=>{e.inputSkipModification=t.payload},setInputSourceUrl:(e,t)=>{e.inputSourceUrl=t.payload},setIsListeningForUpdates:(e,t)=>{e.isListeningForUpdates=t.payload},resetLessonEditorState:e=>((0,u.Ie)(),{...el,userLessons:e.userLessons,teamLessons:e.teamLessons,editorMode:"edit"})},extraReducers:e=>{e.addCase(ek.pending,(e,t)=>{e.textModificationStatus="pending",ec((0,i.xr)(eE),t.meta.arg)}).addCase(ek.rejected,(e,t)=>{e.textModificationStatus="failed";let{error:n="",warning:r=""}=(null==t?void 0:t.payload)||{};r&&(e.warningMessage=r),n&&(e.errorMessage=n),ec((0,i.Kq)(eE),{...t.meta.arg,error:n})}).addCase(ek.fulfilled,(e,t)=>{e.textModificationStatus="successful",e.errorMessage="",ec((0,i.wV)(eE),{...t.meta.arg,...t.payload})}).addCase(eT.pending,(e,t)=>{e.textAnalysisStatus="pending",ec((0,i.xr)(eI),t.meta.arg)}).addCase(eT.rejected,(e,t)=>{var n;e.textAnalysisStatus="failed";let r=(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong";e.errorMessage=r,ec((0,i.Kq)(eI),{...t.meta.arg,error:r})}).addCase(eT.fulfilled,(e,t)=>{e.textAnalysisStatus="successful";let{text_stats:n}=t.payload;e.inputTextStats=n,e.errorMessage="",ec((0,i.wV)(eI),{...t.meta.arg,...t.payload})}).addCase(eC.pending,(e,t)=>{ec((0,i.xr)(ex),t.meta.arg)}).addCase(eC.rejected,(e,t)=>{var n;let r=(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong";e.textAnalysisStatus="successful",e.errorMessage="",ec((0,i.Kq)(ex),{...t.meta.arg,error:r})}).addCase(eC.fulfilled,(e,t)=>{e.textAnalysisStatus="successful",e.errorMessage="";let{unitId:n}=t.meta.arg;ec((0,i.wV)(ex),{...t.meta.arg,...t.payload})}).addCase(eA.pending,(e,t)=>{e.miscQueryStatus="pending"}).addCase(eA.rejected,(e,t)=>{var n;e.miscQueryStatus="failed";let r=(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong";e.errorMessage=r}).addCase(eA.fulfilled,(e,t)=>{let{lesson:n}=t.payload,r=[...e.userLessons];return n&&r.push(n),{...e,...n,miscQueryStatus:"successful",userLessons:r,errorMessage:"",infoMessage:"Activity Saved",editorMode:"edit",editorTab:"editor"}}).addCase(eR.pending,(e,t)=>{e.miscQueryStatus="pending"}).addCase(eR.rejected,(e,t)=>{var n;e.miscQueryStatus="failed";let r=(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong";e.errorMessage=r}).addCase(eR.fulfilled,(e,t)=>{let{update:n,lessonId:r}=t.meta.arg,i=e.userLessons.map(e=>e.id===r?{...e,...n}:e);return{...e,...n,userLessons:i,errorMessage:"",infoMessage:"Changes Saved",miscQueryStatus:"successful"}}).addCase(eN.pending,(e,t)=>{e.miscQueryStatus="pending",ec((0,i.xr)(eO),{lessonId:t.meta.arg})}).addCase(eN.rejected,(e,t)=>{var n,r;e.miscQueryStatus="failed";let o=(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong";e.errorMessage=o,ec((0,i.Kq)(eO),{lessonId:t.meta.arg,error:(null==t?void 0:null===(r=t.payload)||void 0===r?void 0:r.error)||"Something went wrong"})}).addCase(eN.fulfilled,(e,t)=>{let{id:n}=t.payload;return(ec((0,i.wV)(eO),{lessonId:t.meta.arg,...t.payload}),n===e.id)?{...e,...I.Tm,userLessons:e.userLessons.filter(e=>e.id!==n),errorMessage:"",infoMessage:"Document Deleted",miscQueryStatus:"successful"}:{...e,userLessons:e.userLessons.filter(e=>e.id!==n),errorMessage:"",infoMessage:"Document Deleted",miscQueryStatus:"successful"}}).addCase(eD.pending,(e,t)=>{e.miscQueryStatus="pending"}).addCase(eD.rejected,(e,t)=>{var n;e.miscQueryStatus="failed",e.errorMessage=(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong"}).addCase(eD.fulfilled,(e,t)=>{let{lesson:n}=t.payload;return{...e,miscQueryStatus:"successful",...n}}).addCase(eM.pending,(e,t)=>{e.mediaGenerationStatus="pending",e.unitPendingUpdateId=t.meta.arg.unitId,ec((0,i.xr)(eP),t.meta.arg)}).addCase(eM.rejected,(e,t)=>{var n,r;e.mediaGenerationStatus="failed",e.errorMessage=(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong",e.unitPendingUpdateId="",ec((0,i.Kq)(eP),{unitId:t.meta.arg.unitId,error:(null==t?void 0:null===(r=t.payload)||void 0===r?void 0:r.error)||"Something went wrong"})}).addCase(eM.fulfilled,(e,t)=>{e.unitPendingUpdateId="",e.mediaGenerationStatus="successful",ec((0,i.wV)(eP),{...t.payload})}).addCase(eU.pending,(e,t)=>{e.mediaGenerationStatus="pending",ec((0,i.xr)(eL),t.meta.arg)}).addCase(eU.rejected,(e,t)=>{var n,r;e.mediaGenerationStatus="failed",e.errorMessage=(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong",e.unitPendingUpdateId="",ec((0,i.Kq)(eL),{error:(null==t?void 0:null===(r=t.payload)||void 0===r?void 0:r.error)||"Something went wrong"})}).addCase(eU.fulfilled,(e,t)=>{e.unitPendingUpdateId="",e.mediaGenerationStatus="successful",ec((0,i.wV)(eL),{...t.payload})}).addCase(eq.pending,(e,t)=>{e.mediaGenerationStatus="pending",ec((0,i.xr)(ej),t.meta.arg)}).addCase(eq.rejected,(e,t)=>{var n,r;e.mediaGenerationStatus="failed",e.errorMessage=(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong",e.unitPendingUpdateId="",ec((0,i.Kq)(ej),{error:(null==t?void 0:null===(r=t.payload)||void 0===r?void 0:r.error)||"Something went wrong"})}).addCase(eq.fulfilled,(e,t)=>{e.unitPendingUpdateId="",e.mediaGenerationStatus="successful",ec((0,i.wV)(ej),{...t.meta.arg,...t.payload})}).addCase(ev.pending,(e,t)=>{e.mediaGenerationStatus="pending",ec((0,i.xr)(ey),t.meta.arg)}).addCase(ev.rejected,(e,t)=>{var n,r;e.mediaGenerationStatus="failed",e.errorMessage=(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Failed to transcribe audio.",ec((0,i.Kq)(ey),{...t.meta.arg,error:(null==t?void 0:null===(r=t.payload)||void 0===r?void 0:r.error)||"Something went wrong"})}).addCase(ev.fulfilled,(e,t)=>{e.mediaGenerationStatus="successful";let{text:n}=t.payload;e.outputContent={text:n,html:n,markdown:n},ec((0,i.wV)(ey),{...t.meta.arg})}).addCase(eS.pending,(e,t)=>{e.h5pGenerationStatus="pending",ec((0,i.xr)(ew),t.meta.arg)}).addCase(eS.rejected,(e,t)=>{var n;e.h5pGenerationStatus="failed",e.errorMessage="Failed to generate H5P",ec((0,i.Kq)(ew),{...t.meta.arg,error:(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong"})}).addCase(eS.fulfilled,(e,t)=>{e.h5pGenerationStatus="successful";let{h5pUrl:n}=t.payload;e.h5pUrl=n,ec((0,i.wV)(ew),{...t.meta.arg})}).addCase(eb.pending,(e,t)=>{e.pdfSummarizationStatus="pending",ec((0,i.xr)(e_),{userId:t.meta.arg.userId})}).addCase(eb.rejected,(e,t)=>{var n;e.pdfSummarizationStatus="failed",e.errorMessage="Failed to summarize PDF",ec((0,i.Kq)(e_),{user:t.meta.arg.userId,error:(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong"})}).addCase(eb.fulfilled,(e,t)=>{e.pdfSummarizationStatus="successful";let{text:n}=t.payload;e.outputContent={text:n},ec((0,i.wV)(e_),{...t.meta.arg})}).addCase(e$.pending,(e,t)=>{e.translationStatus="pending",ec((0,i.xr)(eF),t.meta.arg)}).addCase(e$.rejected,(e,t)=>{var n,r;e.errorMessage=(null==t?void 0:null===(n=t.payload)||void 0===n?void 0:n.error)||"Something went wrong",ec((0,i.Kq)(eF),{...t.meta.arg,error:(null==t?void 0:null===(r=t.payload)||void 0===r?void 0:r.error)||"Something went wrong"})}).addCase(e$.fulfilled,(e,t)=>{let{slideTranslations:n}=t.payload,{translationLanguage:r}=t.meta.arg;ec((0,i.wV)(eF),{...t.meta.arg,...t.payload})})}}),{setStatusUpdate:eH,clearStatusUpdate:eK,setUnitAssistantOptions:eJ,clearUnitAssistantOptions:eX,setLessonUpdateTask:eQ,clearLessonUpdateTask:eZ,setTemplateTask:eY,updateTemplateTask:e0,clearTemplateTask:e1,setAutoUpdatesEnabled:e2,setElementToScrollIntoViewId:e3,clearElementToScrollIntoViewId:e4,setSuggestions:e5,clearSuggestions:e6,removeSuggestionByUnitType:e9,addSuggestion:e8,setUnitContentInitializer:e7,clearUnitContentInitializer:te,setLessonContentInitializer:tt,clearLessonContentInitializer:tn,updateLessonStyles:tr,setSelectedVoice:ti,setLessonCreatorSelectedSection:to,setLessonCreatorTextView:ts,setPdfImported:ta,updateLessonGenerationContextInput:tu,setStartingTextGenerated:tl,setLessonGenerationContextInput:tc,clearLessonGenerationContextInputText:td,clearLessonGenerationContextInput:th,updateLessonGenerationVocabInput:tf,addLessonGenerationActivityInput:tp,setLessonActivityInputs:tg,removeLessonGenerationActivityInput:tm,updateLessonGenerationActivityInput:ty,selectLessonGenerationActivitiesAudioVoice:tv,toggleLessonGenerationActivityAudio:t_,clearLessonGenerationActivityInputs:tb,loadLessonTemplate:tw,setUnitPendingUpdateId:tS,clearUnitPendingUpdateId:tE,setLessonEditorTab:tk,setLessonErrorMessage:tI,clearLessonErrorMessage:tT,resetLessonEditorState:tx,setLessonInfoMessage:tC,clearLessonInfoMessage:tA,setEditorMode:tO,setIsLessonGenerationComplete:tN,clearLesson:tR,setLessonWarningMessage:tD,openNewLesson:tP,setLessonTeamId:tM,setLessonTitle:tL,setLessonVisibility:tU,setUserLessons:tj,setTeamLessons:tq,setLessonAuthorId:tF,openSavedLesson:t$,openUpdatedLesson:tB,setLessonSaveKey:tz,setTextModificationStatus:tV,setLessonInputContent:tG,clearLessonInputContent:tW,clearLessonCurrentTextStats:tH,setLessonOutputContent:tK,clearLessonOutputContent:tJ,setLessonInputTextStats:tX,setLessonModifiedTextStats:tQ,resetLessonModification:tZ,clearLessonTextStats:tY,clearLessonModification:t0,moveOutputToInput:t1,setTextModificationInstructions:t2,clearTextModificationInstructions:t3,setLessonVocabularyGenerationStatus:t4,updateLessonUnit:t5,setSelectedUnitId:t6,addLessonUnit:t9,deleteLessonUnit:t8,duplicateLessonUnit:t7,rearrangeLessonUnit:ne,clearSelectedUnitId:nt,setLessonEditorStatusMessage:nn,clearLessonEditorStatusMessage:nr,startLessonEditorTimer:ni,tickLessonEditorTimer:no,stopLessonEditorTimer:ns,clearLessonEditorTimer:na,setMediaGenerationStatus:nu,setTranslationStatus:nl,setH5PDownloadUrl:nc,clearH5PDownloadUrl:nd,setShowH5pUrl:nh,setIsAnswerKeyEnabled:nf,setLessonEditorErrorMessage:np,setLessonEditorWarningMessage:ng,setLessonGenerationStatus:nm,setIsReferredFromPlugin:ny,setInputSkipModification:nv,setInputSourceType:n_,setInputSourceUrl:nb,setIsListeningForUpdates:nw,setLessonDetails:nS}=eW.actions;var nE=eW.reducer},13041:function(e,t,n){"use strict";n.d(t,{GzQ:function(){return eH},Obx:function(){return eM},zfd:function(){return K},NEW:function(){return H},pn9:function(){return C},sG:function(){return eJ},avg:function(){return eo},EoL:function(){return W},WTt:function(){return O},KkF:function(){return N},Ame:function(){return em},WTS:function(){return el},JFE:function(){return eb},N43:function(){return e_},zvz:function(){return eX},D$J:function(){return z},Ck:function(){return en}});var r=n(19119),i=n(71842),o=n(31514),s=n(53650),a=n(94),u=n(15384),l=n(50711);n(83640);var c=n(17477);let d=["multiple-choice","multi-select","cloze"];var h=n(33680),f=n(49636),p=[{id:"alloy",name:"alloy",gender:"f",languageCode:"en-US",provider:"openai",ssmlEnabled:!0,quality:"premium"},{id:"echo",name:"echo",gender:"m",languageCode:"en-US",provider:"openai",ssmlEnabled:!0,quality:"premium"},{id:"fable",name:"fable",gender:"m",languageCode:"en-GB",provider:"openai",ssmlEnabled:!0,quality:"premium"},{id:"onyx",name:"onyx",gender:"m",languageCode:"en-US",provider:"openai",ssmlEnabled:!0,quality:"premium"},{id:"nova",name:"nova",gender:"f",languageCode:"en-US",provider:"openai",ssmlEnabled:!0,quality:"premium"},{id:"shimmer",name:"shimmer",gender:"f",languageCode:"en-US",provider:"openai",ssmlEnabled:!0,quality:"premium"}];let g=[{id:"en-US-Casual-K",languageCode:"en-US",name:"en-US-Casual-K",gender:"m",provider:"google",ssmlEnabled:!1,quality:"premium"},{id:"en-US-Journey-D",languageCode:"en-US",name:"en-US-Journey-D",gender:"m",provider:"google",ssmlEnabled:!1,quality:"premium"},{id:"en-US-Journey-F",languageCode:"en-US",name:"en-US-Journey-F",gender:"f",provider:"google",ssmlEnabled:!1,quality:"premium"},{id:"en-US-Journey-O",languageCode:"en-US",name:"en-US-Journey-O",gender:"f",provider:"google",ssmlEnabled:!1,quality:"premium"},{id:"en-AU-Neural2-A",languageCode:"en-AU",name:"en-AU-Neural2-A",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-AU-Neural2-B",languageCode:"en-AU",name:"en-AU-Neural2-B",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-AU-Neural2-C",languageCode:"en-AU",name:"en-AU-Neural2-C",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-AU-Neural2-D",languageCode:"en-AU",name:"en-AU-Neural2-D",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-AU-News-E",languageCode:"en-AU",name:"en-AU-News-E",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-AU-News-F",languageCode:"en-AU",name:"en-AU-News-F",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-AU-News-G",languageCode:"en-AU",name:"en-AU-News-G",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-AU-Polyglot-1",languageCode:"en-AU",name:"en-AU-Polyglot-1",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-AU-Standard-A",languageCode:"en-AU",name:"en-AU-Standard-A",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-AU-Standard-B",languageCode:"en-AU",name:"en-AU-Standard-B",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-AU-Standard-C",languageCode:"en-AU",name:"en-AU-Standard-C",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-AU-Standard-D",languageCode:"en-AU",name:"en-AU-Standard-D",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-AU-Wavenet-A",languageCode:"en-AU",name:"en-AU-Wavenet-A",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-AU-Wavenet-B",languageCode:"en-AU",name:"en-AU-Wavenet-B",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-AU-Wavenet-C",languageCode:"en-AU",name:"en-AU-Wavenet-C",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-AU-Wavenet-D",languageCode:"en-AU",name:"en-AU-Wavenet-D",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Neural2-A",languageCode:"en-GB",name:"en-GB-Neural2-A",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Neural2-B",languageCode:"en-GB",name:"en-GB-Neural2-B",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Neural2-C",languageCode:"en-GB",name:"en-GB-Neural2-C",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Neural2-D",languageCode:"en-GB",name:"en-GB-Neural2-D",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Neural2-F",languageCode:"en-GB",name:"en-GB-Neural2-F",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-News-G",languageCode:"en-GB",name:"en-GB-News-G",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-News-H",languageCode:"en-GB",name:"en-GB-News-H",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-News-I",languageCode:"en-GB",name:"en-GB-News-I",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-News-J",languageCode:"en-GB",name:"en-GB-News-J",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-News-K",languageCode:"en-GB",name:"en-GB-News-K",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-News-L",languageCode:"en-GB",name:"en-GB-News-L",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-News-M",languageCode:"en-GB",name:"en-GB-News-M",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Standard-A",languageCode:"en-GB",name:"en-GB-Standard-A",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Standard-B",languageCode:"en-GB",name:"en-GB-Standard-B",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Standard-C",languageCode:"en-GB",name:"en-GB-Standard-C",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Standard-D",languageCode:"en-GB",name:"en-GB-Standard-D",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Standard-F",languageCode:"en-GB",name:"en-GB-Standard-F",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Studio-B",languageCode:"en-GB",name:"en-GB-Studio-B",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Studio-C",languageCode:"en-GB",name:"en-GB-Studio-C",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Wavenet-A",languageCode:"en-GB",name:"en-GB-Wavenet-A",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Wavenet-B",languageCode:"en-GB",name:"en-GB-Wavenet-B",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Wavenet-C",languageCode:"en-GB",name:"en-GB-Wavenet-C",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Wavenet-D",languageCode:"en-GB",name:"en-GB-Wavenet-D",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-GB-Wavenet-F",languageCode:"en-GB",name:"en-GB-Wavenet-F",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-IN-Neural2-A",languageCode:"en-IN",name:"en-IN-Neural2-A",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-IN-Neural2-B",languageCode:"en-IN",name:"en-IN-Neural2-B",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-IN-Neural2-C",languageCode:"en-IN",name:"en-IN-Neural2-C",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-IN-Neural2-D",languageCode:"en-IN",name:"en-IN-Neural2-D",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-IN-Standard-A",languageCode:"en-IN",name:"en-IN-Standard-A",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-IN-Standard-B",languageCode:"en-IN",name:"en-IN-Standard-B",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-IN-Standard-C",languageCode:"en-IN",name:"en-IN-Standard-C",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-IN-Standard-D",languageCode:"en-IN",name:"en-IN-Standard-D",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-IN-Wavenet-A",languageCode:"en-IN",name:"en-IN-Wavenet-A",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-IN-Wavenet-B",languageCode:"en-IN",name:"en-IN-Wavenet-B",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-IN-Wavenet-C",languageCode:"en-IN",name:"en-IN-Wavenet-C",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-IN-Wavenet-D",languageCode:"en-IN",name:"en-IN-Wavenet-D",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Neural2-A",languageCode:"en-US",name:"en-US-Neural2-A",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Neural2-C",languageCode:"en-US",name:"en-US-Neural2-C",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Neural2-D",languageCode:"en-US",name:"en-US-Neural2-D",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Neural2-E",languageCode:"en-US",name:"en-US-Neural2-E",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Neural2-F",languageCode:"en-US",name:"en-US-Neural2-F",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Neural2-G",languageCode:"en-US",name:"en-US-Neural2-G",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Neural2-H",languageCode:"en-US",name:"en-US-Neural2-H",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Neural2-I",languageCode:"en-US",name:"en-US-Neural2-I",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Neural2-J",languageCode:"en-US",name:"en-US-Neural2-J",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-News-K",languageCode:"en-US",name:"en-US-News-K",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-News-L",languageCode:"en-US",name:"en-US-News-L",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-News-N",languageCode:"en-US",name:"en-US-News-N",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Polyglot-1",languageCode:"en-US",name:"en-US-Polyglot-1",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Standard-A",languageCode:"en-US",name:"en-US-Standard-A",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Standard-B",languageCode:"en-US",name:"en-US-Standard-B",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Standard-C",languageCode:"en-US",name:"en-US-Standard-C",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Standard-D",languageCode:"en-US",name:"en-US-Standard-D",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Standard-E",languageCode:"en-US",name:"en-US-Standard-E",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Standard-F",languageCode:"en-US",name:"en-US-Standard-F",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Standard-G",languageCode:"en-US",name:"en-US-Standard-G",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Standard-H",languageCode:"en-US",name:"en-US-Standard-H",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Standard-I",languageCode:"en-US",name:"en-US-Standard-I",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Standard-J",languageCode:"en-US",name:"en-US-Standard-J",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Studio-O",languageCode:"en-US",name:"en-US-Studio-O",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Studio-Q",languageCode:"en-US",name:"en-US-Studio-Q",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Wavenet-A",languageCode:"en-US",name:"en-US-Wavenet-A",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Wavenet-B",languageCode:"en-US",name:"en-US-Wavenet-B",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Wavenet-C",languageCode:"en-US",name:"en-US-Wavenet-C",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Wavenet-D",languageCode:"en-US",name:"en-US-Wavenet-D",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Wavenet-E",languageCode:"en-US",name:"en-US-Wavenet-E",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Wavenet-F",languageCode:"en-US",name:"en-US-Wavenet-F",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Wavenet-G",languageCode:"en-US",name:"en-US-Wavenet-G",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Wavenet-H",languageCode:"en-US",name:"en-US-Wavenet-H",gender:"f",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Wavenet-I",languageCode:"en-US",name:"en-US-Wavenet-I",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"},{id:"en-US-Wavenet-J",languageCode:"en-US",name:"en-US-Wavenet-J",gender:"m",provider:"google",ssmlEnabled:!1,quality:"standard"}];g.filter(e=>e.name.includes("Wavenet")),g.filter(e=>e.name.includes("Studio")),g.filter(e=>e.name.includes("Neural")),g.filter(e=>e.name.includes("News")),g.filter(e=>e.name.includes("Polyglot"));let m=g.filter(e=>e.name.includes("Journey"));g.filter(e=>e.name.includes("Standard"));let y=[...m,...g.filter(e=>e.name.includes("Casual"))];[...p];let v=[...p,...y],_=e=>v.find(t=>t.id===e)||null,b=e=>!!e&&"object"==typeof e&&"text"in e,w=e=>!!("multiple-choice"===e.variation&&e.choices&&Array.isArray(e.choices)&&e.choices.every(b)),S=e=>!!("open-ended"===e.variation&&"prompt"in e&&"object"==typeof e.prompt&&b(e.prompt)),E=e=>!!("cloze"===e.variation&&"clozeText"in e&&b(e.clozeText)),k=e=>{switch(e.variation){case"multiple-choice":return w(e);case"open-ended":return S(e);case"cloze":return E(e);default:return!1}},I=e=>"quiz"===e.type?{...e,questions:e.questions.filter(k)}:e,T=(0,r.P1)(e=>e.lessonEditor.lessonStyles||null,e=>e||u.Qw);(0,r.P1)(T,e=>(null==e?void 0:e.titleFontSize)||u.Qw.titleFontSize),(0,r.P1)(T,e=>(null==e?void 0:e.headerFontSize)||u.Qw.headerFontSize);let x=e=>e.lessonEditor.selectedVoice,C=e=>e.lessonEditor.isListeningForUpdates,A=(0,r.P1)(i.W$,e=>s.fC[h.bV[e]||"anonymousGroup"]),O=e=>{var t;return(null===(t=e.lessonEditor)||void 0===t?void 0:t.inputContent)||l.gg};(0,r.P1)(e=>"print"===e.lessonEditor.editorMode,e=>"interactive"===e.lessonEditor.editorMode,(e,t)=>e||t);let N=e=>{var t;return(null===(t=e.lessonEditor)||void 0===t?void 0:t.outputContent)||l.gg},R=(0,r.P1)(e=>e.lessonEditor.statusUpdate||null,e=>e&&(0,o.uO)(e.createdAt,60)?e:null),D=(0,r.P1)(R,e=>e&&!e.unitId?e:null),P=(0,r.P1)(D,e=>e&&"error"===e.type?e.message:""),M=(0,r.P1)(D,e=>e&&"warning"===e.type?e.message:""),L=(0,r.P1)(D,e=>e&&"info"===e.type?e.message:""),U=(0,r.P1)(R,e=>e&&"pending"===e.type?e:null),j=(0,r.P1)(U,e=>e&&!e.unitId?e:null),q=(0,r.P1)(j,e=>!!e);(0,r.P1)(R,e=>e&&e.unitId?e:null);let F=(0,r.P1)(U,e=>e&&e.unitId?e:null);(0,r.P1)(j,e=>e?e.message:"");let $=(0,r.P1)(P,e=>e.lessonEditor.errorMessage,(e,t)=>e||t);(0,r.P1)($,e=>!!e),(0,r.P1)(M,e=>e.lessonEditor.warningMessage,(e,t)=>e||t);let B=(0,r.P1)(F,e=>e&&(null==e?void 0:e.unitId)||""),z=(0,r.P1)(B,e=>e.lessonEditor.unitPendingUpdateId||"",(e,t)=>e||t);(0,r.P1)(z,e=>!!e);let V=e=>e.lessonEditor.title,G=(0,r.P1)(V,e=>!!e),W=e=>e.lessonEditor.id,H=(0,r.P1)(e=>!e.lessonEditor.id,e=>!e);(0,r.P1)(L,e=>e.lessonEditor.infoMessage,(e,t)=>e||t);let K=(0,r.P1)(e=>"pending"===e.lessonEditor.textAnalysisStatus,e=>"pending"===e.lessonEditor.textModificationStatus,e=>"pending"===e.lessonEditor.miscQueryStatus,e=>"pending"===e.lessonEditor.vocabularyGeneratorStatus,e=>"pending"===e.lessonEditor.lessonGenerationStatus,e=>"pending"===e.lessonEditor.mediaGenerationStatus,e=>"pending"===e.lessonEditor.storyGenerationStatus,e=>"pending"===e.lessonEditor.storyGenerationStatus,e=>"pending"===e.lessonEditor.h5pGenerationStatus,e=>"pending"===e.lessonEditor.pdfSummarizationStatus,q,(e,t,n,r,i,o,s,a,u,l,c)=>e||t||n||r||i||o||s||a||u||l||c);(0,r.P1)(e=>{var t;return(0,a.wq)(null===(t=e.lessonEditor)||void 0===t?void 0:t.inputContent)},K,(e,t)=>!e||t);let J=e=>e.lessonEditor.textModificationInstructions,X=(0,r.P1)(O,e=>(0,a.o4)(e)),Q=(0,r.P1)(N,e=>(0,a.o4)(e));(0,r.P1)(X,J,i.c7,i.W$,e=>e.lessonEditor.modificationTemplate,(e,t,n,r,i)=>({text:e,textModificationInstructions:t,userId:n,userType:r,targetLevel:"",standard:"CUSTOM"===i?"custom":"generic"}));let Z=(0,r.P1)(e=>e.lessonEditor.lessonGenerationContextInput,e=>{var t;return e&&(null===(t=e.payload)||void 0===t?void 0:t.text)||""});(0,r.P1)(Z,i.c7,i.W$,(e,t,n)=>({text:e,userId:t,userType:n,textModificationInstructions:"",targetLevel:"",standard:"generic"}));let Y=(0,r.P1)(O,e=>(0,a.Po)(e));(0,r.P1)(Y,J,i.c7,i.W$,(e,t,n,r)=>({text:e,textModificationInstructions:t,userId:n,userType:r,targetLevel:""})),(0,r.P1)(X,i.c7,e=>e.lessonEditor.vocabCefrLevel,(e,t,n)=>({text:e,userId:t,vocabCefrLevel:n}));let ee=e=>e.lessonEditor.modifiedTextStats,et=e=>e.lessonEditor.inputTextStats;(0,r.P1)(et,e=>(0,o.ez)(e)),(0,r.P1)(ee,e=>(0,o.ez)(e));let en=e=>e.lessonEditor.userLessons,er=e=>e.lessonEditor.teamLessons;(0,r.P1)(er,e=>e.length>0),(0,r.P1)(en,e=>e.filter(e=>e.title.toLowerCase().includes("untitled")).length),(0,r.P1)(i.LN,e=>e?["article",...s.Mn]:s.Mn);let ei=e=>e.lessonEditor.authorId,eo=(0,r.P1)(H,ei,i.c7,(e,t,n)=>e&&!!t&&t===n);(0,r.P1)(H,ei,(e,t)=>e&&!t);let es=e=>e.lessonEditor.units.find(e=>"vocabulary"===e.type)||null,ea=(0,r.P1)(es,e=>(null==e?void 0:e.vocabularyItems)||null),eu=e=>e.lessonEditor.teamId;(0,r.P1)(i.c7,ei,(e,t)=>!!t&&e!==t);let el=(0,r.P1)(e=>e.lessonEditor.units,e=>e.map(I));(0,r.P1)(el,e=>e.filter(e=>!e.isHidden));let ec=(0,r.P1)(el,e=>e.length>0),ed=(0,r.P1)(el,e=>(0,a.kt)(e)),eh=(0,r.P1)(el,e=>e.filter(e=>"slide"===e.type)),ef=(0,r.P1)(eh,e=>e.map(e=>e.text).filter(e=>!!e).join("/n")||""),ep=(0,r.P1)(ed,e=>(null==e?void 0:e.selectedVersionId)||""),eg=(0,r.P1)(ed,ep,(e,t)=>e&&e.versions&&e.versions.find(e=>e.id===t)||null),em=e=>{var t;return(null===(t=e.lessonEditor)||void 0===t?void 0:t.saveKey)||""},ey=e=>e.lessonEditor.details||null,ev=(0,r.P1)(ey,e=>!!e&&(0,o.ez)(e));(0,r.P1)(G,ev,ec,(e,t,n)=>e||t||n);let e_=(0,r.zB)({id:W,title:V,description:e=>e.lessonEditor.description,authorId:ei,visibility:e=>e.lessonEditor.visibility||"team",teamId:eu,units:el,createdAt:e=>e.lessonEditor.createdAt||"",updatedAt:e=>e.lessonEditor.updatedAt||"",targetLevel:e=>e.lessonEditor.targetLevel||"",language:e=>e.lessonEditor.language||"en",saveKey:em,showH5pUrl:e=>e.lessonEditor.showH5pUrl||!1,details:ey,lessonStyles:T,statusUpdate:R});(0,r.P1)(e_,e=>(0,a.jY)(e));let eb=(0,r.P1)(e_,i.c7,i.oB,(e,t,n)=>({...e,id:"",authorId:t,teamId:n}));(0,r.P1)(e_,i.c7,i.oB,(e,t,n)=>({...e,authorId:t,teamId:n})),(0,r.P1)(eg,e=>(null==e?void 0:e.textStats)||{}),(0,r.P1)(Q,X,(e,t)=>e||t),(0,r.P1)(ee,et,(e,t)=>(0,o.ez)(e)?e:t),(0,r.P1)(X,Q,(e,t)=>!!t&&e!==t);let ew=(0,r.P1)(ea,e=>(0,a.ld)(e)),eS=(0,r.P1)(el,e=>(0,a.Z$)(e)),eE=(0,r.P1)(el,e=>e.filter(e=>"dialogue"===e.type)),ek=(0,r.P1)(el,e=>e.filter(e=>"canvas"===e.type)),eI=(0,r.P1)(eE,e=>{let t=[];for(let r of e){let e=[],{speakers:i}=r;for(let t of r.lines){var n;let r=(null===(n=i.find(e=>e.id===t.speakerId))||void 0===n?void 0:n.name)||"Speaker",o=t.message.text||"";e.push("".concat(r,": ").concat(o))}t.push(e.join("\n"))}return t.join("\n\n")}),eT=(0,r.P1)(eS,e=>e.map(a.pe).join("/n/n")),ex=(0,r.P1)(ek,e=>e.map(a.Cs).join("/n/n")),eC=(0,r.P1)(eT,e=>!!e.trim()),eA=(0,r.P1)(eI,e=>!!e.trim()),eO=(0,r.P1)(ef,e=>!!e.trim()),eN=(0,r.P1)(ew,e=>e.join("\n")),eR=(0,r.P1)(eT,eN,ef,eI,ex,(e,t,n,r,i)=>[e,t,n,r,i].filter(e=>!!e.trim()).join("\n\n")),eD=(0,r.P1)(eR,e=>(0,o.Ht)(e));(0,r.P1)(eD,e=>e>=15);let eP=(0,r.P1)(eC,eO,eA,(e,t,n)=>e||t||n);(0,r.P1)(eR,i.c7,i.W$,(e,t,n)=>({text:e,userId:t,userType:n,activityInstructionsList:[]}));let eM=e=>(0,o.Fp)({userId:(0,i.c7)(e),userType:(0,i.W$)(e),lessonId:W(e),lessonTitle:V(e),lessonText:eR(e)});(0,r.P1)(eR,A,(e,t)=>(0,o.Ht)(e)>t),(0,r.P1)(Q,A,(e,t)=>(0,o.Ht)(e)>t);let eL=(0,r.P1)(en,e=>e.length),eU=(0,r.P1)(eL,e=>e>0),ej=(0,r.P1)(er,e=>e.length>0);(0,r.P1)(eU,ej,(e,t)=>e||t),(0,r.P1)(eS,e=>e.length>0);let eq=(0,r.P1)(eC,eO,(e,t)=>e||t),eF=(0,r.P1)(el,e=>e.filter(e=>"vocabulary"===e.type));(0,r.P1)(eF,e=>e.length>0),(0,r.P1)(eF,e=>e.length>0?e[0].id:"");let e$=(0,r.P1)(el,e=>e.length);(0,r.P1)(e$,e=>e>0);let eB=(0,r.P1)(i.W$,e=>null===u.To||void 0===u.To?void 0:u.To[h.bV[e]||"anonymousGroup"]),ez=(0,r.P1)(es,e=>{var t;return(null==e?void 0:null===(t=e.vocabularyItems)||void 0===t?void 0:t.length)>0});(0,r.P1)(eq,ez,(e,t)=>e||t),(0,r.P1)(el,e=>e.some(e=>"youtubeVideo"===e.type)),(0,r.P1)(el,e=>e.lessonEditor.selectedUnitId,(e,t)=>e.find(e=>e.id===t)||null),(0,r.P1)(H,ei,i.c7,(e,t,n)=>e&&t!==n),(0,r.P1)(ei,i.c7,eu,i.oB,(e,t,n,r)=>!!e&&e!==t&&n===r);let eV=(0,r.P1)(ed,e=>e.selectedVersionId||"");(0,r.P1)(ed,eV,(e,t)=>{var n;return(null==e?void 0:null===(n=e.versions)||void 0===n?void 0:n.find(e=>e.id===t))||l.I8});let eG=(0,r.P1)(i.dy,e=>(null==e?void 0:e.monthlyLessonGenerationCount)||0),eW=(0,r.P1)(i.W$,e=>null===u.E9||void 0===u.E9?void 0:u.E9[h.bV[e]||"anonymousGroup"]),eH=(0,r.P1)(i.LN,eG,eW,(e,t,n)=>e||t<n);(0,r.P1)(W,e=>({lessonId:e})),(0,r.P1)(i.W$,e=>u.gJ[h.bV[e]||"anonymous"]);let eK=(0,r.P1)(el,e=>e.filter(e=>"quiz"===e.type&&e.questions.some(e=>d.includes(e.variation))));(0,r.P1)(eK,e=>e.length>0),(0,r.P1)(e=>e.lessonEditor.isAnswerKeyEnabled,eK,(e,t)=>e&&t.length>0),(0,r.P1)(e=>(0,i.W2)("unlimitedSections",!1,[(0,c.Ce)([])])(e),i.LN,e$,eB,(e,t,n,r)=>e||t||n<r);let eJ=e=>!(0,i.Qb)(e)&&e.lessonEditor.isReferredFromPlugin,eX=(0,r.zB)({userId:i.c7,userType:i.W$,lessonId:W});(0,r.P1)(i.oB,eu,(e,t)=>!!e&&e===t);let eQ=(0,r.P1)(el,e=>e.filter(e=>"quiz"===e.type));(0,r.P1)(eQ,e=>e.reduce((e,t)=>[...e,...t.questions],f.LZ)),(0,r.P1)(e=>e.lessonEditor.lessonCreatorTextView,e=>"confirmed"===e),(0,r.P1)(i.LN,x,(e,t)=>e?{voice:t}:{}),(0,r.P1)(x,e=>{var t;return(null===(t=_(e))||void 0===t?void 0:t.ssmlEnabled)||!1});let eZ=e=>e.lessonEditor.unitContentInitializer;(0,r.P1)(eZ,e=>e?e.view:null),(0,r.P1)(eZ,e=>(null==e?void 0:e.unitId)||"");let eY=e=>e.lessonEditor.lessonContentInitializer;(0,r.P1)(eY,e=>e?e.view:null),(0,r.P1)(eY,e=>(null==e?void 0:e.insertionIndex)||0),(0,r.P1)(eY,e=>(null==e?void 0:e.shouldResetLessonOnCancel)||!1);let e0=e=>e.lessonEditor.suggestions,e1=(0,r.P1)(e0,e=>e.length>0);(0,r.P1)(e1,K,eP,(e,t,n)=>e&&!t&&n),(0,r.P1)(e0,e=>e[0]||null)},31935:function(e,t,n){"use strict";n.d(t,{G7:function(){return f},P6:function(){return l},Ql:function(){return h},Ry:function(){return d},sI:function(){return c}});var r=n(99846),i=n(15661),o=n(19781),s=n(31514),a=n(13247),u=n(94);let l=async(e,t)=>{try{return await (0,o.bo)("lessons",e,{...t,createdAt:(0,a.Bt)(),updatedAt:(0,a.Bt)(),id:e}),{lesson:t,error:""}}catch(e){return console.error("Failed to create lesson",e),(0,r.XY)("firestoreRequestFailed",{error:e}),{lesson:null,error:JSON.stringify(e)}}},c=async e=>{if(!i.mz)return{success:!1,error:"Firestore is not initialized",newSaveKey:""};let{update:t,lessonId:n,saveNewKey:o}=e,u={};Object.keys(t).forEach(e=>{"createdAt"!==e&&"updatedAt"!==e&&(u[e]=t[e])});let l=(0,s.Ox)();o&&(u.saveKey=l);try{return(0,a.r7)((0,a.JU)(i.mz,"lessons",n),{...u,updatedAt:(0,a.Bt)()}),{success:!0,newSaveKey:l,error:""}}catch(e){return console.error("Failed to update lesson",e),(0,r.XY)("firestoreRequestFailed",{error:e}),{success:!1,newSaveKey:"",error:JSON.stringify(e)}}},d=async e=>{if(!i.mz)return{id:"",error:"Firestore is not initialized"};try{return await (0,a.oe)((0,a.JU)(i.mz,"lessons",e)),{id:e,error:""}}catch(e){return console.error("Failed to delete lesson",e),(0,r.XY)("firestoreRequestFailed",{error:e}),{id:"",error:JSON.stringify(e)}}},h=async e=>{if(!i.mz)return[];try{let t=(0,a.IO)((0,a.hJ)(i.mz,"lessons"),(0,a.ar)("authorId","==",e)),n=await (0,a.PL)(t),r=[];return n.forEach(e=>{r.push({...(0,u.f4)(e.data()),id:e.id})}),r}catch(t){return console.error("Failed to fetch lessons for ".concat(e),t),[]}},f=async e=>{if(!i.mz)return{error:"Firestore is not initialized",lesson:null};try{let t=(0,a.JU)(i.mz,"lessons",e),n=await (0,a.QT)(t);if(n.exists())return{error:"",lesson:(0,u.f4)(n.data())};return{error:"We couldn't find this lesson.",lesson:null}}catch(t){return console.error("Failed to fetch activity ".concat(e),t),{error:(0,s.Qj)(t,"We couldn't find this lesson."),lesson:null}}}},94:function(e,t,n){"use strict";n.d(t,{R6:function(){return M},wq:function(){return j},bs:function(){return S},hj:function(){return D},x6:function(){return P},UG:function(){return c},f4:function(){return f},ld:function(){return O},Cs:function(){return V},Po:function(){return U},o4:function(){return L},jY:function(){return F},kt:function(){return m},pe:function(){return z},Z$:function(){return g},MT:function(){return R},Fc:function(){return $},iW:function(){return N}});var r=n(31514),i=n(96486),o=n.n(i);let s={id:"1",type:"cta",title:"CTA Unit",text:"Create your own lesson with audio",path:"/lessons",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),ctaKey:"lessonAudio"};var a=n(15384);let u={rows:[{height:40,cells:[{content:"",colSpan:1,isBold:!0,hasBackground:!0,width:240},{content:"Meets Criteria",colSpan:1,isBold:!0,hasBackground:!0,width:160},{content:"Almost Meets Criteria",colSpan:1,isBold:!0,hasBackground:!0,width:160},{content:"Does Not Meet Criteria",colSpan:1,isBold:!0,hasBackground:!0,width:160}]},{height:40,cells:[{content:"Skill 1",colSpan:1,width:160,isBold:!1,hasBackground:!1},{content:"",colSpan:1,width:160,isBold:!1,hasBackground:!1},{content:"",colSpan:1,width:160,isBold:!1,hasBackground:!1},{content:"",colSpan:1,width:160,isBold:!1,hasBackground:!1}]},{height:40,cells:[{content:"Skill 2",colSpan:1,width:160,isBold:!1,hasBackground:!1},{content:"",colSpan:1,width:160,isBold:!1,hasBackground:!1},{content:"",colSpan:1,width:160,isBold:!1,hasBackground:!1},{content:"",colSpan:1,width:160,isBold:!1,hasBackground:!1}]},{height:40,cells:[{content:"Skill 3",colSpan:1,width:160,isBold:!1,hasBackground:!1},{content:"",colSpan:1,width:160,isBold:!1,hasBackground:!1},{content:"",colSpan:1,width:160,isBold:!1,hasBackground:!1},{content:"",colSpan:1,width:160,isBold:!1,hasBackground:!1}]}]};var l=n(49636);let c=e=>e?"string"==typeof e?e:e&&"object"==typeof e&&"toDate"in e?e.toDate().toISOString():new Date().toISOString():"",d=e=>({...e,createdAt:c(e.createdAt),updatedAt:c(e.updatedAt)}),h=e=>e?{...e,createdAt:c(e.createdAt)}:null,f=e=>({id:e.id,title:e.title,description:e.description,authorId:e.authorId,visibility:e.visibility,teamId:e.teamId,targetLevel:e.targetLevel||"",units:(e.units||[]).map(d),updatedAt:c(e.updatedAt),createdAt:c(e.createdAt),language:(null==e?void 0:e.language)||"en",standard:(null==e?void 0:e.standard)||"cefr",saveKey:e.saveKey||"",h5pSaveKey:e.h5pSaveKey||"",showH5pUrl:e.showH5pUrl||!1,h5pUrl:e.h5pUrl||"",details:e.details||{},taskId:e.taskId||"",lessonStyles:e.lessonStyles||{},statusUpdate:h(e.statusUpdate),template:(null==e?void 0:e.template)||null}),p=()=>({id:(0,r.Ox)(),title:"",type:"text",createdAt:new Date().toString(),updatedAt:new Date().toString(),isHidden:!1}),g=e=>e.filter(e=>"text"===e.type),m=e=>e.find(e=>"text"===e.type)||null,y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:(0,r.Ox)(),title:"",description:"",text:"Text Unit Text",textStats:{},audioUrl:"",markdown:"",...e}},v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return y({text:t}),{...p(),type:"text",title:"",selectedVersionId:"",sourceUrl:"",text:t,markdown:"",audioUrl:"",hideText:!1,...e}},_=e=>(0,r.Sy)(e.map(e=>e.id)),b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vocabularyItems||[];return{...p(),type:"vocabulary",title:"",vocabularyItems:[],shuffledTermsOrder:_(t),shuffledDefinitionsOrder:_(t),shuffled:!0,matchingExerciseVariation:"none",...e}},w=e=>({...p(),type:"youtubeVideo",title:"",sourceUrl:"",...e}),S=e=>({...p(),type:"slide",text:"",sourceUrl:"",imagePrompt:"",translation:null,audioUrl:"",...e}),E=e=>({...p(),type:"quiz",variation:null,questions:[],instructions:null,...e}),k=e=>({...p(),...s,...e,type:"cta"}),I=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{...p(),...e,title:"",description:"",lines:[],speakers:[],type:"dialogue",hideText:!1}},T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{...p(),type:"table",data:u,...e}},x=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{...p(),type:"canvas",html:"",title:"",description:"",...e}},C=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e){case"text":return v(t,(null==t?void 0:t.text)||"");case"vocabulary":return b(t);case"youtubeVideo":return w(t);case"slide":return S(t);case"quiz":return E(t);case"cta":return k(t);case"dialogue":return I(t);case"table":return T(t);case"canvas":return x(t);default:return v(t)}},A=e=>{let t={...o().cloneDeep(e),id:(0,r.Ox)()},n=e=>{if(!e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(e=>n(e));let t={...e};return Object.keys(t).forEach(e=>{"audioUrl"===e||"imageUrl"===e||"src"===e?t[e].includes("avatar")||(t[e]=""):t[e]=n(t[e])}),t};return n(t)},O=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(0,r.Sy)((e||l.LZ).map(e=>"".concat(e.term,": ").concat(e.definition)))},N=(e,t)=>{let{id:n,updatedProps:r}=t;e.units.find(e=>e.id===n)&&(e.units=e.units.map(e=>e.id===n?{...e,...r}:e))},R=(e,t)=>{let{id:n,direction:r}=t,i=e.units.findIndex(e=>e.id===n);if(-1===i)return;let o=e.units[i],s=e.units[i+("up"===r?-1:1)];return e.units[i]=s,e.units[i+("up"===r?-1:1)]=o,e},D=(e,t)=>{e.units=e.units.filter(e=>e.id!==t),e.outputContent={text:"",markdown:"",html:""}},P=(e,t)=>{let n=e.units.findIndex(e=>e.id===t);if(-1===n){console.error("Unit not found");return}let r=e.units[n];if(a.MK.includes(null==r?void 0:r.type)){console.error("Unit type is unique. Cannot duplicate");return}let i=A(r);return e.units.splice(n+1,0,i),e.selectedUnitId=i.id,e.elementToScrollIntoViewId=i.id,e},M=(e,t)=>{let{type:n,props:r,index:i}=t,o=C(n,r),{id:s}=o;e.selectedUnitId=s,e.outputContent={text:"",markdown:"",html:""},a.MK.includes(n)&&(e.units=e.units.filter(e=>e.type!==n)),e.units.splice(i,0,o)},L=e=>(null==e?void 0:e.text)||"",U=e=>(null==e?void 0:e.markdown)||"",j=e=>{var t,n;return!!e.text.trim()||!!(null===(t=e.markdown)||void 0===t?void 0:t.trim())||!!(null===(n=e.html)||void 0===n?void 0:n.trim())},q=e=>{var t,n;return!(null==e?void 0:null===(t=e.text)||void 0===t?void 0:t.trim())&&!(null==e?void 0:null===(n=e.markdown)||void 0===n?void 0:n.trim())},F=e=>{let{units:t}=e;if(!t||!t.length)return!0;if(t.length>1)return!1;let[n]=t;return"text"===n.type&&q(n)};function $(e){let t={};return Object.keys(e).forEach(n=>{["createdAt","updatedAt"].includes(n)?t[n]=c(e[n]):t[n]=e[n]}),t}let B=e=>{if("undefined"==typeof document)return"";try{let t=document.createElement("div");return t.innerHTML=e,t.innerText}catch(e){return""}},z=e=>{var t,n;return(null==e?void 0:e.text)||(null==e?void 0:null===(n=e.versions)||void 0===n?void 0:null===(t=n[0])||void 0===t?void 0:t.text)||""},V=e=>B((null==e?void 0:e.html)||"")},75526:function(e,t,n){"use strict";n.d(t,{Ui:function(){return r},WS:function(){return s},ed:function(){return l},hj:function(){return u},mI:function(){return o},rU:function(){return i},zg:function(){return a},zh:function(){return c}});let r="",i="new",o=["en","fr","es","ja"],s=10,a="vocabulary",u="web-page",l=["kanji_to_reading","reading_to_kanji"],c=3},50135:function(e,t,n){"use strict";n.d(t,{Ix:function(){return y},Rv:function(){return f},H6:function(){return s},Qq:function(){return l},P5:function(){return a},d9:function(){return u},Tq:function(){return c},VP:function(){return v},wK:function(){return d}});var r=n(40608),i=n(75526),o=n(97573);let s="https://storage.googleapis.com/roshi-prod.appspot.com/audio/en/the_pierre_elliott_trudeau_foundation_gave_back_a__gift_from_a_chinese_government_adviser_named_zhang_bin_canadian_security_officials_said_that_the_donation_was_linked_to_the_chinese_government.mp3",a={id:"mock-mcq-1",variation:"multiple-choice",prompt:{id:"Which of these is correct?",text:"Which of these is correct?",audioUrl:"",imageUrl:""},choices:[{id:"incorrect choice 1",text:"incorrect choice 1",audioUrl:"",imageUrl:""},{id:"correct choice",text:"correct choice",audioUrl:"",imageUrl:""},{id:"incorrect choice 2",text:"incorrect choice 2",audioUrl:"",imageUrl:""}],correctChoiceId:"correct choice"},u={id:"mock-mcq-1",variation:"multi-select",prompt:{id:"Which of these fits the category? Select all that apply.",text:"Which of these fits the category? Select all that apply.",audioUrl:"",imageUrl:""},choices:[{id:"This one fits",text:"This one fits",audioUrl:"",imageUrl:""},{id:"And this one",text:"And this one",audioUrl:"",imageUrl:""},{id:"But not this one",text:"But not this one",audioUrl:"",imageUrl:""},{id:"Nor this one",text:"Nor this one",audioUrl:"",imageUrl:""}],correctChoiceIds:["This one fits","And this one"]},l={id:"mock-cloze-1",variation:"cloze",prompt:{id:"Fill in the blank.",text:"Fill in the blank.",audioUrl:"",imageUrl:""},clozeText:{id:"mock-cloze-text-1",text:"It took several *firefighters* to put out the fire.",audioUrl:"",imageUrl:""}},c={id:"mock-open-1",variation:"open-ended",prompt:{id:"What do you think about the text?",text:"What do you think about the text?",audioUrl:"",imageUrl:""}},d={id:"mock-task",variation:"task",prompt:{id:"Use a telephone directory (print or online) to locate the closest medical clinic.",text:"Use a telephone directory (print or online) to locate the closest medical clinic.",audioUrl:"",imageUrl:""}};["I","apple","app","cook","you","ate","an"].map(o.Xt),["I","ate","an","apple"].map(o.Xt);let h={id:i.Ui,authorId:r.xh,targetLanguage:"en",userLanguage:"en",sourceType:"text",title:"",description:"",sourceUrl:"",youtubeVideoId:"",difficulty:"",questions:[],format:"standard",sourceText:"",contentTheme:"",grammarPoint:"",teamId:"",visibility:"private",sessions:[]},f=(i.rU,r.xh,"https://www.youtube.com/watch?v=5Rmv3nliwCs");(0,o.QV)("en",5).join("\n");let p=(0,o.QV)("fr",5).join("\n"),g=(0,o.QV)("es",5).join("\n"),m=(0,o.QV)("ja",5).join("\n"),y="";(0,o.QV)("fr",5).join("\n"),(0,o.QV)("es",5).join("\n"),(0,o.QV)("ja",5).join("\n"),r.xh,i.rU,r.xh,i.rU,r.xh,i.rU;let v={en:{youtubeVideoUrl:f,webPageUrl:"https://breakingnewsenglish.com/2208/220818-thinking.html",exampleRandomSentences:y,exampleComprehensionText:y},fr:{youtubeVideoUrl:"https://www.youtube.com/watch?v=XNyXNuxsGcI",webPageUrl:"https://www.hww.ca/fr/faune/poissons-amphibiens-reptiles/les-tortues-deau-douce.html",exampleRandomSentences:p,exampleComprehensionText:p},es:{youtubeVideoUrl:"https://www.youtube.com/watch?v=xg484Dg69xM",webPageUrl:"https://www.worldwildlife.org/descubre-wwf/historias/7-datos-interesantes-sobre-las-tortugas-marinas",exampleRandomSentences:g,exampleComprehensionText:g},ja:{youtubeVideoUrl:"https://www.youtube.com/watch?v=iZQWF3Ljkew",webPageUrl:"https://www3.nhk.or.jp/news/easy/k10013341461000/k10013341461000.html",exampleRandomSentences:m,exampleComprehensionText:m}},_=[(0,o.Xt)("Thank you for the supplies."),(0,o.Xt)("Where can I find school supplies?"),(0,o.Xt)("Where is the school?")],b=[(0,o.Xt)("What about electronics?"),(0,o.Xt)("What are electronics?"),(0,o.Xt)("Are those electronics?")],w=[(0,o.Xt)("You're welcome"),(0,o.Xt)("Excuse me"),(0,o.Xt)("Thank you!")];i.rU,r.xh,(0,o.Xt)("Hey, how can I help you"),_[1].id,(0,o.Xt)("Those are just over in aisle 3."),b[0].id,(0,o.Xt)("The electronics are just upstairs"),w[2].id,(e=>{let[t,,n]=e.replace(/(>|<)/gi,"").split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);return void 0!==n?n.split(/[^0-9a-z_-]/i)[0]:t})(f)},97573:function(e,t,n){"use strict";n.d(t,{Xt:function(){return s},QV:function(){return a},gh:function(){return o}});var r=JSON.parse('{"en":["Let\'s try something.","I\'m at a loss for words.","This is never going to end.","I just don\'t know what to say.","I was in the mountains.","You\'re in better shape than I am.","You are in my way.","That won\'t happen.","I suppose it\'s different when you think about it over the long term.","I always liked mysterious characters more.","You should sleep.","I told them to send me another ticket.","I can\'t live that kind of life.","The last person I told my idea to thought I was nuts.","It is unfortunately true.","They are too busy fighting against each other to care for common ideals.","Most people think I\'m crazy.","No I\'m not; you are!","That\'s MY line!","He\'s kicking me!","Then there is a problem...","It doesn\'t surprise me.","For some reason I feel more alive at night.","It depends on the context.","Are you freaking kidding me?!","That\'s the stupidest thing I\'ve ever said.","I don\'t want to be lame; I want to be cool!!","When I grow up, I want to be a king.","America is a lovely place to be, if you are here to earn money.","I\'m so fat.","I\'m gonna shoot him.","I\'m just saying!","That was probably what influenced their decision.","I\'ve always wondered what it\'d be like to have siblings.","This is what I would have said.","It would take forever for me to explain everything.","That\'s because you\'re a girl.","Sometimes I can\'t help showing emotions.","It\'s a word I\'d like to find a substitute for.","It would be something I\'d have to program.","I don\'t intend to be selfish.","Let\'s consider the worst that could happen.","I think it is best not to be impolite.","I\'d be unhappy, but I wouldn\'t kill myself.","Back in high school, I got up at 6 a.m. every morning.","When I woke up, I was sad.","That is somewhat explained at the end.","I thought you liked to learn new things.","Most people write about their daily life.","If I could send you a marshmallow, Trang, I would.","In order to do that, you have to take risks.","Every person who is alone is alone because they are afraid of others.","Why do you ask?","I am not an artist. I never had the knack for it.","I can\'t tell her now. It\'s not that simple anymore.","I am a flawed person, but these are flaws that can easily be fixed.","How long did you stay?","Maybe it will be exactly the same for him.","Humans were never meant to live forever.","I think I have a theory about that.","That is intriguing.","This is not important.","I didn\'t like it.","She\'s asking how that\'s possible.","You\'re just running away from life\'s problems.","If you look at the lyrics, they don\'t really mean much.","There\'s a problem there that you don\'t see.","I wish I could go to Japan.","After that, I left, but then I realized that I forgot my backpack at their house.","I won\'t ask you anything else today.","It may freeze next week.","Even though he apologized, I\'m still furious.","Thanks for having explained to me at last why people take me for an idiot.","That wasn\'t my intention.","Thanks for your explanation.","Theoretically, I\'m doing math.","It almost scared me not to see you online for a whole day.","I don\'t know what you mean.","You wanted to tell me about freedom?","If I wanted to scare you, I would tell you what I dreamt about a few weeks ago.","One can\'t expect everything from schools.","There are many words that I don\'t understand.","I don\'t like it when mathematicians who know much more than I do can\'t express themselves explicitly.","You\'re really not stupid.","I need to ask you a silly question.","I don\'t know how to demonstrate it, since it\'s too obvious!","I wouldn\'t have thought I would someday look up \\"Viagra\\" in Wikipedia.","Can it be phrased in another way?","No one will know.","I found a solution, but I found it so fast that it can\'t be the right solution.","It seems interesting to me.","I like candlelight.","What did you answer?","It\'s too bad that I don\'t need to lose weight.","You never have class or what?!","I will play Sudoku then instead of continuing to bother you.","Where is the problem?","I don\'t like you anymore.","Congratulations!","I don\'t want to wait that long.","I shouldn\'t have logged off.","I don\'t know what to do anymore.","I hate chemistry.","I didn\'t want this to happen.","You can probably guess what happens though.","Next thing you know, you\'ll be in the papers.","What other options do I have?","I can\'t explain it either.","How could I be a robot? Robots don\'t dream.","It\'s not something anyone can do.","I don\'t know if I still have it.","What do you think I\'ve been doing?","Don\'t underestimate my power.","My mom doesn\'t speak English very well.","I don\'t speak French well enough!","I was wondering if you were going to show up today.","Therein lies the problem.","How do you find food in outer space?","All you can do is trust one another.","Everyone wants to meet you. You\'re famous!","Why are you sorry for something you haven\'t done?","I utterly despise formal writing!","Whatever I do, she says I can do better.","You\'re not fast enough.","Life is hard, but I am harder.","Stop it! You\'re making her feel uncomfortable!","Nothing is beautiful but the truth.","I don\'t speak Japanese.","Nobody understands me.","I learned to live without her.","It\'s useless to keep on thinking any more.","I just wanted to check my email.","You can\'t expect me to always think of everything!","I suppose that behind each thing we have to do, there\'s something we want to do...","You really don\'t have the right priorities!","Don\'t expect others to think for you!","You never have time for important things!","It\'s no use pretending to make me believe that I believe things you don\'t believe!","It would take me too much time to explain to you why it\'s not going to work.","I\'m so dumb... I\'m trying to explain things to you that I don\'t understand myself.","Stop seeing me as a \\"normal\\" person!","Are you referring to me?","It can\'t be!","I wish I could care more about my grades but it seems that, at a certain point of my life, I decided they wouldn\'t be so important anymore.","A rolling stone gathers no moss is a proverb.","Would you like something to drink?","Who is it? \\"It\'s your mother.\\"","When will you be back? \\"It all depends on the weather.\\"","What\'s the matter? asked the little white rabbit.","What\'s going on in the cave? I\'m curious. \\"I have no idea.\\"","Uh... How\'s that working?","To tell you the truth, I am scared of heights. \\"You are a coward!\\"","This is what I was looking for! he exclaimed.","This looks pretty interesting, Hiroshi says.","Their communication may be much more complex than we thought.","Someday I\'ll run like the wind.","She likes music. \\"So do I.\\"","Please don\'t cry.","Let me know if there is anything I can do.","It is up to you to decide whether we will go there or not.","Class doesn\'t begin until eight-thirty.","I want a boat that will take me far away from here.","I feel like playing cards. \\"So do I.\\"","Haven\'t we met somewhere before? asked the student.","The archer killed the deer.","Communism will never be reached in my lifetime.","Rye was called the grain of poverty.","In the 1950\'s, the Finns were cited as having one of the least healthy diets in the world.","If you see a mistake, then please correct it.","Place the deck of cards on the oaken table."],"fr":["Lorsqu\'il a demand\xe9 qui avait cass\xe9 la fen\xeatre, tous les gar\xe7ons ont pris un air innocent.","Pour une fois dans ma vie je fais un bon geste... Et \xe7a ne sert \xe0 rien.","Qu\'est-ce que c\'est ?","Joyeux anniversaire Muiriel !","C’\xe9tait un m\xe9chant lapin.","Je ne peux pas vivre comme \xe7a.","Je ne fais que parler !","Quand je me suis r\xe9veill\xe9 j\'\xe9tais triste.","C’est ce qui est expliqu\xe9 \xe0 la fin.","Pourquoi demandes-tu ?","Je ne peux pas lui dire maintenant. Ce n’est pas si simple.","Combien de temps es-tu rest\xe9e ?","Je n’ai pas de compte sur ces forums.","Je n\'ai pas aim\xe9.","Elle demande comment c’est possible.","Je d\xe9teste \xe7a quand il y a trop de gens.","Il faut bien que mon ordinateur me serve \xe0 quelque chose.","Je dois te poser une question idiote.","J\'aurais pas imagin\xe9 qu\'un jour j\'irais chercher \xab viagra \xbb dans Wikip\xe9dia.","Je ne t\'aime plus.","Je n\'aurais pas d\xfb me d\xe9connecter.","Tu devines probablement ce qui va arriver.","Quelles autres options ai-je ?","Tu serais surprise de ce que tu peux apprendre en une semaine.","La vie est dure, mais je suis encore plus dur.","Supporter peut \xeatre insupportable.","Arr\xeate ! Tu la mets mal \xe0 l\'aise !","Rien n\'est beau que le vrai.","Demain, il va alunir.","C’est un jeu de mots.","Personne ne me comprend.","J\'ai appris \xe0 vivre sans elle.","\xc7a ne sert plus \xe0 rien de continuer \xe0 r\xe9fl\xe9chir.","J\'ai trop de choses dans la t\xeate ces jours-ci.","Je voulais juste v\xe9rifier mes emails.","Tu peux pas attendre de moi que je pense toujours \xe0 tout !","Je suppose que derri\xe8re chaque chose que l\'on doit faire, il y a quelque chose que l\'on veut faire...","T\'as vraiment pas les bonnes priorit\xe9s !","N\'attends pas que les autres pensent pour toi !","Tu n\'as jamais le temps pour les choses importantes !","Ce n\'est pas la peine de faire semblant de me faire croire que je crois des choses que tu ne crois pas !","\xc7a me prendrait trop de temps pour t\'expliquer pourquoi \xe7a ne va pas marcher.","Je suis trop b\xeate... J\'essaie de t\'expliquer des choses que je ne comprends pas moi-m\xeame.","Arr\xeate de me consid\xe9rer comme quelqu\'un de \xab\xa0normal\xa0\xbb\xa0!","Tu pourrais au moins essayer d\'\xeatre un peu plus poli, m\xeame si ce n\'est pas dans ta nature.","Il y aura toujours des choses que je n\'apprendrai jamais, je n\'ai pas l\'\xe9ternit\xe9 devant moi !","C\'est pas possible !","\xab\xa0Pierre qui roule n\'amasse pas mousse\xa0\xbb est un proverbe.","Veux-tu quelque chose \xe0 boire ?","\xab Qui est-ce ? \xbb \xab C\'est ta m\xe8re. \xbb","\xab Quand vas-tu revenir ? \xbb \xab Tout d\xe9pend du temps qu\'il fera. \xbb","\xab Qu\'est-ce qu\'il se passe dans la grotte ? Je suis curieux. \xbb \xab Je n\'en ai aucune id\xe9e. \xbb","Nous devons apprendre \xe0 vivre ensemble comme des fr\xe8res, ou nous p\xe9rirons ensemble comme des idiots.","Euh... Comment \xe7a marche ?","\xab Pour \xeatre franc, j\'ai le vertige. \xbb \xab Tu es un trouillard ! \xbb","\xab Fais-moi confiance \xbb, dit-il.","\xab C\'est ce que j\'\xe9tais en train de chercher \xbb, s\'exclama-t-il.","\xab \xc7a semble tr\xe8s int\xe9ressant \xbb, dit Hiroshi.","Il se peut que leur communication soit beaucoup plus complexe que nous le pensions.","\xab Le t\xe9l\xe9phone sonne. \xbb \xab Je vais r\xe9pondre. \xbb","\xab\xa0C\'est tr\xe8s gentil de votre part\xa0\xbb, r\xe9pondit Willie.","\xab Merci de m\'aider. \xbb \xab Il n\'y a pas de quoi.\xa0\xbb","Un jour je courrai comme le vent.","\xab Elle aime la musique. \xbb \xab Moi aussi. \xbb","S\'il te pla\xeet, ne pleure pas.","Fais-moi savoir s\'il y a quoi que ce soit que je puisse faire.","C\'est \xe0 toi de d\xe9cider si nous allons l\xe0-bas ou non.","\xc7a ne commence pas avant huit heures trente."],"es":["\xa1Intentemos algo!","Tengo que irme a dormir.","\xbfQu\xe9 est\xe1s haciendo?","\xa1Hoy es 18 de junio y es el cumplea\xf1os de Muiriel!","\xa1Feliz cumplea\xf1os, Muiriel!","Ahora, Muiriel tiene 20 a\xf1os.","La contrase\xf1a es \\"Muiriel\\".","Volver\xe9 pronto.","No tengo palabras.","Esto no acabar\xe1 nunca.","Simplemente no s\xe9 qu\xe9 decir...","Era un conejo malo.","\xbfEs una foto reciente?","No s\xe9 si tengo tiempo.","Por alguna raz\xf3n, el micr\xf3fono no hab\xeda funcionado hasta entonces.","Todo el mundo debe aprender por s\xed mismo al final.","La educaci\xf3n en este mundo me decepciona.","El aprendizaje no debe ser forzado, sino estimulado.","Es una tarea dif\xedcil elegir qu\xe9 est\xe1 \\"bien\\" o \\"mal\\", pero has de hacerlo.","Eso no va a cambiar nada.","Eso va a costar 30 €.","Gano 100 € al d\xeda.","Quiz\xe1s me d\xe9 pronto por vencido y en lugar de eso me eche una siesta.","Eso es porque no quieres estar solo.","Eso no va a pasar.","A veces \xe9l puede ser un chico raro.","Me voy a esforzar por no molestarte en tus estudios.","No te preocupes.","Los llamar\xe9 cuando regrese ma\xf1ana.","Siempre me gustaron m\xe1s los personajes misteriosos.","Deber\xedas dormir.","Les dije que me mandaran otro boleto.","Eres tan impaciente conmigo.","No puedo vivir as\xed.","Una vez quise ser astrof\xedsico.","Nunca me gust\xf3 la biolog\xeda.","La \xfaltima persona a la que le cont\xe9 mi idea pens\xf3 que yo estaba loco.","Desafortunadamente es verdad.","Est\xe1n muy ocupados pele\xe1ndose entre ellos, como para preocuparse por los ideales comunes.","La mayor\xeda de la gente cree que estoy loco.","\xa1No, no lo soy! \xa1Lo eres t\xfa!","\xa1Esa es mi frase!","\xbfEst\xe1s seguro?","Entonces tenemos un problema...","\xa1Ah, all\xed hay una mariposa!","\xa1Date prisa!","No me sorprende.","Si yo pudiera ser as\xed...","Por alguna raz\xf3n, me siento m\xe1s vivo por la noche.","Eso depende del contexto.","\xa1\xbfAcaso te quieres burlar de m\xed?!","Es la cosa m\xe1s est\xfapida que he dicho nunca.","\xa1\xa1No quiero ser pat\xe9tico, quiero ser guay!!","Cuando crezca, quiero ser un rey.","Estoy tan gordo.","\xbfEntonces qu\xe9?","Voy a pegarle un tiro.","No soy un pez de verdad, s\xf3lo soy un peluche.","\xa1Yo s\xf3lo lo digo!","Eso fue probablemente lo que influenci\xf3 su decisi\xf3n.","Siempre me he preguntado c\xf3mo ser\xe1 tener hermanos.","Esto es lo que yo habr\xeda dicho.","Eso es porque eres una chica.","Algunas veces no puedo evitar mostrar mis sentimientos.","Pensemos en lo peor que podr\xeda pasar.","\xbfCu\xe1ntos amigos \xedntimos tienes?","Yo puedo ser antisocial, pero eso no significa que no hable con la gente.","As\xed ha sido siempre.","Creo que lo mejor es no ser maleducado.","Uno siempre puede encontrar tiempo.","Cuando yo estaba en el instituto me levantaba a las 6 todas las ma\xf1anas.","Cuando me despert\xe9 estaba triste.","Por fin est\xe1 m\xe1s o menos explicado.","Si pudiera enviarte un malvavisco, Trang, lo har\xeda.","Para hacer eso, tienes que arriesgarte.","Todas las personas que est\xe1n solas, est\xe1n solas porque tienen miedo de los dem\xe1s.","\xbfPor qu\xe9 lo preguntas?","No puedo dec\xedrselo ahora. Ya no es tan simple.","Soy una persona que tiene muchos defectos, pero esos defectos pueden ser corregidos f\xe1cilmente.","\xbfCu\xe1nto tiempo estuviste?","Quiz\xe1s sea lo mismo para \xe9l.","La inocencia es una cosa hermosa.","No quiero perder mis ideas, aunque algunas de ellas sean un poco extremas.","Eso es intrigante.","\xbfQuieres decir que ocultas intencionalmente tu belleza?","Yo no tengo una cuenta en estos foros.","No sab\xeda de d\xf3nde ven\xeda eso.","No es importante.","T\xfa simplemente huyes de los problemas de la vida.","Hay un problema que no ves.","\xa1Puedes hacerlo!","A mi profesor de f\xedsica no le importa si me salto las clases.","Deseo poder ir a Jap\xf3n.","Odio cuando hay mucha gente.","Me tengo que ir a la cama.","No te preguntar\xe9 m\xe1s por hoy.","La polic\xeda te har\xe1 encontrar las balas.","Gracias por explicarme por fin por qu\xe9 la gente me toma por un idiota.","No era mi intenci\xf3n.","Gracias por tu explicaci\xf3n.","\xbfQu\xe9 ocurri\xf3?","No s\xe9 qu\xe9 quieres decir.","Mi ordenador tiene que ser \xfatil para algo.","\xbfQuer\xedas hablarme de libertad?","Si yo quisiera asustarte, te contar\xeda qu\xe9 fue lo que so\xf1\xe9 hace un par de semanas.","Uno no puede esperarse todo de los colegios.","Hay muchas palabras que no entiendo.","No me gusta cuando matem\xe1ticos que saben mucho m\xe1s que yo no pueden expresarse con claridad.","Necesito hacerte una pregunta tonta.","\xa1No s\xe9 c\xf3mo demostrarlo, ya que es tan evidente!","\xbfSe puede expresar de otra manera?","Nadie sabr\xe1.","Encontr\xe9 una soluci\xf3n, pero la encontr\xe9 tan r\xe1pido que no puede ser la correcta.","Salvo que aqu\xed no es tan simple.","Me gusta la luz de las velas.","\xbfQu\xe9 has respondido?","No, no es mi nuevo novio.","Es una l\xe1stima que yo no tenga que adelgazar.","\xa1\xbfNunca tienes clases o qu\xe9?!","Entonces voy a hacer un sudoku en vez de seguir molest\xe1ndote.","\xbfD\xf3nde est\xe1 el problema?","S\xf3lo puedo esperar.","Te quiero.","Ya no te quiero.","Tengo curiosidad.","\xa1Felicidades!","No quiero esperar tanto tiempo.","\xbfPor qu\xe9 no vienes a visitarnos?","Ya no s\xe9 qu\xe9 hacer.","Detesto la qu\xedmica.","Yo no quer\xeda que pasase esto.","Antes de que te des cuenta, saldr\xe1s en los peri\xf3dicos.","\xbfQu\xe9 otras opciones tengo?","No tengo nada mejor que hacer.","Tampoco lo puedo explicar.","Eso s\xf3lo muestra que no eres un robot.","\xbfC\xf3mo podr\xeda ser yo un robot? Si los robots no sue\xf1an.","No es algo que pueda hacer cualquiera.","No s\xe9 si todav\xeda lo tengo.","\xbfQu\xe9 piensas que estaba haciendo?","No subestimes mi poder.","Mi mam\xe1 no habla muy bien ingl\xe9s.","\xa1No hablo franc\xe9s lo suficientemente bien!","Me estaba preguntando si vendr\xedas hoy.","Ah\xed radica el problema.","\xbfC\xf3mo encuentras comida en el espacio?","Todos quieren conocerte. \xa1Eres famoso!","\xbfPor qu\xe9 lamentas algo que no has hecho?","\xa1Aborrezco profundamente la escritura formal!","La gente extranjera me intriga.","Cualquier cosa que hago, ella dice que puedo hacerlo mejor.","\xbfQu\xe9 te mantiene despierto hasta tan tarde?","Te sorprender\xeda lo que puedes aprender en una semana.","No tengo a nadie que viaje conmigo.","La vida es dura, pero yo soy m\xe1s duro.","\xa1Para ya! \xa1La est\xe1s haciendo sentir inc\xf3moda!","S\xf3lo la verdad es bella.","Ma\xf1ana, alunizar\xe1.","No hablo japon\xe9s.","Es un juego de palabras.","Nadie me entiende.","Aprend\xed a vivir sin ella.","No servir\xe1 de nada seguir pensando.","Tengo demasiadas cosas en la cabeza estos d\xedas.","\xbfRealmente necesitas preguntar para saber la respuesta?","\xa1No puedes esperar de m\xed que yo siempre piense en todo!","Supongo que detr\xe1s de cada cosa que tenemos que hacer, hay algo que queremos hacer...","\xa1No esperes que los dem\xe1s piensen por ti!","\xa1Nunca tienes tiempo para las cosas importantes!","\xa1No vale la pena que hagas como que me haces creer que creo cosas que t\xfa no crees!","Me llevar\xeda demasiado tiempo explicarte por qu\xe9 no va a funcionar.","Soy tan tonto... estoy intentando explicarte cosas que no entiendo ni yo.","\xa1Deja de mirarme como una persona \\"normal\\"!","Siempre habr\xe1 cosas que nunca aprender\xe9, \xa1no tengo toda la eternidad ante m\xed!","\xa1No puede ser!","\xbfTe gustar\xeda beber algo?","\xbfQui\xe9n es? \\"Es tu madre.\\"","—\xbfQu\xe9 pasa? —pregunt\xf3 el peque\xf1o conejo blanco.","\xbfQu\xe9 habr\xe1 en la cueva? Tengo curiosidad. \\"No tengo ni idea.\\"","—\xbfCu\xe1l es tu deseo? —pregunt\xf3 el peque\xf1o conejo blanco.","A decir verdad, tengo v\xe9rtigo. \\"\xa1Eres un cobarde!\\"","—\xa1Esto es lo que estaba buscando! —exclam\xf3 \xe9l.","—Esto parece muy interesante —dice Hiroshi.","El tel\xe9fono est\xe1 sonando. \\"Yo lo coger\xe9.\\"","Gracias por ayudarme. \\"No hay de qu\xe9.\\"","Alg\xfan d\xeda correr\xe9 como el viento.","A ella le gusta la m\xfasica. \\"A m\xed tambi\xe9n.\\"","Por favor, no llores.","Hazme saber si hay algo que yo pueda hacer.","Depende de ti decidir si vamos all\xed o no.","Quiero un barco que me lleve lejos de aqu\xed.","Tengo ganas de jugar a las cartas. \\"Yo tambi\xe9n.\\"","Un japon\xe9s nunca har\xeda tal cosa.","Allen es un poeta.","El arquero mat\xf3 al ciervo.","Si ves un error, entonces corr\xedgelo, por favor.","Los alemanes son muy listos.","Si no comes, te mueres.","\xbfC\xf3mo se escribe \\"pretty\\"?","\xbfPor qu\xe9 no nos vamos a casa?","Lo siento, no puedo quedarme mucho tiempo."],"ja":["お誕生日おめでとうムーリエル！","パスワードは「Muiriel」です。","すぐに戻ります。","知らない。","何と言ったら良いか分かりません。","きりがない。","何と言ったらいいか・・・。","私は山にいました。","時間があるか分かりません。","先程、どういうわけかマイクが入りませんでした。","私は一日に100ユーロ稼ぎます。","すぐに諦めて昼寝をするかも知れない。","それはあなたが一人になりたくないからです。","そんなことは起きないでしょう。","彼は時々変です。","あなたの勉強を邪魔しないようにします。","長い目で見れば違ってくると思います。","会えなくて淋しい。","明日帰ったら電話します。","私はいつも不思議な性格の方が好きだった。","眠った方がいいよ。","行くよ。","私は彼らにチケットをもう一枚送ってくれるように頼んだ。","君は僕にとてもいらいらしている。","私はそんな風には生きられない。","私は一時期、天体物理学者になりたかった。","生物学は好きになれません。","僕が最後に自分の考えを伝えた人は、僕を気違いだと思ったようだ。","残念ながらそれは本当なのです。","大抵の人は僕を気違いだと思っている。","それは私の台詞だよ！","本当？","そうしたらひとつ問題があって・・・。","あ！蝶々がいる！","驚くことではないね。","私はなぜか夜の方が元気だ。","それは文脈による。","冗談でしょ！？","大きくなったら王様になりたい。","お金を稼ぎたいならアメリカが一番だ。","僕はすごく太ってる。","だから何？","こらしめてやる。","言ってみただけだよ！","それで彼らの気が変わったのかも知れない。","兄弟がいるとどんなだろうといつも思う。","私ならそう言っただろうと思う。","いつまでかかっても全部を説明するのは無理だ。","あなたが女の子だからよ。","時々感情が抑えられないことがある。","最悪の場合を考えておこう。","親友は何人いる？","そういうものなんです。","失礼に振舞ったりしないのが一番だと思う。","時間はいくらでも作れる。","高校生の時は毎朝6時に起きていた。","あなたは新しいことを勉強したいのだと思った。","それをするためには危険を冒さなければならない。","孤独な人は、他人を恐れるから一人なのだ。","なんで聞くの？","もう彼女には言えないよ。そんなに単純なことではなくなってきたからね。","傷を付けたのは私だけど、こんなの簡単に直せる傷よ。","欲しいものがみつかると、決まって高いものだ。","どのくらいいたの？","たぶん彼にしてみれば同じことよ。","潔白であることは美しいことだ。","人間は決して永遠には生きられないものだ。","それは面白い。","自分のかっこ良さをわざと隠すということ？","もし誰かにこの話の要点は何かって尋ねられても、私はさっぱりわからないわ。","それがどこから来たのか分からなかった。","僕が君と一緒に住んだことは君の人生観に影響を与えたと思う。","これは重要ではない。","好きにはなれなかった。","君はただ人生の問題から逃げているだけだよ。","歌詞を見てみれば、あまり意味が無いことに気付くでしょう。","君の気付いていない問題がある。","できるよ！","私の物理の先生は授業をサボっても気にしない。","日本へ行けたらいいのに。","人ごみは大嫌い。","今日はもう聞かないよ。","来週には凍るかも知れない。","謝罪はあったにせよ、私はまだ彼に腹を立てている。","警察はあなたに弾丸をみつけさせるでしょう。","そんなつもりではなかったんだ。","説明してくれてありがとう。","何が起きたの？","丸一日オンラインで君を見ないなんてびっくりだよ。","何が言いたいのか分からないなあ。","私のパソコンは何かの役に立つはずだ。","自由について私に話したかったの？","恐い話が聞きたいなら、数週間前に私が見た夢のことを話してあげるよ。","学校に全てを求めることはできない。","分からない言葉がたくさんある。","何か他の言い方はある？","誰にも分からないよ。","面白そう！","だけど、ここではそんなに簡単ではないんです。","私はロウソクの灯りって好きだな。","何て答えたの？","違うよ、新しい彼じゃない。","授業が全然無いとでも言うの？！","何が問題なの？","待つしかない。","そんなに驚くことじゃないよね？","愛してる。","もう好きじゃない。","おめでとうございます。","そんなに待ちたくない。","家に来ませんか。","でも可能性は低そうだね。","ログアウトするんじゃなかったよ。","もう何をしたらいいか分からない。","いつかフランスに行くことは避けられない、それがいつかは分からないけれど。","化学が嫌いだ。","こんなことにはなって欲しくなかった。","君には何が起こるか分かるんじゃないかと思うけどね。","君が次に分かることは君が新聞に載るってことだ。","他にどんな選択肢があるの？","僕はそんなに旅行好きではない。","誰にでも長所と短所がある。","でもほんとに、エピソード21には涙が出るほど笑ったよ。","君がロボットではないってことは分かる。","それは誰にでもできるというものではない。","まだ持ってるか分からないなあ。","何をしてたと思う？","私の力を甘く見ないで。","私の母はあまり英語が上手に話せない。","そこに問題がある。","宇宙でどうやって食べ物をみつけるの？","お互いを信頼し合うしかない。","みんなあなたに会いたがってる。あなたは有名なのよ！","してもいないことをどうして謝るの？","外国人って面白いなあ。","何でこんなに遅くまで起きてるの？","一緒に旅行してくれる人がいないんだ。","真実のみが美しい。","明日、彼は月に着陸する。","私は日本語が話せない。","これは駄洒落です。","誰も私のことを分かってくれない。","僕は彼女無しに生きる術を学んだ。","これ以上考えても無駄だ。","最近考えることが多過ぎる。","メールをチェックしたかっただけ。","何でうまくいかないか君に説明するにはずいぶん時間がかかりそうだ。","うまく言えないんだけど・・・自分も理解していないことを君に説明しようとしてるんだ。","私のことを凡人だと思うのはやめて！","もっと成績を気にかけられればいいのだけれど、でも自分の人生のある点において成績はそんなに重要ではないと分かったんだ。","何かお飲みになりますか？","「どなたですか」「お母さんよ」","「どうかしたの？」と小さな白いウサギが聞きました。","はぁ・・・（汗）、それでコンタクトは取れるようになったのかしら・・・？","「実を言うと、俺、高所恐怖症なんだ。」　「臆病者っ！」","「信用して」と彼は言った。","「これが探していたものだ」と彼は叫んだ。","「これはとてもおもしろそうだね」とひろしが言います。","彼らのコミュニケーションは我々が考えてきたものよりはるかに複雑かもしれません。","「電話が鳴っているよ。」　「私が出ます。」","「おっさん、やさしいなー。」ウィリーは言った。","「手伝ってくれてありがとう」「どういたしまして」","またいつか風のように走るんだ。","お願いだから泣かないで。","何か私にできることがありましたらお知らせ下さい。","そこで私たちを待っている幸福が、私たちが望むような幸福ではないかもしれない。","ここから遠くまで行けるボートが欲しいです。","「トランプしたいなあ。」「私も。」","「以前にどこかで会ったことがありませんか」とその学生はたずねた。","日本人ならそんなことはけっしてしないでしょう。","私の生きているうちに共産主義が効力を持つことは無いだろう。","もし間違いを見つけたら訂正してください。","ドイツ人はとてもずる賢い。","人は食事を取らなければ死んでしまう。","「ｐｒｅｔｔｙ」の綴りは？","家に帰りましょうか。","申し訳ないけど長居できないんですよ。","「どうして行かないの？」「行きたくないからだよ。」","１００万人の人々がその戦争で命を落とした。","３年前に東京へ来て以来ここに住んでいる。","１か月あまり名古屋に居たことがある。","あぁ私の白いズボンが！新しいのに。","私が駅を出た時、男の人を見た。","それで誰もあなたを助けなかったの？","君は天使のような人だ！"]}'),i=n(31514);n(75526),n(83640),n(50135);let o=(e,t)=>[...e.filter(e=>e.questionId!==t.questionId),t],s=e=>({id:e,text:e}),a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;try{let n=r[e].filter(e=>e.length>=50);return(0,i.KS)(n,t)}catch(e){return console.error("Failed to get example sentences",e),[]}}},83640:function(e,t,n){"use strict";n.d(t,{GE:function(){return s},w1:function(){return o},xR:function(){return i}});var r=n(49636);let i=!r.XK&&!1,o=!r.XK&&!1,s=!r.ex},40712:function(e,t,n){"use strict";n.d(t,{C:function(){return a},T:function(){return l},i:function(){return o},w:function(){return u}});var r=n(67294),i=n(8417);n(48137),n(27278);var o=!0,s=r.createContext("undefined"!=typeof HTMLElement?(0,i.Z)({key:"css"}):null),a=s.Provider,u=function(e){return(0,r.forwardRef)(function(t,n){return e(t,(0,r.useContext)(s),n)})};o||(u=function(e){return function(t){var n=(0,r.useContext)(s);return null===n?(n=(0,i.Z)({key:"css"}),r.createElement(s.Provider,{value:n},e(t,n))):e(t,n)}});var l=r.createContext({})},81893:function(e,t,n){"use strict";n.d(t,{F4:function(){return c},iv:function(){return l},xB:function(){return u}});var r=n(40712),i=n(67294),o=n(70444),s=n(27278),a=n(48137);n(8417),n(8679);var u=(0,r.w)(function(e,t){var n=e.styles,u=(0,a.O)([n],void 0,i.useContext(r.T));if(!r.i){for(var l,c=u.name,d=u.styles,h=u.next;void 0!==h;)c+=" "+h.name,d+=h.styles,h=h.next;var f=!0===t.compat,p=t.insert("",{name:c,styles:d},t.sheet,f);return f?null:i.createElement("style",((l={})["data-emotion"]=t.key+"-global "+c,l.dangerouslySetInnerHTML={__html:p},l.nonce=t.sheet.nonce,l))}var g=i.useRef();return(0,s.j)(function(){var e=t.key+"-global",n=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),r=!1,i=document.querySelector('style[data-emotion="'+e+" "+u.name+'"]');return t.sheet.tags.length&&(n.before=t.sheet.tags[0]),null!==i&&(r=!0,i.setAttribute("data-emotion",e),n.hydrate([i])),g.current=[n,r],function(){n.flush()}},[t]),(0,s.j)(function(){var e=g.current,n=e[0];if(e[1]){e[1]=!1;return}if(void 0!==u.next&&(0,o.My)(t,u.next,!0),n.tags.length){var r=n.tags[n.tags.length-1].nextElementSibling;n.before=r,n.flush()}t.insert("",u,n,!1)},[t,u.name]),null});function l(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.O)(t)}var c=function(){var e=l.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}},57555:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(87462);n(67294);var i=n(81893),o=n(85893);function s(e){let{styles:t,defaultTheme:n={}}=e,r="function"==typeof t?e=>t(null==e||0===Object.keys(e).length?n:e):t;return(0,o.jsx)(i.xB,{styles:r})}var a=n(96682),u=function({styles:e,themeId:t,defaultTheme:n={}}){let r=(0,a.Z)(n),i="function"==typeof e?e(t&&r[t]||r):e;return(0,o.jsx)(s,{styles:i})},l=n(34296),c=n(49033),d=function(e){return(0,o.jsx)(u,(0,r.Z)({},e,{defaultTheme:l.Z,themeId:c.Z}))}},61759:function(e,t){"use strict";t.Z={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"}},53042:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(87462),i=n(63366),o=n(67294);let s=o.createContext(null);function a(){return o.useContext(s)}var u="function"==typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__",l=n(85893),c=function(e){let{children:t,theme:n}=e,i=a(),c=o.useMemo(()=>{let e=null===i?n:"function"==typeof n?n(i):(0,r.Z)({},i,n);return null!=e&&(e[u]=null!==i),e},[n,i]);return(0,l.jsx)(s.Provider,{value:c,children:t})},d=n(40712),h=n(34168);let f={};function p(e,t,n,i=!1){return o.useMemo(()=>{let o=e&&t[e]||t;if("function"==typeof n){let s=n(o),a=e?(0,r.Z)({},t,{[e]:s}):s;return i?()=>a:a}return e?(0,r.Z)({},t,{[e]:n}):(0,r.Z)({},t,n)},[e,t,n,i])}var g=function(e){let{children:t,theme:n,themeId:r}=e,i=(0,h.Z)(f),o=a()||f,s=p(r,i,n),u=p(r,o,n,!0);return(0,l.jsx)(c,{theme:u,children:(0,l.jsx)(d.T.Provider,{value:s,children:t})})},m=n(49033);let y=["theme"];function v(e){let{theme:t}=e,n=(0,i.Z)(e,y),o=t[m.Z];return(0,l.jsx)(g,(0,r.Z)({},n,{themeId:o?m.Z:void 0,theme:o||t}))}},9669:function(e,t,n){"use strict";n.d(t,{Z:function(){return M}});var r=n(87462),i=n(63366),o=n(71387),s=n(59766),a=n(66500),u=n(44920),l=n(86523),c=n(41796),d={black:"#000",white:"#fff"},h={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},f={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},p={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},g={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},m={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},y={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},v=n(61759);let _=["mode","contrastThreshold","tonalOffset"],b={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:d.white,default:d.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},w={text:{primary:d.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:d.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function S(e,t,n,r){let i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,c.$n)(e.main,i):"dark"===t&&(e.dark=(0,c._j)(e.main,o)))}let E=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"],k={textTransform:"uppercase"},I='"Roboto", "Helvetica", "Arial", sans-serif';function T(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return["".concat(t[0],"px ").concat(t[1],"px ").concat(t[2],"px ").concat(t[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(t[4],"px ").concat(t[5],"px ").concat(t[6],"px ").concat(t[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(t[8],"px ").concat(t[9],"px ").concat(t[10],"px ").concat(t[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}let x=["none",T(0,2,1,-1,0,1,1,0,0,1,3,0),T(0,3,1,-2,0,2,2,0,0,1,5,0),T(0,3,3,-2,0,3,4,0,0,1,8,0),T(0,2,4,-1,0,4,5,0,0,1,10,0),T(0,3,5,-1,0,5,8,0,0,1,14,0),T(0,3,5,-1,0,6,10,0,0,1,18,0),T(0,4,5,-2,0,7,10,1,0,2,16,1),T(0,5,5,-3,0,8,10,1,0,3,14,2),T(0,5,6,-3,0,9,12,1,0,3,16,2),T(0,6,6,-3,0,10,14,1,0,4,18,3),T(0,6,7,-4,0,11,15,1,0,4,20,3),T(0,7,8,-4,0,12,17,2,0,5,22,4),T(0,7,8,-4,0,13,19,2,0,5,24,4),T(0,7,9,-4,0,14,21,2,0,5,26,4),T(0,8,9,-5,0,15,22,2,0,6,28,5),T(0,8,10,-5,0,16,24,2,0,6,30,5),T(0,8,11,-5,0,17,26,2,0,6,32,5),T(0,9,11,-5,0,18,28,2,0,7,34,6),T(0,9,12,-6,0,19,29,2,0,7,36,6),T(0,10,13,-6,0,20,31,3,0,8,38,7),T(0,10,13,-6,0,21,33,3,0,8,40,7),T(0,10,14,-6,0,22,35,3,0,8,42,7),T(0,11,14,-7,0,23,36,3,0,9,44,8),T(0,11,15,-7,0,24,38,3,0,9,46,8)],C=["duration","easing","delay"],A={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},O={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function N(e){return"".concat(Math.round(e),"ms")}function R(e){if(!e)return 0;let t=e/36;return Math.round((4+15*t**.25+t/5)*10)}var D={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};let P=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];var M=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var t,n=arguments.length,T=Array(n>1?n-1:0),M=1;M<n;M++)T[M-1]=arguments[M];let{mixins:L={},palette:U={},transitions:j={},typography:q={}}=e,F=(0,i.Z)(e,P);if(e.vars)throw Error((0,o.Z)(18));let $=function(e){let{mode:t="light",contrastThreshold:n=3,tonalOffset:a=.2}=e,u=(0,i.Z)(e,_),l=e.primary||function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light";return"dark"===e?{main:m[200],light:m[50],dark:m[400]}:{main:m[700],light:m[400],dark:m[800]}}(t),E=e.secondary||function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light";return"dark"===e?{main:f[200],light:f[50],dark:f[400]}:{main:f[500],light:f[300],dark:f[700]}}(t),k=e.error||function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light";return"dark"===e?{main:p[500],light:p[300],dark:p[700]}:{main:p[700],light:p[400],dark:p[800]}}(t),I=e.info||function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light";return"dark"===e?{main:y[400],light:y[300],dark:y[700]}:{main:y[700],light:y[500],dark:y[900]}}(t),T=e.success||function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light";return"dark"===e?{main:v.Z[400],light:v.Z[300],dark:v.Z[700]}:{main:v.Z[800],light:v.Z[500],dark:v.Z[900]}}(t),x=e.warning||function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light";return"dark"===e?{main:g[400],light:g[300],dark:g[700]}:{main:"#ed6c02",light:g[500],dark:g[900]}}(t);function C(e){return(0,c.mi)(e,w.text.primary)>=n?w.text.primary:b.text.primary}let A=e=>{let{color:t,name:n,mainShade:i=500,lightShade:s=300,darkShade:u=700}=e;if(!(t=(0,r.Z)({},t)).main&&t[i]&&(t.main=t[i]),!t.hasOwnProperty("main"))throw Error((0,o.Z)(11,n?" (".concat(n,")"):"",i));if("string"!=typeof t.main)throw Error((0,o.Z)(12,n?" (".concat(n,")"):"",JSON.stringify(t.main)));return S(t,"light",s,a),S(t,"dark",u,a),t.contrastText||(t.contrastText=C(t.main)),t};return(0,s.Z)((0,r.Z)({common:(0,r.Z)({},d),mode:t,primary:A({color:l,name:"primary"}),secondary:A({color:E,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:A({color:k,name:"error"}),warning:A({color:x,name:"warning"}),info:A({color:I,name:"info"}),success:A({color:T,name:"success"}),grey:h,contrastThreshold:n,getContrastText:C,augmentColor:A,tonalOffset:a},{dark:w,light:b}[t]),u)}(U),B=(0,a.Z)(e),z=(0,s.Z)(B,{mixins:(t=B.breakpoints,(0,r.Z)({toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}}},L)),palette:$,shadows:x.slice(),typography:function(e,t){let n="function"==typeof t?t(e):t,{fontFamily:o=I,fontSize:a=14,fontWeightLight:u=300,fontWeightRegular:l=400,fontWeightMedium:c=500,fontWeightBold:d=700,htmlFontSize:h=16,allVariants:f,pxToRem:p}=n,g=(0,i.Z)(n,E),m=a/14,y=p||(e=>"".concat(e/h*m,"rem")),v=(e,t,n,i,s)=>(0,r.Z)({fontFamily:o,fontWeight:e,fontSize:y(t),lineHeight:n},o===I?{letterSpacing:"".concat(Math.round(i/t*1e5)/1e5,"em")}:{},s,f),_={h1:v(u,96,1.167,-1.5),h2:v(u,60,1.2,-.5),h3:v(l,48,1.167,0),h4:v(l,34,1.235,.25),h5:v(l,24,1.334,0),h6:v(c,20,1.6,.15),subtitle1:v(l,16,1.75,.15),subtitle2:v(c,14,1.57,.1),body1:v(l,16,1.5,.15),body2:v(l,14,1.43,.15),button:v(c,14,1.75,.4,k),caption:v(l,12,1.66,.4),overline:v(l,12,2.66,1,k),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return(0,s.Z)((0,r.Z)({htmlFontSize:h,pxToRem:y,fontFamily:o,fontSize:a,fontWeightLight:u,fontWeightRegular:l,fontWeightMedium:c,fontWeightBold:d},_),g,{clone:!1})}($,q),transitions:function(e){let t=(0,r.Z)({},A,e.easing),n=(0,r.Z)({},O,e.duration);return(0,r.Z)({getAutoHeightDuration:R,create:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{duration:o=n.standard,easing:s=t.easeInOut,delay:a=0}=r;return(0,i.Z)(r,C),(Array.isArray(e)?e:[e]).map(e=>"".concat(e," ").concat("string"==typeof o?o:N(o)," ").concat(s," ").concat("string"==typeof a?a:N(a))).join(",")}},e,{easing:t,duration:n})}(j),zIndex:(0,r.Z)({},D)});return z=(0,s.Z)(z,F),(z=T.reduce((e,t)=>(0,s.Z)(e,t),z)).unstable_sxConfig=(0,r.Z)({},u.Z,null==F?void 0:F.unstable_sxConfig),z.unstable_sx=function(e){return(0,l.Z)({sx:e,theme:this})},z}},34296:function(e,t,n){"use strict";let r=(0,n(9669).Z)();t.Z=r},49033:function(e,t){"use strict";t.Z="$$material"},70804:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(29628),i=n(34296),o=n(49033);function s(e){let{props:t,name:n}=e;return(0,r.Z)({props:t,name:n,defaultTheme:i.Z,themeId:o.Z})}},35432:function(e,t,n){"use strict";let r,i,o,s,a,u,l,c,d,h,f,p,g,m,y,v,_,b,w;var S,E,k,I,T,x,C,A,O=n(42990);function N(e,t,n=[t],r="npm"){let i=e._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${t}`,packages:n.map(e=>({name:`${r}:@sentry/${e}`,version:O.J})),version:O.J}),e._metadata=i}var R=n(39424),D=n(41001),P=n(41982),M=n(89163),L=n(94223);let U=[];function j(e,t){for(let n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function q(e,t,n){if(n[t.name]){L.X&&D.kg.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,-1===U.indexOf(t.name)&&"function"==typeof t.setupOnce&&(t.setupOnce(),U.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){let n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if("function"==typeof t.processEvent){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}L.X&&D.kg.log(`Integration installed: ${t.name}`)}let F=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,"undefined is not an object (evaluating 'a.L')",'can\'t redefine non-configurable property "solana"',"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler"],$=(e={})=>({name:"InboundFilters",processEvent:(t,n,r)=>{var i,o;return((i=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:F],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(e,r.getOptions())).ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(t)?(L.X&&D.kg.warn(`Event dropped due to being internal Sentry Error.
Event: ${(0,P.jH)(t)}`),0):(o=i.ignoreErrors,!t.type&&o&&o.length&&(function(e){let t;let n=[];e.message&&n.push(e.message);try{t=e.exception.values[e.exception.values.length-1]}catch(e){}return t&&t.value&&(n.push(t.value),t.type&&n.push(`${t.type}: ${t.value}`)),n})(t).some(e=>(0,M.U0)(e,o)))?(L.X&&D.kg.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
Event: ${(0,P.jH)(t)}`),0):t.type||!t.exception||!t.exception.values||0===t.exception.values.length||t.message||t.exception.values.some(e=>e.stacktrace||e.type&&"Error"!==e.type||e.value)?!function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;let n=e.transaction;return!!n&&(0,M.U0)(n,t)}(t,i.ignoreTransactions)?!function(e,t){if(!t||!t.length)return!1;let n=B(e);return!!n&&(0,M.U0)(n,t)}(t,i.denyUrls)?function(e,t){if(!t||!t.length)return!0;let n=B(e);return!n||(0,M.U0)(n,t)}(t,i.allowUrls)||(L.X&&D.kg.warn(`Event dropped due to not being matched by \`allowUrls\` option.
Event: ${(0,P.jH)(t)}.
Url: ${B(t)}`),0):(L.X&&D.kg.warn(`Event dropped due to being matched by \`denyUrls\` option.
Event: ${(0,P.jH)(t)}.
Url: ${B(t)}`),0):(L.X&&D.kg.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
Event: ${(0,P.jH)(t)}`),0):(L.X&&D.kg.warn(`Event dropped due to not having an error message, error type or stacktrace.
Event: ${(0,P.jH)(t)}`),0))?t:null}});function B(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?function(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch(t){return L.X&&D.kg.error(`Cannot extract url for event ${(0,P.jH)(e)}`),null}}var z=n(27179),V=n(73076);let G=new WeakMap,W=()=>({name:"FunctionToString",setupOnce(){r=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=(0,z.HK)(this),n=G.has((0,V.s3)())&&void 0!==t?t:this;return r.apply(n,e)}}catch(e){}},setup(e){G.set(e,!0)}});var H=n(42283);let K=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{var n;if((n=e)&&(function(e,t){let n=e.message,r=t.message;return!!((n||r)&&(!n||r)&&(n||!r)&&n===r&&X(e,t)&&J(e,t))}(t,n)||function(e,t){let n=Q(t),r=Q(e);return!!(n&&r&&n.type===r.type&&n.value===r.value&&X(e,t)&&J(e,t))}(t,n)))return L.X&&D.kg.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){}return e=t}}};function J(e,t){let n=(0,H.Fr)(e),r=(0,H.Fr)(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||r.length!==n.length)return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function X(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(e){return!1}}function Q(e){return e.exception&&e.exception.values&&e.exception.values[0]}var Z=n(1525),Y=n(29531);let ee=Y.GLOBAL_OBJ;function et(){if(!("fetch"in ee))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}function en(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function er(){if("string"==typeof EdgeRuntime)return!0;if(!et())return!1;if(en(ee.fetch))return!0;let e=!1,t=ee.document;if(t&&"function"==typeof t.createElement)try{let n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=en(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){Z.X&&D.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e}let ei={},eo={};function es(e,t){ei[e]=ei[e]||[],ei[e].push(t)}function ea(e,t){eo[e]||(t(),eo[e]=!0)}function eu(e,t){let n=e&&ei[e];if(n)for(let r of n)try{r(t)}catch(t){Z.X&&D.kg.error(`Error while triggering instrumentation handler.
Type: ${e}
Name: ${(0,H.$P)(r)}
Error:`,t)}}let el=Y.GLOBAL_OBJ,ec=Y.GLOBAL_OBJ;function ed(e){let t="history";es(t,e),ea(t,eh)}function eh(){if(!function(){let e=el.chrome,t=e&&e.app&&e.app.runtime,n="history"in el&&!!el.history.pushState&&!!el.history.replaceState;return!t&&n}())return;let e=ec.onpopstate;function t(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let e=i,t=String(n);i=t,eu("history",{from:e,to:t})}return e.apply(this,t)}}ec.onpopstate=function(...t){let n=ec.location.href,r=i;if(i=n,eu("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch(e){}},(0,z.hl)(ec.history,"pushState",t),(0,z.hl)(ec.history,"replaceState",t)}let ef=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function ep(e,t=!1){let{host:n,path:r,pass:i,port:o,projectId:s,protocol:a,publicKey:u}=e;return`${a}://${u}${t&&i?`:${i}`:""}@${n}${o?`:${o}`:""}/${r?`${r}/`:r}${s}`}function eg(e){let t=ef.exec(e);if(!t){(0,D.Cf)(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i="",o="",s="",a=""]=t.slice(1),u="",l=a,c=l.split("/");if(c.length>1&&(u=c.slice(0,-1).join("/"),l=c.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return em({host:o,pass:i,path:u,projectId:l,port:s,protocol:n,publicKey:r})}function em(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}var ey=n(16824),ev=n(80128),e_=n(83408);function eb(e,t=[]){return[e,t]}function ew(e,t){for(let n of e[1]){let e=n[0].type;if(t(n,e))return!0}return!1}function eS(e){return Y.GLOBAL_OBJ.__SENTRY__&&Y.GLOBAL_OBJ.__SENTRY__.encodePolyfill?Y.GLOBAL_OBJ.__SENTRY__.encodePolyfill(e):new TextEncoder().encode(e)}let eE={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function ek(e){if(!e||!e.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function eI(e,t,n,r){let i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:ep(r)},...i&&{trace:(0,z.Jr)({...i})}}}class eT extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}var ex=n(26181),eC=n(72123),eA=n(81585),eO=n(10042);function eN(e){if("boolean"==typeof e)return Number(e);let t="string"==typeof e?parseFloat(e):e;if("number"!=typeof t||isNaN(t)||t<0||t>1){L.X&&D.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`);return}return t}var eR=n(5808);let eD="Not capturing exception because it's already been captured.";class eP{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=function(e){let t="string"==typeof e?eg(e):em(e);if(t&&function(e){if(!Z.X)return!0;let{port:t,projectId:n,protocol:r}=e;return!["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(D.kg.error(`Invalid Sentry Dsn: ${t} missing`),!0))&&(n.match(/^\d+$/)?"http"===r||"https"===r?!(t&&isNaN(parseInt(t,10)))||(D.kg.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):(D.kg.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(D.kg.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1))}(t))return t}(e.dsn):L.X&&D.kg.warn("No DSN provided, client will not send events."),this._dsn){var t,n,r;let i=(t=this._dsn,n=e.tunnel,r=e._metadata?e._metadata.sdk:void 0,n||`${function(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(t)}${t.projectId}/envelope/?${(0,z._j)({sentry_key:t.publicKey,sentry_version:"7",...r&&{sentry_client:`${r.name}/${r.version}`}})}`);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:i})}}captureException(e,t,n){let r=(0,P.DM)();if((0,P.YO)(e))return L.X&&D.kg.log(eD),r;let i={event_id:r,...t};return this._process(this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n))),i.event_id}captureMessage(e,t,n,r){let i={event_id:(0,P.DM)(),...n},o=(0,ey.Le)(e)?e:String(e),s=(0,ey.pt)(e)?this.eventFromMessage(o,t,i):this.eventFromException(e,i);return this._process(s.then(e=>this._captureEvent(e,i,r))),i.event_id}captureEvent(e,t,n){let r=(0,P.DM)();if(t&&t.originalException&&(0,P.YO)(t.originalException))return L.X&&D.kg.log(eD),r;let i={event_id:r,...t},o=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,i,o||n)),i.event_id}captureSession(e){"string"!=typeof e.release?L.X&&D.kg.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),(0,eO.CT)(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let t=this._transport;return t?(this.emit("flush"),this._isClientDoneProcessing(e).then(n=>t.flush(e).then(e=>n&&e))):(0,ev.WD)(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,this.emit("close"),e))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let t=this._integrations[e.name];q(this,e,this._integrations),t||j(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=function(e,t,n,r){var i;let o=ek(n),s=e.type&&"replay_event"!==e.type?e.type:"event";(i=n&&n.sdk)&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||i.name,e.sdk.version=e.sdk.version||i.version,e.sdk.integrations=[...e.sdk.integrations||[],...i.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...i.packages||[]]);let a=eI(e,o,r,t);return delete e.sdkProcessingMetadata,eb(a,[[{type:s},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])n=function(e,t){let[n,r]=e;return[n,[...r,t]]}(n,function(e){let t="string"==typeof e.data?eS(e.data):e.data;return[(0,z.Jr)({type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),t]}(e));let r=this.sendEnvelope(n);r&&r.then(t=>this.emit("afterSendEvent",e,t),null)}sendSession(e){let t=function(e,t,n,r){let i=ek(n);return eb({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:ep(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(t)}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){let r="number"==typeof n?n:1,i=`${e}:${t}`;L.X&&D.kg.log(`Recording outcome: "${i}"${r>1?` (${r} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+r}}on(e,t){let n=this._hooks[e]=this._hooks[e]||[];return n.push(t),()=>{let e=n.indexOf(t);e>-1&&n.splice(e,1)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}sendEnvelope(e){return(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)?this._transport.send(e).then(null,e=>(L.X&&D.kg.error("Error while sending event:",e),e)):(L.X&&D.kg.error("Transport disabled"),(0,ev.WD)({}))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=function(e,t){let n={};return t.forEach(t=>{t&&q(e,t,n)}),n}(this,e),j(this,e)}_updateSessionFromEvent(e,t){let n=!1,r=!1,i=t.exception&&t.exception.values;if(i)for(let e of(r=!0,i)){let t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}let o="ok"===e.status;(o&&0===e.errors||o&&n)&&((0,eO.CT)(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new ev.cW(t=>{let n=0,r=setInterval(()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r=(0,V.aF)()){let i=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),(0,eR.R)(i,e,t,n,this,r).then(e=>{if(null===e)return e;let t={...r.getPropagationContext(),...n?n.getPropagationContext():void 0};if(!(e.contexts&&e.contexts.trace)&&t){let{traceId:n,spanId:r,parentSpanId:i,dsc:o}=t;e.contexts={trace:(0,z.Jr)({trace_id:n,span_id:r,parent_span_id:i}),...e.contexts};let s=o||(0,eC._l)(n,this);e.sdkProcessingMetadata={dynamicSamplingContext:s,...e.sdkProcessingMetadata}}return e})}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then(e=>e.event_id,e=>{L.X&&("log"===e.logLevel?D.kg.log(e.message):D.kg.warn(e))})}_processEvent(e,t,n){let r=this.getOptions(),{sampleRate:i}=r,o=eL(e),s=eM(e),a=e.type||"error",u=`before send for type \`${a}\``,l=void 0===i?void 0:eN(i);if(s&&"number"==typeof l&&Math.random()>l)return this.recordDroppedEvent("sample_rate","error",e),(0,ev.$2)(new eT(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));let c="replay_event"===a?"replay":a,d=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,n,d).then(n=>{if(null===n)throw this.recordDroppedEvent("event_processor",c,e),new eT("An event processor returned `null`, will not send event.","log");return t.data&&!0===t.data.__sentry__?n:function(e,t){let n=`${t} must return \`null\` or a valid event.`;if((0,ey.J8)(e))return e.then(e=>{if(!(0,ey.PO)(e)&&null!==e)throw new eT(n);return e},e=>{throw new eT(`${t} rejected with ${e}`)});if(!(0,ey.PO)(e)&&null!==e)throw new eT(n);return e}(function(e,t,n,r){let{beforeSend:i,beforeSendTransaction:o,beforeSendSpan:s}=t;if(eM(n)&&i)return i(n,r);if(eL(n)){if(n.spans&&s){let t=[];for(let r of n.spans){let n=s(r);n?t.push(n):e.recordDroppedEvent("before_send","span")}n.spans=t}if(o){if(n.spans){let e=n.spans.length;n.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return o(n,r)}}return n}(this,r,n,t),u)}).then(r=>{if(null===r){if(this.recordDroppedEvent("before_send",c,e),o){let t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw new eT(`${u} returned \`null\`, will not send event.`,"log")}let i=n&&n.getSession();if(!o&&i&&this._updateSessionFromEvent(i,r),o){let e=(r.sdkProcessingMetadata&&r.sdkProcessingMetadata.spanCountBeforeProcessing||0)-(r.spans?r.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}let s=r.transaction_info;return o&&s&&r.transaction!==e.transaction&&(r.transaction_info={...s,source:"custom"}),this.sendEvent(r,t),r}).then(null,e=>{if(e instanceof eT)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new eT(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
Reason: ${e}`)})}_process(e){this._numProcessing++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(":");return{reason:n,category:r,quantity:t}})}_flushOutcomes(){var e;L.X&&D.kg.log("Flushing outcomes...");let t=this._clearOutcomes();if(0===t.length){L.X&&D.kg.log("No outcomes to send");return}if(!this._dsn){L.X&&D.kg.log("No dsn provided, will not send outcomes");return}L.X&&D.kg.log("Sending outcomes:",t);let n=eb((e=this._options.tunnel&&ep(this._dsn))?{dsn:e}:{},[[{type:"client_report"},{timestamp:(0,ex.yW)(),discarded_events:t}]]);this.sendEnvelope(n)}}function eM(e){return void 0===e.type}function eL(e){return"transaction"===e.type}let eU="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function ej(e,t){let n=eF(e,t),r={type:function(e){let t=e&&e.name;return!t&&eB(e)?e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception":t}(t),value:function(e){let t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:eB(e)&&Array.isArray(e.message)&&2==e.message.length?e.message[1]:t:"No error message"}(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function eq(e,t){return{exception:{values:[ej(e,t)]}}}function eF(e,t){let n=t.stacktrace||t.stack||"",r=t&&e$.test(t.message)?1:0,i="number"==typeof t.framesToPop?t.framesToPop:0;try{return e(n,r,i)}catch(e){}return[]}let e$=/Minified React error #\d+;/i;function eB(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function ez(e,t,n,r,i){let o;if((0,ey.VW)(t)&&t.error)return eq(e,t.error);if((0,ey.TX)(t)||(0,ey.fm)(t)){if("stack"in t)o=eq(e,t);else{let i=t.name||((0,ey.TX)(t)?"DOMError":"DOMException"),s=t.message?`${i}: ${t.message}`:i;o=eV(e,s,n,r),(0,P.Db)(o,s)}return"code"in t&&(o.tags={...o.tags,"DOMException.code":`${t.code}`}),o}return(0,ey.VZ)(t)?eq(e,t):((0,ey.PO)(t)||(0,ey.cO)(t)?o=function(e,t,n,r){let i=(0,V.s3)(),o=i&&i.getOptions().normalizeDepth,s=function(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(n instanceof Error)return n}}(t),a={__serialized__:(0,e_.Qy)(t,o)};if(s)return{exception:{values:[ej(e,s)]},extra:a};let u={exception:{values:[{type:(0,ey.cO)(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:function(e,{isUnhandledRejection:t}){let n=(0,z.zf)(e),r=t?"promise rejection":"exception";if((0,ey.VW)(e))return`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``;if((0,ey.cO)(e)){let t=function(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){}}(e);return`Event \`${t}\` (type=${e.type}) captured as ${r}`}return`Object captured as ${r} with keys: ${n}`}(t,{isUnhandledRejection:r})}]},extra:a};if(n){let t=eF(e,n);t.length&&(u.exception.values[0].stacktrace={frames:t})}return u}(e,t,n,i):(o=eV(e,t,n,r),(0,P.Db)(o,`${t}`,void 0)),(0,P.EG)(o,{synthetic:!0}),o)}function eV(e,t,n,r){let i={};if(r&&n){let r=eF(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]})}if((0,ey.Le)(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}let eG=Y.GLOBAL_OBJ,eW=0;function eH(e,t={},n){if("function"!=typeof e)return e;try{let t=e.__sentry_wrapped__;if(t){if("function"==typeof t)return t;return e}if((0,z.HK)(e))return e}catch(t){return e}let r=function(){let r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);let i=r.map(e=>eH(e,t));return e.apply(this,i)}catch(e){throw eW++,setTimeout(()=>{eW--}),(0,V.$e)(n=>{n.addEventProcessor(e=>(t.mechanism&&((0,P.Db)(e,void 0,void 0),(0,P.EG)(e,t.mechanism)),e.extra={...e.extra,arguments:r},e)),(0,R.Tb)(e)}),e}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch(e){}(0,z.$Q)(r,e),(0,z.xp)(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>e.name})}catch(e){}return r}class eK extends eP{constructor(e){let t={parentSpanIsAlwaysRootSpan:!0,...e};N(t,"browser",["browser"],eG.SENTRY_SDK_SOURCE||"npm"),super(t),t.sendClientReports&&eG.document&&eG.document.addEventListener("visibilitychange",()=>{"hidden"===eG.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,n,r){let i=ez(e,t,n&&n.syntheticException||void 0,r);return(0,P.EG)(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),(0,ev.WD)(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,i){let o=eV(e,t,r&&r.syntheticException||void 0,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),(0,ev.WD)(o)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){eU&&D.kg.warn("SDK not enabled, will not capture user feedback.");return}let t=function(e,{metadata:t,tunnel:n,dsn:r}){return eb({event_id:e.event_id,sent_at:new Date().toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:ep(r)}},[[{type:"user_report"},e]])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}}function eJ(e){es("dom",e),ea("dom",eX)}function eX(){if(!ec.document)return;let e=eu.bind(null,"dom"),t=eQ(e,!0);ec.document.addEventListener("click",t,!1),ec.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{let n=ec[t]&&ec[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,z.hl)(n,"addEventListener",function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{let r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},o=r[n]=r[n]||{refCount:0};if(!o.handler){let r=eQ(e);o.handler=r,t.call(this,n,r,i)}o.refCount++}catch(e){}return t.call(this,n,r,i)}}),(0,z.hl)(n,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{let n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}}))})}function eQ(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=function(e){try{return e.target}catch(e){return null}}(n);if("keypress"===n.type&&(!r||!r.tagName||"INPUT"!==r.tagName&&"TEXTAREA"!==r.tagName&&!r.isContentEditable))return;(0,z.xp)(n,"_sentryCaptured",!0),r&&!r._sentryId&&(0,z.xp)(r,"_sentryId",(0,P.DM)());let i="keypress"===n.type?"input":n.type;!function(e){if(e.type!==s)return!1;try{if(!e.target||e.target._sentryId!==a)return!1}catch(e){}return!0}(n)&&(e({event:n,name:i,global:t}),s=n.type,a=r?r._sentryId:void 0),clearTimeout(o),o=ec.setTimeout(()=>{a=void 0,s=void 0},1e3)}}let eZ="__sentry_xhr_v3__";function eY(e){es("xhr",e),ea("xhr",e0)}function e0(){if(!ec.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=1e3*(0,ex.ph)(),i=(0,ey.HD)(n[0])?n[0].toUpperCase():void 0,o=function(e){if((0,ey.HD)(e))return e;try{return e.toString()}catch(e){}}(n[1]);if(!i||!o)return e.apply(t,n);t[eZ]={method:i,url:o,request_headers:{}},"POST"===i&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);let s=()=>{let e=t[eZ];if(e&&4===t.readyState){try{e.status_code=t.status}catch(e){}eu("xhr",{endTimestamp:1e3*(0,ex.ph)(),startTimestamp:r,xhr:t})}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(s(),e.apply(t,n))}):t.addEventListener("readystatechange",s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){let[r,i]=n,o=t[eZ];return o&&(0,ey.HD)(r)&&(0,ey.HD)(i)&&(o.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){let r=t[eZ];return r&&(void 0!==n[0]&&(r.body=n[0]),eu("xhr",{startTimestamp:1e3*(0,ex.ph)(),xhr:t})),e.apply(t,n)}})}var e1=n(37895);function e2(e){let t="console";es(t,e),ea(t,e3)}function e3(){"console"in Y.GLOBAL_OBJ&&D.RU.forEach(function(e){e in Y.GLOBAL_OBJ.console&&(0,z.hl)(Y.GLOBAL_OBJ.console,e,function(t){return D.LD[e]=t,function(...t){eu("console",{args:t,level:e});let n=D.LD[e];n&&n.apply(Y.GLOBAL_OBJ.console,t)}})})}function e4(e,t){let n="fetch";es(n,e),ea(n,()=>e5(void 0,t))}function e5(e,t=!1){(!t||er())&&(0,z.hl)(Y.GLOBAL_OBJ,"fetch",function(t){return function(...n){let{method:r,url:i}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){let[t,n]=e;return{url:e7(t),method:e8(n,"method")?String(n.method).toUpperCase():"GET"}}let t=e[0];return{url:e7(t),method:e8(t,"method")?String(t.method).toUpperCase():"GET"}}(n),o={args:n,fetchData:{method:r,url:i},startTimestamp:1e3*(0,ex.ph)()};e||eu("fetch",{...o});let s=Error().stack;return t.apply(Y.GLOBAL_OBJ,n).then(async t=>(e?e(t):eu("fetch",{...o,endTimestamp:1e3*(0,ex.ph)(),response:t}),t),e=>{throw eu("fetch",{...o,endTimestamp:1e3*(0,ex.ph)(),error:e}),(0,ey.VZ)(e)&&void 0===e.stack&&(e.stack=s,(0,z.xp)(e,"framesToPop",1)),e})}})}async function e6(e,t){if(e&&e.body){let n=e.body,r=n.getReader(),i=setTimeout(()=>{n.cancel().then(null,()=>{})},9e4),o=!0;for(;o;){let e;try{e=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:i}=await r.read();clearTimeout(e),i&&(t(),o=!1)}catch(e){o=!1}finally{clearTimeout(e)}}clearTimeout(i),r.releaseLock(),n.cancel().then(null,()=>{})}}function e9(e){let t;try{t=e.clone()}catch(e){return}e6(t,()=>{eu("fetch-body-resolved",{endTimestamp:1e3*(0,ex.ph)(),response:e})})}function e8(e,t){return!!e&&"object"==typeof e&&!!e[t]}function e7(e){return"string"==typeof e?e:e?e8(e,"url")?e.url:e.toString?e.toString():"":""}var te=n(1869);let tt=["fatal","error","warning","log","info","debug"];function tn(e){return"warn"===e?"warning":tt.includes(e)?e:"log"}function tr(e){if(void 0!==e)return e>=400&&e<500?"warning":e>=500?"error":void 0}function ti(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}let to=(e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:"Breadcrumbs",setup(e){var n;t.console&&e2(function(t){if((0,V.s3)()!==e)return;let n={category:"console",data:{arguments:t.args,logger:"console"},level:tn(t.level),message:(0,M.nK)(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${(0,M.nK)(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}(0,e1.n)(n,{input:t.args,level:t.level})}),t.dom&&eJ((n=t.dom,function(t){let r,i;if((0,V.s3)()!==e)return;let o="object"==typeof n?n.serializeAttribute:void 0,s="object"==typeof n&&"number"==typeof n.maxStringLength?n.maxStringLength:void 0;s&&s>1024&&(eU&&D.kg.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${s} was configured. Sentry will use 1024 instead.`),s=1024),"string"==typeof o&&(o=[o]);try{let e=t.event,n=e&&e.target?e.target:e;r=(0,te.Rt)(n,{keyAttrs:o,maxStringLength:s}),i=(0,te.iY)(n)}catch(e){r="<unknown>"}if(0===r.length)return;let a={category:`ui.${t.name}`,message:r};i&&(a.data={"ui.component_name":i}),(0,e1.n)(a,{event:t.event,name:t.name,global:t.global})})),t.xhr&&eY(function(t){if((0,V.s3)()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[eZ];if(!n||!r||!i)return;let{method:o,url:s,status_code:a,body:u}=i,l={xhr:t.xhr,input:u,startTimestamp:n,endTimestamp:r},c=tr(a);(0,e1.n)({category:"xhr",data:{method:o,url:s,status_code:a},type:"http",level:c},l)}),t.fetch&&e4(function(t){if((0,V.s3)()!==e)return;let{startTimestamp:n,endTimestamp:r}=t;if(!(!r||t.fetchData.url.match(/sentry_key/)&&"POST"===t.fetchData.method)){if(t.error){let e=t.fetchData,i={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r};(0,e1.n)({category:"fetch",data:e,level:"error",type:"http"},i)}else{let e=t.response,i={...t.fetchData,status_code:e&&e.status},o={input:t.args,response:e,startTimestamp:n,endTimestamp:r},s=tr(i.status_code);(0,e1.n)({category:"fetch",data:i,type:"http",level:s},o)}}}),t.history&&ed(function(t){if((0,V.s3)()!==e)return;let n=t.from,r=t.to,i=ti(eG.location.href),o=n?ti(n):void 0,s=ti(r);o&&o.path||(o=i),i.protocol===s.protocol&&i.host===s.host&&(r=s.relative),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),(0,e1.n)({category:"navigation",data:{from:n,to:r}})}),t.sentry&&e.on("beforeSendEvent",function(t){(0,V.s3)()===e&&(0,e1.n)({category:`sentry.${"transaction"===t.type?"transaction":"event"}`,event_id:t.event_id,level:t.level,message:(0,P.jH)(t)},{event:t})})}}},ts=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],ta=(e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&(0,z.hl)(eG,"setTimeout",tu),t.setInterval&&(0,z.hl)(eG,"setInterval",tu),t.requestAnimationFrame&&(0,z.hl)(eG,"requestAnimationFrame",tl),t.XMLHttpRequest&&"XMLHttpRequest"in eG&&(0,z.hl)(XMLHttpRequest.prototype,"send",tc);let e=t.eventTarget;e&&(Array.isArray(e)?e:ts).forEach(td)}}};function tu(e){return function(...t){let n=t[0];return t[0]=eH(n,{mechanism:{data:{function:(0,H.$P)(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function tl(e){return function(t){return e.apply(this,[eH(t,{mechanism:{data:{function:"requestAnimationFrame",handler:(0,H.$P)(e)},handled:!1,type:"instrument"}})])}}function tc(e){return function(...t){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&(0,z.hl)(n,e,function(t){let n={mechanism:{data:{function:e,handler:(0,H.$P)(t)},handled:!1,type:"instrument"}},r=(0,z.HK)(t);return r&&(n.mechanism.data.handler=(0,H.$P)(r)),eH(t,n)})}),e.apply(this,t)}}function td(e){let t=eG[e]&&eG[e].prototype;t&&t.hasOwnProperty&&t.hasOwnProperty("addEventListener")&&((0,z.hl)(t,"addEventListener",function(t){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=eH(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:(0,H.$P)(r),target:e},handled:!1,type:"instrument"}}))}catch(e){}return t.apply(this,[n,eH(r,{mechanism:{data:{function:"addEventListener",handler:(0,H.$P)(r),target:e},handled:!1,type:"instrument"}}),i])}}),(0,z.hl)(t,"removeEventListener",function(e){return function(t,n,r){try{let i=n&&n.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch(e){}return e.call(this,t,n,r)}}))}let th=null;function tf(e){let t="error";es(t,e),ea(t,tp)}function tp(){th=Y.GLOBAL_OBJ.onerror,Y.GLOBAL_OBJ.onerror=function(e,t,n,r,i){return eu("error",{column:r,error:i,line:n,msg:e,url:t}),!!th&&!th.__SENTRY_LOADER__&&th.apply(this,arguments)},Y.GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__=!0}let tg=null;function tm(e){let t="unhandledrejection";es(t,e),ea(t,ty)}function ty(){tg=Y.GLOBAL_OBJ.onunhandledrejection,Y.GLOBAL_OBJ.onunhandledrejection=function(e){return eu("unhandledrejection",e),!tg||!!tg.__SENTRY_LOADER__||tg.apply(this,arguments)},Y.GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}let tv=(e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(tf(t=>{let{stackParser:n,attachStacktrace:r}=tb();if((0,V.s3)()!==e||eW>0)return;let{msg:i,url:o,line:s,column:a,error:u}=t,l=function(e,t,n,r){let i=e.exception=e.exception||{},o=i.values=i.values||[],s=o[0]=o[0]||{},a=s.stacktrace=s.stacktrace||{},u=a.frames=a.frames||[],l=isNaN(parseInt(r,10))?void 0:r,c=isNaN(parseInt(n,10))?void 0:n,d=(0,ey.HD)(t)&&t.length>0?t:(0,te.l4)();return 0===u.length&&u.push({colno:l,filename:d,function:H.Fi,in_app:!0,lineno:c}),e}(ez(n,u||i,void 0,r,!1),o,s,a);l.level="error",(0,R.eN)(l,{originalException:u,mechanism:{handled:!1,type:"onerror"}})}),t_("onerror")),t.onunhandledrejection&&(tm(t=>{let{stackParser:n,attachStacktrace:r}=tb();if((0,V.s3)()!==e||eW>0)return;let i=function(e){if((0,ey.pt)(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}(t),o=(0,ey.pt)(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:ez(n,i,void 0,r,!0);o.level="error",(0,R.eN)(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})}),t_("onunhandledrejection"))}}};function t_(e){eU&&D.kg.log(`Global Handler attached: ${e}`)}function tb(){let e=(0,V.s3)();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}let tw=()=>({name:"HttpContext",preprocessEvent(e){if(!eG.navigator&&!eG.location&&!eG.document)return;let t=e.request&&e.request.url||eG.location&&eG.location.href,{referrer:n}=eG.document||{},{userAgent:r}=eG.navigator||{},i={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},o={...e.request,...t&&{url:t},headers:i};e.request=o}});function tS(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,..."AggregateError"===e.type&&{is_exception_group:!0},exception_id:t}}function tE(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}let tk=(e={})=>{let t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,i){let o=i.getOptions();!function(e,t,n=250,r,i,o,s){if(!o.exception||!o.exception.values||!s||!(0,ey.V9)(s.originalException,Error))return;let a=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;a&&(o.exception.values=(function e(t,n,r,i,o,s,a,u){if(s.length>=r+1)return s;let l=[...s];if((0,ey.V9)(i[o],Error)){tS(a,u);let s=t(n,i[o]),c=l.length;tE(s,o,c,u),l=e(t,n,r,i[o],o,[s,...l],s,c)}return Array.isArray(i.errors)&&i.errors.forEach((i,s)=>{if((0,ey.V9)(i,Error)){tS(a,u);let c=t(n,i),d=l.length;tE(c,`errors[${s}]`,d,u),l=e(t,n,r,i,o,[c,...l],c,d)}}),l})(e,t,i,s.originalException,r,o.exception.values,a,0).map(e=>(e.value&&(e.value=(0,M.$G)(e.value,n)),e)))}(ej,o.stackParser,o.maxValueLength,n,t,e,r)}}};function tI(e,t,n,r){let i={filename:e,function:"<anonymous>"===t?H.Fi:t,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}let tT=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tx=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tC=/\((\S*)(?::(\d+))(?::(\d+))\)/,tA=[30,e=>{let t=tT.exec(e);if(t){let[,e,n,r]=t;return tI(e,H.Fi,+n,+r)}let n=tx.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){let e=tC.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}let[e,t]=tP(n[1]||H.Fi,n[2]);return tI(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],tO=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tN=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tR=[50,e=>{let t=tO.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let e=tN.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||H.Fi;return[n,e]=tP(n,e),tI(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],tD=(0,H.pE)(...[tA,tR]),tP=(e,t)=>{let n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:H.Fi,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},tM="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,tL={};function tU(e){let t=tL[e];if(t)return t;let n=ec[e];if(en(n))return tL[e]=n.bind(ec);let r=ec.document;if(r&&"function"==typeof r.createElement)try{let t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(n=i[e]),r.head.removeChild(t)}catch(t){tM&&D.kg.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n?tL[e]=n.bind(ec):n}function tj(...e){return tU("setTimeout")(...e)}function tq(e,t,n=Date.now()){return(e[t]||e.all||0)>n}function tF(e,{statusCode:t,headers:n},r=Date.now()){let i={...e},o=n&&n["x-sentry-rate-limits"],s=n&&n["retry-after"];if(o)for(let e of o.trim().split(",")){let[t,n,,,o]=e.split(":",5),s=parseInt(t,10),a=(isNaN(s)?60:s)*1e3;if(n)for(let e of n.split(";"))"metric_bucket"===e?(!o||o.split(";").includes("custom"))&&(i[e]=r+a):i[e]=r+a;else i.all=r+a}else s?i.all=r+function(e,t=Date.now()){let n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;let r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(s,r):429===t&&(i.all=r+6e4);return i}function t$(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}function tB(e,t=tU("fetch")){let n=0,r=0;return function(e,t,n=function(e){let t=[];function n(e){return t.splice(t.indexOf(e),1)[0]||Promise.resolve(void 0)}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return(0,ev.$2)(new eT("Not adding Promise because buffer limit was reached."));let i=r();return -1===t.indexOf(i)&&t.push(i),i.then(()=>n(i)).then(null,()=>n(i).then(null,()=>{})),i},drain:function(e){return new ev.cW((n,r)=>{let i=t.length;if(!i)return n(!0);let o=setTimeout(()=>{e&&e>0&&n(!1)},e);t.forEach(e=>{(0,ev.WD)(e).then(()=>{--i||(clearTimeout(o),n(!0))},r)})})}}}(e.bufferSize||64)){let r={};return{send:function(i){let o=[];if(ew(i,(t,n)=>{let i=eE[n];if(tq(r,i)){let r=t$(t,n);e.recordDroppedEvent("ratelimit_backoff",i,r)}else o.push(t)}),0===o.length)return(0,ev.WD)({});let s=eb(i[0],o),a=t=>{ew(s,(n,r)=>{let i=t$(n,r);e.recordDroppedEvent(t,eE[r],i)})};return n.add(()=>t({body:function(e){let[t,n]=e,r=JSON.stringify(t);function i(e){"string"==typeof r?r="string"==typeof e?r+e:[eS(r),e]:r.push("string"==typeof e?eS(e):e)}for(let e of n){let[t,n]=e;if(i(`
${JSON.stringify(t)}
`),"string"==typeof n||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch(t){e=JSON.stringify((0,e_.Fv)(n))}i(e)}}return"string"==typeof r?r:function(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}(r)}(s)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&L.X&&D.kg.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=tF(r,e),e),e=>{throw a("network_error"),e})).then(e=>e,e=>{if(e instanceof eT)return L.X&&D.kg.error("Skipped sending event because buffer is full."),a("queue_overflow"),(0,ev.WD)({});throw e})},flush:e=>n.drain(e)}}(e,function(i){let o=i.body.length;n+=o,r++;let s={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};if(!t)return tL.fetch=void 0,(0,ev.$2)("No fetch implementation available");try{return t(e.url,s).then(e=>(n-=o,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}}))}catch(e){return tL.fetch=void 0,n-=o,r--,(0,ev.$2)(e)}})}function tz(e){return[$(),W(),ta(),to(),tv(),tk(),K(),tw()]}var tV=n(67294),tG=n(83454),tW=n(13533),tH=n(60811),tK=n(31218),tJ=n(67973),tX=n(89366);class tQ{constructor(e={}){this._traceId=e.traceId||(0,P.DM)(),this._spanId=e.spanId||(0,P.DM)().substring(16)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:eA.ve}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}}var tZ=n(72751);function tY(e){if(!e||0===e.length)return;let t={};return e.forEach(e=>{let n=e.attributes||{},r=n[tK.E1],i=n[tK.Wb];"string"==typeof r&&"number"==typeof i&&(t[e.name]={value:i,unit:r})}),t}let t0="_sentryScope",t1="_sentryIsolationScope";function t2(e){return{scope:e[t0],isolationScope:e[t1]}}class t3{constructor(e={}){this._traceId=e.traceId||(0,P.DM)(),this._spanId=e.spanId||(0,P.DM)().substring(16),this._startTime=e.startTimestamp||(0,ex.ph)(),this._attributes={},this.setAttributes({[tK.S3]:"manual",[tK.$J]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this}addLinks(e){return this}recordException(e,t){}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:n?eA.i0:eA.ve}}setAttribute(e,t){return void 0===t?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._startTime=(0,eA.$k)(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this}end(e){this._endTime||(this._endTime=(0,eA.$k)(e),function(e){if(!L.X)return;let{description:t="< unknown name >",op:n="< unknown op >"}=(0,eA.XU)(e),{spanId:r}=e.spanContext(),i=(0,eA.Gx)(e)===e,o=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;D.kg.log(o)}(this),this._onSpanEnded())}getSpanJSON(){return(0,z.Jr)({data:this._attributes,description:this._name,op:this._attributes[tK.$J],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:(0,eA._4)(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[tK.S3],_metrics_summary:(0,tZ.y)(this),profile_id:this._attributes[tK.p6],exclusive_time:this._attributes[tK.JQ],measurements:tY(this._events),is_segment:this._isStandaloneSpan&&(0,eA.Gx)(this)===this||void 0,segment_id:this._isStandaloneSpan?(0,eA.Gx)(this).spanContext().spanId:void 0})}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){L.X&&D.kg.log("[Tracing] Adding an event to span:",e);let r=t4(t)?t:n||(0,ex.ph)(),i=t4(t)?{}:t||{},o={name:e,time:(0,eA.$k)(r),attributes:i};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=(0,V.s3)();if(e&&e.emit("spanEnd",this),!(this._isStandaloneSpan||this===(0,eA.Gx)(this)))return;if(this._isStandaloneSpan){this._sampled?function(e){let t=(0,V.s3)();if(!t)return;let n=e[1];if(!n||0===n.length){t.recordDroppedEvent("before_send","span");return}let r=t.getTransport();r&&r.send(e).then(null,e=>{L.X&&D.kg.error("Error while sending span:",e)})}(function(e,t){let n=(0,eC.jC)(e[0]),r=t&&t.getDsn(),i=t&&t.getOptions().tunnel,o={sent_at:new Date().toISOString(),...!!n.trace_id&&!!n.public_key&&{trace:n},...!!i&&r&&{dsn:ep(r)}},s=t&&t.getOptions().beforeSendSpan,a=s?e=>s((0,eA.XU)(e)):e=>(0,eA.XU)(e),u=[];for(let t of e){let e=a(t);e&&u.push([{type:"span"},e])}return eb(o,u)}([this],e)):(L.X&&D.kg.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span"));return}let t=this._convertSpanToTransaction();t&&(t2(this).scope||(0,V.nZ)()).captureEvent(t)}_convertSpanToTransaction(){if(!t5((0,eA.XU)(this)))return;this._name||(L.X&&D.kg.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:e,isolationScope:t}=t2(this),n=(e||(0,V.nZ)()).getClient()||(0,V.s3)();if(!0!==this._sampled){L.X&&D.kg.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),n&&n.recordDroppedEvent("sample_rate","transaction");return}let r=(0,eA.Dp)(this).filter(e=>e!==this&&!(e instanceof t3&&e.isStandaloneSpan())).map(e=>(0,eA.XU)(e)).filter(t5),i=this._attributes[tK.Zj],o={contexts:{trace:(0,eA.HR)(this)},spans:r.length>1e3?r.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,1e3):r,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:t,...(0,z.Jr)({dynamicSamplingContext:(0,eC.jC)(this)})},_metrics_summary:(0,tZ.y)(this),...i&&{transaction_info:{source:i}}},s=tY(this._events);return s&&Object.keys(s).length&&(L.X&&D.kg.log("[Measurements] Adding measurements to transaction event",JSON.stringify(s,void 0,2)),o.measurements=s),o}}function t4(e){return e&&"number"==typeof e||e instanceof Date||Array.isArray(e)}function t5(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}let t6="__SENTRY_SUPPRESS_TRACING__";function t9(e){let t=t7();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=function(e){let t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let n={...t};return n.startTimestamp=(0,eA.$k)(e.startTime),delete n.startTime,n}return t}(e),{forceTransaction:r,parentSpan:i}=e;return(e.scope?t=>(0,V.$e)(e.scope,t):void 0!==i?e=>t8(i,e):e=>e())(()=>{let t=(0,V.nZ)(),i=function(e){let t=(0,tX.Y)(e);if(!t)return;let n=(0,V.s3)();return(n?n.getOptions():{}).parentSpanIsAlwaysRootSpan?(0,eA.Gx)(t):t}(t);return e.onlyIfParent&&!i?new tQ:function({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){var i;let o;if(!(0,tJ.z)())return new tQ;let s=(0,V.aF)();if(e&&!n)o=function(e,t,n){let{spanId:r,traceId:i}=e.spanContext(),o=!t.getScopeData().sdkProcessingMetadata[t6]&&(0,eA.Tt)(e),s=o?new t3({...n,parentSpanId:r,traceId:i,sampled:o}):new tQ({traceId:i});(0,eA.j5)(e,s);let a=(0,V.s3)();return a&&(a.emit("spanStart",s),n.endTimestamp&&a.emit("spanEnd",s)),s}(e,r,t),(0,eA.j5)(e,o);else if(e){let n=(0,eC.jC)(e),{traceId:i,spanId:s}=e.spanContext(),a=(0,eA.Tt)(e);o=ne({traceId:i,parentSpanId:s,...t},r,a),(0,eC.Lh)(o,n)}else{let{traceId:e,dsc:n,parentSpanId:i,sampled:a}={...s.getPropagationContext(),...r.getPropagationContext()};o=ne({traceId:e,parentSpanId:i,...t},r,a),n&&(0,eC.Lh)(o,n)}return function(e){if(!L.X)return;let{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=(0,eA.XU)(e),{spanId:i}=e.spanContext(),o=(0,eA.Tt)(e),s=(0,eA.Gx)(e),a=s===e,u=`[Tracing] Starting ${o?"sampled":"unsampled"} ${a?"root ":""}span`,l=[`op: ${n}`,`name: ${t}`,`ID: ${i}`];if(r&&l.push(`parent ID: ${r}`),!a){let{op:e,description:t}=(0,eA.XU)(s);l.push(`root ID: ${s.spanContext().spanId}`),e&&l.push(`root op: ${e}`),t&&l.push(`root description: ${t}`)}D.kg.log(`${u}
  ${l.join("\n  ")}`)}(o),(i=o)&&((0,z.xp)(i,t1,s),(0,z.xp)(i,t0,r)),o}({parentSpan:i,spanArguments:n,forceTransaction:r,scope:t})})}function t8(e,t){let n=t7();return n.withActiveSpan?n.withActiveSpan(e,t):(0,V.$e)(n=>((0,tX.D)(n,e||void 0),t(n)))}function t7(){let e=(0,tW.c)();return(0,tH.G)(e)}function ne(e,t,n){let r=(0,V.s3)(),i=r&&r.getOptions()||{},{name:o="",attributes:s}=e,[a,u]=t.getScopeData().sdkProcessingMetadata[t6]?[!1]:function(e,t){let n;if(!(0,tJ.z)(e))return[!1];let r=eN(n="function"==typeof e.tracesSampler?e.tracesSampler(t):void 0!==t.parentSampled?t.parentSampled:void 0!==e.tracesSampleRate?e.tracesSampleRate:1);return void 0===r?(L.X&&D.kg.warn("[Tracing] Discarding transaction because of invalid sample rate."),[!1]):r?Math.random()<r?[!0,r]:(L.X&&D.kg.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(n)})`),[!1,r]):(L.X&&D.kg.log(`[Tracing] Discarding transaction because ${"function"==typeof e.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,r])}(i,{name:o,parentSampled:n,attributes:s,transactionContext:{name:o,parentSampled:n}}),l=new t3({...e,attributes:{[tK.Zj]:"custom",...e.attributes},sampled:a});return void 0!==u&&l.setAttribute(tK.TE,u),r&&r.emit("spanStart",l),l}function nt(e){let t;let n=e[0],r=1;for(;r<e.length;){let i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):("call"===i||"optionalCall"===i)&&(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}let nn=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",nr=(e,t,n,r)=>{let i,o;return s=>{t.value>=0&&(s||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=nn(t.value,n),e(t))}},ni=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,no=()=>ec.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],ns=()=>{let e=no();return e&&e.activationStart||0},na=(e,t)=>{let n=no(),r="navigate";return n&&(ec.document&&ec.document.prerendering||ns()>0?r="prerender":ec.document&&ec.document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:ni(),navigationType:r}},nu=(e,t,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},nl=e=>{let t=t=>{("pagehide"===t.type||ec.document&&"hidden"===ec.document.visibilityState)&&e(t)};ec.document&&(addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0))},nc=e=>{let t=!1;return n=>{t||(e(n),t=!0)}},nd=-1,nh=()=>{nd="hidden"!==ec.document.visibilityState||ec.document.prerendering?1/0:0},nf=e=>{"hidden"===ec.document.visibilityState&&nd>-1&&(nd="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("visibilitychange",nf,!0),removeEventListener("prerenderingchange",nf,!0))},np=()=>{addEventListener("visibilitychange",nf,!0),addEventListener("prerenderingchange",nf,!0)},ng=()=>(ec.document&&nd<0&&(nh(),np()),{get firstHiddenTime(){return nd}}),nm=e=>{ec.document&&ec.document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},ny=[1800,3e3],nv=(e,t={})=>{nm(()=>{let n;let r=ng(),i=na("FCP"),o=nu("paint",e=>{e.forEach(e=>{"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-ns(),0),i.entries.push(e),n(!0)))})});o&&(n=nr(e,i,ny,t.reportAllChanges))})},n_=[.1,.25],nb=(e,t={})=>{nv(nc(()=>{let n;let r=na("CLS",0),i=0,o=[],s=e=>{e.forEach(e=>{if(!e.hadRecentInput){let t=o[0],n=o[o.length-1];i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}}),i>r.value&&(r.value=i,r.entries=o,n())},a=nu("layout-shift",s);a&&(n=nr(e,r,n_,t.reportAllChanges),nl(()=>{s(a.takeRecords()),n(!0)}),setTimeout(n,0))}))},nw=[100,300],nS=(e,t={})=>{nm(()=>{let n;let r=ng(),i=na("FID"),o=e=>{e.startTime<r.firstHiddenTime&&(i.value=e.processingStart-e.startTime,i.entries.push(e),n(!0))},s=e=>{e.forEach(o)},a=nu("first-input",s);n=nr(e,i,nw,t.reportAllChanges),a&&nl(nc(()=>{s(a.takeRecords()),a.disconnect()}))})},nE=0,nk=1/0,nI=0,nT=e=>{e.forEach(e=>{e.interactionId&&(nk=Math.min(nk,e.interactionId),nE=(nI=Math.max(nI,e.interactionId))?(nI-nk)/7+1:0)})},nx=()=>u?nE:performance.interactionCount||0,nC=()=>{"interactionCount"in performance||u||(u=nu("event",nT,{type:"event",buffered:!0,durationThreshold:0}))},nA=[200,500],nO=()=>nx()-0,nN=[],nR={},nD=e=>{let t=nN[nN.length-1],n=nR[e.interactionId];if(n||nN.length<10||t&&e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{let t={id:e.interactionId,latency:e.duration,entries:[e]};nR[t.id]=t,nN.push(t)}nN.sort((e,t)=>t.latency-e.latency),nN.splice(10).forEach(e=>{delete nR[e.id]})}},nP=()=>{let e=Math.min(nN.length-1,Math.floor(nO()/50));return nN[e]},nM=(e,t={})=>{nm(()=>{let n;nC();let r=na("INP"),i=e=>{e.forEach(e=>{e.interactionId&&nD(e),"first-input"!==e.entryType||nN.some(t=>t.entries.some(t=>e.duration===t.duration&&e.startTime===t.startTime))||nD(e)});let t=nP();t&&t.latency!==r.value&&(r.value=t.latency,r.entries=t.entries,n())},o=nu("event",i,{durationThreshold:null!=t.durationThreshold?t.durationThreshold:40});n=nr(e,r,nA,t.reportAllChanges),o&&("PerformanceEventTiming"in ec&&"interactionId"in PerformanceEventTiming.prototype&&o.observe({type:"first-input",buffered:!0}),nl(()=>{i(o.takeRecords()),r.value<0&&nO()>0&&(r.value=0,r.entries=[]),n(!0)}))})},nL=[2500,4e3],nU={},nj=(e,t={})=>{nm(()=>{let n;let r=ng(),i=na("LCP"),o=e=>{let t=e[e.length-1];t&&t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-ns(),0),i.entries=[t],n())},s=nu("largest-contentful-paint",o);if(s){n=nr(e,i,nL,t.reportAllChanges);let r=nc(()=>{nU[i.id]||(o(s.takeRecords()),s.disconnect(),nU[i.id]=!0,n(!0))});["keydown","click"].forEach(e=>{ec.document&&addEventListener(e,()=>setTimeout(r,0),!0)}),nl(r)}})},nq=[800,1800],nF=e=>{ec.document&&ec.document.prerendering?nm(()=>nF(e)):ec.document&&"complete"!==ec.document.readyState?addEventListener("load",()=>nF(e),!0):setTimeout(e,0)},n$=(e,t={})=>{let n=na("TTFB"),r=nr(e,n,nq,t.reportAllChanges);nF(()=>{let e=no();if(e){let t=e.responseStart;if(t<=0||t>performance.now())return;n.value=Math.max(t-ns(),0),n.entries=[e],r(!0)}})},nB={},nz={};function nV(e,t=!1){return n1("cls",e,nX,l,t)}function nG(e,t=!1){return n1("lcp",e,nZ,d,t)}function nW(e){return n1("fid",e,nQ,c)}function nH(e){return n1("inp",e,n0,f)}function nK(e,t){return n2(e,t),nz[e]||(function(e){let t={};"event"===e&&(t.durationThreshold=0),nu(e,t=>{nJ(e,{entries:t})},t)}(e),nz[e]=!0),n3(e,t)}function nJ(e,t){let n=nB[e];if(n&&n.length)for(let r of n)try{r(t)}catch(t){tM&&D.kg.error(`Error while triggering instrumentation handler.
Type: ${e}
Name: ${(0,H.$P)(r)}
Error:`,t)}}function nX(){return nb(e=>{nJ("cls",{metric:e}),l=e},{reportAllChanges:!0})}function nQ(){return nS(e=>{nJ("fid",{metric:e}),c=e})}function nZ(){return nj(e=>{nJ("lcp",{metric:e}),d=e},{reportAllChanges:!0})}function nY(){return n$(e=>{nJ("ttfb",{metric:e}),h=e})}function n0(){return nM(e=>{nJ("inp",{metric:e}),f=e})}function n1(e,t,n,r,i=!1){let o;return n2(e,t),nz[e]||(o=n(),nz[e]=!0),r&&t({metric:r}),n3(e,t,i?o:void 0)}function n2(e,t){nB[e]=nB[e]||[],nB[e].push(t)}function n3(e,t,n){return()=>{n&&n();let r=nB[e];if(!r)return;let i=r.indexOf(t);-1!==i&&r.splice(i,1)}}function n4(e){return"number"==typeof e&&isFinite(e)}function n5(e,t,n,{...r}){let i=(0,eA.XU)(e).start_timestamp;return i&&i>t&&"function"==typeof e.updateStartTime&&e.updateStartTime(t),t8(e,()=>{let e=t9({startTime:t,...r});return e&&e.end(n),e})}function n6(e){let t;let n=(0,V.s3)();if(!n)return;let{name:r,transaction:i,attributes:o,startTime:s}=e,{release:a,environment:u}=n.getOptions(),l=n.getIntegrationByName("Replay"),c=l&&l.getReplayId(),d=(0,V.nZ)(),h=d.getUser(),f=void 0!==h?h.email||h.id||h.ip_address:void 0;try{t=d.getScopeData().contexts.profile.profile_id}catch(e){}return t9({name:r,attributes:{release:a,environment:u,user:f||void 0,profile_id:t||void 0,replay_id:c||void 0,transaction:i,"user_agent.original":ec.navigator&&ec.navigator.userAgent,...o},startTime:s,experimental:{standalone:!0}})}function n9(){return ec&&ec.addEventListener&&ec.performance}function n8(e){return e/1e3}let n7=0,re={};function rt(e,t,n,r,i,o){let s=o?t[o]:t[`${n}End`],a=t[`${n}Start`];a&&s&&n5(e,r+n8(a),r+n8(s),{op:`browser.${i||n}`,name:t.name,attributes:{[tK.S3]:"auto.ui.browser.metrics"}})}function rn(e,t,n,r){let i=t[n];null!=i&&i<2147483647&&(e[r]=i)}let rr=[],ri=new Map,ro={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};var rs=n(69737);let ra={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3};function ru(e,t={}){let n;let r=new Map,i=!1,o="externalFinish",s=!t.disableAutoFinish,a=[],{idleTimeout:u=ra.idleTimeout,finalTimeout:l=ra.finalTimeout,childSpanTimeout:c=ra.childSpanTimeout,beforeSpanEnd:d}=t,h=(0,V.s3)();if(!h||!(0,tJ.z)())return new tQ;let f=(0,V.nZ)(),p=(0,eA.HN)(),g=function(e){let t=t9(e);return(0,tX.D)((0,V.nZ)(),t),L.X&&D.kg.log("[Tracing] Started span is an idle span"),t}(e);function m(){n&&(clearTimeout(n),n=void 0)}function y(e){m(),n=setTimeout(()=>{!i&&0===r.size&&s&&(o="idleTimeout",g.end(e))},u)}function v(e){n=setTimeout(()=>{!i&&s&&(o="heartbeatFailed",g.end(e))},c)}function _(e){i=!0,r.clear(),a.forEach(e=>e()),(0,tX.D)(f,p);let t=(0,eA.XU)(g),{start_timestamp:n}=t;if(!n)return;(t.data||{})[tK.ju]||g.setAttribute(tK.ju,o),D.kg.log(`[Tracing] Idle span "${t.op}" finished`);let s=(0,eA.Dp)(g).filter(e=>e!==g),c=0;s.forEach(t=>{t.isRecording()&&(t.setStatus({code:rs.jt,message:"cancelled"}),t.end(e),L.X&&D.kg.log("[Tracing] Cancelling span since span ended early",JSON.stringify(t,void 0,2)));let{timestamp:n=0,start_timestamp:r=0}=(0,eA.XU)(t),i=r<=e,o=n-r<=(l+u)/1e3;if(L.X){let e=JSON.stringify(t,void 0,2);i?o||D.kg.log("[Tracing] Discarding span since it finished after idle span final timeout",e):D.kg.log("[Tracing] Discarding span since it happened after idle span was finished",e)}(!o||!i)&&((0,eA.ed)(g,t),c++)}),c>0&&g.setAttribute("sentry.idle_span_discarded_spans",c)}return g.end=new Proxy(g.end,{apply(e,t,n){d&&d(g);let[r,...i]=n,o=r||(0,ex.ph)(),s=(0,eA.$k)(o),a=(0,eA.Dp)(g).filter(e=>e!==g);if(!a.length)return _(s),Reflect.apply(e,t,[s,...i]);let u=a.map(e=>(0,eA.XU)(e).timestamp).filter(e=>!!e),c=u.length?Math.max(...u):void 0,h=(0,eA.XU)(g).start_timestamp,f=Math.min(h?h+l/1e3:1/0,Math.max(h||-1/0,Math.min(s,c||1/0)));return _(f),Reflect.apply(e,t,[f,...i])}}),a.push(h.on("spanStart",e=>{if(!i&&e!==g&&!(0,eA.XU)(e).timestamp&&(0,eA.Dp)(g).includes(e)){var t;t=e.spanContext().spanId,m(),r.set(t,!0),v((0,ex.ph)()+c/1e3)}})),a.push(h.on("spanEnd",e=>{var t;i||(t=e.spanContext().spanId,r.has(t)&&r.delete(t),0===r.size&&y((0,ex.ph)()+u/1e3))})),a.push(h.on("idleSpanEnableAutoFinish",e=>{e===g&&(s=!0,y(),r.size&&v())})),t.disableAutoFinish||y(),setTimeout(()=>{i||(g.setStatus({code:rs.jt,message:"deadline_exceeded"}),o="finalTimeout",g.end())},l),g}let rl=!1;function rc(){let e=(0,eA.HN)(),t=e&&(0,eA.Gx)(e);if(t){let e="internal_error";L.X&&D.kg.log(`[Tracing] Root span: ${e} -> Global error occured`),t.setStatus({code:rs.jt,message:e})}}rc.tag="sentry_tracingErrorCallback";var rd=n(85712),rh=n(19548),rf=n(60859);function rp(e){return e.split(",").filter(e=>!e.split("=")[0].startsWith(rf.lq)).join(",")}let rg=new WeakMap,rm=new Map,ry={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function rv(e){let{url:t}=(0,eA.XU)(e).data||{};if(!t||"string"!=typeof t)return;let n=nK("resource",({entries:r})=>{r.forEach(r=>{"resource"===r.entryType&&"initiatorType"in r&&"string"==typeof r.nextHopProtocol&&("fetch"===r.initiatorType||"xmlhttprequest"===r.initiatorType)&&r.name.endsWith(t)&&((function(e){let{name:t,version:n}=function(e){let t="unknown",n="unknown",r="";for(let i of e){if("/"===i){[t,n]=e.split("/");break}if(!isNaN(Number(i))){t="h"===r?"http":r,n=e.split(r)[1];break}r+=i}return r===e&&(t=r),{name:t,version:n}}(e.nextHopProtocol),r=[];return(r.push(["network.protocol.version",n],["network.protocol.name",t]),ex.Z1)?[...r,["http.request.redirect_start",r_(e.redirectStart)],["http.request.fetch_start",r_(e.fetchStart)],["http.request.domain_lookup_start",r_(e.domainLookupStart)],["http.request.domain_lookup_end",r_(e.domainLookupEnd)],["http.request.connect_start",r_(e.connectStart)],["http.request.secure_connection_start",r_(e.secureConnectionStart)],["http.request.connection_end",r_(e.connectEnd)],["http.request.request_start",r_(e.requestStart)],["http.request.response_start",r_(e.responseStart)],["http.request.response_end",r_(e.responseEnd)]]:r})(r).forEach(t=>e.setAttribute(...t)),setTimeout(n))})})}function r_(e=0){return((ex.Z1||performance.timeOrigin)+e)/1e3}function rb(e){try{return new URL(e,eG.location.origin).href}catch(e){return}}let rw={...ra,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,_experiments:{},...ry},rS=(e={})=>{rl||(rl=!0,tf(rc),tm(rc));let{enableInp:t,enableLongTask:n,enableLongAnimationFrame:r,_experiments:{enableInteractions:i,enableStandaloneClsSpans:o},beforeStartSpan:s,idleTimeout:a,finalTimeout:u,childSpanTimeout:l,markBackgroundSpan:c,traceFetch:d,traceXHR:f,trackFetchStreamPerformance:m,shouldCreateSpanForRequest:y,enableHTTPTimings:v,instrumentPageLoad:_,instrumentNavigation:b}={...rw,...e},w=function({recordClsStandaloneSpans:e}){let t=n9();if(t&&ex.Z1){t.mark&&ec.performance.mark("sentry-tracing-init");let n=nW(({metric:e})=>{let t=e.entries[e.entries.length-1];if(!t)return;let n=n8(ex.Z1),r=n8(t.startTime);tM&&D.kg.log("[Measurements] Adding FID"),re.fid={value:e.value,unit:"millisecond"},re["mark.fid"]={value:n+r,unit:"second"}}),r=nG(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(tM&&D.kg.log("[Measurements] Adding LCP"),re.lcp={value:e.value,unit:"millisecond"},p=t)},!0),i=n1("ttfb",({metric:e})=>{e.entries[e.entries.length-1]&&(tM&&D.kg.log("[Measurements] Adding TTFB"),re.ttfb={value:e.value,unit:"millisecond"})},nY,h),o=e?function(){let e,t,n=0;if(!function(){try{return nt([PerformanceObserver,"access",e=>e.supportedEntryTypes,"optionalAccess",e=>e.includes,"call",e=>e("layout-shift")])}catch(e){return!1}}())return;let r=!1;function i(){r||(r=!0,t&&function(e,t,n){tM&&D.kg.log(`Sending CLS span (${e})`);let r=n8((ex.Z1||0)+(nt([t,"optionalAccess",e=>e.startTime])||0)),i=(0,V.nZ)().getScopeData().transactionName,o=n6({name:t?(0,te.Rt)(nt([t,"access",e=>e.sources,"access",e=>e[0],"optionalAccess",e=>e.node])):"Layout shift",transaction:i,attributes:(0,z.Jr)({[tK.S3]:"auto.http.browser.cls",[tK.$J]:"ui.webvital.cls",[tK.JQ]:nt([t,"optionalAccess",e=>e.duration])||0,"sentry.pageload.span_id":n}),startTime:r});nt([o,"optionalAccess",e=>e.addEvent,"call",t=>t("cls",{[tK.E1]:"",[tK.Wb]:e})]),nt([o,"optionalAccess",e=>e.end,"call",e=>e(r)])}(n,e,t),o())}let o=nV(({metric:t})=>{let r=t.entries[t.entries.length-1];r&&(n=t.value,e=r)},!0);nl(()=>{i()}),setTimeout(()=>{let e=nt([(0,V.s3)(),"optionalAccess",e=>e.on,"call",t=>t("startNavigationSpan",()=>{i(),e&&e()})]),n=(0,eA.HN)(),r=n&&(0,eA.Gx)(n),o=r&&(0,eA.XU)(r);o&&"pageload"===o.op&&(t=r.spanContext().spanId)},0)}():nV(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(tM&&D.kg.log(`[Measurements] Adding CLS ${e.value}`),re.cls={value:e.value,unit:""},g=t)},!0);return()=>{n(),r(),i(),o&&o()}}return()=>void 0}({recordClsStandaloneSpans:o||!1});t&&function(){if(n9()&&ex.Z1){let e=nH(({metric:e})=>{if(void 0==e.value)return;let t=e.entries.find(t=>t.duration===e.value&&ro[t.name]);if(!t)return;let{interactionId:n}=t,r=ro[t.name],i=n8(ex.Z1+t.startTime),o=n8(e.value),s=(0,eA.HN)(),a=s?(0,eA.Gx)(s):void 0,u=(null!=n?ri.get(n):void 0)||a,l=u?(0,eA.XU)(u).description:(0,V.nZ)().getScopeData().transactionName,c=n6({name:(0,te.Rt)(t.target),transaction:l,attributes:(0,z.Jr)({[tK.S3]:"auto.http.browser.inp",[tK.$J]:`ui.interaction.${r}`,[tK.JQ]:t.duration}),startTime:i});nt([c,"optionalAccess",e=>e.addEvent,"call",t=>t("inp",{[tK.E1]:"millisecond",[tK.Wb]:e.value})]),nt([c,"optionalAccess",e=>e.end,"call",e=>e(i+o)])})}}(),r&&Y.GLOBAL_OBJ.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?new PerformanceObserver(e=>{if((0,eA.HN)())for(let t of e.getEntries()){if(!t.scripts[0])continue;let e=n8(ex.Z1+t.startTime),n=n8(t.duration),r={[tK.S3]:"auto.ui.browser.metrics"},{invoker:i,invokerType:o,sourceURL:s,sourceFunctionName:a,sourceCharPosition:u}=t.scripts[0];r["browser.script.invoker"]=i,r["browser.script.invoker_type"]=o,s&&(r["code.filepath"]=s),a&&(r["code.function"]=a),-1!==u&&(r["browser.script.source_char_position"]=u);let l=t9({name:"Main UI thread blocked",op:"ui.long-animation-frame",startTime:e,attributes:r});l&&l.end(e+n)}}).observe({type:"long-animation-frame",buffered:!0}):n&&nK("longtask",({entries:e})=>{if((0,eA.HN)())for(let t of e){let e=n8(ex.Z1+t.startTime),n=n8(t.duration),r=t9({name:"Main UI thread blocked",op:"ui.long-task",startTime:e,attributes:{[tK.S3]:"auto.ui.browser.metrics"}});r&&r.end(e+n)}}),i&&nK("event",({entries:e})=>{if((0,eA.HN)()){for(let t of e)if("click"===t.name){let e=n8(ex.Z1+t.startTime),n=n8(t.duration),r={name:(0,te.Rt)(t.target),op:`ui.interaction.${t.name}`,startTime:e,attributes:{[tK.S3]:"auto.ui.browser.metrics"}},i=(0,te.iY)(t.target);i&&(r.attributes["ui.component_name"]=i);let o=t9(r);o&&o.end(e+n)}}});let S={name:void 0,source:void 0};function E(e,t){let n="pageload"===t.op,r=s?s(t):t,i=r.attributes||{};t.name!==r.name&&(i[tK.Zj]="custom",r.attributes=i),S.name=r.name,S.source=i[tK.Zj];let c=ru(r,{idleTimeout:a,finalTimeout:u,childSpanTimeout:l,disableAutoFinish:n,beforeSpanEnd:e=>{w(),function(e,t){let n=n9();if(!n||!ec.performance.getEntries||!ex.Z1)return;tM&&D.kg.log("[Tracing] Adding & adjusting spans using Performance API");let r=n8(ex.Z1),i=n.getEntries(),{op:o,start_timestamp:s}=(0,eA.XU)(e);if(i.slice(n7).forEach(t=>{let n=n8(t.startTime),i=n8(Math.max(0,t.duration));if("navigation"!==o||!s||!(r+n<s))switch(t.entryType){case"navigation":["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(n=>{rt(e,t,n,r)}),rt(e,t,"secureConnection",r,"TLS/SSL","connectEnd"),rt(e,t,"fetch",r,"cache","domainLookupStart"),rt(e,t,"domainLookup",r,"DNS"),function(e,t,n){let r=n+n8(t.requestStart),i=n+n8(t.responseEnd),o=n+n8(t.responseStart);t.responseEnd&&(n5(e,r,i,{op:"browser.request",name:t.name,attributes:{[tK.S3]:"auto.ui.browser.metrics"}}),n5(e,o,i,{op:"browser.response",name:t.name,attributes:{[tK.S3]:"auto.ui.browser.metrics"}}))}(e,t,r);break;case"mark":case"paint":case"measure":{(function(e,t,n,r,i){let o=no(),s=i+Math.max(n,n8(o?o.requestStart:0)),a=i+n,u={[tK.S3]:"auto.resource.browser.metrics"};s!==a&&(u["sentry.browser.measure_happened_before_request"]=!0,u["sentry.browser.measure_start_time"]=s),n5(e,s,a+r,{name:t.name,op:t.entryType,attributes:u})})(e,t,n,i,r);let o=ng(),s=t.startTime<o.firstHiddenTime;"first-paint"===t.name&&s&&(tM&&D.kg.log("[Measurements] Adding FP"),re.fp={value:t.startTime,unit:"millisecond"}),"first-contentful-paint"===t.name&&s&&(tM&&D.kg.log("[Measurements] Adding FCP"),re.fcp={value:t.startTime,unit:"millisecond"});break}case"resource":(function(e,t,n,r,i,o){if("xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType)return;let s=ti(n),a={[tK.S3]:"auto.resource.browser.metrics"};rn(a,t,"transferSize","http.response_transfer_size"),rn(a,t,"encodedBodySize","http.response_content_length"),rn(a,t,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in t&&(a["resource.render_blocking_status"]=t.renderBlockingStatus),s.protocol&&(a["url.scheme"]=s.protocol.split(":").pop()),s.host&&(a["server.address"]=s.host),a["url.same_origin"]=n.includes(ec.location.origin);let u=o+r;n5(e,u,u+i,{name:n.replace(ec.location.origin,""),op:t.initiatorType?`resource.${t.initiatorType}`:"resource.other",attributes:a})})(e,t,t.name,n,i,r)}}),n7=Math.max(i.length-1,0),function(e){let t=ec.navigator;if(!t)return;let n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),n4(n.rtt)&&(re["connection.rtt"]={value:n.rtt,unit:"millisecond"})),n4(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),n4(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}(e),"pageload"===o){(function(e){let t=no();if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(tM&&D.kg.log("[Measurements] Adding TTFB Request Time"),e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})})(re);let n=re["mark.fid"];n&&re.fid&&(n5(e,n.value,n.value+n8(re.fid.value),{name:"first input delay",op:"ui.action",attributes:{[tK.S3]:"auto.ui.browser.metrics"}}),delete re["mark.fid"]),"fcp"in re&&t.recordClsOnPageloadSpan||delete re.cls,Object.entries(re).forEach(([e,t])=>{!function(e,t,n,r=(0,eA.HN)()){let i=r&&(0,eA.Gx)(r);i&&i.addEvent(e,{[tK.Wb]:t,[tK.E1]:n})}(e,t.value,t.unit)}),e.setAttribute("performance.timeOrigin",r),e.setAttribute("performance.activationStart",ns()),p&&(tM&&D.kg.log("[Measurements] Adding LCP Data"),p.element&&e.setAttribute("lcp.element",(0,te.Rt)(p.element)),p.id&&e.setAttribute("lcp.id",p.id),p.url&&e.setAttribute("lcp.url",p.url.trim().slice(0,200)),e.setAttribute("lcp.size",p.size)),g&&g.sources&&(tM&&D.kg.log("[Measurements] Adding CLS Data"),g.sources.forEach((t,n)=>e.setAttribute(`cls.source.${n+1}`,(0,te.Rt)(t.node))))}p=void 0,g=void 0,re={}}(e,{recordClsOnPageloadSpan:!o})}});function d(){["interactive","complete"].includes(eG.document.readyState)&&e.emit("idleSpanEnableAutoFinish",c)}return n&&eG.document&&(eG.document.addEventListener("readystatechange",()=>{d()}),d()),c}return{name:"BrowserTracing",afterAllSetup(e){let n,r;let o=eG.location&&eG.location.href;e.on("startNavigationSpan",t=>{(0,V.s3)()===e&&(n&&!(0,eA.XU)(n).timestamp&&(eU&&D.kg.log(`[Tracing] Finishing current root span with op: ${(0,eA.XU)(n).op}`),n.end()),n=E(e,{op:"navigation",...t}))}),e.on("startPageLoadSpan",(t,r={})=>{if((0,V.s3)()!==e)return;n&&!(0,eA.XU)(n).timestamp&&(eU&&D.kg.log(`[Tracing] Finishing current root span with op: ${(0,eA.XU)(n).op}`),n.end());let i=r.sentryTrace||rI("sentry-trace"),o=r.baggage||rI("baggage"),s=(0,rd.pT)(i,o);(0,V.nZ)().setPropagationContext(s),n=E(e,{op:"pageload",...t})}),e.on("spanEnd",e=>{let t=(0,eA.XU)(e).op;if(e!==(0,eA.Gx)(e)||"navigation"!==t&&"pageload"!==t)return;let n=(0,V.nZ)(),r=n.getPropagationContext();n.setPropagationContext({...r,sampled:void 0!==r.sampled?r.sampled:(0,eA.Tt)(e),dsc:r.dsc||(0,eC.jC)(e)})}),eG.location&&(_&&rE(e,{name:eG.location.pathname,startTime:ex.Z1?ex.Z1/1e3:void 0,attributes:{[tK.Zj]:"url",[tK.S3]:"auto.pageload.browser"}}),b&&ed(({to:t,from:n})=>{if(void 0===n&&o&&-1!==o.indexOf(t)){o=void 0;return}n!==t&&(o=void 0,rk(e,{name:eG.location.pathname,attributes:{[tK.Zj]:"url",[tK.S3]:"auto.navigation.browser"}}))})),c&&(eG&&eG.document?eG.document.addEventListener("visibilitychange",()=>{let e=(0,eA.HN)();if(!e)return;let t=(0,eA.Gx)(e);if(eG.document.hidden&&t){let e="cancelled",{op:n,status:r}=(0,eA.XU)(t);eU&&D.kg.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus({code:rs.jt,message:e}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):eU&&D.kg.warn("[Tracing] Could not set up background tab detection due to lack of global document")),i&&eG.document&&addEventListener("click",()=>{let e="ui.action.click",t=(0,eA.HN)(),n=t&&(0,eA.Gx)(t);if(n&&["navigation","pageload"].includes((0,eA.XU)(n).op)){eU&&D.kg.warn(`[Tracing] Did not create ${e} span because a pageload or navigation span is in progress.`);return}if(r&&(r.setAttribute(tK.ju,"interactionInterrupted"),r.end(),r=void 0),!S.name){eU&&D.kg.warn(`[Tracing] Did not create ${e} transaction because _latestRouteName is missing.`);return}r=ru({name:S.name,op:e,attributes:{[tK.Zj]:S.source||"url"}},{idleTimeout:a,finalTimeout:u,childSpanTimeout:l})},{once:!1,capture:!0}),t&&function(){let e=({entries:e})=>{let t=(0,eA.HN)(),n=t&&(0,eA.Gx)(t);e.forEach(e=>{if(!("duration"in e)||!n)return;let t=e.interactionId;if(!(null==t||ri.has(t))){if(rr.length>10){let e=rr.shift();ri.delete(e)}rr.push(t),ri.set(t,n)}})};nK("event",e),nK("first-input",e)}(),function(e,t){let{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:i,shouldCreateSpanForRequest:o,enableHTTPTimings:s,tracePropagationTargets:a}={traceFetch:ry.traceFetch,traceXHR:ry.traceXHR,trackFetchStreamPerformance:ry.trackFetchStreamPerformance,...t},u="function"==typeof o?o:e=>!0,l=e=>(function(e,t){let n=eG.location&&eG.location.href;if(n){let r,i;try{r=new URL(e,n),i=new URL(n).origin}catch(e){return!1}let o=r.origin===i;return t?(0,M.U0)(r.toString(),t)||o&&(0,M.U0)(r.pathname,t):o}{let n=!!e.match(/^\/(?!\/)/);return t?(0,M.U0)(e,t):n}})(e,a),c={};n&&(e.addEventProcessor(e=>("transaction"===e.type&&e.spans&&e.spans.forEach(e=>{if("http.client"===e.op){let t=rm.get(e.span_id);t&&(e.timestamp=t/1e3,rm.delete(e.span_id))}}),e)),i&&function(e){let t="fetch-body-resolved";es(t,e),ea(t,()=>e5(e9))}(e=>{if(e.response){let t=rg.get(e.response);t&&e.endTimestamp&&rm.set(t,e.endTimestamp)}}),e4(e=>{let t=function(e,t,n,r,i="auto.http.browser"){if(!e.fetchData)return;let o=(0,tJ.z)()&&t(e.fetchData.url);if(e.endTimestamp&&o){let t=e.fetchData.__span;if(!t)return;let n=r[t];n&&(function(e,t){if(t.response){(0,rs.Q0)(e,t.response.status);let n=t.response&&t.response.headers&&t.response.headers.get("content-length");if(n){let t=parseInt(n);t>0&&e.setAttribute("http.response_content_length",t)}}else t.error&&e.setStatus({code:rs.jt,message:"internal_error"});e.end()}(n,e),delete r[t]);return}let s=(0,V.nZ)(),a=(0,V.s3)(),{method:u,url:l}=e.fetchData,c=function(e){try{return new URL(e).href}catch(e){return}}(l),d=c?ti(c).host:void 0,h=!!(0,eA.HN)(),f=o&&h?t9({name:`${u} ${l}`,attributes:{url:l,type:"fetch","http.method":u,"http.url":c,"server.address":d,[tK.S3]:i,[tK.$J]:"http.client"}}):new tQ;if(e.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f,n(e.fetchData.url)&&a){let t=e.args[0];e.args[1]=e.args[1]||{};let n=e.args[1];n.headers=function(e,t,n,r,i){let{traceId:o,spanId:s,sampled:a,dsc:u}={...(0,V.aF)().getPropagationContext(),...n.getPropagationContext()},l=i?(0,eA.Hb)(i):(0,rd.$p)(o,s,a),c=(0,rf.IQ)(u||(i?(0,eC.jC)(i):(0,eC._l)(o,t))),d=r.headers||("undefined"!=typeof Request&&(0,ey.V9)(e,Request)?e.headers:void 0);if(!d)return{"sentry-trace":l,baggage:c};if("undefined"!=typeof Headers&&(0,ey.V9)(d,Headers)){let e=new Headers(d);if(e.set("sentry-trace",l),c){let t=e.get(rf.bU);if(t){let n=rp(t);e.set(rf.bU,n?`${n},${c}`:c)}else e.set(rf.bU,c)}return e}if(Array.isArray(d)){let e=[...d.filter(e=>!(Array.isArray(e)&&"sentry-trace"===e[0])).map(e=>{if(!Array.isArray(e)||e[0]!==rf.bU||"string"!=typeof e[1])return e;{let[t,n,...r]=e;return[t,rp(n),...r]}}),["sentry-trace",l]];return c&&e.push([rf.bU,c]),e}{let e="baggage"in d?d.baggage:void 0,t=[];return Array.isArray(e)?t=e.map(e=>"string"==typeof e?rp(e):e).filter(e=>""===e):e&&t.push(rp(e)),c&&t.push(c),{...d,"sentry-trace":l,baggage:t.length>0?t.join(","):void 0}}}(t,a,s,n,(0,tJ.z)()&&h?f:void 0)}return f}(e,u,l,c);if(e.response&&e.fetchData.__span&&rg.set(e.response,e.fetchData.__span),t){let n=rb(e.fetchData.url),r=n?ti(n).host:void 0;t.setAttributes({"http.url":n,"server.address":r})}s&&t&&rv(t)})),r&&eY(e=>{let t=function(e,t,n,r){let i=e.xhr,o=i&&i[eZ];if(!i||i.__sentry_own_request__||!o)return;let s=(0,tJ.z)()&&t(o.url);if(e.endTimestamp&&s){let e=i.__sentry_xhr_span_id__;if(!e)return;let t=r[e];t&&void 0!==o.status_code&&((0,rs.Q0)(t,o.status_code),t.end(),delete r[e]);return}let a=rb(o.url),u=a?ti(a).host:void 0,l=!!(0,eA.HN)(),c=s&&l?t9({name:`${o.method} ${o.url}`,attributes:{type:"xhr","http.method":o.method,"http.url":a,url:o.url,"server.address":u,[tK.S3]:"auto.http.browser",[tK.$J]:"http.client"}}):new tQ;i.__sentry_xhr_span_id__=c.spanContext().spanId,r[i.__sentry_xhr_span_id__]=c;let d=(0,V.s3)();return i.setRequestHeader&&n(o.url)&&d&&function(e,t,n){let r=(0,V.nZ)(),{traceId:i,spanId:o,sampled:s,dsc:a}={...(0,V.aF)().getPropagationContext(),...r.getPropagationContext()};(function(e,t,n){try{e.setRequestHeader("sentry-trace",t),n&&e.setRequestHeader(rf.bU,n)}catch(e){}})(e,n&&(0,tJ.z)()?(0,eA.Hb)(n):(0,rd.$p)(i,o,s),(0,rf.IQ)(a||(n?(0,eC.jC)(n):(0,eC._l)(i,t))))}(i,d,(0,tJ.z)()&&l?c:void 0),c}(e,u,l,c);s&&t&&rv(t)})}(e,{traceFetch:d,traceXHR:f,trackFetchStreamPerformance:m,tracePropagationTargets:e.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:y,enableHTTPTimings:v})}}};function rE(e,t,n){e.emit("startPageLoadSpan",t,n),(0,V.nZ)().setTransactionName(t.name);let r=(0,eA.HN)();return"pageload"===(r&&(0,eA.XU)(r).op)?r:void 0}function rk(e,t){(0,V.aF)().setPropagationContext((0,rh.Q)()),(0,V.nZ)().setPropagationContext((0,rh.Q)()),e.emit("startNavigationSpan",t),(0,V.nZ)().setTransactionName(t.name);let n=(0,eA.HN)();return"navigation"===(n&&(0,eA.XU)(n).op)?n:void 0}function rI(e){let t=(0,te.qT)(`meta[name=${e}]`);return t?t.getAttribute("content"):void 0}let rT="incomplete-app-router-transaction",rx=Y.GLOBAL_OBJ;function rC(e){try{return new URL(e,"http://some-random-base.com/").pathname}catch(e){return"/"}}var rA=n(11163),rO=n(36096);let rN=rA.events?rA:rA.default,rR=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function rD(...e){let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:"/";i&&(t=`${i}/${t}`,n="/"===i.charAt(0))}return t=(function(e,t){let n=0;for(let t=e.length-1;t>=0;t--){let r=e[t];"."===r?e.splice(t,1):".."===r?(e.splice(t,1),n++):n&&(e.splice(t,1),n--)}if(t)for(;n--;n)e.unshift("..");return e})(t.split("/").filter(e=>!!e),!n).join("/"),(n?"/":"")+t||"."}function rP(e){let t=0;for(;t<e.length&&""===e[t];t++);let n=e.length-1;for(;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}let rM=(e={})=>{let t=e.root,n=e.prefix||"app:///",r="window"in Y.GLOBAL_OBJ&&void 0!==Y.GLOBAL_OBJ.window,i=e.iteratee||function({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;let i=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes("\\")&&!r.filename.includes("/"),o=/^\//.test(r.filename);if(e){if(t){let e=r.filename;0===e.indexOf(t)&&(r.filename=e.replace(t,n))}}else if(i||o){var s;let e;let o=i?r.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):r.filename,a=t?function(e,t){e=rD(e).slice(1),t=rD(t).slice(1);let n=rP(e.split("/")),r=rP(t.split("/")),i=Math.min(n.length,r.length),o=i;for(let e=0;e<i;e++)if(n[e]!==r[e]){o=e;break}let s=[];for(let e=o;e<n.length;e++)s.push("..");return(s=s.concat(r.slice(o))).join("/")}(t,o):(e=function(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=rR.exec(t);return n?n.slice(1):[]}(o)[2]||"",s&&e.slice(-1*s.length)===s&&(e=e.slice(0,e.length-s.length)),e);r.filename=`${n}${a}`}return r}}({isBrowser:r,root:t,prefix:n});return{name:"RewriteFrames",processEvent(e){let t=e;return e.exception&&Array.isArray(e.exception.values)&&(t=function(e){try{return{...e,exception:{...e.exception,values:e.exception.values.map(e=>{var t;return{...e,...e.stacktrace&&{stacktrace:{...t=e.stacktrace,frames:t&&t.frames&&t.frames.map(e=>i(e))}}}})}}}catch(t){return e}}(t)),t}}},rL=({assetPrefixPath:e})=>({...rM({iteratee:t=>{try{let{origin:n}=new URL(t.filename);t.filename=nt([t,"access",e=>e.filename,"optionalAccess",e=>e.replace,"call",e=>e(n,"app://"),"access",e=>e.replace,"call",t=>t(e,"")])}catch(e){}return t.filename&&t.filename.startsWith("app:///_next")&&(t.filename=decodeURI(t.filename)),t.filename&&t.filename.match(/^app:\/\/\/_next\/static\/chunks\/(main-|main-app-|polyfills-|webpack-|framework-|framework\.)[0-9a-f]+\.js$/)&&(t.in_app=!1),t}}),name:"NextjsClientStackFrameNormalization"}),rU=Y.GLOBAL_OBJ,rj=Y.GLOBAL_OBJ;function rq(e,t){let n=t&&t.getDsn(),r=t&&t.getOptions().tunnel;return!!n&&e.includes(n.host)||!!r&&rF(e)===rF(r)}function rF(e){return"/"===e[e.length-1]?e.slice(0,-1):e}var r$=n(83454);function rB(){return"undefined"!=typeof window&&(!(!("undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call(void 0!==r$?r$:0))||void 0!==Y.GLOBAL_OBJ.process&&"renderer"===Y.GLOBAL_OBJ.process.type)}let rz=Y.GLOBAL_OBJ,rV="sentryReplaySession",rG="Unable to send Replay";function rW(e,t){return null!=e?e:t()}function rH(e){let t;let n=e[0],r=1;for(;r<e.length;){let i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):("call"===i||"optionalCall"===i)&&(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}function rK(e){let t=rH([e,"optionalAccess",e=>e.host]);return rH([t,"optionalAccess",e=>e.shadowRoot])===e}function rJ(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function rX(e){try{var t;let n=e.rules||e.cssRules;return n?((t=Array.from(n,rQ).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}}function rQ(e){let t;if("styleSheet"in e)try{t=rX(e.styleSheet)||function(e){let{cssText:t}=e;if(t.split('"').length<3)return t;let n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if("selectorText"in e&&e.selectorText.includes(":"))return e.cssText.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2");return t||e.cssText}(S=C||(C={}))[S.Document=0]="Document",S[S.DocumentType=1]="DocumentType",S[S.Element=2]="Element",S[S.Text=3]="Text",S[S.CDATA=4]="CDATA",S[S.Comment=5]="Comment";class rZ{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){return e?rW(rH([this,"access",e=>e.getMeta,"call",t=>t(e),"optionalAccess",e=>e.id]),()=>-1):-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function rY({maskInputOptions:e,tagName:t,type:n}){return"OPTION"===t&&(t="SELECT"),!!(e[t.toLowerCase()]||n&&e[n]||"password"===n||"INPUT"===t&&!n&&e.text)}function r0({isMasked:e,element:t,value:n,maskInputFn:r}){let i=n||"";return e?(r&&(i=r(i,t)),"*".repeat(i.length)):i}function r1(e){return e.toLowerCase()}function r2(e){return e.toUpperCase()}let r3="__rrweb_original__";function r4(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?r1(t):null}function r5(e,t,n){return"INPUT"===t&&("radio"===n||"checkbox"===n)?e.getAttribute("value")||"":e.value}function r6(e,t){let n;try{n=new URL(e,rW(t,()=>window.location.href))}catch(e){return null}return rW(rH([n.pathname.match(/\.([0-9a-z]+)(?:$)/i),"optionalAccess",e=>e[1]]),()=>null)}let r9={};function r8(e){let t=r9[e];if(t)return t;let n=window.document,r=window[e];if(n&&"function"==typeof n.createElement)try{let t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch(e){}return r9[e]=r.bind(window)}function r7(...e){return r8("setTimeout")(...e)}function ie(...e){return r8("clearTimeout")(...e)}let it=1,ir=RegExp("[^a-z0-9-_:]");function ii(){return it++}let io=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,is=/^(?:[a-z+]+:)?\/\//i,ia=/^www\..*/i,iu=/^(data:)([^,]*),(.*)/i;function il(e,t){return(e||"").replace(io,(e,n,r,i,o,s)=>{let a=r||o||s,u=n||i||"";if(!a)return e;if(is.test(a)||ia.test(a)||iu.test(a))return`url(${u}${a}${u})`;if("/"===a[0])return`url(${u}${(t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0]).split("?")[0]+a}${u})`;let l=t.split("/"),c=a.split("/");for(let e of(l.pop(),c))"."!==e&&(".."===e?l.pop():l.push(e));return`url(${u}${l.join("/")}${u})`})}let ic=/^[^ \t\n\r\u000c]+/,id=/^[, \t\n\r\u000c]+/,ih=new WeakMap;function ip(e,t){return t&&""!==t.trim()?ig(e,t):t}function ig(e,t){let n=ih.get(e);if(n||(n=e.createElement("a"),ih.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function im(e,t,n,r,i,o){return r?"src"!==n&&("href"!==n||"use"===t&&"#"===r[0])&&("xlink:href"!==n||"#"===r[0])&&("background"!==n||"table"!==t&&"td"!==t&&"th"!==t)?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;let i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}let i=[];for(;r(id),!(n>=t.length);){let o=r(ic);if(","===o.slice(-1))o=ip(e,o.substring(0,o.length-1)),i.push(o);else{let r="";o=ip(e,o);let s=!1;for(;;){let e=t.charAt(n);if(""===e){i.push((o+r).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,i.push((o+r).trim());break}"("===e&&(s=!0)}r+=e,n+=1}}}return i.join(", ")}(e,r):"style"===n?il(r,ig(e)):"object"===t&&"data"===n?ip(e,r):"function"==typeof o?o(n,r,i):r:ip(e,r):r}function iy(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function iv(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:iv(e.parentNode,t,n,r+1)}function i_(e,t){return n=>{if(null===n)return!1;try{if(e){if("string"==typeof e){if(n.matches(`.${e}`))return!0}else if(function(e,t){for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return!1}(n,e))return!0}if(t&&n.matches(t))return!0;return!1}catch(e){return!1}}}function ib(e,t,n,r,i,o){try{let s=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===s)return!1;if("INPUT"===s.tagName){let e=s.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(e))return!0}let a=-1,u=-1;if(o){if((u=iv(s,i_(r,i)))<0)return!0;a=iv(s,i_(t,n),u>=0?u:1/0)}else{if((a=iv(s,i_(t,n)))<0)return!1;u=iv(s,i_(r,i),a>=0?a:1/0)}return a>=0?!(u>=0)||a<=u:!(u>=0)&&!!o}catch(e){}return!!o}function iw(e){return null==e?"":e.toLowerCase()}function iS(e,t){let n;let{doc:r,mirror:i,blockClass:o,blockSelector:s,unblockSelector:a,maskAllText:u,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:h,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:g={},maskAttributeFn:v,maskTextFn:_,maskInputFn:b,slimDOMOptions:w,dataURLOptions:S={},inlineImages:E=!1,recordCanvas:k=!1,onSerialize:I,onIframeLoad:T,iframeLoadTimeout:x=5e3,onStylesheetLoad:A,stylesheetLoadTimeout:O=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:R=!1}=t,{preserveWhiteSpace:D=!0}=t,P=function(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:o,unblockSelector:s,maskAllText:a,maskAttributeFn:u,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:h,inlineStylesheet:f,maskInputOptions:p={},maskTextFn:g,maskInputFn:v,dataURLOptions:_={},inlineImages:b,recordCanvas:w,keepIframeSrcFn:S,newlyAddedElement:E=!1}=t,k=function(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:if("CSS1Compat"!==e.compatMode)return{type:C.Document,childNodes:[],compatMode:e.compatMode};return{type:C.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:C.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:k};case e.ELEMENT_NODE:return function(e,t){let n;let{doc:r,blockClass:i,blockSelector:o,unblockSelector:s,inlineStylesheet:a,maskInputOptions:u={},maskAttributeFn:l,maskInputFn:c,dataURLOptions:d={},inlineImages:h,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g=!1,rootId:v,maskAllText:_,maskTextClass:b,unmaskTextClass:w,maskTextSelector:S,unmaskTextSelector:E}=t,k=function(e,t,n,r){try{if(r&&e.matches(r))return!1;if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,i,o,s),I=function(e){if(e instanceof HTMLFormElement)return"form";let t=r1(e.tagName);return ir.test(t)?"div":t}(e),T={},x=e.attributes.length;for(let t=0;t<x;t++){let n=e.attributes[t];n.name&&!iy(I,n.name,n.value)&&(T[n.name]=im(r,I,r1(n.name),n.value,e,l))}if("link"===I&&a){let t=Array.from(r.styleSheets).find(t=>t.href===e.href),n=null;t&&(n=rX(t)),n&&(delete T.rel,delete T.href,T._cssText=il(n,t.href))}if("style"===I&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){let t=rX(e.sheet);t&&(T._cssText=il(t,ig(r)))}if("input"===I||"textarea"===I||"select"===I||"option"===I){let t=r4(e),n=r5(e,r2(I),t),r=e.checked;if("submit"!==t&&"button"!==t&&n){let r=ib(e,b,S,w,E,rY({type:t,tagName:r2(I),maskInputOptions:u}));T.value=r0({isMasked:r,element:e,value:n,maskInputFn:c})}r&&(T.checked=r)}if("option"===I&&(e.selected&&!u.select?T.selected=!0:delete T.selected),"canvas"===I&&f){if("2d"===e.__context)!function(e){let t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){let i=t.getImageData,o=r3 in i?i[r3]:i;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>0!==e))return!1}return!0}(e)&&(T.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){let t=e.toDataURL(d.type,d.quality),n=r.createElement("canvas");n.width=e.width,n.height=e.height,t!==n.toDataURL(d.type,d.quality)&&(T.rr_dataURL=t)}}if("img"===I&&h){m||(y=(m=r.createElement("canvas")).getContext("2d"));let t=e.currentSrc||e.getAttribute("src")||"<unknown-src>",n=e.crossOrigin,i=()=>{e.removeEventListener("load",i);try{m.width=e.naturalWidth,m.height=e.naturalHeight,y.drawImage(e,0,0),T.rr_dataURL=m.toDataURL(d.type,d.quality)}catch(n){if("anonymous"!==e.crossOrigin){e.crossOrigin="anonymous",e.complete&&0!==e.naturalWidth?i():e.addEventListener("load",i);return}console.warn(`Cannot inline img src=${t}! Error: ${n}`)}"anonymous"===e.crossOrigin&&(n?T.crossOrigin=n:e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?i():e.addEventListener("load",i)}if(("audio"===I||"video"===I)&&(T.rr_mediaState=e.paused?"paused":"played",T.rr_mediaCurrentTime=e.currentTime),!g&&(e.scrollLeft&&(T.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(T.rr_scrollTop=e.scrollTop)),k){let{width:t,height:n}=e.getBoundingClientRect();T={class:T.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==I||p(T.src)||(k||e.contentDocument||(T.rr_src=T.src),delete T.src);try{customElements.get(I)&&(n=!0)}catch(e){}return{type:C.Element,tagName:I,attributes:T,childNodes:[],isSVG:!!("svg"===e.tagName||e.ownerSVGElement)||void 0,needBlock:k,rootId:v,isCustom:n}}(e,{doc:n,blockClass:i,blockSelector:o,unblockSelector:s,inlineStylesheet:f,maskAttributeFn:u,maskInputOptions:p,maskInputFn:v,dataURLOptions:_,inlineImages:b,recordCanvas:w,keepIframeSrcFn:S,newlyAddedElement:E,rootId:k,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:h});case e.TEXT_NODE:return function(e,t){let{maskAllText:n,maskTextClass:r,unmaskTextClass:i,maskTextSelector:o,unmaskTextSelector:s,maskTextFn:a,maskInputOptions:u,maskInputFn:l,rootId:c}=t,d=e.parentNode&&e.parentNode.tagName,h=e.textContent,f="STYLE"===d||void 0,p="SCRIPT"===d||void 0,g="TEXTAREA"===d||void 0;if(f&&h){try{e.nextSibling||e.previousSibling||rH([e,"access",e=>e.parentNode,"access",e=>e.sheet,"optionalAccess",e=>e.cssRules])&&(h=rX(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}h=il(h,ig(t.doc))}p&&(h="SCRIPT_PLACEHOLDER");let m=ib(e,r,o,i,s,n);return f||p||g||!h||!m||(h=a?a(h,e.parentElement):h.replace(/[\S]/g,"*")),g&&h&&(u.textarea||m)&&(h=l?l(h,e.parentNode):h.replace(/[\S]/g,"*")),"OPTION"===d&&h&&(h=r0({isMasked:ib(e,r,o,i,s,rY({type:null,tagName:d,maskInputOptions:u})),element:e,value:h,maskInputFn:l})),{type:C.Text,textContent:h||"",isStyle:f,rootId:c}}(e,{doc:n,maskAllText:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:h,maskTextFn:g,maskInputOptions:p,maskInputFn:v,rootId:k});case e.CDATA_SECTION_NODE:return{type:C.CDATA,textContent:"",rootId:k};case e.COMMENT_NODE:return{type:C.Comment,textContent:e.textContent||"",rootId:k};default:return!1}}(e,{doc:r,mirror:i,blockClass:o,blockSelector:s,maskAllText:u,unblockSelector:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:h,inlineStylesheet:p,maskInputOptions:g,maskAttributeFn:v,maskTextFn:_,maskInputFn:b,dataURLOptions:S,inlineImages:E,recordCanvas:k,keepIframeSrcFn:N,newlyAddedElement:R});if(!P)return console.warn(e,"not serialized"),null;n=i.hasNode(e)?i.getId(e):!function(e,t){if(t.comment&&e.type===C.Comment)return!0;if(e.type===C.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===r6(e.attributes.href))||t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(iw(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===iw(e.attributes.name)||"icon"===iw(e.attributes.rel)||"apple-touch-icon"===iw(e.attributes.rel)||"shortcut icon"===iw(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&iw(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(iw(e.attributes.property).match(/^(og|twitter|fb):/)||iw(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===iw(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===iw(e.attributes.name)||"googlebot"===iw(e.attributes.name)||"bingbot"===iw(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;else if(t.headMetaAuthorship&&("author"===iw(e.attributes.name)||"generator"===iw(e.attributes.name)||"framework"===iw(e.attributes.name)||"publisher"===iw(e.attributes.name)||"progid"===iw(e.attributes.name)||iw(e.attributes.property).match(/^article:/)||iw(e.attributes.property).match(/^product:/)))return!0;else if(t.headMetaVerification&&("google-site-verification"===iw(e.attributes.name)||"yandex-verification"===iw(e.attributes.name)||"csrf-token"===iw(e.attributes.name)||"p:domain_verify"===iw(e.attributes.name)||"verify-v1"===iw(e.attributes.name)||"verification"===iw(e.attributes.name)||"shopify-checkout-api-token"===iw(e.attributes.name)))return!0}}return!1}(P,w)&&(D||P.type!==C.Text||P.isStyle||P.textContent.replace(/^\s+|\s+$/gm,"").length)?ii():-2;let M=Object.assign(P,{id:n});if(i.add(e,M),-2===n)return null;I&&I(e);let L=!f;if(M.type===C.Element){L=L&&!M.needBlock,delete M.needBlock;let t=e.shadowRoot;t&&rJ(t)&&(M.isShadowHost=!0)}if((M.type===C.Document||M.type===C.Element)&&L){w.headWhitespace&&M.type===C.Element&&"head"===M.tagName&&(D=!1);let t={doc:r,mirror:i,blockClass:o,blockSelector:s,maskAllText:u,unblockSelector:a,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:h,skipChild:f,inlineStylesheet:p,maskInputOptions:g,maskAttributeFn:v,maskTextFn:_,maskInputFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:E,recordCanvas:k,preserveWhiteSpace:D,onSerialize:I,onIframeLoad:T,iframeLoadTimeout:x,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:N};for(let n of Array.from(e.childNodes)){let e=iS(n,t);e&&M.childNodes.push(e)}if(e.nodeType===e.ELEMENT_NODE&&e.shadowRoot)for(let n of Array.from(e.shadowRoot.childNodes)){let r=iS(n,t);r&&(rJ(e.shadowRoot)&&(r.isShadow=!0),M.childNodes.push(r))}}return e.parentNode&&rK(e.parentNode)&&rJ(e.parentNode)&&(M.isShadow=!0),M.type===C.Element&&"iframe"===M.tagName&&function(e,t,n){let r;let i=e.contentWindow;if(!i)return;let o=!1;try{r=i.document.readyState}catch(e){return}if("complete"!==r){let r=r7(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{ie(r),o=!0,t()});return}let s="about:blank";if(i.location.href!==s||e.src===s||""===e.src)return r7(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{let t=e.contentDocument;if(t&&T){let n=iS(t,{doc:t,mirror:i,blockClass:o,blockSelector:s,unblockSelector:a,maskAllText:u,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskAttributeFn:v,maskTextFn:_,maskInputFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:E,recordCanvas:k,preserveWhiteSpace:D,onSerialize:I,onIframeLoad:T,iframeLoadTimeout:x,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:N});n&&T(e,n)}},x),M.type===C.Element&&"link"===M.tagName&&"string"==typeof M.attributes.rel&&("stylesheet"===M.attributes.rel||"preload"===M.attributes.rel&&"string"==typeof M.attributes.href&&"css"===r6(M.attributes.href))&&function(e,t,n){let r,i=!1;try{r=e.sheet}catch(e){return}if(r)return;let o=r7(()=>{i||(t(),i=!0)},n);e.addEventListener("load",()=>{ie(o),i=!0,t()})}(e,()=>{if(A){let t=iS(e,{doc:r,mirror:i,blockClass:o,blockSelector:s,unblockSelector:a,maskAllText:u,maskTextClass:l,unmaskTextClass:c,maskTextSelector:d,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:g,maskAttributeFn:v,maskTextFn:_,maskInputFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:E,recordCanvas:k,preserveWhiteSpace:D,onSerialize:I,onIframeLoad:T,iframeLoadTimeout:x,onStylesheetLoad:A,stylesheetLoadTimeout:O,keepIframeSrcFn:N});t&&A(e,t)}},O),M}function iE(e){let t;let n=e[0],r=1;for(;r<e.length;){let i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):("call"===i||"optionalCall"===i)&&(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}function ik(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}let iI="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",iT={map:{},getId:()=>(console.error(iI),-1),getNode:()=>(console.error(iI),null),removeNodeFromMap(){console.error(iI)},has:()=>(console.error(iI),!1),reset(){console.error(iI)}};function ix(e,t,n={}){let r=null,i=0;return function(...o){let s=Date.now();i||!1!==n.leading||(i=s);let a=t-(s-i),u=this;a<=0||a>t?(r&&(function(...e){iV("clearTimeout")(...e)}(r),r=null),i=s,e.apply(u,o)):r||!1===n.trailing||(r=iG(()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(u,o)},a))}}function iC(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(iT=new Proxy(iT,{get:(e,t,n)=>("map"===t&&console.error(iI),Reflect.get(e,t,n))}));let iA=Date.now;function iO(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:iE([t,"optionalAccess",e=>e.documentElement,"access",e=>e.scrollLeft])||iE([t,"optionalAccess",e=>e.body,"optionalAccess",e=>e.parentElement,"optionalAccess",e=>e.scrollLeft])||iE([t,"optionalAccess",e=>e.body,"optionalAccess",e=>e.scrollLeft])||0,top:t.scrollingElement?t.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:iE([t,"optionalAccess",e=>e.documentElement,"access",e=>e.scrollTop])||iE([t,"optionalAccess",e=>e.body,"optionalAccess",e=>e.parentElement,"optionalAccess",e=>e.scrollTop])||iE([t,"optionalAccess",e=>e.body,"optionalAccess",e=>e.scrollTop])||0}}function iN(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function iR(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function iD(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function iP(e,t,n,r,i){if(!e)return!1;let o=iD(e);if(!o)return!1;let s=i_(t,n);if(!i){let e=r&&o.matches(r);return s(o)&&!e}let a=iv(o,s),u=-1;return!(a<0)&&(r&&(u=iv(o,i_(null,r))),a>-1&&u<0||a<u)}function iM(e,t){return -2===t.getId(e)}function iL(e){return!!e.changedTouches}function iU(e,t){return!!("IFRAME"===e.nodeName&&t.getMeta(e))}function ij(e,t){return!!("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function iq(e){return!!iE([e,"optionalAccess",e=>e.shadowRoot])}/[1-9][0-9]{12}/.test(Date.now().toString())||(iA=()=>new Date().getTime());class iF{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return t=this.styleIDMap.get(e),null!=t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){let n;return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n)}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function i$(e){let t=null;return iE([e,"access",e=>e.getRootNode,"optionalCall",e=>e(),"optionalAccess",e=>e.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function iB(e){let t=e.ownerDocument;return!!t&&(t.contains(e)||function(e){let t=e.ownerDocument;if(!t)return!1;let n=function(e){let t,n=e;for(;t=i$(n);)n=t;return n}(e);return t.contains(n)}(e))}let iz={};function iV(e){let t=iz[e];if(t)return t;let n=window.document,r=window[e];if(n&&"function"==typeof n.createElement)try{let t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);let i=t.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(t)}catch(e){}return iz[e]=r.bind(window)}function iG(...e){return iV("setTimeout")(...e)}var iW=((E=iW||{})[E.DomContentLoaded=0]="DomContentLoaded",E[E.Load=1]="Load",E[E.FullSnapshot=2]="FullSnapshot",E[E.IncrementalSnapshot=3]="IncrementalSnapshot",E[E.Meta=4]="Meta",E[E.Custom=5]="Custom",E[E.Plugin=6]="Plugin",E),iH=((k=iH||{})[k.Mutation=0]="Mutation",k[k.MouseMove=1]="MouseMove",k[k.MouseInteraction=2]="MouseInteraction",k[k.Scroll=3]="Scroll",k[k.ViewportResize=4]="ViewportResize",k[k.Input=5]="Input",k[k.TouchMove=6]="TouchMove",k[k.MediaInteraction=7]="MediaInteraction",k[k.StyleSheetRule=8]="StyleSheetRule",k[k.CanvasMutation=9]="CanvasMutation",k[k.Font=10]="Font",k[k.Log=11]="Log",k[k.Drag=12]="Drag",k[k.StyleDeclaration=13]="StyleDeclaration",k[k.Selection=14]="Selection",k[k.AdoptedStyleSheet=15]="AdoptedStyleSheet",k[k.CustomElement=16]="CustomElement",k),iK=((I=iK||{})[I.MouseUp=0]="MouseUp",I[I.MouseDown=1]="MouseDown",I[I.Click=2]="Click",I[I.ContextMenu=3]="ContextMenu",I[I.DblClick=4]="DblClick",I[I.Focus=5]="Focus",I[I.Blur=6]="Blur",I[I.TouchStart=7]="TouchStart",I[I.TouchMove_Departed=8]="TouchMove_Departed",I[I.TouchEnd=9]="TouchEnd",I[I.TouchCancel=10]="TouchCancel",I),iJ=((T=iJ||{})[T.Mouse=0]="Mouse",T[T.Pen=1]="Pen",T[T.Touch=2]="Touch",T);class iX{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=function(e){let t;let n=e[0],r=1;for(;r<e.length;){let i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):("call"===i||"optionalCall"===i)&&(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}([t,"optionalAccess",e=>e.next])||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&"__ln"in e.previousSibling){let n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&"__ln"in e.nextSibling&&e.nextSibling.__ln.previous){let n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}let iQ=(e,t)=>`${e}@${t}`;class iZ{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,n=new iX,r=e=>{let t=e,n=-2;for(;-2===n;)n=(t=t&&t.nextSibling)&&this.mirror.getId(t);return n},i=i=>{if(!i.parentNode||!iB(i))return;let o=rK(i.parentNode)?this.mirror.getId(i$(i)):this.mirror.getId(i.parentNode),s=r(i);if(-1===o||-1===s)return n.addNode(i);let a=iS(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{iU(e,this.mirror)&&!iP(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(e),ij(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),iq(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{iP(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(e,t),e.contentWindow&&this.canvasManager.addWindow(e.contentWindow),this.shadowDomManager.observeAttachShadow(e))},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});a&&(e.push({parentId:o,nextId:s,node:a}),t.add(a.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet)(!i0(this.removes,e,this.mirror)||this.movedSet.has(e.parentNode))&&i(e);for(let e of this.addedSet)i1(this.droppedSet,e)||i0(this.removes,e,this.mirror)?i1(this.movedSet,e)?i(e):this.droppedSet.add(e):i(e);let o=null;for(;n.length;){let e=null;if(o){let t=this.mirror.getId(o.value.parentNode),n=r(o.value);-1!==t&&-1!==n&&(e=o)}if(!e){let t=n.tail;for(;t;){let n=t;if(t=t.previous,n){let t=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==t){e=n;break}{let t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}o=e.previous,n.removeNode(e.value),i(e.value)}let s={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{let{attributes:t}=e;if("string"==typeof t.style){let n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))},this.processMutation=e=>{if(!iM(e.target,this.mirror))switch(e.type){case"characterData":{let t=e.target.textContent;iP(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||t===e.oldValue||this.texts.push({value:ib(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t,iD(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){let n=r4(t),i=t.tagName;r=r5(t,i,n);let o=rY({maskInputOptions:this.maskInputOptions,tagName:i,type:n});r=r0({isMasked:ib(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,o),element:t,value:r,maskInputFn:this.maskInputFn})}if(iP(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||r===e.oldValue)return;let i=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;n="rr_src"}if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!iy(t.tagName,n)&&(i.attributes[n]=im(this.doc,r1(t.tagName),r1(n),r,t,this.maskAttributeFn),"style"===n)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}let n=this.unattachedDoc.createElement("span");for(let r of(e.oldValue&&n.setAttribute("style",e.oldValue),Array.from(t.style))){let e=t.style.getPropertyValue(r),o=t.style.getPropertyPriority(r);e!==n.style.getPropertyValue(r)||o!==n.style.getPropertyPriority(r)?""===o?i.styleDiff[r]=e:i.styleDiff[r]=[e,o]:i._unchangedStyles[r]=[e,o]}for(let e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(i.styleDiff[e]=!1)}break}case"childList":if(iP(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let n=this.mirror.getId(t),r=rK(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);iP(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||iM(t,this.mirror)||-1===this.mirror.getId(t)||(this.addedSet.has(t)?(iY(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||function e(t,n){if(rK(t))return!1;let r=n.getId(t);return!n.has(r)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode,n))}(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[iQ(n,r)]?iY(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!!(rK(e.target)&&rJ(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(iM(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[iQ(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);!iP(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&(e.childNodes.forEach(e=>this.genAdds(e)),iq(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function iY(e,t){e.delete(t),t.childNodes.forEach(t=>iY(e,t))}function i0(e,t,n){return 0!==e.length&&function(e,t,n){let r=t.parentNode;for(;r;){let t=n.getId(r);if(e.some(e=>e.id===t))return!0;r=r.parentNode}return!1}(e,t,n)}function i1(e,t){return 0!==e.size&&function e(t,n){let{parentNode:r}=n;return!!r&&(!!t.has(r)||e(t,r))}(e,t)}let i2=e=>v?(...t)=>{try{return e(...t)}catch(e){if(v&&!0===v(e))return()=>{};throw e}}:e;function i3(e){let t;let n=e[0],r=1;for(;r<e.length;){let i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):("call"===i||"optionalCall"===i)&&(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}let i4=[];function i5(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function i6(e,t){let n=new iZ;i4.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver,i=i3([window,"optionalAccess",e=>e.Zone,"optionalAccess",e=>e.__symbol__,"optionalCall",e=>e("MutationObserver")]);i&&window[i]&&(r=window[i]);let o=new r(i2(t=>{e.onMutation&&!1===e.onMutation(t)||n.processMutations.bind(n)(t)}));return o.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),o}function i9({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:o,sampling:s}){return ik("scroll",i2(ix(i2(s=>{let a=i5(s);if(!a||iP(a,r,i,o,!0))return;let u=n.getId(a);if(a===t&&t.defaultView){let n=iO(t.defaultView);e({id:u,x:n.left,y:n.top})}else e({id:u,x:a.scrollLeft,y:a.scrollTop})}),s.scroll||100)),t)}let i8=["INPUT","TEXTAREA","SELECT"],i7=new WeakMap;function oe(e){var t;return t=[],oi("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||oi("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||oi("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||oi("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule?t.unshift(Array.from(e.parentRule.cssRules).indexOf(e)):e.parentStyleSheet&&t.unshift(Array.from(e.parentStyleSheet.cssRules).indexOf(e)),t}function ot(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function on({mirror:e,stylesheetManager:t},n){let r=null;r="#document"===n.nodeName?e.getId(n):e.getId(n.host);let i="#document"===n.nodeName?i3([n,"access",e=>e.defaultView,"optionalAccess",e=>e.Document]):i3([n,"access",e=>e.ownerDocument,"optionalAccess",e=>e.defaultView,"optionalAccess",e=>e.ShadowRoot]),o=i3([i,"optionalAccess",e=>e.prototype])?Object.getOwnPropertyDescriptor(i3([i,"optionalAccess",e=>e.prototype]),"adoptedStyleSheets"):void 0;return null!==r&&-1!==r&&i&&o?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get(){return i3([o,"access",e=>e.get,"optionalAccess",e=>e.call,"call",e=>e(this)])},set(e){let n=i3([o,"access",e=>e.set,"optionalAccess",e=>e.call,"call",t=>t(this,e)]);if(null!==r&&-1!==r)try{t.adoptStyleSheets(e,r)}catch(e){}return n}}),i2(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:o.get,set:o.set})})):()=>{}}function or(e,t={}){let n;let r=e.doc.defaultView;if(!r)return()=>{};e.recordDOM&&(n=i6(e,e.doc));let i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){let i;if(!1===t.mousemove)return()=>{};let o="number"==typeof t.mousemove?t.mousemove:50,s="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500,a=[],u=ix(i2(t=>{let n=Date.now()-i;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],i=null}),s),l=i2(ix(i2(e=>{let t=i5(e),{clientX:n,clientY:o}=iL(e)?e.changedTouches[0]:e;i||(i=iA()),a.push({x:n,y:o,id:r.getId(t),timeOffset:iA()-i}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?iH.Drag:e instanceof MouseEvent?iH.MouseMove:iH.TouchMove)}),o,{trailing:!1})),c=[ik("mousemove",l,n),ik("touchmove",l,n),ik("drag",l,n)];return i2(()=>{c.forEach(e=>e())})}(e),o=function({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:o,sampling:s}){if(!1===s.mouseInteraction)return()=>{};let a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,u=[],l=null,c=t=>s=>{let a=i5(s);if(iP(a,r,i,o,!0))return;let u=null,c=t;if("pointerType"in s){switch(s.pointerType){case"mouse":u=iJ.Mouse;break;case"touch":u=iJ.Touch;break;case"pen":u=iJ.Pen}u===iJ.Touch?iK[t]===iK.MouseDown?c="TouchStart":iK[t]===iK.MouseUp&&(c="TouchEnd"):iJ.Pen}else iL(s)&&(u=iJ.Touch);null!==u?(l=u,(c.startsWith("Touch")&&u===iJ.Touch||c.startsWith("Mouse")&&u===iJ.Mouse)&&(u=null)):iK[t]===iK.Click&&(u=l,l=null);let d=iL(s)?s.changedTouches[0]:s;if(!d)return;let h=n.getId(a),{clientX:f,clientY:p}=d;i2(e)({type:iK[c],id:h,x:f,y:p,...null!==u&&{pointerType:u}})};return Object.keys(iK).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]).forEach(e=>{let n=r1(e),r=c(e);if(window.PointerEvent)switch(iK[e]){case iK.MouseDown:case iK.MouseUp:n=n.replace("mouse","pointer");break;case iK.TouchStart:case iK.TouchEnd:return}u.push(ik(n,r,t))}),i2(()=>{u.forEach(e=>e())})}(e),s=i9(e),a=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return ik("resize",i2(ix(i2(()=>{let t=iN(),i=iR();(n!==t||r!==i)&&(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}(e,{win:r}),u=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputOptions:u,maskInputFn:l,sampling:c,userTriggeredOnInput:d,maskTextClass:h,unmaskTextClass:f,maskTextSelector:p,unmaskTextSelector:g}){function m(e){let n=i5(e),c=e.isTrusted,m=n&&r2(n.tagName);if("OPTION"===m&&(n=n.parentElement),!n||!m||0>i8.indexOf(m)||iP(n,r,i,o,!0))return;let v=n;if(v.classList.contains(s)||a&&v.matches(a))return;let _=r4(n),b=r5(v,m,_),w=!1,S=rY({maskInputOptions:u,tagName:m,type:_}),E=ib(n,h,p,f,g,S);("radio"===_||"checkbox"===_)&&(w=n.checked),b=r0({isMasked:E,element:n,value:b,maskInputFn:l}),y(n,d?{text:b,isChecked:w,userTriggered:c}:{text:b,isChecked:w});let k=n.name;"radio"===_&&k&&w&&t.querySelectorAll(`input[type="radio"][name="${k}"]`).forEach(e=>{if(e!==n){let t=r0({isMasked:E,element:e,value:r5(e,m,_),maskInputFn:l});y(e,d?{text:t,isChecked:!w,userTriggered:!1}:{text:t,isChecked:!w})}})}function y(t,r){let i=i7.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){i7.set(t,r);let i=n.getId(t);i2(e)({...r,id:i})}}let v=("last"===c.input?["change"]:["input","change"]).map(e=>ik(e,i2(m),t)),_=t.defaultView;if(!_)return()=>{v.forEach(e=>e())};let b=_.Object.getOwnPropertyDescriptor(_.HTMLInputElement.prototype,"value"),w=[[_.HTMLInputElement.prototype,"value"],[_.HTMLInputElement.prototype,"checked"],[_.HTMLSelectElement.prototype,"value"],[_.HTMLTextAreaElement.prototype,"value"],[_.HTMLSelectElement.prototype,"selectedIndex"],[_.HTMLOptionElement.prototype,"selected"]];return b&&b.set&&v.push(...w.map(e=>(function e(t,n,r,i,o=window){let s=o.Object.getOwnPropertyDescriptor(t,n);return o.Object.defineProperty(t,n,i?r:{set(e){iG(()=>{r.set.call(this,e)},0),s&&s.set&&s.set.call(this,e)}}),()=>e(t,n,s||{},!0)})(e[0],e[1],{set(){i2(m)({target:this,isTrusted:!1})}},!1,_))),i2(()=>{v.forEach(e=>e())})}(e),l=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:i,sampling:o,doc:s}){let a=i2(s=>ix(i2(o=>{let a=i5(o);if(!a||iP(a,t,n,r,!0))return;let{currentTime:u,volume:l,muted:c,playbackRate:d}=a;e({type:s,id:i.getId(a),currentTime:u,volume:l,muted:c,playbackRate:d})}),o.media||500)),u=[ik("play",a(0),s),ik("pause",a(1),s),ik("seeked",a(2),s),ik("volumechange",a(3),s),ik("ratechange",a(4),s)];return i2(()=>{u.forEach(e=>e())})}(e),c=()=>{},d=()=>{},h=()=>{},f=()=>{};e.recordDOM&&(c=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){let i,o;if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:i2((r,i,o)=>{let[s,a]=o,{id:u,styleId:l}=ot(i,t,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&e({id:u,styleId:l,adds:[{rule:s,index:a}]}),r.apply(i,o)})});let a=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:i2((r,i,o)=>{let[s]=o,{id:a,styleId:u}=ot(i,t,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&e({id:a,styleId:u,removes:[{index:s}]}),r.apply(i,o)})}),r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:i2((r,i,o)=>{let[s]=o,{id:a,styleId:u}=ot(i,t,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&e({id:a,styleId:u,replace:s}),r.apply(i,o)})})),r.CSSStyleSheet.prototype.replaceSync&&(o=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(o,{apply:i2((r,i,o)=>{let[s]=o,{id:a,styleId:u}=ot(i,t,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&e({id:a,styleId:u,replaceSync:s}),r.apply(i,o)})}));let u={};oo("CSSGroupingRule")?u.CSSGroupingRule=r.CSSGroupingRule:(oo("CSSMediaRule")&&(u.CSSMediaRule=r.CSSMediaRule),oo("CSSConditionRule")&&(u.CSSConditionRule=r.CSSConditionRule),oo("CSSSupportsRule")&&(u.CSSSupportsRule=r.CSSSupportsRule));let l={};return Object.entries(u).forEach(([r,i])=>{l[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(l[r].insertRule,{apply:i2((r,i,o)=>{let[s,a]=o,{id:u,styleId:l}=ot(i.parentStyleSheet,t,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&e({id:u,styleId:l,adds:[{rule:s,index:[...oe(i),a||0]}]}),r.apply(i,o)})}),i.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:i2((r,i,o)=>{let[s]=o,{id:a,styleId:u}=ot(i.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&e({id:a,styleId:u,removes:[{index:[...oe(i),s]}]}),r.apply(i,o)})})}),i2(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=a,i&&(r.CSSStyleSheet.prototype.replace=i),o&&(r.CSSStyleSheet.prototype.replaceSync=o),Object.entries(u).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}(e,{win:r}),d=on(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:i2((i,s,a)=>{let[u,l,c]=a;if(n.has(u))return o.apply(s,[u,l,c]);let{id:d,styleId:h}=ot(i3([s,"access",e=>e.parentRule,"optionalAccess",e=>e.parentStyleSheet]),t,r.styleMirror);return(d&&-1!==d||h&&-1!==h)&&e({id:d,styleId:h,set:{property:u,value:l,priority:c},index:oe(s.parentRule)}),i.apply(s,a)})});let s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:i2((i,o,a)=>{let[u]=a;if(n.has(u))return s.apply(o,[u]);let{id:l,styleId:c}=ot(i3([o,"access",e=>e.parentRule,"optionalAccess",e=>e.parentStyleSheet]),t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,remove:{property:u},index:oe(o.parentRule)}),i.apply(o,a)})}),i2(()=>{i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=s})}(e,{win:r}),e.collectFonts&&(f=function({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,o=n.FontFace;n.FontFace=function(e,t,n){let r=new o(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};let s=iC(t.fonts,"add",function(t){return function(n){return iG(i2(()=>{let t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=o}),r.push(s),i2(()=>{r.forEach(e=>e())})}(e)));let p=function(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:o,selectionCb:s}=e,a=!0,u=i2(()=>{let e=t.getSelection();if(!e||a&&i3([e,"optionalAccess",e=>e.isCollapsed]))return;a=e.isCollapsed||!1;let u=[],l=e.rangeCount||0;for(let t=0;t<l;t++){let{startContainer:s,startOffset:a,endContainer:l,endOffset:c}=e.getRangeAt(t);iP(s,r,i,o,!0)||iP(l,r,i,o,!0)||u.push({start:n.getId(s),startOffset:a,end:n.getId(l),endOffset:c})}s({ranges:u})});return u(),ik("selectionchange",u)}(e),g=function({doc:e,customElementCb:t}){let n=e.defaultView;return n&&n.customElements?iC(n.customElements,"define",function(e){return function(n,r,i){try{t({define:{name:n}})}catch(e){}return e.apply(this,[n,r,i])}}):()=>{}}(e),m=[];for(let t of e.plugins)m.push(t.observer(t.callback,r,t.options));return i2(()=>{i4.forEach(e=>e.reset()),i3([n,"optionalAccess",e=>e.disconnect,"call",e=>e()]),i(),o(),s(),a(),u(),l(),c(),d(),h(),f(),p(),g(),m.forEach(e=>e())})}function oi(e){return void 0!==window[e]}function oo(e){return!!(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class os{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){let i=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e),s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}getIds(e,t){let n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){let r=n||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:r.get(t)||-1}getRemoteIds(e,t){let n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}function oa(e){let t;let n=e[0],r=1;for(;r<e.length;){let i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):("call"===i||"optionalCall"===i)&&(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}class ou{constructor(){this.crossOriginIframeMirror=new os(ii),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class ol{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new os(ii),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new os(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),oa([this,"access",e=>e.loadListener,"optionalCall",t=>t(e)]),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){if("rrweb"!==e.data.type||e.origin!==e.data.origin||!e.source)return;let t=this.crossOriginIframeMap.get(e.source);if(!t)return;let n=this.transformCrossOriginEvent(t,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}transformCrossOriginEvent(e,t){switch(t.type){case iW.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:iW.IncrementalSnapshot,data:{source:iH.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case iW.Meta:case iW.Load:case iW.DomContentLoaded:break;case iW.Plugin:return t;case iW.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case iW.IncrementalSnapshot:switch(t.data.source){case iH.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case iH.Drag:case iH.TouchMove:case iH.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case iH.ViewportResize:return!1;case iH.MediaInteraction:case iH.MouseInteraction:case iH.Scroll:case iH.CanvasMutation:case iH.Input:return this.replaceIds(t.data,e,["id"]),t;case iH.StyleSheetRule:case iH.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case iH.Font:return t;case iH.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case iH.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),oa([t,"access",e=>e.data,"access",e=>e.styles,"optionalAccess",e=>e.forEach,"call",t=>t(t=>{this.replaceStyleIds(t,e,["styleId"])})]),t}}return!1}replace(e,t,n,r){for(let i of r)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===C.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class oc{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class od{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!rJ(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);let n=i6({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(i9({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),iG(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(on({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let n=this;this.restoreHandlers.push(iC(e.prototype,"attachShadow",function(e){return function(r){let i=e.call(this,r);return this.shadowRoot&&iB(this)&&n.addShadowRoot(this.shadowRoot,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}class oh{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class of{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new iF,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;let n={id:t,styleIds:[]},r=[];for(let t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,t)=>({rule:rQ(e),index:t}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class op{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,t){let n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,function(...e){iV("requestAnimationFrame")(...e)}(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}try{if(2!==Array.from([1],e=>2*e)[0]){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=nt([e,"access",e=>e.contentWindow,"optionalAccess",e=>e.Array,"access",e=>e.from])||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}let og=new rZ;function om(e={}){let t;let{emit:n,checkoutEveryNms:r,checkoutEveryNth:i,blockClass:o="rr-block",blockSelector:s=null,unblockSelector:a=null,ignoreClass:u="rr-ignore",ignoreSelector:l=null,maskAllText:c=!1,maskTextClass:d="rr-mask",unmaskTextClass:h=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:g=!0,maskAllInputs:m,maskInputOptions:y,slimDOMOptions:w,maskAttributeFn:S,maskInputFn:E,maskTextFn:k,maxCanvasSize:I=null,packFn:T,sampling:x={},dataURLOptions:C={},mousemoveWait:A,recordDOM:O=!0,recordCanvas:N=!1,recordCrossOriginIframes:R=!1,recordAfter:D="DOMContentLoaded"===e.recordAfter?e.recordAfter:"load",userTriggeredOnInput:P=!1,collectFonts:M=!1,inlineImages:L=!1,plugins:U,keepIframeSrcFn:j=()=>!1,ignoreCSSAttributes:q=new Set([]),errorHandler:F,onMutation:$,getCanvasManager:B}=e;v=F;let z=!R||window.parent===window,V=!1;if(!z)try{window.parent.document&&(V=!1)}catch(e){V=!0}if(z&&!n)throw Error("emit function is required");if(!z&&!V)return()=>{};void 0!==A&&void 0===x.mousemove&&(x.mousemove=A),og.reset();let G=!0===m?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:void 0!==y?y:{},W=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw TypeError("1 argument is required");do if(this===t)return!0;while(t=t&&t.parentNode);return!1})}();let H=0,K=e=>{for(let t of U||[])t.eventProcessor&&(e=t.eventProcessor(e));return T&&!V&&(e=T(e)),e};_=(e,o)=>{if(e.timestamp=iA(),nt([i4,"access",e=>e[0],"optionalAccess",e=>e.isFrozen,"call",e=>e()])&&e.type!==iW.FullSnapshot&&!(e.type===iW.IncrementalSnapshot&&e.data.source===iH.Mutation)&&i4.forEach(e=>e.unfreeze()),z)nt([n,"optionalCall",t=>t(K(e),o)]);else if(V){let t={type:"rrweb",event:K(e),origin:window.location.origin,isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===iW.FullSnapshot)t=e,H=0;else if(e.type===iW.IncrementalSnapshot){if(e.data.source===iH.Mutation&&e.data.isAttachIframe)return;H++;let n=i&&H>=i,o=r&&t&&e.timestamp-t.timestamp>r;(n||o)&&er(!0)}};let J=e=>{_({type:iW.IncrementalSnapshot,data:{source:iH.Mutation,...e}})},X=e=>_({type:iW.IncrementalSnapshot,data:{source:iH.Scroll,...e}}),Q=e=>_({type:iW.IncrementalSnapshot,data:{source:iH.CanvasMutation,...e}}),Z=new of({mutationCb:J,adoptedStyleSheetCb:e=>_({type:iW.IncrementalSnapshot,data:{source:iH.AdoptedStyleSheet,...e}})}),Y="boolean"==typeof __RRWEB_EXCLUDE_IFRAME__&&__RRWEB_EXCLUDE_IFRAME__?new ou:new ol({mirror:og,mutationCb:J,stylesheetManager:Z,recordCrossOriginIframes:R,wrappedEmit:_});for(let e of U||[])e.getMirror&&e.getMirror({nodeMirror:og,crossOriginIframeMirror:Y.crossOriginIframeMirror,crossOriginIframeStyleMirror:Y.crossOriginIframeStyleMirror});let ee=new op,et=function(e,t){try{return e?e(t):new oh}catch(e){return console.warn("Unable to initialize CanvasManager"),new oh}}(B,{mirror:og,win:window,mutationCb:e=>_({type:iW.IncrementalSnapshot,data:{source:iH.CanvasMutation,...e}}),recordCanvas:N,blockClass:o,blockSelector:s,unblockSelector:a,maxCanvasSize:I,sampling:x.canvas,dataURLOptions:C,errorHandler:F}),en="boolean"==typeof __RRWEB_EXCLUDE_SHADOW_DOM__&&__RRWEB_EXCLUDE_SHADOW_DOM__?new oc:new od({mutationCb:J,scrollCb:X,bypassOptions:{onMutation:$,blockClass:o,blockSelector:s,unblockSelector:a,maskAllText:c,maskTextClass:d,unmaskTextClass:h,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:g,maskInputOptions:G,dataURLOptions:C,maskAttributeFn:S,maskTextFn:k,maskInputFn:E,recordCanvas:N,inlineImages:L,sampling:x,slimDOMOptions:W,iframeManager:Y,stylesheetManager:Z,canvasManager:et,keepIframeSrcFn:j,processedNodeManager:ee},mirror:og}),er=(e=!1)=>{if(!O)return;_({type:iW.Meta,data:{href:window.location.href,width:iR(),height:iN()}},e),Z.reset(),en.init(),i4.forEach(e=>e.lock());let t=function(e,t){let{mirror:n=new rZ,blockClass:r="rr-block",blockSelector:i=null,unblockSelector:o=null,maskAllText:s=!1,maskTextClass:a="rr-mask",unmaskTextClass:u=null,maskTextSelector:l=null,unmaskTextSelector:c=null,inlineStylesheet:d=!0,inlineImages:h=!1,recordCanvas:f=!1,maskAllInputs:p=!1,maskAttributeFn:g,maskTextFn:m,maskInputFn:y,slimDOM:v=!1,dataURLOptions:_,preserveWhiteSpace:b,onSerialize:w,onIframeLoad:S,iframeLoadTimeout:E,onStylesheetLoad:k,stylesheetLoadTimeout:I,keepIframeSrcFn:T=()=>!1}=t||{};return iS(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:o,maskAllText:s,maskTextClass:a,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===p?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:!1===p?{}:p,maskAttributeFn:g,maskTextFn:m,maskInputFn:y,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:_,inlineImages:h,recordCanvas:f,preserveWhiteSpace:b,onSerialize:w,onIframeLoad:S,iframeLoadTimeout:E,onStylesheetLoad:k,stylesheetLoadTimeout:I,keepIframeSrcFn:T,newlyAddedElement:!1})}(document,{mirror:og,blockClass:o,blockSelector:s,unblockSelector:a,maskAllText:c,maskTextClass:d,unmaskTextClass:h,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:g,maskAllInputs:G,maskAttributeFn:S,maskInputFn:E,maskTextFn:k,slimDOM:W,dataURLOptions:C,recordCanvas:N,inlineImages:L,onSerialize:e=>{iU(e,og)&&Y.addIframe(e),ij(e,og)&&Z.trackLinkElement(e),iq(e)&&en.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{Y.attachIframe(e,t),e.contentWindow&&et.addWindow(e.contentWindow),en.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Z.attachLinkElement(e,t)},keepIframeSrcFn:j});if(!t)return console.warn("Failed to snapshot the document");_({type:iW.FullSnapshot,data:{node:t,initialOffset:iO(window)}}),i4.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Z.adoptStyleSheets(document.adoptedStyleSheets,og.getId(document))};b=er;try{let e=[],t=e=>i2(or)({onMutation:$,mutationCb:J,mousemoveCb:(e,t)=>_({type:iW.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>_({type:iW.IncrementalSnapshot,data:{source:iH.MouseInteraction,...e}}),scrollCb:X,viewportResizeCb:e=>_({type:iW.IncrementalSnapshot,data:{source:iH.ViewportResize,...e}}),inputCb:e=>_({type:iW.IncrementalSnapshot,data:{source:iH.Input,...e}}),mediaInteractionCb:e=>_({type:iW.IncrementalSnapshot,data:{source:iH.MediaInteraction,...e}}),styleSheetRuleCb:e=>_({type:iW.IncrementalSnapshot,data:{source:iH.StyleSheetRule,...e}}),styleDeclarationCb:e=>_({type:iW.IncrementalSnapshot,data:{source:iH.StyleDeclaration,...e}}),canvasMutationCb:Q,fontCb:e=>_({type:iW.IncrementalSnapshot,data:{source:iH.Font,...e}}),selectionCb:e=>{_({type:iW.IncrementalSnapshot,data:{source:iH.Selection,...e}})},customElementCb:e=>{_({type:iW.IncrementalSnapshot,data:{source:iH.CustomElement,...e}})},blockClass:o,ignoreClass:u,ignoreSelector:l,maskAllText:c,maskTextClass:d,unmaskTextClass:h,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:G,inlineStylesheet:g,sampling:x,recordDOM:O,recordCanvas:N,inlineImages:L,userTriggeredOnInput:P,collectFonts:M,doc:e,maskAttributeFn:S,maskInputFn:E,maskTextFn:k,keepIframeSrcFn:j,blockSelector:s,unblockSelector:a,slimDOMOptions:W,dataURLOptions:C,mirror:og,iframeManager:Y,stylesheetManager:Z,shadowDomManager:en,processedNodeManager:ee,canvasManager:et,ignoreCSSAttributes:q,plugins:nt([U,"optionalAccess",e=>e.filter,"call",e=>e(e=>e.observer),"optionalAccess",e=>e.map,"call",e=>e(e=>({observer:e.observer,options:e.options,callback:t=>_({type:iW.Plugin,data:{plugin:e.name,payload:t}})}))])||[]},{});Y.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});let n=()=>{er(),e.push(t(document))};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(ik("DOMContentLoaded",()=>{_({type:iW.DomContentLoaded,data:{}}),"DOMContentLoaded"===D&&n()})),e.push(ik("load",()=>{_({type:iW.Load,data:{}}),"load"===D&&n()},window))),()=>{e.forEach(e=>e()),ee.destroy(),b=void 0,v=void 0}}catch(e){console.warn(e)}}om.mirror=og,om.takeFullSnapshot=function(e){if(!b)throw Error("please take full snapshot after start recording");b(e)};let oy="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,ov=["info","warn","error","log"],o_="[Replay] ";function ob(e,t="info"){(0,e1.n)({category:"console",data:{logger:"replay"},level:t,message:`${o_}${e}`},{level:t})}let ow=function(){let e=!1,t=!1,n={exception:()=>void 0,infoTick:()=>void 0,setConfig:n=>{e=n.captureExceptions,t=n.traceInternals}};return oy?(ov.forEach(e=>{n[e]=(...n)=>{D.kg[e](o_,...n),t&&ob(n.join(""),tn(e))}}),n.exception=(r,...i)=>{i.length&&n.error&&n.error(...i),D.kg.error(o_,r),e?(0,R.Tb)(r):t&&ob(r,"error")},n.infoTick=(...e)=>{D.kg.info(o_,...e),t&&setTimeout(()=>ob(e[0]),0)}):ov.forEach(e=>{n[e]=()=>void 0}),n}();function oS(e){return e>9999999999?e:1e3*e}function oE(e){return e>9999999999?e/1e3:e}function ok(e,t){"sentry.transaction"!==t.category&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:iW.Custom,timestamp:1e3*(t.timestamp||0),data:{tag:"breadcrumb",payload:(0,e_.Fv)(t,10,1e3)}}),"console"===t.category)))}function oI(e){return e.closest("button,a")||e}function oT(e){let t=ox(e);return t&&t instanceof Element?oI(t):t}function ox(e){return"object"==typeof e&&e&&"target"in e?e.target:e}let oC=new Set([iH.Mutation,iH.StyleSheetRule,iH.StyleDeclaration,iH.AdoptedStyleSheet,iH.CanvasMutation,iH.Selection,iH.MediaInteraction]);class oA{constructor(e,t,n=ok){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=t.timeout/1e3,this._threshold=t.threshold/1e3,this._scollTimeout=t.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=t.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){var e;let t=(e=()=>{this._lastMutation=oN()},w||(w=[],(0,z.hl)(rz,"open",function(e){return function(...t){if(w)try{w.forEach(e=>e())}catch(e){}return e.apply(rz,t)}})),w.push(e),()=>{let t=w?w.indexOf(e):-1;t>-1&&w.splice(t,1)});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,t){var n;if(n=this._ignoreSelector,!oO.includes(t.tagName)||"INPUT"===t.tagName&&!["submit","button"].includes(t.getAttribute("type")||"")||"A"===t.tagName&&(t.hasAttribute("download")||t.hasAttribute("target")&&"_self"!==t.getAttribute("target"))||n&&t.matches(n)||!(e.data&&"number"==typeof e.data.nodeId&&e.timestamp))return;let r={timestamp:oE(e.timestamp),clickBreadcrumb:e,clickCount:0,node:t};this._clicks.some(e=>e.node===r.node&&1>Math.abs(e.timestamp-r.timestamp))||(this._clicks.push(r),1===this._clicks.length&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=oE(e)}registerScroll(e=Date.now()){this._lastScroll=oE(e)}registerClick(e){let t=oI(e);this._handleMultiClick(t)}_handleMultiClick(e){this._getClicks(e).forEach(e=>{e.clickCount++})}_getClicks(e){return this._clicks.filter(t=>t.node===e)}_checkClicks(){let e=[],t=oN();for(let n of(this._clicks.forEach(n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=t&&e.push(n)}),e)){let e=this._clicks.indexOf(n);e>-1&&(this._generateBreadcrumbs(n),this._clicks.splice(e,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){let t=this._replay,n=e.scrollAfter&&e.scrollAfter<=this._scollTimeout,r=e.mutationAfter&&e.mutationAfter<=this._threshold,{clickCount:i,clickBreadcrumb:o}=e;if(!n&&!r){let n=1e3*Math.min(e.mutationAfter||this._timeout,this._timeout),r=n<1e3*this._timeout?"mutation":"timeout",s={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.slowClickDetected",data:{...o.data,url:rz.location.href,route:t.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:i||1}};this._addBreadcrumbEvent(t,s);return}if(i>1){let e={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.multiClick",data:{...o.data,url:rz.location.href,route:t.getCurrentRoute(),clickCount:i,metric:!0}};this._addBreadcrumbEvent(t,e)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=tj(()=>this._checkClicks(),1e3)}}let oO=["A","BUTTON","INPUT"];function oN(){return Date.now()/1e3}function oR(e){return{timestamp:Date.now()/1e3,type:"default",...e}}(x=A||(A={}))[x.Document=0]="Document",x[x.DocumentType=1]="DocumentType",x[x.Element=2]="Element",x[x.Text=3]="Text",x[x.CDATA=4]="CDATA",x[x.Comment=5]="Comment";let oD=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]),oP=e=>t=>{if(!e.isEnabled())return;let n=function(e){let{target:t,message:n}=function(e){let t;let n="click"===e.name,r=null;try{r=n?oT(e.event):ox(e.event),t=(0,te.Rt)(r,{maxStringLength:200})||"<unknown>"}catch(e){t="<unknown>"}return{target:r,message:t}}(e);return oR({category:`ui.${e.name}`,...oM(t,n)})}(t);if(!n)return;let r="click"===t.name,i=r?t.event:void 0;r&&e.clickDetector&&i&&i.target&&!i.altKey&&!i.metaKey&&!i.ctrlKey&&!i.shiftKey&&function(e,t,n){e.handleClick(t,n)}(e.clickDetector,n,oT(t.event)),ok(e,n)};function oM(e,t){let n=om.mirror.getId(e),r=n&&om.mirror.getNode(n),i=r&&om.mirror.getMeta(r),o=i&&i.type===A.Element?i:null;return{message:t,data:o?{nodeId:n,node:{id:n,tagName:o.tagName,textContent:Array.from(o.childNodes).map(e=>e.type===A.Text&&e.textContent).filter(Boolean).map(e=>e.trim()).join(""),attributes:function(e){let t={};for(let n in!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]),e)if(oD.has(n)){let r=n;("data-testid"===n||"data-test-id"===n)&&(r="testId"),t[r]=e[n]}return t}(o.attributes)}}:{}}}let oL={resource:function(e){let{entryType:t,initiatorType:n,name:r,responseEnd:i,startTime:o,decodedBodySize:s,encodedBodySize:a,responseStatus:u,transferSize:l}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:oq(o),end:oq(i),name:r,data:{size:l,statusCode:u,decodedBodySize:s,encodedBodySize:a}}},paint:function(e){let{duration:t,entryType:n,name:r,startTime:i}=e,o=oq(i);return{type:n,name:r,start:o,end:o+t,data:void 0}},navigation:function(e){let{entryType:t,name:n,decodedBodySize:r,duration:i,domComplete:o,encodedBodySize:s,domContentLoadedEventStart:a,domContentLoadedEventEnd:u,domInteractive:l,loadEventStart:c,loadEventEnd:d,redirectCount:h,startTime:f,transferSize:p,type:g}=e;return 0===i?null:{type:`${t}.${g}`,start:oq(f),end:oq(o),name:n,data:{size:p,decodedBodySize:r,encodedBodySize:s,duration:i,domInteractive:l,domContentLoadedEventStart:a,domContentLoadedEventEnd:u,loadEventStart:c,loadEventEnd:d,domComplete:o,redirectCount:h}}}};function oU(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function oj(e){let t=oL[e.entryType];return t?t(e):null}function oq(e){return((ex.Z1||rz.performance.timeOrigin)+e)/1e3}function oF(e){let t=e.entries[e.entries.length-1];return oV(e,"largest-contentful-paint",t&&t.element?[t.element]:void 0)}function o$(e){let t=[],n=[];for(let r of e.entries)if(void 0!==r.sources){let e=[];for(let t of r.sources)if(t.node){n.push(t.node);let r=om.mirror.getId(t.node);r&&e.push(r)}t.push({value:r.value,nodeIds:e.length?e:void 0})}return oV(e,"cumulative-layout-shift",n,t)}function oB(e){let t=e.entries[e.entries.length-1];return oV(e,"first-input-delay",t&&t.target?[t.target]:void 0)}function oz(e){let t=e.entries[e.entries.length-1];return oV(e,"interaction-to-next-paint",t&&t.target?[t.target]:void 0)}function oV(e,t,n,r){let i=e.value,o=e.rating,s=oq(i);return{type:"web-vital",name:t,start:s,end:s,data:{value:i,size:i,rating:o,nodeIds:n?n.map(e=>om.mirror.getId(e)):void 0,attributions:r}}}class oG extends Error{constructor(){super("Event buffer exceeded maximum size of 20000000.")}}class oW{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(e){let t=JSON.stringify(e).length;if(this._totalSize+=t,this._totalSize>2e7)throw new oG;this.events.push(e)}finish(){return new Promise(e=>{let t=this.events;this.clear(),e(JSON.stringify(t))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let e=this.events.map(e=>e.timestamp).sort()[0];return e?oS(e):null}}class oH{constructor(e){this._worker=e,this._id=0}ensureReady(){return this._ensureReadyPromise||(this._ensureReadyPromise=new Promise((e,t)=>{this._worker.addEventListener("message",({data:n})=>{n.success?e():t()},{once:!0}),this._worker.addEventListener("error",e=>{t(e)},{once:!0})})),this._ensureReadyPromise}destroy(){oy&&ow.info("Destroying compression worker"),this._worker.terminate()}postMessage(e,t){let n=this._getAndIncrementId();return new Promise((r,i)=>{let o=({data:t})=>{if(t.method===e&&t.id===n){if(this._worker.removeEventListener("message",o),!t.success){oy&&ow.error("Error in compression worker: ",t.response),i(Error("Error in compression worker"));return}r(t.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:n,method:e,arg:t})})}_getAndIncrementId(){return this._id++}}class oK{constructor(e){this._worker=new oH(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){let t=oS(e.timestamp);(!this._earliestTimestamp||t<this._earliestTimestamp)&&(this._earliestTimestamp=t);let n=JSON.stringify(e);return(this._totalSize+=n.length,this._totalSize>2e7)?Promise.reject(new oG):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{oy&&ow.exception(e,'Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){let e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}}class oJ{constructor(e){this._fallback=new oW,this._compression=new oK(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){oy&&ow.exception(e,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:e,hasCheckout:t}=this._fallback,n=[];for(let t of e)n.push(this._compression.addEvent(t));this._compression.hasCheckout=t,this._used=this._compression;try{await Promise.all(n),this._fallback.clear()}catch(e){oy&&ow.exception(e,"Failed to add events when switching buffers.")}}}function oX(){try{return"sessionStorage"in rz&&!!rz.sessionStorage}catch(e){return!1}}function oQ(e){return void 0!==e&&Math.random()<e}function oZ(e){let t=Date.now(),n=e.id||(0,P.DM)(),r=e.started||t,i=e.lastActivity||t;return{id:n,started:r,lastActivity:i,segmentId:e.segmentId||0,sampled:e.sampled,previousSessionId:e.previousSessionId}}function oY(e){if(oX())try{rz.sessionStorage.setItem(rV,JSON.stringify(e))}catch(e){}}function o0({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){let i=oZ({sampled:oQ(e)?"session":!!t&&"buffer",previousSessionId:r});return n&&oY(i),i}function o1(e,t,n=+new Date){return null===e||void 0===t||t<0||0!==t&&e+t<=n}function o2(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return o1(e.started,t,r)||o1(e.lastActivity,n,r)}function o3(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!!o2(e,{sessionIdleExpire:t,maxReplayDuration:n})&&("buffer"!==e.sampled||0!==e.segmentId)}function o4({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){let i=r.stickySession&&function(){if(!oX())return null;try{let e=rz.sessionStorage.getItem(rV);if(!e)return null;let t=JSON.parse(e);return oy&&ow.infoTick("Loading existing session"),oZ(t)}catch(e){return null}}();return i?o3(i,{sessionIdleExpire:e,maxReplayDuration:t})?(oy&&ow.infoTick("Session in sessionStorage is expired, creating new one..."),o0(r,{previousSessionId:i.id})):i:(oy&&ow.infoTick("Creating new session"),o0(r,{previousSessionId:n}))}function o5(e,t,n){return!!o9(e,t)&&(o6(e,t,n),!0)}async function o6(e,t,n){if(!e.eventBuffer)return null;try{n&&"buffer"===e.recordingMode&&e.eventBuffer.clear(),n&&(e.eventBuffer.hasCheckout=!0);let r=e.getOptions(),i=function(e,t){try{if("function"==typeof t&&e.type===iW.Custom)return t(e)}catch(e){return oy&&ow.exception(e,"An error occured in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}(t,r.beforeAddRecordingEvent);if(!i)return;return await e.eventBuffer.addEvent(i)}catch(r){let t=r&&r instanceof oG?"addEventSizeExceeded":"addEvent";e.handleException(r),await e.stop({reason:t});let n=(0,V.s3)();n&&n.recordDroppedEvent("internal_sdk_error","replay")}}function o9(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;let n=oS(t.timestamp);return!(n+e.timeouts.sessionIdlePause<Date.now())&&(!(n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration)||(oy&&ow.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1))}function o8(e){return"transaction"===e.type}function o7(e){return"feedback"===e.type}function se(e){return!!e.category}function st(e,t){return t.map(({type:t,start:n,end:r,name:i,data:o})=>{let s=e.throttledAddEvent({type:iW.Custom,timestamp:n,data:{tag:"performanceSpan",payload:{op:t,description:i,startTimestamp:n,endTimestamp:r,data:o}}});return"string"==typeof s?Promise.resolve(null):s})}function sn(e,t){var n;e.isEnabled()&&null!==t&&(n=t.name,(!oy||!e.getOptions()._experiments.traceInternals)&&rq(n,(0,V.s3)())||e.addUpdate(()=>(st(e,[t]),!0)))}function sr(e){if(!e)return;let t=new TextEncoder;try{if("string"==typeof e)return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){let n=sd(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch(e){}}function si(e){if(!e)return;let t=parseInt(e,10);return isNaN(t)?void 0:t}function so(e){try{if("string"==typeof e)return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[sd(e)];if(!e)return[void 0]}catch(t){return oy&&ow.exception(t,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return oy&&ow.info("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function ss(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};let n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function sa(e,t){if(!t)return null;let{startTimestamp:n,endTimestamp:r,url:i,method:o,statusCode:s,request:a,response:u}=t;return{type:e,start:n/1e3,end:r/1e3,name:i,data:(0,z.Jr)({method:o,statusCode:s,request:a,response:u})}}function su(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function sl(e,t,n){if(!t&&0===Object.keys(e).length)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};let r={headers:e,size:t},{body:i,warnings:o}=function(e){if(!e||"string"!=typeof e)return{body:e};let t=e.length>15e4,n=function(e){let t=e[0],n=e[e.length-1];return"["===t&&"]"===n||"{"===t&&"}"===n}(e);if(t){let t=e.slice(0,15e4);return n?{body:t,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${t}…`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch(e){}return{body:e}}(n);return r.body=i,o&&o.length>0&&(r._meta={warnings:o}),r}function sc(e,t){return Object.entries(e).reduce((n,[r,i])=>{let o=r.toLowerCase();return t.includes(o)&&e[r]&&(n[o]=i),n},{})}function sd(e){return new URLSearchParams(e).toString()}function sh(e,t){let n=function(e,t=rz.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(rz.location.origin))return e;let n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;let r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}(e);return(0,M.U0)(n,t)}async function sf(e,t,n){try{let r=await sp(e,t,n),i=sa("resource.fetch",r);sn(n.replay,i)}catch(e){oy&&ow.exception(e,"Failed to capture fetch breadcrumb")}}async function sp(e,t,n){let r=Date.now(),{startTimestamp:i=r,endTimestamp:o=r}=t,{url:s,method:a,status_code:u=0,request_body_size:l,response_body_size:c}=e.data,d=sh(s,n.networkDetailAllowUrls)&&!sh(s,n.networkDetailDenyUrls);return{startTimestamp:i,endTimestamp:o,url:s,method:a,statusCode:u,request:d?function({networkCaptureBodies:e,networkRequestHeaders:t},n,r){let i=n?1===n.length&&"string"!=typeof n[0]?s_(n[0],t):2===n.length?s_(n[1],t):{}:{};if(!e)return sl(i,r,void 0);let[o,s]=so(sy(n)),a=sl(i,r,o);return s?ss(a,s):a}(n,t.input,l):su(l),response:await sg(d,n,t.response,c)}}async function sg(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,i){if(!e&&void 0!==i)return su(i);let o=r?sv(r.headers,n):{};if(!r||!t&&void 0!==i)return sl(o,i,void 0);let[s,a]=await sm(r),u=function(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:i}){try{let o=e&&e.length&&void 0===n?sr(e):n;if(!r)return su(o);if(t)return sl(i,o,e);return sl(i,o,void 0)}catch(e){return oy&&ow.exception(e,"Failed to serialize response body"),sl(i,n,void 0)}}(s,{networkCaptureBodies:t,responseBodySize:i,captureDetails:e,headers:o});return a?ss(u,a):u}async function sm(e){let t=function(e){try{return e.clone()}catch(e){oy&&ow.exception(e,"Failed to clone response body")}}(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await new Promise((e,n)=>{let r=tj(()=>n(Error("Timeout while trying to read response body")),500);sb(t).then(t=>e(t),e=>n(e)).finally(()=>clearTimeout(r))})]}catch(e){if(e instanceof Error&&e.message.indexOf("Timeout")>-1)return oy&&ow.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"];return oy&&ow.exception(e,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"]}}function sy(e=[]){if(2===e.length&&"object"==typeof e[1])return e[1].body}function sv(e,t){let n={};return t.forEach(t=>{e.get(t)&&(n[t]=e.get(t))}),n}function s_(e,t){if(!e)return{};let n=e.headers;return n?n instanceof Headers?sv(n,t):Array.isArray(n)?{}:sc(n,t):{}}async function sb(e){return await e.text()}async function sw(e,t,n){try{let r=function(e,t,n){let r=Date.now(),{startTimestamp:i=r,endTimestamp:o=r,input:s,xhr:a}=t,{url:u,method:l,status_code:c=0,request_body_size:d,response_body_size:h}=e.data;if(!u)return null;if(!a||!sh(u,n.networkDetailAllowUrls)||sh(u,n.networkDetailDenyUrls)){let e=su(d);return{startTimestamp:i,endTimestamp:o,url:u,method:l,statusCode:c,request:e,response:su(h)}}let f=a[eZ],p=f?sc(f.request_headers,n.networkRequestHeaders):{},g=sc(function(e){let t=e.getAllResponseHeaders();return t?t.split("\r\n").reduce((e,t)=>{let[n,r]=t.split(": ");return r&&(e[n.toLowerCase()]=r),e},{}):{}}(a),n.networkResponseHeaders),[m,y]=n.networkCaptureBodies?so(s):[void 0],[v,_]=n.networkCaptureBodies?function(e){let t=[];try{return[e.responseText]}catch(e){t.push(e)}try{return function(e,t){try{if("string"==typeof e)return[e];if(e instanceof Document)return[e.body.outerHTML];if("json"===t&&e&&"object"==typeof e)return[JSON.stringify(e)];if(!e)return[void 0]}catch(t){return oy&&ow.exception(t,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return oy&&ow.info("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}(e.response,e.responseType)}catch(e){t.push(e)}return oy&&ow.warn("Failed to get xhr response body",...t),[void 0]}(a):[void 0],b=sl(p,d,m),w=sl(g,h,v);return{startTimestamp:i,endTimestamp:o,url:u,method:l,statusCode:c,request:y?ss(b,y):b,response:_?ss(w,_):w}}(e,t,n),i=sa("resource.xhr",r);sn(n.replay,i)}catch(e){oy&&ow.exception(e,"Failed to capture xhr breadcrumb")}}async function sS(e){try{return Promise.all(st(e,[function(e){let{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,i=Date.now()/1e3;return{type:"memory",name:"memory",start:i,end:i,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}(rz.performance.memory)]))}catch(e){return[]}}async function sE({client:e,scope:t,replayId:n,event:r}){let i={event_id:n,integrations:"object"!=typeof e._integrations||null===e._integrations||Array.isArray(e._integrations)?void 0:Object.keys(e._integrations)};e.emit("preprocessEvent",r,i);let o=await (0,eR.R)(e.getOptions(),r,i,t,e,(0,V.aF)());if(!o)return null;o.platform=o.platform||"javascript";let s=e.getSdkMetadata(),{name:a,version:u}=s&&s.sdk||{};return o.sdk={...o.sdk,name:a||"sentry.javascript.unknown",version:u||"0.0.0"},o}async function sk({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:i,session:o}){var s;let a;let u=function({recordingData:e,headers:t}){let n;let r=`${JSON.stringify(t)}
`;if("string"==typeof e)n=`${r}${e}`;else{let t=new TextEncoder().encode(r);(n=new Uint8Array(t.length+e.length)).set(t),n.set(e,t.length)}return n}({recordingData:e,headers:{segment_id:n}}),{urls:l,errorIds:c,traceIds:d,initialTimestamp:h}=r,f=(0,V.s3)(),p=(0,V.nZ)(),g=f&&f.getTransport(),m=f&&f.getDsn();if(!f||!g||!m||!o.sampled)return(0,ev.WD)({});let y={type:"replay_event",replay_start_timestamp:h/1e3,timestamp:i/1e3,error_ids:c,trace_ids:d,urls:l,replay_id:t,segment_id:n,replay_type:o.sampled},v=await sE({scope:p,client:f,replayId:t,event:y});if(!v)return f.recordDroppedEvent("event_processor","replay",y),oy&&ow.info("An event processor returned `null`, will not send event."),(0,ev.WD)({});delete v.sdkProcessingMetadata;let _=(s=f.getOptions().tunnel,eb(eI(v,ek(v),s,m),[[{type:"replay_event"},v],[{type:"replay_recording",length:"string"==typeof u?new TextEncoder().encode(u).length:u.length},u]]));try{a=await g.send(_)}catch(t){let e=Error(rG);try{e.cause=t}catch(e){}throw e}if("number"==typeof a.statusCode&&(a.statusCode<200||a.statusCode>=300))throw new sI(a.statusCode);let b=tF({},a);if(tq(b,"replay"))throw new sT(b);return a}class sI extends Error{constructor(e){super(`Transport returned status code ${e}`)}}class sT extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}}async function sx(e,t={count:0,interval:5e3}){let{recordingData:n,onError:r}=e;if(n.length)try{return await sk(e),!0}catch(n){if(n instanceof sI||n instanceof sT)throw n;if((0,R.v)("Replays",{_retryCount:t.count}),r&&r(n),t.count>=3){let e=Error(`${rG} - max retries exceeded`);try{e.cause=n}catch(e){}throw e}return t.interval*=++t.count,new Promise((n,r)=>{tj(async()=>{try{await sx(e,t),n(!0)}catch(e){r(e)}},t.interval)})}}let sC="__THROTTLED";class sA{constructor({options:e,recordingOptions:t}){sA.prototype.__init.call(this),sA.prototype.__init2.call(this),sA.prototype.__init3.call(this),sA.prototype.__init4.call(this),sA.prototype.__init5.call(this),sA.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:3e5,sessionIdleExpire:9e5},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=t,this._options=e,this._debouncedFlush=function(e,t,n){let r,i,o;let s=n&&n.maxWait?Math.max(n.maxWait,t):0;function a(){return u(),r=e()}function u(){void 0!==i&&clearTimeout(i),void 0!==o&&clearTimeout(o),i=o=void 0}function l(){return i&&clearTimeout(i),i=tj(a,t),s&&void 0===o&&(o=tj(a,s)),r}return l.cancel=u,l.flush=function(){return void 0!==i||void 0!==o?a():r},l}(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=function(e,t,n){let r=new Map,i=e=>{let t=e-5;r.forEach((e,n)=>{n<t&&r.delete(n)})},o=()=>[...r.values()].reduce((e,t)=>e+t,0),s=!1;return(...t)=>{let n=Math.floor(Date.now()/1e3);if(i(n),o()>=300){let e=s;return s=!0,e?"__SKIPPED":sC}s=!1;let a=r.get(n)||0;return r.set(n,a+1),e(...t)}}((e,t)=>o9(this,e)?o6(this,e,t):Promise.resolve(null),0,0);let{slowClickTimeout:n,slowClickIgnoreSelectors:r}=this.getOptions(),i=n?{threshold:Math.min(3e3,n),timeout:n,scrollTimeout:300,ignoreSelector:r?r.join(","):""}:void 0;if(i&&(this.clickDetector=new oA(this,i)),oy){let t=e._experiments;ow.setConfig({captureExceptions:!!t.captureExceptions,traceInternals:!!t.traceInternals})}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(e){oy&&ow.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){let{errorSampleRate:t,sessionSampleRate:n}=this._options,r=t<=0&&n<=0;if(this._requiresManualStart=r,!r){if(this._initializeSessionForSampling(e),!this.session){oy&&ow.exception(Error("Unable to initialize and create session"));return}!1!==this.session.sampled&&(this.recordingMode="buffer"===this.session.sampled&&0===this.session.segmentId?"buffer":"session",oy&&ow.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&"session"===this.recordingMode){oy&&ow.info("Recording is already in progress");return}if(this._isEnabled&&"buffer"===this.recordingMode){oy&&ow.info("Buffering is in progress, call `flush()` to save the replay");return}oy&&ow.infoTick("Starting replay in session mode"),this._updateUserActivity();let e=o4({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this._initializeRecording()}startBuffering(){if(this._isEnabled){oy&&ow.info("Buffering is in progress, call `flush()` to save the replay");return}oy&&ow.infoTick("Starting replay in buffer mode");let e=o4({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{var e;let t;let n=this._canvas;this._stopRecording=om({...this._recordingOptions,..."buffer"===this.recordingMode?{checkoutEveryNms:6e4}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:(e=this,t=!1,(n,r)=>{if(!e.checkAndHandleExpiredSession()){oy&&ow.warn("Received replay event after session expired.");return}let i=r||!t;t=!0,e.clickDetector&&function(e,t){try{if(3!==t.type)return;let{source:n}=t.data;if(oC.has(n)&&e.registerMutation(t.timestamp),n===iH.Scroll&&e.registerScroll(t.timestamp),t.data.source===iH.MouseInteraction){let{type:n,id:r}=t.data,i=om.mirror.getNode(r);i instanceof HTMLElement&&n===iK.Click&&e.registerClick(i)}}catch(e){}}(e.clickDetector,n),e.addUpdate(()=>{if("buffer"===e.recordingMode&&i&&e.setInitialState(),!o5(e,n,i))return!0;if(!i)return!1;let t=e.session;if(i&&e.session&&0===e.session.segmentId&&o5(e,function(e){let t=e.getOptions();return{type:iW.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:!!e.eventBuffer&&"worker"===e.eventBuffer.type,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}(e),!1),"buffer"===e.recordingMode&&t&&e.eventBuffer){let n=e.eventBuffer.getEarliestTimestamp();n&&(oy&&ow.info(`Updating session start time to earliest event in buffer to ${new Date(n)}`),t.started=n,e.getOptions().stickySession&&oY(t))}return!!t&&!!t.previousSessionId||("session"===e.recordingMode&&e.flush(),!0)})}),onMutation:this._onMutationHandler,...n?{recordCanvas:n.recordCanvas,getCanvasManager:n.getCanvasManager,sampling:n.sampling,dataURLOptions:n.dataURLOptions}:{}})}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this.handleException(e),!1}}async stop({forceFlush:e=!1,reason:t}={}){if(this._isEnabled){this._isEnabled=!1;try{oy&&ow.info(`Stopping Replay${t?` triggered by ${t}`:""}`),function(){let e=(0,V.nZ)().getPropagationContext().dsc;e&&delete e.replay_id;let t=(0,eA.HN)();if(t){let e=(0,eC.jC)(t);delete e.replay_id}}(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,function(){if(oX())try{rz.sessionStorage.removeItem(rV)}catch(e){}}(),this.session=void 0}catch(e){this.handleException(e)}}}pause(){!this._isPaused&&(this._isPaused=!0,this.stopRecording(),oy&&ow.info("Pausing replay"))}resume(){this._isPaused&&this._checkSession()&&(this._isPaused=!1,this.startRecording(),oy&&ow.info("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if("session"===this.recordingMode)return this.flushImmediate();let t=Date.now();oy&&ow.info("Converting buffer to session"),await this.flushImmediate();let n=this.stopRecording();e&&n&&"session"!==this.recordingMode&&(this.recordingMode="session",this.session&&(this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession()),this.startRecording())}addUpdate(e){let t=e();"buffer"!==this.recordingMode&&!0!==t&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return"buffer"===this.recordingMode?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(this._lastActivity&&o1(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&"session"===this.session.sampled){this.pause();return}return!!this._checkSession()}setInitialState(){let e=`${rz.location.pathname}${rz.location.hash}${rz.location.search}`,t=`${rz.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){let n=this._throttledAddEvent(e,t);if(n===sC){let e=oR({category:"replay.throttled"});this.addUpdate(()=>!o5(this,{type:5,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e,metric:!0}}))}return n}getCurrentRoute(){let e=this.lastActiveSpan||(0,eA.HN)(),t=e&&(0,eA.Gx)(e),n=(t&&(0,eA.XU)(t).data||{})[tK.Zj];if(t&&n&&["route","custom"].includes(n))return(0,eA.XU)(t).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=function({useCompression:e,workerUrl:t}){if(e&&window.Worker){let e=function(e){try{let t=e||("undefined"!=typeof __SENTRY_EXCLUDE_REPLAY_WORKER__&&__SENTRY_EXCLUDE_REPLAY_WORKER__?"":function(){let e=new Blob(['var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},C=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=_(f,15),M=b.t,E=b.l,x=_(h,15),C=x.t,U=x.l,F=D(M),I=F.c,S=F.n,L=D(C),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=_(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(C,U,0),R=C;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[a[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}},L=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},O=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,A=c.p||new n(32768),_=c.h||new n(z+1),x=Math.ceil(o/3),D=2*x,T=function(t){return(a[t]^a[t+1]<<x^a[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=_[H];if(A[J]=K,_[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-A[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=C(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=_,c.p=A,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},j=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},q=function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&j(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}},B=function(t){return 10+(t.filename?t.filename.length+1:0)},G=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(O(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();var H=function(){function t(t,n){this.c=L(),this.v=1,G.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),G.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=O(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=L();i.p(n.dictionary),j(t,2,i.d())}}(r,this.o),this.v=0),n&&j(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),J="undefined"!=typeof TextEncoder&&new TextEncoder,K="undefined"!=typeof TextDecoder&&new TextDecoder;try{K.decode(F,{stream:!0})}catch(t){}var N=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(P(t),this.d=n||!1)},t}();function P(n,r){if(r){for(var e=new t(n.length),i=0;i<n.length;++i)e[i]=n.charCodeAt(i);return e}if(J)return J.encode(n);var a=n.length,s=new t(n.length+(n.length>>1)),o=0,f=function(t){s[o++]=t};for(i=0;i<a;++i){if(o+5>s.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}function Q(t){return function(t,n){n||(n={});var r=S(),e=t.length;r.p(t);var i=O(t,n,B(n),8),a=i.length;return q(i,n),j(i,a-8,r.d()),j(i,a-4,e),i}(P(t))}const R=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new H,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new N(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},V={clear:()=>{R.clear()},addEvent:t=>R.addEvent(t),finish:()=>R.finish(),compress:t=>Q(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in V&&"function"==typeof V[n])try{const t=V[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});']);return URL.createObjectURL(e)}());if(!t)return;oy&&ow.info(`Using compression worker${e?` from ${e}`:""}`);let n=new Worker(t);return new oJ(n)}catch(e){oy&&ow.exception(e,"Failed to create compression worker")}}(t);if(e)return e}return oy&&ow.info("Using simple buffer"),new oW}({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_initializeSessionForSampling(e){let t=this._options.errorSampleRate>0,n=o4({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t});this.session=n}_checkSession(){if(!this.session)return!1;let e=this.session;return!o3(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(e),!1)}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(e.id))}_addListeners(){try{rz.document.addEventListener("visibilitychange",this._handleVisibilityChange),rz.addEventListener("blur",this._handleWindowBlur),rz.addEventListener("focus",this._handleWindowFocus),rz.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(function(e){let t=(0,V.s3)();eJ(oP(e)),ed(t=>{if(!e.isEnabled())return;let n=function(e){let{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}(t);null!==n&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(st(e,[n]),!1)))}),function(e){let t=(0,V.s3)();t&&t.on("beforeAddBreadcrumb",t=>(function(e,t){if(!e.isEnabled()||!se(t))return;let n=!se(t)||["fetch","xhr","sentry.event","sentry.transaction"].includes(t.category)||t.category.startsWith("ui.")?null:"console"===t.category?function(e){let t=e.data&&e.data.arguments;if(!Array.isArray(t)||0===t.length)return oR(e);let n=!1,r=t.map(e=>{if(!e)return e;if("string"==typeof e)return e.length>5e3?(n=!0,`${e.slice(0,5e3)}…`):e;if("object"==typeof e)try{let t=(0,e_.Fv)(e,7);if(JSON.stringify(t).length>5e3)return n=!0,`${JSON.stringify(t,null,2).slice(0,5e3)}…`;return t}catch(e){}return e});return oR({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}(t):oR(t);n&&ok(e,n)})(e,t))}(e),function(e){let t=(0,V.s3)();try{let{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:i,networkRequestHeaders:o,networkResponseHeaders:s}=e.getOptions(),a={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:i,networkRequestHeaders:o,networkResponseHeaders:s};t&&t.on("beforeAddBreadcrumb",(e,t)=>(function(e,t,n){if(t.data)try{var r,i;"xhr"===t.category&&(r=n)&&r.xhr&&(function(e,t){let{xhr:n,input:r}=t;if(!n)return;let i=sr(r),o=n.getResponseHeader("content-length")?si(n.getResponseHeader("content-length")):function(e,t){try{let n="json"===t&&e&&"object"==typeof e?JSON.stringify(e):e;return sr(n)}catch(e){return}}(n.response,n.responseType);void 0!==i&&(e.data.request_body_size=i),void 0!==o&&(e.data.response_body_size=o)}(t,n),sw(t,n,e)),"fetch"===t.category&&(i=n)&&i.response&&(function(e,t){let{input:n,response:r}=t,i=sr(n?sy(n):void 0),o=r?si(r.headers.get("content-length")):void 0;void 0!==i&&(e.data.request_body_size=i),void 0!==o&&(e.data.response_body_size=o)}(t,n),sf(t,n,e))}catch(e){oy&&ow.exception(e,"Error when enriching network breadcrumb")}})(a,e,t))}catch(e){}}(e);let n=Object.assign((t,n)=>!e.isEnabled()||e.isPaused()?t:"replay_event"===t.type?(delete t.breadcrumbs,t):(!t.type||o8(t)||o7(t))&&e.checkAndHandleExpiredSession()?o7(t)?(e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),e.triggerUserActivity(),e.addUpdate(()=>!t.timestamp||(e.throttledAddEvent({type:iW.Custom,timestamp:1e3*t.timestamp,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1)),t):!t.type&&t.exception&&t.exception.values&&t.exception.values.length&&n.originalException&&n.originalException.__rrweb__&&!e.getOptions()._experiments.captureExceptions?(oy&&ow.log("Ignoring error from rrweb internals",t),null):(("buffer"===e.recordingMode&&t.message!==rG&&t.exception&&!t.type&&oQ(e.getOptions().errorSampleRate)||"session"===e.recordingMode)&&(t.tags={...t.tags,replayId:e.getSessionId()}),t):t,{id:"Replay"});(0,R.Qy)(n),t&&(t.on("beforeSendEvent",t=>{e.isEnabled()&&!t.type&&function(e,t){let n=t.exception&&t.exception.values&&t.exception.values[0]&&t.exception.values[0].value;"string"==typeof n&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))&&ok(e,oR({category:"replay.hydrate-error",data:{url:(0,te.l4)()}}))}(e,t)}),t.on("afterSendEvent",(t,n)=>{if(!e.isEnabled()||t.type&&!o8(t))return;let r=n&&n.statusCode;if(r&&!(r<200)&&!(r>=300)){if(o8(t)){(function(e,t){let n=e.getContext();t.contexts&&t.contexts.trace&&t.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)})(e,t);return}(function(e,t){let n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),"buffer"!==e.recordingMode||!t.tags||!t.tags.replayId)return;let{beforeErrorSampling:r}=e.getOptions();("function"!=typeof r||r(t))&&tj(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(t){e.handleException(t)}})})(e,t)}}),t.on("createDsc",t=>{let n=e.getSessionId();n&&e.isEnabled()&&"session"===e.recordingMode&&e.checkAndHandleExpiredSession()&&(t.replay_id=n)}),t.on("spanStart",t=>{e.lastActiveSpan=t}),t.on("spanEnd",t=>{e.lastActiveSpan=t}),t.on("beforeSendFeedback",(t,n)=>{let r=e.getSessionId();n&&n.includeReplay&&e.isEnabled()&&r&&t.contexts&&t.contexts.feedback&&(t.contexts.feedback.replay_id=r)}))}(this),this._hasInitializedCoreListeners=!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=function(e){function t(t){e.performanceEntries.includes(t)||e.performanceEntries.push(t)}function n({entries:e}){e.forEach(t)}let r=[];return["navigation","paint","resource"].forEach(e=>{r.push(nK(e,n))}),r.push(nG(oU(oF,e)),nV(oU(o$,e)),nW(oU(oB,e)),nH(oU(oz,e))),()=>{r.forEach(e=>e())}}(this)}_removeListeners(){try{rz.document.removeEventListener("visibilitychange",this._handleVisibilityChange),rz.removeEventListener("blur",this._handleWindowBlur),rz.removeEventListener("focus",this._handleWindowFocus),rz.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}__init(){this._handleVisibilityChange=()=>{"visible"===rz.document.visibilityState?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{let e=oR({category:"ui.blur"});this._doChangeToBackgroundTasks(e)}}__init3(){this._handleWindowFocus=()=>{let e=oR({category:"ui.focus"});this._doChangeToForegroundTasks(e)}}__init4(){this._handleKeyboardEvent=e=>{!function(e,t){if(!e.isEnabled())return;e.updateUserActivity();let n=function(e){var t;let{metaKey:n,shiftKey:r,ctrlKey:i,altKey:o,key:s,target:a}=e;if(!a||"INPUT"===(t=a).tagName||"TEXTAREA"===t.tagName||t.isContentEditable||!s)return null;let u=n||i||o,l=1===s.length;if(!u&&l)return null;let c=(0,te.Rt)(a,{maxStringLength:200})||"<unknown>",d=oM(a,c);return oR({category:"ui.keyDown",message:c,data:{...d.data,metaKey:n,shiftKey:r,ctrlKey:i,altKey:o,key:s}})}(t);n&&ok(e,n)}(this,e)}}_doChangeToBackgroundTasks(e){!this.session||o2(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(e&&this._createCustomBreadcrumb(e),this.conditionalFlush())}_doChangeToForegroundTasks(e){if(this.session){if(!this.checkAndHandleExpiredSession()){oy&&ow.info("Document has become active, but session has expired");return}e&&this._createCustomBreadcrumb(e)}}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:iW.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){let e=this.performanceEntries.map(oj).filter(Boolean).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){let t=this._context.initialTimestamp/1e3;e=e.filter(e=>e.start>=t)}return Promise.all(st(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:e,eventBuffer:t}=this;if(!e||!t||this._requiresManualStart||e.segmentId)return;let n=t.getEarliestTimestamp();n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}_popEventContext(){let e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){let e=this.getSessionId();if(!this.session||!this.eventBuffer||!e){oy&&ow.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),this.eventBuffer&&this.eventBuffer.hasEvents&&(await sS(this),this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let t=Date.now();if(t-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw Error("Session is too long, not sending replay");let n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession();let i=await this.eventBuffer.finish();await sx({replayId:e,recordingData:i,segmentId:r,eventContext:n,session:this.session,timestamp:t,onError:e=>this.handleException(e)})}catch(t){this.handleException(t),this.stop({reason:"sendReplay"});let e=(0,V.s3)();e&&e.recordDroppedEvent(t instanceof sT?"ratelimit_backoff":"send_error","replay")}}__init5(){this._flush=async({force:e=!1}={})=>{if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession()){oy&&ow.error("Attempting to finish replay event after session expired.");return}if(!this.session)return;let t=this.session.started,n=Date.now()-t;this._debouncedFlush.cancel();let r=n<this._options.minReplayDuration,i=n>this._options.maxReplayDuration+5e3;if(r||i){oy&&ow.info(`Session duration (${Math.floor(n/1e3)}s) is too ${r?"short":"long"}, not sending replay.`),r&&this._debouncedFlush();return}let o=this.eventBuffer;o&&0===this.session.segmentId&&!o.hasCheckout&&oy&&ow.info("Flushing initial segment without checkout.");let s=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(e){this.handleException(e)}finally{this._flushLock=void 0,s&&this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&oY(this.session)}__init6(){this._onMutationHandler=e=>{let t=e.length,n=this._options.mutationLimit,r=this._options.mutationBreadcrumbLimit,i=n&&t>n;if(t>r||i){let e=oR({category:"replay.mutations",data:{count:t,limit:i}});this._createCustomBreadcrumb(e)}return!i||(this.stop({reason:"mutationLimit",forceFlush:"session"===this.recordingMode}),!1)}}}function sO(e,t){return[...e,...t].join(",")}let sN='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',sR=["content-length","content-type","accept"],sD=!1;class sP{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:e=5e3,flushMaxDelay:t=5500,minReplayDuration:n=4999,maxReplayDuration:r=36e5,stickySession:i=!0,useCompression:o=!0,workerUrl:s,_experiments:a={},maskAllText:u=!0,maskAllInputs:l=!0,blockAllMedia:c=!0,mutationBreadcrumbLimit:d=750,mutationLimit:h=1e4,slowClickTimeout:f=7e3,slowClickIgnoreSelectors:p=[],networkDetailAllowUrls:g=[],networkDetailDenyUrls:m=[],networkCaptureBodies:y=!0,networkRequestHeaders:v=[],networkResponseHeaders:_=[],mask:b=[],maskAttributes:w=["title","placeholder"],unmask:S=[],block:E=[],unblock:k=[],ignore:I=[],maskFn:T,beforeAddRecordingEvent:x,beforeErrorSampling:C}={}){this.name=sP.id;let A=function({mask:e,unmask:t,block:n,unblock:r,ignore:i}){return{maskTextSelector:sO(e,[".sentry-mask","[data-sentry-mask]"]),unmaskTextSelector:sO(t,[]),blockSelector:sO(n,[".sentry-block","[data-sentry-block]",'base[href="/"]']),unblockSelector:sO(r,[]),ignoreSelector:sO(i,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}({mask:b,unmask:S,block:E,unblock:k,ignore:I});if(this._recordingOptions={maskAllInputs:l,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:T,maskInputFn:T,maskAttributeFn:(e,t,n)=>(function({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:i,value:o}){return!r||i.unmaskTextSelector&&e.matches(i.unmaskTextSelector)?o:n.includes(t)||"value"===t&&"INPUT"===e.tagName&&["submit","button"].includes(e.getAttribute("type")||"")?o.replace(/[\S]/g,"*"):o})({maskAttributes:w,maskAllText:u,privacyOptions:A,key:e,value:t,el:n}),...A,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:e=>{try{e.__rrweb__=!0}catch(e){}}},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(n,15e3),maxReplayDuration:Math.min(r,36e5),stickySession:i,useCompression:o,workerUrl:s,blockAllMedia:c,maskAllInputs:l,maskAllText:u,mutationBreadcrumbLimit:d,mutationLimit:h,slowClickTimeout:f,slowClickIgnoreSelectors:p,networkDetailAllowUrls:g,networkDetailDenyUrls:m,networkCaptureBodies:y,networkRequestHeaders:sM(v),networkResponseHeaders:sM(_),beforeAddRecordingEvent:x,beforeErrorSampling:C,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${sN}`:sN),this._isInitialized&&rB())throw Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return sD}set _isInitialized(e){sD=e}afterAllSetup(e){rB()&&!this._replay&&(this._setup(e),this._initialize(e))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:"session"===this._replay.recordingMode}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(){if(this._replay&&this._replay.isEnabled())return this._replay.getSessionId()}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){let t=function(e,t){let n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...(0,z.Jr)(e)},i=eN(n.replaysSessionSampleRate),o=eN(n.replaysOnErrorSampleRate);return null==i&&null==o&&(0,D.Cf)(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),null!=i&&(r.sessionSampleRate=i),null!=o&&(r.errorSampleRate=o),r}(this._initialOptions,e);this._replay=new sA({options:t,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{let t=e.getIntegrationByName("ReplayCanvas");if(!t)return;this._replay._canvas=t.getOptions()}catch(e){}}}function sM(e){return[...sR,...e.map(e=>e.toLowerCase())]}function sL(e,t){let n;let r=function(e){let t={};return e.forEach((e,n)=>{t[n]=e}),t}(t.headers);try{let t=r[e]||r[e.toLowerCase()]||void 0;t&&(n=sU(t))}catch(t){eU&&D.kg.log(`Could not extract cookies from header ${e}`)}return[r,n]}function sU(e){return e.split("; ").reduce((e,t)=>{let[n,r]=t.split("=");return n&&r&&(e[n]=r),e},{})}function sj(e,t,n){return e.failedRequestStatusCodes.some(e=>"number"==typeof e?e===t:t>=e[0]&&t<=e[1])&&e.failedRequestTargets.some(e=>"string"==typeof e?n.includes(e):e.test(n))&&!rq(n,(0,V.s3)())}function sq(e){let t=`HTTP Client Error with status code: ${e.status}`,n={message:t,exception:{values:[{type:"Error",value:t}]},request:{url:e.url,method:e.method,headers:e.requestHeaders,cookies:e.requestCookies},contexts:{response:{status_code:e.status,headers:e.responseHeaders,cookies:e.responseCookies,body_size:function(e){if(e){let t=e["Content-Length"]||e["content-length"];if(t)return parseInt(t,10)}}(e.responseHeaders)}}};return(0,P.EG)(n,{type:"http.client",handled:!1}),n}function sF(){let e=(0,V.s3)();return!!e&&!!e.getOptions().sendDefaultPii}sP.__initStatic();var s$=n(6713);globalThis.__sentryRewritesTunnelPath__=void 0,globalThis.SENTRY_RELEASE={id:"5fc7109062f635f1baa19eda07eca892cb000365"},globalThis.__sentryBasePath=void 0,globalThis.__rewriteFramesAssetPrefixPath__="",function(e){let t={environment:function(e){let t=e?"production":tG.env.VERCEL_ENV;return t?`vercel-${t}`:void 0}(!0)||"production",defaultIntegrations:function(e){let t=tz(e);("undefined"==typeof __SENTRY_TRACING__||__SENTRY_TRACING__)&&t.push(function(e={}){let t=rS({...e,instrumentNavigation:!1,instrumentPageLoad:!1}),{instrumentPageLoad:n=!0,instrumentNavigation:r=!0}=e;return{...t,afterAllSetup(e){var i;r&&(i=e,eG.document.getElementById("__NEXT_DATA__")?rN.events.on("routeChangeStart",e=>{let t,n;let r=e.split(/[?#]/,1)[0],o=function(e){let t=(eG.__BUILD_MANIFEST||{}).sortedPages;if(t)return t.find(t=>{let n=function(e){let t=e.split("/"),n="";nt([t,"access",e=>e[t.length-1],"optionalAccess",e=>e.match,"call",e=>e(/^\[\[\.\.\..+\]\]$/)])&&(t.pop(),n="(?:/(.+?))?");let r=t.map(e=>e.replace(/^\[\.\.\..+\]$/,"(.+?)").replace(/^\[.*\]$/,"([^/]+?)")).join("/");return RegExp(`^${r}${n}(?:/)?$`)}(t);return e.match(n)})}(r);o?(t=o,n="route"):(t=r,n="url"),rk(i,{name:t,attributes:{[tK.$J]:"navigation",[tK.S3]:"auto.navigation.nextjs.pages_router_instrumentation",[tK.Zj]:n}})}):function(e){let t;eG.addEventListener("popstate",()=>{t&&t.isRecording()?t.updateName(eG.location.pathname):t=rk(e,{name:eG.location.pathname,attributes:{[tK.$J]:"navigation",[tK.S3]:"auto.navigation.nextjs.app_router_instrumentation",[tK.Zj]:"url","navigation.type":"browser.popstate"}})});let n=!1,r=0,i=setInterval(()=>{var o;r++;let s=null!=(o=nt([rx,"optionalAccess",e=>e.next,"optionalAccess",e=>e.router]))?o:nt([rx,"optionalAccess",e=>e.nd,"optionalAccess",e=>e.router]);n||r>500?clearInterval(i):s&&(clearInterval(i),n=!0,["back","forward","push","replace"].forEach(n=>{nt([s,"optionalAccess",e=>e[n]])&&(s[n]=new Proxy(s[n],{apply(r,i,o){let s=rk(e,{name:rT,attributes:{[tK.$J]:"navigation",[tK.S3]:"auto.navigation.nextjs.app_router_instrumentation",[tK.Zj]:"url"}});return t=s,"push"===n?(nt([s,"optionalAccess",e=>e.updateName,"call",e=>e(rC(o[0]))]),nt([s,"optionalAccess",e=>e.setAttribute,"call",e=>e("navigation.type","router.push")])):"replace"===n?(nt([s,"optionalAccess",e=>e.updateName,"call",e=>e(rC(o[0]))]),nt([s,"optionalAccess",e=>e.setAttribute,"call",e=>e("navigation.type","router.replace")])):"back"===n?nt([s,"optionalAccess",e=>e.setAttribute,"call",e=>e("navigation.type","router.back")]):"forward"===n&&nt([s,"optionalAccess",e=>e.setAttribute,"call",e=>e("navigation.type","router.forward")]),r.apply(i,o)}}))}))},20)}(i)),t.afterAllSetup(e),n&&(eG.document.getElementById("__NEXT_DATA__")?function(e){let{route:t,params:n,sentryTrace:r,baggage:i}=function(){let e;let t=eG.document.getElementById("__NEXT_DATA__");if(t&&t.innerHTML)try{e=JSON.parse(t.innerHTML)}catch(e){rO.X&&D.kg.warn("Could not extract __NEXT_DATA__")}if(!e)return{};let n={},{page:r,query:i,props:o}=e;return n.route=r,n.params=i,o&&o.pageProps&&(n.sentryTrace=o.pageProps._sentryTraceData,n.baggage=o.pageProps._sentryBaggage),n}();rE(e,{name:t||eG.location.pathname,startTime:ex.Z1?ex.Z1/1e3:void 0,attributes:{[tK.$J]:"pageload",[tK.S3]:"auto.pageload.nextjs.pages_router_instrumentation",[tK.Zj]:t?"route":"url",...n&&e.getOptions().sendDefaultPii&&{...n}}},{sentryTrace:r,baggage:i})}(e):rE(e,{name:eG.location.pathname,startTime:ex.Z1?ex.Z1/1e3:void 0,attributes:{[tK.$J]:"pageload",[tK.S3]:"auto.pageload.nextjs.app_router_instrumentation",[tK.Zj]:"url"}}))}}}());let n=rj.__rewriteFramesAssetPrefixPath__||"";return t.push(rL({assetPrefixPath:n})),t}(e),...e};(function(e){let t=rU.__sentryRewritesTunnelPath__;if(t&&e.dsn){let n=eg(e.dsn);if(!n)return;let r=n.host.match(/^o(\d+)\.ingest(?:\.([a-z]{2}))?\.sentry\.io$/);if(r){let i=r[1],o=r[2],s=`${t}?o=${i}&p=${n.projectId}`;o&&(s+=`&r=${o}`),e.tunnel=s,rO.X&&D.kg.info(`Tunneling events to "${s}"`)}else rO.X&&D.kg.warn("Provided DSN is not a Sentry SaaS DSN. Will not tunnel events.")}})(t),N(t,"nextjs",["nextjs","react"]),function(e){let t={...e};N(t,"react"),(0,R.v)("react",{version:tV.version}),function(e={}){let t=function(e={}){let t={defaultIntegrations:tz(),release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:eG.SENTRY_RELEASE&&eG.SENTRY_RELEASE.id?eG.SENTRY_RELEASE.id:void 0,autoSessionTracking:!0,sendClientReports:!0};return null==e.defaultIntegrations&&delete e.defaultIntegrations,{...t,...e}}(e);if(function(){let e=void 0!==eG.window&&eG;if(!e)return!1;let t=e.chrome?"chrome":"browser",n=e[t],r=n&&n.runtime&&n.runtime.id,i=eG.location&&eG.location.href||"",o=!!r&&eG===eG.top&&["chrome-extension:","moz-extension:","ms-browser-extension:","safari-web-extension:"].some(e=>i.startsWith(`${e}//`)),s=void 0!==e.nw;return!!r&&!o&&!s}()){(0,D.Cf)(()=>{console.error("[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")});return}eU&&!et()&&D.kg.warn("No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill."),function(e,t){!0===t.debug&&(L.X?D.kg.enable():(0,D.Cf)(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),(0,V.nZ)().update(t.initialScope);let n=new e(t);(0,V.nZ)().setClient(n),n.init()}(eK,{...t,stackParser:(0,H.Sq)(t.stackParser||tD),integrations:function(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r=function(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}(Array.isArray(n)?[...t,...n]:"function"==typeof n?(0,P.lE)(n(t)):t),i=r.findIndex(e=>"Debug"===e.name);if(i>-1){let[e]=r.splice(i,1);r.push(e)}return r}(t),transport:t.transport||tB}),t.autoSessionTracking&&function(){if(void 0===eG.document){eU&&D.kg.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}(0,R.yj)({ignoreDuration:!0}),(0,R.cg)(),ed(({from:e,to:t})=>{void 0!==e&&e!==t&&((0,R.yj)({ignoreDuration:!0}),(0,R.cg)())})}()}(t)}(t);let n=e=>"transaction"===e.type&&"/404"===e.transaction?null:e;n.id="NextClient404Filter",(0,R.Qy)(n);let r=e=>"transaction"===e.type&&e.transaction===rT?null:e;r.id="IncompleteTransactionFilter",(0,R.Qy)(r)}({dsn:"https://ab5e4439cad046599c8dea20ea9da41a@o1361935.ingest.us.sentry.io/6653041",tracesSampleRate:.01,normalizeDepth:10,replaysSessionSampleRate:0,replaysOnErrorSampleRate:.01,beforeSend:s$.og,integrations:[new sP({maskAllInputs:!1,maskAllText:!1,mask:['input[name="password"]','input[type="password"]'],networkDetailAllowUrls:[window.location.origin,"https://www.roshi-server.com","https://www.roshi.ai"]}),((e={})=>{let t=e.levels||D.RU;return{name:"CaptureConsole",setup(e){"console"in Y.GLOBAL_OBJ&&e2(({args:n,level:r})=>{(0,V.s3)()===e&&t.includes(r)&&function(e,t){let n={level:tn(t),extra:{arguments:e}};(0,V.$e)(r=>{if(r.addEventProcessor(e=>(e.logger="console",(0,P.EG)(e,{handled:!1,type:"console"}),e)),"assert"===t){if(!e[0]){let t=`Assertion failed: ${(0,M.nK)(e.slice(1)," ")||"console.assert"}`;r.setExtra("arguments",e.slice(1)),(0,R.uT)(t,n)}return}let i=e.find(e=>e instanceof Error);if(i){(0,R.Tb)(i,n);return}let o=(0,M.nK)(e," ");(0,R.uT)(o,n)})}(n,r)})}}})({levels:["error"]}),((e={})=>{let{depth:t=3,captureErrorCause:n=!0}=e;return{name:"ExtraErrorData",processEvent(e,r,i){let{maxValueLength:o=250}=i.getOptions();return function(e,t={},n,r,i){if(!t.originalException||!(0,ey.VZ)(t.originalException))return e;let o=t.originalException.name||t.originalException.constructor.name,s=function(e,t,n){try{let r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],i={};for(let t of Object.keys(e)){if(-1!==r.indexOf(t))continue;let o=e[t];i[t]=(0,ey.VZ)(o)||"string"==typeof o?(0,M.$G)(`${o}`,n):o}if(t&&void 0!==e.cause&&(i.cause=(0,ey.VZ)(e.cause)?e.cause.toString():e.cause),"function"==typeof e.toJSON){let t=e.toJSON();for(let e of Object.keys(t)){let n=t[e];i[e]=(0,ey.VZ)(n)?n.toString():n}}return i}catch(e){L.X&&D.kg.error("Unable to extract extra data from the Error object:",e)}return null}(t.originalException,r,i);if(s){let t={...e.contexts},r=(0,e_.Fv)(s,n);return(0,ey.PO)(r)&&((0,z.xp)(r,"__sentry_skip_normalization__",!0),t[o]=r),{...e,contexts:t}}return e}(e,r,t,n,o)}}})({depth:10}),((e={})=>{let t={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...e};return{name:"HttpClient",setup(e){er()&&e4(n=>{if((0,V.s3)()!==e)return;let{response:r,args:i}=n,[o,s]=i;r&&function(e,t,n,r){if(sj(e,n.status,n.url)){let e,i,o,s;let a=!r&&t instanceof Request||t instanceof Request&&t.bodyUsed?t:new Request(t,r);sF()&&([e,o]=sL("Cookie",a),[i,s]=sL("Set-Cookie",n));let u=sq({url:a.url,method:a.method,status:n.status,requestHeaders:e,responseHeaders:i,requestCookies:o,responseCookies:s});(0,R.eN)(u)}}(t,o,r,s)}),"XMLHttpRequest"in Y.GLOBAL_OBJ&&eY(n=>{if((0,V.s3)()!==e)return;let r=n.xhr,i=r[eZ];if(!i)return;let{method:o,request_headers:s}=i;try{!function(e,t,n,r){if(sj(e,t.status,t.responseURL)){let e,i,o;if(sF()){try{let e=t.getResponseHeader("Set-Cookie")||t.getResponseHeader("set-cookie")||void 0;e&&(i=sU(e))}catch(e){eU&&D.kg.log("Could not extract cookies from response headers")}try{o=function(e){let t=e.getAllResponseHeaders();return t?t.split("\r\n").reduce((e,t)=>{let[n,r]=t.split(": ");return n&&r&&(e[n]=r),e},{}):{}}(t)}catch(e){eU&&D.kg.log("Could not extract headers from response")}e=r}let s=sq({url:t.responseURL,method:n,status:t.status,requestHeaders:e,responseHeaders:o,responseCookies:i});(0,R.eN)(s)}}(t,r,o,s)}catch(e){eU&&D.kg.warn("Error while extracting response event form XHR response",e)}})}}})()],environment:"production",debug:!1})},56518:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return x}});var r=n(85893),i=n(67294),o=n(9008),s=n.n(o),a=n(87462),u=n(70804),l=n(57555);let c=(e,t)=>(0,a.Z)({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},t&&!e.vars&&{colorScheme:e.palette.mode}),d=e=>(0,a.Z)({color:(e.vars||e).palette.text.primary},e.typography.body1,{backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),h=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r={};n&&e.colorSchemes&&Object.entries(e.colorSchemes).forEach(t=>{var n;let[i,o]=t;r[e.getColorSchemeSelector(i).replace(/\s*&/,"")]={colorScheme:null==(n=o.palette)?void 0:n.mode}});let i=(0,a.Z)({html:c(e,n),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:(0,a.Z)({margin:0},d(e),{"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}})},r),o=null==(t=e.components)||null==(t=t.MuiCssBaseline)?void 0:t.styleOverrides;return o&&(i=[i,o]),i};var f=function(e){let{children:t,enableColorScheme:n=!1}=(0,u.Z)({props:e,name:"MuiCssBaseline"});return(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(l.Z,{styles:e=>h(e,n)}),t]})},p=n(40712),g=n(42122),m=n(8417);n(60),n(78715),n(86721);var y=n(45007),v=n(77745),_=n(53042),b=()=>{window.va||(window.va=function(...e){(window.vaq=window.vaq||[]).push(e)})},w=(e={debug:!0})=>{var t;if(!("undefined"!=typeof window))return;let n=function(e="auto"){return"auto"===e?!function(){try{return!1}catch(e){return!1}}()?"production":"development":e}(e.mode);b(),e.beforeSend&&(null==(t=window.va)||t.call(window,"beforeSend",e.beforeSend));let r="development"===n?"https://cdn.vercel-insights.com/v1/script.debug.js":"/_vercel/insights/script.js";if(document.head.querySelector(`script[src*="${r}"]`))return;let i=document.createElement("script");i.src=r,i.defer=!0,i.setAttribute("data-sdkn","@vercel/analytics"),i.setAttribute("data-sdkv","0.1.11"),"development"===n&&!1===e.debug&&i.setAttribute("data-debug","false"),document.head.appendChild(i)};function S({beforeSend:e,debug:t=!0,mode:n="auto"}){return(0,i.useEffect)(()=>{w({beforeSend:e,debug:t,mode:n})},[e,t,n]),null}var E=n(49636),k=n(4298),I=n.n(k);let T=(0,m.Z)({key:"css",prepend:!0});function x(e){let{Component:t,emotionCache:n=T,pageProps:i}=e;return(0,r.jsxs)(p.C,{value:n,children:[(0,r.jsxs)(s(),{children:[(0,r.jsx)("meta",{name:"viewport",content:"initial-scale=1, width=device-width"}),E.rv&&(0,r.jsx)("meta",{httpEquiv:"Content-Security-Policy",content:"upgrade-insecure-requests"})]}),(0,r.jsx)(I(),{type:"text/javascript",id:"ze-snippet",src:"https://static.zdassets.com/ekr/snippet.js?key=8de10848-3bbb-41a5-a1df-17fb2c349ec4",async:!0,defer:!0}),(0,r.jsx)(y.zt,{store:v.h,children:(0,r.jsxs)(_.Z,{theme:g.D,children:[(0,r.jsx)(f,{}),(0,r.jsx)(t,{...i}),E.XK&&(0,r.jsx)(S,{})]})})]})}},77745:function(e,t,n){"use strict";n.d(t,{h:function(){return ro},TL:function(){return rs},CG:function(){return ra}});var r,i=n(64514),o=n(45007),s=n(73076),a=n(37895),u=n(27179);let l={attachReduxState:!0,actionTransformer:e=>e,stateTransformer:e=>e||null};var c=function(e){return"@@redux-saga/"+e},d=c("CANCEL_PROMISE"),h=c("CHANNEL_END"),f=c("IO"),p=c("MATCH"),g=c("MULTICAST"),m=c("SAGA_ACTION"),y=c("SELF_CANCELLATION"),v=c("TASK"),_=c("TASK_CANCEL"),b=c("TERMINATE"),w=c("LOCATION"),S=n(87462),E=n(63366),k=function(e){return null==e},I=function(e){return null!=e},T=function(e){return"function"==typeof e},x=function(e){return"string"==typeof e},C=Array.isArray,A=function(e){return e&&T(e.then)},O=function(e){return e&&T(e.next)&&T(e.throw)},N=function e(t){return t&&(x(t)||P(t)||T(t)||C(t)&&t.every(e))},R=function(e){return e&&T(e.take)&&T(e.close)},D=function(e){return T(e)&&e.hasOwnProperty("toString")},P=function(e){return!!e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype},M=function(){return!0},L=function(){},U=function(e){return e},j=function(e,t){(0,S.Z)(e,t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(function(n){e[n]=t[n]})},q=function(e,t){var n;return(n=[]).concat.apply(n,t.map(e))};function F(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}function $(e){var t=!1;return function(){t||(t=!0,e())}}var B=function(e){throw e},z=function(e){return{value:e,done:!0}};function V(e,t,n){void 0===t&&(t=B),void 0===n&&(n="iterator");var r={meta:{name:n},next:e,throw:t,return:z,isSagaIterator:!0};return"undefined"!=typeof Symbol&&(r[Symbol.iterator]=function(){return r}),r}function G(e,t){var n=t.sagaStack;console.error(e),console.error(n)}var W=function(e){return Array.apply(null,Array(e))},H=function(e){return e===b},K=function(e){return e===_},J=function(e){return H(e)||K(e)};function X(e,t){var n,r=Object.keys(e),i=r.length,o=0,s=C(e)?W(i):{},a={};return r.forEach(function(e){var r=function(r,a){n||(a||J(r)?(t.cancel(),t(r,a)):(s[e]=r,++o===i&&(n=!0,t(s))))};r.cancel=L,a[e]=r}),t.cancel=function(){n||(n=!0,r.forEach(function(e){return a[e].cancel()}))},a}function Q(e){return{name:e.name||"anonymous",location:e[w]}}function Z(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}var Y={isEmpty:M,put:L,take:L},ee="TAKE",et="FORK",en=function(e,t){var n;return(n={})[f]=!0,n.combinator=!1,n.type=e,n.payload=t,n};function er(e,t){var n;return(void 0===e&&(e="*"),N(e))?(I(t)&&console.warn("take(pattern) takes one argument but two were provided. Consider passing an array for listening to several action types"),en(ee,{pattern:e})):R(n=e)&&n[g]&&I(t)&&N(t)?en(ee,{channel:e,pattern:t}):R(e)?(I(t)&&console.warn("take(channel) takes one argument but two were provided. Second argument is ignored."),en(ee,{channel:e})):void 0}function ei(e,t){return k(t)&&(t=e,e=void 0),en("PUT",{channel:e,action:t})}function eo(e){for(var t,n,r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return en(et,(n=null,T(e)?t=e:(C(e)?(n=e[0],t=e[1]):(n=e.context,t=e.fn),n&&x(t)&&T(n[t])&&(t=n[t])),{context:n,fn:t,args:i}))}var es=function(){var e={};return e.promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),e},ea=[],eu=0;function el(e){ea.push(e),eu||(eu++,ed())}function ec(e){try{return eu++,e()}finally{ed()}}function ed(){var e;for(eu--;!eu&&void 0!==(e=ea.shift());)!function(e){try{eu++,e()}finally{eu--}}(e)}var eh=function(e){return function(t){return e.some(function(e){return ey(e)(t)})}},ef=function(e){return function(t){return e(t)}},ep=function(e){return function(t){return t.type===String(e)}},eg=function(e){return function(t){return t.type===e}},em=function(){return M};function ey(e){var t="*"===e?em:x(e)?ep:C(e)?eh:D(e)?ep:T(e)?ef:P(e)?eg:null;if(null===t)throw Error("invalid pattern: "+e);return t(e)}var ev={type:h},e_=function(e){return e&&e.type===h};function eb(e){if(void 0===e){var t,n,r,i,o,s,a,u;t=void 0,n=Array(t=10),r=0,i=0,o=0,s=function(e){n[i]=e,i=(i+1)%t,r++},a=function(){if(0!=r){var e=n[o];return n[o]=null,r--,o=(o+1)%t,e}},u=function(){for(var e=[];r;)e.push(a());return e},e={isEmpty:function(){return 0==r},put:function(e){if(r<t)s(e);else{var a;a=2*t,r=(n=u()).length,i=n.length,o=0,n.length=a,t=a,s(e)}},take:a,flush:u}}var l=!1,c=[];return{take:function(t){l&&e.isEmpty()?t(ev):e.isEmpty()?(c.push(t),t.cancel=function(){F(c,t)}):t(e.take())},put:function(t){if(!l){if(0===c.length)return e.put(t);c.shift()(t)}},flush:function(t){if(l&&e.isEmpty()){t(ev);return}t(e.flush())},close:function(){if(!l){l=!0;var e=c;c=[];for(var t=0,n=e.length;t<n;t++)(0,e[t])(ev)}}}}function ew(e,t){void 0===t&&(t=Y);var n,r=!1,i=eb(t),o=function(){r||(r=!0,T(n)&&n(),i.close())};return n=$(n=e(function(e){if(e_(e)){o();return}i.put(e)})),r&&n(),{take:i.take,flush:i.flush,close:o}}function eS(){var e,t,n,r,i,o,s=(t=!1,r=n=[],i=function(){r===n&&(r=n.slice())},o=function(){t=!0;var e=n=r;r=[],e.forEach(function(e){e(ev)})},(e={})[g]=!0,e.put=function(e){if(!t){if(e_(e)){o();return}for(var i=n=r,s=0,a=i.length;s<a;s++){var u=i[s];u[p](e)&&(u.cancel(),u(e))}}},e.take=function(e,n){if(void 0===n&&(n=em),t){e(ev);return}e[p]=n,i(),r.push(e),e.cancel=$(function(){i(),F(r,e)})},e.close=o,e),a=s.put;return s.put=function(e){if(e[m]){a(e);return}el(function(){a(e)})},s}function eE(e,t){var n=e[d];T(n)&&(t.cancel=n),e.then(t,function(e){t(e,!0)})}var ek=0,eI=function(){return++ek};function eT(e){e.isRunning()&&e.cancel()}var ex=((r={})[ee]=function(e,t,n){var r=t.channel,i=void 0===r?e.channel:r,o=t.pattern,s=t.maybe,a=function(e){if(e instanceof Error){n(e,!0);return}if(e_(e)&&!s){n(b);return}n(e)};try{i.take(a,I(o)?ey(o):null)}catch(e){n(e,!0);return}n.cancel=a.cancel},r.PUT=function(e,t,n){var r=t.channel,i=t.action,o=t.resolve;el(function(){var t;try{t=(r?r.put:e.dispatch)(i)}catch(e){n(e,!0);return}o&&A(t)?eE(t,n):n(t)})},r.ALL=function(e,t,n,r){var i=r.digestEffect,o=ek,s=Object.keys(t);if(0===s.length){n(C(t)?[]:{});return}var a=X(t,n);s.forEach(function(e){i(t[e],o,a[e],e)})},r.RACE=function(e,t,n,r){var i=r.digestEffect,o=ek,s=Object.keys(t),a=C(t)?W(s.length):{},u={},l=!1;s.forEach(function(e){var t=function(t,r){l||(r||J(t)?(n.cancel(),n(t,r)):(n.cancel(),l=!0,a[e]=t,n(a)))};t.cancel=L,u[e]=t}),n.cancel=function(){l||(l=!0,s.forEach(function(e){return u[e].cancel()}))},s.forEach(function(e){l||i(t[e],o,u[e],e)})},r.CALL=function(e,t,n,r){var i=t.context,o=t.fn,s=t.args,a=r.task;try{var u=o.apply(i,s);if(A(u)){eE(u,n);return}if(O(u)){eM(e,u,a.context,ek,Q(o),!1,n);return}n(u)}catch(e){n(e,!0)}},r.CPS=function(e,t,n){var r=t.context,i=t.fn,o=t.args;try{var s=function(e,t){k(e)?n(t):n(e,!0)};i.apply(r,o.concat(s)),s.cancel&&(n.cancel=s.cancel)}catch(e){n(e,!0)}},r[et]=function(e,t,n,r){var i=t.context,o=t.fn,s=t.args,a=t.detached,u=r.task,l=function(e){var t=e.context,n=e.fn,r=e.args;try{var i=n.apply(t,r);if(O(i))return i;var o=!1;return V(function(e){return o?{value:e,done:!0}:(o=!0,{value:i,done:!A(i)})})}catch(e){return V(function(){throw e})}}({context:i,fn:o,args:s}),c=l.isSagaIterator?{name:l.meta.name}:Q(o);ec(function(){var t=eM(e,l,u.context,ek,c,a,void 0);a?n(t):t.isRunning()?(u.queue.addTask(t),n(t)):t.isAborted()?u.queue.abort(t.error()):n(t)})},r.JOIN=function(e,t,n,r){var i=r.task,o=function(e,t){if(e.isRunning()){var n={task:i,cb:t};t.cancel=function(){e.isRunning()&&F(e.joiners,n)},e.joiners.push(n)}else e.isAborted()?t(e.error(),!0):t(e.result())};if(C(t)){if(0===t.length){n([]);return}var s=X(t,n);t.forEach(function(e,t){o(e,s[t])})}else o(t,n)},r.CANCEL=function(e,t,n,r){var i=r.task;t===y?eT(i):C(t)?t.forEach(eT):eT(t),n()},r.SELECT=function(e,t,n){var r=t.selector,i=t.args;try{var o=r.apply(void 0,[e.getState()].concat(i));n(o)}catch(e){n(e,!0)}},r.ACTION_CHANNEL=function(e,t,n){var r=t.pattern,i=eb(t.buffer),o=ey(r),s=function t(n){e_(n)||e.channel.take(t,o),i.put(n)},a=i.close;i.close=function(){s.cancel(),a()},e.channel.take(s,o),n(i)},r.CANCELLED=function(e,t,n,r){n(r.task.isCancelled())},r.FLUSH=function(e,t,n){t.flush(n)},r.GET_CONTEXT=function(e,t,n,r){n(r.task.context[t])},r.SET_CONTEXT=function(e,t,n,r){j(r.task.context,t),n()},r);function eC(e){var t=e.name,n=e.location;return n?t+"  "+n.fileName+"?"+n.lineNumber:t}var eA=null,eO=[],eN=function(e){e.crashedEffect=eA,eO.push(e)},eR=function(){eA=null,eO.length=0},eD=function(e){eA=e},eP=function(){var e,t,n=eO[0],r=eO.slice(1),i=n.crashedEffect?(e=n.crashedEffect[w])?e.code+"  "+e.fileName+"?"+e.lineNumber:"":null;return["The above error occurred in task "+eC(n.meta)+(i?" \n when executing effect "+i:"")].concat(r.map(function(e){return"    created by "+eC(e.meta)}),[(t=q(function(e){return e.cancelledTasks},eO)).length?["Tasks cancelled due to error:"].concat(t).join("\n"):""]).join("\n")};function eM(e,t,n,r,i,o,s){var a=e.finalizeRunEffect(function(t,n,r){A(t)?eE(t,r):O(t)?eM(e,t,l.context,n,i,!1,r):t&&t[f]?(0,ex[t.type])(e,t.payload,r,c):r(t)});d.cancel=L;var u={meta:i,cancel:function(){0===u.status&&(u.status=1,d(_))},status:0},l=function(e,t,n,r,i,o,s){void 0===s&&(s=L);var a,u,l,c=0,d=null,h=[],f=Object.create(n),p=function(e,t,n){var r,i=[],o=!1;function s(e){t(),u(),n(e,!0)}function a(t){i.push(t),t.cont=function(a,u){!o&&(F(i,t),t.cont=L,u?s(a):(t===e&&(r=a),i.length||(o=!0,n(r))))}}function u(){o||(o=!0,i.forEach(function(e){e.cont=L,e.cancel()}),i=[])}return a(e),{addTask:a,cancelAll:u,abort:s,getTasks:function(){return i}}}(t,function(){h.push.apply(h,p.getTasks().map(function(e){return e.meta.name}))},g);function g(t,n){if(n){if(c=2,eN({meta:i,cancelledTasks:h}),m.isRoot){var r=eP();eR(),e.onError(t,{sagaStack:r})}l=t,d&&d.reject(t)}else t===_?c=1:1!==c&&(c=3),u=t,d&&d.resolve(t);m.cont(t,n),m.joiners.forEach(function(e){e.cb(t,n)}),m.joiners=null}var m=((a={})[v]=!0,a.id=r,a.meta=i,a.isRoot=o,a.context=f,a.joiners=[],a.queue=p,a.cancel=function(){0===c&&(c=1,p.cancelAll(),g(_,!1))},a.cont=s,a.end=g,a.setContext=function(e){j(f,e)},a.toPromise=function(){return d||(d=es(),2===c?d.reject(l):0!==c&&d.resolve(u)),d.promise},a.isRunning=function(){return 0===c},a.isCancelled=function(){return 1===c||0===c&&1===t.status},a.isAborted=function(){return 2===c},a.result=function(){return u},a.error=function(){return l},a);return m}(e,u,n,r,i,o,s),c={task:l,digestEffect:h};return s&&(s.cancel=l.cancel),d(),l;function d(e,n){try{var i;n?(i=t.throw(e),eR()):K(e)?(u.status=1,d.cancel(),i=T(t.return)?t.return(_):{done:!0,value:_}):i=H(e)?T(t.return)?t.return():{done:!0}:t.next(e),i.done?(1!==u.status&&(u.status=3),u.cont(i.value)):h(i.value,r,d)}catch(e){if(1===u.status)throw e;u.status=2,u.cont(e,!0)}}function h(t,n,r,i){void 0===i&&(i="");var o,s=eI();function u(n,i){o||(o=!0,r.cancel=L,e.sagaMonitor&&(i?e.sagaMonitor.effectRejected(s,n):e.sagaMonitor.effectResolved(s,n)),i&&eD(t),r(n,i))}e.sagaMonitor&&e.sagaMonitor.effectTriggered({effectId:s,parentEffectId:n,label:i,effect:t}),u.cancel=L,r.cancel=function(){!o&&(o=!0,u.cancel(),u.cancel=L,e.sagaMonitor&&e.sagaMonitor.effectCancelled(s))},a(t,s,u)}}function eL(e,t){for(var n,r=e.channel,i=void 0===r?eS():r,o=e.dispatch,s=e.getState,a=e.context,u=void 0===a?{}:a,l=e.sagaMonitor,c=e.effectMiddlewares,d=e.onError,h=arguments.length,f=Array(h>2?h-2:0),p=2;p<h;p++)f[p-2]=arguments[p];var g=t.apply(void 0,f),y=eI();if(l&&(l.rootSagaStarted=l.rootSagaStarted||L,l.effectTriggered=l.effectTriggered||L,l.effectResolved=l.effectResolved||L,l.effectRejected=l.effectRejected||L,l.effectCancelled=l.effectCancelled||L,l.actionDispatched=l.actionDispatched||L,l.rootSagaStarted({effectId:y,saga:t,args:f})),c){var v=Z.apply(void 0,c);n=function(e){return function(t,n,r){return v(function(t){return e(t,n,r)})(t)}}}else n=U;var _={channel:i,dispatch:function(e){return o(Object.defineProperty(e,m,{value:!0}))},getState:s,sagaMonitor:l,onError:void 0===d?G:d,finalizeRunEffect:n};return ec(function(){var e=eM(_,g,u,y,Q(t),!0,void 0);return l&&l.effectResolved(y,e),e})}var eU=function(e){return{done:!0,value:e}},ej={};function eq(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o,s={done:!1,value:er(e)},a=function(e){return o=e};return function(e,t,n){var r,i,o,s="q1";function a(t,n){if(s===ej)return eU(t);if(n&&!i)throw s=ej,n;r&&r(t);var a=n?e[i](n):e[s]();return s=a.nextState,o=a.effect,r=a.stateUpdater,i=a.errorState,s===ej?eU(t):o}return V(a,function(e){return a(null,e)},n)}({q1:function(){return{nextState:"q2",effect:s,stateUpdater:a}},q2:function(){var e;return{nextState:"q1",effect:(e=o,{done:!1,value:eo.apply(void 0,[t].concat(r,[e]))})}}},0,"takeEvery("+(R(e)?"channel":D(e)?String(e):T(e)?e.name:String(e))+", "+t.name+")")}function eF(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return eo.apply(void 0,[eq,e,t].concat(r))}var e$=n(6713),eB=n(99846),ez=n(31514);let eV={errorMessage:"",requestStatus:"not-started",text:"",items:[]},eG="playground/testStream",eW=(e,t)=>{let{rootState:n,...r}=t,i=(0,ez.Fp)({...r});(0,eB.Kz)(e,i)},eH=(0,i.hg)(eG,async(e,t)=>{let{rejectWithValue:n}=t;return e}),eK=(0,i.oM)({name:"playground",initialState:eV,reducers:{setPlaygroundErrorMessage:(e,t)=>{e.errorMessage=t.payload},clearPlaygroundErrorMessage:e=>{e.errorMessage=""},updateDataFromStream:(e,t)=>{e.items.push(t.payload)},resetPlaygroundState:()=>eV},extraReducers:e=>{e.addCase(eH.pending,(e,t)=>{e.requestStatus="pending",eW((0,e$.xr)(eG),{actionArgs:t.meta.arg})}).addCase(eH.rejected,(e,t)=>{e.requestStatus="failed";let{error:n}=t.payload;e.errorMessage=n,eW((0,e$.Kq)(eG),{actionArgs:t.meta.arg,error:n})}).addCase(eH.fulfilled,(e,t)=>{e.requestStatus="successful",eW((0,e$.wV)(eG),{actionArgs:t.meta.arg,actionPayload:t.payload})}).addCase(eZ,(e,t)=>{e.text+=t.payload})}}),{setPlaygroundErrorMessage:eJ,clearPlaygroundErrorMessage:eX,resetPlaygroundState:eQ,updateDataFromStream:eZ}=eK.actions;var eY=eK.reducer,e0=n(25019);function*e1(e){try{let t=(e,t,n)=>(0,e0.sg)({input:e,onDataReceived:t,onError:n,endpoint:"test_stream"}),n=ew(n=>(t(e.payload,e=>{n(e)},e=>{console.error("Error while fetching streaming data:",e)}),()=>{}));for(;;){let e=yield er(n);yield ei(eZ(e))}}catch(e){console.error("Error while fetching streaming data:",e.message)}}var e2=n(99092),e3=n(49636);function*e4(e){yield ei((0,e2.dv)("pending"));try{let t=(t,n,r)=>(0,e0.UL)({input:t,onDataReceived:n,onError:r,endpoint:e.meta.arg.endpoint||"stream_text_modification",useEdgeProxy:!0}),n=ew(n=>(t(e.payload,e=>{n(e)},e=>{(0,eB.Pk)(e);let t={status:"failed",message:e3.dd,error:e3.dd,modifiedText:"",warning:""};n(t),n(ev)}),()=>{}));for(;;){let e=yield er(n);yield*function*(e){let{status:t,message:n,modifiedText:r,textStats:i,error:o,warning:s}=e;if(n&&(yield ei((0,e2.Xb)(n))),s&&(yield ei((0,e2.dJ)(s||""))),"pending"===t)yield ei((0,e2.d9)({markdown:r,text:r,html:""}));else if("successful"===t){if(yield ei((0,e2.dv)("successful")),yield ei((0,e2.lx)(!1)),yield ei((0,e2.d9)({markdown:r||"",text:r||"",html:""})),i){let{originalTextStats:e,modifiedTextStats:t}=i;yield ei((0,e2.Zr)(e)),yield ei((0,e2.kx)(t))}}else"failed"===t&&(yield ei((0,e2.dv)("failed")),yield ei((0,e2.lx)(!1)),yield ei((0,e2.jE)(o||e3.dd)))}(e)}}catch(e){(0,eB.Pk)(e,{function:"textModificationStreamGenerator"})}}var e5=n(62519),e6=n(40608),e9=n(75526),e8=n(50135),e7=n(97573);let te=Date.now(),tt=(e,t)=>{switch(t){case"standard":e.quizFocus="vocabulary";break;case"dialogue":e.targetLanguage="en",e.sourceType="text"}},tn=(e,t,n)=>{var r,i,o;switch(t){case"text":case"pre-written-sentences":e.sourceUrl="",e.sourceText=(null===(r=e8.VP[n])||void 0===r?void 0:r.exampleRandomSentences)||"";break;case"web-page":e.sourceText="",e.sourceUrl=(null===(i=e8.VP[n])||void 0===i?void 0:i.webPageUrl)||"";break;case"youtube":e.sourceText="",e.sourceUrl=(null===(o=e8.VP[n])||void 0===o?void 0:o.youtubeVideoUrl)||"";break;case"words":e.sourceText="",e.sourceUrl="",e.wordsInput=["recall","reimburse","recruit","unanimous","anonymous"]}},tr=(e,t)=>{let n=e.sourceType;"ja"!==t&&e9.ed.includes(e.quizFocus)&&(e.quizFocus=e9.zg),"custom-grammar-sentences"===e.sourceType&&"en"!==t&&(e.quizFocus=e9.zg,e.sourceType=e9.hj),"ja"===t&&"youtube"===n&&(e.sourceType=e9.hj,n=e9.hj),"en"===t&&"comprehension"===e.quizFocus&&"words"===e.sourceType&&(e.sourceType=e9.hj,n=e9.hj),tn(e,n,t)},ti=(e,t)=>{if("grammar_point"===t){e.sourceType="custom-grammar-sentences",e.grammarPoint="prepositions",e.contentTheme="the office";return}["web-page","text"].includes(e.sourceType)||(e.sourceType="text")},to=(e,t)=>{let n=e.primaryOption;if(e9.mI.includes(t)){e.targetLanguage=t,e.quizFocus="vocabulary",tr(e,n);return}"topic-comprehension"===n&&(e.targetLanguage="en",e.quizFocus="comprehension",e.sourceType="text",e.questionCount=3,e.sourceText=e8.Ix)},ts=(e,t)=>{Object.keys(t).forEach(n=>{t[n]&&(e[n]=t[n])}),"comprehension"===t.quizFocus?e.primaryOption="topic-comprehension":e.primaryOption=t.targetLanguage},ta={id:"",grammarPoint:"",contentTheme:"",targetLanguage:"en",userLanguage:"en",sourceType:"youtube",title:"",description:"",sourceUrl:e8.Rv,questions:[],answers:[],tentativeAnswers:[],errorMessage:"",difficulty:"",requestStatus:"not-started",userId:e6.xh,sourceText:"",wordsInput:[],currentQuestionIndex:0,isStarted:!1,isFinished:!1,timerEnabled:!0,timerStatus:"stopped",currentTime:te,timerDuration:e9.WS,timerExpireTime:null,timerStartedTime:null,timerStoppedTime:null,quizFocus:"vocabulary",questionCount:e9.zh,format:"standard",youtubeVideoId:"",authorId:"",isSavedQuiz:!1,view:"quiz-generator",primaryOption:"en",quickAnswerMode:!1,score:0,initialized:!1,sessionName:"",shouldTrackSessions:!1},tu=(0,i.oM)({name:"quiz",initialState:ta,reducers:{setSessionName:(e,t)=>{e.sessionName=t.payload},setShouldTrackSessions:(e,t)=>{e.shouldTrackSessions=t.payload},setSourceText:(e,t)=>{e.sourceText=t.payload},clearSourceText:(e,t)=>{e.sourceText=""},setSourceUrl:(e,t)=>{e.sourceUrl=t.payload},clearSourceUrl:e=>{e.sourceUrl=""},setSourceType:(e,t)=>{let n=t.payload,{targetLanguage:r}=e;e.sourceType=n,tn(e,n,r)},setVocabularyWords:(e,t)=>{e.wordsInput=t.payload},clearVocabularyWords:e=>{e.wordsInput=[]},setTargetLanguage:(e,t)=>{let n=t.payload;e.targetLanguage=n,tr(e,n)},setErrorMessage:(e,t)=>{e.errorMessage=t.payload},clearErrorMessage:e=>{e.errorMessage=""},startQuiz:e=>{e.isStarted=!0},addAnswer:(e,t)=>{e.answers=(0,e7.gh)(e.answers,t.payload)},setAnswers:(e,t)=>{e.answers=t.payload},setIsTimerEnabledInQuizCreation:(e,t)=>{e.timerEnabled=t.payload},clearAnswers:e=>{e.answers=[]},addTentativeAnswer:(e,t)=>{e.tentativeAnswers=(0,e7.gh)(e.tentativeAnswers,t.payload)},setTentativeAnswers:(e,t)=>{e.tentativeAnswers=t.payload},clearTentativeAnswers:e=>{e.tentativeAnswers=[]},setCurrentQuestionIndex:(e,t)=>{e.currentQuestionIndex=t.payload},goToNextQuestion:e=>{let t=e.questions.length-1;e.currentQuestionIndex!==t&&(e.currentQuestionIndex=e.currentQuestionIndex+1)},goToPreviousQuestion:e=>{let t=e.questions.length-1,n=0===e.currentQuestionIndex?t:e.currentQuestionIndex-1;e.currentQuestionIndex=n},resetQuiz:e=>{e.currentQuestionIndex=0,e.answers=[],e.tentativeAnswers=[],e.isStarted=!1,e.isFinished=!1},finishQuiz:e=>{e.isFinished=!0},setUserId:(e,t)=>{e.userId=t.payload},tickTimer:e=>{let t=Date.now();e.currentTime=t},setTimerStatus:(e,t)=>{e.timerStatus=t.payload},setTimerDuration:(e,t)=>{e.timerDuration=t.payload},setQuizView:(e,t)=>{e.view=t.payload},setIsQuizPageInitialized:(e,t)=>{e.initialized=t.payload},clearTimer:e=>{e.timerStatus="stopped";let t=Date.now();e.timerStatus="running",e.currentTime=t,e.timerExpireTime=null,e.timerStartedTime=null,e.timerStoppedTime=null},stopTimer:e=>{e.timerStatus="stopped"},startTimer:e=>{let t=Date.now();e.timerStatus="running";let n=1e3*(e.timerDuration||e9.WS);e.currentTime=t,e.timerExpireTime=t+n,e.timerStartedTime=null,e.timerStoppedTime=null},setQuizFocus:(e,t)=>{e.quizFocus=t.payload,ti(e,t.payload)},setGrammarPoint:(e,t)=>{e.grammarPoint=t.payload},setContentTheme:(e,t)=>{e.contentTheme=t.payload},setQuizFormat:(e,t)=>{let n=t.payload;e.format=n,tt(e,n)},setQuestionCount:(e,t)=>{e.questionCount=t.payload},updateQuizOptions:(e,t)=>{ts(e,t.payload)},addToScore:(e,t)=>{e.score+=t.payload},setQuizPrimaryOption:(e,t)=>{e.primaryOption=t.payload,to(e,t.payload)},toggleQuizAnswerMode:(e,t)=>{e.quickAnswerMode=t.payload},resetQuizBuilder:(e,t)=>{let n=t.payload;return{...ta,...n,primaryOption:"comprehension"===n.quizFocus?"topic-comprehension":n.targetLanguage||ta.primaryOption}}}}),{setSourceText:tl,setSourceUrl:tc,clearSourceUrl:td,setSourceType:th,clearSourceText:tf,setErrorMessage:tp,clearErrorMessage:tg,setVocabularyWords:tm,clearVocabularyWords:ty,setTargetLanguage:tv,startQuiz:t_,setAnswers:tb,addAnswer:tw,clearAnswers:tS,setTentativeAnswers:tE,addTentativeAnswer:tk,clearTentativeAnswers:tI,setCurrentQuestionIndex:tT,goToNextQuestion:tx,goToPreviousQuestion:tC,resetQuiz:tA,finishQuiz:tO,setUserId:tN,setTimerStatus:tR,startTimer:tD,stopTimer:tP,tickTimer:tM,clearTimer:tL,resetQuizBuilder:tU,setQuizFocus:tj,setQuestionCount:tq,setQuizFormat:tF,setQuizView:t$,setQuizPrimaryOption:tB,setGrammarPoint:tz,setContentTheme:tV,updateQuizOptions:tG,addToScore:tW,toggleQuizAnswerMode:tH,setIsQuizPageInitialized:tK,setIsTimerEnabledInQuizCreation:tJ,setTimerDuration:tX,setSessionName:tQ,setShouldTrackSessions:tZ}=tu.actions;var tY=tu.reducer,t0=n(60943),t1=n(83640);let t2=[{id:"Plants and animals have observable features",similarity:0,description:"Plants and animals have observable features",sampleQuestions:["How do the different features of plants and animals help them meet their basic needs? What basic needs do plants and animals have in common? What are your basic needs?"],courseId:"Science K",courseName:"Science K",courseUrl:"https://curriculum.gov.bc.ca/curriculum/science/k/core",courseGradeLevel:"K",courseSubject:"Science"},{id:"Humans interact with matter every day through familiar materials",similarity:0,description:"Humans interact with matter every day through familiar materials",sampleQuestions:["What is matter? How do you interact with matter? What qualities do different forms of matter have?"],courseId:"Science K",courseName:"Science K",courseUrl:"https://curriculum.gov.bc.ca/curriculum/science/k/core",courseGradeLevel:"K",courseSubject:"Science"},{id:"The motion of objects depends on their properties",similarity:0,description:"The motion of objects depends on their properties",sampleQuestions:["How can you make objects move? How does the shape or size of an object affect the object's movement? How does the material the object is made of affect the object's movement?"],courseId:"Science K",courseName:"Science K",courseUrl:"https://curriculum.gov.bc.ca/curriculum/science/k/core",courseGradeLevel:"K",courseSubject:"Science"},{id:"Daily and seasonal changes affect all living things",similarity:0,description:"Daily and seasonal changes affect all living things",sampleQuestions:["What daily and seasonal changes can you see or feel? How are plants and animals affected by daily and seasonal changes?"],courseId:"Science K",courseName:"Science K",courseUrl:"https://curriculum.gov.bc.ca/curriculum/science/k/core",courseGradeLevel:"K",courseSubject:"Science"},{id:"Living things have features and behaviours that help them survive in their environment",similarity:0,description:"Living things have features and behaviours that help them survive in their environment",sampleQuestions:["How do local plants and animals depend on their environment? How do plants and animals use their features to respond to stimuli in their environments? How do plants and animals adapt when their basic needs are not being met?"],courseId:"Science 1",courseName:"Science 1",courseUrl:"https://curriculum.gov.bc.ca/curriculum/science/1/core",courseGradeLevel:"1",courseSubject:"Science"},{id:"Matter is useful because of its properties",similarity:0,description:"Matter is useful because of its properties",sampleQuestions:["What makes the properties of matter useful? How do the properties of materials help connect to the function of materials?"],courseId:"Science 1",courseName:"Science 1",courseUrl:"https://curriculum.gov.bc.ca/curriculum/science/1/core",courseGradeLevel:"1",courseSubject:"Science"},{id:"Light and sound can be produced and their properties can be changed",similarity:0,description:"Light and sound can be produced and their properties can be changed",sampleQuestions:["How can you explore the properties of light and sound? What discoveries did you make?"],courseId:"Science 1",courseName:"Science 1",courseUrl:"https://curriculum.gov.bc.ca/curriculum/science/1/core",courseGradeLevel:"1",courseSubject:"Science"},{id:"Observable patterns and cycles occur in the local sky and landscape",similarity:0,description:"Observable patterns and cycles occur in the local sky and landscape",sampleQuestions:["What kinds of patterns in the sky and landscape are you aware of? How do patterns and cycles in the sky and landscape affect living things?"],courseId:"Science 1",courseName:"Science 1",courseUrl:"https://curriculum.gov.bc.ca/curriculum/science/1/core",courseGradeLevel:"1",courseSubject:"Science"},{id:"Living things have life cycles adapted to their environment",similarity:0,description:"Living things have life cycles adapted to their environment",sampleQuestions:["Why are life cycles important? How are the life cycles of local plants and animals similar and different? How do offspring compare to their parents?"],courseId:"Science 2",courseName:"Science 2",courseUrl:"https://curriculum.gov.bc.ca/curriculum/science/2/core",courseGradeLevel:"2",courseSubject:"Science"},{id:"Materials can be changed through physical and chemical processes",similarity:0,description:"Materials can be changed through physical and chemical processes",sampleQuestions:["Why would we want to change the physical properties of an object? What are some natural processes that involve chemical and physical changes?"],courseId:"Science 2",courseName:"Science 2",courseUrl:"https://curriculum.gov.bc.ca/curriculum/science/2/core",courseGradeLevel:"2",courseSubject:"Science"},{id:"Local actions have global consequences, and global actions have local consequences.",similarity:0,description:"Local actions have global consequences, and global actions have local consequences.",sampleQuestions:[""],courseId:"Social Studies 2 - Regional and Global Communities",courseName:"Social Studies 2 - Regional and Global Communities",courseUrl:"https://curriculum.gov.bc.ca/curriculum/social-studies/2/core",courseGradeLevel:"2",courseSubject:"Social Studies"},{id:"Individuals have rights and responsibilities as global citizens.",similarity:0,description:"Individuals have rights and responsibilities as global citizens.",sampleQuestions:[""],courseId:"Social Studies 2 - Regional and Global Communities",courseName:"Social Studies 2 - Regional and Global Communities",courseUrl:"https://curriculum.gov.bc.ca/curriculum/social-studies/2/core",courseGradeLevel:"2",courseSubject:"Social Studies"},{id:"The physical environment influences the nature of political, social, and economic change.",similarity:0,description:"The physical environment influences the nature of political, social, and economic change.",sampleQuestions:[""],courseId:"Social Studies 9",courseName:"Social Studies 9",courseUrl:"https://curriculum.gov.bc.ca/curriculum/social-studies/9/core",courseGradeLevel:"9",courseSubject:"Social Studies"},{id:"Rapid industrialization, urbanization, and economic growth in Asia in the late 20th century have created complex social, political, and environmental challenges (adapted from Asian Studies 12 2013 1850-present).",similarity:0,description:"Rapid industrialization, urbanization, and economic growth in Asia in the late 20th century have created complex social, political, and environmental challenges (adapted from Asian Studies 12 2013 1850-present).",sampleQuestions:[""],courseId:"Explorations in Social Studies 11",courseName:"Explorations in Social Studies 11",courseUrl:"https://curriculum.gov.bc.ca/curriculum/social-studies/11/explorations-in-social-studies",courseGradeLevel:"11",courseSubject:"Social Studies"},{id:"Decision making in urban and regional planning requires balancing political, economic, social, and environmental factors (from Urban Studies 12).",similarity:0,description:"Decision making in urban and regional planning requires balancing political, economic, social, and environmental factors (from Urban Studies 12).",sampleQuestions:[""],courseId:"Explorations in Social Studies 11",courseName:"Explorations in Social Studies 11",courseUrl:"https://curriculum.gov.bc.ca/curriculum/social-studies/11/explorations-in-social-studies",courseGradeLevel:"11",courseSubject:"Social Studies"}],t3=["Local actions have global consequences, and global actions have local consequences.","Rapid industrialization, urbanization, and economic growth in Asia in the late 20th century have created complex social, political, and environmental challenges (adapted from Asian Studies 12 2013 1850-present).","Individuals have rights and responsibilities as global citizens.","Decision making in urban and regional planning requires balancing political, economic, social, and environmental factors (from Urban Studies 12).","The physical environment influences the nature of political, social, and economic change."].map((e,t)=>({id:e,similarity:.6+.05*t})),t4=async e=>{try{let t=await fetch("".concat(e3.LB,"/get_idea_suggestions"),{body:JSON.stringify(e),credentials:"include",headers:{"Content-Type":"application/json"},method:"POST"});return await t.json()}catch(e){return console.error("Failed to generate activity",e),{error:"Something went wrong",suggestions:[]}}},t5=async()=>(await (0,ez.Dc)(e3.uR),{error:"",suggestions:t3}),t6=async e=>t1.xR?t5():await t4(e),t9=async()=>{try{let e=await fetch("".concat(e3.LB,"/get_all_ideas"),{credentials:"include",headers:{"Content-Type":"application/json"},method:"GET"});return await e.json()}catch(e){return console.error("Failed to generate activity",e),{error:"Something went wrong",ideas:[]}}},t8=async()=>(await (0,ez.Dc)(e3.uR),{error:"",ideas:t2}),t7=async()=>t1.xR?t8():await t9(),ne=(e,t)=>{let n={...e.appliedIdeaIdsMap};t.forEach(e=>{n[e]=!0}),e.appliedIdeaIdsMap=n},nt=(e,t)=>{let n={};Object.keys(e.appliedIdeaIdsMap).forEach(e=>{t.includes(e)||(n[e]=!0)}),e.appliedIdeaIdsMap=n},nn=e=>{let t={};return e.forEach(e=>{t[e.id]=e.similarity}),t},nr=e=>e.sort((e,t)=>t.similarity-e.similarity);var ni=n(19119),no=n(71842);let ns=e=>(0,ez.Fp)({userId:(0,no.c7)(e),userType:(0,no.W$)(e)});(0,ni.P1)(e=>e.courseLinks.errorMessage,e=>!!e),(0,ni.P1)(e=>e.courseLinks.requestStatus,e=>"pending"===e);let na=e=>e.courseLinks.ideas;(0,ni.P1)(na,e=>e.courseLinks.suggestedIdeasMap,(e,t)=>nr(e.filter(e=>t[e.id]))),(0,ni.P1)(na,e=>e.courseLinks.appliedIdeaIdsMap,(e,t)=>e.filter(e=>t[e.id])),(0,ni.P1)(no.c7,no.W$,e=>e.courseLinks.text,(e,t,n)=>({userId:e,userType:t,text:n}));let nu={ideasTab:"all",errorMessage:"",requestStatus:"not-started",text:"",ideas:[],suggestedIdeasMap:{},appliedIdeaIdsMap:{}},nl=(e,t)=>{let{rootState:n,...r}=t,i=(0,ez.Fp)({...r,...n?ns(n):{}});(0,eB.Kz)(e,i)},nc="courseLinks/getIdeaSuggestions",nd=(0,i.hg)(nc,async(e,t)=>{var n;let{rejectWithValue:r,getState:i}=t,o=await t6(e),s=i();return(null==o?void 0:null===(n=o.suggestions)||void 0===n?void 0:n.length)?{...o,rootState:s}:r({...o,rootState:s})}),nh="courseLinks/getAllIdeas",nf=(0,i.hg)(nh,async(e,t)=>{var n;let{rejectWithValue:r,getState:i}=t,o=await t7(),s=i();return(null==o?void 0:null===(n=o.ideas)||void 0===n?void 0:n.length)?{...o,rootState:s}:r({...o,rootState:s})}),np=(0,i.oM)({name:"courseLinks",initialState:nu,reducers:{setCourseLinksErrorMessage:(e,t)=>{e.errorMessage=t.payload},clearCourseLinksErrorMessage:e=>{e.errorMessage=""},setCourseLinksText:(e,t)=>{e.text=t.payload},setCourseLinksIdeasTab:(e,t)=>{e.ideasTab=t.payload},clearCourseLinksText:e=>{e.text=""},applyIdeas:(e,t)=>{ne(e,t.payload)},unapplyIdeas:(e,t)=>{nt(e,t.payload)},clearSuggestedIdeas:e=>{e.suggestedIdeasMap={}},resetCourseLinksState:()=>nu},extraReducers:e=>{e.addCase(nf.pending,(e,t)=>{e.requestStatus="pending",nl((0,e$.xr)(nh),{actionArgs:t.meta.arg})}).addCase(nf.rejected,(e,t)=>{e.requestStatus="failed",nl((0,e$.Kq)(nh),{actionArgs:t.meta.arg})}).addCase(nf.fulfilled,(e,t)=>{e.requestStatus="successful";let{ideas:n}=t.payload;e.ideas=n,nl((0,e$.wV)(nh),{actionArgs:t.meta.arg,actionPayload:t.payload})}).addCase(nd.pending,(e,t)=>{e.requestStatus="pending",nl((0,e$.xr)(nc),{actionArgs:t.meta.arg})}).addCase(nd.rejected,(e,t)=>{e.requestStatus="failed",nl((0,e$.Kq)(nc),{actionArgs:t.meta.arg})}).addCase(nd.fulfilled,(e,t)=>{e.requestStatus="successful";let{suggestions:n}=t.payload;e.suggestedIdeasMap=nn(n),e.ideasTab="suggested",nl((0,e$.wV)(nc),{actionArgs:t.meta.arg,actionPayload:t.payload})})}}),{setCourseLinksErrorMessage:ng,clearCourseLinksErrorMessage:nm,resetCourseLinksState:ny,setCourseLinksText:nv,clearCourseLinksText:n_,setCourseLinksIdeasTab:nb,applyIdeas:nw,unapplyIdeas:nS,clearSuggestedIdeas:nE}=np.actions;var nk=np.reducer,nI=n(15661),nT=n(13247);let nx=e=>{let{id:t,userId:n,createdAt:r,name:i,...o}=e;return{id:t,userId:n,createdAt:new Date(r.toDate()).toDateString(),name:i,params:JSON.stringify(o,null,2)}},nC=async e=>{try{if(!nI.mz)return[];let t=(0,nT.IO)((0,nT.hJ)(nI.mz,"events"),(0,nT.ar)("userId","==",e)),n=await (0,nT.PL)(t),r=[];return n.forEach(e=>{r.push({...nx(e.data()),id:e.id})}),r}catch(e){return console.error("Failed to fetch events",e),[]}},nA={errorMessage:"",requestStatus:"not-started",events:[],text:""},nO=(0,i.hg)("Admin/getUserEvents",async(e,t)=>{let{rejectWithValue:n}=t;return await nC(e)||n([])}),nN=(0,i.oM)({name:"Admin",initialState:nA,reducers:{setAdminErrorMessage:(e,t)=>{e.errorMessage=t.payload},clearAdminErrorMessage:e=>{e.errorMessage=""},resetAdminState:()=>nA},extraReducers:e=>{e.addCase(nO.pending,(e,t)=>{e.requestStatus="pending"}).addCase(nO.rejected,(e,t)=>{e.requestStatus="failed"}).addCase(nO.fulfilled,(e,t)=>{e.events=t.payload,e.requestStatus="successful"})}}),{setAdminErrorMessage:nR,clearAdminErrorMessage:nD,resetAdminState:nP}=nN.actions;var nM=nN.reducer;let nL={audioSpeed:1,audioPlayingId:""};(0,i.hg)("lesson/doSomething",async(e,t)=>{let{rejectWithValue:n}=t,r=await null;return r||n(r)});let nU=(0,i.oM)({name:"lesson",initialState:nL,reducers:{setAudioSpeed:(e,t)=>{e.audioSpeed=t.payload},setAudioPlayingId:(e,t)=>{e.audioPlayingId=t.payload},clearAudioPlayingId:e=>{e.audioPlayingId=""},resetLessonState:()=>nL},extraReducers:e=>{}}),{setAudioSpeed:nj,resetLessonState:nq,setAudioPlayingId:nF,clearAudioPlayingId:n$}=nU.actions;var nB=nU.reducer;let nz={errorMessage:"",requestStatus:"not-started",name:"",email:"",topic:"",step:"start",isPromoAllowed:!1},nV=(0,i.oM)({name:"contest",initialState:nz,reducers:{setContestErrorMessage:(e,t)=>{e.errorMessage=t.payload},clearContestErrorMessage:e=>{e.errorMessage=""},setContestName:(e,t)=>{e.name=t.payload},setContestEmail:(e,t)=>{e.email=t.payload},setContestTopic:(e,t)=>{e.topic=t.payload},setIsContestPromoAllowed:(e,t)=>{e.isPromoAllowed=t.payload},setContestInputStep:(e,t)=>{e.step=t.payload},resetContestState:()=>nz},extraReducers:e=>{}}),{setContestErrorMessage:nG,clearContestErrorMessage:nW,resetContestState:nH,setContestEmail:nK,setContestName:nJ,setContestTopic:nX,setContestInputStep:nQ,setIsContestPromoAllowed:nZ}=nV.actions;var nY=nV.reducer;let n0={errorMessage:"",requestStatus:"not-started",text:""},n1=(0,i.hg)("empty/doSomething",async(e,t)=>{let{rejectWithValue:n}=t,r=await null;return r||n(r)}),n2=(0,i.oM)({name:"assessmentTemplates",initialState:n0,reducers:{setEmptyErrorMessage:(e,t)=>{e.errorMessage=t.payload},clearEmptyErrorMessage:e=>{e.errorMessage=""},resetEmptyState:()=>n0},extraReducers:e=>{e.addCase(n1.pending,(e,t)=>{e.requestStatus="pending"}).addCase(n1.rejected,(e,t)=>{e.requestStatus="failed";let{error:n}=t.payload;e.errorMessage=n}).addCase(n1.fulfilled,(e,t)=>{e.requestStatus="successful"})}}),{setEmptyErrorMessage:n3,clearEmptyErrorMessage:n4,resetEmptyState:n5}=n2.actions;var n6=n2.reducer,n9=n(13041);let n8=(0,i.e)(),n7=(e,t)=>{let n=(0,n9.WTS)(e)||[],r=(0,n9.WTS)(t)||[];if(r.length<=n.length||0===n.length)return"";let i=r.map(e=>e.id),o=n.map(e=>e.id);return i.filter(e=>!o.includes(e))[0]},re=e=>{let{prev:t,next:n,type:r}=e;switch(r){case"dialogue":return n.lines.length>t.lines.length;case"quiz":return n.questions.length>t.questions.length;case"vocabulary":return n.vocabularyItems.length>t.vocabularyItems.length;case"slide":return!!n.sourceUrl&&!t.sourceUrl;default:return!1}},rt=(e,t)=>{let n=(0,n9.WTS)(e),r=(0,n9.WTS)(t),i=[];if(r.forEach(e=>{let t=n.find(t=>t.id===e.id);t&&i.push({id:e.id,prev:t,next:e,type:e.type})}),0===i.length)return"";let o=i.filter(re);return 0===o.length?"":o[o.length-1].id},rn=(e,t)=>{if(e.lessonEditor.elementToScrollIntoViewId)return"";let n=n7(e,t);return n?n:rt(e,t)||""};n8.startListening({predicate:(e,t,n)=>{try{return!!rn(n,t)}catch(e){return!1}},effect:async(e,t)=>{try{let{dispatch:e,getState:n,getOriginalState:r}=t,i=rn(r(),n());i&&e((0,e2.bQ)(i))}catch(e){console.error("Error in lessonEditorListenerMiddleware",e)}}});let rr=function(e){var t,n=void 0===e?{}:e,r=n.context,i=void 0===r?{}:r,o=n.channel,s=void 0===o?eS():o,a=n.sagaMonitor,u=(0,E.Z)(n,["context","channel","sagaMonitor"]);function l(e){var n=e.getState,r=e.dispatch;return t=eL.bind(null,(0,S.Z)({},u,{context:i,channel:s,dispatch:r,getState:n,sagaMonitor:a})),function(e){return function(t){a&&a.actionDispatched&&a.actionDispatched(t);var n=e(t);return s.put(t),n}}}return l.run=function(){return t.apply(void 0,arguments)},l.setContext=function(e){j(i,e)},l}(),ri=function(e){let t={...l,...e};return e=>(n,r)=>(t.attachReduxState&&(0,s.lW)().addEventProcessor((e,t)=>{try{void 0===e.type&&"redux"===e.contexts.state.state.type&&(t.attachments=[...t.attachments||[],{filename:"redux_state.json",data:JSON.stringify(e.contexts.state.state.value)}])}catch(e){}return e}),e((e,r)=>{let i=n(e,r),o=(0,s.nZ)(),l=t.actionTransformer(r);null!=l&&(0,a.n)({category:"redux.action",data:l,type:"info"});let c=t.stateTransformer(i);if(null!=c){let e=(0,s.s3)(),t=e&&e.getOptions(),n=t&&t.normalizeDepth||3,r={state:{type:"redux",value:c}};(0,u.xp)(r,"__sentry_override_normalization_depth__",3+n),o.setContext("state",r)}else o.setContext("state",null);let{configureScopeWithState:d}=t;return"function"==typeof d&&d(o,i),i},r))}({});(0,ni.dX)({identityFunctionCheck:"never"});let ro=(0,i.xC)({reducer:{auth:e5.ZP,lessonEditor:e2.ZP,explore:t0.ZP,courseLinks:nk,admin:nM,lesson:nB,playground:eY,quiz:tY,contest:nY,assessmentTemplates:n6},devTools:e3.TQ,middleware:e=>e().prepend(n8.middleware,rr),enhancers:e=>e().concat(ri)}),rs=()=>(0,o.I0)(),ra=o.v9;rr.run(function*(){yield eF(eH.fulfilled,e1)}),rr.run(function*(){yield eF(e2.Rq.fulfilled,e4),yield eF(e2.Fe.fulfilled,e4),yield eF(e2.Rs.fulfilled,e4)})},60:function(){},78715:function(){},86721:function(){},77663:function(e){!function(){var t={229:function(e){var t,n,r,i=e.exports={};function o(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var u=[],l=!1,c=-1;function d(){l&&r&&(l=!1,r.length?u=r.concat(u):c=-1,u.length&&h())}function h(){if(!l){var e=a(d);l=!0;for(var t=u.length;t;){for(r=u,u=[];++c<t;)r&&r[c].run();c=-1,t=u.length}r=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new f(e,t)),1!==u.length||l||a(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var o=n[e]={exports:{}},s=!0;try{t[e](o,o.exports,r),s=!1}finally{s&&delete n[e]}return o.exports}r.ab="//";var i=r(229);e.exports=i}()},9008:function(e,t,n){e.exports=n(97484)},11163:function(e,t,n){e.exports=n(53719)},4298:function(e,t,n){e.exports=n(83145)},53771:function(e,t,n){"use strict";/**
 * @license React
 * use-sync-external-store-with-selector.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 r=n(67294),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useSyncExternalStore,s=r.useRef,a=r.useEffect,u=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,c){var d=s(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;var f=o(e,(d=u(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),void 0!==c&&h.hasValue){var t=h.value;if(c(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return void 0!==c&&c(t,n)?t:(o=e,s=n)}var o,s,a=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,n,r,c]))[0],d[1]);return a(function(){h.hasValue=!0,h.value=f},[f]),l(f),f}},31103:function(e,t,n){"use strict";e.exports=n(53771)},36850:function(e){e.exports=(()=>{"use strict";var e={314:(e,t,n)=>{n.r(t),n.d(t,{default:()=>u,wordsCount:()=>s,wordsSplit:()=>a,wordsDetect:()=>o});var r=[",","，",".","。",":","：",";","；","[","]","【","]","】","{","｛","}","｝","(","（",")","）","<","《",">","》","$","￥","!","！","?","？","~","～","'","’",'"',"“","”","*","/","\\","&","%","@","#","^","、","、","、","、"],i={words:[],count:0},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return i;var n=String(e);if(""===n.trim())return i;var o=t.punctuationAsBreaker?" ":"",s=t.disableDefaultPunctuation?[]:r,a=t.punctuation||[];s.concat(a).forEach(function(e){var t=RegExp("\\"+e,"g");n=n.replace(t,o)}),n=(n=(n=(n=n.replace(/[\uFF00-\uFFEF\u2000-\u206F]/g,"")).replace(/\s+/," ")).split(" ")).filter(function(e){return e.trim()});var u=RegExp("(\\d+)|[a-zA-Z\xc0-\xffĀ-ſƀ-ɏɐ-ʯḀ-ỿЀ-ӿԀ-ԯഀ-ൿ]+|[⺀-⻿⼀-⿟　-〿㇀-㇯㈀-㋿㌀-㏿㐀-㿿䀀-䶿一-俿倀-忿怀-濿瀀-翿耀-迿退-鿿豈-﫿぀-ゟ゠-ヿㇰ-ㇿ㆐-㆟ᄀ-ᇿ㄰-㆏ꥠ-꥿가-꿿뀀-뿿쀀-쿿퀀-힯ힰ-퟿]","g"),l=[];return n.forEach(function(e){var t,n=[];do(t=u.exec(e))&&n.push(t[0]);while(t);0===n.length?l.push(e):l=l.concat(n)}),{words:l,count:l.length}},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o(e,t).count},a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o(e,t).words};let u=s}},t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}return n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(314)})()},87462:function(e,t,n){"use strict";function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,{Z:function(){return r}})},63366:function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}n.d(t,{Z:function(){return r}})},32238:function(e,t,n){"use strict";n.d(t,{Jn:function(){return _},KN:function(){return S},Mq:function(){return w},Xd:function(){return g},ZF:function(){return b},qX:function(){return m}});var r=n(8463),i=n(53333),o=n(74444),s=n(26531);/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class a{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(!function(e){let t=e.getComponent();return(null==t?void 0:t.type)==="VERSION"}(e))return null;{let t=e.getImmediate();return`${t.library}/${t.version}`}}).filter(e=>e).join(" ")}}let u="@firebase/app",l="0.9.7",c=new i.Yd("@firebase/app"),d="[DEFAULT]",h={[u]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","fire-js":"fire-js",firebase:"fire-js-all"},f=new Map,p=new Map;function g(e){let t=e.name;if(p.has(t))return c.debug(`There were multiple attempts to register component ${t}.`),!1;for(let n of(p.set(t,e),f.values()))!function(e,t){try{e.container.addComponent(t)}catch(n){c.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}(n,e);return!0}function m(e,t){let n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}let y=new o.LL("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."});/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class v{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new r.wA("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw y.create("app-deleted",{appName:this._name})}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let _="9.19.1";function b(e,t={}){let n=e;"object"!=typeof t&&(t={name:t});let i=Object.assign({name:d,automaticDataCollectionEnabled:!1},t),s=i.name;if("string"!=typeof s||!s)throw y.create("bad-app-name",{appName:String(s)});if(n||(n=(0,o.aH)()),!n)throw y.create("no-options");let a=f.get(s);if(a){if((0,o.vZ)(n,a.options)&&(0,o.vZ)(i,a.config))return a;throw y.create("duplicate-app",{appName:s})}let u=new r.H0(s);for(let e of p.values())u.addComponent(e);let l=new v(n,i,u);return f.set(s,l),l}function w(e=d){let t=f.get(e);if(!t&&e===d)return b();if(!t)throw y.create("no-app",{appName:e});return t}function S(e,t,n){var i;let o=null!==(i=h[e])&&void 0!==i?i:e;n&&(o+=`-${n}`);let s=o.match(/\s|\//),a=t.match(/\s|\//);if(s||a){let e=[`Unable to register library "${o}" with version "${t}":`];s&&e.push(`library name "${o}" contains illegal characters (whitespace or "/")`),s&&a&&e.push("and"),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),c.warn(e.join(" "));return}g(new r.wA(`${o}-version`,()=>({library:o,version:t}),"VERSION"))}let E="firebase-heartbeat-store",k=null;function I(){return k||(k=(0,s.X3)("firebase-heartbeat-database",1,{upgrade:(e,t)=>{0===t&&e.createObjectStore(E)}}).catch(e=>{throw y.create("idb-open",{originalErrorMessage:e.message})})),k}async function T(e){try{return(await I()).transaction(E).objectStore(E).get(C(e))}catch(e){if(e instanceof o.ZR)c.warn(e.message);else{let t=y.create("idb-get",{originalErrorMessage:null==e?void 0:e.message});c.warn(t.message)}}}async function x(e,t){try{let n=(await I()).transaction(E,"readwrite"),r=n.objectStore(E);return await r.put(t,C(e)),n.done}catch(e){if(e instanceof o.ZR)c.warn(e.message);else{let t=y.create("idb-set",{originalErrorMessage:null==e?void 0:e.message});c.warn(t.message)}}}function C(e){return`${e.name}!${e.options.appId}`}class A{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider("app").getImmediate();this._storage=new N(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){let e=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),t=O();return(null===this._heartbeatsCache&&(this._heartbeatsCache=await this._heartbeatsCachePromise),this._heartbeatsCache.lastSentHeartbeatDate===t||this._heartbeatsCache.heartbeats.some(e=>e.date===t))?void 0:(this._heartbeatsCache.heartbeats.push({date:t,agent:e}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(e=>{let t=new Date(e.date).valueOf();return Date.now()-t<=2592e6}),this._storage.overwrite(this._heartbeatsCache))}async getHeartbeatsHeader(){if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null===this._heartbeatsCache||0===this._heartbeatsCache.heartbeats.length)return"";let e=O(),{heartbeatsToSend:t,unsentEntries:n}=function(e,t=1024){let n=[],r=e.slice();for(let i of e){let e=n.find(e=>e.agent===i.agent);if(e){if(e.dates.push(i.date),R(n)>t){e.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),R(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}(this._heartbeatsCache.heartbeats),r=(0,o.L)(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),r}}function O(){return new Date().toISOString().substring(0,10)}class N{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!(0,o.hl)()&&(0,o.eu)().then(()=>!0).catch(()=>!1)}async read(){return await this._canUseIndexedDBPromise&&await T(this.app)||{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){let n=await this.read();return x(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){let n=await this.read();return x(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}}}function R(e){return(0,o.L)(JSON.stringify({version:2,heartbeats:e})).length}g(new r.wA("platform-logger",e=>new a(e),"PRIVATE")),g(new r.wA("heartbeat",e=>new A(e),"PRIVATE")),S(u,l,""),S(u,l,"esm2017"),S("fire-js","")},8463:function(e,t,n){"use strict";n.d(t,{H0:function(){return a},wA:function(){return i}});var r=n(74444);class i{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let o="[DEFAULT]";/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class s{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let e=new r.BH;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{let n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;let n=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),r=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(e){if(r)return null;throw e}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if("EAGER"===e.instantiationMode)try{this.getOrInitializeService({instanceIdentifier:o})}catch(e){}for(let[e,t]of this.instancesDeferred.entries()){let n=this.normalizeInstanceIdentifier(e);try{let e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch(e){}}}}clearInstance(e=o){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){let e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e=o){return this.instances.has(e)}getOptions(e=o){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let r=this.getOrInitializeService({instanceIdentifier:n,options:t});for(let[e,t]of this.instancesDeferred.entries())n===this.normalizeInstanceIdentifier(e)&&t.resolve(r);return r}onInit(e,t){var n;let r=this.normalizeInstanceIdentifier(t),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(e),this.onInitCallbacks.set(r,i);let o=this.instances.get(r);return o&&e(o,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){let n=this.onInitCallbacks.get(t);if(n)for(let r of n)try{r(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:e===o?void 0:e,options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch(e){}return n||null}normalizeInstanceIdentifier(e=o){return this.component?this.component.multipleInstances?e:o:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class a{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let t=new s(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}},53333:function(e,t,n){"use strict";var r,i;n.d(t,{Yd:function(){return c},in:function(){return r}});/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let o=[];(i=r||(r={}))[i.DEBUG=0]="DEBUG",i[i.VERBOSE=1]="VERBOSE",i[i.INFO=2]="INFO",i[i.WARN=3]="WARN",i[i.ERROR=4]="ERROR",i[i.SILENT=5]="SILENT";let s={debug:r.DEBUG,verbose:r.VERBOSE,info:r.INFO,warn:r.WARN,error:r.ERROR,silent:r.SILENT},a=r.INFO,u={[r.DEBUG]:"log",[r.VERBOSE]:"log",[r.INFO]:"info",[r.WARN]:"warn",[r.ERROR]:"error"},l=(e,t,...n)=>{if(t<e.logLevel)return;let r=new Date().toISOString(),i=u[t];if(i)console[i](`[${r}]  ${e.name}:`,...n);else throw Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class c{constructor(e){this.name=e,this._logLevel=a,this._logHandler=l,this._userLogHandler=null,o.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in r))throw TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?s[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,r.DEBUG,...e),this._logHandler(this,r.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,r.VERBOSE,...e),this._logHandler(this,r.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,r.INFO,...e),this._logHandler(this,r.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,r.WARN,...e),this._logHandler(this,r.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,r.ERROR,...e),this._logHandler(this,r.ERROR,...e)}}},64514:function(e,t,n){"use strict";n.d(t,{xC:function(){return ep},hg:function(){return eS},e:function(){return e6},oM:function(){return eT}});var r,i,o=Symbol.for("immer-nothing"),s=Symbol.for("immer-draftable"),a=Symbol.for("immer-state");function u(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var l=Object.getPrototypeOf;function c(e){return!!e&&!!e[a]}function d(e){return!!e&&(f(e)||Array.isArray(e)||!!e[s]||!!e.constructor?.[s]||v(e)||_(e))}var h=Object.prototype.constructor.toString();function f(e){if(!e||"object"!=typeof e)return!1;let t=l(e);if(null===t)return!0;let n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===h}function p(e,t){0===g(e)?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function g(e){let t=e[a];return t?t.type_:Array.isArray(e)?1:v(e)?2:_(e)?3:0}function m(e,t){return 2===g(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function y(e,t,n){let r=g(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function v(e){return e instanceof Map}function _(e){return e instanceof Set}function b(e){return e.copy_||e.base_}function w(e,t){if(v(e))return new Map(e);if(_(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&f(e))return l(e)?{...e}:Object.assign(Object.create(null),e);let n=Object.getOwnPropertyDescriptors(e);delete n[a];let r=Reflect.ownKeys(n);for(let t=0;t<r.length;t++){let i=r[t],o=n[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(n[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(l(e),n)}function S(e,t=!1){return k(e)||c(e)||!d(e)||(g(e)>1&&(e.set=e.add=e.clear=e.delete=E),Object.freeze(e),t&&Object.entries(e).forEach(([e,t])=>S(t,!0))),e}function E(){u(2)}function k(e){return Object.isFrozen(e)}var I={};function T(e){let t=I[e];return t||u(0,e),t}function x(e,t){t&&(T("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function C(e){A(e),e.drafts_.forEach(N),e.drafts_=null}function A(e){e===i&&(i=e.parent_)}function O(e){return i={drafts_:[],parent_:i,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function N(e){let t=e[a];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function R(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return void 0!==e&&e!==n?(n[a].modified_&&(C(t),u(4)),d(e)&&(e=D(t,e),t.parent_||M(t,e)),t.patches_&&T("Patches").generateReplacementPatches_(n[a].base_,e,t.patches_,t.inversePatches_)):e=D(t,n,[]),C(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==o?e:void 0}function D(e,t,n){if(k(t))return t;let r=t[a];if(!r)return p(t,(i,o)=>P(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return M(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;let t=r.copy_,i=t,o=!1;3===r.type_&&(i=new Set(t),t.clear(),o=!0),p(i,(i,s)=>P(e,r,t,i,s,n,o)),M(e,t,!1),n&&e.patches_&&T("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function P(e,t,n,r,i,o,s){if(c(i)){let s=D(e,i,o&&t&&3!==t.type_&&!m(t.assigned_,r)?o.concat(r):void 0);if(y(n,r,s),!c(s))return;e.canAutoFreeze_=!1}else s&&n.add(i);if(d(i)&&!k(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;D(e,i),(!t||!t.scope_.parent_)&&"symbol"!=typeof r&&Object.prototype.propertyIsEnumerable.call(n,r)&&M(e,i)}}function M(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&S(t,n)}var L={get(e,t){if(t===a)return e;let n=b(e);if(!m(n,t))return function(e,t,n){let r=q(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);let r=n[t];return e.finalized_||!d(r)?r:r===j(e.base_,t)?($(e),e.copy_[t]=B(r,e)):r},has:(e,t)=>t in b(e),ownKeys:e=>Reflect.ownKeys(b(e)),set(e,t,n){let r=q(b(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=j(b(e),t),i=r?.[a];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if((n===r?0!==n||1/n==1/r:n!=n&&r!=r)&&(void 0!==n||m(e.base_,t)))return!0;$(e),F(e)}return!!(e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t]))||(e.copy_[t]=n,e.assigned_[t]=!0,!0)},deleteProperty:(e,t)=>(void 0!==j(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,$(e),F(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let n=b(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){u(11)},getPrototypeOf:e=>l(e.base_),setPrototypeOf(){u(12)}},U={};function j(e,t){let n=e[a];return(n?b(n):e)[t]}function q(e,t){if(!(t in e))return;let n=l(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=l(n)}}function F(e){!e.modified_&&(e.modified_=!0,e.parent_&&F(e.parent_))}function $(e){e.copy_||(e.copy_=w(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function B(e,t){let n=v(e)?T("MapSet").proxyMap_(e,t):_(e)?T("MapSet").proxySet_(e,t):function(e,t){let n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:i,modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=r,s=L;n&&(o=[r],s=U);let{revoke:a,proxy:u}=Proxy.revocable(o,s);return r.draft_=u,r.revoke_=a,u}(e,t);return(t?t.scope_:i).drafts_.push(n),n}function z(e){return c(e)||u(10,e),function e(t){let n;if(!d(t)||k(t))return t;let r=t[a];if(r){if(!r.modified_)return r.base_;r.finalized_=!0,n=w(t,r.scope_.immer_.useStrictShallowCopy_)}else n=w(t,!0);return p(n,(t,r)=>{y(n,t,e(r))}),r&&(r.finalized_=!1),n}(e)}p(L,(e,t)=>{U[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),U.deleteProperty=function(e,t){return U.set.call(this,e,t,void 0)},U.set=function(e,t,n){return L.set.call(this,e[0],t,n,e[0])};var V=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{let r;if("function"==typeof e&&"function"!=typeof t){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}if("function"!=typeof t&&u(6),void 0!==n&&"function"!=typeof n&&u(7),d(e)){let i=O(this),o=B(e,void 0),s=!0;try{r=t(o),s=!1}finally{s?C(i):A(i)}return x(i,n),R(r,i)}if(e&&"object"==typeof e)u(1,e);else{if(void 0===(r=t(e))&&(r=e),r===o&&(r=void 0),this.autoFreeze_&&S(r,!0),n){let t=[],i=[];T("Patches").generateReplacementPatches_(e,r,t,i),n(t,i)}return r}},this.produceWithPatches=(e,t)=>{let n,r;return"function"==typeof e?(t,...n)=>this.produceWithPatches(t,t=>e(t,...n)):[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){d(e)||u(8),c(e)&&(e=z(e));let t=O(this),n=B(e,void 0);return n[a].isManual_=!0,A(t),n}finishDraft(e,t){let n=e&&e[a];n&&n.isManual_||u(9);let{scope_:r}=n;return x(r,t),R(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=T("Patches").applyPatches_;return c(e)?r(e,t):this.produce(e,e=>r(e,t))}},G=V.produce;V.produceWithPatches.bind(V),V.setAutoFreeze.bind(V),V.setUseStrictShallowCopy.bind(V),V.applyPatches.bind(V),V.createDraft.bind(V),V.finishDraft.bind(V);var W=n(19119);function H(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var K="function"==typeof Symbol&&Symbol.observable||"@@observable",J=()=>Math.random().toString(36).substring(7).split("").join("."),X={INIT:`@@redux/INIT${J()}`,REPLACE:`@@redux/REPLACE${J()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${J()}`};function Q(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function Z(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function Y(e){return Q(e)&&"type"in e&&"string"==typeof e.type}function ee(e){return({dispatch:t,getState:n})=>r=>i=>"function"==typeof i?i(t,n,e):r(i)}var et=ee();n(83454),((...e)=>{let t=(0,W.wN)(...e),n=Object.assign((...e)=>{let n=t(...e),r=(e,...t)=>n(c(e)?z(e):e,...t);return Object.assign(r,n),r},{withTypes:()=>n})})(W.kO);var en="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!=arguments.length)return"object"==typeof arguments[0]?Z:Z.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var er=e=>e&&"function"==typeof e.match;function ei(e,t){function n(...r){if(t){let n=t(...r);if(!n)throw Error(e9(0));return{type:e,payload:n.payload,..."meta"in n&&{meta:n.meta},..."error"in n&&{error:n.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>Y(t)&&t.type===e,n}function eo(e,t){for(let n of e)if(t(n))return n}var es=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function ea(e){return d(e)?G(e,()=>{}):e}function eu(e,t,n){if(e.has(t)){let r=e.get(t);return n.update&&(r=n.update(r,t,e),e.set(t,r)),r}if(!n.insert)throw Error(e9(10));let r=n.insert(t,e);return e.set(t,r),r}var el=()=>function(e){let{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{},o=new es;return t&&("boolean"==typeof t?o.push(et):o.push(ee(t.extraArgument))),o},ec=e=>t=>{setTimeout(t,e)},ed="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:ec(10),eh=(e={type:"raf"})=>t=>(...n)=>{let r=t(...n),i=!0,o=!1,s=!1,a=new Set,u="tick"===e.type?queueMicrotask:"raf"===e.type?ed:"callback"===e.type?e.queueNotification:ec(e.timeout),l=()=>{s=!1,o&&(o=!1,a.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){let t=r.subscribe(()=>i&&e());return a.add(e),()=>{t(),a.delete(e)}},dispatch(e){try{return(o=!(i=!e?.meta?.RTK_autoBatch))&&!s&&(s=!0,u(l)),r.dispatch(e)}finally{i=!0}}})},ef=e=>function(t){let{autoBatch:n=!0}=t??{},r=new es(e);return n&&r.push(eh("object"==typeof n?n:void 0)),r};function ep(e){let t,n;let r=el(),{reducer:i,middleware:o,devTools:s=!0,preloadedState:a,enhancers:u}=e||{};if("function"==typeof i)t=i;else if(Q(i))t=function(e){let t;let n=Object.keys(e),r={};for(let t=0;t<n.length;t++){let i=n[t];"function"==typeof e[i]&&(r[i]=e[i])}let i=Object.keys(r);try{!function(e){Object.keys(e).forEach(t=>{let n=e[t];if(void 0===n(void 0,{type:X.INIT}))throw Error(H(12));if(void 0===n(void 0,{type:X.PROBE_UNKNOWN_ACTION()}))throw Error(H(13))})}(r)}catch(e){t=e}return function(e={},n){if(t)throw t;let o=!1,s={};for(let t=0;t<i.length;t++){let a=i[t],u=r[a],l=e[a],c=u(l,n);if(void 0===c)throw n&&n.type,Error(H(14));s[a]=c,o=o||c!==l}return(o=o||i.length!==Object.keys(e).length)?s:e}}(i);else throw Error(e9(1));n="function"==typeof o?o(r):r();let l=Z;s&&(l=en({trace:!1,..."object"==typeof s&&s}));let c=ef(function(...e){return t=>(n,r)=>{let i=t(n,r),o=()=>{throw Error(H(15))},s={getState:i.getState,dispatch:(e,...t)=>o(e,...t)};return o=Z(...e.map(e=>e(s)))(i.dispatch),{...i,dispatch:o}}}(...n));return function e(t,n,r){if("function"!=typeof t)throw Error(H(2));if("function"==typeof n&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw Error(H(0));if("function"==typeof n&&void 0===r&&(r=n,n=void 0),void 0!==r){if("function"!=typeof r)throw Error(H(1));return r(e)(t,n)}let i=t,o=n,s=new Map,a=s,u=0,l=!1;function c(){a===s&&(a=new Map,s.forEach((e,t)=>{a.set(t,e)}))}function d(){if(l)throw Error(H(3));return o}function h(e){if("function"!=typeof e)throw Error(H(4));if(l)throw Error(H(5));let t=!0;c();let n=u++;return a.set(n,e),function(){if(t){if(l)throw Error(H(6));t=!1,c(),a.delete(n),s=null}}}function f(e){if(!Q(e))throw Error(H(7));if(void 0===e.type)throw Error(H(8));if("string"!=typeof e.type)throw Error(H(17));if(l)throw Error(H(9));try{l=!0,o=i(o,e)}finally{l=!1}return(s=a).forEach(e=>{e()}),e}return f({type:X.INIT}),{dispatch:f,subscribe:h,getState:d,replaceReducer:function(e){if("function"!=typeof e)throw Error(H(10));i=e,f({type:X.REPLACE})},[K]:function(){return{subscribe(e){if("object"!=typeof e||null===e)throw Error(H(11));function t(){e.next&&e.next(d())}return t(),{unsubscribe:h(t)}},[K](){return this}}}}}(t,a,l(..."function"==typeof u?u(c):c()))}function eg(e){let t;let n={},r=[],i={addCase(e,t){let r="string"==typeof e?e:e.type;if(!r)throw Error(e9(28));if(r in n)throw Error(e9(29));return n[r]=t,i},addMatcher:(e,t)=>(r.push({matcher:e,reducer:t}),i),addDefaultCase:e=>(t=e,i)};return e(i),[n,r,t]}var em=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},ey=(e,t)=>er(e)?e.match(t):e(t),ev=["name","message","stack","code"],e_=class{constructor(e,t){this.payload=e,this.meta=t}_type},eb=class{constructor(e,t){this.payload=e,this.meta=t}_type},ew=e=>{if("object"==typeof e&&null!==e){let t={};for(let n of ev)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},eS=(()=>{function e(e,t,n){let r=ei(e+"/fulfilled",(e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}})),i=ei(e+"/pending",(e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}})),o=ei(e+"/rejected",(e,t,r,i,o)=>({payload:i,error:(n&&n.serializeError||ew)(e||"Rejected"),meta:{...o||{},arg:r,requestId:t,rejectedWithValue:!!i,requestStatus:"rejected",aborted:e?.name==="AbortError",condition:e?.name==="ConditionError"}}));return Object.assign(function(e){return(s,a,u)=>{let l,c;let d=n?.idGenerator?n.idGenerator(e):em(),h=new AbortController;function f(e){c=e,h.abort()}let p=async function(){let p;try{var g;let o=n?.condition?.(e,{getState:a,extra:u});if(g=o,null!==g&&"object"==typeof g&&"function"==typeof g.then&&(o=await o),!1===o||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let m=new Promise((e,t)=>{l=()=>{t({name:"AbortError",message:c||"Aborted"})},h.signal.addEventListener("abort",l)});s(i(d,e,n?.getPendingMeta?.({requestId:d,arg:e},{getState:a,extra:u}))),p=await Promise.race([m,Promise.resolve(t(e,{dispatch:s,getState:a,extra:u,requestId:d,signal:h.signal,abort:f,rejectWithValue:(e,t)=>new e_(e,t),fulfillWithValue:(e,t)=>new eb(e,t)})).then(t=>{if(t instanceof e_)throw t;return t instanceof eb?r(t.payload,d,e,t.meta):r(t,d,e)})])}catch(t){p=t instanceof e_?o(null,d,e,t.payload,t.meta):o(t,d,e)}finally{l&&h.signal.removeEventListener("abort",l)}return n&&!n.dispatchConditionRejection&&o.match(p)&&p.meta.condition||s(p),p}();return Object.assign(p,{abort:f,requestId:d,arg:e,unwrap:()=>p.then(eE)})}},{pending:i,rejected:o,fulfilled:r,settled:function(...e){return t=>e.some(e=>ey(e,t))}(o,r),typePrefix:e})}return e.withTypes=()=>e,e})();function eE(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var ek=Symbol.for("rtk-slice-createasyncthunk"),eI=((r=eI||{}).reducer="reducer",r.reducerWithPrepare="reducerWithPrepare",r.asyncThunk="asyncThunk",r),eT=function({creators:e}={}){let t=e?.asyncThunk?.[ek];return function(e){let n;let{name:r,reducerPath:i=r}=e;if(!r)throw Error(e9(11));let o=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},s=Object.keys(o),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(e,t){let n="string"==typeof e?e:e.type;if(!n)throw Error(e9(12));if(n in a.sliceCaseReducersByType)throw Error(e9(13));return a.sliceCaseReducersByType[n]=t,u},addMatcher:(e,t)=>(a.sliceMatchers.push({matcher:e,reducer:t}),u),exposeAction:(e,t)=>(a.actionCreators[e]=t,u),exposeCaseReducer:(e,t)=>(a.sliceCaseReducersByName[e]=t,u)};function l(){let[t={},n=[],r]="function"==typeof e.extraReducers?eg(e.extraReducers):[e.extraReducers],i={...t,...a.sliceCaseReducersByType};return function(e,t){let n;let[r,i,o]=eg(t);if("function"==typeof e)n=()=>ea(e());else{let t=ea(e);n=()=>t}function s(e=n(),t){let s=[r[t.type],...i.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return 0===s.filter(e=>!!e).length&&(s=[o]),s.reduce((e,n)=>{if(n){if(c(e)){let r=n(e,t);return void 0===r?e:r}if(d(e))return G(e,e=>n(e,t));{let r=n(e,t);if(void 0===r){if(null===e)return e;throw Error(e9(9))}return r}}return e},e)}return s.getInitialState=n,s}(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of a.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)})}s.forEach(n=>{let i=o[n],s={reducerName:n,type:`${r}/${n}`,createNotation:"function"==typeof e.reducers};"asyncThunk"===i._reducerDefinitionType?function({type:e,reducerName:t},n,r,i){if(!i)throw Error(e9(18));let{payloadCreator:o,fulfilled:s,pending:a,rejected:u,settled:l,options:c}=n,d=i(e,o,c);r.exposeAction(t,d),s&&r.addCase(d.fulfilled,s),a&&r.addCase(d.pending,a),u&&r.addCase(d.rejected,u),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:s||ex,pending:a||ex,rejected:u||ex,settled:l||ex})}(s,i,u,t):function({type:e,reducerName:t,createNotation:n},r,i){let o,s;if("reducer"in r){if(n&&"reducerWithPrepare"!==r._reducerDefinitionType)throw Error(e9(17));o=r.reducer,s=r.prepare}else o=r;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,s?ei(e,s):ei(e))}(s,i,u)});let h=e=>e,f=new Map;function p(e,t){return n||(n=l()),n(e,t)}function g(){return n||(n=l()),n.getInitialState()}function m(t,n=!1){function r(e){let r=e[t];return void 0===r&&n&&(r=g()),r}function i(t=h){let r=eu(f,n,{insert:()=>new WeakMap});return eu(r,t,{insert:()=>{let r={};for(let[i,o]of Object.entries(e.selectors??{}))r[i]=function(e,t,n,r){function i(o,...s){let a=t(o);return void 0===a&&r&&(a=n()),e(a,...s)}return i.unwrapped=e,i}(o,t,g,n);return r}})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}let y={name:r,reducer:p,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:g,...m(i),injectInto(e,{reducerPath:t,...n}={}){let r=t??i;return e.inject({reducerPath:r,reducer:p},n),{...y,...m(r,!0)}}};return y}}();function ex(){}var eC="listener",eA="completed",eO="cancelled",eN=`task-${eO}`,eR=`task-${eA}`,eD=`${eC}-${eO}`,eP=`${eC}-${eA}`,eM=class{constructor(e){this.code=e,this.message=`task ${eO} (reason: ${e})`}name="TaskAbortError";message},eL=(e,t)=>{if("function"!=typeof e)throw Error(e9(32))},eU=()=>{},ej=(e,t=eU)=>(e.catch(t),e),eq=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),eF=(e,t)=>{let n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},e$=e=>{if(e.aborted){let{reason:t}=e;throw new eM(t)}};function eB(e,t){let n=eU;return new Promise((r,i)=>{let o=()=>i(new eM(e.reason));if(e.aborted){o();return}n=eq(e,o),t.finally(()=>n()).then(r,i)}).finally(()=>{n=eU})}var ez=async(e,t)=>{try{await Promise.resolve();let t=await e();return{status:"ok",value:t}}catch(e){return{status:e instanceof eM?"cancelled":"rejected",error:e}}finally{t?.()}},eV=e=>t=>ej(eB(e,t).then(t=>(e$(e),t))),eG=e=>{let t=eV(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:eW}=Object,eH={},eK="listenerMiddleware",eJ=(e,t)=>{let n=t=>eq(e,()=>eF(t,e.reason));return(r,i)=>{eL(r,"taskExecutor");let o=new AbortController;n(o);let s=ez(async()=>{e$(e),e$(o.signal);let t=await r({pause:eV(o.signal),delay:eG(o.signal),signal:o.signal});return e$(o.signal),t},()=>eF(o,eR));return i?.autoJoin&&t.push(s.catch(eU)),{result:eV(e)(s),cancel(){eF(o,eN)}}}},eX=(e,t)=>{let n=async(n,r)=>{e$(t);let i=()=>{},o=[new Promise((t,r)=>{let o=e({predicate:n,effect:(e,n)=>{n.unsubscribe(),t([e,n.getState(),n.getOriginalState()])}});i=()=>{o(),r()}})];null!=r&&o.push(new Promise(e=>setTimeout(e,r,null)));try{let e=await eB(t,Promise.race(o));return e$(t),e}finally{i()}};return(e,t)=>ej(n(e,t))},eQ=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:o}=e;if(t)i=ei(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(i);else throw Error(e9(21));return eL(o,"options.listener"),{predicate:i,type:t,effect:o}},eZ=Object.assign(e=>{let{type:t,predicate:n,effect:r}=eQ(e);return{id:em(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw Error(e9(22))}}},{withTypes:()=>eZ}),eY=e=>{e.pending.forEach(e=>{eF(e,eD)})},e0=e=>()=>{e.forEach(eY),e.clear()},e1=(e,t,n)=>{try{e(t,n)}catch(e){setTimeout(()=>{throw e},0)}},e2=Object.assign(ei(`${eK}/add`),{withTypes:()=>e2}),e3=ei(`${eK}/removeAll`),e4=Object.assign(ei(`${eK}/remove`),{withTypes:()=>e4}),e5=(...e)=>{console.error(`${eK}/error`,...e)},e6=(e={})=>{let t=new Map,{extra:n,onError:r=e5}=e;eL(r,"onError");let i=e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&eY(e)}),o=e=>{let n=eo(Array.from(t.values()),t=>t.effect===e.effect);return n||(n=eZ(e)),i(n)};Object.assign(o,{withTypes:()=>o});let s=e=>{let{type:n,effect:r,predicate:i}=eQ(e),o=eo(Array.from(t.values()),e=>("string"==typeof n?e.type===n:e.predicate===i)&&e.effect===r);return o&&(o.unsubscribe(),e.cancelActive&&eY(o)),!!o};Object.assign(s,{withTypes:()=>s});let a=async(e,i,s,a)=>{let u=new AbortController,l=eX(o,u.signal),c=[];try{e.pending.add(u),await Promise.resolve(e.effect(i,eW({},s,{getOriginalState:a,condition:(e,t)=>l(e,t).then(Boolean),take:l,delay:eG(u.signal),pause:eV(u.signal),extra:n,signal:u.signal,fork:eJ(u.signal,c),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,n)=>{e!==u&&(eF(e,eD),n.delete(e))})},cancel:()=>{eF(u,eD),e.pending.delete(u)},throwIfCancelled:()=>{e$(u.signal)}})))}catch(e){e instanceof eM||e1(r,e,{raisedBy:"effect"})}finally{await Promise.all(c),eF(u,eP),e.pending.delete(u)}},u=e0(t);return{middleware:e=>n=>i=>{let l;if(!Y(i))return n(i);if(e2.match(i))return o(i.payload);if(e3.match(i)){u();return}if(e4.match(i))return s(i.payload);let c=e.getState(),d=()=>{if(c===eH)throw Error(e9(23));return c};try{if(l=n(i),t.size>0){let n=e.getState();for(let o of Array.from(t.values())){let t=!1;try{t=o.predicate(i,n,c)}catch(e){t=!1,e1(r,e,{raisedBy:"predicate"})}t&&a(o,i,e,d)}}}finally{c=eH}return l},startListening:o,stopListening:s,clearListeners:u}};function e9(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}Symbol.for("rtk-state-proxy-original")},60811:function(e,t,n){"use strict";n.d(t,{G:function(){return h}});var r=n(13533),i=n(16824),o=n(29531),s=n(43927);class a{constructor(e,t){let n,r;n=e||new s.s,r=t||new s.s,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){let t;let n=this._pushScope();try{t=e(n)}catch(e){throw this._popScope(),e}return(0,i.J8)(t)?t.then(e=>(this._popScope(),e),e=>{throw this._popScope(),e}):(this._popScope(),t)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function u(){let e=(0,r.c)(),t=(0,r.q)(e);return t.stack=t.stack||new a((0,o.Y)("defaultCurrentScope",()=>new s.s),(0,o.Y)("defaultIsolationScope",()=>new s.s))}function l(e){return u().withScope(e)}function c(e,t){let n=u();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function d(e){return u().withScope(()=>e(u().getIsolationScope()))}function h(e){let t=(0,r.q)(e);return t.acs?t.acs:{withIsolationScope:d,withScope:l,withSetScope:c,withSetIsolationScope:(e,t)=>d(t),getCurrentScope:()=>u().getScope(),getIsolationScope:()=>u().getIsolationScope()}}},37895:function(e,t,n){"use strict";n.d(t,{n:function(){return s}});var r=n(26181),i=n(41001),o=n(73076);function s(e,t){let n=(0,o.s3)(),s=(0,o.aF)();if(!n)return;let{beforeBreadcrumb:a=null,maxBreadcrumbs:u=100}=n.getOptions();if(u<=0)return;let l={timestamp:(0,r.yW)(),...e},c=a?(0,i.Cf)(()=>a(l,t)):l;null!==c&&(n.emit&&n.emit("beforeAddBreadcrumb",c,t),s.addBreadcrumb(c,u))}},13533:function(e,t,n){"use strict";n.d(t,{c:function(){return o},q:function(){return s}});var r=n(29531),i=n(42990);function o(){return s(r.GLOBAL_OBJ),r.GLOBAL_OBJ}function s(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||i.J,t[i.J]=t[i.J]||{}}},73243:function(e,t,n){"use strict";n.d(t,{J:function(){return r}});let r="production"},73076:function(e,t,n){"use strict";n.d(t,{$e:function(){return c},aF:function(){return u},lW:function(){return l},nZ:function(){return a},s3:function(){return d}});var r=n(29531),i=n(60811),o=n(13533),s=n(43927);function a(){let e=(0,o.c)();return(0,i.G)(e).getCurrentScope()}function u(){let e=(0,o.c)();return(0,i.G)(e).getIsolationScope()}function l(){return(0,r.Y)("globalScope",()=>new s.s)}function c(...e){let t=(0,o.c)(),n=(0,i.G)(t);if(2===e.length){let[t,r]=e;return t?n.withSetScope(t,r):n.withScope(r)}return n.withScope(e[0])}function d(){return a().getClient()}},94223:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});let r="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},39424:function(e,t,n){"use strict";n.d(t,{Qy:function(){return g},Tb:function(){return c},cg:function(){return _},eN:function(){return h},uT:function(){return d},v:function(){return f},yj:function(){return m},yl:function(){return p}});var r=n(41001),i=n(29531),o=n(73243),s=n(73076),a=n(94223),u=n(10042),l=n(5808);function c(e,t){return(0,s.nZ)().captureException(e,(0,l.U0)(t))}function d(e,t){let n="string"==typeof t?t:void 0,r="string"!=typeof t?{captureContext:t}:void 0;return(0,s.nZ)().captureMessage(e,n,r)}function h(e,t){return(0,s.nZ)().captureEvent(e,t)}function f(e,t){(0,s.aF)().setContext(e,t)}async function p(e){let t=(0,s.s3)();return t?t.flush(e):(a.X&&r.kg.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}function g(e){(0,s.aF)().addEventProcessor(e)}function m(e){let t=(0,s.s3)(),n=(0,s.aF)(),r=(0,s.nZ)(),{release:a,environment:l=o.J}=t&&t.getOptions()||{},{userAgent:c}=i.GLOBAL_OBJ.navigator||{},d=(0,u.Hv)({release:a,environment:l,user:r.getUser()||n.getUser(),...c&&{userAgent:c},...e}),h=n.getSession();return h&&"ok"===h.status&&(0,u.CT)(h,{status:"exited"}),y(),n.setSession(d),r.setSession(d),d}function y(){let e=(0,s.aF)(),t=(0,s.nZ)(),n=t.getSession()||e.getSession();n&&(0,u.RJ)(n),v(),e.setSession(),t.setSession()}function v(){let e=(0,s.aF)(),t=(0,s.nZ)(),n=(0,s.s3)(),r=t.getSession()||e.getSession();r&&n&&n.captureSession(r)}function _(e=!1){if(e){y();return}v()}},72751:function(e,t,n){"use strict";n.d(t,{y:function(){return i}});var r=n(27179);function i(e){let t=e._sentryMetrics;if(!t)return;let n={};for(let[,[e,i]]of t)(n[e]||(n[e]=[])).push((0,r.Jr)(i));return n}},43927:function(e,t,n){"use strict";n.d(t,{s:function(){return d}});var r=n(19548),i=n(16824),o=n(26181),s=n(41982),a=n(41001),u=n(10042),l=n(89366);class c{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=(0,r.Q)()}clone(){let e=new c;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,(0,l.D)(e,(0,l.Y)(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&(0,u.CT)(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;let t="function"==typeof e?e(this):e,[n,r]=t instanceof d?[t.getScopeData(),t.getRequestSession()]:(0,i.PO)(t)?[e,e.requestSession]:[],{tags:o,extra:s,user:a,contexts:u,level:l,fingerprint:c=[],propagationContext:h}=n||{};return this._tags={...this._tags,...o},this._extra={...this._extra,...s},this._contexts={...this._contexts,...u},a&&Object.keys(a).length&&(this._user=a),l&&(this._level=l),c.length&&(this._fingerprint=c),h&&(this._propagationContext=h),r&&(this._requestSession=r),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,(0,l.D)(this,void 0),this._attachments=[],this._propagationContext=(0,r.Q)(),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n="number"==typeof t?t:100;if(n<=0)return this;let r={timestamp:(0,o.yW)(),...e},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:(0,l.Y)(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t&&t.event_id?t.event_id:(0,s.DM)();if(!this._client)return a.kg.warn("No client configured on scope - will not capture exception!"),n;let r=Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){let r=n&&n.event_id?n.event_id:(0,s.DM)();if(!this._client)return a.kg.warn("No client configured on scope - will not capture message!"),r;let i=Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){let n=t&&t.event_id?t.event_id:(0,s.DM)();return this._client?this._client.captureEvent(e,{...t,event_id:n},this):a.kg.warn("No client configured on scope - will not capture event!"),n}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}let d=c},31218:function(e,t,n){"use strict";n.d(t,{$J:function(){return o},E1:function(){return u},JQ:function(){return d},S3:function(){return s},TE:function(){return i},Wb:function(){return l},Zj:function(){return r},ju:function(){return a},p6:function(){return c}});let r="sentry.source",i="sentry.sample_rate",o="sentry.op",s="sentry.origin",a="sentry.idle_span_finish_reason",u="sentry.measurement_unit",l="sentry.measurement_value",c="sentry.profile_id",d="sentry.exclusive_time"},10042:function(e,t,n){"use strict";n.d(t,{CT:function(){return a},Hv:function(){return s},RJ:function(){return u}});var r=n(26181),i=n(41982),o=n(27179);function s(e){let t=(0,r.ph)(),n={sid:(0,i.DM)(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>(0,o.Jr)({sid:`${n.sid}`,init:n.init,started:new Date(1e3*n.started).toISOString(),timestamp:new Date(1e3*n.timestamp).toISOString(),status:n.status,errors:n.errors,did:"number"==typeof n.did||"string"==typeof n.did?`${n.did}`:void 0,duration:n.duration,abnormal_mechanism:n.abnormal_mechanism,attrs:{release:n.release,environment:n.environment,ip_address:n.ipAddress,user_agent:n.userAgent}})};return e&&a(n,e),n}function a(e,t={}){if(!t.user||(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||(0,r.ph)(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:(0,i.DM)()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function u(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),a(e,n)}},72123:function(e,t,n){"use strict";n.d(t,{Lh:function(){return d},_l:function(){return h},jC:function(){return f}});var r=n(27179),i=n(60859),o=n(73243),s=n(73076),a=n(31218),u=n(67973),l=n(81585);let c="_frozenDsc";function d(e,t){(0,r.xp)(e,c,t)}function h(e,t){let n=t.getOptions(),{publicKey:i}=t.getDsn()||{},s=(0,r.Jr)({environment:n.environment||o.J,release:n.release,public_key:i,trace_id:e});return t.emit("createDsc",s),s}function f(e){let t=(0,s.s3)();if(!t)return{};let n=h((0,l.XU)(e).trace_id||"",t),r=(0,l.Gx)(e),o=r[c];if(o)return o;let d=r.spanContext().traceState,f=d&&d.get("sentry.dsc"),p=f&&(0,i.EN)(f);if(p)return p;let g=(0,l.XU)(r),m=g.data||{},y=m[a.TE];null!=y&&(n.sample_rate=`${y}`);let v=m[a.Zj],_=g.description;return"url"!==v&&_&&(n.transaction=_),(0,u.z)()&&(n.sampled=String((0,l.Tt)(r))),t.emit("createDsc",n,r),n}},69737:function(e,t,n){"use strict";n.d(t,{OP:function(){return i},Q0:function(){return s},jt:function(){return o},pq:function(){return r}});let r=0,i=1,o=2;function s(e,t){e.setAttribute("http.response.status_code",t);let n=function(e){if(e<400&&e>=100)return{code:i};if(e>=400&&e<500)switch(e){case 401:return{code:o,message:"unauthenticated"};case 403:return{code:o,message:"permission_denied"};case 404:return{code:o,message:"not_found"};case 409:return{code:o,message:"already_exists"};case 413:return{code:o,message:"failed_precondition"};case 429:return{code:o,message:"resource_exhausted"};case 499:return{code:o,message:"cancelled"};default:return{code:o,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:o,message:"unimplemented"};case 503:return{code:o,message:"unavailable"};case 504:return{code:o,message:"deadline_exceeded"};default:return{code:o,message:"internal_error"}}return{code:o,message:"unknown_error"}}(t);"unknown_error"!==n.message&&e.setStatus(n)}},67973:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var r=n(73076);function i(e){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;let t=(0,r.s3)(),n=e||t&&t.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}},5808:function(e,t,n){"use strict";n.d(t,{U0:function(){return S},R:function(){return b}});var r=n(41982),i=n(26181),o=n(89163),s=n(29531),a=n(83408),u=n(73243),l=n(73076),c=n(80128),d=n(41001),h=n(16824),f=n(94223),p=n(43927),g=n(27179),m=n(72123),y=n(81585);function v(e,t){let{extra:n,tags:r,user:i,contexts:o,level:s,sdkProcessingMetadata:a,breadcrumbs:u,fingerprint:l,eventProcessors:c,attachments:d,propagationContext:h,transactionName:f,span:p}=t;_(e,"extra",n),_(e,"tags",r),_(e,"user",i),_(e,"contexts",o),_(e,"sdkProcessingMetadata",a),s&&(e.level=s),f&&(e.transactionName=f),p&&(e.span=p),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),l.length&&(e.fingerprint=[...e.fingerprint,...l]),c.length&&(e.eventProcessors=[...e.eventProcessors,...c]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...h}}function _(e,t,n){if(n&&Object.keys(n).length)for(let r in e[t]={...e[t]},n)Object.prototype.hasOwnProperty.call(n,r)&&(e[t][r]=n[r])}function b(e,t,n,_,b,S){let{normalizeDepth:E=3,normalizeMaxBreadth:k=1e3}=e,I={...t,event_id:t.event_id||n.event_id||(0,r.DM)(),timestamp:t.timestamp||(0,i.yW)()},T=n.integrations||e.integrations.map(e=>e.name);(function(e,t){let{environment:n,release:r,dist:i,maxValueLength:s=250}=t;"environment"in e||(e.environment="environment"in t?n:u.J),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=(0,o.$G)(e.message,s));let a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=(0,o.$G)(a.value,s));let l=e.request;l&&l.url&&(l.url=(0,o.$G)(l.url,s))})(I,e),T.length>0&&(I.sdk=I.sdk||{},I.sdk.integrations=[...I.sdk.integrations||[],...T]),b&&b.emit("applyFrameMetadata",t),void 0===t.type&&function(e,t){let n;let r=s.GLOBAL_OBJ._sentryDebugIds;if(!r)return;let i=w.get(t);i?n=i:(n=new Map,w.set(t,n));let o=Object.entries(r).reduce((e,[r,i])=>{let o;let s=n.get(r);s?o=s:(o=t(r),n.set(r,o));for(let t=o.length-1;t>=0;t--){let n=o[t];if(n.filename){e[n.filename]=i;break}}return e},{});try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.filename&&(e.debug_id=o[e.filename])})})}catch(e){}}(I,e.stackParser);let x=function(e,t){if(!t)return e;let n=e?e.clone():new p.s;return n.update(t),n}(_,n.captureContext);n.mechanism&&(0,r.EG)(I,n.mechanism);let C=b?b.getEventProcessors():[],A=(0,l.lW)().getScopeData();S&&v(A,S.getScopeData()),x&&v(A,x.getScopeData());let O=[...n.attachments||[],...A.attachments];return O.length&&(n.attachments=O),function(e,t){let{fingerprint:n,span:i,breadcrumbs:o,sdkProcessingMetadata:s}=t;(function(e,t){let{extra:n,tags:r,user:i,contexts:o,level:s,transactionName:a}=t,u=(0,g.Jr)(n);u&&Object.keys(u).length&&(e.extra={...u,...e.extra});let l=(0,g.Jr)(r);l&&Object.keys(l).length&&(e.tags={...l,...e.tags});let c=(0,g.Jr)(i);c&&Object.keys(c).length&&(e.user={...c,...e.user});let d=(0,g.Jr)(o);d&&Object.keys(d).length&&(e.contexts={...d,...e.contexts}),s&&(e.level=s),a&&"transaction"!==e.type&&(e.transaction=a)})(e,t),i&&function(e,t){e.contexts={trace:(0,y.wy)(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:(0,m.jC)(t),...e.sdkProcessingMetadata};let n=(0,y.Gx)(t),r=(0,y.XU)(n).description;r&&!e.transaction&&"transaction"===e.type&&(e.transaction=r)}(e,i),e.fingerprint=e.fingerprint?(0,r.lE)(e.fingerprint):[],n&&(e.fingerprint=e.fingerprint.concat(n)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint,function(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,o),e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...s}}(I,A),(function e(t,n,r,i=0){return new c.cW((o,s)=>{let a=t[i];if(null===n||"function"!=typeof a)o(n);else{let u=a({...n},r);f.X&&a.id&&null===u&&d.kg.log(`Event processor "${a.id}" dropped event`),(0,h.J8)(u)?u.then(n=>e(t,n,r,i+1).then(o)).then(null,s):e(t,u,r,i+1).then(o).then(null,s)}})})([...C,...A.eventProcessors],I,n).then(e=>(e&&function(e){let t={};try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})})}catch(e){}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:"sourcemap",code_file:e,debug_id:t})})}(e),"number"==typeof E&&E>0)?function(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:(0,a.Fv)(e.data,t,n)}}))},...e.user&&{user:(0,a.Fv)(e.user,t,n)},...e.contexts&&{contexts:(0,a.Fv)(e.contexts,t,n)},...e.extra&&{extra:(0,a.Fv)(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=(0,a.Fv)(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:(0,a.Fv)(e.data,t,n)}}))),r}(e,E,k):e)}let w=new WeakMap;function S(e){return e?e instanceof p.s||"function"==typeof e||Object.keys(e).some(e=>E.includes(e))?{captureContext:e}:e:void 0}let E=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"]},89366:function(e,t,n){"use strict";n.d(t,{D:function(){return o},Y:function(){return s}});var r=n(27179);let i="_sentrySpan";function o(e,t){t?(0,r.xp)(e,i,t):delete e[i]}function s(e){return e[i]}},81585:function(e,t,n){"use strict";n.d(t,{$k:function(){return v},Dp:function(){return x},Gx:function(){return C},HN:function(){return A},HR:function(){return g},Hb:function(){return y},Tt:function(){return w},XU:function(){return b},_4:function(){return S},ed:function(){return T},i0:function(){return p},j5:function(){return I},ve:function(){return f},wy:function(){return m}});var r=n(27179),i=n(85712),o=n(26181),s=n(60811),a=n(13533),u=n(73076),l=n(72751),c=n(31218),d=n(69737),h=n(89366);let f=0,p=1;function g(e){let{spanId:t,traceId:n}=e.spanContext(),{data:i,op:o,parent_span_id:s,status:a,origin:u}=b(e);return(0,r.Jr)({parent_span_id:s,span_id:t,trace_id:n,data:i,op:o,status:a,origin:u})}function m(e){let{spanId:t,traceId:n}=e.spanContext(),{parent_span_id:i}=b(e);return(0,r.Jr)({parent_span_id:i,span_id:t,trace_id:n})}function y(e){let{traceId:t,spanId:n}=e.spanContext(),r=w(e);return(0,i.$p)(t,n,r)}function v(e){return"number"==typeof e?_(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?_(e.getTime()):(0,o.ph)()}function _(e){return e>9999999999?e/1e3:e}function b(e){if("function"==typeof e.getSpanJSON)return e.getSpanJSON();try{let{spanId:t,traceId:n}=e.spanContext();if(e.attributes&&e.startTime&&e.name&&e.endTime&&e.status){let{attributes:i,startTime:o,name:s,endTime:a,parentSpanId:u,status:d}=e;return(0,r.Jr)({span_id:t,trace_id:n,data:i,description:s,parent_span_id:u,start_timestamp:v(o),timestamp:v(a)||void 0,status:S(d),op:i[c.$J],origin:i[c.S3],_metrics_summary:(0,l.y)(e)})}return{span_id:t,trace_id:n}}catch(e){return{}}}function w(e){let{traceFlags:t}=e.spanContext();return t===p}function S(e){return e&&e.code!==d.pq?e.code===d.OP?"ok":e.message||"unknown_error":void 0}let E="_sentryChildSpans",k="_sentryRootSpan";function I(e,t){let n=e[k]||e;(0,r.xp)(t,k,n),e[E]?e[E].add(t):(0,r.xp)(e,E,new Set([t]))}function T(e,t){e[E]&&e[E].delete(t)}function x(e){let t=new Set;return function e(n){if(!t.has(n)&&w(n))for(let r of(t.add(n),n[E]?Array.from(n[E]):[]))e(r)}(e),Array.from(t)}function C(e){return e[k]||e}function A(){let e=(0,a.c)(),t=(0,s.G)(e);return t.getActiveSpan?t.getActiveSpan():(0,h.Y)((0,u.nZ)())}},36096:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});let r="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},60859:function(e,t,n){"use strict";n.d(t,{EN:function(){return l},IQ:function(){return c},bU:function(){return s},lq:function(){return a}});var r=n(1525),i=n(16824),o=n(41001);let s="baggage",a="sentry-",u=/^sentry-/;function l(e){let t=e&&((0,i.HD)(e)||Array.isArray(e))?Array.isArray(e)?e.reduce((e,t)=>(Object.entries(d(t)).forEach(([t,n])=>{e[t]=n}),e),{}):d(e):void 0;if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>(t.match(u)&&(e[t.slice(a.length)]=n),e),{});return Object.keys(n).length>0?n:void 0}function c(e){if(e)return function(e){if(0!==Object.keys(e).length)return Object.entries(e).reduce((e,[t,n],i)=>{let s=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,a=0===i?s:`${e},${s}`;return a.length>8192?(r.X&&o.kg.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},"")}(Object.entries(e).reduce((e,[t,n])=>(n&&(e[`${a}${t}`]=n),e),{}))}function d(e){return e.split(",").map(e=>e.split("=").map(e=>decodeURIComponent(e.trim()))).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}},1869:function(e,t,n){"use strict";n.d(t,{Rt:function(){return o},iY:function(){return u},l4:function(){return s},qT:function(){return a}});var r=n(16824);let i=n(29531).GLOBAL_OBJ;function o(e,t={}){if(!e)return"<unknown>";try{let n,o=e,s=[],a=0,u=0,l=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||80;for(;o&&a++<5&&(n=function(e,t){let n=[];if(!e||!e.tagName)return"";if(i.HTMLElement&&e instanceof HTMLElement&&e.dataset){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}n.push(e.tagName.toLowerCase());let o=t&&t.length?t.filter(t=>e.getAttribute(t)).map(t=>[t,e.getAttribute(t)]):null;if(o&&o.length)o.forEach(e=>{n.push(`[${e[0]}="${e[1]}"]`)});else{e.id&&n.push(`#${e.id}`);let t=e.className;if(t&&(0,r.HD)(t))for(let e of t.split(/\s+/))n.push(`.${e}`)}for(let t of["aria-label","type","name","title","alt"]){let r=e.getAttribute(t);r&&n.push(`[${t}="${r}"]`)}return n.join("")}(o,l),"html"!==n&&(!(a>1)||!(u+3*s.length+n.length>=c)));)s.push(n),u+=n.length,o=o.parentNode;return s.reverse().join(" > ")}catch(e){return"<unknown>"}}function s(){try{return i.document.location.href}catch(e){return""}}function a(e){return i.document&&i.document.querySelector?i.document.querySelector(e):null}function u(e){if(!i.HTMLElement)return null;let t=e;for(let e=0;e<5&&t;e++){if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}},1525:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});let r="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},16824:function(e,t,n){"use strict";n.d(t,{Cy:function(){return y},HD:function(){return l},J8:function(){return m},Kj:function(){return g},Le:function(){return c},PO:function(){return h},TX:function(){return a},V9:function(){return v},VW:function(){return s},VZ:function(){return i},cO:function(){return f},fm:function(){return u},kK:function(){return p},pt:function(){return d},y1:function(){return _}});let r=Object.prototype.toString;function i(e){switch(r.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return v(e,Error)}}function o(e,t){return r.call(e)===`[object ${t}]`}function s(e){return o(e,"ErrorEvent")}function a(e){return o(e,"DOMError")}function u(e){return o(e,"DOMException")}function l(e){return o(e,"String")}function c(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function d(e){return null===e||c(e)||"object"!=typeof e&&"function"!=typeof e}function h(e){return o(e,"Object")}function f(e){return"undefined"!=typeof Event&&v(e,Event)}function p(e){return"undefined"!=typeof Element&&v(e,Element)}function g(e){return o(e,"RegExp")}function m(e){return!!(e&&e.then&&"function"==typeof e.then)}function y(e){return h(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function v(e,t){try{return e instanceof t}catch(e){return!1}}function _(e){return!!("object"==typeof e&&null!==e&&(e.__isVue||e._isVue))}},41001:function(e,t,n){"use strict";n.d(t,{Cf:function(){return a},LD:function(){return s},RU:function(){return o},kg:function(){return u}});var r=n(1525),i=n(29531);let o=["debug","info","warn","error","log","assert","trace"],s={};function a(e){if(!("console"in i.GLOBAL_OBJ))return e();let t=i.GLOBAL_OBJ.console,n={},r=Object.keys(s);r.forEach(e=>{let r=s[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}let u=(0,i.Y)("logger",function(){let e=!1,t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return r.X?o.forEach(n=>{t[n]=(...t)=>{e&&a(()=>{i.GLOBAL_OBJ.console[n](`Sentry Logger [${n}]:`,...t)})}}):o.forEach(e=>{t[e]=()=>void 0}),t})},41982:function(e,t,n){"use strict";n.d(t,{DM:function(){return o},Db:function(){return u},EG:function(){return l},YO:function(){return c},jH:function(){return a},lE:function(){return d}});var r=n(27179),i=n(29531);function o(){let e=i.GLOBAL_OBJ,t=e.crypto||e.msCrypto,n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{let e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch(e){}return"10000000100040008000100000000000".replace(/[018]/g,e=>(e^(15&n())>>e/4).toString(16))}function s(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function a(e){let{message:t,event_id:n}=e;if(t)return t;let r=s(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function u(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type=n||"Error")}function l(e,t){let n=s(e);if(!n)return;let r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){let e={...r&&r.data,...t.data};n.mechanism.data=e}}function c(e){if(e&&e.__sentry_captured__)return!0;try{(0,r.xp)(e,"__sentry_captured__",!0)}catch(e){}return!1}function d(e){return Array.isArray(e)?e:[e]}},83408:function(e,t,n){"use strict";n.d(t,{Fv:function(){return s},Qy:function(){return function e(t,n=3,r=102400){let i=s(t,n);return~-encodeURI(JSON.stringify(i)).split(/%..|./).length>r?e(t,n-1,r):i}}});var r=n(16824),i=n(27179),o=n(42283);function s(e,t=100,n=Infinity){try{return function e(t,n,s=Infinity,a=Infinity,u=function(){let e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){let[l,c]=u;if(null==n||["boolean","string"].includes(typeof n)||"number"==typeof n&&Number.isFinite(n))return n;let d=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if("undefined"!=typeof global&&t===global)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if((0,r.y1)(t))return"[VueViewModel]";if((0,r.Cy)(t))return"[SyntheticEvent]";if("number"==typeof t&&!Number.isFinite(t))return`[${t}]`;if("function"==typeof t)return`[Function: ${(0,o.$P)(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;let n=function(e){let t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);if(/^HTML(\w*)Element$/.test(n))return`[HTMLElement: ${n}]`;return`[object ${n}]`}catch(e){return`**non-serializable** (${e})`}}(t,n);if(!d.startsWith("[object "))return d;if(n.__sentry_skip_normalization__)return n;let h="number"==typeof n.__sentry_override_normalization_depth__?n.__sentry_override_normalization_depth__:s;if(0===h)return d.replace("object ","");if(l(n))return"[Circular ~]";if(n&&"function"==typeof n.toJSON)try{let t=n.toJSON();return e("",t,h-1,a,u)}catch(e){}let f=Array.isArray(n)?[]:{},p=0,g=(0,i.Sh)(n);for(let t in g){if(!Object.prototype.hasOwnProperty.call(g,t))continue;if(p>=a){f[t]="[MaxProperties ~]";break}let n=g[t];f[t]=e(t,n,h-1,a,u),p++}return c(n),f}("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}},27179:function(e,t,n){"use strict";n.d(t,{$Q:function(){return c},HK:function(){return d},Jr:function(){return y},Sh:function(){return f},_j:function(){return h},hl:function(){return u},xp:function(){return l},zf:function(){return m}});var r=n(1869),i=n(1525),o=n(16824),s=n(41001),a=n(89163);function u(e,t,n){if(!(t in e))return;let r=e[t],i=n(r);"function"==typeof i&&c(i,r),e[t]=i}function l(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(n){i.X&&s.kg.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function c(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,l(e,"__sentry_original__",t)}catch(e){}}function d(e){return e.__sentry_original__}function h(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function f(e){if((0,o.VZ)(e))return{message:e.message,name:e.name,stack:e.stack,...g(e)};if(!(0,o.cO)(e))return e;{let t={type:e.type,target:p(e.target),currentTarget:p(e.currentTarget),...g(e)};return"undefined"!=typeof CustomEvent&&(0,o.V9)(e,CustomEvent)&&(t.detail=e.detail),t}}function p(e){try{return(0,o.kK)(e)?(0,r.Rt)(e):Object.prototype.toString.call(e)}catch(e){return"<unknown>"}}function g(e){if("object"!=typeof e||null===e)return{};{let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}}function m(e,t=40){let n=Object.keys(f(e));n.sort();let r=n[0];if(!r)return"[object has no keys]";if(r.length>=t)return(0,a.$G)(r,t);for(let e=n.length;e>0;e--){let r=n.slice(0,e).join(", ");if(!(r.length>t)){if(e===n.length)return r;return(0,a.$G)(r,t)}}return""}function y(e){return function e(t,n){if(function(e){if(!(0,o.PO)(e))return!1;try{let t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch(e){return!0}}(t)){let r=n.get(t);if(void 0!==r)return r;let i={};for(let r of(n.set(t,i),Object.getOwnPropertyNames(t)))void 0!==t[r]&&(i[r]=e(t[r],n));return i}if(Array.isArray(t)){let r=n.get(t);if(void 0!==r)return r;let i=[];return n.set(t,i),t.forEach(t=>{i.push(e(t,n))}),i}return t}(e,new Map)}},19548:function(e,t,n){"use strict";n.d(t,{Q:function(){return i}});var r=n(41982);function i(){return{traceId:(0,r.DM)(),spanId:(0,r.DM)().substring(16)}}},42283:function(e,t,n){"use strict";n.d(t,{$P:function(){return c},Fi:function(){return r},Fr:function(){return d},Sq:function(){return a},pE:function(){return s}});let r="?",i=/\(error: (.*)\)/,o=/captureMessage|captureException/;function s(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,s=0)=>{let a=[],l=e.split("\n");for(let e=n;e<l.length;e++){let n=l[e];if(n.length>1024)continue;let r=i.test(n)?n.replace(i,"$1"):n;if(!r.match(/\S*Error: /)){for(let e of t){let t=e(r);if(t){a.push(t);break}}if(a.length>=50+s)break}}return function(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(u(t).function||"")&&t.pop(),t.reverse(),o.test(u(t).function||"")&&(t.pop(),o.test(u(t).function||"")&&t.pop()),t.slice(0,50).map(e=>({...e,filename:e.filename||u(t).filename,function:e.function||r}))}(a.slice(s))}}function a(e){return Array.isArray(e)?s(...e):e}function u(e){return e[e.length-1]||{}}let l="<anonymous>";function c(e){try{if(!e||"function"!=typeof e)return l;return e.name||l}catch(e){return l}}function d(e){let t=e.exception;if(t){let e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch(e){}}}},89163:function(e,t,n){"use strict";n.d(t,{$G:function(){return i},U0:function(){return s},nK:function(){return o}});var r=n(16824);function i(e,t=0){return"string"!=typeof e||0===t?e:e.length<=t?e:`${e.slice(0,t)}...`}function o(e,t){if(!Array.isArray(e))return"";let n=[];for(let t=0;t<e.length;t++){let i=e[t];try{(0,r.y1)(i)?n.push("[VueViewModel]"):n.push(String(i))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}function s(e,t=[],n=!1){return t.some(t=>(function(e,t,n=!1){return!!(0,r.HD)(e)&&((0,r.Kj)(t)?t.test(e):!!(0,r.HD)(t)&&(n?e===t:e.includes(t)))})(e,t,n))}},80128:function(e,t,n){"use strict";n.d(t,{$2:function(){return a},WD:function(){return s},cW:function(){return u}});var r,i,o=n(16824);function s(e){return new u(t=>{t(e)})}function a(e){return new u((t,n)=>{n(e)})}(r=i||(i={}))[r.PENDING=0]="PENDING",r[r.RESOLVED=1]="RESOLVED",r[r.REJECTED=2]="REJECTED";class u{constructor(e){u.prototype.__init.call(this),u.prototype.__init2.call(this),u.prototype.__init3.call(this),u.prototype.__init4.call(this),this._state=i.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new u((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new u((t,n)=>{let r,i;return this.then(t=>{i=!1,r=t,e&&e()},t=>{i=!0,r=t,e&&e()}).then(()=>{if(i){n(r);return}t(r)})})}__init(){this._resolve=e=>{this._setResult(i.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(i.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===i.PENDING){if((0,o.J8)(t)){t.then(this._resolve,this._reject);return}this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===i.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===i.RESOLVED&&e[1](this._value),this._state===i.REJECTED&&e[2](this._value),e[0]=!0)})}}}},26181:function(e,t,n){"use strict";n.d(t,{Z1:function(){return s},ph:function(){return o},yW:function(){return i}});var r=n(29531);function i(){return Date.now()/1e3}let o=function(){let{performance:e}=r.GLOBAL_OBJ;if(!e||!e.now)return i;let t=Date.now()-e.now(),n=void 0==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/1e3}(),s=(()=>{let{performance:e}=r.GLOBAL_OBJ;if(!e||!e.now)return;let t=e.now(),n=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+t-n):36e5,o=e.timing&&e.timing.navigationStart,s="number"==typeof o?Math.abs(o+t-n):36e5;return i<36e5||s<36e5?i<=s?e.timeOrigin:o:n})()},85712:function(e,t,n){"use strict";n.d(t,{$p:function(){return a},pT:function(){return s}});var r=n(60859),i=n(41982);let o=RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function s(e,t){let n=function(e){let t;if(!e)return;let n=e.match(o);if(n)return"1"===n[3]?t=!0:"0"===n[3]&&(t=!1),{traceId:n[1],parentSampled:t,parentSpanId:n[2]}}(e),s=(0,r.EN)(t),{traceId:a,parentSpanId:u,parentSampled:l}=n||{};return n?{traceId:a||(0,i.DM)(),parentSpanId:u||(0,i.DM)().substring(16),spanId:(0,i.DM)().substring(16),sampled:l,dsc:s||{}}:{traceId:a||(0,i.DM)(),spanId:(0,i.DM)().substring(16)}}function a(e=(0,i.DM)(),t=(0,i.DM)().substring(16),n){let r="";return void 0!==n&&(r=n?"-1":"-0"),`${e}-${t}${r}`}},42990:function(e,t,n){"use strict";n.d(t,{J:function(){return r}});let r="8.35.0"},29531:function(e,t,n){"use strict";n.d(t,{GLOBAL_OBJ:function(){return i},Y:function(){return o}});var r=n(42990);let i=globalThis;function o(e,t,n){let o=n||i,s=o.__SENTRY__=o.__SENTRY__||{},a=s[r.J]=s[r.J]||{};return a[e]||(a[e]=t())}},53059:function(e,t,n){"use strict";let r,i,o,s;n.d(t,{IH:function(){return eS},Gb:function(){return eE},Kz:function(){return ek}});var a=n(32238),u=n(53333),l=n(74444),c=n(8463),d=n(26531);let h="@firebase/installations",f="0.6.4",p=`w:${f}`,g="FIS_v2",m=new l.LL("installations","Installations",{"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."});function y(e){return e instanceof l.ZR&&e.code.includes("request-failed")}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function v({projectId:e}){return`https://firebaseinstallations.googleapis.com/v1/projects/${e}/installations`}function _(e){return{token:e.token,requestStatus:2,expiresIn:Number(e.expiresIn.replace("s","000")),creationTime:Date.now()}}async function b(e,t){let n=(await t.json()).error;return m.create("request-failed",{requestName:e,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function w({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}async function S(e){let t=await e();return t.status>=500&&t.status<600?e():t}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function E({appConfig:e,heartbeatServiceProvider:t},{fid:n}){let r=v(e),i=w(e),o=t.getImmediate({optional:!0});if(o){let e=await o.getHeartbeatsHeader();e&&i.append("x-firebase-client",e)}let s={method:"POST",headers:i,body:JSON.stringify({fid:n,authVersion:g,appId:e.appId,sdkVersion:p})},a=await S(()=>fetch(r,s));if(a.ok){let e=await a.json();return{fid:e.fid||n,registrationStatus:2,refreshToken:e.refreshToken,authToken:_(e.authToken)}}throw await b("Create Installation",a)}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function k(e){return new Promise(t=>{setTimeout(t,e)})}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let I=/^[cdef][\w-]{21}$/;/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function T(e){return`${e.appName}!${e.appId}`}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let x=new Map;function C(e,t){let n=T(e);A(n,t),function(e,t){let n=(!O&&"BroadcastChannel"in self&&((O=new BroadcastChannel("[Firebase] FID Change")).onmessage=e=>{A(e.data.key,e.data.fid)}),O);n&&n.postMessage({key:e,fid:t}),0===x.size&&O&&(O.close(),O=null)}(n,t)}function A(e,t){let n=x.get(e);if(n)for(let e of n)e(t)}let O=null,N="firebase-installations-store",R=null;function D(){return R||(R=(0,d.X3)("firebase-installations-database",1,{upgrade:(e,t)=>{0===t&&e.createObjectStore(N)}})),R}async function P(e,t){let n=T(e),r=(await D()).transaction(N,"readwrite"),i=r.objectStore(N),o=await i.get(n);return await i.put(t,n),await r.done,o&&o.fid===t.fid||C(e,t.fid),t}async function M(e){let t=T(e),n=(await D()).transaction(N,"readwrite");await n.objectStore(N).delete(t),await n.done}async function L(e,t){let n=T(e),r=(await D()).transaction(N,"readwrite"),i=r.objectStore(N),o=await i.get(n),s=t(o);return void 0===s?await i.delete(n):await i.put(s,n),await r.done,s&&(!o||o.fid!==s.fid)&&C(e,s.fid),s}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function U(e){let t;let n=await L(e.appConfig,n=>{let r=function(e,t){if(0===t.registrationStatus){if(!navigator.onLine)return{installationEntry:t,registrationPromise:Promise.reject(m.create("app-offline"))};let n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},r=j(e,n);return{installationEntry:n,registrationPromise:r}}return 1===t.registrationStatus?{installationEntry:t,registrationPromise:q(e)}:{installationEntry:t}}(e,$(n||{fid:function(){try{let e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;let t=btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").substr(0,22);return I.test(t)?t:""}catch(e){return""}}(),registrationStatus:0}));return t=r.registrationPromise,r.installationEntry});return""===n.fid?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}async function j(e,t){try{let n=await E(e,t);return P(e.appConfig,n)}catch(n){throw y(n)&&409===n.customData.serverCode?await M(e.appConfig):await P(e.appConfig,{fid:t.fid,registrationStatus:0}),n}}async function q(e){let t=await F(e.appConfig);for(;1===t.registrationStatus;)await k(100),t=await F(e.appConfig);if(0===t.registrationStatus){let{installationEntry:t,registrationPromise:n}=await U(e);return n||t}return t}function F(e){return L(e,e=>{if(!e)throw m.create("installation-not-found");return $(e)})}function $(e){return 1===e.registrationStatus&&e.registrationTime+1e4<Date.now()?{fid:e.fid,registrationStatus:0}:e}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function B({appConfig:e,heartbeatServiceProvider:t},n){let r=function(e,{fid:t}){return`${v(e)}/${t}/authTokens:generate`}(e,n),i=function(e,{refreshToken:t}){let n=w(e);return n.append("Authorization",`${g} ${t}`),n}(e,n),o=t.getImmediate({optional:!0});if(o){let e=await o.getHeartbeatsHeader();e&&i.append("x-firebase-client",e)}let s={method:"POST",headers:i,body:JSON.stringify({installation:{sdkVersion:p,appId:e.appId}})},a=await S(()=>fetch(r,s));if(a.ok)return _(await a.json());throw await b("Generate Auth Token",a)}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function z(e,t=!1){let n;let r=await L(e.appConfig,r=>{var i;if(!H(r))throw m.create("not-registered");let o=r.authToken;if(!t&&2===(i=o).requestStatus&&!function(e){let t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+36e5}(i))return r;if(1===o.requestStatus)return n=V(e,t),r;{if(!navigator.onLine)throw m.create("app-offline");let t=function(e){let t={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},e),{authToken:t})}(r);return n=W(e,t),t}});return n?await n:r.authToken}async function V(e,t){let n=await G(e.appConfig);for(;1===n.authToken.requestStatus;)await k(100),n=await G(e.appConfig);let r=n.authToken;return 0===r.requestStatus?z(e,t):r}function G(e){return L(e,e=>{var t;if(!H(e))throw m.create("not-registered");return 1===(t=e.authToken).requestStatus&&t.requestTime+1e4<Date.now()?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}async function W(e,t){try{let n=await B(e,t),r=Object.assign(Object.assign({},t),{authToken:n});return await P(e.appConfig,r),n}catch(n){if(y(n)&&(401===n.customData.serverCode||404===n.customData.serverCode))await M(e.appConfig);else{let n=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await P(e.appConfig,n)}throw n}}function H(e){return void 0!==e&&2===e.registrationStatus}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function K(e){let{installationEntry:t,registrationPromise:n}=await U(e);return n?n.catch(console.error):z(e).catch(console.error),t.fid}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function J(e,t=!1){return await X(e),(await z(e,t)).token}async function X(e){let{registrationPromise:t}=await U(e);t&&await t}function Q(e){return m.create("missing-app-config-values",{valueName:e})}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Z="installations";(0,a.Xd)(new c.wA(Z,e=>{let t=e.getProvider("app").getImmediate(),n=/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e){if(!e||!e.options)throw Q("App Configuration");if(!e.name)throw Q("App Name");for(let t of["projectId","apiKey","appId"])if(!e.options[t])throw Q(t);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}(t),r=(0,a.qX)(t,"heartbeat");return{app:t,appConfig:n,heartbeatServiceProvider:r,_delete:()=>Promise.resolve()}},"PUBLIC")),(0,a.Xd)(new c.wA("installations-internal",e=>{let t=e.getProvider("app").getImmediate(),n=(0,a.qX)(t,Z).getImmediate();return{getId:()=>K(n),getToken:e=>J(n,e)}},"PRIVATE")),(0,a.KN)(h,f),(0,a.KN)(h,f,"esm2017");/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Y="analytics",ee="https://www.googletagmanager.com/gtag/js",et=new u.Yd("@firebase/analytics"),en=new l.LL("analytics","Analytics",{"already-exists":"A Firebase Analytics instance with the appId {$id}  already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-intialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',"invalid-gtag-resource":"Trusted Types detected an invalid gtag resource: {$gtagURL}."});/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function er(e){if(!e.startsWith(ee)){let t=en.create("invalid-gtag-resource",{gtagURL:e});return et.warn(t.message),""}return e}function ei(e){return Promise.all(e.map(e=>e.catch(e=>e)))}async function eo(e,t,n,r,i,o){let s=r[i];try{if(s)await t[s];else{let e=(await ei(n)).find(e=>e.measurementId===i);e&&await t[e.appId]}}catch(e){et.error(e)}e("config",i,o)}async function es(e,t,n,r,i){try{let o=[];if(i&&i.send_to){let e=i.send_to;Array.isArray(e)||(e=[e]);let r=await ei(n);for(let n of e){let e=r.find(e=>e.measurementId===n),i=e&&t[e.appId];if(i)o.push(i);else{o=[];break}}}0===o.length&&(o=Object.values(t)),await Promise.all(o),e("event",r,i||{})}catch(e){et.error(e)}}class ea{constructor(e={},t=1e3){this.throttleMetadata=e,this.intervalMillis=t}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,t){this.throttleMetadata[e]=t}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}}let eu=new ea;async function el(e){var t;let{appId:n,apiKey:r}=e,i={method:"GET",headers:new Headers({Accept:"application/json","x-goog-api-key":r})},o="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",n),s=await fetch(o,i);if(200!==s.status&&304!==s.status){let e="";try{let n=await s.json();(null===(t=n.error)||void 0===t?void 0:t.message)&&(e=n.error.message)}catch(e){}throw en.create("config-fetch-failed",{httpStatus:s.status,responseMessage:e})}return s.json()}async function ec(e,t=eu,n){let{appId:r,apiKey:i,measurementId:o}=e.options;if(!r)throw en.create("no-app-id");if(!i){if(o)return{measurementId:o,appId:r};throw en.create("no-api-key")}let s=t.getThrottleMetadata(r)||{backoffCount:0,throttleEndTimeMillis:Date.now()},a=new eh;return setTimeout(async()=>{a.abort()},void 0!==n?n:6e4),ed({appId:r,apiKey:i,measurementId:o},s,a,t)}async function ed(e,{throttleEndTimeMillis:t,backoffCount:n},r,i=eu){var o;let{appId:s,measurementId:a}=e;try{await new Promise((e,n)=>{let i=setTimeout(e,Math.max(t-Date.now(),0));r.addEventListener(()=>{clearTimeout(i),n(en.create("fetch-throttle",{throttleEndTimeMillis:t}))})})}catch(e){if(a)return et.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${null==e?void 0:e.message}]`),{appId:s,measurementId:a};throw e}try{let t=await el(e);return i.deleteThrottleMetadata(s),t}catch(c){if(!function(e){if(!(e instanceof l.ZR)||!e.customData)return!1;let t=Number(e.customData.httpStatus);return 429===t||500===t||503===t||504===t}(c)){if(i.deleteThrottleMetadata(s),a)return et.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${a} provided in the "measurementId" field in the local Firebase config. [${null==c?void 0:c.message}]`),{appId:s,measurementId:a};throw c}let t=503===Number(null===(o=null==c?void 0:c.customData)||void 0===o?void 0:o.httpStatus)?(0,l.$s)(n,i.intervalMillis,30):(0,l.$s)(n,i.intervalMillis),u={throttleEndTimeMillis:Date.now()+t,backoffCount:n+1};return i.setThrottleMetadata(s,u),et.debug(`Calling attemptFetch again in ${t} millis`),ed(e,u,r,i)}}class eh{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach(e=>e())}}async function ef(e,t,n,r,i){if(i&&i.global){e("event",n,r);return}{let i=await t;e("event",n,Object.assign(Object.assign({},r),{send_to:i}))}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function ep(){if(!(0,l.hl)())return et.warn(en.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await (0,l.eu)()}catch(e){return et.warn(en.create("indexeddb-unavailable",{errorInfo:null==e?void 0:e.toString()}).message),!1}return!0}async function eg(e,t,n,o,s,a,u){var l;let c=ec(e);c.then(t=>{n[t.measurementId]=t.appId,e.options.measurementId&&t.measurementId!==e.options.measurementId&&et.warn(`The measurement ID in the local Firebase config (${e.options.measurementId}) does not match the measurement ID fetched from the server (${t.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)}).catch(e=>et.error(e)),t.push(c);let d=ep().then(e=>e?o.getId():void 0),[h,f]=await Promise.all([c,d]);!function(e){for(let t of Object.values(window.document.getElementsByTagName("script")))if(t.src&&t.src.includes(ee)&&t.src.includes(e))return t;return null}(a)&&function(e,t){let n;let r=(window.trustedTypes&&(n=window.trustedTypes.createPolicy("firebase-js-sdk-policy",{createScriptURL:er})),n),i=document.createElement("script"),o=`${ee}?l=${e}&id=${t}`;i.src=r?null==r?void 0:r.createScriptURL(o):o,i.async=!0,document.head.appendChild(i)}(a,h.measurementId),i&&(s("consent","default",i),i=void 0),s("js",new Date);let p=null!==(l=null==u?void 0:u.config)&&void 0!==l?l:{};return p.origin="firebase",p.update=!0,null!=f&&(p.firebase_id=f),s("config",h.measurementId,p),r&&(s("set",r),r=void 0),h.measurementId}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class em{constructor(e){this.app=e}_delete(){return delete ey[this.app.options.appId],Promise.resolve()}}let ey={},ev=[],e_={},eb="dataLayer",ew=!1;function eS(e=(0,a.Mq)()){e=(0,l.m9)(e);let t=(0,a.qX)(e,Y);return t.isInitialized()?t.getImmediate():function(e,t={}){let n=(0,a.qX)(e,Y);if(n.isInitialized()){let e=n.getImmediate();if((0,l.vZ)(t,n.getOptions()))return e;throw en.create("already-initialized")}return n.initialize({options:t})}(e)}async function eE(){if((0,l.ru)()||!(0,l.zI)()||!(0,l.hl)())return!1;try{return await (0,l.eu)()}catch(e){return!1}}function ek(e,t,n,r){e=(0,l.m9)(e),ef(s,ey[e.app.options.appId],t,n,r).catch(e=>et.error(e))}let eI="@firebase/analytics",eT="0.9.5";(0,a.Xd)(new c.wA(Y,(e,{options:t})=>(function(e,t,n){!function(){let e=[];if((0,l.ru)()&&e.push("This is a browser extension environment."),(0,l.zI)()||e.push("Cookies are not available."),e.length>0){let t=e.map((e,t)=>`(${t+1}) ${e}`).join(" "),n=en.create("invalid-analytics-context",{errorInfo:t});et.warn(n.message)}}();let r=e.options.appId;if(!r)throw en.create("no-app-id");if(!e.options.apiKey){if(e.options.measurementId)et.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${e.options.measurementId} provided in the "measurementId" field in the local Firebase config.`);else throw en.create("no-api-key")}if(null!=ey[r])throw en.create("already-exists",{id:r});if(!ew){var i,a;let e,t;e=[],Array.isArray(window[eb])?e=window[eb]:window[eb]=e;let{wrappedGtag:n,gtagCore:r}=(i="gtag",t=function(...e){window[eb].push(arguments)},window[i]&&"function"==typeof window[i]&&(t=window[i]),window[i]=(a=t,async function(e,t,n){try{"event"===e?await es(a,ey,ev,t,n):"config"===e?await eo(a,ey,ev,e_,t,n):"consent"===e?a("consent","update",n):a("set",t)}catch(e){et.error(e)}}),{gtagCore:t,wrappedGtag:window[i]});s=n,o=r,ew=!0}return ey[r]=eg(e,ev,e_,t,o,eb,n),new em(e)})(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),t),"PUBLIC")),(0,a.Xd)(new c.wA("analytics-internal",function(e){try{let t=e.getProvider(Y).getImmediate();return{logEvent:(e,n,r)=>ek(t,e,n,r)}}catch(e){throw en.create("interop-component-reg-failed",{reason:e})}},"PRIVATE")),(0,a.KN)(eI,eT),(0,a.KN)(eI,eT,"esm2017")},49635:function(e,t,n){"use strict";n.d(t,{hJ:function(){return ej},S$:function(){return ep},Xb:function(){return eQ},v0:function(){return t5},LS:function(){return eX},e5:function(){return eZ},rh:function(){return tb},w7:function(){return eY}});var r,i=n(74444),o=n(32238),s=n(53333);function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var u=n(8463);function l(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}let c=new i.LL("auth","Firebase",l()),d=new s.Yd("@firebase/auth");function h(e,...t){d.logLevel<=s.in.ERROR&&d.error(`Auth (${o.Jn}): ${e}`,...t)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function f(e,...t){throw m(e,...t)}function p(e,...t){return m(e,...t)}function g(e,t,n){let r=Object.assign(Object.assign({},l()),{[t]:n});return new i.LL("auth","Firebase",r).create(t,{appName:e.name})}function m(e,...t){if("string"!=typeof e){let n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return c.create(e,...t)}function y(e,t,...n){if(!e)throw m(t,...n)}function v(e){let t="INTERNAL ASSERTION FAILED: "+e;throw h(t),Error(t)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let _=new Map;function b(e){e instanceof Function||v("Expected a class definition");let t=_.get(e);return t?t instanceof e||v("Instance stored in cache mismatched with class"):(t=new e,_.set(e,t)),t}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function w(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function S(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class E{constructor(e,t){this.shortDelay=e,this.longDelay=t,t>e||v("Short delay should be less than long delay!"),this.isMobile=(0,i.uI)()||(0,i.b$)()}get(){return!("undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&("http:"===S()||"https:"===S()||(0,i.ru)()||"connection"in navigator))||navigator.onLine?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function k(e,t){e.emulator||v("Emulator should always be set here");let{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class I{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:void v("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:void v("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:void v("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let T={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error"},x=new E(3e4,6e4);function C(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function A(e,t,n,r,o={}){return O(e,o,async()=>{let o={},s={};r&&("GET"===t?s=r:o={body:JSON.stringify(r)});let a=(0,i.xO)(Object.assign({key:e.config.apiKey},s)).slice(1),u=await e._getAdditionalHeaders();return u["Content-Type"]="application/json",e.languageCode&&(u["X-Firebase-Locale"]=e.languageCode),I.fetch()(R(e,e.config.apiHost,n,a),Object.assign({method:t,headers:u,referrerPolicy:"no-referrer"},o))})}async function O(e,t,n){e._canInitEmulator=!1;let r=Object.assign(Object.assign({},T),t);try{let t=new D(e),i=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();let o=await i.json();if("needConfirmation"in o)throw P(e,"account-exists-with-different-credential",o);if(i.ok&&!("errorMessage"in o))return o;{let[t,n]=(i.ok?o.errorMessage:o.error.message).split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===t)throw P(e,"credential-already-in-use",o);if("EMAIL_EXISTS"===t)throw P(e,"email-already-in-use",o);if("USER_DISABLED"===t)throw P(e,"user-disabled",o);let s=r[t]||t.toLowerCase().replace(/[_\s]+/g,"-");if(n)throw g(e,s,n);f(e,s)}}catch(t){if(t instanceof i.ZR)throw t;f(e,"network-request-failed",{message:String(t)})}}async function N(e,t,n,r,i={}){let o=await A(e,t,n,r,i);return"mfaPendingCredential"in o&&f(e,"multi-factor-auth-required",{_serverResponse:o}),o}function R(e,t,n,r){let i=`${t}${n}?${r}`;return e.config.emulator?k(e.config,i):`${e.config.apiScheme}://${i}`}class D{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>{this.timer=setTimeout(()=>t(p(this.auth,"network-request-failed")),x.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function P(e,t,n){let r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);let i=p(e,t,r);return i.customData._tokenResponse=n,i}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function M(e,t){return A(e,"POST","/v1/accounts:delete",t)}async function L(e,t){return A(e,"POST","/v1/accounts:lookup",t)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function U(e){if(e)try{let t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}async function j(e,t=!1){let n=(0,i.m9)(e),r=await n.getIdToken(t),o=F(r);y(o&&o.exp&&o.auth_time&&o.iat,n.auth,"internal-error");let s="object"==typeof o.firebase?o.firebase:void 0,a=null==s?void 0:s.sign_in_provider;return{claims:o,token:r,authTime:U(q(o.auth_time)),issuedAtTime:U(q(o.iat)),expirationTime:U(q(o.exp)),signInProvider:a||null,signInSecondFactor:(null==s?void 0:s.sign_in_second_factor)||null}}function q(e){return 1e3*Number(e)}function F(e){let[t,n,r]=e.split(".");if(void 0===t||void 0===n||void 0===r)return h("JWT malformed, contained fewer than 3 sections"),null;try{let e=(0,i.tV)(n);if(!e)return h("Failed to decode base64 JWT payload"),null;return JSON.parse(e)}catch(e){return h("Caught error parsing JWT payload as JSON",null==e?void 0:e.toString()),null}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function $(e,t,n=!1){if(n)return t;try{return await t}catch(t){throw t instanceof i.ZR&&function({code:e}){return"auth/user-disabled"===e||"auth/user-token-expired"===e}(t)&&e.auth.currentUser===e&&await e.auth.signOut(),t}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class B{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){var t;if(!e)return this.errorBackoff=3e4,Math.max(0,(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5);{let e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}}schedule(e=!1){if(!this.isRunning)return;let t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(null==e?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class z{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=U(this.lastLoginAt),this.creationTime=U(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function V(e){var t;let n=e.auth,r=await e.getIdToken(),i=await $(e,L(n,{idToken:r}));y(null==i?void 0:i.users.length,n,"internal-error");let o=i.users[0];e._notifyReloadListener(o);let s=(null===(t=o.providerUserInfo)||void 0===t?void 0:t.length)?o.providerUserInfo.map(e=>{var{providerId:t}=e,n=a(e,["providerId"]);return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}}):[],u=[...e.providerData.filter(e=>!s.some(t=>t.providerId===e.providerId)),...s],l=e.isAnonymous,c=!(e.email&&o.passwordHash)&&!(null==u?void 0:u.length);Object.assign(e,{uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:u,metadata:new z(o.createdAt,o.lastLoginAt),isAnonymous:!!l&&c})}async function G(e){let t=(0,i.m9)(e);await V(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function W(e,t){let n=await O(e,{},async()=>{let n=(0,i.xO)({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:r,apiKey:o}=e.config,s=R(e,r,"/v1/token",`key=${o}`),a=await e._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",I.fetch()(s,{method:"POST",headers:a,body:n})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class H{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){y(e.idToken,"internal-error"),y(void 0!==e.idToken,"internal-error"),y(void 0!==e.refreshToken,"internal-error");let t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):function(e){let t=F(e);return y(t,"internal-error"),y(void 0!==t.exp,"internal-error"),y(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}async getToken(e,t=!1){return(y(!this.accessToken||this.refreshToken,e,"user-token-expired"),t||!this.accessToken||this.isExpired)?this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null:this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){let{accessToken:n,refreshToken:r,expiresIn:i}=await W(e,t);this.updateTokensAndExpiration(n,r,Number(i))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){let{refreshToken:n,accessToken:r,expirationTime:i}=t,o=new H;return n&&(y("string"==typeof n,"internal-error",{appName:e}),o.refreshToken=n),r&&(y("string"==typeof r,"internal-error",{appName:e}),o.accessToken=r),i&&(y("number"==typeof i,"internal-error",{appName:e}),o.expirationTime=i),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new H,this.toJSON())}_performRefresh(){return v("not implemented")}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function K(e,t){y("string"==typeof e||void 0===e,"internal-error",{appName:t})}class J{constructor(e){var{uid:t,auth:n,stsTokenManager:r}=e,i=a(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new B(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new z(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){let t=await $(this,this.stsTokenManager.getToken(this.auth,e));return y(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return j(this,e)}reload(){return G(this)}_assign(e){this!==e&&(y(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(e=>Object.assign({},e)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){let t=new J(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){y(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await V(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){let e=await this.getIdToken();return await $(this,M(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var n,r,i,o,s,a,u,l;let c=null!==(n=t.displayName)&&void 0!==n?n:void 0,d=null!==(r=t.email)&&void 0!==r?r:void 0,h=null!==(i=t.phoneNumber)&&void 0!==i?i:void 0,f=null!==(o=t.photoURL)&&void 0!==o?o:void 0,p=null!==(s=t.tenantId)&&void 0!==s?s:void 0,g=null!==(a=t._redirectEventId)&&void 0!==a?a:void 0,m=null!==(u=t.createdAt)&&void 0!==u?u:void 0,v=null!==(l=t.lastLoginAt)&&void 0!==l?l:void 0,{uid:_,emailVerified:b,isAnonymous:w,providerData:S,stsTokenManager:E}=t;y(_&&E,e,"internal-error");let k=H.fromJSON(this.name,E);y("string"==typeof _,e,"internal-error"),K(c,e.name),K(d,e.name),y("boolean"==typeof b,e,"internal-error"),y("boolean"==typeof w,e,"internal-error"),K(h,e.name),K(f,e.name),K(p,e.name),K(g,e.name),K(m,e.name),K(v,e.name);let I=new J({uid:_,auth:e,email:d,emailVerified:b,displayName:c,isAnonymous:w,photoURL:f,phoneNumber:h,tenantId:p,stsTokenManager:k,createdAt:m,lastLoginAt:v});return S&&Array.isArray(S)&&(I.providerData=S.map(e=>Object.assign({},e))),g&&(I._redirectEventId=g),I}static async _fromIdTokenResponse(e,t,n=!1){let r=new H;r.updateFromServerResponse(t);let i=new J({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:n});return await V(i),i}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class X{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){let t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function Q(e,t,n){return`firebase:${e}:${t}:${n}`}X.type="NONE";class Z{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;let{config:r,name:i}=this.auth;this.fullUserKey=Q(this.userKey,r.apiKey,i),this.fullPersistenceKey=Q("persistence",r.apiKey,i),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){let e=await this.persistence._get(this.fullUserKey);return e?J._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;let t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,n="authUser"){if(!t.length)return new Z(b(X),e,n);let r=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e),i=r[0]||b(X),o=Q(n,e.config.apiKey,e.name),s=null;for(let n of t)try{let t=await n._get(o);if(t){let r=J._fromJSON(e,t);n!==i&&(s=r),i=n;break}}catch(e){}let a=r.filter(e=>e._shouldAllowMigration);return i._shouldAllowMigration&&a.length&&(i=a[0],s&&await i._set(o,s.toJSON()),await Promise.all(t.map(async e=>{if(e!==i)try{await e._remove(o)}catch(e){}}))),new Z(i,e,n)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function Y(e){let t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(er(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";{if(t.includes("edge/"))return"Edge";if(ee(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(eo(t))return"Blackberry";if(es(t))return"Webos";if(et(t))return"Safari";if((t.includes("chrome/")||en(t))&&!t.includes("edge/"))return"Chrome";if(ei(t))return"Android";let n=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);if((null==n?void 0:n.length)===2)return n[1]}return"Other"}function ee(e=(0,i.z$)()){return/firefox\//i.test(e)}function et(e=(0,i.z$)()){let t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function en(e=(0,i.z$)()){return/crios\//i.test(e)}function er(e=(0,i.z$)()){return/iemobile/i.test(e)}function ei(e=(0,i.z$)()){return/android/i.test(e)}function eo(e=(0,i.z$)()){return/blackberry/i.test(e)}function es(e=(0,i.z$)()){return/webos/i.test(e)}function ea(e=(0,i.z$)()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function eu(e=(0,i.z$)()){return ea(e)||ei(e)||es(e)||eo(e)||/windows phone/i.test(e)||er(e)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function el(e,t=[]){let n;switch(e){case"Browser":n=Y((0,i.z$)());break;case"Worker":n=`${Y((0,i.z$)())}-${e}`;break;default:n=e}let r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${o.Jn}/${r}`}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ec{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){let n=t=>new Promise((n,r)=>{try{let r=e(t);n(r)}catch(e){r(e)}});n.onAbort=t,this.queue.push(n);let r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;let t=[];try{for(let n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(e){for(let e of(t.reverse(),t))try{e()}catch(e){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null==e?void 0:e.message})}}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ed{constructor(e,t,n){this.app=e,this.heartbeatServiceProvider=t,this.config=n,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new ef(this),this.idTokenSubscription=new ef(this),this.beforeStateQueue=new ec(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=c,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=n.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=b(t)),this._initializationPromise=this.queue(async()=>{var n,r;if(!this._deleted&&(this.persistenceManager=await Z.create(this,e),!this._deleted)){if(null===(n=this._popupRedirectResolver)||void 0===n?void 0:n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(e){}await this.initializeCurrentUser(t),this.lastNotifiedUid=(null===(r=this.currentUser)||void 0===r?void 0:r.uid)||null,this._deleted||(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;let e=await this.assertedPersistence.getCurrentUser();if(this.currentUser||e){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUser(e){var t;let n=await this.assertedPersistence.getCurrentUser(),r=n,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();let n=null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId,o=null==r?void 0:r._redirectEventId,s=await this.tryRedirectSignIn(e);(!n||n===o)&&(null==s?void 0:s.user)&&(r=s.user,i=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(r)}catch(e){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(e))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return(y(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId)?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(e){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await V(e)}catch(e){if((null==e?void 0:e.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;let e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){let t=e?(0,i.m9)(e):null;return t&&y(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&y(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(e){return this.queue(async()=>{await this.assertedPersistence.setPersistence(b(e))})}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new i.LL("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}async _setRedirectUser(e,t){let n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){let t=e&&b(e)||this._popupRedirectResolver;y(t,this,"argument-error"),this.redirectPersistenceManager=await Z.create(this,[b(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,n;return(this._isInitialized&&await this.queue(async()=>{}),(null===(t=this._currentUser)||void 0===t?void 0:t._redirectEventId)===e)?this._currentUser:(null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);let n=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,r){if(this._deleted)return()=>{};let i="function"==typeof t?t:t.next.bind(t),o=this._isInitialized?Promise.resolve():this._initializationPromise;return(y(o,this,"internal-error"),o.then(()=>i(this.currentUser)),"function"==typeof t)?e.addObserver(t,n,r):e.addObserver(t)}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return y(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=el(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;let t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);let n=await (null===(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getHeartbeatsHeader());return n&&(t["X-Firebase-Client"]=n),t}}function eh(e){return(0,i.m9)(e)}class ef{constructor(e){this.auth=e,this.observer=null,this.addObserver=(0,i.ne)(e=>this.observer=e)}get next(){return y(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}function ep(e,t,n){let r=eh(e);y(r._canInitEmulator,r,"emulator-config-failed"),y(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");let i=!!(null==n?void 0:n.disableWarnings),o=eg(t),{host:s,port:a}=function(e){let t=eg(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};let r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){let e=i[1];return{host:e,port:em(r.substr(e.length+1))}}{let[e,t]=r.split(":");return{host:e,port:em(t)}}}(t),u=null===a?"":`:${a}`;r.config.emulator={url:`${o}//${s}${u}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:s,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||function(){function e(){let e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!=typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials."),"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}function eg(e){let t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function em(e){if(!e)return null;let t=Number(e);return isNaN(t)?null:t}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ey{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return v("not implemented")}_getIdTokenResponse(e){return v("not implemented")}_linkToIdToken(e,t){return v("not implemented")}_getReauthenticationResolver(e){return v("not implemented")}}async function ev(e,t){return A(e,"POST","/v1/accounts:update",t)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function e_(e,t){return N(e,"POST","/v1/accounts:signInWithPassword",C(e,t))}async function eb(e,t){return A(e,"POST","/v1/accounts:sendOobCode",C(e,t))}async function ew(e,t){return eb(e,t)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function eS(e,t){return N(e,"POST","/v1/accounts:signInWithEmailLink",C(e,t))}async function eE(e,t){return N(e,"POST","/v1/accounts:signInWithEmailLink",C(e,t))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ek extends ey{constructor(e,t,n,r=null){super("password",n),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new ek(e,t,"password")}static _fromEmailAndCode(e,t,n=null){return new ek(e,t,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){let t="string"==typeof e?JSON.parse(e):e;if((null==t?void 0:t.email)&&(null==t?void 0:t.password)){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return e_(e,{returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return eS(e,{email:this._email,oobCode:this._password});default:f(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return ev(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return eE(e,{idToken:t,email:this._email,oobCode:this._password});default:f(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function eI(e,t){return N(e,"POST","/v1/accounts:signInWithIdp",C(e,t))}class eT extends ey{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){let t=new eT(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):f("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){let t="string"==typeof e?JSON.parse(e):e,{providerId:n,signInMethod:r}=t,i=a(t,["providerId","signInMethod"]);if(!n||!r)return null;let o=new eT(n,r);return o.idToken=i.idToken||void 0,o.accessToken=i.accessToken||void 0,o.secret=i.secret,o.nonce=i.nonce,o.pendingToken=i.pendingToken||null,o}_getIdTokenResponse(e){return eI(e,this.buildRequest())}_linkToIdToken(e,t){let n=this.buildRequest();return n.idToken=t,eI(e,n)}_getReauthenticationResolver(e){let t=this.buildRequest();return t.autoCreate=!1,eI(e,t)}buildRequest(){let e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{let t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=(0,i.xO)(t)}return e}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function ex(e,t){return A(e,"POST","/v1/accounts:sendVerificationCode",C(e,t))}async function eC(e,t){return N(e,"POST","/v1/accounts:signInWithPhoneNumber",C(e,t))}async function eA(e,t){let n=await N(e,"POST","/v1/accounts:signInWithPhoneNumber",C(e,t));if(n.temporaryProof)throw P(e,"account-exists-with-different-credential",n);return n}let eO={USER_NOT_FOUND:"user-not-found"};async function eN(e,t){return N(e,"POST","/v1/accounts:signInWithPhoneNumber",C(e,Object.assign(Object.assign({},t),{operation:"REAUTH"})),eO)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eR extends ey{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new eR({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new eR({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return eC(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return eA(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return eN(e,this._makeVerificationRequest())}_makeVerificationRequest(){let{temporaryProof:e,phoneNumber:t,verificationId:n,verificationCode:r}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:n,code:r}}toJSON(){let e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){"string"==typeof e&&(e=JSON.parse(e));let{verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}=e;return n||t||r||i?new eR({verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}):null}}class eD{constructor(e){var t,n,r,o,s,a;let u=(0,i.zd)((0,i.pd)(e)),l=null!==(t=u.apiKey)&&void 0!==t?t:null,c=null!==(n=u.oobCode)&&void 0!==n?n:null,d=/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(r=u.mode)&&void 0!==r?r:null);y(l&&c&&d,"argument-error"),this.apiKey=l,this.operation=d,this.code=c,this.continueUrl=null!==(o=u.continueUrl)&&void 0!==o?o:null,this.languageCode=null!==(s=u.languageCode)&&void 0!==s?s:null,this.tenantId=null!==(a=u.tenantId)&&void 0!==a?a:null}static parseLink(e){let t=function(e){let t=(0,i.zd)((0,i.pd)(e)).link,n=t?(0,i.zd)((0,i.pd)(t)).deep_link_id:null,r=(0,i.zd)((0,i.pd)(e)).deep_link_id;return(r?(0,i.zd)((0,i.pd)(r)).link:null)||r||n||t||e}(e);try{return new eD(t)}catch(e){return null}}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eP{constructor(){this.providerId=eP.PROVIDER_ID}static credential(e,t){return ek._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){let n=eD.parseLink(t);return y(n,"argument-error"),ek._fromEmailAndCode(e,n.code,n.tenantId)}}eP.PROVIDER_ID="password",eP.EMAIL_PASSWORD_SIGN_IN_METHOD="password",eP.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eM{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eL extends eM{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eU extends eL{constructor(){super("facebook.com")}static credential(e){return eT._fromParams({providerId:eU.PROVIDER_ID,signInMethod:eU.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return eU.credentialFromTaggedObject(e)}static credentialFromError(e){return eU.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return eU.credential(e.oauthAccessToken)}catch(e){return null}}}eU.FACEBOOK_SIGN_IN_METHOD="facebook.com",eU.PROVIDER_ID="facebook.com";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ej extends eL{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return eT._fromParams({providerId:ej.PROVIDER_ID,signInMethod:ej.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return ej.credentialFromTaggedObject(e)}static credentialFromError(e){return ej.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthIdToken:t,oauthAccessToken:n}=e;if(!t&&!n)return null;try{return ej.credential(t,n)}catch(e){return null}}}ej.GOOGLE_SIGN_IN_METHOD="google.com",ej.PROVIDER_ID="google.com";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eq extends eL{constructor(){super("github.com")}static credential(e){return eT._fromParams({providerId:eq.PROVIDER_ID,signInMethod:eq.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return eq.credentialFromTaggedObject(e)}static credentialFromError(e){return eq.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return eq.credential(e.oauthAccessToken)}catch(e){return null}}}eq.GITHUB_SIGN_IN_METHOD="github.com",eq.PROVIDER_ID="github.com";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eF extends eL{constructor(){super("twitter.com")}static credential(e,t){return eT._fromParams({providerId:eF.PROVIDER_ID,signInMethod:eF.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return eF.credentialFromTaggedObject(e)}static credentialFromError(e){return eF.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{oauthAccessToken:t,oauthTokenSecret:n}=e;if(!t||!n)return null;try{return eF.credential(t,n)}catch(e){return null}}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function e$(e,t){return N(e,"POST","/v1/accounts:signUp",C(e,t))}eF.TWITTER_SIGN_IN_METHOD="twitter.com",eF.PROVIDER_ID="twitter.com";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eB{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,n,r=!1){return new eB({user:await J._fromIdTokenResponse(e,n,r),providerId:ez(n),_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){return await e._updateTokensIfNecessary(n,!0),new eB({user:e,providerId:ez(n),_tokenResponse:n,operationType:t})}}function ez(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class eV extends i.ZR{constructor(e,t,n,r){var i;super(t.code,t.message),this.operationType=n,this.user=r,Object.setPrototypeOf(this,eV.prototype),this.customData={appName:e.name,tenantId:null!==(i=e.tenantId)&&void 0!==i?i:void 0,_serverResponse:t.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,t,n,r){return new eV(e,t,n,r)}}function eG(e,t,n,r){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(n=>{if("auth/multi-factor-auth-required"===n.code)throw eV._fromErrorAndOperation(e,n,t,r);throw n})}async function eW(e,t,n=!1){let r=await $(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return eB._forOperation(e,"link",r)}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function eH(e,t,n=!1){let{auth:r}=e,i="reauthenticate";try{let o=await $(e,eG(r,i,t,e),n);y(o.idToken,r,"internal-error");let s=F(o.idToken);y(s,r,"internal-error");let{sub:a}=s;return y(e.uid===a,r,"user-mismatch"),eB._forOperation(e,i,o)}catch(e){throw(null==e?void 0:e.code)==="auth/user-not-found"&&f(r,"user-mismatch"),e}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function eK(e,t,n=!1){let r="signIn",i=await eG(e,r,t),o=await eB._fromIdTokenResponse(e,r,i);return n||await e._updateCurrentUser(o.user),o}async function eJ(e,t){return eK(eh(e),t)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function eX(e,t,n){let r=(0,i.m9)(e),o={requestType:"PASSWORD_RESET",email:t};if(n){var s;y((null===(s=n.url)||void 0===s?void 0:s.length)>0,r,"invalid-continue-uri"),y(void 0===n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,r,"invalid-dynamic-link-domain"),o.continueUrl=n.url,o.dynamicLinkDomain=n.dynamicLinkDomain,o.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(y(n.iOS.bundleId.length>0,r,"missing-ios-bundle-id"),o.iOSBundleId=n.iOS.bundleId),n.android&&(y(n.android.packageName.length>0,r,"missing-android-pkg-name"),o.androidInstallApp=n.android.installApp,o.androidMinimumVersionCode=n.android.minimumVersion,o.androidPackageName=n.android.packageName)}await ew(r,o)}async function eQ(e,t,n){let r=eh(e),i=await e$(r,{returnSecureToken:!0,email:t,password:n}),o=await eB._fromIdTokenResponse(r,"signIn",i);return await r._updateCurrentUser(o.user),o}function eZ(e,t,n){return eJ((0,i.m9)(e),eP.credential(t,n))}function eY(e){return(0,i.m9)(e).signOut()}new WeakMap;let e0="__sak";/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class e1{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{if(!this.storage)return Promise.resolve(!1);return this.storage.setItem(e0,"1"),this.storage.removeItem(e0),Promise.resolve(!0)}catch(e){return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){let t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class e2 extends e1{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(){let e=(0,i.z$)();return et(e)||ea(e)}()&&function(){try{return!!(window&&window!==window.top)}catch(e){return!1}}(),this.fallbackToPolling=eu(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(let t of Object.keys(this.listeners)){let n=this.storage.getItem(t),r=this.localCache[t];n!==r&&e(t,r,n)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((e,t,n)=>{this.notifyListeners(e,n)});return}let n=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){let r=this.storage.getItem(n);if(e.newValue!==r)null!==e.newValue?this.storage.setItem(n,e.newValue):this.storage.removeItem(n);else if(this.localCache[n]===e.newValue&&!t)return}let r=()=>{let e=this.storage.getItem(n);(t||this.localCache[n]!==e)&&this.notifyListeners(n,e)},o=this.storage.getItem(n);(0,i.w1)()&&10===document.documentMode&&o!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,10):r()}notifyListeners(e,t){this.localCache[e]=t;let n=this.listeners[e];if(n)for(let e of Array.from(n))e(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:n}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){let t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}e2.type="LOCAL";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class e3 extends e1{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}e3.type="SESSION";/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class e4{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){let t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;let n=new e4(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){let{eventId:t,eventType:n,data:r}=e.data,i=this.handlersMap[n];if(!(null==i?void 0:i.size))return;e.ports[0].postMessage({status:"ack",eventId:t,eventType:n});let o=Array.from(i).map(async t=>t(e.origin,r)),s=await Promise.all(o.map(async e=>{try{let t=await e;return{fulfilled:!0,value:t}}catch(e){return{fulfilled:!1,reason:e}}}));e.ports[0].postMessage({status:"done",eventId:t,eventType:n,response:s})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function e5(e="",t=10){let n="";for(let e=0;e<t;e++)n+=Math.floor(10*Math.random());return e+n}e4.receivers=[];/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class e6{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,n=50){let r,i;let o="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!o)throw Error("connection_unavailable");return new Promise((s,a)=>{let u=e5("",20);o.port1.start();let l=setTimeout(()=>{a(Error("unsupported_event"))},n);i={messageChannel:o,onMessage(e){if(e.data.eventId===u)switch(e.data.status){case"ack":clearTimeout(l),r=setTimeout(()=>{a(Error("timeout"))},3e3);break;case"done":clearTimeout(r),s(e.data.response);break;default:clearTimeout(l),clearTimeout(r),a(Error("invalid_response"))}}},this.handlers.add(i),o.port1.addEventListener("message",i.onMessage),this.target.postMessage({eventType:e,eventId:u,data:t},[o.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function e9(){return window}/**
 * @license
 * Copyright 2020 Google LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function e8(){return void 0!==e9().WorkerGlobalScope&&"function"==typeof e9().importScripts}async function e7(){if(!(null==navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(e){return null}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let te="firebaseLocalStorageDb",tt="firebaseLocalStorage",tn="fbase_key";class tr{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function ti(e,t){return e.transaction([tt],t?"readwrite":"readonly").objectStore(tt)}function to(){let e=indexedDB.open(te,1);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{let t=e.result;try{t.createObjectStore(tt,{keyPath:tn})}catch(e){n(e)}}),e.addEventListener("success",async()=>{let n=e.result;n.objectStoreNames.contains(tt)?t(n):(n.close(),await new tr(indexedDB.deleteDatabase(te)).toPromise(),t(await to()))})})}async function ts(e,t,n){return new tr(ti(e,!0).put({[tn]:t,value:n})).toPromise()}async function ta(e,t){let n=ti(e,!1).get(t),r=await new tr(n).toPromise();return void 0===r?null:r.value}function tu(e,t){return new tr(ti(e,!0).delete(t)).toPromise()}class tl{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db||(this.db=await to()),this.db}async _withRetries(e){let t=0;for(;;)try{let t=await this._openDb();return await e(t)}catch(e){if(t++>3)throw e;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return e8()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=e4._getInstance(e8()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await e7(),!this.activeServiceWorker)return;this.sender=new e6(this.activeServiceWorker);let n=await this.sender._send("ping",{},800);n&&(null===(e=n[0])||void 0===e?void 0:e.fulfilled)&&(null===(t=n[0])||void 0===t?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){var t;if(this.sender&&this.activeServiceWorker&&((null===(t=null==navigator?void 0:navigator.serviceWorker)||void 0===t?void 0:t.controller)||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch(e){}}async _isAvailable(){try{if(!indexedDB)return!1;let e=await to();return await ts(e,e0,"1"),await tu(e,e0),!0}catch(e){}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(n=>ts(n,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){let t=await this._withRetries(t=>ta(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>tu(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){let e=await this._withRetries(e=>new tr(ti(e,!1).getAll()).toPromise());if(!e||0!==this.pendingWrites)return[];let t=[],n=new Set;for(let{fbase_key:r,value:i}of e)n.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(i)&&(this.notifyListeners(r,i),t.push(r));for(let e of Object.keys(this.localCache))this.localCache[e]&&!n.has(e)&&(this.notifyListeners(e,null),t.push(e));return t}notifyListeners(e,t){this.localCache[e]=t;let n=this.listeners[e];if(n)for(let e of Array.from(n))e(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}function tc(e){return`__${e}${Math.floor(1e6*Math.random())}`}async function td(e,t,n){var r,i,o;let s=await n.verify();try{let a;if(y("string"==typeof s,e,"argument-error"),y("recaptcha"===n.type,e,"argument-error"),a="string"==typeof t?{phoneNumber:t}:t,"session"in a){let t=a.session;if("phoneNumber"in a)return y("enroll"===t.type,e,"internal-error"),(await (i={idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:a.phoneNumber,recaptchaToken:s}},A(e,"POST","/v2/accounts/mfaEnrollment:start",C(e,i)))).phoneSessionInfo.sessionInfo;{y("signin"===t.type,e,"internal-error");let n=(null===(r=a.multiFactorHint)||void 0===r?void 0:r.uid)||a.multiFactorUid;return y(n,e,"missing-multi-factor-info"),(await (o={mfaPendingCredential:t.credential,mfaEnrollmentId:n,phoneSignInInfo:{recaptchaToken:s}},A(e,"POST","/v2/accounts/mfaSignIn:start",C(e,o)))).phoneResponseInfo.sessionInfo}}{let{sessionInfo:t}=await ex(e,{phoneNumber:a.phoneNumber,recaptchaToken:s});return t}}finally{n._reset()}}tl.type="LOCAL",tc("rcb"),new E(3e4,6e4);/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class th{constructor(e){this.providerId=th.PROVIDER_ID,this.auth=eh(e)}verifyPhoneNumber(e,t){return td(this.auth,e,(0,i.m9)(t))}static credential(e,t){return eR._fromVerification(e,t)}static credentialFromResult(e){return th.credentialFromTaggedObject(e)}static credentialFromError(e){return th.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;let{phoneNumber:t,temporaryProof:n}=e;return t&&n?eR._fromTokenResponse(t,n):null}}/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function tf(e,t){return t?b(t):(y(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}th.PROVIDER_ID="phone",th.PHONE_SIGN_IN_METHOD="phone";/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class tp extends ey{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return eI(e,this._buildIdpRequest())}_linkToIdToken(e,t){return eI(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return eI(e,this._buildIdpRequest())}_buildIdpRequest(e){let t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function tg(e){return eK(e.auth,new tp(e),e.bypassAuthState)}function tm(e){let{auth:t,user:n}=e;return y(n,t,"internal-error"),eH(n,new tp(e),e.bypassAuthState)}async function ty(e){let{auth:t,user:n}=e;return y(n,t,"internal-error"),eW(n,new tp(e),e.bypassAuthState)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class tv{constructor(e,t,n,r,i=!1){this.auth=e,this.resolver=n,this.user=r,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}})}async onAuthEvent(e){let{urlResponse:t,sessionId:n,postBody:r,tenantId:i,error:o,type:s}=e;if(o){this.reject(o);return}let a={auth:this.auth,requestUri:t,sessionId:n,tenantId:i||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(s)(a))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return tg;case"linkViaPopup":case"linkViaRedirect":return ty;case"reauthViaPopup":case"reauthViaRedirect":return tm;default:f(this.auth,"internal-error")}}resolve(e){this.pendingPromise||v("Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){this.pendingPromise||v("Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let t_=new E(2e3,1e4);async function tb(e,t,n){let r=eh(e);!function(e,t,n){if(!(t instanceof n))throw n.name!==t.constructor.name&&f(e,"argument-error"),g(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}(e,t,eM);let i=tf(r,n);return new tw(r,"signInViaPopup",t,i).executeNotNull()}class tw extends tv{constructor(e,t,n,r,i){super(e,t,r,i),this.provider=n,this.authWindow=null,this.pollId=null,tw.currentPopupAction&&tw.currentPopupAction.cancel(),tw.currentPopupAction=this}async executeNotNull(){let e=await this.execute();return y(e,this.auth,"internal-error"),e}async onExecution(){1===this.filter.length||v("Popup operations only handle one event");let e=e5();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(p(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}cancel(){this.reject(p(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,tw.currentPopupAction=null}pollUserCancellation(){let e=()=>{var t,n;if(null===(n=null===(t=this.authWindow)||void 0===t?void 0:t.window)||void 0===n?void 0:n.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(p(this.auth,"popup-closed-by-user"))},2e3);return}this.pollId=window.setTimeout(e,t_.get())};e()}}tw.currentPopupAction=null;let tS=new Map;class tE extends tv{constructor(e,t,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,n),this.eventId=null}async execute(){let e=tS.get(this.auth._key());if(!e){try{let t=await tk(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}tS.set(this.auth._key(),e)}return this.bypassAuthState||tS.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("unknown"===e.type){this.resolve(null);return}if(e.eventId){let t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function tk(e,t){let n=Q("pendingRedirect",t.config.apiKey,t.name),r=b(e._redirectPersistence);if(!await r._isAvailable())return!1;let i=await r._get(n)==="true";return await r._remove(n),i}function tI(e,t){tS.set(e._key(),t)}async function tT(e,t,n=!1){let r=eh(e),i=tf(r,t),o=new tE(r,i,n),s=await o.execute();return s&&!n&&(delete s.user._redirectEventId,await r._persistUserIfCurrent(s.user),await r._setRedirectUser(null,t)),s}class tx{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return tA(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var n;if(e.error&&!tA(e)){let r=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(p(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){let n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(tC(e))}saveEventToCache(e){this.cachedEventUids.add(tC(e)),this.lastProcessedEventTime=Date.now()}}function tC(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function tA({type:e,error:t}){return"unknown"===e&&(null==t?void 0:t.code)==="auth/no-auth-event"}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function tO(e,t={}){return A(e,"GET","/v1/projects",t)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tN=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,tR=/^https?/;async function tD(e){if(e.config.emulator)return;let{authorizedDomains:t}=await tO(e);for(let e of t)try{if(function(e){let t=w(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){let i=new URL(e);return""===i.hostname&&""===r?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&i.hostname===r}if(!tR.test(n))return!1;if(tN.test(e))return r===e;let i=e.replace(/\./g,"\\.");return RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}(e))return}catch(e){}f(e,"unauthorized-domain")}/**
 * @license
 * Copyright 2020 Google LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tP=new E(3e4,6e4);function tM(){let e=e9().___jsl;if(null==e?void 0:e.H){for(let t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let t=0;t<e.CP.length;t++)e.CP[t]=null}}let tL=null,tU=new E(5e3,15e3),tj={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},tq=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);async function tF(e){let t=await (tL=tL||new Promise((t,n)=>{var r,i,o,s;function a(){tM(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{tM(),n(p(e,"network-request-failed"))},timeout:tP.get()})}if(null===(i=null===(r=e9().gapi)||void 0===r?void 0:r.iframes)||void 0===i?void 0:i.Iframe)t(gapi.iframes.getContext());else if(null===(o=e9().gapi)||void 0===o?void 0:o.load)a();else{let t=tc("iframefcb");return e9()[t]=()=>{gapi.load?a():n(p(e,"network-request-failed"))},(s=`https://apis.google.com/js/api.js?onload=${t}`,new Promise((e,t)=>{var n,r;let i=document.createElement("script");i.setAttribute("src",s),i.onload=e,i.onerror=e=>{let n=p("internal-error");n.customData=e,t(n)},i.type="text/javascript",i.charset="UTF-8",(null!==(r=null===(n=document.getElementsByTagName("head"))||void 0===n?void 0:n[0])&&void 0!==r?r:document).appendChild(i)})).catch(e=>n(e))}}).catch(e=>{throw tL=null,e})),n=e9().gapi;return y(n,e,"internal-error"),t.open({where:document.body,url:function(e){let t=e.config;y(t.authDomain,e,"auth-domain-config-required");let n=t.emulator?k(t,"emulator/auth/iframe"):`https://${e.config.authDomain}/__/auth/iframe`,r={apiKey:t.apiKey,appName:e.name,v:o.Jn},s=tq.get(e.config.apiHost);s&&(r.eid=s);let a=e._getFrameworks();return a.length&&(r.fw=a.join(",")),`${n}?${(0,i.xO)(r).slice(1)}`}(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:tj,dontclear:!0},t=>new Promise(async(n,r)=>{await t.restyle({setHideOnLeave:!1});let i=p(e,"network-request-failed"),o=e9().setTimeout(()=>{r(i)},tU.get());function s(){e9().clearTimeout(o),n(t)}t.ping(s).then(s,()=>{r(i)})}))}/**
 * @license
 * Copyright 2020 Google LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let t$={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class tB{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}function tz(e,t,n,r,s,a){y(e.config.authDomain,e,"auth-domain-config-required"),y(e.config.apiKey,e,"invalid-api-key");let u={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:o.Jn,eventId:s};if(t instanceof eM)for(let[n,r]of(t.setDefaultLanguage(e.languageCode),u.providerId=t.providerId||"",(0,i.xb)(t.getCustomParameters())||(u.customParameters=JSON.stringify(t.getCustomParameters())),Object.entries(a||{})))u[n]=r;if(t instanceof eL){let e=t.getScopes().filter(e=>""!==e);e.length>0&&(u.scopes=e.join(","))}for(let t of(e.tenantId&&(u.tid=e.tenantId),Object.keys(u)))void 0===u[t]&&delete u[t];return`${function({config:e}){return e.emulator?k(e,"emulator/auth/handler"):`https://${e.authDomain}/__/auth/handler`}(e)}?${(0,i.xO)(u).slice(1)}`}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tV="webStorageSupport";class tG{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=e3,this._completeRedirectFn=tT,this._overrideRedirectResult=tI}async _openPopup(e,t,n,r){var o;(null===(o=this.eventManagers[e._key()])||void 0===o?void 0:o.manager)||v("_initialize() not called before _openPopup()");let s=tz(e,t,n,w(),r);return function(e,t,n,r=500,o=600){let s=Math.max((window.screen.availHeight-o)/2,0).toString(),a=Math.max((window.screen.availWidth-r)/2,0).toString(),u="",l=Object.assign(Object.assign({},t$),{width:r.toString(),height:o.toString(),top:s,left:a}),c=(0,i.z$)().toLowerCase();n&&(u=en(c)?"_blank":n),ee(c)&&(t=t||"http://localhost",l.scrollbars="yes");let d=Object.entries(l).reduce((e,[t,n])=>`${e}${t}=${n},`,"");if(function(e=(0,i.z$)()){var t;return ea(e)&&!!(null===(t=window.navigator)||void 0===t?void 0:t.standalone)}(c)&&"_self"!==u)return function(e,t){let n=document.createElement("a");n.href=e,n.target=t;let r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}(t||"",u),new tB(null);let h=window.open(t||"",u,d);y(h,e,"popup-blocked");try{h.focus()}catch(e){}return new tB(h)}(e,s,e5())}async _openRedirect(e,t,n,r){var i;return await this._originValidation(e),i=tz(e,t,n,w(),r),e9().location.href=i,new Promise(()=>{})}_initialize(e){let t=e._key();if(this.eventManagers[t]){let{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(n||v("If manager is not set, promise should be"),n)}let n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch(()=>{delete this.eventManagers[t]}),n}async initAndGetManager(e){let t=await tF(e),n=new tx(e);return t.register("authEvent",t=>(y(null==t?void 0:t.authEvent,e,"invalid-auth-event"),{status:n.onEvent(t.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(tV,{type:tV},n=>{var r;let i=null===(r=null==n?void 0:n[0])||void 0===r?void 0:r[tV];void 0!==i&&t(!!i),f(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){let t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=tD(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return eu()||et()||ea()}}class tW{constructor(e){this.factorId=e}_process(e,t,n){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,n);case"signin":return this._finalizeSignIn(e,t.credential);default:return v("unexpected MultiFactorSessionType")}}}class tH extends tW{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new tH(e)}_finalizeEnroll(e,t,n){return A(e,"POST","/v2/accounts/mfaEnrollment:finalize",C(e,{idToken:t,displayName:n,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}_finalizeSignIn(e,t){return A(e,"POST","/v2/accounts/mfaSignIn:finalize",C(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}}class tK{constructor(){}static assertion(e){return tH._fromCredential(e)}}tK.FACTOR_ID="phone";class tJ{static assertionForEnrollment(e,t){return tX._fromSecret(e,t)}static assertionForSignIn(e,t){return tX._fromEnrollmentId(e,t)}static async generateSecret(e){var t;y(void 0!==e.auth,"internal-error");let n=await A(t=e.auth,"POST","/v2/accounts/mfaEnrollment:start",C(t,{idToken:e.credential,totpEnrollmentInfo:{}}));return tQ._fromStartTotpMfaEnrollmentResponse(n,e.auth)}}tJ.FACTOR_ID="totp";class tX extends tW{constructor(e,t,n){super("totp"),this.otp=e,this.enrollmentId=t,this.secret=n}static _fromSecret(e,t){return new tX(t,void 0,e)}static _fromEnrollmentId(e,t){return new tX(t,e)}async _finalizeEnroll(e,t,n){return y(void 0!==this.secret,e,"argument-error"),A(e,"POST","/v2/accounts/mfaEnrollment:finalize",C(e,{idToken:t,displayName:n,totpVerificationInfo:this.secret._makeTotpVerificationInfo(this.otp)}))}async _finalizeSignIn(e,t){y(void 0!==this.enrollmentId&&void 0!==this.otp,e,"argument-error");let n={verificationCode:this.otp};return A(e,"POST","/v2/accounts/mfaSignIn:finalize",C(e,{mfaPendingCredential:t,mfaEnrollmentId:this.enrollmentId,totpVerificationInfo:n}))}}class tQ{constructor(e,t,n,r,i,o,s){this.sessionInfo=o,this.auth=s,this.secretKey=e,this.hashingAlgorithm=t,this.codeLength=n,this.codeIntervalSeconds=r,this.enrollmentCompletionDeadline=i}static _fromStartTotpMfaEnrollmentResponse(e,t){return new tQ(e.totpSessionInfo.sharedSecretKey,e.totpSessionInfo.hashingAlgorithm,e.totpSessionInfo.verificationCodeLength,e.totpSessionInfo.periodSec,new Date(e.totpSessionInfo.finalizeEnrollmentTime).toUTCString(),e.totpSessionInfo.sessionInfo,t)}_makeTotpVerificationInfo(e){return{sessionInfo:this.sessionInfo,verificationCode:e}}generateQrCodeUrl(e,t){var n;let r=!1;return(tZ(e)||tZ(t))&&(r=!0),r&&(tZ(e)&&(e=(null===(n=this.auth.currentUser)||void 0===n?void 0:n.email)||"unknownuser"),tZ(t)&&(t=this.auth.name)),`otpauth://totp/${t}:${e}?secret=${this.secretKey}&issuer=${t}&algorithm=${this.hashingAlgorithm}&digits=${this.codeLength}`}}function tZ(e){return void 0===e||(null==e?void 0:e.length)===0}var tY="@firebase/auth",t0="0.22.0";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class t1{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}async getToken(e){return(this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser)?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;let t=this.auth.onIdTokenChanged(t=>{e((null==t?void 0:t.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();let t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){y(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}let t2=(0,i.Pz)("authIdTokenMaxAge")||300,t3=null,t4=e=>async t=>{let n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>t2)return;let i=null==n?void 0:n.token;t3!==i&&(t3=i,await fetch(e,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function t5(e=(0,o.Mq)()){let t=(0,o.qX)(e,"auth");if(t.isInitialized())return t.getImmediate();let n=/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e,t){let n=(0,o.qX)(e,"auth");if(n.isInitialized()){let e=n.getImmediate(),r=n.getOptions();if((0,i.vZ)(r,null!=t?t:{}))return e;f(e,"already-initialized")}return n.initialize({options:t})}(e,{popupRedirectResolver:tG,persistence:[tl,e2,e3]}),r=(0,i.Pz)("authTokenSyncURL");if(r){let e=t4(r);(0,i.m9)(n).beforeAuthStateChanged(e,()=>e(n.currentUser)),(0,i.m9)(n).onIdTokenChanged(t=>e(t),void 0,void 0)}let s=(0,i.q4)("auth");return s&&ep(n,`http://${s}`),n}r="Browser",(0,o.Xd)(new u.wA("auth",(e,{options:t})=>{let n=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),{apiKey:o,authDomain:s}=n.options;return((e,n)=>{y(o&&!o.includes(":"),"invalid-api-key",{appName:e.name}),y(!(null==s?void 0:s.includes(":")),"argument-error",{appName:e.name});let i=new ed(e,n,{apiKey:o,authDomain:s,clientPlatform:r,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:el(r)});return function(e,t){let n=(null==t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(b);(null==t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null==t?void 0:t.popupRedirectResolver)}(i,t),i})(n,i)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,n)=>{e.getProvider("auth-internal").initialize()})),(0,o.Xd)(new u.wA("auth-internal",e=>new t1(eh(e.getProvider("auth").getImmediate())),"PRIVATE").setInstantiationMode("EXPLICIT")),(0,o.KN)(tY,t0,/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(r)),(0,o.KN)(tY,t0,"esm2017")},13247:function(e,t,n){"use strict";n.d(t,{ET:function(){return uT},Ab:function(){return uR},vr:function(){return uN},hJ:function(){return aN},at:function(){return ax},oe:function(){return uI},JU:function(){return aR},QT:function(){return ub},PL:function(){return uS},ad:function(){return aL},cf:function(){return ux},IO:function(){return ua},Bt:function(){return uO},pl:function(){return uE},r7:function(){return uk},ar:function(){return ul}});var r,i,o,s,a,u,l,c,d=n(32238),h=n(8463),f=n(53333),p=n(74444),g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},m={},y=y||{},v=g||self;function _(){}function b(e){var t=typeof e;return"array"==(t="object"!=t?t:e?Array.isArray(e)?"array":t:"null")||"object"==t&&"number"==typeof e.length}function w(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}function S(e,t,n){return e.call.apply(e.bind,arguments)}function E(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function k(e,t,n){return(k=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?S:E).apply(null,arguments)}function I(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}function T(e,t){function n(){}n.prototype=t.prototype,e.X=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.Wb=function(e,n,r){for(var i=Array(arguments.length-2),o=2;o<arguments.length;o++)i[o-2]=arguments[o];return t.prototype[n].apply(e,i)}}function x(){this.s=this.s,this.o=this.o}x.prototype.s=!1,x.prototype.na=function(){this.s||(this.s=!0,this.M())},x.prototype.M=function(){if(this.o)for(;this.o.length;)this.o.shift()()};let C=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if("string"==typeof e)return"string"!=typeof t||1!=t.length?-1:e.indexOf(t,0);for(let n=0;n<e.length;n++)if(n in e&&e[n]===t)return n;return -1};function A(e){let t=e.length;if(0<t){let n=Array(t);for(let r=0;r<t;r++)n[r]=e[r];return n}return[]}function O(e,t){for(let t=1;t<arguments.length;t++){let n=arguments[t];if(b(n)){let t=e.length||0,r=n.length||0;e.length=t+r;for(let i=0;i<r;i++)e[t+i]=n[i]}else e.push(n)}}function N(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}N.prototype.h=function(){this.defaultPrevented=!0};var R=function(){if(!v.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{v.addEventListener("test",_,t),v.removeEventListener("test",_,t)}catch(e){}return e}();function D(e){return/^[\s\xa0]*$/.test(e)}var P=String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]};function M(e,t){return e<t?-1:e>t?1:0}function L(){var e=v.navigator;return e&&(e=e.userAgent)?e:""}function U(e){return -1!=L().indexOf(e)}function j(e){return j[" "](e),e}j[" "]=_;var q=U("Opera"),F=U("Trident")||U("MSIE"),$=U("Edge"),B=$||F,z=U("Gecko")&&!(-1!=L().toLowerCase().indexOf("webkit")&&!U("Edge"))&&!(U("Trident")||U("MSIE"))&&!U("Edge"),V=-1!=L().toLowerCase().indexOf("webkit")&&!U("Edge");function G(){var e=v.document;return e?e.documentMode:void 0}t:{var W,H="",K=(W=L(),z?/rv:([^\);]+)(\)|;)/.exec(W):$?/Edge\/([\d\.]+)/.exec(W):F?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(W):V?/WebKit\/(\S+)/.exec(W):q?/(?:Version)[ \/]?(\S+)/.exec(W):void 0);if(K&&(H=K?K[1]:""),F){var J=G();if(null!=J&&J>parseFloat(H)){i=String(J);break t}}i=H}var X={},Q=v.document&&F&&(G()||parseInt(i,10))||void 0;function Z(e,t){if(N.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.g=t,t=e.relatedTarget){if(z){t:{try{j(t.nodeName);var i=!0;break t}catch(e){}i=!1}i||(t=null)}}else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType="string"==typeof e.pointerType?e.pointerType:Y[e.pointerType]||"",this.state=e.state,this.i=e,e.defaultPrevented&&Z.X.h.call(this)}}T(Z,N);var Y={2:"touch",3:"pen",4:"mouse"};Z.prototype.h=function(){Z.X.h.call(this);var e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var ee="closure_listenable_"+(1e6*Math.random()|0),et=0;function en(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.ha=i,this.key=++et,this.ba=this.ea=!1}function er(e){e.ba=!0,e.listener=null,e.proxy=null,e.src=null,e.ha=null}function ei(e,t,n){for(let r in e)t.call(n,e[r],r,e)}function eo(e){let t={};for(let n in e)t[n]=e[n];return t}let es="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function ea(e,t){let n,r;for(let t=1;t<arguments.length;t++){for(n in r=arguments[t])e[n]=r[n];for(let t=0;t<es.length;t++)n=es[t],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}function eu(e){this.src=e,this.g={},this.h=0}function el(e,t){var n=t.type;if(n in e.g){var r,i=e.g[n],o=C(i,t);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(er(t),0==e.g[n].length&&(delete e.g[n],e.h--))}}function ec(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i];if(!o.ba&&o.listener==t&&!!n==o.capture&&o.ha==r)return i}return -1}eu.prototype.add=function(e,t,n,r,i){var o=e.toString();(e=this.g[o])||(e=this.g[o]=[],this.h++);var s=ec(e,t,r,i);return -1<s?(t=e[s],n||(t.ea=!1)):((t=new en(t,this.src,o,!!r,i)).ea=n,e.push(t)),t};var ed="closure_lm_"+(1e6*Math.random()|0),eh={};function ef(e,t,n,r,i,o){if(!t)throw Error("Invalid event type");var s=w(i)?!!i.capture:!!i,a=ey(e);if(a||(e[ed]=a=new eu(e)),(n=a.add(t,n,r,s,o)).proxy)return n;if(r=function e(t){return em.call(e.src,e.listener,t)},n.proxy=r,r.src=e,r.listener=n,e.addEventListener)R||(i=s),void 0===i&&(i=!1),e.addEventListener(t.toString(),r,i);else if(e.attachEvent)e.attachEvent(eg(t.toString()),r);else if(e.addListener&&e.removeListener)e.addListener(r);else throw Error("addEventListener and attachEvent are unavailable.");return n}function ep(e){if("number"!=typeof e&&e&&!e.ba){var t=e.src;if(t&&t[ee])el(t.i,e);else{var n=e.type,r=e.proxy;t.removeEventListener?t.removeEventListener(n,r,e.capture):t.detachEvent?t.detachEvent(eg(n),r):t.addListener&&t.removeListener&&t.removeListener(r),(n=ey(t))?(el(n,e),0==n.h&&(n.src=null,t[ed]=null)):er(e)}}}function eg(e){return e in eh?eh[e]:eh[e]="on"+e}function em(e,t){if(e.ba)e=!0;else{t=new Z(t,this);var n=e.listener,r=e.ha||e.src;e.ea&&ep(e),e=n.call(r,t)}return e}function ey(e){return(e=e[ed])instanceof eu?e:null}var ev="__closure_events_fn_"+(1e9*Math.random()>>>0);function e_(e){return"function"==typeof e?e:(e[ev]||(e[ev]=function(t){return e.handleEvent(t)}),e[ev])}function eb(){x.call(this),this.i=new eu(this),this.P=this,this.I=null}function ew(e,t){var n,r=e.I;if(r)for(n=[];r;r=r.I)n.push(r);if(e=e.P,r=t.type||t,"string"==typeof t)t=new N(t,e);else if(t instanceof N)t.target=t.target||e;else{var i=t;ea(t=new N(r,e),i)}if(i=!0,n)for(var o=n.length-1;0<=o;o--){var s=t.g=n[o];i=eS(s,r,!0,t)&&i}if(i=eS(s=t.g=e,r,!0,t)&&i,i=eS(s,r,!1,t)&&i,n)for(o=0;o<n.length;o++)i=eS(s=t.g=n[o],r,!1,t)&&i}function eS(e,t,n,r){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();for(var i=!0,o=0;o<t.length;++o){var s=t[o];if(s&&!s.ba&&s.capture==n){var a=s.listener,u=s.ha||s.src;s.ea&&el(e.i,s),i=!1!==a.call(u,r)&&i}}return i&&!r.defaultPrevented}T(eb,x),eb.prototype[ee]=!0,eb.prototype.removeEventListener=function(e,t,n,r){!function e(t,n,r,i,o){if(Array.isArray(n))for(var s=0;s<n.length;s++)e(t,n[s],r,i,o);else(i=w(i)?!!i.capture:!!i,r=e_(r),t&&t[ee])?(t=t.i,(n=String(n).toString())in t.g&&-1<(r=ec(s=t.g[n],r,i,o))&&(er(s[r]),Array.prototype.splice.call(s,r,1),0==s.length&&(delete t.g[n],t.h--))):t&&(t=ey(t))&&(n=t.g[n.toString()],t=-1,n&&(t=ec(n,r,i,o)),(r=-1<t?n[t]:null)&&ep(r))}(this,e,t,n,r)},eb.prototype.M=function(){if(eb.X.M.call(this),this.i){var e,t=this.i;for(e in t.g){for(var n=t.g[e],r=0;r<n.length;r++)er(n[r]);delete t.g[e],t.h--}}this.I=null},eb.prototype.N=function(e,t,n,r){return this.i.add(String(e),t,!1,n,r)},eb.prototype.O=function(e,t,n,r){return this.i.add(String(e),t,!0,n,r)};var eE=v.JSON.stringify;class ek{constructor(){this.h=this.g=null}add(e,t){let n=eI.get();n.set(e,t),this.h?this.h.next=n:this.g=n,this.h=n}}var eI=new class{constructor(e,t){this.i=e,this.j=t,this.h=0,this.g=null}get(){let e;return 0<this.h?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}(()=>new eT,e=>e.reset());class eT{constructor(){this.next=this.g=this.h=null}set(e,t){this.h=e,this.g=t,this.next=null}reset(){this.next=this.g=this.h=null}}function ex(e,t){var n;s||(n=v.Promise.resolve(void 0),s=function(){n.then(eO)}),eC||(s(),eC=!0),eA.add(e,t)}var eC=!1,eA=new ek;function eO(){let e;for(var t;e=null,eA.g&&(e=eA.g,eA.g=eA.g.next,eA.g||(eA.h=null),e.next=null),t=e;){try{t.h.call(t.g)}catch(e){!function(e){v.setTimeout(()=>{throw e},0)}(e)}eI.j(t),100>eI.h&&(eI.h++,t.next=eI.g,eI.g=t)}eC=!1}function eN(e,t){eb.call(this),this.h=e||1,this.g=t||v,this.j=k(this.lb,this),this.l=Date.now()}function eR(e){e.ca=!1,e.R&&(e.g.clearTimeout(e.R),e.R=null)}function eD(e,t,n){if("function"==typeof e)n&&(e=k(e,n));else if(e&&"function"==typeof e.handleEvent)e=k(e.handleEvent,e);else throw Error("Invalid listener argument");return 2147483647<Number(t)?-1:v.setTimeout(e,t||0)}T(eN,eb),(c=eN.prototype).ca=!1,c.R=null,c.lb=function(){if(this.ca){var e=Date.now()-this.l;0<e&&e<.8*this.h?this.R=this.g.setTimeout(this.j,this.h-e):(this.R&&(this.g.clearTimeout(this.R),this.R=null),ew(this,"tick"),this.ca&&(eR(this),this.start()))}},c.start=function(){this.ca=!0,this.R||(this.R=this.g.setTimeout(this.j,this.h),this.l=Date.now())},c.M=function(){eN.X.M.call(this),eR(this),delete this.g};class eP extends x{constructor(e,t){super(),this.m=e,this.j=t,this.h=null,this.i=!1,this.g=null}l(e){this.h=arguments,this.g?this.i=!0:function e(t){t.g=eD(()=>{t.g=null,t.i&&(t.i=!1,e(t))},t.j);let n=t.h;t.h=null,t.m.apply(null,n)}(this)}M(){super.M(),this.g&&(v.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function eM(e){x.call(this),this.h=e,this.g={}}T(eM,x);var eL=[];function eU(e,t,n,r){Array.isArray(n)||(n&&(eL[0]=n.toString()),n=eL);for(var i=0;i<n.length;i++){var o=function e(t,n,r,i,o){if(i&&i.once)return function e(t,n,r,i,o){if(Array.isArray(n)){for(var s=0;s<n.length;s++)e(t,n[s],r,i,o);return null}return r=e_(r),t&&t[ee]?t.O(n,r,w(i)?!!i.capture:!!i,o):ef(t,n,r,!0,i,o)}(t,n,r,i,o);if(Array.isArray(n)){for(var s=0;s<n.length;s++)e(t,n[s],r,i,o);return null}return r=e_(r),t&&t[ee]?t.N(n,r,w(i)?!!i.capture:!!i,o):ef(t,n,r,!1,i,o)}(t,n[i],r||e.handleEvent,!1,e.h||e);if(!o)break;e.g[o.key]=o}}function ej(e){ei(e.g,function(e,t){this.g.hasOwnProperty(t)&&ep(e)},e),e.g={}}function eq(){this.g=!0}function eF(e,t,n,r){e.info(function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.g)return t;if(!t)return null;try{var n=JSON.parse(t);if(n){for(e=0;e<n.length;e++)if(Array.isArray(n[e])){var r=n[e];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var o=i[0];if("noop"!=o&&"stop"!=o&&"close"!=o)for(var s=1;s<i.length;s++)i[s]=""}}}}return eE(n)}catch(e){return t}}(e,n)+(r?" "+r:"")})}eM.prototype.M=function(){eM.X.M.call(this),ej(this)},eM.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},eq.prototype.Aa=function(){this.g=!1},eq.prototype.info=function(){};var e$={},eB=null;function ez(){return eB=eB||new eb}function eV(e){N.call(this,e$.Pa,e)}function eG(e){let t=ez();ew(t,new eV(t))}function eW(e,t){N.call(this,e$.STAT_EVENT,e),this.stat=t}function eH(e){let t=ez();ew(t,new eW(t,e))}function eK(e,t){N.call(this,e$.Qa,e),this.size=t}function eJ(e,t){if("function"!=typeof e)throw Error("Fn must not be null and must be a function");return v.setTimeout(function(){e()},t)}e$.Pa="serverreachability",T(eV,N),e$.STAT_EVENT="statevent",T(eW,N),e$.Qa="timingevent",T(eK,N);var eX={NO_ERROR:0,mb:1,zb:2,yb:3,tb:4,xb:5,Ab:6,Ma:7,TIMEOUT:8,Db:9},eQ={rb:"complete",Nb:"success",Na:"error",Ma:"abort",Fb:"ready",Gb:"readystatechange",TIMEOUT:"timeout",Bb:"incrementaldata",Eb:"progress",ub:"downloadprogress",Vb:"uploadprogress"};function eZ(){}function eY(e){return e.h||(e.h=e.i())}function e0(){}eZ.prototype.h=null;var e1={OPEN:"a",qb:"b",Na:"c",Cb:"d"};function e2(){N.call(this,"d")}function e3(){N.call(this,"c")}function e4(){}function e5(e,t,n,r){this.l=e,this.j=t,this.m=n,this.U=r||1,this.S=new eM(this),this.O=e9,e=B?125:void 0,this.T=new eN(e),this.H=null,this.i=!1,this.s=this.A=this.v=this.K=this.F=this.V=this.B=null,this.D=[],this.g=null,this.C=0,this.o=this.u=null,this.Y=-1,this.I=!1,this.N=0,this.L=null,this.$=this.J=this.Z=this.P=!1,this.h=new e6}function e6(){this.i=null,this.g="",this.h=!1}T(e2,N),T(e3,N),T(e4,eZ),e4.prototype.g=function(){return new XMLHttpRequest},e4.prototype.i=function(){return{}},a=new e4;var e9=45e3,e8={},e7={};function te(e,t,n){e.K=1,e.v=tv(tf(t)),e.s=n,e.P=!0,tt(e,null)}function tt(e,t){e.F=Date.now(),ti(e),e.A=tf(e.v);var n=e.A,r=e.U;Array.isArray(r)||(r=[String(r)]),tN(n.i,"t",r),e.C=0,n=e.l.H,e.h=new e6,e.g=nb(e.l,n?t:null,!e.s),0<e.N&&(e.L=new eP(k(e.La,e,e.g),e.N)),eU(e.S,e.g,"readystatechange",e.ib),t=e.H?eo(e.H):{},e.s?(e.u||(e.u="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.da(e.A,e.u,e.s,t)):(e.u="GET",e.g.da(e.A,e.u,null,t)),eG(),function(e,t,n,r,i,o){e.info(function(){if(e.g){if(o)for(var s="",a=o.split("&"),u=0;u<a.length;u++){var l=a[u].split("=");if(1<l.length){var c=l[0];l=l[1];var d=c.split("_");s=2<=d.length&&"type"==d[1]?s+(c+"=")+l+"&":s+(c+"=redacted&")}}else s=null}else s=o;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+t+"\n"+n+"\n"+s})}(e.j,e.u,e.A,e.m,e.U,e.s)}function tn(e){return!!e.g&&"GET"==e.u&&2!=e.K&&e.l.Da}function tr(e,t,n){let r=!0,i;for(;!e.I&&e.C<n.length;)if((i=function(e,t){var n=e.C,r=t.indexOf("\n",n);return -1==r?e7:isNaN(n=Number(t.substring(n,r)))?e8:(r+=1)+n>t.length?e7:(t=t.substr(r,n),e.C=r+n,t)}(e,n))==e7){4==t&&(e.o=4,eH(14),r=!1),eF(e.j,e.m,null,"[Incomplete Response]");break}else if(i==e8){e.o=4,eH(15),eF(e.j,e.m,n,"[Invalid Chunk]"),r=!1;break}else eF(e.j,e.m,i,null),tl(e,i);tn(e)&&i!=e7&&i!=e8&&(e.h.g="",e.C=0),4!=t||0!=n.length||e.h.h||(e.o=1,eH(16),r=!1),e.i=e.i&&r,r?0<n.length&&!e.$&&(e.$=!0,(t=e.l).g==e&&t.$&&!t.K&&(t.j.info("Great, no buffering proxy detected. Bytes received: "+n.length),nh(t),t.K=!0,eH(11))):(eF(e.j,e.m,n,"[Invalid Chunked Response]"),tu(e),ta(e))}function ti(e){e.V=Date.now()+e.O,to(e,e.O)}function to(e,t){if(null!=e.B)throw Error("WatchDog timer not null");e.B=eJ(k(e.gb,e),t)}function ts(e){e.B&&(v.clearTimeout(e.B),e.B=null)}function ta(e){0==e.l.G||e.I||ng(e.l,e)}function tu(e){ts(e);var t=e.L;t&&"function"==typeof t.na&&t.na(),e.L=null,eR(e.T),ej(e.S),e.g&&(t=e.g,e.g=null,t.abort(),t.na())}function tl(e,t){try{var n=e.l;if(0!=n.G&&(n.g==e||tj(n.h,e))){if(!e.J&&tj(n.h,e)&&3==n.G){try{var r=n.Fa.g.parse(t)}catch(e){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){t:if(!n.u){if(n.g){if(n.g.F+3e3<e.F)np(n),ni(n);else break t}nd(n),eH(18)}}else n.Ba=i[1],0<n.Ba-n.T&&37500>i[2]&&n.L&&0==n.A&&!n.v&&(n.v=eJ(k(n.cb,n),6e3));if(1>=tU(n.h)&&n.ja){try{n.ja()}catch(e){}n.ja=void 0}}else ny(n,11)}else if((e.J||n.g==e)&&np(n),!D(t))for(i=n.Fa.g.parse(t),t=0;t<i.length;t++){let a=i[t];if(n.T=a[0],a=a[1],2==n.G){if("c"==a[0]){n.I=a[1],n.ka=a[2];let t=a[3];null!=t&&(n.ma=t,n.j.info("VER="+n.ma));let i=a[4];null!=i&&(n.Ca=i,n.j.info("SVER="+n.Ca));let u=a[5];null!=u&&"number"==typeof u&&0<u&&(r=1.5*u,n.J=r,n.j.info("backChannelRequestTimeoutMs_="+r)),r=n;let l=e.g;if(l){let e=l.g?l.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(e){var o=r.h;o.g||-1==e.indexOf("spdy")&&-1==e.indexOf("quic")&&-1==e.indexOf("h2")||(o.j=o.l,o.g=new Set,o.h&&(tq(o,o.h),o.h=null))}if(r.D){let e=l.g?l.g.getResponseHeader("X-HTTP-Session-Id"):null;e&&(r.za=e,ty(r.F,r.D,e))}}if(n.G=3,n.l&&n.l.xa(),n.$&&(n.P=Date.now()-e.F,n.j.info("Handshake RTT: "+n.P+"ms")),(r=n).sa=n_(r,r.H?r.ka:null,r.V),e.J){tF(r.h,e);var s=r.J;s&&e.setTimeout(s),e.B&&(ts(e),ti(e)),r.g=e}else nc(r);0<n.i.length&&ns(n)}else"stop"!=a[0]&&"close"!=a[0]||ny(n,7)}else 3==n.G&&("stop"==a[0]||"close"==a[0]?"stop"==a[0]?ny(n,7):nr(n):"noop"!=a[0]&&n.l&&n.l.wa(a),n.A=0)}}eG(4)}catch(e){}}function tc(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(b(e)||"string"==typeof e)Array.prototype.forEach.call(e,t,void 0);else for(var n=function(e){if(e.oa&&"function"==typeof e.oa)return e.oa();if(!e.W||"function"!=typeof e.W){if("undefined"!=typeof Map&&e instanceof Map)return Array.from(e.keys());if(!("undefined"!=typeof Set&&e instanceof Set)){if(b(e)||"string"==typeof e){var t=[];e=e.length;for(var n=0;n<e;n++)t.push(n);return t}for(let r in t=[],n=0,e)t[n++]=r;return t}}}(e),r=function(e){if(e.W&&"function"==typeof e.W)return e.W();if("undefined"!=typeof Map&&e instanceof Map||"undefined"!=typeof Set&&e instanceof Set)return Array.from(e.values());if("string"==typeof e)return e.split("");if(b(e)){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}for(r in t=[],n=0,e)t[n++]=e[r];return t}(e),i=r.length,o=0;o<i;o++)t.call(void 0,r[o],n&&n[o],e)}(c=e5.prototype).setTimeout=function(e){this.O=e},c.ib=function(e){e=e.target;let t=this.L;t&&3==t9(e)?t.l():this.La(e)},c.La=function(e){try{if(e==this.g)t:{let c=t9(this.g);var t=this.g.Ea();let d=this.g.aa();if(!(3>c)&&(3!=c||B||this.g&&(this.h.h||this.g.fa()||t8(this.g)))){this.I||4!=c||7==t||(8==t||0>=d?eG(3):eG(2)),ts(this);var n=this.g.aa();this.Y=n;n:if(tn(this)){var r=t8(this.g);e="";var i=r.length,o=4==t9(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){tu(this),ta(this);var s="";break n}this.h.i=new v.TextDecoder}for(t=0;t<i;t++)this.h.h=!0,e+=this.h.i.decode(r[t],{stream:o&&t==i-1});r.splice(0,i),this.h.g+=e,this.C=0,s=this.h.g}else s=this.g.fa();if(this.i=200==n,function(e,t,n,r,i,o,s){e.info(function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+t+"\n"+n+"\n"+o+" "+s})}(this.j,this.u,this.A,this.m,this.U,c,n),this.i){if(this.Z&&!this.J){n:{if(this.g){var a,u=this.g;if((a=u.g?u.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!D(a)){var l=a;break n}}l=null}if(n=l)eF(this.j,this.m,n,"Initial handshake response via X-HTTP-Initial-Response"),this.J=!0,tl(this,n);else{this.i=!1,this.o=3,eH(12),tu(this),ta(this);break t}}this.P?(tr(this,c,s),B&&this.i&&3==c&&(eU(this.S,this.T,"tick",this.hb),this.T.start())):(eF(this.j,this.m,s,null),tl(this,s)),4==c&&tu(this),this.i&&!this.I&&(4==c?ng(this.l,this):(this.i=!1,ti(this)))}else 400==n&&0<s.indexOf("Unknown SID")?(this.o=3,eH(12)):(this.o=0,eH(13)),tu(this),ta(this)}}}catch(e){}finally{}},c.hb=function(){if(this.g){var e=t9(this.g),t=this.g.fa();this.C<t.length&&(ts(this),tr(this,e,t),this.i&&4!=e&&ti(this))}},c.cancel=function(){this.I=!0,tu(this)},c.gb=function(){this.B=null;let e=Date.now();0<=e-this.V?(function(e,t){e.info(function(){return"TIMEOUT: "+t})}(this.j,this.A),2!=this.K&&(eG(),eH(17)),tu(this),this.o=2,ta(this)):to(this,this.V-e)};var td=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function th(e,t){if(this.g=this.s=this.j="",this.m=null,this.o=this.l="",this.h=!1,e instanceof th){this.h=void 0!==t?t:e.h,tp(this,e.j),this.s=e.s,this.g=e.g,tg(this,e.m),this.l=e.l,t=e.i;var n=new tx;n.i=t.i,t.g&&(n.g=new Map(t.g),n.h=t.h),tm(this,n),this.o=e.o}else e&&(n=String(e).match(td))?(this.h=!!t,tp(this,n[1]||"",!0),this.s=t_(n[2]||""),this.g=t_(n[3]||"",!0),tg(this,n[4]),this.l=t_(n[5]||"",!0),tm(this,n[6]||"",!0),this.o=t_(n[7]||"")):(this.h=!!t,this.i=new tx(null,this.h))}function tf(e){return new th(e)}function tp(e,t,n){e.j=n?t_(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function tg(e,t){if(t){if(isNaN(t=Number(t))||0>t)throw Error("Bad port number "+t);e.m=t}else e.m=null}function tm(e,t,n){var r,i;t instanceof tx?(e.i=t,r=e.i,(i=e.h)&&!r.j&&(tC(r),r.i=null,r.g.forEach(function(e,t){var n=t.toLowerCase();t!=n&&(tA(this,t),tN(this,n,e))},r)),r.j=i):(n||(t=tb(t,tI)),e.i=new tx(t,e.h))}function ty(e,t,n){e.i.set(t,n)}function tv(e){return ty(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function t_(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function tb(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,tw),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function tw(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}th.prototype.toString=function(){var e=[],t=this.j;t&&e.push(tb(t,tS,!0),":");var n=this.g;return(n||"file"==t)&&(e.push("//"),(t=this.s)&&e.push(tb(t,tS,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.m)&&e.push(":",String(n))),(n=this.l)&&(this.g&&"/"!=n.charAt(0)&&e.push("/"),e.push(tb(n,"/"==n.charAt(0)?tk:tE,!0))),(n=this.i.toString())&&e.push("?",n),(n=this.o)&&e.push("#",tb(n,tT)),e.join("")};var tS=/[#\/\?@]/g,tE=/[#\?:]/g,tk=/[#\?]/g,tI=/[#\?@]/g,tT=/#/g;function tx(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function tC(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),i=null;if(0<=r){var o=e[n].substring(0,r);i=e[n].substring(r+1)}else o=e[n];t(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(e.i,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}function tA(e,t){tC(e),t=tR(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function tO(e,t){return tC(e),t=tR(e,t),e.g.has(t)}function tN(e,t,n){tA(e,t),0<n.length&&(e.i=null,e.g.set(tR(e,t),A(n)),e.h+=n.length)}function tR(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}(c=tx.prototype).add=function(e,t){tC(this),this.i=null,e=tR(this,e);var n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this},c.forEach=function(e,t){tC(this),this.g.forEach(function(n,r){n.forEach(function(n){e.call(t,n,r,this)},this)},this)},c.oa=function(){tC(this);let e=Array.from(this.g.values()),t=Array.from(this.g.keys()),n=[];for(let r=0;r<t.length;r++){let i=e[r];for(let e=0;e<i.length;e++)n.push(t[r])}return n},c.W=function(e){tC(this);let t=[];if("string"==typeof e)tO(this,e)&&(t=t.concat(this.g.get(tR(this,e))));else{e=Array.from(this.g.values());for(let n=0;n<e.length;n++)t=t.concat(e[n])}return t},c.set=function(e,t){return tC(this),this.i=null,tO(this,e=tR(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},c.get=function(e,t){return e&&0<(e=this.W(e)).length?String(e[0]):t},c.toString=function(){if(this.i)return this.i;if(!this.g)return"";let e=[],t=Array.from(this.g.keys());for(var n=0;n<t.length;n++){var r=t[n];let o=encodeURIComponent(String(r)),s=this.W(r);for(r=0;r<s.length;r++){var i=o;""!==s[r]&&(i+="="+encodeURIComponent(String(s[r]))),e.push(i)}}return this.i=e.join("&")};var tD=class{constructor(e,t){this.h=e,this.g=t}};function tP(e){this.l=e||tM,e=v.PerformanceNavigationTiming?0<(e=v.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):!!(v.g&&v.g.Ga&&v.g.Ga()&&v.g.Ga().$b),this.j=e?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}var tM=10;function tL(e){return!!e.h||!!e.g&&e.g.size>=e.j}function tU(e){return e.h?1:e.g?e.g.size:0}function tj(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function tq(e,t){e.g?e.g.add(t):e.h=t}function tF(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function t$(e){if(null!=e.h)return e.i.concat(e.h.D);if(null!=e.g&&0!==e.g.size){let t=e.i;for(let n of e.g.values())t=t.concat(n.D);return t}return A(e.i)}function tB(){}function tz(){this.g=new tB}function tV(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch(e){}}function tG(e){this.l=e.ac||null,this.j=e.jb||!1}function tW(e,t){eb.call(this),this.D=e,this.u=t,this.m=void 0,this.readyState=tH,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}tP.prototype.cancel=function(){if(this.i=t$(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(let e of this.g.values())e.cancel();this.g.clear()}},tB.prototype.stringify=function(e){return v.JSON.stringify(e,void 0)},tB.prototype.parse=function(e){return v.JSON.parse(e,void 0)},T(tG,eZ),tG.prototype.g=function(){return new tW(this.l,this.j)},tG.prototype.i=(r={},function(){return r}),T(tW,eb);var tH=0;function tK(e){e.j.read().then(e.Ta.bind(e)).catch(e.ga.bind(e))}function tJ(e){e.readyState=4,e.l=null,e.j=null,e.A=null,tX(e)}function tX(e){e.onreadystatechange&&e.onreadystatechange.call(e)}(c=tW.prototype).open=function(e,t){if(this.readyState!=tH)throw this.abort(),Error("Error reopening a connection");this.C=e,this.B=t,this.readyState=1,tX(this)},c.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;let t={headers:this.v,method:this.C,credentials:this.m,cache:void 0};e&&(t.body=e),(this.D||v).fetch(new Request(this.B,t)).then(this.Wa.bind(this),this.ga.bind(this))},c.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,tJ(this)),this.readyState=tH},c.Wa=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,tX(this)),this.g&&(this.readyState=3,tX(this),this.g))){if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Ua.bind(this),this.ga.bind(this));else if(void 0!==v.ReadableStream&&"body"in e){if(this.j=e.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;tK(this)}else e.text().then(this.Va.bind(this),this.ga.bind(this))}},c.Ta=function(e){if(this.g){if(this.u&&e.value)this.response.push(e.value);else if(!this.u){var t=e.value?e.value:new Uint8Array(0);(t=this.A.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?tJ(this):tX(this),3==this.readyState&&tK(this)}},c.Va=function(e){this.g&&(this.response=this.responseText=e,tJ(this))},c.Ua=function(e){this.g&&(this.response=e,tJ(this))},c.ga=function(){this.g&&tJ(this)},c.setRequestHeader=function(e,t){this.v.append(e,t)},c.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},c.getAllResponseHeaders=function(){if(!this.h)return"";let e=[],t=this.h.entries();for(var n=t.next();!n.done;)e.push((n=n.value)[0]+": "+n[1]),n=t.next();return e.join("\r\n")},Object.defineProperty(tW.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}});var tQ=v.JSON.parse;function tZ(e){eb.call(this),this.headers=new Map,this.u=e||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=tY,this.K=this.L=!1}T(tZ,eb);var tY="",t0=/^https?$/i,t1=["POST","PUT"];function t2(e,t){e.h=!1,e.g&&(e.l=!0,e.g.abort(),e.l=!1),e.j=t,e.m=5,t3(e),t5(e)}function t3(e){e.D||(e.D=!0,ew(e,"complete"),ew(e,"error"))}function t4(e){if(e.h&&void 0!==y&&(!e.C[1]||4!=t9(e)||2!=e.aa())){if(e.v&&4==t9(e))eD(e.Ha,0,e);else if(ew(e,"readystatechange"),4==t9(e)){e.h=!1;try{let a=e.aa();switch(a){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var t,n,r=!0;break;default:r=!1}if(!(t=r)){if(n=0===a){var i=String(e.H).match(td)[1]||null;if(!i&&v.self&&v.self.location){var o=v.self.location.protocol;i=o.substr(0,o.length-1)}n=!t0.test(i?i.toLowerCase():"")}t=n}if(t)ew(e,"complete"),ew(e,"success");else{e.m=6;try{var s=2<t9(e)?e.g.statusText:""}catch(e){s=""}e.j=s+" ["+e.aa()+"]",t3(e)}}finally{t5(e)}}}}function t5(e,t){if(e.g){t6(e);let n=e.g,r=e.C[0]?_:null;e.g=null,e.C=null,t||ew(e,"ready");try{n.onreadystatechange=r}catch(e){}}}function t6(e){e.g&&e.K&&(e.g.ontimeout=null),e.A&&(v.clearTimeout(e.A),e.A=null)}function t9(e){return e.g?e.g.readyState:0}function t8(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.J){case tY:case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(e){return null}}function t7(e){let t="";return ei(e,function(e,n){t+=n+":"+e+"\r\n"}),t}function ne(e,t,n){t:{for(r in n){var r=!1;break t}r=!0}r||(n=t7(n),"string"==typeof e?null!=n&&encodeURIComponent(String(n)):ty(e,t,n))}function nt(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function nn(e){this.Ca=0,this.i=[],this.j=new eq,this.ka=this.sa=this.F=this.V=this.g=this.za=this.D=this.ia=this.o=this.S=this.s=null,this.ab=this.U=0,this.Za=nt("failFast",!1,e),this.L=this.v=this.u=this.m=this.l=null,this.Y=!0,this.pa=this.Ba=this.T=-1,this.Z=this.A=this.C=0,this.Xa=nt("baseRetryDelayMs",5e3,e),this.bb=nt("retryDelaySeedMs",1e4,e),this.$a=nt("forwardChannelMaxRetries",2,e),this.ta=nt("forwardChannelRequestTimeoutMs",2e4,e),this.ra=e&&e.xmlHttpFactory||void 0,this.Da=e&&e.Zb||!1,this.J=void 0,this.H=e&&e.supportsCrossDomainXhr||!1,this.I="",this.h=new tP(e&&e.concurrentRequestLimit),this.Fa=new tz,this.O=e&&e.fastHandshake||!1,this.N=e&&e.encodeInitMessageHeaders||!1,this.O&&this.N&&(this.N=!1),this.Ya=e&&e.Xb||!1,e&&e.Aa&&this.j.Aa(),e&&e.forceLongPolling&&(this.Y=!1),this.$=!this.O&&this.Y&&e&&e.detectBufferingProxy||!1,this.ja=void 0,this.P=0,this.K=!1,this.la=this.B=null}function nr(e){if(no(e),3==e.G){var t=e.U++,n=tf(e.F);ty(n,"SID",e.I),ty(n,"RID",t),ty(n,"TYPE","terminate"),nu(e,n),(t=new e5(e,e.j,t,void 0)).K=2,t.v=tv(tf(n)),n=!1,v.navigator&&v.navigator.sendBeacon&&(n=v.navigator.sendBeacon(t.v.toString(),"")),!n&&v.Image&&((new Image).src=t.v,n=!0),n||(t.g=nb(t.l,null),t.g.da(t.v)),t.F=Date.now(),ti(t)}nv(e)}function ni(e){e.g&&(nh(e),e.g.cancel(),e.g=null)}function no(e){ni(e),e.u&&(v.clearTimeout(e.u),e.u=null),np(e),e.h.cancel(),e.m&&("number"==typeof e.m&&v.clearTimeout(e.m),e.m=null)}function ns(e){tL(e.h)||e.m||(e.m=!0,ex(e.Ja,e),e.C=0)}function na(e,t){var n;n=t?t.m:e.U++;let r=tf(e.F);ty(r,"SID",e.I),ty(r,"RID",n),ty(r,"AID",e.T),nu(e,r),e.o&&e.s&&ne(r,e.o,e.s),n=new e5(e,e.j,n,e.C+1),null===e.o&&(n.H=e.s),t&&(e.i=t.D.concat(e.i)),t=nl(e,n,1e3),n.setTimeout(Math.round(.5*e.ta)+Math.round(.5*e.ta*Math.random())),tq(e.h,n),te(n,r,t)}function nu(e,t){e.ia&&ei(e.ia,function(e,n){ty(t,n,e)}),e.l&&tc({},function(e,n){ty(t,n,e)})}function nl(e,t,n){n=Math.min(e.i.length,n);var r=e.l?k(e.l.Ra,e.l,e):null;t:{var i=e.i;let t=-1;for(;;){let e=["count="+n];-1==t?0<n?(t=i[0].h,e.push("ofs="+t)):t=0:e.push("ofs="+t);let o=!0;for(let s=0;s<n;s++){let n=i[s].h,a=i[s].g;if(0>(n-=t))t=Math.max(0,i[s].h-100),o=!1;else try{!function(e,t,n){let r=n||"";try{tc(e,function(e,n){let i=e;w(e)&&(i=eE(e)),t.push(r+n+"="+encodeURIComponent(i))})}catch(e){throw t.push(r+"type="+encodeURIComponent("_badmap")),e}}(a,e,"req"+n+"_")}catch(e){r&&r(a)}}if(o){r=e.join("&");break t}}}return e=e.i.splice(0,n),t.D=e,r}function nc(e){e.g||e.u||(e.Z=1,ex(e.Ia,e),e.A=0)}function nd(e){return!e.g&&!e.u&&!(3<=e.A)&&(e.Z++,e.u=eJ(k(e.Ia,e),nm(e,e.A)),e.A++,!0)}function nh(e){null!=e.B&&(v.clearTimeout(e.B),e.B=null)}function nf(e){e.g=new e5(e,e.j,"rpc",e.Z),null===e.o&&(e.g.H=e.s),e.g.N=0;var t=tf(e.sa);ty(t,"RID","rpc"),ty(t,"SID",e.I),ty(t,"CI",e.L?"0":"1"),ty(t,"AID",e.T),ty(t,"TYPE","xmlhttp"),nu(e,t),e.o&&e.s&&ne(t,e.o,e.s),e.J&&e.g.setTimeout(e.J);var n=e.g;e=e.ka,n.K=1,n.v=tv(tf(t)),n.s=null,n.P=!0,tt(n,e)}function np(e){null!=e.v&&(v.clearTimeout(e.v),e.v=null)}function ng(e,t){var n=null;if(e.g==t){np(e),nh(e),e.g=null;var r=2}else{if(!tj(e.h,t))return;n=t.D,tF(e.h,t),r=1}if(0!=e.G){if(e.pa=t.Y,t.i){if(1==r){n=t.s?t.s.length:0,t=Date.now()-t.F;var i,o=e.C;ew(r=ez(),new eK(r,n)),ns(e)}else nc(e)}else if(3==(o=t.o)||0==o&&0<e.pa||!(1==r&&(i=t,!(tU(e.h)>=e.h.j-(e.m?1:0))&&(e.m?(e.i=i.D.concat(e.i),!0):1!=e.G&&2!=e.G&&!(e.C>=(e.Za?0:e.$a))&&(e.m=eJ(k(e.Ja,e,i),nm(e,e.C)),e.C++,!0)))||2==r&&nd(e)))switch(n&&0<n.length&&((t=e.h).i=t.i.concat(n)),o){case 1:ny(e,5);break;case 4:ny(e,10);break;case 3:ny(e,6);break;default:ny(e,2)}}}function nm(e,t){let n=e.Xa+Math.floor(Math.random()*e.bb);return e.l||(n*=2),n*t}function ny(e,t){if(e.j.info("Error code "+t),2==t){var n=null;e.l&&(n=null);var r=k(e.kb,e);n||(n=new th("//www.google.com/images/cleardot.gif"),v.location&&"http"==v.location.protocol||tp(n,"https"),tv(n)),function(e,t){let n=new eq;if(v.Image){let r=new Image;r.onload=I(tV,n,r,"TestLoadImage: loaded",!0,t),r.onerror=I(tV,n,r,"TestLoadImage: error",!1,t),r.onabort=I(tV,n,r,"TestLoadImage: abort",!1,t),r.ontimeout=I(tV,n,r,"TestLoadImage: timeout",!1,t),v.setTimeout(function(){r.ontimeout&&r.ontimeout()},1e4),r.src=e}else t(!1)}(n.toString(),r)}else eH(2);e.G=0,e.l&&e.l.va(t),nv(e),no(e)}function nv(e){if(e.G=0,e.la=[],e.l){let t=t$(e.h);(0!=t.length||0!=e.i.length)&&(O(e.la,t),O(e.la,e.i),e.h.i.length=0,A(e.i),e.i.length=0),e.l.ua()}}function n_(e,t,n){var r=n instanceof th?tf(n):new th(n,void 0);if(""!=r.g)t&&(r.g=t+"."+r.g),tg(r,r.m);else{var i=v.location;r=i.protocol,t=t?t+"."+i.hostname:i.hostname,i=+i.port;var o=new th(null,void 0);r&&tp(o,r),t&&(o.g=t),i&&tg(o,i),n&&(o.l=n),r=o}return n=e.D,t=e.za,n&&t&&ty(r,n,t),ty(r,"VER",e.ma),nu(e,r),r}function nb(e,t,n){if(t&&!e.H)throw Error("Can't create secondary domain capable XhrIo object.");return(t=new tZ(n&&e.Da&&!e.ra?new tG({jb:!0}):e.ra)).Ka(e.H),t}function nw(){}function nS(){if(F&&!(10<=Number(Q)))throw Error("Environmental error: no available transport.")}function nE(e,t){eb.call(this),this.g=new nn(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.g.s=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.ya&&(e?e["X-WebChannel-Client-Profile"]=t.ya:e={"X-WebChannel-Client-Profile":t.ya}),this.g.S=e,(e=t&&t.Yb)&&!D(e)&&(this.g.o=e),this.A=t&&t.supportsCrossDomainXhr||!1,this.v=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!D(t)&&(this.g.D=t,null!==(e=this.h)&&t in e&&t in(e=this.h)&&delete e[t]),this.j=new nT(this)}function nk(e){e2.call(this);var t=e.__sm__;if(t){t:{for(let n in t){e=n;break t}e=void 0}(this.i=e)&&(e=this.i,t=null!==t&&e in t?t[e]:void 0),this.data=t}else this.data=e}function nI(){e3.call(this),this.status=1}function nT(e){this.g=e}(c=tZ.prototype).Ka=function(e){this.L=e},c.da=function(e,t,n,r){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.H+"; newUri="+e);t=t?t.toUpperCase():"GET",this.H=e,this.j="",this.m=0,this.D=!1,this.h=!0,this.g=this.u?this.u.g():a.g(),this.C=this.u?eY(this.u):eY(a),this.g.onreadystatechange=k(this.Ha,this);try{this.F=!0,this.g.open(t,String(e),!0),this.F=!1}catch(e){t2(this,e);return}if(e=n||"",n=new Map(this.headers),r){if(Object.getPrototypeOf(r)===Object.prototype)for(var o in r)n.set(o,r[o]);else if("function"==typeof r.keys&&"function"==typeof r.get)for(let e of r.keys())n.set(e,r.get(e));else throw Error("Unknown input type for opt_headers: "+String(r))}for(let[i,s]of(r=Array.from(n.keys()).find(e=>"content-type"==e.toLowerCase()),o=v.FormData&&e instanceof v.FormData,!(0<=C(t1,t))||r||o||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),n))this.g.setRequestHeader(i,s);this.J&&(this.g.responseType=this.J),"withCredentials"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{var s;t6(this),0<this.B&&((this.K=(s=this.g,F&&(Object.prototype.hasOwnProperty.call(X,9)?X[9]:X[9]=function(){let e=0,t=P(String(i)).split("."),n=P("9").split("."),r=Math.max(t.length,n.length);for(let i=0;0==e&&i<r;i++){var o=t[i]||"",s=n[i]||"";do{if(o=/(\d*)(\D*)(.*)/.exec(o)||["","","",""],s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],0==o[0].length&&0==s[0].length)break;e=M(0==o[1].length?0:parseInt(o[1],10),0==s[1].length?0:parseInt(s[1],10))||M(0==o[2].length,0==s[2].length)||M(o[2],s[2]),o=o[3],s=s[3]}while(0==e)}return 0<=e}(9))&&"number"==typeof s.timeout&&void 0!==s.ontimeout))?(this.g.timeout=this.B,this.g.ontimeout=k(this.qa,this)):this.A=eD(this.qa,this.B,this)),this.v=!0,this.g.send(e),this.v=!1}catch(e){t2(this,e)}},c.qa=function(){void 0!==y&&this.g&&(this.j="Timed out after "+this.B+"ms, aborting",this.m=8,ew(this,"timeout"),this.abort(8))},c.abort=function(e){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=e||7,ew(this,"complete"),ew(this,"abort"),t5(this))},c.M=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),t5(this,!0)),tZ.X.M.call(this)},c.Ha=function(){this.s||(this.F||this.v||this.l?t4(this):this.fb())},c.fb=function(){t4(this)},c.aa=function(){try{return 2<t9(this)?this.g.status:-1}catch(e){return -1}},c.fa=function(){try{return this.g?this.g.responseText:""}catch(e){return""}},c.Sa=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),tQ(t)}},c.Ea=function(){return this.m},c.Oa=function(){return"string"==typeof this.j?this.j:String(this.j)},(c=nn.prototype).ma=8,c.G=1,c.Ja=function(e){if(this.m){if(this.m=null,1==this.G){if(!e){this.U=Math.floor(1e5*Math.random()),e=this.U++;let i=new e5(this,this.j,e,void 0),o=this.s;if(this.S&&(o?ea(o=eo(o),this.S):o=this.S),null!==this.o||this.N||(i.H=o,o=null),this.O)t:{for(var t=0,n=0;n<this.i.length;n++){n:{var r=this.i[n];if("__data__"in r.g&&"string"==typeof(r=r.g.__data__)){r=r.length;break n}r=void 0}if(void 0===r)break;if(4096<(t+=r)){t=n;break t}if(4096===t||n===this.i.length-1){t=n+1;break t}}t=1e3}else t=1e3;t=nl(this,i,t),ty(n=tf(this.F),"RID",e),ty(n,"CVER",22),this.D&&ty(n,"X-HTTP-Session-Id",this.D),nu(this,n),o&&(this.N?t="headers="+encodeURIComponent(String(t7(o)))+"&"+t:this.o&&ne(n,this.o,o)),tq(this.h,i),this.Ya&&ty(n,"TYPE","init"),this.O?(ty(n,"$req",t),ty(n,"SID","null"),i.Z=!0,te(i,n,null)):te(i,n,t),this.G=2}}else 3==this.G&&(e?na(this,e):0==this.i.length||tL(this.h)||na(this))}},c.Ia=function(){if(this.u=null,nf(this),this.$&&!(this.K||null==this.g||0>=this.P)){var e=2*this.P;this.j.info("BP detection timer enabled: "+e),this.B=eJ(k(this.eb,this),e)}},c.eb=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.L=!1,this.K=!0,eH(10),ni(this),nf(this))},c.cb=function(){null!=this.v&&(this.v=null,ni(this),nd(this),eH(19))},c.kb=function(e){e?(this.j.info("Successfully pinged google.com"),eH(2)):(this.j.info("Failed to ping google.com"),eH(1))},(c=nw.prototype).xa=function(){},c.wa=function(){},c.va=function(){},c.ua=function(){},c.Ra=function(){},nS.prototype.g=function(e,t){return new nE(e,t)},T(nE,eb),nE.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.H=!0);var e=this.g,t=this.l,n=this.h||void 0;eH(0),e.V=t,e.ia=n||{},e.L=e.Y,e.F=n_(e,null,e.V),ns(e)},nE.prototype.close=function(){nr(this.g)},nE.prototype.u=function(e){var t=this.g;if("string"==typeof e){var n={};n.__data__=e,e=n}else this.v&&((n={}).__data__=eE(e),e=n);t.i.push(new tD(t.ab++,e)),3==t.G&&ns(t)},nE.prototype.M=function(){this.g.l=null,delete this.j,nr(this.g),delete this.g,nE.X.M.call(this)},T(nk,e2),T(nI,e3),T(nT,nw),nT.prototype.xa=function(){ew(this.g,"a")},nT.prototype.wa=function(e){ew(this.g,new nk(e))},nT.prototype.va=function(e){ew(this.g,new nI)},nT.prototype.ua=function(){ew(this.g,"b")},nS.prototype.createWebChannel=nS.prototype.g,nE.prototype.send=nE.prototype.u,nE.prototype.open=nE.prototype.m,nE.prototype.close=nE.prototype.close,eX.NO_ERROR=0,eX.TIMEOUT=8,eX.HTTP_ERROR=6,eQ.COMPLETE="complete",e0.EventType=e1,e1.OPEN="a",e1.CLOSE="b",e1.ERROR="c",e1.MESSAGE="d",eb.prototype.listen=eb.prototype.N,tZ.prototype.listenOnce=tZ.prototype.O,tZ.prototype.getLastError=tZ.prototype.Oa,tZ.prototype.getLastErrorCode=tZ.prototype.Ea,tZ.prototype.getStatus=tZ.prototype.aa,tZ.prototype.getResponseJson=tZ.prototype.Sa,tZ.prototype.getResponseText=tZ.prototype.fa,tZ.prototype.send=tZ.prototype.da,tZ.prototype.setWithCredentials=tZ.prototype.Ka;var nx=m.createWebChannelTransport=function(){return new nS},nC=m.getStatEventTarget=function(){return ez()},nA=m.ErrorCode=eX,nO=m.EventType=eQ,nN=m.Event=e$,nR=m.Stat={sb:0,vb:1,wb:2,Pb:3,Ub:4,Rb:5,Sb:6,Qb:7,Ob:8,Tb:9,PROXY:10,NOPROXY:11,Mb:12,Ib:13,Jb:14,Hb:15,Kb:16,Lb:17,ob:18,nb:19,pb:20},nD=m.FetchXmlHttpFactory=tG,nP=m.WebChannel=e0,nM=m.XhrIo=tZ;n(83454);let nL="@firebase/firestore";/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nU{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}nU.UNAUTHENTICATED=new nU(null),nU.GOOGLE_CREDENTIALS=new nU("google-credentials-uid"),nU.FIRST_PARTY=new nU("first-party-uid"),nU.MOCK_USER=new nU("mock-user");/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let nj="9.19.0",nq=new f.Yd("@firebase/firestore");function nF(){return nq.logLevel}function n$(e,...t){if(nq.logLevel<=f.in.DEBUG){let n=t.map(nV);nq.debug(`Firestore (${nj}): ${e}`,...n)}}function nB(e,...t){if(nq.logLevel<=f.in.ERROR){let n=t.map(nV);nq.error(`Firestore (${nj}): ${e}`,...n)}}function nz(e,...t){if(nq.logLevel<=f.in.WARN){let n=t.map(nV);nq.warn(`Firestore (${nj}): ${e}`,...n)}}function nV(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(t){return e}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function nG(e="Unexpected state"){let t=`FIRESTORE (${nj}) INTERNAL ASSERTION FAILED: `+e;throw nB(t),Error(t)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let nW={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class nH extends p.ZR{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nK{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class nJ{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class nX{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(nU.UNAUTHENTICATED))}shutdown(){}}class nQ{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class nZ{constructor(e){this.t=e,this.currentUser=nU.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){let n=this.i,r=e=>this.i!==n?(n=this.i,t(e)):Promise.resolve(),i=new nK;this.o=()=>{this.i++,this.currentUser=this.u(),i.resolve(),i=new nK,e.enqueueRetryable(()=>r(this.currentUser))};let o=()=>{let t=i;e.enqueueRetryable(async()=>{await t.promise,await r(this.currentUser)})},s=e=>{n$("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=e,this.auth.addAuthTokenListener(this.o),o()};this.t.onInit(e=>s(e)),setTimeout(()=>{if(!this.auth){let e=this.t.getImmediate({optional:!0});e?s(e):(n$("FirebaseAuthCredentialsProvider","Auth not yet detected"),i.resolve(),i=new nK)}},0),o()}getToken(){let e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(t=>this.i!==e?(n$("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?("string"==typeof t.accessToken||nG(),new nJ(t.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){let e=this.auth&&this.auth.getUid();return null===e||"string"==typeof e||nG(),new nU(e)}}class nY{constructor(e,t,n){this.h=e,this.l=t,this.m=n,this.type="FirstParty",this.user=nU.FIRST_PARTY,this.g=new Map}p(){return this.m?this.m():null}get headers(){this.g.set("X-Goog-AuthUser",this.h);let e=this.p();return e&&this.g.set("Authorization",e),this.l&&this.g.set("X-Goog-Iam-Authorization-Token",this.l),this.g}}class n0{constructor(e,t,n){this.h=e,this.l=t,this.m=n}getToken(){return Promise.resolve(new nY(this.h,this.l,this.m))}start(e,t){e.enqueueRetryable(()=>t(nU.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class n1{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class n2{constructor(e){this.I=e,this.forceRefresh=!1,this.appCheck=null,this.T=null}start(e,t){let n=e=>{null!=e.error&&n$("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${e.error.message}`);let n=e.token!==this.T;return this.T=e.token,n$("FirebaseAppCheckTokenProvider",`Received ${n?"new":"existing"} token.`),n?t(e.token):Promise.resolve()};this.o=t=>{e.enqueueRetryable(()=>n(t))};let r=e=>{n$("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=e,this.appCheck.addTokenListener(this.o)};this.I.onInit(e=>r(e)),setTimeout(()=>{if(!this.appCheck){let e=this.I.getImmediate({optional:!0});e?r(e):n$("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){let e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(e=>e?("string"==typeof e.token||nG(),this.T=e.token,new n1(e.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class n3{static A(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=Math.floor(256/e.length)*e.length,n="";for(;n.length<20;){let r=/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e){let t="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(n);else for(let t=0;t<e;t++)n[t]=Math.floor(256*Math.random());return n}(40);for(let i=0;i<r.length;++i)n.length<20&&r[i]<t&&(n+=e.charAt(r[i]%e.length))}return n}}function n4(e,t){return e<t?-1:e>t?1:0}function n5(e,t,n){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class n6{constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0||t>=1e9)throw new nH(nW.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-62135596800||e>=253402300800)throw new nH(nW.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return n6.fromMillis(Date.now())}static fromDate(e){return n6.fromMillis(e.getTime())}static fromMillis(e){let t=Math.floor(e/1e3);return new n6(t,Math.floor(1e6*(e-1e3*t)))}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?n4(this.nanoseconds,e.nanoseconds):n4(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){return String(this.seconds- -62135596800).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class n9{constructor(e){this.timestamp=e}static fromTimestamp(e){return new n9(e)}static min(){return new n9(new n6(0,0))}static max(){return new n9(new n6(253402300799,999999999))}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class n8{constructor(e,t,n){void 0===t?t=0:t>e.length&&nG(),void 0===n?n=e.length-t:n>e.length-t&&nG(),this.segments=e,this.offset=t,this.len=n}get length(){return this.len}isEqual(e){return 0===n8.comparator(this,e)}child(e){let t=this.segments.slice(this.offset,this.limit());return e instanceof n8?e.forEach(e=>{t.push(e)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return 0===this.length}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,n=this.limit();t<n;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e.get(r),i=t.get(r);if(n<i)return -1;if(n>i)return 1}return e.length<t.length?-1:e.length>t.length?1:0}}class n7 extends n8{construct(e,t,n){return new n7(e,t,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}static fromString(...e){let t=[];for(let n of e){if(n.indexOf("//")>=0)throw new nH(nW.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);t.push(...n.split("/").filter(e=>e.length>0))}return new n7(t)}static emptyPath(){return new n7([])}}let re=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class rt extends n8{construct(e,t,n){return new rt(e,t,n)}static isValidIdentifier(e){return re.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),rt.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&"__name__"===this.get(0)}static keyField(){return new rt(["__name__"])}static fromServerFormat(e){let t=[],n="",r=0,i=()=>{if(0===n.length)throw new nH(nW.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(n),n=""},o=!1;for(;r<e.length;){let t=e[r];if("\\"===t){if(r+1===e.length)throw new nH(nW.INVALID_ARGUMENT,"Path has trailing escape character: "+e);let t=e[r+1];if("\\"!==t&&"."!==t&&"`"!==t)throw new nH(nW.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);n+=t,r+=2}else"`"===t?o=!o:"."!==t||o?n+=t:i(),r++}if(i(),o)throw new nH(nW.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new rt(t)}static emptyPath(){return new rt([])}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class rn{constructor(e){this.path=e}static fromPath(e){return new rn(n7.fromString(e))}static fromName(e){return new rn(n7.fromString(e).popFirst(5))}static empty(){return new rn(n7.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return null!==e&&0===n7.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return n7.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new rn(new n7(e.slice()))}}/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class rr{constructor(e,t,n,r){this.indexId=e,this.collectionGroup=t,this.fields=n,this.indexState=r}}rr.UNKNOWN_ID=-1;class ri{constructor(e,t,n){this.readTime=e,this.documentKey=t,this.largestBatchId=n}static min(){return new ri(n9.min(),rn.empty(),-1)}static max(){return new ri(n9.max(),rn.empty(),-1)}}class ro{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function rs(e){if(e.code!==nW.FAILED_PRECONDITION||"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab."!==e.message)throw e;n$("LocalStore","Unexpectedly lost primary lease")}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ra{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(e=>{this.isDone=!0,this.result=e,this.nextCallback&&this.nextCallback(e)},e=>{this.isDone=!0,this.error=e,this.catchCallback&&this.catchCallback(e)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&nG(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new ra((n,r)=>{this.nextCallback=t=>{this.wrapSuccess(e,t).next(n,r)},this.catchCallback=e=>{this.wrapFailure(t,e).next(n,r)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{let t=e();return t instanceof ra?t:ra.resolve(t)}catch(e){return ra.reject(e)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):ra.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):ra.reject(t)}static resolve(e){return new ra((t,n)=>{t(e)})}static reject(e){return new ra((t,n)=>{n(e)})}static waitFor(e){return new ra((t,n)=>{let r=0,i=0,o=!1;e.forEach(e=>{++r,e.next(()=>{++i,o&&i===r&&t()},e=>n(e))}),o=!0,i===r&&t()})}static or(e){let t=ra.resolve(!1);for(let n of e)t=t.next(e=>e?ra.resolve(e):n());return t}static forEach(e,t){let n=[];return e.forEach((e,r)=>{n.push(t.call(this,e,r))}),this.waitFor(n)}static mapArray(e,t){return new ra((n,r)=>{let i=e.length,o=Array(i),s=0;for(let a=0;a<i;a++){let u=a;t(e[u]).next(e=>{o[u]=e,++s===i&&n(o)},e=>r(e))}})}static doWhile(e,t){return new ra((n,r)=>{let i=()=>{!0===e()?t().next(()=>{i()},r):n()};i()})}}function ru(e){return"IndexedDbTransactionError"===e.name}/**
 * @license
 * Copyright 2018 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class rl{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this.ot(e),this.ut=e=>t.writeSequenceNumber(e))}ot(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){let e=++this.previousValue;return this.ut&&this.ut(e),e}}function rc(e){return 0===e&&1/e==-1/0}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function rd(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function rh(e,t){for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function rf(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}rl.ct=-1;/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class rp{constructor(e,t){this.comparator=e,this.root=t||rm.EMPTY}insert(e,t){return new rp(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,rm.BLACK,null,null))}remove(e){return new rp(this.comparator,this.root.remove(e,this.comparator).copy(null,null,rm.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){let n=this.comparator(e,t.key);if(0===n)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null}indexOf(e){let t=0,n=this.root;for(;!n.isEmpty();){let r=this.comparator(e,n.key);if(0===r)return t+n.left.size;r<0?n=n.left:(t+=n.left.size+1,n=n.right)}return -1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,n)=>(e(t,n),!1))}toString(){let e=[];return this.inorderTraversal((t,n)=>(e.push(`${t}:${n}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new rg(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new rg(this.root,e,this.comparator,!1)}getReverseIterator(){return new rg(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new rg(this.root,e,this.comparator,!0)}}class rg{constructor(e,t,n,r){this.isReverse=r,this.nodeStack=[];let i=1;for(;!e.isEmpty();)if(i=t?n(e.key,t):1,t&&r&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(0===i){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop(),t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;let e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class rm{constructor(e,t,n,r,i){this.key=e,this.value=t,this.color=null!=n?n:rm.RED,this.left=null!=r?r:rm.EMPTY,this.right=null!=i?i:rm.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,n,r,i){return new rm(null!=e?e:this.key,null!=t?t:this.value,null!=n?n:this.color,null!=r?r:this.left,null!=i?i:this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let r=this,i=n(e,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n))).fixUp()}removeMin(){if(this.left.isEmpty())return rm.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),(e=e.copy(null,null,null,e.left.removeMin(),null)).fixUp()}remove(e,t){let n,r=this;if(0>t(e,r.key))r.left.isEmpty()||r.left.isRed()||r.left.left.isRed()||(r=r.moveRedLeft()),r=r.copy(null,null,null,r.left.remove(e,t),null);else{if(r.left.isRed()&&(r=r.rotateRight()),r.right.isEmpty()||r.right.isRed()||r.right.left.isRed()||(r=r.moveRedRight()),0===t(e,r.key)){if(r.right.isEmpty())return rm.EMPTY;n=r.right.min(),r=r.copy(n.key,n.value,null,null,r.right.removeMin())}r=r.copy(null,null,null,null,r.right.remove(e,t))}return r.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=(e=(e=e.copy(null,null,null,null,e.right.rotateRight())).rotateLeft()).colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=(e=e.rotateRight()).colorFlip()),e}rotateLeft(){let e=this.copy(null,null,rm.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){let e=this.copy(null,null,rm.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){let e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){return Math.pow(2,this.check())<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw nG();let e=this.left.check();if(e!==this.right.check())throw nG();return e+(this.isRed()?0:1)}}rm.EMPTY=null,rm.RED=!0,rm.BLACK=!1,rm.EMPTY=new class{constructor(){this.size=0}get key(){throw nG()}get value(){throw nG()}get color(){throw nG()}get left(){throw nG()}get right(){throw nG()}copy(e,t,n,r,i){return this}insert(e,t,n){return new rm(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ry{constructor(e){this.comparator=e,this.data=new rp(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,n)=>(e(t),!1))}forEachInRange(e,t){let n=this.data.getIteratorFrom(e[0]);for(;n.hasNext();){let r=n.getNext();if(this.comparator(r.key,e[1])>=0)return;t(r.key)}}forEachWhile(e,t){let n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return}firstAfterOrEqual(e){let t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new rv(this.data.getIterator())}getIteratorFrom(e){return new rv(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size<e.size&&(t=e,e=this),e.forEach(e=>{t=t.add(e)}),t}isEqual(e){if(!(e instanceof ry)||this.size!==e.size)return!1;let t=this.data.getIterator(),n=e.data.getIterator();for(;t.hasNext();){let e=t.getNext().key,r=n.getNext().key;if(0!==this.comparator(e,r))return!1}return!0}toArray(){let e=[];return this.forEach(t=>{e.push(t)}),e}toString(){let e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){let t=new ry(this.comparator);return t.data=e,t}}class rv{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class r_{constructor(e){this.fields=e,e.sort(rt.comparator)}static empty(){return new r_([])}unionWith(e){let t=new ry(rt.comparator);for(let e of this.fields)t=t.add(e);for(let n of e)t=t.add(n);return new r_(t.toArray())}covers(e){for(let t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return n5(this.fields,e.fields,(e,t)=>e.isEqual(t))}}/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class rb extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class rw{constructor(e){this.binaryString=e}static fromBase64String(e){return new rw(function(e){try{return atob(e)}catch(e){throw"undefined"!=typeof DOMException&&e instanceof DOMException?new rb("Invalid base64 string: "+e):e}}(e))}static fromUint8Array(e){return new rw(function(e){let t="";for(let n=0;n<e.length;++n)t+=String.fromCharCode(e[n]);return t}(e))}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return btoa(this.binaryString)}toUint8Array(){return function(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return n4(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}rw.EMPTY_BYTE_STRING=new rw("");let rS=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function rE(e){if(e||nG(),"string"==typeof e){let t=0,n=rS.exec(e);if(n||nG(),n[1]){let e=n[1];t=Number(e=(e+"000000000").substr(0,9))}return{seconds:Math.floor(new Date(e).getTime()/1e3),nanos:t}}return{seconds:rk(e.seconds),nanos:rk(e.nanos)}}function rk(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function rI(e){return"string"==typeof e?rw.fromBase64String(e):rw.fromUint8Array(e)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function rT(e){var t,n;return"server_timestamp"===(null===(n=((null===(t=null==e?void 0:e.mapValue)||void 0===t?void 0:t.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}function rx(e){let t=rE(e.mapValue.fields.__local_write_time__.timestampValue);return new n6(t.seconds,t.nanos)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class rC{constructor(e,t,n,r,i,o,s,a){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=r,this.ssl=i,this.forceLongPolling=o,this.autoDetectLongPolling=s,this.useFetchStreams=a}}class rA{constructor(e,t){this.projectId=e,this.database=t||"(default)"}static empty(){return new rA("","")}get isDefaultDatabase(){return"(default)"===this.database}isEqual(e){return e instanceof rA&&e.projectId===this.projectId&&e.database===this.database}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let rO={mapValue:{fields:{__type__:{stringValue:"__max__"}}}};function rN(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?rT(e)?4:rV(e)?9007199254740991:10:nG()}function rR(e,t){if(e===t)return!0;let n=rN(e);if(n!==rN(t))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return rx(e).isEqual(rx(t));case 3:return function(e,t){if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;let n=rE(e.timestampValue),r=rE(t.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return rI(e.bytesValue).isEqual(rI(t.bytesValue));case 7:return e.referenceValue===t.referenceValue;case 8:return rk(e.geoPointValue.latitude)===rk(t.geoPointValue.latitude)&&rk(e.geoPointValue.longitude)===rk(t.geoPointValue.longitude);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return rk(e.integerValue)===rk(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){let n=rk(e.doubleValue),r=rk(t.doubleValue);return n===r?rc(n)===rc(r):isNaN(n)&&isNaN(r)}return!1}(e,t);case 9:return n5(e.arrayValue.values||[],t.arrayValue.values||[],rR);case 10:return function(e,t){let n=e.mapValue.fields||{},r=t.mapValue.fields||{};if(rd(n)!==rd(r))return!1;for(let e in n)if(n.hasOwnProperty(e)&&(void 0===r[e]||!rR(n[e],r[e])))return!1;return!0}(e,t);default:return nG()}}function rD(e,t){return void 0!==(e.values||[]).find(e=>rR(e,t))}function rP(e,t){if(e===t)return 0;let n=rN(e),r=rN(t);if(n!==r)return n4(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return n4(e.booleanValue,t.booleanValue);case 2:return function(e,t){let n=rk(e.integerValue||e.doubleValue),r=rk(t.integerValue||t.doubleValue);return n<r?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(e,t);case 3:return rM(e.timestampValue,t.timestampValue);case 4:return rM(rx(e),rx(t));case 5:return n4(e.stringValue,t.stringValue);case 6:return function(e,t){let n=rI(e),r=rI(t);return n.compareTo(r)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){let n=e.split("/"),r=t.split("/");for(let e=0;e<n.length&&e<r.length;e++){let t=n4(n[e],r[e]);if(0!==t)return t}return n4(n.length,r.length)}(e.referenceValue,t.referenceValue);case 8:return function(e,t){let n=n4(rk(e.latitude),rk(t.latitude));return 0!==n?n:n4(rk(e.longitude),rk(t.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return function(e,t){let n=e.values||[],r=t.values||[];for(let e=0;e<n.length&&e<r.length;++e){let t=rP(n[e],r[e]);if(t)return t}return n4(n.length,r.length)}(e.arrayValue,t.arrayValue);case 10:return function(e,t){if(e===rO.mapValue&&t===rO.mapValue)return 0;if(e===rO.mapValue)return 1;if(t===rO.mapValue)return -1;let n=e.fields||{},r=Object.keys(n),i=t.fields||{},o=Object.keys(i);r.sort(),o.sort();for(let e=0;e<r.length&&e<o.length;++e){let t=n4(r[e],o[e]);if(0!==t)return t;let s=rP(n[r[e]],i[o[e]]);if(0!==s)return s}return n4(r.length,o.length)}(e.mapValue,t.mapValue);default:throw nG()}}function rM(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return n4(e,t);let n=rE(e),r=rE(t),i=n4(n.seconds,r.seconds);return 0!==i?i:n4(n.nanos,r.nanos)}function rL(e){var t,n;return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(e){let t=rE(e);return`time(${t.seconds},${t.nanos})`}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?rI(e.bytesValue).toBase64():"referenceValue"in e?(n=e.referenceValue,rn.fromName(n).toString()):"geoPointValue"in e?`geo(${(t=e.geoPointValue).latitude},${t.longitude})`:"arrayValue"in e?function(e){let t="[",n=!0;for(let r of e.values||[])n?n=!1:t+=",",t+=rL(r);return t+"]"}(e.arrayValue):"mapValue"in e?function(e){let t=Object.keys(e.fields||{}).sort(),n="{",r=!0;for(let i of t)r?r=!1:n+=",",n+=`${i}:${rL(e.fields[i])}`;return n+"}"}(e.mapValue):nG()}function rU(e,t){return{referenceValue:`projects/${e.projectId}/databases/${e.database}/documents/${t.path.canonicalString()}`}}function rj(e){return!!e&&"integerValue"in e}function rq(e){return!!e&&"arrayValue"in e}function rF(e){return!!e&&"nullValue"in e}function r$(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function rB(e){return!!e&&"mapValue"in e}function rz(e){if(e.geoPointValue)return{geoPointValue:Object.assign({},e.geoPointValue)};if(e.timestampValue&&"object"==typeof e.timestampValue)return{timestampValue:Object.assign({},e.timestampValue)};if(e.mapValue){let t={mapValue:{fields:{}}};return rh(e.mapValue.fields,(e,n)=>t.mapValue.fields[e]=rz(n)),t}if(e.arrayValue){let t={arrayValue:{values:[]}};for(let n=0;n<(e.arrayValue.values||[]).length;++n)t.arrayValue.values[n]=rz(e.arrayValue.values[n]);return t}return Object.assign({},e)}function rV(e){return"__max__"===(((e.mapValue||{}).fields||{}).__type__||{}).stringValue}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class rG{constructor(e){this.value=e}static empty(){return new rG({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let n=0;n<e.length-1;++n)if(!rB(t=(t.mapValue.fields||{})[e.get(n)]))return null;return(t=(t.mapValue.fields||{})[e.lastSegment()])||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=rz(t)}setAll(e){let t=rt.emptyPath(),n={},r=[];e.forEach((e,i)=>{if(!t.isImmediateParentOf(i)){let e=this.getFieldsMap(t);this.applyChanges(e,n,r),n={},r=[],t=i.popLast()}e?n[i.lastSegment()]=rz(e):r.push(i.lastSegment())});let i=this.getFieldsMap(t);this.applyChanges(i,n,r)}delete(e){let t=this.field(e.popLast());rB(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return rR(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let n=0;n<e.length;++n){let r=t.mapValue.fields[e.get(n)];rB(r)&&r.mapValue.fields||(r={mapValue:{fields:{}}},t.mapValue.fields[e.get(n)]=r),t=r}return t.mapValue.fields}applyChanges(e,t,n){for(let r of(rh(t,(t,n)=>e[t]=n),n))delete e[r]}clone(){return new rG(rz(this.value))}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class rW{constructor(e,t,n,r,i,o,s){this.key=e,this.documentType=t,this.version=n,this.readTime=r,this.createTime=i,this.data=o,this.documentState=s}static newInvalidDocument(e){return new rW(e,0,n9.min(),n9.min(),n9.min(),rG.empty(),0)}static newFoundDocument(e,t,n,r){return new rW(e,1,t,n9.min(),n,r,0)}static newNoDocument(e,t){return new rW(e,2,t,n9.min(),n9.min(),rG.empty(),0)}static newUnknownDocument(e,t){return new rW(e,3,t,n9.min(),n9.min(),rG.empty(),2)}convertToFoundDocument(e,t){return this.createTime.isEqual(n9.min())&&(2===this.documentType||0===this.documentType)&&(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=rG.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=rG.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=n9.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(e){return e instanceof rW&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new rW(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class rH{constructor(e,t){this.position=e,this.inclusive=t}}function rK(e,t,n){let r=0;for(let i=0;i<e.position.length;i++){let o=t[i],s=e.position[i];if(r=o.field.isKeyField()?rn.comparator(rn.fromName(s.referenceValue),n.key):rP(s,n.data.field(o.field)),"desc"===o.dir&&(r*=-1),0!==r)break}return r}function rJ(e,t){if(null===e)return null===t;if(null===t||e.inclusive!==t.inclusive||e.position.length!==t.position.length)return!1;for(let n=0;n<e.position.length;n++)if(!rR(e.position[n],t.position[n]))return!1;return!0}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class rX{constructor(e,t="asc"){this.field=e,this.dir=t}}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class rQ{}class rZ extends rQ{constructor(e,t,n){super(),this.field=e,this.op=t,this.value=n}static create(e,t,n){return e.isKeyField()?"in"===t||"not-in"===t?this.createKeyFieldInFilter(e,t,n):new r2(e,t,n):"array-contains"===t?new r6(e,n):"in"===t?new r9(e,n):"not-in"===t?new r8(e,n):"array-contains-any"===t?new r7(e,n):new rZ(e,t,n)}static createKeyFieldInFilter(e,t,n){return"in"===t?new r3(e,n):new r4(e,n)}matches(e){let t=e.data.field(this.field);return"!="===this.op?null!==t&&this.matchesComparison(rP(t,this.value)):null!==t&&rN(this.value)===rN(t)&&this.matchesComparison(rP(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return 0===e;case"!=":return 0!==e;case">":return e>0;case">=":return e>=0;default:return nG()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}getFirstInequalityField(){return this.isInequality()?this.field:null}}class rY extends rQ{constructor(e,t){super(),this.filters=e,this.op=t,this.ht=null}static create(e,t){return new rY(e,t)}matches(e){return r0(this)?void 0===this.filters.find(t=>!t.matches(e)):void 0!==this.filters.find(t=>t.matches(e))}getFlattenedFilters(){return null!==this.ht||(this.ht=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.ht}getFilters(){return Object.assign([],this.filters)}getFirstInequalityField(){let e=this.lt(e=>e.isInequality());return null!==e?e.field:null}lt(e){for(let t of this.getFlattenedFilters())if(e(t))return t;return null}}function r0(e){return"and"===e.op}function r1(e){for(let t of e.filters)if(t instanceof rY)return!1;return!0}class r2 extends rZ{constructor(e,t,n){super(e,t,n),this.key=rn.fromName(n.referenceValue)}matches(e){let t=rn.comparator(e.key,this.key);return this.matchesComparison(t)}}class r3 extends rZ{constructor(e,t){super(e,"in",t),this.keys=r5("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class r4 extends rZ{constructor(e,t){super(e,"not-in",t),this.keys=r5("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function r5(e,t){var n;return((null===(n=t.arrayValue)||void 0===n?void 0:n.values)||[]).map(e=>rn.fromName(e.referenceValue))}class r6 extends rZ{constructor(e,t){super(e,"array-contains",t)}matches(e){let t=e.data.field(this.field);return rq(t)&&rD(t.arrayValue,this.value)}}class r9 extends rZ{constructor(e,t){super(e,"in",t)}matches(e){let t=e.data.field(this.field);return null!==t&&rD(this.value.arrayValue,t)}}class r8 extends rZ{constructor(e,t){super(e,"not-in",t)}matches(e){if(rD(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;let t=e.data.field(this.field);return null!==t&&!rD(this.value.arrayValue,t)}}class r7 extends rZ{constructor(e,t){super(e,"array-contains-any",t)}matches(e){let t=e.data.field(this.field);return!(!rq(t)||!t.arrayValue.values)&&t.arrayValue.values.some(e=>rD(this.value.arrayValue,e))}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ie{constructor(e,t=null,n=[],r=[],i=null,o=null,s=null){this.path=e,this.collectionGroup=t,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=o,this.endAt=s,this.ft=null}}function it(e,t=null,n=[],r=[],i=null,o=null,s=null){return new ie(e,t,n,r,i,o,s)}function ir(e){if(null===e.ft){let t=e.path.canonicalString();null!==e.collectionGroup&&(t+="|cg:"+e.collectionGroup),t+="|f:"+e.filters.map(e=>(function e(t){if(t instanceof rZ)return t.field.canonicalString()+t.op.toString()+rL(t.value);if(r1(t)&&r0(t))return t.filters.map(t=>e(t)).join(",");{let n=t.filters.map(t=>e(t)).join(",");return`${t.op}(${n})`}})(e)).join(",")+"|ob:"+e.orderBy.map(e=>e.field.canonicalString()+e.dir).join(","),null==e.limit||(t+="|l:"+e.limit),e.startAt&&(t+="|lb:"+(e.startAt.inclusive?"b:":"a:")+e.startAt.position.map(e=>rL(e)).join(",")),e.endAt&&(t+="|ub:"+(e.endAt.inclusive?"a:":"b:")+e.endAt.position.map(e=>rL(e)).join(",")),e.ft=t}return e.ft}function ii(e,t){if(e.limit!==t.limit||e.orderBy.length!==t.orderBy.length)return!1;for(let i=0;i<e.orderBy.length;i++){var n,r;if(n=e.orderBy[i],r=t.orderBy[i],!(n.dir===r.dir&&n.field.isEqual(r.field)))return!1}if(e.filters.length!==t.filters.length)return!1;for(let n=0;n<e.filters.length;n++)if(!function e(t,n){return t instanceof rZ?n instanceof rZ&&t.op===n.op&&t.field.isEqual(n.field)&&rR(t.value,n.value):t instanceof rY?n instanceof rY&&t.op===n.op&&t.filters.length===n.filters.length&&t.filters.reduce((t,r,i)=>t&&e(r,n.filters[i]),!0):void nG()}(e.filters[n],t.filters[n]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!rJ(e.startAt,t.startAt)&&rJ(e.endAt,t.endAt)}function io(e){return rn.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class is{constructor(e,t=null,n=[],r=[],i=null,o="F",s=null,a=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=n,this.filters=r,this.limit=i,this.limitType=o,this.startAt=s,this.endAt=a,this.dt=null,this.wt=null,this.startAt,this.endAt}}function ia(e){return new is(e)}function iu(e){return 0===e.filters.length&&null===e.limit&&null==e.startAt&&null==e.endAt&&(0===e.explicitOrderBy.length||1===e.explicitOrderBy.length&&e.explicitOrderBy[0].field.isKeyField())}function il(e){return e.explicitOrderBy.length>0?e.explicitOrderBy[0].field:null}function ic(e){for(let t of e.filters){let e=t.getFirstInequalityField();if(null!==e)return e}return null}function id(e){return null!==e.collectionGroup}function ih(e){if(null===e.dt){e.dt=[];let t=ic(e),n=il(e);if(null!==t&&null===n)t.isKeyField()||e.dt.push(new rX(t)),e.dt.push(new rX(rt.keyField(),"asc"));else{let t=!1;for(let n of e.explicitOrderBy)e.dt.push(n),n.field.isKeyField()&&(t=!0);if(!t){let t=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";e.dt.push(new rX(rt.keyField(),t))}}}return e.dt}function ip(e){if(!e.wt){if("F"===e.limitType)e.wt=it(e.path,e.collectionGroup,ih(e),e.filters,e.limit,e.startAt,e.endAt);else{let t=[];for(let n of ih(e)){let e="desc"===n.dir?"asc":"desc";t.push(new rX(n.field,e))}let n=e.endAt?new rH(e.endAt.position,e.endAt.inclusive):null,r=e.startAt?new rH(e.startAt.position,e.startAt.inclusive):null;e.wt=it(e.path,e.collectionGroup,t,e.filters,e.limit,n,r)}}return e.wt}function ig(e,t){t.getFirstInequalityField(),ic(e);let n=e.filters.concat([t]);return new is(e.path,e.collectionGroup,e.explicitOrderBy.slice(),n,e.limit,e.limitType,e.startAt,e.endAt)}function im(e,t,n){return new is(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function iy(e,t){return ii(ip(e),ip(t))&&e.limitType===t.limitType}function iv(e){return`${ir(ip(e))}|lt:${e.limitType}`}function i_(e){var t;let n;return`Query(target=${n=(t=ip(e)).path.canonicalString(),null!==t.collectionGroup&&(n+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(n+=`, filters: [${t.filters.map(e=>(function e(t){return t instanceof rZ?`${t.field.canonicalString()} ${t.op} ${rL(t.value)}`:t instanceof rY?t.op.toString()+" {"+t.getFilters().map(e).join(" ,")+"}":"Filter"})(e)).join(", ")}]`),null==t.limit||(n+=", limit: "+t.limit),t.orderBy.length>0&&(n+=`, orderBy: [${t.orderBy.map(e=>`${e.field.canonicalString()} (${e.dir})`).join(", ")}]`),t.startAt&&(n+=", startAt: "+(t.startAt.inclusive?"b:":"a:")+t.startAt.position.map(e=>rL(e)).join(",")),t.endAt&&(n+=", endAt: "+(t.endAt.inclusive?"a:":"b:")+t.endAt.position.map(e=>rL(e)).join(",")),`Target(${n})`}; limitType=${e.limitType})`}function ib(e,t){return t.isFoundDocument()&&function(e,t){let n=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(n):rn.isDocumentKey(e.path)?e.path.isEqual(n):e.path.isImmediateParentOf(n)}(e,t)&&function(e,t){for(let n of ih(e))if(!n.field.isKeyField()&&null===t.data.field(n.field))return!1;return!0}(e,t)&&function(e,t){for(let n of e.filters)if(!n.matches(t))return!1;return!0}(e,t)&&(!e.startAt||!!function(e,t,n){let r=rK(e,t,n);return e.inclusive?r<=0:r<0}(e.startAt,ih(e),t))&&(!e.endAt||!!function(e,t,n){let r=rK(e,t,n);return e.inclusive?r>=0:r>0}(e.endAt,ih(e),t))}function iw(e){return(t,n)=>{let r=!1;for(let i of ih(e)){let e=function(e,t,n){let r=e.field.isKeyField()?rn.comparator(t.key,n.key):function(e,t,n){let r=t.data.field(e),i=n.data.field(e);return null!==r&&null!==i?rP(r,i):nG()}(e.field,t,n);switch(e.dir){case"asc":return r;case"desc":return -1*r;default:return nG()}}(i,t,n);if(0!==e)return e;r=r||i.field.isKeyField()}return 0}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class iS{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){let t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n){for(let[t,r]of n)if(this.equalsFn(t,e))return r}}has(e){return void 0!==this.get(e)}set(e,t){let n=this.mapKeyFn(e),r=this.inner[n];if(void 0===r)return this.inner[n]=[[e,t]],void this.innerSize++;for(let n=0;n<r.length;n++)if(this.equalsFn(r[n][0],e))return void(r[n]=[e,t]);r.push([e,t]),this.innerSize++}delete(e){let t=this.mapKeyFn(e),n=this.inner[t];if(void 0===n)return!1;for(let r=0;r<n.length;r++)if(this.equalsFn(n[r][0],e))return 1===n.length?delete this.inner[t]:n.splice(r,1),this.innerSize--,!0;return!1}forEach(e){rh(this.inner,(t,n)=>{for(let[t,r]of n)e(t,r)})}isEmpty(){return rf(this.inner)}size(){return this.innerSize}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let iE=new rp(rn.comparator),ik=new rp(rn.comparator);function iI(...e){let t=ik;for(let n of e)t=t.insert(n.key,n);return t}function iT(e){let t=ik;return e.forEach((e,n)=>t=t.insert(e,n.overlayedDocument)),t}function ix(){return new iS(e=>e.toString(),(e,t)=>e.isEqual(t))}let iC=new rp(rn.comparator),iA=new ry(rn.comparator);function iO(...e){let t=iA;for(let n of e)t=t.add(n);return t}let iN=new ry(n4);/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function iR(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:rc(t)?"-0":t}}function iD(e){return{integerValue:""+e}}/**
 * @license
 * Copyright 2018 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class iP{constructor(){this._=void 0}}function iM(e,t){return e instanceof i$?rj(t)||t&&"doubleValue"in t?t:{integerValue:0}:null}class iL extends iP{}class iU extends iP{constructor(e){super(),this.elements=e}}function ij(e,t){let n=iz(t);for(let t of e.elements)n.some(e=>rR(e,t))||n.push(t);return{arrayValue:{values:n}}}class iq extends iP{constructor(e){super(),this.elements=e}}function iF(e,t){let n=iz(t);for(let t of e.elements)n=n.filter(e=>!rR(e,t));return{arrayValue:{values:n}}}class i$ extends iP{constructor(e,t){super(),this.serializer=e,this._t=t}}function iB(e){return rk(e.integerValue||e.doubleValue)}function iz(e){return rq(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class iV{constructor(e,t){this.field=e,this.transform=t}}class iG{constructor(e,t){this.version=e,this.transformResults=t}}class iW{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new iW}static exists(e){return new iW(void 0,e)}static updateTime(e){return new iW(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function iH(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class iK{}function iJ(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new i3(e.key,iW.none()):new iZ(e.key,e.data,iW.none());{let n=e.data,r=rG.empty(),i=new ry(rt.comparator);for(let e of t.fields)if(!i.has(e)){let t=n.field(e);null===t&&e.length>1&&(e=e.popLast(),t=n.field(e)),null===t?r.delete(e):r.set(e,t),i=i.add(e)}return new iY(e.key,r,new r_(i.toArray()),iW.none())}}function iX(e,t,n,r){return e instanceof iZ?function(e,t,n,r){if(!iH(e.precondition,t))return n;let i=e.value.clone(),o=i2(e.fieldTransforms,r,t);return i.setAll(o),t.convertToFoundDocument(t.version,i).setHasLocalMutations(),null}(e,t,n,r):e instanceof iY?function(e,t,n,r){if(!iH(e.precondition,t))return n;let i=i2(e.fieldTransforms,r,t),o=t.data;return(o.setAll(i0(e)),o.setAll(i),t.convertToFoundDocument(t.version,o).setHasLocalMutations(),null===n)?null:n.unionWith(e.fieldMask.fields).unionWith(e.fieldTransforms.map(e=>e.field))}(e,t,n,r):iH(e.precondition,t)?(t.convertToNoDocument(t.version).setHasLocalMutations(),null):n}function iQ(e,t){var n,r;return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&(n=e.fieldTransforms,r=t.fieldTransforms,!!(void 0===n&&void 0===r||!(!n||!r)&&n5(n,r,(e,t)=>{var n,r;return e.field.isEqual(t.field)&&(n=e.transform,r=t.transform,n instanceof iU&&r instanceof iU||n instanceof iq&&r instanceof iq?n5(n.elements,r.elements,rR):n instanceof i$&&r instanceof i$?rR(n._t,r._t):n instanceof iL&&r instanceof iL)})))&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class iZ extends iK{constructor(e,t,n,r=[]){super(),this.key=e,this.value=t,this.precondition=n,this.fieldTransforms=r,this.type=0}getFieldMask(){return null}}class iY extends iK{constructor(e,t,n,r,i=[]){super(),this.key=e,this.data=t,this.fieldMask=n,this.precondition=r,this.fieldTransforms=i,this.type=1}getFieldMask(){return this.fieldMask}}function i0(e){let t=new Map;return e.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){let r=e.data.field(n);t.set(n,r)}}),t}function i1(e,t,n){var r;let i=new Map;e.length===n.length||nG();for(let o=0;o<n.length;o++){let s=e[o],a=s.transform,u=t.data.field(s.field);i.set(s.field,(r=n[o],a instanceof iU?ij(a,u):a instanceof iq?iF(a,u):r))}return i}function i2(e,t,n){let r=new Map;for(let i of e){let e=i.transform,o=n.data.field(i.field);r.set(i.field,e instanceof iL?function(e,t){let n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&(n.fields.__previous_value__=t),{mapValue:n}}(t,o):e instanceof iU?ij(e,o):e instanceof iq?iF(e,o):function(e,t){let n=iM(e,t),r=iB(n)+iB(e._t);return rj(n)&&rj(e._t)?iD(r):iR(e.serializer,r)}(e,o))}return r}class i3 extends iK{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class i4 extends iK{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class i5{constructor(e,t,n,r){this.batchId=e,this.localWriteTime=t,this.baseMutations=n,this.mutations=r}applyToRemoteDocument(e,t){let n=t.mutationResults;for(let t=0;t<this.mutations.length;t++){let i=this.mutations[t];if(i.key.isEqual(e.key)){var r;r=n[t],i instanceof iZ?function(e,t,n){let r=e.value.clone(),i=i1(e.fieldTransforms,t,n.transformResults);r.setAll(i),t.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(i,e,r):i instanceof iY?function(e,t,n){if(!iH(e.precondition,t))return void t.convertToUnknownDocument(n.version);let r=i1(e.fieldTransforms,t,n.transformResults),i=t.data;i.setAll(i0(e)),i.setAll(r),t.convertToFoundDocument(n.version,i).setHasCommittedMutations()}(i,e,r):function(e,t,n){t.convertToNoDocument(n.version).setHasCommittedMutations()}(0,e,r)}}}applyToLocalView(e,t){for(let n of this.baseMutations)n.key.isEqual(e.key)&&(t=iX(n,e,t,this.localWriteTime));for(let n of this.mutations)n.key.isEqual(e.key)&&(t=iX(n,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){let n=ix();return this.mutations.forEach(r=>{let i=e.get(r.key),o=i.overlayedDocument,s=this.applyToLocalView(o,i.mutatedFields),a=iJ(o,s=t.has(r.key)?null:s);null!==a&&n.set(r.key,a),o.isValidDocument()||o.convertToNoDocument(n9.min())}),n}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),iO())}isEqual(e){return this.batchId===e.batchId&&n5(this.mutations,e.mutations,(e,t)=>iQ(e,t))&&n5(this.baseMutations,e.baseMutations,(e,t)=>iQ(e,t))}}class i6{constructor(e,t,n,r){this.batch=e,this.commitVersion=t,this.mutationResults=n,this.docVersions=r}static from(e,t,n){e.mutations.length===n.length||nG();let r=iC,i=e.mutations;for(let e=0;e<i.length;e++)r=r.insert(i[e].key,n[e].version);return new i6(e,t,n,r)}}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class i9{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return null!==e&&this.mutation===e.mutation}toString(){return`Overlay{
      largestBatchId: ${this.largestBatchId},
      mutation: ${this.mutation.toString()}
    }`}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class i8{constructor(e){this.count=e}}function i7(e){if(void 0===e)return nB("GRPC error has no .code"),nW.UNKNOWN;switch(e){case u.OK:return nW.OK;case u.CANCELLED:return nW.CANCELLED;case u.UNKNOWN:return nW.UNKNOWN;case u.DEADLINE_EXCEEDED:return nW.DEADLINE_EXCEEDED;case u.RESOURCE_EXHAUSTED:return nW.RESOURCE_EXHAUSTED;case u.INTERNAL:return nW.INTERNAL;case u.UNAVAILABLE:return nW.UNAVAILABLE;case u.UNAUTHENTICATED:return nW.UNAUTHENTICATED;case u.INVALID_ARGUMENT:return nW.INVALID_ARGUMENT;case u.NOT_FOUND:return nW.NOT_FOUND;case u.ALREADY_EXISTS:return nW.ALREADY_EXISTS;case u.PERMISSION_DENIED:return nW.PERMISSION_DENIED;case u.FAILED_PRECONDITION:return nW.FAILED_PRECONDITION;case u.ABORTED:return nW.ABORTED;case u.OUT_OF_RANGE:return nW.OUT_OF_RANGE;case u.UNIMPLEMENTED:return nW.UNIMPLEMENTED;case u.DATA_LOSS:return nW.DATA_LOSS;default:return nG()}}(l=u||(u={}))[l.OK=0]="OK",l[l.CANCELLED=1]="CANCELLED",l[l.UNKNOWN=2]="UNKNOWN",l[l.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",l[l.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",l[l.NOT_FOUND=5]="NOT_FOUND",l[l.ALREADY_EXISTS=6]="ALREADY_EXISTS",l[l.PERMISSION_DENIED=7]="PERMISSION_DENIED",l[l.UNAUTHENTICATED=16]="UNAUTHENTICATED",l[l.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",l[l.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",l[l.ABORTED=10]="ABORTED",l[l.OUT_OF_RANGE=11]="OUT_OF_RANGE",l[l.UNIMPLEMENTED=12]="UNIMPLEMENTED",l[l.INTERNAL=13]="INTERNAL",l[l.UNAVAILABLE=14]="UNAVAILABLE",l[l.DATA_LOSS=15]="DATA_LOSS";/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oe{constructor(){this.onExistenceFilterMismatchCallbacks=new Map}static get instance(){return ot}static getOrCreateInstance(){return null===ot&&(ot=new oe),ot}onExistenceFilterMismatch(e){let t=Symbol();return this.onExistenceFilterMismatchCallbacks.set(t,e),()=>this.onExistenceFilterMismatchCallbacks.delete(t)}notifyOnExistenceFilterMismatch(e){this.onExistenceFilterMismatchCallbacks.forEach(t=>t(e))}}let ot=null;/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class on{constructor(e,t,n,r,i){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=n,this.documentUpdates=r,this.resolvedLimboDocuments=i}static createSynthesizedRemoteEventForCurrentChange(e,t,n){let r=new Map;return r.set(e,or.createSynthesizedTargetChangeForCurrentChange(e,t,n)),new on(n9.min(),r,iN,iE,iO())}}class or{constructor(e,t,n,r,i){this.resumeToken=e,this.current=t,this.addedDocuments=n,this.modifiedDocuments=r,this.removedDocuments=i}static createSynthesizedTargetChangeForCurrentChange(e,t,n){return new or(n,t,iO(),iO(),iO())}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oi{constructor(e,t,n,r){this.It=e,this.removedTargetIds=t,this.key=n,this.Tt=r}}class oo{constructor(e,t){this.targetId=e,this.Et=t}}class os{constructor(e,t,n=rw.EMPTY_BYTE_STRING,r=null){this.state=e,this.targetIds=t,this.resumeToken=n,this.cause=r}}class oa{constructor(){this.At=0,this.Rt=oc(),this.vt=rw.EMPTY_BYTE_STRING,this.bt=!1,this.Pt=!0}get current(){return this.bt}get resumeToken(){return this.vt}get Vt(){return 0!==this.At}get St(){return this.Pt}Dt(e){e.approximateByteSize()>0&&(this.Pt=!0,this.vt=e)}Ct(){let e=iO(),t=iO(),n=iO();return this.Rt.forEach((r,i)=>{switch(i){case 0:e=e.add(r);break;case 2:t=t.add(r);break;case 1:n=n.add(r);break;default:nG()}}),new or(this.vt,this.bt,e,t,n)}xt(){this.Pt=!1,this.Rt=oc()}Nt(e,t){this.Pt=!0,this.Rt=this.Rt.insert(e,t)}kt(e){this.Pt=!0,this.Rt=this.Rt.remove(e)}Ot(){this.At+=1}$t(){this.At-=1}Mt(){this.Pt=!0,this.bt=!0}}class ou{constructor(e){this.Ft=e,this.Bt=new Map,this.Lt=iE,this.qt=ol(),this.Ut=new ry(n4)}Kt(e){for(let t of e.It)e.Tt&&e.Tt.isFoundDocument()?this.Gt(t,e.Tt):this.Qt(t,e.key,e.Tt);for(let t of e.removedTargetIds)this.Qt(t,e.key,e.Tt)}zt(e){this.forEachTarget(e,t=>{let n=this.jt(t);switch(e.state){case 0:this.Wt(t)&&n.Dt(e.resumeToken);break;case 1:n.$t(),n.Vt||n.xt(),n.Dt(e.resumeToken);break;case 2:n.$t(),n.Vt||this.removeTarget(t);break;case 3:this.Wt(t)&&(n.Mt(),n.Dt(e.resumeToken));break;case 4:this.Wt(t)&&(this.Ht(t),n.Dt(e.resumeToken));break;default:nG()}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.Bt.forEach((e,n)=>{this.Wt(n)&&t(n)})}Jt(e){var t;let n=e.targetId,r=e.Et.count,i=this.Yt(n);if(i){let o=i.target;if(io(o)){if(0===r){let e=new rn(o.path);this.Qt(n,e,rW.newNoDocument(e,n9.min()))}else 1===r||nG()}else{let i=this.Zt(n);i!==r&&(this.Ht(n),this.Ut=this.Ut.add(n),null===(t=oe.instance)||void 0===t||t.notifyOnExistenceFilterMismatch({localCacheCount:i,existenceFilterCount:e.Et.count}))}}}Xt(e){let t=new Map;this.Bt.forEach((n,r)=>{let i=this.Yt(r);if(i){if(n.current&&io(i.target)){let t=new rn(i.target.path);null!==this.Lt.get(t)||this.te(r,t)||this.Qt(r,t,rW.newNoDocument(t,e))}n.St&&(t.set(r,n.Ct()),n.xt())}});let n=iO();this.qt.forEach((e,t)=>{let r=!0;t.forEachWhile(e=>{let t=this.Yt(e);return!t||2===t.purpose||(r=!1,!1)}),r&&(n=n.add(e))}),this.Lt.forEach((t,n)=>n.setReadTime(e));let r=new on(e,t,this.Ut,this.Lt,n);return this.Lt=iE,this.qt=ol(),this.Ut=new ry(n4),r}Gt(e,t){if(!this.Wt(e))return;let n=this.te(e,t.key)?2:0;this.jt(e).Nt(t.key,n),this.Lt=this.Lt.insert(t.key,t),this.qt=this.qt.insert(t.key,this.ee(t.key).add(e))}Qt(e,t,n){if(!this.Wt(e))return;let r=this.jt(e);this.te(e,t)?r.Nt(t,1):r.kt(t),this.qt=this.qt.insert(t,this.ee(t).delete(e)),n&&(this.Lt=this.Lt.insert(t,n))}removeTarget(e){this.Bt.delete(e)}Zt(e){let t=this.jt(e).Ct();return this.Ft.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}Ot(e){this.jt(e).Ot()}jt(e){let t=this.Bt.get(e);return t||(t=new oa,this.Bt.set(e,t)),t}ee(e){let t=this.qt.get(e);return t||(t=new ry(n4),this.qt=this.qt.insert(e,t)),t}Wt(e){let t=null!==this.Yt(e);return t||n$("WatchChangeAggregator","Detected inactive target",e),t}Yt(e){let t=this.Bt.get(e);return t&&t.Vt?null:this.Ft.ne(e)}Ht(e){this.Bt.set(e,new oa),this.Ft.getRemoteKeysForTarget(e).forEach(t=>{this.Qt(e,t,null)})}te(e,t){return this.Ft.getRemoteKeysForTarget(e).has(t)}}function ol(){return new rp(rn.comparator)}function oc(){return new rp(rn.comparator)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let od={asc:"ASCENDING",desc:"DESCENDING"},oh={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},of={and:"AND",or:"OR"};class op{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function og(e,t){return e.useProto3Json?`${new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+t.nanoseconds).slice(-9)}Z`:{seconds:""+t.seconds,nanos:t.nanoseconds}}function om(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function oy(e){return e||nG(),n9.fromTimestamp(function(e){let t=rE(e);return new n6(t.seconds,t.nanos)}(e))}function ov(e,t){return new n7(["projects",e.projectId,"databases",e.database]).child("documents").child(t).canonicalString()}function o_(e){let t=n7.fromString(e);return oC(t)||nG(),t}function ob(e,t){return ov(e.databaseId,t.path)}function ow(e,t){let n=o_(t);if(n.get(1)!==e.databaseId.projectId)throw new nH(nW.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+e.databaseId.projectId);if(n.get(3)!==e.databaseId.database)throw new nH(nW.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new rn(ok(n))}function oS(e,t){return ov(e.databaseId,t)}function oE(e){return new n7(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function ok(e){return e.length>4&&"documents"===e.get(4)||nG(),e.popFirst(5)}function oI(e,t,n){return{name:ob(e,t),fields:n.value.mapValue.fields}}function oT(e){return{fieldPath:e.canonicalString()}}function ox(e){return rt.fromServerFormat(e.fieldPath)}function oC(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oA{constructor(e,t,n,r,i=n9.min(),o=n9.min(),s=rw.EMPTY_BYTE_STRING){this.target=e,this.targetId=t,this.purpose=n,this.sequenceNumber=r,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=s}withSequenceNumber(e){return new oA(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken)}withResumeToken(e,t){return new oA(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e)}withLastLimboFreeSnapshotVersion(e){return new oA(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oO{constructor(e){this.se=e}}/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oN{constructor(){}oe(e,t){this.ue(e,t),t.ce()}ue(e,t){if("nullValue"in e)this.ae(t,5);else if("booleanValue"in e)this.ae(t,10),t.he(e.booleanValue?1:0);else if("integerValue"in e)this.ae(t,15),t.he(rk(e.integerValue));else if("doubleValue"in e){let n=rk(e.doubleValue);isNaN(n)?this.ae(t,13):(this.ae(t,15),rc(n)?t.he(0):t.he(n))}else if("timestampValue"in e){let n=e.timestampValue;this.ae(t,20),"string"==typeof n?t.le(n):(t.le(`${n.seconds||""}`),t.he(n.nanos||0))}else if("stringValue"in e)this.fe(e.stringValue,t),this.de(t);else if("bytesValue"in e)this.ae(t,30),t.we(rI(e.bytesValue)),this.de(t);else if("referenceValue"in e)this._e(e.referenceValue,t);else if("geoPointValue"in e){let n=e.geoPointValue;this.ae(t,45),t.he(n.latitude||0),t.he(n.longitude||0)}else"mapValue"in e?rV(e)?this.ae(t,Number.MAX_SAFE_INTEGER):(this.me(e.mapValue,t),this.de(t)):"arrayValue"in e?(this.ge(e.arrayValue,t),this.de(t)):nG()}fe(e,t){this.ae(t,25),this.ye(e,t)}ye(e,t){t.le(e)}me(e,t){let n=e.fields||{};for(let e of(this.ae(t,55),Object.keys(n)))this.fe(e,t),this.ue(n[e],t)}ge(e,t){let n=e.values||[];for(let e of(this.ae(t,50),n))this.ue(e,t)}_e(e,t){this.ae(t,37),rn.fromName(e).path.forEach(e=>{this.ae(t,60),this.ye(e,t)})}ae(e,t){e.he(t)}de(e){e.he(2)}}oN.pe=new oN;/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oR{constructor(){this.He=new oD}addToCollectionParentIndex(e,t){return this.He.add(t),ra.resolve()}getCollectionParents(e,t){return ra.resolve(this.He.getEntries(t))}addFieldIndex(e,t){return ra.resolve()}deleteFieldIndex(e,t){return ra.resolve()}getDocumentsMatchingTarget(e,t){return ra.resolve(null)}getIndexType(e,t){return ra.resolve(0)}getFieldIndexes(e,t){return ra.resolve([])}getNextCollectionGroupToUpdate(e){return ra.resolve(null)}getMinOffset(e,t){return ra.resolve(ri.min())}getMinOffsetFromCollectionGroup(e,t){return ra.resolve(ri.min())}updateCollectionGroup(e,t,n){return ra.resolve()}updateIndexEntries(e,t){return ra.resolve()}}class oD{constructor(){this.index={}}add(e){let t=e.lastSegment(),n=e.popLast(),r=this.index[t]||new ry(n7.comparator),i=!r.has(n);return this.index[t]=r.add(n),i}has(e){let t=e.lastSegment(),n=e.popLast(),r=this.index[t];return r&&r.has(n)}getEntries(e){return(this.index[e]||new ry(n7.comparator)).toArray()}}new Uint8Array(0);class oP{constructor(e,t,n){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=n}static withCacheSize(e){return new oP(e,oP.DEFAULT_COLLECTION_PERCENTILE,oP.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */oP.DEFAULT_COLLECTION_PERCENTILE=10,oP.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,oP.DEFAULT=new oP(41943040,oP.DEFAULT_COLLECTION_PERCENTILE,oP.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),oP.DISABLED=new oP(-1,0,0);/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oM{constructor(e){this.Rn=e}next(){return this.Rn+=2,this.Rn}static vn(){return new oM(0)}static bn(){return new oM(-1)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oL{constructor(){this.changes=new iS(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,rW.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();let n=this.changes.get(t);return void 0!==n?ra.resolve(n):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *//**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oU{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oj{constructor(e,t,n,r){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=n,this.indexManager=r}getDocument(e,t){let n=null;return this.documentOverlayCache.getOverlay(e,t).next(r=>(n=r,this.remoteDocumentCache.getEntry(e,t))).next(e=>(null!==n&&iX(n.mutation,e,r_.empty(),n6.now()),e))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.getLocalViewOfDocuments(e,t,iO()).next(()=>t))}getLocalViewOfDocuments(e,t,n=iO()){let r=ix();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,n).next(e=>{let t=iI();return e.forEach((e,n)=>{t=t.insert(e,n.overlayedDocument)}),t}))}getOverlayedDocuments(e,t){let n=ix();return this.populateOverlays(e,n,t).next(()=>this.computeViews(e,t,n,iO()))}populateOverlays(e,t,n){let r=[];return n.forEach(e=>{t.has(e)||r.push(e)}),this.documentOverlayCache.getOverlays(e,r).next(e=>{e.forEach((e,n)=>{t.set(e,n)})})}computeViews(e,t,n,r){let i=iE,o=ix(),s=ix();return t.forEach((e,t)=>{let s=n.get(t.key);r.has(t.key)&&(void 0===s||s.mutation instanceof iY)?i=i.insert(t.key,t):void 0!==s?(o.set(t.key,s.mutation.getFieldMask()),iX(s.mutation,t,s.mutation.getFieldMask(),n6.now())):o.set(t.key,r_.empty())}),this.recalculateAndSaveOverlays(e,i).next(e=>(e.forEach((e,t)=>o.set(e,t)),t.forEach((e,t)=>{var n;return s.set(e,new oU(t,null!==(n=o.get(e))&&void 0!==n?n:null))}),s))}recalculateAndSaveOverlays(e,t){let n=ix(),r=new rp((e,t)=>e-t),i=iO();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(e=>{for(let i of e)i.keys().forEach(e=>{let o=t.get(e);if(null===o)return;let s=n.get(e)||r_.empty();s=i.applyToLocalView(o,s),n.set(e,s);let a=(r.get(i.batchId)||iO()).add(e);r=r.insert(i.batchId,a)})}).next(()=>{let o=[],s=r.getReverseIterator();for(;s.hasNext();){let r=s.getNext(),a=r.key,u=r.value,l=ix();u.forEach(e=>{if(!i.has(e)){let r=iJ(t.get(e),n.get(e));null!==r&&l.set(e,r),i=i.add(e)}}),o.push(this.documentOverlayCache.saveOverlays(e,a,l))}return ra.waitFor(o)}).next(()=>n)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.recalculateAndSaveOverlays(e,t))}getDocumentsMatchingQuery(e,t,n){return rn.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length?this.getDocumentsMatchingDocumentQuery(e,t.path):id(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,n):this.getDocumentsMatchingCollectionQuery(e,t,n)}getNextDocuments(e,t,n,r){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,n,r).next(i=>{let o=r-i.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,n.largestBatchId,r-i.size):ra.resolve(ix()),s=-1,a=i;return o.next(t=>ra.forEach(t,(t,n)=>(s<n.largestBatchId&&(s=n.largestBatchId),i.get(t)?ra.resolve():this.remoteDocumentCache.getEntry(e,t).next(e=>{a=a.insert(t,e)}))).next(()=>this.populateOverlays(e,t,i)).next(()=>this.computeViews(e,a,t,iO())).next(e=>({batchId:s,changes:iT(e)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new rn(t)).next(e=>{let t=iI();return e.isFoundDocument()&&(t=t.insert(e.key,e)),t})}getDocumentsMatchingCollectionGroupQuery(e,t,n){let r=t.collectionGroup,i=iI();return this.indexManager.getCollectionParents(e,r).next(o=>ra.forEach(o,o=>{let s=new is(o.child(r),null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt);return this.getDocumentsMatchingCollectionQuery(e,s,n).next(e=>{e.forEach((e,t)=>{i=i.insert(e,t)})})}).next(()=>i))}getDocumentsMatchingCollectionQuery(e,t,n){let r;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,n.largestBatchId).next(i=>(r=i,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,n,r))).next(e=>{r.forEach((t,n)=>{let r=n.getKey();null===e.get(r)&&(e=e.insert(r,rW.newInvalidDocument(r)))});let n=iI();return e.forEach((e,i)=>{let o=r.get(e);void 0!==o&&iX(o.mutation,i,r_.empty(),n6.now()),ib(t,i)&&(n=n.insert(e,i))}),n})}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oq{constructor(e){this.serializer=e,this.Zn=new Map,this.Xn=new Map}getBundleMetadata(e,t){return ra.resolve(this.Zn.get(t))}saveBundleMetadata(e,t){return this.Zn.set(t.id,{id:t.id,version:t.version,createTime:oy(t.createTime)}),ra.resolve()}getNamedQuery(e,t){return ra.resolve(this.Xn.get(t))}saveNamedQuery(e,t){return this.Xn.set(t.name,{name:t.name,query:function(e){let t=function(e){var t;let n,r=function(e){let t=o_(e);return 4===t.length?n7.emptyPath():ok(t)}(e.parent),i=e.structuredQuery,o=i.from?i.from.length:0,s=null;if(o>0){1===o||nG();let e=i.from[0];e.allDescendants?s=e.collectionId:r=r.child(e.collectionId)}let a=[];i.where&&(a=function(e){var t;let n=function e(t){return void 0!==t.unaryFilter?function(e){switch(e.unaryFilter.op){case"IS_NAN":let t=ox(e.unaryFilter.field);return rZ.create(t,"==",{doubleValue:NaN});case"IS_NULL":let n=ox(e.unaryFilter.field);return rZ.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":let r=ox(e.unaryFilter.field);return rZ.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":let i=ox(e.unaryFilter.field);return rZ.create(i,"!=",{nullValue:"NULL_VALUE"});default:return nG()}}(t):void 0!==t.fieldFilter?rZ.create(ox(t.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return nG()}}(t.fieldFilter.op),t.fieldFilter.value):void 0!==t.compositeFilter?rY.create(t.compositeFilter.filters.map(t=>e(t)),function(e){switch(e){case"AND":return"and";case"OR":return"or";default:return nG()}}(t.compositeFilter.op)):nG()}(e);return n instanceof rY&&r1(t=n)&&r0(t)?n.getFilters():[n]}(i.where));let u=[];i.orderBy&&(u=i.orderBy.map(e=>new rX(ox(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))));let l=null;i.limit&&(l=null==(n="object"==typeof(t=i.limit)?t.value:t)?null:n);let c=null;i.startAt&&(c=function(e){let t=!!e.before;return new rH(e.values||[],t)}(i.startAt));let d=null;return i.endAt&&(d=function(e){let t=!e.before;return new rH(e.values||[],t)}(i.endAt)),new is(r,s,u,a,l,"F",c,d)}({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?im(t,t.limit,"L"):t}(t.bundledQuery),readTime:oy(t.readTime)}),ra.resolve()}}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oF{constructor(){this.overlays=new rp(rn.comparator),this.ts=new Map}getOverlay(e,t){return ra.resolve(this.overlays.get(t))}getOverlays(e,t){let n=ix();return ra.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&n.set(t,e)})).next(()=>n)}saveOverlays(e,t,n){return n.forEach((n,r)=>{this.re(e,t,r)}),ra.resolve()}removeOverlaysForBatchId(e,t,n){let r=this.ts.get(n);return void 0!==r&&(r.forEach(e=>this.overlays=this.overlays.remove(e)),this.ts.delete(n)),ra.resolve()}getOverlaysForCollection(e,t,n){let r=ix(),i=t.length+1,o=new rn(t.child("")),s=this.overlays.getIteratorFrom(o);for(;s.hasNext();){let e=s.getNext().value,o=e.getKey();if(!t.isPrefixOf(o.path))break;o.path.length===i&&e.largestBatchId>n&&r.set(e.getKey(),e)}return ra.resolve(r)}getOverlaysForCollectionGroup(e,t,n,r){let i=new rp((e,t)=>e-t),o=this.overlays.getIterator();for(;o.hasNext();){let e=o.getNext().value;if(e.getKey().getCollectionGroup()===t&&e.largestBatchId>n){let t=i.get(e.largestBatchId);null===t&&(t=ix(),i=i.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}let s=ix(),a=i.getIterator();for(;a.hasNext()&&(a.getNext().value.forEach((e,t)=>s.set(e,t)),!(s.size()>=r)););return ra.resolve(s)}re(e,t,n){let r=this.overlays.get(n.key);if(null!==r){let e=this.ts.get(r.largestBatchId).delete(n.key);this.ts.set(r.largestBatchId,e)}this.overlays=this.overlays.insert(n.key,new i9(t,n));let i=this.ts.get(t);void 0===i&&(i=iO(),this.ts.set(t,i)),this.ts.set(t,i.add(n.key))}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class o${constructor(){this.es=new ry(oB.ns),this.ss=new ry(oB.rs)}isEmpty(){return this.es.isEmpty()}addReference(e,t){let n=new oB(e,t);this.es=this.es.add(n),this.ss=this.ss.add(n)}os(e,t){e.forEach(e=>this.addReference(e,t))}removeReference(e,t){this.us(new oB(e,t))}cs(e,t){e.forEach(e=>this.removeReference(e,t))}hs(e){let t=new rn(new n7([])),n=new oB(t,e),r=new oB(t,e+1),i=[];return this.ss.forEachInRange([n,r],e=>{this.us(e),i.push(e.key)}),i}ls(){this.es.forEach(e=>this.us(e))}us(e){this.es=this.es.delete(e),this.ss=this.ss.delete(e)}fs(e){let t=new rn(new n7([])),n=new oB(t,e),r=new oB(t,e+1),i=iO();return this.ss.forEachInRange([n,r],e=>{i=i.add(e.key)}),i}containsKey(e){let t=new oB(e,0),n=this.es.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)}}class oB{constructor(e,t){this.key=e,this.ds=t}static ns(e,t){return rn.comparator(e.key,t.key)||n4(e.ds,t.ds)}static rs(e,t){return n4(e.ds,t.ds)||rn.comparator(e.key,t.key)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oz{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.ws=1,this._s=new ry(oB.ns)}checkEmpty(e){return ra.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,n,r){let i=this.ws;this.ws++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];let o=new i5(i,t,n,r);for(let t of(this.mutationQueue.push(o),r))this._s=this._s.add(new oB(t.key,i)),this.indexManager.addToCollectionParentIndex(e,t.key.path.popLast());return ra.resolve(o)}lookupMutationBatch(e,t){return ra.resolve(this.gs(t))}getNextMutationBatchAfterBatchId(e,t){let n=this.ys(t+1),r=n<0?0:n;return ra.resolve(this.mutationQueue.length>r?this.mutationQueue[r]:null)}getHighestUnacknowledgedBatchId(){return ra.resolve(0===this.mutationQueue.length?-1:this.ws-1)}getAllMutationBatches(e){return ra.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){let n=new oB(t,0),r=new oB(t,Number.POSITIVE_INFINITY),i=[];return this._s.forEachInRange([n,r],e=>{let t=this.gs(e.ds);i.push(t)}),ra.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new ry(n4);return t.forEach(e=>{let t=new oB(e,0),r=new oB(e,Number.POSITIVE_INFINITY);this._s.forEachInRange([t,r],e=>{n=n.add(e.ds)})}),ra.resolve(this.ps(n))}getAllMutationBatchesAffectingQuery(e,t){let n=t.path,r=n.length+1,i=n;rn.isDocumentKey(i)||(i=i.child(""));let o=new oB(new rn(i),0),s=new ry(n4);return this._s.forEachWhile(e=>{let t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===r&&(s=s.add(e.ds)),!0)},o),ra.resolve(this.ps(s))}ps(e){let t=[];return e.forEach(e=>{let n=this.gs(e);null!==n&&t.push(n)}),t}removeMutationBatch(e,t){0===this.Is(t.batchId,"removed")||nG(),this.mutationQueue.shift();let n=this._s;return ra.forEach(t.mutations,r=>{let i=new oB(r.key,t.batchId);return n=n.delete(i),this.referenceDelegate.markPotentiallyOrphaned(e,r.key)}).next(()=>{this._s=n})}En(e){}containsKey(e,t){let n=new oB(t,0),r=this._s.firstAfterOrEqual(n);return ra.resolve(t.isEqual(r&&r.key))}performConsistencyCheck(e){return this.mutationQueue.length,ra.resolve()}Is(e,t){return this.ys(e)}ys(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}gs(e){let t=this.ys(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oV{constructor(e){this.Ts=e,this.docs=new rp(rn.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){let n=t.key,r=this.docs.get(n),i=r?r.size:0,o=this.Ts(t);return this.docs=this.docs.insert(n,{document:t.mutableCopy(),size:o}),this.size+=o-i,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}removeEntry(e){let t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){let n=this.docs.get(t);return ra.resolve(n?n.document.mutableCopy():rW.newInvalidDocument(t))}getEntries(e,t){let n=iE;return t.forEach(e=>{let t=this.docs.get(e);n=n.insert(e,t?t.document.mutableCopy():rW.newInvalidDocument(e))}),ra.resolve(n)}getDocumentsMatchingQuery(e,t,n,r){let i=iE,o=t.path,s=new rn(o.child("")),a=this.docs.getIteratorFrom(s);for(;a.hasNext();){let{key:e,value:{document:s}}=a.getNext();if(!o.isPrefixOf(e.path))break;e.path.length>o.length+1||0>=function(e,t){let n=e.readTime.compareTo(t.readTime);return 0!==n?n:0!==(n=rn.comparator(e.documentKey,t.documentKey))?n:n4(e.largestBatchId,t.largestBatchId)}(new ri(s.readTime,s.key,-1),n)||(r.has(s.key)||ib(t,s))&&(i=i.insert(s.key,s.mutableCopy()))}return ra.resolve(i)}getAllFromCollectionGroup(e,t,n,r){nG()}Es(e,t){return ra.forEach(this.docs,e=>t(e))}newChangeBuffer(e){return new oG(this)}getSize(e){return ra.resolve(this.size)}}class oG extends oL{constructor(e){super(),this.Jn=e}applyChanges(e){let t=[];return this.changes.forEach((n,r)=>{r.isValidDocument()?t.push(this.Jn.addEntry(e,r)):this.Jn.removeEntry(n)}),ra.waitFor(t)}getFromCache(e,t){return this.Jn.getEntry(e,t)}getAllFromCache(e,t){return this.Jn.getEntries(e,t)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oW{constructor(e){this.persistence=e,this.As=new iS(e=>ir(e),ii),this.lastRemoteSnapshotVersion=n9.min(),this.highestTargetId=0,this.Rs=0,this.vs=new o$,this.targetCount=0,this.bs=oM.vn()}forEachTarget(e,t){return this.As.forEach((e,n)=>t(n)),ra.resolve()}getLastRemoteSnapshotVersion(e){return ra.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return ra.resolve(this.Rs)}allocateTargetId(e){return this.highestTargetId=this.bs.next(),ra.resolve(this.highestTargetId)}setTargetsMetadata(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.Rs&&(this.Rs=t),ra.resolve()}Sn(e){this.As.set(e.target,e);let t=e.targetId;t>this.highestTargetId&&(this.bs=new oM(t),this.highestTargetId=t),e.sequenceNumber>this.Rs&&(this.Rs=e.sequenceNumber)}addTargetData(e,t){return this.Sn(t),this.targetCount+=1,ra.resolve()}updateTargetData(e,t){return this.Sn(t),ra.resolve()}removeTargetData(e,t){return this.As.delete(t.target),this.vs.hs(t.targetId),this.targetCount-=1,ra.resolve()}removeTargets(e,t,n){let r=0,i=[];return this.As.forEach((o,s)=>{s.sequenceNumber<=t&&null===n.get(s.targetId)&&(this.As.delete(o),i.push(this.removeMatchingKeysForTargetId(e,s.targetId)),r++)}),ra.waitFor(i).next(()=>r)}getTargetCount(e){return ra.resolve(this.targetCount)}getTargetData(e,t){let n=this.As.get(t)||null;return ra.resolve(n)}addMatchingKeys(e,t,n){return this.vs.os(t,n),ra.resolve()}removeMatchingKeys(e,t,n){this.vs.cs(t,n);let r=this.persistence.referenceDelegate,i=[];return r&&t.forEach(t=>{i.push(r.markPotentiallyOrphaned(e,t))}),ra.waitFor(i)}removeMatchingKeysForTargetId(e,t){return this.vs.hs(t),ra.resolve()}getMatchingKeysForTargetId(e,t){let n=this.vs.fs(t);return ra.resolve(n)}containsKey(e,t){return ra.resolve(this.vs.containsKey(t))}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oH{constructor(e,t){this.Ps={},this.overlays={},this.Vs=new rl(0),this.Ss=!1,this.Ss=!0,this.referenceDelegate=e(this),this.Ds=new oW(this),this.indexManager=new oR,this.remoteDocumentCache=new oV(e=>this.referenceDelegate.Cs(e)),this.serializer=new oO(t),this.xs=new oq(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.Ss=!1,Promise.resolve()}get started(){return this.Ss}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new oF,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let n=this.Ps[e.toKey()];return n||(n=new oz(t,this.referenceDelegate),this.Ps[e.toKey()]=n),n}getTargetCache(){return this.Ds}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.xs}runTransaction(e,t,n){n$("MemoryPersistence","Starting transaction:",e);let r=new oK(this.Vs.next());return this.referenceDelegate.Ns(),n(r).next(e=>this.referenceDelegate.ks(r).next(()=>e)).toPromise().then(e=>(r.raiseOnCommittedEvent(),e))}Os(e,t){return ra.or(Object.values(this.Ps).map(n=>()=>n.containsKey(e,t)))}}class oK extends ro{constructor(e){super(),this.currentSequenceNumber=e}}class oJ{constructor(e){this.persistence=e,this.$s=new o$,this.Ms=null}static Fs(e){return new oJ(e)}get Bs(){if(this.Ms)return this.Ms;throw nG()}addReference(e,t,n){return this.$s.addReference(n,t),this.Bs.delete(n.toString()),ra.resolve()}removeReference(e,t,n){return this.$s.removeReference(n,t),this.Bs.add(n.toString()),ra.resolve()}markPotentiallyOrphaned(e,t){return this.Bs.add(t.toString()),ra.resolve()}removeTarget(e,t){this.$s.hs(t.targetId).forEach(e=>this.Bs.add(e.toString()));let n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,t.targetId).next(e=>{e.forEach(e=>this.Bs.add(e.toString()))}).next(()=>n.removeTargetData(e,t))}Ns(){this.Ms=new Set}ks(e){let t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return ra.forEach(this.Bs,n=>{let r=rn.fromPath(n);return this.Ls(e,r).next(e=>{e||t.removeEntry(r,n9.min())})}).next(()=>(this.Ms=null,t.apply(e)))}updateLimboDocument(e,t){return this.Ls(e,t).next(e=>{e?this.Bs.delete(t.toString()):this.Bs.add(t.toString())})}Cs(e){return 0}Ls(e,t){return ra.or([()=>ra.resolve(this.$s.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Os(e,t)])}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oX{constructor(e,t,n,r){this.targetId=e,this.fromCache=t,this.Vi=n,this.Si=r}static Di(e,t){let n=iO(),r=iO();for(let e of t.docChanges)switch(e.type){case 0:n=n.add(e.doc.key);break;case 1:r=r.add(e.doc.key)}return new oX(e,t.fromCache,n,r)}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oQ{constructor(){this.Ci=!1}initialize(e,t){this.xi=e,this.indexManager=t,this.Ci=!0}getDocumentsMatchingQuery(e,t,n,r){return this.Ni(e,t).next(i=>i||this.ki(e,t,r,n)).next(n=>n||this.Oi(e,t))}Ni(e,t){if(iu(t))return ra.resolve(null);let n=ip(t);return this.indexManager.getIndexType(e,n).next(r=>0===r?null:(null!==t.limit&&1===r&&(n=ip(t=im(t,null,"F"))),this.indexManager.getDocumentsMatchingTarget(e,n).next(r=>{let i=iO(...r);return this.xi.getDocuments(e,i).next(r=>this.indexManager.getMinOffset(e,n).next(n=>{let o=this.$i(t,r);return this.Mi(t,o,i,n.readTime)?this.Ni(e,im(t,null,"F")):this.Fi(e,o,t,n)}))})))}ki(e,t,n,r){return iu(t)||r.isEqual(n9.min())?this.Oi(e,t):this.xi.getDocuments(e,n).next(i=>{let o=this.$i(t,i);return this.Mi(t,o,n,r)?this.Oi(e,t):(nF()<=f.in.DEBUG&&n$("QueryEngine","Re-using previous result from %s to execute query: %s",r.toString(),i_(t)),this.Fi(e,o,t,function(e,t){let n=e.toTimestamp().seconds,r=e.toTimestamp().nanoseconds+1;return new ri(n9.fromTimestamp(1e9===r?new n6(n+1,0):new n6(n,r)),rn.empty(),-1)}(r,0)))})}$i(e,t){let n=new ry(iw(e));return t.forEach((t,r)=>{ib(e,r)&&(n=n.add(r))}),n}Mi(e,t,n,r){if(null===e.limit)return!1;if(n.size!==t.size)return!0;let i="F"===e.limitType?t.last():t.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(r)>0)}Oi(e,t){return nF()<=f.in.DEBUG&&n$("QueryEngine","Using full collection scan to execute query:",i_(t)),this.xi.getDocumentsMatchingQuery(e,t,ri.min())}Fi(e,t,n,r){return this.xi.getDocumentsMatchingQuery(e,n,r).next(e=>(t.forEach(t=>{e=e.insert(t.key,t)}),e))}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class oZ{constructor(e,t,n,r){this.persistence=e,this.Bi=t,this.serializer=r,this.Li=new rp(n4),this.qi=new iS(e=>ir(e),ii),this.Ui=new Map,this.Ki=e.getRemoteDocumentCache(),this.Ds=e.getTargetCache(),this.xs=e.getBundleCache(),this.Gi(n)}Gi(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new oj(this.Ki,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Ki.setIndexManager(this.indexManager),this.Bi.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.Li))}}async function oY(e,t){return await e.persistence.runTransaction("Handle user change","readonly",n=>{let r;return e.mutationQueue.getAllMutationBatches(n).next(i=>(r=i,e.Gi(t),e.mutationQueue.getAllMutationBatches(n))).next(t=>{let i=[],o=[],s=iO();for(let e of r)for(let t of(i.push(e.batchId),e.mutations))s=s.add(t.key);for(let e of t)for(let t of(o.push(e.batchId),e.mutations))s=s.add(t.key);return e.localDocuments.getDocuments(n,s).next(e=>({Qi:e,removedBatchIds:i,addedBatchIds:o}))})})}function o0(e){return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.Ds.getLastRemoteSnapshotVersion(t))}async function o1(e,t,n){let r=e.Li.get(t);try{n||await e.persistence.runTransaction("Release target",n?"readwrite":"readwrite-primary",t=>e.persistence.referenceDelegate.removeTarget(t,r))}catch(e){if(!ru(e))throw e;n$("LocalStore",`Failed to update sequence numbers for target ${t}: ${e}`)}e.Li=e.Li.remove(t),e.qi.delete(r.target)}function o2(e,t,n){let r=n9.min(),i=iO();return e.persistence.runTransaction("Execute query","readonly",o=>(function(e,t,n){let r=e.qi.get(n);return void 0!==r?ra.resolve(e.Li.get(r)):e.Ds.getTargetData(t,n)})(e,o,ip(t)).next(t=>{if(t)return r=t.lastLimboFreeSnapshotVersion,e.Ds.getMatchingKeysForTargetId(o,t.targetId).next(e=>{i=e})}).next(()=>e.Bi.getDocumentsMatchingQuery(o,t,n?r:n9.min(),n?i:iO())).next(n=>{var r;let o;return r=t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2)),o=e.Ui.get(r)||n9.min(),n.forEach((e,t)=>{t.readTime.compareTo(o)>0&&(o=t.readTime)}),e.Ui.set(r,o),{documents:n,Wi:i}}))}class o3{constructor(){this.activeTargetIds=iN}tr(e){this.activeTargetIds=this.activeTargetIds.add(e)}er(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Xi(){return JSON.stringify({activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()})}}class o4{constructor(){this.Br=new o3,this.Lr={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,n){}addLocalQueryTarget(e){return this.Br.tr(e),this.Lr[e]||"not-current"}updateQueryState(e,t,n){this.Lr[e]=t}removeLocalQueryTarget(e){this.Br.er(e)}isLocalQueryTarget(e){return this.Br.activeTargetIds.has(e)}clearQueryState(e){delete this.Lr[e]}getAllActiveQueryTargets(){return this.Br.activeTargetIds}isActiveQueryTarget(e){return this.Br.activeTargetIds.has(e)}start(){return this.Br=new o3,Promise.resolve()}handleUserChange(e,t,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class o5{qr(e){}shutdown(){}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class o6{constructor(){this.Ur=()=>this.Kr(),this.Gr=()=>this.Qr(),this.zr=[],this.jr()}qr(e){this.zr.push(e)}shutdown(){window.removeEventListener("online",this.Ur),window.removeEventListener("offline",this.Gr)}jr(){window.addEventListener("online",this.Ur),window.addEventListener("offline",this.Gr)}Kr(){for(let e of(n$("ConnectivityMonitor","Network connectivity changed: AVAILABLE"),this.zr))e(0)}Qr(){for(let e of(n$("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE"),this.zr))e(1)}static D(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let o9=null;function o8(){return null===o9?o9=268435456+Math.round(2147483648*Math.random()):o9++,"0x"+o9.toString(16)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let o7={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class se{constructor(e){this.Wr=e.Wr,this.Hr=e.Hr}Jr(e){this.Yr=e}Zr(e){this.Xr=e}onMessage(e){this.eo=e}close(){this.Hr()}send(e){this.Wr(e)}no(){this.Yr()}so(e){this.Xr(e)}io(e){this.eo(e)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let st="WebChannelConnection";class sn extends class{constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;let t=e.ssl?"https":"http";this.ro=t+"://"+e.host,this.oo="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}get uo(){return!1}co(e,t,n,r,i){let o=o8(),s=this.ao(e,t);n$("RestConnection",`Sending RPC '${e}' ${o}:`,s,n);let a={};return this.ho(a,r,i),this.lo(e,s,a,n).then(t=>(n$("RestConnection",`Received RPC '${e}' ${o}: `,t),t),t=>{throw nz("RestConnection",`RPC '${e}' ${o} failed with error: `,t,"url: ",s,"request:",n),t})}fo(e,t,n,r,i,o){return this.co(e,t,n,r,i)}ho(e,t,n){e["X-Goog-Api-Client"]="gl-js/ fire/"+nj,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((t,n)=>e[n]=t),n&&n.headers.forEach((t,n)=>e[n]=t)}ao(e,t){let n=o7[e];return`${this.ro}/v1/${t}:${n}`}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams}lo(e,t,n,r){let i=o8();return new Promise((o,s)=>{let a=new nM;a.setWithCredentials(!0),a.listenOnce(nO.COMPLETE,()=>{try{switch(a.getLastErrorCode()){case nA.NO_ERROR:let t=a.getResponseJson();n$(st,`XHR for RPC '${e}' ${i} received:`,JSON.stringify(t)),o(t);break;case nA.TIMEOUT:n$(st,`RPC '${e}' ${i} timed out`),s(new nH(nW.DEADLINE_EXCEEDED,"Request time out"));break;case nA.HTTP_ERROR:let n=a.getStatus();if(n$(st,`RPC '${e}' ${i} failed with status:`,n,"response text:",a.getResponseText()),n>0){let e=a.getResponseJson();Array.isArray(e)&&(e=e[0]);let t=null==e?void 0:e.error;if(t&&t.status&&t.message){let e=function(e){let t=e.toLowerCase().replace(/_/g,"-");return Object.values(nW).indexOf(t)>=0?t:nW.UNKNOWN}(t.status);s(new nH(e,t.message))}else s(new nH(nW.UNKNOWN,"Server responded with status "+a.getStatus()))}else s(new nH(nW.UNAVAILABLE,"Connection failed."));break;default:nG()}}finally{n$(st,`RPC '${e}' ${i} completed.`)}});let u=JSON.stringify(r);n$(st,`RPC '${e}' ${i} sending request:`,r),a.send(t,"POST",u,n,15)})}wo(e,t,n){let r=o8(),i=[this.ro,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=nx(),s=nC(),a={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(a.xmlHttpFactory=new nD({})),this.ho(a.initMessageHeaders,t,n),a.encodeInitMessageHeaders=!0;let l=i.join("");n$(st,`Creating RPC '${e}' stream ${r}: ${l}`,a);let c=o.createWebChannel(l,a),d=!1,h=!1,f=new se({Wr:t=>{h?n$(st,`Not sending because RPC '${e}' stream ${r} is closed:`,t):(d||(n$(st,`Opening RPC '${e}' stream ${r} transport.`),c.open(),d=!0),n$(st,`RPC '${e}' stream ${r} sending:`,t),c.send(t))},Hr:()=>c.close()}),p=(e,t,n)=>{e.listen(t,e=>{try{n(e)}catch(e){setTimeout(()=>{throw e},0)}})};return p(c,nP.EventType.OPEN,()=>{h||n$(st,`RPC '${e}' stream ${r} transport opened.`)}),p(c,nP.EventType.CLOSE,()=>{h||(h=!0,n$(st,`RPC '${e}' stream ${r} transport closed`),f.so())}),p(c,nP.EventType.ERROR,t=>{h||(h=!0,nz(st,`RPC '${e}' stream ${r} transport errored:`,t),f.so(new nH(nW.UNAVAILABLE,"The operation could not be completed")))}),p(c,nP.EventType.MESSAGE,t=>{var n;if(!h){let i=t.data[0];i||nG();let o=i.error||(null===(n=i[0])||void 0===n?void 0:n.error);if(o){n$(st,`RPC '${e}' stream ${r} received error:`,o);let t=o.status,n=function(e){let t=u[e];if(void 0!==t)return i7(t)}(t),i=o.message;void 0===n&&(n=nW.INTERNAL,i="Unknown error status: "+t+" with message "+o.message),h=!0,f.so(new nH(n,i)),c.close()}else n$(st,`RPC '${e}' stream ${r} received:`,i),f.io(i)}}),p(s,nN.STAT_EVENT,t=>{t.stat===nR.PROXY?n$(st,`RPC '${e}' stream ${r} detected buffering proxy`):t.stat===nR.NOPROXY&&n$(st,`RPC '${e}' stream ${r} detected no buffering proxy`)}),setTimeout(()=>{f.no()},0),f}}function sr(){return"undefined"!=typeof document?document:null}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function si(e){return new op(e,!0)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class so{constructor(e,t,n=1e3,r=1.5,i=6e4){this.Ws=e,this.timerId=t,this._o=n,this.mo=r,this.yo=i,this.po=0,this.Io=null,this.To=Date.now(),this.reset()}reset(){this.po=0}Eo(){this.po=this.yo}Ao(e){this.cancel();let t=Math.floor(this.po+this.Ro()),n=Math.max(0,Date.now()-this.To),r=Math.max(0,t-n);r>0&&n$("ExponentialBackoff",`Backing off for ${r} ms (base delay: ${this.po} ms, delay with jitter: ${t} ms, last attempt: ${n} ms ago)`),this.Io=this.Ws.enqueueAfterDelay(this.timerId,r,()=>(this.To=Date.now(),e())),this.po*=this.mo,this.po<this._o&&(this.po=this._o),this.po>this.yo&&(this.po=this.yo)}vo(){null!==this.Io&&(this.Io.skipDelay(),this.Io=null)}cancel(){null!==this.Io&&(this.Io.cancel(),this.Io=null)}Ro(){return(Math.random()-.5)*this.po}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ss{constructor(e,t,n,r,i,o,s,a){this.Ws=e,this.bo=n,this.Po=r,this.connection=i,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=s,this.listener=a,this.state=0,this.Vo=0,this.So=null,this.Do=null,this.stream=null,this.Co=new so(e,t)}xo(){return 1===this.state||5===this.state||this.No()}No(){return 2===this.state||3===this.state}start(){4!==this.state?this.auth():this.ko()}async stop(){this.xo()&&await this.close(0)}Oo(){this.state=0,this.Co.reset()}$o(){this.No()&&null===this.So&&(this.So=this.Ws.enqueueAfterDelay(this.bo,6e4,()=>this.Mo()))}Fo(e){this.Bo(),this.stream.send(e)}async Mo(){if(this.No())return this.close(0)}Bo(){this.So&&(this.So.cancel(),this.So=null)}Lo(){this.Do&&(this.Do.cancel(),this.Do=null)}async close(e,t){this.Bo(),this.Lo(),this.Co.cancel(),this.Vo++,4!==e?this.Co.reset():t&&t.code===nW.RESOURCE_EXHAUSTED?(nB(t.toString()),nB("Using maximum backoff delay to prevent overloading the backend."),this.Co.Eo()):t&&t.code===nW.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.qo(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Zr(t)}qo(){}auth(){this.state=1;let e=this.Uo(this.Vo),t=this.Vo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([e,n])=>{this.Vo===t&&this.Ko(e,n)},t=>{e(()=>{let e=new nH(nW.UNKNOWN,"Fetching auth token failed: "+t.message);return this.Go(e)})})}Ko(e,t){let n=this.Uo(this.Vo);this.stream=this.Qo(e,t),this.stream.Jr(()=>{n(()=>(this.state=2,this.Do=this.Ws.enqueueAfterDelay(this.Po,1e4,()=>(this.No()&&(this.state=3),Promise.resolve())),this.listener.Jr()))}),this.stream.Zr(e=>{n(()=>this.Go(e))}),this.stream.onMessage(e=>{n(()=>this.onMessage(e))})}ko(){this.state=5,this.Co.Ao(async()=>{this.state=0,this.start()})}Go(e){return n$("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}Uo(e){return t=>{this.Ws.enqueueAndForget(()=>this.Vo===e?t():(n$("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class sa extends ss{constructor(e,t,n,r,i,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,n,r,o),this.serializer=i}Qo(e,t){return this.connection.wo("Listen",e,t)}onMessage(e){this.Co.reset();let t=function(e,t){let n;if("targetChange"in t){var r,i;t.targetChange;let o="NO_CHANGE"===(r=t.targetChange.targetChangeType||"NO_CHANGE")?0:"ADD"===r?1:"REMOVE"===r?2:"CURRENT"===r?3:"RESET"===r?4:nG(),s=t.targetChange.targetIds||[],a=(i=t.targetChange.resumeToken,e.useProto3Json?(void 0===i||"string"==typeof i||nG(),rw.fromBase64String(i||"")):(void 0===i||i instanceof Uint8Array||nG(),rw.fromUint8Array(i||new Uint8Array))),u=t.targetChange.cause;n=new os(o,s,a,u&&new nH(void 0===u.code?nW.UNKNOWN:i7(u.code),u.message||"")||null)}else if("documentChange"in t){t.documentChange;let r=t.documentChange;r.document,r.document.name,r.document.updateTime;let i=ow(e,r.document.name),o=oy(r.document.updateTime),s=r.document.createTime?oy(r.document.createTime):n9.min(),a=new rG({mapValue:{fields:r.document.fields}}),u=rW.newFoundDocument(i,o,s,a);n=new oi(r.targetIds||[],r.removedTargetIds||[],u.key,u)}else if("documentDelete"in t){t.documentDelete;let r=t.documentDelete;r.document;let i=ow(e,r.document),o=r.readTime?oy(r.readTime):n9.min(),s=rW.newNoDocument(i,o);n=new oi([],r.removedTargetIds||[],s.key,s)}else if("documentRemove"in t){t.documentRemove;let r=t.documentRemove;r.document;let i=ow(e,r.document);n=new oi([],r.removedTargetIds||[],i,null)}else{if(!("filter"in t))return nG();{t.filter;let e=t.filter;e.targetId;let r=new i8(e.count||0);n=new oo(e.targetId,r)}}return n}(this.serializer,e),n=function(e){if(!("targetChange"in e))return n9.min();let t=e.targetChange;return t.targetIds&&t.targetIds.length?n9.min():t.readTime?oy(t.readTime):n9.min()}(e);return this.listener.zo(t,n)}jo(e){let t={};t.database=oE(this.serializer),t.addTarget=function(e,t){let n;let r=t.target;return(n=io(r)?{documents:{documents:[oS(e,r.path)]}}:{query:function(e,t){var n,r,i;let o={structuredQuery:{}},s=t.path;null!==t.collectionGroup?(o.parent=oS(e,s),o.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(o.parent=oS(e,s.popLast()),o.structuredQuery.from=[{collectionId:s.lastSegment()}]);let a=function(e){if(0!==e.length)return function e(t){return t instanceof rZ?function(e){if("=="===e.op){if(r$(e.value))return{unaryFilter:{field:oT(e.field),op:"IS_NAN"}};if(rF(e.value))return{unaryFilter:{field:oT(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(r$(e.value))return{unaryFilter:{field:oT(e.field),op:"IS_NOT_NAN"}};if(rF(e.value))return{unaryFilter:{field:oT(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:oT(e.field),op:oh[e.op],value:e.value}}}(t):t instanceof rY?function(t){let n=t.getFilters().map(t=>e(t));return 1===n.length?n[0]:{compositeFilter:{op:of[t.op],filters:n}}}(t):nG()}(rY.create(e,"and"))}(t.filters);a&&(o.structuredQuery.where=a);let u=function(e){if(0!==e.length)return e.map(e=>({field:oT(e.field),direction:od[e.dir]}))}(t.orderBy);u&&(o.structuredQuery.orderBy=u);let l=(r=t.limit,e.useProto3Json||null==r?r:{value:r});return null!==l&&(o.structuredQuery.limit=l),t.startAt&&(o.structuredQuery.startAt={before:(n=t.startAt).inclusive,values:n.position}),t.endAt&&(o.structuredQuery.endAt={before:!(i=t.endAt).inclusive,values:i.position}),o}(e,r)}).targetId=t.targetId,t.resumeToken.approximateByteSize()>0?n.resumeToken=om(e,t.resumeToken):t.snapshotVersion.compareTo(n9.min())>0&&(n.readTime=og(e,t.snapshotVersion.toTimestamp())),n}(this.serializer,e);let n=function(e,t){let n=function(e,t){switch(t){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return nG()}}(0,t.purpose);return null==n?null:{"goog-listen-tags":n}}(this.serializer,e);n&&(t.labels=n),this.Fo(t)}Wo(e){let t={};t.database=oE(this.serializer),t.removeTarget=e,this.Fo(t)}}class su extends ss{constructor(e,t,n,r,i,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,n,r,o),this.serializer=i,this.Ho=!1}get Jo(){return this.Ho}start(){this.Ho=!1,this.lastStreamToken=void 0,super.start()}qo(){this.Ho&&this.Yo([])}Qo(e,t){return this.connection.wo("Write",e,t)}onMessage(e){var t,n;if(e.streamToken||nG(),this.lastStreamToken=e.streamToken,this.Ho){this.Co.reset();let r=(t=e.writeResults,n=e.commitTime,t&&t.length>0?(void 0!==n||nG(),t.map(e=>{let t;return(t=e.updateTime?oy(e.updateTime):oy(n)).isEqual(n9.min())&&(t=oy(n)),new iG(t,e.transformResults||[])})):[]),i=oy(e.commitTime);return this.listener.Zo(i,r)}return e.writeResults&&0!==e.writeResults.length&&nG(),this.Ho=!0,this.listener.Xo()}tu(){let e={};e.database=oE(this.serializer),this.Fo(e)}Yo(e){let t={streamToken:this.lastStreamToken,writes:e.map(e=>(function(e,t){var n;let r;if(t instanceof iZ)r={update:oI(e,t.key,t.value)};else if(t instanceof i3)r={delete:ob(e,t.key)};else if(t instanceof iY)r={update:oI(e,t.key,t.data),updateMask:function(e){let t=[];return e.fields.forEach(e=>t.push(e.canonicalString())),{fieldPaths:t}}(t.fieldMask)};else{if(!(t instanceof i4))return nG();r={verify:ob(e,t.key)}}return t.fieldTransforms.length>0&&(r.updateTransforms=t.fieldTransforms.map(e=>(function(e,t){let n=t.transform;if(n instanceof iL)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof iU)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof iq)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof i$)return{fieldPath:t.field.canonicalString(),increment:n._t};throw nG()})(0,e))),t.precondition.isNone||(r.currentDocument=void 0!==(n=t.precondition).updateTime?{updateTime:og(e,n.updateTime.toTimestamp())}:void 0!==n.exists?{exists:n.exists}:nG()),r})(this.serializer,e))};this.Fo(t)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sl extends class{}{constructor(e,t,n,r){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=n,this.serializer=r,this.eu=!1}nu(){if(this.eu)throw new nH(nW.FAILED_PRECONDITION,"The client has already been terminated.")}co(e,t,n){return this.nu(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([r,i])=>this.connection.co(e,t,n,r,i)).catch(e=>{throw"FirebaseError"===e.name?(e.code===nW.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new nH(nW.UNKNOWN,e.toString())})}fo(e,t,n,r){return this.nu(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,o])=>this.connection.fo(e,t,n,i,o,r)).catch(e=>{throw"FirebaseError"===e.name?(e.code===nW.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new nH(nW.UNKNOWN,e.toString())})}terminate(){this.eu=!0}}class sc{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.su=0,this.iu=null,this.ru=!0}ou(){0===this.su&&(this.uu("Unknown"),this.iu=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.iu=null,this.cu("Backend didn't respond within 10 seconds."),this.uu("Offline"),Promise.resolve())))}au(e){"Online"===this.state?this.uu("Unknown"):(this.su++,this.su>=1&&(this.hu(),this.cu(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.uu("Offline")))}set(e){this.hu(),this.su=0,"Online"===e&&(this.ru=!1),this.uu(e)}uu(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}cu(e){let t=`Could not reach Cloud Firestore backend. ${e}
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.ru?(nB(t),this.ru=!1):n$("OnlineStateTracker",t)}hu(){null!==this.iu&&(this.iu.cancel(),this.iu=null)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sd{constructor(e,t,n,r,i){this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.lu=[],this.fu=new Map,this.du=new Set,this.wu=[],this._u=i,this._u.qr(e=>{n.enqueueAndForget(async()=>{sb(this)&&(n$("RemoteStore","Restarting streams for network reachability change."),await async function(e){e.du.add(4),await sf(e),e.mu.set("Unknown"),e.du.delete(4),await sh(e)}(this))})}),this.mu=new sc(n,r)}}async function sh(e){if(sb(e))for(let t of e.wu)await t(!0)}async function sf(e){for(let t of e.wu)await t(!1)}function sp(e,t){e.fu.has(t.targetId)||(e.fu.set(t.targetId,t),s_(e)?sv(e):sM(e).No()&&sm(e,t))}function sg(e,t){let n=sM(e);e.fu.delete(t),n.No()&&sy(e,t),0===e.fu.size&&(n.No()?n.$o():sb(e)&&e.mu.set("Unknown"))}function sm(e,t){e.gu.Ot(t.targetId),sM(e).jo(t)}function sy(e,t){e.gu.Ot(t),sM(e).Wo(t)}function sv(e){e.gu=new ou({getRemoteKeysForTarget:t=>e.remoteSyncer.getRemoteKeysForTarget(t),ne:t=>e.fu.get(t)||null}),sM(e).start(),e.mu.ou()}function s_(e){return sb(e)&&!sM(e).xo()&&e.fu.size>0}function sb(e){return 0===e.du.size}async function sw(e){e.fu.forEach((t,n)=>{sm(e,t)})}async function sS(e,t){e.gu=void 0,s_(e)?(e.mu.au(t),sv(e)):e.mu.set("Unknown")}async function sE(e,t,n){if(e.mu.set("Online"),t instanceof os&&2===t.state&&t.cause)try{await async function(e,t){let n=t.cause;for(let r of t.targetIds)e.fu.has(r)&&(await e.remoteSyncer.rejectListen(r,n),e.fu.delete(r),e.gu.removeTarget(r))}(e,t)}catch(n){n$("RemoteStore","Failed to remove targets %s: %s ",t.targetIds.join(","),n),await sk(e,n)}else if(t instanceof oi?e.gu.Kt(t):t instanceof oo?e.gu.Jt(t):e.gu.zt(t),!n.isEqual(n9.min()))try{let t=await o0(e.localStore);n.compareTo(t)>=0&&await function(e,t){let n=e.gu.Xt(t);return n.targetChanges.forEach((n,r)=>{if(n.resumeToken.approximateByteSize()>0){let i=e.fu.get(r);i&&e.fu.set(r,i.withResumeToken(n.resumeToken,t))}}),n.targetMismatches.forEach(t=>{let n=e.fu.get(t);if(!n)return;e.fu.set(t,n.withResumeToken(rw.EMPTY_BYTE_STRING,n.snapshotVersion)),sy(e,t);let r=new oA(n.target,t,1,n.sequenceNumber);sm(e,r)}),e.remoteSyncer.applyRemoteEvent(n)}(e,n)}catch(t){n$("RemoteStore","Failed to raise snapshot:",t),await sk(e,t)}}async function sk(e,t,n){if(!ru(t))throw t;e.du.add(1),await sf(e),e.mu.set("Offline"),n||(n=()=>o0(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{n$("RemoteStore","Retrying IndexedDB access"),await n(),e.du.delete(1),await sh(e)})}function sI(e,t){return t().catch(n=>sk(e,n,t))}async function sT(e){let t=sL(e),n=e.lu.length>0?e.lu[e.lu.length-1].batchId:-1;for(;sb(e)&&e.lu.length<10;)try{let r=await function(e,t){return e.persistence.runTransaction("Get next mutation batch","readonly",n=>(void 0===t&&(t=-1),e.mutationQueue.getNextMutationBatchAfterBatchId(n,t)))}(e.localStore,n);if(null===r){0===e.lu.length&&t.$o();break}n=r.batchId,function(e,t){e.lu.push(t);let n=sL(e);n.No()&&n.Jo&&n.Yo(t.mutations)}(e,r)}catch(t){await sk(e,t)}sx(e)&&sC(e)}function sx(e){return sb(e)&&!sL(e).xo()&&e.lu.length>0}function sC(e){sL(e).start()}async function sA(e){sL(e).tu()}async function sO(e){let t=sL(e);for(let n of e.lu)t.Yo(n.mutations)}async function sN(e,t,n){let r=e.lu.shift(),i=i6.from(r,t,n);await sI(e,()=>e.remoteSyncer.applySuccessfulWrite(i)),await sT(e)}async function sR(e,t){t&&sL(e).Jo&&await async function(e,t){var n;if(function(e){switch(e){default:return nG();case nW.CANCELLED:case nW.UNKNOWN:case nW.DEADLINE_EXCEEDED:case nW.RESOURCE_EXHAUSTED:case nW.INTERNAL:case nW.UNAVAILABLE:case nW.UNAUTHENTICATED:return!1;case nW.INVALID_ARGUMENT:case nW.NOT_FOUND:case nW.ALREADY_EXISTS:case nW.PERMISSION_DENIED:case nW.FAILED_PRECONDITION:case nW.ABORTED:case nW.OUT_OF_RANGE:case nW.UNIMPLEMENTED:case nW.DATA_LOSS:return!0}}(n=t.code)&&n!==nW.ABORTED){let n=e.lu.shift();sL(e).Oo(),await sI(e,()=>e.remoteSyncer.rejectFailedWrite(n.batchId,t)),await sT(e)}}(e,t),sx(e)&&sC(e)}async function sD(e,t){e.asyncQueue.verifyOperationInProgress(),n$("RemoteStore","RemoteStore received new credentials");let n=sb(e);e.du.add(3),await sf(e),n&&e.mu.set("Unknown"),await e.remoteSyncer.handleCredentialChange(t),e.du.delete(3),await sh(e)}async function sP(e,t){t?(e.du.delete(2),await sh(e)):t||(e.du.add(2),await sf(e),e.mu.set("Unknown"))}function sM(e){var t,n,r;return e.yu||(e.yu=(t=e.datastore,n=e.asyncQueue,r={Jr:sw.bind(null,e),Zr:sS.bind(null,e),zo:sE.bind(null,e)},t.nu(),new sa(n,t.connection,t.authCredentials,t.appCheckCredentials,t.serializer,r)),e.wu.push(async t=>{t?(e.yu.Oo(),s_(e)?sv(e):e.mu.set("Unknown")):(await e.yu.stop(),e.gu=void 0)})),e.yu}function sL(e){var t,n,r;return e.pu||(e.pu=(t=e.datastore,n=e.asyncQueue,r={Jr:sA.bind(null,e),Zr:sR.bind(null,e),Xo:sO.bind(null,e),Zo:sN.bind(null,e)},t.nu(),new su(n,t.connection,t.authCredentials,t.appCheckCredentials,t.serializer,r)),e.wu.push(async t=>{t?(e.pu.Oo(),await sT(e)):(await e.pu.stop(),e.lu.length>0&&(n$("RemoteStore",`Stopping write stream with ${e.lu.length} pending writes`),e.lu=[]))})),e.pu}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sU{constructor(e,t,n,r,i){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new nK,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(e=>{})}static createAndSchedule(e,t,n,r,i){let o=new sU(e,t,Date.now()+n,r,i);return o.start(n),o}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new nH(nW.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function sj(e,t){if(nB("AsyncQueue",`${t}: ${e}`),ru(e))return new nH(nW.UNAVAILABLE,`${t}: ${e}`);throw e}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sq{constructor(e){this.comparator=e?(t,n)=>e(t,n)||rn.comparator(t.key,n.key):(e,t)=>rn.comparator(e.key,t.key),this.keyedMap=iI(),this.sortedSet=new rp(this.comparator)}static emptySet(e){return new sq(e.comparator)}has(e){return null!=this.keyedMap.get(e)}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){let t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,n)=>(e(t),!1))}add(e){let t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){let t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof sq)||this.size!==e.size)return!1;let t=this.sortedSet.getIterator(),n=e.sortedSet.getIterator();for(;t.hasNext();){let e=t.getNext().key,r=n.getNext().key;if(!e.isEqual(r))return!1}return!0}toString(){let e=[];return this.forEach(t=>{e.push(t.toString())}),0===e.length?"DocumentSet ()":"DocumentSet (\n  "+e.join("  \n")+"\n)"}copy(e,t){let n=new sq;return n.comparator=this.comparator,n.keyedMap=e,n.sortedSet=t,n}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sF{constructor(){this.Iu=new rp(rn.comparator)}track(e){let t=e.doc.key,n=this.Iu.get(t);n?0!==e.type&&3===n.type?this.Iu=this.Iu.insert(t,e):3===e.type&&1!==n.type?this.Iu=this.Iu.insert(t,{type:n.type,doc:e.doc}):2===e.type&&2===n.type?this.Iu=this.Iu.insert(t,{type:2,doc:e.doc}):2===e.type&&0===n.type?this.Iu=this.Iu.insert(t,{type:0,doc:e.doc}):1===e.type&&0===n.type?this.Iu=this.Iu.remove(t):1===e.type&&2===n.type?this.Iu=this.Iu.insert(t,{type:1,doc:n.doc}):0===e.type&&1===n.type?this.Iu=this.Iu.insert(t,{type:2,doc:e.doc}):nG():this.Iu=this.Iu.insert(t,e)}Tu(){let e=[];return this.Iu.inorderTraversal((t,n)=>{e.push(n)}),e}}class s${constructor(e,t,n,r,i,o,s,a,u){this.query=e,this.docs=t,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=s,this.excludesMetadataChanges=a,this.hasCachedResults=u}static fromInitialDocuments(e,t,n,r,i){let o=[];return t.forEach(e=>{o.push({type:0,doc:e})}),new s$(e,t,sq.emptySet(t),o,n,r,!0,!1,i)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&iy(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;let t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e].type!==n[e].type||!t[e].doc.isEqual(n[e].doc))return!1;return!0}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sB{constructor(){this.Eu=void 0,this.listeners=[]}}class sz{constructor(){this.queries=new iS(e=>iv(e),iy),this.onlineState="Unknown",this.Au=new Set}}async function sV(e,t){let n=t.query,r=!1,i=e.queries.get(n);if(i||(r=!0,i=new sB),r)try{i.Eu=await e.onListen(n)}catch(n){let e=sj(n,`Initialization of query '${i_(t.query)}' failed`);return void t.onError(e)}e.queries.set(n,i),i.listeners.push(t),t.Ru(e.onlineState),i.Eu&&t.vu(i.Eu)&&sK(e)}async function sG(e,t){let n=t.query,r=!1,i=e.queries.get(n);if(i){let e=i.listeners.indexOf(t);e>=0&&(i.listeners.splice(e,1),r=0===i.listeners.length)}if(r)return e.queries.delete(n),e.onUnlisten(n)}function sW(e,t){let n=!1;for(let r of t){let t=r.query,i=e.queries.get(t);if(i){for(let e of i.listeners)e.vu(r)&&(n=!0);i.Eu=r}}n&&sK(e)}function sH(e,t,n){let r=e.queries.get(t);if(r)for(let e of r.listeners)e.onError(n);e.queries.delete(t)}function sK(e){e.Au.forEach(e=>{e.next()})}class sJ{constructor(e,t,n){this.query=e,this.bu=t,this.Pu=!1,this.Vu=null,this.onlineState="Unknown",this.options=n||{}}vu(e){if(!this.options.includeMetadataChanges){let t=[];for(let n of e.docChanges)3!==n.type&&t.push(n);e=new s$(e.query,e.docs,e.oldDocs,t,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.Pu?this.Su(e)&&(this.bu.next(e),t=!0):this.Du(e,this.onlineState)&&(this.Cu(e),t=!0),this.Vu=e,t}onError(e){this.bu.error(e)}Ru(e){this.onlineState=e;let t=!1;return this.Vu&&!this.Pu&&this.Du(this.Vu,e)&&(this.Cu(this.Vu),t=!0),t}Du(e,t){return!e.fromCache||(!this.options.xu||!("Offline"!==t))&&(!e.docs.isEmpty()||e.hasCachedResults||"Offline"===t)}Su(e){if(e.docChanges.length>0)return!0;let t=this.Vu&&this.Vu.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges}Cu(e){e=s$.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Pu=!0,this.bu.next(e)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class sX{constructor(e){this.key=e}}class sQ{constructor(e){this.key=e}}class sZ{constructor(e,t){this.query=e,this.Lu=t,this.qu=null,this.hasCachedResults=!1,this.current=!1,this.Uu=iO(),this.mutatedKeys=iO(),this.Ku=iw(e),this.Gu=new sq(this.Ku)}get Qu(){return this.Lu}zu(e,t){let n=t?t.ju:new sF,r=t?t.Gu:this.Gu,i=t?t.mutatedKeys:this.mutatedKeys,o=r,s=!1,a="F"===this.query.limitType&&r.size===this.query.limit?r.last():null,u="L"===this.query.limitType&&r.size===this.query.limit?r.first():null;if(e.inorderTraversal((e,t)=>{let l=r.get(e),c=ib(this.query,t)?t:null,d=!!l&&this.mutatedKeys.has(l.key),h=!!c&&(c.hasLocalMutations||this.mutatedKeys.has(c.key)&&c.hasCommittedMutations),f=!1;l&&c?l.data.isEqual(c.data)?d!==h&&(n.track({type:3,doc:c}),f=!0):this.Wu(l,c)||(n.track({type:2,doc:c}),f=!0,(a&&this.Ku(c,a)>0||u&&0>this.Ku(c,u))&&(s=!0)):!l&&c?(n.track({type:0,doc:c}),f=!0):l&&!c&&(n.track({type:1,doc:l}),f=!0,(a||u)&&(s=!0)),f&&(c?(o=o.add(c),i=h?i.add(e):i.delete(e)):(o=o.delete(e),i=i.delete(e)))}),null!==this.query.limit)for(;o.size>this.query.limit;){let e="F"===this.query.limitType?o.last():o.first();o=o.delete(e.key),i=i.delete(e.key),n.track({type:1,doc:e})}return{Gu:o,ju:n,Mi:s,mutatedKeys:i}}Wu(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,n){let r=this.Gu;this.Gu=e.Gu,this.mutatedKeys=e.mutatedKeys;let i=e.ju.Tu();i.sort((e,t)=>(function(e,t){let n=e=>{switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return nG()}};return n(e)-n(t)})(e.type,t.type)||this.Ku(e.doc,t.doc)),this.Hu(n);let o=t?this.Ju():[],s=0===this.Uu.size&&this.current?1:0,a=s!==this.qu;return(this.qu=s,0!==i.length||a)?{snapshot:new s$(this.query,e.Gu,r,i,e.mutatedKeys,0===s,a,!1,!!n&&n.resumeToken.approximateByteSize()>0),Yu:o}:{Yu:o}}Ru(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({Gu:this.Gu,ju:new sF,mutatedKeys:this.mutatedKeys,Mi:!1},!1)):{Yu:[]}}Zu(e){return!this.Lu.has(e)&&!!this.Gu.has(e)&&!this.Gu.get(e).hasLocalMutations}Hu(e){e&&(e.addedDocuments.forEach(e=>this.Lu=this.Lu.add(e)),e.modifiedDocuments.forEach(e=>{}),e.removedDocuments.forEach(e=>this.Lu=this.Lu.delete(e)),this.current=e.current)}Ju(){if(!this.current)return[];let e=this.Uu;this.Uu=iO(),this.Gu.forEach(e=>{this.Zu(e.key)&&(this.Uu=this.Uu.add(e.key))});let t=[];return e.forEach(e=>{this.Uu.has(e)||t.push(new sQ(e))}),this.Uu.forEach(n=>{e.has(n)||t.push(new sX(n))}),t}Xu(e){this.Lu=e.Wi,this.Uu=iO();let t=this.zu(e.documents);return this.applyChanges(t,!0)}tc(){return s$.fromInitialDocuments(this.query,this.Gu,this.mutatedKeys,0===this.qu,this.hasCachedResults)}}class sY{constructor(e,t,n){this.query=e,this.targetId=t,this.view=n}}class s0{constructor(e){this.key=e,this.ec=!1}}class s1{constructor(e,t,n,r,i,o){this.localStore=e,this.remoteStore=t,this.eventManager=n,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.nc={},this.sc=new iS(e=>iv(e),iy),this.ic=new Map,this.rc=new Set,this.oc=new rp(rn.comparator),this.uc=new Map,this.cc=new o$,this.ac={},this.hc=new Map,this.lc=oM.bn(),this.onlineState="Unknown",this.fc=void 0}get isPrimaryClient(){return!0===this.fc}}async function s2(e,t){var n,r;let i,o;let s=(e.remoteStore.remoteSyncer.applyRemoteEvent=s6.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=al.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=s8.bind(null,e),e.nc.zo=sW.bind(null,e.eventManager),e.nc.wc=sH.bind(null,e.eventManager),e),a=s.sc.get(t);if(a)i=a.targetId,s.sharedClientState.addLocalQueryTarget(i),o=a.view.tc();else{let e=await (n=s.localStore,r=ip(t),n.persistence.runTransaction("Allocate target","readwrite",e=>{let t;return n.Ds.getTargetData(e,r).next(i=>i?(t=i,ra.resolve(t)):n.Ds.allocateTargetId(e).next(i=>(t=new oA(r,i,0,e.currentSequenceNumber),n.Ds.addTargetData(e,t).next(()=>t))))}).then(e=>{let t=n.Li.get(e.targetId);return(null===t||e.snapshotVersion.compareTo(t.snapshotVersion)>0)&&(n.Li=n.Li.insert(e.targetId,e),n.qi.set(r,e.targetId)),e}));s.isPrimaryClient&&sp(s.remoteStore,e);let a=s.sharedClientState.addLocalQueryTarget(e.targetId);i=e.targetId,o=await s3(s,t,i,"current"===a,e.resumeToken)}return o}async function s3(e,t,n,r,i){e.dc=(t,n,r)=>(async function(e,t,n,r){let i=t.view.zu(n);i.Mi&&(i=await o2(e.localStore,t.query,!1).then(({documents:e})=>t.view.zu(e,i)));let o=r&&r.targetChanges.get(t.targetId),s=t.view.applyChanges(i,e.isPrimaryClient,o);return ao(e,t.targetId,s.Yu),s.snapshot})(e,t,n,r);let o=await o2(e.localStore,t,!0),s=new sZ(t,o.Wi),a=s.zu(o.documents),u=or.createSynthesizedTargetChangeForCurrentChange(n,r&&"Offline"!==e.onlineState,i),l=s.applyChanges(a,e.isPrimaryClient,u);ao(e,n,l.Yu);let c=new sY(t,n,s);return e.sc.set(t,c),e.ic.has(n)?e.ic.get(n).push(t):e.ic.set(n,[t]),l.snapshot}async function s4(e,t){let n=e.sc.get(t),r=e.ic.get(n.targetId);if(r.length>1)return e.ic.set(n.targetId,r.filter(e=>!iy(e,t))),void e.sc.delete(t);e.isPrimaryClient?(e.sharedClientState.removeLocalQueryTarget(n.targetId),e.sharedClientState.isActiveQueryTarget(n.targetId)||await o1(e.localStore,n.targetId,!1).then(()=>{e.sharedClientState.clearQueryState(n.targetId),sg(e.remoteStore,n.targetId),ar(e,n.targetId)}).catch(rs)):(ar(e,n.targetId),await o1(e.localStore,n.targetId,!0))}async function s5(e,t,n){var r;let i=(e.remoteStore.remoteSyncer.applySuccessfulWrite=s7.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=ae.bind(null,e),e);try{let e;let o=await function(e,t){let n,r;let i=n6.now(),o=t.reduce((e,t)=>e.add(t.key),iO());return e.persistence.runTransaction("Locally write mutations","readwrite",s=>{let a=iE,u=iO();return e.Ki.getEntries(s,o).next(e=>{(a=e).forEach((e,t)=>{t.isValidDocument()||(u=u.add(e))})}).next(()=>e.localDocuments.getOverlayedDocuments(s,a)).next(r=>{n=r;let o=[];for(let e of t){let t=function(e,t){let n=null;for(let r of e.fieldTransforms){let e=t.data.field(r.field),i=iM(r.transform,e||null);null!=i&&(null===n&&(n=rG.empty()),n.set(r.field,i))}return n||null}(e,n.get(e.key).overlayedDocument);null!=t&&o.push(new iY(e.key,t,function e(t){let n=[];return rh(t.fields,(t,r)=>{let i=new rt([t]);if(rB(r)){let t=e(r.mapValue).fields;if(0===t.length)n.push(i);else for(let e of t)n.push(i.child(e))}else n.push(i)}),new r_(n)}(t.value.mapValue),iW.exists(!0)))}return e.mutationQueue.addMutationBatch(s,i,o,t)}).next(t=>{r=t;let i=t.applyToLocalDocumentSet(n,u);return e.documentOverlayCache.saveOverlays(s,t.batchId,i)})}).then(()=>({batchId:r.batchId,changes:iT(n)}))}(i.localStore,t);i.sharedClientState.addPendingMutation(o.batchId),r=o.batchId,(e=i.ac[i.currentUser.toKey()])||(e=new rp(n4)),e=e.insert(r,n),i.ac[i.currentUser.toKey()]=e,await aa(i,o.changes),await sT(i.remoteStore)}catch(t){let e=sj(t,"Failed to persist write");n.reject(e)}}async function s6(e,t){try{let n=await function(e,t){let n=t.snapshotVersion,r=e.Li;return e.persistence.runTransaction("Apply remote event","readwrite-primary",i=>{var o;let s,a;let u=e.Ki.newChangeBuffer({trackRemovals:!0});r=e.Li;let l=[];t.targetChanges.forEach((o,s)=>{var a;let u=r.get(s);if(!u)return;l.push(e.Ds.removeMatchingKeys(i,o.removedDocuments,s).next(()=>e.Ds.addMatchingKeys(i,o.addedDocuments,s)));let c=u.withSequenceNumber(i.currentSequenceNumber);t.targetMismatches.has(s)?c=c.withResumeToken(rw.EMPTY_BYTE_STRING,n9.min()).withLastLimboFreeSnapshotVersion(n9.min()):o.resumeToken.approximateByteSize()>0&&(c=c.withResumeToken(o.resumeToken,n)),r=r.insert(s,c),a=c,(0===u.resumeToken.approximateByteSize()||a.snapshotVersion.toMicroseconds()-u.snapshotVersion.toMicroseconds()>=3e8||o.addedDocuments.size+o.modifiedDocuments.size+o.removedDocuments.size>0)&&l.push(e.Ds.updateTargetData(i,c))});let c=iE,d=iO();if(t.documentUpdates.forEach(n=>{t.resolvedLimboDocuments.has(n)&&l.push(e.persistence.referenceDelegate.updateLimboDocument(i,n))}),l.push((o=t.documentUpdates,s=iO(),a=iO(),o.forEach(e=>s=s.add(e)),u.getEntries(i,s).next(e=>{let t=iE;return o.forEach((n,r)=>{let i=e.get(n);r.isFoundDocument()!==i.isFoundDocument()&&(a=a.add(n)),r.isNoDocument()&&r.version.isEqual(n9.min())?(u.removeEntry(n,r.readTime),t=t.insert(n,r)):!i.isValidDocument()||r.version.compareTo(i.version)>0||0===r.version.compareTo(i.version)&&i.hasPendingWrites?(u.addEntry(r),t=t.insert(n,r)):n$("LocalStore","Ignoring outdated watch update for ",n,". Current version:",i.version," Watch version:",r.version)}),{zi:t,ji:a}})).next(e=>{c=e.zi,d=e.ji})),!n.isEqual(n9.min())){let t=e.Ds.getLastRemoteSnapshotVersion(i).next(t=>e.Ds.setTargetsMetadata(i,i.currentSequenceNumber,n));l.push(t)}return ra.waitFor(l).next(()=>u.apply(i)).next(()=>e.localDocuments.getLocalViewOfDocuments(i,c,d)).next(()=>c)}).then(t=>(e.Li=r,t))}(e.localStore,t);t.targetChanges.forEach((t,n)=>{let r=e.uc.get(n);r&&(t.addedDocuments.size+t.modifiedDocuments.size+t.removedDocuments.size<=1||nG(),t.addedDocuments.size>0?r.ec=!0:t.modifiedDocuments.size>0?r.ec||nG():t.removedDocuments.size>0&&(r.ec||nG(),r.ec=!1))}),await aa(e,n,t)}catch(e){await rs(e)}}function s9(e,t,n){var r;if(e.isPrimaryClient&&0===n||!e.isPrimaryClient&&1===n){let n;let i=[];e.sc.forEach((e,n)=>{let r=n.view.Ru(t);r.snapshot&&i.push(r.snapshot)}),(r=e.eventManager).onlineState=t,n=!1,r.queries.forEach((e,r)=>{for(let e of r.listeners)e.Ru(t)&&(n=!0)}),n&&sK(r),i.length&&e.nc.zo(i),e.onlineState=t,e.isPrimaryClient&&e.sharedClientState.setOnlineState(t)}}async function s8(e,t,n){e.sharedClientState.updateQueryState(t,"rejected",n);let r=e.uc.get(t),i=r&&r.key;if(i){let n=new rp(rn.comparator);n=n.insert(i,rW.newNoDocument(i,n9.min()));let r=iO().add(i),o=new on(n9.min(),new Map,new ry(n4),n,r);await s6(e,o),e.oc=e.oc.remove(i),e.uc.delete(t),as(e)}else await o1(e.localStore,t,!1).then(()=>ar(e,t,n)).catch(rs)}async function s7(e,t){var n;let r=t.batch.batchId;try{let i=await (n=e.localStore).persistence.runTransaction("Acknowledge batch","readwrite-primary",e=>{let r=t.batch.keys(),i=n.Ki.newChangeBuffer({trackRemovals:!0});return(function(e,t,n,r){let i=n.batch,o=i.keys(),s=ra.resolve();return o.forEach(e=>{s=s.next(()=>r.getEntry(t,e)).next(t=>{let o=n.docVersions.get(e);null!==o||nG(),0>t.version.compareTo(o)&&(i.applyToRemoteDocument(t,n),t.isValidDocument()&&(t.setReadTime(n.commitVersion),r.addEntry(t)))})}),s.next(()=>e.mutationQueue.removeMutationBatch(t,i))})(n,e,t,i).next(()=>i.apply(e)).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,r,t.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,function(e){let t=iO();for(let n=0;n<e.mutationResults.length;++n)e.mutationResults[n].transformResults.length>0&&(t=t.add(e.batch.mutations[n].key));return t}(t))).next(()=>n.localDocuments.getDocuments(e,r))});an(e,r,null),at(e,r),e.sharedClientState.updateMutationState(r,"acknowledged"),await aa(e,i)}catch(e){await rs(e)}}async function ae(e,t,n){var r;try{let i=await (r=e.localStore).persistence.runTransaction("Reject batch","readwrite-primary",e=>{let n;return r.mutationQueue.lookupMutationBatch(e,t).next(t=>(null!==t||nG(),n=t.keys(),r.mutationQueue.removeMutationBatch(e,t))).next(()=>r.mutationQueue.performConsistencyCheck(e)).next(()=>r.documentOverlayCache.removeOverlaysForBatchId(e,n,t)).next(()=>r.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,n)).next(()=>r.localDocuments.getDocuments(e,n))});an(e,t,n),at(e,t),e.sharedClientState.updateMutationState(t,"rejected",n),await aa(e,i)}catch(e){await rs(e)}}function at(e,t){(e.hc.get(t)||[]).forEach(e=>{e.resolve()}),e.hc.delete(t)}function an(e,t,n){let r=e.ac[e.currentUser.toKey()];if(r){let i=r.get(t);i&&(n?i.reject(n):i.resolve(),r=r.remove(t)),e.ac[e.currentUser.toKey()]=r}}function ar(e,t,n=null){for(let r of(e.sharedClientState.removeLocalQueryTarget(t),e.ic.get(t)))e.sc.delete(r),n&&e.nc.wc(r,n);e.ic.delete(t),e.isPrimaryClient&&e.cc.hs(t).forEach(t=>{e.cc.containsKey(t)||ai(e,t)})}function ai(e,t){e.rc.delete(t.path.canonicalString());let n=e.oc.get(t);null!==n&&(sg(e.remoteStore,n),e.oc=e.oc.remove(t),e.uc.delete(n),as(e))}function ao(e,t,n){for(let r of n)r instanceof sX?(e.cc.addReference(r.key,t),function(e,t){let n=t.key,r=n.path.canonicalString();e.oc.get(n)||e.rc.has(r)||(n$("SyncEngine","New document in limbo: "+n),e.rc.add(r),as(e))}(e,r)):r instanceof sQ?(n$("SyncEngine","Document no longer in limbo: "+r.key),e.cc.removeReference(r.key,t),e.cc.containsKey(r.key)||ai(e,r.key)):nG()}function as(e){for(;e.rc.size>0&&e.oc.size<e.maxConcurrentLimboResolutions;){let t=e.rc.values().next().value;e.rc.delete(t);let n=new rn(n7.fromString(t)),r=e.lc.next();e.uc.set(r,new s0(n)),e.oc=e.oc.insert(n,r),sp(e.remoteStore,new oA(ip(ia(n.path)),r,2,rl.ct))}}async function aa(e,t,n){let r=[],i=[],o=[];e.sc.isEmpty()||(e.sc.forEach((s,a)=>{o.push(e.dc(a,t,n).then(t=>{if((t||n)&&e.isPrimaryClient&&e.sharedClientState.updateQueryState(a.targetId,(null==t?void 0:t.fromCache)?"not-current":"current"),t){r.push(t);let e=oX.Di(a.targetId,t);i.push(e)}}))}),await Promise.all(o),e.nc.zo(r),await async function(e,t){try{await e.persistence.runTransaction("notifyLocalViewChanges","readwrite",n=>ra.forEach(t,t=>ra.forEach(t.Vi,r=>e.persistence.referenceDelegate.addReference(n,t.targetId,r)).next(()=>ra.forEach(t.Si,r=>e.persistence.referenceDelegate.removeReference(n,t.targetId,r)))))}catch(e){if(!ru(e))throw e;n$("LocalStore","Failed to update sequence numbers: "+e)}for(let n of t){let t=n.targetId;if(!n.fromCache){let n=e.Li.get(t),r=n.snapshotVersion,i=n.withLastLimboFreeSnapshotVersion(r);e.Li=e.Li.insert(t,i)}}}(e.localStore,i))}async function au(e,t){if(!e.currentUser.isEqual(t)){n$("SyncEngine","User change. New user:",t.toKey());let n=await oY(e.localStore,t);e.currentUser=t,e.hc.forEach(e=>{e.forEach(e=>{e.reject(new nH(nW.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))})}),e.hc.clear(),e.sharedClientState.handleUserChange(t,n.removedBatchIds,n.addedBatchIds),await aa(e,n.Qi)}}function al(e,t){let n=e.uc.get(t);if(n&&n.ec)return iO().add(n.key);{let n=iO(),r=e.ic.get(t);if(!r)return n;for(let t of r){let r=e.sc.get(t);n=n.unionWith(r.view.Qu)}return n}}class ac{constructor(){this.synchronizeTabs=!1}async initialize(e){this.serializer=si(e.databaseInfo.databaseId),this.sharedClientState=this.createSharedClientState(e),this.persistence=this.createPersistence(e),await this.persistence.start(),this.localStore=this.createLocalStore(e),this.gcScheduler=this.createGarbageCollectionScheduler(e,this.localStore),this.indexBackfillerScheduler=this.createIndexBackfillerScheduler(e,this.localStore)}createGarbageCollectionScheduler(e,t){return null}createIndexBackfillerScheduler(e,t){return null}createLocalStore(e){var t;return t=this.persistence,new oZ(t,new oQ,e.initialUser,this.serializer)}createPersistence(e){return new oH(oJ.Fs,this.serializer)}createSharedClientState(e){return new o4}async terminate(){this.gcScheduler&&this.gcScheduler.stop(),await this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class ad{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=e=>s9(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=au.bind(null,this.syncEngine),await sP(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new sz}createDatastore(e){let t=si(e.databaseInfo.databaseId),n=new sn(e.databaseInfo);return new sl(e.authCredentials,e.appCheckCredentials,n,t)}createRemoteStore(e){var t;return t=this.localStore,new sd(t,this.datastore,e.asyncQueue,e=>s9(this.syncEngine,e,0),o6.D()?new o6:new o5)}createSyncEngine(e,t){return function(e,t,n,r,i,o,s){let a=new s1(e,t,n,r,i,o);return s&&(a.fc=!0),a}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}terminate(){return async function(e){n$("RemoteStore","RemoteStore shutting down."),e.du.add(5),await sf(e),e._u.shutdown(),e.mu.set("Unknown")}(this.remoteStore)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *//**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ah{constructor(e){this.observer=e,this.muted=!1}next(e){this.observer.next&&this.gc(this.observer.next,e)}error(e){this.observer.error?this.gc(this.observer.error,e):nB("Uncaught Error in snapshot listener:",e.toString())}yc(){this.muted=!0}gc(e,t){this.muted||setTimeout(()=>{this.muted||e(t)},0)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class af{constructor(e,t,n,r){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=n,this.databaseInfo=r,this.user=nU.UNAUTHENTICATED,this.clientId=n3.A(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(n,async e=>{n$("FirestoreClient","Received user=",e.uid),await this.authCredentialListener(e),this.user=e}),this.appCheckCredentials.start(n,e=>(n$("FirestoreClient","Received new app check token=",e),this.appCheckCredentialListener(e,this.user)))}async getConfiguration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new nH(nW.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();let e=new nK;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(n){let t=sj(n,"Failed to shutdown persistence");e.reject(t)}}),e.promise}}async function ap(e,t){e.asyncQueue.verifyOperationInProgress(),n$("FirestoreClient","Initializing OfflineComponentProvider");let n=await e.getConfiguration();await t.initialize(n);let r=n.initialUser;e.setCredentialChangeListener(async e=>{r.isEqual(e)||(await oY(t.localStore,e),r=e)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function ag(e,t){e.asyncQueue.verifyOperationInProgress();let n=await am(e);n$("FirestoreClient","Initializing OnlineComponentProvider");let r=await e.getConfiguration();await t.initialize(n,r),e.setCredentialChangeListener(e=>sD(t.remoteStore,e)),e.setAppCheckTokenChangeListener((e,n)=>sD(t.remoteStore,n)),e._onlineComponents=t}async function am(e){if(!e._offlineComponents){if(e._uninitializedComponentsProvider){n$("FirestoreClient","Using user provided OfflineComponentProvider");try{await ap(e,e._uninitializedComponentsProvider._offline)}catch(t){if(!("FirebaseError"===t.name?t.code===nW.FAILED_PRECONDITION||t.code===nW.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||22===t.code||20===t.code||11===t.code))throw t;nz("Error using user provided cache. Falling back to memory cache: "+t),await ap(e,new ac)}}else n$("FirestoreClient","Using default OfflineComponentProvider"),await ap(e,new ac)}return e._offlineComponents}async function ay(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(n$("FirestoreClient","Using user provided OnlineComponentProvider"),await ag(e,e._uninitializedComponentsProvider._online)):(n$("FirestoreClient","Using default OnlineComponentProvider"),await ag(e,new ad))),e._onlineComponents}async function av(e){let t=await ay(e),n=t.eventManager;return n.onListen=s2.bind(null,t.syncEngine),n.onUnlisten=s4.bind(null,t.syncEngine),n}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let a_=new Map;/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function ab(e,t,n){if(!n)throw new nH(nW.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}function aw(e){if(!rn.isDocumentKey(e))throw new nH(nW.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function aS(e){if(rn.isDocumentKey(e))throw new nH(nW.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`)}function aE(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e=`${e.substring(0,20)}...`),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";{var t;let n=(t=e).constructor?t.constructor.name:null;return n?`a custom ${n} object`:"an object"}}return"function"==typeof e?"a function":nG()}function ak(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new nH(nW.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{let n=aE(e);throw new nH(nW.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${n}`)}}return e}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class aI{constructor(e){var t;if(void 0===e.host){if(void 0!==e.ssl)throw new nH(nW.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=null===(t=e.ssl)||void 0===t||t;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.cache=e.localCache,void 0===e.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new nH(nW.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.useFetchStreams=!!e.useFetchStreams,function(e,t,n,r){if(!0===t&&!0===r)throw new nH(nW.INVALID_ARGUMENT,`${e} and ${n} cannot be used together.`)}("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling)}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class aT{constructor(e,t,n,r){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=n,this._app=r,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new aI({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new nH(nW.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return void 0!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new nH(nW.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new aI(e),void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new nX;switch(e.type){case"firstParty":return new n0(e.sessionIndex||"0",e.iamToken||null,e.authTokenFactory||null);case"provider":return e.client;default:throw new nH(nW.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(e){let t=a_.get(e);t&&(n$("ComponentProvider","Removing Datastore"),a_.delete(e),t.terminate())}(this),Promise.resolve()}}function ax(e,t,n,r={}){var i;let o=(e=ak(e,aT))._getSettings();if("firestore.googleapis.com"!==o.host&&o.host!==t&&nz("Host has been set in both settings() and useEmulator(), emulator host will be used"),e._setSettings(Object.assign(Object.assign({},o),{host:`${t}:${n}`,ssl:!1})),r.mockUserToken){let t,n;if("string"==typeof r.mockUserToken)t=r.mockUserToken,n=nU.MOCK_USER;else{t=(0,p.Sg)(r.mockUserToken,null===(i=e._app)||void 0===i?void 0:i.options.projectId);let o=r.mockUserToken.sub||r.mockUserToken.user_id;if(!o)throw new nH(nW.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new nU(o)}e._authCredentials=new nQ(new nJ(t,n))}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class aC{constructor(e,t,n){this.converter=t,this._key=n,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new aO(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new aC(this.firestore,e,this._key)}}class aA{constructor(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new aA(this.firestore,e,this._query)}}class aO extends aA{constructor(e,t,n){super(e,t,ia(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){let e=this._path.popLast();return e.isEmpty()?null:new aC(this.firestore,null,new rn(e))}withConverter(e){return new aO(this.firestore,e,this._path)}}function aN(e,t,...n){if(e=(0,p.m9)(e),ab("collection","path",t),e instanceof aT){let r=n7.fromString(t,...n);return aS(r),new aO(e,null,r)}{if(!(e instanceof aC||e instanceof aO))throw new nH(nW.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");let r=e._path.child(n7.fromString(t,...n));return aS(r),new aO(e.firestore,null,r)}}function aR(e,t,...n){if(e=(0,p.m9)(e),1==arguments.length&&(t=n3.A()),ab("doc","path",t),e instanceof aT){let r=n7.fromString(t,...n);return aw(r),new aC(e,null,new rn(r))}{if(!(e instanceof aC||e instanceof aO))throw new nH(nW.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");let r=e._path.child(n7.fromString(t,...n));return aw(r),new aC(e.firestore,e instanceof aO?e.converter:null,new rn(r))}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class aD{constructor(){this.Nc=Promise.resolve(),this.kc=[],this.Oc=!1,this.$c=[],this.Mc=null,this.Fc=!1,this.Bc=!1,this.Lc=[],this.Co=new so(this,"async_queue_retry"),this.qc=()=>{let e=sr();e&&n$("AsyncQueue","Visibility state changed to "+e.visibilityState),this.Co.vo()};let e=sr();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.qc)}get isShuttingDown(){return this.Oc}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Uc(),this.Kc(e)}enterRestrictedMode(e){if(!this.Oc){this.Oc=!0,this.Bc=e||!1;let t=sr();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.qc)}}enqueue(e){if(this.Uc(),this.Oc)return new Promise(()=>{});let t=new nK;return this.Kc(()=>this.Oc&&this.Bc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.kc.push(e),this.Gc()))}async Gc(){if(0!==this.kc.length){try{await this.kc[0](),this.kc.shift(),this.Co.reset()}catch(e){if(!ru(e))throw e;n$("AsyncQueue","Operation failed with retryable error: "+e)}this.kc.length>0&&this.Co.Ao(()=>this.Gc())}}Kc(e){let t=this.Nc.then(()=>(this.Fc=!0,e().catch(e=>{let t;throw this.Mc=e,this.Fc=!1,nB("INTERNAL UNHANDLED ERROR: ",(t=e.message||"",e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t)),e}).then(e=>(this.Fc=!1,e))));return this.Nc=t,t}enqueueAfterDelay(e,t,n){this.Uc(),this.Lc.indexOf(e)>-1&&(t=0);let r=sU.createAndSchedule(this,e,t,n,e=>this.Qc(e));return this.$c.push(r),r}Uc(){this.Mc&&nG()}verifyOperationInProgress(){}async zc(){let e;do e=this.Nc,await e;while(e!==this.Nc)}jc(e){for(let t of this.$c)if(t.timerId===e)return!0;return!1}Wc(e){return this.zc().then(()=>{for(let t of(this.$c.sort((e,t)=>e.targetTimeMs-t.targetTimeMs),this.$c))if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.zc()})}Hc(e){this.Lc.push(e)}Qc(e){let t=this.$c.indexOf(e);this.$c.splice(t,1)}}function aP(e){return function(e,t){if("object"!=typeof e||null===e)return!1;for(let n of t)if(n in e&&"function"==typeof e[n])return!0;return!1}(e,["next","error","complete"])}class aM extends aT{constructor(e,t,n,r){super(e,t,n,r),this.type="firestore",this._queue=new aD,this._persistenceKey=(null==r?void 0:r.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||aj(this),this._firestoreClient.terminate()}}function aL(e,t){let n="object"==typeof e?e:(0,d.Mq)(),r=(0,d.qX)(n,"firestore").getImmediate({identifier:"string"==typeof e?e:t||"(default)"});if(!r._initialized){let e=(0,p.P0)("firestore");e&&ax(r,...e)}return r}function aU(e){return e._firestoreClient||aj(e),e._firestoreClient.verifyNotTerminated(),e._firestoreClient}function aj(e){var t,n,r,i;let o=e._freezeSettings(),s=(i=e._databaseId,new rC(i,(null===(t=e._app)||void 0===t?void 0:t.options.appId)||"",e._persistenceKey,o.host,o.ssl,o.experimentalForceLongPolling,o.experimentalAutoDetectLongPolling,o.useFetchStreams));e._firestoreClient=new af(e._authCredentials,e._appCheckCredentials,e._queue,s),(null===(n=o.cache)||void 0===n?void 0:n._offlineComponentProvider)&&(null===(r=o.cache)||void 0===r?void 0:r._onlineComponentProvider)&&(e._firestoreClient._uninitializedComponentsProvider={_offlineKind:o.cache.kind,_offline:o.cache._offlineComponentProvider,_online:o.cache._onlineComponentProvider})}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class aq{constructor(e){this._byteString=e}static fromBase64String(e){try{return new aq(rw.fromBase64String(e))}catch(e){throw new nH(nW.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}}static fromUint8Array(e){return new aq(rw.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class aF{constructor(...e){for(let t=0;t<e.length;++t)if(0===e[t].length)throw new nH(nW.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new rt(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class a${constructor(e){this._methodName=e}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class aB{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new nH(nW.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new nH(nW.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return n4(this._lat,e._lat)||n4(this._long,e._long)}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let az=/^__.*__$/;class aV{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return null!==this.fieldMask?new iY(e,this.data,this.fieldMask,t,this.fieldTransforms):new iZ(e,this.data,t,this.fieldTransforms)}}class aG{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return new iY(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function aW(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw nG()}}class aH{constructor(e,t,n,r,i,o){this.settings=e,this.databaseId=t,this.serializer=n,this.ignoreUndefinedProperties=r,void 0===i&&this.Jc(),this.fieldTransforms=i||[],this.fieldMask=o||[]}get path(){return this.settings.path}get Yc(){return this.settings.Yc}Zc(e){return new aH(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Xc(e){var t;let n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.Zc({path:n,ta:!1});return r.ea(e),r}na(e){var t;let n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.Zc({path:n,ta:!1});return r.Jc(),r}sa(e){return this.Zc({path:void 0,ta:!0})}ia(e){return a7(e,this.settings.methodName,this.settings.ra||!1,this.path,this.settings.oa)}contains(e){return void 0!==this.fieldMask.find(t=>e.isPrefixOf(t))||void 0!==this.fieldTransforms.find(t=>e.isPrefixOf(t.field))}Jc(){if(this.path)for(let e=0;e<this.path.length;e++)this.ea(this.path.get(e))}ea(e){if(0===e.length)throw this.ia("Document fields must not be empty");if(aW(this.Yc)&&az.test(e))throw this.ia('Document fields cannot begin and end with "__"')}}class aK{constructor(e,t,n){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=n||si(e)}ua(e,t,n,r=!1){return new aH({Yc:e,methodName:t,oa:n,path:rt.emptyPath(),ta:!1,ra:r},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function aJ(e){let t=e._freezeSettings(),n=si(e._databaseId);return new aK(e._databaseId,!!t.ignoreUndefinedProperties,n)}function aX(e,t,n,r,i,o={}){let s,a;let u=e.ua(o.merge||o.mergeFields?2:0,t,n,i);a5("Data must be an object, but it was:",u,r);let l=a3(r,u);if(o.merge)s=new r_(u.fieldMask),a=u.fieldTransforms;else if(o.mergeFields){let e=[];for(let r of o.mergeFields){let i=a6(t,r,n);if(!u.contains(i))throw new nH(nW.INVALID_ARGUMENT,`Field '${i}' is specified in your field mask but missing from your input data.`);ue(e,i)||e.push(i)}s=new r_(e),a=u.fieldTransforms.filter(e=>s.covers(e.field))}else s=null,a=u.fieldTransforms;return new aV(new rG(l),s,a)}class aQ extends a${_toFieldTransform(e){if(2!==e.Yc)throw 1===e.Yc?e.ia(`${this._methodName}() can only appear at the top level of your update data`):e.ia(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof aQ}}function aZ(e,t,n){return new aH({Yc:3,oa:t.settings.oa,methodName:e._methodName,ta:n},t.databaseId,t.serializer,t.ignoreUndefinedProperties)}class aY extends a${_toFieldTransform(e){return new iV(e.path,new iL)}isEqual(e){return e instanceof aY}}class a0 extends a${constructor(e,t){super(e),this.ca=t}_toFieldTransform(e){let t=aZ(this,e,!0),n=new iU(this.ca.map(e=>a2(e,t)));return new iV(e.path,n)}isEqual(e){return this===e}}class a1 extends a${constructor(e,t){super(e),this.ca=t}_toFieldTransform(e){let t=aZ(this,e,!0),n=new iq(this.ca.map(e=>a2(e,t)));return new iV(e.path,n)}isEqual(e){return this===e}}function a2(e,t){if(a4(e=(0,p.m9)(e)))return a5("Unsupported field value:",t,e),a3(e,t);if(e instanceof a$)return function(e,t){if(!aW(t.Yc))throw t.ia(`${e._methodName}() can only be used with update() and set()`);if(!t.path)throw t.ia(`${e._methodName}() is not currently supported inside arrays`);let n=e._toFieldTransform(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.ta&&4!==t.Yc)throw t.ia("Nested arrays are not supported");return function(e,t){let n=[],r=0;for(let i of e){let e=a2(i,t.sa(r));null==e&&(e={nullValue:"NULL_VALUE"}),n.push(e),r++}return{arrayValue:{values:n}}}(e,t)}return function(e,t){if(null===(e=(0,p.m9)(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e){var n,r,i;return n=t.serializer,"number"==typeof(i=r=e)&&Number.isInteger(i)&&!rc(i)&&i<=Number.MAX_SAFE_INTEGER&&i>=Number.MIN_SAFE_INTEGER?iD(r):iR(n,r)}if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){let n=n6.fromDate(e);return{timestampValue:og(t.serializer,n)}}if(e instanceof n6){let n=new n6(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:og(t.serializer,n)}}if(e instanceof aB)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof aq)return{bytesValue:om(t.serializer,e._byteString)};if(e instanceof aC){let n=t.databaseId,r=e.firestore._databaseId;if(!r.isEqual(n))throw t.ia(`Document reference is for database ${r.projectId}/${r.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:ov(e.firestore._databaseId||t.databaseId,e._key.path)}}throw t.ia(`Unsupported field value: ${aE(e)}`)}(e,t)}function a3(e,t){let n={};return rf(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):rh(e,(e,r)=>{let i=a2(r,t.Xc(e));null!=i&&(n[e]=i)}),{mapValue:{fields:n}}}function a4(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof n6||e instanceof aB||e instanceof aq||e instanceof aC||e instanceof a$)}function a5(e,t,n){if(!a4(n)||!("object"==typeof n&&null!==n&&(Object.getPrototypeOf(n)===Object.prototype||null===Object.getPrototypeOf(n)))){let r=aE(n);throw"an object"===r?t.ia(e+" a custom object"):t.ia(e+" "+r)}}function a6(e,t,n){if((t=(0,p.m9)(t))instanceof aF)return t._internalPath;if("string"==typeof t)return a8(e,t);throw a7("Field path arguments must be of type string or ",e,!1,void 0,n)}let a9=RegExp("[~\\*/\\[\\]]");function a8(e,t,n){if(t.search(a9)>=0)throw a7(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e,!1,void 0,n);try{return new aF(...t.split("."))._internalPath}catch(r){throw a7(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e,!1,void 0,n)}}function a7(e,t,n,r,i){let o=r&&!r.isEmpty(),s=void 0!==i,a=`Function ${t}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let u="";return(o||s)&&(u+=" (found",o&&(u+=` in field ${r}`),s&&(u+=` in document ${i}`),u+=")"),new nH(nW.INVALID_ARGUMENT,a+e+u)}function ue(e,t){return e.some(e=>e.isEqual(t))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class ut{constructor(e,t,n,r,i){this._firestore=e,this._userDataWriter=t,this._key=n,this._document=r,this._converter=i}get id(){return this._key.path.lastSegment()}get ref(){return new aC(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){let e=new un(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){let t=this._document.data.field(ur("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class un extends ut{data(){return super.data()}}function ur(e,t){return"string"==typeof t?a8(e,t):t instanceof aF?t._internalPath:t._delegate._internalPath}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function ui(e){if("L"===e.limitType&&0===e.explicitOrderBy.length)throw new nH(nW.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class uo{}class us extends uo{}function ua(e,t,...n){let r=[];for(let i of(t instanceof uo&&r.push(t),function(e){let t=e.filter(e=>e instanceof uc).length,n=e.filter(e=>e instanceof uu).length;if(t>1||t>0&&n>0)throw new nH(nW.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(r=r.concat(n)),r))e=i._apply(e);return e}class uu extends us{constructor(e,t,n){super(),this._field=e,this._op=t,this._value=n,this.type="where"}static _create(e,t,n){return new uu(e,t,n)}_apply(e){let t=this._parse(e);return uf(e._query,t),new aA(e.firestore,e.converter,ig(e._query,t))}_parse(e){let t=aJ(e.firestore);return function(e,t,n,r,i,o,s){let a;if(i.isKeyField()){if("array-contains"===o||"array-contains-any"===o)throw new nH(nW.INVALID_ARGUMENT,`Invalid Query. You can't perform '${o}' queries on documentId().`);if("in"===o||"not-in"===o){uh(s,o);let t=[];for(let n of s)t.push(ud(r,e,n));a={arrayValue:{values:t}}}else a=ud(r,e,s)}else"in"!==o&&"not-in"!==o&&"array-contains-any"!==o||uh(s,o),a=function(e,t,n,r=!1){return a2(n,e.ua(r?4:3,t))}(n,t,s,"in"===o||"not-in"===o);return rZ.create(i,o,a)}(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value)}}function ul(e,t,n){let r=ur("where",e);return uu._create(r,t,n)}class uc extends uo{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new uc(e,t)}_parse(e){let t=this._queryConstraints.map(t=>t._parse(e)).filter(e=>e.getFilters().length>0);return 1===t.length?t[0]:rY.create(t,this._getOperator())}_apply(e){let t=this._parse(e);return 0===t.getFilters().length?e:(function(e,t){let n=e;for(let e of t.getFlattenedFilters())uf(n,e),n=ig(n,e)}(e._query,t),new aA(e.firestore,e.converter,ig(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return"and"===this.type?"and":"or"}}function ud(e,t,n){if("string"==typeof(n=(0,p.m9)(n))){if(""===n)throw new nH(nW.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!id(t)&&-1!==n.indexOf("/"))throw new nH(nW.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);let r=t.path.child(n7.fromString(n));if(!rn.isDocumentKey(r))throw new nH(nW.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return rU(e,new rn(r))}if(n instanceof aC)return rU(e,n._key);throw new nH(nW.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${aE(n)}.`)}function uh(e,t){if(!Array.isArray(e)||0===e.length)throw new nH(nW.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${t.toString()}' filters.`)}function uf(e,t){if(t.isInequality()){let n=ic(e),r=t.field;if(null!==n&&!n.isEqual(r))throw new nH(nW.INVALID_ARGUMENT,`Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${r.toString()}'`);let i=il(e);null!==i&&function(e,t,n){if(!n.isEqual(t))throw new nH(nW.INVALID_ARGUMENT,`Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${t.toString()}' and so you must also use '${t.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`)}(0,r,i)}let n=function(e,t){for(let n of e)for(let e of n.getFlattenedFilters())if(t.indexOf(e.op)>=0)return e.op;return null}(e.filters,function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==n)throw n===t.op?new nH(nW.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${t.op.toString()}' filter.`):new nH(nW.INVALID_ARGUMENT,`Invalid query. You cannot use '${t.op.toString()}' filters with '${n.toString()}' filters.`)}class up{convertValue(e,t="none"){switch(rN(e)){case 0:return null;case 1:return e.booleanValue;case 2:return rk(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(rI(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 10:return this.convertObject(e.mapValue,t);default:throw nG()}}convertObject(e,t){let n={};return rh(e.fields,(e,r)=>{n[e]=this.convertValue(r,t)}),n}convertGeoPoint(e){return new aB(rk(e.latitude),rk(e.longitude))}convertArray(e,t){return(e.values||[]).map(e=>this.convertValue(e,t))}convertServerTimestamp(e,t){switch(t){case"previous":let n=function e(t){let n=t.mapValue.fields.__previous_value__;return rT(n)?e(n):n}(e);return null==n?null:this.convertValue(n,t);case"estimate":return this.convertTimestamp(rx(e));default:return null}}convertTimestamp(e){let t=rE(e);return new n6(t.seconds,t.nanos)}convertDocumentKey(e,t){let n=n7.fromString(e);oC(n)||nG();let r=new rA(n.get(1),n.get(3)),i=new rn(n.popFirst(5));return r.isEqual(t)||nB(`Document ${i} contains a document reference within a different database (${r.projectId}/${r.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),i}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function ug(e,t,n){return e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class um{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class uy extends ut{constructor(e,t,n,r,i,o){super(e,t,n,r,o),this._firestore=e,this._firestoreImpl=e,this.metadata=i}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){let t=new uv(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){let n=this._document.data.field(ur("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}}class uv extends uy{data(e={}){return super.data(e)}}class u_{constructor(e,t,n,r){this._firestore=e,this._userDataWriter=t,this._snapshot=r,this.metadata=new um(r.hasPendingWrites,r.fromCache),this.query=n}get docs(){let e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach(n=>{e.call(t,new uv(this._firestore,this._userDataWriter,n.key,n,new um(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){let t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new nH(nW.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){let t=0;return e._snapshot.docChanges.map(n=>{let r=new uv(e._firestore,e._userDataWriter,n.doc.key,n.doc,new um(e._snapshot.mutatedKeys.has(n.doc.key),e._snapshot.fromCache),e.query.converter);return n.doc,{type:"added",doc:r,oldIndex:-1,newIndex:t++}})}{let n=e._snapshot.oldDocs;return e._snapshot.docChanges.filter(e=>t||3!==e.type).map(t=>{let r=new uv(e._firestore,e._userDataWriter,t.doc.key,t.doc,new um(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter),i=-1,o=-1;return 0!==t.type&&(i=n.indexOf(t.doc.key),n=n.delete(t.doc.key)),1!==t.type&&(o=(n=n.add(t.doc)).indexOf(t.doc.key)),{type:function(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return nG()}}(t.type),doc:r,oldIndex:i,newIndex:o}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function ub(e){e=ak(e,aC);let t=ak(e.firestore,aM);return(function(e,t,n={}){let r=new nK;return e.asyncQueue.enqueueAndForget(async()=>(function(e,t,n,r,i){let o=new ah({next:o=>{t.enqueueAndForget(()=>sG(e,s));let a=o.docs.has(n);!a&&o.fromCache?i.reject(new nH(nW.UNAVAILABLE,"Failed to get document because the client is offline.")):a&&o.fromCache&&r&&"server"===r.source?i.reject(new nH(nW.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):i.resolve(o)},error:e=>i.reject(e)}),s=new sJ(ia(n.path),o,{includeMetadataChanges:!0,xu:!0});return sV(e,s)})(await av(e),e.asyncQueue,t,n,r)),r.promise})(aU(t),e._key).then(n=>uA(t,e,n))}class uw extends up{constructor(e){super(),this.firestore=e}convertBytes(e){return new aq(e)}convertReference(e){let t=this.convertDocumentKey(e,this.firestore._databaseId);return new aC(this.firestore,null,t)}}function uS(e){e=ak(e,aA);let t=ak(e.firestore,aM),n=aU(t),r=new uw(t);return ui(e._query),(function(e,t,n={}){let r=new nK;return e.asyncQueue.enqueueAndForget(async()=>(function(e,t,n,r,i){let o=new sJ(n,new ah({next:n=>{t.enqueueAndForget(()=>sG(e,o)),n.fromCache&&"server"===r.source?i.reject(new nH(nW.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):i.resolve(n)},error:e=>i.reject(e)}),{includeMetadataChanges:!0,xu:!0});return sV(e,o)})(await av(e),e.asyncQueue,t,n,r)),r.promise})(n,e._query).then(n=>new u_(t,r,e,n))}function uE(e,t,n){e=ak(e,aC);let r=ak(e.firestore,aM),i=ug(e.converter,t,n);return uC(r,[aX(aJ(r),"setDoc",e._key,i,null!==e.converter,n).toMutation(e._key,iW.none())])}function uk(e,t,n,...r){e=ak(e,aC);let i=ak(e.firestore,aM),o=aJ(i);return uC(i,[("string"==typeof(t=(0,p.m9)(t))||t instanceof aF?function(e,t,n,r,i,o){let s=e.ua(1,t,n),a=[a6(t,r,n)],u=[i];if(o.length%2!=0)throw new nH(nW.INVALID_ARGUMENT,`Function ${t}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let e=0;e<o.length;e+=2)a.push(a6(t,o[e])),u.push(o[e+1]);let l=[],c=rG.empty();for(let e=a.length-1;e>=0;--e)if(!ue(l,a[e])){let t=a[e],n=u[e];n=(0,p.m9)(n);let r=s.na(t);if(n instanceof aQ)l.push(t);else{let e=a2(n,r);null!=e&&(l.push(t),c.set(t,e))}}return new aG(c,new r_(l),s.fieldTransforms)}(o,"updateDoc",e._key,t,n,r):function(e,t,n,r){let i=e.ua(1,t,n);a5("Data must be an object, but it was:",i,r);let o=[],s=rG.empty();return rh(r,(e,r)=>{let a=a8(t,e,n);r=(0,p.m9)(r);let u=i.na(a);if(r instanceof aQ)o.push(a);else{let e=a2(r,u);null!=e&&(o.push(a),s.set(a,e))}}),new aG(s,new r_(o),i.fieldTransforms)}(o,"updateDoc",e._key,t)).toMutation(e._key,iW.exists(!0))])}function uI(e){return uC(ak(e.firestore,aM),[new i3(e._key,iW.none())])}function uT(e,t){let n=ak(e.firestore,aM),r=aR(e),i=ug(e.converter,t);return uC(n,[aX(aJ(e.firestore),"addDoc",r._key,i,null!==e.converter,{}).toMutation(r._key,iW.exists(!1))]).then(()=>r)}function ux(e,...t){var n,r,i;let o,s,a;e=(0,p.m9)(e);let u={includeMetadataChanges:!1},l=0;"object"!=typeof t[0]||aP(t[l])||(u=t[l],l++);let c={includeMetadataChanges:u.includeMetadataChanges};if(aP(t[l])){let e=t[l];t[l]=null===(n=e.next)||void 0===n?void 0:n.bind(e),t[l+1]=null===(r=e.error)||void 0===r?void 0:r.bind(e),t[l+2]=null===(i=e.complete)||void 0===i?void 0:i.bind(e)}if(e instanceof aC)s=ak(e.firestore,aM),a=ia(e._key.path),o={next:n=>{t[l]&&t[l](uA(s,e,n))},error:t[l+1],complete:t[l+2]};else{let n=ak(e,aA);s=ak(n.firestore,aM),a=n._query;let r=new uw(s);o={next:e=>{t[l]&&t[l](new u_(s,r,n,e))},error:t[l+1],complete:t[l+2]},ui(e._query)}return function(e,t,n,r){let i=new ah(r),o=new sJ(t,i,n);return e.asyncQueue.enqueueAndForget(async()=>sV(await av(e),o)),()=>{i.yc(),e.asyncQueue.enqueueAndForget(async()=>sG(await av(e),o))}}(aU(s),a,c,o)}function uC(e,t){return function(e,t){let n=new nK;return e.asyncQueue.enqueueAndForget(async()=>s5(await ay(e).then(e=>e.syncEngine),t,n)),n.promise}(aU(e),t)}function uA(e,t,n){let r=n.docs.get(t._key),i=new uw(e);return new uy(e,i,t._key,r,new um(n.hasPendingWrites,n.fromCache),t.converter)}function uO(){return new aY("serverTimestamp")}function uN(...e){return new a0("arrayUnion",e)}function uR(...e){return new a1("arrayRemove",e)}!function(e,t=!0){nj=d.Jn,(0,d.Xd)(new h.wA("firestore",(e,{instanceIdentifier:n,options:r})=>{let i=e.getProvider("app").getImmediate(),o=new aM(new nZ(e.getProvider("auth-internal")),new n2(e.getProvider("app-check-internal")),function(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new nH(nW.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new rA(e.options.projectId,t)}(i,n),i);return r=Object.assign({useFetchStreams:t},r),o._setSettings(r),o},"PUBLIC").setMultipleInstances(!0)),(0,d.KN)(nL,"3.10.0",void 0),(0,d.KN)(nL,"3.10.0","esm2017")}()},86650:function(e,t,n){"use strict";n.d(t,{a1:function(){return x},cF:function(){return T}});var r,i,o,s,a=n(32238),u=n(74444),l=n(8463);/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let c="firebasestorage.googleapis.com";/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class d extends u.ZR{constructor(e,t,n=0){super(h(e),`Firebase Storage: ${t} (${h(e)})`),this.status_=n,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,d.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return h(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
${this.customData.serverResponse}`:this.message=this._baseMessage}}function h(e){return"storage/"+e}function f(e){return new d(o.INVALID_ARGUMENT,e)}function p(){return new d(o.APP_DELETED,"The Firebase app was deleted.")}(r=o||(o={})).UNKNOWN="unknown",r.OBJECT_NOT_FOUND="object-not-found",r.BUCKET_NOT_FOUND="bucket-not-found",r.PROJECT_NOT_FOUND="project-not-found",r.QUOTA_EXCEEDED="quota-exceeded",r.UNAUTHENTICATED="unauthenticated",r.UNAUTHORIZED="unauthorized",r.UNAUTHORIZED_APP="unauthorized-app",r.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",r.INVALID_CHECKSUM="invalid-checksum",r.CANCELED="canceled",r.INVALID_EVENT_NAME="invalid-event-name",r.INVALID_URL="invalid-url",r.INVALID_DEFAULT_BUCKET="invalid-default-bucket",r.NO_DEFAULT_BUCKET="no-default-bucket",r.CANNOT_SLICE_BLOB="cannot-slice-blob",r.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",r.NO_DOWNLOAD_URL="no-download-url",r.INVALID_ARGUMENT="invalid-argument",r.INVALID_ARGUMENT_COUNT="invalid-argument-count",r.APP_DELETED="app-deleted",r.INVALID_ROOT_OPERATION="invalid-root-operation",r.INVALID_FORMAT="invalid-format",r.INTERNAL_ERROR="internal-error",r.UNSUPPORTED_ENVIRONMENT="unsupported-environment";/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class g{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){let e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,t){let n;try{n=g.makeFromUrl(e,t)}catch(t){return new g(e,"")}if(""===n.path)return n;throw new d(o.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+e+"'.")}static makeFromUrl(e,t){let n=null,r="([A-Za-z0-9.\\-_]+)",i=RegExp("^gs://"+r+"(/(.*))?$","i");function s(e){e.path_=decodeURIComponent(e.path)}let a=t.replace(/[.]/g,"\\."),u=[{regex:i,indices:{bucket:1,path:3},postModify:function(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}},{regex:RegExp(`^https?://${a}/v[A-Za-z0-9_]+/b/${r}/o(/([^?#]*).*)?$`,"i"),indices:{bucket:1,path:3},postModify:s},{regex:RegExp(`^https?://${t===c?"(?:storage.googleapis.com|storage.cloud.google.com)":t}/${r}/([^?#]*)`,"i"),indices:{bucket:1,path:2},postModify:s}];for(let t=0;t<u.length;t++){let r=u[t],i=r.regex.exec(e);if(i){let e=i[r.indices.bucket],t=i[r.indices.path];t||(t=""),n=new g(e,t),r.postModify(n);break}}if(null==n)throw new d(o.INVALID_URL,"Invalid URL '"+e+"'.");return n}}class m{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}function y(e,t,n,r){if(r<t)throw f(`Invalid value for '${e}'. Expected ${t} or greater.`);if(r>n)throw f(`Invalid value for '${e}'. Expected ${n} or less.`)}(i=s||(s={}))[i.NO_ERROR=0]="NO_ERROR",i[i.NETWORK_ERROR=1]="NETWORK_ERROR",i[i.ABORT=2]="ABORT";/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class v{constructor(e,t,n,r,i,o,s,a,u,l,c,d=!0){this.url_=e,this.method_=t,this.headers_=n,this.body_=r,this.successCodes_=i,this.additionalRetryCodes_=o,this.callback_=s,this.errorCallback_=a,this.timeout_=u,this.progressCallback_=l,this.connectionFactory_=c,this.retry=d,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((e,t)=>{this.resolve_=e,this.reject_=t,this.start_()})}start_(){let e=(e,t)=>{let n=this.resolve_,r=this.reject_,i=t.connection;if(t.wasSuccessCode)try{let e=this.callback_(i,i.getResponse());void 0!==e?n(e):n()}catch(e){r(e)}else if(null!==i){let e=new d(o.UNKNOWN,"An unknown error occurred, please check the error payload for server response.");e.serverResponse=i.getErrorText(),r(this.errorCallback_?this.errorCallback_(i,e):e)}else r(t.canceled?this.appDelete_?p():new d(o.CANCELED,"User canceled the upload/download."):new d(o.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again."))};this.canceled_?e(!1,new _(!1,null,!0)):this.backoffId_=/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e,t,n){let r=1,i=null,o=null,s=!1,a=0,u=!1;function l(...e){u||(u=!0,t.apply(null,e))}function c(t){i=setTimeout(()=>{i=null,e(h,2===a)},t)}function d(){o&&clearTimeout(o)}function h(e,...t){let n;if(u){d();return}if(e||2===a||s){d(),l.call(null,e,...t);return}r<64&&(r*=2),1===a?(a=2,n=0):n=(r+Math.random())*1e3,c(n)}let f=!1;function p(e){!f&&(f=!0,d(),!u&&(null!==i?(e||(a=2),clearTimeout(i),c(0)):e||(a=1)))}return c(0),o=setTimeout(()=>{s=!0,p(!0)},n),p}((e,t)=>{if(t){e(!1,new _(!1,null,!0));return}let n=this.connectionFactory_();this.pendingConnection_=n;let r=e=>{let t=e.loaded,n=e.lengthComputable?e.total:-1;null!==this.progressCallback_&&this.progressCallback_(t,n)};null!==this.progressCallback_&&n.addUploadProgressListener(r),n.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&n.removeUploadProgressListener(r),this.pendingConnection_=null;let t=n.getErrorCode()===s.NO_ERROR,i=n.getStatus();if(!t||/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e,t){let n=e>=500&&e<600,r=-1!==[408,429].indexOf(e),i=-1!==t.indexOf(e);return n||r||i}(i,this.additionalRetryCodes_)&&this.retry){e(!1,new _(!1,null,n.getErrorCode()===s.ABORT));return}e(!0,new _(-1!==this.successCodes_.indexOf(i),n))})},e,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingConnection_&&this.pendingConnection_.abort()}}class _{constructor(e,t,n){this.wasSuccessCode=e,this.connection=t,this.canceled=!!n}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */class b{constructor(e,t){this._service=e,t instanceof g?this._location=t:this._location=g.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new b(e,t)}get root(){let e=new g(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return function(e){let t=e.lastIndexOf("/",e.length-2);return -1===t?e:e.slice(t+1)}(this._location.path)}get storage(){return this._service}get parent(){let e=/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(e){if(0===e.length)return null;let t=e.lastIndexOf("/");return -1===t?"":e.slice(0,t)}(this._location.path);if(null===e)return null;let t=new g(this._location.bucket,e);return new b(this._service,t)}_throwIfRoot(e){if(""===this._location.path)throw new d(o.INVALID_ROOT_OPERATION,"The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}}function w(e,t){let n=null==t?void 0:t.storageBucket;return null==n?null:g.makeFromBucketSpec(n,e)}class S{constructor(e,t,n,r,i){this.app=e,this._authProvider=t,this._appCheckProvider=n,this._url=r,this._firebaseVersion=i,this._bucket=null,this._host=c,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,null!=r?this._bucket=g.makeFromBucketSpec(r,this._host):this._bucket=w(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,null!=this._url?this._bucket=g.makeFromBucketSpec(this._url,e):this._bucket=w(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){y("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){y("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;let e=this._authProvider.getImmediate({optional:!0});if(e){let t=await e.getToken();if(null!==t)return t.accessToken}return null}async _getAppCheckToken(){let e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new b(this,e)}_makeRequest(e,t,n,r,i=!0){if(this._deleted)return new m(p());{let o=function(e,t,n,r,i,o,s=!0){let a=function(e){let t=encodeURIComponent,n="?";for(let r in e)e.hasOwnProperty(r)&&(n=n+(t(r)+"=")+t(e[r])+"&");return n.slice(0,-1)}(e.urlParams),u=e.url+a,l=Object.assign({},e.headers);return t&&(l["X-Firebase-GMPID"]=t),null!==n&&n.length>0&&(l.Authorization="Firebase "+n),l["X-Firebase-Storage-Version"]="webjs/"+(null!=o?o:"AppManager"),null!==r&&(l["X-Firebase-AppCheck"]=r),new v(u,e.method,l,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,i,s)}(e,this._appId,n,r,t,this._firebaseVersion,i);return this._requests.add(o),o.getPromise().then(()=>this._requests.delete(o),()=>this._requests.delete(o)),o}}async makeRequestWithTokens(e,t){let[n,r]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,n,r).getPromise()}}let E="@firebase/storage",k="0.11.2",I="storage";function T(e=(0,a.Mq)(),t){e=(0,u.m9)(e);let n=(0,a.qX)(e,I).getImmediate({identifier:t}),r=(0,u.P0)("storage");return r&&x(n,...r),n}function x(e,t,n,r={}){!function(e,t,n,r={}){e.host=`${t}:${n}`,e._protocol="http";let{mockUserToken:i}=r;i&&(e._overrideAuthToken="string"==typeof i?i:(0,u.Sg)(i,e.app.options.projectId))}(e,t,n,r)}(0,a.Xd)(new l.wA(I,function(e,{instanceIdentifier:t}){return new S(e.getProvider("app").getImmediate(),e.getProvider("auth-internal"),e.getProvider("app-check-internal"),t,a.Jn)},"PUBLIC").setMultipleInstances(!0)),(0,a.KN)(E,k,""),(0,a.KN)(E,k,"esm2017")},26531:function(e,t,n){"use strict";var r;let i,o;n.d(t,{X3:function(){return g}});let s=(e,t)=>t.some(t=>e instanceof t),a=new WeakMap,u=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,h={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return u.get(e);if("objectStoreNames"===t)return e.objectStoreNames||l.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return f(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function f(e){var t;if(e instanceof IDBRequest)return function(e){let t=new Promise((t,n)=>{let r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(f(e.result)),r()},o=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",o)});return t.then(t=>{t instanceof IDBCursor&&a.set(t,e)}).catch(()=>{}),d.set(t,e),t}(e);if(c.has(e))return c.get(e);let n="function"==typeof(t=e)?t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(o||(o=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(p(this),e),f(a.get(this))}:function(...e){return f(t.apply(p(this),e))}:function(e,...n){let r=t.call(p(this),e,...n);return l.set(r,e.sort?e.sort():[e]),f(r)}:(t instanceof IDBTransaction&&function(e){if(u.has(e))return;let t=new Promise((t,n)=>{let r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),r()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)});u.set(e,t)}(t),s(t,i||(i=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(t,h):t;return n!==e&&(c.set(e,n),d.set(n,e)),n}let p=e=>d.get(e);function g(e,t,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){let s=indexedDB.open(e,t),a=f(s);return r&&s.addEventListener("upgradeneeded",e=>{r(f(s.result),e.oldVersion,e.newVersion,f(s.transaction))}),n&&s.addEventListener("blocked",()=>n()),a.then(e=>{o&&e.addEventListener("close",()=>o()),i&&e.addEventListener("versionchange",()=>i())}).catch(()=>{}),a}let m=["get","getKey","getAll","getAllKeys","count"],y=["put","add","delete","clear"],v=new Map;function _(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(v.get(t))return v.get(t);let n=t.replace(/FromIndex$/,""),r=t!==n,i=y.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||m.includes(n)))return;let o=async function(e,...t){let o=this.transaction(e,i?"readwrite":"readonly"),s=o.store;return r&&(s=s.index(t.shift())),(await Promise.all([s[n](...t),i&&o.done]))[0]};return v.set(t,o),o}h={...r=h,get:(e,t,n)=>_(e,t)||r.get(e,t,n),has:(e,t)=>!!_(e,t)||r.has(e,t)}},45007:function(e,t,n){"use strict";n.d(t,{I0:function(){return v},v9:function(){return h},zt:function(){return g}});var r=n(67294),i=n(31103),o=Symbol.for("react-redux-context"),s="undefined"!=typeof globalThis?globalThis:{},a=function(){if(!r.createContext)return{};let e=s[o]??(s[o]=new Map),t=e.get(r.createContext);return t||(t=r.createContext(null),e.set(r.createContext,t)),t}();function u(e=a){return function(){return r.useContext(e)}}var l=u(),c=()=>{throw Error("uSES not initialized!")},d=(e,t)=>e===t,h=function(e=a){let t=e===a?l:u(e),n=(e,n={})=>{let{equalityFn:i=d,devModeChecks:o={}}="function"==typeof n?{equalityFn:n}:n,{store:s,subscription:a,getServerState:u,stabilityCheck:l,identityFunctionCheck:h}=t();r.useRef(!0);let f=r.useCallback({[e.name]:t=>e(t)}[e.name],[e,l,o.stabilityCheck]),p=c(a.addNestedSub,s.getState,u||s.getState,f,i);return r.useDebugValue(p),p};return Object.assign(n,{withTypes:()=>n}),n}();Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen"),Symbol.for("react.client.reference");var f={notify(){},get:()=>[]},p="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect,g=function({store:e,context:t,children:n,serverState:i,stabilityCheck:o="once",identityFunctionCheck:s="once"}){let u=r.useMemo(()=>{let t=function(e,t){let n;let r=f,i=0,o=!1;function s(){l.onStateChange&&l.onStateChange()}function a(){if(i++,!n){let i,o;n=t?t.addNestedSub(s):e.subscribe(s),i=null,o=null,r={clear(){i=null,o=null},notify(){(()=>{let e=i;for(;e;)e.callback(),e=e.next})()},get(){let e=[],t=i;for(;t;)e.push(t),t=t.next;return e},subscribe(e){let t=!0,n=o={callback:e,next:null,prev:o};return n.prev?n.prev.next=n:i=n,function(){t&&null!==i&&(t=!1,n.next?n.next.prev=n.prev:o=n.prev,n.prev?n.prev.next=n.next:i=n.next)}}}}}function u(){i--,n&&0===i&&(n(),n=void 0,r.clear(),r=f)}let l={addNestedSub:function(e){a();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),u())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:s,isSubscribed:function(){return o},trySubscribe:function(){o||(o=!0,a())},tryUnsubscribe:function(){o&&(o=!1,u())},getListeners:()=>r};return l}(e);return{store:e,subscription:t,getServerState:i?()=>i:void 0,stabilityCheck:o,identityFunctionCheck:s}},[e,i,o,s]),l=r.useMemo(()=>e.getState(),[e]);return p(()=>{let{subscription:t}=u;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),l!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}},[u,l]),r.createElement((t||a).Provider,{value:u},n)};function m(e=a){let t=e===a?l:u(e),n=()=>{let{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var y=m(),v=function(e=a){let t=e===a?y:m(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}();c=i.useSyncExternalStoreWithSelector,r.useSyncExternalStore},19119:function(e,t,n){"use strict";n.d(t,{P1:function(){return E},dX:function(){return i},kO:function(){return w},wN:function(){return S},zB:function(){return k}});var r={inputStabilityCheck:"once",identityFunctionCheck:"once"},i=e=>{Object.assign(r,e)},o=e=>Array.isArray(e)?e:[e],s=0,a=class{revision=s;_value;_lastValue;_isEqual=u;constructor(e,t=u){this._value=this._lastValue=e,this._isEqual=t}get value(){return this._value}set value(e){this.value!==e&&(this._value=e,this.revision=++s)}};function u(e,t){return e===t}function l(e){return e instanceof a||console.warn("Not a valid cell! ",e),e.value}var c=(e,t)=>!1;function d(){return function(e,t=u){return new a(null,t)}(0,c)}var h=e=>{let t=e.collectionTag;null===t&&(t=e.collectionTag=d()),l(t)};Symbol();var f=0,p=Object.getPrototypeOf({}),g=class{constructor(e){this.value=e,this.value=e,this.tag.value=e}proxy=new Proxy(this,m);tag=d();tags={};children={};collectionTag=null;id=f++},m={get:(e,t)=>(function(){let{value:n}=e,r=Reflect.get(n,t);if("symbol"==typeof t||t in p)return r;if("object"==typeof r&&null!==r){let n=e.children[t];return void 0===n&&(n=e.children[t]=Array.isArray(r)?new y(r):new g(r)),n.tag&&l(n.tag),n.proxy}{let n=e.tags[t];return void 0===n&&((n=e.tags[t]=d()).value=r),l(n),r}})(),ownKeys:e=>(h(e),Reflect.ownKeys(e.value)),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e.value,t),has:(e,t)=>Reflect.has(e.value,t)},y=class{constructor(e){this.value=e,this.value=e,this.tag.value=e}proxy=new Proxy([this],v);tag=d();tags={};children={};collectionTag=null;id=f++},v={get:([e],t)=>("length"===t&&h(e),m.get(e,t)),ownKeys:([e])=>m.ownKeys(e),getOwnPropertyDescriptor:([e],t)=>m.getOwnPropertyDescriptor(e,t),has:([e],t)=>m.has(e,t)},_="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function b(){return{s:0,v:void 0,o:null,p:null}}function w(e,t={}){let n,r=b(),{resultEqualityCheck:i}=t,o=0;function s(){let t,s=r,{length:a}=arguments;for(let e=0;e<a;e++){let t=arguments[e];if("function"==typeof t||"object"==typeof t&&null!==t){let e=s.o;null===e&&(s.o=e=new WeakMap);let n=e.get(t);void 0===n?(s=b(),e.set(t,s)):s=n}else{let e=s.p;null===e&&(s.p=e=new Map);let n=e.get(t);void 0===n?(s=b(),e.set(t,s)):s=n}}let u=s;if(1===s.s?t=s.v:(t=e.apply(null,arguments),o++),u.s=1,i){let e=n?.deref?.()??n;null!=e&&i(e,t)&&(t=e,0!==o&&o--),n="object"==typeof t&&null!==t||"function"==typeof t?new _(t):t}return u.v=t,t}return s.clearCache=()=>{r=b(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function S(e,...t){let n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,i=0,s={},a=e.pop();"object"==typeof a&&(s=a,a=e.pop()),function(e,t=`expected a function, instead received ${typeof e}`){if("function"!=typeof e)throw TypeError(t)}(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);let{memoize:u,memoizeOptions:l=[],argsMemoize:c=w,argsMemoizeOptions:d=[],devModeChecks:h={}}={...n,...s},f=o(l),p=o(d),g=function(e){let t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){let n=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),m=u(function(){return r++,a.apply(null,arguments)},...f);return Object.assign(c(function(){i++;let e=function(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}(g,arguments);return t=m.apply(null,e)},...p),{resultFunc:a,memoizedResultFunc:m,dependencies:g,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:u,argsMemoize:c})};return Object.assign(r,{withTypes:()=>r}),r}var E=S(w),k=Object.assign((e,t=E)=>{!function(e,t=`expected an object, instead received ${typeof e}`){if("object"!=typeof e)throw TypeError(t)}(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>k})}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[9774,179],function(){return t(35432),t(6840),t(53719)}),_N_E=e.O()}]);