/*! For license information please see bundle.js.LICENSE.txt */ (()=>{var e={9712:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=o(n(2043)),u=a(n(6010)),c=n(5828),d=a(n(2067)),h=a(n(6377)),f=a(n(573)),p=a(n(9875)),m=a(n(6735)),g=a(n(3636)),v=a(n(9643)),y=a(n(2972)),b=a(n(3240)),w=a(n(4968)),E=a(n(7183)),_=a(n(2865)),C=a(n(8884)),S=a(n(6500)),x=a(n(1890)),T=a(n(5432)),I=a(n(9969)),k=a(n(9069)),O=a(n(400)),P=n(4007),N=a(n(4259)),A=n(1802),D=o(n(2980)),R=n(6050),M=a(n(2974)),L=a(n(5827)),j=n(1802),F=a(n(2482)),W=a(n(2910)),B=o(n(5096)),z=a(n(3814)),U=n(4031),V=a(n(9834)),Z=c.makeStyles((e=>({appBarShift:{width:`calc(100% - ${A.DRAWER_WIDTH}px)`,marginLeft:A.DRAWER_WIDTH,transition:e.transitions.create(["margin","width"],{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen})},container:{paddingLeft:"5px",paddingRight:"5px"},drawer:{width:A.DRAWER_WIDTH,flexShrink:0},drawerClose:{color:"white"},drawerPaper:{backgroundColor:P.PANEL_BACKGROUND_COLOR,width:A.DRAWER_WIDTH},drawerHeader:Object.assign(Object.assign({display:"flex",alignItems:"center",padding:e.spacing(0,1)},e.mixins.toolbar),{justifyContent:"flex-start"}),grow:{flexGrow:1},hide:{display:"none"},icons:{display:"flex"},listItem:{"&:hover":{backgroundColor:"white"}},menuButton:{marginRight:e.spacing(2)},tagTitle:{color:"white",marginLeft:"40%"}})));t.default=function(e){const t=Z(),n=P.globalStyles(),r=c.useTheme(),i=B.default.getDefaultSearchState(),o=e.appContext,a=o.getEventBus(),A=o.getCollectionStore(),[$,q]=s.useState(i),H=o.getMessagingService(),[K,G]=s.default.useState({accountDialog:!1,drawerOpen:!1,licenseDialog:!o.getSettingsStore().isLicenseAccepted(),loggedIn:!1,paymentDialog:!1,settingsDialog:!1,menuTags:A.getMenuTags()}),[Q,Y]=s.useState({messages:[]}),[X,J]=s.useState(!1),[ee,te]=s.default.useState(D.getNoErrorState()),[ne,re]=s.default.useState("");function ie(e){G(Object.assign(Object.assign({},K),{loggedIn:!0})),H.addListener(e.login,(e=>{Y({messages:e})}),(e=>{}))}function oe(e){const t=o.getSettingsStore().getLogin();H.deleteMessage(t,e),ue(!0)}function ae(){a.sendMessage({messageType:j.MessageType.HideDrawer}),G(Object.assign(Object.assign({},K),{drawerOpen:!1}))}function se(){G(Object.assign(Object.assign({},K),{paymentDialog:!1}))}function le(){G(Object.assign(Object.assign({},K),{loggedIn:!1})),H.removeListener(),Y({messages:[]})}function ue(e){const t=o.getSettingsStore().getLogin();H.getMessages(t).then((e=>{let t=e.error?[]:e.messages;Y({messages:t})})),J(e)}window.onerror=function(e,t,n,r,i){return te({column:r,error:!0,line:n,message:i.message,stackTrace:i.stack?i.stack:""}),!1},s.useEffect((()=>{function e(){const e=A.getMenuTags();0==A.getMenuTags().length&&K.drawerOpen?(G(Object.assign(Object.assign({},K),{settingsDialog:!1,menuTags:e})),ae()):G(Object.assign(Object.assign({},K),{menuTags:e}))}return a.addEventListener(j.MessageType.CollectionUpdate,e),a.addEventListener(j.MessageType.Login,ie),a.addEventListener(j.MessageType.Logout,le),()=>{a.removeEventListener(j.MessageType.CollectionUpdate,e),a.removeEventListener(j.MessageType.Login,ie),a.removeEventListener(j.MessageType.Logout,le)}}),[K]),l.setLevel(l.levels.INFO),l.debug("Application started"),$.search&&$.term.length;const ce={appContext:o,handleClose:function(){G(Object.assign(Object.assign({},K),{settingsDialog:!1}))},handleMenuTabTagChange:e=>{o.getSettingsStore().setMenuTabTags(e),o.getCollectionStore().buildTags()},handleResetLayout:()=>{o.getSettingsStore().setDefaultLayout()}};return s.default.createElement("div",{className:t.grow,id:"appBar"},s.default.createElement(h.default,{position:"sticky",className:u.default(n.appBarBgColor,{[t.appBarShift]:K.drawerOpen})},s.default.createElement(S.default,null,K.menuTags.length>0&&s.default.createElement(x.default,{color:"inherit","aria-label":"open drawer",onClick:function(){G(Object.assign(Object.assign({},K),{drawerOpen:!0})),setTimeout((()=>{a.sendMessage({messageType:j.MessageType.ShowDrawer})}),100)},edge:"start",className:t.menuButton},s.default.createElement(C.default,null)),s.default.createElement(W.default,{appContext:e.appContext,search:function(e){l.debug("Search "+e.term),a.sendMessage(new B.SearchMessage(e)),q(e)},term:$.term}),s.default.createElement("div",{className:t.grow}),s.default.createElement("div",{className:t.icons},s.default.createElement(k.default,{title:"Messages"},s.default.createElement(x.default,{color:"inherit",onClick:e=>{0==Q.messages.length?re("No messages"):J(!0),e.stopPropagation()}},s.default.createElement(f.default,{badgeContent:Q.messages.length,color:"primary"},s.default.createElement(_.default,null)))),s.default.createElement(k.default,{title:"Help"},s.default.createElement(x.default,{color:"inherit",onClick:t=>{e.appContext.getAccountService().getSystemSettings(!0).then((e=>{e.error||window.open(e.systemSettings.websiteURL+"/forgetmenot.html")})),t.stopPropagation()}},s.default.createElement(T.default,null))),s.default.createElement(k.default,{title:"Settings"},s.default.createElement(x.default,{color:"inherit",onClick:e=>{K.loggedIn&&G(Object.assign(Object.assign({},K),{settingsDialog:!0})),e.stopPropagation()}},s.default.createElement(I.default,null))),s.default.createElement(k.default,{title:"Account"},s.default.createElement(x.default,{color:"inherit",id:"accountButton",onClick:e=>{K.loggedIn&&G(Object.assign(Object.assign({},K),{accountDialog:!0})),e.stopPropagation()}},s.default.createElement(d.default,null))),s.default.createElement(k.default,{title:"Logout"},s.default.createElement(x.default,{color:"inherit",onClick:t=>{e.appContext.getEventBus().sendMessage({messageType:j.MessageType.Logout}),t.stopPropagation()}},s.default.createElement(y.default,null)))))),s.default.createElement(v.default,{className:t.drawer,variant:"persistent",anchor:"left",open:K.drawerOpen,classes:{paper:t.drawerPaper}},s.default.createElement("div",{className:u.default(n.appBarBgColor,t.drawerHeader)},s.default.createElement(O.default,{className:t.tagTitle,variant:"h6",noWrap:!0},"Tags"),s.default.createElement("div",{className:t.grow}),s.default.createElement(x.default,{onClick:ae},"ltr"===r.direction?s.default.createElement(p.default,{className:t.drawerClose}):s.default.createElement(m.default,null))),s.default.createElement(g.default,null),s.default.createElement(b.default,null,K.menuTags.map(((e,n)=>s.default.createElement(w.default,{className:t.listItem,button:!0,key:e.tag,onClick:t=>{!function(e){q(Object.assign(Object.assign({},$),{term:e.tag})),ae()}(e),t.stopPropagation()}},s.default.createElement(E.default,{primary:e.tag+" ("+e.count+")"})))))),ee.error&&s.default.createElement(D.default,Object.assign({},ee,{appContext:o,handleClose:()=>te(D.getNoErrorState())})),K.accountDialog&&s.default.createElement(N.default,{appContext:o,handleClose:function(){G(Object.assign(Object.assign({},K),{accountDialog:!1}))},handleUpgrade:function(){G(Object.assign(Object.assign({},K),{paymentDialog:!0,accountDialog:!1}))}}),K.settingsDialog&&s.default.createElement(z.default,Object.assign({},ce)),X&&s.default.createElement(L.default,{handleClose:function(){ue(!1)},handleDeleteMessage:oe,handleSaveMessage:function(e,t){o.getCollectionStore().restoreWindows([t]),oe(e)},messages:Q.messages}),K.paymentDialog&&s.default.createElement(F.default,Object.assign({},R.paymentProps,{appContext:o,handleCancel:se,handleClose:se})),""!=ne&&s.default.createElement(U.Toast,{duration:3e3,handleClose:function(){re("")},message:ne,open:!0,severity:"success",title:"Message"}),K.licenseDialog&&s.default.createElement(V.default,{appContext:o,handleAccept:function(){o.getSettingsStore().setLicenseAccepted(),G(Object.assign(Object.assign({},K),{licenseDialog:!1}))}}),!K.licenseDialog&&s.default.createElement(M.default,{appContext:o}))}},1802:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.SYSTEM_SETTINGS_COLLECTION_ID=t.SYSTEM_SETTINGS_COLLECTION=t.LIBRARY=t.FIREBASE_ERROR=t.COLLECTION_LIBRARY=t.COLLECTION_SUMMARY=t.CHROME_EXTENSION=t.ACCOUNTS_COLLECTION=t.MessageType=t.Screen=t.ONE_DAY_MS=t.DRAWER_WIDTH=t.SAVED=t.LIVE=void 0,t.LIVE="live",t.SAVED="saved",t.DRAWER_WIDTH=200,t.ONE_DAY_MS=864e5,(r=t.Screen||(t.Screen={})).Container="container",r.Header="header",(n=t.MessageType||(t.MessageType={})).CollectionUpdate="COLLECTION_UPDATE",n.HideDrawer="HIDE_DRAWER",n.ShowDrawer="SHOW_DRAWER",n.LiveWindowUpdate="WINDOW_UPDATE",n.Login="LOGIN",n.Logout="LOGOUT",n.ResetSearch="RESET_SEARCH",n.Resize="RESIZE",n.Search="SEARCH",t.ACCOUNTS_COLLECTION="Accounts",t.CHROME_EXTENSION="chrome-extension:",t.COLLECTION_SUMMARY="CollectionSummary",t.COLLECTION_LIBRARY="CollectionLibrary",t.FIREBASE_ERROR="Firebase fatal error: ",t.LIBRARY="Library",t.SYSTEM_SETTINGS_COLLECTION="SystemSettings",t.SYSTEM_SETTINGS_COLLECTION_ID="0"},1816:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(2043)),l=a(n(6729));class u{constructor(){this.eventEmitter=new l.default,u.instance=this,s.debug("EventBus started up ")}addEventListener(e,t,n){this.eventEmitter.addListener(e,t,n)}addEventListeners(e,t,n){for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MESSAGING_COLLECTION=void 0,t.MESSAGING_COLLECTION="Messaging"},3286:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7212);class i{constructor(e){this.firestore=r.getFirestore(e.getApp()),e.isEmulated()&&r.useFirestoreEmulator(this.firestore,"localhost",8090)}getFirebaseFirestore(){return this.firestore}static getInstance(e){return null==i.instance&&(i.instance=new i(e)),i.instance}}t.default=i},4024:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FirebaseClientApplication=void 0;const r=n(5503);t.FirebaseClientApplication=class{constructor(e,t){this.app=r.initializeApp(e),this.emulated=t}getApp(){return this.app}isEmulated(){return this.emulated}}},8788:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FirebaseClientAuthenticationService=void 0;const r=n(3887),i=n(598);t.FirebaseClientAuthenticationService=class{constructor(e){this.auth=r.getAuth(e.getApp()),e.isEmulated()&&r.useAuthEmulator(this.auth,"http://localhost:9099")}isAlreadyRegistered(e){return new Promise(((t,n)=>{r.fetchSignInMethodsForEmail(this.auth,e).then((e=>{t(e.length>0)})).catch((e=>{n(new Error(e.message))}))}))}login(e,t,n){let o={email:e,error:!1,message:"",password:t,registered:!0,verified:!0};this.isAlreadyRegistered(e).then((a=>{a?r.signInWithEmailAndPassword(this.auth,e,t).then((e=>{o.verified=e.user.emailVerified,o.verified||(o.error=!0,o.message=i.EmailNotVerified),n(o)})).catch((e=>{o.error=!0,o.message=i.InvalidUser,n(o)})):(o.error=!0,o.message=i.NotRegistered,o.registered=!1,n(o))}))}register(e,t,n){let o={email:e,error:!1,message:"",password:t,registered:!0,verified:!0};this.isAlreadyRegistered(e).then((a=>{a?(o.error=!0,o.message=i.AlreadyRegistered,o.registered=!0,n(o)):r.createUserWithEmailAndPassword(this.auth,e,t).then((e=>{o.verified=e.user.emailVerified,n(o)})).catch((e=>{o.error=!0,o.message=e.message,n(o)}))}))}sendEmailVerification(e,t){let n=this.auth.currentUser,i={email:e,error:!1,message:"",password:"",registered:!0,verified:!0};null!=n?r.sendEmailVerification(n).then((()=>{t(i)})).catch((e=>{i.error=!0,i.message=e.message,t(i)})):(i.error=!0,i.message="Not logged in",t(i))}sendPasswordReset(e,t){let n={email:e,error:!1,message:"",password:"",registered:!0,verified:!0};r.sendPasswordResetEmail(this.auth,e).then((()=>{t(n)})).catch((e=>{n.error=!0,n.message=e.message,t(n)}))}signOut(e,t){let n={email:e,error:!1,message:"",password:"",registered:!0,verified:!0};r.signOut(this.auth).then((()=>{t(n)})).catch((e=>{n.error=!0,n.message=e.message,t(n)}))}updatePassword(e,t,n){let i=this.auth.currentUser,o={email:e,error:!1,message:"",password:t,registered:!0,verified:!0};null!=i?r.updatePassword(i,t).then((()=>{n(o)})).catch((e=>{o.error=!0,o.message=e.message,n(o)})):(o.error=!0,o.message="Not logged in",n(o))}}},3467:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8788),o=r(n(2114)),a=r(n(5264)),s=r(n(3286));t.default=class{constructor(e){this.firebaseClientApplication=this.createFirebaseClientApplication(e),this.FirebaseClientFunctions=this.createFirebaseClientFunctions(),this.fireStore=this.createClientFirestore(),this.authenticationService=this.createAuthenticationService(),this.messagingService=this.createMessagingService()}getAuthenticationService(){return this.authenticationService}getFirebaseClientFunctions(){return this.FirebaseClientFunctions}getClientFirestore(){return this.fireStore}getMessagingService(){return this.messagingService}createAuthenticationService(){return new i.FirebaseClientAuthenticationService(this.firebaseClientApplication)}createClientFirestore(){return s.default.getInstance(this.firebaseClientApplication)}createFirebaseClientFunctions(){return new o.default(this.firebaseClientApplication)}createMessagingService(){return new a.default(this.firebaseClientApplication)}}},2114:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3495);t.default=class{constructor(e){this.functions=r.getFunctions(e.getApp()),e.isEmulated()&&r.useFunctionsEmulator(this.functions,"localhost",5001)}getFunctions(){return this.functions}}},5264:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_MESSAGES=void 0;const i=n(7212),o=r(n(3286)),a=n(9544),s=n(228);t.MAX_MESSAGES=10,t.default=class{constructor(e,n,r){this.firestore=o.default.getInstance(e).getFirebaseFirestore(),this.maxMessages=null==n?t.MAX_MESSAGES:n,this.collection=null==r?a.MESSAGING_COLLECTION:r,this.unsubscribes=[]}addListener(e,t,n){let r=e.getEmail();this.removeListener();const o=i.collection(this.firestore,this.collection),a=i.doc(o,r);let l=i.onSnapshot(a,(e=>{if(e.exists){const n=e.data();if(n&&n.messages&&n.messages.length>0){let e=[];n.messages.map((t=>{e.push(new s.Message(t))})),t(e)}}}));this.unsubscribes=[l]}deleteMessage(e,t){return new Promise((n=>{let r=e.getEmail();this.getMessageCollection(r).then((e=>{let o=e.messages.filter((e=>e.id!=t.getId()));const a=i.collection(this.firestore,this.collection),s=i.doc(a,r);i.setDoc(s,{messages:o}).then((()=>{n({error:!1,errorMessage:"",message:t})})).catch((e=>{n({error:!0,errorMessage:e.message,message:t})}))})).catch((e=>{n({error:!0,errorMessage:e.message,message:t})}))}))}getMessages(e){return new Promise((t=>{let n=e.getEmail();this.getMessageCollection(n).then((e=>{let n=e.messages,r=[];n.map((e=>{r.push(new s.Message(e))})),t({error:!1,errorMessage:"",messages:r})})).catch((e=>{t({error:!0,errorMessage:e.message,messages:[]})}))}))}removeListener(){this.unsubscribes.map((e=>{e()})),this.unsubscribes=[]}sendMessage(e){return new Promise((t=>{let n=e.getToEmail();this.getMessageCollection(n).then((r=>{let o=e.toProps(),a=r.messages;if(a.length>this.maxMessages){let n="Maximum number of unread messages is: "+this.maxMessages;t({error:!0,errorMessage:n,message:e})}else{const s=i.collection(this.firestore,this.collection),l=i.doc(s,n);a.push(o),i.setDoc(l,r).then((()=>{t({error:!1,errorMessage:"",message:e})})).catch((n=>{t({error:!0,errorMessage:n.message,message:e})}))}})).catch((n=>{t({error:!0,errorMessage:n.message,message:e})}))}))}setMaxMessages(e){this.maxMessages=e}getMessageCollection(e){return new Promise(((t,n)=>{const r=i.collection(this.firestore,this.collection),o=i.doc(r,e);i.getDoc(o).then((e=>{if(e.exists()){let n=e.data();t(n)}else t({messages:[]})})).catch((e=>{n(new Error(e.message))}))}))}}},8280:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Login=void 0;class n{constructor(e,t){this.email=e,this.password=t}getEmail(){return this.email}getPassword(){return this.password}toLoginProps(){return{email:this.email,password:this.password}}static create(e){return new n(e.email,e.password)}}t.Login=n},228:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Message=void 0,t.Message=class{constructor(e){this.body=e.body,this.from=e.from,this.id=e.id,this.text=e.text,this.to=e.to}getBody(){return this.body}getFromEmail(){return this.from}getId(){return this.id}getText(){return this.text}getToEmail(){return this.to}toProps(){return{body:this.body,from:this.from,id:this.id,text:this.text,to:this.to}}}},598:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotRegistered=t.InvalidUser=t.EmailNotVerified=t.AlreadyRegistered=void 0,t.AlreadyRegistered="Already Registered",t.EmailNotVerified="Email has not been verified;",t.InvalidUser="Invalid user or password",t.NotRegistered="User is not registered"},871:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.CheckoutStatus=t.PaymentStatus=void 0,(r=t.PaymentStatus||(t.PaymentStatus={}))[r.CANCELLED=0]="CANCELLED",r[r.FAILED=1]="FAILED",r[r.INCOMPLETE=2]="INCOMPLETE",r[r.SUCCEEDED=3]="SUCCEEDED",(n=t.CheckoutStatus||(t.CheckoutStatus={})).CANCELLED="cancelled",n.ERROR="error",n.PENDING="pending",n.SUCCEEDED="succeeded"},772:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatDate=t.formatCurrency=void 0,t.formatCurrency=function(e){return e>0?(e/100).toFixed(2):"0"},t.formatDate=function(e){return e.getDate()+"/"+(e.getMonth()+1)+"/"+e.getFullYear()}},3824:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=o(n(7593));t.default=function(){return a.v1()}},5479:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AlertConfirmButtonId=t.AlertCancelButtonId=void 0;const i=r(n(7294)),o=r(n(3912)),a=r(n(2411)),s=r(n(6248)),l=r(n(814)),u=r(n(8101)),c=r(n(6222));t.AlertCancelButtonId="alertCancelButton",t.AlertConfirmButtonId="alertConfirmButton",t.default=function(e){let n=e.cancelTitle?e.cancelTitle:"Cancel",r=e.okTitle?e.okTitle:"OK";return i.default.createElement("div",null,i.default.createElement(a.default,{open:!0,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},i.default.createElement(c.default,{id:"alert-dialog-title"},e.title),i.default.createElement(l.default,null,i.default.createElement(u.default,{id:"alert-dialog-description"},e.text)),i.default.createElement(s.default,null,null!=e.handleCancel&&i.default.createElement(o.default,{id:t.AlertCancelButtonId,onClick:()=>{e.handleCancel()},color:"primary"},n),null!=e.handleConfirm&&i.default.createElement(o.default,{id:t.AlertConfirmButtonId,onClick:()=>{e.handleConfirm()},color:"primary",autoFocus:!0},r))))}},7849:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LoginDialog=void 0;const s=o(n(7294)),l=a(n(4709)),u=a(n(3912)),c=a(n(2411)),d=a(n(6248)),h=a(n(814)),f=a(n(6222)),p=a(n(6366)),m=n(598);t.LoginDialog=function(e){const t=e.authService,[n,r]=s.useState(o()),i=s.useRef(null);function o(){const t=e.login;return{authError:e.loginError,email:t.getEmail(),emailError:!1,emailErrorMessage:"",password:t.getPassword(),passwordError:!1,passwordErrorMessage:"",verified:e.verified}}function a(){let e=n.email;return!(""==e||!i.current.checkValidity()||e.indexOf("+")>=0)||(r(Object.assign(Object.assign({},n),{emailError:!0,emailErrorMessage:"Invalid email"})),!1)}s.useEffect((()=>{r(o())}),[e.open,e.loginError]);let g=e.register?"Register":"Login";return s.default.createElement("div",null,e.open&&s.default.createElement(c.default,{fullWidth:!1,maxWidth:"md",open:e.open,"aria-labelledby":"save-dialog-title","aria-describedby":"save-dialog-description"},s.default.createElement(f.default,{id:"save-dialog-title"},g),s.default.createElement(h.default,{dividers:!0},s.default.createElement(p.default,{id:"email",autoFocus:!0,error:n.emailError,helperText:n.emailErrorMessage,inputRef:i,onChange:function(e){r(Object.assign(Object.assign({},n),{emailError:!1,emailErrorMessage:"",email:e.target.value}))},margin:"dense",label:"Enter email",type:"email",fullWidth:!0,variant:"outlined",value:n.email}),s.default.createElement(p.default,{id:"password",autoFocus:!0,error:n.passwordError,helperText:n.passwordErrorMessage,onChange:function(e){r(Object.assign(Object.assign({},n),{passwordError:!1,passwordErrorMessage:"",password:e.target.value}))},margin:"dense",label:"Enter password",type:"password",fullWidth:!0,variant:"outlined",value:n.password}),""!=n.authError&&s.default.createElement(l.default,{severity:"error"},n.authError)),s.default.createElement(d.default,null,!n.verified&&s.default.createElement(u.default,{id:"resendVerificationButton",color:"primary",onClick:()=>{t.sendEmailVerification(n.email,(t=>{t.error?r(Object.assign(Object.assign({},n),{authError:t.message})):e.handleResendEmailVerification(t)}))}},"Send Email Verification"),!e.register&&n.verified&&s.default.createElement(u.default,{id:"resetPasswordButton",color:"primary",onClick:()=>{!function(){if(a()){let i=n.email;t.sendPasswordReset(i,(t=>{t.error?r(Object.assign(Object.assign({},n),{authError:t.message})):e.handleResetPassword(t)}))}}()}},"Reset Password"),e.allowCancel&&n.verified&&s.default.createElement(u.default,{id:"cancelButton",color:"primary",onClick:()=>{e.handleCancel()}},"Cancel"),s.default.createElement(u.default,{id:"loginButton",color:"primary",autoFocus:!0,onClick:()=>{!function(){if(a()&&(""!=n.password||(r(Object.assign(Object.assign({},n),{passwordError:!0,passwordErrorMessage:"Invalid password"})),0))){let i=n.email,o=n.password;e.register?t.isAlreadyRegistered(i).then((t=>{if(t){let t={email:i,error:!0,message:m.AlreadyRegistered,password:o,registered:!0,verified:!0};e.handleRegistration(t)}else!function(t,i){e.authService.register(t,i,(t=>{t.error?r(Object.assign(Object.assign({},n),{authError:t.message})):function(t){let i=t.email;e.authService.sendEmailVerification(i,(i=>{i.error?r(Object.assign(Object.assign({},n),{authError:i.message})):e.handleRegistration(t)}))}(t)}))}(i,o)})):function(n,r){t.login(n,r,(t=>{t.error?e.handleLoginError(t):e.handleLogin(t)}))}(i,o)}}()}},g))))}},5882:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i({field:{width:150},formControl:{margin:e.spacing(1),minWidth:100}}))),k=e=>{var{component:t,inputRef:n}=e,r=a(e,["component","inputRef"]);const i=l.useRef(null);return l.useImperativeHandle(n,(()=>({focus:()=>i.current.focus}))),l.default.createElement(t,Object.assign({onReady:e=>i.current=e},r))};function O(e){const t=I(),n=u.useStripe(),r=u.useElements(),[i,o]=l.useState({disablePay:!1,errorMessage:"",name:"",nameError:""}),a=e.login.getEmail();return l.default.createElement("div",null,l.default.createElement(m.default,{open:!0,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},l.default.createElement(y.default,{id:"alert-dialog-title"},"Stripe Payment"),l.default.createElement(v.default,{dividers:!0,style:{minHeight:e.height,minWidth:e.width}},l.default.createElement(b.default,null,l.default.createElement(w.default,{variant:"outlined",className:t.formControl},l.default.createElement(_.default,{id:"total",className:t.field,disabled:!0,label:"Amount",value:S.formatCurrency(e.amount),variant:"outlined",InputProps:{startAdornment:l.default.createElement(E.default,{position:"start"},e.currencySymbol)}})),l.default.createElement(w.default,{variant:"outlined",className:t.formControl},l.default.createElement(_.default,{autoFocus:!0,disabled:!0,margin:"dense",id:"email",label:"Email",type:"text",fullWidth:!0,variant:"outlined",value:a})),l.default.createElement(w.default,{variant:"outlined",className:t.formControl},l.default.createElement(_.default,{autoFocus:!0,error:""!=i.nameError,helperText:i.nameError,id:"name",onChange:function(e){o(Object.assign(Object.assign({},i),{nameError:"",name:e.target.value}))},margin:"dense",label:"Name",type:"text",fullWidth:!0,variant:"outlined",value:i.name})),l.default.createElement(w.default,{variant:"outlined",className:t.formControl},l.default.createElement(_.default,{label:"Credit Card Number",variant:"outlined",fullWidth:!0,margin:"dense",InputProps:{inputComponent:k,inputProps:{component:u.CardElement,id:"stripeCard"}},InputLabelProps:{shrink:!0}})),""!=i.errorMessage&&l.default.createElement(f.default,{severity:"error"},i.errorMessage))),l.default.createElement(g.default,null,null!=e.handleCancel&&l.default.createElement(p.default,{id:"cancelButton",onClick:()=>{e.handleCancel()},color:"primary",autoFocus:!0},"Cancel"),l.default.createElement(p.default,{id:"stripePayButton",disabled:i.disablePay,onClick:t=>{!function(t){if(t.preventDefault(),!n)return void o(Object.assign(Object.assign({},i),{errorMessage:"Stripe not initialised"}));if(!r)return void o(Object.assign(Object.assign({},i),{errorMessage:"Stripe Elements not initialised"}));if(""==i.name)return o(Object.assign(Object.assign({},i),{nameError:"Missing name"})),!1;const s={type:"card",card:r.getElement(u.CardElement)};n.createPaymentMethod(s).then((t=>{if(t.error)o(Object.assign(Object.assign({},i),{disablePay:!1,errorMessage:t.error.message}));else{o(Object.assign(Object.assign({},i),{disablePay:!0}));const r={amount:e.amount,currency:e.currency,description:e.description,email:a,metadata:e.metadata,name:i.name,paymentKey:T.default(),paymentMethodId:t.paymentMethod.id};e.collectPayment(r,(t=>{switch(t.status){case x.PaymentStatus.CANCELLED:o(Object.assign(Object.assign({},i),{disablePay:!1,errorMessage:"Payment cancelled"}));break;case x.PaymentStatus.FAILED:o(Object.assign(Object.assign({},i),{disablePay:!1,errorMessage:t.errorMessage}));break;case x.PaymentStatus.INCOMPLETE:!function(t,r){const a=r.result;n.confirmCardPayment(a.client_secret).then((t=>{if(null!=t.error){const e=t.error.message||"Cannot confirm payment";o(Object.assign(Object.assign({},i),{disablePay:!1,errorMessage:e}))}else"succeeded"==t.paymentIntent.status&&e.completePayment(r,!0)})).catch((e=>{o(Object.assign(Object.assign({},i),{disablePay:!1,errorMessage:e.message}))}))}(0,t);break;case x.PaymentStatus.SUCCEEDED:e.completePayment(t,!0)}}))}}))}(t)},color:"primary",autoFocus:!0},"Pay"))))}t.StripePaymentForm=O;let P=null;t.default=function(e){const[t,n]=l.useState({loaded:null!=P,error:""});return t.loaded?l.default.createElement(c.Elements,{stripe:P},l.default.createElement(O,Object.assign({},e))):(""==t.error&&d.loadStripe(e.stripeKey).then((e=>{P=e,n(Object.assign(Object.assign({},t),{loaded:!0}))})).catch((e=>{n(Object.assign(Object.assign({},t),{error:"Cannot load Stripe: "+e.message}))})),l.default.createElement(l.default.Fragment,null,""!=t.error&&l.default.createElement(C.default,{title:"Fatal Error",text:t.error})))}},4031:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Toast=void 0;const s=o(n(7294)),l=a(n(4709)),u=a(n(7237)),c=a(n(366)),d=a(n(2411)),h=a(n(814)),f=a(n(6222)),p=a(n(1890));t.Toast=function(e){let t=null;function n(){null!=t&&(clearTimeout(t),t=null)}function r(){n(),e.handleClose()}s.useEffect((()=>{if(e.open)return t=setTimeout((()=>r()),e.duration),()=>{n()}}),[e.open]);let i=null==e.fullWidth||e.fullWidth,o=null!=e.maxWidth?e.maxWidth:"sm";return s.default.createElement("div",null,e.open&&s.default.createElement(d.default,{fullWidth:i,maxWidth:o,open:e.open,"aria-labelledby":"save-dialog-title","aria-describedby":"save-dialog-description"},s.default.createElement(f.default,{id:"save-dialog-title"},s.default.createElement(u.default,{display:"flex",alignItems:"center"},s.default.createElement(u.default,{flexGrow:1},e.title),s.default.createElement(u.default,null,s.default.createElement(p.default,{onClick:r},s.default.createElement(c.default,null))))),s.default.createElement(h.default,{dividers:!0},s.default.createElement(l.default,{severity:e.severity},e.message))))}},3743:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(1685)),o=r(n(1816)),a=r(n(9263)),s=n(4024),l=r(n(3467)),u=r(n(7742)),c=n(8554);class d extends l.default{constructor(e){if(null!=d.instance)throw Error("AppContext already instantiated");super(e),this.clipBoard=this.createClipBoard(),this.eventBus=this.createEventBus(),this.settingsStore=this.createSettingsStore(),this.collectionStore=this.createCollectionStore(this),this.accountService=this.createAccountService(),this.liveWindowStore=this.createLiveWindowStore(this),this.liveWindowStore.setCollectionStore(this.collectionStore),this.collectionStore.setLiveWindowStore(this.liveWindowStore),this.listener=this.createListener(this.liveWindowStore),this.createPersistence(this.settingsStore,(e=>{this.persistence=e}))}initialise(e){this.settingsStore.initialise((()=>{this.collectionStore.initialise((()=>{this.liveWindowStore.initialise((()=>{this.listener.initialise(),e()}))}))}))}getAccountService(){return this.accountService}getClipBoard(){return this.clipBoard}getEventBus(){return this.eventBus}getListener(){return this.listener}getLiveWindowStore(){return this.liveWindowStore}getCollectionStore(){return this.collectionStore}getPersistence(){return this.persistence}getSettingsStore(){return this.settingsStore}createAccountService(){return new a.default(this.firebaseClientApplication,this)}createClipBoard(){return new i.default}createEventBus(){return o.default.getInstance()}createFirebaseClientApplication(e){return new s.FirebaseClientApplication(c.getFirebaseOptions(),e)}createPersistence(e,t){this.accountService.getSystemSettings().then((e=>{t(new u.default(this.firebaseClientApplication,this))}))}}t.default=d},3099:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.context=t.appContext=void 0;const i=r(n(7294)),o=r(n(3743)),a=r(n(115)),s=r(n(6362)),l=r(n(5849)),u=r(n(6889));class c extends o.default{constructor(e){super(e)}createListener(e){return new l.default(e)}createLiveWindowStore(e){return new s.default(e)}createCollectionStore(e){return new a.default(e)}createSettingsStore(){return new u.default}static getInstance(){if(null==o.default.instance){const e=window.location.search.indexOf("emulator")>=0;o.default.instance=new c(e)}return o.default.instance}}t.default=c,t.appContext=c.getInstance(),t.context=i.default.createContext(t.appContext)},8554:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFirebaseOptions=void 0,t.getFirebaseOptions=function(){return{apiKey:"AIzaSyB09u1Ebi0MXevhXQ1l9n8w5ty54gtj3Zk",authDomain:"forgetmenot-b02c0.firebaseapp.com",projectId:"forgetmenot-b02c0",storageBucket:"forgetmenot-b02c0.appspot.com",messagingSenderId:"841951463409",appId:"1:841951463409:web:1381701e2bac1ff18fa650",measurementId:"G-0BVBPQ8LDW"}}},2143:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7294)),o=r(n(3935)),a=r(n(9712)),s=r(n(6372)),l=n(3099);document.addEventListener("DOMContentLoaded",(function(){l.appContext.initialise((()=>{o.default.render(i.default.createElement(a.default,{appContext:l.appContext}),document.getElementById("header")),setTimeout((()=>{s.default(l.appContext,{initialised:()=>{},hideSearchBar:()=>{},showSearchBar:()=>{}})}),50)}))}))},4269:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7294)),o=r(n(3195)),a=n(3099),s=r(n(7575)),l=r(n(9329));class u extends s.default{constructor(e){super(e)}render(){return i.default.createElement(o.default,{style:{paddingLeft:"0px",paddingRight:"0px"},maxWidth:!1},i.default.createElement(l.default,{appContext:a.appContext,searchState:this.searchState}))}}t.default=u},6372:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7294)),o=r(n(3935)),a=r(n(4070)),s=r(n(4147)),l=r(n(4269)),u=n(1802),c=n(1802),d=r(n(1166)),h=n(6889),f=r(n(201));t.default=function(e,t){let n=e.getEventBus(),r=e.getSettingsStore(),p=r.getLayout(),m=p.content[0].content[0].height,g=p.content[0].content[1].height;window.React=i.default,window.ReactDOM=o.default;let v=new s.default(p,document.getElementById(u.Screen.Container));function y(){let e=v.root.contentItems[0];e.contentItems[0].config.height=0,e.contentItems[1].config.height=100,e.contentItems[0].element.hide(),v.updateSize()}v.registerComponent(h.LayoutComponent.CollectionContainer,l.default),v.registerComponent(h.LayoutComponent.WindowContainer,f.default),v.registerComponent(h.LayoutComponent.SearchContainer,d.default),a.default(window).resize((function(){v.updateSize()})),v.on("initialised",(()=>{y(),t.initialised(v)})),v.on("componentCreated",(e=>{e.element[0].id=e.config.component})),n.addEventListener(c.MessageType.HideDrawer,(()=>{let e=document.getElementById(u.Screen.Container);e.style.marginLeft="0px",e.style.width="100%",v.updateSize()})),n.addEventListener(c.MessageType.ShowDrawer,(()=>{let e=document.getElementById(u.Screen.Container);e.style.marginLeft=u.DRAWER_WIDTH+"px",e.style.width="calc(100% - "+u.DRAWER_WIDTH+"px)",v.updateSize()})),n.addEventListener(c.MessageType.ResetSearch,(()=>{y(),t.hideSearchBar(v)})),n.addEventListener(c.MessageType.Search,(e=>{let n=e.getSearchState();n.search&&n.term.length>0?(function(){let e=v.root.contentItems[0];0==m?e.contentItems[0].config.height=50:(e.contentItems[0].config.height=m,e.contentItems[1].config.height=g),e.contentItems[0].element.show(),v.updateSize()}(),t.showSearchBar(v)):0!=v.root.contentItems[0].contentItems[0].config.height&&y()})),v.init();let b=null;return v.on("stateChanged",(()=>{let e=v.toConfig();0!=e.content[0].content[0].height&&(m=e.content[0].content[0].height,g=e.content[0].content[1].height),r.saveLayout(e),null==b&&(b=setTimeout((()=>{n.sendMessage({messageType:c.MessageType.Resize}),b=null}),500))})),v}},7575:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7294)),o=n(3099),a=n(1802),s=r(n(5096));class l extends i.default.Component{constructor(e){super(e),this.state=this.searchState=s.default.getDefaultSearchState()}componentDidMount(){o.appContext.getEventBus().addEventListener(a.MessageType.Search,this.listen,this)}componentWillUnmount(){o.appContext.getEventBus().removeEventListener(a.MessageType.Search,this.listen)}listen(e){this.searchState=e.getSearchState(),this.setState(this.searchState)}}t.default=l},1166:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7294)),o=r(n(3195)),a=n(3099),s=r(n(7575)),l=r(n(7124));class u extends s.default{constructor(e){super(e)}render(){let e=this.searchState.search&&this.searchState.term.length>0;return i.default.createElement(o.default,{style:{paddingLeft:"0px",paddingRight:"0px"},maxWidth:!1},e&&i.default.createElement(l.default,{appContext:a.appContext,searchState:this.searchState}))}}t.default=u},201:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7294)),o=r(n(3195)),a=n(3099),s=r(n(7575)),l=r(n(1259));class u extends s.default{constructor(e){super(e)}render(){return i.default.createElement(o.default,{style:{paddingLeft:"0px",paddingRight:"0px"},maxWidth:!1},i.default.createElement(l.default,{appContext:a.appContext,searchState:this.searchState}))}}t.default=u},5849:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=o(n(2043));t.default=class{constructor(e){this.liveWindowStore=e}initialise(){setTimeout((()=>{this.listen()}),500)}listen(){let e=chrome.windows.onBoundsChanged;null!=e&&e.addListener((e=>{a.debug("Window updated: "+e.id),this.liveWindowStore.handleWindowMoved(e)})),chrome.windows.onCreated.addListener((e=>{a.debug("Window created: "+e.id),this.liveWindowStore.handleWindowCreate(e)})),chrome.windows.onFocusChanged.addListener((e=>{a.debug("Window focus update"),this.liveWindowStore.handleWindowFocus(e)})),chrome.windows.onRemoved.addListener((e=>{a.debug("Window closed: "+e),this.liveWindowStore.handleWindowClose(e)})),chrome.tabs.onAttached.addListener(((e,t)=>{a.debug("Tab attached: "+e),this.liveWindowStore.handleTabAttached(e,t)})),chrome.tabs.onCreated.addListener((e=>{a.debug("Tab created: "+e.title),this.liveWindowStore.handleTabCreate(e)})),chrome.tabs.onRemoved.addListener(((e,t)=>{a.debug("Tab removed: "+e+" Window "+t.windowId+" closing: "+t.isWindowClosing),t.isWindowClosing||this.liveWindowStore.handleTabRemove(e,t.windowId)})),chrome.tabs.onUpdated.addListener(((e,t,n)=>{"complete"==t.status&&(this.liveWindowStore.handleTabChange(n),a.debug("Tab updated: "+e+" url: "+t.url))})),chrome.tabs.onMoved.addListener(((e,t)=>{this.liveWindowStore.handleTabMoved(e,t),a.debug("Tab moved: "+e+" window: "+t.windowId)}))}}},983:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1802);t.default=class{constructor(e){this.messageType=r.MessageType.Login,this.login=e}}},1042:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0,t.Account=class{constructor(e,t){this.login=e,this.admin=t.admin,this.backupPurchased=t.backupPurchased,this.enterprise=t.enterprise,this.lastLoginDate=new Date,this.paymentDueDate=t.paymentDueDate,this.registrationDate=t.registrationDate}getBackupPurchased(){return this.backupPurchased}getLastLoginDate(){return this.lastLoginDate}getLogin(){return this.login}getPaymentDueDate(){return this.paymentDueDate}getRegistrationDate(){return this.registrationDate}hasLoggedInToday(){const e=new Date,t=this.lastLoginDate;return t.getDate()==e.getDate()&&t.getMonth()==e.getMonth()&&t.getFullYear()==e.getFullYear()}hasEnterprise(){return this.enterprise}isAdmin(){return this.admin}isPaymentDue(){return(new Date).getTime()>=this.paymentDueDate.getTime()}setBackupPurchased(e){this.backupPurchased=e}toProps(){return{admin:this.admin,backupPurchased:this.backupPurchased,enterprise:this.enterprise,paymentDueDate:this.paymentDueDate,registrationDate:this.registrationDate}}updateLastLogin(){this.lastLoginDate=new Date}}},1955:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(5958));class o extends i.default{constructor(e,t,n,r,i,o,a){super(e,t,n,r,i,a),this.parent=o}getParent(){return this.parent}isLive(){return!0}setParent(e){this.parent=e}}t.default=o},5096:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchMessage=void 0;const r=n(1802);t.SearchMessage=class{constructor(e){this.messageType=r.MessageType.Search,this.searchState=e}getSearchState(){return this.searchState}};class i{constructor(e,t,n,r){this.term=e,this.liveWindowMap=t,this.collectionMap=n,this.tabs=r}getCollectionMap(){return this.collectionMap}getLiveWindowMap(){return this.liveWindowMap}getTabs(){return this.tabs}getTerm(){return this.term}static getDefault(){return new i("",{},{},[])}static getDefaultSearchState(){return{filter:!1,loading:!1,search:!1,term:"",result:i.getDefault()}}}t.default=i},8158:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TabFieldType=void 0;const i=r(n(3824));var o;!function(e){e.FavIconUrl="favIconUrl",e.Title="title",e.Url="url"}(o=t.TabFieldType||(t.TabFieldType={}));const a=[o.FavIconUrl,o.Title,o.Url];t.default=class{constructor(e,t,n,r,i,o){if(this.id=t,this.name=n,this.description=r,this.tags=o,e)this.chromeTab=i;else{let e={};a.map((t=>{null!=i[t]&&(e[t]=i[t])})),this.chromeTab=e}}getChromeTab(){return this.chromeTab}getDescription(){return this.description}getId(){return this.id}getName(){return this.name}getTags(){return this.tags}isChromeEqual(e){return this.chromeTab.url==e.url}isEqual(e){if(this.name!=e.name||this.description!=e.description)return!1;for(let t=0;t{e[r]!=n[r]&&(t=!0)})),t}isLive(){return!1}setChromeWindow(e){let t={};s.map((n=>{t[n]=e[n]})),this.chromeWindow=t}setDescription(e){this.description=e}setName(e){this.name=e}setTabs(e){this.tabs=e}setTags(e){this.tags=e}updateChromeWindow(e){s.map((t=>{this.chromeWindow[t]=e[t]}))}static generateId(){return o.default()}static toWindowProps(e){let t=[];return e.getTabs().map((e=>{t.push(i.default.toTabProps(e))})),{chromeWindow:e.getChromeWindow(),description:e.getDescription(),id:e.getId(),name:e.getName(),tabs:t,tags:e.getTags()}}}},9263:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7212),i=n(3495),o=n(1802),a=n(1042);t.default=class{constructor(e,t){this.firestore=t.getClientFirestore().getFirebaseFirestore(),this.appContext=t,this.messageService=t.getMessagingService()}collectPayment(e){return new Promise(((t,n)=>{i.httpsCallable(i.getFunctions(),"stripePay")(e).then((e=>{let n=e.data;t(n)})).catch((e=>{n(new Error(e.message))}))}))}completePayment(e){return new Promise(((t,n)=>{i.httpsCallable(i.getFunctions(),"stripeCompletePayment")(e).then((e=>{let n=e.data;t(n)})).catch((e=>{n(new Error(e.message))}))}))}findAccount(e){return new Promise((t=>{const n=r.collection(this.firestore,o.ACCOUNTS_COLLECTION),i=r.doc(n,e.getEmail());r.getDoc(i).then((n=>{if(n.exists()){let r=n.data(),i={admin:r.admin,backupPurchased:r.backupPurchased,enterprise:r.enterprise,paymentDueDate:new Date(1e3*r.paymentDueDate.seconds),registrationDate:new Date(1e3*r.registrationDate.seconds)},o=new a.Account(e,i);t({account:o,error:null})}else t({account:null,error:null})})).catch((e=>{t({account:null,error:e})}))}))}getAccount(e,t){return new Promise((n=>{this.getSystemSettings().then((r=>{null!=r.error?n({account:null,error:r.error}):t||null==this.account||this.account.getLogin().getEmail()!=e.getEmail()?this.findAccount(e).then((e=>{this.account=e.account,n({account:this.account,error:null})})).catch((e=>{n({account:null,error:e})})):n({account:this.account,error:null})}))}))}getAccountData(){return{account:this.account,systemSettings:this.systemSettings}}getSystemSettings(e){return null==this.systemSettings||e?new Promise(((e,t)=>{this.loadSystemSettings().then((t=>{this.systemSettings=t,this.messageService.setMaxMessages(t.maxMessages),e({systemSettings:t,error:null})})).catch((t=>{e({systemSettings:null,error:t})}))})):new Promise((e=>{e({systemSettings:this.systemSettings,error:null})}))}isPaymentDue(e){return!!e.isPaymentDue()&&(e.getBackupPurchased()>0||null==this.systemSettings||!this.systemSettings.annualSubscription||0!=this.systemSettings.annualSubscriptionPrice)}logout(){this.account=null}loadSystemSettings(){return new Promise(((e,t)=>{const n=r.collection(this.firestore,o.SYSTEM_SETTINGS_COLLECTION),i=r.doc(n,o.SYSTEM_SETTINGS_COLLECTION_ID);r.getDoc(i).then((n=>{if(n.exists()){let t=n.data();e(t)}else t(new Error(o.FIREBASE_ERROR+o.SYSTEM_SETTINGS_COLLECTION+" are missing"))})).catch((e=>{t(new Error(o.FIREBASE_ERROR+e.message))}))}))}}},6050:(e,t)=>{"use strict";function n(e,t){return e.collectPayment(t)}function r(e,t){return e.completePayment(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.paymentProps=t.completePayment=t.collectPayment=void 0,t.collectPayment=n,t.completePayment=r,t.paymentProps={collectPayment:n,completePayment:r}},1685:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{getTab(){return this.tab}saveTab(e){this.tab=e}}},115:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(2043)),l=n(3374),u=n(1802),c=a(n(8158)),d=a(n(5958)),h=a(n(1175));class f extends h.default{constructor(e){super(e),this.menuTags=[],this.tags=[],this.tagMap={},this.windowNameMap={},this.eventBus=e.getEventBus()}addTabAtPosition(e,t,n){e.getTabs().splice(n,0,new c.default(!1,c.default.generateId(),this.getTabName(t),t.getDescription(),t.getChromeTab(),t.getTags())),this.updateAndNotify()}addTabAtEnd(e,t){e.getTabs().push(new c.default(!1,c.default.generateId(),this.getTabName(t),t.getDescription(),t.getChromeTab(),t.getTags())),this.updateAndNotify()}buildTags(){this.createTags(this.getWindows()),this.updateAndNotify()}compareParentWindow(e){let t={},n=e.getParent(),r={changed:!1,changedPosition:!1,newTabs:[],deletedTabs:[]};return r.changedPosition=n.hasPositionChanged(e.getChromeWindow()),e.getTabs().map((e=>{let i=n.findTab(e);t[e.getChromeTab().url]=e,null==i&&(r.newTabs.push(e),r.changed=!0)})),n.getTabs().map((e=>{null==t[e.getChromeTab().url]&&(r.deletedTabs.push(e),r.changed=!0)})),r}compareWindows(e){let t=[];for(let n=0;n{this.deleteWindow(e,!1)})),this.updateAndNotify()}deleteTab(e,t){let n=e.getTabs().filter((e=>e!=t));e.setTabs(n),this.updateAndNotify()}initialise(e){chrome.storage.local.get(u.SAVED,(t=>{if(null!=t[u.SAVED]){s.debug("CollectionState: "+JSON.stringify(t[u.SAVED]));let e=t[u.SAVED].windows,n=this.createWindows(e);this.createTags(n),this.addWindows(n),this.setWindowState(t[u.SAVED])}e()}))}findTag(e){let t=e.toUpperCase(),n=this.tags.filter((e=>e.tagUpper==t));return n.length>0?n[0]:null}findWindowByName(e){return this.windowNameMap[e]}findWindowsByName(e){let t=e.toLowerCase();return this.getWindows().filter((e=>e.getName().toLowerCase()==t))}getMenuTags(){return this.menuTags}getTags(){return this.tags}moveTab(e,t,n,r){let i=this.findWindowById(e),o=this.findWindowById(n);if(null!=i&&null!=o){let e=i.getTabs()[t];this.deleteTab(i,e),this.addTabAtPosition(o,e,r),this.updateAndNotify()}}removeWindow(e){this.deleteWindow(e,!0)}restoreWindows(e){this.createWindows(e).map((e=>{let t=this.findWindowById(e.getId());null!=t&&this.deleteWindow(t,!1),this.addWindow(e)})),this.createTags(this.getWindows()),this.updateAndNotify()}setLiveWindowStore(e){this.liveWindowStore=e}saveWindow(e,t,n,r){const i=r.getTabs(),o=this.findWindowsByName(e);if(this.updateTags(r.getTags(),n),r.setTags(n),0==o.length){let o=Object.assign(r),a=[];i.map((e=>{let t=Object.assign(e.getChromeTab());a.push(new c.default(!1,c.default.generateId(),this.getTabName(e),e.getDescription(),t,[]))}));let s=new d.default(d.default.generateId(),e,t,o.getChromeWindow(),a,n);return this.liveWindowStore.setParent(r,s),this.addWindow(s),this.createTags(this.getWindows()),this.updateAndNotify(),{duplicate:!1,window:s}}return{duplicate:!0,window:o[0]}}updateParentWindow(e){e.getParent().setChromeWindow(e.getChromeWindow())}updateTab(e,t,n,r){e.setName(t),e.setDescription(n),this.updateTags(e.getTags(),r),e.setTags(r),this.createTags(this.getWindows()),this.updateAndNotify()}updateWindow(e,t,n,r){let i=this.isWindowExpanded(e);t!=e.getName()&&(delete this.windowNameMap[e.getName()],this.windowNameMap[t]=e),e.setName(t),e.setDescription(n),this.updateTags(e.getTags(),r),e.setTags(r),this.setWindowExpanded(e,i),this.createTags(this.getWindows()),this.updateAndNotify(),this.eventBus.sendMessage({messageType:u.MessageType.LiveWindowUpdate})}static getNewWindowCompareResult(e){return{compareState:l.CompareWindowState.NewWindow,window:e,windowChanges:{changedPosition:!1,changedTabs:[],deletedTabs:[],deletedTags:[],descriptionChange:!1,nameChange:!1,newTabs:[],newTags:[],updatedTags:[]}}}addWindow(e){super.addWindow(e),this.windowNameMap[e.getName()]=e}addWindows(e){e.map((e=>{this.addWindow(e)}))}updateStorage(){let e={};this.clean();let t=this.getWindowState(),n=[];this.getWindows().map((e=>{let t=[];e.getTabs().map((e=>{t.push({id:e.getId(),name:e.getName(),description:e.getDescription(),chromeTab:e.getChromeTab(),tags:e.getTags()})})),n.push({id:e.getId(),name:e.getName(),description:e.getDescription(),chromeWindow:e.getChromeWindow(),tabs:t,tags:e.getTags()})})),t.windows=n,e[u.SAVED]=t,chrome.storage.local.set(e)}addTag(e){let t=e.toUpperCase(),n=e.toUpperCase().charAt(0),r=this.tagMap[n];if(null==r)this.tagMap[n]=[{tag:e,tagUpper:t,count:1}];else{for(let e=0;e0&&(i=l.CompareWindowState.ChangedWindow,n.deletedTags=r.deletedTags),r.newTags.length>0&&(i=l.CompareWindowState.ChangedWindow,n.newTags=r.newTags),r.updatedTags.length>0&&(i=l.CompareWindowState.ChangedWindow,n.updatedTags=r.updatedTags);let o={};return t.tabs.map((t=>{let r=t.chromeTab.url,a=e.findTabByUrl(r);if(o[r]=t,null==a)n.newTabs.push(t),i=l.CompareWindowState.ChangedWindow;else{let e=this.findTagChanges(a.getTags(),t.tags);a.isEqual(t)&&!this.hasTagChanges(e)||(n.changedTabs.push(Object.assign(Object.assign({},e),{tab:a})),i=l.CompareWindowState.ChangedWindow)}})),e.getTabs().map((e=>{let t=e.getChromeTab().url;null==o[t]&&(n.deletedTabs.push(e),i=l.CompareWindowState.ChangedWindow)})),{compareState:i,window:t,windowChanges:n}}createTags(e){let t={},n={},r=this.appContext.getSettingsStore().getMenuTabTags();e.map((e=>{e.getTags().map((e=>{this.saveTag(t,e),this.saveTag(n,e)})),e.getTabs().map((e=>{e.getTags().map((e=>{this.saveTag(t,e),r&&this.saveTag(n,e)}))}))})),this.sortTagMap(n),this.sortTagMap(t),this.tagMap=t,this.tags=this.sortTags(t),this.menuTags=this.sortTags(n)}createTagMap(e){let t={};return e.map((e=>{let n=e.toUpperCase();t[n]=e})),t}createWindows(e){let t=[];return e.map((e=>{let n=[];e.tabs.map((e=>{let t=null!=e.tags?e.tags:[],r=null==e.id?c.default.generateId():e.id;n.push(new c.default(!1,r,e.name,e.description,e.chromeTab,t))}));let r=null!=e.tags?e.tags:[];t.push(new d.default(e.id,e.name,e.description,e.chromeWindow,n,r))})),t}deleteTag(e){let t=e.toUpperCase(),n=e.toUpperCase().charAt(0),r=this.tagMap[n];if(null!=r)for(let e=0;e{this.updateTags(e.getTags(),[])})),super.removeWindow(e),this.liveWindowStore.removeParent(e),this.createTags(this.getWindows()),null!=this.windowNameMap[e.getName()]&&delete this.windowNameMap[e.getName()],t&&this.updateAndNotify()}findTagChanges(e,t){let n=this.createTagMap(e),r=this.createTagMap(t),i=[],o=[],a=[];return e.map((e=>{let t=e.toUpperCase();null==r[t]&&i.push(e)})),t.map((e=>{let t=n[e.toUpperCase()];null==t?o.push(e):t!=e&&a.push(e)})),{deletedTags:i,newTags:o,updatedTags:a}}findWindow(e){let t=this.findWindowById(e.id);return null!=t?t:this.findWindowByName(e.name)}getTabName(e){if(""!=e.getName())return e.getName();let t=e.getChromeTab().title;return null==t?"":t}hasTagChanges(e){return e.deletedTags.length>0||e.newTags.length>0||e.updatedTags.length>0}saveTag(e,t){let n=t.toUpperCase(),r=n.charAt(0),i=e[r];if(null==i)e[r]=[{tag:t,tagUpper:n,count:1}];else{for(let e=0;e{let r=e[n];t.push(...r)})),t}sortTagMap(e){for(let t in e)e[t].sort(((e,t)=>e.tagUpper.localeCompare(t.tagUpper)))}updateTag(e){let t=this.findTag(e);null!=t&&(t.tag=e)}updateTags(e,t){let n=this.findTagChanges(e,t);n.deletedTags.map((e=>{this.deleteTag(e)})),n.newTags.map((e=>{this.addTag(e)})),n.updatedTags.map((e=>{this.updateTag(e)})),(n.deletedTags.length>0||n.newTags.length>0)&&(this.sortTagMap(this.tagMap),this.tags=this.sortTags(this.tagMap))}updateAndNotify(){this.updateStorage(),this.eventBus.sendMessage({messageType:u.MessageType.CollectionUpdate})}}t.default=f},7742:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7212),o=n(1802),a=r(n(5958));t.default=class{constructor(e,t){this.maxBackupsPerDay=100,this.maxTabsPerCollection=20,this.firestore=t.getClientFirestore().getFirebaseFirestore(),this.appContext=t,this.appContext.getAccountService().getSystemSettings().then((e=>{const t=e.systemSettings;null!=t&&(this.maxBackupsPerDay=t.maxBackupsPerDay,this.maxTabsPerCollection=t.maxTabsPerCollection)}))}authorize(e,t){e()}deleteCollection(e,t,n){const r=this.appContext.getSettingsStore().getLogin(),a=this.getLibrary(r),s=i.doc(a,e);i.deleteDoc(s).then((()=>{this.getCollectionSummary(r).then((a=>{let s=a.collectionData.filter((t=>t.name!=e));const l=i.collection(this.firestore,o.COLLECTION_SUMMARY),u=i.doc(l,r.getEmail()),c={collectionData:s};i.setDoc(u,c).then((()=>t())).catch((e=>{n(o.FIREBASE_ERROR+e.message)}))})).catch((e=>{n(e.message)}))})).catch((e=>{n(e.message)}))}getCollections(e,t,n,r){let i=this.isCloudAccessExceeded();if(i.error)r(i.message);else{const t=this.appContext.getSettingsStore().getLogin(),i=[];e.map((e=>{i.push(this.getCollection(e,t))})),Promise.all(i).then((e=>{n(e)})).catch((e=>{r(e.message)}))}}getCollectionNames(e,t){let n=this.isCloudAccessExceeded();if(n.error)t(n.message);else{const n=this.appContext.getSettingsStore().getLogin();this.getCollectionSummary(n).then((t=>{let n=t.collectionData.map((e=>e.name)).sort((function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}));e(n)})).catch((e=>{t(e.message)}))}}saveWindows(e,t,n){let r=this.isCloudAccessExceeded();r.error?n(r.message):this.isAllowanceExceeded().then((r=>{if(r.exceeded)n(r.message);else{let r=!1;const s=this.appContext.getSettingsStore().getLogin(),l=i.collection(this.firestore,o.COLLECTION_LIBRARY),u=i.doc(l,s.getEmail());i.setDoc(u,{lastWrite:new Date}).then((()=>{if(e.map((e=>{const t=this.getLibrary(s),l=i.doc(t,e.getName());i.setDoc(l,a.default.toWindowProps(e)).catch((e=>{r||n(o.FIREBASE_ERROR+e.message),r=!0}))})),!r){const r=this.appContext.getSettingsStore().getLogin();this.saveWindowSummary(r,e,t,n)}}))}})).catch((e=>{n(e.message)}))}getLibrary(e){const t=i.collection(this.firestore,o.COLLECTION_LIBRARY),n=i.doc(t,e.getEmail());return i.collection(n,o.LIBRARY)}getAllCollections(e){return new Promise(((t,n)=>{let r=[];const a=this.getLibrary(e);i.getDocs(a).then((function(e){e.forEach((function(e){let t=e.data();r.push(t)})),t(r)})).catch((e=>{n(new Error(o.FIREBASE_ERROR+e.message))}))}))}getCollection(e,t){return new Promise(((n,r)=>{const a=this.getLibrary(t),s=i.doc(a,e);i.getDoc(s).then((e=>{if(e.exists()){let t=e.data();n(t)}else n(null)})).catch((e=>{r(new Error(o.FIREBASE_ERROR+e.message))}))}))}getCollectionSummary(e){return new Promise(((t,n)=>{const r=i.collection(this.firestore,o.COLLECTION_SUMMARY),a=i.doc(r,e.getEmail());i.getDoc(a).then((r=>{if(r.exists()){let e=r.data();t(e)}else this.getAllCollections(e).then((r=>{let i=[];r.map((e=>{i.push({name:e.name,tabCount:e.tabs.length})}));let o={collectionData:i};this.saveCollectionSummary(e,o,(()=>{t({collectionData:i})}),(e=>{n(new Error(e))}))})).catch((e=>{n(e)}))})).catch((e=>{n(new Error(o.FIREBASE_ERROR+e.message))}))}))}isAllowanceExceeded(){const e=this.appContext.getSettingsStore().getLogin();return new Promise(((t,n)=>{this.getCollectionSummary(e).then((r=>{let i=0,o=0;r.collectionData.map((e=>{i++,o+=e.tabCount})),this.appContext.getAccountService().getAccount(e).then((e=>{if(null==e.error)if(null!=e.account){let n=e.account.getBackupPurchased(),r=n*this.maxTabsPerCollection;i>n&&t({exceeded:!0,message:"You have exceeded your backup allowance of "+n+" collections"}),o>r&&t({exceeded:!0,message:"You have exceeded your backup allowance of "+r+" tabs"}),t({exceeded:!1,message:""})}else n(new Error("Cannot find account"));else n(e.error)}))})).catch((e=>{n(e.message)}))}))}isCloudAccessExceeded(){let e=this.appContext.getSettingsStore(),t=e.getCloudAccess();return e.updateCloudAccess(),t.count>this.maxBackupsPerDay?{error:!0,message:"Cloud access count "+t.count+" has exceeded maximum "+this.maxBackupsPerDay}:{error:!1,message:""}}saveCollectionSummary(e,t,n,r){const a=i.collection(this.firestore,o.COLLECTION_SUMMARY),s=i.doc(a,e.getEmail());i.setDoc(s,t).catch((e=>{r(o.FIREBASE_ERROR+e.message)})),n()}saveWindowSummary(e,t,n,r){this.getCollectionSummary(e).then((i=>{let o={};i.collectionData.map((e=>{o[e.name]=e})),t.map((e=>{let t=e.getName(),n={name:t,tabCount:e.getTabs().length};null==o[t]?i.collectionData.push(n):o[t]=n})),this.saveCollectionSummary(e,i,n,r)})).catch((e=>{r(o.FIREBASE_ERROR+e.message)}))}}},3374:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.CompareWindowState=void 0,(n=t.CompareWindowState||(t.CompareWindowState={}))[n.NewWindow=1]="NewWindow",n[n.IdenticalWindow=2]="IdenticalWindow",n[n.ChangedWindow=3]="ChangedWindow"},6362:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(2043)),l=n(1802),u=n(1802),c=a(n(1955)),d=a(n(8158)),h=a(n(1175));class f extends h.default{constructor(e){super(e),this.chromeWindows=[],this.chromeWindowMap={},this.windowParentMap={},this.windowTabMap={},this.eventBus=e.getEventBus()}addTab(e){chrome.tabs.create({active:!1,windowId:e.getChromeWindow().id})}addTabAtPosition(e,t,n){chrome.tabs.create({active:!1,windowId:e.getChromeWindow().id,index:n,url:t.getChromeTab().url})}addTabAtEnd(e,t){chrome.tabs.create({active:!1,windowId:e.getChromeWindow().id,url:t.getChromeTab().url})}close(e,t){chrome.windows.remove(e.getChromeWindow().id,t)}closeAllWindows(){this.getWindows().map((e=>{e.getTabs().map((t=>{const n=t.getChromeTab().title;n&&!n.startsWith(l.CHROME_EXTENSION)&&this.deleteTab(e,t)}))}))}cloneCollection(e){this.launch(e,!0)}copyTab(e,t,n){chrome.tabs.create({windowId:t,index:n,url:e.getChromeTab().url},(()=>{this.notify()}))}deleteTab(e,t){chrome.tabs.remove(t.getChromeTab().id)}duplicateLiveWindow(e){this.launch(e,!1)}focusTab(e){chrome.tabs.update(e.getChromeTab().id,{active:!0})}focusWindow(e){chrome.windows.update(e.getChromeWindow().id,{focused:!0})}handleTabAttached(e,t){this.findTab(e);let n=this.findTabWindow(e);if(null!=n){let r=n.getChromeWindow().id,i=this.findWindowTab(e,r);this.removeTab(i,r);let o=t.newWindowId,a=this.windowTabMap[o];null!=a&&(a.splice(t.newPosition,0,i),this.notify())}}handleTabChange(e){let t=e.windowId,n=this.findWindowTab(e.id,t);null!=n&&(n.setChromeTab(e),this.notify())}handleTabCreate(e){const t=e.id.toString(),n=e.windowId,r=this.findWindowById(n.toString());if(null!=r&&null==r.findTabById(t)){let r=this.windowTabMap[n],i=new d.default(!0,t,"","",e,[]);null!=r&&(r.splice(e.index,0,i),this.notify())}}handleTabMoved(e,t){let n=t.windowId,r=this.windowTabMap[n];if(null!=r){let e=t.fromIndex,n=r[e];r.splice(e,1),r.splice(t.toIndex,0,n),this.notify()}}handleTabRemove(e,t){let n=this.findWindowTab(e,t);this.findWindowById(t.toString()),null!=n&&(this.removeTab(n,t),this.notify())}handleWindowClose(e){let t=this.chromeWindows.filter((t=>t.id!=e));this.chromeWindows=t,null!=this.windowParentMap[e]&&(delete this.windowParentMap[e],this.updateStorage()),this.removeWindow(this.findWindowById(e.toString())),this.notify()}handleWindowCreate(e){const t=e.id;this.chromeWindows.push(e),this.chromeWindowMap[t]=e,this.windowTabMap[t]=[];let n=this.findWindowById[e.id];return null==n?(n=new c.default(t.toString(),"","",e,this.getTabs(e),null,[]),this.addWindow(n)):n.setTabs(this.getTabs(e)),this.notify(),n}handleWindowFocus(e){let t=!1;this.getWindows().map((n=>{let r=n.getChromeWindow();r.id==e?(t=!r.focused,r.focused=!0):r.focused=!1})),t&&this.notify()}handleWindowMoved(e){let t=this.findWindowById(e.id.toString());null!=t&&t.updateChromeWindow(e)}initialise(e){chrome.storage.local.get(u.LIVE,(t=>{null!=t[u.LIVE]&&(s.debug("LiveWindowState: "+JSON.stringify(t[u.LIVE])),null!=t[u.LIVE].windowParentMap&&(this.windowParentMap=t[u.LIVE].windowParentMap),this.setWindowState(t[u.LIVE])),this.getChromeWindows((()=>{e()}))}))}minimize(e){let t=e.getChromeWindow();chrome.windows.update(t.id,{state:"minimized"},(()=>{t.state="minimized",this.notify()}))}moveTab(e,t,n){chrome.tabs.move(e,{windowId:t,index:n},(()=>{this.notify()}))}newWindow(){chrome.windows.create({focused:!0},(()=>{this.notify()}))}removeParent(e){let t=this.getWindows(),n=!1;t.map((t=>{const r=t.getParent();null!=r&&r.getName()==e.getName()&&(t.setParent(null),n=!0)})),n&&this.notify()}restore(e){let t=e.getChromeWindow();chrome.windows.update(t.id,{state:"normal"},(()=>{t.state="normal",this.notify()}))}setCollectionStore(e){this.collectionStore=e}setParent(e,t){e.setParent(t),this.windowParentMap[e.getId()]=t.getId(),this.updateStorage()}getChromeWindows(e){chrome.windows.getAll({},(t=>{let n={};s.debug("Number of windows update"+t.length),t.map((e=>{n[e.id]=e})),this.getChromeTabs((r=>{this.chromeWindows=t,this.chromeWindowMap=n,this.windowTabMap=r,this.chromeWindows.map((e=>{let t=this.windowParentMap[e.id],n=null!=t?this.collectionStore.findWindowById(t):null,r=null!=n?n.getTags():[];this.addWindow(new c.default(e.id.toString(),"","",e,this.getTabs(e),n,r))})),e()}))}))}updateStorage(){let e={};this.clean();let t=this.getWindowState(),n={expandedPanel:t.expandedPanel,expandedWindowMap:t.expandedWindowMap,windowParentMap:this.windowParentMap};e[u.LIVE]=n,chrome.storage.local.set(e)}findTab(e){for(let t=0;t{let n={};for(let e=0;e{i.push(e.getChromeTab().url)}));let o={focused:!0,height:n.height,left:n.left,top:n.top,url:i,width:n.width};chrome.windows.create(o,(n=>{const r=n.id,i=t?e:e.getParent(),o=this.findWindowById(r.toString());null!=i&&(this.windowParentMap[r]=i.getId(),this.updateStorage(),null!=o&&o.setParent(i),this.notify())}))}notify(){this.eventBus.sendMessage({messageType:u.MessageType.LiveWindowUpdate})}removeTab(e,t){let n=this.findWindowById(t.toString());if(null!=n){let r=n.getTabs().filter((t=>t!=e));this.windowTabMap[t]=r,n.setTabs(r)}}}t.default=f},6889:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultLayout=t.BACKUP_DIRECTORY=t.SETTINGS=t.LayoutComponent=void 0;const a=o(n(2043)),s=n(8280);var l;function u(){return{settings:{showCloseIcon:!1,showPopoutIcon:!1},content:[{type:"column",content:[{type:"row",height:0,content:[{title:"A react component",type:"react-component",component:l.SearchContainer}]},{type:"row",height:100,content:[{title:"A react component",type:"react-component",component:l.WindowContainer},{title:"Another react component",type:"react-component",component:l.CollectionContainer}]}]}]}}!function(e){e.CollectionContainer="collectionContainer",e.SearchContainer="searchContainer",e.WindowContainer="windowContainer"}(l=t.LayoutComponent||(t.LayoutComponent={})),t.SETTINGS="settings",t.BACKUP_DIRECTORY="ForgetMeNot",t.getDefaultLayout=u,t.default=class{constructor(){this.state={}}getBackupDirectory(){return this.state.backupDirectory}getCloudAccess(){return this.state.cloudAccess}getDefaultLayout(){return u()}getLayout(){return this.state.layoutConfig}getLogin(){return s.Login.create(this.state.login)}getMenuTabTags(){return this.state.menuTabTags}initialise(e){const n={date:(new Date).getTime(),count:0};chrome.storage.local.get(t.SETTINGS,(r=>{null!=r[t.SETTINGS]?(a.debug("SettingsState: "+JSON.stringify(r[t.SETTINGS])),this.state=r[t.SETTINGS],null==this.state.backupDirectory&&(this.state.backupDirectory=t.BACKUP_DIRECTORY),null==this.state.cloudAccess&&(this.state.cloudAccess=n),null==this.state.licenseAccepted&&(this.state.licenseAccepted=!1),null==this.state.login&&(this.state.login={email:"",password:""}),null==this.state.menuTabTags&&(this.state.menuTabTags=!0)):this.state={backupDirectory:t.BACKUP_DIRECTORY,cloudAccess:n,layoutConfig:this.getDefaultLayout(),licenseAccepted:!1,login:{email:"",password:""},menuTabTags:!0},e()}))}isLicenseAccepted(){return this.state.licenseAccepted}saveLayout(e){this.state.layoutConfig=e,this.updateStorage()}setBackupDirectory(e){this.state.backupDirectory=e,this.updateStorage()}setDefaultLayout(){this.saveLayout(this.getDefaultLayout())}setLicenseAccepted(){this.state.licenseAccepted=!0,this.updateStorage()}setLogin(e){this.state.login=e.toLoginProps(),this.updateStorage()}setMenuTabTags(e){this.state.menuTabTags=e,this.updateStorage()}updateCloudAccess(){this.state.cloudAccess.count++,this.isToday(new Date(this.state.cloudAccess.date))||(this.state.cloudAccess.date=(new Date).getTime(),this.state.cloudAccess.count=0),this.updateStorage()}updateStorage(){let e={};e[t.SETTINGS]=this.state,chrome.storage.local.set(e)}isToday(e){const t=new Date;return e.getDate()==t.getDate()&&e.getMonth()==t.getMonth()&&e.getFullYear()==t.getFullYear()}}},1175:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e){this.windowState={expandedPanel:!1,expandedWindowMap:{}},this.windows=[],this.windowIdMap={},this.appContext=e}clean(){let e=this.getWindows(),t={};e.map((e=>{t[e.getId()]=e}));let n=[];return Object.keys(this.windowState.expandedWindowMap).map((e=>{null==t[e]&&n.push(e)})),n.map((e=>{delete this.windowState.expandedWindowMap[e]})),n.length}findTabByIndex(e,t){let n=this.findWindowById(e);return null!=n?n.getTabs()[t]:null}findWindowById(e){return this.windowIdMap[e]}getWindows(){return this.windows}isPanelExpanded(){return this.windowState.expandedPanel}isWindowExpanded(e){let t=this.windowState.expandedWindowMap[e.getId()];return null!=t&&t}removeWindow(e){let t=this.windows.filter((t=>t.getId()!=e.getId()));this.windows=t,null!=this.windowIdMap[e.getId()]&&delete this.windowIdMap[e.getId()]}search(e){let t=this.getWindows(),n=[],r={},i=e.toLowerCase();for(let o=0;o=0||a.getDescription().toLowerCase().search(i)>=0)&&(s=!0),this.searchTags(a.getTags(),e)&&(s=!0);let u=[];for(let e=0;e=0||t.getDescription().toLowerCase().search(i)>=0||null!=r.title&&r.title.toLowerCase().search(i)>=0||null!=r.url&&r.url.toLowerCase().search(i)>=0||this.searchTags(t.getTags(),i))&&(u.push(t),n.push(t))}if(u.length>0||s){let e={tabMap:{}};r[a.getId()]=e,u.map((t=>{e.tabMap[t.getId()]=t}))}}return{tabs:n,windowMap:r}}setPanelExpanded(e){this.windowState.expandedPanel=e,this.updateStorage()}setWindowExpanded(e,t){this.windowState.expandedWindowMap[e.getId()]=t,this.updateStorage()}setWindowsExpanded(e,t){e.map((e=>{this.windowState.expandedWindowMap[e.getId()]=t})),this.updateStorage()}addWindow(e){this.windows.push(e),this.windowIdMap[e.getId()]=e}getWindowState(){return this.windowState}setWindowState(e){this.windowState=e}searchTags(e,t){for(let n=0;n=0)return!0;return!1}}},4259:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7294)),o=r(n(3912)),a=r(n(2411)),s=r(n(6248)),l=r(n(814)),u=r(n(6222)),c=r(n(5249)),d=r(n(6366)),h=n(772),f=n(4007);t.default=function(e){const t=f.globalStyles(),n=e.appContext.getAccountService().getAccountData().account;let r=n.isPaymentDue()?"Subscription is due on "+h.formatDate(n.getPaymentDueDate()):"Subscription is paid until "+h.formatDate(n.getPaymentDueDate()),p="Number of purchased cloud collections: "+n.getBackupPurchased();return i.default.createElement("div",null,i.default.createElement(a.default,{fullWidth:!1,maxWidth:"md",open:!0,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},i.default.createElement(u.default,{id:"alert-dialog-title"},"Account"),i.default.createElement(l.default,{style:{minWidth:"350px"},dividers:!0},i.default.createElement(c.default,null,i.default.createElement(d.default,{id:"user",disabled:!0,value:n.getLogin().getEmail(),variant:"outlined",InputProps:{className:t.boldText}}),i.default.createElement(d.default,{id:"user",disabled:!0,value:r,variant:"outlined",InputProps:{className:t.boldText}}),i.default.createElement(d.default,{id:"user",disabled:!0,value:p,variant:"outlined",InputProps:{className:t.boldText}}))),i.default.createElement(s.default,null,i.default.createElement(o.default,{id:"buyButton",onClick:()=>{e.handleUpgrade()},color:"primary",autoFocus:!0},"Upgrade"),i.default.createElement(o.default,{id:"closeButton",onClick:()=>{e.handleClose()},color:"primary",autoFocus:!0},"Close"))))}},4684:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hasPaidBackup=t.purchaseCloudStorageMessage=void 0;const s=o(n(7294)),l=n(5828),u=a(n(3912)),c=a(n(2411)),d=a(n(6248)),h=a(n(814)),f=a(n(8101)),p=a(n(6222)),m=a(n(115)),g=o(n(8797)),v=n(3374),y=l.makeStyles((e=>({inputFile:{visibility:"hidden"}})));t.default=function(e){y();const t={changes:[],error:!1,loading:!1,message:"",needsOverwrite:!1,overWriteAll:!0},n=e.appContext.getPersistence(),[r,i]=s.useState(t);function o(e,t){return{collectionName:e,compareWindowResult:t,expanded:!1,overWrite:!0}}function a(e){i(Object.assign(Object.assign({},r),{error:!0,loading:!1,message:e}))}function l(e){const t=e.filter((e=>e.compareWindowResult.compareState!=v.CompareWindowState.IdenticalWindow)).length>0;i(Object.assign(Object.assign({},r),{changes:e,loading:!1,message:"",needsOverwrite:t}))}return s.useEffect((()=>{e.open?(i(Object.assign(Object.assign({},r),{error:!1,loading:!0,message:"Accessing Cloud Storage"})),n.authorize((()=>{n.getCollectionNames((t=>{!function(t){let r=e.appContext.getCollectionStore(),i=[],s=e.windows;t.length>0?n.getCollections(t,!1,(e=>{let t={};e.map((e=>{t[e.name]=e})),s.map((e=>{let n=e.getName(),a=t[n];if(null==a)i.push(o(n,m.default.getNewWindowCompareResult(null)));else{let t=r.compareWindows([a]);i.push(o(e.getName(),t[0]))}})),l(i)}),(e=>{a(e)})):(s.map((e=>{i.push(o(e.getName(),m.default.getNewWindowCompareResult(null)))})),l(i))}(t)}),(e=>{a(e)}))}),(e=>{a(e)}))):i(t)}),[e.open]),s.default.createElement("div",null,e.open&&s.default.createElement(c.default,{fullWidth:!1,maxWidth:"md",open:e.open,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},s.default.createElement(p.default,{id:"alert-dialog-title"},"Backup"),s.default.createElement(h.default,{style:{minWidth:"300px",overflowY:"hidden"}},(r.error||r.loading)&&s.default.createElement(f.default,{id:"alert-dialog-description"},r.message),!r.error&&!r.loading&&s.default.createElement(g.default,{backup:!0,changes:r.changes,needsOverwrite:r.needsOverwrite,overWriteAll:r.overWriteAll,overWriteAllLabel:"Save All",setOverWriteAll:function(){const e=!r.overWriteAll;g.setPersistenceOverWriteAll(r.changes,e),i(Object.assign(Object.assign({},r),{overWriteAll:e}))},setOverWriteWindow:function(e,t){let n=t.target.checked,o=g.setPersistenceOverWriteWindow(r.changes,e,n);i(Object.assign(Object.assign({},r),{overWriteAll:o}))},toggleExpanded:function(e){g.togglePanelExpansion(r.changes,e),i(Object.assign({},r))}})),!r.loading&&s.default.createElement(d.default,null,s.default.createElement(u.default,{id:"cancelButton",onClick:()=>{e.handleClose()},color:"primary"},"Cancel"),s.default.createElement(u.default,{id:"saveCloudButton",onClick:()=>{!function(){if(r.error)i(t),e.handleClose();else{let o=[];r.changes.forEach(((t,n,r)=>{t.overWrite&&t.compareWindowResult.compareState!=v.CompareWindowState.IdenticalWindow&&o.push(e.windows[n])})),i(Object.assign(Object.assign({},r),{error:!1,loading:!0,message:"Writing files"})),n.saveWindows(o,(()=>{i(t),e.handleClose()}),(e=>{i(Object.assign(Object.assign({},r),{error:!0,loading:!1,message:e}))}))}}()},color:"primary",autoFocus:!0},"OK"))))},t.purchaseCloudStorageMessage="Cloud storage needs to be purchased",t.hasPaidBackup=function(e,t,n){e.getAuthenticationService(),""!=t.getEmail()?e.getAccountService().findAccount(t).then((e=>{const t=e.account;if(null==t)return!1;n(!t.isPaymentDue()&&t.getBackupPurchased()>0)})):n(!1)}},3739:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=a(n(4731)),u=a(n(3592)),c=a(n(3912)),d=a(n(5851)),h=a(n(2411)),f=a(n(6248)),p=a(n(814)),m=a(n(6222)),g=a(n(6366));t.default=function(e){const[t,n]=s.useState(Object.assign(Object.assign({},e.data),{error:!1,message:""}));function r(e){return e.replace(/[^\x20-\x7E]/g,"")}return s.default.createElement("div",null,s.default.createElement(h.default,{fullWidth:!1,maxWidth:"md",open:!0,"aria-labelledby":"save-dialog-title","aria-describedby":"save-dialog-description"},s.default.createElement(m.default,{id:"save-dialog-title"},e.title),s.default.createElement(p.default,{dividers:!0},s.default.createElement(g.default,{autoFocus:!0,error:t.error,helperText:t.message,onChange:function(e){n(Object.assign(Object.assign({},t),{error:!1,message:"",name:e.target.value}))},margin:"dense",id:"name",label:"Name",type:"text",fullWidth:!0,variant:"outlined",value:t.name}),s.default.createElement(g.default,{autoFocus:!0,onChange:function(e){n(Object.assign(Object.assign({},t),{description:e.target.value}))},margin:"dense",id:"description",label:"Enter description",multiline:!0,rows:10,fullWidth:!0,variant:"outlined",value:t.description}),s.default.createElement("div",{style:{width:"100%"}},s.default.createElement(u.default,{multiple:!0,onChange:(e,i,o)=>{let a=r(i.toString());if(""!=a){let e=a.split(",");n(Object.assign(Object.assign({},t),{tags:e}))}else n(Object.assign(Object.assign({},t),{tags:[]}))},options:e.collectionStore.getTags().map((e=>e.tag)),value:t.tags,freeSolo:!0,renderTags:(e,t)=>e.map(((e,n)=>""!=r(e.toString())?s.default.createElement(d.default,Object.assign({variant:"outlined",label:e},t({index:n}))):null)),style:{width:500},renderInput:e=>s.default.createElement(g.default,Object.assign({},e,{margin:"dense",multiline:!0,variant:"outlined",label:"Tags",placeholder:"Tags"}))}))),s.default.createElement(f.default,null,s.default.createElement(c.default,{id:"closeButton",color:"primary",onClick:()=>{e.handleClose()}},"Cancel"),s.default.createElement(c.default,{id:"saveCollectionButton",color:"primary",autoFocus:!0,onClick:()=>{!function(){let r=t.name;""!=r?r.indexOf(".")>=0?n(Object.assign(Object.assign({},t),{error:!0,message:"Must not contain ."})):l.default(r)?e.isValidWindowName(t.name)?(e.save(t),n(Object.assign(Object.assign({},t),{name:"",description:""})),e.handleClose()):n(Object.assign(Object.assign({},t),{error:!0,message:"Duplicate name"})):n(Object.assign(Object.assign({},t),{error:!0,message:"Must be valid filename"})):n(Object.assign(Object.assign({},t),{error:!0,message:"Invalid name"}))}()}},"Save"))))}},8203:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=a(n(3957)),u=a(n(7237)),c=a(n(3912)),d=a(n(2719)),h=a(n(2411)),f=a(n(6248)),p=a(n(814)),m=a(n(8101)),g=a(n(6222)),v=a(n(5249)),y=a(n(5190)),b=a(n(64)),w=a(n(9069)),E=a(n(400)),_=n(4007);t.default=function(e){const t=_.globalStyles(),n=e.window,r=e.appContext.getCollectionStore(),[i,o]=s.useState(a());function a(){let t={changed:!1,changedPosition:!1,deletedTabState:[],newTabState:[],selectAll:!1};if(e.open&&null!=n.getParent()){let e=r.compareParentWindow(n);(e.changed||e.changedPosition)&&(t.changed=e.changed,t.changedPosition=e.changedPosition,e.deletedTabs.map((e=>{t.deletedTabState.push({select:!1,tab:e})})),e.newTabs.map((e=>{t.newTabState.push({select:!1,tab:e})})))}return t}function C(e,n,r){return s.default.createElement(s.default.Fragment,{key:r},s.default.createElement(u.default,{display:"flex",flexDirection:"row",width:"100%"},s.default.createElement(u.default,{width:"40px"},s.default.createElement(w.default,{title:"Select"},s.default.createElement(d.default,{color:"primary",id:"select"+r,checked:n.select,onClick:e=>e.stopPropagation(),onChange:e=>function(e,t){const n=!e.select,r=i.deletedTabState.length+i.newTabState.length;let a=!1,s=0;e.select=n,n&&(i.deletedTabState.map((e=>{e.select&&s++})),i.newTabState.map((e=>{e.select&&s++})),s==r&&(a=!0)),o(Object.assign(Object.assign({},i),{selectAll:a}))}(n)}))),s.default.createElement(u.default,{width:"5px"}),s.default.createElement(u.default,{style:{paddingTop:"10px"}},e&&s.default.createElement(l.default,null),!e&&s.default.createElement(b.default,null)),s.default.createElement(u.default,{width:"10px"}),s.default.createElement(u.default,{style:{paddingTop:"10px"}},s.default.createElement(E.default,{className:t.tabTitle},n.tab.getChromeTab().title))))}return s.useEffect((()=>{o(a())}),[e.open]),s.default.createElement("div",null,e.open&&s.default.createElement(h.default,{fullWidth:!1,maxWidth:"md",open:e.open,"aria-labelledby":"save-dialog-title","aria-describedby":"save-dialog-description"},s.default.createElement(g.default,{id:"save-dialog-title"},"Update Window"),i.changed&&s.default.createElement(p.default,{style:{minWidth:"300px",overflowY:"hidden"}},s.default.createElement(v.default,null,s.default.createElement(y.default,{control:s.default.createElement(d.default,{id:"selectAll",checked:i.selectAll,onChange:()=>function(){const e=!i.selectAll;i.deletedTabState.map((t=>{t.select=e})),i.newTabState.map((t=>{t.select=e})),o(Object.assign(Object.assign({},i),{selectAll:e}))}(),color:"primary"}),label:"Select all"}),s.default.createElement("br",null)),i.changed&&s.default.createElement(v.default,null,s.default.createElement("div",{className:t.panelContainer,style:{border:"1px solid",height:"400px",overflow:"scroll"}},i.newTabState.map(((e,t)=>C(!0,e,t))),i.deletedTabState.map(((e,t)=>C(!1,e,t)))))),!i.changed&&i.changedPosition&&s.default.createElement(p.default,{style:{minWidth:"300px"}},s.default.createElement(m.default,{id:"alert-dialog-description"},"Position Changes")),!(i.changed||i.changedPosition)&&s.default.createElement(p.default,{style:{minWidth:"300px"}},s.default.createElement(m.default,{id:"alert-dialog-description"},"No Changes")),s.default.createElement(f.default,null,s.default.createElement(c.default,{id:"closeButton",color:"primary",onClick:()=>{e.handleClose()}},"Cancel"),(i.changed||i.changedPosition)&&s.default.createElement(c.default,{id:"saveButton",color:"primary",autoFocus:!0,onClick:()=>{!function(){const e=n.getParent();r.updateParentWindow(n),i.deletedTabState.map((t=>{t.select&&r.deleteTab(e,t.tab)})),i.newTabState.map((t=>{t.select&&r.addTabAtEnd(e,t.tab)}))}(),e.handleClose()}},"Save"))))}},6118:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=o(n(2043)),u=a(n(7237)),c=a(n(8428)),d=a(n(9067)),h=a(n(4566)),f=a(n(9487)),p=a(n(2527)),m=a(n(6692)),g=a(n(9152)),v=a(n(1890)),y=a(n(7133)),b=a(n(6572)),w=a(n(3375)),E=a(n(3093)),_=a(n(9069)),C=a(n(400)),S=n(7623),x=n(4007),T=a(n(5479)),I=o(n(4684)),k=a(n(3739)),O=n(8939),P=a(n(873)),N=n(6050),A=a(n(2482)),D=a(n(9512)),R=n(4031);t.default=function(e){const[t,n]=s.useState(!1),[r,i]=s.useState(!1),[o,a]=s.useState(!1),[M,L]=s.useState(!1),[j,F]=s.useState({show:!1,window:null}),[W,B]=s.useState({name:"",description:"",open:!1,tab:null,tags:[]}),[z,U]=s.useState({message:"",severity:"success"}),V=e.window,[Z,$]=s.useState({name:"",description:"",open:!1,tags:[]}),q=x.globalStyles(),H=e.appContext,K=e.searchState,G=K.result.getCollectionMap(),Q=K.filter,Y=Q?G[V.getId()].tabMap:{},X=H.getClipBoard(),J=H.getLiveWindowStore(),ee=H.getCollectionStore(),te=V.getTabs(),ne=Q?function(e){return Object.keys(e).length}(Y):te.length;let re=ee.isWindowExpanded(V),[ie,oe]=s.useState(re),ae=ie?"Collapse":"Expand";function se(){L(!1)}function le(e){ee.setWindowExpanded(e,!ie),oe(!ie)}l.debug("Collection window id: "+V.getId()+" name "+V.getName()+" expandedWindow "+re+" expanded "+ie),re!=ie&&oe(re);const ue="Are you sure you want to delete the "+V.getName()+" Collection?",ce=Q?ne+" of "+te.length+" Tabs":ne+" Tabs";return s.default.createElement("div",{draggable:!0,className:q.panelContainer},t&&s.default.createElement(T.default,{handleCancel:function(){n(!1)},handleConfirm:function(){ee.removeWindow(V),n(!1)},title:"Delete Collection",text:ue}),r&&s.default.createElement(I.default,{appContext:H,open:r,handleClose:function(){i(!1)},windows:[V]}),W&&s.default.createElement(P.default,{data:W,collectionStore:ee,open:W.open,handleClose:function(){B({name:"",description:"",open:!1,tab:null,tags:[]})},save:function(e){ee.updateTab(e.tab,e.name,e.description,e.tags)},title:"Tab data"}),Z.open&&s.default.createElement(k.default,{data:Z,collectionStore:ee,handleClose:function(){$({name:"",description:"",open:!1,tags:[]})},isValidWindowName:function(e){return ee.findWindowsByName(e).length<=1},save:function(e){ee.updateWindow(V,e.name,e.description,e.tags)},title:"Collection data"}),o&&s.default.createElement(T.default,{handleCancel:()=>a(!1),handleConfirm:function(){a(!1)},okTitle:"Buy",title:"Buy Cloud Storage",text:I.purchaseCloudStorageMessage}),M&&s.default.createElement(A.default,Object.assign({},N.paymentProps,{appContext:H,handleCancel:se,handleClose:se})),j.show&&s.default.createElement(D.default,{appContext:H,open:!0,handleClose:function(){F({show:!1,window:null})},handleSend:function(e,t){H.getMessagingService().sendMessage(e).then((e=>{let n=e.message,r=t.getName()+" Collection has been shared with "+n.getToEmail(),i=e.error;i&&(r="Cannot share: "+e.errorMessage),F({show:!1,window:null}),U({message:r,severity:i?"error":"success"})}))},login:H.getSettingsStore().getLogin(),window:j.window}),""!=z.message&&s.default.createElement(R.Toast,{duration:3e3,handleClose:function(){U(Object.assign(Object.assign({},z),{message:""}))},message:z.message,open:!0,severity:z.severity,title:"Message"}),s.default.createElement(f.default,{expanded:ie,style:{margin:"0px"},className:q.panel},s.default.createElement(p.default,{className:q.panelSummary,onClick:e=>le(V),expandIcon:s.default.createElement(_.default,{title:ae},s.default.createElement(h.default,{id:"expandButton",onClick:e=>{le(V)}}))},s.default.createElement(u.default,{display:"flex",flexDirection:"row"},s.default.createElement(u.default,null,s.default.createElement(_.default,{title:"Delete"},s.default.createElement(v.default,{id:"deleteButton",className:q.iconButton,onClick:e=>{n(!0),e.stopPropagation()}},s.default.createElement(c.default,null)))),s.default.createElement(u.default,{width:"5px"}),s.default.createElement(u.default,null,s.default.createElement(_.default,{title:"Cloud Backup"},s.default.createElement(v.default,{id:"backupButton",className:q.iconButton,onClick:e=>{const t=H.getSettingsStore().getLogin();I.hasPaidBackup(H,t,(e=>{e?i(!0):a(!0)})),e.stopPropagation()}},s.default.createElement(w.default,null)))),s.default.createElement(u.default,{width:"5px"}),s.default.createElement(u.default,null,s.default.createElement(_.default,{title:"Share"},s.default.createElement(v.default,{id:"shareButton",className:q.iconButton,onClick:e=>{const t=H.getSettingsStore().getLogin();I.hasPaidBackup(H,t,(e=>{e?F({show:!0,window:V}):a(!0)})),e.stopPropagation()}},s.default.createElement(E.default,null)))),s.default.createElement(u.default,{width:"5px"}),s.default.createElement(u.default,null,s.default.createElement(_.default,{title:"Launch"},s.default.createElement(v.default,{id:"launchButton",className:q.iconButton,onClick:e=>{J.cloneCollection(V),e.stopPropagation()}},s.default.createElement(y.default,null)))),s.default.createElement(u.default,{width:"5px"}),s.default.createElement(u.default,null,s.default.createElement(_.default,{title:"Paste Tab"},s.default.createElement(v.default,{id:"pasteTabAtEndButton",className:q.iconButton,onClick:e=>{e.stopPropagation();const t=X.getTab();null!=t&&ee.addTabAtEnd(V,t)}},s.default.createElement(O.PasteIcon,null)))),s.default.createElement(u.default,{width:"5px"}),s.default.createElement(u.default,null,s.default.createElement(_.default,{title:"Edit"},s.default.createElement(v.default,{id:"editButton",className:q.iconButton,onClick:e=>{const t=V.getTags();e.stopPropagation(),$({name:V.getName(),description:V.getDescription(),open:!0,tags:Array.from(t)})}},s.default.createElement(d.default,null)))),s.default.createElement(u.default,{width:"15px"}),s.default.createElement(u.default,null,s.default.createElement(C.default,{className:q.windowHeading},s.default.createElement(b.default,{href:"#",color:"inherit",underline:"none",onClick:()=>le(V)},V.getName()," (",ce,")"))))),s.default.createElement(m.default,{className:q.panelDetail},s.default.createElement("div",{className:q.panelContainer},te.map(((e,t)=>{let n=e.getChromeTab(),r=S.createTabId(V,n,t);const i=Q&&function(e,t){return null==t[e.getId()]}(e,Y)?{style:{display:"none"}}:{};return s.default.createElement(s.default.Fragment,{key:t},s.default.createElement(u.default,Object.assign({display:"flex",id:r,flexDirection:"row",draggable:!0,onDragStart:e=>function(e){e.dataTransfer.setData("source",e.target.id)}(e),onDrop:e=>function(e){e.preventDefault();let t=e.dataTransfer.getData("source");null!=t&&S.dropTab(t,e.currentTarget.id,J,ee,(e=>{}))}(e),onDragOver:e=>e.preventDefault(),onMouseOver:()=>{return e=r,void(document.getElementById(e).style.backgroundColor="white");var e},onMouseOut:()=>{return e=r,void(document.getElementById(e).style.backgroundColor=x.PANEL_BACKGROUND_COLOR);var e}},i),s.default.createElement(u.default,{width:"15px",className:q.noshrink}),s.default.createElement(u.default,{className:q.noshrink},s.default.createElement(_.default,{title:"Delete"},s.default.createElement(v.default,{id:"deleteTabButton",className:q.iconButton,onClick:t=>{ee.deleteTab(V,e),t.stopPropagation()}},s.default.createElement(c.default,null)))),s.default.createElement(u.default,{width:"5px",className:q.noshrink}),s.default.createElement(u.default,{className:q.noshrink},s.default.createElement(_.default,{title:"Copy"},s.default.createElement(v.default,{id:"copyTabButton",className:q.iconButton,onClick:t=>{t.stopPropagation(),X.saveTab(e)}},s.default.createElement(O.CopyIcon,null)))),s.default.createElement(u.default,{width:"5px",className:q.noshrink}),s.default.createElement(u.default,{className:q.noshrink},s.default.createElement(_.default,{title:"Paste"},s.default.createElement(v.default,{id:"pasteTabButton",className:q.iconButton,onClick:e=>{e.stopPropagation();const n=X.getTab();null!=n&&ee.addTabAtPosition(V,n,t+1)}},s.default.createElement(O.PasteIcon,null)))),s.default.createElement(u.default,{width:"5px",className:q.noshrink}),s.default.createElement(u.default,{className:q.noshrink},s.default.createElement(_.default,{title:"Edit"},s.default.createElement(v.default,{id:"editTabButton",className:q.iconButton,onClick:t=>{t.stopPropagation(),B({name:e.getName(),description:e.getDescription(),open:!0,tab:e,tags:Array.from(e.getTags())})}},s.default.createElement(d.default,null)))),s.default.createElement(u.default,{width:"10px",className:q.noshrink}),s.default.createElement(u.default,{className:q.noshrink},null!=n.favIconUrl&&s.default.createElement(g.default,{classes:{root:q.iconRoot}},s.default.createElement("img",{className:q.imageIcon,src:n.favIconUrl})),null==n.favIconUrl&&s.default.createElement(g.default,null)),s.default.createElement(u.default,{width:"10px",className:q.noshrink}),s.default.createElement(u.default,null,null!=n.url&&s.default.createElement(b.default,{href:n.url,target:"_blank",className:q.url},s.default.createElement(C.default,{className:q.tabTitle},e.getName())),null==n.url&&s.default.createElement(C.default,{className:q.tabTitle},n.title))))}))))))}},9329:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=o(n(2043)),u=a(n(1673)),c=a(n(9594)),d=a(n(7237)),h=a(n(2215)),f=a(n(8428)),p=a(n(5025)),m=a(n(4566)),g=a(n(9487)),v=a(n(2527)),y=a(n(6692)),b=a(n(4545)),w=a(n(1890)),E=a(n(6572)),_=a(n(3375)),C=a(n(9069)),S=a(n(400)),x=n(4007),T=a(n(5479)),I=o(n(4684)),k=a(n(6118)),O=o(n(2980)),P=n(8939),N=n(6050),A=a(n(8392)),D=n(6889),R=n(1802),M=a(n(2482)),L=a(n(9056)),j=a(n(6375));t.default=function(e){const t=x.globalStyles(),[n,r]=s.useState(!1),[i,o]=s.useState(!1),[a,F]=s.useState(!1),[W,B]=s.useState(!1),[z,U]=s.useState(!1),[V,Z]=s.useState(!1),[$,q]=s.useState(!1),[H,K]=s.default.useState(O.getNoErrorState()),[G,Q]=s.useState(!1),Y=e.appContext,X=Y.getEventBus(),J=Y.getCollectionStore(),ee=e.searchState,te=ee.result.getCollectionMap(),ne=ee.filter,re=!!ne||J.isPanelExpanded(),[ie,oe]=s.useState(re),[ae,se]=s.useState(!1),le=J.getWindows().sort(((e,t)=>{let n=e.getName().toLowerCase(),r=t.getName().toLowerCase();return nr?1:0}));let ue=ie?"Collapse all":"Expand all",ce=ie?"Collapse":"Expand",de=ne?Object.keys(te).length:le.length,he=ne?"("+de+" of "+le.length+" contain your search term)":"("+de+")";function fe(){const e=Y.getSettingsStore().getLogin();Y.getAccountService().getAccount(e).then((e=>{null!=e.account&&e.account.isAdmin()&&se(!0)}))}function pe(){F(!1)}function me(){J.setPanelExpanded(!ie),oe(!ie)}l.debug("CollectionPanel expanded: "+ie),s.useEffect((()=>{function e(){l.debug("Saved Window update "+G),Q(!G)}return X.addEventListener(R.MessageType.CollectionUpdate,e),X.addEventListener(R.MessageType.Resize,e),X.addEventListener(R.MessageType.Login,fe),()=>{X.removeEventListener(R.MessageType.CollectionUpdate,e),X.removeEventListener(R.MessageType.Resize,e),X.removeEventListener(R.MessageType.Login,fe)}}),[G]);const ge={maxHeight:document.getElementById(D.LayoutComponent.CollectionContainer).getBoundingClientRect().height-64+"px"};return s.default.createElement("div",{className:t.panelContainer},n&&s.default.createElement(T.default,{handleCancel:function(){r(!1)},handleConfirm:function(){J.deleteAll(),r(!1)},title:"Delete Collections",text:"Are you sure you want to delete all Collections?"}),i&&s.default.createElement(I.default,{appContext:Y,open:i,handleClose:function(){o(!1)},windows:le}),W&&s.default.createElement(L.default,{appContext:Y,open:W,handleClose:()=>B(!1)}),z&&s.default.createElement(j.default,{appContext:Y,open:z,handleClose:()=>U(!1)}),V&&s.default.createElement(A.default,{appContext:Y,handleClose:()=>Z(!1)}),$&&s.default.createElement(T.default,{handleCancel:()=>q(!1),handleConfirm:function(){q(!1),F(!0)},okTitle:"Buy",title:"Buy Cloud Storage",text:I.purchaseCloudStorageMessage}),a&&s.default.createElement(M.default,Object.assign({},N.paymentProps,{appContext:Y,handleCancel:pe,handleClose:pe})),H.error&&s.default.createElement(O.default,Object.assign({},H,{appContext:Y,handleClose:null})),s.default.createElement(g.default,{expanded:ie,style:{margin:"0px"},className:t.panel},s.default.createElement(v.default,{className:t.windowSummary,onClick:e=>me(),"aria-controls":"panel1a-content",id:"panel1a-header"},s.default.createElement(d.default,{display:"flex",flexDirection:"row",width:"100%"},s.default.createElement(d.default,null,s.default.createElement(C.default,{title:"Delete"},s.default.createElement(w.default,{id:"deleteButton",className:t.iconButton,onClick:e=>{r(!0),e.stopPropagation()}},s.default.createElement(f.default,null)))),s.default.createElement(d.default,{width:"5px"}),s.default.createElement(d.default,null,s.default.createElement(C.default,{title:"Cloud Backup"},s.default.createElement(w.default,{className:t.iconButton,onClick:e=>{const t=Y.getSettingsStore().getLogin();I.hasPaidBackup(Y,t,(e=>{e?o(!0):q(!0)})),e.stopPropagation()}},s.default.createElement(_.default,null)))),s.default.createElement(d.default,{width:"5px"}),s.default.createElement(d.default,null,s.default.createElement(C.default,{title:"Cloud Restore"},s.default.createElement(w.default,{className:t.iconButton,onClick:e=>{const t=Y.getSettingsStore().getLogin();I.hasPaidBackup(Y,t,(e=>{e?B(!0):q(!0)})),e.stopPropagation()}},s.default.createElement(P.FileRestoreIcon,null)))),s.default.createElement(d.default,{width:"5px"}),s.default.createElement(d.default,null,s.default.createElement(C.default,{title:"View Cloud Collections"},s.default.createElement(w.default,{id:"viewCloudButton",className:t.iconButton,onClick:e=>{const t=Y.getSettingsStore().getLogin();I.hasPaidBackup(Y,t,(e=>{e?U(!0):q(!0)})),e.stopPropagation()}},s.default.createElement(h.default,null)))),ae&&s.default.createElement(d.default,null,s.default.createElement(C.default,{title:"Import"},s.default.createElement(w.default,{className:t.iconButton,onClick:e=>{Z(!0),e.stopPropagation()}},s.default.createElement(b.default,null)))),s.default.createElement(d.default,{width:"10px"}),s.default.createElement(d.default,null,s.default.createElement(S.default,{className:t.panelHeading},s.default.createElement(E.default,{href:"#",color:"inherit",underline:"none",onClick:()=>me()},"Collections ",he))),s.default.createElement(d.default,{flexGrow:"1"}),s.default.createElement(d.default,null,s.default.createElement(C.default,{title:ue},s.default.createElement(w.default,{id:"expandAllCollectionButton",className:t.iconButton,onClick:e=>{!function(){let e=!ie;J.setWindowsExpanded(le,e),J.setPanelExpanded(e),oe(e)}(),e.stopPropagation()}},ie&&s.default.createElement(c.default,null),!ie&&s.default.createElement(u.default,null)))),s.default.createElement(d.default,{width:"5px"}),s.default.createElement(d.default,null,s.default.createElement(C.default,{title:ce},s.default.createElement(w.default,{id:"expandCollectionButton",className:t.iconButton,onClick:e=>{me(),e.stopPropagation()}},ie&&s.default.createElement(p.default,null),!ie&&s.default.createElement(m.default,null)))))),s.default.createElement(y.default,{className:t.windowDetail,style:ge},le.map(((e,t)=>{let n=!0;return ne&&(n=null!=te[e.getId()]),s.default.createElement(s.default.Fragment,{key:t},n&&s.default.createElement(k.default,{appContext:Y,searchState:ee,window:e}))})))))}},7623:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dropTab=t.createTabId=void 0;const r=n(1802),i=String.fromCharCode(6);t.createTabId=function(e,t,n){return(e.isLive()?r.LIVE:r.SAVED)+i+e.getId()+i+t.id+i+n},t.dropTab=function(e,t,n,o,a){let s=t.split(i),l=e.split(i);if(s.length==l.length)if(l[0]==s[0])l[0]==r.LIVE?n.moveTab(+l[2],+s[1],+s[3]):o.moveTab(l[1],+l[3],s[1],+s[3]);else if(l[0]==r.LIVE){let e=n.findTabByIndex(l[1],+l[3]);null!=e&&o.copyTab(e,s[1],+s[3])}else{let e=o.findTabByIndex(l[1],+l[3]);null!=e&&n.copyTab(e,+s[1],+s[3])}}},2980:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getNoErrorState=void 0;const s=o(n(7294)),l=a(n(3912)),u=a(n(2411)),c=a(n(6248)),d=a(n(814)),h=a(n(8101)),f=a(n(6222)),p=a(n(2466)),m=a(n(6366));t.getNoErrorState=function(){return{column:0,error:!1,line:0,message:"",stackTrace:""}},t.default=function(e){const[t,n]=s.useState(window.navigator.onLine?{email:"",message:e.error?"A Runtime error has occurred.":"",trace:e.error?e.stackTrace:""}:{email:"",message:"No network connection",trace:""});return s.useEffect((()=>{e.appContext.getAccountService().getSystemSettings().then((e=>{if(!e.error){const r="%0D%0A%0D%0A",i="mailto:"+e.systemSettings.email+"?subject=ForgetMeNot Error&body="+t.message+r+"Trace:"+r+t.trace;n(Object.assign(Object.assign({},t),{email:i}))}}))}),[]),s.default.createElement("div",null,e.error&&s.default.createElement(u.default,{open:e.error,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},s.default.createElement(f.default,{id:"alert-dialog-title"},"Error"),s.default.createElement(d.default,null,s.default.createElement(h.default,{id:"alert-dialog-description"},t.message),""!=t.trace&&s.default.createElement(m.default,{autoFocus:!0,margin:"dense",multiline:!0,rows:5,fullWidth:!0,variant:"outlined",value:t.trace}),s.default.createElement("br",null),s.default.createElement("br",null),""!=t.email&&s.default.createElement(l.default,{variant:"contained",color:"primary",href:t.email,size:"medium",startIcon:s.default.createElement(p.default,null)},"Please email error")),s.default.createElement(c.default,null,null!=e.handleClose&&s.default.createElement(l.default,{id:"closeButton",onClick:()=>{e.handleClose()},color:"primary",autoFocus:!0},"OK"))))}},4007:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.globalStyles=t.PANEL_BACKGROUND_COLOR=void 0;const r=n(5828);t.PANEL_BACKGROUND_COLOR="#e6e6e6",t.globalStyles=r.makeStyles((e=>({appBarBgColor:{backgroundColor:"#6b5b95"},boldText:{color:"black !important",fontWeight:"bold"},expanded:{minHeight:0},imageIcon:{height:"100%"},iconRoot:{textAlign:"center"},iconButton:{padding:"0px"},noshrink:{flexShrink:0},panel:{width:"100%"},panelSummary:{backgroundColor:"#a2b9bc",margin:"0px",minHeight:"0px","&$expanded":{minHeight:0}},panelHeading:{color:"white",fontSize:e.typography.pxToRem(15),fontWeight:e.typography.fontWeightRegular},panelDetail:{backgroundColor:t.PANEL_BACKGROUND_COLOR,flexWrap:"wrap",padding:"10px 16px 10px"},panelContainer:{width:"100%","& .MuiExpansionPanelSummary-root:hover":{cursor:"default"}},searchSummary:{backgroundColor:"#5c8a71",minHeight:"0px","&$expanded":{minHeight:0}},tabTitle:{color:"black",fontSize:e.typography.pxToRem(14),fontWeight:e.typography.fontWeightRegular},windowDetail:{backgroundColor:"#e1e1e1",flexWrap:"wrap",overflowY:"auto",padding:"0px 0px 0px"},windowHeading:{fontSize:e.typography.pxToRem(14),fontWeight:e.typography.fontWeightRegular},windowSummary:{backgroundColor:"#b2ad7f",minHeight:"0px","&$expanded":{minHeight:0}},url:{textDecoration:"none"}})))},8939:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PasteIcon=t.NotEqualIcon=t.FilterIcon=t.FileRestoreIcon=t.EqualIcon=t.CopyIcon=void 0;const i=r(n(7294)),o=r(n(2015));t.CopyIcon=function(e){return i.default.createElement(o.default,Object.assign({},e),i.default.createElement("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}))},t.EqualIcon=function(e){return i.default.createElement(o.default,Object.assign({},e),i.default.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}))},t.FileRestoreIcon=function(e){return i.default.createElement(o.default,Object.assign({},e),i.default.createElement("path",{d:"M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M12,18C9.95,18 8.19,16.76 7.42,15H9.13C9.76,15.9 10.81,16.5 12,16.5A3.5,3.5 0 0,0 15.5,13A3.5,3.5 0 0,0 12,9.5C10.65,9.5 9.5,10.28 8.9,11.4L10.5,13H6.5V9L7.8,10.3C8.69,8.92 10.23,8 12,8A5,5 0 0,1 17,13A5,5 0 0,1 12,18Z"}))},t.FilterIcon=function(e){return i.default.createElement(o.default,Object.assign({},e),i.default.createElement("path",{d:"M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z"}))},t.NotEqualIcon=function(e){return i.default.createElement(o.default,Object.assign({},e),i.default.createElement("path",{d:"M14.08,4.61L15.92,5.4L14.8,8H19V10H13.95L12.23,14H19V16H11.38L9.92,19.4L8.08,18.61L9.2,16H5V14H10.06L11.77,10H5V8H12.63L14.08,4.61Z"}))},t.PasteIcon=function(e){return i.default.createElement(o.default,Object.assign({},e),i.default.createElement("path",{d:"M19 2h-4.18C14.4.84 13.3 0 12 0c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm7 18H5V4h2v3h10V4h2v16z"}))}},8193:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7294)),o=r(n(3957)),a=r(n(3912)),s=r(n(7237)),l=r(n(2719)),u=r(n(2411)),c=r(n(6248)),d=r(n(814)),h=r(n(6222)),f=r(n(4566)),p=r(n(9487)),m=r(n(2527)),g=r(n(6692)),v=r(n(5249)),y=r(n(5190)),b=r(n(64)),w=r(n(9069)),E=r(n(400)),_=n(4007),C=n(8939),S=n(3374);t.default=function(e){const t=_.globalStyles(),n=e.appContext.getCollectionStore(),[r,x]=i.default.useState(function(){const t={needsOverwrite:!1,overWriteAll:!1,confirmWindowStates:[]};return n.compareWindows(e.windows).map((e=>{e.compareState==S.CompareWindowState.ChangedWindow&&(t.needsOverwrite=!0),t.confirmWindowStates.push({expanded:!1,overWrite:!1,compareWindowResult:e})})),t}()),T=n.compareWindows(e.windows).filter((e=>e.compareState==S.CompareWindowState.ChangedWindow)).length>0;function I(e,n,r,a){return i.default.createElement(i.default.Fragment,{key:a},i.default.createElement(s.default,{display:"flex",flexDirection:"row",width:"100%"},i.default.createElement(s.default,null,n&&i.default.createElement(o.default,null),!n&&i.default.createElement(b.default,null)),i.default.createElement(s.default,{width:"5px"}),i.default.createElement(s.default,{fontStyle:"italic"},i.default.createElement(E.default,{className:t.tabTitle},e)),i.default.createElement(s.default,{width:"10px"}),i.default.createElement(s.default,null,i.default.createElement(E.default,{className:t.tabTitle},r))))}function k(e,t,n){return I("Tab:",e,t,n)}function O(e,t,n){return I("Tab Tag:",e,t,n)}function P(e,t,n){return I(e,!0,t,n)}function N(e,t,n){return I("Window Tag:",e,t,n)}let A=0;return i.default.createElement(u.default,{fullWidth:!1,maxWidth:"md",open:!0,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},i.default.createElement(h.default,{id:"alert-dialog-title"},"Restore"),i.default.createElement(d.default,{style:{minWidth:"300px"}},T&&i.default.createElement(v.default,null,i.default.createElement(y.default,{control:i.default.createElement(l.default,{id:"overWriteAll",checked:r.overWriteAll,onChange:()=>function(){const e=!r.overWriteAll;r.confirmWindowStates.map((t=>{t.compareWindowResult.compareState==S.CompareWindowState.ChangedWindow&&(t.overWrite=e)})),x(Object.assign(Object.assign({},r),{overWriteAll:e}))}(),color:"primary"}),label:"Overwrite all"}),i.default.createElement("br",null)),i.default.createElement(v.default,null,i.default.createElement("div",{className:t.panelContainer,style:{border:"1px solid",height:"400px",overflow:"scroll"}},r.confirmWindowStates.map(((e,n)=>{const a=e.compareWindowResult.windowChanges,u=e.compareWindowResult.window,c="overWrite"+n;return i.default.createElement(i.default.Fragment,{key:n},e.compareWindowResult.compareState==S.CompareWindowState.ChangedWindow&&i.default.createElement(p.default,{expanded:e.expanded,style:{margin:"0px"},className:t.panel,onClick:e=>e.stopPropagation()},i.default.createElement(m.default,{className:t.panelSummary,expandIcon:i.default.createElement(f.default,null),onClick:t=>{return n=e,r.confirmWindowStates.map((e=>{e.compareWindowResult.window.id==n.compareWindowResult.window.id&&(e.expanded=!n.expanded)})),void x(Object.assign({},r));var n}},i.default.createElement(s.default,{display:"flex",flexDirection:"row",width:"100%"},i.default.createElement(s.default,{width:"40px"},i.default.createElement(w.default,{title:"Overwrite"},i.default.createElement(l.default,{color:"primary",id:c,checked:e.overWrite,onClick:e=>e.stopPropagation(),onChange:t=>function(e,t){let n=t.target.checked,i=0,o=0;r.confirmWindowStates.map((t=>{t.compareWindowResult.window.id==e.compareWindowResult.window.id&&(t.overWrite=n),t.compareWindowResult.compareState==S.CompareWindowState.ChangedWindow&&(i+=1,t.overWrite&&(o+=1))}));let a=r.overWriteAll;a=0!=o&&o==i,x(Object.assign(Object.assign({},r),{overWriteAll:a}))}(e,t)}))),i.default.createElement(s.default,{style:{paddingTop:"10px"}},i.default.createElement(C.NotEqualIcon,null)),i.default.createElement(s.default,{width:"5px"}),i.default.createElement(s.default,{style:{paddingTop:"10px"}},i.default.createElement(E.default,{className:t.panelHeading},e.compareWindowResult.window.name)),i.default.createElement(s.default,{flexGrow:"1"}))),i.default.createElement(g.default,{className:t.panelDetail},i.default.createElement("div",{className:t.panelContainer},a.nameChange&&P("Window name:",u.name,A++),a.descriptionChange&&P("Window description:",u.description,A++),a.newTabs.map((e=>k(!0,e.name,A++))),a.deletedTabs.map((e=>k(!1,e.getName(),A++))),a.newTags.map((e=>N(!0,e,A++))),a.updatedTags.map((e=>N(!0,e,A++))),a.deletedTags.map((e=>N(!1,e,A++))),a.changedTabs.map((e=>e.newTags.map((e=>O(!0,e,A++))))),a.changedTabs.map((e=>e.updatedTags.map((e=>O(!0,e,A++))))),a.changedTabs.map((e=>e.deletedTags.map((e=>O(!1,e,A++)))))))),e.compareWindowResult.compareState!=S.CompareWindowState.ChangedWindow&&i.default.createElement(p.default,{expanded:!1,style:{margin:"0px"},className:t.panel,onClick:e=>e.stopPropagation()},i.default.createElement(m.default,{className:t.panelSummary,onClick:e=>e.stopPropagation()},i.default.createElement(s.default,{display:"flex",flexDirection:"row",width:"100%"},i.default.createElement(s.default,null,e.compareWindowResult.compareState==S.CompareWindowState.IdenticalWindow&&i.default.createElement(C.EqualIcon,null),e.compareWindowResult.compareState==S.CompareWindowState.NewWindow&&i.default.createElement(o.default,null)),i.default.createElement(s.default,{width:"40px"}),i.default.createElement(s.default,{width:"5px"}),i.default.createElement(s.default,null,i.default.createElement(E.default,{className:t.panelHeading},e.compareWindowResult.window.name))))))}))))),i.default.createElement(c.default,null,i.default.createElement(a.default,{id:"closeButton",onClick:()=>{e.handleClose()},color:"primary",autoFocus:!0},"Cancel"),i.default.createElement(a.default,{id:"saveButton",onClick:()=>{!function(){let t=[];r.confirmWindowStates.map((e=>{let n=e.compareWindowResult;switch(n.compareState){case S.CompareWindowState.ChangedWindow:e.overWrite&&t.push(n.window);break;case S.CompareWindowState.NewWindow:t.push(n.window)}})),n.restoreWindows(t),e.handleClose()}()},color:"primary",autoFocus:!0},"Save")))}},8392:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7294)),o=r(n(3912)),a=r(n(2411)),s=r(n(6248)),l=r(n(814)),u=r(n(6222)),c=r(n(5249)),d=r(n(6366)),h=r(n(8193));t.default=function(e){const[t,n]=i.default.useState({error:"",windows:[]});return i.default.createElement("div",null,0==t.windows.length&&i.default.createElement(a.default,{fullWidth:!1,maxWidth:"md",open:!0,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},i.default.createElement(u.default,{id:"alert-dialog-title"},"Import"),i.default.createElement(l.default,{style:{minWidth:"300px"}},i.default.createElement(c.default,null,i.default.createElement("input",{style:{display:"none"},id:"fileUpload",type:"file",ref:e=>{},onChange:e=>function(e){let r=e.files,i=new FileReader;i.onload=function(r){let i=r.target.result.toString();e.value="";try{let e=JSON.parse(i);if(null==e.name)return void n(Object.assign(Object.assign({},t),{error:"Invalid file"}));n(Object.assign(Object.assign({},t),{windows:[e]}))}catch(e){n(Object.assign(Object.assign({},t),{error:e.message}))}},i.readAsText(r[0])}(e.target)}),i.default.createElement("label",{htmlFor:"fileUpload"},i.default.createElement(o.default,{variant:"contained",id:"selectFile",color:"primary",component:"span"},"Select file"))),i.default.createElement("br",null),i.default.createElement(c.default,null,""!=t.error&&i.default.createElement(d.default,{error:!0,disabled:!0,fullWidth:!0,type:"text",value:t.error}))),i.default.createElement(s.default,null,i.default.createElement(o.default,{id:"cancelButton",onClick:()=>{n(Object.assign(Object.assign({},t),{windows:[]})),e.handleClose()},color:"primary",autoFocus:!0},"Cancel"))),t.windows.length>0&&i.default.createElement(h.default,{appContext:e.appContext,handleClose:close,windows:t.windows}))}},9834:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=a(n(3912)),u=a(n(2411)),c=a(n(6248)),d=a(n(814)),h=a(n(8101)),f=a(n(6222)),p=a(n(5249)),m=n(4007),g=a(n(4709));t.default=function(e){const t=m.globalStyles(),[n,r]=s.useState({error:!1,license:"",message:""});return s.useEffect((()=>{fetch("./eula.html").then((e=>e.text())).then((e=>{r(Object.assign(Object.assign({},n),{license:e}))})).catch((e=>{r(Object.assign(Object.assign({},n),{error:!0,message:e.message}))}))}),[]),s.default.createElement("div",null,s.default.createElement(u.default,{fullWidth:!1,maxWidth:"md",open:!0,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},s.default.createElement(f.default,{id:"alert-dialog-title"},"License Agreement"),s.default.createElement(d.default,{style:{minWidth:"400px",maxWidth:"600px"}},n.error&&s.default.createElement(h.default,{id:"alert-dialog-description"},s.default.createElement(g.default,{severity:"error"},n.message)),!n.error&&s.default.createElement(p.default,{className:t.panelSummary},s.default.createElement("div",{className:t.panelContainer,style:{border:"1px solid",height:"400px",overflow:"scroll"}},""!=n.license&&s.default.createElement("div",{dangerouslySetInnerHTML:(i=n.license,{__html:i})})))),s.default.createElement(c.default,null,s.default.createElement(l.default,{id:"acceptLicenseButton",onClick:()=>{e.handleAccept()},color:"primary",autoFocus:!0},"Agree"))));var i}},8119:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=o(n(2043)),u=a(n(3957)),c=a(n(7237)),d=a(n(366)),h=a(n(4566)),f=a(n(9487)),p=a(n(2527)),m=a(n(6692)),g=a(n(5612)),v=a(n(9152)),y=a(n(1890)),b=a(n(7133)),w=a(n(6572)),E=a(n(9579)),_=a(n(3246)),C=a(n(3375)),S=a(n(9069)),x=a(n(400)),T=n(7623),I=n(4007),k=a(n(5479)),O=a(n(3739)),P=a(n(8203)),N=n(8939);t.default=function(e){const[t,n]=s.useState(!1),[r,i]=s.useState(!1),[o,a]=s.useState(!1),A=I.globalStyles(),D=e.window,R=e.appContext,M=e.searchState,L=M.result.getLiveWindowMap(),j=M.filter,F=j?L[D.getId()].tabMap:{},W=R.getClipBoard(),B=R.getLiveWindowStore(),z=R.getCollectionStore(),U=D.getChromeWindow(),V=D.getTabs(),Z=j?function(e){return Object.keys(e).length}(F):V.length;let $=B.isWindowExpanded(D),[q,H]=s.useState($),K=q?"Collapse":"Expand";function G(e){B.setWindowExpanded(e,!q),H(!q)}l.debug("Live window "+U.id+" expandedWindow "+$+" expanded "+q),$!=q&&H($);const Q="Minimise",Y="normal"==U.state?Q:"Restore",X=j?Z+" of "+V.length+" Tabs":Z+" Tabs",J=null==D.getParent()?"":" (Linked with "+function e(t){return null==t.getParent()?t.getName():e(t.getParent())}(D)+")";return s.default.createElement("div",{draggable:!0,className:A.panelContainer},t&&s.default.createElement(k.default,{handleCancel:function(){n(!1)},handleConfirm:function(){B.close(D,(()=>n(!1)))},title:"Close Window",text:"Are you sure you want to close the window?"}),r&&s.default.createElement(O.default,{data:{name:"",description:"",tags:[]},collectionStore:z,handleClose:function(){i(!1)},isValidWindowName:function(e){return 0==z.findWindowsByName(e).length},save:function(e){z.saveWindow(e.name,e.description,e.tags,D)},title:"Collection data"}),o&&s.default.createElement(P.default,{appContext:R,open:o,handleClose:function(){a(!1)},window:D}),s.default.createElement(f.default,{expanded:q,style:{margin:"0px"},className:A.panel},s.default.createElement(p.default,{className:A.panelSummary,onClick:e=>G(D),expandIcon:s.default.createElement(S.default,{title:K},s.default.createElement(h.default,{id:"expandButton",onClick:e=>{G(D)}}))},s.default.createElement(c.default,{display:"flex",flexDirection:"row"},s.default.createElement(c.default,null,s.default.createElement(S.default,{title:"Close"},s.default.createElement(y.default,{id:"closeButton",className:A.iconButton,onClick:e=>{n(!0),e.stopPropagation()}},s.default.createElement(d.default,null)))),s.default.createElement(c.default,{width:"5px"}),s.default.createElement(c.default,null,s.default.createElement(S.default,{title:"Save"},s.default.createElement(y.default,{id:"saveButton",className:A.iconButton,onClick:e=>{""!=J?a(!0):i(!0),e.stopPropagation()}},s.default.createElement(C.default,null)))),s.default.createElement(c.default,{width:"5px"}),s.default.createElement(c.default,null,s.default.createElement(S.default,{title:"Duplicate"},s.default.createElement(y.default,{id:"duplicateButton",className:A.iconButton,onClick:e=>{B.duplicateLiveWindow(D),e.stopPropagation()}},s.default.createElement(b.default,null)))),s.default.createElement(c.default,{width:"5px"}),s.default.createElement(c.default,null,s.default.createElement(S.default,{title:"Focus"},s.default.createElement(y.default,{id:"focusButton",className:A.iconButton,onClick:e=>{B.focusWindow(D),e.stopPropagation()}},s.default.createElement(g.default,null)))),s.default.createElement(c.default,{width:"5px"}),s.default.createElement(c.default,null,s.default.createElement(S.default,{title:"New Tab"},s.default.createElement(y.default,{id:"newTabButton",className:A.iconButton,onClick:e=>{B.addTab(D),e.stopPropagation()}},s.default.createElement(u.default,null)))),s.default.createElement(c.default,{width:"5px"}),s.default.createElement(c.default,null,s.default.createElement(S.default,{title:"Paste Tab"},s.default.createElement(y.default,{id:"pasteTabAtEndButton",className:A.iconButton,onClick:e=>{e.stopPropagation();const t=W.getTab();null!=t&&B.addTabAtEnd(D,t)}},s.default.createElement(N.PasteIcon,null)))),s.default.createElement(c.default,{width:"5px"}),s.default.createElement(c.default,null,s.default.createElement(S.default,{title:Y},s.default.createElement(y.default,{id:"minimizeButton",className:A.iconButton,onClick:e=>{Y===Q?B.minimize(D):B.restore(D),e.stopPropagation()}},Y===Q&&s.default.createElement(E.default,null),Y!=Q&&s.default.createElement(_.default,null)))),s.default.createElement(c.default,{width:"15px"}),s.default.createElement(c.default,null,s.default.createElement(x.default,{className:A.windowHeading},s.default.createElement(w.default,{href:"#",color:"inherit",underline:"none",onClick:()=>G(D)},U.focused&&s.default.createElement("span",null,"Current")," Window (",X,") ",J))))),s.default.createElement(m.default,{className:A.panelDetail},s.default.createElement("div",{className:A.panelContainer},V.map(((e,t)=>{const n=e.getChromeTab(),r=T.createTabId(D,n,t),i=j&&function(e,t){return null==t[e.getId()]}(e,F)?{style:{display:"none"}}:{};return s.default.createElement(s.default.Fragment,{key:t},s.default.createElement(c.default,Object.assign({display:"flex",id:r,flexDirection:"row",draggable:!0,onDragStart:e=>function(e){e.dataTransfer.setData("source",e.target.id)}(e),onDrop:e=>function(e){e.preventDefault();let t=e.dataTransfer.getData("source");null!=t&&T.dropTab(t,e.currentTarget.id,B,z,(e=>{}))}(e),onDragOver:e=>e.preventDefault(),onMouseOver:()=>{return e=r,void(document.getElementById(e).style.backgroundColor="white");var e},onMouseOut:()=>{return e=r,void(document.getElementById(e).style.backgroundColor=I.PANEL_BACKGROUND_COLOR);var e}},i),s.default.createElement(c.default,{width:"15px",className:A.noshrink}),s.default.createElement(c.default,null,s.default.createElement(S.default,{title:"Close"},s.default.createElement(y.default,{id:"closeTabButton",className:A.iconButton,onClick:t=>{B.deleteTab(D,e),t.stopPropagation()}},s.default.createElement(d.default,null)))),s.default.createElement(c.default,{width:"5px",className:A.noshrink}),s.default.createElement(c.default,{className:A.noshrink},s.default.createElement(S.default,{title:"Copy"},s.default.createElement(y.default,{id:"copyTabButton",className:A.iconButton,onClick:t=>{t.stopPropagation(),W.saveTab(e)}},s.default.createElement(N.CopyIcon,null)))),s.default.createElement(c.default,{width:"5px",className:A.noshrink}),s.default.createElement(c.default,{className:A.noshrink},s.default.createElement(S.default,{title:"Paste"},s.default.createElement(y.default,{id:"pasteTabButton",className:A.iconButton,onClick:e=>{e.stopPropagation();const t=W.getTab();null!=t&&B.addTabAtPosition(D,t,n.index+1)}},s.default.createElement(N.PasteIcon,null)))),s.default.createElement(c.default,{width:"5px",className:A.noshrink}),s.default.createElement(c.default,null,s.default.createElement(S.default,{title:"Focus"},s.default.createElement(y.default,{id:"focusTabButton",className:A.iconButton,onClick:t=>{B.restore(D),B.focusTab(e),t.stopPropagation()}},s.default.createElement(g.default,null)))),s.default.createElement(c.default,{width:"10px",className:A.noshrink}),s.default.createElement(c.default,null,null!=n.favIconUrl&&s.default.createElement(v.default,{classes:{root:A.iconRoot}},s.default.createElement("img",{className:A.imageIcon,src:n.favIconUrl})),null==n.favIconUrl&&s.default.createElement(v.default,null)),s.default.createElement(c.default,{width:"10px",className:A.noshrink}),s.default.createElement(c.default,null,null!=n.url&&s.default.createElement(w.default,{href:n.url,target:"_blank",className:A.url},s.default.createElement(x.default,{className:A.tabTitle},n.title)),null==n.url&&s.default.createElement(x.default,{className:A.tabTitle},n.title))))}))))))}},1259:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=o(n(2043)),u=a(n(1673)),c=a(n(9594)),d=a(n(7237)),h=a(n(366)),f=a(n(5025)),p=a(n(4566)),m=a(n(9487)),g=a(n(2527)),v=a(n(6692)),y=a(n(1890)),b=a(n(7133)),w=a(n(6572)),E=a(n(9069)),_=a(n(400)),C=n(4007),S=a(n(5479)),x=o(n(2980)),T=n(6050),I=a(n(8119)),k=n(6889),O=n(1802),P=a(n(2482));t.default=function(e){const t=C.globalStyles(),[n,r]=s.useState(!1),i=e.appContext,o=i.getAccountService(),a=i.getEventBus(),N=i.getLiveWindowStore(),A=e.searchState,D=A.result.getLiveWindowMap(),R=A.filter,M=!!R||N.isPanelExpanded(),[L,j]=s.useState(M),[F,W]=s.useState(!1),B=N.getWindows(),[z,U]=s.useState(!1),[V,Z]=s.default.useState(x.getNoErrorState());let $=L?"Collapse all":"Expand all",q=L?"Collapse":"Expand",H=R?Object.keys(D).length:B.length,K=R?"("+H+" of "+B.length+" contain your search term)":"("+H+")";function G(){const e=i.getSettingsStore().getLogin();""==e.getEmail()||F||o.getAccount(e).then((e=>{if(null==e.error){let t=e.account;null!=t&&o.isPaymentDue(t)&&W(!0)}else t=e.error,Z({column:0,error:!0,line:0,message:t.message,stackTrace:t.stack?t.stack:""});var t}))}function Q(){U(!1)}function Y(){N.setPanelExpanded(!L),j(!L)}l.debug("LiveWindowPanel expanded: "+L),s.useEffect((()=>{function e(){l.debug("Live Window update "+n),G(),r(!n)}return a.addEventListener(O.MessageType.LiveWindowUpdate,e),a.addEventListener(O.MessageType.Resize,e),a.addEventListener(O.MessageType.Login,G),()=>{a.removeEventListener(O.MessageType.LiveWindowUpdate,e),a.removeEventListener(O.MessageType.Resize,e),a.removeEventListener(O.MessageType.Login,G)}}),[n]);let X={maxHeight:document.getElementById(k.LayoutComponent.WindowContainer).getBoundingClientRect().height-64+"px"};return s.default.createElement("div",{className:t.panelContainer},V.error&&s.default.createElement(x.default,Object.assign({},V,{appContext:i,handleClose:null})),z&&s.default.createElement(S.default,{handleCancel:Q,handleConfirm:function(){N.closeAllWindows(),Q()},title:"Close All Windows",text:"Are you sure you want to close all windows?"}),F&&s.default.createElement(P.default,Object.assign({},T.paymentProps,{appContext:i,handleClose:function(){W(!1)}})),s.default.createElement(m.default,{expanded:L,style:{margin:"0px"},className:t.panel},s.default.createElement(g.default,{className:t.windowSummary,onClick:e=>Y(),"aria-controls":"panel1a-content",id:"panel1a-header"},s.default.createElement(d.default,{display:"flex",flexDirection:"row",width:"100%"},s.default.createElement(d.default,null,s.default.createElement(E.default,{title:"New Window"},s.default.createElement(y.default,{id:"newWindowButton",className:t.iconButton,onClick:e=>{N.newWindow(),e.stopPropagation()}},s.default.createElement(b.default,null)))),s.default.createElement(d.default,{width:"5px"}),s.default.createElement(d.default,null,s.default.createElement(E.default,{title:"Close All Windows"},s.default.createElement(y.default,{id:"closeButton",className:t.iconButton,onClick:e=>{U(!0),e.stopPropagation()}},s.default.createElement(h.default,null)))),s.default.createElement(d.default,{width:"10px"}),s.default.createElement(d.default,null,s.default.createElement(_.default,{className:t.panelHeading},s.default.createElement(w.default,{href:"#",color:"inherit",underline:"none",onClick:()=>Y()},"Windows ",K))),s.default.createElement(d.default,{flexGrow:"1"}),s.default.createElement(d.default,null,s.default.createElement(E.default,{title:$},s.default.createElement(y.default,{id:"expandAllWindowButton",className:t.iconButton,onClick:e=>{!function(){let e=!L;N.setWindowsExpanded(B,e),N.setPanelExpanded(e),j(e)}(),e.stopPropagation()}},L&&s.default.createElement(c.default,null),!L&&s.default.createElement(u.default,null)))),s.default.createElement(d.default,{width:"5px"}),s.default.createElement(d.default,null,s.default.createElement(E.default,{title:q},s.default.createElement(y.default,{id:"expandWindowButton",className:t.iconButton,onClick:e=>{Y(),e.stopPropagation()}},L&&s.default.createElement(f.default,null),!L&&s.default.createElement(p.default,null)))))),s.default.createElement(v.default,{className:t.windowDetail,style:X},B.map(((e,t)=>{let n=!0;return R&&(n=null!=D[e.getId()]),s.default.createElement(s.default.Fragment,{key:t},n&&s.default.createElement(I.default,{appContext:i,searchState:A,window:e}))})))))}},2974:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=a(n(5479)),u=o(n(2980)),c=n(772),d=n(8280),h=n(7849),f=a(n(983)),p=n(1802),m=n(4031);t.default=function(e){const t=e.appContext,n=t.getAuthenticationService(),r=t.getAccountService(),i=t.getSettingsStore(),[o,a]=s.useState(""),[g,v]=s.default.useState(!0),[y,b]=s.default.useState(u.getNoErrorState()),[w,E]=s.useState(function(){let e=i.getLogin(),t=e.getEmail(),r=(e.getPassword(),""==e.getEmail()),a=!1;return r||""==t?a=!0:!y.error&&g&&""==o&&function(e){let t=e.getEmail(),r=e.getPassword();n.isAlreadyRegistered(t).then((t=>{v(!1),t?n.login(e.getEmail(),r,(t=>{t.error&&""==w.loginError?E(Object.assign(Object.assign({},w),{loginError:t.message,showLogin:!0,verified:t.verified})):I(e)})):E(Object.assign(Object.assign({},w),{loginError:"Not registered",register:!0,showLogin:!0}))})).catch((e=>{T(e)}))}(e),{allowCancel:!1,login:e,loginError:"",register:r,showLogin:a,toast:"",verified:!0}}()),[_,C]=s.useState(!1),S=t.getEventBus();function x(e){const t=e?new d.Login("",""):w.login;C(!1),E(Object.assign(Object.assign({},w),{login:t,register:e,showLogin:!0}))}function T(e){b({column:0,error:!0,line:0,message:e.message,stackTrace:e.stack?e.stack:""})}function I(e){r.getAccount(e).then((t=>{null!=t.error?T(t.error):(null!=t.account&&t.account.updateLastLogin(),S.sendMessage(new f.default(e)),E(Object.assign(Object.assign({},w),{login:e,loginError:"",showLogin:!1})))}))}s.useEffect((()=>{function e(){let e=new d.Login(w.login.getEmail(),"");i.setLogin(e),r.logout(),C(!0),E(Object.assign(Object.assign({},w),{login:e,showLogin:!1}))}return S.addEventListener(p.MessageType.Logout,e),()=>{S.removeEventListener(p.MessageType.Logout,e)}}),[w]);const k={allowCancel:w.allowCancel,authService:n,loginError:w.loginError,open:w.showLogin,handleCancel:function(){},handleLogin:function(e){const t=new d.Login(e.email,e.password);i.setLogin(t),I(t)},handleLoginError:function(e){const t=new d.Login(e.email,e.password);E(Object.assign(Object.assign({},w),{login:t,loginError:e.message,register:!e.registered,showLogin:!0}))},handleRegistration:function(e){const t=e.email,n=(e.password,new d.Login(e.email,e.password));e.error?E(Object.assign(Object.assign({},w),{login:n,loginError:e.message,register:!e.registered,showLogin:!0})):(i.setLogin(n),v(!1),E(Object.assign(Object.assign({},w),{login:n,loginError:"",register:!1,showLogin:!1})),r.getSystemSettings().then((e=>{let n="An email has been sent to "+t+". Please verify your email";if(!e.error){const t=e.systemSettings,r=t.trialPeriodDays,i=t.annualSubscriptionPrice,o=t.annualSubscription;if(r>0&&(n+=" to start your "+r+" day trial. "),i>0){const e=o?"year":"month";n+="The subscription price is £"+c.formatCurrency(i)+" per "+e+"."}a(n)}})))},handleResendEmailVerification:function(e){E(Object.assign(Object.assign({},w),{toast:"Email verification has been resent to "+e.email}))},handleResetPassword:function(e){E(Object.assign(Object.assign({},w),{toast:"Password reset email sent to "+e.email}))},login:w.login,register:w.register,verified:w.verified};return s.default.createElement(s.default.Fragment,null,_&&s.default.createElement(l.default,{cancelTitle:"Register",okTitle:"Login",handleCancel:()=>x(!0),handleConfirm:()=>x(!1),title:"You have logged out",text:"Please Login or Register a new user"}),y.error&&s.default.createElement(u.default,Object.assign({},y,{appContext:t,handleClose:null})),w.showLogin&&s.default.createElement(h.LoginDialog,Object.assign({},k)),""!=w.toast&&s.default.createElement(m.Toast,{duration:3e3,handleClose:function(){E(Object.assign(Object.assign({},w),{toast:""}))},message:w.toast,open:!0,severity:"success",title:"Login"}),""!=o&&s.default.createElement(l.default,{handleConfirm:function(){a(""),E(Object.assign(Object.assign({},w),{register:!1,showLogin:!0}))},text:o,title:"Welcome"}))}},5827:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=a(n(7237)),u=a(n(3912)),c=a(n(8428)),d=a(n(2411)),h=a(n(6248)),f=a(n(814)),p=a(n(6222)),m=a(n(4566)),g=a(n(9487)),v=a(n(2527)),y=a(n(6692)),b=a(n(5249)),w=a(n(1890)),E=a(n(3375)),_=a(n(6366)),C=a(n(9069)),S=a(n(400)),x=n(4007);t.default=function(e){const t=x.globalStyles(),[n,r]=s.useState(function(){let t=[];return e.messages.map(((e,n)=>{let r={expanded:!1,key:n,message:e,save:!0,title:"",windowProps:null};try{let t=JSON.parse(e.getBody());null!=t.name&&(r.title=t.name,r.windowProps=t)}catch(e){}t.push(r)})),{messageStates:t}}());function i(t){let i=n.messageStates.filter((e=>e.message.getId()!=t.message.getId()));0==i.length?e.handleClose():r({messageStates:i})}return s.default.createElement("div",null,s.default.createElement(d.default,{fullWidth:!1,maxWidth:"md",open:!0,"aria-labelledby":"message-dialog-title","aria-describedby":"message-dialog-description"},s.default.createElement(p.default,{id:"message-dialog-title"},"Shared Collections"),s.default.createElement(f.default,{dividers:!0},s.default.createElement(b.default,{className:t.panelSummary},s.default.createElement("div",{className:t.panelContainer,style:{border:"1px solid",height:"400px",overflow:"scroll"}},n.messageStates.map(((o,a)=>{let u=o.title+" shared by "+o.message.getFromEmail();return s.default.createElement(s.default.Fragment,{key:a},s.default.createElement(g.default,{expanded:o.expanded,style:{margin:"0px"},className:t.panel,onClick:e=>e.stopPropagation()},s.default.createElement(v.default,{className:t.panelSummary,onClick:e=>function(e){e.expanded=!e.expanded,r(Object.assign({},n))}(o),expandIcon:s.default.createElement(m.default,{id:"expandButton"})},s.default.createElement(l.default,{display:"flex",flexDirection:"row",width:"100%"},s.default.createElement(l.default,null,s.default.createElement(C.default,{title:"Delete"},s.default.createElement(w.default,{id:"deleteButton",className:t.iconButton,onClick:t=>{!function(t){e.handleDeleteMessage(t.message),i(t)}(o),t.stopPropagation()}},s.default.createElement(c.default,null)))),s.default.createElement(l.default,{width:"5px"}),s.default.createElement(l.default,null,s.default.createElement(C.default,{title:"Save"},s.default.createElement(w.default,{id:"saveButton",className:t.iconButton,onClick:t=>{!function(t){e.handleSaveMessage(t.message,t.windowProps),i(t)}(o),t.stopPropagation()}},s.default.createElement(E.default,null)))),s.default.createElement(l.default,{width:"10px"}),s.default.createElement(l.default,{style:{paddingTop:"0px"}},s.default.createElement(S.default,{className:t.panelHeading},u)))),s.default.createElement(y.default,{className:t.panelDetail},s.default.createElement("div",{className:t.panelContainer},s.default.createElement(_.default,{autoFocus:!0,disabled:!0,margin:"dense",multiline:!0,rows:10,fullWidth:!0,variant:"outlined",value:o.message.getText()})))))}))))),s.default.createElement(h.default,null,s.default.createElement(u.default,{id:"closeButton",color:"primary",onClick:()=>{e.handleClose()}},"Close"))))}},2482:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=n(5828),u=a(n(4709)),c=a(n(3912)),d=a(n(2411)),h=a(n(6248)),f=a(n(814)),p=a(n(6222)),m=a(n(202)),g=a(n(4023)),v=a(n(9169)),y=a(n(4781)),b=a(n(3141)),w=a(n(6366)),E=n(772),_=n(4007),C=n(1802),S=a(n(5882)),x=l.makeStyles((e=>({field:{width:150},formControl:{margin:e.spacing(1),minWidth:100}})));t.default=function(e){const t=x(),n="£",r=_.globalStyles(),i=e.appContext.getAccountService(),o=i.getAccountData(),a=o.account;let l=o.systemSettings;const T=l.annualCollectionMultiple,I=l.annualCollectionMultipleCost,k=new Date,O=new Date(k.getTime()+365*C.ONE_DAY_MS),[P,N]=s.useState(function(){let e="",t=0,r=O,i=0,o=[],s=0;if(null==a)e="Cannot retrieve account";else if(null==l)e="Cannot retrieve account settings";else{t=a.isPaymentDue()?l.annualSubscriptionPrice:0,i=a.getBackupPurchased(),s=a.isPaymentDue()?L(i):0,a.isPaymentDue()||(r=a.getPaymentDueDate());for(let e=0;e<=l.maxCloudCollections;e+=T){const t=0==e?0:e/T*I,r=0==e?e:e+" ("+n+E.formatCurrency(t)+")";o.push({total:e,option:r.toString()})}}return l.retired&&(e="ForgetMeNot is no longer available for purchase"),{annualCloudStoragePayment:s,annualSubscriptionPayment:t,cloudStorageCollections:i,cloudStorageOptions:o,errorMessage:e,nextPaymentDate:r,paid:!1,pay:!1,paymentMessage:""}}()),A=e.appContext.getSettingsStore().getLogin(),D="340px",R="400px";function M(e){return e/T*I}function L(e){if(!a.isPaymentDue()){if(e<=a.getBackupPurchased()||0==e)return 0;const t=(O.getTime()-a.getPaymentDueDate().getTime())/C.ONE_DAY_MS,n=M(a.getBackupPurchased())/365*t;return M(e-a.getBackupPurchased())+n}return e>0?e/T*I:0}function j(e){setTimeout((()=>{N(Object.assign(Object.assign({},P),{pay:e}))}),500)}s.useEffect((()=>{i.getSystemSettings(!0).then((e=>{e.error||(l=e.systemSettings)}))}),[]);const F=l.annualSubscription?"Annual ":" Monthly ",W=P.paid?"Paid":a.isPaymentDue()?F+"Payment is due":F+"Payment",B=Math.round(P.annualSubscriptionPayment+P.annualCloudStoragePayment),z=a.isPaymentDue()?"Annual subscription due since "+E.formatDate(P.nextPaymentDate):"Annual subscription is paid until "+E.formatDate(P.nextPaymentDate),U="Number of collections currently bought: "+a.getBackupPurchased();if(P.pay){const t={};t.backupPurchased=P.cloudStorageCollections,t.nextPaymentDate=P.nextPaymentDate.toString();const r={amount:B,collectPayment:function(t,n){e.collectPayment(i,t).then((e=>{n(e)})).catch((e=>{N(Object.assign(Object.assign({},P),{pay:!1,errorMessage:"Error calling Stripe: "+e.message}))}))},completePayment:function(t,n){if(n){const n={backupPurchased:P.cloudStorageCollections,email:t.payment.email,paymentDueDate:P.nextPaymentDate.getTime(),paymentResult:t};e.completePayment(i,n).then((e=>{""==e.errorMessage?N(Object.assign(Object.assign({},P),{paid:!0,pay:!1,paymentMessage:"Thank Your for your payment"})):N(Object.assign(Object.assign({},P),{pay:!1,errorMessage:e.errorMessage}))})).catch((e=>{N(Object.assign(Object.assign({},P),{pay:!1,errorMessage:"Error completing payment: "+e.message}))}))}else N(Object.assign(Object.assign({},P),{pay:!1,errorMessage:"Cannot make payment"}))},currency:"GBP",currencySymbol:n,description:"ForgetMeNot subscription",handleCancel:function(){j(!1)},height:D,login:A,metadata:t,stripeKey:l.stripeKey,width:R};return s.default.createElement(S.default,Object.assign({},r))}if(P.paid)return i.getAccount(A,!0),s.default.createElement(d.default,{open:!0,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},s.default.createElement(p.default,{id:"alert-dialog-title"},W),s.default.createElement(f.default,null,s.default.createElement(u.default,{severity:"success"},P.paymentMessage)),s.default.createElement(h.default,null,s.default.createElement(c.default,{id:"closePayButton",onClick:()=>{e.handleClose()},color:"primary",autoFocus:!0},"Close")));const V=0==B||l.retired,Z=0==B&&0==P.cloudStorageCollections&&o.account.getBackupPurchased()>0;return s.default.createElement("div",null,s.default.createElement(d.default,{open:!0,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},s.default.createElement(p.default,{id:"alert-dialog-title"},W),s.default.createElement(f.default,{dividers:!0,style:{height:D,width:R}},0==P.annualSubscriptionPayment&&s.default.createElement(m.default,{fullWidth:!0,variant:"outlined"},s.default.createElement(w.default,{id:"subscription",disabled:!0,value:z,variant:"outlined",InputProps:{className:r.boldText}})),0!=P.annualSubscriptionPayment&&s.default.createElement(m.default,{variant:"outlined",className:t.formControl},s.default.createElement(v.default,{htmlFor:"annual-sub"},"Subscription"),s.default.createElement(y.default,{id:"annual-sub",className:t.field,disabled:!0,value:E.formatCurrency(P.annualSubscriptionPayment),startAdornment:s.default.createElement(g.default,{position:"start"},n),labelWidth:60})),s.default.createElement("br",null),s.default.createElement("br",null),s.default.createElement(m.default,{fullWidth:!0,variant:"outlined"},s.default.createElement(w.default,{id:"purchased-collections",disabled:!0,value:U,variant:"outlined",InputProps:{className:r.boldText}})),s.default.createElement("br",null),s.default.createElement("br",null),s.default.createElement("div",{style:{display:"inline-block"}},s.default.createElement(m.default,{variant:"outlined",className:t.formControl},s.default.createElement(v.default,{htmlFor:"collections"},"Collections"),s.default.createElement(b.default,{native:!0,className:t.field,value:P.cloudStorageCollections,onChange:function(e){let t=parseInt(e.target.value),n=L(t);if(!a.isPaymentDue())if(t<=a.getBackupPurchased())P.nextPaymentDate=a.getPaymentDueDate(),P.annualSubscriptionPayment=0;else{let e=(O.getTime()-a.getPaymentDueDate().getTime())/C.ONE_DAY_MS,t=l.annualSubscriptionPrice/365*e;P.nextPaymentDate=O,P.annualSubscriptionPayment=t}N(Object.assign(Object.assign({},P),{cloudStorageCollections:t,annualCloudStoragePayment:n}))},inputProps:{name:"collections",id:"collections"}},P.cloudStorageOptions.map(((e,t)=>s.default.createElement("option",{value:e.total,key:t},e.option))))),s.default.createElement(m.default,{variant:"outlined",className:t.formControl},s.default.createElement(v.default,{htmlFor:"cloud-cost"},"Cloud storage cost"),s.default.createElement(y.default,{id:"cloud-cost",className:t.field,disabled:!0,value:E.formatCurrency(P.annualCloudStoragePayment),startAdornment:s.default.createElement(g.default,{position:"start"},n),labelWidth:60}))),s.default.createElement("div",null),s.default.createElement("div",{style:{display:"inline-block"}},s.default.createElement(m.default,{variant:"outlined",className:t.formControl},s.default.createElement(w.default,{disabled:!0,value:"Total",variant:"outlined",className:t.field,InputProps:{className:r.boldText}})),s.default.createElement(m.default,{variant:"outlined",className:t.formControl},s.default.createElement(w.default,{id:"total",className:t.field,disabled:!0,value:E.formatCurrency(B),variant:"outlined",InputProps:{startAdornment:s.default.createElement(g.default,{position:"start"},n)}}))),""!=P.errorMessage&&s.default.createElement("div",null,s.default.createElement(m.default,{fullWidth:!0,variant:"outlined"},s.default.createElement(u.default,{severity:"error"},P.errorMessage)))),s.default.createElement(h.default,null,e.handleCancel&&s.default.createElement(c.default,{id:"cancelButton",onClick:()=>{e.handleCancel()},color:"primary",autoFocus:!0},"cancel"),!Z&&s.default.createElement(c.default,{id:"payButton",disabled:V,onClick:()=>{j(!0)},color:"primary",autoFocus:!0},"Pay"),Z&&s.default.createElement(c.default,{onClick:()=>{!function(){const t={backupPurchased:0,email:A.getEmail(),paymentDueDate:P.nextPaymentDate.getTime(),paymentResult:null};e.completePayment(i,t).then((e=>{""==e.errorMessage?N(Object.assign(Object.assign({},P),{paid:!0,pay:!1,paymentMessage:"Your collections have been deleted"})):N(Object.assign(Object.assign({},P),{pay:!1,errorMessage:e.errorMessage}))})).catch((e=>{N(Object.assign(Object.assign({},P),{pay:!1,errorMessage:"Error completing payment: "+e.message}))}))}()},color:"primary",autoFocus:!0},"Delete Collections"))))}},8797:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.togglePanelExpansion=t.setPersistenceOverWriteWindow=t.setPersistenceOverWriteAll=void 0;const i=r(n(7294)),o=r(n(3957)),a=r(n(7237)),s=r(n(2719)),l=r(n(4566)),u=r(n(9487)),c=r(n(2527)),d=r(n(6692)),h=r(n(5249)),f=r(n(5190)),p=r(n(64)),m=r(n(9069)),g=r(n(400)),v=n(4007),y=n(8939),b=n(3374);t.setPersistenceOverWriteAll=function(e,t){e.map((e=>{e.compareWindowResult.compareState!=b.CompareWindowState.IdenticalWindow&&(e.overWrite=t)}))},t.setPersistenceOverWriteWindow=function(e,t,n){let r=0,i=0;return e.map((e=>{e.collectionName==t.collectionName&&(e.overWrite=n),e.compareWindowResult.compareState!=b.CompareWindowState.IdenticalWindow&&(r+=1,e.overWrite&&(i+=1))})),0!=i&&i==r},t.togglePanelExpansion=function(e,t){e.map((e=>{e.collectionName==t.collectionName&&(e.expanded=!t.expanded)}))},t.default=function(e){const t=v.globalStyles();function n(e,n,r,s){return i.default.createElement(i.default.Fragment,{key:s},i.default.createElement(a.default,{display:"flex",flexDirection:"row",width:"100%"},i.default.createElement(a.default,null,n&&i.default.createElement(o.default,null),!n&&i.default.createElement(p.default,null)),i.default.createElement(a.default,{width:"5px"}),i.default.createElement(a.default,{fontStyle:"italic"},i.default.createElement(g.default,{className:t.tabTitle},e)),i.default.createElement(a.default,{width:"10px"}),i.default.createElement(a.default,null,i.default.createElement(g.default,{className:t.tabTitle},r))))}function r(e,t,r){return n("Tab:",e,t,r)}function w(e,t,r){return n("Tab Tag:",e,t,r)}function E(t,r){return n(t,e.backup,"changed",r)}function _(e,t,r){return n("Window Tag:",e,t,r)}let C=0;return i.default.createElement(i.default.Fragment,null,e.needsOverwrite&&i.default.createElement(h.default,null,i.default.createElement(f.default,{control:i.default.createElement(s.default,{id:"overWriteAll",checked:e.overWriteAll,onChange:()=>e.setOverWriteAll(),color:"primary"}),label:e.overWriteAllLabel}),i.default.createElement("br",null)),i.default.createElement(h.default,null,i.default.createElement("div",{className:t.panelContainer,style:{border:"1px solid",height:"380px",overflow:"scroll"}},e.changes.map(((n,h)=>{const f=n.compareWindowResult.windowChanges,p=(n.compareWindowResult.window,"overWrite"+h);return i.default.createElement(i.default.Fragment,{key:h},n.compareWindowResult.compareState==b.CompareWindowState.ChangedWindow&&i.default.createElement(u.default,{expanded:n.expanded,style:{margin:"0px"},className:t.panel,onClick:e=>e.stopPropagation()},i.default.createElement(c.default,{className:t.panelSummary,expandIcon:i.default.createElement(l.default,null),onClick:t=>e.toggleExpanded(n)},i.default.createElement(a.default,{display:"flex",flexDirection:"row",width:"100%"},i.default.createElement(a.default,{width:"40px"},i.default.createElement(m.default,{title:"Overwrite"},i.default.createElement(s.default,{color:"primary",id:p,checked:n.overWrite,onClick:e=>e.stopPropagation(),onChange:t=>e.setOverWriteWindow(n,t)}))),i.default.createElement(a.default,{style:{paddingTop:"10px"}},i.default.createElement(y.NotEqualIcon,null)),i.default.createElement(a.default,{width:"5px"}),i.default.createElement(a.default,{style:{paddingTop:"10px"}},i.default.createElement(g.default,{className:t.panelHeading},n.collectionName)),i.default.createElement(a.default,{flexGrow:"1"}))),i.default.createElement(d.default,{className:t.panelDetail},i.default.createElement("div",{className:t.panelContainer},f.nameChange&&E("Window name",C++),f.changedPosition&&E("Window position",C++),f.descriptionChange&&E("Window description",C++),f.newTabs.map((t=>r(!e.backup,t.name,C++))),f.changedTabs.map((t=>{if(0==t.deletedTags.length&&0==t.newTags.length&&0==t.updatedTags.length)return r(e.backup,t.tab.getName(),C++)})),f.deletedTabs.map((t=>r(e.backup,t.getName(),C++))),f.newTags.map((t=>_(!e.backup,t,C++))),f.updatedTags.map((t=>_(!e.backup,t,C++))),f.deletedTags.map((t=>_(e.backup,t,C++))),f.changedTabs.map((t=>t.newTags.map((t=>w(!e.backup,t,C++))))),f.changedTabs.map((t=>t.updatedTags.map((t=>w(!e.backup,t,C++))))),f.changedTabs.map((t=>t.deletedTags.map((t=>w(e.backup,t,C++)))))))),n.compareWindowResult.compareState!=b.CompareWindowState.ChangedWindow&&i.default.createElement(u.default,{expanded:!1,style:{margin:"0px"},className:t.panel,onClick:e=>e.stopPropagation()},i.default.createElement(c.default,{className:t.panelSummary,onClick:e=>e.stopPropagation()},i.default.createElement(a.default,{display:"flex",flexDirection:"row",width:"100%"},n.compareWindowResult.compareState==b.CompareWindowState.NewWindow&&i.default.createElement(a.default,{width:"40px"},i.default.createElement(m.default,{title:"Overwrite"},i.default.createElement(s.default,{color:"primary",id:p,checked:n.overWrite,onClick:e=>e.stopPropagation(),onChange:t=>e.setOverWriteWindow(n,t)}))),n.compareWindowResult.compareState==b.CompareWindowState.IdenticalWindow&&i.default.createElement(a.default,{width:"40px"}),i.default.createElement(a.default,{style:{paddingTop:"10px"}},n.compareWindowResult.compareState==b.CompareWindowState.IdenticalWindow&&i.default.createElement(y.EqualIcon,null),n.compareWindowResult.compareState==b.CompareWindowState.NewWindow&&i.default.createElement(o.default,null)),i.default.createElement(a.default,{width:"5px"}),i.default.createElement(a.default,{style:{paddingTop:"10px"}},i.default.createElement(g.default,{className:t.panelHeading},n.collectionName))))))})))))}},9056:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=n(5828),u=a(n(3912)),c=a(n(2411)),d=a(n(6248)),h=a(n(814)),f=a(n(8101)),p=a(n(6222)),m=a(n(115)),g=o(n(8797)),v=n(3374),y=l.makeStyles((e=>({inputFile:{visibility:"hidden"}})));t.default=function(e){y();const t={changes:[],error:!1,loading:!1,message:"",needsOverwrite:!1,overWriteAll:!0},n=e.appContext.getPersistence(),[r,i]=s.useState(t);function o(e,t){return{collectionName:e,compareWindowResult:t,expanded:!1,overWrite:!0}}function a(e){i(Object.assign(Object.assign({},r),{error:!0,loading:!1,message:e}))}function l(e){e.sort(((e,t)=>e.collectionName.toUpperCase().localeCompare(t.collectionName.toUpperCase())))}return s.useEffect((()=>{e.open?(i(Object.assign(Object.assign({},r),{error:!1,loading:!0,message:"Accessing Cloud Storage"})),n.authorize((()=>{n.getCollectionNames((t=>{t.length>0?function(t){let s=e.appContext.getCollectionStore(),u=[],c=[];if(t.sort(((e,t)=>e.toUpperCase().localeCompare(t.toUpperCase()))),t.map((e=>{null!=s.findWindowByName(e)?u.push(e):c.push(o(e,m.default.getNewWindowCompareResult(null)))})),u.length>0)n.getCollections(u,!0,(e=>{for(let t=0;te.compareWindowResult.compareState!=v.CompareWindowState.IdenticalWindow)).length>0;l(c),i(Object.assign(Object.assign({},r),{changes:c,loading:!1,message:"",needsOverwrite:t}))}),(e=>{a(e)}));else{const e=c.filter((e=>e.compareWindowResult.compareState!=v.CompareWindowState.IdenticalWindow)).length>0;l(c),i(Object.assign(Object.assign({},r),{changes:c,loading:!1,message:"",needsOverwrite:e}))}}(t):a("No collections found")}),(e=>{a(e)}))}),(e=>{a(e)}))):i(t)}),[e.open]),s.default.createElement("div",null,e.open&&s.default.createElement(c.default,{fullWidth:!1,maxWidth:"md",open:e.open,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},s.default.createElement(p.default,{id:"alert-dialog-title"},"Restore"),s.default.createElement(h.default,{style:{minWidth:"300px",overflowY:"hidden"}},(r.error||r.loading)&&s.default.createElement(f.default,{id:"alert-dialog-description"},r.message),!r.error&&!r.loading&&s.default.createElement(g.default,{backup:!1,changes:r.changes,needsOverwrite:r.needsOverwrite,overWriteAll:r.overWriteAll,overWriteAllLabel:"Restore All",setOverWriteAll:function(){const e=!r.overWriteAll;g.setPersistenceOverWriteAll(r.changes,e),i(Object.assign(Object.assign({},r),{overWriteAll:e}))},setOverWriteWindow:function(e,t){let n=t.target.checked,o=g.setPersistenceOverWriteWindow(r.changes,e,n);i(Object.assign(Object.assign({},r),{overWriteAll:o}))},toggleExpanded:function(e){g.togglePanelExpansion(r.changes,e),i(Object.assign({},r))}})),!r.loading&&s.default.createElement(d.default,null,s.default.createElement(u.default,{id:"cancelButton",onClick:()=>{e.handleClose()},color:"primary"},"Cancel"),s.default.createElement(u.default,{id:"saveButton",onClick:()=>{!function(){if(!r.error){let o=e.appContext.getCollectionStore(),s=[];if(r.changes.map((e=>{e.overWrite&&e.compareWindowResult.compareState!=v.CompareWindowState.IdenticalWindow&&(null!=e.compareWindowResult.window?o.restoreWindows([e.compareWindowResult.window]):s.push(e.collectionName))})),s.length>0)return i(Object.assign(Object.assign({},r),{error:!1,loading:!0,message:"Reading files"})),void n.getCollections(s,!0,(n=>{o.restoreWindows(n),i(t),e.handleClose()}),(e=>{a(e)}))}i(t),e.handleClose()}()},color:"primary",autoFocus:!0},"OK"))))}},2910:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=n(5828),u=a(n(1890)),c=a(n(8995)),d=a(n(6366)),h=a(n(9069)),f=n(1802),p=a(n(5096)),m=a(n(892)),g=l.makeStyles((e=>({iconButton:{padding:"1px"},input:{color:"white"},search:{backgroundColor:l.fade(e.palette.common.white,.15),"&:hover":{backgroundColor:l.fade(e.palette.common.white,.25)},borderRadius:e.shape.borderRadius,marginLeft:"15px",paddingLeft:"5px",paddingRight:"5px"},searchIcons:{color:"white",display:"flex",marginRight:"5px"},textfield:{width:"40ch"}})));t.default=function(e){const t=g(),n=e.appContext,r=p.default.getDefaultSearchState(),i=n.getLiveWindowStore(),o=n.getCollectionStore(),a=n.getEventBus(),[l,v]=s.useState(r),y=l.term,b=y.length<1;function w(e){let t=i.search(e),n=o.search(e),r=t.tabs.concat(n.tabs);return new p.default(e,t.windowMap,n.windowMap,r)}function E(){v(r),e.search(r)}function _(e){let t=Object.assign(Object.assign({},l),{filter:!0,loading:!0,search:!0,term:e});v(t)}return s.useEffect((()=>(a.addEventListener(f.MessageType.ResetSearch,E),()=>{a.removeEventListener(f.MessageType.ResetSearch,E)})),[y]),s.useEffect((()=>{""!=e.term&&_(e.term)}),[e.term]),s.useEffect((()=>{function t(){if(l.filter||l.search){let t=Object.assign(Object.assign({},l),{result:w(y)});v(t),e.search(t)}}return a.addEventListener(f.MessageType.LiveWindowUpdate,t),a.addEventListener(f.MessageType.CollectionUpdate,t),()=>{a.removeEventListener(f.MessageType.LiveWindowUpdate,t),a.removeEventListener(f.MessageType.CollectionUpdate,t)}}),[l]),l.loading&&setTimeout((()=>{let t=w(l.term),n=Object.assign(Object.assign({},l),{filter:!0,loading:!1,search:!0,result:t});v(n),e.search(n)}),500),s.default.createElement("div",{className:t.search},l.loading&&s.default.createElement(m.default,null),s.default.createElement(d.default,{id:"searchInput",onChange:function(e){""==e.target.value?E():v(Object.assign(Object.assign({},l),{term:e.target.value}))},onKeyPress:function(e){"Enter"===e.key&&(b||_(l.term),e.preventDefault())},className:t.textfield,type:"search",variant:"standard",margin:"none",value:y,InputProps:{className:t.input,disableUnderline:!0,startAdornment:s.default.createElement("div",{className:t.searchIcons},s.default.createElement(h.default,{title:"Search"},s.default.createElement("div",null,s.default.createElement(u.default,{id:"searchButton",disabled:b,className:t.iconButton,color:"inherit",onClick:e=>{_(l.term),e.stopPropagation()}},s.default.createElement(c.default,null)))))}}))}},7124:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=o(n(2043)),u=a(n(7237)),c=a(n(366)),d=a(n(5025)),h=a(n(4566)),f=a(n(9487)),p=a(n(2527)),m=a(n(6692)),g=a(n(9152)),v=a(n(1890)),y=a(n(6572)),b=a(n(9069)),w=a(n(400)),E=n(4007),_=n(8939),C=n(6889),S=n(1802);t.default=function(e){const t=E.globalStyles(),[n,r]=s.useState(!1),i=e.appContext,o=i.getClipBoard(),a=i.getEventBus(),x=e.searchState.result,T=x.getTabs();let[I,k]=s.useState(!0);const O=I?"Collapse":"Expand";l.debug("SearchResultPanel : "+I),s.useEffect((()=>{function e(){l.debug("Search Panel update "+n),r(!n)}return a.addEventListener(S.MessageType.Resize,e),()=>{a.removeEventListener(S.MessageType.Resize,e)}}),[n]);let P={maxHeight:document.getElementById(C.LayoutComponent.SearchContainer).getBoundingClientRect().height-64+"px"};return s.default.createElement("div",{className:t.panelContainer},s.default.createElement(f.default,{expanded:I,style:{margin:"0px"},className:t.panel},s.default.createElement(p.default,{className:t.searchSummary,onClick:e=>k(!I),"aria-controls":"panel1a-content",id:"panel1a-header"},s.default.createElement(u.default,{display:"flex",flexDirection:"row",width:"100%"},s.default.createElement(u.default,null,s.default.createElement(w.default,{className:t.panelHeading},"Found ",T.length,' tabs containing "',x.getTerm(),'"')),s.default.createElement(u.default,{flexGrow:"1"}),s.default.createElement(u.default,null,s.default.createElement(b.default,{title:"Close"},s.default.createElement(v.default,{id:"closeButton",className:t.iconButton,onClick:e=>{a.sendMessage({messageType:S.MessageType.ResetSearch}),e.stopPropagation()}},s.default.createElement(c.default,null)))),s.default.createElement(u.default,{width:"5px"}),s.default.createElement(u.default,null,s.default.createElement(b.default,{title:O},s.default.createElement(v.default,{id:"expandButton",className:t.iconButton,onClick:e=>{k(!I),e.stopPropagation()}},I&&s.default.createElement(d.default,null),!I&&s.default.createElement(h.default,null)))))),s.default.createElement(m.default,{className:t.windowDetail,style:P},s.default.createElement("div",{className:t.panelContainer},T.map(((e,n)=>{let r=e.getChromeTab();return s.default.createElement(s.default.Fragment,{key:n},s.default.createElement(u.default,{display:"flex",flexDirection:"row"},s.default.createElement(u.default,{width:"15px"}),s.default.createElement(u.default,null,s.default.createElement(b.default,{title:"Copy"},s.default.createElement(v.default,{className:t.iconButton,onClick:t=>{t.stopPropagation(),o.saveTab(e)}},s.default.createElement(_.CopyIcon,null)))),s.default.createElement(u.default,{width:"15px"}),s.default.createElement(u.default,null,null!=r.favIconUrl&&s.default.createElement(g.default,{classes:{root:t.iconRoot}},s.default.createElement("img",{className:t.imageIcon,src:r.favIconUrl})),null==r.favIconUrl&&s.default.createElement(g.default,null)),s.default.createElement(u.default,{width:"10px"}),s.default.createElement(u.default,null,null!=r.url&&s.default.createElement(y.default,{href:r.url,target:"_blank",className:t.url},s.default.createElement(w.default,{className:t.tabTitle},r.title)),null==r.url&&s.default.createElement(w.default,{className:t.tabTitle},r.title))))}))))))}},3814:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=n(5828),u=a(n(4709)),c=a(n(7237)),d=a(n(3912)),h=a(n(2411)),f=a(n(6248)),p=a(n(814)),m=a(n(6222)),g=a(n(5190)),v=a(n(5249)),y=a(n(5574)),b=l.makeStyles((e=>({divider:{padding:"10px"}})));t.default=function(e){const t=b(),[n,r]=s.useState({menuTabTags:e.appContext.getSettingsStore().getMenuTabTags(),message:""}),i=e.appContext.getSettingsStore().getMenuTabTags();return s.default.createElement("div",null,s.default.createElement(h.default,{fullWidth:!1,maxWidth:"md",open:!0,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},s.default.createElement(m.default,{id:"alert-dialog-title"},"Settings"),s.default.createElement(p.default,{dividers:!0},s.default.createElement(v.default,null,s.default.createElement(c.default,{flexDirection:"column"},s.default.createElement(c.default,{border:1,className:t.divider},s.default.createElement(g.default,{control:s.default.createElement(y.default,{checked:i,id:"menuTabTagsButton",onChange:function(t){const i=t.target.checked;r(Object.assign(Object.assign({},n),{menuTabTags:i})),e.handleMenuTabTagChange(i)},name:"menuTabTags"}),label:"Include Tab Tags in Side Menu"})),s.default.createElement(c.default,{border:1,className:t.divider},s.default.createElement(d.default,{id:"resetLayoutButton",variant:"contained",onClick:()=>{r(Object.assign(Object.assign({},n),{message:"Reload to return to default layout"})),e.handleResetLayout()},color:"primary",autoFocus:!0},"Reset Layout")),""!=n.message&&s.default.createElement(s.default.Fragment,null,s.default.createElement(c.default,{border:1,className:t.divider},s.default.createElement(u.default,{severity:"success"},n.message)))))),s.default.createElement(f.default,null,s.default.createElement(d.default,{id:"closeButton",onClick:()=>{e.handleClose()},color:"primary",autoFocus:!0},"Close"))))}},9512:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=a(n(3912)),u=a(n(2411)),c=a(n(6248)),d=a(n(814)),h=a(n(6222)),f=a(n(6366)),p=n(228),m=n(8280),g=a(n(3824));t.default=function(e){const[t,n]=s.useState({email:"",emailError:!1,emailErrorMessage:"",message:""}),r=s.useRef(null);s.useEffect((()=>{n({email:"",emailError:!1,emailErrorMessage:"",message:""})}),[e.open]);let i="Share Collection "+e.window.getName();return s.default.createElement("div",null,e.open&&s.default.createElement(u.default,{fullWidth:!1,maxWidth:"md",open:e.open,"aria-labelledby":"save-dialog-title","aria-describedby":"save-dialog-description"},s.default.createElement(h.default,{id:"save-dialog-title"},i),s.default.createElement(d.default,{dividers:!0},s.default.createElement(f.default,{id:"from",autoFocus:!0,disabled:!0,margin:"dense",label:"Enter from",type:"email",fullWidth:!0,variant:"outlined",value:e.login.getEmail()}),s.default.createElement(f.default,{id:"to",autoFocus:!0,error:t.emailError,helperText:t.emailErrorMessage,inputRef:r,onChange:function(e){n(Object.assign(Object.assign({},t),{emailError:!1,emailErrorMessage:"",email:e.target.value}))},margin:"dense",label:"Enter to",type:"email",fullWidth:!0,variant:"outlined",value:t.email}),s.default.createElement(f.default,{id:"message",autoFocus:!0,onChange:function(e){n(Object.assign(Object.assign({},t),{message:e.target.value}))},margin:"dense",label:"Enter message",multiline:!0,rows:10,fullWidth:!0,variant:"outlined",value:t.message})),s.default.createElement(c.default,null,s.default.createElement(l.default,{id:"cancelButton",color:"primary",onClick:()=>{e.handleClose()}},"Cancel"),s.default.createElement(l.default,{id:"sendButton",disabled:!(""!=t.email&&""!=t.message),color:"primary",autoFocus:!0,onClick:()=>{!function(){if(function(){let e=t.email;return!(""==e||!r.current.checkValidity()||e.indexOf("+")>=0)||(n(Object.assign(Object.assign({},t),{emailError:!0,emailErrorMessage:"Invalid email"})),!1)}()){let r=new m.Login(t.email,"");e.appContext.getAccountService().findAccount(r).then((r=>{const i=r.account;if(null!=i)if(0==i.getBackupPurchased())n(Object.assign(Object.assign({},t),{emailError:!0,emailErrorMessage:"User has not bought cloud storage"}));else{let n={body:JSON.stringify(e.window,null,2),from:e.login.getEmail(),id:g.default(),text:t.message,to:t.email},r=new p.Message(n);e.handleSend(r,e.window)}else n(Object.assign(Object.assign({},t),{emailError:!0,emailErrorMessage:"Unknown user"}))}))}}()}},"Send"))))}},892:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(525)),o=r(n(7294)),a=n(5828).makeStyles((e=>({visible:{display:"block",left:"45%",position:"fixed",top:"45%"}})));t.default=function(){const e=a();return o.default.createElement("div",{className:e.visible},o.default.createElement(i.default,{radius:80,color:"#333",stroke:5,visible:!0}))}},873:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=o(n(7294)),l=a(n(3592)),u=a(n(3912)),c=a(n(5851)),d=a(n(2411)),h=a(n(6248)),f=a(n(814)),p=a(n(6222)),m=a(n(6366));t.default=function(e){const[t,n]=s.useState(Object.assign(Object.assign({},e.data),{toggle:!1,message:""}));function r(e){return e.replace(/[^\x20-\x7E]/g,"")}return s.useEffect((()=>{n(Object.assign(Object.assign({},t),e.data))}),[e.data]),s.default.createElement("div",null,e.open&&s.default.createElement(d.default,{fullWidth:!1,maxWidth:"md",open:e.open,"aria-labelledby":"save-dialog-title","aria-describedby":"save-dialog-description"},s.default.createElement(p.default,{id:"save-dialog-title"},e.title),s.default.createElement(f.default,{dividers:!0},s.default.createElement(m.default,{autoFocus:!0,error:t.toggle,helperText:t.message,onChange:function(e){n(Object.assign(Object.assign({},t),{toggle:!1,message:"",name:e.target.value}))},margin:"dense",id:"name",label:"Name",type:"text",fullWidth:!0,variant:"outlined",value:t.name}),s.default.createElement(m.default,{autoFocus:!0,onChange:function(e){n(Object.assign(Object.assign({},t),{description:e.target.value}))},margin:"dense",id:"description",label:"Enter description",multiline:!0,rows:10,fullWidth:!0,variant:"outlined",value:t.description}),s.default.createElement("div",{style:{width:"100%"}},s.default.createElement(l.default,{id:"tags",multiple:!0,onChange:(e,i,o)=>{let a=r(i.toString());if(""!=a){let e=a.split(",");n(Object.assign(Object.assign({},t),{tags:e}))}else n(Object.assign(Object.assign({},t),{tags:[]}))},options:e.collectionStore.getTags().map((e=>e.tag)),value:t.tags,freeSolo:!0,renderTags:(e,t)=>e.map(((e,n)=>""!=r(e.toString())?s.default.createElement(c.default,Object.assign({variant:"outlined",label:e},t({index:n}))):null)),style:{width:500},renderInput:e=>s.default.createElement(m.default,Object.assign({},e,{margin:"dense",multiline:!0,variant:"outlined",label:"Tags",placeholder:"Tags"}))}))),s.default.createElement(h.default,null,s.default.createElement(u.default,{color:"primary",onClick:()=>{e.handleClose()}},"Cancel"),s.default.createElement(u.default,{id:"closeButton",color:"primary",autoFocus:!0,onClick:()=>{e.save(t),n(Object.assign(Object.assign({},t),{name:"",description:""})),e.handleClose()}},"Save"))))}},6375:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DeleteCollectionMessage=t.LoadingCollectionsMessage=void 0;const s=o(n(7294)),l=a(n(3912)),u=a(n(8428)),c=a(n(2411)),d=a(n(6248)),h=a(n(814)),f=a(n(8101)),p=a(n(6222)),m=a(n(5249)),g=a(n(1890)),v=a(n(3240)),y=a(n(4968)),b=a(n(7311)),w=a(n(7183)),E=n(4007),_=a(n(5479));t.LoadingCollectionsMessage="Accessing Cloud Storage",t.DeleteCollectionMessage="Are you sure you want to delete ",t.default=function(e){const n=E.globalStyles(),r={collectionNames:[],error:!1,loading:!1,message:""},i=e.appContext.getPersistence(),[o,a]=s.useState({collectionName:"",message:"",showDeleteDialog:!1}),[C,S]=s.useState(r);function x(){i.getCollectionNames((e=>{e.length>0?S(Object.assign(Object.assign({},C),{collectionNames:e,loading:!1})):T("No collections found")}),(e=>{T(e)}))}function T(e){S(Object.assign(Object.assign({},C),{error:!0,loading:!1,message:e}))}return s.useEffect((()=>{e.open?(S(Object.assign(Object.assign({},C),{error:!1,loading:!0,message:t.LoadingCollectionsMessage})),i.authorize((()=>{x()}),(e=>{T(e)}))):S(r)}),[e.open]),s.default.createElement("div",null,o.showDeleteDialog&&s.default.createElement(_.default,{handleCancel:function(){a({collectionName:"",message:"",showDeleteDialog:!1})},handleConfirm:function(){i.deleteCollection(o.collectionName,(()=>{x()}),(e=>{T(e)})),a({collectionName:"",message:"",showDeleteDialog:!1})},title:"Delete Collection",text:o.message}),e.open&&s.default.createElement(c.default,{fullWidth:!1,maxWidth:"md",open:e.open,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},s.default.createElement(p.default,{id:"alert-dialog-title"},"Cloud Collections"),s.default.createElement(h.default,{style:{minWidth:"300px"}},(C.error||C.loading)&&s.default.createElement(f.default,{id:"alert-dialog-description"},C.message),!C.error&&!C.loading&&s.default.createElement(m.default,{className:n.panelSummary},s.default.createElement("div",{className:n.panelContainer,style:{border:"1px solid",height:"400px",overflow:"scroll"}},s.default.createElement(v.default,{component:"nav"},C.collectionNames.map(((e,n)=>s.default.createElement(y.default,{button:!0,key:n},s.default.createElement(b.default,null,s.default.createElement(g.default,{id:"deleteCloudButton",onClick:n=>{let r=t.DeleteCollectionMessage+e+"?";a({collectionName:e,message:r,showDeleteDialog:!0}),n.stopPropagation()}},s.default.createElement(u.default,null))),s.default.createElement(w.default,{primary:e})))))))),!C.loading&&s.default.createElement(d.default,null,s.default.createElement(l.default,{id:"closeViewCloudButton",onClick:()=>{e.handleClose()},color:"primary",autoFocus:!0},"Close"))))}},9968:(e,t,n)=>{"use strict";function r(e){if(Array.isArray(e))return e}n.d(t,{Z:()=>r})},3349:(e,t,n)=>{"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:()=>r})},6610:(e,t,n)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{Z:()=>r})},5991:(e,t,n)=>{"use strict";function r(e,t){for(var n=0;ni})},6156:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{Z:()=>r})},2122:(e,t,n)=>{"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;tr})},1788:(e,t,n)=>{"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n.d(t,{Z:()=>r})},6410:(e,t,n)=>{"use strict";function r(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}n.d(t,{Z:()=>r})},8970:(e,t,n)=>{"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}n.d(t,{Z:()=>r})},1253:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(9756);function i(e,t){if(null==e)return{};var n,i,o=(0,r.Z)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},9756:(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=0||(i[n]=e[n]);return i}n.d(t,{Z:()=>r})},8481:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9968),i=n(8970);function o(e,t){return(0,r.Z)(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(e,t)||(0,i.Z)()}},5061:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(6410);function i(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,{Z:()=>r})},7154:e=>{function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t{e.exports=function(e){return e&&e.__esModule?e:{default:e}}},3198:(e,t,n)=>{"use strict";n.d(t,{Jn:()=>k,l4:()=>g,H9:()=>w,Vr:()=>E,Af:()=>y,Z8:()=>x,lz:()=>b,qX:()=>C,Xd:()=>_,wN:()=>S,P2:()=>A,Mq:()=>P,C6:()=>N,ZF:()=>O,TP:()=>R,KN:()=>D,Ub:()=>M});var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function a(e,t){for(var n=0,r=t.length,i=e.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const p="@firebase/app-exp",m=new h.Yd("@firebase/app"),g="[DEFAULT]",v={[p]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics-exp":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/auth-exp":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions-exp":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations-exp":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging-exp":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance-exp":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config-exp":"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-exp":"fire-js-all"},y=new Map,b=new Map;function w(e,t){try{e.container.addComponent(t)}catch(n){m.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function E(e,t){e.container.addOrOverwriteComponent(t)}function _(e){const t=e.name;if(b.has(t))return m.debug(`There were multiple attempts to register component ${t}.`),!1;b.set(t,e);for(const t of y.values())w(t,e);return!0}function C(e,t){return e.container.getProvider(t)}function S(e,t,n=g){C(e,t).clearInstance(n)}function x(){b.clear()}const T=new s.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","app-deleted":"Firebase App named '{$appName}' already deleted","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."});class I{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new l("app-exp",(()=>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 container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw T.create("app-deleted",{appName:this._name})}}const k="9.0.0-beta.2";function O(e,t={}){"object"!=typeof t&&(t={name:t});const n=Object.assign({name:g,automaticDataCollectionEnabled:!1},t),r=n.name;if("string"!=typeof r||!r)throw T.create("bad-app-name",{appName:String(r)});if(y.has(r))throw T.create("duplicate-app",{appName:r});const i=new d(r);for(const e of b.values())i.addComponent(e);const o=new I(e,n,i);return y.set(r,o),o}function P(e=g){const t=y.get(e);if(!t)throw T.create("no-app",{appName:e});return t}function N(){return Array.from(y.values())}async function A(e){const t=e.name;y.has(t)&&(y.delete(t),await Promise.all(e.container.getProviders().map((e=>e.delete()))),e.isDeleted=!0)}function D(e,t,n){var r;let i=null!==(r=v[e])&&void 0!==r?r:e;n&&(i+=`-${n}`);const o=i.match(/\s|\//),a=t.match(/\s|\//);if(o||a){const e=[`Unable to register library "${i}" with version "${t}":`];return o&&e.push(`library name "${i}" contains illegal characters (whitespace or "/")`),o&&a&&e.push("and"),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void m.warn(e.join(" "))}_(new l(`${i}-version`,(()=>({library:i,version:t})),"VERSION"))}function R(e,t){if(null!==e&&"function"!=typeof e)throw T.create("invalid-log-argument");(0,h.Am)(e,t)}function M(e){(0,h.Ub)(e)}_(new l("platform-logger",(e=>new f(e)),"PRIVATE")),D(p,"0.0.900-exp.d92a36260",undefined),D("fire-js","")},4594:(e,t,n)=>{"use strict";function r(){for(var e=0,t=0,n=arguments.length;to,Yd:()=>d,Ub:()=>h,Am:()=>f});var o,a=[];!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(o||(o={}));var s={debug:o.DEBUG,verbose:o.VERBOSE,info:o.INFO,warn:o.WARN,error:o.ERROR,silent:o.SILENT},l=o.INFO,u=((i={})[o.DEBUG]="log",i[o.VERBOSE]="log",i[o.INFO]="info",i[o.WARN]="warn",i[o.ERROR]="error",i),c=function(e,t){for(var n=[],i=2;i=(null!=r?r:t.logLevel)&&e({level:o[n].toLowerCase(),message:s,args:i,type:t.name})}},r=0,i=a;r{"use strict";n.d(t,{BH:()=>s,LL:()=>v,ZR:()=>g,tV:()=>a,Sg:()=>l,ne:()=>S,pd:()=>C,m9:()=>I,z$:()=>u,ru:()=>d,d:()=>f,xb:()=>w,w1:()=>p,uI:()=>c,b$:()=>h,Mn:()=>m,xO:()=>E,zd:()=>_});var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n>2,d=(3&o)<<4|s>>4,h=(15&s)<<2|u>>6,f=63&u;l||(f=64,a||(h=64)),r.push(n[c],n[d],n[h],n[f])}return r.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(function(e){for(var t=[],n=0,r=0;r>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t}(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){for(var t=[],n=0,r=0;n191&&i<224){var o=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var a=((7&i)<<18|(63&(o=e[n++]))<<12|(63&(s=e[n++]))<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(a>>10)),t[r++]=String.fromCharCode(56320+(1023&a))}else{o=e[n++];var s=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i>4;if(r.push(u),64!==s){var c=a<<4&240|s>>2;if(r.push(c),64!==l){var d=s<<6&192|l;r.push(d)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},a=function(e){try{return o.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null},s=function(){function e(){var e=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))}return e.prototype.wrapCallback=function(e){var t=this;return function(n,r){n?t.reject(n):t.resolve(r),"function"==typeof e&&(t.promise.catch((function(){})),1===e.length?e(n):e(n,r))}},e}();function l(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');var n=t||"demo-project",r=e.iat||0,a=e.sub||e.user_id;if(!a)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");var s=i({iss:"https://securetoken.google.com/"+n,aud:n,iat:r,exp:r+3600,auth_time:r,sub:a,user_id:a,firebase:{sign_in_provider:"custom",identities:{}}},e);return[o.encodeString(JSON.stringify({alg:"none",type:"JWT"}),!1),o.encodeString(JSON.stringify(s),!1),""].join(".")}function u(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function c(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(u())}function d(){var e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function h(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function f(){return u().indexOf("Electron/")>=0}function p(){var e=u();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function m(){return u().indexOf("MSAppHost/")>=0}var g=function(e){function t(n,r,i){var o=e.call(this,r)||this;return o.code=n,o.customData=i,o.name="FirebaseError",Object.setPrototypeOf(o,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(o,v.prototype.create),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error),v=function(){function e(e,t,n){this.service=e,this.serviceName=t,this.errors=n}return e.prototype.create=function(e){for(var t=[],n=1;n"}))}var b=/\{\$([^}]+)}/g;function w(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function E(e){for(var t=[],n=function(e,n){Array.isArray(n)?n.forEach((function(n){t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))})):t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))},r=0,i=Object.entries(e);r0?n:void 0)}function S(e,t){var n=new x(e,t);return n.subscribe.bind(n)}!function(){function e(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var e=1;e>>31)}var o,a,s=this.chain_[0],l=this.chain_[1],u=this.chain_[2],c=this.chain_[3],d=this.chain_[4];for(r=0;r<80;r++)r<40?r<20?(o=c^l&(u^c),a=1518500249):(o=l^u^c,a=1859775393):r<60?(o=l&u|c&(l|u),a=2400959708):(o=l^u^c,a=3395469782),i=(s<<5|s>>>27)+o+d+a+n[r]&4294967295,d=c,c=u,u=4294967295&(l<<30|l>>>2),l=s,s=i;this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+l&4294967295,this.chain_[2]=this.chain_[2]+u&4294967295,this.chain_[3]=this.chain_[3]+c&4294967295,this.chain_[4]=this.chain_[4]+d&4294967295},e.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var n=t-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r=56;n--)this.buf_[n]=255&t,t/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)e[r]=this.chain_[n]>>i&255,++r;return e}}();var x=function(){function e(e,t){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then((function(){e(n)})).catch((function(e){n.error(e)}))}return e.prototype.next=function(e){this.forEachObserver((function(t){t.next(e)}))},e.prototype.error=function(e){this.forEachObserver((function(t){t.error(e)})),this.close(e)},e.prototype.complete=function(){this.forEachObserver((function(e){e.complete()})),this.close()},e.prototype.subscribe=function(e,t,n){var r,i=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(e,t){if("object"!=typeof e||null===e)return!1;for(var n=0,r=["next","error","complete"];n{"use strict";n.r(t),n.d(t,{default:()=>d});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=n(3871),u=n(9895),c=o.forwardRef((function(e,t){var n=e.classes,s=e.className,c=e.color,d=void 0===c?"primary":c,h=e.position,f=void 0===h?"fixed":h,p=(0,i.Z)(e,["classes","className","color","position"]);return o.createElement(u.Z,(0,r.Z)({square:!0,component:"header",elevation:4,className:(0,a.default)(n.root,n["position".concat((0,l.Z)(f))],n["color".concat((0,l.Z)(d))],s,"fixed"===f&&"mui-fixed"),ref:t},p))}));const d=(0,s.Z)((function(e){var t="light"===e.palette.type?e.palette.grey[100]:e.palette.grey[900];return{root:{display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",zIndex:e.zIndex.appBar,flexShrink:0},positionFixed:{position:"fixed",top:0,left:"auto",right:0,"@media print":{position:"absolute"}},positionAbsolute:{position:"absolute",top:0,left:"auto",right:0},positionSticky:{position:"sticky",top:0,left:"auto",right:0},positionStatic:{position:"static",transform:"translateZ(0)"},positionRelative:{position:"relative"},colorDefault:{backgroundColor:t,color:e.palette.getContrastText(t)},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},colorInherit:{color:"inherit"},colorTransparent:{backgroundColor:"transparent",color:"inherit"}}}),{name:"MuiAppBar"})(c)},2692:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=n(3637),u=o.forwardRef((function(e,t){var n=e.children,s=e.classes,u=e.className,c=e.invisible,d=void 0!==c&&c,h=e.open,f=e.transitionDuration,p=(0,i.Z)(e,["children","classes","className","invisible","open","transitionDuration"]);return o.createElement(l.Z,(0,r.Z)({in:h,timeout:f},p),o.createElement("div",{className:(0,a.default)(s.root,u,d&&s.invisible),"aria-hidden":!0,ref:t},n))}));const c=(0,s.Z)({root:{zIndex:-1,position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},invisible:{backgroundColor:"transparent"}},{name:"MuiBackdrop"})(u)},573:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=n(3871),u=o.forwardRef((function(e,t){var n=e.anchorOrigin,s=void 0===n?{vertical:"top",horizontal:"right"}:n,u=e.badgeContent,c=e.children,d=e.classes,h=e.className,f=e.color,p=void 0===f?"default":f,m=e.component,g=void 0===m?"span":m,v=e.invisible,y=e.max,b=void 0===y?99:y,w=e.overlap,E=void 0===w?"rectangle":w,_=e.showZero,C=void 0!==_&&_,S=e.variant,x=void 0===S?"standard":S,T=(0,i.Z)(e,["anchorOrigin","badgeContent","children","classes","className","color","component","invisible","max","overlap","showZero","variant"]),I=v;null==v&&(0===u&&!C||null==u&&"dot"!==x)&&(I=!0);var k="";return"dot"!==x&&(k=u>b?"".concat(b,"+"):u),o.createElement(g,(0,r.Z)({className:(0,a.default)(d.root,h),ref:t},T),c,o.createElement("span",{className:(0,a.default)(d.badge,d["".concat(s.horizontal).concat((0,l.Z)(s.vertical),"}")],d["anchorOrigin".concat((0,l.Z)(s.vertical)).concat((0,l.Z)(s.horizontal)).concat((0,l.Z)(E))],"default"!==p&&d["color".concat((0,l.Z)(p))],I&&d.invisible,"dot"===x&&d.dot)},k))}));const c=(0,s.Z)((function(e){return{root:{position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0},badge:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:20,lineHeight:1,padding:"0 6px",height:20,borderRadius:10,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen})},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},colorError:{backgroundColor:e.palette.error.main,color:e.palette.error.contrastText},dot:{borderRadius:4,height:8,minWidth:8,padding:0},anchorOriginTopRightRectangle:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%","&$invisible":{transform:"scale(0) translate(50%, -50%)"}},anchorOriginBottomRightRectangle:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%","&$invisible":{transform:"scale(0) translate(50%, 50%)"}},anchorOriginTopLeftRectangle:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%","&$invisible":{transform:"scale(0) translate(-50%, -50%)"}},anchorOriginBottomLeftRectangle:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%","&$invisible":{transform:"scale(0) translate(-50%, 50%)"}},anchorOriginTopRightCircle:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%","&$invisible":{transform:"scale(0) translate(50%, -50%)"}},anchorOriginBottomRightCircle:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%","&$invisible":{transform:"scale(0) translate(50%, 50%)"}},anchorOriginTopLeftCircle:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%","&$invisible":{transform:"scale(0) translate(-50%, -50%)"}},anchorOriginBottomLeftCircle:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%","&$invisible":{transform:"scale(0) translate(-50%, 50%)"}},invisible:{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})}}}),{name:"MuiBadge"})(u)},7237:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>N,styleFunction:()=>P});var r=n(5061),i=n(2122),o=(n(5697),n(9668));const a=function(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(1253),i=n(2122),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=n(9693),u=n(4720),c=n(3871),d=o.forwardRef((function(e,t){var n=e.children,s=e.classes,l=e.className,d=e.color,h=void 0===d?"default":d,f=e.component,p=void 0===f?"button":f,m=e.disabled,g=void 0!==m&&m,v=e.disableElevation,y=void 0!==v&&v,b=e.disableFocusRipple,w=void 0!==b&&b,E=e.endIcon,_=e.focusVisibleClassName,C=e.fullWidth,S=void 0!==C&&C,x=e.size,T=void 0===x?"medium":x,I=e.startIcon,k=e.type,O=void 0===k?"button":k,P=e.variant,N=void 0===P?"text":P,A=(0,r.Z)(e,["children","classes","className","color","component","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"]),D=I&&o.createElement("span",{className:(0,a.default)(s.startIcon,s["iconSize".concat((0,c.Z)(T))])},I),R=E&&o.createElement("span",{className:(0,a.default)(s.endIcon,s["iconSize".concat((0,c.Z)(T))])},E);return o.createElement(u.Z,(0,i.Z)({className:(0,a.default)(s.root,s[N],l,"inherit"===h?s.colorInherit:"default"!==h&&s["".concat(N).concat((0,c.Z)(h))],"medium"!==T&&[s["".concat(N,"Size").concat((0,c.Z)(T))],s["size".concat((0,c.Z)(T))]],y&&s.disableElevation,g&&s.disabled,S&&s.fullWidth),component:p,disabled:g,focusRipple:!w,focusVisibleClassName:(0,a.default)(s.focusVisible,_),ref:t,type:O},A),o.createElement("span",{className:s.label},D,n,R))}));const h=(0,s.Z)((function(e){return{root:(0,i.Z)({},e.typography.button,{boxSizing:"border-box",minWidth:64,padding:"6px 16px",borderRadius:e.shape.borderRadius,color:e.palette.text.primary,transition:e.transitions.create(["background-color","box-shadow","border"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none",backgroundColor:(0,l.U1)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}},"&$disabled":{color:e.palette.action.disabled}}),label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},text:{padding:"6px 8px"},textPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,l.U1)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},textSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,l.U1)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlined:{padding:"5px 15px",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"&$disabled":{border:"1px solid ".concat(e.palette.action.disabledBackground)}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat((0,l.U1)(e.palette.primary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.primary.main),backgroundColor:(0,l.U1)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat((0,l.U1)(e.palette.secondary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.secondary.main),backgroundColor:(0,l.U1)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{border:"1px solid ".concat(e.palette.action.disabled)}},contained:{color:e.palette.getContrastText(e.palette.grey[300]),backgroundColor:e.palette.grey[300],boxShadow:e.shadows[2],"&:hover":{backgroundColor:e.palette.grey.A100,boxShadow:e.shadows[4],"@media (hover: none)":{boxShadow:e.shadows[2],backgroundColor:e.palette.grey[300]},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}},"&$focusVisible":{boxShadow:e.shadows[6]},"&:active":{boxShadow:e.shadows[8]},"&$disabled":{color:e.palette.action.disabled,boxShadow:e.shadows[0],backgroundColor:e.palette.action.disabledBackground}},containedPrimary:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:hover":{backgroundColor:e.palette.primary.dark,"@media (hover: none)":{backgroundColor:e.palette.primary.main}}},containedSecondary:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.main,"&:hover":{backgroundColor:e.palette.secondary.dark,"@media (hover: none)":{backgroundColor:e.palette.secondary.main}}},disableElevation:{boxShadow:"none","&:hover":{boxShadow:"none"},"&$focusVisible":{boxShadow:"none"},"&:active":{boxShadow:"none"},"&$disabled":{boxShadow:"none"}},focusVisible:{},disabled:{},colorInherit:{color:"inherit",borderColor:"currentColor"},textSizeSmall:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},textSizeLarge:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},outlinedSizeSmall:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},outlinedSizeLarge:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},containedSizeSmall:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},containedSizeLarge:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},sizeSmall:{},sizeLarge:{},fullWidth:{width:"100%"},startIcon:{display:"inherit",marginRight:8,marginLeft:-4,"&$iconSizeSmall":{marginLeft:-2}},endIcon:{display:"inherit",marginRight:-4,marginLeft:8,"&$iconSizeSmall":{marginRight:-2}},iconSizeSmall:{"& > *:first-child":{fontSize:18}},iconSizeMedium:{"& > *:first-child":{fontSize:20}},iconSizeLarge:{"& > *:first-child":{fontSize:22}}}}),{name:"MuiButton"})(d)},4720:(e,t,n)=>{"use strict";n.d(t,{Z:()=>k});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(3935)),s=n(6010),l=n(3834),u=n(5192),c=n(4670),d=n(4896),h=n(5061),f=n(9756),p=n(1788),m=n(3349),g=n(220);function v(e,t){var n=Object.create(null);return e&&o.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&(0,o.isValidElement)(e)?t(e):e}(e)})),n}function y(e,t,n){return null!=n[t]?n[t]:e.props[t]}function b(e,t,n){var r=v(e.children),i=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,i=Object.create(null),o=[];for(var a in e)a in t?o.length&&(i[a]=o,o=[]):o.push(a);var s={};for(var l in t){if(i[l])for(r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.pulsate,i=void 0!==r&&r,o=t.center,s=void 0===o?a||t.pulsate:o,l=t.fakeElement,u=void 0!==l&&l;if("mousedown"===e.type&&v.current)v.current=!1;else{"touchstart"===e.type&&(v.current=!0);var c,d,h,f=u?null:w.current,p=f?f.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(s||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(p.width/2),d=Math.round(p.height/2);else{var m=e.clientX?e.clientX:e.touches[0].clientX,g=e.clientY?e.clientY:e.touches[0].clientY;c=Math.round(m-p.left),d=Math.round(g-p.top)}if(s)(h=Math.sqrt((2*Math.pow(p.width,2)+Math.pow(p.height,2))/3))%2==0&&(h+=1);else{var _=2*Math.max(Math.abs((f?f.clientWidth:0)-c),c)+2,C=2*Math.max(Math.abs((f?f.clientHeight:0)-d),d)+2;h=Math.sqrt(Math.pow(_,2)+Math.pow(C,2))}e.touches?null===b.current&&(b.current=function(){E({pulsate:i,rippleX:c,rippleY:d,rippleSize:h,cb:n})},y.current=setTimeout((function(){b.current&&(b.current(),b.current=null)}),80)):E({pulsate:i,rippleX:c,rippleY:d,rippleSize:h,cb:n})}}),[a,E]),x=o.useCallback((function(){C({},{pulsate:!0})}),[C]),T=o.useCallback((function(e,t){if(clearTimeout(y.current),"touchend"===e.type&&b.current)return e.persist(),b.current(),b.current=null,void(y.current=setTimeout((function(){T(e,t)})));b.current=null,p((function(e){return e.length>0?e.slice(1):e})),g.current=t}),[]);return o.useImperativeHandle(t,(function(){return{pulsate:x,start:C,stop:T}}),[x,C,T]),o.createElement("span",(0,r.Z)({className:(0,s.default)(l.root,u),ref:w},c),o.createElement(_,{component:null,exit:!0},f))}));const T=(0,c.Z)((function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(o.memo(x));var I=o.forwardRef((function(e,t){var n=e.action,c=e.buttonRef,h=e.centerRipple,f=void 0!==h&&h,p=e.children,m=e.classes,g=e.className,v=e.component,y=void 0===v?"button":v,b=e.disabled,w=void 0!==b&&b,E=e.disableRipple,_=void 0!==E&&E,C=e.disableTouchRipple,S=void 0!==C&&C,x=e.focusRipple,I=void 0!==x&&x,k=e.focusVisibleClassName,O=e.onBlur,P=e.onClick,N=e.onFocus,A=e.onFocusVisible,D=e.onKeyDown,R=e.onKeyUp,M=e.onMouseDown,L=e.onMouseLeave,j=e.onMouseUp,F=e.onTouchEnd,W=e.onTouchMove,B=e.onTouchStart,z=e.onDragLeave,U=e.tabIndex,V=void 0===U?0:U,Z=e.TouchRippleProps,$=e.type,q=void 0===$?"button":$,H=(0,i.Z)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),K=o.useRef(null),G=o.useRef(null),Q=o.useState(!1),Y=Q[0],X=Q[1];w&&Y&&X(!1);var J=(0,d.Z)(),ee=J.isFocusVisible,te=J.onBlurVisible,ne=J.ref;function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:S;return(0,u.Z)((function(r){return t&&t(r),!n&&G.current&&G.current[e](r),!0}))}o.useImperativeHandle(n,(function(){return{focusVisible:function(){X(!0),K.current.focus()}}}),[]),o.useEffect((function(){Y&&I&&!_&&G.current.pulsate()}),[_,I,Y]);var ie=re("start",M),oe=re("stop",z),ae=re("stop",j),se=re("stop",(function(e){Y&&e.preventDefault(),L&&L(e)})),le=re("start",B),ue=re("stop",F),ce=re("stop",W),de=re("stop",(function(e){Y&&(te(e),X(!1)),O&&O(e)}),!1),he=(0,u.Z)((function(e){K.current||(K.current=e.currentTarget),ee(e)&&(X(!0),A&&A(e)),N&&N(e)})),fe=function(){var e=a.findDOMNode(K.current);return y&&"button"!==y&&!("A"===e.tagName&&e.href)},pe=o.useRef(!1),me=(0,u.Z)((function(e){I&&!pe.current&&Y&&G.current&&" "===e.key&&(pe.current=!0,e.persist(),G.current.stop(e,(function(){G.current.start(e)}))),e.target===e.currentTarget&&fe()&&" "===e.key&&e.preventDefault(),D&&D(e),e.target===e.currentTarget&&fe()&&"Enter"===e.key&&!w&&(e.preventDefault(),P&&P(e))})),ge=(0,u.Z)((function(e){I&&" "===e.key&&G.current&&Y&&!e.defaultPrevented&&(pe.current=!1,e.persist(),G.current.stop(e,(function(){G.current.pulsate(e)}))),R&&R(e),P&&e.target===e.currentTarget&&fe()&&" "===e.key&&!e.defaultPrevented&&P(e)})),ve=y;"button"===ve&&H.href&&(ve="a");var ye={};"button"===ve?(ye.type=q,ye.disabled=w):("a"===ve&&H.href||(ye.role="button"),ye["aria-disabled"]=w);var be=(0,l.Z)(c,t),we=(0,l.Z)(ne,K),Ee=(0,l.Z)(be,we),_e=o.useState(!1),Ce=_e[0],Se=_e[1];o.useEffect((function(){Se(!0)}),[]);var xe=Ce&&!_&&!w;return o.createElement(ve,(0,r.Z)({className:(0,s.default)(m.root,g,Y&&[m.focusVisible,k],w&&m.disabled),onBlur:de,onClick:P,onFocus:he,onKeyDown:me,onKeyUp:ge,onMouseDown:ie,onMouseLeave:se,onMouseUp:ae,onDragLeave:oe,onTouchEnd:ue,onTouchMove:ce,onTouchStart:le,ref:Ee,tabIndex:w?-1:V},ye,H),p,xe?o.createElement(T,(0,r.Z)({ref:G,center:f},Z)):null)}));const k=(0,c.Z)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(I)},2719:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>b});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(6608),l=n(3786);const u=(0,l.Z)(o.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),c=(0,l.Z)(o.createElement("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox");var d=n(9693);const h=(0,l.Z)(o.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");var f=n(3871),p=n(4670),m=o.createElement(c,null),g=o.createElement(u,null),v=o.createElement(h,null),y=o.forwardRef((function(e,t){var n=e.checkedIcon,l=void 0===n?m:n,u=e.classes,c=e.color,d=void 0===c?"secondary":c,h=e.icon,p=void 0===h?g:h,y=e.indeterminate,b=void 0!==y&&y,w=e.indeterminateIcon,E=void 0===w?v:w,_=e.inputProps,C=e.size,S=void 0===C?"medium":C,x=(0,i.Z)(e,["checkedIcon","classes","color","icon","indeterminate","indeterminateIcon","inputProps","size"]);return o.createElement(s.Z,(0,r.Z)({type:"checkbox",classes:{root:(0,a.default)(u.root,u["color".concat((0,f.Z)(d))],b&&u.indeterminate),checked:u.checked,disabled:u.disabled},color:d,inputProps:(0,r.Z)({"data-indeterminate":b},_),icon:o.cloneElement(b?E:p,{fontSize:"small"===S?"small":"default"}),checkedIcon:o.cloneElement(b?E:l,{fontSize:"small"===S?"small":"default"}),ref:t},x))}));const b=(0,p.Z)((function(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},indeterminate:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,d.U1)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,d.U1)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}}),{name:"MuiCheckbox"})(y)},1267:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010));const s=(0,n(3786).Z)(o.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");var l=n(4670),u=n(9693),c=n(3834),d=n(3871),h=n(4720);function f(e){return"Backspace"===e.key||"Delete"===e.key}var p=o.forwardRef((function(e,t){var n=e.avatar,l=e.classes,u=e.className,p=e.clickable,m=e.color,g=void 0===m?"default":m,v=e.component,y=e.deleteIcon,b=e.disabled,w=void 0!==b&&b,E=e.icon,_=e.label,C=e.onClick,S=e.onDelete,x=e.onKeyDown,T=e.onKeyUp,I=e.size,k=void 0===I?"medium":I,O=e.variant,P=void 0===O?"default":O,N=(0,i.Z)(e,["avatar","classes","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant"]),A=o.useRef(null),D=(0,c.Z)(A,t),R=function(e){e.stopPropagation(),S&&S(e)},M=!(!1===p||!C)||p,L="small"===k,j=v||(M?h.Z:"div"),F=j===h.Z?{component:"div"}:{},W=null;if(S){var B=(0,a.default)("default"!==g&&("default"===P?l["deleteIconColor".concat((0,d.Z)(g))]:l["deleteIconOutlinedColor".concat((0,d.Z)(g))]),L&&l.deleteIconSmall);W=y&&o.isValidElement(y)?o.cloneElement(y,{className:(0,a.default)(y.props.className,l.deleteIcon,B),onClick:R}):o.createElement(s,{className:(0,a.default)(l.deleteIcon,B),onClick:R})}var z=null;n&&o.isValidElement(n)&&(z=o.cloneElement(n,{className:(0,a.default)(l.avatar,n.props.className,L&&l.avatarSmall,"default"!==g&&l["avatarColor".concat((0,d.Z)(g))])}));var U=null;return E&&o.isValidElement(E)&&(U=o.cloneElement(E,{className:(0,a.default)(l.icon,E.props.className,L&&l.iconSmall,"default"!==g&&l["iconColor".concat((0,d.Z)(g))])})),o.createElement(j,(0,r.Z)({role:M||S?"button":void 0,className:(0,a.default)(l.root,u,"default"!==g&&[l["color".concat((0,d.Z)(g))],M&&l["clickableColor".concat((0,d.Z)(g))],S&&l["deletableColor".concat((0,d.Z)(g))]],"default"!==P&&[l.outlined,{primary:l.outlinedPrimary,secondary:l.outlinedSecondary}[g]],w&&l.disabled,L&&l.sizeSmall,M&&l.clickable,S&&l.deletable),"aria-disabled":!!w||void 0,tabIndex:M||S?0:void 0,onClick:C,onKeyDown:function(e){e.currentTarget===e.target&&f(e)&&e.preventDefault(),x&&x(e)},onKeyUp:function(e){e.currentTarget===e.target&&(S&&f(e)?S(e):"Escape"===e.key&&A.current&&A.current.blur()),T&&T(e)},ref:D},F,N),z||U,o.createElement("span",{className:(0,a.default)(l.label,L&&l.labelSmall)},_),W)}));const m=(0,l.Z)((function(e){var t="light"===e.palette.type?e.palette.grey[300]:e.palette.grey[700],n=(0,u.U1)(e.palette.text.primary,.26);return{root:{fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:e.palette.getContrastText(t),backgroundColor:t,borderRadius:16,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"default",outline:0,textDecoration:"none",border:"none",padding:0,verticalAlign:"middle",boxSizing:"border-box","&$disabled":{opacity:.5,pointerEvents:"none"},"& $avatar":{marginLeft:5,marginRight:-6,width:24,height:24,color:"light"===e.palette.type?e.palette.grey[700]:e.palette.grey[300],fontSize:e.typography.pxToRem(12)},"& $avatarColorPrimary":{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.dark},"& $avatarColorSecondary":{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.dark},"& $avatarSmall":{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)}},sizeSmall:{height:24},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},disabled:{},clickable:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover, &:focus":{backgroundColor:(0,u._4)(t,.08)},"&:active":{boxShadow:e.shadows[1]}},clickableColorPrimary:{"&:hover, &:focus":{backgroundColor:(0,u._4)(e.palette.primary.main,.08)}},clickableColorSecondary:{"&:hover, &:focus":{backgroundColor:(0,u._4)(e.palette.secondary.main,.08)}},deletable:{"&:focus":{backgroundColor:(0,u._4)(t,.08)}},deletableColorPrimary:{"&:focus":{backgroundColor:(0,u._4)(e.palette.primary.main,.2)}},deletableColorSecondary:{"&:focus":{backgroundColor:(0,u._4)(e.palette.secondary.main,.2)}},outlined:{backgroundColor:"transparent",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,u.U1)(e.palette.text.primary,e.palette.action.hoverOpacity)},"& $avatar":{marginLeft:4},"& $avatarSmall":{marginLeft:2},"& $icon":{marginLeft:4},"& $iconSmall":{marginLeft:2},"& $deleteIcon":{marginRight:5},"& $deleteIconSmall":{marginRight:3}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat(e.palette.primary.main),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,u.U1)(e.palette.primary.main,e.palette.action.hoverOpacity)}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat(e.palette.secondary.main),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,u.U1)(e.palette.secondary.main,e.palette.action.hoverOpacity)}},avatar:{},avatarSmall:{},avatarColorPrimary:{},avatarColorSecondary:{},icon:{color:"light"===e.palette.type?e.palette.grey[700]:e.palette.grey[300],marginLeft:5,marginRight:-6},iconSmall:{width:18,height:18,marginLeft:4,marginRight:-4},iconColorPrimary:{color:"inherit"},iconColorSecondary:{color:"inherit"},label:{overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},labelSmall:{paddingLeft:8,paddingRight:8},deleteIcon:{WebkitTapHighlightColor:"transparent",color:n,height:22,width:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:(0,u.U1)(n,.4)}},deleteIconSmall:{height:16,width:16,marginRight:4,marginLeft:-4},deleteIconColorPrimary:{color:(0,u.U1)(e.palette.primary.contrastText,.7),"&:hover, &:active":{color:e.palette.primary.contrastText}},deleteIconColorSecondary:{color:(0,u.U1)(e.palette.secondary.contrastText,.7),"&:hover, &:active":{color:e.palette.secondary.contrastText}},deleteIconOutlinedColorPrimary:{color:(0,u.U1)(e.palette.primary.main,.7),"&:hover, &:active":{color:e.palette.primary.main}},deleteIconOutlinedColorSecondary:{color:(0,u.U1)(e.palette.secondary.main,.7),"&:hover, &:active":{color:e.palette.secondary.main}}}}),{name:"MuiChip"})(p)},5851:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.Z});var r=n(1267)},3195:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var r=n(2122),i=n(1253),o=n(6156),a=n(7294),s=(n(5697),n(6010)),l=n(4670),u=n(3871),c=a.forwardRef((function(e,t){var n=e.classes,o=e.className,l=e.component,c=void 0===l?"div":l,d=e.disableGutters,h=void 0!==d&&d,f=e.fixed,p=void 0!==f&&f,m=e.maxWidth,g=void 0===m?"lg":m,v=(0,i.Z)(e,["classes","className","component","disableGutters","fixed","maxWidth"]);return a.createElement(c,(0,r.Z)({className:(0,s.default)(n.root,o,p&&n.fixed,h&&n.disableGutters,!1!==g&&n["maxWidth".concat((0,u.Z)(String(g)))]),ref:t},v))}));const d=(0,l.Z)((function(e){return{root:(0,o.Z)({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",paddingLeft:e.spacing(2),paddingRight:e.spacing(2),display:"block"},e.breakpoints.up("sm"),{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}),disableGutters:{paddingLeft:0,paddingRight:0},fixed:Object.keys(e.breakpoints.values).reduce((function(t,n){var r=e.breakpoints.values[n];return 0!==r&&(t[e.breakpoints.up(n)]={maxWidth:r}),t}),{}),maxWidthXs:(0,o.Z)({},e.breakpoints.up("xs"),{maxWidth:Math.max(e.breakpoints.values.xs,444)}),maxWidthSm:(0,o.Z)({},e.breakpoints.up("sm"),{maxWidth:e.breakpoints.values.sm}),maxWidthMd:(0,o.Z)({},e.breakpoints.up("md"),{maxWidth:e.breakpoints.values.md}),maxWidthLg:(0,o.Z)({},e.breakpoints.up("lg"),{maxWidth:e.breakpoints.values.lg}),maxWidthXl:(0,o.Z)({},e.breakpoints.up("xl"),{maxWidth:e.breakpoints.values.xl})}}),{name:"MuiContainer"})(c)},2411:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>v});var r=n(2122),i=n(1253),o=n(6156),a=n(7294),s=(n(5697),n(6010)),l=n(4670),u=n(3871),c=n(6423),d=n(2692),h=n(3637),f=n(3366),p=n(9895),m={enter:f.x9.enteringScreen,exit:f.x9.leavingScreen},g=a.forwardRef((function(e,t){var n=e.BackdropProps,o=e.children,l=e.classes,f=e.className,g=e.disableBackdropClick,v=void 0!==g&&g,y=e.disableEscapeKeyDown,b=void 0!==y&&y,w=e.fullScreen,E=void 0!==w&&w,_=e.fullWidth,C=void 0!==_&&_,S=e.maxWidth,x=void 0===S?"sm":S,T=e.onBackdropClick,I=e.onClose,k=e.onEnter,O=e.onEntered,P=e.onEntering,N=e.onEscapeKeyDown,A=e.onExit,D=e.onExited,R=e.onExiting,M=e.open,L=e.PaperComponent,j=void 0===L?p.Z:L,F=e.PaperProps,W=void 0===F?{}:F,B=e.scroll,z=void 0===B?"paper":B,U=e.TransitionComponent,V=void 0===U?h.Z:U,Z=e.transitionDuration,$=void 0===Z?m:Z,q=e.TransitionProps,H=e["aria-describedby"],K=e["aria-labelledby"],G=(0,i.Z)(e,["BackdropProps","children","classes","className","disableBackdropClick","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","onEnter","onEntered","onEntering","onEscapeKeyDown","onExit","onExited","onExiting","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps","aria-describedby","aria-labelledby"]),Q=a.useRef();return a.createElement(c.Z,(0,r.Z)({className:(0,s.default)(l.root,f),BackdropComponent:d.Z,BackdropProps:(0,r.Z)({transitionDuration:$},n),closeAfterTransition:!0,disableBackdropClick:v,disableEscapeKeyDown:b,onEscapeKeyDown:N,onClose:I,open:M,ref:t},G),a.createElement(V,(0,r.Z)({appear:!0,in:M,timeout:$,onEnter:k,onEntering:P,onEntered:O,onExit:A,onExiting:R,onExited:D,role:"none presentation"},q),a.createElement("div",{className:(0,s.default)(l.container,l["scroll".concat((0,u.Z)(z))]),onClick:function(e){e.target===e.currentTarget&&e.target===Q.current&&(Q.current=null,T&&T(e),!v&&I&&I(e,"backdropClick"))},onMouseDown:function(e){Q.current=e.target}},a.createElement(j,(0,r.Z)({elevation:24,role:"dialog","aria-describedby":H,"aria-labelledby":K},W,{className:(0,s.default)(l.paper,l["paperScroll".concat((0,u.Z)(z))],l["paperWidth".concat((0,u.Z)(String(x)))],W.className,E&&l.paperFullScreen,C&&l.paperFullWidth)}),o))))}));const v=(0,l.Z)((function(e){return{root:{"@media print":{position:"absolute !important"}},scrollPaper:{display:"flex",justifyContent:"center",alignItems:"center"},scrollBody:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&:after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}},container:{height:"100%","@media print":{height:"auto"},outline:0},paper:{margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},paperScrollPaper:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},paperScrollBody:{display:"inline-block",verticalAlign:"middle",textAlign:"left"},paperWidthFalse:{maxWidth:"calc(100% - 64px)"},paperWidthXs:{maxWidth:Math.max(e.breakpoints.values.xs,444),"&$paperScrollBody":(0,o.Z)({},e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64),{maxWidth:"calc(100% - 64px)"})},paperWidthSm:{maxWidth:e.breakpoints.values.sm,"&$paperScrollBody":(0,o.Z)({},e.breakpoints.down(e.breakpoints.values.sm+64),{maxWidth:"calc(100% - 64px)"})},paperWidthMd:{maxWidth:e.breakpoints.values.md,"&$paperScrollBody":(0,o.Z)({},e.breakpoints.down(e.breakpoints.values.md+64),{maxWidth:"calc(100% - 64px)"})},paperWidthLg:{maxWidth:e.breakpoints.values.lg,"&$paperScrollBody":(0,o.Z)({},e.breakpoints.down(e.breakpoints.values.lg+64),{maxWidth:"calc(100% - 64px)"})},paperWidthXl:{maxWidth:e.breakpoints.values.xl,"&$paperScrollBody":(0,o.Z)({},e.breakpoints.down(e.breakpoints.values.xl+64),{maxWidth:"calc(100% - 64px)"})},paperFullWidth:{width:"calc(100% - 64px)"},paperFullScreen:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,"&$paperScrollBody":{margin:0,maxWidth:"100%"}}}}),{name:"MuiDialog"})(g)},6248:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=o.forwardRef((function(e,t){var n=e.disableSpacing,s=void 0!==n&&n,l=e.classes,u=e.className,c=(0,i.Z)(e,["disableSpacing","classes","className"]);return o.createElement("div",(0,r.Z)({className:(0,a.default)(l.root,u,!s&&l.spacing),ref:t},c))}));const u=(0,s.Z)({root:{display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},spacing:{"& > :not(:first-child)":{marginLeft:8}}},{name:"MuiDialogActions"})(l)},814:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=o.forwardRef((function(e,t){var n=e.classes,s=e.className,l=e.dividers,u=void 0!==l&&l,c=(0,i.Z)(e,["classes","className","dividers"]);return o.createElement("div",(0,r.Z)({className:(0,a.default)(n.root,s,u&&n.dividers),ref:t},c))}));const u=(0,s.Z)((function(e){return{root:{flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"8px 24px","&:first-child":{paddingTop:20}},dividers:{padding:"16px 24px",borderTop:"1px solid ".concat(e.palette.divider),borderBottom:"1px solid ".concat(e.palette.divider)}}}),{name:"MuiDialogContent"})(l)},8101:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(2122),i=n(7294),o=(n(5697),n(4670)),a=n(2318),s=i.forwardRef((function(e,t){return i.createElement(a.Z,(0,r.Z)({component:"p",variant:"body1",color:"textSecondary",ref:t},e))}));const l=(0,o.Z)({root:{marginBottom:12}},{name:"MuiDialogContentText"})(s)},6222:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=n(2318),u=o.forwardRef((function(e,t){var n=e.children,s=e.classes,u=e.className,c=e.disableTypography,d=void 0!==c&&c,h=(0,i.Z)(e,["children","classes","className","disableTypography"]);return o.createElement("div",(0,r.Z)({className:(0,a.default)(s.root,u),ref:t},h),d?n:o.createElement(l.Z,{component:"h2",variant:"h6"},n))}));const c=(0,s.Z)({root:{margin:0,padding:"16px 24px",flex:"0 0 auto"}},{name:"MuiDialogTitle"})(u)},3636:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=n(9693),u=o.forwardRef((function(e,t){var n=e.absolute,s=void 0!==n&&n,l=e.classes,u=e.className,c=e.component,d=void 0===c?"hr":c,h=e.flexItem,f=void 0!==h&&h,p=e.light,m=void 0!==p&&p,g=e.orientation,v=void 0===g?"horizontal":g,y=e.role,b=void 0===y?"hr"!==d?"separator":void 0:y,w=e.variant,E=void 0===w?"fullWidth":w,_=(0,i.Z)(e,["absolute","classes","className","component","flexItem","light","orientation","role","variant"]);return o.createElement(d,(0,r.Z)({className:(0,a.default)(l.root,u,"fullWidth"!==E&&l[E],s&&l.absolute,f&&l.flexItem,m&&l.light,"vertical"===v&&l.vertical),role:b,ref:t},_))}));const c=(0,s.Z)((function(e){return{root:{height:1,margin:0,border:"none",flexShrink:0,backgroundColor:e.palette.divider},absolute:{position:"absolute",bottom:0,left:0,width:"100%"},inset:{marginLeft:72},light:{backgroundColor:(0,l.U1)(e.palette.divider,.08)},middle:{marginLeft:e.spacing(2),marginRight:e.spacing(2)},vertical:{height:"100%",width:1},flexItem:{alignSelf:"stretch",height:"auto"}}}),{name:"MuiDivider"})(u)},9643:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>x});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(6423),l=n(2692),u=n(4670),c=n(3935),d=n(9437),h=n(2666),f=n(3834),p=n(8920),m=n(3366),g=n(5653);function v(e,t){var n=function(e,t){var n,r=t.getBoundingClientRect();if(t.fakeTransform)n=t.fakeTransform;else{var i=window.getComputedStyle(t);n=i.getPropertyValue("-webkit-transform")||i.getPropertyValue("transform")}var o=0,a=0;if(n&&"none"!==n&&"string"==typeof n){var s=n.split("(")[1].split(")")[0].split(",");o=parseInt(s[4],10),a=parseInt(s[5],10)}return"left"===e?"translateX(".concat(window.innerWidth,"px) translateX(-").concat(r.left-o,"px)"):"right"===e?"translateX(-".concat(r.left+r.width-o,"px)"):"up"===e?"translateY(".concat(window.innerHeight,"px) translateY(-").concat(r.top-a,"px)"):"translateY(-".concat(r.top+r.height-a,"px)")}(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}var y={enter:m.x9.enteringScreen,exit:m.x9.leavingScreen};const b=o.forwardRef((function(e,t){var n=e.children,a=e.direction,s=void 0===a?"down":a,l=e.in,u=e.onEnter,m=e.onEntering,b=e.onExit,w=e.onExited,E=e.style,_=e.timeout,C=void 0===_?y:_,S=(0,i.Z)(e,["children","direction","in","onEnter","onEntering","onExit","onExited","style","timeout"]),x=(0,p.Z)(),T=o.useRef(null),I=o.useCallback((function(e){T.current=c.findDOMNode(e)}),[]),k=(0,f.Z)(n.ref,I),O=(0,f.Z)(k,t),P=o.useCallback((function(){T.current&&v(s,T.current)}),[s]);return o.useEffect((function(){if(!l&&"down"!==s&&"right"!==s){var e=(0,d.Z)((function(){T.current&&v(s,T.current)}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}}),[s,l]),o.useEffect((function(){l||P()}),[l,P]),o.createElement(h.ZP,(0,r.Z)({onEnter:function(e,t){var n=T.current;v(s,n),(0,g.n)(n),u&&u(n,t)},onEntering:function(e,t){var n=T.current,i=(0,g.C)({timeout:C,style:E},{mode:"enter"});n.style.webkitTransition=x.transitions.create("-webkit-transform",(0,r.Z)({},i,{easing:x.transitions.easing.easeOut})),n.style.transition=x.transitions.create("transform",(0,r.Z)({},i,{easing:x.transitions.easing.easeOut})),n.style.webkitTransform="none",n.style.transform="none",m&&m(n,t)},onExit:function(){var e=T.current,t=(0,g.C)({timeout:C,style:E},{mode:"exit"});e.style.webkitTransition=x.transitions.create("-webkit-transform",(0,r.Z)({},t,{easing:x.transitions.easing.sharp})),e.style.transition=x.transitions.create("transform",(0,r.Z)({},t,{easing:x.transitions.easing.sharp})),v(s,e),b&&b(e)},onExited:function(){var e=T.current;e.style.webkitTransition="",e.style.transition="",w&&w(e)},appear:!0,in:l,timeout:C},S),(function(e,t){return o.cloneElement(n,(0,r.Z)({ref:O,style:(0,r.Z)({visibility:"exited"!==e||l?void 0:"hidden"},E,{},n.props.style)},t))}))}));var w=n(9895),E=n(3871),_={left:"right",right:"left",top:"down",bottom:"up"},C={enter:m.x9.enteringScreen,exit:m.x9.leavingScreen},S=o.forwardRef((function(e,t){var n=e.anchor,u=void 0===n?"left":n,c=e.BackdropProps,d=e.children,h=e.classes,f=e.className,m=e.elevation,g=void 0===m?16:m,v=e.ModalProps,y=(v=void 0===v?{}:v).BackdropProps,S=(0,i.Z)(v,["BackdropProps"]),x=e.onClose,T=e.open,I=void 0!==T&&T,k=e.PaperProps,O=void 0===k?{}:k,P=e.SlideProps,N=e.transitionDuration,A=void 0===N?C:N,D=e.variant,R=void 0===D?"temporary":D,M=(0,i.Z)(e,["anchor","BackdropProps","children","classes","className","elevation","ModalProps","onClose","open","PaperProps","SlideProps","transitionDuration","variant"]),L=(0,p.Z)(),j=o.useRef(!1);o.useEffect((function(){j.current=!0}),[]);var F=function(e,t){return"rtl"===e.direction&&function(e){return-1!==["left","right"].indexOf(e)}(t)?_[t]:t}(L,u),W=o.createElement(w.Z,(0,r.Z)({elevation:"temporary"===R?g:0,square:!0},O,{className:(0,a.default)(h.paper,h["paperAnchor".concat((0,E.Z)(F))],O.className,"temporary"!==R&&h["paperAnchorDocked".concat((0,E.Z)(F))])}),d);if("permanent"===R)return o.createElement("div",(0,r.Z)({className:(0,a.default)(h.root,h.docked,f),ref:t},M),W);var B=o.createElement(b,(0,r.Z)({in:I,direction:_[F],timeout:A,appear:j.current},P),W);return"persistent"===R?o.createElement("div",(0,r.Z)({className:(0,a.default)(h.root,h.docked,f),ref:t},M),B):o.createElement(s.Z,(0,r.Z)({BackdropProps:(0,r.Z)({},c,{},y,{transitionDuration:A}),BackdropComponent:l.Z,className:(0,a.default)(h.root,h.modal,f),open:I,onClose:x,ref:t},M,S),B)}));const x=(0,u.Z)((function(e){return{root:{},docked:{flex:"0 0 auto"},paper:{overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:e.zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},paperAnchorLeft:{left:0,right:"auto"},paperAnchorRight:{left:"auto",right:0},paperAnchorTop:{top:0,left:0,bottom:"auto",right:0,height:"auto",maxHeight:"100%"},paperAnchorBottom:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},paperAnchorDockedLeft:{borderRight:"1px solid ".concat(e.palette.divider)},paperAnchorDockedTop:{borderBottom:"1px solid ".concat(e.palette.divider)},paperAnchorDockedRight:{borderLeft:"1px solid ".concat(e.palette.divider)},paperAnchorDockedBottom:{borderTop:"1px solid ".concat(e.palette.divider)},modal:{}}}),{name:"MuiDrawer",flip:!1})(S)},32:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=n(7294).createContext({})},9487:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>_});var r=n(2122),i=n(9968),o=n(6410),a=n(8970),s=n(8481),l=n(1253),u=n(7294),c=(n(9864),n(5697),n(6010)),d=n(2666),h=n(4670),f=n(3366),p=n(5653),m=n(8920),g=u.forwardRef((function(e,t){var n=e.children,i=e.classes,o=e.className,a=e.collapsedHeight,s=void 0===a?"0px":a,h=e.component,g=void 0===h?"div":h,v=e.in,y=e.onEnter,b=e.onEntered,w=e.onEntering,E=e.onExit,_=e.onExiting,C=e.style,S=e.timeout,x=void 0===S?f.x9.standard:S,T=(0,l.Z)(e,["children","classes","className","collapsedHeight","component","in","onEnter","onEntered","onEntering","onExit","onExiting","style","timeout"]),I=(0,m.Z)(),k=u.useRef(),O=u.useRef(null),P=u.useRef(),N="number"==typeof s?"".concat(s,"px"):s;return u.useEffect((function(){return function(){clearTimeout(k.current)}}),[]),u.createElement(d.ZP,(0,r.Z)({in:v,onEnter:function(e,t){e.style.height=N,y&&y(e,t)},onEntered:function(e,t){e.style.height="auto",b&&b(e,t)},onEntering:function(e,t){var n=O.current?O.current.clientHeight:0,r=(0,p.C)({style:C,timeout:x},{mode:"enter"}).duration;if("auto"===x){var i=I.transitions.getAutoHeightDuration(n);e.style.transitionDuration="".concat(i,"ms"),P.current=i}else e.style.transitionDuration="string"==typeof r?r:"".concat(r,"ms");e.style.height="".concat(n,"px"),w&&w(e,t)},onExit:function(e){var t=O.current?O.current.clientHeight:0;e.style.height="".concat(t,"px"),E&&E(e)},onExiting:function(e){var t=O.current?O.current.clientHeight:0,n=(0,p.C)({style:C,timeout:x},{mode:"exit"}).duration;if("auto"===x){var r=I.transitions.getAutoHeightDuration(t);e.style.transitionDuration="".concat(r,"ms"),P.current=r}else e.style.transitionDuration="string"==typeof n?n:"".concat(n,"ms");e.style.height=N,_&&_(e)},addEndListener:function(e,t){"auto"===x&&(k.current=setTimeout(t,P.current||0))},timeout:"auto"===x?null:x},T),(function(e,a){return u.createElement(g,(0,r.Z)({className:(0,c.default)(i.container,o,{entered:i.entered,exited:!v&&"0px"===N&&i.hidden}[e]),style:(0,r.Z)({minHeight:N},C),ref:t},a),u.createElement("div",{className:i.wrapper,ref:O},u.createElement("div",{className:i.wrapperInner},n)))}))}));g.muiSupportAuto=!0;const v=(0,h.Z)((function(e){return{container:{height:0,overflow:"hidden",transition:e.transitions.create("height")},entered:{height:"auto",overflow:"visible"},hidden:{visibility:"hidden"},wrapper:{display:"flex"},wrapperInner:{width:"100%"}}}),{name:"MuiCollapse"})(g);var y=n(9895),b=n(32),w=n(2775),E=u.forwardRef((function(e,t){var n,d=e.children,h=e.classes,f=e.className,p=e.defaultExpanded,m=void 0!==p&&p,g=e.disabled,E=void 0!==g&&g,_=e.expanded,C=e.onChange,S=e.square,x=void 0!==S&&S,T=e.TransitionComponent,I=void 0===T?v:T,k=e.TransitionProps,O=(0,l.Z)(e,["children","classes","className","defaultExpanded","disabled","expanded","onChange","square","TransitionComponent","TransitionProps"]),P=(0,w.Z)({controlled:_,default:m,name:"ExpansionPanel",state:"expanded"}),N=(0,s.Z)(P,2),A=N[0],D=N[1],R=u.useCallback((function(e){D(!A),C&&C(e,!A)}),[A,C,D]),M=(n=u.Children.toArray(d),(0,i.Z)(n)||(0,o.Z)(n)||(0,a.Z)()),L=M[0],j=M.slice(1),F=u.useMemo((function(){return{expanded:A,disabled:E,toggle:R}}),[A,E,R]);return u.createElement(y.Z,(0,r.Z)({className:(0,c.default)(h.root,f,A&&h.expanded,E&&h.disabled,!x&&h.rounded),ref:t,square:x},O),u.createElement(b.Z.Provider,{value:F},L),u.createElement(I,(0,r.Z)({in:A,timeout:"auto"},k),u.createElement("div",{"aria-labelledby":L.props.id,id:L.props["aria-controls"],role:"region"},j)))}));const _=(0,h.Z)((function(e){var t={duration:e.transitions.duration.shortest};return{root:{position:"relative",transition:e.transitions.create(["margin"],t),"&:before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:e.palette.divider,transition:e.transitions.create(["opacity","background-color"],t)},"&:first-child":{"&:before":{display:"none"}},"&$expanded":{margin:"16px 0","&:first-child":{marginTop:0},"&:last-child":{marginBottom:0},"&:before":{opacity:0}},"&$expanded + &":{"&:before":{display:"none"}},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}},rounded:{borderRadius:0,"&:first-child":{borderTopLeftRadius:e.shape.borderRadius,borderTopRightRadius:e.shape.borderRadius},"&:last-child":{borderBottomLeftRadius:e.shape.borderRadius,borderBottomRightRadius:e.shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},expanded:{},disabled:{}}}),{name:"MuiExpansionPanel"})(E)},6692:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=o.forwardRef((function(e,t){var n=e.classes,s=e.className,l=(0,i.Z)(e,["classes","className"]);return o.createElement("div",(0,r.Z)({className:(0,a.default)(n.root,s),ref:t},l))}));const u=(0,s.Z)({root:{display:"flex",padding:"8px 24px 24px"}},{name:"MuiExpansionPanelDetails"})(l)},2527:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4720),l=n(7812),u=n(4670),c=n(32),d=o.forwardRef((function(e,t){var n=e.children,u=e.classes,d=e.className,h=e.expandIcon,f=e.IconButtonProps,p=e.onBlur,m=e.onClick,g=e.onFocusVisible,v=(0,i.Z)(e,["children","classes","className","expandIcon","IconButtonProps","onBlur","onClick","onFocusVisible"]),y=o.useState(!1),b=y[0],w=y[1],E=o.useContext(c.Z),_=E.disabled,C=void 0!==_&&_,S=E.expanded,x=E.toggle;return o.createElement(s.Z,(0,r.Z)({focusRipple:!1,disableRipple:!0,disabled:C,component:"div","aria-expanded":S,className:(0,a.default)(u.root,d,C&&u.disabled,S&&u.expanded,b&&u.focused),onFocusVisible:function(e){w(!0),g&&g(e)},onBlur:function(e){w(!1),p&&p(e)},onClick:function(e){x&&x(e),m&&m(e)},ref:t},v),o.createElement("div",{className:(0,a.default)(u.content,S&&u.expanded)},n),h&&o.createElement(l.Z,(0,r.Z)({className:(0,a.default)(u.expandIcon,S&&u.expanded),edge:"end",component:"div",tabIndex:null,role:null,"aria-hidden":!0},f),h))}));const h=(0,u.Z)((function(e){var t={duration:e.transitions.duration.shortest};return{root:{display:"flex",minHeight:48,transition:e.transitions.create(["min-height","background-color"],t),padding:e.spacing(0,3),"&:hover:not($disabled)":{cursor:"pointer"},"&$expanded":{minHeight:64},"&$focused":{backgroundColor:e.palette.grey[300]},"&$disabled":{opacity:.38}},expanded:{},focused:{},disabled:{},content:{display:"flex",flexGrow:1,transition:e.transitions.create(["margin"],t),margin:"12px 0","&$expanded":{margin:"20px 0"}},expandIcon:{transform:"rotate(0deg)",transition:e.transitions.create("transform",t),"&:hover":{backgroundColor:"transparent"},"&$expanded":{transform:"rotate(180deg)"}}}}),{name:"MuiExpansionPanelSummary"})(d)},3637:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(2666)),s=n(3366),l=n(8920),u=n(5653),c=n(3834),d={entering:{opacity:1},entered:{opacity:1}},h={enter:s.x9.enteringScreen,exit:s.x9.leavingScreen};const f=o.forwardRef((function(e,t){var n=e.children,s=e.in,f=e.onEnter,p=e.onExit,m=e.style,g=e.timeout,v=void 0===g?h:g,y=(0,i.Z)(e,["children","in","onEnter","onExit","style","timeout"]),b=(0,l.Z)(),w=(0,c.Z)(n.ref,t);return o.createElement(a.ZP,(0,r.Z)({appear:!0,in:s,onEnter:function(e,t){(0,u.n)(e);var n=(0,u.C)({style:m,timeout:v},{mode:"enter"});e.style.webkitTransition=b.transitions.create("opacity",n),e.style.transition=b.transitions.create("opacity",n),f&&f(e,t)},onExit:function(e){var t=(0,u.C)({style:m,timeout:v},{mode:"exit"});e.style.webkitTransition=b.transitions.create("opacity",t),e.style.transition=b.transitions.create("opacity",t),p&&p(e)},timeout:v},y),(function(e,t){return o.cloneElement(n,(0,r.Z)({style:(0,r.Z)({opacity:0,visibility:"exited"!==e||s?void 0:"hidden"},d[e],{},m,{},n.props.style),ref:w},t))}))}))},9446:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4741),l=n(4670),u=o.forwardRef((function(e,t){var n=e.disableUnderline,l=e.classes,u=e.fullWidth,c=void 0!==u&&u,d=e.inputComponent,h=void 0===d?"input":d,f=e.multiline,p=void 0!==f&&f,m=e.type,g=void 0===m?"text":m,v=(0,i.Z)(e,["disableUnderline","classes","fullWidth","inputComponent","multiline","type"]);return o.createElement(s.Z,(0,r.Z)({classes:(0,r.Z)({},l,{root:(0,a.default)(l.root,!n&&l.underline),underline:null}),fullWidth:c,inputComponent:h,multiline:p,ref:t,type:g},v))}));u.muiName="Input";const c=(0,l.Z)((function(e){var t="light"===e.palette.type,n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.09)";return{root:{position:"relative",backgroundColor:r,borderTopLeftRadius:e.shape.borderRadius,borderTopRightRadius:e.shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:t?"rgba(0, 0, 0, 0.13)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:r}},"&$focused":{backgroundColor:t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.09)"},"&$disabled":{backgroundColor:t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"}},colorSecondary:{"&$underline:after":{borderBottomColor:e.palette.secondary.main}},underline:{"&:after":{borderBottom:"2px solid ".concat(e.palette.primary.main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:e.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:"1px solid ".concat(n),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:before":{borderBottom:"1px solid ".concat(e.palette.text.primary)},"&$disabled:before":{borderBottomStyle:"dotted"}},focused:{},disabled:{},adornedStart:{paddingLeft:12},adornedEnd:{paddingRight:12},error:{},marginDense:{},multiline:{padding:"27px 12px 10px","&$marginDense":{paddingTop:23,paddingBottom:6}},input:{padding:"27px 12px 10px","&:-webkit-autofill":{WebkitBoxShadow:"dark"===e.palette.type?"0 0 0 100px #266798 inset":null,WebkitTextFillColor:"dark"===e.palette.type?"#fff":null,borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},inputMarginDense:{paddingTop:23,paddingBottom:6},inputHiddenLabel:{paddingTop:18,paddingBottom:19,"&$inputMarginDense":{paddingTop:10,paddingBottom:11}},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}}),{name:"MuiFilledInput"})(u)},4436:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(6519),l=n(4670),u=n(3871),c=n(3711),d=n(5736),h=o.forwardRef((function(e,t){var n=e.children,l=e.classes,h=e.className,f=e.color,p=void 0===f?"primary":f,m=e.component,g=void 0===m?"div":m,v=e.disabled,y=void 0!==v&&v,b=e.error,w=void 0!==b&&b,E=e.fullWidth,_=void 0!==E&&E,C=e.focused,S=e.hiddenLabel,x=void 0!==S&&S,T=e.margin,I=void 0===T?"none":T,k=e.required,O=void 0!==k&&k,P=e.size,N=e.variant,A=void 0===N?"standard":N,D=(0,i.Z)(e,["children","classes","className","color","component","disabled","error","fullWidth","focused","hiddenLabel","margin","required","size","variant"]),R=o.useState((function(){var e=!1;return n&&o.Children.forEach(n,(function(t){if((0,c.Z)(t,["Input","Select"])){var n=(0,c.Z)(t,["Select"])?t.props.input:t;n&&(0,s.B7)(n.props)&&(e=!0)}})),e})),M=R[0],L=R[1],j=o.useState((function(){var e=!1;return n&&o.Children.forEach(n,(function(t){(0,c.Z)(t,["Input","Select"])&&(0,s.vd)(t.props,!0)&&(e=!0)})),e})),F=j[0],W=j[1],B=o.useState(!1),z=B[0],U=B[1],V=void 0!==C?C:z;y&&V&&U(!1);var Z=o.useCallback((function(){W(!0)}),[]),$={adornedStart:M,setAdornedStart:L,color:p,disabled:y,error:w,filled:F,focused:V,fullWidth:_,hiddenLabel:x,margin:("small"===P?"dense":void 0)||I,onBlur:function(){U(!1)},onEmpty:o.useCallback((function(){W(!1)}),[]),onFilled:Z,onFocus:function(){U(!0)},registerEffect:void 0,required:O,variant:A};return o.createElement(d.Z.Provider,{value:$},o.createElement(g,(0,r.Z)({className:(0,a.default)(l.root,h,"none"!==I&&l["margin".concat((0,u.Z)(I))],_&&l.fullWidth),ref:t},D),n))}));const f=(0,l.Z)({root:{display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},marginNormal:{marginTop:16,marginBottom:8},marginDense:{marginTop:8,marginBottom:4},fullWidth:{width:"100%"}},{name:"MuiFormControl"})(h)},5736:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o,Z:()=>a});var r=n(7294),i=r.createContext();function o(){return r.useContext(i)}const a=i},9345:(e,t,n)=>{"use strict";function r(e){var t=e.props,n=e.states,r=e.muiFormControl;return n.reduce((function(e,n){return e[n]=t[n],r&&void 0===t[n]&&(e[n]=r[n]),e}),{})}n.d(t,{Z:()=>r})},202:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.Z,useFormControl:()=>i.Z});var r=n(4436),i=n(2601)},2601:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),i=n(5736);function o(){return r.useContext(i.Z)}},5190:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(2601),l=n(4670),u=n(2318),c=n(3871),d=o.forwardRef((function(e,t){e.checked;var n=e.classes,l=e.className,d=e.control,h=e.disabled,f=(e.inputRef,e.label),p=e.labelPlacement,m=void 0===p?"end":p,g=(e.name,e.onChange,e.value,(0,i.Z)(e,["checked","classes","className","control","disabled","inputRef","label","labelPlacement","name","onChange","value"])),v=(0,s.Z)(),y=h;void 0===y&&void 0!==d.props.disabled&&(y=d.props.disabled),void 0===y&&v&&(y=v.disabled);var b={disabled:y};return["checked","name","onChange","value","inputRef"].forEach((function(t){void 0===d.props[t]&&void 0!==e[t]&&(b[t]=e[t])})),o.createElement("label",(0,r.Z)({className:(0,a.default)(n.root,l,"end"!==m&&n["labelPlacement".concat((0,c.Z)(m))],y&&n.disabled),ref:t},g),o.cloneElement(d,b),o.createElement(u.Z,{component:"span",className:(0,a.default)(n.label,y&&n.disabled)},f))}));const h=(0,l.Z)((function(e){return{root:{display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,"&$disabled":{cursor:"default"}},labelPlacementStart:{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},labelPlacementTop:{flexDirection:"column-reverse",marginLeft:16},labelPlacementBottom:{flexDirection:"column",marginLeft:16},disabled:{},label:{"&$disabled":{color:e.palette.text.disabled}}}}),{name:"MuiFormControlLabel"})(d)},5249:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=o.forwardRef((function(e,t){var n=e.classes,s=e.className,l=e.row,u=void 0!==l&&l,c=(0,i.Z)(e,["classes","className","row"]);return o.createElement("div",(0,r.Z)({className:(0,a.default)(n.root,s,u&&n.row),ref:t},c))}));const u=(0,s.Z)({root:{display:"flex",flexDirection:"column",flexWrap:"wrap"},row:{flexDirection:"row"}},{name:"MuiFormGroup"})(l)},170:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(2666)),s=n(8920),l=n(5653),u=n(3834);function c(e){return"scale(".concat(e,", ").concat(Math.pow(e,2),")")}var d={entering:{opacity:1,transform:c(1)},entered:{opacity:1,transform:"none"}},h=o.forwardRef((function(e,t){var n=e.children,h=e.in,f=e.onEnter,p=e.onExit,m=e.style,g=e.timeout,v=void 0===g?"auto":g,y=(0,i.Z)(e,["children","in","onEnter","onExit","style","timeout"]),b=o.useRef(),w=o.useRef(),E=(0,u.Z)(n.ref,t),_=(0,s.Z)();return o.useEffect((function(){return function(){clearTimeout(b.current)}}),[]),o.createElement(a.ZP,(0,r.Z)({appear:!0,in:h,onEnter:function(e,t){(0,l.n)(e);var n,r=(0,l.C)({style:m,timeout:v},{mode:"enter"}),i=r.duration,o=r.delay;"auto"===v?(n=_.transitions.getAutoHeightDuration(e.clientHeight),w.current=n):n=i,e.style.transition=[_.transitions.create("opacity",{duration:n,delay:o}),_.transitions.create("transform",{duration:.666*n,delay:o})].join(","),f&&f(e,t)},onExit:function(e){var t,n=(0,l.C)({style:m,timeout:v},{mode:"exit"}),r=n.duration,i=n.delay;"auto"===v?(t=_.transitions.getAutoHeightDuration(e.clientHeight),w.current=t):t=r,e.style.transition=[_.transitions.create("opacity",{duration:t,delay:i}),_.transitions.create("transform",{duration:.666*t,delay:i||.333*t})].join(","),e.style.opacity="0",e.style.transform=c(.75),p&&p(e)},addEndListener:function(e,t){"auto"===v&&(b.current=setTimeout(t,w.current||0))},timeout:"auto"===v?null:v},y),(function(e,t){return o.cloneElement(n,(0,r.Z)({style:(0,r.Z)({opacity:0,transform:c(.75),visibility:"exited"!==e||h?void 0:"hidden"},d[e],{},m,{},n.props.style),ref:E},t))}))}));h.muiSupportAuto=!0;const f=h},9152:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=n(3871),u=o.forwardRef((function(e,t){var n=e.classes,s=e.className,u=e.color,c=void 0===u?"inherit":u,d=e.component,h=void 0===d?"span":d,f=e.fontSize,p=void 0===f?"default":f,m=(0,i.Z)(e,["classes","className","color","component","fontSize"]);return o.createElement(h,(0,r.Z)({className:(0,a.default)("material-icons",n.root,s,"inherit"!==c&&n["color".concat((0,l.Z)(c))],"default"!==p&&n["fontSize".concat((0,l.Z)(p))]),"aria-hidden":!0,ref:t},m))}));u.muiName="Icon";const c=(0,s.Z)((function(e){return{root:{userSelect:"none",fontSize:e.typography.pxToRem(24),width:"1em",height:"1em",overflow:"hidden",flexShrink:0},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorAction:{color:e.palette.action.active},colorError:{color:e.palette.error.main},colorDisabled:{color:e.palette.action.disabled},fontSizeInherit:{fontSize:"inherit"},fontSizeSmall:{fontSize:e.typography.pxToRem(20)},fontSizeLarge:{fontSize:e.typography.pxToRem(36)}}}),{name:"MuiIcon"})(u)},7812:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=n(9693),u=n(4720),c=n(3871),d=o.forwardRef((function(e,t){var n=e.edge,s=void 0!==n&&n,l=e.children,d=e.classes,h=e.className,f=e.color,p=void 0===f?"default":f,m=e.disabled,g=void 0!==m&&m,v=e.disableFocusRipple,y=void 0!==v&&v,b=e.size,w=void 0===b?"medium":b,E=(0,i.Z)(e,["edge","children","classes","className","color","disabled","disableFocusRipple","size"]);return o.createElement(u.Z,(0,r.Z)({className:(0,a.default)(d.root,h,"default"!==p&&d["color".concat((0,c.Z)(p))],g&&d.disabled,"small"===w&&d["size".concat((0,c.Z)(w))],{start:d.edgeStart,end:d.edgeEnd}[s]),centerRipple:!0,focusRipple:!y,disabled:g,ref:t},E),o.createElement("span",{className:d.label},l))}));const h=(0,s.Z)((function(e){return{root:{textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:12,borderRadius:"50%",overflow:"visible",color:e.palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{backgroundColor:(0,l.U1)(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{backgroundColor:"transparent",color:e.palette.action.disabled}},edgeStart:{marginLeft:-12,"$sizeSmall&":{marginLeft:-3}},edgeEnd:{marginRight:-12,"$sizeSmall&":{marginRight:-3}},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,l.U1)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},colorSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,l.U1)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},disabled:{},sizeSmall:{padding:3,fontSize:e.typography.pxToRem(18)},label:{width:"100%",display:"flex",alignItems:"inherit",justifyContent:"inherit"}}}),{name:"MuiIconButton"})(d)},1890:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.Z});var r=n(7812)},8799:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4741),l=n(4670),u=o.forwardRef((function(e,t){var n=e.disableUnderline,l=e.classes,u=e.fullWidth,c=void 0!==u&&u,d=e.inputComponent,h=void 0===d?"input":d,f=e.multiline,p=void 0!==f&&f,m=e.type,g=void 0===m?"text":m,v=(0,i.Z)(e,["disableUnderline","classes","fullWidth","inputComponent","multiline","type"]);return o.createElement(s.Z,(0,r.Z)({classes:(0,r.Z)({},l,{root:(0,a.default)(l.root,!n&&l.underline),underline:null}),fullWidth:c,inputComponent:h,multiline:p,ref:t,type:g},v))}));u.muiName="Input";const c=(0,l.Z)((function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return{root:{position:"relative"},formControl:{"label + &":{marginTop:16}},focused:{},disabled:{},colorSecondary:{"&$underline:after":{borderBottomColor:e.palette.secondary.main}},underline:{"&:after":{borderBottom:"2px solid ".concat(e.palette.primary.main),left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:e.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:"1px solid ".concat(t),left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},"&:hover:not($disabled):before":{borderBottom:"2px solid ".concat(e.palette.text.primary),"@media (hover: none)":{borderBottom:"1px solid ".concat(t)}},"&$disabled:before":{borderBottomStyle:"dotted"}},error:{},marginDense:{},multiline:{},fullWidth:{},input:{},inputMarginDense:{},inputMultiline:{},inputTypeSearch:{}}}),{name:"MuiInput"})(u)},4023:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(2318),l=n(4670),u=n(5736),c=o.forwardRef((function(e,t){var n=e.children,l=e.classes,c=e.className,d=e.component,h=void 0===d?"div":d,f=e.disablePointerEvents,p=void 0!==f&&f,m=e.disableTypography,g=void 0!==m&&m,v=e.position,y=e.variant,b=(0,i.Z)(e,["children","classes","className","component","disablePointerEvents","disableTypography","position","variant"]),w=(0,u.Y)()||{},E=y;return y&&w.variant,w&&!E&&(E=w.variant),o.createElement(u.Z.Provider,{value:null},o.createElement(h,(0,r.Z)({className:(0,a.default)(l.root,c,p&&l.disablePointerEvents,w.hiddenLabel&&l.hiddenLabel,"filled"===E&&l.filled,{start:l.positionStart,end:l.positionEnd}[v],"dense"===w.margin&&l.marginDense),ref:t},b),"string"!=typeof n||g?n:o.createElement(s.Z,{color:"textSecondary"},n)))}));const d=(0,l.Z)({root:{display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap"},filled:{"&$positionStart:not($hiddenLabel)":{marginTop:16}},positionStart:{marginRight:8},positionEnd:{marginLeft:8},disablePointerEvents:{pointerEvents:"none"},hiddenLabel:{},marginDense:{}},{name:"MuiInputAdornment"})(c)},4741:(e,t,n)=>{"use strict";n.d(t,{Z:()=>w});var r=n(1253),i=n(2122),o=n(7294),a=(n(5697),n(6010)),s=n(9345),l=n(5736),u=n(4670),c=n(3871),d=n(3834),h=n(9437);function f(e,t){return parseInt(e[t],10)||0}var p="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,m={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"};const g=o.forwardRef((function(e,t){var n=e.onChange,a=e.rows,s=e.rowsMax,l=e.rowsMin,u=void 0===l?1:l,c=e.style,g=e.value,v=(0,r.Z)(e,["onChange","rows","rowsMax","rowsMin","style","value"]),y=a||u,b=o.useRef(null!=g).current,w=o.useRef(null),E=(0,d.Z)(t,w),_=o.useRef(null),C=o.useRef(0),S=o.useState({}),x=S[0],T=S[1],I=o.useCallback((function(){var t=w.current,n=window.getComputedStyle(t),r=_.current;r.style.width=n.width,r.value=t.value||e.placeholder||"x";var i=n["box-sizing"],o=f(n,"padding-bottom")+f(n,"padding-top"),a=f(n,"border-bottom-width")+f(n,"border-top-width"),l=r.scrollHeight-o;r.value="x";var u=r.scrollHeight-o,c=l;y&&(c=Math.max(Number(y)*u,c)),s&&(c=Math.min(Number(s)*u,c));var d=(c=Math.max(c,u))+("border-box"===i?o+a:0),h=Math.abs(c-l)<=1;T((function(e){return C.current<20&&(d>0&&Math.abs((e.outerHeightStyle||0)-d)>1||e.overflow!==h)?(C.current+=1,{overflow:h,outerHeightStyle:d}):e}))}),[s,y,e.placeholder]);return o.useEffect((function(){var e=(0,h.Z)((function(){C.current=0,I()}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}),[I]),p((function(){I()})),o.useEffect((function(){C.current=0}),[g]),o.createElement(o.Fragment,null,o.createElement("textarea",(0,i.Z)({value:g,onChange:function(e){C.current=0,b||I(),n&&n(e)},ref:E,rows:y,style:(0,i.Z)({height:x.outerHeightStyle,overflow:x.overflow?"hidden":null},c)},v)),o.createElement("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:_,tabIndex:-1,style:(0,i.Z)({},m,{},c)}))}));var v=n(6519),y="undefined"==typeof window?o.useEffect:o.useLayoutEffect,b=o.forwardRef((function(e,t){var n=e["aria-describedby"],u=e.autoComplete,h=e.autoFocus,f=e.classes,p=e.className,m=(e.color,e.defaultValue),b=e.disabled,w=e.endAdornment,E=(e.error,e.fullWidth),_=void 0!==E&&E,C=e.id,S=e.inputComponent,x=void 0===S?"input":S,T=e.inputProps,I=void 0===T?{}:T,k=e.inputRef,O=(e.margin,e.multiline),P=void 0!==O&&O,N=e.name,A=e.onBlur,D=e.onChange,R=e.onClick,M=e.onFocus,L=e.onKeyDown,j=e.onKeyUp,F=e.placeholder,W=e.readOnly,B=e.renderSuffix,z=e.rows,U=e.rowsMax,V=e.rowsMin,Z=e.startAdornment,$=e.type,q=void 0===$?"text":$,H=e.value,K=(0,r.Z)(e,["aria-describedby","autoComplete","autoFocus","classes","className","color","defaultValue","disabled","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","rowsMax","rowsMin","startAdornment","type","value"]),G=null!=I.value?I.value:H,Q=o.useRef(null!=G).current,Y=o.useRef(),X=o.useCallback((function(e){}),[]),J=(0,d.Z)(I.ref,X),ee=(0,d.Z)(k,J),te=(0,d.Z)(Y,ee),ne=o.useState(!1),re=ne[0],ie=ne[1],oe=(0,l.Y)(),ae=(0,s.Z)({props:e,muiFormControl:oe,states:["color","disabled","error","hiddenLabel","margin","required","filled"]});ae.focused=oe?oe.focused:re,o.useEffect((function(){!oe&&b&&re&&(ie(!1),A&&A())}),[oe,b,re,A]);var se=oe&&oe.onFilled,le=oe&&oe.onEmpty,ue=o.useCallback((function(e){(0,v.vd)(e)?se&&se():le&&le()}),[se,le]);y((function(){Q&&ue({value:G})}),[G,ue,Q]),o.useEffect((function(){ue(Y.current)}),[]);var ce=x,de=(0,i.Z)({},I,{ref:te});return"string"!=typeof ce?de=(0,i.Z)({inputRef:te,type:q},de,{ref:null}):P?!z||U||V?(de=(0,i.Z)({rows:z,rowsMax:U},de),ce=g):ce="textarea":de=(0,i.Z)({type:q},de),o.useEffect((function(){oe&&oe.setAdornedStart(Boolean(Z))}),[oe,Z]),o.createElement("div",(0,i.Z)({className:(0,a.default)(f.root,f["color".concat((0,c.Z)(ae.color||"primary"))],p,ae.disabled&&f.disabled,ae.error&&f.error,_&&f.fullWidth,ae.focused&&f.focused,oe&&f.formControl,P&&f.multiline,Z&&f.adornedStart,w&&f.adornedEnd,"dense"===ae.margin&&f.marginDense),onClick:function(e){Y.current&&e.currentTarget===e.target&&Y.current.focus(),R&&R(e)},ref:t},K),Z,o.createElement(l.Z.Provider,{value:null},o.createElement(ce,(0,i.Z)({"aria-invalid":ae.error,"aria-describedby":n,autoComplete:u,autoFocus:h,defaultValue:m,disabled:ae.disabled,id:C,onAnimationStart:function(e){ue("mui-auto-fill-cancel"===e.animationName?Y.current:{value:"x"})},name:N,placeholder:F,readOnly:W,required:ae.required,rows:z,value:G,onKeyDown:L,onKeyUp:j},de,{className:(0,a.default)(f.input,I.className,ae.disabled&&f.disabled,P&&f.inputMultiline,ae.hiddenLabel&&f.inputHiddenLabel,Z&&f.inputAdornedStart,w&&f.inputAdornedEnd,"search"===q&&f.inputTypeSearch,"dense"===ae.margin&&f.inputMarginDense),onBlur:function(e){A&&A(e),I.onBlur&&I.onBlur(e),oe&&oe.onBlur?oe.onBlur(e):ie(!1)},onChange:function(e){if(!Q){var t=e.target||Y.current;if(null==t)throw new TypeError("Material-UI: Expected valid input target. Did you use a custom `inputComponent` and forget to forward refs? See https://material-ui.com/r/input-component-ref-interface for more info.");ue({value:t.value})}for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i{"use strict";function r(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function i(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(r(e.value)&&""!==e.value||t&&r(e.defaultValue)&&""!==e.defaultValue)}function o(e){return e.startAdornment}n.d(t,{vd:()=>i,B7:()=>o})},3700:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(9345),l=n(2601),u=n(4670),c=n(3871),d=o.forwardRef((function(e,t){var n=e.children,u=e.classes,d=e.className,h=(e.color,e.component),f=void 0===h?"label":h,p=(e.disabled,e.error,e.filled,e.focused,e.required,(0,i.Z)(e,["children","classes","className","color","component","disabled","error","filled","focused","required"])),m=(0,l.Z)(),g=(0,s.Z)({props:e,muiFormControl:m,states:["color","required","focused","disabled","error","filled"]});return o.createElement(f,(0,r.Z)({className:(0,a.default)(u.root,u["color".concat((0,c.Z)(g.color||"primary"))],d,g.disabled&&u.disabled,g.error&&u.error,g.filled&&u.filled,g.focused&&u.focused,g.required&&u.required),ref:t},p),n,g.required&&o.createElement("span",{className:(0,a.default)(u.asterisk,g.error&&u.error)}," ","*"))}));const h=(0,u.Z)((function(e){return{root:(0,r.Z)({color:e.palette.text.secondary},e.typography.body1,{lineHeight:1,padding:0,"&$focused":{color:e.palette.primary.main},"&$disabled":{color:e.palette.text.disabled},"&$error":{color:e.palette.error.main}}),colorSecondary:{"&$focused":{color:e.palette.secondary.main}},focused:{},disabled:{},error:{},filled:{},required:{},asterisk:{"&$error":{color:e.palette.error.main}}}}),{name:"MuiFormLabel"})(d);var f=o.forwardRef((function(e,t){var n=e.classes,u=e.className,c=e.disableAnimation,d=void 0!==c&&c,f=(e.margin,e.shrink),p=(e.variant,(0,i.Z)(e,["classes","className","disableAnimation","margin","shrink","variant"])),m=(0,l.Z)(),g=f;void 0===g&&m&&(g=m.filled||m.focused||m.adornedStart);var v=(0,s.Z)({props:e,muiFormControl:m,states:["margin","variant"]});return o.createElement(h,(0,r.Z)({"data-shrink":g,className:(0,a.default)(n.root,u,m&&n.formControl,!d&&n.animated,g&&n.shrink,"dense"===v.margin&&n.marginDense,{filled:n.filled,outlined:n.outlined}[v.variant]),classes:{focused:n.focused,disabled:n.disabled,error:n.error,required:n.required,asterisk:n.asterisk},ref:t},p))}));const p=(0,u.Z)((function(e){return{root:{display:"block",transformOrigin:"top left"},focused:{},disabled:{},error:{},required:{},asterisk:{},formControl:{position:"absolute",left:0,top:0,transform:"translate(0, 24px) scale(1)"},marginDense:{transform:"translate(0, 21px) scale(1)"},shrink:{transform:"translate(0, 1.5px) scale(0.75)",transformOrigin:"top left"},animated:{transition:e.transitions.create(["color","transform"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},filled:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 20px) scale(1)","&$marginDense":{transform:"translate(12px, 17px) scale(1)"},"&$shrink":{transform:"translate(12px, 10px) scale(0.75)","&$marginDense":{transform:"translate(12px, 7px) scale(0.75)"}}},outlined:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 20px) scale(1)","&$marginDense":{transform:"translate(14px, 12px) scale(1)"},"&$shrink":{transform:"translate(14px, -6px) scale(0.75)"}}}}),{name:"MuiInputLabel"})(f)},9169:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.Z});var r=n(3700)},6572:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>f});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(3871),l=n(4670),u=n(4896),c=n(3834),d=n(2318),h=o.forwardRef((function(e,t){var n=e.classes,l=e.className,h=e.color,f=void 0===h?"primary":h,p=e.component,m=void 0===p?"a":p,g=e.onBlur,v=e.onFocus,y=e.TypographyClasses,b=e.underline,w=void 0===b?"hover":b,E=e.variant,_=void 0===E?"inherit":E,C=(0,i.Z)(e,["classes","className","color","component","onBlur","onFocus","TypographyClasses","underline","variant"]),S=(0,u.Z)(),x=S.isFocusVisible,T=S.onBlurVisible,I=S.ref,k=o.useState(!1),O=k[0],P=k[1],N=(0,c.Z)(t,I);return o.createElement(d.Z,(0,r.Z)({className:(0,a.default)(n.root,n["underline".concat((0,s.Z)(w))],l,O&&n.focusVisible,"button"===m&&n.button),classes:y,color:f,component:m,onBlur:function(e){O&&(T(),P(!1)),g&&g(e)},onFocus:function(e){x(e)&&P(!0),v&&v(e)},ref:N,variant:_},C))}));const f=(0,l.Z)({root:{},underlineNone:{textDecoration:"none"},underlineHover:{textDecoration:"none","&:hover":{textDecoration:"underline"}},underlineAlways:{textDecoration:"underline"},button:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none","&::-moz-focus-inner":{borderStyle:"none"},"&$focusVisible":{outline:"auto"}},focusVisible:{}},{name:"MuiLink"})(h)},2822:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=n(6987),u=o.forwardRef((function(e,t){var n=e.children,s=e.classes,u=e.className,c=e.component,d=void 0===c?"ul":c,h=e.dense,f=void 0!==h&&h,p=e.disablePadding,m=void 0!==p&&p,g=e.subheader,v=(0,i.Z)(e,["children","classes","className","component","dense","disablePadding","subheader"]),y=o.useMemo((function(){return{dense:f}}),[f]);return o.createElement(l.Z.Provider,{value:y},o.createElement(d,(0,r.Z)({className:(0,a.default)(s.root,u,f&&s.dense,!m&&s.padding,g&&s.subheader),ref:t},v),g,n))}));const c=(0,s.Z)({root:{listStyle:"none",margin:0,padding:0,position:"relative"},padding:{paddingTop:8,paddingBottom:8},dense:{},subheader:{paddingTop:0}},{name:"MuiList"})(u)},6987:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=n(7294).createContext({})},3240:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.Z});var r=n(2822)},4968:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>m});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=n(4720),u=n(3711),c=n(3834),d=n(6987),h=n(3935),f="undefined"==typeof window?o.useEffect:o.useLayoutEffect,p=o.forwardRef((function(e,t){var n=e.alignItems,s=void 0===n?"center":n,p=e.autoFocus,m=void 0!==p&&p,g=e.button,v=void 0!==g&&g,y=e.children,b=e.classes,w=e.className,E=e.component,_=e.ContainerComponent,C=void 0===_?"li":_,S=e.ContainerProps,x=(S=void 0===S?{}:S).className,T=(0,i.Z)(S,["className"]),I=e.dense,k=void 0!==I&&I,O=e.disabled,P=void 0!==O&&O,N=e.disableGutters,A=void 0!==N&&N,D=e.divider,R=void 0!==D&&D,M=e.focusVisibleClassName,L=e.selected,j=void 0!==L&&L,F=(0,i.Z)(e,["alignItems","autoFocus","button","children","classes","className","component","ContainerComponent","ContainerProps","dense","disabled","disableGutters","divider","focusVisibleClassName","selected"]),W=o.useContext(d.Z),B={dense:k||W.dense||!1,alignItems:s},z=o.useRef(null);f((function(){m&&z.current&&z.current.focus()}),[m]);var U=o.Children.toArray(y),V=U.length&&(0,u.Z)(U[U.length-1],["ListItemSecondaryAction"]),Z=o.useCallback((function(e){z.current=h.findDOMNode(e)}),[]),$=(0,c.Z)(Z,t),q=(0,r.Z)({className:(0,a.default)(b.root,w,B.dense&&b.dense,!A&&b.gutters,R&&b.divider,P&&b.disabled,v&&b.button,"center"!==s&&b.alignItemsFlexStart,V&&b.secondaryAction,j&&b.selected),disabled:P},F),H=E||"li";return v&&(q.component=E||"div",q.focusVisibleClassName=(0,a.default)(b.focusVisible,M),H=l.Z),V?(H=q.component||E?H:"div","li"===C&&("li"===H?H="div":"li"===q.component&&(q.component="div")),o.createElement(d.Z.Provider,{value:B},o.createElement(C,(0,r.Z)({className:(0,a.default)(b.container,x),ref:$},T),o.createElement(H,q,U),U.pop()))):o.createElement(d.Z.Provider,{value:B},o.createElement(H,(0,r.Z)({ref:$},q),U))}));const m=(0,s.Z)((function(e){return{root:{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,"&$focusVisible":{backgroundColor:e.palette.action.selected},"&$selected, &$selected:hover":{backgroundColor:e.palette.action.selected},"&$disabled":{opacity:.5}},container:{position:"relative"},focusVisible:{},dense:{paddingTop:4,paddingBottom:4},alignItemsFlexStart:{alignItems:"flex-start"},disabled:{},divider:{borderBottom:"1px solid ".concat(e.palette.divider),backgroundClip:"padding-box"},gutters:{paddingLeft:16,paddingRight:16},button:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:e.palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}},secondaryAction:{paddingRight:48},selected:{}}}),{name:"MuiListItem"})(p)},7311:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=n(6987),u=o.forwardRef((function(e,t){var n=e.classes,s=e.className,u=(0,i.Z)(e,["classes","className"]),c=o.useContext(l.Z);return o.createElement("div",(0,r.Z)({className:(0,a.default)(n.root,s,"flex-start"===c.alignItems&&n.alignItemsFlexStart),ref:t},u))}));const c=(0,s.Z)((function(e){return{root:{minWidth:56,color:e.palette.action.active,flexShrink:0,display:"inline-flex"},alignItemsFlexStart:{marginTop:8}}}),{name:"MuiListItemIcon"})(u)},7183:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=n(2318),u=n(6987),c=o.forwardRef((function(e,t){var n=e.children,s=e.classes,c=e.className,d=e.disableTypography,h=void 0!==d&&d,f=e.inset,p=void 0!==f&&f,m=e.primary,g=e.primaryTypographyProps,v=e.secondary,y=e.secondaryTypographyProps,b=(0,i.Z)(e,["children","classes","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"]),w=o.useContext(u.Z).dense,E=null!=m?m:n;null==E||E.type===l.Z||h||(E=o.createElement(l.Z,(0,r.Z)({variant:w?"body2":"body1",className:s.primary,component:"span",display:"block"},g),E));var _=v;return null==_||_.type===l.Z||h||(_=o.createElement(l.Z,(0,r.Z)({variant:"body2",className:s.secondary,color:"textSecondary",display:"block"},y),_)),o.createElement("div",(0,r.Z)({className:(0,a.default)(s.root,c,w&&s.dense,p&&s.inset,E&&_&&s.multiline),ref:t},b),E,_)}));const d=(0,s.Z)({root:{flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},multiline:{marginTop:6,marginBottom:6},dense:{},inset:{paddingLeft:56},primary:{},secondary:{}},{name:"MuiListItemText"})(c)},6423:(e,t,n)=>{"use strict";n.d(t,{Z:()=>O});var r=n(1253),i=n(2122),o=n(7294),a=n(3935),s=(n(5697),n(159)),l=n(3869),u=n(626),c=n(6234),d=n(2568),h=n(3834),f=n(5192),p=n(2781),m=n(6610),g=n(5991),v=n(5061),y=n(5840),b=n(713);function w(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function E(e){return parseInt(window.getComputedStyle(e)["padding-right"],10)||0}function _(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0,o=[t,n].concat((0,v.Z)(r)),a=["TEMPLATE","SCRIPT","STYLE"];[].forEach.call(e.children,(function(e){1===e.nodeType&&-1===o.indexOf(e)&&-1===a.indexOf(e.tagName)&&w(e,i)}))}function C(e,t){var n=-1;return e.some((function(e,r){return!!t(e)&&(n=r,!0)})),n}var S=function(){function e(){(0,m.Z)(this,e),this.modals=[],this.containers=[]}return(0,g.Z)(e,[{key:"add",value:function(e,t){var n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&w(e.modalRef,!1);var r=function(e){var t=[];return[].forEach.call(e.children,(function(e){e.getAttribute&&"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);_(t,e.mountNode,e.modalRef,r,!0);var i=C(this.containers,(function(e){return e.container===t}));return-1!==i?(this.containers[i].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblingNodes:r}),n)}},{key:"mount",value:function(e,t){var n=C(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];r.restore||(r.restore=function(e,t){var n,r=[],i=[],o=e.container;if(!t.disableScrollLock){if(function(e){var t=(0,u.Z)(e);return t.body===e?(0,b.Z)(t).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(o)){var a=(0,y.Z)();r.push({value:o.style.paddingRight,key:"padding-right",el:o}),o.style["padding-right"]="".concat(E(o)+a,"px"),n=(0,u.Z)(o).querySelectorAll(".mui-fixed"),[].forEach.call(n,(function(e){i.push(e.style.paddingRight),e.style.paddingRight="".concat(E(e)+a,"px")}))}var s=o.parentElement,l="HTML"===s.nodeName&&"scroll"===window.getComputedStyle(s)["overflow-y"]?s:o;r.push({value:l.style.overflow,key:"overflow",el:l}),l.style.overflow="hidden"}return function(){n&&[].forEach.call(n,(function(e,t){i[t]?e.style.paddingRight=i[t]:e.style.removeProperty("padding-right")})),r.forEach((function(e){var t=e.value,n=e.el,r=e.key;t?n.style.setProperty(r,t):n.style.removeProperty(r)}))}}(r,t))}},{key:"remove",value:function(e){var t=this.modals.indexOf(e);if(-1===t)return t;var n=C(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];if(r.modals.splice(r.modals.indexOf(e),1),this.modals.splice(t,1),0===r.modals.length)r.restore&&r.restore(),e.modalRef&&w(e.modalRef,!0),_(r.container,e.mountNode,e.modalRef,r.hiddenSiblingNodes,!1),this.containers.splice(n,1);else{var i=r.modals[r.modals.length-1];i.modalRef&&w(i.modalRef,!1)}return t}},{key:"isTopModal",value:function(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}]),e}();const x=function(e){var t=e.children,n=e.disableAutoFocus,r=void 0!==n&&n,i=e.disableEnforceFocus,s=void 0!==i&&i,l=e.disableRestoreFocus,c=void 0!==l&&l,d=e.getDoc,f=e.isEnabled,p=e.open,m=o.useRef(),g=o.useRef(null),v=o.useRef(null),y=o.useRef(),b=o.useRef(null),w=o.useCallback((function(e){b.current=a.findDOMNode(e)}),[]),E=(0,h.Z)(t.ref,w);return o.useMemo((function(){p&&"undefined"!=typeof window&&(y.current=d().activeElement)}),[p]),o.useEffect((function(){if(p){var e=(0,u.Z)(b.current);r||!b.current||b.current.contains(e.activeElement)||(b.current.hasAttribute("tabIndex")||b.current.setAttribute("tabIndex",-1),b.current.focus());var t=function(){s||!f()||m.current?m.current=!1:b.current&&!b.current.contains(e.activeElement)&&b.current.focus()},n=function(t){!s&&f()&&9===t.keyCode&&e.activeElement===b.current&&(m.current=!0,t.shiftKey?v.current.focus():g.current.focus())};e.addEventListener("focus",t,!0),e.addEventListener("keydown",n,!0);var i=setInterval((function(){t()}),50);return function(){clearInterval(i),e.removeEventListener("focus",t,!0),e.removeEventListener("keydown",n,!0),c||(y.current&&y.current.focus&&y.current.focus(),y.current=null)}}}),[r,s,c,f,p]),o.createElement(o.Fragment,null,o.createElement("div",{tabIndex:0,ref:g,"data-test":"sentinelStart"}),o.cloneElement(t,{ref:E}),o.createElement("div",{tabIndex:0,ref:v,"data-test":"sentinelEnd"}))};var T={root:{zIndex:-1,position:"fixed",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},invisible:{backgroundColor:"transparent"}};const I=o.forwardRef((function(e,t){var n=e.invisible,a=void 0!==n&&n,s=e.open,l=(0,r.Z)(e,["invisible","open"]);return s?o.createElement("div",(0,i.Z)({"aria-hidden":!0,ref:t},l,{style:(0,i.Z)({},T.root,{},a?T.invisible:{},{},l.style)})):null}));var k=new S;const O=o.forwardRef((function(e,t){var n=(0,s.Z)(),m=(0,l.Z)({name:"MuiModal",props:(0,i.Z)({},e),theme:n}),g=m.BackdropComponent,v=void 0===g?I:g,y=m.BackdropProps,b=m.children,E=m.closeAfterTransition,_=void 0!==E&&E,C=m.container,S=m.disableAutoFocus,T=void 0!==S&&S,O=m.disableBackdropClick,P=void 0!==O&&O,N=m.disableEnforceFocus,A=void 0!==N&&N,D=m.disableEscapeKeyDown,R=void 0!==D&&D,M=m.disablePortal,L=void 0!==M&&M,j=m.disableRestoreFocus,F=void 0!==j&&j,W=m.disableScrollLock,B=void 0!==W&&W,z=m.hideBackdrop,U=void 0!==z&&z,V=m.keepMounted,Z=void 0!==V&&V,$=m.manager,q=void 0===$?k:$,H=m.onBackdropClick,K=m.onClose,G=m.onEscapeKeyDown,Q=m.onRendered,Y=m.open,X=(0,r.Z)(m,["BackdropComponent","BackdropProps","children","closeAfterTransition","container","disableAutoFocus","disableBackdropClick","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","manager","onBackdropClick","onClose","onEscapeKeyDown","onRendered","open"]),J=o.useState(!0),ee=J[0],te=J[1],ne=o.useRef({}),re=o.useRef(null),ie=o.useRef(null),oe=(0,h.Z)(ie,t),ae=function(e){return!!e.children&&e.children.props.hasOwnProperty("in")}(m),se=function(){return(0,u.Z)(re.current)},le=function(){return ne.current.modalRef=ie.current,ne.current.mountNode=re.current,ne.current},ue=function(){q.mount(le(),{disableScrollLock:B}),ie.current.scrollTop=0},ce=(0,f.Z)((function(){var e=function(e){return e="function"==typeof e?e():e,a.findDOMNode(e)}(C)||se().body;q.add(le(),e),ie.current&&ue()})),de=o.useCallback((function(){return q.isTopModal(le())}),[q]),he=(0,f.Z)((function(e){re.current=e,e&&(Q&&Q(),Y&&de()?ue():w(ie.current,!0))})),fe=o.useCallback((function(){q.remove(le())}),[q]);if(o.useEffect((function(){return function(){fe()}}),[fe]),o.useEffect((function(){Y?ce():ae&&_||fe()}),[Y,fe,ae,_,ce]),!Z&&!Y&&(!ae||ee))return null;var pe=function(e){return{root:{position:"fixed",zIndex:e.zIndex.modal,right:0,bottom:0,top:0,left:0},hidden:{visibility:"hidden"}}}(n||{zIndex:p.Z}),me={};return void 0===b.props.tabIndex&&(me.tabIndex=b.props.tabIndex||"-1"),ae&&(me.onEnter=(0,d.Z)((function(){te(!1)}),b.props.onEnter),me.onExited=(0,d.Z)((function(){te(!0),_&&fe()}),b.props.onExited)),o.createElement(c.Z,{ref:he,container:C,disablePortal:L},o.createElement("div",(0,i.Z)({ref:oe,onKeyDown:function(e){"Escape"===e.key&&de()&&(e.stopPropagation(),G&&G(e),!R&&K&&K(e,"escapeKeyDown"))},role:"presentation"},X,{style:(0,i.Z)({},pe.root,{},!Y&&ee?pe.hidden:{},{},X.style)}),U?null:o.createElement(v,(0,i.Z)({open:Y,onClick:function(e){e.target===e.currentTarget&&(H&&H(e),!P&&K&&K(e,"backdropClick"))}},y)),o.createElement(x,{disableEnforceFocus:A,disableAutoFocus:T,disableRestoreFocus:F,getDoc:se,isEnabled:de,open:Y},o.cloneElement(b,me))))}))},6718:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4741),l=n(6156),u=n(4670),c=n(8920),d=n(3871),h=o.forwardRef((function(e,t){e.children;var n=e.classes,s=e.className,u=e.label,h=e.labelWidth,f=e.notched,p=e.style,m=(0,i.Z)(e,["children","classes","className","label","labelWidth","notched","style"]),g="rtl"===(0,c.Z)().direction?"right":"left";if(void 0!==u)return o.createElement("fieldset",(0,r.Z)({"aria-hidden":!0,className:(0,a.default)(n.root,s),ref:t,style:p},m),o.createElement("legend",{className:(0,a.default)(n.legendLabelled,f&&n.legendNotched)},u?o.createElement("span",null,u):o.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}})));var v=h>0?.75*h+8:.01;return o.createElement("fieldset",(0,r.Z)({"aria-hidden":!0,style:(0,r.Z)((0,l.Z)({},"padding".concat((0,d.Z)(g)),8),p),className:(0,a.default)(n.root,s),ref:t},m),o.createElement("legend",{className:n.legend,style:{width:f?v:.01}},o.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}})))}));const f=(0,u.Z)((function(e){return{root:{position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:0,paddingLeft:8,pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1},legend:{textAlign:"left",padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},legendLabelled:{display:"block",width:"auto",textAlign:"left",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),"& > span":{paddingLeft:5,paddingRight:5,display:"inline-block"}},legendNotched:{maxWidth:1e3,transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}}),{name:"PrivateNotchedOutline"})(h);var p=o.forwardRef((function(e,t){var n=e.classes,l=e.fullWidth,u=void 0!==l&&l,c=e.inputComponent,d=void 0===c?"input":c,h=e.label,p=e.labelWidth,m=void 0===p?0:p,g=e.multiline,v=void 0!==g&&g,y=e.notched,b=e.type,w=void 0===b?"text":b,E=(0,i.Z)(e,["classes","fullWidth","inputComponent","label","labelWidth","multiline","notched","type"]);return o.createElement(s.Z,(0,r.Z)({renderSuffix:function(e){return o.createElement(f,{className:n.notchedOutline,label:h,labelWidth:m,notched:void 0!==y?y:Boolean(e.startAdornment||e.filled||e.focused)})},classes:(0,r.Z)({},n,{root:(0,a.default)(n.root,n.underline),notchedOutline:null}),fullWidth:u,inputComponent:d,multiline:v,ref:t,type:w},E))}));p.muiName="Input";const m=(0,u.Z)((function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{root:{position:"relative",borderRadius:e.shape.borderRadius,"&:hover $notchedOutline":{borderColor:e.palette.text.primary},"@media (hover: none)":{"&:hover $notchedOutline":{borderColor:t}},"&$focused $notchedOutline":{borderColor:e.palette.primary.main,borderWidth:2},"&$error $notchedOutline":{borderColor:e.palette.error.main},"&$disabled $notchedOutline":{borderColor:e.palette.action.disabled}},colorSecondary:{"&$focused $notchedOutline":{borderColor:e.palette.secondary.main}},focused:{},disabled:{},adornedStart:{paddingLeft:14},adornedEnd:{paddingRight:14},error:{},marginDense:{},multiline:{padding:"18.5px 14px","&$marginDense":{paddingTop:10.5,paddingBottom:10.5}},notchedOutline:{borderColor:t},input:{padding:"18.5px 14px","&:-webkit-autofill":{WebkitBoxShadow:"dark"===e.palette.type?"0 0 0 100px #266798 inset":null,WebkitTextFillColor:"dark"===e.palette.type?"#fff":null,borderRadius:"inherit"}},inputMarginDense:{paddingTop:10.5,paddingBottom:10.5},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}}),{name:"MuiOutlinedInput"})(p)},4781:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.Z});var r=n(6718)},9895:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(1253),i=n(2122),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=o.forwardRef((function(e,t){var n=e.classes,s=e.className,l=e.component,u=void 0===l?"div":l,c=e.square,d=void 0!==c&&c,h=e.elevation,f=void 0===h?1:h,p=e.variant,m=void 0===p?"elevation":p,g=(0,r.Z)(e,["classes","className","component","square","elevation","variant"]);return o.createElement(u,(0,i.Z)({className:(0,a.default)(n.root,s,"outlined"===m?n.outlined:n["elevation".concat(f)],!d&&n.rounded),ref:t},g))}));const u=(0,s.Z)((function(e){var t={};return e.shadows.forEach((function(e,n){t["elevation".concat(n)]={boxShadow:e}})),(0,i.Z)({root:{backgroundColor:e.palette.background.paper,color:e.palette.text.primary,transition:e.transitions.create("box-shadow")},rounded:{borderRadius:e.shape.borderRadius},outlined:{border:"1px solid ".concat(e.palette.divider)}},t)}),{name:"MuiPaper"})(l)},6617:(e,t,n)=>{"use strict";n.d(t,{Z:()=>ve});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),"undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator),s=function(){for(var e=["Edge","Trident","Firefox"],t=0;t=0)return 1;return 0}(),l=a&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),s))}};function u(e){return e&&"[object Function]"==={}.toString.call(e)}function c(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function d(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function h(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=c(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:h(d(e))}function f(e){return e&&e.referenceNode?e.referenceNode:e}var p=a&&!(!window.MSInputMethodContext||!document.documentMode),m=a&&/MSIE 10/.test(navigator.userAgent);function g(e){return 11===e?p:10===e?m:p||m}function v(e){if(!e)return document.documentElement;for(var t=g(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===c(n,"position")?v(n):n:e?e.ownerDocument.documentElement:document.documentElement}function y(e){return null!==e.parentNode?y(e.parentNode):e}function b(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a,s,l=o.commonAncestorContainer;if(e!==l&&t!==l||r.contains(i))return"BODY"===(s=(a=l).nodeName)||"HTML"!==s&&v(a.firstElementChild)!==a?v(l):l;var u=y(e);return u.host?b(u.host,t):b(e,y(t).host)}function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var i=e.ownerDocument.documentElement,o=e.ownerDocument.scrollingElement||i;return o[n]}return e[n]}function E(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=w(t,"top"),i=w(t,"left"),o=n?-1:1;return e.top+=r*o,e.bottom+=r*o,e.left+=i*o,e.right+=i*o,e}function _(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function C(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],g(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function S(e){var t=e.body,n=e.documentElement,r=g(10)&&getComputedStyle(n);return{height:C("Height",t,n,r),width:C("Width",t,n,r)}}var x=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},T=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],r=g(10),i="HTML"===t.nodeName,o=P(e),a=P(t),s=h(e),l=c(t),u=parseFloat(l.borderTopWidth),d=parseFloat(l.borderLeftWidth);n&&i&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var f=O({top:o.top-a.top-u,left:o.left-a.left-d,width:o.width,height:o.height});if(f.marginTop=0,f.marginLeft=0,!r&&i){var p=parseFloat(l.marginTop),m=parseFloat(l.marginLeft);f.top-=u-p,f.bottom-=u-p,f.left-=d-m,f.right-=d-m,f.marginTop=p,f.marginLeft=m}return(r&&!n?t.contains(s):t===s&&"BODY"!==s.nodeName)&&(f=E(f,t)),f}function A(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=N(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:w(n),s=t?0:w(n,"left"),l={top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:o};return O(l)}function D(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===c(e,"position"))return!0;var n=d(e);return!!n&&D(n)}function R(e){if(!e||!e.parentElement||g())return document.documentElement;for(var t=e.parentElement;t&&"none"===c(t,"transform");)t=t.parentElement;return t||document.documentElement}function M(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},a=i?R(e):b(e,f(t));if("viewport"===r)o=A(a,i);else{var s=void 0;"scrollParent"===r?"BODY"===(s=h(d(t))).nodeName&&(s=e.ownerDocument.documentElement):s="window"===r?e.ownerDocument.documentElement:r;var l=N(s,a,i);if("HTML"!==s.nodeName||D(a))o=l;else{var u=S(e.ownerDocument),c=u.height,p=u.width;o.top+=l.top-l.marginTop,o.bottom=c+l.top,o.left+=l.left-l.marginLeft,o.right=p+l.left}}var m="number"==typeof(n=n||0);return o.left+=m?n:n.left||0,o.top+=m?n:n.top||0,o.right-=m?n:n.right||0,o.bottom-=m?n:n.bottom||0,o}function L(e){return e.width*e.height}function j(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=M(n,r,o,i),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},l=Object.keys(s).map((function(e){return k({key:e},s[e],{area:L(s[e])})})).sort((function(e,t){return t.area-e.area})),u=l.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),c=u.length>0?u[0].key:l[0].key,d=e.split("-")[1];return c+(d?"-"+d:"")}function F(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=r?R(t):b(t,f(n));return N(n,i,r)}function W(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function B(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function z(e,t,n){n=n.split("-")[0];var r=W(e),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",l=o?"height":"width",u=o?"width":"height";return i[a]=t[a]+t[l]/2-r[l]/2,i[s]=n===s?t[s]-r[u]:t[B(s)],i}function U(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function V(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e.name===n}));var r=U(e,(function(e){return e.name===n}));return e.indexOf(r)}(e,0,n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&u(n)&&(t.offsets.popper=O(t.offsets.popper),t.offsets.reference=O(t.offsets.reference),t=n(t,e))})),t}function Z(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=F(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=j(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=z(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=V(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function $(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function q(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r1&&void 0!==arguments[1]&&arguments[1],n=ie.indexOf(e),r=ie.slice(n+1).concat(ie.slice(0,n));return t?r.reverse():r}var ae={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,o=i.reference,a=i.popper,s=-1!==["bottom","top"].indexOf(n),l=s?"left":"top",u=s?"width":"height",c={start:I({},l,o[l]),end:I({},l,o[l]+o[u]-a[u])};e.offsets.popper=k({},a,c[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n,r=t.offset,i=e.placement,o=e.offsets,a=o.popper,s=o.reference,l=i.split("-")[0];return n=J(+r)?[+r,0]:function(e,t,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),s=a.indexOf(U(a,(function(e){return-1!==e.search(/,|\s/)})));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,u=-1!==s?[a.slice(0,s).concat([a[s].split(l)[0]]),[a[s].split(l)[1]].concat(a.slice(s+1))]:[a];return(u=u.map((function(e,r){var i=(1===r?!o:o)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return e;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}return O(s)[t]/100*o}return"vh"===a||"vw"===a?("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o:o}(e,i,t,n)}))}))).forEach((function(e,t){e.forEach((function(n,r){J(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))}))})),i}(r,a,s,l),"left"===l?(a.top+=n[0],a.left-=n[1]):"right"===l?(a.top+=n[0],a.left+=n[1]):"top"===l?(a.left+=n[0],a.top-=n[1]):"bottom"===l&&(a.left+=n[0],a.top+=n[1]),e.popper=a,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||v(e.instance.popper);e.instance.reference===n&&(n=v(n));var r=q("transform"),i=e.instance.popper.style,o=i.top,a=i.left,s=i[r];i.top="",i.left="",i[r]="";var l=M(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=o,i.left=a,i[r]=s,t.boundaries=l;var u=t.priority,c=e.offsets.popper,d={primary:function(e){var n=c[e];return c[e]l[e]&&!t.escapeWithReference&&(r=Math.min(c[n],l[e]-("right"===e?c.width:c.height))),I({},n,r)}};return u.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";c=k({},c,d[t](e))})),e.offsets.popper=c,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),s=a?"right":"bottom",l=a?"left":"top",u=a?"width":"height";return n[s]o(r[s])&&(e.offsets.popper[l]=o(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!ne(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"==typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],o=e.offsets,a=o.popper,s=o.reference,l=-1!==["left","right"].indexOf(i),u=l?"height":"width",d=l?"Top":"Left",h=d.toLowerCase(),f=l?"left":"top",p=l?"bottom":"right",m=W(r)[u];s[p]-ma[p]&&(e.offsets.popper[h]+=s[h]+m-a[p]),e.offsets.popper=O(e.offsets.popper);var g=s[h]+s[u]/2-m/2,v=c(e.instance.popper),y=parseFloat(v["margin"+d]),b=parseFloat(v["border"+d+"Width"]),w=g-e.offsets.popper[h]-y-b;return w=Math.max(Math.min(a[u]-m,w),0),e.arrowElement=r,e.offsets.arrow=(I(n={},h,Math.round(w)),I(n,f,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if($(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=M(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=B(r),o=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case"flip":a=[r,i];break;case"clockwise":a=oe(r);break;case"counterclockwise":a=oe(r,!0);break;default:a=t.behavior}return a.forEach((function(s,l){if(r!==s||a.length===l+1)return e;r=e.placement.split("-")[0],i=B(r);var u=e.offsets.popper,c=e.offsets.reference,d=Math.floor,h="left"===r&&d(u.right)>d(c.left)||"right"===r&&d(u.left)d(c.top)||"bottom"===r&&d(u.top)d(n.right),m=d(u.top)d(n.bottom),v="left"===r&&f||"right"===r&&p||"top"===r&&m||"bottom"===r&&g,y=-1!==["top","bottom"].indexOf(r),b=!!t.flipVariations&&(y&&"start"===o&&f||y&&"end"===o&&p||!y&&"start"===o&&m||!y&&"end"===o&&g),w=!!t.flipVariationsByContent&&(y&&"start"===o&&p||y&&"end"===o&&f||!y&&"start"===o&&g||!y&&"end"===o&&m),E=b||w;(h||v||E)&&(e.flipped=!0,(h||v)&&(r=a[l+1]),E&&(o=function(e){return"end"===e?"start":"start"===e?"end":e}(o)),e.placement=r+(o?"-"+o:""),e.offsets.popper=k({},e.offsets.popper,z(e.instance.popper,e.offsets.reference,e.placement)),e=V(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,i=r.popper,o=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[a?"left":"top"]=o[n]-(s?i[a?"width":"height"]:0),e.placement=B(t),e.offsets.popper=O(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!ne(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=U(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right2&&void 0!==arguments[2]?arguments[2]:{};x(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=l(this.update.bind(this)),this.options=k({},e.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(k({},e.Defaults.modifiers,i.modifiers)).forEach((function(t){r.options.modifiers[t]=k({},e.Defaults.modifiers[t]||{},i.modifiers?i.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return k({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&u(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return T(e,[{key:"update",value:function(){return Z.call(this)}},{key:"destroy",value:function(){return H.call(this)}},{key:"enableEventListeners",value:function(){return Y.call(this)}},{key:"disableEventListeners",value:function(){return X.call(this)}}]),e}();se.Utils=("undefined"!=typeof window?window:n.g).PopperUtils,se.placements=re,se.Defaults=ae;const le=se;var ue=n(159),ce=n(6234),de=n(2568),he=n(4236),fe=n(3834);function pe(e){return"function"==typeof e?e():e}var me="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,ge={};const ve=o.forwardRef((function(e,t){var n=e.anchorEl,a=e.children,s=e.container,l=e.disablePortal,u=void 0!==l&&l,c=e.keepMounted,d=void 0!==c&&c,h=e.modifiers,f=e.open,p=e.placement,m=void 0===p?"bottom":p,g=e.popperOptions,v=void 0===g?ge:g,y=e.popperRef,b=e.style,w=e.transition,E=void 0!==w&&w,_=(0,i.Z)(e,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition"]),C=o.useRef(null),S=(0,fe.Z)(C,t),x=o.useRef(null),T=(0,fe.Z)(x,y),I=o.useRef(T);me((function(){I.current=T}),[T]),o.useImperativeHandle(y,(function(){return x.current}),[]);var k=o.useState(!0),O=k[0],P=k[1],N=function(e,t){if("ltr"===(t&&t.direction||"ltr"))return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(m,(0,ue.Z)()),A=o.useState(N),D=A[0],R=A[1];o.useEffect((function(){x.current&&x.current.update()}));var M=o.useCallback((function(){if(C.current&&n&&f){x.current&&(x.current.destroy(),I.current(null));var e=function(e){R(e.placement)},t=(pe(n),new le(pe(n),C.current,(0,r.Z)({placement:N},v,{modifiers:(0,r.Z)({},u?{}:{preventOverflow:{boundariesElement:"window"}},{},h,{},v.modifiers),onCreate:(0,de.Z)(e,v.onCreate),onUpdate:(0,de.Z)(e,v.onUpdate)})));I.current(t)}}),[n,u,h,f,N,v]),L=o.useCallback((function(e){(0,he.Z)(S,e),M()}),[S,M]),j=function(){x.current&&(x.current.destroy(),I.current(null))};if(o.useEffect((function(){M()}),[M]),o.useEffect((function(){return function(){j()}}),[]),o.useEffect((function(){f||E||j()}),[f,E]),!d&&!f&&(!E||O))return null;var F={placement:D};return E&&(F.TransitionProps={in:f,onEnter:function(){P(!1)},onExited:function(){P(!0),j()}}),o.createElement(ce.Z,{disablePortal:u,container:s},o.createElement("div",(0,r.Z)({ref:L,role:"tooltip"},_,{style:(0,r.Z)({position:"fixed",top:0,left:0},b)}),"function"==typeof a?a(F):a))}))},6234:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(7294),i=n(3935),o=(n(5697),n(4236)),a=n(3834),s="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;const l=r.forwardRef((function(e,t){var n=e.children,l=e.container,u=e.disablePortal,c=void 0!==u&&u,d=e.onRendered,h=r.useState(null),f=h[0],p=h[1],m=(0,a.Z)(r.isValidElement(n)?n.ref:null,t);return s((function(){c||p(function(e){return e="function"==typeof e?e():e,i.findDOMNode(e)}(l)||document.body)}),[l,c]),s((function(){if(f&&!c)return(0,o.Z)(t,f),function(){(0,o.Z)(t,null)}}),[t,f,c]),s((function(){d&&(f||c)&&d()}),[d,f,c]),c?r.isValidElement(n)?r.cloneElement(n,{ref:m}):n:f?i.createPortal(n,f):f}))},3170:(e,t,n)=>{"use strict";n.d(t,{Z:()=>ae});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(5835)),s=n(5061),l=n(8481),u=n(484),c=(n(9864),n(6010)),d=n(3871),h=n(4670),f=n(3935),p=n(9437),m=n(626),g=n(713),v=n(2568),y=n(6423),b=n(170),w=n(9895);function E(e,t){var n=0;return"number"==typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function _(e,t){var n=0;return"number"==typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function C(e){return[e.horizontal,e.vertical].map((function(e){return"number"==typeof e?"".concat(e,"px"):e})).join(" ")}function S(e){return"function"==typeof e?e():e}var x=o.forwardRef((function(e,t){var n=e.action,a=e.anchorEl,s=e.anchorOrigin,l=void 0===s?{vertical:"top",horizontal:"left"}:s,u=e.anchorPosition,d=e.anchorReference,h=void 0===d?"anchorEl":d,x=e.children,T=e.classes,I=e.className,k=e.container,O=e.elevation,P=void 0===O?8:O,N=e.getContentAnchorEl,A=e.marginThreshold,D=void 0===A?16:A,R=e.onEnter,M=e.onEntered,L=e.onEntering,j=e.onExit,F=e.onExited,W=e.onExiting,B=e.open,z=e.PaperProps,U=void 0===z?{}:z,V=e.transformOrigin,Z=void 0===V?{vertical:"top",horizontal:"left"}:V,$=e.TransitionComponent,q=void 0===$?b.Z:$,H=e.transitionDuration,K=void 0===H?"auto":H,G=e.TransitionProps,Q=void 0===G?{}:G,Y=(0,i.Z)(e,["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","classes","className","container","elevation","getContentAnchorEl","marginThreshold","onEnter","onEntered","onEntering","onExit","onExited","onExiting","open","PaperProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps"]),X=o.useRef(),J=o.useCallback((function(e){if("anchorPosition"===h)return u;var t=S(a),n=(t instanceof(0,g.Z)(t).Element?t:(0,m.Z)(X.current).body).getBoundingClientRect(),r=0===e?l.vertical:"center";return{top:n.top+E(n,r),left:n.left+_(n,l.horizontal)}}),[a,l.horizontal,l.vertical,u,h]),ee=o.useCallback((function(e){var t=0;if(N&&"anchorEl"===h){var n=N(e);if(n&&e.contains(n)){var r=function(e,t){for(var n=t,r=0;n&&n!==e;)r+=(n=n.parentElement).scrollTop;return r}(e,n);t=n.offsetTop+n.clientHeight/2-r||0}}return t}),[l.vertical,h,N]),te=o.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{vertical:E(e,Z.vertical)+t,horizontal:_(e,Z.horizontal)}}),[Z.horizontal,Z.vertical]),ne=o.useCallback((function(e){var t=ee(e),n={width:e.offsetWidth,height:e.offsetHeight},r=te(n,t);if("none"===h)return{top:null,left:null,transformOrigin:C(r)};var i=J(t),o=i.top-r.vertical,s=i.left-r.horizontal,l=o+n.height,u=s+n.width,c=(0,g.Z)(S(a)),d=c.innerHeight-D,f=c.innerWidth-D;if(od){var m=l-d;o-=m,r.vertical+=m}if(sf){var y=u-f;s-=y,r.horizontal+=y}return{top:"".concat(Math.round(o),"px"),left:"".concat(Math.round(s),"px"),transformOrigin:C(r)}}),[a,h,J,ee,te,D]),re=o.useCallback((function(){var e=X.current;if(e){var t=ne(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin}}),[ne]),ie=o.useCallback((function(e){X.current=f.findDOMNode(e)}),[]);o.useEffect((function(){B&&re()})),o.useImperativeHandle(n,(function(){return B?{updatePosition:function(){re()}}:null}),[B,re]),o.useEffect((function(){if(B){var e=(0,p.Z)((function(){re()}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}}),[B,re]);var oe=K;"auto"!==K||q.muiSupportAuto||(oe=void 0);var ae=k||(a?(0,m.Z)(S(a)).body:void 0);return o.createElement(y.Z,(0,r.Z)({container:ae,open:B,ref:t,BackdropProps:{invisible:!0},className:(0,c.default)(T.root,I)},Y),o.createElement(q,(0,r.Z)({appear:!0,in:B,onEnter:R,onEntered:M,onExit:j,onExited:F,onExiting:W,timeout:oe},Q,{onEntering:(0,v.Z)((function(e,t){L&&L(e,t),re()}),Q.onEntering)}),o.createElement(w.Z,(0,r.Z)({elevation:P,ref:ie},U,{className:(0,c.default)(T.paper,U.className)}),x)))}));const T=(0,h.Z)({root:{},paper:{position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}},{name:"MuiPopover"})(x);var I=n(2822),k=n(5840),O=n(3834);function P(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function N(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function A(e,t){if(void 0===t)return!0;var n=e.innerText;return void 0===n&&(n=e.textContent),0!==(n=n.trim().toLowerCase()).length&&(t.repeating?n[0]===t.keys[0]:0===n.indexOf(t.keys.join("")))}function D(e,t,n,r,i,o){for(var a=!1,s=i(e,t,!!t&&n);s;){if(s===e.firstChild){if(a)return;a=!0}var l=!r&&(s.disabled||"true"===s.getAttribute("aria-disabled"));if(s.hasAttribute("tabindex")&&A(s,o)&&!l)return void s.focus();s=i(e,s,n)}}var R="undefined"==typeof window?o.useEffect:o.useLayoutEffect;const M=o.forwardRef((function(e,t){var n=e.actions,a=e.autoFocus,s=void 0!==a&&a,l=e.autoFocusItem,u=void 0!==l&&l,c=e.children,d=e.className,h=e.disabledItemsFocusable,p=void 0!==h&&h,g=e.disableListWrap,v=void 0!==g&&g,y=e.onKeyDown,b=e.variant,w=void 0===b?"selectedMenu":b,E=(0,i.Z)(e,["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"]),_=o.useRef(null),C=o.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});R((function(){s&&_.current.focus()}),[s]),o.useImperativeHandle(n,(function(){return{adjustStyleForScrollbar:function(e,t){var n=!_.current.style.width;if(e.clientHeight<_.current.clientHeight&&n){var r="".concat((0,k.Z)(!0),"px");_.current.style["rtl"===t.direction?"paddingLeft":"paddingRight"]=r,_.current.style.width="calc(100% + ".concat(r,")")}return _.current}}}),[]);var S=o.useCallback((function(e){_.current=f.findDOMNode(e)}),[]),x=(0,O.Z)(S,t),T=-1;o.Children.forEach(c,(function(e,t){o.isValidElement(e)&&(e.props.disabled||("selectedMenu"===w&&e.props.selected||-1===T)&&(T=t))}));var M=o.Children.map(c,(function(e,t){if(t===T){var n={};return u&&(n.autoFocus=!0),void 0===e.props.tabIndex&&"selectedMenu"===w&&(n.tabIndex=0),o.cloneElement(e,n)}return e}));return o.createElement(I.Z,(0,r.Z)({role:"menu",ref:x,className:d,onKeyDown:function(e){var t=_.current,n=e.key,r=(0,m.Z)(t).activeElement;if("ArrowDown"===n)e.preventDefault(),D(t,r,v,p,P);else if("ArrowUp"===n)e.preventDefault(),D(t,r,v,p,N);else if("Home"===n)e.preventDefault(),D(t,null,v,p,P);else if("End"===n)e.preventDefault(),D(t,null,v,p,N);else if(1===n.length){var i=C.current,o=n.toLowerCase(),a=performance.now();i.keys.length>0&&(a-i.lastTime>500?(i.keys=[],i.repeating=!0,i.previousKeyMatched=!0):i.repeating&&o!==i.keys[0]&&(i.repeating=!1)),i.lastTime=a,i.keys.push(o);var s=r&&!i.repeating&&A(r,i);i.previousKeyMatched&&(s||D(t,r,!1,p,P,i))?e.preventDefault():i.previousKeyMatched=!1}y&&y(e)},tabIndex:s?0:-1},E),M)}));var L=n(4236),j=n(8920),F={vertical:"top",horizontal:"right"},W={vertical:"top",horizontal:"left"},B=o.forwardRef((function(e,t){var n=e.autoFocus,a=void 0===n||n,s=e.children,l=e.classes,u=e.disableAutoFocusItem,d=void 0!==u&&u,h=e.MenuListProps,p=void 0===h?{}:h,m=e.onClose,g=e.onEntering,v=e.open,y=e.PaperProps,b=void 0===y?{}:y,w=e.PopoverClasses,E=e.transitionDuration,_=void 0===E?"auto":E,C=e.variant,S=void 0===C?"selectedMenu":C,x=(0,i.Z)(e,["autoFocus","children","classes","disableAutoFocusItem","MenuListProps","onClose","onEntering","open","PaperProps","PopoverClasses","transitionDuration","variant"]),I=(0,j.Z)(),k=a&&!d&&v,O=o.useRef(null),P=o.useRef(null),N=-1;o.Children.map(s,(function(e,t){o.isValidElement(e)&&(e.props.disabled||("menu"!==S&&e.props.selected||-1===N)&&(N=t))}));var A=o.Children.map(s,(function(e,t){return t===N?o.cloneElement(e,{ref:function(t){P.current=f.findDOMNode(t),(0,L.Z)(e.ref,t)}}):e}));return o.createElement(T,(0,r.Z)({getContentAnchorEl:function(){return P.current},classes:w,onClose:m,onEntering:function(e,t){O.current&&O.current.adjustStyleForScrollbar(e,I),g&&g(e,t)},anchorOrigin:"rtl"===I.direction?F:W,transformOrigin:"rtl"===I.direction?F:W,PaperProps:(0,r.Z)({},b,{classes:(0,r.Z)({},b.classes,{root:l.paper})}),open:v,ref:t,transitionDuration:_},x),o.createElement(M,(0,r.Z)({onKeyDown:function(e){"Tab"===e.key&&(e.preventDefault(),m&&m(e,"tabKeyDown"))},actions:O,autoFocus:a&&(-1===N||d),autoFocusItem:k,variant:S},p,{className:(0,c.default)(l.list,p.className)}),A))}));const z=(0,h.Z)({paper:{maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"},list:{outline:0}},{name:"MuiMenu"})(B);var U=n(6519),V=n(2775);function Z(e,t){return"object"===(0,u.Z)(t)&&null!==t?e===t:String(e)===String(t)}const $=o.forwardRef((function(e,t){var n=e["aria-label"],a=e.autoFocus,u=e.autoWidth,h=e.children,f=e.classes,p=e.className,m=e.defaultValue,g=e.disabled,v=e.displayEmpty,y=e.IconComponent,b=e.inputRef,w=e.labelId,E=e.MenuProps,_=void 0===E?{}:E,C=e.multiple,S=e.name,x=e.onBlur,T=e.onChange,I=e.onClose,k=e.onFocus,P=e.onOpen,N=e.open,A=e.readOnly,D=e.renderValue,R=(e.required,e.SelectDisplayProps),M=void 0===R?{}:R,L=e.tabIndex,j=(e.type,e.value),F=e.variant,W=void 0===F?"standard":F,B=(0,i.Z)(e,["aria-label","autoFocus","autoWidth","children","classes","className","defaultValue","disabled","displayEmpty","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","required","SelectDisplayProps","tabIndex","type","value","variant"]),$=(0,V.Z)({controlled:j,default:m,name:"SelectInput"}),q=(0,l.Z)($,2),H=q[0],K=q[1],G=o.useRef(null),Q=o.useState(null),Y=Q[0],X=Q[1],J=o.useRef(null!=N).current,ee=o.useState(),te=ee[0],ne=ee[1],re=o.useState(!1),ie=re[0],oe=re[1],ae=(0,O.Z)(t,b);o.useImperativeHandle(ae,(function(){return{focus:function(){Y.focus()},node:G.current,value:H}}),[Y,H]),o.useEffect((function(){a&&Y&&Y.focus()}),[a,Y]);var se,le,ue=function(e,t){e?P&&P(t):I&&I(t),J||(ne(u?null:Y.clientWidth),oe(e))},ce=function(e){return function(t){var n;if(C||ue(!1,t),C){n=Array.isArray(H)?(0,s.Z)(H):[];var r=H.indexOf(e.props.value);-1===r?n.push(e.props.value):n.splice(r,1)}else n=e.props.value;H!==n&&(K(n),T&&(t.persist(),Object.defineProperty(t,"target",{writable:!0,value:{value:n,name:S}}),T(t,e)))}},de=null!==Y&&(J?N:ie);delete B["aria-invalid"];var he=[],fe=!1;((0,U.vd)({value:H})||v)&&(D?se=D(H):fe=!0);var pe=o.Children.map(h,(function(e){if(!o.isValidElement(e))return null;var t;if(C){if(!Array.isArray(H))throw new Error("Material-UI: the `value` prop must be an array when using the `Select` component with `multiple`.");(t=H.some((function(t){return Z(t,e.props.value)})))&&fe&&he.push(e.props.children)}else(t=Z(H,e.props.value))&&fe&&(le=e.props.children);return o.cloneElement(e,{"aria-selected":t?"true":void 0,onClick:ce(e),onKeyUp:function(t){" "===t.key&&t.preventDefault();var n=e.props.onKeyUp;"function"==typeof n&&n(t)},role:"option",selected:t,value:void 0,"data-value":e.props.value})}));fe&&(se=C?he.join(", "):le);var me,ge=te;!u&&J&&Y&&(ge=Y.clientWidth),me=void 0!==L?L:g?null:0;var ve=M.id||(S?"mui-component-select-".concat(S):void 0);return o.createElement(o.Fragment,null,o.createElement("div",(0,r.Z)({className:(0,c.default)(f.root,f.select,f.selectMenu,f[W],p,g&&f.disabled),ref:X,tabIndex:me,role:"button","aria-disabled":g?"true":void 0,"aria-expanded":de?"true":void 0,"aria-haspopup":"listbox","aria-label":n,"aria-labelledby":[w,ve].filter(Boolean).join(" ")||void 0,onKeyDown:function(e){A||-1!==[" ","ArrowUp","ArrowDown","Enter"].indexOf(e.key)&&(e.preventDefault(),ue(!0,e))},onMouseDown:g||A?null:function(e){0===e.button&&(e.preventDefault(),Y.focus(),ue(!0,e))},onBlur:function(e){!de&&x&&(e.persist(),Object.defineProperty(e,"target",{writable:!0,value:{value:H,name:S}}),x(e))},onFocus:k},M,{id:ve}),function(e){return null==e||"string"==typeof e&&!e.trim()}(se)?o.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}}):se),o.createElement("input",(0,r.Z)({value:Array.isArray(H)?H.join(","):H,name:S,ref:G,type:"hidden",autoFocus:a},B)),o.createElement(y,{className:(0,c.default)(f.icon,f["icon".concat((0,d.Z)(W))],de&&f.iconOpen,g&&f.disabled)}),o.createElement(z,(0,r.Z)({id:"menu-".concat(S||""),anchorEl:Y,open:de,onClose:function(e){ue(!1,e)}},_,{MenuListProps:(0,r.Z)({"aria-labelledby":w,role:"listbox",disableListWrap:!0},_.MenuListProps),PaperProps:(0,r.Z)({},_.PaperProps,{style:(0,r.Z)({minWidth:ge},null!=_.PaperProps?_.PaperProps.style:null)})}),pe))}));var q=n(9345),H=n(2601);const K=(0,n(3786).Z)(o.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");var G=n(8799);const Q=o.forwardRef((function(e,t){var n=e.classes,a=e.className,s=e.disabled,l=e.IconComponent,u=e.inputRef,h=e.variant,f=void 0===h?"standard":h,p=(0,i.Z)(e,["classes","className","disabled","IconComponent","inputRef","variant"]);return o.createElement(o.Fragment,null,o.createElement("select",(0,r.Z)({className:(0,c.default)(n.root,n.select,n[f],a,s&&n.disabled),disabled:s,ref:u||t},p)),e.multiple?null:o.createElement(l,{className:(0,c.default)(n.icon,n["icon".concat((0,d.Z)(f))],s&&n.disabled)}))}));var Y=function(e){return{root:{},select:{"-moz-appearance":"none","-webkit-appearance":"none",userSelect:"none",borderRadius:0,minWidth:16,cursor:"pointer","&:focus":{backgroundColor:"light"===e.palette.type?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)",borderRadius:0},"&::-ms-expand":{display:"none"},"&$disabled":{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:e.palette.background.paper},"&&":{paddingRight:24}},filled:{"&&":{paddingRight:32}},outlined:{borderRadius:e.shape.borderRadius,"&&":{paddingRight:32}},selectMenu:{height:"auto",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},disabled:{},icon:{position:"absolute",right:0,top:"calc(50% - 12px)",pointerEvents:"none",color:e.palette.action.active,"&$disabled":{color:e.palette.action.disabled}},iconOpen:{transform:"rotate(180deg)"},iconFilled:{right:7},iconOutlined:{right:7}}},X=o.createElement(G.Z,null),J=o.forwardRef((function(e,t){var n=e.children,a=e.classes,s=e.IconComponent,l=void 0===s?K:s,u=e.input,c=void 0===u?X:u,d=e.inputProps,h=(e.variant,(0,i.Z)(e,["children","classes","IconComponent","input","inputProps","variant"])),f=(0,H.Z)(),p=(0,q.Z)({props:e,muiFormControl:f,states:["variant"]});return o.cloneElement(c,(0,r.Z)({inputComponent:Q,inputProps:(0,r.Z)({children:n,classes:a,IconComponent:l,variant:p.variant,type:void 0},d,{},c?c.props.inputProps:{}),ref:t},h))}));J.muiName="Select",(0,h.Z)(Y,{name:"MuiNativeSelect"})(J);var ee=n(9446),te=n(6718),ne=Y,re=o.createElement(G.Z,null),ie=o.createElement(ee.Z,null),oe=o.forwardRef((function e(t,n){var s=t.autoWidth,l=void 0!==s&&s,u=t.children,c=t.classes,d=t.displayEmpty,h=void 0!==d&&d,f=t.IconComponent,p=void 0===f?K:f,m=t.id,g=t.input,v=t.inputProps,y=t.label,b=t.labelId,w=t.labelWidth,E=void 0===w?0:w,_=t.MenuProps,C=t.multiple,S=void 0!==C&&C,x=t.native,T=void 0!==x&&x,I=t.onClose,k=t.onOpen,O=t.open,P=t.renderValue,N=t.SelectDisplayProps,A=t.variant,D=void 0===A?"standard":A,R=(0,i.Z)(t,["autoWidth","children","classes","displayEmpty","IconComponent","id","input","inputProps","label","labelId","labelWidth","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"]),M=T?Q:$,L=(0,H.Z)(),j=(0,q.Z)({props:t,muiFormControl:L,states:["variant"]}).variant||D,F=g||{standard:re,outlined:o.createElement(te.Z,{label:y,labelWidth:E}),filled:ie}[j];return o.cloneElement(F,(0,r.Z)({inputComponent:M,inputProps:(0,r.Z)({children:u,IconComponent:p,variant:j,type:void 0,multiple:S},T?{id:m}:{autoWidth:l,displayEmpty:h,labelId:b,MenuProps:_,onClose:I,onOpen:k,open:O,renderValue:P,SelectDisplayProps:(0,r.Z)({id:m},N)},{},v,{classes:v?(0,a.Z)({baseClasses:c,newClasses:v.classes,Component:e}):c},g?g.props.inputProps:{}),ref:n},R))}));oe.muiName="Select";const ae=(0,h.Z)(ne,{name:"MuiSelect"})(oe)},3141:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.Z});var r=n(3170)},2087:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=n(3871),u=o.forwardRef((function(e,t){var n=e.children,s=e.classes,u=e.className,c=e.color,d=void 0===c?"inherit":c,h=e.component,f=void 0===h?"svg":h,p=e.fontSize,m=void 0===p?"default":p,g=e.htmlColor,v=e.titleAccess,y=e.viewBox,b=void 0===y?"0 0 24 24":y,w=(0,i.Z)(e,["children","classes","className","color","component","fontSize","htmlColor","titleAccess","viewBox"]);return o.createElement(f,(0,r.Z)({className:(0,a.default)(s.root,u,"inherit"!==d&&s["color".concat((0,l.Z)(d))],"default"!==m&&s["fontSize".concat((0,l.Z)(m))]),focusable:"false",viewBox:b,color:g,"aria-hidden":v?void 0:"true",role:v?"img":void 0,ref:t},w),n,v?o.createElement("title",null,v):null)}));u.muiName="SvgIcon";const c=(0,s.Z)((function(e){return{root:{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,fontSize:e.typography.pxToRem(24),transition:e.transitions.create("fill",{duration:e.transitions.duration.shorter})},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorAction:{color:e.palette.action.active},colorError:{color:e.palette.error.main},colorDisabled:{color:e.palette.action.disabled},fontSizeInherit:{fontSize:"inherit"},fontSizeSmall:{fontSize:e.typography.pxToRem(20)},fontSizeLarge:{fontSize:e.typography.pxToRem(35)}}}),{name:"MuiSvgIcon"})(u)},2015:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.Z});var r=n(2087)},5574:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=n(9693),u=n(3871),c=n(6608),d=o.forwardRef((function(e,t){var n=e.classes,s=e.className,l=e.color,d=void 0===l?"secondary":l,h=e.edge,f=void 0!==h&&h,p=e.size,m=void 0===p?"medium":p,g=(0,i.Z)(e,["classes","className","color","edge","size"]),v=o.createElement("span",{className:n.thumb});return o.createElement("span",{className:(0,a.default)(n.root,s,{start:n.edgeStart,end:n.edgeEnd}[f],"small"===m&&n["size".concat((0,u.Z)(m))])},o.createElement(c.Z,(0,r.Z)({type:"checkbox",icon:v,checkedIcon:v,classes:{root:(0,a.default)(n.switchBase,n["color".concat((0,u.Z)(d))]),input:n.input,checked:n.checked,disabled:n.disabled},ref:t},g)),o.createElement("span",{className:n.track}))}));const h=(0,s.Z)((function(e){return{root:{display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle"},edgeStart:{marginLeft:-8},edgeEnd:{marginRight:-8},switchBase:{position:"absolute",top:0,left:0,zIndex:1,color:"light"===e.palette.type?e.palette.grey[50]:e.palette.grey[400],transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),"&$checked":{transform:"translateX(20px)"},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{opacity:.5},"&$disabled + $track":{opacity:"light"===e.palette.type?.12:.1}},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,l.U1)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.primary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,l.U1)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.secondary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},sizeSmall:{width:40,height:24,padding:7,"& $thumb":{width:16,height:16},"& $switchBase":{padding:4,"&$checked":{transform:"translateX(16px)"}}},checked:{},disabled:{},input:{left:"-100%",width:"300%"},thumb:{boxShadow:e.shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"},track:{height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white,opacity:"light"===e.palette.type?.38:.3}}}),{name:"MuiSwitch"})(d)},6366:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>w});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(8799),l=n(9446),u=n(6718),c=n(3700),d=n(4436),h=n(9345),f=n(2601),p=n(4670),m=o.forwardRef((function(e,t){var n=e.children,s=e.classes,l=e.className,u=e.component,c=void 0===u?"p":u,d=(e.disabled,e.error,e.filled,e.focused,e.margin,e.required,e.variant,(0,i.Z)(e,["children","classes","className","component","disabled","error","filled","focused","margin","required","variant"])),p=(0,f.Z)(),m=(0,h.Z)({props:e,muiFormControl:p,states:["variant","margin","disabled","error","filled","focused","required"]});return o.createElement(c,(0,r.Z)({className:(0,a.default)(s.root,("filled"===m.variant||"outlined"===m.variant)&&s.contained,l,m.disabled&&s.disabled,m.error&&s.error,m.filled&&s.filled,m.focused&&s.focused,m.required&&s.required,"dense"===m.margin&&s.marginDense),ref:t},d)," "===n?o.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}}):n)}));const g=(0,p.Z)((function(e){return{root:(0,r.Z)({color:e.palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,margin:0,"&$disabled":{color:e.palette.text.disabled},"&$error":{color:e.palette.error.main}}),error:{},disabled:{},marginDense:{marginTop:4},contained:{marginLeft:14,marginRight:14},focused:{},filled:{},required:{}}}),{name:"MuiFormHelperText"})(m);var v=n(3170),y={standard:s.Z,filled:l.Z,outlined:u.Z},b=o.forwardRef((function(e,t){var n=e.autoComplete,s=e.autoFocus,l=void 0!==s&&s,u=e.children,h=e.classes,f=e.className,p=e.color,m=void 0===p?"primary":p,b=e.defaultValue,w=e.disabled,E=void 0!==w&&w,_=e.error,C=void 0!==_&&_,S=e.FormHelperTextProps,x=e.fullWidth,T=void 0!==x&&x,I=e.helperText,k=e.hiddenLabel,O=e.id,P=e.InputLabelProps,N=e.inputProps,A=e.InputProps,D=e.inputRef,R=e.label,M=e.multiline,L=void 0!==M&&M,j=e.name,F=e.onBlur,W=e.onChange,B=e.onFocus,z=e.placeholder,U=e.required,V=void 0!==U&&U,Z=e.rows,$=e.rowsMax,q=e.select,H=void 0!==q&&q,K=e.SelectProps,G=e.type,Q=e.value,Y=e.variant,X=void 0===Y?"standard":Y,J=(0,i.Z)(e,["autoComplete","autoFocus","children","classes","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","hiddenLabel","id","InputLabelProps","inputProps","InputProps","inputRef","label","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","rowsMax","select","SelectProps","type","value","variant"]),ee={};"outlined"===X&&(P&&void 0!==P.shrink&&(ee.notched=P.shrink),R&&(ee.label=o.createElement(o.Fragment,null,R,V&&" *"))),H&&(K&&K.native||(ee.id=void 0),ee["aria-describedby"]=void 0);var te=I&&O?"".concat(O,"-helper-text"):void 0,ne=R&&O?"".concat(O,"-label"):void 0,re=y[X],ie=o.createElement(re,(0,r.Z)({"aria-describedby":te,autoComplete:n,autoFocus:l,defaultValue:b,fullWidth:T,multiline:L,name:j,rows:Z,rowsMax:$,type:G,value:Q,id:O,inputRef:D,onBlur:F,onChange:W,onFocus:B,placeholder:z,inputProps:N},ee,A));return o.createElement(d.Z,(0,r.Z)({className:(0,a.default)(h.root,f),disabled:E,error:C,fullWidth:T,hiddenLabel:k,ref:t,required:V,color:m,variant:X},J),R&&o.createElement(c.Z,(0,r.Z)({htmlFor:O,id:ne},P),R),H?o.createElement(v.Z,(0,r.Z)({"aria-describedby":te,id:O,labelId:ne,value:Q,input:ie},K),u):ie,I&&o.createElement(g,(0,r.Z)({id:te},S),I))}));const w=(0,p.Z)({root:{}},{name:"MuiTextField"})(b)},6500:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>c});var r=n(2122),i=n(1253),o=n(6156),a=n(7294),s=(n(5697),n(6010)),l=n(4670),u=a.forwardRef((function(e,t){var n=e.classes,o=e.className,l=e.component,u=void 0===l?"div":l,c=e.disableGutters,d=void 0!==c&&c,h=e.variant,f=void 0===h?"regular":h,p=(0,i.Z)(e,["classes","className","component","disableGutters","variant"]);return a.createElement(u,(0,r.Z)({className:(0,s.default)(n.root,n[f],o,!d&&n.gutters),ref:t},p))}));const c=(0,l.Z)((function(e){return{root:{position:"relative",display:"flex",alignItems:"center"},gutters:(0,o.Z)({paddingLeft:e.spacing(2),paddingRight:e.spacing(2)},e.breakpoints.up("sm"),{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}),regular:e.mixins.toolbar,dense:{minHeight:48}}}),{name:"MuiToolbar"})(u)},9069:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>T});var r=n(2122),i=n(8481),o=n(1253),a=n(6156),s=n(7294),l=n(3935),u=(n(5697),n(6010)),c=n(5953),d=n(9693),h=n(4670),f=n(3871),p=n(170),m=n(6617),g=n(3834),v=n(5001),y=n(4236),b=n(4896),w=n(2775),E=n(8920);function _(e){return Math.round(1e5*e)/1e5}var C=!1,S=null,x=s.forwardRef((function(e,t){var n=e.arrow,a=void 0!==n&&n,d=e.children,h=e.classes,_=e.disableFocusListener,x=void 0!==_&&_,T=e.disableHoverListener,I=void 0!==T&&T,k=e.disableTouchListener,O=void 0!==k&&k,P=e.enterDelay,N=void 0===P?100:P,A=e.enterNextDelay,D=void 0===A?0:A,R=e.enterTouchDelay,M=void 0===R?700:R,L=e.id,j=e.interactive,F=void 0!==j&&j,W=e.leaveDelay,B=void 0===W?0:W,z=e.leaveTouchDelay,U=void 0===z?1500:z,V=e.onClose,Z=e.onOpen,$=e.open,q=e.placement,H=void 0===q?"bottom":q,K=e.PopperProps,G=e.title,Q=e.TransitionComponent,Y=void 0===Q?p.Z:Q,X=e.TransitionProps,J=(0,o.Z)(e,["arrow","children","classes","disableFocusListener","disableHoverListener","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","id","interactive","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperProps","title","TransitionComponent","TransitionProps"]),ee=(0,E.Z)(),te=s.useState(),ne=te[0],re=te[1],ie=s.useState(null),oe=ie[0],ae=ie[1],se=s.useRef(!1),le=s.useRef(),ue=s.useRef(),ce=s.useRef(),de=s.useRef(),he=(0,w.Z)({controlled:$,default:!1,name:"Tooltip",state:"open"}),fe=(0,i.Z)(he,2),pe=fe[0],me=fe[1],ge=pe,ve=(0,v.Z)(L);s.useEffect((function(){return function(){clearTimeout(le.current),clearTimeout(ue.current),clearTimeout(ce.current),clearTimeout(de.current)}}),[]);var ye=function(e){clearTimeout(S),C=!0,me(!0),Z&&Z(e)},be=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){var n=d.props;"mouseover"===t.type&&n.onMouseOver&&e&&n.onMouseOver(t),se.current&&"touchstart"!==t.type||(ne&&ne.removeAttribute("title"),clearTimeout(ue.current),clearTimeout(ce.current),N||C&&D?(t.persist(),ue.current=setTimeout((function(){ye(t)}),C?D:N)):ye(t))}},we=(0,b.Z)(),Ee=we.isFocusVisible,_e=we.onBlurVisible,Ce=we.ref,Se=s.useState(!1),xe=Se[0],Te=Se[1],Ie=function(){xe&&(Te(!1),_e())},ke=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){ne||re(t.currentTarget),Ee(t)&&(Te(!0),be()(t));var n=d.props;n.onFocus&&e&&n.onFocus(t)}},Oe=function(e){clearTimeout(S),S=setTimeout((function(){C=!1}),800+B),me(!1),V&&V(e),clearTimeout(le.current),le.current=setTimeout((function(){se.current=!1}),ee.transitions.duration.shortest)},Pe=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){var n=d.props;"blur"===t.type&&(n.onBlur&&e&&n.onBlur(t),Ie()),"mouseleave"===t.type&&n.onMouseLeave&&t.currentTarget===ne&&n.onMouseLeave(t),clearTimeout(ue.current),clearTimeout(ce.current),t.persist(),ce.current=setTimeout((function(){Oe(t)}),B)}},Ne=(0,g.Z)(re,t),Ae=(0,g.Z)(Ce,Ne),De=s.useCallback((function(e){(0,y.Z)(Ae,l.findDOMNode(e))}),[Ae]),Re=(0,g.Z)(d.ref,De);""===G&&(ge=!1);var Me=!ge&&!I,Le=(0,r.Z)({"aria-describedby":ge?ve:null,title:Me&&"string"==typeof G?G:null},J,{},d.props,{className:(0,u.default)(J.className,d.props.className),ref:Re}),je={};O||(Le.onTouchStart=function(e){se.current=!0;var t=d.props;t.onTouchStart&&t.onTouchStart(e),clearTimeout(ce.current),clearTimeout(le.current),clearTimeout(de.current),e.persist(),de.current=setTimeout((function(){be()(e)}),M)},Le.onTouchEnd=function(e){d.props.onTouchEnd&&d.props.onTouchEnd(e),clearTimeout(de.current),clearTimeout(ce.current),e.persist(),ce.current=setTimeout((function(){Oe(e)}),U)}),I||(Le.onMouseOver=be(),Le.onMouseLeave=Pe(),F&&(je.onMouseOver=be(!1),je.onMouseLeave=Pe(!1))),x||(Le.onFocus=ke(),Le.onBlur=Pe(),F&&(je.onFocus=ke(!1),je.onBlur=Pe(!1)));var Fe=s.useMemo((function(){return(0,c.Z)({popperOptions:{modifiers:{arrow:{enabled:Boolean(oe),element:oe}}}},K)}),[oe,K]);return s.createElement(s.Fragment,null,s.cloneElement(d,Le),s.createElement(m.Z,(0,r.Z)({className:(0,u.default)(h.popper,F&&h.popperInteractive,a&&h.popperArrow),placement:H,anchorEl:ne,open:!!ne&&ge,id:Le["aria-describedby"],transition:!0},je,Fe),(function(e){var t=e.placement,n=e.TransitionProps;return s.createElement(Y,(0,r.Z)({timeout:ee.transitions.duration.shorter},n,X),s.createElement("div",{className:(0,u.default)(h.tooltip,h["tooltipPlacement".concat((0,f.Z)(t.split("-")[0]))],se.current&&h.touch,a&&h.tooltipArrow)},G,a?s.createElement("span",{className:h.arrow,ref:ae}):null))})))}));const T=(0,h.Z)((function(e){return{popper:{zIndex:e.zIndex.tooltip,pointerEvents:"none",flip:!1},popperInteractive:{pointerEvents:"auto"},popperArrow:{'&[x-placement*="bottom"] $arrow':{flip:!1,top:0,left:0,marginTop:"-0.95em",marginLeft:4,marginRight:4,width:"2em",height:"1em","&::before":{flip:!1,borderWidth:"0 1em 1em 1em",borderColor:"transparent transparent currentcolor transparent"}},'&[x-placement*="top"] $arrow':{flip:!1,bottom:0,left:0,marginBottom:"-0.95em",marginLeft:4,marginRight:4,width:"2em",height:"1em","&::before":{flip:!1,borderWidth:"1em 1em 0 1em",borderColor:"currentcolor transparent transparent transparent"}},'&[x-placement*="right"] $arrow':{flip:!1,left:0,marginLeft:"-0.95em",marginTop:4,marginBottom:4,height:"2em",width:"1em","&::before":{flip:!1,borderWidth:"1em 1em 1em 0",borderColor:"transparent currentcolor transparent transparent"}},'&[x-placement*="left"] $arrow':{flip:!1,right:0,marginRight:"-0.95em",marginTop:4,marginBottom:4,height:"2em",width:"1em","&::before":{flip:!1,borderWidth:"1em 0 1em 1em",borderColor:"transparent transparent transparent currentcolor"}}},tooltip:{backgroundColor:(0,d.U1)(e.palette.grey[700],.9),borderRadius:e.shape.borderRadius,color:e.palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(10),lineHeight:"".concat(_(1.4),"em"),maxWidth:300,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},tooltipArrow:{position:"relative",margin:"0"},arrow:{position:"absolute",fontSize:6,color:(0,d.U1)(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:0,height:0,borderStyle:"solid"}},touch:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:"".concat(_(16/14),"em"),fontWeight:e.typography.fontWeightRegular},tooltipPlacementLeft:(0,a.Z)({transformOrigin:"right center",margin:"0 24px "},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementRight:(0,a.Z)({transformOrigin:"left center",margin:"0 24px"},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementTop:(0,a.Z)({transformOrigin:"center bottom",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"}),tooltipPlacementBottom:(0,a.Z)({transformOrigin:"center top",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"})}}),{name:"MuiTooltip"})(x)},2318:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(6010)),s=n(4670),l=n(3871),u={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},c=o.forwardRef((function(e,t){var n=e.align,s=void 0===n?"inherit":n,c=e.classes,d=e.className,h=e.color,f=void 0===h?"initial":h,p=e.component,m=e.display,g=void 0===m?"initial":m,v=e.gutterBottom,y=void 0!==v&&v,b=e.noWrap,w=void 0!==b&&b,E=e.paragraph,_=void 0!==E&&E,C=e.variant,S=void 0===C?"body1":C,x=e.variantMapping,T=void 0===x?u:x,I=(0,i.Z)(e,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),k=p||(_?"p":T[S]||u[S])||"span";return o.createElement(k,(0,r.Z)({className:(0,a.default)(c.root,d,"inherit"!==S&&c[S],"initial"!==f&&c["color".concat((0,l.Z)(f))],w&&c.noWrap,y&&c.gutterBottom,_&&c.paragraph,"inherit"!==s&&c["align".concat((0,l.Z)(s))],"initial"!==g&&c["display".concat((0,l.Z)(g))]),ref:t},I))}));const d=(0,s.Z)((function(e){return{root:{margin:0},body2:e.typography.body2,body1:e.typography.body1,caption:e.typography.caption,button:e.typography.button,h1:e.typography.h1,h2:e.typography.h2,h3:e.typography.h3,h4:e.typography.h4,h5:e.typography.h5,h6:e.typography.h6,subtitle1:e.typography.subtitle1,subtitle2:e.typography.subtitle2,overline:e.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorTextPrimary:{color:e.palette.text.primary},colorTextSecondary:{color:e.palette.text.secondary},colorError:{color:e.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}}),{name:"MuiTypography"})(c)},400:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r.Z});var r=n(2318)},6608:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(2122),i=n(8481),o=n(1253),a=n(7294),s=(n(5697),n(6010)),l=n(2775),u=n(2601),c=n(4670),d=n(7812),h=a.forwardRef((function(e,t){var n=e.autoFocus,c=e.checked,h=e.checkedIcon,f=e.classes,p=e.className,m=e.defaultChecked,g=e.disabled,v=e.icon,y=e.id,b=e.inputProps,w=e.inputRef,E=e.name,_=e.onBlur,C=e.onChange,S=e.onFocus,x=e.readOnly,T=e.required,I=e.tabIndex,k=e.type,O=e.value,P=(0,o.Z)(e,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),N=(0,l.Z)({controlled:c,default:Boolean(m),name:"SwitchBase",state:"checked"}),A=(0,i.Z)(N,2),D=A[0],R=A[1],M=(0,u.Z)(),L=g;M&&void 0===L&&(L=M.disabled);var j="checkbox"===k||"radio"===k;return a.createElement(d.Z,(0,r.Z)({component:"span",className:(0,s.default)(f.root,p,D&&f.checked,L&&f.disabled),disabled:L,tabIndex:null,role:void 0,onFocus:function(e){S&&S(e),M&&M.onFocus&&M.onFocus(e)},onBlur:function(e){_&&_(e),M&&M.onBlur&&M.onBlur(e)},ref:t},P),a.createElement("input",(0,r.Z)({autoFocus:n,checked:c,defaultChecked:m,className:f.input,disabled:L,id:j&&y,name:E,onChange:function(e){var t=e.target.checked;R(t),C&&C(e,t)},readOnly:x,ref:w,required:T,tabIndex:I,type:k,value:O},b)),D?h:v)}));const f=(0,c.Z)({root:{padding:9},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}},{name:"PrivateSwitchBase"})(h)},9693:(e,t,n)=>{"use strict";function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function i(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length/3,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb(".concat(n.map((function(e){return parseInt(e,16)})).join(", "),")"):""}function o(e){if(0===e.indexOf("#"))return e;var t=s(e).values;return"#".concat(t.map((function(e){return 1===(t=e.toString(16)).length?"0".concat(t):t;var t})).join(""))}function a(e){var t=(e=s(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-o*Math.max(Math.min(t-3,9-t,1),-1)},u="rgb",c=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(u+="a",c.push(t[3])),l({type:u,values:c})}function s(e){if(e.type)return e;if("#"===e.charAt(0))return s(i(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(["Material-UI: unsupported `".concat(e,"` color."),"We support the following formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()."].join("\n"));var r=e.substring(t+1,e.length-1).split(",");return{type:n,values:r=r.map((function(e){return parseFloat(e)}))}}function l(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function u(e,t){var n=c(e),r=c(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function c(e){var t="hsl"===(e=s(e)).type?s(a(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return c(e)>.5?f(e,t):p(e,t)}function h(e,t){return e=s(e),t=r(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,l(e)}function f(e,t){if(e=s(e),t=r(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return l(e)}function p(e,t){if(e=s(e),t=r(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return l(e)}n.d(t,{oo:()=>i,vq:()=>o,ve:()=>a,tB:()=>s,wy:()=>l,mi:()=>u,H3:()=>c,_4:()=>d,U1:()=>h,_j:()=>f,$n:()=>p})},8129:(e,t,n)=>{"use strict";n.d(t,{Z:()=>q});var r=n(1253),i=n(5953),o=n(2122),a=["xs","sm","md","lg","xl"];function s(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,i=e.unit,s=void 0===i?"px":i,l=e.step,u=void 0===l?5:l,c=(0,r.Z)(e,["values","unit","step"]);function d(e){var t="number"==typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(s,")")}function h(e,t){var r=a.indexOf(t);return r===a.length-1?d(e):"@media (min-width:".concat("number"==typeof n[e]?n[e]:e).concat(s,") and ")+"(max-width:".concat((-1!==r&&"number"==typeof n[a[r+1]]?n[a[r+1]]:t)-u/100).concat(s,")")}return(0,o.Z)({keys:a,values:n,up:d,down:function(e){var t=a.indexOf(e)+1,r=n[a[t]];return t===a.length?d("xs"):"@media (max-width:".concat(("number"==typeof r&&t>0?r:e)-u/100).concat(s,")")},between:h,only:function(e){return h(e,e)},width:function(e){return n[e]}},c)}var l=n(6156);function u(e,t,n){var r;return(0,o.Z)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.Z)({paddingLeft:t(2),paddingRight:t(2)},n,(0,l.Z)({},e.up("sm"),(0,o.Z)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(r={minHeight:56},(0,l.Z)(r,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),(0,l.Z)(r,e.up("sm"),{minHeight:64}),r)},n)}const c={black:"#000",white:"#fff"},d={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},h="#7986cb",f="#3f51b5",p="#303f9f",m="#ff4081",g="#f50057",v="#c51162",y="#e57373",b="#f44336",w="#d32f2f",E="#ffb74d",_="#ff9800",C="#f57c00",S="#64b5f6",x="#2196f3",T="#1976d2",I="#81c784",k="#4caf50",O="#388e3c";var P=n(9693),N={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:c.white,default:d[50]},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}},A={text:{primary:c.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:d[800],default:"#303030"},action:{active:c.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 D(e,t,n,r){e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,P.$n)(e.main,r):"dark"===t&&(e.dark=(0,P._j)(e.main,1.5*r)))}function R(e){var t=e.primary,n=void 0===t?{light:h,main:f,dark:p}:t,a=e.secondary,s=void 0===a?{light:m,main:g,dark:v}:a,l=e.error,u=void 0===l?{light:y,main:b,dark:w}:l,R=e.warning,M=void 0===R?{light:E,main:_,dark:C}:R,L=e.info,j=void 0===L?{light:S,main:x,dark:T}:L,F=e.success,W=void 0===F?{light:I,main:k,dark:O}:F,B=e.type,z=void 0===B?"light":B,U=e.contrastThreshold,V=void 0===U?3:U,Z=e.tonalOffset,$=void 0===Z?.2:Z,q=(0,r.Z)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function H(e){return(0,P.mi)(e,A.text.primary)>=V?A.text.primary:N.text.primary}var K=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=(0,o.Z)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(["Material-UI: the color provided to augmentColor(color) is invalid.","The color object needs to have a `main` property or a `".concat(t,"` property.")].join("\n"));if("string"!=typeof e.main)throw new Error(["Material-UI: the color provided to augmentColor(color) is invalid.","`color.main` should be a string, but `".concat(JSON.stringify(e.main),"` was provided instead."),"","Did you intend to use one of the following approaches?","",'import { green } from "@material-ui/core/colors";',"","const theme1 = createMuiTheme({ palette: {"," primary: green,","} });","","const theme2 = createMuiTheme({ palette: {"," primary: { main: green[500] },","} });"].join("\n"));return D(e,"light",n,$),D(e,"dark",r,$),e.contrastText||(e.contrastText=H(e.main)),e},G={dark:A,light:N};return(0,i.Z)((0,o.Z)({common:c,type:z,primary:K(n),secondary:K(s,"A400","A200","A700"),error:K(u),warning:K(M),info:K(j),success:K(W),grey:d,contrastThreshold:V,getContrastText:H,augmentColor:K,tonalOffset:$},G[z]),q)}function M(e){return Math.round(1e5*e)/1e5}var L={textTransform:"uppercase"},j='"Roboto", "Helvetica", "Arial", sans-serif';function F(e,t){var n="function"==typeof t?t(e):t,a=n.fontFamily,s=void 0===a?j:a,l=n.fontSize,u=void 0===l?14:l,c=n.fontWeightLight,d=void 0===c?300:c,h=n.fontWeightRegular,f=void 0===h?400:h,p=n.fontWeightMedium,m=void 0===p?500:p,g=n.fontWeightBold,v=void 0===g?700:g,y=n.htmlFontSize,b=void 0===y?16:y,w=n.allVariants,E=n.pxToRem,_=(0,r.Z)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]),C=u/14,S=E||function(e){return"".concat(e/b*C,"rem")},x=function(e,t,n,r,i){return(0,o.Z)({fontFamily:s,fontWeight:e,fontSize:S(t),lineHeight:n},s===j?{letterSpacing:"".concat(M(r/t),"em")}:{},{},i,{},w)},T={h1:x(d,96,1.167,-1.5),h2:x(d,60,1.2,-.5),h3:x(f,48,1.167,0),h4:x(f,34,1.235,.25),h5:x(f,24,1.334,0),h6:x(m,20,1.6,.15),subtitle1:x(f,16,1.75,.15),subtitle2:x(m,14,1.57,.1),body1:x(f,16,1.5,.15),body2:x(f,14,1.43,.15),button:x(m,14,1.75,.4,L),caption:x(f,12,1.66,.4),overline:x(f,12,2.66,1,L)};return(0,i.Z)((0,o.Z)({htmlFontSize:b,pxToRem:S,round:M,fontFamily:s,fontSize:u,fontWeightLight:d,fontWeightRegular:f,fontWeightMedium:m,fontWeightBold:v},T),_,{clone:!1})}function W(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}const B=["none",W(0,2,1,-1,0,1,1,0,0,1,3,0),W(0,3,1,-2,0,2,2,0,0,1,5,0),W(0,3,3,-2,0,3,4,0,0,1,8,0),W(0,2,4,-1,0,4,5,0,0,1,10,0),W(0,3,5,-1,0,5,8,0,0,1,14,0),W(0,3,5,-1,0,6,10,0,0,1,18,0),W(0,4,5,-2,0,7,10,1,0,2,16,1),W(0,5,5,-3,0,8,10,1,0,3,14,2),W(0,5,6,-3,0,9,12,1,0,3,16,2),W(0,6,6,-3,0,10,14,1,0,4,18,3),W(0,6,7,-4,0,11,15,1,0,4,20,3),W(0,7,8,-4,0,12,17,2,0,5,22,4),W(0,7,8,-4,0,13,19,2,0,5,24,4),W(0,7,9,-4,0,14,21,2,0,5,26,4),W(0,8,9,-5,0,15,22,2,0,6,28,5),W(0,8,10,-5,0,16,24,2,0,6,30,5),W(0,8,11,-5,0,17,26,2,0,6,32,5),W(0,9,11,-5,0,18,28,2,0,7,34,6),W(0,9,12,-6,0,19,29,2,0,7,36,6),W(0,10,13,-6,0,20,31,3,0,8,38,7),W(0,10,13,-6,0,21,33,3,0,8,40,7),W(0,10,14,-6,0,22,35,3,0,8,42,7),W(0,11,14,-7,0,23,36,3,0,9,44,8),W(0,11,15,-7,0,24,38,3,0,9,46,8)],z={borderRadius:4};var U=n(8681);function V(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=(0,U.h)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,o=e.mixins,a=void 0===o?{}:o,l=e.palette,c=void 0===l?{}:l,d=e.spacing,h=e.typography,f=void 0===h?{}:h,p=(0,r.Z)(e,["breakpoints","mixins","palette","spacing","typography"]),m=R(c),g=s(n),v=V(d),y=(0,i.Z)({breakpoints:g,direction:"ltr",mixins:u(g,v,a),overrides:{},palette:m,props:{},shadows:B,typography:F(m,f),spacing:v,shape:z,transitions:Z.ZP,zIndex:$.Z},p),b=arguments.length,w=new Array(b>1?b-1:0),E=1;E{"use strict";n.d(t,{Z:()=>r});const r=(0,n(8129).Z)()},5828:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MuiThemeProvider:()=>j,ServerStyleSheets:()=>R,StylesProvider:()=>A.ZP,ThemeProvider:()=>j,createGenerateClassName:()=>D.Z,createMuiTheme:()=>i.Z,createStyles:()=>o,darken:()=>r._j,decomposeColor:()=>r.tB,duration:()=>b.x9,easing:()=>b.Ui,emphasize:()=>r._4,fade:()=>r.U1,getContrastRatio:()=>r.mi,getLuminance:()=>r.H3,hexToRgb:()=>r.oo,hslToRgb:()=>r.ve,jssPreset:()=>F.Z,lighten:()=>r.$n,makeStyles:()=>u,recomposeColor:()=>r.wy,responsiveFontSizes:()=>v,rgbToHex:()=>r.vq,styled:()=>y.Z,useTheme:()=>w.Z,withStyles:()=>E.Z,withTheme:()=>k});var r=n(9693),i=n(8129);function o(e){return e}var a=n(2122),s=n(3914),l=n(9700);const u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,s.Z)(e,(0,a.Z)({defaultTheme:l.Z},t))};var c=n(6156);function d(e){return String(parseFloat(e)).length===String(e).length}function h(e){return parseFloat(e)}function f(e){return function(t,n){var r=String(t).match(/[\d.\-+]*\s*(.*)/)[1]||"";if(r===n)return t;var i=h(t);if("px"!==r)if("em"===r)i=h(t)*h(e);else if("rem"===r)return i=h(t)*h(e),t;var o=i;if("px"!==n)if("em"===n)o=i/h(e);else{if("rem"!==n)return t;o=i/h(e)}return parseFloat(o.toFixed(5))+n}}function p(e){var t=e.size,n=e.grid,r=t-t%n,i=r+n;return t-r1&&void 0!==arguments[1]?arguments[1]:{},n=t.breakpoints,r=void 0===n?["sm","md","lg"]:n,i=t.disableAlign,o=void 0!==i&&i,s=t.factor,l=void 0===s?2:s,u=t.variants,c=void 0===u?["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","caption","button","overline"]:u,h=(0,a.Z)({},e);h.typography=(0,a.Z)({},h.typography);var v=h.typography,y=f(v.htmlFontSize),b=r.map((function(e){return h.breakpoints.values[e]}));return c.forEach((function(e){var t=v[e],n=parseFloat(y(t.fontSize,"rem"));if(!(n<=1)){var r=n,i=1+(r-1)/l,s=t.lineHeight;if(!d(s)&&!o)throw new Error(["Material-UI: unsupported non-unitless line height with grid alignment.","Use unitless line heights instead."].join("\n"));d(s)||(s=parseFloat(y(s,"rem"))/parseFloat(n));var u=null;o||(u=function(e){return p({size:e,grid:m({pixels:4,lineHeight:s,htmlFontSize:v.htmlFontSize})})}),v[e]=(0,a.Z)({},t,{},g({cssProperty:"fontSize",min:i,max:r,unit:"rem",breakpoints:b,transform:u}))}})),h}var y=n(1911),b=n(3366),w=n(8920),E=n(4670),_=n(1253),C=n(7294),S=(n(5697),n(8679)),x=n.n(S),T=n(159);function I(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.defaultTheme,n=function(e){var n=C.forwardRef((function(n,r){var i=n.innerRef,o=(0,_.Z)(n,["innerRef"]),s=(0,T.Z)()||t;return C.createElement(e,(0,a.Z)({theme:s,ref:i||r},o))}));return x()(n,e),n};return n}I();const k=I({defaultTheme:l.Z});var O=n(6610),P=n(5991),N=n(4013),A=n(6975),D=n(5034),R=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,O.Z)(this,e),this.options=t}return(0,P.Z)(e,[{key:"collect",value:function(e){var t=new Map;this.sheetsRegistry=new N.xE;var n=(0,D.Z)();return C.createElement(A.ZP,(0,a.Z)({sheetsManager:t,serverGenerateClassName:n,sheetsRegistry:this.sheetsRegistry},this.options),e)}},{key:"toString",value:function(){return this.sheetsRegistry?this.sheetsRegistry.toString():""}},{key:"getStyleElement",value:function(e){return C.createElement("style",(0,a.Z)({id:"jss-server-side",key:"jss-server-side",dangerouslySetInnerHTML:{__html:this.toString()}},e))}}]),e}(),M=n(3800),L=n(7076);const j=function(e){var t=e.children,n=e.theme,r=(0,T.Z)(),i=C.useMemo((function(){var e=null===r?n:function(e,t){return"function"==typeof t?t(e):(0,a.Z)({},e,{},t)}(r,n);return null!=e&&(e[L.Z]=null!==r),e}),[n,r]);return C.createElement(M.Z.Provider,{value:i},t)};var F=n(246)},1911:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(2122),i=n(1253),o=n(7294),a=n(6010),s=(n(5697),n(8679)),l=n.n(s),u=n(3914);function c(e,t){var n={};return Object.keys(e).forEach((function(r){-1===t.indexOf(r)&&(n[r]=e[r])})),n}var d=n(9700);const h=function(e){var t=function(e){return function(t){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=s.name,h=(0,i.Z)(s,["name"]),f=d,p="function"==typeof t?function(e){return{root:function(n){return t((0,r.Z)({theme:e},n))}}}:{root:t},m=(0,u.Z)(p,(0,r.Z)({Component:e,name:d||e.displayName,classNamePrefix:f},h));t.filterProps&&(n=t.filterProps,delete t.filterProps),t.propTypes&&(t.propTypes,delete t.propTypes);var g=o.forwardRef((function(t,s){var l=t.children,u=t.className,d=t.clone,h=t.component,f=(0,i.Z)(t,["children","className","clone","component"]),p=m(t),g=(0,a.default)(p.root,u),v=f;if(n&&(v=c(v,n)),d)return o.cloneElement(l,(0,r.Z)({className:(0,a.default)(l.props.className,g)},v));if("function"==typeof l)return l((0,r.Z)({className:g},v));var y=h||e;return o.createElement(y,(0,r.Z)({ref:s,className:g},v),l)}));return l()(g,e),g}}(e);return function(e,n){return t(e,(0,r.Z)({defaultTheme:d.Z},n))}}},3366:(e,t,n)=>{"use strict";n.d(t,{Ui:()=>i,x9:()=>o,ZP:()=>s});var r=n(1253),i={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 a(e){return"".concat(Math.round(e),"ms")}const s={easing:i,duration:o,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,s=void 0===n?o.standard:n,l=t.easing,u=void 0===l?i.easeInOut:l,c=t.delay,d=void 0===c?0:c;return(0,r.Z)(t,["duration","easing","delay"]),(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"==typeof s?s:a(s)," ").concat(u," ").concat("string"==typeof d?d:a(d))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}}},8920:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(159),i=(n(7294),n(9700));function o(){return(0,r.Z)()||i.Z}},4670:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(2122),i=n(1253),o=n(7294),a=(n(5697),n(8679)),s=n.n(a),l=n(3914),u=n(3869),c=n(159);var d=n(9700);const h=function(e,t){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var a=t.defaultTheme,d=t.withTheme,h=void 0!==d&&d,f=t.name,p=(0,i.Z)(t,["defaultTheme","withTheme","name"]),m=f,g=(0,l.Z)(e,(0,r.Z)({defaultTheme:a,Component:n,name:f||n.displayName,classNamePrefix:m},p)),v=o.forwardRef((function(e,t){e.classes;var s,l=e.innerRef,d=(0,i.Z)(e,["classes","innerRef"]),p=g((0,r.Z)({},n.defaultProps,{},e)),m=d;return("string"==typeof f||h)&&(s=(0,c.Z)()||a,f&&(m=(0,u.Z)({theme:s,name:f,props:d})),h&&!m.theme&&(m.theme=s)),o.createElement(n,(0,r.Z)({ref:l||t,classes:p},m))}));return s()(v,n),v}}(e,(0,r.Z)({defaultTheme:d.Z},t))}},2781:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500}},5653:(e,t,n)=>{"use strict";n.d(t,{n:()=>r,C:()=>i});var r=function(e){return e.scrollTop};function i(e,t){var n=e.timeout,r=e.style,i=void 0===r?{}:r;return{duration:i.transitionDuration||"number"==typeof n?n:n[t.mode]||0,delay:i.transitionDelay}}},3871:(e,t,n)=>{"use strict";function r(e){return e.charAt(0).toUpperCase()+e.slice(1)}n.d(t,{Z:()=>r})},2568:(e,t,n)=>{"use strict";function r(){for(var e=arguments.length,t=new Array(e),n=0;nr})},3786:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(2122),i=n(7294),o=n(2087);function a(e,t){var n=i.memo(i.forwardRef((function(t,n){return i.createElement(o.Z,(0,r.Z)({ref:n},t),e)})));return n.muiName=o.Z.muiName,n}},9437:(e,t,n)=>{"use strict";function r(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,i=new Array(r),o=0;or})},5840:(e,t,n)=>{"use strict";function r(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}n.d(t,{Z:()=>r})},3711:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(7294);function i(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}},626:(e,t,n)=>{"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,{Z:()=>r})},713:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(626);function i(e){return(0,r.Z)(e).defaultView||window}},4236:(e,t,n)=>{"use strict";function r(e,t){"function"==typeof e?e(t):e&&(e.current=t)}n.d(t,{Z:()=>r})},5001:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(7294);function i(e){var t=r.useState(e),n=t[0],i=t[1],o=e||n;return r.useEffect((function(){null==n&&i("mui-".concat(Math.round(1e5*Math.random())))}),[n]),o}},2775:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(7294);function i(e){var t=e.controlled,n=e.default,i=(e.name,e.state,r.useRef(void 0!==t).current),o=r.useState(n),a=o[0],s=o[1];return[i?t:a,r.useCallback((function(e){i||s(e)}),[])]}},5192:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),i="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;function o(e){var t=r.useRef(e);return i((function(){t.current=e})),r.useCallback((function(){return t.current.apply(void 0,arguments)}),[])}},3834:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),i=n(4236);function o(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){(0,i.Z)(e,n),(0,i.Z)(t,n)}}),[e,t])}},4896:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(7294),i=n(3935),o=!0,a=!1,s=null,l={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function u(e){e.metaKey||e.altKey||e.ctrlKey||(o=!0)}function c(){o=!1}function d(){"hidden"===this.visibilityState&&a&&(o=!0)}function h(e){var t,n,r,i=e.target;try{return i.matches(":focus-visible")}catch(e){}return o||(n=(t=i).type,!("INPUT"!==(r=t.tagName)||!l[n]||t.readOnly)||"TEXTAREA"===r&&!t.readOnly||!!t.isContentEditable)}function f(){a=!0,window.clearTimeout(s),s=window.setTimeout((function(){a=!1}),100)}function p(){return{isFocusVisible:h,onBlurVisible:f,ref:r.useCallback((function(e){var t,n=i.findDOMNode(e);null!=n&&((t=n.ownerDocument).addEventListener("keydown",u,!0),t.addEventListener("mousedown",c,!0),t.addEventListener("pointerdown",c,!0),t.addEventListener("touchstart",c,!0),t.addEventListener("visibilitychange",d,!0))}),[])}}},2067:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"}),"AccountCircle");t.default=o},3957:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");t.default=o},1673:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");t.default=o},9594:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward");t.default=o},9875:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");t.default=o},6735:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");t.default=o},366:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");t.default=o},2215:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"}),"Cloud");t.default=o},8428:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");t.default=o},9067:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 00-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Edit");t.default=o},2972:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"ExitToApp");t.default=o},5025:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");t.default=o},4566:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");t.default=o},5612:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M3 13h2v-2H3v2zm0 4h2v-2H3v2zm2 4v-2H3c0 1.1.89 2 2 2zM3 9h2V7H3v2zm12 12h2v-2h-2v2zm4-18H9c-1.11 0-2 .9-2 2v10c0 1.1.89 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 12H9V5h10v10zm-8 6h2v-2h-2v2zm-4 0h2v-2H7v2z"}),"FlipToFront");t.default=o},4545:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z"}),"ImportExport");t.default=o},5432:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"InfoOutlined");t.default=o},7133:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"Launch");t.default=o},2865:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"}),"Mail");t.default=o},2466:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"}),"MailOutline");t.default=o},8884:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");t.default=o},9579:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M6 19h12v2H6z"}),"Minimize");t.default=o},64:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M19 13H5v-2h14v2z"}),"Remove");t.default=o},3246:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"}),"Restore");t.default=o},3375:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"}),"Save");t.default=o},8995:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"Search");t.default=o},9969:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{transform:"scale(1.2, 1.2)",d:"M15.95 10.78c.03-.25.05-.51.05-.78s-.02-.53-.06-.78l1.69-1.32c.15-.12.19-.34.1-.51l-1.6-2.77c-.1-.18-.31-.24-.49-.18l-1.99.8c-.42-.32-.86-.58-1.35-.78L12 2.34c-.03-.2-.2-.34-.4-.34H8.4c-.2 0-.36.14-.39.34l-.3 2.12c-.49.2-.94.47-1.35.78l-1.99-.8c-.18-.07-.39 0-.49.18l-1.6 2.77c-.1.18-.06.39.1.51l1.69 1.32c-.04.25-.07.52-.07.78s.02.53.06.78L2.37 12.1c-.15.12-.19.34-.1.51l1.6 2.77c.1.18.31.24.49.18l1.99-.8c.42.32.86.58 1.35.78l.3 2.12c.04.2.2.34.4.34h3.2c.2 0 .37-.14.39-.34l.3-2.12c.49-.2.94-.47 1.35-.78l1.99.8c.18.07.39 0 .49-.18l1.6-2.77c.1-.18.06-.39-.1-.51l-1.67-1.32zM10 13c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z"}),"Settings");t.default=o},3093:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7294)),o=(0,r(n(2108)).default)(i.default.createElement("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z"}),"Share");t.default=o},2108:(e,t,n)=>{"use strict";var r=n(5318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=o.default.memo(o.default.forwardRef((function(t,n){return o.default.createElement(a.default,(0,i.default)({ref:n},t),e)})));return n.muiName=a.default.muiName,n};var i=r(n(7154)),o=r(n(7294)),a=r(n(2015))},4709:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>E});var r=n(1253),i=n(2122),o=n(7294),a=(n(5697),n(6010)),s=n(9693),l=n(4670),u=n(9895),c=n(3786);const d=(0,c.Z)(o.createElement("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),h=(0,c.Z)(o.createElement("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),f=(0,c.Z)(o.createElement("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),p=(0,c.Z)(o.createElement("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined");var m=n(7694),g=n(7812),v=n(3871),y={success:o.createElement(d,{fontSize:"inherit"}),warning:o.createElement(h,{fontSize:"inherit"}),error:o.createElement(f,{fontSize:"inherit"}),info:o.createElement(p,{fontSize:"inherit"})},b=o.createElement(m.Z,{fontSize:"small"}),w=o.forwardRef((function(e,t){var n=e.action,s=e.children,l=e.classes,c=e.className,d=e.closeText,h=void 0===d?"Close":d,f=e.color,p=e.icon,m=e.iconMapping,w=void 0===m?y:m,E=e.onClose,_=e.role,C=void 0===_?"alert":_,S=e.severity,x=void 0===S?"success":S,T=e.variant,I=void 0===T?"standard":T,k=(0,r.Z)(e,["action","children","classes","className","closeText","color","icon","iconMapping","onClose","role","severity","variant"]);return o.createElement(u.Z,(0,i.Z)({role:C,square:!0,elevation:0,className:(0,a.default)(l.root,l["".concat(I).concat((0,v.Z)(f||x))],c),ref:t},k),!1!==p?o.createElement("div",{className:l.icon},p||w[x]||y[x]):null,o.createElement("div",{className:l.message},s),null!=n?o.createElement("div",{className:l.action},n):null,null==n&&E?o.createElement("div",{className:l.action},o.createElement(g.Z,{size:"small","aria-label":h,title:h,color:"inherit",onClick:E},b)):null)}));const E=(0,l.Z)((function(e){var t="light"===e.palette.type?s._j:s.$n,n="light"===e.palette.type?s.$n:s._j;return{root:(0,i.Z)({},e.typography.body2,{borderRadius:e.shape.borderRadius,backgroundColor:"transparent",display:"flex",padding:"6px 16px"}),standardSuccess:{color:t(e.palette.success.main,.6),backgroundColor:n(e.palette.success.main,.9),"& $icon":{color:e.palette.success.main}},standardInfo:{color:t(e.palette.info.main,.6),backgroundColor:n(e.palette.info.main,.9),"& $icon":{color:e.palette.info.main}},standardWarning:{color:t(e.palette.warning.main,.6),backgroundColor:n(e.palette.warning.main,.9),"& $icon":{color:e.palette.warning.main}},standardError:{color:t(e.palette.error.main,.6),backgroundColor:n(e.palette.error.main,.9),"& $icon":{color:e.palette.error.main}},outlinedSuccess:{color:t(e.palette.success.main,.6),border:"1px solid ".concat(e.palette.success.main),"& $icon":{color:e.palette.success.main}},outlinedInfo:{color:t(e.palette.info.main,.6),border:"1px solid ".concat(e.palette.info.main),"& $icon":{color:e.palette.info.main}},outlinedWarning:{color:t(e.palette.warning.main,.6),border:"1px solid ".concat(e.palette.warning.main),"& $icon":{color:e.palette.warning.main}},outlinedError:{color:t(e.palette.error.main,.6),border:"1px solid ".concat(e.palette.error.main),"& $icon":{color:e.palette.error.main}},filledSuccess:{color:"#fff",fontWeight:e.typography.fontWeightMedium,backgroundColor:e.palette.success.main},filledInfo:{color:"#fff",fontWeight:e.typography.fontWeightMedium,backgroundColor:e.palette.info.main},filledWarning:{color:"#fff",fontWeight:e.typography.fontWeightMedium,backgroundColor:e.palette.warning.main},filledError:{color:"#fff",fontWeight:e.typography.fontWeightMedium,backgroundColor:e.palette.error.main},icon:{marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9},message:{padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}}}),{name:"MuiAlert"})(w)},3592:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createFilterOptions:()=>S,default:()=>N});var r=n(1253),i=n(6156),o=n(2122),a=n(7294),s=(n(5697),n(6010)),l=n(4670),u=n(6617),c=n(3871),d=a.forwardRef((function(e,t){var n=e.classes,i=e.className,l=e.color,u=void 0===l?"default":l,d=e.component,h=void 0===d?"li":d,f=e.disableGutters,p=void 0!==f&&f,m=e.disableSticky,g=void 0!==m&&m,v=e.inset,y=void 0!==v&&v,b=(0,r.Z)(e,["classes","className","color","component","disableGutters","disableSticky","inset"]);return a.createElement(h,(0,o.Z)({className:(0,s.default)(n.root,i,"default"!==u&&n["color".concat((0,c.Z)(u))],y&&n.inset,!g&&n.sticky,!p&&n.gutters),ref:t},b))}));const h=(0,l.Z)((function(e){return{root:{boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:e.palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14)},colorPrimary:{color:e.palette.primary.main},colorInherit:{color:"inherit"},gutters:{paddingLeft:16,paddingRight:16},inset:{paddingLeft:72},sticky:{position:"sticky",top:0,zIndex:1,backgroundColor:"inherit"}}}),{name:"MuiListSubheader"})(d);var f=n(9895),p=n(7812),m=n(1267),g=n(7694);const v=(0,n(3786).Z)(a.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");var y=n(8481),b=n(5001),w=n(2775),E=n(5192),_=n(4236);function C(e){return void 0!==e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function S(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ignoreAccents,n=void 0===t||t,r=e.ignoreCase,i=void 0===r||r,o=e.limit,a=e.matchFrom,s=void 0===a?"any":a,l=e.stringify,u=e.trim,c=void 0!==u&&u;return function(e,t){var r=t.inputValue,a=t.getOptionLabel,u=c?r.trim():r;i&&(u=u.toLowerCase()),n&&(u=C(u));var d=e.filter((function(e){var t=(l||a)(e);return i&&(t=t.toLowerCase()),n&&(t=C(t)),"start"===s?0===t.indexOf(u):t.indexOf(u)>-1}));return"number"==typeof o?d.slice(0,o):d}}function x(e,t){for(var n=0;nPe.length-1&&(xe(-1),He(-1))}),[Pe,te,Se,He]);var Ke=(0,E.Z)((function(e){var t=e.event,n=e.index,r=e.reason,i=void 0===r?"auto":r;if(Ie.current=n,-1===n?ye.current.removeAttribute("aria-activedescendant"):ye.current.setAttribute("aria-activedescendant","".concat(pe,"-option-").concat(n)),ie&&ie(t,-1===n?null:qe[n],i),be.current){var o=be.current.querySelector("[data-focus]");o&&o.removeAttribute("data-focus");var a=be.current.parentElement.querySelector('[role="listbox"]');if(a)if(-1!==n){var s=be.current.querySelector('[data-option-index="'.concat(n,'"]'));if(s&&(s.setAttribute("data-focus","true"),a.scrollHeight>a.clientHeight&&"mouse"!==i)){var l=s,u=a.clientHeight+a.scrollTop,c=l.offsetTop+l.offsetHeight;c>u?a.scrollTop=c-a.clientHeight:l.offsetTop-l.offsetHeight*(H?1.3:0)1?0:e:t>e?t===e+1&&X?-1:M||Math.abs(r)>1?e:0:t}(),o);if(Ke({index:l,reason:s,event:t}),n&&"reset"!==r)if(-1===l)ye.current.value=Re;else{var u=me(qe[l]);ye.current.value=u,0===u.toLowerCase().indexOf(Re.toLowerCase())&&Re.length>0&&ye.current.setSelectionRange(Re.length,u.length)}}})),Qe=a.useCallback((function(){if($e){var e=te?Pe[0]:Pe;if(0!==qe.length&&null!=e){if(be.current)if(W||null==e)Ie.current>=qe.length-1?Ke({index:qe.length-1}):Ke({index:Ie.current});else{var t=qe[Ie.current];if(te&&t&&-1!==x(Pe,(function(e){return q(t,e)})))return;var n=x(qe,(function(t){return q(t,e)}));-1===n?Ge({diff:"reset"}):Ke({index:n})}}else Ge({diff:"reset"})}}),[0===qe.length,!te&&Pe,W,Ge,Ke,$e,Re,te]),Ye=(0,E.Z)((function(e){(0,_.Z)(be,e),e&&Qe()}));a.useEffect((function(){Qe()}),[Qe]);var Xe=function(e){Ue||(Ve(!0),ae&&ae(e))},Je=function(e,t){Ue&&(Ve(!1),re&&re(e,t))},et=function(e,t,n,r){Pe!==t&&(ne&&ne(e,t,n,r),Ne(t))},tt=a.useRef(!1),nt=function(e,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"options",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"select-option",i=t;if(te){var o=x(i=Array.isArray(Pe)?Pe.slice():[],(function(e){return q(t,e)}));-1===o?i.push(t):"freeSolo"!==n&&(i.splice(o,1),r="remove-option")}We(e,i),et(e,i,r,{option:t}),N||Je(e,r),(!0===c||"touch"===c&&tt.current||"mouse"===c&&!tt.current)&&ye.current.blur()},rt=function(e,t){if(te){Je(e,"toggleInput");var n=Se;-1===Se?""===Re&&"previous"===t&&(n=Pe.length-1):((n+="next"===t?1:-1)<0&&(n=0),n===Pe.length&&(n=-1)),n=function(e,t){if(-1===e)return-1;for(var n=e;;){if("next"===t&&n===Pe.length||"previous"===t&&-1===n)return-1;var r=Ee.querySelector('[data-tag-index="'.concat(n,'"]'));if(!r||r.hasAttribute("tabindex")&&!r.disabled&&"true"!==r.getAttribute("aria-disabled"))return n;n+="next"===t?1:-1}}(n,t),xe(n),He(n)}},it=function(e){ge.current=!0,Me(""),oe&&oe(e,"","clear"),et(e,te?[]:null,"clear")},ot=function(e){return function(t){switch(-1!==Se&&-1===["ArrowLeft","ArrowRight"].indexOf(t.key)&&(xe(-1),He(-1)),t.key){case"Home":$e&&G&&(t.preventDefault(),Ge({diff:"start",direction:"next",reason:"keyboard",event:t}));break;case"End":$e&&G&&(t.preventDefault(),Ge({diff:"end",direction:"previous",reason:"keyboard",event:t}));break;case"PageUp":t.preventDefault(),Ge({diff:-5,direction:"previous",reason:"keyboard",event:t}),Xe(t);break;case"PageDown":t.preventDefault(),Ge({diff:5,direction:"next",reason:"keyboard",event:t}),Xe(t);break;case"ArrowDown":t.preventDefault(),Ge({diff:1,direction:"next",reason:"keyboard",event:t}),Xe(t);break;case"ArrowUp":t.preventDefault(),Ge({diff:-1,direction:"previous",reason:"keyboard",event:t}),Xe(t);break;case"ArrowLeft":rt(t,"previous");break;case"ArrowRight":rt(t,"next");break;case"Enter":if(229===t.which)break;if(-1!==Ie.current&&$e){var r=qe[Ie.current],i=!!U&&U(r);if(t.preventDefault(),i)return;nt(t,r,"select-option"),n&&ye.current.setSelectionRange(ye.current.value.length,ye.current.value.length)}else z&&""!==Re&&!1===Ze&&(te&&t.preventDefault(),nt(t,Re,"create-option","freeSolo"));break;case"Escape":$e?(t.preventDefault(),t.stopPropagation(),Je(t,"escape")):p&&(""!==Re||te&&Pe.length>0)&&(t.preventDefault(),t.stopPropagation(),it(t));break;case"Backspace":if(te&&""===Re&&Pe.length>0){var o=-1===Se?Pe.length-1:Se,a=Pe.slice();a.splice(o,1),et(t,a,"remove-option",{option:Pe[o]})}}e.onKeyDown&&e.onKeyDown(t)}},at=function(e){Fe(!0),ue&&!ge.current&&Xe(e)},st=function(e){null===be.current||document.activeElement!==be.current.parentElement?(Fe(!1),ve.current=!0,ge.current=!1,C&&""!==Re||(l&&-1!==Ie.current&&$e?nt(e,qe[Ie.current],"blur"):l&&z&&""!==Re?nt(e,Re,"blur","freeSolo"):h&&We(e,Pe),Je(e,"blur"))):ye.current.focus()},lt=function(e){var t=e.target.value;Re!==t&&(Me(t),oe&&oe(e,t,"input")),""===t?O||te||et(e,null,"clear"):Xe(e)},ut=function(e){Ke({event:e,index:Number(e.currentTarget.getAttribute("data-option-index")),reason:"mouse"})},ct=function(){tt.current=!0},dt=function(e){var t=Number(e.currentTarget.getAttribute("data-option-index"));nt(e,qe[t],"select-option"),tt.current=!1},ht=function(e){return function(t){var n=Pe.slice();n.splice(e,1),et(t,n,"remove-option",{option:Pe[e]})}},ft=function(e){Ue?Je(e,"toggleInput"):Xe(e)},pt=function(e){e.target.getAttribute("id")!==pe&&e.preventDefault()},mt=function(){ye.current.focus(),he&&ve.current&&ye.current.selectionEnd-ye.current.selectionStart==0&&ye.current.select(),ve.current=!1},gt=function(e){""!==Re&&Ue||ft(e)},vt=z&&Re.length>0;vt=vt||(te?Pe.length>0:null!==Pe);var yt=qe;return H&&(new Map,yt=qe.reduce((function(e,t,n){var r=H(t);return e.length>0&&e[e.length-1].group===r?e[e.length-1].options.push(t):e.push({key:n,index:n,group:r,options:[t]}),e}),[])),{getRootProps:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.Z)({"aria-owns":$e?"".concat(pe,"-popup"):null,role:"combobox","aria-expanded":$e},e,{onKeyDown:ot(e),onMouseDown:pt,onClick:mt})},getInputLabelProps:function(){return{id:"".concat(pe,"-label"),htmlFor:pe}},getInputProps:function(){return{id:pe,value:Re,onBlur:st,onFocus:at,onChange:lt,onMouseDown:gt,"aria-activedescendant":$e?"":null,"aria-autocomplete":n?"both":"list","aria-controls":$e?"".concat(pe,"-popup"):null,autoComplete:"off",ref:ye,autoCapitalize:"none",spellCheck:"false"}},getClearProps:function(){return{tabIndex:-1,onClick:it}},getPopupIndicatorProps:function(){return{tabIndex:-1,onClick:ft}},getTagProps:function(e){var t=e.index;return{key:t,"data-tag-index":t,tabIndex:-1,onDelete:ht(t)}},getListboxProps:function(){return{role:"listbox",id:"".concat(pe,"-popup"),"aria-labelledby":"".concat(pe,"-label"),ref:Ye,onMouseDown:function(e){e.preventDefault()}}},getOptionProps:function(e){var t=e.index,n=e.option,r=(te?Pe:[Pe]).some((function(e){return null!=e&&q(n,e)})),i=!!U&&U(n);return{key:t,tabIndex:-1,role:"option",id:"".concat(pe,"-option-").concat(t),onMouseOver:ut,onClick:dt,onTouchStart:ct,"data-option-index":t,"aria-disabled":i,"aria-selected":r}},id:pe,inputValue:Re,value:Pe,dirty:vt,popupOpen:$e,focused:je||-1!==Se,anchorEl:Ee,setAnchorEl:_e,focusedTag:Se,groupedOptions:yt}}((0,o.Z)({},e,{componentName:"Autocomplete"})),Se=Ce.getRootProps,xe=Ce.getInputProps,Te=Ce.getInputLabelProps,Ie=Ce.getPopupIndicatorProps,ke=Ce.getClearProps,Oe=Ce.getTagProps,Pe=Ce.getListboxProps,Ne=Ce.getOptionProps,Ae=Ce.value,De=Ce.dirty,Re=Ce.id,Me=Ce.popupOpen,Le=Ce.focused,je=Ce.focusedTag,Fe=Ce.anchorEl,We=Ce.setAnchorEl,Be=Ce.inputValue,ze=Ce.groupedOptions;if(ie&&Ae.length>0){var Ue=function(e){return(0,o.Z)({className:(0,s.default)(l.tag,"small"===we&&l.tagSizeSmall),disabled:R},Oe(e))};n=ye?ye(Ae,Ue):Ae.map((function(e,t){return a.createElement(m.Z,(0,o.Z)({label:q(e),size:we},Ue({index:t}),i))}))}if(G>-1&&Array.isArray(n)){var Ve=n.length-G;!Le&&Ve>0&&(n=n.splice(0,G)).push(a.createElement("span",{className:l.tag,key:n.length},Z(Ve)))}var Ze=me||function(e){return a.createElement("li",{key:e.key},a.createElement(h,{className:l.groupLabel,component:"div"},e.group),a.createElement("ul",{className:l.groupUl},e.children))},$e=ve||q,qe=function(e,t){var n=Ne({option:e,index:t});return a.createElement("li",(0,o.Z)({},n,{className:l.option}),$e(e,{selected:n["aria-selected"],inputValue:Be}))},He=!A&&!R,Ke=(!B||!0===F)&&!1!==F;return a.createElement(a.Fragment,null,a.createElement("div",(0,o.Z)({ref:t,className:(0,s.default)(l.root,c,Le&&l.focused,U&&l.fullWidth,He&&l.hasClearIcon,Ke&&l.hasPopupIcon)},Se(Ee)),ge({id:Re,disabled:R,fullWidth:!0,size:"small"===we?"small":void 0,InputLabelProps:Te(),InputProps:{ref:We,className:l.inputRoot,startAdornment:n,endAdornment:a.createElement("div",{className:l.endAdornment},He?a.createElement(p.Z,(0,o.Z)({},ke(),{"aria-label":g,title:g,className:(0,s.default)(l.clearIndicator,De&&l.clearIndicatorDirty)}),C):null,Ke?a.createElement(p.Z,(0,o.Z)({},Ie(),{disabled:R,"aria-label":Me?P:le,title:Me?P:le,className:(0,s.default)(l.popupIndicator,Me&&l.popupIndicatorOpen)}),pe):null)},inputProps:(0,o.Z)({className:(0,s.default)(l.input,-1===je&&l.inputFocused),disabled:R},xe())})),Me&&Fe?a.createElement(_e,{className:(0,s.default)(l.popper,L&&l.popperDisablePortal),style:{width:Fe?Fe.clientWidth:null},role:"presentation",anchorEl:Fe,open:!0},a.createElement(ce,{className:l.paper},ee&&0===ze.length?a.createElement("div",{className:l.loading},ne):null,0!==ze.length||B||ee?null:a.createElement("div",{className:l.noOptions},ae),ze.length>0?a.createElement(Y,(0,o.Z)({className:l.listbox},Pe(),X),ze.map((function(e,t){return H?Ze({key:e.key,group:e.group,children:e.options.map((function(t,n){return qe(t,e.index+n)}))}):qe(e,t)}))):null)):null)}));const N=(0,l.Z)((function(e){var t;return{root:{"&$focused $clearIndicatorDirty":{visibility:"visible"},"@media (pointer: fine)":{"&:hover $clearIndicatorDirty":{visibility:"visible"}}},fullWidth:{width:"100%"},focused:{},tag:{margin:3,maxWidth:"calc(100% - 6px)"},tagSizeSmall:{margin:2,maxWidth:"calc(100% - 4px)"},hasPopupIcon:{},hasClearIcon:{},inputRoot:{flexWrap:"wrap","$hasPopupIcon &, $hasClearIcon &":{paddingRight:30},"$hasPopupIcon$hasClearIcon &":{paddingRight:56},"& $input":{width:0,minWidth:30},'&[class*="MuiInput-root"]':{paddingBottom:1,"& $input":{padding:4},"& $input:first-child":{padding:"6px 0"}},'&[class*="MuiInput-root"][class*="MuiInput-marginDense"]':{"& $input":{padding:"4px 4px 5px"},"& $input:first-child":{padding:"3px 0 6px"}},'&[class*="MuiOutlinedInput-root"]':{padding:9,"$hasPopupIcon &, $hasClearIcon &":{paddingRight:39},"$hasPopupIcon$hasClearIcon &":{paddingRight:65},"& $input":{padding:"9.5px 4px"},"& $input:first-child":{paddingLeft:6},"& $endAdornment":{right:9}},'&[class*="MuiOutlinedInput-root"][class*="MuiOutlinedInput-marginDense"]':{padding:6,"& $input":{padding:"4.5px 4px"}},'&[class*="MuiFilledInput-root"]':{paddingTop:19,paddingLeft:8,"$hasPopupIcon &, $hasClearIcon &":{paddingRight:39},"$hasPopupIcon$hasClearIcon &":{paddingRight:65},"& $input":{padding:"9px 4px"},"& $endAdornment":{right:9}},'&[class*="MuiFilledInput-root"][class*="MuiFilledInput-marginDense"]':{paddingBottom:1,"& $input":{padding:"4.5px 4px"}}},input:{flexGrow:1,textOverflow:"ellipsis",opacity:0},inputFocused:{opacity:1},endAdornment:{position:"absolute",right:0,top:"calc(50% - 14px)"},clearIndicator:{marginRight:-2,padding:4,visibility:"hidden"},clearIndicatorDirty:{},popupIndicator:{padding:2,marginRight:-2},popupIndicatorOpen:{transform:"rotate(180deg)"},popper:{zIndex:e.zIndex.modal},popperDisablePortal:{position:"absolute"},paper:(0,o.Z)({},e.typography.body1,{overflow:"hidden",margin:"4px 0"}),listbox:{listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto"},loading:{color:e.palette.text.secondary,padding:"14px 16px"},noOptions:{color:e.palette.text.secondary,padding:"14px 16px"},option:(t={minHeight:48,display:"flex",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16},(0,i.Z)(t,e.breakpoints.up("sm"),{minHeight:"auto"}),(0,i.Z)(t,'&[aria-selected="true"]',{backgroundColor:e.palette.action.selected}),(0,i.Z)(t,'&[data-focus="true"]',{backgroundColor:e.palette.action.hover}),(0,i.Z)(t,"&:active",{backgroundColor:e.palette.action.selected}),(0,i.Z)(t,'&[aria-disabled="true"]',{opacity:e.palette.action.disabledOpacity,pointerEvents:"none"}),t),groupLabel:{backgroundColor:e.palette.background.paper,top:-8},groupUl:{padding:0,"& $option":{paddingLeft:24}}}}),{name:"MuiAutocomplete"})(P)},7694:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(7294);const i=(0,n(3786).Z)(r.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close")},6975:(e,t,n)=>{"use strict";n.d(t,{NU:()=>h,ZP:()=>f});var r,i=n(2122),o=n(1253),a=n(7294),s=(n(5697),n(5034)),l=n(4013),u=n(246),c=(0,l.Ue)((0,u.Z)()),d={disableGeneration:!1,generateClassName:(0,s.Z)(),jss:c,sheetsCache:null,sheetsManager:new Map,sheetsRegistry:null},h=a.createContext(d);function f(e){var t=e.children,n=e.injectFirst,s=void 0!==n&&n,c=e.disableGeneration,d=void 0!==c&&c,f=(0,o.Z)(e,["children","injectFirst","disableGeneration"]),p=a.useContext(h),m=(0,i.Z)({},p,{disableGeneration:d},f);if(!m.jss.options.insertionPoint&&s&&"undefined"!=typeof window){if(!r){var g=document.head;r=document.createComment("mui-inject-first"),g.insertBefore(r,g.firstChild)}m.jss=(0,l.Ue)({plugins:(0,u.Z)().plugins,insertionPoint:r})}return a.createElement(h.Provider,{value:m},t)}},7076:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r="function"==typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__"},5034:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7076),i=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.disableGlobal,n=void 0!==t&&t,o=e.productionPrefix,a=void 0===o?"jss":o,s=e.seed,l=void 0===s?"":s,u=""===l?"":"".concat(l,"-"),c=0;return function(e,t){c+=1;var o=t.options.name;if(o&&0===o.indexOf("Mui")&&!t.options.link&&!n){if(-1!==i.indexOf(e.key))return"Mui-".concat(e.key);var s="".concat(u).concat(o,"-").concat(e.key);return t.options.theme[r.Z]&&""===l?"".concat(s,"-").concat(c):s}return"".concat(u).concat(a).concat(c)}}},3869:(e,t,n)=>{"use strict";function r(e){var t=e.theme,n=e.name,r=e.props;if(!t||!t.props||!t.props[n])return r;var i,o=t.props[n];for(i in o)void 0===r[i]&&(r[i]=o[i]);return r}n.d(t,{Z:()=>r})},246:(e,t,n)=>{"use strict";n.d(t,{Z:()=>Pe});var r=n(4013),i=Date.now(),o="fnValues"+i,a="fnStyle"+ ++i;var s=n(2122),l="@global",u="@global ",c=function(){function e(e,t,n){for(var i in this.type="global",this.at=l,this.rules=void 0,this.options=void 0,this.key=void 0,this.isProcessed=!1,this.key=e,this.options=n,this.rules=new r.RB((0,s.Z)({},n,{parent:this})),t)this.rules.add(i,t[i]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return this.options.jss.plugins.onProcessRule(r),r},t.indexOf=function(e){return this.rules.indexOf(e)},t.toString=function(){return this.rules.toString()},e}(),d=function(){function e(e,t,n){this.type="global",this.at=l,this.options=void 0,this.rule=void 0,this.isProcessed=!1,this.key=void 0,this.key=e,this.options=n;var r=e.substr(u.length);this.rule=n.jss.createRule(r,t,(0,s.Z)({},n,{parent:this}))}return e.prototype.toString=function(e){return this.rule?this.rule.toString(e):""},e}(),h=/\s*,\s*/g;function f(e,t){for(var n=e.split(h),r="",i=0;i-1){var i=fe[e];if(!Array.isArray(i))return z+Y(i)in t&&U+i;if(!r)return!1;for(var o=0;ot?1:-1:e.length-t.length},{onProcessStyle:function(t,n){if("style"!==n.type)return t;for(var r={},i=Object.keys(t).sort(e),o=0;o{"use strict";n.d(t,{Z:()=>C});var r=n(1253),i=n(2122),o=n(7294),a=n(4013),s=n(5835);const l=function(e,t,n,r){var i=e.get(t);i||(i=new Map,e.set(t,i)),i.set(n,r)},u=function(e,t,n){var r=e.get(t);return r?r.get(n):void 0},c=function(e,t,n){e.get(t).delete(n)};var d=n(159),h=n(6975),f=-1e9;function p(){return f+=1}var m=n(5953);function g(e){var t="function"==typeof e;return{create:function(n,r){var o;try{o=t?e(n):e}catch(e){throw e}if(!r||!n.overrides||!n.overrides[r])return o;var a=n.overrides[r],s=(0,i.Z)({},o);return Object.keys(a).forEach((function(e){s[e]=(0,m.Z)(s[e],a[e])})),s},options:{}}}const v={};function y(e,t,n){var r=e.state;if(e.stylesOptions.disableGeneration)return t||{};r.cacheClasses||(r.cacheClasses={value:null,lastProp:null,lastJSS:{}});var i=!1;return r.classes!==r.cacheClasses.lastJSS&&(r.cacheClasses.lastJSS=r.classes,i=!0),t!==r.cacheClasses.lastProp&&(r.cacheClasses.lastProp=t,i=!0),i&&(r.cacheClasses.value=(0,s.Z)({baseClasses:r.cacheClasses.lastJSS,newClasses:t,Component:n})),r.cacheClasses.value}function b(e,t){var n=e.state,r=e.theme,o=e.stylesOptions,c=e.stylesCreator,d=e.name;if(!o.disableGeneration){var h=u(o.sheetsManager,c,r);h||(h={refs:0,staticSheet:null,dynamicStyles:null},l(o.sheetsManager,c,r,h));var f=(0,i.Z)({},c.options,{},o,{theme:r,flip:"boolean"==typeof o.flip?o.flip:"rtl"===r.direction});f.generateId=f.serverGenerateClassName||f.generateClassName;var p=o.sheetsRegistry;if(0===h.refs){var m;o.sheetsCache&&(m=u(o.sheetsCache,c,r));var g=c.create(r,d);m||((m=o.jss.createStyleSheet(g,(0,i.Z)({link:!1},f))).attach(),o.sheetsCache&&l(o.sheetsCache,c,r,m)),p&&p.add(m),h.staticSheet=m,h.dynamicStyles=(0,a._$)(g)}if(h.dynamicStyles){var v=o.jss.createStyleSheet(h.dynamicStyles,(0,i.Z)({link:!0},f));v.update(t),v.attach(),n.dynamicSheet=v,n.classes=(0,s.Z)({baseClasses:h.staticSheet.classes,newClasses:v.classes}),p&&p.add(v)}else n.classes=h.staticSheet.classes;h.refs+=1}}function w(e,t){var n=e.state;n.dynamicSheet&&n.dynamicSheet.update(t)}function E(e){var t=e.state,n=e.theme,r=e.stylesOptions,i=e.stylesCreator;if(!r.disableGeneration){var o=u(r.sheetsManager,i,n);o.refs-=1;var a=r.sheetsRegistry;0===o.refs&&(c(r.sheetsManager,i,n),r.jss.removeStyleSheet(o.staticSheet),a&&a.remove(o.staticSheet)),t.dynamicSheet&&(r.jss.removeStyleSheet(t.dynamicSheet),a&&a.remove(t.dynamicSheet))}}function _(e,t){var n,r=o.useRef([]),i=o.useMemo((function(){return{}}),t);r.current!==i&&(r.current=i,n=e()),o.useEffect((function(){return function(){n&&n()}}),[i])}function C(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.name,a=t.classNamePrefix,s=t.Component,l=t.defaultTheme,u=void 0===l?v:l,c=(0,r.Z)(t,["name","classNamePrefix","Component","defaultTheme"]),f=g(e),m=n||a||"makeStyles";f.options={index:p(),name:n,meta:m,classNamePrefix:m};var C=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,d.Z)()||u,r=(0,i.Z)({},o.useContext(h.NU),{},c),a=o.useRef(),l=o.useRef();_((function(){var i={name:n,state:{},stylesCreator:f,stylesOptions:r,theme:t};return b(i,e),l.current=!1,a.current=i,function(){E(i)}}),[t,f]),o.useEffect((function(){l.current&&w(a.current,e),l.current=!0}));var p=y(a.current,e.classes,s);return p};return C}},5835:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(2122);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.baseClasses,n=e.newClasses;if(e.Component,!n)return t;var i=(0,r.Z)({},t);return Object.keys(n).forEach((function(e){n[e]&&(i[e]="".concat(t[e]," ").concat(n[e]))})),i}},3800:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=n(7294).createContext(null)},159:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),i=n(3800);function o(){return r.useContext(i.Z)}},1410:(e,t,n)=>{"use strict";n.d(t,{k:()=>a});var r=n(484),i=(n(5697),{xs:0,sm:600,md:960,lg:1280,xl:1920}),o={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(i[e],"px)")}};function a(e,t,n){if(Array.isArray(t)){var i=e.theme.breakpoints||o;return t.reduce((function(e,r,o){return e[i.up(i.keys[o])]=n(t[o]),e}),{})}if("object"===(0,r.Z)(t)){var a=e.theme.breakpoints||o;return Object.keys(t).reduce((function(e,r){return e[a.up(r)]=n(t[r]),e}),{})}return n(t)}},9668:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(5953);const i=function(e,t){return t?(0,r.Z)(e,t,{clone:!1}):e}},8681:(e,t,n)=>{"use strict";n.d(t,{h:()=>f,Z:()=>m});var r,i,o=n(8481),a=n(1410),s=n(9668),l={m:"margin",p:"padding"},u={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},c={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},d=(r=function(e){if(e.length>2){if(!c[e])return[e];e=c[e]}var t=e.split(""),n=(0,o.Z)(t,2),r=n[0],i=n[1],a=l[r],s=u[i]||"";return Array.isArray(s)?s.map((function(e){return a+e})):[a+s]},i={},function(e){return void 0===i[e]&&(i[e]=r(e)),i[e]}),h=["m","mt","mr","mb","ml","mx","my","p","pt","pr","pb","pl","px","py","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY"];function f(e){var t=e.spacing||8;return"number"==typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"==typeof t?t:function(){}}function p(e){var t=f(e.theme);return Object.keys(e).map((function(n){if(-1===h.indexOf(n))return null;var r=function(e,t){return function(n){return e.reduce((function(e,r){return e[r]=function(e,t){if("string"==typeof t)return t;var n=e(Math.abs(t));return t>=0?n:"number"==typeof n?-n:"-".concat(n)}(t,n),e}),{})}}(d(n),t),i=e[n];return(0,a.k)(e,i,r)})).reduce(s.Z,{})}p.propTypes={},p.filterProps=h;const m=p},5953:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(2122),i=n(484);function o(e){return e&&"object"===(0,i.Z)(e)&&e.constructor===Object}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},i=n.clone?(0,r.Z)({},e):e;return o(e)&&o(t)&&Object.keys(t).forEach((function(r){"__proto__"!==r&&(o(t[r])&&r in e?i[r]=a(e[r],t[r],n):i[r]=t[r])})),i}},6664:function(e,t,n){!function(e,t){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n provider."));return e}(t.useContext(g),e)},b=function(e){return(0,e.children)(y("mounts "))};b.propTypes={children:u.func.isRequired};var w=function(e){var n=t.useRef(e);return t.useEffect((function(){n.current=e}),[e]),function(){n.current&&n.current.apply(n,arguments)}},E=function(e){return c(e)?(e.paymentRequest,r(e,["paymentRequest"])):{}},_=function(){},C=function(e,n){var r,i="".concat((r=e).charAt(0).toUpperCase()+r.slice(1),"Element"),o=n?function(e){y("mounts <".concat(i,">"));var n=e.id,r=e.className;return t.createElement("div",{id:n,className:r})}:function(n){var r=n.id,o=n.className,a=n.options,s=void 0===a?{}:a,l=n.onBlur,u=void 0===l?_:l,c=n.onFocus,d=void 0===c?_:c,f=n.onReady,p=void 0===f?_:f,m=n.onChange,g=void 0===m?_:m,v=n.onEscape,b=void 0===v?_:v,C=n.onClick,S=void 0===C?_:C,x=y("mounts <".concat(i,">")).elements,T=t.useRef(null),I=t.useRef(null),k=w(p),O=w(u),P=w(d),N=w(S),A=w(g),D=w(b);t.useLayoutEffect((function(){if(null==T.current&&x&&null!=I.current){var t=x.create(e,s);T.current=t,t.mount(I.current),t.on("ready",(function(){return k(t)})),t.on("change",A),t.on("blur",O),t.on("focus",P),t.on("escape",D),t.on("click",N)}}));var R=t.useRef(s);return t.useEffect((function(){R.current&&R.current.paymentRequest!==s.paymentRequest&&console.warn("Unsupported prop change: options.paymentRequest is not a customizable property.");var e=E(s);0===Object.keys(e).length||h(e,E(R.current))||T.current&&(T.current.update(e),R.current=s)}),[s]),t.useLayoutEffect((function(){return function(){T.current&&T.current.destroy()}}),[]),t.createElement("div",{id:r,className:o,ref:I})};return o.propTypes={id:u.string,className:u.string,onChange:u.func,onBlur:u.func,onFocus:u.func,onReady:u.func,onClick:u.func,options:u.object},o.displayName=i,o.__elementType=e,o},S="undefined"==typeof window,x=C("auBankAccount",S),T=C("card",S),I=C("cardNumber",S),k=C("cardExpiry",S),O=C("cardCvc",S),P=C("fpxBank",S),N=C("iban",S),A=C("idealBank",S),D=C("p24Bank",S),R=C("epsBank",S),M=C("paymentRequestButton",S),L=C("afterpayClearpayMessage",S);e.AfterpayClearpayMessageElement=L,e.AuBankAccountElement=x,e.CardCvcElement=O,e.CardElement=T,e.CardExpiryElement=k,e.CardNumberElement=I,e.Elements=v,e.ElementsConsumer=b,e.EpsBankElement=R,e.FpxBankElement=P,e.IbanElement=N,e.IdealBankElement=A,e.P24BankElement=D,e.PaymentRequestButtonElement=M,e.useElements=function(){return y("calls useElements()").elements},e.useStripe=function(){return y("calls useStripe()").stripe},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(7294))},4465:(e,t,n)=>{"use strict";n.r(t),n.d(t,{loadStripe:()=>c});var r="https://js.stripe.com/v3",i=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,o="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",a=null,s=function(e,t,n){if(null===e)return null;var r=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.13.2",startTime:t})}(r,n),r},l=Promise.resolve().then((function(){return e=null,null!==a?a:a=new Promise((function(t,n){if("undefined"!=typeof window)if(window.Stripe&&e&&console.warn(o),window.Stripe)t(window.Stripe);else try{var a=function(){for(var e=document.querySelectorAll('script[src^="'.concat(r,'"]')),t=0;t element.");return i.appendChild(n),n}(e)),a.addEventListener("load",(function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))})),a.addEventListener("error",(function(){n(new Error("Failed to load Stripe.js"))}))}catch(e){return void n(e)}else t(null)}));var e})),u=!1;l.catch((function(e){u||console.warn(e)}));var c=function(){for(var e=arguments.length,t=new Array(e),n=0;n{"use strict";function r(e){var t,n,i="";if(e)if("object"==typeof e)if(Array.isArray(e))for(t=0;ti})},6729:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i{"use strict";e.exports=()=>/[<>:"\/\\|?*\x00-\x1F]/g,e.exports.windowsNames=()=>/^(con|prn|aux|nul|com[0-9]|lpt[0-9])$/i},5503:(e,t,n)=>{"use strict";n.r(t),n.d(t,{SDK_VERSION:()=>r.Jn,_DEFAULT_ENTRY_NAME:()=>r.l4,_addComponent:()=>r.H9,_addOrOverwriteComponent:()=>r.Vr,_apps:()=>r.Af,_clearComponents:()=>r.Z8,_components:()=>r.lz,_getProvider:()=>r.qX,_registerComponent:()=>r.Xd,_removeServiceInstance:()=>r.wN,deleteApp:()=>r.P2,getApp:()=>r.Mq,getApps:()=>r.C6,initializeApp:()=>r.ZF,onLog:()=>r.TP,registerVersion:()=>r.KN,setLogLevel:()=>r.Ub});var r=n(3198);(0,r.KN)("firebase-exp","9.0.0-beta.2","app")},3887:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ActionCodeURL:()=>Ae,AuthCredential:()=>Ce,EmailAuthCredential:()=>Ie,EmailAuthProvider:()=>Re,FacebookAuthProvider:()=>Fe,GithubAuthProvider:()=>Be,GoogleAuthProvider:()=>We,OAuthCredential:()=>Oe,OAuthProvider:()=>je,PhoneAuthCredential:()=>Ne,PhoneAuthProvider:()=>mr,PhoneMultiFactorGenerator:()=>_r,RecaptchaVerifier:()=>lr,SAMLAuthProvider:()=>Ue,TwitterAuthProvider:()=>Ve,applyActionCode:()=>dt,browserLocalPersistence:()=>Qt,browserPopupRedirectResolver:()=>Xn,browserSessionPersistence:()=>Pn,checkActionCode:()=>ht,confirmPasswordReset:()=>ct,createUserWithEmailAndPassword:()=>pt,debugErrorMap:()=>p,deleteUser:()=>Wt,fetchSignInMethodsForEmail:()=>bt,getAdditionalUserInfo:()=>At,getAuth:()=>Cr,getIdToken:()=>Z,getIdTokenResult:()=>$,getMultiFactorResolver:()=>Ut,getRedirectResult:()=>Hn,inMemoryPersistence:()=>re,indexedDBLocalPersistence:()=>dn,initializeAuth:()=>I,isSignInWithEmailLink:()=>vt,linkWithCredential:()=>rt,linkWithPhoneNumber:()=>dr,linkWithPopup:()=>br,linkWithRedirect:()=>qn,multiFactor:()=>$t,onAuthStateChanged:()=>Mt,onIdTokenChanged:()=>Rt,parseActionCodeURL:()=>De,prodErrorMap:()=>m,reauthenticateWithCredential:()=>it,reauthenticateWithPhoneNumber:()=>hr,reauthenticateWithPopup:()=>yr,reauthenticateWithRedirect:()=>$n,reload:()=>X,sendEmailVerification:()=>wt,sendPasswordResetEmail:()=>ut,sendSignInLinkToEmail:()=>gt,setPersistence:()=>Dt,signInAnonymously:()=>He,signInWithCredential:()=>nt,signInWithCustomToken:()=>ot,signInWithEmailAndPassword:()=>mt,signInWithEmailLink:()=>yt,signInWithPhoneNumber:()=>cr,signInWithPopup:()=>vr,signInWithRedirect:()=>Zn,signOut:()=>Ft,unlink:()=>Ye,updateCurrentUser:()=>jt,updateEmail:()=>Ct,updatePassword:()=>St,updatePhoneNumber:()=>pr,updateProfile:()=>_t,useAuthEmulator:()=>we,useDeviceLanguage:()=>Lt,verifyBeforeUpdateEmail:()=>Et,verifyPasswordResetCode:()=>ft});var r=n(3198),i=n(8448),o=n(4594),a=function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function c(e,t){for(var n=0,r=t.length,i=e.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]e,"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&&(O()||(0,i.ru)()||"connection"in navigator)&&!navigator.onLine?Math.min(5e3,this.shortDelay):this.isMobile?this.longDelay:this.shortDelay}}function A(e,t){S(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}class D{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 C("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 C("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 C("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const R={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:"internal-error",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"},M=new N(3e4,6e4);function L(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function j(e,t,n,r,o={}){return F(e,o,(()=>{let o={},a={};r&&("GET"===t?a=r:o={body:JSON.stringify(r)});const s=(0,i.xO)(Object.assign({key:e.config.apiKey},a)).slice(1),l=new(D.headers());return l.set("Content-Type","application/json"),l.set("X-Client-Version",e._getSdkClientVersion()),e.languageCode&&l.set("X-Firebase-Locale",e.languageCode),D.fetch()(B(e,e.config.apiHost,n,s),Object.assign({method:t,headers:l,referrerPolicy:"no-referrer"},o))}))}async function F(e,t,n){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},R),t);try{const t=new z(e),i=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const o=await i.json();if("needConfirmation"in o)throw U(e,"account-exists-with-different-credential",o);if(i.ok&&!("errorMessage"in o))return o;{const t=(i.ok?o.errorMessage:o.error.message).split(" : ")[0];if("FEDERATED_USER_ID_ALREADY_LINKED"===t)throw U(e,"credential-already-in-use",o);if("EMAIL_EXISTS"===t)throw U(e,"email-already-in-use",o);b(e,r[t]||t.toLowerCase().replace(/[_\s]+/g,"-"))}}catch(t){if(t instanceof i.ZR)throw t;b(e,"network-request-failed")}}async function W(e,t,n,r,i={}){const o=await j(e,t,n,r,i);return"mfaPendingCredential"in o&&b(e,"multi-factor-auth-required",{serverResponse:o}),o}function B(e,t,n,r){const i=`${t}${n}?${r}`;return e.config.emulator?A(e.config,i):`${e.config.apiScheme}://${i}`}class z{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise(((e,t)=>{this.timer=setTimeout((()=>t(w(this.auth,"timeout"))),M.get())}))}clearNetworkTimeout(){clearTimeout(this.timer)}}function U(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=w(e,t,r);return i.customData._tokenResponse=n,i}function V(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}function Z(e,t=!1){return(0,i.m9)(e).getIdToken(t)}async function $(e,t=!1){const n=(0,i.m9)(e),r=await n.getIdToken(t),o=H(r);_(o&&o.exp&&o.auth_time&&o.iat,n.auth,"internal-error");const a="object"==typeof o.firebase?o.firebase:void 0,s=null==a?void 0:a.sign_in_provider;return{claims:o,token:r,authTime:V(q(o.auth_time)),issuedAtTime:V(q(o.iat)),expirationTime:V(q(o.exp)),signInProvider:s||null,signInSecondFactor:(null==a?void 0:a.sign_in_second_factor)||null}}function q(e){return 1e3*Number(e)}function H(e){const[t,n,r]=e.split(".");if(void 0===t||void 0===n||void 0===r)return y("JWT malformed, contained fewer than 3 sections"),null;try{const e=(0,i.tV)(n);return e?JSON.parse(e):(y("Failed to decode base64 JWT payload"),null)}catch(e){return y("Caught error parsing JWT payload as JSON",e),null}}async function K(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}}class G{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){const e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{this.errorBackoff=3e4;const e=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,e)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout((async()=>{await this.iteration()}),t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){return void("auth/network-request-failed"===e.code&&this.schedule(!0))}this.schedule()}}class Q{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=V(this.lastLoginAt),this.creationTime=V(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function Y(e){var t;const n=e.auth,r=await e.getIdToken(),i=await K(e,async function(e,t){return j(e,"POST","/v1/accounts:lookup",t)}(n,{idToken:r}));_(null==i?void 0:i.users.length,n,"internal-error");const o=i.users[0];e._notifyReloadListener(o);const a=(null===(t=o.providerUserInfo)||void 0===t?void 0:t.length)?o.providerUserInfo.map((e=>{var{providerId:t}=e,n=s(e,["providerId"]);return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})):[],l=(u=e.providerData,c=a,[...u.filter((e=>!c.some((t=>t.providerId===e.providerId)))),...c]);var u,c;const d=e.isAnonymous,h=!(e.email&&o.passwordHash||(null==l?void 0:l.length)),f=!!d&&h,p={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:l,metadata:new Q(o.createdAt,o.lastLoginAt),isAnonymous:f};Object.assign(e,p)}async function X(e){const t=(0,i.m9)(e);await Y(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}class J{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){_(e.idToken,"internal-error"),_(void 0!==e.idToken,"internal-error"),_(void 0!==e.refreshToken,"internal-error");const t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):function(e){const t=H(e);return _(t,"internal-error"),_(void 0!==t.exp,"internal-error"),_(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 _(!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){const{accessToken:n,refreshToken:r,expiresIn:o}=await async function(e,t){const n=await F(e,{},(()=>{const n=(0,i.xO)({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:r,apiKey:o}=e.config,a=B(e,r,"/v1/token",`key=${o}`);return D.fetch()(a,{method:"POST",headers:{"X-Client-Version":e._getSdkClientVersion(),"Content-Type":"application/x-www-form-urlencoded"},body:n})}));return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(e,t);this.updateTokensAndExpiration(n,r,Number(o))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){const{refreshToken:n,accessToken:r,expirationTime:i}=t,o=new J;return n&&(_("string"==typeof n,"internal-error",{appName:e}),o.refreshToken=n),r&&(_("string"==typeof r,"internal-error",{appName:e}),o.accessToken=r),i&&(_("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 J,this.toJSON())}_performRefresh(){return C("not implemented")}}function ee(e,t){_("string"==typeof e||void 0===e,"internal-error",{appName:t})}class te{constructor(e){var{uid:t,auth:n,stsTokenManager:r}=e,i=s(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.emailVerified=!1,this.isAnonymous=!1,this.tenantId=null,this.providerData=[],this.proactiveRefresh=new G(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.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.metadata=new Q(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const t=await K(this,this.stsTokenManager.getToken(this.auth,e));return _(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return $(this,e)}reload(){return X(this)}_assign(e){this!==e&&(_(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){return new te(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}))}_onReload(e){_(!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 Y(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await K(this,async function(e,t){return j(e,"POST","/v1/accounts:delete",t)}(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,a,s,l,u;const 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!==(a=t.tenantId)&&void 0!==a?a:void 0,m=null!==(s=t._redirectEventId)&&void 0!==s?s:void 0,g=null!==(l=t.createdAt)&&void 0!==l?l:void 0,v=null!==(u=t.lastLoginAt)&&void 0!==u?u:void 0,{uid:y,emailVerified:b,isAnonymous:w,providerData:E,stsTokenManager:C}=t;_(y&&C,e,"internal-error");const S=J.fromJSON(this.name,C);_("string"==typeof y,e,"internal-error"),ee(c,e.name),ee(d,e.name),_("boolean"==typeof b,e,"internal-error"),_("boolean"==typeof w,e,"internal-error"),ee(h,e.name),ee(f,e.name),ee(p,e.name),ee(m,e.name),ee(g,e.name),ee(v,e.name);const x=new te({uid:y,auth:e,email:d,emailVerified:b,displayName:c,isAnonymous:w,photoURL:f,phoneNumber:h,tenantId:p,stsTokenManager:S,createdAt:g,lastLoginAt:v});return E&&Array.isArray(E)&&(x.providerData=E.map((e=>Object.assign({},e)))),m&&(x._redirectEventId=m),x}static async _fromIdTokenResponse(e,t,n=!1){const r=new J;r.updateFromServerResponse(t);const i=new te({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:n});return await Y(i),i}}class ne{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}ne.type="NONE";const re=ne;function ie(e,t,n){return`firebase:${e}:${t}:${n}`}class oe{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:r,name:i}=this.auth;this.fullUserKey=ie(this.userKey,r.apiKey,i),this.fullPersistenceKey=ie("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(){const e=await this.persistence._get(this.fullUserKey);return e?te._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;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,n="authUser"){if(!t.length)return new oe(T(re),e,n);let r=T(re);for(const e of t)if(await e._isAvailable()){r=e;break}let i=null;const o=ie(n,e.config.apiKey,e.name);for(const n of t)try{const t=await n._get(o);if(t){const o=te._fromJSON(e,t);n!==r&&(i=o);break}}catch(e){}return i&&await r._set(o,i.toJSON()),await Promise.all(t.map((async e=>{if(e!==r)try{await e._remove(o)}catch(e){}}))),new oe(r,e,n)}}function ae(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(ce(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(se(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(he(t))return"Blackberry";if(fe(t))return"Webos";if(le(t))return"Safari";if((t.includes("chrome/")||ue(t))&&!t.includes("edge/"))return"Chrome";if(de(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(t);if(2===(null==n?void 0:n.length))return n[1]}return"Other"}function se(e=(0,i.z$)()){return/firefox\//i.test(e)}function le(e=(0,i.z$)()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function ue(e=(0,i.z$)()){return/crios\//i.test(e)}function ce(e=(0,i.z$)()){return/iemobile/i.test(e)}function de(e=(0,i.z$)()){return/android/i.test(e)}function he(e=(0,i.z$)()){return/blackberry/i.test(e)}function fe(e=(0,i.z$)()){return/webos/i.test(e)}function pe(e=(0,i.z$)()){return/iphone|ipad|ipod/i.test(e)}function me(e=(0,i.z$)()){return pe(e)||de(e)||fe(e)||he(e)||/windows phone/i.test(e)||ce(e)}function ge(e,t=[]){let n;switch(e){case"Browser":n=ae((0,i.z$)());break;case"Worker":n=`${ae((0,i.z$)())}-${e}`;break;default:n=e}const o=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${r.Jn}/${o}`}class ve{constructor(e,t){this.app=e,this.config=t,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new be(this),this.idTokenSubscription=new be(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.redirectInitializerError=null,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=g,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=t.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=T(t)),this._initializationPromise=this.queue((async()=>{var n;this._deleted||(this.persistenceManager=await oe.create(this,e),this._deleted||((null===(n=this._popupRedirectResolver)||void 0===n?void 0:n._shouldInitProactively)&&await this._popupRedirectResolver._initialize(this),await this.initializeCurrentUser(t),this._deleted||(this._isInitialized=!0)))})),this._initializationPromise.then((()=>{if(this.redirectInitializerError)throw this.redirectInitializerError}))}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(e):void 0}async initializeCurrentUser(e){var t;let n=await this.assertedPersistence.getCurrentUser();if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const r=null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId,i=null==n?void 0:n._redirectEventId,o=await this.tryRedirectSignIn(e);r&&r!==i||!(null==o?void 0:o.user)||(n=o.user)}return n?n._redirectEventId?(_(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===n._redirectEventId?this.directlySetCurrentUser(n):this.reloadAndSetCurrentUserOrClear(n)):this.reloadAndSetCurrentUserOrClear(n):this.directlySetCurrentUser(null)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(e){this.redirectInitializerError=e,await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await Y(e)}catch(e){if("auth/network-request-failed"!==e.code)return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const t=e?(0,i.m9)(e):null;return t&&_(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e){if(!this._deleted)return e&&_(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),this.queue((async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()}))}async signOut(){return(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null)}setPersistence(e){return this.queue((async()=>{await this.assertedPersistence.setPersistence(T(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)}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){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&T(e)||this._popupRedirectResolver;_(t,this,"argument-error"),this.redirectPersistenceManager=await oe.create(this,[T(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);const 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()=>{};const i="function"==typeof t?t:t.next,o=this._isInitialized?Promise.resolve():this._initializationPromise;return _(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 _(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=ge(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}_getSdkClientVersion(){return this.clientVersion}}function ye(e){return(0,i.m9)(e)}class be{constructor(e){this.auth=e,this.observer=null,this.addObserver=(0,i.ne)((e=>this.observer=e))}get next(){return _(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}function we(e,t,n){const r=ye(e);_(r._canInitEmulator,r,"emulator-config-failed"),_(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const i=!!(null==n?void 0:n.disableWarnings),o=Ee(t),{host:a,port:s}=function(e){const t=Ee(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const e=i[1];return{host:e,port:_e(r.substr(e.length+1))}}{const[e,t]=r.split(":");return{host:e,port:_e(t)}}}(t),l=null===s?"":`:${s}`;r.config.emulator={url:`${o}//${a}${l}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:a,port:s,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:i})}),function(e){function t(){const 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||e||("loading"===document.readyState?window.addEventListener("DOMContentLoaded",t):t())}(i)}function Ee(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function _e(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}class Ce{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return C("not implemented")}_getIdTokenResponse(e){return C("not implemented")}_linkToIdToken(e,t){return C("not implemented")}_getReauthenticationResolver(e){return C("not implemented")}}async function Se(e,t){return j(e,"POST","/v1/accounts:resetPassword",L(e,t))}async function xe(e,t){return j(e,"POST","/v1/accounts:update",t)}async function Te(e,t){return j(e,"POST","/v1/accounts:sendOobCode",L(e,t))}class Ie extends Ce{constructor(e,t,n,r=null){super("password",n),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new Ie(e,t,"password")}static _fromEmailAndCode(e,t,n=null){return new Ie(e,t,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const 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 async function(e,t){return W(e,"POST","/v1/accounts:signInWithPassword",L(e,t))}(e,{returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return async function(e,t){return W(e,"POST","/v1/accounts:signInWithEmailLink",L(e,t))}(e,{email:this._email,oobCode:this._password});default:b(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return xe(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return async function(e,t){return W(e,"POST","/v1/accounts:signInWithEmailLink",L(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:b(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function ke(e,t){return W(e,"POST","/v1/accounts:signInWithIdp",L(e,t))}class Oe extends Ce{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new Oe(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):b("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){const t="string"==typeof e?JSON.parse(e):e,{providerId:n,signInMethod:r}=t,i=s(t,["providerId","signInMethod"]);if(!n||!r)return null;const o=new Oe(n,r);return Object.assign(o,i),o}_getIdTokenResponse(e){return ke(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,ke(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,ke(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const 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}}const Pe={USER_NOT_FOUND:"user-not-found"};class Ne extends Ce{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new Ne({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new Ne({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return async function(e,t){return W(e,"POST","/v1/accounts:signInWithPhoneNumber",L(e,t))}(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return async function(e,t){const n=await W(e,"POST","/v1/accounts:signInWithPhoneNumber",L(e,t));if(n.temporaryProof)throw U(e,"account-exists-with-different-credential",n);return n}(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return async function(e,t){return W(e,"POST","/v1/accounts:signInWithPhoneNumber",L(e,Object.assign(Object.assign({},t),{operation:"REAUTH"})),Pe)}(e,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:e,phoneNumber:t,verificationId:n,verificationCode:r}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:n,code:r}}toJSON(){const 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));const{verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}=e;return n||t||r||i?new Ne({verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}):null}}class Ae{constructor(e){var t,n,r,o,a,s;const l=(0,i.zd)((0,i.pd)(e)),u=null!==(t=l.apiKey)&&void 0!==t?t:null,c=null!==(n=l.oobCode)&&void 0!==n?n:null,d=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=l.mode)&&void 0!==r?r:null);_(u&&c&&d,"argument-error"),this.apiKey=u,this.operation=d,this.code=c,this.continueUrl=null!==(o=l.continueUrl)&&void 0!==o?o:null,this.languageCode=null!==(a=l.languageCode)&&void 0!==a?a:null,this.tenantId=null!==(s=l.tenantId)&&void 0!==s?s:null}static parseLink(e){const t=function(e){const 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 Ae(t)}catch(e){return null}}}function De(e){return Ae.parseLink(e)}class Re{constructor(){this.providerId=Re.PROVIDER_ID}static credential(e,t){return Ie._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const n=Ae.parseLink(t);return _(n,"argument-error"),Ie._fromEmailAndCode(e,n.code,n.tenantId)}}Re.PROVIDER_ID="password",Re.EMAIL_PASSWORD_SIGN_IN_METHOD="password",Re.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class Me{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}}class Le extends Me{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class je extends Le{static credentialFromJSON(e){const t="string"==typeof e?JSON.parse(e):e;return _("providerId"in t&&"signInMethod"in t,"argument-error"),Oe._fromParams(t)}credential(e){return this._credential(e)}_credential(e){return _(e.idToken||e.accessToken,"argument-error"),Oe._fromParams(Object.assign(Object.assign({},e),{providerId:this.providerId,signInMethod:this.providerId}))}static credentialFromResult(e){return je.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return je.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n,oauthTokenSecret:r,pendingToken:i,nonce:o,providerId:a}=e;if(!(n||r||t||i))return null;if(!a)return null;try{return new je(a)._credential({idToken:t,accessToken:n,rawNonce:o,pendingToken:i})}catch(e){return null}}}class Fe extends Le{constructor(){super("facebook.com")}static credential(e){return Oe._fromParams({providerId:Fe.PROVIDER_ID,signInMethod:Fe.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Fe.credentialFromTaggedObject(e)}static credentialFromError(e){return Fe.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return Fe.credential(e.oauthAccessToken)}catch(e){return null}}}Fe.FACEBOOK_SIGN_IN_METHOD="facebook.com",Fe.PROVIDER_ID="facebook.com";class We extends Le{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return Oe._fromParams({providerId:We.PROVIDER_ID,signInMethod:We.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return We.credentialFromTaggedObject(e)}static credentialFromError(e){return We.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n}=e;if(!t&&!n)return null;try{return We.credential(t,n)}catch(e){return null}}}We.GOOGLE_SIGN_IN_METHOD="google.com",We.PROVIDER_ID="google.com";class Be extends Le{constructor(){super("github.com")}static credential(e){return Oe._fromParams({providerId:Be.PROVIDER_ID,signInMethod:Be.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Be.credentialFromTaggedObject(e)}static credentialFromError(e){return Be.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return Be.credential(e.oauthAccessToken)}catch(e){return null}}}Be.GITHUB_SIGN_IN_METHOD="github.com",Be.PROVIDER_ID="github.com";class ze extends Ce{constructor(e,t){super(e,e),this.pendingToken=t}_getIdTokenResponse(e){return ke(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,ke(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,ke(e,t)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e,{providerId:n,signInMethod:r,pendingToken:i}=t;return n&&r&&i&&n===r?new ze(n,i):null}static _create(e,t){return new ze(e,t)}buildRequest(){return{requestUri:"http://localhost",returnSecureToken:!0,pendingToken:this.pendingToken}}}class Ue extends Me{constructor(e){_(e.startsWith("saml."),"argument-error"),super(e)}static credentialFromResult(e){return Ue.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return Ue.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){const t=ze.fromJSON(e);return _(t,"argument-error"),t}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{pendingToken:t,providerId:n}=e;if(!t||!n)return null;try{return ze._create(n,t)}catch(e){return null}}}class Ve extends Le{constructor(){super("twitter.com")}static credential(e,t){return Oe._fromParams({providerId:Ve.PROVIDER_ID,signInMethod:Ve.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return Ve.credentialFromTaggedObject(e)}static credentialFromError(e){return Ve.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:n}=e;if(!t||!n)return null;try{return Ve.credential(t,n)}catch(e){return null}}}async function Ze(e,t){return W(e,"POST","/v1/accounts:signUp",L(e,t))}Ve.TWITTER_SIGN_IN_METHOD="twitter.com",Ve.PROVIDER_ID="twitter.com";class $e{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){const i=await te._fromIdTokenResponse(e,n,r),o=qe(n);return new $e({user:i,providerId:o,_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){await e._updateTokensIfNecessary(n,!0);const r=qe(n);return new $e({user:e,providerId:r,_tokenResponse:n,operationType:t})}}function qe(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}async function He(e){var t;const n=ye(e);if(null===(t=n.currentUser)||void 0===t?void 0:t.isAnonymous)return new $e({user:n.currentUser,providerId:null,operationType:"signIn"});const r=await Ze(n,{returnSecureToken:!0}),i=await $e._fromIdTokenResponse(n,"signIn",r,!0);return await n._updateCurrentUser(i.user),i}class Ke extends i.ZR{constructor(e,t,n,r){var i;super(t.code,t.message),this.operationType=n,this.user=r,this.name="FirebaseError",Object.setPrototypeOf(this,Ke.prototype),this.appName=e.name,this.code=t.code,this.tenantId=null!==(i=e.tenantId)&&void 0!==i?i:void 0,this.serverResponse=t.customData.serverResponse}static _fromErrorAndOperation(e,t,n,r){return new Ke(e,t,n,r)}}function Ge(e,t,n,r){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch((n=>{if("auth/multi-factor-auth-required"===n.code)throw Ke._fromErrorAndOperation(e,n,t,r);throw n}))}function Qe(e){return new Set(e.map((({providerId:e})=>e)).filter((e=>!!e)))}async function Ye(e,t){const n=(0,i.m9)(e);await Je(!0,n,t);const{providerUserInfo:r}=await async function(e,t){return j(e,"POST","/v1/accounts:update",t)}(n.auth,{idToken:await n.getIdToken(),deleteProvider:[t]}),o=Qe(r||[]);return n.providerData=n.providerData.filter((e=>o.has(e.providerId))),o.has("phone")||(n.phoneNumber=null),await n.auth._persistUserIfCurrent(n),n}async function Xe(e,t,n=!1){const r=await K(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return $e._forOperation(e,"link",r)}async function Je(e,t,n){await Y(t);const r=!1===e?"provider-already-linked":"no-such-provider";_(Qe(t.providerData).has(n)===e,t.auth,r)}async function et(e,t,n=!1){const{auth:r}=e,i="reauthenticate";try{const o=await K(e,Ge(r,i,t,e),n);_(o.idToken,r,"internal-error");const a=H(o.idToken);_(a,r,"internal-error");const{sub:s}=a;return _(e.uid===s,r,"user-mismatch"),$e._forOperation(e,i,o)}catch(e){throw"auth/user-not-found"===(null==e?void 0:e.code)&&b(r,"user-mismatch"),e}}async function tt(e,t,n=!1){const r="signIn",i=await Ge(e,r,t),o=await $e._fromIdTokenResponse(e,r,i);return n||await e._updateCurrentUser(o.user),o}async function nt(e,t){return tt(ye(e),t)}async function rt(e,t){const n=(0,i.m9)(e);return await Je(!1,n,t.providerId),Xe(n,t)}async function it(e,t){return et((0,i.m9)(e),t)}async function ot(e,t){const n=ye(e),r=await async function(e,t){return W(e,"POST","/v1/accounts:signInWithCustomToken",L(e,t))}(n,{token:t,returnSecureToken:!0}),i=await $e._fromIdTokenResponse(n,"signIn",r);return await n._updateCurrentUser(i.user),i}class at{constructor(e,t){this.factorId=e,this.uid=t.mfaEnrollmentId,this.enrollmentTime=new Date(t.enrolledAt).toUTCString(),this.displayName=t.displayName}static _fromServerResponse(e,t){return"phoneInfo"in t?st._fromServerResponse(e,t):b(e,"internal-error")}}class st extends at{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new st(t)}}function lt(e,t,n){var r;_((null===(r=n.url)||void 0===r?void 0:r.length)>0,e,"invalid-continue-uri"),_(void 0===n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),t.continueUrl=n.url,t.dynamicLinkDomain=n.dynamicLinkDomain,t.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(_(n.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iosBundleId=n.iOS.bundleId),n.android&&(_(n.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=n.android.installApp,t.androidMinimumVersionCode=n.android.minimumVersion,t.androidPackageName=n.android.packageName)}async function ut(e,t,n){const r=(0,i.m9)(e),o={requestType:"PASSWORD_RESET",email:t};n&<(r,o,n),await async function(e,t){return Te(e,t)}(r,o)}async function ct(e,t,n){await Se((0,i.m9)(e),{oobCode:t,newPassword:n})}async function dt(e,t){await async function(e,t){return j(e,"POST","/v1/accounts:update",L(e,t))}((0,i.m9)(e),{oobCode:t})}async function ht(e,t){const n=(0,i.m9)(e),r=await Se(n,{oobCode:t}),o=r.requestType;switch(_(o,n,"internal-error"),o){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":_(r.newEmail,n,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":_(r.mfaInfo,n,"internal-error");default:_(r.email,n,"internal-error")}let a=null;return r.mfaInfo&&(a=at._fromServerResponse(ye(n),r.mfaInfo)),{data:{email:("VERIFY_AND_CHANGE_EMAIL"===r.requestType?r.newEmail:r.email)||null,previousEmail:("VERIFY_AND_CHANGE_EMAIL"===r.requestType?r.email:r.newEmail)||null,multiFactorInfo:a},operation:o}}async function ft(e,t){const{data:n}=await ht((0,i.m9)(e),t);return n.email}async function pt(e,t,n){const r=ye(e),i=await Ze(r,{returnSecureToken:!0,email:t,password:n}),o=await $e._fromIdTokenResponse(r,"signIn",i);return await r._updateCurrentUser(o.user),o}function mt(e,t,n){return nt((0,i.m9)(e),Re.credential(t,n))}async function gt(e,t,n){const r=(0,i.m9)(e),o={requestType:"EMAIL_SIGNIN",email:t};_(n.handleCodeInApp,r,"argument-error"),n&<(r,o,n),await async function(e,t){return Te(e,t)}(r,o)}function vt(e,t){const n=Ae.parseLink(t);return"EMAIL_SIGNIN"===(null==n?void 0:n.operation)}async function yt(e,t,n){const r=(0,i.m9)(e),o=Re.credentialWithLink(t,n||k());return _(o._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),nt(r,o)}async function bt(e,t){const n={identifier:t,continueUri:O()?k():"http://localhost"},{signinMethods:r}=await async function(e,t){return j(e,"POST","/v1/accounts:createAuthUri",L(e,t))}((0,i.m9)(e),n);return r||[]}async function wt(e,t){const n=(0,i.m9)(e),r={requestType:"VERIFY_EMAIL",idToken:await e.getIdToken()};t&<(n.auth,r,t);const{email:o}=await async function(e,t){return Te(e,t)}(n.auth,r);o!==e.email&&await e.reload()}async function Et(e,t,n){const r=(0,i.m9)(e),o={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await e.getIdToken(),newEmail:t};n&<(r.auth,o,n);const{email:a}=await async function(e,t){return Te(e,t)}(r.auth,o);a!==e.email&&await e.reload()}async function _t(e,{displayName:t,photoURL:n}){if(void 0===t&&void 0===n)return;const r=(0,i.m9)(e),o={idToken:await r.getIdToken(),displayName:t,photoUrl:n,returnSecureToken:!0},a=await K(r,async function(e,t){return j(e,"POST","/v1/accounts:update",t)}(r.auth,o));r.displayName=a.displayName||null,r.photoURL=a.photoUrl||null;const s=r.providerData.find((({providerId:e})=>"password"===e));s&&(s.displayName=r.displayName,s.photoURL=r.photoURL),await r._updateTokensIfNecessary(a)}function Ct(e,t){return xt((0,i.m9)(e),t,null)}function St(e,t){return xt((0,i.m9)(e),null,t)}async function xt(e,t,n){const{auth:r}=e,i={idToken:await e.getIdToken(),returnSecureToken:!0};t&&(i.email=t),n&&(i.password=n);const o=await K(e,xe(r,i));await e._updateTokensIfNecessary(o,!0)}class Tt{constructor(e,t,n={}){this.isNewUser=e,this.providerId=t,this.profile=n}}class It extends Tt{constructor(e,t,n,r){super(e,t,n),this.username=r}}class kt extends Tt{constructor(e,t){super(e,"facebook.com",t)}}class Ot extends It{constructor(e,t){super(e,"github.com",t,"string"==typeof(null==t?void 0:t.login)?null==t?void 0:t.login:null)}}class Pt extends Tt{constructor(e,t){super(e,"google.com",t)}}class Nt extends It{constructor(e,t,n){super(e,"twitter.com",t,n)}}function At(e){const{user:t,_tokenResponse:n}=e;return t.isAnonymous&&!n?{providerId:null,isNewUser:!1,profile:null}:function(e){var t,n;if(!e)return null;const{providerId:r}=e,i=e.rawUserInfo?JSON.parse(e.rawUserInfo):{},o=e.isNewUser||"identitytoolkit#SignupNewUserResponse"===e.kind;if(!r&&(null==e?void 0:e.idToken)){const r=null===(n=null===(t=H(e.idToken))||void 0===t?void 0:t.firebase)||void 0===n?void 0:n.sign_in_provider;if(r)return new Tt(o,"anonymous"!==r&&"custom"!==r?r:null)}if(!r)return null;switch(r){case"facebook.com":return new kt(o,i);case"github.com":return new Ot(o,i);case"google.com":return new Pt(o,i);case"twitter.com":return new Nt(o,i,e.screenName||null);case"custom":case"anonymous":return new Tt(o,null);default:return new Tt(o,r,i)}}(n)}function Dt(e,t){return(0,i.m9)(e).setPersistence(t)}function Rt(e,t,n,r){return(0,i.m9)(e).onIdTokenChanged(t,n,r)}function Mt(e,t,n,r){return(0,i.m9)(e).onAuthStateChanged(t,n,r)}function Lt(e){(0,i.m9)(e).useDeviceLanguage()}function jt(e,t){return(0,i.m9)(e).updateCurrentUser(t)}function Ft(e){return(0,i.m9)(e).signOut()}async function Wt(e){return(0,i.m9)(e).delete()}class Bt{constructor(e,t){this.type=e,this.credential=t}static _fromIdtoken(e){return new Bt("enroll",e)}static _fromMfaPendingCredential(e){return new Bt("signin",e)}toJSON(){return{multiFactorSession:{["enroll"===this.type?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){var t,n;if(null==e?void 0:e.multiFactorSession){if(null===(t=e.multiFactorSession)||void 0===t?void 0:t.pendingCredential)return Bt._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);if(null===(n=e.multiFactorSession)||void 0===n?void 0:n.idToken)return Bt._fromIdtoken(e.multiFactorSession.idToken)}return null}}class zt{constructor(e,t,n){this.session=e,this.hints=t,this.signInResolver=n}static _fromError(e,t){const n=ye(e),r=(t.serverResponse.mfaInfo||[]).map((e=>at._fromServerResponse(n,e)));_(t.serverResponse.mfaPendingCredential,n,"internal-error");const i=Bt._fromMfaPendingCredential(t.serverResponse.mfaPendingCredential);return new zt(i,r,(async e=>{const r=await e._process(n,i);delete t.serverResponse.mfaInfo,delete t.serverResponse.mfaPendingCredential;const o=Object.assign(Object.assign({},t.serverResponse),{idToken:r.idToken,refreshToken:r.refreshToken});switch(t.operationType){case"signIn":const e=await $e._fromIdTokenResponse(n,t.operationType,o);return await n._updateCurrentUser(e.user),e;case"reauthenticate":return _(t.user,n,"internal-error"),$e._forOperation(t.user,t.operationType,o);default:b(n,"internal-error")}}))}async resolveSignIn(e){const t=e;return this.signInResolver(t)}}function Ut(e,t){var n;const r=(0,i.m9)(e),o=t;return _(t.operationType,r,"argument-error"),_(null===(n=o.serverResponse)||void 0===n?void 0:n.mfaPendingCredential,r,"argument-error"),zt._fromError(r,o)}class Vt{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload((t=>{t.mfaInfo&&(this.enrolledFactors=t.mfaInfo.map((t=>at._fromServerResponse(e.auth,t))))}))}static _fromUser(e){return new Vt(e)}async getSession(){return Bt._fromIdtoken(await this.user.getIdToken())}async enroll(e,t){const n=e,r=await this.getSession(),i=await K(this.user,n._process(this.user.auth,r,t));return await this.user._updateTokensIfNecessary(i),this.user.reload()}async unenroll(e){const t="string"==typeof e?e:e.uid,n=await this.user.getIdToken(),r=await K(this.user,(i=this.user.auth,o={idToken:n,mfaEnrollmentId:t},j(i,"POST","/v2/accounts/mfaEnrollment:withdraw",Object.assign({tenantId:i.tenantId},o))));var i,o;this.enrolledFactors=this.enrolledFactors.filter((({uid:e})=>e!==t)),await this.user._updateTokensIfNecessary(r);try{await this.user.reload()}catch(e){if("auth/user-token-expired"!==e.code)throw e}}}const Zt=new WeakMap;function $t(e){const t=(0,i.m9)(e);return Zt.has(t)||Zt.set(t,Vt._fromUser(t)),Zt.get(t)}class qt{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;const t=this.auth.onIdTokenChanged((t=>{var n;e((null===(n=t)||void 0===n?void 0:n.stsTokenManager.accessToken)||null)}));this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){_(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}const Ht="__sak";class Kt{constructor(e,t){this.storage=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(Ht,"1"),this.storage.removeItem(Ht),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}}class Gt extends Kt{constructor(){super(window.localStorage,"LOCAL"),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=function(){const e=(0,i.z$)();return le(e)||pe(e)}()&&function(){try{return!(!window||window===window.top)}catch(e){return!1}}(),this.fallbackToPolling=me(),this.boundEventHandler=this.onStorageEvent.bind(this)}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const n=this.storage.getItem(t),r=this.localCache[t];n!==r&&e(t,r,n)}}onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys(((e,t,n)=>{this.notifyListeners(e,n)}));const n=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const 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}const r=()=>{const 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;const n=this.listeners[e];if(n)for(const 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){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}Gt.type="LOCAL";const Qt=Gt;class Yt{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find((t=>t.isListeningto(e)));if(t)return t;const n=new Yt(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:r,data:i}=t.data,o=this.handlersMap[r];if(!(null==o?void 0:o.size))return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:r});const a=Array.from(o).map((async e=>e(t.origin,i))),s=await function(e){return Promise.all(e.map((async e=>{try{return{fulfilled:!0,value:await e}}catch(e){return{fulfilled:!1,reason:e}}})))}(a);t.ports[0].postMessage({status:"done",eventId:n,eventType:r,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)}}Yt.receivers=[];class Xt{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){const r="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!r)throw new Error("connection_unavailable");let i,o;return new Promise(((a,s)=>{const l=function(e="",t=20){return`${e}${Math.floor(Math.random()*Math.pow(10,t))}`}();r.port1.start();const u=setTimeout((()=>{s(new Error("unsupported_event"))}),n);o={messageChannel:r,onMessage(e){const t=e;if(t.data.eventId===l)switch(t.data.status){case"ack":clearTimeout(u),i=setTimeout((()=>{s(new Error("timeout"))}),3e3);break;case"done":clearTimeout(i),a(t.data.response);break;default:clearTimeout(u),clearTimeout(i),s(new Error("invalid_response"))}}},this.handlers.add(o),r.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[r.port2])})).finally((()=>{o&&this.removeMessageHandler(o)}))}}function Jt(){return window}function en(){return void 0!==Jt().WorkerGlobalScope&&"function"==typeof Jt().importScripts}const tn="firebaseLocalStorageDb",nn="firebaseLocalStorage",rn="fbase_key";class on{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 an(e,t){return e.transaction([nn],t?"readwrite":"readonly").objectStore(nn)}function sn(){const e=indexedDB.open(tn,1);return new Promise(((t,n)=>{e.addEventListener("error",(()=>{n(e.error)})),e.addEventListener("upgradeneeded",(()=>{const t=e.result;try{t.createObjectStore(nn,{keyPath:rn})}catch(e){n(e)}})),e.addEventListener("success",(async()=>{const n=e.result;if(!n.objectStoreNames.contains(nn))return await function(){const e=indexedDB.deleteDatabase(tn);return new on(e).toPromise()}(),sn();t(n)}))}))}async function ln(e,t,n){const r=an(e,!0).put({[rn]:t,value:n});return new on(r).toPromise()}function un(e,t){const n=an(e,!0).delete(t);return new on(n).toPromise()}class cn{constructor(){this.type="LOCAL",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 sn()),this.db}async _withRetries(e){let t=0;for(;;)try{const 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 en()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Yt._getInstance(en()?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 async function(){if(!(null===navigator||void 0===navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(e){return null}}(),!this.activeServiceWorker)return;this.sender=new Xt(this.activeServiceWorker);const 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?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(t){}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await sn();return await ln(e,Ht,"1"),await un(e,Ht),!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=>ln(n,e,t))),this.localCache[e]=t,this.notifyServiceWorker(e))))}async _get(e){const t=await this._withRetries((t=>async function(e,t){const n=an(e,!1).get(t),r=await new on(n).toPromise();return void 0===r?null:r.value}(t,e)));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite((async()=>(await this._withRetries((t=>un(t,e))),delete this.localCache[e],this.notifyServiceWorker(e))))}async _poll(){const e=await this._withRetries((e=>{const t=an(e,!1).getAll();return new on(t).toPromise()}));if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;for(const{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(const 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;const n=this.listeners[e];if(n)for(const 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()}}cn.type="LOCAL";const dn=cn;class hn{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 pn(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var n;if(e.error&&!pn(e)){const r=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(w(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const 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(fn(e))}saveEventToCache(e){this.cachedEventUids.add(fn(e)),this.lastProcessedEventTime=Date.now()}}function fn(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter((e=>e)).join("-")}function pn({type:e,error:t}){return"unknown"===e&&"auth/no-auth-event"===(null==t?void 0:t.code)}function mn(e){return`${e||""}${Math.floor(1e9*Math.random())}`}const gn=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,vn=/^https?/;function yn(e){const t=k(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const 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(!vn.test(n))return!1;if(gn.test(e))return r===e;const i=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}function bn(e){return new Promise(((t,n)=>{const r=document.createElement("script");var i,o;r.setAttribute("src",e),r.onload=t,r.onerror=n,r.type="text/javascript",r.charset="UTF-8",(null!==(o=null===(i=document.getElementsByTagName("head"))||void 0===i?void 0:i[0])&&void 0!==o?o:document).appendChild(r)}))}function wn(e){return`__${e}${Math.floor(1e6*Math.random())}`}const En=new N(3e4,6e4);function _n(){const e=Jt().___jsl;if(null==e?void 0:e.H)for(const 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{var r,i,o;function a(){_n(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{_n(),n(w(e,"network-request-failed"))},timeout:En.get()})}if(null===(i=null===(r=Jt().gapi)||void 0===r?void 0:r.iframes)||void 0===i?void 0:i.Iframe)t(gapi.iframes.getContext());else{if(!(null===(o=Jt().gapi)||void 0===o?void 0:o.load)){const t=wn("iframefcb");return Jt()[t]=()=>{gapi.load?a():n(w(e,"network-request-failed"))},bn(`https://apis.google.com/js/api.js?onload=${t}`)}a()}})).catch((e=>{throw Cn=null,e}))}(e),Cn}const xn=new N(5e3,15e3),Tn={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"}},In=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function kn(e){const t=e.config;_(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?A(t,"emulator/auth/iframe"):`https://${e.config.authDomain}/__/auth/iframe`,o={apiKey:t.apiKey,appName:e.name,v:r.Jn},a=In.get(e.config.apiHost);a&&(o.eid=a);const s=e._getFrameworks();return s.length&&(o.fw=s.join(",")),`${n}?${(0,i.xO)(o).slice(1)}`}class On extends Kt{constructor(){super(window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}On.type="SESSION";const Pn=On,Nn={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class An{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}function Dn(e,t){return t?T(t):(_(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}class Rn extends Ce{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return ke(e,this._buildIdpRequest())}_linkToIdToken(e,t){return ke(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return ke(e,this._buildIdpRequest())}_buildIdpRequest(e){const 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 Mn(e){return tt(e.auth,new Rn(e),e.bypassAuthState)}function Ln(e){const{auth:t,user:n}=e;return _(n,t,"internal-error"),et(n,new Rn(e),e.bypassAuthState)}async function jn(e){const{auth:t,user:n}=e;return _(n,t,"internal-error"),Xe(n,new Rn(e),e.bypassAuthState)}class Fn{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){const{urlResponse:t,sessionId:n,postBody:r,tenantId:i,error:o,type:a}=e;if(o)return void this.reject(o);const s={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(a)(s))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Mn;case"linkViaPopup":case"linkViaRedirect":return jn;case"reauthViaPopup":case"reauthViaRedirect":return Ln;default:b(this.auth,"internal-error")}}resolve(e){S(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){S(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const Wn=new Map;class Bn extends Fn{constructor(e,t,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,n),this.eventId=null}async execute(){let e=Wn.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=Vn(t),r="true"===await Un(e)._get(n);return await Un(e)._remove(n),r}(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}Wn.set(this.auth._key(),e)}return e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}async function zn(e,t){return Un(e)._set(Vn(t),"true")}function Un(e){return T(e._redirectPersistence)}function Vn(e){return ie("pendingRedirect",e.config.apiKey,e.name)}function Zn(e,t,n){return async function(e,t,n){const r=ye(e);_(t instanceof Me,e,"argument-error");const i=Dn(r,n);return await zn(i,r),i._openRedirect(r,t,"signInViaRedirect")}(e,t,n)}function $n(e,t,n){return async function(e,t,n){const r=(0,i.m9)(e);_(t instanceof Me,r.auth,"argument-error");const o=Dn(r.auth,n);await zn(o,r.auth);const a=await Gn(r);return o._openRedirect(r.auth,t,"reauthViaRedirect",a)}(e,t,n)}function qn(e,t,n){return async function(e,t,n){const r=(0,i.m9)(e);_(t instanceof Me,r.auth,"argument-error");const o=Dn(r.auth,n);await Je(!1,r,t.providerId),await zn(o,r.auth);const a=await Gn(r);return o._openRedirect(r.auth,t,"linkViaRedirect",a)}(e,t,n)}async function Hn(e,t){return await ye(e)._initializationPromise,Kn(e,t,!1)}async function Kn(e,t,n=!1){const r=ye(e),i=Dn(r,t),o=new Bn(r,i,n),a=await o.execute();return a&&!n&&(delete a.user._redirectEventId,await r._persistUserIfCurrent(a.user),await r._setRedirectUser(null,t)),a}async function Gn(e){const t=mn(`${e.uid}:::`);return e._redirectEventId=t,await e.auth._setRedirectUser(e),await e.auth._persistUserIfCurrent(e),t}function Qn(e,t,n,o,a,s){_(e.config.authDomain,e,"auth-domain-config-required"),_(e.config.apiKey,e,"invalid-api-key");const l={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:o,v:r.Jn,eventId:a};if(t instanceof Me){t.setDefaultLanguage(e.languageCode),l.providerId=t.providerId||"",(0,i.xb)(t.getCustomParameters())||(l.customParameters=JSON.stringify(t.getCustomParameters()));for(const[e,t]of Object.entries(s||{}))l[e]=t}if(t instanceof Le){const e=t.getScopes().filter((e=>""!==e));e.length>0&&(l.scopes=e.join(","))}e.tenantId&&(l.tid=e.tenantId);const u=l;for(const e of Object.keys(u))void 0===u[e]&&delete u[e];return`${function({config:e}){return e.emulator?A(e,"emulator/auth/handler"):`https://${e.authDomain}/__/auth/handler`}(e)}?${(0,i.xO)(u).slice(1)}`}const Yn="webStorageSupport",Xn=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Pn,this._completeRedirectFn=Kn}async _openPopup(e,t,n,r){var o;return S(null===(o=this.eventManagers[e._key()])||void 0===o?void 0:o.manager,"_initialize() not called before _openPopup()"),function(e,t,n,r=500,o=600){const a=Math.min((window.screen.availHeight-o)/2,0).toString(),s=Math.min((window.screen.availWidth-r)/2,0).toString();let l="";const u=Object.assign(Object.assign({},Nn),{width:r.toString(),height:o.toString(),top:a,left:s}),c=(0,i.z$)().toLowerCase();n&&(l=ue(c)?"_blank":n),se(c)&&(t=t||"http://localhost",u.scrollbars="yes");const d=Object.entries(u).reduce(((e,[t,n])=>`${e}${t}=${n},`),"");if(function(e=(0,i.z$)()){var t;return pe(e)&&!!(null===(t=window.navigator)||void 0===t?void 0:t.standalone)}(c)&&"_self"!==l)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const 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||"",l),new An(null);const h=window.open(t||"",l,d);_(h,e,"popup-blocked");try{h.focus()}catch(e){}return new An(h)}(e,Qn(e,t,n,k(),r),mn())}async _openRedirect(e,t,n,r){var i;return await this._originValidation(e),i=Qn(e,t,n,k(),r),Jt().location.href=i,new Promise((()=>{}))}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(S(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n}async initAndGetManager(e){const t=await async function(e){const t=await Sn(e),n=Jt().gapi;return _(n,e,"internal-error"),t.open({where:document.body,url:kn(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Tn,dontclear:!0},(t=>new Promise((async(n,r)=>{await t.restyle({setHideOnLeave:!1});const i=w(e,"network-request-failed"),o=Jt().setTimeout((()=>{r(i)}),xn.get());function a(){Jt().clearTimeout(o),n(t)}t.ping(a).then(a,(()=>{r(i)}))}))))}(e),n=new hn(e);return t.register("authEvent",(t=>(_(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(Yn,{type:Yn},(n=>{var r;const i=null===(r=null==n?void 0:n[0])||void 0===r?void 0:r.webStorageSupport;void 0!==i&&t(!!i),b(e,"internal-error")}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=async function(e){if(e.config.emulator)return;const{authorizedDomains:t}=await async function(e){return j(e,"GET","/v1/projects",{})}(e);for(const e of t)try{if(yn(e))return}catch(e){}b(e,"unauthorized-domain")}(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return me()||le()||pe()}},Jn=1e12;class er{constructor(e){this.auth=e,this.counter=Jn,this._widgets=new Map}render(e,t){const n=this.counter;return this._widgets.set(n,new tr(e,this.auth.name,t||{})),this.counter++,n}reset(e){var t;const n=e||Jn;null===(t=this._widgets.get(n))||void 0===t||t.delete(),this._widgets.delete(n)}getResponse(e){var t;const n=e||Jn;return(null===(t=this._widgets.get(n))||void 0===t?void 0:t.getResponse())||""}async execute(e){var t;const n=e||Jn;return null===(t=this._widgets.get(n))||void 0===t||t.execute(),""}}class tr{constructor(e,t,n){this.params=n,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};const r="string"==typeof e?document.getElementById(e):e;_(r,"argument-error",{appName:t}),this.container=r,this.isVisible="invisible"!==this.params.size,this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)}getResponse(){return this.checkIfDeleted(),this.responseToken}delete(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)}execute(){this.checkIfDeleted(),this.timerId||(this.timerId=window.setTimeout((()=>{this.responseToken=function(e){const t=[],n="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let e=0;e<50;e++)t.push(n.charAt(Math.floor(Math.random()*n.length)));return t.join("")}();const{callback:e,"expired-callback":t}=this.params;if(e)try{e(this.responseToken)}catch(e){}this.timerId=window.setTimeout((()=>{if(this.timerId=null,this.responseToken=null,t)try{t()}catch(e){}this.isVisible&&this.execute()}),6e4)}),500))}checkIfDeleted(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}}const nr=wn("rcb"),rr=new N(3e4,6e4);class ir{constructor(){this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!Jt().grecaptcha}load(e,t=""){return _(function(e){return e.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(e)}(t),e,"argument-error"),this.shouldResolveImmediately(t)?Promise.resolve(Jt().grecaptcha):new Promise(((n,r)=>{const o=Jt().setTimeout((()=>{r(w(e,"network-request-failed"))}),rr.get());Jt()[nr]=()=>{Jt().clearTimeout(o),delete Jt()[nr];const i=Jt().grecaptcha;if(!i)return void r(w(e,"internal-error"));const a=i.render;i.render=(e,t)=>{const n=a(e,t);return this.counter++,n},this.hostLanguage=t,n(i)},bn(`https://www.google.com/recaptcha/api.js??${(0,i.xO)({onload:nr,render:"explicit",hl:t})}`).catch((()=>{clearTimeout(o),r(w(e,"internal-error"))}))}))}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){return!!Jt().grecaptcha&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}}class or{async load(e){return new er(e)}clearedOneInstance(){}}const ar="recaptcha",sr={theme:"light",type:"image"};class lr{constructor(e,t=Object.assign({},sr),n){this.parameters=t,this.type=ar,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=ye(n),this.isInvisible="invisible"===this.parameters.size,_("undefined"!=typeof document,this.auth,"operation-not-supported-in-this-environment");const r="string"==typeof e?document.getElementById(e):e;_(r,this.auth,"argument-error"),this.container=r,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new or:new ir,this.validateStartingState()}async verify(){this.assertNotDestroyed();const e=await this.render(),t=this.getAssertedRecaptcha();return t.getResponse(e)||new Promise((n=>{const r=e=>{e&&(this.tokenChangeListeners.delete(r),n(e))};this.tokenChangeListeners.add(r),this.isInvisible&&t.execute(e)}))}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise||(this.renderPromise=this.makeRenderPromise().catch((e=>{throw this.renderPromise=null,e}))),this.renderPromise}_reset(){this.assertNotDestroyed(),null!==this.widgetId&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEach((e=>{this.container.removeChild(e)}))}validateStartingState(){_(!this.parameters.sitekey,this.auth,"argument-error"),_(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),_("undefined"!=typeof document,this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return t=>{if(this.tokenChangeListeners.forEach((e=>e(t))),"function"==typeof e)e(t);else if("string"==typeof e){const n=Jt()[e];"function"==typeof n&&n(t)}}}assertNotDestroyed(){_(!this.destroyed,this.auth,"internal-error")}async makeRenderPromise(){if(await this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){const t=document.createElement("div");e.appendChild(t),e=t}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId}async init(){_(O()&&!en(),this.auth,"internal-error"),await function(){let e=null;return new Promise((t=>{"complete"!==document.readyState?(e=()=>t(),window.addEventListener("load",e)):t()})).catch((t=>{throw e&&window.removeEventListener("load",e),t}))}(),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);const e=await async function(e){return(await j(e,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""}(this.auth);_(e,this.auth,"internal-error"),this.parameters.sitekey=e}getAssertedRecaptcha(){return _(this.recaptcha,this.auth,"internal-error"),this.recaptcha}}class ur{constructor(e,t){this.verificationId=e,this.onConfirmation=t}confirm(e){const t=Ne._fromVerification(this.verificationId,e);return this.onConfirmation(t)}}async function cr(e,t,n){const r=ye(e),o=await fr(r,t,(0,i.m9)(n));return new ur(o,(e=>nt(r,e)))}async function dr(e,t,n){const r=(0,i.m9)(e);await Je(!1,r,"phone");const o=await fr(r.auth,t,(0,i.m9)(n));return new ur(o,(e=>rt(r,e)))}async function hr(e,t,n){const r=(0,i.m9)(e),o=await fr(r.auth,t,(0,i.m9)(n));return new ur(o,(e=>it(r,e)))}async function fr(e,t,n){var r;const i=await n.verify();try{let o;if(_("string"==typeof i,e,"argument-error"),_(n.type===ar,e,"argument-error"),o="string"==typeof t?{phoneNumber:t}:t,"session"in o){const t=o.session;if("phoneNumber"in o)return _("enroll"===t.type,e,"internal-error"),(await function(e,t){return j(e,"POST","/v2/accounts/mfaEnrollment:start",Object.assign({tenantId:e.tenantId},t))}(e,{idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:o.phoneNumber,recaptchaToken:i}})).phoneSessionInfo.sessionInfo;{_("signin"===t.type,e,"internal-error");const n=(null===(r=o.multiFactorHint)||void 0===r?void 0:r.uid)||o.multiFactorUid;return _(n,e,"missing-multi-factor-info"),(await function(e,t){return j(e,"POST","/v2/accounts/mfaSignIn:start",Object.assign({tenantId:e.tenantId},t))}(e,{mfaPendingCredential:t.credential,mfaEnrollmentId:n,phoneSignInInfo:{recaptchaToken:i}})).phoneResponseInfo.sessionInfo}}{const{sessionInfo:t}=await async function(e,t){return j(e,"POST","/v1/accounts:sendVerificationCode",L(e,t))}(e,{phoneNumber:o.phoneNumber,recaptchaToken:i});return t}}finally{n._reset()}}async function pr(e,t){await Xe((0,i.m9)(e),t)}class mr{constructor(e){this.providerId=mr.PROVIDER_ID,this.auth=ye(e)}verifyPhoneNumber(e,t){return fr(this.auth,e,(0,i.m9)(t))}static credential(e,t){return Ne._fromVerification(e,t)}static credentialFromResult(e){const t=e;return mr.credentialFromTaggedObject(t)}static credentialFromError(e){return mr.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{phoneNumber:t,temporaryProof:n}=e;return t&&n?Ne._fromTokenResponse(t,n):null}}mr.PROVIDER_ID="phone",mr.PHONE_SIGN_IN_METHOD="phone";const gr=new N(2e3,1e4);async function vr(e,t,n){const r=ye(e);_(t instanceof Me,e,"argument-error");const i=Dn(r,n);return new wr(r,"signInViaPopup",t,i).executeNotNull()}async function yr(e,t,n){const r=(0,i.m9)(e);_(t instanceof Me,r.auth,"argument-error");const o=Dn(r.auth,n);return new wr(r.auth,"reauthViaPopup",t,o,r).executeNotNull()}async function br(e,t,n){const r=(0,i.m9)(e);_(t instanceof Me,r.auth,"argument-error");const o=Dn(r.auth,n);return new wr(r.auth,"linkViaPopup",t,o,r).executeNotNull()}class wr extends Fn{constructor(e,t,n,r,i){super(e,t,r,i),this.provider=n,this.authWindow=null,this.pollId=null,wr.currentPopupAction&&wr.currentPopupAction.cancel(),wr.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return _(e,this.auth,"internal-error"),e}async onExecution(){S(1===this.filter.length,"Popup operations only handle one event");const e=mn();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(w(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(w(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,wr.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,n;(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(w(this.auth,"popup-closed-by-user"))}),2e3):this.pollId=window.setTimeout(e,gr.get())};e()}}wr.currentPopupAction=null;class Er extends class{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 C("unexpected MultiFactorSessionType")}}}{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new Er(e)}_finalizeEnroll(e,t,n){return function(e,t){return j(e,"POST","/v2/accounts/mfaEnrollment:finalize",Object.assign({tenantId:e.tenantId},t))}(e,{idToken:t,displayName:n,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(e,t){return function(e,t){return j(e,"POST","/v2/accounts/mfaSignIn:finalize",Object.assign({tenantId:e.tenantId},t))}(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()})}}class _r{constructor(){}static assertion(e){return Er._fromCredential(e)}}function Cr(e=(0,r.Mq)()){const t=(0,r.qX)(e,"auth-exp");return t.isInitialized()?t.getImmediate():I(e,{popupRedirectResolver:Xn,persistence:[dn,Qt]})}var Sr;Sr="Browser",(0,r.Xd)(new d("auth-exp",((e,{options:t})=>{const n=e.getProvider("app-exp").getImmediate(),{apiKey:r,authDomain:i}=n.options;return(e=>{_(r&&!r.includes(":"),"invalid-api-key",{appName:e.name}),_(!(null==i?void 0:i.includes(":")),"argument-error",{appName:e.name});const n={apiKey:r,authDomain:i,clientPlatform:Sr,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:ge(Sr)},o=new ve(e,n);return function(e,t){const n=(null==t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(T);(null==t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null==t?void 0:t.popupRedirectResolver)}(o,t),o})(n)}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback(((e,t,n)=>{e.getProvider("auth-internal").initialize()}))),(0,r.Xd)(new d("auth-internal",(e=>{return t=ye(e.getProvider("auth-exp").getImmediate()),new qt(t);var t}),"PRIVATE").setInstantiationMode("EXPLICIT")),(0,r.KN)("@firebase/auth-exp","0.0.900-exp.d92a36260",void 0)},7212:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AbstractUserDataWriter:()=>yf,Bytes:()=>fh,CACHE_SIZE_UNLIMITED:()=>Kd,CollectionReference:()=>Wd,DocumentReference:()=>jd,DocumentSnapshot:()=>qh,FieldPath:()=>dh,FieldValue:()=>ph,FirebaseFirestore:()=>Gd,FirestoreError:()=>_r,GeoPoint:()=>mh,LoadBundleTask:()=>Hd,Query:()=>Fd,QueryConstraint:()=>Xh,QueryDocumentSnapshot:()=>Hh,QuerySnapshot:()=>Kh,SnapshotMetadata:()=>$h,Timestamp:()=>Fr,Transaction:()=>Ff,WriteBatch:()=>Ef,addDoc:()=>Df,arrayRemove:()=>Vf,arrayUnion:()=>Uf,clearIndexedDbPersistence:()=>rh,collection:()=>Bd,collectionGroup:()=>zd,deleteDoc:()=>Af,deleteField:()=>Bf,disableNetwork:()=>ah,doc:()=>Ud,documentId:()=>hh,enableIndexedDbPersistence:()=>eh,enableMultiTabIndexedDbPersistence:()=>th,enableNetwork:()=>oh,endAt:()=>ff,endBefore:()=>hf,ensureFirestoreConfigured:()=>Xd,executeWrite:()=>Lf,getDoc:()=>Cf,getDocFromCache:()=>xf,getDocFromServer:()=>Tf,getDocs:()=>If,getDocsFromCache:()=>kf,getDocsFromServer:()=>Of,getFirestore:()=>Yd,increment:()=>Zf,initializeFirestore:()=>Qd,limit:()=>af,limitToLast:()=>sf,loadBundle:()=>lh,namedQuery:()=>uh,onSnapshot:()=>Rf,onSnapshotsInSync:()=>Mf,orderBy:()=>rf,query:()=>Jh,queryEqual:()=>Zd,refEqual:()=>Vd,runTransaction:()=>Wf,serverTimestamp:()=>zf,setDoc:()=>Pf,setLogLevel:()=>xr,snapshotEqual:()=>Qh,startAfter:()=>cf,startAt:()=>uf,terminate:()=>sh,updateDoc:()=>Nf,useFirestoreEmulator:()=>Ld,waitForPendingWrites:()=>ih,where:()=>tf,writeBatch:()=>$f});var r=n(3198),i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function s(e,t){for(var n=0,r=t.length,i=e.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var m,g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},v=v||{},y=g||self;function b(){}function w(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 E(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var _="closure_uid_"+(1e9*Math.random()>>>0),C=0;function S(e,t,n){return e.call.apply(e.bind,arguments)}function x(e,t,n){if(!e)throw Error();if(2t?1:0}e:{var B=y.navigator;if(B){var z=B.userAgent;if(z){L=z;break e}}L=""}function U(e,t,n){for(var r in e)t.call(n,e[r],r,e)}function V(e){var t={};for(var n in e)t[n]=e[n];return t}var Z="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function $(e,t){for(var n,r,i=1;iparseFloat(ne)){H=String(ie);break e}}H=ne}var oe,ae={};function se(e){return function(e,t){var n=ae;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t()}(e,(function(){for(var t=0,n=j(String(H)).split("."),r=j(String(e)).split("."),i=Math.max(n.length,r.length),o=0;0==t&&o=e.keyCode)&&(e.keyCode=-1)}catch(e){}};var me="closure_listenable_"+(1e6*Math.random()|0),ge=0;function ve(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.ca=i,this.key=++ge,this.Y=this.Z=!1}function ye(e){e.Y=!0,e.listener=null,e.proxy=null,e.src=null,e.ca=null}function be(e){this.src=e,this.a={},this.b=0}function we(e,t){var n=t.type;if(n in e.a){var r,i=e.a[n],o=N(i,t);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(ye(t),0==e.a[n].length&&(delete e.a[n],e.b--))}}function Ee(e,t,n,r){for(var i=0;i>>0);function Re(e){return"function"==typeof e?e:(e[De]||(e[De]=function(t){return e.handleEvent(t)}),e[De])}function Me(){P.call(this),this.c=new be(this),this.J=this,this.C=null}function Le(e,t){var n,r=e.C;if(r)for(n=[];r;r=r.C)n.push(r);if(e=e.J,r=t.type||t,"string"==typeof t)t=new he(t,e);else if(t instanceof he)t.target=t.target||e;else{var i=t;$(t=new he(r,e),i)}if(i=!0,n)for(var o=n.length-1;0<=o;o--){var a=t.a=n[o];i=je(a,r,!0,t)&&i}if(i=je(a=t.a=e,r,!0,t)&&i,i=je(a,r,!1,t)&&i,n)for(o=0;ot.b&&(t.b++,e.next=t.a,t.a=e)}qe=!1}function Ge(e,t){Me.call(this),this.b=e||1,this.a=t||y,this.f=T(this.Za,this),this.g=k()}function Qe(e){e.aa=!1,e.M&&(e.a.clearTimeout(e.M),e.M=null)}function Ye(e,t,n){if("function"==typeof e)n&&(e=T(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=T(e.handleEvent,e)}return 2147483647r.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 a=1;at.length?kt:(t=t.substr(r,n),e.D=r+n,t))}function Dt(e){e.T=k()+e.P,Rt(e,e.P)}function Rt(e,t){if(null!=e.o)throw Error("WatchDog timer not null");e.o=pt(T(e.Va,e),t)}function Mt(e){e.o&&(y.clearTimeout(e.o),e.o=null)}function Lt(e){0==e.g.v||e.A||er(e.g,e)}function jt(e){Mt(e);var t=e.F;t&&"function"==typeof t.ja&&t.ja(),e.F=null,Qe(e.R),rt(e.J),e.a&&(t=e.a,e.a=null,t.abort(),t.ja())}function Ft(e,t){try{var n=e.g;if(0!=n.v&&(n.a==e||yn(n.b,e)))if(n.I=e.N,!e.C&&yn(n.b,e)&&3==n.v){try{var r=n.ka.a.parse(t)}catch(e){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){e:if(!n.j){if(n.a){if(!(n.a.u+3e3i[2]&&n.H&&0==n.o&&!n.m&&(n.m=pt(T(n.Sa,n),6e3));if(1>=vn(n.b)&&n.ea){try{n.ea()}catch(e){}n.ea=void 0}}else nr(n,11)}else if((e.C||n.a==e)&&Jn(n),!M(t))for(t=r=n.ka.a.parse(t),r=0;rt||3==t&&!X&&!this.a.$())){this.A||4!=t||7==n||ct(8==n||0>=r?3:2),Mt(this);var i=this.a.W();this.N=i;var o=this.a.$();if(this.b=200==i,function(e,t,n,r,i,o,a){e.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+t+"\n"+n+"\n"+o+" "+a}))}(this.c,this.m,this.l,this.f,this.S,t,i),this.b){if(this.U&&!this.C){t:{if(this.a){var a,s=this.a;if((a=s.a?s.a.getResponseHeader("X-HTTP-Initial-Response"):null)&&!M(a)){var l=a;break t}}l=null}if(!l){this.b=!1,this.h=3,ht(12),jt(this),Lt(this);break e}ot(this.c,this.f,l,"Initial handshake response via X-HTTP-Initial-Response"),this.C=!0,Ft(this,l)}this.I?(Nt(this,t,o),X&&this.b&&3==t&&(nt(this.J,this.R,"tick",this.Wa),this.R.start())):(ot(this.c,this.f,o,null),Ft(this,o)),4==t&&jt(this),this.b&&!this.A&&(4==t?er(this.g,this):(this.b=!1,Dt(this)))}else 400==i&&0t)throw Error("Bad port number "+t);e.h=t}else e.h=null}function Gt(e,t,n){t instanceof sn?(e.b=t,function(e,t){t&&!e.f&&(ln(e),e.c=null,e.a.forEach((function(e,t){var n=t.toLowerCase();t!=n&&(un(this,t),dn(this,n,e))}),e)),e.f=t}(e.b,e.a)):(n||(t=Jt(t,on)),e.b=new sn(t,e.a))}function Qt(e,t,n){e.b.set(t,n)}function Yt(e){return Qt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^k()).toString(36)),e}function Xt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Jt(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,en),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function en(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}Zt.prototype.toString=function(){var e=[],t=this.f;t&&e.push(Jt(t,tn,!0),":");var n=this.c;return(n||"file"==t)&&(e.push("//"),(t=this.j)&&e.push(Jt(t,tn,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.h)&&e.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&e.push("/"),e.push(Jt(n,"/"==n.charAt(0)?rn:nn,!0))),(n=this.b.toString())&&e.push("?",n),(n=this.i)&&e.push("#",Jt(n,an)),e.join("")};var tn=/[#\/\?@]/g,nn=/[#\?:]/g,rn=/[#\?]/g,on=/[#\?@]/g,an=/#/g;function sn(e,t){this.b=this.a=null,this.c=e||null,this.f=!!t}function ln(e){e.a||(e.a=new Bt,e.b=0,e.c&&function(e,t){if(e){e=e.split("&");for(var n=0;n2*e.c&&zt(e)))}function cn(e,t){return ln(e),t=hn(e,t),Ut(e.a.b,t)}function dn(e,t,n){un(e,t),0=e.f}function vn(e){return e.b?1:e.a?e.a.size:0}function yn(e,t){return e.b?e.b==t:!!e.a&&e.a.has(t)}function bn(e,t){e.a?e.a.add(t):e.b=t}function wn(e,t){e.b&&e.b==t?e.b=null:e.a&&e.a.has(t)&&e.a.delete(t)}function En(e){var t,n;if(null!=e.b)return e.c.concat(e.b.s);if(null!=e.a&&0!==e.a.size){var r=e.c;try{for(var i=p(e.a.values()),o=i.next();!o.done;o=i.next()){var a=o.value;r=r.concat(a.s)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}return R(e.c)}function _n(){}function Cn(){this.a=new _n}function Sn(e,t,n){var r=n||"";try{Wt(e,(function(e,n){var i=e;E(e)&&(i=Fe(e)),t.push(r+n+"="+encodeURIComponent(i))}))}catch(e){throw t.push(r+"type="+encodeURIComponent("_badmap")),e}}function xn(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch(e){}}pn.prototype.cancel=function(){var e,t;if(this.c=En(this),this.b)this.b.cancel(),this.b=null;else if(this.a&&0!==this.a.size){try{for(var n=p(this.a.values()),r=n.next();!r.done;r=n.next())r.value.cancel()}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.a.clear()}},_n.prototype.stringify=function(e){return y.JSON.stringify(e,void 0)},_n.prototype.parse=function(e){return y.JSON.parse(e,void 0)};var Tn=y.JSON.parse;function In(e){Me.call(this),this.headers=new Bt,this.H=e||null,this.b=!1,this.s=this.a=null,this.B="",this.h=0,this.f="",this.g=this.A=this.l=this.u=!1,this.o=0,this.m=null,this.I=kn,this.D=this.F=!1}O(In,Me);var kn="",On=/^https?$/i,Pn=["POST","PUT"];function Nn(e){return"content-type"==e.toLowerCase()}function An(e,t){e.b=!1,e.a&&(e.g=!0,e.a.abort(),e.g=!1),e.f=t,e.h=5,Dn(e),Mn(e)}function Dn(e){e.u||(e.u=!0,Le(e,"complete"),Le(e,"error"))}function Rn(e){if(e.b&&void 0!==v&&(!e.s[1]||4!=jn(e)||2!=e.W()))if(e.l&&4==jn(e))Ye(e.za,0,e);else if(Le(e,"readystatechange"),4==jn(e)){e.b=!1;try{var t,n=e.W();e:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break e;default:r=!1}if(!(t=r)){var i;if(i=0===n){var o=String(e.B).match(Vt)[1]||null;if(!o&&y.self&&y.self.location){var a=y.self.location.protocol;o=a.substr(0,a.length-1)}i=!On.test(o?o.toLowerCase():"")}t=i}if(t)Le(e,"complete"),Le(e,"success");else{e.h=6;try{var s=2(u-=o))o=Math.max(0,i[l].b-100),s=!1;else try{Sn(c,a,"req"+u+"_")}catch(e){r&&r(c)}}if(s){r=a.join("&");break e}}return e=e.g.splice(0,n),t.s=e,r}function Gn(e){e.a||e.j||(e.T=1,$e(e.Aa,e),e.o=0)}function Qn(e){return!(e.a||e.j||3<=e.o||(e.T++,e.j=pt(T(e.Aa,e),tr(e,e.o)),e.o++,0))}function Yn(e){null!=e.s&&(y.clearTimeout(e.s),e.s=null)}function Xn(e){e.a=new xt(e,e.c,"rpc",e.T),null===e.i&&(e.a.B=e.l),e.a.O=0;var t=$t(e.la);Qt(t,"RID","rpc"),Qt(t,"SID",e.J),Qt(t,"CI",e.H?"0":"1"),Qt(t,"AID",e.P),Hn(e,t),Qt(t,"TYPE","xmlhttp"),e.i&&e.l&&Fn(t,e.i,e.l),e.D&&e.a.setTimeout(e.D);var n=e.a;e=e.ga,n.H=1,n.i=Yt($t(t)),n.j=null,n.I=!0,Pt(n,e)}function Jn(e){null!=e.m&&(y.clearTimeout(e.m),e.m=null)}function er(e,t){var n=null;if(e.a==t){Jn(e),Yn(e),e.a=null;var r=2}else{if(!yn(e.b,t))return;n=t.s,wn(e.b,t),r=1}if(e.I=t.N,0!=e.v)if(t.b)if(1==r){n=t.j?t.j.length:0,t=k()-t.u;var i=e.u;Le(r=lt(),new ft(r,n,t,i)),$n(e)}else Gn(e);else if(3==(i=t.h)||0==i&&0=e.b.f-(e.h?1:0)||(e.h?(e.g=t.s.concat(e.g),0):1==e.v||2==e.v||e.u>=(e.La?0:e.Ma)||(e.h=pt(T(e.Ba,e,t),tr(e,e.u)),e.u++,0)))}(e,t)||2==r&&Qn(e)))switch(n&&0t?null:"string"==typeof e?e.charAt(t):e[t]}(i.L()),n=y.FormData&&e instanceof y.FormData,!(0<=N(Pn,t))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),i.forEach((function(e,t){this.a.setRequestHeader(t,e)}),this),this.I&&(this.a.responseType=this.I),"withCredentials"in this.a&&this.a.withCredentials!==this.F&&(this.a.withCredentials=this.F);try{Ln(this),0=this.N)){var e=2*this.N;this.c.info("BP detection timer enabled: "+e),this.s=pt(T(this.Ta,this),e)}},m.Ta=function(){this.s&&(this.s=null,this.c.info("BP detection timeout reached."),this.c.info("Buffering proxy detected and switch to long-polling!"),this.H=!1,this.F=!0,ht(10),Un(this),Xn(this))},m.Sa=function(){null!=this.m&&(this.m=null,Un(this),Qn(this),ht(19))},m.Ya=function(e){e?(this.c.info("Successfully pinged google.com"),ht(2)):(this.c.info("Failed to ping google.com"),ht(1))},(m=ar.prototype).ta=function(){},m.sa=function(){},m.ra=function(){},m.qa=function(){},m.Ja=function(){},sr.prototype.a=function(e,t){return new lr(e,t)},O(lr,Me),lr.prototype.g=function(){this.a.f=this.f,this.m&&(this.a.C=!0);var e=this.a,t=this.o,n=this.b||void 0;ht(0),e.fa=t,e.V=n||{},e.H=e.S,e.B=ir(e,null,e.fa),$n(e)},lr.prototype.close=function(){zn(this.a)},lr.prototype.h=function(e){if("string"==typeof e){var t={};t.__data__=e,Zn(this.a,t)}else this.l?((t={}).__data__=Fe(e),Zn(this.a,t)):Zn(this.a,e)},lr.prototype.G=function(){this.a.f=null,delete this.f,zn(this.a),delete this.a,lr.X.G.call(this)},O(ur,_t),O(cr,Ct),O(dr,ar),dr.prototype.ta=function(){Le(this.a,"a")},dr.prototype.sa=function(e){Le(this.a,new ur(e))},dr.prototype.ra=function(e){Le(this.a,new cr(e))},dr.prototype.qa=function(){Le(this.a,"b")},sr.prototype.createWebChannel=sr.prototype.a,lr.prototype.send=lr.prototype.h,lr.prototype.open=lr.prototype.g,lr.prototype.close=lr.prototype.close,mt.NO_ERROR=0,mt.TIMEOUT=8,mt.HTTP_ERROR=6,gt.COMPLETE="complete",bt.EventType=Et,Et.OPEN="a",Et.CLOSE="b",Et.ERROR="c",Et.MESSAGE="d",Me.prototype.listen=Me.prototype.va,In.prototype.listenOnce=In.prototype.wa,In.prototype.getLastError=In.prototype.Qa,In.prototype.getLastErrorCode=In.prototype.ua,In.prototype.getStatus=In.prototype.W,In.prototype.getResponseJson=In.prototype.Pa,In.prototype.getResponseText=In.prototype.$,In.prototype.send=In.prototype.ba;var hr=mt,fr=gt,pr=at,mr=10,gr=11,vr=bt,yr=In;let br="8.6.1";class wr{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this.t(e),this.i=e=>t.writeSequenceNumber(e))}t(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.i&&this.i(e),e}}wr.o=-1;const Er={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 _r extends Error{constructor(e,t){super(t),this.code=e,this.message=t,this.name="FirebaseError",this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}const Cr=new h.Yd("@firebase/firestore");function Sr(){return Cr.logLevel}function xr(e){Cr.setLogLevel(e)}function Tr(e,...t){if(Cr.logLevel<=h.in.DEBUG){const n=t.map(Or);Cr.debug(`Firestore (${br}): ${e}`,...n)}}function Ir(e,...t){if(Cr.logLevel<=h.in.ERROR){const n=t.map(Or);Cr.error(`Firestore (${br}): ${e}`,...n)}}function kr(e,...t){if(Cr.logLevel<=h.in.WARN){const n=t.map(Or);Cr.warn(`Firestore (${br}): ${e}`,...n)}}function Or(e){if("string"==typeof e)return e;try{return t=e,JSON.stringify(t)}catch(t){return e}var t}function Pr(e="Unexpected state"){const t=`FIRESTORE (${br}) INTERNAL ASSERTION FAILED: `+e;throw Ir(t),new Error(t)}function Nr(e,t){e||Pr()}function Ar(e,t){return e}function Dr(e){const 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;tt?1:0}function Lr(e,t,n){return e.length===t.length&&e.every(((e,r)=>n(e,t[r])))}function jr(e){return e+"\0"}class Fr{constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new _r(Er.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new _r(Er.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-62135596800)throw new _r(Er.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new _r(Er.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return Fr.fromMillis(Date.now())}static fromDate(e){return Fr.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),n=Math.floor(1e6*(e-1e3*t));return new Fr(t,n)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?Mr(this.nanoseconds,e.nanoseconds):Mr(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(){const e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}class Wr{constructor(e){this.timestamp=e}static fromTimestamp(e){return new Wr(e)}static min(){return new Wr(new Fr(0,0))}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}}function Br(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function zr(e,t){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function Ur(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}class Vr{constructor(e,t,n){void 0===t?t=0:t>e.length&&Pr(),void 0===n?n=e.length-t:n>e.length-t&&Pr(),this.segments=e,this.offset=t,this.len=n}get length(){return this.len}isEqual(e){return 0===Vr.comparator(this,e)}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof Vr?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.lengthi)return 1}return e.lengtht.length?1:0}}class Zr extends Vr{construct(e,t,n){return new Zr(e,t,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}static fromString(...e){const t=[];for(const n of e){if(n.indexOf("//")>=0)throw new _r(Er.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);t.push(...n.split("/").filter((e=>e.length>0)))}return new Zr(t)}static emptyPath(){return new Zr([])}}const $r=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class qr extends Vr{construct(e,t,n){return new qr(e,t,n)}static isValidIdentifier(e){return $r.test(e)}canonicalString(){return this.toArray().map((e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),qr.isValidIdentifier(e)||(e="`"+e+"`"),e))).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&"__name__"===this.get(0)}static keyField(){return new qr(["__name__"])}static fromServerFormat(e){const t=[];let n="",r=0;const i=()=>{if(0===n.length)throw new _r(Er.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(n),n=""};let o=!1;for(;re.isEqual(t)))}}class Kr{constructor(e){this.binaryString=e}static fromBase64String(e){const t=atob(e);return new Kr(t)}static fromUint8Array(e){const t=function(e){let t="";for(let n=0;n=Number.MIN_SAFE_INTEGER}class oi{constructor(e){this.path=e}static fromPath(e){return new oi(Zr.fromString(e))}static fromName(e){return new oi(Zr.fromString(e).popFirst(5))}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}isEqual(e){return null!==e&&0===Zr.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return Zr.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new oi(new Zr(e.slice()))}}function ai(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?Jr(e)?4:10:Pr()}function si(e,t){const n=ai(e);if(n!==ai(t))return!1;switch(n){case 0:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return ti(e).isEqual(ti(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;const n=Qr(e.timestampValue),r=Qr(t.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return function(e,t){return Xr(e.bytesValue).isEqual(Xr(t.bytesValue))}(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return Yr(e.geoPointValue.latitude)===Yr(t.geoPointValue.latitude)&&Yr(e.geoPointValue.longitude)===Yr(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return Yr(e.integerValue)===Yr(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){const n=Yr(e.doubleValue),r=Yr(t.doubleValue);return n===r?ri(n)===ri(r):isNaN(n)&&isNaN(r)}return!1}(e,t);case 9:return Lr(e.arrayValue.values||[],t.arrayValue.values||[],si);case 10:return function(e,t){const n=e.mapValue.fields||{},r=t.mapValue.fields||{};if(Br(n)!==Br(r))return!1;for(const e in n)if(n.hasOwnProperty(e)&&(void 0===r[e]||!si(n[e],r[e])))return!1;return!0}(e,t);default:return Pr()}}function li(e,t){return void 0!==(e.values||[]).find((e=>si(e,t)))}function ui(e,t){const n=ai(e),r=ai(t);if(n!==r)return Mr(n,r);switch(n){case 0:return 0;case 1:return Mr(e.booleanValue,t.booleanValue);case 2:return function(e,t){const n=Yr(e.integerValue||e.doubleValue),r=Yr(t.integerValue||t.doubleValue);return nr?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(e,t);case 3:return ci(e.timestampValue,t.timestampValue);case 4:return ci(ti(e),ti(t));case 5:return Mr(e.stringValue,t.stringValue);case 6:return function(e,t){const n=Xr(e),r=Xr(t);return n.compareTo(r)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){const n=e.split("/"),r=t.split("/");for(let e=0;e{e?this.set(t,e):this.delete(t)}))}delete(e){this.setOverlay(e,null)}isEqual(e){return si(this.buildProto(),e.buildProto())}setOverlay(e,t){let n=this.overlayMap;for(let t=0;t{if(t instanceof Map){const o=this.applyOverlay(e.child(r),t);null!=o&&(i[r]=o,n=!0)}else null!==t?(i[r]=t,n=!0):i.hasOwnProperty(r)&&(delete i[r],n=!0)})),n?{mapValue:{fields:i}}:null}buildProto(){const e=this.applyOverlay(qr.emptyPath(),this.overlayMap);return null!=e&&(this.partialValue=e,this.overlayMap.clear()),this.partialValue}static extractNestedValue(e,t){if(t.isEmpty())return e;{let n=e;for(let e=0;e{const r=new qr([e]);if(yi(n)){const e=wi(n.mapValue).fields;if(0===e.length)t.push(r);else for(const n of e)t.push(r.child(n))}else t.push(r)})),new Hr(t)}class Ei{constructor(e,t,n,r,i){this.key=e,this.documentType=t,this.version=n,this.data=r,this.documentState=i}static newInvalidDocument(e){return new Ei(e,0,Wr.min(),bi.empty(),0)}static newFoundDocument(e,t,n){return new Ei(e,1,t,n,0)}static newNoDocument(e,t){return new Ei(e,2,t,bi.empty(),0)}static newUnknownDocument(e,t){return new Ei(e,3,t,bi.empty(),2)}convertToFoundDocument(e,t){return this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=bi.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=bi.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,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 Ei&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}clone(){return new Ei(this.key,this.documentType,this.version,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.toProto())}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}class _i{constructor(e,t=null,n=[],r=[],i=null,o=null,a=null){this.path=e,this.collectionGroup=t,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=o,this.endAt=a,this.h=null}}function Ci(e,t=null,n=[],r=[],i=null,o=null,a=null){return new _i(e,t,n,r,i,o,a)}function Si(e){const t=Ar(e);if(null===t.h){let e=t.path.canonicalString();null!==t.collectionGroup&&(e+="|cg:"+t.collectionGroup),e+="|f:",e+=t.filters.map((e=>function(e){return e.field.canonicalString()+e.op.toString()+di(e.value)}(e))).join(","),e+="|ob:",e+=t.orderBy.map((e=>function(e){return e.field.canonicalString()+e.dir}(e))).join(","),ni(t.limit)||(e+="|l:",e+=t.limit),t.startAt&&(e+="|lb:",e+=ji(t.startAt)),t.endAt&&(e+="|ub:",e+=ji(t.endAt)),t.h=e}return t.h}function xi(e,t){if(e.limit!==t.limit)return!1;if(e.orderBy.length!==t.orderBy.length)return!1;for(let n=0;n":return e>0;case">=":return e>=0;default:return Pr()}}g(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}}class ki extends Ii{constructor(e,t,n){super(e,t,n),this.key=oi.fromName(n.referenceValue)}matches(e){const t=oi.comparator(e.key,this.key);return this.m(t)}}class Oi extends Ii{constructor(e,t){super(e,"in",t),this.keys=Ni(0,t)}matches(e){return this.keys.some((t=>t.isEqual(e.key)))}}class Pi extends Ii{constructor(e,t){super(e,"not-in",t),this.keys=Ni(0,t)}matches(e){return!this.keys.some((t=>t.isEqual(e.key)))}}function Ni(e,t){var n;return((null===(n=t.arrayValue)||void 0===n?void 0:n.values)||[]).map((e=>oi.fromName(e.referenceValue)))}class Ai extends Ii{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return mi(t)&&li(t.arrayValue,this.value)}}class Di extends Ii{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return null!==t&&li(this.value.arrayValue,t)}}class Ri extends Ii{constructor(e,t){super(e,"not-in",t)}matches(e){if(li(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return null!==t&&!li(this.value.arrayValue,t)}}class Mi extends Ii{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!mi(t)||!t.arrayValue.values)&&t.arrayValue.values.some((e=>li(this.value.arrayValue,e)))}}class Li{constructor(e,t){this.position=e,this.before=t}}function ji(e){return`${e.before?"b":"a"}:${e.position.map((e=>di(e))).join(",")}`}class Fi{constructor(e,t="asc"){this.field=e,this.dir=t}}function Wi(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}function Bi(e,t,n){let r=0;for(let i=0;i0?e.explicitOrderBy[0].field:null}function Ki(e){for(const t of e.filters)if(t.g())return t.field;return null}function Gi(e){return null!==e.collectionGroup}function Qi(e){const t=Ar(e);if(null===t.p){t.p=[];const e=Ki(t),n=Hi(t);if(null!==e&&null===n)e.isKeyField()||t.p.push(new Fi(e)),t.p.push(new Fi(qr.keyField(),"asc"));else{let e=!1;for(const n of t.explicitOrderBy)t.p.push(n),n.field.isKeyField()&&(e=!0);if(!e){const e=t.explicitOrderBy.length>0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc";t.p.push(new Fi(qr.keyField(),e))}}}return t.p}function Yi(e){const t=Ar(e);if(!t.T)if("F"===t.limitType)t.T=Ci(t.path,t.collectionGroup,Qi(t),t.filters,t.limit,t.startAt,t.endAt);else{const e=[];for(const n of Qi(t)){const t="desc"===n.dir?"asc":"desc";e.push(new Fi(n.field,t))}const n=t.endAt?new Li(t.endAt.position,!t.endAt.before):null,r=t.startAt?new Li(t.startAt.position,!t.startAt.before):null;t.T=Ci(t.path,t.collectionGroup,e,t.filters,t.limit,n,r)}return t.T}function Xi(e,t,n){return new Ui(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function Ji(e,t){return xi(Yi(e),Yi(t))&&e.limitType===t.limitType}function eo(e){return`${Si(Yi(e))}|lt:${e.limitType}`}function to(e){return`Query(target=${function(e){let t=e.path.canonicalString();return null!==e.collectionGroup&&(t+=" collectionGroup="+e.collectionGroup),e.filters.length>0&&(t+=`, filters: [${e.filters.map((e=>{return`${(t=e).field.canonicalString()} ${t.op} ${di(t.value)}`;var t})).join(", ")}]`),ni(e.limit)||(t+=", limit: "+e.limit),e.orderBy.length>0&&(t+=`, orderBy: [${e.orderBy.map((e=>function(e){return`${e.field.canonicalString()} (${e.dir})`}(e))).join(", ")}]`),e.startAt&&(t+=", startAt: "+ji(e.startAt)),e.endAt&&(t+=", endAt: "+ji(e.endAt)),`Target(${t})`}(Yi(e))}; limitType=${e.limitType})`}function no(e,t){return t.isFoundDocument()&&function(e,t){const n=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(n):oi.isDocumentKey(e.path)?e.path.isEqual(n):e.path.isImmediateParentOf(n)}(e,t)&&function(e,t){for(const n of e.explicitOrderBy)if(!n.field.isKeyField()&&null===t.data.field(n.field))return!1;return!0}(e,t)&&function(e,t){for(const n of e.filters)if(!n.matches(t))return!1;return!0}(e,t)&&function(e,t){return!(e.startAt&&!Bi(e.startAt,Qi(e),t)||e.endAt&&Bi(e.endAt,Qi(e),t))}(e,t)}function ro(e){return(t,n)=>{let r=!1;for(const i of Qi(e)){const e=io(i,t,n);if(0!==e)return e;r=r||i.field.isKeyField()}return 0}}function io(e,t,n){const r=e.field.isKeyField()?oi.comparator(t.key,n.key):function(e,t,n){const r=t.data.field(e),i=n.data.field(e);return null!==r&&null!==i?ui(r,i):Pr()}(e.field,t,n);switch(e.dir){case"asc":return r;case"desc":return-1*r;default:return Pr()}}function oo(e,t){if(e.I){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:ri(t)?"-0":t}}function ao(e){return{integerValue:""+e}}function so(e,t){return ii(t)?ao(t):oo(e,t)}class lo{constructor(){this._=void 0}}function uo(e,t,n){return e instanceof fo?function(e,t){const 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}}(n,t):e instanceof po?mo(e,t):e instanceof go?vo(e,t):function(e,t){const n=ho(e,t),r=bo(n)+bo(e.A);return pi(n)&&pi(e.A)?ao(r):oo(e.R,r)}(e,t)}function co(e,t,n){return e instanceof po?mo(e,t):e instanceof go?vo(e,t):n}function ho(e,t){return e instanceof yo?pi(n=t)||function(e){return!!e&&"doubleValue"in e}(n)?t:{integerValue:0}:null;var n}class fo extends lo{}class po extends lo{constructor(e){super(),this.elements=e}}function mo(e,t){const n=wo(t);for(const t of e.elements)n.some((e=>si(e,t)))||n.push(t);return{arrayValue:{values:n}}}class go extends lo{constructor(e){super(),this.elements=e}}function vo(e,t){let n=wo(t);for(const t of e.elements)n=n.filter((e=>!si(e,t)));return{arrayValue:{values:n}}}class yo extends lo{constructor(e,t){super(),this.R=e,this.A=t}}function bo(e){return Yr(e.integerValue||e.doubleValue)}function wo(e){return mi(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}class Eo{constructor(e,t){this.field=e,this.transform=t}}class _o{constructor(e,t){this.version=e,this.transformResults=t}}class Co{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new Co}static exists(e){return new Co(void 0,e)}static updateTime(e){return new Co(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 So(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class xo{}function To(e,t,n){e instanceof No?function(e,t,n){const r=e.value.clone(),i=Ro(e.fieldTransforms,t,n.transformResults);r.setAll(i),t.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(e,t,n):e instanceof Ao?function(e,t,n){if(!So(e.precondition,t))return void t.convertToUnknownDocument(n.version);const r=Ro(e.fieldTransforms,t,n.transformResults),i=t.data;i.setAll(Do(e)),i.setAll(r),t.convertToFoundDocument(n.version,i).setHasCommittedMutations()}(e,t,n):function(e,t,n){t.convertToNoDocument(n.version).setHasCommittedMutations()}(0,t,n)}function Io(e,t,n){e instanceof No?function(e,t,n){if(!So(e.precondition,t))return;const r=e.value.clone(),i=Mo(e.fieldTransforms,n,t);r.setAll(i),t.convertToFoundDocument(Po(t),r).setHasLocalMutations()}(e,t,n):e instanceof Ao?function(e,t,n){if(!So(e.precondition,t))return;const r=Mo(e.fieldTransforms,n,t),i=t.data;i.setAll(Do(e)),i.setAll(r),t.convertToFoundDocument(Po(t),i).setHasLocalMutations()}(e,t,n):function(e,t){So(e.precondition,t)&&t.convertToNoDocument(Wr.min())}(e,t)}function ko(e,t){let n=null;for(const r of e.fieldTransforms){const e=t.data.field(r.field),i=ho(r.transform,e||null);null!=i&&(null==n&&(n=bi.empty()),n.set(r.field,i))}return n||null}function Oo(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&!!function(e,t){return void 0===e&&void 0===t||!(!e||!t)&&Lr(e,t,((e,t)=>function(e,t){return e.field.isEqual(t.field)&&function(e,t){return e instanceof po&&t instanceof po||e instanceof go&&t instanceof go?Lr(e.elements,t.elements,si):e instanceof yo&&t instanceof yo?si(e.A,t.A):e instanceof fo&&t instanceof fo}(e.transform,t.transform)}(e,t)))}(e.fieldTransforms,t.fieldTransforms)&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}function Po(e){return e.isFoundDocument()?e.version:Wr.min()}class No extends xo{constructor(e,t,n,r=[]){super(),this.key=e,this.value=t,this.precondition=n,this.fieldTransforms=r,this.type=0}}class Ao extends xo{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}}function Do(e){const t=new Map;return e.fieldMask.fields.forEach((n=>{if(!n.isEmpty()){const r=e.data.field(n);t.set(n,r)}})),t}function Ro(e,t,n){const r=new Map;Nr(e.length===n.length);for(let i=0;i0&&(t=t.right)}return null}indexOf(e){let t=0,n=this.root;for(;!n.isEmpty();){const 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(){const e=[];return this.inorderTraversal(((t,n)=>(e.push(`${t}:${n}`),!1))),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new Zo(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new Zo(this.root,e,this.comparator,!1)}getReverseIterator(){return new Zo(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new Zo(this.root,e,this.comparator,!0)}}class Zo{constructor(e,t,n,r){this.isReverse=r,this.nodeStack=[];let i=1;for(;!e.isEmpty();)if(i=t?n(e.key,t):1,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();const 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;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class $o{constructor(e,t,n,r,i){this.key=e,this.value=t,this.color=null!=n?n:$o.RED,this.left=null!=r?r:$o.EMPTY,this.right=null!=i?i:$o.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,n,r,i){return new $o(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;const 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)),r.fixUp()}removeMin(){if(this.left.isEmpty())return $o.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),e.fixUp()}remove(e,t){let n,r=this;if(t(e,r.key)<0)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 $o.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.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,$o.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,$o.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const 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(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw Pr();if(this.right.isRed())throw Pr();const e=this.left.check();if(e!==this.right.check())throw Pr();return e+(this.isRed()?0:1)}}$o.EMPTY=null,$o.RED=!0,$o.BLACK=!1,$o.EMPTY=new class{constructor(){this.size=0}get key(){throw Pr()}get value(){throw Pr()}get color(){throw Pr()}get left(){throw Pr()}get right(){throw Pr()}copy(e,t,n,r,i){return this}insert(e,t,n){return new $o(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}};class qo{constructor(e){this.comparator=e,this.data=new Vo(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){const n=this.data.getIteratorFrom(e[0]);for(;n.hasNext();){const 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){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new Ho(this.data.getIterator())}getIteratorFrom(e){return new Ho(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{t=t.add(e)})),t}isEqual(e){if(!(e instanceof qo))return!1;if(this.size!==e.size)return!1;const t=this.data.getIterator(),n=e.data.getIterator();for(;t.hasNext();){const e=t.getNext().key,r=n.getNext().key;if(0!==this.comparator(e,r))return!1}return!0}toArray(){const e=[];return this.forEach((t=>{e.push(t)})),e}toString(){const e=[];return this.forEach((t=>e.push(t))),"SortedSet("+e.toString()+")"}copy(e){const t=new qo(this.comparator);return t.data=e,t}}class Ho{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}const Ko=new Vo(oi.comparator);function Go(){return Ko}const Qo=new Vo(oi.comparator);function Yo(){return Qo}const Xo=new Vo(oi.comparator);function Jo(){return Xo}const ea=new qo(oi.comparator);function ta(...e){let t=ea;for(const n of e)t=t.add(n);return t}const na=new qo(Mr);function ra(){return na}class ia{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){const n=new Map;return n.set(e,oa.createSynthesizedTargetChangeForCurrentChange(e,t)),new ia(Wr.min(),n,ra(),Go(),ta())}}class oa{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){return new oa(Kr.EMPTY_BYTE_STRING,t,ta(),ta(),ta())}}class aa{constructor(e,t,n,r){this.P=e,this.removedTargetIds=t,this.key=n,this.v=r}}class sa{constructor(e,t){this.targetId=e,this.V=t}}class la{constructor(e,t,n=Kr.EMPTY_BYTE_STRING,r=null){this.state=e,this.targetIds=t,this.resumeToken=n,this.cause=r}}class ua{constructor(){this.S=0,this.D=ha(),this.C=Kr.EMPTY_BYTE_STRING,this.N=!1,this.k=!0}get current(){return this.N}get resumeToken(){return this.C}get $(){return 0!==this.S}get O(){return this.k}M(e){e.approximateByteSize()>0&&(this.k=!0,this.C=e)}F(){let e=ta(),t=ta(),n=ta();return this.D.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:Pr()}})),new oa(this.C,this.N,e,t,n)}L(){this.k=!1,this.D=ha()}B(e,t){this.k=!0,this.D=this.D.insert(e,t)}U(e){this.k=!0,this.D=this.D.remove(e)}q(){this.S+=1}K(){this.S-=1}j(){this.k=!0,this.N=!0}}class ca{constructor(e){this.W=e,this.G=new Map,this.H=Go(),this.J=da(),this.Y=new qo(Mr)}X(e){for(const t of e.P)e.v&&e.v.isFoundDocument()?this.Z(t,e.v):this.tt(t,e.key,e.v);for(const t of e.removedTargetIds)this.tt(t,e.key,e.v)}et(e){this.forEachTarget(e,(t=>{const n=this.nt(t);switch(e.state){case 0:this.st(t)&&n.M(e.resumeToken);break;case 1:n.K(),n.$||n.L(),n.M(e.resumeToken);break;case 2:n.K(),n.$||this.removeTarget(t);break;case 3:this.st(t)&&(n.j(),n.M(e.resumeToken));break;case 4:this.st(t)&&(this.it(t),n.M(e.resumeToken));break;default:Pr()}}))}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.G.forEach(((e,n)=>{this.st(n)&&t(n)}))}rt(e){const t=e.targetId,n=e.V.count,r=this.ot(t);if(r){const e=r.target;if(Ti(e))if(0===n){const n=new oi(e.path);this.tt(t,n,Ei.newNoDocument(n,Wr.min()))}else Nr(1===n);else this.ct(t)!==n&&(this.it(t),this.Y=this.Y.add(t))}}at(e){const t=new Map;this.G.forEach(((n,r)=>{const i=this.ot(r);if(i){if(n.current&&Ti(i.target)){const t=new oi(i.target.path);null!==this.H.get(t)||this.ut(r,t)||this.tt(r,t,Ei.newNoDocument(t,e))}n.O&&(t.set(r,n.F()),n.L())}}));let n=ta();this.J.forEach(((e,t)=>{let r=!0;t.forEachWhile((e=>{const t=this.ot(e);return!t||2===t.purpose||(r=!1,!1)})),r&&(n=n.add(e))}));const r=new ia(e,t,this.Y,this.H,n);return this.H=Go(),this.J=da(),this.Y=new qo(Mr),r}Z(e,t){if(!this.st(e))return;const n=this.ut(e,t.key)?2:0;this.nt(e).B(t.key,n),this.H=this.H.insert(t.key,t),this.J=this.J.insert(t.key,this.ht(t.key).add(e))}tt(e,t,n){if(!this.st(e))return;const r=this.nt(e);this.ut(e,t)?r.B(t,1):r.U(t),this.J=this.J.insert(t,this.ht(t).delete(e)),n&&(this.H=this.H.insert(t,n))}removeTarget(e){this.G.delete(e)}ct(e){const t=this.nt(e).F();return this.W.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}q(e){this.nt(e).q()}nt(e){let t=this.G.get(e);return t||(t=new ua,this.G.set(e,t)),t}ht(e){let t=this.J.get(e);return t||(t=new qo(Mr),this.J=this.J.insert(e,t)),t}st(e){const t=null!==this.ot(e);return t||Tr("WatchChangeAggregator","Detected inactive target",e),t}ot(e){const t=this.G.get(e);return t&&t.$?null:this.W.lt(e)}it(e){this.G.set(e,new ua),this.W.getRemoteKeysForTarget(e).forEach((t=>{this.tt(e,t,null)}))}ut(e,t){return this.W.getRemoteKeysForTarget(e).has(t)}}function da(){return new Vo(oi.comparator)}function ha(){return new Vo(oi.comparator)}const fa={asc:"ASCENDING",desc:"DESCENDING"},pa={"<":"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"};class ma{constructor(e,t){this.databaseId=e,this.I=t}}function ga(e,t){return e.I?`${new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+t.nanoseconds).slice(-9)}Z`:{seconds:""+t.seconds,nanos:t.nanoseconds}}function va(e,t){return e.I?t.toBase64():t.toUint8Array()}function ya(e,t){return ga(e,t.toTimestamp())}function ba(e){return Nr(!!e),Wr.fromTimestamp(function(e){const t=Qr(e);return new Fr(t.seconds,t.nanos)}(e))}function wa(e,t){return function(e){return new Zr(["projects",e.projectId,"databases",e.database])}(e).child("documents").child(t).canonicalString()}function Ea(e){const t=Zr.fromString(e);return Nr($a(t)),t}function _a(e,t){return wa(e.databaseId,t.path)}function Ca(e,t){const n=Ea(t);if(n.get(1)!==e.databaseId.projectId)throw new _r(Er.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 _r(Er.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new oi(Ia(n))}function Sa(e,t){return wa(e.databaseId,t)}function xa(e){const t=Ea(e);return 4===t.length?Zr.emptyPath():Ia(t)}function Ta(e){return new Zr(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function Ia(e){return Nr(e.length>4&&"documents"===e.get(4)),e.popFirst(5)}function ka(e,t,n){return{name:_a(e,t),fields:n.toProto().mapValue.fields}}function Oa(e,t,n){const r=Ca(e,t.name),i=ba(t.updateTime),o=new bi({mapValue:{fields:t.fields}}),a=Ei.newFoundDocument(r,i,o);return n&&a.setHasCommittedMutations(),n?a.setHasCommittedMutations():a}function Pa(e,t){let n;if(t instanceof No)n={update:ka(e,t.key,t.value)};else if(t instanceof Lo)n={delete:_a(e,t.key)};else if(t instanceof Ao)n={update:ka(e,t.key,t.data),updateMask:Za(t.fieldMask)};else{if(!(t instanceof jo))return Pr();n={verify:_a(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map((e=>function(e,t){const n=t.transform;if(n instanceof fo)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof po)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof go)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof yo)return{fieldPath:t.field.canonicalString(),increment:n.A};throw Pr()}(0,e)))),t.precondition.isNone||(n.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:ya(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:Pr()}(e,t.precondition)),n}function Na(e,t){const n=t.currentDocument?function(e){return void 0!==e.updateTime?Co.updateTime(ba(e.updateTime)):void 0!==e.exists?Co.exists(e.exists):Co.none()}(t.currentDocument):Co.none(),r=t.updateTransforms?t.updateTransforms.map((t=>function(e,t){let n=null;if("setToServerValue"in t)Nr("REQUEST_TIME"===t.setToServerValue),n=new fo;else if("appendMissingElements"in t){const e=t.appendMissingElements.values||[];n=new po(e)}else if("removeAllFromArray"in t){const e=t.removeAllFromArray.values||[];n=new go(e)}else"increment"in t?n=new yo(e,t.increment):Pr();const r=qr.fromServerFormat(t.fieldPath);return new Eo(r,n)}(e,t))):[];if(t.update){t.update.name;const i=Ca(e,t.update.name),o=new bi({mapValue:{fields:t.update.fields}});if(t.updateMask){const e=function(e){const t=e.fieldPaths||[];return new Hr(t.map((e=>qr.fromServerFormat(e))))}(t.updateMask);return new Ao(i,o,e,n,r)}return new No(i,o,n,r)}if(t.delete){const r=Ca(e,t.delete);return new Lo(r,n)}if(t.verify){const r=Ca(e,t.verify);return new jo(r,n)}return Pr()}function Aa(e,t){return{documents:[Sa(e,t.path)]}}function Da(e,t){const n={structuredQuery:{}},r=t.path;null!==t.collectionGroup?(n.parent=Sa(e,r),n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(n.parent=Sa(e,r.popLast()),n.structuredQuery.from=[{collectionId:r.lastSegment()}]);const i=function(e){if(0===e.length)return;const t=e.map((e=>function(e){if("=="===e.op){if(vi(e.value))return{unaryFilter:{field:Ba(e.field),op:"IS_NAN"}};if(gi(e.value))return{unaryFilter:{field:Ba(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(vi(e.value))return{unaryFilter:{field:Ba(e.field),op:"IS_NOT_NAN"}};if(gi(e.value))return{unaryFilter:{field:Ba(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Ba(e.field),op:Wa(e.op),value:e.value}}}(e)));return 1===t.length?t[0]:{compositeFilter:{op:"AND",filters:t}}}(t.filters);i&&(n.structuredQuery.where=i);const o=function(e){if(0!==e.length)return e.map((e=>function(e){return{field:Ba(e.field),direction:Fa(e.dir)}}(e)))}(t.orderBy);o&&(n.structuredQuery.orderBy=o);const a=function(e,t){return e.I||ni(t)?t:{value:t}}(e,t.limit);return null!==a&&(n.structuredQuery.limit=a),t.startAt&&(n.structuredQuery.startAt=La(t.startAt)),t.endAt&&(n.structuredQuery.endAt=La(t.endAt)),n}function Ra(e){let t=xa(e.parent);const n=e.structuredQuery,r=n.from?n.from.length:0;let i=null;if(r>0){Nr(1===r);const e=n.from[0];e.allDescendants?i=e.collectionId:t=t.child(e.collectionId)}let o=[];n.where&&(o=Ma(n.where));let a=[];n.orderBy&&(a=n.orderBy.map((e=>function(e){return new Fi(za(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))}(e))));let s=null;n.limit&&(s=function(e){let t;return t="object"==typeof e?e.value:e,ni(t)?null:t}(n.limit));let l=null;n.startAt&&(l=ja(n.startAt));let u=null;return n.endAt&&(u=ja(n.endAt)),Vi(t,i,a,o,s,"F",l,u)}function Ma(e){return e?void 0!==e.unaryFilter?[Va(e)]:void 0!==e.fieldFilter?[Ua(e)]:void 0!==e.compositeFilter?e.compositeFilter.filters.map((e=>Ma(e))).reduce(((e,t)=>e.concat(t))):Pr():[]}function La(e){return{before:e.before,values:e.position}}function ja(e){const t=!!e.before,n=e.values||[];return new Li(n,t)}function Fa(e){return fa[e]}function Wa(e){return pa[e]}function Ba(e){return{fieldPath:e.canonicalString()}}function za(e){return qr.fromServerFormat(e.fieldPath)}function Ua(e){return Ii.create(za(e.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";case"OPERATOR_UNSPECIFIED":default:return Pr()}}(e.fieldFilter.op),e.fieldFilter.value)}function Va(e){switch(e.unaryFilter.op){case"IS_NAN":const t=za(e.unaryFilter.field);return Ii.create(t,"==",{doubleValue:NaN});case"IS_NULL":const n=za(e.unaryFilter.field);return Ii.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const r=za(e.unaryFilter.field);return Ii.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const i=za(e.unaryFilter.field);return Ii.create(i,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return Pr()}}function Za(e){const t=[];return e.fields.forEach((e=>t.push(e.canonicalString()))),{fieldPaths:t}}function $a(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}function qa(e){let t="";for(let n=0;n0&&(t=Ka(t)),t=Ha(e.get(n),t);return Ka(t)}function Ha(e,t){let n=t;const r=e.length;for(let t=0;t=2),2===t)return Nr(""===e.charAt(0)&&""===e.charAt(1)),Zr.emptyPath();const n=t-2,r=[];let i="";for(let o=0;on)&&Pr(),e.charAt(t+1)){case"":const n=e.substring(o,t);let a;0===i.length?a=n:(i+=n,a=i,i=""),r.push(a);break;case"":i+=e.substring(o,t),i+="\0";break;case"":i+=e.substring(o,t+1);break;default:Pr()}o=t+2}return new Zr(r)}class Qa{constructor(e,t){this.seconds=e,this.nanoseconds=t}}class Ya{constructor(e,t,n){this.ownerId=e,this.allowTabSynchronization=t,this.leaseTimestampMs=n}}Ya.store="owner",Ya.key="owner";class Xa{constructor(e,t,n){this.userId=e,this.lastAcknowledgedBatchId=t,this.lastStreamToken=n}}Xa.store="mutationQueues",Xa.keyPath="userId";class Ja{constructor(e,t,n,r,i){this.userId=e,this.batchId=t,this.localWriteTimeMs=n,this.baseMutations=r,this.mutations=i}}Ja.store="mutations",Ja.keyPath="batchId",Ja.userMutationsIndex="userMutationsIndex",Ja.userMutationsKeyPath=["userId","batchId"];class es{constructor(){}static prefixForUser(e){return[e]}static prefixForPath(e,t){return[e,qa(t)]}static key(e,t,n){return[e,qa(t),n]}}es.store="documentMutations",es.PLACEHOLDER=new es;class ts{constructor(e,t){this.path=e,this.readTime=t}}class ns{constructor(e,t){this.path=e,this.version=t}}class rs{constructor(e,t,n,r,i,o){this.unknownDocument=e,this.noDocument=t,this.document=n,this.hasCommittedMutations=r,this.readTime=i,this.parentPath=o}}rs.store="remoteDocuments",rs.readTimeIndex="readTimeIndex",rs.readTimeIndexPath="readTime",rs.collectionReadTimeIndex="collectionReadTimeIndex",rs.collectionReadTimeIndexPath=["parentPath","readTime"];class is{constructor(e){this.byteSize=e}}is.store="remoteDocumentGlobal",is.key="remoteDocumentGlobalKey";class os{constructor(e,t,n,r,i,o,a){this.targetId=e,this.canonicalId=t,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.lastLimboFreeSnapshotVersion=o,this.query=a}}os.store="targets",os.keyPath="targetId",os.queryTargetsIndexName="queryTargetsIndex",os.queryTargetsKeyPath=["canonicalId","targetId"];class as{constructor(e,t,n){this.targetId=e,this.path=t,this.sequenceNumber=n}}as.store="targetDocuments",as.keyPath=["targetId","path"],as.documentTargetsIndex="documentTargetsIndex",as.documentTargetsKeyPath=["path","targetId"];class ss{constructor(e,t,n,r){this.highestTargetId=e,this.highestListenSequenceNumber=t,this.lastRemoteSnapshotVersion=n,this.targetCount=r}}ss.key="targetGlobalKey",ss.store="targetGlobal";class ls{constructor(e,t){this.collectionId=e,this.parent=t}}ls.store="collectionParents",ls.keyPath=["collectionId","parent"];class us{constructor(e,t,n,r){this.clientId=e,this.updateTimeMs=t,this.networkEnabled=n,this.inForeground=r}}us.store="clientMetadata",us.keyPath="clientId";class cs{constructor(e,t,n){this.bundleId=e,this.createTime=t,this.version=n}}cs.store="bundles",cs.keyPath="bundleId";class ds{constructor(e,t,n){this.name=e,this.readTime=t,this.bundledQuery=n}}ds.store="namedQueries",ds.keyPath="name";const hs=[Xa.store,Ja.store,es.store,rs.store,os.store,Ya.store,ss.store,as.store,us.store,is.store,ls.store,cs.store,ds.store],fs="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class ps{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach((e=>e()))}}class ms{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}class gs{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&&Pr(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new gs(((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{const t=e();return t instanceof gs?t:gs.resolve(t)}catch(e){return gs.reject(e)}}wrapSuccess(e,t){return e?this.wrapUserFunction((()=>e(t))):gs.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction((()=>e(t))):gs.reject(t)}static resolve(e){return new gs(((t,n)=>{t(e)}))}static reject(e){return new gs(((t,n)=>{n(e)}))}static waitFor(e){return new gs(((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=gs.resolve(!1);for(const n of e)t=t.next((e=>e?gs.resolve(e):n()));return t}static forEach(e,t){const n=[];return e.forEach(((e,r)=>{n.push(t.call(this,e,r))})),this.waitFor(n)}}class vs{constructor(e,t){this.action=e,this.transaction=t,this.aborted=!1,this.ft=new ms,this.transaction.oncomplete=()=>{this.ft.resolve()},this.transaction.onabort=()=>{t.error?this.ft.reject(new ws(e,t.error)):this.ft.resolve()},this.transaction.onerror=t=>{const n=xs(t.target.error);this.ft.reject(new ws(e,n))}}static open(e,t,n,r){try{return new vs(t,e.transaction(r,n))}catch(e){throw new ws(t,e)}}get dt(){return this.ft.promise}abort(e){e&&this.ft.reject(e),this.aborted||(Tr("SimpleDb","Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}store(e){const t=this.transaction.objectStore(e);return new _s(t)}}class ys{constructor(e,t,n){this.name=e,this.version=t,this.wt=n,12.2===ys._t((0,l.z$)())&&Ir("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}static delete(e){return Tr("SimpleDb","Removing database:",e),Cs(window.indexedDB.deleteDatabase(e)).toPromise()}static gt(){if("undefined"==typeof indexedDB)return!1;if(ys.yt())return!0;const e=(0,l.z$)(),t=ys._t(e),n=00||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||n||i)}static yt(){var e;return"undefined"!=typeof process&&"YES"===(null===(e=process.env)||void 0===e?void 0:e.Tt)}static It(e,t){return e.store(t)}static _t(e){const t=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=t?t[1].split("_").slice(0,2).join("."):"-1";return Number(n)}static Et(e){const t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)}async At(e){return this.db||(Tr("SimpleDb","Opening database:",this.name),this.db=await new Promise(((t,n)=>{const r=indexedDB.open(this.name,this.version);r.onsuccess=e=>{const n=e.target.result;t(n)},r.onblocked=()=>{n(new ws(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},r.onerror=t=>{const r=t.target.error;"VersionError"===r.name?n(new _r(Er.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):n(new ws(e,r))},r.onupgradeneeded=e=>{Tr("SimpleDb",'Database "'+this.name+'" requires upgrade from version:',e.oldVersion);const t=e.target.result;this.wt.Rt(t,r.transaction,e.oldVersion,this.version).next((()=>{Tr("SimpleDb","Database upgrade to version "+this.version+" complete")}))}}))),this.Pt&&(this.db.onversionchange=e=>this.Pt(e)),this.db}bt(e){this.Pt=e,this.db&&(this.db.onversionchange=t=>e(t))}async runTransaction(e,t,n,r){const i="readonly"===t;let o=0;for(;;){++o;try{this.db=await this.At(e);const t=vs.open(this.db,e,i?"readonly":"readwrite",n),o=r(t).catch((e=>(t.abort(e),gs.reject(e)))).toPromise();return o.catch((()=>{})),await t.dt,o}catch(e){const t="FirebaseError"!==e.name&&o<3;if(Tr("SimpleDb","Transaction failed with error:",e.message,"Retrying:",t),this.close(),!t)return Promise.reject(e)}}}close(){this.db&&this.db.close(),this.db=void 0}}class bs{constructor(e){this.vt=e,this.Vt=!1,this.St=null}get isDone(){return this.Vt}get Dt(){return this.St}set cursor(e){this.vt=e}done(){this.Vt=!0}Ct(e){this.St=e}delete(){return Cs(this.vt.delete())}}class ws extends _r{constructor(e,t){super(Er.UNAVAILABLE,`IndexedDB transaction '${e}' failed: ${t}`),this.name="IndexedDbTransactionError"}}function Es(e){return"IndexedDbTransactionError"===e.name}class _s{constructor(e){this.store=e}put(e,t){let n;return void 0!==t?(Tr("SimpleDb","PUT",this.store.name,e,t),n=this.store.put(t,e)):(Tr("SimpleDb","PUT",this.store.name,"",e),n=this.store.put(e)),Cs(n)}add(e){return Tr("SimpleDb","ADD",this.store.name,e,e),Cs(this.store.add(e))}get(e){return Cs(this.store.get(e)).next((t=>(void 0===t&&(t=null),Tr("SimpleDb","GET",this.store.name,e,t),t)))}delete(e){return Tr("SimpleDb","DELETE",this.store.name,e),Cs(this.store.delete(e))}count(){return Tr("SimpleDb","COUNT",this.store.name),Cs(this.store.count())}Nt(e,t){const n=this.cursor(this.options(e,t)),r=[];return this.xt(n,((e,t)=>{r.push(t)})).next((()=>r))}kt(e,t){Tr("SimpleDb","DELETE ALL",this.store.name);const n=this.options(e,t);n.$t=!1;const r=this.cursor(n);return this.xt(r,((e,t,n)=>n.delete()))}Ot(e,t){let n;t?n=e:(n={},t=e);const r=this.cursor(n);return this.xt(r,t)}Mt(e){const t=this.cursor({});return new gs(((n,r)=>{t.onerror=e=>{const t=xs(e.target.error);r(t)},t.onsuccess=t=>{const r=t.target.result;r?e(r.primaryKey,r.value).next((e=>{e?r.continue():n()})):n()}}))}xt(e,t){const n=[];return new gs(((r,i)=>{e.onerror=e=>{i(e.target.error)},e.onsuccess=e=>{const i=e.target.result;if(!i)return void r();const o=new bs(i),a=t(i.primaryKey,i.value,o);if(a instanceof gs){const e=a.catch((e=>(o.done(),gs.reject(e))));n.push(e)}o.isDone?r():null===o.Dt?i.continue():i.continue(o.Dt)}})).next((()=>gs.waitFor(n)))}options(e,t){let n;return void 0!==e&&("string"==typeof e?n=e:t=e),{index:n,range:t}}cursor(e){let t="next";if(e.reverse&&(t="prev"),e.index){const n=this.store.index(e.index);return e.$t?n.openKeyCursor(e.range,t):n.openCursor(e.range,t)}return this.store.openCursor(e.range,t)}}function Cs(e){return new gs(((t,n)=>{e.onsuccess=e=>{const n=e.target.result;t(n)},e.onerror=e=>{const t=xs(e.target.error);n(t)}}))}let Ss=!1;function xs(e){const t=ys._t((0,l.z$)());if(t>=12.2&&t<13){const t="An internal error was encountered in the Indexed Database server";if(e.message.indexOf(t)>=0){const e=new _r("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${t}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return Ss||(Ss=!0,setTimeout((()=>{throw e}),0)),e}}return e}class Ts extends ps{constructor(e,t){super(),this.Ft=e,this.currentSequenceNumber=t}}function Is(e,t){const n=Ar(e);return ys.It(n.Ft,t)}class ks{constructor(e,t,n,r){this.batchId=e,this.localWriteTime=t,this.baseMutations=n,this.mutations=r}applyToRemoteDocument(e,t){const n=t.mutationResults;for(let t=0;t{const n=e.get(t.key),r=n;this.applyToLocalView(r),n.isValidDocument()||r.convertToNoDocument(Wr.min())}))}keys(){return this.mutations.reduce(((e,t)=>e.add(t.key)),ta())}isEqual(e){return this.batchId===e.batchId&&Lr(this.mutations,e.mutations,((e,t)=>Oo(e,t)))&&Lr(this.baseMutations,e.baseMutations,((e,t)=>Oo(e,t)))}}class Os{constructor(e,t,n,r){this.batch=e,this.commitVersion=t,this.mutationResults=n,this.docVersions=r}static from(e,t,n){Nr(e.mutations.length===n.length);let r=Jo();const i=e.mutations;for(let e=0;eNa(e.Lt,t)));for(let e=0;eNa(e.Lt,t))),i=Fr.fromMillis(t.localWriteTimeMs);return new ks(t.batchId,i,n,r)}function Ws(e){const t=js(e.readTime),n=void 0!==e.lastLimboFreeSnapshotVersion?js(e.lastLimboFreeSnapshotVersion):Wr.min();let r;var i;return void 0!==e.query.documents?(Nr(1===(i=e.query).documents.length),r=Yi(Zi(xa(i.documents[0])))):r=function(e){return Yi(Ra(e))}(e.query),new Ps(r,e.targetId,0,e.lastListenSequenceNumber,t,n,Kr.fromBase64String(e.resumeToken))}function Bs(e,t){const n=Ls(t.snapshotVersion),r=Ls(t.lastLimboFreeSnapshotVersion);let i;i=Ti(t.target)?Aa(e.Lt,t.target):Da(e.Lt,t.target);const o=t.resumeToken.toBase64();return new os(t.targetId,Si(t.target),n,o,t.sequenceNumber,r,i)}function zs(e){const t=Ra({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?Xi(t,t.limit,"L"):t}class Us{getBundleMetadata(e,t){return Vs(e).get(t).next((e=>{if(e)return{id:(t=e).bundleId,createTime:js(t.createTime),version:t.version};var t}))}saveBundleMetadata(e,t){return Vs(e).put({bundleId:(n=t).id,createTime:Ls(ba(n.createTime)),version:n.version});var n}getNamedQuery(e,t){return Zs(e).get(t).next((e=>{if(e)return{name:(t=e).name,query:zs(t.bundledQuery),readTime:js(t.readTime)};var t}))}saveNamedQuery(e,t){return Zs(e).put(function(e){return{name:e.name,readTime:Ls(ba(e.readTime)),bundledQuery:e.bundledQuery}}(t))}}function Vs(e){return Is(e,cs.store)}function Zs(e){return Is(e,ds.store)}class $s{constructor(){this.Bt=new qs}addToCollectionParentIndex(e,t){return this.Bt.add(t),gs.resolve()}getCollectionParents(e,t){return gs.resolve(this.Bt.getEntries(t))}}class qs{constructor(){this.index={}}add(e){const t=e.lastSegment(),n=e.popLast(),r=this.index[t]||new qo(Zr.comparator),i=!r.has(n);return this.index[t]=r.add(n),i}has(e){const t=e.lastSegment(),n=e.popLast(),r=this.index[t];return r&&r.has(n)}getEntries(e){return(this.index[e]||new qo(Zr.comparator)).toArray()}}class Hs{constructor(){this.Ut=new qs}addToCollectionParentIndex(e,t){if(!this.Ut.has(t)){const n=t.lastSegment(),r=t.popLast();e.addOnCommittedListener((()=>{this.Ut.add(t)}));const i={collectionId:n,parent:qa(r)};return Ks(e).put(i)}return gs.resolve()}getCollectionParents(e,t){const n=[],r=IDBKeyRange.bound([t,""],[jr(t),""],!1,!0);return Ks(e).Nt(r).next((e=>{for(const r of e){if(r.collectionId!==t)break;n.push(Ga(r.parent))}return n}))}}function Ks(e){return Is(e,ls.store)}const Gs={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0};class Qs{constructor(e,t,n){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=n}static withCacheSize(e){return new Qs(e,Qs.DEFAULT_COLLECTION_PERCENTILE,Qs.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}}function Ys(e,t,n){const r=e.store(Ja.store),i=e.store(es.store),o=[],a=IDBKeyRange.only(n.batchId);let s=0;const l=r.Ot({range:a},((e,t,n)=>(s++,n.delete())));o.push(l.next((()=>{Nr(1===s)})));const u=[];for(const e of n.mutations){const r=es.key(t,e.key.path,n.batchId);o.push(i.delete(r)),u.push(e.key)}return gs.waitFor(o).next((()=>u))}function Xs(e){if(!e)return 0;let t;if(e.document)t=e.document;else if(e.unknownDocument)t=e.unknownDocument;else{if(!e.noDocument)throw Pr();t=e.noDocument}return JSON.stringify(t).length}Qs.DEFAULT_COLLECTION_PERCENTILE=10,Qs.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Qs.DEFAULT=new Qs(41943040,Qs.DEFAULT_COLLECTION_PERCENTILE,Qs.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Qs.DISABLED=new Qs(-1,0,0);class Js{constructor(e,t,n,r){this.userId=e,this.R=t,this.qt=n,this.referenceDelegate=r,this.Kt={}}static Qt(e,t,n,r){Nr(""!==e.uid);const i=e.isAuthenticated()?e.uid:"";return new Js(i,t,n,r)}checkEmpty(e){let t=!0;const n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return tl(e).Ot({index:Ja.userMutationsIndex,range:n},((e,n,r)=>{t=!1,r.done()})).next((()=>t))}addMutationBatch(e,t,n,r){const i=nl(e),o=tl(e);return o.add({}).next((a=>{Nr("number"==typeof a);const s=new ks(a,t,n,r),l=function(e,t,n){const r=n.baseMutations.map((t=>Pa(e.Lt,t))),i=n.mutations.map((t=>Pa(e.Lt,t)));return new Ja(t,n.batchId,n.localWriteTime.toMillis(),r,i)}(this.R,this.userId,s),u=[];let c=new qo(((e,t)=>Mr(e.canonicalString(),t.canonicalString())));for(const e of r){const t=es.key(this.userId,e.key.path,a);c=c.add(e.key.path.popLast()),u.push(o.put(l)),u.push(i.put(t,es.PLACEHOLDER))}return c.forEach((t=>{u.push(this.qt.addToCollectionParentIndex(e,t))})),e.addOnCommittedListener((()=>{this.Kt[a]=s.keys()})),gs.waitFor(u).next((()=>s))}))}lookupMutationBatch(e,t){return tl(e).get(t).next((e=>e?(Nr(e.userId===this.userId),Fs(this.R,e)):null))}jt(e,t){return this.Kt[t]?gs.resolve(this.Kt[t]):this.lookupMutationBatch(e,t).next((e=>{if(e){const n=e.keys();return this.Kt[t]=n,n}return null}))}getNextMutationBatchAfterBatchId(e,t){const n=t+1,r=IDBKeyRange.lowerBound([this.userId,n]);let i=null;return tl(e).Ot({index:Ja.userMutationsIndex,range:r},((e,t,r)=>{t.userId===this.userId&&(Nr(t.batchId>=n),i=Fs(this.R,t)),r.done()})).next((()=>i))}getHighestUnacknowledgedBatchId(e){const t=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]);let n=-1;return tl(e).Ot({index:Ja.userMutationsIndex,range:t,reverse:!0},((e,t,r)=>{n=t.batchId,r.done()})).next((()=>n))}getAllMutationBatches(e){const t=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return tl(e).Nt(Ja.userMutationsIndex,t).next((e=>e.map((e=>Fs(this.R,e)))))}getAllMutationBatchesAffectingDocumentKey(e,t){const n=es.prefixForPath(this.userId,t.path),r=IDBKeyRange.lowerBound(n),i=[];return nl(e).Ot({range:r},((n,r,o)=>{const[a,s,l]=n,u=Ga(s);if(a===this.userId&&t.path.isEqual(u))return tl(e).get(l).next((e=>{if(!e)throw Pr();Nr(e.userId===this.userId),i.push(Fs(this.R,e))}));o.done()})).next((()=>i))}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new qo(Mr);const r=[];return t.forEach((t=>{const i=es.prefixForPath(this.userId,t.path),o=IDBKeyRange.lowerBound(i),a=nl(e).Ot({range:o},((e,r,i)=>{const[o,a,s]=e,l=Ga(a);o===this.userId&&t.path.isEqual(l)?n=n.add(s):i.done()}));r.push(a)})),gs.waitFor(r).next((()=>this.Wt(e,n)))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,r=n.length+1,i=es.prefixForPath(this.userId,n),o=IDBKeyRange.lowerBound(i);let a=new qo(Mr);return nl(e).Ot({range:o},((e,t,i)=>{const[o,s,l]=e,u=Ga(s);o===this.userId&&n.isPrefixOf(u)?u.length===r&&(a=a.add(l)):i.done()})).next((()=>this.Wt(e,a)))}Wt(e,t){const n=[],r=[];return t.forEach((t=>{r.push(tl(e).get(t).next((e=>{if(null===e)throw Pr();Nr(e.userId===this.userId),n.push(Fs(this.R,e))})))})),gs.waitFor(r).next((()=>n))}removeMutationBatch(e,t){return Ys(e.Ft,this.userId,t).next((n=>(e.addOnCommittedListener((()=>{this.Gt(t.batchId)})),gs.forEach(n,(t=>this.referenceDelegate.markPotentiallyOrphaned(e,t))))))}Gt(e){delete this.Kt[e]}performConsistencyCheck(e){return this.checkEmpty(e).next((t=>{if(!t)return gs.resolve();const n=IDBKeyRange.lowerBound(es.prefixForUser(this.userId)),r=[];return nl(e).Ot({range:n},((e,t,n)=>{if(e[0]===this.userId){const t=Ga(e[1]);r.push(t)}else n.done()})).next((()=>{Nr(0===r.length)}))}))}containsKey(e,t){return el(e,this.userId,t)}zt(e){return rl(e).get(this.userId).next((e=>e||new Xa(this.userId,-1,"")))}}function el(e,t,n){const r=es.prefixForPath(t,n.path),i=r[1],o=IDBKeyRange.lowerBound(r);let a=!1;return nl(e).Ot({range:o,$t:!0},((e,n,r)=>{const[o,s,l]=e;o===t&&s===i&&(a=!0),r.done()})).next((()=>a))}function tl(e){return Is(e,Ja.store)}function nl(e){return Is(e,es.store)}function rl(e){return Is(e,Xa.store)}class il{constructor(e){this.Ht=e}next(){return this.Ht+=2,this.Ht}static Jt(){return new il(0)}static Yt(){return new il(-1)}}class ol{constructor(e,t){this.referenceDelegate=e,this.R=t}allocateTargetId(e){return this.Xt(e).next((t=>{const n=new il(t.highestTargetId);return t.highestTargetId=n.next(),this.Zt(e,t).next((()=>t.highestTargetId))}))}getLastRemoteSnapshotVersion(e){return this.Xt(e).next((e=>Wr.fromTimestamp(new Fr(e.lastRemoteSnapshotVersion.seconds,e.lastRemoteSnapshotVersion.nanoseconds))))}getHighestSequenceNumber(e){return this.Xt(e).next((e=>e.highestListenSequenceNumber))}setTargetsMetadata(e,t,n){return this.Xt(e).next((r=>(r.highestListenSequenceNumber=t,n&&(r.lastRemoteSnapshotVersion=n.toTimestamp()),t>r.highestListenSequenceNumber&&(r.highestListenSequenceNumber=t),this.Zt(e,r))))}addTargetData(e,t){return this.te(e,t).next((()=>this.Xt(e).next((n=>(n.targetCount+=1,this.ee(t,n),this.Zt(e,n))))))}updateTargetData(e,t){return this.te(e,t)}removeTargetData(e,t){return this.removeMatchingKeysForTargetId(e,t.targetId).next((()=>al(e).delete(t.targetId))).next((()=>this.Xt(e))).next((t=>(Nr(t.targetCount>0),t.targetCount-=1,this.Zt(e,t))))}removeTargets(e,t,n){let r=0;const i=[];return al(e).Ot(((o,a)=>{const s=Ws(a);s.sequenceNumber<=t&&null===n.get(s.targetId)&&(r++,i.push(this.removeTargetData(e,s)))})).next((()=>gs.waitFor(i))).next((()=>r))}forEachTarget(e,t){return al(e).Ot(((e,n)=>{const r=Ws(n);t(r)}))}Xt(e){return sl(e).get(ss.key).next((e=>(Nr(null!==e),e)))}Zt(e,t){return sl(e).put(ss.key,t)}te(e,t){return al(e).put(Bs(this.R,t))}ee(e,t){let n=!1;return e.targetId>t.highestTargetId&&(t.highestTargetId=e.targetId,n=!0),e.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=e.sequenceNumber,n=!0),n}getTargetCount(e){return this.Xt(e).next((e=>e.targetCount))}getTargetData(e,t){const n=Si(t),r=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]);let i=null;return al(e).Ot({range:r,index:os.queryTargetsIndexName},((e,n,r)=>{const o=Ws(n);xi(t,o.target)&&(i=o,r.done())})).next((()=>i))}addMatchingKeys(e,t,n){const r=[],i=ll(e);return t.forEach((t=>{const o=qa(t.path);r.push(i.put(new as(n,o))),r.push(this.referenceDelegate.addReference(e,n,t))})),gs.waitFor(r)}removeMatchingKeys(e,t,n){const r=ll(e);return gs.forEach(t,(t=>{const i=qa(t.path);return gs.waitFor([r.delete([n,i]),this.referenceDelegate.removeReference(e,n,t)])}))}removeMatchingKeysForTargetId(e,t){const n=ll(e),r=IDBKeyRange.bound([t],[t+1],!1,!0);return n.delete(r)}getMatchingKeysForTargetId(e,t){const n=IDBKeyRange.bound([t],[t+1],!1,!0),r=ll(e);let i=ta();return r.Ot({range:n,$t:!0},((e,t,n)=>{const r=Ga(e[1]),o=new oi(r);i=i.add(o)})).next((()=>i))}containsKey(e,t){const n=qa(t.path),r=IDBKeyRange.bound([n],[jr(n)],!1,!0);let i=0;return ll(e).Ot({index:as.documentTargetsIndex,$t:!0,range:r},(([e,t],n,r)=>{0!==e&&(i++,r.done())})).next((()=>i>0))}lt(e,t){return al(e).get(t).next((e=>e?Ws(e):null))}}function al(e){return Is(e,os.store)}function sl(e){return Is(e,ss.store)}function ll(e){return Is(e,as.store)}async function ul(e){if(e.code!==Er.FAILED_PRECONDITION||e.message!==fs)throw e;Tr("LocalStore","Unexpectedly lost primary lease")}function cl([e,t],[n,r]){const i=Mr(e,n);return 0===i?Mr(t,r):i}class dl{constructor(e){this.ne=e,this.buffer=new qo(cl),this.se=0}ie(){return++this.se}re(e){const t=[e,this.ie()];if(this.buffer.size{this.ce=null,this.oe=!0;try{await e.collectGarbage(this.garbageCollector)}catch(e){Es(e)?Tr("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",e):await ul(e)}await this.ae(e)}))}}class fl{constructor(e,t){this.ue=e,this.params=t}calculateTargetCount(e,t){return this.ue.he(e).next((e=>Math.floor(t/100*e)))}nthSequenceNumber(e,t){if(0===t)return gs.resolve(wr.o);const n=new dl(t);return this.ue.forEachTarget(e,(e=>n.re(e.sequenceNumber))).next((()=>this.ue.le(e,(e=>n.re(e))))).next((()=>n.maxValue))}removeTargets(e,t,n){return this.ue.removeTargets(e,t,n)}removeOrphanedDocuments(e,t){return this.ue.removeOrphanedDocuments(e,t)}collect(e,t){return-1===this.params.cacheSizeCollectionThreshold?(Tr("LruGarbageCollector","Garbage collection skipped; disabled"),gs.resolve(Gs)):this.getCacheSize(e).next((n=>n(t>this.params.maximumSequenceNumbersToCollect?(Tr("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${t}`),r=this.params.maximumSequenceNumbersToCollect):r=t,o=Date.now(),this.nthSequenceNumber(e,r)))).next((r=>(n=r,a=Date.now(),this.removeTargets(e,n,t)))).next((t=>(i=t,s=Date.now(),this.removeOrphanedDocuments(e,n)))).next((e=>(l=Date.now(),Sr()<=h.in.DEBUG&&Tr("LruGarbageCollector",`LRU Garbage Collection\n\tCounted targets in ${o-u}ms\n\tDetermined least recently used ${r} in `+(a-o)+"ms\n"+`\tRemoved ${i} targets in `+(s-a)+"ms\n"+`\tRemoved ${e} documents in `+(l-s)+"ms\n"+`Total Duration: ${l-u}ms`),gs.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:i,documentsRemoved:e}))))}}class pl{constructor(e,t){this.db=e,this.garbageCollector=function(e,t){return new fl(e,t)}(this,t)}he(e){const t=this.de(e);return this.db.getTargetCache().getTargetCount(e).next((e=>t.next((t=>e+t))))}de(e){let t=0;return this.le(e,(e=>{t++})).next((()=>t))}forEachTarget(e,t){return this.db.getTargetCache().forEachTarget(e,t)}le(e,t){return this.we(e,((e,n)=>t(n)))}addReference(e,t,n){return ml(e,n)}removeReference(e,t,n){return ml(e,n)}removeTargets(e,t,n){return this.db.getTargetCache().removeTargets(e,t,n)}markPotentiallyOrphaned(e,t){return ml(e,t)}_e(e,t){return function(e,t){let n=!1;return rl(e).Mt((r=>el(e,r,t).next((e=>(e&&(n=!0),gs.resolve(!e)))))).next((()=>n))}(e,t)}removeOrphanedDocuments(e,t){const n=this.db.getRemoteDocumentCache().newChangeBuffer(),r=[];let i=0;return this.we(e,((o,a)=>{if(a<=t){const t=this._e(e,o).next((t=>{if(!t)return i++,n.getEntry(e,o).next((()=>(n.removeEntry(o),ll(e).delete([0,qa(o.path)]))))}));r.push(t)}})).next((()=>gs.waitFor(r))).next((()=>n.apply(e))).next((()=>i))}removeTarget(e,t){const n=t.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,n)}updateLimboDocument(e,t){return ml(e,t)}we(e,t){const n=ll(e);let r,i=wr.o;return n.Ot({index:as.documentTargetsIndex},(([e,n],{path:o,sequenceNumber:a})=>{0===e?(i!==wr.o&&t(new oi(Ga(r)),i),i=a,r=o):i=wr.o})).next((()=>{i!==wr.o&&t(new oi(Ga(r)),i)}))}getCacheSize(e){return this.db.getRemoteDocumentCache().getSize(e)}}function ml(e,t){return ll(e).put(function(e,t){return new as(0,qa(e.path),t)}(t,e.currentSequenceNumber))}class gl{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={}}get(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n)for(const[t,r]of n)if(this.equalsFn(t,e))return r}has(e){return void 0!==this.get(e)}set(e,t){const n=this.mapKeyFn(e),r=this.inner[n];if(void 0!==r){for(let n=0;n{for(const[t,r]of n)e(t,r)}))}isEmpty(){return Ur(this.inner)}}class vl{constructor(){this.changes=new gl((e=>e.toString()),((e,t)=>e.isEqual(t))),this.changesApplied=!1}getReadTime(e){const t=this.changes.get(e);return t?t.readTime:Wr.min()}addEntry(e,t){this.assertNotApplied(),this.changes.set(e.key,{document:e,readTime:t})}removeEntry(e,t=null){this.assertNotApplied(),this.changes.set(e,{document:Ei.newInvalidDocument(e),readTime:t})}getEntry(e,t){this.assertNotApplied();const n=this.changes.get(t);return void 0!==n?gs.resolve(n.document):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class yl{constructor(e,t){this.R=e,this.qt=t}addEntry(e,t,n){return El(e).put(_l(t),n)}removeEntry(e,t){const n=El(e),r=_l(t);return n.delete(r)}updateMetadata(e,t){return this.getMetadata(e).next((n=>(n.byteSize+=t,this.me(e,n))))}getEntry(e,t){return El(e).get(_l(t)).next((e=>this.ge(t,e)))}ye(e,t){return El(e).get(_l(t)).next((e=>({document:this.ge(t,e),size:Xs(e)})))}getEntries(e,t){let n=Go();return this.pe(e,t,((e,t)=>{const r=this.ge(e,t);n=n.insert(e,r)})).next((()=>n))}Ee(e,t){let n=Go(),r=new Vo(oi.comparator);return this.pe(e,t,((e,t)=>{const i=this.ge(e,t);n=n.insert(e,i),r=r.insert(e,Xs(t))})).next((()=>({documents:n,Te:r})))}pe(e,t,n){if(t.isEmpty())return gs.resolve();const r=IDBKeyRange.bound(t.first().path.toArray(),t.last().path.toArray()),i=t.getIterator();let o=i.getNext();return El(e).Ot({range:r},((e,t,r)=>{const a=oi.fromSegments(e);for(;o&&oi.comparator(o,a)<0;)n(o,null),o=i.getNext();o&&o.isEqual(a)&&(n(o,t),o=i.hasNext()?i.getNext():null),o?r.Ct(o.path.toArray()):r.done()})).next((()=>{for(;o;)n(o,null),o=i.hasNext()?i.getNext():null}))}getDocumentsMatchingQuery(e,t,n){let r=Go();const i=t.path.length+1,o={};if(n.isEqual(Wr.min())){const e=t.path.toArray();o.range=IDBKeyRange.lowerBound(e)}else{const e=t.path.toArray(),r=Rs(n);o.range=IDBKeyRange.lowerBound([e,r],!0),o.index=rs.collectionReadTimeIndex}return El(e).Ot(o,((e,n,o)=>{if(e.length!==i)return;const a=As(this.R,n);t.path.isPrefixOf(a.key.path)?no(t,a)&&(r=r.insert(a.key,a)):o.done()})).next((()=>r))}newChangeBuffer(e){return new bl(this,!!e&&e.trackRemovals)}getSize(e){return this.getMetadata(e).next((e=>e.byteSize))}getMetadata(e){return wl(e).get(is.key).next((e=>(Nr(!!e),e)))}me(e,t){return wl(e).put(is.key,t)}ge(e,t){if(t){const e=As(this.R,t);if(!e.isNoDocument()||!e.version.isEqual(Wr.min()))return e}return Ei.newInvalidDocument(e)}}class bl extends vl{constructor(e,t){super(),this.Ie=e,this.trackRemovals=t,this.Ae=new gl((e=>e.toString()),((e,t)=>e.isEqual(t)))}applyChanges(e){const t=[];let n=0,r=new qo(((e,t)=>Mr(e.canonicalString(),t.canonicalString())));return this.changes.forEach(((i,o)=>{const a=this.Ae.get(i);if(o.document.isValidDocument()){const s=Ds(this.Ie.R,o.document,this.getReadTime(i));r=r.add(i.path.popLast());const l=Xs(s);n+=l-a,t.push(this.Ie.addEntry(e,i,s))}else if(n-=a,this.trackRemovals){const n=Ds(this.Ie.R,Ei.newNoDocument(i,Wr.min()),this.getReadTime(i));t.push(this.Ie.addEntry(e,i,n))}else t.push(this.Ie.removeEntry(e,i))})),r.forEach((n=>{t.push(this.Ie.qt.addToCollectionParentIndex(e,n))})),t.push(this.Ie.updateMetadata(e,n)),gs.waitFor(t)}getFromCache(e,t){return this.Ie.ye(e,t).next((e=>(this.Ae.set(t,e.size),e.document)))}getAllFromCache(e,t){return this.Ie.Ee(e,t).next((({documents:e,Te:t})=>(t.forEach(((e,t)=>{this.Ae.set(e,t)})),e)))}}function wl(e){return Is(e,is.store)}function El(e){return Is(e,rs.store)}function _l(e){return e.path.toArray()}class Cl{constructor(e){this.R=e}Rt(e,t,n,r){Nr(n=0&&r<=11);const i=new vs("createOrUpgrade",t);n<1&&r>=1&&(function(e){e.createObjectStore(Ya.store)}(e),function(e){e.createObjectStore(Xa.store,{keyPath:Xa.keyPath}),e.createObjectStore(Ja.store,{keyPath:Ja.keyPath,autoIncrement:!0}).createIndex(Ja.userMutationsIndex,Ja.userMutationsKeyPath,{unique:!0}),e.createObjectStore(es.store)}(e),Sl(e),function(e){e.createObjectStore(rs.store)}(e));let o=gs.resolve();return n<3&&r>=3&&(0!==n&&(function(e){e.deleteObjectStore(as.store),e.deleteObjectStore(os.store),e.deleteObjectStore(ss.store)}(e),Sl(e)),o=o.next((()=>function(e){const t=e.store(ss.store),n=new ss(0,0,Wr.min().toTimestamp(),0);return t.put(ss.key,n)}(i)))),n<4&&r>=4&&(0!==n&&(o=o.next((()=>function(e,t){return t.store(Ja.store).Nt().next((n=>{e.deleteObjectStore(Ja.store),e.createObjectStore(Ja.store,{keyPath:Ja.keyPath,autoIncrement:!0}).createIndex(Ja.userMutationsIndex,Ja.userMutationsKeyPath,{unique:!0});const r=t.store(Ja.store),i=n.map((e=>r.put(e)));return gs.waitFor(i)}))}(e,i)))),o=o.next((()=>{!function(e){e.createObjectStore(us.store,{keyPath:us.keyPath})}(e)}))),n<5&&r>=5&&(o=o.next((()=>this.Re(i)))),n<6&&r>=6&&(o=o.next((()=>(function(e){e.createObjectStore(is.store)}(e),this.Pe(i))))),n<7&&r>=7&&(o=o.next((()=>this.be(i)))),n<8&&r>=8&&(o=o.next((()=>this.ve(e,i)))),n<9&&r>=9&&(o=o.next((()=>{!function(e){e.objectStoreNames.contains("remoteDocumentChanges")&&e.deleteObjectStore("remoteDocumentChanges")}(e),function(e){const t=e.objectStore(rs.store);t.createIndex(rs.readTimeIndex,rs.readTimeIndexPath,{unique:!1}),t.createIndex(rs.collectionReadTimeIndex,rs.collectionReadTimeIndexPath,{unique:!1})}(t)}))),n<10&&r>=10&&(o=o.next((()=>this.Ve(i)))),n<11&&r>=11&&(o=o.next((()=>{!function(e){e.createObjectStore(cs.store,{keyPath:cs.keyPath})}(e),function(e){e.createObjectStore(ds.store,{keyPath:ds.keyPath})}(e)}))),o}Pe(e){let t=0;return e.store(rs.store).Ot(((e,n)=>{t+=Xs(n)})).next((()=>{const n=new is(t);return e.store(is.store).put(is.key,n)}))}Re(e){const t=e.store(Xa.store),n=e.store(Ja.store);return t.Nt().next((t=>gs.forEach(t,(t=>{const r=IDBKeyRange.bound([t.userId,-1],[t.userId,t.lastAcknowledgedBatchId]);return n.Nt(Ja.userMutationsIndex,r).next((n=>gs.forEach(n,(n=>{Nr(n.userId===t.userId);const r=Fs(this.R,n);return Ys(e,t.userId,r).next((()=>{}))}))))}))))}be(e){const t=e.store(as.store),n=e.store(rs.store);return e.store(ss.store).get(ss.key).next((e=>{const r=[];return n.Ot(((n,i)=>{const o=new Zr(n),a=function(e){return[0,qa(e)]}(o);r.push(t.get(a).next((n=>n?gs.resolve():(n=>t.put(new as(0,qa(n),e.highestListenSequenceNumber)))(o))))})).next((()=>gs.waitFor(r)))}))}ve(e,t){e.createObjectStore(ls.store,{keyPath:ls.keyPath});const n=t.store(ls.store),r=new qs,i=e=>{if(r.add(e)){const t=e.lastSegment(),r=e.popLast();return n.put({collectionId:t,parent:qa(r)})}};return t.store(rs.store).Ot({$t:!0},((e,t)=>{const n=new Zr(e);return i(n.popLast())})).next((()=>t.store(es.store).Ot({$t:!0},(([e,t,n],r)=>{const o=Ga(t);return i(o.popLast())}))))}Ve(e){const t=e.store(os.store);return t.Ot(((e,n)=>{const r=Ws(n),i=Bs(this.R,r);return t.put(i)}))}}function Sl(e){e.createObjectStore(as.store,{keyPath:as.keyPath}).createIndex(as.documentTargetsIndex,as.documentTargetsKeyPath,{unique:!0}),e.createObjectStore(os.store,{keyPath:os.keyPath}).createIndex(os.queryTargetsIndexName,os.queryTargetsKeyPath,{unique:!0}),e.createObjectStore(ss.store)}const xl="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.";class Tl{constructor(e,t,n,r,i,o,a,s,l,u){if(this.allowTabSynchronization=e,this.persistenceKey=t,this.clientId=n,this.Se=i,this.window=o,this.document=a,this.De=l,this.Ce=u,this.Ne=null,this.xe=!1,this.isPrimary=!1,this.networkEnabled=!0,this.ke=null,this.inForeground=!1,this.$e=null,this.Oe=null,this.Me=Number.NEGATIVE_INFINITY,this.Fe=e=>Promise.resolve(),!Tl.gt())throw new _r(Er.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new pl(this,r),this.Le=t+"main",this.R=new Ns(s),this.Be=new ys(this.Le,11,new Cl(this.R)),this.Ue=new ol(this.referenceDelegate,this.R),this.qt=new Hs,this.qe=function(e,t){return new yl(e,t)}(this.R,this.qt),this.Ke=new Us,this.window&&this.window.localStorage?this.Qe=this.window.localStorage:(this.Qe=null,!1===u&&Ir("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.je().then((()=>{if(!this.isPrimary&&!this.allowTabSynchronization)throw new _r(Er.FAILED_PRECONDITION,xl);return this.We(),this.Ge(),this.ze(),this.runTransaction("getHighestListenSequenceNumber","readonly",(e=>this.Ue.getHighestSequenceNumber(e)))})).then((e=>{this.Ne=new wr(e,this.De)})).then((()=>{this.xe=!0})).catch((e=>(this.Be&&this.Be.close(),Promise.reject(e))))}He(e){return this.Fe=async t=>{if(this.started)return e(t)},e(this.isPrimary)}setDatabaseDeletedListener(e){this.Be.bt((async t=>{null===t.newVersion&&await e()}))}setNetworkEnabled(e){this.networkEnabled!==e&&(this.networkEnabled=e,this.Se.enqueueAndForget((async()=>{this.started&&await this.je()})))}je(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(e=>kl(e).put(new us(this.clientId,Date.now(),this.networkEnabled,this.inForeground)).next((()=>{if(this.isPrimary)return this.Je(e).next((e=>{e||(this.isPrimary=!1,this.Se.enqueueRetryable((()=>this.Fe(!1))))}))})).next((()=>this.Ye(e))).next((t=>this.isPrimary&&!t?this.Xe(e).next((()=>!1)):!!t&&this.Ze(e).next((()=>!0)))))).catch((e=>{if(Es(e))return Tr("IndexedDbPersistence","Failed to extend owner lease: ",e),this.isPrimary;if(!this.allowTabSynchronization)throw e;return Tr("IndexedDbPersistence","Releasing owner lease after error during lease refresh",e),!1})).then((e=>{this.isPrimary!==e&&this.Se.enqueueRetryable((()=>this.Fe(e))),this.isPrimary=e}))}Je(e){return Il(e).get(Ya.key).next((e=>gs.resolve(this.tn(e))))}en(e){return kl(e).delete(this.clientId)}async nn(){if(this.isPrimary&&!this.sn(this.Me,18e5)){this.Me=Date.now();const e=await this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(e=>{const t=Is(e,us.store);return t.Nt().next((e=>{const n=this.rn(e,18e5),r=e.filter((e=>-1===n.indexOf(e)));return gs.forEach(r,(e=>t.delete(e.clientId))).next((()=>r))}))})).catch((()=>[]));if(this.Qe)for(const t of e)this.Qe.removeItem(this.on(t.clientId))}}ze(){this.Oe=this.Se.enqueueAfterDelay("client_metadata_refresh",4e3,(()=>this.je().then((()=>this.nn())).then((()=>this.ze()))))}tn(e){return!!e&&e.ownerId===this.clientId}Ye(e){return this.Ce?gs.resolve(!0):Il(e).get(Ya.key).next((t=>{if(null!==t&&this.sn(t.leaseTimestampMs,5e3)&&!this.cn(t.ownerId)){if(this.tn(t)&&this.networkEnabled)return!0;if(!this.tn(t)){if(!t.allowTabSynchronization)throw new _r(Er.FAILED_PRECONDITION,xl);return!1}}return!(!this.networkEnabled||!this.inForeground)||kl(e).Nt().next((e=>void 0===this.rn(e,5e3).find((e=>{if(this.clientId!==e.clientId){const t=!this.networkEnabled&&e.networkEnabled,n=!this.inForeground&&e.inForeground,r=this.networkEnabled===e.networkEnabled;if(t||n&&r)return!0}return!1}))))})).next((e=>(this.isPrimary!==e&&Tr("IndexedDbPersistence",`Client ${e?"is":"is not"} eligible for a primary lease.`),e)))}async shutdown(){this.xe=!1,this.an(),this.Oe&&(this.Oe.cancel(),this.Oe=null),this.un(),this.hn(),await this.Be.runTransaction("shutdown","readwrite",[Ya.store,us.store],(e=>{const t=new Ts(e,wr.o);return this.Xe(t).next((()=>this.en(t)))})),this.Be.close(),this.ln()}rn(e,t){return e.filter((e=>this.sn(e.updateTimeMs,t)&&!this.cn(e.clientId)))}fn(){return this.runTransaction("getActiveClients","readonly",(e=>kl(e).Nt().next((e=>this.rn(e,18e5).map((e=>e.clientId))))))}get started(){return this.xe}getMutationQueue(e){return Js.Qt(e,this.R,this.qt,this.referenceDelegate)}getTargetCache(){return this.Ue}getRemoteDocumentCache(){return this.qe}getIndexManager(){return this.qt}getBundleCache(){return this.Ke}runTransaction(e,t,n){Tr("IndexedDbPersistence","Starting transaction:",e);const r="readonly"===t?"readonly":"readwrite";let i;return this.Be.runTransaction(e,r,hs,(r=>(i=new Ts(r,this.Ne?this.Ne.next():wr.o),"readwrite-primary"===t?this.Je(i).next((e=>!!e||this.Ye(i))).next((t=>{if(!t)throw Ir(`Failed to obtain primary lease for action '${e}'.`),this.isPrimary=!1,this.Se.enqueueRetryable((()=>this.Fe(!1))),new _r(Er.FAILED_PRECONDITION,fs);return n(i)})).next((e=>this.Ze(i).next((()=>e)))):this.dn(i).next((()=>n(i)))))).then((e=>(i.raiseOnCommittedEvent(),e)))}dn(e){return Il(e).get(Ya.key).next((e=>{if(null!==e&&this.sn(e.leaseTimestampMs,5e3)&&!this.cn(e.ownerId)&&!this.tn(e)&&!(this.Ce||this.allowTabSynchronization&&e.allowTabSynchronization))throw new _r(Er.FAILED_PRECONDITION,xl)}))}Ze(e){const t=new Ya(this.clientId,this.allowTabSynchronization,Date.now());return Il(e).put(Ya.key,t)}static gt(){return ys.gt()}Xe(e){const t=Il(e);return t.get(Ya.key).next((e=>this.tn(e)?(Tr("IndexedDbPersistence","Releasing primary lease."),t.delete(Ya.key)):gs.resolve()))}sn(e,t){const n=Date.now();return!(en&&(Ir(`Detected an update time that is in the future: ${e} > ${n}`),1))}We(){null!==this.document&&"function"==typeof this.document.addEventListener&&(this.$e=()=>{this.Se.enqueueAndForget((()=>(this.inForeground="visible"===this.document.visibilityState,this.je())))},this.document.addEventListener("visibilitychange",this.$e),this.inForeground="visible"===this.document.visibilityState)}un(){this.$e&&(this.document.removeEventListener("visibilitychange",this.$e),this.$e=null)}Ge(){var e;"function"==typeof(null===(e=this.window)||void 0===e?void 0:e.addEventListener)&&(this.ke=()=>{this.an(),this.Se.enqueueAndForget((()=>this.shutdown()))},this.window.addEventListener("pagehide",this.ke))}hn(){this.ke&&(this.window.removeEventListener("pagehide",this.ke),this.ke=null)}cn(e){var t;try{const n=null!==(null===(t=this.Qe)||void 0===t?void 0:t.getItem(this.on(e)));return Tr("IndexedDbPersistence",`Client '${e}' ${n?"is":"is not"} zombied in LocalStorage`),n}catch(e){return Ir("IndexedDbPersistence","Failed to get zombied client id.",e),!1}}an(){if(this.Qe)try{this.Qe.setItem(this.on(this.clientId),String(Date.now()))}catch(e){Ir("Failed to set zombie client id.",e)}}ln(){if(this.Qe)try{this.Qe.removeItem(this.on(this.clientId))}catch(e){}}on(e){return`firestore_zombie_${this.persistenceKey}_${e}`}}function Il(e){return Is(e,Ya.store)}function kl(e){return Is(e,us.store)}function Ol(e,t){let n=e.projectId;return e.isDefaultDatabase||(n+="."+e.database),"firestore/"+t+"/"+n+"/"}class Pl{constructor(e,t){this.progress=e,this.wn=t}}class Nl{constructor(e,t,n){this.qe=e,this._n=t,this.qt=n}mn(e,t){return this._n.getAllMutationBatchesAffectingDocumentKey(e,t).next((n=>this.gn(e,t,n)))}gn(e,t,n){return this.qe.getEntry(e,t).next((e=>{for(const t of n)t.applyToLocalView(e);return e}))}yn(e,t){e.forEach(((e,n)=>{for(const e of t)e.applyToLocalView(n)}))}pn(e,t){return this.qe.getEntries(e,t).next((t=>this.En(e,t).next((()=>t))))}En(e,t){return this._n.getAllMutationBatchesAffectingDocumentKeys(e,t).next((e=>this.yn(t,e)))}getDocumentsMatchingQuery(e,t,n){return function(e){return oi.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}(t)?this.Tn(e,t.path):Gi(t)?this.In(e,t,n):this.An(e,t,n)}Tn(e,t){return this.mn(e,new oi(t)).next((e=>{let t=Yo();return e.isFoundDocument()&&(t=t.insert(e.key,e)),t}))}In(e,t,n){const r=t.collectionGroup;let i=Yo();return this.qt.getCollectionParents(e,r).next((o=>gs.forEach(o,(o=>{const a=function(e,t){return new Ui(t,null,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(t,o.child(r));return this.An(e,a,n).next((e=>{e.forEach(((e,t)=>{i=i.insert(e,t)}))}))})).next((()=>i))))}An(e,t,n){let r,i;return this.qe.getDocumentsMatchingQuery(e,t,n).next((n=>(r=n,this._n.getAllMutationBatchesAffectingQuery(e,t)))).next((t=>(i=t,this.Rn(e,i,r).next((e=>{r=e;for(const e of i)for(const t of e.mutations){const n=t.key;let i=r.get(n);null==i&&(i=Ei.newInvalidDocument(n),r=r.insert(n,i)),Io(t,i,e.localWriteTime),i.isFoundDocument()||(r=r.remove(n))}}))))).next((()=>(r.forEach(((e,n)=>{no(t,n)||(r=r.remove(e))})),r)))}Rn(e,t,n){let r=ta();for(const e of t)for(const t of e.mutations)t instanceof Ao&&null===n.get(t.key)&&(r=r.add(t.key));let i=n;return this.qe.getEntries(e,r).next((e=>(e.forEach(((e,t)=>{t.isFoundDocument()&&(i=i.insert(e,t))})),i)))}}class Al{constructor(e,t,n,r){this.targetId=e,this.fromCache=t,this.Pn=n,this.bn=r}static vn(e,t){let n=ta(),r=ta();for(const 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 Al(e,t.fromCache,n,r)}}class Dl{Vn(e){this.Sn=e}getDocumentsMatchingQuery(e,t,n,r){return function(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())}(t)||n.isEqual(Wr.min())?this.Dn(e,t):this.Sn.pn(e,r).next((i=>{const o=this.Cn(t,i);return($i(t)||qi(t))&&this.Nn(t.limitType,o,r,n)?this.Dn(e,t):(Sr()<=h.in.DEBUG&&Tr("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),to(t)),this.Sn.getDocumentsMatchingQuery(e,t,n).next((e=>(o.forEach((t=>{e=e.insert(t.key,t)})),e))))}))}Cn(e,t){let n=new qo(ro(e));return t.forEach(((t,r)=>{no(e,r)&&(n=n.add(r))})),n}Nn(e,t,n,r){if(n.size!==t.size)return!0;const i="F"===e?t.last():t.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(r)>0)}Dn(e,t){return Sr()<=h.in.DEBUG&&Tr("QueryEngine","Using full collection scan to execute query:",to(t)),this.Sn.getDocumentsMatchingQuery(e,t,Wr.min())}}class Rl{constructor(e,t,n,r){this.persistence=e,this.xn=t,this.R=r,this.kn=new Vo(Mr),this.$n=new gl((e=>Si(e)),xi),this.On=Wr.min(),this._n=e.getMutationQueue(n),this.Mn=e.getRemoteDocumentCache(),this.Ue=e.getTargetCache(),this.Fn=new Nl(this.Mn,this._n,this.persistence.getIndexManager()),this.Ke=e.getBundleCache(),this.xn.Vn(this.Fn)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(t=>e.collect(t,this.kn)))}}function Ml(e,t,n,r){return new Rl(e,t,n,r)}async function Ll(e,t){const n=Ar(e);let r=n._n,i=n.Fn;const o=await n.persistence.runTransaction("Handle user change","readonly",(e=>{let o;return n._n.getAllMutationBatches(e).next((a=>(o=a,r=n.persistence.getMutationQueue(t),i=new Nl(n.Mn,r,n.persistence.getIndexManager()),r.getAllMutationBatches(e)))).next((t=>{const n=[],r=[];let a=ta();for(const e of o){n.push(e.batchId);for(const t of e.mutations)a=a.add(t.key)}for(const e of t){r.push(e.batchId);for(const t of e.mutations)a=a.add(t.key)}return i.pn(e,a).next((e=>({Ln:e,removedBatchIds:n,addedBatchIds:r})))}))}));return n._n=r,n.Fn=i,n.xn.Vn(n.Fn),o}function jl(e){const t=Ar(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",(e=>t.Ue.getLastRemoteSnapshotVersion(e)))}function Fl(e,t,n,r,i){let o=ta();return n.forEach((e=>o=o.add(e))),t.getEntries(e,o).next((e=>{let o=Go();return n.forEach(((n,a)=>{const s=e.get(n),l=(null==i?void 0:i.get(n))||r;a.isNoDocument()&&a.version.isEqual(Wr.min())?(t.removeEntry(n,l),o=o.insert(n,a)):!s.isValidDocument()||a.version.compareTo(s.version)>0||0===a.version.compareTo(s.version)&&s.hasPendingWrites?(t.addEntry(a,l),o=o.insert(n,a)):Tr("LocalStore","Ignoring outdated watch update for ",n,". Current version:",s.version," Watch version:",a.version)})),o}))}function Wl(e,t){const n=Ar(e);return n.persistence.runTransaction("Get next mutation batch","readonly",(e=>(void 0===t&&(t=-1),n._n.getNextMutationBatchAfterBatchId(e,t))))}function Bl(e,t){const n=Ar(e);return n.persistence.runTransaction("Allocate target","readwrite",(e=>{let r;return n.Ue.getTargetData(e,t).next((i=>i?(r=i,gs.resolve(r)):n.Ue.allocateTargetId(e).next((i=>(r=new Ps(t,i,0,e.currentSequenceNumber),n.Ue.addTargetData(e,r).next((()=>r)))))))})).then((e=>{const r=n.kn.get(e.targetId);return(null===r||e.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.kn=n.kn.insert(e.targetId,e),n.$n.set(t,e.targetId)),e}))}async function zl(e,t,n){const r=Ar(e),i=r.kn.get(t),o=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",o,(e=>r.persistence.referenceDelegate.removeTarget(e,i)))}catch(e){if(!Es(e))throw e;Tr("LocalStore",`Failed to update sequence numbers for target ${t}: ${e}`)}r.kn=r.kn.remove(t),r.$n.delete(i.target)}function Ul(e,t,n){const r=Ar(e);let i=Wr.min(),o=ta();return r.persistence.runTransaction("Execute query","readonly",(e=>function(e,t,n){const r=Ar(e),i=r.$n.get(n);return void 0!==i?gs.resolve(r.kn.get(i)):r.Ue.getTargetData(t,n)}(r,e,Yi(t)).next((t=>{if(t)return i=t.lastLimboFreeSnapshotVersion,r.Ue.getMatchingKeysForTargetId(e,t.targetId).next((e=>{o=e}))})).next((()=>r.xn.getDocumentsMatchingQuery(e,t,n?i:Wr.min(),n?o:ta()))).next((e=>({documents:e,Bn:o})))))}function Vl(e,t){const n=Ar(e),r=Ar(n.Ue),i=n.kn.get(t);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",(e=>r.lt(e,t).next((e=>e?e.target:null))))}function Zl(e){const t=Ar(e);return t.persistence.runTransaction("Get new document changes","readonly",(e=>function(e,t,n){const r=Ar(e);let i=Go(),o=Rs(n);const a=El(t),s=IDBKeyRange.lowerBound(o,!0);return a.Ot({index:rs.readTimeIndex,range:s},((e,t)=>{const n=As(r.R,t);i=i.insert(n.key,n),o=t.readTime})).next((()=>({wn:i,readTime:Ms(o)})))}(t.Mn,e,t.On))).then((({wn:e,readTime:n})=>(t.On=n,e)))}async function $l(e,t,n=ta()){const r=await Bl(e,Yi(zs(t.bundledQuery))),i=Ar(e);return i.persistence.runTransaction("Save named query","readwrite",(e=>{const o=ba(t.readTime);if(r.snapshotVersion.compareTo(o)>=0)return i.Ke.saveNamedQuery(e,t);const a=r.withResumeToken(Kr.EMPTY_BYTE_STRING,o);return i.kn=i.kn.insert(a.targetId,a),i.Ue.updateTargetData(e,a).next((()=>i.Ue.removeMatchingKeysForTargetId(e,r.targetId))).next((()=>i.Ue.addMatchingKeys(e,n,r.targetId))).next((()=>i.Ke.saveNamedQuery(e,t)))}))}class ql{constructor(e){this.R=e,this.Qn=new Map,this.jn=new Map}getBundleMetadata(e,t){return gs.resolve(this.Qn.get(t))}saveBundleMetadata(e,t){var n;return this.Qn.set(t.id,{id:(n=t).id,version:n.version,createTime:ba(n.createTime)}),gs.resolve()}getNamedQuery(e,t){return gs.resolve(this.jn.get(t))}saveNamedQuery(e,t){return this.jn.set(t.name,function(e){return{name:e.name,query:zs(e.bundledQuery),readTime:ba(e.readTime)}}(t)),gs.resolve()}}class Hl{constructor(){this.Wn=new qo(Kl.Gn),this.zn=new qo(Kl.Hn)}isEmpty(){return this.Wn.isEmpty()}addReference(e,t){const n=new Kl(e,t);this.Wn=this.Wn.add(n),this.zn=this.zn.add(n)}Jn(e,t){e.forEach((e=>this.addReference(e,t)))}removeReference(e,t){this.Yn(new Kl(e,t))}Xn(e,t){e.forEach((e=>this.removeReference(e,t)))}Zn(e){const t=new oi(new Zr([])),n=new Kl(t,e),r=new Kl(t,e+1),i=[];return this.zn.forEachInRange([n,r],(e=>{this.Yn(e),i.push(e.key)})),i}ts(){this.Wn.forEach((e=>this.Yn(e)))}Yn(e){this.Wn=this.Wn.delete(e),this.zn=this.zn.delete(e)}es(e){const t=new oi(new Zr([])),n=new Kl(t,e),r=new Kl(t,e+1);let i=ta();return this.zn.forEachInRange([n,r],(e=>{i=i.add(e.key)})),i}containsKey(e){const t=new Kl(e,0),n=this.Wn.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)}}class Kl{constructor(e,t){this.key=e,this.ns=t}static Gn(e,t){return oi.comparator(e.key,t.key)||Mr(e.ns,t.ns)}static Hn(e,t){return Mr(e.ns,t.ns)||oi.comparator(e.key,t.key)}}class Gl{constructor(e,t){this.qt=e,this.referenceDelegate=t,this._n=[],this.ss=1,this.rs=new qo(Kl.Gn)}checkEmpty(e){return gs.resolve(0===this._n.length)}addMutationBatch(e,t,n,r){const i=this.ss;this.ss++,this._n.length>0&&this._n[this._n.length-1];const o=new ks(i,t,n,r);this._n.push(o);for(const t of r)this.rs=this.rs.add(new Kl(t.key,i)),this.qt.addToCollectionParentIndex(e,t.key.path.popLast());return gs.resolve(o)}lookupMutationBatch(e,t){return gs.resolve(this.os(t))}getNextMutationBatchAfterBatchId(e,t){const n=t+1,r=this.cs(n),i=r<0?0:r;return gs.resolve(this._n.length>i?this._n[i]:null)}getHighestUnacknowledgedBatchId(){return gs.resolve(0===this._n.length?-1:this.ss-1)}getAllMutationBatches(e){return gs.resolve(this._n.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const n=new Kl(t,0),r=new Kl(t,Number.POSITIVE_INFINITY),i=[];return this.rs.forEachInRange([n,r],(e=>{const t=this.os(e.ns);i.push(t)})),gs.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new qo(Mr);return t.forEach((e=>{const t=new Kl(e,0),r=new Kl(e,Number.POSITIVE_INFINITY);this.rs.forEachInRange([t,r],(e=>{n=n.add(e.ns)}))})),gs.resolve(this.us(n))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,r=n.length+1;let i=n;oi.isDocumentKey(i)||(i=i.child(""));const o=new Kl(new oi(i),0);let a=new qo(Mr);return this.rs.forEachWhile((e=>{const t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===r&&(a=a.add(e.ns)),!0)}),o),gs.resolve(this.us(a))}us(e){const t=[];return e.forEach((e=>{const n=this.os(e);null!==n&&t.push(n)})),t}removeMutationBatch(e,t){Nr(0===this.hs(t.batchId,"removed")),this._n.shift();let n=this.rs;return gs.forEach(t.mutations,(r=>{const i=new Kl(r.key,t.batchId);return n=n.delete(i),this.referenceDelegate.markPotentiallyOrphaned(e,r.key)})).next((()=>{this.rs=n}))}Gt(e){}containsKey(e,t){const n=new Kl(t,0),r=this.rs.firstAfterOrEqual(n);return gs.resolve(t.isEqual(r&&r.key))}performConsistencyCheck(e){return this._n.length,gs.resolve()}hs(e,t){return this.cs(e)}cs(e){return 0===this._n.length?0:e-this._n[0].batchId}os(e){const t=this.cs(e);return t<0||t>=this._n.length?null:this._n[t]}}class Ql{constructor(e,t){this.qt=e,this.ls=t,this.docs=new Vo(oi.comparator),this.size=0}addEntry(e,t,n){const r=t.key,i=this.docs.get(r),o=i?i.size:0,a=this.ls(t);return this.docs=this.docs.insert(r,{document:t.clone(),size:a,readTime:n}),this.size+=a-o,this.qt.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const n=this.docs.get(t);return gs.resolve(n?n.document.clone():Ei.newInvalidDocument(t))}getEntries(e,t){let n=Go();return t.forEach((e=>{const t=this.docs.get(e);n=n.insert(e,t?t.document.clone():Ei.newInvalidDocument(e))})),gs.resolve(n)}getDocumentsMatchingQuery(e,t,n){let r=Go();const i=new oi(t.path.child("")),o=this.docs.getIteratorFrom(i);for(;o.hasNext();){const{key:e,value:{document:i,readTime:a}}=o.getNext();if(!t.path.isPrefixOf(e.path))break;a.compareTo(n)<=0||no(t,i)&&(r=r.insert(i.key,i.clone()))}return gs.resolve(r)}fs(e,t){return gs.forEach(this.docs,(e=>t(e)))}newChangeBuffer(e){return new Yl(this)}getSize(e){return gs.resolve(this.size)}}class Yl extends vl{constructor(e){super(),this.Ie=e}applyChanges(e){const t=[];return this.changes.forEach(((n,r)=>{r.document.isValidDocument()?t.push(this.Ie.addEntry(e,r.document,this.getReadTime(n))):this.Ie.removeEntry(n)})),gs.waitFor(t)}getFromCache(e,t){return this.Ie.getEntry(e,t)}getAllFromCache(e,t){return this.Ie.getEntries(e,t)}}class Xl{constructor(e){this.persistence=e,this.ds=new gl((e=>Si(e)),xi),this.lastRemoteSnapshotVersion=Wr.min(),this.highestTargetId=0,this.ws=0,this._s=new Hl,this.targetCount=0,this.gs=il.Jt()}forEachTarget(e,t){return this.ds.forEach(((e,n)=>t(n))),gs.resolve()}getLastRemoteSnapshotVersion(e){return gs.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return gs.resolve(this.ws)}allocateTargetId(e){return this.highestTargetId=this.gs.next(),gs.resolve(this.highestTargetId)}setTargetsMetadata(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.ws&&(this.ws=t),gs.resolve()}te(e){this.ds.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.gs=new il(t),this.highestTargetId=t),e.sequenceNumber>this.ws&&(this.ws=e.sequenceNumber)}addTargetData(e,t){return this.te(t),this.targetCount+=1,gs.resolve()}updateTargetData(e,t){return this.te(t),gs.resolve()}removeTargetData(e,t){return this.ds.delete(t.target),this._s.Zn(t.targetId),this.targetCount-=1,gs.resolve()}removeTargets(e,t,n){let r=0;const i=[];return this.ds.forEach(((o,a)=>{a.sequenceNumber<=t&&null===n.get(a.targetId)&&(this.ds.delete(o),i.push(this.removeMatchingKeysForTargetId(e,a.targetId)),r++)})),gs.waitFor(i).next((()=>r))}getTargetCount(e){return gs.resolve(this.targetCount)}getTargetData(e,t){const n=this.ds.get(t)||null;return gs.resolve(n)}addMatchingKeys(e,t,n){return this._s.Jn(t,n),gs.resolve()}removeMatchingKeys(e,t,n){this._s.Xn(t,n);const r=this.persistence.referenceDelegate,i=[];return r&&t.forEach((t=>{i.push(r.markPotentiallyOrphaned(e,t))})),gs.waitFor(i)}removeMatchingKeysForTargetId(e,t){return this._s.Zn(t),gs.resolve()}getMatchingKeysForTargetId(e,t){const n=this._s.es(t);return gs.resolve(n)}containsKey(e,t){return gs.resolve(this._s.containsKey(t))}}class Jl{constructor(e,t){this.ys={},this.Ne=new wr(0),this.xe=!1,this.xe=!0,this.referenceDelegate=e(this),this.Ue=new Xl(this),this.qt=new $s,this.qe=function(e,t){return new Ql(e,t)}(this.qt,(e=>this.referenceDelegate.ps(e))),this.R=new Ns(t),this.Ke=new ql(this.R)}start(){return Promise.resolve()}shutdown(){return this.xe=!1,Promise.resolve()}get started(){return this.xe}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(){return this.qt}getMutationQueue(e){let t=this.ys[e.toKey()];return t||(t=new Gl(this.qt,this.referenceDelegate),this.ys[e.toKey()]=t),t}getTargetCache(){return this.Ue}getRemoteDocumentCache(){return this.qe}getBundleCache(){return this.Ke}runTransaction(e,t,n){Tr("MemoryPersistence","Starting transaction:",e);const r=new eu(this.Ne.next());return this.referenceDelegate.Es(),n(r).next((e=>this.referenceDelegate.Ts(r).next((()=>e)))).toPromise().then((e=>(r.raiseOnCommittedEvent(),e)))}Is(e,t){return gs.or(Object.values(this.ys).map((n=>()=>n.containsKey(e,t))))}}class eu extends ps{constructor(e){super(),this.currentSequenceNumber=e}}class tu{constructor(e){this.persistence=e,this.As=new Hl,this.Rs=null}static Ps(e){return new tu(e)}get bs(){if(this.Rs)return this.Rs;throw Pr()}addReference(e,t,n){return this.As.addReference(n,t),this.bs.delete(n.toString()),gs.resolve()}removeReference(e,t,n){return this.As.removeReference(n,t),this.bs.add(n.toString()),gs.resolve()}markPotentiallyOrphaned(e,t){return this.bs.add(t.toString()),gs.resolve()}removeTarget(e,t){this.As.Zn(t.targetId).forEach((e=>this.bs.add(e.toString())));const 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)))}Es(){this.Rs=new Set}Ts(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return gs.forEach(this.bs,(n=>{const r=oi.fromPath(n);return this.vs(e,r).next((e=>{e||t.removeEntry(r)}))})).next((()=>(this.Rs=null,t.apply(e))))}updateLimboDocument(e,t){return this.vs(e,t).next((e=>{e?this.bs.delete(t.toString()):this.bs.add(t.toString())}))}ps(e){return 0}vs(e,t){return gs.or([()=>gs.resolve(this.As.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Is(e,t)])}}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}}function ru(e,t){return`firestore_clients_${e}_${t}`}function iu(e,t,n){let r=`firestore_mutations_${e}_${n}`;return t.isAuthenticated()&&(r+=`_${t.uid}`),r}function ou(e,t){return`firestore_targets_${e}_${t}`}nu.UNAUTHENTICATED=new nu(null),nu.GOOGLE_CREDENTIALS=new nu("google-credentials-uid"),nu.FIRST_PARTY=new nu("first-party-uid");class au{constructor(e,t,n,r){this.user=e,this.batchId=t,this.state=n,this.error=r}static Vs(e,t,n){const r=JSON.parse(n);let i,o="object"==typeof r&&-1!==["pending","acknowledged","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error);return o&&r.error&&(o="string"==typeof r.error.message&&"string"==typeof r.error.code,o&&(i=new _r(r.error.code,r.error.message))),o?new au(e,t,r.state,i):(Ir("SharedClientState",`Failed to parse mutation state for ID '${t}': ${n}`),null)}Ss(){const e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class su{constructor(e,t,n){this.targetId=e,this.state=t,this.error=n}static Vs(e,t){const n=JSON.parse(t);let r,i="object"==typeof n&&-1!==["not-current","current","rejected"].indexOf(n.state)&&(void 0===n.error||"object"==typeof n.error);return i&&n.error&&(i="string"==typeof n.error.message&&"string"==typeof n.error.code,i&&(r=new _r(n.error.code,n.error.message))),i?new su(e,n.state,r):(Ir("SharedClientState",`Failed to parse target state for ID '${e}': ${t}`),null)}Ss(){const e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class lu{constructor(e,t){this.clientId=e,this.activeTargetIds=t}static Vs(e,t){const n=JSON.parse(t);let r="object"==typeof n&&n.activeTargetIds instanceof Array,i=ra();for(let e=0;r&&ethis.shutdown())),this.started=!0}writeSequenceNumber(e){this.setItem(this.Fs,JSON.stringify(e))}getAllActiveQueryTargets(){return this.Gs(this.$s)}isActiveQueryTarget(e){let t=!1;return this.$s.forEach(((n,r)=>{r.activeTargetIds.has(e)&&(t=!0)})),t}addPendingMutation(e){this.zs(e,"pending")}updateMutationState(e,t,n){this.zs(e,t,n),this.Hs(e)}addLocalQueryTarget(e){let t="not-current";if(this.isActiveQueryTarget(e)){const n=this.storage.getItem(ou(this.persistenceKey,e));if(n){const r=su.Vs(e,n);r&&(t=r.state)}}return this.Js.Ds(e),this.Qs(),t}removeLocalQueryTarget(e){this.Js.Cs(e),this.Qs()}isLocalQueryTarget(e){return this.Js.activeTargetIds.has(e)}clearQueryState(e){this.removeItem(ou(this.persistenceKey,e))}updateQueryState(e,t,n){this.Ys(e,t,n)}handleUserChange(e,t,n){t.forEach((e=>{this.Hs(e)})),this.currentUser=e,n.forEach((e=>{this.addPendingMutation(e)}))}setOnlineState(e){this.Xs(e)}notifyBundleLoaded(){this.Zs()}shutdown(){this.started&&(this.window.removeEventListener("storage",this.xs),this.removeItem(this.Ms),this.started=!1)}getItem(e){const t=this.storage.getItem(e);return Tr("SharedClientState","READ",e,t),t}setItem(e,t){Tr("SharedClientState","SET",e,t),this.storage.setItem(e,t)}removeItem(e){Tr("SharedClientState","REMOVE",e),this.storage.removeItem(e)}ks(e){const t=e;if(t.storageArea===this.storage){if(Tr("SharedClientState","EVENT",t.key,t.newValue),t.key===this.Ms)return void Ir("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Se.enqueueRetryable((async()=>{if(this.started){if(null!==t.key)if(this.Ls.test(t.key)){if(null==t.newValue){const e=this.ti(t.key);return this.ei(e,null)}{const e=this.ni(t.key,t.newValue);if(e)return this.ei(e.clientId,e)}}else if(this.Bs.test(t.key)){if(null!==t.newValue){const e=this.si(t.key,t.newValue);if(e)return this.ii(e)}}else if(this.Us.test(t.key)){if(null!==t.newValue){const e=this.ri(t.key,t.newValue);if(e)return this.oi(e)}}else if(t.key===this.qs){if(null!==t.newValue){const e=this.js(t.newValue);if(e)return this.Ws(e)}}else if(t.key===this.Fs){const e=function(e){let t=wr.o;if(null!=e)try{const n=JSON.parse(e);Nr("number"==typeof n),t=n}catch(e){Ir("SharedClientState","Failed to read sequence number from WebStorage",e)}return t}(t.newValue);e!==wr.o&&this.sequenceNumberHandler(e)}else if(t.key===this.Ks)return this.syncEngine.ci()}else this.Os.push(t)}))}}get Js(){return this.$s.get(this.Ns)}Qs(){this.setItem(this.Ms,this.Js.Ss())}zs(e,t,n){const r=new au(this.currentUser,e,t,n),i=iu(this.persistenceKey,this.currentUser,e);this.setItem(i,r.Ss())}Hs(e){const t=iu(this.persistenceKey,this.currentUser,e);this.removeItem(t)}Xs(e){const t={clientId:this.Ns,onlineState:e};this.storage.setItem(this.qs,JSON.stringify(t))}Ys(e,t,n){const r=ou(this.persistenceKey,e),i=new su(e,t,n);this.setItem(r,i.Ss())}Zs(){this.setItem(this.Ks,"value-not-used")}ti(e){const t=this.Ls.exec(e);return t?t[1]:null}ni(e,t){const n=this.ti(e);return lu.Vs(n,t)}si(e,t){const n=this.Bs.exec(e),r=Number(n[1]),i=void 0!==n[2]?n[2]:null;return au.Vs(new nu(i),r,t)}ri(e,t){const n=this.Us.exec(e),r=Number(n[1]);return su.Vs(r,t)}js(e){return uu.Vs(e)}async ii(e){if(e.user.uid===this.currentUser.uid)return this.syncEngine.ai(e.batchId,e.state,e.error);Tr("SharedClientState",`Ignoring mutation for non-active user ${e.user.uid}`)}oi(e){return this.syncEngine.ui(e.targetId,e.state,e.error)}ei(e,t){const n=t?this.$s.insert(e,t):this.$s.remove(e),r=this.Gs(this.$s),i=this.Gs(n),o=[],a=[];return i.forEach((e=>{r.has(e)||o.push(e)})),r.forEach((e=>{i.has(e)||a.push(e)})),this.syncEngine.hi(o,a).then((()=>{this.$s=n}))}Ws(e){this.$s.get(e.clientId)&&this.onlineStateHandler(e.onlineState)}Gs(e){let t=ra();return e.forEach(((e,n)=>{t=t.unionWith(n.activeTargetIds)})),t}}class hu{constructor(){this.li=new cu,this.fi={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,n){}addLocalQueryTarget(e){return this.li.Ds(e),this.fi[e]||"not-current"}updateQueryState(e,t,n){this.fi[e]=t}removeLocalQueryTarget(e){this.li.Cs(e)}isLocalQueryTarget(e){return this.li.activeTargetIds.has(e)}clearQueryState(e){delete this.fi[e]}getAllActiveQueryTargets(){return this.li.activeTargetIds}isActiveQueryTarget(e){return this.li.activeTargetIds.has(e)}start(){return this.li=new cu,Promise.resolve()}handleUserChange(e,t,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(){}}class fu{di(e){}shutdown(){}}class pu{constructor(){this.wi=()=>this._i(),this.mi=()=>this.gi(),this.yi=[],this.pi()}di(e){this.yi.push(e)}shutdown(){window.removeEventListener("online",this.wi),window.removeEventListener("offline",this.mi)}pi(){window.addEventListener("online",this.wi),window.addEventListener("offline",this.mi)}_i(){Tr("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const e of this.yi)e(0)}gi(){Tr("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const e of this.yi)e(1)}static gt(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}const mu={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"};class gu{constructor(e){this.Ei=e.Ei,this.Ti=e.Ti}Ii(e){this.Ai=e}Ri(e){this.Pi=e}onMessage(e){this.bi=e}close(){this.Ti()}send(e){this.Ei(e)}vi(){this.Ai()}Vi(e){this.Pi(e)}Si(e){this.bi(e)}}class vu extends class{constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http";this.Di=t+"://"+e.host,this.Ci="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}Ni(e,t,n,r){const i=this.xi(e,t);Tr("RestConnection","Sending: ",i,n);const o={};return this.ki(o,r),this.$i(e,i,o,n).then((e=>(Tr("RestConnection","Received: ",e),e)),(t=>{throw kr("RestConnection",`${e} failed with error: `,t,"url: ",i,"request:",n),t}))}Oi(e,t,n,r){return this.Ni(e,t,n,r)}ki(e,t){if(e["X-Goog-Api-Client"]="gl-js/ fire/"+br,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t)for(const n in t.authHeaders)t.authHeaders.hasOwnProperty(n)&&(e[n]=t.authHeaders[n])}xi(e,t){const n=mu[e];return`${this.Di}/v1/${t}:${n}`}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling}$i(e,t,n,r){return new Promise(((i,o)=>{const a=new yr;a.listenOnce(fr.COMPLETE,(()=>{try{switch(a.getLastErrorCode()){case hr.NO_ERROR:const t=a.getResponseJson();Tr("Connection","XHR received:",JSON.stringify(t)),i(t);break;case hr.TIMEOUT:Tr("Connection",'RPC "'+e+'" timed out'),o(new _r(Er.DEADLINE_EXCEEDED,"Request time out"));break;case hr.HTTP_ERROR:const n=a.getStatus();if(Tr("Connection",'RPC "'+e+'" failed with status:',n,"response text:",a.getResponseText()),n>0){const e=a.getResponseJson().error;if(e&&e.status&&e.message){const t=function(e){const t=e.toLowerCase().replace(/_/g,"-");return Object.values(Er).indexOf(t)>=0?t:Er.UNKNOWN}(e.status);o(new _r(t,e.message))}else o(new _r(Er.UNKNOWN,"Server responded with status "+a.getStatus()))}else o(new _r(Er.UNAVAILABLE,"Connection failed."));break;default:Pr()}}finally{Tr("Connection",'RPC "'+e+'" completed.')}}));const s=JSON.stringify(r);a.send(t,"POST",s,n,15)}))}Mi(e,t){const n=[this.Di,"/","google.firestore.v1.Firestore","/",e,"/channel"],r=new sr,i=lt(),o={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.ki(o.initMessageHeaders,t),(0,l.uI)()||(0,l.b$)()||(0,l.d)()||(0,l.w1)()||(0,l.Mn)()||(0,l.ru)()||(o.httpHeadersOverwriteParam="$httpHeaders");const a=n.join("");Tr("Connection","Creating WebChannel: "+a,o);const s=r.createWebChannel(a,o);let u=!1,c=!1;const d=new gu({Ei:e=>{c?Tr("Connection","Not sending because WebChannel is closed:",e):(u||(Tr("Connection","Opening WebChannel transport."),s.open(),u=!0),Tr("Connection","WebChannel sending:",e),s.send(e))},Ti:()=>s.close()}),h=(e,t,n)=>{e.listen(t,(e=>{try{n(e)}catch(e){setTimeout((()=>{throw e}),0)}}))};return h(s,vr.EventType.OPEN,(()=>{c||Tr("Connection","WebChannel transport opened.")})),h(s,vr.EventType.CLOSE,(()=>{c||(c=!0,Tr("Connection","WebChannel transport closed"),d.Vi())})),h(s,vr.EventType.ERROR,(e=>{c||(c=!0,kr("Connection","WebChannel transport errored:",e),d.Vi(new _r(Er.UNAVAILABLE,"The operation could not be completed")))})),h(s,vr.EventType.MESSAGE,(e=>{var t;if(!c){const n=e.data[0];Nr(!!n);const r=n,i=r.error||(null===(t=r[0])||void 0===t?void 0:t.error);if(i){Tr("Connection","WebChannel received error:",i);const e=i.status;let t=function(e){const t=Wo[e];if(void 0!==t)return Uo(t)}(e),n=i.message;void 0===t&&(t=Er.INTERNAL,n="Unknown error status: "+e+" with message "+i.message),c=!0,d.Vi(new _r(t,n)),s.close()}else Tr("Connection","WebChannel received:",n),d.Si(n)}})),h(i,pr.STAT_EVENT,(e=>{e.stat===mr?Tr("Connection","Detected buffering proxy"):e.stat===gr&&Tr("Connection","Detected no buffering proxy")})),setTimeout((()=>{d.vi()}),0),d}}function yu(){return"undefined"!=typeof window?window:null}function bu(){return"undefined"!=typeof document?document:null}function wu(e){return new ma(e,!0)}class Eu{constructor(e,t,n=1e3,r=1.5,i=6e4){this.Se=e,this.timerId=t,this.Fi=n,this.Li=r,this.Bi=i,this.Ui=0,this.qi=null,this.Ki=Date.now(),this.reset()}reset(){this.Ui=0}Qi(){this.Ui=this.Bi}ji(e){this.cancel();const t=Math.floor(this.Ui+this.Wi()),n=Math.max(0,Date.now()-this.Ki),r=Math.max(0,t-n);r>0&&Tr("ExponentialBackoff",`Backing off for ${r} ms (base delay: ${this.Ui} ms, delay with jitter: ${t} ms, last attempt: ${n} ms ago)`),this.qi=this.Se.enqueueAfterDelay(this.timerId,r,(()=>(this.Ki=Date.now(),e()))),this.Ui*=this.Li,this.Uithis.Bi&&(this.Ui=this.Bi)}Gi(){null!==this.qi&&(this.qi.skipDelay(),this.qi=null)}cancel(){null!==this.qi&&(this.qi.cancel(),this.qi=null)}Wi(){return(Math.random()-.5)*this.Ui}}class _u{constructor(e,t,n,r,i,o){this.Se=e,this.zi=n,this.Hi=r,this.Ji=i,this.listener=o,this.state=0,this.Yi=0,this.Xi=null,this.stream=null,this.Zi=new Eu(e,t)}tr(){return 1===this.state||2===this.state||4===this.state}er(){return 2===this.state}start(){3!==this.state?this.auth():this.nr()}async stop(){this.tr()&&await this.close(0)}sr(){this.state=0,this.Zi.reset()}ir(){this.er()&&null===this.Xi&&(this.Xi=this.Se.enqueueAfterDelay(this.zi,6e4,(()=>this.rr())))}cr(e){this.ar(),this.stream.send(e)}async rr(){if(this.er())return this.close(0)}ar(){this.Xi&&(this.Xi.cancel(),this.Xi=null)}async close(e,t){this.ar(),this.Zi.cancel(),this.Yi++,3!==e?this.Zi.reset():t&&t.code===Er.RESOURCE_EXHAUSTED?(Ir(t.toString()),Ir("Using maximum backoff delay to prevent overloading the backend."),this.Zi.Qi()):t&&t.code===Er.UNAUTHENTICATED&&this.Ji.invalidateToken(),null!==this.stream&&(this.ur(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Ri(t)}ur(){}auth(){this.state=1;const e=this.hr(this.Yi),t=this.Yi;this.Ji.getToken().then((e=>{this.Yi===t&&this.lr(e)}),(t=>{e((()=>{const e=new _r(Er.UNKNOWN,"Fetching auth token failed: "+t.message);return this.dr(e)}))}))}lr(e){const t=this.hr(this.Yi);this.stream=this.wr(e),this.stream.Ii((()=>{t((()=>(this.state=2,this.listener.Ii())))})),this.stream.Ri((e=>{t((()=>this.dr(e)))})),this.stream.onMessage((e=>{t((()=>this.onMessage(e)))}))}nr(){this.state=4,this.Zi.ji((async()=>{this.state=0,this.start()}))}dr(e){return Tr("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(3,e)}hr(e){return t=>{this.Se.enqueueAndForget((()=>this.Yi===e?t():(Tr("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class Cu extends _u{constructor(e,t,n,r,i){super(e,"listen_stream_connection_backoff","listen_stream_idle",t,n,i),this.R=r}wr(e){return this.Hi.Mi("Listen",e)}onMessage(e){this.Zi.reset();const t=function(e,t){let n;if("targetChange"in t){t.targetChange;const r=function(e){return"NO_CHANGE"===e?0:"ADD"===e?1:"REMOVE"===e?2:"CURRENT"===e?3:"RESET"===e?4:Pr()}(t.targetChange.targetChangeType||"NO_CHANGE"),i=t.targetChange.targetIds||[],o=function(e,t){return e.I?(Nr(void 0===t||"string"==typeof t),Kr.fromBase64String(t||"")):(Nr(void 0===t||t instanceof Uint8Array),Kr.fromUint8Array(t||new Uint8Array))}(e,t.targetChange.resumeToken),a=t.targetChange.cause,s=a&&function(e){const t=void 0===e.code?Er.UNKNOWN:Uo(e.code);return new _r(t,e.message||"")}(a);n=new la(r,i,o,s||null)}else if("documentChange"in t){t.documentChange;const r=t.documentChange;r.document,r.document.name,r.document.updateTime;const i=Ca(e,r.document.name),o=ba(r.document.updateTime),a=new bi({mapValue:{fields:r.document.fields}}),s=Ei.newFoundDocument(i,o,a),l=r.targetIds||[],u=r.removedTargetIds||[];n=new aa(l,u,s.key,s)}else if("documentDelete"in t){t.documentDelete;const r=t.documentDelete;r.document;const i=Ca(e,r.document),o=r.readTime?ba(r.readTime):Wr.min(),a=Ei.newNoDocument(i,o),s=r.removedTargetIds||[];n=new aa([],s,a.key,a)}else if("documentRemove"in t){t.documentRemove;const r=t.documentRemove;r.document;const i=Ca(e,r.document),o=r.removedTargetIds||[];n=new aa([],o,i,null)}else{if(!("filter"in t))return Pr();{t.filter;const e=t.filter;e.targetId;const r=e.count||0,i=new Fo(r),o=e.targetId;n=new sa(o,i)}}return n}(this.R,e),n=function(e){if(!("targetChange"in e))return Wr.min();const t=e.targetChange;return t.targetIds&&t.targetIds.length?Wr.min():t.readTime?ba(t.readTime):Wr.min()}(e);return this.listener._r(t,n)}mr(e){const t={};t.database=Ta(this.R),t.addTarget=function(e,t){let n;const r=t.target;return n=Ti(r)?{documents:Aa(e,r)}:{query:Da(e,r)},n.targetId=t.targetId,t.resumeToken.approximateByteSize()>0?n.resumeToken=va(e,t.resumeToken):t.snapshotVersion.compareTo(Wr.min())>0&&(n.readTime=ga(e,t.snapshotVersion.toTimestamp())),n}(this.R,e);const n=function(e,t){const n=function(e,t){switch(t){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return Pr()}}(0,t.purpose);return null==n?null:{"goog-listen-tags":n}}(this.R,e);n&&(t.labels=n),this.cr(t)}gr(e){const t={};t.database=Ta(this.R),t.removeTarget=e,this.cr(t)}}class Su extends _u{constructor(e,t,n,r,i){super(e,"write_stream_connection_backoff","write_stream_idle",t,n,i),this.R=r,this.yr=!1}get pr(){return this.yr}start(){this.yr=!1,this.lastStreamToken=void 0,super.start()}ur(){this.yr&&this.Er([])}wr(e){return this.Hi.Mi("Write",e)}onMessage(e){if(Nr(!!e.streamToken),this.lastStreamToken=e.streamToken,this.yr){this.Zi.reset();const t=function(e,t){return e&&e.length>0?(Nr(void 0!==t),e.map((e=>function(e,t){let n=e.updateTime?ba(e.updateTime):ba(t);return n.isEqual(Wr.min())&&(n=ba(t)),new _o(n,e.transformResults||[])}(e,t)))):[]}(e.writeResults,e.commitTime),n=ba(e.commitTime);return this.listener.Tr(n,t)}return Nr(!e.writeResults||0===e.writeResults.length),this.yr=!0,this.listener.Ir()}Ar(){const e={};e.database=Ta(this.R),this.cr(e)}Er(e){const t={streamToken:this.lastStreamToken,writes:e.map((e=>Pa(this.R,e)))};this.cr(t)}}class xu extends class{}{constructor(e,t,n){super(),this.credentials=e,this.Hi=t,this.R=n,this.Rr=!1}Pr(){if(this.Rr)throw new _r(Er.FAILED_PRECONDITION,"The client has already been terminated.")}Ni(e,t,n){return this.Pr(),this.credentials.getToken().then((r=>this.Hi.Ni(e,t,n,r))).catch((e=>{throw"FirebaseError"===e.name?(e.code===Er.UNAUTHENTICATED&&this.credentials.invalidateToken(),e):new _r(Er.UNKNOWN,e.toString())}))}Oi(e,t,n){return this.Pr(),this.credentials.getToken().then((r=>this.Hi.Oi(e,t,n,r))).catch((e=>{throw"FirebaseError"===e.name?(e.code===Er.UNAUTHENTICATED&&this.credentials.invalidateToken(),e):new _r(Er.UNKNOWN,e.toString())}))}terminate(){this.Rr=!0}}class Tu{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.br=0,this.vr=null,this.Vr=!0}Sr(){0===this.br&&(this.Dr("Unknown"),this.vr=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(()=>(this.vr=null,this.Cr("Backend didn't respond within 10 seconds."),this.Dr("Offline"),Promise.resolve()))))}Nr(e){"Online"===this.state?this.Dr("Unknown"):(this.br++,this.br>=1&&(this.kr(),this.Cr(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.Dr("Offline")))}set(e){this.kr(),this.br=0,"Online"===e&&(this.Vr=!1),this.Dr(e)}Dr(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}Cr(e){const t=`Could not reach Cloud Firestore backend. ${e}\nThis 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.Vr?(Ir(t),this.Vr=!1):Tr("OnlineStateTracker",t)}kr(){null!==this.vr&&(this.vr.cancel(),this.vr=null)}}class Iu{constructor(e,t,n,r,i){this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.$r=[],this.Or=new Map,this.Mr=new Set,this.Fr=[],this.Lr=i,this.Lr.di((e=>{n.enqueueAndForget((async()=>{Lu(this)&&(Tr("RemoteStore","Restarting streams for network reachability change."),await async function(e){const t=Ar(e);t.Mr.add(4),await Ou(t),t.Br.set("Unknown"),t.Mr.delete(4),await ku(t)}(this))}))})),this.Br=new Tu(n,r)}}async function ku(e){if(Lu(e))for(const t of e.Fr)await t(!0)}async function Ou(e){for(const t of e.Fr)await t(!1)}function Pu(e,t){const n=Ar(e);n.Or.has(t.targetId)||(n.Or.set(t.targetId,t),Mu(n)?Ru(n):Ju(n).er()&&Au(n,t))}function Nu(e,t){const n=Ar(e),r=Ju(n);n.Or.delete(t),r.er()&&Du(n,t),0===n.Or.size&&(r.er()?r.ir():Lu(n)&&n.Br.set("Unknown"))}function Au(e,t){e.Ur.q(t.targetId),Ju(e).mr(t)}function Du(e,t){e.Ur.q(t),Ju(e).gr(t)}function Ru(e){e.Ur=new ca({getRemoteKeysForTarget:t=>e.remoteSyncer.getRemoteKeysForTarget(t),lt:t=>e.Or.get(t)||null}),Ju(e).start(),e.Br.Sr()}function Mu(e){return Lu(e)&&!Ju(e).tr()&&e.Or.size>0}function Lu(e){return 0===Ar(e).Mr.size}function ju(e){e.Ur=void 0}async function Fu(e){e.Or.forEach(((t,n)=>{Au(e,t)}))}async function Wu(e,t){ju(e),Mu(e)?(e.Br.Nr(t),Ru(e)):e.Br.set("Unknown")}async function Bu(e,t,n){if(e.Br.set("Online"),t instanceof la&&2===t.state&&t.cause)try{await async function(e,t){const n=t.cause;for(const r of t.targetIds)e.Or.has(r)&&(await e.remoteSyncer.rejectListen(r,n),e.Or.delete(r),e.Ur.removeTarget(r))}(e,t)}catch(n){Tr("RemoteStore","Failed to remove targets %s: %s ",t.targetIds.join(","),n),await zu(e,n)}else if(t instanceof aa?e.Ur.X(t):t instanceof sa?e.Ur.rt(t):e.Ur.et(t),!n.isEqual(Wr.min()))try{const t=await jl(e.localStore);n.compareTo(t)>=0&&await function(e,t){const n=e.Ur.at(t);return n.targetChanges.forEach(((n,r)=>{if(n.resumeToken.approximateByteSize()>0){const i=e.Or.get(r);i&&e.Or.set(r,i.withResumeToken(n.resumeToken,t))}})),n.targetMismatches.forEach((t=>{const n=e.Or.get(t);if(!n)return;e.Or.set(t,n.withResumeToken(Kr.EMPTY_BYTE_STRING,n.snapshotVersion)),Du(e,t);const r=new Ps(n.target,t,1,n.sequenceNumber);Au(e,r)})),e.remoteSyncer.applyRemoteEvent(n)}(e,n)}catch(t){Tr("RemoteStore","Failed to raise snapshot:",t),await zu(e,t)}}async function zu(e,t,n){if(!Es(t))throw t;e.Mr.add(1),await Ou(e),e.Br.set("Offline"),n||(n=()=>jl(e.localStore)),e.asyncQueue.enqueueRetryable((async()=>{Tr("RemoteStore","Retrying IndexedDB access"),await n(),e.Mr.delete(1),await ku(e)}))}function Uu(e,t){return t().catch((n=>zu(e,n,t)))}async function Vu(e){const t=Ar(e),n=ec(t);let r=t.$r.length>0?t.$r[t.$r.length-1].batchId:-1;for(;Zu(t);)try{const e=await Wl(t.localStore,r);if(null===e){0===t.$r.length&&n.ir();break}r=e.batchId,$u(t,e)}catch(e){await zu(t,e)}qu(t)&&Hu(t)}function Zu(e){return Lu(e)&&e.$r.length<10}function $u(e,t){e.$r.push(t);const n=ec(e);n.er()&&n.pr&&n.Er(t.mutations)}function qu(e){return Lu(e)&&!ec(e).tr()&&e.$r.length>0}function Hu(e){ec(e).start()}async function Ku(e){ec(e).Ar()}async function Gu(e){const t=ec(e);for(const n of e.$r)t.Er(n.mutations)}async function Qu(e,t,n){const r=e.$r.shift(),i=Os.from(r,t,n);await Uu(e,(()=>e.remoteSyncer.applySuccessfulWrite(i))),await Vu(e)}async function Yu(e,t){t&&ec(e).pr&&await async function(e,t){if(zo(n=t.code)&&n!==Er.ABORTED){const n=e.$r.shift();ec(e).sr(),await Uu(e,(()=>e.remoteSyncer.rejectFailedWrite(n.batchId,t))),await Vu(e)}var n}(e,t),qu(e)&&Hu(e)}async function Xu(e,t){const n=Ar(e);t?(n.Mr.delete(2),await ku(n)):t||(n.Mr.add(2),await Ou(n),n.Br.set("Unknown"))}function Ju(e){return e.qr||(e.qr=function(e,t,n){const r=Ar(e);return r.Pr(),new Cu(t,r.Hi,r.credentials,r.R,n)}(e.datastore,e.asyncQueue,{Ii:Fu.bind(null,e),Ri:Wu.bind(null,e),_r:Bu.bind(null,e)}),e.Fr.push((async t=>{t?(e.qr.sr(),Mu(e)?Ru(e):e.Br.set("Unknown")):(await e.qr.stop(),ju(e))}))),e.qr}function ec(e){return e.Kr||(e.Kr=function(e,t,n){const r=Ar(e);return r.Pr(),new Su(t,r.Hi,r.credentials,r.R,n)}(e.datastore,e.asyncQueue,{Ii:Ku.bind(null,e),Ri:Yu.bind(null,e),Ir:Gu.bind(null,e),Tr:Qu.bind(null,e)}),e.Fr.push((async t=>{t?(e.Kr.sr(),await Vu(e)):(await e.Kr.stop(),e.$r.length>0&&(Tr("RemoteStore",`Stopping write stream with ${e.$r.length} pending writes`),e.$r=[]))}))),e.Kr}class tc{constructor(e,t,n,r,i){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new ms,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((e=>{}))}static createAndSchedule(e,t,n,r,i){const o=Date.now()+n,a=new tc(e,t,o,r,i);return a.start(n),a}start(e){this.timerHandle=setTimeout((()=>this.handleDelayElapsed()),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new _r(Er.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 nc(e,t){if(Ir("AsyncQueue",`${t}: ${e}`),Es(e))return new _r(Er.UNAVAILABLE,`${t}: ${e}`);throw e}class rc{constructor(e){this.comparator=e?(t,n)=>e(t,n)||oi.comparator(t.key,n.key):(e,t)=>oi.comparator(e.key,t.key),this.keyedMap=Yo(),this.sortedSet=new Vo(this.comparator)}static emptySet(e){return new rc(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){const 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){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof rc))return!1;if(this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),n=e.sortedSet.getIterator();for(;t.hasNext();){const e=t.getNext().key,r=n.getNext().key;if(!e.isEqual(r))return!1}return!0}toString(){const e=[];return this.forEach((t=>{e.push(t.toString())})),0===e.length?"DocumentSet ()":"DocumentSet (\n "+e.join(" \n")+"\n)"}copy(e,t){const n=new rc;return n.comparator=this.comparator,n.keyedMap=e,n.sortedSet=t,n}}class ic{constructor(){this.Qr=new Vo(oi.comparator)}track(e){const t=e.doc.key,n=this.Qr.get(t);n?0!==e.type&&3===n.type?this.Qr=this.Qr.insert(t,e):3===e.type&&1!==n.type?this.Qr=this.Qr.insert(t,{type:n.type,doc:e.doc}):2===e.type&&2===n.type?this.Qr=this.Qr.insert(t,{type:2,doc:e.doc}):2===e.type&&0===n.type?this.Qr=this.Qr.insert(t,{type:0,doc:e.doc}):1===e.type&&0===n.type?this.Qr=this.Qr.remove(t):1===e.type&&2===n.type?this.Qr=this.Qr.insert(t,{type:1,doc:n.doc}):0===e.type&&1===n.type?this.Qr=this.Qr.insert(t,{type:2,doc:e.doc}):Pr():this.Qr=this.Qr.insert(t,e)}jr(){const e=[];return this.Qr.inorderTraversal(((t,n)=>{e.push(n)})),e}}class oc{constructor(e,t,n,r,i,o,a,s){this.query=e,this.docs=t,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=s}static fromInitialDocuments(e,t,n,r){const i=[];return t.forEach((e=>{i.push({type:0,doc:e})})),new oc(e,t,rc.emptySet(t),i,n,r,!0,!1)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Ji(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(let e=0;eeo(e)),Ji),this.onlineState="Unknown",this.Gr=new Set}}async function lc(e,t){const n=Ar(e),r=t.query;let i=!1,o=n.queries.get(r);if(o||(i=!0,o=new ac),i)try{o.Wr=await n.onListen(r)}catch(e){const n=nc(e,`Initialization of query '${to(t.query)}' failed`);return void t.onError(n)}n.queries.set(r,o),o.listeners.push(t),t.zr(n.onlineState),o.Wr&&t.Hr(o.Wr)&&hc(n)}async function uc(e,t){const n=Ar(e),r=t.query;let i=!1;const o=n.queries.get(r);if(o){const e=o.listeners.indexOf(t);e>=0&&(o.listeners.splice(e,1),i=0===o.listeners.length)}if(i)return n.queries.delete(r),n.onUnlisten(r)}function cc(e,t){const n=Ar(e);let r=!1;for(const e of t){const t=e.query,i=n.queries.get(t);if(i){for(const t of i.listeners)t.Hr(e)&&(r=!0);i.Wr=e}}r&&hc(n)}function dc(e,t,n){const r=Ar(e),i=r.queries.get(t);if(i)for(const e of i.listeners)e.onError(n);r.queries.delete(t)}function hc(e){e.Gr.forEach((e=>{e.next()}))}class fc{constructor(e,t,n){this.query=e,this.Jr=t,this.Yr=!1,this.Xr=null,this.onlineState="Unknown",this.options=n||{}}Hr(e){if(!this.options.includeMetadataChanges){const t=[];for(const n of e.docChanges)3!==n.type&&t.push(n);e=new oc(e.query,e.docs,e.oldDocs,t,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0)}let t=!1;return this.Yr?this.Zr(e)&&(this.Jr.next(e),t=!0):this.eo(e,this.onlineState)&&(this.no(e),t=!0),this.Xr=e,t}onError(e){this.Jr.error(e)}zr(e){this.onlineState=e;let t=!1;return this.Xr&&!this.Yr&&this.eo(this.Xr,e)&&(this.no(this.Xr),t=!0),t}eo(e,t){if(!e.fromCache)return!0;const n="Offline"!==t;return!(this.options.so&&n||e.docs.isEmpty()&&"Offline"!==t)}Zr(e){if(e.docChanges.length>0)return!0;const t=this.Xr&&this.Xr.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges}no(e){e=oc.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache),this.Yr=!0,this.Jr.next(e)}}class pc{constructor(e,t){this.payload=e,this.byteLength=t}io(){return"metadata"in this.payload}}class mc{constructor(e){this.R=e}Un(e){return Ca(this.R,e)}qn(e){return e.metadata.exists?Oa(this.R,e.document,!1):Ei.newNoDocument(this.Un(e.metadata.name),this.Kn(e.metadata.readTime))}Kn(e){return ba(e)}}class gc{constructor(e,t,n){this.ro=e,this.localStore=t,this.R=n,this.queries=[],this.documents=[],this.progress=vc(e)}oo(e){this.progress.bytesLoaded+=e.byteLength;let t=this.progress.documentsLoaded;return e.payload.namedQuery?this.queries.push(e.payload.namedQuery):e.payload.documentMetadata?(this.documents.push({metadata:e.payload.documentMetadata}),e.payload.documentMetadata.exists||++t):e.payload.document&&(this.documents[this.documents.length-1].document=e.payload.document,++t),t!==this.progress.documentsLoaded?(this.progress.documentsLoaded=t,Object.assign({},this.progress)):null}co(e){const t=new Map,n=new mc(this.R);for(const r of e)if(r.metadata.queries){const e=n.Un(r.metadata.name);for(const n of r.metadata.queries){const r=(t.get(n)||ta()).add(e);t.set(n,r)}}return t}async complete(){const e=await async function(e,t,n,r){const i=Ar(e);let o=ta(),a=Go(),s=Jo();for(const e of n){const n=t.Un(e.metadata.name);e.document&&(o=o.add(n)),a=a.insert(n,t.qn(e)),s=s.insert(n,t.Kn(e.metadata.readTime))}const l=i.Mn.newChangeBuffer({trackRemovals:!0}),u=await Bl(i,function(e){return Yi(Zi(Zr.fromString(`__bundle__/docs/${e}`)))}(r));return i.persistence.runTransaction("Apply bundle documents","readwrite",(e=>Fl(e,l,a,Wr.min(),s).next((t=>(l.apply(e),t))).next((t=>i.Ue.removeMatchingKeysForTargetId(e,u.targetId).next((()=>i.Ue.addMatchingKeys(e,o,u.targetId))).next((()=>i.Fn.En(e,t))).next((()=>t))))))}(this.localStore,new mc(this.R),this.documents,this.ro.id),t=this.co(this.documents);for(const e of this.queries)await $l(this.localStore,e,t.get(e.name));return this.progress.taskState="Success",new Pl(Object.assign({},this.progress),e)}}function vc(e){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:e.totalDocuments,totalBytes:e.totalBytes}}class yc{constructor(e){this.key=e}}class bc{constructor(e){this.key=e}}class wc{constructor(e,t){this.query=e,this.ao=t,this.uo=null,this.current=!1,this.ho=ta(),this.mutatedKeys=ta(),this.lo=ro(e),this.fo=new rc(this.lo)}get wo(){return this.ao}_o(e,t){const n=t?t.mo:new ic,r=t?t.fo:this.fo;let i=t?t.mutatedKeys:this.mutatedKeys,o=r,a=!1;const s=$i(this.query)&&r.size===this.query.limit?r.last():null,l=qi(this.query)&&r.size===this.query.limit?r.first():null;if(e.inorderTraversal(((e,t)=>{const u=r.get(e),c=no(this.query,t)?t:null,d=!!u&&this.mutatedKeys.has(u.key),h=!!c&&(c.hasLocalMutations||this.mutatedKeys.has(c.key)&&c.hasCommittedMutations);let f=!1;u&&c?u.data.isEqual(c.data)?d!==h&&(n.track({type:3,doc:c}),f=!0):this.yo(u,c)||(n.track({type:2,doc:c}),f=!0,(s&&this.lo(c,s)>0||l&&this.lo(c,l)<0)&&(a=!0)):!u&&c?(n.track({type:0,doc:c}),f=!0):u&&!c&&(n.track({type:1,doc:u}),f=!0,(s||l)&&(a=!0)),f&&(c?(o=o.add(c),i=h?i.add(e):i.delete(e)):(o=o.delete(e),i=i.delete(e)))})),$i(this.query)||qi(this.query))for(;o.size>this.query.limit;){const e=$i(this.query)?o.last():o.first();o=o.delete(e.key),i=i.delete(e.key),n.track({type:1,doc:e})}return{fo:o,mo:n,Nn:a,mutatedKeys:i}}yo(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,n){const r=this.fo;this.fo=e.fo,this.mutatedKeys=e.mutatedKeys;const i=e.mo.jr();i.sort(((e,t)=>function(e,t){const n=e=>{switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Pr()}};return n(e)-n(t)}(e.type,t.type)||this.lo(e.doc,t.doc))),this.po(n);const o=t?this.Eo():[],a=0===this.ho.size&&this.current?1:0,s=a!==this.uo;return this.uo=a,0!==i.length||s?{snapshot:new oc(this.query,e.fo,r,i,e.mutatedKeys,0===a,s,!1),To:o}:{To:o}}zr(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({fo:this.fo,mo:new ic,mutatedKeys:this.mutatedKeys,Nn:!1},!1)):{To:[]}}Io(e){return!this.ao.has(e)&&!!this.fo.has(e)&&!this.fo.get(e).hasLocalMutations}po(e){e&&(e.addedDocuments.forEach((e=>this.ao=this.ao.add(e))),e.modifiedDocuments.forEach((e=>{})),e.removedDocuments.forEach((e=>this.ao=this.ao.delete(e))),this.current=e.current)}Eo(){if(!this.current)return[];const e=this.ho;this.ho=ta(),this.fo.forEach((e=>{this.Io(e.key)&&(this.ho=this.ho.add(e.key))}));const t=[];return e.forEach((e=>{this.ho.has(e)||t.push(new bc(e))})),this.ho.forEach((n=>{e.has(n)||t.push(new yc(n))})),t}Ao(e){this.ao=e.Bn,this.ho=ta();const t=this._o(e.documents);return this.applyChanges(t,!0)}Ro(){return oc.fromInitialDocuments(this.query,this.fo,this.mutatedKeys,0===this.uo)}}class Ec{constructor(e,t,n){this.query=e,this.targetId=t,this.view=n}}class _c{constructor(e){this.key=e,this.Po=!1}}class Cc{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.bo={},this.vo=new gl((e=>eo(e)),Ji),this.Vo=new Map,this.So=new Set,this.Do=new Vo(oi.comparator),this.Co=new Map,this.No=new Hl,this.xo={},this.ko=new Map,this.$o=il.Yt(),this.onlineState="Unknown",this.Oo=void 0}get isPrimaryClient(){return!0===this.Oo}}async function Sc(e,t){const n=Qc(e);let r,i;const o=n.vo.get(t);if(o)r=o.targetId,n.sharedClientState.addLocalQueryTarget(r),i=o.view.Ro();else{const e=await Bl(n.localStore,Yi(t)),o=n.sharedClientState.addLocalQueryTarget(e.targetId);r=e.targetId,i=await xc(n,t,r,"current"===o),n.isPrimaryClient&&Pu(n.remoteStore,e)}return i}async function xc(e,t,n,r){e.Mo=(t,n,r)=>async function(e,t,n,r){let i=t.view._o(n);i.Nn&&(i=await Ul(e.localStore,t.query,!1).then((({documents:e})=>t.view._o(e,i))));const o=r&&r.targetChanges.get(t.targetId),a=t.view.applyChanges(i,e.isPrimaryClient,o);return Lc(e,t.targetId,a.To),a.snapshot}(e,t,n,r);const i=await Ul(e.localStore,t,!0),o=new wc(t,i.Bn),a=o._o(i.documents),s=oa.createSynthesizedTargetChangeForCurrentChange(n,r&&"Offline"!==e.onlineState),l=o.applyChanges(a,e.isPrimaryClient,s);Lc(e,n,l.To);const u=new Ec(t,n,o);return e.vo.set(t,u),e.Vo.has(n)?e.Vo.get(n).push(t):e.Vo.set(n,[t]),l.snapshot}async function Tc(e,t){const n=Ar(e),r=n.vo.get(t),i=n.Vo.get(r.targetId);if(i.length>1)return n.Vo.set(r.targetId,i.filter((e=>!Ji(e,t)))),void n.vo.delete(t);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(r.targetId),n.sharedClientState.isActiveQueryTarget(r.targetId)||await zl(n.localStore,r.targetId,!1).then((()=>{n.sharedClientState.clearQueryState(r.targetId),Nu(n.remoteStore,r.targetId),Rc(n,r.targetId)})).catch(ul)):(Rc(n,r.targetId),await zl(n.localStore,r.targetId,!0))}async function Ic(e,t){const n=Ar(e);try{const e=await function(e,t){const n=Ar(e),r=t.snapshotVersion;let i=n.kn;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(e=>{const o=n.Mn.newChangeBuffer({trackRemovals:!0});i=n.kn;const a=[];t.targetChanges.forEach(((t,o)=>{const s=i.get(o);if(!s)return;a.push(n.Ue.removeMatchingKeys(e,t.removedDocuments,o).next((()=>n.Ue.addMatchingKeys(e,t.addedDocuments,o))));const l=t.resumeToken;if(l.approximateByteSize()>0){const u=s.withResumeToken(l,r).withSequenceNumber(e.currentSequenceNumber);i=i.insert(o,u),function(e,t,n){return Nr(t.resumeToken.approximateByteSize()>0),0===e.resumeToken.approximateByteSize()||t.snapshotVersion.toMicroseconds()-e.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0}(s,u,t)&&a.push(n.Ue.updateTargetData(e,u))}}));let s=Go();if(t.documentUpdates.forEach(((r,i)=>{t.resolvedLimboDocuments.has(r)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(e,r))})),a.push(Fl(e,o,t.documentUpdates,r,void 0).next((e=>{s=e}))),!r.isEqual(Wr.min())){const t=n.Ue.getLastRemoteSnapshotVersion(e).next((t=>n.Ue.setTargetsMetadata(e,e.currentSequenceNumber,r)));a.push(t)}return gs.waitFor(a).next((()=>o.apply(e))).next((()=>n.Fn.En(e,s))).next((()=>s))})).then((e=>(n.kn=i,e)))}(n.localStore,t);t.targetChanges.forEach(((e,t)=>{const r=n.Co.get(t);r&&(Nr(e.addedDocuments.size+e.modifiedDocuments.size+e.removedDocuments.size<=1),e.addedDocuments.size>0?r.Po=!0:e.modifiedDocuments.size>0?Nr(r.Po):e.removedDocuments.size>0&&(Nr(r.Po),r.Po=!1))})),await Wc(n,e,t)}catch(e){await ul(e)}}function kc(e,t,n){const r=Ar(e);if(r.isPrimaryClient&&0===n||!r.isPrimaryClient&&1===n){const e=[];r.vo.forEach(((n,r)=>{const i=r.view.zr(t);i.snapshot&&e.push(i.snapshot)})),function(e,t){const n=Ar(e);n.onlineState=t;let r=!1;n.queries.forEach(((e,n)=>{for(const e of n.listeners)e.zr(t)&&(r=!0)})),r&&hc(n)}(r.eventManager,t),e.length&&r.bo._r(e),r.onlineState=t,r.isPrimaryClient&&r.sharedClientState.setOnlineState(t)}}async function Oc(e,t,n){const r=Ar(e);r.sharedClientState.updateQueryState(t,"rejected",n);const i=r.Co.get(t),o=i&&i.key;if(o){let e=new Vo(oi.comparator);e=e.insert(o,Ei.newNoDocument(o,Wr.min()));const n=ta().add(o),i=new ia(Wr.min(),new Map,new qo(Mr),e,n);await Ic(r,i),r.Do=r.Do.remove(o),r.Co.delete(t),Fc(r)}else await zl(r.localStore,t,!1).then((()=>Rc(r,t,n))).catch(ul)}async function Pc(e,t){const n=Ar(e),r=t.batch.batchId;try{const e=await function(e,t){const n=Ar(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(e=>{const r=t.batch.keys(),i=n.Mn.newChangeBuffer({trackRemovals:!0});return function(e,t,n,r){const i=n.batch,o=i.keys();let a=gs.resolve();return o.forEach((e=>{a=a.next((()=>r.getEntry(t,e))).next((t=>{const o=n.docVersions.get(e);Nr(null!==o),t.version.compareTo(o)<0&&(i.applyToRemoteDocument(t,n),t.isValidDocument()&&r.addEntry(t,n.commitVersion))}))})),a.next((()=>e._n.removeMutationBatch(t,i)))}(n,e,t,i).next((()=>i.apply(e))).next((()=>n._n.performConsistencyCheck(e))).next((()=>n.Fn.pn(e,r)))}))}(n.localStore,t);Dc(n,r,null),Ac(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await Wc(n,e)}catch(e){await ul(e)}}async function Nc(e,t,n){const r=Ar(e);try{const e=await function(e,t){const n=Ar(e);return n.persistence.runTransaction("Reject batch","readwrite-primary",(e=>{let r;return n._n.lookupMutationBatch(e,t).next((t=>(Nr(null!==t),r=t.keys(),n._n.removeMutationBatch(e,t)))).next((()=>n._n.performConsistencyCheck(e))).next((()=>n.Fn.pn(e,r)))}))}(r.localStore,t);Dc(r,t,n),Ac(r,t),r.sharedClientState.updateMutationState(t,"rejected",n),await Wc(r,e)}catch(n){await ul(n)}}function Ac(e,t){(e.ko.get(t)||[]).forEach((e=>{e.resolve()})),e.ko.delete(t)}function Dc(e,t,n){const r=Ar(e);let i=r.xo[r.currentUser.toKey()];if(i){const e=i.get(t);e&&(n?e.reject(n):e.resolve(),i=i.remove(t)),r.xo[r.currentUser.toKey()]=i}}function Rc(e,t,n=null){e.sharedClientState.removeLocalQueryTarget(t);for(const r of e.Vo.get(t))e.vo.delete(r),n&&e.bo.Fo(r,n);e.Vo.delete(t),e.isPrimaryClient&&e.No.Zn(t).forEach((t=>{e.No.containsKey(t)||Mc(e,t)}))}function Mc(e,t){e.So.delete(t.path.canonicalString());const n=e.Do.get(t);null!==n&&(Nu(e.remoteStore,n),e.Do=e.Do.remove(t),e.Co.delete(n),Fc(e))}function Lc(e,t,n){for(const r of n)r instanceof yc?(e.No.addReference(r.key,t),jc(e,r)):r instanceof bc?(Tr("SyncEngine","Document no longer in limbo: "+r.key),e.No.removeReference(r.key,t),e.No.containsKey(r.key)||Mc(e,r.key)):Pr()}function jc(e,t){const n=t.key,r=n.path.canonicalString();e.Do.get(n)||e.So.has(r)||(Tr("SyncEngine","New document in limbo: "+n),e.So.add(r),Fc(e))}function Fc(e){for(;e.So.size>0&&e.Do.size{a.push(r.Mo(s,t,n).then((e=>{if(e){r.isPrimaryClient&&r.sharedClientState.updateQueryState(s.targetId,e.fromCache?"not-current":"current"),i.push(e);const t=Al.vn(s.targetId,e);o.push(t)}})))})),await Promise.all(a),r.bo._r(i),await async function(e,t){const n=Ar(e);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(e=>gs.forEach(t,(t=>gs.forEach(t.Pn,(r=>n.persistence.referenceDelegate.addReference(e,t.targetId,r))).next((()=>gs.forEach(t.bn,(r=>n.persistence.referenceDelegate.removeReference(e,t.targetId,r)))))))))}catch(e){if(!Es(e))throw e;Tr("LocalStore","Failed to update sequence numbers: "+e)}for(const e of t){const t=e.targetId;if(!e.fromCache){const e=n.kn.get(t),r=e.snapshotVersion,i=e.withLastLimboFreeSnapshotVersion(r);n.kn=n.kn.insert(t,i)}}}(r.localStore,o))}async function Bc(e,t){const n=Ar(e);if(!n.currentUser.isEqual(t)){Tr("SyncEngine","User change. New user:",t.toKey());const e=await Ll(n.localStore,t);n.currentUser=t,function(e,t){e.ko.forEach((e=>{e.forEach((e=>{e.reject(new _r(Er.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),e.ko.clear()}(n),n.sharedClientState.handleUserChange(t,e.removedBatchIds,e.addedBatchIds),await Wc(n,e.Ln)}}function zc(e,t){const n=Ar(e),r=n.Co.get(t);if(r&&r.Po)return ta().add(r.key);{let e=ta();const r=n.Vo.get(t);if(!r)return e;for(const t of r){const r=n.vo.get(t);e=e.unionWith(r.view.wo)}return e}}async function Uc(e,t){const n=Ar(e),r=await Ul(n.localStore,t.query,!0),i=t.view.Ao(r);return n.isPrimaryClient&&Lc(n,t.targetId,i.To),i}async function Vc(e){const t=Ar(e);return Zl(t.localStore).then((e=>Wc(t,e)))}async function Zc(e,t,n,r){const i=Ar(e),o=await function(e,t){const n=Ar(e),r=Ar(n._n);return n.persistence.runTransaction("Lookup mutation documents","readonly",(e=>r.jt(e,t).next((t=>t?n.Fn.pn(e,t):gs.resolve(null)))))}(i.localStore,t);null!==o?("pending"===n?await Vu(i.remoteStore):"acknowledged"===n||"rejected"===n?(Dc(i,t,r||null),Ac(i,t),function(e,t){Ar(Ar(e)._n).Gt(t)}(i.localStore,t)):Pr(),await Wc(i,o)):Tr("SyncEngine","Cannot apply mutation batch with id: "+t)}async function $c(e,t,n){const r=Ar(e),i=[],o=[];for(const e of t){let t;const n=r.Vo.get(e);if(n&&0!==n.length){t=await Bl(r.localStore,Yi(n[0]));for(const e of n){const t=r.vo.get(e),n=await Uc(r,t);n.snapshot&&o.push(n.snapshot)}}else{const n=await Vl(r.localStore,e);t=await Bl(r.localStore,n),await xc(r,qc(n),e,!1)}i.push(t)}return r.bo._r(o),i}function qc(e){return Vi(e.path,e.collectionGroup,e.orderBy,e.filters,e.limit,"F",e.startAt,e.endAt)}function Hc(e){const t=Ar(e);return Ar(Ar(t.localStore).persistence).fn()}async function Kc(e,t,n,r){const i=Ar(e);if(i.Oo)Tr("SyncEngine","Ignoring unexpected query state notification.");else if(i.Vo.has(t))switch(n){case"current":case"not-current":{const e=await Zl(i.localStore),r=ia.createSynthesizedRemoteEventForCurrentChange(t,"current"===n);await Wc(i,e,r);break}case"rejected":await zl(i.localStore,t,!0),Rc(i,t,r);break;default:Pr()}}async function Gc(e,t,n){const r=Qc(e);if(r.Oo){for(const e of t){if(r.Vo.has(e)){Tr("SyncEngine","Adding an already active target "+e);continue}const t=await Vl(r.localStore,e),n=await Bl(r.localStore,t);await xc(r,qc(t),n.targetId,!1),Pu(r.remoteStore,n)}for(const e of n)r.Vo.has(e)&&await zl(r.localStore,e,!1).then((()=>{Nu(r.remoteStore,e),Rc(r,e)})).catch(ul)}}function Qc(e){const t=Ar(e);return t.remoteStore.remoteSyncer.applyRemoteEvent=Ic.bind(null,t),t.remoteStore.remoteSyncer.getRemoteKeysForTarget=zc.bind(null,t),t.remoteStore.remoteSyncer.rejectListen=Oc.bind(null,t),t.bo._r=cc.bind(null,t.eventManager),t.bo.Fo=dc.bind(null,t.eventManager),t}function Yc(e){const t=Ar(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=Pc.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=Nc.bind(null,t),t}class Xc{constructor(){this.synchronizeTabs=!1}async initialize(e){this.R=wu(e.databaseInfo.databaseId),this.sharedClientState=this.Bo(e),this.persistence=this.Uo(e),await this.persistence.start(),this.gcScheduler=this.qo(e),this.localStore=this.Ko(e)}qo(e){return null}Ko(e){return Ml(this.persistence,new Dl,e.initialUser,this.R)}Uo(e){return new Jl(tu.Ps,this.R)}Bo(e){return new hu}async terminate(){this.gcScheduler&&this.gcScheduler.stop(),await this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class Jc extends Xc{constructor(e,t,n){super(),this.Qo=e,this.cacheSizeBytes=t,this.forceOwnership=n,this.synchronizeTabs=!1}async initialize(e){await super.initialize(e),await async function(e){const t=Ar(e);return t.persistence.runTransaction("Synchronize last document change read time","readonly",(e=>function(e){const t=El(e);let n=Wr.min();return t.Ot({index:rs.readTimeIndex,reverse:!0},((e,t,r)=>{t.readTime&&(n=Ms(t.readTime)),r.done()})).next((()=>n))}(e))).then((e=>{t.On=e}))}(this.localStore),await this.Qo.initialize(this,e),await Yc(this.Qo.syncEngine),await Vu(this.Qo.remoteStore)}Ko(e){return Ml(this.persistence,new Dl,e.initialUser,this.R)}qo(e){const t=this.persistence.referenceDelegate.garbageCollector;return new hl(t,e.asyncQueue)}Uo(e){const t=Ol(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),n=void 0!==this.cacheSizeBytes?Qs.withCacheSize(this.cacheSizeBytes):Qs.DEFAULT;return new Tl(this.synchronizeTabs,t,e.clientId,n,e.asyncQueue,yu(),bu(),this.R,this.sharedClientState,!!this.forceOwnership)}Bo(e){return new hu}}class ed extends Jc{constructor(e,t){super(e,t,!1),this.Qo=e,this.cacheSizeBytes=t,this.synchronizeTabs=!0}async initialize(e){await super.initialize(e);const t=this.Qo.syncEngine;this.sharedClientState instanceof du&&(this.sharedClientState.syncEngine={ai:Zc.bind(null,t),ui:Kc.bind(null,t),hi:Gc.bind(null,t),fn:Hc.bind(null,t),ci:Vc.bind(null,t)},await this.sharedClientState.start()),await this.persistence.He((async e=>{await async function(e,t){const n=Ar(e);if(Qc(n),Yc(n),!0===t&&!0!==n.Oo){const e=n.sharedClientState.getAllActiveQueryTargets(),t=await $c(n,e.toArray());n.Oo=!0,await Xu(n.remoteStore,!0);for(const e of t)Pu(n.remoteStore,e)}else if(!1===t&&!1!==n.Oo){const e=[];let t=Promise.resolve();n.Vo.forEach(((r,i)=>{n.sharedClientState.isLocalQueryTarget(i)?e.push(i):t=t.then((()=>(Rc(n,i),zl(n.localStore,i,!0)))),Nu(n.remoteStore,i)})),await t,await $c(n,e),function(e){const t=Ar(e);t.Co.forEach(((e,n)=>{Nu(t.remoteStore,n)})),t.No.ts(),t.Co=new Map,t.Do=new Vo(oi.comparator)}(n),n.Oo=!1,await Xu(n.remoteStore,!1)}}(this.Qo.syncEngine,e),this.gcScheduler&&(e&&!this.gcScheduler.started?this.gcScheduler.start(this.localStore):e||this.gcScheduler.stop())}))}Bo(e){const t=yu();if(!du.gt(t))throw new _r(Er.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");const n=Ol(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey);return new du(t,e.asyncQueue,n,e.clientId,e.initialUser)}}class td{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=>kc(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=Bc.bind(null,this.syncEngine),await Xu(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new sc}createDatastore(e){const t=wu(e.databaseInfo.databaseId),n=(r=e.databaseInfo,new vu(r));var r;return function(e,t,n){return new xu(e,t,n)}(e.credentials,n,t)}createRemoteStore(e){return t=this.localStore,n=this.datastore,r=e.asyncQueue,i=e=>kc(this.syncEngine,e,0),o=pu.gt()?new pu:new fu,new Iu(t,n,r,i,o);var t,n,r,i,o}createSyncEngine(e,t){return function(e,t,n,r,i,o,a){const s=new Cc(e,t,n,r,i,o);return a&&(s.Oo=!0),s}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}terminate(){return async function(e){const t=Ar(e);Tr("RemoteStore","RemoteStore shutting down."),t.Mr.add(5),await Ou(t),t.Lr.shutdown(),t.Br.set("Unknown")}(this.remoteStore)}}function nd(e,t=10240){let n=0;return{async read(){if(n{this.muted||e(t)}),0)}}class id{constructor(e,t){this.Go=e,this.R=t,this.metadata=new ms,this.buffer=new Uint8Array,this.zo=new TextDecoder("utf-8"),this.Ho().then((e=>{e&&e.io()?this.metadata.resolve(e.payload.metadata):this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\n ${JSON.stringify(null==e?void 0:e.payload)}`))}),(e=>this.metadata.reject(e)))}close(){return this.Go.cancel()}async getMetadata(){return this.metadata.promise}async Lo(){return await this.getMetadata(),this.Ho()}async Ho(){const e=await this.Jo();if(null===e)return null;const t=this.zo.decode(e),n=Number(t);isNaN(n)&&this.Yo(`length string (${t}) is not valid number`);const r=await this.Xo(n);return new pc(JSON.parse(r),e.length+n)}Zo(){return this.buffer.findIndex((e=>e==="{".charCodeAt(0)))}async Jo(){for(;this.Zo()<0&&!await this.tc(););if(0===this.buffer.length)return null;const e=this.Zo();e<0&&this.Yo("Reached the end of bundle when a length string is expected.");const t=this.buffer.slice(0,e);return this.buffer=this.buffer.slice(e),t}async Xo(e){for(;this.buffer.length0)throw new _r(Er.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");const t=await async function(e,t){const n=Ar(e),r=Ta(n.R)+"/documents",i={documents:t.map((e=>_a(n.R,e)))},o=await n.Oi("BatchGetDocuments",r,i),a=new Map;o.forEach((e=>{const t=function(e,t){return"found"in t?function(e,t){Nr(!!t.found),t.found.name,t.found.updateTime;const n=Ca(e,t.found.name),r=ba(t.found.updateTime),i=new bi({mapValue:{fields:t.found.fields}});return Ei.newFoundDocument(n,r,i)}(e,t):"missing"in t?function(e,t){Nr(!!t.missing),Nr(!!t.readTime);const n=Ca(e,t.missing),r=ba(t.readTime);return Ei.newNoDocument(n,r)}(e,t):Pr()}(n.R,e);a.set(t.key.toString(),t)}));const s=[];return t.forEach((e=>{const t=a.get(e.toString());Nr(!!t),s.push(t)})),s}(this.datastore,e);return t.forEach((e=>this.recordVersion(e))),t}set(e,t){this.write(t.toMutation(e,this.precondition(e))),this.writtenDocs.add(e.toString())}update(e,t){try{this.write(t.toMutation(e,this.preconditionForUpdate(e)))}catch(e){this.lastWriteError=e}this.writtenDocs.add(e.toString())}delete(e){this.write(new Lo(e,this.precondition(e))),this.writtenDocs.add(e.toString())}async commit(){if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;const e=this.readVersions;this.mutations.forEach((t=>{e.delete(t.key.toString())})),e.forEach(((e,t)=>{const n=oi.fromPath(t);this.mutations.push(new jo(n,this.precondition(n)))})),await async function(e,t){const n=Ar(e),r=Ta(n.R)+"/documents",i={writes:t.map((e=>Pa(n.R,e)))};await n.Ni("Commit",r,i)}(this.datastore,this.mutations),this.committed=!0}recordVersion(e){let t;if(e.isFoundDocument())t=e.version;else{if(!e.isNoDocument())throw Pr();t=Wr.min()}const n=this.readVersions.get(e.key.toString());if(n){if(!t.isEqual(n))throw new _r(Er.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(e.key.toString(),t)}precondition(e){const t=this.readVersions.get(e.toString());return!this.writtenDocs.has(e.toString())&&t?Co.updateTime(t):Co.none()}preconditionForUpdate(e){const t=this.readVersions.get(e.toString());if(!this.writtenDocs.has(e.toString())&&t){if(t.isEqual(Wr.min()))throw new _r(Er.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return Co.updateTime(t)}return Co.exists(!0)}write(e){this.ensureCommitNotCalled(),this.mutations.push(e)}ensureCommitNotCalled(){}}class ad{constructor(e,t,n,r){this.asyncQueue=e,this.datastore=t,this.updateFunction=n,this.deferred=r,this.ec=5,this.Zi=new Eu(this.asyncQueue,"transaction_retry")}run(){this.nc()}nc(){this.Zi.ji((async()=>{const e=new od(this.datastore),t=this.sc(e);t&&t.then((t=>{this.asyncQueue.enqueueAndForget((()=>e.commit().then((()=>{this.deferred.resolve(t)})).catch((e=>{this.ic(e)}))))})).catch((e=>{this.ic(e)}))}))}sc(e){try{const t=this.updateFunction(e);return!ni(t)&&t.catch&&t.then?t:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(e){return this.deferred.reject(e),null}}ic(e){this.ec>0&&this.rc(e)?(this.ec-=1,this.asyncQueue.enqueueAndForget((()=>(this.nc(),Promise.resolve())))):this.deferred.reject(e)}rc(e){if("FirebaseError"===e.name){const t=e.code;return"aborted"===t||"failed-precondition"===t||!zo(t)}return!1}}class sd{constructor(e,t,n){this.credentials=e,this.asyncQueue=t,this.databaseInfo=n,this.user=nu.UNAUTHENTICATED,this.clientId=Rr.u(),this.credentialListener=()=>Promise.resolve(),this.credentials.setChangeListener(t,(async e=>{Tr("FirestoreClient","Received user=",e.uid),await this.credentialListener(e),this.user=e}))}async getConfiguration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,credentials:this.credentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.credentialListener=e}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new _r(Er.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const e=new ms;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async()=>{try{this.onlineComponents&&await this.onlineComponents.terminate(),this.offlineComponents&&await this.offlineComponents.terminate(),this.credentials.removeChangeListener(),e.resolve()}catch(t){const n=nc(t,"Failed to shutdown persistence");e.reject(n)}})),e.promise}}async function ld(e,t){e.asyncQueue.verifyOperationInProgress(),Tr("FirestoreClient","Initializing OfflineComponentProvider");const n=await e.getConfiguration();await t.initialize(n);let r=n.initialUser;e.setCredentialChangeListener((async e=>{r.isEqual(e)||(await Ll(t.localStore,e),r=e)})),t.persistence.setDatabaseDeletedListener((()=>e.terminate())),e.offlineComponents=t}async function ud(e,t){e.asyncQueue.verifyOperationInProgress();const n=await cd(e);Tr("FirestoreClient","Initializing OnlineComponentProvider");const r=await e.getConfiguration();await t.initialize(n,r),e.setCredentialChangeListener((e=>async function(e,t){const n=Ar(e);n.asyncQueue.verifyOperationInProgress(),Tr("RemoteStore","RemoteStore received new credentials");const r=Lu(n);n.Mr.add(3),await Ou(n),r&&n.Br.set("Unknown"),await n.remoteSyncer.handleCredentialChange(t),n.Mr.delete(3),await ku(n)}(t.remoteStore,e))),e.onlineComponents=t}async function cd(e){return e.offlineComponents||(Tr("FirestoreClient","Using default OfflineComponentProvider"),await ld(e,new Xc)),e.offlineComponents}async function dd(e){return e.onlineComponents||(Tr("FirestoreClient","Using default OnlineComponentProvider"),await ud(e,new td)),e.onlineComponents}function hd(e){return cd(e).then((e=>e.persistence))}function fd(e){return cd(e).then((e=>e.localStore))}function pd(e){return dd(e).then((e=>e.remoteStore))}function md(e){return dd(e).then((e=>e.syncEngine))}async function gd(e){const t=await dd(e),n=t.eventManager;return n.onListen=Sc.bind(null,t.syncEngine),n.onUnlisten=Tc.bind(null,t.syncEngine),n}function vd(e,t,n={}){const r=new ms;return e.asyncQueue.enqueueAndForget((async()=>function(e,t,n,r,i){const o=new rd({next:o=>{t.enqueueAndForget((()=>uc(e,a)));const s=o.docs.has(n);!s&&o.fromCache?i.reject(new _r(Er.UNAVAILABLE,"Failed to get document because the client is offline.")):s&&o.fromCache&&r&&"server"===r.source?i.reject(new _r(Er.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)}),a=new fc(Zi(n.path),o,{includeMetadataChanges:!0,so:!0});return lc(e,a)}(await gd(e),e.asyncQueue,t,n,r))),r.promise}function yd(e,t,n={}){const r=new ms;return e.asyncQueue.enqueueAndForget((async()=>function(e,t,n,r,i){const o=new rd({next:n=>{t.enqueueAndForget((()=>uc(e,a))),n.fromCache&&"server"===r.source?i.reject(new _r(Er.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)}),a=new fc(n,o,{includeMetadataChanges:!0,so:!0});return lc(e,a)}(await gd(e),e.asyncQueue,t,n,r))),r.promise}class bd{constructor(e,t,n,r,i,o,a){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=r,this.ssl=i,this.forceLongPolling=o,this.autoDetectLongPolling=a}}class wd{constructor(e,t){this.projectId=e,this.database=t||"(default)"}get isDefaultDatabase(){return"(default)"===this.database}isEqual(e){return e instanceof wd&&e.projectId===this.projectId&&e.database===this.database}}const Ed=new Map;class _d{constructor(e,t){this.user=t,this.type="OAuth",this.authHeaders={},this.authHeaders.Authorization=`Bearer ${e}`}}class Cd{constructor(){this.changeListener=null}getToken(){return Promise.resolve(null)}invalidateToken(){}setChangeListener(e,t){this.changeListener=t,e.enqueueRetryable((()=>t(nu.UNAUTHENTICATED)))}removeChangeListener(){this.changeListener=null}}class Sd{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}setChangeListener(e,t){this.changeListener=t,e.enqueueRetryable((()=>t(this.token.user)))}removeChangeListener(){this.changeListener=null}}class xd{constructor(e){this.currentUser=nu.UNAUTHENTICATED,this.oc=new ms,this.cc=0,this.changeListener=()=>Promise.resolve(),this.ac=!1,this.forceRefresh=!1,this.auth=null,this.asyncQueue=null,this.uc=()=>{this.cc++,this.currentUser=this.hc(),this.oc.resolve(),this.ac&&this.asyncQueue.enqueueRetryable((()=>this.changeListener(this.currentUser)))};const t=e=>{Tr("FirebaseCredentialsProvider","Auth detected"),this.auth=e,this.lc(),this.auth.addAuthTokenListener(this.uc)};e.onInit((e=>t(e))),setTimeout((()=>{if(!this.auth){const n=e.getImmediate({optional:!0});n?t(n):this.ac&&(Tr("FirebaseCredentialsProvider","Auth not yet detected"),this.asyncQueue.enqueueRetryable((()=>this.changeListener(this.currentUser))))}}),0)}getToken(){const e=this.cc,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then((t=>this.cc!==e?(Tr("FirebaseCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?(Nr("string"==typeof t.accessToken),new _d(t.accessToken,this.currentUser)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}setChangeListener(e,t){this.ac=!0,this.asyncQueue=e,this.changeListener=t}removeChangeListener(){this.auth&&this.auth.removeAuthTokenListener(this.uc),this.changeListener=()=>Promise.resolve()}hc(){const e=this.auth&&this.auth.getUid();return Nr(null===e||"string"==typeof e),new nu(e)}lc(){this.ac&&(this.ac=!1,this.asyncQueue.enqueueRetryable((async()=>{await this.oc.promise,await this.changeListener(this.currentUser),this.ac=!0})))}}class Td{constructor(e,t,n){this.fc=e,this.dc=t,this.wc=n,this.type="FirstParty",this.user=nu.FIRST_PARTY}get authHeaders(){const e={"X-Goog-AuthUser":this.dc},t=this.fc.auth.getAuthHeaderValueForFirstParty([]);return t&&(e.Authorization=t),this.wc&&(e["X-Goog-Iam-Authorization-Token"]=this.wc),e}}class Id{constructor(e,t,n){this.fc=e,this.dc=t,this.wc=n}getToken(){return Promise.resolve(new Td(this.fc,this.dc,this.wc))}setChangeListener(e,t){e.enqueueRetryable((()=>t(nu.FIRST_PARTY)))}removeChangeListener(){}invalidateToken(){}}function kd(e,t,n){if(!n)throw new _r(Er.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}function Od(e){if(!oi.isDocumentKey(e))throw new _r(Er.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function Pd(e){if(oi.isDocumentKey(e))throw new _r(Er.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`)}function Nd(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";{const t=function(e){if(e.constructor){const t=/function\s+([^\s(]+)\s*\(/.exec(e.constructor.toString());if(t&&t.length>1)return t[1]}return null}(e);return t?`a custom ${t} object`:"an object"}}return"function"==typeof e?"a function":Pr()}function Ad(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new _r(Er.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=Nd(e);throw new _r(Er.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${n}`)}}return e}function Dd(e,t){if(t<=0)throw new _r(Er.INVALID_ARGUMENT,`Function ${e}() requires a positive number, but it was: ${t}.`)}class Rd{constructor(e){var t;if(void 0===e.host){if(void 0!==e.ssl)throw new _r(Er.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,void 0===e.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new _r(Er.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,function(e,t,n,r){if(!0===t&&!0===r)throw new _r(Er.INVALID_ARGUMENT,"experimentalForceLongPolling and experimentalAutoDetectLongPolling cannot be used together.")}(0,e.experimentalForceLongPolling,0,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}}class Md{constructor(e,t){this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Rd({}),this._settingsFrozen=!1,e instanceof wd?(this._databaseId=e,this._credentials=new Cd):(this._app=e,this._databaseId=function(e){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new _r(Er.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new wd(e.options.projectId)}(e),this._credentials=new xd(t))}get app(){if(!this._app)throw new _r(Er.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 _r(Er.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 Rd(e),void 0!==e.credentials&&(this._credentials=function(e){if(!e)return new Cd;switch(e.type){case"gapi":const t=e.client;return Nr(!("object"!=typeof t||null===t||!t.auth||!t.auth.getAuthHeaderValueForFirstParty)),new Id(t,e.sessionIndex||"0",e.iamToken||null);case"provider":return e.client;default:throw new _r(Er.INVALID_ARGUMENT,"makeCredentialsProvider 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){const t=Ed.get(e);t&&(Tr("ComponentProvider","Removing Datastore"),Ed.delete(e),t.terminate())}(this),Promise.resolve()}}function Ld(e,t,n,r={}){const i=(e=Ad(e,Md))._getSettings();if("firestore.googleapis.com"!==i.host&&i.host!==t&&kr("Host has been set in both settings() and useEmulator(), emulator host will be used"),e._setSettings(Object.assign(Object.assign({},i),{host:`${t}:${n}`,ssl:!1})),r.mockUserToken){const t=(0,l.Sg)(r.mockUserToken),n=r.mockUserToken.sub||r.mockUserToken.user_id;if(!n)throw new _r(Er.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");e._credentials=new Sd(new _d(t,new nu(n)))}}class jd{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 Wd(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new jd(this.firestore,e,this._key)}}class Fd{constructor(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new Fd(this.firestore,e,this._query)}}class Wd extends Fd{constructor(e,t,n){super(e,t,Zi(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new jd(this.firestore,null,new oi(e))}withConverter(e){return new Wd(this.firestore,e,this._path)}}function Bd(e,t,...n){if(e=(0,l.m9)(e),kd("collection","path",t),e instanceof Md){const r=Zr.fromString(t,...n);return Pd(r),new Wd(e,null,r)}{if(!(e instanceof jd||e instanceof Wd))throw new _r(Er.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=Zr.fromString(e.path,...n).child(Zr.fromString(t));return Pd(r),new Wd(e.firestore,null,r)}}function zd(e,t){if(e=Ad(e,Md),kd("collectionGroup","collection id",t),t.indexOf("/")>=0)throw new _r(Er.INVALID_ARGUMENT,`Invalid collection ID '${t}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);return new Fd(e,null,function(e){return new Ui(Zr.emptyPath(),e)}(t))}function Ud(e,t,...n){if(e=(0,l.m9)(e),1===arguments.length&&(t=Rr.u()),kd("doc","path",t),e instanceof Md){const r=Zr.fromString(t,...n);return Od(r),new jd(e,null,new oi(r))}{if(!(e instanceof jd||e instanceof Wd))throw new _r(Er.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=e._path.child(Zr.fromString(t,...n));return Od(r),new jd(e.firestore,e instanceof Wd?e.converter:null,new oi(r))}}function Vd(e,t){return e=(0,l.m9)(e),t=(0,l.m9)(t),(e instanceof jd||e instanceof Wd)&&(t instanceof jd||t instanceof Wd)&&e.firestore===t.firestore&&e.path===t.path&&e.converter===t.converter}function Zd(e,t){return e=(0,l.m9)(e),t=(0,l.m9)(t),e instanceof Fd&&t instanceof Fd&&e.firestore===t.firestore&&Ji(e._query,t._query)&&e.converter===t.converter}class $d{constructor(){this._c=Promise.resolve(),this.mc=[],this.gc=!1,this.yc=[],this.Ec=null,this.Tc=!1,this.Ic=[],this.Zi=new Eu(this,"async_queue_retry"),this.Ac=()=>{const e=bu();e&&Tr("AsyncQueue","Visibility state changed to "+e.visibilityState),this.Zi.Gi()};const e=bu();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.Ac)}get isShuttingDown(){return this.gc}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Rc(),this.Pc(e)}enterRestrictedMode(){if(!this.gc){this.gc=!0;const e=bu();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("visibilitychange",this.Ac)}}enqueue(e){return this.Rc(),this.gc?new Promise((e=>{})):this.Pc(e)}enqueueRetryable(e){this.enqueueAndForget((()=>(this.mc.push(e),this.bc())))}async bc(){if(0!==this.mc.length){try{await this.mc[0](),this.mc.shift(),this.Zi.reset()}catch(e){if(!Es(e))throw e;Tr("AsyncQueue","Operation failed with retryable error: "+e)}this.mc.length>0&&this.Zi.ji((()=>this.bc()))}}Pc(e){const t=this._c.then((()=>(this.Tc=!0,e().catch((e=>{throw this.Ec=e,this.Tc=!1,Ir("INTERNAL UNHANDLED ERROR: ",function(e){let t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}(e)),e})).then((e=>(this.Tc=!1,e))))));return this._c=t,t}enqueueAfterDelay(e,t,n){this.Rc(),this.Ic.indexOf(e)>-1&&(t=0);const r=tc.createAndSchedule(this,e,t,n,(e=>this.vc(e)));return this.yc.push(r),r}Rc(){this.Ec&&Pr()}verifyOperationInProgress(){}async Vc(){let e;do{e=this._c,await e}while(e!==this._c)}Sc(e){for(const t of this.yc)if(t.timerId===e)return!0;return!1}Dc(e){return this.Vc().then((()=>{this.yc.sort(((e,t)=>e.targetTimeMs-t.targetTimeMs));for(const t of this.yc)if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.Vc()}))}Cc(e){this.Ic.push(e)}vc(e){const t=this.yc.indexOf(e);this.yc.splice(t,1)}}function qd(e){return function(e,t){if("object"!=typeof e||null===e)return!1;const n=e;for(const e of["next","error","complete"])if(e in n&&"function"==typeof n[e])return!0;return!1}(e)}class Hd{constructor(){this._progressObserver={},this._taskCompletionResolver=new ms,this._lastProgress={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}onProgress(e,t,n){this._progressObserver={next:e,error:t,complete:n}}catch(e){return this._taskCompletionResolver.promise.catch(e)}then(e,t){return this._taskCompletionResolver.promise.then(e,t)}_completeWith(e){this._updateProgress(e),this._progressObserver.complete&&this._progressObserver.complete(),this._taskCompletionResolver.resolve(e)}_failWith(e){this._lastProgress.taskState="Error",this._progressObserver.next&&this._progressObserver.next(this._lastProgress),this._progressObserver.error&&this._progressObserver.error(e),this._taskCompletionResolver.reject(e)}_updateProgress(e){this._lastProgress=e,this._progressObserver.next&&this._progressObserver.next(e)}}const Kd=-1;class Gd extends Md{constructor(e,t){super(e,t),this.type="firestore",this._queue=new $d,this._persistenceKey="name"in e?e.name:"[DEFAULT]"}_terminate(){return this._firestoreClient||Jd(this),this._firestoreClient.terminate()}}function Qd(e,t){const n=(0,r.qX)(e,"firestore-exp");if(n.isInitialized())throw new _r(Er.FAILED_PRECONDITION,"Firestore can only be initialized once per app.");if(void 0!==t.cacheSizeBytes&&-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new _r(Er.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return n.initialize({options:t})}function Yd(e=(0,r.Mq)()){return(0,r.qX)(e,"firestore-exp").getImmediate()}function Xd(e){return e._firestoreClient||Jd(e),e._firestoreClient.verifyNotTerminated(),e._firestoreClient}function Jd(e){var t;const n=e._freezeSettings(),r=function(e,t,n,r){return new bd(e,t,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling)}(e._databaseId,(null===(t=e._app)||void 0===t?void 0:t.options.appId)||"",e._persistenceKey,n);e._firestoreClient=new sd(e._credentials,e._queue,r)}function eh(e,t){ch(e=Ad(e,Gd));const n=Xd(e),r=e._freezeSettings(),i=new td;return nh(n,i,new Jc(i,r.cacheSizeBytes,null==t?void 0:t.forceOwnership))}function th(e){ch(e=Ad(e,Gd));const t=Xd(e),n=e._freezeSettings(),r=new td;return nh(t,r,new ed(r,n.cacheSizeBytes))}function nh(e,t,n){const r=new ms;return e.asyncQueue.enqueue((async()=>{try{await ld(e,n),await ud(e,t),r.resolve()}catch(e){if(!function(e){return"FirebaseError"===e.name?e.code===Er.FAILED_PRECONDITION||e.code===Er.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&e instanceof DOMException)||22===e.code||20===e.code||11===e.code}(e))throw e;console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+e),r.reject(e)}})).then((()=>r.promise))}function rh(e){if(e._initialized&&!e._terminated)throw new _r(Er.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");const t=new ms;return e._queue.enqueueAndForgetEvenWhileRestricted((async()=>{try{await async function(e){if(!ys.gt())return Promise.resolve();const t=e+"main";await ys.delete(t)}(Ol(e._databaseId,e._persistenceKey)),t.resolve()}catch(e){t.reject(e)}})),t.promise}function ih(e){return function(e){const t=new ms;return e.asyncQueue.enqueueAndForget((async()=>async function(e,t){const n=Ar(e);Lu(n.remoteStore)||Tr("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.");try{const e=await function(e){const t=Ar(e);return t.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(e=>t._n.getHighestUnacknowledgedBatchId(e)))}(n.localStore);if(-1===e)return void t.resolve();const r=n.ko.get(e)||[];r.push(t),n.ko.set(e,r)}catch(e){const n=nc(e,"Initialization of waitForPendingWrites() operation failed");t.reject(n)}}(await md(e),t))),t.promise}(Xd(e=Ad(e,Gd)))}function oh(e){return function(e){return e.asyncQueue.enqueue((async()=>{const t=await hd(e),n=await pd(e);return t.setNetworkEnabled(!0),function(e){const t=Ar(e);return t.Mr.delete(0),ku(t)}(n)}))}(Xd(e=Ad(e,Gd)))}function ah(e){return function(e){return e.asyncQueue.enqueue((async()=>{const t=await hd(e),n=await pd(e);return t.setNetworkEnabled(!1),async function(e){const t=Ar(e);t.Mr.add(0),await Ou(t),t.Br.set("Offline")}(n)}))}(Xd(e=Ad(e,Gd)))}function sh(e){return(0,r.wN)(e.app,"firestore-exp"),e._delete()}function lh(e,t){const n=Xd(e=Ad(e,Gd)),r=new Hd;return function(e,t,n,r){const i=function(e,t){let n;return n="string"==typeof e?(new TextEncoder).encode(e):e,function(e,t){return new id(e,t)}(function(e,t){if(e instanceof Uint8Array)return nd(e,t);if(e instanceof ArrayBuffer)return nd(new Uint8Array(e),t);if(e instanceof ReadableStream)return e.getReader();throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream")}(n),t)}(n,wu(t));e.asyncQueue.enqueueAndForget((async()=>{!function(e,t,n){const r=Ar(e);(async function(e,t,n){try{const r=await t.getMetadata();if(await function(e,t){const n=Ar(e),r=ba(t.createTime);return n.persistence.runTransaction("hasNewerBundle","readonly",(e=>n.Ke.getBundleMetadata(e,t.id))).then((e=>!!e&&e.createTime.compareTo(r)>=0))}(e.localStore,r))return await t.close(),void n._completeWith(function(e){return{taskState:"Success",documentsLoaded:e.totalDocuments,bytesLoaded:e.totalBytes,totalDocuments:e.totalDocuments,totalBytes:e.totalBytes}}(r));n._updateProgress(vc(r));const i=new gc(r,e.localStore,t.R);let o=await t.Lo();for(;o;){const e=await i.oo(o);e&&n._updateProgress(e),o=await t.Lo()}const a=await i.complete();await Wc(e,a.wn,void 0),await function(e,t){const n=Ar(e);return n.persistence.runTransaction("Save bundle","readwrite",(e=>n.Ke.saveBundleMetadata(e,t)))}(e.localStore,r),n._completeWith(a.progress)}catch(e){kr("SyncEngine",`Loading bundle failed with ${e}`),n._failWith(e)}})(r,t,n).then((()=>{r.sharedClientState.notifyBundleLoaded()}))}(await md(e),i,r)}))}(n,e._databaseId,t,r),r}function uh(e,t){return function(e,t){return e.asyncQueue.enqueue((async()=>function(e,t){const n=Ar(e);return n.persistence.runTransaction("Get named query","readonly",(e=>n.Ke.getNamedQuery(e,t)))}(await fd(e),t)))}(Xd(e=Ad(e,Gd)),t).then((t=>t?new Fd(e,null,t.query):null))}function ch(e){if(e._initialized||e._terminated)throw new _r(Er.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.")}class dh{constructor(...e){for(let t=0;t90)throw new _r(Er.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new _r(Er.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 Mr(this._lat,e._lat)||Mr(this._long,e._long)}}const gh=/^__.*__$/;class vh{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return null!==this.fieldMask?new Ao(e,this.data,this.fieldMask,t,this.fieldTransforms):new No(e,this.data,t,this.fieldTransforms)}}class yh{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return new Ao(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function bh(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Pr()}}class wh{constructor(e,t,n,r,i,o){this.settings=e,this.databaseId=t,this.R=n,this.ignoreUndefinedProperties=r,void 0===i&&this.Nc(),this.fieldTransforms=i||[],this.fieldMask=o||[]}get path(){return this.settings.path}get xc(){return this.settings.xc}kc(e){return new wh(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.R,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}$c(e){var t;const n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.kc({path:n,Oc:!1});return r.Mc(e),r}Fc(e){var t;const n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.kc({path:n,Oc:!1});return r.Nc(),r}Lc(e){return this.kc({path:void 0,Oc:!0})}Bc(e){return Bh(e,this.settings.methodName,this.settings.Uc||!1,this.path,this.settings.qc)}contains(e){return void 0!==this.fieldMask.find((t=>e.isPrefixOf(t)))||void 0!==this.fieldTransforms.find((t=>e.isPrefixOf(t.field)))}Nc(){if(this.path)for(let e=0;el.covers(e.field)))}else l=null,u=a.fieldTransforms;return new vh(new bi(s),l,u)}class Sh extends ph{_toFieldTransform(e){if(2!==e.xc)throw 1===e.xc?e.Bc(`${this._methodName}() can only appear at the top level of your update data`):e.Bc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof Sh}}function xh(e,t,n){return new wh({xc:3,qc:t.settings.qc,methodName:e._methodName,Oc:n},t.databaseId,t.R,t.ignoreUndefinedProperties)}class Th extends ph{_toFieldTransform(e){return new Eo(e.path,new fo)}isEqual(e){return e instanceof Th}}class Ih extends ph{constructor(e,t){super(e),this.Qc=t}_toFieldTransform(e){const t=xh(this,e,!0),n=this.Qc.map((e=>Dh(e,t))),r=new po(n);return new Eo(e.path,r)}isEqual(e){return this===e}}class kh extends ph{constructor(e,t){super(e),this.Qc=t}_toFieldTransform(e){const t=xh(this,e,!0),n=this.Qc.map((e=>Dh(e,t))),r=new go(n);return new Eo(e.path,r)}isEqual(e){return this===e}}class Oh extends ph{constructor(e,t){super(e),this.jc=t}_toFieldTransform(e){const t=new yo(e.R,so(e.R,this.jc));return new Eo(e.path,t)}isEqual(e){return this===e}}function Ph(e,t,n,r){const i=e.Kc(1,t,n);Lh("Data must be an object, but it was:",i,r);const o=[],a=bi.empty();zr(r,((e,r)=>{const s=Wh(t,e,n);r=(0,l.m9)(r);const u=i.Fc(s);if(r instanceof Sh)o.push(s);else{const e=Dh(r,u);null!=e&&(o.push(s),a.set(s,e))}}));const s=new Hr(o);return new yh(a,s,i.fieldTransforms)}function Nh(e,t,n,r,i,o){const a=e.Kc(1,t,n),s=[jh(t,r,n)],u=[i];if(o.length%2!=0)throw new _r(Er.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=0;--e)if(!zh(c,s[e])){const t=s[e];let n=u[e];n=(0,l.m9)(n);const r=a.Fc(t);if(n instanceof Sh)c.push(t);else{const e=Dh(n,r);null!=e&&(c.push(t),d.set(t,e))}}const h=new Hr(c);return new yh(d,h,a.fieldTransforms)}function Ah(e,t,n,r=!1){return Dh(n,e.Kc(r?4:3,t))}function Dh(e,t){if(Mh(e=(0,l.m9)(e)))return Lh("Unsupported field value:",t,e),Rh(e,t);if(e instanceof ph)return function(e,t){if(!bh(t.xc))throw t.Bc(`${e._methodName}() can only be used with update() and set()`);if(!t.path)throw t.Bc(`${e._methodName}() is not currently supported inside arrays`);const 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.Oc&&4!==t.xc)throw t.Bc("Nested arrays are not supported");return function(e,t){const n=[];let r=0;for(const i of e){let e=Dh(i,t.Lc(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,l.m9)(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e)return so(t.R,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){const n=Fr.fromDate(e);return{timestampValue:ga(t.R,n)}}if(e instanceof Fr){const n=new Fr(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:ga(t.R,n)}}if(e instanceof mh)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof fh)return{bytesValue:va(t.R,e._byteString)};if(e instanceof jd){const n=t.databaseId,r=e.firestore._databaseId;if(!r.isEqual(n))throw t.Bc(`Document reference is for database ${r.projectId}/${r.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:wa(e.firestore._databaseId||t.databaseId,e._key.path)}}throw t.Bc(`Unsupported field value: ${Nd(e)}`)}(e,t)}function Rh(e,t){const n={};return Ur(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):zr(e,((e,r)=>{const i=Dh(r,t.$c(e));null!=i&&(n[e]=i)})),{mapValue:{fields:n}}}function Mh(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof Fr||e instanceof mh||e instanceof fh||e instanceof jd||e instanceof ph)}function Lh(e,t,n){if(!Mh(n)||!function(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}(n)){const r=Nd(n);throw"an object"===r?t.Bc(e+" a custom object"):t.Bc(e+" "+r)}}function jh(e,t,n){if((t=(0,l.m9)(t))instanceof dh)return t._internalPath;if("string"==typeof t)return Wh(e,t);throw Bh("Field path arguments must be of type string or FieldPath.",e,!1,void 0,n)}const Fh=new RegExp("[~\\*/\\[\\]]");function Wh(e,t,n){if(t.search(Fh)>=0)throw Bh(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e,!1,void 0,n);try{return new dh(...t.split("."))._internalPath}catch(r){throw Bh(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e,!1,void 0,n)}}function Bh(e,t,n,r,i){const o=r&&!r.isEmpty(),a=void 0!==i;let s=`Function ${t}() called with invalid data`;n&&(s+=" (via `toFirestore()`)"),s+=". ";let l="";return(o||a)&&(l+=" (found",o&&(l+=` in field ${r}`),a&&(l+=` in document ${i}`),l+=")"),new _r(Er.INVALID_ARGUMENT,s+e+l)}function zh(e,t){return e.some((e=>e.isEqual(t)))}class Uh{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 jd(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const e=new Vh(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.toProto())}}get(e){if(this._document){const t=this._document.data.field(Zh("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class Vh extends Uh{data(){return super.data()}}function Zh(e,t){return"string"==typeof t?Wh(e,t):t instanceof dh?t._internalPath:t._delegate._internalPath}class $h{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class qh extends Uh{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){const t=new Hh(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.toProto(),e.serverTimestamps)}}get(e,t={}){if(this._document){const n=this._document.data.field(Zh("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}}class Hh extends qh{data(e={}){return super.data(e)}}class Kh{constructor(e,t,n,r){this._firestore=e,this._userDataWriter=t,this._snapshot=r,this.metadata=new $h(r.hasPendingWrites,r.fromCache),this.query=n}get docs(){const 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 Hh(this._firestore,this._userDataWriter,n.key,n,new $h(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new _r(Er.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,n=0;return e._snapshot.docChanges.map((r=>{const i=new Hh(e._firestore,e._userDataWriter,r.doc.key,r.doc,new $h(e._snapshot.mutatedKeys.has(r.doc.key),e._snapshot.fromCache),e.query.converter);return t=r.doc,{type:"added",doc:i,oldIndex:-1,newIndex:n++}}))}{let n=e._snapshot.oldDocs;return e._snapshot.docChanges.filter((e=>t||3!==e.type)).map((t=>{const r=new Hh(e._firestore,e._userDataWriter,t.doc.key,t.doc,new $h(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter);let i=-1,o=-1;return 0!==t.type&&(i=n.indexOf(t.doc.key),n=n.delete(t.doc.key)),1!==t.type&&(n=n.add(t.doc),o=n.indexOf(t.doc.key)),{type:Gh(t.type),doc:r,oldIndex:i,newIndex:o}}))}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}function Gh(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Pr()}}function Qh(e,t){return e instanceof qh&&t instanceof qh?e._firestore===t._firestore&&e._key.isEqual(t._key)&&(null===e._document?null===t._document:e._document.isEqual(t._document))&&e._converter===t._converter:e instanceof Kh&&t instanceof Kh&&e._firestore===t._firestore&&Zd(e.query,t.query)&&e.metadata.isEqual(t.metadata)&&e._snapshot.isEqual(t._snapshot)}function Yh(e){if(qi(e)&&0===e.explicitOrderBy.length)throw new _r(Er.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class Xh{}function Jh(e,...t){for(const n of t)e=n._apply(e);return e}class ef extends Xh{constructor(e,t,n){super(),this.Wc=e,this.Gc=t,this.zc=n,this.type="where"}_apply(e){const t=_h(e.firestore),n=function(e,t,n,r,i,o,a){let s;if(i.isKeyField()){if("array-contains"===o||"array-contains-any"===o)throw new _r(Er.INVALID_ARGUMENT,`Invalid Query. You can't perform '${o}' queries on FieldPath.documentId().`);if("in"===o||"not-in"===o){gf(a,o);const t=[];for(const n of a)t.push(mf(r,e,n));s={arrayValue:{values:t}}}else s=mf(r,e,a)}else"in"!==o&&"not-in"!==o&&"array-contains-any"!==o||gf(a,o),s=Ah(n,"where",a,"in"===o||"not-in"===o);const l=Ii.create(i,o,s);return function(e,t){if(t.g()){const n=Ki(e);if(null!==n&&!n.isEqual(t.field))throw new _r(Er.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 '${t.field.toString()}'`);const r=Hi(e);null!==r&&vf(0,t.field,r)}const n=function(e,t){for(const n of e.filters)if(t.indexOf(n.op)>=0)return n.op;return null}(e,function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==n)throw n===t.op?new _r(Er.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${t.op.toString()}' filter.`):new _r(Er.INVALID_ARGUMENT,`Invalid query. You cannot use '${t.op.toString()}' filters with '${n.toString()}' filters.`)}(e,l),l}(e._query,0,t,e.firestore._databaseId,this.Wc,this.Gc,this.zc);return new Fd(e.firestore,e.converter,function(e,t){const n=e.filters.concat([t]);return new Ui(e.path,e.collectionGroup,e.explicitOrderBy.slice(),n,e.limit,e.limitType,e.startAt,e.endAt)}(e._query,n))}}function tf(e,t,n){const r=t,i=Zh("where",e);return new ef(i,r,n)}class nf extends Xh{constructor(e,t){super(),this.Wc=e,this.Hc=t,this.type="orderBy"}_apply(e){const t=function(e,t,n){if(null!==e.startAt)throw new _r(Er.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new _r(Er.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");const r=new Fi(t,n);return function(e,t){if(null===Hi(e)){const n=Ki(e);null!==n&&vf(0,n,t.field)}}(e,r),r}(e._query,this.Wc,this.Hc);return new Fd(e.firestore,e.converter,function(e,t){const n=e.explicitOrderBy.concat([t]);return new Ui(e.path,e.collectionGroup,n,e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(e._query,t))}}function rf(e,t="asc"){const n=t,r=Zh("orderBy",e);return new nf(r,n)}class of extends Xh{constructor(e,t,n){super(),this.type=e,this.Jc=t,this.Yc=n}_apply(e){return new Fd(e.firestore,e.converter,Xi(e._query,this.Jc,this.Yc))}}function af(e){return Dd("limit",e),new of("limit",e,"F")}function sf(e){return Dd("limitToLast",e),new of("limitToLast",e,"L")}class lf extends Xh{constructor(e,t,n){super(),this.type=e,this.Xc=t,this.Zc=n}_apply(e){const t=pf(e,this.type,this.Xc,this.Zc);return new Fd(e.firestore,e.converter,function(e,t){return new Ui(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,t,e.endAt)}(e._query,t))}}function uf(...e){return new lf("startAt",e,!0)}function cf(...e){return new lf("startAfter",e,!1)}class df extends Xh{constructor(e,t,n){super(),this.type=e,this.Xc=t,this.Zc=n}_apply(e){const t=pf(e,this.type,this.Xc,this.Zc);return new Fd(e.firestore,e.converter,function(e,t){return new Ui(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,t)}(e._query,t))}}function hf(...e){return new df("endBefore",e,!0)}function ff(...e){return new df("endAt",e,!1)}function pf(e,t,n,r){if(n[0]=(0,l.m9)(n[0]),n[0]instanceof Uh)return function(e,t,n,r,i){if(!r)throw new _r(Er.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${n}().`);const o=[];for(const n of Qi(e))if(n.field.isKeyField())o.push(fi(t,r.key));else{const e=r.data.field(n.field);if(Jr(e))throw new _r(Er.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+n.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===e){const e=n.field.canonicalString();throw new _r(Er.INVALID_ARGUMENT,`Invalid query. You are trying to start or end a query using a document for which the field '${e}' (used as the orderBy) does not exist.`)}o.push(e)}return new Li(o,i)}(e._query,e.firestore._databaseId,t,n[0]._document,r);{const i=_h(e.firestore);return function(e,t,n,r,i,o){const a=e.explicitOrderBy;if(i.length>a.length)throw new _r(Er.INVALID_ARGUMENT,`Too many arguments provided to ${r}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);const s=[];for(let o=0;o10)throw new _r(Er.INVALID_ARGUMENT,`Invalid Query. '${t.toString()}' filters support a maximum of 10 elements in the value array.`)}function vf(e,t,n){if(!n.isEqual(t))throw new _r(Er.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.`)}class yf{convertValue(e,t="none"){switch(ai(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Yr(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(Xr(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 Pr()}}convertObject(e,t){const n={};return zr(e.fields||{},((e,r)=>{n[e]=this.convertValue(r,t)})),n}convertGeoPoint(e){return new mh(Yr(e.latitude),Yr(e.longitude))}convertArray(e,t){return(e.values||[]).map((e=>this.convertValue(e,t)))}convertServerTimestamp(e,t){switch(t){case"previous":const n=ei(e);return null==n?null:this.convertValue(n,t);case"estimate":return this.convertTimestamp(ti(e));default:return null}}convertTimestamp(e){const t=Qr(e);return new Fr(t.seconds,t.nanos)}convertDocumentKey(e,t){const n=Zr.fromString(e);Nr($a(n));const r=new wd(n.get(1),n.get(3)),i=new oi(n.popFirst(5));return r.isEqual(t)||Ir(`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}}function bf(e,t,n){let r;return r=e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t,r}class wf extends yf{constructor(e){super(),this.firestore=e}convertBytes(e){return new fh(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new jd(this.firestore,null,t)}}class Ef{constructor(e,t){this._firestore=e,this._commitHandler=t,this._mutations=[],this._committed=!1,this._dataReader=_h(e)}set(e,t,n){this._verifyNotCommitted();const r=_f(e,this._firestore),i=bf(r.converter,t,n),o=Ch(this._dataReader,"WriteBatch.set",r._key,i,null!==r.converter,n);return this._mutations.push(o.toMutation(r._key,Co.none())),this}update(e,t,n,...r){this._verifyNotCommitted();const i=_f(e,this._firestore);let o;return o="string"==typeof(t=(0,l.m9)(t))||t instanceof dh?Nh(this._dataReader,"WriteBatch.update",i._key,t,n,r):Ph(this._dataReader,"WriteBatch.update",i._key,t),this._mutations.push(o.toMutation(i._key,Co.exists(!0))),this}delete(e){this._verifyNotCommitted();const t=_f(e,this._firestore);return this._mutations=this._mutations.concat(new Lo(t._key,Co.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new _r(Er.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function _f(e,t){if((e=(0,l.m9)(e)).firestore!==t)throw new _r(Er.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return e}function Cf(e){e=Ad(e,jd);const t=Ad(e.firestore,Gd);return vd(Xd(t),e._key).then((n=>jf(t,e,n)))}class Sf extends yf{constructor(e){super(),this.firestore=e}convertBytes(e){return new fh(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new jd(this.firestore,null,t)}}function xf(e){e=Ad(e,jd);const t=Ad(e.firestore,Gd),n=Xd(t),r=new Sf(t);return function(e,t){const n=new ms;return e.asyncQueue.enqueueAndForget((async()=>async function(e,t,n){try{const r=await function(e,t){const n=Ar(e);return n.persistence.runTransaction("read document","readonly",(e=>n.Fn.mn(e,t)))}(e,t);r.isFoundDocument()?n.resolve(r):r.isNoDocument()?n.resolve(null):n.reject(new _r(Er.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)"))}catch(e){const r=nc(e,`Failed to get document '${t} from cache`);n.reject(r)}}(await fd(e),t,n))),n.promise}(n,e._key).then((n=>new qh(t,r,e._key,n,new $h(null!==n&&n.hasLocalMutations,!0),e.converter)))}function Tf(e){e=Ad(e,jd);const t=Ad(e.firestore,Gd);return vd(Xd(t),e._key,{source:"server"}).then((n=>jf(t,e,n)))}function If(e){e=Ad(e,Fd);const t=Ad(e.firestore,Gd),n=Xd(t),r=new Sf(t);return Yh(e._query),yd(n,e._query).then((n=>new Kh(t,r,e,n)))}function kf(e){e=Ad(e,Fd);const t=Ad(e.firestore,Gd),n=Xd(t),r=new Sf(t);return function(e,t){const n=new ms;return e.asyncQueue.enqueueAndForget((async()=>async function(e,t,n){try{const r=await Ul(e,t,!0),i=new wc(t,r.Bn),o=i._o(r.documents),a=i.applyChanges(o,!1);n.resolve(a.snapshot)}catch(e){const r=nc(e,`Failed to execute query '${t} against cache`);n.reject(r)}}(await fd(e),t,n))),n.promise}(n,e._query).then((n=>new Kh(t,r,e,n)))}function Of(e){e=Ad(e,Fd);const t=Ad(e.firestore,Gd),n=Xd(t),r=new Sf(t);return yd(n,e._query,{source:"server"}).then((n=>new Kh(t,r,e,n)))}function Pf(e,t,n){e=Ad(e,jd);const r=Ad(e.firestore,Gd),i=bf(e.converter,t,n);return Lf(r,[Ch(_h(r),"setDoc",e._key,i,null!==e.converter,n).toMutation(e._key,Co.none())])}function Nf(e,t,n,...r){e=Ad(e,jd);const i=Ad(e.firestore,Gd),o=_h(i);let a;return a="string"==typeof(t=(0,l.m9)(t))||t instanceof dh?Nh(o,"updateDoc",e._key,t,n,r):Ph(o,"updateDoc",e._key,t),Lf(i,[a.toMutation(e._key,Co.exists(!0))])}function Af(e){return Lf(Ad(e.firestore,Gd),[new Lo(e._key,Co.none())])}function Df(e,t){const n=Ad(e.firestore,Gd),r=Ud(e),i=bf(e.converter,t);return Lf(n,[Ch(_h(e.firestore),"addDoc",r._key,i,null!==e.converter,{}).toMutation(r._key,Co.exists(!1))]).then((()=>r))}function Rf(e,...t){var n,r,i;e=(0,l.m9)(e);let o={includeMetadataChanges:!1},a=0;"object"!=typeof t[a]||qd(t[a])||(o=t[a],a++);const s={includeMetadataChanges:o.includeMetadataChanges};if(qd(t[a])){const e=t[a];t[a]=null===(n=e.next)||void 0===n?void 0:n.bind(e),t[a+1]=null===(r=e.error)||void 0===r?void 0:r.bind(e),t[a+2]=null===(i=e.complete)||void 0===i?void 0:i.bind(e)}let u,c,d;if(e instanceof jd)c=Ad(e.firestore,Gd),d=Zi(e._key.path),u={next:n=>{t[a]&&t[a](jf(c,e,n))},error:t[a+1],complete:t[a+2]};else{const n=Ad(e,Fd);c=Ad(n.firestore,Gd),d=n._query;const r=new Sf(c);u={next:e=>{t[a]&&t[a](new Kh(c,r,n,e))},error:t[a+1],complete:t[a+2]},Yh(e._query)}return function(e,t,n,r){const i=new rd(r),o=new fc(t,i,n);return e.asyncQueue.enqueueAndForget((async()=>lc(await gd(e),o))),()=>{i.Wo(),e.asyncQueue.enqueueAndForget((async()=>uc(await gd(e),o)))}}(Xd(c),d,s,u)}function Mf(e,t){return function(e,t){const n=new rd(t);return e.asyncQueue.enqueueAndForget((async()=>function(e,t){Ar(e).Gr.add(t),t.next()}(await gd(e),n))),()=>{n.Wo(),e.asyncQueue.enqueueAndForget((async()=>function(e,t){Ar(e).Gr.delete(t)}(await gd(e),n)))}}(Xd(e=Ad(e,Gd)),qd(t)?t:{next:t})}function Lf(e,t){return function(e,t){const n=new ms;return e.asyncQueue.enqueueAndForget((async()=>async function(e,t,n){const r=Yc(e);try{const e=await function(e,t){const n=Ar(e),r=Fr.now(),i=t.reduce(((e,t)=>e.add(t.key)),ta());let o;return n.persistence.runTransaction("Locally write mutations","readwrite",(e=>n.Fn.pn(e,i).next((i=>{o=i;const a=[];for(const e of t){const t=ko(e,o.get(e.key));null!=t&&a.push(new Ao(e.key,t,wi(t.toProto().mapValue),Co.exists(!0)))}return n._n.addMutationBatch(e,r,a,t)})))).then((e=>(e.applyToLocalDocumentSet(o),{batchId:e.batchId,changes:o})))}(r.localStore,t);r.sharedClientState.addPendingMutation(e.batchId),function(e,t,n){let r=e.xo[e.currentUser.toKey()];r||(r=new Vo(Mr)),r=r.insert(t,n),e.xo[e.currentUser.toKey()]=r}(r,e.batchId,n),await Wc(r,e.changes),await Vu(r.remoteStore)}catch(e){const t=nc(e,"Failed to persist write");n.reject(t)}}(await md(e),t,n))),n.promise}(Xd(e),t)}function jf(e,t,n){const r=n.docs.get(t._key),i=new Sf(e);return new qh(e,i,t._key,r,new $h(n.hasPendingWrites,n.fromCache),t.converter)}class Ff extends class{constructor(e,t){this._firestore=e,this._transaction=t,this._dataReader=_h(e)}get(e){const t=_f(e,this._firestore),n=new wf(this._firestore);return this._transaction.lookup([t._key]).then((e=>{if(!e||1!==e.length)return Pr();const r=e[0];if(r.isFoundDocument())return new Uh(this._firestore,n,r.key,r,t.converter);if(r.isNoDocument())return new Uh(this._firestore,n,t._key,null,t.converter);throw Pr()}))}set(e,t,n){const r=_f(e,this._firestore),i=bf(r.converter,t,n),o=Ch(this._dataReader,"Transaction.set",r._key,i,null!==r.converter,n);return this._transaction.set(r._key,o),this}update(e,t,n,...r){const i=_f(e,this._firestore);let o;return o="string"==typeof(t=(0,l.m9)(t))||t instanceof dh?Nh(this._dataReader,"Transaction.update",i._key,t,n,r):Ph(this._dataReader,"Transaction.update",i._key,t),this._transaction.update(i._key,o),this}delete(e){const t=_f(e,this._firestore);return this._transaction.delete(t._key),this}}{constructor(e,t){super(e,t),this._firestore=e}get(e){const t=_f(e,this._firestore),n=new Sf(this._firestore);return super.get(e).then((e=>new qh(this._firestore,n,t._key,e._document,new $h(!1,!1),t.converter)))}}function Wf(e,t){return function(e,t){const n=new ms;return e.asyncQueue.enqueueAndForget((async()=>{const r=await function(e){return dd(e).then((e=>e.datastore))}(e);new ad(e.asyncQueue,r,t,n).run()})),n.promise}(Xd(e),(n=>t(new Ff(e,n))))}function Bf(){return new Sh("deleteField")}function zf(){return new Th("serverTimestamp")}function Uf(...e){return new Ih("arrayUnion",e)}function Vf(...e){return new kh("arrayRemove",e)}function Zf(e){return new Oh("increment",e)}function $f(e){return Xd(e=Ad(e,Gd)),new Ef(e,(t=>Lf(e,t)))}!function(e){br=e}(r.Jn),(0,r.Xd)(new u("firestore-exp",((e,{options:t})=>{const n=e.getProvider("app-exp").getImmediate(),r=new Gd(n,e.getProvider("auth-internal"));return t&&r._setSettings(t),r}),"PUBLIC")),(0,r.KN)("@firebase/firestore","0.0.900-exp.d92a36260",void 0)},3495:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getFunctions:()=>E,httpsCallable:()=>C,useFunctionsEmulator:()=>_});var r=n(3198),i=n(8448),o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function l(e,t){for(var n=0,r=t.length,i=e.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]f(e)));if("function"==typeof e||"object"==typeof e)return h(e,(e=>f(e)));throw new Error("Data cannot be encoded in JSON: "+e)}function p(e){if(null==e)return e;if(e["@type"])switch(e["@type"]){case"type.googleapis.com/google.protobuf.Int64Value":case"type.googleapis.com/google.protobuf.UInt64Value":{const t=Number(e.value);if(isNaN(t))throw new Error("Data cannot be decoded from JSON: "+e);return t}default:throw new Error("Data cannot be decoded from JSON: "+e)}return Array.isArray(e)?e.map((e=>p(e))):"function"==typeof e||"object"==typeof e?h(e,(e=>p(e))):e}!function(){function e(e){this.name=e,this.providers=new Map}e.prototype.addComponent=function(e){var t=this.getProvider(e.name);if(t.isComponentSet())throw new Error("Component "+e.name+" has already been registered with "+this.name);t.setComponent(e)},e.prototype.addOrOverwriteComponent=function(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)},e.prototype.getProvider=function(e){if(this.providers.has(e))return this.providers.get(e);var t=new d(e,this);return this.providers.set(e,t),t},e.prototype.getProviders=function(){return Array.from(this.providers.values())}}();const m="functions-exp",g={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 v extends i.ZR{constructor(e,t,n){super(`functions-exp/${e}`,t||""),this.details=n}}class y{constructor(e,t){this.auth=null,this.messaging=null,this.auth=e.getImmediate({optional:!0}),this.messaging=t.getImmediate({optional:!0}),this.auth||e.get().then((e=>this.auth=e),(()=>{})),this.messaging||t.get().then((e=>this.messaging=e),(()=>{}))}async getAuthToken(){if(this.auth)try{const e=await this.auth.getToken();return null==e?void 0:e.accessToken}catch(e){return}}async getMessagingToken(){if(this.messaging&&"Notification"in self&&"granted"===Notification.permission)try{return this.messaging.getToken()}catch(e){return}}async getContext(){return{authToken:await this.getAuthToken(),messagingToken:await this.getMessagingToken()}}}class b{constructor(e,t,n,r="us-central1",i){this.app=e,this.fetchImpl=i,this.emulatorOrigin=null,this.contextProvider=new y(t,n),this.cancelAllRequests=new Promise((e=>{this.deleteService=()=>Promise.resolve(e())}));try{const e=new URL(r);this.customDomain=e.origin,this.region="us-central1"}catch(e){this.customDomain=null,this.region=r}}_delete(){return this.deleteService()}_url(e){const t=this.app.options.projectId;return null!==this.emulatorOrigin?`${this.emulatorOrigin}/${t}/${this.region}/${e}`:null!==this.customDomain?`${this.customDomain}/${e}`:`https://${this.region}-${t}.cloudfunctions.net/${e}`}}async function w(e,t,n,r){let i;n["Content-Type"]="application/json";try{i=await r(e,{method:"POST",body:JSON.stringify(t),headers:n})}catch(e){return{status:0,json:null}}let o=null;try{o=await i.json()}catch(e){}return{status:i.status,json:o}}function E(e=(0,r.Mq)(),t="us-central1"){return(0,r.qX)((0,i.m9)(e),m).getImmediate({identifier:t})}function _(e,t,n){!function(e,t,n){e.emulatorOrigin=`http://${t}:${n}`}((0,i.m9)(e),t,n)}function C(e,t,n){return function(e,t,n){return r=>async function(e,t,n,r){const i=e._url(t),o={data:n=f(n)},a={},s=await e.contextProvider.getContext();s.authToken&&(a.Authorization="Bearer "+s.authToken),s.messagingToken&&(a["Firebase-Instance-ID-Token"]=s.messagingToken);const l=r.timeout||7e4,u=await Promise.race([w(i,o,a,e.fetchImpl),(c=l,new Promise(((e,t)=>{setTimeout((()=>{t(new v("deadline-exceeded","deadline-exceeded"))}),c)}))),e.cancelAllRequests]);var c;if(!u)throw new v("cancelled","Firebase Functions instance was deleted.");const d=function(e,t){let n,r=function(e){if(e>=200&&e<300)return"ok";switch(e){case 0:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 500:return"internal";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}(e),i=r;try{const e=t&&t.error;if(e){const t=e.status;if("string"==typeof t){if(!g[t])return new v("internal","internal");r=g[t],i=t}const o=e.message;"string"==typeof o&&(i=o),n=e.details,void 0!==n&&(n=p(n))}}catch(e){}return"ok"===r?null:new v(r,i,n)}(u.status,u.json);if(d)throw d;if(!u.json)throw new v("internal","Response is not valid JSON object.");let h=u.json.data;if(void 0===h&&(h=u.json.result),void 0===h)throw new v("internal","Response is missing data field.");return{data:p(h)}}(e,t,r,n||{})}((0,i.m9)(e),t,n)}var S;S=fetch.bind(self),(0,r.Xd)(new u(m,((e,{instanceIdentifier:t})=>{const n=e.getProvider("app-exp").getImmediate(),r=e.getProvider("auth-internal"),i=e.getProvider("messaging");return new b(n,r,i,t,S)}),"PUBLIC").setMultipleInstances(!0)),(0,r.KN)("@firebase/functions-exp","0.0.900-exp.d92a36260")},4147:(e,t,n)=>{var r,i,o,a;o=window.$,(a={config:{},container:{},controls:{},errors:{},items:{},utils:{}}).utils.F=function(){},a.utils.extend=function(e,t){e.prototype=a.utils.createObject(t.prototype),e.prototype.contructor=e},a.utils.createObject=function(e){return"function"==typeof Object.create?Object.create(e):(a.utils.F.prototype=e,new a.utils.F)},a.utils.objectKeys=function(e){var t,n;if("function"==typeof Object.keys)return Object.keys(e);for(n in t=[],e)t.push(n);return t},a.utils.getHashValue=function(e){var t=location.hash.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},a.utils.getQueryStringParam=function(e){if(window.location.hash)return a.utils.getHashValue(e);if(!window.location.search)return null;var t,n,r=window.location.search.substr(1).split("&"),i={};for(n=0;n/g,">").replace(/]+)>)/gi,""))},a.utils.EventEmitter=function(){this._mSubscriptions={},this._mSubscriptions[a.utils.EventEmitter.ALL_EVENT]=[],this.on=function(e,t,n){if(!a.utils.isFunction(t))throw new Error("Tried to listen to event "+e+" with non-function callback "+t);this._mSubscriptions[e]||(this._mSubscriptions[e]=[]),this._mSubscriptions[e].push({fn:t,ctx:n})},this.emit=function(e){var t,n,r;r=Array.prototype.slice.call(arguments,1);var i=this._mSubscriptions[e];if(i)for(i=i.slice(),t=0;tthis._nDistance||Math.abs(this._nY)>this._nDistance)&&(clearTimeout(this._timeout),this._startDrag()),this._bDragging&&this.emit("drag",this._nX,this._nY,e)}},onMouseUp:function(e){null!=this._timeout&&(clearTimeout(this._timeout),this._eBody.removeClass("lm_dragging"),this._eElement.removeClass("lm_dragging"),this._oDocument.find("iframe").css("pointer-events",""),this._oDocument.unbind("mousemove touchmove",this._fMove),this._oDocument.unbind("mouseup touchend",this._fUp),!0===this._bDragging&&(this._bDragging=!1,this.emit("dragStop",e,this._nOriginalX+this._nX)))},_startDrag:function(){this._bDragging=!0,this._eBody.addClass("lm_dragging"),this._eElement.addClass("lm_dragging"),this._oDocument.find("iframe").css("pointer-events","none"),this.emit("dragStart",this._nOriginalX,this._nOriginalY)},_getCoordinates:function(e){return{x:(e=e.originalEvent&&e.originalEvent.touches?e.originalEvent.touches[0]:e).pageX,y:e.pageY}}}),a.LayoutManager=function(e,t){if(!o||"function"!=typeof o.noConflict)throw new Error('jQuery is missing as dependency for GoldenLayout. Please either expose $ on GoldenLayout\'s scope (e.g. window) or add "jquery" to your paths when using RequireJS/AMD');a.utils.EventEmitter.call(this),this.isInitialised=!1,this._isFullPage=!1,this._resizeTimeoutId=null,this._components={"lm-react-component":a.utils.ReactComponentHandler},this._itemAreas=[],this._resizeFunction=a.utils.fnBind(this._onResize,this),this._unloadFunction=a.utils.fnBind(this._onUnload,this),this._maximisedItem=null,this._maximisePlaceholder=o('
'),this._creationTimeoutPassed=!1,this._subWindowsCreated=!1,this._dragSources=[],this._updatingColumnsResponsive=!1,this._firstLoad=!0,this.width=null,this.height=null,this.root=null,this.openPopouts=[],this.selectedItem=null,this.isSubWindow=!1,this.eventHub=new a.utils.EventHub(this),this.config=this._createConfig(e),this.container=t,this.dropTargetIndicator=null,this.transitionIndicator=null,this.tabDropPlaceholder=o('
'),!0===this.isSubWindow&&o("body").css("visibility","hidden"),this._typeToItem={column:a.utils.fnBind(a.items.RowOrColumn,this,[!0]),row:a.utils.fnBind(a.items.RowOrColumn,this,[!1]),stack:a.items.Stack,component:a.items.Component}},a.LayoutManager.__lm=a,a.LayoutManager.minifyConfig=function(e){return(new a.utils.ConfigMinifier).minifyConfig(e)},a.LayoutManager.unminifyConfig=function(e){return(new a.utils.ConfigMinifier).unminifyConfig(e)},a.utils.copy(a.LayoutManager.prototype,{registerComponent:function(e,t){if("function"!=typeof t)throw new Error("Please register a constructor function");if(void 0!==this._components[e])throw new Error("Component "+e+" is already registered");this._components[e]=t},toConfig:function(e){var t,n,r;if(!1===this.isInitialised)throw new Error("Can't create config, layout not yet initialised");if(e&&!(e instanceof a.items.AbstractContentItem))throw new Error("Root must be a ContentItem");for((t={settings:a.utils.copy({},this.config.settings),dimensions:a.utils.copy({},this.config.dimensions),labels:a.utils.copy({},this.config.labels)}).content=[],(n=function(e,t){var r,i;for(r in t.config)"content"!==r&&(e[r]=t.config[r]);if(t.contentItems.length)for(e.content=[],i=0;i(r=this._itemAreas[n]).x1&&er.y1&&tr.surface&&(i=r.surface,o=r);return o},_$createRootItemAreas:function(){var e={y2:0,x2:0,y1:"y2",x1:"x2"};for(var t in e){var n=this.root._$getArea();n.side=t,n[t]=e[t]?n[e[t]]-50:50,n.surface=(n.x2-n.x1)*(n.y2-n.y1),this._itemAreas.push(n)}},_$calculateItemAreas:function(){var e,t,n=this._getAllContentItems();if(this._itemAreas=[],1!==n.length){for(this._$createRootItemAreas(),e=0;e
');e.click(a.utils.fnBind((function(){this.emit("popIn")}),this)),document.title=a.utils.stripTags(this.config.content[0].title),o("head").append(o("body link, body style, template, .gl_keep")),this.container=o("body").html("").css("visibility","visible").append(e),document.body.offsetHeight,window.__glInstance=this},_createSubWindows:function(){var e,t;for(e=0;e1)throw new Error("GoldenLayout more than one container element specified");e[0]===document.body&&(this._isFullPage=!0,o("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"})),this.container=e},_create:function(e){var t;if(!(e.content instanceof Array))throw t=void 0===e.content?"Missing setting 'content' on top level of configuration":"Configuration parameter 'content' must be an array",new a.errors.ConfigurationError(t,e);if(e.content.length>1)throw t="Top level content can't contain more then one element.",new a.errors.ConfigurationError(t,e);this.root=new a.items.Root(this,{content:e.content},this.container),this.root.callDownwards("_$init"),"__glMaximised"===e.maximisedItemId&&this.root.getItemsById(e.maximisedItemId)[0].toggleMaximise()},_onUnload:function(){if(!0===this.config.settings.closePopoutsOnUnload)for(var e=0;e','
',""].join("")),this._contentElement=this._element.find(".lm_content")},a.utils.copy(a.container.ItemContainer.prototype,{getElement:function(){return this._contentElement},hide:function(){this.emit("hide"),this.isHidden=!0,this._element.hide()},show:function(){this.emit("show"),this.isHidden=!1,this._element.show(),0==this.height&&0==this.width||this.emit("shown")},setSize:function(e,t){for(var n,r,i,o,a=this.parent,s=this;!a.isColumn&&!a.isRow;)if(s=a,(a=a.parent).isRoot)return!1;for(n=("height"==(r=a.isColumn?"height":"width")?t:e)/(this[r]*(1/(s.config[r]/100)))*100,i=(s.config[r]-n)/(a.contentItems.length-1),o=0;o0?this._layoutManager.root.contentItems[0]:this._layoutManager.root)),t.addChild(e,this._indexInParent),this.close()},_createWindow:function(){var e,t=this._createUrl(),n=Math.floor(1e6*Math.random()).toString(36),r=this._serializeWindowOptions({width:this._dimensions.width,height:this._dimensions.height,innerWidth:this._dimensions.width,innerHeight:this._dimensions.height,menubar:"no",toolbar:"no",location:"no",personalbar:"no",resizable:"yes",scrollbars:"no",status:"no"});if(this._popoutWindow=window.open(t,n,r),this._popoutWindow)o(this._popoutWindow).on("load",a.utils.fnBind(this._positionWindow,this)).on("unload beforeunload",a.utils.fnBind(this._onClose,this)),e=setInterval(a.utils.fnBind((function(){this._popoutWindow.__glInstance&&this._popoutWindow.__glInstance.isInitialised&&(this._onInitialised(),clearInterval(e))}),this),10);else if(!0===this._layoutManager.config.settings.blockedPopoutsThrowError){var i=new Error("Popout blocked");throw i.type="popoutBlocked",i}},_serializeWindowOptions:function(e){var t,n=[];for(t in e)n.push(t+"="+e[t]);return n.join(",")},_createUrl:function(){var e,t={content:this._config},n="gl-window-config-"+a.utils.getUniqueId();t=(new a.utils.ConfigMinifier).minifyConfig(t);try{localStorage.setItem(n,JSON.stringify(t))}catch(e){throw new Error("Error while writing to localStorage "+e.toString())}return 1===(e=document.location.href.split("?")).length?e[0]+"?gl-window="+n:document.location.href+"&gl-window="+n},_positionWindow:function(){this._popoutWindow.moveTo(this._dimensions.left,this._dimensions.top),this._popoutWindow.focus()},_onInitialised:function(){this.isInitialised=!0,this.getGlInstance().on("popIn",this.popIn,this),this.emit("initialised")},_onClose:function(){setTimeout(a.utils.fnBind(this.emit,this,["closed"]),50)}}),a.controls.DragProxy=function(e,t,n,r,i,s){a.utils.EventEmitter.call(this),this._dragListener=n,this._layoutManager=r,this._contentItem=i,this._originalParent=s,this._area=null,this._lastValidArea=null,this._dragListener.on("drag",this._onDrag,this),this._dragListener.on("dragStop",this._onDrop,this),this.element=o(a.controls.DragProxy._template),s&&s._side&&(this._sided=s._sided,this.element.addClass("lm_"+s._side),["right","bottom"].indexOf(s._side)>=0&&this.element.find(".lm_content").after(this.element.find(".lm_header"))),this.element.css({left:e,top:t}),this.element.find(".lm_tab").attr("title",a.utils.stripTags(this._contentItem.config.title)),this.element.find(".lm_title").html(this._contentItem.config.title),this.childElementContainer=this.element.find(".lm_content"),this.childElementContainer.append(i.element),this._updateTree(),this._layoutManager._$calculateItemAreas(),this._setDimensions(),o(document.body).append(this.element);var l=this._layoutManager.container.offset();this._minX=l.left,this._minY=l.top,this._maxX=this._layoutManager.container.width()+this._minX,this._maxY=this._layoutManager.container.height()+this._minY,this._width=this.element.width(),this._height=this.element.height(),this._setDropPosition(e,t)},a.controls.DragProxy._template='
',a.utils.copy(a.controls.DragProxy.prototype,{_onDrag:function(e,t,n){var r=(n=n.originalEvent&&n.originalEvent.touches?n.originalEvent.touches[0]:n).pageX,i=n.pageY;(r>this._minX&&rthis._minY&&i
',a.utils.copy(a.controls.DropTargetIndicator.prototype,{destroy:function(){this.element.remove()},highlight:function(e,t,n,r){this.highlightArea({x1:e,y1:t,x2:n,y2:r})},highlightArea:function(e){this.element.css({left:e.x1,top:e.y1,width:e.x2-e.x1,height:e.y2-e.y1}).show()},hide:function(){this.element.hide()}}),a.controls.Header=function(e,t){a.utils.EventEmitter.call(this),this.layoutManager=e,this.element=o(a.controls.Header._template),!0===this.layoutManager.config.settings.selectionEnabled&&(this.element.addClass("lm_selectable"),this.element.on("click touchstart",a.utils.fnBind(this._onHeaderClick,this))),this.tabsContainer=this.element.find(".lm_tabs"),this.tabDropdownContainer=this.element.find(".lm_tabdropdown_list"),this.tabDropdownContainer.hide(),this.controlsContainer=this.element.find(".lm_controls"),this.parent=t,this.parent.on("resize",this._updateTabSizes,this),this.tabs=[],this.activeContentItem=null,this.closeButton=null,this.tabDropdownButton=null,this.hideAdditionalTabsDropdown=a.utils.fnBind(this._hideAdditionalTabsDropdown,this),o(document).mouseup(this.hideAdditionalTabsDropdown),this._lastVisibleTabIndex=-1,this._tabControlOffset=this.layoutManager.config.settings.tabControlOffset,this._createControls()},a.controls.Header._template=['
','
    ','
      ','
        ',"
        "].join(""),a.utils.copy(a.controls.Header.prototype,{createTab:function(e,t){var n,r;for(r=0;r0?this.tabs[t-1].element.after(n.element):this.tabs[0].element.before(n.element),this.tabs.splice(t,0,n),this._updateTabSizes()},removeTab:function(e){for(var t=0;tthis._lastVisibleTabIndex){for(i=this.tabs[this.parent.config.activeItemIndex],n=this.parent.config.activeItemIndex;n>0;n--)this.tabs[n]=this.tabs[n-1];this.tabs[0]=i,this.parent.config.activeItemIndex=0}this._updateTabSizes(),this.parent.emitBubblingEvent("stateChanged")},position:function(e){var t=this.parent._header.show;return t&&!this.parent._side&&(t="top"),void 0!==e&&this.parent._header.show!=e&&(this.parent._header.show=e,this.parent._setupHeaderPosition()),t},_$setClosable:function(e){return!(!this.closeButton||!this._isClosable()||(this.closeButton.element[e?"show":"hide"](),0))},_$destroy:function(){this.emit("destroy",this);for(var e=0;ea){if(d)r===h&&(n.css({"z-index":"auto","margin-left":""}),this.tabsContainer.append(n));else if((u=h>0&&h<=r?(l-a)/(r-1):(l-a)/r)'),this._header.on("destroy",this._$destroy,this),this._action=r,this.element.on("click touchstart",this._action),this._header.controlsContainer.append(this.element)},a.utils.copy(a.controls.HeaderButton.prototype,{_$destroy:function(){this.element.off(),this.element.remove()}}),a.controls.Splitter=function(e,t,n){this._isVertical=e,this._size=t,this._grabSize=n'),t=o('
        ');t.append(e);var n=this._grabSize-this._size,r=n/2;return this._isVertical?(e.css("top",-r),e.css("height",this._size+n),t.addClass("lm_vertical"),t.height(this._size)):(e.css("left",-r),e.css("width",this._size+n),t.addClass("lm_horizontal"),t.width(this._size)),t}}),a.controls.Tab=function(e,t){this.header=e,this.contentItem=t,this.element=o(a.controls.Tab._template),this.titleElement=this.element.find(".lm_title"),this.closeElement=this.element.find(".lm_close_tab"),this.closeElement[t.config.isClosable?"show":"hide"](),this.isActive=!1,this.setTitle(t.config.title),this.contentItem.on("titleChanged",this.setTitle,this),this._layoutManager=this.contentItem.layoutManager,!0===this._layoutManager.config.settings.reorderEnabled&&!0===t.config.reorderEnabled&&(this._dragListener=new a.utils.DragListener(this.element),this._dragListener.on("dragStart",this._onDragStart,this),this.contentItem.on("destroy",this._dragListener.destroy,this._dragListener)),this._onTabClickFn=a.utils.fnBind(this._onTabClick,this),this._onCloseClickFn=a.utils.fnBind(this._onCloseClick,this),this.element.on("mousedown touchstart",this._onTabClickFn),this.contentItem.config.isClosable?(this.closeElement.on("click touchstart",this._onCloseClickFn),this.closeElement.on("mousedown",this._onCloseMousedown)):this.closeElement.remove(),this.contentItem.tab=this,this.contentItem.emit("tab",this),this.contentItem.layoutManager.emit("tabCreated",this),this.contentItem.isComponent&&(this.contentItem.container.tab=this,this.contentItem.container.emit("tab",this))},a.controls.Tab._template='
      • ',a.utils.copy(a.controls.Tab.prototype,{setTitle:function(e){this.element.attr("title",a.utils.stripTags(e)),this.titleElement.html(e)},setActive:function(e){e!==this.isActive&&(this.isActive=e,e?this.element.addClass("lm_active"):this.element.removeClass("lm_active"))},_$destroy:function(){this.element.off("mousedown touchstart",this._onTabClickFn),this.closeElement.off("click touchstart",this._onCloseClickFn),this._dragListener&&(this.contentItem.off("destroy",this._dragListener.destroy,this._dragListener),this._dragListener.off("dragStart",this._onDragStart),this._dragListener=null),this.element.remove()},_onDragStart:function(e,t){!0===this.contentItem.parent.isMaximised&&this.contentItem.parent.toggleMaximise(),new a.controls.DragProxy(e,t,this._dragListener,this._layoutManager,this.contentItem,this.header.parent)},_onTabClick:function(e){if(0===e.button||"touchstart"===e.type){var t=this.header.parent.getActiveContentItem();this.contentItem!==t&&this.header.parent.setActiveContentItem(this.contentItem)}else 1===e.button&&this.contentItem.config.isClosable&&this._onCloseClick(e)},_onCloseClick:function(e){e.stopPropagation(),this.header.parent.removeChild(this.contentItem)},_onCloseMousedown:function(e){e.stopPropagation()}}),a.controls.TransitionIndicator=function(){this._element=o('
        '),o(document.body).append(this._element),this._toElement=null,this._fromDimensions=null,this._totalAnimationDuration=200,this._animationStartTime=null},a.utils.copy(a.controls.TransitionIndicator.prototype,{destroy:function(){this._element.remove()},transitionElements:function(e,t){},_nextAnimationFrame:function(){var e,t=this._measure(this._toElement),n=(a.utils.now()-this._animationStartTime)/this._totalAnimationDuration,r={};if(n>=1)this._element.hide();else{for(e in t.opacity=0,this._fromDimensions)r[e]=this._fromDimensions[e]+(t[e]-this._fromDimensions[e])*n;this._element.css(r),a.utils.animFrame(a.utils.fnBind(this._nextAnimationFrame,this))}},_measure:function(e){var t=e.offset();return{left:t.left,top:t.top,width:e.outerWidth(),height:e.outerHeight()}}}),a.errors.ConfigurationError=function(e,t){Error.call(this),this.name="Configuration Error",this.message=e,this.node=t},a.errors.ConfigurationError.prototype=new Error,a.items.AbstractContentItem=function(e,t,n){a.utils.EventEmitter.call(this),this.config=this._extendItemNode(t),this.type=t.type,this.contentItems=[],this.parent=n,this.isInitialised=!1,this.isMaximised=!1,this.isRoot=!1,this.isRow=!1,this.isColumn=!1,this.isStack=!1,this.isComponent=!1,this.layoutManager=e,this._pendingEventPropagations={},this._throttledEvents=["stateChanged"],this.on(a.utils.EventEmitter.ALL_EVENT,this._propagateEvent,this),t.content&&this._createContentItems(t)},a.utils.copy(a.items.AbstractContentItem.prototype,{setSize:function(){throw new Error("Abstract Method")},callDownwards:function(e,t,n,r){var i;for(!0!==n&&!0!==r&&this[e].apply(this,t||[]),i=0;i0?this.callDownwards("setSize"):this instanceof a.items.Root||!0!==this.config.isClosable||this.parent.removeChild(this)},addChild:function(e,t){void 0===t&&(t=this.contentItems.length),this.contentItems.splice(t,0,e),void 0===this.config.content&&(this.config.content=[]),this.config.content.splice(t,0,e.config),e.parent=this,!0===e.parent.isInitialised&&!1===e.isInitialised&&e._$init()},replaceChild:function(e,t,n){t=this.layoutManager._$normalizeContentItem(t);var r=a.utils.indexOf(e,this.contentItems),i=e.element[0].parentNode;if(-1===r)throw new Error("Can't replace child. oldChild is not child of this");i.replaceChild(t.element[0],e.element[0]),!0===n&&(e.parent=null,e._$destroy()),this.contentItems[r]=t,t.parent=this,this.isStack&&(this.header.tabs[r].contentItem=t),!0===t.parent.isInitialised&&!1===t.isInitialised&&t._$init(),this.callDownwards("setSize")},remove:function(){this.parent.removeChild(this)},popout:function(){var e=this.layoutManager.createPopout(this);return this.emitBubblingEvent("stateChanged"),e},toggleMaximise:function(e){e&&e.preventDefault(),!0===this.isMaximised?this.layoutManager._$minimiseItem(this):this.layoutManager._$maximiseItem(this),this.isMaximised=!this.isMaximised,this.emitBubblingEvent("stateChanged")},select:function(){this.layoutManager.selectedItem!==this&&(this.layoutManager.selectItem(this,!0),this.element.addClass("lm_selected"))},deselect:function(){this.layoutManager.selectedItem===this&&(this.layoutManager.selectedItem=null,this.element.removeClass("lm_selected"))},setTitle:function(e){this.config.title=e,this.emit("titleChanged",e),this.emit("stateChanged")},hasId:function(e){return!!this.config.id&&("string"==typeof this.config.id?this.config.id===e:this.config.id instanceof Array?-1!==a.utils.indexOf(e,this.config.id):void 0)},addId:function(e){this.hasId(e)||(this.config.id?"string"==typeof this.config.id?this.config.id=[this.config.id,e]:this.config.id instanceof Array&&this.config.id.push(e):this.config.id=e)},removeId:function(e){if(!this.hasId(e))throw new Error("Id not found");if("string"==typeof this.config.id)delete this.config.id;else if(this.config.id instanceof Array){var t=a.utils.indexOf(e,this.config.id);this.config.id.splice(t,1)}},getItemsByFilter:function(e){var t=[],n=function(r){for(var i=0;i'),this.childElementContainer=this.element,this._containerElement=n,this._containerElement.append(this.element)},a.utils.extend(a.items.Root,a.items.AbstractContentItem),a.utils.copy(a.items.Root.prototype,{addChild:function(e){if(this.contentItems.length>0)throw new Error("Root node can only have a single child");e=this.layoutManager._$normalizeContentItem(e,this),this.childElementContainer.append(e.element),a.items.AbstractContentItem.prototype.addChild.call(this,e),this.callDownwards("setSize"),this.emitBubblingEvent("stateChanged")},setSize:function(e,t){e=void 0===e?this._containerElement.width():e,t=void 0===t?this._containerElement.height():t,this.element.width(e),this.element.height(t),this.contentItems[0]&&(this.contentItems[0].element.width(e),this.contentItems[0].element.height(t))},_$highlightDropZone:function(e,t,n){this.layoutManager.tabDropPlaceholder.remove(),a.items.AbstractContentItem.prototype._$highlightDropZone.apply(this,arguments)},_$onDrop:function(e,t){var n;if(e.isComponent&&((n=this.layoutManager.createContentItem({type:"stack",header:e.config.header||{}},this))._$init(),n.addChild(e),e=n),this.contentItems.length){var r="x"==t.side[0]?"row":"column",i="x"==t.side[0]?"width":"height",o="2"==t.side[1],s=this.contentItems[0];if(!s instanceof a.items.RowOrColumn||s.type!=r){var l=this.layoutManager.createContentItem({type:r},this);this.replaceChild(s,l),l.addChild(e,o?0:void 0,!0),l.addChild(s,o?void 0:0,!0),s.config[i]=50,e.config[i]=50,l.callDownwards("setSize")}else{var u=s.contentItems[o?0:s.contentItems.length-1];s.addChild(e,o?0:void 0,!0),u.config[i]*=.5,e.config[i]=u.config[i],s.callDownwards("setSize")}}else this.addChild(e)}}),a.items.RowOrColumn=function(e,t,n,r){a.items.AbstractContentItem.call(this,t,n,r),this.isRow=!e,this.isColumn=e,this.element=o('
        '),this.childElementContainer=this.element,this._splitterSize=t.config.dimensions.borderWidth,this._splitterGrabSize=t.config.dimensions.borderGrabWidth,this._isColumn=e,this._dimension=e?"height":"width",this._splitter=[],this._splitterPosition=null,this._splitterMinPosition=null,this._splitterMaxPosition=null},a.utils.extend(a.items.RowOrColumn,a.items.AbstractContentItem),a.utils.copy(a.items.RowOrColumn.prototype,{addChild:function(e,t,n){var r,i,o,s;if(e=this.layoutManager._$normalizeContentItem(e,this),void 0===t&&(t=this.contentItems.length),this.contentItems.length>0?(s=this._createSplitter(Math.max(0,t-1)).element,t>0?(this.contentItems[t-1].element.after(s),s.after(e.element)):(this.contentItems[0].element.before(s),s.before(e.element))):this.childElementContainer.append(e.element),a.items.AbstractContentItem.prototype.addChild.call(this,e,t),r=1/this.contentItems.length*100,!0!==n){for(o=0;o0&&(this._calculateRelativeSizes(),this._setAbsoluteSizes()),this.emitBubblingEvent("stateChanged"),this.emit("resize")},_$init:function(){var e;if(!0!==this.isInitialised)for(a.items.AbstractContentItem.prototype._$init.call(this),e=0;e0&&t.itemSizes[e]++,this._isColumn?(this.contentItems[e].element.width(t.totalWidth),this.contentItems[e].element.height(t.itemSizes[e])):(this.contentItems[e].element.width(t.itemSizes[e]),this.contentItems[e].element.height(t.totalHeight))},_calculateAbsoluteSizes:function(){var e,t,n=(this.contentItems.length-1)*this._splitterSize,r=this.element.width(),i=this.element.height(),o=0,a=[];for(this._isColumn?i-=n:r-=n,e=0;e0){for(e=0;e100)for(e=0;ea)){for(t=s/a,l=s,d=0;dthis._splitterMinPosition&&r'),this._activeContentItem=null;var r=e.config;this._header={show:!0===r.settings.hasHeaders&&!1!==t.hasHeaders,popout:r.settings.showPopoutIcon&&r.labels.popout,maximise:r.settings.showMaximiseIcon&&r.labels.maximise,close:r.settings.showCloseIcon&&r.labels.close,minimise:r.labels.minimise},r.header&&a.utils.copy(this._header,r.header),t.header&&a.utils.copy(this._header,t.header),t.content&&t.content[0]&&t.content[0].header&&a.utils.copy(this._header,t.content[0].header),this._dropZones={},this._dropSegment=null,this._contentAreaDimensions=null,this._dropIndex=null,this.isStack=!0,this.childElementContainer=o('
        '),this.header=new a.controls.Header(e,this),this.element.append(this.header.element),this.element.append(this.childElementContainer),this._setupHeaderPosition(),this._$validateClosability()},a.utils.extend(a.items.Stack,a.items.AbstractContentItem),a.utils.copy(a.items.Stack.prototype,{setSize:function(){var e,t=this._header.show?this.layoutManager.config.dimensions.headerHeight:0,n=this.element.width()-(this._sided?t:0),r=this.element.height()-(this._sided?0:t);for(this.childElementContainer.width(n),this.childElementContainer.height(r),e=0;e0){if(!(t=this.contentItems[this.config.activeItemIndex||0]))throw new Error("Configured activeItemIndex out of bounds");this.setActiveContentItem(t)}}},setActiveContentItem:function(e){if(-1===a.utils.indexOf(e,this.contentItems))throw new Error("contentItem is not a child of this stack");null!==this._activeContentItem&&this._activeContentItem._$hide(),this._activeContentItem=e,this.header.setActiveContentItem(e),e._$show(),this.emit("activeContentItemChanged",e),this.layoutManager.emit("activeContentItemChanged",e),this.emitBubblingEvent("stateChanged")},getActiveContentItem:function(){return this.header.activeContentItem},addChild:function(e,t){e=this.layoutManager._$normalizeContentItem(e,this),a.items.AbstractContentItem.prototype.addChild.call(this,e,t),this.childElementContainer.append(e.element),this.header.createTab(e,t),this.setActiveContentItem(e),this.callDownwards("setSize"),this._$validateClosability(),this.emitBubblingEvent("stateChanged")},removeChild:function(e,t){var n=a.utils.indexOf(e,this.contentItems);a.items.AbstractContentItem.prototype.removeChild.call(this,e,t),this.header.removeTab(e),this.header.activeContentItem===e&&(this.contentItems.length>0?this.setActiveContentItem(this.contentItems[Math.max(n-1,0)]):this._activeContentItem=null),this._$validateClosability(),this.emitBubblingEvent("stateChanged")},_$validateClosability:function(){var e,t,n;for(e=this.header._isClosable(),n=0,t=this.contentItems.length;ne&&r.y1t)return void("header"===n?(this._dropSegment="header",this._highlightHeaderDropZone(this._sided?t:e)):(this._resetHeaderDropZone(),this._highlightBodyDropZone(n)))},_$getArea:function(){if(!1===this.element.is(":visible"))return null;var e=a.items.AbstractContentItem.prototype._$getArea,t=e.call(this,this.header.element),n=e.call(this,this.childElementContainer),r=n.x2-n.x1,i=n.y2-n.y1;return this._contentAreaDimensions={header:{hoverArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2},highlightArea:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}}},this._activeContentItem&&!1===this._activeContentItem.isComponent?t:0===this.contentItems.length?(this._contentAreaDimensions.body={hoverArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2}},e.call(this,this.element)):(this._contentAreaDimensions.left={hoverArea:{x1:n.x1,y1:n.y1,x2:n.x1+.25*r,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x1+.5*r,y2:n.y2}},this._contentAreaDimensions.top={hoverArea:{x1:n.x1+.25*r,y1:n.y1,x2:n.x1+.75*r,y2:n.y1+.5*i},highlightArea:{x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y1+.5*i}},this._contentAreaDimensions.right={hoverArea:{x1:n.x1+.75*r,y1:n.y1,x2:n.x2,y2:n.y2},highlightArea:{x1:n.x1+.5*r,y1:n.y1,x2:n.x2,y2:n.y2}},this._contentAreaDimensions.bottom={hoverArea:{x1:n.x1+.25*r,y1:n.y1+.5*i,x2:n.x1+.75*r,y2:n.y2},highlightArea:{x1:n.x1,y1:n.y1+.5*i,x2:n.x2,y2:n.y2}},e.call(this,this.element))},_highlightHeaderDropZone:function(e){var t,n,r,i,o,a,s,l,u=this.header.tabs.length,c=!1;if(0===u)return s=this.header.element.offset(),void this.layoutManager.dropTargetIndicator.highlightArea({x1:s.left,x2:s.left+100,y1:s.top+this.header.element.height()-20,y2:s.top+this.header.element.height()});for(t=0;ti&&e=0&&this._header.show;if(this.header.element.toggle(!!this._header.show),this._side=e,this._sided=["right","left"].indexOf(this._side)>=0,this.element.removeClass("lm_left lm_right lm_bottom"),this._side&&this.element.addClass("lm_"+this._side),this.element.find(".lm_header").length&&this.childElementContainer){var t=["right","bottom"].indexOf(this._side)>=0?"before":"after";this.header.element[t](this.childElementContainer),this.callDownwards("setSize")}},_highlightBodyDropZone:function(e){var t=this._contentAreaDimensions[e].highlightArea;this.layoutManager.dropTargetIndicator.highlightArea(t),this._dropSegment=e}}),a.utils.BubblingEvent=function(e,t){this.name=e,this.origin=t,this.isPropagationStopped=!1},a.utils.BubblingEvent.prototype.stopPropagation=function(){this.isPropagationStopped=!0},a.utils.ConfigMinifier=function(){if(this._keys=["settings","hasHeaders","constrainDragToContainer","selectionEnabled","dimensions","borderWidth","minItemHeight","minItemWidth","headerHeight","dragProxyWidth","dragProxyHeight","labels","close","maximise","minimise","popout","content","componentName","componentState","id","width","type","height","isClosable","title","popoutWholeStack","openPopouts","parentId","activeItemIndex","reorderEnabled","borderGrabWidth"],this._keys.length>36)throw new Error("Too many keys in config minifier map");this._values=[!0,!1,"row","column","stack","component","close","maximise","minimise","open in new window"]},a.utils.copy(a.utils.ConfigMinifier.prototype,{minifyConfig:function(e){var t={};return this._nextLevel(e,t,"_min"),t},unminifyConfig:function(e){var t={};return this._nextLevel(e,t,"_max"),t},_nextLevel:function(e,t,n){var r,i;for(r in e)e instanceof Array&&(r=parseInt(r,10)),e.hasOwnProperty(r)&&(i=this[n](r,this._keys),"object"==typeof e[r]?(t[i]=e[r]instanceof Array?[]:{},this._nextLevel(e[r],t[i],n)):t[i]=this[n](e[r],this._values))},_min:function(e,t){if("string"==typeof e&&1===e.length)return"___"+e;var n=a.utils.indexOf(e,t);return-1===n?e:n.toString(36)},_max:function(e,t){return"string"==typeof e&&1===e.length?t[parseInt(e,36)]:"string"==typeof e&&"___"===e.substr(0,3)?e[3]:e}}),a.utils.EventHub=function(e){a.utils.EventEmitter.call(this),this._layoutManager=e,this._dontPropagateToParent=null,this._childEventSource=null,this.on(a.utils.EventEmitter.ALL_EVENT,a.utils.fnBind(this._onEventFromThis,this)),this._boundOnEventFromChild=a.utils.fnBind(this._onEventFromChild,this),o(window).on("gl_child_event",this._boundOnEventFromChild)},a.utils.EventHub.prototype._onEventFromThis=function(){var e=Array.prototype.slice.call(arguments);this._layoutManager.isSubWindow&&e[0]!==this._dontPropagateToParent&&this._propagateToParent(e),this._propagateToChildren(e),this._dontPropagateToParent=null,this._childEventSource=null},a.utils.EventHub.prototype._$onEventFromParent=function(e){this._dontPropagateToParent=e[0],this.emit.apply(this,e)},a.utils.EventHub.prototype._onEventFromChild=function(e){this._childEventSource=e.originalEvent.__gl,this.emit.apply(this,e.originalEvent.__glArgs)},a.utils.EventHub.prototype._propagateToParent=function(e){var t,n="gl_child_event";document.createEvent?(t=window.opener.document.createEvent("HTMLEvents")).initEvent(n,!0,!0):(t=window.opener.document.createEventObject()).eventType=n,t.eventName=n,t.__glArgs=e,t.__gl=this._layoutManager,document.createEvent?window.opener.dispatchEvent(t):window.opener.fireEvent("on"+t.eventType,t)},a.utils.EventHub.prototype._propagateToChildren=function(e){var t,n;for(n=0;n{"use strict";var r=n(9864),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},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var u=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 a=c(n);d&&(a=a.concat(d(n)));for(var s=l(t),m=l(n),g=0;g{"use strict";n.d(t,{Z:()=>i});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};const i="object"===("undefined"==typeof window?"undefined":r(window))&&"object"===("undefined"==typeof document?"undefined":r(document))&&9===document.nodeType},4070:function(e,t){var n;!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,(function(r,i){"use strict";var o=[],a=Object.getPrototypeOf,s=o.slice,l=o.flat?function(e){return o.flat.call(e)}:function(e){return o.concat.apply([],e)},u=o.push,c=o.indexOf,d={},h=d.toString,f=d.hasOwnProperty,p=f.toString,m=p.call(Object),g={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},y=function(e){return null!=e&&e===e.window},b=r.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function E(e,t,n){var r,i,o=(n=n||b).createElement("script");if(o.text=e,t)for(r in w)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function _(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[h.call(e)]||"object":typeof e}var C="3.5.1 -ajax,-ajax/jsonp,-ajax/load,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-deprecated/ajax-event-alias,-effects,-effects/Tween,-effects/animatedSelector",S=function(e,t){return new S.fn.init(e,t)};function x(e){var t=!!e&&"length"in e&&e.length,n=_(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}S.fn=S.prototype={jquery:C,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),$=new RegExp(j+"|>"),q=new RegExp(B),H=new RegExp("^"+F+"$"),K={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},G=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,X=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){h()},ae=we((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{D.apply(P=R.call(E.childNodes),E.childNodes),P[E.childNodes.length].nodeType}catch(e){D={apply:P.length?function(e,t){A.apply(e,R.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(e,t,r,i){var o,s,u,c,d,p,v,y=t&&t.ownerDocument,E=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==E&&9!==E&&11!==E)return r;if(!i&&(h(t),t=t||f,m)){if(11!==E&&(d=J.exec(e)))if(o=d[1]){if(9===E){if(!(u=t.getElementById(o)))return r;if(u.id===o)return r.push(u),r}else if(y&&(u=y.getElementById(o))&&b(t,u)&&u.id===o)return r.push(u),r}else{if(d[2])return D.apply(r,t.getElementsByTagName(e)),r;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return D.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!I[e+" "]&&(!g||!g.test(e))&&(1!==E||"object"!==t.nodeName.toLowerCase())){if(v=e,y=t,1===E&&($.test(e)||Z.test(e))){for((y=ee.test(e)&&ve(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,ie):t.setAttribute("id",c=w)),s=(p=a(e)).length;s--;)p[s]=(c?"#"+c:":scope")+" "+be(p[s]);v=p.join(",")}try{return D.apply(r,y.querySelectorAll(v)),r}catch(t){I(e,!0)}finally{c===w&&t.removeAttribute("id")}}}return l(e.replace(U,"$1"),t,r,i)}function le(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function ue(e){return e[w]=!0,e}function ce(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function he(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return ue((function(t){return t=+t,ue((function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},o=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!G.test(t||n&&n.nodeName||"HTML")},h=se.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:E;return a!=f&&9===a.nodeType&&a.documentElement?(p=(f=a).documentElement,m=!o(f),E!=f&&(i=f.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce((function(e){return p.appendChild(e).appendChild(f.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=ce((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ce((function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=X.test(f.getElementsByClassName),n.getById=ce((function(e){return p.appendChild(e).id=w,!f.getElementsByName||!f.getElementsByName(w).length})),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},v=[],g=[],(n.qsa=X.test(f.querySelectorAll))&&(ce((function(e){var t;p.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+L+")"),e.querySelectorAll("[id~="+w+"-]").length||g.push("~="),(t=f.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\[[\\x20\\t\\r\\n\\f]*name[\\x20\\t\\r\\n\\f]*=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+w+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ce((function(e){e.innerHTML="";var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),p.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=X.test(y=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ce((function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),v.push("!=",B)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=X.test(p.compareDocumentPosition),b=t||X.test(p.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},k=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==f||e.ownerDocument==E&&b(E,e)?-1:t==f||t.ownerDocument==E&&b(E,t)?1:c?M(c,e)-M(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==f?-1:t==f?1:i?-1:o?1:c?M(c,e)-M(c,t):0;if(i===o)return he(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?he(a[r],s[r]):a[r]==E?-1:s[r]==E?1:0},f):f},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(h(e),n.matchesSelector&&m&&!I[t+" "]&&(!v||!v.test(t))&&(!g||!g.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){I(t,!0)}return se(t,f,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!=f&&h(e),b(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=f&&h(e);var i=r.attrHandle[t.toLowerCase()],o=i&&O.call(r.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,r=[],i=0,o=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(k),d){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=se.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=se.selectors={cacheLength:50,createPseudo:ue,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return K.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&q.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=S[e+" "];return t||(t=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+e+"("+j+"|$)"))&&S(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=se.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(z," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,d,h,f,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s,b=!1;if(g){if(o){for(;m;){for(h=t;h=h[m];)if(s?h.nodeName.toLowerCase()===v:1===h.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(b=(f=(u=(c=(d=(h=g)[w]||(h[w]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]||[])[0]===_&&u[1])&&u[2],h=f&&g.childNodes[f];h=++f&&h&&h[m]||(b=f=0)||p.pop();)if(1===h.nodeType&&++b&&h===t){c[e]=[_,f,b];break}}else if(y&&(b=f=(u=(c=(d=(h=t)[w]||(h[w]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]||[])[0]===_&&u[1]),!1===b)for(;(h=++f&&h&&h[m]||(b=f=0)||p.pop())&&((s?h.nodeName.toLowerCase()!==v:1!==h.nodeType)||!++b||(y&&((c=(d=h[w]||(h[w]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]=[_,b]),h!==t)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return i[w]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ue((function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=M(e,o[a])]=!(n[r]=o[a])})):function(e){return i(e,0,n)}):i}},pseudos:{not:ue((function(e){var t=[],n=[],r=s(e.replace(U,"$1"));return r[w]?ue((function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:ue((function(e){return function(t){return se(e,t).length>0}})),contains:ue((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}})),lang:ue((function(e){return H.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge((function(){return[0]})),last:ge((function(e,t){return[t-1]})),eq:ge((function(e,t,n){return[n<0?n+t:n]})),even:ge((function(e,t){for(var n=0;nt?t:n;--r>=0;)e.push(r);return e})),gt:ge((function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function _e(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,u=null!=t;s-1&&(o[u]=!(a[u]=d))}}else v=_e(v===a?v.splice(p,v.length):v),i?i(null,a,v,l):D.apply(a,v)}))}function Se(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],l=a?1:0,c=we((function(e){return e===t}),s,!0),d=we((function(e){return M(t,e)>-1}),s,!0),h=[function(e,n,r){var i=!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):d(e,n,r));return t=null,i}];l1&&Ee(h),l>1&&be(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(U,"$1"),n,l0,i=e.length>0,o=function(o,a,s,l,c){var d,p,g,v=0,y="0",b=o&&[],w=[],E=u,C=o||i&&r.find.TAG("*",c),S=_+=null==E?1:Math.random()||.1,x=C.length;for(c&&(u=a==f||a||c);y!==x&&null!=(d=C[y]);y++){if(i&&d){for(p=0,a||d.ownerDocument==f||(h(d),s=!m);g=e[p++];)if(g(d,a||f,s)){l.push(d);break}c&&(_=S)}n&&((d=!g&&d)&&v--,o&&b.push(d))}if(v+=y,n&&y!==v){for(p=0;g=t[p++];)g(b,w,a,s);if(o){if(v>0)for(;y--;)b[y]||w[y]||(w[y]=N.call(l));w=_e(w)}D.apply(l,w),c&&!o&&w.length>0&&v+t.length>1&&se.uniqueSort(l)}return c&&(_=S,u=E),b};return n?ue(o):o}(o,i))).selector=e}return s},l=se.select=function(e,t,n,i){var o,l,u,c,d,h="function"==typeof e&&e,f=!i&&a(e=h.selector||e);if(n=n||[],1===f.length){if((l=f[0]=f[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===t.nodeType&&m&&r.relative[l[1].type]){if(!(t=(r.find.ID(u.matches[0].replace(te,ne),t)||[])[0]))return n;h&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(o=K.needsContext.test(e)?0:l.length;o--&&(u=l[o],!r.relative[c=u.type]);)if((d=r.find[c])&&(i=d(u.matches[0].replace(te,ne),ee.test(l[0].type)&&ve(t.parentNode)||t))){if(l.splice(o,1),!(e=i.length&&be(l)))return D.apply(n,i),n;break}}return(h||s(e,f))(i,t,!m,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},n.sortStable=w.split("").sort(k).join("")===w,n.detectDuplicates=!!d,h(),n.sortDetached=ce((function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))})),ce((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||de("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ce((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||de("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ce((function(e){return null==e.getAttribute("disabled")}))||de(L,(function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),se}(r);S.find=T,S.expr=T.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=T.uniqueSort,S.text=T.getText,S.isXMLDoc=T.isXML,S.contains=T.contains,S.escapeSelector=T.escape;var I=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},k=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},O=S.expr.match.needsContext;function P(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(e,t,n){return v(t)?S.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?S.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?S.grep(e,(function(e){return c.call(t,e)>-1!==n})):S.filter(t,e,n)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,(function(e){return 1===e.nodeType})))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter((function(){for(t=0;t1?S.uniqueSort(n):n},filter:function(e){return this.pushStack(A(this,e||[],!1))},not:function(e){return this.pushStack(A(this,e||[],!0))},is:function(e){return!!A(this,"string"==typeof e&&O.test(e)?S(e):e||[],!1).length}});var D,R=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:R.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:b,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=b.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(b);var M=/^(?:parents|prev(?:Until|All))/,L={children:!0,contents:!0,next:!0,prev:!0};function j(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter((function(){for(var e=0;e-1:1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?c.call(S(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return I(e,"parentNode")},parentsUntil:function(e,t,n){return I(e,"parentNode",n)},next:function(e){return j(e,"nextSibling")},prev:function(e){return j(e,"previousSibling")},nextAll:function(e){return I(e,"nextSibling")},prevAll:function(e){return I(e,"previousSibling")},nextUntil:function(e,t,n){return I(e,"nextSibling",n)},prevUntil:function(e,t,n){return I(e,"previousSibling",n)},siblings:function(e){return k((e.parentNode||{}).firstChild,e)},children:function(e){return k(e.firstChild)},contents:function(e){return null!=e.contentDocument&&a(e.contentDocument)?e.contentDocument:(P(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},(function(e,t){S.fn[e]=function(n,r){var i=S.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=S.filter(r,i)),this.length>1&&(L[e]||S.uniqueSort(i),M.test(e)&&i.reverse()),this.pushStack(i)}}));var F=/[^\x20\t\r\n\f]+/g;function W(e){return e}function B(e){throw e}function z(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return S.each(e.match(F)||[],(function(e,n){t[n]=!0})),t}(e):S.extend({},e);var t,n,r,i,o=[],a=[],s=-1,l=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--})),this},has:function(e){return e?S.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},S.extend({Deferred:function(e){var t=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return S.Deferred((function(n){S.each(t,(function(t,r){var i=v(e[r[4]])&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&v(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(e,n,i){var o=0;function a(e,t,n,i){return function(){var s=this,l=arguments,u=function(){var r,u;if(!(e=o&&(n!==B&&(s=void 0,l=[r]),t.rejectWith(s,l))}};e?c():(S.Deferred.getStackHook&&(c.stackTrace=S.Deferred.getStackHook()),r.setTimeout(c))}}return S.Deferred((function(r){t[0][3].add(a(0,r,v(i)?i:W,r.notifyWith)),t[1][3].add(a(0,r,v(e)?e:W)),t[2][3].add(a(0,r,v(n)?n:B))})).promise()},promise:function(e){return null!=e?S.extend(e,i):i}},o={};return S.each(t,(function(e,r){var a=r[2],s=r[5];i[r[1]]=a.add,s&&a.add((function(){n=s}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(r[3].fire),o[r[0]]=function(){return o[r[0]+"With"](this===o?void 0:this,arguments),this},o[r[0]+"With"]=a.fireWith})),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=s.call(arguments),o=S.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?s.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(z(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||v(i[n]&&i[n].then)))return o.then();for(;n--;)z(i[n],a(n),o.reject);return o.promise()}});var U=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){r.console&&r.console.warn&&e&&U.test(e.name)&&r.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){r.setTimeout((function(){throw e}))};var V=S.Deferred();function Z(){b.removeEventListener("DOMContentLoaded",Z),r.removeEventListener("load",Z),S.ready()}S.fn.ready=function(e){return V.then(e).catch((function(e){S.readyException(e)})),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==e&&--S.readyWait>0||V.resolveWith(b,[S]))}}),S.ready.then=V.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?r.setTimeout(S.ready):(b.addEventListener("DOMContentLoaded",Z),r.addEventListener("load",Z));var $=function(e,t,n,r,i,o,a){var s=0,l=e.length,u=null==n;if("object"===_(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(S(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each((function(){J.remove(this,e)}))}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=X.get(e,t),n&&(!r||Array.isArray(n)?r=X.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){S.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return X.get(e,n)||X.access(e,n,{empty:S.Callbacks("once memory").add((function(){X.remove(e,[t+"queue",n])}))})}}),S.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,ve=/^$|^module$|\/(?:java|ecma)script/i;fe=b.createDocumentFragment().appendChild(b.createElement("div")),(pe=b.createElement("input")).setAttribute("type","radio"),pe.setAttribute("checked","checked"),pe.setAttribute("name","t"),fe.appendChild(pe),g.checkClone=fe.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.innerHTML="",g.noCloneChecked=!!fe.cloneNode(!0).lastChild.defaultValue,fe.innerHTML="",g.option=!!fe.lastChild;var ye={thead:[1,"","
        "],col:[2,"","
        "],tr:[2,"","
        "],td:[3,"","
        "],_default:[0,"",""]};function be(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&P(e,t)?S.merge([e],n):n}function we(e,t){for(var n=0,r=e.length;n",""]);var Ee=/<|&#?\w+;/;function _e(e,t,n,r,i){for(var o,a,s,l,u,c,d=t.createDocumentFragment(),h=[],f=0,p=e.length;f-1)i&&i.push(o);else if(u=se(o),a=be(d.appendChild(o),"script"),u&&we(a),n)for(c=0;o=a[c++];)ve.test(o.type||"")&&n.push(o);return d}var Ce=/^key/,Se=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,xe=/^([^.]*)(?:\.(.+)|)/;function Te(){return!0}function Ie(){return!1}function ke(e,t){return e===function(){try{return b.activeElement}catch(e){}}()==("focus"===t)}function Oe(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Oe(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ie;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each((function(){S.event.add(this,t,i,r,n)}))}function Pe(e,t,n){n?(X.set(e,t,!1),S.event.add(e,t,{namespace:!1,handler:function(e){var r,i,o=X.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(S.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=s.call(arguments),X.set(this,t,o),r=n(this,t),this[t](),o!==(i=X.get(this,t))||r?X.set(this,t,!1):i={},o!==i)return e.stopImmediatePropagation(),e.preventDefault(),i.value}else o.length&&(X.set(this,t,{value:S.event.trigger(S.extend(o[0],S.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===X.get(e,t)&&S.event.add(e,t,Te)}S.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,d,h,f,p,m,g=X.get(e);if(Q(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(ae,i),n.guid||(n.guid=S.guid++),(l=g.events)||(l=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(F)||[""]).length;u--;)f=m=(s=xe.exec(t[u])||[])[1],p=(s[2]||"").split(".").sort(),f&&(d=S.event.special[f]||{},f=(i?d.delegateType:d.bindType)||f,d=S.event.special[f]||{},c=S.extend({type:f,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:p.join(".")},o),(h=l[f])||((h=l[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,p,a)||e.addEventListener&&e.addEventListener(f,a)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,c):h.push(c),S.event.global[f]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,u,c,d,h,f,p,m,g=X.hasData(e)&&X.get(e);if(g&&(l=g.events)){for(u=(t=(t||"").match(F)||[""]).length;u--;)if(f=m=(s=xe.exec(t[u])||[])[1],p=(s[2]||"").split(".").sort(),f){for(d=S.event.special[f]||{},h=l[f=(r?d.delegateType:d.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=h.length;o--;)c=h[o],!i&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(h.splice(o,1),c.selector&&h.delegateCount--,d.remove&&d.remove.call(e,c));a&&!h.length&&(d.teardown&&!1!==d.teardown.call(e,p,g.handle)||S.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)S.event.remove(e,f+t[u],n,r,!0);S.isEmptyObject(l)&&X.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),l=S.event.fix(e),u=(X.get(this,"events")||Object.create(null))[l.type]||[],c=S.event.special[l.type]||{};for(s[0]=l,t=1;t=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(o=[],a={},n=0;n-1:S.find(i,this,null,[u]).length),a[i]&&o.push(r);o.length&&s.push({elem:u,handlers:o})}return u=this,l\s*$/g;function Re(e,t){return P(e,"table")&&P(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Me(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Le(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function je(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(X.hasData(e)&&(s=X.get(e).events))for(i in X.remove(t,"handle events"),s)for(n=0,r=s[i].length;n1&&"string"==typeof p&&!g.checkClone&&Ae.test(p))return e.each((function(i){var o=e.eq(i);m&&(t[0]=p.call(this,i,o.html())),We(o,t,n,r)}));if(h&&(o=(i=_e(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=(a=S.map(be(i,"script"),Me)).length;d0&&we(a,!l&&be(e,"script")),s},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(Q(n)){if(t=n[X.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[X.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Be(this,e,!0)},remove:function(e){return Be(this,e)},text:function(e){return $(this,(function(e){return void 0===e?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return We(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Re(this,e).appendChild(e)}))},prepend:function(){return We(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Re(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return We(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return We(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(be(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return S.clone(this,e,t)}))},html:function(e){return $(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!ye[(ge.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n3,ae.removeChild(e)),s}}))}();var He=["Webkit","Moz","ms"],Ke=b.createElement("div").style,Ge={};function Qe(e){return S.cssProps[e]||Ge[e]||(e in Ke?e:Ge[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=He.length;n--;)if((e=He[n]+t)in Ke)return e}(e)||e)}var Ye=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Je={position:"absolute",visibility:"hidden",display:"block"},et={letterSpacing:"0",fontWeight:"400"};function tt(e,t,n){var r=ie.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function nt(e,t,n,r,i,o){var a="width"===t?1:0,s=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=S.css(e,n+oe[a],!0,i)),r?("content"===n&&(l-=S.css(e,"padding"+oe[a],!0,i)),"margin"!==n&&(l-=S.css(e,"border"+oe[a]+"Width",!0,i))):(l+=S.css(e,"padding"+oe[a],!0,i),"padding"!==n?l+=S.css(e,"border"+oe[a]+"Width",!0,i):s+=S.css(e,"border"+oe[a]+"Width",!0,i));return!r&&o>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))||0),l}function rt(e,t,n){var r=Ue(e),i=(!g.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=$e(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(ze.test(a)){if(!n)return a;a="auto"}return(!g.boxSizingReliable()&&i||!g.reliableTrDimensions()&&P(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+nt(e,t,n||(i?"border":"content"),o,r,a)+"px"}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=$e(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),l=Xe.test(t),u=e.style;if(l||(t=Qe(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=function(e,t,n,r){var i,o,a=20,s=function(){return S.css(e,t,"")},l=s(),u=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==u&&+l)&&ie.exec(S.css(e,t));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;a--;)S.style(e,t,c+u),(1-o)*(1-(o=s()/l||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+u),n=n||[]}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2]),i}(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),g.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var i,o,a,s=G(t);return Xe.test(t)||(t=Qe(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=$e(e,t,r)),"normal"===i&&t in et&&(i=et[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],(function(e,t){S.cssHooks[t]={get:function(e,n,r){if(n)return!Ye.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?rt(e,t,r):Ve(e,Je,(function(){return rt(e,t,r)}))},set:function(e,n,r){var i,o=Ue(e),a=!g.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===S.css(e,"boxSizing",!1,o),l=r?nt(e,t,r,s,o):0;return s&&a&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-nt(e,t,"border",!1,o)-.5)),l&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=S.css(e,t)),tt(0,n,l)}}})),S.cssHooks.marginLeft=qe(g.reliableMarginLeft,(function(e,t){if(t)return(parseFloat($e(e,"marginLeft"))||e.getBoundingClientRect().left-Ve(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(e,t){S.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(S.cssHooks[e+t].set=tt)})),S.fn.extend({css:function(e,t){return $(this,(function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ue(e),i=t.length;a1)}}),S.fn.delay=function(e,t){return e=S.fx&&S.fx.speeds[e]||e,t=t||"fx",this.queue(t,(function(t,n){var i=r.setTimeout(t,e);n.stop=function(){r.clearTimeout(i)}}))},function(){var e=b.createElement("input"),t=b.createElement("select").appendChild(b.createElement("option"));e.type="checkbox",g.checkOn=""!==e.value,g.optSelected=t.selected,(e=b.createElement("input")).value="t",e.type="radio",g.radioValue="t"===e.value}();var it,ot=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){S.removeAttr(this,e)}))}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?it:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&P(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(F);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),it={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=ot[t]||S.find.attr;ot[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ot[a],ot[a]=i,i=null!=n(e,t,r)?a:null,ot[a]=o),i}}));var at=/^(?:input|select|textarea|button)$/i,st=/^(?:a|area)$/i;function lt(e){return(e.match(F)||[]).join(" ")}function ut(e){return e.getAttribute&&e.getAttribute("class")||""}function ct(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(F)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[S.propFix[e]||e]}))}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):at.test(e.nodeName)||st.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,l=0;if(v(e))return this.each((function(t){S(this).addClass(e.call(this,t,ut(this)))}));if((t=ct(e)).length)for(;n=this[l++];)if(i=ut(n),r=1===n.nodeType&&" "+lt(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=lt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,l=0;if(v(e))return this.each((function(t){S(this).removeClass(e.call(this,t,ut(this)))}));if(!arguments.length)return this.attr("class","");if((t=ct(e)).length)for(;n=this[l++];)if(i=ut(n),r=1===n.nodeType&&" "+lt(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=lt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):v(e)?this.each((function(n){S(this).toggleClass(e.call(this,n,ut(this),t),t)})):this.each((function(){var t,i,o,a;if(r)for(i=0,o=S(this),a=ct(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=ut(this))&&X.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":X.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+lt(ut(n))+" ").indexOf(t)>-1)return!0;return!1}});var dt=/\r/g;S.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=v(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,S(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=S.map(i,(function(e){return null==e?"":e+""}))),(t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=S.valHooks[i.type]||S.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(dt,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:lt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?o+1:i.length;for(r=o<0?l:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=S.inArray(S(e).val(),t)>-1}},g.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),g.focusin="onfocusin"in r;var ht=/^(?:focusinfocus|focusoutblur)$/,ft=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,i){var o,a,s,l,u,c,d,h,p=[n||b],m=f.call(e,"type")?e.type:e,g=f.call(e,"namespace")?e.namespace.split("."):[];if(a=h=s=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!ht.test(m+S.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),u=m.indexOf(":")<0&&"on"+m,(e=e[S.expando]?e:new S.Event(m,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),d=S.event.special[m]||{},i||!d.trigger||!1!==d.trigger.apply(n,t))){if(!i&&!d.noBubble&&!y(n)){for(l=d.delegateType||m,ht.test(l+m)||(a=a.parentNode);a;a=a.parentNode)p.push(a),s=a;s===(n.ownerDocument||b)&&p.push(s.defaultView||s.parentWindow||r)}for(o=0;(a=p[o++])&&!e.isPropagationStopped();)h=a,e.type=o>1?l:d.bindType||m,(c=(X.get(a,"events")||Object.create(null))[e.type]&&X.get(a,"handle"))&&c.apply(a,t),(c=u&&a[u])&&c.apply&&Q(a)&&(e.result=c.apply(a,t),!1===e.result&&e.preventDefault());return e.type=m,i||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),t)||!Q(n)||u&&v(n[m])&&!y(n)&&((s=n[u])&&(n[u]=null),S.event.triggered=m,e.isPropagationStopped()&&h.addEventListener(m,ft),n[m](),e.isPropagationStopped()&&h.removeEventListener(m,ft),S.event.triggered=void 0,s&&(n[u]=s)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each((function(){S.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),g.focusin||S.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){S.event.simulate(t,e.target,S.event.fix(e))};S.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=X.access(r,t);i||r.addEventListener(e,n,!0),X.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=X.access(r,t)-1;i?X.access(r,t,i):(r.removeEventListener(e,n,!0),X.remove(r,t))}}})),S.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||S.error("Invalid XML: "+e),t};var pt,mt=/\[\]$/,gt=/\r?\n/g,vt=/^(?:submit|button|image|reset|file)$/i,yt=/^(?:input|select|textarea|keygen)/i;function bt(e,t,n,r){var i;if(Array.isArray(t))S.each(t,(function(t,i){n||mt.test(e)?r(e,i):bt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==_(t))r(e,t);else for(i in t)bt(e+"["+i+"]",t[i],n,r)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,(function(){i(this.name,this.value)}));else for(n in e)bt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&yt.test(this.nodeName)&&!vt.test(e)&&(this.checked||!me.test(e))})).map((function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,(function(e){return{name:t.name,value:e.replace(gt,"\r\n")}})):{name:t.name,value:n.replace(gt,"\r\n")}})).get()}}),S.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return v(e)?this.each((function(t){S(this).wrapInner(e.call(this,t))})):this.each((function(){var t=S(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=v(e);return this.each((function(n){S(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},g.createHTMLDocument=((pt=b.implementation.createHTMLDocument("").body).innerHTML="
        ",2===pt.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(g.createHTMLDocument?((r=(t=b.implementation.createHTMLDocument("")).createElement("base")).href=b.location.href,t.head.appendChild(r)):t=b),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=_e([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,u=S.css(e,"position"),c=S(e),d={};"static"===u&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),l=S.css(e,"left"),("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),v(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):("number"==typeof d.top&&(d.top+="px"),"number"==typeof d.left&&(d.left+="px"),c.css(d))}},S.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){S.offset.setOffset(this,e,t)}));var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||ae}))}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;S.fn[e]=function(r){return $(this,(function(e,r,i){var o;if(y(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i}),e,r,arguments.length)}})),S.each(["top","left"],(function(e,t){S.cssHooks[t]=qe(g.pixelPosition,(function(e,n){if(n)return n=$e(e,t),ze.test(n)?S(e).position()[t]+"px":n}))})),S.each({Height:"height",Width:"width"},(function(e,t){S.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){S.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return $(this,(function(t,n,i){var o;return y(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?S.css(t,n,s):S.style(t,n,i,s)}),t,a?i:void 0,a)}}))})),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){S.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}));var wt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=P,S.isFunction=v,S.isWindow=y,S.camelCase=G,S.type=_,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(wt,"")},void 0===(n=function(){return S}.apply(t,[]))||(e.exports=n);var Et=r.jQuery,_t=r.$;return S.noConflict=function(e){return r.$===S&&(r.$=_t),e&&r.jQuery===S&&(r.jQuery=Et),S},void 0===i&&(r.jQuery=r.$=S),S}))},4013:(e,t,n)=>{"use strict";n.d(t,{HZ:()=>pe,Ue:()=>me,_$:()=>fe,EK:()=>f,JH:()=>d,xE:()=>Q,RB:()=>H});var r=n(2122),i=n(3827),o=n(5991),a=n(1788),s=n(3349),l=n(9756),u={}.constructor;function c(e){if(null==e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(c);if(e.constructor!==u)return e;var t={};for(var n in e)t[n]=c(e[n]);return t}function d(e,t,n){void 0===e&&(e="unnamed");var r=n.jss,i=c(t);return r.plugins.onCreateRule(e,i,n)||(e[0],null)}var h=function(e,t){for(var n="",r=0;r<+~=|^:(),"'`\s])/g,v="undefined"!=typeof CSS&&CSS.escape,y=function(e){return v?v(e):e.replace(g,"\\$1")},b=function(){function e(e,t,n){this.type="style",this.key=void 0,this.isProcessed=!1,this.style=void 0,this.renderer=void 0,this.renderable=void 0,this.options=void 0;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:i&&(this.renderer=new i)}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var i=t;n&&!1===n.process||(i=this.options.jss.plugins.onChangeValue(t,e,this));var o=null==i||!1===i,a=e in this.style;if(o&&!a&&!r)return this;var s=o&&a;if(s?delete this.style[e]:this.style[e]=i,this.renderable&&this.renderer)return s?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,i),this;var l=this.options.sheet;return l&&l.attached,this},e}(),w=function(e){function t(t,n,r){var i;(i=e.call(this,t,n,r)||this).selectorText=void 0,i.id=void 0,i.renderable=void 0;var o=r.selector,a=r.scoped,l=r.sheet,u=r.generateId;return o?i.selectorText=o:!1!==a&&(i.id=u((0,s.Z)((0,s.Z)(i)),l),i.selectorText="."+y(i.id)),i}(0,a.Z)(t,e);var n=t.prototype;return n.applyTo=function(e){var t=this.renderer;if(t){var n=this.toJSON();for(var r in n)t.setProperty(e,r,n[r])}return this},n.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!=typeof n?e[t]=n:Array.isArray(n)&&(e[t]=f(n))}return e},n.toString=function(e){var t=this.options.sheet,n=t&&t.options.link?(0,r.Z)({},e,{allowEmpty:!0}):e;return m(this.selectorText,this.style,n)},(0,o.Z)(t,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,n=this.renderable;n&&t&&(t.setSelector(n,e)||t.replaceRule(n,this))}},get:function(){return this.selectorText}}]),t}(b),E={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new w(e,t,n)}},_={indent:1,children:!0},C=/@([\w-]+)/,S=function(){function e(e,t,n){this.type="conditional",this.at=void 0,this.key=void 0,this.query=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.query=n.name;var i=e.match(C);for(var o in this.at=i?i[1]:"unknown",this.options=n,this.rules=new H((0,r.Z)({},n,{parent:this})),t)this.rules.add(o,t[o]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.toString=function(e){if(void 0===e&&(e=_),null==e.indent&&(e.indent=_.indent),null==e.children&&(e.children=_.children),!1===e.children)return this.query+" {}";var t=this.rules.toString(e);return t?this.query+" {\n"+t+"\n}":""},e}(),x=/@media|@supports\s+/,T={onCreateRule:function(e,t,n){return x.test(e)?new S(e,t,n):null}},I={indent:1,children:!0},k=/@keyframes\s+([\w-]+)/,O=function(){function e(e,t,n){this.type="keyframes",this.at="@keyframes",this.key=void 0,this.name=void 0,this.id=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var i=e.match(k);i&&i[1]?this.name=i[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var o=n.scoped,a=n.sheet,s=n.generateId;for(var l in this.id=!1===o?this.name:y(s(this,a)),this.rules=new H((0,r.Z)({},n,{parent:this})),t)this.rules.add(l,t[l],(0,r.Z)({},n,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){if(void 0===e&&(e=I),null==e.indent&&(e.indent=I.indent),null==e.children&&(e.children=I.children),!1===e.children)return this.at+" "+this.id+" {}";var t=this.rules.toString(e);return t&&(t="\n"+t+"\n"),this.at+" "+this.id+" {"+t+"}"},e}(),P=/@keyframes\s+/,N=/\$([\w-]+)/g,A=function(e,t){return"string"==typeof e?e.replace(N,(function(e,n){return n in t?t[n]:e})):e},D=function(e,t,n){var r=e[t],i=A(r,n);i!==r&&(e[t]=i)},R={onCreateRule:function(e,t,n){return"string"==typeof e&&P.test(e)?new O(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n?("animation-name"in e&&D(e,"animation-name",n.keyframes),"animation"in e&&D(e,"animation",n.keyframes),e):e},onChangeValue:function(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return A(e,r.keyframes);default:return e}}},M=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i=this.index)t.push(e);else for(var r=0;rn)return void t.splice(r,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,n=t.attached,r=(0,l.Z)(t,["attached"]),i="",o=0;or)&&(n=r);try{"insertRule"in e?e.insertRule(t,n):"appendRule"in e&&e.appendRule(t)}catch(e){return!1}return e.cssRules[n]},ce=function(){function e(e){this.getPropertyValue=re,this.setProperty=ie,this.removeProperty=oe,this.setSelector=ae,this.element=void 0,this.sheet=void 0,this.hasInsertedRules=!1,e&&Y.add(e),this.sheet=e;var t,n=this.sheet?this.sheet.options:{},r=n.media,i=n.meta,o=n.element;this.element=o||((t=document.createElement("style")).textContent="\n",t),this.element.setAttribute("data-jss",""),r&&this.element.setAttribute("media",r),i&&this.element.setAttribute("data-meta",i);var a=le();a&&this.element.setAttribute("nonce",a)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){!function(e,t){var n=t.insertionPoint,r=function(e){var t=Y.registry;if(t.length>0){var n=function(e,t){for(var n=0;nt.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if((n=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"==typeof r){var i=function(e){for(var t=se(),n=0;n=0&&n<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(o=n,!1!==i&&function(e){var n=(r[e]||"silent").toUpperCase();if(typeof window!==t){try{return void(window.localStorage[l]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"="+n+";"}catch(e){}}}(n),s.call(a,n,e),typeof console===t&&n{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var a,s,l=i(e),u=1;u{"use strict";var r=n(414);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4448:(e,t,n)=>{"use strict";var r=n(7294),i=n(7418),o=n(4142);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n