PageSourceSearch

https://www.10x-crm.app/_next/static/chunks/110.ad58a2fba0b1de44.js

js 10x-crm.app collected 2026-10-07 07:33:24 UTC 58,219 bytes, 5 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[110],{434:(e,t,i)=>{i.d(t,{Aq:()=>h,BR:()=>C,CU:()=>u,Ho:()=>x,M2:()=>T,MR:()=>P,Mk:()=>m,Ni:()=>S,O$:()=>v,Oc:()=>d,PD:()=>g,T$:()=>E,Tl:()=>O,VL:()=>c,VZ:()=>I,Vm:()=>A,Wb:()=>o,XV:()=>s,XW:()=>p,Xh:()=>L,Y_:()=>j,Zr:()=>r,aV:()=>W,aY:()=>a,cj:()=>w,cq:()=>l,hr:()=>b,mP:()=>R,mW:()=>y,o1:()=>f,qh:()=>k,u:()=>n}),i(74951),i(80496);let r="descope-login-flow",n="t",o="code",s="redirect_mode",l="err",a="ra-challenge",d="ra-callback",c="ra-backup-callback",u="ra-initiator",h="data-descope-",p="data-exclude-field",g="data-exclude-next",f="dls_last_auth",m="state_id",v="saml_idp_state_id",b="saml_idp_username",w="descope_idp_initiated",y="sso_app_id",S="third_party_app_id",C="third_party_app_state_id",k="oidc_login_hint",A="oidc_prompt",I="oidc_resource",E="oidc_error_redirect_uri",O="application_scopes",x="data-type",j="sdkScriptsResults",R={redirect:"redirect",poll:"poll",webauthnCreate:"webauthnCreate",webauthnGet:"webauthnGet",nativeBridge:"nativeBridge",loadForm:"loadForm"},W={submit:"submit",polling:"polling"},P="data-has-dynamic-attr-values",T=["descope-multi-select-combo-box","de
1scope-text-area"],L=5e3},7797:(e,t,i)=>{var r;i.d(t,{O:()=>r}),function(e){e.backward="backward",e.forward="forward"}(r||(r={}))},19815:(e,t,i)=>{i.d(t,{F:()=>n});let r=["*","#","/","(",")","[","]","_","<",">","`"],n=e=>"string"!=typeof e?e:e.replace((e=>{let t=r.map(t=>`${e}${t}`).join("|");return RegExp(`(${t})`,"g")})("\\"),"\\$1")},47584:(e,t,i)=>{i.d(t,{xQ:()=>v,BW:()=>P,sd:()=>m,tH:()=>b,Ix:()=>u,mI:()=>p,zp:()=>I,Dr:()=>h,dR:()=>w,kN:()=>j,Rt:()=>g,Cp:()=>U,YK:()=>W,_A:()=>C,X4:()=>k,My:()=>y,qx:()=>O,F2:()=>f,A0:()=>R,FQ:()=>N,$Z:()=>T,Tf:()=>E,rM:()=>x,BK:()=>A,C3:()=>$,it:()=>L,CM:()=>S});var r=i(63990),n=i(434);let o=["cssVars","componentsConfig","inputs","errorText","errorType","clientScripts"];var s=i(7797),l=i(74951);let a=["descope-enriched-text"];function d(e){return new URLSearchParams(window.location.search).get(e)}function c(e){if(window.history.replaceState&&d(e)){let t=new URL(window.location.href),i=new URLSearchParams(t.search);i.delete(e),t.search=i.toString(),window.history.replaceState({},"",t.toString())}}function u(e,t){return(0,r.sH)(this,void 0,void 0,function*(){let i=yield fetch(e,{cache:"default"});if(!i.ok)throw Error(`Error fetching URL ${e} [${i.status}]`);return{body:yield i[t](),headers:Object.fromEntries(i.headers.entries())}})}function h({projectId:e,filename:t,assetsFolder:i=l.pC,baseUrl:r}){let n=new URL(l.fz||r||l.cL);return n.pathname=((...e)=>e.join("/").replace(/\/+/g,"/"))(n.pathname,e,i,t),n.toString()}function p(e,t){if(!t)return;let i=+e,r=+t;return Number.isNaN(i)||Number.isNaN(r)?void 0:i>r?s.O.forward:i<r?s.O.backward:void 0}let g=e=>{let[t="",i=""]=(d(n.Zr)||"").split("_"),r=(e=>{var t;return(null==(t=/(.*)\|#\|.*/.exec(e))?void 0:t[1])||""})(t);return(!e||r&&r!==e)&&(t="",i=""),{executionId:t,stepId:i,executionFlowId:r}};function f(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}function m(){c(n.Zr)}let v=e=>e.replace(/-./g,e=>e[1].toUpperCase()),b=(e,t)=>i=>e[i]!==t[i],w=e=>Array.from((null==e?void 0:e.attributes)||[]).reduce((e,t)=>{var i;let r=null==(i=RegExp(`^${n.Aq}(\\S+)$`).exec(t.name))?void 0:i[1];return r?Object.assign(e,{[r]:t.value}):e},{}),y=(e,t)=>{let{executionId:i,stepId:r,executionFlowId:o}=g(e);if(o&&e!==o)return t.debug("Flow id does not match the execution flow id, skipping url params handling"),{ssoQueryParams:{}};(i||r)&&m();let s=d(n.u)||void 0;s&&c(n.u);let l=d(n.Wb)||void 0;l&&c(n.Wb);let a="popup"===d(n.XV);a&&c(n.XV);let u=d(n.cq)||void 0;u&&c(n.cq);let{redirectAuthCodeChallenge:h,redirectAuthCallbackUrl:p,redirectAuthBackupCallbackUri:f,redirectAuthInitiator:v}={redirectAuthCodeChallenge:d(n.aY),redirectAuthCallbackUrl:d(n.Oc),redirectAuthBackupCallbackUri:d(n.VL),redirectAuthInitiator:d(n.CU)},b=d(n.Mk);b&&c(n.Mk);let w=d(n.O$);w&&c(n.O$);let y=d(n.hr);w&&c(n.hr);let S=d(n.cj);S&&c(n.cj);let C=d(n.mW);C&&c(n.mW);let k=d(n.Ni);k&&c(n.Ni);let A=d(n.BR);A&&c(n.BR);let I=d(n.Tl);I&&c(n.Tl);let E=d(n.qh);E&&c(n.qh);let O=d(n.Vm);O&&c(n.Vm);let x=d(n.T$);x&&c(n.T$);let j=d(n.VZ);return j&&c(n.VZ),{executionId:i,stepId:r,token:s,code:l,isPopup:a,exchangeError:u,redirectAuthCodeChallenge:h,redirectAuthCallbackUrl:p,redirectAuthBackupCallbackUri:f,redirectAuthInitiator:v,ssoQueryParams:{oidcIdpStateId:b,samlIdpStateId:w,samlIdpUsername:y,descopeIdpInitiated:"true"===S,ssoAppId:C,oidcLoginHint:E,oidcPrompt:O,oidcErrorRedirectUri:x,oidcResource:j,thirdPartyAppId:k,thirdPartyAppStateId:A,applicationScopes:I}}},S=e=>{let t,i;return Object.assign((...r)=>{var n;return t&&(n=t).length===r.length&&n.every((e,t)=>e===r[t])||(t=r,i=e(...r)),i},{reset:()=>{t=void 0,i=void 0}})},C=(e,t,i)=>{if(!0===t||"skipFirstScreen"===t&&!i){let t=e.querySelector("*[name]");setTimeout(()=>{null==t||t.focus()})}},k=e=>{e.querySelectorAll("*[name]").forEach(t=>{t.addEventListener("blur",()=>{var i;let r=()=>{var e;let i=t.focus;t.focus=()=>{},null==(e=t.reportValidity)||e.call(t),setTimeout(()=>{t.focus=i})};if("true"===t.getAttribute("invalid")||(null==(i=t.value)?void 0:i.length))return void r();let n={timer:void 0},o=e=>{"true"===e.target.getAttribute("formnovalidate")&&(clearTimeout(n.timer),n.timer=void 0)};n.timer=setTimeout(()=>{e.removeEventListener("click",o),r(),n.timer=void 0},150),e.addEventListener("click",o,{once:!0})})})};function A(e,t,i){return new Promise((r,n)=>{let o=!1,s=setTimeout(()=>{o=!0,void 0!==i?r(i):n(Error(`Promise timed out after ${e} ms`))},e);t.then(e=>{o||(clearTimeout(s),r(e))}).catch(e=>{o||(clearTimeout(s),n(e))})})}let I=()=>{var e;let t=null==(e=null==navigator?void 0:navigator.userAgentData)?void 0:e.brands,i=null==t?void 0:t.find(({brand:e,version:t})=>"Chromium"===e&&parseFloat(t));return i?i.version:0},E=(e,{oidcIdpStateId:t,samlIdpStateId:i,samlIdpUsername:r,ssoAppId:n,oidcLoginHint:o,oidcPrompt:s,oidcErrorRedirectUri:l,oidcResource:a,thirdPartyAppId:d,thirdPartyAppStateId:c,applicationScopes:u})=>
1!(!e||t||i||r||n||o||s||l||a||d||c||u),O=(e,t,i,r)=>{let n=document.createElement("form");n.method="POST",n.action=e,n.innerHTML=`
2  <input type="hidden" role="saml-response" name="SAMLResponse" value="${t}" />
3  <input type="hidden" role="saml-relay-state" name="RelayState" value="${i}" />
4  <input style="display: none;" id="SAMLSubmitButton" type="submit" value="Continue" />
5  `,document.body.appendChild(n),r(n)},x=e=>null==e?void 0:e.submit(),j=(e,t)=>{let i=t.find(t=>e[t]);return i?e[i]:null},R=(e,t=100)=>{let i;return function(...r){i||e.apply(this,r),clearTimeout(i),i=setTimeout(()=>{i=null},t)}};function W(e){if(e)return{locale:e.toLowerCase(),fallback:e.toLowerCase()};let t=navigator.language;return t?t.includes("-")?{locale:t.toLowerCase(),fallback:t.split("-")[0].toLowerCase()}:{locale:t.toLowerCase(),fallback:t.toLowerCase()}:{locale:"",fallback:""}}let P=()=>{document.querySelectorAll('[data-hidden-input="true"]').forEach(e=>e.remove())},T=e=>a.includes(e),L=e=>{var t,i,r,n,s;let l=(n=e.screenState,s=(e,t)=>o.includes(t)||t.startsWith("_"),Object.fromEntries(Object.entries(n).filter(([e,t])=>!s(t,e)))),{screenState:{errorText:a,errorType:d}}=e;return(a||d)&&(l.error={text:a,type:d}),e.action&&(l.action=e.action),(null==(r=null==(i=null==(t=e.screenState)?void 0:t.componentsConfig)?void 0:i.thirdPartyAppApproveScopes)?void 0:r.data)&&(l.inboundAppApproveScopes=e.screenState.componentsConfig.thirdPartyAppApproveScopes.data),l},$=e=>{let t=Object.assign({},e);return e.inboundAppApproveScopes&&(t.thirdPartyAppApproveScopes=e.inboundAppApproveScopes),t};function U(e,t){return`${n.Y_}.${t?`${e}_${t}`:e}`}let N=(e,t,i,r)=>{let n=void 0!==window.screenLeft?window.screenLeft:window.screen.left,o=void 0!==window.screenTop?window.screenTop:window.screen.top,s=((window.innerWidth||document.documentElement.clientWidth||window.screen.width)-i)/2+n,l=((window.innerHeight||document.documentElement.clientHeight||window.screen.height)-r)/2+o,a=!function(){let e=navigator.userAgent||"",t=/\b(iPhone)\b/.test(e),i=/Safari/.test(e)&&!/CriOS|FxiOS|OPiOS|EdgiOS|Chrome|Chromium/.test(e);return t&&i}()?"":"about:blank",d=window.open(a,t,`width=${i},height=${r},top=${l},left=${s},scrollbars=yes,resizable=yes`);return d.location.href=e,d.focus(),d}},59915:(e,t,i)=>{i.d(t,{A:()=>d});var r,n,o,s,l=i(63990),a=i(47584);class d{constructor(e={},{forceUpdate:t=!1}={}){r.set(this,void 0),n.set(this,{}),o.set(this,0),s.set(this,!0),this.update=e=>{let t="function"==typeof e?e((0,l.gn)(this,r,"f")):e,i=Object.assign(Object.assign({},(0,l.gn)(this,r,"f")),t),o=(0,l.gn)(this,r,"f");(0,l.GG)(this,r,i,"f"),Object.freeze((0,l.gn)(this,r,"f")),setTimeout(()=>{Object.values((0,l.gn)(this,n,"f")).forEach(({cb:e,selector:t,forceUpdate:r})=>{let n=t(o),d=t(i);((0,l.gn)(this,s,"f")||r||(!function(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}(d)?n!==d:!function e(t,i){let r=Object.getOwnPropertyNames(t),n=Object.getOwnPropertyNames(i);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n+=1){let o=r[n],s=t[o],l=i[o];if(null===s||null===l){if(s!==l)return!1}else if("object"==typeof s&&"object"==typeof l){if(!e(s,l))return!1}else if(s!==l)return!1}return!0}(n,d)))&&e(d,n,(0,a.tH)(d,n))})},0)},(0,l.GG)(this,r,e,"f"),(0,l.GG)(this,s,t,"f")}get current(){return Object.assign({},(0,l.gn)(this,r,"f"))}set forceUpdate(e){(0,l.GG)(this,s,e,"f")}subscribe(e,t=e=>e,{forceUpdate:i=!1}={}){return(0,l.GG)(this,o,(0,l.gn)(this,o,"f")+1,"f"),(0,l.gn)(this,n,"f")[(0,l.gn)(this,o,"f")]={cb:e,selector:t,forceUpdate:i},(0,l.gn)(this,o,"f").toString()}unsubscribe(e){let t=!!(0,l.gn)(this,n,"f")[e];return t&&delete(0,l.gn)(this,n,"f")[e],t}unsubscribeAll(){return(0,l.GG)(this,n,{},"f"),!0}}r=new WeakMap,n=new WeakMap,o=new WeakMap,s=new WeakMap},62038:(e,t,i)=>{i.d(t,{Db:()=>s,SO:()=>n,bm:()=>o,fb:()=>l,jt:()=>a,lz:()=>r});let r="undefined"!=typeof localStorage,n="J151000",o="J151001",s="E103205",l="E102004",a="E103202"},70110:(e,t,i)=>{let r;i.r(t),i.d(t,{default:()=>eH});var n,o,s,l,a,d,c,u,h,p,g,f,m,v,b,w,y,S,C,k,A,I,E,O,x,j,R,W,P,T,L,$,U,N,M,H,q,G,V,_,F,D,K,B,z,J,X,Z,Q,Y,ee,et,ei,er,en,eo,es,el,ea,ed,ec=i(63990),eu=i(78402),eh=i(434),ep=i(47584),eg=i(59915),ef=i(19815);let em=["disabled"],ev=(e,t)=>
5{Object.entries(t||{}).forEach(([t,i])=>{Array.from(e.querySelectorAll(`*[name="${t}"]:not([${eh.XW}])`)).forEach(e=>{e.value=i})})},eb=(e,t)=>t.split(".").reduce((e,t)=>(null==e?void 0:e[t])||"",e),ew=(e,t,i)=>e.replace(/{{(.+?)}}/g,(e,r)=>i?(0,ef.F)(eb(t,r)):eb(t,r)),ey=(e,t,i)=>{e.querySelectorAll(`[${eh.Ho}="${t}"]`).forEach(e=>{e.setAttribute("href",i)})},eS=(e,t,i)=>{var r,n;let o=null==(r=customElements.get(t))?void 0:r.cssVarList.url;i&&o&&(null==(n=null==e?void 0:e.style)||n.setProperty(o,`url(data:image/jpg;base64,${i})`))};var eC=i(98028);let ek=(e,t)=>{r?r.setItem(e,t):void 0!==(null==window?void 0:window.localStorage)&&window.localStorage.setItem(e,t)},eA=e=>r?r.getItem(e):void 0!==(null==window?void 0:window.localStorage)?window.localStorage.getItem(e):null,eI="dls_ab_testing_id",eE={"lastAuth.loginId":{"not-empty":e=>{var t;return!!e.loginId||!!(null==(t=e.lastAuth)?void 0:t.loginId)},empty:e=>{var t;return!e.loginId&&!(null==(t=e.lastAuth)?void 0:t.loginId)}},idpInitiated:{"is-true":e=>!!e.code,"is-false":e=>!e.code},externalToken:{"is-true":e=>!!e.token,"is-false":e=>!e.token},abTestingKey:{"greater-than":(e,t)=>(e.abTestingKey||0)>t,"less-than":(e,t)=>(e.abTestingKey||0)<t,"greater-than-or-equal":(e,t)=>(e.abTestingKey||0)>=t,"less-than-or-equal":(e,t)=>(e.abTestingKey||0)<=t,"in-range":(e,t)=>{let[i,r]=t?t.split(",").map(Number):[void 0,void 0];return(e.abTestingKey||0)>=(null!=i?i:0)&&(e.abTestingKey||0)<=(null!=r?r:0)},"not-in-range":(e,t)=>{let[i,r]=t?t.split(",").map(Number):[void 0,void 0];return!(void 0!==i&&void 0!==r&&!Number.isNaN(i)&&!Number.isNaN(r))||(e.abTestingKey||0)<i||(e.abTestingKey||0)>r},"devised-by":(e,t)=>{let i=Number(t);return!Number.isNaN(i)&&(e.abTestingKey||0)%i==0}}};function eO(e){let t={};try{Object.assign(t,JSON.parse(eA(eh.o1)))}catch(e){}return(null==t?void 0:t.loginId)||e?t:{}}function ex(e,t){(null==e?void 0:e.authMethod)&&(!t||(null==e?void 0:e.loginId))&&ek(eh.o1,JSON.stringify(e))}var ej=i(12364),eR=i(69207),eW=i(44077),eP=i(20783);let eT=(e,t="")=>Object.keys(e).reduce((i,r)=>{var n;if(Array.isArray(e[r]))return Object.assign(Object.assign({},i),{[r]:{value:e[r].map(e=>"object"==typeof e&&null!==e?eT(e):e)}});if("object"==typeof e[r]&&null!==e[r]&&!(null==(n=e[r])?void 0:n.value))return Object.assign(Object.assign({},i),eT(e[r],`${t+r}.`));let o="object"==typeof e[r]?e[r]:{value:e[r]},s=Object.assign(Object.assign({},i),{[t+r]:o,[`form.${t}${r}`]:o});return"displayName"===r?Object.assign(Object.assign({},s),{[`${t}fullName`]:o,[`form.${t}fullName`]:o}):s},[]);var eL=i(74951);i(80496);let e$=(0,ej.fc)(e=>{var t,i,r,n;return n=class extends e{constructor(){super(...arguments),t.add(this)}connectedCallback(){var e;(0,ec.gn)(this,t,"m",i).call(this)&&(0,ec.gn)(this,t,"m",r).call(this),null==(e=super.connectedCallback)||e.call(this)}},t=new WeakSet,i=function(){return!this.shadowRoot.host.closest("form")&&(0,ep.F2)()},r=function(){let e=this.shadowRoot.host,t=document.createElement("form");t.style.width="100%",t.style.height="100%",e.parentElement.appendChild(t),t.appendChild(e)},n});var eU=i(62038);let eN=(0,ej.Zz)(eW.T,eR.R,e$,eP.s)(HTMLElement);class eM extends eN{static get observedAttributes(){return["project-id","flow-id","base-url","tenant","locale","debug","storage-prefix","preview","redirect-url","auto-focus","store-last-authenticated-user","refresh-cookie-name","keep-last-authenticated-user-after-logout","validate-on-blur","style-id"]}constructor(e){super(),n.add(this),s.set(this,!1),l.set(this,void 0),this.flowStatus="initial",this.loggerWrapper={error:(e,t="")=>{this.logger.error(e,t,Error()),(0,ec.gn)(this,n,"m",I).call(this,e,t)},warn:(e,t="")=>{this.logger.warn(e,t)},info:(e,t="",i={})=>{this.logger.info(e,t,i)},debug:(e,t="")=>{this.logger.debug(e,t)}},a.set(this,new eg.A),d.set(this,new eg.A),c.set(this,{}),this.getComponentsContext=()=>(0,ec.gn)(this,c,"f"),this.nextRequestStatus=new eg.A({isLoading:!1}),u.set(this,void 0),h.set(this,{popstate:(0,ec.gn)(this,n,"m",v).bind(this),componentsContext:(0,ec.gn)(this,n,"m",C).bind(this)}),p.set(this,void 0),this.getConfig=()=>(0,ec.sH)(this,void 0,void 0,function*(){return(yield this.config)||{isMissingConfig:!0}}),(0,ec.GG)(this,p,e,"f"),(0,ec.gn)(this,n,"m",f).call(this)}get flowId(){return this.getAttribute("flow-id")}
5get client(){try{return JSON.parse(this.getAttribute("client"))||{}}catch(e){return{}}}get tenantId(){return this.getAttribute("tenant")||void 0}get redirectUrl(){return this.getAttribute("redirect-url")||void 0}get debug(){return"true"===this.getAttribute("debug")}get locale(){return this.getAttribute("locale")||void 0}get autoFocus(){var e;let t=null!=(e=this.getAttribute("auto-focus"))?e:"true";return"skipFirstScreen"===t?t:"true"===t}get validateOnBlur(){return"true"===this.getAttribute("validate-on-blur")}get storeLastAuthenticatedUser(){var e;return"true"===(null!=(e=this.getAttribute("store-last-authenticated-user"))?e:"true")}get refreshCookieName(){return this.getAttribute("refresh-cookie-name")||""}get keepLastAuthenticatedUserAfterLogout(){return"true"===this.getAttribute("keep-last-authenticated-user-after-logout")}get storagePrefix(){return this.getAttribute("storage-prefix")||""}get preview(){return!!this.getAttribute("preview")}get formConfig(){var e=this.form;try{return eT(JSON.parse(e))}catch(e){return{}}}get form(){return this.getAttribute("form")}get formConfigValues(){return Object.fromEntries(Object.entries(this.formConfig).map(([e,t])=>[e,t.value]))}get outboundAppId(){return this.getAttribute("outbound-app-id")}get outboundAppScopes(){try{return JSON.parse(this.getAttribute("outbound-app-scopes"))||null}catch(e){return null}}get popupOrigin(){return this.getAttribute("popup-origin")}get customStorage(){return(0,ec.gn)(this,l,"f")}set customStorage(e){if(e&&"function"!=typeof e.getItem)throw Error("Custom storage must have a getItem method");if(e&&"function"!=typeof e.setItem)throw Error("Custom storage must have a setItem method");if(e&&"function"!=typeof e.removeItem)throw Error("Custom storage must have a removeItem method");(0,ec.GG)(this,l,e,"f"),r=e}get isRestartOnError(){return"true"===this.getAttribute("restart-on-error")}getExecutionContext(){return(0,ec.sH)(this,void 0,void 0,function*(){let e=yield this.getConfig();return"executionContext"in e?e.executionContext:void 0})}getProjectConfig(){return(0,ec.sH)(this,void 0,void 0,function*(){let e=yield this.getConfig();return"projectConfig"in e?e.projectConfig:void 0})}getFlowConfig(){return(0,ec.sH)(this,void 0,void 0,function*(){var e;let t=yield this.getProjectConfig(),i=(null==(e=null==t?void 0:t.flows)?void 0:e[this.flowId])||{};return null!=i.version||(i.version=0),i})}getTargetLocales(){return(0,ec.sH)(this,void 0,void 0,function*(){let e=yield this.getFlowConfig();return((null==e?void 0:e.targetLocales)||[]).map(e=>e.toLowerCase())})}handleKeyPress(){this.logger.debug("Enable key press handler"),this.rootElement.onkeydown=e=>{var t,i,r;let n=!!(null==(t=this.shadowRoot.activeElement)?void 0:t.getAttribute("href")),o=eh.M2.includes(null!=(r=null==(i=this.shadowRoot.activeElement)?void 0:i.localName)?r:"");if("Enter"!==e.key||n||o)return;e.preventDefault();let s=this.rootElement.querySelectorAll("descope-button");if(1===s.length&&"false"!==s[0].getAttribute("auto-submit"))return void s[0].click();let l=Array.from(s).filter(e=>"true"===e.getAttribute("auto-submit"));if(1===l.length)return void l[0].click();let a=Array.from(s).filter(e=>"button"===e.getAttribute("data-type"));if(1===a.length)"false"!==a[0].getAttribute("auto-submit")&&a[0].click();else if(0===a.length){let e=Array.from(s).filter(e=>"sso"===e.getAttribute("data-type"));1===e.length&&"false"!==e[0].getAttribute("auto-submit")&&e[0].click()}}}disableKeyPressHandler(){this.logger.debug("Disable key press handler"),this.rootElement.onkeydown=null}getComponentsVersion(){return(0,ec.sH)(this,void 0,void 0,function*(){var e;let t=yield this.getConfig();return("projectConfig"in t?null==(e=t.projectConfig)?void 0:e.componentsVersion:{})||(this.logger.error("Did not get components version, using latest version"),"latest")})}init(){let e=Object.create(null,{init:{get:()=>super.init}});return(0,ec.sH)(this,void 0,void 0,function*(){var t;if(this.flowStatus="loading",["ready","error","success"].forEach(e=>this.addEventListener(e,()=>{this.flowStatus=e})),yield null==(t=e.init)?void 0:t.call(this),(0,ec.gn)(this,d,"f").subscribe((0,ec.gn)(this,n,"m",A).bind(this)),(0,ec.gn)(this,d,"f").update({isDebug:this.debug}),(0,ec.gn)(this,n,"m",m).call(this),yield(0,ec.gn)(this,n,"m",y).call(this))return void this.loggerWrapper.error("This SDK version does not support your flows version","Make sure to upgrade your flows to the latest version or use an older SDK ver
5sion");let i=yield this.getConfig();if("isMissingConfig"in i&&i.isMissingConfig)return void this.loggerWrapper.error("Cannot get config file","Make sure that your projectId & flowId are correct");let{executionId:r,stepId:o,token:l,code:c,isPopup:u,exchangeError:p,redirectAuthCallbackUrl:g,redirectAuthBackupCallbackUri:f,redirectAuthCodeChallenge:v,redirectAuthInitiator:b,ssoQueryParams:S}=(0,ep.My)(this.flowId,this.loggerWrapper);window.addEventListener("popstate",(0,ec.gn)(this,h,"f").popstate),window.addEventListener("components-context",(0,ec.gn)(this,h,"f").componentsContext),(0,ec.gn)(this,a,"f").subscribe((0,ec.gn)(this,n,"m",w).bind(this)),(0,ec.gn)(this,a,"f").update(Object.assign({projectId:this.projectId,flowId:this.flowId,baseUrl:this.baseUrl,tenant:this.tenantId,redirectUrl:this.redirectUrl,locale:this.locale,stepId:o,executionId:r,token:l,code:c,isPopup:u,exchangeError:p,redirectAuthCallbackUrl:g,redirectAuthBackupCallbackUri:f,redirectAuthCodeChallenge:v,redirectAuthInitiator:b},S)),(0,ec.GG)(this,s,!0,"f")})}disconnectedCallback(){(0,ec.gn)(this,a,"f").unsubscribeAll(),(0,ec.gn)(this,d,"f").unsubscribeAll(),(0,ec.gn)(this,n,"m",k).call(this),window.removeEventListener("popstate",(0,ec.gn)(this,h,"f").popstate),window.removeEventListener("components-context",(0,ec.gn)(this,h,"f").componentsContext)}attributeChangedCallback(e,t,i){if(this.shadowRoot.isConnected&&(0,ec.gn)(this,s,"f")&&t!==i&&o.observedAttributes.includes(e)){(0,ec.gn)(this,n,"m",m).call(this);let r=null===t;(0,ec.gn)(this,a,"f").update(({stepId:t,executionId:n})=>{let o=t,s=n;return r||(s=null,o=null,(0,ep.sd)()),{[(0,ep.xQ)(e)]:i,stepId:o,executionId:s}}),(0,ec.gn)(this,d,"f").update({isDebug:this.debug})}}}o=eM,s=new WeakMap,l=new WeakMap,a=new WeakMap,d=new WeakMap,c=new WeakMap,u=new WeakMap,h=new WeakMap,p=new WeakMap,n=new WeakSet,g=function(){this.injectStyle("\n    :host {\n			width: 100%;\n      display: block;\n		}\n\n		#root {\n			height: 100%;\n      display: flex;\n      flex-direction: column;\n		}\n\n    #content-root {\n      all: initial;\n      transition: opacity 200ms ease-in-out;\n    }\n\n		#root[data-theme] {\n			background-color: transparent;\n		}\n\n		.fade-out {\n			opacity: 0.1!important;\n		}\n\n    .hidden {\n      display: none;\n    }\n    ")},f=function(){(0,ec.gn)(this,n,"m",g).call(this),this.slotElement=document.createElement("slot"),this.slotElement.classList.add("hidden"),this.rootElement.appendChild(this.slotElement)},m=function(){let e=["base-url","tenant","locale","debug","redirect-url","auto-focus","store-last-authenticated-user","refresh-cookie-name","keep-last-authenticated-user-after-logout","preview","storage-prefix","form","client","validate-on-blur","style-id","outbound-app-id","outbound-app-scopes"];o.observedAttributes.forEach(t=>{if(!e.includes(t)&&!this[(0,ep.xQ)(t)])throw Error(`${t} cannot be empty`)})},v=function(){let{stepId:e,executionId:t}=(0,ep.Rt)(this.flowId);(0,ec.gn)(this,a,"f").update({stepId:e,executionId:t})},b=function(e,t){eu.ns&&"function"==typeof eu.ns||this.logger.error("SDK was not loaded properly",eu.ns,JSON.stringify(eu.ns));let i=Object.assign(Object.assign({persistTokens:!0,preview:this.preview,storagePrefix:this.storagePrefix,storeLastAuthenticatedUser:this.storeLastAuthenticatedUser,keepLastAuthenticatedUserAfterLogout:this.keepLastAuthenticatedUserAfterLogout,refreshCookieName:this.refreshCookieName},o.sdkConfigOverrides),{projectId:e,baseUrl:t});(0,ec.gn)(this,l,"f")&&(i.customStorage=(0,ec.gn)(this,l,"f")),this.sdk=(0,eu.ns)(i),["start","next"].forEach(e=>{let t=this.sdk.flow[e];this.sdk.flow[e]=(...e)=>(0,ec.sH)(this,void 0,void 0,function*(){try{return yield t(...e)}catch(e){return{error:{errorCode:eU.SO,errorDescription:e.toString()}}}})})},w=function(e,t,i){return(0,ec.sH)(this,void 0,void 0,function*(){let{projectId:t,baseUrl:r}=e;if(i("projectId")||i("baseUrl")){if(!t)return;(0,ec.gn)(this,n,"m",b).call(this,t,r)}(0,ec.gn)(this,p,"f").call(this,e)})},y=function(){return(0,ec.sH)(this,void 0,void 0,function*(){let e=yield this.getConfig();
5return"isMissingConfig"in e&&e.isMissingConfig&&(yield(0,ec.gn)(this,n,"m",S).call(this))})},S=function(){return(0,ec.sH)(this,void 0,void 0,function*(){let e=(0,ep.Dr)({projectId:this.projectId,filename:eL.VS,assetsFolder:eL.l$,baseUrl:this.baseStaticUrl});try{return yield(0,ep.Ix)(e,"json"),!0}catch(e){return!1}})},C=function(e){(0,ec.GG)(this,c,Object.assign(Object.assign({},(0,ec.gn)(this,c,"f")),e.detail),"f")},k=function(){var e;null==(e=(0,ec.gn)(this,u,"f"))||e.remove(),(0,ec.GG)(this,u,null,"f")},A=function(e){return(0,ec.sH)(this,arguments,void 0,function*({isDebug:e}){e?((0,ec.GG)(this,u,document.createElement("descope-debugger"),"f"),Object.assign((0,ec.gn)(this,u,"f").style,{position:"fixed",top:"0",right:"0",height:"100vh",width:"100vw",pointerEvents:"none",zIndex:99999}),yield i.e(4714).then(i.bind(i,24714)),document.body.appendChild((0,ec.gn)(this,u,"f"))):(0,ec.gn)(this,n,"m",k).call(this)})},I=function(e,t){var i;e&&this.debug&&(null==(i=(0,ec.gn)(this,u,"f"))||i.updateData({title:e,description:t}))},eM.sdkConfigOverrides={baseHeaders:{"x-descope-sdk-name":"web-component","x-descope-sdk-version":"3.54.0"}};class eH extends eM{static set sdkConfigOverrides(e){eM.sdkConfigOverrides=e}static get sdkConfigOverrides(){return eM.sdkConfigOverrides}constructor(){let e=new eg.A({deferredRedirect:!1,deferredPolling:!1});super(e.update.bind(e)),E.add(this),this.stepState=new eg.A({}),O.set(this,void 0),x.set(this,null),j.set(this,null),R.set(this,{visibilitychange:(0,ec.gn)(this,E,"m",W).bind(this)}),this.bridgeVersion=2,this.nativeCallbacks={},H.set(this,!1),this.handleRedirect=e=>{window.location.assign(e)},G.set(this,e=>{let t=()=>{this.contentRootElement.classList.toggle("hidden",e),this.slotElement.classList.toggle("hidden",!e),e&&(this.contentRootElement.innerHTML="")};e&&this.contentRootElement.hasChildNodes()?(0,ec.gn)(this,E,"m",V).call(this,t):t()}),_.set(this,(e,t,i,r,n=!1)=>{let o=[eU.Db,eU.jt];if(this.flowState.current.action===eh.mP.poll){if((0,ec.gn)(this,D,"f").call(this)&&document.hidden)return this.logger.debug("polling - Deferring polling until in foreground"),void this.flowState.update({deferredPolling:!0});this.logger.debug("polling - Scheduling polling request");let s=Date.now(),l=n?500:2e3;(0,ec.GG)(this,O,setTimeout(()=>(0,ec.sH)(this,void 0,void 0,function*(){var a,d;let c;this.logger.debug("polling - Calling next");let u=this.sdk.flow.next(e,t,eh.aV.polling,i,r,{}),h=document.hidden&&!n&&Date.now()-s>l+500;h&&this.logger.debug("polling - The polling seems to be throttled");try{c=yield(0,ep.BK)(h?1e3:6e3,u)}catch(n){return this.logger.warn(`polling - The ${h?"throttled fetch":"fetch"} call timed out or was aborted`),void(0,ec.gn)(this,_,"f").call(this,e,t,i,r,h)}if((null==(a=null==c?void 0:c.error)?void 0:a.errorCode)===eU.SO)return this.logger.debug("polling - Got a generic error due to exception in fetch call"),void(0,ec.gn)(this,_,"f").call(this,e,t,i,r);this.logger.debug("polling - Got a response"),(null==c?void 0:c.error)&&this.logger.debug("polling - Response has an error",JSON.stringify(c.error,null,4)),(null==(d=null==c?void 0:c.error)?void 0:d.errorCode)&&o.includes(c.error.errorCode)?this.logger.debug("polling - Stopping polling due to error"):(0,ec.gn)(this,_,"f").call(this,e,t,i,r),(0,ec.gn)(this,K,"f").call(this,c)}),l),"f")}}),F.set(this,()=>{clearTimeout((0,ec.gn)(this,O,"f")),(0,ec.GG)(this,O,null,"f")}),D.set(this,()=>!!window.descopeBridge||/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)),K.set(this,e=>{var t,i,r,n,o,s,l,a,d,c,u,h,p;if(!(null==e?void 0:e.ok)){let l=null==(t=null==e?void 0:e.response)?void 0:t.url,a=`${null==(i=null==e?void 0:e.response)?void 0:i.status} - ${null==(r=null==e?void 0:e.response)?void 0:r.statusText}`;(0,ec.gn)(this,E,"m",ea).call(this,"error",(null==e?void 0:e.error)||{errorCode:eU.bm,errorDescription:a,errorMessage:l}),this.loggerWrapper.error((null==(n=null==e?void 0:e.error)?void 0:n.errorDescription)||l,(null==(o=null==e?void 0:e.error)?void 0:o.errorMessage)||a);let d=null==(s=null==e?void 0:e.error)?void 0:s.errorCode;return void(d!==eU.fb&&d!==eU.Db||!this.isRestartOnError||(0,ec.gn)(this,E,"m",M).call(this))}
5null==(a=null==(l=e.data)?void 0:l.runnerLogs)||a.forEach(e=>{let{level:t,title:i,log:r}=e;t&&this.loggerWrapper[t]?this.loggerWrapper[t](i,r):this.loggerWrapper.info(i,r)});let g=null==(u=null==(c=null==(d=e.data)?void 0:d.screen)?void 0:c.state)?void 0:u.errorText;(null==(h=e.data)?void 0:h.error)?this.loggerWrapper.error(`[${e.data.error.code}]: ${e.data.error.description}`,`${g?`${g} - `:""}${e.data.error.message}`):g&&this.loggerWrapper.error(g);let{status:f,authInfo:m,lastAuth:v,action:b,openInNewTabUrl:w}=e.data;if(b!==eh.mP.poll&&(0,ec.gn)(this,F,"f").call(this),"completed"===f){this.storeLastAuthenticatedUser&&ex(v);let t=Object.assign({},m);return e.data.output&&Object.keys(e.data.output).length>0&&(t.flowOutput=e.data.output),void(0,ec.gn)(this,E,"m",ea).call(this,"success",t)}this.storeLastAuthenticatedUser&&ex(v,!0),w&&window.open(w,"_blank");let{executionId:y,stepId:S,stepName:C,screen:k,redirect:A,webauthn:I,error:O,samlIdpResponse:x,nativeResponse:R}=e.data,W=Date.now();b!==eh.mP.poll?(this.loggerWrapper.info(`Step "${C||`#${S}`}" is ${f}`,"",{screen:k,status:f,stepId:S,stepName:C,action:b,error:O}),(null==(p=k.state)?void 0:p.clientScripts)&&(0,ec.GG)(this,j,this.loadSdkScripts(k.state.clientScripts),"f"),this.flowState.update({stepId:S,stepName:C,executionId:y,action:b,redirectTo:null==A?void 0:A.url,redirectIsPopup:null==A?void 0:A.isPopup,screenId:null==k?void 0:k.id,screenState:null==k?void 0:k.state,webauthnTransactionId:null==I?void 0:I.transactionId,webauthnOptions:null==I?void 0:I.options,samlIdpResponseUrl:null==x?void 0:x.url,samlIdpResponseSamlResponse:null==x?void 0:x.samlResponse,samlIdpResponseRelayState:null==x?void 0:x.relayState,nativeResponseType:null==R?void 0:R.type,nativePayload:null==R?void 0:R.payload,reqTimestamp:W})):this.flowState.update({action:b,reqTimestamp:W})}),B.set(this,(0,ep.CM)(()=>(0,ec.sH)(this,void 0,void 0,function*(){var e;try{let t=yield this.sdk.webauthn.signIn.start("",window.location.origin);return t.ok||this.loggerWrapper.warn("Webauthn start failed",null==(e=null==t?void 0:t.error)?void 0:e.errorMessage),t.data}catch(e){this.loggerWrapper.warn("Webauthn start failed",e.message)}}))),Y.set(this,null),en.set(this,(0,ep.A0)((e,t)=>(0,ec.sH)(this,void 0,void 0,function*(){var i;if("true"===e.getAttribute("formnovalidate")||(0,ec.gn)(this,E,"m",Z).call(this)){let r=null==e?void 0:e.getAttribute("id");(0,ec.gn)(this,E,"m",ee).call(this,e);let n=yield(0,ec.gn)(this,E,"m",Q).call(this),o=(0,ep.dR)(e);this.nextRequestStatus.update({isLoading:!0});let s=Object.assign(Object.assign(Object.assign({},o),n),{origin:(null==(i=this.nativeOptions)?void 0:i.origin)||window.location.origin});yield t(r,s),this.nextRequestStatus.update({isLoading:!1}),(0,ec.gn)(this,E,"m",et).call(this,n)}}))),this.flowState=e}nativeResume(e,t){var i,r,n,o,s;let l=JSON.parse(t);if("oauthWeb"===e||"sso"===e){let{exchangeCode:e}=l;e||(e=null==(i=new URL(l.url).searchParams)?void 0:i.get(eh.Wb)),null==(n=(r=this.nativeCallbacks).complete)||n.call(r,{exchangeCode:e,idpInitiated:!0})}else if("magicLink"===e){let e=new URL(l.url),t=e.searchParams.get(eh.u),i=e.searchParams.get(eh.Zr).split("_").pop();(0,ec.gn)(this,F,"f").call(this),this.flowState.update({token:t,stepId:i,action:void 0})}else if("beforeScreen"===e){let{screenResolve:e}=this.nativeCallbacks;this.nativeCallbacks.screenResolve=null;let{override:t}=l;t||(this.nativeCallbacks.screenNext=null),null==e||e(t)}else if("resumeScreen"===e){let{interactionId:e,form:t}=l,{screenNext:i}=this.nativeCallbacks;this.nativeCallbacks.screenNext=null,null==i||i(e,t)}else null==(s=(o=this.nativeCallbacks).complete)||s.call(o,l)}loadSdkScriptsModules(){return Array.from(this.shadowRoot.querySelectorAll("div[data-script-id]")).map(e=>e.moduleRes).filter(e=>!!e)}loadSdkScripts(e){if(!(null==e?void 0:e.length))return null;let t=(e,t)=>i=>{this.dispatchEvent(new CustomEvent("components-context",{detail:{[(0,ep.Cp)(e.id,e.resultKey)]:i},bubbles:!0,composed:!0})),t(e.id)};return this.loggerWrapper.debug(`Preparing to load scripts: ${e.map(e=>e.id).join(", ")}`),Promise.race([Promise.all(null==e?void 0:e.map(e=>(0,ec.sH)(this,void 0,void 0,function*(){var i,r;
5let n=this.shadowRoot.querySelector(`[data-script-id="${e.id}"]`);if(n){this.loggerWrapper.debug("Script already loaded",e.id);let{moduleRes:t}=n;return null==(i=null==t?void 0:t.start)||i.call(t),t}yield this.injectNpmLib("@descope/flow-scripts","1.0.13",`dist/${e.id}.js`);let o=null==(r=globalThis.descope)?void 0:r[e.id];return new Promise((i,r)=>{try{let r=o(e.initArgs,{baseUrl:this.baseUrl,ref:this},t(e,i),this.loggerWrapper);if(r){let t=document.createElement("div");t.setAttribute("data-script-id",e.id),t.moduleRes=r,this.shadowRoot.appendChild(t),this.nextRequestStatus.subscribe(()=>{var t;this.loggerWrapper.debug("Unloading script",e.id),null==(t=r.stop)||t.call(r)})}}catch(e){r(e)}})}))),new Promise(e=>{setTimeout(()=>{this.loggerWrapper.warn("SDK scripts loading timeout"),e(!0)},eh.Xh)})])}get isDismissScreenErrorOnInput(){return"true"===this.getAttribute("dismiss-screen-error-on-input")}init(){if(!window.descopeBridge)return this._init();this.lazyInit=this._init}_init(){let e=Object.create(null,{init:{get:()=>super.init}});return(0,ec.sH)(this,void 0,void 0,function*(){var t,i;this.shadowRoot.isConnected&&(null==(t=this.flowState)||t.subscribe(this.onFlowChange.bind(this)),(0,ec.gn)(this,E,"m",U).call(this),window.addEventListener("visibilitychange",(0,ec.gn)(this,R,"f").visibilitychange)),yield null==(i=e.init)?void 0:i.call(this)})}disconnectedCallback(){var e;super.disconnectedCallback(),this.flowState.unsubscribeAll(),this.stepState.unsubscribeAll(),(0,ec.gn)(this,F,"f").call(this),null==(e=(0,ec.gn)(this,x,"f"))||e.abort(),(0,ec.GG)(this,x,null,"f"),window.removeEventListener("visibilitychange",(0,ec.gn)(this,R,"f").visibilitychange)}getHtmlFilenameWithLocale(e,t){return(0,ec.sH)(this,void 0,void 0,function*(){let i,r=(0,ep.YK)(e),n=yield this.getTargetLocales();return n.includes(r.locale)?i=`${t}-${r.locale}.html`:n.includes(r.fallback)&&(i=`${t}-${r.fallback}.html`),i})}getPageContent(e,t){return(0,ec.sH)(this,void 0,void 0,function*(){if(t)try{let{body:e}=yield this.fetchStaticResource(t,"text");return e}catch(i){this.loggerWrapper.error(`Failed to fetch flow page from ${t}. Fallback to url ${e}`,i)}try{let{body:t}=yield this.fetchStaticResource(e,"text");return t}catch(e){this.loggerWrapper.error("Failed to fetch flow page",e.message)}return null})}onFlowChange(e,t,i){return(0,ec.sH)(this,void 0,void 0,function*(){var r,n;let o,s,l,{projectId:a,flowId:d,tenant:c,stepId:u,executionId:h,action:p,screenId:g,screenState:f,redirectTo:m,redirectIsPopup:v,redirectUrl:b,token:w,code:y,isPopup:S,exchangeError:C,webauthnTransactionId:k,webauthnOptions:A,redirectAuthCodeChallenge:I,redirectAuthCallbackUrl:O,redirectAuthBackupCallbackUri:R,redirectAuthInitiator:W,locale:P,samlIdpResponseUrl:T,samlIdpResponseSamlResponse:$,samlIdpResponseRelayState:U,nativeResponseType:N,nativePayload:M,reqTimestamp:H}=e,G=(0,ec.Tt)(e,["projectId","flowId","tenant","stepId","executionId","action","screenId","screenState","redirectTo","redirectIsPopup","redirectUrl","token","code","isPopup","exchangeError","webauthnTransactionId","webauthnOptions","redirectAuthCodeChallenge","redirectAuthCallbackUrl","redirectAuthBackupCallbackUri","redirectAuthInitiator","locale","samlIdpResponseUrl","samlIdpResponseSamlResponse","samlIdpResponseRelayState","nativeResponseType","nativePayload","reqTimestamp"]),V=(()=>{let e=eA(eI);if(!e){let e=Math.floor(100*Math.random()+1);return ek(eI,e.toString()),e}return Number(e)})(),{outboundAppId:F}=this,{outboundAppScopes:D}=this,B=this.sdk.getLastUserLoginId(),z=yield this.getFlowConfig(),J=yield this.getProjectConfig(),X=Object.entries(J.flows||{}).reduce((e,[t,i])=>(e[t]=i.version,e),{}),Z=O&&I?{callbackUrl:O,codeChallenge:I,backupCallbackUri:R}:void 0,Q=this.nativeOptions?{platform:this.nativeOptions.platform,bridgeVersion:this.nativeOptions.bridgeVersion,oauthProvider:this.nativeOptions.oauthProvider,oauthRedirect:this.nativeOptions.oauthRedirect,magicLinkRedirect:this.nativeOptions.magicLinkRedirect,ssoRedirect:this.nativeOptions.ssoRedirect}:void 0,Y={};if(!h){let e=[...z.clientScripts||[],...z.sdkScripts||[]];if(z.conditions){let t=[];({startScreenId:o,conditionInteractionId:l,startScreenName:s,clientScripts:t,componentsConfig:Y}=((e,t)=>{let i=null==t?void 0:t.find(({key:t,operator:i,predicate:r})=>{var n;if("ELSE"===t)return!0;let o=null==(n=eE[t])?void 0:n[i];return!!(null==o?void 0:o(e,r))});return i?{startScreenId:i.met.screenId,startScreenName:i.met.screenName,conditionInteractionId:i.met.interactionId,clientScripts:i.met.clientScripts,componentsConfig:i.met.componentsConfig}:{}})({loginId:B,code:y,token:w,abTestingKey:V,lastAuth:eO(B)},z.conditions)),e.push(...t||[])}else z.condition?{startScreenId:o,conditionInteractionId:l}=((e,t)=>{var i;let r=null==(i=eE[null==e?void 0:e.key])?void 0:i[e.operator];if(!r)return{};let n=r(t,e.predicate)?e.met:e.unmet;return{startScreenId:null==n?void 0:n.screenId,startScreenName:null==n?void 0:n.screenName,conditionInteractionId:null==n?void 0:n.interactionId}})(z.condition,{loginId:B,code:y,token:w,abTestingKey:V,lastAuth:eO(B)}):(s=z.startScreenName,o=z.startScreenId);if((0,ec.GG)(this,j,this.loadSdkScripts(e),"f"),z.fingerprintEnabled&&z.fingerprintKey?yield(0,eu.bv)(z.fingerprintKey,this.baseUrl):(0,eu.g0)(),!(0,ep.Tf)(o,G)){let e=yield this.sdk.flow.start(d,Object.assign(Object.assign(Object.assign(Object.assign({tenant:c,redirectAuth:Z},G),{client:this.client}),b&&{redirectUrl:b}),{lastAuth:eO(B),abTestingKey:V,locale:(0,ep.YK)(P).locale,nativeOptions:Q,outboundAppId:F,outboundAppScopes:D}),l,"",J.componentsVersion,X,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.formConfigValues),y?{exchangeCode:y,idpInitiated:!0}:{}),G.descopeIdpInitiated&&{idpInitiated:!0}),w?{token:w}:{}),G.oidcLoginHint?{externalId:G.oidcLoginHint}:{}));return(0,ec.gn)(this,K,"f").call(this,e),void("completed"!==(null==(r=null==e?void 0:e.data)?void 0:r.status)&&this.flowState.update({code:void 0,token:void 0}))}}if(this.loggerWrapper.debug("Before popup postmessage send",JSON.stringify({isPopup:S,code:y,exchangeError:C,isCodeChanged:i("code"),isExchangeErrorChanged:i("exchangeError")}
5)),S&&(i("code")&&y||i("exchangeError")&&C))return void(0,ec.gn)(this,E,"m",ed).call(this,h,y,C);if(h&&(i("token")&&w||i("code")&&y||i("exchangeError")&&C)){let e=yield this.sdk.flow.next(h,u,eh.aV.submit,z.version,J.componentsVersion,{token:w,exchangeCode:y,exchangeError:C});return(0,ec.gn)(this,K,"f").call(this,e),void this.flowState.update({token:void 0,code:void 0,exchangeError:void 0})}if(p===eh.mP.loadForm&&["samlIdpResponseUrl","samlIdpResponseSamlResponse","samlIdpResponseRelayState"].some(e=>i(e))){if(!T||!$)return void this.loggerWrapper.error("Did not get saml idp params data to load");(0,ep.qx)(T,$,U||"",ep.rM)}if(p===eh.mP.redirect&&(i("redirectTo")||i("deferredRedirect"))){if(!m)return void this.loggerWrapper.error("Did not get redirect url");if("no-op"===m)return;if("android"===W&&document.hidden)return void this.flowState.update({deferredRedirect:!0});if(this.loggerWrapper.debug(`Redirect is popup ${v}`),v){let e;this.loggerWrapper.debug("Opening redirect in popup");let t=(0,ep.FQ)(m,"?",598,700),i=this.shouldUsePopupPostMessage();i&&(t.name=`descope-wc|${window.location.origin}`),this.loggerWrapper.debug("Popup communication method: "+(i?"postMessage":"BroadcastChannel"));let r=e=>{this.loggerWrapper.debug("Received popup message",JSON.stringify(e.data));let t=i?this.popupOrigin:window.location.origin;if(e.origin!==t)return void this.loggerWrapper.debug(`Ignoring message from unexpected origin. received: "${e.origin}", expected: "${t}"`);let{action:r,data:n}=e.data||{};"code"===r&&this.flowState.update({code:n.code,exchangeError:n.exchangeError})};this.loggerWrapper.debug("Starting popup closed detection");let n=setInterval(()=>{t.closed&&(this.loggerWrapper.debug("Popup closed, dispatching popupclosed event"),clearInterval(n),(0,ec.gn)(this,E,"m",ea).call(this,"popupclosed",{}),this.loggerWrapper.debug("Cleaning up popup listeners"),null==e||e())},1e3);if(i)window.addEventListener("message",r),e=()=>{this.loggerWrapper.debug("Cleaning up popup postMessage listener"),window.removeEventListener("message",r)};else{this.loggerWrapper.debug("Creating broadcast channel");let t=new BroadcastChannel(h);t.onmessage=r,e=()=>{this.loggerWrapper.debug("Closing channel"),t.close()}}}else this.handleRedirect(m),this.flowState.update({redirectTo:"no-op"}),(0,ec.gn)(this,E,"m",ea).call(this,"popupclosed",{});return}if(p===eh.mP.webauthnCreate||p===eh.mP.webauthnGet){let e,t;if(!k||!A)return void this.loggerWrapper.error("Did not get webauthn transaction id or options");null==(n=(0,ec.gn)(this,x,"f"))||n.abort(),(0,ec.GG)(this,x,null,"f");try{e=p===eh.mP.webauthnCreate?yield this.sdk.webauthn.helpers.create(A):yield this.sdk.webauthn.helpers.get(A)}catch(e){"InvalidStateError"===e.name?this.loggerWrapper.warn("WebAuthn operation failed",e.message):"NotAllowedError"!==e.name&&this.loggerWrapper.error(e.message),t=e.name}let i=yield this.sdk.flow.next(h,u,eh.aV.submit,z.version,J.componentsVersion,{transactionId:k,response:e,failure:t});(0,ec.gn)(this,K,"f").call(this,i)}if(p===eh.mP.nativeBridge)return this.nativeCallbacks.complete=e=>(0,ec.sH)(this,void 0,void 0,function*(){let t=yield this.sdk.flow.next(h,u,eh.aV.submit,z.version,J.componentsVersion,e);(0,ec.gn)(this,K,"f").call(this,t)}),(0,ec.gn)(this,E,"m",L).call(this,N,M),void setTimeout(()=>{this.dispatchEvent(new Event("popupclosed"))},500);if((i("action")||i("deferredPolling"))&&(0,ec.gn)(this,_,"f").call(this,h,u,z.version,J.componentsVersion),!g&&!o)return void this.loggerWrapper.warn("No screen was found to show");let ee=o||g,et=yield this.getHtmlFilenameWithLocale(P,ee),{oidcLoginHint:ei,oidcPrompt:er,oidcErrorRedirectUri:en,oidcResource:es,samlIdpUsername:el}=G,eg={direction:(0,ep.mI)(u,t.stepId),screenState:Object.assign(Object.assign({},f),{form:Object.assign(Object.assign({},this.formConfigValues),null==f?void 0:f.form),lastAuth:{loginId:B,name:this.sdk.getLastUserDisplayName()||B},componentsConfig:Object.assign(Object.assign(Object.assign({},z.componentsConfig),Y),null==f?void 0:f.componentsConfig)}),htmlFilename:`${ee}.html`,htmlLocaleFilename:et,screenId:ee,stepName:e.stepName||s,samlIdpUsername:el,oidcLoginHint:ei,oidcPrompt:er,oidcErrorRedirectUri:en,oidcResource:es,action:p},ef=eO(B);(0,ep.Tf)(o,G)?eg.next=(e,t)=>
5(0,ec.sH)(this,void 0,void 0,function*(){let i=(null==z?void 0:z.clientScripts)||[];yield(0,ec.gn)(this,E,"m",eo).call(this,i);let r=yield this.sdk.flow.start(d,Object.assign(Object.assign(Object.assign(Object.assign({tenant:c,redirectAuth:Z},G),{lastAuth:ef,preview:this.preview,abTestingKey:V,client:this.client}),b&&{redirectUrl:b}),{locale:(0,ep.YK)(P).locale,nativeOptions:Q,outboundAppId:F,outboundAppScopes:D}),l,e,J.componentsVersion,X,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.formConfigValues),this.getComponentsContext()),(0,ep.C3)(t)),y&&{exchangeCode:y,idpInitiated:!0}),G.descopeIdpInitiated&&{idpInitiated:!0}),w&&{token:w}),eg.next.isCustomScreen);return(0,ec.gn)(this,K,"f").call(this,r),r}):(i("projectId")||i("baseUrl")||i("executionId")||i("stepId"))&&(eg.next=(e,t)=>(0,ec.sH)(this,void 0,void 0,function*(){let i=(null==f?void 0:f.clientScripts)||[];yield(0,ec.gn)(this,E,"m",eo).call(this,i);let r=yield this.sdk.flow.next(h,u,e,z.version,J.componentsVersion,Object.assign(Object.assign({},this.getComponentsContext()),(0,ep.C3)(t)),eg.next.isCustomScreen);return(0,ec.gn)(this,K,"f").call(this,r),r})),this.loggerWrapper.debug("Got a screen with id",eg.screenId),yield(0,ec.gn)(this,E,"m",q).call(this,eg),this.stepState.update(eg)})}onStepChange(e,t){return(0,ec.sH)(this,void 0,void 0,function*(){var i,r,n,o,s,l,a,d;let{htmlFilename:c,htmlLocaleFilename:u,direction:h,next:p,screenState:g}=e;this.loggerWrapper.debug("Rendering a flow screen");let f=document.createElement("template");f.innerHTML=yield this.getPageContent(c,u);let m=f.content.cloneNode(!0),v=this.loadDescopeUiComponents(f);this.sdk.webauthn.helpers.isSupported()?yield(0,ec.gn)(this,E,"m",J).call(this,m,p):m.querySelectorAll(`descope-button[${eh.Ho}="biometrics"]`).forEach(e=>e.setAttribute("disabled","true")),!e.samlIdpUsername||(null==(i=g.form)?void 0:i.loginId)||(null==(r=g.form)?void 0:r.email)||(g.form||(g.form={}),g.form.loginId=e.samlIdpUsername,g.form.email=e.samlIdpUsername),n=this.formConfig,o=this.loggerWrapper,ey(m,"totp-link",null==(s=null==g?void 0:g.totp)?void 0:s.provisionUrl),ey(m,"notp-link",null==(l=null==g?void 0:g.notp)?void 0:l.redirectUrl),a=m,d=g,a.querySelectorAll("descope-text,descope-link,descope-enriched-text,descope-code-snippet").forEach(e=>{let t=(0,ep.$Z)(e.localName);e.textContent=ew(e.textContent,d,t);let i=e.getAttribute("href");i&&e.setAttribute("href",ew(i,d))}),((e,t,i)=>{if(!t)return;
5let{componentsDynamicAttrs:r}=t,n=(0,ec.Tt)(t,["componentsDynamicAttrs"]),o=Object.keys(n).reduce((e,t)=>(e[`[name=${t}]`]=n[t],e),{});r&&Object.keys(r).forEach(e=>{let t=r[e];if(t){let{attributes:i}=t;i&&Object.keys(i).length&&(o[e]=i)}}),Object.keys(o).forEach(t=>{e.querySelectorAll(t).forEach(e=>{let r=o[t];Object.keys(r).forEach(t=>{let n=r[t];if("string"!=typeof n)try{n=JSON.stringify(n)}catch(e){i.error(`Could not stringify value "${n}" for "${t}"`,e.message),n=""}e.setAttribute(t,n)})})})})(m,null==g?void 0:g.componentsConfig,o),m.querySelectorAll(`[${eh.MR}]`).forEach(e=>{Array.from(e.attributes).forEach(e=>{e.value=ew(e.value,g)})}),Object.entries(n).forEach(([e,t])=>{m.querySelectorAll(`[name="${e}"]`).forEach(e=>{Object.entries(t).forEach(([t,i])=>{em.includes(t)&&e.setAttribute(t,i)})})}),((e,t={},i)=>{Object.entries(t).forEach(([t,r])=>{e.querySelectorAll(`[id="${CSS.escape(t)}"]`).forEach(e=>{switch(r){case"disable":e.setAttribute("disabled","true");break;case"hide":e.classList.add("hidden");break;default:null==i||i.error(`Unknown component state "${r}" for component with id "${t}"`,'Valid states are "disable" and "hide"')}})})})(m,null==g?void 0:g.componentsState,o);let{geo:b}=yield this.getExecutionContext();Array.from(m.querySelectorAll('[default-code="autoDetect"]')).forEach(e=>{e.setAttribute("default-code",b)});let w=()=>(0,ec.sH)(this,void 0,void 0,function*(){var i,r,n,o;yield v;let s=this.contentRootElement;eS(s,"descope-totp-image",null==(i=null==g?void 0:g.totp)?void 0:i.image),eS(s,"descope-notp-image",null==(r=null==g?void 0:g.notp)?void 0:r.image),n=g.cssVars,o=this.loggerWrapper,n&&Object.keys(n).forEach(e=>{if(!m.querySelector(e))return void o.debug(`Skipping css vars for component "${e}"`,`Got css vars for component ${e} but Could not find it on next page`);let t=customElements.get(e);t?Object.keys(n[e]).forEach(i=>{var r;let l=n[e],a=null==(r=null==t?void 0:t.cssVarList)?void 0:r[i];if(!a)return void o.info(`Could not find css variable name for ${i} in ${e}`,"Check if the css variable is defined in the component");let d=l[i];s.style.setProperty(a,d)}):o.debug(`Could not find component class for ${e}`,"Check if the component is registered")}),s.replaceChildren(m);let l=!t.htmlFilename;setTimeout(()=>{(0,ec.gn)(this,E,"m",ei).call(this),this.validateOnBlur&&(0,ep.X4)(s),ev(s,null==g?void 0:g.inputs),ev(s,null==g?void 0:g.form),(0,ec.gn)(this,E,"m",X).call(this,{isFirstScreen:l,isCustomScreen:!1,stepName:e.stepName}),(0,ep._A)(s,this.autoFocus,l)}),(0,ec.gn)(this,E,"m",el).call(this,p),s.querySelector(`[${eh.Ho}="polling"]`)&&p(eh.aV.polling,{})});h?(0,ec.gn)(this,E,"m",V).call(this,w):w()})}getInputs(){return Array.from(this.shadowRoot.querySelectorAll(`*:not(slot)[name]:not([${eh.XW}])`))}shouldUsePopupPostMessage(){if(!this.popupOrigin)return!1;try{new URL(this.popupOrigin)}catch(e){return!1}return!0}}O=new WeakMap,x=new WeakMap,j=new WeakMap,R=new WeakMap,H=new WeakMap,G=new WeakMap,_=new WeakMap,F=new WeakMap,D=new WeakMap,K=new WeakMap,B=new WeakMap,Y=new WeakMap,en=new WeakMap,E=new WeakSet,W=function(){document.hidden||setTimeout(()=>{this.flowState.update({deferredRedirect:!1,deferredPolling:!1})},300)},P=function(e,t,i){return(0,ec.sH)(this,void 0,void 0,function*(){var r;return(null==(r=this.nativeOptions)?void 0:r.bridgeVersion)>=2&&new Promise(r=>{this.nativeCallbacks.screenNext=i,this.nativeCallbacks.screenResolve=r,(0,ec.gn)(this,E,"m",L).call(this,"beforeScreen",{screen:e,context:t})})})},T=function(e){var t;(null==(t=this.nativeOptions)?void 0:t.bridgeVersion)>=2&&(0,ec.gn)(this,E,"m",L).call(this,"afterScreen",{screen:e})},L=function(e,t){(0,ec.gn)(this,E,"m",ea).call(this,"bridge",{type:e,payload:t})},$=function({errorText:e,errorType:t}){let i=()=>{var i;let r=e;try{r=(null==(i=this.errorTransformer)?void 0:i.call(this,{text:e,type:t}))||e}catch(e){this.loggerWrapper.error("Error transforming error message",e.message)}((e,t,i="")=>{e.querySelectorAll(`[${eh.Ho}="${t}"]`).forEach(e=>{e.textContent=i,e.classList[i?"remove":"add"]("hide")})})(this.contentRootElement,"error-message",r)};this.addEventListener("screen-updated",i,{once:!0}),i()},U=function(){var e,t,i;null==(e=this.stepState)||e.subscribe(this.onStepChange.bind(this),e=>{var t=e.screenState,i=(0,ec.Tt)(void 0===t?{}:t,["errorText","errorType"]);return Object.assign(Object.assign({}
5,(0,ec.Tt)(e,["screenState"])),{screenState:i})}),null==(t=this.stepState)||t.subscribe((0,ec.gn)(this,E,"m",$).bind(this),e=>{var t,i;return{errorText:null==(t=null==e?void 0:e.screenState)?void 0:t.errorText,errorType:null==(i=null==e?void 0:e.screenState)?void 0:i.errorType}},{forceUpdate:!0}),null==(i=this.stepState)||i.subscribe((0,ec.gn)(this,E,"m",N).bind(this),e=>{var t,i;return{errorText:null==(t=null==e?void 0:e.screenState)?void 0:t.errorText,errorType:null==(i=null==e?void 0:e.screenState)?void 0:i.errorType}},{forceUpdate:!0})},N=function({errorText:e,errorType:t}){(t||e)&&(this.contentRootElement.querySelectorAll('descope-passcode[data-auto-submit="true"]').forEach(e=>{e.shadowRoot.querySelectorAll("descope-text-field[data-id]").forEach(e=>{e.value=""})}),(0,ep._A)(this.contentRootElement,this.autoFocus,!1))},M=function(){return(0,ec.sH)(this,void 0,void 0,function*(){this.loggerWrapper.debug("Trying to restart the flow");let e=yield this.getComponentsVersion();this.reset(),e===(yield this.getComponentsVersion())?(this.loggerWrapper.debug("Components version was not changed, restarting flow"),this.flowState.update({stepId:null,executionId:null})):this.loggerWrapper.error("Components version mismatch, please reload the page")})},q=function(e){return(0,ec.sH)(this,void 0,void 0,function*(){var t;let i=Object.assign(Object.assign({},this.stepState.current),e),{next:r,stepName:n}=i,o=(0,ec.Tt)(i,["next","stepName"]),s=(0,ep.it)(o),l=yield(0,ec.gn)(this,E,"m",P).call(this,n,s,r);l||(l=!!(yield null==(t=this.onScreenUpdate)?void 0:t.call(this,n,s,r,this)));let a=!this.stepState.current.htmlFilename;if((0,ec.gn)(this,G,"f").call(this,l),r&&(r.isCustomScreen=l),(0,ec.gn)(this,H,"f")!==l){let[e,t]=["flow","custom"].sort(()=>l?-1:1);this.loggerWrapper.debug(`Switching from ${t} screen to ${e} screen`),(0,ec.GG)(this,H,l,"f"),l?this.stepState.unsubscribeAll():(0,ec.gn)(this,E,"m",U).call(this)}l?(this.loggerWrapper.debug("Showing a custom screen"),(0,ec.gn)(this,E,"m",X).call(this,{isFirstScreen:a,isCustomScreen:l,stepName:e.stepName}),this.disableKeyPressHandler()):this.handleKeyPress(),this.stepState.forceUpdate=l})},V=function(e){this.contentRootElement.addEventListener("transitionend",()=>{this.loggerWrapper.debug("page switch transition end"),this.contentRootElement.classList.remove("fade-out"),e()},{once:!0}),this.loggerWrapper.debug("page switch transition start"),this.contentRootElement.classList.add("fade-out")},z=function(e){let t=e.getAttribute("name");if(!["email"].includes(t)){let i=`user-${t}`;e.setAttribute("name",i),e.addEventListener("input",()=>{e.setAttribute("name",e.value?t:i)})}},J=function(e,t){return(0,ec.sH)(this,void 0,void 0,function*(){var i;null==(i=(0,ec.gn)(this,x,"f"))||i.abort();let r=e.querySelector('*[autocomplete="webauthn"]');if(r&&(yield(0,eC.M)())){let{options:e,transactionId:i}=(yield(0,ec.gn)(this,B,"f").call(this))||{};e&&i&&((0,ec.gn)(this,E,"m",z).call(this,r),(0,ec.GG)(this,x,new AbortController,"f"),this.sdk.webauthn.helpers.conditional(e,(0,ec.gn)(this,x,"f")).then(e=>(0,ec.sH)(this,void 0,void 0,function*(){t(r.id,{transactionId:i,response:e})})).catch(e=>{"AbortError"!==e.name&&this.loggerWrapper.error("Conditional login failed",e.message)}))}})},X=function({isFirstScreen:e,isCustomScreen:t,stepName:i}){e&&(0,ec.gn)(this,E,"m",ea).call(this,"ready",{}),t||(0,ec.gn)(this,E,"m",T).call(this,i),(0,ec.gn)(this,E,"m",ea).call(this,"page-updated",{screenName:i}),(0,ec.gn)(this,E,"m",ea).call(this,"screen-updated",{screenName:i})},Z=function(){let e=!0;return Array.from(this.shadowRoot.querySelectorAll("*[name]")).reverse().forEach(t=>{var i,r;"slot"===t.localName||t.classList.contains("hidden")||(null==(i=t.reportValidity)||i.call(t),e&&(e=null==(r=t.checkValidity)?void 0:r.call(t)))}),e},Q=function(){return(0,ec.sH)(this,void 0,void 0,function*(){let e=this.getInputs();return(yield Promise.all(e.map(e=>(0,ec.sH)(this,void 0,void 0,function*(){return{name:e.getAttribute("name"),value:e.value}})))).reduce((e,t)=>Object.assign(Object.assign({},e),{[t.name]:t.value}),{})})},ee=function(e){let t=Array.from(this.contentRootElement.querySelectorAll(':not([disabled]), [disabled="false"]')).filter(t=>t!==e),i=()=>(0,ec.sH)(this,void 0,void 0,function*(){this.loggerWrapper.debug("Restoring components state"),this.removeEventListener("popupclosed",i),e.removeAttribute("loading"),t.forEach(e
5=>{e.removeAttribute("disabled")});let r=yield this.getFlowConfig(),n=[...r.clientScripts||[],...r.sdkScripts||[]];this.loadSdkScripts(n)}),r=()=>{var e;window.removeEventListener("pageshow",(0,ec.gn)(this,Y,"f")),(0,ec.GG)(this,Y,e=>{e.persisted&&(this.logger.debug("Page was loaded from cache, restoring components state"),i())},"f"),window.addEventListener("pageshow",(0,ec.gn)(this,Y,"f"),{once:!0});let t=null==(e=this.stepState)?void 0:e.subscribe((e,r)=>{e===r&&i(),this.removeEventListener("popupclosed",i),this.stepState.unsubscribe(t)},e=>e.screenId,{forceUpdate:!0})},n=this.nextRequestStatus.subscribe(({isLoading:o})=>{o?(this.addEventListener("popupclosed",i,{once:!0}),e.setAttribute("loading","true"),t.forEach(e=>e.setAttribute("disabled","true"))):(this.nextRequestStatus.unsubscribe(n),r())})},et=function(e={}){var t,i;let r=(0,ep.kN)(e,["externalId","email","phone"]),n=(0,ep.kN)(e,["newPassword","password"]);if(r&&n)try{if(!globalThis.PasswordCredential)return;let e=new globalThis.PasswordCredential({id:r,password:n});null==(i=null==(t=null==navigator?void 0:navigator.credentials)?void 0:t.store)||i.call(t,e)}catch(e){this.loggerWrapper.error("Could not store credentials",e.message)}},ei=function(){(0,ep.BW)(),this.contentRootElement.querySelectorAll('[external-input="true"]').forEach(e=>(0,ec.gn)(this,E,"m",er).call(this,e))},er=function(e){e&&e.querySelectorAll("input").forEach(t=>{let i=t.getAttribute("slot"),r=`input-${e.id}-${i}`,n=document.createElement("slot");n.setAttribute("name",r),n.setAttribute("slot",i),e.appendChild(n),t.setAttribute("slot",r),this.appendChild(t)})},eo=function(e){return(0,ec.sH)(this,void 0,void 0,function*(){if((0,ec.gn)(this,j,"f")){this.loggerWrapper.debug("Waiting for sdk scripts to load");let e=Date.now();yield(0,ec.gn)(this,j,"f"),this.loggerWrapper.debug("Sdk scripts loaded for",(Date.now()-e).toString())}let t=this.loadSdkScriptsModules(),i=e.map(e=>e.id);for(let e of t)if(i.includes(e.id))try{"function"==typeof e.present&&((yield e.present())||this.loggerWrapper.debug(`Sdk script ${e.id} was cancelled`))}catch(t){this.loggerWrapper.error(`Failed to present ${e.id} script module`,t.message)}let r=[];for(let e of t)"function"==typeof e.refresh&&r.push(e.refresh());if(r.length>0)try{yield(0,ep.BK)(eh.Xh,Promise.all(r),null)}catch(e){this.loggerWrapper.error("Failed to refresh script module",e.message)}})},es=function(e){this.contentRootElement.querySelectorAll('descope-passcode[data-auto-submit="true"]').forEach(t=>{t.addEventListener("input",()=>{var i;(null==(i=t.checkValidity)?void 0:i.call(t))&&(0,ec.gn)(this,en,"f").call(this,t,e)})})},el=function(e){this.contentRootElement.querySelectorAll(`descope-button:not([${eh.PD}]), [data-type="button"]:not([${eh.PD}]`).forEach(t=>{t.onclick=()=>{(0,ec.gn)(this,en,"f").call(this,t,e)}}),(0,ec.gn)(this,E,"m",es).call(this,e),this.isDismissScreenErrorOnInput&&this.contentRootElement.querySelectorAll(`*[name]:not([${eh.XW}])`).forEach(e=>{e.addEventListener("input",()=>{this.stepState.update(e=>Object.assign(Object.assign({},e),{screenState:Object.assign(Object.assign({},e.screenState),{errorText:"",errorType:""})}))})})},ea=function(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t}))},ed=function(e,t,i){var r;let[n,o]=(null==(r=window.name)?void 0:r.split("|"))||[],s={data:{code:t,exchangeError:i},action:"code"};if("descope-wc"===n&&o){this.loggerWrapper.debug("Using postMessage fallback to notify opener in origin",o);try{window.opener.postMessage(s,o)}catch(e){this.loggerWrapper.error("Failed to send postMessage fallback (likely COOP isolation)",null==e?void 0:e.message)}}else{this.loggerWrapper.debug("Creating popup channel",e);let t=new BroadcastChannel(e);t.postMessage(s),t.close()}try{window.close()}catch(e){}},customElements.get("descope-wc")?console.log("descope-wc is already defined"):customElements.define("descope-wc",eH)},74951:(e,t,i)=>{i.d(t,{VS:()=>l,cL:()=>n,fz:()=>r,l$:()=>s,pC:()=>o});let r=i(62038).lz&&localStorage.getItem("base.content.url")||"",n="https://static.descope.com/pages",o="v2-beta",s="v2-alpha",l="config.json"},80496:(e,t,i)=>{var r=i(62038);
5let n="base.ui.components.url";r.lz&&localStorage.getItem(n),r.lz&&localStorage.getItem(n)},98028:(e,t,i)=>{i.d(t,{M:()=>o});var r=i(63990),n=i(47584);let o=(0,n.CM)(()=>(0,r.sH)(void 0,void 0,void 0,function*(){var e,t;if(!window.PublicKeyCredential||!PublicKeyCredential.isConditionalMediationAvailable||!PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable)return!1;try{let i=Promise.all([null==(e=window.PublicKeyCredential)?void 0:e.isConditionalMediationAvailable(),null==(t=window.PublicKeyCredential)?void 0:t.isUserVerifyingPlatformAuthenticatorAvailable()]).then(e=>e.every(e=>!!e)),r=(0,n.zp)()>=108;return yield(0,n.BK)(100,i,r)}catch(e){return console.error("Conditional login check failed",e),!1}}))}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.