@remit/web-client-dist 0.0.20 → 0.0.21
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.
- package/assets/{ComposeBody-YnCJxfqC.js → ComposeBody-D8PmiND3.js} +1 -1
- package/assets/{ErrorState-j8S5XFk6.js → ErrorState-DG6jh7e2.js} +1 -1
- package/assets/{OnboardingWizard-1Up61eEk.js → OnboardingWizard-DgxqSbdA.js} +1 -1
- package/assets/{account-form-helpers-Cnz1UyCd.js → account-form-helpers-voIR3KwJ.js} +1 -1
- package/assets/{accounts-C5ua8Szj.js → accounts-_cJv_LIO.js} +1 -1
- package/assets/{advanced-DAyxsQQA.js → advanced-BNBIvl7Z.js} +1 -1
- package/assets/{appearance-CGIVvQ__.js → appearance-C4sV_Bgs.js} +1 -1
- package/assets/{avatar-BBYbqlEP.js → avatar-WwuE7aom.js} +1 -1
- package/assets/{browser-ponyfill-B8dXU7OB.js → browser-ponyfill-BBk5Xtq_.js} +1 -1
- package/assets/{filter-status-C5iGEfo1.js → filter-status-ybqLOFOR.js} +1 -1
- package/assets/{filters-ChFVclfN.js → filters-DGstBlo9.js} +1 -1
- package/assets/{flagged-CYp-wRoV.js → flagged-Ceo9C3FE.js} +1 -1
- package/assets/{folders-CiwXxce8.js → folders-BNURd924.js} +1 -1
- package/assets/{index-CTKsy36p.js → index-BQKG41NM.js} +5 -5
- package/assets/{index-D8tcVoGJ.js → index-CCeIZpQ0.js} +1 -1
- package/assets/index-D6uqSvyo.js +1 -0
- package/assets/{kbd-CheP1Ri1.js → kbd-JYECpmki.js} +1 -1
- package/assets/{mail-DUpIpDxR.js → mail-wRyPOZOI.js} +5 -5
- package/assets/{onboarding-D3j_ozgf.js → onboarding-DfwoEoUJ.js} +1 -1
- package/assets/{select-Cp8q0xm5.js → select-DdWCZXwu.js} +1 -1
- package/assets/{send-DhVj_U9i.js → send-BH4zdB7m.js} +1 -1
- package/assets/{senders-Dfo4XvA2.js → senders-D14qF6PF.js} +1 -1
- package/assets/settings-BTbXK9X8.js +1 -0
- package/assets/{settings-screen-fLD_jdIZ.js → settings-screen-VrytBs2p.js} +1 -1
- package/assets/{star-DS7xFC3x.js → star-Diyw51pt.js} +1 -1
- package/assets/{suggested-vips-C286_Wq_.js → suggested-vips-BRyX8ZX3.js} +1 -1
- package/assets/{trash-2-BsYJJRpG.js → trash-2-DTa9lOCZ.js} +1 -1
- package/assets/{useDebouncedValue-B5Xuyscd.js → useDebouncedValue-D5vdtQkN.js} +1 -1
- package/assets/{useMutation-0lfTKIOn.js → useMutation-CXo-HYWj.js} +1 -1
- package/assets/{useSignature-CF90xdGJ.js → useSignature-ip7HP0v5.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/index-CdSD5Ukp.js +0 -1
- package/assets/settings-HMGH-kik.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mail-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mail-wRyPOZOI.js","assets/kbd-JYECpmki.js","assets/avatar-WwuE7aom.js","assets/star-Diyw51pt.js","assets/trash-2-DTa9lOCZ.js","assets/account-form-helpers-voIR3KwJ.js","assets/send-BH4zdB7m.js","assets/useMutation-CXo-HYWj.js","assets/useSignature-ip7HP0v5.js","assets/useDebouncedValue-D5vdtQkN.js","assets/ErrorState-DG6jh7e2.js","assets/format-BGdB831k.js","assets/folder-roles-XnseeyyD.js","assets/select-DdWCZXwu.js","assets/filter-status-ybqLOFOR.js","assets/onboarding-DfwoEoUJ.js","assets/OnboardingWizard-DgxqSbdA.js","assets/index-CCeIZpQ0.js","assets/flagged-Ceo9C3FE.js","assets/accounts-_cJv_LIO.js","assets/settings-screen-VrytBs2p.js","assets/advanced-BNBIvl7Z.js","assets/appearance-C4sV_Bgs.js","assets/filters-DGstBlo9.js","assets/folders-BNURd924.js","assets/senders-D14qF6PF.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function N6(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 Ig=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 T1={exports:{}},pf={};var bN;function x$(){if(bN)return pf;bN=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 pf.Fragment=e,pf.jsx=n,pf.jsxs=n,pf}var SN;function A$(){return SN||(SN=1,T1.exports=x$()),T1.exports}var D=A$();const T$="Logging",R$="x-amz-user-agent",I$="NoHubcallbackProvidedException";var rs;(function(t){t.DEBUG="DEBUG",t.ERROR="ERROR",t.INFO="INFO",t.WARN="WARN",t.VERBOSE="VERBOSE",t.NONE="NONE"})(rs||(rs={}));const EN={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};class nr{constructor(e,n=rs.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;nr.LOG_LEVEL&&(r=nr.LOG_LEVEL),typeof window<"u"&&window.LOG_LEVEL&&(r=window.LOG_LEVEL);const s=EN[r];if(!(EN[e]>=s))return;let a=console.log.bind(console);e===rs.ERROR&&console.error&&(a=console.error.bind(console)),e===rs.WARN&&console.warn&&(a=console.warn.bind(console)),nr.BIND_ALL_LOG_LEVELS&&(e===rs.INFO&&console.info&&(a=console.info.bind(console)),e===rs.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(rs.INFO,...e)}info(...e){this._log(rs.INFO,...e)}warn(...e){this._log(rs.WARN,...e)}error(...e){this._log(rs.ERROR,...e)}debug(...e){this._log(rs.DEBUG,...e)}verbose(...e){this._log(rs.VERBOSE,...e)}addPluggable(e){e&&e.getCategoryName()===T$&&(this._pluggables.push(e),e.configure(this._config))}listPluggables(){return this._pluggables}}nr.LOG_LEVEL=null;nr.BIND_ALL_LOG_LEVELS=!1;class jr 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=jr,Object.setPrototypeOf(this,jr.prototype)}}var Pa;(function(t){t.NoEndpointId="NoEndpointId",t.PlatformNotSupported="PlatformNotSupported",t.Unknown="Unknown",t.NetworkError="NetworkError"})(Pa||(Pa={}));const fy=(t,e=jr)=>(n,r,s)=>{const{message:o,recoverySuggestion:a}=t[r];if(!n)throw new e({name:r,message:s?`${o} ${s}`:o,recoverySuggestion:a})},xo=typeof Symbol<"u"?Symbol("amplify_default"):"@@amplify_default",gf=new nr("Hub");class M6{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){gf.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===xo||gf.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){gf.error(a)}}listen(e,n,r="noname"){let s;if(typeof n!="function")throw new jr({name:I$,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=>{gf.debug(`Dispatching to ${n} with `,r);try{o.callback(e)}catch(a){gf.error(a)}})}}const Ao=new M6("__default__"),fv=new M6("internal-hub"),bA=()=>{if(typeof window=="object"&&typeof window.crypto=="object")return window.crypto;if(typeof crypto=="object")return crypto;throw new jr({name:"MissingPolyfill",message:"Cannot resolve the `crypto` function from the environment."})},O$=()=>{if(typeof window<"u"&&typeof window.btoa=="function")return window.btoa;if(typeof btoa=="function")return btoa;throw new jr({name:"Base64EncoderError",message:"Cannot resolve the `btoa` function from the environment."})},N$=()=>{if(typeof window<"u"&&typeof window.atob=="function")return window.atob;if(typeof atob=="function")return atob;throw new jr({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})},SA={convert(t,e){let n=t;return e?.urlSafe&&(n=n.replace(/-/g,"+").replace(/_/g,"/")),N$()(n)}};var Eo;(function(t){t.AuthTokenConfigException="AuthTokenConfigException",t.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",t.AuthUserPoolException="AuthUserPoolException",t.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",t.OAuthNotConfigureException="OAuthNotConfigureException"})(Eo||(Eo={}));const M$={[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."}},EA=fy(M$);function lt(t){let e=!0;t?e=!!t.userPoolId&&!!t.userPoolClientId:e=!1,EA(e,Eo.AuthUserPoolException)}function hy(t){const e=!!t?.loginWith?.oauth?.domain&&!!t?.loginWith?.oauth?.redirectSignOut&&!!t?.loginWith?.oauth?.redirectSignIn&&!!t?.loginWith?.oauth?.responseType;EA(e,Eo.OAuthNotConfigureException)}function Lm(t){const e=!!t?.identityPoolId;EA(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(SA.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 P6=t=>{const e=Reflect.ownKeys(t);for(const n of e){const r=t[n];(r&&typeof r=="object"||typeof r=="function")&&P6(r)}return Object.freeze(t)},P$=new nr("parseAWSExports"),k$={API_KEY:"apiKey",AWS_IAM:"iam",AMAZON_COGNITO_USER_POOLS:"userPool",OPENID_CONNECT:"oidc",NONE:"none",AWS_LAMBDA:"lambda",LAMBDA:"lambda"},D$=(t={})=>{if(!Object.prototype.hasOwnProperty.call(t,"aws_project_region"))throw new jr({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:x,aws_user_files_s3_bucket_region:T,aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing:R,aws_user_pools_id:M,aws_user_pools_web_client_id:O,geo:I,oauth:P,predictions:k,aws_cloud_logic_custom:H,Notifications:F,modelIntrospection:B}=t,W={};C&&(W.Analytics={Pinpoint:{appId:C,region:w}});const{InAppMessaging:Y,Push:ne}=F??{};if(Y?.AWSPinpoint||ne?.AWSPinpoint){if(Y?.AWSPinpoint){const{appId:J,region:oe}=Y.AWSPinpoint;W.Notifications={InAppMessaging:{Pinpoint:{appId:J,region:oe}}}}if(ne?.AWSPinpoint){const{appId:J,region:oe}=ne.AWSPinpoint;W.Notifications={...W.Notifications,PushNotification:{Pinpoint:{appId:J,region:oe}}}}}if(Array.isArray(o)&&(W.Interactions={LexV1:Object.fromEntries(o.map(J=>[J.name,J]))}),r){const J=k$[n];J||P$.debug(`Invalid authentication type ${n}. Falling back to IAM.`),W.API={GraphQL:{endpoint:r,apiKey:e,region:s,defaultAuthMode:J??"iam"}},B&&(W.API.GraphQL.modelIntrospection=B)}const $=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||M)&&(W.Auth={Cognito:{identityPoolId:a,allowGuestAccess:E!=="enable",signUpVerificationMethod:u,userAttributes:de,userPoolClientId:O,userPoolId:M,mfa:$,passwordFormat:ee,loginWith:{username:!(Ae||L),email:Ae,phone:L}}});const V=P?Object.keys(P).length>0:!1,K=y?y.length>0:!1;if(W.Auth&&V&&(W.Auth.Cognito.loginWith={...W.Auth.Cognito.loginWith,oauth:{...L$(P),...K&&{providers:U$(y)}}}),x&&(W.Storage={S3:{bucket:x,region:T,dangerouslyConnectToHttpEndpointForTesting:R}}),I){const{amazon_location_service:J}=I;W.Geo={LocationService:{maps:J.maps,geofenceCollections:J.geofenceCollections,searchIndices:J.search_indices,region:J.region}}}if(H&&(W.API={...W.API,REST:H.reduce((J,oe)=>{const{name:he,endpoint:ue,region:ve,service:_e}=oe;return{...J,[he]:{endpoint:ue,..._e?{service:_e}:void 0,...ve?{region:ve}:void 0}}},{})}),k){const{VoiceId:J}=k?.convert?.speechGenerator?.defaults??{};W.Predictions=J?{...k,convert:{...k.convert,speechGenerator:{...k.convert.speechGenerator,defaults:{voiceId:J}}}}:k}return W},CN=t=>t?.split(",")??[],L$=({domain:t,scope:e,redirectSignIn:n,redirectSignOut:r,responseType:s})=>({domain:t,scopes:e,redirectSignIn:CN(n),redirectSignOut:CN(r),responseType:s}),U$=t=>t.map(e=>{const n=e.toLowerCase();return n.charAt(0).toUpperCase()+n.slice(1)}),k6=Symbol("oauth-listener"),Xn=[];for(let t=0;t<256;++t)Xn.push((t+256).toString(16).slice(1));function F$(t,e=0){return(Xn[t[e+0]]+Xn[t[e+1]]+Xn[t[e+2]]+Xn[t[e+3]]+"-"+Xn[t[e+4]]+Xn[t[e+5]]+"-"+Xn[t[e+6]]+Xn[t[e+7]]+"-"+Xn[t[e+8]]+Xn[t[e+9]]+"-"+Xn[t[e+10]]+Xn[t[e+11]]+Xn[t[e+12]]+Xn[t[e+13]]+Xn[t[e+14]]+Xn[t[e+15]]).toLowerCase()}let R1;const z$=new Uint8Array(16);function B$(){if(!R1){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");R1=crypto.getRandomValues.bind(crypto)}return R1(z$)}const j$=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),wN={randomUUID:j$};function H$(t,e,n){if(wN.randomUUID&&!e&&!t)return wN.randomUUID();t=t||{};const r=t.random??t.rng?.()??B$();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 F$(r)}function $$(t){const{version:e}=t;return e?e.startsWith("1"):!1}function q$(t){if(!t)return;const{bucket_name:e,aws_region:n,buckets:r}=t;return{S3:{bucket:e,region:n,buckets:r&&tq(r)}}}function W$(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:eq(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:J$(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 G$(t){if(!t?.amazon_pinpoint)return;const{amazon_pinpoint:e}=t;return{Pinpoint:{appId:e.app_id,region:e.aws_region}}}function V$(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 K$(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 Y$(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 Z$(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 X$(t){const e={};if(t.storage&&(e.Storage=q$(t.storage)),t.auth&&(e.Auth=W$(t.auth)),t.analytics&&(e.Analytics=G$(t.analytics)),t.geo&&(e.Geo=V$(t.geo)),t.data&&(e.API=K$(t.data)),t.custom){const n=Y$(t.custom);n&&"Events"in n&&(e.API={...e.API,...n})}return t.notifications&&(e.Notifications=Z$(t.notifications)),e}const Q$={AMAZON_COGNITO_USER_POOLS:"userPool",API_KEY:"apiKey",AWS_IAM:"iam",AWS_LAMBDA:"lambda",OPENID_CONNECT:"oidc"};function D6(t){return Q$[t]}const _N={GOOGLE:"Google",LOGIN_WITH_AMAZON:"Amazon",FACEBOOK:"Facebook",SIGN_IN_WITH_APPLE:"Apple"};function J$(t=[]){return t.reduce((e,n)=>(_N[n]!==void 0&&e.push(_N[n]),e),[])}function eq(t){return t==="OPTIONAL"?"optional":t==="REQUIRED"?"on":"off"}function tq(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 L6=t=>Object.keys(t).some(e=>e.startsWith("aws_"))?D$(t):$$(t)?X$(t):t;var xN=function(){return xN=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},xN.apply(this,arguments)};function mxe(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 nq(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 rq(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 vxe(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,sq=32,oq=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]),iq=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],aq=Math.pow(2,53)-1,Um=(function(){function t(){this.state=Int32Array.from(iq),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>aq)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(sq),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+(oq[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 lq=t=>new TextEncoder().encode(t);var uq=typeof Buffer<"u"&&Buffer.from?function(t){return Buffer.from(t,"utf8")}:lq;function U6(t){return t instanceof Uint8Array?t:typeof t=="string"?uq(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}function cq(t){return typeof t=="string"?t.length===0:t.byteLength===0}var Ul=(function(){function t(e){this.secret=e,this.hash=new Um,this.reset()}return t.prototype.update=function(e){if(!(cq(e)||this.error))try{this.hash.update(U6(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 nq(this,void 0,void 0,function(){return rq(this,function(e){return[2,this.digestSync()]})})},t.prototype.reset=function(){if(this.hash=new Um,this.secret){this.outer=new Um;var e=dq(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 dq(t){var e=U6(t);if(e.byteLength>_s){var n=new Um;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 _n;(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"})(_n||(_n={}));var Rs;(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"})(Rs||(Rs={}));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 AN;(function(t){t.Record="1",t.IdentifyUser="2"})(AN||(AN={}));var TN;(function(t){t.GraphQl="1",t.Get="2",t.Post="3",t.Put="4",t.Patch="5",t.Del="6",t.Head="7"})(TN||(TN={}));var Ve;(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"})(Ve||(Ve={}));var RN;(function(t){t.Subscribe="1",t.GraphQl="2"})(RN||(RN={}));var Qf;(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"})(Qf||(Qf={}));var b_;(function(t){t.SyncMessages="1",t.IdentifyUser="2",t.NotifyMessageInteraction="3"})(b_||(b_={}));var IN;(function(t){t.None="0"})(IN||(IN={}));var ON;(function(t){t.Convert="1",t.Identify="2",t.Interpret="3"})(ON||(ON={}));var NN;(function(t){t.Subscribe="1"})(NN||(NN={}));var MN;(function(t){t.InitializePushNotifications="1",t.IdentifyUser="2"})(MN||(MN={}));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 fq="6.18.0",py=()=>typeof global<"u",Qc=()=>typeof window<"u",F6=()=>typeof document<"u",CA=()=>typeof process<"u",fh=(t,e)=>!!Object.keys(t).find(n=>n.startsWith(e));var PN={};function hq(){const t=r=>r.startsWith("_react")||r.startsWith("__react"),e=r=>Object.keys(r).find(t),n=()=>Array.from(document.querySelectorAll("[id]"));return F6()&&n().some(e)}function pq(){return CA()&&typeof PN<"u"&&!!Object.keys(PN).find(t=>t.includes("react"))}function gq(){return Qc()&&fh(window,"__VUE")}function mq(){return py()&&fh(global,"__VUE")}var kN={};function vq(){return Qc()&&fh(window,"__SVELTE")}function yq(){return CA()&&typeof kN<"u"&&!!Object.keys(kN).find(t=>t.includes("svelte"))}function bq(){return Qc()&&window.next&&typeof window.next=="object"}function Sq(){return py()&&(fh(global,"__next")||fh(global,"__NEXT"))}function Eq(){return Qc()&&(window.__NUXT__!==void 0||window.$nuxt!==void 0)}function Cq(){return py()&&typeof global.__NUXT_PATHS__<"u"}var DN={};function wq(){const t=!!(F6()&&document.querySelector("[ng-version]")),e=!!(Qc()&&typeof window.ng<"u");return t||e}function _q(){return CA()&&typeof DN=="object"&&DN.npm_lifecycle_script?.startsWith("ng ")||!1}function xq(){return typeof navigator<"u"&&typeof navigator.product<"u"&&navigator.product==="ReactNative"}function Aq(){return py()&&typeof global.expo<"u"}function Tq(){return Qc()}const Rq=[{platform:_n.Expo,detectionMethod:Aq},{platform:_n.ReactNative,detectionMethod:xq},{platform:_n.NextJs,detectionMethod:bq},{platform:_n.Nuxt,detectionMethod:Eq},{platform:_n.Angular,detectionMethod:wq},{platform:_n.React,detectionMethod:hq},{platform:_n.VueJs,detectionMethod:gq},{platform:_n.Svelte,detectionMethod:vq},{platform:_n.WebUnknown,detectionMethod:Tq},{platform:_n.NextJsSSR,detectionMethod:Sq},{platform:_n.NuxtSSR,detectionMethod:Cq},{platform:_n.ReactSSR,detectionMethod:pq},{platform:_n.VueJsSSR,detectionMethod:mq},{platform:_n.AngularSSR,detectionMethod:_q},{platform:_n.SvelteSSR,detectionMethod:yq}];function Iq(){return Rq.find(t=>t.detectionMethod())?.platform||_n.ServerSideUnknown}let Jf;const I1=[];let S_=!1;const Oq=10,Nq=10,Mq=1e3,z6=()=>{if(!Jf){if(Jf=Iq(),S_)for(;I1.length;)I1.pop()?.();else I1.forEach(t=>{t()});LN(_n.ServerSideUnknown,Oq),LN(_n.WebUnknown,Nq)}return Jf};function Pq(){Jf=void 0}function LN(t,e){Jf===t&&!S_&&setTimeout(()=>{Pq(),S_=!0,setTimeout(z6,Mq)},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])}))}},kq=(t,e)=>pa[t]?.[e]?.additionalDetails,Dq="aws-amplify",Lq=t=>t.replace(/\+.*/,""),Uq=({category:t,action:e}={})=>{const n=[[Dq,Lq(fq)]];if(t&&n.push([t,e]),n.push(["framework",z6()]),t&&e){const r=kq(t,e);r&&r.forEach(s=>{n.push(s)})}return n},gy=t=>Uq(t).map(([r,s])=>r&&s?`${r}/${s}`:r).join(" "),my=()=>typeof window<"u"&&typeof window.document<"u",UN=new nr("Auth");class Fq{configure(e,n){this.authConfig=e,this.authOptions=n,e&&e.Cognito?.userPoolEndpoint&&UN.warn(FN("Amazon Cognito User Pool")),e&&e.Cognito?.identityPoolEndpoint&&UN.warn(FN("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 FN=t=>`You are using a custom Amazon ${t} endpoint, ensure the endpoint is correct.`;class zq{constructor(){this.oAuthListener=void 0,this.isConfigured=!1,this.resourcesConfig={},this.libraryOptions={},this.Auth=new Fq}configure(e,n){const r=L6(e);this.resourcesConfig=r,n&&(this.libraryOptions=n),this.resourcesConfig=P6(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",xo),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}[k6](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 zq,B6=(t,e)=>t.Auth.fetchAuthSession(e),vy=t=>B6(Ht,t);function j6(){return Ht.Auth.clearCredentials()}const yy=t=>{const{headers:e,statusCode:n}=t;return{...Bq(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"]}},Bq=t=>typeof t?.$metadata=="object",Jc=async t=>{if(!t||t.statusCode<300)return;const e=await Wh(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:yy(t)})},Wh=async t=>{if(!t.body)throw new Error("Missing response payload");const e=await t.body.json();return Object.assign(e,{$metadata:yy(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)},jq=300*1e3;function Hq(t=jq){return r=>{const s=2**r*100+100*Math.random();return s>t?!1:s}}const H6=3,zN="amz-sdk-invocation-id",$q="amz-sdk-request",BN=300*1e3,$6=t=>{const n=Hq(BN)(t);return n===!1?BN:n},qq=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],Wq=t=>!!t&&qq.includes(t),q6=t=>async(e,n)=>{const r=n??await t(e)??void 0,s=r?.code||r?.name,o=e?.statusCode;return{retryable:Yq(n)||Kq(o,s)||Wq(s)||Zq(o,s)}},Gq=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],Vq=["TimeoutError","RequestTimeout","RequestTimeoutException"],Kq=(t,e)=>t===429||!!e&&Gq.includes(e),Yq=t=>[Pa.NetworkError,"ERR_NETWORK"].includes(t?.name),Zq=(t,e)=>!!t&&[500,502,503,504].includes(t)||!!e&&Vq.includes(e),W6="cognito-identity",G6={service:W6,retryDecider:q6(Jc),computeDelay:$6,cache:"no-store"},Xq=({maxAttempts:t=H6,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 jN(p,f),p;throw jN(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 Qq(S,r)}continue}else return g()}if(r?.aborted)throw new Error("Request aborted.");return g()}},Qq=(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},jN=(t,e)=>{Object.prototype.toString.call(t)==="[object Object]"&&(t.$metadata={...t.$metadata??{},attempts:e})},Jq=H$,eW=()=>t=>async function(n){return n.headers[zN]||(n.headers[zN]=Jq()),t(n)},tW=({maxAttempts:t=H6})=>(e,n)=>async function(s){const o=n.attemptsCount??0;return s.headers[$q]=`attempt=${o+1}; max=${t}`,e(s)},nW=({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)}},wA=(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)},O1=t=>{let e;return()=>(e||(e=t()),e)},rW=t=>!["HEAD","GET"].includes(t.toUpperCase()),sW=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:rW(e)?r:void 0,signal:s,cache:o,credentials:a?"include":"same-origin"})}catch(g){throw g instanceof TypeError?new jr({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:O1(()=>u.text()),blob:O1(()=>u.blob()),json:O1(()=>u.json())});return{...f,body:p}},V6=wA(sW,[nW,eW,Xq,tW]),oW=()=>t=>async function(n){return n.headers["cache-control"]="no-store",t(n)},K6=wA(V6,[oW]),Y6=t=>(e,n)=>{const r=iW(t),s=JSON.stringify(e);return aW(n,r,s)},iW=t=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${t}`}),aW=({url:t},e,n)=>({headers:e,url:t,body:n,method:"POST"}),HN=t=>Rn(K6,Y6("GetCredentialsForIdentity"),lW,{...G6,...t,userAgentValue:gy()}),lW=async t=>{if(t.statusCode>=300)throw await Jc(t);const e=await Wh(t);return{IdentityId:e.IdentityId,Credentials:uW(e.Credentials),$metadata:yy(t)}},uW=({Expiration:t,...e}={})=>({...e,Expiration:t&&new Date(t*1e3)}),cW=t=>Rn(K6,Y6("GetId"),dW,{...G6,...t,userAgentValue:gy()}),dW=async t=>{if(t.statusCode>=300)throw await Jc(t);return{IdentityId:(await Wh(t)).IdentityId,$metadata:yy(t)}},Z6={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},fW={partitions:[Z6,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},X6=t=>{const{partitions:e}=fW;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 Z6.outputs.dnsSuffix},Wa=URL,hW=({region:t})=>({url:new Wa(`https://${W6}.${t}.${X6(t)}`)});class Uf extends jr{constructor(){super({name:Pa.PlatformNotSupported,message:"Function not supported on current platform"})}}class Q6{constructor(e){this.storage=e}async setItem(e,n){if(!this.storage)throw new Uf;this.storage.setItem(e,n)}async getItem(e){if(!this.storage)throw new Uf;return this.storage.getItem(e)}async removeItem(e){if(!this.storage)throw new Uf;this.storage.removeItem(e)}async clear(){if(!this.storage)throw new Uf;this.storage.clear()}}class J6{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 e5=new nr("CoreStorageUtils"),pW=()=>{try{if(typeof window<"u"&&window.localStorage)return window.localStorage}catch{e5.info("localStorage not found. InMemoryStorage is used as a fallback.")}return new J6},t5=()=>{try{if(typeof window<"u"&&window.sessionStorage)return window.sessionStorage.getItem("test"),window.sessionStorage;throw new Error("sessionStorage is not defined")}catch{return e5.info("sessionStorage not found. InMemoryStorage is used as a fallback."),new J6}};class gW extends Q6{constructor(){super(pW())}}class mW extends Q6{constructor(){super(t5())}}class vW{constructor(e){this._storage=e}get storage(){if(!this._storage)throw new Uf;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 yW extends vW{constructor(){super(t5())}}function Og(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 bW={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 E_(t,e){function n(s,o,a){if(!(typeof document>"u")){a=Og({},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,"",Og({},o,{expires:-1}))},withAttributes:function(s){return E_(this.converter,Og({},this.attributes,s))},withConverter:function(s){return E_(Og({},this.converter,s),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var Ng=E_(bW,{path:"/"});class SW{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){Ng.set(e,n,this.getData())}async getItem(e){return Ng.get(e)??null}async removeItem(e){Ng.remove(e,this.getData())}async clear(){const e=Ng.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 Gh=new gW;new mW;const ci=new yW,EW=new nr("I18n");let CW=class{constructor(){this._options=null,this._lang=null,this._dict={}}setDefaultLanguage(){!this._lang&&typeof window<"u"&&window&&window.navigator&&(this._lang=window.navigator.language),EW.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 wW={[Cl.NotConfigured]:{message:"i18n is not configured."}},Mg=fy(wW),$N=new nr("I18n");let Pg={language:null},Bs=null,n5=class bl{static configure(e){return $N.debug("configure I18n"),e&&(Pg=Object.assign({},Pg,e.I18n||e),bl.createInstance()),Pg}static getModuleName(){return"I18n"}static createInstance(){$N.debug("create I18n instance"),!Bs&&(Bs=new CW)}static setLanguage(e){bl.checkConfig(),Mg(!!Bs,Cl.NotConfigured),Bs.setLanguage(e)}static get(e,n){return bl.checkConfig(),Mg(!!Bs,Cl.NotConfigured),Bs.get(e,n)}static putVocabulariesForLanguage(e,n){bl.checkConfig(),Mg(!!Bs,Cl.NotConfigured),Bs.putVocabulariesForLanguage(e,n)}static putVocabularies(e){bl.checkConfig(),Mg(!!Bs,Cl.NotConfigured),Bs.putVocabularies(e)}static checkConfig(){return Bs||bl.createInstance(),!0}};n5.createInstance();const _W=t=>{const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=[],r=new Uint8Array(t);bA().getRandomValues(r);for(const s of r)n.push(e[s%e.length]);return n.join("")};function xW(t){return(t.match(/.{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("")}function AW(t){return t.split("").map(e=>e.charCodeAt(0).toString(16).padStart(2,"0")).join("")}const TW=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 qN({expiresAt:t,clockDrift:e,tolerance:n=5e3}){return Date.now()+e+n>t}const RW=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 IW(t){return Array.from(t,e=>String.fromCodePoint(e)).join("")}const Nc={convert(t,e={urlSafe:!1,skipPadding:!1}){const n=typeof t=="string"?t:IW(t);let r=O$()(n);return e.urlSafe&&(r=r.replace(/\+/g,"-").replace(/\//g,"_")),e.skipPadding&&(r=r.replace(/=/g,"")),r}};function OW(){return bA().getRandomValues(new Uint32Array(1))[0]}function NW(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 _A{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(OW());return new _A(n,e)}toString(){return NW(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 r5={[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 Fn;(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"})(Fn||(Fn={}));var To;(function(t){t.SignInException="SignInException",t.OAuthSignInError="OAuthSignInException"})(To||(To={}));class Le extends jr{constructor(e){super(e),this.constructor=Le,Object.setPrototypeOf(this,Le.prototype)}}function fn(t,e){const{message:n,recoverySuggestion:r}=r5[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 C_(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 WN(t){return Object.entries(t).map(([e,n])=>({Name:e,Value:n}))}function MW(t){const e={};return t?.forEach(n=>{n.Name&&(e[n.Name]=n.Value)}),e}var GN;(function(t){t.ConcurrentModificationException="ConcurrentModificationException",t.ForbiddenException="ForbiddenException",t.InternalErrorException="InternalErrorException",t.InvalidParameterException="InvalidParameterException",t.NotAuthorizedException="NotAuthorizedException",t.ResourceNotFoundException="ResourceNotFoundException",t.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException"})(GN||(GN={}));var VN;(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"})(VN||(VN={}));var KN;(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"})(KN||(KN={}));var YN;(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"})(YN||(YN={}));var ZN;(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"})(ZN||(ZN={}));var XN;(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"})(XN||(XN={}));var QN;(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"})(QN||(QN={}));var JN;(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"})(JN||(JN={}));var eM;(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"})(eM||(eM={}));var tM;(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"})(tM||(tM={}));var nM;(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"})(nM||(nM={}));var rM;(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"})(rM||(rM={}));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.PasswordResetRequiredException="PasswordResetRequiredException",t.ResourceNotFoundException="ResourceNotFoundException",t.TooManyRequestsException="TooManyRequestsException",t.UnexpectedLambdaException="UnexpectedLambdaException",t.UserLambdaValidationException="UserLambdaValidationException",t.UserNotConfirmedException="UserNotConfirmedException",t.UserNotFoundException="UserNotFoundException"})(sM||(sM={}));var oM;(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"})(oM||(oM={}));var hv;(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"})(hv||(hv={}));var iM;(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"})(iM||(iM={}));var aM;(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"})(aM||(aM={}));var lM;(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"})(lM||(lM={}));var w_;(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"})(w_||(w_={}));var uM;(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"})(uM||(uM={}));var cM;(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"})(cM||(cM={}));var dM;(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"})(dM||(dM={}));var fM;(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"})(fM||(fM={}));var hM;(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"})(hM||(hM={}));const by="UserUnAuthenticatedException",PW="UserAlreadyAuthenticatedException",kW="DeviceMetadataNotFoundException",s5="AutoSignInException",DW="InvalidRedirectException",LW="InvalidAppSchemeException",UW="InvalidPreferredRedirectUrlException",FW=new Le({name:DW,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:LW,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:UW,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 zW="InvalidOriginException",BW=new Le({name:zW,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."}),jW="OAuthSignOutException",HW="TokenRefreshException",$W="UnexpectedSignInInterruptionException";function ed(t){if(!t||!t.accessToken)throw new Le({name:by,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}function qW(t){if(!t||!t.idToken)throw new Le({name:by,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}const WW=new Le({name:HW,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' }`}),GW=new Le({name:by,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function o5(t){if(YW(t))throw WW;if(!KW(t))throw GW}function i5(t){if(!t||!t.deviceKey||!t.deviceGroupKey||!t.randomPassword)throw new Le({name:kW,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 VW={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function a5(t){return t?.accessToken||t?.idToken}function KW(t){return a5(t)&&t?.refreshToken}function YW(t){return a5(t)&&!t?.refreshToken}const ZW=async t=>{const e=t.getConfig().Auth?.Cognito;lt(e);const n=await t.Auth.getTokens({forceRefresh:!1});ed(n);const{"cognito:username":r,sub:s}=n.idToken?.payload??{},o={username:r,userId:s},a=XW(n);return a&&(o.signInDetails=a),o};function XW(t){return t?.signInDetails}const Sy=async()=>ZW(Ht),Nt=(t,e)=>gy({category:Rs.Auth,action:t,...e}),Bn=t=>(e,n)=>{const r=QW(t),s=JSON.stringify(e);return JW(n,r,s)},QW=t=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProviderService.${t}`}),JW=({url:t},e,n)=>({headers:e,url:t,body:n,method:"POST"});function Is(t){if(!t||t.name==="Error"||t instanceof TypeError)throw new Le({name:Pa.Unknown,message:"An unknown error has occurred.",underlyingError:t})}const or=()=>async t=>{if(t.statusCode>=300){const e=await Jc(t);throw Is(e),new Le({name:e.name,message:e.message,metadata:e.$metadata})}return Wh(t)},eG=()=>(t,e)=>async function(r){return r.headers={...r.headers,"cache-control":"no-store",...await Ht.libraryOptions?.Auth?.headers?.()},t(r)},jn=wA(V6,[eG]),l5="cognito-idp",Hn={service:l5,retryDecider:q6(Jc),computeDelay:$6,get userAgentValue(){return gy()},cache:"no-store"},Vh=t=>Rn(jn,Bn("InitiateAuth"),or(),{...Hn,...t}),is=t=>Rn(jn,Bn("RespondToAuthChallenge"),or(),{...Hn,...t}),tG=t=>Rn(jn,Bn("VerifySoftwareToken"),or(),{...Hn,...t}),nG=t=>Rn(jn,Bn("AssociateSoftwareToken"),or(),{...Hn,...t}),rG=({region:t})=>({url:new Wa(`https://${l5}.${t}.${X6(t)}`)}),bt=({endpointOverride:t})=>e=>t?{url:new Wa(t)}:rG(e),sG=t=>Rn(jn,Bn("GetTokensFromRefreshToken"),or(),{...Hn,...t}),oG=async({tokens:t,authConfig:e,username:n,clientMetadata:r})=>{lt(e?.Cognito);const{userPoolId:s,userPoolClientId:o,userPoolEndpoint:a}=e.Cognito,u=yt(s);o5(t);const c=sG({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}},iG=TW(oG),aG={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetails:"signInDetails",oauthMetadata:"oauthMetadata"};var pv;(function(t){t.InvalidAuthTokens="InvalidAuthTokens"})(pv||(pv={}));const lG={[pv.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},uG=fy(lG),pM="CognitoIdentityServiceProvider";class cG{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){uG(e!==void 0,pv.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 dG(pM,`${this.authConfig.Cognito.userPoolClientId}.${n}`)}getLastAuthUserKey(){lt(this.authConfig?.Cognito);const e=this.authConfig.Cognito.userPoolClientId;return`${pM}.${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 dG=(t,e)=>xA(aG)(`${t}`,e);function xA(t){const e=Object.values({...t});return(n,r)=>e.reduce((s,o)=>({...s,[o]:`${n}.${r}.${o}`}),{})}const gM="amplify-signin-with-hostedUI",ho="CognitoIdentityServiceProvider";class u5{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(gM),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(gM),[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)=>xA(VW)(t,e),Lr=new u5(Gh),__=[],fG=t=>{__.push(t)},c5=()=>{for(;__.length;)__.pop()?.()};class hG{constructor(){this.waitForInflightOAuth=my()?async()=>{if(await Lr.loadOAuthInFlight())return this.inflightPromise?this.inflightPromise:(this.inflightPromise=new Promise((e,n)=>{fG(e)}),this.inflightPromise)}:async()=>{}}setAuthConfig(e){Lr.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&&qN({expiresAt:(n.idToken?.payload?.exp??0)*1e3,clockDrift:n.clockDrift??0}),o=qN({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",xo),o}catch(s){return this.handleErrors(s)}}handleErrors(e){if(Is(e),this.isAuthenticationError(e)&&this.clearTokens(),Ao.dispatch("auth",{event:"tokenRefresh_failure",data:{error:e}},"Auth",xo),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 pG{constructor(){this.authTokenStore=new cG,this.authTokenStore.setKeyValueStorage(Gh),this.tokenOrchestrator=new hG,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(iG)}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 Fm=new pG,{tokenOrchestrator:Hr}=Fm;async function xi(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 Hr.setTokens({tokens:c})}else throw new jr({message:"Invalid tokens",name:"InvalidTokens",recoverySuggestion:"Check Cognito UserPool settings"})}const gG="Unable to get user session following successful sign-in.",Ga=async()=>{try{Ao.dispatch("auth",{event:"signedIn",data:await Sy()},"Auth",xo)}catch(t){throw t.name===by?new Le({name:$W,message:gG,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 d5(){return{active:!1}}const mG=(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 d5();default:return t}},vG=t=>{let e=t(d5(),{type:"RESET"});return{getState:()=>e,dispatch:n=>{e=t(e,n)}}},Aa=vG(mG),yG=180*1e3,kg="CognitoSignInState",di={username:`${kg}.username`,challengeName:`${kg}.challengeName`,signInSession:`${kg}.signInSession`,expiry:`${kg}.expiry`},bG=(t,e)=>{switch(e.type){case"SET_SIGN_IN_SESSION":return Dg({signInSession:e.value}),{...t,signInSession:e.value};case"SET_SIGN_IN_STATE":return Dg(e.value),{...e.value};case"SET_CHALLENGE_NAME":return Dg({challengeName:e.value}),{...t,challengeName:e.value};case"SET_USERNAME":return Dg({username:e.value}),{...t,username:e.value};case"SET_INITIAL_STATE":return EG();case"RESET_STATE":return f5(),AA();default:return t}},SG=t=>{const e=Number(t),n=Date.now();return e<=n},Qs=()=>{Ro.dispatch({type:"RESET_STATE"})},f5=()=>{for(const t of Object.values(di))ci.removeItem(t)},AA=()=>({username:void 0,challengeName:void 0,signInSession:void 0}),EG=()=>{const t=ci.getItem(di.expiry);if(!t||SG(t))return f5(),AA();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}},CG=t=>{let e=t(AA(),{type:"SET_INITIAL_STATE"});return{getState:()=>e,dispatch:n=>{e=t(e,n)}}},Ro=CG(bG);function Zl(t){Ro.dispatch({type:"SET_SIGN_IN_STATE",value:t})}const Dg=({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()+yG)))},mM="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 Ts extends jr{constructor(e){super(e),this.constructor=Ts,Object.setPrototypeOf(this,Ts.prototype)}}var Bt;(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"})(Bt||(Bt={}));const N1="User may have canceled the ceremony or another interruption has occurred. Check underlying error for details.",vM="Ensure your user pool is configured to support the WEB_AUTHN as an authentication factor.",Mc={[Bt.PasskeyNotSupported]:{message:"Passkeys may not be supported on this device.",recoverySuggestion:mM},[Bt.InvalidPasskeyRegistrationOptions]:{message:"Invalid passkey registration options.",recoverySuggestion:vM},[Bt.InvalidPasskeyAuthenticationOptions]:{message:"Invalid passkey authentication options.",recoverySuggestion:vM},[Bt.PasskeyRegistrationFailed]:{message:"Device failed to create passkey.",recoverySuggestion:mM},[Bt.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."},[Bt.PasskeyAlreadyExists]:{message:"Passkey already exists in authenticator.",recoverySuggestion:"Proceed with existing passkey or try again after deleting the credential."},[Bt.PasskeyRegistrationCanceled]:{message:"Passkey registration ceremony has been canceled.",recoverySuggestion:N1},[Bt.PasskeyAuthenticationCanceled]:{message:"Passkey authentication ceremony has been canceled.",recoverySuggestion:N1},[Bt.PasskeyOperationAborted]:{message:"Passkey operation has been aborted.",recoverySuggestion:N1},[Bt.RelyingPartyMismatch]:{message:"Relying party does not match current domain.",recoverySuggestion:"Ensure relying party identifier matches current domain."}},td=fy(Mc,Ts),h5=t=>{if(t instanceof Error){if(t.name==="AbortError"){const{message:e,recoverySuggestion:n}=Mc[Bt.PasskeyOperationAborted];return new Ts({name:Bt.PasskeyOperationAborted,message:e,recoverySuggestion:n,underlyingError:t})}if(t.name==="SecurityError"){const{message:e,recoverySuggestion:n}=Mc[Bt.RelyingPartyMismatch];return new Ts({name:Bt.RelyingPartyMismatch,message:e,recoverySuggestion:n,underlyingError:t})}}return new Ts({name:Pa.Unknown,message:"An unknown error has occurred.",underlyingError:t})},wG=t=>{if(t instanceof Ts)return t;if(t instanceof Error&&t.name==="NotAllowedError"){const{message:e,recoverySuggestion:n}=Mc[Bt.PasskeyAuthenticationCanceled];return new Ts({name:Bt.PasskeyAuthenticationCanceled,message:e,recoverySuggestion:n,underlyingError:t})}return h5(t)},p5=()=>my()&&window.isSecureContext&&"credentials"in navigator&&typeof window.PublicKeyCredential=="function",Co=t=>Nc.convert(new Uint8Array(t),{urlSafe:!0,skipPadding:!0}),eh=t=>Uint8Array.from(SA.convert(t,{urlSafe:!0}),e=>e.charCodeAt(0)).buffer,_G=t=>{const e=eh(t.user.id),n=eh(t.challenge),r=(t.excludeCredentials||[]).map(s=>({...s,id:eh(s.id)}));return{...t,excludeCredentials:r,challenge:n,user:{...t.user,id:e}}},xG=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},AG=t=>{const e=eh(t.challenge),n=(t.allowCredentials||[]).map(r=>({...r,id:eh(r.id)}));return{...t,challenge:e,allowCredentials:n}},TG=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 RG(t){td([!!t,!!t?.challenge,!!t?.user,!!t?.rp,!!t?.pubKeyCredParams].every(Boolean),Bt.InvalidPasskeyRegistrationOptions)}function IG(t){td(t&&t instanceof PublicKeyCredential&&t.response instanceof AuthenticatorAttestationResponse,Bt.PasskeyRegistrationFailed)}function OG(t){td(t&&t instanceof PublicKeyCredential&&t.response instanceof AuthenticatorAssertionResponse,Bt.PasskeyRetrievalFailed)}const NG=async t=>{try{const e=p5();td(e,Bt.PasskeyNotSupported);const n=AG(t),r=await navigator.credentials.get({publicKey:n});return OG(r),TG(r)}catch(e){throw wG(e)}},MG=t=>Rn(jn,Bn("ConfirmDevice"),or(),{...Hn,...t}),zm={convert(t){return new TextEncoder().encode(t)}};function Ie(t,e){t!=null&&this.fromString(t,e)}function Cr(){return new Ie(null,null)}let Ia;const PG=0xdeadbeefcafe,yM=(PG&16777215)===15715070;function kG(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 DG(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 LG(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 bM=typeof navigator<"u";bM&&yM&&navigator.appName==="Microsoft Internet Explorer"?(Ie.prototype.am=DG,Ia=30):bM&&yM&&navigator.appName!=="Netscape"?(Ie.prototype.am=kG,Ia=26):(Ie.prototype.am=LG,Ia=28);Ie.prototype.DB=Ia;Ie.prototype.DM=(1<<Ia)-1;Ie.prototype.DV=1<<Ia;const TA=52;Ie.prototype.FV=Math.pow(2,TA);Ie.prototype.F1=TA-Ia;Ie.prototype.F2=2*Ia-TA;const UG="0123456789abcdefghijklmnopqrstuvwxyz",Ey=[];let nd,xs;nd=48;for(xs=0;xs<=9;++xs)Ey[nd++]=xs;nd=97;for(xs=10;xs<36;++xs)Ey[nd++]=xs;nd=65;for(xs=10;xs<36;++xs)Ey[nd++]=xs;function SM(t){return UG.charAt(t)}function FG(t,e){const n=Ey[t.charCodeAt(e)];return n??-1}function zG(t){for(let e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function BG(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 RA(t){const e=Cr();return e.fromInt(t),e}function jG(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=FG(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 HG(){const t=this.s&this.DM;for(;this.t>0&&this[this.t-1]==t;)--this.t}function $G(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=SM(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+=SM(r));return s?o:"0"}function qG(){const t=Cr();return Ie.ZERO.subTo(this,t),t}function WG(){return this.s<0?this.negate():this}function GG(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 IA(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 VG(){return this.t<=0?0:this.DB*(this.t-1)+IA(this[this.t-1]^this.s&this.DM)}function KG(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 YG(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 ZG(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 XG(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 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<-1?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()}function JG(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 eV(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 tV(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=Cr());const o=Cr(),a=this.s,u=t.s,c=this.DB-IA(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?Cr():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 x=n[--E]===p?this.DM:Math.floor(n[E]*m+(n[E-1]+S)*y);if((n[E]+=o.am(0,x,n,C,0,f))<x)for(o.dlShiftTo(C,w),n.subTo(w,n);n[E]<--x;)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 nV(t){const e=Cr();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(Ie.ZERO)>0&&t.subTo(e,e),e}function rV(){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 sV(t){return this.compareTo(t)===0}function oV(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 iV(t){const e=Cr();return this.addTo(t,e),e}function aV(t){const e=Cr();return this.subTo(t,e),e}function lV(t){const e=Cr();return this.multiplyTo(t,e),e}function uV(t){const e=Cr();return this.divRemTo(t,e,null),e}function rd(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 cV(t){const e=Cr();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 dV(t){const e=Cr();return t.copyTo(e),this.reduce(e),e}function fV(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 hV(t,e){t.squareTo(e),this.reduce(e)}function pV(t,e,n){t.multiplyTo(e,n),this.reduce(n)}rd.prototype.convert=cV;rd.prototype.revert=dV;rd.prototype.reduce=fV;rd.prototype.mulTo=pV;rd.prototype.sqrTo=hV;function gV(t,e,n){let r=t.bitLength(),s,o=RA(1);const a=new rd(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=Cr();for(a.sqrTo(u[1],w);c<=p;)u[c]=Cr(),a.mulTo(w,u[c-2],u[c]),c+=2}let g=t.t-1,m,y=!0,S=Cr(),E;for(r=IA(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=zG;Ie.prototype.fromInt=BG;Ie.prototype.fromString=jG;Ie.prototype.clamp=HG;Ie.prototype.dlShiftTo=KG;Ie.prototype.drShiftTo=YG;Ie.prototype.lShiftTo=ZG;Ie.prototype.rShiftTo=XG;Ie.prototype.subTo=QG;Ie.prototype.multiplyTo=JG;Ie.prototype.squareTo=eV;Ie.prototype.divRemTo=tV;Ie.prototype.invDigit=rV;Ie.prototype.addTo=oV;Ie.prototype.toString=$G;Ie.prototype.negate=qG;Ie.prototype.abs=WG;Ie.prototype.compareTo=GG;Ie.prototype.bitLength=VG;Ie.prototype.mod=nV;Ie.prototype.equals=sV;Ie.prototype.add=iV;Ie.prototype.subtract=aV;Ie.prototype.multiply=lV;Ie.prototype.divide=uV;Ie.prototype.modPow=gV;Ie.ZERO=RA(0);Ie.ONE=RA(1);const mV=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))})})}),vV="FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",g5={},x_={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),g5[t]=e,x_[e]=t}const Pc=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 x_)e[n/2]=x_[r];else throw new Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`)}return e},OA=t=>{let e="";for(let n=0;n<t.byteLength;n++)e+=g5[t[n]];return e},A_=t=>{const e=new Ul;e.update(t);const n=e.digestSync(),r=OA(n);return new Array(64-r.length).join("0")+r},Bm=t=>A_(Pc(t)),yV=/^[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=yV.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},bV=({A:t,B:e})=>{const n=new Ie(Bm(ii(t)+ii(e)),16);if(n.equals(Ie.ZERO))throw new Error("U cannot be zero.");return n},SV=(t,e,n)=>{const r=new Ul(e);r.update(t);const s=r.digestSync(),o=new Ul(s);return o.update(n),o.digestSync().slice(0,16)},NA=t=>{const e=new _A().random(t).toString();return Pc(e)},EV=()=>Nc.convert(NA(40));class CV{constructor({userPoolName:e,a:n,g:r,A:s,N:o}){this.encoder=zm,this.userPoolName=e,this.a=n,this.g=r,this.A=s,this.N=o,this.k=new Ie(Bm(`${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=EV();const r=`${e}${n}:${this.randomPassword}`,s=A_(r),o=OA(NA(16));return this.saltToHashDevices=ii(new Ie(o,16)),new Promise((a,u)=>{this.g.modPow(new Ie(Bm(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=bV({A:this.A,B:r}),a=`${this.userPoolName}${e}:${n}`,u=A_(a),c=new Ie(Bm(ii(s)+u),16),f=await mV({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),SV(Pc(ii(f)),Pc(ii(o)),m)}}const wV=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)})}),Kh=async t=>{const e=new Ie(vV,16),n=new Ie("2",16),r=_V(),s=await wV({a:r,g:n,N:e});return new CV({userPoolName:t,a:r,g:n,A:s,N:e})},_V=()=>{const t=OA(NA(128));return new Ie(t,16)};async function Xl({userPoolId:t,userPoolEndpoint:e,newDeviceMetadata:n,accessToken:r}){if(!n)return;const s=t.split("_")[1]||"",o=await Kh(s),a=n?.DeviceKey,u=n?.DeviceGroupKey;try{await o.generateHashDevice(u??"",a??"")}catch{return}const c={Salt:Nc.convert(Pc(o.getSaltToHashDevices())),PasswordVerifier:Nc.convert(Pc(o.getVerifierDevices()))},f=o.getRandomPassword();try{return await MG({endpointResolver:bt({endpointOverride:e})})({region:yt(t)},{AccessToken:r,DeviceName:await RW(),DeviceKey:n?.DeviceKey,DeviceSecretVerifierConfig:c}),{deviceKey:a,deviceGroupKey:u,randomPassword:f}}catch{return}}async function xV(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;td(!!a,Bt.InvalidPasskeyAuthenticationOptions);const u=await NG(JSON.parse(a)),c=is({endpointResolver:bt({endpointOverride:e.userPoolEndpoint})}),{ChallengeName:f,ChallengeParameters:p,AuthenticationResult:g,Session:m}=await c({region:yt(e.userPoolId),userAgentValue:Nt(Ve.ConfirmSignIn)},{ChallengeName:"WEB_AUTHN",ChallengeResponses:{USERNAME:n,CREDENTIAL:JSON.stringify(u)},ClientId:e.userPoolClientId,Session:r});if(Zl({signInSession:m,username:n,challengeName:f,signInDetails:s}),g)return await xi({...g,username:n,NewDeviceMetadata:await Xl({userPoolId:e.userPoolId,userPoolEndpoint:e.userPoolEndpoint,newDeviceMetadata:g.NewDeviceMetadata,accessToken:g.AccessToken}),signInDetails:s}),Ro.dispatch({type:"RESET_STATE"}),await Ga(),{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 $n({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 AV=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],TV=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],m5=()=>{const t=new Date,e=TV[t.getUTCDay()],n=AV[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}`},v5=({userPoolName:t,username:e,challengeParameters:n,dateNow:r,hkdf:s})=>{const o=zm.convert(t),a=zm.convert(e),u=RV(n.SECRET_BLOCK),c=zm.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 Ul(s);p.update(f);const g=p.digestSync();return Nc.convert(g)},RV=t=>{const e="=".repeat((4-t.length%4)%4),n=(t+e).replace(/-/g,"+").replace(/_/g,"/"),r=SA.convert(n),s=new Uint8Array(r.length);for(let o=0;o<r.length;++o)s[o]=r.charCodeAt(o);return s};async function Yh({username:t,config:e,clientMetadata:n,session:r,tokenOrchestrator:s}){const{userPoolId:o,userPoolEndpoint:a}=e,u=e.userPoolClientId,c=await s?.getDeviceMetadata(t);i5(c);const f=await Kh(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=is({endpointResolver:bt({endpointOverride:a})}),{ChallengeParameters:y,Session:S}=await m({region:yt(o)},g);return IV(t,y,n,S,f,e,s)}async function IV(t,e,n,r,s,{userPoolId:o,userPoolClientId:a,userPoolEndpoint:u},c){const f=await c?.getDeviceMetadata(t);i5(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=m5(),C={USERNAME:e?.USERNAME??t,PASSWORD_CLAIM_SECRET_BLOCK:e?.SECRET_BLOCK,TIMESTAMP:E,PASSWORD_CLAIM_SIGNATURE:v5({username:m,userPoolName:y,challengeParameters:e,dateNow:E,hkdf:S}),DEVICE_KEY:m},w=$n({username:t,userPoolId:o,userPoolClientId:a}),x={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:a,ChallengeResponses:C,Session:r,ClientMetadata:n,UserContextData:w};return is({endpointResolver:bt({endpointOverride:u})})({region:yt(o)},x)}async function MA(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=m5(),C={USERNAME:y,PASSWORD_CLAIM_SECRET_BLOCK:e?.SECRET_BLOCK,TIMESTAMP:E,PASSWORD_CLAIM_SIGNATURE:v5({username:y,userPoolName:p,challengeParameters:e,dateNow:E,hkdf:S})},w=await a.getDeviceMetadata(y);w&&w.deviceKey&&(C.DEVICE_KEY=w.deviceKey);const x=$n({username:y,userPoolId:u,userPoolClientId:c}),T={ChallengeName:"PASSWORD_VERIFIER",ChallengeResponses:C,ClientMetadata:n,Session:r,ClientId:c,UserContextData:x},M=await is({endpointResolver:bt({endpointOverride:f})})({region:yt(u)},T);return M.ChallengeName==="DEVICE_SRP_AUTH"?Yh({username:y,config:o,clientMetadata:n,session:M.Session,tokenOrchestrator:a}):M}async function sd(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 Ql(t){const{dispatch:e}=Ro;e({type:"SET_USERNAME",value:t})}async function y5({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 Kh(p),m={USERNAME:t,SRP_A:g.A.toString(16)};o==="USER_AUTH"&&a&&(m.PREFERRED_CHALLENGE=a);const y=$n({username:t,userPoolId:u,userPoolClientId:c}),S={AuthFlow:o,AuthParameters:m,ClientMetadata:n,ClientId:c,UserContextData:y},C=await Vh({endpointResolver:bt({endpointOverride:f})})({region:yt(u),userAgentValue:Nt(Ve.SignIn)},S),{ChallengeParameters:w,Session:x}=C,T=w?.USERNAME??t;return Ql(T),C.ChallengeName==="PASSWORD_VERIFIER"?sd(MA,[e,w,n,x,g,r,s],T,s):C}async function OV({username:t,session:e,selectedChallenge:n,config:r,clientMetadata:s}){return is({endpointResolver:bt({endpointOverride:r.userPoolEndpoint})})({region:yt(r.userPoolId),userAgentValue:Nt(Ve.ConfirmSignIn)},{ChallengeName:"SELECT_CHALLENGE",ChallengeResponses:{USERNAME:t,ANSWER:n},ClientId:r.userPoolClientId,Session:e,ClientMetadata:s})}async function NV(t,e,n,r,s){const{userPoolId:o,userPoolClientId:a,userPoolEndpoint:u}=r,c={ANSWER:"PASSWORD",USERNAME:t,PASSWORD:e},f=$n({username:t,userPoolId:o,userPoolClientId:a}),g=await is({endpointResolver:bt({endpointOverride:u})})({region:yt(o),userAgentValue:Nt(Ve.ConfirmSignIn)},{ChallengeName:"SELECT_CHALLENGE",ChallengeResponses:c,ClientId:a,ClientMetadata:n,Session:s,UserContextData:f}),m=g.ChallengeParameters?.USERNAME??t;return Ql(m),g}async function MV(t,e,n,r,s,o){const{userPoolId:a,userPoolClientId:u,userPoolEndpoint:c}=r,f=a.split("_")[1]||"",p=await Kh(f),g={ANSWER:"PASSWORD_SRP",USERNAME:t,SRP_A:p.A.toString(16)},m=$n({username:t,userPoolId:a,userPoolClientId:u}),S=await is({endpointResolver:bt({endpointOverride:c})})({region:yt(a),userAgentValue:Nt(Ve.ConfirmSignIn)},{ChallengeName:"SELECT_CHALLENGE",ChallengeResponses:g,ClientId:u,ClientMetadata:n,Session:s,UserContextData:m}),E=S.ChallengeParameters?.USERNAME??t;return Ql(E),S.ChallengeName==="PASSWORD_VERIFIER"?sd(MA,[e,S.ChallengeParameters,n,S.Session,p,r,o],E,o):S}const T_="userAttributes.";function PV(t){return"isSignedIn"in t&&"nextStep"in t}async function kV({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=$n({username:r,userPoolId:a,userPoolClientId:u}),m={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:f,Session:n,ClientMetadata:e,ClientId:u,UserContextData:g},S=await is({endpointResolver:bt({endpointOverride:c})})({region:yt(a),userAgentValue:Nt(Ve.ConfirmSignIn)},m);return S.ChallengeName==="DEVICE_SRP_AUTH"?Yh({username:r,config:s,clientMetadata:e,session:S.Session,tokenOrchestrator:o}):S}async function DV({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=tG({endpointResolver:bt({endpointOverride:c})}),{Session:y}=await m({region:yt(a),userAgentValue:Nt(Ve.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 is({endpointResolver:bt({endpointOverride:c})})({region:yt(a),userAgentValue:Nt(Ve.ConfirmSignIn)},S)}if(t.includes("@")){f.EMAIL=t;const m={ChallengeName:"MFA_SETUP",ChallengeResponses:f,Session:r,ClientMetadata:n,ClientId:u};return is({endpointResolver:bt({endpointOverride:c})})({region:yt(a),userAgentValue:Nt(Ve.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 LV({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:GV(t)},f=$n({username:e,userPoolId:o,userPoolClientId:a}),p={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:c,Session:r,ClientMetadata:n,ClientId:a,UserContextData:f};return is({endpointResolver:bt({endpointOverride:u})})({region:yt(o),userAgentValue:Nt(Ve.ConfirmSignIn)},p)}async function UV({challengeResponse:t,clientMetadata:e,session:n,username:r,requiredAttributes:s,config:o}){const{userPoolId:a,userPoolClientId:u,userPoolEndpoint:c}=o,f={...qV(s),NEW_PASSWORD:t,USERNAME:r},p=$n({username:r,userPoolId:a,userPoolClientId:u}),g={ChallengeName:"NEW_PASSWORD_REQUIRED",ChallengeResponses:f,ClientMetadata:e,Session:n,ClientId:u,UserContextData:p};return is({endpointResolver:bt({endpointOverride:c})})({region:yt(a),userAgentValue:Nt(Ve.ConfirmSignIn)},g)}async function FV(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=$n({username:t,userPoolId:a,userPoolClientId:o}),g={AuthFlow:"USER_PASSWORD_AUTH",AuthParameters:c,ClientMetadata:n,ClientId:o,UserContextData:p},y=await Vh({endpointResolver:bt({endpointOverride:u})})({region:yt(a),userAgentValue:Nt(Ve.SignIn)},g),S=y.ChallengeParameters?.USERNAME??y.ChallengeParameters?.USER_ID_FOR_SRP??t;return Ql(S),y.ChallengeName==="DEVICE_SRP_AUTH"?Yh({username:S,config:r,clientMetadata:n,session:y.Session,tokenOrchestrator:s}):y}async function zV(t,e,n,r,s){return y5({username:t,password:e,clientMetadata:n,config:r,tokenOrchestrator:s,authFlow:"USER_SRP_AUTH"})}async function BV(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=$n({username:t,userPoolId:o,userPoolClientId:s}),p={AuthFlow:"CUSTOM_AUTH",AuthParameters:u,ClientMetadata:e,ClientId:s,UserContextData:f},m=await Vh({endpointResolver:bt({endpointOverride:a})})({region:yt(o),userAgentValue:Nt(Ve.SignIn)},p),y=m.ChallengeParameters?.USERNAME??t;return Ql(y),m.ChallengeName==="DEVICE_SRP_AUTH"?Yh({username:y,config:n,clientMetadata:e,session:m.Session,tokenOrchestrator:r}):m}async function jV(t,e,n,r,s){lt(r);const{userPoolId:o,userPoolClientId:a,userPoolEndpoint:u}=r,c=o?.split("_")[1]||"",f=await Kh(c),p={USERNAME:t,SRP_A:f.A.toString(16),CHALLENGE_NAME:"SRP_A"},g=$n({username:t,userPoolId:o,userPoolClientId:a}),m={AuthFlow:"CUSTOM_AUTH",AuthParameters:p,ClientMetadata:n,ClientId:a,UserContextData:g},y=Vh({endpointResolver:bt({endpointOverride:u})}),{ChallengeParameters:S,Session:E}=await y({region:yt(o),userAgentValue:Nt(Ve.SignIn)},m),C=S?.USERNAME??t;return Ql(C),sd(MA,[e,S,n,E,f,r,s],C,s)}async function Jl(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=EM(CM(n.MFAS_CAN_SETUP))||[],c=KV(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=nG({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:HV(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:$V(n.requiredAttributes)}};case"SELECT_MFA_TYPE":return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_MFA_SELECTION",allowedMFATypes:EM(CM(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 xV(n);return PV(o)?o:Jl(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 HV(t,e){return{sharedSecret:t,getSetupUri:(n,r)=>{const s=`otpauth://totp/${n}:${r??e}?secret=${t}&issuer=${n}`;return new Wa(s)}}}function od(t){if(t===hv.PasswordResetRequiredException)return{isSignedIn:!1,nextStep:{signInStep:"RESET_PASSWORD"}};if(t===hv.UserNotConfirmedException)return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_UP"}}}function $V(t){return t?JSON.parse(t).map(n=>n.includes(T_)?n.replace(T_,""):n):[]}function qV(t){if(!t)return{};const e={};return Object.entries(t).forEach(([n,r])=>{r&&(e[`${T_}${n}`]=r)}),e}async function WV(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:{}}:OV({username:t,session:n,selectedChallenge:r,config:s,clientMetadata:a});case"SELECT_MFA_TYPE":return LV({challengeResponse:r,clientMetadata:a,session:n,username:t,config:s});case"MFA_SETUP":return DV({challengeResponse:r,clientMetadata:a,session:n,username:t,deviceName:f,config:s});case"NEW_PASSWORD_REQUIRED":return UV({challengeResponse:r,clientMetadata:a,session:n,username:t,requiredAttributes:c,config:s});case"CUSTOM_CHALLENGE":return sd(kV,[{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 YV({challengeName:e,challengeResponse:r,clientMetadata:a,session:n,username:t,config:s,tokenOrchestrator:o});case"PASSWORD":return NV(t,r,a,s,n);case"PASSWORD_SRP":return MV(t,r,a,s,n,o)}throw new Le({name:To.SignInException,message:`An error occurred during the sign in process.
|
|
@@ -9,7 +9,7 @@ function N6(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&
|
|
|
9
9
|
1. signIn was not called before confirmSignIn.
|
|
10
10
|
2. signIn threw an exception.
|
|
11
11
|
3. page was refreshed during the sign in flow and session has expired.
|
|
12
|
-
`,recoverySuggestion:"Make sure a successful call to signIn is made before calling confirmSignInand that the session has not expired."});try{const{Session:f,ChallengeName:p,AuthenticationResult:g,ChallengeParameters:m}=await WV(r,s,o,e,u,Hr,c,n);return Zl({signInSession:f,username:r,challengeName:p,signInDetails:a}),g?(await xi({username:r,...g,NewDeviceMetadata:await Xl({userPoolId:u.userPoolId,userPoolEndpoint:u.userPoolEndpoint,newDeviceMetadata:g.NewDeviceMetadata,accessToken:g.AccessToken}),signInDetails:a}),Qs(),await Ga(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):Jl({challengeName:p,challengeParameters:m})}catch(f){Is(f);const p=od(f.name);if(p)return p;throw f}}const vK=t=>Rn(jn,Bn("GetUser"),or(),{...Hn,...t}),yK=t=>Rn(jn,Bn("VerifyUserAttribute"),or(),{...Hn,...t});async function bK(t){const e=Ht.getConfig().Auth?.Cognito;lt(e);const{userPoolEndpoint:n,userPoolId:r}=e,{confirmationCode:s,userAttributeKey:o}=t;fn(!!s,Ge.EmptyConfirmUserAttributeCode);const{tokens:a}=await vy({forceRefresh:!1});ed(a),await yK({endpointResolver:bt({endpointOverride:n})})({region:yt(r),userAgentValue:Nt(Ve.ConfirmUserAttribute)},{AccessToken:a.accessToken.toString(),AttributeName:o,Code:s})}new nr("AuthError");const SK={oauthSignInError:{message:Fn.OAUTH_ERROR,log:"Make sure Cognito Hosted UI has been configured correctly"},noConfig:{message:Fn.DEFAULT_MSG},missingAuthConfig:{message:Fn.DEFAULT_MSG},emptyUsername:{message:Fn.EMPTY_USERNAME},invalidUsername:{message:Fn.INVALID_USERNAME},emptyPassword:{message:Fn.EMPTY_PASSWORD},emptyCode:{message:Fn.EMPTY_CODE},signUpError:{message:Fn.SIGN_UP_ERROR},noMFA:{message:Fn.NO_MFA},invalidMFA:{message:Fn.INVALID_MFA},emptyChallengeResponse:{message:Fn.EMPTY_CHALLENGE},noUserSession:{message:Fn.NO_USER_SESSION},deviceConfig:{message:Fn.DEVICE_CONFIG},networkError:{message:Fn.NETWORK_ERROR},autoSignInError:{message:Fn.AUTOSIGNIN_ERROR},default:{message:Fn.DEFAULT_MSG}},ka=(t,e)=>new Le({message:t??"An error has occurred during the oauth process.",name:To.OAuthSignInError,recoverySuggestion:SK.oauthSignInError.log});var I_;(function(t){t.NoConfig="noConfig",t.MissingAuthConfig="missingAuthConfig",t.EmptyUsername="emptyUsername",t.InvalidUsername="invalidUsername",t.EmptyPassword="emptyPassword",t.EmptyCode="emptyCode",t.SignUpError="signUpError",t.NoMFA="noMFA",t.InvalidMFA="invalidMFA",t.EmptyChallengeResponse="emptyChallengeResponse",t.NoUserSession="noUserSession",t.Default="default",t.DeviceConfig="deviceConfig",t.NetworkError="networkError",t.AutoSignInError="autoSignInError",t.OAuthSignInError="oauthSignInError"})(I_||(I_={}));const EK="`signInWithRedirect` has been canceled.",CK="An error occurred while validating the state.",wK="Try to initiate an OAuth flow from Amplify",T5=async t=>{const e=await Lr.loadOAuthState(),n=t===e?e:void 0;if(!n)throw new Le({name:I_.OAuthSignInError,message:t===null?EK:CK,recoverySuggestion:t===null?void 0:wK});return n},R5=async({currentUrl:t,userAgentValue:e,clientId:n,redirectUri:r,responseType:s,domain:o,preferPrivateSession:a})=>{const u=new Wa(t),c=u.searchParams.get("error"),f=u.searchParams.get("error_description");if(c)throw ka(f??c);return s==="code"?_K({currentUrl:t,userAgentValue:e,clientId:n,redirectUri:r,domain:o,preferPrivateSession:a}):xK({currentUrl:t,redirectUri:r,preferPrivateSession:a})},_K=async({currentUrl:t,userAgentValue:e,clientId:n,redirectUri:r,domain:s,preferPrivateSession:o})=>{const a=new Wa(t),u=a.searchParams.get("code"),c=a.searchParams.get("state");if(!u||!c)throw ka("User cancelled OAuth flow.");const f=await T5(c),p="https://"+s+"/oauth2/token",g=await Lr.loadPKCE(),m={grant_type:"authorization_code",code:u,client_id:n,redirect_uri:r,...g?{code_verifier:g}:{}},y=Object.entries(m).map(([O,I])=>`${encodeURIComponent(O)}=${encodeURIComponent(I)}`).join("&"),{access_token:S,refresh_token:E,id_token:C,error:w,error_message:x,token_type:T,expires_in:R}=await(await fetch(p,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",[R$]:e},body:y})).json();if(w)throw ka(x??w);const M=(S&&gi(S).payload.username)??"username";return await xi({username:M,AccessToken:S,IdToken:C,RefreshToken:E}),I5({redirectUri:r,state:f,preferPrivateSession:o})},xK=async({currentUrl:t,redirectUri:e,preferPrivateSession:n})=>{const r=new Wa(t),{id_token:s,access_token:o,state:a,token_type:u,expires_in:c,error_description:f,error:p}=(r.hash??"#").substring(1).split("&").map(y=>y.split("=")).reduce((y,[S,E])=>({...y,[S]:E}),{id_token:void 0,access_token:void 0,state:void 0,token_type:void 0,expires_in:void 0,error_description:void 0,error:void 0});if(p)throw ka(f??p);if(!o)throw ka("No access token returned from OAuth flow.");const g=await T5(a),m=(o&&gi(o).payload.username)??"username";return await xi({username:m,AccessToken:o,IdToken:s}),I5({redirectUri:e,state:g,preferPrivateSession:n})},I5=async({redirectUri:t,state:e,preferPrivateSession:n})=>{await Hr.setOAuthMetadata({oauthSignIn:!0}),await Lr.clearOAuthData(),await Lr.storeOAuthSignIn(!0,n),c5(),RK(t),AK(e)&&Ao.dispatch("auth",{event:"customOAuthState",data:xW(TK(e))},"Auth",xo),Ao.dispatch("auth",{event:"signInWithRedirect"},"Auth",xo),await Ga()},AK=t=>/-/.test(t),TK=t=>t.split("-").splice(1).join("-"),RK=t=>{typeof window<"u"&&typeof window.history<"u"&&window.history.replaceState(window.history.state,"",t)};function DA(t,e){{const n=t?.find(IK)??t?.find(OK),r=t?.find(MK)??t?.find(NK);if(n)return n;throw r?BW:FW}}const IK=t=>t.startsWith(String(window.location.origin+(window.location.pathname||"/"))),OK=t=>t.includes(String(window.location.hostname)),NK=t=>t.startsWith("http://"),MK=t=>t.startsWith("https://"),LA=async t=>{c5(),await Lr.clearOAuthInflightData(),Ao.dispatch("auth",{event:"signInWithRedirect_failure",data:{error:t}},"Auth",xo)},PK=async t=>{try{lt(t),hy(t),Lr.setAuthConfig(t)}catch{return}if(await Lr.loadOAuthInFlight())try{const e=window.location.href,{loginWith:n,userPoolClientId:r}=t,{domain:s,redirectSignIn:o,responseType:a}=n.oauth,u=DA(o);await R5({currentUrl:e,clientId:r,domain:s,redirectUri:u,responseType:a,userAgentValue:Nt(Ve.SignInWithRedirect)})}catch(e){await LA(e)}};my()&&Ht[k6](PK);const kK={Google:"Google",Facebook:"Facebook",Amazon:"LoginWithAmazon",Apple:"SignInWithApple"},O5=async t=>{window?.location&&(window.location.href=t.replace("http://","https://"))},_M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",DK=t=>{const e=new Uint8Array(t);bA().getRandomValues(e);let n="",r;for(const s of e)n+=_M.charAt(s%_M.length);return{value:n,method:"S256",toCodeChallenge(){return r||(r=LK(n),r)}}};function LK(t){const e=new Ul;return e.update(t),UK(Nc.convert(e.digestSync(),{urlSafe:!0}))}function UK(t){return t.replace(/=/g,"")}const FK=()=>_W(32),zK=t=>{async function e(n){if(n.persisted&&await t.loadOAuthInFlight()){const s=ka("User cancelled OAuth flow.");await LA(s)}window.removeEventListener("pageshow",e)}window.addEventListener("pageshow",e)};async function N5(t){const e=Ht.getConfig().Auth?.Cognito;lt(e),hy(e),Lr.setAuthConfig(e),t?.options?.prompt||await b5();let n="COGNITO",r;return typeof t?.provider=="string"?n=kK[t.provider]:t?.provider?.custom?n=t.provider.custom:t?.provider?.idpIdentifier&&({idpIdentifier:r}=t.provider),BK({oauthConfig:e.loginWith.oauth,clientId:e.userPoolClientId,provider:n,idpIdentifier:r,customState:t?.customState,preferPrivateSession:t?.options?.preferPrivateSession,options:{loginHint:t?.options?.loginHint,lang:t?.options?.lang,nonce:t?.options?.nonce,prompt:t?.options?.prompt},authSessionOpener:t?.options?.authSessionOpener})}const BK=async({oauthConfig:t,provider:e,idpIdentifier:n,clientId:r,customState:s,preferPrivateSession:o,options:a,authSessionOpener:u})=>{const{domain:c,redirectSignIn:f,responseType:p,scopes:g}=t,{loginHint:m,lang:y,nonce:S,prompt:E}=a??{},C=FK(),w=u||O5,x=s?`${C}-${AW(s)}`:C,{value:T,method:R,toCodeChallenge:M}=DK(128),O=DA(t.redirectSignIn);my()&&Lr.storeOAuthInFlight(!0),Lr.storeOAuthState(x),Lr.storePKCE(T);const I=new URLSearchParams;I.append("redirect_uri",O),I.append("response_type",p),I.append("client_id",r),n?I.append("idp_identifier",n):I.append("identity_provider",e),I.append("scope",g.join(" ")),m&&I.append("login_hint",m),y&&I.append("lang",y),S&&I.append("nonce",S),E&&I.append("prompt",E.toLowerCase()),I.append("state",x),p==="code"&&(I.append("code_challenge",M()),I.append("code_challenge_method",R));const P=`https://${c}/oauth2/authorize?${I.toString()}`;zK(Lr);const{type:k,error:H,url:F}=await w(P,f,o)??{};try{if(k==="error")throw ka(String(H));if(k==="canceled")throw ka(String(k));k==="success"&&F&&await R5({currentUrl:F,clientId:r,domain:c,redirectUri:O,responseType:p,userAgentValue:Nt(Ve.SignInWithRedirect),preferPrivateSession:o})}catch(B){throw await LA(B),B}},jK=async t=>{const e=t.getConfig().Auth?.Cognito;lt(e);const{userPoolEndpoint:n,userPoolId:r}=e,{tokens:s}=await B6(t,{forceRefresh:!1});ed(s);const o=vK({endpointResolver:bt({endpointOverride:n})}),{UserAttributes:a}=await o({region:yt(r),userAgentValue:Nt(Ve.FetchUserAttributes)},{AccessToken:s.accessToken.toString()});return MW(a)},M5=()=>jK(Ht),HK=async t=>{await t.clearOAuthData(),Hr.clearTokens(),await j6(),Ao.dispatch("auth",{event:"signedOut"},"Auth",xo)},$K=async(t,e=!1,n)=>{hy(t);const{loginWith:r,userPoolClientId:s}=t,{domain:o,redirectSignOut:a}=r.oauth,u=DA(a),c=`https://${o}/logout?${Object.entries({client_id:s,logout_uri:encodeURIComponent(u)}).map(([f,p])=>`${f}=${p}`).join("&")}`;return O5(c)},qK=async(t,e,n,r)=>{const{isOAuthSignIn:s}=await e.loadOAuthSignIn(),o=await n.getOAuthMetadata();if(await HK(e),s||o?.oauthSignIn)return $K(t,!1)},WK=t=>Rn(jn,Bn("RevokeToken"),or(),{...Hn,...t}),GK=new nr("Auth");async function VK(t){const e=Ht.getConfig().Auth?.Cognito;lt(e),await KK(e);let n;try{hy(e),n=!0}catch{n=!1}if(n){const r=new u5(Gh);r.setAuthConfig(e);const{type:s}=await qK(e,r,Hr)??{};if(s==="error")throw new Le({name:jW,message:"An error occurred when attempting to log out from OAuth provider."})}else Hr.clearTokens(),await j6(),Ao.dispatch("auth",{event:"signedOut"},"Auth",xo)}async function KK(t){try{const{userPoolEndpoint:e,userPoolId:n,userPoolClientId:r}=t,s=await Hr.getTokenStore().loadTokens();o5(s),YK(s.accessToken)&&await WK({endpointResolver:bt({endpointOverride:e})})({region:yt(n),userAgentValue:Nt(Ve.SignOut)},{ClientId:r,Token:s.refreshToken})}catch{GK.debug("Client signOut error caught but will proceed with token removal")}}const YK=t=>!!t?.payload?.origin_jti,ZK=t=>Rn(jn,Bn("GetUserAttributeVerificationCode"),or(),{...Hn,...t}),XK=async t=>{const{userAttributeKey:e,options:n}=t,r=Ht.getConfig().Auth?.Cognito,s=n?.clientMetadata;lt(r);const{userPoolEndpoint:o,userPoolId:a}=r,{tokens:u}=await vy({forceRefresh:!1});ed(u);const c=ZK({endpointResolver:bt({endpointOverride:o})}),{CodeDeliveryDetails:f}=await c({region:yt(a),userAgentValue:Nt(Ve.SendUserAttributeVerificationCode)},{AccessToken:u.accessToken.toString(),ClientMetadata:s,AttributeName:e}),{DeliveryMedium:p,AttributeName:g,Destination:m}={...f};return{destination:m,deliveryMedium:p,attributeName:g}},QK={identityId:"identityId"},JK=new nr("DefaultIdentityIdStore");class P5{setAuthConfig(e){Lm(e.Cognito),this.authConfig=e,this._authKeys=eY("Cognito",e.Cognito.identityPoolId)}constructor(e){this._authKeys={},this._hasGuestIdentityId=!1,this.keyValueStorage=e}async loadIdentityId(){Lm(this.authConfig?.Cognito);try{if(this._primaryIdentityId)return{id:this._primaryIdentityId,type:"primary"};{const e=await this.keyValueStorage.getItem(this._authKeys.identityId);return e?(this._hasGuestIdentityId=!0,{id:e,type:"guest"}):null}}catch(e){return JK.log("Error getting stored IdentityId.",e),null}}async storeIdentityId(e){Lm(this.authConfig?.Cognito),e.type==="guest"?(this.keyValueStorage.setItem(this._authKeys.identityId,e.id),this._primaryIdentityId=void 0,this._hasGuestIdentityId=!0):(this._primaryIdentityId=e.id,this._hasGuestIdentityId&&(this.keyValueStorage.removeItem(this._authKeys.identityId),this._hasGuestIdentityId=!1))}async clearIdentityId(){this._primaryIdentityId=void 0,await this.keyValueStorage.removeItem(this._authKeys.identityId)}}const eY=(t,e)=>xA(QK)(`com.amplify.${t}`,e),O_=({endpointOverride:t})=>e=>t?{url:new Wa(t)}:hW(e);function k5(t){const e=gi(t).payload.iss,n={};if(!e)throw new Le({name:"InvalidIdTokenException",message:"Invalid Idtoken."});const r=e.replace(/(^\w+:|^)\/\//,"");return n[r]=t,n}async function tY({tokens:t,authConfig:e,identityIdStore:n}){n.setAuthConfig({Cognito:e});const r=await n.loadIdentityId();if(r)return r.id;const s=t?.idToken?k5(t.idToken.toString()):{},o=await nY(s,e);return n.storeIdentityId({id:o,type:t?"primary":"guest"}),o}async function nY(t,e){const n=e?.identityPoolId,r=C_(n),s=cW({endpointResolver:O_({endpointOverride:e.identityPoolEndpoint})});let o;try{o=(await s({region:r},{IdentityPoolId:n,Logins:t})).IdentityId}catch(a){throw Is(a),new Le(a)}if(!o)throw new Le({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return o}const Lg=new nr("CognitoCredentialsProvider"),xM=3e3*1e3;class D5{constructor(e){this._nextCredentialsRefresh=0,this._identityIdStore=e}async clearCredentialsAndIdentityId(){Lg.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,await this._identityIdStore.clearIdentityId()}async clearCredentials(){Lg.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0}async getCredentialsAndIdentityId(e){const n=e.authenticated,{tokens:r}=e,{authConfig:s}=e;try{Lm(s?.Cognito)}catch{return}if(!n&&!s.Cognito.allowGuestAccess)return;const{forceRefresh:o}=e,a=this.hasTokenChanged(r),u=await tY({tokens:r,authConfig:s.Cognito,identityIdStore:this._identityIdStore});return(o||a)&&this.clearCredentials(),n?(qW(r),this.credsForOIDCTokens(s.Cognito,r,u)):this.getGuestCredentials(u,s.Cognito)}async getGuestCredentials(e,n){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!1)return Lg.info("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const r=C_(n.identityPoolId),s=HN({endpointResolver:O_({endpointOverride:n.identityPoolEndpoint})});let o;try{o=await s({region:r},{IdentityId:e})}catch(a){throw Is(a),new Le(a)}if(o?.Credentials?.AccessKeyId&&o?.Credentials?.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+xM;const a={credentials:{accessKeyId:o.Credentials.AccessKeyId,secretAccessKey:o.Credentials.SecretKey,sessionToken:o.Credentials.SessionToken,expiration:o.Credentials.Expiration},identityId:e};return o.IdentityId&&(a.identityId=o.IdentityId,this._identityIdStore.storeIdentityId({id:o.IdentityId,type:"guest"})),this._credentialsAndIdentityId={...a,isAuthenticatedCreds:!1},a}else throw new Le({name:"CredentialsNotFoundException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}async credsForOIDCTokens(e,n,r){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!0)return Lg.debug("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const s=n.idToken?k5(n.idToken.toString()):{},o=C_(e.identityPoolId),a=HN({endpointResolver:O_({endpointOverride:e.identityPoolEndpoint})});let u;try{u=await a({region:o},{IdentityId:r,Logins:s})}catch(c){throw Is(c),new Le(c)}if(u?.Credentials?.AccessKeyId&&u?.Credentials?.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+xM;const c={credentials:{accessKeyId:u.Credentials.AccessKeyId,secretAccessKey:u.Credentials.SecretKey,sessionToken:u.Credentials.SessionToken,expiration:u.Credentials.Expiration},identityId:r};return u.IdentityId&&(c.identityId=u.IdentityId,this._identityIdStore.storeIdentityId({id:u.IdentityId,type:"primary"})),this._credentialsAndIdentityId={...c,isAuthenticatedCreds:!0,associatedIdToken:n.idToken?.toString()},c}else throw new Le({name:"CredentialsException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}isPastTTL(){return this._nextCredentialsRefresh===void 0?!0:this._nextCredentialsRefresh<=Date.now()}hasTokenChanged(e){return!!e&&!!this._credentialsAndIdentityId?.associatedIdToken&&e.idToken?.toString()!==this._credentialsAndIdentityId.associatedIdToken}}const rY=new D5(new P5(Gh)),L5={configure(t,e){const n=L6(t),r=new SW({sameSite:"lax"}),s=e?.ssr?r:Gh,o=e?.ssr?new D5(new P5(r)):rY;if(!n.Auth||e?.Auth){Ht.configure(n,e);return}Fm.setAuthConfig(n.Auth),Fm.setKeyValueStorage(s),Ht.configure(n,{...e,Auth:{tokenProvider:Fm,credentialsProvider:o}})},getConfig(){return Ht.getConfig()}},Cy=()=>{const t=globalThis.__REMIT_CONFIG__??{};return{apiUrl:t.apiUrl??"/api",appOrigin:t.appOrigin??"",betterAuthEnabled:t.betterAuthEnabled??!1,cognito:{userPoolId:t.cognito?.userPoolId??"",clientId:t.cognito?.clientId??"",domain:t.cognito?.domain??"",region:t.cognito?.region??""},rum:{appMonitorId:t.rum?.appMonitorId??"",identityPoolId:t.rum?.identityPoolId??"",region:t.rum?.region??"eu-west-1"},mailboxPollIntervalSeconds:t.mailboxPollIntervalSeconds!=null?String(t.mailboxPollIntervalSeconds):void 0,disableDevtools:t.disableDevtools??!1}},sY=()=>{const t=Cy(),{userPoolId:e,clientId:n,domain:r,region:s}=t.cognito;return!e||!n?null:{userPoolId:e,userPoolClientId:n,domain:r,region:s,appOrigin:t.appOrigin}},N_=sY(),wy=()=>N_!==null,U5=()=>{if(!N_){console.warn("[auth] Cognito user pool is not configured. Running in local dev mode without Cognito auth.");return}const{userPoolId:t,userPoolClientId:e,domain:n,appOrigin:r}=N_;L5.configure({Auth:{Cognito:{userPoolId:t,userPoolClientId:e,loginWith:n?{oauth:{domain:n,scopes:["openid","email","profile"],redirectSignIn:r?[r]:[],redirectSignOut:r?[r]:[],responseType:"code"}}:void 0}}})};var oY={};const jm=Object.create(null),mf=t=>oY||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?jm:globalThis),ga=new Proxy(jm,{get(t,e){return mf()[e]??jm[e]},has(t,e){return e in mf()||e in jm},set(t,e,n){const r=mf(!0);return r[e]=n,!0},deleteProperty(t,e){if(!e)return!1;const n=mf(!0);return delete n[e],!0},ownKeys(){const t=mf(!0);return Object.keys(t)}});ga.NODE_ENV;var Hm=class extends Error{constructor(t,e){super(t,e),this.name="BetterAuthError",this.message=t,this.stack=""}};const iY=47;function F5(t){let e=t.length;for(;e>0&&t.charCodeAt(e-1)===iY;)e--;return e===t.length?t:t.slice(0,e)}function aY(t){try{return(F5(new URL(t).pathname)||"/")!=="/"}catch{throw new Hm(`Invalid base URL: ${t}. Please provide a valid base URL.`)}}function lY(t){try{const e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Hm(`Invalid base URL: ${t}. URL must include 'http://' or 'https://'`)}catch(e){throw e instanceof Hm?e:new Hm(`Invalid base URL: ${t}. Please provide a valid base URL.`,{cause:e})}}function AM(t,e="/api/auth"){if(lY(t),aY(t))return t;const n=F5(t);return!e||e==="/"?n:(e=e.startsWith("/")?e:`/${e}`,`${n}${e}`)}function uY(t,e,n,r,s){{const o=ga.BETTER_AUTH_URL||ga.NEXT_PUBLIC_BETTER_AUTH_URL||ga.PUBLIC_BETTER_AUTH_URL||ga.NUXT_PUBLIC_BETTER_AUTH_URL||ga.NUXT_PUBLIC_AUTH_URL||(ga.BASE_URL!=="/"?ga.BASE_URL:void 0);if(o)return AM(o,e)}if(typeof window<"u"&&window.location)return AM(window.location.origin,e)}const cY={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},dY=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,TM={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},fY=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function hY(t){return t instanceof Date&&!isNaN(t.getTime())}function pY(t){const e=fY.exec(t);if(!e)return null;const[,n,r,s,o,a,u,c,f,p,g]=e,m=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(s,10),parseInt(o,10),parseInt(a,10),parseInt(u,10),c?parseInt(c.padEnd(3,"0"),10):0));if(f){const y=(parseInt(p,10)*60+parseInt(g,10))*(f==="+"?-1:1);m.setUTCMinutes(m.getUTCMinutes()+y)}return hY(m)?m:null}function gY(t,e={}){const{strict:n=!1,warnings:r=!1,reviver:s,parseDates:o=!0}=e;if(typeof t!="string")return t;const a=t.trim(),u=a.toLowerCase();if(u.length<=9&&u in TM)return TM[u];if(!dY.test(a)){if(n)throw new SyntaxError("[better-json] Invalid JSON");return t}if(Object.entries(cY).some(([c,f])=>{const p=f.test(a);return p&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${c} pattern`),p})&&n)throw new Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(a,(f,p)=>{if(f==="__proto__"||f==="constructor"&&p&&typeof p=="object"&&"prototype"in p){r&&console.warn(`[better-json] Dropping "${f}" key to prevent prototype pollution`);return}if(o&&typeof p=="string"){const g=pY(p);if(g)return g}return s?s(f,p):p})}catch(c){if(n)throw c;return t}}function mY(t,e={strict:!0}){return gY(t,e)}const vY=["javascript:","data:","vbscript:"];function yY(t){let e;try{e=new URL(t)}catch{return!0}return!vY.includes(e.protocol)}const bY={id:"redirect",name:"Redirect",hooks:{onSuccess(t){if(t.data?.url&&t.data?.redirect&&yY(t.data.url)&&typeof window<"u"&&window.location&&window.location)try{window.location.href=t.data.url}catch{}}}};let Vs=[],ma=0;const $m=4,SY=globalThis.nanostoresGlobal||={epoch:0};let EY=()=>{for(ma=0;ma<Vs.length;ma+=$m)Vs[ma](Vs[ma+1].value,Vs[ma+2],Vs[ma+3]);Vs.length=0};const RM=t=>{let e=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:t,lc:0,listen(r){return n.lc=e.push(r),()=>{for(let o=ma+$m;o<Vs.length;)Vs[o]===r?Vs.splice(o,$m):o+=$m;let s=e.indexOf(r);~s&&(e.splice(s,1),--n.lc||n.off())}},notify(r,s){SY.epoch++;let o=!Vs.length&&!0;for(let a of e)Vs.push(a,n,r,s);o&&EY()},off(){},set(r){let s=n.value;s!==r&&(n.value=r,n.notify(s))},subscribe(r){let s=n.listen(r);return r(n.value),s},value:t};return n},CY=2,wY=5,Ug=6,Fg=10;let z5=(t,e,n,r)=>(t.events=t.events||{},t.events[n+Fg]||(t.events[n+Fg]=r(s=>{t.events[n].reduceRight((o,a)=>(a(o),o),{shared:{},...s})})),t.events[n]=t.events[n]||[],t.events[n].push(e),()=>{let s=t.events[n],o=s.indexOf(e);s.splice(o,1),s.length||(delete t.events[n],t.events[n+Fg](),delete t.events[n+Fg])}),_Y=(t,e)=>z5(t,e,CY,n=>{let r=t.set,s=t.setKey;return t.setKey&&(t.setKey=(o,a)=>{let u;if(n({abort:()=>{u=!0},changed:o,newValue:{...t.value,[o]:a}}),!u)return s(o,a)}),t.set=o=>{let a;if(n({abort:()=>{a=!0},newValue:o}),!a)return r(o)},()=>{t.set=r,t.setKey=s}});const xY=1e3;let AY=(t,e)=>z5(t,r=>{let s=e(r);s&&t.events[Ug].push(s)},wY,r=>{let s=t.listen;t.listen=(...a)=>(!t.lc&&!t.active&&(t.active=!0,r()),s(...a));let o=t.off;return t.events[Ug]=[],t.off=()=>{o(),setTimeout(()=>{if(t.active&&!t.lc){t.active=!1;for(let a of t.events[Ug])a();t.events[Ug]=[]}},xY)},()=>{t.listen=s,t.off=o}});function TY(t,e,n){let r=new Set(e);return t.listen((s,o,a)=>{(a===void 0?e.some(u=>s[u]!==o[u]):r.has(a)||r.has(a.split(/\.|\[/)[0]))&&n(s,o,a)})}function IM(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function gv(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!gv(t[n],e[n]))return!1;return!0}if(IM(t)&&IM(e)){const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const s of n)if(!(s in e)||!gv(t[s],e[s]))return!1;return!0}return!1}function RY(t,e){return _Y(t,({newValue:n,abort:r})=>{e(t.value,n)&&r()})}const M1=Symbol.for("better-auth:broadcast-channel"),IY=()=>Math.floor(Date.now()/1e3);var OY=class{listeners=new Set;name;constructor(t="better-auth.message"){this.name=t}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}post(t){if(!(typeof window>"u"))try{localStorage.setItem(this.name,JSON.stringify({...t,timestamp:IY()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const t=e=>{if(e.key!==this.name)return;const n=JSON.parse(e.newValue??"{}");n?.event!=="session"||!n?.data||this.listeners.forEach(r=>r(n))};return window.addEventListener("storage",t),()=>{window.removeEventListener("storage",t)}}};function P1(t="better-auth.message"){return globalThis[M1]||(globalThis[M1]=new OY(t)),globalThis[M1]}const k1=Symbol.for("better-auth:focus-manager");var NY=class{listeners=new Set;subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}setFocused(t){this.listeners.forEach(e=>e(t))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};const t=()=>{document.visibilityState==="visible"&&this.setFocused(!0)};return document.addEventListener("visibilitychange",t,!1),()=>{document.removeEventListener("visibilitychange",t,!1)}}};function OM(){return globalThis[k1]||(globalThis[k1]=new NY),globalThis[k1]}const D1=Symbol.for("better-auth:online-manager");var MY=class{listeners=new Set;isOnline=typeof navigator<"u"?navigator.onLine:!0;subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}setOnline(t){this.isOnline=t,this.listeners.forEach(e=>e(t))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const t=()=>this.setOnline(!0),e=()=>this.setOnline(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",e,!1),()=>{window.removeEventListener("online",t,!1),window.removeEventListener("offline",e,!1)}}};function L1(){return globalThis[D1]||(globalThis[D1]=new MY),globalThis[D1]}const U1=()=>Math.floor(Date.now()/1e3),PY=5;function kY(t){const{fetchSession:e,shouldPollSession:n=()=>!0,sessionSignal:r,options:s={}}=t,o=s.sessionOptions?.refetchInterval??0,a=s.sessionOptions?.refetchOnWindowFocus??!0,u=s.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},f=()=>u||L1().isOnline,p=T=>{if(f()){if(T?.event==="storage"){e();return}if(T?.event==="poll"){c.lastSessionRequest=U1(),e();return}if(T?.event==="visibilitychange"){if(U1()-c.lastSessionRequest<PY)return;c.lastSessionRequest=U1(),e();return}e()}},g=T=>{P1().post({event:"session",data:{trigger:T},clientId:Math.random().toString(36).substring(7)})},m=()=>{o&&o>0&&(c.pollInterval=setInterval(()=>{n()&&p({event:"poll"})},o*1e3))},y=()=>{c.unsubscribeBroadcast=P1().subscribe(()=>{p({event:"storage"})})},S=()=>{a&&(c.unsubscribeFocus=OM().subscribe(()=>{p({event:"visibilitychange"})}))},E=()=>{c.unsubscribeOnline=L1().subscribe(T=>{T&&p({event:"visibilitychange"})})},C=()=>{c.unsubscribeSignal=r.listen(()=>{e()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,m(),y(),S(),E(),C(),c.cleanupBroadcastSetup=P1().setup(),c.cleanupFocusSetup=OM().setup(),c.cleanupOnlineSetup=L1().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&(clearInterval(c.pollInterval),c.pollInterval=void 0),c.unsubscribeBroadcast&&(c.unsubscribeBroadcast(),c.unsubscribeBroadcast=void 0),c.unsubscribeFocus&&(c.unsubscribeFocus(),c.unsubscribeFocus=void 0),c.unsubscribeOnline&&(c.unsubscribeOnline(),c.unsubscribeOnline=void 0),c.unsubscribeSignal&&(c.unsubscribeSignal(),c.unsubscribeSignal=void 0),c.cleanupBroadcastSetup&&(c.cleanupBroadcastSetup(),c.cleanupBroadcastSetup=void 0),c.cleanupFocusSetup&&(c.cleanupFocusSetup(),c.cleanupFocusSetup=void 0),c.cleanupOnlineSetup&&(c.cleanupOnlineSetup(),c.cleanupOnlineSetup=void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:p,broadcastSessionUpdate:g}}const DY=()=>typeof window>"u";function NM(t){return typeof t=="object"&&t!==null&&"data"in t&&"error"in t?t:{data:t,error:null}}function LY(t){return!t||t.session===null&&t.user===null?null:t}function UY(t,e){return gv(t.data,e.data)&&t.error===e.error&&t.isPending===e.isPending&&t.isRefetching===e.isRefetching&&t.refetch===e.refetch}function FY(t,e){const n=RM(!1);let r;const s=f=>u(f),o=RM({data:null,error:null,isPending:!0,isRefetching:!1,refetch:s});RY(o,UY);const a=f=>{if(r!==f)return;const p=o.get();r=void 0,!(!p.isPending&&!p.isRefetching)&&o.set({...p,isPending:!1,isRefetching:!1,refetch:s})},u=async f=>{r?.abort();const p=new AbortController;r=p;const g=o.get();o.set({...g,isPending:g.data===null,isRefetching:!0,error:null,refetch:s});try{const m=await t("/get-session",{method:"GET",query:f?.query,signal:p.signal});if(p.signal.aborted){a(p);return}let{data:y,error:S}=NM(m);if(y?.needsRefresh)try{const x=await t("/get-session",{method:"POST",signal:p.signal});if(p.signal.aborted){a(p);return}({data:y,error:S}=NM(x))}catch{if(p.signal.aborted){a(p);return}}if(S){const x=o.get(),T=S?.status===401;o.set({data:T?null:x.data,error:S,isPending:!1,isRefetching:!1,refetch:s});return}const E=LY(y),C=o.get(),w=C.data!=null&&E!=null&&gv(C.data,E)?C.data:E;o.set({data:w,error:null,isPending:!1,isRefetching:!1,refetch:s})}catch(m){if(p.signal.aborted){a(p);return}const y=o.get();o.set({data:y.data,error:m,isPending:!1,isRefetching:!1,refetch:s})}};let c=()=>{};return AY(o,()=>{let f;DY()||(f=setTimeout(()=>{u()},0));const p=kY({fetchSession:u,shouldPollSession:()=>o.get().data!=null,sessionSignal:n,options:e});return p.init(),c=p.broadcastSessionUpdate,()=>{f&&clearTimeout(f);const g=r;g?.abort(),g&&a(g),p.cleanup()}}),{session:o,$sessionSignal:n,broadcastSessionUpdate:f=>c(f)}}function F1(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function M_(t,e,n=".",r){if(!F1(e))return M_(t,{},n,r);const s={...e};for(const o of Object.keys(t)){if(o==="__proto__"||o==="constructor")continue;const a=t[o];a!=null&&(r&&r(s,o,a,n)||(Array.isArray(a)&&Array.isArray(s[o])?s[o]=[...a,...s[o]]:F1(a)&&F1(s[o])?s[o]=M_(a,s[o],(n?`${n}.`:"")+o.toString(),r):s[o]=a))}return s}function zY(t){return(...e)=>e.reduce((n,r)=>M_(n,r,"",t),{})}const BY=zY();var jY=Object.defineProperty,HY=Object.defineProperties,$Y=Object.getOwnPropertyDescriptors,MM=Object.getOwnPropertySymbols,qY=Object.prototype.hasOwnProperty,WY=Object.prototype.propertyIsEnumerable,PM=(t,e,n)=>e in t?jY(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ws=(t,e)=>{for(var n in e||(e={}))qY.call(e,n)&&PM(t,n,e[n]);if(MM)for(var n of MM(e))WY.call(e,n)&&PM(t,n,e[n]);return t},bo=(t,e)=>HY(t,$Y(e)),GY=class extends Error{constructor(t,e,n){super(e||t.toString(),{cause:n}),this.status=t,this.statusText=e,this.error=n,Error.captureStackTrace(this,this.constructor)}},VY=async(t,e)=>{var n,r,s,o,a,u;let c=e||{};const f={onRequest:[e?.onRequest],onResponse:[e?.onResponse],onSuccess:[e?.onSuccess],onError:[e?.onError],onRetry:[e?.onRetry]};if(!e||!e?.plugins)return{url:t,options:c,hooks:f};for(const p of e?.plugins||[]){if(p.init){const g=await((n=p.init)==null?void 0:n.call(p,t.toString(),e));c=g.options||c,t=g.url}f.onRequest.push((r=p.hooks)==null?void 0:r.onRequest),f.onResponse.push((s=p.hooks)==null?void 0:s.onResponse),f.onSuccess.push((o=p.hooks)==null?void 0:o.onSuccess),f.onError.push((a=p.hooks)==null?void 0:a.onError),f.onRetry.push((u=p.hooks)==null?void 0:u.onRetry)}return{url:t,options:c,hooks:f}},kM=class{constructor(t){this.options=t}shouldAttemptRetry(t,e){return this.options.shouldRetry?Promise.resolve(t<this.options.attempts&&this.options.shouldRetry(e)):Promise.resolve(t<this.options.attempts)}getDelay(){return this.options.delay}},KY=class{constructor(t){this.options=t}shouldAttemptRetry(t,e){return this.options.shouldRetry?Promise.resolve(t<this.options.attempts&&this.options.shouldRetry(e)):Promise.resolve(t<this.options.attempts)}getDelay(t){return Math.min(this.options.maxDelay,this.options.baseDelay*2**t)}};function YY(t){if(typeof t=="number")return new kM({type:"linear",attempts:t,delay:1e3});switch(t.type){case"linear":return new kM(t);case"exponential":return new KY(t);default:throw new Error("Invalid retry strategy")}}var ZY=async t=>{const e={},n=async r=>typeof r=="function"?await r():r;if(t?.auth){if(t.auth.type==="Bearer"){const r=await n(t.auth.token);if(!r)return e;e.authorization=`Bearer ${r}`}else if(t.auth.type==="Basic"){const[r,s]=await Promise.all([n(t.auth.username),n(t.auth.password)]);if(!r||!s)return e;e.authorization=`Basic ${btoa(`${r}:${s}`)}`}else if(t.auth.type==="Custom"){const[r,s]=await Promise.all([n(t.auth.prefix),n(t.auth.value)]);if(!s)return e;e.authorization=`${r??""} ${s}`}}return e},XY=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function QY(t){const e=t.headers.get("content-type"),n=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!e)return"json";const r=e.split(";").shift()||"";return XY.test(r)?"json":n.has(r)||r.startsWith("text/")?"text":"blob"}function JY(t){try{return JSON.parse(t),!0}catch{return!1}}function B5(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.buffer?!1:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}function DM(t){try{return JSON.parse(t)}catch{return t}}function LM(t){return typeof t=="function"}function eZ(t){if(t?.customFetchImpl)return t.customFetchImpl;if(typeof globalThis<"u"&&LM(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&LM(window.fetch))return window.fetch;throw new Error("No fetch implementation found")}function j5(...t){const e={};for(const n of t)if(n)if(n instanceof Headers)n.forEach((r,s)=>{e[s]=r});else{const r=Array.isArray(n)?n:Object.entries(n);for(const[s,o]of r)o!=null&&(e[s]=o)}return e}async function tZ(t){const e=new Headers(j5(t?.headers,await ZY(t)));if(!e.has("content-type")){const n=nZ(t?.body);n&&e.set("content-type",n)}return e}function nZ(t){return B5(t)?"application/json":null}function rZ(t){const e=t.get("content-type");return e?e.split(";")[0].trim().toLowerCase():null}function sZ(t,e){const{body:n}=t;return n?!B5(n)||typeof n=="string"?n:rZ(e)==="application/x-www-form-urlencoded"?new URLSearchParams(n).toString():JSON.stringify(n):null}function oZ(t,e){var n;if(e?.method)return e.method.toUpperCase();if(t.startsWith("@")){const r=(n=t.split("@")[1])==null?void 0:n.split("/")[0];return $5.includes(r)?r.toUpperCase():e?.body?"POST":"GET"}return e?.body?"POST":"GET"}function iZ(t,e){let n;return!t?.signal&&t?.timeout&&(n=setTimeout(()=>e?.abort(),t?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var aZ=class H5 extends Error{constructor(e,n){super(n||JSON.stringify(e,null,2)),this.issues=e,Object.setPrototypeOf(this,H5.prototype)}};async function Ff(t,e){const n=await t["~standard"].validate(e);if(n.issues)throw new aZ(n.issues);return n.value}var $5=["get","post","put","patch","delete"],lZ=t=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,n){var r,s,o,a;const u=((s=(r=t.plugins)==null?void 0:r.find(c=>{var f;return(f=c.schema)!=null&&f.config?e.startsWith(c.schema.config.baseURL||"")||e.startsWith(c.schema.config.prefix||""):!1}))==null?void 0:s.schema)||t.schema;if(u){let c=e;(o=u.config)!=null&&o.prefix&&c.startsWith(u.config.prefix)&&(c=c.replace(u.config.prefix,""),u.config.baseURL&&(e=e.replace(u.config.prefix,u.config.baseURL))),(a=u.config)!=null&&a.baseURL&&c.startsWith(u.config.baseURL)&&(c=c.replace(u.config.baseURL,"")),c.startsWith("/")&&c.charAt(1)==="@"&&(c=c.substring(1));const f=u.schema[c];if(f){let p=n?.headers;if(f.headers&&!n?.disableValidation){const m={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((E,C)=>{m[C.toLowerCase()]=E});else if(typeof n.headers=="object")for(const[E,C]of Object.entries(n.headers))C!=null&&(m[E.toLowerCase()]=C)}const y=await Ff(f.headers,m),S={};for(const[E,C]of Object.entries(y))S[E.toLowerCase()]=C;p=S}let g=bo(Ws({},n),{method:f.method,output:f.output,headers:p});return n?.disableValidation||(g=bo(Ws({},g),{body:f.input?await Ff(f.input,n?.body):n?.body,params:f.params?await Ff(f.params,n?.params):n?.params,query:f.query?await Ff(f.query,n?.query):n?.query})),{url:e,options:g}}}return{url:e,options:n}}}),uZ=t=>{async function e(n,r){const s=bo(Ws(Ws({},t),r),{headers:j5(t?.headers,r?.headers),plugins:[...t?.plugins||[],lZ(t||{}),...r?.plugins||[]]});if(t?.catchAllError)try{return await P_(n,s)}catch(o){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:o}}}return await P_(n,s)}return e},cZ=t=>t==="."||t==="..";function dZ(t,e){let n=t;for(const[r,s]of e)n=n.replace(r,s);if(cZ(n))throw new TypeError("Path parameters cannot be reserved path segments");return encodeURIComponent(n)}function fZ(t,e){const{baseURL:n,params:r,query:s}=e||{query:{},params:{},baseURL:""};let o=t.startsWith("http")?t.split("/").slice(0,3).join("/"):n||"";if(t.startsWith("@")){const m=t.toString().split("@")[1].split("/")[0];$5.includes(m)&&(t=t.replace(`@${m}/`,"/"))}o.endsWith("/")||(o+="/");let[a,u]=t.replace(o,"").split("?");const c=new URLSearchParams(u);for(const[m,y]of Object.entries(s||{})){if(y==null)continue;let S;if(typeof y=="string")S=y;else if(Array.isArray(y)){for(const E of y)c.append(m,E);continue}else S=JSON.stringify(y);c.set(m,S)}const f=new Map;if(r)if(Array.isArray(r)){const m=a.split("/").filter(y=>y.startsWith(":"));for(const[y,S]of m.entries()){const E=r[y];f.set(S,String(E))}}else for(const[m,y]of Object.entries(r))f.set(`:${m}`,String(y));a=a.split("/").map(m=>dZ(m,f)).join("/"),a=a.replace(/^\/+/,"");let p=c.toString();return p=p.length>0?`?${p}`.replace(/\+/g,"%20"):"",o.startsWith("http")?new URL(`${a}${p}`,o):`${o}${a}${p}`}var P_=async(t,e)=>{var n,r,s,o,a,u,c,f;const{hooks:p,url:g,options:m}=await VY(t,e),y=eZ(m),S=new AbortController,E=(n=m.signal)!=null?n:S.signal,C=fZ(g,m),w=await tZ(m),x=sZ(m,w),T=oZ(g,m),R=bo(Ws({},m),{url:C,headers:w,body:x,method:T,signal:E});for(const W of p.onRequest)if(W){const Y=await W(R);typeof Y=="object"&&Y!==null&&Object.assign(R,Y)}("pipeTo"in R&&typeof R.pipeTo=="function"||typeof((r=e?.body)==null?void 0:r.pipe)=="function")&&("duplex"in R||(R.duplex="half"));const{clearTimeout:M}=iZ(m,S);let O=await y(R.url,R);M();const I={response:O,request:R};for(const W of p.onResponse)if(W){const Y=await W(bo(Ws({},I),{response:(s=e?.hookOptions)!=null&&s.cloneResponse?O.clone():O}));Y instanceof Response?O=Y:typeof Y=="object"&&Y!==null&&(O=Y.response)}if(O.ok){if(!(R.method!=="HEAD"))return{data:"",error:null};const Y=QY(O),ne={data:null,response:O,request:R};if(Y==="json"||Y==="text"){const $=await O.text(),ee=(o=R.jsonParser)!=null?o:DM;ne.data=await ee($)}else ne.data=await O[Y]();R?.output&&R.output&&!R.disableValidation&&(ne.data=await Ff(R.output,ne.data));for(const $ of p.onSuccess)$&&await $(bo(Ws({},ne),{response:(a=e?.hookOptions)!=null&&a.cloneResponse?O.clone():O}));return e?.throw?ne.data:{data:ne.data,error:null}}const P=(u=e?.jsonParser)!=null?u:DM,k=await O.text(),H=JY(k),F=H?await P(k):null,B={response:O,responseText:k,request:R,error:bo(Ws({},F),{status:O.status,statusText:O.statusText})};for(const W of p.onError)W&&await W(bo(Ws({},B),{response:(c=e?.hookOptions)!=null&&c.cloneResponse?O.clone():O}));if(e?.retry){const W=YY(e.retry),Y=(f=e.retryAttempt)!=null?f:0;if(await W.shouldAttemptRetry(Y,O)){for(const $ of p.onRetry)$&&await $(I);const ne=W.getDelay(Y);return await new Promise($=>setTimeout($,ne)),await P_(t,bo(Ws({},e),{retryAttempt:Y+1}))}}if(e?.throw)throw new GY(O.status,O.statusText,H?F:k);return{data:null,error:bo(Ws({},F),{status:O.status,statusText:O.statusText})}},gl={};const hZ=t=>{if(typeof process>"u")return;const e="/api/auth";if(gl.NEXT_PUBLIC_AUTH_URL)return gl.NEXT_PUBLIC_AUTH_URL;if(typeof window>"u"){if(gl.NEXTAUTH_URL)try{return gl.NEXTAUTH_URL}catch{}if(gl.VERCEL_URL)try{const n=gl.VERCEL_URL.startsWith("http")?"":"https://";return`${new URL(`${n}${gl.VERCEL_URL}`).origin}${e}`}catch{}}},pZ=(t,e)=>{const n="credentials"in Request.prototype,r=uY(t?.baseURL,t?.basePath)??hZ()??"/api/auth",s=[],o={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:t?.fetchOptions?.onSuccess,onError:t?.fetchOptions?.onError,onRequest:t?.fetchOptions?.onRequest,onResponse:t?.fetchOptions?.onResponse}},{onSuccess:a,onError:u,onRequest:c,onResponse:f,...p}={},g=uZ({baseURL:r,...n?{credentials:"include"}:{},method:"GET",jsonParser(M){return M?mY(M,{strict:!1}):null},customFetchImpl:fetch,...p,plugins:[o,...p.plugins||[],bY,...s]}),{$sessionSignal:m,session:y,broadcastSessionUpdate:S}=FY(g,t),E=[];let C={};const w={$sessionSignal:m,session:y},x={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},T=[{signal:"$sessionSignal",matcher(M){return M==="/sign-out"||M==="/update-user"||M==="/update-session"||M==="/sign-up/email"||M==="/sign-in/email"||M==="/delete-user"||M==="/verify-email"||M==="/revoke-sessions"||M==="/revoke-session"||M==="/revoke-other-sessions"||M==="/change-email"||M==="/change-password"},callback(M){M==="/sign-out"?S("signout"):(M==="/update-user"||M==="/update-session")&&S("updateUser")}}];for(const M of E)M.getAtoms&&Object.assign(w,M.getAtoms?.(g)),M.pathMethods&&Object.assign(x,M.pathMethods),M.atomListeners&&T.push(...M.atomListeners);const R={notify:M=>{w[M].set(!w[M].get())},listen:(M,O)=>{w[M].subscribe(O)},atoms:w};for(const M of E)M.getActions&&(C=BY(M.getActions?.(g,R,t)??{},C));return{get baseURL(){return r},pluginsActions:C,pluginsAtoms:w,pluginPathMethods:x,atomListeners:T,$fetch:g,$store:R}};function gZ(t){return typeof t=="object"&&t!==null&&"get"in t&&typeof t.get=="function"&&"lc"in t&&typeof t.lc=="number"}function mZ(t){return t.charAt(0).toUpperCase()+t.slice(1)}const vZ=new RegExp("[\\p{Ll}\\d]+|\\p{Lu}+(?!\\p{Ll})|\\p{Lu}[\\p{Ll}\\d]+|\\p{Lo}+","gu"),yZ=/['\u2019]/g;function bZ(t){return t.replace(yZ,"").match(vZ)??[]}function SZ(t){return bZ(t).map(e=>e.toLowerCase()).join("-")}function EZ(t,e,n){const r=e[t],{fetchOptions:s,query:o,...a}=n||{};return r||(s?.method?s.method:a&&Object.keys(a).length>0?"POST":"GET")}function CZ(t,e,n,r,s){function o(a=[]){return new Proxy(function(){},{get(u,c){if(typeof c!="string"||c==="then"||c==="catch"||c==="finally")return;const f=[...a,c];let p=t;for(const g of f)if(p&&typeof p=="object"&&g in p)p=p[g];else{p=void 0;break}return typeof p=="function"||gZ(p)?p:o(f)},apply:async(u,c,f)=>{const p="/"+a.map(SZ).join("/"),g=f[0]||{},m=f[1]||{},{query:y,fetchOptions:S,...E}=g,C={...m,...S},w=EZ(p,n,g);return await e(p,{...C,body:w==="GET"?void 0:{...E,...C?.body||{}},query:y||C?.query,method:w,async onSuccess(x){if(await C?.onSuccess?.(x),!s||C.disableSignal)return;const T=s.filter(M=>M.matcher(p));if(!T.length)return;const R=new Set;for(const M of T){const O=r[M.signal];if(!O)return;if(R.has(M.signal))continue;R.add(M.signal);const I=O.get();setTimeout(()=>{O.set(!I)},10),M.callback?.(p)}}})}})}return o()}var z1={exports:{}},We={};var UM;function wZ(){if(UM)return We;UM=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),m=Symbol.iterator;function y(L){return L===null||typeof L!="object"?null:(L=m&&L[m]||L["@@iterator"],typeof L=="function"?L:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,C={};function w(L,V,K){this.props=L,this.context=V,this.refs=C,this.updater=K||S}w.prototype.isReactComponent={},w.prototype.setState=function(L,V){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,V,"setState")},w.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function x(){}x.prototype=w.prototype;function T(L,V,K){this.props=L,this.context=V,this.refs=C,this.updater=K||S}var R=T.prototype=new x;R.constructor=T,E(R,w.prototype),R.isPureReactComponent=!0;var M=Array.isArray;function O(){}var I={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function k(L,V,K){var J=K.ref;return{$$typeof:t,type:L,key:V,ref:J!==void 0?J:null,props:K}}function H(L,V){return k(L.type,V,L.props)}function F(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function B(L){var V={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(K){return V[K]})}var W=/\/+/g;function Y(L,V){return typeof L=="object"&&L!==null&&L.key!=null?B(""+L.key):V.toString(36)}function ne(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(O,O):(L.status="pending",L.then(function(V){L.status==="pending"&&(L.status="fulfilled",L.value=V)},function(V){L.status==="pending"&&(L.status="rejected",L.reason=V)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function $(L,V,K,J,oe){var he=typeof L;(he==="undefined"||he==="boolean")&&(L=null);var ue=!1;if(L===null)ue=!0;else switch(he){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(L.$$typeof){case t:case e:ue=!0;break;case p:return ue=L._init,$(ue(L._payload),V,K,J,oe)}}if(ue)return oe=oe(L),ue=J===""?"."+Y(L,0):J,M(oe)?(K="",ue!=null&&(K=ue.replace(W,"$&/")+"/"),$(oe,V,K,"",function(Xe){return Xe})):oe!=null&&(F(oe)&&(oe=H(oe,K+(oe.key==null||L&&L.key===oe.key?"":(""+oe.key).replace(W,"$&/")+"/")+ue)),V.push(oe)),1;ue=0;var ve=J===""?".":J+":";if(M(L))for(var _e=0;_e<L.length;_e++)J=L[_e],he=ve+Y(J,_e),ue+=$(J,V,K,he,oe);else if(_e=y(L),typeof _e=="function")for(L=_e.call(L),_e=0;!(J=L.next()).done;)J=J.value,he=ve+Y(J,_e++),ue+=$(J,V,K,he,oe);else if(he==="object"){if(typeof L.then=="function")return $(ne(L),V,K,J,oe);throw V=String(L),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return ue}function ee(L,V,K){if(L==null)return L;var J=[],oe=0;return $(L,J,"","",function(he){return V.call(K,he,oe++)}),J}function fe(L){if(L._status===-1){var V=L._result;V=V(),V.then(function(K){(L._status===0||L._status===-1)&&(L._status=1,L._result=K)},function(K){(L._status===0||L._status===-1)&&(L._status=2,L._result=K)}),L._status===-1&&(L._status=0,L._result=V)}if(L._status===1)return L._result.default;throw L._result}var de=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},Ae={map:ee,forEach:function(L,V,K){ee(L,function(){V.apply(this,arguments)},K)},count:function(L){var V=0;return ee(L,function(){V++}),V},toArray:function(L){return ee(L,function(V){return V})||[]},only:function(L){if(!F(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return We.Activity=g,We.Children=Ae,We.Component=w,We.Fragment=n,We.Profiler=s,We.PureComponent=T,We.StrictMode=r,We.Suspense=c,We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,We.__COMPILER_RUNTIME={__proto__:null,c:function(L){return I.H.useMemoCache(L)}},We.cache=function(L){return function(){return L.apply(null,arguments)}},We.cacheSignal=function(){return null},We.cloneElement=function(L,V,K){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var J=E({},L.props),oe=L.key;if(V!=null)for(he in V.key!==void 0&&(oe=""+V.key),V)!P.call(V,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&V.ref===void 0||(J[he]=V[he]);var he=arguments.length-2;if(he===1)J.children=K;else if(1<he){for(var ue=Array(he),ve=0;ve<he;ve++)ue[ve]=arguments[ve+2];J.children=ue}return k(L.type,oe,J)},We.createContext=function(L){return L={$$typeof:a,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:o,_context:L},L},We.createElement=function(L,V,K){var J,oe={},he=null;if(V!=null)for(J in V.key!==void 0&&(he=""+V.key),V)P.call(V,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(oe[J]=V[J]);var ue=arguments.length-2;if(ue===1)oe.children=K;else if(1<ue){for(var ve=Array(ue),_e=0;_e<ue;_e++)ve[_e]=arguments[_e+2];oe.children=ve}if(L&&L.defaultProps)for(J in ue=L.defaultProps,ue)oe[J]===void 0&&(oe[J]=ue[J]);return k(L,he,oe)},We.createRef=function(){return{current:null}},We.forwardRef=function(L){return{$$typeof:u,render:L}},We.isValidElement=F,We.lazy=function(L){return{$$typeof:p,_payload:{_status:-1,_result:L},_init:fe}},We.memo=function(L,V){return{$$typeof:f,type:L,compare:V===void 0?null:V}},We.startTransition=function(L){var V=I.T,K={};I.T=K;try{var J=L(),oe=I.S;oe!==null&&oe(K,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(O,de)}catch(he){de(he)}finally{V!==null&&K.types!==null&&(V.types=K.types),I.T=V}},We.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},We.use=function(L){return I.H.use(L)},We.useActionState=function(L,V,K){return I.H.useActionState(L,V,K)},We.useCallback=function(L,V){return I.H.useCallback(L,V)},We.useContext=function(L){return I.H.useContext(L)},We.useDebugValue=function(){},We.useDeferredValue=function(L,V){return I.H.useDeferredValue(L,V)},We.useEffect=function(L,V){return I.H.useEffect(L,V)},We.useEffectEvent=function(L){return I.H.useEffectEvent(L)},We.useId=function(){return I.H.useId()},We.useImperativeHandle=function(L,V,K){return I.H.useImperativeHandle(L,V,K)},We.useInsertionEffect=function(L,V){return I.H.useInsertionEffect(L,V)},We.useLayoutEffect=function(L,V){return I.H.useLayoutEffect(L,V)},We.useMemo=function(L,V){return I.H.useMemo(L,V)},We.useOptimistic=function(L,V){return I.H.useOptimistic(L,V)},We.useReducer=function(L,V,K){return I.H.useReducer(L,V,K)},We.useRef=function(L){return I.H.useRef(L)},We.useState=function(L){return I.H.useState(L)},We.useSyncExternalStore=function(L,V,K){return I.H.useSyncExternalStore(L,V,K)},We.useTransition=function(){return I.H.useTransition()},We.version="19.2.7",We}var FM;function Xh(){return FM||(FM=1,z1.exports=wZ()),z1.exports}var A=Xh();const z=qa(A),q5=N6({__proto__:null,default:z},[A]);function _Z(t,e={}){const n=A.useRef(t.get()),{keys:r,deps:s=[t,r]}=e,o=A.useCallback(u=>{const c=f=>{n.current!==f&&(n.current=f,u())};return c(t.value),r?.length?TY(t,r,c):t.listen(c)},s),a=()=>n.current;return A.useSyncExternalStore(o,a,a)}function xZ(t){return`use${mZ(t)}`}function AZ(t){const{pluginPathMethods:e,pluginsActions:n,pluginsAtoms:r,$fetch:s,$store:o,atomListeners:a}=pZ(t),u={};for(const[c,f]of Object.entries(r))u[xZ(c)]=()=>_Z(f);return CZ({...n,...u,$fetch:s,$store:o},s,e,r,a)}const _y=()=>Cy().betterAuthEnabled,TZ="EMAIL_PASSWORD_SIGN_UP_DISABLED",RZ=t=>typeof t=="object"&&t!==null&&t.code===TZ,hh=AZ(),IZ=60;let zf=null;const qm=()=>Math.floor(Date.now()/1e3),OZ=t=>{const[,e]=t.split(".");if(!e)return qm();try{const n=JSON.parse(atob(e.replace(/-/g,"+").replace(/_/g,"/")));return typeof n.exp=="number"?n.exp:qm()}catch{return qm()}},NZ=async()=>{const t=await fetch("/api/auth/token",{credentials:"include"});if(!t.ok)return null;const e=await t.json();return e&&typeof e=="object"&&"token"in e&&typeof e.token=="string"?e.token:null},MZ=async()=>{if(zf&&zf.expiresAt-IZ>qm())return zf.value;const t=await NZ();return zf=t?{value:t,expiresAt:OZ(t)}:null,t},W5=()=>{zf=null};const PZ=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),G5=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();var kZ={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const DZ=A.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:a,...u},c)=>A.createElement("svg",{ref:c,...kZ,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:G5("lucide",s),...u},[...a.map(([f,p])=>A.createElement(f,p)),...Array.isArray(o)?o:[o]]));const Ns=(t,e)=>{const n=A.forwardRef(({className:r,...s},o)=>A.createElement(DZ,{ref:o,iconNode:e,className:G5(`lucide-${PZ(t)}`,r),...s}));return n.displayName=`${t}`,n};const zM=Ns("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const LZ=Ns("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const UZ=Ns("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);const FZ=Ns("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);const zZ=Ns("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);const BZ=Ns("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const jZ=Ns("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const HZ=Ns("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);const $Z=Ns("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const qZ=Ns("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);const WZ=Ns("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);const ph=Ns("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function V5(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=V5(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function K5(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=V5(t))&&(r&&(r+=" "),r+=e);return r}const UA="-",GZ=t=>{const e=KZ(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const u=a.split(UA);return u[0]===""&&u.length!==1&&u.shift(),Y5(u,e)||VZ(a)},getConflictingClassGroupIds:(a,u)=>{const c=n[a]||[];return u&&r[a]?[...c,...r[a]]:c}}},Y5=(t,e)=>{if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?Y5(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const o=t.join(UA);return e.validators.find(({validator:a})=>a(o))?.classGroupId},BM=/^\[(.+)\]$/,VZ=t=>{if(BM.test(t)){const e=BM.exec(t)[1],n=e?.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},KZ=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return ZZ(Object.entries(t.classGroups),n).forEach(([o,a])=>{k_(a,r,o,e)}),r},k_=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const o=s===""?e:jM(e,s);o.classGroupId=n;return}if(typeof s=="function"){if(YZ(s)){k_(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,a])=>{k_(a,jM(e,o),n,r)})})},jM=(t,e)=>{let n=t;return e.split(UA).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},YZ=t=>t.isThemeGetter,ZZ=(t,e)=>e?t.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,u])=>[e+a,u])):o);return[n,s]}):t,XZ=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(o,a)=>{n.set(o,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return s(o,a),a},set(o,a){n.has(o)?n.set(o,a):s(o,a)}}},Z5="!",QZ=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,s=e[0],o=e.length,a=u=>{const c=[];let f=0,p=0,g;for(let C=0;C<u.length;C++){let w=u[C];if(f===0){if(w===s&&(r||u.slice(C,C+o)===e)){c.push(u.slice(p,C)),p=C+o;continue}if(w==="/"){g=C;continue}}w==="["?f++:w==="]"&&f--}const m=c.length===0?u:u.substring(p),y=m.startsWith(Z5),S=y?m.substring(1):m,E=g&&g>p?g-p:void 0;return{modifiers:c,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:E}};return n?u=>n({className:u,parseClassName:a}):a},JZ=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},eX=t=>({cache:XZ(t.cacheSize),parseClassName:QZ(t),...GZ(t)}),tX=/\s+/,nX=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,o=[],a=t.trim().split(tX);let u="";for(let c=a.length-1;c>=0;c-=1){const f=a[c],{modifiers:p,hasImportantModifier:g,baseClassName:m,maybePostfixModifierPosition:y}=n(f);let S=!!y,E=r(S?m.substring(0,y):m);if(!E){if(!S){u=f+(u.length>0?" "+u:u);continue}if(E=r(m),!E){u=f+(u.length>0?" "+u:u);continue}S=!1}const C=JZ(p).join(":"),w=g?C+Z5:C,x=w+E;if(o.includes(x))continue;o.push(x);const T=s(E,S);for(let R=0;R<T.length;++R){const M=T[R];o.push(w+M)}u=f+(u.length>0?" "+u:u)}return u};function rX(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=X5(e))&&(r&&(r+=" "),r+=n);return r}const X5=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=X5(t[r]))&&(n&&(n+=" "),n+=e);return n};function sX(t,...e){let n,r,s,o=a;function a(c){const f=e.reduce((p,g)=>g(p),t());return n=eX(f),r=n.cache.get,s=n.cache.set,o=u,u(c)}function u(c){const f=r(c);if(f)return f;const p=nX(c,n);return s(c,p),p}return function(){return o(rX.apply(null,arguments))}}const Yt=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},Q5=/^\[(?:([a-z-]+):)?(.+)\]$/i,oX=/^\d+\/\d+$/,iX=new Set(["px","full","screen"]),aX=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lX=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,uX=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cX=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dX=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ei=t=>xc(t)||iX.has(t)||oX.test(t),ca=t=>id(t,"length",bX),xc=t=>!!t&&!Number.isNaN(Number(t)),B1=t=>id(t,"number",xc),vf=t=>!!t&&Number.isInteger(Number(t)),fX=t=>t.endsWith("%")&&xc(t.slice(0,-1)),et=t=>Q5.test(t),da=t=>aX.test(t),hX=new Set(["length","size","percentage"]),pX=t=>id(t,hX,J5),gX=t=>id(t,"position",J5),mX=new Set(["image","url"]),vX=t=>id(t,mX,EX),yX=t=>id(t,"",SX),yf=()=>!0,id=(t,e,n)=>{const r=Q5.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},bX=t=>lX.test(t)&&!uX.test(t),J5=()=>!1,SX=t=>cX.test(t),EX=t=>dX.test(t),CX=()=>{const t=Yt("colors"),e=Yt("spacing"),n=Yt("blur"),r=Yt("brightness"),s=Yt("borderColor"),o=Yt("borderRadius"),a=Yt("borderSpacing"),u=Yt("borderWidth"),c=Yt("contrast"),f=Yt("grayscale"),p=Yt("hueRotate"),g=Yt("invert"),m=Yt("gap"),y=Yt("gradientColorStops"),S=Yt("gradientColorStopPositions"),E=Yt("inset"),C=Yt("margin"),w=Yt("opacity"),x=Yt("padding"),T=Yt("saturate"),R=Yt("scale"),M=Yt("sepia"),O=Yt("skew"),I=Yt("space"),P=Yt("translate"),k=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",et,e],B=()=>[et,e],W=()=>["",ei,ca],Y=()=>["auto",xc,et],ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>["start","end","center","between","around","evenly","stretch"],de=()=>["","0",et],Ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[xc,et];return{cacheSize:500,separator:":",theme:{colors:[yf],spacing:[ei,ca],blur:["none","",da,et],brightness:L(),borderColor:[t],borderRadius:["none","","full",da,et],borderSpacing:B(),borderWidth:W(),contrast:L(),grayscale:de(),hueRotate:L(),invert:de(),gap:B(),gradientColorStops:[t],gradientColorStopPositions:[fX,ca],inset:F(),margin:F(),opacity:L(),padding:B(),saturate:L(),scale:L(),sepia:de(),skew:L(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",et]}],container:["container"],columns:[{columns:[da]}],"break-after":[{"break-after":Ae()}],"break-before":[{"break-before":Ae()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ne(),et]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",vf,et]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",et]}],grow:[{grow:de()}],shrink:[{shrink:de()}],order:[{order:["first","last","none",vf,et]}],"grid-cols":[{"grid-cols":[yf]}],"col-start-end":[{col:["auto",{span:["full",vf,et]},et]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[yf]}],"row-start-end":[{row:["auto",{span:[vf,et]},et]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",et]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",et]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...fe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...fe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...fe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",et,e]}],"min-w":[{"min-w":[et,e,"min","max","fit"]}],"max-w":[{"max-w":[et,e,"none","full","min","max","fit","prose",{screen:[da]},da]}],h:[{h:[et,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[et,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[et,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[et,e,"auto","min","max","fit"]}],"font-size":[{text:["base",da,ca]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",B1]}],"font-family":[{font:[yf]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",et]}],"line-clamp":[{"line-clamp":["none",xc,B1]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ei,et]}],"list-image":[{"list-image":["none",et]}],"list-style-type":[{list:["none","disc","decimal",et]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ei,ca]}],"underline-offset":[{"underline-offset":["auto",ei,et]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",et]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",et]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ne(),gX]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pX]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},vX]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:$()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[ei,et]}],"outline-w":[{outline:[ei,ca]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[ei,ca]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",da,yX]}],"shadow-color":[{shadow:[yf]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...ee(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ee()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",da,et]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[g]}],saturate:[{saturate:[T]}],sepia:[{sepia:[M]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"backdrop-sepia":[{"backdrop-sepia":[M]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",et]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",et]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",et]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[vf,et]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",et]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",et]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",et]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[ei,ca,B1]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},e8=sX(CX);function dn(...t){return e8(K5(t))}const wX=1024,_X=1280;function xX(t,e=wX,n=_X){const r=t>=e;return{nav:r,reading:r,intelligence:t>=n}}function AX(t){const e=A.useRef(null),[n,r]=A.useState(t??null);return A.useEffect(()=>{const s=e.current;if(!s||typeof ResizeObserver>"u")return;const o=new ResizeObserver(a=>{const u=a[0];u&&r(u.contentRect.width)});return o.observe(s),r(s.getBoundingClientRect().width),()=>o.disconnect()},[]),[e,n]}const TX=[{id:"all",label:"All"},{id:"personal",label:"Personal"},{id:"newsletter",label:"Newsletters"},{id:"marketing",label:"Marketing"},{id:"automated",label:"Automated"},{id:"transactional",label:"Transactional"},{id:"social",label:"Social"}],RX={personal:"accent",newsletter:"neutral",marketing:"neutral",automated:"neutral",transactional:"positive",social:"warning"};function IX({open:t,onClose:e,title:n,titleId:r="dialog-title",children:s,className:o,anchor:a="center"}){const u=A.useRef(null),c=A.useCallback(m=>{m.key==="Escape"&&(m.preventDefault(),m.stopImmediatePropagation(),e())},[e]);if(A.useEffect(()=>{if(t)return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[t,c]),A.useEffect(()=>{if(!t)return;const m=u.current;if(!m)return;m.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')[0]?.focus()},[t]),!t)return null;const f=a==="left",p=a==="right",g=f||p;return D.jsxs("div",{className:dn("fixed inset-0 z-50 flex",f?"items-stretch justify-start":p?"items-stretch justify-end":"items-center justify-center px-4"),role:"presentation",onClick:e,children:[D.jsx("div",{className:dn("absolute inset-0",!g&&"bg-canvas/80")}),D.jsxs("div",{ref:u,role:"dialog","aria-modal":"true","aria-labelledby":r,className:dn("relative z-10 overflow-hidden border-line bg-surface shadow-xl",f?"h-full w-72 max-w-[85vw] border-r":p?"h-full w-[80vw] max-w-[320px] border-l":"w-full max-w-lg rounded-md border",o),onClick:m=>m.stopPropagation(),onKeyDown:m=>m.stopPropagation(),children:[D.jsx("h2",{id:r,className:"sr-only",children:n}),s]})]})}const xy=A.createContext(null);xy.displayName="PanelGroupContext";const mn={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},FA=10,Rl=A.useLayoutEffect,HM=q5.useId,OX=typeof HM=="function"?HM:()=>null;let NX=0;function zA(t=null){const e=OX(),n=A.useRef(t||e||null);return n.current===null&&(n.current=""+NX++),t??n.current}function t8({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:o,id:a,maxSize:u,minSize:c,onCollapse:f,onExpand:p,onResize:g,order:m,style:y,tagName:S="div",...E}){const C=A.useContext(xy);if(C===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:x,getPanelSize:T,getPanelStyle:R,groupId:M,isPanelCollapsed:O,reevaluatePanelConstraints:I,registerPanel:P,resizePanel:k,unregisterPanel:H}=C,F=zA(a),B=A.useRef({callbacks:{onCollapse:f,onExpand:p,onResize:g},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:u,minSize:c},id:F,idIsFromProps:a!==void 0,order:m});A.useRef({didLogMissingDefaultSizeWarning:!1}),Rl(()=>{const{callbacks:Y,constraints:ne}=B.current,$={...ne};B.current.id=F,B.current.idIsFromProps=a!==void 0,B.current.order=m,Y.onCollapse=f,Y.onExpand=p,Y.onResize=g,ne.collapsedSize=n,ne.collapsible=r,ne.defaultSize=s,ne.maxSize=u,ne.minSize=c,($.collapsedSize!==ne.collapsedSize||$.collapsible!==ne.collapsible||$.maxSize!==ne.maxSize||$.minSize!==ne.minSize)&&I(B.current,$)}),Rl(()=>{const Y=B.current;return P(Y),()=>{H(Y)}},[m,F,P,H]),A.useImperativeHandle(o,()=>({collapse:()=>{w(B.current)},expand:Y=>{x(B.current,Y)},getId(){return F},getSize(){return T(B.current)},isCollapsed(){return O(B.current)},isExpanded(){return!O(B.current)},resize:Y=>{k(B.current,Y)}}),[w,x,T,O,F,k]);const W=R(B.current,s);return A.createElement(S,{...E,children:t,className:e,id:F,style:{...W,...y},[mn.groupId]:M,[mn.panel]:"",[mn.panelCollapsible]:r||void 0,[mn.panelId]:F,[mn.panelSize]:parseFloat(""+W.flexGrow).toFixed(1)})}const n8=A.forwardRef((t,e)=>A.createElement(t8,{...t,forwardedRef:e}));t8.displayName="Panel";n8.displayName="forwardRef(Panel)";let D_=null,Wm=-1,Ea=null;function MX(t,e){if(e){const n=(e&a8)!==0,r=(e&l8)!==0,s=(e&u8)!==0,o=(e&c8)!==0;if(n)return s?"se-resize":o?"ne-resize":"e-resize";if(r)return s?"sw-resize":o?"nw-resize":"w-resize";if(s)return"s-resize";if(o)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function PX(){Ea!==null&&(document.head.removeChild(Ea),D_=null,Ea=null,Wm=-1)}function j1(t,e){var n,r;const s=MX(t,e);if(D_!==s){if(D_=s,Ea===null&&(Ea=document.createElement("style"),document.head.appendChild(Ea)),Wm>=0){var o;(o=Ea.sheet)===null||o===void 0||o.removeRule(Wm)}Wm=(n=(r=Ea.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${s} !important;}`))!==null&&n!==void 0?n:-1}}function r8(t){return t.type==="keydown"}function s8(t){return t.type.startsWith("pointer")}function o8(t){return t.type.startsWith("mouse")}function Ay(t){if(s8(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(o8(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function kX(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function DX(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function LX(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:WM(t),b:WM(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;tt(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:qM($M(n.a)),b:qM($M(n.b))};if(s.a===s.b){const o=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let u=o.length;for(;u--;){const c=o[u];if(c===a.a)return 1;if(c===a.b)return-1}}return Math.sign(s.a-s.b)}const UX=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function FX(t){var e;const n=getComputedStyle((e=i8(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function zX(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||FX(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||UX.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function $M(t){let e=t.length;for(;e--;){const n=t[e];if(tt(n,"Missing node"),zX(n))return n}return null}function qM(t){return t&&Number(getComputedStyle(t).zIndex)||0}function WM(t){const e=[];for(;t;)e.push(t),t=i8(t);return e}function i8(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const a8=1,l8=2,u8=4,c8=8,BX=kX()==="coarse";let Ys=[],Ac=!1,El=new Map,Ty=new Map;const gh=new Set;function jX(t,e,n,r,s){var o;const{ownerDocument:a}=e,u={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:s},c=(o=El.get(a))!==null&&o!==void 0?o:0;return El.set(a,c+1),gh.add(u),mv(),function(){var p;Ty.delete(t),gh.delete(u);const g=(p=El.get(a))!==null&&p!==void 0?p:1;if(El.set(a,g-1),mv(),g===1&&El.delete(a),Ys.includes(u)){const m=Ys.indexOf(u);m>=0&&Ys.splice(m,1),jA(),s("up",!0,null)}}}function HX(t){const{target:e}=t,{x:n,y:r}=Ay(t);Ac=!0,BA({target:e,x:n,y:r}),mv(),Ys.length>0&&(vv("down",t),t.preventDefault(),d8(e)||t.stopImmediatePropagation())}function H1(t){const{x:e,y:n}=Ay(t);if(Ac&&t.buttons===0&&(Ac=!1,vv("up",t)),!Ac){const{target:r}=t;BA({target:r,x:e,y:n})}vv("move",t),jA(),Ys.length>0&&t.preventDefault()}function $1(t){const{target:e}=t,{x:n,y:r}=Ay(t);Ty.clear(),Ac=!1,Ys.length>0&&(t.preventDefault(),d8(e)||t.stopImmediatePropagation()),vv("up",t),BA({target:e,x:n,y:r}),jA(),mv()}function d8(t){let e=t;for(;e;){if(e.hasAttribute(mn.resizeHandle))return!0;e=e.parentElement}return!1}function BA({target:t,x:e,y:n}){Ys.splice(0);let r=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(r=t),gh.forEach(s=>{const{element:o,hitAreaMargins:a}=s,u=o.getBoundingClientRect(),{bottom:c,left:f,right:p,top:g}=u,m=BX?a.coarse:a.fine;if(e>=f-m&&e<=p+m&&n>=g-m&&n<=c+m){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&LX(r,o)>0){let S=r,E=!1;for(;S&&!S.contains(o);){if(DX(S.getBoundingClientRect(),u)){E=!0;break}S=S.parentElement}if(E)return}Ys.push(s)}})}function q1(t,e){Ty.set(t,e)}function jA(){let t=!1,e=!1;Ys.forEach(r=>{const{direction:s}=r;s==="horizontal"?t=!0:e=!0});let n=0;Ty.forEach(r=>{n|=r}),t&&e?j1("intersection",n):t?j1("horizontal",n):e?j1("vertical",n):PX()}let W1=new AbortController;function mv(){W1.abort(),W1=new AbortController;const t={capture:!0,signal:W1.signal};gh.size&&(Ac?(Ys.length>0&&El.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("contextmenu",$1,t),r.addEventListener("pointerleave",H1,t),r.addEventListener("pointermove",H1,t))}),window.addEventListener("pointerup",$1,t),window.addEventListener("pointercancel",$1,t)):El.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("pointerdown",HX,t),r.addEventListener("pointermove",H1,t))}))}function vv(t,e){gh.forEach(n=>{const{setResizeHandlerState:r}=n,s=Ys.includes(n);r(t,s,e)})}function $X(){const[t,e]=A.useState(0);return A.useCallback(()=>e(n=>n+1),[])}function tt(t,e){if(!t)throw console.error(e),Error(e)}function Fl(t,e,n=FA){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function li(t,e,n=FA){return Fl(t,e,n)===0}function ss(t,e,n){return Fl(t,e,n)===0}function qX(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++){const s=t[r],o=e[r];if(!ss(s,o,n))return!1}return!0}function mc({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];tt(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:s=0,collapsible:o,maxSize:a=100,minSize:u=0}=r;if(Fl(n,u)<0)if(o){const c=(s+u)/2;Fl(n,c)<0?n=s:n=u}else n=u;return n=Math.min(a,n),n=parseFloat(n.toFixed(FA)),n}function Bf({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:o}){if(ss(t,0))return e;const a=[...e],[u,c]=r;tt(u!=null,"Invalid first pivot index"),tt(c!=null,"Invalid second pivot index");let f=0;if(o==="keyboard"){{const g=t<0?c:u,m=n[g];tt(m,`Panel constraints not found for index ${g}`);const{collapsedSize:y=0,collapsible:S,minSize:E=0}=m;if(S){const C=e[g];if(tt(C!=null,`Previous layout not found for panel index ${g}`),ss(C,y)){const w=E-C;Fl(w,Math.abs(t))>0&&(t=t<0?0-w:w)}}}{const g=t<0?u:c,m=n[g];tt(m,`No panel constraints found for index ${g}`);const{collapsedSize:y=0,collapsible:S,minSize:E=0}=m;if(S){const C=e[g];if(tt(C!=null,`Previous layout not found for panel index ${g}`),ss(C,E)){const w=C-y;Fl(w,Math.abs(t))>0&&(t=t<0?0-w:w)}}}}{const g=t<0?1:-1;let m=t<0?c:u,y=0;for(;;){const E=e[m];tt(E!=null,`Previous layout not found for panel index ${m}`);const w=mc({panelConstraints:n,panelIndex:m,size:100})-E;if(y+=w,m+=g,m<0||m>=n.length)break}const S=Math.min(Math.abs(t),Math.abs(y));t=t<0?0-S:S}{let m=t<0?u:c;for(;m>=0&&m<n.length;){const y=Math.abs(t)-Math.abs(f),S=e[m];tt(S!=null,`Previous layout not found for panel index ${m}`);const E=S-y,C=mc({panelConstraints:n,panelIndex:m,size:E});if(!ss(S,C)&&(f+=S-C,a[m]=C,f.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?m--:m++}}if(qX(s,a))return s;{const g=t<0?c:u,m=e[g];tt(m!=null,`Previous layout not found for panel index ${g}`);const y=m+f,S=mc({panelConstraints:n,panelIndex:g,size:y});if(a[g]=S,!ss(S,y)){let E=y-S,w=t<0?c:u;for(;w>=0&&w<n.length;){const x=a[w];tt(x!=null,`Previous layout not found for panel index ${w}`);const T=x+E,R=mc({panelConstraints:n,panelIndex:w,size:T});if(ss(x,R)||(E-=R-x,a[w]=R),ss(E,0))break;t>0?w--:w++}}}const p=a.reduce((g,m)=>m+g,0);return ss(p,100)?a:s}function WX({layout:t,panelsArray:e,pivotIndices:n}){let r=0,s=100,o=0,a=0;const u=n[0];tt(u!=null,"No pivot index found"),e.forEach((g,m)=>{const{constraints:y}=g,{maxSize:S=100,minSize:E=0}=y;m===u?(r=E,s=S):(o+=E,a+=S)});const c=Math.min(s,100-o),f=Math.max(r,100-a),p=t[u];return{valueMax:c,valueMin:f,valueNow:p}}function mh(t,e=document){return Array.from(e.querySelectorAll(`[${mn.resizeHandleId}][data-panel-group-id="${t}"]`))}function f8(t,e,n=document){const s=mh(t,n).findIndex(o=>o.getAttribute(mn.resizeHandleId)===e);return s??null}function h8(t,e,n){const r=f8(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function p8(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return r||null}function Ry(t,e=document){const n=e.querySelector(`[${mn.resizeHandleId}="${t}"]`);return n||null}function GX(t,e,n,r=document){var s,o,a,u;const c=Ry(e,r),f=mh(t,r),p=c?f.indexOf(c):-1,g=(s=(o=n[p])===null||o===void 0?void 0:o.id)!==null&&s!==void 0?s:null,m=(a=(u=n[p+1])===null||u===void 0?void 0:u.id)!==null&&a!==void 0?a:null;return[g,m]}function VX({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:s,panelGroupElement:o,setLayout:a}){A.useRef({didWarnAboutMissingResizeHandle:!1}),Rl(()=>{if(!o)return;const u=mh(n,o);for(let c=0;c<s.length-1;c++){const{valueMax:f,valueMin:p,valueNow:g}=WX({layout:r,panelsArray:s,pivotIndices:[c,c+1]}),m=u[c];if(m!=null){const y=s[c];tt(y,`No panel data found for index "${c}"`),m.setAttribute("aria-controls",y.id),m.setAttribute("aria-valuemax",""+Math.round(f)),m.setAttribute("aria-valuemin",""+Math.round(p)),m.setAttribute("aria-valuenow",g!=null?""+Math.round(g):"")}}return()=>{u.forEach((c,f)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,r,s,o]),A.useEffect(()=>{if(!o)return;const u=e.current;tt(u,"Eager values not found");const{panelDataArray:c}=u,f=p8(n,o);tt(f!=null,`No group found for id "${n}"`);const p=mh(n,o);tt(p,`No resize handles found for group id "${n}"`);const g=p.map(m=>{const y=m.getAttribute(mn.resizeHandleId);tt(y,"Resize handle element has no handle id attribute");const[S,E]=GX(n,y,c,o);if(S==null||E==null)return()=>{};const C=w=>{if(!w.defaultPrevented)switch(w.key){case"Enter":{w.preventDefault();const x=c.findIndex(T=>T.id===S);if(x>=0){const T=c[x];tt(T,`No panel data found for index ${x}`);const R=r[x],{collapsedSize:M=0,collapsible:O,minSize:I=0}=T.constraints;if(R!=null&&O){const P=Bf({delta:ss(R,M)?I-M:M-R,initialLayout:r,panelConstraints:c.map(k=>k.constraints),pivotIndices:h8(n,y,o),prevLayout:r,trigger:"keyboard"});r!==P&&a(P)}}break}}};return m.addEventListener("keydown",C),()=>{m.removeEventListener("keydown",C)}});return()=>{g.forEach(m=>m())}},[o,t,e,n,r,s,a])}function GM(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function g8(t,e){const n=t==="horizontal",{x:r,y:s}=Ay(e);return n?r:s}function KX(t,e,n,r,s){const o=n==="horizontal",a=Ry(e,s);tt(a,`No resize handle element found for id "${e}"`);const u=a.getAttribute(mn.groupId);tt(u,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=r;const f=g8(n,t),p=p8(u,s);tt(p,`No group element found for id "${u}"`);const g=p.getBoundingClientRect(),m=o?g.width:g.height;return(f-c)/m*100}function YX(t,e,n,r,s,o){if(r8(t)){const a=n==="horizontal";let u=0;t.shiftKey?u=100:s!=null?u=s:u=10;let c=0;switch(t.key){case"ArrowDown":c=a?0:u;break;case"ArrowLeft":c=a?-u:0;break;case"ArrowRight":c=a?u:0;break;case"ArrowUp":c=a?0:-u;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return r==null?0:KX(t,e,n,r,o)}function ZX({panelDataArray:t}){const e=Array(t.length),n=t.map(o=>o.constraints);let r=0,s=100;for(let o=0;o<t.length;o++){const a=n[o];tt(a,`Panel constraints not found for index ${o}`);const{defaultSize:u}=a;u!=null&&(r++,e[o]=u,s-=u)}for(let o=0;o<t.length;o++){const a=n[o];tt(a,`Panel constraints not found for index ${o}`);const{defaultSize:u}=a;if(u!=null)continue;const c=t.length-r,f=s/c;r++,e[o]=f,s-=f}return e}function Vu(t,e,n){e.forEach((r,s)=>{const o=t[s];tt(o,`Panel data not found for index ${s}`);const{callbacks:a,constraints:u,id:c}=o,{collapsedSize:f=0,collapsible:p}=u,g=n[c];if(g==null||r!==g){n[c]=r;const{onCollapse:m,onExpand:y,onResize:S}=a;S&&S(r,g),p&&(m||y)&&(y&&(g==null||li(g,f))&&!li(r,f)&&y(),m&&(g==null||!li(g,f))&&li(r,f)&&m())}})}function zg(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function XX({defaultSize:t,dragState:e,layout:n,panelData:r,panelIndex:s,precision:o=3}){const a=n[s];let u;return a==null?u=t!=null?t.toPrecision(o):"1":r.length===1?u="1":u=a.toPrecision(o),{flexBasis:0,flexGrow:u,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function QX(t,e=10){let n=null;return(...s)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...s)},e)}}function VM(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function m8(t){return`react-resizable-panels:${t}`}function v8(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:s,order:o}=e;return s?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function y8(t,e){try{const n=m8(t),r=e.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function JX(t,e,n){var r,s;const o=(r=y8(t,n))!==null&&r!==void 0?r:{},a=v8(e);return(s=o[a])!==null&&s!==void 0?s:null}function eQ(t,e,n,r,s){var o;const a=m8(t),u=v8(e),c=(o=y8(t,s))!==null&&o!==void 0?o:{};c[u]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(a,JSON.stringify(c))}catch(f){console.error(f)}}function KM({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((o,a)=>o+a,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!ss(r,100)&&n.length>0)for(let o=0;o<e.length;o++){const a=n[o];tt(a!=null,`No layout data found for index ${o}`);const u=100/r*a;n[o]=u}let s=0;for(let o=0;o<e.length;o++){const a=n[o];tt(a!=null,`No layout data found for index ${o}`);const u=mc({panelConstraints:e,panelIndex:o,size:a});a!=u&&(s+=a-u,n[o]=u)}if(!ss(s,0))for(let o=0;o<e.length;o++){const a=n[o];tt(a!=null,`No layout data found for index ${o}`);const u=a+s,c=mc({panelConstraints:e,panelIndex:o,size:u});if(a!==c&&(s-=c-a,n[o]=c,ss(s,0)))break}return n}const tQ=100,jf={getItem:t=>(VM(jf),jf.getItem(t)),setItem:(t,e)=>{VM(jf),jf.setItem(t,e)}},YM={};function b8({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:s,id:o=null,onLayout:a=null,keyboardResizeBy:u=null,storage:c=jf,style:f,tagName:p="div",...g}){const m=zA(o),y=A.useRef(null),[S,E]=A.useState(null),[C,w]=A.useState([]),x=$X(),T=A.useRef({}),R=A.useRef(new Map),M=A.useRef(0),O=A.useRef({autoSaveId:t,direction:r,dragState:S,id:m,keyboardResizeBy:u,onLayout:a,storage:c}),I=A.useRef({layout:C,panelDataArray:[],panelDataArrayChanged:!1});A.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),A.useImperativeHandle(s,()=>({getId:()=>O.current.id,getLayout:()=>{const{layout:K}=I.current;return K},setLayout:K=>{const{onLayout:J}=O.current,{layout:oe,panelDataArray:he}=I.current,ue=KM({layout:K,panelConstraints:he.map(ve=>ve.constraints)});GM(oe,ue)||(w(ue),I.current.layout=ue,J&&J(ue),Vu(he,ue,T.current))}}),[]),Rl(()=>{O.current.autoSaveId=t,O.current.direction=r,O.current.dragState=S,O.current.id=m,O.current.onLayout=a,O.current.storage=c}),VX({committedValuesRef:O,eagerValuesRef:I,groupId:m,layout:C,panelDataArray:I.current.panelDataArray,setLayout:w,panelGroupElement:y.current}),A.useEffect(()=>{const{panelDataArray:K}=I.current;if(t){if(C.length===0||C.length!==K.length)return;let J=YM[t];J==null&&(J=QX(eQ,tQ),YM[t]=J);const oe=[...K],he=new Map(R.current);J(t,oe,he,C,c)}},[t,C,c]),A.useEffect(()=>{});const P=A.useCallback(K=>{const{onLayout:J}=O.current,{layout:oe,panelDataArray:he}=I.current;if(K.constraints.collapsible){const ue=he.map(Ee=>Ee.constraints),{collapsedSize:ve=0,panelSize:_e,pivotIndices:Xe}=ml(he,K,oe);if(tt(_e!=null,`Panel size not found for panel "${K.id}"`),!li(_e,ve)){R.current.set(K.id,_e);const pt=lc(he,K)===he.length-1?_e-ve:ve-_e,Ce=Bf({delta:pt,initialLayout:oe,panelConstraints:ue,pivotIndices:Xe,prevLayout:oe,trigger:"imperative-api"});zg(oe,Ce)||(w(Ce),I.current.layout=Ce,J&&J(Ce),Vu(he,Ce,T.current))}}},[]),k=A.useCallback((K,J)=>{const{onLayout:oe}=O.current,{layout:he,panelDataArray:ue}=I.current;if(K.constraints.collapsible){const ve=ue.map(ze=>ze.constraints),{collapsedSize:_e=0,panelSize:Xe=0,minSize:Ee=0,pivotIndices:pt}=ml(ue,K,he),Ce=J??Ee;if(li(Xe,_e)){const ze=R.current.get(K.id),Be=ze!=null&&ze>=Ce?ze:Ce,pr=lc(ue,K)===ue.length-1?Xe-Be:Be-Xe,Et=Bf({delta:pr,initialLayout:he,panelConstraints:ve,pivotIndices:pt,prevLayout:he,trigger:"imperative-api"});zg(he,Et)||(w(Et),I.current.layout=Et,oe&&oe(Et),Vu(ue,Et,T.current))}}},[]),H=A.useCallback(K=>{const{layout:J,panelDataArray:oe}=I.current,{panelSize:he}=ml(oe,K,J);return tt(he!=null,`Panel size not found for panel "${K.id}"`),he},[]),F=A.useCallback((K,J)=>{const{panelDataArray:oe}=I.current,he=lc(oe,K);return XX({defaultSize:J,dragState:S,layout:C,panelData:oe,panelIndex:he})},[S,C]),B=A.useCallback(K=>{const{layout:J,panelDataArray:oe}=I.current,{collapsedSize:he=0,collapsible:ue,panelSize:ve}=ml(oe,K,J);return tt(ve!=null,`Panel size not found for panel "${K.id}"`),ue===!0&&li(ve,he)},[]),W=A.useCallback(K=>{const{layout:J,panelDataArray:oe}=I.current,{collapsedSize:he=0,collapsible:ue,panelSize:ve}=ml(oe,K,J);return tt(ve!=null,`Panel size not found for panel "${K.id}"`),!ue||Fl(ve,he)>0},[]),Y=A.useCallback(K=>{const{panelDataArray:J}=I.current;J.push(K),J.sort((oe,he)=>{const ue=oe.order,ve=he.order;return ue==null&&ve==null?0:ue==null?-1:ve==null?1:ue-ve}),I.current.panelDataArrayChanged=!0,x()},[x]);Rl(()=>{if(I.current.panelDataArrayChanged){I.current.panelDataArrayChanged=!1;const{autoSaveId:K,onLayout:J,storage:oe}=O.current,{layout:he,panelDataArray:ue}=I.current;let ve=null;if(K){const Xe=JX(K,ue,oe);Xe&&(R.current=new Map(Object.entries(Xe.expandToSizes)),ve=Xe.layout)}ve==null&&(ve=ZX({panelDataArray:ue}));const _e=KM({layout:ve,panelConstraints:ue.map(Xe=>Xe.constraints)});GM(he,_e)||(w(_e),I.current.layout=_e,J&&J(_e),Vu(ue,_e,T.current))}}),Rl(()=>{const K=I.current;return()=>{K.layout=[]}},[]);const ne=A.useCallback(K=>{let J=!1;const oe=y.current;return oe&&window.getComputedStyle(oe,null).getPropertyValue("direction")==="rtl"&&(J=!0),function(ue){ue.preventDefault();const ve=y.current;if(!ve)return()=>null;const{direction:_e,dragState:Xe,id:Ee,keyboardResizeBy:pt,onLayout:Ce}=O.current,{layout:ze,panelDataArray:Be}=I.current,{initialLayout:He}=Xe??{},pr=h8(Ee,K,ve);let Et=YX(ue,K,_e,Xe,pt,ve);const Gr=_e==="horizontal";Gr&&J&&(Et=-Et);const Wn=Be.map(xr=>xr.constraints),_r=Bf({delta:Et,initialLayout:He??ze,panelConstraints:Wn,pivotIndices:pr,prevLayout:ze,trigger:r8(ue)?"keyboard":"mouse-or-touch"}),to=!zg(ze,_r);(s8(ue)||o8(ue))&&M.current!=Et&&(M.current=Et,!to&&Et!==0?Gr?q1(K,Et<0?a8:l8):q1(K,Et<0?u8:c8):q1(K,0)),to&&(w(_r),I.current.layout=_r,Ce&&Ce(_r),Vu(Be,_r,T.current))}},[]),$=A.useCallback((K,J)=>{const{onLayout:oe}=O.current,{layout:he,panelDataArray:ue}=I.current,ve=ue.map(ze=>ze.constraints),{panelSize:_e,pivotIndices:Xe}=ml(ue,K,he);tt(_e!=null,`Panel size not found for panel "${K.id}"`);const pt=lc(ue,K)===ue.length-1?_e-J:J-_e,Ce=Bf({delta:pt,initialLayout:he,panelConstraints:ve,pivotIndices:Xe,prevLayout:he,trigger:"imperative-api"});zg(he,Ce)||(w(Ce),I.current.layout=Ce,oe&&oe(Ce),Vu(ue,Ce,T.current))},[]),ee=A.useCallback((K,J)=>{const{layout:oe,panelDataArray:he}=I.current,{collapsedSize:ue=0,collapsible:ve}=J,{collapsedSize:_e=0,collapsible:Xe,maxSize:Ee=100,minSize:pt=0}=K.constraints,{panelSize:Ce}=ml(he,K,oe);Ce!=null&&(ve&&Xe&&li(Ce,ue)?li(ue,_e)||$(K,_e):Ce<pt?$(K,pt):Ce>Ee&&$(K,Ee))},[$]),fe=A.useCallback((K,J)=>{const{direction:oe}=O.current,{layout:he}=I.current;if(!y.current)return;const ue=Ry(K,y.current);tt(ue,`Drag handle element not found for id "${K}"`);const ve=g8(oe,J);E({dragHandleId:K,dragHandleRect:ue.getBoundingClientRect(),initialCursorPosition:ve,initialLayout:he})},[]),de=A.useCallback(()=>{E(null)},[]),Ae=A.useCallback(K=>{const{panelDataArray:J}=I.current,oe=lc(J,K);oe>=0&&(J.splice(oe,1),delete T.current[K.id],I.current.panelDataArrayChanged=!0,x())},[x]),L=A.useMemo(()=>({collapsePanel:P,direction:r,dragState:S,expandPanel:k,getPanelSize:H,getPanelStyle:F,groupId:m,isPanelCollapsed:B,isPanelExpanded:W,reevaluatePanelConstraints:ee,registerPanel:Y,registerResizeHandle:ne,resizePanel:$,startDragging:fe,stopDragging:de,unregisterPanel:Ae,panelGroupElement:y.current}),[P,S,r,k,H,F,m,B,W,ee,Y,ne,$,fe,de,Ae]),V={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return A.createElement(xy.Provider,{value:L},A.createElement(p,{...g,children:e,className:n,id:o,ref:y,style:{...V,...f},[mn.group]:"",[mn.groupDirection]:r,[mn.groupId]:m}))}const S8=A.forwardRef((t,e)=>A.createElement(b8,{...t,forwardedRef:e}));b8.displayName="PanelGroup";S8.displayName="forwardRef(PanelGroup)";function lc(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function ml(t,e,n){const r=lc(t,e),o=r===t.length-1?[r-1,r]:[r,r+1],a=n[r];return{...e.constraints,panelSize:a,pivotIndices:o}}function nQ({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){A.useEffect(()=>{if(t||n==null||r==null)return;const s=Ry(e,r);if(s==null)return;const o=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const u=s.getAttribute(mn.groupId);tt(u,`No group element found for id "${u}"`);const c=mh(u,r),f=f8(u,e,r);tt(f!==null,`No resize element found for id "${e}"`);const p=a.shiftKey?f>0?f-1:c.length-1:f+1<c.length?f+1:0;c[p].focus();break}}};return s.addEventListener("keydown",o),()=>{s.removeEventListener("keydown",o)}},[r,t,e,n])}function E8({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:o,onClick:a,onDragging:u,onFocus:c,onPointerDown:f,onPointerUp:p,style:g={},tabIndex:m=0,tagName:y="div",...S}){var E,C;const w=A.useRef(null),x=A.useRef({onClick:a,onDragging:u,onPointerDown:f,onPointerUp:p});A.useEffect(()=>{x.current.onClick=a,x.current.onDragging=u,x.current.onPointerDown=f,x.current.onPointerUp=p});const T=A.useContext(xy);if(T===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:R,groupId:M,registerResizeHandle:O,startDragging:I,stopDragging:P,panelGroupElement:k}=T,H=zA(s),[F,B]=A.useState("inactive"),[W,Y]=A.useState(!1),[ne,$]=A.useState(null),ee=A.useRef({state:F});Rl(()=>{ee.current.state=F}),A.useEffect(()=>{if(n)$(null);else{const L=O(H);$(()=>L)}},[n,H,O]);const fe=(E=r?.coarse)!==null&&E!==void 0?E:15,de=(C=r?.fine)!==null&&C!==void 0?C:5;A.useEffect(()=>{if(n||ne==null)return;const L=w.current;tt(L,"Element ref not attached");let V=!1;return jX(H,L,R,{coarse:fe,fine:de},(J,oe,he)=>{if(!oe){B("inactive");return}switch(J){case"down":{B("drag"),V=!1,tt(he,'Expected event to be defined for "down" action'),I(H,he);const{onDragging:ue,onPointerDown:ve}=x.current;ue?.(!0),ve?.();break}case"move":{const{state:ue}=ee.current;V=!0,ue!=="drag"&&B("hover"),tt(he,'Expected event to be defined for "move" action'),ne(he);break}case"up":{B("hover"),P();const{onClick:ue,onDragging:ve,onPointerUp:_e}=x.current;ve?.(!1),_e?.(),V||ue?.();break}}})},[fe,R,n,de,O,H,ne,I,P]),nQ({disabled:n,handleId:H,resizeHandler:ne,panelGroupElement:k});const Ae={touchAction:"none",userSelect:"none"};return A.createElement(y,{...S,children:t,className:e,id:s,onBlur:()=>{Y(!1),o?.()},onFocus:()=>{Y(!0),c?.()},ref:w,role:"separator",style:{...Ae,...g},tabIndex:m,[mn.groupDirection]:R,[mn.groupId]:M,[mn.resizeHandle]:"",[mn.resizeHandleActive]:F==="drag"?"pointer":W?"keyboard":void 0,[mn.resizeHandleEnabled]:!n,[mn.resizeHandleId]:H,[mn.resizeHandleState]:F})}E8.displayName="PanelResizeHandle";function rQ({className:t,...e}){return D.jsx(S8,{className:dn("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...e})}const Bg=n8;function G1({className:t,...e}){return D.jsx(E8,{className:dn("relative w-px shrink-0 bg-line transition-colors cursor-col-resize","after:absolute after:inset-y-0 after:left-1/2 after:w-1.5 after:-translate-x-1/2","data-[resize-handle-state=hover]:bg-line-strong","data-[resize-handle-state=drag]:bg-accent","focus-visible:outline-none focus-visible:bg-accent",t),...e})}const C8=A.createContext(null);function bxe(){return A.useContext(C8)}function Sxe({nav:t,list:e,reading:n,intelligence:r,intelligenceOpen:s=!0,hasThread:o=!0,density:a="comfortable",header:u,overlay:c,skeleton:f,isLoading:p=!1,initialWidth:g,navOpen:m,onOpenNav:y,onCloseNav:S}){const[E,C]=AX(g),w=xX(C??0),x=w.nav,T=w.reading&&!!n,R=w.intelligence,[M,O]=A.useState(!1),I=m!==void 0,P=I?m:M,k=()=>{I||O(!0),y?.()},H=()=>{I||O(!1),S?.()},F=R&&s&&o&&!!r,B={panes:w,containerWidth:C,showNavPane:x,openNav:k,showReadingPane:T,showIntelligencePane:R};return D.jsx(C8.Provider,{value:B,children:D.jsx("div",{ref:E,className:"@container flex h-dvh w-full flex-col overflow-hidden bg-canvas font-sans text-fg",children:p&&f?f:D.jsxs(D.Fragment,{children:[!x&&u&&D.jsx("div",{className:"shrink-0",children:u}),D.jsxs(rQ,{direction:"horizontal",className:"min-h-0 flex-1",children:[x&&D.jsxs(D.Fragment,{children:[D.jsx(Bg,{id:"nav",order:1,defaultSize:17,minSize:12,maxSize:24,className:"min-w-0",children:t}),D.jsx(G1,{})]}),D.jsx(Bg,{id:"list",order:2,defaultSize:T?a==="compact"?36:27:83,minSize:18,maxSize:T?48:88,className:"min-w-0",children:e}),T&&D.jsxs(D.Fragment,{children:[D.jsx(G1,{}),D.jsx(Bg,{id:"reading",order:3,minSize:24,className:"min-w-0",children:n})]}),F&&D.jsxs(D.Fragment,{children:[D.jsx(G1,{}),D.jsx(Bg,{id:"intelligence",order:4,defaultSize:21,minSize:15,maxSize:32,className:"min-w-0",children:r})]})]}),!x&&D.jsx(IX,{open:P,onClose:H,title:"Folders",anchor:"left",children:t}),c]})})})}const sQ="inline-flex items-center justify-center gap-2 rounded-md font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface disabled:opacity-50 disabled:pointer-events-none",oQ={primary:"bg-accent text-accent-fg hover:bg-accent-hover",secondary:"bg-surface text-fg border border-line hover:bg-surface-sunken hover:border-line-strong",ghost:"text-fg-muted hover:bg-surface-sunken hover:text-fg",danger:"bg-danger text-accent-fg hover:opacity-90"},iQ={sm:"h-7 px-2.5 text-xs",md:"h-9 px-3.5 text-sm"};function Gm({variant:t="primary",size:e="md",icon:n,className:r,children:s,...o}){return D.jsxs("button",{type:"button",className:dn(sQ,oQ[t],iQ[e],r),...o,children:[n,s]})}const aQ={neutral:"bg-surface-sunken text-fg-muted",accent:"bg-accent-2-soft text-accent-2",positive:"bg-surface-sunken text-positive",warning:"bg-surface-sunken text-warning",danger:"bg-danger-soft text-danger"},lQ={neutral:"bg-fg-subtle",accent:"bg-accent-2",positive:"bg-positive",warning:"bg-warning",danger:"bg-danger"};function ZM({tone:t="neutral",dot:e,className:n,children:r,...s}){return D.jsxs("span",{className:dn("inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-2xs font-medium",aQ[t],n),...s,children:[e&&D.jsx("span",{className:dn("size-1.5 rounded-full",lQ[t])}),r]})}const XM=10;function uQ({section:t,Row:e,selectedThreadId:n,initialExpanded:r=!1,initialCollapsed:s=!1,onSelectThread:o}){const[a,u]=A.useState(r),[c,f]=A.useState(s),p=t.threads.length>XM,m=!a&&p?t.threads.slice(0,XM):t.threads,y=t.threads.length-m.length;return D.jsxs("div",{children:[t.label&&D.jsxs("button",{type:"button","aria-expanded":!c,onClick:()=>f(S=>!S),className:"sticky top-0 z-10 flex h-section-row w-full items-center gap-1.5 border-b border-line bg-surface-sunken px-row-inset text-left transition-colors hover:bg-surface",children:[D.jsx("span",{className:"flex-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:t.label}),D.jsx("span",{className:"text-2xs text-fg-subtle tabular-nums",children:t.threads.length}),D.jsx(zM,{className:dn("size-3 shrink-0 text-fg-subtle transition-transform duration-200",c?"rotate-0":"rotate-180")})]}),!c&&D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"divide-y divide-line",children:m.map(S=>D.jsx(e,{thread:S,active:S.id===n,onClick:()=>o?.(S.id)},S.id))}),p&&D.jsxs("button",{type:"button",onClick:()=>u(S=>!S),className:"flex w-full items-center justify-center border-b border-line px-row-inset py-1.5 text-2xs font-medium text-accent transition-colors hover:bg-surface",children:[a?"Show less":`Show ${y} more`,!a&&D.jsx(zM,{className:"ml-1 size-3"})]})]})]})}function cQ(t){return t.target!==t.currentTarget?!1:t.key==="Enter"||t.key===" "}function dQ({className:t}){return D.jsx("svg",{viewBox:"0 0 12 12",className:t,fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:D.jsx("path",{d:"M2 4l4 4 4-4"})})}function QM({className:t}){return D.jsx("svg",{viewBox:"0 0 12 12",className:t,fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:D.jsx("path",{d:"M3 3l6 6M9 3l-6 6"})})}function fQ({categories:t,filters:e,sources:n,sourcesNote:r,selectedCategory:s,activeFilters:o,expanded:a,onSelectCategory:u,onSelectSource:c,onToggleFilter:f,onClear:p,onExpandedChange:g,children:m}){const y=a!==void 0,[S,E]=A.useState(!1),C=y?a:S,w=A.useCallback(ne=>{y||E(ne),g?.(ne)},[y,g]),x=t[0],T=x!==void 0&&s===x.id,R=n?.[0],M=n?.find(ne=>ne.active),O=R===void 0||M?.id===R.id,I=!T||o.size>0||!O&&!!M,P=A.useCallback(()=>{R&&c?.(R.id)},[R,c]),k=A.useCallback(()=>{p(),P()},[p,P]),H=t.find(ne=>ne.id===s),F=I?D.jsxs(D.Fragment,{children:[!O&&M&&D.jsx("span",{className:"inline-flex items-center rounded-full border border-accent-2 bg-accent-2-soft px-2 py-0.5 text-2xs font-medium text-accent-2",children:M.label}),!T&&H&&D.jsx(ZM,{tone:H.tone??"neutral",children:H.label}),e.filter(ne=>o.has(ne.id)).map(ne=>D.jsx("span",{className:"inline-flex items-center rounded-full border border-accent-2 bg-accent-2-soft px-2 py-0.5 text-2xs font-medium text-accent-2",children:ne.label},ne.id))]}):D.jsx("span",{className:"text-2xs text-fg-subtle",children:"Filters"}),B=n&&n.length>1&&D.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-b border-line px-row-inset pb-2 pt-2",children:[n.map(ne=>D.jsxs("button",{type:"button",onClick:()=>c?.(ne.id),className:dn("flex items-center gap-1 rounded-full border px-2.5 py-0.5 text-2xs transition-colors",ne.active?"border-accent-2 bg-accent-2-soft font-medium text-accent-2":"border-line text-fg-muted hover:border-line-strong"),children:[ne.label,ne.count!=null&&ne.count>0&&D.jsx("span",{className:"tabular-nums opacity-70",children:ne.count})]},ne.id)),r&&D.jsx("span",{className:"ml-auto shrink-0 text-2xs text-fg-subtle",children:r})]}),W=D.jsx("div",{className:"flex flex-wrap items-center gap-1.5 border-b border-line px-row-inset pb-1.5 pt-1.5",children:t.map(ne=>{const $=s===ne.id;return D.jsx("button",{type:"button",onClick:()=>u(ne.id),className:dn("shrink-0 rounded-full transition-opacity",$?"opacity-100 ring-1 ring-accent-2":"opacity-60 hover:opacity-100"),children:D.jsx(ZM,{tone:ne.tone??"neutral",children:ne.label})},ne.id)})}),Y=D.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-b border-line px-row-inset pb-2 pt-1.5",children:[e.map(ne=>{const $=o.has(ne.id);return D.jsx("button",{type:"button",onClick:()=>f(ne.id),className:dn("shrink-0 rounded-full border px-2.5 py-0.5 text-2xs transition-colors",$?"border-accent-2 bg-accent-2-soft font-medium text-accent-2":"border-line text-fg-muted hover:border-line-strong"),children:ne.label},ne.id)}),I&&D.jsxs("button",{type:"button",onClick:k,className:"ml-auto flex items-center gap-1 px-1 text-2xs text-fg-subtle hover:text-fg-muted",children:[D.jsx(QM,{className:"size-3"}),"Clear"]})]});return D.jsxs("div",{className:"flex h-full w-full flex-col overflow-hidden",children:[D.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":C,"aria-label":C?"Collapse filters":"Expand filters",onClick:()=>w(!C),onKeyDown:ne=>{cQ(ne)&&(ne.preventDefault(),w(!C))},className:"flex h-section-row w-full shrink-0 cursor-pointer items-center gap-1.5 overflow-x-hidden border-b border-line bg-surface-sunken px-row-inset text-left hover:bg-surface",children:[F,I&&D.jsx("button",{type:"button","aria-label":"Clear filters",onClick:ne=>{ne.stopPropagation(),k()},className:"flex size-6 items-center justify-center text-fg-subtle hover:text-fg-muted",children:D.jsx(QM,{className:"size-3"})}),D.jsx(dQ,{className:dn("ml-auto size-3 shrink-0 text-fg-subtle transition-transform duration-200",C?"rotate-180":"rotate-0")})]}),C&&D.jsxs("div",{className:"shrink-0",children:[B,W,Y]}),D.jsx("div",{className:"flex-1 overflow-y-auto",children:m})]})}function hQ(t){return t.sentDate!=null?new Date(t.sentDate).toDateString()===new Date().toDateString():/^\d{1,2}:\d{2}$/.test(t.timeLabel)}const w8=[{id:"unread",label:"Unread",match:t=>!t.isRead},{id:"attachment",label:"Has attachment",match:t=>!!t.hasAttachment},{id:"contacts",label:"From contacts",match:t=>t.trust==="vip"||t.trust==="wellknown"},{id:"today",label:"Today",match:hQ}],pQ=w8.map(({id:t,label:e})=>({id:t,label:e}));function Exe({sections:t,briefCategory:e="all",selectedThreadId:n,Row:r,onSelectThread:s,onSelectBriefCategory:o,sources:a,sourcesNote:u,onSelectSource:c,defaultExpanded:f=!1}){const[p,g]=A.useState(new Set),[m,y]=A.useState(f),S=k=>{g(H=>{const F=new Set(H);return F.has(k)?F.delete(k):F.add(k),F})},E=w8.filter(k=>p.has(k.id)),C=k=>(e==="all"||k.category===e)&&E.every(H=>H.match(k)),w=e==="all",x=t.map(k=>({...k,threads:k.threads.filter(C)})).filter(k=>k.threads.length>0),T=t.flatMap(k=>k.threads).filter(C),R=TX.map(k=>({id:k.id,label:k.label,tone:k.id==="all"?"neutral":RX[k.id]})),M=pQ,O=()=>{o?.("all"),g(new Set)},I=w?x.length===0:T.length===0,P=D.jsxs(D.Fragment,{children:[w?x.map(k=>D.jsx(uQ,{section:k,Row:r,selectedThreadId:n,onSelectThread:s},k.id)):D.jsx("div",{className:"divide-y divide-line",children:T.map(k=>D.jsx(r,{thread:k,active:k.id===n,onClick:()=>s?.(k.id)},k.id))}),I&&D.jsx("div",{className:"px-row-inset py-6 text-center text-2xs text-fg-subtle",children:"No threads match these filters."})]});return D.jsx(fQ,{categories:R,filters:M,sources:a,sourcesNote:u,selectedCategory:e,activeFilters:p,expanded:m,onExpandedChange:y,onSelectCategory:k=>o?.(k),onSelectSource:c,onToggleFilter:k=>S(k),onClear:O,children:P})}const gQ={default:dn("flex h-9 items-center gap-2 rounded-md border border-line bg-surface-sunken px-3 text-sm","focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30 transition-colors"),inline:"flex items-center gap-2 bg-transparent text-sm"};function V1({icon:t,className:e,variant:n="default",ref:r,...s}){return D.jsxs("div",{className:dn(gQ[n],e),children:[t&&D.jsx("span",{className:"text-fg-subtle shrink-0",children:t}),D.jsx("input",{ref:r,className:"min-w-0 flex-1 bg-transparent text-fg placeholder:text-fg-subtle outline-none",...s})]})}function JM(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 mQ(t){if(Array.isArray(t))return t}function vQ(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,s,o,a,u=[],c=!0,f=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(c=(r=o.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(p){f=!0,s=p}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(f)throw s}}return u}}function yQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
12
|
+
`,recoverySuggestion:"Make sure a successful call to signIn is made before calling confirmSignInand that the session has not expired."});try{const{Session:f,ChallengeName:p,AuthenticationResult:g,ChallengeParameters:m}=await WV(r,s,o,e,u,Hr,c,n);return Zl({signInSession:f,username:r,challengeName:p,signInDetails:a}),g?(await xi({username:r,...g,NewDeviceMetadata:await Xl({userPoolId:u.userPoolId,userPoolEndpoint:u.userPoolEndpoint,newDeviceMetadata:g.NewDeviceMetadata,accessToken:g.AccessToken}),signInDetails:a}),Qs(),await Ga(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):Jl({challengeName:p,challengeParameters:m})}catch(f){Is(f);const p=od(f.name);if(p)return p;throw f}}const vK=t=>Rn(jn,Bn("GetUser"),or(),{...Hn,...t}),yK=t=>Rn(jn,Bn("VerifyUserAttribute"),or(),{...Hn,...t});async function bK(t){const e=Ht.getConfig().Auth?.Cognito;lt(e);const{userPoolEndpoint:n,userPoolId:r}=e,{confirmationCode:s,userAttributeKey:o}=t;fn(!!s,Ge.EmptyConfirmUserAttributeCode);const{tokens:a}=await vy({forceRefresh:!1});ed(a),await yK({endpointResolver:bt({endpointOverride:n})})({region:yt(r),userAgentValue:Nt(Ve.ConfirmUserAttribute)},{AccessToken:a.accessToken.toString(),AttributeName:o,Code:s})}new nr("AuthError");const SK={oauthSignInError:{message:Fn.OAUTH_ERROR,log:"Make sure Cognito Hosted UI has been configured correctly"},noConfig:{message:Fn.DEFAULT_MSG},missingAuthConfig:{message:Fn.DEFAULT_MSG},emptyUsername:{message:Fn.EMPTY_USERNAME},invalidUsername:{message:Fn.INVALID_USERNAME},emptyPassword:{message:Fn.EMPTY_PASSWORD},emptyCode:{message:Fn.EMPTY_CODE},signUpError:{message:Fn.SIGN_UP_ERROR},noMFA:{message:Fn.NO_MFA},invalidMFA:{message:Fn.INVALID_MFA},emptyChallengeResponse:{message:Fn.EMPTY_CHALLENGE},noUserSession:{message:Fn.NO_USER_SESSION},deviceConfig:{message:Fn.DEVICE_CONFIG},networkError:{message:Fn.NETWORK_ERROR},autoSignInError:{message:Fn.AUTOSIGNIN_ERROR},default:{message:Fn.DEFAULT_MSG}},ka=(t,e)=>new Le({message:t??"An error has occurred during the oauth process.",name:To.OAuthSignInError,recoverySuggestion:SK.oauthSignInError.log});var I_;(function(t){t.NoConfig="noConfig",t.MissingAuthConfig="missingAuthConfig",t.EmptyUsername="emptyUsername",t.InvalidUsername="invalidUsername",t.EmptyPassword="emptyPassword",t.EmptyCode="emptyCode",t.SignUpError="signUpError",t.NoMFA="noMFA",t.InvalidMFA="invalidMFA",t.EmptyChallengeResponse="emptyChallengeResponse",t.NoUserSession="noUserSession",t.Default="default",t.DeviceConfig="deviceConfig",t.NetworkError="networkError",t.AutoSignInError="autoSignInError",t.OAuthSignInError="oauthSignInError"})(I_||(I_={}));const EK="`signInWithRedirect` has been canceled.",CK="An error occurred while validating the state.",wK="Try to initiate an OAuth flow from Amplify",T5=async t=>{const e=await Lr.loadOAuthState(),n=t===e?e:void 0;if(!n)throw new Le({name:I_.OAuthSignInError,message:t===null?EK:CK,recoverySuggestion:t===null?void 0:wK});return n},R5=async({currentUrl:t,userAgentValue:e,clientId:n,redirectUri:r,responseType:s,domain:o,preferPrivateSession:a})=>{const u=new Wa(t),c=u.searchParams.get("error"),f=u.searchParams.get("error_description");if(c)throw ka(f??c);return s==="code"?_K({currentUrl:t,userAgentValue:e,clientId:n,redirectUri:r,domain:o,preferPrivateSession:a}):xK({currentUrl:t,redirectUri:r,preferPrivateSession:a})},_K=async({currentUrl:t,userAgentValue:e,clientId:n,redirectUri:r,domain:s,preferPrivateSession:o})=>{const a=new Wa(t),u=a.searchParams.get("code"),c=a.searchParams.get("state");if(!u||!c)throw ka("User cancelled OAuth flow.");const f=await T5(c),p="https://"+s+"/oauth2/token",g=await Lr.loadPKCE(),m={grant_type:"authorization_code",code:u,client_id:n,redirect_uri:r,...g?{code_verifier:g}:{}},y=Object.entries(m).map(([O,I])=>`${encodeURIComponent(O)}=${encodeURIComponent(I)}`).join("&"),{access_token:S,refresh_token:E,id_token:C,error:w,error_message:x,token_type:T,expires_in:R}=await(await fetch(p,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",[R$]:e},body:y})).json();if(w)throw ka(x??w);const M=(S&&gi(S).payload.username)??"username";return await xi({username:M,AccessToken:S,IdToken:C,RefreshToken:E}),I5({redirectUri:r,state:f,preferPrivateSession:o})},xK=async({currentUrl:t,redirectUri:e,preferPrivateSession:n})=>{const r=new Wa(t),{id_token:s,access_token:o,state:a,token_type:u,expires_in:c,error_description:f,error:p}=(r.hash??"#").substring(1).split("&").map(y=>y.split("=")).reduce((y,[S,E])=>({...y,[S]:E}),{id_token:void 0,access_token:void 0,state:void 0,token_type:void 0,expires_in:void 0,error_description:void 0,error:void 0});if(p)throw ka(f??p);if(!o)throw ka("No access token returned from OAuth flow.");const g=await T5(a),m=(o&&gi(o).payload.username)??"username";return await xi({username:m,AccessToken:o,IdToken:s}),I5({redirectUri:e,state:g,preferPrivateSession:n})},I5=async({redirectUri:t,state:e,preferPrivateSession:n})=>{await Hr.setOAuthMetadata({oauthSignIn:!0}),await Lr.clearOAuthData(),await Lr.storeOAuthSignIn(!0,n),c5(),RK(t),AK(e)&&Ao.dispatch("auth",{event:"customOAuthState",data:xW(TK(e))},"Auth",xo),Ao.dispatch("auth",{event:"signInWithRedirect"},"Auth",xo),await Ga()},AK=t=>/-/.test(t),TK=t=>t.split("-").splice(1).join("-"),RK=t=>{typeof window<"u"&&typeof window.history<"u"&&window.history.replaceState(window.history.state,"",t)};function DA(t,e){{const n=t?.find(IK)??t?.find(OK),r=t?.find(MK)??t?.find(NK);if(n)return n;throw r?BW:FW}}const IK=t=>t.startsWith(String(window.location.origin+(window.location.pathname||"/"))),OK=t=>t.includes(String(window.location.hostname)),NK=t=>t.startsWith("http://"),MK=t=>t.startsWith("https://"),LA=async t=>{c5(),await Lr.clearOAuthInflightData(),Ao.dispatch("auth",{event:"signInWithRedirect_failure",data:{error:t}},"Auth",xo)},PK=async t=>{try{lt(t),hy(t),Lr.setAuthConfig(t)}catch{return}if(await Lr.loadOAuthInFlight())try{const e=window.location.href,{loginWith:n,userPoolClientId:r}=t,{domain:s,redirectSignIn:o,responseType:a}=n.oauth,u=DA(o);await R5({currentUrl:e,clientId:r,domain:s,redirectUri:u,responseType:a,userAgentValue:Nt(Ve.SignInWithRedirect)})}catch(e){await LA(e)}};my()&&Ht[k6](PK);const kK={Google:"Google",Facebook:"Facebook",Amazon:"LoginWithAmazon",Apple:"SignInWithApple"},O5=async t=>{window?.location&&(window.location.href=t.replace("http://","https://"))},_M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",DK=t=>{const e=new Uint8Array(t);bA().getRandomValues(e);let n="",r;for(const s of e)n+=_M.charAt(s%_M.length);return{value:n,method:"S256",toCodeChallenge(){return r||(r=LK(n),r)}}};function LK(t){const e=new Ul;return e.update(t),UK(Nc.convert(e.digestSync(),{urlSafe:!0}))}function UK(t){return t.replace(/=/g,"")}const FK=()=>_W(32),zK=t=>{async function e(n){if(n.persisted&&await t.loadOAuthInFlight()){const s=ka("User cancelled OAuth flow.");await LA(s)}window.removeEventListener("pageshow",e)}window.addEventListener("pageshow",e)};async function N5(t){const e=Ht.getConfig().Auth?.Cognito;lt(e),hy(e),Lr.setAuthConfig(e),t?.options?.prompt||await b5();let n="COGNITO",r;return typeof t?.provider=="string"?n=kK[t.provider]:t?.provider?.custom?n=t.provider.custom:t?.provider?.idpIdentifier&&({idpIdentifier:r}=t.provider),BK({oauthConfig:e.loginWith.oauth,clientId:e.userPoolClientId,provider:n,idpIdentifier:r,customState:t?.customState,preferPrivateSession:t?.options?.preferPrivateSession,options:{loginHint:t?.options?.loginHint,lang:t?.options?.lang,nonce:t?.options?.nonce,prompt:t?.options?.prompt},authSessionOpener:t?.options?.authSessionOpener})}const BK=async({oauthConfig:t,provider:e,idpIdentifier:n,clientId:r,customState:s,preferPrivateSession:o,options:a,authSessionOpener:u})=>{const{domain:c,redirectSignIn:f,responseType:p,scopes:g}=t,{loginHint:m,lang:y,nonce:S,prompt:E}=a??{},C=FK(),w=u||O5,x=s?`${C}-${AW(s)}`:C,{value:T,method:R,toCodeChallenge:M}=DK(128),O=DA(t.redirectSignIn);my()&&Lr.storeOAuthInFlight(!0),Lr.storeOAuthState(x),Lr.storePKCE(T);const I=new URLSearchParams;I.append("redirect_uri",O),I.append("response_type",p),I.append("client_id",r),n?I.append("idp_identifier",n):I.append("identity_provider",e),I.append("scope",g.join(" ")),m&&I.append("login_hint",m),y&&I.append("lang",y),S&&I.append("nonce",S),E&&I.append("prompt",E.toLowerCase()),I.append("state",x),p==="code"&&(I.append("code_challenge",M()),I.append("code_challenge_method",R));const P=`https://${c}/oauth2/authorize?${I.toString()}`;zK(Lr);const{type:k,error:H,url:F}=await w(P,f,o)??{};try{if(k==="error")throw ka(String(H));if(k==="canceled")throw ka(String(k));k==="success"&&F&&await R5({currentUrl:F,clientId:r,domain:c,redirectUri:O,responseType:p,userAgentValue:Nt(Ve.SignInWithRedirect),preferPrivateSession:o})}catch(B){throw await LA(B),B}},jK=async t=>{const e=t.getConfig().Auth?.Cognito;lt(e);const{userPoolEndpoint:n,userPoolId:r}=e,{tokens:s}=await B6(t,{forceRefresh:!1});ed(s);const o=vK({endpointResolver:bt({endpointOverride:n})}),{UserAttributes:a}=await o({region:yt(r),userAgentValue:Nt(Ve.FetchUserAttributes)},{AccessToken:s.accessToken.toString()});return MW(a)},M5=()=>jK(Ht),HK=async t=>{await t.clearOAuthData(),Hr.clearTokens(),await j6(),Ao.dispatch("auth",{event:"signedOut"},"Auth",xo)},$K=async(t,e=!1,n)=>{hy(t);const{loginWith:r,userPoolClientId:s}=t,{domain:o,redirectSignOut:a}=r.oauth,u=DA(a),c=`https://${o}/logout?${Object.entries({client_id:s,logout_uri:encodeURIComponent(u)}).map(([f,p])=>`${f}=${p}`).join("&")}`;return O5(c)},qK=async(t,e,n,r)=>{const{isOAuthSignIn:s}=await e.loadOAuthSignIn(),o=await n.getOAuthMetadata();if(await HK(e),s||o?.oauthSignIn)return $K(t,!1)},WK=t=>Rn(jn,Bn("RevokeToken"),or(),{...Hn,...t}),GK=new nr("Auth");async function VK(t){const e=Ht.getConfig().Auth?.Cognito;lt(e),await KK(e);let n;try{hy(e),n=!0}catch{n=!1}if(n){const r=new u5(Gh);r.setAuthConfig(e);const{type:s}=await qK(e,r,Hr)??{};if(s==="error")throw new Le({name:jW,message:"An error occurred when attempting to log out from OAuth provider."})}else Hr.clearTokens(),await j6(),Ao.dispatch("auth",{event:"signedOut"},"Auth",xo)}async function KK(t){try{const{userPoolEndpoint:e,userPoolId:n,userPoolClientId:r}=t,s=await Hr.getTokenStore().loadTokens();o5(s),YK(s.accessToken)&&await WK({endpointResolver:bt({endpointOverride:e})})({region:yt(n),userAgentValue:Nt(Ve.SignOut)},{ClientId:r,Token:s.refreshToken})}catch{GK.debug("Client signOut error caught but will proceed with token removal")}}const YK=t=>!!t?.payload?.origin_jti,ZK=t=>Rn(jn,Bn("GetUserAttributeVerificationCode"),or(),{...Hn,...t}),XK=async t=>{const{userAttributeKey:e,options:n}=t,r=Ht.getConfig().Auth?.Cognito,s=n?.clientMetadata;lt(r);const{userPoolEndpoint:o,userPoolId:a}=r,{tokens:u}=await vy({forceRefresh:!1});ed(u);const c=ZK({endpointResolver:bt({endpointOverride:o})}),{CodeDeliveryDetails:f}=await c({region:yt(a),userAgentValue:Nt(Ve.SendUserAttributeVerificationCode)},{AccessToken:u.accessToken.toString(),ClientMetadata:s,AttributeName:e}),{DeliveryMedium:p,AttributeName:g,Destination:m}={...f};return{destination:m,deliveryMedium:p,attributeName:g}},QK={identityId:"identityId"},JK=new nr("DefaultIdentityIdStore");class P5{setAuthConfig(e){Lm(e.Cognito),this.authConfig=e,this._authKeys=eY("Cognito",e.Cognito.identityPoolId)}constructor(e){this._authKeys={},this._hasGuestIdentityId=!1,this.keyValueStorage=e}async loadIdentityId(){Lm(this.authConfig?.Cognito);try{if(this._primaryIdentityId)return{id:this._primaryIdentityId,type:"primary"};{const e=await this.keyValueStorage.getItem(this._authKeys.identityId);return e?(this._hasGuestIdentityId=!0,{id:e,type:"guest"}):null}}catch(e){return JK.log("Error getting stored IdentityId.",e),null}}async storeIdentityId(e){Lm(this.authConfig?.Cognito),e.type==="guest"?(this.keyValueStorage.setItem(this._authKeys.identityId,e.id),this._primaryIdentityId=void 0,this._hasGuestIdentityId=!0):(this._primaryIdentityId=e.id,this._hasGuestIdentityId&&(this.keyValueStorage.removeItem(this._authKeys.identityId),this._hasGuestIdentityId=!1))}async clearIdentityId(){this._primaryIdentityId=void 0,await this.keyValueStorage.removeItem(this._authKeys.identityId)}}const eY=(t,e)=>xA(QK)(`com.amplify.${t}`,e),O_=({endpointOverride:t})=>e=>t?{url:new Wa(t)}:hW(e);function k5(t){const e=gi(t).payload.iss,n={};if(!e)throw new Le({name:"InvalidIdTokenException",message:"Invalid Idtoken."});const r=e.replace(/(^\w+:|^)\/\//,"");return n[r]=t,n}async function tY({tokens:t,authConfig:e,identityIdStore:n}){n.setAuthConfig({Cognito:e});const r=await n.loadIdentityId();if(r)return r.id;const s=t?.idToken?k5(t.idToken.toString()):{},o=await nY(s,e);return n.storeIdentityId({id:o,type:t?"primary":"guest"}),o}async function nY(t,e){const n=e?.identityPoolId,r=C_(n),s=cW({endpointResolver:O_({endpointOverride:e.identityPoolEndpoint})});let o;try{o=(await s({region:r},{IdentityPoolId:n,Logins:t})).IdentityId}catch(a){throw Is(a),new Le(a)}if(!o)throw new Le({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return o}const Lg=new nr("CognitoCredentialsProvider"),xM=3e3*1e3;class D5{constructor(e){this._nextCredentialsRefresh=0,this._identityIdStore=e}async clearCredentialsAndIdentityId(){Lg.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,await this._identityIdStore.clearIdentityId()}async clearCredentials(){Lg.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0}async getCredentialsAndIdentityId(e){const n=e.authenticated,{tokens:r}=e,{authConfig:s}=e;try{Lm(s?.Cognito)}catch{return}if(!n&&!s.Cognito.allowGuestAccess)return;const{forceRefresh:o}=e,a=this.hasTokenChanged(r),u=await tY({tokens:r,authConfig:s.Cognito,identityIdStore:this._identityIdStore});return(o||a)&&this.clearCredentials(),n?(qW(r),this.credsForOIDCTokens(s.Cognito,r,u)):this.getGuestCredentials(u,s.Cognito)}async getGuestCredentials(e,n){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!1)return Lg.info("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const r=C_(n.identityPoolId),s=HN({endpointResolver:O_({endpointOverride:n.identityPoolEndpoint})});let o;try{o=await s({region:r},{IdentityId:e})}catch(a){throw Is(a),new Le(a)}if(o?.Credentials?.AccessKeyId&&o?.Credentials?.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+xM;const a={credentials:{accessKeyId:o.Credentials.AccessKeyId,secretAccessKey:o.Credentials.SecretKey,sessionToken:o.Credentials.SessionToken,expiration:o.Credentials.Expiration},identityId:e};return o.IdentityId&&(a.identityId=o.IdentityId,this._identityIdStore.storeIdentityId({id:o.IdentityId,type:"guest"})),this._credentialsAndIdentityId={...a,isAuthenticatedCreds:!1},a}else throw new Le({name:"CredentialsNotFoundException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}async credsForOIDCTokens(e,n,r){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!0)return Lg.debug("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const s=n.idToken?k5(n.idToken.toString()):{},o=C_(e.identityPoolId),a=HN({endpointResolver:O_({endpointOverride:e.identityPoolEndpoint})});let u;try{u=await a({region:o},{IdentityId:r,Logins:s})}catch(c){throw Is(c),new Le(c)}if(u?.Credentials?.AccessKeyId&&u?.Credentials?.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+xM;const c={credentials:{accessKeyId:u.Credentials.AccessKeyId,secretAccessKey:u.Credentials.SecretKey,sessionToken:u.Credentials.SessionToken,expiration:u.Credentials.Expiration},identityId:r};return u.IdentityId&&(c.identityId=u.IdentityId,this._identityIdStore.storeIdentityId({id:u.IdentityId,type:"primary"})),this._credentialsAndIdentityId={...c,isAuthenticatedCreds:!0,associatedIdToken:n.idToken?.toString()},c}else throw new Le({name:"CredentialsException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}isPastTTL(){return this._nextCredentialsRefresh===void 0?!0:this._nextCredentialsRefresh<=Date.now()}hasTokenChanged(e){return!!e&&!!this._credentialsAndIdentityId?.associatedIdToken&&e.idToken?.toString()!==this._credentialsAndIdentityId.associatedIdToken}}const rY=new D5(new P5(Gh)),L5={configure(t,e){const n=L6(t),r=new SW({sameSite:"lax"}),s=e?.ssr?r:Gh,o=e?.ssr?new D5(new P5(r)):rY;if(!n.Auth||e?.Auth){Ht.configure(n,e);return}Fm.setAuthConfig(n.Auth),Fm.setKeyValueStorage(s),Ht.configure(n,{...e,Auth:{tokenProvider:Fm,credentialsProvider:o}})},getConfig(){return Ht.getConfig()}},Cy=()=>{const t=globalThis.__REMIT_CONFIG__??{};return{apiUrl:t.apiUrl??"/api",appOrigin:t.appOrigin??"",betterAuthEnabled:t.betterAuthEnabled??!1,cognito:{userPoolId:t.cognito?.userPoolId??"",clientId:t.cognito?.clientId??"",domain:t.cognito?.domain??"",region:t.cognito?.region??""},rum:{appMonitorId:t.rum?.appMonitorId??"",identityPoolId:t.rum?.identityPoolId??"",region:t.rum?.region??"eu-west-1"},mailboxPollIntervalSeconds:t.mailboxPollIntervalSeconds!=null?String(t.mailboxPollIntervalSeconds):void 0,disableDevtools:t.disableDevtools??!1}},sY=()=>{const t=Cy(),{userPoolId:e,clientId:n,domain:r,region:s}=t.cognito;return!e||!n?null:{userPoolId:e,userPoolClientId:n,domain:r,region:s,appOrigin:t.appOrigin}},N_=sY(),wy=()=>N_!==null,U5=()=>{if(!N_){console.warn("[auth] Cognito user pool is not configured. Running in local dev mode without Cognito auth.");return}const{userPoolId:t,userPoolClientId:e,domain:n,appOrigin:r}=N_;L5.configure({Auth:{Cognito:{userPoolId:t,userPoolClientId:e,loginWith:n?{oauth:{domain:n,scopes:["openid","email","profile"],redirectSignIn:r?[r]:[],redirectSignOut:r?[r]:[],responseType:"code"}}:void 0}}})};var oY={};const jm=Object.create(null),mf=t=>oY||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?jm:globalThis),ga=new Proxy(jm,{get(t,e){return mf()[e]??jm[e]},has(t,e){return e in mf()||e in jm},set(t,e,n){const r=mf(!0);return r[e]=n,!0},deleteProperty(t,e){if(!e)return!1;const n=mf(!0);return delete n[e],!0},ownKeys(){const t=mf(!0);return Object.keys(t)}});ga.NODE_ENV;var Hm=class extends Error{constructor(t,e){super(t,e),this.name="BetterAuthError",this.message=t,this.stack=""}};const iY=47;function F5(t){let e=t.length;for(;e>0&&t.charCodeAt(e-1)===iY;)e--;return e===t.length?t:t.slice(0,e)}function aY(t){try{return(F5(new URL(t).pathname)||"/")!=="/"}catch{throw new Hm(`Invalid base URL: ${t}. Please provide a valid base URL.`)}}function lY(t){try{const e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Hm(`Invalid base URL: ${t}. URL must include 'http://' or 'https://'`)}catch(e){throw e instanceof Hm?e:new Hm(`Invalid base URL: ${t}. Please provide a valid base URL.`,{cause:e})}}function AM(t,e="/api/auth"){if(lY(t),aY(t))return t;const n=F5(t);return!e||e==="/"?n:(e=e.startsWith("/")?e:`/${e}`,`${n}${e}`)}function uY(t,e,n,r,s){{const o=ga.BETTER_AUTH_URL||ga.NEXT_PUBLIC_BETTER_AUTH_URL||ga.PUBLIC_BETTER_AUTH_URL||ga.NUXT_PUBLIC_BETTER_AUTH_URL||ga.NUXT_PUBLIC_AUTH_URL||(ga.BASE_URL!=="/"?ga.BASE_URL:void 0);if(o)return AM(o,e)}if(typeof window<"u"&&window.location)return AM(window.location.origin,e)}const cY={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},dY=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,TM={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},fY=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function hY(t){return t instanceof Date&&!isNaN(t.getTime())}function pY(t){const e=fY.exec(t);if(!e)return null;const[,n,r,s,o,a,u,c,f,p,g]=e,m=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(s,10),parseInt(o,10),parseInt(a,10),parseInt(u,10),c?parseInt(c.padEnd(3,"0"),10):0));if(f){const y=(parseInt(p,10)*60+parseInt(g,10))*(f==="+"?-1:1);m.setUTCMinutes(m.getUTCMinutes()+y)}return hY(m)?m:null}function gY(t,e={}){const{strict:n=!1,warnings:r=!1,reviver:s,parseDates:o=!0}=e;if(typeof t!="string")return t;const a=t.trim(),u=a.toLowerCase();if(u.length<=9&&u in TM)return TM[u];if(!dY.test(a)){if(n)throw new SyntaxError("[better-json] Invalid JSON");return t}if(Object.entries(cY).some(([c,f])=>{const p=f.test(a);return p&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${c} pattern`),p})&&n)throw new Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(a,(f,p)=>{if(f==="__proto__"||f==="constructor"&&p&&typeof p=="object"&&"prototype"in p){r&&console.warn(`[better-json] Dropping "${f}" key to prevent prototype pollution`);return}if(o&&typeof p=="string"){const g=pY(p);if(g)return g}return s?s(f,p):p})}catch(c){if(n)throw c;return t}}function mY(t,e={strict:!0}){return gY(t,e)}const vY=["javascript:","data:","vbscript:"];function yY(t){let e;try{e=new URL(t)}catch{return!0}return!vY.includes(e.protocol)}const bY={id:"redirect",name:"Redirect",hooks:{onSuccess(t){if(t.data?.url&&t.data?.redirect&&yY(t.data.url)&&typeof window<"u"&&window.location&&window.location)try{window.location.href=t.data.url}catch{}}}};let Vs=[],ma=0;const $m=4,SY=globalThis.nanostoresGlobal||={epoch:0};let EY=()=>{for(ma=0;ma<Vs.length;ma+=$m)Vs[ma](Vs[ma+1].value,Vs[ma+2],Vs[ma+3]);Vs.length=0};const RM=t=>{let e=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:t,lc:0,listen(r){return n.lc=e.push(r),()=>{for(let o=ma+$m;o<Vs.length;)Vs[o]===r?Vs.splice(o,$m):o+=$m;let s=e.indexOf(r);~s&&(e.splice(s,1),--n.lc||n.off())}},notify(r,s){SY.epoch++;let o=!Vs.length&&!0;for(let a of e)Vs.push(a,n,r,s);o&&EY()},off(){},set(r){let s=n.value;s!==r&&(n.value=r,n.notify(s))},subscribe(r){let s=n.listen(r);return r(n.value),s},value:t};return n},CY=2,wY=5,Ug=6,Fg=10;let z5=(t,e,n,r)=>(t.events=t.events||{},t.events[n+Fg]||(t.events[n+Fg]=r(s=>{t.events[n].reduceRight((o,a)=>(a(o),o),{shared:{},...s})})),t.events[n]=t.events[n]||[],t.events[n].push(e),()=>{let s=t.events[n],o=s.indexOf(e);s.splice(o,1),s.length||(delete t.events[n],t.events[n+Fg](),delete t.events[n+Fg])}),_Y=(t,e)=>z5(t,e,CY,n=>{let r=t.set,s=t.setKey;return t.setKey&&(t.setKey=(o,a)=>{let u;if(n({abort:()=>{u=!0},changed:o,newValue:{...t.value,[o]:a}}),!u)return s(o,a)}),t.set=o=>{let a;if(n({abort:()=>{a=!0},newValue:o}),!a)return r(o)},()=>{t.set=r,t.setKey=s}});const xY=1e3;let AY=(t,e)=>z5(t,r=>{let s=e(r);s&&t.events[Ug].push(s)},wY,r=>{let s=t.listen;t.listen=(...a)=>(!t.lc&&!t.active&&(t.active=!0,r()),s(...a));let o=t.off;return t.events[Ug]=[],t.off=()=>{o(),setTimeout(()=>{if(t.active&&!t.lc){t.active=!1;for(let a of t.events[Ug])a();t.events[Ug]=[]}},xY)},()=>{t.listen=s,t.off=o}});function TY(t,e,n){let r=new Set(e);return t.listen((s,o,a)=>{(a===void 0?e.some(u=>s[u]!==o[u]):r.has(a)||r.has(a.split(/\.|\[/)[0]))&&n(s,o,a)})}function IM(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function gv(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!gv(t[n],e[n]))return!1;return!0}if(IM(t)&&IM(e)){const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const s of n)if(!(s in e)||!gv(t[s],e[s]))return!1;return!0}return!1}function RY(t,e){return _Y(t,({newValue:n,abort:r})=>{e(t.value,n)&&r()})}const M1=Symbol.for("better-auth:broadcast-channel"),IY=()=>Math.floor(Date.now()/1e3);var OY=class{listeners=new Set;name;constructor(t="better-auth.message"){this.name=t}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}post(t){if(!(typeof window>"u"))try{localStorage.setItem(this.name,JSON.stringify({...t,timestamp:IY()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const t=e=>{if(e.key!==this.name)return;const n=JSON.parse(e.newValue??"{}");n?.event!=="session"||!n?.data||this.listeners.forEach(r=>r(n))};return window.addEventListener("storage",t),()=>{window.removeEventListener("storage",t)}}};function P1(t="better-auth.message"){return globalThis[M1]||(globalThis[M1]=new OY(t)),globalThis[M1]}const k1=Symbol.for("better-auth:focus-manager");var NY=class{listeners=new Set;subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}setFocused(t){this.listeners.forEach(e=>e(t))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};const t=()=>{document.visibilityState==="visible"&&this.setFocused(!0)};return document.addEventListener("visibilitychange",t,!1),()=>{document.removeEventListener("visibilitychange",t,!1)}}};function OM(){return globalThis[k1]||(globalThis[k1]=new NY),globalThis[k1]}const D1=Symbol.for("better-auth:online-manager");var MY=class{listeners=new Set;isOnline=typeof navigator<"u"?navigator.onLine:!0;subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}setOnline(t){this.isOnline=t,this.listeners.forEach(e=>e(t))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const t=()=>this.setOnline(!0),e=()=>this.setOnline(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",e,!1),()=>{window.removeEventListener("online",t,!1),window.removeEventListener("offline",e,!1)}}};function L1(){return globalThis[D1]||(globalThis[D1]=new MY),globalThis[D1]}const U1=()=>Math.floor(Date.now()/1e3),PY=5;function kY(t){const{fetchSession:e,shouldPollSession:n=()=>!0,sessionSignal:r,options:s={}}=t,o=s.sessionOptions?.refetchInterval??0,a=s.sessionOptions?.refetchOnWindowFocus??!0,u=s.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},f=()=>u||L1().isOnline,p=T=>{if(f()){if(T?.event==="storage"){e();return}if(T?.event==="poll"){c.lastSessionRequest=U1(),e();return}if(T?.event==="visibilitychange"){if(U1()-c.lastSessionRequest<PY)return;c.lastSessionRequest=U1(),e();return}e()}},g=T=>{P1().post({event:"session",data:{trigger:T},clientId:Math.random().toString(36).substring(7)})},m=()=>{o&&o>0&&(c.pollInterval=setInterval(()=>{n()&&p({event:"poll"})},o*1e3))},y=()=>{c.unsubscribeBroadcast=P1().subscribe(()=>{p({event:"storage"})})},S=()=>{a&&(c.unsubscribeFocus=OM().subscribe(()=>{p({event:"visibilitychange"})}))},E=()=>{c.unsubscribeOnline=L1().subscribe(T=>{T&&p({event:"visibilitychange"})})},C=()=>{c.unsubscribeSignal=r.listen(()=>{e()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,m(),y(),S(),E(),C(),c.cleanupBroadcastSetup=P1().setup(),c.cleanupFocusSetup=OM().setup(),c.cleanupOnlineSetup=L1().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&(clearInterval(c.pollInterval),c.pollInterval=void 0),c.unsubscribeBroadcast&&(c.unsubscribeBroadcast(),c.unsubscribeBroadcast=void 0),c.unsubscribeFocus&&(c.unsubscribeFocus(),c.unsubscribeFocus=void 0),c.unsubscribeOnline&&(c.unsubscribeOnline(),c.unsubscribeOnline=void 0),c.unsubscribeSignal&&(c.unsubscribeSignal(),c.unsubscribeSignal=void 0),c.cleanupBroadcastSetup&&(c.cleanupBroadcastSetup(),c.cleanupBroadcastSetup=void 0),c.cleanupFocusSetup&&(c.cleanupFocusSetup(),c.cleanupFocusSetup=void 0),c.cleanupOnlineSetup&&(c.cleanupOnlineSetup(),c.cleanupOnlineSetup=void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:p,broadcastSessionUpdate:g}}const DY=()=>typeof window>"u";function NM(t){return typeof t=="object"&&t!==null&&"data"in t&&"error"in t?t:{data:t,error:null}}function LY(t){return!t||t.session===null&&t.user===null?null:t}function UY(t,e){return gv(t.data,e.data)&&t.error===e.error&&t.isPending===e.isPending&&t.isRefetching===e.isRefetching&&t.refetch===e.refetch}function FY(t,e){const n=RM(!1);let r;const s=f=>u(f),o=RM({data:null,error:null,isPending:!0,isRefetching:!1,refetch:s});RY(o,UY);const a=f=>{if(r!==f)return;const p=o.get();r=void 0,!(!p.isPending&&!p.isRefetching)&&o.set({...p,isPending:!1,isRefetching:!1,refetch:s})},u=async f=>{r?.abort();const p=new AbortController;r=p;const g=o.get();o.set({...g,isPending:g.data===null,isRefetching:!0,error:null,refetch:s});try{const m=await t("/get-session",{method:"GET",query:f?.query,signal:p.signal});if(p.signal.aborted){a(p);return}let{data:y,error:S}=NM(m);if(y?.needsRefresh)try{const x=await t("/get-session",{method:"POST",signal:p.signal});if(p.signal.aborted){a(p);return}({data:y,error:S}=NM(x))}catch{if(p.signal.aborted){a(p);return}}if(S){const x=o.get(),T=S?.status===401;o.set({data:T?null:x.data,error:S,isPending:!1,isRefetching:!1,refetch:s});return}const E=LY(y),C=o.get(),w=C.data!=null&&E!=null&&gv(C.data,E)?C.data:E;o.set({data:w,error:null,isPending:!1,isRefetching:!1,refetch:s})}catch(m){if(p.signal.aborted){a(p);return}const y=o.get();o.set({data:y.data,error:m,isPending:!1,isRefetching:!1,refetch:s})}};let c=()=>{};return AY(o,()=>{let f;DY()||(f=setTimeout(()=>{u()},0));const p=kY({fetchSession:u,shouldPollSession:()=>o.get().data!=null,sessionSignal:n,options:e});return p.init(),c=p.broadcastSessionUpdate,()=>{f&&clearTimeout(f);const g=r;g?.abort(),g&&a(g),p.cleanup()}}),{session:o,$sessionSignal:n,broadcastSessionUpdate:f=>c(f)}}function F1(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function M_(t,e,n=".",r){if(!F1(e))return M_(t,{},n,r);const s={...e};for(const o of Object.keys(t)){if(o==="__proto__"||o==="constructor")continue;const a=t[o];a!=null&&(r&&r(s,o,a,n)||(Array.isArray(a)&&Array.isArray(s[o])?s[o]=[...a,...s[o]]:F1(a)&&F1(s[o])?s[o]=M_(a,s[o],(n?`${n}.`:"")+o.toString(),r):s[o]=a))}return s}function zY(t){return(...e)=>e.reduce((n,r)=>M_(n,r,"",t),{})}const BY=zY();var jY=Object.defineProperty,HY=Object.defineProperties,$Y=Object.getOwnPropertyDescriptors,MM=Object.getOwnPropertySymbols,qY=Object.prototype.hasOwnProperty,WY=Object.prototype.propertyIsEnumerable,PM=(t,e,n)=>e in t?jY(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ws=(t,e)=>{for(var n in e||(e={}))qY.call(e,n)&&PM(t,n,e[n]);if(MM)for(var n of MM(e))WY.call(e,n)&&PM(t,n,e[n]);return t},bo=(t,e)=>HY(t,$Y(e)),GY=class extends Error{constructor(t,e,n){super(e||t.toString(),{cause:n}),this.status=t,this.statusText=e,this.error=n,Error.captureStackTrace(this,this.constructor)}},VY=async(t,e)=>{var n,r,s,o,a,u;let c=e||{};const f={onRequest:[e?.onRequest],onResponse:[e?.onResponse],onSuccess:[e?.onSuccess],onError:[e?.onError],onRetry:[e?.onRetry]};if(!e||!e?.plugins)return{url:t,options:c,hooks:f};for(const p of e?.plugins||[]){if(p.init){const g=await((n=p.init)==null?void 0:n.call(p,t.toString(),e));c=g.options||c,t=g.url}f.onRequest.push((r=p.hooks)==null?void 0:r.onRequest),f.onResponse.push((s=p.hooks)==null?void 0:s.onResponse),f.onSuccess.push((o=p.hooks)==null?void 0:o.onSuccess),f.onError.push((a=p.hooks)==null?void 0:a.onError),f.onRetry.push((u=p.hooks)==null?void 0:u.onRetry)}return{url:t,options:c,hooks:f}},kM=class{constructor(t){this.options=t}shouldAttemptRetry(t,e){return this.options.shouldRetry?Promise.resolve(t<this.options.attempts&&this.options.shouldRetry(e)):Promise.resolve(t<this.options.attempts)}getDelay(){return this.options.delay}},KY=class{constructor(t){this.options=t}shouldAttemptRetry(t,e){return this.options.shouldRetry?Promise.resolve(t<this.options.attempts&&this.options.shouldRetry(e)):Promise.resolve(t<this.options.attempts)}getDelay(t){return Math.min(this.options.maxDelay,this.options.baseDelay*2**t)}};function YY(t){if(typeof t=="number")return new kM({type:"linear",attempts:t,delay:1e3});switch(t.type){case"linear":return new kM(t);case"exponential":return new KY(t);default:throw new Error("Invalid retry strategy")}}var ZY=async t=>{const e={},n=async r=>typeof r=="function"?await r():r;if(t?.auth){if(t.auth.type==="Bearer"){const r=await n(t.auth.token);if(!r)return e;e.authorization=`Bearer ${r}`}else if(t.auth.type==="Basic"){const[r,s]=await Promise.all([n(t.auth.username),n(t.auth.password)]);if(!r||!s)return e;e.authorization=`Basic ${btoa(`${r}:${s}`)}`}else if(t.auth.type==="Custom"){const[r,s]=await Promise.all([n(t.auth.prefix),n(t.auth.value)]);if(!s)return e;e.authorization=`${r??""} ${s}`}}return e},XY=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function QY(t){const e=t.headers.get("content-type"),n=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!e)return"json";const r=e.split(";").shift()||"";return XY.test(r)?"json":n.has(r)||r.startsWith("text/")?"text":"blob"}function JY(t){try{return JSON.parse(t),!0}catch{return!1}}function B5(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.buffer?!1:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}function DM(t){try{return JSON.parse(t)}catch{return t}}function LM(t){return typeof t=="function"}function eZ(t){if(t?.customFetchImpl)return t.customFetchImpl;if(typeof globalThis<"u"&&LM(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&LM(window.fetch))return window.fetch;throw new Error("No fetch implementation found")}function j5(...t){const e={};for(const n of t)if(n)if(n instanceof Headers)n.forEach((r,s)=>{e[s]=r});else{const r=Array.isArray(n)?n:Object.entries(n);for(const[s,o]of r)o!=null&&(e[s]=o)}return e}async function tZ(t){const e=new Headers(j5(t?.headers,await ZY(t)));if(!e.has("content-type")){const n=nZ(t?.body);n&&e.set("content-type",n)}return e}function nZ(t){return B5(t)?"application/json":null}function rZ(t){const e=t.get("content-type");return e?e.split(";")[0].trim().toLowerCase():null}function sZ(t,e){const{body:n}=t;return n?!B5(n)||typeof n=="string"?n:rZ(e)==="application/x-www-form-urlencoded"?new URLSearchParams(n).toString():JSON.stringify(n):null}function oZ(t,e){var n;if(e?.method)return e.method.toUpperCase();if(t.startsWith("@")){const r=(n=t.split("@")[1])==null?void 0:n.split("/")[0];return $5.includes(r)?r.toUpperCase():e?.body?"POST":"GET"}return e?.body?"POST":"GET"}function iZ(t,e){let n;return!t?.signal&&t?.timeout&&(n=setTimeout(()=>e?.abort(),t?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var aZ=class H5 extends Error{constructor(e,n){super(n||JSON.stringify(e,null,2)),this.issues=e,Object.setPrototypeOf(this,H5.prototype)}};async function Ff(t,e){const n=await t["~standard"].validate(e);if(n.issues)throw new aZ(n.issues);return n.value}var $5=["get","post","put","patch","delete"],lZ=t=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,n){var r,s,o,a;const u=((s=(r=t.plugins)==null?void 0:r.find(c=>{var f;return(f=c.schema)!=null&&f.config?e.startsWith(c.schema.config.baseURL||"")||e.startsWith(c.schema.config.prefix||""):!1}))==null?void 0:s.schema)||t.schema;if(u){let c=e;(o=u.config)!=null&&o.prefix&&c.startsWith(u.config.prefix)&&(c=c.replace(u.config.prefix,""),u.config.baseURL&&(e=e.replace(u.config.prefix,u.config.baseURL))),(a=u.config)!=null&&a.baseURL&&c.startsWith(u.config.baseURL)&&(c=c.replace(u.config.baseURL,"")),c.startsWith("/")&&c.charAt(1)==="@"&&(c=c.substring(1));const f=u.schema[c];if(f){let p=n?.headers;if(f.headers&&!n?.disableValidation){const m={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((E,C)=>{m[C.toLowerCase()]=E});else if(typeof n.headers=="object")for(const[E,C]of Object.entries(n.headers))C!=null&&(m[E.toLowerCase()]=C)}const y=await Ff(f.headers,m),S={};for(const[E,C]of Object.entries(y))S[E.toLowerCase()]=C;p=S}let g=bo(Ws({},n),{method:f.method,output:f.output,headers:p});return n?.disableValidation||(g=bo(Ws({},g),{body:f.input?await Ff(f.input,n?.body):n?.body,params:f.params?await Ff(f.params,n?.params):n?.params,query:f.query?await Ff(f.query,n?.query):n?.query})),{url:e,options:g}}}return{url:e,options:n}}}),uZ=t=>{async function e(n,r){const s=bo(Ws(Ws({},t),r),{headers:j5(t?.headers,r?.headers),plugins:[...t?.plugins||[],lZ(t||{}),...r?.plugins||[]]});if(t?.catchAllError)try{return await P_(n,s)}catch(o){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:o}}}return await P_(n,s)}return e},cZ=t=>t==="."||t==="..";function dZ(t,e){let n=t;for(const[r,s]of e)n=n.replace(r,s);if(cZ(n))throw new TypeError("Path parameters cannot be reserved path segments");return encodeURIComponent(n)}function fZ(t,e){const{baseURL:n,params:r,query:s}=e||{query:{},params:{},baseURL:""};let o=t.startsWith("http")?t.split("/").slice(0,3).join("/"):n||"";if(t.startsWith("@")){const m=t.toString().split("@")[1].split("/")[0];$5.includes(m)&&(t=t.replace(`@${m}/`,"/"))}o.endsWith("/")||(o+="/");let[a,u]=t.replace(o,"").split("?");const c=new URLSearchParams(u);for(const[m,y]of Object.entries(s||{})){if(y==null)continue;let S;if(typeof y=="string")S=y;else if(Array.isArray(y)){for(const E of y)c.append(m,E);continue}else S=JSON.stringify(y);c.set(m,S)}const f=new Map;if(r)if(Array.isArray(r)){const m=a.split("/").filter(y=>y.startsWith(":"));for(const[y,S]of m.entries()){const E=r[y];f.set(S,String(E))}}else for(const[m,y]of Object.entries(r))f.set(`:${m}`,String(y));a=a.split("/").map(m=>dZ(m,f)).join("/"),a=a.replace(/^\/+/,"");let p=c.toString();return p=p.length>0?`?${p}`.replace(/\+/g,"%20"):"",o.startsWith("http")?new URL(`${a}${p}`,o):`${o}${a}${p}`}var P_=async(t,e)=>{var n,r,s,o,a,u,c,f;const{hooks:p,url:g,options:m}=await VY(t,e),y=eZ(m),S=new AbortController,E=(n=m.signal)!=null?n:S.signal,C=fZ(g,m),w=await tZ(m),x=sZ(m,w),T=oZ(g,m),R=bo(Ws({},m),{url:C,headers:w,body:x,method:T,signal:E});for(const W of p.onRequest)if(W){const Y=await W(R);typeof Y=="object"&&Y!==null&&Object.assign(R,Y)}("pipeTo"in R&&typeof R.pipeTo=="function"||typeof((r=e?.body)==null?void 0:r.pipe)=="function")&&("duplex"in R||(R.duplex="half"));const{clearTimeout:M}=iZ(m,S);let O=await y(R.url,R);M();const I={response:O,request:R};for(const W of p.onResponse)if(W){const Y=await W(bo(Ws({},I),{response:(s=e?.hookOptions)!=null&&s.cloneResponse?O.clone():O}));Y instanceof Response?O=Y:typeof Y=="object"&&Y!==null&&(O=Y.response)}if(O.ok){if(!(R.method!=="HEAD"))return{data:"",error:null};const Y=QY(O),ne={data:null,response:O,request:R};if(Y==="json"||Y==="text"){const $=await O.text(),ee=(o=R.jsonParser)!=null?o:DM;ne.data=await ee($)}else ne.data=await O[Y]();R?.output&&R.output&&!R.disableValidation&&(ne.data=await Ff(R.output,ne.data));for(const $ of p.onSuccess)$&&await $(bo(Ws({},ne),{response:(a=e?.hookOptions)!=null&&a.cloneResponse?O.clone():O}));return e?.throw?ne.data:{data:ne.data,error:null}}const P=(u=e?.jsonParser)!=null?u:DM,k=await O.text(),H=JY(k),F=H?await P(k):null,B={response:O,responseText:k,request:R,error:bo(Ws({},F),{status:O.status,statusText:O.statusText})};for(const W of p.onError)W&&await W(bo(Ws({},B),{response:(c=e?.hookOptions)!=null&&c.cloneResponse?O.clone():O}));if(e?.retry){const W=YY(e.retry),Y=(f=e.retryAttempt)!=null?f:0;if(await W.shouldAttemptRetry(Y,O)){for(const $ of p.onRetry)$&&await $(I);const ne=W.getDelay(Y);return await new Promise($=>setTimeout($,ne)),await P_(t,bo(Ws({},e),{retryAttempt:Y+1}))}}if(e?.throw)throw new GY(O.status,O.statusText,H?F:k);return{data:null,error:bo(Ws({},F),{status:O.status,statusText:O.statusText})}},gl={};const hZ=t=>{if(typeof process>"u")return;const e="/api/auth";if(gl.NEXT_PUBLIC_AUTH_URL)return gl.NEXT_PUBLIC_AUTH_URL;if(typeof window>"u"){if(gl.NEXTAUTH_URL)try{return gl.NEXTAUTH_URL}catch{}if(gl.VERCEL_URL)try{const n=gl.VERCEL_URL.startsWith("http")?"":"https://";return`${new URL(`${n}${gl.VERCEL_URL}`).origin}${e}`}catch{}}},pZ=(t,e)=>{const n="credentials"in Request.prototype,r=uY(t?.baseURL,t?.basePath)??hZ()??"/api/auth",s=[],o={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:t?.fetchOptions?.onSuccess,onError:t?.fetchOptions?.onError,onRequest:t?.fetchOptions?.onRequest,onResponse:t?.fetchOptions?.onResponse}},{onSuccess:a,onError:u,onRequest:c,onResponse:f,...p}={},g=uZ({baseURL:r,...n?{credentials:"include"}:{},method:"GET",jsonParser(M){return M?mY(M,{strict:!1}):null},customFetchImpl:fetch,...p,plugins:[o,...p.plugins||[],bY,...s]}),{$sessionSignal:m,session:y,broadcastSessionUpdate:S}=FY(g,t),E=[];let C={};const w={$sessionSignal:m,session:y},x={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},T=[{signal:"$sessionSignal",matcher(M){return M==="/sign-out"||M==="/update-user"||M==="/update-session"||M==="/sign-up/email"||M==="/sign-in/email"||M==="/delete-user"||M==="/verify-email"||M==="/revoke-sessions"||M==="/revoke-session"||M==="/revoke-other-sessions"||M==="/change-email"||M==="/change-password"},callback(M){M==="/sign-out"?S("signout"):(M==="/update-user"||M==="/update-session")&&S("updateUser")}}];for(const M of E)M.getAtoms&&Object.assign(w,M.getAtoms?.(g)),M.pathMethods&&Object.assign(x,M.pathMethods),M.atomListeners&&T.push(...M.atomListeners);const R={notify:M=>{w[M].set(!w[M].get())},listen:(M,O)=>{w[M].subscribe(O)},atoms:w};for(const M of E)M.getActions&&(C=BY(M.getActions?.(g,R,t)??{},C));return{get baseURL(){return r},pluginsActions:C,pluginsAtoms:w,pluginPathMethods:x,atomListeners:T,$fetch:g,$store:R}};function gZ(t){return typeof t=="object"&&t!==null&&"get"in t&&typeof t.get=="function"&&"lc"in t&&typeof t.lc=="number"}function mZ(t){return t.charAt(0).toUpperCase()+t.slice(1)}const vZ=new RegExp("[\\p{Ll}\\d]+|\\p{Lu}+(?!\\p{Ll})|\\p{Lu}[\\p{Ll}\\d]+|\\p{Lo}+","gu"),yZ=/['\u2019]/g;function bZ(t){return t.replace(yZ,"").match(vZ)??[]}function SZ(t){return bZ(t).map(e=>e.toLowerCase()).join("-")}function EZ(t,e,n){const r=e[t],{fetchOptions:s,query:o,...a}=n||{};return r||(s?.method?s.method:a&&Object.keys(a).length>0?"POST":"GET")}function CZ(t,e,n,r,s){function o(a=[]){return new Proxy(function(){},{get(u,c){if(typeof c!="string"||c==="then"||c==="catch"||c==="finally")return;const f=[...a,c];let p=t;for(const g of f)if(p&&typeof p=="object"&&g in p)p=p[g];else{p=void 0;break}return typeof p=="function"||gZ(p)?p:o(f)},apply:async(u,c,f)=>{const p="/"+a.map(SZ).join("/"),g=f[0]||{},m=f[1]||{},{query:y,fetchOptions:S,...E}=g,C={...m,...S},w=EZ(p,n,g);return await e(p,{...C,body:w==="GET"?void 0:{...E,...C?.body||{}},query:y||C?.query,method:w,async onSuccess(x){if(await C?.onSuccess?.(x),!s||C.disableSignal)return;const T=s.filter(M=>M.matcher(p));if(!T.length)return;const R=new Set;for(const M of T){const O=r[M.signal];if(!O)return;if(R.has(M.signal))continue;R.add(M.signal);const I=O.get();setTimeout(()=>{O.set(!I)},10),M.callback?.(p)}}})}})}return o()}var z1={exports:{}},We={};var UM;function wZ(){if(UM)return We;UM=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),m=Symbol.iterator;function y(L){return L===null||typeof L!="object"?null:(L=m&&L[m]||L["@@iterator"],typeof L=="function"?L:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,C={};function w(L,V,K){this.props=L,this.context=V,this.refs=C,this.updater=K||S}w.prototype.isReactComponent={},w.prototype.setState=function(L,V){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,V,"setState")},w.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function x(){}x.prototype=w.prototype;function T(L,V,K){this.props=L,this.context=V,this.refs=C,this.updater=K||S}var R=T.prototype=new x;R.constructor=T,E(R,w.prototype),R.isPureReactComponent=!0;var M=Array.isArray;function O(){}var I={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function k(L,V,K){var J=K.ref;return{$$typeof:t,type:L,key:V,ref:J!==void 0?J:null,props:K}}function H(L,V){return k(L.type,V,L.props)}function F(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function B(L){var V={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(K){return V[K]})}var W=/\/+/g;function Y(L,V){return typeof L=="object"&&L!==null&&L.key!=null?B(""+L.key):V.toString(36)}function ne(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(O,O):(L.status="pending",L.then(function(V){L.status==="pending"&&(L.status="fulfilled",L.value=V)},function(V){L.status==="pending"&&(L.status="rejected",L.reason=V)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function $(L,V,K,J,oe){var he=typeof L;(he==="undefined"||he==="boolean")&&(L=null);var ue=!1;if(L===null)ue=!0;else switch(he){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(L.$$typeof){case t:case e:ue=!0;break;case p:return ue=L._init,$(ue(L._payload),V,K,J,oe)}}if(ue)return oe=oe(L),ue=J===""?"."+Y(L,0):J,M(oe)?(K="",ue!=null&&(K=ue.replace(W,"$&/")+"/"),$(oe,V,K,"",function(Xe){return Xe})):oe!=null&&(F(oe)&&(oe=H(oe,K+(oe.key==null||L&&L.key===oe.key?"":(""+oe.key).replace(W,"$&/")+"/")+ue)),V.push(oe)),1;ue=0;var ve=J===""?".":J+":";if(M(L))for(var _e=0;_e<L.length;_e++)J=L[_e],he=ve+Y(J,_e),ue+=$(J,V,K,he,oe);else if(_e=y(L),typeof _e=="function")for(L=_e.call(L),_e=0;!(J=L.next()).done;)J=J.value,he=ve+Y(J,_e++),ue+=$(J,V,K,he,oe);else if(he==="object"){if(typeof L.then=="function")return $(ne(L),V,K,J,oe);throw V=String(L),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return ue}function ee(L,V,K){if(L==null)return L;var J=[],oe=0;return $(L,J,"","",function(he){return V.call(K,he,oe++)}),J}function fe(L){if(L._status===-1){var V=L._result;V=V(),V.then(function(K){(L._status===0||L._status===-1)&&(L._status=1,L._result=K)},function(K){(L._status===0||L._status===-1)&&(L._status=2,L._result=K)}),L._status===-1&&(L._status=0,L._result=V)}if(L._status===1)return L._result.default;throw L._result}var de=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},Ae={map:ee,forEach:function(L,V,K){ee(L,function(){V.apply(this,arguments)},K)},count:function(L){var V=0;return ee(L,function(){V++}),V},toArray:function(L){return ee(L,function(V){return V})||[]},only:function(L){if(!F(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return We.Activity=g,We.Children=Ae,We.Component=w,We.Fragment=n,We.Profiler=s,We.PureComponent=T,We.StrictMode=r,We.Suspense=c,We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,We.__COMPILER_RUNTIME={__proto__:null,c:function(L){return I.H.useMemoCache(L)}},We.cache=function(L){return function(){return L.apply(null,arguments)}},We.cacheSignal=function(){return null},We.cloneElement=function(L,V,K){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var J=E({},L.props),oe=L.key;if(V!=null)for(he in V.key!==void 0&&(oe=""+V.key),V)!P.call(V,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&V.ref===void 0||(J[he]=V[he]);var he=arguments.length-2;if(he===1)J.children=K;else if(1<he){for(var ue=Array(he),ve=0;ve<he;ve++)ue[ve]=arguments[ve+2];J.children=ue}return k(L.type,oe,J)},We.createContext=function(L){return L={$$typeof:a,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:o,_context:L},L},We.createElement=function(L,V,K){var J,oe={},he=null;if(V!=null)for(J in V.key!==void 0&&(he=""+V.key),V)P.call(V,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(oe[J]=V[J]);var ue=arguments.length-2;if(ue===1)oe.children=K;else if(1<ue){for(var ve=Array(ue),_e=0;_e<ue;_e++)ve[_e]=arguments[_e+2];oe.children=ve}if(L&&L.defaultProps)for(J in ue=L.defaultProps,ue)oe[J]===void 0&&(oe[J]=ue[J]);return k(L,he,oe)},We.createRef=function(){return{current:null}},We.forwardRef=function(L){return{$$typeof:u,render:L}},We.isValidElement=F,We.lazy=function(L){return{$$typeof:p,_payload:{_status:-1,_result:L},_init:fe}},We.memo=function(L,V){return{$$typeof:f,type:L,compare:V===void 0?null:V}},We.startTransition=function(L){var V=I.T,K={};I.T=K;try{var J=L(),oe=I.S;oe!==null&&oe(K,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(O,de)}catch(he){de(he)}finally{V!==null&&K.types!==null&&(V.types=K.types),I.T=V}},We.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},We.use=function(L){return I.H.use(L)},We.useActionState=function(L,V,K){return I.H.useActionState(L,V,K)},We.useCallback=function(L,V){return I.H.useCallback(L,V)},We.useContext=function(L){return I.H.useContext(L)},We.useDebugValue=function(){},We.useDeferredValue=function(L,V){return I.H.useDeferredValue(L,V)},We.useEffect=function(L,V){return I.H.useEffect(L,V)},We.useEffectEvent=function(L){return I.H.useEffectEvent(L)},We.useId=function(){return I.H.useId()},We.useImperativeHandle=function(L,V,K){return I.H.useImperativeHandle(L,V,K)},We.useInsertionEffect=function(L,V){return I.H.useInsertionEffect(L,V)},We.useLayoutEffect=function(L,V){return I.H.useLayoutEffect(L,V)},We.useMemo=function(L,V){return I.H.useMemo(L,V)},We.useOptimistic=function(L,V){return I.H.useOptimistic(L,V)},We.useReducer=function(L,V,K){return I.H.useReducer(L,V,K)},We.useRef=function(L){return I.H.useRef(L)},We.useState=function(L){return I.H.useState(L)},We.useSyncExternalStore=function(L,V,K){return I.H.useSyncExternalStore(L,V,K)},We.useTransition=function(){return I.H.useTransition()},We.version="19.2.7",We}var FM;function Xh(){return FM||(FM=1,z1.exports=wZ()),z1.exports}var A=Xh();const z=qa(A),q5=N6({__proto__:null,default:z},[A]);function _Z(t,e={}){const n=A.useRef(t.get()),{keys:r,deps:s=[t,r]}=e,o=A.useCallback(u=>{const c=f=>{n.current!==f&&(n.current=f,u())};return c(t.value),r?.length?TY(t,r,c):t.listen(c)},s),a=()=>n.current;return A.useSyncExternalStore(o,a,a)}function xZ(t){return`use${mZ(t)}`}function AZ(t){const{pluginPathMethods:e,pluginsActions:n,pluginsAtoms:r,$fetch:s,$store:o,atomListeners:a}=pZ(t),u={};for(const[c,f]of Object.entries(r))u[xZ(c)]=()=>_Z(f);return CZ({...n,...u,$fetch:s,$store:o},s,e,r,a)}const _y=()=>Cy().betterAuthEnabled,TZ="EMAIL_PASSWORD_SIGN_UP_DISABLED",RZ=t=>typeof t=="object"&&t!==null&&t.code===TZ,hh=AZ(),IZ=60;let zf=null;const qm=()=>Math.floor(Date.now()/1e3),OZ=t=>{const[,e]=t.split(".");if(!e)return qm();try{const n=JSON.parse(atob(e.replace(/-/g,"+").replace(/_/g,"/")));return typeof n.exp=="number"?n.exp:qm()}catch{return qm()}},NZ=async()=>{const t=await fetch("/api/auth/token",{credentials:"include"});if(!t.ok)return null;const e=await t.json();return e&&typeof e=="object"&&"token"in e&&typeof e.token=="string"?e.token:null},MZ=async()=>{if(zf&&zf.expiresAt-IZ>qm())return zf.value;const t=await NZ();return zf=t?{value:t,expiresAt:OZ(t)}:null,t},W5=()=>{zf=null};const PZ=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),G5=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();var kZ={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const DZ=A.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:a,...u},c)=>A.createElement("svg",{ref:c,...kZ,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:G5("lucide",s),...u},[...a.map(([f,p])=>A.createElement(f,p)),...Array.isArray(o)?o:[o]]));const Ns=(t,e)=>{const n=A.forwardRef(({className:r,...s},o)=>A.createElement(DZ,{ref:o,iconNode:e,className:G5(`lucide-${PZ(t)}`,r),...s}));return n.displayName=`${t}`,n};const zM=Ns("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const LZ=Ns("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const UZ=Ns("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);const FZ=Ns("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);const zZ=Ns("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);const BZ=Ns("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const jZ=Ns("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const HZ=Ns("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);const $Z=Ns("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const qZ=Ns("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);const WZ=Ns("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);const ph=Ns("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function V5(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=V5(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function K5(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=V5(t))&&(r&&(r+=" "),r+=e);return r}const UA="-",GZ=t=>{const e=KZ(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const u=a.split(UA);return u[0]===""&&u.length!==1&&u.shift(),Y5(u,e)||VZ(a)},getConflictingClassGroupIds:(a,u)=>{const c=n[a]||[];return u&&r[a]?[...c,...r[a]]:c}}},Y5=(t,e)=>{if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?Y5(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const o=t.join(UA);return e.validators.find(({validator:a})=>a(o))?.classGroupId},BM=/^\[(.+)\]$/,VZ=t=>{if(BM.test(t)){const e=BM.exec(t)[1],n=e?.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},KZ=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return ZZ(Object.entries(t.classGroups),n).forEach(([o,a])=>{k_(a,r,o,e)}),r},k_=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const o=s===""?e:jM(e,s);o.classGroupId=n;return}if(typeof s=="function"){if(YZ(s)){k_(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,a])=>{k_(a,jM(e,o),n,r)})})},jM=(t,e)=>{let n=t;return e.split(UA).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},YZ=t=>t.isThemeGetter,ZZ=(t,e)=>e?t.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,u])=>[e+a,u])):o);return[n,s]}):t,XZ=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(o,a)=>{n.set(o,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return s(o,a),a},set(o,a){n.has(o)?n.set(o,a):s(o,a)}}},Z5="!",QZ=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,s=e[0],o=e.length,a=u=>{const c=[];let f=0,p=0,g;for(let C=0;C<u.length;C++){let w=u[C];if(f===0){if(w===s&&(r||u.slice(C,C+o)===e)){c.push(u.slice(p,C)),p=C+o;continue}if(w==="/"){g=C;continue}}w==="["?f++:w==="]"&&f--}const m=c.length===0?u:u.substring(p),y=m.startsWith(Z5),S=y?m.substring(1):m,E=g&&g>p?g-p:void 0;return{modifiers:c,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:E}};return n?u=>n({className:u,parseClassName:a}):a},JZ=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},eX=t=>({cache:XZ(t.cacheSize),parseClassName:QZ(t),...GZ(t)}),tX=/\s+/,nX=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,o=[],a=t.trim().split(tX);let u="";for(let c=a.length-1;c>=0;c-=1){const f=a[c],{modifiers:p,hasImportantModifier:g,baseClassName:m,maybePostfixModifierPosition:y}=n(f);let S=!!y,E=r(S?m.substring(0,y):m);if(!E){if(!S){u=f+(u.length>0?" "+u:u);continue}if(E=r(m),!E){u=f+(u.length>0?" "+u:u);continue}S=!1}const C=JZ(p).join(":"),w=g?C+Z5:C,x=w+E;if(o.includes(x))continue;o.push(x);const T=s(E,S);for(let R=0;R<T.length;++R){const M=T[R];o.push(w+M)}u=f+(u.length>0?" "+u:u)}return u};function rX(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=X5(e))&&(r&&(r+=" "),r+=n);return r}const X5=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=X5(t[r]))&&(n&&(n+=" "),n+=e);return n};function sX(t,...e){let n,r,s,o=a;function a(c){const f=e.reduce((p,g)=>g(p),t());return n=eX(f),r=n.cache.get,s=n.cache.set,o=u,u(c)}function u(c){const f=r(c);if(f)return f;const p=nX(c,n);return s(c,p),p}return function(){return o(rX.apply(null,arguments))}}const Yt=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},Q5=/^\[(?:([a-z-]+):)?(.+)\]$/i,oX=/^\d+\/\d+$/,iX=new Set(["px","full","screen"]),aX=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lX=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,uX=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cX=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dX=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ei=t=>xc(t)||iX.has(t)||oX.test(t),ca=t=>id(t,"length",bX),xc=t=>!!t&&!Number.isNaN(Number(t)),B1=t=>id(t,"number",xc),vf=t=>!!t&&Number.isInteger(Number(t)),fX=t=>t.endsWith("%")&&xc(t.slice(0,-1)),et=t=>Q5.test(t),da=t=>aX.test(t),hX=new Set(["length","size","percentage"]),pX=t=>id(t,hX,J5),gX=t=>id(t,"position",J5),mX=new Set(["image","url"]),vX=t=>id(t,mX,EX),yX=t=>id(t,"",SX),yf=()=>!0,id=(t,e,n)=>{const r=Q5.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},bX=t=>lX.test(t)&&!uX.test(t),J5=()=>!1,SX=t=>cX.test(t),EX=t=>dX.test(t),CX=()=>{const t=Yt("colors"),e=Yt("spacing"),n=Yt("blur"),r=Yt("brightness"),s=Yt("borderColor"),o=Yt("borderRadius"),a=Yt("borderSpacing"),u=Yt("borderWidth"),c=Yt("contrast"),f=Yt("grayscale"),p=Yt("hueRotate"),g=Yt("invert"),m=Yt("gap"),y=Yt("gradientColorStops"),S=Yt("gradientColorStopPositions"),E=Yt("inset"),C=Yt("margin"),w=Yt("opacity"),x=Yt("padding"),T=Yt("saturate"),R=Yt("scale"),M=Yt("sepia"),O=Yt("skew"),I=Yt("space"),P=Yt("translate"),k=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",et,e],B=()=>[et,e],W=()=>["",ei,ca],Y=()=>["auto",xc,et],ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>["start","end","center","between","around","evenly","stretch"],de=()=>["","0",et],Ae=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[xc,et];return{cacheSize:500,separator:":",theme:{colors:[yf],spacing:[ei,ca],blur:["none","",da,et],brightness:L(),borderColor:[t],borderRadius:["none","","full",da,et],borderSpacing:B(),borderWidth:W(),contrast:L(),grayscale:de(),hueRotate:L(),invert:de(),gap:B(),gradientColorStops:[t],gradientColorStopPositions:[fX,ca],inset:F(),margin:F(),opacity:L(),padding:B(),saturate:L(),scale:L(),sepia:de(),skew:L(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",et]}],container:["container"],columns:[{columns:[da]}],"break-after":[{"break-after":Ae()}],"break-before":[{"break-before":Ae()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ne(),et]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",vf,et]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",et]}],grow:[{grow:de()}],shrink:[{shrink:de()}],order:[{order:["first","last","none",vf,et]}],"grid-cols":[{"grid-cols":[yf]}],"col-start-end":[{col:["auto",{span:["full",vf,et]},et]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[yf]}],"row-start-end":[{row:["auto",{span:[vf,et]},et]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",et]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",et]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...fe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...fe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...fe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",et,e]}],"min-w":[{"min-w":[et,e,"min","max","fit"]}],"max-w":[{"max-w":[et,e,"none","full","min","max","fit","prose",{screen:[da]},da]}],h:[{h:[et,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[et,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[et,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[et,e,"auto","min","max","fit"]}],"font-size":[{text:["base",da,ca]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",B1]}],"font-family":[{font:[yf]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",et]}],"line-clamp":[{"line-clamp":["none",xc,B1]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ei,et]}],"list-image":[{"list-image":["none",et]}],"list-style-type":[{list:["none","disc","decimal",et]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ei,ca]}],"underline-offset":[{"underline-offset":["auto",ei,et]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",et]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",et]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ne(),gX]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pX]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},vX]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:$()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[ei,et]}],"outline-w":[{outline:[ei,ca]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[ei,ca]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",da,yX]}],"shadow-color":[{shadow:[yf]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...ee(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ee()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",da,et]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[g]}],saturate:[{saturate:[T]}],sepia:[{sepia:[M]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"backdrop-sepia":[{"backdrop-sepia":[M]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",et]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",et]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",et]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[vf,et]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",et]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",et]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",et]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[ei,ca,B1]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},e8=sX(CX);function dn(...t){return e8(K5(t))}const wX=1024,_X=1280;function xX(t,e=wX,n=_X){const r=t>=e;return{nav:r,reading:r,intelligence:t>=n}}function AX(t){const e=A.useRef(null),[n,r]=A.useState(t??null);return A.useEffect(()=>{const s=e.current;if(!s||typeof ResizeObserver>"u")return;const o=new ResizeObserver(a=>{const u=a[0];u&&r(u.contentRect.width)});return o.observe(s),r(s.getBoundingClientRect().width),()=>o.disconnect()},[]),[e,n]}const TX=[{id:"all",label:"All"},{id:"personal",label:"Personal"},{id:"uncategorized",label:"Unclassified"},{id:"newsletter",label:"Newsletters"},{id:"marketing",label:"Marketing"},{id:"automated",label:"Automated"},{id:"transactional",label:"Transactional"},{id:"social",label:"Social"}],RX={uncategorized:"neutral",personal:"accent",newsletter:"neutral",marketing:"neutral",automated:"neutral",transactional:"positive",social:"warning"};function IX({open:t,onClose:e,title:n,titleId:r="dialog-title",children:s,className:o,anchor:a="center"}){const u=A.useRef(null),c=A.useCallback(m=>{m.key==="Escape"&&(m.preventDefault(),m.stopImmediatePropagation(),e())},[e]);if(A.useEffect(()=>{if(t)return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[t,c]),A.useEffect(()=>{if(!t)return;const m=u.current;if(!m)return;m.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')[0]?.focus()},[t]),!t)return null;const f=a==="left",p=a==="right",g=f||p;return D.jsxs("div",{className:dn("fixed inset-0 z-50 flex",f?"items-stretch justify-start":p?"items-stretch justify-end":"items-center justify-center px-4"),role:"presentation",onClick:e,children:[D.jsx("div",{className:dn("absolute inset-0",!g&&"bg-canvas/80")}),D.jsxs("div",{ref:u,role:"dialog","aria-modal":"true","aria-labelledby":r,className:dn("relative z-10 overflow-hidden border-line bg-surface shadow-xl",f?"h-full w-72 max-w-[85vw] border-r":p?"h-full w-[80vw] max-w-[320px] border-l":"w-full max-w-lg rounded-md border",o),onClick:m=>m.stopPropagation(),onKeyDown:m=>m.stopPropagation(),children:[D.jsx("h2",{id:r,className:"sr-only",children:n}),s]})]})}const xy=A.createContext(null);xy.displayName="PanelGroupContext";const mn={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},FA=10,Rl=A.useLayoutEffect,HM=q5.useId,OX=typeof HM=="function"?HM:()=>null;let NX=0;function zA(t=null){const e=OX(),n=A.useRef(t||e||null);return n.current===null&&(n.current=""+NX++),t??n.current}function t8({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:o,id:a,maxSize:u,minSize:c,onCollapse:f,onExpand:p,onResize:g,order:m,style:y,tagName:S="div",...E}){const C=A.useContext(xy);if(C===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:x,getPanelSize:T,getPanelStyle:R,groupId:M,isPanelCollapsed:O,reevaluatePanelConstraints:I,registerPanel:P,resizePanel:k,unregisterPanel:H}=C,F=zA(a),B=A.useRef({callbacks:{onCollapse:f,onExpand:p,onResize:g},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:u,minSize:c},id:F,idIsFromProps:a!==void 0,order:m});A.useRef({didLogMissingDefaultSizeWarning:!1}),Rl(()=>{const{callbacks:Y,constraints:ne}=B.current,$={...ne};B.current.id=F,B.current.idIsFromProps=a!==void 0,B.current.order=m,Y.onCollapse=f,Y.onExpand=p,Y.onResize=g,ne.collapsedSize=n,ne.collapsible=r,ne.defaultSize=s,ne.maxSize=u,ne.minSize=c,($.collapsedSize!==ne.collapsedSize||$.collapsible!==ne.collapsible||$.maxSize!==ne.maxSize||$.minSize!==ne.minSize)&&I(B.current,$)}),Rl(()=>{const Y=B.current;return P(Y),()=>{H(Y)}},[m,F,P,H]),A.useImperativeHandle(o,()=>({collapse:()=>{w(B.current)},expand:Y=>{x(B.current,Y)},getId(){return F},getSize(){return T(B.current)},isCollapsed(){return O(B.current)},isExpanded(){return!O(B.current)},resize:Y=>{k(B.current,Y)}}),[w,x,T,O,F,k]);const W=R(B.current,s);return A.createElement(S,{...E,children:t,className:e,id:F,style:{...W,...y},[mn.groupId]:M,[mn.panel]:"",[mn.panelCollapsible]:r||void 0,[mn.panelId]:F,[mn.panelSize]:parseFloat(""+W.flexGrow).toFixed(1)})}const n8=A.forwardRef((t,e)=>A.createElement(t8,{...t,forwardedRef:e}));t8.displayName="Panel";n8.displayName="forwardRef(Panel)";let D_=null,Wm=-1,Ea=null;function MX(t,e){if(e){const n=(e&a8)!==0,r=(e&l8)!==0,s=(e&u8)!==0,o=(e&c8)!==0;if(n)return s?"se-resize":o?"ne-resize":"e-resize";if(r)return s?"sw-resize":o?"nw-resize":"w-resize";if(s)return"s-resize";if(o)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function PX(){Ea!==null&&(document.head.removeChild(Ea),D_=null,Ea=null,Wm=-1)}function j1(t,e){var n,r;const s=MX(t,e);if(D_!==s){if(D_=s,Ea===null&&(Ea=document.createElement("style"),document.head.appendChild(Ea)),Wm>=0){var o;(o=Ea.sheet)===null||o===void 0||o.removeRule(Wm)}Wm=(n=(r=Ea.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${s} !important;}`))!==null&&n!==void 0?n:-1}}function r8(t){return t.type==="keydown"}function s8(t){return t.type.startsWith("pointer")}function o8(t){return t.type.startsWith("mouse")}function Ay(t){if(s8(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(o8(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function kX(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function DX(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function LX(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:WM(t),b:WM(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;tt(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:qM($M(n.a)),b:qM($M(n.b))};if(s.a===s.b){const o=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let u=o.length;for(;u--;){const c=o[u];if(c===a.a)return 1;if(c===a.b)return-1}}return Math.sign(s.a-s.b)}const UX=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function FX(t){var e;const n=getComputedStyle((e=i8(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function zX(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||FX(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||UX.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function $M(t){let e=t.length;for(;e--;){const n=t[e];if(tt(n,"Missing node"),zX(n))return n}return null}function qM(t){return t&&Number(getComputedStyle(t).zIndex)||0}function WM(t){const e=[];for(;t;)e.push(t),t=i8(t);return e}function i8(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const a8=1,l8=2,u8=4,c8=8,BX=kX()==="coarse";let Ys=[],Ac=!1,El=new Map,Ty=new Map;const gh=new Set;function jX(t,e,n,r,s){var o;const{ownerDocument:a}=e,u={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:s},c=(o=El.get(a))!==null&&o!==void 0?o:0;return El.set(a,c+1),gh.add(u),mv(),function(){var p;Ty.delete(t),gh.delete(u);const g=(p=El.get(a))!==null&&p!==void 0?p:1;if(El.set(a,g-1),mv(),g===1&&El.delete(a),Ys.includes(u)){const m=Ys.indexOf(u);m>=0&&Ys.splice(m,1),jA(),s("up",!0,null)}}}function HX(t){const{target:e}=t,{x:n,y:r}=Ay(t);Ac=!0,BA({target:e,x:n,y:r}),mv(),Ys.length>0&&(vv("down",t),t.preventDefault(),d8(e)||t.stopImmediatePropagation())}function H1(t){const{x:e,y:n}=Ay(t);if(Ac&&t.buttons===0&&(Ac=!1,vv("up",t)),!Ac){const{target:r}=t;BA({target:r,x:e,y:n})}vv("move",t),jA(),Ys.length>0&&t.preventDefault()}function $1(t){const{target:e}=t,{x:n,y:r}=Ay(t);Ty.clear(),Ac=!1,Ys.length>0&&(t.preventDefault(),d8(e)||t.stopImmediatePropagation()),vv("up",t),BA({target:e,x:n,y:r}),jA(),mv()}function d8(t){let e=t;for(;e;){if(e.hasAttribute(mn.resizeHandle))return!0;e=e.parentElement}return!1}function BA({target:t,x:e,y:n}){Ys.splice(0);let r=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(r=t),gh.forEach(s=>{const{element:o,hitAreaMargins:a}=s,u=o.getBoundingClientRect(),{bottom:c,left:f,right:p,top:g}=u,m=BX?a.coarse:a.fine;if(e>=f-m&&e<=p+m&&n>=g-m&&n<=c+m){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&LX(r,o)>0){let S=r,E=!1;for(;S&&!S.contains(o);){if(DX(S.getBoundingClientRect(),u)){E=!0;break}S=S.parentElement}if(E)return}Ys.push(s)}})}function q1(t,e){Ty.set(t,e)}function jA(){let t=!1,e=!1;Ys.forEach(r=>{const{direction:s}=r;s==="horizontal"?t=!0:e=!0});let n=0;Ty.forEach(r=>{n|=r}),t&&e?j1("intersection",n):t?j1("horizontal",n):e?j1("vertical",n):PX()}let W1=new AbortController;function mv(){W1.abort(),W1=new AbortController;const t={capture:!0,signal:W1.signal};gh.size&&(Ac?(Ys.length>0&&El.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("contextmenu",$1,t),r.addEventListener("pointerleave",H1,t),r.addEventListener("pointermove",H1,t))}),window.addEventListener("pointerup",$1,t),window.addEventListener("pointercancel",$1,t)):El.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("pointerdown",HX,t),r.addEventListener("pointermove",H1,t))}))}function vv(t,e){gh.forEach(n=>{const{setResizeHandlerState:r}=n,s=Ys.includes(n);r(t,s,e)})}function $X(){const[t,e]=A.useState(0);return A.useCallback(()=>e(n=>n+1),[])}function tt(t,e){if(!t)throw console.error(e),Error(e)}function Fl(t,e,n=FA){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function li(t,e,n=FA){return Fl(t,e,n)===0}function ss(t,e,n){return Fl(t,e,n)===0}function qX(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++){const s=t[r],o=e[r];if(!ss(s,o,n))return!1}return!0}function mc({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];tt(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:s=0,collapsible:o,maxSize:a=100,minSize:u=0}=r;if(Fl(n,u)<0)if(o){const c=(s+u)/2;Fl(n,c)<0?n=s:n=u}else n=u;return n=Math.min(a,n),n=parseFloat(n.toFixed(FA)),n}function Bf({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:o}){if(ss(t,0))return e;const a=[...e],[u,c]=r;tt(u!=null,"Invalid first pivot index"),tt(c!=null,"Invalid second pivot index");let f=0;if(o==="keyboard"){{const g=t<0?c:u,m=n[g];tt(m,`Panel constraints not found for index ${g}`);const{collapsedSize:y=0,collapsible:S,minSize:E=0}=m;if(S){const C=e[g];if(tt(C!=null,`Previous layout not found for panel index ${g}`),ss(C,y)){const w=E-C;Fl(w,Math.abs(t))>0&&(t=t<0?0-w:w)}}}{const g=t<0?u:c,m=n[g];tt(m,`No panel constraints found for index ${g}`);const{collapsedSize:y=0,collapsible:S,minSize:E=0}=m;if(S){const C=e[g];if(tt(C!=null,`Previous layout not found for panel index ${g}`),ss(C,E)){const w=C-y;Fl(w,Math.abs(t))>0&&(t=t<0?0-w:w)}}}}{const g=t<0?1:-1;let m=t<0?c:u,y=0;for(;;){const E=e[m];tt(E!=null,`Previous layout not found for panel index ${m}`);const w=mc({panelConstraints:n,panelIndex:m,size:100})-E;if(y+=w,m+=g,m<0||m>=n.length)break}const S=Math.min(Math.abs(t),Math.abs(y));t=t<0?0-S:S}{let m=t<0?u:c;for(;m>=0&&m<n.length;){const y=Math.abs(t)-Math.abs(f),S=e[m];tt(S!=null,`Previous layout not found for panel index ${m}`);const E=S-y,C=mc({panelConstraints:n,panelIndex:m,size:E});if(!ss(S,C)&&(f+=S-C,a[m]=C,f.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?m--:m++}}if(qX(s,a))return s;{const g=t<0?c:u,m=e[g];tt(m!=null,`Previous layout not found for panel index ${g}`);const y=m+f,S=mc({panelConstraints:n,panelIndex:g,size:y});if(a[g]=S,!ss(S,y)){let E=y-S,w=t<0?c:u;for(;w>=0&&w<n.length;){const x=a[w];tt(x!=null,`Previous layout not found for panel index ${w}`);const T=x+E,R=mc({panelConstraints:n,panelIndex:w,size:T});if(ss(x,R)||(E-=R-x,a[w]=R),ss(E,0))break;t>0?w--:w++}}}const p=a.reduce((g,m)=>m+g,0);return ss(p,100)?a:s}function WX({layout:t,panelsArray:e,pivotIndices:n}){let r=0,s=100,o=0,a=0;const u=n[0];tt(u!=null,"No pivot index found"),e.forEach((g,m)=>{const{constraints:y}=g,{maxSize:S=100,minSize:E=0}=y;m===u?(r=E,s=S):(o+=E,a+=S)});const c=Math.min(s,100-o),f=Math.max(r,100-a),p=t[u];return{valueMax:c,valueMin:f,valueNow:p}}function mh(t,e=document){return Array.from(e.querySelectorAll(`[${mn.resizeHandleId}][data-panel-group-id="${t}"]`))}function f8(t,e,n=document){const s=mh(t,n).findIndex(o=>o.getAttribute(mn.resizeHandleId)===e);return s??null}function h8(t,e,n){const r=f8(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function p8(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return r||null}function Ry(t,e=document){const n=e.querySelector(`[${mn.resizeHandleId}="${t}"]`);return n||null}function GX(t,e,n,r=document){var s,o,a,u;const c=Ry(e,r),f=mh(t,r),p=c?f.indexOf(c):-1,g=(s=(o=n[p])===null||o===void 0?void 0:o.id)!==null&&s!==void 0?s:null,m=(a=(u=n[p+1])===null||u===void 0?void 0:u.id)!==null&&a!==void 0?a:null;return[g,m]}function VX({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:s,panelGroupElement:o,setLayout:a}){A.useRef({didWarnAboutMissingResizeHandle:!1}),Rl(()=>{if(!o)return;const u=mh(n,o);for(let c=0;c<s.length-1;c++){const{valueMax:f,valueMin:p,valueNow:g}=WX({layout:r,panelsArray:s,pivotIndices:[c,c+1]}),m=u[c];if(m!=null){const y=s[c];tt(y,`No panel data found for index "${c}"`),m.setAttribute("aria-controls",y.id),m.setAttribute("aria-valuemax",""+Math.round(f)),m.setAttribute("aria-valuemin",""+Math.round(p)),m.setAttribute("aria-valuenow",g!=null?""+Math.round(g):"")}}return()=>{u.forEach((c,f)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,r,s,o]),A.useEffect(()=>{if(!o)return;const u=e.current;tt(u,"Eager values not found");const{panelDataArray:c}=u,f=p8(n,o);tt(f!=null,`No group found for id "${n}"`);const p=mh(n,o);tt(p,`No resize handles found for group id "${n}"`);const g=p.map(m=>{const y=m.getAttribute(mn.resizeHandleId);tt(y,"Resize handle element has no handle id attribute");const[S,E]=GX(n,y,c,o);if(S==null||E==null)return()=>{};const C=w=>{if(!w.defaultPrevented)switch(w.key){case"Enter":{w.preventDefault();const x=c.findIndex(T=>T.id===S);if(x>=0){const T=c[x];tt(T,`No panel data found for index ${x}`);const R=r[x],{collapsedSize:M=0,collapsible:O,minSize:I=0}=T.constraints;if(R!=null&&O){const P=Bf({delta:ss(R,M)?I-M:M-R,initialLayout:r,panelConstraints:c.map(k=>k.constraints),pivotIndices:h8(n,y,o),prevLayout:r,trigger:"keyboard"});r!==P&&a(P)}}break}}};return m.addEventListener("keydown",C),()=>{m.removeEventListener("keydown",C)}});return()=>{g.forEach(m=>m())}},[o,t,e,n,r,s,a])}function GM(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function g8(t,e){const n=t==="horizontal",{x:r,y:s}=Ay(e);return n?r:s}function KX(t,e,n,r,s){const o=n==="horizontal",a=Ry(e,s);tt(a,`No resize handle element found for id "${e}"`);const u=a.getAttribute(mn.groupId);tt(u,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=r;const f=g8(n,t),p=p8(u,s);tt(p,`No group element found for id "${u}"`);const g=p.getBoundingClientRect(),m=o?g.width:g.height;return(f-c)/m*100}function YX(t,e,n,r,s,o){if(r8(t)){const a=n==="horizontal";let u=0;t.shiftKey?u=100:s!=null?u=s:u=10;let c=0;switch(t.key){case"ArrowDown":c=a?0:u;break;case"ArrowLeft":c=a?-u:0;break;case"ArrowRight":c=a?u:0;break;case"ArrowUp":c=a?0:-u;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return r==null?0:KX(t,e,n,r,o)}function ZX({panelDataArray:t}){const e=Array(t.length),n=t.map(o=>o.constraints);let r=0,s=100;for(let o=0;o<t.length;o++){const a=n[o];tt(a,`Panel constraints not found for index ${o}`);const{defaultSize:u}=a;u!=null&&(r++,e[o]=u,s-=u)}for(let o=0;o<t.length;o++){const a=n[o];tt(a,`Panel constraints not found for index ${o}`);const{defaultSize:u}=a;if(u!=null)continue;const c=t.length-r,f=s/c;r++,e[o]=f,s-=f}return e}function Vu(t,e,n){e.forEach((r,s)=>{const o=t[s];tt(o,`Panel data not found for index ${s}`);const{callbacks:a,constraints:u,id:c}=o,{collapsedSize:f=0,collapsible:p}=u,g=n[c];if(g==null||r!==g){n[c]=r;const{onCollapse:m,onExpand:y,onResize:S}=a;S&&S(r,g),p&&(m||y)&&(y&&(g==null||li(g,f))&&!li(r,f)&&y(),m&&(g==null||!li(g,f))&&li(r,f)&&m())}})}function zg(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function XX({defaultSize:t,dragState:e,layout:n,panelData:r,panelIndex:s,precision:o=3}){const a=n[s];let u;return a==null?u=t!=null?t.toPrecision(o):"1":r.length===1?u="1":u=a.toPrecision(o),{flexBasis:0,flexGrow:u,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function QX(t,e=10){let n=null;return(...s)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...s)},e)}}function VM(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function m8(t){return`react-resizable-panels:${t}`}function v8(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:s,order:o}=e;return s?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function y8(t,e){try{const n=m8(t),r=e.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function JX(t,e,n){var r,s;const o=(r=y8(t,n))!==null&&r!==void 0?r:{},a=v8(e);return(s=o[a])!==null&&s!==void 0?s:null}function eQ(t,e,n,r,s){var o;const a=m8(t),u=v8(e),c=(o=y8(t,s))!==null&&o!==void 0?o:{};c[u]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(a,JSON.stringify(c))}catch(f){console.error(f)}}function KM({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((o,a)=>o+a,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!ss(r,100)&&n.length>0)for(let o=0;o<e.length;o++){const a=n[o];tt(a!=null,`No layout data found for index ${o}`);const u=100/r*a;n[o]=u}let s=0;for(let o=0;o<e.length;o++){const a=n[o];tt(a!=null,`No layout data found for index ${o}`);const u=mc({panelConstraints:e,panelIndex:o,size:a});a!=u&&(s+=a-u,n[o]=u)}if(!ss(s,0))for(let o=0;o<e.length;o++){const a=n[o];tt(a!=null,`No layout data found for index ${o}`);const u=a+s,c=mc({panelConstraints:e,panelIndex:o,size:u});if(a!==c&&(s-=c-a,n[o]=c,ss(s,0)))break}return n}const tQ=100,jf={getItem:t=>(VM(jf),jf.getItem(t)),setItem:(t,e)=>{VM(jf),jf.setItem(t,e)}},YM={};function b8({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:s,id:o=null,onLayout:a=null,keyboardResizeBy:u=null,storage:c=jf,style:f,tagName:p="div",...g}){const m=zA(o),y=A.useRef(null),[S,E]=A.useState(null),[C,w]=A.useState([]),x=$X(),T=A.useRef({}),R=A.useRef(new Map),M=A.useRef(0),O=A.useRef({autoSaveId:t,direction:r,dragState:S,id:m,keyboardResizeBy:u,onLayout:a,storage:c}),I=A.useRef({layout:C,panelDataArray:[],panelDataArrayChanged:!1});A.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),A.useImperativeHandle(s,()=>({getId:()=>O.current.id,getLayout:()=>{const{layout:K}=I.current;return K},setLayout:K=>{const{onLayout:J}=O.current,{layout:oe,panelDataArray:he}=I.current,ue=KM({layout:K,panelConstraints:he.map(ve=>ve.constraints)});GM(oe,ue)||(w(ue),I.current.layout=ue,J&&J(ue),Vu(he,ue,T.current))}}),[]),Rl(()=>{O.current.autoSaveId=t,O.current.direction=r,O.current.dragState=S,O.current.id=m,O.current.onLayout=a,O.current.storage=c}),VX({committedValuesRef:O,eagerValuesRef:I,groupId:m,layout:C,panelDataArray:I.current.panelDataArray,setLayout:w,panelGroupElement:y.current}),A.useEffect(()=>{const{panelDataArray:K}=I.current;if(t){if(C.length===0||C.length!==K.length)return;let J=YM[t];J==null&&(J=QX(eQ,tQ),YM[t]=J);const oe=[...K],he=new Map(R.current);J(t,oe,he,C,c)}},[t,C,c]),A.useEffect(()=>{});const P=A.useCallback(K=>{const{onLayout:J}=O.current,{layout:oe,panelDataArray:he}=I.current;if(K.constraints.collapsible){const ue=he.map(Ee=>Ee.constraints),{collapsedSize:ve=0,panelSize:_e,pivotIndices:Xe}=ml(he,K,oe);if(tt(_e!=null,`Panel size not found for panel "${K.id}"`),!li(_e,ve)){R.current.set(K.id,_e);const pt=lc(he,K)===he.length-1?_e-ve:ve-_e,Ce=Bf({delta:pt,initialLayout:oe,panelConstraints:ue,pivotIndices:Xe,prevLayout:oe,trigger:"imperative-api"});zg(oe,Ce)||(w(Ce),I.current.layout=Ce,J&&J(Ce),Vu(he,Ce,T.current))}}},[]),k=A.useCallback((K,J)=>{const{onLayout:oe}=O.current,{layout:he,panelDataArray:ue}=I.current;if(K.constraints.collapsible){const ve=ue.map(ze=>ze.constraints),{collapsedSize:_e=0,panelSize:Xe=0,minSize:Ee=0,pivotIndices:pt}=ml(ue,K,he),Ce=J??Ee;if(li(Xe,_e)){const ze=R.current.get(K.id),Be=ze!=null&&ze>=Ce?ze:Ce,pr=lc(ue,K)===ue.length-1?Xe-Be:Be-Xe,Et=Bf({delta:pr,initialLayout:he,panelConstraints:ve,pivotIndices:pt,prevLayout:he,trigger:"imperative-api"});zg(he,Et)||(w(Et),I.current.layout=Et,oe&&oe(Et),Vu(ue,Et,T.current))}}},[]),H=A.useCallback(K=>{const{layout:J,panelDataArray:oe}=I.current,{panelSize:he}=ml(oe,K,J);return tt(he!=null,`Panel size not found for panel "${K.id}"`),he},[]),F=A.useCallback((K,J)=>{const{panelDataArray:oe}=I.current,he=lc(oe,K);return XX({defaultSize:J,dragState:S,layout:C,panelData:oe,panelIndex:he})},[S,C]),B=A.useCallback(K=>{const{layout:J,panelDataArray:oe}=I.current,{collapsedSize:he=0,collapsible:ue,panelSize:ve}=ml(oe,K,J);return tt(ve!=null,`Panel size not found for panel "${K.id}"`),ue===!0&&li(ve,he)},[]),W=A.useCallback(K=>{const{layout:J,panelDataArray:oe}=I.current,{collapsedSize:he=0,collapsible:ue,panelSize:ve}=ml(oe,K,J);return tt(ve!=null,`Panel size not found for panel "${K.id}"`),!ue||Fl(ve,he)>0},[]),Y=A.useCallback(K=>{const{panelDataArray:J}=I.current;J.push(K),J.sort((oe,he)=>{const ue=oe.order,ve=he.order;return ue==null&&ve==null?0:ue==null?-1:ve==null?1:ue-ve}),I.current.panelDataArrayChanged=!0,x()},[x]);Rl(()=>{if(I.current.panelDataArrayChanged){I.current.panelDataArrayChanged=!1;const{autoSaveId:K,onLayout:J,storage:oe}=O.current,{layout:he,panelDataArray:ue}=I.current;let ve=null;if(K){const Xe=JX(K,ue,oe);Xe&&(R.current=new Map(Object.entries(Xe.expandToSizes)),ve=Xe.layout)}ve==null&&(ve=ZX({panelDataArray:ue}));const _e=KM({layout:ve,panelConstraints:ue.map(Xe=>Xe.constraints)});GM(he,_e)||(w(_e),I.current.layout=_e,J&&J(_e),Vu(ue,_e,T.current))}}),Rl(()=>{const K=I.current;return()=>{K.layout=[]}},[]);const ne=A.useCallback(K=>{let J=!1;const oe=y.current;return oe&&window.getComputedStyle(oe,null).getPropertyValue("direction")==="rtl"&&(J=!0),function(ue){ue.preventDefault();const ve=y.current;if(!ve)return()=>null;const{direction:_e,dragState:Xe,id:Ee,keyboardResizeBy:pt,onLayout:Ce}=O.current,{layout:ze,panelDataArray:Be}=I.current,{initialLayout:He}=Xe??{},pr=h8(Ee,K,ve);let Et=YX(ue,K,_e,Xe,pt,ve);const Gr=_e==="horizontal";Gr&&J&&(Et=-Et);const Wn=Be.map(xr=>xr.constraints),_r=Bf({delta:Et,initialLayout:He??ze,panelConstraints:Wn,pivotIndices:pr,prevLayout:ze,trigger:r8(ue)?"keyboard":"mouse-or-touch"}),to=!zg(ze,_r);(s8(ue)||o8(ue))&&M.current!=Et&&(M.current=Et,!to&&Et!==0?Gr?q1(K,Et<0?a8:l8):q1(K,Et<0?u8:c8):q1(K,0)),to&&(w(_r),I.current.layout=_r,Ce&&Ce(_r),Vu(Be,_r,T.current))}},[]),$=A.useCallback((K,J)=>{const{onLayout:oe}=O.current,{layout:he,panelDataArray:ue}=I.current,ve=ue.map(ze=>ze.constraints),{panelSize:_e,pivotIndices:Xe}=ml(ue,K,he);tt(_e!=null,`Panel size not found for panel "${K.id}"`);const pt=lc(ue,K)===ue.length-1?_e-J:J-_e,Ce=Bf({delta:pt,initialLayout:he,panelConstraints:ve,pivotIndices:Xe,prevLayout:he,trigger:"imperative-api"});zg(he,Ce)||(w(Ce),I.current.layout=Ce,oe&&oe(Ce),Vu(ue,Ce,T.current))},[]),ee=A.useCallback((K,J)=>{const{layout:oe,panelDataArray:he}=I.current,{collapsedSize:ue=0,collapsible:ve}=J,{collapsedSize:_e=0,collapsible:Xe,maxSize:Ee=100,minSize:pt=0}=K.constraints,{panelSize:Ce}=ml(he,K,oe);Ce!=null&&(ve&&Xe&&li(Ce,ue)?li(ue,_e)||$(K,_e):Ce<pt?$(K,pt):Ce>Ee&&$(K,Ee))},[$]),fe=A.useCallback((K,J)=>{const{direction:oe}=O.current,{layout:he}=I.current;if(!y.current)return;const ue=Ry(K,y.current);tt(ue,`Drag handle element not found for id "${K}"`);const ve=g8(oe,J);E({dragHandleId:K,dragHandleRect:ue.getBoundingClientRect(),initialCursorPosition:ve,initialLayout:he})},[]),de=A.useCallback(()=>{E(null)},[]),Ae=A.useCallback(K=>{const{panelDataArray:J}=I.current,oe=lc(J,K);oe>=0&&(J.splice(oe,1),delete T.current[K.id],I.current.panelDataArrayChanged=!0,x())},[x]),L=A.useMemo(()=>({collapsePanel:P,direction:r,dragState:S,expandPanel:k,getPanelSize:H,getPanelStyle:F,groupId:m,isPanelCollapsed:B,isPanelExpanded:W,reevaluatePanelConstraints:ee,registerPanel:Y,registerResizeHandle:ne,resizePanel:$,startDragging:fe,stopDragging:de,unregisterPanel:Ae,panelGroupElement:y.current}),[P,S,r,k,H,F,m,B,W,ee,Y,ne,$,fe,de,Ae]),V={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return A.createElement(xy.Provider,{value:L},A.createElement(p,{...g,children:e,className:n,id:o,ref:y,style:{...V,...f},[mn.group]:"",[mn.groupDirection]:r,[mn.groupId]:m}))}const S8=A.forwardRef((t,e)=>A.createElement(b8,{...t,forwardedRef:e}));b8.displayName="PanelGroup";S8.displayName="forwardRef(PanelGroup)";function lc(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function ml(t,e,n){const r=lc(t,e),o=r===t.length-1?[r-1,r]:[r,r+1],a=n[r];return{...e.constraints,panelSize:a,pivotIndices:o}}function nQ({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){A.useEffect(()=>{if(t||n==null||r==null)return;const s=Ry(e,r);if(s==null)return;const o=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const u=s.getAttribute(mn.groupId);tt(u,`No group element found for id "${u}"`);const c=mh(u,r),f=f8(u,e,r);tt(f!==null,`No resize element found for id "${e}"`);const p=a.shiftKey?f>0?f-1:c.length-1:f+1<c.length?f+1:0;c[p].focus();break}}};return s.addEventListener("keydown",o),()=>{s.removeEventListener("keydown",o)}},[r,t,e,n])}function E8({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:o,onClick:a,onDragging:u,onFocus:c,onPointerDown:f,onPointerUp:p,style:g={},tabIndex:m=0,tagName:y="div",...S}){var E,C;const w=A.useRef(null),x=A.useRef({onClick:a,onDragging:u,onPointerDown:f,onPointerUp:p});A.useEffect(()=>{x.current.onClick=a,x.current.onDragging=u,x.current.onPointerDown=f,x.current.onPointerUp=p});const T=A.useContext(xy);if(T===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:R,groupId:M,registerResizeHandle:O,startDragging:I,stopDragging:P,panelGroupElement:k}=T,H=zA(s),[F,B]=A.useState("inactive"),[W,Y]=A.useState(!1),[ne,$]=A.useState(null),ee=A.useRef({state:F});Rl(()=>{ee.current.state=F}),A.useEffect(()=>{if(n)$(null);else{const L=O(H);$(()=>L)}},[n,H,O]);const fe=(E=r?.coarse)!==null&&E!==void 0?E:15,de=(C=r?.fine)!==null&&C!==void 0?C:5;A.useEffect(()=>{if(n||ne==null)return;const L=w.current;tt(L,"Element ref not attached");let V=!1;return jX(H,L,R,{coarse:fe,fine:de},(J,oe,he)=>{if(!oe){B("inactive");return}switch(J){case"down":{B("drag"),V=!1,tt(he,'Expected event to be defined for "down" action'),I(H,he);const{onDragging:ue,onPointerDown:ve}=x.current;ue?.(!0),ve?.();break}case"move":{const{state:ue}=ee.current;V=!0,ue!=="drag"&&B("hover"),tt(he,'Expected event to be defined for "move" action'),ne(he);break}case"up":{B("hover"),P();const{onClick:ue,onDragging:ve,onPointerUp:_e}=x.current;ve?.(!1),_e?.(),V||ue?.();break}}})},[fe,R,n,de,O,H,ne,I,P]),nQ({disabled:n,handleId:H,resizeHandler:ne,panelGroupElement:k});const Ae={touchAction:"none",userSelect:"none"};return A.createElement(y,{...S,children:t,className:e,id:s,onBlur:()=>{Y(!1),o?.()},onFocus:()=>{Y(!0),c?.()},ref:w,role:"separator",style:{...Ae,...g},tabIndex:m,[mn.groupDirection]:R,[mn.groupId]:M,[mn.resizeHandle]:"",[mn.resizeHandleActive]:F==="drag"?"pointer":W?"keyboard":void 0,[mn.resizeHandleEnabled]:!n,[mn.resizeHandleId]:H,[mn.resizeHandleState]:F})}E8.displayName="PanelResizeHandle";function rQ({className:t,...e}){return D.jsx(S8,{className:dn("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...e})}const Bg=n8;function G1({className:t,...e}){return D.jsx(E8,{className:dn("relative w-px shrink-0 bg-line transition-colors cursor-col-resize","after:absolute after:inset-y-0 after:left-1/2 after:w-1.5 after:-translate-x-1/2","data-[resize-handle-state=hover]:bg-line-strong","data-[resize-handle-state=drag]:bg-accent","focus-visible:outline-none focus-visible:bg-accent",t),...e})}const C8=A.createContext(null);function bxe(){return A.useContext(C8)}function Sxe({nav:t,list:e,reading:n,intelligence:r,intelligenceOpen:s=!0,hasThread:o=!0,density:a="comfortable",header:u,overlay:c,skeleton:f,isLoading:p=!1,initialWidth:g,navOpen:m,onOpenNav:y,onCloseNav:S}){const[E,C]=AX(g),w=xX(C??0),x=w.nav,T=w.reading&&!!n,R=w.intelligence,[M,O]=A.useState(!1),I=m!==void 0,P=I?m:M,k=()=>{I||O(!0),y?.()},H=()=>{I||O(!1),S?.()},F=R&&s&&o&&!!r,B={panes:w,containerWidth:C,showNavPane:x,openNav:k,showReadingPane:T,showIntelligencePane:R};return D.jsx(C8.Provider,{value:B,children:D.jsx("div",{ref:E,className:"@container flex h-dvh w-full flex-col overflow-hidden bg-canvas font-sans text-fg",children:p&&f?f:D.jsxs(D.Fragment,{children:[!x&&u&&D.jsx("div",{className:"shrink-0",children:u}),D.jsxs(rQ,{direction:"horizontal",className:"min-h-0 flex-1",children:[x&&D.jsxs(D.Fragment,{children:[D.jsx(Bg,{id:"nav",order:1,defaultSize:17,minSize:12,maxSize:24,className:"min-w-0",children:t}),D.jsx(G1,{})]}),D.jsx(Bg,{id:"list",order:2,defaultSize:T?a==="compact"?36:27:83,minSize:18,maxSize:T?48:88,className:"min-w-0",children:e}),T&&D.jsxs(D.Fragment,{children:[D.jsx(G1,{}),D.jsx(Bg,{id:"reading",order:3,minSize:24,className:"min-w-0",children:n})]}),F&&D.jsxs(D.Fragment,{children:[D.jsx(G1,{}),D.jsx(Bg,{id:"intelligence",order:4,defaultSize:21,minSize:15,maxSize:32,className:"min-w-0",children:r})]})]}),!x&&D.jsx(IX,{open:P,onClose:H,title:"Folders",anchor:"left",children:t}),c]})})})}const sQ="inline-flex items-center justify-center gap-2 rounded-md font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface disabled:opacity-50 disabled:pointer-events-none",oQ={primary:"bg-accent text-accent-fg hover:bg-accent-hover",secondary:"bg-surface text-fg border border-line hover:bg-surface-sunken hover:border-line-strong",ghost:"text-fg-muted hover:bg-surface-sunken hover:text-fg",danger:"bg-danger text-accent-fg hover:opacity-90"},iQ={sm:"h-7 px-2.5 text-xs",md:"h-9 px-3.5 text-sm"};function Gm({variant:t="primary",size:e="md",icon:n,className:r,children:s,...o}){return D.jsxs("button",{type:"button",className:dn(sQ,oQ[t],iQ[e],r),...o,children:[n,s]})}const aQ={neutral:"bg-surface-sunken text-fg-muted",accent:"bg-accent-2-soft text-accent-2",positive:"bg-surface-sunken text-positive",warning:"bg-surface-sunken text-warning",danger:"bg-danger-soft text-danger"},lQ={neutral:"bg-fg-subtle",accent:"bg-accent-2",positive:"bg-positive",warning:"bg-warning",danger:"bg-danger"};function ZM({tone:t="neutral",dot:e,className:n,children:r,...s}){return D.jsxs("span",{className:dn("inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-2xs font-medium",aQ[t],n),...s,children:[e&&D.jsx("span",{className:dn("size-1.5 rounded-full",lQ[t])}),r]})}const XM=10;function uQ({section:t,Row:e,selectedThreadId:n,initialExpanded:r=!1,initialCollapsed:s=!1,onSelectThread:o}){const[a,u]=A.useState(r),[c,f]=A.useState(s),p=t.threads.length>XM,m=!a&&p?t.threads.slice(0,XM):t.threads,y=t.threads.length-m.length;return D.jsxs("div",{children:[t.label&&D.jsxs("button",{type:"button","aria-expanded":!c,onClick:()=>f(S=>!S),className:"sticky top-0 z-10 flex h-section-row w-full items-center gap-1.5 border-b border-line bg-surface-sunken px-row-inset text-left transition-colors hover:bg-surface",children:[D.jsx("span",{className:"flex-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:t.label}),D.jsx("span",{className:"text-2xs text-fg-subtle tabular-nums",children:t.threads.length}),D.jsx(zM,{className:dn("size-3 shrink-0 text-fg-subtle transition-transform duration-200",c?"rotate-0":"rotate-180")})]}),!c&&D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"divide-y divide-line",children:m.map(S=>D.jsx(e,{thread:S,active:S.id===n,onClick:()=>o?.(S.id)},S.id))}),p&&D.jsxs("button",{type:"button",onClick:()=>u(S=>!S),className:"flex w-full items-center justify-center border-b border-line px-row-inset py-1.5 text-2xs font-medium text-accent transition-colors hover:bg-surface",children:[a?"Show less":`Show ${y} more`,!a&&D.jsx(zM,{className:"ml-1 size-3"})]})]})]})}function cQ(t){return t.target!==t.currentTarget?!1:t.key==="Enter"||t.key===" "}function dQ({className:t}){return D.jsx("svg",{viewBox:"0 0 12 12",className:t,fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:D.jsx("path",{d:"M2 4l4 4 4-4"})})}function QM({className:t}){return D.jsx("svg",{viewBox:"0 0 12 12",className:t,fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:D.jsx("path",{d:"M3 3l6 6M9 3l-6 6"})})}function fQ({categories:t,filters:e,sources:n,sourcesNote:r,selectedCategory:s,activeFilters:o,expanded:a,onSelectCategory:u,onSelectSource:c,onToggleFilter:f,onClear:p,onExpandedChange:g,children:m}){const y=a!==void 0,[S,E]=A.useState(!1),C=y?a:S,w=A.useCallback(ne=>{y||E(ne),g?.(ne)},[y,g]),x=t[0],T=x!==void 0&&s===x.id,R=n?.[0],M=n?.find(ne=>ne.active),O=R===void 0||M?.id===R.id,I=!T||o.size>0||!O&&!!M,P=A.useCallback(()=>{R&&c?.(R.id)},[R,c]),k=A.useCallback(()=>{p(),P()},[p,P]),H=t.find(ne=>ne.id===s),F=I?D.jsxs(D.Fragment,{children:[!O&&M&&D.jsx("span",{className:"inline-flex items-center rounded-full border border-accent-2 bg-accent-2-soft px-2 py-0.5 text-2xs font-medium text-accent-2",children:M.label}),!T&&H&&D.jsx(ZM,{tone:H.tone??"neutral",children:H.label}),e.filter(ne=>o.has(ne.id)).map(ne=>D.jsx("span",{className:"inline-flex items-center rounded-full border border-accent-2 bg-accent-2-soft px-2 py-0.5 text-2xs font-medium text-accent-2",children:ne.label},ne.id))]}):D.jsx("span",{className:"text-2xs text-fg-subtle",children:"Filters"}),B=n&&n.length>1&&D.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-b border-line px-row-inset pb-2 pt-2",children:[n.map(ne=>D.jsxs("button",{type:"button",onClick:()=>c?.(ne.id),className:dn("flex items-center gap-1 rounded-full border px-2.5 py-0.5 text-2xs transition-colors",ne.active?"border-accent-2 bg-accent-2-soft font-medium text-accent-2":"border-line text-fg-muted hover:border-line-strong"),children:[ne.label,ne.count!=null&&ne.count>0&&D.jsx("span",{className:"tabular-nums opacity-70",children:ne.count})]},ne.id)),r&&D.jsx("span",{className:"ml-auto shrink-0 text-2xs text-fg-subtle",children:r})]}),W=D.jsx("div",{className:"flex flex-wrap items-center gap-1.5 border-b border-line px-row-inset pb-1.5 pt-1.5",children:t.map(ne=>{const $=s===ne.id;return D.jsx("button",{type:"button",onClick:()=>u(ne.id),className:dn("shrink-0 rounded-full transition-opacity",$?"opacity-100 ring-1 ring-accent-2":"opacity-60 hover:opacity-100"),children:D.jsx(ZM,{tone:ne.tone??"neutral",children:ne.label})},ne.id)})}),Y=D.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-b border-line px-row-inset pb-2 pt-1.5",children:[e.map(ne=>{const $=o.has(ne.id);return D.jsx("button",{type:"button",onClick:()=>f(ne.id),className:dn("shrink-0 rounded-full border px-2.5 py-0.5 text-2xs transition-colors",$?"border-accent-2 bg-accent-2-soft font-medium text-accent-2":"border-line text-fg-muted hover:border-line-strong"),children:ne.label},ne.id)}),I&&D.jsxs("button",{type:"button",onClick:k,className:"ml-auto flex items-center gap-1 px-1 text-2xs text-fg-subtle hover:text-fg-muted",children:[D.jsx(QM,{className:"size-3"}),"Clear"]})]});return D.jsxs("div",{className:"flex h-full w-full flex-col overflow-hidden",children:[D.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":C,"aria-label":C?"Collapse filters":"Expand filters",onClick:()=>w(!C),onKeyDown:ne=>{cQ(ne)&&(ne.preventDefault(),w(!C))},className:"flex h-section-row w-full shrink-0 cursor-pointer items-center gap-1.5 overflow-x-hidden border-b border-line bg-surface-sunken px-row-inset text-left hover:bg-surface",children:[F,I&&D.jsx("button",{type:"button","aria-label":"Clear filters",onClick:ne=>{ne.stopPropagation(),k()},className:"flex size-6 items-center justify-center text-fg-subtle hover:text-fg-muted",children:D.jsx(QM,{className:"size-3"})}),D.jsx(dQ,{className:dn("ml-auto size-3 shrink-0 text-fg-subtle transition-transform duration-200",C?"rotate-180":"rotate-0")})]}),C&&D.jsxs("div",{className:"shrink-0",children:[B,W,Y]}),D.jsx("div",{className:"flex-1 overflow-y-auto",children:m})]})}function hQ(t){return t.sentDate!=null?new Date(t.sentDate).toDateString()===new Date().toDateString():/^\d{1,2}:\d{2}$/.test(t.timeLabel)}const w8=[{id:"unread",label:"Unread",match:t=>!t.isRead},{id:"attachment",label:"Has attachment",match:t=>!!t.hasAttachment},{id:"contacts",label:"From contacts",match:t=>t.trust==="vip"||t.trust==="wellknown"},{id:"today",label:"Today",match:hQ}],pQ=w8.map(({id:t,label:e})=>({id:t,label:e}));function Exe({sections:t,briefCategory:e="all",selectedThreadId:n,Row:r,onSelectThread:s,onSelectBriefCategory:o,sources:a,sourcesNote:u,onSelectSource:c,defaultExpanded:f=!1}){const[p,g]=A.useState(new Set),[m,y]=A.useState(f),S=k=>{g(H=>{const F=new Set(H);return F.has(k)?F.delete(k):F.add(k),F})},E=w8.filter(k=>p.has(k.id)),C=k=>(e==="all"||k.category===e)&&E.every(H=>H.match(k)),w=e==="all",x=t.map(k=>({...k,threads:k.threads.filter(C)})).filter(k=>k.threads.length>0),T=t.flatMap(k=>k.threads).filter(C),R=TX.map(k=>({id:k.id,label:k.label,tone:k.id==="all"?"neutral":RX[k.id]})),M=pQ,O=()=>{o?.("all"),g(new Set)},I=w?x.length===0:T.length===0,P=D.jsxs(D.Fragment,{children:[w?x.map(k=>D.jsx(uQ,{section:k,Row:r,selectedThreadId:n,onSelectThread:s},k.id)):D.jsx("div",{className:"divide-y divide-line",children:T.map(k=>D.jsx(r,{thread:k,active:k.id===n,onClick:()=>s?.(k.id)},k.id))}),I&&D.jsx("div",{className:"px-row-inset py-6 text-center text-2xs text-fg-subtle",children:"No threads match these filters."})]});return D.jsx(fQ,{categories:R,filters:M,sources:a,sourcesNote:u,selectedCategory:e,activeFilters:p,expanded:m,onExpandedChange:y,onSelectCategory:k=>o?.(k),onSelectSource:c,onToggleFilter:k=>S(k),onClear:O,children:P})}const gQ={default:dn("flex h-9 items-center gap-2 rounded-md border border-line bg-surface-sunken px-3 text-sm","focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30 transition-colors"),inline:"flex items-center gap-2 bg-transparent text-sm"};function V1({icon:t,className:e,variant:n="default",ref:r,...s}){return D.jsxs("div",{className:dn(gQ[n],e),children:[t&&D.jsx("span",{className:"text-fg-subtle shrink-0",children:t}),D.jsx("input",{ref:r,className:"min-w-0 flex-1 bg-transparent text-fg placeholder:text-fg-subtle outline-none",...s})]})}function JM(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 mQ(t){if(Array.isArray(t))return t}function vQ(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,s,o,a,u=[],c=!0,f=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(c=(r=o.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(p){f=!0,s=p}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(f)throw s}}return u}}function yQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
13
13
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bQ(t,e){return mQ(t)||vQ(t,e)||SQ(t,e)||yQ()}function SQ(t,e){if(t){if(typeof t=="string")return JM(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)?JM(t,e):void 0}}const _8=Object.entries,eP=Object.setPrototypeOf,EQ=Object.isFrozen,CQ=Object.getPrototypeOf,wQ=Object.getOwnPropertyDescriptor;let tr=Object.freeze,rr=Object.seal,uc=Object.create,x8=typeof Reflect<"u"&&Reflect,L_=x8.apply,U_=x8.construct;tr||(tr=function(e){return e});rr||(rr=function(e){return e});L_||(L_=function(e,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),o=2;o<r;o++)s[o-2]=arguments[o];return e.apply(n,s)});U_||(U_=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return new e(...r)});const Ku=Tn(Array.prototype.forEach),_Q=Tn(Array.prototype.lastIndexOf),tP=Tn(Array.prototype.pop),Yu=Tn(Array.prototype.push),xQ=Tn(Array.prototype.splice),Ca=Array.isArray,Hf=Tn(String.prototype.toLowerCase),K1=Tn(String.prototype.toString),nP=Tn(String.prototype.match),bf=Tn(String.prototype.replace),rP=Tn(String.prototype.indexOf),AQ=Tn(String.prototype.trim),TQ=Tn(Number.prototype.toString),RQ=Tn(Boolean.prototype.toString),sP=typeof BigInt>"u"?null:Tn(BigInt.prototype.toString),oP=typeof Symbol>"u"?null:Tn(Symbol.prototype.toString),zn=Tn(Object.prototype.hasOwnProperty),Sf=Tn(Object.prototype.toString),Un=Tn(RegExp.prototype.test),vl=IQ(TypeError);function Tn(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return L_(t,e,r)}}function IQ(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return U_(t,n)}}function mt(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Hf;if(eP&&eP(t,null),!Ca(e))return t;let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){const o=n(s);o!==s&&(EQ(e)||(e[r]=o),s=o)}t[s]=!0}return t}function OQ(t){for(let e=0;e<t.length;e++)zn(t,e)||(t[e]=null);return t}function br(t){const e=uc(null);for(const r of _8(t)){var n=bQ(r,2);const s=n[0],o=n[1];zn(t,s)&&(Ca(o)?e[s]=OQ(o):o&&typeof o=="object"&&o.constructor===Object?e[s]=br(o):e[s]=o)}return e}function NQ(t){switch(typeof t){case"string":return t;case"number":return TQ(t);case"boolean":return RQ(t);case"bigint":return sP?sP(t):"0";case"symbol":return oP?oP(t):"Symbol()";case"undefined":return Sf(t);case"function":case"object":{if(t===null)return Sf(t);const e=t,n=mo(e,"toString");if(typeof n=="function"){const r=n(e);return typeof r=="string"?r:Sf(r)}return Sf(t)}default:return Sf(t)}}function mo(t,e){for(;t!==null;){const r=wQ(t,e);if(r){if(r.get)return Tn(r.get);if(typeof r.value=="function")return Tn(r.value)}t=CQ(t)}function n(){return null}return n}function MQ(t){try{return Un(t,""),!0}catch{return!1}}const iP=tr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Y1=tr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Z1=tr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),PQ=tr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),X1=tr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),kQ=tr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),aP=tr(["#text"]),lP=tr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Q1=tr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),uP=tr(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),jg=tr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),DQ=rr(/{{[\w\W]*|^[\w\W]*}}/g),LQ=rr(/<%[\w\W]*|^[\w\W]*%>/g),UQ=rr(/\${[\w\W]*/g),FQ=rr(/^data-[\-\w.\u00B7-\uFFFF]+$/),zQ=rr(/^aria-[\-\w]+$/),cP=rr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),BQ=rr(/^(?:\w+script|data):/i),jQ=rr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),HQ=rr(/^html$/i),$Q=rr(/^[a-z][.\w]*(-[.\w]+)+$/i),dP=rr(/<[/\w!]/g),fP=rr(/<[/\w]/g),qQ=rr(/<\/no(script|embed|frames)/i),WQ=rr(/\/>/i),ns={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},GQ=function(){return typeof window>"u"?null:window},VQ=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(r=n.getAttribute(s));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},hP=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},fa=function(e,n,r,s){return zn(e,n)&&Ca(e[n])?mt(s.base?br(s.base):{},e[n],s.transform):r};function A8(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:GQ();const e=pe=>A8(pe);if(e.version="3.4.12",e.removed=[],!t||!t.document||t.document.nodeType!==ns.document||!t.Element)return e.isSupported=!1,e;let n=t.document;const r=n,s=r.currentScript;t.DocumentFragment;const o=t.HTMLTemplateElement,a=t.Node,u=t.Element,c=t.NodeFilter,f=t.NamedNodeMap;f===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const p=t.DOMParser,g=t.trustedTypes,m=u.prototype,y=mo(m,"cloneNode"),S=mo(m,"remove"),E=mo(m,"nextSibling"),C=mo(m,"childNodes"),w=mo(m,"parentNode"),x=mo(m,"shadowRoot"),T=mo(m,"attributes"),R=a&&a.prototype?mo(a.prototype,"nodeType"):null,M=a&&a.prototype?mo(a.prototype,"nodeName"):null;if(typeof o=="function"){const pe=n.createElement("template");pe.content&&pe.content.ownerDocument&&(n=pe.content.ownerDocument)}let O,I="",P,k=!1,H=0;const F=function(){if(H>0)throw vl('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},B=function(U){F(),H++;try{return O.createHTML(U)}finally{H--}},W=function(U){F(),H++;try{return O.createScriptURL(U)}finally{H--}},Y=function(){return k||(P=VQ(g,s),k=!0),P},ne=n,$=ne.implementation,ee=ne.createNodeIterator,fe=ne.createDocumentFragment,de=ne.getElementsByTagName,Ae=r.importNode;let L=hP();e.isSupported=typeof _8=="function"&&typeof w=="function"&&$&&$.createHTMLDocument!==void 0;const V=DQ,K=LQ,J=UQ,oe=FQ,he=zQ,ue=BQ,ve=jQ,_e=$Q;let Xe=cP,Ee=null;const pt=mt({},[...iP,...Y1,...Z1,...X1,...aP]);let Ce=null;const ze=mt({},[...lP,...Q1,...uP,...jg]);let Be=Object.seal(uc(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),He=null,pr=null;const Et=Object.seal(uc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Gr=!0,Wn=!0,_r=!1,to=!0,xr=!1,Gt=!0,gt=!1,vn=!1,Ar=null,no=null,hd=!1,ko=!1,uu=!1,cu=!1,Mi=!0,ir=!1;const Ps="user-content-";let Gn=!0,pd=!1,Pi={},hs=null;const ki=mt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Va=null;const Ka=mt({},["audio","video","img","source","image","track"]);let ks=null;const Ya=mt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ro="http://www.w3.org/1998/Math/MathML",du="http://www.w3.org/2000/svg",Vr="http://www.w3.org/1999/xhtml";let so=Vr,Do=!1,gd=null;const pp=mt({},[ro,du,Vr],K1),md=tr(["mi","mo","mn","ms","mtext"]);let fu=mt({},md);const hu=tr(["annotation-xml"]);let Za=mt({},hu);const gp=mt({},["title","style","font","a","script"]);let Di=null;const oo=["application/xhtml+xml","text/html"],In="text/html";let nt=null,Kr=null;const vd=n.createElement("form"),mp=function(U){return U instanceof RegExp||U instanceof Function},yd=function(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Kr&&Kr===U)return;(!U||typeof U!="object")&&(U={}),U=br(U),Di=oo.indexOf(U.PARSER_MEDIA_TYPE)===-1?In:U.PARSER_MEDIA_TYPE,nt=Di==="application/xhtml+xml"?K1:Hf,Ee=fa(U,"ALLOWED_TAGS",pt,{transform:nt}),Ce=fa(U,"ALLOWED_ATTR",ze,{transform:nt}),gd=fa(U,"ALLOWED_NAMESPACES",pp,{transform:K1}),ks=fa(U,"ADD_URI_SAFE_ATTR",Ya,{transform:nt,base:Ya}),Va=fa(U,"ADD_DATA_URI_TAGS",Ka,{transform:nt,base:Ka}),hs=fa(U,"FORBID_CONTENTS",ki,{transform:nt}),He=fa(U,"FORBID_TAGS",br({}),{transform:nt}),pr=fa(U,"FORBID_ATTR",br({}),{transform:nt}),Pi=zn(U,"USE_PROFILES")?U.USE_PROFILES&&typeof U.USE_PROFILES=="object"?br(U.USE_PROFILES):U.USE_PROFILES:!1,Gr=U.ALLOW_ARIA_ATTR!==!1,Wn=U.ALLOW_DATA_ATTR!==!1,_r=U.ALLOW_UNKNOWN_PROTOCOLS||!1,to=U.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xr=U.SAFE_FOR_TEMPLATES||!1,Gt=U.SAFE_FOR_XML!==!1,gt=U.WHOLE_DOCUMENT||!1,ko=U.RETURN_DOM||!1,uu=U.RETURN_DOM_FRAGMENT||!1,cu=U.RETURN_TRUSTED_TYPE||!1,hd=U.FORCE_BODY||!1,Mi=U.SANITIZE_DOM!==!1,ir=U.SANITIZE_NAMED_PROPS||!1,Gn=U.KEEP_CONTENT!==!1,pd=U.IN_PLACE||!1,Xe=MQ(U.ALLOWED_URI_REGEXP)?U.ALLOWED_URI_REGEXP:cP,so=typeof U.NAMESPACE=="string"?U.NAMESPACE:Vr,fu=zn(U,"MATHML_TEXT_INTEGRATION_POINTS")&&U.MATHML_TEXT_INTEGRATION_POINTS&&typeof U.MATHML_TEXT_INTEGRATION_POINTS=="object"?br(U.MATHML_TEXT_INTEGRATION_POINTS):mt({},md),Za=zn(U,"HTML_INTEGRATION_POINTS")&&U.HTML_INTEGRATION_POINTS&&typeof U.HTML_INTEGRATION_POINTS=="object"?br(U.HTML_INTEGRATION_POINTS):mt({},hu);const Z=zn(U,"CUSTOM_ELEMENT_HANDLING")&&U.CUSTOM_ELEMENT_HANDLING&&typeof U.CUSTOM_ELEMENT_HANDLING=="object"?br(U.CUSTOM_ELEMENT_HANDLING):uc(null);if(Be=uc(null),zn(Z,"tagNameCheck")&&mp(Z.tagNameCheck)&&(Be.tagNameCheck=Z.tagNameCheck),zn(Z,"attributeNameCheck")&&mp(Z.attributeNameCheck)&&(Be.attributeNameCheck=Z.attributeNameCheck),zn(Z,"allowCustomizedBuiltInElements")&&typeof Z.allowCustomizedBuiltInElements=="boolean"&&(Be.allowCustomizedBuiltInElements=Z.allowCustomizedBuiltInElements),rr(Be),xr&&(Wn=!1),uu&&(ko=!0),Pi&&(Ee=mt({},aP),Ce=uc(null),Pi.html===!0&&(mt(Ee,iP),mt(Ce,lP)),Pi.svg===!0&&(mt(Ee,Y1),mt(Ce,Q1),mt(Ce,jg)),Pi.svgFilters===!0&&(mt(Ee,Z1),mt(Ce,Q1),mt(Ce,jg)),Pi.mathMl===!0&&(mt(Ee,X1),mt(Ce,uP),mt(Ce,jg))),Et.tagCheck=null,Et.attributeCheck=null,zn(U,"ADD_TAGS")&&(typeof U.ADD_TAGS=="function"?Et.tagCheck=U.ADD_TAGS:Ca(U.ADD_TAGS)&&(Ee===pt&&(Ee=br(Ee)),mt(Ee,U.ADD_TAGS,nt))),zn(U,"ADD_ATTR")&&(typeof U.ADD_ATTR=="function"?Et.attributeCheck=U.ADD_ATTR:Ca(U.ADD_ATTR)&&(Ce===ze&&(Ce=br(Ce)),mt(Ce,U.ADD_ATTR,nt))),zn(U,"ADD_URI_SAFE_ATTR")&&Ca(U.ADD_URI_SAFE_ATTR)&&mt(ks,U.ADD_URI_SAFE_ATTR,nt),zn(U,"FORBID_CONTENTS")&&Ca(U.FORBID_CONTENTS)&&(hs===ki&&(hs=br(hs)),mt(hs,U.FORBID_CONTENTS,nt)),zn(U,"ADD_FORBID_CONTENTS")&&Ca(U.ADD_FORBID_CONTENTS)&&(hs===ki&&(hs=br(hs)),mt(hs,U.ADD_FORBID_CONTENTS,nt)),Gn&&(Ee["#text"]=!0),gt&&mt(Ee,["html","head","body"]),Ee.table&&(mt(Ee,["tbody"]),delete He.tbody),U.TRUSTED_TYPES_POLICY){if(typeof U.TRUSTED_TYPES_POLICY.createHTML!="function")throw vl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof U.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw vl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ce=O;O=U.TRUSTED_TYPES_POLICY;try{I=B("")}catch(Te){throw O=ce,Te}}else U.TRUSTED_TYPES_POLICY===null?(O=void 0,I=""):(O===void 0&&(O=Y()),O&&typeof I=="string"&&(I=B("")));tr&&tr(U),Kr=U},bd=mt({},[...Y1,...Z1,...PQ]),Li=mt({},[...X1,...kQ]),Sd=function(U,Z,ce){return Z.namespaceURI===Vr?U==="svg":Z.namespaceURI===ro?U==="svg"&&(ce==="annotation-xml"||fu[ce]):!!bd[U]},Ui=function(U,Z,ce){return Z.namespaceURI===Vr?U==="math":Z.namespaceURI===du?U==="math"&&Za[ce]:!!Li[U]},Fi=function(U,Z,ce){return Z.namespaceURI===du&&!Za[ce]||Z.namespaceURI===ro&&!fu[ce]?!1:!Li[U]&&(gp[U]||!bd[U])},Xa=function(U){let Z=w(U);(!Z||!Z.tagName)&&(Z={namespaceURI:so,tagName:"template"});const ce=Hf(U.tagName),Te=Hf(Z.tagName);return gd[U.namespaceURI]?U.namespaceURI===du?Sd(ce,Z,Te):U.namespaceURI===ro?Ui(ce,Z,Te):U.namespaceURI===Vr?Fi(ce,Z,Te):!!(Di==="application/xhtml+xml"&&gd[U.namespaceURI]):!1},gr=function(U){Yu(e.removed,{element:U});try{w(U).removeChild(U)}catch{if(S(U),!w(U))throw vl("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},an=function(U){Ds(U);const Z=C(U);if(Z){const Te=[];Ku(Z,ke=>{Yu(Te,ke)}),Ku(Te,ke=>{try{S(ke)}catch{}})}const ce=T(U);if(ce)for(let Te=ce.length-1;Te>=0;--Te){const ke=ce[Te],Ue=ke&&ke.name;if(typeof Ue=="string")try{U.removeAttribute(Ue)}catch{}}},io=function(U,Z){try{Yu(e.removed,{attribute:Z.getAttributeNode(U),from:Z})}catch{Yu(e.removed,{attribute:null,from:Z})}if(Z.removeAttribute(U),U==="is")if(ko||uu)try{gr(Z)}catch{}else try{Z.setAttribute(U,"")}catch{}},vp=function(U){const Z=T(U);if(Z)for(let ce=Z.length-1;ce>=0;--ce){const Te=Z[ce],ke=Te&&Te.name;if(!(typeof ke!="string"||Ce[nt(ke)]))try{U.removeAttribute(ke)}catch{}}},Ds=function(U){const Z=[U];for(;Z.length>0;){const ce=Z.pop();(R?R(ce):ce.nodeType)===ns.element&&vp(ce);const ke=C(ce);if(ke)for(let Ue=ke.length-1;Ue>=0;--Ue)Z.push(ke[Ue])}},zi=function(U){if(!Gt)return;const Z=[U];for(;Z.length>0;){const ce=Z.pop(),Te=R?R(ce):ce.nodeType;if(Te===ns.processingInstruction||Te===ns.comment&&Un(fP,ce.data)){try{S(ce)}catch{}continue}if(Te===ns.element){const Ue=ce,en=nt(M?M(ce):ce.nodeName);try{Ue.hasAttribute&&Ue.hasAttribute("patchsrc")&&Ue.removeAttribute("patchsrc"),Ue.hasAttribute&&Ue.hasAttribute("for")&&en!=="label"&&en!=="output"&&Ue.removeAttribute("for")}catch{}}const ke=C(ce);if(ke)for(let Ue=ke.length-1;Ue>=0;--Ue)Z.push(ke[Ue])}},yp=function(U){let Z=null,ce=null;if(hd)U="<remove></remove>"+U;else{const Ue=nP(U,/^[\r\n\t ]+/);ce=Ue&&Ue[0]}Di==="application/xhtml+xml"&&so===Vr&&(U='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+U+"</body></html>");const Te=O?B(U):U;if(so===Vr)try{Z=new p().parseFromString(Te,Di)}catch{}if(!Z||!Z.documentElement){Z=$.createDocument(so,"template",null);try{Z.documentElement.innerHTML=Do?I:Te}catch{}}const ke=Z.body||Z.documentElement;return U&&ce&&ke.insertBefore(n.createTextNode(ce),ke.childNodes[0]||null),so===Vr?de.call(Z,gt?"html":"body")[0]:gt?Z.documentElement:ke},Ed=function(U){return ee.call(U.ownerDocument||U,U,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Qa=function(U){return U=bf(U,V," "),U=bf(U,K," "),U=bf(U,J," "),U},Cd=function(U){var Z;U.normalize();const ce=ee.call(U.ownerDocument||U,U,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let Te=ce.nextNode();for(;Te;)Te.data=Qa(Te.data),Te=ce.nextNode();const ke=(Z=U.querySelectorAll)===null||Z===void 0?void 0:Z.call(U,"template");ke&&Ku(ke,Ue=>{Ls(Ue.content)&&Cd(Ue.content)})},Lo=function(U){const Z=M?M(U):null;return typeof Z!="string"||nt(Z)!=="form"?!1:typeof U.nodeName!="string"||typeof U.textContent!="string"||typeof U.removeChild!="function"||U.attributes!==T(U)||typeof U.removeAttribute!="function"||typeof U.setAttribute!="function"||typeof U.namespaceURI!="string"||typeof U.insertBefore!="function"||typeof U.hasChildNodes!="function"||U.nodeType!==R(U)||U.childNodes!==C(U)},Ls=function(U){if(!R||typeof U!="object"||U===null)return!1;try{return R(U)===ns.documentFragment}catch{return!1}},mr=function(U){if(!R||typeof U!="object"||U===null)return!1;try{return typeof R(U)=="number"}catch{return!1}};function ln(pe,U,Z){pe.length!==0&&Ku(pe,ce=>{ce.call(e,U,Z,Kr)})}const bp=function(U,Z){return!!(Gt&&U.hasChildNodes()&&!mr(U.firstElementChild)&&Un(dP,U.textContent)&&Un(dP,U.innerHTML)||Gt&&U.namespaceURI===Vr&&Z==="style"&&mr(U.firstElementChild)||U.nodeType===ns.processingInstruction||Gt&&U.nodeType===ns.comment&&Un(fP,U.data))},xb=function(U,Z){if(!He[Z]&&Sp(Z)&&(Be.tagNameCheck instanceof RegExp&&Un(Be.tagNameCheck,Z)||Be.tagNameCheck instanceof Function&&Be.tagNameCheck(Z)))return!1;if(Gn&&!hs[Z]){const ce=w(U),Te=C(U);if(Te&&ce){const ke=Te.length;for(let Ue=ke-1;Ue>=0;--Ue){const en=pd?Te[Ue]:y(Te[Ue],!0);ce.insertBefore(en,E(U))}}}return gr(U),!0},pu=function(U,Z){if(ln(L.beforeSanitizeElements,U,null),U!==Z&&w(U)===null)return!0;if(Lo(U))return gr(U),!0;const ce=nt(M?M(U):U.nodeName);if(ln(L.uponSanitizeElement,U,{tagName:ce,allowedTags:Ee}),U!==Z&&w(U)===null)return!0;if(bp(U,ce))return gr(U),!0;if(He[ce]||!(Et.tagCheck instanceof Function&&Et.tagCheck(ce))&&!Ee[ce]){const ke=xb(U,ce);return ke===!1&&ln(L.afterSanitizeElements,U,null),ke}if((R?R(U):U.nodeType)===ns.element&&!Xa(U)||(ce==="noscript"||ce==="noembed"||ce==="noframes")&&Un(qQ,U.innerHTML))return gr(U),!0;if(xr&&U.nodeType===ns.text){const ke=Qa(U.textContent);U.textContent!==ke&&(Yu(e.removed,{element:U.cloneNode()}),U.textContent=ke)}return ln(L.afterSanitizeElements,U,null),!1},wd=function(U,Z,ce){if(pr[Z]||Gt&&Z==="patchsrc"||Gt&&Z==="for"&&U!=="label"&&U!=="output"||Mi&&(Z==="id"||Z==="name")&&(ce in n||ce in vd))return!1;const Te=Ce[Z]||Et.attributeCheck instanceof Function&&Et.attributeCheck(Z,U);if(!(Wn&&Un(oe,Z))){if(!(Gr&&Un(he,Z))){if(Te){if(!ks[Z]){if(!Un(Xe,bf(ce,ve,""))){if(!((Z==="src"||Z==="xlink:href"||Z==="href")&&U!=="script"&&rP(ce,"data:")===0&&Va[U])){if(!(_r&&!Un(ue,bf(ce,ve,"")))){if(ce)return!1}}}}}else if(!(Sp(U)&&(Be.tagNameCheck instanceof RegExp&&Un(Be.tagNameCheck,U)||Be.tagNameCheck instanceof Function&&Be.tagNameCheck(U))&&(Be.attributeNameCheck instanceof RegExp&&Un(Be.attributeNameCheck,Z)||Be.attributeNameCheck instanceof Function&&Be.attributeNameCheck(Z,U))||Z==="is"&&Be.allowCustomizedBuiltInElements&&(Be.tagNameCheck instanceof RegExp&&Un(Be.tagNameCheck,ce)||Be.tagNameCheck instanceof Function&&Be.tagNameCheck(ce))))return!1}}return!0},gu=mt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Sp=function(U){return!gu[Hf(U)]&&Un(_e,U)},Tr=function(U,Z,ce,Te){if(O&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!ce)switch(g.getAttributeType(U,Z)){case"TrustedHTML":return B(Te);case"TrustedScriptURL":return W(Te)}return Te},_d=function(U,Z,ce,Te){try{ce?U.setAttributeNS(ce,Z,Te):U.setAttribute(Z,Te),Lo(U)?gr(U):tP(e.removed)}catch{io(Z,U)}},xd=function(U){ln(L.beforeSanitizeAttributes,U,null);const Z=U.attributes;if(!Z||Lo(U))return;const ce={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ce,forceKeepAttr:void 0};let Te=Z.length;const ke=nt(U.nodeName);for(;Te--;){const Ue=Z[Te],en=Ue.name,Dn=Ue.namespaceURI,ar=Ue.value,tn=nt(en),vr=ar;let On=en==="value"?vr:AQ(vr);if(ce.attrName=tn,ce.attrValue=On,ce.keepAttr=!0,ce.forceKeepAttr=void 0,ln(L.uponSanitizeAttribute,U,ce),On=ce.attrValue,ir&&(tn==="id"||tn==="name")&&rP(On,Ps)!==0&&(io(en,U),On=Ps+On),Gt&&Un(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,On)){io(en,U);continue}if(tn==="attributename"&&nP(On,"href")){io(en,U);continue}if(!ce.forceKeepAttr){if(!ce.keepAttr){io(en,U);continue}if(!to&&Un(WQ,On)){io(en,U);continue}if(xr&&(On=Qa(On)),!wd(ke,tn,On)){io(en,U);continue}On=Tr(ke,tn,Dn,On),On!==vr&&_d(U,en,Dn,On)}}ln(L.afterSanitizeAttributes,U,null)},Bi=function(U){let Z=null;const ce=Ed(U);for(ln(L.beforeSanitizeShadowDOM,U,null);Z=ce.nextNode();)if(ln(L.uponSanitizeShadowNode,Z,null),pu(Z,U),xd(Z),Ls(Z.content)&&Bi(Z.content),(R?R(Z):Z.nodeType)===ns.element){const ke=x(Z);Ls(ke)&&(ao(ke),Bi(ke))}ln(L.afterSanitizeShadowDOM,U,null)},ao=function(U){const Z=[{node:U,shadow:null}];for(;Z.length>0;){const ce=Z.pop();if(ce.shadow){Bi(ce.shadow);continue}const Te=ce.node,Ue=(R?R(Te):Te.nodeType)===ns.element,en=C(Te);if(en)for(let Dn=en.length-1;Dn>=0;--Dn)Z.push({node:en[Dn],shadow:null});if(Ue){const Dn=M?M(Te):null;if(typeof Dn=="string"&&nt(Dn)==="template"){const ar=Te.content;Ls(ar)&&Z.push({node:ar,shadow:null})}}if(Ue){const Dn=x(Te);Ls(Dn)&&Z.push({node:null,shadow:Dn},{node:Dn,shadow:null})}}};return e.sanitize=function(pe){let U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z=null,ce=null,Te=null,ke=null;if(Do=!pe,Do&&(pe="<!-->"),typeof pe!="string"&&!mr(pe)&&(pe=NQ(pe),typeof pe!="string"))throw vl("dirty is not a string, aborting");if(!e.isSupported)return pe;vn?(Ee=Ar,Ce=no):yd(U),(L.uponSanitizeElement.length>0||L.uponSanitizeAttribute.length>0)&&(Ee=br(Ee)),L.uponSanitizeAttribute.length>0&&(Ce=br(Ce)),e.removed=[];const Ue=pd&&typeof pe!="string"&&mr(pe);if(Ue){zi(pe);const tn=M?M(pe):pe.nodeName;if(typeof tn=="string"){const vr=nt(tn);if(!Ee[vr]||He[vr])throw an(pe),vl("root node is forbidden and cannot be sanitized in-place")}if(Lo(pe))throw an(pe),vl("root node is clobbered and cannot be sanitized in-place");try{ao(pe)}catch(vr){throw an(pe),vr}}else if(mr(pe))Z=yp("<!---->"),ce=Z.ownerDocument.importNode(pe,!0),ce.nodeType===ns.element&&ce.nodeName==="BODY"||ce.nodeName==="HTML"?Z=ce:Z.appendChild(ce),ao(ce);else{if(!ko&&!xr&&!gt&&pe.indexOf("<")===-1)return O&&cu?B(pe):pe;if(Z=yp(pe),!Z)return ko?null:cu?I:""}Z&&hd&&gr(Z.firstChild);const en=Ue?pe:Z,Dn=Ed(en);try{for(;Te=Dn.nextNode();)pu(Te,en),xd(Te),Ls(Te.content)&&Bi(Te.content)}catch(tn){throw Ue&&(an(pe),Ku(e.removed,vr=>{vr.element&&Ds(vr.element)})),tn}if(Ue)return Ku(e.removed,tn=>{tn.element&&Ds(tn.element)}),xr&&Cd(pe),pe;if(ko){if(xr&&Cd(Z),uu)for(ke=fe.call(Z.ownerDocument);Z.firstChild;)ke.appendChild(Z.firstChild);else ke=Z;return(Ce.shadowroot||Ce.shadowrootmode)&&(ke=Ae.call(r,ke,!0)),ke}let ar=gt?Z.outerHTML:Z.innerHTML;return gt&&Ee["!doctype"]&&Z.ownerDocument&&Z.ownerDocument.doctype&&Z.ownerDocument.doctype.name&&Un(HQ,Z.ownerDocument.doctype.name)&&(ar="<!DOCTYPE "+Z.ownerDocument.doctype.name+`>
|
|
14
14
|
`+ar),xr&&(ar=Qa(ar)),O&&cu?B(ar):ar},e.setConfig=function(){let pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yd(pe),vn=!0,Ar=Ee,no=Ce},e.clearConfig=function(){Kr=null,vn=!1,Ar=null,no=null,O=P,I=""},e.isValidAttribute=function(pe,U,Z){Kr||yd({});const ce=nt(pe),Te=nt(U);return wd(ce,Te,Z)},e.addHook=function(pe,U){typeof U=="function"&&zn(L,pe)&&Yu(L[pe],U)},e.removeHook=function(pe,U){if(zn(L,pe)){if(U!==void 0){const Z=_Q(L[pe],U);return Z===-1?void 0:xQ(L[pe],Z,1)[0]}return tP(L[pe])}},e.removeHooks=function(pe){zn(L,pe)&&(L[pe]=[])},e.removeAllHooks=function(){L=hP()},e}var Cxe=A8();function T8({children:t,className:e}){return D.jsx("div",{"data-auth-page":!0,className:dn("flex min-h-dvh w-full flex-col items-center justify-center overflow-y-auto bg-surface-sunken px-4 py-8 text-fg",e),style:{backgroundImage:"radial-gradient(at 20% 0%, color-mix(in oklch, var(--accent) 8%, transparent) 0px, transparent 50%), radial-gradient(at 80% 100%, color-mix(in oklch, var(--accent) 8%, transparent) 0px, transparent 50%)"},children:D.jsx("div",{className:"w-full max-w-[26rem]",children:t})})}const KQ="Secure sign-in powered by AWS Cognito";function R8(t){const e=t?.note??"Secure sign-in";return D.jsx("div",{className:"text-center pt-5",children:D.jsx("p",{className:"text-xs text-fg-muted",children:e})})}const YQ=()=>D.jsxs("svg",{width:"36",height:"36",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:"text-accent",children:[D.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),D.jsx("path",{d:"M3 7l9 6 9-6"})]});function I8({wordmark:t="remit,",tagline:e="your email client in the cloud.",mark:n=D.jsx(YQ,{})}){return D.jsxs("div",{className:"text-center pb-6",children:[D.jsx("div",{className:"flex items-center justify-center pb-3",children:n}),D.jsx("h1",{className:"text-[1.75rem] font-semibold tracking-[-0.01em] text-fg",children:t}),D.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:e})]})}const ZQ={info:"bg-accent-2/15 text-accent-2 border-accent-2/40",success:"bg-positive/15 text-positive border-positive/40",warning:"bg-warning/15 text-warning border-warning/40",danger:"bg-danger/15 text-danger border-danger/40"},XQ={info:"bg-surface-sunken text-fg-muted",success:"bg-positive/10 text-positive",warning:"bg-warning/10 text-warning",danger:"bg-danger-soft text-danger"},QQ={info:"status",success:"status",warning:"alert",danger:"alert"};function F_({tone:t="info",variant:e="framed",onDismiss:n,role:r,className:s,children:o,...a}){const u=e==="soft";return D.jsxs("div",{role:r??QQ[t],className:dn("flex gap-2 px-3 py-2 text-sm",u?dn("items-start rounded-md",XQ[t]):dn("items-center border",ZQ[t]),s),...a,children:[D.jsx("div",{className:"flex-1 min-w-0",children:o}),n&&(u?D.jsx(Gm,{variant:"ghost",size:"sm",icon:D.jsx(ph,{className:"size-3.5"}),onClick:n,"aria-label":"Dismiss",className:"-mr-1 shrink-0"}):D.jsx("button",{type:"button",onClick:n,"aria-label":"Dismiss",className:"shrink-0 rounded-md p-1 hover:bg-fg/10 transition-colors",children:D.jsx(ph,{className:"size-4","aria-hidden":"true"})}))]})}const O8={filter:"border-line bg-surface-sunken text-fg-muted",scope:"border-accent-2/40 bg-accent-2-soft text-accent-2"},JQ=({label:t,onRemove:e,tone:n="filter",className:r})=>D.jsxs("span",{className:dn("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-2xs",O8[n],r),children:[D.jsx("span",{children:t}),D.jsx("button",{type:"button",onClick:e,className:"shrink-0 rounded-full p-0.5 hover:bg-fg-muted/20 transition-colors","aria-label":`Remove filter: ${t}`,children:D.jsx(ph,{className:"size-3"})})]}),eJ=A.forwardRef(({label:t,onRemove:e,onActivate:n,tone:r="filter",focused:s=!1,onKeyDown:o,onFocusLabel:a,className:u},c)=>D.jsxs("span",{role:"row",tabIndex:-1,className:dn("inline-flex max-w-48 items-center gap-1 rounded-full border px-2 py-0.5 text-2xs transition-colors",O8[r],s&&"ring-2 ring-ring",u),children:[D.jsx("button",{ref:c,type:"button",role:"gridcell",tabIndex:s?0:-1,onClick:n,onFocus:a,onKeyDown:o,className:dn("block min-w-0 max-w-full truncate rounded-full outline-none",n?"cursor-pointer":"cursor-default"),children:t}),D.jsx("button",{type:"button",role:"gridcell",tabIndex:-1,onClick:e,className:"block shrink-0 rounded-full p-0.5 transition-colors hover:bg-fg-muted/20","aria-label":`Remove filter: ${t}`,children:D.jsx(ph,{className:"size-3"})})]}));eJ.displayName="SearchChipRow";const wxe=({tokens:t,className:e})=>t.length===0?null:D.jsx("div",{className:dn("flex flex-wrap items-center gap-1.5 border-b border-line bg-surface px-row-inset py-1.5",e),children:t.map(n=>D.jsx(JQ,{label:n.label,onRemove:n.onRemove},n.label))});var vh;(function(t){t[t.UP=-1]="UP",t[t.DOWN=1]="DOWN"})(vh||(vh={}));function tJ(t){var e=getComputedStyle(t).overflowY;return t===document.scrollingElement&&e==="visible"?!0:!(e!=="scroll"&&e!=="auto")}function nJ(t,e){if(!tJ(t))return!1;if(e===vh.DOWN){var n=t.scrollTop+t.clientHeight;return n<t.scrollHeight}if(e===vh.UP)return t.scrollTop>0;throw new Error("unsupported direction")}function N8(t,e){return nJ(t,e)?!0:t.parentElement==null?!1:N8(t.parentElement,e)}function M8(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(!t||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",n==="top"&&r.firstChild?r.insertBefore(s,r.firstChild):r.appendChild(s),s.styleSheet?s.styleSheet.cssText=t:s.appendChild(document.createTextNode(t))}}var rJ=`.lds-ellipsis {
|
|
15
15
|
display: inline-block;
|
|
@@ -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
|
-
}`;M8(iJ);var _xe=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?z.createElement(sJ,null):u,f=t.pullingContent,p=f===void 0?z.createElement(oJ,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,x=t.resistance,T=x===void 0?1:x,R=t.backgroundColor,M=t.className,O=M===void 0?"":M,I=A.useRef(null),P=A.useRef(null),k=A.useRef(null),H=A.useRef(null),F=!1,B=!1,W=!1,Y=0,ne=0;A.useEffect(function(){if(!(!n||!P||!P.current)){var V=P.current;return V.addEventListener("touchstart",fe,{passive:!0}),V.addEventListener("mousedown",fe),V.addEventListener("touchmove",de,{passive:!1}),V.addEventListener("mousemove",de),window.addEventListener("scroll",Ae),V.addEventListener("touchend",L),V.addEventListener("mouseup",L),document.body.addEventListener("mouseleave",L),function(){V.removeEventListener("touchstart",fe),V.removeEventListener("mousedown",fe),V.removeEventListener("touchmove",de),V.removeEventListener("mousemove",de),window.removeEventListener("scroll",Ae),V.removeEventListener("touchend",L),V.removeEventListener("mouseup",L),document.body.removeEventListener("mouseleave",L)}}},[g,n,o,y,w,s,E]),A.useEffect(function(){var V;if(!((V=I)===null||V===void 0)&&V.current){var K=I.current.classList.contains("ptr--fetch-more-treshold-breached");K||s&&$()<E&&a&&(I.current.classList.add("ptr--fetch-more-treshold-breached"),B=!0,a().then(ee).catch(ee))}},[s,g]);var $=function(){if(!P||!P.current)return-1;var V=window.scrollY,K=P.current.scrollHeight;return K-V-window.innerHeight},ee=function(){requestAnimationFrame(function(){P.current&&(P.current.style.overflowX="hidden",P.current.style.overflowY="auto",P.current.style.transform="unset"),k.current&&(k.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")),F&&(F=!1),B&&(B=!1)})},fe=function(V){W=!1,V instanceof MouseEvent&&(Y=V.pageY),window.TouchEvent&&V instanceof TouchEvent&&(Y=V.touches[0].pageY),ne=Y,!(V.type==="touchstart"&&N8(V.target,vh.UP))&&(P.current.getBoundingClientRect().top<0||(W=!0))},de=function(V){if(W){if(window.TouchEvent&&V instanceof TouchEvent?ne=V.touches[0].pageY:ne=V.pageY,I.current.classList.add("ptr--dragging"),ne<Y){W=!1;return}V.cancelable&&V.preventDefault();var K=Math.min((ne-Y)/T,w);K>=y&&(W=!0,F=!0,I.current.classList.remove("ptr--dragging"),I.current.classList.add("ptr--pull-down-treshold-breached")),!(K>=w)&&(k.current.style.opacity=(K/65).toString(),P.current.style.overflow="visible",P.current.style.transform="translate(0px, "+K+"px)",k.current.style.visibility="visible")}},Ae=function(V){B||s&&$()<E&&a&&(B=!0,I.current.classList.add("ptr--fetch-more-treshold-breached"),a().then(ee).catch(ee))},L=function(){if(W=!1,Y=0,ne=0,!F){k.current&&(k.current.style.visibility="hidden"),ee();return}P.current&&(P.current.style.overflow="visible",P.current.style.transform="translate(0px, "+y+"px)"),o().then(ee).catch(ee)};return z.createElement("div",{className:"ptr "+O,style:{backgroundColor:R},ref:I},z.createElement("div",{className:"ptr__pull-down",ref:k},z.createElement("div",{className:"ptr__loader ptr__pull-down--loading"},c),z.createElement("div",{className:"ptr__pull-down--pull-more"},p)),z.createElement("div",{className:"ptr__children",ref:P},g,z.createElement("div",{className:"ptr__fetch-more",ref:H},z.createElement("div",{className:"ptr__loader ptr__fetch-more--loading"},c))))};const aJ=()=>D.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:[D.jsx("div",{className:"mb-3 h-6 w-24 rounded bg-surface-sunken"}),Array.from({length:6}).map((t,e)=>D.jsxs("div",{className:"flex items-center gap-2 py-1.5",children:[D.jsx("div",{className:"size-5 shrink-0 rounded bg-surface-sunken"}),D.jsx("div",{className:"h-3.5 flex-1 rounded bg-surface-sunken"})]},e))]}),lJ=()=>D.jsx("div",{className:"min-w-0 flex-1",children:Array.from({length:8}).map((t,e)=>D.jsxs("div",{className:"flex items-start gap-3 border-b border-line py-2 pl-5 pr-4",children:[D.jsx("div",{className:"mt-0.5 size-7 shrink-0 rounded-full bg-surface-sunken"}),D.jsxs("div",{className:"flex-1 space-y-1.5",children:[D.jsxs("div",{className:"flex justify-between gap-2",children:[D.jsx("div",{className:"h-3.5 w-28 rounded bg-surface-sunken"}),D.jsx("div",{className:"h-3 w-12 rounded bg-surface-sunken"})]}),D.jsx("div",{className:"h-3.5 w-48 rounded bg-surface-sunken"}),D.jsx("div",{className:"h-3 w-full rounded bg-surface-sunken"})]})]},e))}),HA=()=>D.jsxs("div",{className:"flex h-dvh animate-pulse bg-canvas","aria-hidden":"true",children:[D.jsx(aJ,{}),D.jsx(lJ,{})]}),$A="
|
|
148
|
+
}`;M8(iJ);var _xe=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?z.createElement(sJ,null):u,f=t.pullingContent,p=f===void 0?z.createElement(oJ,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,x=t.resistance,T=x===void 0?1:x,R=t.backgroundColor,M=t.className,O=M===void 0?"":M,I=A.useRef(null),P=A.useRef(null),k=A.useRef(null),H=A.useRef(null),F=!1,B=!1,W=!1,Y=0,ne=0;A.useEffect(function(){if(!(!n||!P||!P.current)){var V=P.current;return V.addEventListener("touchstart",fe,{passive:!0}),V.addEventListener("mousedown",fe),V.addEventListener("touchmove",de,{passive:!1}),V.addEventListener("mousemove",de),window.addEventListener("scroll",Ae),V.addEventListener("touchend",L),V.addEventListener("mouseup",L),document.body.addEventListener("mouseleave",L),function(){V.removeEventListener("touchstart",fe),V.removeEventListener("mousedown",fe),V.removeEventListener("touchmove",de),V.removeEventListener("mousemove",de),window.removeEventListener("scroll",Ae),V.removeEventListener("touchend",L),V.removeEventListener("mouseup",L),document.body.removeEventListener("mouseleave",L)}}},[g,n,o,y,w,s,E]),A.useEffect(function(){var V;if(!((V=I)===null||V===void 0)&&V.current){var K=I.current.classList.contains("ptr--fetch-more-treshold-breached");K||s&&$()<E&&a&&(I.current.classList.add("ptr--fetch-more-treshold-breached"),B=!0,a().then(ee).catch(ee))}},[s,g]);var $=function(){if(!P||!P.current)return-1;var V=window.scrollY,K=P.current.scrollHeight;return K-V-window.innerHeight},ee=function(){requestAnimationFrame(function(){P.current&&(P.current.style.overflowX="hidden",P.current.style.overflowY="auto",P.current.style.transform="unset"),k.current&&(k.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")),F&&(F=!1),B&&(B=!1)})},fe=function(V){W=!1,V instanceof MouseEvent&&(Y=V.pageY),window.TouchEvent&&V instanceof TouchEvent&&(Y=V.touches[0].pageY),ne=Y,!(V.type==="touchstart"&&N8(V.target,vh.UP))&&(P.current.getBoundingClientRect().top<0||(W=!0))},de=function(V){if(W){if(window.TouchEvent&&V instanceof TouchEvent?ne=V.touches[0].pageY:ne=V.pageY,I.current.classList.add("ptr--dragging"),ne<Y){W=!1;return}V.cancelable&&V.preventDefault();var K=Math.min((ne-Y)/T,w);K>=y&&(W=!0,F=!0,I.current.classList.remove("ptr--dragging"),I.current.classList.add("ptr--pull-down-treshold-breached")),!(K>=w)&&(k.current.style.opacity=(K/65).toString(),P.current.style.overflow="visible",P.current.style.transform="translate(0px, "+K+"px)",k.current.style.visibility="visible")}},Ae=function(V){B||s&&$()<E&&a&&(B=!0,I.current.classList.add("ptr--fetch-more-treshold-breached"),a().then(ee).catch(ee))},L=function(){if(W=!1,Y=0,ne=0,!F){k.current&&(k.current.style.visibility="hidden"),ee();return}P.current&&(P.current.style.overflow="visible",P.current.style.transform="translate(0px, "+y+"px)"),o().then(ee).catch(ee)};return z.createElement("div",{className:"ptr "+O,style:{backgroundColor:R},ref:I},z.createElement("div",{className:"ptr__pull-down",ref:k},z.createElement("div",{className:"ptr__loader ptr__pull-down--loading"},c),z.createElement("div",{className:"ptr__pull-down--pull-more"},p)),z.createElement("div",{className:"ptr__children",ref:P},g,z.createElement("div",{className:"ptr__fetch-more",ref:H},z.createElement("div",{className:"ptr__loader ptr__fetch-more--loading"},c))))};const aJ=()=>D.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:[D.jsx("div",{className:"mb-3 h-6 w-24 rounded bg-surface-sunken"}),Array.from({length:6}).map((t,e)=>D.jsxs("div",{className:"flex items-center gap-2 py-1.5",children:[D.jsx("div",{className:"size-5 shrink-0 rounded bg-surface-sunken"}),D.jsx("div",{className:"h-3.5 flex-1 rounded bg-surface-sunken"})]},e))]}),lJ=()=>D.jsx("div",{className:"min-w-0 flex-1",children:Array.from({length:8}).map((t,e)=>D.jsxs("div",{className:"flex items-start gap-3 border-b border-line py-2 pl-5 pr-4",children:[D.jsx("div",{className:"mt-0.5 size-7 shrink-0 rounded-full bg-surface-sunken"}),D.jsxs("div",{className:"flex-1 space-y-1.5",children:[D.jsxs("div",{className:"flex justify-between gap-2",children:[D.jsx("div",{className:"h-3.5 w-28 rounded bg-surface-sunken"}),D.jsx("div",{className:"h-3 w-12 rounded bg-surface-sunken"})]}),D.jsx("div",{className:"h-3.5 w-48 rounded bg-surface-sunken"}),D.jsx("div",{className:"h-3 w-full rounded bg-surface-sunken"})]})]},e))}),HA=()=>D.jsxs("div",{className:"flex h-dvh animate-pulse bg-canvas","aria-hidden":"true",children:[D.jsx(aJ,{}),D.jsx(lJ,{})]}),$A="eb659aa84af9c6eb806d2c6beb61c36deb025d71",uJ="2026-07-20T00:02:16.589Z",cJ=$A.slice(0,7),xxe=`https://github.com/remit-mail/reader/commit/${$A}`,dJ="https://github.com/remit-mail/reader/issues/new";class z_ extends Error{constructor(e,n,r){super(e),this.status=n,this.body=r,this.name="ApiError"}status;body}const ad=t=>{if(t instanceof z_)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}},fJ=t=>ad(t)!==void 0,qA=t=>{const e=ad(t);return e!==void 0&&e>=500&&e<=599},WA=t=>!!(typeof DOMException<"u"&&t instanceof DOMException&&t.name==="AbortError"||t&&typeof t=="object"&&"name"in t&&t.name==="AbortError"),hJ=t=>!WA(t)&&!fJ(t),pJ=t=>t?.softError===!0,P8=(t,e)=>qA(t)?!0:!(WA(t)||hJ(t)||pJ(e)),gJ=t=>qA(t),B_=new Set;let k8=null,D8=null;const mJ=t=>{D8=t},vJ=t=>t instanceof Error?t:new Error(L8(t)),L8=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.",yJ=()=>typeof globalThis.crypto<"u"&&typeof globalThis.crypto.randomUUID=="function"?globalThis.crypto.randomUUID():`fatal-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,kc=(t,e)=>{const n={error:t,message:L8(t),correlationId:yJ(),at:Date.now(),recoverable:e?.recoverable??gJ(t),stack:t instanceof Error?t.stack:void 0,componentStack:e?.componentStack};k8=n,_J(`Fatal: ${n.message} [${n.correlationId}]`),D8?.recordError(vJ(t),{fatal:"true",correlationId:n.correlationId});for(const r of B_)r(n);return n},bJ=t=>(B_.add(t),()=>{B_.delete(t)}),SJ=()=>k8,EJ=20,Vm=[],CJ=new Set(["ResizeObserver loop limit exceeded","ResizeObserver loop completed with undelivered notifications"]);function wJ(t){return typeof t!="string"?!1:CJ.has(t.replace(/\.\s*$/,""))}function Km(t){Vm.push(t),Vm.length>EJ&&Vm.shift()}function _J(t){Km(t)}function xJ(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 AJ(){const t=console.error.bind(console);console.error=(...e)=>{Km(xJ(e)),t(...e)},window.addEventListener("error",e=>{wJ(e.message)||(Km(`Uncaught ${e.error instanceof Error?`${e.error.name}: ${e.error.message}`:String(e.message)} (${e.filename}:${e.lineno})`),kc(e.error??e.message))}),window.addEventListener("unhandledrejection",e=>{const n=e.reason,r=n instanceof Error?`${n.name}: ${n.message}`:String(n);Km(`Unhandled rejection: ${r}`),kc(n)})}function TJ(){return Vm.slice()}const pP=7500,gP=`
|
|
149
149
|
… (truncated — use “Copy full details” for the full stacktrace)`;function mP(t){return{appSha:$A,appShortSha:cJ,appBuildTime:uJ,userAgent:navigator.userAgent,viewport:`${window.innerWidth}×${window.innerHeight}`,timestamp:new Date().toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,href:window.location.href,recentErrors:TJ(),errorMessage:t?.errorMessage,stack:t?.stack,componentStack:t?.componentStack}}function vP(t){return["```",t,"```"].join(`
|
|
150
150
|
`)}function U8(t,e){const n=t.recentErrors.length>0?t.recentErrors.map(o=>` - ${o}`).join(`
|
|
151
151
|
`):" (none)",r=["## Environment",`- **Version**: [\`${t.appShortSha}\`](https://github.com/remit-mail/reader/commit/${t.appSha}) built ${t.appBuildTime}`,`- **Browser**: ${t.userAgent}`,`- **Viewport**: ${t.viewport}`,`- **Time**: ${t.timestamp} (${t.timezone})`,"","## URL",t.href,""];t.errorMessage&&r.push("## Error",t.errorMessage,"");const s=e??t.stack;return s&&r.push("## Stacktrace",vP(s),""),t.componentStack&&r.push("## Component stack",vP(t.componentStack),""),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`),Bv.LANG&&Bv.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 UR().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=k1e;Lt.parse=z1e;Lt.fromJSON=D1e;Lt.list=B1e;Lt.comment=t=>new _B(t);Lt.atRule=t=>new xB(t);Lt.decl=t=>new CB(t);Lt.rule=t=>new AB(t);Lt.root=t=>new TB(t);Lt.document=t=>new wB(t);Lt.CssSyntaxError=N1e;Lt.Declaration=CB;Lt.Container=P1e;Lt.Processor=UR;Lt.Document=wB;Lt.Comment=_B;Lt.Warning=L1e;Lt.AtRule=xB;Lt.Result=U1e;Lt.Input=F1e;Lt.Rule=AB;Lt.Root=TB;Lt.Node=j1e;M1e.registerPostcss(Lt);var H1e=Lt;Lt.default=Lt;const on=t0e(H1e);on.stringify;on.fromJSON;on.plugin;on.parse;on.list;on.document;on.comment;on.atRule;on.rule;on.decl;on.root;on.CssSyntaxError;on.Declaration;on.Container;on.Processor;on.Document;on.Comment;on.Warning;on.AtRule;on.Result;on.Input;on.Rule;on.Root;on.Node;class FR{constructor(...e){Cs(this,"parentElement",null),Cs(this,"parentNode",null),Cs(this,"ownerDocument"),Cs(this,"firstChild",null),Cs(this,"lastChild",null),Cs(this,"previousSibling",null),Cs(this,"nextSibling",null),Cs(this,"ELEMENT_NODE",1),Cs(this,"TEXT_NODE",3),Cs(this,"nodeType"),Cs(this,"nodeName"),Cs(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 FR){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 x4={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},A4={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Om={},$1e=()=>!!globalThis.Zone;function zR(t){if(Om[t])return Om[t];const e=globalThis[t],n=e.prototype,r=t in x4?x4[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 A4?A4[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&&!$1e())return Om[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?Om[t]=f:n}catch{return n}}const d_={};function Oi(t,e,n){var r;const s=`${t}.${String(n)}`;if(d_[s])return d_[s].call(e);const o=zR(t),a=(r=Object.getOwnPropertyDescriptor(o,n))==null?void 0:r.get;return a?(d_[s]=a,a.call(e)):e[n]}const f_={};function RB(t,e,n){const r=`${t}.${String(n)}`;if(f_[r])return f_[r].bind(e);const o=zR(t)[n];return typeof o!="function"?e[n]:(f_[r]=o,o.bind(e))}function q1e(t){return Oi("Node",t,"ownerDocument")}function W1e(t){return Oi("Node",t,"childNodes")}function G1e(t){return Oi("Node",t,"parentNode")}function V1e(t){return Oi("Node",t,"parentElement")}function K1e(t){return Oi("Node",t,"textContent")}function Y1e(t,e){return RB("Node",t,"contains")(e)}function Z1e(t){return RB("Node",t,"getRootNode")()}function X1e(t){return!t||!("host"in t)?null:Oi("ShadowRoot",t,"host")}function Q1e(t){return t.styleSheets}function J1e(t){return!t||!("shadowRoot"in t)?null:Oi("Element",t,"shadowRoot")}function eSe(t,e){return Oi("Element",t,"querySelector")(e)}function tSe(t,e){return Oi("Element",t,"querySelectorAll")(e)}function IB(){return zR("MutationObserver").constructor}function lu(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:q1e,childNodes:W1e,parentNode:G1e,parentElement:V1e,textContent:K1e,contains:Y1e,getRootNode:Z1e,host:X1e,styleSheets:Q1e,shadowRoot:J1e,querySelector:eSe,querySelectorAll:tSe,mutationObserver:IB,patch:lu};function Sr(t,e,n=document){const r={capture:!0,passive:!0};return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}const hc=`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 T4={map:{},getId(){return console.error(hc),-1},getNode(){return console.error(hc),null},removeNodeFromMap(){console.error(hc)},has(){return console.error(hc),!1},reset(){console.error(hc)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(T4=new Proxy(T4,{get(t,e,n){return e==="map"&&console.error(hc),Reflect.get(t,e,n)}}));function jh(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 wb(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)}}),()=>wb(t,e,o||{},!0)}let Jv=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Jv=()=>new Date().getTime());function OB(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 NB(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function MB(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function PB(t){return t?t.nodeType===t.ELEMENT_NODE?t:rt.parentElement(t):null}function Er(t,e,n,r){if(!t)return!1;const s=PB(t);if(!s)return!1;try{if(typeof e=="string"){if(s.classList.contains(e)||r&&s.closest("."+e)!==null)return!0}else if(qv(s,e,r))return!0}catch{}return!!(n&&(s.matches(n)||r&&s.closest(n)!==null))}function nSe(t,e){return e.getId(t)!==-1}function h_(t,e,n){return t.tagName==="TITLE"&&n.headTitleMutations?!0:e.getId(t)===Mh}function kB(t,e){if(lh(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?kB(r,e):!0}function tA(t){return!!t.changedTouches}function rSe(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 DB(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function LB(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function nA(t){return t?t instanceof FR&&"shadowRoot"in t?!!t.shadowRoot:!!rt.shadowRoot(t):!1}class sSe{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 UB(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 oSe(t){let e=t,n;for(;n=UB(e);)e=n;return e}function iSe(t){const e=rt.ownerDocument(t);if(!e)return!1;const n=oSe(t);return rt.contains(e,n)}function FB(t){const e=rt.ownerDocument(t);return e?rt.contains(e,t)||iSe(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||{}),kr=(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))(kr||{}),si=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(si||{}),Wc=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Wc||{}),pc=(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))(pc||{}),zB=(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))(zB||{});function R4(t){return"__ln"in t}class aSe{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&&R4(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&&R4(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 I4=(t,e)=>`${t}@${e}`;class lSe{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 aSe,s=c=>{let f=c,p=Mh;for(;p===Mh;)f=f&&f.nextSibling,p=f&&this.mirror.getId(f);return p},o=c=>{const f=rt.parentNode(c);if(!f||!FB(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=lh(f)?this.mirror.getId(UB(c)):this.mirror.getId(f),m=s(c);if(g===-1||m===-1)return r.addNode(c);const y=wc(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=>{DB(S,this.mirror)&&this.iframeManager.addIframe(S),LB(S,this.mirror)&&this.stylesheetManager.trackLinkElement(S),nA(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)O4(this.removesSubTreeCache,c,this.mirror)&&!this.movedSet.has(rt.parentNode(c))||o(c);for(const c of this.addedSet)!N4(this.droppedSet,c)&&!O4(this.removesSubTreeCache,c,this.mirror)||N4(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=jv({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Hv(e),value:r,maskInputFn:this.maskInputFn})}),Se(this,"processMutation",e=>{if(!h_(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const n=rt.textContent(e.target);!Er(e.target,this.blockClass,this.blockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:lz(e.target,this.maskTextClass,this.maskTextSelector,!0)&&n?this.maskTextFn?this.maskTextFn(n,PB(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=Hv(n);s=jv({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:a,value:s,maskInputFn:this.maskInputFn})}if(Er(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"),!az(n.tagName,r))if(o.attributes[r]=iz(this.doc,Wl(n.tagName),Wl(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(Er(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=lh(e.target)?this.mirror.getId(rt.host(e.target)):this.mirror.getId(e.target);Er(e.target,this.blockClass,this.blockSelector,!1)||h_(n,this.mirror,this.slimDOMOptions)||!nSe(n,this.mirror)||(this.addedSet.has(n)?(rA(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||kB(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[I4(r,s)]?rA(this.movedSet,n):(this.removes.push({parentId:s,id:r,isShadow:lh(e.target)&&uh(e.target)?!0:void 0}),uSe(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(h_(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[I4(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Er(e,this.blockClass,this.blockSelector,!1)||(rt.childNodes(e).forEach(r=>this.genAdds(r)),nA(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 rA(t,e){t.delete(e),rt.childNodes(e).forEach(n=>rA(t,n))}function uSe(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 O4(t,e,n){return t.size===0?!1:cSe(t,e)}function cSe(t,e,n){const r=rt.parentNode(e);return r?t.has(r):!1}function N4(t,e){return t.size===0?!1:BB(t,e)}function BB(t,e){const n=rt.parentNode(e);return n?t.has(n)?!0:BB(t,n):!1}let ch;function dSe(t){ch=t}function fSe(){ch=void 0}const vt=t=>ch?(...n)=>{try{return t(...n)}catch(r){if(ch&&ch(r)===!0)return;throw r}}:t,Tl=[];function cp(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 jB(t,e){const n=new lSe;Tl.push(n),n.init(t);const r=new(IB())(vt(n.processMutations.bind(n)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function hSe({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=jh(vt(g=>{const m=Date.now()-u;t(a.map(y=>(y.timeOffset-=m,y)),g),a=[],u=null}),o),f=vt(jh(vt(g=>{const m=cp(g),{clientX:y,clientY:S}=tA(g)?g.changedTouches[0]:g;u||(u=Jv()),a.push({x:y,y:S,id:r.getId(m),timeOffset:Jv()-u}),c(typeof DragEvent<"u"&&g instanceof DragEvent?ft.Drag:g instanceof MouseEvent?ft.MouseMove:ft.TouchMove)}),s,{trailing:!1})),p=[Sr("mousemove",f,n),Sr("touchmove",f,n),Sr("drag",f,n)];return vt(()=>{p.forEach(g=>g())})}function pSe({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=cp(g);if(Er(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?kr[p]===kr.MouseDown?S="TouchStart":kr[p]===kr.MouseUp&&(S="TouchEnd"):si.Pen}else tA(g)&&(y=si.Touch);y!==null?(c=y,(S.startsWith("Touch")&&y===si.Touch||S.startsWith("Mouse")&&y===si.Mouse)&&(y=null)):kr[p]===kr.Click&&(y=c,c=null);const E=tA(g)?g.changedTouches[0]:g;if(!E)return;const C=n.getId(m),{clientX:w,clientY:x}=E;vt(t)({type:kr[S],id:C,x:w,y:x,...y!==null&&{pointerType:y}})};return Object.keys(kr).filter(p=>Number.isNaN(Number(p))&&!p.endsWith("_Departed")&&a[p]!==!1).forEach(p=>{let g=Wl(p);const m=f(p);if(window.PointerEvent)switch(kr[p]){case kr.MouseDown:case kr.MouseUp:g=g.replace("mouse","pointer");break;case kr.TouchStart:case kr.TouchEnd:return}u.push(Sr(g,m,e))}),vt(()=>{u.forEach(p=>p())})}function HB({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,sampling:o}){const a=vt(jh(vt(u=>{const c=cp(u);if(!c||Er(c,r,s,!0))return;const f=n.getId(c);if(c===e&&e.defaultView){const p=OB(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 Sr("scroll",a,e)}function gSe({viewportResizeCb:t},{win:e}){let n=-1,r=-1;const s=vt(jh(vt(()=>{const o=NB(),a=MB();(n!==o||r!==a)&&(t({width:Number(a),height:Number(o)}),n=o,r=a)}),200));return Sr("resize",s,e)}const mSe=["INPUT","TEXTAREA","SELECT"],M4=new WeakMap;function vSe({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:u,maskInputFn:c,sampling:f,userTriggeredOnInput:p}){function g(x){let T=cp(x);const R=x.isTrusted,M=T&&T.tagName;if(T&&M==="OPTION"&&(T=rt.parentElement(T)),!T||!M||mSe.indexOf(M)<0||Er(T,r,s,!0)||T.classList.contains(o)||a&&T.matches(a))return;let O=T.value,I=!1;const P=Hv(T)||"";P==="radio"||P==="checkbox"?I=T.checked:(u[M.toLowerCase()]||u[P])&&(O=jv({element:T,maskInputOptions:u,tagName:M,type:P,value:O,maskInputFn:c})),m(T,p?{text:O,isChecked:I,userTriggered:R}:{text:O,isChecked:I});const k=T.name;P==="radio"&&k&&I&&e.querySelectorAll(`input[type="radio"][name="${k}"]`).forEach(H=>{if(H!==T){const F=H.value;m(H,p?{text:F,isChecked:!I,userTriggered:!1}:{text:F,isChecked:!I})}})}function m(x,T){const R=M4.get(x);if(!R||R.text!==T.text||R.isChecked!==T.isChecked){M4.set(x,T);const M=n.getId(x);vt(t)({...T,id:M})}}const S=(f.input==="last"?["change"]:["input","change"]).map(x=>Sr(x,vt(g),e)),E=e.defaultView;if(!E)return()=>{S.forEach(x=>x())};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(x=>wb(x[0],x[1],{set(){vt(g)({target:this,isTrusted:!1})}},!1,E))),vt(()=>{S.forEach(x=>x())})}function ey(t){const e=[];function n(r,s){if(Nm("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Nm("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Nm("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Nm("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 ySe({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={};Mm("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(Mm("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),Mm("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),Mm("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:x}=ba(y.parentStyleSheet,e,n.styleMirror);return(w&&w!==-1||x&&x!==-1)&&t({id:w,styleId:x,adds:[{rule:E,index:[...ey(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:[...ey(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 $B({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 bSe({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:ey(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:ey(c.parentRule)}),u.apply(c,f)})}),vt(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a})}function SSe({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:r,sampling:s,doc:o}){const a=vt(c=>jh(vt(f=>{const p=cp(f);if(!p||Er(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=[Sr("play",a(pc.Play),o),Sr("pause",a(pc.Pause),o),Sr("seeked",a(pc.Seeked),o),Sr("volumechange",a(pc.VolumeChange),o),Sr("ratechange",a(pc.RateChange),o)];return vt(()=>{u.forEach(c=>c())})}function ESe({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=lu(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 CSe(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;Er(y,r,s,!0)||Er(E,r,s,!0)||f.push({start:n.getId(y),startOffset:S,end:n.getId(E),endOffset:C})}o({ranges:f})});return u(),Sr("selectionchange",u)}function wSe({doc:t,customElementCb:e}){const n=t.defaultView;return!n||!n.customElements?()=>{}:lu(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 _Se(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 xSe(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};_Se(t,e);let r;t.recordDOM&&(r=jB(t,t.doc));const s=hSe(t),o=pSe(t),a=HB(t),u=gSe(t,{win:n}),c=vSe(t),f=SSe(t);let p=()=>{},g=()=>{},m=()=>{},y=()=>{};t.recordDOM&&(p=ySe(t,{win:n}),g=$B(t,t.doc),m=bSe(t,{win:n}),t.collectFonts&&(y=ESe(t)));const S=CSe(t),E=wSe(t),C=[];for(const w of t.plugins)C.push(w.observer(w.callback,n,w.options));return vt(()=>{Tl.forEach(w=>w.reset()),r?.disconnect(),s(),o(),a(),u(),c(),f(),p(),g(),m(),y(),S(),E(),C.forEach(w=>w())})}function Nm(t){return typeof window[t]<"u"}function Mm(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class P4{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 ASe{constructor(e){Se(this,"iframes",new WeakMap),Se(this,"crossOriginIframeMap",new WeakMap),Se(this,"crossOriginIframeMirror",new P4(oz)),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 P4(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!==zB.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class TSe{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(!uh(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=jB({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(HB({...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($B({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(lu(e.prototype,"attachShadow",function(s){return function(o){const a=s.call(this,o),u=rt.shadowRoot(this);return u&&FB(this)&&r.addShadowRoot(u,n),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var _c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",RSe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Pm=0;Pm<_c.length;Pm++)RSe[_c.charCodeAt(Pm)]=Pm;var ISe=function(t){var e=new Uint8Array(t),n,r=e.length,s="";for(n=0;n<r;n+=3)s+=_c[e[n]>>2],s+=_c[(e[n]&3)<<4|e[n+1]>>4],s+=_c[(e[n+1]&15)<<2|e[n+2]>>6],s+=_c[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 k4=new Map;function OSe(t,e){let n=k4.get(t);return n||(n=new Map,k4.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}const qB=(t,e,n)=>{if(!t||!(GB(t,e)||typeof t=="object"))return;const r=t.constructor.name,s=OSe(n,r);let o=s.indexOf(t);return o===-1&&(o=s.length,s.push(t)),o};function cv(t,e,n){if(t instanceof Array)return t.map(r=>cv(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=ISe(t);return{rr_type:r,base64:s}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[cv(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:[cv(t.data,e,n),t.width,t.height]};if(GB(t,e)||typeof t=="object"){const r=t.constructor.name,s=qB(t,e,n);return{rr_type:r,index:s}}}}return t}const WB=(t,e,n)=>t.map(r=>cv(r,e,n)),GB=(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 NSe(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=lu(e.CanvasRenderingContext2D.prototype,a,function(c){return function(...f){return Er(this.canvas,n,r,!0)||setTimeout(()=>{const p=WB(f,e,this);t(this.canvas,{type:Wc["2D"],property:a,args:p})},0),c.apply(this,f)}});s.push(u)}catch{const u=wb(e.CanvasRenderingContext2D.prototype,a,{set(c){t(this.canvas,{type:Wc["2D"],property:a,args:[c],setter:!0})}});s.push(u)}return()=>{s.forEach(a=>a())}}function MSe(t){return t==="experimental-webgl"?"webgl":t}function D4(t,e,n,r){const s=[];try{const o=lu(t.HTMLCanvasElement.prototype,"getContext",function(a){return function(u,...c){if(!Er(this,e,n,!0)){const f=MSe(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 L4(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=lu(t,c,function(p){return function(...g){const m=p.apply(this,g);if(qB(m,o,this),"tagName"in this.canvas&&!Er(this.canvas,r,s,!0)){const y=WB(g,o,this),S={type:e,property:c,args:y};n(this.canvas,S)}return m}});a.push(f)}catch{const f=wb(t,c,{set(p){n(this.canvas,{type:e,property:c,args:[p],setter:!0})}});a.push(f)}return a}function PSe(t,e,n,r){const s=[];return s.push(...L4(e.WebGLRenderingContext.prototype,Wc.WebGL,t,n,r,e)),typeof e.WebGL2RenderingContext<"u"&&s.push(...L4(e.WebGL2RenderingContext.prototype,Wc.WebGL2,t,n,r,e)),()=>{s.forEach(o=>o())}}const VB="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",kSe=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),U4=typeof window<"u"&&window.Blob&&new Blob([kSe(VB)],{type:"text/javascript;charset=utf-8"});function DSe(t){let e;try{if(e=U4&&(window.URL||window.webkitURL).createObjectURL(U4),!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,"+VB,{name:t?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class LSe{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=D4(n,r,s,!0),u=new Map,c=new DSe;c.onmessage=S=>{const{id:E}=S.data;if(u.set(E,!1),!("base64"in S.data))return;const{base64:C,type:w,width:x,height:T}=S.data;this.mutationCb({id:E,type:Wc["2D"],commands:[{property:"clearRect",args:[0,0,x,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=>{Er(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 x=await createImageBitmap(E);c.postMessage({id:w,bitmap:x,width:E.width,height:E.height,dataURLOptions:o.dataURLOptions},[x])}),g=requestAnimationFrame(y)};g=requestAnimationFrame(y),this.resetObservers=()=>{a(),cancelAnimationFrame(g)}}initCanvasMutationObserver(e,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=D4(e,n,r,!1),o=NSe(this.processMutation.bind(this),e,n,r),a=PSe(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 USe{constructor(e){Se(this,"trackedLinkElements",new WeakSet),Se(this,"mutationCb"),Se(this,"adoptedStyleSheetCb"),Se(this,"styleMirror",new sSe),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:nz(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 FSe{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,dv,p_,ty=!1;try{if(Array.from([1],t=>t*2)[0]!==2){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=((BU=t.contentWindow)==null?void 0:BU.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}const js=Bve();function dp(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:x={},dataURLOptions:T={},mousemoveWait:R,recordDOM:M=!0,recordCanvas:O=!1,recordCrossOriginIframes:I=!1,recordAfter:P=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:k=!1,collectFonts:H=!1,inlineImages:F=!1,plugins:B,keepIframeSrcFn:W=()=>!1,ignoreCSSAttributes:Y=new Set([]),errorHandler:ne}=t;dSe(ne);const $=I?window.parent===window:!0;let ee=!1;if(!$)try{window.parent.document&&(ee=!1)}catch{ee=!0}if($&&!e)throw new Error("emit function is required");if(!$&&!ee)return()=>{};R!==void 0&&x.mousemove===void 0&&(x.mousemove=R),js.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=uz(y);rSe();let Ae,L=0;const V=Ee=>{for(const pt of B||[])pt.eventProcessor&&(Ee=pt.eventProcessor(Ee));return w&&!ee&&(Ee=w(Ee)),Ee};gn=(Ee,pt)=>{var Ce;const ze=Ee;if(ze.timestamp=Jv(),(Ce=Tl[0])!=null&&Ce.isFrozen()&&ze.type!==Ct.FullSnapshot&&!(ze.type===Ct.IncrementalSnapshot&&ze.data.source===ft.Mutation)&&Tl.forEach(Be=>Be.unfreeze()),$)e?.(V(ze),pt);else if(ee){const Be={type:"rrweb",event:V(ze),origin:window.location.origin,isCheckout:pt};window.parent.postMessage(Be,"*")}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 Be=r&&L>=r,He=n&&ze.timestamp-Ae.timestamp>n;(Be||He)&&dv(!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 USe({mutationCb:K,adoptedStyleSheetCb:he}),ve=new ASe({mirror:js,mutationCb:K,stylesheetManager:ue,recordCrossOriginIframes:I,wrappedEmit:gn});for(const Ee of B||[])Ee.getMirror&&Ee.getMirror({nodeMirror:js,crossOriginIframeMirror:ve.crossOriginIframeMirror,crossOriginIframeStyleMirror:ve.crossOriginIframeStyleMirror});const _e=new FSe;p_=new LSe({recordCanvas:O,mutationCb:oe,win:window,blockClass:s,blockSelector:o,mirror:js,sampling:x.canvas,dataURLOptions:T});const Xe=new TSe({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:F,sampling:x,slimDOMOptions:de,iframeManager:ve,stylesheetManager:ue,canvasManager:p_,keepIframeSrcFn:W,processedNodeManager:_e},mirror:js});dv=(Ee=!1)=>{if(!M)return;gn({type:Ct.Meta,data:{href:window.location.href,width:MB(),height:NB()}},Ee),ue.reset(),Xe.init(),Tl.forEach(Ce=>Ce.lock());const pt=cye(document,{mirror:js,blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:f,inlineStylesheet:p,maskAllInputs:fe,maskTextFn:E,maskInputFn:S,slimDOM:de,dataURLOptions:T,recordCanvas:O,inlineImages:F,onSerialize:Ce=>{DB(Ce,js)&&ve.addIframe(Ce),LB(Ce,js)&&ue.trackLinkElement(Ce),nA(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:W});if(!pt)return console.warn("Failed to snapshot the document");gn({type:Ct.FullSnapshot,data:{node:pt,initialOffset:OB(window)}},Ee),Tl.forEach(Ce=>Ce.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ue.adoptStyleSheets(document.adoptedStyleSheets,js.getId(document))};try{const Ee=[],pt=ze=>{var Be;return vt(xSe)({mutationCb:K,mousemoveCb:(He,pr)=>gn({type:Ct.IncrementalSnapshot,data:{source:pr,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:x,recordDOM:M,recordCanvas:O,inlineImages:F,userTriggeredOnInput:k,collectFonts:H,doc:ze,maskInputFn:S,maskTextFn:E,keepIframeSrcFn:W,blockSelector:o,slimDOMOptions:de,dataURLOptions:T,mirror:js,iframeManager:ve,stylesheetManager:ue,shadowDomManager:Xe,processedNodeManager:_e,canvasManager:p_,ignoreCSSAttributes:Y,plugins:((Be=B?.filter(He=>He.observer))==null?void 0:Be.map(He=>({observer:He.observer,options:He.options,callback:pr=>gn({type:Ct.Plugin,data:{plugin:He.name,payload:pr}})})))||[]},C)};ve.addLoadListener(ze=>{try{Ee.push(pt(ze.contentDocument))}catch(Be){console.warn(Be)}});const Ce=()=>{dv(),Ee.push(pt(document)),ty=!0};return["interactive","complete"].includes(document.readyState)?Ce():(Ee.push(Sr("DOMContentLoaded",()=>{gn({type:Ct.DomContentLoaded,data:{}}),P==="DOMContentLoaded"&&Ce()})),Ee.push(Sr("load",()=>{gn({type:Ct.Load,data:{}}),P==="load"&&Ce()},window))),()=>{Ee.forEach(ze=>{try{ze()}catch(Be){String(Be).toLowerCase().includes("cross-origin")||console.warn(Be)}}),_e.destroy(),ty=!1,fSe()}}catch(Ee){console.warn(Ee)}}dp.addCustomEvent=(t,e)=>{if(!ty)throw new Error("please add custom event after start recording");gn({type:Ct.Custom,data:{tag:t,payload:e}})};dp.freezePage=()=>{Tl.forEach(t=>t.freeze())};dp.takeFullSnapshot=t=>{if(!ty)throw new Error("please take full snapshot after start recording");dv(t)};dp.mirror=js;var F4;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(F4||(F4={}));const zSe="rrweb",BSe={maskAllInputs:!0,maskTextSelector:"*",maskInputOptions:void 0},jSe={additionalSampleRate:1,batchSize:50,flushInterval:5e3,recordOptions:{slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,recordCrossOriginIframes:!1}},z4=jSe;class HSe extends Os{constructor(e){super(zSe),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({},z4.recordOptions),e?.recordOptions),BSe);this.config=Object.assign(Object.assign(Object.assign({},z4),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=dp(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(_U,n),be.info("RRWebPlugin events sent to RUM",{eventType:_U,eventCount:this.recordingEvents.length}),this.recordingEvents=[]}}var $Se=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},sA;(function(t){t.Path="PATH",t.Hash="HASH",t.PathAndHash="PATH_AND_HASH"})(sA||(sA={}));const KB="us-west-2",oA=`https://dataplane.rum.${KB}.amazonaws.com`,YB=()=>({unique:!1,domain:window.location.hostname,path:"/",sameSite:"Strict",secure:!0}),ZB=t=>({allowCookies:!1,batchLimit:100,client:hge,compressionStrategy:{enabled:!0},cookieAttributes:t,debug:!1,disableAutoPageView:!1,dispatchInterval:5*1e3,enableRumClient:!0,enableXRay:!1,endpoint:oA,endpointUrl:new URL(oA),eventCacheSize:1e3,eventPluginsToLoad:[],pageIdFormat:sA.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 qSe=class{constructor(e,n,r,s={}){var{cookieAttributes:o}=s,a=$Se(s,["cookieAttributes"]);this.eventBus=new B7,typeof r>"u"&&(r="us-west-2"),this.applicationId=e;const u=Object.assign(Object.assign({},YB()),o);this.config=Object.assign(Object.assign({fetchFunction:fetch},ZB(u)),a),this.config.sessionId&&(this.config.suppressSessionStartEvent=!0),this.config.endpoint=a.endpoint?a.endpoint:oA.replace(KB,r),this.config.endpointUrl=new URL(this.config.endpoint),be.configure(this.config.debug),be.info("Initialized RUM Slim"),this.eventCache=new _me({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;[kv,Dv,Fc,`${kv}_${this.applicationId}`,`${Dv}_${this.applicationId}`,`${Fc}_${this.applicationId}`].forEach(r=>mme(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 pge(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 gme(r);return this.config.disableAutoPageView||s.addPlugin(new Hme),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 B4;(function(t){t.Path="PATH",t.Hash="HASH",t.PathAndHash="PATH_AND_HASH"})(B4||(B4={}));const WSe=t=>Object.assign(Object.assign({},ZB(t)),{signing:!0,telemetries:[Ks.Errors,Ks.Performance,Ks.Http,Ks.Replay]});class GSe extends qSe{constructor(e,n,r,s={}){super(e,n,r,Object.assign(Object.assign({},WSe(YB())),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($ge),r.setCognitoCredentialProviderFactory((s,o,a,u)=>{const c={identityPoolId:a,guestRoleArn:u,cookieAttributes:s.cookieAttributes};return a&&u?new ome(c,o).ChainAnonymousCredentialsProvider:new ime(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($7,e)}registerDomEvents(e){this.pluginManager.updatePlugin(j7,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 Dme(e)],[Ks.Performance]:e=>[new Fme(e),new qme(e),new cve(e)],[Ks.Interaction]:e=>[new iR(e)],[Ks.Http]:e=>[new gve(e),new fve(e)],[Ks.Replay]:e=>[new HSe(e)]}}}const XB={recordPageView:()=>{},recordError:()=>{},recordEvent:()=>{},recordTiming:()=>{}},VSe=/([?&](token|access_token|id_token|authorization)=[^&]*)|\/messages\/[a-z0-9_-]+/gi;function QB(t){return t.replace(VSe,"[redacted]")}function KSe(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 QB(t.slice(0,r))}function YSe(t){const e=QB(t.message);if(e===t.message)return t;const n=new Error(e);return n.name=t.name,n.stack=t.stack,n}function ZSe(t){return{recordPageView(e){t.recordPageView(KSe(e))},recordError(e,n){t.recordError(YSe(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 j4(t){return t instanceof Error?t:new Error(String(t))}function XSe(t){window.addEventListener("error",e=>{t.recordError(j4(e.error??e.message))}),window.addEventListener("unhandledrejection",e=>{t.recordError(j4(e.reason))})}function QSe(){const{appMonitorId:t,identityPoolId:e,region:n}=Cy().rum;if(!t)return XB;const r=new GSe(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=ZSe(r);return XSe(s),s}const JB=A.createContext(XB);function pAe(){return A.useContext(JB)}const iA="remit.theme",JSe="dark";function H4(){return typeof localStorage>"u"?"system":localStorage.getItem(iA)??"system"}function aA(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(JSe,e)}function gAe(t){typeof localStorage<"u"&&(t==="system"?localStorage.removeItem(iA):localStorage.setItem(iA,t)),aA(t)}const eEe=()=>{if(typeof window>"u"||(aA(H4()),typeof window.matchMedia!="function"))return;const t=window.matchMedia("(prefers-color-scheme: dark)"),e=()=>{aA(H4())};typeof t.addEventListener=="function"?t.addEventListener("change",e):t.addListener(e)},tEe=(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);Ll(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),t?.services?.logger?.warn?t.services.logger.warn(...s):console?.warn&&console.warn(...s)},$4={},lA=(t,e,n,r)=>{Ll(n)&&$4[n]||(Ll(n)&&($4[n]=new Date),tEe(t,e,n,r))},ej=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},uA=(t,e,n)=>{t.loadNamespaces(e,ej(t,n))},q4=(t,e,n,r)=>{if(Ll(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return uA(t,n,r);n.forEach(s=>{t.options.ns.indexOf(s)<0&&t.options.ns.push(s)}),t.loadLanguages(e,ej(t,r))},nEe=(t,e,n={})=>!e.languages||!e.languages.length?(lA(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}}),Ll=t=>typeof t=="string",rEe=t=>typeof t=="object"&&t!==null,sEe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,oEe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},iEe=t=>oEe[t],aEe=t=>t.replace(sEe,iEe);let cA={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:aEe};const lEe=(t={})=>{cA={...cA,...t}},uEe=()=>cA;let tj;const cEe=t=>{tj=t},dEe=()=>tj,fEe={type:"3rdParty",init(t){lEe(t.options.react),cEe(t)}},hEe=A.createContext();class pEe{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const gEe=(t,e)=>{const n=A.useRef();return A.useEffect(()=>{n.current=t},[t,e]),n.current},nj=(t,e,n,r)=>t.getFixedT(e,n,r),mEe=(t,e,n,r)=>A.useCallback(nj(t,e,n,r),[t,e,n,r]),vEe=(t,e={})=>{const{i18n:n}=e,{i18n:r,defaultNS:s}=A.useContext(hEe)||{},o=n||r||dEe();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new pEe),!o){lA(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const R=(O,I)=>Ll(I)?I:rEe(I)&&Ll(I.defaultValue)?I.defaultValue:Array.isArray(O)?O[O.length-1]:O,M=[R,{},!1];return M.t=R,M.i18n={},M.ready=!1,M}o.options.react?.wait&&lA(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...uEe(),...o.options.react,...e},{useSuspense:u,keyPrefix:c}=a;let f=t||s||o.options?.defaultNS;f=Ll(f)?[f]:f||["translation"],o.reportNamespaces.addUsedNamespaces?.(f);const p=(o.isInitialized||o.initializedStoreOnce)&&f.every(R=>nEe(R,o,a)),g=mEe(o,e.lng||null,a.nsMode==="fallback"?f:f[0],c),m=()=>g,y=()=>nj(o,e.lng||null,a.nsMode==="fallback"?f:f[0],c),[S,E]=A.useState(m);let C=f.join();e.lng&&(C=`${e.lng}${C}`);const w=gEe(C),x=A.useRef(!0);A.useEffect(()=>{const{bindI18n:R,bindI18nStore:M}=a;x.current=!0,!p&&!u&&(e.lng?q4(o,e.lng,f,()=>{x.current&&E(y)}):uA(o,f,()=>{x.current&&E(y)})),p&&w&&w!==C&&x.current&&E(y);const O=()=>{x.current&&E(y)};return R&&o?.on(R,O),M&&o?.store.on(M,O),()=>{x.current=!1,o&&R&&R?.split(" ").forEach(I=>o.off(I,O)),M&&o&&M.split(" ").forEach(I=>o.store.off(I,O))}},[o,C]),A.useEffect(()=>{x.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?q4(o,e.lng,f,()=>R()):uA(o,f,()=>R())})},yEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts",...t,headers:{"Content-Type":"application/json",...t.headers}}),bEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/oauth/microsoft/start",...t,headers:{"Content-Type":"application/json",...t.headers}}),SEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/test-connection",...t,headers:{"Content-Type":"application/json",...t.headers}}),EEe=t=>(t.client??Ze).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}",...t}),CEe=t=>(t.client??Ze).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),wEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters",...t}),_Ee=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters",...t,headers:{"Content-Type":"application/json",...t.headers}}),xEe=t=>(t.client??Ze).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters/{filterId}",...t}),AEe=t=>(t.client??Ze).put({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/folder-roles/{role}",...t,headers:{"Content-Type":"application/json",...t.headers}}),TEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/mailboxes",...t}),REe=t=>(t.client??Ze).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/mailboxes/{mailboxId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),IEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize",...t,headers:{"Content-Type":"application/json",...t.headers}}),OEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize/preview",...t,headers:{"Content-Type":"application/json",...t.headers}}),NEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize/{organizeJobId}",...t}),MEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/sync",...t}),PEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/sync/status",...t}),kEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/addresses/search",...t}),DEe=t=>(t.client??Ze).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/addresses/{addressId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),LEe=t=>(t?.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/config",...t}),mAe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/mailboxes/{mailboxId}/threads",...t}),UEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/mailboxes/{mailboxId}/threads/search",...t}),FEe=t=>(t.client??Ze).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/me",...t,headers:{"Content-Type":"application/json",...t.headers}}),zEe=t=>(t?.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/me/export",...t}),BEe=t=>(t?.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/me/vip-suggestions",...t}),jEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/delete",...t,headers:{"Content-Type":"application/json",...t.headers}}),HEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/flags",...t,headers:{"Content-Type":"application/json",...t.headers}}),$Ee=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/move",...t,headers:{"Content-Type":"application/json",...t.headers}}),qEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}",...t}),WEe=t=>(t.client??Ze).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}/flags",...t,headers:{"Content-Type":"application/json",...t.headers}}),GEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}/raw",...t}),VEe=t=>(t?.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox",...t}),KEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox",...t,headers:{"Content-Type":"application/json",...t.headers}}),YEe=t=>(t.client??Ze).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t}),ZEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t}),XEe=t=>(t.client??Ze).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),QEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}/send",...t}),JEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/search/semantic",...t}),eCe=t=>(t?.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/threads",...t}),tCe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/threads/{threadId}/messages",...t}),vAe=t=>({mutationFn:async n=>{const{data:r}=await yEe({...t,...n,throwOnError:!0});return r}}),fr=(t,e,n,r)=>{const s={_id:t,baseUrl:e?.baseUrl||(e?.client??Ze).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]},yAe=t=>({mutationFn:async n=>{const{data:r}=await bEe({...t,...n,throwOnError:!0});return r}}),bAe=t=>({mutationFn:async n=>{const{data:r}=await SEe({...t,...n,throwOnError:!0});return r}}),SAe=t=>({mutationFn:async n=>{const{data:r}=await EEe({...t,...n,throwOnError:!0});return r}}),EAe=t=>({mutationFn:async n=>{const{data:r}=await CEe({...t,...n,throwOnError:!0});return r}}),nCe=t=>fr("filterOperationsListFilters",t),CAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await wEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:nCe(t)}),wAe=t=>({mutationFn:async n=>{const{data:r}=await _Ee({...t,...n,throwOnError:!0});return r}}),_Ae=t=>({mutationFn:async n=>{const{data:r}=await xEe({...t,...n,throwOnError:!0});return r}}),xAe=t=>({mutationFn:async n=>{const{data:r}=await AEe({...t,...n,throwOnError:!0});return r}}),rCe=t=>fr("mailboxOperationsListMailboxes",t),AAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await TEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:rCe(t)}),TAe=t=>({mutationFn:async n=>{const{data:r}=await REe({...t,...n,throwOnError:!0});return r}}),RAe=t=>({mutationFn:async n=>{const{data:r}=await IEe({...t,...n,throwOnError:!0});return r}}),IAe=t=>({mutationFn:async n=>{const{data:r}=await OEe({...t,...n,throwOnError:!0});return r}}),sCe=t=>fr("organizeJobDetailOperationsGetOrganizeJob",t),OAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await NEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:sCe(t)}),NAe=t=>({mutationFn:async n=>{const{data:r}=await MEe({...t,...n,throwOnError:!0});return r}}),oCe=t=>fr("syncOperationsGetSyncStatus",t),MAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await PEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:oCe(t)}),iCe=t=>fr("addressOperationsSearchAddresses",t),PAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await kEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:iCe(t)}),kAe=t=>({mutationFn:async n=>{const{data:r}=await DEe({...t,...n,throwOnError:!0});return r}}),aCe=t=>fr("configOperationsGetConfig",t),lCe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await LEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:aCe(t)}),DAe=t=>fr("threadOperationsListThreads",t),uCe=t=>fr("threadOperationsSearchThreads",t),LAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await UEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:uCe(t)}),UAe=t=>({mutationFn:async n=>{const{data:r}=await FEe({...t,...n,throwOnError:!0});return r}}),FAe=t=>({mutationFn:async n=>{const{data:r}=await zEe({...t,...n,throwOnError:!0});return r}}),cCe=t=>fr("meOperationsListVipSuggestions",t),zAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await BEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:cCe(t)}),BAe=t=>({mutationFn:async n=>{const{data:r}=await jEe({...t,...n,throwOnError:!0});return r}}),jAe=t=>({mutationFn:async n=>{const{data:r}=await HEe({...t,...n,throwOnError:!0});return r}}),HAe=t=>({mutationFn:async n=>{const{data:r}=await $Ee({...t,...n,throwOnError:!0});return r}}),dCe=t=>fr("messageOperationsDescribeMessage",t),$Ae=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await qEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:dCe(t)}),qAe=t=>({mutationFn:async n=>{const{data:r}=await WEe({...t,...n,throwOnError:!0});return r}}),fCe=t=>fr("messageOperationsGetRawMessage",t),WAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await GEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:fCe(t)}),rj=t=>fr("outboxOperationsListOutboxMessages",t),GAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await VEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:rj(t)}),VAe=t=>({mutationFn:async n=>{const{data:r}=await KEe({...t,...n,throwOnError:!0});return r}}),KAe=t=>({mutationFn:async n=>{const{data:r}=await YEe({...t,...n,throwOnError:!0});return r}}),hCe=t=>fr("outboxDetailOperationsGetOutboxMessage",t),pCe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await ZEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:hCe(t)}),YAe=t=>({mutationFn:async n=>{const{data:r}=await XEe({...t,...n,throwOnError:!0});return r}}),ZAe=t=>({mutationFn:async n=>{const{data:r}=await QEe({...t,...n,throwOnError:!0});return r}}),gCe=t=>fr("semanticSearchOperationsSemanticSearch",t),XAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await JEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:gCe(t)}),mCe=t=>fr("unifiedThreadOperationsListAllThreads",t),vCe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await eCe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:mCe(t)}),yCe=t=>fr("threadDetailOperationsListThreadMessages",t),QAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await tCe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:yCe(t)}),sj=A.createContext(void 0),W4={isOpen:!1,mode:"new"},bCe=2e3,SCe=6e4,ECe=({children:t})=>{const[e,n]=A.useState(W4),[r,s]=A.useState(),o=A.useRef(0),a=DF(),{data:u}=ufe({...pCe({path:{outboxMessageId:r??""}}),enabled:!!r,refetchInterval:y=>{const S=y.state.data?.status;return S==="sent"||S==="failed"||S==="blocked"||Date.now()-o.current>SCe?!1:bCe}});A.useEffect(()=>{if(!u||!r)return;(u.status==="sent"||u.status==="failed"||u.status==="blocked")&&(s(void 0),a.invalidateQueries({queryKey:rj()}))},[u,r,a]);const c=A.useCallback(y=>{n({...y,isOpen:!0})},[]),f=A.useCallback(()=>{n(W4)},[]),p=A.useCallback(y=>{n(S=>({...S,outboxMessageId:y}))},[]),g=A.useCallback(y=>{o.current=Date.now(),s(y)},[]),m=A.useMemo(()=>({state:e,openCompose:c,closeCompose:f,setOutboxMessageId:p,startSendPolling:g}),[e,c,f,p,g]);return D.jsx(sj.Provider,{value:m,children:t})},JAe=()=>{const t=A.useContext(sj);if(!t)throw new Error("useCompose must be used within a ComposeProvider");return t},g_=(...t)=>e8(K5(t)),CCe={error:{container:"border-danger/50 bg-danger/10 dark:bg-danger/20",icon:"text-danger",title:"text-danger"},warning:{container:"border-warning/50 bg-warning/10",icon:"text-warning",title:"text-warning"},info:{container:"border-accent-2/50 bg-accent-2-soft",icon:"text-accent-2",title:"text-accent-2"}},wCe={error:LZ,warning:$Z,info:BZ},_Ce={error:"Error",warning:"Warning",info:"Information"},xCe=({id:t,severity:e,title:n,detail:r,onDismiss:s})=>{const o=CCe[e],a=wCe[e];return D.jsxs("div",{role:e==="error"?"alert":"status","aria-live":e==="error"?"assertive":"polite",className:g_("pointer-events-auto flex items-start gap-3 rounded-md border bg-canvas/80 px-3 py-2 shadow-md backdrop-blur",o.container),children:[D.jsx(a,{className:g_("size-5 shrink-0 mt-0.5",o.icon),"aria-hidden":"true"}),D.jsxs("div",{className:"flex-1 min-w-0",children:[D.jsx("p",{className:g_("text-sm font-medium",o.title),children:n}),r&&D.jsx("p",{className:"mt-0.5 text-xs text-fg-muted break-words",children:r})]}),D.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 ${_Ce[e].toLowerCase()}`,children:D.jsx(ph,{className:"size-4","aria-hidden":"true"})})]})},ACe=({errors:t,onDismiss:e})=>t.length===0?null:D.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:D.jsx("div",{className:"flex w-full max-w-md flex-col gap-2",children:t.map(n=>D.jsx(xCe,{id:n.id,severity:n.severity,title:n.title,detail:n.detail,onDismiss:e},n.id))})}),G4=5,eTe=(t,e,n)=>({title:t,detail:oj(n)??e}),oj=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}},tTe=t=>{const e=oj(t);return e?e.startsWith("Message not found"):!1},TCe=(t,e,n)=>t.severity===n&&t.title===e.title&&t.detail===e.detail,RCe=(t,e)=>{const r=[...t.filter(s=>!TCe(s,{title:e.title,detail:e.detail,severity:e.severity},e.severity)),e];return r.length<=G4?r:r.slice(r.length-G4)},ICe=(t,e)=>t.filter(n=>n.id!==e),OCe=(t,e,n)=>({id:e,severity:t.severity??"error",title:t.title,detail:t.detail,createdAt:n}),ij=A.createContext(void 0),NCe=()=>typeof globalThis.crypto<"u"&&typeof globalThis.crypto.randomUUID=="function"?globalThis.crypto.randomUUID():`banner-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,MCe=({children:t})=>{const[e,n]=A.useState([]),r=A.useCallback(u=>{const c=OCe(u,NCe(),Date.now());return n(f=>RCe(f,c)),c.id},[]),s=A.useCallback(u=>{n(c=>ICe(c,u))},[]),o=A.useCallback(()=>{n([])},[]),a=A.useMemo(()=>({errors:e,pushError:r,dismissError:s,clearAll:o}),[e,r,s,o]);return D.jsxs(ij.Provider,{value:a,children:[t,D.jsx(ACe,{errors:e,onDismiss:s})]})},nTe=()=>{const t=A.useContext(ij);if(!t)throw new Error("useErrorBanners must be used within an ErrorBannerProvider");return t},PCe=({error:t,reset:e,info:n})=>{const r=qA(t),s=kc(t,{recoverable:r,componentStack:n?.componentStack});return D.jsx(z8,{fatal:s,onRetry:r?e:void 0})},fp=Uhe()({component:DCe,errorComponent:PCe}),kCe=()=>{const{t}=vEe("common",{useSuspense:!1});return D.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 DCe(){return D.jsxs(MCe,{children:[D.jsxs(ECe,{children:[D.jsx(kCe,{}),D.jsx("main",{id:"main-content",className:"h-dvh overflow-hidden",children:D.jsx(A.Suspense,{fallback:D.jsx(HA,{}),children:D.jsx(h7,{})})})]}),D.jsx(F8,{})]})}const LCe=dr("/")({beforeLoad:()=>{throw VF({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 V4;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(V4||(V4={}));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 _i 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 _i))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()}}_i.create=t=>new _i(t);const dA=(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 UCe=dA;function FCe(){return UCe}const zCe=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 xe(t,e){const n=FCe(),r=zCe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===dA?void 0:dA].filter(s=>!!s)});t.common.issues.push(r)}class ls{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 Ke;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 ls.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 Ke;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 Ke=Object.freeze({status:"aborted"}),Xf=t=>({status:"dirty",value:t}),Ms=t=>({status:"valid",value:t}),K4=t=>t.status==="aborted",Y4=t=>t.status==="dirty",Gc=t=>t.status==="valid",ny=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 ja{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 Z4=(t,e)=>{if(Gc(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 _i(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 ls,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(ny(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 Z4(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 Gc(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=>Gc(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(ny(s)?s:Promise.resolve(s));return Z4(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 Yc({schema:this,typeName:Ye.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 Zc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _o.create(this)}promise(){return iy.create(this,this._def)}or(e){return sy.create([this,e],this._def)}and(e){return oy.create(this,e,this._def)}transform(e){return new Yc({...st(this._def),schema:this,typeName:Ye.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new hA({...st(this._def),innerType:this,defaultValue:n,typeName:Ye.ZodDefault})}brand(){return new lwe({typeName:Ye.ZodBranded,type:this,...st(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new pA({...st(this._def),innerType:this,catchValue:n,typeName:Ye.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return BR.create(this,e)}readonly(){return gA.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const BCe=/^c[^\s-]{8,}$/i,jCe=/^[0-9a-z]+$/,HCe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$Ce=/^[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,qCe=/^[a-z0-9_-]{21}$/i,WCe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,GCe=/^[-+]?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)?)??$/,VCe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,KCe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let m_;const YCe=/^(?:(?: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])$/,ZCe=/^(?:(?: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])$/,XCe=/^(([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]))$/,QCe=/^(([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])$/,JCe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ewe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,aj="((\\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])))",twe=new RegExp(`^${aj}$`);function lj(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 nwe(t){return new RegExp(`^${lj(t)}$`)}function rwe(t){let e=`${aj}T${lj(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 swe(t,e){return!!((e==="v4"||!e)&&YCe.test(t)||(e==="v6"||!e)&&XCe.test(t))}function owe(t,e){if(!WCe.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 iwe(t,e){return!!((e==="v4"||!e)&&ZCe.test(t)||(e==="v6"||!e)&&QCe.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 xe(o,{code:ge.invalid_type,expected:Oe.string,received:o.parsedType}),Ke}const r=new ls;let s;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(s=this._getOrReturnCtx(e,s),xe(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),xe(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?xe(s,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&xe(s,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")VCe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"email",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")m_||(m_=new RegExp(KCe,"u")),m_.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"emoji",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")$Ce.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"uuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")qCe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"nanoid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")BCe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"cuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")jCe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"cuid2",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")HCe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(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),xe(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),xe(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),xe(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),xe(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),xe(s,{code:ge.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?rwe(o).test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{code:ge.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?twe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{code:ge.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?nwe(o).test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{code:ge.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?GCe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"duration",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?swe(e.data,o.version)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"ip",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?owe(e.data,o.alg)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"jwt",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?iwe(e.data,o.version)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"cidr",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?JCe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"base64",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?ewe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(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:Ye.ZodString,coerce:t?.coerce??!1,...st(t)});function awe(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 Gl 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 xe(o,{code:ge.invalid_type,expected:Oe.number,received:o.parsedType}),Ke}let r;const s=new ls;for(const o of this._def.checks)o.kind==="int"?Tt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),xe(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),xe(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),xe(r,{code:ge.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?awe(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),xe(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),xe(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 Gl({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Me.toString(s)}]})}_addCheck(e){return new Gl({...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)}}Gl.create=t=>new Gl({checks:[],typeName:Ye.ZodNumber,coerce:t?.coerce||!1,...st(t)});class Vl 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 ls;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),xe(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),xe(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),xe(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 xe(n,{code:ge.invalid_type,expected:Oe.bigint,received:n.parsedType}),Ke}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 Vl({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Me.toString(s)}]})}_addCheck(e){return new Vl({...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}}Vl.create=t=>new Vl({checks:[],typeName:Ye.ZodBigInt,coerce:t?.coerce??!1,...st(t)});class ry extends wt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Oe.boolean){const r=this._getOrReturnCtx(e);return xe(r,{code:ge.invalid_type,expected:Oe.boolean,received:r.parsedType}),Ke}return Ms(e.data)}}ry.create=t=>new ry({typeName:Ye.ZodBoolean,coerce:t?.coerce||!1,...st(t)});class Vc 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 xe(o,{code:ge.invalid_type,expected:Oe.date,received:o.parsedType}),Ke}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return xe(o,{code:ge.invalid_date}),Ke}const r=new ls;let s;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(s=this._getOrReturnCtx(e,s),xe(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),xe(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 Vc({...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}}Vc.create=t=>new Vc({checks:[],coerce:t?.coerce||!1,typeName:Ye.ZodDate,...st(t)});class X4 extends wt{_parse(e){if(this._getType(e)!==Oe.symbol){const r=this._getOrReturnCtx(e);return xe(r,{code:ge.invalid_type,expected:Oe.symbol,received:r.parsedType}),Ke}return Ms(e.data)}}X4.create=t=>new X4({typeName:Ye.ZodSymbol,...st(t)});class Q4 extends wt{_parse(e){if(this._getType(e)!==Oe.undefined){const r=this._getOrReturnCtx(e);return xe(r,{code:ge.invalid_type,expected:Oe.undefined,received:r.parsedType}),Ke}return Ms(e.data)}}Q4.create=t=>new Q4({typeName:Ye.ZodUndefined,...st(t)});class J4 extends wt{_parse(e){if(this._getType(e)!==Oe.null){const r=this._getOrReturnCtx(e);return xe(r,{code:ge.invalid_type,expected:Oe.null,received:r.parsedType}),Ke}return Ms(e.data)}}J4.create=t=>new J4({typeName:Ye.ZodNull,...st(t)});class e6 extends wt{constructor(){super(...arguments),this._any=!0}_parse(e){return Ms(e.data)}}e6.create=t=>new e6({typeName:Ye.ZodAny,...st(t)});class t6 extends wt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ms(e.data)}}t6.create=t=>new t6({typeName:Ye.ZodUnknown,...st(t)});class Ha extends wt{_parse(e){const n=this._getOrReturnCtx(e);return xe(n,{code:ge.invalid_type,expected:Oe.never,received:n.parsedType}),Ke}}Ha.create=t=>new Ha({typeName:Ye.ZodNever,...st(t)});class n6 extends wt{_parse(e){if(this._getType(e)!==Oe.undefined){const r=this._getOrReturnCtx(e);return xe(r,{code:ge.invalid_type,expected:Oe.void,received:r.parsedType}),Ke}return Ms(e.data)}}n6.create=t=>new n6({typeName:Ye.ZodVoid,...st(t)});class _o extends wt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==Oe.array)return xe(n,{code:ge.invalid_type,expected:Oe.array,received:n.parsedType}),Ke;if(s.exactLength!==null){const a=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(a||u)&&(xe(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&&(xe(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&&(xe(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 ja(n,a,n.path,u)))).then(a=>ls.mergeArray(r,a));const o=[...n.data].map((a,u)=>s.type._parseSync(new ja(n,a,n.path,u)));return ls.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new _o({...this._def,minLength:{value:e,message:Me.toString(n)}})}max(e,n){return new _o({...this._def,maxLength:{value:e,message:Me.toString(n)}})}length(e,n){return new _o({...this._def,exactLength:{value:e,message:Me.toString(n)}})}nonempty(e){return this.min(1,e)}}_o.create=(t,e)=>new _o({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ye.ZodArray,...st(e)});function gc(t){if(t instanceof xn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Ma.create(gc(r))}return new xn({...t._def,shape:()=>e})}else return t instanceof _o?new _o({...t._def,type:gc(t.element)}):t instanceof Ma?Ma.create(gc(t.unwrap())):t instanceof Zc?Zc.create(gc(t.unwrap())):t instanceof Kl?Kl.create(t.items.map(e=>gc(e))):t}class xn 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 xe(f,{code:ge.invalid_type,expected:Oe.object,received:f.parsedType}),Ke}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 ja(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&&(xe(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 ja(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=>ls.mergeObjectSync(r,f)):ls.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return Me.errToObj,new xn({...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 xn({...this._def,unknownKeys:"strip"})}passthrough(){return new xn({...this._def,unknownKeys:"passthrough"})}extend(e){return new xn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new xn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ye.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new xn({...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 xn({...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 xn({...this._def,shape:()=>n})}deepPartial(){return gc(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 xn({...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 xn({...this._def,shape:()=>n})}keyof(){return uj(Tt.objectKeys(this.shape))}}xn.create=(t,e)=>new xn({shape:()=>t,unknownKeys:"strip",catchall:Ha.create(),typeName:Ye.ZodObject,...st(e)});xn.strictCreate=(t,e)=>new xn({shape:()=>t,unknownKeys:"strict",catchall:Ha.create(),typeName:Ye.ZodObject,...st(e)});xn.lazycreate=(t,e)=>new xn({shape:t,unknownKeys:"strip",catchall:Ha.create(),typeName:Ye.ZodObject,...st(e)});class sy 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 _i(u.ctx.common.issues));return xe(n,{code:ge.invalid_union,unionErrors:a}),Ke}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 _i(c));return xe(n,{code:ge.invalid_union,unionErrors:u}),Ke}}get options(){return this._def.options}}sy.create=(t,e)=>new sy({options:t,typeName:Ye.ZodUnion,...st(e)});function fA(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=fA(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=fA(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 oy extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(o,a)=>{if(K4(o)||K4(a))return Ke;const u=fA(o.value,a.value);return u.valid?((Y4(o)||Y4(a))&&n.dirty(),{status:n.value,value:u.data}):(xe(r,{code:ge.invalid_intersection_types}),Ke)};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}))}}oy.create=(t,e,n)=>new oy({left:t,right:e,typeName:Ye.ZodIntersection,...st(n)});class Kl extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Oe.array)return xe(r,{code:ge.invalid_type,expected:Oe.array,received:r.parsedType}),Ke;if(r.data.length<this._def.items.length)return xe(r,{code:ge.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ke;!this._def.rest&&r.data.length>this._def.items.length&&(xe(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 ja(r,a,r.path,u)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>ls.mergeArray(n,a)):ls.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new Kl({...this._def,rest:e})}}Kl.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Kl({items:t,typeName:Ye.ZodTuple,rest:null,...st(e)})};class r6 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 xe(r,{code:ge.invalid_type,expected:Oe.map,received:r.parsedType}),Ke;const s=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([u,c],f)=>({key:s._parse(new ja(r,u,r.path,[f,"key"])),value:o._parse(new ja(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 Ke;(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 Ke;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),u.set(f.value,p.value)}return{status:n.value,value:u}}}}r6.create=(t,e,n)=>new r6({valueType:e,keyType:t,typeName:Ye.ZodMap,...st(n)});class Hh extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Oe.set)return xe(r,{code:ge.invalid_type,expected:Oe.set,received:r.parsedType}),Ke;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(xe(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&&(xe(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 Ke;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 ja(r,c,r.path,f)));return r.common.async?Promise.all(u).then(c=>a(c)):a(u)}min(e,n){return new Hh({...this._def,minSize:{value:e,message:Me.toString(n)}})}max(e,n){return new Hh({...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)}}Hh.create=(t,e)=>new Hh({valueType:t,minSize:null,maxSize:null,typeName:Ye.ZodSet,...st(e)});class s6 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})}}s6.create=(t,e)=>new s6({getter:t,typeName:Ye.ZodLazy,...st(e)});class o6 extends wt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return xe(n,{received:n.data,code:ge.invalid_literal,expected:this._def.value}),Ke}return{status:"valid",value:e.data}}get value(){return this._def.value}}o6.create=(t,e)=>new o6({value:t,typeName:Ye.ZodLiteral,...st(e)});function uj(t,e){return new Kc({values:t,typeName:Ye.ZodEnum,...st(e)})}class Kc extends wt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return xe(n,{expected:Tt.joinValues(r),received:n.parsedType,code:ge.invalid_type}),Ke}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 xe(n,{received:n.data,code:ge.invalid_enum_value,options:r}),Ke}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 Kc.create(e,{...this._def,...n})}exclude(e,n=this._def){return Kc.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Kc.create=uj;class i6 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 xe(r,{expected:Tt.joinValues(s),received:r.parsedType,code:ge.invalid_type}),Ke}if(this._cache||(this._cache=new Set(Tt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=Tt.objectValues(n);return xe(r,{received:r.data,code:ge.invalid_enum_value,options:s}),Ke}return Ms(e.data)}get enum(){return this._def.values}}i6.create=(t,e)=>new i6({values:t,typeName:Ye.ZodNativeEnum,...st(e)});class iy 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 xe(n,{code:ge.invalid_type,expected:Oe.promise,received:n.parsedType}),Ke;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})))}}iy.create=(t,e)=>new iy({type:t,typeName:Ye.ZodPromise,...st(e)});class Yc extends wt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ye.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=>{xe(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 Ke;const c=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return c.status==="aborted"?Ke:c.status==="dirty"||n.value==="dirty"?Xf(c.value):c});{if(n.value==="aborted")return Ke;const u=this._def.schema._parseSync({data:a,path:r.path,parent:r});return u.status==="aborted"?Ke:u.status==="dirty"||n.value==="dirty"?Xf(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"?Ke:(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"?Ke:(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(!Gc(a))return Ke;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=>Gc(a)?Promise.resolve(s.transform(a.value,o)).then(u=>({status:n.value,value:u})):Ke);Tt.assertNever(s)}}Yc.create=(t,e,n)=>new Yc({schema:t,typeName:Ye.ZodEffects,effect:e,...st(n)});Yc.createWithPreprocess=(t,e,n)=>new Yc({schema:e,effect:{type:"preprocess",transform:t},typeName:Ye.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:Ye.ZodOptional,...st(e)});class Zc extends wt{_parse(e){return this._getType(e)===Oe.null?Ms(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Zc.create=(t,e)=>new Zc({innerType:t,typeName:Ye.ZodNullable,...st(e)});class hA 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}}hA.create=(t,e)=>new hA({innerType:t,typeName:Ye.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...st(e)});class pA 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 ny(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new _i(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new _i(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}pA.create=(t,e)=>new pA({innerType:t,typeName:Ye.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...st(e)});class a6 extends wt{_parse(e){if(this._getType(e)!==Oe.nan){const r=this._getOrReturnCtx(e);return xe(r,{code:ge.invalid_type,expected:Oe.nan,received:r.parsedType}),Ke}return{status:"valid",value:e.data}}}a6.create=t=>new a6({typeName:Ye.ZodNaN,...st(t)});class lwe 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 BR 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"?Ke:o.status==="dirty"?(n.dirty(),Xf(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"?Ke: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 BR({in:e,out:n,typeName:Ye.ZodPipeline})}}class gA extends wt{_parse(e){const n=this._def.innerType._parse(e),r=s=>(Gc(s)&&(s.value=Object.freeze(s.value)),s);return ny(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}gA.create=(t,e)=>new gA({innerType:t,typeName:Ye.ZodReadonly,...st(e)});var Ye;(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"})(Ye||(Ye={}));const Fr=hi.create;Gl.create;Vl.create;const uwe=ry.create;Vc.create;Ha.create;_o.create;const fd=xn.create;sy.create;oy.create;Kl.create;Kc.create;iy.create;Ma.create;Zc.create;const rTe={string:(t=>hi.create({...t,coerce:!0})),number:(t=>Gl.create({...t,coerce:!0})),boolean:(t=>ry.create({...t,coerce:!0})),bigint:(t=>Vl.create({...t,coerce:!0})),date:(t=>Vc.create({...t,coerce:!0}))},cwe=Cy().apiUrl;Ze.setConfig({baseUrl:cwe});Ze.interceptors.error.use((t,e)=>{if(t instanceof z_||!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 z_(r,e.status,n)});const dwe=A.createContext(null),sTe=()=>A.useContext(dwe)??{accounts:[],mailboxNameIndex:new Map,accountNameIndex:new Map,searchQuery:"",searchInput:"",onSearchChange:()=>{},onSearchClear:()=>{},onSearchClearQuery:()=>{},intelligenceOpen:!1,onToggleIntelligence:()=>{},onSetIntelligenceOpen:()=>{}},fwe=()=>qn(()=>import("./mail-DUpIpDxR.js").then(t=>t.m),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])),hwe=fd({q:Fr().optional()}),pwe=dr("/mail")({loader:({context:{queryClient:t}})=>{t.prefetchQuery(lCe()),t.prefetchQuery({...vCe(),staleTime:6e4})},component:sr(fwe,"component"),validateSearch:hwe}),gwe=()=>qn(()=>import("./onboarding-D3j_ozgf.js"),__vite__mapDeps([15,16,1,13,7,5])),mwe=dr("/onboarding")({component:sr(gwe,"component")}),vwe=()=>qn(()=>import("./settings-HMGH-kik.js"),[]),oTe=[{id:"accounts",label:"Accounts",icon:D.jsx(zZ,{className:"size-4"})},{id:"senders",label:"Senders & Rules",icon:D.jsx(qZ,{className:"size-4"})},{id:"folders",label:"Folder roles",icon:D.jsx(FZ,{className:"size-4"})},{id:"filters",label:"Filters",icon:D.jsx(UZ,{className:"size-4"})},{id:"appearance",label:"Appearance",icon:D.jsx(HZ,{className:"size-4"})},{id:"advanced",label:"Advanced",icon:D.jsx(WZ,{className:"size-4"})}],iTe={accounts:"/settings/accounts",senders:"/settings/senders",folders:"/settings/folders",filters:"/settings/filters",appearance:"/settings/appearance",advanced:"/settings/advanced"},ywe=dr("/settings")({component:sr(vwe,"component")}),bwe=()=>qn(()=>import("./index-D8tcVoGJ.js"),__vite__mapDeps([17,10])),Swe=()=>qn(()=>import("./index-DtqBFgK5.js"),[]),Ewe=fd({selectedMessageId:Fr().optional(),selectedThreadId:Fr().optional(),selectedMailboxId:Fr().optional(),q:Fr().optional()}),Cwe=dr("/mail/")({component:sr(Swe,"component"),validateSearch:Ewe,errorComponent:sr(bwe,"errorComponent")}),wwe=()=>qn(()=>import("./_mailboxId-DtqBFgK5.js"),[]),_we=fd({selectedMessageId:Fr().optional(),selectedThreadId:Fr().optional(),q:Fr().optional()}),xwe=dr("/mail/$mailboxId")({component:sr(wwe,"component"),validateSearch:_we}),Awe=()=>qn(()=>import("./flagged-CYp-wRoV.js"),__vite__mapDeps([18,10])),Twe=()=>qn(()=>import("./flagged-DtqBFgK5.js"),[]),Rwe=fd({selectedMessageId:Fr().optional(),q:Fr().optional()}),Iwe=dr("/mail/flagged")({component:sr(Twe,"component"),validateSearch:Rwe,errorComponent:sr(Awe,"errorComponent")}),Owe=()=>qn(()=>import("./outbox-DtqBFgK5.js"),[]),Nwe=fd({selectedOutboxMessageId:Fr().optional()}),Mwe=dr("/mail/outbox")({component:sr(Owe,"component"),validateSearch:Nwe}),Pwe=()=>qn(()=>import("./index-CdSD5Ukp.js"),[]),kwe=dr("/settings/")({component:sr(Pwe,"component")}),Dwe=()=>qn(()=>import("./accounts-C5ua8Szj.js"),__vite__mapDeps([19,8,5,7,20,2,16,1,13,10,11,4])),Lwe=fd({editAccountId:Fr().optional(),focusSmtp:uwe().optional(),connected:Fr().optional(),oauthError:Fr().optional()}),Uwe=dr("/settings/accounts")({component:sr(Dwe,"component"),validateSearch:Lwe}),Fwe=()=>qn(()=>import("./advanced-DAyxsQQA.js"),__vite__mapDeps([21,20,2])),zwe=dr("/settings/advanced")({component:sr(Fwe,"component")}),Bwe=()=>qn(()=>import("./appearance-CGIVvQ__.js"),__vite__mapDeps([22,20,2])),jwe=dr("/settings/appearance")({component:sr(Bwe,"component")}),Hwe=()=>qn(()=>import("./filters-ChFVclfN.js"),__vite__mapDeps([23,20,2,14,7,4,10,12])),$we=dr("/settings/filters")({component:sr(Hwe,"component")}),qwe=()=>qn(()=>import("./folders-CiwXxce8.js"),__vite__mapDeps([24,6,4,3,13,20,2,7,10,12])),Wwe=dr("/settings/folders")({component:sr(qwe,"component")}),Gwe=()=>qn(()=>import("./senders-Dfo4XvA2.js"),__vite__mapDeps([25,1,20,2,7,10,9,11,3])),Vwe=dr("/settings/senders")({component:sr(Gwe,"component")}),Kwe=()=>qn(()=>import("./suggested-vips-C286_Wq_.js"),[]),Ywe=dr("/settings/suggested-vips")({component:sr(Kwe,"component")}),Zwe=LCe.update({id:"/",path:"/",getParentRoute:()=>fp}),hp=pwe.update({id:"/mail",path:"/mail",getParentRoute:()=>fp}),Xwe=mwe.update({id:"/onboarding",path:"/onboarding",getParentRoute:()=>fp}),Ni=ywe.update({id:"/settings",path:"/settings",getParentRoute:()=>fp}),Qwe=Cwe.update({id:"/",path:"/",getParentRoute:()=>hp}),Jwe=xwe.update({id:"/$mailboxId",path:"/$mailboxId",getParentRoute:()=>hp}),e_e=Iwe.update({id:"/flagged",path:"/flagged",getParentRoute:()=>hp}),t_e=Mwe.update({id:"/outbox",path:"/outbox",getParentRoute:()=>hp}),n_e=kwe.update({id:"/",path:"/",getParentRoute:()=>Ni}),r_e=Uwe.update({id:"/accounts",path:"/accounts",getParentRoute:()=>Ni}),s_e=zwe.update({id:"/advanced",path:"/advanced",getParentRoute:()=>Ni}),o_e=jwe.update({id:"/appearance",path:"/appearance",getParentRoute:()=>Ni}),i_e=$we.update({id:"/filters",path:"/filters",getParentRoute:()=>Ni}),a_e=Wwe.update({id:"/folders",path:"/folders",getParentRoute:()=>Ni}),l_e=Vwe.update({id:"/senders",path:"/senders",getParentRoute:()=>Ni}),u_e=Ywe.update({id:"/suggested-vips",path:"/suggested-vips",getParentRoute:()=>Ni}),c_e={MailMailboxIdRoute:Jwe,MailFlaggedRoute:e_e,MailOutboxRoute:t_e,MailIndexRoute:Qwe},d_e=hp._addFileChildren(c_e),f_e={SettingsAccountsRoute:r_e,SettingsAdvancedRoute:s_e,SettingsAppearanceRoute:o_e,SettingsFiltersRoute:i_e,SettingsFoldersRoute:a_e,SettingsSendersRoute:l_e,SettingsSuggestedVipsRoute:u_e,SettingsIndexRoute:n_e},h_e=Ni._addFileChildren(f_e),p_e={IndexRoute:Zwe,MailRoute:d_e,OnboardingRoute:Xwe,SettingsRoute:h_e},g_e=fp._addFileChildren(p_e)._addFileTypes(),m_e=(t,e)=>{const n=Jhe({routeTree:g_e,context:{queryClient:t},defaultPreload:"intent"});return n.subscribe("onResolved",r=>{e.recordPageView(r.toLocation.pathname)}),n},qe=t=>typeof t=="string",Lf=()=>{let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n},l6=t=>t==null?"":""+t,v_e=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},y_e=/###/g,u6=t=>t&&t.indexOf("###")>-1?t.replace(y_e,"."):t,c6=t=>!t||qe(t),dh=(t,e,n)=>{const r=qe(e)?e.split("."):e;let s=0;for(;s<r.length-1;){if(c6(t))return{};const o=u6(r[s]);!t[o]&&n&&(t[o]=new n),Object.prototype.hasOwnProperty.call(t,o)?t=t[o]:t={},++s}return c6(t)?{}:{obj:t,k:u6(r[s])}},d6=(t,e,n)=>{const{obj:r,k:s}=dh(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=dh(t,a,Object);for(;u.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),u=dh(t,a,Object),u?.obj&&typeof u.obj[`${u.k}.${o}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${o}`]=n},b_e=(t,e,n,r)=>{const{obj:s,k:o}=dh(t,e,Object);s[o]=s[o]||[],s[o].push(n)},ay=(t,e)=>{const{obj:n,k:r}=dh(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},S_e=(t,e,n)=>{const r=ay(t,n);return r!==void 0?r:ay(e,n)},cj=(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]):cj(t[r],e[r],n):t[r]=e[r]);return t},sc=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var E_e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const C_e=t=>qe(t)?t.replace(/[&<>"'\/]/g,e=>E_e[e]):t;class w_e{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 __e=[" ",",","?","!",";"],x_e=new w_e(20),A_e=(t,e,n)=>{e=e||"",n=n||"";const r=__e.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const s=x_e.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},ly=t=>t?.replace("_","-"),T_e={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 uy{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||T_e,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 uy(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new uy(this.logger,e)}}var wo=new uy;class _b{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 f6 extends _b{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=ay(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),d6(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=ay(this.data,u)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?cj(c,r,o):c={...c,...r},d6(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 dj={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 h6={},p6=t=>!qe(t)&&typeof t!="boolean"&&typeof t!="number";class cy extends _b{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),v_e(["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&&!A_e(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 F=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${F}${a}`,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${F}${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,x=n.count!==void 0&&!qe(n.count),T=cy.hasDefaultValue(n),R=x?this.pluralResolver.getSuffix(f,n.count,n):"",M=n.ordinal&&x?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",O=x&&!n.ordinal&&n.count===0,I=O&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${R}`]||n[`defaultValue${M}`]||n.defaultValue;let P=m;w&&!m&&T&&(P=I);const k=p6(P),H=Object.prototype.toString.apply(P);if(w&&P&&k&&E.indexOf(H)<0&&!(qe(C)&&Array.isArray(P))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const F=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,P,{...n,ns:u}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(g.res=F,g.usedParams=this.getUsedParamsDetails(n),g):F}if(o){const F=Array.isArray(P),B=F?[]:{},W=F?S:y;for(const Y in P)if(Object.prototype.hasOwnProperty.call(P,Y)){const ne=`${W}${o}${Y}`;T&&!m?B[Y]=this.translate(ne,{...n,defaultValue:p6(I)?I[Y]:void 0,joinArrays:!1,ns:u}):B[Y]=this.translate(ne,{...n,joinArrays:!1,ns:u}),B[Y]===ne&&(B[Y]=P[Y])}m=B}}else if(w&&qe(C)&&Array.isArray(m))m=m.join(C),m&&(m=this.extendTranslation(m,e,n,r));else{let F=!1,B=!1;!this.isValidLookup(m)&&T&&(F=!0,m=I),this.isValidLookup(m)||(B=!0,m=a);const Y=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&B?void 0:m,ne=T&&I!==m&&this.options.updateMissing;if(B||F||ne){if(this.logger.log(ne?"updateKey":"missingKey",f,c,a,ne?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 $=[];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++)$.push(ee[de]);else this.options.saveMissingTo==="all"?$=this.languageUtils.toResolveHierarchy(n.lng||this.language):$.push(n.lng||this.language);const fe=(de,Ae,L)=>{const V=T&&L!==m?L:Y;this.options.missingKeyHandler?this.options.missingKeyHandler(de,c,Ae,V,ne,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(de,c,Ae,V,ne,n),this.emit("missingKey",de,c,Ae,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?$.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($,a,I))}m=this.extendTranslation(m,e,n,g,r),B&&m===a&&this.options.appendNamespaceToMissingKey&&(m=`${c}:${a}`),(B||F)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${a}`:a,F?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=dj.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,!h6[`${E[0]}-${C}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(u)&&(h6[`${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 x=[p];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(x,p,w,C,n);else{let R;m&&(R=this.pluralResolver.getSuffix(w,n.count,n));const M=`${this.options.pluralSeparator}zero`,O=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(x.push(p+R),n.ordinal&&R.indexOf(O)===0&&x.push(p+R.replace(O,this.options.pluralSeparator)),y&&x.push(p+M)),S){const I=`${p}${this.options.contextSeparator}${n.context}`;x.push(I),m&&(x.push(I+R),n.ordinal&&R.indexOf(O)===0&&x.push(I+R.replace(O,this.options.pluralSeparator)),y&&x.push(I+M))}}let T;for(;T=x.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 g6{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wo.create("languageUtils")}getScriptPartFromCode(e){if(e=ly(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=ly(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 m6={zero:0,one:1,two:2,few:3,many:4,other:5},v6={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class R_e{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=ly(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!"),v6;if(!e.match(/-|_/))return v6;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)=>m6[s]-m6[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 y6=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=S_e(t,e,n);return!o&&s&&qe(n)&&(o=mA(t,n,r),o===void 0&&(o=mA(e,n,r))),o},v_=t=>t.replace(/\$/g,"$$$$");class I_e{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:x}=e.interpolation;this.escape=n!==void 0?n:C_e,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?sc(o):a||"{{",this.suffix=u?sc(u):c||"}}",this.formatSeparator=f||",",this.unescapePrefix=p?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":p||"",this.nestingPrefix=m?sc(m):y||sc("$t("),this.nestingSuffix=S?sc(S):E||sc(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=w||1e3,this.alwaysFormat=x!==void 0?x:!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=y6(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(y6(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=>v_(y)},{regex:this.regexp,safeValue:y=>this.escapeValue?v_(this.escape(y)):v_(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=l6(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=l6(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 O_e=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}},oc=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(ly(r),s),e[a]=u),u(n)}};class N_e{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=wo.create("formatter"),this.options=e,this.formats={number:oc((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return o=>s.format(o)}),currency:oc((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>s.format(o)}),datetime:oc((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return o=>s.format(o)}),relativetime:oc((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return o=>s.format(o,r.range||"day")}),list:oc((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()]=oc(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}=O_e(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 M_e=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class P_e extends _b{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=>{b_e(c.loaded,[o],a),M_e(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 b6=()=>({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}}),S6=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),km=()=>{},k_e=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class $h extends _b{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=S6(e),this.services={},this.logger=wo,this.modules={external:[]},k_e(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=b6();this.options={...s,...this.options,...S6(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=N_e;const g=new g6(this.options);this.store=new f6(this.options.resources,this.options);const m=this.services;m.logger=wo,m.resourceStore=this.store,m.languageUtils=g,m.pluralResolver=new R_e(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 I_e(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new P_e(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 cy(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=km),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=Lf(),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]:km;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=Lf();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=km),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"&&dj.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=Lf();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=Lf();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=Lf();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 g6(b6());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 $h(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:km;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},o=new $h(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 f6(u,s),o.services.resourceStore=o.store}return o.translator=new cy(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 hr=$h.createInstance();hr.createInstance=$h.createInstance;hr.createInstance;hr.dir;hr.init;hr.loadResources;hr.reloadResources;hr.use;hr.changeLanguage;hr.getFixedT;hr.t;hr.exists;hr.setDefaultNamespace;hr.hasLoadedNamespace;hr.loadNamespaces;hr.loadLanguages;const{slice:D_e,forEach:L_e}=[];function U_e(t){return L_e.call(D_e.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}function F_e(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 E6=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,z_e=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(!E6.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!E6.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},C6={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=z_e(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 B_e={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return C6.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:s,cookieOptions:o}=e;n&&typeof document<"u"&&C6.create(n,t,r,s,o)}},j_e={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}},H_e={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 ic=null;const w6=()=>{if(ic!==null)return ic;try{if(ic=typeof window<"u"&&window.localStorage!==null,!ic)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{ic=!1}return ic};var $_e={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&w6())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&w6()&&window.localStorage.setItem(n,t)}};let ac=null;const _6=()=>{if(ac!==null)return ac;try{if(ac=typeof window<"u"&&window.sessionStorage!==null,!ac)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{ac=!1}return ac};var q_e={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&_6())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&_6()&&window.sessionStorage.setItem(n,t)}},W_e={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}},G_e={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}},V_e={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}},K_e={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 fj=!1;try{document.cookie,fj=!0}catch{}const hj=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];fj||hj.splice(1,1);const Y_e=()=>({order:hj,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class pj{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=U_e(n,this.options||{},Y_e()),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(B_e),this.addDetector(j_e),this.addDetector($_e),this.addDetector(q_e),this.addDetector(W_e),this.addDetector(G_e),this.addDetector(V_e),this.addDetector(K_e),this.addDetector(H_e)}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&&!F_e(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)}))}}pj.type="languageDetector";function Z_e(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=X_e(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 X_e(t,e){if(t){if(typeof t=="string")return x6(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)?x6(t,e):void 0}}function x6(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 vA(t){"@babel/helpers - typeof";return vA=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},vA(t)}var gj=["__proto__","constructor","prototype"];function mj(t){return!(typeof t!="string"||t.length===0||t.length>128||gj.indexOf(t)>-1||t.indexOf("..")>-1||t.indexOf("\\")>-1||/[?#%\s@]/.test(t)||/[\x00-\x1F\x7F]/.test(t))}function vj(t){return!(!mj(t)||t.indexOf("/")>-1)}function Q_e(t){return mj(t)}var J_e={lng:vj,ns:Q_e};function Dm(t){return typeof t!="string"?t:t.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function exe(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 yj(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":vA(XMLHttpRequest))==="object"}function txe(t){return!!t&&typeof t.then=="function"}function nxe(t){return txe(t)?t:Promise.resolve(t)}var rxe=/\{\{(.+?)\}\}/g;function A6(t,e){var n=!1,r=t.replace(rxe,function(s,o){var a=o.trim();if(gj.indexOf(a)>-1)return s;var u=e[a];if(u==null)return s;var c=J_e[a]||vj,f=String(u).split("+"),p=Z_e(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 T6(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 R6(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?T6(Object(n),!0).forEach(function(r){sxe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function sxe(t,e,n){return(e=oxe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oxe(t){var e=ixe(t,"string");return Yl(e)=="symbol"?e:e+""}function ixe(t,e){if(Yl(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Yl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yl(t){"@babel/helpers - typeof";return Yl=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},Yl(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;yj()&&(typeof global<"u"&&global.XMLHttpRequest?qh=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(qh=window.XMLHttpRequest));var dy;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?dy=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(dy=window.ActiveXObject));typeof $a!="function"&&($a=void 0);if(!$a&&!qh&&!dy)try{qn(()=>import("./browser-ponyfill-B8dXU7OB.js").then(t=>t.b),[]).then(function(t){$a=t.default}).catch(function(){})}catch{}var bj=["__proto__","constructor","prototype"],yA=function(e,n){if(n&&Yl(n)==="object"){for(var r="",s=0,o=Object.keys(n);s<o.length;s++){var a=o[s];bj.indexOf(a)>-1||(r+="&"+encodeURIComponent(a)+"="+encodeURIComponent(n[a]))}if(!r)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+r.slice(1)}return e},I6=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)},axe=function(e,n,r,s){e.queryStringParams&&(n=yA(n,e.queryStringParams));var o=R6({},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=R6({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{I6(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]}),I6(n,u,s,c),e._omitFetchOptions=!0}catch(p){s(p)}}},lxe=function(e,n,r,s){r&&Yl(r)==="object"&&(r=yA("",r).slice(1)),e.queryStringParams&&(n=yA(n,e.queryStringParams));try{var o=qh?new qh:new dy("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];bj.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)}},uxe=function(e,n,r,s){if(typeof r=="function"&&(s=r,r=void 0),s=s||function(){},$a&&n.indexOf("file:")!==0)return axe(e,n,r,s);if(yj()||typeof ActiveXObject=="function")return lxe(e,n,r,s);s(new Error("No fetch and no xhr implementation found!"))};function Xc(t){"@babel/helpers - typeof";return Xc=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},Xc(t)}function O6(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 y_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?O6(Object(n),!0).forEach(function(r){Sj(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function cxe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dxe(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,Ej(r.key),r)}}function fxe(t,e,n){return e&&dxe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Sj(t,e,n){return(e=Ej(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ej(t){var e=hxe(t,"string");return Xc(e)=="symbol"?e:e+""}function hxe(t,e){if(Xc(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Xc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var pxe=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 Sj({},r,s||"")},parseLoadPayload:function(n,r){},request:uxe,reloadInterval:typeof window<"u"?!1:3600*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},Cj=(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]:{};cxe(this,t),this.services=e,this.options=n,this.allOptions=r,this.type="backend",this.init(e,n,r)}return fxe(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=y_(y_(y_({},pxe()),this.options||{}),s),this.allOptions=o,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);Xc(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=nxe(c),c.then(function(f){if(!f)return a(null,{});var p=A6(f,{lng:n.join("+"),ns:s.join("+")});if(p==null){var g=n.map(Dm).join(", "),m=s.map(Dm).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=Dm(exe(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+": "+Dm(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=A6(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)})})})}}}])})();Cj.type="backend";hr.use(Cj).use(pj).use(fEe).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 gxe=({authProvider:t,rootElementId:e="root"})=>{AJ(),eEe(),t.configure(),xpe(t);const n=QSe();mJ(n);const r=new Zde({queryCache:new PF({onError:Ipe}),mutationCache:new MF({onError:Ope}),defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:1}}}),s=m_e(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;ape.createRoot(o).render(D.jsx(A.StrictMode,{children:D.jsx(JB.Provider,{value:n,children:D.jsxs(Xde,{client:r,children:[D.jsx(Rpe,{value:t,children:D.jsx(a,{children:D.jsx(npe,{router:s})})}),!1]})})}))};gxe({authProvider:Tde});export{g_ as $,tfe as A,Gm as B,zM as C,IX as D,ofe as E,fQ as F,nfe as G,rfe as H,zZ as I,Dr as J,afe as K,ML as L,sfe as M,lfe as N,jZ as O,_xe as P,Wde as Q,q5 as R,eJ as S,$Z as T,ds as U,qr as V,xhe as W,ph as X,JAe as Y,XT as Z,xN as _,dn as a,aCe as a$,pAe as a0,Pxe as a1,ufe as a2,dCe as a3,VAe as a4,YAe as a5,GAe as a6,PAe as a7,lCe as a8,nTe as a9,bxe as aA,vCe as aB,qA as aC,iCe as aD,kc as aE,c7 as aF,mP as aG,OJ as aH,eCe as aI,rj as aJ,IAe as aK,RAe as aL,OAe as aM,NAe as aN,a7 as aO,LAe as aP,Rxe as aQ,UEe as aR,mAe as aS,qa as aT,MEe as aU,P8 as aV,Cy as aW,dwe as aX,Sxe as aY,HA as aZ,h7 as a_,pCe as aa,oj as ab,ZAe as ac,eTe as ad,KAe as ae,qn as af,AAe as ag,DAe as ah,uCe as ai,rCe as aj,jAe as ak,yCe as al,mCe as am,qAe as an,HAe as ao,BAe as ap,kAe as aq,z as ar,vEe as as,l7 as at,WAe as au,$Ae as av,tTe as aw,QAe as ax,sTe as ay,XAe as az,ZM as b,Pee as b$,Nxe as b0,bAe as b1,vAe as b2,EAe as b3,fd as b4,uwe as b5,Fr as b6,rTe as b7,UAe as b8,FAe as b9,Ai as bA,soe as bB,Ti as bC,Zse as bD,X8 as bE,Dy as bF,P9 as bG,Sre as bH,loe as bI,voe as bJ,Cre as bK,gre as bL,Ny as bM,QA as bN,W8 as bO,poe as bP,coe as bQ,Tre as bR,ooe as bS,CT as bT,K8 as bU,wre as bV,Qse as bW,Jse as bX,$ee as bY,tu as bZ,kee as b_,Uwe as ba,yAe as bb,SAe as bc,oTe as bd,iTe as be,MAe as bf,cJ as bg,xxe as bh,uJ as bi,H4 as bj,gAe as bk,CAe as bl,nCe as bm,_Ae as bn,wAe as bo,xAe as bp,TAe as bq,zAe as br,cCe as bs,Ch as bt,Yde as bu,AF as bv,Ig as bw,Q8 as bx,No as by,gT as bz,Ns as c,XA as c0,U9 as c1,Xse as c2,Uee as c3,Are as c4,noe as c5,JA as c6,eoe as c7,Soe as c8,H9 as c9,K5 as ca,Txe as cb,Xh as cc,Axe as cd,yT as ce,$y as cf,ep as cg,goe as ch,Qh as ci,moe as cj,uoe as ck,LZ as d,RX as e,Exe as f,BZ as g,wxe as h,cQ as i,D as j,V1 as k,F_ as l,pQ as m,sF as n,mxe as o,Cxe as p,vxe as q,A as r,Oxe as s,Ixe as t,sp as u,er as v,rx as w,_F as x,DF as y,Qde as z};
|
|
294
|
+
or you can use record.mirror to access the mirror instance during recording.`;let T4={map:{},getId(){return console.error(hc),-1},getNode(){return console.error(hc),null},removeNodeFromMap(){console.error(hc)},has(){return console.error(hc),!1},reset(){console.error(hc)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(T4=new Proxy(T4,{get(t,e,n){return e==="map"&&console.error(hc),Reflect.get(t,e,n)}}));function jh(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 wb(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)}}),()=>wb(t,e,o||{},!0)}let Jv=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Jv=()=>new Date().getTime());function OB(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 NB(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function MB(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function PB(t){return t?t.nodeType===t.ELEMENT_NODE?t:rt.parentElement(t):null}function Er(t,e,n,r){if(!t)return!1;const s=PB(t);if(!s)return!1;try{if(typeof e=="string"){if(s.classList.contains(e)||r&&s.closest("."+e)!==null)return!0}else if(qv(s,e,r))return!0}catch{}return!!(n&&(s.matches(n)||r&&s.closest(n)!==null))}function nSe(t,e){return e.getId(t)!==-1}function h_(t,e,n){return t.tagName==="TITLE"&&n.headTitleMutations?!0:e.getId(t)===Mh}function kB(t,e){if(lh(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?kB(r,e):!0}function tA(t){return!!t.changedTouches}function rSe(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 DB(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function LB(t,e){return!!(t.nodeName==="LINK"&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&t.getAttribute("rel")==="stylesheet"&&e.getMeta(t))}function nA(t){return t?t instanceof FR&&"shadowRoot"in t?!!t.shadowRoot:!!rt.shadowRoot(t):!1}class sSe{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 UB(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 oSe(t){let e=t,n;for(;n=UB(e);)e=n;return e}function iSe(t){const e=rt.ownerDocument(t);if(!e)return!1;const n=oSe(t);return rt.contains(e,n)}function FB(t){const e=rt.ownerDocument(t);return e?rt.contains(e,t)||iSe(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||{}),kr=(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))(kr||{}),si=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(si||{}),Wc=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(Wc||{}),pc=(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))(pc||{}),zB=(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))(zB||{});function R4(t){return"__ln"in t}class aSe{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&&R4(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&&R4(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 I4=(t,e)=>`${t}@${e}`;class lSe{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 aSe,s=c=>{let f=c,p=Mh;for(;p===Mh;)f=f&&f.nextSibling,p=f&&this.mirror.getId(f);return p},o=c=>{const f=rt.parentNode(c);if(!f||!FB(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=lh(f)?this.mirror.getId(UB(c)):this.mirror.getId(f),m=s(c);if(g===-1||m===-1)return r.addNode(c);const y=wc(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=>{DB(S,this.mirror)&&this.iframeManager.addIframe(S),LB(S,this.mirror)&&this.stylesheetManager.trackLinkElement(S),nA(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)O4(this.removesSubTreeCache,c,this.mirror)&&!this.movedSet.has(rt.parentNode(c))||o(c);for(const c of this.addedSet)!N4(this.droppedSet,c)&&!O4(this.removesSubTreeCache,c,this.mirror)||N4(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=jv({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Hv(e),value:r,maskInputFn:this.maskInputFn})}),Se(this,"processMutation",e=>{if(!h_(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const n=rt.textContent(e.target);!Er(e.target,this.blockClass,this.blockSelector,!1)&&n!==e.oldValue&&this.texts.push({value:lz(e.target,this.maskTextClass,this.maskTextSelector,!0)&&n?this.maskTextFn?this.maskTextFn(n,PB(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=Hv(n);s=jv({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:a,value:s,maskInputFn:this.maskInputFn})}if(Er(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"),!az(n.tagName,r))if(o.attributes[r]=iz(this.doc,Wl(n.tagName),Wl(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(Er(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=lh(e.target)?this.mirror.getId(rt.host(e.target)):this.mirror.getId(e.target);Er(e.target,this.blockClass,this.blockSelector,!1)||h_(n,this.mirror,this.slimDOMOptions)||!nSe(n,this.mirror)||(this.addedSet.has(n)?(rA(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(e.target)&&r===-1||kB(e.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[I4(r,s)]?rA(this.movedSet,n):(this.removes.push({parentId:s,id:r,isShadow:lh(e.target)&&uh(e.target)?!0:void 0}),uSe(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(h_(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[I4(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Er(e,this.blockClass,this.blockSelector,!1)||(rt.childNodes(e).forEach(r=>this.genAdds(r)),nA(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 rA(t,e){t.delete(e),rt.childNodes(e).forEach(n=>rA(t,n))}function uSe(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 O4(t,e,n){return t.size===0?!1:cSe(t,e)}function cSe(t,e,n){const r=rt.parentNode(e);return r?t.has(r):!1}function N4(t,e){return t.size===0?!1:BB(t,e)}function BB(t,e){const n=rt.parentNode(e);return n?t.has(n)?!0:BB(t,n):!1}let ch;function dSe(t){ch=t}function fSe(){ch=void 0}const vt=t=>ch?(...n)=>{try{return t(...n)}catch(r){if(ch&&ch(r)===!0)return;throw r}}:t,Tl=[];function cp(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 jB(t,e){const n=new lSe;Tl.push(n),n.init(t);const r=new(IB())(vt(n.processMutations.bind(n)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function hSe({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=jh(vt(g=>{const m=Date.now()-u;t(a.map(y=>(y.timeOffset-=m,y)),g),a=[],u=null}),o),f=vt(jh(vt(g=>{const m=cp(g),{clientX:y,clientY:S}=tA(g)?g.changedTouches[0]:g;u||(u=Jv()),a.push({x:y,y:S,id:r.getId(m),timeOffset:Jv()-u}),c(typeof DragEvent<"u"&&g instanceof DragEvent?ft.Drag:g instanceof MouseEvent?ft.MouseMove:ft.TouchMove)}),s,{trailing:!1})),p=[Sr("mousemove",f,n),Sr("touchmove",f,n),Sr("drag",f,n)];return vt(()=>{p.forEach(g=>g())})}function pSe({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=cp(g);if(Er(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?kr[p]===kr.MouseDown?S="TouchStart":kr[p]===kr.MouseUp&&(S="TouchEnd"):si.Pen}else tA(g)&&(y=si.Touch);y!==null?(c=y,(S.startsWith("Touch")&&y===si.Touch||S.startsWith("Mouse")&&y===si.Mouse)&&(y=null)):kr[p]===kr.Click&&(y=c,c=null);const E=tA(g)?g.changedTouches[0]:g;if(!E)return;const C=n.getId(m),{clientX:w,clientY:x}=E;vt(t)({type:kr[S],id:C,x:w,y:x,...y!==null&&{pointerType:y}})};return Object.keys(kr).filter(p=>Number.isNaN(Number(p))&&!p.endsWith("_Departed")&&a[p]!==!1).forEach(p=>{let g=Wl(p);const m=f(p);if(window.PointerEvent)switch(kr[p]){case kr.MouseDown:case kr.MouseUp:g=g.replace("mouse","pointer");break;case kr.TouchStart:case kr.TouchEnd:return}u.push(Sr(g,m,e))}),vt(()=>{u.forEach(p=>p())})}function HB({scrollCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,sampling:o}){const a=vt(jh(vt(u=>{const c=cp(u);if(!c||Er(c,r,s,!0))return;const f=n.getId(c);if(c===e&&e.defaultView){const p=OB(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 Sr("scroll",a,e)}function gSe({viewportResizeCb:t},{win:e}){let n=-1,r=-1;const s=vt(jh(vt(()=>{const o=NB(),a=MB();(n!==o||r!==a)&&(t({width:Number(a),height:Number(o)}),n=o,r=a)}),200));return Sr("resize",s,e)}const mSe=["INPUT","TEXTAREA","SELECT"],M4=new WeakMap;function vSe({inputCb:t,doc:e,mirror:n,blockClass:r,blockSelector:s,ignoreClass:o,ignoreSelector:a,maskInputOptions:u,maskInputFn:c,sampling:f,userTriggeredOnInput:p}){function g(x){let T=cp(x);const R=x.isTrusted,M=T&&T.tagName;if(T&&M==="OPTION"&&(T=rt.parentElement(T)),!T||!M||mSe.indexOf(M)<0||Er(T,r,s,!0)||T.classList.contains(o)||a&&T.matches(a))return;let O=T.value,I=!1;const P=Hv(T)||"";P==="radio"||P==="checkbox"?I=T.checked:(u[M.toLowerCase()]||u[P])&&(O=jv({element:T,maskInputOptions:u,tagName:M,type:P,value:O,maskInputFn:c})),m(T,p?{text:O,isChecked:I,userTriggered:R}:{text:O,isChecked:I});const k=T.name;P==="radio"&&k&&I&&e.querySelectorAll(`input[type="radio"][name="${k}"]`).forEach(H=>{if(H!==T){const F=H.value;m(H,p?{text:F,isChecked:!I,userTriggered:!1}:{text:F,isChecked:!I})}})}function m(x,T){const R=M4.get(x);if(!R||R.text!==T.text||R.isChecked!==T.isChecked){M4.set(x,T);const M=n.getId(x);vt(t)({...T,id:M})}}const S=(f.input==="last"?["change"]:["input","change"]).map(x=>Sr(x,vt(g),e)),E=e.defaultView;if(!E)return()=>{S.forEach(x=>x())};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(x=>wb(x[0],x[1],{set(){vt(g)({target:this,isTrusted:!1})}},!1,E))),vt(()=>{S.forEach(x=>x())})}function ey(t){const e=[];function n(r,s){if(Nm("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Nm("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Nm("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Nm("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 ySe({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={};Mm("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(Mm("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),Mm("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),Mm("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:x}=ba(y.parentStyleSheet,e,n.styleMirror);return(w&&w!==-1||x&&x!==-1)&&t({id:w,styleId:x,adds:[{rule:E,index:[...ey(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:[...ey(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 $B({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 bSe({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:ey(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:ey(c.parentRule)}),u.apply(c,f)})}),vt(()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=a})}function SSe({mediaInteractionCb:t,blockClass:e,blockSelector:n,mirror:r,sampling:s,doc:o}){const a=vt(c=>jh(vt(f=>{const p=cp(f);if(!p||Er(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=[Sr("play",a(pc.Play),o),Sr("pause",a(pc.Pause),o),Sr("seeked",a(pc.Seeked),o),Sr("volumechange",a(pc.VolumeChange),o),Sr("ratechange",a(pc.RateChange),o)];return vt(()=>{u.forEach(c=>c())})}function ESe({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=lu(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 CSe(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;Er(y,r,s,!0)||Er(E,r,s,!0)||f.push({start:n.getId(y),startOffset:S,end:n.getId(E),endOffset:C})}o({ranges:f})});return u(),Sr("selectionchange",u)}function wSe({doc:t,customElementCb:e}){const n=t.defaultView;return!n||!n.customElements?()=>{}:lu(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 _Se(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 xSe(t,e={}){const n=t.doc.defaultView;if(!n)return()=>{};_Se(t,e);let r;t.recordDOM&&(r=jB(t,t.doc));const s=hSe(t),o=pSe(t),a=HB(t),u=gSe(t,{win:n}),c=vSe(t),f=SSe(t);let p=()=>{},g=()=>{},m=()=>{},y=()=>{};t.recordDOM&&(p=ySe(t,{win:n}),g=$B(t,t.doc),m=bSe(t,{win:n}),t.collectFonts&&(y=ESe(t)));const S=CSe(t),E=wSe(t),C=[];for(const w of t.plugins)C.push(w.observer(w.callback,n,w.options));return vt(()=>{Tl.forEach(w=>w.reset()),r?.disconnect(),s(),o(),a(),u(),c(),f(),p(),g(),m(),y(),S(),E(),C.forEach(w=>w())})}function Nm(t){return typeof window[t]<"u"}function Mm(t){return!!(typeof window[t]<"u"&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class P4{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 ASe{constructor(e){Se(this,"iframes",new WeakMap),Se(this,"crossOriginIframeMap",new WeakMap),Se(this,"crossOriginIframeMirror",new P4(oz)),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 P4(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!==zB.Document&&!e.rootId&&(e.rootId=n),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class TSe{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(!uh(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=jB({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(HB({...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($B({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(lu(e.prototype,"attachShadow",function(s){return function(o){const a=s.call(this,o),u=rt.shadowRoot(this);return u&&FB(this)&&r.addShadowRoot(u,n),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var _c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",RSe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Pm=0;Pm<_c.length;Pm++)RSe[_c.charCodeAt(Pm)]=Pm;var ISe=function(t){var e=new Uint8Array(t),n,r=e.length,s="";for(n=0;n<r;n+=3)s+=_c[e[n]>>2],s+=_c[(e[n]&3)<<4|e[n+1]>>4],s+=_c[(e[n+1]&15)<<2|e[n+2]>>6],s+=_c[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 k4=new Map;function OSe(t,e){let n=k4.get(t);return n||(n=new Map,k4.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}const qB=(t,e,n)=>{if(!t||!(GB(t,e)||typeof t=="object"))return;const r=t.constructor.name,s=OSe(n,r);let o=s.indexOf(t);return o===-1&&(o=s.length,s.push(t)),o};function cv(t,e,n){if(t instanceof Array)return t.map(r=>cv(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=ISe(t);return{rr_type:r,base64:s}}else{if(t instanceof DataView)return{rr_type:t.constructor.name,args:[cv(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:[cv(t.data,e,n),t.width,t.height]};if(GB(t,e)||typeof t=="object"){const r=t.constructor.name,s=qB(t,e,n);return{rr_type:r,index:s}}}}return t}const WB=(t,e,n)=>t.map(r=>cv(r,e,n)),GB=(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 NSe(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=lu(e.CanvasRenderingContext2D.prototype,a,function(c){return function(...f){return Er(this.canvas,n,r,!0)||setTimeout(()=>{const p=WB(f,e,this);t(this.canvas,{type:Wc["2D"],property:a,args:p})},0),c.apply(this,f)}});s.push(u)}catch{const u=wb(e.CanvasRenderingContext2D.prototype,a,{set(c){t(this.canvas,{type:Wc["2D"],property:a,args:[c],setter:!0})}});s.push(u)}return()=>{s.forEach(a=>a())}}function MSe(t){return t==="experimental-webgl"?"webgl":t}function D4(t,e,n,r){const s=[];try{const o=lu(t.HTMLCanvasElement.prototype,"getContext",function(a){return function(u,...c){if(!Er(this,e,n,!0)){const f=MSe(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 L4(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=lu(t,c,function(p){return function(...g){const m=p.apply(this,g);if(qB(m,o,this),"tagName"in this.canvas&&!Er(this.canvas,r,s,!0)){const y=WB(g,o,this),S={type:e,property:c,args:y};n(this.canvas,S)}return m}});a.push(f)}catch{const f=wb(t,c,{set(p){n(this.canvas,{type:e,property:c,args:[p],setter:!0})}});a.push(f)}return a}function PSe(t,e,n,r){const s=[];return s.push(...L4(e.WebGLRenderingContext.prototype,Wc.WebGL,t,n,r,e)),typeof e.WebGL2RenderingContext<"u"&&s.push(...L4(e.WebGL2RenderingContext.prototype,Wc.WebGL2,t,n,r,e)),()=>{s.forEach(o=>o())}}const VB="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",kSe=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0)),U4=typeof window<"u"&&window.Blob&&new Blob([kSe(VB)],{type:"text/javascript;charset=utf-8"});function DSe(t){let e;try{if(e=U4&&(window.URL||window.webkitURL).createObjectURL(U4),!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,"+VB,{name:t?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class LSe{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=D4(n,r,s,!0),u=new Map,c=new DSe;c.onmessage=S=>{const{id:E}=S.data;if(u.set(E,!1),!("base64"in S.data))return;const{base64:C,type:w,width:x,height:T}=S.data;this.mutationCb({id:E,type:Wc["2D"],commands:[{property:"clearRect",args:[0,0,x,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=>{Er(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 x=await createImageBitmap(E);c.postMessage({id:w,bitmap:x,width:E.width,height:E.height,dataURLOptions:o.dataURLOptions},[x])}),g=requestAnimationFrame(y)};g=requestAnimationFrame(y),this.resetObservers=()=>{a(),cancelAnimationFrame(g)}}initCanvasMutationObserver(e,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=D4(e,n,r,!1),o=NSe(this.processMutation.bind(this),e,n,r),a=PSe(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 USe{constructor(e){Se(this,"trackedLinkElements",new WeakSet),Se(this,"mutationCb"),Se(this,"adoptedStyleSheetCb"),Se(this,"styleMirror",new sSe),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:nz(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 FSe{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,dv,p_,ty=!1;try{if(Array.from([1],t=>t*2)[0]!==2){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=((BU=t.contentWindow)==null?void 0:BU.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}const js=Bve();function dp(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:x={},dataURLOptions:T={},mousemoveWait:R,recordDOM:M=!0,recordCanvas:O=!1,recordCrossOriginIframes:I=!1,recordAfter:P=t.recordAfter==="DOMContentLoaded"?t.recordAfter:"load",userTriggeredOnInput:k=!1,collectFonts:H=!1,inlineImages:F=!1,plugins:B,keepIframeSrcFn:W=()=>!1,ignoreCSSAttributes:Y=new Set([]),errorHandler:ne}=t;dSe(ne);const $=I?window.parent===window:!0;let ee=!1;if(!$)try{window.parent.document&&(ee=!1)}catch{ee=!0}if($&&!e)throw new Error("emit function is required");if(!$&&!ee)return()=>{};R!==void 0&&x.mousemove===void 0&&(x.mousemove=R),js.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=uz(y);rSe();let Ae,L=0;const V=Ee=>{for(const pt of B||[])pt.eventProcessor&&(Ee=pt.eventProcessor(Ee));return w&&!ee&&(Ee=w(Ee)),Ee};gn=(Ee,pt)=>{var Ce;const ze=Ee;if(ze.timestamp=Jv(),(Ce=Tl[0])!=null&&Ce.isFrozen()&&ze.type!==Ct.FullSnapshot&&!(ze.type===Ct.IncrementalSnapshot&&ze.data.source===ft.Mutation)&&Tl.forEach(Be=>Be.unfreeze()),$)e?.(V(ze),pt);else if(ee){const Be={type:"rrweb",event:V(ze),origin:window.location.origin,isCheckout:pt};window.parent.postMessage(Be,"*")}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 Be=r&&L>=r,He=n&&ze.timestamp-Ae.timestamp>n;(Be||He)&&dv(!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 USe({mutationCb:K,adoptedStyleSheetCb:he}),ve=new ASe({mirror:js,mutationCb:K,stylesheetManager:ue,recordCrossOriginIframes:I,wrappedEmit:gn});for(const Ee of B||[])Ee.getMirror&&Ee.getMirror({nodeMirror:js,crossOriginIframeMirror:ve.crossOriginIframeMirror,crossOriginIframeStyleMirror:ve.crossOriginIframeStyleMirror});const _e=new FSe;p_=new LSe({recordCanvas:O,mutationCb:oe,win:window,blockClass:s,blockSelector:o,mirror:js,sampling:x.canvas,dataURLOptions:T});const Xe=new TSe({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:F,sampling:x,slimDOMOptions:de,iframeManager:ve,stylesheetManager:ue,canvasManager:p_,keepIframeSrcFn:W,processedNodeManager:_e},mirror:js});dv=(Ee=!1)=>{if(!M)return;gn({type:Ct.Meta,data:{href:window.location.href,width:MB(),height:NB()}},Ee),ue.reset(),Xe.init(),Tl.forEach(Ce=>Ce.lock());const pt=cye(document,{mirror:js,blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:f,inlineStylesheet:p,maskAllInputs:fe,maskTextFn:E,maskInputFn:S,slimDOM:de,dataURLOptions:T,recordCanvas:O,inlineImages:F,onSerialize:Ce=>{DB(Ce,js)&&ve.addIframe(Ce),LB(Ce,js)&&ue.trackLinkElement(Ce),nA(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:W});if(!pt)return console.warn("Failed to snapshot the document");gn({type:Ct.FullSnapshot,data:{node:pt,initialOffset:OB(window)}},Ee),Tl.forEach(Ce=>Ce.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ue.adoptStyleSheets(document.adoptedStyleSheets,js.getId(document))};try{const Ee=[],pt=ze=>{var Be;return vt(xSe)({mutationCb:K,mousemoveCb:(He,pr)=>gn({type:Ct.IncrementalSnapshot,data:{source:pr,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:x,recordDOM:M,recordCanvas:O,inlineImages:F,userTriggeredOnInput:k,collectFonts:H,doc:ze,maskInputFn:S,maskTextFn:E,keepIframeSrcFn:W,blockSelector:o,slimDOMOptions:de,dataURLOptions:T,mirror:js,iframeManager:ve,stylesheetManager:ue,shadowDomManager:Xe,processedNodeManager:_e,canvasManager:p_,ignoreCSSAttributes:Y,plugins:((Be=B?.filter(He=>He.observer))==null?void 0:Be.map(He=>({observer:He.observer,options:He.options,callback:pr=>gn({type:Ct.Plugin,data:{plugin:He.name,payload:pr}})})))||[]},C)};ve.addLoadListener(ze=>{try{Ee.push(pt(ze.contentDocument))}catch(Be){console.warn(Be)}});const Ce=()=>{dv(),Ee.push(pt(document)),ty=!0};return["interactive","complete"].includes(document.readyState)?Ce():(Ee.push(Sr("DOMContentLoaded",()=>{gn({type:Ct.DomContentLoaded,data:{}}),P==="DOMContentLoaded"&&Ce()})),Ee.push(Sr("load",()=>{gn({type:Ct.Load,data:{}}),P==="load"&&Ce()},window))),()=>{Ee.forEach(ze=>{try{ze()}catch(Be){String(Be).toLowerCase().includes("cross-origin")||console.warn(Be)}}),_e.destroy(),ty=!1,fSe()}}catch(Ee){console.warn(Ee)}}dp.addCustomEvent=(t,e)=>{if(!ty)throw new Error("please add custom event after start recording");gn({type:Ct.Custom,data:{tag:t,payload:e}})};dp.freezePage=()=>{Tl.forEach(t=>t.freeze())};dp.takeFullSnapshot=t=>{if(!ty)throw new Error("please take full snapshot after start recording");dv(t)};dp.mirror=js;var F4;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(F4||(F4={}));const zSe="rrweb",BSe={maskAllInputs:!0,maskTextSelector:"*",maskInputOptions:void 0},jSe={additionalSampleRate:1,batchSize:50,flushInterval:5e3,recordOptions:{slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,recordCrossOriginIframes:!1}},z4=jSe;class HSe extends Os{constructor(e){super(zSe),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({},z4.recordOptions),e?.recordOptions),BSe);this.config=Object.assign(Object.assign(Object.assign({},z4),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=dp(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(_U,n),be.info("RRWebPlugin events sent to RUM",{eventType:_U,eventCount:this.recordingEvents.length}),this.recordingEvents=[]}}var $Se=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},sA;(function(t){t.Path="PATH",t.Hash="HASH",t.PathAndHash="PATH_AND_HASH"})(sA||(sA={}));const KB="us-west-2",oA=`https://dataplane.rum.${KB}.amazonaws.com`,YB=()=>({unique:!1,domain:window.location.hostname,path:"/",sameSite:"Strict",secure:!0}),ZB=t=>({allowCookies:!1,batchLimit:100,client:hge,compressionStrategy:{enabled:!0},cookieAttributes:t,debug:!1,disableAutoPageView:!1,dispatchInterval:5*1e3,enableRumClient:!0,enableXRay:!1,endpoint:oA,endpointUrl:new URL(oA),eventCacheSize:1e3,eventPluginsToLoad:[],pageIdFormat:sA.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 qSe=class{constructor(e,n,r,s={}){var{cookieAttributes:o}=s,a=$Se(s,["cookieAttributes"]);this.eventBus=new B7,typeof r>"u"&&(r="us-west-2"),this.applicationId=e;const u=Object.assign(Object.assign({},YB()),o);this.config=Object.assign(Object.assign({fetchFunction:fetch},ZB(u)),a),this.config.sessionId&&(this.config.suppressSessionStartEvent=!0),this.config.endpoint=a.endpoint?a.endpoint:oA.replace(KB,r),this.config.endpointUrl=new URL(this.config.endpoint),be.configure(this.config.debug),be.info("Initialized RUM Slim"),this.eventCache=new _me({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;[kv,Dv,Fc,`${kv}_${this.applicationId}`,`${Dv}_${this.applicationId}`,`${Fc}_${this.applicationId}`].forEach(r=>mme(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 pge(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 gme(r);return this.config.disableAutoPageView||s.addPlugin(new Hme),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 B4;(function(t){t.Path="PATH",t.Hash="HASH",t.PathAndHash="PATH_AND_HASH"})(B4||(B4={}));const WSe=t=>Object.assign(Object.assign({},ZB(t)),{signing:!0,telemetries:[Ks.Errors,Ks.Performance,Ks.Http,Ks.Replay]});class GSe extends qSe{constructor(e,n,r,s={}){super(e,n,r,Object.assign(Object.assign({},WSe(YB())),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($ge),r.setCognitoCredentialProviderFactory((s,o,a,u)=>{const c={identityPoolId:a,guestRoleArn:u,cookieAttributes:s.cookieAttributes};return a&&u?new ome(c,o).ChainAnonymousCredentialsProvider:new ime(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($7,e)}registerDomEvents(e){this.pluginManager.updatePlugin(j7,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 Dme(e)],[Ks.Performance]:e=>[new Fme(e),new qme(e),new cve(e)],[Ks.Interaction]:e=>[new iR(e)],[Ks.Http]:e=>[new gve(e),new fve(e)],[Ks.Replay]:e=>[new HSe(e)]}}}const XB={recordPageView:()=>{},recordError:()=>{},recordEvent:()=>{},recordTiming:()=>{}},VSe=/([?&](token|access_token|id_token|authorization)=[^&]*)|\/messages\/[a-z0-9_-]+/gi;function QB(t){return t.replace(VSe,"[redacted]")}function KSe(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 QB(t.slice(0,r))}function YSe(t){const e=QB(t.message);if(e===t.message)return t;const n=new Error(e);return n.name=t.name,n.stack=t.stack,n}function ZSe(t){return{recordPageView(e){t.recordPageView(KSe(e))},recordError(e,n){t.recordError(YSe(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 j4(t){return t instanceof Error?t:new Error(String(t))}function XSe(t){window.addEventListener("error",e=>{t.recordError(j4(e.error??e.message))}),window.addEventListener("unhandledrejection",e=>{t.recordError(j4(e.reason))})}function QSe(){const{appMonitorId:t,identityPoolId:e,region:n}=Cy().rum;if(!t)return XB;const r=new GSe(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=ZSe(r);return XSe(s),s}const JB=A.createContext(XB);function pAe(){return A.useContext(JB)}const iA="remit.theme",JSe="dark";function H4(){return typeof localStorage>"u"?"system":localStorage.getItem(iA)??"system"}function aA(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(JSe,e)}function gAe(t){typeof localStorage<"u"&&(t==="system"?localStorage.removeItem(iA):localStorage.setItem(iA,t)),aA(t)}const eEe=()=>{if(typeof window>"u"||(aA(H4()),typeof window.matchMedia!="function"))return;const t=window.matchMedia("(prefers-color-scheme: dark)"),e=()=>{aA(H4())};typeof t.addEventListener=="function"?t.addEventListener("change",e):t.addListener(e)},tEe=(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);Ll(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),t?.services?.logger?.warn?t.services.logger.warn(...s):console?.warn&&console.warn(...s)},$4={},lA=(t,e,n,r)=>{Ll(n)&&$4[n]||(Ll(n)&&($4[n]=new Date),tEe(t,e,n,r))},ej=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},uA=(t,e,n)=>{t.loadNamespaces(e,ej(t,n))},q4=(t,e,n,r)=>{if(Ll(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return uA(t,n,r);n.forEach(s=>{t.options.ns.indexOf(s)<0&&t.options.ns.push(s)}),t.loadLanguages(e,ej(t,r))},nEe=(t,e,n={})=>!e.languages||!e.languages.length?(lA(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}}),Ll=t=>typeof t=="string",rEe=t=>typeof t=="object"&&t!==null,sEe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,oEe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},iEe=t=>oEe[t],aEe=t=>t.replace(sEe,iEe);let cA={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:aEe};const lEe=(t={})=>{cA={...cA,...t}},uEe=()=>cA;let tj;const cEe=t=>{tj=t},dEe=()=>tj,fEe={type:"3rdParty",init(t){lEe(t.options.react),cEe(t)}},hEe=A.createContext();class pEe{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const gEe=(t,e)=>{const n=A.useRef();return A.useEffect(()=>{n.current=t},[t,e]),n.current},nj=(t,e,n,r)=>t.getFixedT(e,n,r),mEe=(t,e,n,r)=>A.useCallback(nj(t,e,n,r),[t,e,n,r]),vEe=(t,e={})=>{const{i18n:n}=e,{i18n:r,defaultNS:s}=A.useContext(hEe)||{},o=n||r||dEe();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new pEe),!o){lA(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const R=(O,I)=>Ll(I)?I:rEe(I)&&Ll(I.defaultValue)?I.defaultValue:Array.isArray(O)?O[O.length-1]:O,M=[R,{},!1];return M.t=R,M.i18n={},M.ready=!1,M}o.options.react?.wait&&lA(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...uEe(),...o.options.react,...e},{useSuspense:u,keyPrefix:c}=a;let f=t||s||o.options?.defaultNS;f=Ll(f)?[f]:f||["translation"],o.reportNamespaces.addUsedNamespaces?.(f);const p=(o.isInitialized||o.initializedStoreOnce)&&f.every(R=>nEe(R,o,a)),g=mEe(o,e.lng||null,a.nsMode==="fallback"?f:f[0],c),m=()=>g,y=()=>nj(o,e.lng||null,a.nsMode==="fallback"?f:f[0],c),[S,E]=A.useState(m);let C=f.join();e.lng&&(C=`${e.lng}${C}`);const w=gEe(C),x=A.useRef(!0);A.useEffect(()=>{const{bindI18n:R,bindI18nStore:M}=a;x.current=!0,!p&&!u&&(e.lng?q4(o,e.lng,f,()=>{x.current&&E(y)}):uA(o,f,()=>{x.current&&E(y)})),p&&w&&w!==C&&x.current&&E(y);const O=()=>{x.current&&E(y)};return R&&o?.on(R,O),M&&o?.store.on(M,O),()=>{x.current=!1,o&&R&&R?.split(" ").forEach(I=>o.off(I,O)),M&&o&&M.split(" ").forEach(I=>o.store.off(I,O))}},[o,C]),A.useEffect(()=>{x.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?q4(o,e.lng,f,()=>R()):uA(o,f,()=>R())})},yEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts",...t,headers:{"Content-Type":"application/json",...t.headers}}),bEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/oauth/microsoft/start",...t,headers:{"Content-Type":"application/json",...t.headers}}),SEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/test-connection",...t,headers:{"Content-Type":"application/json",...t.headers}}),EEe=t=>(t.client??Ze).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}",...t}),CEe=t=>(t.client??Ze).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),wEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters",...t}),_Ee=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters",...t,headers:{"Content-Type":"application/json",...t.headers}}),xEe=t=>(t.client??Ze).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/filters/{filterId}",...t}),AEe=t=>(t.client??Ze).put({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/folder-roles/{role}",...t,headers:{"Content-Type":"application/json",...t.headers}}),TEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/mailboxes",...t}),REe=t=>(t.client??Ze).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/mailboxes/{mailboxId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),IEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize",...t,headers:{"Content-Type":"application/json",...t.headers}}),OEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize/preview",...t,headers:{"Content-Type":"application/json",...t.headers}}),NEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/organize/{organizeJobId}",...t}),MEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/sync",...t}),PEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/accounts/{accountId}/sync/status",...t}),kEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/addresses/search",...t}),DEe=t=>(t.client??Ze).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/addresses/{addressId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),LEe=t=>(t?.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/config",...t}),mAe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/mailboxes/{mailboxId}/threads",...t}),UEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/mailboxes/{mailboxId}/threads/search",...t}),FEe=t=>(t.client??Ze).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/me",...t,headers:{"Content-Type":"application/json",...t.headers}}),zEe=t=>(t?.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/me/export",...t}),BEe=t=>(t?.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/me/vip-suggestions",...t}),jEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/delete",...t,headers:{"Content-Type":"application/json",...t.headers}}),HEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/flags",...t,headers:{"Content-Type":"application/json",...t.headers}}),$Ee=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/move",...t,headers:{"Content-Type":"application/json",...t.headers}}),qEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}",...t}),WEe=t=>(t.client??Ze).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}/flags",...t,headers:{"Content-Type":"application/json",...t.headers}}),GEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/messages/{messageId}/raw",...t}),VEe=t=>(t?.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox",...t}),KEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox",...t,headers:{"Content-Type":"application/json",...t.headers}}),YEe=t=>(t.client??Ze).delete({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t}),ZEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t}),XEe=t=>(t.client??Ze).patch({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}",...t,headers:{"Content-Type":"application/json",...t.headers}}),QEe=t=>(t.client??Ze).post({security:[{name:"Authorization",type:"apiKey"}],url:"/outbox/{outboxMessageId}/send",...t}),JEe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/search/semantic",...t}),eCe=t=>(t?.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/threads",...t}),tCe=t=>(t.client??Ze).get({security:[{name:"Authorization",type:"apiKey"}],url:"/threads/{threadId}/messages",...t}),vAe=t=>({mutationFn:async n=>{const{data:r}=await yEe({...t,...n,throwOnError:!0});return r}}),fr=(t,e,n,r)=>{const s={_id:t,baseUrl:e?.baseUrl||(e?.client??Ze).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]},yAe=t=>({mutationFn:async n=>{const{data:r}=await bEe({...t,...n,throwOnError:!0});return r}}),bAe=t=>({mutationFn:async n=>{const{data:r}=await SEe({...t,...n,throwOnError:!0});return r}}),SAe=t=>({mutationFn:async n=>{const{data:r}=await EEe({...t,...n,throwOnError:!0});return r}}),EAe=t=>({mutationFn:async n=>{const{data:r}=await CEe({...t,...n,throwOnError:!0});return r}}),nCe=t=>fr("filterOperationsListFilters",t),CAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await wEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:nCe(t)}),wAe=t=>({mutationFn:async n=>{const{data:r}=await _Ee({...t,...n,throwOnError:!0});return r}}),_Ae=t=>({mutationFn:async n=>{const{data:r}=await xEe({...t,...n,throwOnError:!0});return r}}),xAe=t=>({mutationFn:async n=>{const{data:r}=await AEe({...t,...n,throwOnError:!0});return r}}),rCe=t=>fr("mailboxOperationsListMailboxes",t),AAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await TEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:rCe(t)}),TAe=t=>({mutationFn:async n=>{const{data:r}=await REe({...t,...n,throwOnError:!0});return r}}),RAe=t=>({mutationFn:async n=>{const{data:r}=await IEe({...t,...n,throwOnError:!0});return r}}),IAe=t=>({mutationFn:async n=>{const{data:r}=await OEe({...t,...n,throwOnError:!0});return r}}),sCe=t=>fr("organizeJobDetailOperationsGetOrganizeJob",t),OAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await NEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:sCe(t)}),NAe=t=>({mutationFn:async n=>{const{data:r}=await MEe({...t,...n,throwOnError:!0});return r}}),oCe=t=>fr("syncOperationsGetSyncStatus",t),MAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await PEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:oCe(t)}),iCe=t=>fr("addressOperationsSearchAddresses",t),PAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await kEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:iCe(t)}),kAe=t=>({mutationFn:async n=>{const{data:r}=await DEe({...t,...n,throwOnError:!0});return r}}),aCe=t=>fr("configOperationsGetConfig",t),lCe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await LEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:aCe(t)}),DAe=t=>fr("threadOperationsListThreads",t),uCe=t=>fr("threadOperationsSearchThreads",t),LAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await UEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:uCe(t)}),UAe=t=>({mutationFn:async n=>{const{data:r}=await FEe({...t,...n,throwOnError:!0});return r}}),FAe=t=>({mutationFn:async n=>{const{data:r}=await zEe({...t,...n,throwOnError:!0});return r}}),cCe=t=>fr("meOperationsListVipSuggestions",t),zAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await BEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:cCe(t)}),BAe=t=>({mutationFn:async n=>{const{data:r}=await jEe({...t,...n,throwOnError:!0});return r}}),jAe=t=>({mutationFn:async n=>{const{data:r}=await HEe({...t,...n,throwOnError:!0});return r}}),HAe=t=>({mutationFn:async n=>{const{data:r}=await $Ee({...t,...n,throwOnError:!0});return r}}),dCe=t=>fr("messageOperationsDescribeMessage",t),$Ae=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await qEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:dCe(t)}),qAe=t=>({mutationFn:async n=>{const{data:r}=await WEe({...t,...n,throwOnError:!0});return r}}),fCe=t=>fr("messageOperationsGetRawMessage",t),WAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await GEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:fCe(t)}),rj=t=>fr("outboxOperationsListOutboxMessages",t),GAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await VEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:rj(t)}),VAe=t=>({mutationFn:async n=>{const{data:r}=await KEe({...t,...n,throwOnError:!0});return r}}),KAe=t=>({mutationFn:async n=>{const{data:r}=await YEe({...t,...n,throwOnError:!0});return r}}),hCe=t=>fr("outboxDetailOperationsGetOutboxMessage",t),pCe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await ZEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:hCe(t)}),YAe=t=>({mutationFn:async n=>{const{data:r}=await XEe({...t,...n,throwOnError:!0});return r}}),ZAe=t=>({mutationFn:async n=>{const{data:r}=await QEe({...t,...n,throwOnError:!0});return r}}),gCe=t=>fr("semanticSearchOperationsSemanticSearch",t),XAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await JEe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:gCe(t)}),mCe=t=>fr("unifiedThreadOperationsListAllThreads",t),vCe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await eCe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:mCe(t)}),yCe=t=>fr("threadDetailOperationsListThreadMessages",t),QAe=t=>({queryFn:async({queryKey:e,signal:n})=>{const{data:r}=await tCe({...t,...e[0],signal:n,throwOnError:!0});return r},queryKey:yCe(t)}),sj=A.createContext(void 0),W4={isOpen:!1,mode:"new"},bCe=2e3,SCe=6e4,ECe=({children:t})=>{const[e,n]=A.useState(W4),[r,s]=A.useState(),o=A.useRef(0),a=DF(),{data:u}=ufe({...pCe({path:{outboxMessageId:r??""}}),enabled:!!r,refetchInterval:y=>{const S=y.state.data?.status;return S==="sent"||S==="failed"||S==="blocked"||Date.now()-o.current>SCe?!1:bCe}});A.useEffect(()=>{if(!u||!r)return;(u.status==="sent"||u.status==="failed"||u.status==="blocked")&&(s(void 0),a.invalidateQueries({queryKey:rj()}))},[u,r,a]);const c=A.useCallback(y=>{n({...y,isOpen:!0})},[]),f=A.useCallback(()=>{n(W4)},[]),p=A.useCallback(y=>{n(S=>({...S,outboxMessageId:y}))},[]),g=A.useCallback(y=>{o.current=Date.now(),s(y)},[]),m=A.useMemo(()=>({state:e,openCompose:c,closeCompose:f,setOutboxMessageId:p,startSendPolling:g}),[e,c,f,p,g]);return D.jsx(sj.Provider,{value:m,children:t})},JAe=()=>{const t=A.useContext(sj);if(!t)throw new Error("useCompose must be used within a ComposeProvider");return t},g_=(...t)=>e8(K5(t)),CCe={error:{container:"border-danger/50 bg-danger/10 dark:bg-danger/20",icon:"text-danger",title:"text-danger"},warning:{container:"border-warning/50 bg-warning/10",icon:"text-warning",title:"text-warning"},info:{container:"border-accent-2/50 bg-accent-2-soft",icon:"text-accent-2",title:"text-accent-2"}},wCe={error:LZ,warning:$Z,info:BZ},_Ce={error:"Error",warning:"Warning",info:"Information"},xCe=({id:t,severity:e,title:n,detail:r,onDismiss:s})=>{const o=CCe[e],a=wCe[e];return D.jsxs("div",{role:e==="error"?"alert":"status","aria-live":e==="error"?"assertive":"polite",className:g_("pointer-events-auto flex items-start gap-3 rounded-md border bg-canvas/80 px-3 py-2 shadow-md backdrop-blur",o.container),children:[D.jsx(a,{className:g_("size-5 shrink-0 mt-0.5",o.icon),"aria-hidden":"true"}),D.jsxs("div",{className:"flex-1 min-w-0",children:[D.jsx("p",{className:g_("text-sm font-medium",o.title),children:n}),r&&D.jsx("p",{className:"mt-0.5 text-xs text-fg-muted break-words",children:r})]}),D.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 ${_Ce[e].toLowerCase()}`,children:D.jsx(ph,{className:"size-4","aria-hidden":"true"})})]})},ACe=({errors:t,onDismiss:e})=>t.length===0?null:D.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:D.jsx("div",{className:"flex w-full max-w-md flex-col gap-2",children:t.map(n=>D.jsx(xCe,{id:n.id,severity:n.severity,title:n.title,detail:n.detail,onDismiss:e},n.id))})}),G4=5,eTe=(t,e,n)=>({title:t,detail:oj(n)??e}),oj=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}},tTe=t=>{const e=oj(t);return e?e.startsWith("Message not found"):!1},TCe=(t,e,n)=>t.severity===n&&t.title===e.title&&t.detail===e.detail,RCe=(t,e)=>{const r=[...t.filter(s=>!TCe(s,{title:e.title,detail:e.detail,severity:e.severity},e.severity)),e];return r.length<=G4?r:r.slice(r.length-G4)},ICe=(t,e)=>t.filter(n=>n.id!==e),OCe=(t,e,n)=>({id:e,severity:t.severity??"error",title:t.title,detail:t.detail,createdAt:n}),ij=A.createContext(void 0),NCe=()=>typeof globalThis.crypto<"u"&&typeof globalThis.crypto.randomUUID=="function"?globalThis.crypto.randomUUID():`banner-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,MCe=({children:t})=>{const[e,n]=A.useState([]),r=A.useCallback(u=>{const c=OCe(u,NCe(),Date.now());return n(f=>RCe(f,c)),c.id},[]),s=A.useCallback(u=>{n(c=>ICe(c,u))},[]),o=A.useCallback(()=>{n([])},[]),a=A.useMemo(()=>({errors:e,pushError:r,dismissError:s,clearAll:o}),[e,r,s,o]);return D.jsxs(ij.Provider,{value:a,children:[t,D.jsx(ACe,{errors:e,onDismiss:s})]})},nTe=()=>{const t=A.useContext(ij);if(!t)throw new Error("useErrorBanners must be used within an ErrorBannerProvider");return t},PCe=({error:t,reset:e,info:n})=>{const r=qA(t),s=kc(t,{recoverable:r,componentStack:n?.componentStack});return D.jsx(z8,{fatal:s,onRetry:r?e:void 0})},fp=Uhe()({component:DCe,errorComponent:PCe}),kCe=()=>{const{t}=vEe("common",{useSuspense:!1});return D.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 DCe(){return D.jsxs(MCe,{children:[D.jsxs(ECe,{children:[D.jsx(kCe,{}),D.jsx("main",{id:"main-content",className:"h-dvh overflow-hidden",children:D.jsx(A.Suspense,{fallback:D.jsx(HA,{}),children:D.jsx(h7,{})})})]}),D.jsx(F8,{})]})}const LCe=dr("/")({beforeLoad:()=>{throw VF({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 V4;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(V4||(V4={}));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 _i 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 _i))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()}}_i.create=t=>new _i(t);const dA=(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 UCe=dA;function FCe(){return UCe}const zCe=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 xe(t,e){const n=FCe(),r=zCe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===dA?void 0:dA].filter(s=>!!s)});t.common.issues.push(r)}class ls{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 Ke;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 ls.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 Ke;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 Ke=Object.freeze({status:"aborted"}),Xf=t=>({status:"dirty",value:t}),Ms=t=>({status:"valid",value:t}),K4=t=>t.status==="aborted",Y4=t=>t.status==="dirty",Gc=t=>t.status==="valid",ny=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 ja{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 Z4=(t,e)=>{if(Gc(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 _i(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 ls,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(ny(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 Z4(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 Gc(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=>Gc(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(ny(s)?s:Promise.resolve(s));return Z4(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 Yc({schema:this,typeName:Ye.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 Zc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _o.create(this)}promise(){return iy.create(this,this._def)}or(e){return sy.create([this,e],this._def)}and(e){return oy.create(this,e,this._def)}transform(e){return new Yc({...st(this._def),schema:this,typeName:Ye.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new hA({...st(this._def),innerType:this,defaultValue:n,typeName:Ye.ZodDefault})}brand(){return new lwe({typeName:Ye.ZodBranded,type:this,...st(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new pA({...st(this._def),innerType:this,catchValue:n,typeName:Ye.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return BR.create(this,e)}readonly(){return gA.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const BCe=/^c[^\s-]{8,}$/i,jCe=/^[0-9a-z]+$/,HCe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$Ce=/^[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,qCe=/^[a-z0-9_-]{21}$/i,WCe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,GCe=/^[-+]?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)?)??$/,VCe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,KCe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let m_;const YCe=/^(?:(?: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])$/,ZCe=/^(?:(?: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])$/,XCe=/^(([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]))$/,QCe=/^(([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])$/,JCe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ewe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,aj="((\\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])))",twe=new RegExp(`^${aj}$`);function lj(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 nwe(t){return new RegExp(`^${lj(t)}$`)}function rwe(t){let e=`${aj}T${lj(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 swe(t,e){return!!((e==="v4"||!e)&&YCe.test(t)||(e==="v6"||!e)&&XCe.test(t))}function owe(t,e){if(!WCe.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 iwe(t,e){return!!((e==="v4"||!e)&&ZCe.test(t)||(e==="v6"||!e)&&QCe.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 xe(o,{code:ge.invalid_type,expected:Oe.string,received:o.parsedType}),Ke}const r=new ls;let s;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(s=this._getOrReturnCtx(e,s),xe(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),xe(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?xe(s,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&xe(s,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")VCe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"email",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")m_||(m_=new RegExp(KCe,"u")),m_.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"emoji",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")$Ce.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"uuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")qCe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"nanoid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")BCe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"cuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")jCe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"cuid2",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")HCe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(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),xe(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),xe(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),xe(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),xe(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),xe(s,{code:ge.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?rwe(o).test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{code:ge.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?twe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{code:ge.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?nwe(o).test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{code:ge.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?GCe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"duration",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?swe(e.data,o.version)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"ip",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?owe(e.data,o.alg)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"jwt",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?iwe(e.data,o.version)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"cidr",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?JCe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(s,{validation:"base64",code:ge.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?ewe.test(e.data)||(s=this._getOrReturnCtx(e,s),xe(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:Ye.ZodString,coerce:t?.coerce??!1,...st(t)});function awe(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 Gl 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 xe(o,{code:ge.invalid_type,expected:Oe.number,received:o.parsedType}),Ke}let r;const s=new ls;for(const o of this._def.checks)o.kind==="int"?Tt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),xe(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),xe(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),xe(r,{code:ge.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?awe(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),xe(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),xe(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 Gl({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Me.toString(s)}]})}_addCheck(e){return new Gl({...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)}}Gl.create=t=>new Gl({checks:[],typeName:Ye.ZodNumber,coerce:t?.coerce||!1,...st(t)});class Vl 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 ls;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),xe(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),xe(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),xe(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 xe(n,{code:ge.invalid_type,expected:Oe.bigint,received:n.parsedType}),Ke}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 Vl({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Me.toString(s)}]})}_addCheck(e){return new Vl({...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}}Vl.create=t=>new Vl({checks:[],typeName:Ye.ZodBigInt,coerce:t?.coerce??!1,...st(t)});class ry extends wt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Oe.boolean){const r=this._getOrReturnCtx(e);return xe(r,{code:ge.invalid_type,expected:Oe.boolean,received:r.parsedType}),Ke}return Ms(e.data)}}ry.create=t=>new ry({typeName:Ye.ZodBoolean,coerce:t?.coerce||!1,...st(t)});class Vc 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 xe(o,{code:ge.invalid_type,expected:Oe.date,received:o.parsedType}),Ke}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return xe(o,{code:ge.invalid_date}),Ke}const r=new ls;let s;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(s=this._getOrReturnCtx(e,s),xe(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),xe(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 Vc({...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}}Vc.create=t=>new Vc({checks:[],coerce:t?.coerce||!1,typeName:Ye.ZodDate,...st(t)});class X4 extends wt{_parse(e){if(this._getType(e)!==Oe.symbol){const r=this._getOrReturnCtx(e);return xe(r,{code:ge.invalid_type,expected:Oe.symbol,received:r.parsedType}),Ke}return Ms(e.data)}}X4.create=t=>new X4({typeName:Ye.ZodSymbol,...st(t)});class Q4 extends wt{_parse(e){if(this._getType(e)!==Oe.undefined){const r=this._getOrReturnCtx(e);return xe(r,{code:ge.invalid_type,expected:Oe.undefined,received:r.parsedType}),Ke}return Ms(e.data)}}Q4.create=t=>new Q4({typeName:Ye.ZodUndefined,...st(t)});class J4 extends wt{_parse(e){if(this._getType(e)!==Oe.null){const r=this._getOrReturnCtx(e);return xe(r,{code:ge.invalid_type,expected:Oe.null,received:r.parsedType}),Ke}return Ms(e.data)}}J4.create=t=>new J4({typeName:Ye.ZodNull,...st(t)});class e6 extends wt{constructor(){super(...arguments),this._any=!0}_parse(e){return Ms(e.data)}}e6.create=t=>new e6({typeName:Ye.ZodAny,...st(t)});class t6 extends wt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ms(e.data)}}t6.create=t=>new t6({typeName:Ye.ZodUnknown,...st(t)});class Ha extends wt{_parse(e){const n=this._getOrReturnCtx(e);return xe(n,{code:ge.invalid_type,expected:Oe.never,received:n.parsedType}),Ke}}Ha.create=t=>new Ha({typeName:Ye.ZodNever,...st(t)});class n6 extends wt{_parse(e){if(this._getType(e)!==Oe.undefined){const r=this._getOrReturnCtx(e);return xe(r,{code:ge.invalid_type,expected:Oe.void,received:r.parsedType}),Ke}return Ms(e.data)}}n6.create=t=>new n6({typeName:Ye.ZodVoid,...st(t)});class _o extends wt{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==Oe.array)return xe(n,{code:ge.invalid_type,expected:Oe.array,received:n.parsedType}),Ke;if(s.exactLength!==null){const a=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(a||u)&&(xe(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&&(xe(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&&(xe(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 ja(n,a,n.path,u)))).then(a=>ls.mergeArray(r,a));const o=[...n.data].map((a,u)=>s.type._parseSync(new ja(n,a,n.path,u)));return ls.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new _o({...this._def,minLength:{value:e,message:Me.toString(n)}})}max(e,n){return new _o({...this._def,maxLength:{value:e,message:Me.toString(n)}})}length(e,n){return new _o({...this._def,exactLength:{value:e,message:Me.toString(n)}})}nonempty(e){return this.min(1,e)}}_o.create=(t,e)=>new _o({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ye.ZodArray,...st(e)});function gc(t){if(t instanceof xn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Ma.create(gc(r))}return new xn({...t._def,shape:()=>e})}else return t instanceof _o?new _o({...t._def,type:gc(t.element)}):t instanceof Ma?Ma.create(gc(t.unwrap())):t instanceof Zc?Zc.create(gc(t.unwrap())):t instanceof Kl?Kl.create(t.items.map(e=>gc(e))):t}class xn 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 xe(f,{code:ge.invalid_type,expected:Oe.object,received:f.parsedType}),Ke}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 ja(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&&(xe(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 ja(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=>ls.mergeObjectSync(r,f)):ls.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return Me.errToObj,new xn({...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 xn({...this._def,unknownKeys:"strip"})}passthrough(){return new xn({...this._def,unknownKeys:"passthrough"})}extend(e){return new xn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new xn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ye.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new xn({...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 xn({...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 xn({...this._def,shape:()=>n})}deepPartial(){return gc(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 xn({...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 xn({...this._def,shape:()=>n})}keyof(){return uj(Tt.objectKeys(this.shape))}}xn.create=(t,e)=>new xn({shape:()=>t,unknownKeys:"strip",catchall:Ha.create(),typeName:Ye.ZodObject,...st(e)});xn.strictCreate=(t,e)=>new xn({shape:()=>t,unknownKeys:"strict",catchall:Ha.create(),typeName:Ye.ZodObject,...st(e)});xn.lazycreate=(t,e)=>new xn({shape:t,unknownKeys:"strip",catchall:Ha.create(),typeName:Ye.ZodObject,...st(e)});class sy 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 _i(u.ctx.common.issues));return xe(n,{code:ge.invalid_union,unionErrors:a}),Ke}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 _i(c));return xe(n,{code:ge.invalid_union,unionErrors:u}),Ke}}get options(){return this._def.options}}sy.create=(t,e)=>new sy({options:t,typeName:Ye.ZodUnion,...st(e)});function fA(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=fA(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=fA(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 oy extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(o,a)=>{if(K4(o)||K4(a))return Ke;const u=fA(o.value,a.value);return u.valid?((Y4(o)||Y4(a))&&n.dirty(),{status:n.value,value:u.data}):(xe(r,{code:ge.invalid_intersection_types}),Ke)};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}))}}oy.create=(t,e,n)=>new oy({left:t,right:e,typeName:Ye.ZodIntersection,...st(n)});class Kl extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Oe.array)return xe(r,{code:ge.invalid_type,expected:Oe.array,received:r.parsedType}),Ke;if(r.data.length<this._def.items.length)return xe(r,{code:ge.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ke;!this._def.rest&&r.data.length>this._def.items.length&&(xe(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 ja(r,a,r.path,u)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>ls.mergeArray(n,a)):ls.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new Kl({...this._def,rest:e})}}Kl.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Kl({items:t,typeName:Ye.ZodTuple,rest:null,...st(e)})};class r6 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 xe(r,{code:ge.invalid_type,expected:Oe.map,received:r.parsedType}),Ke;const s=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([u,c],f)=>({key:s._parse(new ja(r,u,r.path,[f,"key"])),value:o._parse(new ja(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 Ke;(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 Ke;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),u.set(f.value,p.value)}return{status:n.value,value:u}}}}r6.create=(t,e,n)=>new r6({valueType:e,keyType:t,typeName:Ye.ZodMap,...st(n)});class Hh extends wt{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Oe.set)return xe(r,{code:ge.invalid_type,expected:Oe.set,received:r.parsedType}),Ke;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(xe(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&&(xe(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 Ke;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 ja(r,c,r.path,f)));return r.common.async?Promise.all(u).then(c=>a(c)):a(u)}min(e,n){return new Hh({...this._def,minSize:{value:e,message:Me.toString(n)}})}max(e,n){return new Hh({...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)}}Hh.create=(t,e)=>new Hh({valueType:t,minSize:null,maxSize:null,typeName:Ye.ZodSet,...st(e)});class s6 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})}}s6.create=(t,e)=>new s6({getter:t,typeName:Ye.ZodLazy,...st(e)});class o6 extends wt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return xe(n,{received:n.data,code:ge.invalid_literal,expected:this._def.value}),Ke}return{status:"valid",value:e.data}}get value(){return this._def.value}}o6.create=(t,e)=>new o6({value:t,typeName:Ye.ZodLiteral,...st(e)});function uj(t,e){return new Kc({values:t,typeName:Ye.ZodEnum,...st(e)})}class Kc extends wt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return xe(n,{expected:Tt.joinValues(r),received:n.parsedType,code:ge.invalid_type}),Ke}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 xe(n,{received:n.data,code:ge.invalid_enum_value,options:r}),Ke}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 Kc.create(e,{...this._def,...n})}exclude(e,n=this._def){return Kc.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Kc.create=uj;class i6 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 xe(r,{expected:Tt.joinValues(s),received:r.parsedType,code:ge.invalid_type}),Ke}if(this._cache||(this._cache=new Set(Tt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=Tt.objectValues(n);return xe(r,{received:r.data,code:ge.invalid_enum_value,options:s}),Ke}return Ms(e.data)}get enum(){return this._def.values}}i6.create=(t,e)=>new i6({values:t,typeName:Ye.ZodNativeEnum,...st(e)});class iy 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 xe(n,{code:ge.invalid_type,expected:Oe.promise,received:n.parsedType}),Ke;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})))}}iy.create=(t,e)=>new iy({type:t,typeName:Ye.ZodPromise,...st(e)});class Yc extends wt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ye.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=>{xe(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 Ke;const c=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return c.status==="aborted"?Ke:c.status==="dirty"||n.value==="dirty"?Xf(c.value):c});{if(n.value==="aborted")return Ke;const u=this._def.schema._parseSync({data:a,path:r.path,parent:r});return u.status==="aborted"?Ke:u.status==="dirty"||n.value==="dirty"?Xf(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"?Ke:(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"?Ke:(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(!Gc(a))return Ke;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=>Gc(a)?Promise.resolve(s.transform(a.value,o)).then(u=>({status:n.value,value:u})):Ke);Tt.assertNever(s)}}Yc.create=(t,e,n)=>new Yc({schema:t,typeName:Ye.ZodEffects,effect:e,...st(n)});Yc.createWithPreprocess=(t,e,n)=>new Yc({schema:e,effect:{type:"preprocess",transform:t},typeName:Ye.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:Ye.ZodOptional,...st(e)});class Zc extends wt{_parse(e){return this._getType(e)===Oe.null?Ms(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Zc.create=(t,e)=>new Zc({innerType:t,typeName:Ye.ZodNullable,...st(e)});class hA 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}}hA.create=(t,e)=>new hA({innerType:t,typeName:Ye.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...st(e)});class pA 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 ny(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new _i(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new _i(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}pA.create=(t,e)=>new pA({innerType:t,typeName:Ye.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...st(e)});class a6 extends wt{_parse(e){if(this._getType(e)!==Oe.nan){const r=this._getOrReturnCtx(e);return xe(r,{code:ge.invalid_type,expected:Oe.nan,received:r.parsedType}),Ke}return{status:"valid",value:e.data}}}a6.create=t=>new a6({typeName:Ye.ZodNaN,...st(t)});class lwe 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 BR 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"?Ke:o.status==="dirty"?(n.dirty(),Xf(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"?Ke: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 BR({in:e,out:n,typeName:Ye.ZodPipeline})}}class gA extends wt{_parse(e){const n=this._def.innerType._parse(e),r=s=>(Gc(s)&&(s.value=Object.freeze(s.value)),s);return ny(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}gA.create=(t,e)=>new gA({innerType:t,typeName:Ye.ZodReadonly,...st(e)});var Ye;(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"})(Ye||(Ye={}));const Fr=hi.create;Gl.create;Vl.create;const uwe=ry.create;Vc.create;Ha.create;_o.create;const fd=xn.create;sy.create;oy.create;Kl.create;Kc.create;iy.create;Ma.create;Zc.create;const rTe={string:(t=>hi.create({...t,coerce:!0})),number:(t=>Gl.create({...t,coerce:!0})),boolean:(t=>ry.create({...t,coerce:!0})),bigint:(t=>Vl.create({...t,coerce:!0})),date:(t=>Vc.create({...t,coerce:!0}))},cwe=Cy().apiUrl;Ze.setConfig({baseUrl:cwe});Ze.interceptors.error.use((t,e)=>{if(t instanceof z_||!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 z_(r,e.status,n)});const dwe=A.createContext(null),sTe=()=>A.useContext(dwe)??{accounts:[],mailboxNameIndex:new Map,accountNameIndex:new Map,searchQuery:"",searchInput:"",onSearchChange:()=>{},onSearchClear:()=>{},onSearchClearQuery:()=>{},intelligenceOpen:!1,onToggleIntelligence:()=>{},onSetIntelligenceOpen:()=>{}},fwe=()=>qn(()=>import("./mail-wRyPOZOI.js").then(t=>t.m),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])),hwe=fd({q:Fr().optional()}),pwe=dr("/mail")({loader:({context:{queryClient:t}})=>{t.prefetchQuery(lCe()),t.prefetchQuery({...vCe(),staleTime:6e4})},component:sr(fwe,"component"),validateSearch:hwe}),gwe=()=>qn(()=>import("./onboarding-DfwoEoUJ.js"),__vite__mapDeps([15,16,1,13,7,5])),mwe=dr("/onboarding")({component:sr(gwe,"component")}),vwe=()=>qn(()=>import("./settings-BTbXK9X8.js"),[]),oTe=[{id:"accounts",label:"Accounts",icon:D.jsx(zZ,{className:"size-4"})},{id:"senders",label:"Senders & Rules",icon:D.jsx(qZ,{className:"size-4"})},{id:"folders",label:"Folder roles",icon:D.jsx(FZ,{className:"size-4"})},{id:"filters",label:"Filters",icon:D.jsx(UZ,{className:"size-4"})},{id:"appearance",label:"Appearance",icon:D.jsx(HZ,{className:"size-4"})},{id:"advanced",label:"Advanced",icon:D.jsx(WZ,{className:"size-4"})}],iTe={accounts:"/settings/accounts",senders:"/settings/senders",folders:"/settings/folders",filters:"/settings/filters",appearance:"/settings/appearance",advanced:"/settings/advanced"},ywe=dr("/settings")({component:sr(vwe,"component")}),bwe=()=>qn(()=>import("./index-CCeIZpQ0.js"),__vite__mapDeps([17,10])),Swe=()=>qn(()=>import("./index-DtqBFgK5.js"),[]),Ewe=fd({selectedMessageId:Fr().optional(),selectedThreadId:Fr().optional(),selectedMailboxId:Fr().optional(),q:Fr().optional()}),Cwe=dr("/mail/")({component:sr(Swe,"component"),validateSearch:Ewe,errorComponent:sr(bwe,"errorComponent")}),wwe=()=>qn(()=>import("./_mailboxId-DtqBFgK5.js"),[]),_we=fd({selectedMessageId:Fr().optional(),selectedThreadId:Fr().optional(),q:Fr().optional()}),xwe=dr("/mail/$mailboxId")({component:sr(wwe,"component"),validateSearch:_we}),Awe=()=>qn(()=>import("./flagged-Ceo9C3FE.js"),__vite__mapDeps([18,10])),Twe=()=>qn(()=>import("./flagged-DtqBFgK5.js"),[]),Rwe=fd({selectedMessageId:Fr().optional(),q:Fr().optional()}),Iwe=dr("/mail/flagged")({component:sr(Twe,"component"),validateSearch:Rwe,errorComponent:sr(Awe,"errorComponent")}),Owe=()=>qn(()=>import("./outbox-DtqBFgK5.js"),[]),Nwe=fd({selectedOutboxMessageId:Fr().optional()}),Mwe=dr("/mail/outbox")({component:sr(Owe,"component"),validateSearch:Nwe}),Pwe=()=>qn(()=>import("./index-D6uqSvyo.js"),[]),kwe=dr("/settings/")({component:sr(Pwe,"component")}),Dwe=()=>qn(()=>import("./accounts-_cJv_LIO.js"),__vite__mapDeps([19,8,5,7,20,2,16,1,13,10,11,4])),Lwe=fd({editAccountId:Fr().optional(),focusSmtp:uwe().optional(),connected:Fr().optional(),oauthError:Fr().optional()}),Uwe=dr("/settings/accounts")({component:sr(Dwe,"component"),validateSearch:Lwe}),Fwe=()=>qn(()=>import("./advanced-BNBIvl7Z.js"),__vite__mapDeps([21,20,2])),zwe=dr("/settings/advanced")({component:sr(Fwe,"component")}),Bwe=()=>qn(()=>import("./appearance-C4sV_Bgs.js"),__vite__mapDeps([22,20,2])),jwe=dr("/settings/appearance")({component:sr(Bwe,"component")}),Hwe=()=>qn(()=>import("./filters-DGstBlo9.js"),__vite__mapDeps([23,20,2,14,7,4,10,12])),$we=dr("/settings/filters")({component:sr(Hwe,"component")}),qwe=()=>qn(()=>import("./folders-BNURd924.js"),__vite__mapDeps([24,6,4,3,13,20,2,7,10,12])),Wwe=dr("/settings/folders")({component:sr(qwe,"component")}),Gwe=()=>qn(()=>import("./senders-D14qF6PF.js"),__vite__mapDeps([25,1,20,2,7,10,9,11,3])),Vwe=dr("/settings/senders")({component:sr(Gwe,"component")}),Kwe=()=>qn(()=>import("./suggested-vips-BRyX8ZX3.js"),[]),Ywe=dr("/settings/suggested-vips")({component:sr(Kwe,"component")}),Zwe=LCe.update({id:"/",path:"/",getParentRoute:()=>fp}),hp=pwe.update({id:"/mail",path:"/mail",getParentRoute:()=>fp}),Xwe=mwe.update({id:"/onboarding",path:"/onboarding",getParentRoute:()=>fp}),Ni=ywe.update({id:"/settings",path:"/settings",getParentRoute:()=>fp}),Qwe=Cwe.update({id:"/",path:"/",getParentRoute:()=>hp}),Jwe=xwe.update({id:"/$mailboxId",path:"/$mailboxId",getParentRoute:()=>hp}),e_e=Iwe.update({id:"/flagged",path:"/flagged",getParentRoute:()=>hp}),t_e=Mwe.update({id:"/outbox",path:"/outbox",getParentRoute:()=>hp}),n_e=kwe.update({id:"/",path:"/",getParentRoute:()=>Ni}),r_e=Uwe.update({id:"/accounts",path:"/accounts",getParentRoute:()=>Ni}),s_e=zwe.update({id:"/advanced",path:"/advanced",getParentRoute:()=>Ni}),o_e=jwe.update({id:"/appearance",path:"/appearance",getParentRoute:()=>Ni}),i_e=$we.update({id:"/filters",path:"/filters",getParentRoute:()=>Ni}),a_e=Wwe.update({id:"/folders",path:"/folders",getParentRoute:()=>Ni}),l_e=Vwe.update({id:"/senders",path:"/senders",getParentRoute:()=>Ni}),u_e=Ywe.update({id:"/suggested-vips",path:"/suggested-vips",getParentRoute:()=>Ni}),c_e={MailMailboxIdRoute:Jwe,MailFlaggedRoute:e_e,MailOutboxRoute:t_e,MailIndexRoute:Qwe},d_e=hp._addFileChildren(c_e),f_e={SettingsAccountsRoute:r_e,SettingsAdvancedRoute:s_e,SettingsAppearanceRoute:o_e,SettingsFiltersRoute:i_e,SettingsFoldersRoute:a_e,SettingsSendersRoute:l_e,SettingsSuggestedVipsRoute:u_e,SettingsIndexRoute:n_e},h_e=Ni._addFileChildren(f_e),p_e={IndexRoute:Zwe,MailRoute:d_e,OnboardingRoute:Xwe,SettingsRoute:h_e},g_e=fp._addFileChildren(p_e)._addFileTypes(),m_e=(t,e)=>{const n=Jhe({routeTree:g_e,context:{queryClient:t},defaultPreload:"intent"});return n.subscribe("onResolved",r=>{e.recordPageView(r.toLocation.pathname)}),n},qe=t=>typeof t=="string",Lf=()=>{let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n},l6=t=>t==null?"":""+t,v_e=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},y_e=/###/g,u6=t=>t&&t.indexOf("###")>-1?t.replace(y_e,"."):t,c6=t=>!t||qe(t),dh=(t,e,n)=>{const r=qe(e)?e.split("."):e;let s=0;for(;s<r.length-1;){if(c6(t))return{};const o=u6(r[s]);!t[o]&&n&&(t[o]=new n),Object.prototype.hasOwnProperty.call(t,o)?t=t[o]:t={},++s}return c6(t)?{}:{obj:t,k:u6(r[s])}},d6=(t,e,n)=>{const{obj:r,k:s}=dh(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=dh(t,a,Object);for(;u.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),u=dh(t,a,Object),u?.obj&&typeof u.obj[`${u.k}.${o}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${o}`]=n},b_e=(t,e,n,r)=>{const{obj:s,k:o}=dh(t,e,Object);s[o]=s[o]||[],s[o].push(n)},ay=(t,e)=>{const{obj:n,k:r}=dh(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},S_e=(t,e,n)=>{const r=ay(t,n);return r!==void 0?r:ay(e,n)},cj=(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]):cj(t[r],e[r],n):t[r]=e[r]);return t},sc=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var E_e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const C_e=t=>qe(t)?t.replace(/[&<>"'\/]/g,e=>E_e[e]):t;class w_e{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 __e=[" ",",","?","!",";"],x_e=new w_e(20),A_e=(t,e,n)=>{e=e||"",n=n||"";const r=__e.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const s=x_e.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},ly=t=>t?.replace("_","-"),T_e={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 uy{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||T_e,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 uy(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new uy(this.logger,e)}}var wo=new uy;class _b{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 f6 extends _b{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=ay(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),d6(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=ay(this.data,u)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?cj(c,r,o):c={...c,...r},d6(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 dj={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 h6={},p6=t=>!qe(t)&&typeof t!="boolean"&&typeof t!="number";class cy extends _b{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),v_e(["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&&!A_e(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 F=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${F}${a}`,usedKey:a,exactUsedKey:a,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${F}${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,x=n.count!==void 0&&!qe(n.count),T=cy.hasDefaultValue(n),R=x?this.pluralResolver.getSuffix(f,n.count,n):"",M=n.ordinal&&x?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",O=x&&!n.ordinal&&n.count===0,I=O&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${R}`]||n[`defaultValue${M}`]||n.defaultValue;let P=m;w&&!m&&T&&(P=I);const k=p6(P),H=Object.prototype.toString.apply(P);if(w&&P&&k&&E.indexOf(H)<0&&!(qe(C)&&Array.isArray(P))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const F=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,P,{...n,ns:u}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(g.res=F,g.usedParams=this.getUsedParamsDetails(n),g):F}if(o){const F=Array.isArray(P),B=F?[]:{},W=F?S:y;for(const Y in P)if(Object.prototype.hasOwnProperty.call(P,Y)){const ne=`${W}${o}${Y}`;T&&!m?B[Y]=this.translate(ne,{...n,defaultValue:p6(I)?I[Y]:void 0,joinArrays:!1,ns:u}):B[Y]=this.translate(ne,{...n,joinArrays:!1,ns:u}),B[Y]===ne&&(B[Y]=P[Y])}m=B}}else if(w&&qe(C)&&Array.isArray(m))m=m.join(C),m&&(m=this.extendTranslation(m,e,n,r));else{let F=!1,B=!1;!this.isValidLookup(m)&&T&&(F=!0,m=I),this.isValidLookup(m)||(B=!0,m=a);const Y=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&B?void 0:m,ne=T&&I!==m&&this.options.updateMissing;if(B||F||ne){if(this.logger.log(ne?"updateKey":"missingKey",f,c,a,ne?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 $=[];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++)$.push(ee[de]);else this.options.saveMissingTo==="all"?$=this.languageUtils.toResolveHierarchy(n.lng||this.language):$.push(n.lng||this.language);const fe=(de,Ae,L)=>{const V=T&&L!==m?L:Y;this.options.missingKeyHandler?this.options.missingKeyHandler(de,c,Ae,V,ne,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(de,c,Ae,V,ne,n),this.emit("missingKey",de,c,Ae,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?$.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($,a,I))}m=this.extendTranslation(m,e,n,g,r),B&&m===a&&this.options.appendNamespaceToMissingKey&&(m=`${c}:${a}`),(B||F)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${a}`:a,F?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=dj.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,!h6[`${E[0]}-${C}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(u)&&(h6[`${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 x=[p];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(x,p,w,C,n);else{let R;m&&(R=this.pluralResolver.getSuffix(w,n.count,n));const M=`${this.options.pluralSeparator}zero`,O=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(x.push(p+R),n.ordinal&&R.indexOf(O)===0&&x.push(p+R.replace(O,this.options.pluralSeparator)),y&&x.push(p+M)),S){const I=`${p}${this.options.contextSeparator}${n.context}`;x.push(I),m&&(x.push(I+R),n.ordinal&&R.indexOf(O)===0&&x.push(I+R.replace(O,this.options.pluralSeparator)),y&&x.push(I+M))}}let T;for(;T=x.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 g6{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wo.create("languageUtils")}getScriptPartFromCode(e){if(e=ly(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=ly(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 m6={zero:0,one:1,two:2,few:3,many:4,other:5},v6={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class R_e{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=ly(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!"),v6;if(!e.match(/-|_/))return v6;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)=>m6[s]-m6[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 y6=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=S_e(t,e,n);return!o&&s&&qe(n)&&(o=mA(t,n,r),o===void 0&&(o=mA(e,n,r))),o},v_=t=>t.replace(/\$/g,"$$$$");class I_e{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:x}=e.interpolation;this.escape=n!==void 0?n:C_e,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?sc(o):a||"{{",this.suffix=u?sc(u):c||"}}",this.formatSeparator=f||",",this.unescapePrefix=p?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":p||"",this.nestingPrefix=m?sc(m):y||sc("$t("),this.nestingSuffix=S?sc(S):E||sc(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=w||1e3,this.alwaysFormat=x!==void 0?x:!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=y6(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(y6(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=>v_(y)},{regex:this.regexp,safeValue:y=>this.escapeValue?v_(this.escape(y)):v_(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=l6(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=l6(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 O_e=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}},oc=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(ly(r),s),e[a]=u),u(n)}};class N_e{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=wo.create("formatter"),this.options=e,this.formats={number:oc((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return o=>s.format(o)}),currency:oc((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>s.format(o)}),datetime:oc((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return o=>s.format(o)}),relativetime:oc((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return o=>s.format(o,r.range||"day")}),list:oc((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()]=oc(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}=O_e(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 M_e=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class P_e extends _b{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=>{b_e(c.loaded,[o],a),M_e(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 b6=()=>({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}}),S6=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),km=()=>{},k_e=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class $h extends _b{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=S6(e),this.services={},this.logger=wo,this.modules={external:[]},k_e(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=b6();this.options={...s,...this.options,...S6(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=N_e;const g=new g6(this.options);this.store=new f6(this.options.resources,this.options);const m=this.services;m.logger=wo,m.resourceStore=this.store,m.languageUtils=g,m.pluralResolver=new R_e(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 I_e(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new P_e(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 cy(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=km),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=Lf(),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]:km;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=Lf();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=km),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"&&dj.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=Lf();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=Lf();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=Lf();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 g6(b6());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 $h(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:km;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},o=new $h(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 f6(u,s),o.services.resourceStore=o.store}return o.translator=new cy(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 hr=$h.createInstance();hr.createInstance=$h.createInstance;hr.createInstance;hr.dir;hr.init;hr.loadResources;hr.reloadResources;hr.use;hr.changeLanguage;hr.getFixedT;hr.t;hr.exists;hr.setDefaultNamespace;hr.hasLoadedNamespace;hr.loadNamespaces;hr.loadLanguages;const{slice:D_e,forEach:L_e}=[];function U_e(t){return L_e.call(D_e.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}function F_e(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 E6=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,z_e=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(!E6.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!E6.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},C6={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=z_e(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 B_e={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return C6.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:s,cookieOptions:o}=e;n&&typeof document<"u"&&C6.create(n,t,r,s,o)}},j_e={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}},H_e={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 ic=null;const w6=()=>{if(ic!==null)return ic;try{if(ic=typeof window<"u"&&window.localStorage!==null,!ic)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{ic=!1}return ic};var $_e={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&w6())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&w6()&&window.localStorage.setItem(n,t)}};let ac=null;const _6=()=>{if(ac!==null)return ac;try{if(ac=typeof window<"u"&&window.sessionStorage!==null,!ac)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{ac=!1}return ac};var q_e={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&_6())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&_6()&&window.sessionStorage.setItem(n,t)}},W_e={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}},G_e={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}},V_e={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}},K_e={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 fj=!1;try{document.cookie,fj=!0}catch{}const hj=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];fj||hj.splice(1,1);const Y_e=()=>({order:hj,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class pj{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=U_e(n,this.options||{},Y_e()),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(B_e),this.addDetector(j_e),this.addDetector($_e),this.addDetector(q_e),this.addDetector(W_e),this.addDetector(G_e),this.addDetector(V_e),this.addDetector(K_e),this.addDetector(H_e)}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&&!F_e(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)}))}}pj.type="languageDetector";function Z_e(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=X_e(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 X_e(t,e){if(t){if(typeof t=="string")return x6(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)?x6(t,e):void 0}}function x6(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 vA(t){"@babel/helpers - typeof";return vA=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},vA(t)}var gj=["__proto__","constructor","prototype"];function mj(t){return!(typeof t!="string"||t.length===0||t.length>128||gj.indexOf(t)>-1||t.indexOf("..")>-1||t.indexOf("\\")>-1||/[?#%\s@]/.test(t)||/[\x00-\x1F\x7F]/.test(t))}function vj(t){return!(!mj(t)||t.indexOf("/")>-1)}function Q_e(t){return mj(t)}var J_e={lng:vj,ns:Q_e};function Dm(t){return typeof t!="string"?t:t.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function exe(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 yj(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":vA(XMLHttpRequest))==="object"}function txe(t){return!!t&&typeof t.then=="function"}function nxe(t){return txe(t)?t:Promise.resolve(t)}var rxe=/\{\{(.+?)\}\}/g;function A6(t,e){var n=!1,r=t.replace(rxe,function(s,o){var a=o.trim();if(gj.indexOf(a)>-1)return s;var u=e[a];if(u==null)return s;var c=J_e[a]||vj,f=String(u).split("+"),p=Z_e(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 T6(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 R6(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?T6(Object(n),!0).forEach(function(r){sxe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function sxe(t,e,n){return(e=oxe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oxe(t){var e=ixe(t,"string");return Yl(e)=="symbol"?e:e+""}function ixe(t,e){if(Yl(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Yl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yl(t){"@babel/helpers - typeof";return Yl=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},Yl(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;yj()&&(typeof global<"u"&&global.XMLHttpRequest?qh=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(qh=window.XMLHttpRequest));var dy;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?dy=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(dy=window.ActiveXObject));typeof $a!="function"&&($a=void 0);if(!$a&&!qh&&!dy)try{qn(()=>import("./browser-ponyfill-BBk5Xtq_.js").then(t=>t.b),[]).then(function(t){$a=t.default}).catch(function(){})}catch{}var bj=["__proto__","constructor","prototype"],yA=function(e,n){if(n&&Yl(n)==="object"){for(var r="",s=0,o=Object.keys(n);s<o.length;s++){var a=o[s];bj.indexOf(a)>-1||(r+="&"+encodeURIComponent(a)+"="+encodeURIComponent(n[a]))}if(!r)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+r.slice(1)}return e},I6=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)},axe=function(e,n,r,s){e.queryStringParams&&(n=yA(n,e.queryStringParams));var o=R6({},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=R6({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{I6(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]}),I6(n,u,s,c),e._omitFetchOptions=!0}catch(p){s(p)}}},lxe=function(e,n,r,s){r&&Yl(r)==="object"&&(r=yA("",r).slice(1)),e.queryStringParams&&(n=yA(n,e.queryStringParams));try{var o=qh?new qh:new dy("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];bj.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)}},uxe=function(e,n,r,s){if(typeof r=="function"&&(s=r,r=void 0),s=s||function(){},$a&&n.indexOf("file:")!==0)return axe(e,n,r,s);if(yj()||typeof ActiveXObject=="function")return lxe(e,n,r,s);s(new Error("No fetch and no xhr implementation found!"))};function Xc(t){"@babel/helpers - typeof";return Xc=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},Xc(t)}function O6(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 y_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?O6(Object(n),!0).forEach(function(r){Sj(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O6(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function cxe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dxe(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,Ej(r.key),r)}}function fxe(t,e,n){return e&&dxe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Sj(t,e,n){return(e=Ej(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ej(t){var e=hxe(t,"string");return Xc(e)=="symbol"?e:e+""}function hxe(t,e){if(Xc(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Xc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var pxe=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 Sj({},r,s||"")},parseLoadPayload:function(n,r){},request:uxe,reloadInterval:typeof window<"u"?!1:3600*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},Cj=(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]:{};cxe(this,t),this.services=e,this.options=n,this.allOptions=r,this.type="backend",this.init(e,n,r)}return fxe(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=y_(y_(y_({},pxe()),this.options||{}),s),this.allOptions=o,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);Xc(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=nxe(c),c.then(function(f){if(!f)return a(null,{});var p=A6(f,{lng:n.join("+"),ns:s.join("+")});if(p==null){var g=n.map(Dm).join(", "),m=s.map(Dm).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=Dm(exe(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+": "+Dm(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=A6(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)})})})}}}])})();Cj.type="backend";hr.use(Cj).use(pj).use(fEe).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 gxe=({authProvider:t,rootElementId:e="root"})=>{AJ(),eEe(),t.configure(),xpe(t);const n=QSe();mJ(n);const r=new Zde({queryCache:new PF({onError:Ipe}),mutationCache:new MF({onError:Ope}),defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:1}}}),s=m_e(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;ape.createRoot(o).render(D.jsx(A.StrictMode,{children:D.jsx(JB.Provider,{value:n,children:D.jsxs(Xde,{client:r,children:[D.jsx(Rpe,{value:t,children:D.jsx(a,{children:D.jsx(npe,{router:s})})}),!1]})})}))};gxe({authProvider:Tde});export{g_ as $,tfe as A,Gm as B,zM as C,IX as D,ofe as E,fQ as F,nfe as G,rfe as H,zZ as I,Dr as J,afe as K,ML as L,sfe as M,lfe as N,jZ as O,_xe as P,Wde as Q,q5 as R,eJ as S,$Z as T,ds as U,qr as V,xhe as W,ph as X,JAe as Y,XT as Z,xN as _,dn as a,aCe as a$,pAe as a0,Pxe as a1,ufe as a2,dCe as a3,VAe as a4,YAe as a5,GAe as a6,PAe as a7,lCe as a8,nTe as a9,bxe as aA,vCe as aB,qA as aC,iCe as aD,kc as aE,c7 as aF,mP as aG,OJ as aH,eCe as aI,rj as aJ,IAe as aK,RAe as aL,OAe as aM,NAe as aN,a7 as aO,LAe as aP,Rxe as aQ,UEe as aR,mAe as aS,qa as aT,MEe as aU,P8 as aV,Cy as aW,dwe as aX,Sxe as aY,HA as aZ,h7 as a_,pCe as aa,oj as ab,ZAe as ac,eTe as ad,KAe as ae,qn as af,AAe as ag,DAe as ah,uCe as ai,rCe as aj,jAe as ak,yCe as al,mCe as am,qAe as an,HAe as ao,BAe as ap,kAe as aq,z as ar,vEe as as,l7 as at,WAe as au,$Ae as av,tTe as aw,QAe as ax,sTe as ay,XAe as az,ZM as b,Pee as b$,Nxe as b0,bAe as b1,vAe as b2,EAe as b3,fd as b4,uwe as b5,Fr as b6,rTe as b7,UAe as b8,FAe as b9,Ai as bA,soe as bB,Ti as bC,Zse as bD,X8 as bE,Dy as bF,P9 as bG,Sre as bH,loe as bI,voe as bJ,Cre as bK,gre as bL,Ny as bM,QA as bN,W8 as bO,poe as bP,coe as bQ,Tre as bR,ooe as bS,CT as bT,K8 as bU,wre as bV,Qse as bW,Jse as bX,$ee as bY,tu as bZ,kee as b_,Uwe as ba,yAe as bb,SAe as bc,oTe as bd,iTe as be,MAe as bf,cJ as bg,xxe as bh,uJ as bi,H4 as bj,gAe as bk,CAe as bl,nCe as bm,_Ae as bn,wAe as bo,xAe as bp,TAe as bq,zAe as br,cCe as bs,Ch as bt,Yde as bu,AF as bv,Ig as bw,Q8 as bx,No as by,gT as bz,Ns as c,XA as c0,U9 as c1,Xse as c2,Uee as c3,Are as c4,noe as c5,JA as c6,eoe as c7,Soe as c8,H9 as c9,K5 as ca,Txe as cb,Xh as cc,Axe as cd,yT as ce,$y as cf,ep as cg,goe as ch,Qh as ci,moe as cj,uoe as ck,LZ as d,RX as e,Exe as f,BZ as g,wxe as h,cQ as i,D as j,V1 as k,F_ as l,pQ as m,sF as n,mxe as o,Cxe as p,vxe as q,A as r,Oxe as s,Ixe as t,sp as u,er as v,rx as w,_F as x,DF as y,Qde as z};
|