@remit/web-client-dist 0.0.127 → 0.0.128

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/assets/{ComposeBody-h2C6k222.js → ComposeBody-BmDqP2br.js} +1 -1
  2. package/assets/{ErrorState-B7jWTPIf.js → ErrorState-D_8uppAK.js} +1 -1
  3. package/assets/{OnboardingWizard-k84Sdw86.js → OnboardingWizard-BcyrLnMy.js} +1 -1
  4. package/assets/{account-form-helpers-xI92Dwmc.js → account-form-helpers-D7EMABCp.js} +1 -1
  5. package/assets/{accounts-DKfAXZjO.js → accounts-DqILuy2V.js} +1 -1
  6. package/assets/{advanced-CkqcfzJJ.js → advanced-e4evDSNK.js} +1 -1
  7. package/assets/{appearance-Dytafdds.js → appearance-BwiZN-Rf.js} +1 -1
  8. package/assets/{avatar-0qIqgsXP.js → avatar-CVAYDnpj.js} +1 -1
  9. package/assets/{browser-ponyfill-BwVTtQXO.js → browser-ponyfill-D2EtxrZ2.js} +1 -1
  10. package/assets/{download-BwUpxXRu.js → download-DRSLizxj.js} +1 -1
  11. package/assets/{filter-status-CSIQ5QUR.js → filter-status-ZlgR_CjI.js} +1 -1
  12. package/assets/{filters-CJq3f7fG.js → filters-Bf2CSGtM.js} +1 -1
  13. package/assets/{flagged-BoZpfueM.js → flagged-oUNx6RRA.js} +1 -1
  14. package/assets/{folder--nZa3AWC.js → folder-RZgUjcE_.js} +1 -1
  15. package/assets/{folders-Bd3b1tcw.js → folders-DIOTNG5-.js} +1 -1
  16. package/assets/{index-DmAjS0RP.js → index-BMNF091M.js} +4 -4
  17. package/assets/{index-Db6DEVIe.js → index-BfZ-RfPW.js} +1 -1
  18. package/assets/index-Bnxs3LrV.js +1 -0
  19. package/assets/{kbd-7BCcqn6e.js → kbd-CTm4HXP-.js} +1 -1
  20. package/assets/mail-UHzkrnk0.js +118 -0
  21. package/assets/{onboarding-w8oC_k77.js → onboarding-DD3xjYdh.js} +1 -1
  22. package/assets/{rotate-ccw-DMt3woFX.js → rotate-ccw-un1uH_12.js} +1 -1
  23. package/assets/{select-BjP4w3Or.js → select-DfJvmiX9.js} +1 -1
  24. package/assets/{senders-C6xMNaU5.js → senders-DnmzQeCG.js} +1 -1
  25. package/assets/settings-ovBR_9gX.js +1 -0
  26. package/assets/{settings-screen-BCJFYn9T.js → settings-screen-eWBlxlso.js} +1 -1
  27. package/assets/{suggested-vips-P2LJ2gFj.js → suggested-vips-CP6Nt7du.js} +1 -1
  28. package/assets/{useDebouncedValue-C1Om-LCu.js → useDebouncedValue-BGzzncLs.js} +1 -1
  29. package/assets/{useSignature-C_KrJpXy.js → useSignature-CYWujB_O.js} +1 -1
  30. package/index.html +1 -1
  31. package/package.json +1 -1
  32. package/assets/index-DhjmWYCG.js +0 -1
  33. package/assets/mail-BhCnC0zo.js +0 -118
  34. package/assets/settings-CAQOtl8y.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mail-BhCnC0zo.js","assets/useDebouncedValue-C1Om-LCu.js","assets/avatar-0qIqgsXP.js","assets/kbd-7BCcqn6e.js","assets/account-form-helpers-xI92Dwmc.js","assets/useSignature-C_KrJpXy.js","assets/ErrorState-B7jWTPIf.js","assets/format-B6Elex-n.js","assets/filter-status-CSIQ5QUR.js","assets/select-BjP4w3Or.js","assets/rotate-ccw-DMt3woFX.js","assets/folder--nZa3AWC.js","assets/onboarding-w8oC_k77.js","assets/OnboardingWizard-k84Sdw86.js","assets/index-Db6DEVIe.js","assets/flagged-BoZpfueM.js","assets/accounts-DKfAXZjO.js","assets/settings-screen-BCJFYn9T.js","assets/download-BwUpxXRu.js","assets/advanced-CkqcfzJJ.js","assets/appearance-Dytafdds.js","assets/filters-CJq3f7fG.js","assets/folders-Bd3b1tcw.js","assets/senders-C6xMNaU5.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mail-UHzkrnk0.js","assets/useDebouncedValue-BGzzncLs.js","assets/avatar-CVAYDnpj.js","assets/kbd-CTm4HXP-.js","assets/account-form-helpers-D7EMABCp.js","assets/useSignature-CYWujB_O.js","assets/ErrorState-D_8uppAK.js","assets/format-B6Elex-n.js","assets/filter-status-ZlgR_CjI.js","assets/select-DfJvmiX9.js","assets/rotate-ccw-un1uH_12.js","assets/folder-RZgUjcE_.js","assets/onboarding-DD3xjYdh.js","assets/OnboardingWizard-BcyrLnMy.js","assets/index-BfZ-RfPW.js","assets/flagged-oUNx6RRA.js","assets/accounts-DqILuy2V.js","assets/settings-screen-eWBlxlso.js","assets/download-DRSLizxj.js","assets/advanced-e4evDSNK.js","assets/appearance-BwiZN-Rf.js","assets/filters-Bf2CSGtM.js","assets/folders-DIOTNG5-.js","assets/senders-DnmzQeCG.js"])))=>i.map(i=>d[i]);
2
2
  function a6(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var Lg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qa(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var j1={exports:{}},Sf={};var zN;function yq(){if(zN)return Sf;zN=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,s,o){var a=null;if(o!==void 0&&(a=""+o),s.key!==void 0&&(a=""+s.key),"key"in s){o={};for(var u in s)u!=="key"&&(o[u]=s[u])}else o=s;return s=o.ref,{$$typeof:t,type:r,key:a,ref:s!==void 0?s:null,props:o}}return Sf.Fragment=e,Sf.jsx=n,Sf.jsxs=n,Sf}var jN;function bq(){return jN||(jN=1,j1.exports=yq()),j1.exports}var P=bq();const Sq="Logging",Eq="x-amz-user-agent",Cq="NoHubcallbackProvidedException";var ss;(function(t){t.DEBUG="DEBUG",t.ERROR="ERROR",t.INFO="INFO",t.WARN="WARN",t.VERBOSE="VERBOSE",t.NONE="NONE"})(ss||(ss={}));const BN={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};class rr{constructor(e,n=ss.WARN){this.name=e,this.level=n,this._pluggables=[]}_padding(e){return e<10?"0"+e:""+e}_ts(){const e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()}configure(e){return e?(this._config=e,this._config):this._config}_log(e,...n){let r=this.level;rr.LOG_LEVEL&&(r=rr.LOG_LEVEL),typeof window<"u"&&window.LOG_LEVEL&&(r=window.LOG_LEVEL);const s=BN[r];if(!(BN[e]>=s))return;let a=console.log.bind(console);e===ss.ERROR&&console.error&&(a=console.error.bind(console)),e===ss.WARN&&console.warn&&(a=console.warn.bind(console)),rr.BIND_ALL_LOG_LEVELS&&(e===ss.INFO&&console.info&&(a=console.info.bind(console)),e===ss.DEBUG&&console.debug&&(a=console.debug.bind(console)));const u=`[${e}] ${this._ts()} ${this.name}`;let c="";if(n.length===1&&typeof n[0]=="string")c=`${u} - ${n[0]}`,a(c);else if(n.length===1)c=`${u} ${n[0]}`,a(u,n[0]);else if(typeof n[0]=="string"){let f=n.slice(1);f.length===1&&(f=f[0]),c=`${u} - ${n[0]} ${f}`,a(`${u} - ${n[0]}`,f)}else c=`${u} ${n}`,a(u,n);for(const f of this._pluggables){const p={message:c,timestamp:Date.now()};f.pushLogs([p])}}log(...e){this._log(ss.INFO,...e)}info(...e){this._log(ss.INFO,...e)}warn(...e){this._log(ss.WARN,...e)}error(...e){this._log(ss.ERROR,...e)}debug(...e){this._log(ss.DEBUG,...e)}verbose(...e){this._log(ss.VERBOSE,...e)}addPluggable(e){e&&e.getCategoryName()===Sq&&(this._pluggables.push(e),e.configure(this._config))}listPluggables(){return this._pluggables}}rr.LOG_LEVEL=null;rr.BIND_ALL_LOG_LEVELS=!1;class Hr extends Error{constructor({message:e,name:n,recoverySuggestion:r,underlyingError:s,metadata:o}){if(super(e),this.name=n,this.underlyingError=s,this.recoverySuggestion=r,o){const{extendedRequestId:a,httpStatusCode:u,requestId:c}=o;this.metadata={extendedRequestId:a,httpStatusCode:u,requestId:c}}this.constructor=Hr,Object.setPrototypeOf(this,Hr.prototype)}}var Pa;(function(t){t.NoEndpointId="NoEndpointId",t.PlatformNotSupported="PlatformNotSupported",t.Unknown="Unknown",t.NetworkError="NetworkError"})(Pa||(Pa={}));const Cy=(t,e=Hr)=>(n,r,s)=>{const{message:o,recoverySuggestion:a}=t[r];if(!n)throw new e({name:r,message:s?`${o} ${s}`:o,recoverySuggestion:a})},_o=typeof Symbol<"u"?Symbol("amplify_default"):"@@amplify_default",Ef=new rr("Hub");class l6{constructor(e){this.listeners=new Map,this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=e}_remove(e,n){const r=this.listeners.get(e);if(!r){Ef.warn(`No listeners for ${e}`);return}this.listeners.set(e,[...r.filter(({callback:s})=>s!==n)])}dispatch(e,n,r,s){typeof e=="string"&&this.protectedChannels.indexOf(e)>-1&&(s===_o||Ef.warn(`WARNING: ${e} is protected and dispatching on it can have unintended consequences`));const o={channel:e,payload:{...n},source:r,patternInfo:[]};try{this._toListeners(o)}catch(a){Ef.error(a)}}listen(e,n,r="noname"){let s;if(typeof n!="function")throw new Hr({name:Cq,message:"No callback supplied to Hub"});s=n;let o=this.listeners.get(e);return o||(o=[],this.listeners.set(e,o)),o.push({name:r,callback:s}),()=>{this._remove(e,s)}}_toListeners(e){const{channel:n,payload:r}=e,s=this.listeners.get(n);s&&s.forEach(o=>{Ef.debug(`Dispatching to ${n} with `,r);try{o.callback(e)}catch(a){Ef.error(a)}})}}const Ao=new l6("__default__"),yv=new l6("internal-hub"),DA=()=>{if(typeof window=="object"&&typeof window.crypto=="object")return window.crypto;if(typeof crypto=="object")return crypto;throw new Hr({name:"MissingPolyfill",message:"Cannot resolve the `crypto` function from the environment."})},wq=()=>{if(typeof window<"u"&&typeof window.btoa=="function")return window.btoa;if(typeof btoa=="function")return btoa;throw new Hr({name:"Base64EncoderError",message:"Cannot resolve the `btoa` function from the environment."})},xq=()=>{if(typeof window<"u"&&typeof window.atob=="function")return window.atob;if(typeof atob=="function")return atob;throw new Hr({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})},LA={convert(t,e){let n=t;return e?.urlSafe&&(n=n.replace(/-/g,"+").replace(/_/g,"/")),xq()(n)}};var Eo;(function(t){t.AuthTokenConfigException="AuthTokenConfigException",t.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",t.AuthUserPoolException="AuthUserPoolException",t.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",t.OAuthNotConfigureException="OAuthNotConfigureException"})(Eo||(Eo={}));const _q={[Eo.AuthTokenConfigException]:{message:"Auth Token Provider not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app."},[Eo.AuthUserPoolAndIdentityPoolException]:{message:"Auth UserPool or IdentityPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId."},[Eo.AuthUserPoolException]:{message:"Auth UserPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId."},[Eo.InvalidIdentityPoolIdException]:{message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."},[Eo.OAuthNotConfigureException]:{message:"oauth param not configured.",recoverySuggestion:"Make sure to call Amplify.configure with oauth parameter in your app."}},UA=Cy(_q);function lt(t){let e=!0;t?e=!!t.userPoolId&&!!t.userPoolClientId:e=!1,UA(e,Eo.AuthUserPoolException)}function wy(t){const e=!!t?.loginWith?.oauth?.domain&&!!t?.loginWith?.oauth?.redirectSignOut&&!!t?.loginWith?.oauth?.redirectSignIn&&!!t?.loginWith?.oauth?.responseType;UA(e,Eo.OAuthNotConfigureException)}function qm(t){const e=!!t?.identityPoolId;UA(e,Eo.InvalidIdentityPoolIdException)}function gi(t){const e=t.split(".");if(e.length!==3)throw new Error("Invalid token");try{const r=e[1].replace(/-/g,"+").replace(/_/g,"/"),s=decodeURIComponent(LA.convert(r).split("").map(a=>`%${`00${a.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")),o=JSON.parse(s);return{toString:()=>t,payload:o}}catch{throw new Error("Invalid token payload")}}const u6=t=>{const e=Reflect.ownKeys(t);for(const n of e){const r=t[n];(r&&typeof r=="object"||typeof r=="function")&&u6(r)}return Object.freeze(t)},Aq=new rr("parseAWSExports"),Tq={API_KEY:"apiKey",AWS_IAM:"iam",AMAZON_COGNITO_USER_POOLS:"userPool",OPENID_CONNECT:"oidc",NONE:"none",AWS_LAMBDA:"lambda",LAMBDA:"lambda"},Rq=(t={})=>{if(!Object.prototype.hasOwnProperty.call(t,"aws_project_region"))throw new Hr({name:"InvalidParameterException",message:"Invalid config parameter.",recoverySuggestion:"Ensure passing the config object imported from `amplifyconfiguration.json`."});const{aws_appsync_apiKey:e,aws_appsync_authenticationType:n,aws_appsync_graphqlEndpoint:r,aws_appsync_region:s,aws_bots_config:o,aws_cognito_identity_pool_id:a,aws_cognito_sign_up_verification_method:u,aws_cognito_mfa_configuration:c,aws_cognito_mfa_types:f,aws_cognito_password_protection_settings:p,aws_cognito_verification_mechanisms:g,aws_cognito_signup_attributes:m,aws_cognito_social_providers:y,aws_cognito_username_attributes:S,aws_mandatory_sign_in:E,aws_mobile_analytics_app_id:C,aws_mobile_analytics_app_region:w,aws_user_files_s3_bucket:A,aws_user_files_s3_bucket_region:T,aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing:R,aws_user_pools_id:N,aws_user_pools_web_client_id:O,geo:I,oauth:k,predictions:F,aws_cloud_logic_custom:$,Notifications:D,modelIntrospection:z}=t,q={};C&&(q.Analytics={Pinpoint:{appId:C,region:w}});const{InAppMessaging:Y,Push:te}=D??{};if(Y?.AWSPinpoint||te?.AWSPinpoint){if(Y?.AWSPinpoint){const{appId:J,region:oe}=Y.AWSPinpoint;q.Notifications={InAppMessaging:{Pinpoint:{appId:J,region:oe}}}}if(te?.AWSPinpoint){const{appId:J,region:oe}=te.AWSPinpoint;q.Notifications={...q.Notifications,PushNotification:{Pinpoint:{appId:J,region:oe}}}}}if(Array.isArray(o)&&(q.Interactions={LexV1:Object.fromEntries(o.map(J=>[J.name,J]))}),r){const J=Tq[n];J||Aq.debug(`Invalid authentication type ${n}. Falling back to IAM.`),q.API={GraphQL:{endpoint:r,apiKey:e,region:s,defaultAuthMode:J??"iam"}},z&&(q.API.GraphQL.modelIntrospection=z)}const H=c?{status:c&&c.toLowerCase(),totpEnabled:f?.includes("TOTP")??!1,smsEnabled:f?.includes("SMS")??!1}:void 0,ee=p?{minLength:p.passwordPolicyMinLength,requireLowercase:p.passwordPolicyCharacters?.includes("REQUIRES_LOWERCASE")??!1,requireUppercase:p.passwordPolicyCharacters?.includes("REQUIRES_UPPERCASE")??!1,requireNumbers:p.passwordPolicyCharacters?.includes("REQUIRES_NUMBERS")??!1,requireSpecialCharacters:p.passwordPolicyCharacters?.includes("REQUIRES_SYMBOLS")??!1}:void 0,de=Array.from(new Set([...g??[],...m??[]])).reduce((J,oe)=>({...J,[oe.toLowerCase()]:{required:!0}}),{}),Ae=S?.includes("EMAIL")??!1,L=S?.includes("PHONE_NUMBER")??!1;(a||N)&&(q.Auth={Cognito:{identityPoolId:a,allowGuestAccess:E!=="enable",signUpVerificationMethod:u,userAttributes:de,userPoolClientId:O,userPoolId:N,mfa:H,passwordFormat:ee,loginWith:{username:!(Ae||L),email:Ae,phone:L}}});const G=k?Object.keys(k).length>0:!1,K=y?y.length>0:!1;if(q.Auth&&G&&(q.Auth.Cognito.loginWith={...q.Auth.Cognito.loginWith,oauth:{...Iq(k),...K&&{providers:Oq(y)}}}),A&&(q.Storage={S3:{bucket:A,region:T,dangerouslyConnectToHttpEndpointForTesting:R}}),I){const{amazon_location_service:J}=I;q.Geo={LocationService:{maps:J.maps,geofenceCollections:J.geofenceCollections,searchIndices:J.search_indices,region:J.region}}}if($&&(q.API={...q.API,REST:$.reduce((J,oe)=>{const{name:he,endpoint:ue,region:ve,service:xe}=oe;return{...J,[he]:{endpoint:ue,...xe?{service:xe}:void 0,...ve?{region:ve}:void 0}}},{})}),F){const{VoiceId:J}=F?.convert?.speechGenerator?.defaults??{};q.Predictions=J?{...F,convert:{...F.convert,speechGenerator:{...F.convert.speechGenerator,defaults:{voiceId:J}}}}:F}return q},HN=t=>t?.split(",")??[],Iq=({domain:t,scope:e,redirectSignIn:n,redirectSignOut:r,responseType:s})=>({domain:t,scopes:e,redirectSignIn:HN(n),redirectSignOut:HN(r),responseType:s}),Oq=t=>t.map(e=>{const n=e.toLowerCase();return n.charAt(0).toUpperCase()+n.slice(1)}),c6=Symbol("oauth-listener"),Jn=[];for(let t=0;t<256;++t)Jn.push((t+256).toString(16).slice(1));function Nq(t,e=0){return(Jn[t[e+0]]+Jn[t[e+1]]+Jn[t[e+2]]+Jn[t[e+3]]+"-"+Jn[t[e+4]]+Jn[t[e+5]]+"-"+Jn[t[e+6]]+Jn[t[e+7]]+"-"+Jn[t[e+8]]+Jn[t[e+9]]+"-"+Jn[t[e+10]]+Jn[t[e+11]]+Jn[t[e+12]]+Jn[t[e+13]]+Jn[t[e+14]]+Jn[t[e+15]]).toLowerCase()}let B1;const Mq=new Uint8Array(16);function Pq(){if(!B1){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");B1=crypto.getRandomValues.bind(crypto)}return B1(Mq)}const kq=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$N={randomUUID:kq};function Dq(t,e,n){if($N.randomUUID&&!e&&!t)return $N.randomUUID();t=t||{};const r=t.random??t.rng?.()??Pq();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){if(n=n||0,n<0||n+16>e.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let s=0;s<16;++s)e[n+s]=r[s];return e}return Nq(r)}function Lq(t){const{version:e}=t;return e?e.startsWith("1"):!1}function Uq(t){if(!t)return;const{bucket_name:e,aws_region:n,buckets:r}=t;return{S3:{bucket:e,region:n,buckets:r&&Kq(r)}}}function Fq(t){if(!t)return;const{user_pool_id:e,user_pool_client_id:n,identity_pool_id:r,password_policy:s,mfa_configuration:o,mfa_methods:a,unauthenticated_identities_enabled:u,oauth:c,username_attributes:f,standard_required_attributes:p,groups:g,passwordless:m}=t,y={Cognito:{userPoolId:e,userPoolClientId:n,groups:g}};return r&&(y.Cognito={...y.Cognito,identityPoolId:r}),s&&(y.Cognito.passwordFormat={requireLowercase:s.require_lowercase,requireNumbers:s.require_numbers,requireUppercase:s.require_uppercase,requireSpecialCharacters:s.require_symbols,minLength:s.min_length??6}),o&&(y.Cognito.mfa={status:Gq(o),smsEnabled:a?.includes("SMS"),totpEnabled:a?.includes("TOTP")}),u&&(y.Cognito.allowGuestAccess=u),c&&(y.Cognito.loginWith={oauth:{domain:c.domain,redirectSignIn:c.redirect_sign_in_uri,redirectSignOut:c.redirect_sign_out_uri,responseType:c.response_type==="token"?"token":"code",scopes:c.scopes,providers:Vq(c.identity_providers)}}),f&&(y.Cognito.loginWith={...y.Cognito.loginWith,email:f.includes("email"),phone:f.includes("phone_number"),username:f.includes("username")}),p&&(y.Cognito.userAttributes=p.reduce((S,E)=>({...S,[E]:{required:!0}}),{})),m&&(y.Cognito.passwordless={emailOtpEnabled:m.email_otp_enabled,smsOtpEnabled:m.sms_otp_enabled,webAuthn:m.web_authn?{relyingPartyId:m.web_authn.relying_party_id,userVerification:m.web_authn.user_verification}:void 0,preferredChallenge:m.preferred_challenge}),y}function zq(t){if(!t?.amazon_pinpoint)return;const{amazon_pinpoint:e}=t;return{Pinpoint:{appId:e.app_id,region:e.aws_region}}}function jq(t){if(!t)return;const{aws_region:e,geofence_collections:n,maps:r,search_indices:s}=t;return{LocationService:{region:e,searchIndices:s,geofenceCollections:n,maps:r}}}function Bq(t){if(!t)return;const{aws_region:e,default_authorization_type:n,url:r,api_key:s,model_introspection:o}=t;return{GraphQL:{endpoint:r,defaultAuthMode:d6(n),region:e,apiKey:s,modelIntrospection:o}}}function Hq(t){if(!t?.events)return;const{url:e,aws_region:n,api_key:r,default_authorization_type:s}=t.events;return{Events:{endpoint:e,defaultAuthMode:d6(s),region:n,apiKey:r}}}function $q(t){if(!t)return;const{aws_region:e,channels:n,amazon_pinpoint_app_id:r}=t,s=n.includes("IN_APP_MESSAGING"),o=n.includes("APNS")||n.includes("FCM");if(!(s||o))return;const a={};return s&&(a.InAppMessaging={Pinpoint:{appId:r,region:e}}),o&&(a.PushNotification={Pinpoint:{appId:r,region:e}}),a}function qq(t){const e={};if(t.storage&&(e.Storage=Uq(t.storage)),t.auth&&(e.Auth=Fq(t.auth)),t.analytics&&(e.Analytics=zq(t.analytics)),t.geo&&(e.Geo=jq(t.geo)),t.data&&(e.API=Bq(t.data)),t.custom){const n=Hq(t.custom);n&&"Events"in n&&(e.API={...e.API,...n})}return t.notifications&&(e.Notifications=$q(t.notifications)),e}const Wq={AMAZON_COGNITO_USER_POOLS:"userPool",API_KEY:"apiKey",AWS_IAM:"iam",AWS_LAMBDA:"lambda",OPENID_CONNECT:"oidc"};function d6(t){return Wq[t]}const qN={GOOGLE:"Google",LOGIN_WITH_AMAZON:"Amazon",FACEBOOK:"Facebook",SIGN_IN_WITH_APPLE:"Apple"};function Vq(t=[]){return t.reduce((e,n)=>(qN[n]!==void 0&&e.push(qN[n]),e),[])}function Gq(t){return t==="OPTIONAL"?"optional":t==="REQUIRED"?"on":"off"}function Kq(t){const e={};return t.forEach(({name:n,bucket_name:r,aws_region:s,paths:o})=>{if(n in e)throw new Error(`Duplicate friendly name found: ${n}. Name must be unique.`);const a=o?Object.entries(o).reduce((u,[c,f])=>(f!==void 0&&(u[c]=f),u),{}):void 0;e[n]={bucketName:r,region:s,paths:a}}),e}const f6=t=>Object.keys(t).some(e=>e.startsWith("aws_"))?Rq(t):Lq(t)?qq(t):t;var WN=function(){return WN=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},WN.apply(this,arguments)};function RTe(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function Yq(t,e,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(p){try{f(r.next(p))}catch(g){a(g)}}function c(p){try{f(r.throw(p))}catch(g){a(g)}}function f(p){p.done?o(p.value):s(p.value).then(u,c)}f((r=r.apply(t,e||[])).next())})}function Zq(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,s,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(f){return function(p){return c([f,p])}}function c(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(n=0)),n;)try{if(r=1,s&&(o=f[0]&2?s.return:f[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,f[1])).done)return o;switch(s=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,s=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){n.label=f[1];break}if(f[0]===6&&n.label<o[1]){n.label=o[1],o=f;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(f);break}o[2]&&n.ops.pop(),n.trys.pop();continue}f=e.call(t,n)}catch(p){f=[6,p],s=0}finally{r=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function ITe(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,o;r<s;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var _s=64,Xq=32,Qq=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Jq=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],eW=Math.pow(2,53)-1,Wm=(function(){function t(){this.state=Int32Array.from(Jq),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return t.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var n=0,r=e.byteLength;if(this.bytesHashed+=r,this.bytesHashed*8>eW)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;r>0;)this.buffer[this.bufferLength++]=e[n++],r--,this.bufferLength===_s&&(this.hashBuffer(),this.bufferLength=0)},t.prototype.digest=function(){if(!this.finished){var e=this.bytesHashed*8,n=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),r=this.bufferLength;if(n.setUint8(this.bufferLength++,128),r%_s>=_s-8){for(var s=this.bufferLength;s<_s;s++)n.setUint8(s,0);this.hashBuffer(),this.bufferLength=0}for(var s=this.bufferLength;s<_s-8;s++)n.setUint8(s,0);n.setUint32(_s-8,Math.floor(e/4294967296),!0),n.setUint32(_s-4,e),this.hashBuffer(),this.finished=!0}for(var o=new Uint8Array(Xq),s=0;s<8;s++)o[s*4]=this.state[s]>>>24&255,o[s*4+1]=this.state[s]>>>16&255,o[s*4+2]=this.state[s]>>>8&255,o[s*4+3]=this.state[s]>>>0&255;return o},t.prototype.hashBuffer=function(){for(var e=this,n=e.buffer,r=e.state,s=r[0],o=r[1],a=r[2],u=r[3],c=r[4],f=r[5],p=r[6],g=r[7],m=0;m<_s;m++){if(m<16)this.temp[m]=(n[m*4]&255)<<24|(n[m*4+1]&255)<<16|(n[m*4+2]&255)<<8|n[m*4+3]&255;else{var y=this.temp[m-2],S=(y>>>17|y<<15)^(y>>>19|y<<13)^y>>>10;y=this.temp[m-15];var E=(y>>>7|y<<25)^(y>>>18|y<<14)^y>>>3;this.temp[m]=(S+this.temp[m-7]|0)+(E+this.temp[m-16]|0)}var C=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&f^~c&p)|0)+(g+(Qq[m]+this.temp[m]|0)|0)|0,w=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&o^s&a^o&a)|0;g=p,p=f,f=c,c=u+C|0,u=a,a=o,o=s,s=C+w|0}r[0]+=s,r[1]+=o,r[2]+=a,r[3]+=u,r[4]+=c,r[5]+=f,r[6]+=p,r[7]+=g},t})();const tW=t=>new TextEncoder().encode(t);var nW=typeof Buffer<"u"&&Buffer.from?function(t){return Buffer.from(t,"utf8")}:tW;function h6(t){return t instanceof Uint8Array?t:typeof t=="string"?nW(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}function rW(t){return typeof t=="string"?t.length===0:t.byteLength===0}var zl=(function(){function t(e){this.secret=e,this.hash=new Wm,this.reset()}return t.prototype.update=function(e){if(!(rW(e)||this.error))try{this.hash.update(h6(e))}catch(n){this.error=n}},t.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},t.prototype.digest=function(){return Yq(this,void 0,void 0,function(){return Zq(this,function(e){return[2,this.digestSync()]})})},t.prototype.reset=function(){if(this.hash=new Wm,this.secret){this.outer=new Wm;var e=sW(this.secret),n=new Uint8Array(_s);n.set(e);for(var r=0;r<_s;r++)e[r]^=54,n[r]^=92;this.hash.update(e),this.outer.update(n);for(var r=0;r<e.byteLength;r++)e[r]=0}},t})();function sW(t){var e=h6(t);if(e.byteLength>_s){var n=new Wm;n.update(e),e=n.digest()}var r=new Uint8Array(_s);return r.set(e),r}for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`)}var xn;(function(t){t.WebUnknown="0",t.React="1",t.NextJs="2",t.Angular="3",t.VueJs="4",t.Nuxt="5",t.Svelte="6",t.ServerSideUnknown="100",t.ReactSSR="101",t.NextJsSSR="102",t.AngularSSR="103",t.VueJsSSR="104",t.NuxtSSR="105",t.SvelteSSR="106",t.ReactNative="201",t.Expo="202"})(xn||(xn={}));var Is;(function(t){t.AI="ai",t.API="api",t.Auth="auth",t.Analytics="analytics",t.DataStore="datastore",t.Geo="geo",t.InAppMessaging="inappmessaging",t.Interactions="interactions",t.Predictions="predictions",t.PubSub="pubsub",t.PushNotification="pushnotification",t.Storage="storage"})(Is||(Is={}));var oi;(function(t){t.CreateConversation="1",t.GetConversation="2",t.ListConversations="3",t.DeleteConversation="4",t.SendMessage="5",t.ListMessages="6",t.OnMessage="7",t.Generation="8",t.UpdateConversation="9"})(oi||(oi={}));var VN;(function(t){t.Record="1",t.IdentifyUser="2"})(VN||(VN={}));var GN;(function(t){t.GraphQl="1",t.Get="2",t.Post="3",t.Put="4",t.Patch="5",t.Del="6",t.Head="7"})(GN||(GN={}));var Ke;(function(t){t.SignUp="1",t.ConfirmSignUp="2",t.ResendSignUpCode="3",t.SignIn="4",t.FetchMFAPreference="6",t.UpdateMFAPreference="7",t.SetUpTOTP="10",t.VerifyTOTPSetup="11",t.ConfirmSignIn="12",t.DeleteUserAttributes="15",t.DeleteUser="16",t.UpdateUserAttributes="17",t.FetchUserAttributes="18",t.ConfirmUserAttribute="22",t.SignOut="26",t.UpdatePassword="27",t.ResetPassword="28",t.ConfirmResetPassword="29",t.FederatedSignIn="30",t.RememberDevice="32",t.ForgetDevice="33",t.FetchDevices="34",t.SendUserAttributeVerificationCode="35",t.SignInWithRedirect="36",t.StartWebAuthnRegistration="37",t.CompleteWebAuthnRegistration="38",t.ListWebAuthnCredentials="39",t.DeleteWebAuthnCredential="40"})(Ke||(Ke={}));var KN;(function(t){t.Subscribe="1",t.GraphQl="2"})(KN||(KN={}));var ih;(function(t){t.SearchByText="0",t.SearchByCoordinates="1",t.SearchForSuggestions="2",t.SearchByPlaceId="3",t.SaveGeofences="4",t.GetGeofence="5",t.ListGeofences="6",t.DeleteGeofences="7"})(ih||(ih={}));var kx;(function(t){t.SyncMessages="1",t.IdentifyUser="2",t.NotifyMessageInteraction="3"})(kx||(kx={}));var YN;(function(t){t.None="0"})(YN||(YN={}));var ZN;(function(t){t.Convert="1",t.Identify="2",t.Interpret="3"})(ZN||(ZN={}));var XN;(function(t){t.Subscribe="1"})(XN||(XN={}));var QN;(function(t){t.InitializePushNotifications="1",t.IdentifyUser="2"})(QN||(QN={}));var qs;(function(t){t.UploadData="1",t.DownloadData="2",t.List="3",t.Copy="4",t.Remove="5",t.GetProperties="6",t.GetUrl="7",t.GetDataAccess="8",t.ListCallerAccessGrants="9"})(qs||(qs={}));const oW="6.18.0",xy=()=>typeof global<"u",sd=()=>typeof window<"u",p6=()=>typeof document<"u",FA=()=>typeof process<"u",Eh=(t,e)=>!!Object.keys(t).find(n=>n.startsWith(e));var JN={};function iW(){const t=r=>r.startsWith("_react")||r.startsWith("__react"),e=r=>Object.keys(r).find(t),n=()=>Array.from(document.querySelectorAll("[id]"));return p6()&&n().some(e)}function aW(){return FA()&&typeof JN<"u"&&!!Object.keys(JN).find(t=>t.includes("react"))}function lW(){return sd()&&Eh(window,"__VUE")}function uW(){return xy()&&Eh(global,"__VUE")}var eM={};function cW(){return sd()&&Eh(window,"__SVELTE")}function dW(){return FA()&&typeof eM<"u"&&!!Object.keys(eM).find(t=>t.includes("svelte"))}function fW(){return sd()&&window.next&&typeof window.next=="object"}function hW(){return xy()&&(Eh(global,"__next")||Eh(global,"__NEXT"))}function pW(){return sd()&&(window.__NUXT__!==void 0||window.$nuxt!==void 0)}function gW(){return xy()&&typeof global.__NUXT_PATHS__<"u"}var tM={};function mW(){const t=!!(p6()&&document.querySelector("[ng-version]")),e=!!(sd()&&typeof window.ng<"u");return t||e}function vW(){return FA()&&typeof tM=="object"&&tM.npm_lifecycle_script?.startsWith("ng ")||!1}function yW(){return typeof navigator<"u"&&typeof navigator.product<"u"&&navigator.product==="ReactNative"}function bW(){return xy()&&typeof global.expo<"u"}function SW(){return sd()}const EW=[{platform:xn.Expo,detectionMethod:bW},{platform:xn.ReactNative,detectionMethod:yW},{platform:xn.NextJs,detectionMethod:fW},{platform:xn.Nuxt,detectionMethod:pW},{platform:xn.Angular,detectionMethod:mW},{platform:xn.React,detectionMethod:iW},{platform:xn.VueJs,detectionMethod:lW},{platform:xn.Svelte,detectionMethod:cW},{platform:xn.WebUnknown,detectionMethod:SW},{platform:xn.NextJsSSR,detectionMethod:hW},{platform:xn.NuxtSSR,detectionMethod:gW},{platform:xn.ReactSSR,detectionMethod:aW},{platform:xn.VueJsSSR,detectionMethod:uW},{platform:xn.AngularSSR,detectionMethod:vW},{platform:xn.SvelteSSR,detectionMethod:dW}];function CW(){return EW.find(t=>t.detectionMethod())?.platform||xn.ServerSideUnknown}let ah;const H1=[];let Dx=!1;const wW=10,xW=10,_W=1e3,g6=()=>{if(!ah){if(ah=CW(),Dx)for(;H1.length;)H1.pop()?.();else H1.forEach(t=>{t()});nM(xn.ServerSideUnknown,wW),nM(xn.WebUnknown,xW)}return ah};function AW(){ah=void 0}function nM(t,e){ah===t&&!Dx&&setTimeout(()=>{AW(),Dx=!0,setTimeout(g6,_W)},e)}const pa={},Jo=t=>{pa[t.category]=t.apis.reduce((r,s)=>({...r,[s]:{refCount:r[s]?.refCount?r[s].refCount+1:1,additionalDetails:t.additionalDetails}}),pa[t.category]??{});let e=!1;return()=>{e||(e=!0,t.apis.forEach(r=>{const s=pa[t.category][r].refCount;s>1?pa[t.category][r].refCount=s-1:(delete pa[t.category][r],Object.keys(pa[t.category]).length||delete pa[t.category])}))}},TW=(t,e)=>pa[t]?.[e]?.additionalDetails,RW="aws-amplify",IW=t=>t.replace(/\+.*/,""),OW=({category:t,action:e}={})=>{const n=[[RW,IW(oW)]];if(t&&n.push([t,e]),n.push(["framework",g6()]),t&&e){const r=TW(t,e);r&&r.forEach(s=>{n.push(s)})}return n},_y=t=>OW(t).map(([r,s])=>r&&s?`${r}/${s}`:r).join(" "),Ay=()=>typeof window<"u"&&typeof window.document<"u",rM=new rr("Auth");class NW{configure(e,n){this.authConfig=e,this.authOptions=n,e&&e.Cognito?.userPoolEndpoint&&rM.warn(sM("Amazon Cognito User Pool")),e&&e.Cognito?.identityPoolEndpoint&&rM.warn(sM("Amazon Cognito Identity Pool"))}async fetchAuthSession(e={}){let n,r;const s=await this.getTokens(e);return s?(r=s.accessToken?.payload?.sub,n=await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({authConfig:this.authConfig,tokens:s,authenticated:!0,forceRefresh:e.forceRefresh})):n=await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({authConfig:this.authConfig,authenticated:!1,forceRefresh:e.forceRefresh}),{tokens:s,credentials:n?.credentials,identityId:n?.identityId,userSub:r}}async clearCredentials(){await this.authOptions?.credentialsProvider?.clearCredentialsAndIdentityId()}async getTokens(e){return await this.authOptions?.tokenProvider?.getTokens(e)??void 0}}const sM=t=>`You are using a custom Amazon ${t} endpoint, ensure the endpoint is correct.`;class MW{constructor(){this.oAuthListener=void 0,this.isConfigured=!1,this.resourcesConfig={},this.libraryOptions={},this.Auth=new NW}configure(e,n){const r=f6(e);this.resourcesConfig=r,n&&(this.libraryOptions=n),this.resourcesConfig=u6(this.resourcesConfig),this.Auth.configure(this.resourcesConfig.Auth,this.libraryOptions.Auth),(this.resourcesConfig.Analytics?.Pinpoint||this.resourcesConfig.Notifications?.InAppMessaging?.Pinpoint||this.resourcesConfig.Notifications?.PushNotification?.Pinpoint)&&console.warn("AWS will end support for Amazon Pinpoint on October 30, 2026. The guidance is to use AWS End User Messaging for push notifications and SMS, Amazon Simple Email Service for sending emails, Amazon Connect for campaigns, journeys, endpoints, and engagement analytics. Pinpoint recommends Amazon Kinesis for event collection and mobile analytics."),Ao.dispatch("core",{event:"configure",data:this.resourcesConfig},"Configure",_o),this.notifyOAuthListener(),this.isConfigured=!0}getConfig(){return this.isConfigured||console.warn("Amplify has not been configured. Please call Amplify.configure() before using this service."),this.resourcesConfig}[c6](e){this.resourcesConfig.Auth?.Cognito.loginWith?.oauth?e(this.resourcesConfig.Auth?.Cognito):this.oAuthListener=e}notifyOAuthListener(){!this.resourcesConfig.Auth?.Cognito.loginWith?.oauth||!this.oAuthListener||(this.oAuthListener(this.resourcesConfig.Auth?.Cognito),this.oAuthListener=void 0)}}const Ht=new MW,m6=(t,e)=>t.Auth.fetchAuthSession(e),Ty=t=>m6(Ht,t);function v6(){return Ht.Auth.clearCredentials()}const Ry=t=>{const{headers:e,statusCode:n}=t;return{...PW(t)?t.$metadata:{},httpStatusCode:n,requestId:e["x-amzn-requestid"]??e["x-amzn-request-id"]??e["x-amz-request-id"],extendedRequestId:e["x-amz-id-2"],cfId:e["x-amz-cf-id"]}},PW=t=>typeof t?.$metadata=="object",od=async t=>{if(!t||t.statusCode<300)return;const e=await Jh(t),r=(a=>{const[u]=a.toString().split(/[,:]+/);return u.includes("#")?u.split("#")[1]:u})(t.headers["x-amzn-errortype"]??e.code??e.__type??"UnknownError"),s=e.message??e.Message??"Unknown error",o=new Error(s);return Object.assign(o,{name:r,$metadata:Ry(t)})},Jh=async t=>{if(!t.body)throw new Error("Missing response payload");const e=await t.body.json();return Object.assign(e,{$metadata:Ry(t)})},Rn=(t,e,n,r)=>async(s,o)=>{const a={...r,...s},u=await a.endpointResolver(a,o),c=await e(o,u),f=await t(c,{...a});return n(f)},kW=300*1e3;function DW(t=kW){return r=>{const s=2**r*100+100*Math.random();return s>t?!1:s}}const y6=3,oM="amz-sdk-invocation-id",LW="amz-sdk-request",iM=300*1e3,b6=t=>{const n=DW(iM)(t);return n===!1?iM:n},UW=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],FW=t=>!!t&&UW.includes(t),S6=t=>async(e,n)=>{const r=n??await t(e)??void 0,s=r?.code||r?.name,o=e?.statusCode;return{retryable:HW(n)||BW(o,s)||FW(s)||$W(o,s)}},zW=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],jW=["TimeoutError","RequestTimeout","RequestTimeoutException"],BW=(t,e)=>t===429||!!e&&zW.includes(e),HW=t=>[Pa.NetworkError,"ERR_NETWORK"].includes(t?.name),$W=(t,e)=>!!t&&[500,502,503,504].includes(t)||!!e&&jW.includes(e),E6="cognito-identity",C6={service:E6,retryDecider:S6(od),computeDelay:b6,cache:"no-store"},qW=({maxAttempts:t=y6,retryDecider:e,computeDelay:n,abortSignal:r})=>{if(t<1)throw new Error("maxAttempts must be greater than 0");return(s,o)=>async function(u){let c,f=o.attemptsCount??0,p;const g=()=>{if(p)return aM(p,f),p;throw aM(c,f),c};for(;!r?.aborted&&f<t;){try{p=await s(u),c=void 0}catch(S){c=S,p=void 0}f=(o.attemptsCount??0)>f?o.attemptsCount??0:f+1,o.attemptsCount=f;const{isCredentialsExpiredError:m,retryable:y}=await e(p,c,o);if(y){if(o.isCredentialsExpired=!!m,!r?.aborted&&f<t){const S=n(f);await WW(S,r)}continue}else return g()}if(r?.aborted)throw new Error("Request aborted.");return g()}},WW=(t,e)=>{if(e?.aborted)return Promise.resolve();let n,r;const s=new Promise(o=>{r=o,n=setTimeout(o,t)});return e?.addEventListener("abort",function o(a){clearTimeout(n),e?.removeEventListener("abort",o),r()}),s},aM=(t,e)=>{Object.prototype.toString.call(t)==="[object Object]"&&(t.$metadata={...t.$metadata??{},attempts:e})},VW=Dq,GW=()=>t=>async function(n){return n.headers[oM]||(n.headers[oM]=VW()),t(n)},KW=({maxAttempts:t=y6})=>(e,n)=>async function(s){const o=n.attemptsCount??0;return s.headers[LW]=`attempt=${o+1}; max=${t}`,e(s)},YW=({userAgentHeader:t="x-amz-user-agent",userAgentValue:e=""})=>n=>async function(s){if(e.trim().length===0)return await n(s);{const o=t.toLowerCase();return s.headers[o]=s.headers[o]?`${s.headers[o]} ${e}`:e,await n(s)}},zA=(t,e)=>(n,r)=>{const s={};let o=a=>t(a,r);for(let a=e.length-1;a>=0;a--){const u=e[a];o=u(r)(o,s)}return o(n)},$1=t=>{let e;return()=>(e||(e=t()),e)},ZW=t=>!["HEAD","GET"].includes(t.toUpperCase()),XW=async({url:t,method:e,headers:n,body:r},{abortSignal:s,cache:o,withCrossDomainCredentials:a})=>{let u;try{u=await fetch(t,{method:e,headers:n,body:ZW(e)?r:void 0,signal:s,cache:o,credentials:a?"include":"same-origin"})}catch(g){throw g instanceof TypeError?new Hr({name:Pa.NetworkError,message:"A network error has occurred.",underlyingError:g}):g}const c={};u.headers?.forEach((g,m)=>{c[m.toLowerCase()]=g});const f={statusCode:u.status,headers:c,body:null},p=Object.assign(u.body??{},{text:$1(()=>u.text()),blob:$1(()=>u.blob()),json:$1(()=>u.json())});return{...f,body:p}},w6=zA(XW,[YW,GW,qW,KW]),QW=()=>t=>async function(n){return n.headers["cache-control"]="no-store",t(n)},x6=zA(w6,[QW]),_6=t=>(e,n)=>{const r=JW(t),s=JSON.stringify(e);return eV(n,r,s)},JW=t=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${t}`}),eV=({url:t},e,n)=>({headers:e,url:t,body:n,method:"POST"}),lM=t=>Rn(x6,_6("GetCredentialsForIdentity"),tV,{...C6,...t,userAgentValue:_y()}),tV=async t=>{if(t.statusCode>=300)throw await od(t);const e=await Jh(t);return{IdentityId:e.IdentityId,Credentials:nV(e.Credentials),$metadata:Ry(t)}},nV=({Expiration:t,...e}={})=>({...e,Expiration:t&&new Date(t*1e3)}),rV=t=>Rn(x6,_6("GetId"),sV,{...C6,...t,userAgentValue:_y()}),sV=async t=>{if(t.statusCode>=300)throw await od(t);return{IdentityId:(await Jh(t)).IdentityId,$metadata:Ry(t)}},A6={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},oV={partitions:[A6,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},T6=t=>{const{partitions:e}=oV;for(const{regions:n,outputs:r,regionRegex:s}of e){const o=new RegExp(s);if(n.includes(t)||o.test(t))return r.dnsSuffix}return A6.outputs.dnsSuffix},Wa=URL,iV=({region:t})=>({url:new Wa(`https://${E6}.${t}.${T6(t)}`)});class Wf extends Hr{constructor(){super({name:Pa.PlatformNotSupported,message:"Function not supported on current platform"})}}class R6{constructor(e){this.storage=e}async setItem(e,n){if(!this.storage)throw new Wf;this.storage.setItem(e,n)}async getItem(e){if(!this.storage)throw new Wf;return this.storage.getItem(e)}async removeItem(e){if(!this.storage)throw new Wf;this.storage.removeItem(e)}async clear(){if(!this.storage)throw new Wf;this.storage.clear()}}class I6{constructor(){this.storage=new Map}get length(){return this.storage.size}key(e){return e>this.length-1?null:Array.from(this.storage.keys())[e]}setItem(e,n){this.storage.set(e,n)}getItem(e){return this.storage.get(e)??null}removeItem(e){this.storage.delete(e)}clear(){this.storage.clear()}}const O6=new rr("CoreStorageUtils"),aV=()=>{try{if(typeof window<"u"&&window.localStorage)return window.localStorage}catch{O6.info("localStorage not found. InMemoryStorage is used as a fallback.")}return new I6},N6=()=>{try{if(typeof window<"u"&&window.sessionStorage)return window.sessionStorage.getItem("test"),window.sessionStorage;throw new Error("sessionStorage is not defined")}catch{return O6.info("sessionStorage not found. InMemoryStorage is used as a fallback."),new I6}};class lV extends R6{constructor(){super(aV())}}class uV extends R6{constructor(){super(N6())}}class cV{constructor(e){this._storage=e}get storage(){if(!this._storage)throw new Wf;return this._storage}setItem(e,n){this.storage.setItem(e,n)}getItem(e){return this.storage.getItem(e)}removeItem(e){this.storage.removeItem(e)}clear(){this.storage.clear()}}class dV extends cV{constructor(){super(N6())}}function Ug(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)r!=="__proto__"&&(t[r]=n[r])}return t}var fV={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Lx(t,e){function n(s,o,a){if(!(typeof document>"u")){a=Ug({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),s=encodeURIComponent(s).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var u="";for(var c in a)a[c]&&(u+="; "+c,a[c]!==!0&&(u+="="+a[c].split(";")[0]));return document.cookie=s+"="+t.write(o,s)+u}}function r(s){if(!(typeof document>"u"||arguments.length&&!s)){for(var o=document.cookie?document.cookie.split("; "):[],a={},u=0;u<o.length;u++){var c=o[u].split("="),f=c.slice(1).join("=");try{var p=decodeURIComponent(c[0]);if(p in a||(a[p]=t.read(f,p)),s===p)break}catch{}}return s?a[s]:a}}return Object.create({set:n,get:r,remove:function(s,o){n(s,"",Ug({},o,{expires:-1}))},withAttributes:function(s){return Lx(this.converter,Ug({},this.attributes,s))},withConverter:function(s){return Lx(Ug({},this.converter,s),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var Fg=Lx(fV,{path:"/"});class hV{constructor(e={}){const{path:n,domain:r,expires:s,sameSite:o,secure:a}=e;if(this.domain=r,this.path=n||"/",this.expires=Object.prototype.hasOwnProperty.call(e,"expires")?s:365,this.secure=Object.prototype.hasOwnProperty.call(e,"secure")?a:!0,Object.prototype.hasOwnProperty.call(e,"sameSite")){if(!o||!["strict","lax","none"].includes(o))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if(o==="none"&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=o}}async setItem(e,n){Fg.set(e,n,this.getData())}async getItem(e){return Fg.get(e)??null}async removeItem(e){Fg.remove(e,this.getData())}async clear(){const e=Fg.get(),n=Object.keys(e).map(r=>this.removeItem(r));await Promise.all(n)}getData(){return{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure,...this.sameSite&&{sameSite:this.sameSite}}}}const ep=new lV;new uV;const ci=new dV,pV=new rr("I18n");let gV=class{constructor(){this._options=null,this._lang=null,this._dict={}}setDefaultLanguage(){!this._lang&&typeof window<"u"&&window&&window.navigator&&(this._lang=window.navigator.language),pV.debug(this._lang)}setLanguage(e){this._lang=e}get(e,n=void 0){if(this.setDefaultLanguage(),!this._lang)return typeof n<"u"?n:e;const r=this._lang;let s=this.getByLanguage(e,r);return s||(r.indexOf("-")>0&&(s=this.getByLanguage(e,r.split("-")[0])),s)?s:typeof n<"u"?n:e}getByLanguage(e,n,r=null){if(!n)return r;const s=this._dict[n];return s?s[e]:r}putVocabulariesForLanguage(e,n){let r=this._dict[e];r||(r=this._dict[e]={}),this._dict[e]={...r,...n}}putVocabularies(e){Object.keys(e).forEach(n=>{this.putVocabulariesForLanguage(n,e[n])})}};var Cl;(function(t){t.NotConfigured="NotConfigured"})(Cl||(Cl={}));const mV={[Cl.NotConfigured]:{message:"i18n is not configured."}},zg=Cy(mV),uM=new rr("I18n");let jg={language:null},js=null,M6=class bl{static configure(e){return uM.debug("configure I18n"),e&&(jg=Object.assign({},jg,e.I18n||e),bl.createInstance()),jg}static getModuleName(){return"I18n"}static createInstance(){uM.debug("create I18n instance"),!js&&(js=new gV)}static setLanguage(e){bl.checkConfig(),zg(!!js,Cl.NotConfigured),js.setLanguage(e)}static get(e,n){return bl.checkConfig(),zg(!!js,Cl.NotConfigured),js.get(e,n)}static putVocabulariesForLanguage(e,n){bl.checkConfig(),zg(!!js,Cl.NotConfigured),js.putVocabulariesForLanguage(e,n)}static putVocabularies(e){bl.checkConfig(),zg(!!js,Cl.NotConfigured),js.putVocabularies(e)}static checkConfig(){return js||bl.createInstance(),!0}};M6.createInstance();const vV=t=>{const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=[],r=new Uint8Array(t);DA().getRandomValues(r);for(const s of r)n.push(e[s%e.length]);return n.join("")};function yV(t){return(t.match(/.{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("")}function bV(t){return t.split("").map(e=>e.charCodeAt(0).toString(16).padStart(2,"0")).join("")}const SV=t=>{let e;return async(...n)=>e||(e=new Promise((r,s)=>{t(...n).then(o=>{r(o)}).catch(o=>{s(o)}).finally(()=>{e=void 0})}),e)};function cM({expiresAt:t,clockDrift:e,tolerance:n=5e3}){return Date.now()+e+n>t}const EV=async()=>{const{userAgentData:t}=navigator;if(!t)return navigator.userAgent;const{platform:e="",platformVersion:n="",model:r="",architecture:s="",fullVersionList:o=[]}=await t.getHighEntropyValues(["platform","platformVersion","architecture","model","fullVersionList"]),a=o.map(c=>`${c.brand}/${c.version}`).join(";");return[e,n,s,r,e,a].filter(c=>c).join(" ")||navigator.userAgent};function CV(t){return Array.from(t,e=>String.fromCodePoint(e)).join("")}const Fc={convert(t,e={urlSafe:!1,skipPadding:!1}){const n=typeof t=="string"?t:CV(t);let r=wq()(n);return e.urlSafe&&(r=r.replace(/\+/g,"-").replace(/\//g,"_")),e.skipPadding&&(r=r.replace(/=/g,"")),r}};function wV(){return DA().getRandomValues(new Uint32Array(1))[0]}function xV(t){const{words:e}=t,{sigBytes:n}=t,r=[];for(let s=0;s<n;s++){const o=e[s>>>2]>>>24-s%4*8&255;r.push((o>>>4).toString(16)),r.push((o&15).toString(16))}return r.join("")}class jA{constructor(e,n){this.words=[];let r=e;r=this.words=r||[],n!==void 0?this.sigBytes=n:this.sigBytes=r.length*4}random(e){const n=[];for(let r=0;r<e;r+=4)n.push(wV());return new jA(n,e)}toString(){return xV(this)}}var Ge;(function(t){t.EmptySignInUsername="EmptySignInUsername",t.EmptySignInPassword="EmptySignInPassword",t.CustomAuthSignInPassword="CustomAuthSignInPassword",t.EmptySignUpUsername="EmptySignUpUsername",t.EmptySignUpPassword="EmptySignUpPassword",t.EmptyConfirmSignUpUsername="EmptyConfirmSignUpUsername",t.EmptyConfirmSignUpCode="EmptyConfirmSignUpCode",t.EmptyResendSignUpCodeUsername="EmptyresendSignUpCodeUsername",t.EmptyChallengeResponse="EmptyChallengeResponse",t.EmptyConfirmResetPasswordUsername="EmptyConfirmResetPasswordUsername",t.EmptyConfirmResetPasswordNewPassword="EmptyConfirmResetPasswordNewPassword",t.EmptyConfirmResetPasswordConfirmationCode="EmptyConfirmResetPasswordConfirmationCode",t.EmptyResetPasswordUsername="EmptyResetPasswordUsername",t.EmptyVerifyTOTPSetupCode="EmptyVerifyTOTPSetupCode",t.EmptyConfirmUserAttributeCode="EmptyConfirmUserAttributeCode",t.IncorrectMFAMethod="IncorrectMFAMethod",t.EmptyUpdatePassword="EmptyUpdatePassword",t.InvalidPreferredChallenge="InvalidPreferredChallenge"})(Ge||(Ge={}));const P6={[Ge.EmptyChallengeResponse]:{message:"challengeResponse is required to confirmSignIn"},[Ge.EmptyConfirmResetPasswordUsername]:{message:"username is required to confirmResetPassword"},[Ge.EmptyConfirmSignUpCode]:{message:"code is required to confirmSignUp"},[Ge.EmptyConfirmSignUpUsername]:{message:"username is required to confirmSignUp"},[Ge.EmptyConfirmResetPasswordConfirmationCode]:{message:"confirmationCode is required to confirmResetPassword"},[Ge.EmptyConfirmResetPasswordNewPassword]:{message:"newPassword is required to confirmResetPassword"},[Ge.EmptyResendSignUpCodeUsername]:{message:"username is required to confirmSignUp"},[Ge.EmptyResetPasswordUsername]:{message:"username is required to resetPassword"},[Ge.EmptySignInPassword]:{message:"password is required to signIn"},[Ge.EmptySignInUsername]:{message:"username is required to signIn"},[Ge.EmptySignUpPassword]:{message:"password is required to signUp"},[Ge.EmptySignUpUsername]:{message:"username is required to signUp"},[Ge.CustomAuthSignInPassword]:{message:"A password is not needed when signing in with CUSTOM_WITHOUT_SRP",recoverySuggestion:"Do not include a password in your signIn call."},[Ge.IncorrectMFAMethod]:{message:"Incorrect MFA method was chosen. It should be either SMS, TOTP, or EMAIL",recoverySuggestion:"Try to pass SMS, TOTP, or EMAIL as the challengeResponse"},[Ge.EmptyVerifyTOTPSetupCode]:{message:"code is required to verifyTotpSetup"},[Ge.EmptyUpdatePassword]:{message:"oldPassword and newPassword are required to changePassword"},[Ge.EmptyConfirmUserAttributeCode]:{message:"confirmation code is required to confirmUserAttribute"},[Ge.InvalidPreferredChallenge]:{message:"The preferred challenge is not enabled in your backend configuration",recoverySuggestion:"Ensure the authentication method is enabled in your Amplify backend configuration"}};var jn;(function(t){t.DEFAULT_MSG="Authentication Error",t.EMPTY_EMAIL="Email cannot be empty",t.EMPTY_PHONE="Phone number cannot be empty",t.EMPTY_USERNAME="Username cannot be empty",t.INVALID_USERNAME="The username should either be a string or one of the sign in types",t.EMPTY_PASSWORD="Password cannot be empty",t.EMPTY_CODE="Confirmation code cannot be empty",t.SIGN_UP_ERROR="Error creating account",t.NO_MFA="No valid MFA method provided",t.INVALID_MFA="Invalid MFA type",t.EMPTY_CHALLENGE="Challenge response cannot be empty",t.NO_USER_SESSION="Failed to get the session because the user is empty",t.NETWORK_ERROR="Network Error",t.DEVICE_CONFIG="Device tracking has not been configured in this User Pool",t.AUTOSIGNIN_ERROR="Please use your credentials to sign in",t.OAUTH_ERROR="Couldn't finish OAuth flow, check your User Pool HostedUI settings"})(jn||(jn={}));var To;(function(t){t.SignInException="SignInException",t.OAuthSignInError="OAuthSignInException"})(To||(To={}));class Le extends Hr{constructor(e){super(e),this.constructor=Le,Object.setPrototypeOf(this,Le.prototype)}}function fn(t,e){const{message:n,recoverySuggestion:r}=P6[e];if(!t)throw new Le({name:e,message:n,recoverySuggestion:r})}function yt(t){const e=t?.split("_")[0];if(!t||t.indexOf("_")<0||!e||typeof e!="string")throw new Le({name:"InvalidUserPoolId",message:"Invalid user pool id provided."});return e}function Ux(t){if(!t||!t.includes(":"))throw new Le({name:"InvalidIdentityPoolIdException",message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."});return t.split(":")[0]}function dM(t){return Object.entries(t).map(([e,n])=>({Name:e,Value:n}))}function _V(t){const e={};return t?.forEach(n=>{n.Name&&(e[n.Name]=n.Value)}),e}var fM;(function(t){t.ConcurrentModificationException="ConcurrentModificationException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceNotFoundException="ResourceNotFoundException",t.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException"})(fM||(fM={}));var hM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.InvalidPasswordException="InvalidPasswordException",t.LimitExceededException="LimitExceededException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(hM||(hM={}));var pM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidPasswordException="InvalidPasswordException",t.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UsernameExistsException="UsernameExistsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(pM||(pM={}));var gM;(function(t){t.CodeMismatchException="CodeMismatchException",t.ExpiredCodeException="ExpiredCodeException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidPasswordException="InvalidPasswordException",t.LimitExceededException="LimitExceededException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyFailedAttemptsException="TooManyFailedAttemptsException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(gM||(gM={}));var mM;(function(t){t.AliasExistsException="AliasExistsException",t.CodeMismatchException="CodeMismatchException",t.ExpiredCodeException="ExpiredCodeException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.LimitExceededException="LimitExceededException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyFailedAttemptsException="TooManyFailedAttemptsException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotFoundException="UserNotFoundException"})(mM||(mM={}));var vM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(vM||(vM={}));var yM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(yM||(yM={}));var bM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(bM||(bM={}));var SM;(function(t){t.CodeDeliveryFailureException="CodeDeliveryFailureException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",t.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",t.LimitExceededException="LimitExceededException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotFoundException="UserNotFoundException"})(SM||(SM={}));var EM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(EM||(EM={}));var CM;(function(t){t.ExternalServiceException="ExternalServiceException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.LimitExceededException="LimitExceededException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceConflictException="ResourceConflictException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException"})(CM||(CM={}));var wM;(function(t){t.ExternalServiceException="ExternalServiceException",t.InternalErrorException="InternalErrorException",t.InvalidIdentityPoolConfigurationException="InvalidIdentityPoolConfigurationException",t.InvalidParameterException="InvalidParameterException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceConflictException="ResourceConflictException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException"})(wM||(wM={}));var xM;(function(t){t.CodeDeliveryFailureException="CodeDeliveryFailureException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",t.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",t.LimitExceededException="LimitExceededException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(xM||(xM={}));var _M;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException"})(_M||(_M={}));var bv;(function(t){t.PasswordResetRequiredException="PasswordResetRequiredException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",t.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",t.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(bv||(bv={}));var AM;(function(t){t.CodeDeliveryFailureException="CodeDeliveryFailureException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",t.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",t.LimitExceededException="LimitExceededException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotFoundException="UserNotFoundException"})(AM||(AM={}));var TM;(function(t){t.AliasExistsException="AliasExistsException",t.CodeMismatchException="CodeMismatchException",t.ExpiredCodeException="ExpiredCodeException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidPasswordException="InvalidPasswordException",t.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",t.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",t.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",t.MFAMethodNotFoundException="MFAMethodNotFoundException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(TM||(TM={}));var RM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(RM||(RM={}));var Fx;(function(t){t.CodeDeliveryFailureException="CodeDeliveryFailureException",t.InternalErrorException="InternalErrorException",t.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidPasswordException="InvalidPasswordException",t.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",t.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UsernameExistsException="UsernameExistsException"})(Fx||(Fx={}));var IM;(function(t){t.AliasExistsException="AliasExistsException",t.CodeDeliveryFailureException="CodeDeliveryFailureException",t.CodeMismatchException="CodeMismatchException",t.ExpiredCodeException="ExpiredCodeException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",t.InvalidLambdaResponseException="InvalidLambdaResponseException",t.InvalidParameterException="InvalidParameterException",t.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",t.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(IM||(IM={}));var OM;(function(t){t.CodeMismatchException="CodeMismatchException",t.EnableSoftwareTokenMFAException="EnableSoftwareTokenMFAException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(OM||(OM={}));var NM;(function(t){t.AliasExistsException="AliasExistsException",t.CodeMismatchException="CodeMismatchException",t.ExpiredCodeException="ExpiredCodeException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.LimitExceededException="LimitExceededException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(NM||(NM={}));var MM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(MM||(MM={}));var PM;(function(t){t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",t.NotAuthorizedException="NotAuthorizedException",t.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(PM||(PM={}));const Iy="UserUnAuthenticatedException",AV="UserAlreadyAuthenticatedException",TV="DeviceMetadataNotFoundException",k6="AutoSignInException",RV="InvalidRedirectException",IV="InvalidAppSchemeException",OV="InvalidPreferredRedirectUrlException",NV=new Le({name:RV,message:"signInRedirect or signOutRedirect had an invalid format or was not found.",recoverySuggestion:"Please make sure the signIn/Out redirect in your oauth config is valid."});new Le({name:IV,message:"A valid non-http app scheme was not found in the config.",recoverySuggestion:"Please make sure a valid custom app scheme is present in the config."});new Le({name:OV,message:"The given preferredRedirectUrl does not match any items in the redirectSignOutUrls array from the config.",recoverySuggestion:"Please make sure a matching preferredRedirectUrl is provided."});const MV="InvalidOriginException",PV=new Le({name:MV,message:"redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin",recoverySuggestion:"Please call signInWithRedirect from the same origin."}),kV="OAuthSignOutException",DV="TokenRefreshException",LV="UnexpectedSignInInterruptionException";function id(t){if(!t||!t.accessToken)throw new Le({name:Iy,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}function UV(t){if(!t||!t.idToken)throw new Le({name:Iy,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}const FV=new Le({name:DV,message:`Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow.
3
3
  Please change your oauth configuration to use 'code grant' flow.`,recoverySuggestion:`Please logout and change your Amplify configuration to use "code grant" flow.
4
4
  E.g { responseType: 'code' }`}),zV=new Le({name:Iy,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function D6(t){if(HV(t))throw FV;if(!BV(t))throw zV}function L6(t){if(!t||!t.deviceKey||!t.deviceGroupKey||!t.randomPassword)throw new Le({name:TV,message:"Either deviceKey, deviceGroupKey or secretPassword were not found during the sign-in process.",recoverySuggestion:"Make sure to not clear storage after calling the signIn API."})}const jV={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function U6(t){return t?.accessToken||t?.idToken}function BV(t){return U6(t)&&t?.refreshToken}function HV(t){return U6(t)&&!t?.refreshToken}const $V=async t=>{const e=t.getConfig().Auth?.Cognito;lt(e);const n=await t.Auth.getTokens({forceRefresh:!1});id(n);const{"cognito:username":r,sub:s}=n.idToken?.payload??{},o={username:r,userId:s},a=qV(n);return a&&(o.signInDetails=a),o};function qV(t){return t?.signInDetails}const Oy=async()=>$V(Ht),Nt=(t,e)=>_y({category:Is.Auth,action:t,...e}),Hn=t=>(e,n)=>{const r=WV(t),s=JSON.stringify(e);return VV(n,r,s)},WV=t=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProviderService.${t}`}),VV=({url:t},e,n)=>({headers:e,url:t,body:n,method:"POST"});function Os(t){if(!t||t.name==="Error"||t instanceof TypeError)throw new Le({name:Pa.Unknown,message:"An unknown error has occurred.",underlyingError:t})}const ir=()=>async t=>{if(t.statusCode>=300){const e=await od(t);throw Os(e),new Le({name:e.name,message:e.message,metadata:e.$metadata})}return Jh(t)},GV=()=>(t,e)=>async function(r){return r.headers={...r.headers,"cache-control":"no-store",...await Ht.libraryOptions?.Auth?.headers?.()},t(r)},$n=zA(w6,[GV]),F6="cognito-idp",qn={service:F6,retryDecider:S6(od),computeDelay:b6,get userAgentValue(){return _y()},cache:"no-store"},tp=t=>Rn($n,Hn("InitiateAuth"),ir(),{...qn,...t}),as=t=>Rn($n,Hn("RespondToAuthChallenge"),ir(),{...qn,...t}),KV=t=>Rn($n,Hn("VerifySoftwareToken"),ir(),{...qn,...t}),YV=t=>Rn($n,Hn("AssociateSoftwareToken"),ir(),{...qn,...t}),ZV=({region:t})=>({url:new Wa(`https://${F6}.${t}.${T6(t)}`)}),bt=({endpointOverride:t})=>e=>t?{url:new Wa(t)}:ZV(e),XV=t=>Rn($n,Hn("GetTokensFromRefreshToken"),ir(),{...qn,...t}),QV=async({tokens:t,authConfig:e,username:n,clientMetadata:r})=>{lt(e?.Cognito);const{userPoolId:s,userPoolClientId:o,userPoolEndpoint:a}=e.Cognito,u=yt(s);D6(t);const c=XV({endpointResolver:bt({endpointOverride:a})}),{AuthenticationResult:f}=await c({region:u},{ClientId:o,RefreshToken:t.refreshToken,DeviceKey:t.deviceMetadata?.deviceKey,ClientMetadata:r}),p=gi(f?.AccessToken??""),g=f?.IdToken?gi(f.IdToken):void 0,{iat:m}=p.payload;if(!m)throw new Le({name:"iatNotFoundException",message:"iat not found in access token"});const y=m*1e3-new Date().getTime();return{accessToken:p,idToken:g,clockDrift:y,refreshToken:f?.RefreshToken??t.refreshToken,username:n}},JV=SV(QV),eG={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetails:"signInDetails",oauthMetadata:"oauthMetadata"};var Sv;(function(t){t.InvalidAuthTokens="InvalidAuthTokens"})(Sv||(Sv={}));const tG={[Sv.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},nG=Cy(tG),kM="CognitoIdentityServiceProvider";class rG{getKeyValueStorage(){if(!this.keyValueStorage)throw new Le({name:"KeyValueStorageNotFoundException",message:"KeyValueStorage was not found in TokenStore"});return this.keyValueStorage}setKeyValueStorage(e){this.keyValueStorage=e}setAuthConfig(e){this.authConfig=e}async loadTokens(){try{const e=await this.getAuthKeys(),n=await this.getKeyValueStorage().getItem(e.accessToken);if(!n)throw new Le({name:"NoSessionFoundException",message:"Auth session was not found. Make sure to call signIn."});const r=gi(n),s=await this.getKeyValueStorage().getItem(e.idToken),o=s?gi(s):void 0,a=await this.getKeyValueStorage().getItem(e.refreshToken)??void 0,u=await this.getKeyValueStorage().getItem(e.clockDrift)??"0",c=Number.parseInt(u),f=await this.getKeyValueStorage().getItem(e.signInDetails),p={accessToken:r,idToken:o,refreshToken:a,deviceMetadata:await this.getDeviceMetadata()??void 0,clockDrift:c,username:await this.getLastAuthUser()};return f&&(p.signInDetails=JSON.parse(f)),p}catch{return null}}async storeTokens(e){nG(e!==void 0,Sv.InvalidAuthTokens);const n=e.username;await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(),n);const r=await this.getAuthKeys();await this.getKeyValueStorage().setItem(r.accessToken,e.accessToken.toString()),e.idToken?await this.getKeyValueStorage().setItem(r.idToken,e.idToken.toString()):await this.getKeyValueStorage().removeItem(r.idToken),e.refreshToken?await this.getKeyValueStorage().setItem(r.refreshToken,e.refreshToken):await this.getKeyValueStorage().removeItem(r.refreshToken),e.deviceMetadata&&(e.deviceMetadata.deviceKey&&await this.getKeyValueStorage().setItem(r.deviceKey,e.deviceMetadata.deviceKey),e.deviceMetadata.deviceGroupKey&&await this.getKeyValueStorage().setItem(r.deviceGroupKey,e.deviceMetadata.deviceGroupKey),await this.getKeyValueStorage().setItem(r.randomPasswordKey,e.deviceMetadata.randomPassword)),e.signInDetails?await this.getKeyValueStorage().setItem(r.signInDetails,JSON.stringify(e.signInDetails)):await this.getKeyValueStorage().removeItem(r.signInDetails),await this.getKeyValueStorage().setItem(r.clockDrift,`${e.clockDrift}`)}async clearTokens(){const e=await this.getAuthKeys();await Promise.all([this.getKeyValueStorage().removeItem(e.accessToken),this.getKeyValueStorage().removeItem(e.idToken),this.getKeyValueStorage().removeItem(e.clockDrift),this.getKeyValueStorage().removeItem(e.refreshToken),this.getKeyValueStorage().removeItem(e.signInDetails),this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),this.getKeyValueStorage().removeItem(e.oauthMetadata)])}async getDeviceMetadata(e){const n=await this.getAuthKeys(e),r=await this.getKeyValueStorage().getItem(n.deviceKey),s=await this.getKeyValueStorage().getItem(n.deviceGroupKey),o=await this.getKeyValueStorage().getItem(n.randomPasswordKey);return o&&s&&r?{deviceKey:r,deviceGroupKey:s,randomPassword:o}:null}async clearDeviceMetadata(e){const n=await this.getAuthKeys(e);await Promise.all([this.getKeyValueStorage().removeItem(n.deviceKey),this.getKeyValueStorage().removeItem(n.deviceGroupKey),this.getKeyValueStorage().removeItem(n.randomPasswordKey)])}async getAuthKeys(e){lt(this.authConfig?.Cognito);const n=e??await this.getLastAuthUser();return sG(kM,`${this.authConfig.Cognito.userPoolClientId}.${n}`)}getLastAuthUserKey(){lt(this.authConfig?.Cognito);const e=this.authConfig.Cognito.userPoolClientId;return`${kM}.${e}.LastAuthUser`}async getLastAuthUser(){return await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())??"username"}async setOAuthMetadata(e){const{oauthMetadata:n}=await this.getAuthKeys();await this.getKeyValueStorage().setItem(n,JSON.stringify(e))}async getOAuthMetadata(){const{oauthMetadata:e}=await this.getAuthKeys(),n=await this.getKeyValueStorage().getItem(e);return n&&JSON.parse(n)}}const sG=(t,e)=>BA(eG)(`${t}`,e);function BA(t){const e=Object.values({...t});return(n,r)=>e.reduce((s,o)=>({...s,[o]:`${n}.${r}.${o}`}),{})}const DM="amplify-signin-with-hostedUI",ho="CognitoIdentityServiceProvider";class z6{constructor(e){this.keyValueStorage=e}async clearOAuthInflightData(){lt(this.cognitoConfig);const e=po(ho,this.cognitoConfig.userPoolClientId);await Promise.all([this.keyValueStorage.removeItem(e.inflightOAuth),this.keyValueStorage.removeItem(e.oauthPKCE),this.keyValueStorage.removeItem(e.oauthState)])}async clearOAuthData(){lt(this.cognitoConfig);const e=po(ho,this.cognitoConfig.userPoolClientId);return await this.clearOAuthInflightData(),await this.keyValueStorage.removeItem(DM),this.keyValueStorage.removeItem(e.oauthSignIn)}loadOAuthState(){lt(this.cognitoConfig);const e=po(ho,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(e.oauthState)}storeOAuthState(e){lt(this.cognitoConfig);const n=po(ho,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(n.oauthState,e)}loadPKCE(){lt(this.cognitoConfig);const e=po(ho,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(e.oauthPKCE)}storePKCE(e){lt(this.cognitoConfig);const n=po(ho,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(n.oauthPKCE,e)}setAuthConfig(e){this.cognitoConfig=e}async loadOAuthInFlight(){lt(this.cognitoConfig);const e=po(ho,this.cognitoConfig.userPoolClientId);return await this.keyValueStorage.getItem(e.inflightOAuth)==="true"}async storeOAuthInFlight(e){lt(this.cognitoConfig);const n=po(ho,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(n.inflightOAuth,`${e}`)}async loadOAuthSignIn(){lt(this.cognitoConfig);const e=po(ho,this.cognitoConfig.userPoolClientId),n=await this.keyValueStorage.getItem(DM),[r,s]=(await this.keyValueStorage.getItem(e.oauthSignIn))?.split(",")??[];return{isOAuthSignIn:r==="true"||n==="true",preferPrivateSession:s==="true"}}async storeOAuthSignIn(e,n=!1){lt(this.cognitoConfig);const r=po(ho,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(r.oauthSignIn,`${e},${n}`)}}const po=(t,e)=>BA(jV)(t,e),Fr=new z6(ep),zx=[],oG=t=>{zx.push(t)},j6=()=>{for(;zx.length;)zx.pop()?.()};class iG{constructor(){this.waitForInflightOAuth=Ay()?async()=>{if(await Fr.loadOAuthInFlight())return this.inflightPromise?this.inflightPromise:(this.inflightPromise=new Promise((e,n)=>{oG(e)}),this.inflightPromise)}:async()=>{}}setAuthConfig(e){Fr.setAuthConfig(e.Cognito),this.authConfig=e}setTokenRefresher(e){this.tokenRefresher=e}setAuthTokenStore(e){this.tokenStore=e}getTokenStore(){if(!this.tokenStore)throw new Le({name:"EmptyTokenStoreException",message:"TokenStore not set"});return this.tokenStore}getTokenRefresher(){if(!this.tokenRefresher)throw new Le({name:"EmptyTokenRefresherException",message:"TokenRefresher not set"});return this.tokenRefresher}setClientMetadataProvider(e){this.clientMetadataProvider=e}async getTokens(e){let n;try{lt(this.authConfig?.Cognito)}catch{return null}await this.waitForInflightOAuth(),this.inflightPromise=void 0,n=await this.getTokenStore().loadTokens();const r=await this.getTokenStore().getLastAuthUser();if(n===null)return null;const s=!!n?.idToken&&cM({expiresAt:(n.idToken?.payload?.exp??0)*1e3,clockDrift:n.clockDrift??0}),o=cM({expiresAt:(n.accessToken?.payload?.exp??0)*1e3,clockDrift:n.clockDrift??0});return(e?.forceRefresh||s||o)&&(n=await this.refreshTokens({tokens:n,username:r,clientMetadata:e?.clientMetadata??await this.clientMetadataProvider?.()}),n===null)?null:{accessToken:n?.accessToken,idToken:n?.idToken,signInDetails:n?.signInDetails}}async refreshTokens({tokens:e,username:n,clientMetadata:r}){try{const{signInDetails:s}=e,o=await this.getTokenRefresher()({tokens:e,authConfig:this.authConfig,username:n,clientMetadata:r});return o.signInDetails=s,await this.setTokens({tokens:o}),Ao.dispatch("auth",{event:"tokenRefresh"},"Auth",_o),o}catch(s){return this.handleErrors(s)}}handleErrors(e){if(Os(e),this.isAuthenticationError(e)&&this.clearTokens(),Ao.dispatch("auth",{event:"tokenRefresh_failure",data:{error:e}},"Auth",_o),e.name.startsWith("NotAuthorizedException"))return null;throw e}isAuthenticationError(e){return["NotAuthorizedException","TokenRevokedException","UserNotFoundException","PasswordResetRequiredException","UserNotConfirmedException","RefreshTokenReuseException"].some(r=>e?.name?.startsWith?.(r))}async setTokens({tokens:e}){return this.getTokenStore().storeTokens(e)}async clearTokens(){return this.getTokenStore().clearTokens()}getDeviceMetadata(e){return this.getTokenStore().getDeviceMetadata(e)}clearDeviceMetadata(e){return this.getTokenStore().clearDeviceMetadata(e)}setOAuthMetadata(e){return this.getTokenStore().setOAuthMetadata(e)}getOAuthMetadata(){return this.getTokenStore().getOAuthMetadata()}}class aG{constructor(){this.authTokenStore=new rG,this.authTokenStore.setKeyValueStorage(ep),this.tokenOrchestrator=new iG,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(JV)}getTokens(e={}){return this.tokenOrchestrator.getTokens(e)}setKeyValueStorage(e){this.authTokenStore.setKeyValueStorage(e)}setClientMetadataProvider(e){this.tokenOrchestrator.setClientMetadataProvider(e)}setAuthConfig(e){this.authTokenStore.setAuthConfig(e),this.tokenOrchestrator.setAuthConfig(e)}}const Vm=new aG,{tokenOrchestrator:$r}=Vm;async function _i(t){if(t.AccessToken){const e=gi(t.AccessToken),n=(e.payload.iat||0)*1e3,r=new Date().getTime(),s=n>0?n-r:0;let o,a,u;t.RefreshToken&&(a=t.RefreshToken),t.IdToken&&(o=gi(t.IdToken)),t?.NewDeviceMetadata&&(u=t.NewDeviceMetadata);const c={accessToken:e,idToken:o,refreshToken:a,clockDrift:s,deviceMetadata:u,username:t.username};t?.signInDetails&&(c.signInDetails=t.signInDetails),await $r.setTokens({tokens:c})}else throw new Hr({message:"Invalid tokens",name:"InvalidTokens",recoverySuggestion:"Check Cognito UserPool settings"})}const lG="Unable to get user session following successful sign-in.",Va=async()=>{try{Ao.dispatch("auth",{event:"signedIn",data:await Oy()},"Auth",_o)}catch(t){throw t.name===Iy?new Le({name:LV,message:lG,recoverySuggestion:"This most likely is due to auth tokens not being persisted. If you are using cookie store, please ensure cookies can be correctly set from your server."}):t}};function B6(){return{active:!1}}const uG=(t,e)=>{switch(e.type){case"SET_USERNAME":return{...t,username:e.value};case"SET_SESSION":return{...t,session:e.value};case"START":return{...t,active:!0};case"RESET":return B6();default:return t}},cG=t=>{let e=t(B6(),{type:"RESET"});return{getState:()=>e,dispatch:n=>{e=t(e,n)}}},Aa=cG(uG),dG=180*1e3,Bg="CognitoSignInState",di={username:`${Bg}.username`,challengeName:`${Bg}.challengeName`,signInSession:`${Bg}.signInSession`,expiry:`${Bg}.expiry`},fG=(t,e)=>{switch(e.type){case"SET_SIGN_IN_SESSION":return Hg({signInSession:e.value}),{...t,signInSession:e.value};case"SET_SIGN_IN_STATE":return Hg(e.value),{...e.value};case"SET_CHALLENGE_NAME":return Hg({challengeName:e.value}),{...t,challengeName:e.value};case"SET_USERNAME":return Hg({username:e.value}),{...t,username:e.value};case"SET_INITIAL_STATE":return pG();case"RESET_STATE":return H6(),HA();default:return t}},hG=t=>{const e=Number(t),n=Date.now();return e<=n},Qs=()=>{Ro.dispatch({type:"RESET_STATE"})},H6=()=>{for(const t of Object.values(di))ci.removeItem(t)},HA=()=>({username:void 0,challengeName:void 0,signInSession:void 0}),pG=()=>{const t=ci.getItem(di.expiry);if(!t||hG(t))return H6(),HA();const e=ci.getItem(di.username)??void 0,n=ci.getItem(di.challengeName)??void 0,r=ci.getItem(di.signInSession)??void 0;return{username:e,challengeName:n,signInSession:r}},gG=t=>{let e=t(HA(),{type:"SET_INITIAL_STATE"});return{getState:()=>e,dispatch:n=>{e=t(e,n)}}},Ro=gG(fG);function eu(t){Ro.dispatch({type:"SET_SIGN_IN_STATE",value:t})}const Hg=({challengeName:t,signInSession:e,username:n})=>{n&&ci.setItem(di.username,n),t&&ci.setItem(di.challengeName,t),e&&(ci.setItem(di.signInSession,e),ci.setItem(di.expiry,String(Date.now()+dG)))},LM="Passkeys may not be supported on this device. Ensure your application is running in a secure context (HTTPS) and Web Authentication API is supported.";class Rs extends Hr{constructor(e){super(e),this.constructor=Rs,Object.setPrototypeOf(this,Rs.prototype)}}var jt;(function(t){t.PasskeyNotSupported="PasskeyNotSupported",t.PasskeyAlreadyExists="PasskeyAlreadyExists",t.InvalidPasskeyRegistrationOptions="InvalidPasskeyRegistrationOptions",t.InvalidPasskeyAuthenticationOptions="InvalidPasskeyAuthenticationOptions",t.RelyingPartyMismatch="RelyingPartyMismatch",t.PasskeyRegistrationFailed="PasskeyRegistrationFailed",t.PasskeyRetrievalFailed="PasskeyRetrievalFailed",t.PasskeyRegistrationCanceled="PasskeyRegistrationCanceled",t.PasskeyAuthenticationCanceled="PasskeyAuthenticationCanceled",t.PasskeyOperationAborted="PasskeyOperationAborted"})(jt||(jt={}));const q1="User may have canceled the ceremony or another interruption has occurred. Check underlying error for details.",UM="Ensure your user pool is configured to support the WEB_AUTHN as an authentication factor.",zc={[jt.PasskeyNotSupported]:{message:"Passkeys may not be supported on this device.",recoverySuggestion:LM},[jt.InvalidPasskeyRegistrationOptions]:{message:"Invalid passkey registration options.",recoverySuggestion:UM},[jt.InvalidPasskeyAuthenticationOptions]:{message:"Invalid passkey authentication options.",recoverySuggestion:UM},[jt.PasskeyRegistrationFailed]:{message:"Device failed to create passkey.",recoverySuggestion:LM},[jt.PasskeyRetrievalFailed]:{message:"Device failed to retrieve passkey.",recoverySuggestion:"Passkeys may not be available on this device. Try an alternative authentication factor like PASSWORD, EMAIL_OTP, or SMS_OTP."},[jt.PasskeyAlreadyExists]:{message:"Passkey already exists in authenticator.",recoverySuggestion:"Proceed with existing passkey or try again after deleting the credential."},[jt.PasskeyRegistrationCanceled]:{message:"Passkey registration ceremony has been canceled.",recoverySuggestion:q1},[jt.PasskeyAuthenticationCanceled]:{message:"Passkey authentication ceremony has been canceled.",recoverySuggestion:q1},[jt.PasskeyOperationAborted]:{message:"Passkey operation has been aborted.",recoverySuggestion:q1},[jt.RelyingPartyMismatch]:{message:"Relying party does not match current domain.",recoverySuggestion:"Ensure relying party identifier matches current domain."}},ad=Cy(zc,Rs),$6=t=>{if(t instanceof Error){if(t.name==="AbortError"){const{message:e,recoverySuggestion:n}=zc[jt.PasskeyOperationAborted];return new Rs({name:jt.PasskeyOperationAborted,message:e,recoverySuggestion:n,underlyingError:t})}if(t.name==="SecurityError"){const{message:e,recoverySuggestion:n}=zc[jt.RelyingPartyMismatch];return new Rs({name:jt.RelyingPartyMismatch,message:e,recoverySuggestion:n,underlyingError:t})}}return new Rs({name:Pa.Unknown,message:"An unknown error has occurred.",underlyingError:t})},mG=t=>{if(t instanceof Rs)return t;if(t instanceof Error&&t.name==="NotAllowedError"){const{message:e,recoverySuggestion:n}=zc[jt.PasskeyAuthenticationCanceled];return new Rs({name:jt.PasskeyAuthenticationCanceled,message:e,recoverySuggestion:n,underlyingError:t})}return $6(t)},q6=()=>Ay()&&window.isSecureContext&&"credentials"in navigator&&typeof window.PublicKeyCredential=="function",Co=t=>Fc.convert(new Uint8Array(t),{urlSafe:!0,skipPadding:!0}),lh=t=>Uint8Array.from(LA.convert(t,{urlSafe:!0}),e=>e.charCodeAt(0)).buffer,vG=t=>{const e=lh(t.user.id),n=lh(t.challenge),r=(t.excludeCredentials||[]).map(s=>({...s,id:lh(s.id)}));return{...t,excludeCredentials:r,challenge:n,user:{...t.user,id:e}}},yG=t=>{const e={clientDataJSON:Co(t.response.clientDataJSON),attestationObject:Co(t.response.attestationObject),transports:t.response.getTransports(),publicKeyAlgorithm:t.response.getPublicKeyAlgorithm(),authenticatorData:Co(t.response.getAuthenticatorData())},n=t.response.getPublicKey();n&&(e.publicKey=Co(n));const r={type:t.type,id:t.id,rawId:Co(t.rawId),clientExtensionResults:t.getClientExtensionResults(),response:e};return t.authenticatorAttachment&&(r.authenticatorAttachment=t.authenticatorAttachment),r},bG=t=>{const e=lh(t.challenge),n=(t.allowCredentials||[]).map(r=>({...r,id:lh(r.id)}));return{...t,challenge:e,allowCredentials:n}},SG=t=>{const e={clientDataJSON:Co(t.response.clientDataJSON),authenticatorData:Co(t.response.authenticatorData),signature:Co(t.response.signature)};t.response.userHandle&&(e.userHandle=Co(t.response.userHandle));const n={id:t.id,rawId:Co(t.rawId),type:t.type,clientExtensionResults:t.getClientExtensionResults(),response:e};return t.authenticatorAttachment&&(n.authenticatorAttachment=t.authenticatorAttachment),n};function EG(t){ad([!!t,!!t?.challenge,!!t?.user,!!t?.rp,!!t?.pubKeyCredParams].every(Boolean),jt.InvalidPasskeyRegistrationOptions)}function CG(t){ad(t&&t instanceof PublicKeyCredential&&t.response instanceof AuthenticatorAttestationResponse,jt.PasskeyRegistrationFailed)}function wG(t){ad(t&&t instanceof PublicKeyCredential&&t.response instanceof AuthenticatorAssertionResponse,jt.PasskeyRetrievalFailed)}const xG=async t=>{try{const e=q6();ad(e,jt.PasskeyNotSupported);const n=bG(t),r=await navigator.credentials.get({publicKey:n});return wG(r),SG(r)}catch(e){throw mG(e)}},_G=t=>Rn($n,Hn("ConfirmDevice"),ir(),{...qn,...t}),Gm={convert(t){return new TextEncoder().encode(t)}};function Ie(t,e){t!=null&&this.fromString(t,e)}function _r(){return new Ie(null,null)}let Ia;const AG=0xdeadbeefcafe,FM=(AG&16777215)===15715070;function TG(t,e,n,r,s,o){for(;--o>=0;){const a=e*this[t++]+n[r]+s;s=Math.floor(a/67108864),n[r++]=a&67108863}return s}function RG(t,e,n,r,s,o){const a=e&32767,u=e>>15;for(;--o>=0;){let c=this[t]&32767;const f=this[t++]>>15,p=u*c+f*a;c=a*c+((p&32767)<<15)+n[r]+(s&1073741823),s=(c>>>30)+(p>>>15)+u*f+(s>>>30),n[r++]=c&1073741823}return s}function IG(t,e,n,r,s,o){const a=e&16383,u=e>>14;for(;--o>=0;){let c=this[t]&16383;const f=this[t++]>>14,p=u*c+f*a;c=a*c+((p&16383)<<14)+n[r]+s,s=(c>>28)+(p>>14)+u*f,n[r++]=c&268435455}return s}const zM=typeof navigator<"u";zM&&FM&&navigator.appName==="Microsoft Internet Explorer"?(Ie.prototype.am=RG,Ia=30):zM&&FM&&navigator.appName!=="Netscape"?(Ie.prototype.am=TG,Ia=26):(Ie.prototype.am=IG,Ia=28);Ie.prototype.DB=Ia;Ie.prototype.DM=(1<<Ia)-1;Ie.prototype.DV=1<<Ia;const $A=52;Ie.prototype.FV=Math.pow(2,$A);Ie.prototype.F1=$A-Ia;Ie.prototype.F2=2*Ia-$A;const OG="0123456789abcdefghijklmnopqrstuvwxyz",Ny=[];let ld,As;ld=48;for(As=0;As<=9;++As)Ny[ld++]=As;ld=97;for(As=10;As<36;++As)Ny[ld++]=As;ld=65;for(As=10;As<36;++As)Ny[ld++]=As;function jM(t){return OG.charAt(t)}function NG(t,e){const n=Ny[t.charCodeAt(e)];return n??-1}function MG(t){for(let e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function PG(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function qA(t){const e=_r();return e.fromInt(t),e}function kG(t,e){let n;if(e===16)n=4;else if(e===8)n=3;else if(e===2)n=1;else if(e===32)n=5;else if(e===4)n=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");this.t=0,this.s=0;let r=t.length,s=!1,o=0;for(;--r>=0;){const a=NG(t,r);if(a<0){t.charAt(r)==="-"&&(s=!0);continue}s=!1,o===0?this[this.t++]=a:o+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,o+=n,o>=this.DB&&(o-=this.DB)}this.clamp(),s&&Ie.ZERO.subTo(this,this)}function DG(){const t=this.s&this.DM;for(;this.t>0&&this[this.t-1]==t;)--this.t}function LG(t){if(this.s<0)return"-"+this.negate().toString(t);let e;if(t==16)e=4;else if(t===8)e=3;else if(t===2)e=1;else if(t===32)e=5;else if(t===4)e=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");const n=(1<<e)-1;let r,s=!1,o="",a=this.t,u=this.DB-a*this.DB%e;if(a-- >0)for(u<this.DB&&(r=this[a]>>u)>0&&(s=!0,o=jM(r));a>=0;)u<e?(r=(this[a]&(1<<u)-1)<<e-u,r|=this[--a]>>(u+=this.DB-e)):(r=this[a]>>(u-=e)&n,u<=0&&(u+=this.DB,--a)),r>0&&(s=!0),s&&(o+=jM(r));return s?o:"0"}function UG(){const t=_r();return Ie.ZERO.subTo(this,t),t}function FG(){return this.s<0?this.negate():this}function zG(t){let e=this.s-t.s;if(e!=0)return e;let n=this.t;if(e=n-t.t,e!=0)return this.s<0?-e:e;for(;--n>=0;)if((e=this[n]-t[n])!=0)return e;return 0}function WA(t){let e=1,n;return(n=t>>>16)!==0&&(t=n,e+=16),(n=t>>8)!==0&&(t=n,e+=8),(n=t>>4)!==0&&(t=n,e+=4),(n=t>>2)!==0&&(t=n,e+=2),(n=t>>1)!==0&&(t=n,e+=1),e}function jG(){return this.t<=0?0:this.DB*(this.t-1)+WA(this[this.t-1]^this.s&this.DM)}function BG(t,e){let n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s}function HG(t,e){for(let n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s}function $G(t,e){const n=t%this.DB,r=this.DB-n,s=(1<<r)-1,o=Math.floor(t/this.DB);let a=this.s<<n&this.DM,u;for(u=this.t-1;u>=0;--u)e[u+o+1]=this[u]>>r|a,a=(this[u]&s)<<n;for(u=o-1;u>=0;--u)e[u]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()}function qG(t,e){e.s=this.s;const n=Math.floor(t/this.DB);if(n>=this.t){e.t=0;return}const r=t%this.DB,s=this.DB-r,o=(1<<r)-1;e[0]=this[n]>>r;for(let a=n+1;a<this.t;++a)e[a-n-1]|=(this[a]&o)<<s,e[a-n]=this[a]>>r;r>0&&(e[this.t-n-1]|=(this.s&o)<<s),e.t=this.t-n,e.clamp()}function WG(t,e){let n=0,r=0;const s=Math.min(t.t,this.t);for(;n<s;)r+=this[n]-t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r-=t[n],e[n++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()}function VG(t,e){const n=this.abs(),r=t.abs();let s=n.t;for(e.t=s+r.t;--s>=0;)e[s]=0;for(s=0;s<r.t;++s)e[s+n.t]=n.am(0,r[s],e,s,0,n.t);e.s=0,e.clamp(),this.s!==t.s&&Ie.ZERO.subTo(e,e)}function GG(t){const e=this.abs();let n=t.t=2*e.t;for(;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){const r=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,r,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()}function KG(t,e,n){const r=t.abs();if(r.t<=0)return;const s=this.abs();if(s.t<r.t){e?.fromInt(0),n!=null&&this.copyTo(n);return}n===null&&(n=_r());const o=_r(),a=this.s,u=t.s,c=this.DB-WA(r[r.t-1]);c>0?(r.lShiftTo(c,o),s.lShiftTo(c,n)):(r.copyTo(o),s.copyTo(n));const f=o.t,p=o[f-1];if(p===0)return;const g=p*(1<<this.F1)+(f>1?o[f-2]>>this.F2:0),m=this.FV/g,y=(1<<this.F1)/g,S=1<<this.F2;let E=n.t,C=E-f;const w=e===null?_r():e;for(o.dlShiftTo(C,w),n.compareTo(w)>=0&&(n[n.t++]=1,n.subTo(w,n)),Ie.ONE.dlShiftTo(f,w),w.subTo(o,o);o.t<f;)o[o.t++]=0;for(;--C>=0;){let A=n[--E]===p?this.DM:Math.floor(n[E]*m+(n[E-1]+S)*y);if((n[E]+=o.am(0,A,n,C,0,f))<A)for(o.dlShiftTo(C,w),n.subTo(w,n);n[E]<--A;)n.subTo(w,n)}e!==null&&(n.drShiftTo(f,e),a!==u&&Ie.ZERO.subTo(e,e)),n.t=f,n.clamp(),c>0&&n.rShiftTo(c,n),a<0&&Ie.ZERO.subTo(n,n)}function YG(t){const e=_r();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(Ie.ZERO)>0&&t.subTo(e,e),e}function ZG(){if(this.t<1)return 0;const t=this[0];if((t&1)===0)return 0;let e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function XG(t){return this.compareTo(t)===0}function QG(t,e){let n=0,r=0;const s=Math.min(t.t,this.t);for(;n<s;)r+=this[n]+t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r+=t[n],e[n++]=r&this.DM,r>>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e[n++]=r:r<-1&&(e[n++]=this.DV+r),e.t=n,e.clamp()}function JG(t){const e=_r();return this.addTo(t,e),e}function eK(t){const e=_r();return this.subTo(t,e),e}function tK(t){const e=_r();return this.multiplyTo(t,e),e}function nK(t){const e=_r();return this.divRemTo(t,e,null),e}function ud(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function rK(t){const e=_r();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(Ie.ZERO)>0&&this.m.subTo(e,e),e}function sK(t){const e=_r();return t.copyTo(e),this.reduce(e),e}function oK(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(let e=0;e<this.m.t;++e){let n=t[e]&32767;const r=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t[n]+=this.m.am(0,r,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function iK(t,e){t.squareTo(e),this.reduce(e)}function aK(t,e,n){t.multiplyTo(e,n),this.reduce(n)}ud.prototype.convert=rK;ud.prototype.revert=sK;ud.prototype.reduce=oK;ud.prototype.mulTo=aK;ud.prototype.sqrTo=iK;function lK(t,e,n){let r=t.bitLength(),s,o=qA(1);const a=new ud(e);if(r<=0)return o;r<18?s=1:r<48?s=3:r<144?s=4:r<768?s=5:s=6;const u=[];let c=3;const f=s-1,p=(1<<s)-1;if(u[1]=a.convert(this),s>1){const w=_r();for(a.sqrTo(u[1],w);c<=p;)u[c]=_r(),a.mulTo(w,u[c-2],u[c]),c+=2}let g=t.t-1,m,y=!0,S=_r(),E;for(r=WA(t[g])-1;g>=0;){for(r>=f?m=t[g]>>r-f&p:(m=(t[g]&(1<<r+1)-1)<<f-r,g>0&&(m|=t[g-1]>>this.DB+r-f)),c=s;(m&1)===0;)m>>=1,--c;if((r-=c)<0&&(r+=this.DB,--g),y)u[m].copyTo(o),y=!1;else{for(;c>1;)a.sqrTo(o,S),a.sqrTo(S,o),c-=2;c>0?a.sqrTo(o,S):(E=o,o=S,S=E),a.mulTo(S,u[m],o)}for(;g>=0&&(t[g]&1<<r)===0;)a.sqrTo(o,S),E=o,o=S,S=E,--r<0&&(r=this.DB-1,--g)}const C=a.revert(o);return n(null,C),C}Ie.prototype.copyTo=MG;Ie.prototype.fromInt=PG;Ie.prototype.fromString=kG;Ie.prototype.clamp=DG;Ie.prototype.dlShiftTo=BG;Ie.prototype.drShiftTo=HG;Ie.prototype.lShiftTo=$G;Ie.prototype.rShiftTo=qG;Ie.prototype.subTo=WG;Ie.prototype.multiplyTo=VG;Ie.prototype.squareTo=GG;Ie.prototype.divRemTo=KG;Ie.prototype.invDigit=ZG;Ie.prototype.addTo=QG;Ie.prototype.toString=LG;Ie.prototype.negate=UG;Ie.prototype.abs=FG;Ie.prototype.compareTo=zG;Ie.prototype.bitLength=jG;Ie.prototype.mod=YG;Ie.prototype.equals=XG;Ie.prototype.add=JG;Ie.prototype.subtract=eK;Ie.prototype.multiply=tK;Ie.prototype.divide=nK;Ie.prototype.modPow=lK;Ie.ZERO=qA(0);Ie.ONE=qA(1);const uK=async({a:t,g:e,k:n,x:r,B:s,N:o,U:a})=>new Promise((u,c)=>{e.modPow(r,o,(f,p)=>{if(f){c(f);return}s.subtract(n.multiply(p)).modPow(t.add(a.multiply(r)),o,(g,m)=>{if(g){c(g);return}u(m.mod(o))})})}),cK="FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",W6={},jx={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),W6[t]=e,jx[e]=t}const jc=t=>{if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2){const r=t.slice(n,n+2).toLowerCase();if(r in jx)e[n/2]=jx[r];else throw new Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`)}return e},VA=t=>{let e="";for(let n=0;n<t.byteLength;n++)e+=W6[t[n]];return e},Bx=t=>{const e=new zl;e.update(t);const n=e.digestSync(),r=VA(n);return new Array(64-r.length).join("0")+r},Km=t=>Bx(jc(t)),dK=/^[89a-f]/i,ii=t=>{if(!(t instanceof Ie))throw new Error("Not a BigInteger");const e=t.compareTo(Ie.ZERO)<0;let n=t.abs().toString(16);if(n=n.length%2!==0?`0${n}`:n,n=dK.test(n)?`00${n}`:n,e){const r=n.split("").map(o=>{const a=~parseInt(o,16)&15;return"0123456789ABCDEF".charAt(a)}).join("");n=new Ie(r,16).add(Ie.ONE).toString(16),n.toUpperCase().startsWith("FF8")&&(n=n.substring(2))}return n},fK=({A:t,B:e})=>{const n=new Ie(Km(ii(t)+ii(e)),16);if(n.equals(Ie.ZERO))throw new Error("U cannot be zero.");return n},hK=(t,e,n)=>{const r=new zl(e);r.update(t);const s=r.digestSync(),o=new zl(s);return o.update(n),o.digestSync().slice(0,16)},GA=t=>{const e=new jA().random(t).toString();return jc(e)},pK=()=>Fc.convert(GA(40));class gK{constructor({userPoolName:e,a:n,g:r,A:s,N:o}){this.encoder=Gm,this.userPoolName=e,this.a=n,this.g=r,this.A=s,this.N=o,this.k=new Ie(Km(`${ii(o)}${ii(r)}`),16)}getRandomPassword(){if(!this.randomPassword)throw new Le({name:"EmptyBigIntegerRandomPassword",message:"random password is empty"});return this.randomPassword}getSaltToHashDevices(){if(!this.saltToHashDevices)throw new Le({name:"EmptyBigIntegersaltToHashDevices",message:"saltToHashDevices is empty"});return this.saltToHashDevices}getVerifierDevices(){if(!this.verifierDevices)throw new Le({name:"EmptyBigIntegerVerifierDevices",message:"verifyDevices is empty"});return this.verifierDevices}async generateHashDevice(e,n){this.randomPassword=pK();const r=`${e}${n}:${this.randomPassword}`,s=Bx(r),o=VA(GA(16));return this.saltToHashDevices=ii(new Ie(o,16)),new Promise((a,u)=>{this.g.modPow(new Ie(Km(this.saltToHashDevices+s),16),this.N,(c,f)=>{if(c){u(c);return}this.verifierDevices=ii(f),a()})})}async getPasswordAuthenticationKey({username:e,password:n,serverBValue:r,salt:s}){if(r.mod(this.N).equals(Ie.ZERO))throw new Error("B cannot be zero.");const o=fK({A:this.A,B:r}),a=`${this.userPoolName}${e}:${n}`,u=Bx(a),c=new Ie(Km(ii(s)+u),16),f=await uK({a:this.a,g:this.g,k:this.k,x:c,B:r,N:this.N,U:o}),p=this.encoder.convert("Caldera Derived Key"),g=this.encoder.convert(""),m=new Uint8Array(p.byteLength+g.byteLength);return m.set(p,0),m.set(g,p.byteLength),hK(jc(ii(f)),jc(ii(o)),m)}}const mK=async({a:t,g:e,N:n})=>new Promise((r,s)=>{e.modPow(t,n,(o,a)=>{if(o){s(o);return}if(a.mod(n).equals(Ie.ZERO)){s(new Error("Illegal parameter. A mod N cannot be 0."));return}r(a)})}),np=async t=>{const e=new Ie(cK,16),n=new Ie("2",16),r=vK(),s=await mK({a:r,g:n,N:e});return new gK({userPoolName:t,a:r,g:n,A:s,N:e})},vK=()=>{const t=VA(GA(128));return new Ie(t,16)};async function tu({userPoolId:t,userPoolEndpoint:e,newDeviceMetadata:n,accessToken:r}){if(!n)return;const s=t.split("_")[1]||"",o=await np(s),a=n?.DeviceKey,u=n?.DeviceGroupKey;try{await o.generateHashDevice(u??"",a??"")}catch{return}const c={Salt:Fc.convert(jc(o.getSaltToHashDevices())),PasswordVerifier:Fc.convert(jc(o.getVerifierDevices()))},f=o.getRandomPassword();try{return await _G({endpointResolver:bt({endpointOverride:e})})({region:yt(t)},{AccessToken:r,DeviceName:await EV(),DeviceKey:n?.DeviceKey,DeviceSecretVerifierConfig:c}),{deviceKey:a,deviceGroupKey:u,randomPassword:f}}catch{return}}async function yK(t){const e=Ht.getConfig().Auth?.Cognito;lt(e);const{username:n,signInSession:r,signInDetails:s,challengeName:o}=Ro.getState();if(o!=="WEB_AUTHN"||!n)throw new Le({name:To.SignInException,message:"Unable to proceed due to invalid sign in state."});const{CREDENTIAL_REQUEST_OPTIONS:a}=t;ad(!!a,jt.InvalidPasskeyAuthenticationOptions);const u=await xG(JSON.parse(a)),c=as({endpointResolver:bt({endpointOverride:e.userPoolEndpoint})}),{ChallengeName:f,ChallengeParameters:p,AuthenticationResult:g,Session:m}=await c({region:yt(e.userPoolId),userAgentValue:Nt(Ke.ConfirmSignIn)},{ChallengeName:"WEB_AUTHN",ChallengeResponses:{USERNAME:n,CREDENTIAL:JSON.stringify(u)},ClientId:e.userPoolClientId,Session:r});if(eu({signInSession:m,username:n,challengeName:f,signInDetails:s}),g)return await _i({...g,username:n,NewDeviceMetadata:await tu({userPoolId:e.userPoolId,userPoolEndpoint:e.userPoolEndpoint,newDeviceMetadata:g.NewDeviceMetadata,accessToken:g.AccessToken}),signInDetails:s}),Ro.dispatch({type:"RESET_STATE"}),await Va(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};if(f==="WEB_AUTHN")throw new Le({name:To.SignInException,message:"Sequential WEB_AUTHN challenges returned from underlying service cannot be handled."});return{challengeName:f,challengeParameters:p}}function Wn({username:t,userPoolId:e,userPoolClientId:n}){if(typeof window>"u")return;const r=window.AmazonCognitoAdvancedSecurityData;if(typeof r>"u")return;const s=r.getData(t,e,n);return s?{EncodedData:s}:{}}const bK=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],SK=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],V6=()=>{const t=new Date,e=SK[t.getUTCDay()],n=bK[t.getUTCMonth()],r=t.getUTCDate();let s=t.getUTCHours();s<10&&(s=`0${s}`);let o=t.getUTCMinutes();o<10&&(o=`0${o}`);let a=t.getUTCSeconds();a<10&&(a=`0${a}`);const u=t.getUTCFullYear();return`${e} ${n} ${r} ${s}:${o}:${a} UTC ${u}`},G6=({userPoolName:t,username:e,challengeParameters:n,dateNow:r,hkdf:s})=>{const o=Gm.convert(t),a=Gm.convert(e),u=EK(n.SECRET_BLOCK),c=Gm.convert(r),f=new Uint8Array(o.byteLength+a.byteLength+u.byteLength+c.byteLength);f.set(o,0),f.set(a,o.byteLength),f.set(u,o.byteLength+a.byteLength),f.set(c,o.byteLength+a.byteLength+u.byteLength);const p=new zl(s);p.update(f);const g=p.digestSync();return Fc.convert(g)},EK=t=>{const e="=".repeat((4-t.length%4)%4),n=(t+e).replace(/-/g,"+").replace(/_/g,"/"),r=LA.convert(n),s=new Uint8Array(r.length);for(let o=0;o<r.length;++o)s[o]=r.charCodeAt(o);return s};async function rp({username:t,config:e,clientMetadata:n,session:r,tokenOrchestrator:s}){const{userPoolId:o,userPoolEndpoint:a}=e,u=e.userPoolClientId,c=await s?.getDeviceMetadata(t);L6(c);const f=await np(c.deviceGroupKey),p={USERNAME:t,SRP_A:f.A.toString(16),DEVICE_KEY:c.deviceKey},g={ChallengeName:"DEVICE_SRP_AUTH",ClientId:u,ChallengeResponses:p,ClientMetadata:n,Session:r},m=as({endpointResolver:bt({endpointOverride:a})}),{ChallengeParameters:y,Session:S}=await m({region:yt(o)},g);return CK(t,y,n,S,f,e,s)}async function CK(t,e,n,r,s,{userPoolId:o,userPoolClientId:a,userPoolEndpoint:u},c){const f=await c?.getDeviceMetadata(t);L6(f);const p=new Ie(e?.SRP_B,16),g=new Ie(e?.SALT,16),{deviceKey:m}=f,{deviceGroupKey:y}=f,S=await s.getPasswordAuthenticationKey({username:f.deviceKey,password:f.randomPassword,serverBValue:p,salt:g}),E=V6(),C={USERNAME:e?.USERNAME??t,PASSWORD_CLAIM_SECRET_BLOCK:e?.SECRET_BLOCK,TIMESTAMP:E,PASSWORD_CLAIM_SIGNATURE:G6({username:m,userPoolName:y,challengeParameters:e,dateNow:E,hkdf:S}),DEVICE_KEY:m},w=Wn({username:t,userPoolId:o,userPoolClientId:a}),A={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:a,ChallengeResponses:C,Session:r,ClientMetadata:n,UserContextData:w};return as({endpointResolver:bt({endpointOverride:u})})({region:yt(o)},A)}async function KA(t,e,n,r,s,o,a){const{userPoolId:u,userPoolClientId:c,userPoolEndpoint:f}=o,p=u?.split("_")[1]||"",g=new Ie(e?.SRP_B,16),m=new Ie(e?.SALT,16),y=e?.USER_ID_FOR_SRP;if(!y)throw new Le({name:"EmptyUserIdForSRPException",message:"USER_ID_FOR_SRP was not found in challengeParameters"});const S=await s.getPasswordAuthenticationKey({username:y,password:t,serverBValue:g,salt:m}),E=V6(),C={USERNAME:y,PASSWORD_CLAIM_SECRET_BLOCK:e?.SECRET_BLOCK,TIMESTAMP:E,PASSWORD_CLAIM_SIGNATURE:G6({username:y,userPoolName:p,challengeParameters:e,dateNow:E,hkdf:S})},w=await a.getDeviceMetadata(y);w&&w.deviceKey&&(C.DEVICE_KEY=w.deviceKey);const A=Wn({username:y,userPoolId:u,userPoolClientId:c}),T={ChallengeName:"PASSWORD_VERIFIER",ChallengeResponses:C,ClientMetadata:n,Session:r,ClientId:c,UserContextData:A},N=await as({endpointResolver:bt({endpointOverride:f})})({region:yt(u)},T);return N.ChallengeName==="DEVICE_SRP_AUTH"?rp({username:y,config:o,clientMetadata:n,session:N.Session,tokenOrchestrator:a}):N}async function cd(t,e,n,r){try{return await t(...e)}catch(s){if(s instanceof Le&&s.name==="ResourceNotFoundException"&&s.message.includes("Device does not exist."))return await r.clearDeviceMetadata(n),t(...e);throw s}}function nu(t){const{dispatch:e}=Ro;e({type:"SET_USERNAME",value:t})}async function K6({username:t,password:e,clientMetadata:n,config:r,tokenOrchestrator:s,authFlow:o,preferredChallenge:a}){const{userPoolId:u,userPoolClientId:c,userPoolEndpoint:f}=r,p=u?.split("_")[1]||"",g=await np(p),m={USERNAME:t,SRP_A:g.A.toString(16)};o==="USER_AUTH"&&a&&(m.PREFERRED_CHALLENGE=a);const y=Wn({username:t,userPoolId:u,userPoolClientId:c}),S={AuthFlow:o,AuthParameters:m,ClientMetadata:n,ClientId:c,UserContextData:y},C=await tp({endpointResolver:bt({endpointOverride:f})})({region:yt(u),userAgentValue:Nt(Ke.SignIn)},S),{ChallengeParameters:w,Session:A}=C,T=w?.USERNAME??t;return nu(T),C.ChallengeName==="PASSWORD_VERIFIER"?cd(KA,[e,w,n,A,g,r,s],T,s):C}async function wK({username:t,session:e,selectedChallenge:n,config:r,clientMetadata:s}){return as({endpointResolver:bt({endpointOverride:r.userPoolEndpoint})})({region:yt(r.userPoolId),userAgentValue:Nt(Ke.ConfirmSignIn)},{ChallengeName:"SELECT_CHALLENGE",ChallengeResponses:{USERNAME:t,ANSWER:n},ClientId:r.userPoolClientId,Session:e,ClientMetadata:s})}async function xK(t,e,n,r,s){const{userPoolId:o,userPoolClientId:a,userPoolEndpoint:u}=r,c={ANSWER:"PASSWORD",USERNAME:t,PASSWORD:e},f=Wn({username:t,userPoolId:o,userPoolClientId:a}),g=await as({endpointResolver:bt({endpointOverride:u})})({region:yt(o),userAgentValue:Nt(Ke.ConfirmSignIn)},{ChallengeName:"SELECT_CHALLENGE",ChallengeResponses:c,ClientId:a,ClientMetadata:n,Session:s,UserContextData:f}),m=g.ChallengeParameters?.USERNAME??t;return nu(m),g}async function _K(t,e,n,r,s,o){const{userPoolId:a,userPoolClientId:u,userPoolEndpoint:c}=r,f=a.split("_")[1]||"",p=await np(f),g={ANSWER:"PASSWORD_SRP",USERNAME:t,SRP_A:p.A.toString(16)},m=Wn({username:t,userPoolId:a,userPoolClientId:u}),S=await as({endpointResolver:bt({endpointOverride:c})})({region:yt(a),userAgentValue:Nt(Ke.ConfirmSignIn)},{ChallengeName:"SELECT_CHALLENGE",ChallengeResponses:g,ClientId:u,ClientMetadata:n,Session:s,UserContextData:m}),E=S.ChallengeParameters?.USERNAME??t;return nu(E),S.ChallengeName==="PASSWORD_VERIFIER"?cd(KA,[e,S.ChallengeParameters,n,S.Session,p,r,o],E,o):S}const Hx="userAttributes.";function AK(t){return"isSignedIn"in t&&"nextStep"in t}async function TK({challengeResponse:t,clientMetadata:e,session:n,username:r,config:s,tokenOrchestrator:o}){const{userPoolId:a,userPoolClientId:u,userPoolEndpoint:c}=s,f={USERNAME:r,ANSWER:t},p=await o?.getDeviceMetadata(r);p&&p.deviceKey&&(f.DEVICE_KEY=p.deviceKey);const g=Wn({username:r,userPoolId:a,userPoolClientId:u}),m={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:f,Session:n,ClientMetadata:e,ClientId:u,UserContextData:g},S=await as({endpointResolver:bt({endpointOverride:c})})({region:yt(a),userAgentValue:Nt(Ke.ConfirmSignIn)},m);return S.ChallengeName==="DEVICE_SRP_AUTH"?rp({username:r,config:s,clientMetadata:e,session:S.Session,tokenOrchestrator:o}):S}async function RK({challengeResponse:t,username:e,clientMetadata:n,session:r,deviceName:s,config:o}){const{userPoolId:a,userPoolClientId:u,userPoolEndpoint:c}=o;if(t==="EMAIL")return{ChallengeName:"MFA_SETUP",Session:r,ChallengeParameters:{MFAS_CAN_SETUP:'["EMAIL_OTP"]'},$metadata:{}};if(t==="TOTP")return{ChallengeName:"MFA_SETUP",Session:r,ChallengeParameters:{MFAS_CAN_SETUP:'["SOFTWARE_TOKEN_MFA"]'},$metadata:{}};const f={USERNAME:e};if(/^\d+$/.test(t)){const m=KV({endpointResolver:bt({endpointOverride:c})}),{Session:y}=await m({region:yt(a),userAgentValue:Nt(Ke.ConfirmSignIn)},{UserCode:t,Session:r,FriendlyDeviceName:s});Ro.dispatch({type:"SET_SIGN_IN_SESSION",value:y});const S={ChallengeName:"MFA_SETUP",ChallengeResponses:f,Session:y,ClientMetadata:n,ClientId:u};return as({endpointResolver:bt({endpointOverride:c})})({region:yt(a),userAgentValue:Nt(Ke.ConfirmSignIn)},S)}if(t.includes("@")){f.EMAIL=t;const m={ChallengeName:"MFA_SETUP",ChallengeResponses:f,Session:r,ClientMetadata:n,ClientId:u};return as({endpointResolver:bt({endpointOverride:c})})({region:yt(a),userAgentValue:Nt(Ke.ConfirmSignIn)},m)}throw new Le({name:To.SignInException,message:`Cannot proceed with MFA setup using challengeResponse: ${t}`,recoverySuggestion:'Try passing "EMAIL", "TOTP", a valid email, or OTP code as the challengeResponse.'})}async function IK({challengeResponse:t,username:e,clientMetadata:n,session:r,config:s}){const{userPoolId:o,userPoolClientId:a,userPoolEndpoint:u}=s;fn(t==="TOTP"||t==="SMS"||t==="EMAIL",Ge.IncorrectMFAMethod);const c={USERNAME:e,ANSWER:zK(t)},f=Wn({username:e,userPoolId:o,userPoolClientId:a}),p={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:c,Session:r,ClientMetadata:n,ClientId:a,UserContextData:f};return as({endpointResolver:bt({endpointOverride:u})})({region:yt(o),userAgentValue:Nt(Ke.ConfirmSignIn)},p)}async function OK({challengeResponse:t,clientMetadata:e,session:n,username:r,requiredAttributes:s,config:o}){const{userPoolId:a,userPoolClientId:u,userPoolEndpoint:c}=o,f={...UK(s),NEW_PASSWORD:t,USERNAME:r},p=Wn({username:r,userPoolId:a,userPoolClientId:u}),g={ChallengeName:"NEW_PASSWORD_REQUIRED",ChallengeResponses:f,ClientMetadata:e,Session:n,ClientId:u,UserContextData:p};return as({endpointResolver:bt({endpointOverride:c})})({region:yt(a),userAgentValue:Nt(Ke.ConfirmSignIn)},g)}async function NK(t,e,n,r,s){const{userPoolClientId:o,userPoolId:a,userPoolEndpoint:u}=r,c={USERNAME:t,PASSWORD:e},f=await s.getDeviceMetadata(t);f&&f.deviceKey&&(c.DEVICE_KEY=f.deviceKey);const p=Wn({username:t,userPoolId:a,userPoolClientId:o}),g={AuthFlow:"USER_PASSWORD_AUTH",AuthParameters:c,ClientMetadata:n,ClientId:o,UserContextData:p},y=await tp({endpointResolver:bt({endpointOverride:u})})({region:yt(a),userAgentValue:Nt(Ke.SignIn)},g),S=y.ChallengeParameters?.USERNAME??y.ChallengeParameters?.USER_ID_FOR_SRP??t;return nu(S),y.ChallengeName==="DEVICE_SRP_AUTH"?rp({username:S,config:r,clientMetadata:n,session:y.Session,tokenOrchestrator:s}):y}async function MK(t,e,n,r,s){return K6({username:t,password:e,clientMetadata:n,config:r,tokenOrchestrator:s,authFlow:"USER_SRP_AUTH"})}async function PK(t,e,n,r){const{userPoolClientId:s,userPoolId:o,userPoolEndpoint:a}=n,u={USERNAME:t},c=await r.getDeviceMetadata(t);c&&c.deviceKey&&(u.DEVICE_KEY=c.deviceKey);const f=Wn({username:t,userPoolId:o,userPoolClientId:s}),p={AuthFlow:"CUSTOM_AUTH",AuthParameters:u,ClientMetadata:e,ClientId:s,UserContextData:f},m=await tp({endpointResolver:bt({endpointOverride:a})})({region:yt(o),userAgentValue:Nt(Ke.SignIn)},p),y=m.ChallengeParameters?.USERNAME??t;return nu(y),m.ChallengeName==="DEVICE_SRP_AUTH"?rp({username:y,config:n,clientMetadata:e,session:m.Session,tokenOrchestrator:r}):m}async function kK(t,e,n,r,s){lt(r);const{userPoolId:o,userPoolClientId:a,userPoolEndpoint:u}=r,c=o?.split("_")[1]||"",f=await np(c),p={USERNAME:t,SRP_A:f.A.toString(16),CHALLENGE_NAME:"SRP_A"},g=Wn({username:t,userPoolId:o,userPoolClientId:a}),m={AuthFlow:"CUSTOM_AUTH",AuthParameters:p,ClientMetadata:n,ClientId:a,UserContextData:g},y=tp({endpointResolver:bt({endpointOverride:u})}),{ChallengeParameters:S,Session:E}=await y({region:yt(o),userAgentValue:Nt(Ke.SignIn)},m),C=S?.USERNAME??t;return nu(C),cd(KA,[e,S,n,E,f,r,s],C,s)}async function ru(t){const{challengeName:e,challengeParameters:n,availableChallenges:r}=t,s=Ht.getConfig().Auth?.Cognito;switch(lt(s),e){case"CUSTOM_CHALLENGE":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_CUSTOM_CHALLENGE",additionalInfo:n}};case"MFA_SETUP":{const{signInSession:o,username:a}=Ro.getState(),u=BM(HM(n.MFAS_CAN_SETUP))||[],c=BK(u),f=c.includes("TOTP"),p=c.includes("EMAIL");if(f&&p)return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION",allowedMFATypes:c}};if(p)return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_EMAIL_SETUP"}};if(f){const g=YV({endpointResolver:bt({endpointOverride:s.userPoolEndpoint})}),{Session:m,SecretCode:y}=await g({region:yt(s.userPoolId)},{Session:o});return Ro.dispatch({type:"SET_SIGN_IN_SESSION",value:m}),{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_TOTP_SETUP",totpSetupDetails:DK(y,a)}}}throw new Le({name:To.SignInException,message:`Cannot initiate MFA setup from available types: ${u}`})}case"NEW_PASSWORD_REQUIRED":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED",missingAttributes:LK(n.requiredAttributes)}};case"SELECT_MFA_TYPE":return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_MFA_SELECTION",allowedMFATypes:BM(HM(n.MFAS_CAN_CHOOSE))}};case"SMS_OTP":case"SMS_MFA":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_SMS_CODE",codeDeliveryDetails:{deliveryMedium:n.CODE_DELIVERY_DELIVERY_MEDIUM,destination:n.CODE_DELIVERY_DESTINATION}}};case"SOFTWARE_TOKEN_MFA":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_TOTP_CODE"}};case"EMAIL_OTP":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_EMAIL_CODE",codeDeliveryDetails:{deliveryMedium:n.CODE_DELIVERY_DELIVERY_MEDIUM,destination:n.CODE_DELIVERY_DESTINATION}}};case"WEB_AUTHN":{const o=await yK(n);return AK(o)?o:ru(o)}case"PASSWORD":case"PASSWORD_SRP":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_PASSWORD"}};case"SELECT_CHALLENGE":return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_FIRST_FACTOR_SELECTION",availableChallenges:r}}}throw new Le({name:To.SignInException,message:`An error occurred during the sign in process. ${e} challengeName returned by the underlying service was not addressed.`})}function DK(t,e){return{sharedSecret:t,getSetupUri:(n,r)=>{const s=`otpauth://totp/${n}:${r??e}?secret=${t}&issuer=${n}`;return new Wa(s)}}}function dd(t){if(t===bv.PasswordResetRequiredException)return{isSignedIn:!1,nextStep:{signInStep:"RESET_PASSWORD"}};if(t===bv.UserNotConfirmedException)return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_UP"}}}function LK(t){return t?JSON.parse(t).map(n=>n.includes(Hx)?n.replace(Hx,""):n):[]}function UK(t){if(!t)return{};const e={};return Object.entries(t).forEach(([n,r])=>{r&&(e[`${Hx}${n}`]=r)}),e}async function FK(t,e,n,r,s,o,a,u){const c=u?.userAttributes,f=u?.friendlyDeviceName;switch(e){case"WEB_AUTHN":case"SELECT_CHALLENGE":return r==="PASSWORD_SRP"||r==="PASSWORD"?{ChallengeName:r,Session:n,$metadata:{}}:wK({username:t,session:n,selectedChallenge:r,config:s,clientMetadata:a});case"SELECT_MFA_TYPE":return IK({challengeResponse:r,clientMetadata:a,session:n,username:t,config:s});case"MFA_SETUP":return RK({challengeResponse:r,clientMetadata:a,session:n,username:t,deviceName:f,config:s});case"NEW_PASSWORD_REQUIRED":return OK({challengeResponse:r,clientMetadata:a,session:n,username:t,requiredAttributes:c,config:s});case"CUSTOM_CHALLENGE":return cd(TK,[{challengeResponse:r,clientMetadata:a,session:n,username:t,config:s,tokenOrchestrator:o}],t,o);case"SMS_MFA":case"SOFTWARE_TOKEN_MFA":case"SMS_OTP":case"EMAIL_OTP":return HK({challengeName:e,challengeResponse:r,clientMetadata:a,session:n,username:t,config:s,tokenOrchestrator:o});case"PASSWORD":return xK(t,r,a,s,n);case"PASSWORD_SRP":return _K(t,r,a,s,n,o)}throw new Le({name:To.SignInException,message:`An error occurred during the sign in process.
@@ -145,7 +145,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
145
145
  .ptr__loader {
146
146
  margin: 0 auto;
147
147
  text-align: center;
148
- }`;m9(Nee);var jTe=function(t){var e=t.isPullable,n=e===void 0?!0:e,r=t.canFetchMore,s=r===void 0?!1:r,o=t.onRefresh,a=t.onFetchMore,u=t.refreshingContent,c=u===void 0?j.createElement(Iee,null):u,f=t.pullingContent,p=f===void 0?j.createElement(Oee,null):f,g=t.children,m=t.pullDownThreshold,y=m===void 0?67:m,S=t.fetchMoreThreshold,E=S===void 0?100:S,C=t.maxPullDownDistance,w=C===void 0?95:C,A=t.resistance,T=A===void 0?1:A,R=t.backgroundColor,N=t.className,O=N===void 0?"":N,I=_.useRef(null),k=_.useRef(null),F=_.useRef(null),$=_.useRef(null),D=!1,z=!1,q=!1,Y=0,te=0;_.useEffect(function(){if(!(!n||!k||!k.current)){var G=k.current;return G.addEventListener("touchstart",fe,{passive:!0}),G.addEventListener("mousedown",fe),G.addEventListener("touchmove",de,{passive:!1}),G.addEventListener("mousemove",de),window.addEventListener("scroll",Ae),G.addEventListener("touchend",L),G.addEventListener("mouseup",L),document.body.addEventListener("mouseleave",L),function(){G.removeEventListener("touchstart",fe),G.removeEventListener("mousedown",fe),G.removeEventListener("touchmove",de),G.removeEventListener("mousemove",de),window.removeEventListener("scroll",Ae),G.removeEventListener("touchend",L),G.removeEventListener("mouseup",L),document.body.removeEventListener("mouseleave",L)}}},[g,n,o,y,w,s,E]),_.useEffect(function(){var G;if(!((G=I)===null||G===void 0)&&G.current){var K=I.current.classList.contains("ptr--fetch-more-treshold-breached");K||s&&H()<E&&a&&(I.current.classList.add("ptr--fetch-more-treshold-breached"),z=!0,a().then(ee).catch(ee))}},[s,g]);var H=function(){if(!k||!k.current)return-1;var G=window.scrollY,K=k.current.scrollHeight;return K-G-window.innerHeight},ee=function(){requestAnimationFrame(function(){k.current&&(k.current.style.overflowX="hidden",k.current.style.overflowY="auto",k.current.style.transform="unset"),F.current&&(F.current.style.opacity="0"),I.current&&(I.current.classList.remove("ptr--pull-down-treshold-breached"),I.current.classList.remove("ptr--dragging"),I.current.classList.remove("ptr--fetch-more-treshold-breached")),D&&(D=!1),z&&(z=!1)})},fe=function(G){q=!1,G instanceof MouseEvent&&(Y=G.pageY),window.TouchEvent&&G instanceof TouchEvent&&(Y=G.touches[0].pageY),te=Y,!(G.type==="touchstart"&&g9(G.target,Ah.UP))&&(k.current.getBoundingClientRect().top<0||(q=!0))},de=function(G){if(q){if(window.TouchEvent&&G instanceof TouchEvent?te=G.touches[0].pageY:te=G.pageY,I.current.classList.add("ptr--dragging"),te<Y){q=!1;return}G.cancelable&&G.preventDefault();var K=Math.min((te-Y)/T,w);K>=y&&(q=!0,D=!0,I.current.classList.remove("ptr--dragging"),I.current.classList.add("ptr--pull-down-treshold-breached")),!(K>=w)&&(F.current.style.opacity=(K/65).toString(),k.current.style.overflow="visible",k.current.style.transform="translate(0px, "+K+"px)",F.current.style.visibility="visible")}},Ae=function(G){z||s&&H()<E&&a&&(z=!0,I.current.classList.add("ptr--fetch-more-treshold-breached"),a().then(ee).catch(ee))},L=function(){if(q=!1,Y=0,te=0,!D){F.current&&(F.current.style.visibility="hidden"),ee();return}k.current&&(k.current.style.overflow="visible",k.current.style.transform="translate(0px, "+y+"px)"),o().then(ee).catch(ee)};return j.createElement("div",{className:"ptr "+O,style:{backgroundColor:R},ref:I},j.createElement("div",{className:"ptr__pull-down",ref:F},j.createElement("div",{className:"ptr__loader ptr__pull-down--loading"},c),j.createElement("div",{className:"ptr__pull-down--pull-more"},p)),j.createElement("div",{className:"ptr__children",ref:k},g,j.createElement("div",{className:"ptr__fetch-more",ref:$},j.createElement("div",{className:"ptr__loader ptr__fetch-more--loading"},c))))};const Mee={preparing:"Getting the new version ready",restarting:"Restarting Remit",reconnecting:"Waiting for Remit to answer again"};function $P(t){return Mee[t]}function Pee(t){return t<90?"This usually takes about a minute.":t<240?"Longer than usual. Remit is still trying to reach the server.":"Still no answer. Remit keeps trying."}function BTe(t,e=Date.now()){const n=Math.floor((e-t)/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function HTe(t){return new Date(t).toLocaleDateString(void 0,{dateStyle:"medium"})}function kee({children:t,show:e,label:n="Update available"}){return P.jsxs("span",{className:"relative inline-flex",children:[t,e&&P.jsxs(P.Fragment,{children:[P.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-accent-2"}),P.jsx("span",{className:"sr-only",children:n})]})]})}const qP=["preparing","restarting","reconnecting"],Dee='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function v9(t){_.useEffect(()=>{const e=t.current;if(!e)return;const n=()=>Array.from(e.querySelectorAll(Dee));(n()[0]??e).focus();const r=s=>{if(s.key!=="Tab")return;const o=n();if(o.length===0){s.preventDefault(),e.focus();return}const a=o[0],u=o[o.length-1],c=document.activeElement;if(s.shiftKey&&(c===a||!e.contains(c))){s.preventDefault(),u.focus();return}!s.shiftKey&&(c===u||!e.contains(c))&&(s.preventDefault(),a.focus())};return window.addEventListener("keydown",r,!0),()=>window.removeEventListener("keydown",r,!0)},[t])}const y9="fixed inset-0 z-50 flex flex-col items-center justify-center gap-6 bg-canvas p-6 text-center outline-none";function Lee({target:t,phase:e,elapsedSeconds:n}){const r=_.useRef(null);v9(r);const s=qP.indexOf(e);return P.jsxs("div",{ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"self-update-progress-title",tabIndex:-1,className:y9,children:[P.jsxs("div",{className:"max-w-md space-y-2",children:[P.jsxs("h1",{id:"self-update-progress-title",className:"text-lg font-semibold text-fg",children:["Installing Remit ",t]}),P.jsx("p",{className:"text-sm text-fg-muted",children:"Remit is restarting, so this page has no server to talk to for a moment. Leave this open — it reconnects on its own."})]}),P.jsx("ol",{className:"w-full max-w-sm space-y-2 text-left",children:qP.map((o,a)=>{const u=a<s,c=a===s;return P.jsxs("li",{className:Jt("flex items-center gap-3 rounded-sm border px-row-inset py-2 text-sm",c?"border-line-strong bg-surface text-fg":"border-line bg-surface-sunken text-fg-subtle"),children:[u?P.jsx(YX,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}):c?P.jsx(tQ,{className:"size-4 shrink-0 animate-spin text-accent-2","aria-hidden":!0}):P.jsx("span",{className:"size-4 shrink-0 rounded-full border border-line-strong"}),$P(o)]},o)})}),P.jsxs("p",{"aria-live":"polite",className:"max-w-md text-xs text-fg-subtle",children:[P.jsx("span",{className:"sr-only",children:`${$P(e)}. `}),Pee(n)]})]})}function Uee({attemptedVersion:t,previousVersion:e,elapsedSeconds:n,logsCommand:r,onRetryConnection:s}){const o=_.useRef(null);v9(o);const a=Math.max(1,Math.round(n/60));return P.jsxs("div",{ref:o,role:"alertdialog","aria-modal":"true","aria-labelledby":"self-update-unreachable-title",tabIndex:-1,className:y9,children:[P.jsx(tT,{className:"size-12 shrink-0 text-danger","aria-hidden":!0}),P.jsxs("div",{className:"max-w-lg space-y-3",children:[P.jsx("h1",{id:"self-update-unreachable-title",className:"text-lg font-semibold text-fg",children:"Remit has not answered since the restart"}),P.jsxs("p",{className:"text-sm text-fg-muted",children:["Installing ",t," started ",a," minute",a===1?"":"s"," ago and the server has been silent since. Your mail is safe at your provider — it was never part of the update."]}),P.jsxs("p",{className:"text-sm text-fg-muted",children:["Remit rolls back to ",e," on its own when the new version fails to start, but this page cannot confirm that from here. Check the server directly:"]}),P.jsx("code",{className:"block rounded-xs bg-surface-sunken px-3 py-2 text-left text-xs text-fg-muted",children:r})]}),P.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2",children:P.jsx(uh,{size:"sm",onClick:s,children:"Try connecting again"})})]})}const Fee=()=>P.jsxs("div",{className:"hidden h-full w-[17%] min-w-40 max-w-64 shrink-0 flex-col gap-1 border-r border-line p-3 md:flex",children:[P.jsx("div",{className:"mb-3 h-6 w-24 rounded bg-surface-sunken"}),Array.from({length:6}).map((t,e)=>P.jsxs("div",{className:"flex items-center gap-2 py-1.5",children:[P.jsx("div",{className:"size-5 shrink-0 rounded bg-surface-sunken"}),P.jsx("div",{className:"h-3.5 flex-1 rounded bg-surface-sunken"})]},e))]}),zee=()=>P.jsx("div",{className:"min-w-0 flex-1",children:Array.from({length:8}).map((t,e)=>P.jsxs("div",{className:"flex items-start gap-3 border-b border-line py-2 pl-5 pr-4",children:[P.jsx("div",{className:"mt-0.5 size-7 shrink-0 rounded-full bg-surface-sunken"}),P.jsxs("div",{className:"flex-1 space-y-1.5",children:[P.jsxs("div",{className:"flex justify-between gap-2",children:[P.jsx("div",{className:"h-3.5 w-28 rounded bg-surface-sunken"}),P.jsx("div",{className:"h-3 w-12 rounded bg-surface-sunken"})]}),P.jsx("div",{className:"h-3.5 w-48 rounded bg-surface-sunken"}),P.jsx("div",{className:"h-3 w-full rounded bg-surface-sunken"})]})]},e))}),aT=()=>P.jsxs("div",{className:"flex h-dvh animate-pulse bg-canvas","aria-hidden":"true",children:[P.jsx(Fee,{}),P.jsx(zee,{})]}),lT="c6830118c98e85c679d02b25a25f13eec737109b",jee="2026-07-24T21:09:25.843Z",Bee=lT.slice(0,7),Hee=/^[0-9a-f]{40}$/.test(lT),$ee=Hee?`https://github.com/remit-mail/reader/commit/${lT}`:void 0,qee="https://github.com/remit-mail/reader/issues/new";class t_ extends Error{constructor(e,n,r){super(e),this.status=n,this.body=r,this.name="ApiError"}status;body}const su=t=>{if(t instanceof t_)return t.status;if(t&&typeof t=="object"){const e=t;if(typeof e.status=="number")return e.status;if(typeof e.statusCode=="number")return e.statusCode}},b9=t=>su(t)!==void 0,zy=t=>{const e=su(t);return e!==void 0&&e>=500&&e<=599},jy=t=>!!(typeof DOMException<"u"&&t instanceof DOMException&&t.name==="AbortError"||t&&typeof t=="object"&&"name"in t&&t.name==="AbortError"),Wee=()=>typeof navigator<"u"&&navigator.onLine===!1,S9=t=>jy(t)||b9(t)?!1:t instanceof JA?!0:Wee(),Vee=t=>!b9(t)&&!jy(t)&&!S9(t),E9=t=>zy(t)||Vee(t),Gee=t=>t?.softError===!0,C9=(t,e)=>zy(t)?!0:jy(t)||S9(t)?!1:E9(t)?!0:!Gee(e),Kee=t=>zy(t),n_=new Set;let w9=null,x9=null;const Yee=t=>{x9=t},Zee=t=>t instanceof Error?t:new Error(_9(t)),_9=t=>t instanceof Error?t.message||t.name:typeof t=="string"?t:t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:"An unexpected server error occurred.",Xee=()=>typeof globalThis.crypto<"u"&&typeof globalThis.crypto.randomUUID=="function"?globalThis.crypto.randomUUID():`fatal-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,Bl=(t,e)=>{const n={error:t,message:_9(t),correlationId:Xee(),at:Date.now(),recoverable:e?.recoverable??Kee(t),stack:t instanceof Error?t.stack:void 0,componentStack:e?.componentStack};w9=n,rte(`Fatal: ${n.message} [${n.correlationId}]`),x9?.recordError(Zee(t),{fatal:"true",correlationId:n.correlationId});for(const r of n_)r(n);return n},Qee=t=>(n_.add(t),()=>{n_.delete(t)}),Jee=()=>w9,ete=20,Jm=[],tte=new Set(["ResizeObserver loop limit exceeded","ResizeObserver loop completed with undelivered notifications"]);function nte(t){return typeof t!="string"?!1:tte.has(t.replace(/\.\s*$/,""))}function ev(t){Jm.push(t),Jm.length>ete&&Jm.shift()}function rte(t){ev(t)}function ste(t){return t.map(e=>{if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}).join(" ")}function ote(){const t=console.error.bind(console);console.error=(...e)=>{ev(ste(e)),t(...e)},window.addEventListener("error",e=>{nte(e.message)||(ev(`Uncaught ${e.error instanceof Error?`${e.error.name}: ${e.error.message}`:String(e.message)} (${e.filename}:${e.lineno})`),Bl(e.error??e.message))}),window.addEventListener("unhandledrejection",e=>{const n=e.reason,r=n instanceof Error?`${n.name}: ${n.message}`:String(n);ev(`Unhandled rejection: ${r}`),Bl(n)})}function ite(){return Jm.slice()}const ate=8,gc=[];function lte(t){const e=t.split(/[?#]/)[0],n=gc[gc.length-1];n&&n.path===e||(gc.push({path:e,timestamp:new Date().toISOString()}),gc.length>ate&&gc.shift())}function ute(){return gc.slice()}const gS=7500,WP=`
148
+ }`;m9(Nee);var jTe=function(t){var e=t.isPullable,n=e===void 0?!0:e,r=t.canFetchMore,s=r===void 0?!1:r,o=t.onRefresh,a=t.onFetchMore,u=t.refreshingContent,c=u===void 0?j.createElement(Iee,null):u,f=t.pullingContent,p=f===void 0?j.createElement(Oee,null):f,g=t.children,m=t.pullDownThreshold,y=m===void 0?67:m,S=t.fetchMoreThreshold,E=S===void 0?100:S,C=t.maxPullDownDistance,w=C===void 0?95:C,A=t.resistance,T=A===void 0?1:A,R=t.backgroundColor,N=t.className,O=N===void 0?"":N,I=_.useRef(null),k=_.useRef(null),F=_.useRef(null),$=_.useRef(null),D=!1,z=!1,q=!1,Y=0,te=0;_.useEffect(function(){if(!(!n||!k||!k.current)){var G=k.current;return G.addEventListener("touchstart",fe,{passive:!0}),G.addEventListener("mousedown",fe),G.addEventListener("touchmove",de,{passive:!1}),G.addEventListener("mousemove",de),window.addEventListener("scroll",Ae),G.addEventListener("touchend",L),G.addEventListener("mouseup",L),document.body.addEventListener("mouseleave",L),function(){G.removeEventListener("touchstart",fe),G.removeEventListener("mousedown",fe),G.removeEventListener("touchmove",de),G.removeEventListener("mousemove",de),window.removeEventListener("scroll",Ae),G.removeEventListener("touchend",L),G.removeEventListener("mouseup",L),document.body.removeEventListener("mouseleave",L)}}},[g,n,o,y,w,s,E]),_.useEffect(function(){var G;if(!((G=I)===null||G===void 0)&&G.current){var K=I.current.classList.contains("ptr--fetch-more-treshold-breached");K||s&&H()<E&&a&&(I.current.classList.add("ptr--fetch-more-treshold-breached"),z=!0,a().then(ee).catch(ee))}},[s,g]);var H=function(){if(!k||!k.current)return-1;var G=window.scrollY,K=k.current.scrollHeight;return K-G-window.innerHeight},ee=function(){requestAnimationFrame(function(){k.current&&(k.current.style.overflowX="hidden",k.current.style.overflowY="auto",k.current.style.transform="unset"),F.current&&(F.current.style.opacity="0"),I.current&&(I.current.classList.remove("ptr--pull-down-treshold-breached"),I.current.classList.remove("ptr--dragging"),I.current.classList.remove("ptr--fetch-more-treshold-breached")),D&&(D=!1),z&&(z=!1)})},fe=function(G){q=!1,G instanceof MouseEvent&&(Y=G.pageY),window.TouchEvent&&G instanceof TouchEvent&&(Y=G.touches[0].pageY),te=Y,!(G.type==="touchstart"&&g9(G.target,Ah.UP))&&(k.current.getBoundingClientRect().top<0||(q=!0))},de=function(G){if(q){if(window.TouchEvent&&G instanceof TouchEvent?te=G.touches[0].pageY:te=G.pageY,I.current.classList.add("ptr--dragging"),te<Y){q=!1;return}G.cancelable&&G.preventDefault();var K=Math.min((te-Y)/T,w);K>=y&&(q=!0,D=!0,I.current.classList.remove("ptr--dragging"),I.current.classList.add("ptr--pull-down-treshold-breached")),!(K>=w)&&(F.current.style.opacity=(K/65).toString(),k.current.style.overflow="visible",k.current.style.transform="translate(0px, "+K+"px)",F.current.style.visibility="visible")}},Ae=function(G){z||s&&H()<E&&a&&(z=!0,I.current.classList.add("ptr--fetch-more-treshold-breached"),a().then(ee).catch(ee))},L=function(){if(q=!1,Y=0,te=0,!D){F.current&&(F.current.style.visibility="hidden"),ee();return}k.current&&(k.current.style.overflow="visible",k.current.style.transform="translate(0px, "+y+"px)"),o().then(ee).catch(ee)};return j.createElement("div",{className:"ptr "+O,style:{backgroundColor:R},ref:I},j.createElement("div",{className:"ptr__pull-down",ref:F},j.createElement("div",{className:"ptr__loader ptr__pull-down--loading"},c),j.createElement("div",{className:"ptr__pull-down--pull-more"},p)),j.createElement("div",{className:"ptr__children",ref:k},g,j.createElement("div",{className:"ptr__fetch-more",ref:$},j.createElement("div",{className:"ptr__loader ptr__fetch-more--loading"},c))))};const Mee={preparing:"Getting the new version ready",restarting:"Restarting Remit",reconnecting:"Waiting for Remit to answer again"};function $P(t){return Mee[t]}function Pee(t){return t<90?"This usually takes about a minute.":t<240?"Longer than usual. Remit is still trying to reach the server.":"Still no answer. Remit keeps trying."}function BTe(t,e=Date.now()){const n=Math.floor((e-t)/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function HTe(t){return new Date(t).toLocaleDateString(void 0,{dateStyle:"medium"})}function kee({children:t,show:e,label:n="Update available"}){return P.jsxs("span",{className:"relative inline-flex",children:[t,e&&P.jsxs(P.Fragment,{children:[P.jsx("span",{className:"absolute -right-1 -top-1 size-2 rounded-full bg-accent-2"}),P.jsx("span",{className:"sr-only",children:n})]})]})}const qP=["preparing","restarting","reconnecting"],Dee='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function v9(t){_.useEffect(()=>{const e=t.current;if(!e)return;const n=()=>Array.from(e.querySelectorAll(Dee));(n()[0]??e).focus();const r=s=>{if(s.key!=="Tab")return;const o=n();if(o.length===0){s.preventDefault(),e.focus();return}const a=o[0],u=o[o.length-1],c=document.activeElement;if(s.shiftKey&&(c===a||!e.contains(c))){s.preventDefault(),u.focus();return}!s.shiftKey&&(c===u||!e.contains(c))&&(s.preventDefault(),a.focus())};return window.addEventListener("keydown",r,!0),()=>window.removeEventListener("keydown",r,!0)},[t])}const y9="fixed inset-0 z-50 flex flex-col items-center justify-center gap-6 bg-canvas p-6 text-center outline-none";function Lee({target:t,phase:e,elapsedSeconds:n}){const r=_.useRef(null);v9(r);const s=qP.indexOf(e);return P.jsxs("div",{ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"self-update-progress-title",tabIndex:-1,className:y9,children:[P.jsxs("div",{className:"max-w-md space-y-2",children:[P.jsxs("h1",{id:"self-update-progress-title",className:"text-lg font-semibold text-fg",children:["Installing Remit ",t]}),P.jsx("p",{className:"text-sm text-fg-muted",children:"Remit is restarting, so this page has no server to talk to for a moment. Leave this open — it reconnects on its own."})]}),P.jsx("ol",{className:"w-full max-w-sm space-y-2 text-left",children:qP.map((o,a)=>{const u=a<s,c=a===s;return P.jsxs("li",{className:Jt("flex items-center gap-3 rounded-sm border px-row-inset py-2 text-sm",c?"border-line-strong bg-surface text-fg":"border-line bg-surface-sunken text-fg-subtle"),children:[u?P.jsx(YX,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}):c?P.jsx(tQ,{className:"size-4 shrink-0 animate-spin text-accent-2","aria-hidden":!0}):P.jsx("span",{className:"size-4 shrink-0 rounded-full border border-line-strong"}),$P(o)]},o)})}),P.jsxs("p",{"aria-live":"polite",className:"max-w-md text-xs text-fg-subtle",children:[P.jsx("span",{className:"sr-only",children:`${$P(e)}. `}),Pee(n)]})]})}function Uee({attemptedVersion:t,previousVersion:e,elapsedSeconds:n,logsCommand:r,onRetryConnection:s}){const o=_.useRef(null);v9(o);const a=Math.max(1,Math.round(n/60));return P.jsxs("div",{ref:o,role:"alertdialog","aria-modal":"true","aria-labelledby":"self-update-unreachable-title",tabIndex:-1,className:y9,children:[P.jsx(tT,{className:"size-12 shrink-0 text-danger","aria-hidden":!0}),P.jsxs("div",{className:"max-w-lg space-y-3",children:[P.jsx("h1",{id:"self-update-unreachable-title",className:"text-lg font-semibold text-fg",children:"Remit has not answered since the restart"}),P.jsxs("p",{className:"text-sm text-fg-muted",children:["Installing ",t," started ",a," minute",a===1?"":"s"," ago and the server has been silent since. Your mail is safe at your provider — it was never part of the update."]}),P.jsxs("p",{className:"text-sm text-fg-muted",children:["Remit rolls back to ",e," on its own when the new version fails to start, but this page cannot confirm that from here. Check the server directly:"]}),P.jsx("code",{className:"block rounded-xs bg-surface-sunken px-3 py-2 text-left text-xs text-fg-muted",children:r})]}),P.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2",children:P.jsx(uh,{size:"sm",onClick:s,children:"Try connecting again"})})]})}const Fee=()=>P.jsxs("div",{className:"hidden h-full w-[17%] min-w-40 max-w-64 shrink-0 flex-col gap-1 border-r border-line p-3 md:flex",children:[P.jsx("div",{className:"mb-3 h-6 w-24 rounded bg-surface-sunken"}),Array.from({length:6}).map((t,e)=>P.jsxs("div",{className:"flex items-center gap-2 py-1.5",children:[P.jsx("div",{className:"size-5 shrink-0 rounded bg-surface-sunken"}),P.jsx("div",{className:"h-3.5 flex-1 rounded bg-surface-sunken"})]},e))]}),zee=()=>P.jsx("div",{className:"min-w-0 flex-1",children:Array.from({length:8}).map((t,e)=>P.jsxs("div",{className:"flex items-start gap-3 border-b border-line py-2 pl-5 pr-4",children:[P.jsx("div",{className:"mt-0.5 size-7 shrink-0 rounded-full bg-surface-sunken"}),P.jsxs("div",{className:"flex-1 space-y-1.5",children:[P.jsxs("div",{className:"flex justify-between gap-2",children:[P.jsx("div",{className:"h-3.5 w-28 rounded bg-surface-sunken"}),P.jsx("div",{className:"h-3 w-12 rounded bg-surface-sunken"})]}),P.jsx("div",{className:"h-3.5 w-48 rounded bg-surface-sunken"}),P.jsx("div",{className:"h-3 w-full rounded bg-surface-sunken"})]})]},e))}),aT=()=>P.jsxs("div",{className:"flex h-dvh animate-pulse bg-canvas","aria-hidden":"true",children:[P.jsx(Fee,{}),P.jsx(zee,{})]}),lT="f6e507eae9e03f4a82915ab2cbf49717e6b4b02d",jee="2026-07-24T21:15:44.414Z",Bee=lT.slice(0,7),Hee=/^[0-9a-f]{40}$/.test(lT),$ee=Hee?`https://github.com/remit-mail/reader/commit/${lT}`:void 0,qee="https://github.com/remit-mail/reader/issues/new";class t_ extends Error{constructor(e,n,r){super(e),this.status=n,this.body=r,this.name="ApiError"}status;body}const su=t=>{if(t instanceof t_)return t.status;if(t&&typeof t=="object"){const e=t;if(typeof e.status=="number")return e.status;if(typeof e.statusCode=="number")return e.statusCode}},b9=t=>su(t)!==void 0,zy=t=>{const e=su(t);return e!==void 0&&e>=500&&e<=599},jy=t=>!!(typeof DOMException<"u"&&t instanceof DOMException&&t.name==="AbortError"||t&&typeof t=="object"&&"name"in t&&t.name==="AbortError"),Wee=()=>typeof navigator<"u"&&navigator.onLine===!1,S9=t=>jy(t)||b9(t)?!1:t instanceof JA?!0:Wee(),Vee=t=>!b9(t)&&!jy(t)&&!S9(t),E9=t=>zy(t)||Vee(t),Gee=t=>t?.softError===!0,C9=(t,e)=>zy(t)?!0:jy(t)||S9(t)?!1:E9(t)?!0:!Gee(e),Kee=t=>zy(t),n_=new Set;let w9=null,x9=null;const Yee=t=>{x9=t},Zee=t=>t instanceof Error?t:new Error(_9(t)),_9=t=>t instanceof Error?t.message||t.name:typeof t=="string"?t:t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:"An unexpected server error occurred.",Xee=()=>typeof globalThis.crypto<"u"&&typeof globalThis.crypto.randomUUID=="function"?globalThis.crypto.randomUUID():`fatal-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,Bl=(t,e)=>{const n={error:t,message:_9(t),correlationId:Xee(),at:Date.now(),recoverable:e?.recoverable??Kee(t),stack:t instanceof Error?t.stack:void 0,componentStack:e?.componentStack};w9=n,rte(`Fatal: ${n.message} [${n.correlationId}]`),x9?.recordError(Zee(t),{fatal:"true",correlationId:n.correlationId});for(const r of n_)r(n);return n},Qee=t=>(n_.add(t),()=>{n_.delete(t)}),Jee=()=>w9,ete=20,Jm=[],tte=new Set(["ResizeObserver loop limit exceeded","ResizeObserver loop completed with undelivered notifications"]);function nte(t){return typeof t!="string"?!1:tte.has(t.replace(/\.\s*$/,""))}function ev(t){Jm.push(t),Jm.length>ete&&Jm.shift()}function rte(t){ev(t)}function ste(t){return t.map(e=>{if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}).join(" ")}function ote(){const t=console.error.bind(console);console.error=(...e)=>{ev(ste(e)),t(...e)},window.addEventListener("error",e=>{nte(e.message)||(ev(`Uncaught ${e.error instanceof Error?`${e.error.name}: ${e.error.message}`:String(e.message)} (${e.filename}:${e.lineno})`),Bl(e.error??e.message))}),window.addEventListener("unhandledrejection",e=>{const n=e.reason,r=n instanceof Error?`${n.name}: ${n.message}`:String(n);ev(`Unhandled rejection: ${r}`),Bl(n)})}function ite(){return Jm.slice()}const ate=8,gc=[];function lte(t){const e=t.split(/[?#]/)[0],n=gc[gc.length-1];n&&n.path===e||(gc.push({path:e,timestamp:new Date().toISOString()}),gc.length>ate&&gc.shift())}function ute(){return gc.slice()}const gS=7500,WP=`
149
149
  … (truncated — the copy action on this screen has the full report)`;function VP(t){return{appShortSha:Bee,appCommitUrl:$ee,appBuildTime:jee,userAgent:navigator.userAgent,viewport:`${window.innerWidth}×${window.innerHeight}`,timestamp:new Date().toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,href:window.location.href,recentErrors:ite(),requests:AX(),routes:ute(),failingRequest:TX(),errorMessage:t?.errorMessage,stack:t?.stack,componentStack:t?.componentStack,quarantine:t?.quarantine,title:t?.title}}function mS(t){return["```",t,"```"].join(`
150
150
  `)}function A9(t){const e=/T(\d{2}:\d{2}:\d{2})/.exec(t);return e?e[1]:t}function cte(t){return`- **Version**: ${t.appCommitUrl?`[\`${t.appShortSha}\`](${t.appCommitUrl})`:`\`${t.appShortSha}\``} built ${t.appBuildTime}`}function dte(t){const e=t.status===0?"no response (transport failure)":`${t.status}`;return["## Failing request",`- **Endpoint**: \`${t.path}\``,`- **Method**: ${t.method}`,`- **Status**: ${e}`,`- **Correlation id**: ${t.correlationId??"(none)"}`,""]}function fte(t){return t.length===0?["## Recent API requests","(none)",""]:["## Recent API requests","| Time | Method | Path | Status | Duration | Correlation |","| --- | --- | --- | --- | --- | --- |",...t.map(n=>{const r=n.status===0?"ERR":`${n.status}`;return`| ${A9(n.timestamp)} | ${n.method} | \`${n.path}\` | ${r} | ${n.durationMs}ms | ${n.correlationId??""} |`}),""]}function hte(t){return t.length===0?["## Navigation trail","(none)",""]:["## Navigation trail",...t.map(n=>`- ${A9(n.timestamp)} \`${n.path}\``),""]}function T9(t,e){const n=t.recentErrors.length>0?t.recentErrors.map(o=>` - ${o}`).join(`
151
151
  `):" (none)",r=["## Environment",cte(t),`- **Browser**: ${t.userAgent}`,`- **Viewport**: ${t.viewport}`,`- **Time**: ${t.timestamp} (${t.timezone})`,"","## URL",t.href,""];if(t.errorMessage&&r.push("## Error",t.errorMessage,""),t.failingRequest&&r.push(...dte(t.failingRequest)),t.quarantine){const o=e?.quarantineStructure??t.quarantine.structure;r.push(t.quarantine.head,"",mS(o),"",t.quarantine.disclaimer,"")}const s=e?.stack??t.stack;return s&&r.push("## Stacktrace",mS(s),""),t.componentStack&&r.push("## Component stack",mS(t.componentStack),""),r.push(...fte(t.requests)),r.push(...hte(t.routes)),r.push("## Recent console errors",n,"","## Steps to reproduce","1. ","","## Expected behaviour","","## Actual behaviour",""),r.join(`
@@ -291,5 +291,5 @@ https://www.w3ctech.com/topic/2226`));let u=n(...a);return u.postcssPlugin=e,u.p
291
291
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),Yv.LANG&&Yv.LANG.startsWith("cn")&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
292
292
  https://www.w3ctech.com/topic/2226`));let u=n(...a);return u.postcssPlugin=e,u.postcssVersion=new tI().version,u}let o;return Object.defineProperty(s,"postcss",{get(){return o||(o=s()),o}}),s.process=function(a,u,c){return Lt([s(c)]).process(a,u)},s};Lt.stringify=vEe;Lt.parse=CEe;Lt.fromJSON=yEe;Lt.list=wEe;Lt.comment=t=>new fB(t);Lt.atRule=t=>new hB(t);Lt.decl=t=>new cB(t);Lt.rule=t=>new pB(t);Lt.root=t=>new gB(t);Lt.document=t=>new dB(t);Lt.CssSyntaxError=pEe;Lt.Declaration=cB;Lt.Container=mEe;Lt.Processor=tI;Lt.Document=dB;Lt.Comment=fB;Lt.Warning=bEe;Lt.AtRule=hB;Lt.Result=SEe;Lt.Input=EEe;Lt.Rule=pB;Lt.Root=gB;Lt.Node=xEe;gEe.registerPostcss(Lt);var _Ee=Lt;Lt.default=Lt;const an=F1e(_Ee);an.stringify;an.fromJSON;an.plugin;an.parse;an.list;an.document;an.comment;an.atRule;an.rule;an.decl;an.root;an.CssSyntaxError;an.Declaration;an.Container;an.Processor;an.Document;an.Comment;an.Warning;an.AtRule;an.Result;an.Input;an.Rule;an.Root;an.Node;class nI{constructor(...e){ws(this,"parentElement",null),ws(this,"parentNode",null),ws(this,"ownerDocument"),ws(this,"firstChild",null),ws(this,"lastChild",null),ws(this,"previousSibling",null),ws(this,"nextSibling",null),ws(this,"ELEMENT_NODE",1),ws(this,"TEXT_NODE",3),ws(this,"nodeType"),ws(this,"nodeName"),ws(this,"RRNodeType")}get childNodes(){const e=[];let n=this.firstChild;for(;n;)e.push(n),n=n.nextSibling;return e}contains(e){if(e instanceof nI){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,n){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Z4={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},X4={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Um={},AEe=()=>!!globalThis.Zone;function rI(t){if(Um[t])return Um[t];const e=globalThis[t],n=e.prototype,r=t in Z4?Z4[t]:void 0,s=!!(r&&r.every(u=>{var c,f;return!!((f=(c=Object.getOwnPropertyDescriptor(n,u))==null?void 0:c.get)!=null&&f.toString().includes("[native code]"))})),o=t in X4?X4[t]:void 0,a=!!(o&&o.every(u=>{var c;return typeof n[u]=="function"&&((c=n[u])==null?void 0:c.toString().includes("[native code]"))}));if(s&&a&&!AEe())return Um[t]=e.prototype,e.prototype;try{const u=document.createElement("iframe");document.body.appendChild(u);const c=u.contentWindow;if(!c)return e.prototype;const f=c[t].prototype;return document.body.removeChild(u),f?Um[t]=f:n}catch{return n}}const _x={};function Oi(t,e,n){var r;const s=`${t}.${String(n)}`;if(_x[s])return _x[s].call(e);const o=rI(t),a=(r=Object.getOwnPropertyDescriptor(o,n))==null?void 0:r.get;return a?(_x[s]=a,a.call(e)):e[n]}const Ax={};function mB(t,e,n){const r=`${t}.${String(n)}`;if(Ax[r])return Ax[r].bind(e);const o=rI(t)[n];return typeof o!="function"?e[n]:(Ax[r]=o,o.bind(e))}function TEe(t){return Oi("Node",t,"ownerDocument")}function REe(t){return Oi("Node",t,"childNodes")}function IEe(t){return Oi("Node",t,"parentNode")}function OEe(t){return Oi("Node",t,"parentElement")}function NEe(t){return Oi("Node",t,"textContent")}function MEe(t,e){return mB("Node",t,"contains")(e)}function PEe(t){return mB("Node",t,"getRootNode")()}function kEe(t){return!t||!("host"in t)?null:Oi("ShadowRoot",t,"host")}function DEe(t){return t.styleSheets}function LEe(t){return!t||!("shadowRoot"in t)?null:Oi("Element",t,"shadowRoot")}function UEe(t,e){return Oi("Element",t,"querySelector")(e)}function FEe(t,e){return Oi("Element",t,"querySelectorAll")(e)}function vB(){return rI("MutationObserver").constructor}function hu(t,e,n){try{if(!(e in t))return()=>{};const r=t[e],s=n(r);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=s,()=>{t[e]=r}}catch{return()=>{}}}const rt={ownerDocument:TEe,childNodes:REe,parentNode:IEe,parentElement:OEe,textContent:NEe,contains:MEe,getRootNode:PEe,host:kEe,styleSheets:DEe,shadowRoot:LEe,querySelector:UEe,querySelectorAll:FEe,mutationObserver:vB,patch:hu};function Cr(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}const bc=`Please stop import mirror directly. Instead of that,\r
293
293
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
294
- or you can use record.mirror to access the mirror instance during recording.`;let Q4={map:{},getId(){return console.error(bc),-1},getNode(){return console.error(bc),null},removeNodeFromMap(){console.error(bc)},has(){return console.error(bc),!1},reset(){console.error(bc)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Q4=new Proxy(Q4,{get(t,e,n){return e==="map"&&console.error(bc),Reflect.get(t,e,n)}}));function Yh(t,e,n={}){let r=null,s=0;return function(...o){const a=Date.now();!s&&n.leading===!1&&(s=a);const u=e-(a-s),c=this;u<=0||u>e?(r&&(clearTimeout(r),r=null),s=a,t.apply(c,o)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{s=n.leading===!1?0:Date.now(),r=null,t.apply(c,o)},u))}}function Lb(t,e,n,r,s=window){const o=s.Object.getOwnPropertyDescriptor(t,e);return s.Object.defineProperty(t,e,r?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}}),()=>Lb(t,e,o||{},!0)}let ly=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ly=()=>new Date().getTime());function yB(t){var e,n,r,s;const o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:t.pageXOffset!==void 0?t.pageXOffset:o.documentElement.scrollLeft||o?.body&&((e=rt.parentElement(o.body))==null?void 0:e.scrollLeft)||((n=o?.body)==null?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:t.pageYOffset!==void 0?t.pageYOffset:o?.documentElement.scrollTop||o?.body&&((r=rt.parentElement(o.body))==null?void 0:r.scrollTop)||((s=o?.body)==null?void 0:s.scrollTop)||0}}function bB(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function SB(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function EB(t){return t?t.nodeType===t.ELEMENT_NODE?t:rt.parentElement(t):null}function wr(t,e,n,r){if(!t)return!1;const s=EB(t);if(!s)return!1;try{if(typeof e=="string"){if(s.classList.contains(e)||r&&s.closest("."+e)!==null)return!0}else if(Jv(s,e,r))return!0}catch{}return!!(n&&(s.matches(n)||r&&s.closest(n)!==null))}function zEe(t,e){return e.getId(t)!==-1}function Tx(t,e,n){return t.tagName==="TITLE"&&n.headTitleMutations?!0:e.getId(t)===jh}function CB(t,e){if(vh(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const r=rt.parentNode(t);return r&&r.nodeType===t.DOCUMENT_NODE?!1:r?CB(r,e):!0}function mA(t){return!!t.changedTouches}function jEe(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function wB(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function xB(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function vA(t){return t?t instanceof nI&&"shadowRoot"in t?!!t.shadowRoot:!!rt.shadowRoot(t):!1}class BEe{constructor(){Se(this,"id",1),Se(this,"styleIDMap",new WeakMap),Se(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function _B(t){var e;let n=null;return"getRootNode"in t&&((e=rt.getRootNode(t))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&rt.host(rt.getRootNode(t))&&(n=rt.host(rt.getRootNode(t))),n}function HEe(t){let e=t,n;for(;n=_B(e);)e=n;return e}function $Ee(t){const e=rt.ownerDocument(t);if(!e)return!1;const n=HEe(t);return rt.contains(e,n)}function AB(t){const e=rt.ownerDocument(t);return e?rt.contains(e,t)||$Ee(t):!1}var Ct=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Ct||{}),ft=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(ft||{}),Ur=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Ur||{}),si=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(si||{}),Xc=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Xc||{}),Sc=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(Sc||{}),TB=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(TB||{});function J4(t){return"__ln"in t}class qEe{constructor(){Se(this,"length",0),Se(this,"head",null),Se(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<e;r++)n=n?.next||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&J4(e.previousSibling)){const r=e.previousSibling.__ln.next;n.next=r,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(e.nextSibling&&J4(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;n.previous=r,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(e){const n=e.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const e5=(t,e)=>`${t}@${e}`;class WEe{constructor(){Se(this,"frozen",!1),Se(this,"locked",!1),Se(this,"texts",[]),Se(this,"attributes",[]),Se(this,"attributeMap",new WeakMap),Se(this,"removes",[]),Se(this,"mapRemoves",[]),Se(this,"movedMap",{}),Se(this,"addedSet",new Set),Se(this,"movedSet",new Set),Se(this,"droppedSet",new Set),Se(this,"removesSubTreeCache",new Set),Se(this,"mutationCb"),Se(this,"blockClass"),Se(this,"blockSelector"),Se(this,"maskTextClass"),Se(this,"maskTextSelector"),Se(this,"inlineStylesheet"),Se(this,"maskInputOptions"),Se(this,"maskTextFn"),Se(this,"maskInputFn"),Se(this,"keepIframeSrcFn"),Se(this,"recordCanvas"),Se(this,"inlineImages"),Se(this,"slimDOMOptions"),Se(this,"dataURLOptions"),Se(this,"doc"),Se(this,"mirror"),Se(this,"iframeManager"),Se(this,"stylesheetManager"),Se(this,"shadowDomManager"),Se(this,"canvasManager"),Se(this,"processedNodeManager"),Se(this,"unattachedDoc"),Se(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Se(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],n=new Set,r=new qEe,s=c=>{let f=c,p=jh;for(;p===jh;)f=f&&f.nextSibling,p=f&&this.mirror.getId(f);return p},o=c=>{const f=rt.parentNode(c);if(!f||!AB(c))return;let p=!1;if(c.nodeType===Node.TEXT_NODE){const S=f.tagName;if(S==="TEXTAREA")return;S==="STYLE"&&this.addedSet.has(f)&&(p=!0)}const g=vh(f)?this.mirror.getId(_B(c)):this.mirror.getId(f),m=s(c);if(g===-1||m===-1)return r.addNode(c);const y=Ic(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:S=>{wB(S,this.mirror)&&this.iframeManager.addIframe(S),xB(S,this.mirror)&&this.stylesheetManager.trackLinkElement(S),vA(c)&&this.shadowDomManager.addShadowRoot(rt.shadowRoot(c),this.doc)},onIframeLoad:(S,E)=>{this.iframeManager.attachIframe(S,E),this.shadowDomManager.observeAttachShadow(S)},onStylesheetLoad:(S,E)=>{this.stylesheetManager.attachLinkElement(S,E)},cssCaptured:p});y&&(e.push({parentId:g,nextId:m,node:y}),n.add(y.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of this.movedSet)t5(this.removesSubTreeCache,c,this.mirror)&&!this.movedSet.has(rt.parentNode(c))||o(c);for(const c of this.addedSet)!n5(this.droppedSet,c)&&!t5(this.removesSubTreeCache,c,this.mirror)||n5(this.movedSet,c)?o(c):this.droppedSet.add(c);let a=null;for(;r.length;){let c=null;if(a){const f=this.mirror.getId(rt.parentNode(a.value)),p=s(a.value);f!==-1&&p!==-1&&(c=a)}if(!c){let f=r.tail;for(;f;){const p=f;if(f=f.previous,p){const g=this.mirror.getId(rt.parentNode(p.value));if(s(p.value)===-1)continue;if(g!==-1){c=p;break}else{const y=p.value,S=rt.parentNode(y);if(S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const E=rt.host(S);if(this.mirror.getId(E)!==-1){c=p;break}}}}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}a=c.previous,r.removeNode(c.value),o(c.value)}const u={texts:this.texts.map(c=>{const f=c.node,p=rt.parentNode(f);return p&&p.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(p),{id:this.mirror.getId(f),value:c.value}}).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:f}=c;if(typeof f.style=="string"){const p=JSON.stringify(c.styleDiff),g=JSON.stringify(c._unchangedStyles);p.length<f.style.length&&(p+g).split("var(").length===f.style.split("var(").length&&(f.style=c.styleDiff)}return{id:this.mirror.getId(c.node),attributes:f}}).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:e};!u.texts.length&&!u.attributes.length&&!u.removes.length&&!u.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(u))}),Se(this,"genTextAreaValueMutation",e=>{let n=this.attributeMap.get(e);n||(n={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e,n));const r=Array.from(rt.childNodes(e),s=>rt.textContent(s)||"").join("");n.attributes.value=Zv({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Xv(e),value:r,maskInputFn:this.maskInputFn})}),Se(this,"processMutation",e=>{if(!Tx(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const n=rt.textContent(e.target);!wr(e.target,this.blockClass,this.blockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:Zz(e.target,this.maskTextClass,this.maskTextSelector,!0)&&n?this.maskTextFn?this.maskTextFn(n,EB(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,s=e.target.getAttribute(r);if(r==="value"){const a=Xv(n);s=Zv({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:a,value:s,maskInputFn:this.maskInputFn})}if(wr(e.target,this.blockClass,this.blockSelector,!1)||s===e.oldValue)return;let o=this.attributeMap.get(e.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!n.contentDocument)r="rr_src";else return;if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),r==="type"&&n.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!Yz(n.tagName,r))if(o.attributes[r]=Kz(this.doc,Yl(n.tagName),Yl(r),s),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");e.oldValue&&a.setAttribute("style",e.oldValue);for(const u of Array.from(n.style)){const c=n.style.getPropertyValue(u),f=n.style.getPropertyPriority(u);c!==a.style.getPropertyValue(u)||f!==a.style.getPropertyPriority(u)?f===""?o.styleDiff[u]=c:o.styleDiff[u]=[c,f]:o._unchangedStyles[u]=[c,f]}for(const u of Array.from(a.style))n.style.getPropertyValue(u)===""&&(o.styleDiff[u]=!1)}else r==="open"&&n.tagName==="DIALOG"&&(n.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(wr(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const r=this.mirror.getId(n),s=vh(e.target)?this.mirror.getId(rt.host(e.target)):this.mirror.getId(e.target);wr(e.target,this.blockClass,this.blockSelector,!1)||Tx(n,this.mirror,this.slimDOMOptions)||!zEe(n,this.mirror)||(this.addedSet.has(n)?(yA(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||CB(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[e5(r,s)]?yA(this.movedSet,n):(this.removes.push({parentId:s,id:r,isShadow:vh(e.target)&&yh(e.target)?!0:void 0}),VEe(n,this.removesSubTreeCache))),this.mapRemoves.push(n))});break}}}),Se(this,"genAdds",(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Tx(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[e5(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);wr(e,this.blockClass,this.blockSelector,!1)||(rt.childNodes(e).forEach(r=>this.genAdds(r)),vA(e)&&rt.childNodes(rt.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=e[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function yA(t,e){t.delete(e),rt.childNodes(e).forEach(n=>yA(t,n))}function VEe(t,e){const n=[t];for(;n.length;){const r=n.pop();e.has(r)||(e.add(r),rt.childNodes(r).forEach(s=>n.push(s)))}}function t5(t,e,n){return t.size===0?!1:GEe(t,e)}function GEe(t,e,n){const r=rt.parentNode(e);return r?t.has(r):!1}function n5(t,e){return t.size===0?!1:RB(t,e)}function RB(t,e){const n=rt.parentNode(e);return n?t.has(n)?!0:RB(t,n):!1}let bh;function KEe(t){bh=t}function YEe(){bh=void 0}const vt=t=>bh?(...n)=>{try{return t(...n)}catch(r){if(bh&&bh(r)===!0)return;throw r}}:t,Rl=[];function vp(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function IB(t,e){const n=new WEe;Rl.push(n),n.init(t);const r=new(vB())(vt(n.processMutations.bind(n)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function ZEe({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};const s=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let a=[],u;const c=Yh(vt(g=>{const m=Date.now()-u;t(a.map(y=>(y.timeOffset-=m,y)),g),a=[],u=null}),o),f=vt(Yh(vt(g=>{const m=vp(g),{clientX:y,clientY:S}=mA(g)?g.changedTouches[0]:g;u||(u=ly()),a.push({x:y,y:S,id:r.getId(m),timeOffset:ly()-u}),c(typeof DragEvent<"u"&&g instanceof DragEvent?ft.Drag:g instanceof MouseEvent?ft.MouseMove:ft.TouchMove)}),s,{trailing:!1})),p=[Cr("mousemove",f,n),Cr("touchmove",f,n),Cr("drag",f,n)];return vt(()=>{p.forEach(g=>g())})}function XEe({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,u=[];let c=null;const f=p=>g=>{const m=vp(g);if(wr(m,r,s,!0))return;let y=null,S=p;if("pointerType"in g){switch(g.pointerType){case"mouse":y=si.Mouse;break;case"touch":y=si.Touch;break;case"pen":y=si.Pen;break}y===si.Touch?Ur[p]===Ur.MouseDown?S="TouchStart":Ur[p]===Ur.MouseUp&&(S="TouchEnd"):si.Pen}else mA(g)&&(y=si.Touch);y!==null?(c=y,(S.startsWith("Touch")&&y===si.Touch||S.startsWith("Mouse")&&y===si.Mouse)&&(y=null)):Ur[p]===Ur.Click&&(y=c,c=null);const E=mA(g)?g.changedTouches[0]:g;if(!E)return;const C=n.getId(m),{clientX:w,clientY:A}=E;vt(t)({type:Ur[S],id:C,x:w,y:A,...y!==null&&{pointerType:y}})};return Object.keys(Ur).filter(p=>Number.isNaN(Number(p))&&!p.endsWith("_Departed")&&a[p]!==!1).forEach(p=>{let g=Yl(p);const m=f(p);if(window.PointerEvent)switch(Ur[p]){case Ur.MouseDown:case Ur.MouseUp:g=g.replace("mouse","pointer");break;case Ur.TouchStart:case Ur.TouchEnd:return}u.push(Cr(g,m,e))}),vt(()=>{u.forEach(p=>p())})}function OB({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,sampling:o}){const a=vt(Yh(vt(u=>{const c=vp(u);if(!c||wr(c,r,s,!0))return;const f=n.getId(c);if(c===e&&e.defaultView){const p=yB(e.defaultView);t({id:f,x:p.left,y:p.top})}else t({id:f,x:c.scrollLeft,y:c.scrollTop})}),o.scroll||100));return Cr("scroll",a,e)}function QEe({viewportResizeCb:t},{win:e}){let n=-1,r=-1;const s=vt(Yh(vt(()=>{const o=bB(),a=SB();(n!==o||r!==a)&&(t({width:Number(a),height:Number(o)}),n=o,r=a)}),200));return Cr("resize",s,e)}const JEe=["INPUT","TEXTAREA","SELECT"],r5=new WeakMap;function eCe({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:u,maskInputFn:c,sampling:f,userTriggeredOnInput:p}){function g(A){let T=vp(A);const R=A.isTrusted,N=T&&T.tagName;if(T&&N==="OPTION"&&(T=rt.parentElement(T)),!T||!N||JEe.indexOf(N)<0||wr(T,r,s,!0)||T.classList.contains(o)||a&&T.matches(a))return;let O=T.value,I=!1;const k=Xv(T)||"";k==="radio"||k==="checkbox"?I=T.checked:(u[N.toLowerCase()]||u[k])&&(O=Zv({element:T,maskInputOptions:u,tagName:N,type:k,value:O,maskInputFn:c})),m(T,p?{text:O,isChecked:I,userTriggered:R}:{text:O,isChecked:I});const F=T.name;k==="radio"&&F&&I&&e.querySelectorAll(`input[type="radio"][name="${F}"]`).forEach($=>{if($!==T){const D=$.value;m($,p?{text:D,isChecked:!I,userTriggered:!1}:{text:D,isChecked:!I})}})}function m(A,T){const R=r5.get(A);if(!R||R.text!==T.text||R.isChecked!==T.isChecked){r5.set(A,T);const N=n.getId(A);vt(t)({...T,id:N})}}const S=(f.input==="last"?["change"]:["input","change"]).map(A=>Cr(A,vt(g),e)),E=e.defaultView;if(!E)return()=>{S.forEach(A=>A())};const C=E.Object.getOwnPropertyDescriptor(E.HTMLInputElement.prototype,"value"),w=[[E.HTMLInputElement.prototype,"value"],[E.HTMLInputElement.prototype,"checked"],[E.HTMLSelectElement.prototype,"value"],[E.HTMLTextAreaElement.prototype,"value"],[E.HTMLSelectElement.prototype,"selectedIndex"],[E.HTMLOptionElement.prototype,"selected"]];return C&&C.set&&S.push(...w.map(A=>Lb(A[0],A[1],{set(){vt(g)({target:this,isTrusted:!1})}},!1,E))),vt(()=>{S.forEach(A=>A())})}function uy(t){const e=[];function n(r,s){if(Fm("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Fm("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Fm("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Fm("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const a=Array.from(r.parentRule.cssRules).indexOf(r);s.unshift(a)}else if(r.parentStyleSheet){const a=Array.from(r.parentStyleSheet.cssRules).indexOf(r);s.unshift(a)}return s}return n(t,e)}function ba(t,e,n){let r,s;return t?(t.ownerNode?r=e.getId(t.ownerNode):s=n.getId(t),{styleId:s,id:r}):{}}function tCe({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:vt((p,g,m)=>{const[y,S]=m,{id:E,styleId:C}=ba(g,e,n.styleMirror);return(E&&E!==-1||C&&C!==-1)&&t({id:E,styleId:C,adds:[{rule:y,index:S}]}),p.apply(g,m)})}),r.CSSStyleSheet.prototype.addRule=function(p,g,m=this.cssRules.length){const y=`${p} { ${g} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[y,m])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:vt((p,g,m)=>{const[y]=m,{id:S,styleId:E}=ba(g,e,n.styleMirror);return(S&&S!==-1||E&&E!==-1)&&t({id:S,styleId:E,removes:[{index:y}]}),p.apply(g,m)})}),r.CSSStyleSheet.prototype.removeRule=function(p){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[p])};let a;r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:vt((p,g,m)=>{const[y]=m,{id:S,styleId:E}=ba(g,e,n.styleMirror);return(S&&S!==-1||E&&E!==-1)&&t({id:S,styleId:E,replace:y}),p.apply(g,m)})}));let u;r.CSSStyleSheet.prototype.replaceSync&&(u=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:vt((p,g,m)=>{const[y]=m,{id:S,styleId:E}=ba(g,e,n.styleMirror);return(S&&S!==-1||E&&E!==-1)&&t({id:S,styleId:E,replaceSync:y}),p.apply(g,m)})}));const c={};zm("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(zm("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),zm("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),zm("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const f={};return Object.entries(c).forEach(([p,g])=>{f[p]={insertRule:g.prototype.insertRule,deleteRule:g.prototype.deleteRule},g.prototype.insertRule=new Proxy(f[p].insertRule,{apply:vt((m,y,S)=>{const[E,C]=S,{id:w,styleId:A}=ba(y.parentStyleSheet,e,n.styleMirror);return(w&&w!==-1||A&&A!==-1)&&t({id:w,styleId:A,adds:[{rule:E,index:[...uy(y),C||0]}]}),m.apply(y,S)})}),g.prototype.deleteRule=new Proxy(f[p].deleteRule,{apply:vt((m,y,S)=>{const[E]=S,{id:C,styleId:w}=ba(y.parentStyleSheet,e,n.styleMirror);return(C&&C!==-1||w&&w!==-1)&&t({id:C,styleId:w,removes:[{index:[...uy(y),E]}]}),m.apply(y,S)})})}),vt(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=o,a&&(r.CSSStyleSheet.prototype.replace=a),u&&(r.CSSStyleSheet.prototype.replaceSync=u),Object.entries(c).forEach(([p,g])=>{g.prototype.insertRule=f[p].insertRule,g.prototype.deleteRule=f[p].deleteRule})})}function NB({mirror:t,stylesheetManager:e},n){var r,s,o;let a=null;n.nodeName==="#document"?a=t.getId(n):a=t.getId(rt.host(n));const u=n.nodeName==="#document"?(r=n.defaultView)==null?void 0:r.Document:(o=(s=n.ownerDocument)==null?void 0:s.defaultView)==null?void 0:o.ShadowRoot,c=u?.prototype?Object.getOwnPropertyDescriptor(u?.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!u||!c?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var f;return(f=c.get)==null?void 0:f.call(this)},set(f){var p;const g=(p=c.set)==null?void 0:p.call(this,f);if(a!==null&&a!==-1)try{e.adoptStyleSheets(f,a)}catch{}return g}}),vt(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))}function nCe({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:vt((u,c,f)=>{var p;const[g,m,y]=f;if(n.has(g))return o.apply(c,[g,m,y]);const{id:S,styleId:E}=ba((p=c.parentRule)==null?void 0:p.parentStyleSheet,e,r.styleMirror);return(S&&S!==-1||E&&E!==-1)&&t({id:S,styleId:E,set:{property:g,value:m,priority:y},index:uy(c.parentRule)}),u.apply(c,f)})});const a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:vt((u,c,f)=>{var p;const[g]=f;if(n.has(g))return a.apply(c,[g]);const{id:m,styleId:y}=ba((p=c.parentRule)==null?void 0:p.parentStyleSheet,e,r.styleMirror);return(m&&m!==-1||y&&y!==-1)&&t({id:m,styleId:y,remove:{property:g},index:uy(c.parentRule)}),u.apply(c,f)})}),vt(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a})}function rCe({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:r,sampling:s,doc:o}){const a=vt(c=>Yh(vt(f=>{const p=vp(f);if(!p||wr(p,e,n,!0))return;const{currentTime:g,volume:m,muted:y,playbackRate:S,loop:E}=p;t({type:c,id:r.getId(p),currentTime:g,volume:m,muted:y,playbackRate:S,loop:E})}),s.media||500)),u=[Cr("play",a(Sc.Play),o),Cr("pause",a(Sc.Pause),o),Cr("seeked",a(Sc.Seeked),o),Cr("volumechange",a(Sc.VolumeChange),o),Cr("ratechange",a(Sc.RateChange),o)];return vt(()=>{u.forEach(c=>c())})}function sCe({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,o=n.FontFace;n.FontFace=function(c,f,p){const g=new o(c,f,p);return s.set(g,{family:c,buffer:typeof f!="string",descriptors:p,fontSource:typeof f=="string"?f:JSON.stringify(Array.from(new Uint8Array(f)))}),g};const a=hu(e.fonts,"add",function(u){return function(c){return setTimeout(vt(()=>{const f=s.get(c);f&&(t(f),s.delete(c))}),0),u.apply(this,[c])}});return r.push(()=>{n.FontFace=o}),r.push(a),vt(()=>{r.forEach(u=>u())})}function oCe(t){const{doc:e,mirror:n,blockClass:r,blockSelector:s,selectionCb:o}=t;let a=!0;const u=vt(()=>{const c=e.getSelection();if(!c||a&&c?.isCollapsed)return;a=c.isCollapsed||!1;const f=[],p=c.rangeCount||0;for(let g=0;g<p;g++){const m=c.getRangeAt(g),{startContainer:y,startOffset:S,endContainer:E,endOffset:C}=m;wr(y,r,s,!0)||wr(E,r,s,!0)||f.push({start:n.getId(y),startOffset:S,end:n.getId(E),endOffset:C})}o({ranges:f})});return u(),Cr("selectionchange",u)}function iCe({doc:t,customElementCb:e}){const n=t.defaultView;return!n||!n.customElements?()=>{}:hu(n.customElements,"define",function(s){return function(o,a,u){try{e({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return s.apply(this,[o,a,u])}})}function aCe(t,e){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:a,inputCb:u,mediaInteractionCb:c,styleSheetRuleCb:f,styleDeclarationCb:p,canvasMutationCb:g,fontCb:m,selectionCb:y,customElementCb:S}=t;t.mutationCb=(...E)=>{e.mutation&&e.mutation(...E),n(...E)},t.mousemoveCb=(...E)=>{e.mousemove&&e.mousemove(...E),r(...E)},t.mouseInteractionCb=(...E)=>{e.mouseInteraction&&e.mouseInteraction(...E),s(...E)},t.scrollCb=(...E)=>{e.scroll&&e.scroll(...E),o(...E)},t.viewportResizeCb=(...E)=>{e.viewportResize&&e.viewportResize(...E),a(...E)},t.inputCb=(...E)=>{e.input&&e.input(...E),u(...E)},t.mediaInteractionCb=(...E)=>{e.mediaInteaction&&e.mediaInteaction(...E),c(...E)},t.styleSheetRuleCb=(...E)=>{e.styleSheetRule&&e.styleSheetRule(...E),f(...E)},t.styleDeclarationCb=(...E)=>{e.styleDeclaration&&e.styleDeclaration(...E),p(...E)},t.canvasMutationCb=(...E)=>{e.canvasMutation&&e.canvasMutation(...E),g(...E)},t.fontCb=(...E)=>{e.font&&e.font(...E),m(...E)},t.selectionCb=(...E)=>{e.selection&&e.selection(...E),y(...E)},t.customElementCb=(...E)=>{e.customElement&&e.customElement(...E),S(...E)}}function lCe(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};aCe(t,e);let r;t.recordDOM&&(r=IB(t,t.doc));const s=ZEe(t),o=XEe(t),a=OB(t),u=QEe(t,{win:n}),c=eCe(t),f=rCe(t);let p=()=>{},g=()=>{},m=()=>{},y=()=>{};t.recordDOM&&(p=tCe(t,{win:n}),g=NB(t,t.doc),m=nCe(t,{win:n}),t.collectFonts&&(y=sCe(t)));const S=oCe(t),E=iCe(t),C=[];for(const w of t.plugins)C.push(w.observer(w.callback,n,w.options));return vt(()=>{Rl.forEach(w=>w.reset()),r?.disconnect(),s(),o(),a(),u(),c(),f(),p(),g(),m(),y(),S(),E(),C.forEach(w=>w())})}function Fm(t){return typeof window[t]<"u"}function zm(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class s5{constructor(e){Se(this,"iframeIdToRemoteIdMap",new WeakMap),Se(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,n,r,s){const o=r||this.getIdToRemoteIdMap(e),a=s||this.getRemoteIdToIdMap(e);let u=o.get(n);return u||(u=this.generateIdFn(),o.set(n,u),a.set(u,n)),u}getIds(e,n){const r=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return n.map(o=>this.getId(e,o,r,s))}getRemoteId(e,n,r){const s=r||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;const o=s.get(n);return o||-1}getRemoteIds(e,n){const r=this.getRemoteIdToIdMap(e);return n.map(s=>this.getRemoteId(e,s,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}}class uCe{constructor(e){Se(this,"iframes",new WeakMap),Se(this,"crossOriginIframeMap",new WeakMap),Se(this,"crossOriginIframeMirror",new s5(Gz)),Se(this,"crossOriginIframeStyleMirror"),Se(this,"crossOriginIframeRootIdMap",new WeakMap),Se(this,"mirror"),Se(this,"mutationCb"),Se(this,"wrappedEmit"),Se(this,"loadListener"),Se(this,"stylesheetManager"),Se(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new s5(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){var r,s;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;const s=this.crossOriginIframeMap.get(e.source);if(!s)return;const o=this.transformCrossOriginEvent(s,n.data.event);o&&this.wrappedEmit(o,n.data.isCheckout)}transformCrossOriginEvent(e,n){var r;switch(n.type){case Ct.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);const s=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,s),this.patchRootIdOnNode(n.data.node,s),{timestamp:n.timestamp,type:Ct.IncrementalSnapshot,data:{source:ft.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Ct.Meta:case Ct.Load:case Ct.DomContentLoaded:return!1;case Ct.Plugin:return n;case Ct.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case Ct.IncrementalSnapshot:switch(n.data.source){case ft.Mutation:return n.data.adds.forEach(s=>{this.replaceIds(s,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,e);const o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(s.node,o)}),n.data.removes.forEach(s=>{this.replaceIds(s,e,["parentId","id"])}),n.data.attributes.forEach(s=>{this.replaceIds(s,e,["id"])}),n.data.texts.forEach(s=>{this.replaceIds(s,e,["id"])}),n;case ft.Drag:case ft.TouchMove:case ft.MouseMove:return n.data.positions.forEach(s=>{this.replaceIds(s,e,["id"])}),n;case ft.ViewportResize:return!1;case ft.MediaInteraction:case ft.MouseInteraction:case ft.Scroll:case ft.CanvasMutation:case ft.Input:return this.replaceIds(n.data,e,["id"]),n;case ft.StyleSheetRule:case ft.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case ft.Font:return n;case ft.Selection:return n.data.ranges.forEach(s=>{this.replaceIds(s,e,["start","end"])}),n;case ft.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),(r=n.data.styles)==null||r.forEach(s=>{this.replaceStyleIds(s,e,["styleId"])}),n}}return!1}replace(e,n,r,s){for(const o of s)!Array.isArray(n[o])&&typeof n[o]!="number"||(Array.isArray(n[o])?n[o]=e.getIds(r,n[o]):n[o]=e.getId(r,n[o]));return n}replaceIds(e,n,r){return this.replace(this.crossOriginIframeMirror,e,n,r)}replaceStyleIds(e,n,r){return this.replace(this.crossOriginIframeStyleMirror,e,n,r)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(e,n){e.type!==TB.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class cCe{constructor(e){Se(this,"shadowDoms",new WeakSet),Se(this,"mutationCb"),Se(this,"scrollCb"),Se(this,"bypassOptions"),Se(this,"mirror"),Se(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!yh(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=IB({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(OB({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(rt.host(e))),this.restoreHandlers.push(NB({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,n){const r=this;this.restoreHandlers.push(hu(e.prototype,"attachShadow",function(s){return function(o){const a=s.call(this,o),u=rt.shadowRoot(this);return u&&AB(this)&&r.addShadowRoot(u,n),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Oc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dCe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var jm=0;jm<Oc.length;jm++)dCe[Oc.charCodeAt(jm)]=jm;var fCe=function(t){var e=new Uint8Array(t),n,r=e.length,s="";for(n=0;n<r;n+=3)s+=Oc[e[n]>>2],s+=Oc[(e[n]&3)<<4|e[n+1]>>4],s+=Oc[(e[n+1]&15)<<2|e[n+2]>>6],s+=Oc[e[n+2]&63];return r%3===2?s=s.substring(0,s.length-1)+"=":r%3===1&&(s=s.substring(0,s.length-2)+"=="),s};const o5=new Map;function hCe(t,e){let n=o5.get(t);return n||(n=new Map,o5.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}const MB=(t,e,n)=>{if(!t||!(kB(t,e)||typeof t=="object"))return;const r=t.constructor.name,s=hCe(n,r);let o=s.indexOf(t);return o===-1&&(o=s.length,s.push(t)),o};function mv(t,e,n){if(t instanceof Array)return t.map(r=>mv(r,e,n));if(t===null)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){const r=t.constructor.name,s=fCe(t);return{rr_type:r,base64:s}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[mv(t.buffer,e,n),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const r=t.constructor.name,{src:s}=t;return{rr_type:r,src:s}}else if(t instanceof HTMLCanvasElement){const r="HTMLImageElement",s=t.toDataURL();return{rr_type:r,src:s}}else{if(t instanceof ImageData)return{rr_type:t.constructor.name,args:[mv(t.data,e,n),t.width,t.height]};if(kB(t,e)||typeof t=="object"){const r=t.constructor.name,s=MB(t,e,n);return{rr_type:r,index:s}}}}return t}const PB=(t,e,n)=>t.map(r=>mv(r,e,n)),kB=(t,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(s=>typeof e[s]=="function").find(s=>t instanceof e[s]);function pCe(t,e,n,r){const s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const a of o)try{if(typeof e.CanvasRenderingContext2D.prototype[a]!="function")continue;const u=hu(e.CanvasRenderingContext2D.prototype,a,function(c){return function(...f){return wr(this.canvas,n,r,!0)||setTimeout(()=>{const p=PB(f,e,this);t(this.canvas,{type:Xc["2D"],property:a,args:p})},0),c.apply(this,f)}});s.push(u)}catch{const u=Lb(e.CanvasRenderingContext2D.prototype,a,{set(c){t(this.canvas,{type:Xc["2D"],property:a,args:[c],setter:!0})}});s.push(u)}return()=>{s.forEach(a=>a())}}function gCe(t){return t==="experimental-webgl"?"webgl":t}function i5(t,e,n,r){const s=[];try{const o=hu(t.HTMLCanvasElement.prototype,"getContext",function(a){return function(u,...c){if(!wr(this,e,n,!0)){const f=gCe(u);if("__context"in this||(this.__context=f),r&&["webgl","webgl2"].includes(f))if(c[0]&&typeof c[0]=="object"){const p=c[0];p.preserveDrawingBuffer||(p.preserveDrawingBuffer=!0)}else c.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[u,...c])}});s.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(o=>o())}}function a5(t,e,n,r,s,o){const a=[],u=Object.getOwnPropertyNames(t);for(const c of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof t[c]!="function")continue;const f=hu(t,c,function(p){return function(...g){const m=p.apply(this,g);if(MB(m,o,this),"tagName"in this.canvas&&!wr(this.canvas,r,s,!0)){const y=PB(g,o,this),S={type:e,property:c,args:y};n(this.canvas,S)}return m}});a.push(f)}catch{const f=Lb(t,c,{set(p){n(this.canvas,{type:e,property:c,args:[p],setter:!0})}});a.push(f)}return a}function mCe(t,e,n,r){const s=[];return s.push(...a5(e.WebGLRenderingContext.prototype,Xc.WebGL,t,n,r,e)),typeof e.WebGL2RenderingContext<"u"&&s.push(...a5(e.WebGL2RenderingContext.prototype,Xc.WebGL2,t,n,r,e)),()=>{s.forEach(o=>o())}}const DB="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",vCe=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),l5=typeof window<"u"&&window.Blob&&new Blob([vCe(DB)],{type:"text/javascript;charset=utf-8"});function yCe(t){let e;try{if(e=l5&&(window.URL||window.webkitURL).createObjectURL(l5),!e)throw"";const n=new Worker(e,{name:t?.name});return n.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),n}catch{return new Worker("data:text/javascript;base64,"+DB,{name:t?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class bCe{constructor(e){Se(this,"pendingCanvasMutations",new Map),Se(this,"rafStamps",{latestId:0,invokeId:null}),Se(this,"mirror"),Se(this,"mutationCb"),Se(this,"resetObservers"),Se(this,"frozen",!1),Se(this,"locked",!1),Se(this,"processMutation",(c,f)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(f)});const{sampling:n="all",win:r,blockClass:s,blockSelector:o,recordCanvas:a,dataURLOptions:u}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&n==="all"&&this.initCanvasMutationObserver(r,s,o),a&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,s,o,{dataURLOptions:u})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,n,r,s,o){const a=i5(n,r,s,!0),u=new Map,c=new yCe;c.onmessage=S=>{const{id:E}=S.data;if(u.set(E,!1),!("base64"in S.data))return;const{base64:C,type:w,width:A,height:T}=S.data;this.mutationCb({id:E,type:Xc["2D"],commands:[{property:"clearRect",args:[0,0,A,T]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:C}],type:w}]},0,0]}]})};const f=1e3/e;let p=0,g;const m=()=>{const S=[];return n.document.querySelectorAll("canvas").forEach(E=>{wr(E,r,s,!0)||S.push(E)}),S},y=S=>{if(p&&S-p<f){g=requestAnimationFrame(y);return}p=S,m().forEach(async E=>{var C;const w=this.mirror.getId(E);if(u.get(w)||E.width===0||E.height===0)return;if(u.set(w,!0),["webgl","webgl2"].includes(E.__context)){const T=E.getContext(E.__context);((C=T?.getContextAttributes())==null?void 0:C.preserveDrawingBuffer)===!1&&T.clear(T.COLOR_BUFFER_BIT)}const A=await createImageBitmap(E);c.postMessage({id:w,bitmap:A,width:E.width,height:E.height,dataURLOptions:o.dataURLOptions},[A])}),g=requestAnimationFrame(y)};g=requestAnimationFrame(y),this.resetObservers=()=>{a(),cancelAnimationFrame(g)}}initCanvasMutationObserver(e,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=i5(e,n,r,!1),o=pCe(this.processMutation.bind(this),e,n,r),a=mCe(this.processMutation.bind(this),e,n,r);this.resetObservers=()=>{s(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=n=>{this.rafStamps.latestId=n,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||n===-1)return;const s=r.map(a=>{const{type:u,...c}=a;return c}),{type:o}=r[0];this.mutationCb({id:n,type:o,commands:s}),this.pendingCanvasMutations.delete(e)}}class SCe{constructor(e){Se(this,"trackedLinkElements",new WeakSet),Se(this,"mutationCb"),Se(this,"adoptedStyleSheetCb"),Se(this,"styleMirror",new BEe),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;const r={id:n,styleIds:[]},s=[];for(const o of e){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),s.push({styleId:a,rules:Array.from(o.rules||CSSRule,(u,c)=>({rule:qz(u,o.href),index:c}))})),r.styleIds.push(a)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class ECe{constructor(){Se(this,"nodeMap",new WeakMap),Se(this,"active",!1)}inOtherBuffer(e,n){const r=this.nodeMap.get(e);return r&&Array.from(r).some(s=>s!==n)}add(e,n){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}destroy(){}}let gn,vv,Rx,cy=!1;try{if(Array.from([1],t=>t*2)[0]!==2){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=((d4=t.contentWindow)==null?void 0:d4.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}const Bs=wbe();function yp(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:c="rr-mask",maskTextSelector:f=null,inlineStylesheet:p=!0,maskAllInputs:g,maskInputOptions:m,slimDOMOptions:y,maskInputFn:S,maskTextFn:E,hooks:C,packFn:w,sampling:A={},dataURLOptions:T={},mousemoveWait:R,recordDOM:N=!0,recordCanvas:O=!1,recordCrossOriginIframes:I=!1,recordAfter:k=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:F=!1,collectFonts:$=!1,inlineImages:D=!1,plugins:z,keepIframeSrcFn:q=()=>!1,ignoreCSSAttributes:Y=new Set([]),errorHandler:te}=t;KEe(te);const H=I?window.parent===window:!0;let ee=!1;if(!H)try{window.parent.document&&(ee=!1)}catch{ee=!0}if(H&&!e)throw new Error("emit function is required");if(!H&&!ee)return()=>{};R!==void 0&&A.mousemove===void 0&&(A.mousemove=R),Bs.reset();const fe=g===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:m!==void 0?m:{password:!0},de=Xz(y);jEe();let Ae,L=0;const G=Ee=>{for(const pt of z||[])pt.eventProcessor&&(Ee=pt.eventProcessor(Ee));return w&&!ee&&(Ee=w(Ee)),Ee};gn=(Ee,pt)=>{var Ce;const ze=Ee;if(ze.timestamp=ly(),(Ce=Rl[0])!=null&&Ce.isFrozen()&&ze.type!==Ct.FullSnapshot&&!(ze.type===Ct.IncrementalSnapshot&&ze.data.source===ft.Mutation)&&Rl.forEach(je=>je.unfreeze()),H)e?.(G(ze),pt);else if(ee){const je={type:"rrweb",event:G(ze),origin:window.location.origin,isCheckout:pt};window.parent.postMessage(je,"*")}if(ze.type===Ct.FullSnapshot)Ae=ze,L=0;else if(ze.type===Ct.IncrementalSnapshot){if(ze.data.source===ft.Mutation&&ze.data.isAttachIframe)return;L++;const je=r&&L>=r,He=n&&ze.timestamp-Ae.timestamp>n;(je||He)&&vv(!0)}};const K=Ee=>{gn({type:Ct.IncrementalSnapshot,data:{source:ft.Mutation,...Ee}})},J=Ee=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.Scroll,...Ee}}),oe=Ee=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.CanvasMutation,...Ee}}),he=Ee=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.AdoptedStyleSheet,...Ee}}),ue=new SCe({mutationCb:K,adoptedStyleSheetCb:he}),ve=new uCe({mirror:Bs,mutationCb:K,stylesheetManager:ue,recordCrossOriginIframes:I,wrappedEmit:gn});for(const Ee of z||[])Ee.getMirror&&Ee.getMirror({nodeMirror:Bs,crossOriginIframeMirror:ve.crossOriginIframeMirror,crossOriginIframeStyleMirror:ve.crossOriginIframeStyleMirror});const xe=new ECe;Rx=new bCe({recordCanvas:O,mutationCb:oe,win:window,blockClass:s,blockSelector:o,mirror:Bs,sampling:A.canvas,dataURLOptions:T});const Xe=new cCe({mutationCb:K,scrollCb:J,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:f,inlineStylesheet:p,maskInputOptions:fe,dataURLOptions:T,maskTextFn:E,maskInputFn:S,recordCanvas:O,inlineImages:D,sampling:A,slimDOMOptions:de,iframeManager:ve,stylesheetManager:ue,canvasManager:Rx,keepIframeSrcFn:q,processedNodeManager:xe},mirror:Bs});vv=(Ee=!1)=>{if(!N)return;gn({type:Ct.Meta,data:{href:window.location.href,width:SB(),height:bB()}},Ee),ue.reset(),Xe.init(),Rl.forEach(Ce=>Ce.lock());const pt=Gbe(document,{mirror:Bs,blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:f,inlineStylesheet:p,maskAllInputs:fe,maskTextFn:E,maskInputFn:S,slimDOM:de,dataURLOptions:T,recordCanvas:O,inlineImages:D,onSerialize:Ce=>{wB(Ce,Bs)&&ve.addIframe(Ce),xB(Ce,Bs)&&ue.trackLinkElement(Ce),vA(Ce)&&Xe.addShadowRoot(rt.shadowRoot(Ce),document)},onIframeLoad:(Ce,ze)=>{ve.attachIframe(Ce,ze),Xe.observeAttachShadow(Ce)},onStylesheetLoad:(Ce,ze)=>{ue.attachLinkElement(Ce,ze)},keepIframeSrcFn:q});if(!pt)return console.warn("Failed to snapshot the document");gn({type:Ct.FullSnapshot,data:{node:pt,initialOffset:yB(window)}},Ee),Rl.forEach(Ce=>Ce.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ue.adoptStyleSheets(document.adoptedStyleSheets,Bs.getId(document))};try{const Ee=[],pt=ze=>{var je;return vt(lCe)({mutationCb:K,mousemoveCb:(He,gr)=>gn({type:Ct.IncrementalSnapshot,data:{source:gr,positions:He}}),mouseInteractionCb:He=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.MouseInteraction,...He}}),scrollCb:J,viewportResizeCb:He=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.ViewportResize,...He}}),inputCb:He=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.Input,...He}}),mediaInteractionCb:He=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.MediaInteraction,...He}}),styleSheetRuleCb:He=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.StyleSheetRule,...He}}),styleDeclarationCb:He=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.StyleDeclaration,...He}}),canvasMutationCb:oe,fontCb:He=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.Font,...He}}),selectionCb:He=>{gn({type:Ct.IncrementalSnapshot,data:{source:ft.Selection,...He}})},customElementCb:He=>{gn({type:Ct.IncrementalSnapshot,data:{source:ft.CustomElement,...He}})},blockClass:s,ignoreClass:a,ignoreSelector:u,maskTextClass:c,maskTextSelector:f,maskInputOptions:fe,inlineStylesheet:p,sampling:A,recordDOM:N,recordCanvas:O,inlineImages:D,userTriggeredOnInput:F,collectFonts:$,doc:ze,maskInputFn:S,maskTextFn:E,keepIframeSrcFn:q,blockSelector:o,slimDOMOptions:de,dataURLOptions:T,mirror:Bs,iframeManager:ve,stylesheetManager:ue,shadowDomManager:Xe,processedNodeManager:xe,canvasManager:Rx,ignoreCSSAttributes:Y,plugins:((je=z?.filter(He=>He.observer))==null?void 0:je.map(He=>({observer:He.observer,options:He.options,callback:gr=>gn({type:Ct.Plugin,data:{plugin:He.name,payload:gr}})})))||[]},C)};ve.addLoadListener(ze=>{try{Ee.push(pt(ze.contentDocument))}catch(je){console.warn(je)}});const Ce=()=>{vv(),Ee.push(pt(document)),cy=!0};return["interactive","complete"].includes(document.readyState)?Ce():(Ee.push(Cr("DOMContentLoaded",()=>{gn({type:Ct.DomContentLoaded,data:{}}),k==="DOMContentLoaded"&&Ce()})),Ee.push(Cr("load",()=>{gn({type:Ct.Load,data:{}}),k==="load"&&Ce()},window))),()=>{Ee.forEach(ze=>{try{ze()}catch(je){String(je).toLowerCase().includes("cross-origin")||console.warn(je)}}),xe.destroy(),cy=!1,YEe()}}catch(Ee){console.warn(Ee)}}yp.addCustomEvent=(t,e)=>{if(!cy)throw new Error("please add custom event after start recording");gn({type:Ct.Custom,data:{tag:t,payload:e}})};yp.freezePage=()=>{Rl.forEach(t=>t.freeze())};yp.takeFullSnapshot=t=>{if(!cy)throw new Error("please take full snapshot after start recording");vv(t)};yp.mirror=Bs;var u5;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(u5||(u5={}));const CCe="rrweb",wCe={maskAllInputs:!0,maskTextSelector:"*",maskInputOptions:void 0},xCe={additionalSampleRate:1,batchSize:50,flushInterval:5e3,recordOptions:{slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,recordCrossOriginIframes:!1}},c5=xCe;class _Ce extends Ns{constructor(e){super(CCe),this.recordingEvents=[],this.isRecording=!1,this.recordingStartTime=null,this.flushTimer=null,this.stopRecording=null,this.enabled=!1;const n=Object.assign(Object.assign(Object.assign({},c5.recordOptions),e?.recordOptions),wCe);this.config=Object.assign(Object.assign(Object.assign({},c5),e),{recordOptions:n}),be.info("RRWebPlugin initialized",{additionalSampleRate:this.config.additionalSampleRate,batchSize:this.config.batchSize,flushInterval:this.config.flushInterval})}enable(){var e;if(this.enabled){be.info("RRWebPlugin already enabled");return}const n=(e=this.context)===null||e===void 0?void 0:e.getSession();if(!n||!n.record){be.warn("RRWebPlugin skipping - session not being recorded",{hasSession:!!n,sessionRecord:n?.record});return}const r=Math.random();if(r>this.config.additionalSampleRate){be.warn("RRWebPlugin skipping - session replay additionalSampleRate",{randomValue:r,samplingRate:this.config.additionalSampleRate});return}this.enabled=!0,be.info("RRWebPlugin enabled - starting recording"),this.startRecording()}disable(){if(!this.enabled){be.info("RRWebPlugin already disabled");return}be.info("RRWebPlugin disabled - stopping recording"),this.enabled=!1,this.stopCurrentRecording()}record(e){const n=e?.action;n==="start"?(be.info("RRWebPlugin manual start recording"),this.startRecording()):n==="stop"&&(be.info("RRWebPlugin manual stop recording"),this.stopCurrentRecording())}onload(){}startRecording(){this.recordingStartTime=Date.now(),this.recordingEvents=[],this.isRecording=!0,be.info("RRWebPlugin starting rrweb recording",{startTime:this.recordingStartTime});const e=yp(Object.assign(Object.assign({},this.config.recordOptions),{emit:this.handleRRWebEvent.bind(this)}));e?(this.stopRecording=e,be.info("RRWebPlugin rrweb recording initialized successfully")):be.warn("RRWebPlugin failed to initialize rrweb recording"),this.flushTimer=window.setInterval(()=>{this.flush()},this.config.flushInterval)}stopCurrentRecording(){if(!this.isRecording){be.info("RRWebPlugin stopCurrentRecording called but not recording");return}be.info("RRWebPlugin stopping current recording"),this.isRecording=!1,this.stopRecording&&(this.stopRecording(),this.stopRecording=null,be.info("RRWebPlugin rrweb recording stopped")),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null,be.info("RRWebPlugin flush timer cleared")),this.flush()}handleRRWebEvent(e){this.isRecording&&(this.recordingEvents.push(e),this.recordingEvents.length>=this.config.batchSize&&(be.info("RRWebPlugin flushing events due to batch size",{eventCount:this.recordingEvents.length,batchSize:this.config.batchSize}),this.flush()))}flush(){if(this.recordingEvents.length===0){be.info("RRWebPlugin flushEvent called but no events to flush");return}be.info("RRWebPlugin flushing events",{eventCount:this.recordingEvents.length});const e=[...this.recordingEvents],n={version:"1.0.0",events:e,eventCount:e.length};this.context.record(YU,n),be.info("RRWebPlugin events sent to RUM",{eventType:YU,eventCount:this.recordingEvents.length}),this.recordingEvents=[]}}var ACe=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n},bA;(function(t){t.Path="PATH",t.Hash="HASH",t.PathAndHash="PATH_AND_HASH"})(bA||(bA={}));const LB="us-west-2",SA=`https://dataplane.rum.${LB}.amazonaws.com`,UB=()=>({unique:!1,domain:window.location.hostname,path:"/",sameSite:"Strict",secure:!0}),FB=t=>({allowCookies:!1,batchLimit:100,client:Zme,compressionStrategy:{enabled:!0},cookieAttributes:t,debug:!1,disableAutoPageView:!1,dispatchInterval:5*1e3,enableRumClient:!0,enableXRay:!1,endpoint:SA,endpointUrl:new URL(SA),eventCacheSize:1e3,eventPluginsToLoad:[],pageIdFormat:bA.Path,pagesToExclude:[],pagesToInclude:[/.*/],signing:!1,recordResourceUrl:!0,retries:2,routeChangeComplete:100,routeChangeTimeout:1e4,sessionAttributes:{},sessionEventLimit:200,sessionLengthSeconds:1800,sessionSampleRate:1,suppressSessionStartEvent:!1,useBeacon:!0,userIdRetentionDays:30,enableW3CTraceId:!1,candidatesCacheSize:10});let TCe=class{constructor(e,n,r,s={}){var{cookieAttributes:o}=s,a=ACe(s,["cookieAttributes"]);this.eventBus=new Rz,typeof r>"u"&&(r="us-west-2"),this.applicationId=e;const u=Object.assign(Object.assign({},UB()),o);this.config=Object.assign(Object.assign({fetchFunction:fetch},FB(u)),a),this.config.sessionId&&(this.config.suppressSessionStartEvent=!0),this.config.endpoint=a.endpoint?a.endpoint:SA.replace(LB,r),this.config.endpointUrl=new URL(this.config.endpoint),be.configure(this.config.debug),be.info("Initialized RUM Slim"),this.eventCache=new aye({id:e,version:n},this.config,this.eventBus),this.dispatchManager=this.initDispatch(r,e),this.pluginManager=this.initPluginManager(e,n),this.eventCache.setPluginFlushHook(()=>this.pluginManager.flush()),this.config.enableRumClient?this.enable():this.disable()}setAwsCredentials(e){this.dispatchManager.setAwsCredentials(e)}setSigningConfigFactory(e){this.dispatchManager.setSigningConfigFactory(e)}addSessionAttributes(e){this.eventCache.addSessionAttributes(e)}getSessionId(){return this.eventCache.getSessionId()}pinSessionId(e){this.eventCache.pinSessionId(e)}startSession(e){return this.eventCache.startSession(e)}getUserId(){return this.eventCache.getUserId()}pinUserId(e){this.eventCache.pinUserId(e)}setEventMetadataHook(e){this.eventCache.setEventMetadataHook(e)}clearEventMetadataHook(){this.eventCache.clearEventMetadataHook()}addPlugin(e){this.pluginManager.addPlugin(e)}dispatch(){this.dispatchManager.dispatchFetch()}dispatchBeacon(){this.dispatchManager.dispatchBeacon()}enable(){this.eventCache.enable(),this.pluginManager.enable(),this.dispatchManager.enable()}disable(){this.dispatchManager.disable(),this.pluginManager.disable(),this.eventCache.disable()}allowCookies(e){this.config.allowCookies=e}clearCookies(){const e=this.config.cookieAttributes;[$v,qv,qc,`${$v}_${this.applicationId}`,`${qv}_${this.applicationId}`,`${qc}_${this.applicationId}`].forEach(r=>Jve(r,e))}recordPageView(e){this.eventCache.recordPageView(e)}recordError(e){this.pluginManager.record("com.amazonaws.rum.js-error",e)}registerDomEvents(e){this.pluginManager.updatePlugin("com.amazonaws.rum.dom-event",e)}recordEvent(e,n,r){this.eventCache.recordEvent(e,n,r)}initDispatch(e,n){return new Xme(n,e,this.config.endpointUrl,this.eventCache,this.config)}initPluginManager(e,n){const r={applicationId:e,applicationVersion:n,config:this.config,record:this.eventCache.recordEvent,recordCandidate:this.eventCache.recordCandidate,recordPageView:this.eventCache.recordPageView,getSession:this.eventCache.getSession,eventBus:this.eventBus},s=new Qve(r);return this.config.disableAutoPageView||s.addPlugin(new _ye),this.config.eventPluginsToLoad.forEach(o=>{s.addPlugin(o)}),s}};var Ks;(function(t){t.Errors="errors",t.Performance="performance",t.Interaction="interaction",t.Http="http",t.Replay="replay"})(Ks||(Ks={}));var d5;(function(t){t.Path="PATH",t.Hash="HASH",t.PathAndHash="PATH_AND_HASH"})(d5||(d5={}));const RCe=t=>Object.assign(Object.assign({},FB(t)),{signing:!0,telemetries:[Ks.Errors,Ks.Performance,Ks.Http,Ks.Replay]});class ICe extends TCe{constructor(e,n,r,s={}){super(e,n,r,Object.assign(Object.assign({},RCe(UB())),s)),be.info(`RUM client initialized for app: ${e}`),be.info(`Telemetries enabled: ${this.config.telemetries.join(", ")||"none"}`)}initDispatch(e,n){const r=super.initDispatch(e,n);return r.setSigningConfigFactory(Ave),r.setCognitoCredentialProviderFactory((s,o,a,u)=>{const c={identityPoolId:a,guestRoleArn:u,cookieAttributes:s.cookieAttributes};return a&&u?new Hve(c,o).ChainAnonymousCredentialsProvider:new $ve(c,o).ChainAnonymousCredentialsProvider}),this.config.signing&&this.config.identityPoolId&&r.setCognitoCredentials(this.config.identityPoolId,this.config.guestRoleArn),r}initPluginManager(e,n){const r=super.initPluginManager(e,n);return this.constructBuiltinPlugins().forEach(o=>{r.addPlugin(o)}),r}recordError(e){this.pluginManager.record(Nz,e)}registerDomEvents(e){this.pluginManager.updatePlugin(Iz,e)}constructBuiltinPlugins(){let e=[];const n=this.telemetryFunctor();return this.config.telemetries.forEach(r=>{typeof r=="string"&&n[r.toLowerCase()]?e=[...e,...n[r.toLowerCase()]({})]:Array.isArray(r)&&n[r[0].toLowerCase()]&&(e=[...e,...n[r[0].toLowerCase()](r[1])])}),e}telemetryFunctor(){return{[Ks.Errors]:e=>[new yye(e)],[Ks.Performance]:e=>[new Eye(e),new Tye(e),new Gye(e)],[Ks.Interaction]:e=>[new xR(e)],[Ks.Http]:e=>[new Qye(e),new Yye(e)],[Ks.Replay]:e=>[new _Ce(e)]}}}const zB={recordPageView:()=>{},recordError:()=>{},recordEvent:()=>{},recordTiming:()=>{}},OCe=/([?&](token|access_token|id_token|authorization)=[^&]*)|\/messages\/[a-z0-9_-]+/gi;function jB(t){return t.replace(OCe,"[redacted]")}function NCe(t){const e=t.indexOf("?"),n=t.indexOf("#"),r=e===-1&&n===-1?t.length:e===-1?n:n===-1?e:Math.min(e,n);return jB(t.slice(0,r))}function MCe(t){const e=jB(t.message);if(e===t.message)return t;const n=new Error(e);return n.name=t.name,n.stack=t.stack,n}function PCe(t){return{recordPageView(e){t.recordPageView(NCe(e))},recordError(e,n){t.recordError(MCe(e)),n&&t.recordEvent("telemetry.error_context",n)},recordEvent(e,n){t.recordEvent(e,n??{})},recordTiming(e,n,r){t.recordEvent("telemetry.timing",{...r,name:e,durationMs:String(n)})}}}function f5(t){return t instanceof Error?t:new Error(String(t))}function kCe(t){window.addEventListener("error",e=>{t.recordError(f5(e.error??e.message))}),window.addEventListener("unhandledrejection",e=>{t.recordError(f5(e.reason))})}function DCe(){const{appMonitorId:t,identityPoolId:e,region:n}=My().rum;if(!t)return zB;const r=new ICe(t,"1.0.0",n,{sessionSampleRate:1,identityPoolId:e,endpoint:`https://dataplane.rum.${n}.amazonaws.com`,telemetries:["performance"],disableAutoPageView:!0,allowCookies:!1,enableXRay:!1}),s=PCe(r);return kCe(s),s}const BB=_.createContext(zB);function NRe(){return _.useContext(BB)}const EA="remit.theme",LCe="dark";function h5(){return typeof localStorage>"u"?"system":localStorage.getItem(EA)??"system"}function CA(t){if(typeof document>"u")return;const e=t==="dark"||t==="system"&&typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.classList.toggle(LCe,e)}function MRe(t){typeof localStorage<"u"&&(t==="system"?localStorage.removeItem(EA):localStorage.setItem(EA,t)),CA(t)}const UCe=()=>{if(typeof window>"u"||(CA(h5()),typeof window.matchMedia!="function"))return;const t=window.matchMedia("(prefers-color-scheme: dark)"),e=()=>{CA(h5())};typeof t.addEventListener=="function"?t.addEventListener("change",e):t.addListener(e)},FCe=(t,e,n,r)=>{const s=[n,{code:e,...r||{}}];if(t?.services?.logger?.forward)return t.services.logger.forward(s,"warn","react-i18next::",!0);Fl(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),t?.services?.logger?.warn?t.services.logger.warn(...s):console?.warn&&console.warn(...s)},p5={},wA=(t,e,n,r)=>{Fl(n)&&p5[n]||(Fl(n)&&(p5[n]=new Date),FCe(t,e,n,r))},HB=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},xA=(t,e,n)=>{t.loadNamespaces(e,HB(t,n))},g5=(t,e,n,r)=>{if(Fl(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return xA(t,n,r);n.forEach(s=>{t.options.ns.indexOf(s)<0&&t.options.ns.push(s)}),t.loadLanguages(e,HB(t,r))},zCe=(t,e,n={})=>!e.languages||!e.languages.length?(wA(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,s)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,t))return!1}}),Fl=t=>typeof t=="string",jCe=t=>typeof t=="object"&&t!==null,BCe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,HCe={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},$Ce=t=>HCe[t],qCe=t=>t.replace(BCe,$Ce);let _A={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:qCe};const WCe=(t={})=>{_A={..._A,...t}},VCe=()=>_A;let $B;const GCe=t=>{$B=t},KCe=()=>$B,YCe={type:"3rdParty",init(t){WCe(t.options.react),GCe(t)}},ZCe=_.createContext();class XCe{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const QCe=(t,e)=>{const n=_.useRef();return _.useEffect(()=>{n.current=t},[t,e]),n.current},qB=(t,e,n,r)=>t.getFixedT(e,n,r),JCe=(t,e,n,r)=>_.useCallback(qB(t,e,n,r),[t,e,n,r]),ewe=(t,e={})=>{const{i18n:n}=e,{i18n:r,defaultNS:s}=_.useContext(ZCe)||{},o=n||r||KCe();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new XCe),!o){wA(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const R=(O,I)=>Fl(I)?I:jCe(I)&&Fl(I.defaultValue)?I.defaultValue:Array.isArray(O)?O[O.length-1]:O,N=[R,{},!1];return N.t=R,N.i18n={},N.ready=!1,N}o.options.react?.wait&&wA(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...VCe(),...o.options.react,...e},{useSuspense:u,keyPrefix:c}=a;let f=t||s||o.options?.defaultNS;f=Fl(f)?[f]:f||["translation"],o.reportNamespaces.addUsedNamespaces?.(f);const p=(o.isInitialized||o.initializedStoreOnce)&&f.every(R=>zCe(R,o,a)),g=JCe(o,e.lng||null,a.nsMode==="fallback"?f:f[0],c),m=()=>g,y=()=>qB(o,e.lng||null,a.nsMode==="fallback"?f:f[0],c),[S,E]=_.useState(m);let C=f.join();e.lng&&(C=`${e.lng}${C}`);const w=QCe(C),A=_.useRef(!0);_.useEffect(()=>{const{bindI18n:R,bindI18nStore:N}=a;A.current=!0,!p&&!u&&(e.lng?g5(o,e.lng,f,()=>{A.current&&E(y)}):xA(o,f,()=>{A.current&&E(y)})),p&&w&&w!==C&&A.current&&E(y);const O=()=>{A.current&&E(y)};return R&&o?.on(R,O),N&&o?.store.on(N,O),()=>{A.current=!1,o&&R&&R?.split(" ").forEach(I=>o.off(I,O)),N&&o&&N.split(" ").forEach(I=>o.store.off(I,O))}},[o,C]),_.useEffect(()=>{A.current&&p&&E(m)},[o,c,p]);const T=[S,o,p];if(T.t=S,T.i18n=o,T.ready=p,p||!p&&!u)return T;throw new Promise(R=>{e.lng?g5(o,e.lng,f,()=>R()):xA(o,f,()=>R())})},twe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts",...t,headers:{"Content-Type":"application/json",...t.headers}}),nwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/oauth/microsoft/start",...t,headers:{"Content-Type":"application/json",...t.headers}}),rwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/test-connection",...t,headers:{"Content-Type":"application/json",...t.headers}}),swe=t=>(t.client??We).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}",...t}),owe=t=>(t.client??We).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),iwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters",...t}),awe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters",...t,headers:{"Content-Type":"application/json",...t.headers}}),lwe=t=>(t.client??We).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters/{filterId}",...t}),uwe=t=>(t.client??We).put({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/folder-roles/{role}",...t,headers:{"Content-Type":"application/json",...t.headers}}),cwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/mailboxes",...t}),dwe=t=>(t.client??We).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/mailboxes/{mailboxId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),fwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize",...t,headers:{"Content-Type":"application/json",...t.headers}}),hwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize/preview",...t,headers:{"Content-Type":"application/json",...t.headers}}),pwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize/{organizeJobId}",...t}),gwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/sync",...t}),mwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/sync/status",...t}),vwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/addresses/search",...t}),ywe=t=>(t.client??We).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/addresses/{addressId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),bwe=t=>(t?.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/config",...t}),PRe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/mailboxes/{mailboxId}/threads",...t}),Swe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/mailboxes/{mailboxId}/threads/search",...t}),Ewe=t=>(t.client??We).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/me",...t,headers:{"Content-Type":"application/json",...t.headers}}),Cwe=t=>(t?.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/me/export",...t}),wwe=t=>(t?.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/me/vip-suggestions",...t}),xwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/delete",...t,headers:{"Content-Type":"application/json",...t.headers}}),_we=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/flags",...t,headers:{"Content-Type":"application/json",...t.headers}}),Awe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/move",...t,headers:{"Content-Type":"application/json",...t.headers}}),Twe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}",...t}),Rwe=t=>(t.client??We).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}/flags",...t,headers:{"Content-Type":"application/json",...t.headers}}),Iwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}/raw",...t}),Owe=t=>(t?.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox",...t}),Nwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox",...t,headers:{"Content-Type":"application/json",...t.headers}}),Mwe=t=>(t.client??We).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t}),Pwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t}),kwe=t=>(t.client??We).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),Dwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}/send",...t}),Lwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/search/semantic",...t}),Uwe=t=>(t?.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/system/update",...t}),Fwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/system/update",...t,headers:{"Content-Type":"application/json",...t.headers}}),zwe=t=>(t?.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/threads",...t}),jwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/threads/{threadId}/messages",...t}),kRe=t=>({mutationFn:async n=>{const{data:r}=await twe({...t,...n,throwOnError:!0});return r}}),ar=(t,e,n,r)=>{const s={_id:t,baseUrl:e?.baseUrl||(e?.client??We).getConfig().baseUrl};return e?.body&&(s.body=e.body),e?.headers&&(s.headers=e.headers),e?.path&&(s.path=e.path),e?.query&&(s.query=e.query),[s]},DRe=t=>({mutationFn:async n=>{const{data:r}=await nwe({...t,...n,throwOnError:!0});return r}}),LRe=t=>({mutationFn:async n=>{const{data:r}=await rwe({...t,...n,throwOnError:!0});return r}}),URe=t=>({mutationFn:async n=>{const{data:r}=await swe({...t,...n,throwOnError:!0});return r}}),FRe=t=>({mutationFn:async n=>{const{data:r}=await owe({...t,...n,throwOnError:!0});return r}}),Bwe=t=>ar("filterOperationsListFilters",t),zRe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await iwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Bwe(t)}),jRe=t=>({mutationFn:async n=>{const{data:r}=await awe({...t,...n,throwOnError:!0});return r}}),BRe=t=>({mutationFn:async n=>{const{data:r}=await lwe({...t,...n,throwOnError:!0});return r}}),HRe=t=>({mutationFn:async n=>{const{data:r}=await uwe({...t,...n,throwOnError:!0});return r}}),Hwe=t=>ar("mailboxOperationsListMailboxes",t),$Re=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await cwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Hwe(t)}),qRe=t=>({mutationFn:async n=>{const{data:r}=await dwe({...t,...n,throwOnError:!0});return r}}),WRe=t=>({mutationFn:async n=>{const{data:r}=await fwe({...t,...n,throwOnError:!0});return r}}),VRe=t=>({mutationFn:async n=>{const{data:r}=await hwe({...t,...n,throwOnError:!0});return r}}),$we=t=>ar("organizeJobDetailOperationsGetOrganizeJob",t),GRe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await pwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:$we(t)}),KRe=t=>({mutationFn:async n=>{const{data:r}=await gwe({...t,...n,throwOnError:!0});return r}}),qwe=t=>ar("syncOperationsGetSyncStatus",t),YRe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await mwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:qwe(t)}),Wwe=t=>ar("addressOperationsSearchAddresses",t),ZRe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await vwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Wwe(t)}),XRe=t=>({mutationFn:async n=>{const{data:r}=await ywe({...t,...n,throwOnError:!0});return r}}),Vwe=t=>ar("configOperationsGetConfig",t),Gwe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await bwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Vwe(t)}),QRe=t=>ar("threadOperationsListThreads",t),Kwe=t=>ar("threadOperationsSearchThreads",t),JRe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Swe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Kwe(t)}),eIe=t=>({mutationFn:async n=>{const{data:r}=await Ewe({...t,...n,throwOnError:!0});return r}}),tIe=t=>({mutationFn:async n=>{const{data:r}=await Cwe({...t,...n,throwOnError:!0});return r}}),Ywe=t=>ar("meOperationsListVipSuggestions",t),nIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await wwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Ywe(t)}),rIe=t=>({mutationFn:async n=>{const{data:r}=await xwe({...t,...n,throwOnError:!0});return r}}),sIe=t=>({mutationFn:async n=>{const{data:r}=await _we({...t,...n,throwOnError:!0});return r}}),oIe=t=>({mutationFn:async n=>{const{data:r}=await Awe({...t,...n,throwOnError:!0});return r}}),Zwe=t=>ar("messageOperationsDescribeMessage",t),iIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Twe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Zwe(t)}),aIe=t=>({mutationFn:async n=>{const{data:r}=await Rwe({...t,...n,throwOnError:!0});return r}}),Xwe=t=>ar("messageOperationsGetRawMessage",t),lIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Iwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Xwe(t)}),WB=t=>ar("outboxOperationsListOutboxMessages",t),uIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Owe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:WB(t)}),cIe=t=>({mutationFn:async n=>{const{data:r}=await Nwe({...t,...n,throwOnError:!0});return r}}),dIe=t=>({mutationFn:async n=>{const{data:r}=await Mwe({...t,...n,throwOnError:!0});return r}}),Qwe=t=>ar("outboxDetailOperationsGetOutboxMessage",t),Jwe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Pwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Qwe(t)}),fIe=t=>({mutationFn:async n=>{const{data:r}=await kwe({...t,...n,throwOnError:!0});return r}}),hIe=t=>({mutationFn:async n=>{const{data:r}=await Dwe({...t,...n,throwOnError:!0});return r}}),exe=t=>ar("semanticSearchOperationsSemanticSearch",t),pIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Lwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:exe(t)}),VB=t=>ar("systemOperationsGetSystemUpdate",t),txe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Uwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:VB(t)}),nxe=t=>({mutationFn:async n=>{const{data:r}=await Fwe({...t,...n,throwOnError:!0});return r}}),rxe=t=>ar("unifiedThreadOperationsListAllThreads",t),sxe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await zwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:rxe(t)}),oxe=t=>ar("threadDetailOperationsListThreadMessages",t),gIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await jwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:oxe(t)}),GB=_.createContext(void 0),m5={isOpen:!1,mode:"new"},ixe=2e3,axe=6e4,lxe=({children:t})=>{const[e,n]=_.useState(m5),[r,s]=_.useState(),o=_.useRef(0),a=pb(),{data:u}=x7({...Jwe({path:{outboxMessageId:r??""}}),enabled:!!r,refetchInterval:y=>{const S=y.state.data?.status;return S==="sent"||S==="failed"||S==="blocked"||Date.now()-o.current>axe?!1:ixe}});_.useEffect(()=>{if(!u||!r)return;(u.status==="sent"||u.status==="failed"||u.status==="blocked")&&(s(void 0),a.invalidateQueries({queryKey:WB()}))},[u,r,a]);const c=_.useCallback(y=>{n({...y,isOpen:!0})},[]),f=_.useCallback(()=>{n(m5)},[]),p=_.useCallback(y=>{n(S=>({...S,outboxMessageId:y}))},[]),g=_.useCallback(y=>{o.current=Date.now(),s(y)},[]),m=_.useMemo(()=>({state:e,openCompose:c,closeCompose:f,setOutboxMessageId:p,startSendPolling:g}),[e,c,f,p,g]);return P.jsx(GB.Provider,{value:m,children:t})},mIe=()=>{const t=_.useContext(GB);if(!t)throw new Error("useCompose must be used within a ComposeProvider");return t},sI="remit.self-update.run",uxe=600,cxe=300,v5="remit logs",dxe="https://github.com/remit-mail/reader/releases/tag/",fxe={checking:"preparing",pulling:"preparing",snapshotting:"preparing",stopping:"restarting",starting:"restarting",verifying:"reconnecting",committing:"reconnecting",rollingBack:"reconnecting",recovering:"reconnecting"};function AA(t){return fxe[t]??"reconnecting"}function KB(t){const e=su(t);return e===404||e===403||e===401}function YB(t,e){const n=t?.check;if(n?.status==="ok"&&!(!n.updateAvailable||!n.latestVersion))return{version:n.latestVersion,releasedAt:dy(n.publishedAt)??e,releaseNotesUrl:n.releaseNotesUrl??XB(n.latestVersion),summary:n.summary??""}}function hxe(t){const e=t?.check.schemaVersion,n=t?.currentSchemaVersion;return e===void 0||n===void 0?!1:e>n}function pxe(){try{const t=localStorage.getItem(sI);if(!t)return null;const e=JSON.parse(t);return mxe(e)?e:null}catch{return null}}function gxe(t){try{localStorage.setItem(sI,JSON.stringify(t))}catch{}}function y5(){try{localStorage.removeItem(sI)}catch{}}function mxe(t){if(!t||typeof t!="object")return!1;const e=t;return typeof e.runId=="string"&&typeof e.attemptedVersion=="string"&&typeof e.previousVersion=="string"&&typeof e.startedAt=="number"}function b5(){return uxe+cxe}function ZB(t,e){return Math.max(0,Math.floor((e-t)/1e3))}function dy(t){if(!t)return;const e=Date.parse(t);return Number.isNaN(e)?void 0:e}function XB(t){return`${dxe}${t}`}function sh(t,e,n,r,s){return{status:"applying",runId:t,version:e,target:n,phase:r,elapsedSeconds:s}}function vxe(t,e,n){switch(n){case"succeeded":return{status:"succeeded",runId:e.runId,version:e.targetVersion,previousVersion:e.fromVersion,releaseNotesUrl:t.check.releaseNotesUrl??XB(e.targetVersion)};case"rolledBack":return{status:"rolledBack",runId:e.runId,version:e.fromVersion,attemptedVersion:e.targetVersion,reason:e.message,logsCommand:e.logCommand};case"rollbackFailed":return{status:"rollbackFailed",runId:e.runId,attemptedVersion:e.targetVersion,previousVersion:e.fromVersion,reason:e.message,logsCommand:e.logCommand};case"abandoned":return{status:"abandoned",runId:e.runId,version:e.fromVersion,attemptedVersion:e.targetVersion,reason:e.message,logsCommand:e.logCommand};default:return n}}function yxe(t,e,n){const r=t.check;if(e)return{status:"checking",version:t.currentVersion};if(r.status==="failed")return{status:"checkFailed",version:t.currentVersion,reason:r.error??"Remit could not reach the update service.",lastCheckedAt:dy(r.lastCheckedAt)};if(r.status==="disabled")return{status:"checking",version:t.currentVersion};const s=YB(t,n);return s?{status:"available",version:t.currentVersion,release:s}:{status:"upToDate",version:t.currentVersion,checkedAt:dy(r.lastCheckedAt)??n}}function Bm(t,e,n,r){return{surface:{status:"ready",section:t,overlay:e},clearStoredRun:n,releaseHeld:r}}function bxe(t,e,n,r,s){const o=ZB(t.startedAt,s),a=e?.currentVersion??t.previousVersion,u=!r&&n!==null&&n.runId===t.runId;if(u&&n!==null&&n.outcome!==null)return null;if(u&&n!==null){const f=AA(n.phase);return Bm(sh(n.runId,a,n.targetVersion,f,o),{kind:"applying",target:n.targetVersion,phase:f,elapsedSeconds:o},!1,!1)}if(r){const f=sh(t.runId,t.previousVersion,t.attemptedVersion,"reconnecting",o);return o>b5()?{surface:{status:"ready",section:f,overlay:{kind:"neverCameBack",attemptedVersion:t.attemptedVersion,previousVersion:t.previousVersion,elapsedSeconds:o,logsCommand:v5}},clearStoredRun:!0,releaseHeld:!1}:Bm(f,{kind:"applying",target:t.attemptedVersion,phase:"reconnecting",elapsedSeconds:o},!1,!1)}if(e===void 0)return Bm(sh(t.runId,a,t.attemptedVersion,"preparing",o),{kind:"applying",target:t.attemptedVersion,phase:"preparing",elapsedSeconds:o},!1,!1);if(o>b5())return{surface:{status:"ready",section:{status:"unreachable",runId:t.runId,previousVersion:t.previousVersion,attemptedVersion:t.attemptedVersion,elapsedSeconds:o,logsCommand:n?.logCommand??v5},overlay:{kind:"none"}},clearStoredRun:!0,releaseHeld:!0};const c=n!==null&&n.outcome===null?AA(n.phase):"preparing";return Bm(sh(t.runId,a,t.attemptedVersion,c,o),{kind:"applying",target:t.attemptedVersion,phase:c,elapsedSeconds:o},!1,!1)}function S5(t){const{data:e,isError:n,isFetching:r,dismissedRunId:s,checkRequested:o,now:a}=t;if(n)return{surface:{status:"ready",section:{status:"checkFailed",version:e?.currentVersion??"the current version",reason:"Remit could not reach the update service."},overlay:{kind:"none"}},clearStoredRun:!0};if(!e)return{surface:{status:"loading"},clearStoredRun:!1};const u=e.run,c=u!==null&&s!==null&&u.runId===s;if(u!==null&&!c&&u.outcome!==null)return{surface:{status:"ready",section:vxe(e,u,u.outcome),overlay:{kind:"none"}},clearStoredRun:!0};if(u!==null&&!c&&u.outcome===null){const f=ZB(dy(u.startedAt)??a,a),p=AA(u.phase);return{surface:{status:"ready",section:sh(u.runId,u.fromVersion,u.targetVersion,p,f),overlay:{kind:"applying",target:u.targetVersion,phase:p,elapsedSeconds:f}},clearStoredRun:!1}}return{surface:{status:"ready",section:yxe(e,o&&r,a),overlay:{kind:"none"}},clearStoredRun:!1}}function Sxe(t){const{data:e,isError:n,error:r,held:s,now:o}=t,a=e?.run??null;if(KB(r)&&!s)return{surface:{status:"absent"},clearStoredRun:!0,releaseHeld:!0};if(s){const c=bxe(s,e,a,n,o);return c||{surface:S5(t).surface,clearStoredRun:!0,releaseHeld:!0}}const u=S5(t);return{surface:u.surface,clearStoredRun:u.clearStoredRun,releaseHeld:!1}}const Exe=3e4,Cxe=5e3;function wxe(t,e,n){if(KB(t)&&!n)return!1;const r=e!==null&&e.outcome===null;return n||r?Cxe:Exe}function xxe(){const t=pb(),[e,n]=_.useState(()=>pxe()),[r,s]=_.useState(null),[o,a]=_.useState(!1),u=_.useRef(e);u.current=e;const c=x7({...txe(),retry:!1,meta:{softError:!0},refetchInterval:R=>wxe(R.state.error,R.state.data?.run??null,u.current!==null)}),f=Sxe({data:c.data,isError:c.isError,error:c.error,isFetching:c.isFetching,held:e,dismissedRunId:r,checkRequested:o,now:Date.now()}),p=_.useRef(null);p.current=f.surface.status==="ready"&&"runId"in f.surface.section?f.surface.section.runId:null;const{clearStoredRun:g,releaseHeld:m}=f;_.useEffect(()=>{g&&y5()},[g]),_.useEffect(()=>{m&&n(R=>R===null?R:null)},[m]),_.useEffect(()=>{o&&!c.isFetching&&a(!1)},[o,c.isFetching]);const{refetch:y}=c,S=_.useCallback(()=>{a(!0),y()},[y]),E=_.useCallback(()=>{y()},[y]),C=Vhe({...nxe(),meta:{softError:!0},onSuccess:R=>{const N=R.run;if(N!==null){const O={runId:N.runId,attemptedVersion:N.targetVersion,previousVersion:N.fromVersion,startedAt:Date.now()};gxe(O),n(O),s(null)}t.setQueryData(VB(),R)},onError:()=>{y()}}),{mutate:w}=C,A=_.useCallback(R=>{w({body:{targetVersion:R}})},[w]),T=_.useCallback(()=>{p.current!==null&&s(p.current),y5(),n(null)},[]);return{surface:f.surface,appliesSchemaMigration:hxe(c.data),currentVersion:c.data?.currentVersion,release:YB(c.data,Date.now()),onCheck:S,install:A,onDismissResult:T,onRetryConnection:E}}const oI=_.createContext(null);function _xe({children:t}){const e=xxe();return _.createElement(oI.Provider,{value:e},t)}function Axe(){const t=_.useContext(oI);if(t===null)throw new Error("useSelfUpdate must be used within a SelfUpdateProvider");return t}function Txe(){return _.useContext(oI)}function Rxe(){const{surface:t,onRetryConnection:e}=Axe();if(t.status!=="ready")return null;const{overlay:n}=t;return n.kind==="applying"?P.jsx(Lee,{target:n.target,phase:n.phase,elapsedSeconds:n.elapsedSeconds}):n.kind==="neverCameBack"?P.jsx(Uee,{attemptedVersion:n.attemptedVersion,previousVersion:n.previousVersion,elapsedSeconds:n.elapsedSeconds,logsCommand:n.logsCommand,onRetryConnection:e}):null}const Ix=(...t)=>D8(_8(t)),Ixe={error:{container:"border-danger/50 bg-danger-soft",icon:"text-danger",title:"text-danger"},warning:{container:"border-warning/50 bg-warning-soft",icon:"text-warning",title:"text-warning"},info:{container:"border-accent-2/50 bg-accent-2-soft",icon:"text-accent-2",title:"text-accent-2"}},Oxe={error:ZX,warning:aQ,info:eQ},Nxe={error:"Error",warning:"Warning",info:"Information"},Mxe=({id:t,severity:e,title:n,detail:r,onDismiss:s})=>{const o=Ixe[e],a=Oxe[e];return P.jsxs("div",{role:e==="error"?"alert":"status","aria-live":e==="error"?"assertive":"polite",className:Ix("pointer-events-auto flex items-start gap-3 rounded-md border bg-canvas px-3 py-2 shadow-lg",o.container),children:[P.jsx(a,{className:Ix("size-5 shrink-0 mt-0.5",o.icon),"aria-hidden":"true"}),P.jsxs("div",{className:"flex-1 min-w-0",children:[P.jsx("p",{className:Ix("text-sm font-medium",o.title),children:n}),r&&P.jsx("p",{className:"mt-0.5 text-xs text-fg-muted break-words",children:r})]}),P.jsx("button",{type:"button",onClick:()=>s(t),className:"shrink-0 rounded-md p-1 text-fg-muted hover:bg-surface-raised hover:text-fg transition-colors","aria-label":`Dismiss ${Nxe[e].toLowerCase()}`,children:P.jsx(wh,{className:"size-4","aria-hidden":"true"})})]})},Pxe=({errors:t,onDismiss:e})=>t.length===0?null:P.jsx("section",{"aria-label":"Notifications",className:"pointer-events-none fixed inset-x-0 top-0 z-[60] flex flex-col items-center gap-2 px-4 pt-4 sm:items-end sm:pr-6",children:P.jsx("div",{className:"flex w-full max-w-md flex-col gap-2",children:t.map(n=>P.jsx(Mxe,{id:n.id,severity:n.severity,title:n.title,detail:n.detail,onDismiss:e},n.id))})}),E5=5,vIe=(t,e,n)=>({title:t,detail:QB(n)??e,error:n}),QB=t=>{if(t!=null){if(t instanceof Error)return t.message||void 0;if(typeof t=="string")return t||void 0;if(typeof t=="object"&&"message"in t&&typeof t.message=="string")return t.message||void 0}},yIe=t=>{const e=QB(t);return e?e.startsWith("Message not found"):!1},kxe=(t,e,n)=>t.severity===n&&t.title===e.title&&t.detail===e.detail,Dxe=(t,e)=>{const r=[...t.filter(s=>!kxe(s,{title:e.title,detail:e.detail,severity:e.severity},e.severity)),e];return r.length<=E5?r:r.slice(r.length-E5)},Lxe=(t,e)=>t.filter(n=>n.id!==e),Uxe=(t,e,n)=>({id:e,severity:t.severity??"error",title:t.title,detail:t.detail,createdAt:n}),JB=_.createContext(void 0),Fxe=()=>typeof globalThis.crypto<"u"&&typeof globalThis.crypto.randomUUID=="function"?globalThis.crypto.randomUUID():`banner-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,zxe=({children:t})=>{const[e,n]=_.useState([]),r=_.useCallback(u=>{if(u.error!=null&&E9(u.error))return Bl(u.error).correlationId;const c=Uxe(u,Fxe(),Date.now());return n(f=>Dxe(f,c)),c.id},[]),s=_.useCallback(u=>{n(c=>Lxe(c,u))},[]),o=_.useCallback(()=>{n([])},[]),a=_.useMemo(()=>({errors:e,pushError:r,dismissError:s,clearAll:o}),[e,r,s,o]);return P.jsxs(JB.Provider,{value:a,children:[t,P.jsx(Pxe,{errors:e,onDismiss:s})]})},bIe=()=>{const t=_.useContext(JB);if(!t)throw new Error("useErrorBanners must be used within an ErrorBannerProvider");return t},jxe=({error:t,reset:e,info:n})=>{const r=zy(t),s=Bl(t,{recoverable:r,componentStack:n?.componentStack});return P.jsx(I9,{fatal:s,onRetry:r?e:void 0})},bp=Sge()({component:Hxe,errorComponent:jxe}),Bxe=()=>{const{t}=ewe("common",{useSuspense:!1});return P.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:z-50 focus:p-4 focus:bg-canvas focus:text-fg focus:rounded-md",children:t("accessibility.skipToContent","Skip to main content")})};function Hxe(){return P.jsxs(zxe,{children:[P.jsxs(_xe,{children:[P.jsxs(lxe,{children:[P.jsx(Bxe,{}),P.jsx("main",{id:"main-content",className:"h-dvh overflow-hidden",children:P.jsx(_.Suspense,{fallback:P.jsx(aT,{}),children:P.jsx(tz,{})})})]}),P.jsx(Rxe,{})]}),P.jsx(R9,{})]})}const $xe=hr("/")({beforeLoad:()=>{throw D7({to:"/mail"})}});var Tt;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),a={};for(const u of o)a[u]=s[u];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},t.find=(s,o)=>{for(const a of s)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(Tt||(Tt={}));var C5;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(C5||(C5={}));const Oe=Tt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Sa=t=>{switch(typeof t){case"undefined":return Oe.undefined;case"string":return Oe.string;case"number":return Number.isNaN(t)?Oe.nan:Oe.number;case"boolean":return Oe.boolean;case"function":return Oe.function;case"bigint":return Oe.bigint;case"symbol":return Oe.symbol;case"object":return Array.isArray(t)?Oe.array:t===null?Oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Oe.promise:typeof Map<"u"&&t instanceof Map?Oe.map:typeof Set<"u"&&t instanceof Set?Oe.set:typeof Date<"u"&&t instanceof Date?Oe.date:Oe.object;default:return Oe.unknown}},ge=Tt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class xi extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,c=0;for(;c<a.path.length;){const f=a.path[c];c===a.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(a))):u[f]=u[f]||{_errors:[]},u=u[f],c++}}};return s(this),r}static assert(e){if(!(e instanceof xi))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Tt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];n[o]=n[o]||[],n[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}xi.create=t=>new xi(t);const TA=(t,e)=>{let n;switch(t.code){case ge.invalid_type:t.received===Oe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ge.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Tt.jsonStringifyReplacer)}`;break;case ge.unrecognized_keys:n=`Unrecognized key(s) in object: ${Tt.joinValues(t.keys,", ")}`;break;case ge.invalid_union:n="Invalid input";break;case ge.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Tt.joinValues(t.options)}`;break;case ge.invalid_enum_value:n=`Invalid enum value. Expected ${Tt.joinValues(t.options)}, received '${t.received}'`;break;case ge.invalid_arguments:n="Invalid function arguments";break;case ge.invalid_return_type:n="Invalid function return type";break;case ge.invalid_date:n="Invalid date";break;case ge.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Tt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ge.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ge.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ge.custom:n="Invalid input";break;case ge.invalid_intersection_types:n="Intersection results could not be merged";break;case ge.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ge.not_finite:n="Number must be finite";break;default:n=e.defaultError,Tt.assertNever(t)}return{message:n}};let qxe=TA;function Wxe(){return qxe}const Vxe=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,o=[...n,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let u="";const c=r.filter(f=>!!f).slice().reverse();for(const f of c)u=f(a,{data:e,defaultError:u}).message;return{...s,path:o,message:u}};function _e(t,e){const n=Wxe(),r=Vxe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===TA?void 0:TA].filter(s=>!!s)});t.common.issues.push(r)}class us{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return Ye;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const o=await s.key,a=await s.value;r.push({key:o,value:a})}return us.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return Ye;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(r[o.value]=a.value)}return{status:e.value,value:r}}}const Ye=Object.freeze({status:"aborted"}),oh=t=>({status:"dirty",value:t}),Ms=t=>({status:"valid",value:t}),w5=t=>t.status==="aborted",x5=t=>t.status==="dirty",Qc=t=>t.status==="valid",fy=t=>typeof Promise<"u"&&t instanceof Promise;var Me;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Me||(Me={}));class Ba{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const _5=(t,e)=>{if(Qc(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new xi(t.common.issues);return this._error=n,this._error}}};function st(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,u)=>{const{message:c}=t;return a.code==="invalid_enum_value"?{message:c??u.defaultError}:typeof u.data>"u"?{message:c??r??u.defaultError}:a.code!=="invalid_type"?{message:u.defaultError}:{message:c??n??u.defaultError}},description:s}}class wt{get description(){return this._def.description}_getType(e){return Sa(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Sa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new us,ctx:{common:e.parent.common,data:e.data,parsedType:Sa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(fy(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sa(e)},s=this._parseSync({data:e,path:r.path,parent:r});return _5(r,s)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sa(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:n});return Qc(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>Qc(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sa(e)},s=this._parse({data:e,path:r.path,parent:r}),o=await(fy(s)?s:Promise.resolve(s));return _5(r,o)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{const a=e(s),u=()=>o.addIssue({code:ge.custom,...r(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(u(),!1)):a?!0:(u(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new td({schema:this,typeName:Ze.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ma.create(this,this._def)}nullable(){return nd.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return xo.create(this)}promise(){return my.create(this,this._def)}or(e){return py.create([this,e],this._def)}and(e){return gy.create(this,e,this._def)}transform(e){return new td({...st(this._def),schema:this,typeName:Ze.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new IA({...st(this._def),innerType:this,defaultValue:n,typeName:Ze.ZodDefault})}brand(){return new g_e({typeName:Ze.ZodBranded,type:this,...st(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new OA({...st(this._def),innerType:this,catchValue:n,typeName:Ze.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return iI.create(this,e)}readonly(){return NA.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Gxe=/^c[^\s-]{8,}$/i,Kxe=/^[0-9a-z]+$/,Yxe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Zxe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Xxe=/^[a-z0-9_-]{21}$/i,Qxe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Jxe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,e_e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,t_e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ox;const n_e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,r_e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,s_e=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,o_e=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,i_e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,a_e=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,eH="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",l_e=new RegExp(`^${eH}$`);function tH(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function u_e(t){return new RegExp(`^${tH(t)}$`)}function c_e(t){let e=`${eH}T${tH(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function d_e(t,e){return!!((e==="v4"||!e)&&n_e.test(t)||(e==="v6"||!e)&&s_e.test(t))}function f_e(t,e){if(!Qxe.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function h_e(t,e){return!!((e==="v4"||!e)&&r_e.test(t)||(e==="v6"||!e)&&o_e.test(t))}class hi extends wt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Oe.string){const o=this._getOrReturnCtx(e);return _e(o,{code:ge.invalid_type,expected:Oe.string,received:o.parsedType}),Ye}const r=new us;let s;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=e.data.length>o.value,u=e.data.length<o.value;(a||u)&&(s=this._getOrReturnCtx(e,s),a?_e(s,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&_e(s,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")e_e.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"email",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Ox||(Ox=new RegExp(t_e,"u")),Ox.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"emoji",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Zxe.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"uuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")Xxe.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"nanoid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")Gxe.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"cuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Kxe.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"cuid2",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Yxe.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"ulid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),_e(s,{validation:"url",code:ge.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"regex",code:ge.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?c_e(o).test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?l_e.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?u_e(o).test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?Jxe.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"duration",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?d_e(e.data,o.version)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"ip",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?f_e(e.data,o.alg)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"jwt",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?h_e(e.data,o.version)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"cidr",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?i_e.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"base64",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?a_e.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"base64url",code:ge.invalid_string,message:o.message}),r.dirty()):Tt.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:ge.invalid_string,...Me.errToObj(r)})}_addCheck(e){return new hi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Me.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Me.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Me.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Me.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Me.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Me.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Me.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Me.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Me.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Me.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Me.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Me.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Me.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Me.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Me.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Me.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Me.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...Me.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Me.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Me.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Me.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Me.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Me.errToObj(n)})}nonempty(e){return this.min(1,Me.errToObj(e))}trim(){return new hi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new hi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new hi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}hi.create=t=>new hi({checks:[],typeName:Ze.ZodString,coerce:t?.coerce??!1,...st(t)});function p_e(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,o=Number.parseInt(t.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return o%a/10**s}class Zl extends wt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Oe.number){const o=this._getOrReturnCtx(e);return _e(o,{code:ge.invalid_type,expected:Oe.number,received:o.parsedType}),Ye}let r;const s=new us;for(const o of this._def.checks)o.kind==="int"?Tt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),_e(r,{code:ge.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),_e(r,{code:ge.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),_e(r,{code:ge.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?p_e(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),_e(r,{code:ge.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),_e(r,{code:ge.not_finite,message:o.message}),s.dirty()):Tt.assertNever(o);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Me.toString(n))}setLimit(e,n,r,s){return new Zl({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Me.toString(s)}]})}_addCheck(e){return new Zl({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Me.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Me.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Me.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Me.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Me.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Tt.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Zl.create=t=>new Zl({checks:[],typeName:Ze.ZodNumber,coerce:t?.coerce||!1,...st(t)});class Xl extends wt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Oe.bigint)return this._getInvalidInput(e);let r;const s=new us;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),_e(r,{code:ge.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),_e(r,{code:ge.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),_e(r,{code:ge.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):Tt.assertNever(o);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return _e(n,{code:ge.invalid_type,expected:Oe.bigint,received:n.parsedType}),Ye}gte(e,n){return this.setLimit("min",e,!0,Me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Me.toString(n))}setLimit(e,n,r,s){return new Xl({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Me.toString(s)}]})}_addCheck(e){return new Xl({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Me.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Xl.create=t=>new Xl({checks:[],typeName:Ze.ZodBigInt,coerce:t?.coerce??!1,...st(t)});class hy extends wt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Oe.boolean){const r=this._getOrReturnCtx(e);return _e(r,{code:ge.invalid_type,expected:Oe.boolean,received:r.parsedType}),Ye}return Ms(e.data)}}hy.create=t=>new hy({typeName:Ze.ZodBoolean,coerce:t?.coerce||!1,...st(t)});class Jc extends wt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Oe.date){const o=this._getOrReturnCtx(e);return _e(o,{code:ge.invalid_type,expected:Oe.date,received:o.parsedType}),Ye}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return _e(o,{code:ge.invalid_date}),Ye}const r=new us;let s;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Tt.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Jc({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Me.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Me.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Jc.create=t=>new Jc({checks:[],coerce:t?.coerce||!1,typeName:Ze.ZodDate,...st(t)});class A5 extends wt{_parse(e){if(this._getType(e)!==Oe.symbol){const r=this._getOrReturnCtx(e);return _e(r,{code:ge.invalid_type,expected:Oe.symbol,received:r.parsedType}),Ye}return Ms(e.data)}}A5.create=t=>new A5({typeName:Ze.ZodSymbol,...st(t)});class T5 extends wt{_parse(e){if(this._getType(e)!==Oe.undefined){const r=this._getOrReturnCtx(e);return _e(r,{code:ge.invalid_type,expected:Oe.undefined,received:r.parsedType}),Ye}return Ms(e.data)}}T5.create=t=>new T5({typeName:Ze.ZodUndefined,...st(t)});class R5 extends wt{_parse(e){if(this._getType(e)!==Oe.null){const r=this._getOrReturnCtx(e);return _e(r,{code:ge.invalid_type,expected:Oe.null,received:r.parsedType}),Ye}return Ms(e.data)}}R5.create=t=>new R5({typeName:Ze.ZodNull,...st(t)});class I5 extends wt{constructor(){super(...arguments),this._any=!0}_parse(e){return Ms(e.data)}}I5.create=t=>new I5({typeName:Ze.ZodAny,...st(t)});class O5 extends wt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ms(e.data)}}O5.create=t=>new O5({typeName:Ze.ZodUnknown,...st(t)});class Ha extends wt{_parse(e){const n=this._getOrReturnCtx(e);return _e(n,{code:ge.invalid_type,expected:Oe.never,received:n.parsedType}),Ye}}Ha.create=t=>new Ha({typeName:Ze.ZodNever,...st(t)});class N5 extends wt{_parse(e){if(this._getType(e)!==Oe.undefined){const r=this._getOrReturnCtx(e);return _e(r,{code:ge.invalid_type,expected:Oe.void,received:r.parsedType}),Ye}return Ms(e.data)}}N5.create=t=>new N5({typeName:Ze.ZodVoid,...st(t)});class xo extends wt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==Oe.array)return _e(n,{code:ge.invalid_type,expected:Oe.array,received:n.parsedType}),Ye;if(s.exactLength!==null){const a=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(a||u)&&(_e(n,{code:a?ge.too_big:ge.too_small,minimum:u?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(_e(n,{code:ge.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(_e(n,{code:ge.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,u)=>s.type._parseAsync(new Ba(n,a,n.path,u)))).then(a=>us.mergeArray(r,a));const o=[...n.data].map((a,u)=>s.type._parseSync(new Ba(n,a,n.path,u)));return us.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new xo({...this._def,minLength:{value:e,message:Me.toString(n)}})}max(e,n){return new xo({...this._def,maxLength:{value:e,message:Me.toString(n)}})}length(e,n){return new xo({...this._def,exactLength:{value:e,message:Me.toString(n)}})}nonempty(e){return this.min(1,e)}}xo.create=(t,e)=>new xo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ze.ZodArray,...st(e)});function Ec(t){if(t instanceof _n){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Ma.create(Ec(r))}return new _n({...t._def,shape:()=>e})}else return t instanceof xo?new xo({...t._def,type:Ec(t.element)}):t instanceof Ma?Ma.create(Ec(t.unwrap())):t instanceof nd?nd.create(Ec(t.unwrap())):t instanceof Ql?Ql.create(t.items.map(e=>Ec(e))):t}class _n extends wt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Tt.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Oe.object){const f=this._getOrReturnCtx(e);return _e(f,{code:ge.invalid_type,expected:Oe.object,received:f.parsedType}),Ye}const{status:r,ctx:s}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ha&&this._def.unknownKeys==="strip"))for(const f in s.data)a.includes(f)||u.push(f);const c=[];for(const f of a){const p=o[f],g=s.data[f];c.push({key:{status:"valid",value:f},value:p._parse(new Ba(s,g,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Ha){const f=this._def.unknownKeys;if(f==="passthrough")for(const p of u)c.push({key:{status:"valid",value:p},value:{status:"valid",value:s.data[p]}});else if(f==="strict")u.length>0&&(_e(s,{code:ge.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const p of u){const g=s.data[p];c.push({key:{status:"valid",value:p},value:f._parse(new Ba(s,g,s.path,p)),alwaysSet:p in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const p of c){const g=await p.key,m=await p.value;f.push({key:g,value:m,alwaysSet:p.alwaysSet})}return f}).then(f=>us.mergeObjectSync(r,f)):us.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return Me.errToObj,new _n({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{const s=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:Me.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new _n({...this._def,unknownKeys:"strip"})}passthrough(){return new _n({...this._def,unknownKeys:"passthrough"})}extend(e){return new _n({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new _n({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ze.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new _n({...this._def,catchall:e})}pick(e){const n={};for(const r of Tt.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new _n({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Tt.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new _n({...this._def,shape:()=>n})}deepPartial(){return Ec(this)}partial(e){const n={};for(const r of Tt.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new _n({...this._def,shape:()=>n})}required(e){const n={};for(const r of Tt.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Ma;)o=o._def.innerType;n[r]=o}return new _n({...this._def,shape:()=>n})}keyof(){return nH(Tt.objectKeys(this.shape))}}_n.create=(t,e)=>new _n({shape:()=>t,unknownKeys:"strip",catchall:Ha.create(),typeName:Ze.ZodObject,...st(e)});_n.strictCreate=(t,e)=>new _n({shape:()=>t,unknownKeys:"strict",catchall:Ha.create(),typeName:Ze.ZodObject,...st(e)});_n.lazycreate=(t,e)=>new _n({shape:t,unknownKeys:"strip",catchall:Ha.create(),typeName:Ze.ZodObject,...st(e)});class py extends wt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(o){for(const u of o)if(u.result.status==="valid")return u.result;for(const u of o)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const a=o.map(u=>new xi(u.ctx.common.issues));return _e(n,{code:ge.invalid_union,unionErrors:a}),Ye}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(s);{let o;const a=[];for(const c of r){const f={...n,common:{...n.common,issues:[]},parent:null},p=c._parseSync({data:n.data,path:n.path,parent:f});if(p.status==="valid")return p;p.status==="dirty"&&!o&&(o={result:p,ctx:f}),f.common.issues.length&&a.push(f.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const u=a.map(c=>new xi(c));return _e(n,{code:ge.invalid_union,unionErrors:u}),Ye}}get options(){return this._def.options}}py.create=(t,e)=>new py({options:t,typeName:Ze.ZodUnion,...st(e)});function RA(t,e){const n=Sa(t),r=Sa(e);if(t===e)return{valid:!0,data:t};if(n===Oe.object&&r===Oe.object){const s=Tt.objectKeys(e),o=Tt.objectKeys(t).filter(u=>s.indexOf(u)!==-1),a={...t,...e};for(const u of o){const c=RA(t[u],e[u]);if(!c.valid)return{valid:!1};a[u]=c.data}return{valid:!0,data:a}}else if(n===Oe.array&&r===Oe.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let o=0;o<t.length;o++){const a=t[o],u=e[o],c=RA(a,u);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===Oe.date&&r===Oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class gy extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(o,a)=>{if(w5(o)||w5(a))return Ye;const u=RA(o.value,a.value);return u.valid?((x5(o)||x5(a))&&n.dirty(),{status:n.value,value:u.data}):(_e(r,{code:ge.invalid_intersection_types}),Ye)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>s(o,a)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}gy.create=(t,e,n)=>new gy({left:t,right:e,typeName:Ze.ZodIntersection,...st(n)});class Ql extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Oe.array)return _e(r,{code:ge.invalid_type,expected:Oe.array,received:r.parsedType}),Ye;if(r.data.length<this._def.items.length)return _e(r,{code:ge.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ye;!this._def.rest&&r.data.length>this._def.items.length&&(_e(r,{code:ge.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,u)=>{const c=this._def.items[u]||this._def.rest;return c?c._parse(new Ba(r,a,r.path,u)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>us.mergeArray(n,a)):us.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new Ql({...this._def,rest:e})}}Ql.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ql({items:t,typeName:Ze.ZodTuple,rest:null,...st(e)})};class M5 extends wt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Oe.map)return _e(r,{code:ge.invalid_type,expected:Oe.map,received:r.parsedType}),Ye;const s=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([u,c],f)=>({key:s._parse(new Ba(r,u,r.path,[f,"key"])),value:o._parse(new Ba(r,c,r.path,[f,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const c of a){const f=await c.key,p=await c.value;if(f.status==="aborted"||p.status==="aborted")return Ye;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),u.set(f.value,p.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const c of a){const f=c.key,p=c.value;if(f.status==="aborted"||p.status==="aborted")return Ye;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),u.set(f.value,p.value)}return{status:n.value,value:u}}}}M5.create=(t,e,n)=>new M5({valueType:e,keyType:t,typeName:Ze.ZodMap,...st(n)});class Zh extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Oe.set)return _e(r,{code:ge.invalid_type,expected:Oe.set,received:r.parsedType}),Ye;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(_e(r,{code:ge.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(_e(r,{code:ge.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const o=this._def.valueType;function a(c){const f=new Set;for(const p of c){if(p.status==="aborted")return Ye;p.status==="dirty"&&n.dirty(),f.add(p.value)}return{status:n.value,value:f}}const u=[...r.data.values()].map((c,f)=>o._parse(new Ba(r,c,r.path,f)));return r.common.async?Promise.all(u).then(c=>a(c)):a(u)}min(e,n){return new Zh({...this._def,minSize:{value:e,message:Me.toString(n)}})}max(e,n){return new Zh({...this._def,maxSize:{value:e,message:Me.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Zh.create=(t,e)=>new Zh({valueType:t,minSize:null,maxSize:null,typeName:Ze.ZodSet,...st(e)});class P5 extends wt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}P5.create=(t,e)=>new P5({getter:t,typeName:Ze.ZodLazy,...st(e)});class k5 extends wt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return _e(n,{received:n.data,code:ge.invalid_literal,expected:this._def.value}),Ye}return{status:"valid",value:e.data}}get value(){return this._def.value}}k5.create=(t,e)=>new k5({value:t,typeName:Ze.ZodLiteral,...st(e)});function nH(t,e){return new ed({values:t,typeName:Ze.ZodEnum,...st(e)})}class ed extends wt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return _e(n,{expected:Tt.joinValues(r),received:n.parsedType,code:ge.invalid_type}),Ye}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return _e(n,{received:n.data,code:ge.invalid_enum_value,options:r}),Ye}return Ms(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return ed.create(e,{...this._def,...n})}exclude(e,n=this._def){return ed.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}ed.create=nH;class D5 extends wt{_parse(e){const n=Tt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Oe.string&&r.parsedType!==Oe.number){const s=Tt.objectValues(n);return _e(r,{expected:Tt.joinValues(s),received:r.parsedType,code:ge.invalid_type}),Ye}if(this._cache||(this._cache=new Set(Tt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=Tt.objectValues(n);return _e(r,{received:r.data,code:ge.invalid_enum_value,options:s}),Ye}return Ms(e.data)}get enum(){return this._def.values}}D5.create=(t,e)=>new D5({values:t,typeName:Ze.ZodNativeEnum,...st(e)});class my extends wt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Oe.promise&&n.common.async===!1)return _e(n,{code:ge.invalid_type,expected:Oe.promise,received:n.parsedType}),Ye;const r=n.parsedType===Oe.promise?n.data:Promise.resolve(n.data);return Ms(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}my.create=(t,e)=>new my({type:t,typeName:Ze.ZodPromise,...st(e)});class td extends wt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ze.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,o={addIssue:a=>{_e(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const a=s.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async u=>{if(n.value==="aborted")return Ye;const c=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return c.status==="aborted"?Ye:c.status==="dirty"||n.value==="dirty"?oh(c.value):c});{if(n.value==="aborted")return Ye;const u=this._def.schema._parseSync({data:a,path:r.path,parent:r});return u.status==="aborted"?Ye:u.status==="dirty"||n.value==="dirty"?oh(u.value):u}}if(s.type==="refinement"){const a=u=>{const c=s.refinement(u,o);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?Ye:(u.status==="dirty"&&n.dirty(),a(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?Ye:(u.status==="dirty"&&n.dirty(),a(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Qc(a))return Ye;const u=s.transform(a.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Qc(a)?Promise.resolve(s.transform(a.value,o)).then(u=>({status:n.value,value:u})):Ye);Tt.assertNever(s)}}td.create=(t,e,n)=>new td({schema:t,typeName:Ze.ZodEffects,effect:e,...st(n)});td.createWithPreprocess=(t,e,n)=>new td({schema:e,effect:{type:"preprocess",transform:t},typeName:Ze.ZodEffects,...st(n)});class Ma extends wt{_parse(e){return this._getType(e)===Oe.undefined?Ms(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ma.create=(t,e)=>new Ma({innerType:t,typeName:Ze.ZodOptional,...st(e)});class nd extends wt{_parse(e){return this._getType(e)===Oe.null?Ms(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}nd.create=(t,e)=>new nd({innerType:t,typeName:Ze.ZodNullable,...st(e)});class IA extends wt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}IA.create=(t,e)=>new IA({innerType:t,typeName:Ze.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...st(e)});class OA extends wt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return fy(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new xi(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new xi(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}OA.create=(t,e)=>new OA({innerType:t,typeName:Ze.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...st(e)});class L5 extends wt{_parse(e){if(this._getType(e)!==Oe.nan){const r=this._getOrReturnCtx(e);return _e(r,{code:ge.invalid_type,expected:Oe.nan,received:r.parsedType}),Ye}return{status:"valid",value:e.data}}}L5.create=t=>new L5({typeName:Ze.ZodNaN,...st(t)});class g_e extends wt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class iI extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ye:o.status==="dirty"?(n.dirty(),oh(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ye:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new iI({in:e,out:n,typeName:Ze.ZodPipeline})}}class NA extends wt{_parse(e){const n=this._def.innerType._parse(e),r=s=>(Qc(s)&&(s.value=Object.freeze(s.value)),s);return fy(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}NA.create=(t,e)=>new NA({innerType:t,typeName:Ze.ZodReadonly,...st(e)});var Ze;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Ze||(Ze={}));const xr=hi.create;Zl.create;Xl.create;const m_e=hy.create;Jc.create;Ha.create;xo.create;const yd=_n.create;py.create;gy.create;Ql.create;ed.create;my.create;Ma.create;nd.create;const SIe={string:(t=>hi.create({...t,coerce:!0})),number:(t=>Zl.create({...t,coerce:!0})),boolean:(t=>hy.create({...t,coerce:!0})),bigint:(t=>Xl.create({...t,coerce:!0})),date:(t=>Jc.create({...t,coerce:!0}))},v_e=My().apiUrl;We.setConfig({baseUrl:v_e,fetch:E8});We.interceptors.error.use((t,e)=>{if(t instanceof t_||!e)return t;const n=t,r=n&&typeof n=="object"&&"message"in n?String(n.message):`Request failed with status ${e.status}`;return new t_(r,e.status,n)});const Nx={Inbox:"inbox",Drafts:"drafts",Sent:"sent",Archive:"archive",Junk:"junk",Trash:"trash",All:"all",Flagged:"flagged"},EIe={inbox:"Inbox",drafts:"Drafts",sent:"Sent",archive:"Archive",junk:"Junk",trash:"Trash",all:"All",flagged:"Flagged"},U5=["inbox","flagged","drafts","sent","archive","all","junk","trash"];function y_e(t){const e=new Map,n=[...t].sort((r,s)=>U5.indexOf(Nx[r.role])-U5.indexOf(Nx[s.role]));for(const r of n){if(!r.mailboxId||e.has(r.mailboxId))continue;const s=Nx[r.role];s&&e.set(r.mailboxId,s)}return e}const b_e=t=>{const e=t.split("/");return e[e.length-1]||t};function CIe(t,e,n){const r=t.displayNameOverride?.trim();if(r)return r;const s=b_e(t.fullPath);return!e||!n?s:n(`sidebar.${e}`,s)}const S_e=new Set(["sent","drafts","trash"]),wIe=t=>t===void 0||!S_e.has(t),E_e=new Map;function xIe(t){const e=new Map;for(const n of t){const r=y_e(n.folderAppointments);for(const[s,o]of r)e.set(s,{role:o});for(const s of n.mailboxes){const o=r.get(s.mailboxId);e.set(s.mailboxId,{...o?{role:o}:{},providerPath:s.fullPath})}}return e}function _Ie(t,e){const n=e[0];if(!t)return n?{mailboxId:n}:{};for(const s of e){const o=t.get(s);if(o&&wee(o)!==void 0)return{mailboxId:s,folder:o}}if(!n)return{};const r=t.get(n);return{mailboxId:n,...r?{folder:r}:{}}}const C_e=_.createContext(null),AIe=()=>_.useContext(C_e)??{accounts:[],mailboxNameIndex:new Map,accountNameIndex:new Map,resultFolderIndex:E_e,searchQuery:"",searchInput:"",searchViewKey:"",onSearchChange:()=>{},onSearchClear:()=>{},onSearchClearQuery:()=>{},intelligenceOpen:!1,onToggleIntelligence:()=>{},onSetIntelligenceOpen:()=>{}},w_e=()=>Vn(()=>import("./mail-BhCnC0zo.js").then(t=>t.m),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),x_e=yd({q:xr().optional()}),__e=hr("/mail")({loader:({context:{queryClient:t}})=>{t.prefetchQuery(Gwe()),t.prefetchQuery({...sxe(),staleTime:6e4})},component:or(w_e,"component"),validateSearch:x_e}),A_e=()=>Vn(()=>import("./onboarding-w8oC_k77.js"),__vite__mapDeps([12,13,3,9,4])),T_e=hr("/onboarding")({component:or(A_e,"component")});function R_e(){const t=Txe(),e=t?.surface.status==="ready"&&t.surface.section.status==="available";return P.jsx(kee,{show:e,children:P.jsx(uQ,{className:"size-4"})})}const I_e=()=>Vn(()=>import("./settings-CAQOtl8y.js"),[]),TIe=[{id:"accounts",label:"Accounts",icon:P.jsx(I8,{className:"size-4"})},{id:"senders",label:"Senders & Rules",icon:P.jsx(lQ,{className:"size-4"})},{id:"folders",label:"Folder roles",icon:P.jsx(JX,{className:"size-4"})},{id:"filters",label:"Filters",icon:P.jsx(QX,{className:"size-4"})},{id:"appearance",label:"Appearance",icon:P.jsx(rQ,{className:"size-4"})},{id:"advanced",label:"Advanced",icon:P.jsx(R_e,{})}],RIe={accounts:"/settings/accounts",senders:"/settings/senders",folders:"/settings/folders",filters:"/settings/filters",appearance:"/settings/appearance",advanced:"/settings/advanced"},O_e=hr("/settings")({component:or(I_e,"component")}),N_e=()=>Vn(()=>import("./index-Db6DEVIe.js"),__vite__mapDeps([14,6])),M_e=()=>Vn(()=>import("./index-DtqBFgK5.js"),[]),P_e=yd({selectedMessageId:xr().optional(),selectedThreadId:xr().optional(),selectedMailboxId:xr().optional(),q:xr().optional()}),k_e=hr("/mail/")({component:or(M_e,"component"),validateSearch:P_e,errorComponent:or(N_e,"errorComponent")}),D_e=()=>Vn(()=>import("./_mailboxId-DtqBFgK5.js"),[]),L_e=yd({selectedMessageId:xr().optional(),selectedThreadId:xr().optional(),q:xr().optional()}),U_e=hr("/mail/$mailboxId")({component:or(D_e,"component"),validateSearch:L_e}),F_e=()=>Vn(()=>import("./flagged-BoZpfueM.js"),__vite__mapDeps([15,6])),z_e=()=>Vn(()=>import("./flagged-DtqBFgK5.js"),[]),j_e=yd({selectedMessageId:xr().optional(),q:xr().optional()}),B_e=hr("/mail/flagged")({component:or(z_e,"component"),validateSearch:j_e,errorComponent:or(F_e,"errorComponent")}),H_e=()=>Vn(()=>import("./outbox-DtqBFgK5.js"),[]),$_e=yd({selectedOutboxMessageId:xr().optional(),q:xr().optional()}),q_e=hr("/mail/outbox")({component:or(H_e,"component"),validateSearch:$_e}),W_e=()=>Vn(()=>import("./index-DhjmWYCG.js"),[]),V_e=hr("/settings/")({component:or(W_e,"component")}),G_e=()=>Vn(()=>import("./accounts-DKfAXZjO.js"),__vite__mapDeps([16,5,17,2,13,3,9,4,18,6,7])),K_e=yd({editAccountId:xr().optional(),focusSmtp:m_e().optional(),connected:xr().optional(),oauthError:xr().optional()}),Y_e=hr("/settings/accounts")({component:or(G_e,"component"),validateSearch:K_e}),Z_e=()=>Vn(()=>import("./advanced-CkqcfzJJ.js"),__vite__mapDeps([19,17,2,18,10])),X_e=hr("/settings/advanced")({component:or(Z_e,"component")}),Q_e=()=>Vn(()=>import("./appearance-Dytafdds.js"),__vite__mapDeps([20,17,2])),J_e=hr("/settings/appearance")({component:or(Q_e,"component")}),eAe=()=>Vn(()=>import("./filters-CJq3f7fG.js"),__vite__mapDeps([21,17,2,8,6])),tAe=hr("/settings/filters")({component:or(eAe,"component")}),nAe=()=>Vn(()=>import("./folders-Bd3b1tcw.js"),__vite__mapDeps([22,9,11,17,2,6])),rAe=hr("/settings/folders")({component:or(nAe,"component")}),sAe=()=>Vn(()=>import("./senders-C6xMNaU5.js"),__vite__mapDeps([23,3,17,2,6,1,7])),oAe=hr("/settings/senders")({component:or(sAe,"component")}),iAe=()=>Vn(()=>import("./suggested-vips-P2LJ2gFj.js"),[]),aAe=hr("/settings/suggested-vips")({component:or(iAe,"component")}),lAe=$xe.update({id:"/",path:"/",getParentRoute:()=>bp}),Sp=__e.update({id:"/mail",path:"/mail",getParentRoute:()=>bp}),uAe=T_e.update({id:"/onboarding",path:"/onboarding",getParentRoute:()=>bp}),Ni=O_e.update({id:"/settings",path:"/settings",getParentRoute:()=>bp}),cAe=k_e.update({id:"/",path:"/",getParentRoute:()=>Sp}),dAe=U_e.update({id:"/$mailboxId",path:"/$mailboxId",getParentRoute:()=>Sp}),fAe=B_e.update({id:"/flagged",path:"/flagged",getParentRoute:()=>Sp}),hAe=q_e.update({id:"/outbox",path:"/outbox",getParentRoute:()=>Sp}),pAe=V_e.update({id:"/",path:"/",getParentRoute:()=>Ni}),gAe=Y_e.update({id:"/accounts",path:"/accounts",getParentRoute:()=>Ni}),mAe=X_e.update({id:"/advanced",path:"/advanced",getParentRoute:()=>Ni}),vAe=J_e.update({id:"/appearance",path:"/appearance",getParentRoute:()=>Ni}),yAe=tAe.update({id:"/filters",path:"/filters",getParentRoute:()=>Ni}),bAe=rAe.update({id:"/folders",path:"/folders",getParentRoute:()=>Ni}),SAe=oAe.update({id:"/senders",path:"/senders",getParentRoute:()=>Ni}),EAe=aAe.update({id:"/suggested-vips",path:"/suggested-vips",getParentRoute:()=>Ni}),CAe={MailMailboxIdRoute:dAe,MailFlaggedRoute:fAe,MailOutboxRoute:hAe,MailIndexRoute:cAe},wAe=Sp._addFileChildren(CAe),xAe={SettingsAccountsRoute:gAe,SettingsAdvancedRoute:mAe,SettingsAppearanceRoute:vAe,SettingsFiltersRoute:yAe,SettingsFoldersRoute:bAe,SettingsSendersRoute:SAe,SettingsSuggestedVipsRoute:EAe,SettingsIndexRoute:pAe},_Ae=Ni._addFileChildren(xAe),AAe={IndexRoute:lAe,MailRoute:wAe,OnboardingRoute:uAe,SettingsRoute:_Ae},TAe=bp._addFileChildren(AAe)._addFileTypes(),RAe=(t,e)=>{const n=Lge({routeTree:TAe,context:{queryClient:t},defaultPreload:"intent"});return n.subscribe("onResolved",r=>{e.recordPageView(r.toLocation.pathname),lte(r.toLocation.pathname)}),n},qe=t=>typeof t=="string",qf=()=>{let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n},F5=t=>t==null?"":""+t,IAe=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},OAe=/###/g,z5=t=>t&&t.indexOf("###")>-1?t.replace(OAe,"."):t,j5=t=>!t||qe(t),Sh=(t,e,n)=>{const r=qe(e)?e.split("."):e;let s=0;for(;s<r.length-1;){if(j5(t))return{};const o=z5(r[s]);!t[o]&&n&&(t[o]=new n),Object.prototype.hasOwnProperty.call(t,o)?t=t[o]:t={},++s}return j5(t)?{}:{obj:t,k:z5(r[s])}},B5=(t,e,n)=>{const{obj:r,k:s}=Sh(t,e,Object);if(r!==void 0||e.length===1){r[s]=n;return}let o=e[e.length-1],a=e.slice(0,e.length-1),u=Sh(t,a,Object);for(;u.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),u=Sh(t,a,Object),u?.obj&&typeof u.obj[`${u.k}.${o}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${o}`]=n},NAe=(t,e,n,r)=>{const{obj:s,k:o}=Sh(t,e,Object);s[o]=s[o]||[],s[o].push(n)},vy=(t,e)=>{const{obj:n,k:r}=Sh(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},MAe=(t,e,n)=>{const r=vy(t,n);return r!==void 0?r:vy(e,n)},rH=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?qe(t[r])||t[r]instanceof String||qe(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):rH(t[r],e[r],n):t[r]=e[r]);return t},uc=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var PAe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const kAe=t=>qe(t)?t.replace(/[&<>"'\/]/g,e=>PAe[e]):t;class DAe{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const LAe=[" ",",","?","!",";"],UAe=new DAe(20),FAe=(t,e,n)=>{e=e||"",n=n||"";const r=LAe.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const s=UAe.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!s.test(t);if(!o){const a=t.indexOf(n);a>0&&!s.test(t.substring(0,a))&&(o=!0)}return o},MA=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const r=e.split(n);let s=t;for(let o=0;o<r.length;){if(!s||typeof s!="object")return;let a,u="";for(let c=o;c<r.length;++c)if(c!==o&&(u+=n),u+=r[c],a=s[u],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&c<r.length-1)continue;o+=c-o+1;break}s=a}return s},yy=t=>t?.replace("_","-"),zAe={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class by{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||zAe,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,s){return s&&!this.debug?null:(qe(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new by(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new by(this.logger,e)}}var wo=new by;class Ub{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(a=>{let[u,c]=a;for(let f=0;f<c;f++)u(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[u,c]=a;for(let f=0;f<c;f++)u.apply(u,[e,...r])})}}class H5 extends Ub{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let u;e.indexOf(".")>-1?u=e.split("."):(u=[e,n],r&&(Array.isArray(r)?u.push(...r):qe(r)&&o?u.push(...r.split(o)):u.push(r)));const c=vy(this.data,u);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=u[0],n=u[1],r=u.slice(2).join(".")),c||!a||!qe(r)?c:MA(this.data?.[e]?.[n],r,o)}addResource(e,n,r,s){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let u=[e,n];r&&(u=u.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(u=e.split("."),s=n,n=u[1]),this.addNamespaces(n),B5(this.data,u,s),o.silent||this.emit("added",e,n,r,s)}addResources(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(qe(r[o])||Array.isArray(r[o]))&&this.addResource(e,n,o,r[o],{silent:!0});s.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,s,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},u=[e,n];e.indexOf(".")>-1&&(u=e.split("."),s=r,r=n,n=u[1]),this.addNamespaces(n);let c=vy(this.data,u)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?rH(c,r,o):c={...c,...r},B5(this.data,u,c),a.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var sH={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,s){return t.forEach(o=>{e=this.processors[o]?.process(e,n,r,s)??e}),e}};const $5={},q5=t=>!qe(t)&&typeof t!="boolean"&&typeof t!="number";class Sy extends Ub{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),IAe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=wo.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};return e==null?!1:this.resolve(e,n)?.res!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&e.indexOf(r)>-1,u=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!FAe(e,r,s);if(a&&!u){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:qe(o)?[o]:o};const f=e.split(r);(r!==s||r===s&&this.options.ns.indexOf(f[0])>-1)&&(o=f.shift()),e=f.join(s)}return{key:e,namespaces:qe(o)?[o]:o}}translate(e,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:u}=this.extractFromKey(e[e.length-1],n),c=u[u.length-1],f=n.lng||this.language,p=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()==="cimode"){if(p){const D=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${D}${a}`,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${D}${a}`}return s?{res:a,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:a}const g=this.resolve(e,n);let m=g?.res;const y=g?.usedKey||a,S=g?.exactUsedKey||a,E=["[object Number]","[object Function]","[object RegExp]"],C=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,A=n.count!==void 0&&!qe(n.count),T=Sy.hasDefaultValue(n),R=A?this.pluralResolver.getSuffix(f,n.count,n):"",N=n.ordinal&&A?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",O=A&&!n.ordinal&&n.count===0,I=O&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${R}`]||n[`defaultValue${N}`]||n.defaultValue;let k=m;w&&!m&&T&&(k=I);const F=q5(k),$=Object.prototype.toString.apply(k);if(w&&k&&F&&E.indexOf($)<0&&!(qe(C)&&Array.isArray(k))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,k,{...n,ns:u}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(g.res=D,g.usedParams=this.getUsedParamsDetails(n),g):D}if(o){const D=Array.isArray(k),z=D?[]:{},q=D?S:y;for(const Y in k)if(Object.prototype.hasOwnProperty.call(k,Y)){const te=`${q}${o}${Y}`;T&&!m?z[Y]=this.translate(te,{...n,defaultValue:q5(I)?I[Y]:void 0,joinArrays:!1,ns:u}):z[Y]=this.translate(te,{...n,joinArrays:!1,ns:u}),z[Y]===te&&(z[Y]=k[Y])}m=z}}else if(w&&qe(C)&&Array.isArray(m))m=m.join(C),m&&(m=this.extendTranslation(m,e,n,r));else{let D=!1,z=!1;!this.isValidLookup(m)&&T&&(D=!0,m=I),this.isValidLookup(m)||(z=!0,m=a);const Y=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&z?void 0:m,te=T&&I!==m&&this.options.updateMissing;if(z||D||te){if(this.logger.log(te?"updateKey":"missingKey",f,c,a,te?I:m),o){const de=this.resolve(a,{...n,keySeparator:!1});de&&de.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let H=[];const ee=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ee&&ee[0])for(let de=0;de<ee.length;de++)H.push(ee[de]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(n.lng||this.language):H.push(n.lng||this.language);const fe=(de,Ae,L)=>{const G=T&&L!==m?L:Y;this.options.missingKeyHandler?this.options.missingKeyHandler(de,c,Ae,G,te,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(de,c,Ae,G,te,n),this.emit("missingKey",de,c,Ae,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?H.forEach(de=>{const Ae=this.pluralResolver.getSuffixes(de,n);O&&n[`defaultValue${this.options.pluralSeparator}zero`]&&Ae.indexOf(`${this.options.pluralSeparator}zero`)<0&&Ae.push(`${this.options.pluralSeparator}zero`),Ae.forEach(L=>{fe([de],a+L,n[`defaultValue${L}`]||I)})}):fe(H,a,I))}m=this.extendTranslation(m,e,n,g,r),z&&m===a&&this.options.appendNamespaceToMissingKey&&(m=`${c}:${a}`),(z||D)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${a}`:a,D?m:void 0))}return s?(g.res=m,g.usedParams=this.getUsedParamsDetails(n),g):m}extendTranslation(e,n,r,s,o){var a=this;if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const f=qe(e)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(f){const m=e.match(this.interpolator.nestingRegexp);p=m&&m.length}let g=r.replace&&!qe(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(g={...this.options.interpolation.defaultVariables,...g}),e=this.interpolator.interpolate(e,g,r.lng||this.language||s.usedLng,r),f){const m=e.match(this.interpolator.nestingRegexp),y=m&&m.length;p<y&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var m=arguments.length,y=new Array(m),S=0;S<m;S++)y[S]=arguments[S];return o?.[0]===y[0]&&!r.context?(a.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${n[0]}`),null):a.translate(...y,n)},r)),r.interpolation&&this.interpolator.reset()}const u=r.postProcess||this.options.postProcess,c=qe(u)?[u]:u;return e!=null&&c?.length&&r.applyPostProcessor!==!1&&(e=sH.handle(c,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,s,o,a,u;return qe(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(r))return;const f=this.extractFromKey(c,n),p=f.key;s=p;let g=f.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const m=n.count!==void 0&&!qe(n.count),y=m&&!n.ordinal&&n.count===0,S=n.context!==void 0&&(qe(n.context)||typeof n.context=="number")&&n.context!=="",E=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);g.forEach(C=>{this.isValidLookup(r)||(u=C,!$5[`${E[0]}-${C}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(u)&&($5[`${E[0]}-${C}`]=!0,this.logger.warn(`key "${s}" for languages "${E.join(", ")}" won't get resolved as namespace "${u}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),E.forEach(w=>{if(this.isValidLookup(r))return;a=w;const A=[p];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(A,p,w,C,n);else{let R;m&&(R=this.pluralResolver.getSuffix(w,n.count,n));const N=`${this.options.pluralSeparator}zero`,O=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(A.push(p+R),n.ordinal&&R.indexOf(O)===0&&A.push(p+R.replace(O,this.options.pluralSeparator)),y&&A.push(p+N)),S){const I=`${p}${this.options.contextSeparator}${n.context}`;A.push(I),m&&(A.push(I+R),n.ordinal&&R.indexOf(O)===0&&A.push(I+R.replace(O,this.options.pluralSeparator)),y&&A.push(I+N))}}let T;for(;T=A.pop();)this.isValidLookup(r)||(o=T,r=this.getResource(w,C,T,n))}))})}),{res:r,usedKey:s,exactUsedKey:o,usedLng:a,usedNS:u}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,n,r,s):this.resourceStore.getResource(e,n,r,s)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!qe(e.replace);let s=r?e.replace:e;if(r&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const o of n)delete s[o]}return s}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}class W5{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wo.create("languageUtils")}getScriptPartFromCode(e){if(e=yy(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=yy(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(qe(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>{if(o===s)return o;if(!(o.indexOf("-")<0&&s.indexOf("-")<0)&&(o.indexOf("-")>0&&s.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===s||o.indexOf(s)===0&&s.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),qe(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),s=[],o=a=>{a&&(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return qe(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(e))):qe(e)&&o(this.formatLanguageCode(e)),r.forEach(a=>{s.indexOf(a)<0&&o(this.formatLanguageCode(a))}),s}}const V5={zero:0,one:1,two:2,few:3,many:4,other:5},G5={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class jAe{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=wo.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=yy(e==="dev"?"en":e),s=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),G5;if(!e.match(/-|_/))return G5;const c=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(c,n)}return this.pluralRulesCache[o]=a,a}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(s=>`${n}${s}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((s,o)=>V5[s]-V5[o]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(e,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const K5=function(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=MAe(t,e,n);return!o&&s&&qe(n)&&(o=MA(t,n,r),o===void 0&&(o=MA(e,n,r))),o},Mx=t=>t.replace(/\$/g,"$$$$");class BAe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=wo.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:o,prefixEscaped:a,suffix:u,suffixEscaped:c,formatSeparator:f,unescapeSuffix:p,unescapePrefix:g,nestingPrefix:m,nestingPrefixEscaped:y,nestingSuffix:S,nestingSuffixEscaped:E,nestingOptionsSeparator:C,maxReplaces:w,alwaysFormat:A}=e.interpolation;this.escape=n!==void 0?n:kAe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?uc(o):a||"{{",this.suffix=u?uc(u):c||"}}",this.formatSeparator=f||",",this.unescapePrefix=p?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":p||"",this.nestingPrefix=m?uc(m):y||uc("$t("),this.nestingSuffix=S?uc(S):E||uc(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=w||1e3,this.alwaysFormat=A!==void 0?A:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,s){let o,a,u;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=y=>{if(y.indexOf(this.formatSeparator)<0){const w=K5(n,c,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,r,{...s,...n,interpolationkey:y}):w}const S=y.split(this.formatSeparator),E=S.shift().trim(),C=S.join(this.formatSeparator).trim();return this.format(K5(n,c,E,this.options.keySeparator,this.options.ignoreJSONStructure),C,r,{...s,...n,interpolationkey:E})};this.resetRegExp();const p=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,g=s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:y=>Mx(y)},{regex:this.regexp,safeValue:y=>this.escapeValue?Mx(this.escape(y)):Mx(y)}].forEach(y=>{for(u=0;o=y.regex.exec(e);){const S=o[1].trim();if(a=f(S),a===void 0)if(typeof p=="function"){const C=p(e,o,s);a=qe(C)?C:""}else if(s&&Object.prototype.hasOwnProperty.call(s,S))a="";else if(g){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${S} for interpolating ${e}`),a="";else!qe(a)&&!this.useRawValueToEscape&&(a=F5(a));const E=y.safeValue(a);if(e=e.replace(o[0],E),g?(y.regex.lastIndex+=a.length,y.regex.lastIndex-=o[0].length):y.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,o,a;const u=(c,f)=>{const p=this.nestingOptionsSeparator;if(c.indexOf(p)<0)return c;const g=c.split(new RegExp(`${p}[ ]*{`));let m=`{${g[1]}`;c=g[0],m=this.interpolate(m,a);const y=m.match(/'/g),S=m.match(/"/g);((y?.length??0)%2===0&&!S||S.length%2!==0)&&(m=m.replace(/'/g,'"'));try{a=JSON.parse(m),f&&(a={...f,...a})}catch(E){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,E),`${c}${p}${m}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];a={...r},a=a.replace&&!qe(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const p=s[1].split(this.formatSeparator).map(g=>g.trim());s[1]=p.shift(),c=p,f=!0}if(o=n(u.call(this,s[1].trim(),a),a),o&&s[0]===e&&!qe(o))return o;qe(o)||(o=F5(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),o=""),f&&(o=c.reduce((p,g)=>this.format(p,g,r.lng,{...r,interpolationkey:s[1].trim()}),o.trim())),e=e.replace(s[0],o),this.regexp.lastIndex=0}return e}}const HAe=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);e==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(a=>{if(a){const[u,...c]=a.split(":"),f=c.join(":").trim().replace(/^'+|'+$/g,""),p=u.trim();n[p]||(n[p]=f),f==="false"&&(n[p]=!1),f==="true"&&(n[p]=!0),isNaN(f)||(n[p]=parseInt(f,10))}})}return{formatName:e,formatOptions:n}},cc=t=>{const e={};return(n,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const a=r+JSON.stringify(o);let u=e[a];return u||(u=t(yy(r),s),e[a]=u),u(n)}};class $Ae{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=wo.create("formatter"),this.options=e,this.formats={number:cc((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return o=>s.format(o)}),currency:cc((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>s.format(o)}),datetime:cc((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return o=>s.format(o)}),relativetime:cc((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return o=>s.format(o,r.range||"day")}),list:cc((n,r)=>{const s=new Intl.ListFormat(n,{...r});return o=>s.format(o)})},this.init(e)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=cc(n)}format(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(u=>u.indexOf(")")>-1)){const u=o.findIndex(c=>c.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,u)].join(this.formatSeparator)}return o.reduce((u,c)=>{const{formatName:f,formatOptions:p}=HAe(c);if(this.formats[f]){let g=u;try{const m=s?.formatParams?.[s.interpolationkey]||{},y=m.locale||m.lng||s.locale||s.lng||r;g=this.formats[f](u,y,{...p,...s,...m})}catch(m){this.logger.warn(m)}return g}else this.logger.warn(`there was no format function for ${f}`);return u},e)}}const qAe=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class WAe extends Ub{constructor(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=wo.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,s.backend,s)}queueLoad(e,n,r,s){const o={},a={},u={},c={};return e.forEach(f=>{let p=!0;n.forEach(g=>{const m=`${f}|${g}`;!r.reload&&this.store.hasResourceBundle(f,g)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?a[m]===void 0&&(a[m]=!0):(this.state[m]=1,p=!1,a[m]===void 0&&(a[m]=!0),o[m]===void 0&&(o[m]=!0),c[g]===void 0&&(c[g]=!0)))}),p||(u[f]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const s=e.split("|"),o=s[0],a=s[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const u={};this.queue.forEach(c=>{NAe(c.loaded,[o],a),qAe(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(f=>{u[f]||(u[f]={});const p=c.loaded[f];p.length&&p.forEach(g=>{u[f][g]===void 0&&(u[f][g]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(c=>!c.done)}read(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:s,wait:o,callback:a});return}this.readingCalls++;const u=(f,p)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(f&&p&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,s+1,o*2,a)},o);return}a(f,p)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const f=c(e,n);f&&typeof f.then=="function"?f.then(p=>u(null,p)).catch(u):u(null,f)}catch(f){u(f)}return}return c(e,n,u)}prepareLoading(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();qe(e)&&(e=this.languageUtils.toResolveHierarchy(e)),qe(n)&&(n=[n]);const o=this.queueLoad(e,n,r,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),s=r[0],o=r[1];this.read(s,o,"read",void 0,void 0,(a,u)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${s} failed`,a),!a&&u&&this.logger.log(`${n}loaded namespace ${o} for language ${s}`,u),this.loaded(e,a,u)})}saveMissing(e,n,r,s,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const c={...a,isUpdate:o},f=this.backend.create.bind(this.backend);if(f.length<6)try{let p;f.length===5?p=f(e,n,r,s,c):p=f(e,n,r,s),p&&typeof p.then=="function"?p.then(g=>u(null,g)).catch(u):u(null,p)}catch(p){u(p)}else f(e,n,r,s,u,c)}!e||!e[0]||this.store.addResource(e[0],n,r,s)}}}const Y5=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),qe(t[1])&&(e.defaultValue=t[1]),qe(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Z5=t=>(qe(t.ns)&&(t.ns=[t.ns]),qe(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),qe(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t),Hm=()=>{},VAe=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class Xh extends Ub{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Z5(e),this.services={},this.logger=wo,this.modules={external:[]},VAe(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),n.defaultNS==null&&n.ns&&(qe(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=Y5();this.options={...s,...this.options,...Z5(n)},this.options.interpolation={...s.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?wo.init(o(this.modules.logger),this.options):wo.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:p=$Ae;const g=new W5(this.options);this.store=new H5(this.options.resources,this.options);const m=this.services;m.logger=wo,m.resourceStore=this.store,m.languageUtils=g,m.pluralResolver=new jAe(g,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),p&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(m.formatter=o(p),m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new BAe(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new WAe(o(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",function(y){for(var S=arguments.length,E=new Array(S>1?S-1:0),C=1;C<S;C++)E[C-1]=arguments[C];e.emit(y,...E)}),this.modules.languageDetector&&(m.languageDetector=o(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=o(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new Sy(this.services,this.options),this.translator.on("*",function(y){for(var S=arguments.length,E=new Array(S>1?S-1:0),C=1;C<S;C++)E[C-1]=arguments[C];e.emit(y,...E)}),this.modules.external.forEach(y=>{y.init&&y.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Hm),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(p=>{this[p]=function(){return e.store[p](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=function(){return e.store[p](...arguments),e}});const c=qf(),f=()=>{const p=(g,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(m),r(g,m)};if(this.languages&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initAsync?f():setTimeout(f,0),c}loadResources(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hm;const s=qe(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(s?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&o.indexOf(f)<0&&o.push(f)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>a(c)),this.options.preload?.forEach?.(u=>a(u)),this.services.backendConnector.load(o,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(e,n,r){const s=qf();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=Hm),this.services.backendConnector.reload(e,n,o=>{s.resolve(),r(o)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&sH.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,n){var r=this;this.isLanguageChangingTo=e;const s=qf();this.emit("languageChanging",e);const o=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},a=(c,f)=>{f?(o(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},u=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const f=qe(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);f&&(this.language||o(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector?.cacheUserLanguage?.(f)),this.loadResources(f,p=>{a(p,f)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(e),s}getFixedT(e,n,r){var s=this;const o=function(a,u){let c;if(typeof u!="object"){for(var f=arguments.length,p=new Array(f>2?f-2:0),g=2;g<f;g++)p[g-2]=arguments[g];c=s.options.overloadTranslationOptionHandler([a,u].concat(p))}else c={...u};c.lng=c.lng||o.lng,c.lngs=c.lngs||o.lngs,c.ns=c.ns||o.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||o.keyPrefix);const m=s.options.keySeparator||".";let y;return c.keyPrefix&&Array.isArray(a)?y=a.map(S=>`${c.keyPrefix}${m}${S}`):y=c.keyPrefix?`${c.keyPrefix}${m}${a}`:a,s.t(y,c)};return qe(e)?o.lng=e:o.lngs=e,o.ns=n,o.keyPrefix=r,o}t(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.translator?.translate(...n)}exists(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.translator?.exists(...n)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(u,c)=>{const f=this.services.backendConnector.state[`${u}|${c}`];return f===-1||f===0||f===2};if(n.precheck){const u=n.precheck(this,a);if(u!==void 0)return u}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,e)&&(!s||a(o,e)))}loadNamespaces(e,n){const r=qf();return this.options.ns?(qe(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=qf();qe(e)&&(e=[e]);const s=this.options.preload||[],o=e.filter(a=>s.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=s.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new W5(Y5());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Xh(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hm;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},o=new Xh(s);if((e.debug!==void 0||e.prefix!==void 0)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(u=>{o[u]=this[u]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const u=Object.keys(this.store.data).reduce((c,f)=>(c[f]={...this.store.data[f]},Object.keys(c[f]).reduce((p,g)=>(p[g]={...c[f][g]},p),{})),{});o.store=new H5(u,s),o.services.resourceStore=o.store}return o.translator=new Sy(o.services,s),o.translator.on("*",function(u){for(var c=arguments.length,f=new Array(c>1?c-1:0),p=1;p<c;p++)f[p-1]=arguments[p];o.emit(u,...f)}),o.init(s,n),o.translator.options=s,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const pr=Xh.createInstance();pr.createInstance=Xh.createInstance;pr.createInstance;pr.dir;pr.init;pr.loadResources;pr.reloadResources;pr.use;pr.changeLanguage;pr.getFixedT;pr.t;pr.exists;pr.setDefaultNamespace;pr.hasLoadedNamespace;pr.loadNamespaces;pr.loadLanguages;const{slice:GAe,forEach:KAe}=[];function YAe(t){return KAe.call(GAe.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}function ZAe(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(t))}const X5=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,XAe=function(t,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(e);let o=`${t}=${s}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!X5.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!X5.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},Q5={create(t,e,n,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+n*60*1e3)),r&&(s.domain=r),document.cookie=XAe(t,e,s)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let s=n[r];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return s.substring(e.length,s.length)}return null},remove(t,e){this.create(t,"",-1,e)}};var QAe={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return Q5.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:s,cookieOptions:o}=e;n&&typeof document<"u"&&Q5.create(n,t,r,s,o)}},JAe={name:"querystring",lookup(t){let{lookupQuerystring:e}=t,n;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const o=r.substring(1).split("&");for(let a=0;a<o.length;a++){const u=o[a].indexOf("=");u>0&&o[a].substring(0,u)===e&&(n=o[a].substring(u+1))}}return n}},eTe={name:"hash",lookup(t){let{lookupHash:e,lookupFromHashIndex:n}=t,r;if(typeof window<"u"){const{hash:s}=window.location;if(s&&s.length>2){const o=s.substring(1);if(e){const a=o.split("&");for(let u=0;u<a.length;u++){const c=a[u].indexOf("=");c>0&&a[u].substring(0,c)===e&&(r=a[u].substring(c+1))}}if(r)return r;if(!r&&n>-1){const a=s.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof n=="number"?n:0]?.replace("/",""):void 0}}}return r}};let dc=null;const J5=()=>{if(dc!==null)return dc;try{if(dc=typeof window<"u"&&window.localStorage!==null,!dc)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{dc=!1}return dc};var tTe={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&J5())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&J5()&&window.localStorage.setItem(n,t)}};let fc=null;const e6=()=>{if(fc!==null)return fc;try{if(fc=typeof window<"u"&&window.sessionStorage!==null,!fc)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{fc=!1}return fc};var nTe={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&e6())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&e6()&&window.sessionStorage.setItem(n,t)}},rTe={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:s}=navigator;if(n)for(let o=0;o<n.length;o++)e.push(n[o]);r&&e.push(r),s&&e.push(s)}return e.length>0?e:void 0}},sTe={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},oTe={name:"path",lookup(t){let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof e=="number"?e:0]?.replace("/",""):void 0}},iTe={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let oH=!1;try{document.cookie,oH=!0}catch{}const iH=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];oH||iH.splice(1,1);const aTe=()=>({order:iH,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class aH{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=YAe(n,this.options||{},aTe()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(QAe),this.addDetector(JAe),this.addDetector(tTe),this.addDetector(nTe),this.addDetector(rTe),this.addDetector(sTe),this.addDetector(oTe),this.addDetector(iTe),this.addDetector(eTe)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return e.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.filter(r=>r!=null&&!ZAe(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}aH.type="languageDetector";function lTe(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=uTe(t))||e){n&&(t=n);var r=0,s=function(){};return{s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(f){throw f},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
295
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var f=n.next();return a=f.done,f},e:function(f){u=!0,o=f},f:function(){try{a||n.return==null||n.return()}finally{if(u)throw o}}}}function uTe(t,e){if(t){if(typeof t=="string")return t6(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t6(t,e):void 0}}function t6(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function PA(t){"@babel/helpers - typeof";return PA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},PA(t)}var lH=["__proto__","constructor","prototype"];function uH(t){return!(typeof t!="string"||t.length===0||t.length>128||lH.indexOf(t)>-1||t.indexOf("..")>-1||t.indexOf("\\")>-1||/[?#%\s@]/.test(t)||/[\x00-\x1F\x7F]/.test(t))}function cH(t){return!(!uH(t)||t.indexOf("/")>-1)}function cTe(t){return uH(t)}var dTe={lng:cH,ns:cTe};function $m(t){return typeof t!="string"?t:t.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function fTe(t){if(typeof t!="string"||t.length===0)return t;try{var e=new URL(t);return e.username||e.password?(e.username="",e.password="",e.toString()):t}catch{return t.replace(/(\/\/)[^/@\s]+@/g,"$1")}}function dH(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":PA(XMLHttpRequest))==="object"}function hTe(t){return!!t&&typeof t.then=="function"}function pTe(t){return hTe(t)?t:Promise.resolve(t)}var gTe=/\{\{(.+?)\}\}/g;function n6(t,e){var n=!1,r=t.replace(gTe,function(s,o){var a=o.trim();if(lH.indexOf(a)>-1)return s;var u=e[a];if(u==null)return s;var c=dTe[a]||cH,f=String(u).split("+"),p=lTe(f),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(!c(m))return n=!0,s}}catch(y){p.e(y)}finally{p.f()}return f.join("+")});return n?null:r}function r6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function s6(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?r6(Object(n),!0).forEach(function(r){mTe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function mTe(t,e,n){return(e=vTe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vTe(t){var e=yTe(t,"string");return Jl(e)=="symbol"?e:e+""}function yTe(t,e){if(Jl(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Jl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jl(t){"@babel/helpers - typeof";return Jl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jl(t)}var $a=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?$a=global.fetch:typeof window<"u"&&window.fetch&&($a=window.fetch);var Qh;dH()&&(typeof global<"u"&&global.XMLHttpRequest?Qh=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Qh=window.XMLHttpRequest));var Ey;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Ey=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Ey=window.ActiveXObject));typeof $a!="function"&&($a=void 0);if(!$a&&!Qh&&!Ey)try{Vn(()=>import("./browser-ponyfill-BwVTtQXO.js").then(t=>t.b),[]).then(function(t){$a=t.default}).catch(function(){})}catch{}var fH=["__proto__","constructor","prototype"],kA=function(e,n){if(n&&Jl(n)==="object"){for(var r="",s=0,o=Object.keys(n);s<o.length;s++){var a=o[s];fH.indexOf(a)>-1||(r+="&"+encodeURIComponent(a)+"="+encodeURIComponent(n[a]))}if(!r)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+r.slice(1)}return e},o6=function(e,n,r,s){var o=function(c){if(!c.ok)return r(c.statusText||"Error",{status:c.status});c.text().then(function(f){r(null,{status:c.status,data:f})}).catch(r)};if(s){var a=s(e,n);if(a instanceof Promise){a.then(o).catch(r);return}}typeof fetch=="function"?fetch(e,n).then(o).catch(r):$a(e,n).then(o).catch(r)},bTe=function(e,n,r,s){e.queryStringParams&&(n=kA(n,e.queryStringParams));var o=s6({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(o["Content-Type"]="application/json");var a=typeof e.requestOptions=="function"?e.requestOptions(r):e.requestOptions,u=s6({method:r?"POST":"GET",body:r?e.stringify(r):void 0,headers:o},e._omitFetchOptions?{}:a),c=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{o6(n,u,s,c)}catch(f){if(!a||Object.keys(a).length===0||!f.message||f.message.indexOf("not implemented")<0)return s(f);try{Object.keys(a).forEach(function(p){delete u[p]}),o6(n,u,s,c),e._omitFetchOptions=!0}catch(p){s(p)}}},STe=function(e,n,r,s){r&&Jl(r)==="object"&&(r=kA("",r).slice(1)),e.queryStringParams&&(n=kA(n,e.queryStringParams));try{var o=Qh?new Qh:new Ey("MSXML2.XMLHTTP.3.0");o.open(r?"POST":"GET",n,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=e.customHeaders;if(a=typeof a=="function"?a():a,a)for(var u=0,c=Object.keys(a);u<c.length;u++){var f=c[u];fH.indexOf(f)>-1||o.setRequestHeader(f,a[f])}o.onreadystatechange=function(){o.readyState>3&&s(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(p){console&&console.log(p)}},ETe=function(e,n,r,s){if(typeof r=="function"&&(s=r,r=void 0),s=s||function(){},$a&&n.indexOf("file:")!==0)return bTe(e,n,r,s);if(dH()||typeof ActiveXObject=="function")return STe(e,n,r,s);s(new Error("No fetch and no xhr implementation found!"))};function rd(t){"@babel/helpers - typeof";return rd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rd(t)}function i6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function Px(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?i6(Object(n),!0).forEach(function(r){hH(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function CTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wTe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pH(r.key),r)}}function xTe(t,e,n){return e&&wTe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function hH(t,e,n){return(e=pH(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pH(t){var e=_Te(t,"string");return rd(e)=="symbol"?e:e+""}function _Te(t,e){if(rd(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(rd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var ATe=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,s){return hH({},r,s||"")},parseLoadPayload:function(n,r){},request:ETe,reloadInterval:typeof window<"u"?!1:3600*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},gH=(function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};CTe(this,t),this.services=e,this.options=n,this.allOptions=r,this.type="backend",this.init(e,n,r)}return xTe(t,[{key:"init",value:function(n){var r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=Px(Px(Px({},ATe()),this.options||{}),s),this.allOptions=o,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);rd(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,s){this._readAny(n,n,r,r,s)}},{key:"read",value:function(n,r,s){this._readAny([n],n,[r],r,s)}},{key:"_readAny",value:function(n,r,s,o,a){var u=this,c=this.options.loadPath;typeof this.options.loadPath=="function"&&(c=this.options.loadPath(n,s)),c=pTe(c),c.then(function(f){if(!f)return a(null,{});var p=n6(f,{lng:n.join("+"),ns:s.join("+")});if(p==null){var g=n.map($m).join(", "),m=s.map($m).join(", ");return a(new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+g+"] namespaces=["+m+"]"),!1)}u.loadUrl(p,a,r,o)})}},{key:"loadUrl",value:function(n,r,s,o){var a=this,u=typeof s=="string"?[s]:s,c=typeof o=="string"?[o]:o,f=this.options.parseLoadPayload(u,c),p=$m(fTe(n));this.options.request(this.options,n,f,function(g,m){if(m&&(m.status>=500&&m.status<600||!m.status))return r("failed loading "+p+"; status code: "+m.status,!0);if(m&&m.status>=400&&m.status<500)return r("failed loading "+p+"; status code: "+m.status,!1);if(!m&&g&&g.message){var y=g.message.toLowerCase(),S=["failed","fetch","network","load"].find(function(w){return y.indexOf(w)>-1});if(S)return r("failed loading "+p+": "+$m(g.message),!0)}if(g)return r(g,!1);var E,C;try{typeof m.data=="string"?E=a.options.parse(m.data,s,o):E=m.data}catch{C="failed parsing "+p+" to json"}if(C)return r(C,!1);r(null,E)})}},{key:"create",value:function(n,r,s,o,a){var u=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var c=this.options.parsePayload(r,s,o),f=0,p=[],g=[];n.forEach(function(m){var y=u.options.addPath;typeof u.options.addPath=="function"&&(y=u.options.addPath(m,r));var S=n6(y,{lng:m,ns:r});if(S==null){f+=1,a&&f===n.length&&a(p,g);return}u.options.request(u.options,S,c,function(E,C){f+=1,p.push(E),g.push(C),f===n.length&&typeof a=="function"&&a(p,g)})})}}},{key:"reload",value:function(){var n=this,r=this.services,s=r.backendConnector,o=r.languageUtils,a=r.logger,u=s.language;if(!(u&&u.toLowerCase()==="cimode")){var c=[],f=function(g){var m=o.toResolveHierarchy(g);m.forEach(function(y){c.indexOf(y)<0&&c.push(y)})};f(u),this.allOptions.preload&&this.allOptions.preload.forEach(function(p){return f(p)}),c.forEach(function(p){n.allOptions.ns.forEach(function(g){s.read(p,g,"read",null,null,function(m,y){m&&a.warn("loading namespace ".concat(g," for language ").concat(p," failed"),m),!m&&y&&a.log("loaded namespace ".concat(g," for language ").concat(p),y),s.loaded("".concat(p,"|").concat(g),m,y)})})})}}}])})();gH.type="backend";pr.use(gH).use(aH).use(YCe).init({fallbackLng:"en",supportedLngs:["en","nl","de","fr"],ns:["common","mail","settings","errors"],defaultNS:"common",backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},detection:{order:["navigator","htmlTag"],caches:[]},interpolation:{escapeValue:!1},react:{useSuspense:!0,bindI18n:"languageChanged loaded"}});const TTe=({authProvider:t,rootElementId:e="root"})=>{ote(),UCe(),t.configure(),lme(t);const n=DCe();Yee(n);const r=new Phe({queryCache:new E7({onError:fme}),mutationCache:new S7({onError:hme}),defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:1}}}),s=RAe(r,n);n.recordPageView(window.location.pathname);const o=document.getElementById(e);if(!o)throw new Error(`Root element not found: #${e}`);const{Shell:a}=t;qge.createRoot(o).render(P.jsx(_.StrictMode,{children:P.jsx(BB.Provider,{value:n,children:P.jsxs(khe,{client:r,children:[P.jsx(dme,{value:t,children:P.jsx(a,{children:P.jsx(zge,{router:s})})}),!1]})})}))};TTe({authProvider:che});export{Fhe as $,KX as A,uh as B,dP as C,GQ as D,T8 as E,XX as F,RTe as G,ITe as H,eQ as I,VTe as J,WTe as K,DTe as L,nQ as M,md as N,tT as O,jTe as P,Rhe as Q,j as R,oQ as S,iQ as T,Dn as U,kv as V,f7 as W,wh as X,pb as Y,Dhe as Z,WN as _,In as a,Wwe as a$,Hhe as a0,zhe as a1,jhe as a2,Er as a3,qhe as a4,rU as a5,Bhe as a6,Whe as a7,fs as a8,Wr as a9,hIe as aA,vIe as aB,dIe as aC,Vn as aD,QRe as aE,Kwe as aF,rxe as aG,Hwe as aH,sIe as aI,oxe as aJ,aIe as aK,oIe as aL,b_e as aM,rIe as aN,XRe as aO,U5 as aP,Z7 as aQ,lIe as aR,iIe as aS,yIe as aT,gIe as aU,pIe as aV,_Ie as aW,MTe as aX,Q7 as aY,sxe as aZ,zy as a_,lge as aa,mIe as ab,gR as ac,$Re as ad,y_e as ae,Ix as af,ZTe as ag,VP as ah,mte as ai,Y7 as aj,ewe as ak,CIe as al,AIe as am,NRe as an,x7 as ao,Zwe as ap,E8 as aq,Vhe as ar,cIe as as,fIe as at,uIe as au,ZRe as av,Gwe as aw,bIe as ax,Jwe as ay,QB as az,Jt as b,Lg as b$,Bl as b0,zwe as b1,WB as b2,Swe as b3,Awe as b4,_we as b5,xwe as b6,VRe as b7,WRe as b8,GRe as b9,DRe as bA,URe as bB,TIe as bC,RIe as bD,YRe as bE,HTe as bF,kTe as bG,BTe as bH,Axe as bI,$ee as bJ,Bee as bK,jee as bL,h5 as bM,MRe as bN,zRe as bO,BRe as bP,Bwe as bQ,jRe as bR,bee as bS,FTe as bT,yee as bU,HRe as bV,qRe as bW,Nx as bX,EIe as bY,nIe as bZ,Ywe as b_,KRe as ba,JRe as bb,qTe as bc,PRe as bd,wIe as be,xIe as bf,qa as bg,gwe as bh,C9 as bi,My as bj,C_e as bk,PTe as bl,aT as bm,tz as bn,Vwe as bo,KTe as bp,LRe as bq,kRe as br,FRe as bs,yd as bt,m_e as bu,xr as bv,SIe as bw,eIe as bx,tIe as by,Y_e as bz,_8 as c,H9 as c0,No as c1,MT as c2,Ai as c3,Hie as c4,Ti as c5,kie as c6,B9 as c7,Gy as c8,wF as c9,jie as cA,mT as cB,Fie as cC,sae as cD,MF as cE,NTe as cF,op as cG,$Te as cH,DT as cI,tb as cJ,lp as cK,Jie as cL,ip as cM,eae as cN,Gie as cO,soe as ca,Vie as cb,tae as cc,ioe as cd,Jse as ce,$y as cf,gT as cg,D9 as ch,Qie as ci,Kie as cj,doe as ck,$ie as cl,zT as cm,F9 as cn,aoe as co,Lie as cp,Uie as cq,Ine as cr,iu as cs,Sne as ct,bne as cu,pT as cv,TF as cw,Die as cx,wne as cy,coe as cz,wP as d,ZX as e,VQ as f,YX as g,tQ as h,Qx as i,P as j,wJ as k,LTe as l,I8 as m,TJ as n,sQ as o,UTe as p,_ee as q,_ as r,wee as s,zTe as t,_J as u,IJ as v,pS as w,aQ as x,NJ as y,S8 as z};
294
+ or you can use record.mirror to access the mirror instance during recording.`;let Q4={map:{},getId(){return console.error(bc),-1},getNode(){return console.error(bc),null},removeNodeFromMap(){console.error(bc)},has(){return console.error(bc),!1},reset(){console.error(bc)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Q4=new Proxy(Q4,{get(t,e,n){return e==="map"&&console.error(bc),Reflect.get(t,e,n)}}));function Yh(t,e,n={}){let r=null,s=0;return function(...o){const a=Date.now();!s&&n.leading===!1&&(s=a);const u=e-(a-s),c=this;u<=0||u>e?(r&&(clearTimeout(r),r=null),s=a,t.apply(c,o)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{s=n.leading===!1?0:Date.now(),r=null,t.apply(c,o)},u))}}function Lb(t,e,n,r,s=window){const o=s.Object.getOwnPropertyDescriptor(t,e);return s.Object.defineProperty(t,e,r?n:{set(a){setTimeout(()=>{n.set.call(this,a)},0),o&&o.set&&o.set.call(this,a)}}),()=>Lb(t,e,o||{},!0)}let ly=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ly=()=>new Date().getTime());function yB(t){var e,n,r,s;const o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:t.pageXOffset!==void 0?t.pageXOffset:o.documentElement.scrollLeft||o?.body&&((e=rt.parentElement(o.body))==null?void 0:e.scrollLeft)||((n=o?.body)==null?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:t.pageYOffset!==void 0?t.pageYOffset:o?.documentElement.scrollTop||o?.body&&((r=rt.parentElement(o.body))==null?void 0:r.scrollTop)||((s=o?.body)==null?void 0:s.scrollTop)||0}}function bB(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function SB(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function EB(t){return t?t.nodeType===t.ELEMENT_NODE?t:rt.parentElement(t):null}function wr(t,e,n,r){if(!t)return!1;const s=EB(t);if(!s)return!1;try{if(typeof e=="string"){if(s.classList.contains(e)||r&&s.closest("."+e)!==null)return!0}else if(Jv(s,e,r))return!0}catch{}return!!(n&&(s.matches(n)||r&&s.closest(n)!==null))}function zEe(t,e){return e.getId(t)!==-1}function Tx(t,e,n){return t.tagName==="TITLE"&&n.headTitleMutations?!0:e.getId(t)===jh}function CB(t,e){if(vh(t))return!1;const n=e.getId(t);if(!e.has(n))return!0;const r=rt.parentNode(t);return r&&r.nodeType===t.DOCUMENT_NODE?!1:r?CB(r,e):!0}function mA(t){return!!t.changedTouches}function jEe(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function wB(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function xB(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function vA(t){return t?t instanceof nI&&"shadowRoot"in t?!!t.shadowRoot:!!rt.shadowRoot(t):!1}class BEe{constructor(){Se(this,"id",1),Se(this,"styleIDMap",new WeakMap),Se(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,n){if(this.has(e))return this.getId(e);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function _B(t){var e;let n=null;return"getRootNode"in t&&((e=rt.getRootNode(t))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&rt.host(rt.getRootNode(t))&&(n=rt.host(rt.getRootNode(t))),n}function HEe(t){let e=t,n;for(;n=_B(e);)e=n;return e}function $Ee(t){const e=rt.ownerDocument(t);if(!e)return!1;const n=HEe(t);return rt.contains(e,n)}function AB(t){const e=rt.ownerDocument(t);return e?rt.contains(e,t)||$Ee(t):!1}var Ct=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Ct||{}),ft=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(ft||{}),Ur=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Ur||{}),si=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(si||{}),Xc=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Xc||{}),Sc=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(Sc||{}),TB=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(TB||{});function J4(t){return"__ln"in t}class qEe{constructor(){Se(this,"length",0),Se(this,"head",null),Se(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<e;r++)n=n?.next||null;return n}addNode(e){const n={value:e,previous:null,next:null};if(e.__ln=n,e.previousSibling&&J4(e.previousSibling)){const r=e.previousSibling.__ln.next;n.next=r,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(e.nextSibling&&J4(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;n.previous=r,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(e){const n=e.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const e5=(t,e)=>`${t}@${e}`;class WEe{constructor(){Se(this,"frozen",!1),Se(this,"locked",!1),Se(this,"texts",[]),Se(this,"attributes",[]),Se(this,"attributeMap",new WeakMap),Se(this,"removes",[]),Se(this,"mapRemoves",[]),Se(this,"movedMap",{}),Se(this,"addedSet",new Set),Se(this,"movedSet",new Set),Se(this,"droppedSet",new Set),Se(this,"removesSubTreeCache",new Set),Se(this,"mutationCb"),Se(this,"blockClass"),Se(this,"blockSelector"),Se(this,"maskTextClass"),Se(this,"maskTextSelector"),Se(this,"inlineStylesheet"),Se(this,"maskInputOptions"),Se(this,"maskTextFn"),Se(this,"maskInputFn"),Se(this,"keepIframeSrcFn"),Se(this,"recordCanvas"),Se(this,"inlineImages"),Se(this,"slimDOMOptions"),Se(this,"dataURLOptions"),Se(this,"doc"),Se(this,"mirror"),Se(this,"iframeManager"),Se(this,"stylesheetManager"),Se(this,"shadowDomManager"),Se(this,"canvasManager"),Se(this,"processedNodeManager"),Se(this,"unattachedDoc"),Se(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Se(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],n=new Set,r=new qEe,s=c=>{let f=c,p=jh;for(;p===jh;)f=f&&f.nextSibling,p=f&&this.mirror.getId(f);return p},o=c=>{const f=rt.parentNode(c);if(!f||!AB(c))return;let p=!1;if(c.nodeType===Node.TEXT_NODE){const S=f.tagName;if(S==="TEXTAREA")return;S==="STYLE"&&this.addedSet.has(f)&&(p=!0)}const g=vh(f)?this.mirror.getId(_B(c)):this.mirror.getId(f),m=s(c);if(g===-1||m===-1)return r.addNode(c);const y=Ic(c,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:S=>{wB(S,this.mirror)&&this.iframeManager.addIframe(S),xB(S,this.mirror)&&this.stylesheetManager.trackLinkElement(S),vA(c)&&this.shadowDomManager.addShadowRoot(rt.shadowRoot(c),this.doc)},onIframeLoad:(S,E)=>{this.iframeManager.attachIframe(S,E),this.shadowDomManager.observeAttachShadow(S)},onStylesheetLoad:(S,E)=>{this.stylesheetManager.attachLinkElement(S,E)},cssCaptured:p});y&&(e.push({parentId:g,nextId:m,node:y}),n.add(y.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of this.movedSet)t5(this.removesSubTreeCache,c,this.mirror)&&!this.movedSet.has(rt.parentNode(c))||o(c);for(const c of this.addedSet)!n5(this.droppedSet,c)&&!t5(this.removesSubTreeCache,c,this.mirror)||n5(this.movedSet,c)?o(c):this.droppedSet.add(c);let a=null;for(;r.length;){let c=null;if(a){const f=this.mirror.getId(rt.parentNode(a.value)),p=s(a.value);f!==-1&&p!==-1&&(c=a)}if(!c){let f=r.tail;for(;f;){const p=f;if(f=f.previous,p){const g=this.mirror.getId(rt.parentNode(p.value));if(s(p.value)===-1)continue;if(g!==-1){c=p;break}else{const y=p.value,S=rt.parentNode(y);if(S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const E=rt.host(S);if(this.mirror.getId(E)!==-1){c=p;break}}}}}}if(!c){for(;r.head;)r.removeNode(r.head.value);break}a=c.previous,r.removeNode(c.value),o(c.value)}const u={texts:this.texts.map(c=>{const f=c.node,p=rt.parentNode(f);return p&&p.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(p),{id:this.mirror.getId(f),value:c.value}}).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:f}=c;if(typeof f.style=="string"){const p=JSON.stringify(c.styleDiff),g=JSON.stringify(c._unchangedStyles);p.length<f.style.length&&(p+g).split("var(").length===f.style.split("var(").length&&(f.style=c.styleDiff)}return{id:this.mirror.getId(c.node),attributes:f}}).filter(c=>!n.has(c.id)).filter(c=>this.mirror.has(c.id)),removes:this.removes,adds:e};!u.texts.length&&!u.attributes.length&&!u.removes.length&&!u.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(u))}),Se(this,"genTextAreaValueMutation",e=>{let n=this.attributeMap.get(e);n||(n={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e,n));const r=Array.from(rt.childNodes(e),s=>rt.textContent(s)||"").join("");n.attributes.value=Zv({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Xv(e),value:r,maskInputFn:this.maskInputFn})}),Se(this,"processMutation",e=>{if(!Tx(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const n=rt.textContent(e.target);!wr(e.target,this.blockClass,this.blockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:Zz(e.target,this.maskTextClass,this.maskTextSelector,!0)&&n?this.maskTextFn?this.maskTextFn(n,EB(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,s=e.target.getAttribute(r);if(r==="value"){const a=Xv(n);s=Zv({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:a,value:s,maskInputFn:this.maskInputFn})}if(wr(e.target,this.blockClass,this.blockSelector,!1)||s===e.oldValue)return;let o=this.attributeMap.get(e.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!n.contentDocument)r="rr_src";else return;if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),r==="type"&&n.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!Yz(n.tagName,r))if(o.attributes[r]=Kz(this.doc,Yl(n.tagName),Yl(r),s),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");e.oldValue&&a.setAttribute("style",e.oldValue);for(const u of Array.from(n.style)){const c=n.style.getPropertyValue(u),f=n.style.getPropertyPriority(u);c!==a.style.getPropertyValue(u)||f!==a.style.getPropertyPriority(u)?f===""?o.styleDiff[u]=c:o.styleDiff[u]=[c,f]:o._unchangedStyles[u]=[c,f]}for(const u of Array.from(a.style))n.style.getPropertyValue(u)===""&&(o.styleDiff[u]=!1)}else r==="open"&&n.tagName==="DIALOG"&&(n.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(wr(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(n=>this.genAdds(n,e.target)),e.removedNodes.forEach(n=>{const r=this.mirror.getId(n),s=vh(e.target)?this.mirror.getId(rt.host(e.target)):this.mirror.getId(e.target);wr(e.target,this.blockClass,this.blockSelector,!1)||Tx(n,this.mirror,this.slimDOMOptions)||!zEe(n,this.mirror)||(this.addedSet.has(n)?(yA(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||CB(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[e5(r,s)]?yA(this.movedSet,n):(this.removes.push({parentId:s,id:r,isShadow:vh(e.target)&&yh(e.target)?!0:void 0}),VEe(n,this.removesSubTreeCache))),this.mapRemoves.push(n))});break}}}),Se(this,"genAdds",(e,n)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Tx(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[e5(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);wr(e,this.blockClass,this.blockSelector,!1)||(rt.childNodes(e).forEach(r=>this.genAdds(r)),vA(e)&&rt.childNodes(rt.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(n=>{this[n]=e[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function yA(t,e){t.delete(e),rt.childNodes(e).forEach(n=>yA(t,n))}function VEe(t,e){const n=[t];for(;n.length;){const r=n.pop();e.has(r)||(e.add(r),rt.childNodes(r).forEach(s=>n.push(s)))}}function t5(t,e,n){return t.size===0?!1:GEe(t,e)}function GEe(t,e,n){const r=rt.parentNode(e);return r?t.has(r):!1}function n5(t,e){return t.size===0?!1:RB(t,e)}function RB(t,e){const n=rt.parentNode(e);return n?t.has(n)?!0:RB(t,n):!1}let bh;function KEe(t){bh=t}function YEe(){bh=void 0}const vt=t=>bh?(...n)=>{try{return t(...n)}catch(r){if(bh&&bh(r)===!0)return;throw r}}:t,Rl=[];function vp(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function IB(t,e){const n=new WEe;Rl.push(n),n.init(t);const r=new(vB())(vt(n.processMutations.bind(n)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function ZEe({mousemoveCb:t,sampling:e,doc:n,mirror:r}){if(e.mousemove===!1)return()=>{};const s=typeof e.mousemove=="number"?e.mousemove:50,o=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let a=[],u;const c=Yh(vt(g=>{const m=Date.now()-u;t(a.map(y=>(y.timeOffset-=m,y)),g),a=[],u=null}),o),f=vt(Yh(vt(g=>{const m=vp(g),{clientX:y,clientY:S}=mA(g)?g.changedTouches[0]:g;u||(u=ly()),a.push({x:y,y:S,id:r.getId(m),timeOffset:ly()-u}),c(typeof DragEvent<"u"&&g instanceof DragEvent?ft.Drag:g instanceof MouseEvent?ft.MouseMove:ft.TouchMove)}),s,{trailing:!1})),p=[Cr("mousemove",f,n),Cr("touchmove",f,n),Cr("drag",f,n)];return vt(()=>{p.forEach(g=>g())})}function XEe({mouseInteractionCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const a=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,u=[];let c=null;const f=p=>g=>{const m=vp(g);if(wr(m,r,s,!0))return;let y=null,S=p;if("pointerType"in g){switch(g.pointerType){case"mouse":y=si.Mouse;break;case"touch":y=si.Touch;break;case"pen":y=si.Pen;break}y===si.Touch?Ur[p]===Ur.MouseDown?S="TouchStart":Ur[p]===Ur.MouseUp&&(S="TouchEnd"):si.Pen}else mA(g)&&(y=si.Touch);y!==null?(c=y,(S.startsWith("Touch")&&y===si.Touch||S.startsWith("Mouse")&&y===si.Mouse)&&(y=null)):Ur[p]===Ur.Click&&(y=c,c=null);const E=mA(g)?g.changedTouches[0]:g;if(!E)return;const C=n.getId(m),{clientX:w,clientY:A}=E;vt(t)({type:Ur[S],id:C,x:w,y:A,...y!==null&&{pointerType:y}})};return Object.keys(Ur).filter(p=>Number.isNaN(Number(p))&&!p.endsWith("_Departed")&&a[p]!==!1).forEach(p=>{let g=Yl(p);const m=f(p);if(window.PointerEvent)switch(Ur[p]){case Ur.MouseDown:case Ur.MouseUp:g=g.replace("mouse","pointer");break;case Ur.TouchStart:case Ur.TouchEnd:return}u.push(Cr(g,m,e))}),vt(()=>{u.forEach(p=>p())})}function OB({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,sampling:o}){const a=vt(Yh(vt(u=>{const c=vp(u);if(!c||wr(c,r,s,!0))return;const f=n.getId(c);if(c===e&&e.defaultView){const p=yB(e.defaultView);t({id:f,x:p.left,y:p.top})}else t({id:f,x:c.scrollLeft,y:c.scrollTop})}),o.scroll||100));return Cr("scroll",a,e)}function QEe({viewportResizeCb:t},{win:e}){let n=-1,r=-1;const s=vt(Yh(vt(()=>{const o=bB(),a=SB();(n!==o||r!==a)&&(t({width:Number(a),height:Number(o)}),n=o,r=a)}),200));return Cr("resize",s,e)}const JEe=["INPUT","TEXTAREA","SELECT"],r5=new WeakMap;function eCe({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:u,maskInputFn:c,sampling:f,userTriggeredOnInput:p}){function g(A){let T=vp(A);const R=A.isTrusted,N=T&&T.tagName;if(T&&N==="OPTION"&&(T=rt.parentElement(T)),!T||!N||JEe.indexOf(N)<0||wr(T,r,s,!0)||T.classList.contains(o)||a&&T.matches(a))return;let O=T.value,I=!1;const k=Xv(T)||"";k==="radio"||k==="checkbox"?I=T.checked:(u[N.toLowerCase()]||u[k])&&(O=Zv({element:T,maskInputOptions:u,tagName:N,type:k,value:O,maskInputFn:c})),m(T,p?{text:O,isChecked:I,userTriggered:R}:{text:O,isChecked:I});const F=T.name;k==="radio"&&F&&I&&e.querySelectorAll(`input[type="radio"][name="${F}"]`).forEach($=>{if($!==T){const D=$.value;m($,p?{text:D,isChecked:!I,userTriggered:!1}:{text:D,isChecked:!I})}})}function m(A,T){const R=r5.get(A);if(!R||R.text!==T.text||R.isChecked!==T.isChecked){r5.set(A,T);const N=n.getId(A);vt(t)({...T,id:N})}}const S=(f.input==="last"?["change"]:["input","change"]).map(A=>Cr(A,vt(g),e)),E=e.defaultView;if(!E)return()=>{S.forEach(A=>A())};const C=E.Object.getOwnPropertyDescriptor(E.HTMLInputElement.prototype,"value"),w=[[E.HTMLInputElement.prototype,"value"],[E.HTMLInputElement.prototype,"checked"],[E.HTMLSelectElement.prototype,"value"],[E.HTMLTextAreaElement.prototype,"value"],[E.HTMLSelectElement.prototype,"selectedIndex"],[E.HTMLOptionElement.prototype,"selected"]];return C&&C.set&&S.push(...w.map(A=>Lb(A[0],A[1],{set(){vt(g)({target:this,isTrusted:!1})}},!1,E))),vt(()=>{S.forEach(A=>A())})}function uy(t){const e=[];function n(r,s){if(Fm("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Fm("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Fm("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Fm("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const a=Array.from(r.parentRule.cssRules).indexOf(r);s.unshift(a)}else if(r.parentStyleSheet){const a=Array.from(r.parentStyleSheet.cssRules).indexOf(r);s.unshift(a)}return s}return n(t,e)}function ba(t,e,n){let r,s;return t?(t.ownerNode?r=e.getId(t.ownerNode):s=n.getId(t),{styleId:s,id:r}):{}}function tCe({styleSheetRuleCb:t,mirror:e,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:vt((p,g,m)=>{const[y,S]=m,{id:E,styleId:C}=ba(g,e,n.styleMirror);return(E&&E!==-1||C&&C!==-1)&&t({id:E,styleId:C,adds:[{rule:y,index:S}]}),p.apply(g,m)})}),r.CSSStyleSheet.prototype.addRule=function(p,g,m=this.cssRules.length){const y=`${p} { ${g} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[y,m])};const o=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:vt((p,g,m)=>{const[y]=m,{id:S,styleId:E}=ba(g,e,n.styleMirror);return(S&&S!==-1||E&&E!==-1)&&t({id:S,styleId:E,removes:[{index:y}]}),p.apply(g,m)})}),r.CSSStyleSheet.prototype.removeRule=function(p){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[p])};let a;r.CSSStyleSheet.prototype.replace&&(a=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:vt((p,g,m)=>{const[y]=m,{id:S,styleId:E}=ba(g,e,n.styleMirror);return(S&&S!==-1||E&&E!==-1)&&t({id:S,styleId:E,replace:y}),p.apply(g,m)})}));let u;r.CSSStyleSheet.prototype.replaceSync&&(u=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:vt((p,g,m)=>{const[y]=m,{id:S,styleId:E}=ba(g,e,n.styleMirror);return(S&&S!==-1||E&&E!==-1)&&t({id:S,styleId:E,replaceSync:y}),p.apply(g,m)})}));const c={};zm("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(zm("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),zm("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),zm("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const f={};return Object.entries(c).forEach(([p,g])=>{f[p]={insertRule:g.prototype.insertRule,deleteRule:g.prototype.deleteRule},g.prototype.insertRule=new Proxy(f[p].insertRule,{apply:vt((m,y,S)=>{const[E,C]=S,{id:w,styleId:A}=ba(y.parentStyleSheet,e,n.styleMirror);return(w&&w!==-1||A&&A!==-1)&&t({id:w,styleId:A,adds:[{rule:E,index:[...uy(y),C||0]}]}),m.apply(y,S)})}),g.prototype.deleteRule=new Proxy(f[p].deleteRule,{apply:vt((m,y,S)=>{const[E]=S,{id:C,styleId:w}=ba(y.parentStyleSheet,e,n.styleMirror);return(C&&C!==-1||w&&w!==-1)&&t({id:C,styleId:w,removes:[{index:[...uy(y),E]}]}),m.apply(y,S)})})}),vt(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=o,a&&(r.CSSStyleSheet.prototype.replace=a),u&&(r.CSSStyleSheet.prototype.replaceSync=u),Object.entries(c).forEach(([p,g])=>{g.prototype.insertRule=f[p].insertRule,g.prototype.deleteRule=f[p].deleteRule})})}function NB({mirror:t,stylesheetManager:e},n){var r,s,o;let a=null;n.nodeName==="#document"?a=t.getId(n):a=t.getId(rt.host(n));const u=n.nodeName==="#document"?(r=n.defaultView)==null?void 0:r.Document:(o=(s=n.ownerDocument)==null?void 0:s.defaultView)==null?void 0:o.ShadowRoot,c=u?.prototype?Object.getOwnPropertyDescriptor(u?.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!u||!c?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var f;return(f=c.get)==null?void 0:f.call(this)},set(f){var p;const g=(p=c.set)==null?void 0:p.call(this,f);if(a!==null&&a!==-1)try{e.adoptStyleSheets(f,a)}catch{}return g}}),vt(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))}function nCe({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:vt((u,c,f)=>{var p;const[g,m,y]=f;if(n.has(g))return o.apply(c,[g,m,y]);const{id:S,styleId:E}=ba((p=c.parentRule)==null?void 0:p.parentStyleSheet,e,r.styleMirror);return(S&&S!==-1||E&&E!==-1)&&t({id:S,styleId:E,set:{property:g,value:m,priority:y},index:uy(c.parentRule)}),u.apply(c,f)})});const a=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:vt((u,c,f)=>{var p;const[g]=f;if(n.has(g))return a.apply(c,[g]);const{id:m,styleId:y}=ba((p=c.parentRule)==null?void 0:p.parentStyleSheet,e,r.styleMirror);return(m&&m!==-1||y&&y!==-1)&&t({id:m,styleId:y,remove:{property:g},index:uy(c.parentRule)}),u.apply(c,f)})}),vt(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a})}function rCe({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:r,sampling:s,doc:o}){const a=vt(c=>Yh(vt(f=>{const p=vp(f);if(!p||wr(p,e,n,!0))return;const{currentTime:g,volume:m,muted:y,playbackRate:S,loop:E}=p;t({type:c,id:r.getId(p),currentTime:g,volume:m,muted:y,playbackRate:S,loop:E})}),s.media||500)),u=[Cr("play",a(Sc.Play),o),Cr("pause",a(Sc.Pause),o),Cr("seeked",a(Sc.Seeked),o),Cr("volumechange",a(Sc.VolumeChange),o),Cr("ratechange",a(Sc.RateChange),o)];return vt(()=>{u.forEach(c=>c())})}function sCe({fontCb:t,doc:e}){const n=e.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,o=n.FontFace;n.FontFace=function(c,f,p){const g=new o(c,f,p);return s.set(g,{family:c,buffer:typeof f!="string",descriptors:p,fontSource:typeof f=="string"?f:JSON.stringify(Array.from(new Uint8Array(f)))}),g};const a=hu(e.fonts,"add",function(u){return function(c){return setTimeout(vt(()=>{const f=s.get(c);f&&(t(f),s.delete(c))}),0),u.apply(this,[c])}});return r.push(()=>{n.FontFace=o}),r.push(a),vt(()=>{r.forEach(u=>u())})}function oCe(t){const{doc:e,mirror:n,blockClass:r,blockSelector:s,selectionCb:o}=t;let a=!0;const u=vt(()=>{const c=e.getSelection();if(!c||a&&c?.isCollapsed)return;a=c.isCollapsed||!1;const f=[],p=c.rangeCount||0;for(let g=0;g<p;g++){const m=c.getRangeAt(g),{startContainer:y,startOffset:S,endContainer:E,endOffset:C}=m;wr(y,r,s,!0)||wr(E,r,s,!0)||f.push({start:n.getId(y),startOffset:S,end:n.getId(E),endOffset:C})}o({ranges:f})});return u(),Cr("selectionchange",u)}function iCe({doc:t,customElementCb:e}){const n=t.defaultView;return!n||!n.customElements?()=>{}:hu(n.customElements,"define",function(s){return function(o,a,u){try{e({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return s.apply(this,[o,a,u])}})}function aCe(t,e){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:a,inputCb:u,mediaInteractionCb:c,styleSheetRuleCb:f,styleDeclarationCb:p,canvasMutationCb:g,fontCb:m,selectionCb:y,customElementCb:S}=t;t.mutationCb=(...E)=>{e.mutation&&e.mutation(...E),n(...E)},t.mousemoveCb=(...E)=>{e.mousemove&&e.mousemove(...E),r(...E)},t.mouseInteractionCb=(...E)=>{e.mouseInteraction&&e.mouseInteraction(...E),s(...E)},t.scrollCb=(...E)=>{e.scroll&&e.scroll(...E),o(...E)},t.viewportResizeCb=(...E)=>{e.viewportResize&&e.viewportResize(...E),a(...E)},t.inputCb=(...E)=>{e.input&&e.input(...E),u(...E)},t.mediaInteractionCb=(...E)=>{e.mediaInteaction&&e.mediaInteaction(...E),c(...E)},t.styleSheetRuleCb=(...E)=>{e.styleSheetRule&&e.styleSheetRule(...E),f(...E)},t.styleDeclarationCb=(...E)=>{e.styleDeclaration&&e.styleDeclaration(...E),p(...E)},t.canvasMutationCb=(...E)=>{e.canvasMutation&&e.canvasMutation(...E),g(...E)},t.fontCb=(...E)=>{e.font&&e.font(...E),m(...E)},t.selectionCb=(...E)=>{e.selection&&e.selection(...E),y(...E)},t.customElementCb=(...E)=>{e.customElement&&e.customElement(...E),S(...E)}}function lCe(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};aCe(t,e);let r;t.recordDOM&&(r=IB(t,t.doc));const s=ZEe(t),o=XEe(t),a=OB(t),u=QEe(t,{win:n}),c=eCe(t),f=rCe(t);let p=()=>{},g=()=>{},m=()=>{},y=()=>{};t.recordDOM&&(p=tCe(t,{win:n}),g=NB(t,t.doc),m=nCe(t,{win:n}),t.collectFonts&&(y=sCe(t)));const S=oCe(t),E=iCe(t),C=[];for(const w of t.plugins)C.push(w.observer(w.callback,n,w.options));return vt(()=>{Rl.forEach(w=>w.reset()),r?.disconnect(),s(),o(),a(),u(),c(),f(),p(),g(),m(),y(),S(),E(),C.forEach(w=>w())})}function Fm(t){return typeof window[t]<"u"}function zm(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class s5{constructor(e){Se(this,"iframeIdToRemoteIdMap",new WeakMap),Se(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,n,r,s){const o=r||this.getIdToRemoteIdMap(e),a=s||this.getRemoteIdToIdMap(e);let u=o.get(n);return u||(u=this.generateIdFn(),o.set(n,u),a.set(u,n)),u}getIds(e,n){const r=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return n.map(o=>this.getId(e,o,r,s))}getRemoteId(e,n,r){const s=r||this.getRemoteIdToIdMap(e);if(typeof n!="number")return n;const o=s.get(n);return o||-1}getRemoteIds(e,n){const r=this.getRemoteIdToIdMap(e);return n.map(s=>this.getRemoteId(e,s,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let n=this.iframeIdToRemoteIdMap.get(e);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(e,n)),n}getRemoteIdToIdMap(e){let n=this.iframeRemoteIdToIdMap.get(e);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(e,n)),n}}class uCe{constructor(e){Se(this,"iframes",new WeakMap),Se(this,"crossOriginIframeMap",new WeakMap),Se(this,"crossOriginIframeMirror",new s5(Gz)),Se(this,"crossOriginIframeStyleMirror"),Se(this,"crossOriginIframeRootIdMap",new WeakMap),Se(this,"mirror"),Se(this,"mutationCb"),Se(this,"wrappedEmit"),Se(this,"loadListener"),Se(this,"stylesheetManager"),Se(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new s5(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,n){var r,s;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const n=e;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!e.source)return;const s=this.crossOriginIframeMap.get(e.source);if(!s)return;const o=this.transformCrossOriginEvent(s,n.data.event);o&&this.wrappedEmit(o,n.data.isCheckout)}transformCrossOriginEvent(e,n){var r;switch(n.type){case Ct.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(n.data.node,e);const s=n.data.node.id;return this.crossOriginIframeRootIdMap.set(e,s),this.patchRootIdOnNode(n.data.node,s),{timestamp:n.timestamp,type:Ct.IncrementalSnapshot,data:{source:ft.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Ct.Meta:case Ct.Load:case Ct.DomContentLoaded:return!1;case Ct.Plugin:return n;case Ct.Custom:return this.replaceIds(n.data.payload,e,["id","parentId","previousId","nextId"]),n;case Ct.IncrementalSnapshot:switch(n.data.source){case ft.Mutation:return n.data.adds.forEach(s=>{this.replaceIds(s,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,e);const o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(s.node,o)}),n.data.removes.forEach(s=>{this.replaceIds(s,e,["parentId","id"])}),n.data.attributes.forEach(s=>{this.replaceIds(s,e,["id"])}),n.data.texts.forEach(s=>{this.replaceIds(s,e,["id"])}),n;case ft.Drag:case ft.TouchMove:case ft.MouseMove:return n.data.positions.forEach(s=>{this.replaceIds(s,e,["id"])}),n;case ft.ViewportResize:return!1;case ft.MediaInteraction:case ft.MouseInteraction:case ft.Scroll:case ft.CanvasMutation:case ft.Input:return this.replaceIds(n.data,e,["id"]),n;case ft.StyleSheetRule:case ft.StyleDeclaration:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleId"]),n;case ft.Font:return n;case ft.Selection:return n.data.ranges.forEach(s=>{this.replaceIds(s,e,["start","end"])}),n;case ft.AdoptedStyleSheet:return this.replaceIds(n.data,e,["id"]),this.replaceStyleIds(n.data,e,["styleIds"]),(r=n.data.styles)==null||r.forEach(s=>{this.replaceStyleIds(s,e,["styleId"])}),n}}return!1}replace(e,n,r,s){for(const o of s)!Array.isArray(n[o])&&typeof n[o]!="number"||(Array.isArray(n[o])?n[o]=e.getIds(r,n[o]):n[o]=e.getId(r,n[o]));return n}replaceIds(e,n,r){return this.replace(this.crossOriginIframeMirror,e,n,r)}replaceStyleIds(e,n,r){return this.replace(this.crossOriginIframeStyleMirror,e,n,r)}replaceIdOnNode(e,n){this.replaceIds(e,n,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(e,n){e.type!==TB.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class cCe{constructor(e){Se(this,"shadowDoms",new WeakSet),Se(this,"mutationCb"),Se(this,"scrollCb"),Se(this,"bypassOptions"),Se(this,"mirror"),Se(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,n){if(!yh(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=IB({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(OB({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(rt.host(e))),this.restoreHandlers.push(NB({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,n){const r=this;this.restoreHandlers.push(hu(e.prototype,"attachShadow",function(s){return function(o){const a=s.call(this,o),u=rt.shadowRoot(this);return u&&AB(this)&&r.addShadowRoot(u,n),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Oc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dCe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var jm=0;jm<Oc.length;jm++)dCe[Oc.charCodeAt(jm)]=jm;var fCe=function(t){var e=new Uint8Array(t),n,r=e.length,s="";for(n=0;n<r;n+=3)s+=Oc[e[n]>>2],s+=Oc[(e[n]&3)<<4|e[n+1]>>4],s+=Oc[(e[n+1]&15)<<2|e[n+2]>>6],s+=Oc[e[n+2]&63];return r%3===2?s=s.substring(0,s.length-1)+"=":r%3===1&&(s=s.substring(0,s.length-2)+"=="),s};const o5=new Map;function hCe(t,e){let n=o5.get(t);return n||(n=new Map,o5.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}const MB=(t,e,n)=>{if(!t||!(kB(t,e)||typeof t=="object"))return;const r=t.constructor.name,s=hCe(n,r);let o=s.indexOf(t);return o===-1&&(o=s.length,s.push(t)),o};function mv(t,e,n){if(t instanceof Array)return t.map(r=>mv(r,e,n));if(t===null)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){const r=t.constructor.name,s=fCe(t);return{rr_type:r,base64:s}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[mv(t.buffer,e,n),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const r=t.constructor.name,{src:s}=t;return{rr_type:r,src:s}}else if(t instanceof HTMLCanvasElement){const r="HTMLImageElement",s=t.toDataURL();return{rr_type:r,src:s}}else{if(t instanceof ImageData)return{rr_type:t.constructor.name,args:[mv(t.data,e,n),t.width,t.height]};if(kB(t,e)||typeof t=="object"){const r=t.constructor.name,s=MB(t,e,n);return{rr_type:r,index:s}}}}return t}const PB=(t,e,n)=>t.map(r=>mv(r,e,n)),kB=(t,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(s=>typeof e[s]=="function").find(s=>t instanceof e[s]);function pCe(t,e,n,r){const s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const a of o)try{if(typeof e.CanvasRenderingContext2D.prototype[a]!="function")continue;const u=hu(e.CanvasRenderingContext2D.prototype,a,function(c){return function(...f){return wr(this.canvas,n,r,!0)||setTimeout(()=>{const p=PB(f,e,this);t(this.canvas,{type:Xc["2D"],property:a,args:p})},0),c.apply(this,f)}});s.push(u)}catch{const u=Lb(e.CanvasRenderingContext2D.prototype,a,{set(c){t(this.canvas,{type:Xc["2D"],property:a,args:[c],setter:!0})}});s.push(u)}return()=>{s.forEach(a=>a())}}function gCe(t){return t==="experimental-webgl"?"webgl":t}function i5(t,e,n,r){const s=[];try{const o=hu(t.HTMLCanvasElement.prototype,"getContext",function(a){return function(u,...c){if(!wr(this,e,n,!0)){const f=gCe(u);if("__context"in this||(this.__context=f),r&&["webgl","webgl2"].includes(f))if(c[0]&&typeof c[0]=="object"){const p=c[0];p.preserveDrawingBuffer||(p.preserveDrawingBuffer=!0)}else c.splice(0,1,{preserveDrawingBuffer:!0})}return a.apply(this,[u,...c])}});s.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(o=>o())}}function a5(t,e,n,r,s,o){const a=[],u=Object.getOwnPropertyNames(t);for(const c of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof t[c]!="function")continue;const f=hu(t,c,function(p){return function(...g){const m=p.apply(this,g);if(MB(m,o,this),"tagName"in this.canvas&&!wr(this.canvas,r,s,!0)){const y=PB(g,o,this),S={type:e,property:c,args:y};n(this.canvas,S)}return m}});a.push(f)}catch{const f=Lb(t,c,{set(p){n(this.canvas,{type:e,property:c,args:[p],setter:!0})}});a.push(f)}return a}function mCe(t,e,n,r){const s=[];return s.push(...a5(e.WebGLRenderingContext.prototype,Xc.WebGL,t,n,r,e)),typeof e.WebGL2RenderingContext<"u"&&s.push(...a5(e.WebGL2RenderingContext.prototype,Xc.WebGL2,t,n,r,e)),()=>{s.forEach(o=>o())}}const DB="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",vCe=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),l5=typeof window<"u"&&window.Blob&&new Blob([vCe(DB)],{type:"text/javascript;charset=utf-8"});function yCe(t){let e;try{if(e=l5&&(window.URL||window.webkitURL).createObjectURL(l5),!e)throw"";const n=new Worker(e,{name:t?.name});return n.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),n}catch{return new Worker("data:text/javascript;base64,"+DB,{name:t?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class bCe{constructor(e){Se(this,"pendingCanvasMutations",new Map),Se(this,"rafStamps",{latestId:0,invokeId:null}),Se(this,"mirror"),Se(this,"mutationCb"),Se(this,"resetObservers"),Se(this,"frozen",!1),Se(this,"locked",!1),Se(this,"processMutation",(c,f)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(f)});const{sampling:n="all",win:r,blockClass:s,blockSelector:o,recordCanvas:a,dataURLOptions:u}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&n==="all"&&this.initCanvasMutationObserver(r,s,o),a&&typeof n=="number"&&this.initCanvasFPSObserver(n,r,s,o,{dataURLOptions:u})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,n,r,s,o){const a=i5(n,r,s,!0),u=new Map,c=new yCe;c.onmessage=S=>{const{id:E}=S.data;if(u.set(E,!1),!("base64"in S.data))return;const{base64:C,type:w,width:A,height:T}=S.data;this.mutationCb({id:E,type:Xc["2D"],commands:[{property:"clearRect",args:[0,0,A,T]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:C}],type:w}]},0,0]}]})};const f=1e3/e;let p=0,g;const m=()=>{const S=[];return n.document.querySelectorAll("canvas").forEach(E=>{wr(E,r,s,!0)||S.push(E)}),S},y=S=>{if(p&&S-p<f){g=requestAnimationFrame(y);return}p=S,m().forEach(async E=>{var C;const w=this.mirror.getId(E);if(u.get(w)||E.width===0||E.height===0)return;if(u.set(w,!0),["webgl","webgl2"].includes(E.__context)){const T=E.getContext(E.__context);((C=T?.getContextAttributes())==null?void 0:C.preserveDrawingBuffer)===!1&&T.clear(T.COLOR_BUFFER_BIT)}const A=await createImageBitmap(E);c.postMessage({id:w,bitmap:A,width:E.width,height:E.height,dataURLOptions:o.dataURLOptions},[A])}),g=requestAnimationFrame(y)};g=requestAnimationFrame(y),this.resetObservers=()=>{a(),cancelAnimationFrame(g)}}initCanvasMutationObserver(e,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=i5(e,n,r,!1),o=pCe(this.processMutation.bind(this),e,n,r),a=mCe(this.processMutation.bind(this),e,n,r);this.resetObservers=()=>{s(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=n=>{this.rafStamps.latestId=n,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,n)=>{const r=this.mirror.getId(n);this.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,n){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||n===-1)return;const s=r.map(a=>{const{type:u,...c}=a;return c}),{type:o}=r[0];this.mutationCb({id:n,type:o,commands:s}),this.pendingCanvasMutations.delete(e)}}class SCe{constructor(e){Se(this,"trackedLinkElements",new WeakSet),Se(this,"mutationCb"),Se(this,"adoptedStyleSheetCb"),Se(this,"styleMirror",new BEe),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,n){if(e.length===0)return;const r={id:n,styleIds:[]},s=[];for(const o of e){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),s.push({styleId:a,rules:Array.from(o.rules||CSSRule,(u,c)=>({rule:qz(u,o.href),index:c}))})),r.styleIds.push(a)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class ECe{constructor(){Se(this,"nodeMap",new WeakMap),Se(this,"active",!1)}inOtherBuffer(e,n){const r=this.nodeMap.get(e);return r&&Array.from(r).some(s=>s!==n)}add(e,n){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(n))}destroy(){}}let gn,vv,Rx,cy=!1;try{if(Array.from([1],t=>t*2)[0]!==2){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=((d4=t.contentWindow)==null?void 0:d4.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}const Bs=wbe();function yp(t={}){const{emit:e,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:u=null,maskTextClass:c="rr-mask",maskTextSelector:f=null,inlineStylesheet:p=!0,maskAllInputs:g,maskInputOptions:m,slimDOMOptions:y,maskInputFn:S,maskTextFn:E,hooks:C,packFn:w,sampling:A={},dataURLOptions:T={},mousemoveWait:R,recordDOM:N=!0,recordCanvas:O=!1,recordCrossOriginIframes:I=!1,recordAfter:k=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:F=!1,collectFonts:$=!1,inlineImages:D=!1,plugins:z,keepIframeSrcFn:q=()=>!1,ignoreCSSAttributes:Y=new Set([]),errorHandler:te}=t;KEe(te);const H=I?window.parent===window:!0;let ee=!1;if(!H)try{window.parent.document&&(ee=!1)}catch{ee=!0}if(H&&!e)throw new Error("emit function is required");if(!H&&!ee)return()=>{};R!==void 0&&A.mousemove===void 0&&(A.mousemove=R),Bs.reset();const fe=g===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:m!==void 0?m:{password:!0},de=Xz(y);jEe();let Ae,L=0;const G=Ee=>{for(const pt of z||[])pt.eventProcessor&&(Ee=pt.eventProcessor(Ee));return w&&!ee&&(Ee=w(Ee)),Ee};gn=(Ee,pt)=>{var Ce;const ze=Ee;if(ze.timestamp=ly(),(Ce=Rl[0])!=null&&Ce.isFrozen()&&ze.type!==Ct.FullSnapshot&&!(ze.type===Ct.IncrementalSnapshot&&ze.data.source===ft.Mutation)&&Rl.forEach(je=>je.unfreeze()),H)e?.(G(ze),pt);else if(ee){const je={type:"rrweb",event:G(ze),origin:window.location.origin,isCheckout:pt};window.parent.postMessage(je,"*")}if(ze.type===Ct.FullSnapshot)Ae=ze,L=0;else if(ze.type===Ct.IncrementalSnapshot){if(ze.data.source===ft.Mutation&&ze.data.isAttachIframe)return;L++;const je=r&&L>=r,He=n&&ze.timestamp-Ae.timestamp>n;(je||He)&&vv(!0)}};const K=Ee=>{gn({type:Ct.IncrementalSnapshot,data:{source:ft.Mutation,...Ee}})},J=Ee=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.Scroll,...Ee}}),oe=Ee=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.CanvasMutation,...Ee}}),he=Ee=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.AdoptedStyleSheet,...Ee}}),ue=new SCe({mutationCb:K,adoptedStyleSheetCb:he}),ve=new uCe({mirror:Bs,mutationCb:K,stylesheetManager:ue,recordCrossOriginIframes:I,wrappedEmit:gn});for(const Ee of z||[])Ee.getMirror&&Ee.getMirror({nodeMirror:Bs,crossOriginIframeMirror:ve.crossOriginIframeMirror,crossOriginIframeStyleMirror:ve.crossOriginIframeStyleMirror});const xe=new ECe;Rx=new bCe({recordCanvas:O,mutationCb:oe,win:window,blockClass:s,blockSelector:o,mirror:Bs,sampling:A.canvas,dataURLOptions:T});const Xe=new cCe({mutationCb:K,scrollCb:J,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:f,inlineStylesheet:p,maskInputOptions:fe,dataURLOptions:T,maskTextFn:E,maskInputFn:S,recordCanvas:O,inlineImages:D,sampling:A,slimDOMOptions:de,iframeManager:ve,stylesheetManager:ue,canvasManager:Rx,keepIframeSrcFn:q,processedNodeManager:xe},mirror:Bs});vv=(Ee=!1)=>{if(!N)return;gn({type:Ct.Meta,data:{href:window.location.href,width:SB(),height:bB()}},Ee),ue.reset(),Xe.init(),Rl.forEach(Ce=>Ce.lock());const pt=Gbe(document,{mirror:Bs,blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:f,inlineStylesheet:p,maskAllInputs:fe,maskTextFn:E,maskInputFn:S,slimDOM:de,dataURLOptions:T,recordCanvas:O,inlineImages:D,onSerialize:Ce=>{wB(Ce,Bs)&&ve.addIframe(Ce),xB(Ce,Bs)&&ue.trackLinkElement(Ce),vA(Ce)&&Xe.addShadowRoot(rt.shadowRoot(Ce),document)},onIframeLoad:(Ce,ze)=>{ve.attachIframe(Ce,ze),Xe.observeAttachShadow(Ce)},onStylesheetLoad:(Ce,ze)=>{ue.attachLinkElement(Ce,ze)},keepIframeSrcFn:q});if(!pt)return console.warn("Failed to snapshot the document");gn({type:Ct.FullSnapshot,data:{node:pt,initialOffset:yB(window)}},Ee),Rl.forEach(Ce=>Ce.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ue.adoptStyleSheets(document.adoptedStyleSheets,Bs.getId(document))};try{const Ee=[],pt=ze=>{var je;return vt(lCe)({mutationCb:K,mousemoveCb:(He,gr)=>gn({type:Ct.IncrementalSnapshot,data:{source:gr,positions:He}}),mouseInteractionCb:He=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.MouseInteraction,...He}}),scrollCb:J,viewportResizeCb:He=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.ViewportResize,...He}}),inputCb:He=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.Input,...He}}),mediaInteractionCb:He=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.MediaInteraction,...He}}),styleSheetRuleCb:He=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.StyleSheetRule,...He}}),styleDeclarationCb:He=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.StyleDeclaration,...He}}),canvasMutationCb:oe,fontCb:He=>gn({type:Ct.IncrementalSnapshot,data:{source:ft.Font,...He}}),selectionCb:He=>{gn({type:Ct.IncrementalSnapshot,data:{source:ft.Selection,...He}})},customElementCb:He=>{gn({type:Ct.IncrementalSnapshot,data:{source:ft.CustomElement,...He}})},blockClass:s,ignoreClass:a,ignoreSelector:u,maskTextClass:c,maskTextSelector:f,maskInputOptions:fe,inlineStylesheet:p,sampling:A,recordDOM:N,recordCanvas:O,inlineImages:D,userTriggeredOnInput:F,collectFonts:$,doc:ze,maskInputFn:S,maskTextFn:E,keepIframeSrcFn:q,blockSelector:o,slimDOMOptions:de,dataURLOptions:T,mirror:Bs,iframeManager:ve,stylesheetManager:ue,shadowDomManager:Xe,processedNodeManager:xe,canvasManager:Rx,ignoreCSSAttributes:Y,plugins:((je=z?.filter(He=>He.observer))==null?void 0:je.map(He=>({observer:He.observer,options:He.options,callback:gr=>gn({type:Ct.Plugin,data:{plugin:He.name,payload:gr}})})))||[]},C)};ve.addLoadListener(ze=>{try{Ee.push(pt(ze.contentDocument))}catch(je){console.warn(je)}});const Ce=()=>{vv(),Ee.push(pt(document)),cy=!0};return["interactive","complete"].includes(document.readyState)?Ce():(Ee.push(Cr("DOMContentLoaded",()=>{gn({type:Ct.DomContentLoaded,data:{}}),k==="DOMContentLoaded"&&Ce()})),Ee.push(Cr("load",()=>{gn({type:Ct.Load,data:{}}),k==="load"&&Ce()},window))),()=>{Ee.forEach(ze=>{try{ze()}catch(je){String(je).toLowerCase().includes("cross-origin")||console.warn(je)}}),xe.destroy(),cy=!1,YEe()}}catch(Ee){console.warn(Ee)}}yp.addCustomEvent=(t,e)=>{if(!cy)throw new Error("please add custom event after start recording");gn({type:Ct.Custom,data:{tag:t,payload:e}})};yp.freezePage=()=>{Rl.forEach(t=>t.freeze())};yp.takeFullSnapshot=t=>{if(!cy)throw new Error("please take full snapshot after start recording");vv(t)};yp.mirror=Bs;var u5;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(u5||(u5={}));const CCe="rrweb",wCe={maskAllInputs:!0,maskTextSelector:"*",maskInputOptions:void 0},xCe={additionalSampleRate:1,batchSize:50,flushInterval:5e3,recordOptions:{slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,recordCrossOriginIframes:!1}},c5=xCe;class _Ce extends Ns{constructor(e){super(CCe),this.recordingEvents=[],this.isRecording=!1,this.recordingStartTime=null,this.flushTimer=null,this.stopRecording=null,this.enabled=!1;const n=Object.assign(Object.assign(Object.assign({},c5.recordOptions),e?.recordOptions),wCe);this.config=Object.assign(Object.assign(Object.assign({},c5),e),{recordOptions:n}),be.info("RRWebPlugin initialized",{additionalSampleRate:this.config.additionalSampleRate,batchSize:this.config.batchSize,flushInterval:this.config.flushInterval})}enable(){var e;if(this.enabled){be.info("RRWebPlugin already enabled");return}const n=(e=this.context)===null||e===void 0?void 0:e.getSession();if(!n||!n.record){be.warn("RRWebPlugin skipping - session not being recorded",{hasSession:!!n,sessionRecord:n?.record});return}const r=Math.random();if(r>this.config.additionalSampleRate){be.warn("RRWebPlugin skipping - session replay additionalSampleRate",{randomValue:r,samplingRate:this.config.additionalSampleRate});return}this.enabled=!0,be.info("RRWebPlugin enabled - starting recording"),this.startRecording()}disable(){if(!this.enabled){be.info("RRWebPlugin already disabled");return}be.info("RRWebPlugin disabled - stopping recording"),this.enabled=!1,this.stopCurrentRecording()}record(e){const n=e?.action;n==="start"?(be.info("RRWebPlugin manual start recording"),this.startRecording()):n==="stop"&&(be.info("RRWebPlugin manual stop recording"),this.stopCurrentRecording())}onload(){}startRecording(){this.recordingStartTime=Date.now(),this.recordingEvents=[],this.isRecording=!0,be.info("RRWebPlugin starting rrweb recording",{startTime:this.recordingStartTime});const e=yp(Object.assign(Object.assign({},this.config.recordOptions),{emit:this.handleRRWebEvent.bind(this)}));e?(this.stopRecording=e,be.info("RRWebPlugin rrweb recording initialized successfully")):be.warn("RRWebPlugin failed to initialize rrweb recording"),this.flushTimer=window.setInterval(()=>{this.flush()},this.config.flushInterval)}stopCurrentRecording(){if(!this.isRecording){be.info("RRWebPlugin stopCurrentRecording called but not recording");return}be.info("RRWebPlugin stopping current recording"),this.isRecording=!1,this.stopRecording&&(this.stopRecording(),this.stopRecording=null,be.info("RRWebPlugin rrweb recording stopped")),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null,be.info("RRWebPlugin flush timer cleared")),this.flush()}handleRRWebEvent(e){this.isRecording&&(this.recordingEvents.push(e),this.recordingEvents.length>=this.config.batchSize&&(be.info("RRWebPlugin flushing events due to batch size",{eventCount:this.recordingEvents.length,batchSize:this.config.batchSize}),this.flush()))}flush(){if(this.recordingEvents.length===0){be.info("RRWebPlugin flushEvent called but no events to flush");return}be.info("RRWebPlugin flushing events",{eventCount:this.recordingEvents.length});const e=[...this.recordingEvents],n={version:"1.0.0",events:e,eventCount:e.length};this.context.record(YU,n),be.info("RRWebPlugin events sent to RUM",{eventType:YU,eventCount:this.recordingEvents.length}),this.recordingEvents=[]}}var ACe=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n},bA;(function(t){t.Path="PATH",t.Hash="HASH",t.PathAndHash="PATH_AND_HASH"})(bA||(bA={}));const LB="us-west-2",SA=`https://dataplane.rum.${LB}.amazonaws.com`,UB=()=>({unique:!1,domain:window.location.hostname,path:"/",sameSite:"Strict",secure:!0}),FB=t=>({allowCookies:!1,batchLimit:100,client:Zme,compressionStrategy:{enabled:!0},cookieAttributes:t,debug:!1,disableAutoPageView:!1,dispatchInterval:5*1e3,enableRumClient:!0,enableXRay:!1,endpoint:SA,endpointUrl:new URL(SA),eventCacheSize:1e3,eventPluginsToLoad:[],pageIdFormat:bA.Path,pagesToExclude:[],pagesToInclude:[/.*/],signing:!1,recordResourceUrl:!0,retries:2,routeChangeComplete:100,routeChangeTimeout:1e4,sessionAttributes:{},sessionEventLimit:200,sessionLengthSeconds:1800,sessionSampleRate:1,suppressSessionStartEvent:!1,useBeacon:!0,userIdRetentionDays:30,enableW3CTraceId:!1,candidatesCacheSize:10});let TCe=class{constructor(e,n,r,s={}){var{cookieAttributes:o}=s,a=ACe(s,["cookieAttributes"]);this.eventBus=new Rz,typeof r>"u"&&(r="us-west-2"),this.applicationId=e;const u=Object.assign(Object.assign({},UB()),o);this.config=Object.assign(Object.assign({fetchFunction:fetch},FB(u)),a),this.config.sessionId&&(this.config.suppressSessionStartEvent=!0),this.config.endpoint=a.endpoint?a.endpoint:SA.replace(LB,r),this.config.endpointUrl=new URL(this.config.endpoint),be.configure(this.config.debug),be.info("Initialized RUM Slim"),this.eventCache=new aye({id:e,version:n},this.config,this.eventBus),this.dispatchManager=this.initDispatch(r,e),this.pluginManager=this.initPluginManager(e,n),this.eventCache.setPluginFlushHook(()=>this.pluginManager.flush()),this.config.enableRumClient?this.enable():this.disable()}setAwsCredentials(e){this.dispatchManager.setAwsCredentials(e)}setSigningConfigFactory(e){this.dispatchManager.setSigningConfigFactory(e)}addSessionAttributes(e){this.eventCache.addSessionAttributes(e)}getSessionId(){return this.eventCache.getSessionId()}pinSessionId(e){this.eventCache.pinSessionId(e)}startSession(e){return this.eventCache.startSession(e)}getUserId(){return this.eventCache.getUserId()}pinUserId(e){this.eventCache.pinUserId(e)}setEventMetadataHook(e){this.eventCache.setEventMetadataHook(e)}clearEventMetadataHook(){this.eventCache.clearEventMetadataHook()}addPlugin(e){this.pluginManager.addPlugin(e)}dispatch(){this.dispatchManager.dispatchFetch()}dispatchBeacon(){this.dispatchManager.dispatchBeacon()}enable(){this.eventCache.enable(),this.pluginManager.enable(),this.dispatchManager.enable()}disable(){this.dispatchManager.disable(),this.pluginManager.disable(),this.eventCache.disable()}allowCookies(e){this.config.allowCookies=e}clearCookies(){const e=this.config.cookieAttributes;[$v,qv,qc,`${$v}_${this.applicationId}`,`${qv}_${this.applicationId}`,`${qc}_${this.applicationId}`].forEach(r=>Jve(r,e))}recordPageView(e){this.eventCache.recordPageView(e)}recordError(e){this.pluginManager.record("com.amazonaws.rum.js-error",e)}registerDomEvents(e){this.pluginManager.updatePlugin("com.amazonaws.rum.dom-event",e)}recordEvent(e,n,r){this.eventCache.recordEvent(e,n,r)}initDispatch(e,n){return new Xme(n,e,this.config.endpointUrl,this.eventCache,this.config)}initPluginManager(e,n){const r={applicationId:e,applicationVersion:n,config:this.config,record:this.eventCache.recordEvent,recordCandidate:this.eventCache.recordCandidate,recordPageView:this.eventCache.recordPageView,getSession:this.eventCache.getSession,eventBus:this.eventBus},s=new Qve(r);return this.config.disableAutoPageView||s.addPlugin(new _ye),this.config.eventPluginsToLoad.forEach(o=>{s.addPlugin(o)}),s}};var Ks;(function(t){t.Errors="errors",t.Performance="performance",t.Interaction="interaction",t.Http="http",t.Replay="replay"})(Ks||(Ks={}));var d5;(function(t){t.Path="PATH",t.Hash="HASH",t.PathAndHash="PATH_AND_HASH"})(d5||(d5={}));const RCe=t=>Object.assign(Object.assign({},FB(t)),{signing:!0,telemetries:[Ks.Errors,Ks.Performance,Ks.Http,Ks.Replay]});class ICe extends TCe{constructor(e,n,r,s={}){super(e,n,r,Object.assign(Object.assign({},RCe(UB())),s)),be.info(`RUM client initialized for app: ${e}`),be.info(`Telemetries enabled: ${this.config.telemetries.join(", ")||"none"}`)}initDispatch(e,n){const r=super.initDispatch(e,n);return r.setSigningConfigFactory(Ave),r.setCognitoCredentialProviderFactory((s,o,a,u)=>{const c={identityPoolId:a,guestRoleArn:u,cookieAttributes:s.cookieAttributes};return a&&u?new Hve(c,o).ChainAnonymousCredentialsProvider:new $ve(c,o).ChainAnonymousCredentialsProvider}),this.config.signing&&this.config.identityPoolId&&r.setCognitoCredentials(this.config.identityPoolId,this.config.guestRoleArn),r}initPluginManager(e,n){const r=super.initPluginManager(e,n);return this.constructBuiltinPlugins().forEach(o=>{r.addPlugin(o)}),r}recordError(e){this.pluginManager.record(Nz,e)}registerDomEvents(e){this.pluginManager.updatePlugin(Iz,e)}constructBuiltinPlugins(){let e=[];const n=this.telemetryFunctor();return this.config.telemetries.forEach(r=>{typeof r=="string"&&n[r.toLowerCase()]?e=[...e,...n[r.toLowerCase()]({})]:Array.isArray(r)&&n[r[0].toLowerCase()]&&(e=[...e,...n[r[0].toLowerCase()](r[1])])}),e}telemetryFunctor(){return{[Ks.Errors]:e=>[new yye(e)],[Ks.Performance]:e=>[new Eye(e),new Tye(e),new Gye(e)],[Ks.Interaction]:e=>[new xR(e)],[Ks.Http]:e=>[new Qye(e),new Yye(e)],[Ks.Replay]:e=>[new _Ce(e)]}}}const zB={recordPageView:()=>{},recordError:()=>{},recordEvent:()=>{},recordTiming:()=>{}},OCe=/([?&](token|access_token|id_token|authorization)=[^&]*)|\/messages\/[a-z0-9_-]+/gi;function jB(t){return t.replace(OCe,"[redacted]")}function NCe(t){const e=t.indexOf("?"),n=t.indexOf("#"),r=e===-1&&n===-1?t.length:e===-1?n:n===-1?e:Math.min(e,n);return jB(t.slice(0,r))}function MCe(t){const e=jB(t.message);if(e===t.message)return t;const n=new Error(e);return n.name=t.name,n.stack=t.stack,n}function PCe(t){return{recordPageView(e){t.recordPageView(NCe(e))},recordError(e,n){t.recordError(MCe(e)),n&&t.recordEvent("telemetry.error_context",n)},recordEvent(e,n){t.recordEvent(e,n??{})},recordTiming(e,n,r){t.recordEvent("telemetry.timing",{...r,name:e,durationMs:String(n)})}}}function f5(t){return t instanceof Error?t:new Error(String(t))}function kCe(t){window.addEventListener("error",e=>{t.recordError(f5(e.error??e.message))}),window.addEventListener("unhandledrejection",e=>{t.recordError(f5(e.reason))})}function DCe(){const{appMonitorId:t,identityPoolId:e,region:n}=My().rum;if(!t)return zB;const r=new ICe(t,"1.0.0",n,{sessionSampleRate:1,identityPoolId:e,endpoint:`https://dataplane.rum.${n}.amazonaws.com`,telemetries:["performance"],disableAutoPageView:!0,allowCookies:!1,enableXRay:!1}),s=PCe(r);return kCe(s),s}const BB=_.createContext(zB);function NRe(){return _.useContext(BB)}const EA="remit.theme",LCe="dark";function h5(){return typeof localStorage>"u"?"system":localStorage.getItem(EA)??"system"}function CA(t){if(typeof document>"u")return;const e=t==="dark"||t==="system"&&typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.classList.toggle(LCe,e)}function MRe(t){typeof localStorage<"u"&&(t==="system"?localStorage.removeItem(EA):localStorage.setItem(EA,t)),CA(t)}const UCe=()=>{if(typeof window>"u"||(CA(h5()),typeof window.matchMedia!="function"))return;const t=window.matchMedia("(prefers-color-scheme: dark)"),e=()=>{CA(h5())};typeof t.addEventListener=="function"?t.addEventListener("change",e):t.addListener(e)},FCe=(t,e,n,r)=>{const s=[n,{code:e,...r||{}}];if(t?.services?.logger?.forward)return t.services.logger.forward(s,"warn","react-i18next::",!0);Fl(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),t?.services?.logger?.warn?t.services.logger.warn(...s):console?.warn&&console.warn(...s)},p5={},wA=(t,e,n,r)=>{Fl(n)&&p5[n]||(Fl(n)&&(p5[n]=new Date),FCe(t,e,n,r))},HB=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},xA=(t,e,n)=>{t.loadNamespaces(e,HB(t,n))},g5=(t,e,n,r)=>{if(Fl(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return xA(t,n,r);n.forEach(s=>{t.options.ns.indexOf(s)<0&&t.options.ns.push(s)}),t.loadLanguages(e,HB(t,r))},zCe=(t,e,n={})=>!e.languages||!e.languages.length?(wA(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,s)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,t))return!1}}),Fl=t=>typeof t=="string",jCe=t=>typeof t=="object"&&t!==null,BCe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,HCe={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},$Ce=t=>HCe[t],qCe=t=>t.replace(BCe,$Ce);let _A={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:qCe};const WCe=(t={})=>{_A={..._A,...t}},VCe=()=>_A;let $B;const GCe=t=>{$B=t},KCe=()=>$B,YCe={type:"3rdParty",init(t){WCe(t.options.react),GCe(t)}},ZCe=_.createContext();class XCe{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const QCe=(t,e)=>{const n=_.useRef();return _.useEffect(()=>{n.current=t},[t,e]),n.current},qB=(t,e,n,r)=>t.getFixedT(e,n,r),JCe=(t,e,n,r)=>_.useCallback(qB(t,e,n,r),[t,e,n,r]),ewe=(t,e={})=>{const{i18n:n}=e,{i18n:r,defaultNS:s}=_.useContext(ZCe)||{},o=n||r||KCe();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new XCe),!o){wA(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const R=(O,I)=>Fl(I)?I:jCe(I)&&Fl(I.defaultValue)?I.defaultValue:Array.isArray(O)?O[O.length-1]:O,N=[R,{},!1];return N.t=R,N.i18n={},N.ready=!1,N}o.options.react?.wait&&wA(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...VCe(),...o.options.react,...e},{useSuspense:u,keyPrefix:c}=a;let f=t||s||o.options?.defaultNS;f=Fl(f)?[f]:f||["translation"],o.reportNamespaces.addUsedNamespaces?.(f);const p=(o.isInitialized||o.initializedStoreOnce)&&f.every(R=>zCe(R,o,a)),g=JCe(o,e.lng||null,a.nsMode==="fallback"?f:f[0],c),m=()=>g,y=()=>qB(o,e.lng||null,a.nsMode==="fallback"?f:f[0],c),[S,E]=_.useState(m);let C=f.join();e.lng&&(C=`${e.lng}${C}`);const w=QCe(C),A=_.useRef(!0);_.useEffect(()=>{const{bindI18n:R,bindI18nStore:N}=a;A.current=!0,!p&&!u&&(e.lng?g5(o,e.lng,f,()=>{A.current&&E(y)}):xA(o,f,()=>{A.current&&E(y)})),p&&w&&w!==C&&A.current&&E(y);const O=()=>{A.current&&E(y)};return R&&o?.on(R,O),N&&o?.store.on(N,O),()=>{A.current=!1,o&&R&&R?.split(" ").forEach(I=>o.off(I,O)),N&&o&&N.split(" ").forEach(I=>o.store.off(I,O))}},[o,C]),_.useEffect(()=>{A.current&&p&&E(m)},[o,c,p]);const T=[S,o,p];if(T.t=S,T.i18n=o,T.ready=p,p||!p&&!u)return T;throw new Promise(R=>{e.lng?g5(o,e.lng,f,()=>R()):xA(o,f,()=>R())})},twe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts",...t,headers:{"Content-Type":"application/json",...t.headers}}),nwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/oauth/microsoft/start",...t,headers:{"Content-Type":"application/json",...t.headers}}),rwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/test-connection",...t,headers:{"Content-Type":"application/json",...t.headers}}),swe=t=>(t.client??We).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}",...t}),owe=t=>(t.client??We).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),iwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters",...t}),awe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters",...t,headers:{"Content-Type":"application/json",...t.headers}}),lwe=t=>(t.client??We).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters/{filterId}",...t}),uwe=t=>(t.client??We).put({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/folder-roles/{role}",...t,headers:{"Content-Type":"application/json",...t.headers}}),cwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/mailboxes",...t}),dwe=t=>(t.client??We).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/mailboxes/{mailboxId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),fwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize",...t,headers:{"Content-Type":"application/json",...t.headers}}),hwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize/preview",...t,headers:{"Content-Type":"application/json",...t.headers}}),pwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize/{organizeJobId}",...t}),gwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/sync",...t}),mwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/sync/status",...t}),vwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/addresses/search",...t}),ywe=t=>(t.client??We).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/addresses/{addressId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),bwe=t=>(t?.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/config",...t}),PRe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/mailboxes/{mailboxId}/threads",...t}),Swe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/mailboxes/{mailboxId}/threads/search",...t}),Ewe=t=>(t.client??We).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/me",...t,headers:{"Content-Type":"application/json",...t.headers}}),Cwe=t=>(t?.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/me/export",...t}),wwe=t=>(t?.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/me/vip-suggestions",...t}),xwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/delete",...t,headers:{"Content-Type":"application/json",...t.headers}}),_we=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/flags",...t,headers:{"Content-Type":"application/json",...t.headers}}),Awe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/move",...t,headers:{"Content-Type":"application/json",...t.headers}}),Twe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}",...t}),Rwe=t=>(t.client??We).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}/flags",...t,headers:{"Content-Type":"application/json",...t.headers}}),Iwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}/raw",...t}),Owe=t=>(t?.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox",...t}),Nwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox",...t,headers:{"Content-Type":"application/json",...t.headers}}),Mwe=t=>(t.client??We).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t}),Pwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t}),kwe=t=>(t.client??We).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),Dwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}/send",...t}),Lwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/search/semantic",...t}),Uwe=t=>(t?.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/system/update",...t}),Fwe=t=>(t.client??We).post({security:[{name:"Authorization",type:"apiKey"}],url:"/system/update",...t,headers:{"Content-Type":"application/json",...t.headers}}),zwe=t=>(t?.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/threads",...t}),jwe=t=>(t.client??We).get({security:[{name:"Authorization",type:"apiKey"}],url:"/threads/{threadId}/messages",...t}),kRe=t=>({mutationFn:async n=>{const{data:r}=await twe({...t,...n,throwOnError:!0});return r}}),ar=(t,e,n,r)=>{const s={_id:t,baseUrl:e?.baseUrl||(e?.client??We).getConfig().baseUrl};return e?.body&&(s.body=e.body),e?.headers&&(s.headers=e.headers),e?.path&&(s.path=e.path),e?.query&&(s.query=e.query),[s]},DRe=t=>({mutationFn:async n=>{const{data:r}=await nwe({...t,...n,throwOnError:!0});return r}}),LRe=t=>({mutationFn:async n=>{const{data:r}=await rwe({...t,...n,throwOnError:!0});return r}}),URe=t=>({mutationFn:async n=>{const{data:r}=await swe({...t,...n,throwOnError:!0});return r}}),FRe=t=>({mutationFn:async n=>{const{data:r}=await owe({...t,...n,throwOnError:!0});return r}}),Bwe=t=>ar("filterOperationsListFilters",t),zRe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await iwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Bwe(t)}),jRe=t=>({mutationFn:async n=>{const{data:r}=await awe({...t,...n,throwOnError:!0});return r}}),BRe=t=>({mutationFn:async n=>{const{data:r}=await lwe({...t,...n,throwOnError:!0});return r}}),HRe=t=>({mutationFn:async n=>{const{data:r}=await uwe({...t,...n,throwOnError:!0});return r}}),Hwe=t=>ar("mailboxOperationsListMailboxes",t),$Re=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await cwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Hwe(t)}),qRe=t=>({mutationFn:async n=>{const{data:r}=await dwe({...t,...n,throwOnError:!0});return r}}),WRe=t=>({mutationFn:async n=>{const{data:r}=await fwe({...t,...n,throwOnError:!0});return r}}),VRe=t=>({mutationFn:async n=>{const{data:r}=await hwe({...t,...n,throwOnError:!0});return r}}),$we=t=>ar("organizeJobDetailOperationsGetOrganizeJob",t),GRe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await pwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:$we(t)}),KRe=t=>({mutationFn:async n=>{const{data:r}=await gwe({...t,...n,throwOnError:!0});return r}}),qwe=t=>ar("syncOperationsGetSyncStatus",t),YRe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await mwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:qwe(t)}),Wwe=t=>ar("addressOperationsSearchAddresses",t),ZRe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await vwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Wwe(t)}),XRe=t=>({mutationFn:async n=>{const{data:r}=await ywe({...t,...n,throwOnError:!0});return r}}),Vwe=t=>ar("configOperationsGetConfig",t),Gwe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await bwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Vwe(t)}),QRe=t=>ar("threadOperationsListThreads",t),Kwe=t=>ar("threadOperationsSearchThreads",t),JRe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Swe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Kwe(t)}),eIe=t=>({mutationFn:async n=>{const{data:r}=await Ewe({...t,...n,throwOnError:!0});return r}}),tIe=t=>({mutationFn:async n=>{const{data:r}=await Cwe({...t,...n,throwOnError:!0});return r}}),Ywe=t=>ar("meOperationsListVipSuggestions",t),nIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await wwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Ywe(t)}),rIe=t=>({mutationFn:async n=>{const{data:r}=await xwe({...t,...n,throwOnError:!0});return r}}),sIe=t=>({mutationFn:async n=>{const{data:r}=await _we({...t,...n,throwOnError:!0});return r}}),oIe=t=>({mutationFn:async n=>{const{data:r}=await Awe({...t,...n,throwOnError:!0});return r}}),Zwe=t=>ar("messageOperationsDescribeMessage",t),iIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Twe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Zwe(t)}),aIe=t=>({mutationFn:async n=>{const{data:r}=await Rwe({...t,...n,throwOnError:!0});return r}}),Xwe=t=>ar("messageOperationsGetRawMessage",t),lIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Iwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Xwe(t)}),WB=t=>ar("outboxOperationsListOutboxMessages",t),uIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Owe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:WB(t)}),cIe=t=>({mutationFn:async n=>{const{data:r}=await Nwe({...t,...n,throwOnError:!0});return r}}),dIe=t=>({mutationFn:async n=>{const{data:r}=await Mwe({...t,...n,throwOnError:!0});return r}}),Qwe=t=>ar("outboxDetailOperationsGetOutboxMessage",t),Jwe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Pwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:Qwe(t)}),fIe=t=>({mutationFn:async n=>{const{data:r}=await kwe({...t,...n,throwOnError:!0});return r}}),hIe=t=>({mutationFn:async n=>{const{data:r}=await Dwe({...t,...n,throwOnError:!0});return r}}),exe=t=>ar("semanticSearchOperationsSemanticSearch",t),pIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Lwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:exe(t)}),VB=t=>ar("systemOperationsGetSystemUpdate",t),txe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await Uwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:VB(t)}),nxe=t=>({mutationFn:async n=>{const{data:r}=await Fwe({...t,...n,throwOnError:!0});return r}}),rxe=t=>ar("unifiedThreadOperationsListAllThreads",t),sxe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await zwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:rxe(t)}),oxe=t=>ar("threadDetailOperationsListThreadMessages",t),gIe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await jwe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:oxe(t)}),GB=_.createContext(void 0),m5={isOpen:!1,mode:"new"},ixe=2e3,axe=6e4,lxe=({children:t})=>{const[e,n]=_.useState(m5),[r,s]=_.useState(),o=_.useRef(0),a=pb(),{data:u}=x7({...Jwe({path:{outboxMessageId:r??""}}),enabled:!!r,refetchInterval:y=>{const S=y.state.data?.status;return S==="sent"||S==="failed"||S==="blocked"||Date.now()-o.current>axe?!1:ixe}});_.useEffect(()=>{if(!u||!r)return;(u.status==="sent"||u.status==="failed"||u.status==="blocked")&&(s(void 0),a.invalidateQueries({queryKey:WB()}))},[u,r,a]);const c=_.useCallback(y=>{n({...y,isOpen:!0})},[]),f=_.useCallback(()=>{n(m5)},[]),p=_.useCallback(y=>{n(S=>({...S,outboxMessageId:y}))},[]),g=_.useCallback(y=>{o.current=Date.now(),s(y)},[]),m=_.useMemo(()=>({state:e,openCompose:c,closeCompose:f,setOutboxMessageId:p,startSendPolling:g}),[e,c,f,p,g]);return P.jsx(GB.Provider,{value:m,children:t})},mIe=()=>{const t=_.useContext(GB);if(!t)throw new Error("useCompose must be used within a ComposeProvider");return t},sI="remit.self-update.run",uxe=600,cxe=300,v5="remit logs",dxe="https://github.com/remit-mail/reader/releases/tag/",fxe={checking:"preparing",pulling:"preparing",snapshotting:"preparing",stopping:"restarting",starting:"restarting",verifying:"reconnecting",committing:"reconnecting",rollingBack:"reconnecting",recovering:"reconnecting"};function AA(t){return fxe[t]??"reconnecting"}function KB(t){const e=su(t);return e===404||e===403||e===401}function YB(t,e){const n=t?.check;if(n?.status==="ok"&&!(!n.updateAvailable||!n.latestVersion))return{version:n.latestVersion,releasedAt:dy(n.publishedAt)??e,releaseNotesUrl:n.releaseNotesUrl??XB(n.latestVersion),summary:n.summary??""}}function hxe(t){const e=t?.check.schemaVersion,n=t?.currentSchemaVersion;return e===void 0||n===void 0?!1:e>n}function pxe(){try{const t=localStorage.getItem(sI);if(!t)return null;const e=JSON.parse(t);return mxe(e)?e:null}catch{return null}}function gxe(t){try{localStorage.setItem(sI,JSON.stringify(t))}catch{}}function y5(){try{localStorage.removeItem(sI)}catch{}}function mxe(t){if(!t||typeof t!="object")return!1;const e=t;return typeof e.runId=="string"&&typeof e.attemptedVersion=="string"&&typeof e.previousVersion=="string"&&typeof e.startedAt=="number"}function b5(){return uxe+cxe}function ZB(t,e){return Math.max(0,Math.floor((e-t)/1e3))}function dy(t){if(!t)return;const e=Date.parse(t);return Number.isNaN(e)?void 0:e}function XB(t){return`${dxe}${t}`}function sh(t,e,n,r,s){return{status:"applying",runId:t,version:e,target:n,phase:r,elapsedSeconds:s}}function vxe(t,e,n){switch(n){case"succeeded":return{status:"succeeded",runId:e.runId,version:e.targetVersion,previousVersion:e.fromVersion,releaseNotesUrl:t.check.releaseNotesUrl??XB(e.targetVersion)};case"rolledBack":return{status:"rolledBack",runId:e.runId,version:e.fromVersion,attemptedVersion:e.targetVersion,reason:e.message,logsCommand:e.logCommand};case"rollbackFailed":return{status:"rollbackFailed",runId:e.runId,attemptedVersion:e.targetVersion,previousVersion:e.fromVersion,reason:e.message,logsCommand:e.logCommand};case"abandoned":return{status:"abandoned",runId:e.runId,version:e.fromVersion,attemptedVersion:e.targetVersion,reason:e.message,logsCommand:e.logCommand};default:return n}}function yxe(t,e,n){const r=t.check;if(e)return{status:"checking",version:t.currentVersion};if(r.status==="failed")return{status:"checkFailed",version:t.currentVersion,reason:r.error??"Remit could not reach the update service.",lastCheckedAt:dy(r.lastCheckedAt)};if(r.status==="disabled")return{status:"checking",version:t.currentVersion};const s=YB(t,n);return s?{status:"available",version:t.currentVersion,release:s}:{status:"upToDate",version:t.currentVersion,checkedAt:dy(r.lastCheckedAt)??n}}function Bm(t,e,n,r){return{surface:{status:"ready",section:t,overlay:e},clearStoredRun:n,releaseHeld:r}}function bxe(t,e,n,r,s){const o=ZB(t.startedAt,s),a=e?.currentVersion??t.previousVersion,u=!r&&n!==null&&n.runId===t.runId;if(u&&n!==null&&n.outcome!==null)return null;if(u&&n!==null){const f=AA(n.phase);return Bm(sh(n.runId,a,n.targetVersion,f,o),{kind:"applying",target:n.targetVersion,phase:f,elapsedSeconds:o},!1,!1)}if(r){const f=sh(t.runId,t.previousVersion,t.attemptedVersion,"reconnecting",o);return o>b5()?{surface:{status:"ready",section:f,overlay:{kind:"neverCameBack",attemptedVersion:t.attemptedVersion,previousVersion:t.previousVersion,elapsedSeconds:o,logsCommand:v5}},clearStoredRun:!0,releaseHeld:!1}:Bm(f,{kind:"applying",target:t.attemptedVersion,phase:"reconnecting",elapsedSeconds:o},!1,!1)}if(e===void 0)return Bm(sh(t.runId,a,t.attemptedVersion,"preparing",o),{kind:"applying",target:t.attemptedVersion,phase:"preparing",elapsedSeconds:o},!1,!1);if(o>b5())return{surface:{status:"ready",section:{status:"unreachable",runId:t.runId,previousVersion:t.previousVersion,attemptedVersion:t.attemptedVersion,elapsedSeconds:o,logsCommand:n?.logCommand??v5},overlay:{kind:"none"}},clearStoredRun:!0,releaseHeld:!0};const c=n!==null&&n.outcome===null?AA(n.phase):"preparing";return Bm(sh(t.runId,a,t.attemptedVersion,c,o),{kind:"applying",target:t.attemptedVersion,phase:c,elapsedSeconds:o},!1,!1)}function S5(t){const{data:e,isError:n,isFetching:r,dismissedRunId:s,checkRequested:o,now:a}=t;if(n)return{surface:{status:"ready",section:{status:"checkFailed",version:e?.currentVersion??"the current version",reason:"Remit could not reach the update service."},overlay:{kind:"none"}},clearStoredRun:!0};if(!e)return{surface:{status:"loading"},clearStoredRun:!1};const u=e.run,c=u!==null&&s!==null&&u.runId===s;if(u!==null&&!c&&u.outcome!==null)return{surface:{status:"ready",section:vxe(e,u,u.outcome),overlay:{kind:"none"}},clearStoredRun:!0};if(u!==null&&!c&&u.outcome===null){const f=ZB(dy(u.startedAt)??a,a),p=AA(u.phase);return{surface:{status:"ready",section:sh(u.runId,u.fromVersion,u.targetVersion,p,f),overlay:{kind:"applying",target:u.targetVersion,phase:p,elapsedSeconds:f}},clearStoredRun:!1}}return{surface:{status:"ready",section:yxe(e,o&&r,a),overlay:{kind:"none"}},clearStoredRun:!1}}function Sxe(t){const{data:e,isError:n,error:r,held:s,now:o}=t,a=e?.run??null;if(KB(r)&&!s)return{surface:{status:"absent"},clearStoredRun:!0,releaseHeld:!0};if(s){const c=bxe(s,e,a,n,o);return c||{surface:S5(t).surface,clearStoredRun:!0,releaseHeld:!0}}const u=S5(t);return{surface:u.surface,clearStoredRun:u.clearStoredRun,releaseHeld:!1}}const Exe=3e4,Cxe=5e3;function wxe(t,e,n){if(KB(t)&&!n)return!1;const r=e!==null&&e.outcome===null;return n||r?Cxe:Exe}function xxe(){const t=pb(),[e,n]=_.useState(()=>pxe()),[r,s]=_.useState(null),[o,a]=_.useState(!1),u=_.useRef(e);u.current=e;const c=x7({...txe(),retry:!1,meta:{softError:!0},refetchInterval:R=>wxe(R.state.error,R.state.data?.run??null,u.current!==null)}),f=Sxe({data:c.data,isError:c.isError,error:c.error,isFetching:c.isFetching,held:e,dismissedRunId:r,checkRequested:o,now:Date.now()}),p=_.useRef(null);p.current=f.surface.status==="ready"&&"runId"in f.surface.section?f.surface.section.runId:null;const{clearStoredRun:g,releaseHeld:m}=f;_.useEffect(()=>{g&&y5()},[g]),_.useEffect(()=>{m&&n(R=>R===null?R:null)},[m]),_.useEffect(()=>{o&&!c.isFetching&&a(!1)},[o,c.isFetching]);const{refetch:y}=c,S=_.useCallback(()=>{a(!0),y()},[y]),E=_.useCallback(()=>{y()},[y]),C=Vhe({...nxe(),meta:{softError:!0},onSuccess:R=>{const N=R.run;if(N!==null){const O={runId:N.runId,attemptedVersion:N.targetVersion,previousVersion:N.fromVersion,startedAt:Date.now()};gxe(O),n(O),s(null)}t.setQueryData(VB(),R)},onError:()=>{y()}}),{mutate:w}=C,A=_.useCallback(R=>{w({body:{targetVersion:R}})},[w]),T=_.useCallback(()=>{p.current!==null&&s(p.current),y5(),n(null)},[]);return{surface:f.surface,appliesSchemaMigration:hxe(c.data),currentVersion:c.data?.currentVersion,release:YB(c.data,Date.now()),onCheck:S,install:A,onDismissResult:T,onRetryConnection:E}}const oI=_.createContext(null);function _xe({children:t}){const e=xxe();return _.createElement(oI.Provider,{value:e},t)}function Axe(){const t=_.useContext(oI);if(t===null)throw new Error("useSelfUpdate must be used within a SelfUpdateProvider");return t}function Txe(){return _.useContext(oI)}function Rxe(){const{surface:t,onRetryConnection:e}=Axe();if(t.status!=="ready")return null;const{overlay:n}=t;return n.kind==="applying"?P.jsx(Lee,{target:n.target,phase:n.phase,elapsedSeconds:n.elapsedSeconds}):n.kind==="neverCameBack"?P.jsx(Uee,{attemptedVersion:n.attemptedVersion,previousVersion:n.previousVersion,elapsedSeconds:n.elapsedSeconds,logsCommand:n.logsCommand,onRetryConnection:e}):null}const Ix=(...t)=>D8(_8(t)),Ixe={error:{container:"border-danger/50 bg-danger-soft",icon:"text-danger",title:"text-danger"},warning:{container:"border-warning/50 bg-warning-soft",icon:"text-warning",title:"text-warning"},info:{container:"border-accent-2/50 bg-accent-2-soft",icon:"text-accent-2",title:"text-accent-2"}},Oxe={error:ZX,warning:aQ,info:eQ},Nxe={error:"Error",warning:"Warning",info:"Information"},Mxe=({id:t,severity:e,title:n,detail:r,onDismiss:s})=>{const o=Ixe[e],a=Oxe[e];return P.jsxs("div",{role:e==="error"?"alert":"status","aria-live":e==="error"?"assertive":"polite",className:Ix("pointer-events-auto flex items-start gap-3 rounded-md border bg-canvas px-3 py-2 shadow-lg",o.container),children:[P.jsx(a,{className:Ix("size-5 shrink-0 mt-0.5",o.icon),"aria-hidden":"true"}),P.jsxs("div",{className:"flex-1 min-w-0",children:[P.jsx("p",{className:Ix("text-sm font-medium",o.title),children:n}),r&&P.jsx("p",{className:"mt-0.5 text-xs text-fg-muted break-words",children:r})]}),P.jsx("button",{type:"button",onClick:()=>s(t),className:"shrink-0 rounded-md p-1 text-fg-muted hover:bg-surface-raised hover:text-fg transition-colors","aria-label":`Dismiss ${Nxe[e].toLowerCase()}`,children:P.jsx(wh,{className:"size-4","aria-hidden":"true"})})]})},Pxe=({errors:t,onDismiss:e})=>t.length===0?null:P.jsx("section",{"aria-label":"Notifications",className:"pointer-events-none fixed inset-x-0 top-0 z-[60] flex flex-col items-center gap-2 px-4 pt-4 sm:items-end sm:pr-6",children:P.jsx("div",{className:"flex w-full max-w-md flex-col gap-2",children:t.map(n=>P.jsx(Mxe,{id:n.id,severity:n.severity,title:n.title,detail:n.detail,onDismiss:e},n.id))})}),E5=5,vIe=(t,e,n)=>({title:t,detail:QB(n)??e,error:n}),QB=t=>{if(t!=null){if(t instanceof Error)return t.message||void 0;if(typeof t=="string")return t||void 0;if(typeof t=="object"&&"message"in t&&typeof t.message=="string")return t.message||void 0}},yIe=t=>{const e=QB(t);return e?e.startsWith("Message not found"):!1},kxe=(t,e,n)=>t.severity===n&&t.title===e.title&&t.detail===e.detail,Dxe=(t,e)=>{const r=[...t.filter(s=>!kxe(s,{title:e.title,detail:e.detail,severity:e.severity},e.severity)),e];return r.length<=E5?r:r.slice(r.length-E5)},Lxe=(t,e)=>t.filter(n=>n.id!==e),Uxe=(t,e,n)=>({id:e,severity:t.severity??"error",title:t.title,detail:t.detail,createdAt:n}),JB=_.createContext(void 0),Fxe=()=>typeof globalThis.crypto<"u"&&typeof globalThis.crypto.randomUUID=="function"?globalThis.crypto.randomUUID():`banner-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,zxe=({children:t})=>{const[e,n]=_.useState([]),r=_.useCallback(u=>{if(u.error!=null&&E9(u.error))return Bl(u.error).correlationId;const c=Uxe(u,Fxe(),Date.now());return n(f=>Dxe(f,c)),c.id},[]),s=_.useCallback(u=>{n(c=>Lxe(c,u))},[]),o=_.useCallback(()=>{n([])},[]),a=_.useMemo(()=>({errors:e,pushError:r,dismissError:s,clearAll:o}),[e,r,s,o]);return P.jsxs(JB.Provider,{value:a,children:[t,P.jsx(Pxe,{errors:e,onDismiss:s})]})},bIe=()=>{const t=_.useContext(JB);if(!t)throw new Error("useErrorBanners must be used within an ErrorBannerProvider");return t},jxe=({error:t,reset:e,info:n})=>{const r=zy(t),s=Bl(t,{recoverable:r,componentStack:n?.componentStack});return P.jsx(I9,{fatal:s,onRetry:r?e:void 0})},bp=Sge()({component:Hxe,errorComponent:jxe}),Bxe=()=>{const{t}=ewe("common",{useSuspense:!1});return P.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:z-50 focus:p-4 focus:bg-canvas focus:text-fg focus:rounded-md",children:t("accessibility.skipToContent","Skip to main content")})};function Hxe(){return P.jsxs(zxe,{children:[P.jsxs(_xe,{children:[P.jsxs(lxe,{children:[P.jsx(Bxe,{}),P.jsx("main",{id:"main-content",className:"h-dvh overflow-hidden",children:P.jsx(_.Suspense,{fallback:P.jsx(aT,{}),children:P.jsx(tz,{})})})]}),P.jsx(Rxe,{})]}),P.jsx(R9,{})]})}const $xe=hr("/")({beforeLoad:()=>{throw D7({to:"/mail"})}});var Tt;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),a={};for(const u of o)a[u]=s[u];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},t.find=(s,o)=>{for(const a of s)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(Tt||(Tt={}));var C5;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(C5||(C5={}));const Oe=Tt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Sa=t=>{switch(typeof t){case"undefined":return Oe.undefined;case"string":return Oe.string;case"number":return Number.isNaN(t)?Oe.nan:Oe.number;case"boolean":return Oe.boolean;case"function":return Oe.function;case"bigint":return Oe.bigint;case"symbol":return Oe.symbol;case"object":return Array.isArray(t)?Oe.array:t===null?Oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Oe.promise:typeof Map<"u"&&t instanceof Map?Oe.map:typeof Set<"u"&&t instanceof Set?Oe.set:typeof Date<"u"&&t instanceof Date?Oe.date:Oe.object;default:return Oe.unknown}},ge=Tt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class xi extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,c=0;for(;c<a.path.length;){const f=a.path[c];c===a.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(a))):u[f]=u[f]||{_errors:[]},u=u[f],c++}}};return s(this),r}static assert(e){if(!(e instanceof xi))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Tt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];n[o]=n[o]||[],n[o].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}xi.create=t=>new xi(t);const TA=(t,e)=>{let n;switch(t.code){case ge.invalid_type:t.received===Oe.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ge.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Tt.jsonStringifyReplacer)}`;break;case ge.unrecognized_keys:n=`Unrecognized key(s) in object: ${Tt.joinValues(t.keys,", ")}`;break;case ge.invalid_union:n="Invalid input";break;case ge.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Tt.joinValues(t.options)}`;break;case ge.invalid_enum_value:n=`Invalid enum value. Expected ${Tt.joinValues(t.options)}, received '${t.received}'`;break;case ge.invalid_arguments:n="Invalid function arguments";break;case ge.invalid_return_type:n="Invalid function return type";break;case ge.invalid_date:n="Invalid date";break;case ge.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Tt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ge.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ge.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ge.custom:n="Invalid input";break;case ge.invalid_intersection_types:n="Intersection results could not be merged";break;case ge.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ge.not_finite:n="Number must be finite";break;default:n=e.defaultError,Tt.assertNever(t)}return{message:n}};let qxe=TA;function Wxe(){return qxe}const Vxe=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,o=[...n,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let u="";const c=r.filter(f=>!!f).slice().reverse();for(const f of c)u=f(a,{data:e,defaultError:u}).message;return{...s,path:o,message:u}};function _e(t,e){const n=Wxe(),r=Vxe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===TA?void 0:TA].filter(s=>!!s)});t.common.issues.push(r)}class us{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return Ye;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const o=await s.key,a=await s.value;r.push({key:o,value:a})}return us.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return Ye;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(r[o.value]=a.value)}return{status:e.value,value:r}}}const Ye=Object.freeze({status:"aborted"}),oh=t=>({status:"dirty",value:t}),Ms=t=>({status:"valid",value:t}),w5=t=>t.status==="aborted",x5=t=>t.status==="dirty",Qc=t=>t.status==="valid",fy=t=>typeof Promise<"u"&&t instanceof Promise;var Me;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Me||(Me={}));class Ba{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const _5=(t,e)=>{if(Qc(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new xi(t.common.issues);return this._error=n,this._error}}};function st(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,u)=>{const{message:c}=t;return a.code==="invalid_enum_value"?{message:c??u.defaultError}:typeof u.data>"u"?{message:c??r??u.defaultError}:a.code!=="invalid_type"?{message:u.defaultError}:{message:c??n??u.defaultError}},description:s}}class wt{get description(){return this._def.description}_getType(e){return Sa(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Sa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new us,ctx:{common:e.parent.common,data:e.data,parsedType:Sa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(fy(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sa(e)},s=this._parseSync({data:e,path:r.path,parent:r});return _5(r,s)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sa(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:n});return Qc(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>Qc(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sa(e)},s=this._parse({data:e,path:r.path,parent:r}),o=await(fy(s)?s:Promise.resolve(s));return _5(r,o)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{const a=e(s),u=()=>o.addIssue({code:ge.custom,...r(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(u(),!1)):a?!0:(u(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new td({schema:this,typeName:Ze.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ma.create(this,this._def)}nullable(){return nd.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return xo.create(this)}promise(){return my.create(this,this._def)}or(e){return py.create([this,e],this._def)}and(e){return gy.create(this,e,this._def)}transform(e){return new td({...st(this._def),schema:this,typeName:Ze.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new IA({...st(this._def),innerType:this,defaultValue:n,typeName:Ze.ZodDefault})}brand(){return new g_e({typeName:Ze.ZodBranded,type:this,...st(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new OA({...st(this._def),innerType:this,catchValue:n,typeName:Ze.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return iI.create(this,e)}readonly(){return NA.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Gxe=/^c[^\s-]{8,}$/i,Kxe=/^[0-9a-z]+$/,Yxe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Zxe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Xxe=/^[a-z0-9_-]{21}$/i,Qxe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Jxe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,e_e=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,t_e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ox;const n_e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,r_e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,s_e=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,o_e=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,i_e=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,a_e=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,eH="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",l_e=new RegExp(`^${eH}$`);function tH(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function u_e(t){return new RegExp(`^${tH(t)}$`)}function c_e(t){let e=`${eH}T${tH(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function d_e(t,e){return!!((e==="v4"||!e)&&n_e.test(t)||(e==="v6"||!e)&&s_e.test(t))}function f_e(t,e){if(!Qxe.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function h_e(t,e){return!!((e==="v4"||!e)&&r_e.test(t)||(e==="v6"||!e)&&o_e.test(t))}class hi extends wt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Oe.string){const o=this._getOrReturnCtx(e);return _e(o,{code:ge.invalid_type,expected:Oe.string,received:o.parsedType}),Ye}const r=new us;let s;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=e.data.length>o.value,u=e.data.length<o.value;(a||u)&&(s=this._getOrReturnCtx(e,s),a?_e(s,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&_e(s,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")e_e.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"email",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Ox||(Ox=new RegExp(t_e,"u")),Ox.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"emoji",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Zxe.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"uuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")Xxe.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"nanoid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")Gxe.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"cuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Kxe.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"cuid2",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Yxe.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"ulid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),_e(s,{validation:"url",code:ge.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"regex",code:ge.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?c_e(o).test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?l_e.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?u_e(o).test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?Jxe.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"duration",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?d_e(e.data,o.version)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"ip",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?f_e(e.data,o.alg)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"jwt",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?h_e(e.data,o.version)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"cidr",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?i_e.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"base64",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?a_e.test(e.data)||(s=this._getOrReturnCtx(e,s),_e(s,{validation:"base64url",code:ge.invalid_string,message:o.message}),r.dirty()):Tt.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:ge.invalid_string,...Me.errToObj(r)})}_addCheck(e){return new hi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Me.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Me.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Me.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Me.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Me.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Me.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Me.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Me.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Me.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Me.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Me.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Me.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Me.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Me.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Me.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Me.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Me.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...Me.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Me.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Me.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Me.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Me.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Me.errToObj(n)})}nonempty(e){return this.min(1,Me.errToObj(e))}trim(){return new hi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new hi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new hi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}hi.create=t=>new hi({checks:[],typeName:Ze.ZodString,coerce:t?.coerce??!1,...st(t)});function p_e(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,o=Number.parseInt(t.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return o%a/10**s}class Zl extends wt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Oe.number){const o=this._getOrReturnCtx(e);return _e(o,{code:ge.invalid_type,expected:Oe.number,received:o.parsedType}),Ye}let r;const s=new us;for(const o of this._def.checks)o.kind==="int"?Tt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),_e(r,{code:ge.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),_e(r,{code:ge.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),_e(r,{code:ge.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?p_e(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),_e(r,{code:ge.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),_e(r,{code:ge.not_finite,message:o.message}),s.dirty()):Tt.assertNever(o);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Me.toString(n))}setLimit(e,n,r,s){return new Zl({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Me.toString(s)}]})}_addCheck(e){return new Zl({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Me.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Me.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Me.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Me.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Me.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Tt.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Zl.create=t=>new Zl({checks:[],typeName:Ze.ZodNumber,coerce:t?.coerce||!1,...st(t)});class Xl extends wt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Oe.bigint)return this._getInvalidInput(e);let r;const s=new us;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),_e(r,{code:ge.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),_e(r,{code:ge.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),_e(r,{code:ge.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):Tt.assertNever(o);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return _e(n,{code:ge.invalid_type,expected:Oe.bigint,received:n.parsedType}),Ye}gte(e,n){return this.setLimit("min",e,!0,Me.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Me.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Me.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Me.toString(n))}setLimit(e,n,r,s){return new Xl({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Me.toString(s)}]})}_addCheck(e){return new Xl({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Me.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Me.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Xl.create=t=>new Xl({checks:[],typeName:Ze.ZodBigInt,coerce:t?.coerce??!1,...st(t)});class hy extends wt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Oe.boolean){const r=this._getOrReturnCtx(e);return _e(r,{code:ge.invalid_type,expected:Oe.boolean,received:r.parsedType}),Ye}return Ms(e.data)}}hy.create=t=>new hy({typeName:Ze.ZodBoolean,coerce:t?.coerce||!1,...st(t)});class Jc extends wt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Oe.date){const o=this._getOrReturnCtx(e);return _e(o,{code:ge.invalid_type,expected:Oe.date,received:o.parsedType}),Ye}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return _e(o,{code:ge.invalid_date}),Ye}const r=new us;let s;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(s=this._getOrReturnCtx(e,s),_e(s,{code:ge.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Tt.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Jc({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Me.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Me.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Jc.create=t=>new Jc({checks:[],coerce:t?.coerce||!1,typeName:Ze.ZodDate,...st(t)});class A5 extends wt{_parse(e){if(this._getType(e)!==Oe.symbol){const r=this._getOrReturnCtx(e);return _e(r,{code:ge.invalid_type,expected:Oe.symbol,received:r.parsedType}),Ye}return Ms(e.data)}}A5.create=t=>new A5({typeName:Ze.ZodSymbol,...st(t)});class T5 extends wt{_parse(e){if(this._getType(e)!==Oe.undefined){const r=this._getOrReturnCtx(e);return _e(r,{code:ge.invalid_type,expected:Oe.undefined,received:r.parsedType}),Ye}return Ms(e.data)}}T5.create=t=>new T5({typeName:Ze.ZodUndefined,...st(t)});class R5 extends wt{_parse(e){if(this._getType(e)!==Oe.null){const r=this._getOrReturnCtx(e);return _e(r,{code:ge.invalid_type,expected:Oe.null,received:r.parsedType}),Ye}return Ms(e.data)}}R5.create=t=>new R5({typeName:Ze.ZodNull,...st(t)});class I5 extends wt{constructor(){super(...arguments),this._any=!0}_parse(e){return Ms(e.data)}}I5.create=t=>new I5({typeName:Ze.ZodAny,...st(t)});class O5 extends wt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ms(e.data)}}O5.create=t=>new O5({typeName:Ze.ZodUnknown,...st(t)});class Ha extends wt{_parse(e){const n=this._getOrReturnCtx(e);return _e(n,{code:ge.invalid_type,expected:Oe.never,received:n.parsedType}),Ye}}Ha.create=t=>new Ha({typeName:Ze.ZodNever,...st(t)});class N5 extends wt{_parse(e){if(this._getType(e)!==Oe.undefined){const r=this._getOrReturnCtx(e);return _e(r,{code:ge.invalid_type,expected:Oe.void,received:r.parsedType}),Ye}return Ms(e.data)}}N5.create=t=>new N5({typeName:Ze.ZodVoid,...st(t)});class xo extends wt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==Oe.array)return _e(n,{code:ge.invalid_type,expected:Oe.array,received:n.parsedType}),Ye;if(s.exactLength!==null){const a=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(a||u)&&(_e(n,{code:a?ge.too_big:ge.too_small,minimum:u?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(_e(n,{code:ge.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(_e(n,{code:ge.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,u)=>s.type._parseAsync(new Ba(n,a,n.path,u)))).then(a=>us.mergeArray(r,a));const o=[...n.data].map((a,u)=>s.type._parseSync(new Ba(n,a,n.path,u)));return us.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new xo({...this._def,minLength:{value:e,message:Me.toString(n)}})}max(e,n){return new xo({...this._def,maxLength:{value:e,message:Me.toString(n)}})}length(e,n){return new xo({...this._def,exactLength:{value:e,message:Me.toString(n)}})}nonempty(e){return this.min(1,e)}}xo.create=(t,e)=>new xo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ze.ZodArray,...st(e)});function Ec(t){if(t instanceof _n){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Ma.create(Ec(r))}return new _n({...t._def,shape:()=>e})}else return t instanceof xo?new xo({...t._def,type:Ec(t.element)}):t instanceof Ma?Ma.create(Ec(t.unwrap())):t instanceof nd?nd.create(Ec(t.unwrap())):t instanceof Ql?Ql.create(t.items.map(e=>Ec(e))):t}class _n extends wt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Tt.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Oe.object){const f=this._getOrReturnCtx(e);return _e(f,{code:ge.invalid_type,expected:Oe.object,received:f.parsedType}),Ye}const{status:r,ctx:s}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ha&&this._def.unknownKeys==="strip"))for(const f in s.data)a.includes(f)||u.push(f);const c=[];for(const f of a){const p=o[f],g=s.data[f];c.push({key:{status:"valid",value:f},value:p._parse(new Ba(s,g,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Ha){const f=this._def.unknownKeys;if(f==="passthrough")for(const p of u)c.push({key:{status:"valid",value:p},value:{status:"valid",value:s.data[p]}});else if(f==="strict")u.length>0&&(_e(s,{code:ge.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const p of u){const g=s.data[p];c.push({key:{status:"valid",value:p},value:f._parse(new Ba(s,g,s.path,p)),alwaysSet:p in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const p of c){const g=await p.key,m=await p.value;f.push({key:g,value:m,alwaysSet:p.alwaysSet})}return f}).then(f=>us.mergeObjectSync(r,f)):us.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return Me.errToObj,new _n({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{const s=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:Me.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new _n({...this._def,unknownKeys:"strip"})}passthrough(){return new _n({...this._def,unknownKeys:"passthrough"})}extend(e){return new _n({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new _n({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ze.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new _n({...this._def,catchall:e})}pick(e){const n={};for(const r of Tt.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new _n({...this._def,shape:()=>n})}omit(e){const n={};for(const r of Tt.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new _n({...this._def,shape:()=>n})}deepPartial(){return Ec(this)}partial(e){const n={};for(const r of Tt.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new _n({...this._def,shape:()=>n})}required(e){const n={};for(const r of Tt.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Ma;)o=o._def.innerType;n[r]=o}return new _n({...this._def,shape:()=>n})}keyof(){return nH(Tt.objectKeys(this.shape))}}_n.create=(t,e)=>new _n({shape:()=>t,unknownKeys:"strip",catchall:Ha.create(),typeName:Ze.ZodObject,...st(e)});_n.strictCreate=(t,e)=>new _n({shape:()=>t,unknownKeys:"strict",catchall:Ha.create(),typeName:Ze.ZodObject,...st(e)});_n.lazycreate=(t,e)=>new _n({shape:t,unknownKeys:"strip",catchall:Ha.create(),typeName:Ze.ZodObject,...st(e)});class py extends wt{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(o){for(const u of o)if(u.result.status==="valid")return u.result;for(const u of o)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const a=o.map(u=>new xi(u.ctx.common.issues));return _e(n,{code:ge.invalid_union,unionErrors:a}),Ye}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(s);{let o;const a=[];for(const c of r){const f={...n,common:{...n.common,issues:[]},parent:null},p=c._parseSync({data:n.data,path:n.path,parent:f});if(p.status==="valid")return p;p.status==="dirty"&&!o&&(o={result:p,ctx:f}),f.common.issues.length&&a.push(f.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const u=a.map(c=>new xi(c));return _e(n,{code:ge.invalid_union,unionErrors:u}),Ye}}get options(){return this._def.options}}py.create=(t,e)=>new py({options:t,typeName:Ze.ZodUnion,...st(e)});function RA(t,e){const n=Sa(t),r=Sa(e);if(t===e)return{valid:!0,data:t};if(n===Oe.object&&r===Oe.object){const s=Tt.objectKeys(e),o=Tt.objectKeys(t).filter(u=>s.indexOf(u)!==-1),a={...t,...e};for(const u of o){const c=RA(t[u],e[u]);if(!c.valid)return{valid:!1};a[u]=c.data}return{valid:!0,data:a}}else if(n===Oe.array&&r===Oe.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let o=0;o<t.length;o++){const a=t[o],u=e[o],c=RA(a,u);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return n===Oe.date&&r===Oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class gy extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(o,a)=>{if(w5(o)||w5(a))return Ye;const u=RA(o.value,a.value);return u.valid?((x5(o)||x5(a))&&n.dirty(),{status:n.value,value:u.data}):(_e(r,{code:ge.invalid_intersection_types}),Ye)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>s(o,a)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}gy.create=(t,e,n)=>new gy({left:t,right:e,typeName:Ze.ZodIntersection,...st(n)});class Ql extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Oe.array)return _e(r,{code:ge.invalid_type,expected:Oe.array,received:r.parsedType}),Ye;if(r.data.length<this._def.items.length)return _e(r,{code:ge.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ye;!this._def.rest&&r.data.length>this._def.items.length&&(_e(r,{code:ge.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,u)=>{const c=this._def.items[u]||this._def.rest;return c?c._parse(new Ba(r,a,r.path,u)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>us.mergeArray(n,a)):us.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new Ql({...this._def,rest:e})}}Ql.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ql({items:t,typeName:Ze.ZodTuple,rest:null,...st(e)})};class M5 extends wt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Oe.map)return _e(r,{code:ge.invalid_type,expected:Oe.map,received:r.parsedType}),Ye;const s=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([u,c],f)=>({key:s._parse(new Ba(r,u,r.path,[f,"key"])),value:o._parse(new Ba(r,c,r.path,[f,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const c of a){const f=await c.key,p=await c.value;if(f.status==="aborted"||p.status==="aborted")return Ye;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),u.set(f.value,p.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const c of a){const f=c.key,p=c.value;if(f.status==="aborted"||p.status==="aborted")return Ye;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),u.set(f.value,p.value)}return{status:n.value,value:u}}}}M5.create=(t,e,n)=>new M5({valueType:e,keyType:t,typeName:Ze.ZodMap,...st(n)});class Zh extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Oe.set)return _e(r,{code:ge.invalid_type,expected:Oe.set,received:r.parsedType}),Ye;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(_e(r,{code:ge.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(_e(r,{code:ge.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const o=this._def.valueType;function a(c){const f=new Set;for(const p of c){if(p.status==="aborted")return Ye;p.status==="dirty"&&n.dirty(),f.add(p.value)}return{status:n.value,value:f}}const u=[...r.data.values()].map((c,f)=>o._parse(new Ba(r,c,r.path,f)));return r.common.async?Promise.all(u).then(c=>a(c)):a(u)}min(e,n){return new Zh({...this._def,minSize:{value:e,message:Me.toString(n)}})}max(e,n){return new Zh({...this._def,maxSize:{value:e,message:Me.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Zh.create=(t,e)=>new Zh({valueType:t,minSize:null,maxSize:null,typeName:Ze.ZodSet,...st(e)});class P5 extends wt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}P5.create=(t,e)=>new P5({getter:t,typeName:Ze.ZodLazy,...st(e)});class k5 extends wt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return _e(n,{received:n.data,code:ge.invalid_literal,expected:this._def.value}),Ye}return{status:"valid",value:e.data}}get value(){return this._def.value}}k5.create=(t,e)=>new k5({value:t,typeName:Ze.ZodLiteral,...st(e)});function nH(t,e){return new ed({values:t,typeName:Ze.ZodEnum,...st(e)})}class ed extends wt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return _e(n,{expected:Tt.joinValues(r),received:n.parsedType,code:ge.invalid_type}),Ye}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return _e(n,{received:n.data,code:ge.invalid_enum_value,options:r}),Ye}return Ms(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return ed.create(e,{...this._def,...n})}exclude(e,n=this._def){return ed.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}ed.create=nH;class D5 extends wt{_parse(e){const n=Tt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Oe.string&&r.parsedType!==Oe.number){const s=Tt.objectValues(n);return _e(r,{expected:Tt.joinValues(s),received:r.parsedType,code:ge.invalid_type}),Ye}if(this._cache||(this._cache=new Set(Tt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=Tt.objectValues(n);return _e(r,{received:r.data,code:ge.invalid_enum_value,options:s}),Ye}return Ms(e.data)}get enum(){return this._def.values}}D5.create=(t,e)=>new D5({values:t,typeName:Ze.ZodNativeEnum,...st(e)});class my extends wt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Oe.promise&&n.common.async===!1)return _e(n,{code:ge.invalid_type,expected:Oe.promise,received:n.parsedType}),Ye;const r=n.parsedType===Oe.promise?n.data:Promise.resolve(n.data);return Ms(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}my.create=(t,e)=>new my({type:t,typeName:Ze.ZodPromise,...st(e)});class td extends wt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ze.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,o={addIssue:a=>{_e(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const a=s.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async u=>{if(n.value==="aborted")return Ye;const c=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return c.status==="aborted"?Ye:c.status==="dirty"||n.value==="dirty"?oh(c.value):c});{if(n.value==="aborted")return Ye;const u=this._def.schema._parseSync({data:a,path:r.path,parent:r});return u.status==="aborted"?Ye:u.status==="dirty"||n.value==="dirty"?oh(u.value):u}}if(s.type==="refinement"){const a=u=>{const c=s.refinement(u,o);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?Ye:(u.status==="dirty"&&n.dirty(),a(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?Ye:(u.status==="dirty"&&n.dirty(),a(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Qc(a))return Ye;const u=s.transform(a.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Qc(a)?Promise.resolve(s.transform(a.value,o)).then(u=>({status:n.value,value:u})):Ye);Tt.assertNever(s)}}td.create=(t,e,n)=>new td({schema:t,typeName:Ze.ZodEffects,effect:e,...st(n)});td.createWithPreprocess=(t,e,n)=>new td({schema:e,effect:{type:"preprocess",transform:t},typeName:Ze.ZodEffects,...st(n)});class Ma extends wt{_parse(e){return this._getType(e)===Oe.undefined?Ms(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ma.create=(t,e)=>new Ma({innerType:t,typeName:Ze.ZodOptional,...st(e)});class nd extends wt{_parse(e){return this._getType(e)===Oe.null?Ms(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}nd.create=(t,e)=>new nd({innerType:t,typeName:Ze.ZodNullable,...st(e)});class IA extends wt{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}IA.create=(t,e)=>new IA({innerType:t,typeName:Ze.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...st(e)});class OA extends wt{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return fy(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new xi(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new xi(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}OA.create=(t,e)=>new OA({innerType:t,typeName:Ze.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...st(e)});class L5 extends wt{_parse(e){if(this._getType(e)!==Oe.nan){const r=this._getOrReturnCtx(e);return _e(r,{code:ge.invalid_type,expected:Oe.nan,received:r.parsedType}),Ye}return{status:"valid",value:e.data}}}L5.create=t=>new L5({typeName:Ze.ZodNaN,...st(t)});class g_e extends wt{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class iI extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ye:o.status==="dirty"?(n.dirty(),oh(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ye:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new iI({in:e,out:n,typeName:Ze.ZodPipeline})}}class NA extends wt{_parse(e){const n=this._def.innerType._parse(e),r=s=>(Qc(s)&&(s.value=Object.freeze(s.value)),s);return fy(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}NA.create=(t,e)=>new NA({innerType:t,typeName:Ze.ZodReadonly,...st(e)});var Ze;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Ze||(Ze={}));const xr=hi.create;Zl.create;Xl.create;const m_e=hy.create;Jc.create;Ha.create;xo.create;const yd=_n.create;py.create;gy.create;Ql.create;ed.create;my.create;Ma.create;nd.create;const SIe={string:(t=>hi.create({...t,coerce:!0})),number:(t=>Zl.create({...t,coerce:!0})),boolean:(t=>hy.create({...t,coerce:!0})),bigint:(t=>Xl.create({...t,coerce:!0})),date:(t=>Jc.create({...t,coerce:!0}))},v_e=My().apiUrl;We.setConfig({baseUrl:v_e,fetch:E8});We.interceptors.error.use((t,e)=>{if(t instanceof t_||!e)return t;const n=t,r=n&&typeof n=="object"&&"message"in n?String(n.message):`Request failed with status ${e.status}`;return new t_(r,e.status,n)});const Nx={Inbox:"inbox",Drafts:"drafts",Sent:"sent",Archive:"archive",Junk:"junk",Trash:"trash",All:"all",Flagged:"flagged"},EIe={inbox:"Inbox",drafts:"Drafts",sent:"Sent",archive:"Archive",junk:"Junk",trash:"Trash",all:"All",flagged:"Flagged"},U5=["inbox","flagged","drafts","sent","archive","all","junk","trash"];function y_e(t){const e=new Map,n=[...t].sort((r,s)=>U5.indexOf(Nx[r.role])-U5.indexOf(Nx[s.role]));for(const r of n){if(!r.mailboxId||e.has(r.mailboxId))continue;const s=Nx[r.role];s&&e.set(r.mailboxId,s)}return e}const b_e=t=>{const e=t.split("/");return e[e.length-1]||t};function CIe(t,e,n){const r=t.displayNameOverride?.trim();if(r)return r;const s=b_e(t.fullPath);return!e||!n?s:n(`sidebar.${e}`,s)}const S_e=new Set(["sent","drafts","trash"]),wIe=t=>t===void 0||!S_e.has(t),E_e=new Map;function xIe(t){const e=new Map;for(const n of t){const r=y_e(n.folderAppointments);for(const[s,o]of r)e.set(s,{role:o});for(const s of n.mailboxes){const o=r.get(s.mailboxId);e.set(s.mailboxId,{...o?{role:o}:{},providerPath:s.fullPath})}}return e}function _Ie(t,e){const n=e[0];if(!t)return n?{mailboxId:n}:{};for(const s of e){const o=t.get(s);if(o&&wee(o)!==void 0)return{mailboxId:s,folder:o}}if(!n)return{};const r=t.get(n);return{mailboxId:n,...r?{folder:r}:{}}}const C_e=_.createContext(null),AIe=()=>_.useContext(C_e)??{accounts:[],mailboxNameIndex:new Map,accountNameIndex:new Map,resultFolderIndex:E_e,searchQuery:"",searchInput:"",searchViewKey:"",onSearchChange:()=>{},onSearchClear:()=>{},onSearchClearQuery:()=>{},intelligenceOpen:!1,onToggleIntelligence:()=>{},onSetIntelligenceOpen:()=>{}},w_e=()=>Vn(()=>import("./mail-UHzkrnk0.js").then(t=>t.m),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),x_e=yd({q:xr().optional()}),__e=hr("/mail")({loader:({context:{queryClient:t}})=>{t.prefetchQuery(Gwe()),t.prefetchQuery({...sxe(),staleTime:6e4})},component:or(w_e,"component"),validateSearch:x_e}),A_e=()=>Vn(()=>import("./onboarding-DD3xjYdh.js"),__vite__mapDeps([12,13,3,9,4])),T_e=hr("/onboarding")({component:or(A_e,"component")});function R_e(){const t=Txe(),e=t?.surface.status==="ready"&&t.surface.section.status==="available";return P.jsx(kee,{show:e,children:P.jsx(uQ,{className:"size-4"})})}const I_e=()=>Vn(()=>import("./settings-ovBR_9gX.js"),[]),TIe=[{id:"accounts",label:"Accounts",icon:P.jsx(I8,{className:"size-4"})},{id:"senders",label:"Senders & Rules",icon:P.jsx(lQ,{className:"size-4"})},{id:"folders",label:"Folder roles",icon:P.jsx(JX,{className:"size-4"})},{id:"filters",label:"Filters",icon:P.jsx(QX,{className:"size-4"})},{id:"appearance",label:"Appearance",icon:P.jsx(rQ,{className:"size-4"})},{id:"advanced",label:"Advanced",icon:P.jsx(R_e,{})}],RIe={accounts:"/settings/accounts",senders:"/settings/senders",folders:"/settings/folders",filters:"/settings/filters",appearance:"/settings/appearance",advanced:"/settings/advanced"},O_e=hr("/settings")({component:or(I_e,"component")}),N_e=()=>Vn(()=>import("./index-BfZ-RfPW.js"),__vite__mapDeps([14,6])),M_e=()=>Vn(()=>import("./index-DtqBFgK5.js"),[]),P_e=yd({selectedMessageId:xr().optional(),selectedThreadId:xr().optional(),selectedMailboxId:xr().optional(),q:xr().optional()}),k_e=hr("/mail/")({component:or(M_e,"component"),validateSearch:P_e,errorComponent:or(N_e,"errorComponent")}),D_e=()=>Vn(()=>import("./_mailboxId-DtqBFgK5.js"),[]),L_e=yd({selectedMessageId:xr().optional(),selectedThreadId:xr().optional(),q:xr().optional()}),U_e=hr("/mail/$mailboxId")({component:or(D_e,"component"),validateSearch:L_e}),F_e=()=>Vn(()=>import("./flagged-oUNx6RRA.js"),__vite__mapDeps([15,6])),z_e=()=>Vn(()=>import("./flagged-DtqBFgK5.js"),[]),j_e=yd({selectedMessageId:xr().optional(),q:xr().optional()}),B_e=hr("/mail/flagged")({component:or(z_e,"component"),validateSearch:j_e,errorComponent:or(F_e,"errorComponent")}),H_e=()=>Vn(()=>import("./outbox-DtqBFgK5.js"),[]),$_e=yd({selectedOutboxMessageId:xr().optional(),q:xr().optional()}),q_e=hr("/mail/outbox")({component:or(H_e,"component"),validateSearch:$_e}),W_e=()=>Vn(()=>import("./index-Bnxs3LrV.js"),[]),V_e=hr("/settings/")({component:or(W_e,"component")}),G_e=()=>Vn(()=>import("./accounts-DqILuy2V.js"),__vite__mapDeps([16,5,17,2,13,3,9,4,18,6,7])),K_e=yd({editAccountId:xr().optional(),focusSmtp:m_e().optional(),connected:xr().optional(),oauthError:xr().optional()}),Y_e=hr("/settings/accounts")({component:or(G_e,"component"),validateSearch:K_e}),Z_e=()=>Vn(()=>import("./advanced-e4evDSNK.js"),__vite__mapDeps([19,17,2,18,10])),X_e=hr("/settings/advanced")({component:or(Z_e,"component")}),Q_e=()=>Vn(()=>import("./appearance-BwiZN-Rf.js"),__vite__mapDeps([20,17,2])),J_e=hr("/settings/appearance")({component:or(Q_e,"component")}),eAe=()=>Vn(()=>import("./filters-Bf2CSGtM.js"),__vite__mapDeps([21,17,2,8,6])),tAe=hr("/settings/filters")({component:or(eAe,"component")}),nAe=()=>Vn(()=>import("./folders-DIOTNG5-.js"),__vite__mapDeps([22,9,11,17,2,6])),rAe=hr("/settings/folders")({component:or(nAe,"component")}),sAe=()=>Vn(()=>import("./senders-DnmzQeCG.js"),__vite__mapDeps([23,3,17,2,6,1,7])),oAe=hr("/settings/senders")({component:or(sAe,"component")}),iAe=()=>Vn(()=>import("./suggested-vips-CP6Nt7du.js"),[]),aAe=hr("/settings/suggested-vips")({component:or(iAe,"component")}),lAe=$xe.update({id:"/",path:"/",getParentRoute:()=>bp}),Sp=__e.update({id:"/mail",path:"/mail",getParentRoute:()=>bp}),uAe=T_e.update({id:"/onboarding",path:"/onboarding",getParentRoute:()=>bp}),Ni=O_e.update({id:"/settings",path:"/settings",getParentRoute:()=>bp}),cAe=k_e.update({id:"/",path:"/",getParentRoute:()=>Sp}),dAe=U_e.update({id:"/$mailboxId",path:"/$mailboxId",getParentRoute:()=>Sp}),fAe=B_e.update({id:"/flagged",path:"/flagged",getParentRoute:()=>Sp}),hAe=q_e.update({id:"/outbox",path:"/outbox",getParentRoute:()=>Sp}),pAe=V_e.update({id:"/",path:"/",getParentRoute:()=>Ni}),gAe=Y_e.update({id:"/accounts",path:"/accounts",getParentRoute:()=>Ni}),mAe=X_e.update({id:"/advanced",path:"/advanced",getParentRoute:()=>Ni}),vAe=J_e.update({id:"/appearance",path:"/appearance",getParentRoute:()=>Ni}),yAe=tAe.update({id:"/filters",path:"/filters",getParentRoute:()=>Ni}),bAe=rAe.update({id:"/folders",path:"/folders",getParentRoute:()=>Ni}),SAe=oAe.update({id:"/senders",path:"/senders",getParentRoute:()=>Ni}),EAe=aAe.update({id:"/suggested-vips",path:"/suggested-vips",getParentRoute:()=>Ni}),CAe={MailMailboxIdRoute:dAe,MailFlaggedRoute:fAe,MailOutboxRoute:hAe,MailIndexRoute:cAe},wAe=Sp._addFileChildren(CAe),xAe={SettingsAccountsRoute:gAe,SettingsAdvancedRoute:mAe,SettingsAppearanceRoute:vAe,SettingsFiltersRoute:yAe,SettingsFoldersRoute:bAe,SettingsSendersRoute:SAe,SettingsSuggestedVipsRoute:EAe,SettingsIndexRoute:pAe},_Ae=Ni._addFileChildren(xAe),AAe={IndexRoute:lAe,MailRoute:wAe,OnboardingRoute:uAe,SettingsRoute:_Ae},TAe=bp._addFileChildren(AAe)._addFileTypes(),RAe=(t,e)=>{const n=Lge({routeTree:TAe,context:{queryClient:t},defaultPreload:"intent"});return n.subscribe("onResolved",r=>{e.recordPageView(r.toLocation.pathname),lte(r.toLocation.pathname)}),n},qe=t=>typeof t=="string",qf=()=>{let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n},F5=t=>t==null?"":""+t,IAe=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},OAe=/###/g,z5=t=>t&&t.indexOf("###")>-1?t.replace(OAe,"."):t,j5=t=>!t||qe(t),Sh=(t,e,n)=>{const r=qe(e)?e.split("."):e;let s=0;for(;s<r.length-1;){if(j5(t))return{};const o=z5(r[s]);!t[o]&&n&&(t[o]=new n),Object.prototype.hasOwnProperty.call(t,o)?t=t[o]:t={},++s}return j5(t)?{}:{obj:t,k:z5(r[s])}},B5=(t,e,n)=>{const{obj:r,k:s}=Sh(t,e,Object);if(r!==void 0||e.length===1){r[s]=n;return}let o=e[e.length-1],a=e.slice(0,e.length-1),u=Sh(t,a,Object);for(;u.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),u=Sh(t,a,Object),u?.obj&&typeof u.obj[`${u.k}.${o}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${o}`]=n},NAe=(t,e,n,r)=>{const{obj:s,k:o}=Sh(t,e,Object);s[o]=s[o]||[],s[o].push(n)},vy=(t,e)=>{const{obj:n,k:r}=Sh(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},MAe=(t,e,n)=>{const r=vy(t,n);return r!==void 0?r:vy(e,n)},rH=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?qe(t[r])||t[r]instanceof String||qe(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):rH(t[r],e[r],n):t[r]=e[r]);return t},uc=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var PAe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const kAe=t=>qe(t)?t.replace(/[&<>"'\/]/g,e=>PAe[e]):t;class DAe{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const LAe=[" ",",","?","!",";"],UAe=new DAe(20),FAe=(t,e,n)=>{e=e||"",n=n||"";const r=LAe.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const s=UAe.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!s.test(t);if(!o){const a=t.indexOf(n);a>0&&!s.test(t.substring(0,a))&&(o=!0)}return o},MA=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const r=e.split(n);let s=t;for(let o=0;o<r.length;){if(!s||typeof s!="object")return;let a,u="";for(let c=o;c<r.length;++c)if(c!==o&&(u+=n),u+=r[c],a=s[u],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&c<r.length-1)continue;o+=c-o+1;break}s=a}return s},yy=t=>t?.replace("_","-"),zAe={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class by{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||zAe,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,s){return s&&!this.debug?null:(qe(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new by(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new by(this.logger,e)}}var wo=new by;class Ub{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(a=>{let[u,c]=a;for(let f=0;f<c;f++)u(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[u,c]=a;for(let f=0;f<c;f++)u.apply(u,[e,...r])})}}class H5 extends Ub{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let u;e.indexOf(".")>-1?u=e.split("."):(u=[e,n],r&&(Array.isArray(r)?u.push(...r):qe(r)&&o?u.push(...r.split(o)):u.push(r)));const c=vy(this.data,u);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=u[0],n=u[1],r=u.slice(2).join(".")),c||!a||!qe(r)?c:MA(this.data?.[e]?.[n],r,o)}addResource(e,n,r,s){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let u=[e,n];r&&(u=u.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(u=e.split("."),s=n,n=u[1]),this.addNamespaces(n),B5(this.data,u,s),o.silent||this.emit("added",e,n,r,s)}addResources(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(qe(r[o])||Array.isArray(r[o]))&&this.addResource(e,n,o,r[o],{silent:!0});s.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,s,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},u=[e,n];e.indexOf(".")>-1&&(u=e.split("."),s=r,r=n,n=u[1]),this.addNamespaces(n);let c=vy(this.data,u)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?rH(c,r,o):c={...c,...r},B5(this.data,u,c),a.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var sH={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,s){return t.forEach(o=>{e=this.processors[o]?.process(e,n,r,s)??e}),e}};const $5={},q5=t=>!qe(t)&&typeof t!="boolean"&&typeof t!="number";class Sy extends Ub{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),IAe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=wo.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};return e==null?!1:this.resolve(e,n)?.res!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&e.indexOf(r)>-1,u=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!FAe(e,r,s);if(a&&!u){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:qe(o)?[o]:o};const f=e.split(r);(r!==s||r===s&&this.options.ns.indexOf(f[0])>-1)&&(o=f.shift()),e=f.join(s)}return{key:e,namespaces:qe(o)?[o]:o}}translate(e,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:u}=this.extractFromKey(e[e.length-1],n),c=u[u.length-1],f=n.lng||this.language,p=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()==="cimode"){if(p){const D=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${D}${a}`,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${D}${a}`}return s?{res:a,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:a}const g=this.resolve(e,n);let m=g?.res;const y=g?.usedKey||a,S=g?.exactUsedKey||a,E=["[object Number]","[object Function]","[object RegExp]"],C=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,A=n.count!==void 0&&!qe(n.count),T=Sy.hasDefaultValue(n),R=A?this.pluralResolver.getSuffix(f,n.count,n):"",N=n.ordinal&&A?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",O=A&&!n.ordinal&&n.count===0,I=O&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${R}`]||n[`defaultValue${N}`]||n.defaultValue;let k=m;w&&!m&&T&&(k=I);const F=q5(k),$=Object.prototype.toString.apply(k);if(w&&k&&F&&E.indexOf($)<0&&!(qe(C)&&Array.isArray(k))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,k,{...n,ns:u}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(g.res=D,g.usedParams=this.getUsedParamsDetails(n),g):D}if(o){const D=Array.isArray(k),z=D?[]:{},q=D?S:y;for(const Y in k)if(Object.prototype.hasOwnProperty.call(k,Y)){const te=`${q}${o}${Y}`;T&&!m?z[Y]=this.translate(te,{...n,defaultValue:q5(I)?I[Y]:void 0,joinArrays:!1,ns:u}):z[Y]=this.translate(te,{...n,joinArrays:!1,ns:u}),z[Y]===te&&(z[Y]=k[Y])}m=z}}else if(w&&qe(C)&&Array.isArray(m))m=m.join(C),m&&(m=this.extendTranslation(m,e,n,r));else{let D=!1,z=!1;!this.isValidLookup(m)&&T&&(D=!0,m=I),this.isValidLookup(m)||(z=!0,m=a);const Y=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&z?void 0:m,te=T&&I!==m&&this.options.updateMissing;if(z||D||te){if(this.logger.log(te?"updateKey":"missingKey",f,c,a,te?I:m),o){const de=this.resolve(a,{...n,keySeparator:!1});de&&de.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let H=[];const ee=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ee&&ee[0])for(let de=0;de<ee.length;de++)H.push(ee[de]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(n.lng||this.language):H.push(n.lng||this.language);const fe=(de,Ae,L)=>{const G=T&&L!==m?L:Y;this.options.missingKeyHandler?this.options.missingKeyHandler(de,c,Ae,G,te,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(de,c,Ae,G,te,n),this.emit("missingKey",de,c,Ae,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?H.forEach(de=>{const Ae=this.pluralResolver.getSuffixes(de,n);O&&n[`defaultValue${this.options.pluralSeparator}zero`]&&Ae.indexOf(`${this.options.pluralSeparator}zero`)<0&&Ae.push(`${this.options.pluralSeparator}zero`),Ae.forEach(L=>{fe([de],a+L,n[`defaultValue${L}`]||I)})}):fe(H,a,I))}m=this.extendTranslation(m,e,n,g,r),z&&m===a&&this.options.appendNamespaceToMissingKey&&(m=`${c}:${a}`),(z||D)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${a}`:a,D?m:void 0))}return s?(g.res=m,g.usedParams=this.getUsedParamsDetails(n),g):m}extendTranslation(e,n,r,s,o){var a=this;if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const f=qe(e)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(f){const m=e.match(this.interpolator.nestingRegexp);p=m&&m.length}let g=r.replace&&!qe(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(g={...this.options.interpolation.defaultVariables,...g}),e=this.interpolator.interpolate(e,g,r.lng||this.language||s.usedLng,r),f){const m=e.match(this.interpolator.nestingRegexp),y=m&&m.length;p<y&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var m=arguments.length,y=new Array(m),S=0;S<m;S++)y[S]=arguments[S];return o?.[0]===y[0]&&!r.context?(a.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${n[0]}`),null):a.translate(...y,n)},r)),r.interpolation&&this.interpolator.reset()}const u=r.postProcess||this.options.postProcess,c=qe(u)?[u]:u;return e!=null&&c?.length&&r.applyPostProcessor!==!1&&(e=sH.handle(c,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,s,o,a,u;return qe(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(r))return;const f=this.extractFromKey(c,n),p=f.key;s=p;let g=f.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const m=n.count!==void 0&&!qe(n.count),y=m&&!n.ordinal&&n.count===0,S=n.context!==void 0&&(qe(n.context)||typeof n.context=="number")&&n.context!=="",E=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);g.forEach(C=>{this.isValidLookup(r)||(u=C,!$5[`${E[0]}-${C}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(u)&&($5[`${E[0]}-${C}`]=!0,this.logger.warn(`key "${s}" for languages "${E.join(", ")}" won't get resolved as namespace "${u}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),E.forEach(w=>{if(this.isValidLookup(r))return;a=w;const A=[p];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(A,p,w,C,n);else{let R;m&&(R=this.pluralResolver.getSuffix(w,n.count,n));const N=`${this.options.pluralSeparator}zero`,O=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(A.push(p+R),n.ordinal&&R.indexOf(O)===0&&A.push(p+R.replace(O,this.options.pluralSeparator)),y&&A.push(p+N)),S){const I=`${p}${this.options.contextSeparator}${n.context}`;A.push(I),m&&(A.push(I+R),n.ordinal&&R.indexOf(O)===0&&A.push(I+R.replace(O,this.options.pluralSeparator)),y&&A.push(I+N))}}let T;for(;T=A.pop();)this.isValidLookup(r)||(o=T,r=this.getResource(w,C,T,n))}))})}),{res:r,usedKey:s,exactUsedKey:o,usedLng:a,usedNS:u}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,n,r,s):this.resourceStore.getResource(e,n,r,s)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!qe(e.replace);let s=r?e.replace:e;if(r&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const o of n)delete s[o]}return s}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}class W5{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wo.create("languageUtils")}getScriptPartFromCode(e){if(e=yy(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=yy(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(qe(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>{if(o===s)return o;if(!(o.indexOf("-")<0&&s.indexOf("-")<0)&&(o.indexOf("-")>0&&s.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===s||o.indexOf(s)===0&&s.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),qe(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),s=[],o=a=>{a&&(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return qe(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(e))):qe(e)&&o(this.formatLanguageCode(e)),r.forEach(a=>{s.indexOf(a)<0&&o(this.formatLanguageCode(a))}),s}}const V5={zero:0,one:1,two:2,few:3,many:4,other:5},G5={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class jAe{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=wo.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=yy(e==="dev"?"en":e),s=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),G5;if(!e.match(/-|_/))return G5;const c=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(c,n)}return this.pluralRulesCache[o]=a,a}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(s=>`${n}${s}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((s,o)=>V5[s]-V5[o]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(e,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const K5=function(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=MAe(t,e,n);return!o&&s&&qe(n)&&(o=MA(t,n,r),o===void 0&&(o=MA(e,n,r))),o},Mx=t=>t.replace(/\$/g,"$$$$");class BAe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=wo.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:o,prefixEscaped:a,suffix:u,suffixEscaped:c,formatSeparator:f,unescapeSuffix:p,unescapePrefix:g,nestingPrefix:m,nestingPrefixEscaped:y,nestingSuffix:S,nestingSuffixEscaped:E,nestingOptionsSeparator:C,maxReplaces:w,alwaysFormat:A}=e.interpolation;this.escape=n!==void 0?n:kAe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?uc(o):a||"{{",this.suffix=u?uc(u):c||"}}",this.formatSeparator=f||",",this.unescapePrefix=p?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":p||"",this.nestingPrefix=m?uc(m):y||uc("$t("),this.nestingSuffix=S?uc(S):E||uc(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=w||1e3,this.alwaysFormat=A!==void 0?A:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,s){let o,a,u;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=y=>{if(y.indexOf(this.formatSeparator)<0){const w=K5(n,c,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,r,{...s,...n,interpolationkey:y}):w}const S=y.split(this.formatSeparator),E=S.shift().trim(),C=S.join(this.formatSeparator).trim();return this.format(K5(n,c,E,this.options.keySeparator,this.options.ignoreJSONStructure),C,r,{...s,...n,interpolationkey:E})};this.resetRegExp();const p=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,g=s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:y=>Mx(y)},{regex:this.regexp,safeValue:y=>this.escapeValue?Mx(this.escape(y)):Mx(y)}].forEach(y=>{for(u=0;o=y.regex.exec(e);){const S=o[1].trim();if(a=f(S),a===void 0)if(typeof p=="function"){const C=p(e,o,s);a=qe(C)?C:""}else if(s&&Object.prototype.hasOwnProperty.call(s,S))a="";else if(g){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${S} for interpolating ${e}`),a="";else!qe(a)&&!this.useRawValueToEscape&&(a=F5(a));const E=y.safeValue(a);if(e=e.replace(o[0],E),g?(y.regex.lastIndex+=a.length,y.regex.lastIndex-=o[0].length):y.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,o,a;const u=(c,f)=>{const p=this.nestingOptionsSeparator;if(c.indexOf(p)<0)return c;const g=c.split(new RegExp(`${p}[ ]*{`));let m=`{${g[1]}`;c=g[0],m=this.interpolate(m,a);const y=m.match(/'/g),S=m.match(/"/g);((y?.length??0)%2===0&&!S||S.length%2!==0)&&(m=m.replace(/'/g,'"'));try{a=JSON.parse(m),f&&(a={...f,...a})}catch(E){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,E),`${c}${p}${m}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];a={...r},a=a.replace&&!qe(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const p=s[1].split(this.formatSeparator).map(g=>g.trim());s[1]=p.shift(),c=p,f=!0}if(o=n(u.call(this,s[1].trim(),a),a),o&&s[0]===e&&!qe(o))return o;qe(o)||(o=F5(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),o=""),f&&(o=c.reduce((p,g)=>this.format(p,g,r.lng,{...r,interpolationkey:s[1].trim()}),o.trim())),e=e.replace(s[0],o),this.regexp.lastIndex=0}return e}}const HAe=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);e==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(a=>{if(a){const[u,...c]=a.split(":"),f=c.join(":").trim().replace(/^'+|'+$/g,""),p=u.trim();n[p]||(n[p]=f),f==="false"&&(n[p]=!1),f==="true"&&(n[p]=!0),isNaN(f)||(n[p]=parseInt(f,10))}})}return{formatName:e,formatOptions:n}},cc=t=>{const e={};return(n,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const a=r+JSON.stringify(o);let u=e[a];return u||(u=t(yy(r),s),e[a]=u),u(n)}};class $Ae{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=wo.create("formatter"),this.options=e,this.formats={number:cc((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return o=>s.format(o)}),currency:cc((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>s.format(o)}),datetime:cc((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return o=>s.format(o)}),relativetime:cc((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return o=>s.format(o,r.range||"day")}),list:cc((n,r)=>{const s=new Intl.ListFormat(n,{...r});return o=>s.format(o)})},this.init(e)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=cc(n)}format(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(u=>u.indexOf(")")>-1)){const u=o.findIndex(c=>c.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,u)].join(this.formatSeparator)}return o.reduce((u,c)=>{const{formatName:f,formatOptions:p}=HAe(c);if(this.formats[f]){let g=u;try{const m=s?.formatParams?.[s.interpolationkey]||{},y=m.locale||m.lng||s.locale||s.lng||r;g=this.formats[f](u,y,{...p,...s,...m})}catch(m){this.logger.warn(m)}return g}else this.logger.warn(`there was no format function for ${f}`);return u},e)}}const qAe=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class WAe extends Ub{constructor(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=wo.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,s.backend,s)}queueLoad(e,n,r,s){const o={},a={},u={},c={};return e.forEach(f=>{let p=!0;n.forEach(g=>{const m=`${f}|${g}`;!r.reload&&this.store.hasResourceBundle(f,g)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?a[m]===void 0&&(a[m]=!0):(this.state[m]=1,p=!1,a[m]===void 0&&(a[m]=!0),o[m]===void 0&&(o[m]=!0),c[g]===void 0&&(c[g]=!0)))}),p||(u[f]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const s=e.split("|"),o=s[0],a=s[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const u={};this.queue.forEach(c=>{NAe(c.loaded,[o],a),qAe(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(f=>{u[f]||(u[f]={});const p=c.loaded[f];p.length&&p.forEach(g=>{u[f][g]===void 0&&(u[f][g]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(c=>!c.done)}read(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:s,wait:o,callback:a});return}this.readingCalls++;const u=(f,p)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(f&&p&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,s+1,o*2,a)},o);return}a(f,p)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const f=c(e,n);f&&typeof f.then=="function"?f.then(p=>u(null,p)).catch(u):u(null,f)}catch(f){u(f)}return}return c(e,n,u)}prepareLoading(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();qe(e)&&(e=this.languageUtils.toResolveHierarchy(e)),qe(n)&&(n=[n]);const o=this.queueLoad(e,n,r,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),s=r[0],o=r[1];this.read(s,o,"read",void 0,void 0,(a,u)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${s} failed`,a),!a&&u&&this.logger.log(`${n}loaded namespace ${o} for language ${s}`,u),this.loaded(e,a,u)})}saveMissing(e,n,r,s,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const c={...a,isUpdate:o},f=this.backend.create.bind(this.backend);if(f.length<6)try{let p;f.length===5?p=f(e,n,r,s,c):p=f(e,n,r,s),p&&typeof p.then=="function"?p.then(g=>u(null,g)).catch(u):u(null,p)}catch(p){u(p)}else f(e,n,r,s,u,c)}!e||!e[0]||this.store.addResource(e[0],n,r,s)}}}const Y5=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),qe(t[1])&&(e.defaultValue=t[1]),qe(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Z5=t=>(qe(t.ns)&&(t.ns=[t.ns]),qe(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),qe(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t),Hm=()=>{},VAe=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class Xh extends Ub{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Z5(e),this.services={},this.logger=wo,this.modules={external:[]},VAe(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),n.defaultNS==null&&n.ns&&(qe(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=Y5();this.options={...s,...this.options,...Z5(n)},this.options.interpolation={...s.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?wo.init(o(this.modules.logger),this.options):wo.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:p=$Ae;const g=new W5(this.options);this.store=new H5(this.options.resources,this.options);const m=this.services;m.logger=wo,m.resourceStore=this.store,m.languageUtils=g,m.pluralResolver=new jAe(g,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),p&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(m.formatter=o(p),m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new BAe(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new WAe(o(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",function(y){for(var S=arguments.length,E=new Array(S>1?S-1:0),C=1;C<S;C++)E[C-1]=arguments[C];e.emit(y,...E)}),this.modules.languageDetector&&(m.languageDetector=o(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=o(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new Sy(this.services,this.options),this.translator.on("*",function(y){for(var S=arguments.length,E=new Array(S>1?S-1:0),C=1;C<S;C++)E[C-1]=arguments[C];e.emit(y,...E)}),this.modules.external.forEach(y=>{y.init&&y.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Hm),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(p=>{this[p]=function(){return e.store[p](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=function(){return e.store[p](...arguments),e}});const c=qf(),f=()=>{const p=(g,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(m),r(g,m)};if(this.languages&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initAsync?f():setTimeout(f,0),c}loadResources(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hm;const s=qe(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(s?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&o.indexOf(f)<0&&o.push(f)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>a(c)),this.options.preload?.forEach?.(u=>a(u)),this.services.backendConnector.load(o,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(e,n,r){const s=qf();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=Hm),this.services.backendConnector.reload(e,n,o=>{s.resolve(),r(o)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&sH.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,n){var r=this;this.isLanguageChangingTo=e;const s=qf();this.emit("languageChanging",e);const o=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},a=(c,f)=>{f?(o(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},u=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const f=qe(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);f&&(this.language||o(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector?.cacheUserLanguage?.(f)),this.loadResources(f,p=>{a(p,f)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(e),s}getFixedT(e,n,r){var s=this;const o=function(a,u){let c;if(typeof u!="object"){for(var f=arguments.length,p=new Array(f>2?f-2:0),g=2;g<f;g++)p[g-2]=arguments[g];c=s.options.overloadTranslationOptionHandler([a,u].concat(p))}else c={...u};c.lng=c.lng||o.lng,c.lngs=c.lngs||o.lngs,c.ns=c.ns||o.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||o.keyPrefix);const m=s.options.keySeparator||".";let y;return c.keyPrefix&&Array.isArray(a)?y=a.map(S=>`${c.keyPrefix}${m}${S}`):y=c.keyPrefix?`${c.keyPrefix}${m}${a}`:a,s.t(y,c)};return qe(e)?o.lng=e:o.lngs=e,o.ns=n,o.keyPrefix=r,o}t(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.translator?.translate(...n)}exists(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.translator?.exists(...n)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(u,c)=>{const f=this.services.backendConnector.state[`${u}|${c}`];return f===-1||f===0||f===2};if(n.precheck){const u=n.precheck(this,a);if(u!==void 0)return u}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,e)&&(!s||a(o,e)))}loadNamespaces(e,n){const r=qf();return this.options.ns?(qe(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=qf();qe(e)&&(e=[e]);const s=this.options.preload||[],o=e.filter(a=>s.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=s.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new W5(Y5());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Xh(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hm;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},o=new Xh(s);if((e.debug!==void 0||e.prefix!==void 0)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(u=>{o[u]=this[u]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const u=Object.keys(this.store.data).reduce((c,f)=>(c[f]={...this.store.data[f]},Object.keys(c[f]).reduce((p,g)=>(p[g]={...c[f][g]},p),{})),{});o.store=new H5(u,s),o.services.resourceStore=o.store}return o.translator=new Sy(o.services,s),o.translator.on("*",function(u){for(var c=arguments.length,f=new Array(c>1?c-1:0),p=1;p<c;p++)f[p-1]=arguments[p];o.emit(u,...f)}),o.init(s,n),o.translator.options=s,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const pr=Xh.createInstance();pr.createInstance=Xh.createInstance;pr.createInstance;pr.dir;pr.init;pr.loadResources;pr.reloadResources;pr.use;pr.changeLanguage;pr.getFixedT;pr.t;pr.exists;pr.setDefaultNamespace;pr.hasLoadedNamespace;pr.loadNamespaces;pr.loadLanguages;const{slice:GAe,forEach:KAe}=[];function YAe(t){return KAe.call(GAe.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}function ZAe(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(t))}const X5=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,XAe=function(t,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(e);let o=`${t}=${s}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!X5.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!X5.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},Q5={create(t,e,n,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+n*60*1e3)),r&&(s.domain=r),document.cookie=XAe(t,e,s)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let s=n[r];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return s.substring(e.length,s.length)}return null},remove(t,e){this.create(t,"",-1,e)}};var QAe={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return Q5.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:s,cookieOptions:o}=e;n&&typeof document<"u"&&Q5.create(n,t,r,s,o)}},JAe={name:"querystring",lookup(t){let{lookupQuerystring:e}=t,n;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const o=r.substring(1).split("&");for(let a=0;a<o.length;a++){const u=o[a].indexOf("=");u>0&&o[a].substring(0,u)===e&&(n=o[a].substring(u+1))}}return n}},eTe={name:"hash",lookup(t){let{lookupHash:e,lookupFromHashIndex:n}=t,r;if(typeof window<"u"){const{hash:s}=window.location;if(s&&s.length>2){const o=s.substring(1);if(e){const a=o.split("&");for(let u=0;u<a.length;u++){const c=a[u].indexOf("=");c>0&&a[u].substring(0,c)===e&&(r=a[u].substring(c+1))}}if(r)return r;if(!r&&n>-1){const a=s.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof n=="number"?n:0]?.replace("/",""):void 0}}}return r}};let dc=null;const J5=()=>{if(dc!==null)return dc;try{if(dc=typeof window<"u"&&window.localStorage!==null,!dc)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{dc=!1}return dc};var tTe={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&J5())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&J5()&&window.localStorage.setItem(n,t)}};let fc=null;const e6=()=>{if(fc!==null)return fc;try{if(fc=typeof window<"u"&&window.sessionStorage!==null,!fc)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{fc=!1}return fc};var nTe={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&e6())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&e6()&&window.sessionStorage.setItem(n,t)}},rTe={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:s}=navigator;if(n)for(let o=0;o<n.length;o++)e.push(n[o]);r&&e.push(r),s&&e.push(s)}return e.length>0?e:void 0}},sTe={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},oTe={name:"path",lookup(t){let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof e=="number"?e:0]?.replace("/",""):void 0}},iTe={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let oH=!1;try{document.cookie,oH=!0}catch{}const iH=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];oH||iH.splice(1,1);const aTe=()=>({order:iH,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class aH{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=YAe(n,this.options||{},aTe()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(QAe),this.addDetector(JAe),this.addDetector(tTe),this.addDetector(nTe),this.addDetector(rTe),this.addDetector(sTe),this.addDetector(oTe),this.addDetector(iTe),this.addDetector(eTe)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return e.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.filter(r=>r!=null&&!ZAe(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}aH.type="languageDetector";function lTe(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=uTe(t))||e){n&&(t=n);var r=0,s=function(){};return{s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(f){throw f},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
295
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var f=n.next();return a=f.done,f},e:function(f){u=!0,o=f},f:function(){try{a||n.return==null||n.return()}finally{if(u)throw o}}}}function uTe(t,e){if(t){if(typeof t=="string")return t6(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t6(t,e):void 0}}function t6(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function PA(t){"@babel/helpers - typeof";return PA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},PA(t)}var lH=["__proto__","constructor","prototype"];function uH(t){return!(typeof t!="string"||t.length===0||t.length>128||lH.indexOf(t)>-1||t.indexOf("..")>-1||t.indexOf("\\")>-1||/[?#%\s@]/.test(t)||/[\x00-\x1F\x7F]/.test(t))}function cH(t){return!(!uH(t)||t.indexOf("/")>-1)}function cTe(t){return uH(t)}var dTe={lng:cH,ns:cTe};function $m(t){return typeof t!="string"?t:t.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function fTe(t){if(typeof t!="string"||t.length===0)return t;try{var e=new URL(t);return e.username||e.password?(e.username="",e.password="",e.toString()):t}catch{return t.replace(/(\/\/)[^/@\s]+@/g,"$1")}}function dH(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":PA(XMLHttpRequest))==="object"}function hTe(t){return!!t&&typeof t.then=="function"}function pTe(t){return hTe(t)?t:Promise.resolve(t)}var gTe=/\{\{(.+?)\}\}/g;function n6(t,e){var n=!1,r=t.replace(gTe,function(s,o){var a=o.trim();if(lH.indexOf(a)>-1)return s;var u=e[a];if(u==null)return s;var c=dTe[a]||cH,f=String(u).split("+"),p=lTe(f),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(!c(m))return n=!0,s}}catch(y){p.e(y)}finally{p.f()}return f.join("+")});return n?null:r}function r6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function s6(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?r6(Object(n),!0).forEach(function(r){mTe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function mTe(t,e,n){return(e=vTe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vTe(t){var e=yTe(t,"string");return Jl(e)=="symbol"?e:e+""}function yTe(t,e){if(Jl(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Jl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jl(t){"@babel/helpers - typeof";return Jl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jl(t)}var $a=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?$a=global.fetch:typeof window<"u"&&window.fetch&&($a=window.fetch);var Qh;dH()&&(typeof global<"u"&&global.XMLHttpRequest?Qh=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Qh=window.XMLHttpRequest));var Ey;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Ey=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Ey=window.ActiveXObject));typeof $a!="function"&&($a=void 0);if(!$a&&!Qh&&!Ey)try{Vn(()=>import("./browser-ponyfill-D2EtxrZ2.js").then(t=>t.b),[]).then(function(t){$a=t.default}).catch(function(){})}catch{}var fH=["__proto__","constructor","prototype"],kA=function(e,n){if(n&&Jl(n)==="object"){for(var r="",s=0,o=Object.keys(n);s<o.length;s++){var a=o[s];fH.indexOf(a)>-1||(r+="&"+encodeURIComponent(a)+"="+encodeURIComponent(n[a]))}if(!r)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+r.slice(1)}return e},o6=function(e,n,r,s){var o=function(c){if(!c.ok)return r(c.statusText||"Error",{status:c.status});c.text().then(function(f){r(null,{status:c.status,data:f})}).catch(r)};if(s){var a=s(e,n);if(a instanceof Promise){a.then(o).catch(r);return}}typeof fetch=="function"?fetch(e,n).then(o).catch(r):$a(e,n).then(o).catch(r)},bTe=function(e,n,r,s){e.queryStringParams&&(n=kA(n,e.queryStringParams));var o=s6({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(o["Content-Type"]="application/json");var a=typeof e.requestOptions=="function"?e.requestOptions(r):e.requestOptions,u=s6({method:r?"POST":"GET",body:r?e.stringify(r):void 0,headers:o},e._omitFetchOptions?{}:a),c=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{o6(n,u,s,c)}catch(f){if(!a||Object.keys(a).length===0||!f.message||f.message.indexOf("not implemented")<0)return s(f);try{Object.keys(a).forEach(function(p){delete u[p]}),o6(n,u,s,c),e._omitFetchOptions=!0}catch(p){s(p)}}},STe=function(e,n,r,s){r&&Jl(r)==="object"&&(r=kA("",r).slice(1)),e.queryStringParams&&(n=kA(n,e.queryStringParams));try{var o=Qh?new Qh:new Ey("MSXML2.XMLHTTP.3.0");o.open(r?"POST":"GET",n,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=e.customHeaders;if(a=typeof a=="function"?a():a,a)for(var u=0,c=Object.keys(a);u<c.length;u++){var f=c[u];fH.indexOf(f)>-1||o.setRequestHeader(f,a[f])}o.onreadystatechange=function(){o.readyState>3&&s(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(p){console&&console.log(p)}},ETe=function(e,n,r,s){if(typeof r=="function"&&(s=r,r=void 0),s=s||function(){},$a&&n.indexOf("file:")!==0)return bTe(e,n,r,s);if(dH()||typeof ActiveXObject=="function")return STe(e,n,r,s);s(new Error("No fetch and no xhr implementation found!"))};function rd(t){"@babel/helpers - typeof";return rd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rd(t)}function i6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function Px(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?i6(Object(n),!0).forEach(function(r){hH(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function CTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wTe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pH(r.key),r)}}function xTe(t,e,n){return e&&wTe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function hH(t,e,n){return(e=pH(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pH(t){var e=_Te(t,"string");return rd(e)=="symbol"?e:e+""}function _Te(t,e){if(rd(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(rd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var ATe=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,s){return hH({},r,s||"")},parseLoadPayload:function(n,r){},request:ETe,reloadInterval:typeof window<"u"?!1:3600*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},gH=(function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};CTe(this,t),this.services=e,this.options=n,this.allOptions=r,this.type="backend",this.init(e,n,r)}return xTe(t,[{key:"init",value:function(n){var r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=Px(Px(Px({},ATe()),this.options||{}),s),this.allOptions=o,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);rd(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,s){this._readAny(n,n,r,r,s)}},{key:"read",value:function(n,r,s){this._readAny([n],n,[r],r,s)}},{key:"_readAny",value:function(n,r,s,o,a){var u=this,c=this.options.loadPath;typeof this.options.loadPath=="function"&&(c=this.options.loadPath(n,s)),c=pTe(c),c.then(function(f){if(!f)return a(null,{});var p=n6(f,{lng:n.join("+"),ns:s.join("+")});if(p==null){var g=n.map($m).join(", "),m=s.map($m).join(", ");return a(new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+g+"] namespaces=["+m+"]"),!1)}u.loadUrl(p,a,r,o)})}},{key:"loadUrl",value:function(n,r,s,o){var a=this,u=typeof s=="string"?[s]:s,c=typeof o=="string"?[o]:o,f=this.options.parseLoadPayload(u,c),p=$m(fTe(n));this.options.request(this.options,n,f,function(g,m){if(m&&(m.status>=500&&m.status<600||!m.status))return r("failed loading "+p+"; status code: "+m.status,!0);if(m&&m.status>=400&&m.status<500)return r("failed loading "+p+"; status code: "+m.status,!1);if(!m&&g&&g.message){var y=g.message.toLowerCase(),S=["failed","fetch","network","load"].find(function(w){return y.indexOf(w)>-1});if(S)return r("failed loading "+p+": "+$m(g.message),!0)}if(g)return r(g,!1);var E,C;try{typeof m.data=="string"?E=a.options.parse(m.data,s,o):E=m.data}catch{C="failed parsing "+p+" to json"}if(C)return r(C,!1);r(null,E)})}},{key:"create",value:function(n,r,s,o,a){var u=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var c=this.options.parsePayload(r,s,o),f=0,p=[],g=[];n.forEach(function(m){var y=u.options.addPath;typeof u.options.addPath=="function"&&(y=u.options.addPath(m,r));var S=n6(y,{lng:m,ns:r});if(S==null){f+=1,a&&f===n.length&&a(p,g);return}u.options.request(u.options,S,c,function(E,C){f+=1,p.push(E),g.push(C),f===n.length&&typeof a=="function"&&a(p,g)})})}}},{key:"reload",value:function(){var n=this,r=this.services,s=r.backendConnector,o=r.languageUtils,a=r.logger,u=s.language;if(!(u&&u.toLowerCase()==="cimode")){var c=[],f=function(g){var m=o.toResolveHierarchy(g);m.forEach(function(y){c.indexOf(y)<0&&c.push(y)})};f(u),this.allOptions.preload&&this.allOptions.preload.forEach(function(p){return f(p)}),c.forEach(function(p){n.allOptions.ns.forEach(function(g){s.read(p,g,"read",null,null,function(m,y){m&&a.warn("loading namespace ".concat(g," for language ").concat(p," failed"),m),!m&&y&&a.log("loaded namespace ".concat(g," for language ").concat(p),y),s.loaded("".concat(p,"|").concat(g),m,y)})})})}}}])})();gH.type="backend";pr.use(gH).use(aH).use(YCe).init({fallbackLng:"en",supportedLngs:["en","nl","de","fr"],ns:["common","mail","settings","errors"],defaultNS:"common",backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},detection:{order:["navigator","htmlTag"],caches:[]},interpolation:{escapeValue:!1},react:{useSuspense:!0,bindI18n:"languageChanged loaded"}});const TTe=({authProvider:t,rootElementId:e="root"})=>{ote(),UCe(),t.configure(),lme(t);const n=DCe();Yee(n);const r=new Phe({queryCache:new E7({onError:fme}),mutationCache:new S7({onError:hme}),defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:1}}}),s=RAe(r,n);n.recordPageView(window.location.pathname);const o=document.getElementById(e);if(!o)throw new Error(`Root element not found: #${e}`);const{Shell:a}=t;qge.createRoot(o).render(P.jsx(_.StrictMode,{children:P.jsx(BB.Provider,{value:n,children:P.jsxs(khe,{client:r,children:[P.jsx(dme,{value:t,children:P.jsx(a,{children:P.jsx(zge,{router:s})})}),!1]})})}))};TTe({authProvider:che});export{Fhe as $,KX as A,uh as B,dP as C,GQ as D,T8 as E,XX as F,RTe as G,ITe as H,eQ as I,VTe as J,WTe as K,DTe as L,nQ as M,md as N,tT as O,jTe as P,Rhe as Q,j as R,oQ as S,iQ as T,Dn as U,kv as V,f7 as W,wh as X,pb as Y,Dhe as Z,WN as _,In as a,Wwe as a$,Hhe as a0,zhe as a1,jhe as a2,Er as a3,qhe as a4,rU as a5,Bhe as a6,Whe as a7,fs as a8,Wr as a9,hIe as aA,vIe as aB,dIe as aC,Vn as aD,QRe as aE,Kwe as aF,rxe as aG,Hwe as aH,sIe as aI,oxe as aJ,aIe as aK,oIe as aL,b_e as aM,rIe as aN,XRe as aO,U5 as aP,Z7 as aQ,lIe as aR,iIe as aS,yIe as aT,gIe as aU,pIe as aV,_Ie as aW,MTe as aX,Q7 as aY,sxe as aZ,zy as a_,lge as aa,mIe as ab,gR as ac,$Re as ad,y_e as ae,Ix as af,ZTe as ag,VP as ah,mte as ai,Y7 as aj,ewe as ak,CIe as al,AIe as am,NRe as an,x7 as ao,Zwe as ap,E8 as aq,Vhe as ar,cIe as as,fIe as at,uIe as au,ZRe as av,Gwe as aw,bIe as ax,Jwe as ay,QB as az,Jt as b,Lg as b$,Bl as b0,zwe as b1,WB as b2,Swe as b3,Awe as b4,_we as b5,xwe as b6,VRe as b7,WRe as b8,GRe as b9,DRe as bA,URe as bB,TIe as bC,RIe as bD,YRe as bE,HTe as bF,kTe as bG,BTe as bH,Axe as bI,$ee as bJ,Bee as bK,jee as bL,h5 as bM,MRe as bN,zRe as bO,BRe as bP,Bwe as bQ,jRe as bR,bee as bS,FTe as bT,yee as bU,HRe as bV,qRe as bW,Nx as bX,EIe as bY,nIe as bZ,Ywe as b_,KRe as ba,JRe as bb,qTe as bc,PRe as bd,wIe as be,xIe as bf,qa as bg,gwe as bh,C9 as bi,My as bj,C_e as bk,PTe as bl,aT as bm,tz as bn,Vwe as bo,KTe as bp,LRe as bq,kRe as br,FRe as bs,yd as bt,m_e as bu,xr as bv,SIe as bw,eIe as bx,tIe as by,Y_e as bz,_8 as c,H9 as c0,No as c1,MT as c2,Ai as c3,Hie as c4,Ti as c5,kie as c6,B9 as c7,Gy as c8,wF as c9,jie as cA,mT as cB,Fie as cC,sae as cD,MF as cE,NTe as cF,op as cG,$Te as cH,DT as cI,tb as cJ,lp as cK,Jie as cL,ip as cM,eae as cN,Gie as cO,soe as ca,Vie as cb,tae as cc,ioe as cd,Jse as ce,$y as cf,gT as cg,D9 as ch,Qie as ci,Kie as cj,doe as ck,$ie as cl,zT as cm,F9 as cn,aoe as co,Lie as cp,Uie as cq,Ine as cr,iu as cs,Sne as ct,bne as cu,pT as cv,TF as cw,Die as cx,wne as cy,coe as cz,wP as d,ZX as e,VQ as f,YX as g,tQ as h,Qx as i,P as j,wJ as k,LTe as l,I8 as m,TJ as n,sQ as o,UTe as p,_ee as q,_ as r,wee as s,zTe as t,_J as u,IJ as v,pS as w,aQ as x,NJ as y,S8 as z};