@slashid/jump-page 0.0.7-beta.1 โ 0.0.7-beta.2
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/cli.js +4 -4
- package/dist/_astro/app.f7d04798.js +39 -0
- package/dist/_astro/client.a5ffbec0.js +24 -0
- package/dist/_astro/index.03be2d59.js +9 -0
- package/dist/_astro/index.2dd0ad08.css +1 -0
- package/dist/_astro/index.cc62d81f.css +1 -0
- package/dist/favicon.png +0 -0
- package/dist/index.html +7 -0
- package/package.json +2 -2
- package/src/components/README.md +0 -3
- package/src/components/app/app.component.tsx +0 -83
- package/src/components/app/app.context.tsx +0 -41
- package/src/components/app/app.css.ts +0 -15
- package/src/components/app/index.ts +0 -1
- package/src/components/card/card.component.tsx +0 -42
- package/src/components/card/card.css.ts +0 -40
- package/src/components/card/index.ts +0 -1
- package/src/components/flow/flow.component.tsx +0 -99
- package/src/components/flow/flow.css.ts +0 -20
- package/src/components/flow/flow.domain.ts +0 -18
- package/src/components/flow/flow.error.tsx +0 -32
- package/src/components/flow/flow.initial.tsx +0 -14
- package/src/components/flow/flow.loader.tsx +0 -9
- package/src/components/flow/flow.progress.tsx +0 -119
- package/src/components/flow/flow.recover.tsx +0 -121
- package/src/components/flow/flow.success.tsx +0 -40
- package/src/components/flow/flow.types.ts +0 -48
- package/src/components/flow/index.ts +0 -3
- package/src/components/text/index.ts +0 -1
- package/src/components/text/text.component.tsx +0 -8
- package/src/components/text/use-i18n.ts +0 -13
- package/src/config.ts +0 -7
- package/src/domain/i18n.ts +0 -115
- package/src/env.d.ts +0 -1
- package/src/layouts/README.md +0 -3
- package/src/layouts/page.astro +0 -33
- package/src/pages/index.astro +0 -8
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import{r as w,R as Wr}from"./index.03be2d59.js";/* empty css */var zr={exports:{}},tt={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var $i=w,Ei=Symbol.for("react.element"),vi=Symbol.for("react.fragment"),Ci=Object.prototype.hasOwnProperty,ki=$i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ri={key:!0,ref:!0,__self:!0,__source:!0};function Kr(e,t,n){var r,s={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Ci.call(t,r)&&!Ri.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:Ei,type:e,key:i,ref:a,props:s,_owner:ki.current}}tt.Fragment=vi;tt.jsx=Kr;tt.jsxs=Kr;zr.exports=tt;var l=zr.exports;function N(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var gn={};gn=JSON.parse(`{"name":"@slashid/slashid","private":false,"publishConfig":{"access":"public"},"version":"3.17.4-beta.3","description":"Client SDK for the /id platform","homepage":"https://slashid.dev","author":"SlashID","license":"MIT","main":"./dist/bundle/slashid.js","module":"./dist/esmodule/slashid.esm.js","esmodule":"./dist/esmodule/slashid.esm.js","commonjs":"./dist/commonjs/slashid.cjs.js","bundle":"./dist/bundle/slashid.js","types":"./dist/types/slashid.d.ts","exports":{".":{"require":"./dist/commonjs/slashid.cjs.js","import":"./dist/esmodule/slashid.esm.js","default":"./dist/commonjs/slashid.cjs.js","types":"./dist/types/slashid.d.ts"}},"targets":{"esmodule":{"source":"src/targets/package.ts","context":"browser","isLibrary":true,"outputFormat":"esmodule","engines":{"browsers":["and_chr >= 73","chrome >= 73","and_ff >= 67","android >= 114","edge >= 79","samsung >= 11.2","safari >= 13","ios_saf >= 13.1","opera >= 60","firefox >= 67","unreleased and_chr versions","unreleased chrome versions","unreleased and_ff versions","unreleased android versions","unreleased edge versions","unreleased samsung versions","unreleased safari versions","unreleased ios_saf versions","unreleased opera versions","unreleased firefox versions"]}},"commonjs":{"source":"src/targets/package.ts","context":"node","isLibrary":true,"outputFormat":"commonjs","engines":{"node":">= 12"}},"bundle":{"source":"src/targets/bundle.ts","context":"browser","outputFormat":"global","engines":{"browsers":["> 0.5%","last 2 versions","not dead"]}},"page":{"source":"static/sdk.html","context":"browser","engines":{"browsers":["and_chr >= 73","chrome >= 73","and_ff >= 67","android >= 114","edge >= 79","samsung >= 11.2","safari >= 13","ios_saf >= 13.1","opera >= 60","firefox >= 67","unreleased and_chr versions","unreleased chrome versions","unreleased and_ff versions","unreleased android versions","unreleased edge versions","unreleased samsung versions","unreleased safari versions","unreleased ios_saf versions","unreleased opera versions","unreleased firefox versions"]}},"types":{"source":"src/targets/package.ts"}},"files":["dist/esmodule","dist/commonjs","dist/types"],"keywords":["slashid","SlashID","auth","openid","authentication","jwt","browser"],"scripts":{"clean":"rm -rf dist docs","lint":"eslint ./src --ext .ts","format":"prettier --config .prettierrc.json 'src/**/*.ts' --write","test:ts":"tsc --project tsconfig.json --noEmit","test:unit":"jest","test:unit:watch":"jest --watch","test:unit:ci":"jest --ci","test:integration":"playwright test","build":"rm -rf dist && parcel build && cp compat/esmodule/package.json dist/esmodule","docs":"rm -rf docs && typedoc","dist":"npm run lint && npm run build","all":"npm run dist && npm run docs","serve:all":"parcel serve 'static/*.html' --port 8080","serve:example":"parcel serve static/index.html --port 8080","serve:jump":"parcel serve static/sdk.html --port 8080","serve:docs":"parcel serve docs/index.html --port 8081","push:docs":"aws s3 sync docs s3://slashiddoc/sdk/v$(node tools/version.js --major) && (aws cloudfront create-invalidation --distribution-id ETLBNGAAF97EN --paths \\"/*\\")","changeset":"changeset","prepublishOnly":"npm run all","publish:ci":"npm run build && changeset publish"},"devDependencies":{"@parcel/core":"2.9.3","@parcel/packager-ts":"2.9.3","@parcel/transformer-babel":"2.9.3","@parcel/transformer-js":"2.9.3","@parcel/transformer-json":"2.9.3","@parcel/transformer-react-refresh-wrap":"2.9.3","@parcel/transformer-typescript-types":"2.9.3","@playwright/test":"^1.25.0","@types/jest":"^28.1.7","@types/node":"~15.0.2","@types/qrcode":"^1.5.0","@typescript-eslint/eslint-plugin":"^4.15.1","@typescript-eslint/parser":"^4.15.1","danger":"^11.2.6","eslint":"^7.20.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.2.1","isomorphic-fetch":"^3.0.0","jest":"^28.1.3","jest-environment-jsdom":"^28.1.3","jest-fetch-mock":"^3.0.3","parcel":"^2.7.0","prettier":"^2.7.1","ts-jest":"^28.0.8","typedoc":"^0.23.00","typedoc-plugin-mdn-links":"^2.0.0","typedoc-plugin-missing-exports":"^1.0.0","typescript":"~4.7.0"},"dependencies":{"@changesets/cli":"^2.26.2","@types/uuid":"8.3.4","changeset":"^0.2.6","docdash":"^1.2.0","jwt-decode":"^3.1.2","mitt":"^3.0.0","qrcode":"^1.5.1","querystring-es3":"^0.2.1","regenerator-runtime":"^0.13.9","url":"^0.11.0","uuid":"8.3.2"}}`);const[Ii,xi,Di]=gn.version.split("."),I={major:Ii,minor:xi,patch:Di,raw:gn.version},Ti="https://api.slashid.com".replace(/\/+$/,"");class he{set config(t){this.configuration=t}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:Ti}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||jr}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const t=this.configuration.apiKey;if(t)return typeof t=="function"?t:()=>t}get accessToken(){const t=this.configuration.accessToken;if(t)return typeof t=="function"?t:async()=>t}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(t={}){this.configuration=t}}const ge=new he;class re{withMiddleware(...t){const n=this.clone();return n.middleware=n.middleware.concat(...t),n}withPreMiddleware(...t){const n=t.map(r=>({pre:r}));return this.withMiddleware(...n)}withPostMiddleware(...t){const n=t.map(r=>({post:r}));return this.withMiddleware(...n)}isJsonMime(t){return t?re.jsonRegex.test(t):!1}async request(t,n){const{url:r,init:s}=await this.createFetchParams(t,n),i=await this.fetchApi(r,s);if(i&&i.status>=200&&i.status<300)return i;throw new Oi(i,"Response returned an error code")}async createFetchParams(t,n){let r=this.configuration.basePath+t.path;t.query!==void 0&&Object.keys(t.query).length!==0&&(r+="?"+this.configuration.queryParamsStringify(t.query));const s=Object.assign({},this.configuration.headers,t.headers);Object.keys(s).forEach(c=>s[c]===void 0?delete s[c]:{});const i=typeof n=="function"?n:async()=>n,a={method:t.method,headers:s,body:t.body,credentials:this.configuration.credentials},o={...a,...await i({init:a,context:t})},d={...o,body:Ai(o.body)||o.body instanceof URLSearchParams||qi(o.body)?o.body:JSON.stringify(o.body)};return{url:r,init:d}}clone(){const t=this.constructor,n=new t(this.configuration);return n.middleware=this.middleware.slice(),n}constructor(t=ge){this.configuration=t,this.fetchApi=async(n,r)=>{let s={url:n,init:r};for(const a of this.middleware)a.pre&&(s=await a.pre({fetch:this.fetchApi,...s})||s);let i;try{i=await(this.configuration.fetchApi||fetch)(s.url,s.init)}catch(a){for(const o of this.middleware)o.onError&&(i=await o.onError({fetch:this.fetchApi,url:s.url,init:s.init,error:a,response:i?i.clone():void 0})||i);if(i===void 0)throw a instanceof Error?new Ni(a,"The request failed and the interceptors did not return an alternative response"):a}for(const a of this.middleware)a.post&&(i=await a.post({fetch:this.fetchApi,url:s.url,init:s.init,response:i.clone()})||i);return i},this.middleware=t.middleware}}re.jsonRegex=new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");function qi(e){return typeof Blob<"u"&&e instanceof Blob}function Ai(e){return typeof FormData<"u"&&e instanceof FormData}class Oi extends Error{constructor(t,n){super(n),this.response=t,this.name="ResponseError"}}class Ni extends Error{constructor(t,n){super(n),this.cause=t,this.name="FetchError"}}class y extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}}const Tt={csv:",",ssv:" ",tsv:" ",pipes:"|"};function h(e,t){const n=e[t];return n!=null}function jr(e,t=""){return Object.keys(e).map(n=>Jr(n,e[n],t)).filter(n=>n.length>0).join("&")}function Jr(e,t,n=""){const r=n+(n.length?`[${e}]`:e);if(t instanceof Array){const s=t.map(i=>encodeURIComponent(String(i))).join(`&${encodeURIComponent(r)}=`);return`${encodeURIComponent(r)}=${s}`}if(t instanceof Set){const s=Array.from(t);return Jr(e,s,n)}return t instanceof Date?`${encodeURIComponent(r)}=${encodeURIComponent(t.toISOString())}`:t instanceof Object?jr(t,r):`${encodeURIComponent(r)}=${encodeURIComponent(String(t))}`}class ${async value(){return this.transformer(await this.raw.json())}constructor(t,n=r=>r){this.raw=t,this.transformer=n}}class Ke{async value(){}constructor(t){this.raw=t}}function Li(e){return Pi(e)}function Pi(e,t){return e==null?e:{limit:e.limit,offset:e.offset,total_count:e.total_count}}function M(e){return Ui(e)}function Ui(e,t){return e==null?e:{pagination:h(e,"pagination")?Li(e.pagination):void 0}}function B(e){return Mi(e)}function Mi(e,t){return e==null?e:{httpcode:h(e,"httpcode")?e.httpcode:void 0,message:h(e,"message")?e.message:void 0}}function qt(e){return Bi(e)}function Bi(e,t){return e==null?e:{meta:h(e,"meta")?M(e.meta):void 0,errors:h(e,"errors")?e.errors.map(B):void 0}}const q={Proxy:"proxy",WebauthnCreate:"webauthn_create",WebauthnGet:"webauthn_get",Nonce:"nonce",Otp:"otp",Oidc:"oidc",Saml:"saml",PasswordSet:"password_set",PasswordVerify:"password_verify",PasswordReset:"password_reset"};function H(e){return Gi(e)}function Gi(e,t){return e}function Vi(e){if(e!==void 0)return e===null?null:{challenge:e.challenge}}function Fi(e){if(e!==void 0)return e===null?null:{challenge_id:e.challenge_id,challenge_type:e.challenge_type,data:Vi(e.data)}}function Yi(e){if(e!==void 0)return e===null?null:{otp:e.otp}}function Hi(e){if(e!==void 0)return e===null?null:{challenge_id:e.challenge_id,challenge_type:e.challenge_type,data:Yi(e.data)}}function Wi(e){if(e!==void 0)return e===null?null:{password:e.password}}function zi(e){if(e!==void 0)return e===null?null:{challenge_id:e.challenge_id,challenge_type:e.challenge_type,data:Wi(e.data)}}function Ki(e){if(e!==void 0)return e===null?null:{password:e.password}}function ji(e){if(e!==void 0)return e===null?null:{challenge_id:e.challenge_id,challenge_type:e.challenge_type,data:Ki(e.data)}}function Ji(e){if(e!==void 0)return e===null?null:{password:e.password}}function Xi(e){if(e!==void 0)return e===null?null:{challenge_id:e.challenge_id,challenge_type:e.challenge_type,data:Ji(e.data)}}function Zi(e){if(e!==void 0)return e===null?null:{challenge_id:e.challenge_id,challenge_type:e.challenge_type,data:e.data}}function Qi(e){if(e!==void 0)return e===null?null:{challenge_id:e.challenge_id,challenge_type:e.challenge_type,data:e.data}}function Mn(e){if(e!==void 0){if(e===null)return null;switch(e.challenge_type){case"nonce":return Fi(e);case"otp":return Hi(e);case"password_reset":return zi(e);case"password_set":return ji(e);case"password_verify":return Xi(e);case"webauthn_create":return Zi(e);case"webauthn_get":return Qi(e);default:throw new Error(`No variant of Attestation exists with 'challenge_type=${e.challenge_type}'`)}}}const D={Webauthn:"webauthn",EmailLink:"email_link",SmsLink:"sms_link",OtpViaSms:"otp_via_sms",OtpViaEmail:"otp_via_email",Oidc:"oidc",Saml:"saml",Api:"api",DirectId:"direct_id",Password:"password"};function W(e){return ea(e)}function ea(e,t){return e}function Xr(e){return e}const ue={EmailAddress:"email_address",PhoneNumber:"phone_number"};function ta(e){return na(e)}function na(e,t){return e}function Zr(e){return ra(e)}function ra(e,t){return e==null?e:{type:ta(e.type),value:e.value}}function nt(e){if(e!==void 0)return e===null?null:{type:e.type,value:e.value}}function sa(e){return ia(e)}function ia(e,t){return e}function aa(e){return oa(e)}function oa(e,t){return e==null?e:{challenge:h(e,"challenge")?e.challenge:void 0}}function da(e,t){return e==null?e:{id:e.id,type:H(e.type),authentication_method:W(e.authentication_method),options:h(e,"options")?aa(e.options):void 0}}function ca(e){return ua(e)}function ua(e,t){return e==null?e:{auth_code_url:e.auth_code_url}}function la(e,t){return e==null?e:{id:e.id,type:H(e.type),authentication_method:W(e.authentication_method),options:ca(e.options)}}function fa(e,t){return e==null?e:{id:e.id,type:H(e.type),authentication_method:W(e.authentication_method)}}function pa(e){return ha(e)}function ha(e,t){return e}function ga(e){return _a(e)}function _a(e,t){return e}function ma(e){return ba(e)}function ba(e,t){return e==null?e:{name:sa(e.name),pattern:e.pattern,match_type:pa(e.match_type),pattern_qualifiers:h(e,"pattern_qualifiers")?e.pattern_qualifiers.map(ga):void 0}}function Qr(e){return wa(e)}function wa(e,t){return e==null?e:{regular_expressions:h(e,"regular_expressions")?e.regular_expressions.map(ma):void 0}}function ya(e){return Sa(e)}function Sa(e,t){return e==null?e:{validation_rules:Qr(e.validation_rules)}}function $a(e,t){return e==null?e:{id:e.id,type:H(e.type),authentication_method:W(e.authentication_method),options:ya(e.options)}}function Ea(e){return va(e)}function va(e,t){return e==null?e:{validation_rules:Qr(e.validation_rules)}}function Ca(e,t){return e==null?e:{id:e.id,type:H(e.type),authentication_method:W(e.authentication_method),options:Ea(e.options)}}function ka(e,t){return e==null?e:{id:e.id,type:H(e.type),authentication_method:W(e.authentication_method)}}function Ra(e){return Ia(e)}function Ia(e,t){return e==null?e:{challenge_id:h(e,"challenge_id")?e.challenge_id:void 0}}function xa(e,t){return e==null?e:{id:e.id,type:H(e.type),authentication_method:W(e.authentication_method),options:h(e,"options")?Ra(e.options):void 0}}function Da(e){return Ta(e)}function Ta(e,t){return e==null?e:{start_authentication_url:e.start_authentication_url}}function qa(e,t){return e==null?e:{id:e.id,type:H(e.type),authentication_method:W(e.authentication_method),options:Da(e.options)}}function Aa(e,t){return e==null?e:{id:e.id,type:H(e.type),authentication_method:W(e.authentication_method),options:h(e,"options")?e.options:void 0}}function Oa(e,t){return e==null?e:{id:e.id,type:H(e.type),authentication_method:W(e.authentication_method),options:h(e,"options")?e.options:void 0}}function Na(e){return La(e)}function La(e,t){if(e==null)return e;switch(e.type){case"nonce":return{...da(e,!0),type:"nonce"};case"oidc":return{...la(e,!0),type:"oidc"};case"otp":return{...fa(e,!0),type:"otp"};case"password_reset":return{...$a(e,!0),type:"password_reset"};case"password_set":return{...Ca(e,!0),type:"password_set"};case"password_verify":return{...ka(e,!0),type:"password_verify"};case"proxy":return{...xa(e,!0),type:"proxy"};case"saml":return{...qa(e,!0),type:"saml"};case"webauthn_create":return{...Aa(e,!0),type:"webauthn_create"};case"webauthn_get":return{...Oa(e,!0),type:"webauthn_get"};default:throw new Error(`No variant of ChallengeListInner exists with 'type=${e.type}'`)}}function Pa(e){return Ua(e)}function Ua(e,t){return e}const le={AuthenticationSucceededV1:"AuthenticationSucceeded_v1",AuthenticationFailedV1:"AuthenticationFailed_v1",PersonCreatedV1:"PersonCreated_v1",PersonDeletedV1:"PersonDeleted_v1",VirtualPageLoadedV1:"VirtualPageLoaded_v1",SlashIdsdkLoadedV1:"SlashIDSDKLoaded_v1",PersonIdentifiedV1:"PersonIdentified_v1",PersonLoggedOutV1:"PersonLoggedOut_v1",TokenMintedV1:"TokenMinted_v1",GateServerStartedV1:"GateServerStarted_v1",GateRequestHandledV1:"GateRequestHandled_v1"};function Ma(e){if(e!==void 0)return e===null?null:{event_name:e.event_name,person_id:e.person_id,authenticated_methods:e.authenticated_methods===void 0?void 0:e.authenticated_methods.map(Xr),failed_authn_method:e.failed_authn_method,failure_reason:e.failure_reason,failure_detail:e.failure_detail,handle:nt(e.handle),challenge_id:e.challenge_id}}function Ba(e){if(e!==void 0)return e===null?null:{event_name:e.event_name,person_id:e.person_id,success_authn_method:e.success_authn_method,authenticated_methods:e.authenticated_methods.map(Xr),handle:nt(e.handle)}}function Ga(e){if(e!==void 0)return e===null?null:{event_name:e.event_name,person_id:e.person_id}}function Va(e){if(e!==void 0)return e===null?null:{event_name:e.event_name,person_id:e.person_id}}function Fa(e){if(e!==void 0)return e===null?null:{event_name:e.event_name}}function Ya(e){if(e!==void 0)return e===null?null:{event_name:e.event_name,person_id:e.person_id}}function Ha(e){if(e!==void 0){if(e===null)return null;switch(e.event_name){case"AuthenticationFailed_v1":return Ma(e);case"AuthenticationSucceeded_v1":return Ba(e);case"PersonIdentified_v1":return Ga(e);case"PersonLoggedOut_v1":return Va(e);case"SlashIDSDKLoaded_v1":return Fa(e);case"VirtualPageLoaded_v1":return Ya(e);default:throw new Error(`No variant of EventPostRequestEventData exists with 'event_name=${e.event_name}'`)}}}function Bn(e){if(e!==void 0)return e===null?null:{organization_id:e.organization_id,analytics_correlation_id:e.analytics_correlation_id,window_location:e.window_location,user_agent:e.user_agent,event_data:Ha(e.event_data)}}function Wa(e){return za(e)}function za(e,t){return e==null?e:{params:h(e,"params")?e.params:void 0,type:Pa(e.type),label:h(e,"label")?e.label:void 0,id:e.id,last_used:h(e,"last_used")?new Date(e.last_used):void 0}}const Ce={Popup:"popup",Redirect:"redirect"};function Ka(e){let t=!0;return t=t&&"client_id"in e,t=t&&"provider"in e,t}function ja(e){if(e!==void 0)return e===null?null:{client_id:e.client_id,provider:e.provider,ux_mode:e.ux_mode,redirect_target:e.redirect_target,requires_groups:e.requires_groups,pkce_code_challenge:e.pkce_code_challenge,csrf_token:e.csrf_token}}const ke={Popup:"popup",Redirect:"redirect"};function Ja(e){let t=!0;return t=t&&"provider_credentials_id"in e,t}function Xa(e){if(e!==void 0)return e===null?null:{provider_credentials_id:e.provider_credentials_id,ux_mode:e.ux_mode,redirect_target:e.redirect_target,pkce_code_challenge:e.pkce_code_challenge,csrf_token:e.csrf_token}}const Za={None:"none",Indirect:"indirect",Direct:"direct"};const Gn={Any:"any",Platform:"platform",CrossPlatform:"cross_platform"};const Qa={Discouraged:"discouraged",Preferred:"preferred",Required:"required"};const eo={Discouraged:"discouraged",Preferred:"preferred",Required:"required"};function to(e){return!0}function no(e){if(e!==void 0)return e===null?null:{scope:e.scope,available_credential_ids:e.available_credential_ids,attachment:e.attachment,user_verification:e.user_verification,resident_key:e.resident_key,attestation:e.attestation}}function ro(e){if(e!==void 0)return e===null?null:Ka(e)?ja(e):Ja(e)?Xa(e):to(e)?no(e):{}}function so(e){if(e!==void 0)return e===null?null:{method:e.method,options:ro(e.options)}}function io(e){return ao(e)}function ao(e,t){return e}function oo(e){return e}function co(e){return uo(e)}function uo(e,t){return e==null?e:{consent_level:io(e.consent_level),created_at:new Date(e.created_at)}}function Vn(e){if(e!==void 0)return e===null?null:{consent_levels:e.consent_levels.map(oo)}}function es(e){return lo(e)}function lo(e,t){return e==null?e:{consents:e.consents.map(co)}}function fo(e){return po(e)}function po(e,t){return e==null?e:{meta:h(e,"meta")?M(e.meta):void 0,errors:h(e,"errors")?e.errors.map(B):void 0,result:h(e,"result")?e.result:void 0}}function ho(e){return go(e)}function go(e,t){return e==null?e:{meta:h(e,"meta")?M(e.meta):void 0,errors:h(e,"errors")?e.errors.map(B):void 0,result:h(e,"result")?e.result:void 0}}function Fn(e){return _o(e)}function _o(e,t){return e==null?e:{meta:h(e,"meta")?M(e.meta):void 0,errors:h(e,"errors")?e.errors.map(B):void 0,result:h(e,"result")?e.result:void 0}}function At(e){return mo(e)}function mo(e,t){return e==null?e:{meta:h(e,"meta")?M(e.meta):void 0,errors:h(e,"errors")?e.errors.map(B):void 0,result:h(e,"result")?e.result:void 0}}function bo(e){return wo(e)}function wo(e,t){return e==null?e:{meta:h(e,"meta")?M(e.meta):void 0,errors:h(e,"errors")?e.errors.map(B):void 0,result:h(e,"result")?es(e.result):void 0}}function yo(e){return So(e)}function So(e,t){return e==null?e:{id:e.id,org_name:e.org_name,tenant_name:e.tenant_name}}function $o(e){return Eo(e)}function Eo(e,t){return e==null?e:{id:e.id,org_name:e.org_name,tenant_name:e.tenant_name,managed_organizations:h(e,"managed_organizations")?e.managed_organizations.map(yo):void 0}}function vo(e){return Co(e)}function Co(e,t){return e==null?e:{active:e.active,person_id:e.person_id,roles:h(e,"roles")?e.roles:void 0,region:e.region,handles:h(e,"handles")?e.handles.map(Zr):void 0,groups:h(e,"groups")?e.groups:void 0,attributes:h(e,"attributes")?e.attributes:void 0}}function ko(e){return Ro(e)}function Ro(e,t){return e==null?e:{person:vo(e.person),organizations:e.organizations.map($o),handles:e.handles.map(Zr),credentials:e.credentials.map(Wa)}}function Io(e){return xo(e)}function xo(e,t){return e==null?e:{meta:h(e,"meta")?M(e.meta):void 0,errors:h(e,"errors")?e.errors.map(B):void 0,result:ko(e.result)}}function Do(e){if(e!==void 0)return e===null?null:{handle:nt(e.handle),factor:so(e.factor)}}function To(e){return qo(e)}function qo(e,t){return e==null?e:{meta:h(e,"meta")?M(e.meta):void 0,errors:h(e,"errors")?e.errors.map(B):void 0,result:h(e,"result")?e.result:void 0}}function Ot(e){return Ao(e)}function Ao(e,t){return e==null?e:{meta:h(e,"meta")?M(e.meta):void 0,errors:h(e,"errors")?e.errors.map(B):void 0,result:h(e,"result")?e.result.map(Na):void 0}}function Oo(e){if(e!==void 0)return e===null?null:{challenge_id:e.challenge_id,code:e.code,pkce_code_verifier:e.pkce_code_verifier}}function No(e){return Lo(e)}function Lo(e,t){return e==null?e:{valid:e.valid,invalidity_reason:h(e,"invalidity_reason")?e.invalidity_reason:void 0,expires_in_seconds:h(e,"expires_in_seconds")?e.expires_in_seconds:void 0,expires_at:h(e,"expires_at")?new Date(e.expires_at):void 0}}function Po(e){return Uo(e)}function Uo(e,t){return e==null?e:{meta:h(e,"meta")?M(e.meta):void 0,errors:h(e,"errors")?e.errors.map(B):void 0,result:h(e,"result")?No(e.result):void 0}}function Yn(e){return Mo(e)}function Mo(e,t){return e==null?e:{meta:h(e,"meta")?M(e.meta):void 0,errors:h(e,"errors")?e.errors.map(B):void 0,result:es(e.result)}}function Bo(e){if(e!==void 0)return e===null?null:{method:e.method}}function Go(e){if(e!==void 0)return e===null?null:{handle:nt(e.handle),factor:Bo(e.factor)}}function Vo(e){if(e!==void 0)return e===null?null:{token:e.token}}class Hn extends re{async deleteAttributesBucketNameRaw(t,n){if(t.bucketName===null||t.bucketName===void 0)throw new y("bucketName","Required parameter requestParameters.bucketName was null or undefined when calling deleteAttributesBucketName.");const r={};t.attributes&&(r.attributes=t.attributes.join(Tt.csv));const s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/attributes/{bucket_name}".replace("{bucket_name}",encodeURIComponent(String(t.bucketName))),method:"DELETE",headers:s,query:r},n);return new $(i,a=>qt(a))}async deleteAttributesBucketName(t,n){return await(await this.deleteAttributesBucketNameRaw(t,n)).value()}async getAttributesRaw(t,n){const r={};t.buckets&&(r.buckets=t.buckets.join(Tt.csv));const s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/attributes",method:"GET",headers:s,query:r},n);return new $(i,a=>fo(a))}async getAttributes(t={},n){return await(await this.getAttributesRaw(t,n)).value()}async getAttributesBucketNameRaw(t,n){if(t.bucketName===null||t.bucketName===void 0)throw new y("bucketName","Required parameter requestParameters.bucketName was null or undefined when calling getAttributesBucketName.");const r={};t.attributes&&(r.attributes=t.attributes.join(Tt.csv));const s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/attributes/{bucket_name}".replace("{bucket_name}",encodeURIComponent(String(t.bucketName))),method:"GET",headers:s,query:r},n);return new $(i,a=>ho(a))}async getAttributesBucketName(t,n){return await(await this.getAttributesBucketNameRaw(t,n)).value()}async putAttributesRaw(t,n){if(t.body===null||t.body===void 0)throw new y("body","Required parameter requestParameters.body was null or undefined when calling putAttributes.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/attributes",method:"PUT",headers:s,query:r,body:t.body},n);return new $(i,a=>qt(a))}async putAttributes(t,n){return await(await this.putAttributesRaw(t,n)).value()}async putAttributesBucketNameRaw(t,n){if(t.bucketName===null||t.bucketName===void 0)throw new y("bucketName","Required parameter requestParameters.bucketName was null or undefined when calling putAttributesBucketName.");if(t.body===null||t.body===void 0)throw new y("body","Required parameter requestParameters.body was null or undefined when calling putAttributesBucketName.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/attributes/{bucket_name}".replace("{bucket_name}",encodeURIComponent(String(t.bucketName))),method:"PUT",headers:s,query:r,body:t.body},n);return new $(i,a=>qt(a))}async putAttributesBucketName(t,n){return await(await this.putAttributesBucketNameRaw(t,n)).value()}}class je extends re{async getChallengeChallengeIdRaw(t,n){if(t.challengeId===null||t.challengeId===void 0)throw new y("challengeId","Required parameter requestParameters.challengeId was null or undefined when calling getChallengeChallengeId.");const r={},s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/challenge/{challenge_id}".replace("{challenge_id}",encodeURIComponent(String(t.challengeId))),method:"GET",headers:s,query:r},n);return new $(i,a=>Fn(a))}async getChallengeChallengeId(t,n){return await(await this.getChallengeChallengeIdRaw(t,n)).value()}async getChallengeChallengeIdV2Raw(t,n){if(t.challengeId===null||t.challengeId===void 0)throw new y("challengeId","Required parameter requestParameters.challengeId was null or undefined when calling getChallengeChallengeIdV2.");const r={},s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/challenge/{challenge_id}/v2".replace("{challenge_id}",encodeURIComponent(String(t.challengeId))),method:"GET",headers:s,query:r},n);return new $(i,a=>At(a))}async getChallengeChallengeIdV2(t,n){return await(await this.getChallengeChallengeIdV2Raw(t,n)).value()}async getChallengePackChallengePackIdRaw(t,n){if(t.challengePackId===null||t.challengePackId===void 0)throw new y("challengePackId","Required parameter requestParameters.challengePackId was null or undefined when calling getChallengePackChallengePackId.");const r={},s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/challenge_pack/{challenge_pack_id}".replace("{challenge_pack_id}",encodeURIComponent(String(t.challengePackId))),method:"GET",headers:s,query:r},n);return new $(i,a=>Ot(a))}async getChallengePackChallengePackId(t,n){return await(await this.getChallengePackChallengePackIdRaw(t,n)).value()}async getMeRaw(t){const n={},r={};if(this.configuration&&this.configuration.accessToken){const i=this.configuration.accessToken,a=await i("Bearer",[]);a&&(r.Authorization=`Bearer ${a}`)}const s=await this.request({path:"/me",method:"GET",headers:r,query:n},t);return new $(s,i=>Io(i))}async getMe(t){return await(await this.getMeRaw(t)).value()}async getTokenRaw(t,n){if(t.slashIDOrgID===null||t.slashIDOrgID===void 0)throw new y("slashIDOrgID","Required parameter requestParameters.slashIDOrgID was null or undefined when calling getToken.");const r={},s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),t.slashIDOrgID!==void 0&&t.slashIDOrgID!==null&&(s["SlashID-OrgID"]=String(t.slashIDOrgID)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/token",method:"GET",headers:s,query:r},n);return new $(i,a=>At(a))}async getToken(t,n){return await(await this.getTokenRaw(t,n)).value()}async postAttestationRaw(t,n){if(t.attestation===null||t.attestation===void 0)throw new y("attestation","Required parameter requestParameters.attestation was null or undefined when calling postAttestation.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/attestation",method:"POST",headers:s,query:r,body:Mn(t.attestation)},n);return new $(i,a=>Fn(a))}async postAttestation(t,n){return await(await this.postAttestationRaw(t,n)).value()}async postAttestationV2Raw(t,n){if(t.attestation===null||t.attestation===void 0)throw new y("attestation","Required parameter requestParameters.attestation was null or undefined when calling postAttestationV2.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/attestation/v2",method:"POST",headers:s,query:r,body:Mn(t.attestation)},n);return new $(i,a=>At(a))}async postAttestationV2(t,n){return await(await this.postAttestationV2Raw(t,n)).value()}async postDirectIdRaw(t,n){const r={},s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/direct-id",method:"POST",headers:s,query:r},n);return new $(i,a=>To(a))}async postDirectId(t={},n){return await(await this.postDirectIdRaw(t,n)).value()}async postIdRaw(t,n){if(t.slashIDOrgID===null||t.slashIDOrgID===void 0)throw new y("slashIDOrgID","Required parameter requestParameters.slashIDOrgID was null or undefined when calling postId.");if(t.iDRequest===null||t.iDRequest===void 0)throw new y("iDRequest","Required parameter requestParameters.iDRequest was null or undefined when calling postId.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDOrgID!==void 0&&t.slashIDOrgID!==null&&(s["SlashID-OrgID"]=String(t.slashIDOrgID)),t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/id",method:"POST",headers:s,query:r,body:Do(t.iDRequest)},n);return new $(i,a=>Ot(a))}async postId(t,n){return await(await this.postIdRaw(t,n)).value()}async postRecoverRaw(t,n){if(t.slashIDOrgID===null||t.slashIDOrgID===void 0)throw new y("slashIDOrgID","Required parameter requestParameters.slashIDOrgID was null or undefined when calling postRecover.");if(t.recoverRequest===null||t.recoverRequest===void 0)throw new y("recoverRequest","Required parameter requestParameters.recoverRequest was null or undefined when calling postRecover.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDOrgID!==void 0&&t.slashIDOrgID!==null&&(s["SlashID-OrgID"]=String(t.slashIDOrgID)),t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/recover",method:"POST",headers:s,query:r,body:Go(t.recoverRequest)},n);return new $(i,a=>Ot(a))}async postRecover(t,n){return await(await this.postRecoverRaw(t,n)).value()}async postSsoResolveRaw(t,n){if(t.slashIDOrgID===null||t.slashIDOrgID===void 0)throw new y("slashIDOrgID","Required parameter requestParameters.slashIDOrgID was null or undefined when calling postSsoResolve.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDOrgID!==void 0&&t.slashIDOrgID!==null&&(s["SlashID-OrgID"]=String(t.slashIDOrgID)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/sso/resolve",method:"POST",headers:s,query:r,body:Oo(t.postSsoResolveRequest)},n);return new Ke(i)}async postSsoResolve(t,n){await this.postSsoResolveRaw(t,n)}}class Fo extends re{async postActionsSdkRaw(t,n){if(t.eventPostRequest===null||t.eventPostRequest===void 0)throw new y("eventPostRequest","Required parameter requestParameters.eventPostRequest was null or undefined when calling postActionsSdk.");const r={},s={};if(s["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/actions/sdk",method:"POST",headers:s,query:r,body:Bn(t.eventPostRequest)},n);return new Ke(i)}async postActionsSdk(t,n){await this.postActionsSdkRaw(t,n)}async postEventsRaw(t,n){if(t.eventPostRequest===null||t.eventPostRequest===void 0)throw new y("eventPostRequest","Required parameter requestParameters.eventPostRequest was null or undefined when calling postEvents.");const r={},s={};if(s["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/events",method:"POST",headers:s,query:r,body:Bn(t.eventPostRequest)},n);return new Ke(i)}async postEvents(t,n){await this.postEventsRaw(t,n)}}class Wn extends re{async deleteConsentGdprRaw(t,n){const r={};t.consentLevels&&(r.consent_levels=t.consentLevels),t.deleteAll!==void 0&&(r.deleteAll=t.deleteAll);const s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/consent/gdpr",method:"DELETE",headers:s,query:r},n);return new Ke(i)}async deleteConsentGdpr(t={},n){await this.deleteConsentGdprRaw(t,n)}async getConsentGdprRaw(t,n){const r={},s={};if(t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/consent/gdpr",method:"GET",headers:s,query:r},n);return new $(i,a=>bo(a))}async getConsentGdpr(t={},n){return await(await this.getConsentGdprRaw(t,n)).value()}async postConsentGdprRaw(t,n){if(t.gDPRConsentRequest===null||t.gDPRConsentRequest===void 0)throw new y("gDPRConsentRequest","Required parameter requestParameters.gDPRConsentRequest was null or undefined when calling postConsentGdpr.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/consent/gdpr",method:"POST",headers:s,query:r,body:Vn(t.gDPRConsentRequest)},n);return new $(i,a=>Yn(a))}async postConsentGdpr(t,n){return await(await this.postConsentGdprRaw(t,n)).value()}async putConsentGdprRaw(t,n){if(t.gDPRConsentRequest===null||t.gDPRConsentRequest===void 0)throw new y("gDPRConsentRequest","Required parameter requestParameters.gDPRConsentRequest was null or undefined when calling putConsentGdpr.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/consent/gdpr",method:"PUT",headers:s,query:r,body:Vn(t.gDPRConsentRequest)},n);return new $(i,a=>Yn(a))}async putConsentGdpr(t,n){return await(await this.putConsentGdprRaw(t,n)).value()}}class zn extends re{async postTokenValidateRaw(t,n){if(t.validateTokenReq===null||t.validateTokenReq===void 0)throw new y("validateTokenReq","Required parameter requestParameters.validateTokenReq was null or undefined when calling postTokenValidate.");const r={},s={};if(s["Content-Type"]="application/json",t.slashIDSdkVersion!==void 0&&t.slashIDSdkVersion!==null&&(s["SlashID-SdkVersion"]=String(t.slashIDSdkVersion)),this.configuration&&this.configuration.accessToken){const a=this.configuration.accessToken,o=await a("Bearer",[]);o&&(s.Authorization=`Bearer ${o}`)}const i=await this.request({path:"/token/validate",method:"POST",headers:s,query:r,body:Vo(t.validateTokenReq)},n);return new $(i,a=>Po(a))}async postTokenValidate(t,n){return await(await this.postTokenValidateRaw(t,n)).value()}}function Yo(){const n=window.screenX+(window.innerWidth-400)/2;return`width=400,height=600,top=${window.screenY+(window.innerHeight-600)/2},left=${n},resizable,scrollbars=yes,status=1`}function ts(){const e=Yo(),t=window.open(window.location.href,"/id:popup",e);if(!t)throw new Error("SlashId: Popup blocked, please consider redirect instead");const n='<div style="position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);">You will be redirected in a moment...</div>';try{var r;t==null||(r=t.document)===null||r===void 0||r.write(n)}catch(i){console.error(i),t.document&&t.document.body&&(t.document.body.innerHTML=n)}finally{t.blur()}return[t,i=>(t&&(t.location=i,t.focus()),t)]}function Ho(e,t){return e.origin+e.pathname===t.origin+t.pathname}function ns(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}var Ge,Wo=new Uint8Array(16);function zo(){if(!Ge&&(Ge=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Ge))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ge(Wo)}var Ko=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function jo(e){return typeof e=="string"&&Ko.test(e)}var Jo=jo,R=[];for(var Nt=0;Nt<256;++Nt)R.push((Nt+256).toString(16).substr(1));function Xo(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(R[e[t+0]]+R[e[t+1]]+R[e[t+2]]+R[e[t+3]]+"-"+R[e[t+4]]+R[e[t+5]]+"-"+R[e[t+6]]+R[e[t+7]]+"-"+R[e[t+8]]+R[e[t+9]]+"-"+R[e[t+10]]+R[e[t+11]]+R[e[t+12]]+R[e[t+13]]+R[e[t+14]]+R[e[t+15]]).toLowerCase();if(!Jo(n))throw TypeError("Stringified UUID is invalid");return n}var Zo=Xo;function Qo(e,t,n){e=e||{};var r=e.random||(e.rng||zo)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var s=0;s<16;++s)t[n+s]=r[s];return t}return Zo(r)}var Re=Qo;function fe(e){const t=e.replace(/_/g,"/").replace(/-/g,"+"),n=atob(t);return Uint8Array.from(n,r=>r.charCodeAt(0))}function z(e,t=!0){const n=String.fromCharCode(...e),r=btoa(n);return t?r.replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,""):r}const ed="challenges",td="sidcp",Yt="@SLASHID/CSRF_TOKEN",Ht="@SLASHID/PKCE_CODE_VERIFIER";var O;(function(e){e[e.StorageGetItem=0]="StorageGetItem",e[e.StorageSetItem=1]="StorageSetItem",e[e.Ping=2]="Ping",e[e.ChallengeWebauthnCreate=3]="ChallengeWebauthnCreate",e[e.ChallengeWebauthnGet=4]="ChallengeWebauthnGet",e[e.SSOChallenge=5]="SSOChallenge"})(O||(O={}));class nd{constructor(){this.id=Ne(),this.type=O.Ping}}class Kn{constructor(t,n){this.id=t,this.error=n}}class rd{constructor(t,n){this.type=O.ChallengeWebauthnCreate,this.id=Ne(),this.slashIDOptions=t,this.challenge=n}}class jn{constructor(t,n,r){this.id=t,this.attestation=n,this.error=r}}class sd{constructor(t,n){this.type=O.ChallengeWebauthnGet,this.id=Ne(),this.slashIDOptions=t,this.challenge=n}}class Jn{constructor(t,n,r){this.id=t,this.attestation=n,this.error=r}}class id{constructor(t){this.type=O.StorageGetItem,this.id=Ne(),this.key=t}}class Xn{constructor(t,n,r){this.id=t,this.value=n,this.error=r}}class ad{constructor(t,n){this.id=Ne(),this.type=O.StorageSetItem,this.key=t,this.value=n}}class Zn{constructor(t,n){this.id=t,this.error=n}}function Ne(){const e=new Uint32Array(1);return window.crypto.getRandomValues(e),e[0]}function Qn(e){const t=new URLSearchParams(e),n=t.get("sso_challenge_id"),r=t.get("sso_code"),s=t.get("csrf_token");return!n||!r||!s?null:{ssoChallengeID:n,ssoCode:r,csrfToken:s}}function od(e){return e.type===O.ChallengeWebauthnCreate}function dd(e){return e.type===O.ChallengeWebauthnGet}function cd(e){return e&&e.type===O.SSOChallenge}function ud(e){return e.type===O.Ping}function ld(e){return typeof e=="object"&&!!e.baseURL&&!!e.sdkURL}const fd=["http:","https:"];function pd(e){if(!e)throw new TypeError("options cannot be null");if(e.environment){if(typeof e.environment=="string"&&e.environment!=="production"&&e.environment!=="sandbox")throw new TypeError("If 'environment' is set as a string, it must be either 'production' or 'sandbox'");if(typeof e.environment=="object"){if(typeof e.environment.baseURL!="string")throw new TypeError("'environment.baseURL' must be a string");if(typeof e.environment.sdkURL!="string")throw new TypeError("'environment.sdkURL' must be a string")}}if(e.environment&&(e.baseURL||e.sdkURL))throw new TypeError("If 'environment' is set, 'baseURL' and 'sdkURL' cannot be set at the same time. Use a custom environment instead.");if(e.baseURL){if(typeof e.baseURL!="string")throw new TypeError("'baseURL' must be a string");let r;try{r=new URL(e.baseURL)}catch{throw new TypeError("'baseURL' must be a valid URL")}if(fd.indexOf(r.protocol)===-1)throw new TypeError("'baseURL' must be either an http or https URL")}if(e.sdkURL){if(typeof e.sdkURL!="string")throw new TypeError("'sdkURL' must be a string");try{new URL(e.sdkURL)}catch{throw new TypeError("'sdkURL' must be a valid URL")}}const{analyticsEnabled:t=!0,oid:n}=e;if(t&&!n)throw new Error("Analytics require the 'oid' parameter to be set when instantiating SlashID()")}function hd(e){return e.environment?gd(e.environment):{baseURL:e.baseURL||Wt.production.baseURL,sdkURL:e.sdkURL||Wt.production.sdkURL}}const Wt={production:{baseURL:"https://api.slashid.com",sdkURL:"https://cdn.slashid.com/sdk.html"},sandbox:{baseURL:"https://api.sandbox.slashid.com",sdkURL:"https://cdn.sandbox.slashid.com/sdk.html"}};function gd(e){if(typeof e=="string")return Wt[e];if(ld(e))return{baseURL:e.baseURL,sdkURL:e.sdkURL};throw new TypeError("'environment' must be either a string or an object")}function rs(e){const t=hd(e);var n;return{oid:e.oid,analyticsEnabled:(n=e.analyticsEnabled)!==null&&n!==void 0?n:!0,...t}}class er{constructor(t){this.getOTP=t?.getOTP}}async function ss(){const e=Re(),t=Re()+Re(),n=new TextEncoder().encode(t),r=await window.crypto.subtle.digest("SHA-256",n),s=z(new Uint8Array(r));return window.localStorage.setItem(Yt,e),window.localStorage.setItem(Ht,t),{csrf_token:e,pkce_code_challenge:s}}async function _d(e){if(e.method!=="oidc")throw new Error(`Can't create OIDC extras for method: ${e.method}`);let t={};const{client_id:n,provider:r}=e.options;let{ux_mode:s,redirect_target:i}=e.options;if(s||(s=Ce.Popup),i||(i=window.location.href),s===Ce.Redirect&&!ns(i))throw new Error(`If OIDC ux_mode was set to "redirect" a "redirect_target" is required, got ${i}`);if(s===Ce.Popup){const[d,c]=ts();t={...t,popup:d,setPopupUrl:c}}const{csrf_token:a,pkce_code_challenge:o}=await ss();return{...e,options:{...e.options,client_id:n,provider:r,ux_mode:s,redirect_target:i,csrf_token:a,pkce_code_challenge:o},extras:t}}async function md(e){if(e.method!=="saml")throw new Error(`Can't create SAML extras for method: ${e.method}`);let t={},{ux_mode:n,redirect_target:r}=e.options;if(n||(n=ke.Popup),r||(r=window.location.href),n===ke.Redirect&&!ns(r))throw new Error(`If SAML ux_mode was set to "redirect" a "redirect_target" is required, got ${r}`);if(n===ke.Popup){const[a,o]=ts();t={...t,popup:a,setPopupUrl:o}}const{csrf_token:s,pkce_code_challenge:i}=await ss();return{...e,options:{...e.options,ux_mode:n,redirect_target:r,csrf_token:s,pkce_code_challenge:i},extras:t}}function zt(e){this.message=e}zt.prototype=new Error,zt.prototype.name="InvalidCharacterError";var tr=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new zt("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,s=0,i=0,a="";r=t.charAt(i++);~r&&(n=s%4?64*n+r:r,s++%4)&&(a+=String.fromCharCode(255&n>>(-2*s&6))))r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function bd(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(tr(n).replace(/(.)/g,function(r,s){var i=s.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}(t)}catch{return tr(t)}}function Je(e){this.message=e}function wd(e,t){if(typeof e!="string")throw new Je("Invalid token specified");var n=(t=t||{}).header===!0?0:1;try{return JSON.parse(bd(e.split(".")[n]))}catch(r){throw new Je("Invalid token specified: "+r.message)}}Je.prototype=new Error,Je.prototype.name="InvalidTokenError";var Lt=wd;const yd={end_user_read_write:"end_user_read_write",end_user_read_only:"end_user_read_only",end_user_no_access:"end_user_no_access","person_pool-end_user_read_write":"person_pool-end_user_read_write","person_pool-end_user_read_only":"person_pool-end_user_read_only","person_pool-end_user_no_access":"person_pool-end_user_no_access"};class Sd{async get(t){const n=await this.user.getAttributesClient().getAttributesBucketName({bucketName:this.bucketName,attributes:t,slashIDSdkVersion:I.raw},{cache:"no-cache"}),r=n.errors;if(r)throw r;return n.result}async set(t){const r=(await this.user.getAttributesClient().putAttributesBucketName({bucketName:this.bucketName,body:t,slashIDSdkVersion:I.raw},{cache:"no-cache"})).errors;if(r)throw r}async delete(t){const r=(await this.user.getAttributesClient().deleteAttributesBucketName({bucketName:this.bucketName,slashIDSdkVersion:I.raw,attributes:t},{cache:"no-cache"})).errors;if(r)throw r}constructor({user:t,bucketName:n}){this.user=t,this.bucketName=n}}function $d(e){return e?typeof e.user_token=="string":!1}class is{get decoded(){if(!this._token)throw new Error("Cannot call methods on unauthenticated user");try{return Lt(this._token)}catch(t){throw new TypeError(t.toString())}}get tokenClaims(){return this.decoded}get decodedTokenContainer(){if(this._tokenContainer)try{return Lt(this._tokenContainer)}catch(t){throw new TypeError(t.toString())}}get tokenContainerClaims(){return this.decodedTokenContainer}updateClient(t){var n;this._token=t;const r=new he({...ge,...((n=this._clientOptions)===null||n===void 0?void 0:n.baseURL)&&{basePath:this._clientOptions.baseURL},accessToken:t});this._apiClient=new je(r),this._attrsClient=new Hn(r),this._tokenClient=new zn(r),this._personConsentsApi=new Wn(r)}get ID(){return this.decoded.person_id}get token(){var t;return(t=this._token)!==null&&t!==void 0?t:""}get tokenContainer(){return this._tokenContainer||""}get oid(){return this.decoded.oid}get firstLogin(){return this.decoded.first_token}get authentication(){return this.decoded.authenticated_methods||[]}get authentications(){return this.decoded.authentications||[]}async createDirectID(){const{result:t}=await this._apiClient.postDirectId({slashIDSdkVersion:I.raw});return t}async logout(){this.updateClient(void 0),this._tokenContainer=void 0}async validateToken(){var t;const n=await((t=this._tokenClient)===null||t===void 0?void 0:t.postTokenValidate({validateTokenReq:{token:this.token},slashIDSdkVersion:I.raw},{cache:"no-cache"})),r=n.errors;if(r)throw r;return n.result}getGroups(){const t=this.decoded.groups_claim_name||"groups";return this.decoded[t]}getAttributesClient(){return this._attrsClient}getBucket(t=yd.end_user_read_write){return new Sd({user:this,bucketName:t})}async get(t){return this.getBucket().get(t)}async set(t){return this.getBucket().set(t)}async delete(t){return this.getBucket().delete(t)}async getGDPRConsent(){const t=await this._personConsentsApi.getConsentGdpr({slashIDSdkVersion:I.raw}),n=t.errors;if(n)throw n;return t.result}async setGDPRConsent({consentLevels:t}){const n=await this._personConsentsApi.putConsentGdpr({gDPRConsentRequest:{consent_levels:t},slashIDSdkVersion:I.raw}),r=n.errors;if(r)throw r;return n.result}async addGDPRConsent({consentLevels:t}){const n=await this._personConsentsApi.postConsentGdpr({gDPRConsentRequest:{consent_levels:t},slashIDSdkVersion:I.raw}),r=n.errors;if(r)throw r;return n.result}async removeGDPRConsent({consentLevels:t}){return this._personConsentsApi.deleteConsentGdpr({slashIDSdkVersion:I.raw,consentLevels:t})}async removeGDPRConsentAll(){return this._personConsentsApi.deleteConsentGdpr({slashIDSdkVersion:I.raw,deleteAll:!0})}async getOrganizations(){const t=await this._apiClient.getMe(),n=t.errors;if(n)throw n;return t.result.organizations}async getHandles(){const{errors:t,result:n}=await this._apiClient.getMe();if(t)throw t;return n.handles}async getTokenForOrganization(t){const n=await this._apiClient.getToken({slashIDOrgID:t,slashIDSdkVersion:I.raw}),r=n.errors;if(r)throw r;return n.result}toString(){var t,n;return(n=(t=this._tokenContainer)!==null&&t!==void 0?t:this._token)!==null&&n!==void 0?n:""}toJSON(){var t,n;return`${(n=(t=this._tokenContainer)!==null&&t!==void 0?t:this._token)!==null&&n!==void 0?n:""}`}constructor(t,n){try{t=JSON.parse(t)}catch{}if(typeof t!="string")throw new TypeError("token must be a string");try{const s=Lt(t);$d(s)?(this._token=s.user_token,this._tokenContainer=t):this._token=t}catch(s){throw new TypeError(s.toString())}this._clientOptions=rs(n??{});const r=new he({...ge,...n?.baseURL&&{basePath:n.baseURL},accessToken:this._token});this._apiClient=new je(r),this._attrsClient=new Hn(r),this._tokenClient=new zn(r),this._personConsentsApi=new Wn(r)}}var T={};N(T,"InvalidAuthenticationMethodError",function(){return se});N(T,"isResponseError",function(){return te});N(T,"isRateLimitError",function(){return _n});N(T,"isTimeoutError",function(){return as});N(T,"isBadPasskeyScopeError",function(){return os});N(T,"isThrownResponse",function(){return De});N(T,"isTimeoutInPayload",function(){return ds});N(T,"isRateLimitInPayload",function(){return cs});N(T,"RateLimitError",function(){return Te});N(T,"clientGeneratedErrorSlugs",function(){return us});N(T,"isClientGeneratedErrorSlug",function(){return Ed});N(T,"ensureError",function(){return Kt});N(T,"createEventFromError",function(){return ls});class se extends Error{constructor(t,n){super(`Authentication method '${t}': ${n}`)}}function te(e){return e.name==="ResponseError"&&e.response instanceof Response}function _n(e){var t;return((t=e.response)===null||t===void 0?void 0:t.status)===429}async function as(e){var t,n,r,s;return(((t=e.response)===null||t===void 0?void 0:t.status)===401||((n=e.response)===null||n===void 0?void 0:n.status)===403)&&te(e)&&((r=(await e.response.clone().json()).errors)===null||r===void 0||(s=r[0])===null||s===void 0?void 0:s.message)==="authentication has expired"}async function os(e){var t,n,r;const s=/selected scope '(.*?)' is not equal to or a registrable domain suffix of origin '(.*?)'/;return((t=e.response)===null||t===void 0?void 0:t.status)===400&&te(e)&&s.test((n=(await e.response.clone().json()).errors)===null||n===void 0||(r=n[0])===null||r===void 0?void 0:r.message)}function De(e){return typeof e=="object"&&Array.isArray(e.errors)&&e.errors.every(t=>typeof t.httpcode=="number"&&typeof t.message=="string")}function ds(e){return e.errors.some(t=>t.message==="authentication has expired")}function cs(e){return e.errors.some(t=>t.httpcode===429)}class Te extends Error{static async fromResponseError(t){const r=(await t.response.clone().json()).errors.find(s=>s.httpcode===429);return r?new Te(t,r.message):new Te(t)}constructor(t,n){super(n||"Too many requests!"),this.name="RateLimitError",this.response=t.response}}const us=["incorrect_otp_code_via_email","incorrect_otp_code_via_sms","incorrect_otp_code","invalid_password","incorrect_password","bad_passkey_scope","rate_limit_exceeded","timeout","client_side_error","unspecified"],Ed=e=>us.includes(e);function Kt(e){if(e instanceof Error)return e;let t="[Unable to stringify the thrown value]";try{t=JSON.stringify(e)}catch{}return new Error(`Non-Error thrown: ${t}`)}async function vd(e){if(te(e)||De(e)){let t;try{return te(e)?t=await e.response.clone().json():t=e,JSON.stringify(t)}catch{return Kt(e).message}}return Kt(e).message}async function ls(e,{authenticationFactor:t,handle:n,previousToken:r,challengeId:s}){const i=await(async()=>{if(!te(e)&&!De(e))return null;if(_n(e))return"rate_limit_exceeded";if(await as(e))return"timeout";if(await os(e))return"bad_passkey_scope";if(De(e)){if(ds(e))return"timeout";if(cs(e))return"rate_limit_exceeded"}return"unspecified"})();return{authenticationFactor:t,handle:n,errorText:i||"client_side_error",previousToken:r,challengeId:s,failureDetail:await vd(e)}}function Ie(e){return new Promise(t=>setTimeout(t,e))}function Cd(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(s){s(n)}),(r=e.get("*"))&&r.slice().map(function(s){s(t,n)})}}}async function nr(){const e=document.hasFocus();for(;!e&&!document.hasFocus();)await Ie(50);return e}const rr={PopupBlocked:"Popup blocked",BadOAuthURL:"Bad OAuth sign in URL"},sr={PopupBlocked:"Popup blocked",BadAuthURL:"Bad authentication URL"};function kd(e){return e.errorText==="client_side_error"}const Rd=["otpSmsSent","otpCodeSent","otpIncorrectCodeSubmitted","passwordSetReady","passwordResetReady","passwordVerifyReady","invalidPasswordSubmitted","incorrectPasswordSubmitted","oauthFlowStarted","oauthFlowFailed","userAuthenticatedFromURL","idFlowSucceeded","idFlowStarted","idFlowFailed","webAuthnChallengeProcessed"],Id=["otpCodeSubmitted","passwordSubmitted"],xd=["clientSideError"];function ir(e){return Rd.includes(e)}function Dd(e){return Id.includes(e)}function Pt(e){return xd.includes(e)}function Td(){return Cd()}async function jt(e){return new Promise(async(n,r)=>{const s=new nd;let i=!1;const a=o=>{const d=o.data;d.id===s.id&&(window.removeEventListener("message",a),d.error?r(d.error):(i=!0,n(e)))};for(window.addEventListener("message",a);!i;)e.postMessage(s,"*"),await Ie(50)})}class qd{async getRemoteWindow(){var t;const n=(t=this.remote)===null||t===void 0?void 0:t.contentWindow;if(!n)throw new Error("this context has no remote");return this.remoteReady||(await jt(n),this.remoteReady=!0),n}async processEvent(t){let n=null;if(window.parent&&t.source===window.parent&&(n=window.parent),!!n)switch(t.data.type){case O.StorageGetItem:{const r=t.data;try{const s=await this.localGetItem(r.key);n.postMessage(new Xn(t.data.id,s),"*")}catch(s){n.postMessage(new Xn(t.data.id,null,s),"*")}}break;case O.StorageSetItem:{const r=t.data;try{await this.localSetItem(r.key,r.value),n.postMessage(new Zn(t.data.id),"*")}catch(s){n.postMessage(new Zn(t.data.id,s),"*")}}break}}async localGetItem(t){return window.localStorage.getItem(t)}async remoteGetItem(t){let n=null;return this.remote&&(n=await new Promise((r,s)=>{const i=new id(t),a=o=>{const d=o.data;d.id===i.id&&(window.removeEventListener("message",a),d.error?s(d.error):r(d.value))};window.addEventListener("message",a),this.getRemoteWindow().then(o=>{o.postMessage(i,"*")})})),n}async localSetItem(t,n){return window.localStorage.setItem(t,n)}async remoteSetItem(t,n){this.remote&&await new Promise((r,s)=>{const i=new ad(t,n),a=o=>{const d=o.data;d.id===i.id&&(window.removeEventListener("message",a),d.error?s(d.error):r())};window.addEventListener("message",a),this.getRemoteWindow().then(o=>{o.postMessage(i,"*")})})}constructor(t,n){this.remoteReady=!1,this.remote=t,this.remoteOrigin=n,this.remote||window.addEventListener("message",this.processEvent.bind(this))}}class fs{constructor(t){this.store=t}}class V extends fs{stringify(t){return JSON.stringify(t)}parse(t){return t?JSON.parse(t):[]}async getAll(){const t=this.parse(await this.store.localGetItem(V.LOCAL_STORAGE_IDENTIFIERS_KEY)),n=this.parse(await this.store.remoteGetItem(V.LOCAL_STORAGE_IDENTIFIERS_KEY));return V.merge(t,n)}async add(t){const n=await this.getAll(),r=this.stringify(V.merge(n,[t]));await this.store.localSetItem(V.LOCAL_STORAGE_IDENTIFIERS_KEY,r),await this.store.remoteSetItem(V.LOCAL_STORAGE_IDENTIFIERS_KEY,r)}static identifiersEqual(t,n){return t.type===n.type&&t.value===n.value}static merge(t,n){return t.concat(...n).reduce((r,s)=>{for(const i of r)if(V.identifiersEqual(i,s))return r;return r.push(s),r},[])}}V.LOCAL_STORAGE_IDENTIFIERS_KEY="SLASHID_IDENTIFIERS";class rt extends fs{static identifiersEqual(t,n){return t===n}static merge(t,n){return t.concat(...n).reduce((r,s)=>{for(const i of r)if(rt.identifiersEqual(i,s))return r;return r.push(s),r},[])}}class j extends rt{stringify(t){return JSON.stringify(t)}parse(t){if(!t)return[];let n=null;try{n=JSON.parse(t)}catch{return[t]}return Array.isArray(n)?n.filter(s=>typeof s=="string"):[]}async getAll(){const t=this.parse(await this.store.localGetItem(j.LOCAL_STORAGE_WEBAUTHN_CREDENTIAL_ID_KEY)),n=this.parse(await this.store.remoteGetItem(j.LOCAL_STORAGE_WEBAUTHN_CREDENTIAL_ID_KEY));return j.merge(t,n)}async add(t){const n=await this.getAll(),r=this.stringify(j.merge(n,[t]));await this.store.localSetItem(j.LOCAL_STORAGE_WEBAUTHN_CREDENTIAL_ID_KEY,r),await this.store.remoteSetItem(j.LOCAL_STORAGE_WEBAUTHN_CREDENTIAL_ID_KEY,r)}}j.LOCAL_STORAGE_WEBAUTHN_CREDENTIAL_ID_KEY="SLASHID_WEBAUTHN_CREDENTIAL_ID";class qe extends rt{stringify(t){return JSON.stringify(t)}parse(t){if(!t)return{};let n=null;try{n=JSON.parse(t)}catch{return{}}if(typeof n!="object")return{};const r={};for(const s of Object.keys(n)){if(typeof s!="string"||!Array.isArray(n[s]))continue;const i=n[s].filter(a=>typeof a=="string");r[s]=i}return r}async getAll(){return this.parse(await this.store.localGetItem(qe.LOCAL_STORAGE_WEBAUTHN_CREDENTIAL_ID_KEY_V2))}async get(t){return!this.store.remoteOrigin||this.store.remoteOrigin.endsWith(t)?this.v1Storage.getAll():(await this.getAll())[t]||[]}async add(t,n){if(!this.store.remoteOrigin||this.store.remoteOrigin.endsWith(t)){this.v1Storage.add(n);return}const r=await this.getAll(),s=r[t]||[];for(const a of s)if(a===n){console.warn(`Attempted to add already present credential ID: scope=${t} credId=${n}`);return}s.push(n),r[t]=s;const i=this.stringify(r);await this.store.localSetItem(qe.LOCAL_STORAGE_WEBAUTHN_CREDENTIAL_ID_KEY_V2,i)}constructor(t){super(t),this.v1Storage=new j(t)}}qe.LOCAL_STORAGE_WEBAUTHN_CREDENTIAL_ID_KEY_V2="SLASHID_WEBAUTHN_CREDENTIAL_ID_V2";class Ad extends is{async mfa(t,n){let r;if(!t)throw new Error("at least one of PersonHandle or Factor is required");t.type&&t.value&&(r=t),t.method&&(n=t);const s=await this._slashid._id(this.decoded.oid,r,n,this._token);this.updateClient(s._token)}constructor(t,n){super(t,n),this._slashid=n instanceof Ae?n:new Ae(n),this._slashid.updateClient(this._token)}}const ar="@slashid/EVENTS_CORRELATION_ID";class Od{subscribeToDomainEvents(){this.sdk.subscribe("idFlowSucceeded",n=>this.trackAuthenticationSuccess(n)),this.sdk.subscribe("idFlowFailed",n=>this.trackAuthenticationFailure(n)),this.sdk.subscribe("invalidPasswordSubmitted",n=>this.trackAuthenticationFailure({...n,errorText:"invalid_password"})),this.sdk.subscribe("incorrectPasswordSubmitted",n=>this.trackAuthenticationFailure({...n,errorText:"incorrect_password"})),this.sdk.subscribe("otpIncorrectCodeSubmitted",n=>{var r;const s=(()=>{var i,a;return((i=n.factor)===null||i===void 0?void 0:i.method)==="otp_via_email"?"incorrect_otp_code_via_email":((a=n.factor)===null||a===void 0?void 0:a.method)==="otp_via_sms"?"incorrect_otp_code_via_sms":"incorrect_otp_code"})();this.trackAuthenticationFailure({errorText:s,authenticationFactor:{method:(r=n.factor)===null||r===void 0?void 0:r.method},challengeId:n.challengeId})}),_s(this.sdk).subscribe("clientSideError",n=>{this.trackAuthenticationFailure({...n,errorText:"client_side_error"})})}getCorrelationID(){let t=sessionStorage.getItem(ar);return t||(t=Re(),sessionStorage.setItem(ar,t)),t}getFlowID(){return Re()}createEventMetadata({location:t=window.location.href}={}){var n,r,s;return{organization_id:(s=(r=this.sdk.oid)!==null&&r!==void 0?r:(n=this.user)===null||n===void 0?void 0:n.oid)!==null&&s!==void 0?s:"",analytics_correlation_id:this.getCorrelationID(),window_location:t,user_agent:navigator.userAgent}}sendEvent(t){const n=new Blob([JSON.stringify(t)],{type:"application/json"});navigator.sendBeacon(`${this.sdk.baseURL}/actions/sdk`,n)}trackPersonIdentified({user:t}){const n={event_name:le.PersonIdentifiedV1,person_id:t.ID},r={...this.createEventMetadata(),event_data:n};this.sendEvent(r)}trackPersonLoggedOut(t){const n=this.sdk.getUser(t.token),r={event_name:le.PersonLoggedOutV1,person_id:n.ID},s={...this.createEventMetadata(),event_data:r};this.sendEvent(s)}trackAuthenticationSuccess(t){var n;const r=this.sdk.getUser(t.token);this.identify(r);const s={event_name:le.AuthenticationSucceededV1,person_id:r.ID,success_authn_method:(n=t.authenticationFactor)===null||n===void 0?void 0:n.method,authenticated_methods:r.authentication,...t.handle&&{handle:t.handle}},i={...this.createEventMetadata(),event_data:s};this.sendEvent(i)}trackAuthenticationFailure(t){var n,r;const s={event_name:le.AuthenticationFailedV1,failed_authn_method:(n=t.authenticationFactor)===null||n===void 0?void 0:n.method,authenticated_methods:(r=this.user)===null||r===void 0?void 0:r.authentication,failure_reason:t.errorText,...t.handle&&{handle:t.handle},...t.challengeId&&{challenge_id:t.challengeId},...t.failureDetail&&{failure_detail:t.failureDetail}},i={...this.createEventMetadata({}),event_data:s};this.sendEvent(i)}trackSdkLoaded(){const t={...this.createEventMetadata(),event_data:{event_name:le.SlashIdsdkLoadedV1}};this.sendEvent(t)}identify(t){this.user=t,this.trackPersonIdentified({user:t})}logout(){const t=this.user;t&&(this.trackPersonLoggedOut({token:t.token}),this.user=void 0)}trackVirtualPageView(t){const{url:n=window.location.href}=t,r={event_name:le.VirtualPageLoadedV1},s={...this.createEventMetadata({location:n}),event_data:r};this.sendEvent(s)}constructor(t){this.sdk=t.sdk,this.eventsAPI=new Fo(new he({...ge,basePath:this.sdk.baseURL})),this.user=t.user,this.subscribeToDomainEvents(),this.trackSdkLoaded()}}function Nd(e){var t;const n=(t=e.pattern_qualifiers)===null||t===void 0?void 0:t.reduce((s,i)=>i==="case_insensitive"?s+"i":s,"");return new RegExp(e.pattern,n)}function or(e){const t=e.options.validation_rules.regular_expressions;return t?t.map(r=>{const s=Nd(r);return{type:"regex",name:r.name,regexp:s,matchType:r.match_type}}):[]}function dr({password:e,rules:t}){const n=[];return t.forEach(r=>{const s=r.regexp.test(e);(s&&r.matchType==="must_not_match"||!s&&r.matchType==="must_match")&&n.push(r)}),n.length===0?{valid:!0,failedRules:[]}:{valid:!1,failedRules:n}}const cr="__SlashID_iframe",ps=Symbol(),hs=Symbol(),gs=Symbol(),_s=e=>({publish:(t,n)=>e[ps](t,n),subscribe:(t,n)=>e[hs](t,n),unsubscribe:(t,n)=>e[gs](t,n)});class Ae{getAnalytics(){if(!this.analytics)throw new Error("Analytics has to be enabled and oid has to be set to use this method");return this.analytics}static async canGetPublicKeyCredentialsInIFrame(){const t=window;return!!t.chrome&&(!!t.chrome.webstore||!!t.chrome.runtime)}publish(t,n){if(!Dd(t))throw new Error(`Unsupported event name: ${t}`);this.emitter.emit(t,n)}[ps](t,n){if(!Pt(t))throw new Error(`Unsupported event name: ${t}`);this.emitter.emit(t,n)}subscribe(t,n){if(!ir(t))throw new Error(`Unsupported event name: ${t}`);this.emitter.on(t,n)}[hs](t,n){if(!Pt(t))throw new Error(`Unsupported event name: ${t}`);this.emitter.on(t,n)}unsubscribe(t,n){if(!ir(t))throw new Error(`Unsupported event name: ${t}`);this.emitter.off(t,n)}[gs](t,n){if(!Pt(t))throw new Error(`Unsupported event name: ${t}`);this.emitter.off(t,n)}updateClient(t){this.authnClient=new je(new he({...ge,basePath:this.baseURL,accessToken:t}))}resetClient(){this.updateClient(void 0)}async getChallengesFromURL(){const t=window.location.search,n=new URLSearchParams(t);let r;const s=n.get(td),i=n.get(ed);if(s&&i)throw new Error("found both 'challenges' and 'sidcp' URL query parameters");if(s){const a=await this.authnClient.getChallengePackChallengePackId({challengePackId:s,slashIDSdkVersion:I.raw},{cache:"no-cache"});if(a.errors)throw a;r=a.result}else if(i){const a=fe(i),o=new TextDecoder("utf-8").decode(a);r=JSON.parse(o)}return r}async getUserFromURL(){if(!this.urlChallengesUser){let n;try{n=await this.getChallengesFromURL()}catch(r){throw await this.processError(r,{}),r}if(n){var t;const r=Qn(window.location.search);r&&this.resolveSSOChallenge(r);let s;for(const i of n){const a=i;try{s=await this.processChallenge(a,void 0)}catch(o){throw await this.processError(o,{challengeId:a.id,authenticationFactor:{method:a.authentication_method}}),o}this.updateClient(s)}if(this.urlChallengesUser=new is(s,{baseURL:this.baseURL,sdkURL:this.sdkURL}),!((t=this.urlChallengesUser.authentications)===null||t===void 0)&&t.length){const i=this.urlChallengesUser.authentications[this.urlChallengesUser.authentications.length-1];this.emitter.emit("idFlowSucceeded",{token:s,authenticationFactor:{method:i.method},handle:i.handle})}}}return this.urlChallengesUser&&this.emitter.emit("userAuthenticatedFromURL",{token:this.urlChallengesUser.token}),this.urlChallengesUser}async resolveSSOChallenge({ssoChallengeID:t,ssoCode:n,csrfToken:r}){if(!(!t||!n||!r))try{const s=window.localStorage.getItem(Yt);if(!s)throw new Error("no CSRF token stored");if(r!==s)throw new Error("CSRF token mismatch");const i=window.localStorage.getItem(Ht);if(!i)throw new Error("no PKCE code verifier stored");await this.authnClient.postSsoResolve({slashIDOrgID:this.oid,postSsoResolveRequest:{challenge_id:t,code:n,pkce_code_verifier:i}})}catch(s){this.processError(s,{})}finally{window.localStorage.removeItem(Yt),window.localStorage.removeItem(Ht)}}async processEvent(t){if(cd(t.data)){if(t.origin!==this.baseURL)return;const r=Qn(t.data.urlParams);r&&await this.resolveSSOChallenge(r);return}let n=null;if(window.opener&&t.source===window.opener&&(n=window.opener),window.parent&&t.source===window.parent&&(n=window.parent),!!n){if(ud(t.data)){const r=t.data;try{n.postMessage(new Kn(r.id),"*")}catch(s){n.postMessage(new Kn(r.id,s.toString()),"*")}}if(od(t.data)){const r=t.data;try{const s=await this.processWebAuthnCreateChallenge(r.challenge);n.postMessage(new jn(r.id,s),"*")}catch(s){n.postMessage(new jn(r.id,null,s.toString()),"*")}}if(dd(t.data)){const r=t.data;try{const s=await this.processWebAuthnGetChallenge(r.challenge);n.postMessage(new Jn(r.id,s),"*")}catch(s){n.postMessage(new Jn(r.id,null,s.toString()),"*")}}}}async listenForEvents(){window.addEventListener("message",this.processEvent.bind(this))}setupIFrame(){const t=this.getSDKUrl().toString();if(Ho(new URL(window.location.href),new URL(this.sdkURL)))return null;let n=document.getElementById(cr);return n&&n.src!==t&&(n.remove(),n=null),n||(n=document.createElement("iframe"),n.id=cr,n.allow="publickey-credentials-get *",n.src=t,n.style.display="none",document.body.appendChild(n)),n}async getAvailableAuthenticationMethods(t){const n=[D.Password];switch(t){case ue.EmailAddress:n.push(D.EmailLink,D.OtpViaEmail);break;case ue.PhoneNumber:n.push(D.SmsLink,D.OtpViaSms);break;default:throw new Error(`unhandled handle type: ${t}`)}return navigator&&window.PublicKeyCredential&&n.unshift(D.Webauthn),n}getUser(t){return new Ad(t,this)}async id(t,n,r){return this._id(t,n,r)}async _id(t,n,r,s){this.resetClient(),s&&this.updateClient(s);try{if(r)switch(r.method){case D.Webauthn.toString():{if(!(navigator&&window.PublicKeyCredential))throw new se(D.Webauthn,"The WebAuthn API is not available in the current environment");let c=r.options;c||(c={}),c.scope||(c.scope=window.location.hostname);const f=await this.credentialStorage.get(c.scope);if(f&&(c.available_credential_ids=f),c.attachment||(c.attachment=Gn.Any),c.user_verification||(c.user_verification=eo.Preferred),c.resident_key||(c.resident_key=Qa.Preferred),c.attestation||(c.attestation=Za.None),c.attachment===Gn.Platform&&!await window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable())throw new se(D.Webauthn,`This device has no authenticator available with attachment '${c.attachment}'`);r.options=c}break;case D.EmailLink.toString():case D.OtpViaEmail.toString():if(n&&n.type!==ue.EmailAddress)throw new se(r.method,`A handle of type '${ue.EmailAddress}' is required, got '${n.type}' instead`);break;case D.SmsLink.toString():case D.OtpViaSms.toString():if(n&&n.type!==ue.PhoneNumber)throw new se(r.method,`A handle of type '${ue.PhoneNumber}' is required, got '${n.type}' instead`);r.options=new er(r.options);break;case D.Oidc.toString():{if(n)throw new se(r.method,"OIDC should not be used with handles");r=await _d(r);const c=()=>{var f,u;const p=r;!(p==null||(f=p.extras)===null||f===void 0)&&f.popup&&(p==null||(u=p.extras)===null||u===void 0||u.popup.close()),this.emitter.off("oauthFlowFailed",c)};this.emitter.on("oauthFlowFailed",c)}break;case D.Saml.toString():{if(n)throw new se(r.method,"SAML should not be used with handles");r=await md(r);const c=()=>{var f,u;const p=r;!(p==null||(f=p.extras)===null||f===void 0)&&f.popup&&(p==null||(u=p.extras)===null||u===void 0||u.popup.close()),this.emitter.off("popupFailed",c)};this.emitter.on("popupFailed",c)}break;default:break}const i={method:r?.method,options:r?.options};this.emitter.emit("idFlowStarted",{authenticationFactor:r});const a=await this.authnClient.postId({slashIDOrgID:t,slashIDSdkVersion:I.raw,iDRequest:{handle:n,factor:i}},{cache:"no-cache"});if(a.errors)throw a;const o=a.result;if(!o)throw new Error("no challenges in ID response");let d=s;for(const c of o)d=await this.processChallenge(c,r),d&&this.updateClient(d);if(n)try{this.identifiersStorage.add(n)}catch(c){console.warn(c)}return this.emitter.emit("idFlowSucceeded",{token:`${d}`,authenticationFactor:r,handle:n}),this.getUser(d)}catch(i){throw await this.processError(i,{authenticationFactor:r,handle:n,previousToken:s}),te(i)&&_n(i)?await Te.fromResponseError(i):i}finally{this.resetClient()}}async getAvailableIdentifiers(){try{return this.identifiersStorage.getAll()}catch(t){return console.warn(t),[]}}async recover({handle:t,factor:n}){if(!this.oid)throw new Error("oid is required - please initialize the SDK with an organization ID");try{const{result:r}=await this.authnClient.postRecover({recoverRequest:{handle:t,factor:n},slashIDSdkVersion:I.raw,slashIDOrgID:this.oid});if(!r)throw new Error("no result in recover response");let s;for(const i of r)s=await this.processChallenge(i,n),s&&this.updateClient(s);if(t)try{this.identifiersStorage.add(t)}catch(i){console.warn(i)}return this.getUser(s)}catch(r){throw this.processError(r,{handle:t}),r}}async processChallenge(t,n){let r;switch(t.type){case q.Proxy:return this.processProxyChallenge(t);case q.Nonce:r=await this.processNonceChallenge(t);break;case q.Otp:{const a=new er(n?.options);r=await this.processOTPChallenge(t,a);break}case q.WebauthnGet:r=await this.processWebAuthnGetChallenge(t);break;case q.WebauthnCreate:r=await this.processWebAuthnCreateChallenge(t);break;case q.Oidc:return this.processOIDCChallenge(t,n);case q.Saml:return this.processSAMLChallenge(t,n);case q.PasswordSet:r=await this.processPasswordSetChallenge(t);break;case q.PasswordVerify:r=await this.processPasswordVerifyChallenge(t);break;case q.PasswordReset:r=await this.processPasswordResetChallenge(t);break;default:throw new Error("unhandled challenge type: "+t.toString())}let s;try{s=await this.authnClient.postAttestationV2({attestation:r,slashIDSdkVersion:I.raw},{cache:"no-cache"})}catch(a){if(te(a))s=await a.response.json();else throw a}if(De(s)&&s.errors.length){if(s.errors[0].httpcode===400&&t.type===q.PasswordSet)return this.emitter.emit("invalidPasswordSubmitted",{failedRules:[],authenticationFactor:n,challengeId:t.id,failureDetail:s.errors[0].message}),this.processChallenge(t,n);if(s.errors[0].httpcode===401&&t.type===q.PasswordVerify)return this.emitter.emit("incorrectPasswordSubmitted",{authenticationFactor:n,challengeId:t.id,failureDetail:s.errors[0].message}),this.processChallenge(t,n);if(s.errors[0].httpcode===401&&t.type===q.Otp)return this.emitter.emit("otpIncorrectCodeSubmitted",{factor:n,challengeId:t.id}),this.processChallenge(t,n);throw s}const i=s.result;if(!i)throw new Error("no user token in attestation response");if(t.type===q.WebauthnCreate){const a=t.options;this.credentialStorage.add(a.rp.id,r.data.rawId)}return i}async processProxyChallenge(t){let n;for(;!n;){await Ie(1e3);const r=await this.authnClient.getChallengeChallengeIdV2({challengeId:t.options.challenge_id,slashIDSdkVersion:I.raw},{cache:"no-cache"});if(r.errors&&(r.errors.length!==1||r.errors[0].httpcode!==202))throw r;n=r.result}return n}async processNonceChallenge(t){var n;return{challenge_id:t.id,challenge_type:t.type,data:{challenge:(n=t.options)===null||n===void 0?void 0:n.challenge}}}async processOTPChallenge(t,n){this.emitter.emit("otpSmsSent"),this.emitter.emit("otpCodeSent");const r=new Promise(a=>{const o=d=>{this.emitter.off("otpCodeSubmitted",o),a(d)};this.emitter.on("otpCodeSubmitted",o)});typeof n.getOTP=="function"&&n.getOTP().then(a=>this.emitter.emit("otpCodeSubmitted",a));const s=await r;if(!s)throw new Error("no OTP code provided");return{challenge_id:t.id,challenge_type:t.type,data:{otp:s}}}async processWebAuthnGetChallenge(t){const n=await nr(),r=t.options;if(this.isLocalScope(r.rpId)){const s={challenge:fe(r.challenge),extensions:r.extensions,rpId:r.rpId,timeout:r.timeout,userVerification:r.userVerification},i=r.allowCredentials;if(i){s.allowCredentials=new Array(i.length);for(let u=0;u<i.length;u++){const p=i[u];s.allowCredentials[u]={id:fe(p.id),type:p.type,transports:p.transports}}}const a=await navigator.credentials.get({publicKey:s});if(!a)throw new Error("could not create assert credential");const o=a.response,d=z(new Uint8Array(a.rawId)),c={id:a.id,rawId:d,type:a.type,clientExtensionResults:a.getClientExtensionResults(),response:{clientDataJSON:z(new Uint8Array(o.clientDataJSON)),authenticatorData:z(new Uint8Array(o.authenticatorData)),signature:z(new Uint8Array(o.signature)),userHandle:o.userHandle?z(new Uint8Array(o.userHandle)):null}},f={challenge_id:t.id,challenge_type:t.type,data:c};return this.emitter.emit("webAuthnChallengeProcessed",{credentialId:d}),f}else{const s=this.getSDKUrl();let i;if(await Ae.canGetPublicKeyCredentialsInIFrame()){if(i=this.iframe.contentWindow,!i)throw new Error("cannot get global id iframe")}else if(n||await Ie(200),i=window.open(s.toString()),!i)throw new Error("cannot open global id window");return new Promise((o,d)=>{const c=new sd({baseURL:this.baseURL,sdkURL:this.sdkURL},t),f=u=>{const p=u.data;p.id===c.id&&(i.close(),window.removeEventListener("message",f),p.error?d(p.error):o(p.attestation))};window.addEventListener("message",f),jt(i).then(u=>{u.postMessage(c,s.origin)})})}}async processWebAuthnCreateChallenge(t){const n=await nr(),r=t.options;if(this.isLocalScope(r.rp.id)){const s={challenge:fe(r.challenge),rp:r.rp,user:{id:fe(r.user.id),name:r.user.name,displayName:r.user.displayName},pubKeyCredParams:r.pubKeyCredParams,authenticatorSelection:r.authenticatorSelection,timeout:r.timeout,extensions:r.extensions,attestation:r.attestation},i=r.excludeCredentials;if(i){s.excludeCredentials=new Array(i.length);for(let u=0;u<i.length;u++){const p=i[u];s.excludeCredentials[u]={id:fe(p.id),type:p.type,transports:p.transports}}}const a=await navigator.credentials.create({publicKey:s});if(!a)throw new Error("cannot create credential");const o=a.response,d=z(new Uint8Array(a.rawId)),c={id:a.id,rawId:d,type:a.type,clientExtensionResults:a.getClientExtensionResults(),response:{attestationObject:z(new Uint8Array(o.attestationObject)),clientDataJSON:z(new Uint8Array(o.clientDataJSON))}},f={challenge_id:t.id,challenge_type:t.type,data:c};return this.emitter.emit("webAuthnChallengeProcessed",{credentialId:d}),f}else return n||await Ie(200),new Promise((i,a)=>{const o=this.getSDKUrl(),d=window.open(o.toString());if(!d){a(new Error("cannot open global id window"));return}const c=new rd({baseURL:this.baseURL,sdkURL:this.sdkURL},t),f=u=>{const p=u.data;p.id===c.id&&(d.close(),window.removeEventListener("message",f),p.error?a(p.error):i(p.attestation))};window.addEventListener("message",f),jt(d).then(u=>{u.postMessage(c,o.origin)})})}async processOIDCChallenge(t,n){if(n.options.ux_mode===Ce.Popup){var r;const i=n.extras.setPopupUrl(t.options.auth_code_url);if(!(!(t==null||(r=t.options)===null||r===void 0)&&r.auth_code_url)){var s;throw this.emitter.emit("oauthFlowFailed",{...n.options,reason:rr.BadOAuthURL}),new Error(`Bad OAuth URL - got ${t==null||(s=t.options)===null||s===void 0?void 0:s.auth_code_url}`)}if(!i)throw this.emitter.emit("oauthFlowFailed",{...n.options,reason:rr.PopupBlocked}),new Error("OIDC flow unsuccesful!")}else if(n.options.ux_mode===Ce.Redirect)window.location.assign(t.options.auth_code_url);else throw new Error(`Unsupported OAuth ux_mode - got ${n.options.ux_mode}`);return this.emitter.emit("oauthFlowStarted",n.options),""}async processSAMLChallenge(t,n){if(n.options.ux_mode===ke.Popup){var r;const i=n.extras.setPopupUrl(t.options.start_authentication_url);if(!(!(t==null||(r=t.options)===null||r===void 0)&&r.start_authentication_url)){var s;throw this.emitter.emit("popupFailed",{reason:sr.BadAuthURL}),new Error(`Bad authentication URL - got ${t==null||(s=t.options)===null||s===void 0?void 0:s.start_authentication_url}`)}if(!i)throw this.emitter.emit("popupFailed",{reason:sr.PopupBlocked}),new Error("SAML flow unsuccesful!")}else if(n.options.ux_mode===ke.Redirect)window.location.assign(t.options.start_authentication_url);else throw new Error(`Unsupported SAML ux_mode - got ${n.options.ux_mode}`);return""}async processPasswordSetChallenge(t){this.emitter.emit("passwordSetReady");const r=await new Promise(a=>{const o=d=>{this.emitter.off("passwordSubmitted",o),a(d)};this.emitter.on("passwordSubmitted",o)}),s=dr({password:r,rules:or(t)});return s.valid?{challenge_id:t.id,challenge_type:t.type,data:{password:r}}:(this.emitter.emit("invalidPasswordSubmitted",{failedRules:s.failedRules,challengeId:t.id,failureDetail:`invalid_password: ${s.failedRules.map(a=>a.name).join(",")}`}),await this.processPasswordSetChallenge(t))}processPasswordVerifyChallenge(t){return this.emitter.emit("passwordVerifyReady"),new Promise(r=>{const s=i=>{this.emitter.off("passwordSubmitted",s),r(i)};this.emitter.on("passwordSubmitted",s)}).then(r=>{if(!r)throw new Error("No password provided");return{challenge_id:t.id,challenge_type:t.type,data:{password:r}}})}async processPasswordResetChallenge(t){this.emitter.emit("passwordResetReady");const r=await new Promise(a=>{const o=d=>{this.emitter.off("passwordSubmitted",o),a(d)};this.emitter.on("passwordSubmitted",o)}),s=dr({password:r,rules:or(t)});return s.valid?{challenge_id:t.id,challenge_type:t.type,data:{password:r}}:(this.emitter.emit("invalidPasswordSubmitted",{failedRules:s.failedRules,challengeId:t.id,failureDetail:`invalid_password: ${s.failedRules.map(a=>a.name).join(",")}`}),await this.processPasswordSetChallenge(t))}getSDKUrl(){const t=new URL(this.sdkURL);return t.searchParams.append("v",I.raw),t}isLocalScope(t){return window.location.hostname.endsWith(t)}async processError(t,{authenticationFactor:n,handle:r,previousToken:s,challengeId:i}){const a=await ls(t,{authenticationFactor:n,handle:r,previousToken:s,challengeId:i});kd(a)?_s(this).publish("clientSideError",a):this.emitter.emit("idFlowFailed",a)}constructor(t){t&&pd(t);const{baseURL:n,sdkURL:r,oid:s,analyticsEnabled:i=!0}=rs(t??{});this.baseURL=n,this.sdkURL=r,this.oid=s,this.authnClient=new je(new he({...ge,basePath:this.baseURL})),this.iframe=this.setupIFrame();const a=new qd(this.iframe,this.getSDKUrl().origin);this.identifiersStorage=new V(a),this.credentialStorage=new qe(a),this.urlChallengesUser=null,this.emitter=Td(),this.analytics=i?new Od({sdk:this}):void 0,this.listenForEvents()}}({...T});({...T});const ms=Object.prototype.toString;function mn(e){switch(ms.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return oe(e,Error)}}function ye(e,t){return ms.call(e)===`[object ${t}]`}function bn(e){return ye(e,"ErrorEvent")}function ur(e){return ye(e,"DOMError")}function Ld(e){return ye(e,"DOMException")}function ae(e){return ye(e,"String")}function bs(e){return e===null||typeof e!="object"&&typeof e!="function"}function _e(e){return ye(e,"Object")}function st(e){return typeof Event<"u"&&oe(e,Event)}function Pd(e){return typeof Element<"u"&&oe(e,Element)}function Ud(e){return ye(e,"RegExp")}function wn(e){return!!(e&&e.then&&typeof e.then=="function")}function Md(e){return _e(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Bd(e){return typeof e=="number"&&e!==e}function oe(e,t){try{return e instanceof t}catch{return!1}}function ws(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}function pe(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function lr(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const s=e[r];try{ws(s)?n.push("[VueViewModel]"):n.push(String(s))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Gd(e,t,n=!1){return ae(e)?Ud(t)?t.test(e):ae(t)?n?e===t:e.includes(t):!1:!1}function it(e,t=[],n=!1){return t.some(r=>Gd(e,r,n))}function Vd(e,t,n=250,r,s,i,a){if(!i.exception||!i.exception.values||!a||!oe(a.originalException,Error))return;const o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=Fd(Jt(e,t,s,a.originalException,r,i.exception.values,o,0),n))}function Jt(e,t,n,r,s,i,a,o){if(i.length>=n+1)return i;let d=[...i];if(oe(r[s],Error)){fr(a,o);const c=e(t,r[s]),f=d.length;pr(c,s,f,o),d=Jt(e,t,n,r[s],s,[c,...d],c,f)}return Array.isArray(r.errors)&&r.errors.forEach((c,f)=>{if(oe(c,Error)){fr(a,o);const u=e(t,c),p=d.length;pr(u,`errors[${f}]`,p,o),d=Jt(e,t,n,c,s,[u,...d],u,p)}}),d}function fr(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,is_exception_group:!0,exception_id:t}}function pr(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Fd(e,t){return e.map(n=>(n.value&&(n.value=pe(n.value,t)),n))}function Ve(e){return e&&e.Math==Math?e:void 0}const v=typeof globalThis=="object"&&Ve(globalThis)||typeof window=="object"&&Ve(window)||typeof self=="object"&&Ve(self)||typeof global=="object"&&Ve(global)||function(){return this}()||{};function Le(){return v}function ys(e,t,n){const r=n||v,s=r.__SENTRY__=r.__SENTRY__||{};return s[e]||(s[e]=t())}const Yd=Le(),Hd=80;function Xt(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,s=[];let i=0,a=0;const o=" > ",d=o.length;let c;const f=Array.isArray(t)?t:t.keyAttrs,u=!Array.isArray(t)&&t.maxStringLength||Hd;for(;n&&i++<r&&(c=Wd(n,f),!(c==="html"||i>1&&a+s.length*d+c.length>=u));)s.push(c),a+=c.length,n=n.parentNode;return s.reverse().join(o)}catch{return"<unknown>"}}function Wd(e,t){const n=e,r=[];let s,i,a,o,d;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());const c=t&&t.length?t.filter(u=>n.getAttribute(u)).map(u=>[u,n.getAttribute(u)]):null;if(c&&c.length)c.forEach(u=>{r.push(`[${u[0]}="${u[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),s=n.className,s&&ae(s))for(i=s.split(/\s+/),d=0;d<i.length;d++)r.push(`.${i[d]}`);const f=["aria-label","type","name","title","alt"];for(d=0;d<f.length;d++)a=f[d],o=n.getAttribute(a),o&&r.push(`[${a}="${o}"]`);return r.join("")}function zd(){try{return Yd.document.location.href}catch{return""}}const Kd="Sentry Logger ",Zt=["debug","info","warn","error","log","assert","trace"],Xe={};function Ss(e){if(!("console"in v))return e();const t=v.console,n={},r=Object.keys(Xe);r.forEach(s=>{const i=Xe[s];n[s]=t[s],t[s]=i});try{return e()}finally{r.forEach(s=>{t[s]=n[s]})}}function jd(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?Zt.forEach(n=>{t[n]=(...r)=>{e&&Ss(()=>{v.console[n](`${Kd}[${n}]:`,...r)})}}):Zt.forEach(n=>{t[n]=()=>{}}),t}const g=jd(),Jd=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Xd(e){return e==="http"||e==="https"}function Pe(e,t=!1){const{host:n,path:r,pass:s,port:i,projectId:a,protocol:o,publicKey:d}=e;return`${o}://${d}${t&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${a}`}function Zd(e){const t=Jd.exec(e);if(!t){console.error(`Invalid Sentry Dsn: ${e}`);return}const[n,r,s="",i,a="",o]=t.slice(1);let d="",c=o;const f=c.split("/");if(f.length>1&&(d=f.slice(0,-1).join("/"),c=f.pop()),c){const u=c.match(/^\d+/);u&&(c=u[0])}return $s({host:i,pass:s,path:d,projectId:c,port:a,protocol:n,publicKey:r})}function $s(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Qd(e){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(a=>e[a]?!1:(g.error(`Invalid Sentry Dsn: ${a} missing`),!0))?!1:n.match(/^\d+$/)?Xd(r)?t&&isNaN(parseInt(t,10))?(g.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(g.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(g.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Es(e){const t=typeof e=="string"?Zd(e):$s(e);if(!(!t||!Qd(t)))return t}class F extends Error{constructor(t,n="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function x(e,t,n){if(!(t in e))return;const r=e[t],s=n(r);typeof s=="function"&&vs(s,r),e[t]=s}function Oe(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function vs(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Oe(e,"__sentry_original__",t)}catch{}}function yn(e){return e.__sentry_original__}function ec(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function Cs(e){if(mn(e))return{message:e.message,name:e.name,stack:e.stack,...gr(e)};if(st(e)){const t={type:e.type,target:hr(e.target),currentTarget:hr(e.currentTarget),...gr(e)};return typeof CustomEvent<"u"&&oe(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function hr(e){try{return Pd(e)?Xt(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function gr(e){if(typeof e=="object"&&e!==null){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function tc(e,t=40){const n=Object.keys(Cs(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return pe(n[0],t);for(let r=n.length;r>0;r--){const s=n.slice(0,r).join(", ");if(!(s.length>t))return r===n.length?s:pe(s,t)}return""}function at(e){return Qt(e,new Map)}function Qt(e,t){if(_e(e)){const n=t.get(e);if(n!==void 0)return n;const r={};t.set(e,r);for(const s of Object.keys(e))typeof e[s]<"u"&&(r[s]=Qt(e[s],t));return r}if(Array.isArray(e)){const n=t.get(e);if(n!==void 0)return n;const r=[];return t.set(e,r),e.forEach(s=>{r.push(Qt(s,t))}),r}return e}function J(){const e=v,t=e.crypto||e.msCrypto;let n=()=>Math.random()*16;try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>t.getRandomValues(new Uint8Array(1))[0])}catch{}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function ks(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Q(e){const{message:t,event_id:n}=e;if(t)return t;const r=ks(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function en(e,t,n){const r=e.exception=e.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function me(e,t){const n=ks(e);if(!n)return;const r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...t},t&&"data"in t){const i={...s&&s.data,...t.data};n.mechanism.data=i}}function _r(e){if(e&&e.__sentry_captured__)return!0;try{Oe(e,"__sentry_captured__",!0)}catch{}return!1}function Rs(e){return Array.isArray(e)?e:[e]}const Is=50,mr=/\(error: (.*)\)/,br=/captureMessage|captureException/;function xs(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0)=>{const s=[],i=n.split(`
|
|
10
|
+
`);for(let a=r;a<i.length;a++){const o=i[a];if(o.length>1024)continue;const d=mr.test(o)?o.replace(mr,"$1"):o;if(!d.match(/\S*Error: /)){for(const c of t){const f=c(d);if(f){s.push(f);break}}if(s.length>=Is)break}}return rc(s)}}function nc(e){return Array.isArray(e)?xs(...e):e}function rc(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),br.test(t[t.length-1].function||"")&&(t.pop(),br.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,Is).map(n=>({...n,filename:n.filename||t[t.length-1].filename,function:n.function||"?"}))}const Ut="<anonymous>";function ne(e){try{return!e||typeof e!="function"?Ut:e.name||Ut}catch{return Ut}}const tn=Le();function Ds(){if(!("fetch"in tn))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function nn(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function sc(){if(typeof EdgeRuntime=="string")return!0;if(!Ds())return!1;if(nn(tn.fetch))return!0;let e=!1;const t=tn.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=nn(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}const Fe=Le();function ic(){const e=Fe.chrome,t=e&&e.app&&e.app.runtime,n="history"in Fe&&!!Fe.history.pushState&&!!Fe.history.replaceState;return!t&&n}const E=Le(),Ee="__sentry_xhr_v2__",xe={},wr={};function ac(e){if(!wr[e])switch(wr[e]=!0,e){case"console":oc();break;case"dom":_c();break;case"xhr":uc();break;case"fetch":dc();break;case"history":lc();break;case"error":mc();break;case"unhandledrejection":bc();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn("unknown instrumentation type:",e);return}}function ee(e,t){xe[e]=xe[e]||[],xe[e].push(t),ac(e)}function U(e,t){if(!(!e||!xe[e]))for(const n of xe[e]||[])try{n(t)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.error(`Error while triggering instrumentation handler.
|
|
11
|
+
Type: ${e}
|
|
12
|
+
Name: ${ne(n)}
|
|
13
|
+
Error:`,r)}}function oc(){"console"in v&&Zt.forEach(function(e){e in v.console&&x(v.console,e,function(t){return Xe[e]=t,function(...n){U("console",{args:n,level:e});const r=Xe[e];r&&r.apply(v.console,n)}})})}function dc(){sc()&&x(v,"fetch",function(e){return function(...t){const{method:n,url:r}=cc(t),s={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return U("fetch",{...s}),e.apply(v,t).then(i=>(U("fetch",{...s,endTimestamp:Date.now(),response:i}),i),i=>{throw U("fetch",{...s,endTimestamp:Date.now(),error:i}),i})}})}function rn(e,t){return!!e&&typeof e=="object"&&!!e[t]}function yr(e){return typeof e=="string"?e:e?rn(e,"url")?e.url:e.toString?e.toString():"":""}function cc(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:yr(n),method:rn(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:yr(t),method:rn(t,"method")?String(t.method).toUpperCase():"GET"}}function uc(){if(!E.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;x(e,"open",function(t){return function(...n){const r=Date.now(),s=n[1],i=this[Ee]={method:ae(n[0])?n[0].toUpperCase():n[0],url:n[1],request_headers:{}};ae(s)&&i.method==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const a=()=>{const o=this[Ee];if(o&&this.readyState===4){try{o.status_code=this.status}catch{}U("xhr",{args:n,endTimestamp:Date.now(),startTimestamp:r,xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?x(this,"onreadystatechange",function(o){return function(...d){return a(),o.apply(this,d)}}):this.addEventListener("readystatechange",a),x(this,"setRequestHeader",function(o){return function(...d){const[c,f]=d,u=this[Ee];return u&&(u.request_headers[c.toLowerCase()]=f),o.apply(this,d)}}),t.apply(this,n)}}),x(e,"send",function(t){return function(...n){const r=this[Ee];return r&&n[0]!==void 0&&(r.body=n[0]),U("xhr",{args:n,startTimestamp:Date.now(),xhr:this}),t.apply(this,n)}})}let Ye;function lc(){if(!ic())return;const e=E.onpopstate;E.onpopstate=function(...n){const r=E.location.href,s=Ye;if(Ye=r,U("history",{from:s,to:r}),e)try{return e.apply(this,n)}catch{}};function t(n){return function(...r){const s=r.length>2?r[2]:void 0;if(s){const i=Ye,a=String(s);Ye=a,U("history",{from:i,to:a})}return n.apply(this,r)}}x(E.history,"pushState",t),x(E.history,"replaceState",t)}const fc=1e3;let Sr,sn,an;function pc(e){if(e.type!==sn)return!1;try{if(!e.target||e.target._sentryId!==an)return!1}catch{}return!0}function hc(e,t){return e!=="keypress"?!1:!t||!t.tagName?!0:!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)}function gc(e){try{return e.target}catch{return null}}function $r(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=gc(n);if(hc(n.type,r))return;Oe(n,"_sentryCaptured",!0),r&&!r._sentryId&&Oe(r,"_sentryId",J());const s=n.type==="keypress"?"input":n.type;pc(n)||(e({event:n,name:s,global:t}),sn=n.type,an=r?r._sentryId:void 0),clearTimeout(Sr),Sr=E.setTimeout(()=>{an=void 0,sn=void 0},fc)}}function _c(){if(!E.document)return;const e=U.bind(null,"dom"),t=$r(e,!0);E.document.addEventListener("click",t,!1),E.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const r=E[n]&&E[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(x(r,"addEventListener",function(s){return function(i,a,o){if(i==="click"||i=="keypress")try{const d=this,c=d.__sentry_instrumentation_handlers__=d.__sentry_instrumentation_handlers__||{},f=c[i]=c[i]||{refCount:0};if(!f.handler){const u=$r(e);f.handler=u,s.call(this,i,u,o)}f.refCount++}catch{}return s.call(this,i,a,o)}}),x(r,"removeEventListener",function(s){return function(i,a,o){if(i==="click"||i=="keypress")try{const d=this,c=d.__sentry_instrumentation_handlers__||{},f=c[i];f&&(f.refCount--,f.refCount<=0&&(s.call(this,i,f.handler,o),f.handler=void 0,delete c[i]),Object.keys(c).length===0&&delete d.__sentry_instrumentation_handlers__)}catch{}return s.call(this,i,a,o)}}))})}let He=null;function mc(){He=E.onerror,E.onerror=function(e,t,n,r,s){return U("error",{column:r,error:s,line:n,msg:e,url:t}),He&&!He.__SENTRY_LOADER__?He.apply(this,arguments):!1},E.onerror.__SENTRY_INSTRUMENTED__=!0}let We=null;function bc(){We=E.onunhandledrejection,E.onunhandledrejection=function(e){return U("unhandledrejection",e),We&&!We.__SENTRY_LOADER__?We.apply(this,arguments):!0},E.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function wc(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function yc(){return"npm"}function Sc(){return!wc()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function $c(e,t){return e.require(t)}function Ec(){const e=typeof WeakSet=="function",t=e?new WeakSet:[];function n(s){if(e)return t.has(s)?!0:(t.add(s),!1);for(let i=0;i<t.length;i++)if(t[i]===s)return!0;return t.push(s),!1}function r(s){if(e)t.delete(s);else for(let i=0;i<t.length;i++)if(t[i]===s){t.splice(i,1);break}}return[n,r]}function Z(e,t=100,n=1/0){try{return on("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Ts(e,t=3,n=100*1024){const r=Z(e,t);return Rc(r)>n?Ts(e,t-1,n):r}function on(e,t,n=1/0,r=1/0,s=Ec()){const[i,a]=s;if(t==null||["number","boolean","string"].includes(typeof t)&&!Bd(t))return t;const o=vc(e,t);if(!o.startsWith("[object "))return o;if(t.__sentry_skip_normalization__)return t;const d=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(d===0)return o.replace("object ","");if(i(t))return"[Circular ~]";const c=t;if(c&&typeof c.toJSON=="function")try{const b=c.toJSON();return on("",b,d-1,r,s)}catch{}const f=Array.isArray(t)?[]:{};let u=0;const p=Cs(t);for(const b in p){if(!Object.prototype.hasOwnProperty.call(p,b))continue;if(u>=r){f[b]="[MaxProperties ~]";break}const G=p[b];f[b]=on(b,G,d-1,r,s),u++}return a(t),f}function vc(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(ws(t))return"[VueViewModel]";if(Md(t))return"[SyntheticEvent]";if(typeof t=="number"&&t!==t)return"[NaN]";if(typeof t=="function")return`[Function: ${ne(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=Cc(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Cc(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}function kc(e){return~-encodeURI(e).split(/%..|./).length}function Rc(e){return kc(JSON.stringify(e))}var K;(function(e){e[e.PENDING=0]="PENDING";const n=1;e[e.RESOLVED=n]="RESOLVED";const r=2;e[e.REJECTED=r]="REJECTED"})(K||(K={}));function de(e){return new A(t=>{t(e)})}function Sn(e){return new A((t,n)=>{n(e)})}class A{constructor(t){A.prototype.__init.call(this),A.prototype.__init2.call(this),A.prototype.__init3.call(this),A.prototype.__init4.call(this),this._state=K.PENDING,this._handlers=[];try{t(this._resolve,this._reject)}catch(n){this._reject(n)}}then(t,n){return new A((r,s)=>{this._handlers.push([!1,i=>{if(!t)r(i);else try{r(t(i))}catch(a){s(a)}},i=>{if(!n)s(i);else try{r(n(i))}catch(a){s(a)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new A((n,r)=>{let s,i;return this.then(a=>{i=!1,s=a,t&&t()},a=>{i=!0,s=a,t&&t()}).then(()=>{if(i){r(s);return}n(s)})})}__init(){this._resolve=t=>{this._setResult(K.RESOLVED,t)}}__init2(){this._reject=t=>{this._setResult(K.REJECTED,t)}}__init3(){this._setResult=(t,n)=>{if(this._state===K.PENDING){if(wn(n)){n.then(this._resolve,this._reject);return}this._state=t,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===K.PENDING)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===K.RESOLVED&&n[1](this._value),this._state===K.REJECTED&&n[2](this._value),n[0]=!0)})}}}function Ic(e){const t=[];function n(){return e===void 0||t.length<e}function r(a){return t.splice(t.indexOf(a),1)[0]}function s(a){if(!n())return Sn(new F("Not adding Promise because buffer limit was reached."));const o=a();return t.indexOf(o)===-1&&t.push(o),o.then(()=>r(o)).then(null,()=>r(o).then(null,()=>{})),o}function i(a){return new A((o,d)=>{let c=t.length;if(!c)return o(!0);const f=setTimeout(()=>{a&&a>0&&o(!1)},a);t.forEach(u=>{de(u).then(()=>{--c||(clearTimeout(f),o(!0))},d)})})}return{$:t,add:s,drain:i}}function Mt(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const xc=["fatal","error","warning","log","info","debug"];function Dc(e){return e==="warn"?"warning":xc.includes(e)?e:"log"}const qs=Le(),dn={nowSeconds:()=>Date.now()/1e3};function Tc(){const{performance:e}=qs;if(!e||!e.now)return;const t=Date.now()-e.now();return{now:()=>e.now(),timeOrigin:t}}function qc(){try{return $c(module,"perf_hooks").performance}catch{return}}const Bt=Sc()?qc():Tc(),Er=Bt===void 0?dn:{nowSeconds:()=>(Bt.timeOrigin+Bt.now())/1e3},ot=dn.nowSeconds.bind(dn),As=Er.nowSeconds.bind(Er);(()=>{const{performance:e}=qs;if(!e||!e.now)return;const t=3600*1e3,n=e.now(),r=Date.now(),s=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,i=s<t,a=e.timing&&e.timing.navigationStart,d=typeof a=="number"?Math.abs(a+n-r):t,c=d<t;return i||c?s<=d?e.timeOrigin:a:r})();function Ue(e,t=[]){return[e,t]}function Ac(e,t){const[n,r]=e;return[n,[...r,t]]}function vr(e,t){const n=e[1];for(const r of n){const s=r[0].type;if(t(r,s))return!0}return!1}function cn(e,t){return(t||new TextEncoder).encode(e)}function Oc(e,t){const[n,r]=e;let s=JSON.stringify(n);function i(a){typeof s=="string"?s=typeof a=="string"?s+a:[cn(s,t),a]:s.push(typeof a=="string"?cn(a,t):a)}for(const a of r){const[o,d]=a;if(i(`
|
|
14
|
+
${JSON.stringify(o)}
|
|
15
|
+
`),typeof d=="string"||d instanceof Uint8Array)i(d);else{let c;try{c=JSON.stringify(d)}catch{c=JSON.stringify(Z(d))}i(c)}}return typeof s=="string"?s:Nc(s)}function Nc(e){const t=e.reduce((s,i)=>s+i.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Lc(e,t){const n=typeof e.data=="string"?cn(e.data,t):e.data;return[at({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}const Pc={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",statsd:"unknown"};function Cr(e){return Pc[e]}function Os(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Uc(e,t,n,r){const s=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Pe(r)},...s&&{trace:at({...s})}}}function Mc(e,t,n){const r=[{type:"client_report"},{timestamp:n||ot(),discarded_events:e}];return Ue(t?{dsn:t}:{},[r])}const Bc=60*1e3;function Gc(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?Bc:r-t}function Vc(e,t){return e[t]||e.all||0}function Fc(e,t,n=Date.now()){return Vc(e,t)>n}function Yc(e,{statusCode:t,headers:n},r=Date.now()){const s={...e},i=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(i)for(const o of i.trim().split(",")){const[d,c]=o.split(":",2),f=parseInt(d,10),u=(isNaN(f)?60:f)*1e3;if(!c)s.all=r+u;else for(const p of c.split(";"))s[p]=r+u}else a?s.all=r+Gc(a,r):t===429&&(s.all=r+60*1e3);return s}const $n="production";function En(){return ys("globalEventProcessors",()=>[])}function Hc(e){En().push(e)}function Ze(e,t,n,r=0){return new A((s,i)=>{const a=e[r];if(t===null||typeof a!="function")s(t);else{const o=a({...t},n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&a.id&&o===null&&g.log(`Event processor "${a.id}" dropped event`),wn(o)?o.then(d=>Ze(e,d,n,r+1).then(s)).then(null,i):Ze(e,o,n,r+1).then(s).then(null,i)}})}function Wc(e){const t=As(),n={sid:J(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Kc(n)};return e&&be(n,e),n}function be(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||As(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:J()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function zc(e,t){let n={};t?n={status:t}:e.status==="ok"&&(n={status:"exited"}),be(e,n)}function Kc(e){return at({sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}const jc=100;class ie{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=kr()}static clone(t){const n=new ie;return t&&(n._breadcrumbs=[...t._breadcrumbs],n._tags={...t._tags},n._extra={...t._extra},n._contexts={...t._contexts},n._user=t._user,n._level=t._level,n._span=t._span,n._session=t._session,n._transactionName=t._transactionName,n._fingerprint=t._fingerprint,n._eventProcessors=[...t._eventProcessors],n._requestSession=t._requestSession,n._attachments=[...t._attachments],n._sdkProcessingMetadata={...t._sdkProcessingMetadata},n._propagationContext={...t._propagationContext}),n}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{},this._session&&be(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this._tags={...this._tags,[t]:n},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSpan(t){return this._span=t,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const t=this.getSpan();return t&&t.transaction}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;if(typeof t=="function"){const n=t(this);return n instanceof ie?n:this}return t instanceof ie?(this._tags={...this._tags,...t._tags},this._extra={...this._extra,...t._extra},this._contexts={...this._contexts,...t._contexts},t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession),t._propagationContext&&(this._propagationContext=t._propagationContext)):_e(t)&&(t=t,this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession),t.propagationContext&&(this._propagationContext=t.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=kr(),this}addBreadcrumb(t,n){const r=typeof n=="number"?n:jc;if(r<=0)return this;const s={timestamp:ot(),...t},i=this._breadcrumbs;return i.push(s),this._breadcrumbs=i.length>r?i.slice(-r):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(t,n={},r){if(this._extra&&Object.keys(this._extra).length&&(t.extra={...this._extra,...t.extra}),this._tags&&Object.keys(this._tags).length&&(t.tags={...this._tags,...t.tags}),this._user&&Object.keys(this._user).length&&(t.user={...this._user,...t.user}),this._contexts&&Object.keys(this._contexts).length&&(t.contexts={...this._contexts,...t.contexts}),this._level&&(t.level=this._level),this._transactionName&&(t.transaction=this._transactionName),this._span){t.contexts={trace:this._span.getTraceContext(),...t.contexts};const a=this._span.transaction;if(a){t.sdkProcessingMetadata={dynamicSamplingContext:a.getDynamicSamplingContext(),...t.sdkProcessingMetadata};const o=a.name;o&&(t.tags={transaction:o,...t.tags})}}this._applyFingerprint(t);const s=this._getBreadcrumbs(),i=[...t.breadcrumbs||[],...s];return t.breadcrumbs=i.length>0?i:void 0,t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},Ze([...r||[],...En(),...this._eventProcessors],t,n)}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...t},this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}_applyFingerprint(t){t.fingerprint=t.fingerprint?Rs(t.fingerprint):[],this._fingerprint&&(t.fingerprint=t.fingerprint.concat(this._fingerprint)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}}function kr(){return{traceId:J(),spanId:J().substring(16)}}const Ns=4,Jc=100;class Ls{constructor(t,n=new ie,r=Ns){this._version=r,this._stack=[{scope:n}],t&&this.bindClient(t)}isOlderThan(t){return this._version<t}bindClient(t){const n=this.getStackTop();n.client=t,t&&t.setupIntegrations&&t.setupIntegrations()}pushScope(){const t=ie.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:t}),t}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(t){const n=this.pushScope();try{t(n)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(t,n){const r=this._lastEventId=n&&n.event_id?n.event_id:J(),s=new Error("Sentry syntheticException");return this._withClient((i,a)=>{i.captureException(t,{originalException:t,syntheticException:s,...n,event_id:r},a)}),r}captureMessage(t,n,r){const s=this._lastEventId=r&&r.event_id?r.event_id:J(),i=new Error(t);return this._withClient((a,o)=>{a.captureMessage(t,n,{originalException:t,syntheticException:i,...r,event_id:s},o)}),s}captureEvent(t,n){const r=n&&n.event_id?n.event_id:J();return t.type||(this._lastEventId=r),this._withClient((s,i)=>{s.captureEvent(t,{...n,event_id:r},i)}),r}lastEventId(){return this._lastEventId}addBreadcrumb(t,n){const{scope:r,client:s}=this.getStackTop();if(!s)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=Jc}=s.getOptions&&s.getOptions()||{};if(a<=0)return;const d={timestamp:ot(),...t},c=i?Ss(()=>i(d,n)):d;c!==null&&(s.emit&&s.emit("beforeAddBreadcrumb",c,n),r.addBreadcrumb(c,a))}setUser(t){this.getScope().setUser(t)}setTags(t){this.getScope().setTags(t)}setExtras(t){this.getScope().setExtras(t)}setTag(t,n){this.getScope().setTag(t,n)}setExtra(t,n){this.getScope().setExtra(t,n)}setContext(t,n){this.getScope().setContext(t,n)}configureScope(t){const{scope:n,client:r}=this.getStackTop();r&&t(n)}run(t){const n=Rr(this);try{t(this)}finally{Rr(n)}}getIntegration(t){const n=this.getClient();if(!n)return null;try{return n.getIntegration(t)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn(`Cannot retrieve integration ${t.id} from the current Hub`),null}}startTransaction(t,n){const r=this._callExtensionMethod("startTransaction",t,n);if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!r){const s=this.getClient();console.warn(s?`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
|
|
16
|
+
Sentry.addTracingExtensions();
|
|
17
|
+
Sentry.init({...});
|
|
18
|
+
`:"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(t=!1){if(t)return this.endSession();this._sendSessionUpdate()}endSession(){const n=this.getStackTop().scope,r=n.getSession();r&&zc(r),this._sendSessionUpdate(),n.setSession()}startSession(t){const{scope:n,client:r}=this.getStackTop(),{release:s,environment:i=$n}=r&&r.getOptions()||{},{userAgent:a}=v.navigator||{},o=Wc({release:s,environment:i,user:n.getUser(),...a&&{userAgent:a},...t}),d=n.getSession&&n.getSession();return d&&d.status==="ok"&&be(d,{status:"exited"}),this.endSession(),n.setSession(o),o}shouldSendDefaultPii(){const t=this.getClient(),n=t&&t.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){const{scope:t,client:n}=this.getStackTop(),r=t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_withClient(t){const{scope:n,client:r}=this.getStackTop();r&&t(r,n)}_callExtensionMethod(t,...n){const s=dt().__SENTRY__;if(s&&s.extensions&&typeof s.extensions[t]=="function")return s.extensions[t].apply(this,n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn(`Extension method ${t} couldn't be found, doing nothing.`)}}function dt(){return v.__SENTRY__=v.__SENTRY__||{extensions:{},hub:void 0},v}function Rr(e){const t=dt(),n=un(t);return Ps(t,e),n}function C(){const e=dt();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return Xc(e)}function Xc(e=dt()){return(!Zc(e)||un(e).isOlderThan(Ns))&&Ps(e,new Ls),un(e)}function Zc(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function un(e){return ys("hub",()=>new Ls,e)}function Ps(e,t){if(!e)return!1;const n=e.__SENTRY__=e.__SENTRY__||{};return n.hub=t,!0}function Qc(e,t,n){const r=t.getOptions(),{publicKey:s}=t.getDsn()||{},{segment:i}=n&&n.getUser()||{},a=at({environment:r.environment||$n,release:r.release,user_segment:i,public_key:s,trace_id:e});return t.emit&&t.emit("createDsc",a),a}function eu(e,t){return t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]]),e}function tu(e,t,n,r){const s=Os(n),i={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:Pe(t)}},a="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Ue(i,[a])}function nu(e,t,n,r){const s=Os(n),i=e.type&&e.type!=="replay_event"?e.type:"event";eu(e,n&&n.sdk);const a=Uc(e,s,r,t);return delete e.sdkProcessingMetadata,Ue(a,[[{type:i},e]])}function ct(e,t){return C().captureException(e,{captureContext:t})}function Us(e){C().withScope(e)}const ru="7";function Ms(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function su(e){return`${Ms(e)}${e.projectId}/envelope/`}function iu(e,t){return ec({sentry_key:e.publicKey,sentry_version:ru,...t&&{sentry_client:`${t.name}/${t.version}`}})}function au(e,t={}){const n=typeof t=="string"?t:t.tunnel,r=typeof t=="string"||!t._metadata?void 0:t._metadata.sdk;return n||`${su(e)}?${iu(e,r)}`}function ou(e,t){const n=Es(e);if(!n)return"";const r=`${Ms(n)}embed/error-page/`;let s=`dsn=${Pe(n)}`;for(const i in t)if(i!=="dsn")if(i==="user"){const a=t.user;if(!a)continue;a.name&&(s+=`&name=${encodeURIComponent(a.name)}`),a.email&&(s+=`&email=${encodeURIComponent(a.email)}`)}else s+=`&${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`;return`${r}?${s}`}const Ir=[];function du(e){const t={};return e.forEach(n=>{const{name:r}=n,s=t[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.keys(t).map(n=>t[n])}function cu(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(a=>{a.isDefaultInstance=!0});let r;Array.isArray(n)?r=[...t,...n]:typeof n=="function"?r=Rs(n(t)):r=t;const s=du(r),i=lu(s,a=>a.name==="Debug");if(i!==-1){const[a]=s.splice(i,1);s.push(a)}return s}function uu(e,t){const n={};return t.forEach(r=>{r&&Bs(e,r,n)}),n}function Bs(e,t,n){if(n[t.name]=t,Ir.indexOf(t.name)===-1&&(t.setupOnce(Hc,C),Ir.push(t.name)),e.on&&typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(s,i)=>r(s,i,e))}if(e.addEventProcessor&&typeof t.processEvent=="function"){const r=t.processEvent.bind(t),s=Object.assign((i,a)=>r(i,a,e),{id:t.name});e.addEventProcessor(s)}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.log(`Integration installed: ${t.name}`)}function lu(e,t){for(let n=0;n<e.length;n++)if(t(e[n])===!0)return n;return-1}function fu(e,t,n,r,s){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,o={...t,event_id:t.event_id||n.event_id||J(),timestamp:t.timestamp||ot()},d=n.integrations||e.integrations.map(p=>p.name);pu(o,e),_u(o,d),t.type===void 0&&hu(o,e.stackParser);let c=r;n.captureContext&&(c=ie.clone(c).update(n.captureContext));let f=de(o);const u=s&&s.getEventProcessors?s.getEventProcessors():[];if(c){if(c.getAttachments){const p=[...n.attachments||[],...c.getAttachments()];p.length&&(n.attachments=p)}f=c.applyToEvent(o,n,u)}else f=Ze([...u,...En()],o,n);return f.then(p=>(p&&gu(p),typeof i=="number"&&i>0?mu(p,i,a):p))}function pu(e,t){const{environment:n,release:r,dist:s,maxValueLength:i=250}=t;"environment"in e||(e.environment="environment"in t?n:$n),e.release===void 0&&r!==void 0&&(e.release=r),e.dist===void 0&&s!==void 0&&(e.dist=s),e.message&&(e.message=pe(e.message,i));const a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=pe(a.value,i));const o=e.request;o&&o.url&&(o.url=pe(o.url,i))}const xr=new WeakMap;function hu(e,t){const n=v._sentryDebugIds;if(!n)return;let r;const s=xr.get(t);s?r=s:(r=new Map,xr.set(t,r));const i=Object.keys(n).reduce((a,o)=>{let d;const c=r.get(o);c?d=c:(d=t(o),r.set(o,d));for(let f=d.length-1;f>=0;f--){const u=d[f];if(u.filename){a[u.filename]=n[o];break}}return a},{});try{e.exception.values.forEach(a=>{a.stacktrace.frames.forEach(o=>{o.filename&&(o.debug_id=i[o.filename])})})}catch{}}function gu(e){const t={};try{e.exception.values.forEach(r=>{r.stacktrace.frames.forEach(s=>{s.debug_id&&(s.abs_path?t[s.abs_path]=s.debug_id:s.filename&&(t[s.filename]=s.debug_id),delete s.debug_id)})})}catch{}if(Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.keys(t).forEach(r=>{n.push({type:"sourcemap",code_file:r,debug_id:t[r]})})}function _u(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function mu(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(s=>({...s,...s.data&&{data:Z(s.data,t,n)}}))},...e.user&&{user:Z(e.user,t,n)},...e.contexts&&{contexts:Z(e.contexts,t,n)},...e.extra&&{extra:Z(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Z(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(s=>(s.data&&(s.data=Z(s.data,t,n)),s))),r}const Dr="Not capturing exception because it's already been captured.";class bu{constructor(t){if(this._options=t,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],t.dsn?this._dsn=Es(t.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn("No DSN provided, client will not send events."),this._dsn){const n=au(this._dsn,t);this._transport=t.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:n})}}captureException(t,n,r){if(_r(t)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.log(Dr);return}let s=n&&n.event_id;return this._process(this.eventFromException(t,n).then(i=>this._captureEvent(i,n,r)).then(i=>{s=i})),s}captureMessage(t,n,r,s){let i=r&&r.event_id;const a=bs(t)?this.eventFromMessage(String(t),n,r):this.eventFromException(t,r);return this._process(a.then(o=>this._captureEvent(o,r,s)).then(o=>{i=o})),i}captureEvent(t,n,r){if(n&&n.originalException&&_r(n.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.log(Dr);return}let s=n&&n.event_id;return this._process(this._captureEvent(t,n,r).then(i=>{s=i})),s}captureSession(t){typeof t.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn("Discarded session because of missing or non-string release"):(this.sendSession(t),be(t,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){const n=this._transport;return n?this._isClientDoneProcessing(t).then(r=>n.flush(t).then(s=>r&&s)):de(!0)}close(t){return this.flush(t).then(n=>(this.getOptions().enabled=!1,n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}setupIntegrations(t){(t&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&(this._integrations=uu(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(t){return this._integrations[t]}getIntegration(t){try{return this._integrations[t.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn(`Cannot retrieve integration ${t.id} from the current Client`),null}}addIntegration(t){Bs(this,t,this._integrations)}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=nu(t,this._dsn,this._options._metadata,this._options.tunnel);for(const i of n.attachments||[])r=Ac(r,Lc(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));const s=this._sendEnvelope(r);s&&s.then(i=>this.emit("afterSendEvent",t,i),null)}sendSession(t){const n=tu(t,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}recordDroppedEvent(t,n,r){if(this._options.sendClientReports){const s=`${t}:${n}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.log(`Adding outcome: "${s}"`),this._outcomes[s]=this._outcomes[s]+1||1}}on(t,n){this._hooks[t]||(this._hooks[t]=[]),this._hooks[t].push(n)}emit(t,...n){this._hooks[t]&&this._hooks[t].forEach(r=>r(...n))}_updateSessionFromEvent(t,n){let r=!1,s=!1;const i=n.exception&&n.exception.values;if(i){s=!0;for(const d of i){const c=d.mechanism;if(c&&c.handled===!1){r=!0;break}}}const a=t.status==="ok";(a&&t.errors===0||a&&r)&&(be(t,{...r&&{status:"crashed"},errors:t.errors||Number(s||r)}),this.captureSession(t))}_isClientDoneProcessing(t){return new A(n=>{let r=0;const s=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),n(!0)):(r+=s,t&&r>=t&&(clearInterval(i),n(!1)))},s)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r){const s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i.length>0&&(n.integrations=i),this.emit("preprocessEvent",t,n),fu(s,t,n,r,this).then(a=>{if(a===null)return a;const{propagationContext:o}=a.sdkProcessingMetadata||{};if(!(a.contexts&&a.contexts.trace)&&o){const{traceId:c,spanId:f,parentSpanId:u,dsc:p}=o;a.contexts={trace:{trace_id:c,span_id:f,parent_span_id:u},...a.contexts};const b=p||Qc(c,this,r);a.sdkProcessingMetadata={dynamicSamplingContext:b,...a.sdkProcessingMetadata}}return a})}_captureEvent(t,n={},r){return this._processEvent(t,n,r).then(s=>s.event_id,s=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){const i=s;i.logLevel==="log"?g.log(i.message):g.warn(i)}})}_processEvent(t,n,r){const s=this.getOptions(),{sampleRate:i}=s,a=Vs(t),o=Gs(t),d=t.type||"error",c=`before send for type \`${d}\``;if(o&&typeof i=="number"&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",t),Sn(new F(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const f=d==="replay_event"?"replay":d;return this._prepareEvent(t,n,r).then(u=>{if(u===null)throw this.recordDroppedEvent("event_processor",f,t),new F("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return u;const b=yu(s,u,n);return wu(b,c)}).then(u=>{if(u===null)throw this.recordDroppedEvent("before_send",f,t),new F(`${c} returned \`null\`, will not send event.`,"log");const p=r&&r.getSession();!a&&p&&this._updateSessionFromEvent(p,u);const b=u.transaction_info;if(a&&b&&u.transaction!==t.transaction){const G="custom";u.transaction_info={...b,source:G}}return this.sendEvent(u,n),u}).then(null,u=>{throw u instanceof F?u:(this.captureException(u,{data:{__sentry__:!0},originalException:u}),new F(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
19
|
+
Reason: ${u}`))})}_process(t){this._numProcessing++,t.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)return this._transport.send(t).then(null,n=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.error("Error while sending event:",n)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.error("Transport disabled")}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.keys(t).map(n=>{const[r,s]=n.split(":");return{reason:r,category:s,quantity:t[n]}})}}function wu(e,t){const n=`${t} must return \`null\` or a valid event.`;if(wn(e))return e.then(r=>{if(!_e(r)&&r!==null)throw new F(n);return r},r=>{throw new F(`${t} rejected with ${r}`)});if(!_e(e)&&e!==null)throw new F(n);return e}function yu(e,t,n){const{beforeSend:r,beforeSendTransaction:s}=e;return Gs(t)&&r?r(t,n):Vs(t)&&s?s(t,n):t}function Gs(e){return e.type===void 0}function Vs(e){return e.type==="transaction"}function Su(e,t){t.debug===!0&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?g.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));const n=C();n.getScope().update(t.initialScope);const s=new e(t);n.bindClient(s)}const $u=30;function Fs(e,t,n=Ic(e.bufferSize||$u)){let r={};const s=a=>n.drain(a);function i(a){const o=[];if(vr(a,(u,p)=>{const b=Cr(p);if(Fc(r,b)){const G=Tr(u,p);e.recordDroppedEvent("ratelimit_backoff",b,G)}else o.push(u)}),o.length===0)return de();const d=Ue(a[0],o),c=u=>{vr(d,(p,b)=>{const G=Tr(p,b);e.recordDroppedEvent(u,Cr(b),G)})},f=()=>t({body:Oc(d,e.textEncoder)}).then(u=>(u.statusCode!==void 0&&(u.statusCode<200||u.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn(`Sentry responded with status code ${u.statusCode} to sent event.`),r=Yc(r,u),u),u=>{throw c("network_error"),u});return n.add(f).then(u=>u,u=>{if(u instanceof F)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.error("Skipped sending event because buffer is full."),c("queue_overflow"),de();throw u})}return i.__sentry__baseTransport__=!0,{send:i,flush:s}}function Tr(e,t){if(!(t!=="event"&&t!=="transaction"))return Array.isArray(e)?e[1]:void 0}const Qe="7.81.1";let qr;class ut{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=ut.id}setupOnce(){qr=Function.prototype.toString;try{Function.prototype.toString=function(...t){const n=yn(this)||this;return qr.apply(n,t)}}catch{}}}ut.__initStatic();const Eu=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],vu=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/];class lt{static __initStatic(){this.id="InboundFilters"}constructor(t={}){this.name=lt.id,this._options=t}setupOnce(t,n){}processEvent(t,n,r){const s=r.getOptions(),i=Cu(this._options,s);return ku(t,i)?null:t}}lt.__initStatic();function Cu(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Eu],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:vu],ignoreInternal:e.ignoreInternal!==void 0?e.ignoreInternal:!0}}function ku(e,t){return t.ignoreInternal&&qu(e)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn(`Event dropped due to being internal Sentry Error.
|
|
20
|
+
Event: ${Q(e)}`),!0):Ru(e,t.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
21
|
+
Event: ${Q(e)}`),!0):Iu(e,t.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
22
|
+
Event: ${Q(e)}`),!0):xu(e,t.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
23
|
+
Event: ${Q(e)}.
|
|
24
|
+
Url: ${et(e)}`),!0):Du(e,t.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
25
|
+
Event: ${Q(e)}.
|
|
26
|
+
Url: ${et(e)}`),!0)}function Ru(e,t){return e.type||!t||!t.length?!1:Tu(e).some(n=>it(n,t))}function Iu(e,t){if(e.type!=="transaction"||!t||!t.length)return!1;const n=e.transaction;return n?it(n,t):!1}function xu(e,t){if(!t||!t.length)return!1;const n=et(e);return n?it(n,t):!1}function Du(e,t){if(!t||!t.length)return!0;const n=et(e);return n?it(n,t):!0}function Tu(e){const t=[];e.message&&t.push(e.message);let n;try{n=e.exception.values[e.exception.values.length-1]}catch{}return n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`)),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&t.length===0&&g.error(`Could not extract message for event ${Q(e)}`),t}function qu(e){try{return e.exception.values[0].type==="SentryError"}catch{}return!1}function Au(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function et(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?Au(t):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.error(`Cannot extract url for event ${Q(e)}`),null}}const _=v;let ln=0;function Ys(){return ln>0}function Ou(){ln++,setTimeout(()=>{ln--})}function we(e,t={},n){if(typeof e!="function")return e;try{const s=e.__sentry_wrapped__;if(s)return s;if(yn(e))return e}catch{return e}const r=function(){const s=Array.prototype.slice.call(arguments);try{n&&typeof n=="function"&&n.apply(this,arguments);const i=s.map(a=>we(a,t));return e.apply(this,i)}catch(i){throw Ou(),Us(a=>{a.addEventProcessor(o=>(t.mechanism&&(en(o,void 0,void 0),me(o,t.mechanism)),o.extra={...o.extra,arguments:s},o)),ct(i)}),i}};try{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}catch{}vs(r,e),Oe(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function Hs(e,t){const n=vn(e,t),r={type:t&&t.name,value:Uu(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Nu(e,t,n,r){const i=C().getClient(),a=i&&i.getOptions().normalizeDepth,o={exception:{values:[{type:st(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Gu(t,{isUnhandledRejection:r})}]},extra:{__serialized__:Ts(t,a)}};if(n){const d=vn(e,n);d.length&&(o.exception.values[0].stacktrace={frames:d})}return o}function Gt(e,t){return{exception:{values:[Hs(e,t)]}}}function vn(e,t){const n=t.stacktrace||t.stack||"",r=Pu(t);try{return e(n,r)}catch{}return[]}const Lu=/Minified React error #\d+;/i;function Pu(e){if(e){if(typeof e.framesToPop=="number")return e.framesToPop;if(Lu.test(e.message))return 1}return 0}function Uu(e){const t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function Mu(e,t,n,r){const s=n&&n.syntheticException||void 0,i=Cn(e,t,s,r);return me(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),de(i)}function Bu(e,t,n="info",r,s){const i=r&&r.syntheticException||void 0,a=fn(e,t,i,s);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),de(a)}function Cn(e,t,n,r,s){let i;if(bn(t)&&t.error)return Gt(e,t.error);if(ur(t)||Ld(t)){const a=t;if("stack"in t)i=Gt(e,t);else{const o=a.name||(ur(a)?"DOMError":"DOMException"),d=a.message?`${o}: ${a.message}`:o;i=fn(e,d,n,r),en(i,d)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return mn(t)?Gt(e,t):_e(t)||st(t)?(i=Nu(e,t,n,s),me(i,{synthetic:!0}),i):(i=fn(e,t,n,r),en(i,`${t}`,void 0),me(i,{synthetic:!0}),i)}function fn(e,t,n,r){const s={message:t};if(r&&n){const i=vn(e,n);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]})}return s}function Gu(e,{isUnhandledRejection:t}){const n=tc(e),r=t?"promise rejection":"exception";return bn(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:st(e)?`Event \`${Vu(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Vu(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Fu(e,{metadata:t,tunnel:n,dsn:r}){const s={event_id:e.event_id,sent_at:new Date().toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:Pe(r)}},i=Yu(e);return Ue(s,[i])}function Yu(e){return[{type:"user_report"},e]}class Hu extends bu{constructor(t){const n=_.SENTRY_SDK_SOURCE||yc();t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${n}:@sentry/browser`,version:Qe}],version:Qe},super(t),t.sendClientReports&&_.document&&_.document.addEventListener("visibilitychange",()=>{_.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(t,n){return Mu(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return Bu(this._options.stackParser,t,n,r,this._options.attachStacktrace)}captureUserFeedback(t){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn("SDK not enabled, will not capture user feedback.");return}const n=Fu(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(n)}_prepareEvent(t,n,r){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r)}_flushOutcomes(){const t=this._clearOutcomes();if(t.length===0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.log("No outcomes to send");return}if(!this._dsn){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.log("No dsn provided, will not send outcomes");return}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.log("Sending outcomes:",t);const n=Mc(t,this._options.tunnel&&Pe(this._dsn));this._sendEnvelope(n)}}let ve;function Wu(){if(ve)return ve;if(nn(_.fetch))return ve=_.fetch.bind(_);const e=_.document;let t=_.fetch;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return ve=t.bind(_)}function zu(){ve=void 0}function Ku(e,t=Wu()){let n=0,r=0;function s(i){const a=i.body.length;n+=a,r++;const o={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{return t(e.url,o).then(d=>(n-=a,r--,{statusCode:d.status,headers:{"x-sentry-rate-limits":d.headers.get("X-Sentry-Rate-Limits"),"retry-after":d.headers.get("Retry-After")}}))}catch(d){return zu(),n-=a,r--,Sn(d)}}return Fs(e,s)}const ju=4;function Ju(e){function t(n){return new A((r,s)=>{const i=new XMLHttpRequest;i.onerror=s,i.onreadystatechange=()=>{i.readyState===ju&&r({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",e.url);for(const a in e.headers)Object.prototype.hasOwnProperty.call(e.headers,a)&&i.setRequestHeader(a,e.headers[a]);i.send(n.body)})}return Fs(e,t)}const ft="?",Xu=30,Zu=40,Qu=50;function kn(e,t,n,r){const s={filename:e,function:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const el=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tl=/\((\S*)(?::(\d+))(?::(\d+))\)/,nl=e=>{const t=el.exec(e);if(t){if(t[2]&&t[2].indexOf("eval")===0){const i=tl.exec(t[2]);i&&(t[2]=i[1],t[3]=i[2],t[4]=i[3])}const[r,s]=Ws(t[1]||ft,t[2]);return kn(s,r,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}},rl=[Xu,nl],sl=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,il=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,al=e=>{const t=sl.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=il.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],s=t[1]||ft;return[s,r]=Ws(s,r),kn(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},ol=[Qu,al],dl=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,cl=e=>{const t=dl.exec(e);return t?kn(t[2],t[1]||ft,+t[3],t[4]?+t[4]:void 0):void 0},ul=[Zu,cl],ll=[rl,ol,ul],fl=xs(...ll),Ws=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:ft,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};class Se{static __initStatic(){this.id="GlobalHandlers"}constructor(t){this.name=Se.id,this._options={onerror:!0,onunhandledrejection:!0,...t},this._installFunc={onerror:pl,onunhandledrejection:hl}}setupOnce(){Error.stackTraceLimit=50;const t=this._options;for(const n in t){const r=this._installFunc[n];r&&t[n]&&(ml(n),r(),this._installFunc[n]=void 0)}}}Se.__initStatic();function pl(){ee("error",e=>{const[t,n,r]=js();if(!t.getIntegration(Se))return;const{msg:s,url:i,line:a,column:o,error:d}=e;if(Ys()||d&&d.__sentry_own_request__)return;const c=d===void 0&&ae(s)?_l(s,i,a,o):zs(Cn(n,d||s,void 0,r,!1),i,a,o);c.level="error",Ks(t,d,c,"onerror")})}function hl(){ee("unhandledrejection",e=>{const[t,n,r]=js();if(!t.getIntegration(Se))return;let s=e;try{"reason"in e?s=e.reason:"detail"in e&&"reason"in e.detail&&(s=e.detail.reason)}catch{}if(Ys()||s&&s.__sentry_own_request__)return!0;const i=bs(s)?gl(s):Cn(n,s,void 0,r,!0);i.level="error",Ks(t,s,i,"onunhandledrejection")})}function gl(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function _l(e,t,n,r){const s=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let i=bn(e)?e.message:e,a="Error";const o=i.match(s);return o&&(a=o[1],i=o[2]),zs({exception:{values:[{type:a,value:i}]}},t,n,r)}function zs(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],a=i[0]=i[0]||{},o=a.stacktrace=a.stacktrace||{},d=o.frames=o.frames||[],c=isNaN(parseInt(r,10))?void 0:r,f=isNaN(parseInt(n,10))?void 0:n,u=ae(t)&&t.length>0?t:zd();return d.length===0&&d.push({colno:c,filename:u,function:"?",in_app:!0,lineno:f}),e}function ml(e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.log(`Global Handler attached: ${e}`)}function Ks(e,t,n,r){me(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function js(){const e=C(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}const bl=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class pt{static __initStatic(){this.id="TryCatch"}constructor(t){this.name=pt.id,this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t}}setupOnce(){this._options.setTimeout&&x(_,"setTimeout",Ar),this._options.setInterval&&x(_,"setInterval",Ar),this._options.requestAnimationFrame&&x(_,"requestAnimationFrame",wl),this._options.XMLHttpRequest&&"XMLHttpRequest"in _&&x(XMLHttpRequest.prototype,"send",yl);const t=this._options.eventTarget;t&&(Array.isArray(t)?t:bl).forEach(Sl)}}pt.__initStatic();function Ar(e){return function(...t){const n=t[0];return t[0]=we(n,{mechanism:{data:{function:ne(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function wl(e){return function(t){return e.apply(this,[we(t,{mechanism:{data:{function:"requestAnimationFrame",handler:ne(e)},handled:!1,type:"instrument"}})])}}function yl(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&x(n,s,function(i){const a={mechanism:{data:{function:s,handler:ne(i)},handled:!1,type:"instrument"}},o=yn(i);return o&&(a.mechanism.data.handler=ne(o)),we(i,a)})}),e.apply(this,t)}}function Sl(e){const t=_,n=t[e]&&t[e].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(x(n,"addEventListener",function(r){return function(s,i,a){try{typeof i.handleEvent=="function"&&(i.handleEvent=we(i.handleEvent,{mechanism:{data:{function:"handleEvent",handler:ne(i),target:e},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[s,we(i,{mechanism:{data:{function:"addEventListener",handler:ne(i),target:e},handled:!1,type:"instrument"}}),a])}}),x(n,"removeEventListener",function(r){return function(s,i,a){const o=i;try{const d=o&&o.__sentry_wrapped__;d&&r.call(this,s,d,a)}catch{}return r.call(this,s,o,a)}}))}const ze=1024;class ht{static __initStatic(){this.id="Breadcrumbs"}constructor(t){this.name=ht.id,this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t}}setupOnce(){if(this.options.console&&ee("console",vl),this.options.dom&&ee("dom",El(this.options.dom)),this.options.xhr&&ee("xhr",Cl),this.options.fetch&&ee("fetch",kl),this.options.history&&ee("history",Rl),this.options.sentry){const t=C().getClient();t&&t.on&&t.on("beforeSendEvent",$l)}}}ht.__initStatic();function $l(e){C().addBreadcrumb({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:Q(e)},{event:e})}function El(e){function t(n){let r,s=typeof e=="object"?e.serializeAttribute:void 0,i=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;i&&i>ze&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn(`\`dom.maxStringLength\` cannot exceed ${ze}, but a value of ${i} was configured. Sentry will use ${ze} instead.`),i=ze),typeof s=="string"&&(s=[s]);try{const a=n.event;r=Il(a)?Xt(a.target,{keyAttrs:s,maxStringLength:i}):Xt(a,{keyAttrs:s,maxStringLength:i})}catch{r="<unknown>"}r.length!==0&&C().addBreadcrumb({category:`ui.${n.name}`,message:r},{event:n.event,name:n.name,global:n.global})}return t}function vl(e){const t={category:"console",data:{arguments:e.args,logger:"console"},level:Dc(e.level),message:lr(e.args," ")};if(e.level==="assert")if(e.args[0]===!1)t.message=`Assertion failed: ${lr(e.args.slice(1)," ")||"console.assert"}`,t.data.arguments=e.args.slice(1);else return;C().addBreadcrumb(t,{input:e.args,level:e.level})}function Cl(e){const{startTimestamp:t,endTimestamp:n}=e,r=e.xhr[Ee];if(!t||!n||!r)return;const{method:s,url:i,status_code:a,body:o}=r,d={method:s,url:i,status_code:a},c={xhr:e.xhr,input:o,startTimestamp:t,endTimestamp:n};C().addBreadcrumb({category:"xhr",data:d,type:"http"},c)}function kl(e){const{startTimestamp:t,endTimestamp:n}=e;if(n&&!(e.fetchData.url.match(/sentry_key/)&&e.fetchData.method==="POST"))if(e.error){const r=e.fetchData,s={data:e.error,input:e.args,startTimestamp:t,endTimestamp:n};C().addBreadcrumb({category:"fetch",data:r,level:"error",type:"http"},s)}else{const r={...e.fetchData,status_code:e.response&&e.response.status},s={input:e.args,response:e.response,startTimestamp:t,endTimestamp:n};C().addBreadcrumb({category:"fetch",data:r,type:"http"},s)}}function Rl(e){let t=e.from,n=e.to;const r=Mt(_.location.href);let s=Mt(t);const i=Mt(n);s.path||(s=r),r.protocol===i.protocol&&r.host===i.host&&(n=i.relative),r.protocol===s.protocol&&r.host===s.host&&(t=s.relative),C().addBreadcrumb({category:"navigation",data:{from:t,to:n}})}function Il(e){return!!e&&!!e.target}const xl="cause",Dl=5;class gt{static __initStatic(){this.id="LinkedErrors"}constructor(t={}){this.name=gt.id,this._key=t.key||xl,this._limit=t.limit||Dl}setupOnce(){}preprocessEvent(t,n,r){const s=r.getOptions();Vd(Hs,s.stackParser,s.maxValueLength,this._key,this._limit,t,n)}}gt.__initStatic();class _t{static __initStatic(){this.id="HttpContext"}constructor(){this.name=_t.id}setupOnce(){}preprocessEvent(t){if(!_.navigator&&!_.location&&!_.document)return;const n=t.request&&t.request.url||_.location&&_.location.href,{referrer:r}=_.document||{},{userAgent:s}=_.navigator||{},i={...t.request&&t.request.headers,...r&&{Referer:r},...s&&{"User-Agent":s}},a={...t.request,...n&&{url:n},headers:i};t.request=a}}_t.__initStatic();class mt{static __initStatic(){this.id="Dedupe"}constructor(){this.name=mt.id}setupOnce(t,n){}processEvent(t){if(t.type)return t;try{if(Tl(t,this._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return this._previousEvent=t}}mt.__initStatic();function Tl(e,t){return t?!!(ql(e,t)||Al(e,t)):!1}function ql(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Xs(e,t)||!Js(e,t))}function Al(e,t){const n=Or(t),r=Or(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Xs(e,t)||!Js(e,t))}function Js(e,t){let n=Nr(e),r=Nr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let s=0;s<r.length;s++){const i=r[s],a=n[s];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function Xs(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function Or(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Nr(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}const Ol=[new lt,new ut,new pt,new ht,new Se,new gt,new mt,new _t];function Nl(e={}){e.defaultIntegrations===void 0&&(e.defaultIntegrations=Ol),e.release===void 0&&(typeof __SENTRY_RELEASE__=="string"&&(e.release=__SENTRY_RELEASE__),_.SENTRY_RELEASE&&_.SENTRY_RELEASE.id&&(e.release=_.SENTRY_RELEASE.id)),e.autoSessionTracking===void 0&&(e.autoSessionTracking=!0),e.sendClientReports===void 0&&(e.sendClientReports=!0);const t={...e,stackParser:nc(e.stackParser||fl),integrations:cu(e),transport:e.transport||(Ds()?Ku:Ju)};Su(Hu,t),e.autoSessionTracking&&Ll()}function Lr(e={},t=C()){if(!_.document){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.error("Global document not defined in showReportDialog call");return}const{client:n,scope:r}=t.getStackTop(),s=e.dsn||n&&n.getDsn();if(!s){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.error("DSN not configured for showReportDialog call");return}r&&(e.user={...r.getUser(),...e.user}),e.eventId||(e.eventId=t.lastEventId());const i=_.document.createElement("script");i.async=!0,i.crossOrigin="anonymous",i.src=ou(s,e),e.onLoad&&(i.onload=e.onLoad);const a=_.document.head||_.document.body;a?a.appendChild(i):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.error("Not injecting report dialog. No injection point found in HTML")}function Pr(e){e.startSession({ignoreDuration:!0}),e.captureSession()}function Ll(){if(typeof _.document>"u"){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}const e=C();e.captureSession&&(Pr(e),ee("history",({from:t,to:n})=>{t===void 0||t===n||Pr(C())}))}function Pl(e){const t={_metadata:{},...e};t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.react",packages:[{name:"npm:@sentry/react",version:Qe}],version:Qe},Nl(t)}var Zs={exports:{}},m={};/** @license React v16.13.1
|
|
27
|
+
* react-is.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var k=typeof Symbol=="function"&&Symbol.for,Rn=k?Symbol.for("react.element"):60103,In=k?Symbol.for("react.portal"):60106,bt=k?Symbol.for("react.fragment"):60107,wt=k?Symbol.for("react.strict_mode"):60108,yt=k?Symbol.for("react.profiler"):60114,St=k?Symbol.for("react.provider"):60109,$t=k?Symbol.for("react.context"):60110,xn=k?Symbol.for("react.async_mode"):60111,Et=k?Symbol.for("react.concurrent_mode"):60111,vt=k?Symbol.for("react.forward_ref"):60112,Ct=k?Symbol.for("react.suspense"):60113,Ul=k?Symbol.for("react.suspense_list"):60120,kt=k?Symbol.for("react.memo"):60115,Rt=k?Symbol.for("react.lazy"):60116,Ml=k?Symbol.for("react.block"):60121,Bl=k?Symbol.for("react.fundamental"):60117,Gl=k?Symbol.for("react.responder"):60118,Vl=k?Symbol.for("react.scope"):60119;function L(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Rn:switch(e=e.type,e){case xn:case Et:case bt:case yt:case wt:case Ct:return e;default:switch(e=e&&e.$$typeof,e){case $t:case vt:case Rt:case kt:case St:return e;default:return t}}case In:return t}}}function Qs(e){return L(e)===Et}m.AsyncMode=xn;m.ConcurrentMode=Et;m.ContextConsumer=$t;m.ContextProvider=St;m.Element=Rn;m.ForwardRef=vt;m.Fragment=bt;m.Lazy=Rt;m.Memo=kt;m.Portal=In;m.Profiler=yt;m.StrictMode=wt;m.Suspense=Ct;m.isAsyncMode=function(e){return Qs(e)||L(e)===xn};m.isConcurrentMode=Qs;m.isContextConsumer=function(e){return L(e)===$t};m.isContextProvider=function(e){return L(e)===St};m.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Rn};m.isForwardRef=function(e){return L(e)===vt};m.isFragment=function(e){return L(e)===bt};m.isLazy=function(e){return L(e)===Rt};m.isMemo=function(e){return L(e)===kt};m.isPortal=function(e){return L(e)===In};m.isProfiler=function(e){return L(e)===yt};m.isStrictMode=function(e){return L(e)===wt};m.isSuspense=function(e){return L(e)===Ct};m.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===bt||e===Et||e===yt||e===wt||e===Ct||e===Ul||typeof e=="object"&&e!==null&&(e.$$typeof===Rt||e.$$typeof===kt||e.$$typeof===St||e.$$typeof===$t||e.$$typeof===vt||e.$$typeof===Bl||e.$$typeof===Gl||e.$$typeof===Vl||e.$$typeof===Ml)};m.typeOf=L;Zs.exports=m;var Fl=Zs.exports,ei=Fl,Yl={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Hl={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ti={};ti[ei.ForwardRef]=Yl;ti[ei.Memo]=Hl;function Wl(e){const t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}const Ur={componentStack:null,error:null,eventId:null};function zl(e,t){const n=new WeakMap;function r(s,i){if(!n.has(s)){if(s.cause)return n.set(s,!0),r(s.cause,i);s.cause=i}}r(e,t)}class Dn extends w.Component{constructor(t){super(t),Dn.prototype.__init.call(this),this.state=Ur,this._openFallbackReportDialog=!0;const n=C().getClient();n&&n.on&&t.showDialog&&(this._openFallbackReportDialog=!1,n.on("afterSendEvent",r=>{!r.type&&r.event_id===this._lastEventId&&Lr({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,{componentStack:n}){const{beforeCapture:r,onError:s,showDialog:i,dialogOptions:a}=this.props;Us(o=>{if(Wl(w.version)&&mn(t)){const c=new Error(t.message);c.name=`React ErrorBoundary ${t.name}`,c.stack=n,zl(t,c)}r&&r(o,t,n),o.addEventProcessor(c=>(me(c,{handled:!1}),c));const d=ct(t,{contexts:{react:{componentStack:n}}});s&&s(t,n,d),i&&(this._lastEventId=d,this._openFallbackReportDialog&&Lr({...a,eventId:d})),this.setState({error:t,componentStack:n,eventId:d})})}componentDidMount(){const{onMount:t}=this.props;t&&t()}componentWillUnmount(){const{error:t,componentStack:n,eventId:r}=this.state,{onUnmount:s}=this.props;s&&s(t,n,r)}__init(){this.resetErrorBoundary=()=>{const{onReset:t}=this.props,{error:n,componentStack:r,eventId:s}=this.state;t&&t(n,r,s),this.setState(Ur)}}render(){const{fallback:t,children:n}=this.props,r=this.state;if(r.error){let s;return typeof t=="function"?s=t({error:r.error,componentStack:r.componentStack,resetError:this.resetErrorBoundary,eventId:r.eventId}):s=t,w.isValidElement(s)?s:(t&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&g.warn("fallback did not produce a valid ReactElement"),null)}return typeof n=="function"?n():n}}function ni(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=ni(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Y(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=ni(e))&&(r&&(r+=" "),r+=t);return r}var Mr="sid-theme-root",Kl="pd2ssj2",jl="pd2ssj0",Jl="pd2ssj1",Xl="pd2ssj3";function ri(){return typeof window<"u"&&globalThis===window}function si({theme:e,className:t}){return Y(Mr,`${Mr}__${e}`,Xl,{[jl]:e==="dark",[Kl]:e==="auto",[Jl]:e==="light"},t)}function Zl({theme:e,className:t}){const n=si({theme:e,className:t});document.body.classList.add(...n.split(" "))}const ii=({children:e})=>l.jsx("div",{className:si({theme:"light"}),children:e}),Ql=({children:e,theme:t="light",className:n})=>{const[r,s]=Wr.useState(!1);return w.useLayoutEffect(()=>{r||s(!0)},[n,r,t]),w.useLayoutEffect(()=>{r&&Zl({theme:t,className:n})},[n,r,t]),r?l.jsx(l.Fragment,{children:e}):l.jsx(ii,{children:e})};function ef({children:e,theme:t="light",className:n}){return ri()?l.jsx(Ql,{theme:t,className:n,children:e}):l.jsx(ii,{children:e})}var tf={default:"_14s8p9y2 _14s8p9y1",short:"_14s8p9y3 _14s8p9y1"};const ai=({className:e,variant:t="default"})=>l.jsx("div",{className:Y(tf[t],e)});var nf={primary:"_18bwogh2 _18bwogh0",secondary:"_18bwogh3 _18bwogh0",secondaryMd:"_18bwogh4 _18bwogh0 _18bwogh1",neutral:"_18bwogh5 _18bwogh0",neutralMd:"_18bwogh6 _18bwogh0 _18bwogh1",ghost:"_18bwogh7 _18bwogh0",ghostMd:"_18bwogh8 _18bwogh0 _18bwogh1"},rf="_18bwogh9",sf="_18bwogha",af={primary:"_18bwoghb",secondary:"_18bwoghc",secondaryMd:"_18bwoghd",neutral:"_18bwoghe",neutralMd:"_18bwoghf",ghost:"_18bwoghg",ghostMd:"_18bwoghh"};const oi=w.forwardRef(({children:e,onClick:t,className:n,type:r="button",variant:s="primary",testId:i,icon:a,disabled:o,loading:d=!1},c)=>l.jsx("button",{ref:c,"data-testid":i,type:r,disabled:o,className:Y("sid-button",`sid-button--${s}`,nf[s],{[rf]:o},n),onClick:t,children:d?l.jsx(ai,{variant:"short",className:af[s]}):l.jsxs(l.Fragment,{children:[a?l.jsx("i",{className:sf,children:a}):null,e]})}));oi.displayName="Button";var P={},Tn={};Object.defineProperty(Tn,"__esModule",{value:!0});var of=[{name:"Afghanistan",dial_code:"+93",code:"AF",flag:"๐ฆ๐ซ"},{name:"Albania",dial_code:"+355",code:"AL",flag:"๐ฆ๐ฑ"},{name:"Algeria",dial_code:"+213",code:"DZ",flag:"๐ฉ๐ฟ"},{name:"AmericanSamoa",dial_code:"+1684",code:"AS",flag:"๐ฆ๐ธ"},{name:"Andorra",dial_code:"+376",code:"AD",flag:"๐ฆ๐ฉ"},{name:"Angola",dial_code:"+244",code:"AO",flag:"๐ฆ๐ด"},{name:"Anguilla",dial_code:"+1264",code:"AI",flag:"๐ฆ๐ฎ"},{name:"Antarctica",dial_code:"+672",code:"AQ",flag:"๐ฆ๐ถ"},{name:"Antigua and Barbuda",dial_code:"+1268",code:"AG",flag:"๐ฆ๐ฌ"},{name:"Argentina",dial_code:"+54",code:"AR",flag:"๐ฆ๐ท"},{name:"Armenia",dial_code:"+374",code:"AM",flag:"๐ฆ๐ฒ"},{name:"Aruba",dial_code:"+297",code:"AW",flag:"๐ฆ๐ผ"},{name:"Australia",dial_code:"+61",code:"AU",preferred:!0,flag:"๐ฆ๐บ"},{name:"Austria",dial_code:"+43",code:"AT",flag:"๐ฆ๐น"},{name:"Azerbaijan",dial_code:"+994",code:"AZ",flag:"๐ฆ๐ฟ"},{name:"Bahamas",dial_code:"+1242",code:"BS",flag:"๐ง๐ธ"},{name:"Bahrain",dial_code:"+973",code:"BH",flag:"๐ง๐ญ"},{name:"Bangladesh",dial_code:"+880",code:"BD",flag:"๐ง๐ฉ"},{name:"Barbados",dial_code:"+1246",code:"BB",flag:"๐ง๐ง"},{name:"Belarus",dial_code:"+375",code:"BY",flag:"๐ง๐พ"},{name:"Belgium",dial_code:"+32",code:"BE",flag:"๐ง๐ช"},{name:"Belize",dial_code:"+501",code:"BZ",flag:"๐ง๐ฟ"},{name:"Benin",dial_code:"+229",code:"BJ",flag:"๐ง๐ฏ"},{name:"Bermuda",dial_code:"+1441",code:"BM",flag:"๐ง๐ฒ"},{name:"Bhutan",dial_code:"+975",code:"BT",flag:"๐ง๐น"},{name:"Bolivia, Plurinational State of",dial_code:"+591",code:"BO",flag:"๐ง๐ด"},{name:"Bosnia and Herzegovina",dial_code:"+387",code:"BA",flag:"๐ง๐ฆ"},{name:"Botswana",dial_code:"+267",code:"BW",flag:"๐ง๐ผ"},{name:"Brazil",dial_code:"+55",code:"BR",flag:"๐ง๐ท"},{name:"British Indian Ocean Territory",dial_code:"+246",code:"IO",flag:"๐ฎ๐ด"},{name:"Brunei Darussalam",dial_code:"+673",code:"BN",flag:"๐ง๐ณ"},{name:"Bulgaria",dial_code:"+359",code:"BG",flag:"๐ง๐ฌ"},{name:"Burkina Faso",dial_code:"+226",code:"BF",flag:"๐ง๐ซ"},{name:"Burundi",dial_code:"+257",code:"BI",flag:"๐ง๐ฎ"},{name:"Cambodia",dial_code:"+855",code:"KH",flag:"๐ฐ๐ญ"},{name:"Cameroon",dial_code:"+237",code:"CM",flag:"๐จ๐ฒ"},{name:"Canada",dial_code:"+1",code:"CA",flag:"๐จ๐ฆ"},{name:"Cape Verde",dial_code:"+238",code:"CV",flag:"๐จ๐ป"},{name:"Cayman Islands",dial_code:"+345",code:"KY",flag:"๐ฐ๐พ"},{name:"Central African Republic",dial_code:"+236",code:"CF",flag:"๐จ๐ซ"},{name:"Chad",dial_code:"+235",code:"TD",flag:"๐น๐ฉ"},{name:"Chile",dial_code:"+56",code:"CL",flag:"๐จ๐ฑ"},{name:"China",dial_code:"+86",code:"CN",flag:"๐จ๐ณ"},{name:"Christmas Island",dial_code:"+61",code:"CX",flag:"๐จ๐ฝ"},{name:"Cocos (Keeling) Islands",dial_code:"+61",code:"CC",flag:"๐จ๐จ"},{name:"Colombia",dial_code:"+57",code:"CO",flag:"๐จ๐ด"},{name:"Comoros",dial_code:"+269",code:"KM",flag:"๐ฐ๐ฒ"},{name:"Congo",dial_code:"+242",code:"CG",flag:"๐จ๐ฌ"},{name:"Congo, The Democratic Republic of the",dial_code:"+243",code:"CD",flag:"๐จ๐ฉ"},{name:"Cook Islands",dial_code:"+682",code:"CK",flag:"๐จ๐ฐ"},{name:"Costa Rica",dial_code:"+506",code:"CR",flag:"๐จ๐ท"},{name:"Cote d'Ivoire",dial_code:"+225",code:"CI",flag:"๐จ๐ฎ"},{name:"Croatia",dial_code:"+385",code:"HR",flag:"๐ญ๐ท"},{name:"Cuba",dial_code:"+53",code:"CU",flag:"๐จ๐บ"},{name:"Cyprus",dial_code:"+357",code:"CY",flag:"๐จ๐พ"},{name:"Czech Republic",dial_code:"+420",code:"CZ",flag:"๐จ๐ฟ"},{name:"Denmark",dial_code:"+45",code:"DK",flag:"๐ฉ๐ฐ"},{name:"Djibouti",dial_code:"+253",code:"DJ",flag:"๐ฉ๐ฏ"},{name:"Dominica",dial_code:"+1767",code:"DM",flag:"๐ฉ๐ฒ"},{name:"Dominican Republic",dial_code:"+1849",code:"DO",flag:"๐ฉ๐ด"},{name:"Ecuador",dial_code:"+593",code:"EC",flag:"๐ช๐จ"},{name:"Egypt",dial_code:"+20",code:"EG",flag:"๐ช๐ฌ"},{name:"El Salvador",dial_code:"+503",code:"SV",flag:"๐ธ๐ป"},{name:"Equatorial Guinea",dial_code:"+240",code:"GQ",flag:"๐ฌ๐ถ"},{name:"Eritrea",dial_code:"+291",code:"ER",flag:"๐ช๐ท"},{name:"Estonia",dial_code:"+372",code:"EE",flag:"๐ช๐ช"},{name:"Ethiopia",dial_code:"+251",code:"ET",flag:"๐ช๐น"},{name:"Falkland Islands (Malvinas)",dial_code:"+500",code:"FK",flag:"๐ซ๐ฐ"},{name:"Faroe Islands",dial_code:"+298",code:"FO",flag:"๐ซ๐ด"},{name:"Fiji",dial_code:"+679",code:"FJ",flag:"๐ซ๐ฏ"},{name:"Finland",dial_code:"+358",code:"FI",flag:"๐ซ๐ฎ"},{name:"France",dial_code:"+33",code:"FR",flag:"๐ซ๐ท"},{name:"French Guiana",dial_code:"+594",code:"GF",flag:"๐ฌ๐ซ"},{name:"French Polynesia",dial_code:"+689",code:"PF",flag:"๐ต๐ซ"},{name:"Gabon",dial_code:"+241",code:"GA",flag:"๐ฌ๐ฆ"},{name:"Gambia",dial_code:"+220",code:"GM",flag:"๐ฌ๐ฒ"},{name:"Georgia",dial_code:"+995",code:"GE",flag:"๐ฌ๐ช"},{name:"Germany",dial_code:"+49",code:"DE",flag:"๐ฉ๐ช"},{name:"Ghana",dial_code:"+233",code:"GH",flag:"๐ฌ๐ญ"},{name:"Gibraltar",dial_code:"+350",code:"GI",flag:"๐ฌ๐ฎ"},{name:"Greece",dial_code:"+30",code:"GR",flag:"๐ฌ๐ท"},{name:"Greenland",dial_code:"+299",code:"GL",flag:"๐ฌ๐ฑ"},{name:"Grenada",dial_code:"+1473",code:"GD",flag:"๐ฌ๐ฉ"},{name:"Guadeloupe",dial_code:"+590",code:"GP",flag:"๐ฌ๐ต"},{name:"Guam",dial_code:"+1671",code:"GU",flag:"๐ฌ๐บ"},{name:"Guatemala",dial_code:"+502",code:"GT",flag:"๐ฌ๐น"},{name:"Guernsey",dial_code:"+44",code:"GG",flag:"๐ฌ๐ฌ"},{name:"Guinea",dial_code:"+224",code:"GN",flag:"๐ฌ๐ณ"},{name:"Guinea-Bissau",dial_code:"+245",code:"GW",flag:"๐ฌ๐ผ"},{name:"Guyana",dial_code:"+592",code:"GY",flag:"๐ฌ๐พ"},{name:"Haiti",dial_code:"+509",code:"HT",flag:"๐ญ๐น"},{name:"Holy See (Vatican City State)",dial_code:"+379",code:"VA",flag:"๐ป๐ฆ"},{name:"Honduras",dial_code:"+504",code:"HN",flag:"๐ญ๐ณ"},{name:"Hong Kong",dial_code:"+852",code:"HK",flag:"๐ญ๐ฐ"},{name:"Hungary",dial_code:"+36",code:"HU",flag:"๐ญ๐บ"},{name:"Iceland",dial_code:"+354",code:"IS",flag:"๐ฎ๐ธ"},{name:"India",dial_code:"+91",code:"IN",preferred:!0,flag:"๐ฎ๐ณ"},{name:"Indonesia",dial_code:"+62",code:"ID",flag:"๐ฎ๐ฉ"},{name:"Iran, Islamic Republic of",dial_code:"+98",code:"IR",flag:"๐ฎ๐ท"},{name:"Iraq",dial_code:"+964",code:"IQ",flag:"๐ฎ๐ถ"},{name:"Ireland",dial_code:"+353",code:"IE",flag:"๐ฎ๐ช"},{name:"Isle of Man",dial_code:"+44",code:"IM",flag:"๐ฎ๐ฒ"},{name:"Israel",dial_code:"+972",code:"IL",flag:"๐ฎ๐ฑ"},{name:"Italy",dial_code:"+39",code:"IT",flag:"๐ฎ๐น"},{name:"Jamaica",dial_code:"+1876",code:"JM",flag:"๐ฏ๐ฒ"},{name:"Japan",dial_code:"+81",code:"JP",flag:"๐ฏ๐ต"},{name:"Jersey",dial_code:"+44",code:"JE",flag:"๐ฏ๐ช"},{name:"Jordan",dial_code:"+962",code:"JO",flag:"๐ฏ๐ด"},{name:"Kazakhstan",dial_code:"+77",code:"KZ",flag:"๐ฐ๐ฟ"},{name:"Kenya",dial_code:"+254",code:"KE",flag:"๐ฐ๐ช"},{name:"Kiribati",dial_code:"+686",code:"KI",flag:"๐ฐ๐ฎ"},{name:"Korea, Democratic People's Republic of",dial_code:"+850",code:"KP",flag:"๐ฐ๐ต"},{name:"Korea, Republic of",dial_code:"+82",code:"KR",flag:"๐ฐ๐ท"},{name:"Kuwait",dial_code:"+965",code:"KW",flag:"๐ฐ๐ผ"},{name:"Kyrgyzstan",dial_code:"+996",code:"KG",flag:"๐ฐ๐ฌ"},{name:"Lao People's Democratic Republic",dial_code:"+856",code:"LA",flag:"๐ฑ๐ฆ"},{name:"Latvia",dial_code:"+371",code:"LV",flag:"๐ฑ๐ป"},{name:"Lebanon",dial_code:"+961",code:"LB",flag:"๐ฑ๐ง"},{name:"Lesotho",dial_code:"+266",code:"LS",flag:"๐ฑ๐ธ"},{name:"Liberia",dial_code:"+231",code:"LR",flag:"๐ฑ๐ท"},{name:"Libyan Arab Jamahiriya",dial_code:"+218",code:"LY",flag:"๐ฑ๐พ"},{name:"Liechtenstein",dial_code:"+423",code:"LI",flag:"๐ฑ๐ฎ"},{name:"Lithuania",dial_code:"+370",code:"LT",flag:"๐ฑ๐น"},{name:"Luxembourg",dial_code:"+352",code:"LU",flag:"๐ฑ๐บ"},{name:"Macao",dial_code:"+853",code:"MO",flag:"๐ฒ๐ด"},{name:"Macedonia, The Former Yugoslav Republic of",dial_code:"+389",code:"MK",flag:"๐ฒ๐ฐ"},{name:"Madagascar",dial_code:"+261",code:"MG",flag:"๐ฒ๐ฌ"},{name:"Malawi",dial_code:"+265",code:"MW",flag:"๐ฒ๐ผ"},{name:"Malaysia",dial_code:"+60",code:"MY",flag:"๐ฒ๐พ"},{name:"Maldives",dial_code:"+960",code:"MV",flag:"๐ฒ๐ป"},{name:"Mali",dial_code:"+223",code:"ML",flag:"๐ฒ๐ฑ"},{name:"Malta",dial_code:"+356",code:"MT",flag:"๐ฒ๐น"},{name:"Marshall Islands",dial_code:"+692",code:"MH",flag:"๐ฒ๐ญ"},{name:"Martinique",dial_code:"+596",code:"MQ",flag:"๐ฒ๐ถ"},{name:"Mauritania",dial_code:"+222",code:"MR",flag:"๐ฒ๐ท"},{name:"Mauritius",dial_code:"+230",code:"MU",flag:"๐ฒ๐บ"},{name:"Mayotte",dial_code:"+262",code:"YT",flag:"๐พ๐น"},{name:"Mexico",dial_code:"+52",code:"MX",flag:"๐ฒ๐ฝ"},{name:"Micronesia, Federated States of",dial_code:"+691",code:"FM",flag:"๐ซ๐ฒ"},{name:"Moldova, Republic of",dial_code:"+373",code:"MD",flag:"๐ฒ๐ฉ"},{name:"Monaco",dial_code:"+377",code:"MC",flag:"๐ฒ๐จ"},{name:"Mongolia",dial_code:"+976",code:"MN",flag:"๐ฒ๐ณ"},{name:"Montenegro",dial_code:"+382",code:"ME",flag:"๐ฒ๐ช"},{name:"Montserrat",dial_code:"+1664",code:"MS",flag:"๐ฒ๐ธ"},{name:"Morocco",dial_code:"+212",code:"MA",flag:"๐ฒ๐ฆ"},{name:"Mozambique",dial_code:"+258",code:"MZ",flag:"๐ฒ๐ฟ"},{name:"Myanmar",dial_code:"+95",code:"MM",flag:"๐ฒ๐ฒ"},{name:"Namibia",dial_code:"+264",code:"NA",flag:"๐ณ๐ฆ"},{name:"Nauru",dial_code:"+674",code:"NR",flag:"๐ณ๐ท"},{name:"Nepal",dial_code:"+977",code:"NP",flag:"๐ณ๐ต"},{name:"Netherlands",dial_code:"+31",code:"NL",flag:"๐ณ๐ฑ"},{name:"Netherlands Antilles",dial_code:"+599",code:"AN",flag:"๐ฆ๐ณ"},{name:"New Caledonia",dial_code:"+687",code:"NC",flag:"๐ณ๐จ"},{name:"New Zealand",dial_code:"+64",code:"NZ",flag:"๐ณ๐ฟ"},{name:"Nicaragua",dial_code:"+505",code:"NI",flag:"๐ณ๐ฎ"},{name:"Niger",dial_code:"+227",code:"NE",flag:"๐ณ๐ช"},{name:"Nigeria",dial_code:"+234",code:"NG",flag:"๐ณ๐ฌ"},{name:"Niue",dial_code:"+683",code:"NU",flag:"๐ณ๐บ"},{name:"Norfolk Island",dial_code:"+672",code:"NF",flag:"๐ณ๐ซ"},{name:"Northern Mariana Islands",dial_code:"+1670",code:"MP",flag:"๐ฒ๐ต"},{name:"Norway",dial_code:"+47",code:"NO",flag:"๐ณ๐ด"},{name:"Oman",dial_code:"+968",code:"OM",flag:"๐ด๐ฒ"},{name:"Pakistan",dial_code:"+92",code:"PK",flag:"๐ต๐ฐ"},{name:"Palau",dial_code:"+680",code:"PW",flag:"๐ต๐ผ"},{name:"Palestinian Territory, Occupied",dial_code:"+970",code:"PS",flag:"๐ต๐ธ"},{name:"Panama",dial_code:"+507",code:"PA",flag:"๐ต๐ฆ"},{name:"Papua New Guinea",dial_code:"+675",code:"PG",flag:"๐ต๐ฌ"},{name:"Paraguay",dial_code:"+595",code:"PY",flag:"๐ต๐พ"},{name:"Peru",dial_code:"+51",code:"PE",flag:"๐ต๐ช"},{name:"Philippines",dial_code:"+63",code:"PH",flag:"๐ต๐ญ"},{name:"Pitcairn",dial_code:"+872",code:"PN",flag:"๐ต๐ณ"},{name:"Poland",dial_code:"+48",code:"PL",flag:"๐ต๐ฑ"},{name:"Portugal",dial_code:"+351",code:"PT",flag:"๐ต๐น"},{name:"Puerto Rico",dial_code:"+1939",code:"PR",flag:"๐ต๐ท"},{name:"Qatar",dial_code:"+974",code:"QA",flag:"๐ถ๐ฆ"},{name:"Romania",dial_code:"+40",code:"RO",flag:"๐ท๐ด"},{name:"Russia",dial_code:"+7",code:"RU",flag:"๐ท๐บ"},{name:"Rwanda",dial_code:"+250",code:"RW",flag:"๐ท๐ผ"},{name:"Rรฉunion",dial_code:"+262",code:"RE",flag:"๐ท๐ช"},{name:"Saint Barthรฉlemy",dial_code:"+590",code:"BL",flag:"๐ง๐ฑ"},{name:"Saint Helena, Ascension and Tristan Da Cunha",dial_code:"+290",code:"SH",flag:"๐ธ๐ญ"},{name:"Saint Kitts and Nevis",dial_code:"+1869",code:"KN",flag:"๐ฐ๐ณ"},{name:"Saint Lucia",dial_code:"+1758",code:"LC",flag:"๐ฑ๐จ"},{name:"Saint Martin",dial_code:"+590",code:"MF",flag:"๐ฒ๐ซ"},{name:"Saint Pierre and Miquelon",dial_code:"+508",code:"PM",flag:"๐ต๐ฒ"},{name:"Saint Vincent and the Grenadines",dial_code:"+1784",code:"VC",flag:"๐ป๐จ"},{name:"Samoa",dial_code:"+685",code:"WS",flag:"๐ผ๐ธ"},{name:"San Marino",dial_code:"+378",code:"SM",flag:"๐ธ๐ฒ"},{name:"Sao Tome and Principe",dial_code:"+239",code:"ST",flag:"๐ธ๐น"},{name:"Saudi Arabia",dial_code:"+966",code:"SA",flag:"๐ธ๐ฆ"},{name:"Senegal",dial_code:"+221",code:"SN",flag:"๐ธ๐ณ"},{name:"Serbia",dial_code:"+381",code:"RS",flag:"๐ท๐ธ"},{name:"Seychelles",dial_code:"+248",code:"SC",flag:"๐ธ๐จ"},{name:"Sierra Leone",dial_code:"+232",code:"SL",flag:"๐ธ๐ฑ"},{name:"Singapore",dial_code:"+65",code:"SG",flag:"๐ธ๐ฌ"},{name:"Slovakia",dial_code:"+421",code:"SK",flag:"๐ธ๐ฐ"},{name:"Slovenia",dial_code:"+386",code:"SI",flag:"๐ธ๐ฎ"},{name:"Solomon Islands",dial_code:"+677",code:"SB",flag:"๐ธ๐ง"},{name:"Somalia",dial_code:"+252",code:"SO",flag:"๐ธ๐ด"},{name:"South Africa",dial_code:"+27",code:"ZA",flag:"๐ฟ๐ฆ"},{name:"South Georgia and the South Sandwich Islands",dial_code:"+500",code:"GS",flag:"๐ฌ๐ธ"},{name:"Spain",dial_code:"+34",code:"ES",flag:"๐ช๐ธ"},{name:"Sri Lanka",dial_code:"+94",code:"LK",flag:"๐ฑ๐ฐ"},{name:"Sudan",dial_code:"+249",code:"SD",flag:"๐ธ๐ฉ"},{name:"South Sudan",dial_code:"+211",code:"SS",flag:"๐ธ๐ธ"},{name:"Suriname",dial_code:"+597",code:"SR",flag:"๐ธ๐ท"},{name:"Svalbard and Jan Mayen",dial_code:"+47",code:"SJ",flag:"๐ธ๐ฏ"},{name:"Swaziland",dial_code:"+268",code:"SZ",flag:"๐ธ๐ฟ"},{name:"Sweden",dial_code:"+46",code:"SE",flag:"๐ธ๐ช"},{name:"Switzerland",dial_code:"+41",code:"CH",flag:"๐จ๐ญ"},{name:"Syrian Arab Republic",dial_code:"+963",code:"SY",flag:"๐ธ๐พ"},{name:"Taiwan, Province of China",dial_code:"+886",code:"TW",flag:"๐น๐ผ"},{name:"Tajikistan",dial_code:"+992",code:"TJ",flag:"๐น๐ฏ"},{name:"Tanzania, United Republic of",dial_code:"+255",code:"TZ",flag:"๐น๐ฟ"},{name:"Thailand",dial_code:"+66",code:"TH",flag:"๐น๐ญ"},{name:"Timor-Leste",dial_code:"+670",code:"TL",flag:"๐น๐ฑ"},{name:"Togo",dial_code:"+228",code:"TG",flag:"๐น๐ฌ"},{name:"Tokelau",dial_code:"+690",code:"TK",flag:"๐น๐ฐ"},{name:"Tonga",dial_code:"+676",code:"TO",flag:"๐น๐ด"},{name:"Trinidad and Tobago",dial_code:"+1868",code:"TT",flag:"๐น๐น"},{name:"Tunisia",dial_code:"+216",code:"TN",flag:"๐น๐ณ"},{name:"Turkey",dial_code:"+90",code:"TR",flag:"๐น๐ท"},{name:"Turkmenistan",dial_code:"+993",code:"TM",flag:"๐น๐ฒ"},{name:"Turks and Caicos Islands",dial_code:"+1649",code:"TC",flag:"๐น๐จ"},{name:"Tuvalu",dial_code:"+688",code:"TV",flag:"๐น๐ป"},{name:"Uganda",dial_code:"+256",code:"UG",flag:"๐บ๐ฌ"},{name:"Ukraine",dial_code:"+380",code:"UA",flag:"๐บ๐ฆ"},{name:"United Arab Emirates",dial_code:"+971",code:"AE",preferred:!0,flag:"๐ฆ๐ช"},{name:"United Kingdom",dial_code:"+44",code:"GB",preferred:!0,flag:"๐ฌ๐ง"},{name:"United States",dial_code:"+1",code:"US",preferred:!0,flag:"๐บ๐ธ"},{name:"Uruguay",dial_code:"+598",code:"UY",flag:"๐บ๐พ"},{name:"Uzbekistan",dial_code:"+998",code:"UZ",flag:"๐บ๐ฟ"},{name:"Vanuatu",dial_code:"+678",code:"VU",flag:"๐ป๐บ"},{name:"Venezuela, Bolivarian Republic of",dial_code:"+58",code:"VE",flag:"๐ป๐ช"},{name:"Viet Nam",dial_code:"+84",code:"VN",flag:"๐ป๐ณ"},{name:"Virgin Islands, British",dial_code:"+1284",code:"VG",flag:"๐ป๐ฌ"},{name:"Virgin Islands, U.S.",dial_code:"+1340",code:"VI",flag:"๐ป๐ฎ"},{name:"Wallis and Futuna",dial_code:"+681",code:"WF",flag:"๐ผ๐ซ"},{name:"Yemen",dial_code:"+967",code:"YE",flag:"๐พ๐ช"},{name:"Zambia",dial_code:"+260",code:"ZM",flag:"๐ฟ๐ฒ"},{name:"Zimbabwe",dial_code:"+263",code:"ZW",flag:"๐ฟ๐ผ"},{name:"ร
land Islands",dial_code:"+358",code:"AX",flag:"๐ฆ๐ฝ"}];Tn.default=of;Object.defineProperty(P,"__esModule",{value:!0});P.searchFlag=P.findFlagsByDialCode=P.findFlagByDialCode=P.findFlag=P.getList=void 0;var It=Tn,df=function(e){return It.default.find(function(t){return t.code.toLowerCase()===e.toLowerCase()})};P.findFlag=df;var cf=function(e){var t,n=di(e),r=n.find(function(s){return s.dial_code===e&&s.preferred});return r||((t=n[0])!==null&&t!==void 0?t:null)};P.findFlagByDialCode=cf;var di=function(e){return It.default.filter(function(t){return t.dial_code===e})};P.findFlagsByDialCode=di;var uf=function(){return It.default};P.getList=uf;var lf=function(e){return It.default.filter(function(t){return t.code.toLowerCase().includes(e.toLowerCase())||t.name.toLowerCase().includes(e.toLowerCase())||t.dial_code.toLowerCase().includes(e.toLowerCase())})};P.searchFlag=lf;var ff="_6bk5ng3",pf="_6bk5ng0",hf={text:"_6bk5ng5 _6bk5ng4",email:"_6bk5ng6 _6bk5ng4",password:"_6bk5ng7 _6bk5ng4",tel:"_6bk5ng8 _6bk5ng4"},gf="_6bk5ng9";const _f=({id:e,name:t,label:n,placeholder:r="",value:s,onChange:i,type:a="text"})=>{const o=w.useCallback(d=>{i(d)},[i]);return l.jsxs("div",{className:hf[a],children:[l.jsx("label",{htmlFor:e,className:gf,children:n}),l.jsx("input",{type:a,id:e,name:t,className:pf,placeholder:r,value:s,onChange:o})]})},Br=({name:e,id:t,label:n,placeholder:r="",className:s="",type:i="text",value:a,onChange:o})=>l.jsx("div",{className:Y("sid-input",`sid-input--${i}`,ff,s),children:l.jsx(_f,{id:t,name:e,label:n,placeholder:r,className:s,type:i,value:a,onChange:o})}),mf=`
|
|
34
|
+
@media (prefers-color-scheme: dark) {
|
|
35
|
+
.sid-theme-root__auto path { fill: white; }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.sid-theme-root__dark path { fill: white; }
|
|
39
|
+
`;var bf="vsm5or3",wf="vsm5org",yf={blue:"vsm5ore vsm5orc",red:"vsm5orf vsm5orc"},Sf="vsm5ord",$f={blue:"vsm5ora vsm5or8",red:"vsm5orb vsm5or8"},Ef="vsm5or9",vf={blue:"vsm5or6 vsm5or4",red:"vsm5or7 vsm5or4"},Cf="vsm5or5";const qn=({children:e,className:t,variant:n="blue",shouldAnimate:r=!0})=>l.jsxs("div",{className:Y(bf,t),children:[l.jsx("div",{className:Y(vf[n],{[Cf]:r})}),l.jsx("div",{className:Y($f[n],{[Ef]:r})}),l.jsx("div",{className:Y(yf[n],{[Sf]:r})}),l.jsx("div",{className:wf,children:e})]});function kf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Vr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Gr(Object(n),!0).forEach(function(r){kf(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gr(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Rf=(e,t,n)=>{for(var r of Object.keys(e)){var s;if(e[r]!==((s=t[r])!==null&&s!==void 0?s:n[r]))return!1}return!0},ci=e=>t=>{var n=e.defaultClassName,r=Vr(Vr({},e.defaultVariants),t);for(var s in r){var i,a=(i=r[s])!==null&&i!==void 0?i:e.defaultVariants[s];if(a!=null){var o=a;typeof o=="boolean"&&(o=o===!0?"true":"false");var d=e.variantClassNames[s][o];d&&(n+=" "+d)}}for(var[c,f]of e.compoundVariants)Rf(c,r,e.defaultVariants)&&(n+=" "+f);return n},If=ci({defaultClassName:"jpsq540",variantClassNames:{direction:{vertical:"jpsq541",horizontal:"jpsq542"},space:{between:"jpsq543",evenly:"jpsq544"}},defaultVariants:{direction:"vertical"},compoundVariants:[]});function xf(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Df(e){var t=xf(e,"string");return typeof t=="symbol"?t:String(t)}function Tf(e,t,n){return t=Df(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Vt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fr(Object(n),!0).forEach(function(r){Tf(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fr(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var qf=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=Object.assign({},...n.map(d=>d.styles)),i=Object.keys(s),a=i.filter(d=>"mappings"in s[d]),o=d=>{var c=[],f={},u=Vt({},d),p=!1;for(var b of a){var G=d[b];if(G!=null){var mi=s[b];p=!0;for(var Dt of mi.mappings)f[Dt]=G,u[Dt]==null&&delete u[Dt]}}var On=p?Vt(Vt({},f),u):d,bi=function(){var X=On[Nn],$e=s[Nn];try{if($e.mappings)return"continue";if(typeof X=="string"||typeof X=="number")c.push($e.values[X].defaultClass);else if(Array.isArray(X))for(var Be=0;Be<X.length;Be++){var Ln=X[Be];if(Ln!=null){var yi=$e.responsiveArray[Be];c.push($e.values[Ln].conditions[yi])}}else for(var Pn in X){var Un=X[Pn];Un!=null&&c.push($e.values[Un].conditions[Pn])}}catch(Si){throw Si}};for(var Nn in On)var wi=bi();return e(c.join(" "))};return Object.assign(o,{properties:new Set(i)})},Af=e=>e,Of=function(){return qf(Af)(...arguments)},ui=Of({conditions:{defaultCondition:"lightMode",conditionNames:["lightMode","darkMode"],responsiveArray:void 0},styles:{color:{values:{background:{conditions:{lightMode:"q4sipu0",darkMode:"q4sipu1"},defaultClass:"q4sipu0"},mute:{conditions:{lightMode:"q4sipu2",darkMode:"q4sipu3"},defaultClass:"q4sipu2"},panel:{conditions:{lightMode:"q4sipu4",darkMode:"q4sipu5"},defaultClass:"q4sipu4"},foreground:{conditions:{lightMode:"q4sipu6",darkMode:"q4sipu7"},defaultClass:"q4sipu6"},contrast:{conditions:{lightMode:"q4sipu8",darkMode:"q4sipu9"},defaultClass:"q4sipu8"},secondary:{conditions:{lightMode:"q4sipua",darkMode:"q4sipub"},defaultClass:"q4sipua"},tertiary:{conditions:{lightMode:"q4sipuc",darkMode:"q4sipud"},defaultClass:"q4sipuc"},placeholder:{conditions:{lightMode:"q4sipue",darkMode:"q4sipuf"},defaultClass:"q4sipue"},smooth:{conditions:{lightMode:"q4sipug",darkMode:"q4sipuh"},defaultClass:"q4sipug"},subtle:{conditions:{lightMode:"q4sipui",darkMode:"q4sipuj"},defaultClass:"q4sipui"},soft:{conditions:{lightMode:"q4sipuk",darkMode:"q4sipul"},defaultClass:"q4sipuk"},offset:{conditions:{lightMode:"q4sipum",darkMode:"q4sipun"},defaultClass:"q4sipum"},primary:{conditions:{lightMode:"q4sipuo",darkMode:"q4sipup"},defaultClass:"q4sipuo"},primaryHover:{conditions:{lightMode:"q4sipuq",darkMode:"q4sipur"},defaultClass:"q4sipuq"},transparent:{conditions:{lightMode:"q4sipus",darkMode:"q4siput"},defaultClass:"q4sipus"},error:{conditions:{lightMode:"q4sipuu",darkMode:"q4sipuv"},defaultClass:"q4sipuu"},auxiliary:{conditions:{lightMode:"q4sipuw",darkMode:"q4sipux"},defaultClass:"q4sipuw"},success:{conditions:{lightMode:"q4sipuy",darkMode:"q4sipuz"},defaultClass:"q4sipuy"},foregroundSuccess:{conditions:{lightMode:"q4sipu10",darkMode:"q4sipu11"},defaultClass:"q4sipu10"},backgroundSuccess:{conditions:{lightMode:"q4sipu12",darkMode:"q4sipu13"},defaultClass:"q4sipu12"},failure:{conditions:{lightMode:"q4sipu14",darkMode:"q4sipu15"},defaultClass:"q4sipu14"},foregroundFailure:{conditions:{lightMode:"q4sipu16",darkMode:"q4sipu17"},defaultClass:"q4sipu16"},backgroundFailure:{conditions:{lightMode:"q4sipu18",darkMode:"q4sipu19"},defaultClass:"q4sipu18"}}},backgroundColor:{values:{background:{conditions:{lightMode:"q4sipu1a",darkMode:"q4sipu1b"},defaultClass:"q4sipu1a"},mute:{conditions:{lightMode:"q4sipu1c",darkMode:"q4sipu1d"},defaultClass:"q4sipu1c"},panel:{conditions:{lightMode:"q4sipu1e",darkMode:"q4sipu1f"},defaultClass:"q4sipu1e"},foreground:{conditions:{lightMode:"q4sipu1g",darkMode:"q4sipu1h"},defaultClass:"q4sipu1g"},contrast:{conditions:{lightMode:"q4sipu1i",darkMode:"q4sipu1j"},defaultClass:"q4sipu1i"},secondary:{conditions:{lightMode:"q4sipu1k",darkMode:"q4sipu1l"},defaultClass:"q4sipu1k"},tertiary:{conditions:{lightMode:"q4sipu1m",darkMode:"q4sipu1n"},defaultClass:"q4sipu1m"},placeholder:{conditions:{lightMode:"q4sipu1o",darkMode:"q4sipu1p"},defaultClass:"q4sipu1o"},smooth:{conditions:{lightMode:"q4sipu1q",darkMode:"q4sipu1r"},defaultClass:"q4sipu1q"},subtle:{conditions:{lightMode:"q4sipu1s",darkMode:"q4sipu1t"},defaultClass:"q4sipu1s"},soft:{conditions:{lightMode:"q4sipu1u",darkMode:"q4sipu1v"},defaultClass:"q4sipu1u"},offset:{conditions:{lightMode:"q4sipu1w",darkMode:"q4sipu1x"},defaultClass:"q4sipu1w"},primary:{conditions:{lightMode:"q4sipu1y",darkMode:"q4sipu1z"},defaultClass:"q4sipu1y"},primaryHover:{conditions:{lightMode:"q4sipu20",darkMode:"q4sipu21"},defaultClass:"q4sipu20"},transparent:{conditions:{lightMode:"q4sipu22",darkMode:"q4sipu23"},defaultClass:"q4sipu22"},error:{conditions:{lightMode:"q4sipu24",darkMode:"q4sipu25"},defaultClass:"q4sipu24"},auxiliary:{conditions:{lightMode:"q4sipu26",darkMode:"q4sipu27"},defaultClass:"q4sipu26"},success:{conditions:{lightMode:"q4sipu28",darkMode:"q4sipu29"},defaultClass:"q4sipu28"},foregroundSuccess:{conditions:{lightMode:"q4sipu2a",darkMode:"q4sipu2b"},defaultClass:"q4sipu2a"},backgroundSuccess:{conditions:{lightMode:"q4sipu2c",darkMode:"q4sipu2d"},defaultClass:"q4sipu2c"},failure:{conditions:{lightMode:"q4sipu2e",darkMode:"q4sipu2f"},defaultClass:"q4sipu2e"},foregroundFailure:{conditions:{lightMode:"q4sipu2g",darkMode:"q4sipu2h"},defaultClass:"q4sipu2g"},backgroundFailure:{conditions:{lightMode:"q4sipu2i",darkMode:"q4sipu2j"},defaultClass:"q4sipu2i"}}}}},{conditions:void 0,styles:{marginY:{mappings:["marginTop","marginBottom"]},marginX:{mappings:["marginLeft","marginRight"]},gap:{values:{0:{defaultClass:"q4sipu2k"},1:{defaultClass:"q4sipu2l"},2:{defaultClass:"q4sipu2m"},3:{defaultClass:"q4sipu2n"},4:{defaultClass:"q4sipu2o"},5:{defaultClass:"q4sipu2p"},6:{defaultClass:"q4sipu2q"},7:{defaultClass:"q4sipu2r"},8:{defaultClass:"q4sipu2s"},9:{defaultClass:"q4sipu2t"},10:{defaultClass:"q4sipu2u"},11:{defaultClass:"q4sipu2v"},12:{defaultClass:"q4sipu2w"},13:{defaultClass:"q4sipu2x"},14:{defaultClass:"q4sipu2y"},15:{defaultClass:"q4sipu2z"},16:{defaultClass:"q4sipu30"},20:{defaultClass:"q4sipu31"},24:{defaultClass:"q4sipu32"},28:{defaultClass:"q4sipu33"},32:{defaultClass:"q4sipu34"},36:{defaultClass:"q4sipu35"},40:{defaultClass:"q4sipu36"},44:{defaultClass:"q4sipu37"},48:{defaultClass:"q4sipu38"},52:{defaultClass:"q4sipu39"},56:{defaultClass:"q4sipu3a"},60:{defaultClass:"q4sipu3b"},64:{defaultClass:"q4sipu3c"},68:{defaultClass:"q4sipu3d"},72:{defaultClass:"q4sipu3e"},76:{defaultClass:"q4sipu3f"},80:{defaultClass:"q4sipu3g"},96:{defaultClass:"q4sipu3h"},px:{defaultClass:"q4sipu3i"},"0.25":{defaultClass:"q4sipu3j"},"0.5":{defaultClass:"q4sipu3k"},"0.75":{defaultClass:"q4sipu3l"},"1.5":{defaultClass:"q4sipu3m"},"2.5":{defaultClass:"q4sipu3n"},"3.5":{defaultClass:"q4sipu3o"}}},marginTop:{values:{0:{defaultClass:"q4sipu3p"},1:{defaultClass:"q4sipu3q"},2:{defaultClass:"q4sipu3r"},3:{defaultClass:"q4sipu3s"},4:{defaultClass:"q4sipu3t"},5:{defaultClass:"q4sipu3u"},6:{defaultClass:"q4sipu3v"},7:{defaultClass:"q4sipu3w"},8:{defaultClass:"q4sipu3x"},9:{defaultClass:"q4sipu3y"},10:{defaultClass:"q4sipu3z"},11:{defaultClass:"q4sipu40"},12:{defaultClass:"q4sipu41"},13:{defaultClass:"q4sipu42"},14:{defaultClass:"q4sipu43"},15:{defaultClass:"q4sipu44"},16:{defaultClass:"q4sipu45"},20:{defaultClass:"q4sipu46"},24:{defaultClass:"q4sipu47"},28:{defaultClass:"q4sipu48"},32:{defaultClass:"q4sipu49"},36:{defaultClass:"q4sipu4a"},40:{defaultClass:"q4sipu4b"},44:{defaultClass:"q4sipu4c"},48:{defaultClass:"q4sipu4d"},52:{defaultClass:"q4sipu4e"},56:{defaultClass:"q4sipu4f"},60:{defaultClass:"q4sipu4g"},64:{defaultClass:"q4sipu4h"},68:{defaultClass:"q4sipu4i"},72:{defaultClass:"q4sipu4j"},76:{defaultClass:"q4sipu4k"},80:{defaultClass:"q4sipu4l"},96:{defaultClass:"q4sipu4m"},px:{defaultClass:"q4sipu4n"},"0.25":{defaultClass:"q4sipu4o"},"0.5":{defaultClass:"q4sipu4p"},"0.75":{defaultClass:"q4sipu4q"},"1.5":{defaultClass:"q4sipu4r"},"2.5":{defaultClass:"q4sipu4s"},"3.5":{defaultClass:"q4sipu4t"}}},marginBottom:{values:{0:{defaultClass:"q4sipu4u"},1:{defaultClass:"q4sipu4v"},2:{defaultClass:"q4sipu4w"},3:{defaultClass:"q4sipu4x"},4:{defaultClass:"q4sipu4y"},5:{defaultClass:"q4sipu4z"},6:{defaultClass:"q4sipu50"},7:{defaultClass:"q4sipu51"},8:{defaultClass:"q4sipu52"},9:{defaultClass:"q4sipu53"},10:{defaultClass:"q4sipu54"},11:{defaultClass:"q4sipu55"},12:{defaultClass:"q4sipu56"},13:{defaultClass:"q4sipu57"},14:{defaultClass:"q4sipu58"},15:{defaultClass:"q4sipu59"},16:{defaultClass:"q4sipu5a"},20:{defaultClass:"q4sipu5b"},24:{defaultClass:"q4sipu5c"},28:{defaultClass:"q4sipu5d"},32:{defaultClass:"q4sipu5e"},36:{defaultClass:"q4sipu5f"},40:{defaultClass:"q4sipu5g"},44:{defaultClass:"q4sipu5h"},48:{defaultClass:"q4sipu5i"},52:{defaultClass:"q4sipu5j"},56:{defaultClass:"q4sipu5k"},60:{defaultClass:"q4sipu5l"},64:{defaultClass:"q4sipu5m"},68:{defaultClass:"q4sipu5n"},72:{defaultClass:"q4sipu5o"},76:{defaultClass:"q4sipu5p"},80:{defaultClass:"q4sipu5q"},96:{defaultClass:"q4sipu5r"},px:{defaultClass:"q4sipu5s"},"0.25":{defaultClass:"q4sipu5t"},"0.5":{defaultClass:"q4sipu5u"},"0.75":{defaultClass:"q4sipu5v"},"1.5":{defaultClass:"q4sipu5w"},"2.5":{defaultClass:"q4sipu5x"},"3.5":{defaultClass:"q4sipu5y"}}},marginLeft:{values:{0:{defaultClass:"q4sipu5z"},1:{defaultClass:"q4sipu60"},2:{defaultClass:"q4sipu61"},3:{defaultClass:"q4sipu62"},4:{defaultClass:"q4sipu63"},5:{defaultClass:"q4sipu64"},6:{defaultClass:"q4sipu65"},7:{defaultClass:"q4sipu66"},8:{defaultClass:"q4sipu67"},9:{defaultClass:"q4sipu68"},10:{defaultClass:"q4sipu69"},11:{defaultClass:"q4sipu6a"},12:{defaultClass:"q4sipu6b"},13:{defaultClass:"q4sipu6c"},14:{defaultClass:"q4sipu6d"},15:{defaultClass:"q4sipu6e"},16:{defaultClass:"q4sipu6f"},20:{defaultClass:"q4sipu6g"},24:{defaultClass:"q4sipu6h"},28:{defaultClass:"q4sipu6i"},32:{defaultClass:"q4sipu6j"},36:{defaultClass:"q4sipu6k"},40:{defaultClass:"q4sipu6l"},44:{defaultClass:"q4sipu6m"},48:{defaultClass:"q4sipu6n"},52:{defaultClass:"q4sipu6o"},56:{defaultClass:"q4sipu6p"},60:{defaultClass:"q4sipu6q"},64:{defaultClass:"q4sipu6r"},68:{defaultClass:"q4sipu6s"},72:{defaultClass:"q4sipu6t"},76:{defaultClass:"q4sipu6u"},80:{defaultClass:"q4sipu6v"},96:{defaultClass:"q4sipu6w"},px:{defaultClass:"q4sipu6x"},"0.25":{defaultClass:"q4sipu6y"},"0.5":{defaultClass:"q4sipu6z"},"0.75":{defaultClass:"q4sipu70"},"1.5":{defaultClass:"q4sipu71"},"2.5":{defaultClass:"q4sipu72"},"3.5":{defaultClass:"q4sipu73"}}},marginRight:{values:{0:{defaultClass:"q4sipu74"},1:{defaultClass:"q4sipu75"},2:{defaultClass:"q4sipu76"},3:{defaultClass:"q4sipu77"},4:{defaultClass:"q4sipu78"},5:{defaultClass:"q4sipu79"},6:{defaultClass:"q4sipu7a"},7:{defaultClass:"q4sipu7b"},8:{defaultClass:"q4sipu7c"},9:{defaultClass:"q4sipu7d"},10:{defaultClass:"q4sipu7e"},11:{defaultClass:"q4sipu7f"},12:{defaultClass:"q4sipu7g"},13:{defaultClass:"q4sipu7h"},14:{defaultClass:"q4sipu7i"},15:{defaultClass:"q4sipu7j"},16:{defaultClass:"q4sipu7k"},20:{defaultClass:"q4sipu7l"},24:{defaultClass:"q4sipu7m"},28:{defaultClass:"q4sipu7n"},32:{defaultClass:"q4sipu7o"},36:{defaultClass:"q4sipu7p"},40:{defaultClass:"q4sipu7q"},44:{defaultClass:"q4sipu7r"},48:{defaultClass:"q4sipu7s"},52:{defaultClass:"q4sipu7t"},56:{defaultClass:"q4sipu7u"},60:{defaultClass:"q4sipu7v"},64:{defaultClass:"q4sipu7w"},68:{defaultClass:"q4sipu7x"},72:{defaultClass:"q4sipu7y"},76:{defaultClass:"q4sipu7z"},80:{defaultClass:"q4sipu80"},96:{defaultClass:"q4sipu81"},px:{defaultClass:"q4sipu82"},"0.25":{defaultClass:"q4sipu83"},"0.5":{defaultClass:"q4sipu84"},"0.75":{defaultClass:"q4sipu85"},"1.5":{defaultClass:"q4sipu86"},"2.5":{defaultClass:"q4sipu87"},"3.5":{defaultClass:"q4sipu88"}}}}});const xt=e=>l.jsx("div",{className:Y("sid-stack",If(e.variant),ui({gap:e.space||"2"}),e.className),style:e.style,children:e.children});var Nf=ci({defaultClassName:"blle260",variantClassNames:{size:{xs:"blle261",sm:"blle262",base:"blle263",xl:"blle264","2xl-title":"blle265"},weight:{medium:"blle266",semibold:"blle267",bold:"blle268"},color:{contrast:"blle269",tertiary:"blle26a",placeholder:"blle26b",white:"blle26c",success:"blle26d",failure:"blle26e"}},defaultVariants:{size:"base",weight:"medium"},compoundVariants:[]});const Lf={text:{}},An=w.createContext(Lf);An.displayName="SlashIDTextContext";const Pf=({text:e,children:t})=>{const n=w.useMemo(()=>({text:e}),[e]);return l.jsx(An.Provider,{value:n,children:t})};function Uf(){const{text:e}=Wr.useContext(An);return e}const Ft={opening:"{{",closing:"}}"};function Mf(e,t){return e.includes(Ft.opening)?Object.keys(t).reduce((r,s)=>r.replace(`${Ft.opening}${s}${Ft.closing}`,t[s]),e):e}const pn=({as:e,t,tokens:n,variant:r,className:s,children:i})=>{const a=Uf(),o=e||"p";return l.jsxs(o,{className:Y("sid-text",`sid-text--${e}`,Nf(r),s),children:[n?Mf(a[t],n):a[t],i||null]})};var Bf="oqrv7f1";function Yr({width:e,height:t,minHeight:n,maxHeight:r,minWidth:s,maxWidth:i}){return l.jsx("div",{className:Bf,style:{width:e,height:t,minHeight:n,maxHeight:r,minWidth:s,maxWidth:i}})}function Gf(){return l.jsxs("svg",{width:"5",height:"20",viewBox:"0 0 5 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.5 0C3.32843 1.19209e-07 4 0.671573 4 1.5L4 11.5C4 12.3284 3.32843 13 2.5 13C1.67157 13 1 12.3284 1 11.5L1 1.5C1 0.671573 1.67157 -1.19209e-07 2.5 0Z",fill:"white"}),l.jsx("path",{d:"M4.5 18C4.5 19.1046 3.60457 20 2.5 20C1.39543 20 0.5 19.1046 0.5 18C0.5 16.8954 1.39543 16 2.5 16C3.60457 16 4.5 16.8954 4.5 18Z",fill:"white"})]})}const li=()=>l.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("style",{children:mf}),l.jsx("path",{d:"M12.686 10L2 30.228H5.198L15.884 10H12.686Z",fill:"#2A6AFF"}),l.jsx("path",{d:"M19.7923 15.694C20.9373 15.694 21.8723 14.732 21.8723 13.588C21.8723 12.444 20.9373 11.482 19.7923 11.482C18.6223 11.482 17.6873 12.444 17.6873 13.588C17.6873 14.732 18.6233 15.694 19.7933 15.694H19.7923ZM18.0773 17.514V30.228H21.4573V17.514H18.0773ZM34.1883 10V18.502C33.172 17.6398 31.8809 17.1695 30.5483 17.176C26.8563 17.176 24.0743 20.14 24.0743 23.884C24.0743 27.628 26.8563 30.592 30.5483 30.592C32.0823 30.592 33.4343 30.02 34.4483 29.032V30.228H37.5683V10H34.1883ZM30.9383 27.42C28.9883 27.42 27.5583 25.912 27.5583 23.884C27.5583 21.856 28.9883 20.348 30.9383 20.348C32.8883 20.348 34.3183 21.856 34.3183 23.884C34.3183 25.912 32.8883 27.42 30.9383 27.42Z",fill:"#142049"})]});function Vf(){const e=navigator.language.toLowerCase();return e==="ja"||e.startsWith("ja-")?"ja":"en"}const S={"footer.text":"Top-tier security by SlashID","initial.title":"Logging you in...","initial.details":"Please follow the on-screen instructions.","recover.password.title":"Reset password","recover.password.details":"Enter your new password.","recover.password.input.password.label":"Password","recover.password.input.confirmPassword.label":"Confirm password","recover.password.input.placeholder":"Type your new password","recover.password.submit":"Reset password","recover.password.validation.length":"Password is too short","recover.password.validation.password_variants":"Contains word 'password'","recover.password.validation.admin_variants":"Contains word 'admin'","recover.password.validation.user_variants":"Contains word 'user'","recover.password.validation.alphanumeric_sequences_1":"Sequence of alphanumeric characters","recover.password.validation.alphanumeric_sequences_2":"Sequence of alphanumeric characters","recover.password.validation.numeric_sequences_ascending":"Sequence of alphanumeric characters","recover.password.validation.numeric_subsequences_ascending":"Sequence of alphanumeric characters","recover.password.validation.numeric_sequences_descending":"Sequence of alphanumeric characters","recover.password.validation.numeric_subsequences_descending":"Sequence of alphanumeric characters","recover.password.validation.common_password_xkcd":"Common password","success.title":"Thank you, you're signed in!","success.details":"You can now close this page.","error.title":"Something went wrong...","error.detail":"Please log in again."},fi={en:S,ja:{"footer.text":S["footer.text"],"initial.title":"ใญใฐใคใณๅฆ็ใ่กใฃใฆใใพใใ","initial.details":"ๅฆ็ๅฎไบๅพใ็ป้ขใฏ่ชๅใงๅใๆฟใใใพใใ","success.title":"่ช่จผใๅฎไบใใพใใ๏ผ","success.details":"ใใฎใใผใธใ้ใใฆใๅ
ใฎใใผใธใธๆปใฃใฆใใ ใใใ","recover.password.title":S["recover.password.title"],"recover.password.details":S["recover.password.details"],"recover.password.input.password.label":S["recover.password.input.password.label"],"recover.password.input.confirmPassword.label":S["recover.password.input.confirmPassword.label"],"recover.password.input.placeholder":S["recover.password.input.placeholder"],"recover.password.submit":S["recover.password.submit"],"recover.password.validation.length":S["recover.password.validation.length"],"recover.password.validation.password_variants":S["recover.password.validation.password_variants"],"recover.password.validation.admin_variants":S["recover.password.validation.admin_variants"],"recover.password.validation.user_variants":S["recover.password.validation.user_variants"],"recover.password.validation.alphanumeric_sequences_1":S["recover.password.validation.alphanumeric_sequences_1"],"recover.password.validation.alphanumeric_sequences_2":S["recover.password.validation.alphanumeric_sequences_2"],"recover.password.validation.numeric_sequences_ascending":S["recover.password.validation.numeric_sequences_ascending"],"recover.password.validation.numeric_subsequences_ascending":S["recover.password.validation.numeric_subsequences_ascending"],"recover.password.validation.numeric_sequences_descending":S["recover.password.validation.numeric_sequences_descending"],"recover.password.validation.numeric_subsequences_descending":S["recover.password.validation.numeric_subsequences_descending"],"recover.password.validation.common_password_xkcd":S["recover.password.validation.common_password_xkcd"],"error.title":S["error.title"],"error.detail":"ๅๅบฆใญใฐใคใณใใใฆใใ ใใใ"}},Ff=e=>t=>fi[e][t],pi={logo:l.jsx(li,{}),language:"en",state:"initial",sdk:void 0},hi=w.createContext(pi),Me=()=>w.useContext(hi),ce=e=>l.jsx(pn,{...e});var Yf="_1vg0oop0",Hf="_1vg0oop2",Wf="_1vg0oop1",zf="_1vg0oop3";function Kf(){const{logo:e}=Me();return l.jsx("div",{className:zf,children:e})}function jf(){return l.jsx(ce,{t:"footer.text",variant:{size:"xs",weight:"semibold",color:"placeholder"}})}function gi({children:e,header:t=l.jsx(Kf,{}),footer:n=l.jsx(jf,{})}){return l.jsxs("article",{className:Yf,children:[t&&l.jsx("header",{className:Wf,children:t}),l.jsx("div",{children:e}),n&&l.jsx("footer",{className:Hf,children:n})]})}function _i(){return l.jsx(qn,{children:l.jsx(ai,{})})}function Jf(){return l.jsxs(l.Fragment,{children:[l.jsxs(xt,{space:"2",children:[l.jsx(Yr,{width:"75%",height:24}),l.jsx(Yr,{width:"50%",height:16})]}),l.jsx(_i,{})]})}function Xf({type:e}){return l.jsx(qn,{variant:e==="warning"?"blue":"red",shouldAnimate:!1,children:l.jsx(Gf,{})})}function hn({type:e}){return l.jsxs(l.Fragment,{children:[l.jsxs(xt,{space:"0.25",children:[l.jsx(ce,{as:"h1",variant:{size:"2xl-title",weight:"bold"},t:"error.title"}),l.jsx(ce,{as:"h2",t:"error.detail",variant:{color:"contrast",weight:"semibold"}})]}),l.jsx(Xf,{type:e})]})}var Zf="_8vopmj2",Qf="_8vopmj0";function ep(){const{language:e}=Me();return w.useMemo(()=>Ff(e),[e])}function tp(e){return`authenticating.setPassword.validation.${e.failedRules[0].name}`}function np({message:e}){return l.jsx("span",{className:Zf,children:e})}function rp(){const e=ep(),{sdk:t}=Me(),[n,r]=w.useState(""),[s,i]=w.useState(""),[a,o]=w.useState(null);w.useEffect(()=>{const u=p=>{console.log("onInvalidPassword",p),o(e(tp(p)))};return t?.subscribe("invalidPasswordSubmitted",u),()=>{t?.unsubscribe("invalidPasswordSubmitted",u)}},[e,t,o]);const d=u=>{u.preventDefault(),t&&t.publish("passwordSubmitted",n)},c=u=>{r(u.target.value)},f=u=>{i(u.target.value)};return l.jsxs(l.Fragment,{children:[l.jsxs(xt,{space:"0.25",children:[l.jsx(pn,{as:"h1",variant:{size:"2xl-title",weight:"bold"},t:"recover.password.title"}),l.jsx(pn,{variant:{color:"contrast",weight:"semibold"},as:"h2",t:"recover.password.details"})]}),l.jsxs("form",{onSubmit:d,children:[l.jsxs("div",{className:Qf,children:[l.jsx(Br,{id:"password-input",label:e("recover.password.input.password.label"),placeholder:e("recover.password.input.placeholder"),name:"password",type:"password",value:n??"",onChange:c}),l.jsx(Br,{id:"password-input-confirm",label:e("recover.password.input.confirmPassword.label"),placeholder:e("recover.password.input.placeholder"),name:"passwordConfirm",type:"password",value:s??"",onChange:f,className:ui({marginTop:"4"})}),a&&l.jsx(np,{message:a})]}),l.jsx(oi,{type:"submit",variant:"primary",testId:"sid-form-initial-submit-button",disabled:!n||n!==s,children:e("recover.password.submit")})]})]})}class sp extends Error{errors;constructor(t){super(t.length>0?t[0].message:"Unknown SlashID error"),this.errors=t}}function ip(e){return!!(typeof e=="object"&&e!==null&&"errors"in e&&Array.isArray(e.errors))}function ap(e){if(e instanceof Error)return e;if(ip(e))return new sp(e.errors);let t="[Unable to stringify the thrown value]";try{t=JSON.stringify(e)}catch{}return new Error(`This value was thrown as is, not through an Error: ${t}`)}function op({onSuccess:e,onError:t,flowType:n}){const{sdk:r}=Me();return w.useEffect(()=>{if(!r)return;async function s(){try{await r?.getUserFromURL(),e()}catch(a){const o=ap(a);ct(o),t({error:o})}}function i(){console.log("Password reset - input ready")}return n==="password-recovery"&&(console.log("Subscribed"),r.subscribe("passwordResetReady",i)),s(),()=>{n==="password-recovery"&&(console.log("Cleaned up"),r.unsubscribe("passwordResetReady",i))}},[n,t,e,r]),n==="password-recovery"?l.jsx(rp,{}):l.jsxs(l.Fragment,{children:[l.jsxs(xt,{space:"0.25",children:[l.jsx(ce,{as:"h1",variant:{size:"2xl-title",weight:"bold"},t:"initial.title"}),l.jsx(ce,{variant:{color:"contrast",weight:"semibold"},as:"h2",t:"initial.details"})]}),l.jsx(_i,{})]})}const dp=()=>l.jsx(qn,{children:l.jsx("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.8505 0.705985C20.6342 1.38283 20.7209 2.56684 20.044 3.35055L8.16908 17.1005C7.80192 17.5256 7.2635 17.7637 6.70195 17.7493C6.1404 17.7349 5.61489 17.4695 5.27002 17.0261L0.895049 11.4011C0.259296 10.5837 0.406547 9.4057 1.22394 8.76995C2.04134 8.13419 3.21935 8.28145 3.8551 9.09884L6.82592 12.9185L17.2059 0.89949C17.8828 0.115778 19.0668 0.0291434 19.8505 0.705985Z",fill:"white"})})});function cp(){return l.jsxs("article",{"data-testid":"sid-form-success-state",children:[l.jsx(ce,{as:"h1",t:"success.title",variant:{size:"2xl-title",weight:"bold"}}),l.jsx(ce,{as:"h2",t:"success.details",variant:{color:"contrast",weight:"semibold"}}),l.jsx(dp,{})]})}function up(e){if(e instanceof Error)return e;let t="[Unable to stringify the thrown value]";try{t=JSON.stringify(e)}catch{}return new Error(`This value was thrown as is, not through an Error: ${t}`)}function lp(e){return e.some(t=>t.type==="password_reset")}function fp(e){return lp(e)?"password-recovery":"catch-all"}function pp(){const[e,t]=w.useState({state:"initial"}),{sdk:n,state:r}=Me();w.useEffect(()=>{if(e.state!=="initial")return;async function a(){if(!n)return;t({state:"parsing-url"});let o=[];try{o=await n.getChallengesFromURL()}catch(c){ct(up(c))}if(!o){t({state:"no-challenges",challenges:null});return}const d=fp(o);t({state:"progress",challenges:o,flowType:d})}a()},[r,e.state,n]);const s=()=>{e.state==="progress"&&t({state:"success",challenges:e.challenges,flowType:e.flowType})},i=({error:a})=>{e.state==="progress"&&t({state:"error",challenges:e.challenges,flowType:e.flowType,error:a})};return l.jsxs(gi,{children:[(r!=="ready"||e.state==="parsing-url")&&l.jsx(Jf,{}),r==="ready"&&l.jsxs(l.Fragment,{children:[e.state==="progress"&&l.jsx(op,{onSuccess:s,onError:i,flowType:e.flowType}),e.state==="no-challenges"&&l.jsx(hn,{type:"warning"}),e.state==="success"&&l.jsx(cp,{}),e.state==="error"&&l.jsx(hn,{type:"error"})]})]})}var hp="d0vxn40";const Hr={sdkURL:{}.PUBLIC_SID_SDK_URL||"https://jump.slashid.local",baseURL:{}.PUBLIC_SID_API_URL||"https://slashid.local"};function bp(){const e=ri(),[t,n]=w.useState("initial"),r=w.useRef(void 0);w.useEffect(()=>{t==="initial"&&(Pl({dsn:"https://6435e8a20ba8b61404fb4621d2aedd4a@o4505317722619904.ingest.sentry.io/4506275681075200"}),r.current=new Ae({analyticsEnabled:!1,sdkURL:Hr.sdkURL,baseURL:Hr.baseURL}),n("ready"))},[t]);const s=w.useMemo(()=>!e||t=="initial"?pi:{logo:l.jsx(li,{}),language:Vf(),state:t,sdk:r.current},[t,e]);return l.jsx(ef,{theme:"light",children:l.jsx(Dn,{fallback:l.jsx(gi,{children:l.jsx(hn,{type:"error"})}),children:l.jsx(hi.Provider,{value:s,children:l.jsx(Pf,{text:fi[s.language],children:l.jsx("main",{className:hp,children:l.jsx(pp,{})})})})})})}export{bp as App};
|