@atlasauth/embed 0.9.0 → 0.10.0

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/dist/embed.js CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";(()=>{var Wa=Object.create;var Pt=Object.defineProperty;var Ha=Object.getOwnPropertyDescriptor;var ja=Object.getOwnPropertyNames;var Ka=Object.getPrototypeOf,Ga=Object.prototype.hasOwnProperty;var qa=(e,t,n)=>t in e?Pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Tt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Va=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ja(t))!Ga.call(e,o)&&o!==n&&Pt(e,o,{get:()=>t[o],enumerable:!(r=Ha(t,o))||r.enumerable});return e};var Ya=(e,t,n)=>(n=e!=null?Wa(Ka(e)):{},Va(t||!e||!e.__esModule?Pt(n,"default",{value:e,enumerable:!0}):n,e));var h=(e,t,n)=>qa(e,typeof t!="symbol"?t+"":t,n);var io=Tt(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.ForbiddenError=void 0;ce.evaluate=dn;ce.hasFromClaims=pi;ce.protectFromClaims=fi;function ui(e){return e.permission!==void 0||e.role!==void 0||e.anyPermission!==void 0||e.allPermissions!==void 0}function dn(e,t={}){var o,a,s,l;if(!e)return{allowed:!1,reason:"signed_out"};if(t.plan!==void 0&&e.pla!==t.plan)return{allowed:!1,reason:"missing_entitlement"};if(t.feature!==void 0&&!((o=e.fea)!=null?o:[]).includes(t.feature))return{allowed:!1,reason:"missing_entitlement"};let n=new Set((a=e.app_permissions)!=null?a:[]);if(t.appRole!==void 0&&!((s=e.app_roles)!=null?s:[]).includes(t.appRole))return{allowed:!1,reason:"missing_permission"};if(t.appPermission!==void 0&&!n.has(t.appPermission))return{allowed:!1,reason:"missing_permission"};if(t.anyAppPermission&&!t.anyAppPermission.some(i=>n.has(i)))return{allowed:!1,reason:"missing_permission"};if(t.allAppPermissions&&!t.allAppPermissions.every(i=>n.has(i)))return{allowed:!1,reason:"missing_permission"};if(!ui(t))return{allowed:!0};if(!e.org_id)return{allowed:!1,reason:"no_organization"};let r=new Set((l=e.org_permissions)!=null?l:[]);return t.role!==void 0&&e.org_role!==t.role?{allowed:!1,reason:"missing_permission"}:t.permission!==void 0&&!r.has(t.permission)?{allowed:!1,reason:"missing_permission"}:t.anyPermission&&!t.anyPermission.some(i=>r.has(i))?{allowed:!1,reason:"missing_permission"}:t.allPermissions&&!t.allPermissions.every(i=>r.has(i))?{allowed:!1,reason:"missing_permission"}:{allowed:!0}}function pi(e,t={}){return dn(e,t).allowed}var tt=class extends Error{constructor(n,r){super(n==="signed_out"?"Not signed in.":n==="no_organization"?"No active organization for this authorization check.":n==="missing_entitlement"?"Missing the required plan or feature.":"Missing the required permission or role.");h(this,"reason");h(this,"condition");this.name="ForbiddenError",this.reason=n,this.condition=r}};ce.ForbiddenError=tt;function fi(e,t={}){let n=dn(e,t);if(!n.allowed)throw new tt(n.reason,t)}});var lo=Tt(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.PERMISSION_KEY_PATTERN=K.ROLE_KEY_PATTERN=void 0;K.isRoleKey=gi;K.isPermissionKey=mi;K.ROLE_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}$/;K.PERMISSION_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}:[a-z][a-z0-9_]{1,31}$/;function gi(e){return K.ROLE_KEY_PATTERN.test(e)}function mi(e){return K.PERMISSION_KEY_PATTERN.test(e)}});var co=Tt(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.isPermissionKey=U.isRoleKey=U.PERMISSION_KEY_PATTERN=U.ROLE_KEY_PATTERN=U.ForbiddenError=U.protectFromClaims=U.hasFromClaims=U.evaluate=void 0;var nt=io();Object.defineProperty(U,"evaluate",{enumerable:!0,get:function(){return nt.evaluate}});Object.defineProperty(U,"hasFromClaims",{enumerable:!0,get:function(){return nt.hasFromClaims}});Object.defineProperty(U,"protectFromClaims",{enumerable:!0,get:function(){return nt.protectFromClaims}});Object.defineProperty(U,"ForbiddenError",{enumerable:!0,get:function(){return nt.ForbiddenError}});var rt=lo();Object.defineProperty(U,"ROLE_KEY_PATTERN",{enumerable:!0,get:function(){return rt.ROLE_KEY_PATTERN}});Object.defineProperty(U,"PERMISSION_KEY_PATTERN",{enumerable:!0,get:function(){return rt.PERMISSION_KEY_PATTERN}});Object.defineProperty(U,"isRoleKey",{enumerable:!0,get:function(){return rt.isRoleKey}});Object.defineProperty(U,"isPermissionKey",{enumerable:!0,get:function(){return rt.isPermissionKey}})});var gl=30*24*60*60*1e3;function Bn(e){if(typeof BroadcastChannel=="undefined")return null;let t=new BroadcastChannel(e);return{post:n=>t.postMessage(n),subscribe(n){let r=o=>n(o.data);return t.addEventListener("message",r),()=>t.removeEventListener("message",r)},close:()=>t.close()}}function Wn(e){if(typeof window=="undefined"||typeof window.localStorage=="undefined")return null;let t=`atlas:${e}`;return{post(n){try{window.localStorage.setItem(t,JSON.stringify({message:n,at:Date.now()})),window.localStorage.removeItem(t)}catch{}},subscribe(n){let r=o=>{if(!(o.key!==t||!o.newValue))try{n(JSON.parse(o.newValue).message)}catch{}};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)},close:()=>{}}}function $(e){var t,n;switch(e.status){case"needs_identifier":return{kind:"collect_identifier"};case"needs_first_factor":return{kind:"collect_first_factor",strategies:(t=e.supported_first_factors)!=null?t:[]};case"needs_second_factor":return{kind:"collect_second_factor"};case"needs_mfa_enrollment":return{kind:"enroll_second_factor"};case"needs_email_verification":return{kind:"collect_email_code"};case"needs_captcha":return{kind:"collect_captcha"};case"needs_oauth_callback":return{kind:"await_oauth"};case"needs_new_password":return{kind:"collect_new_password"};case"complete":return{kind:"done",sessionId:(n=e.created_session_id)!=null?n:null};case"abandoned":return{kind:"restart",reason:"abandoned"};default:return{kind:"unknown",status:e.status}}}function Hn(e){return e.status==="complete"||e.status==="abandoned"}function jn(e){if(!e||typeof e!="object")return[];let t=e.errors;return Array.isArray(t)?t.filter(n=>!!n&&typeof n.message=="string").map(n=>{let r={code:n.code,message:n.message,param:n.param},o=n.reason;typeof o=="string"&&o!==""&&(r.reason=o);let a=n.meta;return a&&typeof a=="object"&&!Array.isArray(a)&&(r.meta=a),r}):[]}function We(e){var r;let t=["email_code","email_link"].filter(o=>e.includes(o)),n=e.includes("password");return{password:n,email:t,autoSend:n?null:(r=t[0])!=null?r:null}}var Fl=Object.freeze(["form_password_incorrect","form_code_incorrect","form_code_already_used","form_code_expired","form_code_max_attempts","form_link_invalid","form_identifier_not_found","form_identifier_exists","form_password_pwned","form_password_too_short","form_password_too_long","form_password_requires_uppercase","form_password_requires_lowercase","form_password_requires_number","form_password_requires_symbol","form_password_not_allowed","form_password_contains_identifier","form_password_same_as_current","form_password_reused","password_expired","email_not_verified","sign_in_token_invalid","too_many_attempts","too_many_requests","captcha_required","captcha_failed","captcha_unavailable","email_delivery_unavailable","strategy_disabled","sign_up_restricted","waitlisted","identifier_not_allowed","disposable_email_blocked","sso_required","sign_ins_disabled","sign_ups_disabled","high_risk_blocked","sms_region_blocked"]);function Ja(e){return`error.${e}`}var Za="Something went wrong. Please try again.",Xa=/^[a-z][a-z0-9_]{0,63}$/;function Qa(e,t){let n=!0,r=e.replace(/\{(\w+)\}/g,(o,a)=>{let s=t&&Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;return typeof s=="string"&&s!==""?s:typeof s=="number"&&Number.isFinite(s)?String(s):(n=!1,o)});return n?r:null}function It(e,t){if(!e)return null;let n;if(typeof e=="function"?n=e(t):n=Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,typeof n!="string")return null;let r=n.trim();return r===""||r===t?null:n}function Kn(e,t,n){var a,s;let r=typeof e=="string"?{message:e}:e!=null?e:{},o=typeof r.reason=="string"?r.reason:"";if(o&&Xa.test(o)){let l=It(t,Ja(o)),i=l?Qa(l,r.meta):null;if(i)return i}return typeof r.message=="string"&&r.message.trim()!==""?r.message:(s=(a=It(t,"error.generic"))!=null?a:It(n,"error.generic"))!=null?s:Za}function Gn(e){if(!e||typeof e!="object")return;let t=e.locale;return typeof t=="string"&&t.trim()!==""?t:void 0}var Ot="atlas:oauth",es="atlas_popup_result",qn="atlas:oauth";function ts(e){return`${qn}:${e}`}function Vn(){let e=new Uint8Array(16),t=globalThis.crypto;if(t!=null&&t.getRandomValues)t.getRandomValues(e);else for(let r=0;r<e.length;r++)e[r]=Math.floor(Math.random()*256);let n="";for(let r of e)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function ns(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.id!="string"?!1:t.type==="atlas:oauth:result"?!!t.result&&typeof t.result=="object":t.type==="atlas:oauth:signed_in"||t.type==="atlas:oauth:ack"}function rs(e){var t;try{return(t=Bn(e))!=null?t:Wn(e)}catch{return null}}function Yn(e,t,n){let r=rs(e);if(!r)return Promise.resolve(!1);let o=Vn();return new Promise(a=>{let s=!1,l=d=>{s||(s=!0,clearTimeout(c),i(),r.close(),a(d))},i=r.subscribe(d=>{ns(d)&&d.type==="atlas:oauth:ack"&&d.id===o&&l(!0)}),c=setTimeout(()=>l(!1),n);try{r.post({...t,id:o})}catch{l(!1)}})}function os(e){if(!e||e.length<2)return null;let t=new URLSearchParams(e.replace(/^#/,"")).get(es);if(!t)return null;try{let n=t.replace(/-/g,"+").replace(/_/g,"/"),r=atob(n+"=".repeat((4-n.length%4)%4)),o=Uint8Array.from(r,l=>l.charCodeAt(0)),a=JSON.parse(new TextDecoder().decode(o));if(!a||typeof a!="object")return null;let s=a;return s.v!==1||typeof s.n!="string"||!s.n||typeof s.type!="string"||!s.type.startsWith("atlas:oauth:")?null:{nonce:s.n,payload:s}}catch{return null}}async function Jn(e={}){var o,a;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t)return null;let n=os(t.location.hash);if(!n)return null;try{t.history.replaceState(t.history.state,"",t.location.href.split("#")[0])}catch{}try{t.name=Ot}catch{}let r=await Yn(ts(n.nonce),{type:"atlas:oauth:result",result:n.payload},(a=e.ackTimeoutMs)!=null?a:1500);return r&&Xn(t),{payload:n.payload,delivered:r}}async function Zn(e={}){var o,a;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t||t.name!==Ot)return!1;let n=await Yn(qn,{type:"atlas:oauth:signed_in"},(a=e.ackTimeoutMs)!=null?a:1500),r=!1;try{r=!!t.opener&&!t.opener.closed}catch{r=!1}return!n&&!r?!1:(Xn(t),!0)}function Xn(e){try{e.close()}catch{}}var as=["__atlas_attempt","__atlas_ticket","__atlas_status"];function Qn(e){var r;if(!e||typeof e!="object")return null;let t=e,n=o=>typeof o=="string"?o:void 0;switch(t.type){case"atlas:oauth:complete":return{ticket:n(t.ticket),attemptId:n(t.attemptId)};case"atlas:oauth:error":return{error:(r=n(t.code))!=null?r:"error",continuationUrl:n(t.continuationUrl)};case"atlas:oauth:continue":return{status:n(t.status),attemptId:n(t.attemptId),continuationUrl:n(t.continuationUrl)};default:return null}}var Bl=5*6e4;function er(e){let t=new URLSearchParams(e),n=t.get("__atlas_attempt");if(!n)return null;let r=t.get("__atlas_ticket"),o=t.get("__atlas_status");return!r&&!o?null:{attemptId:n,...r?{ticket:r}:{},...o?{status:o}:{}}}function He(e){let t=new URL(e);for(let n of as)t.searchParams.delete(n);return t.toString()}var tr="0.16.0";var rr={name:"@atlasauth/js",version:tr},or="x-atlas-sdk",ss="atlas-sdk-advisory";function ar(e){return`${e.name}/${e.version}`}function is(e){return typeof e!="string"||!e.trim()?[]:e.split(",").map(t=>{let[n,...r]=t.split(";").map(a=>a.trim()),o=a=>{var s,l;return(l=(s=r.find(i=>i.startsWith(`${a}=`)))==null?void 0:s.slice(a.length+1))!=null?l:null};return{action:n!=null?n:"",min:o("min"),reason:o("reason")}}).filter(t=>t.action!=="")}var nr=new Set;function sr(e,t,n=ls){var a,s,l,i,c;let r=null;try{r=(l=(s=(a=e==null?void 0:e.headers)==null?void 0:a.get)==null?void 0:s.call(a,ss))!=null?l:null}catch{return[]}let o=[];for(let d of is(r)){let u=`${t.name}|${(i=d.reason)!=null?i:""}|${(c=d.min)!=null?c:""}`;nr.has(u)||(nr.add(u),o.push(d),n(`[Atlas] ${t.name} ${t.version} has a known problem${d.reason?` (${d.reason})`:""}${d.min?` fixed in ${d.min}. Upgrade ${t.name} to ${d.min} or later`:". Upgrade it"} \u2014 with a 0.x version a caret range does not move past your lockfile on its own. Details: https://atlasauth.net/v1/sdk_advisories/${encodeURIComponent(t.name)}`))}return o}function ls(e){typeof console!="undefined"&&console.warn(e)}var fe="__atlas_dev_session:",ir="/v1/client/tickets/exchange",lr="/v1/client",cr=/^\/v1\/client\/sessions\/[^/]+\/tokens$/,cs=/^\/v1\/client\/sessions\/[^/]+\/revoke$/;function ie(){try{let e=globalThis.localStorage;return e&&typeof e.getItem=="function"?e:null}catch{return null}}function fr(e){return e.startsWith("pk_test_")&&ie()!==null}function gr(e){var t,n;try{return(n=(t=ie())==null?void 0:t.getItem(fe+e))!=null?n:null}catch{return null}}var Dt=":sid";function dr(e,t,n){var r,o;if(!(typeof t!="string"||!t))try{(r=ie())==null||r.setItem(fe+e,t),typeof n=="string"&&n&&((o=ie())==null||o.setItem(fe+e+Dt,n))}catch{}}function ds(e){var t,n;try{return(n=(t=ie())==null?void 0:t.getItem(fe+e+Dt))!=null?n:null}catch{return null}}function je(e){var t,n;try{(t=ie())==null||t.removeItem(fe+e),(n=ie())==null||n.removeItem(fe+e+Dt)}catch{}}function us(e){try{let t=typeof e=="string"?e:e instanceof URL?e.href:e.url;return new URL(t,"https://invalid.example").pathname}catch{return null}}function ur(e){let t=/^\/v1\/client\/sessions\/([^/]+)\//.exec(e);return t?decodeURIComponent(t[1]):null}async function Lt(e){try{let t=await e.clone().json();return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}var pr=Symbol.for("atlas.devBrowser");function Ft(e,t){if(!e.startsWith("pk_test_")||t[pr])return t;let n=async(r,o)=>{var u,f;if(!fr(e))return t(r,o);let a=us(r),s=((u=o==null?void 0:o.method)!=null?u:"GET").toUpperCase(),l=o,i=!1;if(a===ir&&s==="POST"&&typeof(o==null?void 0:o.body)=="string")try{let p=JSON.parse(o.body);p&&typeof p=="object"&&!Array.isArray(p)&&(l={...o,body:JSON.stringify({...p,return_refresh_token:!0})})}catch{}let c=gr(e);if(c&&(a===lr&&s==="GET"||a&&cr.test(a)&&s==="POST")){let p=new Headers(l==null?void 0:l.headers);p.has("x-refresh-token")||p.set("x-refresh-token",c),l={...l,headers:p},i=!0}let d=await t(r,l);if(!a)return d;if(a===ir&&d.ok){let p=await Lt(d);dr(e,p==null?void 0:p.refresh_token,p==null?void 0:p.id)}else if(a&&cr.test(a))d.ok?dr(e,(f=await Lt(d))==null?void 0:f.refresh_token,ur(a)):i&&d.status===401&&je(e);else if(a===lr&&i&&d.ok){let p=await Lt(d);p&&p.session===null&&je(e)}else if(a&&cs.test(a)&&(d.ok||d.status===404)){let p=ds(e);(!p||p===ur(a))&&je(e)}return d};return n[pr]=!0,n}function Mt(e){let t=e==null?void 0:e.mfa;return{totp:t?t.totp:!0,sms:t?t.sms:!1,emailCode:(e==null?void 0:e.emailSecondFactor)===!0,totpCodes:t?t.totpCodes:2}}async function ps(e,t,n){let r=await e.post(`/v1/client/sign_ins/${encodeURIComponent(t)}/prepare_mfa_enrollment`,n.strategy==="phone_code"?{strategy:"phone_code",phone:n.phone}:{strategy:"totp"}),o=r.data;if(!r.ok||!o||typeof o.factor_id!="string")return{enrollment:null,errors:r.errors,status:r.status};let a=l=>typeof l=="string"&&l?l:void 0,s={strategy:n.strategy,factorId:o.factor_id};if(n.strategy==="totp"){a(o.secret)&&(s.secret=a(o.secret)),a(o.uri)&&(s.uri=a(o.uri));let l=a(o.qr_code);l&&/^data:image\//.test(l)&&(s.qrCode=l)}else a(o.phone)&&(s.phone=a(o.phone));return{enrollment:s,errors:[],status:r.status}}function mr(e){return e.replace(/\s+/g,"").replace(/(.{4})(?=.)/g,"$1 ")}function fs(e,t){return t===409?!0:e.some(n=>n.code==="STRATEGY_DISABLED"||n.param==="strategy")}function hr(e,t){let n=()=>typeof t=="function"?t():t,r=p=>{let m=[];return p.totp&&m.push("totp"),p.sms&&m.push("phone_code"),m.length?m:["totp"]},o=()=>{let p=n();return{options:r(p),method:null,enrollment:null,busy:!1,errors:[],totpCodes:p.totpCodes}},a=o(),s=null,l="",i=0,c=new Set,d=p=>{a={...a,...p};for(let m of c)m(a)},u=async p=>{let m=s;if(!m)return;let b=i;d({busy:!0,errors:[]});let y=await ps(e,m,p);if(b===i){if(y.enrollment){d({busy:!1,enrollment:y.enrollment,errors:[]});return}if(fs(y.errors,y.status)&&a.options.length>1){let E=a.options.filter(C=>C!==p.strategy);d({busy:!1,options:E,method:null,enrollment:null,errors:y.errors}),E.length===1&&await f.choose(E[0]);return}d({busy:!1,errors:y.errors})}},f={get state(){return a},subscribe(p){return c.add(p),()=>c.delete(p)},start(p){p!==s&&(i+=1,s=p,l="",a=o(),d({}),a.options.length===1&&f.choose(a.options[0]))},async choose(p){a.options.includes(p)&&(d({method:p,enrollment:null,errors:[]}),p==="totp"&&await u({strategy:"totp"}))},async sendPhone(p){let m=p.trim();if(!m){d({errors:[{code:"FORM_PARAM_MISSING",message:"A phone number is required.",param:"phone"}]});return}l=m,await u({strategy:"phone_code",phone:m})},async resend(){a.method==="phone_code"&&l&&await u({strategy:"phone_code",phone:l})},async submit(p){var y,E,C,k;if(a.method==="phone_code"&&!a.enrollment)return await f.sendPhone((y=p.phone)!=null?y:""),null;let m=a.enrollment;return m?m.strategy==="phone_code"?{factorId:m.factorId,enrollStrategy:"phone_code",code:(E=p.code)!=null?E:""}:{factorId:m.factorId,code:(C=p.code)!=null?C:"",secondCode:(k=p.secondCode)!=null?k:""}:null},reset(){i+=1,s=null,l="",a=o(),d({})}};return f}function br(e){return e.method===null?null:e.method==="phone_code"&&!e.enrollment?"mfa.sendCode":e.enrollment?"signIn.submit":null}async function yr(e,t,n){var o,a;let r=await e.post(`/v1/client/sign_ins/${encodeURIComponent(t)}/prepare_second_factor`,{strategy:n});if(!r.ok){let s=r.errors[0],l=new Error((o=s==null?void 0:s.message)!=null?o:"Could not send the code.");throw s!=null&&s.code&&(l.code=s.code),l}return{sentTo:typeof((a=r.data)==null?void 0:a.sent_to)=="string"?r.data.sent_to:""}}function kr(e){if(!Array.isArray(e))return null;let t=e.filter(n=>typeof n=="string"&&n.length>0);return t.length?t:null}function Ce(e){var t;return((t=e.attempt)==null?void 0:t.status)!=="complete"?null:e.recoveryCodes&&e.recoveryCodes.length?e.recoveryCodes:null}function vr(e){return{...e,recoveryCodes:null}}function gs(e){return`${e.join(`
1
+ "use strict";(()=>{var Vs=Object.create;var Pt=Object.defineProperty;var Gs=Object.getOwnPropertyDescriptor;var Ys=Object.getOwnPropertyNames;var Js=Object.getPrototypeOf,Zs=Object.prototype.hasOwnProperty;var Xs=(e,t,n)=>t in e?Pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Tt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Qs=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ys(t))!Zs.call(e,o)&&o!==n&&Pt(e,o,{get:()=>t[o],enumerable:!(r=Gs(t,o))||r.enumerable});return e};var ea=(e,t,n)=>(n=e!=null?Vs(Js(e)):{},Qs(t||!e||!e.__esModule?Pt(n,"default",{value:e,enumerable:!0}):n,e));var h=(e,t,n)=>Xs(e,typeof t!="symbol"?t+"":t,n);var po=Tt(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.ForbiddenError=void 0;ce.evaluate=dn;ce.hasFromClaims=_i;ce.protectFromClaims=xi;function vi(e){return e.permission!==void 0||e.role!==void 0||e.anyPermission!==void 0||e.allPermissions!==void 0}function dn(e,t={}){var o,s,a,l;if(!e)return{allowed:!1,reason:"signed_out"};if(t.plan!==void 0&&e.pla!==t.plan)return{allowed:!1,reason:"missing_entitlement"};if(t.feature!==void 0&&!((o=e.fea)!=null?o:[]).includes(t.feature))return{allowed:!1,reason:"missing_entitlement"};let n=new Set((s=e.app_permissions)!=null?s:[]);if(t.appRole!==void 0&&!((a=e.app_roles)!=null?a:[]).includes(t.appRole))return{allowed:!1,reason:"missing_permission"};if(t.appPermission!==void 0&&!n.has(t.appPermission))return{allowed:!1,reason:"missing_permission"};if(t.anyAppPermission&&!t.anyAppPermission.some(i=>n.has(i)))return{allowed:!1,reason:"missing_permission"};if(t.allAppPermissions&&!t.allAppPermissions.every(i=>n.has(i)))return{allowed:!1,reason:"missing_permission"};if(!vi(t))return{allowed:!0};if(!e.org_id)return{allowed:!1,reason:"no_organization"};let r=new Set((l=e.org_permissions)!=null?l:[]);return t.role!==void 0&&e.org_role!==t.role?{allowed:!1,reason:"missing_permission"}:t.permission!==void 0&&!r.has(t.permission)?{allowed:!1,reason:"missing_permission"}:t.anyPermission&&!t.anyPermission.some(i=>r.has(i))?{allowed:!1,reason:"missing_permission"}:t.allPermissions&&!t.allPermissions.every(i=>r.has(i))?{allowed:!1,reason:"missing_permission"}:{allowed:!0}}function _i(e,t={}){return dn(e,t).allowed}var tt=class extends Error{constructor(n,r){super(n==="signed_out"?"Not signed in.":n==="no_organization"?"No active organization for this authorization check.":n==="missing_entitlement"?"Missing the required plan or feature.":"Missing the required permission or role.");h(this,"reason");h(this,"condition");this.name="ForbiddenError",this.reason=n,this.condition=r}};ce.ForbiddenError=tt;function xi(e,t={}){let n=dn(e,t);if(!n.allowed)throw new tt(n.reason,t)}});var fo=Tt(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.PERMISSION_KEY_PATTERN=K.ROLE_KEY_PATTERN=void 0;K.isRoleKey=wi;K.isPermissionKey=Si;K.ROLE_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}$/;K.PERMISSION_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}:[a-z][a-z0-9_]{1,31}$/;function wi(e){return K.ROLE_KEY_PATTERN.test(e)}function Si(e){return K.PERMISSION_KEY_PATTERN.test(e)}});var go=Tt(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.isPermissionKey=U.isRoleKey=U.PERMISSION_KEY_PATTERN=U.ROLE_KEY_PATTERN=U.ForbiddenError=U.protectFromClaims=U.hasFromClaims=U.evaluate=void 0;var nt=po();Object.defineProperty(U,"evaluate",{enumerable:!0,get:function(){return nt.evaluate}});Object.defineProperty(U,"hasFromClaims",{enumerable:!0,get:function(){return nt.hasFromClaims}});Object.defineProperty(U,"protectFromClaims",{enumerable:!0,get:function(){return nt.protectFromClaims}});Object.defineProperty(U,"ForbiddenError",{enumerable:!0,get:function(){return nt.ForbiddenError}});var rt=fo();Object.defineProperty(U,"ROLE_KEY_PATTERN",{enumerable:!0,get:function(){return rt.ROLE_KEY_PATTERN}});Object.defineProperty(U,"PERMISSION_KEY_PATTERN",{enumerable:!0,get:function(){return rt.PERMISSION_KEY_PATTERN}});Object.defineProperty(U,"isRoleKey",{enumerable:!0,get:function(){return rt.isRoleKey}});Object.defineProperty(U,"isPermissionKey",{enumerable:!0,get:function(){return rt.isPermissionKey}})});var El=30*24*60*60*1e3;function Bn(e){if(typeof BroadcastChannel=="undefined")return null;let t=new BroadcastChannel(e);return{post:n=>t.postMessage(n),subscribe(n){let r=o=>n(o.data);return t.addEventListener("message",r),()=>t.removeEventListener("message",r)},close:()=>t.close()}}function Wn(e){if(typeof window=="undefined"||typeof window.localStorage=="undefined")return null;let t=`atlas:${e}`;return{post(n){try{window.localStorage.setItem(t,JSON.stringify({message:n,at:Date.now()})),window.localStorage.removeItem(t)}catch{}},subscribe(n){let r=o=>{if(!(o.key!==t||!o.newValue))try{n(JSON.parse(o.newValue).message)}catch{}};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)},close:()=>{}}}function z(e){var t,n;switch(e.status){case"needs_identifier":return{kind:"collect_identifier"};case"needs_first_factor":return{kind:"collect_first_factor",strategies:(t=e.supported_first_factors)!=null?t:[]};case"needs_second_factor":return{kind:"collect_second_factor"};case"needs_mfa_enrollment":return{kind:"enroll_second_factor"};case"needs_email_verification":return{kind:"collect_email_code"};case"needs_captcha":return{kind:"collect_captcha"};case"needs_oauth_callback":return{kind:"await_oauth"};case"needs_new_password":return{kind:"collect_new_password"};case"complete":return{kind:"done",sessionId:(n=e.created_session_id)!=null?n:null};case"abandoned":return{kind:"restart",reason:"abandoned"};default:return{kind:"unknown",status:e.status}}}function Hn(e){return e.status==="complete"||e.status==="abandoned"}function jn(e){if(!e||typeof e!="object")return[];let t=e.errors;return Array.isArray(t)?t.filter(n=>!!n&&typeof n.message=="string").map(n=>{let r={code:n.code,message:n.message,param:n.param},o=n.reason;typeof o=="string"&&o!==""&&(r.reason=o);let s=n.meta;return s&&typeof s=="object"&&!Array.isArray(s)&&(r.meta=s),r}):[]}function He(e){var r;let t=["email_code","email_link"].filter(o=>e.includes(o)),n=e.includes("password");return{password:n,email:t,autoSend:n?null:(r=t[0])!=null?r:null}}var Yl=Object.freeze(["form_password_incorrect","form_code_incorrect","form_code_already_used","form_code_expired","form_code_max_attempts","form_link_invalid","form_identifier_not_found","form_identifier_exists","form_password_pwned","form_password_too_short","form_password_too_long","form_password_requires_uppercase","form_password_requires_lowercase","form_password_requires_number","form_password_requires_symbol","form_password_not_allowed","form_password_contains_identifier","form_password_same_as_current","form_password_reused","password_expired","email_not_verified","sign_in_token_invalid","too_many_attempts","too_many_requests","captcha_required","captcha_failed","captcha_unavailable","email_delivery_unavailable","strategy_disabled","sign_up_restricted","waitlisted","identifier_not_allowed","disposable_email_blocked","sso_required","sign_ins_disabled","sign_ups_disabled","high_risk_blocked","sms_region_blocked"]);function ta(e){return`error.${e}`}var na="Something went wrong. Please try again.",ra=/^[a-z][a-z0-9_]{0,63}$/;function oa(e,t){let n=!0,r=e.replace(/\{(\w+)\}/g,(o,s)=>{let a=t&&Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;return typeof a=="string"&&a!==""?a:typeof a=="number"&&Number.isFinite(a)?String(a):(n=!1,o)});return n?r:null}function It(e,t){if(!e)return null;let n;if(typeof e=="function"?n=e(t):n=Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,typeof n!="string")return null;let r=n.trim();return r===""||r===t?null:n}function Kn(e,t,n){var s,a;let r=typeof e=="string"?{message:e}:e!=null?e:{},o=typeof r.reason=="string"?r.reason:"";if(o&&ra.test(o)){let l=It(t,ta(o)),i=l?oa(l,r.meta):null;if(i)return i}return typeof r.message=="string"&&r.message.trim()!==""?r.message:(a=(s=It(t,"error.generic"))!=null?s:It(n,"error.generic"))!=null?a:na}function qn(e){if(!e||typeof e!="object")return;let t=e.locale;return typeof t=="string"&&t.trim()!==""?t:void 0}var Ot="atlas:oauth",sa="atlas_popup_result",Vn="atlas:oauth";function aa(e){return`${Vn}:${e}`}function Gn(){let e=new Uint8Array(16),t=globalThis.crypto;if(t!=null&&t.getRandomValues)t.getRandomValues(e);else for(let r=0;r<e.length;r++)e[r]=Math.floor(Math.random()*256);let n="";for(let r of e)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function ia(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.id!="string"?!1:t.type==="atlas:oauth:result"?!!t.result&&typeof t.result=="object":t.type==="atlas:oauth:signed_in"||t.type==="atlas:oauth:ack"}function la(e){var t;try{return(t=Bn(e))!=null?t:Wn(e)}catch{return null}}function Yn(e,t,n){let r=la(e);if(!r)return Promise.resolve(!1);let o=Gn();return new Promise(s=>{let a=!1,l=d=>{a||(a=!0,clearTimeout(c),i(),r.close(),s(d))},i=r.subscribe(d=>{ia(d)&&d.type==="atlas:oauth:ack"&&d.id===o&&l(!0)}),c=setTimeout(()=>l(!1),n);try{r.post({...t,id:o})}catch{l(!1)}})}function ca(e){if(!e||e.length<2)return null;let t=new URLSearchParams(e.replace(/^#/,"")).get(sa);if(!t)return null;try{let n=t.replace(/-/g,"+").replace(/_/g,"/"),r=atob(n+"=".repeat((4-n.length%4)%4)),o=Uint8Array.from(r,l=>l.charCodeAt(0)),s=JSON.parse(new TextDecoder().decode(o));if(!s||typeof s!="object")return null;let a=s;return a.v!==1||typeof a.n!="string"||!a.n||typeof a.type!="string"||!a.type.startsWith("atlas:oauth:")?null:{nonce:a.n,payload:a}}catch{return null}}async function Jn(e={}){var o,s;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t)return null;let n=ca(t.location.hash);if(!n)return null;try{t.history.replaceState(t.history.state,"",t.location.href.split("#")[0])}catch{}try{t.name=Ot}catch{}let r=await Yn(aa(n.nonce),{type:"atlas:oauth:result",result:n.payload},(s=e.ackTimeoutMs)!=null?s:1500);return r&&Xn(t),{payload:n.payload,delivered:r}}async function Zn(e={}){var o,s;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t||t.name!==Ot)return!1;let n=await Yn(Vn,{type:"atlas:oauth:signed_in"},(s=e.ackTimeoutMs)!=null?s:1500),r=!1;try{r=!!t.opener&&!t.opener.closed}catch{r=!1}return!n&&!r?!1:(Xn(t),!0)}function Xn(e){try{e.close()}catch{}}var da=["__atlas_attempt","__atlas_ticket","__atlas_status"];function Qn(e){var r;if(!e||typeof e!="object")return null;let t=e,n=o=>typeof o=="string"?o:void 0;switch(t.type){case"atlas:oauth:complete":return{ticket:n(t.ticket),attemptId:n(t.attemptId)};case"atlas:oauth:error":return{error:(r=n(t.code))!=null?r:"error",continuationUrl:n(t.continuationUrl)};case"atlas:oauth:continue":return{status:n(t.status),attemptId:n(t.attemptId),continuationUrl:n(t.continuationUrl)};default:return null}}var tc=5*6e4;function er(e){let t=new URLSearchParams(e),n=t.get("__atlas_attempt");if(!n)return null;let r=t.get("__atlas_ticket"),o=t.get("__atlas_status");return!r&&!o?null:{attemptId:n,...r?{ticket:r}:{},...o?{status:o}:{}}}function je(e){let t=new URL(e);for(let n of da)t.searchParams.delete(n);return t.toString()}var tr="0.17.0";var rr={name:"@atlasauth/js",version:tr},or="x-atlas-sdk",ua="atlas-sdk-advisory";function sr(e){return`${e.name}/${e.version}`}function pa(e){return typeof e!="string"||!e.trim()?[]:e.split(",").map(t=>{let[n,...r]=t.split(";").map(s=>s.trim()),o=s=>{var a,l;return(l=(a=r.find(i=>i.startsWith(`${s}=`)))==null?void 0:a.slice(s.length+1))!=null?l:null};return{action:n!=null?n:"",min:o("min"),reason:o("reason")}}).filter(t=>t.action!=="")}var nr=new Set;function ar(e,t,n=fa){var s,a,l,i,c;let r=null;try{r=(l=(a=(s=e==null?void 0:e.headers)==null?void 0:s.get)==null?void 0:a.call(s,ua))!=null?l:null}catch{return[]}let o=[];for(let d of pa(r)){let u=`${t.name}|${(i=d.reason)!=null?i:""}|${(c=d.min)!=null?c:""}`;nr.has(u)||(nr.add(u),o.push(d),n(`[Atlas] ${t.name} ${t.version} has a known problem${d.reason?` (${d.reason})`:""}${d.min?` fixed in ${d.min}. Upgrade ${t.name} to ${d.min} or later`:". Upgrade it"} \u2014 with a 0.x version a caret range does not move past your lockfile on its own. Details: https://atlasauth.net/v1/sdk_advisories/${encodeURIComponent(t.name)}`))}return o}function fa(e){typeof console!="undefined"&&console.warn(e)}var fe="__atlas_dev_session:",ir="/v1/client/tickets/exchange",lr="/v1/client",cr=/^\/v1\/client\/sessions\/[^/]+\/tokens$/,ga=/^\/v1\/client\/sessions\/[^/]+\/revoke$/;function ie(){try{let e=globalThis.localStorage;return e&&typeof e.getItem=="function"?e:null}catch{return null}}function fr(e){return e.startsWith("pk_test_")&&ie()!==null}function gr(e){var t,n;try{return(n=(t=ie())==null?void 0:t.getItem(fe+e))!=null?n:null}catch{return null}}var Dt=":sid";function dr(e,t,n){var r,o;if(!(typeof t!="string"||!t))try{(r=ie())==null||r.setItem(fe+e,t),typeof n=="string"&&n&&((o=ie())==null||o.setItem(fe+e+Dt,n))}catch{}}function ma(e){var t,n;try{return(n=(t=ie())==null?void 0:t.getItem(fe+e+Dt))!=null?n:null}catch{return null}}function Ke(e){var t,n;try{(t=ie())==null||t.removeItem(fe+e),(n=ie())==null||n.removeItem(fe+e+Dt)}catch{}}function ha(e){try{let t=typeof e=="string"?e:e instanceof URL?e.href:e.url;return new URL(t,"https://invalid.example").pathname}catch{return null}}function ur(e){let t=/^\/v1\/client\/sessions\/([^/]+)\//.exec(e);return t?decodeURIComponent(t[1]):null}async function Lt(e){try{let t=await e.clone().json();return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}var pr=Symbol.for("atlas.devBrowser");function Ft(e,t){if(!e.startsWith("pk_test_")||t[pr])return t;let n=async(r,o)=>{var u,f;if(!fr(e))return t(r,o);let s=ha(r),a=((u=o==null?void 0:o.method)!=null?u:"GET").toUpperCase(),l=o,i=!1;if(s===ir&&a==="POST"&&typeof(o==null?void 0:o.body)=="string")try{let p=JSON.parse(o.body);p&&typeof p=="object"&&!Array.isArray(p)&&(l={...o,body:JSON.stringify({...p,return_refresh_token:!0})})}catch{}let c=gr(e);if(c&&(s===lr&&a==="GET"||s&&cr.test(s)&&a==="POST")){let p=new Headers(l==null?void 0:l.headers);p.has("x-refresh-token")||p.set("x-refresh-token",c),l={...l,headers:p},i=!0}let d=await t(r,l);if(!s)return d;if(s===ir&&d.ok){let p=await Lt(d);dr(e,p==null?void 0:p.refresh_token,p==null?void 0:p.id)}else if(s&&cr.test(s))d.ok?dr(e,(f=await Lt(d))==null?void 0:f.refresh_token,ur(s)):i&&d.status===401&&Ke(e);else if(s===lr&&i&&d.ok){let p=await Lt(d);p&&p.session===null&&Ke(e)}else if(s&&ga.test(s)&&(d.ok||d.status===404)){let p=ma(e);(!p||p===ur(s))&&Ke(e)}return d};return n[pr]=!0,n}function Mt(e){let t=e==null?void 0:e.mfa;return{totp:t?t.totp:!0,sms:t?t.sms:!1,emailCode:(e==null?void 0:e.emailSecondFactor)===!0,totpCodes:t?t.totpCodes:2}}async function ba(e,t,n){let r=await e.post(`/v1/client/sign_ins/${encodeURIComponent(t)}/prepare_mfa_enrollment`,n.strategy==="phone_code"?{strategy:"phone_code",phone:n.phone}:{strategy:"totp"}),o=r.data;if(!r.ok||!o||typeof o.factor_id!="string")return{enrollment:null,errors:r.errors,status:r.status};let s=l=>typeof l=="string"&&l?l:void 0,a={strategy:n.strategy,factorId:o.factor_id};if(n.strategy==="totp"){s(o.secret)&&(a.secret=s(o.secret)),s(o.uri)&&(a.uri=s(o.uri));let l=s(o.qr_code);l&&/^data:image\//.test(l)&&(a.qrCode=l)}else s(o.phone)&&(a.phone=s(o.phone));return{enrollment:a,errors:[],status:r.status}}function mr(e){return e.replace(/\s+/g,"").replace(/(.{4})(?=.)/g,"$1 ")}function ya(e,t){return t===409?!0:e.some(n=>n.code==="STRATEGY_DISABLED"||n.param==="strategy")}function hr(e,t){let n=()=>typeof t=="function"?t():t,r=p=>{let m=[];return p.totp&&m.push("totp"),p.sms&&m.push("phone_code"),m.length?m:["totp"]},o=()=>{let p=n();return{options:r(p),method:null,enrollment:null,busy:!1,errors:[],totpCodes:p.totpCodes}},s=o(),a=null,l="",i=0,c=new Set,d=p=>{s={...s,...p};for(let m of c)m(s)},u=async p=>{let m=a;if(!m)return;let b=i;d({busy:!0,errors:[]});let y=await ba(e,m,p);if(b===i){if(y.enrollment){d({busy:!1,enrollment:y.enrollment,errors:[]});return}if(ya(y.errors,y.status)&&s.options.length>1){let A=s.options.filter(E=>E!==p.strategy);d({busy:!1,options:A,method:null,enrollment:null,errors:y.errors}),A.length===1&&await f.choose(A[0]);return}d({busy:!1,errors:y.errors})}},f={get state(){return s},subscribe(p){return c.add(p),()=>c.delete(p)},start(p){p!==a&&(i+=1,a=p,l="",s=o(),d({}),s.options.length===1&&f.choose(s.options[0]))},async choose(p){s.options.includes(p)&&(d({method:p,enrollment:null,errors:[]}),p==="totp"&&await u({strategy:"totp"}))},async sendPhone(p){let m=p.trim();if(!m){d({errors:[{code:"FORM_PARAM_MISSING",message:"A phone number is required.",param:"phone"}]});return}l=m,await u({strategy:"phone_code",phone:m})},async resend(){s.method==="phone_code"&&l&&await u({strategy:"phone_code",phone:l})},async submit(p){var y,A,E,v;if(s.method==="phone_code"&&!s.enrollment)return await f.sendPhone((y=p.phone)!=null?y:""),null;let m=s.enrollment;return m?m.strategy==="phone_code"?{factorId:m.factorId,enrollStrategy:"phone_code",code:(A=p.code)!=null?A:""}:{factorId:m.factorId,code:(E=p.code)!=null?E:"",secondCode:(v=p.secondCode)!=null?v:""}:null},reset(){i+=1,a=null,l="",s=o(),d({})}};return f}function br(e){return e.method===null?null:e.method==="phone_code"&&!e.enrollment?"mfa.sendCode":e.enrollment?"signIn.submit":null}async function yr(e,t,n){var o,s;let r=await e.post(`/v1/client/sign_ins/${encodeURIComponent(t)}/prepare_second_factor`,{strategy:n});if(!r.ok){let a=r.errors[0],l=new Error((o=a==null?void 0:a.message)!=null?o:"Could not send the code.");throw a!=null&&a.code&&(l.code=a.code),l}return{sentTo:typeof((s=r.data)==null?void 0:s.sent_to)=="string"?r.data.sent_to:""}}function kr(e){if(!Array.isArray(e))return null;let t=e.filter(n=>typeof n=="string"&&n.length>0);return t.length?t:null}function Ce(e){var t;return((t=e.attempt)==null?void 0:t.status)!=="complete"?null:e.recoveryCodes&&e.recoveryCodes.length?e.recoveryCodes:null}function vr(e){return{...e,recoveryCodes:null}}function ka(e){return`${e.join(`
2
2
  `)}
3
3
  `}async function _r(e){var n;let t=(n=globalThis.navigator)==null?void 0:n.clipboard;if(!(t!=null&&t.writeText))return!1;try{return await t.writeText(e.join(`
4
- `)),!0}catch{return!1}}function Ut(){return typeof document!="undefined"&&typeof Blob!="undefined"&&typeof URL!="undefined"&&typeof URL.createObjectURL=="function"}function xr(e,t="recovery-codes.txt"){var r;if(!Ut())return!1;let n=URL.createObjectURL(new Blob([gs(e)],{type:"text/plain;charset=utf-8"}));try{let o=document.createElement("a");return o.href=n,o.download=t,o.rel="noopener",o.style.display="none",((r=document.body)!=null?r:document.documentElement).appendChild(o),o.click(),o.remove(),!0}catch{return!1}finally{setTimeout(()=>URL.revokeObjectURL(n),0)}}var ms=/^[A-Za-z0-9_-]{3,64}$/,le=e=>!!e&&typeof e=="object"&&!Array.isArray(e),zt=e=>typeof e=="string"&&ms.test(e.trim())?e.trim():null,$t=["referally","rewardful","tolt","promotekit","firstpromoter","partnerstack","dub"],Er=["cookiemunch","onetrust","cookiebot","didomi","usercentrics","osano","cookieyes","complianz","klaro","tcf","consent_mode"];function v(e,t){try{return e!=null&&(typeof e=="object"||typeof e=="function")?e[t]:void 0}catch{return}}function V(e,t,...n){try{return typeof e=="function"?e.apply(t,n):void 0}catch{return}}function Ee(e,t){if(!e)return null;for(let n of e.split(";")){let r=n.trim();if(r.startsWith(`${t}=`)){let o=r.slice(t.length+1);try{return decodeURIComponent(o)}catch{return o}}}return null}function Ar(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return new Date(e<1e12?e*1e3:e).toISOString();if(typeof e=="string"&&e&&e.length<=40){if(/^\d{9,13}$/.test(e))return Ar(Number(e));let t=Date.parse(e);if(Number.isFinite(t))return new Date(t).toISOString()}}function ee(e,t,n,r,o){let a={source:e,code:zt(t),clickId:zt(n),anonId:zt(r)},s=Ar(o);return s&&(a.capturedAt=s),a.code||a.clickId||a.anonId?a:null}var hs={referally:({win:e})=>{var r,o;let t=v(e,"aff"),n=V(v(t,"getReferral"),t);return le(n)?ee("referally",n.code,(r=n.clickId)!=null?r:n.click_id,(o=n.anonId)!=null?o:n.anon_id,n.ts):null},rewardful:({win:e})=>{let t=v(e,"Rewardful");return ee("rewardful",v(v(t,"affiliate"),"token"),v(t,"referral"),null)},tolt:({win:e})=>ee("tolt",null,v(e,"tolt_referral"),null),promotekit:({win:e})=>ee("promotekit",null,v(e,"promotekit_referral"),null),firstpromoter:({cookies:e})=>ee("firstpromoter",Ee(e,"_fprom_ref"),Ee(e,"_fprom_tid"),null),partnerstack:({cookies:e})=>ee("partnerstack",Ee(e,"ps_partner_key"),Ee(e,"ps_xid"),null),dub:({cookies:e})=>ee("dub",null,Ee(e,"dub_id"),null)};function Bt(e){var n,r,o;if(typeof e!="function")return null;let t;try{t=e()}catch{return null}return le(t)?ee("custom",t.code,(n=t.clickId)!=null?n:t.click_id,(r=t.anonId)!=null?r:t.anon_id,(o=t.capturedAt)!=null?o:t.ts):null}function Ae(e,t){for(let n of t){let r=hs[n];if(!r)continue;let o=null;try{o=r(e)}catch{o=null}if(o)return o}return null}var bs={necessary:"necessary",essential:"necessary",strictly_necessary:"necessary",preferences:"preferences",functional:"preferences",functionality:"preferences",personalization:"preferences",statistics:"statistics",analytics:"statistics",performance:"statistics",marketing:"marketing",advertising:"marketing",advertisement:"marketing",targeting:"marketing",ads:"marketing"};function Rr(e){var t;return(t=bs[e.trim().toLowerCase()])!=null?t:null}var Q=e=>typeof e=="boolean"?e:void 0;function q(e,t){return(n,r)=>{let o=t(r);if(o!==void 0)return o;let a=Rr(r),s=a?e[a]:void 0;return s?t(s):void 0}}var Nt=null,Sr=!1;function Wt(e){let t=v(e,"__tcfapi");Sr||typeof t!="function"||(Sr=!0,V(t,e,"addEventListener",2,(n,r)=>{r&&le(n)&&(Nt=n)}))}function ys(e){if(Nt)return Nt;let t=null;return V(v(e,"__tcfapi"),e,"getTCData",2,(n,r)=>{r&&le(n)&&(t=n)}),t}var wr={necessary:"necessary",preferences:"preferences",statistics:"statistics",marketing:"marketing"},Cr=(e,t)=>Array.isArray(e)&&e.includes(t),ks={cookiemunch:{present:e=>le(v(v(e,"CookieMunch"),"consent")),ask:(e,t)=>{let n=v(v(e,"CookieMunch"),"consent");return q(wr,r=>Q(v(n,r)))(e,t)}},onetrust:{present:e=>{var t;return typeof((t=v(e,"OnetrustActiveGroups"))!=null?t:v(e,"OptanonActiveGroups"))=="string"},ask:(e,t)=>{var r,o;let n=String((o=(r=v(e,"OnetrustActiveGroups"))!=null?r:v(e,"OptanonActiveGroups"))!=null?o:"").split(",").map(a=>a.trim()).filter(Boolean);return q({necessary:"C0001",statistics:"C0002",preferences:"C0003",marketing:"C0004"},a=>/^C\d{4}$/.test(a)||n.includes(a)?n.includes(a):void 0)(e,t)}},cookiebot:{present:e=>!v(e,"CookieMunch")&&le(v(v(e,"Cookiebot"),"consent")),ask:(e,t)=>{let n=v(v(e,"Cookiebot"),"consent");return q(wr,r=>Q(v(n,r)))(e,t)}},didomi:{present:e=>typeof v(v(e,"Didomi"),"getUserStatus")=="function",ask:(e,t)=>{let n=v(e,"Didomi"),r=v(v(V(v(n,"getUserStatus"),n),"purposes"),"global"),o=v(r,"enabled"),a=v(r,"disabled");return q({marketing:"cookies",statistics:"measure_content_performance"},s=>Cr(o,s)?!0:Cr(a,s)?!1:void 0)(e,t)}},usercentrics:{present:e=>typeof v(v(e,"UC_UI"),"getServicesBaseInfo")=="function",ask:(e,t)=>{let n=v(e,"UC_UI"),r=V(v(n,"getServicesBaseInfo"),n);if(Array.isArray(r))return q({necessary:"essential",preferences:"functional",statistics:"functional",marketing:"marketing"},o=>{let a=r.filter(s=>v(s,"categorySlug")===o);return a.length?a.every(s=>v(v(s,"consent"),"status")===!0):void 0})(e,t)}},osano:{present:e=>typeof v(v(v(e,"Osano"),"cm"),"getConsent")=="function",ask:(e,t)=>{let n=v(v(e,"Osano"),"cm"),r=V(v(n,"getConsent"),n);return q({necessary:"ESSENTIAL",preferences:"PERSONALIZATION",statistics:"ANALYTICS",marketing:"MARKETING"},o=>{var s;let a=(s=v(r,o))!=null?s:v(r,o.toUpperCase());return a==="ACCEPT"?!0:a==="DENY"?!1:void 0})(e,t)}},cookieyes:{present:e=>typeof v(e,"getCkyConsent")=="function",ask:(e,t)=>{let n=v(V(v(e,"getCkyConsent"),e),"categories");return q({necessary:"necessary",preferences:"functional",statistics:"analytics",marketing:"advertisement"},r=>Q(v(n,r)))(e,t)}},complianz:{present:e=>typeof v(e,"cmplz_has_consent")=="function",ask:(e,t)=>q({necessary:"functional",preferences:"preferences",statistics:"statistics",marketing:"marketing"},n=>Q(V(v(e,"cmplz_has_consent"),e,n)))(e,t)},klaro:{present:e=>typeof v(v(e,"klaro"),"getManager")=="function",ask:(e,t)=>{let n=v(e,"klaro"),r=v(V(v(n,"getManager"),n),"consents");return Q(v(r,t))}},tcf:{present:e=>typeof v(e,"__tcfapi")=="function",ask:e=>{var n;let t=ys(e);if(t)return t.gdprApplies===!1?!0:(n=Q(v(v(v(t,"purpose"),"consents"),"1")))!=null?n:!1}},consent_mode:{present:e=>le(v(v(v(e,"google_tag_data"),"ics"),"entries")),ask:(e,t)=>{let n=v(v(v(e,"google_tag_data"),"ics"),"entries");return q({preferences:"functionality_storage",statistics:"analytics_storage",marketing:"ad_storage"},r=>{var a;let o=v(n,r);return(a=Q(v(o,"update")))!=null?a:Q(v(o,"default"))})(e,t)}}};function vs(e){let t=e;if(typeof e=="function")try{t=e()}catch{t=void 0}if(t==="granted"||t===!0)return!0;if(t==="denied"||t===!1)return!1}function Ht(e,t,n={}){let r=n.provider||"auto",o=()=>{let l=vs(n.appConsent);return l===void 0?{granted:!1,by:"none"}:{granted:l,by:"app"}};if(r==="app")return o();let a=r==="auto"?Er:[r],s=t.filter(l=>typeof l=="string"&&l.trim().length>0);for(let l of a){let i=ks[l],c=!1;try{c=!!i&&i.present(e)}catch{c=!1}if(!(!i||!c)){for(let d of s){let u;try{u=i.ask(e,d)}catch{u=void 0}if(u!==void 0)return{granted:u,by:l}}return{granted:!1,by:l}}}return o()}var Pr=new Set(["referally","rewardful","tolt","promotekit"]),Tr=["referally"],Ir=Object.freeze({enabled:!1,sources:[],consentProvider:"auto",urlParams:[],contextCookie:null,consentCategory:"referrals",consentFallbackCategory:"marketing",challengeReferredSignups:"inherit",codeLookupUrl:null,signupCodeField:!1}),_s=/^[A-Za-z0-9_-]{3,64}$/,xs=/^[A-Za-z0-9_.-]{1,40}$/,Ss=/^[A-Za-z0-9_.-]{1,64}$/,Re=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function te(e){if(typeof e!="string")return null;let t=e.trim();return _s.test(t)?t:null}function Or(e){let t=Re(e)&&Re(e.referrals)?e.referrals:e;if(!Re(t)||t.enabled!==!0)return{...Ir,urlParams:[],sources:[]};let n=Array.isArray(t.url_params)?t.url_params.filter(o=>typeof o=="string"&&xs.test(o)).slice(0,10):[];return{enabled:!0,sources:Array.isArray(t.browser_sources)?t.browser_sources.filter(o=>typeof o=="string"&&/^[a-z0-9_]{1,40}$/.test(o)).slice(0,20):[...Tr],consentProvider:typeof t.consent_provider=="string"&&/^[a-z0-9_]{1,40}$/.test(t.consent_provider)?t.consent_provider:"auto",urlParams:n.length?n:["ref","via","aff"],contextCookie:typeof t.context_cookie=="string"&&Ss.test(t.context_cookie)?t.context_cookie:null,consentCategory:typeof t.consent_category=="string"&&t.consent_category?t.consent_category:"referrals",consentFallbackCategory:typeof t.consent_fallback_category=="string"&&t.consent_fallback_category?t.consent_fallback_category:null,challengeReferredSignups:t.challenge_referred_signups==="always"?"always":"inherit",codeLookupUrl:typeof t.code_lookup_url=="string"&&/^https?:\/\//i.test(t.code_lookup_url)&&t.code_lookup_url.includes("{code}")?t.code_lookup_url:null,signupCodeField:t.signup_code_field===!0}}function ws(e,t){if(!e)return null;let n;try{n=new URLSearchParams(e)}catch{return null}for(let r of t){let o=te(n.get(r));if(o)return o}return null}function Cs(e,t){let n=[],r=o=>{o&&!n.includes(o)&&n.push(o)};for(let o of e)r(o);for(let o of e){let a;try{a=new URLSearchParams(o)}catch{continue}for(let s of["redirect_url","after_url","redirect_url_complete","after_sign_up_url","after_sign_in_url"]){let l=a.get(s);if(l)try{r(new URL(l,t!=null?t:"https://invalid.example").search)}catch{}}}return n}function Ke(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return new Date(e<1e12?e*1e3:e).toISOString();if(typeof e!="string"||!e||e.length>40)return null;if(/^\d{9,13}$/.test(e))return Ke(Number(e));let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toISOString():null}function Es(e,t=Date.now()){var s,l,i;if(typeof e!="string"||!e||e.length>4096)return null;let n=e;try{n=decodeURIComponent(e)}catch{}let r=c=>{if(!c.startsWith("{"))return null;try{let d=JSON.parse(c);return Re(d)?d:null}catch{return null}},o=(s=r(e.trim()))!=null?s:r(n.trim());if(o){let c=Ke(o.exp);if(c&&Date.parse(c)<=t)return null;let d={code:te(o.code),clickId:te((l=o.clickId)!=null?l:o.click_id),anonId:te((i=o.anonId)!=null?i:o.anon_id)},u=Ke(o.ts);return u&&(d.capturedAt=u),d.code||d.clickId||d.anonId?d:null}let a=te(n);return a?{code:null,clickId:a,anonId:null}:null}function As(e,t){if(!e)return null;for(let n of e.split(";")){let r=n.trim();if(r.startsWith(`${t}=`))return r.slice(t.length+1)}return null}var Rs=["ref_click_id","ref_anon_id","ref_consent","ref_captured_at"];function Ps(e){if(!e)return null;let t;try{t=new URLSearchParams(e)}catch{return null}if(!Rs.some(a=>t.get(a)!==null))return null;let n=t.get("ref_consent")==="granted",r={code:te(t.get("ref")),clickId:te(t.get("ref_click_id")),anonId:te(t.get("ref_anon_id")),consentGranted:n},o=Ke(t.get("ref_captured_at"));return o&&(r.capturedAt=o),r.code||r.clickId||r.anonId?r:null}function jt(e,t,n,r){var i;let a=!!(e.clickId||e.anonId)?t():null,s=!!(a!=null&&a.granted),l={code:e.code,click_id:s?e.clickId:null,anon_id:s?e.anonId:null,consent:s?"granted":"not_required",captured_at:(i=e.capturedAt)!=null?i:n,source:r,...a?{consent_by:a.by}:{}};return l.code||l.click_id||l.anon_id?l:null}function Ts(e){return e.win!==void 0?e.win:{CookieMunch:e.cookieMunch,aff:e.aff}}function Is(e,t,n,r){var y,E;if(!e.enabled)return null;let o=(y=t.capturedAt)!=null?y:new Date().toISOString(),a=Ts(t),s,l=()=>s!=null?s:s=Ht(a,[e.consentCategory,e.consentFallbackCategory],{provider:e.consentProvider,appConsent:n}),i=C=>C?jt(C,l,o,C.source):null,c=(E=e.sources)!=null?E:Tr,d={win:a,cookies:t.cookies},u=i(Bt(r));if(u)return u;let f=i(Ae(d,c.filter(C=>Pr.has(C))));if(f)return f;let p=Cs(t.searches,t.base);for(let C of p){let k=Ps(C);if(!k)continue;let S=jt(k,()=>k.consentGranted?{granted:!0,by:"url"}:l(),o,"url");if(S)return S}for(let C of p){let k=ws(C,e.urlParams);if(k)return{code:k,click_id:null,anon_id:null,consent:"not_required",captured_at:o,source:"url"}}let m=e.contextCookie?Es(As(t.cookies,e.contextCookie)):null,b=m?jt(m,l,o,"cookie"):null;return b||i(Ae(d,c.filter(C=>!Pr.has(C))))}var Os=new Set(["/v1/client/sign_ups","/v1/client/sign_ups/passkey","/v1/client/sign_ins","/v1/client/sign_ins/oauth","/v1/client/sign_ins/sso","/v1/client/sign_ins/saml","/v1/client/sign_ins/discourse","/v1/client/sign_ins/id_token","/v1/client/sign_ins/id_token/nonce","/v1/client/sign_ins/external_jwt","/v1/client/sign_ins/ldap","/v1/client/sign_ins/passkey/finish","/v1/oauth/telegram","/v1/oauth/siwe/nonce","/v1/oauth/siwe/verify","/v1/oauth/siws/nonce","/v1/oauth/siws/verify","/v1/oauth/siwf/nonce","/v1/oauth/siwf/verify"]),Ls=/^\/v1\/client\/(sign_ins\/[^/]+\/(prepare_first_factor|attempt_first_factor)|sign_ups\/[^/]+\/(prepare_verification|attempt_verification|passkey\/finish))$/;function Lr(e){var n;let t=(n=e.split("?")[0])!=null?n:e;return Os.has(t)||Ls.test(t)}var he=()=>typeof window=="undefined"?null:window,Ge=[],me=null;function Gt(){var t,n;let e=(n=(t=he())==null?void 0:t.location)==null?void 0:n.search;!e||Ge.includes(e)||(Ge.push(e),me!=null||(me=new Date().toISOString()))}Gt();he()&&Wt(he());var Kt={};var ge=new Map;function Dr(e,t){return`${e!=null?e:""}|${t}`}function Fr(e,t){!Re(t)||!("referrals"in t)||ge.set(e,Promise.resolve(Or(t)))}function Mr(e){let t=ge.get(e.referralCacheKey);if(!t){let n=e.referralCacheKey,r=()=>(ge.get(n)===t&&ge.delete(n),{...Ir,urlParams:[]});t=e.get("/v1/client/environment").then(o=>o.ok?Or(o.data):r()).catch(r),ge.set(n,t)}return t}function Ur(e){var n,r,o;let t=he();return ge.has(e.referralCacheKey)||!!((n=t==null?void 0:t.location)!=null&&n.search)||Ge.length>0||Bt(qt(e).referralSource)!==null||Ae({win:t,cookies:(o=(r=t==null?void 0:t.document)==null?void 0:r.cookie)!=null?o:null},$t)!==null}function qt(e){var n,r,o;let t=e.referralOptions;return{referral:(n=t.referral)!=null?n:Kt.referral,referralConsent:(r=t.referralConsent)!=null?r:Kt.referralConsent,referralSource:(o=t.referralSource)!=null?o:Kt.referralSource}}async function Vt(e){var r,o,a,s,l;let t=he();if(!t)return null;let n=qt(e);if(n.referral===!1)return null;try{let i=(o=(r=t.location)==null?void 0:r.search)!=null?o:"";if(!Ur(e))return null;let c=await Mr(e);return c.enabled?(Wt(t),Is(c,{searches:[i,...Ge],cookies:(s=(a=t.document)==null?void 0:a.cookie)!=null?s:null,win:t,base:(l=t.location)==null?void 0:l.href,capturedAt:me!=null?me:void 0},n.referralConsent,n.referralSource)):null}catch{return null}}async function Yt(e){if(!he()||qt(e).referral===!1||!Ur(e))return!1;try{if((await Mr(e)).challengeReferredSignups!=="always")return!1;let n=await Vt(e);return!!(n!=null&&n.code)}catch{return!1}}var zr=typeof window!="undefined",Pe=()=>typeof navigator!="undefined"?navigator:void 0;function I(e,t){try{return e()}catch{return t}}function Ds(){return I(()=>{if(!zr||typeof document=="undefined")return{vendor:null,renderer:null};let e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return{vendor:null,renderer:null};let n=t.getExtension("WEBGL_debug_renderer_info"),r=n?t.getParameter(n.UNMASKED_VENDOR_WEBGL):null,o=n?t.getParameter(n.UNMASKED_RENDERER_WEBGL):null;return{vendor:r!=null?r:null,renderer:o!=null?o:null}},{vendor:null,renderer:null})}function Fs(){return I(()=>{if(typeof document=="undefined")return null;let e=document.createElement("canvas");e.width=220,e.height=40;let t=e.getContext("2d");return t?(t.textBaseline="top",t.font="14px 'Arial'",t.fillStyle="#f60",t.fillRect(0,0,60,20),t.fillStyle="#069",t.fillText("Atlas anti-bot \u2708 1.0",2,15),Xt(e.toDataURL())):null},null)}function Ms(){var l;let e=Pe(),t=zr?window:{},n=(l=e==null?void 0:e.userAgent)!=null?l:"",r=I(()=>(e==null?void 0:e.webdriver)===!0,!1),o=I(()=>"chrome"in t&&!!t.chrome,!1),a=/headless/i.test(n)||/chrome/i.test(n)&&!o&&I(()=>{var i,c;return((c=(i=e==null?void 0:e.plugins)==null?void 0:i.length)!=null?c:0)===0},!1),s=I(()=>r||"_phantom"in t||"callPhantom"in t||"__nightmare"in t||"domAutomation"in t||"domAutomationController"in t||typeof document!="undefined"&&Object.keys(document).some(i=>i.startsWith("cdc_")||i.startsWith("$cdc_"))||/electron|phantomjs|slimerjs/i.test(n),r);return{webdriver:r,headless:a,hasChrome:o,automationHint:s}}function Us(){let e=Pe(),t=Ds(),n=Ms(),r=I(()=>{var a;return Array.from((a=e==null?void 0:e.languages)!=null?a:[])},[]),o=t.renderer;return{screenWidth:I(()=>{var a,s;return(s=(a=window.screen)==null?void 0:a.width)!=null?s:null},null),screenHeight:I(()=>{var a,s;return(s=(a=window.screen)==null?void 0:a.height)!=null?s:null},null),colorDepth:I(()=>{var a,s;return(s=(a=window.screen)==null?void 0:a.colorDepth)!=null?s:null},null),pixelRatio:I(()=>{var a;return(a=window.devicePixelRatio)!=null?a:null},null),timezone:I(()=>{var a;return(a=Intl.DateTimeFormat().resolvedOptions().timeZone)!=null?a:null},null),timezoneOffset:I(()=>new Date().getTimezoneOffset(),null),language:I(()=>{var a;return(a=e==null?void 0:e.language)!=null?a:null},null),languages:r,platform:I(()=>{var a;return(a=e==null?void 0:e.platform)!=null?a:null},null),hardwareConcurrency:I(()=>{var a;return(a=e==null?void 0:e.hardwareConcurrency)!=null?a:null},null),deviceMemory:I(()=>{var a;return(a=e==null?void 0:e.deviceMemory)!=null?a:null},null),maxTouchPoints:I(()=>{var a;return(a=e==null?void 0:e.maxTouchPoints)!=null?a:null},null),touchSupport:I(()=>{var a;return((a=e==null?void 0:e.maxTouchPoints)!=null?a:0)>0||"ontouchstart"in window},!1),cookieEnabled:I(()=>{var a;return(a=e==null?void 0:e.cookieEnabled)!=null?a:null},null),doNotTrack:I(()=>(e==null?void 0:e.doNotTrack)==="1"||(e==null?void 0:e.doNotTrack)==="yes",null),webglVendor:t.vendor,webglRenderer:o,pluginCount:I(()=>{var a,s;return(s=(a=e==null?void 0:e.plugins)==null?void 0:a.length)!=null?s:null},null),pointerType:I(()=>{var a,s;return(s=(a=window.matchMedia)==null?void 0:a.call(window,"(pointer: fine)"))!=null&&s.matches?"fine":"coarse"},null),webdriver:n.webdriver,headless:n.headless,hasChrome:n.hasChrome,webglSoftware:o?/swiftshader|llvmpipe|software|basic render/i.test(o):!1,automationHint:n.automationHint}}function zs(){var e;return(e=I(()=>{var o,a;let t=Pe(),n=typeof window!="undefined"?window:void 0,r=(a=(o=t==null?void 0:t.doNotTrack)!=null?o:t==null?void 0:t.msDoNotTrack)!=null?a:n==null?void 0:n.doNotTrack;return r==="1"||r==="yes"},!1))!=null?e:!1}function Zt(){return I(()=>{let e=()=>{var r,o;return"d_"+Xt(String(Math.random())+String(Date.now())+((o=(r=Pe())==null?void 0:r.userAgent)!=null?o:""))};if(zs())return e();if(typeof localStorage=="undefined")return null;let t="__atlas_did",n=localStorage.getItem(t);return n||(n=e(),localStorage.setItem(t,n)),n},null)}function Ns(e){let t=[e.timezone,e.platform,e.languages.join(","),e.webglVendor,e.webglRenderer,e.screenWidth,e.screenHeight,e.colorDepth,e.hardwareConcurrency,Fs()];return Xt(t.map(n=>n==null?"":String(n)).join("|"))}function Xt(e){let t=5381;for(let n=0;n<e.length;n+=1)t=(t<<5)+t+e.charCodeAt(n)>>>0;return t.toString(16).padStart(8,"0")}var qe=e=>e.length?e.reduce((t,n)=>t+n,0)/e.length:null,Jt=e=>{let t=qe(e);return t===null?null:e.reduce((n,r)=>n+(r-t)**2,0)/e.length},Ve=class{constructor(t){h(this,"start",Date.now());h(this,"firstInteraction",null);h(this,"moves",0);h(this,"distance",0);h(this,"maxSpeed",0);h(this,"speeds",[]);h(this,"lastX",null);h(this,"lastY",null);h(this,"lastMoveT",0);h(this,"netDx",0);h(this,"netDy",0);h(this,"keyCount",0);h(this,"downAt",new Map);h(this,"dwell",[]);h(this,"flight",[]);h(this,"lastUpAt",null);h(this,"pastes",0);h(this,"backspaces",0);h(this,"focusChanges",0);h(this,"scrolls",0);h(this,"target");h(this,"bound",[]);this.target=t!=null?t:typeof document!="undefined"?document:void 0,this.attach()}mark(){this.firstInteraction===null&&(this.firstInteraction=Date.now()-this.start)}attach(){let t=this.target;if(!t)return;let n=(r,o)=>{I(()=>t.addEventListener(r,o,{passive:!0}),void 0),this.bound.push([r,o])};n("pointermove",r=>this.onMove(r)),n("mousemove",r=>this.onMove(r)),n("keydown",r=>this.onKeyDown(r)),n("keyup",r=>this.onKeyUp(r)),n("paste",()=>{this.mark(),this.pastes+=1}),n("focusin",()=>{this.mark(),this.focusChanges+=1}),n("scroll",()=>{this.mark(),this.scrolls+=1})}onMove(t){var a,s;this.mark();let n=(a=t.clientX)!=null?a:0,r=(s=t.clientY)!=null?s:0,o=Date.now();if(this.lastX!==null&&this.lastY!==null){let l=n-this.lastX,i=r-this.lastY,c=Math.hypot(l,i);this.distance+=c,this.netDx+=l,this.netDy+=i;let d=o-this.lastMoveT;if(d>0){let u=c/d;this.speeds.push(u),u>this.maxSpeed&&(this.maxSpeed=u)}}this.moves+=1,this.lastX=n,this.lastY=r,this.lastMoveT=o}onKeyDown(t){this.mark(),this.keyCount+=1,t.key==="Backspace"&&(this.backspaces+=1),this.downAt.set(t.code||t.key||String(this.keyCount),Date.now()),this.lastUpAt!==null&&this.flight.push(Date.now()-this.lastUpAt)}onKeyUp(t){let n=t.code||t.key||"",r=this.downAt.get(n),o=Date.now();r!==void 0&&(this.dwell.push(o-r),this.downAt.delete(n)),this.lastUpAt=o}snapshot(){let t=Math.hypot(this.netDx,this.netDy);return{mouseMoves:this.moves,mouseDistance:Math.round(this.distance),mouseAvgSpeed:qe(this.speeds),mouseMaxSpeed:Math.round(this.maxSpeed*1e3)/1e3,mouseSpeedVariance:Jt(this.speeds),mouseStraightLineRatio:this.distance>0?Math.min(1,t/this.distance):null,keyCount:this.keyCount,keyAvgDwellMs:qe(this.dwell),keyAvgFlightMs:qe(this.flight),keyDwellVariance:Jt(this.dwell),keyFlightVariance:Jt(this.flight),pasteCount:this.pastes,backspaceCount:this.backspaces,timeToFirstInteractionMs:this.firstInteraction,timeToSubmitMs:Date.now()-this.start,focusChanges:this.focusChanges,scrollCount:this.scrolls,hadPointerMove:this.moves>0,hadKeydown:this.keyCount>0,interactionCount:this.moves+this.keyCount+this.scrolls+this.focusChanges}}stop(){let t=this.target;if(t){for(let[n,r]of this.bound)I(()=>t.removeEventListener(n,r),void 0);this.bound=[]}}};async function Nr(e){return I(async()=>{var i,c,d;let t=Us(),n={attempt_id:e.attemptId,kind:(i=e.kind)!=null?i:"telemetry",device_id:Zt(),device_fingerprint:Ns(t),device:t,behavior:(c=e.recorder)==null?void 0:c.snapshot()},r=`${e.api}/v1/client/telemetry?publishable_key=${encodeURIComponent(e.publishableKey)}`,o=JSON.stringify(n),a=Pe();if(!e.fetchImpl&&a&&typeof a.sendBeacon=="function"&&typeof Blob!="undefined"&&a.sendBeacon(r,new Blob([o],{type:"application/json"})))return!0;let s=(d=e.fetchImpl)!=null?d:typeof fetch!="undefined"?fetch:void 0;return s?(await s(r,{method:"POST",headers:{"content-type":"application/json","x-publishable-key":e.publishableKey},body:o,keepalive:!0,credentials:"include"})).ok:!1},Promise.resolve(!1))}function $r(e){if(typeof e!="string")return null;let t=e.trim().replace(/_/g,"-");return/^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$/.test(t)?t:null}var $s=new Set(["/v1/client/sign_ups","/v1/client/sign_ins/oauth","/v1/client/sign_ins/sso","/v1/client/sign_ins/saml","/v1/client/sign_ins/discourse","/v1/client/sign_ins/id_token","/v1/client/sign_ins/external_jwt","/v1/client/sign_ins/ldap","/v1/oauth/telegram","/v1/oauth/siwe/verify","/v1/oauth/siws/verify","/v1/oauth/siwf/verify"]),Ye=class{constructor(t){this.options=t;Gt()}get referralCacheKey(){return Dr(this.options.baseUrl,this.options.publishableKey)}get referralOptions(){return{referral:this.options.referral,referralConsent:this.options.referralConsent,referralSource:this.options.referralSource}}get locale(){return $r(this.options.locale)}get frontendApiOrigin(){let t=this.options.baseUrl;if(!t)return"";try{return new URL(t).origin}catch{return""}}async request(t,n={}){var c,d,u,f;let r=Ft(this.options.publishableKey,(c=this.options.fetchImpl)!=null?c:fetch),o=this.locale,a=(d=this.options.sdk)!=null?d:rr,s;try{s=await r(`${(u=this.options.baseUrl)!=null?u:""}${t}`,{...n,credentials:"include",headers:{"x-publishable-key":this.options.publishableKey,[or]:ar(a),...o?{"accept-language":o}:{},...n.body?{"content-type":"application/json"}:{},...n.headers}})}catch{return{ok:!1,status:0,data:null,errors:[{code:"NETWORK",reason:"network",message:"We could not reach the server."}]}}sr(s,a);let l=null;try{l=await s.json()}catch{}let i=t.split("?")[0];return s.ok&&((f=n.method)!=null?f:"GET")==="GET"&&(i==="/v1/client/environment"||i==="/v1/appearance")&&Fr(this.referralCacheKey,l),{ok:s.ok,status:s.status,data:s.ok?l:null,errors:s.ok?[]:jn(l)}}async post(t,n){let r=n;if(r!==null&&typeof r=="object"&&!Array.isArray(r)&&!("referral"in r)&&Lr(t)){let a=await Vt(this);a&&(r={...r,referral:a})}let o=t.split("?")[0];if(o!==void 0&&$s.has(o)&&r!==null&&typeof r=="object"&&!Array.isArray(r)&&!("device_id"in r)){let a=Zt();a&&(r={...r,device_id:a})}return this.request(t,{method:"POST",body:r===void 0?void 0:JSON.stringify(r)})}get(t){return this.request(t,{method:"GET"})}};var z={attempt:null,errors:[],busy:!1,pollSecret:null,ticket:null,prepared:null};function Bs(e,t){var o,a,s,l,i,c,d,u,f,p,m,b,y;if(!e)return{path:"/v1/client/sign_ins",body:{identifier:(o=t.identifier)!=null?o:"",...t.captcha_token?{captcha_token:t.captcha_token}:{}}};let n=$(e),r=(a=e.id)!=null?a:"";switch(n.kind){case"collect_identifier":return{path:"/v1/client/sign_ins",body:{identifier:(s=t.identifier)!=null?s:"",...t.captcha_token?{captcha_token:t.captcha_token}:{}}};case"collect_first_factor":return t.code?{path:`/v1/client/sign_ins/${r}/attempt_first_factor`,body:{strategy:"email_code",code:t.code}}:{path:`/v1/client/sign_ins/${r}/attempt_first_factor`,body:{strategy:"password",password:(l=t.password)!=null?l:""}};case"collect_second_factor":return{path:`/v1/client/sign_ins/${r}/attempt_second_factor`,body:{code:(i=t.code)!=null?i:"",...t.remember_device==="true"?{remember_device:!0}:{}}};case"enroll_second_factor":return t.enrollStrategy==="phone_code"?{path:`/v1/client/sign_ins/${r}/attempt_mfa_enrollment`,body:{factor_id:(c=t.factorId)!=null?c:"",code:(d=t.code)!=null?d:""}}:{path:`/v1/client/sign_ins/${r}/attempt_mfa_enrollment`,body:{factor_id:(u=t.factorId)!=null?u:"",codes:[(f=t.code)!=null?f:"",(p=t.secondCode)!=null?p:""]}};case"collect_email_code":return{path:`/v1/client/sign_ups/${r}/attempt_verification`,body:{code:(m=t.code)!=null?m:""}};case"collect_captcha":return t.captcha_token?{path:"/v1/client/sign_ins",body:{identifier:(b=t.identifier)!=null?b:"",captcha_token:t.captcha_token}}:null;case"collect_new_password":return{path:`/v1/client/password_resets/${r}/set_new_password`,body:{password:(y=t.password)!=null?y:""}};case"await_oauth":case"done":case"restart":case"unknown":return null}}function Je(e){return e?{...z,attempt:{id:e.id,status:e.status}}:z}async function Te(e,t,n){var c,d,u,f;let r=Bs(t.attempt,n);if(!r)return t;let o=await e.post(r.path,r.body);if(!o.ok||!o.data)return{...t,busy:!1,errors:o.errors};let{backup_codes:a,...s}=o.data,l=kr(a),i=s.id===((c=t.attempt)==null?void 0:c.id)&&s.status===((d=t.attempt)==null?void 0:d.status);return{attempt:s,errors:[],busy:!1,pollSecret:t.pollSecret,ticket:(u=s.ticket)!=null?u:null,prepared:i&&(f=t.prepared)!=null?f:null,...l?{recoveryCodes:l}:{}}}async function Qt(e,t){var o,a;let n=t.fields&&Object.keys(t.fields).length>0,r=await e.post("/v1/client/sign_ups",{email:t.email,password:t.password,...n?{fields:t.fields}:{},...t.consent?{consent:!0}:{},...t.captchaToken?{captcha_token:t.captchaToken}:{},...t.username?{username:t.username}:{}});return!r.ok||!r.data?{...z,busy:!1,errors:r.errors}:{attempt:r.data,errors:[],busy:!1,pollSecret:(o=r.data.poll_secret)!=null?o:z.pollSecret,ticket:(a=r.data.ticket)!=null?a:null}}async function Br(e,t){var o;let n=(o=t.attempt)==null?void 0:o.id;if(!n)return t;let r=await e.post(`/v1/client/sign_ups/${n}/prepare_verification`,{});return r.ok?{...t,busy:!1,errors:[]}:{...t,busy:!1,errors:r.errors}}function Ze(e,t){return!!e&&e.object==="sign_up_attempt"&&e.status==="needs_email_verification"&&t==="link"}async function Wr(e,t,n){var a,s,l;let r=(a=t.attempt)==null?void 0:a.id;if(!r)return t;let o=await e.post(`/v1/client/sign_ins/${r}/prepare_first_factor`,{strategy:n});return o.ok?{...t,busy:!1,errors:[],pollSecret:n==="email_link"&&(l=(s=o.data)==null?void 0:s.poll_secret)!=null?l:null,prepared:n}:{...t,busy:!1,errors:o.errors}}async function Hr(e,t){var a,s,l;let n=(a=t.attempt)==null?void 0:a.id;if(!n||!t.pollSecret)return{state:t,ticket:null};let r=((s=t.attempt)==null?void 0:s.object)==="sign_up_attempt"?"sign_ups":"sign_ins",o=await e.get(`/v1/client/${r}/${n}?poll_secret=${encodeURIComponent(t.pollSecret)}`);return!o.ok||!o.data?{state:t,ticket:null}:{state:{...t,attempt:o.data},ticket:(l=o.data.ticket)!=null?l:null}}function en(e){var r;if(!e.pollSecret||!e.attempt||Hn(e.attempt))return!1;let t=e.attempt;return!(t.object==="sign_up_attempt"&&t.status==="needs_first_factor"&&((r=t.supported_first_factors)!=null?r:[]).includes("passkey"))}var sc=Object.freeze({entries:[],loading:!1,forbidden:!1,hasMore:!1});function Gr(e){return{provider:e.provider,id_token:e.idToken,...e.nonce?{nonce:e.nonce}:{}}}function qr(e){if(!e||typeof e!="object")return null;let t=e;return typeof t.id!="string"||typeof t.status!="string"?null:{attemptId:t.id,status:t.status,...typeof t.ticket=="string"?{ticket:t.ticket}:{}}}var jr="https://accounts.google.com/gsi/client",Xe=null;function Ws(){return typeof process!="undefined"&&!1}var Kr=new Set,Hs=!1;function js(e){return Xe||(Xe=new Promise((t,n)=>{if(e.querySelector(`script[src="${jr}"]`)){t();return}let r=e.createElement("script");r.src=jr,r.async=!0,r.defer=!0,r.addEventListener("load",()=>t()),r.addEventListener("error",()=>n(new Error("Failed to load Google Identity Services."))),e.head.appendChild(r)}),Xe)}async function Vr(e){var C,k,S,x,_,A;let t=(C=e.host)!=null?C:window,n=t.document;await js(n);let r=(S=(k=t.google)==null?void 0:k.accounts)==null?void 0:S.id;if(!r)throw new Error("Google Identity Services unavailable.");r.initialize({client_id:e.clientId,nonce:e.nonce,callback:w=>{var T;w.credential?(Hs=!0,e.onCredential(w.credential)):(T=e.onError)==null||T.call(e,new Error("Google returned no credential."))}});let o=e.wrapper.style.position!=="";o||(e.wrapper.style.position="relative");let a=(x=e.visible)!=null?x:!1,s=n.createElement("div");a||s.setAttribute("aria-hidden","true");let l=.004;s.style.cssText=`position:absolute;inset:0;z-index:2;opacity:${a?1:l};overflow:hidden;`,e.wrapper.appendChild(s);let i={provider:"google",wrapper:e.wrapper,overlay:s};Kr.add(i);let c=w=>{let T=w==null?void 0:w.style;T&&(T.width!=="100%"&&(T.width="100%"),T.height!=="100%"&&(T.height="100%"))},d=()=>{c(s.firstElementChild);let w=s.querySelector("iframe");c(w);let T=w==null?void 0:w.style;T&&T.margin!=="0px"&&(T.margin="0")},u=()=>{var L;let w=Math.round(e.wrapper.getBoundingClientRect().width)||320,T=Math.max(200,Math.min(400,w));s.replaceChildren(),r.renderButton(s,{type:"standard",theme:"outline",size:(L=e.size)!=null?L:"large",text:"continue_with",width:T}),d(),p()},f=w=>({width:w.width,height:w.height,top:w.top,left:w.left,right:w.right,bottom:w.bottom}),p=()=>{if(Ws()&&typeof window!="undefined")try{let w=e.wrapper.getBoundingClientRect(),T=s.getBoundingClientRect(),L=T.left<=w.left+1&&T.top<=w.top+1&&T.right>=w.right-1&&T.bottom>=w.bottom-1,X=s.querySelector("iframe"),N=X==null?void 0:X.getBoundingClientRect(),B=!!N&&N.width>=8&&N.height>=8;(!L||!B)&&console.warn("[atlas] Google overlay misaligned/undersized \u2014 clicks may miss the invisible GSI button",{covers:L,iframeOk:B,wrapper:f(w),overlay:f(T),iframe:N?{width:N.width,height:N.height}:null})}catch{}};u();let m,b=(_=t.ResizeObserver)!=null?_:typeof ResizeObserver!="undefined"?ResizeObserver:void 0;b&&(m=new b(()=>u()),m.observe(e.wrapper));let y,E=(A=t.MutationObserver)!=null?A:typeof MutationObserver!="undefined"?MutationObserver:void 0;return E&&(y=new E(()=>d()),y.observe(s,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","width","height"]})),e.oneTap&&r.prompt(),{destroy:()=>{m==null||m.disconnect(),y==null||y.disconnect(),Kr.delete(i),s.remove(),o||(e.wrapper.style.position="")}}}var Ks=()=>{let e=globalThis.navigator;if(!e||!e.credentials)throw new Error("WebAuthn is not available in this environment.");return e};function Qe(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n="";for(let r=0;r<t.length;r+=1)n+=String.fromCharCode(t[r]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Yr(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),r=atob(t+n),o=new Uint8Array(r.length);for(let a=0;a<r.length;a+=1)o[a]=r.charCodeAt(a);return o.buffer}function be(e){return typeof(e!=null?e:globalThis.PublicKeyCredential)!="undefined"}async function Jr(){var t;let e=globalThis.PublicKeyCredential;try{return await((t=e==null?void 0:e.isConditionalMediationAvailable)==null?void 0:t.call(e))===!0}catch{return!1}}async function tn(e,t={}){var l,i;let n=(l=t.host)!=null?l:Ks(),r=(i=e.allowCredentials)!=null?i:[],o={challenge:Yr(e.challenge),rpId:e.rpId,allowCredentials:r.map(c=>({type:c.type,id:Yr(c.id)})),userVerification:e.userVerification,timeout:e.timeout},a=await n.credentials.get({publicKey:o,...t.mediation?{mediation:t.mediation}:{},...t.signal?{signal:t.signal}:{}});if(!a)throw new Error("Passkey sign-in was cancelled.");let s=a.response;return{handle:e.handle,challenge:e.challenge,credential_id:Qe(a.rawId),authenticator_data:Qe(s.authenticatorData),client_data_json:Qe(s.clientDataJSON),signature:Qe(s.signature)}}var Gs={checking:"Checking your browser\u2026",verified:"Security check complete.",puzzlePrompt:"Select every picture that shows the same shape as this one. Colour and size don't matter.",confirm:"Confirm",tile:"Picture {n}",alternative:"Can't do the picture check? Use a longer automatic check instead."},qs={checking:"captcha.checking",verified:"captcha.verified",puzzlePrompt:"captcha.puzzlePrompt",confirm:"captcha.puzzleConfirm",tile:"captcha.puzzleTile",alternative:"captcha.puzzleAlternative"};function nn(e){if(!e)return{};let t=typeof e=="function"?e:r=>e[r],n={};for(let[r,o]of Object.entries(qs)){let a=t(o);typeof a=="string"&&a.trim()&&a!==o&&(n[r]=a)}return n}var Vs=e=>{let t=new Uint8Array(e),n="";for(let r=0;r<t.length;r++)n+=(t[r]<16?"0":"")+t[r].toString(16);return n},et=2e3;async function Ys(e,t,n,r=()=>!1){let o=new TextEncoder;for(let a=t;a<=n;a+=et){if(r())return null;let s=Math.min(n,a+et-1),l=[];for(let c=a;c<=s;c++)l.push(crypto.subtle.digest("SHA-256",o.encode(`${e.salt}${c}`)));let i=await Promise.all(l);for(let c=0;c<i.length;c++)if(Vs(i[c])===e.challenge)return a+c}return null}var Js=`
4
+ `)),!0}catch{return!1}}function Ut(){return typeof document!="undefined"&&typeof Blob!="undefined"&&typeof URL!="undefined"&&typeof URL.createObjectURL=="function"}function xr(e,t="recovery-codes.txt"){var r;if(!Ut())return!1;let n=URL.createObjectURL(new Blob([ka(e)],{type:"text/plain;charset=utf-8"}));try{let o=document.createElement("a");return o.href=n,o.download=t,o.rel="noopener",o.style.display="none",((r=document.body)!=null?r:document.documentElement).appendChild(o),o.click(),o.remove(),!0}catch{return!1}finally{setTimeout(()=>URL.revokeObjectURL(n),0)}}var va=/^[A-Za-z0-9_-]{3,64}$/,le=e=>!!e&&typeof e=="object"&&!Array.isArray(e),zt=e=>typeof e=="string"&&va.test(e.trim())?e.trim():null,$t=["referally","rewardful","tolt","promotekit","firstpromoter","partnerstack","dub"],Er=["cookiemunch","onetrust","cookiebot","didomi","usercentrics","osano","cookieyes","complianz","klaro","tcf","consent_mode"];function _(e,t){try{return e!=null&&(typeof e=="object"||typeof e=="function")?e[t]:void 0}catch{return}}function G(e,t,...n){try{return typeof e=="function"?e.apply(t,n):void 0}catch{return}}function Ee(e,t){if(!e)return null;for(let n of e.split(";")){let r=n.trim();if(r.startsWith(`${t}=`)){let o=r.slice(t.length+1);try{return decodeURIComponent(o)}catch{return o}}}return null}function Ar(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return new Date(e<1e12?e*1e3:e).toISOString();if(typeof e=="string"&&e&&e.length<=40){if(/^\d{9,13}$/.test(e))return Ar(Number(e));let t=Date.parse(e);if(Number.isFinite(t))return new Date(t).toISOString()}}function ee(e,t,n,r,o){let s={source:e,code:zt(t),clickId:zt(n),anonId:zt(r)},a=Ar(o);return a&&(s.capturedAt=a),s.code||s.clickId||s.anonId?s:null}var _a={referally:({win:e})=>{var r,o;let t=_(e,"aff"),n=G(_(t,"getReferral"),t);return le(n)?ee("referally",n.code,(r=n.clickId)!=null?r:n.click_id,(o=n.anonId)!=null?o:n.anon_id,n.ts):null},rewardful:({win:e})=>{let t=_(e,"Rewardful");return ee("rewardful",_(_(t,"affiliate"),"token"),_(t,"referral"),null)},tolt:({win:e})=>ee("tolt",null,_(e,"tolt_referral"),null),promotekit:({win:e})=>ee("promotekit",null,_(e,"promotekit_referral"),null),firstpromoter:({cookies:e})=>ee("firstpromoter",Ee(e,"_fprom_ref"),Ee(e,"_fprom_tid"),null),partnerstack:({cookies:e})=>ee("partnerstack",Ee(e,"ps_partner_key"),Ee(e,"ps_xid"),null),dub:({cookies:e})=>ee("dub",null,Ee(e,"dub_id"),null)};function Bt(e){var n,r,o;if(typeof e!="function")return null;let t;try{t=e()}catch{return null}return le(t)?ee("custom",t.code,(n=t.clickId)!=null?n:t.click_id,(r=t.anonId)!=null?r:t.anon_id,(o=t.capturedAt)!=null?o:t.ts):null}function Ae(e,t){for(let n of t){let r=_a[n];if(!r)continue;let o=null;try{o=r(e)}catch{o=null}if(o)return o}return null}var xa={necessary:"necessary",essential:"necessary",strictly_necessary:"necessary",preferences:"preferences",functional:"preferences",functionality:"preferences",personalization:"preferences",statistics:"statistics",analytics:"statistics",performance:"statistics",marketing:"marketing",advertising:"marketing",advertisement:"marketing",targeting:"marketing",ads:"marketing"};function Rr(e){var t;return(t=xa[e.trim().toLowerCase()])!=null?t:null}var Q=e=>typeof e=="boolean"?e:void 0;function V(e,t){return(n,r)=>{let o=t(r);if(o!==void 0)return o;let s=Rr(r),a=s?e[s]:void 0;return a?t(a):void 0}}var Nt=null,wr=!1;function Wt(e){let t=_(e,"__tcfapi");wr||typeof t!="function"||(wr=!0,G(t,e,"addEventListener",2,(n,r)=>{r&&le(n)&&(Nt=n)}))}function wa(e){if(Nt)return Nt;let t=null;return G(_(e,"__tcfapi"),e,"getTCData",2,(n,r)=>{r&&le(n)&&(t=n)}),t}var Sr={necessary:"necessary",preferences:"preferences",statistics:"statistics",marketing:"marketing"},Cr=(e,t)=>Array.isArray(e)&&e.includes(t),Sa={cookiemunch:{present:e=>le(_(_(e,"CookieMunch"),"consent")),ask:(e,t)=>{let n=_(_(e,"CookieMunch"),"consent");return V(Sr,r=>Q(_(n,r)))(e,t)}},onetrust:{present:e=>{var t;return typeof((t=_(e,"OnetrustActiveGroups"))!=null?t:_(e,"OptanonActiveGroups"))=="string"},ask:(e,t)=>{var r,o;let n=String((o=(r=_(e,"OnetrustActiveGroups"))!=null?r:_(e,"OptanonActiveGroups"))!=null?o:"").split(",").map(s=>s.trim()).filter(Boolean);return V({necessary:"C0001",statistics:"C0002",preferences:"C0003",marketing:"C0004"},s=>/^C\d{4}$/.test(s)||n.includes(s)?n.includes(s):void 0)(e,t)}},cookiebot:{present:e=>!_(e,"CookieMunch")&&le(_(_(e,"Cookiebot"),"consent")),ask:(e,t)=>{let n=_(_(e,"Cookiebot"),"consent");return V(Sr,r=>Q(_(n,r)))(e,t)}},didomi:{present:e=>typeof _(_(e,"Didomi"),"getUserStatus")=="function",ask:(e,t)=>{let n=_(e,"Didomi"),r=_(_(G(_(n,"getUserStatus"),n),"purposes"),"global"),o=_(r,"enabled"),s=_(r,"disabled");return V({marketing:"cookies",statistics:"measure_content_performance"},a=>Cr(o,a)?!0:Cr(s,a)?!1:void 0)(e,t)}},usercentrics:{present:e=>typeof _(_(e,"UC_UI"),"getServicesBaseInfo")=="function",ask:(e,t)=>{let n=_(e,"UC_UI"),r=G(_(n,"getServicesBaseInfo"),n);if(Array.isArray(r))return V({necessary:"essential",preferences:"functional",statistics:"functional",marketing:"marketing"},o=>{let s=r.filter(a=>_(a,"categorySlug")===o);return s.length?s.every(a=>_(_(a,"consent"),"status")===!0):void 0})(e,t)}},osano:{present:e=>typeof _(_(_(e,"Osano"),"cm"),"getConsent")=="function",ask:(e,t)=>{let n=_(_(e,"Osano"),"cm"),r=G(_(n,"getConsent"),n);return V({necessary:"ESSENTIAL",preferences:"PERSONALIZATION",statistics:"ANALYTICS",marketing:"MARKETING"},o=>{var a;let s=(a=_(r,o))!=null?a:_(r,o.toUpperCase());return s==="ACCEPT"?!0:s==="DENY"?!1:void 0})(e,t)}},cookieyes:{present:e=>typeof _(e,"getCkyConsent")=="function",ask:(e,t)=>{let n=_(G(_(e,"getCkyConsent"),e),"categories");return V({necessary:"necessary",preferences:"functional",statistics:"analytics",marketing:"advertisement"},r=>Q(_(n,r)))(e,t)}},complianz:{present:e=>typeof _(e,"cmplz_has_consent")=="function",ask:(e,t)=>V({necessary:"functional",preferences:"preferences",statistics:"statistics",marketing:"marketing"},n=>Q(G(_(e,"cmplz_has_consent"),e,n)))(e,t)},klaro:{present:e=>typeof _(_(e,"klaro"),"getManager")=="function",ask:(e,t)=>{let n=_(e,"klaro"),r=_(G(_(n,"getManager"),n),"consents");return Q(_(r,t))}},tcf:{present:e=>typeof _(e,"__tcfapi")=="function",ask:e=>{var n;let t=wa(e);if(t)return t.gdprApplies===!1?!0:(n=Q(_(_(_(t,"purpose"),"consents"),"1")))!=null?n:!1}},consent_mode:{present:e=>le(_(_(_(e,"google_tag_data"),"ics"),"entries")),ask:(e,t)=>{let n=_(_(_(e,"google_tag_data"),"ics"),"entries");return V({preferences:"functionality_storage",statistics:"analytics_storage",marketing:"ad_storage"},r=>{var s;let o=_(n,r);return(s=Q(_(o,"update")))!=null?s:Q(_(o,"default"))})(e,t)}}};function Ca(e){let t=e;if(typeof e=="function")try{t=e()}catch{t=void 0}if(t==="granted"||t===!0)return!0;if(t==="denied"||t===!1)return!1}function Ht(e,t,n={}){let r=n.provider||"auto",o=()=>{let l=Ca(n.appConsent);return l===void 0?{granted:!1,by:"none"}:{granted:l,by:"app"}};if(r==="app")return o();let s=r==="auto"?Er:[r],a=t.filter(l=>typeof l=="string"&&l.trim().length>0);for(let l of s){let i=Sa[l],c=!1;try{c=!!i&&i.present(e)}catch{c=!1}if(!(!i||!c)){for(let d of a){let u;try{u=i.ask(e,d)}catch{u=void 0}if(u!==void 0)return{granted:u,by:l}}return{granted:!1,by:l}}}return o()}var Pr=new Set(["referally","rewardful","tolt","promotekit"]),Tr=["referally"],Ir=Object.freeze({enabled:!1,sources:[],consentProvider:"auto",urlParams:[],contextCookie:null,consentCategory:"referrals",consentFallbackCategory:"marketing",challengeReferredSignups:"inherit",codeLookupUrl:null,signupCodeField:!1}),Ea=/^[A-Za-z0-9_-]{3,64}$/,Aa=/^[A-Za-z0-9_.-]{1,40}$/,Ra=/^[A-Za-z0-9_.-]{1,64}$/,Re=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function te(e){if(typeof e!="string")return null;let t=e.trim();return Ea.test(t)?t:null}function Or(e){let t=Re(e)&&Re(e.referrals)?e.referrals:e;if(!Re(t)||t.enabled!==!0)return{...Ir,urlParams:[],sources:[]};let n=Array.isArray(t.url_params)?t.url_params.filter(o=>typeof o=="string"&&Aa.test(o)).slice(0,10):[];return{enabled:!0,sources:Array.isArray(t.browser_sources)?t.browser_sources.filter(o=>typeof o=="string"&&/^[a-z0-9_]{1,40}$/.test(o)).slice(0,20):[...Tr],consentProvider:typeof t.consent_provider=="string"&&/^[a-z0-9_]{1,40}$/.test(t.consent_provider)?t.consent_provider:"auto",urlParams:n.length?n:["ref","via","aff"],contextCookie:typeof t.context_cookie=="string"&&Ra.test(t.context_cookie)?t.context_cookie:null,consentCategory:typeof t.consent_category=="string"&&t.consent_category?t.consent_category:"referrals",consentFallbackCategory:typeof t.consent_fallback_category=="string"&&t.consent_fallback_category?t.consent_fallback_category:null,challengeReferredSignups:t.challenge_referred_signups==="always"?"always":"inherit",codeLookupUrl:typeof t.code_lookup_url=="string"&&/^https?:\/\//i.test(t.code_lookup_url)&&t.code_lookup_url.includes("{code}")?t.code_lookup_url:null,signupCodeField:t.signup_code_field===!0}}function Pa(e,t){if(!e)return null;let n;try{n=new URLSearchParams(e)}catch{return null}for(let r of t){let o=te(n.get(r));if(o)return o}return null}function Ta(e,t){let n=[],r=o=>{o&&!n.includes(o)&&n.push(o)};for(let o of e)r(o);for(let o of e){let s;try{s=new URLSearchParams(o)}catch{continue}for(let a of["redirect_url","after_url","redirect_url_complete","after_sign_up_url","after_sign_in_url"]){let l=s.get(a);if(l)try{r(new URL(l,t!=null?t:"https://invalid.example").search)}catch{}}}return n}function qe(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return new Date(e<1e12?e*1e3:e).toISOString();if(typeof e!="string"||!e||e.length>40)return null;if(/^\d{9,13}$/.test(e))return qe(Number(e));let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toISOString():null}function Ia(e,t=Date.now()){var a,l,i;if(typeof e!="string"||!e||e.length>4096)return null;let n=e;try{n=decodeURIComponent(e)}catch{}let r=c=>{if(!c.startsWith("{"))return null;try{let d=JSON.parse(c);return Re(d)?d:null}catch{return null}},o=(a=r(e.trim()))!=null?a:r(n.trim());if(o){let c=qe(o.exp);if(c&&Date.parse(c)<=t)return null;let d={code:te(o.code),clickId:te((l=o.clickId)!=null?l:o.click_id),anonId:te((i=o.anonId)!=null?i:o.anon_id)},u=qe(o.ts);return u&&(d.capturedAt=u),d.code||d.clickId||d.anonId?d:null}let s=te(n);return s?{code:null,clickId:s,anonId:null}:null}function Oa(e,t){if(!e)return null;for(let n of e.split(";")){let r=n.trim();if(r.startsWith(`${t}=`))return r.slice(t.length+1)}return null}var La=["ref_click_id","ref_anon_id","ref_consent","ref_captured_at"];function Da(e){if(!e)return null;let t;try{t=new URLSearchParams(e)}catch{return null}if(!La.some(s=>t.get(s)!==null))return null;let n=t.get("ref_consent")==="granted",r={code:te(t.get("ref")),clickId:te(t.get("ref_click_id")),anonId:te(t.get("ref_anon_id")),consentGranted:n},o=qe(t.get("ref_captured_at"));return o&&(r.capturedAt=o),r.code||r.clickId||r.anonId?r:null}function jt(e,t,n,r){var i;let s=!!(e.clickId||e.anonId)?t():null,a=!!(s!=null&&s.granted),l={code:e.code,click_id:a?e.clickId:null,anon_id:a?e.anonId:null,consent:a?"granted":"not_required",captured_at:(i=e.capturedAt)!=null?i:n,source:r,...s?{consent_by:s.by}:{}};return l.code||l.click_id||l.anon_id?l:null}function Fa(e){return e.win!==void 0?e.win:{CookieMunch:e.cookieMunch,aff:e.aff}}function Ma(e,t,n,r){var y,A;if(!e.enabled)return null;let o=(y=t.capturedAt)!=null?y:new Date().toISOString(),s=Fa(t),a,l=()=>a!=null?a:a=Ht(s,[e.consentCategory,e.consentFallbackCategory],{provider:e.consentProvider,appConsent:n}),i=E=>E?jt(E,l,o,E.source):null,c=(A=e.sources)!=null?A:Tr,d={win:s,cookies:t.cookies},u=i(Bt(r));if(u)return u;let f=i(Ae(d,c.filter(E=>Pr.has(E))));if(f)return f;let p=Ta(t.searches,t.base);for(let E of p){let v=Da(E);if(!v)continue;let C=jt(v,()=>v.consentGranted?{granted:!0,by:"url"}:l(),o,"url");if(C)return C}for(let E of p){let v=Pa(E,e.urlParams);if(v)return{code:v,click_id:null,anon_id:null,consent:"not_required",captured_at:o,source:"url"}}let m=e.contextCookie?Ia(Oa(t.cookies,e.contextCookie)):null,b=m?jt(m,l,o,"cookie"):null;return b||i(Ae(d,c.filter(E=>!Pr.has(E))))}var Ua=new Set(["/v1/client/sign_ups","/v1/client/sign_ups/passkey","/v1/client/sign_ins","/v1/client/sign_ins/oauth","/v1/client/sign_ins/sso","/v1/client/sign_ins/saml","/v1/client/sign_ins/discourse","/v1/client/sign_ins/id_token","/v1/client/sign_ins/id_token/nonce","/v1/client/sign_ins/external_jwt","/v1/client/sign_ins/ldap","/v1/client/sign_ins/passkey/finish","/v1/oauth/telegram","/v1/oauth/siwe/nonce","/v1/oauth/siwe/verify","/v1/oauth/siws/nonce","/v1/oauth/siws/verify","/v1/oauth/siwf/nonce","/v1/oauth/siwf/verify"]),za=/^\/v1\/client\/(sign_ins\/[^/]+\/(prepare_first_factor|attempt_first_factor)|sign_ups\/[^/]+\/(prepare_verification|attempt_verification|passkey\/finish))$/;function Lr(e){var n;let t=(n=e.split("?")[0])!=null?n:e;return Ua.has(t)||za.test(t)}var he=()=>typeof window=="undefined"?null:window,Ve=[],me=null;function qt(){var t,n;let e=(n=(t=he())==null?void 0:t.location)==null?void 0:n.search;!e||Ve.includes(e)||(Ve.push(e),me!=null||(me=new Date().toISOString()))}qt();he()&&Wt(he());var Kt={};var ge=new Map;function Dr(e,t){return`${e!=null?e:""}|${t}`}function Fr(e,t){!Re(t)||!("referrals"in t)||ge.set(e,Promise.resolve(Or(t)))}function Mr(e){let t=ge.get(e.referralCacheKey);if(!t){let n=e.referralCacheKey,r=()=>(ge.get(n)===t&&ge.delete(n),{...Ir,urlParams:[]});t=e.get("/v1/client/environment").then(o=>o.ok?Or(o.data):r()).catch(r),ge.set(n,t)}return t}function Ur(e){var n,r,o;let t=he();return ge.has(e.referralCacheKey)||!!((n=t==null?void 0:t.location)!=null&&n.search)||Ve.length>0||Bt(Vt(e).referralSource)!==null||Ae({win:t,cookies:(o=(r=t==null?void 0:t.document)==null?void 0:r.cookie)!=null?o:null},$t)!==null}function Vt(e){var n,r,o;let t=e.referralOptions;return{referral:(n=t.referral)!=null?n:Kt.referral,referralConsent:(r=t.referralConsent)!=null?r:Kt.referralConsent,referralSource:(o=t.referralSource)!=null?o:Kt.referralSource}}async function Gt(e){var r,o,s,a,l;let t=he();if(!t)return null;let n=Vt(e);if(n.referral===!1)return null;try{let i=(o=(r=t.location)==null?void 0:r.search)!=null?o:"";if(!Ur(e))return null;let c=await Mr(e);return c.enabled?(Wt(t),Ma(c,{searches:[i,...Ve],cookies:(a=(s=t.document)==null?void 0:s.cookie)!=null?a:null,win:t,base:(l=t.location)==null?void 0:l.href,capturedAt:me!=null?me:void 0},n.referralConsent,n.referralSource)):null}catch{return null}}async function Yt(e){if(!he()||Vt(e).referral===!1||!Ur(e))return!1;try{if((await Mr(e)).challengeReferredSignups!=="always")return!1;let n=await Gt(e);return!!(n!=null&&n.code)}catch{return!1}}var zr=typeof window!="undefined",Pe=()=>typeof navigator!="undefined"?navigator:void 0;function O(e,t){try{return e()}catch{return t}}function Na(){return O(()=>{if(!zr||typeof document=="undefined")return{vendor:null,renderer:null};let e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return{vendor:null,renderer:null};let n=t.getExtension("WEBGL_debug_renderer_info"),r=n?t.getParameter(n.UNMASKED_VENDOR_WEBGL):null,o=n?t.getParameter(n.UNMASKED_RENDERER_WEBGL):null;return{vendor:r!=null?r:null,renderer:o!=null?o:null}},{vendor:null,renderer:null})}function $a(){return O(()=>{if(typeof document=="undefined")return null;let e=document.createElement("canvas");e.width=220,e.height=40;let t=e.getContext("2d");return t?(t.textBaseline="top",t.font="14px 'Arial'",t.fillStyle="#f60",t.fillRect(0,0,60,20),t.fillStyle="#069",t.fillText("Atlas anti-bot \u2708 1.0",2,15),Xt(e.toDataURL())):null},null)}function Ba(){var l;let e=Pe(),t=zr?window:{},n=(l=e==null?void 0:e.userAgent)!=null?l:"",r=O(()=>(e==null?void 0:e.webdriver)===!0,!1),o=O(()=>"chrome"in t&&!!t.chrome,!1),s=/headless/i.test(n)||/chrome/i.test(n)&&!o&&O(()=>{var i,c;return((c=(i=e==null?void 0:e.plugins)==null?void 0:i.length)!=null?c:0)===0},!1),a=O(()=>r||"_phantom"in t||"callPhantom"in t||"__nightmare"in t||"domAutomation"in t||"domAutomationController"in t||typeof document!="undefined"&&Object.keys(document).some(i=>i.startsWith("cdc_")||i.startsWith("$cdc_"))||/electron|phantomjs|slimerjs/i.test(n),r);return{webdriver:r,headless:s,hasChrome:o,automationHint:a}}function Wa(){let e=Pe(),t=Na(),n=Ba(),r=O(()=>{var s;return Array.from((s=e==null?void 0:e.languages)!=null?s:[])},[]),o=t.renderer;return{screenWidth:O(()=>{var s,a;return(a=(s=window.screen)==null?void 0:s.width)!=null?a:null},null),screenHeight:O(()=>{var s,a;return(a=(s=window.screen)==null?void 0:s.height)!=null?a:null},null),colorDepth:O(()=>{var s,a;return(a=(s=window.screen)==null?void 0:s.colorDepth)!=null?a:null},null),pixelRatio:O(()=>{var s;return(s=window.devicePixelRatio)!=null?s:null},null),timezone:O(()=>{var s;return(s=Intl.DateTimeFormat().resolvedOptions().timeZone)!=null?s:null},null),timezoneOffset:O(()=>new Date().getTimezoneOffset(),null),language:O(()=>{var s;return(s=e==null?void 0:e.language)!=null?s:null},null),languages:r,platform:O(()=>{var s;return(s=e==null?void 0:e.platform)!=null?s:null},null),hardwareConcurrency:O(()=>{var s;return(s=e==null?void 0:e.hardwareConcurrency)!=null?s:null},null),deviceMemory:O(()=>{var s;return(s=e==null?void 0:e.deviceMemory)!=null?s:null},null),maxTouchPoints:O(()=>{var s;return(s=e==null?void 0:e.maxTouchPoints)!=null?s:null},null),touchSupport:O(()=>{var s;return((s=e==null?void 0:e.maxTouchPoints)!=null?s:0)>0||"ontouchstart"in window},!1),cookieEnabled:O(()=>{var s;return(s=e==null?void 0:e.cookieEnabled)!=null?s:null},null),doNotTrack:O(()=>(e==null?void 0:e.doNotTrack)==="1"||(e==null?void 0:e.doNotTrack)==="yes",null),webglVendor:t.vendor,webglRenderer:o,pluginCount:O(()=>{var s,a;return(a=(s=e==null?void 0:e.plugins)==null?void 0:s.length)!=null?a:null},null),pointerType:O(()=>{var s,a;return(a=(s=window.matchMedia)==null?void 0:s.call(window,"(pointer: fine)"))!=null&&a.matches?"fine":"coarse"},null),webdriver:n.webdriver,headless:n.headless,hasChrome:n.hasChrome,webglSoftware:o?/swiftshader|llvmpipe|software|basic render/i.test(o):!1,automationHint:n.automationHint}}function Ha(){var e;return(e=O(()=>{var o,s;let t=Pe(),n=typeof window!="undefined"?window:void 0,r=(s=(o=t==null?void 0:t.doNotTrack)!=null?o:t==null?void 0:t.msDoNotTrack)!=null?s:n==null?void 0:n.doNotTrack;return r==="1"||r==="yes"},!1))!=null?e:!1}function Zt(){return O(()=>{let e=()=>{var r,o;return"d_"+Xt(String(Math.random())+String(Date.now())+((o=(r=Pe())==null?void 0:r.userAgent)!=null?o:""))};if(Ha())return e();if(typeof localStorage=="undefined")return null;let t="__atlas_did",n=localStorage.getItem(t);return n||(n=e(),localStorage.setItem(t,n)),n},null)}function ja(e){let t=[e.timezone,e.platform,e.languages.join(","),e.webglVendor,e.webglRenderer,e.screenWidth,e.screenHeight,e.colorDepth,e.hardwareConcurrency,$a()];return Xt(t.map(n=>n==null?"":String(n)).join("|"))}function Xt(e){let t=5381;for(let n=0;n<e.length;n+=1)t=(t<<5)+t+e.charCodeAt(n)>>>0;return t.toString(16).padStart(8,"0")}var Ge=e=>e.length?e.reduce((t,n)=>t+n,0)/e.length:null,Jt=e=>{let t=Ge(e);return t===null?null:e.reduce((n,r)=>n+(r-t)**2,0)/e.length},Ye=class{constructor(t){h(this,"start",Date.now());h(this,"firstInteraction",null);h(this,"moves",0);h(this,"distance",0);h(this,"maxSpeed",0);h(this,"speeds",[]);h(this,"lastX",null);h(this,"lastY",null);h(this,"lastMoveT",0);h(this,"netDx",0);h(this,"netDy",0);h(this,"keyCount",0);h(this,"downAt",new Map);h(this,"dwell",[]);h(this,"flight",[]);h(this,"lastUpAt",null);h(this,"pastes",0);h(this,"backspaces",0);h(this,"focusChanges",0);h(this,"scrolls",0);h(this,"target");h(this,"bound",[]);this.target=t!=null?t:typeof document!="undefined"?document:void 0,this.attach()}mark(){this.firstInteraction===null&&(this.firstInteraction=Date.now()-this.start)}attach(){let t=this.target;if(!t)return;let n=(r,o)=>{O(()=>t.addEventListener(r,o,{passive:!0}),void 0),this.bound.push([r,o])};n("pointermove",r=>this.onMove(r)),n("mousemove",r=>this.onMove(r)),n("keydown",r=>this.onKeyDown(r)),n("keyup",r=>this.onKeyUp(r)),n("paste",()=>{this.mark(),this.pastes+=1}),n("focusin",()=>{this.mark(),this.focusChanges+=1}),n("scroll",()=>{this.mark(),this.scrolls+=1})}onMove(t){var s,a;this.mark();let n=(s=t.clientX)!=null?s:0,r=(a=t.clientY)!=null?a:0,o=Date.now();if(this.lastX!==null&&this.lastY!==null){let l=n-this.lastX,i=r-this.lastY,c=Math.hypot(l,i);this.distance+=c,this.netDx+=l,this.netDy+=i;let d=o-this.lastMoveT;if(d>0){let u=c/d;this.speeds.push(u),u>this.maxSpeed&&(this.maxSpeed=u)}}this.moves+=1,this.lastX=n,this.lastY=r,this.lastMoveT=o}onKeyDown(t){this.mark(),this.keyCount+=1,t.key==="Backspace"&&(this.backspaces+=1),this.downAt.set(t.code||t.key||String(this.keyCount),Date.now()),this.lastUpAt!==null&&this.flight.push(Date.now()-this.lastUpAt)}onKeyUp(t){let n=t.code||t.key||"",r=this.downAt.get(n),o=Date.now();r!==void 0&&(this.dwell.push(o-r),this.downAt.delete(n)),this.lastUpAt=o}snapshot(){let t=Math.hypot(this.netDx,this.netDy);return{mouseMoves:this.moves,mouseDistance:Math.round(this.distance),mouseAvgSpeed:Ge(this.speeds),mouseMaxSpeed:Math.round(this.maxSpeed*1e3)/1e3,mouseSpeedVariance:Jt(this.speeds),mouseStraightLineRatio:this.distance>0?Math.min(1,t/this.distance):null,keyCount:this.keyCount,keyAvgDwellMs:Ge(this.dwell),keyAvgFlightMs:Ge(this.flight),keyDwellVariance:Jt(this.dwell),keyFlightVariance:Jt(this.flight),pasteCount:this.pastes,backspaceCount:this.backspaces,timeToFirstInteractionMs:this.firstInteraction,timeToSubmitMs:Date.now()-this.start,focusChanges:this.focusChanges,scrollCount:this.scrolls,hadPointerMove:this.moves>0,hadKeydown:this.keyCount>0,interactionCount:this.moves+this.keyCount+this.scrolls+this.focusChanges}}stop(){let t=this.target;if(t){for(let[n,r]of this.bound)O(()=>t.removeEventListener(n,r),void 0);this.bound=[]}}};async function Nr(e){return O(async()=>{var i,c,d;let t=Wa(),n={attempt_id:e.attemptId,kind:(i=e.kind)!=null?i:"telemetry",device_id:Zt(),device_fingerprint:ja(t),device:t,behavior:(c=e.recorder)==null?void 0:c.snapshot()},r=`${e.api}/v1/client/telemetry?publishable_key=${encodeURIComponent(e.publishableKey)}`,o=JSON.stringify(n),s=Pe();if(!e.fetchImpl&&s&&typeof s.sendBeacon=="function"&&typeof Blob!="undefined"&&s.sendBeacon(r,new Blob([o],{type:"application/json"})))return!0;let a=(d=e.fetchImpl)!=null?d:typeof fetch!="undefined"?fetch:void 0;return a?(await a(r,{method:"POST",headers:{"content-type":"application/json","x-publishable-key":e.publishableKey},body:o,keepalive:!0,credentials:"include"})).ok:!1},Promise.resolve(!1))}function $r(e){if(typeof e!="string")return null;let t=e.trim().replace(/_/g,"-");return/^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$/.test(t)?t:null}var Ka=new Set(["/v1/client/sign_ups","/v1/client/sign_ins/oauth","/v1/client/sign_ins/sso","/v1/client/sign_ins/saml","/v1/client/sign_ins/discourse","/v1/client/sign_ins/id_token","/v1/client/sign_ins/external_jwt","/v1/client/sign_ins/ldap","/v1/oauth/telegram","/v1/oauth/siwe/verify","/v1/oauth/siws/verify","/v1/oauth/siwf/verify"]),Je=class{constructor(t){this.options=t;qt()}get referralCacheKey(){return Dr(this.options.baseUrl,this.options.publishableKey)}get referralOptions(){return{referral:this.options.referral,referralConsent:this.options.referralConsent,referralSource:this.options.referralSource}}get locale(){return $r(this.options.locale)}get frontendApiOrigin(){let t=this.options.baseUrl;if(!t)return"";try{return new URL(t).origin}catch{return""}}async request(t,n={}){var c,d,u,f;let r=Ft(this.options.publishableKey,(c=this.options.fetchImpl)!=null?c:fetch),o=this.locale,s=(d=this.options.sdk)!=null?d:rr,a;try{a=await r(`${(u=this.options.baseUrl)!=null?u:""}${t}`,{...n,credentials:"include",headers:{"x-publishable-key":this.options.publishableKey,[or]:sr(s),...o?{"accept-language":o}:{},...n.body?{"content-type":"application/json"}:{},...n.headers}})}catch{return{ok:!1,status:0,data:null,errors:[{code:"NETWORK",reason:"network",message:"We could not reach the server."}]}}ar(a,s);let l=null;try{l=await a.json()}catch{}let i=t.split("?")[0];return a.ok&&((f=n.method)!=null?f:"GET")==="GET"&&(i==="/v1/client/environment"||i==="/v1/appearance")&&Fr(this.referralCacheKey,l),{ok:a.ok,status:a.status,data:a.ok?l:null,errors:a.ok?[]:jn(l)}}async post(t,n){let r=n;if(r!==null&&typeof r=="object"&&!Array.isArray(r)&&!("referral"in r)&&Lr(t)){let s=await Gt(this);s&&(r={...r,referral:s})}let o=t.split("?")[0];if(o!==void 0&&Ka.has(o)&&r!==null&&typeof r=="object"&&!Array.isArray(r)&&!("device_id"in r)){let s=Zt();s&&(r={...r,device_id:s})}return this.request(t,{method:"POST",body:r===void 0?void 0:JSON.stringify(r)})}get(t){return this.request(t,{method:"GET"})}};var N={attempt:null,errors:[],busy:!1,pollSecret:null,ticket:null,prepared:null};function qa(e,t){var o,s,a,l,i,c,d,u,f,p,m,b,y;if(!e)return{path:"/v1/client/sign_ins",body:{identifier:(o=t.identifier)!=null?o:"",...t.captcha_token?{captcha_token:t.captcha_token}:{}}};let n=z(e),r=(s=e.id)!=null?s:"";switch(n.kind){case"collect_identifier":return{path:"/v1/client/sign_ins",body:{identifier:(a=t.identifier)!=null?a:"",...t.captcha_token?{captcha_token:t.captcha_token}:{}}};case"collect_first_factor":return t.code?{path:`/v1/client/sign_ins/${r}/attempt_first_factor`,body:{strategy:"email_code",code:t.code}}:{path:`/v1/client/sign_ins/${r}/attempt_first_factor`,body:{strategy:"password",password:(l=t.password)!=null?l:""}};case"collect_second_factor":return{path:`/v1/client/sign_ins/${r}/attempt_second_factor`,body:{code:(i=t.code)!=null?i:"",...t.remember_device==="true"?{remember_device:!0}:{}}};case"enroll_second_factor":return t.enrollStrategy==="phone_code"?{path:`/v1/client/sign_ins/${r}/attempt_mfa_enrollment`,body:{factor_id:(c=t.factorId)!=null?c:"",code:(d=t.code)!=null?d:""}}:{path:`/v1/client/sign_ins/${r}/attempt_mfa_enrollment`,body:{factor_id:(u=t.factorId)!=null?u:"",codes:[(f=t.code)!=null?f:"",(p=t.secondCode)!=null?p:""]}};case"collect_email_code":return{path:`/v1/client/sign_ups/${r}/attempt_verification`,body:{code:(m=t.code)!=null?m:""}};case"collect_captcha":return t.captcha_token?{path:"/v1/client/sign_ins",body:{identifier:(b=t.identifier)!=null?b:"",captcha_token:t.captcha_token}}:null;case"collect_new_password":return{path:`/v1/client/password_resets/${r}/set_new_password`,body:{password:(y=t.password)!=null?y:""}};case"await_oauth":case"done":case"restart":case"unknown":return null}}function Ze(e){return e?{...N,attempt:{id:e.id,status:e.status}}:N}async function Te(e,t,n){var c,d,u,f;let r=qa(t.attempt,n);if(!r)return t;let o=await e.post(r.path,r.body);if(!o.ok||!o.data)return{...t,busy:!1,errors:o.errors};let{backup_codes:s,...a}=o.data,l=kr(s),i=a.id===((c=t.attempt)==null?void 0:c.id)&&a.status===((d=t.attempt)==null?void 0:d.status);return{attempt:a,errors:[],busy:!1,pollSecret:t.pollSecret,ticket:(u=a.ticket)!=null?u:null,prepared:i&&(f=t.prepared)!=null?f:null,...l?{recoveryCodes:l}:{}}}async function Qt(e,t){var o,s;let n=t.fields&&Object.keys(t.fields).length>0,r=await e.post("/v1/client/sign_ups",{email:t.email,password:t.password,...n?{fields:t.fields}:{},...t.consent?{consent:!0}:{},...t.captchaToken?{captcha_token:t.captchaToken}:{},...t.username?{username:t.username}:{}});return!r.ok||!r.data?{...N,busy:!1,errors:r.errors}:{attempt:r.data,errors:[],busy:!1,pollSecret:(o=r.data.poll_secret)!=null?o:N.pollSecret,ticket:(s=r.data.ticket)!=null?s:null}}async function Br(e,t){var o;let n=(o=t.attempt)==null?void 0:o.id;if(!n)return t;let r=await e.post(`/v1/client/sign_ups/${n}/prepare_verification`,{});return r.ok?{...t,busy:!1,errors:[]}:{...t,busy:!1,errors:r.errors}}function Xe(e,t){return!!e&&e.object==="sign_up_attempt"&&e.status==="needs_email_verification"&&t==="link"}async function Wr(e,t,n){var s,a,l;let r=(s=t.attempt)==null?void 0:s.id;if(!r)return t;let o=await e.post(`/v1/client/sign_ins/${r}/prepare_first_factor`,{strategy:n});return o.ok?{...t,busy:!1,errors:[],pollSecret:n==="email_link"&&(l=(a=o.data)==null?void 0:a.poll_secret)!=null?l:null,prepared:n}:{...t,busy:!1,errors:o.errors}}async function Hr(e,t){var s,a,l;let n=(s=t.attempt)==null?void 0:s.id;if(!n||!t.pollSecret)return{state:t,ticket:null};let r=((a=t.attempt)==null?void 0:a.object)==="sign_up_attempt"?"sign_ups":"sign_ins",o=await e.get(`/v1/client/${r}/${n}?poll_secret=${encodeURIComponent(t.pollSecret)}`);return!o.ok||!o.data?{state:t,ticket:null}:{state:{...t,attempt:o.data},ticket:(l=o.data.ticket)!=null?l:null}}function en(e){var r;if(!e.pollSecret||!e.attempt||Hn(e.attempt))return!1;let t=e.attempt;return!(t.object==="sign_up_attempt"&&t.status==="needs_first_factor"&&((r=t.supported_first_factors)!=null?r:[]).includes("passkey"))}var vc=Object.freeze({entries:[],loading:!1,forbidden:!1,hasMore:!1});function qr(e){return{provider:e.provider,id_token:e.idToken,...e.nonce?{nonce:e.nonce}:{}}}function Vr(e){if(!e||typeof e!="object")return null;let t=e;return typeof t.id!="string"||typeof t.status!="string"?null:{attemptId:t.id,status:t.status,...typeof t.ticket=="string"?{ticket:t.ticket}:{}}}var jr="https://accounts.google.com/gsi/client",Qe=null;function Va(){return typeof process!="undefined"&&!1}var Kr=new Set,Ga=!1;function Ya(e){return Qe||(Qe=new Promise((t,n)=>{if(e.querySelector(`script[src="${jr}"]`)){t();return}let r=e.createElement("script");r.src=jr,r.async=!0,r.defer=!0,r.addEventListener("load",()=>t()),r.addEventListener("error",()=>n(new Error("Failed to load Google Identity Services."))),e.head.appendChild(r)}),Qe)}async function Gr(e){var E,v,C,x,k,w;let t=(E=e.host)!=null?E:window,n=t.document;await Ya(n);let r=(C=(v=t.google)==null?void 0:v.accounts)==null?void 0:C.id;if(!r)throw new Error("Google Identity Services unavailable.");r.initialize({client_id:e.clientId,nonce:e.nonce,callback:S=>{var T;S.credential?(Ga=!0,e.onCredential(S.credential)):(T=e.onError)==null||T.call(e,new Error("Google returned no credential."))}});let o=e.wrapper.style.position!=="";o||(e.wrapper.style.position="relative");let s=(x=e.visible)!=null?x:!1,a=n.createElement("div");s||a.setAttribute("aria-hidden","true");let l=.004;a.style.cssText=`position:absolute;inset:0;z-index:2;opacity:${s?1:l};overflow:hidden;`,e.wrapper.appendChild(a);let i={provider:"google",wrapper:e.wrapper,overlay:a};Kr.add(i);let c=S=>{let T=S==null?void 0:S.style;T&&(T.width!=="100%"&&(T.width="100%"),T.height!=="100%"&&(T.height="100%"))},d=()=>{c(a.firstElementChild);let S=a.querySelector("iframe");c(S);let T=S==null?void 0:S.style;T&&T.margin!=="0px"&&(T.margin="0")},u=()=>{var I;let S=Math.round(e.wrapper.getBoundingClientRect().width)||320,T=Math.max(200,Math.min(400,S));a.replaceChildren(),r.renderButton(a,{type:"standard",theme:"outline",size:(I=e.size)!=null?I:"large",text:"continue_with",width:T}),d(),p()},f=S=>({width:S.width,height:S.height,top:S.top,left:S.left,right:S.right,bottom:S.bottom}),p=()=>{if(Va()&&typeof window!="undefined")try{let S=e.wrapper.getBoundingClientRect(),T=a.getBoundingClientRect(),I=T.left<=S.left+1&&T.top<=S.top+1&&T.right>=S.right-1&&T.bottom>=S.bottom-1,X=a.querySelector("iframe"),$=X==null?void 0:X.getBoundingClientRect(),B=!!$&&$.width>=8&&$.height>=8;(!I||!B)&&console.warn("[atlas] Google overlay misaligned/undersized \u2014 clicks may miss the invisible GSI button",{covers:I,iframeOk:B,wrapper:f(S),overlay:f(T),iframe:$?{width:$.width,height:$.height}:null})}catch{}};u();let m,b=(k=t.ResizeObserver)!=null?k:typeof ResizeObserver!="undefined"?ResizeObserver:void 0;b&&(m=new b(()=>u()),m.observe(e.wrapper));let y,A=(w=t.MutationObserver)!=null?w:typeof MutationObserver!="undefined"?MutationObserver:void 0;return A&&(y=new A(()=>d()),y.observe(a,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","width","height"]})),e.oneTap&&r.prompt(),{destroy:()=>{m==null||m.disconnect(),y==null||y.disconnect(),Kr.delete(i),a.remove(),o||(e.wrapper.style.position="")}}}var Ja=()=>{let e=globalThis.navigator;if(!e||!e.credentials)throw new Error("WebAuthn is not available in this environment.");return e};function Ie(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n="";for(let r=0;r<t.length;r+=1)n+=String.fromCharCode(t[r]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Yr(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),r=atob(t+n),o=new Uint8Array(r.length);for(let s=0;s<r.length;s+=1)o[s]=r.charCodeAt(s);return o.buffer}function be(e){return typeof(e!=null?e:globalThis.PublicKeyCredential)!="undefined"}async function Qr(){var t;let e=globalThis.PublicKeyCredential;try{return await((t=e==null?void 0:e.isConditionalMediationAvailable)==null?void 0:t.call(e))===!0}catch{return!1}}function Jr(e){return typeof e=="string"?new TextEncoder().encode(e):e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function Zr(e){return{first:Jr(e.first),...e.second!==void 0?{second:Jr(e.second)}:{}}}function Za(e,t){if(!e)return;let n={};return e.eval&&(n.eval=Zr(e.eval)),t==="get"&&e.evalByCredential&&(n.evalByCredential=Object.fromEntries(Object.entries(e.evalByCredential).map(([r,o])=>[r,Zr(o)]))),{prf:n}}var Xr=e=>e instanceof ArrayBuffer?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):void 0;function Xa(e){var s,a,l,i;let t=(a=(s=e.getClientExtensionResults)==null?void 0:s.call(e))!=null?a:{},n={credentialId:Ie(e.rawId)},r=t.prf;if(r&&typeof r=="object"){let c=Xr((l=r.results)==null?void 0:l.first),d=Xr((i=r.results)==null?void 0:i.second);n.prf={...typeof r.enabled=="boolean"?{enabled:r.enabled}:{},...c?{results:{first:c,...d?{second:d}:{}}}:{}}}let o=t.credProps;return o&&typeof o=="object"&&(n.credProps=typeof o.rk=="boolean"?{rk:o.rk}:{}),n}async function tn(e,t={}){var l,i;let n=(l=t.host)!=null?l:Ja(),r=(i=e.allowCredentials)!=null?i:[],o={challenge:Yr(e.challenge),rpId:e.rpId,allowCredentials:r.map(c=>({type:c.type,id:Yr(c.id)})),userVerification:e.userVerification,timeout:e.timeout,...Qa(Za(t.prf,"get"),e.extensions)},s=await n.credentials.get({publicKey:o,...t.mediation?{mediation:t.mediation}:{},...t.signal?{signal:t.signal}:{}});if(!s)throw new Error("Passkey sign-in was cancelled.");let a=s.response;return t.onExtensionResults&&t.onExtensionResults(Xa(s)),{handle:e.handle,challenge:e.challenge,credential_id:Ie(s.rawId),authenticator_data:Ie(a.authenticatorData),client_data_json:Ie(a.clientDataJSON),signature:Ie(a.signature)}}function Qa(e,t){let n=t&&typeof t=="object"&&!Array.isArray(t)?t:void 0;return!e&&!n?{}:{extensions:{...n!=null?n:{},...e!=null?e:{}}}}var ei={checking:"Checking your browser\u2026",verified:"Security check complete.",puzzlePrompt:"Select every picture that shows the same shape as this one. Colour and size don't matter.",confirm:"Confirm",tile:"Picture {n}",alternative:"Can't do the picture check? Use a longer automatic check instead."},ti={checking:"captcha.checking",verified:"captcha.verified",puzzlePrompt:"captcha.puzzlePrompt",confirm:"captcha.puzzleConfirm",tile:"captcha.puzzleTile",alternative:"captcha.puzzleAlternative"};function nn(e){if(!e)return{};let t=typeof e=="function"?e:r=>e[r],n={};for(let[r,o]of Object.entries(ti)){let s=t(o);typeof s=="string"&&s.trim()&&s!==o&&(n[r]=s)}return n}var ni=e=>{let t=new Uint8Array(e),n="";for(let r=0;r<t.length;r++)n+=(t[r]<16?"0":"")+t[r].toString(16);return n},et=2e3;async function ri(e,t,n,r=()=>!1){let o=new TextEncoder;for(let s=t;s<=n;s+=et){if(r())return null;let a=Math.min(n,s+et-1),l=[];for(let c=s;c<=a;c++)l.push(crypto.subtle.digest("SHA-256",o.encode(`${e.salt}${c}`)));let i=await Promise.all(l);for(let c=0;c<i.length;c++)if(ni(i[c])===e.challenge)return s+c}return null}var oi=`
5
5
  self.onmessage = async function (e) {
6
6
  var d = e.data, enc = new TextEncoder();
7
7
  function hex(buf) { var b = new Uint8Array(buf), s = ''; for (var i = 0; i < b.length; i++) s += (b[i] < 16 ? '0' : '') + b[i].toString(16); return s; }
@@ -12,7 +12,7 @@ self.onmessage = async function (e) {
12
12
  for (var i = 0; i < hs.length; i++) if (hex(hs[i]) === d.challenge) { self.postMessage({ n: start + i }); return; }
13
13
  }
14
14
  self.postMessage({ n: null });
15
- };`;async function Zs(e,t={}){var a,s,l,i;let n=(a=t.cancelled)!=null?a:()=>!1,r=globalThis;if(t.workers!==!1&&r.Worker&&r.Blob&&((s=r.URL)!=null&&s.createObjectURL)){let c=await Xs(e,Math.max(1,Math.min(4,(i=(l=r.navigator)==null?void 0:l.hardwareConcurrency)!=null?i:2)),n).catch(()=>{});if(c!==void 0){if(c===null)throw new Error("captcha: no solution");return{n:c,worker:!0}}}let o=await Ys(e,0,e.maxnumber,n);if(o===null)throw new Error(n()?"captcha: cancelled":"captcha: no solution");return{n:o,worker:!1}}function Xs(e,t,n){let r=URL.createObjectURL(new Blob([Js],{type:"text/javascript"})),o=[],a=()=>{for(let s of o)s.terminate();URL.revokeObjectURL(r)};return new Promise((s,l)=>{let i=t,c=Math.ceil((e.maxnumber+1)/t),d=setInterval(()=>{n()&&(clearInterval(d),a(),s(null))},100),u=f=>{clearInterval(d),a(),f instanceof Error?l(f):s(f)};try{for(let f=0;f<t;f++){let p=new Worker(r);o.push(p),p.onmessage=b=>{var y;typeof((y=b.data)==null?void 0:y.n)=="number"?u(b.data.n):--i===0&&u(null)},p.onerror=()=>u(new Error("captcha: worker failed"));let m=f*c;p.postMessage({salt:e.salt,challenge:e.challenge,from:m,to:Math.min(e.maxnumber,m+c-1)})}}catch(f){u(f instanceof Error?f:new Error("captcha: worker failed"))}})}var Qs=e=>{let t=new TextEncoder().encode(e),n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")};function ei(e){return`atlas1.${Qs(JSON.stringify(e))}`}async function ti(e,t=!1){let n=t?`${e}${e.includes("?")?"&":"?"}accessible=true`:e,r=await fetch(n,{method:"GET",credentials:"omit"});if(!r.ok)throw new Error(`captcha: challenge refused (${r.status})`);return await r.json()}function Zr(e,t){let n=e.createElement("img");return n.src=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(t)))}`,n.alt="",n.width=64,n.height=64,n.style.cssText="display:block;width:64px;height:64px;border-radius:6px",n}function ni(e,t,n,r){let o=e.ownerDocument;return new Promise((a,s)=>{e.replaceChildren();let l=o.createElement("div");l.setAttribute("role","group"),l.setAttribute("data-atlas-captcha-puzzle",""),l.style.cssText="display:flex;flex-direction:column;align-items:center;gap:8px";let i=o.createElement("p");i.style.cssText="margin:0;font-size:13px;text-align:center",i.textContent=n.puzzlePrompt,l.append(i,Zr(o,t.interactive.example));let c=o.createElement("div");c.style.cssText="display:grid;grid-template-columns:repeat(3,72px);gap:6px";let d=0;t.interactive.tiles.forEach((f,p)=>{let m=o.createElement("button");m.type="button",m.setAttribute("aria-pressed","false"),m.setAttribute("aria-label",n.tile.replace("{n}",String(p+1))),m.setAttribute("data-atlas-captcha-tile",String(p)),m.style.cssText="padding:3px;border:2px solid transparent;border-radius:8px;background:none;cursor:pointer",m.append(Zr(o,f)),m.addEventListener("click",()=>{d^=1<<p;let b=(d&1<<p)!==0;m.setAttribute("aria-pressed",b?"true":"false"),m.style.borderColor=b?"currentColor":"transparent"}),c.append(m)});let u=o.createElement("button");if(u.type="button",u.setAttribute("data-atlas-captcha-confirm",""),u.textContent=n.confirm,u.addEventListener("click",()=>r()?s(new Error("captcha: widget removed")):a(d)),l.append(c,u),t.accessible_alternative){let f=o.createElement("button");f.type="button",f.setAttribute("data-atlas-captcha-alternative",""),f.style.cssText="font-size:12px;background:none;border:0;text-decoration:underline;cursor:pointer",f.textContent=n.alternative,f.addEventListener("click",()=>a("accessible")),l.append(f)}e.append(l)})}function rn(e,t){var p,m;let n={...Gs,...t.labels},r=(p=t.mode)!=null?p:"managed",o=e.ownerDocument,a=(m=t.fetchChallenge)!=null?m:b=>t.challengeUrl?ti(t.challengeUrl,b):Promise.reject(new Error("captcha: no challenge URL")),s=!1,l=0,i=()=>s,c=o.createElement("div");c.setAttribute("role","status"),c.setAttribute("aria-live","polite"),c.setAttribute("data-atlas-captcha-provider","atlas"),c.style.cssText="font-size:13px;opacity:.85;text-align:center",e.append(c);let d=b=>{c.replaceChildren(),c.textContent=b},u=async b=>{let y=await a(b);if(s)throw new Error("captcha: widget removed");l=Date.parse(y.expires_at)||0,(r==="visible"||y.interactive)&&d(n.checking);let E=Date.now(),C=Zs(y,{workers:t.workers,cancelled:i}).then(A=>({...A,ms:Date.now()-E}));C.catch(()=>{});let k;if(y.interactive){let A=await ni(c,y,n,i);if(A==="accessible")return d(n.checking),u(!0);k=A,d(n.checking)}let{n:S,worker:x,ms:_}=await C;if(s)throw new Error("captcha: widget removed");return(r==="visible"||k!==void 0)&&d(n.verified),ei({t:y.token,n:S,ms:_,...x?{w:1}:{},...k!==void 0?{sel:k}:{}})},f=u(!1);return f.catch(()=>{}),{token:f,stale:()=>l>0&&Date.now()>l-15e3,remove(){s=!0,c.remove()}}}var ri=new Set(["atlas","turnstile","hcaptcha","recaptcha","recaptcha_v3","recaptcha_enterprise"]);function Ie(e){return!!e&&ri.has(e)}function ye(e){return!!e&&e.enabled===!0&&Ie(e.provider)}var oi=["CAPTCHA_REQUIRED","CAPTCHA_FAILED"];function on(e){return!!e&&typeof e.code=="string"&&oi.includes(e.code)}var ai={turnstile:{src:()=>"https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",global:"turnstile"},hcaptcha:{src:()=>"https://js.hcaptcha.com/1/api.js?render=explicit",global:"hcaptcha"},recaptcha:{src:()=>"https://www.google.com/recaptcha/api.js?render=explicit",global:"grecaptcha"},recaptcha_v3:{src:e=>`https://www.google.com/recaptcha/api.js?render=${encodeURIComponent(e)}`,global:"grecaptcha"},recaptcha_enterprise:{src:e=>`https://www.google.com/recaptcha/enterprise.js?render=${encodeURIComponent(e)}`,global:"grecaptcha"}};function Xr(e,t,n){let r=ai[e];if(!r)return Promise.reject(new Error(`captcha: ${e} is not renderable`));if(n[r.global])return Promise.resolve(n[r.global]);let o=n.document,a=`__atlasCaptchaLoad_${e}`,s=n[a];if(s)return s;let l=new Promise((i,c)=>{var p,m;let d=()=>{n[r.global]?i(n[r.global]):c(new Error(`captcha: ${e} script loaded but global missing`))},u=r.src(t),f=o.querySelector(`script[src="${u}"]`);if(f){if(n[r.global])return i(n[r.global]);f.addEventListener("load",d,{once:!0}),f.addEventListener("error",()=>c(new Error(`captcha: ${e} script failed`)),{once:!0});return}f=o.createElement("script"),f.src=u,f.async=!0,f.defer=!0,f.addEventListener("load",d,{once:!0}),f.addEventListener("error",()=>c(new Error(`captcha: ${e} script failed`)),{once:!0}),((m=(p=o.head)!=null?p:o.body)!=null?m:o.documentElement).appendChild(f)});return n[a]=l,l.catch(()=>{n[a]===l&&delete n[a]}),l}function si(e,t,n,r,o){return new Promise((a,s)=>{let l=e.render(t,{sitekey:n,appearance:r==="invisible"?"interaction-only":"always",callback:i=>a(i),"error-callback":()=>s(new Error("captcha: turnstile error")),"timeout-callback":()=>s(new Error("captcha: turnstile timeout"))});o(()=>{var i;return(i=e.remove)==null?void 0:i.call(e,l)}),r==="invisible"&&e.execute&&e.execute(l)})}function ii(e,t,n,r,o){return new Promise((a,s)=>{let l=e.render(t,{sitekey:n,size:r==="invisible"?"invisible":"normal",callback:i=>a(i),"error-callback":()=>s(new Error("captcha: hcaptcha error"))});if(o(()=>{var i;return(i=e.remove)==null?void 0:i.call(e,l)}),r==="invisible"){let i=e.execute(l,{async:!0});i&&typeof i.then=="function"&&i.then(c=>a(c.response),s)}})}function li(e,t,n,r,o){return new Promise((a,s)=>{let l=e.render(t,{sitekey:n,size:r==="invisible"?"invisible":"normal",callback:i=>a(i),"error-callback":()=>s(new Error("captcha: recaptcha error"))});if(o(()=>{var i;return(i=e.reset)==null?void 0:i.call(e,l)}),r==="invisible"&&e.execute){let i=e.execute(void 0,{widgetId:l});i&&typeof i.then=="function"&&i.then(a,s)}})}function ci(e,t){let n=()=>{let r=e.execute(t,{action:"submit"});return r&&typeof r.then=="function"?r:Promise.reject(new Error("captcha: recaptcha v3 execute returned no promise"))};return new Promise((r,o)=>{e.ready?e.ready(()=>n().then(r,o)):n().then(r,o)})}function Qr(e,t,n={}){var f,p,m,b,y,E;let r=(f=e.provider)!=null?f:"";if(r==="atlas")return rn(t,{challengeUrl:e.challengeUrl,mode:(p=e.widget)!=null?p:"managed",...n.atlas});let o=(m=e.siteKey)!=null?m:"",a=(b=e.widget)!=null?b:"managed",s=(E=(y=t.ownerDocument)==null?void 0:y.defaultView)!=null?E:globalThis,l=!1,i=null,c=null,d=C=>{i=C};return{token:new Promise((C,k)=>{c=k,Xr(r,o,s).then(S=>{if(l)throw new Error("captcha: widget removed");switch(r){case"turnstile":return si(S,t,o,a,d);case"hcaptcha":return ii(S,t,o,a,d);case"recaptcha":return li(S,t,o,a,d);case"recaptcha_v3":case"recaptcha_enterprise":return ci(S,o);default:throw new Error(`captcha: ${r} is not renderable`)}}).then(C,k)}),remove(){if(!l){l=!0;try{i==null||i()}catch{}for(;t.firstChild;)t.removeChild(t.firstChild);c==null||c(new Error("captcha: widget removed"))}}}}async function an(e,t,n){return Qr(e,t,n).token}var di="/v1/client/sign_ins/passkey/begin",eo=async(e,t)=>{try{return await e(t)||null}catch{return null}};async function sn(e,t={}){var i;let n=c=>e.post(di,c?{captcha_token:c}:{}),r=(i=t.captcha)!=null?i:null,o=r?await eo(r,{retry:!1}):null,a=await n(o);if(a.ok||!r)return a;let s=a.errors.find(c=>on(c));if(!s)return a;let l=await eo(r,{retry:!0,refused:s.code==="CAPTCHA_FAILED"?"CAPTCHA_FAILED":"CAPTCHA_REQUIRED"});return l?n(l):a}var Oe={attempt:null,errors:[],busy:!1,ticket:null};async function to(e,t,n){let r=await e.post("/v1/client/password_resets",{email_address:t,captcha_token:n});return!r.ok||!r.data?{...Oe,errors:r.errors}:{attempt:r.data,errors:[],busy:!1,ticket:null}}async function no(e,t,n){var l,i,c,d;let r=t.attempt;if(!r)return t;let o=null,a={};switch(r.status){case"needs_email_verification":o=`/v1/client/password_resets/${r.id}/attempt_verification`,a={code:(l=n.code)!=null?l:""};break;case"needs_second_factor":o=`/v1/client/password_resets/${r.id}/attempt_second_factor`,a={code:(i=n.code)!=null?i:""};break;case"needs_new_password":o=`/v1/client/password_resets/${r.id}/set_new_password`,a={password:(c=n.password)!=null?c:""};break;default:return t}let s=await e.post(o,a);return!s.ok||!s.data?{...t,busy:!1,errors:s.errors}:{attempt:{id:s.data.id,status:s.data.status},errors:[],busy:!1,ticket:(d=s.data.ticket)!=null?d:null}}function ke(e){var n;let t=(n=e.attempt)==null?void 0:n.status;if(!t)return"request";switch(t){case"needs_email_verification":return"collect_email_code";case"needs_second_factor":return"collect_second_factor";case"needs_new_password":return"collect_new_password";case"complete":return"done";default:return"unknown"}}async function ro(e,t){let n=t.attempt;if(!(n!=null&&n.poll_secret))return t;let r=await e.get(`/v1/client/password_resets/${n.id}?poll_secret=${encodeURIComponent(n.poll_secret)}`);return!r.ok||!r.data?t:{...t,attempt:{id:r.data.id,status:r.data.status,poll_secret:n.poll_secret}}}var Hc=Object.freeze({available:!0,passwordReset:!0,passwordSignUp:!0}),ao="This app can't send email right now. Try another sign-in method or contact the app owner.";var Le=e=>!!e&&typeof e=="object"&&!Array.isArray(e);var ln=Object.freeze({username:null,lastSignInMethod:!1,emailVerification:"code",passwordReset:"code",emailSecondFactor:!1,passkeySignUp:null}),oo=e=>e==="link"||e==="both"?e:"code";function cn(e){var o;let t=Le(e)&&Le(e.account)?e.account:null;if(!t)return{...ln};let n=Le(t.username)?t.username:null,r=(a,s)=>typeof a=="number"&&Number.isInteger(a)?a:s;return{username:n?{minLength:r(n.min_length,3),maxLength:r(n.max_length,30),charset:n.charset==="alphanumeric"||n.charset==="alphanumeric_underscore"?n.charset:"default",requiredAtSignUp:n.required_at_sign_up===!0}:null,lastSignInMethod:t.last_sign_in_method===!0,emailVerification:oo(t.email_verification),passwordReset:oo(t.password_reset),emailSecondFactor:t.email_second_factor===!0,...Le(t.mfa)?{mfa:{totp:t.mfa.totp!==!1,sms:t.mfa.sms===!0,totpCodes:Number((o=t.mfa.totp_codes)!=null?o:t.mfa.totpCodes)>=2?2:1}}:{},passkeySignUp:Le(t.passkey_sign_up)?{email:t.passkey_sign_up.email==="off"||t.passkey_sign_up.email==="optional"?t.passkey_sign_up.email:"required"}:null}}function so(e){let t={...e};for(let n of["signUp","signIn"]){let r=t[n];r&&r.provider&&!r.enabled&&(t[n]={...r,enabled:!0})}return t}var ne=Ya(co());var uo=["auto","light","dark"],de=["primary","primaryInk","accent","background","surface","text","muted","border","danger","success","inputBackground","inputText"],ot=["none","uppercase"],po={"minor-second":1.067,"major-second":1.125,"minor-third":1.2,"major-third":1.25,"perfect-fourth":1.333,"augmented-fourth":1.414,"perfect-fifth":1.5,golden:1.618,"minor-seventh":1.778,octave:2},fo=Object.keys(po),at=["none","sm","md","lg","xl"],st=["compact","comfortable","spacious"],it=["solid","glass","outline","none"],lt=["narrow","normal","wide"],ct=["center","left","right","split"],dt=["left","right"],ut=["card","page","hidden"],pt=["sm","md","lg"],ft=["solid","outline","soft","gradient"],gt=["list","grid","icons"],mt=["outline","filled","underline"],go=["linear","radial"],un=["cover","contain"],pn=["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"],De=["none","dots","grid","noise"],ht=["minimal","atlas","glass","midnight","editorial","terminal","sunrise","forest","grape","slate","split-photo","bold"],fn=/^#[0-9a-fA-F]{6}$/,gn=/^dasset_[0-9A-HJKMNP-TV-Z]{26}$/;var W="system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",bt="Georgia, Cambria, 'Times New Roman', Times, serif",mn="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",H="wght@400;500;600;700;800",mo=[{id:"system",label:"System UI",family:null,category:"sans-serif",fallback:`-apple-system, BlinkMacSystemFont, ${W}`,google:null},{id:"system-serif",label:"System serif (Georgia)",family:null,category:"serif",fallback:bt,google:null},{id:"system-mono",label:"System monospace",family:null,category:"monospace",fallback:mn,google:null},{id:"inter",label:"Inter",family:"Inter",category:"sans-serif",fallback:W,google:`Inter:${H}`},{id:"roboto",label:"Roboto",family:"Roboto",category:"sans-serif",fallback:W,google:"Roboto:wght@400;500;700;800"},{id:"open-sans",label:"Open Sans",family:"Open Sans",category:"sans-serif",fallback:W,google:`Open+Sans:${H}`},{id:"lato",label:"Lato",family:"Lato",category:"sans-serif",fallback:W,google:"Lato:wght@400;700;900"},{id:"montserrat",label:"Montserrat",family:"Montserrat",category:"sans-serif",fallback:W,google:`Montserrat:${H}`},{id:"poppins",label:"Poppins",family:"Poppins",category:"sans-serif",fallback:W,google:`Poppins:${H}`},{id:"nunito",label:"Nunito",family:"Nunito",category:"sans-serif",fallback:W,google:`Nunito:${H}`},{id:"work-sans",label:"Work Sans",family:"Work Sans",category:"sans-serif",fallback:W,google:`Work+Sans:${H}`},{id:"dm-sans",label:"DM Sans",family:"DM Sans",category:"sans-serif",fallback:W,google:`DM+Sans:${H}`},{id:"manrope",label:"Manrope",family:"Manrope",category:"sans-serif",fallback:W,google:`Manrope:${H}`},{id:"source-serif",label:"Source Serif",family:"Source Serif 4",category:"serif",fallback:bt,google:`Source+Serif+4:${H}`},{id:"merriweather",label:"Merriweather",family:"Merriweather",category:"serif",fallback:bt,google:"Merriweather:wght@400;700;900"},{id:"playfair-display",label:"Playfair Display",family:"Playfair Display",category:"serif",fallback:bt,google:`Playfair+Display:${H}`},{id:"jetbrains-mono",label:"JetBrains Mono",family:"JetBrains Mono",category:"monospace",fallback:mn,google:`JetBrains+Mono:${H}`},{id:"ibm-plex-mono",label:"IBM Plex Mono",family:"IBM Plex Mono",category:"monospace",fallback:mn,google:"IBM+Plex+Mono:wght@400;500;600;700"}],ho=mo.map(e=>e.id),bo=new Map(mo.map(e=>[e.id,e]));function hn(e){return typeof e=="string"?bo.get(e):void 0}function bn(e){var n;let t=(n=hn(e))!=null?n:bo.get("system");return t.family?`'${t.family}', ${t.fallback}`:t.fallback}function yo(e){let t=hn(e);return t!=null&&t.google?`/v1/design/fonts/${t.id}.css`:null}var yn=e=>{if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},ue=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),M=e=>t=>typeof t=="string"&&e.includes(t),Y=(e,t,n=1)=>r=>typeof r=="number"&&Number.isInteger(r)&&r>=e&&r<=t&&r%n===0,vo=(e,t)=>n=>typeof n=="number"&&!Number.isNaN(n)&&n>=e&&n<=t,Fe=e=>typeof e=="string"&&fn.test(e),kn=e=>typeof e=="string"&&gn.test(e);function re(e,t=[]){return n=>{if(!yn(n))return!1;for(let r of Object.keys(n)){if(!ue(e,r))return!1;let o=n[r];if(o===void 0){if(t.includes(r))return!1;continue}if(!e[r](o))return!1}return t.every(r=>ue(n,r)&&n[r]!==void 0)}}var ko=M(ho),vn={palette:Object.fromEntries(de.map(e=>[e,Fe])),paletteDark:Object.fromEntries(de.map(e=>[e,Fe])),typography:{font:ko,headingFont:ko,baseSize:Y(12,20),headingWeight:Y(400,800,100),bodyWeight:Y(300,600,100),letterCase:M(ot),scale:M(fo)},shape:{radius:Y(0,32),controlRadius:Y(0,999),borderWidth:Y(0,3)},elevation:{cardShadow:M(at)},spacing:{density:M(st)},card:{style:M(it),blur:Y(0,40),width:M(lt)},layout:{position:M(ct),splitImageSide:M(dt),logoPlacement:M(ut),logoSize:M(pt)},buttons:{style:M(ft),socialLayout:M(gt)},inputs:{style:M(mt)},logo:{assetId:kn,darkAssetId:kn}},hi=e=>{if(!re({type:M(go),angle:Y(0,360),stops:()=>!0},["type","stops"])(e))return!1;let t=e.stops;return Array.isArray(t)&&t.length>=2&&t.length<=4&&t.every(re({color:Fe,at:vo(0,100)},["color","at"]))},bi=re({assetId:kn,fit:M(un),position:M(pn),overlay:re({color:Fe,opacity:vo(0,1)},["color","opacity"]),blur:Y(0,20)},["assetId"]),_n={color:Fe,gradient:hi,image:bi,pattern:M(De)},Me={version:e=>e===1,preset:M(ht),colorScheme:M(uo),background:re(_n),backgroundDark:re(_n),...Object.fromEntries(Object.entries(vn).map(([e,t])=>[e,re(t)]))};function _o(e,t){return ue(Me,e)&&Me[e](t)}var xo=re(Me);function So(e,t=()=>{},n=""){let r=(...a)=>[n,...a].filter(Boolean).join(".");if(e==null)return{};if(!yn(e))return t({path:n||"(root)",message:"must be an object"}),{};let o={};for(let[a,s]of Object.entries(e)){if(s===void 0)continue;if(!ue(Me,a)){t({path:r(a),message:"Unknown setting."});continue}if(Me[a](s)){o[a]=s;continue}let l=ue(vn,a)?vn[a]:a==="background"||a==="backgroundDark"?_n:null;if(!l||!yn(s)){t({path:r(a),message:"Invalid value."});continue}let i={};for(let[c,d]of Object.entries(s))d!==void 0&&(ue(l,c)&&l[c](d)?i[c]=d:t({path:r(a,c),message:ue(l,c)?"Invalid value.":"Unknown setting."}));Object.keys(i).length&&(o[a]=i)}return o}var yi=new Set(["__proto__","constructor","prototype"]),wo=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function xn(e,t){let n={...e};for(let[r,o]of Object.entries(t)){if(yi.has(r)||o===void 0)continue;if(o===null){delete n[r];continue}let a=n[r];n[r]=wo(a)&&wo(o)?xn(a,o):o}return n}function F(e){let t=e.split(" ");if(t.length!==de.length)throw new Error(`palette spec needs ${de.length} slots: ${e}`);let n={};return t.forEach((r,o)=>{r!=="-"&&(n[de[o]]=r)}),n}var Co={version:1,preset:"minimal",colorScheme:"auto",palette:F("#18181b #ffffff #4f46e5 #fafafa #ffffff #18181b #71717a #e4e4e7 #dc2626 #15803d #ffffff #18181b"),paletteDark:F("#fafafa #18181b #818cf8 #09090b #18181b #fafafa #a1a1aa #3f3f46 #f87171 #4ade80 #09090b #fafafa"),typography:{font:"inter",headingFont:"inter",baseSize:15,headingWeight:600,bodyWeight:400,letterCase:"none",scale:"perfect-fourth"},shape:{radius:12,controlRadius:8,borderWidth:1},elevation:{cardShadow:"md"},spacing:{density:"comfortable"},card:{style:"solid",blur:16,width:"normal"},layout:{position:"center",splitImageSide:"left",logoPlacement:"card",logoSize:"md"},buttons:{style:"solid",socialLayout:"list"},inputs:{style:"outline"},background:{},backgroundDark:{},logo:{}},Eo={minimal:{design:{}},atlas:{design:{palette:F("#6d4aff #ffffff #0e8fc7 #f6f5ff #ffffff #0b0d17 #5b6078 #e2def5 #d92d3a #0f7a52 #ffffff #0b0d17"),paletteDark:F("#7455fa #ffffff #46c7ff #070811 #0f1120 #eef0f6 #959bb0 #262a40 #ff6b6b #43d9a0 #0b0d17 #eef0f6"),typography:{font:"system",headingFont:"system",headingWeight:600},shape:{radius:14,controlRadius:9,borderWidth:1},elevation:{cardShadow:"lg"},buttons:{style:"gradient"},background:{gradient:{type:"linear",angle:160,stops:[{color:"#f6f5ff",at:0},{color:"#eef6ff",at:100}]}},backgroundDark:{gradient:{type:"radial",stops:[{color:"#1a1440",at:0},{color:"#070811",at:70}]},pattern:"grid"}}},glass:{design:{palette:F("#4338ca - #db2777 #eef2ff #ffffff #111827 #4b5563 #ffffff - - #ffffff #111827"),paletteDark:F("#a5b4fc - #f472b6 #1e1b4b #111827 #f9fafb #cbd5e1 #374151 - - #0b1120 #f9fafb"),shape:{radius:20,controlRadius:12},elevation:{cardShadow:"xl"},card:{style:"glass",blur:20},background:{gradient:{type:"linear",angle:135,stops:[{color:"#6366f1",at:0},{color:"#ec4899",at:55},{color:"#f59e0b",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:135,stops:[{color:"#1e1b4b",at:0},{color:"#4c1d95",at:55},{color:"#831843",at:100}]}}}},midnight:{design:{colorScheme:"dark",palette:F("#1d4ed8 - #7c3aed #eef2f9 #ffffff #0b1020 #475569 #d5dceb - - #ffffff #0b1020"),paletteDark:F("#60a5fa - #a78bfa #0b1020 #121a2f #e6eaf5 #94a3b8 #24314f #f87171 #34d399 #0e1528 #e6eaf5"),typography:{font:"manrope",headingFont:"manrope"},shape:{radius:16,controlRadius:10},elevation:{cardShadow:"lg"},backgroundDark:{pattern:"dots"}}},editorial:{design:{palette:F("#8b2e1f - #8a6410 #f7f3ec #fffdf8 #1f1a14 #6b6157 #e3dacb - - #fffdf8 #1f1a14"),paletteDark:F("#e07a5f - #d4a64a #16130f #1f1b16 #f2ebe0 #a89f92 #3a332a - - #16130f #f2ebe0"),typography:{font:"source-serif",headingFont:"playfair-display",baseSize:16,headingWeight:700,scale:"golden"},shape:{radius:4,controlRadius:2},elevation:{cardShadow:"sm"},inputs:{style:"underline"}}},terminal:{design:{colorScheme:"dark",palette:F("#166534 - #0e7490 #f4fbf3 #ffffff #0b2a0b #3f6b3c #b7d8b4 - - #ffffff #0b2a0b"),paletteDark:F("#39ff14 #031003 #00e5ff #0a0f0a #0d140d #c8f7c5 #7fb57b #2c5a2c #ff5555 #39ff14 #050805 #c8f7c5"),typography:{font:"jetbrains-mono",headingFont:"jetbrains-mono",baseSize:14,letterCase:"uppercase",scale:"major-second"},shape:{radius:0,controlRadius:0,borderWidth:1},elevation:{cardShadow:"none"},card:{style:"outline"},buttons:{style:"outline"},backgroundDark:{pattern:"grid"}}},sunrise:{design:{palette:F("#c2410c - #be185d #fff1e6 #ffffff #2a1a12 #7c5e52 #f4d9cb - - #ffffff #2a1a12"),paletteDark:F("#fb923c - #f472b6 #1a0f0a #24150f #fdebe1 #c4a092 #4a2e22 - - #1a0f0a #fdebe1"),typography:{font:"poppins",headingFont:"poppins"},shape:{radius:20,controlRadius:999},elevation:{cardShadow:"lg"},background:{gradient:{type:"linear",angle:160,stops:[{color:"#fff1e6",at:0},{color:"#ffe4ec",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:160,stops:[{color:"#2a1209",at:0},{color:"#2a0f1c",at:100}]}}}},forest:{design:{palette:F("#166534 - #a16207 #f3f7f2 #ffffff #14261a #53685a #d6e3d8 - - #f3f7f2 #14261a"),paletteDark:F("#4ade80 - #facc15 #0c1510 #13201a #e3efe6 #9db5a4 #2a3d31 - - #0c1510 #e3efe6"),typography:{font:"dm-sans",headingFont:"dm-sans"},shape:{radius:10,controlRadius:8},inputs:{style:"filled"}}},grape:{design:{palette:F("#7e22ce - #be185d #faf5ff #ffffff #2e1065 #6b5b8a #e9d5ff - - #ffffff #2e1065"),paletteDark:F("#c084fc - #f472b6 #12081f #1c1030 #f3e8ff #b4a3cf #3b2559 - - #12081f #f3e8ff"),typography:{font:"nunito",headingFont:"nunito",headingWeight:800},shape:{radius:24,controlRadius:14},buttons:{socialLayout:"grid"},background:{pattern:"dots"},backgroundDark:{pattern:"dots"}}},slate:{design:{palette:F("#334155 - #0369a1 #f1f5f9 #ffffff #0f172a #64748b #cbd5e1 - - #f8fafc #0f172a"),paletteDark:F("#cbd5e1 - #38bdf8 #0f172a #1e293b #f1f5f9 #94a3b8 #334155 - - #0f172a #f1f5f9"),typography:{font:"work-sans",headingFont:"work-sans"},shape:{radius:8,controlRadius:6},elevation:{cardShadow:"sm"},spacing:{density:"compact"},inputs:{style:"filled"}}},"split-photo":{design:{layout:{position:"split",splitImageSide:"left",logoPlacement:"page"},card:{style:"none",width:"normal"},elevation:{cardShadow:"none"},shape:{radius:0,controlRadius:8},background:{gradient:{type:"linear",angle:135,stops:[{color:"#0f172a",at:0},{color:"#334155",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:135,stops:[{color:"#020617",at:0},{color:"#1e293b",at:100}]}}}},bold:{design:{palette:F("#4338ca - #ca8a04 #4338ca #ffffff #111827 #4b5563 #e5e7eb - - #ffffff #111827"),paletteDark:F("#a5b4fc - #facc15 #1e1b4b #111827 #f9fafb #cbd5e1 #374151 - - #0b1120 #f9fafb"),typography:{font:"montserrat",headingFont:"montserrat",baseSize:17,headingWeight:800,letterCase:"uppercase",scale:"octave"},shape:{radius:24,controlRadius:999,borderWidth:0},elevation:{cardShadow:"xl"},spacing:{density:"spacious"},card:{width:"wide"}}}};var ve=(e,t,n)=>Math.min(n,Math.max(t,e));function _e(e){if(!e||typeof e!="string")return null;let t=e.trim().toLowerCase();if(t==="transparent")return{r:0,g:0,b:0,a:0};let n=/^#([0-9a-f]{3,8})$/.exec(t);if(n){let i=n[1];if((i.length===3||i.length===4)&&(i=[...i].map(d=>d+d).join("")),i.length!==6&&i.length!==8)return null;let c=d=>parseInt(i.slice(d,d+2),16);return{r:c(0),g:c(2),b:c(4),a:i.length===8?c(6)/255:1}}let r=/^rgba?\(([^)]+)\)$/.exec(t);if(!r)return null;let o=r[1].replace("/"," ").split(/[\s,]+/).filter(Boolean);if(o.length<3)return null;let a=i=>i.endsWith("%")?parseFloat(i)/100*255:parseFloat(i),s=i=>i===void 0?1:i.endsWith("%")?parseFloat(i)/100:parseFloat(i),l={r:ve(a(o[0]),0,255),g:ve(a(o[1]),0,255),b:ve(a(o[2]),0,255),a:ve(s(o[3]),0,1)};return[l.r,l.g,l.b,l.a].some(Number.isNaN)?null:l}var yt=e=>ve(Math.round(e),0,255).toString(16).padStart(2,"0");function vt(e){return`#${yt(e.r)}${yt(e.g)}${yt(e.b)}`}function ki(e){let t=n=>{let r=n/255;return r<=.03928?r/12.92:((r+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function kt(e){let t=_e(e);return t?ki(t):null}function Ue(e,t){let n=kt(e),r=kt(t);if(n===null||r===null)return 1;let o=Math.max(n,r),a=Math.min(n,r);return(o+.05)/(a+.05)}var vi=4.5,_i=3;function Ao(e){var t;return((t=kt(e))!=null?t:0)>.179?"#111827":"#ffffff"}function xi(e,t,n){let r=e/255,o=t/255,a=n/255,s=Math.max(r,o,a),l=Math.min(r,o,a),i=(s+l)/2;if(s===l)return[0,0,i];let c=s-l,d=i>.5?c/(2-s-l):c/(s+l);return[s===r?((o-a)/c+(o<a?6:0))/6:s===o?((a-r)/c+2)/6:((r-o)/c+4)/6,d,i]}function Si(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,a=l=>{let i=l;return i<0&&(i+=1),i>1&&(i-=1),i<1/6?o+(r-o)*6*i:i<1/2?r:i<2/3?o+(r-o)*(2/3-i)*6:o};return`#${(t===0?[n,n,n]:[a(e+1/3),a(e),a(e-1/3)]).map(l=>yt(ve(l,0,1)*255)).join("")}`}function wi(e,t,n=vi){var u;let r=_e(e);if(!r||t.length===0)return e;let o=f=>t.every(p=>Ue(f,p)>=n);if(o(e))return e;let s=((u=kt(t[0]))!=null?u:1)>.179?-.01:.01,[l,i,c]=xi(r.r,r.g,r.b),d=e;for(let f=1;f<=100;f+=1){let p=c+s*f;if(p<0||p>1)break;if(d=Si(l,i,p),o(d))return d}return d}function Ro(e,t){return wi(e,t,_i)}var Ci=["primary","accent","danger","success"],ae=e=>JSON.parse(JSON.stringify(e));function To(e){if(!e||typeof e!="object"||Array.isArray(e))return{};if(xo(e))return ae(e);let t={};for(let[n,r]of Object.entries(e))r!==void 0&&_o(n,r)&&(t[n]=ae(r));return t}function Po(e,t){if(!t)return e;let n={...e};for(let[r,o]of Object.entries(t))o!==void 0&&(n[r]=o);return t.primary&&!t.primaryInk&&(n.primaryInk=Ao(t.primary)),n}function Sn(e,t,n){var a,s,l;t.colorScheme&&(e.colorScheme=t.colorScheme);let r=e.palette;e.palette=Po(e.palette,t.palette);let o=t.paletteDark?{...t.paletteDark}:void 0;if(n.carryBrand&&t.palette){for(let i of Ci){let c=t.palette[i];c&&c!==r[i]&&!((a=t.paletteDark)!=null&&a[i])&&(o={...o!=null?o:{},[i]:c})}t.palette.primaryInk&&!((s=t.paletteDark)!=null&&s.primaryInk)&&(o!=null&&o.primary)&&(o.primaryInk=t.palette.primaryInk)}if(e.paletteDark=Po(e.paletteDark,o),t.typography){let i=t.typography;e.typography={...e.typography,...oe(i),headingFont:(l=i.headingFont)!=null?l:i.font?i.font:e.typography.headingFont}}if(t.shape&&(e.shape={...e.shape,...oe(t.shape)}),t.elevation&&(e.elevation={...e.elevation,...oe(t.elevation)}),t.spacing&&(e.spacing={...e.spacing,...oe(t.spacing)}),t.card&&(e.card={...e.card,...oe(t.card)}),t.layout&&(e.layout={...e.layout,...oe(t.layout)}),t.buttons&&(e.buttons={...e.buttons,...oe(t.buttons)}),t.inputs&&(e.inputs={...e.inputs,...oe(t.inputs)}),t.background&&(e.background=ae(t.background)),t.backgroundDark)e.backgroundDark=ae(t.backgroundDark);else if(t.background&&n.carryBrand){let i={};t.background.gradient&&(i.gradient=ae(t.background.gradient)),t.background.image&&(i.image=ae(t.background.image)),t.background.pattern&&(i.pattern=t.background.pattern),e.backgroundDark=i}t.logo&&(e.logo=ae(t.logo))}function oe(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function wn(e){return typeof e=="string"&&ht.includes(e)}function ze(e){let t=To(e),n=wn(t.preset)?t.preset:"minimal",r=ae(Co);return r.preset=n,Sn(r,Eo[n].design,{carryBrand:!1}),Sn(r,t,{carryBrand:!0}),r}function Io(e,t){let n=ze(e),r=To(t);return delete r.preset,Sn(n,r,{carryBrand:!0}),n}function Cn(e){var o,a,s,l,i,c,d,u,f,p,m,b,y,E;let t=(C,k,S)=>typeof k=="string"&&C.includes(k)?k:S,n=(o=e==null?void 0:e.background)!=null?o:{},r={"data-atlas-layout":t(ct,(a=e==null?void 0:e.layout)==null?void 0:a.position,"center"),"data-atlas-split-side":t(dt,(s=e==null?void 0:e.layout)==null?void 0:s.splitImageSide,"left"),"data-atlas-logo":t(ut,(l=e==null?void 0:e.layout)==null?void 0:l.logoPlacement,"card"),"data-atlas-logo-size":t(pt,(i=e==null?void 0:e.layout)==null?void 0:i.logoSize,"md"),"data-atlas-card":t(it,(c=e==null?void 0:e.card)==null?void 0:c.style,"solid"),"data-atlas-card-width":t(lt,(d=e==null?void 0:e.card)==null?void 0:d.width,"normal"),"data-atlas-shadow":t(at,(u=e==null?void 0:e.elevation)==null?void 0:u.cardShadow,"md"),"data-atlas-density":t(st,(f=e==null?void 0:e.spacing)==null?void 0:f.density,"comfortable"),"data-atlas-button":t(ft,(p=e==null?void 0:e.buttons)==null?void 0:p.style,"solid"),"data-atlas-social":t(gt,(m=e==null?void 0:e.buttons)==null?void 0:m.socialLayout,"list"),"data-atlas-input":t(mt,(b=e==null?void 0:e.inputs)==null?void 0:b.style,"outline"),"data-atlas-pattern":t(De,n.pattern,"none"),"data-atlas-pattern-dark":t(De,(y=e==null?void 0:e.backgroundDark)==null?void 0:y.pattern,"none"),"data-atlas-letter-case":t(ot,(E=e==null?void 0:e.typography)==null?void 0:E.letterCase,"none")};return((e==null?void 0:e.colorScheme)==="dark"||(e==null?void 0:e.colorScheme)==="light")&&(r["data-atlas-theme"]=e.colorScheme),r}function Oo(e){var n,r;let t=new Set;for(let o of[(n=e==null?void 0:e.typography)==null?void 0:n.font,(r=e==null?void 0:e.typography)==null?void 0:r.headingFont]){let a=yo(o);a&&t.add(a)}return[...t]}function En(){try{return typeof process!="undefined"&&!1}catch{return!1}}var Do=e=>{En()&&console.warn(`[atlas] ${e}`)},Lo=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Ei(e,t=Do,n="design"){return e!=null&&(typeof e!="object"||Array.isArray(e))?(t(`${n} must be an object; ignored.`),{}):So(e,r=>t(r.message==="Unknown setting."&&r.path.split(".").length===n.split(".").length+1?`${r.path} is not a design setting; ignored.`:`${r.path} is invalid; ignored.`),n)}function Fo(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t.toString(36)}var Ai=/^(?:https:\/\/[A-Za-z0-9.-]+(?::\d{1,5})?|http:\/\/(?:localhost|127\.0\.0\.1)(?::\d{1,5})?)$/;function Ri(e,t){let n=(t!=null?t:"").replace(/\/+$/,"");return n&&!Ai.test(n)?[]:Oo(e).map(r=>`${n}${r}`)}function Pi(e){if(!(!Lo(e)||!Lo(e.resolved)))return e.resolved}function Mo(e){var c,d,u;let t=(c=e.warn)!=null?c:Do,n=Pi(e.instance),r=Ei(e.design,t,"appearance.design"),o,a=(d=e.preset)!=null?d:r.preset;a!==void 0&&(wn(a)?o=a:t(`appearance.preset "${String(a)}" is not a preset; ignored.`));let s=o!==void 0||Object.keys(r).some(f=>f!=="preset");if(!n&&!s)return null;let l=o?ze({preset:o}):n?ze(n):ze({}),i=xn((u=e.tokensDesign)!=null?u:{},r);return Io(l,i)}function Uo(e,t){return Ri(e,t)}var zo=new Set,No=e=>{var t;!En()||zo.has(e)||(zo.add(e),(t=globalThis.console)==null||t.warn(`[atlas] ${e}`))};function $o(e){var r,o;if(!e||typeof e!="object")return null;let t=e,n=(o=t.design)!=null?o:(r=t.appearance)==null?void 0:r.design;return n&&typeof n=="object"&&n.resolved?n:null}function Bo(e,t,n,r){var o,a;for(let s of(o=r==null?void 0:r.attributes)!=null?o:[])s in n.attributes||t.removeAttribute(s);for(let s of(a=r==null?void 0:r.style)!=null?a:[])s in n.style||t.style.removeProperty(s);for(let[s,l]of Object.entries(n.style))t.style.setProperty(s,l);for(let[s,l]of Object.entries(n.attributes))t.setAttribute(s,l);if(n.css&&!Array.from(e.head.querySelectorAll("style[data-atlas-design]")).some(l=>l.getAttribute("data-atlas-design")===n.key)){let l=e.createElement("style");l.setAttribute("data-atlas-design",n.key),l.textContent=n.css,e.head.appendChild(l)}if(n.fontStylesheets.length){let s=new Set(Array.from(e.head.querySelectorAll("link[data-atlas-font]")).map(l=>l.getAttribute("href")));for(let l of n.fontStylesheets){if(s.has(l))continue;let i=e.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("href",l),i.setAttribute("data-atlas-font",""),e.head.appendChild(i)}}return{attributes:Object.keys(n.attributes),style:Object.keys(n.style)}}var Ti=["boxes","single"];function Ho(e,t){for(let n of[t,e])if(n&&Ti.includes(n))return n;return"boxes"}var jo=8,Ii=["solid","outline","soft","ghost"],Oi=["none","scale","lift","glow","ripple"],Li=["none","sm","md","lg"],Di=["comfortable","compact"],Fi=["outline","filled","underline"],Mi=["slow","normal","fast"],Ui=["spinner","skeleton","dots","bar"],Ko={slow:280,normal:160,fast:80};function _t(e,t){let n=(r,o,...a)=>{for(let s of a)if(s!==void 0&&r.includes(s))return s;return o};return{buttonStyle:n(Ii,"solid",t==null?void 0:t.buttonStyle,e==null?void 0:e.buttonStyle),buttonEffect:n(Oi,"scale",t==null?void 0:t.buttonEffect,e==null?void 0:e.buttonEffect),shadow:n(Li,"md",t==null?void 0:t.shadow,e==null?void 0:e.shadow),density:n(Di,"comfortable",t==null?void 0:t.density,e==null?void 0:e.density),inputStyle:n(Fi,"outline",t==null?void 0:t.inputStyle,e==null?void 0:e.inputStyle),animations:typeof(t==null?void 0:t.animations)=="boolean"?t.animations:typeof(e==null?void 0:e.animations)=="boolean"?e.animations:!0,motionSpeed:n(Mi,"normal",t==null?void 0:t.motionSpeed,e==null?void 0:e.motionSpeed),loading:n(Ui,"spinner",t==null?void 0:t.loading,e==null?void 0:e.loading)}}var zi=["block","compact","icon"],Ni=["sm","md","lg"],$i=["list","grid","carousel"],Bi=["auto","always","never"];function An(e,t){var r,o,a;let n=(s,...l)=>{for(let i of l)if(i!==void 0&&s.includes(i))return i;return s[0]};return{variant:n(zi,t==null?void 0:t.variant,e==null?void 0:e.variant),size:n(Ni,(r=t==null?void 0:t.size)!=null?r:"md",e==null?void 0:e.size,"md"),layout:n($i,t==null?void 0:t.layout,e==null?void 0:e.layout),labels:{...(o=e==null?void 0:e.labels)!=null?o:{},...(a=t==null?void 0:t.labels)!=null?a:{}},search:n(Bi,t==null?void 0:t.search,e==null?void 0:e.search)}}var J={colorPrimary:"#5b5bd6",colorText:"#1c1c1f",colorBackground:"#ffffff",colorAccent:"#5b5bd6",colorCard:"#ffffff",colorBorder:"#e4e4e9",borderRadius:"10px",fontFamily:'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'};function Wi(e){return e?{colorPrimary:e.colorPrimary||J.colorPrimary,colorText:e.colorText||J.colorText,colorBackground:e.colorBackground||J.colorBackground,colorAccent:e.colorAccent||e.colorPrimary||J.colorAccent,colorCard:e.colorCard||e.colorBackground||J.colorCard,colorBorder:e.colorBorder||J.colorBorder,borderRadius:e.borderRadius||J.borderRadius,fontFamily:e.fontStack||J.fontFamily}:J}function Go(e,t){var o;let n={...Wi(e)},r=(o=t==null?void 0:t.variables)!=null?o:{};for(let[a,s]of Object.entries(r))s!==void 0&&(n[a]=s);return n}function qo(e){let t={};for(let[n,r]of Object.entries(e))t[`--atlas-embed-${n.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}`]=r;return t}function Vo(e){let t=_e(e);if(!t)return"#ffffff";let n=vt(t);return Ue("#ffffff",n)>=Ue("#111111",n)?"#ffffff":"#111111"}function Yo(e,t){let n=_e(e);if(!n)return e;let r=vt(n),o=t.map(a=>_e(a)).filter(a=>!!a&&a.a>0).map(vt);return o.length===0||o.every(a=>Ue(r,a)>=3)?e:Ro(r,o)}function Jo(e,t,n){var o;let r=(o=n==null?void 0:n.elements)==null?void 0:o[e];return r?`${t} ${r}`:t}function Zo(e,t){var s,l;let n=(s=t==null?void 0:t.providerOrder)!=null?s:[],r=new Set((l=t==null?void 0:t.providerHidden)!=null?l:[]),o=new Set(e.filter(i=>!r.has(i))),a=[];for(let i of n)o.has(i)&&!a.includes(i)&&a.push(i);for(let i of e)o.has(i)&&!a.includes(i)&&a.push(i);return a}var Wo={google:"Google",github:"GitHub",gitlab:"GitLab",facebook:"Facebook",apple:"Apple",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",twitter:"X",twitter_v1:"X",x:"X",slack:"Slack",spotify:"Spotify",twitch:"Twitch",notion:"Notion",linear:"Linear",steam:"Steam"};function xt(e){return Wo[e]?Wo[e]:e.split(/[_-]/).map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}var Hi="0.9.0",Xo={name:"@atlasauth/embed",version:Hi};function ji(e,t){return(n,r)=>{let o=typeof n=="string"?n:n.toString(),a;try{a=new URL(o)}catch{return t(n,r)}return a.searchParams.has("publishable_key")||a.searchParams.set("publishable_key",e),t(a.toString(),r)}}function Qo(e){var n;let t=(n=e.fetchImpl)!=null?n:fetch;return new Ye({publishableKey:e.publishableKey,baseUrl:e.frontendApi.replace(/\/$/,""),fetchImpl:ji(e.publishableKey,t),locale:e.locale,sdk:Xo,referral:e.referral,referralConsent:e.referralConsent})}async function ea(e){let t=await e.get("/v1/appearance");return t.ok?t.data:null}var ta="atlas-embed-styles",Ki=`
15
+ };`;async function si(e,t={}){var s,a,l,i;let n=(s=t.cancelled)!=null?s:()=>!1,r=globalThis;if(t.workers!==!1&&r.Worker&&r.Blob&&((a=r.URL)!=null&&a.createObjectURL)){let c=await ai(e,Math.max(1,Math.min(4,(i=(l=r.navigator)==null?void 0:l.hardwareConcurrency)!=null?i:2)),n).catch(()=>{});if(c!==void 0){if(c===null)throw new Error("captcha: no solution");return{n:c,worker:!0}}}let o=await ri(e,0,e.maxnumber,n);if(o===null)throw new Error(n()?"captcha: cancelled":"captcha: no solution");return{n:o,worker:!1}}function ai(e,t,n){let r=URL.createObjectURL(new Blob([oi],{type:"text/javascript"})),o=[],s=()=>{for(let a of o)a.terminate();URL.revokeObjectURL(r)};return new Promise((a,l)=>{let i=t,c=Math.ceil((e.maxnumber+1)/t),d=setInterval(()=>{n()&&(clearInterval(d),s(),a(null))},100),u=f=>{clearInterval(d),s(),f instanceof Error?l(f):a(f)};try{for(let f=0;f<t;f++){let p=new Worker(r);o.push(p),p.onmessage=b=>{var y;typeof((y=b.data)==null?void 0:y.n)=="number"?u(b.data.n):--i===0&&u(null)},p.onerror=()=>u(new Error("captcha: worker failed"));let m=f*c;p.postMessage({salt:e.salt,challenge:e.challenge,from:m,to:Math.min(e.maxnumber,m+c-1)})}}catch(f){u(f instanceof Error?f:new Error("captcha: worker failed"))}})}var ii=e=>{let t=new TextEncoder().encode(e),n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")};function li(e){return`atlas1.${ii(JSON.stringify(e))}`}async function ci(e,t=!1){let n=t?`${e}${e.includes("?")?"&":"?"}accessible=true`:e,r=await fetch(n,{method:"GET",credentials:"omit"});if(!r.ok)throw new Error(`captcha: challenge refused (${r.status})`);return await r.json()}function eo(e,t){let n=e.createElement("img");return n.src=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(t)))}`,n.alt="",n.width=64,n.height=64,n.style.cssText="display:block;width:64px;height:64px;border-radius:6px",n}function di(e,t,n,r){let o=e.ownerDocument;return new Promise((s,a)=>{e.replaceChildren();let l=o.createElement("div");l.setAttribute("role","group"),l.setAttribute("data-atlas-captcha-puzzle",""),l.style.cssText="display:flex;flex-direction:column;align-items:center;gap:8px";let i=o.createElement("p");i.style.cssText="margin:0;font-size:13px;text-align:center",i.textContent=n.puzzlePrompt,l.append(i,eo(o,t.interactive.example));let c=o.createElement("div");c.style.cssText="display:grid;grid-template-columns:repeat(3,72px);gap:6px";let d=0;t.interactive.tiles.forEach((f,p)=>{let m=o.createElement("button");m.type="button",m.setAttribute("aria-pressed","false"),m.setAttribute("aria-label",n.tile.replace("{n}",String(p+1))),m.setAttribute("data-atlas-captcha-tile",String(p)),m.style.cssText="padding:3px;border:2px solid transparent;border-radius:8px;background:none;cursor:pointer",m.append(eo(o,f)),m.addEventListener("click",()=>{d^=1<<p;let b=(d&1<<p)!==0;m.setAttribute("aria-pressed",b?"true":"false"),m.style.borderColor=b?"currentColor":"transparent"}),c.append(m)});let u=o.createElement("button");if(u.type="button",u.setAttribute("data-atlas-captcha-confirm",""),u.textContent=n.confirm,u.addEventListener("click",()=>r()?a(new Error("captcha: widget removed")):s(d)),l.append(c,u),t.accessible_alternative){let f=o.createElement("button");f.type="button",f.setAttribute("data-atlas-captcha-alternative",""),f.style.cssText="font-size:12px;background:none;border:0;text-decoration:underline;cursor:pointer",f.textContent=n.alternative,f.addEventListener("click",()=>s("accessible")),l.append(f)}e.append(l)})}function rn(e,t){var p,m;let n={...ei,...t.labels},r=(p=t.mode)!=null?p:"managed",o=e.ownerDocument,s=(m=t.fetchChallenge)!=null?m:b=>t.challengeUrl?ci(t.challengeUrl,b):Promise.reject(new Error("captcha: no challenge URL")),a=!1,l=0,i=()=>a,c=o.createElement("div");c.setAttribute("role","status"),c.setAttribute("aria-live","polite"),c.setAttribute("data-atlas-captcha-provider","atlas"),c.style.cssText="font-size:13px;opacity:.85;text-align:center",e.append(c);let d=b=>{c.replaceChildren(),c.textContent=b},u=async b=>{let y=await s(b);if(a)throw new Error("captcha: widget removed");l=Date.parse(y.expires_at)||0,(r==="visible"||y.interactive)&&d(n.checking);let A=Date.now(),E=si(y,{workers:t.workers,cancelled:i}).then(w=>({...w,ms:Date.now()-A}));E.catch(()=>{});let v;if(y.interactive){let w=await di(c,y,n,i);if(w==="accessible")return d(n.checking),u(!0);v=w,d(n.checking)}let{n:C,worker:x,ms:k}=await E;if(a)throw new Error("captcha: widget removed");return(r==="visible"||v!==void 0)&&d(n.verified),li({t:y.token,n:C,ms:k,...x?{w:1}:{},...v!==void 0?{sel:v}:{}})},f=u(!1);return f.catch(()=>{}),{token:f,stale:()=>l>0&&Date.now()>l-15e3,remove(){a=!0,c.remove()}}}var ui=new Set(["atlas","turnstile","hcaptcha","recaptcha","recaptcha_v3","recaptcha_enterprise","captchafox","vercel_botid"]);function Oe(e,t){return!e||!ui.has(e)?!1:e==="vercel_botid"?!!(t!=null&&t.attestationUrl):!0}function ye(e){return!!e&&e.enabled===!0&&Oe(e.provider,e)}var pi=["CAPTCHA_REQUIRED","CAPTCHA_FAILED"];function on(e){return!!e&&typeof e.code=="string"&&pi.includes(e.code)}var fi={turnstile:{src:()=>"https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",global:"turnstile"},hcaptcha:{src:()=>"https://js.hcaptcha.com/1/api.js?render=explicit",global:"hcaptcha"},recaptcha:{src:()=>"https://www.google.com/recaptcha/api.js?render=explicit",global:"grecaptcha"},recaptcha_v3:{src:e=>`https://www.google.com/recaptcha/api.js?render=${encodeURIComponent(e)}`,global:"grecaptcha"},recaptcha_enterprise:{src:e=>`https://www.google.com/recaptcha/enterprise.js?render=${encodeURIComponent(e)}`,global:"grecaptcha"},captchafox:{src:()=>"https://cdn.captchafox.com/api.js?render=explicit",global:"captchafox"}};function to(e,t,n){let r=fi[e];if(!r)return Promise.reject(new Error(`captcha: ${e} is not renderable`));if(n[r.global])return Promise.resolve(n[r.global]);let o=n.document,s=`__atlasCaptchaLoad_${e}`,a=n[s];if(a)return a;let l=new Promise((i,c)=>{var p,m;let d=()=>{n[r.global]?i(n[r.global]):c(new Error(`captcha: ${e} script loaded but global missing`))},u=r.src(t),f=o.querySelector(`script[src="${u}"]`);if(f){if(n[r.global])return i(n[r.global]);f.addEventListener("load",d,{once:!0}),f.addEventListener("error",()=>c(new Error(`captcha: ${e} script failed`)),{once:!0});return}f=o.createElement("script"),f.src=u,f.async=!0,f.defer=!0,f.addEventListener("load",d,{once:!0}),f.addEventListener("error",()=>c(new Error(`captcha: ${e} script failed`)),{once:!0}),((m=(p=o.head)!=null?p:o.body)!=null?m:o.documentElement).appendChild(f)});return n[s]=l,l.catch(()=>{n[s]===l&&delete n[s]}),l}function gi(e,t,n,r,o){return new Promise((s,a)=>{let l=e.render(t,{sitekey:n,appearance:r==="invisible"?"interaction-only":"always",callback:i=>s(i),"error-callback":()=>a(new Error("captcha: turnstile error")),"timeout-callback":()=>a(new Error("captcha: turnstile timeout"))});o(()=>{var i;return(i=e.remove)==null?void 0:i.call(e,l)}),r==="invisible"&&e.execute&&e.execute(l)})}function mi(e,t,n,r,o){return new Promise((s,a)=>{let l=e.render(t,{sitekey:n,size:r==="invisible"?"invisible":"normal",callback:i=>s(i),"error-callback":()=>a(new Error("captcha: hcaptcha error"))});if(o(()=>{var i;return(i=e.remove)==null?void 0:i.call(e,l)}),r==="invisible"){let i=e.execute(l,{async:!0});i&&typeof i.then=="function"&&i.then(c=>s(c.response),a)}})}function hi(e,t,n,r,o){return new Promise((s,a)=>{let l=e.render(t,{sitekey:n,size:r==="invisible"?"invisible":"normal",callback:i=>s(i),"error-callback":()=>a(new Error("captcha: recaptcha error"))});if(o(()=>{var i;return(i=e.reset)==null?void 0:i.call(e,l)}),r==="invisible"&&e.execute){let i=e.execute(void 0,{widgetId:l});i&&typeof i.then=="function"&&i.then(s,a)}})}function bi(e,t,n,r,o){return new Promise((s,a)=>{let l=()=>a(new Error("captcha: captchafox error"));Promise.resolve(e.render(t,{sitekey:n,mode:r==="invisible"?"hidden":"inline",onVerify:i=>s(i),onError:l,onFail:l})).then(i=>{o(()=>{var c;return(c=e.remove)==null?void 0:c.call(e,i)}),r==="invisible"&&e.execute&&Promise.resolve(e.execute(i)).then(c=>{typeof c=="string"&&c&&s(c)},l)},l)})}async function no(e,t=globalThis.fetch){let n=await t(e,{method:"POST",credentials:"same-origin",headers:{accept:"application/json"}});if(!n.ok)throw new Error(`captcha: BotID attestation route answered ${n.status}`);let r=await n.json();if(typeof r.token!="string"||!r.token)throw new Error("captcha: BotID attestation missing");return r.token}function yi(e,t){let n=()=>{let r=e.execute(t,{action:"submit"});return r&&typeof r.then=="function"?r:Promise.reject(new Error("captcha: recaptcha v3 execute returned no promise"))};return new Promise((r,o)=>{e.ready?e.ready(()=>n().then(r,o)):n().then(r,o)})}function ro(e,t,n={}){var f,p,m,b,y,A,E,v,C;let r=(f=e.provider)!=null?f:"";if(r==="atlas")return rn(t,{challengeUrl:e.challengeUrl,mode:(p=e.widget)!=null?p:"managed",...n.atlas});if(r==="vercel_botid"){let x=!1,k=(b=(m=t.ownerDocument)==null?void 0:m.defaultView)!=null?b:globalThis,w=e.attestationUrl?no(e.attestationUrl,(y=k.fetch)==null?void 0:y.bind(k)).then(S=>{if(x)throw new Error("captcha: widget removed");return S}):Promise.reject(new Error("captcha: vercel_botid needs an attestationUrl"));return w.catch(()=>{}),{token:w,remove(){x=!0}}}let o=(A=e.siteKey)!=null?A:"",s=(E=e.widget)!=null?E:"managed",a=(C=(v=t.ownerDocument)==null?void 0:v.defaultView)!=null?C:globalThis,l=!1,i=null,c=null,d=x=>{i=x};return{token:new Promise((x,k)=>{c=k,to(r,o,a).then(w=>{if(l)throw new Error("captcha: widget removed");switch(r){case"turnstile":return gi(w,t,o,s,d);case"hcaptcha":return mi(w,t,o,s,d);case"recaptcha":return hi(w,t,o,s,d);case"recaptcha_v3":case"recaptcha_enterprise":return yi(w,o);case"captchafox":return bi(w,t,o,s,d);default:throw new Error(`captcha: ${r} is not renderable`)}}).then(x,k)}),remove(){if(!l){l=!0;try{i==null||i()}catch{}for(;t.firstChild;)t.removeChild(t.firstChild);c==null||c(new Error("captcha: widget removed"))}}}}async function sn(e,t,n){return ro(e,t,n).token}var ki="/v1/client/sign_ins/passkey/begin",oo=async(e,t)=>{try{return await e(t)||null}catch{return null}};async function an(e,t={}){var i;let n=c=>e.post(ki,c?{captcha_token:c}:{}),r=(i=t.captcha)!=null?i:null,o=r?await oo(r,{retry:!1}):null,s=await n(o);if(s.ok||!r)return s;let a=s.errors.find(c=>on(c));if(!a)return s;let l=await oo(r,{retry:!0,refused:a.code==="CAPTCHA_FAILED"?"CAPTCHA_FAILED":"CAPTCHA_REQUIRED"});return l?n(l):s}var Le={attempt:null,errors:[],busy:!1,ticket:null};async function so(e,t,n){let r=await e.post("/v1/client/password_resets",{email_address:t,captcha_token:n});return!r.ok||!r.data?{...Le,errors:r.errors}:{attempt:r.data,errors:[],busy:!1,ticket:null}}async function ao(e,t,n){var l,i,c,d;let r=t.attempt;if(!r)return t;let o=null,s={};switch(r.status){case"needs_email_verification":o=`/v1/client/password_resets/${r.id}/attempt_verification`,s={code:(l=n.code)!=null?l:""};break;case"needs_second_factor":o=`/v1/client/password_resets/${r.id}/attempt_second_factor`,s={code:(i=n.code)!=null?i:""};break;case"needs_new_password":o=`/v1/client/password_resets/${r.id}/set_new_password`,s={password:(c=n.password)!=null?c:""};break;default:return t}let a=await e.post(o,s);return!a.ok||!a.data?{...t,busy:!1,errors:a.errors}:{attempt:{id:a.data.id,status:a.data.status},errors:[],busy:!1,ticket:(d=a.data.ticket)!=null?d:null}}function ke(e){var n;let t=(n=e.attempt)==null?void 0:n.status;if(!t)return"request";switch(t){case"needs_email_verification":return"collect_email_code";case"needs_second_factor":return"collect_second_factor";case"needs_new_password":return"collect_new_password";case"complete":return"done";default:return"unknown"}}async function io(e,t){let n=t.attempt;if(!(n!=null&&n.poll_secret))return t;let r=await e.get(`/v1/client/password_resets/${n.id}?poll_secret=${encodeURIComponent(n.poll_secret)}`);return!r.ok||!r.data?t:{...t,attempt:{id:r.data.id,status:r.data.status,poll_secret:n.poll_secret}}}var ld=Object.freeze({available:!0,passwordReset:!0,passwordSignUp:!0}),co="This app can't send email right now. Try another sign-in method or contact the app owner.";var De=e=>!!e&&typeof e=="object"&&!Array.isArray(e);var ln=Object.freeze({username:null,lastSignInMethod:!1,emailVerification:"code",passwordReset:"code",emailSecondFactor:!1,passkeySignUp:null}),lo=e=>e==="link"||e==="both"?e:"code";function cn(e){var o;let t=De(e)&&De(e.account)?e.account:null;if(!t)return{...ln};let n=De(t.username)?t.username:null,r=(s,a)=>typeof s=="number"&&Number.isInteger(s)?s:a;return{username:n?{minLength:r(n.min_length,3),maxLength:r(n.max_length,30),charset:n.charset==="alphanumeric"||n.charset==="alphanumeric_underscore"?n.charset:"default",requiredAtSignUp:n.required_at_sign_up===!0}:null,lastSignInMethod:t.last_sign_in_method===!0,emailVerification:lo(t.email_verification),passwordReset:lo(t.password_reset),emailSecondFactor:t.email_second_factor===!0,...De(t.mfa)?{mfa:{totp:t.mfa.totp!==!1,sms:t.mfa.sms===!0,totpCodes:Number((o=t.mfa.totp_codes)!=null?o:t.mfa.totpCodes)>=2?2:1}}:{},passkeySignUp:De(t.passkey_sign_up)?{email:t.passkey_sign_up.email==="off"||t.passkey_sign_up.email==="optional"?t.passkey_sign_up.email:"required"}:null}}function uo(e){let t={...e};for(let n of["signUp","signIn"]){let r=t[n];r&&r.provider&&!r.enabled&&(t[n]={...r,enabled:!0})}return t}var ne=ea(go());var mo=["auto","light","dark"],de=["primary","primaryInk","accent","background","surface","text","muted","border","danger","success","inputBackground","inputText"],ot=["none","uppercase"],ho={"minor-second":1.067,"major-second":1.125,"minor-third":1.2,"major-third":1.25,"perfect-fourth":1.333,"augmented-fourth":1.414,"perfect-fifth":1.5,golden:1.618,"minor-seventh":1.778,octave:2},bo=Object.keys(ho),st=["none","sm","md","lg","xl"],at=["compact","comfortable","spacious"],it=["solid","glass","outline","none"],lt=["narrow","normal","wide"],ct=["center","left","right","split"],dt=["left","right"],ut=["card","page","hidden"],pt=["sm","md","lg"],ft=["solid","outline","soft","gradient"],gt=["list","grid","icons"],mt=["outline","filled","underline"],yo=["linear","radial"],un=["cover","contain"],pn=["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"],Fe=["none","dots","grid","noise"],ht=["minimal","atlas","glass","midnight","editorial","terminal","sunrise","forest","grape","slate","split-photo","bold"],fn=/^#[0-9a-fA-F]{6}$/,gn=/^dasset_[0-9A-HJKMNP-TV-Z]{26}$/;var W="system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",bt="Georgia, Cambria, 'Times New Roman', Times, serif",mn="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",H="wght@400;500;600;700;800",ko=[{id:"system",label:"System UI",family:null,category:"sans-serif",fallback:`-apple-system, BlinkMacSystemFont, ${W}`,google:null},{id:"system-serif",label:"System serif (Georgia)",family:null,category:"serif",fallback:bt,google:null},{id:"system-mono",label:"System monospace",family:null,category:"monospace",fallback:mn,google:null},{id:"inter",label:"Inter",family:"Inter",category:"sans-serif",fallback:W,google:`Inter:${H}`},{id:"roboto",label:"Roboto",family:"Roboto",category:"sans-serif",fallback:W,google:"Roboto:wght@400;500;700;800"},{id:"open-sans",label:"Open Sans",family:"Open Sans",category:"sans-serif",fallback:W,google:`Open+Sans:${H}`},{id:"lato",label:"Lato",family:"Lato",category:"sans-serif",fallback:W,google:"Lato:wght@400;700;900"},{id:"montserrat",label:"Montserrat",family:"Montserrat",category:"sans-serif",fallback:W,google:`Montserrat:${H}`},{id:"poppins",label:"Poppins",family:"Poppins",category:"sans-serif",fallback:W,google:`Poppins:${H}`},{id:"nunito",label:"Nunito",family:"Nunito",category:"sans-serif",fallback:W,google:`Nunito:${H}`},{id:"work-sans",label:"Work Sans",family:"Work Sans",category:"sans-serif",fallback:W,google:`Work+Sans:${H}`},{id:"dm-sans",label:"DM Sans",family:"DM Sans",category:"sans-serif",fallback:W,google:`DM+Sans:${H}`},{id:"manrope",label:"Manrope",family:"Manrope",category:"sans-serif",fallback:W,google:`Manrope:${H}`},{id:"source-serif",label:"Source Serif",family:"Source Serif 4",category:"serif",fallback:bt,google:`Source+Serif+4:${H}`},{id:"merriweather",label:"Merriweather",family:"Merriweather",category:"serif",fallback:bt,google:"Merriweather:wght@400;700;900"},{id:"playfair-display",label:"Playfair Display",family:"Playfair Display",category:"serif",fallback:bt,google:`Playfair+Display:${H}`},{id:"jetbrains-mono",label:"JetBrains Mono",family:"JetBrains Mono",category:"monospace",fallback:mn,google:`JetBrains+Mono:${H}`},{id:"ibm-plex-mono",label:"IBM Plex Mono",family:"IBM Plex Mono",category:"monospace",fallback:mn,google:"IBM+Plex+Mono:wght@400;500;600;700"}],vo=ko.map(e=>e.id),_o=new Map(ko.map(e=>[e.id,e]));function hn(e){return typeof e=="string"?_o.get(e):void 0}function bn(e){var n;let t=(n=hn(e))!=null?n:_o.get("system");return t.family?`'${t.family}', ${t.fallback}`:t.fallback}function xo(e){let t=hn(e);return t!=null&&t.google?`/v1/design/fonts/${t.id}.css`:null}var yn=e=>{if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},ue=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),M=e=>t=>typeof t=="string"&&e.includes(t),Y=(e,t,n=1)=>r=>typeof r=="number"&&Number.isInteger(r)&&r>=e&&r<=t&&r%n===0,So=(e,t)=>n=>typeof n=="number"&&!Number.isNaN(n)&&n>=e&&n<=t,Me=e=>typeof e=="string"&&fn.test(e),kn=e=>typeof e=="string"&&gn.test(e);function re(e,t=[]){return n=>{if(!yn(n))return!1;for(let r of Object.keys(n)){if(!ue(e,r))return!1;let o=n[r];if(o===void 0){if(t.includes(r))return!1;continue}if(!e[r](o))return!1}return t.every(r=>ue(n,r)&&n[r]!==void 0)}}var wo=M(vo),vn={palette:Object.fromEntries(de.map(e=>[e,Me])),paletteDark:Object.fromEntries(de.map(e=>[e,Me])),typography:{font:wo,headingFont:wo,baseSize:Y(12,20),headingWeight:Y(400,800,100),bodyWeight:Y(300,600,100),letterCase:M(ot),scale:M(bo)},shape:{radius:Y(0,32),controlRadius:Y(0,999),borderWidth:Y(0,3)},elevation:{cardShadow:M(st)},spacing:{density:M(at)},card:{style:M(it),blur:Y(0,40),width:M(lt)},layout:{position:M(ct),splitImageSide:M(dt),logoPlacement:M(ut),logoSize:M(pt)},buttons:{style:M(ft),socialLayout:M(gt)},inputs:{style:M(mt)},logo:{assetId:kn,darkAssetId:kn}},Ci=e=>{if(!re({type:M(yo),angle:Y(0,360),stops:()=>!0},["type","stops"])(e))return!1;let t=e.stops;return Array.isArray(t)&&t.length>=2&&t.length<=4&&t.every(re({color:Me,at:So(0,100)},["color","at"]))},Ei=re({assetId:kn,fit:M(un),position:M(pn),overlay:re({color:Me,opacity:So(0,1)},["color","opacity"]),blur:Y(0,20)},["assetId"]),_n={color:Me,gradient:Ci,image:Ei,pattern:M(Fe)},Ue={version:e=>e===1,preset:M(ht),colorScheme:M(mo),background:re(_n),backgroundDark:re(_n),...Object.fromEntries(Object.entries(vn).map(([e,t])=>[e,re(t)]))};function Co(e,t){return ue(Ue,e)&&Ue[e](t)}var Eo=re(Ue);function Ao(e,t=()=>{},n=""){let r=(...s)=>[n,...s].filter(Boolean).join(".");if(e==null)return{};if(!yn(e))return t({path:n||"(root)",message:"must be an object"}),{};let o={};for(let[s,a]of Object.entries(e)){if(a===void 0)continue;if(!ue(Ue,s)){t({path:r(s),message:"Unknown setting."});continue}if(Ue[s](a)){o[s]=a;continue}let l=ue(vn,s)?vn[s]:s==="background"||s==="backgroundDark"?_n:null;if(!l||!yn(a)){t({path:r(s),message:"Invalid value."});continue}let i={};for(let[c,d]of Object.entries(a))d!==void 0&&(ue(l,c)&&l[c](d)?i[c]=d:t({path:r(s,c),message:ue(l,c)?"Invalid value.":"Unknown setting."}));Object.keys(i).length&&(o[s]=i)}return o}var Ai=new Set(["__proto__","constructor","prototype"]),Ro=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function xn(e,t){let n={...e};for(let[r,o]of Object.entries(t)){if(Ai.has(r)||o===void 0)continue;if(o===null){delete n[r];continue}let s=n[r];n[r]=Ro(s)&&Ro(o)?xn(s,o):o}return n}function F(e){let t=e.split(" ");if(t.length!==de.length)throw new Error(`palette spec needs ${de.length} slots: ${e}`);let n={};return t.forEach((r,o)=>{r!=="-"&&(n[de[o]]=r)}),n}var Po={version:1,preset:"minimal",colorScheme:"auto",palette:F("#18181b #ffffff #4f46e5 #fafafa #ffffff #18181b #71717a #e4e4e7 #dc2626 #15803d #ffffff #18181b"),paletteDark:F("#fafafa #18181b #818cf8 #09090b #18181b #fafafa #a1a1aa #3f3f46 #f87171 #4ade80 #09090b #fafafa"),typography:{font:"inter",headingFont:"inter",baseSize:15,headingWeight:600,bodyWeight:400,letterCase:"none",scale:"perfect-fourth"},shape:{radius:12,controlRadius:8,borderWidth:1},elevation:{cardShadow:"md"},spacing:{density:"comfortable"},card:{style:"solid",blur:16,width:"normal"},layout:{position:"center",splitImageSide:"left",logoPlacement:"card",logoSize:"md"},buttons:{style:"solid",socialLayout:"list"},inputs:{style:"outline"},background:{},backgroundDark:{},logo:{}},To={minimal:{design:{}},atlas:{design:{palette:F("#6d4aff #ffffff #0e8fc7 #f6f5ff #ffffff #0b0d17 #5b6078 #e2def5 #d92d3a #0f7a52 #ffffff #0b0d17"),paletteDark:F("#7455fa #ffffff #46c7ff #070811 #0f1120 #eef0f6 #959bb0 #262a40 #ff6b6b #43d9a0 #0b0d17 #eef0f6"),typography:{font:"system",headingFont:"system",headingWeight:600},shape:{radius:14,controlRadius:9,borderWidth:1},elevation:{cardShadow:"lg"},buttons:{style:"gradient"},background:{gradient:{type:"linear",angle:160,stops:[{color:"#f6f5ff",at:0},{color:"#eef6ff",at:100}]}},backgroundDark:{gradient:{type:"radial",stops:[{color:"#1a1440",at:0},{color:"#070811",at:70}]},pattern:"grid"}}},glass:{design:{palette:F("#4338ca - #db2777 #eef2ff #ffffff #111827 #4b5563 #ffffff - - #ffffff #111827"),paletteDark:F("#a5b4fc - #f472b6 #1e1b4b #111827 #f9fafb #cbd5e1 #374151 - - #0b1120 #f9fafb"),shape:{radius:20,controlRadius:12},elevation:{cardShadow:"xl"},card:{style:"glass",blur:20},background:{gradient:{type:"linear",angle:135,stops:[{color:"#6366f1",at:0},{color:"#ec4899",at:55},{color:"#f59e0b",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:135,stops:[{color:"#1e1b4b",at:0},{color:"#4c1d95",at:55},{color:"#831843",at:100}]}}}},midnight:{design:{colorScheme:"dark",palette:F("#1d4ed8 - #7c3aed #eef2f9 #ffffff #0b1020 #475569 #d5dceb - - #ffffff #0b1020"),paletteDark:F("#60a5fa - #a78bfa #0b1020 #121a2f #e6eaf5 #94a3b8 #24314f #f87171 #34d399 #0e1528 #e6eaf5"),typography:{font:"manrope",headingFont:"manrope"},shape:{radius:16,controlRadius:10},elevation:{cardShadow:"lg"},backgroundDark:{pattern:"dots"}}},editorial:{design:{palette:F("#8b2e1f - #8a6410 #f7f3ec #fffdf8 #1f1a14 #6b6157 #e3dacb - - #fffdf8 #1f1a14"),paletteDark:F("#e07a5f - #d4a64a #16130f #1f1b16 #f2ebe0 #a89f92 #3a332a - - #16130f #f2ebe0"),typography:{font:"source-serif",headingFont:"playfair-display",baseSize:16,headingWeight:700,scale:"golden"},shape:{radius:4,controlRadius:2},elevation:{cardShadow:"sm"},inputs:{style:"underline"}}},terminal:{design:{colorScheme:"dark",palette:F("#166534 - #0e7490 #f4fbf3 #ffffff #0b2a0b #3f6b3c #b7d8b4 - - #ffffff #0b2a0b"),paletteDark:F("#39ff14 #031003 #00e5ff #0a0f0a #0d140d #c8f7c5 #7fb57b #2c5a2c #ff5555 #39ff14 #050805 #c8f7c5"),typography:{font:"jetbrains-mono",headingFont:"jetbrains-mono",baseSize:14,letterCase:"uppercase",scale:"major-second"},shape:{radius:0,controlRadius:0,borderWidth:1},elevation:{cardShadow:"none"},card:{style:"outline"},buttons:{style:"outline"},backgroundDark:{pattern:"grid"}}},sunrise:{design:{palette:F("#c2410c - #be185d #fff1e6 #ffffff #2a1a12 #7c5e52 #f4d9cb - - #ffffff #2a1a12"),paletteDark:F("#fb923c - #f472b6 #1a0f0a #24150f #fdebe1 #c4a092 #4a2e22 - - #1a0f0a #fdebe1"),typography:{font:"poppins",headingFont:"poppins"},shape:{radius:20,controlRadius:999},elevation:{cardShadow:"lg"},background:{gradient:{type:"linear",angle:160,stops:[{color:"#fff1e6",at:0},{color:"#ffe4ec",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:160,stops:[{color:"#2a1209",at:0},{color:"#2a0f1c",at:100}]}}}},forest:{design:{palette:F("#166534 - #a16207 #f3f7f2 #ffffff #14261a #53685a #d6e3d8 - - #f3f7f2 #14261a"),paletteDark:F("#4ade80 - #facc15 #0c1510 #13201a #e3efe6 #9db5a4 #2a3d31 - - #0c1510 #e3efe6"),typography:{font:"dm-sans",headingFont:"dm-sans"},shape:{radius:10,controlRadius:8},inputs:{style:"filled"}}},grape:{design:{palette:F("#7e22ce - #be185d #faf5ff #ffffff #2e1065 #6b5b8a #e9d5ff - - #ffffff #2e1065"),paletteDark:F("#c084fc - #f472b6 #12081f #1c1030 #f3e8ff #b4a3cf #3b2559 - - #12081f #f3e8ff"),typography:{font:"nunito",headingFont:"nunito",headingWeight:800},shape:{radius:24,controlRadius:14},buttons:{socialLayout:"grid"},background:{pattern:"dots"},backgroundDark:{pattern:"dots"}}},slate:{design:{palette:F("#334155 - #0369a1 #f1f5f9 #ffffff #0f172a #64748b #cbd5e1 - - #f8fafc #0f172a"),paletteDark:F("#cbd5e1 - #38bdf8 #0f172a #1e293b #f1f5f9 #94a3b8 #334155 - - #0f172a #f1f5f9"),typography:{font:"work-sans",headingFont:"work-sans"},shape:{radius:8,controlRadius:6},elevation:{cardShadow:"sm"},spacing:{density:"compact"},inputs:{style:"filled"}}},"split-photo":{design:{layout:{position:"split",splitImageSide:"left",logoPlacement:"page"},card:{style:"none",width:"normal"},elevation:{cardShadow:"none"},shape:{radius:0,controlRadius:8},background:{gradient:{type:"linear",angle:135,stops:[{color:"#0f172a",at:0},{color:"#334155",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:135,stops:[{color:"#020617",at:0},{color:"#1e293b",at:100}]}}}},bold:{design:{palette:F("#4338ca - #ca8a04 #4338ca #ffffff #111827 #4b5563 #e5e7eb - - #ffffff #111827"),paletteDark:F("#a5b4fc - #facc15 #1e1b4b #111827 #f9fafb #cbd5e1 #374151 - - #0b1120 #f9fafb"),typography:{font:"montserrat",headingFont:"montserrat",baseSize:17,headingWeight:800,letterCase:"uppercase",scale:"octave"},shape:{radius:24,controlRadius:999,borderWidth:0},elevation:{cardShadow:"xl"},spacing:{density:"spacious"},card:{width:"wide"}}}};var ve=(e,t,n)=>Math.min(n,Math.max(t,e));function _e(e){if(!e||typeof e!="string")return null;let t=e.trim().toLowerCase();if(t==="transparent")return{r:0,g:0,b:0,a:0};let n=/^#([0-9a-f]{3,8})$/.exec(t);if(n){let i=n[1];if((i.length===3||i.length===4)&&(i=[...i].map(d=>d+d).join("")),i.length!==6&&i.length!==8)return null;let c=d=>parseInt(i.slice(d,d+2),16);return{r:c(0),g:c(2),b:c(4),a:i.length===8?c(6)/255:1}}let r=/^rgba?\(([^)]+)\)$/.exec(t);if(!r)return null;let o=r[1].replace("/"," ").split(/[\s,]+/).filter(Boolean);if(o.length<3)return null;let s=i=>i.endsWith("%")?parseFloat(i)/100*255:parseFloat(i),a=i=>i===void 0?1:i.endsWith("%")?parseFloat(i)/100:parseFloat(i),l={r:ve(s(o[0]),0,255),g:ve(s(o[1]),0,255),b:ve(s(o[2]),0,255),a:ve(a(o[3]),0,1)};return[l.r,l.g,l.b,l.a].some(Number.isNaN)?null:l}var yt=e=>ve(Math.round(e),0,255).toString(16).padStart(2,"0");function vt(e){return`#${yt(e.r)}${yt(e.g)}${yt(e.b)}`}function Ri(e){let t=n=>{let r=n/255;return r<=.03928?r/12.92:((r+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function kt(e){let t=_e(e);return t?Ri(t):null}function ze(e,t){let n=kt(e),r=kt(t);if(n===null||r===null)return 1;let o=Math.max(n,r),s=Math.min(n,r);return(o+.05)/(s+.05)}var Pi=4.5,Ti=3;function Io(e){var t;return((t=kt(e))!=null?t:0)>.179?"#111827":"#ffffff"}function Ii(e,t,n){let r=e/255,o=t/255,s=n/255,a=Math.max(r,o,s),l=Math.min(r,o,s),i=(a+l)/2;if(a===l)return[0,0,i];let c=a-l,d=i>.5?c/(2-a-l):c/(a+l);return[a===r?((o-s)/c+(o<s?6:0))/6:a===o?((s-r)/c+2)/6:((r-o)/c+4)/6,d,i]}function Oi(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,s=l=>{let i=l;return i<0&&(i+=1),i>1&&(i-=1),i<1/6?o+(r-o)*6*i:i<1/2?r:i<2/3?o+(r-o)*(2/3-i)*6:o};return`#${(t===0?[n,n,n]:[s(e+1/3),s(e),s(e-1/3)]).map(l=>yt(ve(l,0,1)*255)).join("")}`}function Li(e,t,n=Pi){var u;let r=_e(e);if(!r||t.length===0)return e;let o=f=>t.every(p=>ze(f,p)>=n);if(o(e))return e;let a=((u=kt(t[0]))!=null?u:1)>.179?-.01:.01,[l,i,c]=Ii(r.r,r.g,r.b),d=e;for(let f=1;f<=100;f+=1){let p=c+a*f;if(p<0||p>1)break;if(d=Oi(l,i,p),o(d))return d}return d}function Oo(e,t){return Li(e,t,Ti)}var Di=["primary","accent","danger","success"],se=e=>JSON.parse(JSON.stringify(e));function Do(e){if(!e||typeof e!="object"||Array.isArray(e))return{};if(Eo(e))return se(e);let t={};for(let[n,r]of Object.entries(e))r!==void 0&&Co(n,r)&&(t[n]=se(r));return t}function Lo(e,t){if(!t)return e;let n={...e};for(let[r,o]of Object.entries(t))o!==void 0&&(n[r]=o);return t.primary&&!t.primaryInk&&(n.primaryInk=Io(t.primary)),n}function wn(e,t,n){var s,a,l;t.colorScheme&&(e.colorScheme=t.colorScheme);let r=e.palette;e.palette=Lo(e.palette,t.palette);let o=t.paletteDark?{...t.paletteDark}:void 0;if(n.carryBrand&&t.palette){for(let i of Di){let c=t.palette[i];c&&c!==r[i]&&!((s=t.paletteDark)!=null&&s[i])&&(o={...o!=null?o:{},[i]:c})}t.palette.primaryInk&&!((a=t.paletteDark)!=null&&a.primaryInk)&&(o!=null&&o.primary)&&(o.primaryInk=t.palette.primaryInk)}if(e.paletteDark=Lo(e.paletteDark,o),t.typography){let i=t.typography;e.typography={...e.typography,...oe(i),headingFont:(l=i.headingFont)!=null?l:i.font?i.font:e.typography.headingFont}}if(t.shape&&(e.shape={...e.shape,...oe(t.shape)}),t.elevation&&(e.elevation={...e.elevation,...oe(t.elevation)}),t.spacing&&(e.spacing={...e.spacing,...oe(t.spacing)}),t.card&&(e.card={...e.card,...oe(t.card)}),t.layout&&(e.layout={...e.layout,...oe(t.layout)}),t.buttons&&(e.buttons={...e.buttons,...oe(t.buttons)}),t.inputs&&(e.inputs={...e.inputs,...oe(t.inputs)}),t.background&&(e.background=se(t.background)),t.backgroundDark)e.backgroundDark=se(t.backgroundDark);else if(t.background&&n.carryBrand){let i={};t.background.gradient&&(i.gradient=se(t.background.gradient)),t.background.image&&(i.image=se(t.background.image)),t.background.pattern&&(i.pattern=t.background.pattern),e.backgroundDark=i}t.logo&&(e.logo=se(t.logo))}function oe(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function Sn(e){return typeof e=="string"&&ht.includes(e)}function Ne(e){let t=Do(e),n=Sn(t.preset)?t.preset:"minimal",r=se(Po);return r.preset=n,wn(r,To[n].design,{carryBrand:!1}),wn(r,t,{carryBrand:!0}),r}function Fo(e,t){let n=Ne(e),r=Do(t);return delete r.preset,wn(n,r,{carryBrand:!0}),n}function Cn(e){var o,s,a,l,i,c,d,u,f,p,m,b,y,A;let t=(E,v,C)=>typeof v=="string"&&E.includes(v)?v:C,n=(o=e==null?void 0:e.background)!=null?o:{},r={"data-atlas-layout":t(ct,(s=e==null?void 0:e.layout)==null?void 0:s.position,"center"),"data-atlas-split-side":t(dt,(a=e==null?void 0:e.layout)==null?void 0:a.splitImageSide,"left"),"data-atlas-logo":t(ut,(l=e==null?void 0:e.layout)==null?void 0:l.logoPlacement,"card"),"data-atlas-logo-size":t(pt,(i=e==null?void 0:e.layout)==null?void 0:i.logoSize,"md"),"data-atlas-card":t(it,(c=e==null?void 0:e.card)==null?void 0:c.style,"solid"),"data-atlas-card-width":t(lt,(d=e==null?void 0:e.card)==null?void 0:d.width,"normal"),"data-atlas-shadow":t(st,(u=e==null?void 0:e.elevation)==null?void 0:u.cardShadow,"md"),"data-atlas-density":t(at,(f=e==null?void 0:e.spacing)==null?void 0:f.density,"comfortable"),"data-atlas-button":t(ft,(p=e==null?void 0:e.buttons)==null?void 0:p.style,"solid"),"data-atlas-social":t(gt,(m=e==null?void 0:e.buttons)==null?void 0:m.socialLayout,"list"),"data-atlas-input":t(mt,(b=e==null?void 0:e.inputs)==null?void 0:b.style,"outline"),"data-atlas-pattern":t(Fe,n.pattern,"none"),"data-atlas-pattern-dark":t(Fe,(y=e==null?void 0:e.backgroundDark)==null?void 0:y.pattern,"none"),"data-atlas-letter-case":t(ot,(A=e==null?void 0:e.typography)==null?void 0:A.letterCase,"none")};return((e==null?void 0:e.colorScheme)==="dark"||(e==null?void 0:e.colorScheme)==="light")&&(r["data-atlas-theme"]=e.colorScheme),r}function Mo(e){var n,r;let t=new Set;for(let o of[(n=e==null?void 0:e.typography)==null?void 0:n.font,(r=e==null?void 0:e.typography)==null?void 0:r.headingFont]){let s=xo(o);s&&t.add(s)}return[...t]}function En(){try{return typeof process!="undefined"&&!1}catch{return!1}}var zo=e=>{En()&&console.warn(`[atlas] ${e}`)},Uo=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Fi(e,t=zo,n="design"){return e!=null&&(typeof e!="object"||Array.isArray(e))?(t(`${n} must be an object; ignored.`),{}):Ao(e,r=>t(r.message==="Unknown setting."&&r.path.split(".").length===n.split(".").length+1?`${r.path} is not a design setting; ignored.`:`${r.path} is invalid; ignored.`),n)}function No(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t.toString(36)}var Mi=/^(?:https:\/\/[A-Za-z0-9.-]+(?::\d{1,5})?|http:\/\/(?:localhost|127\.0\.0\.1)(?::\d{1,5})?)$/;function Ui(e,t){let n=(t!=null?t:"").replace(/\/+$/,"");return n&&!Mi.test(n)?[]:Mo(e).map(r=>`${n}${r}`)}function zi(e){if(!(!Uo(e)||!Uo(e.resolved)))return e.resolved}function $o(e){var c,d,u;let t=(c=e.warn)!=null?c:zo,n=zi(e.instance),r=Fi(e.design,t,"appearance.design"),o,s=(d=e.preset)!=null?d:r.preset;s!==void 0&&(Sn(s)?o=s:t(`appearance.preset "${String(s)}" is not a preset; ignored.`));let a=o!==void 0||Object.keys(r).some(f=>f!=="preset");if(!n&&!a)return null;let l=o?Ne({preset:o}):n?Ne(n):Ne({}),i=xn((u=e.tokensDesign)!=null?u:{},r);return Fo(l,i)}function Bo(e,t){return Ui(e,t)}var Wo=new Set,Ho=e=>{var t;!En()||Wo.has(e)||(Wo.add(e),(t=globalThis.console)==null||t.warn(`[atlas] ${e}`))};function jo(e){var r,o;if(!e||typeof e!="object")return null;let t=e,n=(o=t.design)!=null?o:(r=t.appearance)==null?void 0:r.design;return n&&typeof n=="object"&&n.resolved?n:null}function Ko(e,t,n,r){var o,s;for(let a of(o=r==null?void 0:r.attributes)!=null?o:[])a in n.attributes||t.removeAttribute(a);for(let a of(s=r==null?void 0:r.style)!=null?s:[])a in n.style||t.style.removeProperty(a);for(let[a,l]of Object.entries(n.style))t.style.setProperty(a,l);for(let[a,l]of Object.entries(n.attributes))t.setAttribute(a,l);if(n.css&&!Array.from(e.head.querySelectorAll("style[data-atlas-design]")).some(l=>l.getAttribute("data-atlas-design")===n.key)){let l=e.createElement("style");l.setAttribute("data-atlas-design",n.key),l.textContent=n.css,e.head.appendChild(l)}if(n.fontStylesheets.length){let a=new Set(Array.from(e.head.querySelectorAll("link[data-atlas-font]")).map(l=>l.getAttribute("href")));for(let l of n.fontStylesheets){if(a.has(l))continue;let i=e.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("href",l),i.setAttribute("data-atlas-font",""),e.head.appendChild(i)}}return{attributes:Object.keys(n.attributes),style:Object.keys(n.style)}}var Ni=["boxes","single"];function Vo(e,t){for(let n of[t,e])if(n&&Ni.includes(n))return n;return"boxes"}var Go=8,$i=["solid","outline","soft","ghost"],Bi=["none","scale","lift","glow","ripple"],Wi=["none","sm","md","lg"],Hi=["comfortable","compact"],ji=["outline","filled","underline"],Ki=["slow","normal","fast"],qi=["spinner","skeleton","dots","bar"],Yo={slow:280,normal:160,fast:80};function _t(e,t){let n=(r,o,...s)=>{for(let a of s)if(a!==void 0&&r.includes(a))return a;return o};return{buttonStyle:n($i,"solid",t==null?void 0:t.buttonStyle,e==null?void 0:e.buttonStyle),buttonEffect:n(Bi,"scale",t==null?void 0:t.buttonEffect,e==null?void 0:e.buttonEffect),shadow:n(Wi,"md",t==null?void 0:t.shadow,e==null?void 0:e.shadow),density:n(Hi,"comfortable",t==null?void 0:t.density,e==null?void 0:e.density),inputStyle:n(ji,"outline",t==null?void 0:t.inputStyle,e==null?void 0:e.inputStyle),animations:typeof(t==null?void 0:t.animations)=="boolean"?t.animations:typeof(e==null?void 0:e.animations)=="boolean"?e.animations:!0,motionSpeed:n(Ki,"normal",t==null?void 0:t.motionSpeed,e==null?void 0:e.motionSpeed),loading:n(qi,"spinner",t==null?void 0:t.loading,e==null?void 0:e.loading)}}var Vi=["block","compact","icon"],Gi=["sm","md","lg"],Yi=["list","grid","carousel"],Ji=["auto","always","never"];function An(e,t){var r,o,s;let n=(a,...l)=>{for(let i of l)if(i!==void 0&&a.includes(i))return i;return a[0]};return{variant:n(Vi,t==null?void 0:t.variant,e==null?void 0:e.variant),size:n(Gi,(r=t==null?void 0:t.size)!=null?r:"md",e==null?void 0:e.size,"md"),layout:n(Yi,t==null?void 0:t.layout,e==null?void 0:e.layout),labels:{...(o=e==null?void 0:e.labels)!=null?o:{},...(s=t==null?void 0:t.labels)!=null?s:{}},search:n(Ji,t==null?void 0:t.search,e==null?void 0:e.search)}}var J={colorPrimary:"#5b5bd6",colorText:"#1c1c1f",colorBackground:"#ffffff",colorAccent:"#5b5bd6",colorCard:"#ffffff",colorBorder:"#e4e4e9",borderRadius:"10px",fontFamily:'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'};function Zi(e){return e?{colorPrimary:e.colorPrimary||J.colorPrimary,colorText:e.colorText||J.colorText,colorBackground:e.colorBackground||J.colorBackground,colorAccent:e.colorAccent||e.colorPrimary||J.colorAccent,colorCard:e.colorCard||e.colorBackground||J.colorCard,colorBorder:e.colorBorder||J.colorBorder,borderRadius:e.borderRadius||J.borderRadius,fontFamily:e.fontStack||J.fontFamily}:J}function Jo(e,t){var o;let n={...Zi(e)},r=(o=t==null?void 0:t.variables)!=null?o:{};for(let[s,a]of Object.entries(r))a!==void 0&&(n[s]=a);return n}function Zo(e){let t={};for(let[n,r]of Object.entries(e))t[`--atlas-embed-${n.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}`]=r;return t}function Xo(e){let t=_e(e);if(!t)return"#ffffff";let n=vt(t);return ze("#ffffff",n)>=ze("#111111",n)?"#ffffff":"#111111"}function Qo(e,t){let n=_e(e);if(!n)return e;let r=vt(n),o=t.map(s=>_e(s)).filter(s=>!!s&&s.a>0).map(vt);return o.length===0||o.every(s=>ze(r,s)>=3)?e:Oo(r,o)}function es(e,t,n){var o;let r=(o=n==null?void 0:n.elements)==null?void 0:o[e];return r?`${t} ${r}`:t}function ts(e,t){var a,l;let n=(a=t==null?void 0:t.providerOrder)!=null?a:[],r=new Set((l=t==null?void 0:t.providerHidden)!=null?l:[]),o=new Set(e.filter(i=>!r.has(i))),s=[];for(let i of n)o.has(i)&&!s.includes(i)&&s.push(i);for(let i of e)o.has(i)&&!s.includes(i)&&s.push(i);return s}var qo={google:"Google",github:"GitHub",gitlab:"GitLab",facebook:"Facebook",apple:"Apple",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",twitter:"X",twitter_v1:"X",x:"X",slack:"Slack",spotify:"Spotify",twitch:"Twitch",notion:"Notion",linear:"Linear",steam:"Steam"};function xt(e){return qo[e]?qo[e]:e.split(/[_-]/).map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}var Xi="0.10.0",ns={name:"@atlasauth/embed",version:Xi};function Qi(e,t){return(n,r)=>{let o=typeof n=="string"?n:n.toString(),s;try{s=new URL(o)}catch{return t(n,r)}return s.searchParams.has("publishable_key")||s.searchParams.set("publishable_key",e),t(s.toString(),r)}}function rs(e){var n;let t=(n=e.fetchImpl)!=null?n:fetch;return new Je({publishableKey:e.publishableKey,baseUrl:e.frontendApi.replace(/\/$/,""),fetchImpl:Qi(e.publishableKey,t),locale:e.locale,sdk:ns,referral:e.referral,referralConsent:e.referralConsent})}async function os(e){let t=await e.get("/v1/appearance");return t.ok?t.data:null}var ss="atlas-embed-styles",el=`
16
16
  .atlas-embed-root {
17
17
  --_bg: var(--atlas-embed-color-background, #ffffff);
18
18
  --_card: var(--atlas-embed-color-card, #ffffff);
@@ -384,4 +384,4 @@ form > .atlas-embed-step-back { display: block; width: 100%; text-align: center;
384
384
  .atlas-embed-loadbar::before { position: static; width: 100%; }
385
385
  }
386
386
  @keyframes atlas-embed-pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }
387
- `;function na(e=document){var n;if(e.querySelector(`style[data-${ta}]`))return;let t=e.createElement("style");t.setAttribute(`data-${ta}`,""),t.textContent=Ki,((n=e.head)!=null?n:e.documentElement).appendChild(t)}function ra(e,t,n={}){var u;let r=Mo({instance:(t==null?void 0:t.instanceDesign)===!1?null:e,preset:t==null?void 0:t.preset,design:t==null?void 0:t.design,warn:No});if(!r)return null;let a=r.colorScheme==="dark"||r.colorScheme==="auto"&&!!n.prefersDark?r.paletteDark:r.palette,s={colorPrimary:a.primary,colorText:a.text,colorBackground:a.background,colorAccent:a.accent,colorCard:a.surface,colorBorder:a.border,borderRadius:`${Math.min(r.shape.controlRadius,24)}px`,fontFamily:bn(r.typography.font)};for(let[f,p]of Object.entries((u=t==null?void 0:t.variables)!=null?u:{}))p!==void 0&&(s[f]=p);let l=r.elevation.cardShadow==="xl"?"lg":r.elevation.cardShadow,i={buttonStyle:r.buttons.style==="gradient"?"solid":r.buttons.style,shadow:r.card.style==="outline"||r.card.style==="none"?"none":l,density:r.spacing.density==="compact"?"compact":"comfortable",inputStyle:r.inputs.style},c=r.buttons.socialLayout==="icons"?{variant:"icon",layout:"grid"}:{layout:r.buttons.socialLayout==="grid"?"grid":"list"},d=Fo(JSON.stringify(r));return{render:{style:{},attributes:{...Cn(r),"data-atlas-design":d},css:"",key:d,fontStylesheets:Uo(r,n.frontendApi)},tokens:s,interaction:i,socialButtons:c,resolved:r}}var oa=new Set(["bluesky"]),aa='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg>',sa='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 18l6-6-6-6"/></svg>',pe={"sign-in":{title:"Sign in",submit:"Continue"},"sign-up":{title:"Create your account",submit:"Continue"}};function O(e){var t;return(t=e.root.ownerDocument)!=null?t:document}function g(e,t,n,r){let o=O(e).createElement(t);return n&&(o.className=n),r!=null&&(o.textContent=r),(o.classList.contains("atlas-embed-button")||o.classList.contains("atlas-embed-social-button"))&&Gi(e,o),o}function R(e,t,n){return Jo(t,n,e.options.appearance)}function Gi(e,t){e.interaction.buttonEffect!=="ripple"||!e.interaction.animations||t.addEventListener("pointerdown",n=>{let r=t.getBoundingClientRect(),o=Math.max(r.width,r.height),a=O(e).createElement("span");a.className="atlas-embed-ripple",a.style.width=a.style.height=`${o}px`,a.style.left=`${n.clientX-r.left-o/2}px`,a.style.top=`${n.clientY-r.top-o/2}px`,a.addEventListener("animationend",()=>a.remove()),t.appendChild(a)})}function xe(e,t){let n=g(e,"button",R(e,"buttonPrimary","atlas-embed-button"));if(n.type="submit",n.disabled=e.busy,e.busy){n.setAttribute("data-busy",""),n.setAttribute("aria-label",t);let r=g(e,"span","atlas-embed-btn-spinner");r.setAttribute("aria-hidden","true"),n.appendChild(r)}else n.textContent=t;return n}function ia(e,t=typeof window!="undefined"?window.location.origin:""){if(!e||typeof e!="string")return null;if(e.startsWith("/")&&!e.startsWith("//"))try{return t?new URL(e,t).toString():e}catch{return null}let n;try{n=new URL(e)}catch{return null}return t&&n.origin===t||n.protocol==="https:"?n.toString():null}async function Ne(e,t,n=!1){var l,i,c;let r=e.captchaFlows[t];if(!(n?!!r&&Ie(r.provider):ye(r))||!r)return null;let a=(l=e.root.ownerDocument)!=null?l:document,s=a.createElement("div");s.className="atlas-embed-captcha",((c=(i=e.root.parentElement)!=null?i:a.body)!=null?c:a.documentElement).appendChild(s);try{return await an(r,s,{atlas:{labels:nn(e.options.localization)}})}catch{return null}finally{s.remove()}}var Rn=new WeakMap;async function qi(e){let t=Rn.get(e);if(t){let o=await t;return o?{...o,owner:!1}:null}let n=Jn({win:e}).catch(()=>null);Rn.set(e,n),n.finally(()=>Rn.delete(e));let r=await n;return r?{...r,owner:!0}:null}async function da(e){var o,a;let t=(a=(o=e.root.ownerDocument)==null?void 0:o.defaultView)!=null?a:typeof window!="undefined"?window:null;if(!t)return!1;let n=await qi(t);if(n!=null&&n.delivered)return Se(e,"Signed in. You can close this window."),!0;if(n!=null&&n.owner){let s=Qn(n.payload);if(s!=null&&s.ticket&&s.attemptId)return await la(e,t,s.attemptId,s.ticket),!0;if(s!=null&&s.continuationUrl)return t.location.replace(s.continuationUrl),!0}let r=er(t.location.search);return r?r.ticket?(await la(e,t,r.attemptId,r.ticket,()=>ca(e,t)),!0):(r.status&&(e.state=Je({id:r.attemptId,status:r.status}),ca(e,t)),!1):!1}async function la(e,t,n,r,o){let a=await se(e,n,r);o==null||o(),!(a&&await Zn({win:t}).catch(()=>!1))&&await j(e,n)}function ca(e,t){try{t.history.replaceState({},t.document.title,He(t.location.href))}catch{}}async function se(e,t,n){return e.options.preview?!1:(await e.client.post("/v1/client/tickets/exchange",{attempt_id:t,ticket:n,remember:e.remember})).ok}async function j(e,t){var o,a;let n=(a=(o=e.root.ownerDocument)==null?void 0:o.defaultView)!=null?a:typeof window!="undefined"?window:null,r=ia(e.options.redirect,n?n.location.origin:void 0);if(e.root.dispatchEvent(new CustomEvent("atlas:complete",{bubbles:!0,detail:{attemptId:t,redirected:!!r}})),e.options.preview){Se(e,"Sign-in works \u2014 this is a preview, so no session was created.");return}if(r&&n){n.location.assign(r);return}Se(e,"You are signed in.")}function $e(e,t){Nr({api:e.options.frontendApi,publishableKey:e.options.publishableKey,attemptId:t!=null?t:void 0,kind:e.mode==="sign-up"?"sign_up":"sign_in",recorder:e.recorder,fetchImpl:e.options.fetchImpl})}async function Be(e,t,n){var l,i,c,d,u;if(e.busy)return;if((l=e.conditionalAbort)==null||l.abort(),e.flash=null,typeof t.identifier=="string"&&t.identifier.trim()&&(e.enteredIdentifier=t.identifier.trim()),e.busy=!0,$e(e,(i=e.state.attempt)==null?void 0:i.id),P(e),e.state=await Te(e.client,e.state,t),e.state.attempt&&$(e.state.attempt).kind==="collect_captcha"){let f=await Ne(e,"signIn",!0);f&&(e.state=await Te(e.client,e.state,{identifier:(d=(c=e.enteredIdentifier)!=null?c:t.identifier)!=null?d:"",captcha_token:f}))}let r=e.state.attempt?$(e.state.attempt):null;n&&(r==null?void 0:r.kind)==="collect_first_factor"&&e.state.errors.length===0?r.strategies.includes(n)?await St(e,n,!1):e.state={...e.state,errors:[{code:"STRATEGY_DISABLED",message:"That sign-in method is not available for this account."}]}:(r==null?void 0:r.kind)==="collect_first_factor"&&t.password&&e.state.errors.length===0&&(e.state=await Te(e.client,e.state,{password:t.password})),e.busy=!1;let o=e.state.attempt?$(e.state.attempt):null;e.mode==="sign-in"&&e.passwordEnabled&&(o==null?void 0:o.kind)==="collect_first_factor"&&!e.state.prepared&&(e.state={...z,errors:e.state.errors});let a=e.state.attempt?$(e.state.attempt):null;if((a==null?void 0:a.kind)==="collect_first_factor"&&!e.state.prepared&&e.state.errors.length===0){let f=We(e.emailDeliveryAvailable?a.strategies:a.strategies.filter(p=>p!=="email_code"&&p!=="email_link")).autoSend;f&&await St(e,f,!1)}let s=e.state.attempt;if(Ce(e.state)){P(e);return}if((s==null?void 0:s.status)==="complete"){let f=(u=s.id)!=null?u:null;e.state.ticket&&f&&await se(e,f,e.state.ticket),await j(e,f);return}P(e)}async function ua(e){var n,r;if(e.busy||!Ce(e.state))return;e.state=vr(e.state);let t=(r=(n=e.state.attempt)==null?void 0:n.id)!=null?r:null;e.busy=!0;try{e.state.ticket&&t&&await se(e,t,e.state.ticket)}finally{e.busy=!1}await j(e,t)}async function St(e,t,n=!0){var a;if(n){if(e.busy)return;e.busy=!0,P(e)}let r=(a=e.state.prepared)!=null?a:null,o=await Wr(e.client,e.state,t);e.state=o.errors.length>0?{...o,prepared:r}:o,t==="email_link"&&o.errors.length===0&&fa(e),n&&(e.busy=!1,P(e))}async function pa(e){e.busy||(e.busy=!0,P(e),e.state=await Br(e.client,e.state),e.busy=!1,e.flash=e.state.errors.length===0?"We sent you a new email.":null,P(e))}function fa(e){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=setInterval(()=>{(async()=>{var a,s;if(!en(e.state)){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;return}let t=(a=e.state.attempt)==null?void 0:a.status,{state:n,ticket:r}=await Hr(e.client,e.state);if(e.state=n,!r&&n.attempt&&n.attempt.status!==t&&P(e),!r||!n.attempt)return;e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;let o=(s=n.attempt.id)!=null?s:null;o&&await se(e,o,r),await j(e,o)})()},2e3)}async function wt(e,t,n){var l,i,c;$e(e);let r=(i=(l=e.root.ownerDocument)==null?void 0:l.defaultView)!=null?i:typeof window!="undefined"?window:null,o=r?He(r.location.href):e.options.frontendApi,a=await e.client.post("/v1/client/sign_ins/oauth",{provider:t,redirect_url:o,...n?{identifier:n}:{}}),s=(c=a.data)==null?void 0:c.authorization_url;s&&r?r.location.assign(s):(e.handlePrompt=null,Z(e,a.errors))}async function Pn(e,t,n={}){var l,i,c;$e(e);let r=(i=(l=e.root.ownerDocument)==null?void 0:l.defaultView)!=null?i:typeof window!="undefined"?window:null,o=r?He(r.location.href):e.options.frontendApi;if(n.popup&&r){await Yi(e,t,r,o);return}let a=await e.client.post("/v1/client/sign_ins/sso",{connection_id:t,redirect_url:o}),s=(c=a.data)==null?void 0:c.authorization_url;s&&r?r.location.assign(s):Z(e,a.errors)}function Vi(e){let t=e.options.frontendApi;try{return new URL(/^https?:\/\//.test(t)?t:`https://${t}`).origin}catch{return t}}async function Yi(e,t,n,r){var u;let o=n.open("about:blank","atlas-sso","width=480,height=640,menubar=no,toolbar=no,location=no,status=no");if(!o){await Pn(e,t);return}let a=r.includes("?")?"&":"?",s=`${r}${a}__atlas_display=popup`,l=Vi(e),i=f=>{if(f.origin!==l)return;let p=f.data;if(!(!p||p.type!=="atlas-sso")){n.removeEventListener("message",i);try{o.close()}catch{}if(p.error){Z(e,[{code:"sso_popup_cancelled",message:"Sign-in was cancelled."}]);return}if(p.status==="complete"&&p.ticket&&p.attempt_id){let m=p.attempt_id,b=p.ticket;(async()=>(await se(e,m,b),await j(e,m)))();return}p.attempt_id&&p.status&&(e.state=Je({id:p.attempt_id,status:p.status}),P(e))}};n.addEventListener("message",i);let c=await e.client.post("/v1/client/sign_ins/sso",{connection_id:t,redirect_url:s}),d=(u=c.data)==null?void 0:u.authorization_url;if(d)try{o.location.assign(d)}catch{try{o.close()}catch{}n.removeEventListener("message",i),n.location.assign(d)}else{n.removeEventListener("message",i);try{o.close()}catch{}Z(e,c.errors)}}async function ga(e,t,n){let r=await e.client.post("/v1/client/sign_ins/id_token",Gr({provider:t,idToken:n})),o=qr(r.data);if(!o){Z(e,r.errors);return}if(o.status==="complete"&&o.ticket){await se(e,o.attemptId,o.ticket),await j(e,o.attemptId);return}e.state=Je({id:o.attemptId,status:o.status}),P(e)}function ma(e){e.resetFlow={...Oe},P(e)}async function Tn(e,t){var r,o,a;if(e.busy||!e.resetFlow)return;if(e.busy=!0,$e(e),P(e),ke(e.resetFlow)==="request"){typeof t.email=="string"&&t.email.trim()&&(e.enteredIdentifier=t.email.trim());let s=await Ne(e,"passwordReset");e.resetFlow=await to(e.client,(r=t.email)!=null?r:"",s!=null?s:void 0),(o=e.resetFlow.attempt)!=null&&o.poll_secret&&Ji(e)}else e.resetFlow=await no(e.client,e.resetFlow,{code:t.code,password:t.password});e.busy=!1;let n=e.resetFlow;if(((a=n==null?void 0:n.attempt)==null?void 0:a.status)==="complete"){let s=n.attempt.id;e.resetFlow=null,n.ticket?(await se(e,s,n.ticket),await j(e,s)):(e.flash="Password updated. Sign in with your new password.",e.state=z,P(e));return}P(e)}function Ji(e){var n,r;e.linkPoll&&clearInterval(e.linkPoll);let t=(r=(n=e.resetFlow)==null?void 0:n.attempt)==null?void 0:r.id;e.linkPoll=setInterval(()=>{(async()=>{var s;let o=e.resetFlow;if(!(o!=null&&o.attempt)||o.attempt.id!==t||o.attempt.status!=="needs_email_verification"){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;return}let a=await ro(e.client,o);e.resetFlow!==o||((s=a.attempt)==null?void 0:s.status)==="needs_email_verification"||(e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null,e.resetFlow=a,P(e))})()},2e3)}async function ha(e,t,n=!0){var c;if(e.busy)return;e.busy=!0,$e(e),P(e);let{identifier:r,password:o,...a}=t,s={};for(let[d,u]of Object.entries(a))u&&(s[d]=u);let l=await Ne(e,"signUp");e.state=await Qt(e.client,{email:r!=null?r:"",password:o!=null?o:"",fields:s,consent:n,captchaToken:l!=null?l:void 0}),e.busy=!1;let i=e.state.attempt;if((i==null?void 0:i.status)==="complete"){let d=(c=i.id)!=null?c:null;e.state.ticket&&d&&await se(e,d,e.state.ticket),await j(e,d);return}en(e.state)&&fa(e),P(e)}var Zi={"mfa.enrollChoose":"Set up a second step for signing in.","mfa.enrollTotpOption":"Use an authenticator app","mfa.enrollSmsOption":"Use text messages","mfa.enrollScan":"Scan this QR code with your authenticator app, or enter the setup key.","mfa.enrollQrAlt":"QR code for your authenticator app","mfa.enrollSetupKey":"Setup key","mfa.enrollPreparing":"Setting up\u2026","mfa.enrollFirstCodeLabel":"Code from your authenticator app","mfa.enrollSecondCodeLabel":"The next code it shows","mfa.phoneLabel":"Mobile number","mfa.phoneHint":"Include the country code, for example +14155550101.","mfa.sendCode":"Text me a code","mfa.codeTextedTo":"Enter the code we texted to {phone}.","mfa.codeLabel":"Code","mfa.smsCodeOption":"Text me a code instead","mfa.recoveryCodesTitle":"Save your recovery codes","mfa.recoveryCodesHelp":"Each code works once. If you can't use your second step, sign in with one of these. Keep them somewhere safe: they won't be shown again.","mfa.recoveryCodesCopy":"Copy codes","mfa.recoveryCodesCopied":"Copied.","mfa.recoveryCodesDownload":"Download as .txt","mfa.recoveryCodesSaved":"I've saved my codes","signIn.emailCodeOption":"Email me a code instead","signIn.codeSentTo":"We sent a code to {email}. Enter it below.","signIn.resendCode":"Resend code","signIn.sending":"Sending\u2026"};function D(e,t,n={}){var s;let r=e.options.localization,o=typeof r=="function"?r(t):r&&typeof r=="object"?r[t]:void 0;return(typeof o=="string"&&o.trim()?o:(s=Zi[t])!=null?s:t).replace(/\{(\w+)\}/g,(l,i)=>{var c;return(c=n[i])!=null?c:l})}function ba(e){var n;let t=(n=e.state.attempt)==null?void 0:n.id;return t?(e.enrollment||(e.enrollment=hr(e.client,()=>Mt(e.account)),e.enrollment.subscribe(()=>queueMicrotask(()=>P(e)))),e.enrollment.start(t),e.enrollment):null}function ya(e,t,n,r){var i;let o=ba(e);if(!o)return r;let a=o.state,s=(c,d)=>{let u=g(e,"button","atlas-embed-step-back",D(e,c==="totp"?"mfa.enrollTotpOption":"mfa.enrollSmsOption"));u.type="button",u.setAttribute("data-atlas-mfa-method",c),u.disabled=e.busy||a.busy,u.addEventListener("click",()=>void o.choose(c)),Array.isArray(d)?d.push(u):d.appendChild(u)};if(a.method===null){t.appendChild(g(e,"p","atlas-embed-note",D(e,"mfa.enrollChoose")));for(let c of a.options)s(c,t)}else if(a.method==="totp"){let c=a.enrollment;if(c){if(t.appendChild(g(e,"p","atlas-embed-note",D(e,"mfa.enrollScan"))),c.qrCode){let d=O(e).createElement("img");d.className="atlas-embed-mfa-qr",d.setAttribute("data-atlas","mfa-qr"),d.src=c.qrCode,d.alt=D(e,"mfa.enrollQrAlt"),d.width=180,d.height=180,t.appendChild(d)}if(c.secret){let d=g(e,"p","atlas-embed-note",`${D(e,"mfa.enrollSetupKey")}: `);d.setAttribute("data-atlas","mfa-setup-key"),d.appendChild(g(e,"code","atlas-embed-mfa-key",mr(c.secret))),t.appendChild(d)}n.addCodeField("code",D(e,"mfa.enrollFirstCodeLabel"),!0),a.totpCodes>=2&&n.addCodeField("secondCode",D(e,"mfa.enrollSecondCodeLabel"),!1)}else{let d=g(e,"p","atlas-embed-note",a.busy?D(e,"mfa.enrollPreparing"):"");d.setAttribute("aria-live","polite"),t.appendChild(d)}}else if(!a.enrollment)n.addField("phone",D(e,"mfa.phoneLabel"),"tel","tel"),t.appendChild(g(e,"p","atlas-embed-note",D(e,"mfa.phoneHint")));else{let c=g(e,"p","atlas-embed-note",D(e,"mfa.codeTextedTo",{phone:(i=a.enrollment.phone)!=null?i:""}));c.setAttribute("data-atlas","mfa-code-texted"),t.appendChild(c),n.addCodeField("code",D(e,"mfa.codeLabel"),!0);let d=g(e,"button","atlas-embed-step-back",D(e,"signIn.resendCode"));d.type="button",d.setAttribute("data-atlas-resend",""),d.disabled=e.busy||a.busy,d.addEventListener("click",()=>void o.resend()),n.trailing.push(d)}for(let c of a.errors){let d=g(e,"p","atlas-embed-error",e.errorText(c));d.setAttribute("role","alert"),t.appendChild(d)}if(a.method!==null&&a.options.length>1)for(let c of a.options.filter(d=>d!==a.method))s(c,n.trailing);let l=br(a);return l===null?null:l==="mfa.sendCode"?D(e,"mfa.sendCode"):r}async function ka(e,t){let n=ba(e);if(!n)return;let r=await n.submit(t);r&&await Be(e,r)}function va(e,t){var s;let n=(s=e.state.attempt)==null?void 0:s.id;if(!n)return;let r=Mt(e.account),o=e.secondFactorCode&&e.secondFactorCode.attemptId===n?e.secondFactorCode:null,a=[];r.sms&&a.push("sms"),r.emailCode&&a.push("email_code");for(let l of a){let i=l==="sms"?"sms-second-factor":"email-second-factor";if((o==null?void 0:o.strategy)===l&&o.sentTo!==void 0){let u=g(e,"p","atlas-embed-note",l==="sms"?D(e,"mfa.codeTextedTo",{phone:o.sentTo}):D(e,"signIn.codeSentTo",{email:o.sentTo}));u.setAttribute("data-atlas",`${i}-sent`),u.setAttribute("aria-live","polite"),t.push(u);continue}let c=(o==null?void 0:o.strategy)===l&&o.busy===!0,d=g(e,"button","atlas-embed-step-back",c?D(e,"signIn.sending"):D(e,l==="sms"?"mfa.smsCodeOption":"signIn.emailCodeOption"));if(d.type="button",d.setAttribute("data-atlas",i),d.disabled=e.busy||c,d.addEventListener("click",()=>{e.secondFactorCode={attemptId:n,strategy:l,busy:!0},P(e),yr(e.client,n,l).then(({sentTo:u})=>{e.secondFactorCode={attemptId:n,strategy:l,sentTo:u},P(e)},u=>{e.secondFactorCode={attemptId:n,strategy:l,error:u instanceof Error?u.message:String(u)},P(e)})}),t.push(d),(o==null?void 0:o.strategy)===l&&o.error){let u=g(e,"p","atlas-embed-error",o.error);u.setAttribute("role","alert"),t.push(u)}}}function _a(e,t){var s,l;let n=g(e,"div","atlas-embed-recovery-codes");n.setAttribute("data-atlas","recovery-codes"),n.appendChild(g(e,"h2",R(e,"title","atlas-embed-title"),D(e,"mfa.recoveryCodesTitle"))),n.appendChild(g(e,"p","atlas-embed-note",D(e,"mfa.recoveryCodesHelp")));let r=g(e,"ul","atlas-embed-recovery-list");r.setAttribute("data-atlas","recovery-codes-list"),r.setAttribute("style","list-style:none;padding:0;margin:8px 0 12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center");for(let i of t){let c=g(e,"li");c.appendChild(g(e,"code","atlas-embed-mfa-key",i)),r.appendChild(c)}n.appendChild(r);let o=((s=O(e).defaultView)!=null?s:globalThis).navigator;if((l=o==null?void 0:o.clipboard)!=null&&l.writeText){let i=g(e,"button","atlas-embed-step-back",D(e,"mfa.recoveryCodesCopy"));i.type="button",i.setAttribute("data-atlas","recovery-codes-copy"),i.addEventListener("click",()=>{_r(t).then(c=>{if(!c||n.querySelector('[data-atlas="recovery-codes-copied"]'))return;let d=g(e,"p","atlas-embed-note",D(e,"mfa.recoveryCodesCopied"));d.setAttribute("data-atlas","recovery-codes-copied"),d.setAttribute("aria-live","polite"),n.insertBefore(d,a)})}),n.appendChild(i)}if(Ut()){let i=g(e,"button","atlas-embed-step-back",D(e,"mfa.recoveryCodesDownload"));i.type="button",i.setAttribute("data-atlas","recovery-codes-download"),i.addEventListener("click",()=>xr(t)),n.appendChild(i)}let a=g(e,"button",R(e,"buttonPrimary","atlas-embed-button"),D(e,"mfa.recoveryCodesSaved"));return a.type="button",a.setAttribute("data-atlas","recovery-codes-saved"),a.disabled=e.busy,a.addEventListener("click",()=>{a.disabled=!0,ua(e)}),n.appendChild(a),n}function xa(e){var p;let t=e.resetFlow,n=ke(t),r=g(e,"div","atlas-embed-reset");r.appendChild(g(e,"h1",R(e,"title","atlas-embed-title"),"Reset your password"));let o=O(e).createElement("form"),a=t.errors,s=new Map,l=a.find(m=>!m.param);l&&o.appendChild(g(e,"div","atlas-embed-form-error",e.errorText(l)));let i=null,c="Continue",d=!0,u=e.account.passwordReset;switch(n){case"request":i=u==="link"?"Enter your email and we\u2019ll send you a reset link.":u==="both"?"Enter your email and we\u2019ll send you a reset link and code.":"Enter your email and we\u2019ll send you a reset code.",c=u==="link"?"Send reset link":"Send reset code",Ct(e,o,s,a,"email","Email address","email","username");{let m=s.get("email");m&&(e.enteredIdentifier&&(m.value=e.enteredIdentifier),m.setAttribute("data-atlas-autofocus",""))}break;case"collect_email_code":if(u==="link"){d=!1,i="Check your email";let m=g(e,"p","atlas-embed-note",e.enteredIdentifier?`We sent a reset link to ${e.enteredIdentifier}. Open it on any device; this page continues on its own.`:"We sent you a reset link. Open it on any device; this page continues on its own.");m.setAttribute("data-atlas-link-sent",""),o.appendChild(m);let b=g(e,"button","atlas-embed-step-back","Send another link");b.type="button",b.setAttribute("data-atlas-resend",""),b.disabled=e.busy,b.addEventListener("click",()=>{var y;e.resetFlow={...Oe},Tn(e,{email:(y=e.enteredIdentifier)!=null?y:""})}),o.appendChild(b);break}i=e.enteredIdentifier?`Enter the code we sent to ${e.enteredIdentifier}`:"Enter the code we sent to your email",In(e,o,s,a,"code","Reset code",!0);break;case"collect_second_factor":i="Enter the code from your authenticator app",In(e,o,s,a,"code","Two-factor code",!0);break;case"collect_new_password":i="Choose a new password",c="Set new password",Ct(e,o,s,a,"password","New password","password","new-password"),(p=s.get("password"))==null||p.setAttribute("data-atlas-autofocus","");break;default:d=!1,o.appendChild(g(e,"p","atlas-embed-note","You\u2019re all set."))}i&&r.appendChild(g(e,"p",R(e,"subtitle","atlas-embed-subtitle"),i)),r.appendChild(o),d&&o.appendChild(xe(e,c));let f=g(e,"button","atlas-embed-step-back","Back to sign in");return f.type="button",f.addEventListener("click",()=>{e.resetFlow=null,P(e)}),o.appendChild(f),o.addEventListener("submit",m=>{m.preventDefault();let b={};for(let[y,E]of s)b[y]=E.value;Tn(e,b)}),r}function Ct(e,t,n,r,o,a,s,l){let i=g(e,"label",R(e,"field","atlas-embed-field"));i.appendChild(g(e,"span",R(e,"label","atlas-embed-label"),a));let c=O(e).createElement("input");if(c.className=R(e,"input","atlas-embed-input"),c.type=s,c.name=o,c.setAttribute("autocomplete",l),s==="password"){let d=g(e,"div","atlas-embed-password");d.appendChild(c);let u=g(e,"button","atlas-embed-password-toggle","Show");u.type="button",u.setAttribute("aria-label","Show password"),u.addEventListener("click",f=>{f.preventDefault();let p=c.type==="password";c.type=p?"text":"password",u.textContent=p?"Hide":"Show",u.setAttribute("aria-label",p?"Hide password":"Show password")}),d.appendChild(u),i.appendChild(d)}else i.appendChild(c);for(let d of r.filter(u=>u.param===o))i.appendChild(g(e,"span",R(e,"error","atlas-embed-error"),e.errorText(d)));n.set(o,c),t.appendChild(i)}function In(e,t,n,r,o,a,s){var m;if(e.codeInputStyle==="single"){Ct(e,t,n,r,o,a,"text","one-time-code"),s&&((m=n.get(o))==null||m.setAttribute("data-atlas-autofocus",""));return}let i=g(e,"div",R(e,"field","atlas-embed-field"));i.appendChild(g(e,"span",R(e,"label","atlas-embed-label"),a));let c=g(e,"div","atlas-embed-code");c.setAttribute("role","group"),c.setAttribute("aria-label",a);let d=O(e).createElement("input");d.type="hidden",d.name=o,n.set(o,d);let u=[],f=()=>{d.value=u.map(b=>b.value).join("")},p=()=>{d.value.length!==6||e.busy||t.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))};for(let b=0;b<6;b++){let y=O(e).createElement("input");y.className="atlas-embed-code-box",y.type="text",y.setAttribute("inputmode","numeric"),y.setAttribute("autocomplete",b===0?"one-time-code":"off"),y.setAttribute("aria-label",`${a} digit ${b+1}`),y.maxLength=1,s&&b===0&&y.setAttribute("data-atlas-autofocus",""),y.addEventListener("input",()=>{y.value=y.value.replace(/\D/g,"").slice(0,1),f(),y.value&&b<5&&u[b+1].focus(),p()}),y.addEventListener("keydown",E=>{E.key==="Backspace"&&!y.value&&b>0&&u[b-1].focus()}),y.addEventListener("paste",E=>{var k,S,x;E.preventDefault();let C=((S=(k=E.clipboardData)==null?void 0:k.getData("text"))!=null?S:"").replace(/\D/g,"").slice(0,6);for(let _=0;_<6;_++)u[_].value=(x=C[_])!=null?x:"";f(),u[Math.min(C.length,5)].focus(),p()}),u.push(y),c.appendChild(y)}i.appendChild(c),i.appendChild(d);for(let b of r.filter(y=>y.param===o))i.appendChild(g(e,"span",R(e,"error","atlas-embed-error"),e.errorText(b)));t.appendChild(i)}function Sa(e,t){var f,p,m,b,y,E,C,k,S;let n=O(e).createElement("form"),r=e.state.errors.find(x=>!x.param);r&&n.appendChild(g(e,"div","atlas-embed-form-error",e.errorText(r)));let o=new Map,a=e.state.errors,s=(x,_,A,w)=>Ct(e,n,o,a,x,_,A,w),l=(x,_,A)=>In(e,n,o,a,x,_,A),i=!0,c=pe[e.mode].submit,d=[];switch(t){case"collect_identifier":if(s("identifier","Email address","email",e.passkeyEnabled&&be()?"username webauthn":"username"),e.enteredIdentifier&&(o.get("identifier").value=e.enteredIdentifier),e.mode==="sign-in"&&e.passwordEnabled){s("password","Password","password","current-password");let x=[];e.emailDeliveryAvailable&&e.emailCodeEnabled?x.push("email_code"):e.emailDeliveryAvailable&&e.emailLinkEnabled&&x.push("email_link");for(let _ of x){let A=g(e,"button","atlas-embed-step-back",_==="email_code"?"Email me a code instead":"Email me a sign-in link instead");A.type="button",A.setAttribute("data-strategy",_),A.disabled=e.busy,A.addEventListener("click",()=>{var T;let w=o.get("identifier");if(!w.value.trim()){(T=w.reportValidity)==null||T.call(w),w.focus();return}Be(e,{identifier:w.value},_)}),d.push(A)}}if(e.mode==="sign-in"&&e.rememberMeEnabled){let x=g(e,"label","atlas-embed-remember"),_=O(e).createElement("input");_.type="checkbox",_.className="atlas-embed-remember-check",_.checked=e.remember,_.addEventListener("change",()=>{e.remember=_.checked}),x.appendChild(_),x.appendChild(g(e,"span","atlas-embed-remember-text","Remember me")),n.appendChild(x)}break;case"collect_first_factor":{let x=e.state.attempt?(f=$(e.state.attempt).strategies)!=null?f:[]:[],_=We(e.emailDeliveryAvailable?x:x.filter(L=>L!=="email_code"&&L!=="email_link")),A=(p=e.state.prepared)!=null?p:null,w=(y=(b=e.enteredIdentifier)!=null?b:(m=e.state.attempt)==null?void 0:m.identifier)!=null?y:"",T=(L,X,N)=>{let B=g(e,"button","atlas-embed-step-back",X);return B.type="button",B.setAttribute(N,N==="data-strategy"?L:""),B.disabled=e.busy,B.addEventListener("click",()=>void St(e,L)),B};if(A==="email_code"){let L=g(e,"p","atlas-embed-note",w?`We sent a code to ${w}. Enter it below.`:"We sent you a code. Enter it below.");L.setAttribute("data-atlas-code-sent",""),n.appendChild(L),l("code","Verification code",!0),d.push(T("email_code","Resend code","data-atlas-resend"))}else if(A==="email_link"){i=!1;let L=g(e,"p","atlas-embed-note",w?`We sent a sign-in link to ${w}. Open it on any device to continue.`:"Check your email for a sign-in link.");L.setAttribute("data-atlas-link-sent",""),n.appendChild(L),d.push(T("email_link","Resend link","data-atlas-resend"))}else if(!_.password&&_.email.length>0){i=!1;for(let L of _.email)d.push(T(L,L==="email_code"?"Email me a code":"Email me a sign-in link","data-strategy"))}else{s("password","Password","password","current-password");for(let L of _.email)d.push(T(L,L==="email_code"?"Email me a code instead":"Email me a sign-in link instead","data-strategy"))}break}case"collect_second_factor":if(e.backupCodeMode?s("code","Backup code","text","one-time-code"):l("code","Two-factor code",!0),e.trustedDeviceEnabled){let x=g(e,"label","atlas-embed-remember"),_=O(e).createElement("input");_.type="checkbox",_.className="atlas-embed-remember-check",_.checked=e.rememberDevice,_.addEventListener("change",()=>{e.rememberDevice=_.checked}),x.appendChild(_),x.appendChild(g(e,"span","atlas-embed-remember-text","Remember this device")),n.appendChild(x)}va(e,d);break;case"collect_email_code":{let x=Ze(e.state.attempt,e.account.emailVerification);if(x){i=!1;let _=(k=(C=e.enteredIdentifier)!=null?C:(E=e.state.attempt)==null?void 0:E.identifier)!=null?k:"",A=g(e,"p","atlas-embed-note",_?`We sent a confirmation link to ${_}. Open it on any device; this page continues on its own.`:"We sent you a confirmation link. Open it on any device; this page continues on its own.");A.setAttribute("data-atlas-link-sent",""),n.appendChild(A)}else l("code","Verification code",!0);if(((S=e.state.attempt)==null?void 0:S.object)==="sign_up_attempt"){let _=g(e,"button","atlas-embed-step-back",x?"Resend link":"Resend code");_.type="button",_.setAttribute("data-atlas-resend",""),_.disabled=e.busy,_.addEventListener("click",()=>void pa(e)),d.push(_)}break}case"collect_new_password":s("password","New password","password","new-password");break;case"enroll_second_factor":{let x=ya(e,n,{addField:s,addCodeField:l,trailing:d},c);x===null?i=!1:c=x;break}default:i=!1,n.appendChild(g(e,"p","atlas-embed-note","Please continue in your application."))}i&&n.appendChild(xe(e,c));for(let x of d)n.appendChild(x);if(t==="collect_second_factor"){let x=g(e,"button","atlas-embed-step-back",e.backupCodeMode?"Use your authenticator app":"Use a backup code instead");x.type="button",x.addEventListener("click",()=>{e.backupCodeMode=!e.backupCodeMode,P(e)}),n.appendChild(x)}if((t==="collect_identifier"&&e.mode==="sign-in"&&e.passwordEnabled||t==="collect_first_factor"&&o.has("password"))&&e.passwordResetEnabled){let x=g(e,"button","atlas-embed-step-back","Forgot password?");x.type="button",x.addEventListener("click",()=>ma(e)),n.appendChild(x)}return n.addEventListener("submit",x=>{x.preventDefault();let _={};for(let[A,w]of o)_[A]=w.value;if(t==="collect_second_factor"&&e.trustedDeviceEnabled&&e.rememberDevice&&(_.remember_device="true"),t==="enroll_second_factor"){ka(e,_);return}Be(e,_)}),n}function Xi(e){var i;let t=(i=e.appearance)==null?void 0:i.legal;if(!t||!t.termsUrl&&!t.privacyUrl)return null;let n=O(e),r=g(e,"div","atlas-embed-consent"),o=null;t.required&&(o=n.createElement("input"),o.type="checkbox",o.className="atlas-embed-consent-check",o.setAttribute("aria-label","Agree to the terms and privacy policy"),r.appendChild(o));let a=g(e,"span","atlas-embed-consent-text"),s=(c,d)=>{let u=n.createElement("a");return u.href=c,u.textContent=d,u.target="_blank",u.rel="noopener noreferrer",u.className="atlas-embed-consent-link",u};a.appendChild(n.createTextNode(t.required?"I agree to the ":"By continuing you agree to the "));let l=[];return t.termsUrl&&l.push(s(t.termsUrl,"Terms of Service")),t.privacyUrl&&l.push(s(t.privacyUrl,"Privacy Policy")),l.forEach((c,d)=>{d>0&&a.appendChild(n.createTextNode(" and ")),a.appendChild(c)}),a.appendChild(n.createTextNode(".")),r.appendChild(a),{row:r,checkbox:o}}function wa(e){var i;let t=O(e).createElement("form");if(!e.passwordSignUpEnabled)return t.appendChild(g(e,"div","atlas-embed-form-error",ao)),t;let n=e.state.errors.find(c=>!c.param);n&&t.appendChild(g(e,"div","atlas-embed-form-error",e.errorText(n)));let r=new Map,o=(c,d,u)=>{var y,E,C;let f=(y=u.type)!=null?y:"text",p=f==="radio"||f==="multiselect",m=g(e,p?"fieldset":"label",R(e,"field","atlas-embed-field"));m.appendChild(g(e,p?"legend":"span",R(e,"label","atlas-embed-label"),u.required?d:`${d} (optional)`));let b=O(e);if(f==="select"){let k=b.createElement("select");k.className=R(e,"input","atlas-embed-input"),k.name=c;let S=b.createElement("option");S.value="",S.textContent=u.placeholder||"Select\u2026",k.appendChild(S);for(let x of(E=u.options)!=null?E:[]){let _=b.createElement("option");_.value=x,_.textContent=x,k.appendChild(_)}m.appendChild(k),r.set(c,()=>k.value)}else if(f==="textarea"){let k=b.createElement("textarea");k.className=R(e,"input","atlas-embed-input"),k.name=c,k.rows=3,u.placeholder&&k.setAttribute("placeholder",u.placeholder),m.appendChild(k),r.set(c,()=>k.value)}else if(f==="checkbox"){let k=b.createElement("input");k.type="checkbox",k.name=c,k.className="atlas-embed-checkbox",m.classList.add("atlas-embed-field-checkbox"),m.appendChild(k),r.set(c,()=>k.checked?"true":"")}else if(f==="radio"||f==="multiselect"){let k=b.createElement("div");k.className="atlas-embed-choices";let S=[];for(let x of(C=u.options)!=null?C:[]){let _=b.createElement("label");_.className="atlas-embed-choice";let A=b.createElement("input");A.type=f==="radio"?"radio":"checkbox",A.name=c,A.value=x,S.push(A),_.appendChild(A),_.appendChild(g(e,"span",void 0,x)),k.appendChild(_)}m.appendChild(k),r.set(c,()=>{var x,_;return f==="radio"?(_=(x=S.find(A=>A.checked))==null?void 0:x.value)!=null?_:"":S.filter(A=>A.checked).map(A=>A.value).join(", ")})}else{let k=b.createElement("input");k.className=R(e,"input","atlas-embed-input"),k.type=f,k.name=c,u.autocomplete&&k.setAttribute("autocomplete",u.autocomplete),u.placeholder&&k.setAttribute("placeholder",u.placeholder),m.appendChild(k),r.set(c,()=>k.value)}for(let k of e.state.errors.filter(S=>S.param===c))m.appendChild(g(e,"span",R(e,"error","atlas-embed-error"),e.errorText(k)));t.appendChild(m)};for(let c of e.signUpFields)o(c.key,c.label,{type:c.type,required:c.required,placeholder:c.placeholder,options:c.options});o("identifier","Email address",{type:"email",required:!0,autocomplete:"email"}),o("password","Password",{type:"password",required:!0,autocomplete:"new-password"});let a=Xi(e);a&&t.appendChild(a.row);let s=xe(e,pe[e.mode].submit),l=()=>!(a!=null&&a.checkbox)||a.checkbox.checked;return s.disabled=e.busy||!l(),(i=a==null?void 0:a.checkbox)==null||i.addEventListener("change",()=>{s.disabled=e.busy||!l()}),t.appendChild(s),t.addEventListener("submit",c=>{c.preventDefault();let d={};for(let[u,f]of r)d[u]=f();ha(e,d,l())}),t}var Qi={google:'<path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/><path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/><path fill="#FBBC05" d="M5.84 14.1c-.22-.66-.35-1.36-.35-2.1s.13-1.44.35-2.1V7.06H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.94l3.66-2.84z"/><path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.06l3.66 2.84C6.71 7.31 9.14 5.38 12 5.38z"/>',microsoft:'<path fill="#F25022" d="M2 2h9.3v9.3H2z"/><path fill="#7FBA00" d="M12.7 2H22v9.3h-9.3z"/><path fill="#00A4EF" d="M2 12.7h9.3V22H2z"/><path fill="#FFB900" d="M12.7 12.7H22V22h-9.3z"/>'},el={github:{fill:"currentColor",path:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"},apple:{fill:"currentColor",path:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"},x:{fill:"currentColor",path:"M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"},notion:{fill:"currentColor",path:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"},facebook:{fill:"#0866FF",path:"M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z"},discord:{fill:"#5865F2",path:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},gitlab:{fill:"#FC6D26",path:"m23.6004 9.5927-.0337-.0862L20.3.9814a.851.851 0 0 0-.3362-.405.8748.8748 0 0 0-.9997.0539.8748.8748 0 0 0-.29.4399l-2.2055 6.748H7.5375l-2.2057-6.748a.8573.8573 0 0 0-.29-.4412.8748.8748 0 0 0-.9997-.0537.8585.8585 0 0 0-.3362.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 0 0 2.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 0 0 1.2197 0l1.4995-1.1321 2.4619-1.8633 5.006-3.7489.0125-.01a6.0682 6.0682 0 0 0 2.0094-7.003z"},spotify:{fill:"#1ED760",path:"M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"},twitch:{fill:"#9146FF",path:"M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z"},reddit:{fill:"#FF4500",path:"M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z"},figma:{fill:"#F24E1E",path:"M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z"},dropbox:{fill:"#0061FF",path:"M6 1.807L0 5.629l6 3.822 6.001-3.822L6 1.807zM18 1.807l-6 3.822 6 3.822 6-3.822-6-3.822zM0 13.274l6 3.822 6.001-3.822L6 9.452l-6 3.822zM18 9.452l-6 3.822 6 3.822 6-3.822-6-3.822zM6 18.371l6.001 3.822 6-3.822-6-3.822L6 18.371z"},gitee:{fill:"#C71D23",path:"M11.984 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.016 0zm6.09 5.333c.328 0 .593.266.592.593v1.482a.594.594 0 0 1-.593.592H9.777c-.982 0-1.778.796-1.778 1.778v5.63c0 .327.266.592.593.592h5.63c.982 0 1.778-.796 1.778-1.778v-.296a.593.593 0 0 0-.592-.593h-4.15a.592.592 0 0 1-.592-.592v-1.482a.593.593 0 0 1 .593-.592h6.815c.327 0 .593.265.593.592v3.408a4 4 0 0 1-4 4H5.926a.593.593 0 0 1-.593-.593V9.778a4.444 4.444 0 0 1 4.445-4.444h8.296Z"}};function Ca(e){let t=Qi[e];if(t)return`<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" focusable="false">${t}</svg>`;let n=el[e];return n?`<svg viewBox="0 0 24 24" width="18" height="18" fill="${n.fill}" aria-hidden="true" focusable="false"><path d="${n.path}"/></svg>`:null}function Ea(e,t){return!t||!t.id||!t.status||t.status==="complete"?!1:(e.state={...e.state,attempt:t,errors:[]},P(e),!0)}async function Aa(e){var o,a,s;if(e.busy)return;(o=e.conditionalAbort)==null||o.abort(),e.busy=!0,P(e);let t=await sn(e.client,{captcha:({retry:l})=>Ne(e,"signIn",l)});if(!t.ok||!t.data){e.busy=!1,Z(e,t.errors);return}let n;try{n=await tn(t.data)}catch{e.busy=!1,P(e);return}let r=await e.client.post("/v1/client/sign_ins/passkey/finish",n);if(e.busy=!1,r.ok&&((a=r.data)==null?void 0:a.status)==="complete"){await j(e,(s=r.data.created_session_id)!=null?s:null);return}r.ok&&Ea(e,r.data)||Z(e,r.errors)}async function Ra(e){var r,o,a;if(e.mode!=="sign-in"||!e.passkeyEnabled||!be())return;let t=!1;try{t=await Jr()}catch{t=!1}if(!t||ye(e.captchaFlows.signIn))return;(r=e.conditionalAbort)==null||r.abort();let n=new AbortController;e.conditionalAbort=n;try{let s=await sn(e.client);if(!s.ok||!s.data||n.signal.aborted)return;let l=await tn(s.data,{mediation:"conditional",signal:n.signal});if(n.signal.aborted)return;let i=await e.client.post("/v1/client/sign_ins/passkey/finish",l);i.ok&&((o=i.data)==null?void 0:o.status)==="complete"?await j(e,(a=i.data.created_session_id)!=null?a:null):i.ok&&Ea(e,i.data)}catch{}}function Pa(e){let t=g(e,"button",R(e,"socialButton","atlas-embed-social-button"),"Sign in with a passkey");return t.type="button",t.setAttribute("data-atlas-passkey",""),t.disabled=e.busy,t.addEventListener("click",()=>{Aa(e)}),t}function On(e){let t=[...e.providers];for(let n of e.nativeProviders)t.includes(n.provider)||t.push(n.provider);return t}var tl='<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" fill="none"><path d="M12 2 3 21h4l5-11 5 11h4L12 2z" fill="currentColor"/></svg>';function nl(e,t){var l;let{variant:n,labels:r}=e.social,o=(l=r.atlas)!=null?l:n==="block"?"Continue with Atlas":"Atlas",a=g(e,"button",R(e,"socialButton","atlas-embed-social-button"));a.type="button",a.setAttribute("data-atlas-provider","atlas"),a.setAttribute("data-variant",n);let s=O(e).createElement("span");if(s.className="atlas-embed-social-icon",s.innerHTML=tl,a.appendChild(s),n==="icon")a.setAttribute("aria-label","Continue with Atlas"),a.setAttribute("title","Atlas");else{let i=O(e).createElement("span");i.className="atlas-embed-social-label",i.textContent=o,a.appendChild(i)}return a.addEventListener("click",()=>{Pn(e,t,{popup:!0})}),a}function Ta(e){let t=On(e),n=g(e,"div","atlas-embed-social");n.setAttribute("data-layout",e.social.layout),n.setAttribute("data-size",e.social.size),n.setAttribute("data-variant",e.social.variant),e.signInWithAtlas.enabled&&e.signInWithAtlas.connection_id&&n.appendChild(nl(e,e.signInWithAtlas.connection_id));for(let c of t){let d=e.nativeProviders.find(f=>f.provider===c),u=c==="google"&&(d!=null&&d.client_id)?al(e,d.client_id):ol(e,c);u.getAttribute("data-atlas-provider")||u.setAttribute("data-atlas-provider",c),n.appendChild(u)}let r=e.social.layout==="carousel"?rl(e,n):n;if(!(e.social.search==="always"||e.social.search==="auto"&&t.length>jo))return r;let a=g(e,"div","atlas-embed-social-field"),s=O(e).createElement("input");s.type="search",s.className="atlas-embed-social-search",s.setAttribute("placeholder","Search sign-in options\u2026"),s.setAttribute("aria-label","Search sign-in options"),s.autocomplete="off";let l=g(e,"div","atlas-embed-social-empty");l.textContent="No matching sign-in options.",l.setAttribute("hidden","");let i=Array.from(n.children);return s.addEventListener("input",()=>{var u;let c=s.value.trim().toLowerCase(),d=0;for(let f of i){let p=(u=f.getAttribute("data-atlas-provider"))!=null?u:"",m=c===""||xt(p).toLowerCase().includes(c)||p.toLowerCase().includes(c);f.toggleAttribute("hidden",!m),m&&(d+=1)}l.toggleAttribute("hidden",d!==0),n.dispatchEvent(new Event("scroll"))}),a.appendChild(s),a.appendChild(r),a.appendChild(l),a}function rl(e,t){var c;let n=(c=O(e).defaultView)!=null?c:typeof window!="undefined"?window:null,r=g(e,"div","atlas-embed-carousel"),o=d=>{let u=g(e,"button","atlas-embed-carousel-nav");return u.type="button",u.setAttribute("data-dir",d),u.setAttribute("aria-label",d==="prev"?"Scroll to previous sign-in options":"Scroll to more sign-in options"),u.innerHTML=d==="prev"?aa:sa,u.addEventListener("click",()=>{let f=Math.max(t.clientWidth*.8,140);typeof t.scrollBy=="function"&&t.scrollBy({left:(d==="prev"?-1:1)*f,behavior:"smooth"})}),u},a=o("prev"),s=o("next"),l=()=>{let d=t.scrollWidth-t.clientWidth,u=d>2;r.setAttribute("data-overflow",u?"true":"false"),a.disabled=!u||t.scrollLeft<=1,s.disabled=!u||t.scrollLeft>=d-1};t.addEventListener("scroll",l,{passive:!0});let i=n&&n.ResizeObserver;return i?new i(l).observe(t):n&&n.addEventListener("resize",l),n!=null&&n.requestAnimationFrame&&n.requestAnimationFrame(l),l(),r.appendChild(a),r.appendChild(t),r.appendChild(s),r}function Ia(e,t,n="button"){var c;let{variant:r,labels:o}=e.social,a=xt(t),s=(c=o[t])!=null?c:r==="block"?`Continue with ${a}`:a,l=g(e,n,R(e,"socialButton","atlas-embed-social-button"));n==="button"&&(l.type="button"),l.setAttribute("data-atlas-provider",t),l.setAttribute("data-variant",r);let i=Ca(t);if(i){let d=O(e).createElement("span");d.className="atlas-embed-social-icon",d.innerHTML=i,l.appendChild(d)}if(r==="icon")l.setAttribute("aria-label",`Continue with ${a}`),l.setAttribute("title",a);else{let d=O(e).createElement("span");d.className="atlas-embed-social-label",d.textContent=s,l.appendChild(d)}return l}function ol(e,t){let n=Ia(e,t);return n.addEventListener("click",()=>{oa.has(t)?(e.handlePrompt=t,P(e)):wt(e,t)}),n}function Oa(e,t){let n=xt(t),r=O(e).createElement("form");r.className="atlas-embed-form",r.setAttribute("novalidate","true");for(let i of e.state.errors.filter(c=>!c.param))r.appendChild(g(e,"div","atlas-embed-form-error",e.errorText(i)));let o=g(e,"label",R(e,"field","atlas-embed-field"));o.appendChild(g(e,"span",R(e,"label","atlas-embed-label"),`${n} handle`));let a=O(e).createElement("input");a.className=R(e,"input","atlas-embed-input"),a.type="text",a.name="identifier",a.placeholder="you.bsky.social",a.setAttribute("autocomplete","username"),a.setAttribute("autocapitalize","none"),a.setAttribute("spellcheck","false"),o.appendChild(a),r.appendChild(o);let s=xe(e,pe[e.mode].submit);r.appendChild(s);let l=g(e,"button","atlas-embed-handle-back","Back");return l.type="button",l.addEventListener("click",()=>{e.handlePrompt=null,e.state={...e.state,errors:[]},P(e)}),r.appendChild(l),r.addEventListener("submit",i=>{i.preventDefault();let c=a.value.trim();if(!c){e.state={...e.state,errors:[{code:"validation_error",message:`Enter your ${n} handle.`}]},P(e);return}wt(e,t,c)}),r}function al(e,t){let n=Ia(e,"google","div");return n.setAttribute("role","button"),n.setAttribute("tabindex","0"),Vr({wrapper:n,clientId:t,onCredential:r=>void ga(e,"google",r),onError:()=>Se(e,"Google sign-in could not start.")}).catch(()=>{n.addEventListener("click",()=>void wt(e,"google"))}),n}function Se(e,t){e.root.textContent="";let n=g(e,"div",R(e,"card","atlas-embed-card"));n.appendChild(g(e,"p","atlas-embed-note",t)),e.root.appendChild(n)}function La(e){e.root.textContent="";let t=g(e,"div",R(e,"card","atlas-embed-card")),n=e.interaction.loading,r=g(e,"div","atlas-embed-loading");if(r.setAttribute("data-loading",n),r.setAttribute("role","status"),r.setAttribute("aria-label","Loading"),n==="skeleton")for(let a of["title","sub","input","input","button"])r.appendChild(g(e,"div",`atlas-embed-skel atlas-embed-skel-${a}`));else if(n==="dots")for(let a=0;a<3;a+=1)r.appendChild(g(e,"span","atlas-embed-dot"));else n==="bar"?r.appendChild(g(e,"span","atlas-embed-loadbar")):r.appendChild(g(e,"span","atlas-embed-spinner"));let o=g(e,"span","atlas-embed-sr","Loading\u2026");r.appendChild(o),t.appendChild(r),e.root.appendChild(t)}function Z(e,t){e.state={...e.state,errors:[...t]},P(e)}function P(e){var d,u,f,p,m,b,y,E,C,k;e.root.textContent="";let t=g(e,"div",R(e,"card","atlas-embed-card")),n=(u=(d=e.appearance)==null?void 0:d.logoUrl)!=null?u:null;if(n){let S=O(e).createElement("img");S.className="atlas-embed-logo",S.src=n,S.alt=(p=(f=e.appearance)==null?void 0:f.applicationName)!=null?p:"",t.appendChild(S)}if(e.resetFlow){let S=`reset_${ke(e.resetFlow)}`;if(t.setAttribute("data-step",S),S!==e.lastStepKind&&t.setAttribute("data-enter",""),e.lastStepKind=S,t.appendChild(xa(e)),(m=e.appearance)!=null&&m.footer&&t.appendChild(g(e,"p",R(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(t),t.hasAttribute("data-enter")){let x=t.querySelector("[data-atlas-autofocus]");x instanceof HTMLElement&&x.focus()}return}let r=Ce(e.state);if(r){t.setAttribute("data-step","recovery_codes"),e.lastStepKind!=="recovery_codes"&&t.setAttribute("data-enter",""),e.lastStepKind="recovery_codes",t.appendChild(_a(e,r)),e.root.appendChild(t);return}let o=e.state.attempt?$(e.state.attempt):{kind:"collect_identifier"},a=e.mode==="sign-up"&&!e.state.attempt,s=a||o.kind==="collect_identifier",l=e.handlePrompt?"handle":o.kind;t.setAttribute("data-step",l),l!==e.lastStepKind&&t.setAttribute("data-enter",""),e.lastStepKind=l;let i=(y=(b=e.appearance)==null?void 0:b.headline)!=null?y:pe[e.mode].title;t.appendChild(g(e,"h1",R(e,"title","atlas-embed-title"),i));let c=s?null:sl(e,o.kind);if(c?t.appendChild(c):(E=e.appearance)!=null&&E.subheadline&&t.appendChild(g(e,"p",R(e,"subtitle","atlas-embed-subtitle"),e.appearance.subheadline)),e.flash&&t.appendChild(g(e,"div","atlas-embed-flash",e.flash)),e.handlePrompt){t.appendChild(Oa(e,e.handlePrompt)),(C=e.appearance)!=null&&C.footer&&t.appendChild(g(e,"p",R(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(t);return}if(s&&(On(e).length>0||e.signInWithAtlas.enabled)&&(t.appendChild(Ta(e)),t.appendChild(g(e,"div",R(e,"divider","atlas-embed-divider"),"or"))),t.appendChild(a?wa(e):Sa(e,o.kind)),s&&e.mode==="sign-in"&&e.passkeyEnabled&&be()&&t.appendChild(Pa(e)),(k=e.appearance)!=null&&k.footer&&t.appendChild(g(e,"p",R(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(t),t.hasAttribute("data-enter")){let S=t.querySelector("[data-atlas-autofocus]");S instanceof HTMLElement&&S.focus()}}function sl(e,t){let n=e.enteredIdentifier,r=null,o=!1;switch(t){case"collect_email_code":r=Ze(e.state.attempt,e.account.emailVerification)?"Check your email":n?`Enter the code we sent to ${n}`:"Enter the code we sent to your email",o=!0;break;case"collect_first_factor":r=n?`Enter the password for ${n}`:"Enter your password",o=!0;break;case"collect_second_factor":r=e.backupCodeMode?"Enter one of your backup codes":"Enter the code from your authenticator app";break;case"collect_new_password":r="Choose a new password";break;case"enroll_second_factor":r=D(e,"mfa.enrollChoose");break;default:return null}let a=g(e,"div","atlas-embed-step-context");if(a.appendChild(g(e,"p",R(e,"subtitle","atlas-embed-subtitle"),r)),o){let s=g(e,"button","atlas-embed-step-back","Use a different email");s.type="button",s.addEventListener("click",()=>il(e)),a.appendChild(s)}return a}function il(e){e.state=z,e.backupCodeMode=!1,e.handlePrompt=null,e.enteredIdentifier=null,P(e)}var we=class{constructor(t,n){this.root=t;this.options=n;h(this,"client");h(this,"mode");h(this,"appearance",null);h(this,"design",null);h(this,"appliedDesign");h(this,"providers",[]);h(this,"nativeProviders",[]);h(this,"signInWithAtlas",{enabled:!1});h(this,"social",An(void 0,void 0));h(this,"codeInputStyle","boxes");h(this,"interaction",_t(void 0,void 0));h(this,"backupCodeMode",!1);h(this,"enrollment",null);h(this,"secondFactorCode",null);h(this,"enteredIdentifier",null);h(this,"lastStepKind",null);h(this,"signUpFields",[]);h(this,"passwordEnabled",!0);h(this,"emailCodeEnabled",!1);h(this,"emailLinkEnabled",!1);h(this,"emailDeliveryAvailable",!0);h(this,"passkeyEnabled",!1);h(this,"passwordResetEnabled",!0);h(this,"passwordSignUpEnabled",!0);h(this,"conditionalAbort");h(this,"linkPoll",null);h(this,"account",{...ln});h(this,"rememberMeEnabled",!1);h(this,"remember",!0);h(this,"trustedDeviceEnabled",!1);h(this,"rememberDevice",!1);h(this,"captchaFlows",{});h(this,"captchaHost");h(this,"state",z);h(this,"resetFlow",null);h(this,"flash",null);h(this,"handlePrompt",null);h(this,"busy",!1);h(this,"recorder");var r,o,a;this.mode=(r=n.mode)!=null?r:"sign-in",this.interaction=_t(void 0,(o=n.appearance)==null?void 0:o.interaction),this.client=Qo({publishableKey:n.publishableKey,frontendApi:n.frontendApi,fetchImpl:n.fetchImpl,locale:(a=n.locale)!=null?a:Gn(n.localization),referral:n.referral,referralConsent:n.referralConsent})}errorText(t){return Kn(t,this.options.localization)}async mount(){var r,o,a,s,l,i,c,d,u,f,p,m,b,y,E,C,k,S,x,_,A,w,T,L,X,N,B,Mn,Un,zn,Nn;if(na((r=this.root.ownerDocument)!=null?r:document),this.root.classList.add("atlas-embed-root"),this.resolveDesign(null),this.applyTheme(),this.applyInteraction(),La(this),await da(this))return;let n=await ea(this.client);if(n){this.appearance=n.appearance;let Ba=(o=n.provider_scopes)!=null?o:{},$n=At=>{let Rt=Ba[At];return Rt?this.mode==="sign-up"?Rt.sign_up:Rt.sign_in:!0};this.providers=Zo((a=n.providers)!=null?a:[],n.appearance).filter($n),this.nativeProviders=((s=n.native_providers)!=null?s:[]).filter(At=>$n(At.provider)),this.passwordEnabled=(i=(l=n.strategies)==null?void 0:l.password)!=null?i:!0,this.passkeyEnabled=(d=(c=n.strategies)==null?void 0:c.passkey)!=null?d:!1,this.emailCodeEnabled=(f=(u=n.strategies)==null?void 0:u.emailCode)!=null?f:!1,this.emailLinkEnabled=(m=(p=n.strategies)==null?void 0:p.emailLink)!=null?m:!1,this.passwordResetEnabled=(y=(b=n.email_delivery)==null?void 0:b.password_reset)!=null?y:!0,this.emailDeliveryAvailable=(C=(E=n.email_delivery)==null?void 0:E.available)!=null?C:!0,this.passwordSignUpEnabled=(S=(k=n.email_delivery)==null?void 0:k.password_sign_up)!=null?S:!0,this.account=cn(n),this.signInWithAtlas=(x=n.sign_in_with_atlas)!=null?x:{enabled:!1},this.rememberMeEnabled=n.rememberMe===!0,this.trustedDeviceEnabled=n.rememberDevice===!0,this.captchaFlows=(_=n.captchaFlows)!=null?_:{},await Yt(this.client)&&(this.captchaFlows=so(this.captchaFlows)),this.resolveDesign($o(n)),this.applyTheme()}this.social=An(this.design?{...(A=this.appearance)==null?void 0:A.socialButtons,...this.design.socialButtons}:(w=this.appearance)==null?void 0:w.socialButtons,(T=this.options.appearance)==null?void 0:T.socialButtons),this.codeInputStyle=Ho((L=this.appearance)==null?void 0:L.codeInput,(X=this.options.appearance)==null?void 0:X.codeInput),this.interaction=_t(this.design?{...(N=this.appearance)==null?void 0:N.interaction,...this.design.interaction}:(B=this.appearance)==null?void 0:B.interaction,(Mn=this.options.appearance)==null?void 0:Mn.interaction),this.applyInteraction(),this.signUpFields=(zn=(Un=this.appearance)==null?void 0:Un.signUpFields)!=null?zn:[];try{this.recorder=new Ve((Nn=this.root.ownerDocument)!=null?Nn:document)}catch{}P(this),Ra(this)}applyTheme(){var r,o,a,s,l,i;let t=(o=(r=this.design)==null?void 0:r.tokens)!=null?o:Go(this.appearance,this.options.appearance),n=qo(t);for(let[c,d]of Object.entries(n))this.root.style.setProperty(c,d);this.root.style.setProperty("--atlas-embed-color-text-on-primary",Vo(t.colorPrimary)),this.root.style.setProperty("--atlas-embed-color-focus-ring",(l=(s=(a=this.options.appearance)==null?void 0:a.variables)==null?void 0:s.colorFocusRing)!=null?l:Yo(t.colorPrimary,[t.colorCard,t.colorBackground])),this.design&&(this.appliedDesign=Bo((i=this.root.ownerDocument)!=null?i:document,this.root,this.design.render,this.appliedDesign))}resolveDesign(t){var o,a,s;let n=(a=(o=this.root.ownerDocument)==null?void 0:o.defaultView)!=null?a:typeof window!="undefined"?window:null,r=!1;try{r=!!((s=n==null?void 0:n.matchMedia)!=null&&s.call(n,"(prefers-color-scheme: dark)").matches)}catch{}this.design=ra(t,this.options.appearance,{frontendApi:this.options.frontendApi,prefersDark:r})}applyInteraction(){let t=this.interaction;this.root.setAttribute("data-button-style",t.buttonStyle),this.root.setAttribute("data-button-effect",t.buttonEffect),this.root.setAttribute("data-shadow",t.shadow),this.root.setAttribute("data-density",t.density),this.root.setAttribute("data-input-style",t.inputStyle);let n=t.animations?Ko[t.motionSpeed]:0;this.root.style.setProperty("--atlas-embed-motion",`${n}ms`)}};var G={};function Da(e){G=e}function Fa(e){if(!e)return{};let t=e.dataset,n={};return t.atlasKey&&(n.publishableKey=t.atlasKey),t.atlasFapi&&(n.frontendApi=t.atlasFapi),t.atlasRedirect&&(n.redirect=t.atlasRedirect),t.atlasLocale&&(n.locale=t.atlasLocale),n}function Ma(e,t){var f,p,m,b,y,E,C,k,S,x,_;let n=e.dataset,r=A=>{var w;return(w=e.getAttribute(A))!=null?w:void 0},o=(p=(f=n.atlasKey)!=null?f:r("publishable-key"))!=null?p:G.publishableKey,a=(b=(m=n.atlasFapi)!=null?m:r("frontend-api"))!=null?b:G.frontendApi,s=(E=(y=n.atlasRedirect)!=null?y:r("redirect"))!=null?E:G.redirect;if(!o||!a)return null;let l={publishableKey:o,frontendApi:a,mode:t};s&&(l.redirect=s);let i=(k=(C=n.atlasLocale)!=null?C:r("locale"))!=null?k:G.locale;i&&(l.locale=i);let c=(S=n.atlasPreset)!=null?S:r("preset");c&&(l.appearance={preset:c});let d=(x=n.atlasReferral)!=null?x:r("referral");(d==="off"||d==="false")&&(l.referral=!1);let u=(_=n.atlasReferralConsent)!=null?_:r("referral-consent");return(u==="granted"||u==="denied")&&(l.referralConsent=u),l}function Ua(e,t={}){var o,a,s,l,i;let n=(o=t.publishableKey)!=null?o:G.publishableKey,r=(a=t.frontendApi)!=null?a:G.frontendApi;return!n||!r?null:{...t,publishableKey:n,frontendApi:r,redirect:(s=t.redirect)!=null?s:G.redirect,...((l=t.locale)!=null?l:G.locale)?{locale:(i=t.locale)!=null?i:G.locale}:{},mode:e}}var Et=class extends HTMLElement{constructor(){super(...arguments);h(this,"widget",null)}connectedCallback(){if(this.widget)return;let n=Ma(this,this.mode);if(!n){this.textContent="Atlas: set data-atlas-key (publishable key) and data-atlas-fapi (frontend API origin).";return}this.widget=new we(this,n),this.widget.mount()}},Ln=class extends Et{constructor(){super(...arguments);h(this,"mode","sign-in")}},Dn=class extends Et{constructor(){super(...arguments);h(this,"mode","sign-up")}};function Fn(){typeof customElements!="undefined"&&(customElements.get("atlas-sign-in")||customElements.define("atlas-sign-in",Ln),customElements.get("atlas-sign-up")||customElements.define("atlas-sign-up",Dn))}function ll(e){let t=typeof e=="string"?document.querySelector(e):e;return t instanceof HTMLElement?t:null}function za(e,t,n){let r=ll(t);if(!r)return null;let o=Ua(e,n);if(!o)return r.textContent="Atlas: a publishable key and a frontend API origin are required to mount the widget.",null;let a=new we(r,o);return a.mount(),a}function Na(e,t={}){return za("sign-in",e,t)}function $a(e,t={}){return za("sign-up",e,t)}function cl(){var t;let e=document.currentScript;return e instanceof HTMLScriptElement?e:(t=document.querySelector("script[data-atlas-key]"))!=null?t:document.querySelector('script[src*="embed.js"]')}function dl(){Da(Fa(cl())),Fn(),window.Atlas={mountSignIn:Na,mountSignUp:$a,defineElements:Fn}}dl();})();
387
+ `;function as(e=document){var n;if(e.querySelector(`style[data-${ss}]`))return;let t=e.createElement("style");t.setAttribute(`data-${ss}`,""),t.textContent=el,((n=e.head)!=null?n:e.documentElement).appendChild(t)}function is(e,t,n={}){var u;let r=$o({instance:(t==null?void 0:t.instanceDesign)===!1?null:e,preset:t==null?void 0:t.preset,design:t==null?void 0:t.design,warn:Ho});if(!r)return null;let s=r.colorScheme==="dark"||r.colorScheme==="auto"&&!!n.prefersDark?r.paletteDark:r.palette,a={colorPrimary:s.primary,colorText:s.text,colorBackground:s.background,colorAccent:s.accent,colorCard:s.surface,colorBorder:s.border,borderRadius:`${Math.min(r.shape.controlRadius,24)}px`,fontFamily:bn(r.typography.font)};for(let[f,p]of Object.entries((u=t==null?void 0:t.variables)!=null?u:{}))p!==void 0&&(a[f]=p);let l=r.elevation.cardShadow==="xl"?"lg":r.elevation.cardShadow,i={buttonStyle:r.buttons.style==="gradient"?"solid":r.buttons.style,shadow:r.card.style==="outline"||r.card.style==="none"?"none":l,density:r.spacing.density==="compact"?"compact":"comfortable",inputStyle:r.inputs.style},c=r.buttons.socialLayout==="icons"?{variant:"icon",layout:"grid"}:{layout:r.buttons.socialLayout==="grid"?"grid":"list"},d=No(JSON.stringify(r));return{render:{style:{},attributes:{...Cn(r),"data-atlas-design":d},css:"",key:d,fontStylesheets:Bo(r,n.frontendApi)},tokens:a,interaction:i,socialButtons:c,resolved:r}}var ls=new Set(["bluesky"]),cs='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg>',ds='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 18l6-6-6-6"/></svg>',pe={"sign-in":{title:"Sign in",submit:"Continue"},"sign-up":{title:"Create your account",submit:"Continue"}};function L(e){var t;return(t=e.root.ownerDocument)!=null?t:document}function g(e,t,n,r){let o=L(e).createElement(t);return n&&(o.className=n),r!=null&&(o.textContent=r),(o.classList.contains("atlas-embed-button")||o.classList.contains("atlas-embed-social-button"))&&tl(e,o),o}function R(e,t,n){return es(t,n,e.options.appearance)}function tl(e,t){e.interaction.buttonEffect!=="ripple"||!e.interaction.animations||t.addEventListener("pointerdown",n=>{let r=t.getBoundingClientRect(),o=Math.max(r.width,r.height),s=L(e).createElement("span");s.className="atlas-embed-ripple",s.style.width=s.style.height=`${o}px`,s.style.left=`${n.clientX-r.left-o/2}px`,s.style.top=`${n.clientY-r.top-o/2}px`,s.addEventListener("animationend",()=>s.remove()),t.appendChild(s)})}function xe(e,t){let n=g(e,"button",R(e,"buttonPrimary","atlas-embed-button"));if(n.type="submit",n.disabled=e.busy,e.busy){n.setAttribute("data-busy",""),n.setAttribute("aria-label",t);let r=g(e,"span","atlas-embed-btn-spinner");r.setAttribute("aria-hidden","true"),n.appendChild(r)}else n.textContent=t;return n}function us(e,t=typeof window!="undefined"?window.location.origin:""){if(!e||typeof e!="string")return null;if(e.startsWith("/")&&!e.startsWith("//"))try{return t?new URL(e,t).toString():e}catch{return null}let n;try{n=new URL(e)}catch{return null}return t&&n.origin===t||n.protocol==="https:"?n.toString():null}async function $e(e,t,n=!1){var l,i,c;let r=e.captchaFlows[t];if(!(n?!!r&&Oe(r.provider,r):ye(r))||!r)return null;let s=(l=e.root.ownerDocument)!=null?l:document,a=s.createElement("div");a.className="atlas-embed-captcha",((c=(i=e.root.parentElement)!=null?i:s.body)!=null?c:s.documentElement).appendChild(a);try{return await sn(r,a,{atlas:{labels:nn(e.options.localization)}})}catch{return null}finally{a.remove()}}var Rn=new WeakMap;async function nl(e){let t=Rn.get(e);if(t){let o=await t;return o?{...o,owner:!1}:null}let n=Jn({win:e}).catch(()=>null);Rn.set(e,n),n.finally(()=>Rn.delete(e));let r=await n;return r?{...r,owner:!0}:null}async function gs(e){var o,s;let t=(s=(o=e.root.ownerDocument)==null?void 0:o.defaultView)!=null?s:typeof window!="undefined"?window:null;if(!t)return!1;let n=await nl(t);if(n!=null&&n.delivered)return we(e,"Signed in. You can close this window."),!0;if(n!=null&&n.owner){let a=Qn(n.payload);if(a!=null&&a.ticket&&a.attemptId)return await ps(e,t,a.attemptId,a.ticket),!0;if(a!=null&&a.continuationUrl)return t.location.replace(a.continuationUrl),!0}let r=er(t.location.search);return r?r.ticket?(await ps(e,t,r.attemptId,r.ticket,()=>fs(e,t)),!0):(r.status&&(e.state=Ze({id:r.attemptId,status:r.status}),fs(e,t)),!1):!1}async function ps(e,t,n,r,o){let s=await ae(e,n,r);o==null||o(),!(s&&await Zn({win:t}).catch(()=>!1))&&await j(e,n)}function fs(e,t){try{t.history.replaceState({},t.document.title,je(t.location.href))}catch{}}async function ae(e,t,n){return e.options.preview?!1:(await e.client.post("/v1/client/tickets/exchange",{attempt_id:t,ticket:n,remember:e.remember})).ok}async function j(e,t){var o,s;let n=(s=(o=e.root.ownerDocument)==null?void 0:o.defaultView)!=null?s:typeof window!="undefined"?window:null,r=us(e.options.redirect,n?n.location.origin:void 0);if(e.root.dispatchEvent(new CustomEvent("atlas:complete",{bubbles:!0,detail:{attemptId:t,redirected:!!r}})),e.options.preview){we(e,"Sign-in works \u2014 this is a preview, so no session was created.");return}if(r&&n){n.location.assign(r);return}we(e,"You are signed in.")}function Be(e,t){Nr({api:e.options.frontendApi,publishableKey:e.options.publishableKey,attemptId:t!=null?t:void 0,kind:e.mode==="sign-up"?"sign_up":"sign_in",recorder:e.recorder,fetchImpl:e.options.fetchImpl})}async function We(e,t,n){var l,i,c,d,u;if(e.busy)return;if((l=e.conditionalAbort)==null||l.abort(),e.flash=null,typeof t.identifier=="string"&&t.identifier.trim()&&(e.enteredIdentifier=t.identifier.trim()),e.busy=!0,Be(e,(i=e.state.attempt)==null?void 0:i.id),P(e),e.state=await Te(e.client,e.state,t),e.state.attempt&&z(e.state.attempt).kind==="collect_captcha"){let f=await $e(e,"signIn",!0);f&&(e.state=await Te(e.client,e.state,{identifier:(d=(c=e.enteredIdentifier)!=null?c:t.identifier)!=null?d:"",captcha_token:f}))}let r=e.state.attempt?z(e.state.attempt):null;n&&(r==null?void 0:r.kind)==="collect_first_factor"&&e.state.errors.length===0?r.strategies.includes(n)?await wt(e,n,!1):e.state={...e.state,errors:[{code:"STRATEGY_DISABLED",message:"That sign-in method is not available for this account."}]}:(r==null?void 0:r.kind)==="collect_first_factor"&&t.password&&e.state.errors.length===0&&(e.state=await Te(e.client,e.state,{password:t.password})),e.busy=!1;let o=e.state.attempt?z(e.state.attempt):null;e.mode==="sign-in"&&e.passwordEnabled&&(o==null?void 0:o.kind)==="collect_first_factor"&&!e.state.prepared&&(e.state={...N,errors:e.state.errors});let s=e.state.attempt?z(e.state.attempt):null;if((s==null?void 0:s.kind)==="collect_first_factor"&&!e.state.prepared&&e.state.errors.length===0){let f=He(e.emailDeliveryAvailable?s.strategies:s.strategies.filter(p=>p!=="email_code"&&p!=="email_link")).autoSend;f&&await wt(e,f,!1)}let a=e.state.attempt;if(Ce(e.state)){P(e);return}if((a==null?void 0:a.status)==="complete"){let f=(u=a.id)!=null?u:null;e.state.ticket&&f&&await ae(e,f,e.state.ticket),await j(e,f);return}P(e)}async function ms(e){var n,r;if(e.busy||!Ce(e.state))return;e.state=vr(e.state);let t=(r=(n=e.state.attempt)==null?void 0:n.id)!=null?r:null;e.busy=!0;try{e.state.ticket&&t&&await ae(e,t,e.state.ticket)}finally{e.busy=!1}await j(e,t)}async function wt(e,t,n=!0){var s;if(n){if(e.busy)return;e.busy=!0,P(e)}let r=(s=e.state.prepared)!=null?s:null,o=await Wr(e.client,e.state,t);e.state=o.errors.length>0?{...o,prepared:r}:o,t==="email_link"&&o.errors.length===0&&bs(e),n&&(e.busy=!1,P(e))}async function hs(e){e.busy||(e.busy=!0,P(e),e.state=await Br(e.client,e.state),e.busy=!1,e.flash=e.state.errors.length===0?"We sent you a new email.":null,P(e))}function bs(e){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=setInterval(()=>{(async()=>{var s,a;if(!en(e.state)){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;return}let t=(s=e.state.attempt)==null?void 0:s.status,{state:n,ticket:r}=await Hr(e.client,e.state);if(e.state=n,!r&&n.attempt&&n.attempt.status!==t&&P(e),!r||!n.attempt)return;e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;let o=(a=n.attempt.id)!=null?a:null;o&&await ae(e,o,r),await j(e,o)})()},2e3)}async function St(e,t,n){var l,i,c;Be(e);let r=(i=(l=e.root.ownerDocument)==null?void 0:l.defaultView)!=null?i:typeof window!="undefined"?window:null,o=r?je(r.location.href):e.options.frontendApi,s=await e.client.post("/v1/client/sign_ins/oauth",{provider:t,redirect_url:o,...n?{identifier:n}:{}}),a=(c=s.data)==null?void 0:c.authorization_url;a&&r?r.location.assign(a):(e.handlePrompt=null,Z(e,s.errors))}async function Pn(e,t,n={}){var l,i,c;Be(e);let r=(i=(l=e.root.ownerDocument)==null?void 0:l.defaultView)!=null?i:typeof window!="undefined"?window:null,o=r?je(r.location.href):e.options.frontendApi;if(n.popup&&r){await ol(e,t,r,o);return}let s=await e.client.post("/v1/client/sign_ins/sso",{connection_id:t,redirect_url:o}),a=(c=s.data)==null?void 0:c.authorization_url;a&&r?r.location.assign(a):Z(e,s.errors)}function rl(e){let t=e.options.frontendApi;try{return new URL(/^https?:\/\//.test(t)?t:`https://${t}`).origin}catch{return t}}async function ol(e,t,n,r){var u;let o=n.open("about:blank","atlas-sso","width=480,height=640,menubar=no,toolbar=no,location=no,status=no");if(!o){await Pn(e,t);return}let s=r.includes("?")?"&":"?",a=`${r}${s}__atlas_display=popup`,l=rl(e),i=f=>{if(f.origin!==l)return;let p=f.data;if(!(!p||p.type!=="atlas-sso")){n.removeEventListener("message",i);try{o.close()}catch{}if(p.error){Z(e,[{code:"sso_popup_cancelled",message:"Sign-in was cancelled."}]);return}if(p.status==="complete"&&p.ticket&&p.attempt_id){let m=p.attempt_id,b=p.ticket;(async()=>(await ae(e,m,b),await j(e,m)))();return}p.attempt_id&&p.status&&(e.state=Ze({id:p.attempt_id,status:p.status}),P(e))}};n.addEventListener("message",i);let c=await e.client.post("/v1/client/sign_ins/sso",{connection_id:t,redirect_url:a}),d=(u=c.data)==null?void 0:u.authorization_url;if(d)try{o.location.assign(d)}catch{try{o.close()}catch{}n.removeEventListener("message",i),n.location.assign(d)}else{n.removeEventListener("message",i);try{o.close()}catch{}Z(e,c.errors)}}async function ys(e,t,n){let r=await e.client.post("/v1/client/sign_ins/id_token",qr({provider:t,idToken:n})),o=Vr(r.data);if(!o){Z(e,r.errors);return}if(o.status==="complete"&&o.ticket){await ae(e,o.attemptId,o.ticket),await j(e,o.attemptId);return}e.state=Ze({id:o.attemptId,status:o.status}),P(e)}function ks(e){e.resetFlow={...Le},P(e)}async function Tn(e,t){var r,o,s;if(e.busy||!e.resetFlow)return;if(e.busy=!0,Be(e),P(e),ke(e.resetFlow)==="request"){typeof t.email=="string"&&t.email.trim()&&(e.enteredIdentifier=t.email.trim());let a=await $e(e,"passwordReset");e.resetFlow=await so(e.client,(r=t.email)!=null?r:"",a!=null?a:void 0),(o=e.resetFlow.attempt)!=null&&o.poll_secret&&sl(e)}else e.resetFlow=await ao(e.client,e.resetFlow,{code:t.code,password:t.password});e.busy=!1;let n=e.resetFlow;if(((s=n==null?void 0:n.attempt)==null?void 0:s.status)==="complete"){let a=n.attempt.id;e.resetFlow=null,n.ticket?(await ae(e,a,n.ticket),await j(e,a)):(e.flash="Password updated. Sign in with your new password.",e.state=N,P(e));return}P(e)}function sl(e){var n,r;e.linkPoll&&clearInterval(e.linkPoll);let t=(r=(n=e.resetFlow)==null?void 0:n.attempt)==null?void 0:r.id;e.linkPoll=setInterval(()=>{(async()=>{var a;let o=e.resetFlow;if(!(o!=null&&o.attempt)||o.attempt.id!==t||o.attempt.status!=="needs_email_verification"){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;return}let s=await io(e.client,o);e.resetFlow!==o||((a=s.attempt)==null?void 0:a.status)==="needs_email_verification"||(e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null,e.resetFlow=s,P(e))})()},2e3)}async function vs(e,t,n=!0){var c;if(e.busy)return;e.busy=!0,Be(e),P(e);let{identifier:r,password:o,...s}=t,a={};for(let[d,u]of Object.entries(s))u&&(a[d]=u);let l=await $e(e,"signUp");e.state=await Qt(e.client,{email:r!=null?r:"",password:o!=null?o:"",fields:a,consent:n,captchaToken:l!=null?l:void 0}),e.busy=!1;let i=e.state.attempt;if((i==null?void 0:i.status)==="complete"){let d=(c=i.id)!=null?c:null;e.state.ticket&&d&&await ae(e,d,e.state.ticket),await j(e,d);return}en(e.state)&&bs(e),P(e)}var al={"mfa.enrollChoose":"Set up a second step for signing in.","mfa.enrollTotpOption":"Use an authenticator app","mfa.enrollSmsOption":"Use text messages","mfa.enrollScan":"Scan this QR code with your authenticator app, or enter the setup key.","mfa.enrollQrAlt":"QR code for your authenticator app","mfa.enrollSetupKey":"Setup key","mfa.enrollPreparing":"Setting up\u2026","mfa.enrollFirstCodeLabel":"Code from your authenticator app","mfa.enrollSecondCodeLabel":"The next code it shows","mfa.phoneLabel":"Mobile number","mfa.phoneHint":"Include the country code, for example +14155550101.","mfa.sendCode":"Text me a code","mfa.codeTextedTo":"Enter the code we texted to {phone}.","mfa.codeLabel":"Code","mfa.smsCodeOption":"Text me a code instead","mfa.recoveryCodesTitle":"Save your recovery codes","mfa.recoveryCodesHelp":"Each code works once. If you can't use your second step, sign in with one of these. Keep them somewhere safe: they won't be shown again.","mfa.recoveryCodesCopy":"Copy codes","mfa.recoveryCodesCopied":"Copied.","mfa.recoveryCodesDownload":"Download as .txt","mfa.recoveryCodesSaved":"I've saved my codes","signIn.emailCodeOption":"Email me a code instead","signIn.codeSentTo":"We sent a code to {email}. Enter it below.","signIn.resendCode":"Resend code","signIn.sending":"Sending\u2026"};function D(e,t,n={}){var a;let r=e.options.localization,o=typeof r=="function"?r(t):r&&typeof r=="object"?r[t]:void 0;return(typeof o=="string"&&o.trim()?o:(a=al[t])!=null?a:t).replace(/\{(\w+)\}/g,(l,i)=>{var c;return(c=n[i])!=null?c:l})}function _s(e){var n;let t=(n=e.state.attempt)==null?void 0:n.id;return t?(e.enrollment||(e.enrollment=hr(e.client,()=>Mt(e.account)),e.enrollment.subscribe(()=>queueMicrotask(()=>P(e)))),e.enrollment.start(t),e.enrollment):null}function xs(e,t,n,r){var i;let o=_s(e);if(!o)return r;let s=o.state,a=(c,d)=>{let u=g(e,"button","atlas-embed-step-back",D(e,c==="totp"?"mfa.enrollTotpOption":"mfa.enrollSmsOption"));u.type="button",u.setAttribute("data-atlas-mfa-method",c),u.disabled=e.busy||s.busy,u.addEventListener("click",()=>void o.choose(c)),Array.isArray(d)?d.push(u):d.appendChild(u)};if(s.method===null){t.appendChild(g(e,"p","atlas-embed-note",D(e,"mfa.enrollChoose")));for(let c of s.options)a(c,t)}else if(s.method==="totp"){let c=s.enrollment;if(c){if(t.appendChild(g(e,"p","atlas-embed-note",D(e,"mfa.enrollScan"))),c.qrCode){let d=L(e).createElement("img");d.className="atlas-embed-mfa-qr",d.setAttribute("data-atlas","mfa-qr"),d.src=c.qrCode,d.alt=D(e,"mfa.enrollQrAlt"),d.width=180,d.height=180,t.appendChild(d)}if(c.secret){let d=g(e,"p","atlas-embed-note",`${D(e,"mfa.enrollSetupKey")}: `);d.setAttribute("data-atlas","mfa-setup-key"),d.appendChild(g(e,"code","atlas-embed-mfa-key",mr(c.secret))),t.appendChild(d)}n.addCodeField("code",D(e,"mfa.enrollFirstCodeLabel"),!0),s.totpCodes>=2&&n.addCodeField("secondCode",D(e,"mfa.enrollSecondCodeLabel"),!1)}else{let d=g(e,"p","atlas-embed-note",s.busy?D(e,"mfa.enrollPreparing"):"");d.setAttribute("aria-live","polite"),t.appendChild(d)}}else if(!s.enrollment)n.addField("phone",D(e,"mfa.phoneLabel"),"tel","tel"),t.appendChild(g(e,"p","atlas-embed-note",D(e,"mfa.phoneHint")));else{let c=g(e,"p","atlas-embed-note",D(e,"mfa.codeTextedTo",{phone:(i=s.enrollment.phone)!=null?i:""}));c.setAttribute("data-atlas","mfa-code-texted"),t.appendChild(c),n.addCodeField("code",D(e,"mfa.codeLabel"),!0);let d=g(e,"button","atlas-embed-step-back",D(e,"signIn.resendCode"));d.type="button",d.setAttribute("data-atlas-resend",""),d.disabled=e.busy||s.busy,d.addEventListener("click",()=>void o.resend()),n.trailing.push(d)}for(let c of s.errors){let d=g(e,"p","atlas-embed-error",e.errorText(c));d.setAttribute("role","alert"),t.appendChild(d)}if(s.method!==null&&s.options.length>1)for(let c of s.options.filter(d=>d!==s.method))a(c,n.trailing);let l=br(s);return l===null?null:l==="mfa.sendCode"?D(e,"mfa.sendCode"):r}async function ws(e,t){let n=_s(e);if(!n)return;let r=await n.submit(t);r&&await We(e,r)}function Ss(e,t){var a;let n=(a=e.state.attempt)==null?void 0:a.id;if(!n)return;let r=Mt(e.account),o=e.secondFactorCode&&e.secondFactorCode.attemptId===n?e.secondFactorCode:null,s=[];r.sms&&s.push("sms"),r.emailCode&&s.push("email_code");for(let l of s){let i=l==="sms"?"sms-second-factor":"email-second-factor";if((o==null?void 0:o.strategy)===l&&o.sentTo!==void 0){let u=g(e,"p","atlas-embed-note",l==="sms"?D(e,"mfa.codeTextedTo",{phone:o.sentTo}):D(e,"signIn.codeSentTo",{email:o.sentTo}));u.setAttribute("data-atlas",`${i}-sent`),u.setAttribute("aria-live","polite"),t.push(u);continue}let c=(o==null?void 0:o.strategy)===l&&o.busy===!0,d=g(e,"button","atlas-embed-step-back",c?D(e,"signIn.sending"):D(e,l==="sms"?"mfa.smsCodeOption":"signIn.emailCodeOption"));if(d.type="button",d.setAttribute("data-atlas",i),d.disabled=e.busy||c,d.addEventListener("click",()=>{e.secondFactorCode={attemptId:n,strategy:l,busy:!0},P(e),yr(e.client,n,l).then(({sentTo:u})=>{e.secondFactorCode={attemptId:n,strategy:l,sentTo:u},P(e)},u=>{e.secondFactorCode={attemptId:n,strategy:l,error:u instanceof Error?u.message:String(u)},P(e)})}),t.push(d),(o==null?void 0:o.strategy)===l&&o.error){let u=g(e,"p","atlas-embed-error",o.error);u.setAttribute("role","alert"),t.push(u)}}}function Cs(e,t){var a,l;let n=g(e,"div","atlas-embed-recovery-codes");n.setAttribute("data-atlas","recovery-codes"),n.appendChild(g(e,"h2",R(e,"title","atlas-embed-title"),D(e,"mfa.recoveryCodesTitle"))),n.appendChild(g(e,"p","atlas-embed-note",D(e,"mfa.recoveryCodesHelp")));let r=g(e,"ul","atlas-embed-recovery-list");r.setAttribute("data-atlas","recovery-codes-list"),r.setAttribute("style","list-style:none;padding:0;margin:8px 0 12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center");for(let i of t){let c=g(e,"li");c.appendChild(g(e,"code","atlas-embed-mfa-key",i)),r.appendChild(c)}n.appendChild(r);let o=((a=L(e).defaultView)!=null?a:globalThis).navigator;if((l=o==null?void 0:o.clipboard)!=null&&l.writeText){let i=g(e,"button","atlas-embed-step-back",D(e,"mfa.recoveryCodesCopy"));i.type="button",i.setAttribute("data-atlas","recovery-codes-copy"),i.addEventListener("click",()=>{_r(t).then(c=>{if(!c||n.querySelector('[data-atlas="recovery-codes-copied"]'))return;let d=g(e,"p","atlas-embed-note",D(e,"mfa.recoveryCodesCopied"));d.setAttribute("data-atlas","recovery-codes-copied"),d.setAttribute("aria-live","polite"),n.insertBefore(d,s)})}),n.appendChild(i)}if(Ut()){let i=g(e,"button","atlas-embed-step-back",D(e,"mfa.recoveryCodesDownload"));i.type="button",i.setAttribute("data-atlas","recovery-codes-download"),i.addEventListener("click",()=>xr(t)),n.appendChild(i)}let s=g(e,"button",R(e,"buttonPrimary","atlas-embed-button"),D(e,"mfa.recoveryCodesSaved"));return s.type="button",s.setAttribute("data-atlas","recovery-codes-saved"),s.disabled=e.busy,s.addEventListener("click",()=>{s.disabled=!0,ms(e)}),n.appendChild(s),n}function Es(e){var p;let t=e.resetFlow,n=ke(t),r=g(e,"div","atlas-embed-reset");r.appendChild(g(e,"h1",R(e,"title","atlas-embed-title"),"Reset your password"));let o=L(e).createElement("form"),s=t.errors,a=new Map,l=s.find(m=>!m.param);l&&o.appendChild(g(e,"div","atlas-embed-form-error",e.errorText(l)));let i=null,c="Continue",d=!0,u=e.account.passwordReset;switch(n){case"request":i=u==="link"?"Enter your email and we\u2019ll send you a reset link.":u==="both"?"Enter your email and we\u2019ll send you a reset link and code.":"Enter your email and we\u2019ll send you a reset code.",c=u==="link"?"Send reset link":"Send reset code",Ct(e,o,a,s,"email","Email address","email","username");{let m=a.get("email");m&&(e.enteredIdentifier&&(m.value=e.enteredIdentifier),m.setAttribute("data-atlas-autofocus",""))}break;case"collect_email_code":if(u==="link"){d=!1,i="Check your email";let m=g(e,"p","atlas-embed-note",e.enteredIdentifier?`We sent a reset link to ${e.enteredIdentifier}. Open it on any device; this page continues on its own.`:"We sent you a reset link. Open it on any device; this page continues on its own.");m.setAttribute("data-atlas-link-sent",""),o.appendChild(m);let b=g(e,"button","atlas-embed-step-back","Send another link");b.type="button",b.setAttribute("data-atlas-resend",""),b.disabled=e.busy,b.addEventListener("click",()=>{var y;e.resetFlow={...Le},Tn(e,{email:(y=e.enteredIdentifier)!=null?y:""})}),o.appendChild(b);break}i=e.enteredIdentifier?`Enter the code we sent to ${e.enteredIdentifier}`:"Enter the code we sent to your email",In(e,o,a,s,"code","Reset code",!0);break;case"collect_second_factor":i="Enter the code from your authenticator app",In(e,o,a,s,"code","Two-factor code",!0);break;case"collect_new_password":i="Choose a new password",c="Set new password",Ct(e,o,a,s,"password","New password","password","new-password"),(p=a.get("password"))==null||p.setAttribute("data-atlas-autofocus","");break;default:d=!1,o.appendChild(g(e,"p","atlas-embed-note","You\u2019re all set."))}i&&r.appendChild(g(e,"p",R(e,"subtitle","atlas-embed-subtitle"),i)),r.appendChild(o),d&&o.appendChild(xe(e,c));let f=g(e,"button","atlas-embed-step-back","Back to sign in");return f.type="button",f.addEventListener("click",()=>{e.resetFlow=null,P(e)}),o.appendChild(f),o.addEventListener("submit",m=>{m.preventDefault();let b={};for(let[y,A]of a)b[y]=A.value;Tn(e,b)}),r}function Ct(e,t,n,r,o,s,a,l){let i=g(e,"label",R(e,"field","atlas-embed-field"));i.appendChild(g(e,"span",R(e,"label","atlas-embed-label"),s));let c=L(e).createElement("input");if(c.className=R(e,"input","atlas-embed-input"),c.type=a,c.name=o,c.setAttribute("autocomplete",l),a==="password"){let d=g(e,"div","atlas-embed-password");d.appendChild(c);let u=g(e,"button","atlas-embed-password-toggle","Show");u.type="button",u.setAttribute("aria-label","Show password"),u.addEventListener("click",f=>{f.preventDefault();let p=c.type==="password";c.type=p?"text":"password",u.textContent=p?"Hide":"Show",u.setAttribute("aria-label",p?"Hide password":"Show password")}),d.appendChild(u),i.appendChild(d)}else i.appendChild(c);for(let d of r.filter(u=>u.param===o))i.appendChild(g(e,"span",R(e,"error","atlas-embed-error"),e.errorText(d)));n.set(o,c),t.appendChild(i)}function In(e,t,n,r,o,s,a){var m;if(e.codeInputStyle==="single"){Ct(e,t,n,r,o,s,"text","one-time-code"),a&&((m=n.get(o))==null||m.setAttribute("data-atlas-autofocus",""));return}let i=g(e,"div",R(e,"field","atlas-embed-field"));i.appendChild(g(e,"span",R(e,"label","atlas-embed-label"),s));let c=g(e,"div","atlas-embed-code");c.setAttribute("role","group"),c.setAttribute("aria-label",s);let d=L(e).createElement("input");d.type="hidden",d.name=o,n.set(o,d);let u=[],f=()=>{d.value=u.map(b=>b.value).join("")},p=()=>{d.value.length!==6||e.busy||t.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))};for(let b=0;b<6;b++){let y=L(e).createElement("input");y.className="atlas-embed-code-box",y.type="text",y.setAttribute("inputmode","numeric"),y.setAttribute("autocomplete",b===0?"one-time-code":"off"),y.setAttribute("aria-label",`${s} digit ${b+1}`),y.maxLength=1,a&&b===0&&y.setAttribute("data-atlas-autofocus",""),y.addEventListener("input",()=>{y.value=y.value.replace(/\D/g,"").slice(0,1),f(),y.value&&b<5&&u[b+1].focus(),p()}),y.addEventListener("keydown",A=>{A.key==="Backspace"&&!y.value&&b>0&&u[b-1].focus()}),y.addEventListener("paste",A=>{var v,C,x;A.preventDefault();let E=((C=(v=A.clipboardData)==null?void 0:v.getData("text"))!=null?C:"").replace(/\D/g,"").slice(0,6);for(let k=0;k<6;k++)u[k].value=(x=E[k])!=null?x:"";f(),u[Math.min(E.length,5)].focus(),p()}),u.push(y),c.appendChild(y)}i.appendChild(c),i.appendChild(d);for(let b of r.filter(y=>y.param===o))i.appendChild(g(e,"span",R(e,"error","atlas-embed-error"),e.errorText(b)));t.appendChild(i)}function As(e,t){var f,p,m,b,y,A,E,v,C;let n=L(e).createElement("form"),r=e.state.errors.find(x=>!x.param);r&&n.appendChild(g(e,"div","atlas-embed-form-error",e.errorText(r)));let o=new Map,s=e.state.errors,a=(x,k,w,S)=>Ct(e,n,o,s,x,k,w,S),l=(x,k,w)=>In(e,n,o,s,x,k,w),i=!0,c=pe[e.mode].submit,d=[];switch(t){case"collect_identifier":if(a("identifier","Email address","email",e.passkeyEnabled&&be()?"username webauthn":"username"),e.enteredIdentifier&&(o.get("identifier").value=e.enteredIdentifier),e.mode==="sign-in"&&e.passwordEnabled){a("password","Password","password","current-password");let x=[];e.emailDeliveryAvailable&&e.emailCodeEnabled?x.push("email_code"):e.emailDeliveryAvailable&&e.emailLinkEnabled&&x.push("email_link");for(let k of x){let w=g(e,"button","atlas-embed-step-back",k==="email_code"?"Email me a code instead":"Email me a sign-in link instead");w.type="button",w.setAttribute("data-strategy",k),w.disabled=e.busy,w.addEventListener("click",()=>{var T;let S=o.get("identifier");if(!S.value.trim()){(T=S.reportValidity)==null||T.call(S),S.focus();return}We(e,{identifier:S.value},k)}),d.push(w)}}if(e.mode==="sign-in"&&e.rememberMeEnabled){let x=g(e,"label","atlas-embed-remember"),k=L(e).createElement("input");k.type="checkbox",k.className="atlas-embed-remember-check",k.checked=e.remember,k.addEventListener("change",()=>{e.remember=k.checked}),x.appendChild(k),x.appendChild(g(e,"span","atlas-embed-remember-text","Remember me")),n.appendChild(x)}break;case"collect_first_factor":{let x=e.state.attempt?(f=z(e.state.attempt).strategies)!=null?f:[]:[],k=He(e.emailDeliveryAvailable?x:x.filter(I=>I!=="email_code"&&I!=="email_link")),w=(p=e.state.prepared)!=null?p:null,S=(y=(b=e.enteredIdentifier)!=null?b:(m=e.state.attempt)==null?void 0:m.identifier)!=null?y:"",T=(I,X,$)=>{let B=g(e,"button","atlas-embed-step-back",X);return B.type="button",B.setAttribute($,$==="data-strategy"?I:""),B.disabled=e.busy,B.addEventListener("click",()=>void wt(e,I)),B};if(w==="email_code"){let I=g(e,"p","atlas-embed-note",S?`We sent a code to ${S}. Enter it below.`:"We sent you a code. Enter it below.");I.setAttribute("data-atlas-code-sent",""),n.appendChild(I),l("code","Verification code",!0),d.push(T("email_code","Resend code","data-atlas-resend"))}else if(w==="email_link"){i=!1;let I=g(e,"p","atlas-embed-note",S?`We sent a sign-in link to ${S}. Open it on any device to continue.`:"Check your email for a sign-in link.");I.setAttribute("data-atlas-link-sent",""),n.appendChild(I),d.push(T("email_link","Resend link","data-atlas-resend"))}else if(!k.password&&k.email.length>0){i=!1;for(let I of k.email)d.push(T(I,I==="email_code"?"Email me a code":"Email me a sign-in link","data-strategy"))}else{a("password","Password","password","current-password");for(let I of k.email)d.push(T(I,I==="email_code"?"Email me a code instead":"Email me a sign-in link instead","data-strategy"))}break}case"collect_second_factor":if(e.backupCodeMode?a("code","Backup code","text","one-time-code"):l("code","Two-factor code",!0),e.trustedDeviceEnabled){let x=g(e,"label","atlas-embed-remember"),k=L(e).createElement("input");k.type="checkbox",k.className="atlas-embed-remember-check",k.checked=e.rememberDevice,k.addEventListener("change",()=>{e.rememberDevice=k.checked}),x.appendChild(k),x.appendChild(g(e,"span","atlas-embed-remember-text","Remember this device")),n.appendChild(x)}Ss(e,d);break;case"collect_email_code":{let x=Xe(e.state.attempt,e.account.emailVerification);if(x){i=!1;let k=(v=(E=e.enteredIdentifier)!=null?E:(A=e.state.attempt)==null?void 0:A.identifier)!=null?v:"",w=g(e,"p","atlas-embed-note",k?`We sent a confirmation link to ${k}. Open it on any device; this page continues on its own.`:"We sent you a confirmation link. Open it on any device; this page continues on its own.");w.setAttribute("data-atlas-link-sent",""),n.appendChild(w)}else l("code","Verification code",!0);if(((C=e.state.attempt)==null?void 0:C.object)==="sign_up_attempt"){let k=g(e,"button","atlas-embed-step-back",x?"Resend link":"Resend code");k.type="button",k.setAttribute("data-atlas-resend",""),k.disabled=e.busy,k.addEventListener("click",()=>void hs(e)),d.push(k)}break}case"collect_new_password":a("password","New password","password","new-password");break;case"enroll_second_factor":{let x=xs(e,n,{addField:a,addCodeField:l,trailing:d},c);x===null?i=!1:c=x;break}default:i=!1,n.appendChild(g(e,"p","atlas-embed-note","Please continue in your application."))}i&&n.appendChild(xe(e,c));for(let x of d)n.appendChild(x);if(t==="collect_second_factor"){let x=g(e,"button","atlas-embed-step-back",e.backupCodeMode?"Use your authenticator app":"Use a backup code instead");x.type="button",x.addEventListener("click",()=>{e.backupCodeMode=!e.backupCodeMode,P(e)}),n.appendChild(x)}if((t==="collect_identifier"&&e.mode==="sign-in"&&e.passwordEnabled||t==="collect_first_factor"&&o.has("password"))&&e.passwordResetEnabled){let x=g(e,"button","atlas-embed-step-back","Forgot password?");x.type="button",x.addEventListener("click",()=>ks(e)),n.appendChild(x)}return n.addEventListener("submit",x=>{x.preventDefault();let k={};for(let[w,S]of o)k[w]=S.value;if(t==="collect_second_factor"&&e.trustedDeviceEnabled&&e.rememberDevice&&(k.remember_device="true"),t==="enroll_second_factor"){ws(e,k);return}We(e,k)}),n}function il(e){var i;let t=(i=e.appearance)==null?void 0:i.legal;if(!t||!t.termsUrl&&!t.privacyUrl)return null;let n=L(e),r=g(e,"div","atlas-embed-consent"),o=null;t.required&&(o=n.createElement("input"),o.type="checkbox",o.className="atlas-embed-consent-check",o.setAttribute("aria-label","Agree to the terms and privacy policy"),r.appendChild(o));let s=g(e,"span","atlas-embed-consent-text"),a=(c,d)=>{let u=n.createElement("a");return u.href=c,u.textContent=d,u.target="_blank",u.rel="noopener noreferrer",u.className="atlas-embed-consent-link",u};s.appendChild(n.createTextNode(t.required?"I agree to the ":"By continuing you agree to the "));let l=[];return t.termsUrl&&l.push(a(t.termsUrl,"Terms of Service")),t.privacyUrl&&l.push(a(t.privacyUrl,"Privacy Policy")),l.forEach((c,d)=>{d>0&&s.appendChild(n.createTextNode(" and ")),s.appendChild(c)}),s.appendChild(n.createTextNode(".")),r.appendChild(s),{row:r,checkbox:o}}function Rs(e){var i;let t=L(e).createElement("form");if(!e.passwordSignUpEnabled)return t.appendChild(g(e,"div","atlas-embed-form-error",co)),t;let n=e.state.errors.find(c=>!c.param);n&&t.appendChild(g(e,"div","atlas-embed-form-error",e.errorText(n)));let r=new Map,o=(c,d,u)=>{var y,A,E;let f=(y=u.type)!=null?y:"text",p=f==="radio"||f==="multiselect",m=g(e,p?"fieldset":"label",R(e,"field","atlas-embed-field"));m.appendChild(g(e,p?"legend":"span",R(e,"label","atlas-embed-label"),u.required?d:`${d} (optional)`));let b=L(e);if(f==="select"){let v=b.createElement("select");v.className=R(e,"input","atlas-embed-input"),v.name=c;let C=b.createElement("option");C.value="",C.textContent=u.placeholder||"Select\u2026",v.appendChild(C);for(let x of(A=u.options)!=null?A:[]){let k=b.createElement("option");k.value=x,k.textContent=x,v.appendChild(k)}m.appendChild(v),r.set(c,()=>v.value)}else if(f==="textarea"){let v=b.createElement("textarea");v.className=R(e,"input","atlas-embed-input"),v.name=c,v.rows=3,u.placeholder&&v.setAttribute("placeholder",u.placeholder),m.appendChild(v),r.set(c,()=>v.value)}else if(f==="checkbox"){let v=b.createElement("input");v.type="checkbox",v.name=c,v.className="atlas-embed-checkbox",m.classList.add("atlas-embed-field-checkbox"),m.appendChild(v),r.set(c,()=>v.checked?"true":"")}else if(f==="radio"||f==="multiselect"){let v=b.createElement("div");v.className="atlas-embed-choices";let C=[];for(let x of(E=u.options)!=null?E:[]){let k=b.createElement("label");k.className="atlas-embed-choice";let w=b.createElement("input");w.type=f==="radio"?"radio":"checkbox",w.name=c,w.value=x,C.push(w),k.appendChild(w),k.appendChild(g(e,"span",void 0,x)),v.appendChild(k)}m.appendChild(v),r.set(c,()=>{var x,k;return f==="radio"?(k=(x=C.find(w=>w.checked))==null?void 0:x.value)!=null?k:"":C.filter(w=>w.checked).map(w=>w.value).join(", ")})}else{let v=b.createElement("input");v.className=R(e,"input","atlas-embed-input"),v.type=f,v.name=c,u.autocomplete&&v.setAttribute("autocomplete",u.autocomplete),u.placeholder&&v.setAttribute("placeholder",u.placeholder),m.appendChild(v),r.set(c,()=>v.value)}for(let v of e.state.errors.filter(C=>C.param===c))m.appendChild(g(e,"span",R(e,"error","atlas-embed-error"),e.errorText(v)));t.appendChild(m)};for(let c of e.signUpFields)o(c.key,c.label,{type:c.type,required:c.required,placeholder:c.placeholder,options:c.options});o("identifier","Email address",{type:"email",required:!0,autocomplete:"email"}),o("password","Password",{type:"password",required:!0,autocomplete:"new-password"});let s=il(e);s&&t.appendChild(s.row);let a=xe(e,pe[e.mode].submit),l=()=>!(s!=null&&s.checkbox)||s.checkbox.checked;return a.disabled=e.busy||!l(),(i=s==null?void 0:s.checkbox)==null||i.addEventListener("change",()=>{a.disabled=e.busy||!l()}),t.appendChild(a),t.addEventListener("submit",c=>{c.preventDefault();let d={};for(let[u,f]of r)d[u]=f();vs(e,d,l())}),t}var ll={google:'<path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/><path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/><path fill="#FBBC05" d="M5.84 14.1c-.22-.66-.35-1.36-.35-2.1s.13-1.44.35-2.1V7.06H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.94l3.66-2.84z"/><path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.06l3.66 2.84C6.71 7.31 9.14 5.38 12 5.38z"/>',microsoft:'<path fill="#F25022" d="M2 2h9.3v9.3H2z"/><path fill="#7FBA00" d="M12.7 2H22v9.3h-9.3z"/><path fill="#00A4EF" d="M2 12.7h9.3V22H2z"/><path fill="#FFB900" d="M12.7 12.7H22V22h-9.3z"/>'},cl={github:{fill:"currentColor",path:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"},apple:{fill:"currentColor",path:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"},x:{fill:"currentColor",path:"M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"},notion:{fill:"currentColor",path:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"},facebook:{fill:"#0866FF",path:"M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z"},discord:{fill:"#5865F2",path:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},gitlab:{fill:"#FC6D26",path:"m23.6004 9.5927-.0337-.0862L20.3.9814a.851.851 0 0 0-.3362-.405.8748.8748 0 0 0-.9997.0539.8748.8748 0 0 0-.29.4399l-2.2055 6.748H7.5375l-2.2057-6.748a.8573.8573 0 0 0-.29-.4412.8748.8748 0 0 0-.9997-.0537.8585.8585 0 0 0-.3362.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 0 0 2.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 0 0 1.2197 0l1.4995-1.1321 2.4619-1.8633 5.006-3.7489.0125-.01a6.0682 6.0682 0 0 0 2.0094-7.003z"},spotify:{fill:"#1ED760",path:"M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"},twitch:{fill:"#9146FF",path:"M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z"},reddit:{fill:"#FF4500",path:"M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z"},figma:{fill:"#F24E1E",path:"M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z"},dropbox:{fill:"#0061FF",path:"M6 1.807L0 5.629l6 3.822 6.001-3.822L6 1.807zM18 1.807l-6 3.822 6 3.822 6-3.822-6-3.822zM0 13.274l6 3.822 6.001-3.822L6 9.452l-6 3.822zM18 9.452l-6 3.822 6 3.822 6-3.822-6-3.822zM6 18.371l6.001 3.822 6-3.822-6-3.822L6 18.371z"},gitee:{fill:"#C71D23",path:"M11.984 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.016 0zm6.09 5.333c.328 0 .593.266.592.593v1.482a.594.594 0 0 1-.593.592H9.777c-.982 0-1.778.796-1.778 1.778v5.63c0 .327.266.592.593.592h5.63c.982 0 1.778-.796 1.778-1.778v-.296a.593.593 0 0 0-.592-.593h-4.15a.592.592 0 0 1-.592-.592v-1.482a.593.593 0 0 1 .593-.592h6.815c.327 0 .593.265.593.592v3.408a4 4 0 0 1-4 4H5.926a.593.593 0 0 1-.593-.593V9.778a4.444 4.444 0 0 1 4.445-4.444h8.296Z"}};function Ps(e){let t=ll[e];if(t)return`<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" focusable="false">${t}</svg>`;let n=cl[e];return n?`<svg viewBox="0 0 24 24" width="18" height="18" fill="${n.fill}" aria-hidden="true" focusable="false"><path d="${n.path}"/></svg>`:null}function Ts(e,t){return!t||!t.id||!t.status||t.status==="complete"?!1:(e.state={...e.state,attempt:t,errors:[]},P(e),!0)}function Is(e){let t=e.options.passkeyPrf;return t?{prf:t,onExtensionResults:n=>{var a,l,i,c,d;let r={credentialId:n.credentialId,enabled:!!((a=n.prf)!=null&&a.results)||((l=n.prf)==null?void 0:l.enabled)===!0,...(i=n.prf)!=null&&i.results?{results:n.prf.results}:{}},o=(c=e.root.ownerDocument)==null?void 0:c.defaultView,s=(d=o==null?void 0:o.CustomEvent)!=null?d:CustomEvent;e.root.dispatchEvent(new s("atlas:passkey-prf",{detail:r,bubbles:!1}))}}:{}}async function Os(e){var o,s,a;if(e.busy)return;(o=e.conditionalAbort)==null||o.abort(),e.busy=!0,P(e);let t=await an(e.client,{captcha:({retry:l})=>$e(e,"signIn",l)});if(!t.ok||!t.data){e.busy=!1,Z(e,t.errors);return}let n;try{n=await tn(t.data,Is(e))}catch{e.busy=!1,P(e);return}let r=await e.client.post("/v1/client/sign_ins/passkey/finish",n);if(e.busy=!1,r.ok&&((s=r.data)==null?void 0:s.status)==="complete"){await j(e,(a=r.data.created_session_id)!=null?a:null);return}r.ok&&Ts(e,r.data)||Z(e,r.errors)}async function Ls(e){var r,o,s;if(e.mode!=="sign-in"||!e.passkeyEnabled||!be())return;let t=!1;try{t=await Qr()}catch{t=!1}if(!t||ye(e.captchaFlows.signIn))return;(r=e.conditionalAbort)==null||r.abort();let n=new AbortController;e.conditionalAbort=n;try{let a=await an(e.client);if(!a.ok||!a.data||n.signal.aborted)return;let l=await tn(a.data,{mediation:"conditional",signal:n.signal,...Is(e)});if(n.signal.aborted)return;let i=await e.client.post("/v1/client/sign_ins/passkey/finish",l);i.ok&&((o=i.data)==null?void 0:o.status)==="complete"?await j(e,(s=i.data.created_session_id)!=null?s:null):i.ok&&Ts(e,i.data)}catch{}}function Ds(e){let t=g(e,"button",R(e,"socialButton","atlas-embed-social-button"),"Sign in with a passkey");return t.type="button",t.setAttribute("data-atlas-passkey",""),t.disabled=e.busy,t.addEventListener("click",()=>{Os(e)}),t}function On(e){let t=[...e.providers];for(let n of e.nativeProviders)t.includes(n.provider)||t.push(n.provider);return t}var dl='<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" fill="none"><path d="M12 2 3 21h4l5-11 5 11h4L12 2z" fill="currentColor"/></svg>';function ul(e,t){var l;let{variant:n,labels:r}=e.social,o=(l=r.atlas)!=null?l:n==="block"?"Continue with Atlas":"Atlas",s=g(e,"button",R(e,"socialButton","atlas-embed-social-button"));s.type="button",s.setAttribute("data-atlas-provider","atlas"),s.setAttribute("data-variant",n);let a=L(e).createElement("span");if(a.className="atlas-embed-social-icon",a.innerHTML=dl,s.appendChild(a),n==="icon")s.setAttribute("aria-label","Continue with Atlas"),s.setAttribute("title","Atlas");else{let i=L(e).createElement("span");i.className="atlas-embed-social-label",i.textContent=o,s.appendChild(i)}return s.addEventListener("click",()=>{Pn(e,t,{popup:!0})}),s}function Fs(e){let t=On(e),n=g(e,"div","atlas-embed-social");n.setAttribute("data-layout",e.social.layout),n.setAttribute("data-size",e.social.size),n.setAttribute("data-variant",e.social.variant),e.signInWithAtlas.enabled&&e.signInWithAtlas.connection_id&&n.appendChild(ul(e,e.signInWithAtlas.connection_id));for(let c of t){let d=e.nativeProviders.find(f=>f.provider===c),u=c==="google"&&(d!=null&&d.client_id)?gl(e,d.client_id):fl(e,c);u.getAttribute("data-atlas-provider")||u.setAttribute("data-atlas-provider",c),n.appendChild(u)}let r=e.social.layout==="carousel"?pl(e,n):n;if(!(e.social.search==="always"||e.social.search==="auto"&&t.length>Go))return r;let s=g(e,"div","atlas-embed-social-field"),a=L(e).createElement("input");a.type="search",a.className="atlas-embed-social-search",a.setAttribute("placeholder","Search sign-in options\u2026"),a.setAttribute("aria-label","Search sign-in options"),a.autocomplete="off";let l=g(e,"div","atlas-embed-social-empty");l.textContent="No matching sign-in options.",l.setAttribute("hidden","");let i=Array.from(n.children);return a.addEventListener("input",()=>{var u;let c=a.value.trim().toLowerCase(),d=0;for(let f of i){let p=(u=f.getAttribute("data-atlas-provider"))!=null?u:"",m=c===""||xt(p).toLowerCase().includes(c)||p.toLowerCase().includes(c);f.toggleAttribute("hidden",!m),m&&(d+=1)}l.toggleAttribute("hidden",d!==0),n.dispatchEvent(new Event("scroll"))}),s.appendChild(a),s.appendChild(r),s.appendChild(l),s}function pl(e,t){var c;let n=(c=L(e).defaultView)!=null?c:typeof window!="undefined"?window:null,r=g(e,"div","atlas-embed-carousel"),o=d=>{let u=g(e,"button","atlas-embed-carousel-nav");return u.type="button",u.setAttribute("data-dir",d),u.setAttribute("aria-label",d==="prev"?"Scroll to previous sign-in options":"Scroll to more sign-in options"),u.innerHTML=d==="prev"?cs:ds,u.addEventListener("click",()=>{let f=Math.max(t.clientWidth*.8,140);typeof t.scrollBy=="function"&&t.scrollBy({left:(d==="prev"?-1:1)*f,behavior:"smooth"})}),u},s=o("prev"),a=o("next"),l=()=>{let d=t.scrollWidth-t.clientWidth,u=d>2;r.setAttribute("data-overflow",u?"true":"false"),s.disabled=!u||t.scrollLeft<=1,a.disabled=!u||t.scrollLeft>=d-1};t.addEventListener("scroll",l,{passive:!0});let i=n&&n.ResizeObserver;return i?new i(l).observe(t):n&&n.addEventListener("resize",l),n!=null&&n.requestAnimationFrame&&n.requestAnimationFrame(l),l(),r.appendChild(s),r.appendChild(t),r.appendChild(a),r}function Ms(e,t,n="button"){var c;let{variant:r,labels:o}=e.social,s=xt(t),a=(c=o[t])!=null?c:r==="block"?`Continue with ${s}`:s,l=g(e,n,R(e,"socialButton","atlas-embed-social-button"));n==="button"&&(l.type="button"),l.setAttribute("data-atlas-provider",t),l.setAttribute("data-variant",r);let i=Ps(t);if(i){let d=L(e).createElement("span");d.className="atlas-embed-social-icon",d.innerHTML=i,l.appendChild(d)}if(r==="icon")l.setAttribute("aria-label",`Continue with ${s}`),l.setAttribute("title",s);else{let d=L(e).createElement("span");d.className="atlas-embed-social-label",d.textContent=a,l.appendChild(d)}return l}function fl(e,t){let n=Ms(e,t);return n.addEventListener("click",()=>{ls.has(t)?(e.handlePrompt=t,P(e)):St(e,t)}),n}function Us(e,t){let n=xt(t),r=L(e).createElement("form");r.className="atlas-embed-form",r.setAttribute("novalidate","true");for(let i of e.state.errors.filter(c=>!c.param))r.appendChild(g(e,"div","atlas-embed-form-error",e.errorText(i)));let o=g(e,"label",R(e,"field","atlas-embed-field"));o.appendChild(g(e,"span",R(e,"label","atlas-embed-label"),`${n} handle`));let s=L(e).createElement("input");s.className=R(e,"input","atlas-embed-input"),s.type="text",s.name="identifier",s.placeholder="you.bsky.social",s.setAttribute("autocomplete","username"),s.setAttribute("autocapitalize","none"),s.setAttribute("spellcheck","false"),o.appendChild(s),r.appendChild(o);let a=xe(e,pe[e.mode].submit);r.appendChild(a);let l=g(e,"button","atlas-embed-handle-back","Back");return l.type="button",l.addEventListener("click",()=>{e.handlePrompt=null,e.state={...e.state,errors:[]},P(e)}),r.appendChild(l),r.addEventListener("submit",i=>{i.preventDefault();let c=s.value.trim();if(!c){e.state={...e.state,errors:[{code:"validation_error",message:`Enter your ${n} handle.`}]},P(e);return}St(e,t,c)}),r}function gl(e,t){let n=Ms(e,"google","div");return n.setAttribute("role","button"),n.setAttribute("tabindex","0"),Gr({wrapper:n,clientId:t,onCredential:r=>void ys(e,"google",r),onError:()=>we(e,"Google sign-in could not start.")}).catch(()=>{n.addEventListener("click",()=>void St(e,"google"))}),n}function we(e,t){e.root.textContent="";let n=g(e,"div",R(e,"card","atlas-embed-card"));n.appendChild(g(e,"p","atlas-embed-note",t)),e.root.appendChild(n)}function zs(e){e.root.textContent="";let t=g(e,"div",R(e,"card","atlas-embed-card")),n=e.interaction.loading,r=g(e,"div","atlas-embed-loading");if(r.setAttribute("data-loading",n),r.setAttribute("role","status"),r.setAttribute("aria-label","Loading"),n==="skeleton")for(let s of["title","sub","input","input","button"])r.appendChild(g(e,"div",`atlas-embed-skel atlas-embed-skel-${s}`));else if(n==="dots")for(let s=0;s<3;s+=1)r.appendChild(g(e,"span","atlas-embed-dot"));else n==="bar"?r.appendChild(g(e,"span","atlas-embed-loadbar")):r.appendChild(g(e,"span","atlas-embed-spinner"));let o=g(e,"span","atlas-embed-sr","Loading\u2026");r.appendChild(o),t.appendChild(r),e.root.appendChild(t)}function Z(e,t){e.state={...e.state,errors:[...t]},P(e)}function P(e){var d,u,f,p,m,b,y,A,E,v;e.root.textContent="";let t=g(e,"div",R(e,"card","atlas-embed-card")),n=(u=(d=e.appearance)==null?void 0:d.logoUrl)!=null?u:null;if(n){let C=L(e).createElement("img");C.className="atlas-embed-logo",C.src=n,C.alt=(p=(f=e.appearance)==null?void 0:f.applicationName)!=null?p:"",t.appendChild(C)}if(e.resetFlow){let C=`reset_${ke(e.resetFlow)}`;if(t.setAttribute("data-step",C),C!==e.lastStepKind&&t.setAttribute("data-enter",""),e.lastStepKind=C,t.appendChild(Es(e)),(m=e.appearance)!=null&&m.footer&&t.appendChild(g(e,"p",R(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(t),t.hasAttribute("data-enter")){let x=t.querySelector("[data-atlas-autofocus]");x instanceof HTMLElement&&x.focus()}return}let r=Ce(e.state);if(r){t.setAttribute("data-step","recovery_codes"),e.lastStepKind!=="recovery_codes"&&t.setAttribute("data-enter",""),e.lastStepKind="recovery_codes",t.appendChild(Cs(e,r)),e.root.appendChild(t);return}let o=e.state.attempt?z(e.state.attempt):{kind:"collect_identifier"},s=e.mode==="sign-up"&&!e.state.attempt,a=s||o.kind==="collect_identifier",l=e.handlePrompt?"handle":o.kind;t.setAttribute("data-step",l),l!==e.lastStepKind&&t.setAttribute("data-enter",""),e.lastStepKind=l;let i=(y=(b=e.appearance)==null?void 0:b.headline)!=null?y:pe[e.mode].title;t.appendChild(g(e,"h1",R(e,"title","atlas-embed-title"),i));let c=a?null:ml(e,o.kind);if(c?t.appendChild(c):(A=e.appearance)!=null&&A.subheadline&&t.appendChild(g(e,"p",R(e,"subtitle","atlas-embed-subtitle"),e.appearance.subheadline)),e.flash&&t.appendChild(g(e,"div","atlas-embed-flash",e.flash)),e.handlePrompt){t.appendChild(Us(e,e.handlePrompt)),(E=e.appearance)!=null&&E.footer&&t.appendChild(g(e,"p",R(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(t);return}if(a&&(On(e).length>0||e.signInWithAtlas.enabled)&&(t.appendChild(Fs(e)),t.appendChild(g(e,"div",R(e,"divider","atlas-embed-divider"),"or"))),t.appendChild(s?Rs(e):As(e,o.kind)),a&&e.mode==="sign-in"&&e.passkeyEnabled&&be()&&t.appendChild(Ds(e)),(v=e.appearance)!=null&&v.footer&&t.appendChild(g(e,"p",R(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(t),t.hasAttribute("data-enter")){let C=t.querySelector("[data-atlas-autofocus]");C instanceof HTMLElement&&C.focus()}}function ml(e,t){let n=e.enteredIdentifier,r=null,o=!1;switch(t){case"collect_email_code":r=Xe(e.state.attempt,e.account.emailVerification)?"Check your email":n?`Enter the code we sent to ${n}`:"Enter the code we sent to your email",o=!0;break;case"collect_first_factor":r=n?`Enter the password for ${n}`:"Enter your password",o=!0;break;case"collect_second_factor":r=e.backupCodeMode?"Enter one of your backup codes":"Enter the code from your authenticator app";break;case"collect_new_password":r="Choose a new password";break;case"enroll_second_factor":r=D(e,"mfa.enrollChoose");break;default:return null}let s=g(e,"div","atlas-embed-step-context");if(s.appendChild(g(e,"p",R(e,"subtitle","atlas-embed-subtitle"),r)),o){let a=g(e,"button","atlas-embed-step-back","Use a different email");a.type="button",a.addEventListener("click",()=>hl(e)),s.appendChild(a)}return s}function hl(e){e.state=N,e.backupCodeMode=!1,e.handlePrompt=null,e.enteredIdentifier=null,P(e)}var Se=class{constructor(t,n){this.root=t;this.options=n;h(this,"client");h(this,"mode");h(this,"appearance",null);h(this,"design",null);h(this,"appliedDesign");h(this,"providers",[]);h(this,"nativeProviders",[]);h(this,"signInWithAtlas",{enabled:!1});h(this,"social",An(void 0,void 0));h(this,"codeInputStyle","boxes");h(this,"interaction",_t(void 0,void 0));h(this,"backupCodeMode",!1);h(this,"enrollment",null);h(this,"secondFactorCode",null);h(this,"enteredIdentifier",null);h(this,"lastStepKind",null);h(this,"signUpFields",[]);h(this,"passwordEnabled",!0);h(this,"emailCodeEnabled",!1);h(this,"emailLinkEnabled",!1);h(this,"emailDeliveryAvailable",!0);h(this,"passkeyEnabled",!1);h(this,"passwordResetEnabled",!0);h(this,"passwordSignUpEnabled",!0);h(this,"conditionalAbort");h(this,"linkPoll",null);h(this,"account",{...ln});h(this,"rememberMeEnabled",!1);h(this,"remember",!0);h(this,"trustedDeviceEnabled",!1);h(this,"rememberDevice",!1);h(this,"captchaFlows",{});h(this,"captchaHost");h(this,"state",N);h(this,"resetFlow",null);h(this,"flash",null);h(this,"handlePrompt",null);h(this,"busy",!1);h(this,"recorder");var r,o,s;this.mode=(r=n.mode)!=null?r:"sign-in",this.interaction=_t(void 0,(o=n.appearance)==null?void 0:o.interaction),this.client=rs({publishableKey:n.publishableKey,frontendApi:n.frontendApi,fetchImpl:n.fetchImpl,locale:(s=n.locale)!=null?s:qn(n.localization),referral:n.referral,referralConsent:n.referralConsent})}errorText(t){return Kn(t,this.options.localization)}async mount(){var r,o,s,a,l,i,c,d,u,f,p,m,b,y,A,E,v,C,x,k,w,S,T,I,X,$,B,Mn,Un,zn,Nn;if(as((r=this.root.ownerDocument)!=null?r:document),this.root.classList.add("atlas-embed-root"),this.resolveDesign(null),this.applyTheme(),this.applyInteraction(),zs(this),await gs(this))return;let n=await os(this.client);if(n){this.appearance=n.appearance;let qs=(o=n.provider_scopes)!=null?o:{},$n=At=>{let Rt=qs[At];return Rt?this.mode==="sign-up"?Rt.sign_up:Rt.sign_in:!0};this.providers=ts((s=n.providers)!=null?s:[],n.appearance).filter($n),this.nativeProviders=((a=n.native_providers)!=null?a:[]).filter(At=>$n(At.provider)),this.passwordEnabled=(i=(l=n.strategies)==null?void 0:l.password)!=null?i:!0,this.passkeyEnabled=(d=(c=n.strategies)==null?void 0:c.passkey)!=null?d:!1,this.emailCodeEnabled=(f=(u=n.strategies)==null?void 0:u.emailCode)!=null?f:!1,this.emailLinkEnabled=(m=(p=n.strategies)==null?void 0:p.emailLink)!=null?m:!1,this.passwordResetEnabled=(y=(b=n.email_delivery)==null?void 0:b.password_reset)!=null?y:!0,this.emailDeliveryAvailable=(E=(A=n.email_delivery)==null?void 0:A.available)!=null?E:!0,this.passwordSignUpEnabled=(C=(v=n.email_delivery)==null?void 0:v.password_sign_up)!=null?C:!0,this.account=cn(n),this.signInWithAtlas=(x=n.sign_in_with_atlas)!=null?x:{enabled:!1},this.rememberMeEnabled=n.rememberMe===!0,this.trustedDeviceEnabled=n.rememberDevice===!0,this.captchaFlows=(k=n.captchaFlows)!=null?k:{},await Yt(this.client)&&(this.captchaFlows=uo(this.captchaFlows)),this.resolveDesign(jo(n)),this.applyTheme()}this.social=An(this.design?{...(w=this.appearance)==null?void 0:w.socialButtons,...this.design.socialButtons}:(S=this.appearance)==null?void 0:S.socialButtons,(T=this.options.appearance)==null?void 0:T.socialButtons),this.codeInputStyle=Vo((I=this.appearance)==null?void 0:I.codeInput,(X=this.options.appearance)==null?void 0:X.codeInput),this.interaction=_t(this.design?{...($=this.appearance)==null?void 0:$.interaction,...this.design.interaction}:(B=this.appearance)==null?void 0:B.interaction,(Mn=this.options.appearance)==null?void 0:Mn.interaction),this.applyInteraction(),this.signUpFields=(zn=(Un=this.appearance)==null?void 0:Un.signUpFields)!=null?zn:[];try{this.recorder=new Ye((Nn=this.root.ownerDocument)!=null?Nn:document)}catch{}P(this),Ls(this)}applyTheme(){var r,o,s,a,l,i;let t=(o=(r=this.design)==null?void 0:r.tokens)!=null?o:Jo(this.appearance,this.options.appearance),n=Zo(t);for(let[c,d]of Object.entries(n))this.root.style.setProperty(c,d);this.root.style.setProperty("--atlas-embed-color-text-on-primary",Xo(t.colorPrimary)),this.root.style.setProperty("--atlas-embed-color-focus-ring",(l=(a=(s=this.options.appearance)==null?void 0:s.variables)==null?void 0:a.colorFocusRing)!=null?l:Qo(t.colorPrimary,[t.colorCard,t.colorBackground])),this.design&&(this.appliedDesign=Ko((i=this.root.ownerDocument)!=null?i:document,this.root,this.design.render,this.appliedDesign))}resolveDesign(t){var o,s,a;let n=(s=(o=this.root.ownerDocument)==null?void 0:o.defaultView)!=null?s:typeof window!="undefined"?window:null,r=!1;try{r=!!((a=n==null?void 0:n.matchMedia)!=null&&a.call(n,"(prefers-color-scheme: dark)").matches)}catch{}this.design=is(t,this.options.appearance,{frontendApi:this.options.frontendApi,prefersDark:r})}applyInteraction(){let t=this.interaction;this.root.setAttribute("data-button-style",t.buttonStyle),this.root.setAttribute("data-button-effect",t.buttonEffect),this.root.setAttribute("data-shadow",t.shadow),this.root.setAttribute("data-density",t.density),this.root.setAttribute("data-input-style",t.inputStyle);let n=t.animations?Yo[t.motionSpeed]:0;this.root.style.setProperty("--atlas-embed-motion",`${n}ms`)}};var q={};function Ns(e){q=e}function $s(e){if(!e)return{};let t=e.dataset,n={};return t.atlasKey&&(n.publishableKey=t.atlasKey),t.atlasFapi&&(n.frontendApi=t.atlasFapi),t.atlasRedirect&&(n.redirect=t.atlasRedirect),t.atlasLocale&&(n.locale=t.atlasLocale),n}function Bs(e,t){var p,m,b,y,A,E,v,C,x,k,w,S;let n=e.dataset,r=T=>{var I;return(I=e.getAttribute(T))!=null?I:void 0},o=(m=(p=n.atlasKey)!=null?p:r("publishable-key"))!=null?m:q.publishableKey,s=(y=(b=n.atlasFapi)!=null?b:r("frontend-api"))!=null?y:q.frontendApi,a=(E=(A=n.atlasRedirect)!=null?A:r("redirect"))!=null?E:q.redirect;if(!o||!s)return null;let l={publishableKey:o,frontendApi:s,mode:t};a&&(l.redirect=a);let i=(C=(v=n.atlasLocale)!=null?v:r("locale"))!=null?C:q.locale;i&&(l.locale=i);let c=(x=n.atlasPreset)!=null?x:r("preset");c&&(l.appearance={preset:c});let d=(k=n.atlasReferral)!=null?k:r("referral");(d==="off"||d==="false")&&(l.referral=!1);let u=(w=n.atlasReferralConsent)!=null?w:r("referral-consent");(u==="granted"||u==="denied")&&(l.referralConsent=u);let f=(S=n.atlasPasskeyPrf)!=null?S:r("passkey-prf");return f&&(l.passkeyPrf={eval:{first:f}}),l}function Ws(e,t={}){var o,s,a,l,i;let n=(o=t.publishableKey)!=null?o:q.publishableKey,r=(s=t.frontendApi)!=null?s:q.frontendApi;return!n||!r?null:{...t,publishableKey:n,frontendApi:r,redirect:(a=t.redirect)!=null?a:q.redirect,...((l=t.locale)!=null?l:q.locale)?{locale:(i=t.locale)!=null?i:q.locale}:{},mode:e}}var Et=class extends HTMLElement{constructor(){super(...arguments);h(this,"widget",null)}connectedCallback(){if(this.widget)return;let n=Bs(this,this.mode);if(!n){this.textContent="Atlas: set data-atlas-key (publishable key) and data-atlas-fapi (frontend API origin).";return}this.widget=new Se(this,n),this.widget.mount()}},Ln=class extends Et{constructor(){super(...arguments);h(this,"mode","sign-in")}},Dn=class extends Et{constructor(){super(...arguments);h(this,"mode","sign-up")}};function Fn(){typeof customElements!="undefined"&&(customElements.get("atlas-sign-in")||customElements.define("atlas-sign-in",Ln),customElements.get("atlas-sign-up")||customElements.define("atlas-sign-up",Dn))}function bl(e){let t=typeof e=="string"?document.querySelector(e):e;return t instanceof HTMLElement?t:null}function Hs(e,t,n){let r=bl(t);if(!r)return null;let o=Ws(e,n);if(!o)return r.textContent="Atlas: a publishable key and a frontend API origin are required to mount the widget.",null;let s=new Se(r,o);return s.mount(),s}function js(e,t={}){return Hs("sign-in",e,t)}function Ks(e,t={}){return Hs("sign-up",e,t)}function yl(){var t;let e=document.currentScript;return e instanceof HTMLScriptElement?e:(t=document.querySelector("script[data-atlas-key]"))!=null?t:document.querySelector('script[src*="embed.js"]')}function kl(){Ns($s(yl())),Fn(),window.Atlas={mountSignIn:js,mountSignUp:Ks,defineElements:Fn}}kl();})();