@descope/user-profile-widget 0.4.25 → 0.4.27

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/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * @descope/user-profile-widget v0.4.25
3
+ * @descope/user-profile-widget v0.4.27
4
4
  */
5
- "use strict";var e=require("tslib"),t=require("@descope/sdk-helpers"),i=require("@descope/sdk-mixins"),s=require("@descope/sdk-component-drivers"),a=require("@reduxjs/toolkit");require("@descope/core-js-sdk");var r=require("@descope/web-js-sdk"),l=require("reselect");require("@descope/web-component");const o=(e={})=>{const i=t.createTemplate("<descope-wc></descope-wc>");return Object.entries(e).forEach((([e,s])=>{i.content.querySelector("descope-wc").setAttribute(t.kebabCase(e),s)})),i};function d(e){return new URLSearchParams(window.location.search).get(e)}const n=e=>(...t)=>i=>{i.addCase(e.pending,((e,i)=>{t.forEach((({onPending:t})=>{null==t||t(e,i)}))})),i.addCase(e.fulfilled,((e,i)=>{t.forEach((({onFulfilled:t})=>{null==t||t(e,i)}))})),i.addCase(e.rejected,((e,i)=>{t.forEach((({onRejected:t})=>{null==t||t(e,i)}))}))},c=a.createAsyncThunk("users/me",((e,{extra:{api:t}})=>t.user.me())),h=n(c)({onFulfilled:(e,t)=>{e.me.data=t.payload}},(v=e=>e.me,{onFulfilled:e=>{v(e).loading=!1},onPending:e=>{v(e).loading=!0,v(e).error=null},onRejected:(e,t)=>{v(e).loading=!1,v(e).error=t.error}}));var v;const u={action:c,reducer:h},_=a.createAsyncThunk("users/logout",((e,{extra:{api:t}})=>t.user.logout())),f={action:_,reducer:n(_)({})},g={me:{loading:!1,error:null,data:{}}},m={me:"/v1/auth/me"},p=()=>e.__awaiter(void 0,void 0,void 0,(function*(){return new Promise((e=>{e({loginIds:["user@company.com"],externalIds:["user@company.com"],userId:"user-1",name:"Test User",email:"user@company.com",roleNames:["Role"],phone:"+1-202-555-010",verifiedEmail:!0,verifiedPhone:!0,userTenants:[],status:"enabled",editable:!0,createdTime:(new Date).getTime(),customAttributes:{},familyName:"",givenName:"",middleName:"",picture:void 0,password:!0,SAML:!1,test:!1,TOTP:!1,webauthn:!0})}))})),w=({httpClient:t,mock:i})=>({me:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(i)return p();const s=yield t.get(m.me);return yield(t=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=yield t.text(),i=JSON.parse(e);if(!t.ok){const e=`${i.errorDescription}${i.errorMessage?`: ${i.errorMessage}`:""}`;throw Error(e||`${t.status} ${t.statusText}`)}t.json=()=>Promise.resolve(i),t.text=()=>Promise.resolve(e)})))(s),s.json()}))}),F=t.createSingletonMixin((s=>{var a,l,o,d;const n=t.compose(i.projectIdMixin,i.observeAttributesMixin,i.loggerMixin,i.baseUrlMixin,i.cookieConfigMixin)(s);return d=class extends n{constructor(){super(...arguments),a.add(this),l.set(this,void 0)}get widgetId(){return this.getAttribute("widget-id")}get mock(){return this.getAttribute("mock")}get api(){return e.__classPrivateFieldGet(this,l,"f")||e.__classPrivateFieldGet(this,a,"m",o).call(this),e.__classPrivateFieldGet(this,l,"f")}init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.init)||void 0===i?void 0:i.call(this),this.observeAttributes(["project-id","base-url"],(()=>{e.__classPrivateFieldGet(this,l,"f")&&e.__classPrivateFieldGet(this,a,"m",o).call(this)}))}))}},l=new WeakMap,a=new WeakSet,o=function(){this.logger.debug("creating an sdk instance"),e.__classPrivateFieldSet(this,l,((t,i,s)=>{const a=r(Object.assign(Object.assign({},t),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":s,"x-descope-widget-version":"0.4.25"}}));return{user:Object.assign(Object.assign({},w({httpClient:a.httpClient,mock:i})),{logout:i?()=>e.__awaiter(void 0,void 0,void 0,(function*(){})):a.logout})}})({projectId:this.projectId,baseUrl:this.baseUrl,refreshCookieName:this.refreshCookieName},"true"===this.mock,this.widgetId),"f")},d})),b=t.createSingletonMixin((e=>{const s=t.compose(i.createStateManagementMixin({name:"widget",initialState:g,reducers:{},extraReducers:e=>{u.reducer(e),f.reducer(e)},asyncActions:{getMe:u.action,logout:f.action}}),i.initLifecycleMixin,i.loggerMixin,F)(e);return class extends s{constructor(...e){super(...e),this.state=g,this.subscribe((e=>{this.logger.debug("State update:",e),this.state=e}))}}})),P="widget-flow",M=t.createSingletonMixin((a=>{var r,l,n;return n=class extends(t.compose(i.initLifecycleMixin,i.modalMixin,b,i.cookieConfigMixin,i.loggerMixin,i.themeMixin)(a)){constructor(){super(...arguments),r.add(this)}init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.init)||void 0===i?void 0:i.call(this);const s=d(P);s&&(!function(e){if(window.history.replaceState&&d(e)){const t=new URL(window.location.href),i=new URLSearchParams(t.search);i.delete(e),t.search=i.toString(),window.history.replaceState({},"",t.toString())}}(P),e.__classPrivateFieldGet(this,r,"m",l).call(this,s))}))}},r=new WeakSet,l=function(e){const t=this.createModal({"data-id":"redirect-flow"});t.setContent(o({projectId:this.projectId,flowId:e,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme}));new s.FlowDriver((()=>{var e;return null===(e=t.ele)||void 0===e?void 0:e.querySelector("descope-wc")}),{logger:this.logger}).onSuccess((()=>{t.close(),this.actions.getMe()})),t.afterClose=()=>{t.remove()},t.open()},n})),G=e=>e.me.data,S=l.createSelector(G,(e=>e.picture)),U=l.createSelector(G,(e=>e.email)),y=l.createSelector(G,(e=>e.verifiedEmail)),C=l.createSelector(G,(e=>e.name)),k=l.createSelector(G,(e=>e.phone)),x=l.createSelector(G,(e=>e.verifiedPhone)),R=l.createSelector(G,(e=>e.webauthn));l.createSelector(G,(e=>e.password));const W=l.createSelector(G,(e=>e.TOTP)),A=l.createSelector(G,(e=>e.customAttributes)),I=t.createSingletonMixin((s=>{const a=t.compose(i.staticResourcesMixin,i.createValidateAttributesMixin({"widget-id":i.createValidateAttributesMixin.missingAttrValidator}))(s);return class extends a{get widgetId(){return this.getAttribute("widget-id")}fetchWidgetPage(t){return e.__awaiter(this,void 0,void 0,(function*(){return(yield this.fetchStaticResource(`user-profile-widget/${this.widgetId}/${t}`,"text")).body}))}}})),j=t.createSingletonMixin((s=>{var a,r,l;return l=class extends(t.compose(i.loggerMixin,i.initLifecycleMixin,i.descopeUiMixin,i.initElementMixin,I,b)(s)){constructor(){super(...arguments),a.add(this)}onWidgetRootReady(){return e.__awaiter(this,void 0,void 0,(function*(){}))}init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.init)||void 0===i?void 0:i.call(this),yield Promise.all([this.actions.getMe(),e.__classPrivateFieldGet(this,a,"m",r).call(this)]),this.onWidgetRootReady()}))}},a=new WeakSet,r=function(){return e.__awaiter(this,void 0,void 0,(function*(){const e=t.createTemplate(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(e),this.contentRootElement.append(e.content.cloneNode(!0))}))},l})),N=t.createSingletonMixin((e=>class extends(t.compose(i.themeMixin,i.observeAttributesMixin)(e)){syncFlowTheme(e){e.theme=this.theme,this.observeAttributes(["theme"],(()=>{e.theme=this.theme}))}})),T=t.createSingletonMixin((a=>{var r,l,d,n,c,h,v,u,_;return _=class extends(t.compose(N,i.themeMixin,b,i.loggerMixin,i.cookieConfigMixin,j,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this),l.set(this,void 0),d.set(this,void 0),v.set(this,t.withMemCache((e=>{this.avatar.image=e}))),u.set(this,t.withMemCache((e=>{this.avatar.displayName=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,r,"m",h).call(this),e.__classPrivateFieldGet(this,r,"m",n).call(this),e.__classPrivateFieldGet(this,v,"f").call(this,S(this.state)),e.__classPrivateFieldGet(this,u,"f").call(this,C(this.state)),this.subscribe(e.__classPrivateFieldGet(this,v,"f").bind(this),S),this.subscribe(e.__classPrivateFieldGet(this,u,"f").bind(this),C)}))}},l=new WeakMap,d=new WeakMap,v=new WeakMap,u=new WeakMap,r=new WeakSet,n=function(){this.avatar.flowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"update-pic"}),"f"),e.__classPrivateFieldSet(this,d,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",c).bind(this),e.__classPrivateFieldGet(this,r,"m",c).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},c=function(){e.__classPrivateFieldGet(this,l,"f").setContent(o({projectId:this.projectId,flowId:this.avatar.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getMe()}))},h=function(){this.avatar=new s.AvatarDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("descope-avatar")}),{logger:this.logger}),this.avatar.onClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()}))},_})),q=t.createSingletonMixin((a=>{var r,l,d,n,c,h,v,u,_,f,g,m,p;return p=class extends(t.compose(N,b,i.loggerMixin,j,i.cookieConfigMixin,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this),l.set(this,void 0),d.set(this,void 0),n.set(this,void 0),c.set(this,void 0),g.set(this,t.withMemCache((e=>{this.emailUserAttr.value=e}))),m.set(this,t.withMemCache((e=>{this.emailUserAttr.badgeLabel=e?"":"Unverified"})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,r,"m",f).call(this),e.__classPrivateFieldGet(this,r,"m",h).call(this),e.__classPrivateFieldGet(this,r,"m",u).call(this),e.__classPrivateFieldGet(this,g,"f").call(this,U(this.state)),e.__classPrivateFieldGet(this,m,"f").call(this,y(this.state)),this.subscribe(e.__classPrivateFieldGet(this,g,"f").bind(this),U),this.subscribe(e.__classPrivateFieldGet(this,m,"f").bind(this),y)}))}},l=new WeakMap,d=new WeakMap,n=new WeakMap,c=new WeakMap,g=new WeakMap,m=new WeakMap,r=new WeakSet,h=function(){this.emailUserAttr.editFlowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"edit-email"}),"f"),e.__classPrivateFieldSet(this,d,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",v).bind(this),e.__classPrivateFieldGet(this,r,"m",v).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},v=function(){e.__classPrivateFieldGet(this,l,"f").setContent(o({projectId:this.projectId,flowId:this.emailUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getMe()}))},u=function(){this.emailUserAttr.deleteFlowId&&(e.__classPrivateFieldSet(this,n,this.createModal({"data-id":"delete-email"}),"f"),e.__classPrivateFieldSet(this,c,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,n,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",_).bind(this),e.__classPrivateFieldGet(this,r,"m",_).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,c,"f")))},_=function(){e.__classPrivateFieldGet(this,n,"f").setContent(o({projectId:this.projectId,flowId:this.emailUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,c,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,n,"f").close(),this.actions.getMe()}))},f=function(){this.emailUserAttr=new s.UserAttributeDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-attribute[data-id="email"]')}),{logger:this.logger}),this.emailUserAttr.onEditClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()})),this.emailUserAttr.onDeleteClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,n,"f"))||void 0===t||t.open()}))},p})),D=t.createSingletonMixin((a=>{var r,l,o;return o=class extends(t.compose(b,i.loggerMixin,j,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this)}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,r,"m",l).call(this)}))}},r=new WeakSet,l=function(){this.logout=new s.ButtonDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-button[data-id="logout"]')}),{logger:this.logger}),this.logout.onClick((()=>e.__awaiter(this,void 0,void 0,(function*(){yield this.actions.logout(),this.dispatchEvent(new CustomEvent("logout"))}))))},o})),E=t.createSingletonMixin((a=>{var r,l,d,n,c,h,v,u,_,f,g,m;return m=class extends(t.compose(N,b,i.loggerMixin,j,i.cookieConfigMixin,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this),l.set(this,void 0),d.set(this,void 0),n.set(this,void 0),c.set(this,void 0),g.set(this,t.withMemCache((e=>{this.nameUserAttr.value=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,r,"m",f).call(this),e.__classPrivateFieldGet(this,r,"m",h).call(this),e.__classPrivateFieldGet(this,r,"m",u).call(this),e.__classPrivateFieldGet(this,g,"f").call(this,C(this.state)),this.subscribe(e.__classPrivateFieldGet(this,g,"f").bind(this),C)}))}},l=new WeakMap,d=new WeakMap,n=new WeakMap,c=new WeakMap,g=new WeakMap,r=new WeakSet,h=function(){this.nameUserAttr.editFlowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"edit-name"}),"f"),e.__classPrivateFieldSet(this,d,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",v).bind(this),e.__classPrivateFieldGet(this,r,"m",v).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},v=function(){e.__classPrivateFieldGet(this,l,"f").setContent(o({projectId:this.projectId,flowId:this.nameUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getMe()}))},u=function(){this.nameUserAttr.deleteFlowId&&(e.__classPrivateFieldSet(this,n,this.createModal({"data-id":"delete-name"}),"f"),e.__classPrivateFieldSet(this,c,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,n,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",_).bind(this),e.__classPrivateFieldGet(this,r,"m",_).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,c,"f")))},_=function(){e.__classPrivateFieldGet(this,n,"f").setContent(o({projectId:this.projectId,flowId:this.nameUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,c,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,n,"f").close(),this.actions.getMe()}))},f=function(){this.nameUserAttr=new s.UserAttributeDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-attribute[data-id="name"]')}),{logger:this.logger}),this.nameUserAttr.onEditClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()})),this.nameUserAttr.onDeleteClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,n,"f"))||void 0===t||t.open()}))},m})),O=t.createSingletonMixin((a=>{var r,l,d,n,c,h,v,u;return u=class extends(t.compose(N,b,i.loggerMixin,j,i.cookieConfigMixin,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this),l.set(this,void 0),d.set(this,void 0),v.set(this,t.withMemCache((e=>{this.passkeyUserAuthMethod.fulfilled=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,r,"m",h).call(this),e.__classPrivateFieldGet(this,r,"m",n).call(this),e.__classPrivateFieldGet(this,v,"f").call(this,R(this.state)),this.subscribe(e.__classPrivateFieldGet(this,v,"f").bind(this),R)}))}},l=new WeakMap,d=new WeakMap,v=new WeakMap,r=new WeakSet,n=function(){this.passkeyUserAuthMethod.flowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"passkey"}),"f"),e.__classPrivateFieldSet(this,d,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",c).bind(this),e.__classPrivateFieldGet(this,r,"m",c).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},c=function(){e.__classPrivateFieldGet(this,l,"f").setContent(o({projectId:this.projectId,flowId:this.passkeyUserAuthMethod.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getMe()}))},h=function(){this.passkeyUserAuthMethod=new s.UserAuthMethodDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-auth-method[data-id="passkey"]')}),{logger:this.logger}),this.passkeyUserAuthMethod.onButtonClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()}))},u})),L=t.createSingletonMixin((a=>{var r,l,d,n,c,h;return h=class extends(t.compose(N,b,i.loggerMixin,j,i.cookieConfigMixin,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this),l.set(this,void 0),d.set(this,void 0)}initPasswordAuthMethod(){this.passwordUserAuthMethod=new s.UserAuthMethodDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-auth-method[data-id="password"]')}),{logger:this.logger}),this.passwordUserAuthMethod.onButtonClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()}))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),this.initPasswordAuthMethod(),e.__classPrivateFieldGet(this,r,"m",n).call(this)}))}},l=new WeakMap,d=new WeakMap,r=new WeakSet,n=function(){this.passwordUserAuthMethod.flowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"password"}),"f"),e.__classPrivateFieldSet(this,d,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",c).bind(this),e.__classPrivateFieldGet(this,r,"m",c).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},c=function(){e.__classPrivateFieldGet(this,l,"f").setContent(o({projectId:this.projectId,flowId:this.passwordUserAuthMethod.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close()}))},h})),$=t.createSingletonMixin((a=>{var r,l,d,n,c,h,v,u,_,f,g,m,p;return p=class extends(t.compose(N,b,i.loggerMixin,j,i.cookieConfigMixin,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this),l.set(this,void 0),d.set(this,void 0),n.set(this,void 0),c.set(this,void 0),g.set(this,t.withMemCache((e=>{this.phoneUserAttr.value=e}))),m.set(this,t.withMemCache((e=>{this.phoneUserAttr.badgeLabel=e?"":"Unverified"})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,r,"m",f).call(this),e.__classPrivateFieldGet(this,r,"m",h).call(this),e.__classPrivateFieldGet(this,r,"m",u).call(this),e.__classPrivateFieldGet(this,g,"f").call(this,k(this.state)),e.__classPrivateFieldGet(this,m,"f").call(this,x(this.state)),this.subscribe(e.__classPrivateFieldGet(this,g,"f").bind(this),k),this.subscribe(e.__classPrivateFieldGet(this,m,"f").bind(this),x)}))}},l=new WeakMap,d=new WeakMap,n=new WeakMap,c=new WeakMap,g=new WeakMap,m=new WeakMap,r=new WeakSet,h=function(){this.phoneUserAttr.editFlowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"edit-phone"}),"f"),e.__classPrivateFieldSet(this,d,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",v).bind(this),e.__classPrivateFieldGet(this,r,"m",v).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},v=function(){e.__classPrivateFieldGet(this,l,"f").setContent(o({projectId:this.projectId,flowId:this.phoneUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getMe()}))},u=function(){this.phoneUserAttr.deleteFlowId&&(e.__classPrivateFieldSet(this,n,this.createModal({"data-id":"delete-phone"}),"f"),e.__classPrivateFieldSet(this,c,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,n,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",_).bind(this),e.__classPrivateFieldGet(this,r,"m",_).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,c,"f")))},_=function(){e.__classPrivateFieldGet(this,n,"f").setContent(o({projectId:this.projectId,flowId:this.phoneUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,c,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,n,"f").close(),this.actions.getMe()}))},f=function(){this.phoneUserAttr=new s.UserAttributeDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-attribute[data-id="phone"]')}),{logger:this.logger}),this.phoneUserAttr.onEditClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()})),this.phoneUserAttr.onDeleteClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,n,"f"))||void 0===t||t.open()}))},p}));var B;!function(e){e.TEXT="text",e.NUMBER="number",e.BOOLEAN="boolean",e.SINGLE_SELECT="singleSelect",e.ARRAY="array",e.DATE="date"}(B||(B={}));const V=t.createSingletonMixin((a=>{var r,l,d,n,c,h,v,u,_,f,g;return l=class extends(t.compose(N,b,i.loggerMixin,j,i.cookieConfigMixin,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this),d.set(this,{}),n.set(this,{}),c.set(this,{}),h.set(this,{}),_.set(this,t.withMemCache((t=>{var i;const a=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelectorAll('descope-user-attribute[data-id^="customAttributes."]');Array.from(a).forEach((i=>{const a=i.getAttribute("data-id").replace("customAttributes.",""),o=i.getAttribute("data-type")||B.TEXT,d=t[a],n=new s.UserAttributeDriver(i,{logger:this.logger});n.value=l.getFormattedValue(o,d),e.__classPrivateFieldGet(this,r,"m",f).call(this,i,a,n),e.__classPrivateFieldGet(this,r,"m",g).call(this,i,a,n)}))})))}static getFormattedValue(e,t){return e===B.DATE&&t?new Date(t).toLocaleString():e===B.BOOLEAN&&void 0!==t?t?"True":"False":(t||"").toString()}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,_,"f").call(this,A(this.state)),this.subscribe(e.__classPrivateFieldGet(this,_,"f").bind(this),A)}))}},d=new WeakMap,n=new WeakMap,c=new WeakMap,h=new WeakMap,_=new WeakMap,r=new WeakSet,v=function(t){var i,s;null===(i=e.__classPrivateFieldGet(this,d,"f")[t])||void 0===i||i.setContent(o({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),null===(s=e.__classPrivateFieldGet(this,n,"f")[t])||void 0===s||s.onSuccess((()=>{var i;null===(i=e.__classPrivateFieldGet(this,d,"f")[t])||void 0===i||i.close(),this.actions.getMe()}))},u=function(t){var i,s;null===(i=e.__classPrivateFieldGet(this,c,"f")[t])||void 0===i||i.setContent(o({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),null===(s=e.__classPrivateFieldGet(this,h,"f")[t])||void 0===s||s.onSuccess((()=>{var i;null===(i=e.__classPrivateFieldGet(this,c,"f")[t])||void 0===i||i.close(),this.actions.getMe()}))},f=function(t,i,a){const l=t.getAttribute("edit-flow-id");l&&(e.__classPrivateFieldGet(this,d,"f")[l]=this.createModal({"data-id":`edit-${i}`}),e.__classPrivateFieldGet(this,n,"f")[l]=new s.FlowDriver((()=>{var t,i;return null===(i=null===(t=e.__classPrivateFieldGet(this,d,"f")[l])||void 0===t?void 0:t.ele)||void 0===i?void 0:i.querySelector("descope-wc")}),{logger:this.logger}),e.__classPrivateFieldGet(this,d,"f")[l].afterClose=e.__classPrivateFieldGet(this,r,"m",v).bind(this,l),a.onEditClick((()=>{var t,i;null===(i=null===(t=e.__classPrivateFieldGet(this,d,"f"))||void 0===t?void 0:t[l])||void 0===i||i.open()})),e.__classPrivateFieldGet(this,r,"m",v).call(this,l),this.syncFlowTheme(e.__classPrivateFieldGet(this,n,"f")[l]))},g=function(t,i,a){const l=t.getAttribute("delete-flow-id");l&&(e.__classPrivateFieldGet(this,c,"f")[l]=this.createModal({"data-id":`delete-${i}`}),e.__classPrivateFieldGet(this,h,"f")[l]=new s.FlowDriver((()=>{var t,i;return null===(i=null===(t=e.__classPrivateFieldGet(this,c,"f")[l])||void 0===t?void 0:t.ele)||void 0===i?void 0:i.querySelector("descope-wc")}),{logger:this.logger}),e.__classPrivateFieldGet(this,c,"f")[l].afterClose=e.__classPrivateFieldGet(this,r,"m",u).bind(this,l),a.onDeleteClick((()=>{var t,i;null===(i=null===(t=e.__classPrivateFieldGet(this,c,"f"))||void 0===t?void 0:t[l])||void 0===i||i.open()})),e.__classPrivateFieldGet(this,r,"m",u).call(this,l),this.syncFlowTheme(e.__classPrivateFieldGet(this,h,"f")[l]))},l})),H=t.createSingletonMixin((a=>{var r,l,d,n,c,h,v,u;return u=class extends(t.compose(N,b,i.loggerMixin,j,i.cookieConfigMixin,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this),l.set(this,void 0),d.set(this,void 0),v.set(this,t.withMemCache((e=>{this.totpUserAuthMethod.fulfilled=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,r,"m",h).call(this),e.__classPrivateFieldGet(this,r,"m",n).call(this),e.__classPrivateFieldGet(this,v,"f").call(this,W(this.state)),this.subscribe(e.__classPrivateFieldGet(this,v,"f").bind(this),W)}))}},l=new WeakMap,d=new WeakMap,v=new WeakMap,r=new WeakSet,n=function(){this.totpUserAuthMethod.flowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"totp"}),"f"),e.__classPrivateFieldSet(this,d,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",c).bind(this),e.__classPrivateFieldGet(this,r,"m",c).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},c=function(){e.__classPrivateFieldGet(this,l,"f").setContent(o({projectId:this.projectId,flowId:this.totpUserAuthMethod.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getMe()}))},h=function(){this.totpUserAuthMethod=new s.UserAuthMethodDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-auth-method[data-id="totp"]')}),{logger:this.logger}),this.totpUserAuthMethod.onButtonClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()}))},u})),X=t.createSingletonMixin((s=>class extends(t.compose(i.debuggerMixin,i.themeMixin,M,V,q,T,E,$,O,L,L,H,D)(s)){init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var e;yield null===(e=t.init)||void 0===e?void 0:e.call(this)}))}})),J=t.compose((t=>class extends(X(t)){init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var e;yield null===(e=t.init)||void 0===e?void 0:e.call(this);(customElements.get("descope-wc")||(yield import("@descope/web-component").then((e=>e.default)))).sdkConfigOverrides={baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":this.getAttribute("widget-id"),"x-descope-widget-version":"0.4.25"}}}))}}))(HTMLElement);customElements.define("descope-user-profile-widget",J),module.exports=J;
5
+ "use strict";var e=require("tslib"),t=require("@descope/sdk-helpers"),i=require("@descope/sdk-mixins"),s=require("@descope/sdk-component-drivers"),a=require("@reduxjs/toolkit");require("@descope/core-js-sdk");var r=require("@descope/web-js-sdk"),l=require("reselect");require("@descope/web-component");const o=(e={})=>{const i=t.createTemplate("<descope-wc></descope-wc>");return Object.entries(e).forEach((([e,s])=>{i.content.querySelector("descope-wc").setAttribute(t.kebabCase(e),s)})),i};function d(e){return new URLSearchParams(window.location.search).get(e)}const n=e=>(...t)=>i=>{i.addCase(e.pending,((e,i)=>{t.forEach((({onPending:t})=>{null==t||t(e,i)}))})),i.addCase(e.fulfilled,((e,i)=>{t.forEach((({onFulfilled:t})=>{null==t||t(e,i)}))})),i.addCase(e.rejected,((e,i)=>{t.forEach((({onRejected:t})=>{null==t||t(e,i)}))}))},c=a.createAsyncThunk("users/me",((e,{extra:{api:t}})=>t.user.me())),h=n(c)({onFulfilled:(e,t)=>{e.me.data=t.payload}},(v=e=>e.me,{onFulfilled:e=>{v(e).loading=!1},onPending:e=>{v(e).loading=!0,v(e).error=null},onRejected:(e,t)=>{v(e).loading=!1,v(e).error=t.error}}));var v;const u={action:c,reducer:h},_=a.createAsyncThunk("users/logout",((e,{extra:{api:t}})=>t.user.logout())),f={action:_,reducer:n(_)({})},g={me:{loading:!1,error:null,data:{}}},m={me:"/v1/auth/me"},p=()=>e.__awaiter(void 0,void 0,void 0,(function*(){return new Promise((e=>{e({loginIds:["user@company.com"],externalIds:["user@company.com"],userId:"user-1",name:"Test User",email:"user@company.com",roleNames:["Role"],phone:"+1-202-555-010",verifiedEmail:!0,verifiedPhone:!0,userTenants:[],status:"enabled",editable:!0,createdTime:(new Date).getTime(),customAttributes:{},familyName:"",givenName:"",middleName:"",picture:void 0,password:!0,SAML:!1,test:!1,TOTP:!1,webauthn:!0})}))})),w=({httpClient:t,mock:i})=>({me:()=>e.__awaiter(void 0,void 0,void 0,(function*(){if(i)return p();const s=yield t.get(m.me);return yield(t=>e.__awaiter(void 0,void 0,void 0,(function*(){const e=yield t.text(),i=JSON.parse(e);if(!t.ok){const e=`${i.errorDescription}${i.errorMessage?`: ${i.errorMessage}`:""}`;throw Error(e||`${t.status} ${t.statusText}`)}t.json=()=>Promise.resolve(i),t.text=()=>Promise.resolve(e)})))(s),s.json()}))}),F=t.createSingletonMixin((s=>{var a,l,o,d;const n=t.compose(i.projectIdMixin,i.observeAttributesMixin,i.loggerMixin,i.baseUrlMixin,i.cookieConfigMixin)(s);return d=class extends n{constructor(){super(...arguments),a.add(this),l.set(this,void 0)}get widgetId(){return this.getAttribute("widget-id")}get mock(){return this.getAttribute("mock")}get api(){return e.__classPrivateFieldGet(this,l,"f")||e.__classPrivateFieldGet(this,a,"m",o).call(this),e.__classPrivateFieldGet(this,l,"f")}init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.init)||void 0===i?void 0:i.call(this),this.observeAttributes(["project-id","base-url"],(()=>{e.__classPrivateFieldGet(this,l,"f")&&e.__classPrivateFieldGet(this,a,"m",o).call(this)}))}))}},l=new WeakMap,a=new WeakSet,o=function(){this.logger.debug("creating an sdk instance"),e.__classPrivateFieldSet(this,l,((t,i,s)=>{const a=r(Object.assign(Object.assign({},t),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":s,"x-descope-widget-version":"0.4.27"}}));return{user:Object.assign(Object.assign({},w({httpClient:a.httpClient,mock:i})),{logout:i?()=>e.__awaiter(void 0,void 0,void 0,(function*(){})):a.logout})}})({projectId:this.projectId,baseUrl:this.baseUrl,refreshCookieName:this.refreshCookieName},"true"===this.mock,this.widgetId),"f")},d})),b=t.createSingletonMixin((e=>{const s=t.compose(i.createStateManagementMixin({name:"widget",initialState:g,reducers:{},extraReducers:e=>{u.reducer(e),f.reducer(e)},asyncActions:{getMe:u.action,logout:f.action}}),i.initLifecycleMixin,i.loggerMixin,F)(e);return class extends s{constructor(...e){super(...e),this.state=g,this.subscribe((e=>{this.logger.debug("State update:",e),this.state=e}))}}})),P="widget-flow",M=t.createSingletonMixin((a=>{var r,l,n;return n=class extends(t.compose(i.initLifecycleMixin,i.modalMixin,b,i.cookieConfigMixin,i.loggerMixin,i.themeMixin)(a)){constructor(){super(...arguments),r.add(this)}init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.init)||void 0===i?void 0:i.call(this);const s=d(P);s&&(!function(e){if(window.history.replaceState&&d(e)){const t=new URL(window.location.href),i=new URLSearchParams(t.search);i.delete(e),t.search=i.toString(),window.history.replaceState({},"",t.toString())}}(P),e.__classPrivateFieldGet(this,r,"m",l).call(this,s))}))}},r=new WeakSet,l=function(e){const t=this.createModal({"data-id":"redirect-flow"});t.setContent(o({projectId:this.projectId,flowId:e,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme}));new s.FlowDriver((()=>{var e;return null===(e=t.ele)||void 0===e?void 0:e.querySelector("descope-wc")}),{logger:this.logger}).onSuccess((()=>{t.close(),this.actions.getMe()})),t.afterClose=()=>{t.remove()},t.open()},n})),G=e=>e.me.data,S=l.createSelector(G,(e=>e.picture)),U=l.createSelector(G,(e=>e.email)),y=l.createSelector(G,(e=>e.verifiedEmail)),C=l.createSelector(G,(e=>e.name)),k=l.createSelector(G,(e=>e.phone)),x=l.createSelector(G,(e=>e.verifiedPhone)),R=l.createSelector(G,(e=>e.webauthn));l.createSelector(G,(e=>e.password));const W=l.createSelector(G,(e=>e.TOTP)),A=l.createSelector(G,(e=>e.customAttributes)),I=t.createSingletonMixin((s=>{const a=t.compose(i.staticResourcesMixin,i.createValidateAttributesMixin({"widget-id":i.createValidateAttributesMixin.missingAttrValidator}))(s);return class extends a{get widgetId(){return this.getAttribute("widget-id")}fetchWidgetPage(t){return e.__awaiter(this,void 0,void 0,(function*(){return(yield this.fetchStaticResource(`user-profile-widget/${this.widgetId}/${t}`,"text")).body}))}}})),j=t.createSingletonMixin((s=>{var a,r,l;return l=class extends(t.compose(i.loggerMixin,i.initLifecycleMixin,i.descopeUiMixin,i.initElementMixin,I,b)(s)){constructor(){super(...arguments),a.add(this)}onWidgetRootReady(){return e.__awaiter(this,void 0,void 0,(function*(){}))}init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.init)||void 0===i?void 0:i.call(this),yield Promise.all([this.actions.getMe(),e.__classPrivateFieldGet(this,a,"m",r).call(this)]),this.onWidgetRootReady()}))}},a=new WeakSet,r=function(){return e.__awaiter(this,void 0,void 0,(function*(){const e=t.createTemplate(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(e),this.contentRootElement.append(e.content.cloneNode(!0))}))},l})),N=t.createSingletonMixin((e=>class extends(t.compose(i.themeMixin,i.observeAttributesMixin)(e)){syncFlowTheme(e){e.theme=this.theme,this.observeAttributes(["theme"],(()=>{e.theme=this.theme}))}})),T=t.createSingletonMixin((a=>{var r,l,d,n,c,h,v,u,_;return _=class extends(t.compose(N,i.themeMixin,b,i.loggerMixin,i.cookieConfigMixin,j,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this),l.set(this,void 0),d.set(this,void 0),v.set(this,t.withMemCache((e=>{this.avatar.image=e}))),u.set(this,t.withMemCache((e=>{this.avatar.displayName=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,r,"m",h).call(this),e.__classPrivateFieldGet(this,r,"m",n).call(this),e.__classPrivateFieldGet(this,v,"f").call(this,S(this.state)),e.__classPrivateFieldGet(this,u,"f").call(this,C(this.state)),this.subscribe(e.__classPrivateFieldGet(this,v,"f").bind(this),S),this.subscribe(e.__classPrivateFieldGet(this,u,"f").bind(this),C)}))}},l=new WeakMap,d=new WeakMap,v=new WeakMap,u=new WeakMap,r=new WeakSet,n=function(){this.avatar.flowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"update-pic"}),"f"),e.__classPrivateFieldSet(this,d,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",c).bind(this),e.__classPrivateFieldGet(this,r,"m",c).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},c=function(){e.__classPrivateFieldGet(this,l,"f").setContent(o({projectId:this.projectId,flowId:this.avatar.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getMe()}))},h=function(){this.avatar=new s.AvatarDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("descope-avatar")}),{logger:this.logger}),this.avatar.onClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()}))},_})),q=t.createSingletonMixin((a=>{var r,l,d,n,c,h,v,u,_,f,g,m,p;return p=class extends(t.compose(N,b,i.loggerMixin,j,i.cookieConfigMixin,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this),l.set(this,void 0),d.set(this,void 0),n.set(this,void 0),c.set(this,void 0),g.set(this,t.withMemCache((e=>{this.emailUserAttr.value=e}))),m.set(this,t.withMemCache((e=>{this.emailUserAttr.badgeLabel=e?"":"Unverified"})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,r,"m",f).call(this),e.__classPrivateFieldGet(this,r,"m",h).call(this),e.__classPrivateFieldGet(this,r,"m",u).call(this),e.__classPrivateFieldGet(this,g,"f").call(this,U(this.state)),e.__classPrivateFieldGet(this,m,"f").call(this,y(this.state)),this.subscribe(e.__classPrivateFieldGet(this,g,"f").bind(this),U),this.subscribe(e.__classPrivateFieldGet(this,m,"f").bind(this),y)}))}},l=new WeakMap,d=new WeakMap,n=new WeakMap,c=new WeakMap,g=new WeakMap,m=new WeakMap,r=new WeakSet,h=function(){this.emailUserAttr.editFlowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"edit-email"}),"f"),e.__classPrivateFieldSet(this,d,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",v).bind(this),e.__classPrivateFieldGet(this,r,"m",v).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},v=function(){e.__classPrivateFieldGet(this,l,"f").setContent(o({projectId:this.projectId,flowId:this.emailUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getMe()}))},u=function(){this.emailUserAttr.deleteFlowId&&(e.__classPrivateFieldSet(this,n,this.createModal({"data-id":"delete-email"}),"f"),e.__classPrivateFieldSet(this,c,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,n,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",_).bind(this),e.__classPrivateFieldGet(this,r,"m",_).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,c,"f")))},_=function(){e.__classPrivateFieldGet(this,n,"f").setContent(o({projectId:this.projectId,flowId:this.emailUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,c,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,n,"f").close(),this.actions.getMe()}))},f=function(){this.emailUserAttr=new s.UserAttributeDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-attribute[data-id="email"]')}),{logger:this.logger}),this.emailUserAttr.onEditClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()})),this.emailUserAttr.onDeleteClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,n,"f"))||void 0===t||t.open()}))},p})),D=t.createSingletonMixin((a=>{var r,l,o;return o=class extends(t.compose(b,i.loggerMixin,j,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this)}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,r,"m",l).call(this)}))}},r=new WeakSet,l=function(){this.logout=new s.ButtonDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-button[data-id="logout"]')}),{logger:this.logger}),this.logout.onClick((()=>e.__awaiter(this,void 0,void 0,(function*(){yield this.actions.logout(),this.dispatchEvent(new CustomEvent("logout"))}))))},o})),E=t.createSingletonMixin((a=>{var r,l,d,n,c,h,v,u,_,f,g,m;return m=class extends(t.compose(N,b,i.loggerMixin,j,i.cookieConfigMixin,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this),l.set(this,void 0),d.set(this,void 0),n.set(this,void 0),c.set(this,void 0),g.set(this,t.withMemCache((e=>{this.nameUserAttr.value=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,r,"m",f).call(this),e.__classPrivateFieldGet(this,r,"m",h).call(this),e.__classPrivateFieldGet(this,r,"m",u).call(this),e.__classPrivateFieldGet(this,g,"f").call(this,C(this.state)),this.subscribe(e.__classPrivateFieldGet(this,g,"f").bind(this),C)}))}},l=new WeakMap,d=new WeakMap,n=new WeakMap,c=new WeakMap,g=new WeakMap,r=new WeakSet,h=function(){this.nameUserAttr.editFlowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"edit-name"}),"f"),e.__classPrivateFieldSet(this,d,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",v).bind(this),e.__classPrivateFieldGet(this,r,"m",v).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},v=function(){e.__classPrivateFieldGet(this,l,"f").setContent(o({projectId:this.projectId,flowId:this.nameUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getMe()}))},u=function(){this.nameUserAttr.deleteFlowId&&(e.__classPrivateFieldSet(this,n,this.createModal({"data-id":"delete-name"}),"f"),e.__classPrivateFieldSet(this,c,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,n,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",_).bind(this),e.__classPrivateFieldGet(this,r,"m",_).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,c,"f")))},_=function(){e.__classPrivateFieldGet(this,n,"f").setContent(o({projectId:this.projectId,flowId:this.nameUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,c,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,n,"f").close(),this.actions.getMe()}))},f=function(){this.nameUserAttr=new s.UserAttributeDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-attribute[data-id="name"]')}),{logger:this.logger}),this.nameUserAttr.onEditClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()})),this.nameUserAttr.onDeleteClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,n,"f"))||void 0===t||t.open()}))},m})),O=t.createSingletonMixin((a=>{var r,l,d,n,c,h,v,u;return u=class extends(t.compose(N,b,i.loggerMixin,j,i.cookieConfigMixin,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this),l.set(this,void 0),d.set(this,void 0),v.set(this,t.withMemCache((e=>{this.passkeyUserAuthMethod.fulfilled=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,r,"m",h).call(this),e.__classPrivateFieldGet(this,r,"m",n).call(this),e.__classPrivateFieldGet(this,v,"f").call(this,R(this.state)),this.subscribe(e.__classPrivateFieldGet(this,v,"f").bind(this),R)}))}},l=new WeakMap,d=new WeakMap,v=new WeakMap,r=new WeakSet,n=function(){this.passkeyUserAuthMethod.flowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"passkey"}),"f"),e.__classPrivateFieldSet(this,d,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",c).bind(this),e.__classPrivateFieldGet(this,r,"m",c).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},c=function(){e.__classPrivateFieldGet(this,l,"f").setContent(o({projectId:this.projectId,flowId:this.passkeyUserAuthMethod.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getMe()}))},h=function(){this.passkeyUserAuthMethod=new s.UserAuthMethodDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-auth-method[data-id="passkey"]')}),{logger:this.logger}),this.passkeyUserAuthMethod.onButtonClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()}))},u})),L=t.createSingletonMixin((a=>{var r,l,d,n,c,h;return h=class extends(t.compose(N,b,i.loggerMixin,j,i.cookieConfigMixin,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this),l.set(this,void 0),d.set(this,void 0)}initPasswordAuthMethod(){this.passwordUserAuthMethod=new s.UserAuthMethodDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-auth-method[data-id="password"]')}),{logger:this.logger}),this.passwordUserAuthMethod.onButtonClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()}))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),this.initPasswordAuthMethod(),e.__classPrivateFieldGet(this,r,"m",n).call(this)}))}},l=new WeakMap,d=new WeakMap,r=new WeakSet,n=function(){this.passwordUserAuthMethod.flowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"password"}),"f"),e.__classPrivateFieldSet(this,d,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",c).bind(this),e.__classPrivateFieldGet(this,r,"m",c).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},c=function(){e.__classPrivateFieldGet(this,l,"f").setContent(o({projectId:this.projectId,flowId:this.passwordUserAuthMethod.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close()}))},h})),$=t.createSingletonMixin((a=>{var r,l,d,n,c,h,v,u,_,f,g,m,p;return p=class extends(t.compose(N,b,i.loggerMixin,j,i.cookieConfigMixin,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this),l.set(this,void 0),d.set(this,void 0),n.set(this,void 0),c.set(this,void 0),g.set(this,t.withMemCache((e=>{this.phoneUserAttr.value=e}))),m.set(this,t.withMemCache((e=>{this.phoneUserAttr.badgeLabel=e?"":"Unverified"})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,r,"m",f).call(this),e.__classPrivateFieldGet(this,r,"m",h).call(this),e.__classPrivateFieldGet(this,r,"m",u).call(this),e.__classPrivateFieldGet(this,g,"f").call(this,k(this.state)),e.__classPrivateFieldGet(this,m,"f").call(this,x(this.state)),this.subscribe(e.__classPrivateFieldGet(this,g,"f").bind(this),k),this.subscribe(e.__classPrivateFieldGet(this,m,"f").bind(this),x)}))}},l=new WeakMap,d=new WeakMap,n=new WeakMap,c=new WeakMap,g=new WeakMap,m=new WeakMap,r=new WeakSet,h=function(){this.phoneUserAttr.editFlowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"edit-phone"}),"f"),e.__classPrivateFieldSet(this,d,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",v).bind(this),e.__classPrivateFieldGet(this,r,"m",v).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},v=function(){e.__classPrivateFieldGet(this,l,"f").setContent(o({projectId:this.projectId,flowId:this.phoneUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getMe()}))},u=function(){this.phoneUserAttr.deleteFlowId&&(e.__classPrivateFieldSet(this,n,this.createModal({"data-id":"delete-phone"}),"f"),e.__classPrivateFieldSet(this,c,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,n,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,n,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",_).bind(this),e.__classPrivateFieldGet(this,r,"m",_).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,c,"f")))},_=function(){e.__classPrivateFieldGet(this,n,"f").setContent(o({projectId:this.projectId,flowId:this.phoneUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,c,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,n,"f").close(),this.actions.getMe()}))},f=function(){this.phoneUserAttr=new s.UserAttributeDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-attribute[data-id="phone"]')}),{logger:this.logger}),this.phoneUserAttr.onEditClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()})),this.phoneUserAttr.onDeleteClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,n,"f"))||void 0===t||t.open()}))},p}));var B;!function(e){e.TEXT="text",e.NUMBER="number",e.BOOLEAN="boolean",e.SINGLE_SELECT="singleSelect",e.ARRAY="array",e.DATE="date"}(B||(B={}));const V=t.createSingletonMixin((a=>{var r,l,d,n,c,h,v,u,_,f,g;return l=class extends(t.compose(N,b,i.loggerMixin,j,i.cookieConfigMixin,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this),d.set(this,{}),n.set(this,{}),c.set(this,{}),h.set(this,{}),_.set(this,t.withMemCache((t=>{var i;const a=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelectorAll('descope-user-attribute[data-id^="customAttributes."]');Array.from(a).forEach((i=>{const a=i.getAttribute("data-id").replace("customAttributes.",""),o=i.getAttribute("data-type")||B.TEXT,d=t[a],n=new s.UserAttributeDriver(i,{logger:this.logger});n.value=l.getFormattedValue(o,d),e.__classPrivateFieldGet(this,r,"m",f).call(this,i,a,n),e.__classPrivateFieldGet(this,r,"m",g).call(this,i,a,n)}))})))}static getFormattedValue(e,t){return e===B.DATE&&t?new Date(t).toLocaleString():e===B.BOOLEAN&&void 0!==t?t?"True":"False":(t||"").toString()}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,_,"f").call(this,A(this.state)),this.subscribe(e.__classPrivateFieldGet(this,_,"f").bind(this),A)}))}},d=new WeakMap,n=new WeakMap,c=new WeakMap,h=new WeakMap,_=new WeakMap,r=new WeakSet,v=function(t){var i,s;null===(i=e.__classPrivateFieldGet(this,d,"f")[t])||void 0===i||i.setContent(o({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),null===(s=e.__classPrivateFieldGet(this,n,"f")[t])||void 0===s||s.onSuccess((()=>{var i;null===(i=e.__classPrivateFieldGet(this,d,"f")[t])||void 0===i||i.close(),this.actions.getMe()}))},u=function(t){var i,s;null===(i=e.__classPrivateFieldGet(this,c,"f")[t])||void 0===i||i.setContent(o({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),null===(s=e.__classPrivateFieldGet(this,h,"f")[t])||void 0===s||s.onSuccess((()=>{var i;null===(i=e.__classPrivateFieldGet(this,c,"f")[t])||void 0===i||i.close(),this.actions.getMe()}))},f=function(t,i,a){const l=t.getAttribute("edit-flow-id");l&&(e.__classPrivateFieldGet(this,d,"f")[l]=this.createModal({"data-id":`edit-${i}`}),e.__classPrivateFieldGet(this,n,"f")[l]=new s.FlowDriver((()=>{var t,i;return null===(i=null===(t=e.__classPrivateFieldGet(this,d,"f")[l])||void 0===t?void 0:t.ele)||void 0===i?void 0:i.querySelector("descope-wc")}),{logger:this.logger}),e.__classPrivateFieldGet(this,d,"f")[l].afterClose=e.__classPrivateFieldGet(this,r,"m",v).bind(this,l),a.onEditClick((()=>{var t,i;null===(i=null===(t=e.__classPrivateFieldGet(this,d,"f"))||void 0===t?void 0:t[l])||void 0===i||i.open()})),e.__classPrivateFieldGet(this,r,"m",v).call(this,l),this.syncFlowTheme(e.__classPrivateFieldGet(this,n,"f")[l]))},g=function(t,i,a){const l=t.getAttribute("delete-flow-id");l&&(e.__classPrivateFieldGet(this,c,"f")[l]=this.createModal({"data-id":`delete-${i}`}),e.__classPrivateFieldGet(this,h,"f")[l]=new s.FlowDriver((()=>{var t,i;return null===(i=null===(t=e.__classPrivateFieldGet(this,c,"f")[l])||void 0===t?void 0:t.ele)||void 0===i?void 0:i.querySelector("descope-wc")}),{logger:this.logger}),e.__classPrivateFieldGet(this,c,"f")[l].afterClose=e.__classPrivateFieldGet(this,r,"m",u).bind(this,l),a.onDeleteClick((()=>{var t,i;null===(i=null===(t=e.__classPrivateFieldGet(this,c,"f"))||void 0===t?void 0:t[l])||void 0===i||i.open()})),e.__classPrivateFieldGet(this,r,"m",u).call(this,l),this.syncFlowTheme(e.__classPrivateFieldGet(this,h,"f")[l]))},l})),H=t.createSingletonMixin((a=>{var r,l,d,n,c,h,v,u;return u=class extends(t.compose(N,b,i.loggerMixin,j,i.cookieConfigMixin,i.modalMixin)(a)){constructor(){super(...arguments),r.add(this),l.set(this,void 0),d.set(this,void 0),v.set(this,t.withMemCache((e=>{this.totpUserAuthMethod.fulfilled=e})))}onWidgetRootReady(){const t=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return e.__awaiter(this,void 0,void 0,(function*(){var i;yield null===(i=t.onWidgetRootReady)||void 0===i?void 0:i.call(this),e.__classPrivateFieldGet(this,r,"m",h).call(this),e.__classPrivateFieldGet(this,r,"m",n).call(this),e.__classPrivateFieldGet(this,v,"f").call(this,W(this.state)),this.subscribe(e.__classPrivateFieldGet(this,v,"f").bind(this),W)}))}},l=new WeakMap,d=new WeakMap,v=new WeakMap,r=new WeakSet,n=function(){this.totpUserAuthMethod.flowId&&(e.__classPrivateFieldSet(this,l,this.createModal({"data-id":"totp"}),"f"),e.__classPrivateFieldSet(this,d,new s.FlowDriver((()=>{var t;return null===(t=e.__classPrivateFieldGet(this,l,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e.__classPrivateFieldGet(this,l,"f").afterClose=e.__classPrivateFieldGet(this,r,"m",c).bind(this),e.__classPrivateFieldGet(this,r,"m",c).call(this),this.syncFlowTheme(e.__classPrivateFieldGet(this,d,"f")))},c=function(){e.__classPrivateFieldGet(this,l,"f").setContent(o({projectId:this.projectId,flowId:this.totpUserAuthMethod.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e.__classPrivateFieldGet(this,d,"f").onSuccess((()=>{e.__classPrivateFieldGet(this,l,"f").close(),this.actions.getMe()}))},h=function(){this.totpUserAuthMethod=new s.UserAuthMethodDriver((()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('descope-user-auth-method[data-id="totp"]')}),{logger:this.logger}),this.totpUserAuthMethod.onButtonClick((()=>{var t;null===(t=e.__classPrivateFieldGet(this,l,"f"))||void 0===t||t.open()}))},u})),X=t.createSingletonMixin((s=>class extends(t.compose(i.debuggerMixin,i.themeMixin,M,V,q,T,E,$,O,L,L,H,D)(s)){init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var e;yield null===(e=t.init)||void 0===e?void 0:e.call(this)}))}})),J=t.compose((t=>class extends(X(t)){init(){const t=Object.create(null,{init:{get:()=>super.init}});return e.__awaiter(this,void 0,void 0,(function*(){var e;yield null===(e=t.init)||void 0===e?void 0:e.call(this);(customElements.get("descope-wc")||(yield import("@descope/web-component").then((e=>e.default)))).sdkConfigOverrides={baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":this.getAttribute("widget-id"),"x-descope-widget-version":"0.4.27"}}}))}}))(HTMLElement);customElements.define("descope-user-profile-widget",J),module.exports=J;
6
6
  //# sourceMappingURL=index.js.map
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * @descope/user-profile-widget v0.4.25
3
+ * @descope/user-profile-widget v0.4.27
4
4
  */
5
- import{__awaiter as t,__classPrivateFieldGet as e,__classPrivateFieldSet as i}from"tslib";import{createTemplate as s,kebabCase as o,createSingletonMixin as r,compose as a,withMemCache as h}from"@descope/sdk-helpers";import{projectIdMixin as n,observeAttributesMixin as d,loggerMixin as l,baseUrlMixin as c,cookieConfigMixin as u,createStateManagementMixin as f,initLifecycleMixin as v,modalMixin as g,themeMixin as p,staticResourcesMixin as m,createValidateAttributesMixin as w,descopeUiMixin as b,initElementMixin as U,debuggerMixin as y}from"@descope/sdk-mixins";import{FlowDriver as k,AvatarDriver as C,UserAttributeDriver as R,ButtonDriver as S,UserAuthMethodDriver as W}from"@descope/sdk-component-drivers";import{createAsyncThunk as M}from"@reduxjs/toolkit";import"@descope/core-js-sdk";import I from"@descope/web-js-sdk";import{createSelector as A}from"reselect";import"@descope/web-component";const j=(t={})=>{const e=s("<descope-wc></descope-wc>");return Object.entries(t).forEach((([t,i])=>{e.content.querySelector("descope-wc").setAttribute(o(t),i)})),e};function N(t){return new URLSearchParams(window.location.search).get(t)}const x=t=>(...e)=>i=>{i.addCase(t.pending,((t,i)=>{e.forEach((({onPending:e})=>{null==e||e(t,i)}))})),i.addCase(t.fulfilled,((t,i)=>{e.forEach((({onFulfilled:e})=>{null==e||e(t,i)}))})),i.addCase(t.rejected,((t,i)=>{e.forEach((({onRejected:e})=>{null==e||e(t,i)}))}))},T=M("users/me",((t,{extra:{api:e}})=>e.user.me())),F=x(T)({onFulfilled:(t,e)=>{t.me.data=e.payload}},(E=t=>t.me,{onFulfilled:t=>{E(t).loading=!1},onPending:t=>{E(t).loading=!0,E(t).error=null},onRejected:(t,e)=>{E(t).loading=!1,E(t).error=e.error}}));var E;const O={action:T,reducer:F},q=M("users/logout",((t,{extra:{api:e}})=>e.user.logout())),P={action:q,reducer:x(q)({})},L={me:{loading:!1,error:null,data:{}}},D={me:"/v1/auth/me"},$=()=>t(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({loginIds:["user@company.com"],externalIds:["user@company.com"],userId:"user-1",name:"Test User",email:"user@company.com",roleNames:["Role"],phone:"+1-202-555-010",verifiedEmail:!0,verifiedPhone:!0,userTenants:[],status:"enabled",editable:!0,createdTime:(new Date).getTime(),customAttributes:{},familyName:"",givenName:"",middleName:"",picture:void 0,password:!0,SAML:!1,test:!1,TOTP:!1,webauthn:!0})}))})),B=({httpClient:e,mock:i})=>({me:()=>t(void 0,void 0,void 0,(function*(){if(i)return $();const s=yield e.get(D.me);return yield(e=>t(void 0,void 0,void 0,(function*(){const t=yield e.text(),i=JSON.parse(t);if(!e.ok){const t=`${i.errorDescription}${i.errorMessage?`: ${i.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(i),e.text=()=>Promise.resolve(t)})))(s),s.json()}))}),H=r((s=>{var o,r,h,f;const v=a(n,d,l,c,u)(s);return f=class extends v{constructor(){super(...arguments),o.add(this),r.set(this,void 0)}get widgetId(){return this.getAttribute("widget-id")}get mock(){return this.getAttribute("mock")}get api(){return e(this,r,"f")||e(this,o,"m",h).call(this),e(this,r,"f")}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this),this.observeAttributes(["project-id","base-url"],(()=>{e(this,r,"f")&&e(this,o,"m",h).call(this)}))}))}},r=new WeakMap,o=new WeakSet,h=function(){this.logger.debug("creating an sdk instance"),i(this,r,((e,i,s)=>{const o=I(Object.assign(Object.assign({},e),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":s,"x-descope-widget-version":"0.4.25"}}));return{user:Object.assign(Object.assign({},B({httpClient:o.httpClient,mock:i})),{logout:i?()=>t(void 0,void 0,void 0,(function*(){})):o.logout})}})({projectId:this.projectId,baseUrl:this.baseUrl,refreshCookieName:this.refreshCookieName},"true"===this.mock,this.widgetId),"f")},f})),V=r((t=>{const e=a(f({name:"widget",initialState:L,reducers:{},extraReducers:t=>{O.reducer(t),P.reducer(t)},asyncActions:{getMe:O.action,logout:P.action}}),v,l,H)(t);return class extends e{constructor(...t){super(...t),this.state=L,this.subscribe((t=>{this.logger.debug("State update:",t),this.state=t}))}}})),X="widget-flow",G=r((i=>{var s,o,r;return r=class extends(a(v,g,V,u,l,p)(i)){constructor(){super(...arguments),s.add(this)}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this);const r=N(X);r&&(!function(t){if(window.history.replaceState&&N(t)){const e=new URL(window.location.href),i=new URLSearchParams(e.search);i.delete(t),e.search=i.toString(),window.history.replaceState({},"",e.toString())}}(X),e(this,s,"m",o).call(this,r))}))}},s=new WeakSet,o=function(t){const e=this.createModal({"data-id":"redirect-flow"});e.setContent(j({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme}));new k((()=>{var t;return null===(t=e.ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}).onSuccess((()=>{e.close(),this.actions.getMe()})),e.afterClose=()=>{e.remove()},e.open()},r})),J=t=>t.me.data,Y=A(J,(t=>t.picture)),_=A(J,(t=>t.email)),z=A(J,(t=>t.verifiedEmail)),K=A(J,(t=>t.name)),Q=A(J,(t=>t.phone)),Z=A(J,(t=>t.verifiedPhone)),tt=A(J,(t=>t.webauthn));A(J,(t=>t.password));const et=A(J,(t=>t.TOTP)),it=A(J,(t=>t.customAttributes)),st=r((e=>{const i=a(m,w({"widget-id":w.missingAttrValidator}))(e);return class extends i{get widgetId(){return this.getAttribute("widget-id")}fetchWidgetPage(e){return t(this,void 0,void 0,(function*(){return(yield this.fetchStaticResource(`user-profile-widget/${this.widgetId}/${e}`,"text")).body}))}}})),ot=r((i=>{var o,r,h;return h=class extends(a(l,v,b,U,st,V)(i)){constructor(){super(...arguments),o.add(this)}onWidgetRootReady(){return t(this,void 0,void 0,(function*(){}))}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this),yield Promise.all([this.actions.getMe(),e(this,o,"m",r).call(this)]),this.onWidgetRootReady()}))}},o=new WeakSet,r=function(){return t(this,void 0,void 0,(function*(){const t=s(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(t),this.contentRootElement.append(t.content.cloneNode(!0))}))},h})),rt=r((t=>class extends(a(p,d)(t)){syncFlowTheme(t){t.theme=this.theme,this.observeAttributes(["theme"],(()=>{t.theme=this.theme}))}})),at=r((s=>{var o,r,n,d,c,f,v,m,w;return w=class extends(a(rt,p,V,l,u,ot,g)(s)){constructor(){super(...arguments),o.add(this),r.set(this,void 0),n.set(this,void 0),v.set(this,h((t=>{this.avatar.image=t}))),m.set(this,h((t=>{this.avatar.displayName=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,o,"m",f).call(this),e(this,o,"m",d).call(this),e(this,v,"f").call(this,Y(this.state)),e(this,m,"f").call(this,K(this.state)),this.subscribe(e(this,v,"f").bind(this),Y),this.subscribe(e(this,m,"f").bind(this),K)}))}},r=new WeakMap,n=new WeakMap,v=new WeakMap,m=new WeakMap,o=new WeakSet,d=function(){this.avatar.flowId&&(i(this,r,this.createModal({"data-id":"update-pic"}),"f"),i(this,n,new k((()=>{var t;return null===(t=e(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,r,"f").afterClose=e(this,o,"m",c).bind(this),e(this,o,"m",c).call(this),this.syncFlowTheme(e(this,n,"f")))},c=function(){e(this,r,"f").setContent(j({projectId:this.projectId,flowId:this.avatar.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,n,"f").onSuccess((()=>{e(this,r,"f").close(),this.actions.getMe()}))},f=function(){this.avatar=new C((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("descope-avatar")}),{logger:this.logger}),this.avatar.onClick((()=>{var t;null===(t=e(this,r,"f"))||void 0===t||t.open()}))},w})),ht=r((s=>{var o,r,n,d,c,f,v,p,m,w,b,U,y;return y=class extends(a(rt,V,l,ot,u,g)(s)){constructor(){super(...arguments),o.add(this),r.set(this,void 0),n.set(this,void 0),d.set(this,void 0),c.set(this,void 0),b.set(this,h((t=>{this.emailUserAttr.value=t}))),U.set(this,h((t=>{this.emailUserAttr.badgeLabel=t?"":"Unverified"})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,o,"m",w).call(this),e(this,o,"m",f).call(this),e(this,o,"m",p).call(this),e(this,b,"f").call(this,_(this.state)),e(this,U,"f").call(this,z(this.state)),this.subscribe(e(this,b,"f").bind(this),_),this.subscribe(e(this,U,"f").bind(this),z)}))}},r=new WeakMap,n=new WeakMap,d=new WeakMap,c=new WeakMap,b=new WeakMap,U=new WeakMap,o=new WeakSet,f=function(){this.emailUserAttr.editFlowId&&(i(this,r,this.createModal({"data-id":"edit-email"}),"f"),i(this,n,new k((()=>{var t;return null===(t=e(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,r,"f").afterClose=e(this,o,"m",v).bind(this),e(this,o,"m",v).call(this),this.syncFlowTheme(e(this,n,"f")))},v=function(){e(this,r,"f").setContent(j({projectId:this.projectId,flowId:this.emailUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,n,"f").onSuccess((()=>{e(this,r,"f").close(),this.actions.getMe()}))},p=function(){this.emailUserAttr.deleteFlowId&&(i(this,d,this.createModal({"data-id":"delete-email"}),"f"),i(this,c,new k((()=>{var t;return null===(t=e(this,d,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,d,"f").afterClose=e(this,o,"m",m).bind(this),e(this,o,"m",m).call(this),this.syncFlowTheme(e(this,c,"f")))},m=function(){e(this,d,"f").setContent(j({projectId:this.projectId,flowId:this.emailUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,c,"f").onSuccess((()=>{e(this,d,"f").close(),this.actions.getMe()}))},w=function(){this.emailUserAttr=new R((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="email"]')}),{logger:this.logger}),this.emailUserAttr.onEditClick((()=>{var t;null===(t=e(this,r,"f"))||void 0===t||t.open()})),this.emailUserAttr.onDeleteClick((()=>{var t;null===(t=e(this,d,"f"))||void 0===t||t.open()}))},y})),nt=r((i=>{var s,o,r;return r=class extends(a(V,l,ot,g)(i)){constructor(){super(...arguments),s.add(this)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,s,"m",o).call(this)}))}},s=new WeakSet,o=function(){this.logout=new S((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-button[data-id="logout"]')}),{logger:this.logger}),this.logout.onClick((()=>t(this,void 0,void 0,(function*(){yield this.actions.logout(),this.dispatchEvent(new CustomEvent("logout"))}))))},r})),dt=r((s=>{var o,r,n,d,c,f,v,p,m,w,b,U;return U=class extends(a(rt,V,l,ot,u,g)(s)){constructor(){super(...arguments),o.add(this),r.set(this,void 0),n.set(this,void 0),d.set(this,void 0),c.set(this,void 0),b.set(this,h((t=>{this.nameUserAttr.value=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,o,"m",w).call(this),e(this,o,"m",f).call(this),e(this,o,"m",p).call(this),e(this,b,"f").call(this,K(this.state)),this.subscribe(e(this,b,"f").bind(this),K)}))}},r=new WeakMap,n=new WeakMap,d=new WeakMap,c=new WeakMap,b=new WeakMap,o=new WeakSet,f=function(){this.nameUserAttr.editFlowId&&(i(this,r,this.createModal({"data-id":"edit-name"}),"f"),i(this,n,new k((()=>{var t;return null===(t=e(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,r,"f").afterClose=e(this,o,"m",v).bind(this),e(this,o,"m",v).call(this),this.syncFlowTheme(e(this,n,"f")))},v=function(){e(this,r,"f").setContent(j({projectId:this.projectId,flowId:this.nameUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,n,"f").onSuccess((()=>{e(this,r,"f").close(),this.actions.getMe()}))},p=function(){this.nameUserAttr.deleteFlowId&&(i(this,d,this.createModal({"data-id":"delete-name"}),"f"),i(this,c,new k((()=>{var t;return null===(t=e(this,d,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,d,"f").afterClose=e(this,o,"m",m).bind(this),e(this,o,"m",m).call(this),this.syncFlowTheme(e(this,c,"f")))},m=function(){e(this,d,"f").setContent(j({projectId:this.projectId,flowId:this.nameUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,c,"f").onSuccess((()=>{e(this,d,"f").close(),this.actions.getMe()}))},w=function(){this.nameUserAttr=new R((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="name"]')}),{logger:this.logger}),this.nameUserAttr.onEditClick((()=>{var t;null===(t=e(this,r,"f"))||void 0===t||t.open()})),this.nameUserAttr.onDeleteClick((()=>{var t;null===(t=e(this,d,"f"))||void 0===t||t.open()}))},U})),lt=r((s=>{var o,r,n,d,c,f,v,p;return p=class extends(a(rt,V,l,ot,u,g)(s)){constructor(){super(...arguments),o.add(this),r.set(this,void 0),n.set(this,void 0),v.set(this,h((t=>{this.passkeyUserAuthMethod.fulfilled=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,o,"m",f).call(this),e(this,o,"m",d).call(this),e(this,v,"f").call(this,tt(this.state)),this.subscribe(e(this,v,"f").bind(this),tt)}))}},r=new WeakMap,n=new WeakMap,v=new WeakMap,o=new WeakSet,d=function(){this.passkeyUserAuthMethod.flowId&&(i(this,r,this.createModal({"data-id":"passkey"}),"f"),i(this,n,new k((()=>{var t;return null===(t=e(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,r,"f").afterClose=e(this,o,"m",c).bind(this),e(this,o,"m",c).call(this),this.syncFlowTheme(e(this,n,"f")))},c=function(){e(this,r,"f").setContent(j({projectId:this.projectId,flowId:this.passkeyUserAuthMethod.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,n,"f").onSuccess((()=>{e(this,r,"f").close(),this.actions.getMe()}))},f=function(){this.passkeyUserAuthMethod=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="passkey"]')}),{logger:this.logger}),this.passkeyUserAuthMethod.onButtonClick((()=>{var t;null===(t=e(this,r,"f"))||void 0===t||t.open()}))},p})),ct=r((s=>{var o,r,h,n,d,c;return c=class extends(a(rt,V,l,ot,u,g)(s)){constructor(){super(...arguments),o.add(this),r.set(this,void 0),h.set(this,void 0)}initPasswordAuthMethod(){this.passwordUserAuthMethod=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="password"]')}),{logger:this.logger}),this.passwordUserAuthMethod.onButtonClick((()=>{var t;null===(t=e(this,r,"f"))||void 0===t||t.open()}))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),this.initPasswordAuthMethod(),e(this,o,"m",n).call(this)}))}},r=new WeakMap,h=new WeakMap,o=new WeakSet,n=function(){this.passwordUserAuthMethod.flowId&&(i(this,r,this.createModal({"data-id":"password"}),"f"),i(this,h,new k((()=>{var t;return null===(t=e(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,r,"f").afterClose=e(this,o,"m",d).bind(this),e(this,o,"m",d).call(this),this.syncFlowTheme(e(this,h,"f")))},d=function(){e(this,r,"f").setContent(j({projectId:this.projectId,flowId:this.passwordUserAuthMethod.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,h,"f").onSuccess((()=>{e(this,r,"f").close()}))},c})),ut=r((s=>{var o,r,n,d,c,f,v,p,m,w,b,U,y;return y=class extends(a(rt,V,l,ot,u,g)(s)){constructor(){super(...arguments),o.add(this),r.set(this,void 0),n.set(this,void 0),d.set(this,void 0),c.set(this,void 0),b.set(this,h((t=>{this.phoneUserAttr.value=t}))),U.set(this,h((t=>{this.phoneUserAttr.badgeLabel=t?"":"Unverified"})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,o,"m",w).call(this),e(this,o,"m",f).call(this),e(this,o,"m",p).call(this),e(this,b,"f").call(this,Q(this.state)),e(this,U,"f").call(this,Z(this.state)),this.subscribe(e(this,b,"f").bind(this),Q),this.subscribe(e(this,U,"f").bind(this),Z)}))}},r=new WeakMap,n=new WeakMap,d=new WeakMap,c=new WeakMap,b=new WeakMap,U=new WeakMap,o=new WeakSet,f=function(){this.phoneUserAttr.editFlowId&&(i(this,r,this.createModal({"data-id":"edit-phone"}),"f"),i(this,n,new k((()=>{var t;return null===(t=e(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,r,"f").afterClose=e(this,o,"m",v).bind(this),e(this,o,"m",v).call(this),this.syncFlowTheme(e(this,n,"f")))},v=function(){e(this,r,"f").setContent(j({projectId:this.projectId,flowId:this.phoneUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,n,"f").onSuccess((()=>{e(this,r,"f").close(),this.actions.getMe()}))},p=function(){this.phoneUserAttr.deleteFlowId&&(i(this,d,this.createModal({"data-id":"delete-phone"}),"f"),i(this,c,new k((()=>{var t;return null===(t=e(this,d,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,d,"f").afterClose=e(this,o,"m",m).bind(this),e(this,o,"m",m).call(this),this.syncFlowTheme(e(this,c,"f")))},m=function(){e(this,d,"f").setContent(j({projectId:this.projectId,flowId:this.phoneUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,c,"f").onSuccess((()=>{e(this,d,"f").close(),this.actions.getMe()}))},w=function(){this.phoneUserAttr=new R((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="phone"]')}),{logger:this.logger}),this.phoneUserAttr.onEditClick((()=>{var t;null===(t=e(this,r,"f"))||void 0===t||t.open()})),this.phoneUserAttr.onDeleteClick((()=>{var t;null===(t=e(this,d,"f"))||void 0===t||t.open()}))},y}));var ft;!function(t){t.TEXT="text",t.NUMBER="number",t.BOOLEAN="boolean",t.SINGLE_SELECT="singleSelect",t.ARRAY="array",t.DATE="date"}(ft||(ft={}));const vt=r((i=>{var s,o,r,n,d,c,f,v,p,m,w;return o=class extends(a(rt,V,l,ot,u,g)(i)){constructor(){super(...arguments),s.add(this),r.set(this,{}),n.set(this,{}),d.set(this,{}),c.set(this,{}),p.set(this,h((t=>{var i;const r=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelectorAll('descope-user-attribute[data-id^="customAttributes."]');Array.from(r).forEach((i=>{const r=i.getAttribute("data-id").replace("customAttributes.",""),a=i.getAttribute("data-type")||ft.TEXT,h=t[r],n=new R(i,{logger:this.logger});n.value=o.getFormattedValue(a,h),e(this,s,"m",m).call(this,i,r,n),e(this,s,"m",w).call(this,i,r,n)}))})))}static getFormattedValue(t,e){return t===ft.DATE&&e?new Date(e).toLocaleString():t===ft.BOOLEAN&&void 0!==e?e?"True":"False":(e||"").toString()}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,p,"f").call(this,it(this.state)),this.subscribe(e(this,p,"f").bind(this),it)}))}},r=new WeakMap,n=new WeakMap,d=new WeakMap,c=new WeakMap,p=new WeakMap,s=new WeakSet,f=function(t){var i,s;null===(i=e(this,r,"f")[t])||void 0===i||i.setContent(j({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),null===(s=e(this,n,"f")[t])||void 0===s||s.onSuccess((()=>{var i;null===(i=e(this,r,"f")[t])||void 0===i||i.close(),this.actions.getMe()}))},v=function(t){var i,s;null===(i=e(this,d,"f")[t])||void 0===i||i.setContent(j({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),null===(s=e(this,c,"f")[t])||void 0===s||s.onSuccess((()=>{var i;null===(i=e(this,d,"f")[t])||void 0===i||i.close(),this.actions.getMe()}))},m=function(t,i,o){const a=t.getAttribute("edit-flow-id");a&&(e(this,r,"f")[a]=this.createModal({"data-id":`edit-${i}`}),e(this,n,"f")[a]=new k((()=>{var t,i;return null===(i=null===(t=e(this,r,"f")[a])||void 0===t?void 0:t.ele)||void 0===i?void 0:i.querySelector("descope-wc")}),{logger:this.logger}),e(this,r,"f")[a].afterClose=e(this,s,"m",f).bind(this,a),o.onEditClick((()=>{var t,i;null===(i=null===(t=e(this,r,"f"))||void 0===t?void 0:t[a])||void 0===i||i.open()})),e(this,s,"m",f).call(this,a),this.syncFlowTheme(e(this,n,"f")[a]))},w=function(t,i,o){const r=t.getAttribute("delete-flow-id");r&&(e(this,d,"f")[r]=this.createModal({"data-id":`delete-${i}`}),e(this,c,"f")[r]=new k((()=>{var t,i;return null===(i=null===(t=e(this,d,"f")[r])||void 0===t?void 0:t.ele)||void 0===i?void 0:i.querySelector("descope-wc")}),{logger:this.logger}),e(this,d,"f")[r].afterClose=e(this,s,"m",v).bind(this,r),o.onDeleteClick((()=>{var t,i;null===(i=null===(t=e(this,d,"f"))||void 0===t?void 0:t[r])||void 0===i||i.open()})),e(this,s,"m",v).call(this,r),this.syncFlowTheme(e(this,c,"f")[r]))},o})),gt=r((s=>{var o,r,n,d,c,f,v,p;return p=class extends(a(rt,V,l,ot,u,g)(s)){constructor(){super(...arguments),o.add(this),r.set(this,void 0),n.set(this,void 0),v.set(this,h((t=>{this.totpUserAuthMethod.fulfilled=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,o,"m",f).call(this),e(this,o,"m",d).call(this),e(this,v,"f").call(this,et(this.state)),this.subscribe(e(this,v,"f").bind(this),et)}))}},r=new WeakMap,n=new WeakMap,v=new WeakMap,o=new WeakSet,d=function(){this.totpUserAuthMethod.flowId&&(i(this,r,this.createModal({"data-id":"totp"}),"f"),i(this,n,new k((()=>{var t;return null===(t=e(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,r,"f").afterClose=e(this,o,"m",c).bind(this),e(this,o,"m",c).call(this),this.syncFlowTheme(e(this,n,"f")))},c=function(){e(this,r,"f").setContent(j({projectId:this.projectId,flowId:this.totpUserAuthMethod.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,n,"f").onSuccess((()=>{e(this,r,"f").close(),this.actions.getMe()}))},f=function(){this.totpUserAuthMethod=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="totp"]')}),{logger:this.logger}),this.totpUserAuthMethod.onButtonClick((()=>{var t;null===(t=e(this,r,"f"))||void 0===t||t.open()}))},p})),pt=r((e=>class extends(a(y,p,G,vt,ht,at,dt,ut,lt,ct,ct,gt,nt)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),mt=a((e=>class extends(pt(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this);(customElements.get("descope-wc")||(yield import("@descope/web-component").then((t=>t.default)))).sdkConfigOverrides={baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":this.getAttribute("widget-id"),"x-descope-widget-version":"0.4.25"}}}))}}))(HTMLElement);customElements.define("descope-user-profile-widget",mt);export{mt as default};
5
+ import{__awaiter as t,__classPrivateFieldGet as e,__classPrivateFieldSet as i}from"tslib";import{createTemplate as s,kebabCase as o,createSingletonMixin as r,compose as a,withMemCache as h}from"@descope/sdk-helpers";import{projectIdMixin as n,observeAttributesMixin as d,loggerMixin as l,baseUrlMixin as c,cookieConfigMixin as u,createStateManagementMixin as f,initLifecycleMixin as v,modalMixin as g,themeMixin as p,staticResourcesMixin as m,createValidateAttributesMixin as w,descopeUiMixin as b,initElementMixin as U,debuggerMixin as y}from"@descope/sdk-mixins";import{FlowDriver as k,AvatarDriver as C,UserAttributeDriver as R,ButtonDriver as S,UserAuthMethodDriver as W}from"@descope/sdk-component-drivers";import{createAsyncThunk as M}from"@reduxjs/toolkit";import"@descope/core-js-sdk";import I from"@descope/web-js-sdk";import{createSelector as A}from"reselect";import"@descope/web-component";const j=(t={})=>{const e=s("<descope-wc></descope-wc>");return Object.entries(t).forEach((([t,i])=>{e.content.querySelector("descope-wc").setAttribute(o(t),i)})),e};function N(t){return new URLSearchParams(window.location.search).get(t)}const x=t=>(...e)=>i=>{i.addCase(t.pending,((t,i)=>{e.forEach((({onPending:e})=>{null==e||e(t,i)}))})),i.addCase(t.fulfilled,((t,i)=>{e.forEach((({onFulfilled:e})=>{null==e||e(t,i)}))})),i.addCase(t.rejected,((t,i)=>{e.forEach((({onRejected:e})=>{null==e||e(t,i)}))}))},T=M("users/me",((t,{extra:{api:e}})=>e.user.me())),F=x(T)({onFulfilled:(t,e)=>{t.me.data=e.payload}},(E=t=>t.me,{onFulfilled:t=>{E(t).loading=!1},onPending:t=>{E(t).loading=!0,E(t).error=null},onRejected:(t,e)=>{E(t).loading=!1,E(t).error=e.error}}));var E;const O={action:T,reducer:F},q=M("users/logout",((t,{extra:{api:e}})=>e.user.logout())),P={action:q,reducer:x(q)({})},L={me:{loading:!1,error:null,data:{}}},D={me:"/v1/auth/me"},$=()=>t(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({loginIds:["user@company.com"],externalIds:["user@company.com"],userId:"user-1",name:"Test User",email:"user@company.com",roleNames:["Role"],phone:"+1-202-555-010",verifiedEmail:!0,verifiedPhone:!0,userTenants:[],status:"enabled",editable:!0,createdTime:(new Date).getTime(),customAttributes:{},familyName:"",givenName:"",middleName:"",picture:void 0,password:!0,SAML:!1,test:!1,TOTP:!1,webauthn:!0})}))})),B=({httpClient:e,mock:i})=>({me:()=>t(void 0,void 0,void 0,(function*(){if(i)return $();const s=yield e.get(D.me);return yield(e=>t(void 0,void 0,void 0,(function*(){const t=yield e.text(),i=JSON.parse(t);if(!e.ok){const t=`${i.errorDescription}${i.errorMessage?`: ${i.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(i),e.text=()=>Promise.resolve(t)})))(s),s.json()}))}),H=r((s=>{var o,r,h,f;const v=a(n,d,l,c,u)(s);return f=class extends v{constructor(){super(...arguments),o.add(this),r.set(this,void 0)}get widgetId(){return this.getAttribute("widget-id")}get mock(){return this.getAttribute("mock")}get api(){return e(this,r,"f")||e(this,o,"m",h).call(this),e(this,r,"f")}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this),this.observeAttributes(["project-id","base-url"],(()=>{e(this,r,"f")&&e(this,o,"m",h).call(this)}))}))}},r=new WeakMap,o=new WeakSet,h=function(){this.logger.debug("creating an sdk instance"),i(this,r,((e,i,s)=>{const o=I(Object.assign(Object.assign({},e),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":s,"x-descope-widget-version":"0.4.27"}}));return{user:Object.assign(Object.assign({},B({httpClient:o.httpClient,mock:i})),{logout:i?()=>t(void 0,void 0,void 0,(function*(){})):o.logout})}})({projectId:this.projectId,baseUrl:this.baseUrl,refreshCookieName:this.refreshCookieName},"true"===this.mock,this.widgetId),"f")},f})),V=r((t=>{const e=a(f({name:"widget",initialState:L,reducers:{},extraReducers:t=>{O.reducer(t),P.reducer(t)},asyncActions:{getMe:O.action,logout:P.action}}),v,l,H)(t);return class extends e{constructor(...t){super(...t),this.state=L,this.subscribe((t=>{this.logger.debug("State update:",t),this.state=t}))}}})),X="widget-flow",G=r((i=>{var s,o,r;return r=class extends(a(v,g,V,u,l,p)(i)){constructor(){super(...arguments),s.add(this)}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this);const r=N(X);r&&(!function(t){if(window.history.replaceState&&N(t)){const e=new URL(window.location.href),i=new URLSearchParams(e.search);i.delete(t),e.search=i.toString(),window.history.replaceState({},"",e.toString())}}(X),e(this,s,"m",o).call(this,r))}))}},s=new WeakSet,o=function(t){const e=this.createModal({"data-id":"redirect-flow"});e.setContent(j({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme}));new k((()=>{var t;return null===(t=e.ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}).onSuccess((()=>{e.close(),this.actions.getMe()})),e.afterClose=()=>{e.remove()},e.open()},r})),J=t=>t.me.data,Y=A(J,(t=>t.picture)),_=A(J,(t=>t.email)),z=A(J,(t=>t.verifiedEmail)),K=A(J,(t=>t.name)),Q=A(J,(t=>t.phone)),Z=A(J,(t=>t.verifiedPhone)),tt=A(J,(t=>t.webauthn));A(J,(t=>t.password));const et=A(J,(t=>t.TOTP)),it=A(J,(t=>t.customAttributes)),st=r((e=>{const i=a(m,w({"widget-id":w.missingAttrValidator}))(e);return class extends i{get widgetId(){return this.getAttribute("widget-id")}fetchWidgetPage(e){return t(this,void 0,void 0,(function*(){return(yield this.fetchStaticResource(`user-profile-widget/${this.widgetId}/${e}`,"text")).body}))}}})),ot=r((i=>{var o,r,h;return h=class extends(a(l,v,b,U,st,V)(i)){constructor(){super(...arguments),o.add(this)}onWidgetRootReady(){return t(this,void 0,void 0,(function*(){}))}init(){const i=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.init)||void 0===t?void 0:t.call(this),yield Promise.all([this.actions.getMe(),e(this,o,"m",r).call(this)]),this.onWidgetRootReady()}))}},o=new WeakSet,r=function(){return t(this,void 0,void 0,(function*(){const t=s(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(t),this.contentRootElement.append(t.content.cloneNode(!0))}))},h})),rt=r((t=>class extends(a(p,d)(t)){syncFlowTheme(t){t.theme=this.theme,this.observeAttributes(["theme"],(()=>{t.theme=this.theme}))}})),at=r((s=>{var o,r,n,d,c,f,v,m,w;return w=class extends(a(rt,p,V,l,u,ot,g)(s)){constructor(){super(...arguments),o.add(this),r.set(this,void 0),n.set(this,void 0),v.set(this,h((t=>{this.avatar.image=t}))),m.set(this,h((t=>{this.avatar.displayName=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,o,"m",f).call(this),e(this,o,"m",d).call(this),e(this,v,"f").call(this,Y(this.state)),e(this,m,"f").call(this,K(this.state)),this.subscribe(e(this,v,"f").bind(this),Y),this.subscribe(e(this,m,"f").bind(this),K)}))}},r=new WeakMap,n=new WeakMap,v=new WeakMap,m=new WeakMap,o=new WeakSet,d=function(){this.avatar.flowId&&(i(this,r,this.createModal({"data-id":"update-pic"}),"f"),i(this,n,new k((()=>{var t;return null===(t=e(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,r,"f").afterClose=e(this,o,"m",c).bind(this),e(this,o,"m",c).call(this),this.syncFlowTheme(e(this,n,"f")))},c=function(){e(this,r,"f").setContent(j({projectId:this.projectId,flowId:this.avatar.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,n,"f").onSuccess((()=>{e(this,r,"f").close(),this.actions.getMe()}))},f=function(){this.avatar=new C((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("descope-avatar")}),{logger:this.logger}),this.avatar.onClick((()=>{var t;null===(t=e(this,r,"f"))||void 0===t||t.open()}))},w})),ht=r((s=>{var o,r,n,d,c,f,v,p,m,w,b,U,y;return y=class extends(a(rt,V,l,ot,u,g)(s)){constructor(){super(...arguments),o.add(this),r.set(this,void 0),n.set(this,void 0),d.set(this,void 0),c.set(this,void 0),b.set(this,h((t=>{this.emailUserAttr.value=t}))),U.set(this,h((t=>{this.emailUserAttr.badgeLabel=t?"":"Unverified"})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,o,"m",w).call(this),e(this,o,"m",f).call(this),e(this,o,"m",p).call(this),e(this,b,"f").call(this,_(this.state)),e(this,U,"f").call(this,z(this.state)),this.subscribe(e(this,b,"f").bind(this),_),this.subscribe(e(this,U,"f").bind(this),z)}))}},r=new WeakMap,n=new WeakMap,d=new WeakMap,c=new WeakMap,b=new WeakMap,U=new WeakMap,o=new WeakSet,f=function(){this.emailUserAttr.editFlowId&&(i(this,r,this.createModal({"data-id":"edit-email"}),"f"),i(this,n,new k((()=>{var t;return null===(t=e(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,r,"f").afterClose=e(this,o,"m",v).bind(this),e(this,o,"m",v).call(this),this.syncFlowTheme(e(this,n,"f")))},v=function(){e(this,r,"f").setContent(j({projectId:this.projectId,flowId:this.emailUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,n,"f").onSuccess((()=>{e(this,r,"f").close(),this.actions.getMe()}))},p=function(){this.emailUserAttr.deleteFlowId&&(i(this,d,this.createModal({"data-id":"delete-email"}),"f"),i(this,c,new k((()=>{var t;return null===(t=e(this,d,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,d,"f").afterClose=e(this,o,"m",m).bind(this),e(this,o,"m",m).call(this),this.syncFlowTheme(e(this,c,"f")))},m=function(){e(this,d,"f").setContent(j({projectId:this.projectId,flowId:this.emailUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,c,"f").onSuccess((()=>{e(this,d,"f").close(),this.actions.getMe()}))},w=function(){this.emailUserAttr=new R((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="email"]')}),{logger:this.logger}),this.emailUserAttr.onEditClick((()=>{var t;null===(t=e(this,r,"f"))||void 0===t||t.open()})),this.emailUserAttr.onDeleteClick((()=>{var t;null===(t=e(this,d,"f"))||void 0===t||t.open()}))},y})),nt=r((i=>{var s,o,r;return r=class extends(a(V,l,ot,g)(i)){constructor(){super(...arguments),s.add(this)}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,s,"m",o).call(this)}))}},s=new WeakSet,o=function(){this.logout=new S((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-button[data-id="logout"]')}),{logger:this.logger}),this.logout.onClick((()=>t(this,void 0,void 0,(function*(){yield this.actions.logout(),this.dispatchEvent(new CustomEvent("logout"))}))))},r})),dt=r((s=>{var o,r,n,d,c,f,v,p,m,w,b,U;return U=class extends(a(rt,V,l,ot,u,g)(s)){constructor(){super(...arguments),o.add(this),r.set(this,void 0),n.set(this,void 0),d.set(this,void 0),c.set(this,void 0),b.set(this,h((t=>{this.nameUserAttr.value=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,o,"m",w).call(this),e(this,o,"m",f).call(this),e(this,o,"m",p).call(this),e(this,b,"f").call(this,K(this.state)),this.subscribe(e(this,b,"f").bind(this),K)}))}},r=new WeakMap,n=new WeakMap,d=new WeakMap,c=new WeakMap,b=new WeakMap,o=new WeakSet,f=function(){this.nameUserAttr.editFlowId&&(i(this,r,this.createModal({"data-id":"edit-name"}),"f"),i(this,n,new k((()=>{var t;return null===(t=e(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,r,"f").afterClose=e(this,o,"m",v).bind(this),e(this,o,"m",v).call(this),this.syncFlowTheme(e(this,n,"f")))},v=function(){e(this,r,"f").setContent(j({projectId:this.projectId,flowId:this.nameUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,n,"f").onSuccess((()=>{e(this,r,"f").close(),this.actions.getMe()}))},p=function(){this.nameUserAttr.deleteFlowId&&(i(this,d,this.createModal({"data-id":"delete-name"}),"f"),i(this,c,new k((()=>{var t;return null===(t=e(this,d,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,d,"f").afterClose=e(this,o,"m",m).bind(this),e(this,o,"m",m).call(this),this.syncFlowTheme(e(this,c,"f")))},m=function(){e(this,d,"f").setContent(j({projectId:this.projectId,flowId:this.nameUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,c,"f").onSuccess((()=>{e(this,d,"f").close(),this.actions.getMe()}))},w=function(){this.nameUserAttr=new R((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="name"]')}),{logger:this.logger}),this.nameUserAttr.onEditClick((()=>{var t;null===(t=e(this,r,"f"))||void 0===t||t.open()})),this.nameUserAttr.onDeleteClick((()=>{var t;null===(t=e(this,d,"f"))||void 0===t||t.open()}))},U})),lt=r((s=>{var o,r,n,d,c,f,v,p;return p=class extends(a(rt,V,l,ot,u,g)(s)){constructor(){super(...arguments),o.add(this),r.set(this,void 0),n.set(this,void 0),v.set(this,h((t=>{this.passkeyUserAuthMethod.fulfilled=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,o,"m",f).call(this),e(this,o,"m",d).call(this),e(this,v,"f").call(this,tt(this.state)),this.subscribe(e(this,v,"f").bind(this),tt)}))}},r=new WeakMap,n=new WeakMap,v=new WeakMap,o=new WeakSet,d=function(){this.passkeyUserAuthMethod.flowId&&(i(this,r,this.createModal({"data-id":"passkey"}),"f"),i(this,n,new k((()=>{var t;return null===(t=e(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,r,"f").afterClose=e(this,o,"m",c).bind(this),e(this,o,"m",c).call(this),this.syncFlowTheme(e(this,n,"f")))},c=function(){e(this,r,"f").setContent(j({projectId:this.projectId,flowId:this.passkeyUserAuthMethod.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,n,"f").onSuccess((()=>{e(this,r,"f").close(),this.actions.getMe()}))},f=function(){this.passkeyUserAuthMethod=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="passkey"]')}),{logger:this.logger}),this.passkeyUserAuthMethod.onButtonClick((()=>{var t;null===(t=e(this,r,"f"))||void 0===t||t.open()}))},p})),ct=r((s=>{var o,r,h,n,d,c;return c=class extends(a(rt,V,l,ot,u,g)(s)){constructor(){super(...arguments),o.add(this),r.set(this,void 0),h.set(this,void 0)}initPasswordAuthMethod(){this.passwordUserAuthMethod=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="password"]')}),{logger:this.logger}),this.passwordUserAuthMethod.onButtonClick((()=>{var t;null===(t=e(this,r,"f"))||void 0===t||t.open()}))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),this.initPasswordAuthMethod(),e(this,o,"m",n).call(this)}))}},r=new WeakMap,h=new WeakMap,o=new WeakSet,n=function(){this.passwordUserAuthMethod.flowId&&(i(this,r,this.createModal({"data-id":"password"}),"f"),i(this,h,new k((()=>{var t;return null===(t=e(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,r,"f").afterClose=e(this,o,"m",d).bind(this),e(this,o,"m",d).call(this),this.syncFlowTheme(e(this,h,"f")))},d=function(){e(this,r,"f").setContent(j({projectId:this.projectId,flowId:this.passwordUserAuthMethod.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,h,"f").onSuccess((()=>{e(this,r,"f").close()}))},c})),ut=r((s=>{var o,r,n,d,c,f,v,p,m,w,b,U,y;return y=class extends(a(rt,V,l,ot,u,g)(s)){constructor(){super(...arguments),o.add(this),r.set(this,void 0),n.set(this,void 0),d.set(this,void 0),c.set(this,void 0),b.set(this,h((t=>{this.phoneUserAttr.value=t}))),U.set(this,h((t=>{this.phoneUserAttr.badgeLabel=t?"":"Unverified"})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,o,"m",w).call(this),e(this,o,"m",f).call(this),e(this,o,"m",p).call(this),e(this,b,"f").call(this,Q(this.state)),e(this,U,"f").call(this,Z(this.state)),this.subscribe(e(this,b,"f").bind(this),Q),this.subscribe(e(this,U,"f").bind(this),Z)}))}},r=new WeakMap,n=new WeakMap,d=new WeakMap,c=new WeakMap,b=new WeakMap,U=new WeakMap,o=new WeakSet,f=function(){this.phoneUserAttr.editFlowId&&(i(this,r,this.createModal({"data-id":"edit-phone"}),"f"),i(this,n,new k((()=>{var t;return null===(t=e(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,r,"f").afterClose=e(this,o,"m",v).bind(this),e(this,o,"m",v).call(this),this.syncFlowTheme(e(this,n,"f")))},v=function(){e(this,r,"f").setContent(j({projectId:this.projectId,flowId:this.phoneUserAttr.editFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,n,"f").onSuccess((()=>{e(this,r,"f").close(),this.actions.getMe()}))},p=function(){this.phoneUserAttr.deleteFlowId&&(i(this,d,this.createModal({"data-id":"delete-phone"}),"f"),i(this,c,new k((()=>{var t;return null===(t=e(this,d,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,d,"f").afterClose=e(this,o,"m",m).bind(this),e(this,o,"m",m).call(this),this.syncFlowTheme(e(this,c,"f")))},m=function(){e(this,d,"f").setContent(j({projectId:this.projectId,flowId:this.phoneUserAttr.deleteFlowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,c,"f").onSuccess((()=>{e(this,d,"f").close(),this.actions.getMe()}))},w=function(){this.phoneUserAttr=new R((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-attribute[data-id="phone"]')}),{logger:this.logger}),this.phoneUserAttr.onEditClick((()=>{var t;null===(t=e(this,r,"f"))||void 0===t||t.open()})),this.phoneUserAttr.onDeleteClick((()=>{var t;null===(t=e(this,d,"f"))||void 0===t||t.open()}))},y}));var ft;!function(t){t.TEXT="text",t.NUMBER="number",t.BOOLEAN="boolean",t.SINGLE_SELECT="singleSelect",t.ARRAY="array",t.DATE="date"}(ft||(ft={}));const vt=r((i=>{var s,o,r,n,d,c,f,v,p,m,w;return o=class extends(a(rt,V,l,ot,u,g)(i)){constructor(){super(...arguments),s.add(this),r.set(this,{}),n.set(this,{}),d.set(this,{}),c.set(this,{}),p.set(this,h((t=>{var i;const r=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelectorAll('descope-user-attribute[data-id^="customAttributes."]');Array.from(r).forEach((i=>{const r=i.getAttribute("data-id").replace("customAttributes.",""),a=i.getAttribute("data-type")||ft.TEXT,h=t[r],n=new R(i,{logger:this.logger});n.value=o.getFormattedValue(a,h),e(this,s,"m",m).call(this,i,r,n),e(this,s,"m",w).call(this,i,r,n)}))})))}static getFormattedValue(t,e){return t===ft.DATE&&e?new Date(e).toLocaleString():t===ft.BOOLEAN&&void 0!==e?e?"True":"False":(e||"").toString()}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,p,"f").call(this,it(this.state)),this.subscribe(e(this,p,"f").bind(this),it)}))}},r=new WeakMap,n=new WeakMap,d=new WeakMap,c=new WeakMap,p=new WeakMap,s=new WeakSet,f=function(t){var i,s;null===(i=e(this,r,"f")[t])||void 0===i||i.setContent(j({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),null===(s=e(this,n,"f")[t])||void 0===s||s.onSuccess((()=>{var i;null===(i=e(this,r,"f")[t])||void 0===i||i.close(),this.actions.getMe()}))},v=function(t){var i,s;null===(i=e(this,d,"f")[t])||void 0===i||i.setContent(j({projectId:this.projectId,flowId:t,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),null===(s=e(this,c,"f")[t])||void 0===s||s.onSuccess((()=>{var i;null===(i=e(this,d,"f")[t])||void 0===i||i.close(),this.actions.getMe()}))},m=function(t,i,o){const a=t.getAttribute("edit-flow-id");a&&(e(this,r,"f")[a]=this.createModal({"data-id":`edit-${i}`}),e(this,n,"f")[a]=new k((()=>{var t,i;return null===(i=null===(t=e(this,r,"f")[a])||void 0===t?void 0:t.ele)||void 0===i?void 0:i.querySelector("descope-wc")}),{logger:this.logger}),e(this,r,"f")[a].afterClose=e(this,s,"m",f).bind(this,a),o.onEditClick((()=>{var t,i;null===(i=null===(t=e(this,r,"f"))||void 0===t?void 0:t[a])||void 0===i||i.open()})),e(this,s,"m",f).call(this,a),this.syncFlowTheme(e(this,n,"f")[a]))},w=function(t,i,o){const r=t.getAttribute("delete-flow-id");r&&(e(this,d,"f")[r]=this.createModal({"data-id":`delete-${i}`}),e(this,c,"f")[r]=new k((()=>{var t,i;return null===(i=null===(t=e(this,d,"f")[r])||void 0===t?void 0:t.ele)||void 0===i?void 0:i.querySelector("descope-wc")}),{logger:this.logger}),e(this,d,"f")[r].afterClose=e(this,s,"m",v).bind(this,r),o.onDeleteClick((()=>{var t,i;null===(i=null===(t=e(this,d,"f"))||void 0===t?void 0:t[r])||void 0===i||i.open()})),e(this,s,"m",v).call(this,r),this.syncFlowTheme(e(this,c,"f")[r]))},o})),gt=r((s=>{var o,r,n,d,c,f,v,p;return p=class extends(a(rt,V,l,ot,u,g)(s)){constructor(){super(...arguments),o.add(this),r.set(this,void 0),n.set(this,void 0),v.set(this,h((t=>{this.totpUserAuthMethod.fulfilled=t})))}onWidgetRootReady(){const i=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=i.onWidgetRootReady)||void 0===t?void 0:t.call(this),e(this,o,"m",f).call(this),e(this,o,"m",d).call(this),e(this,v,"f").call(this,et(this.state)),this.subscribe(e(this,v,"f").bind(this),et)}))}},r=new WeakMap,n=new WeakMap,v=new WeakMap,o=new WeakSet,d=function(){this.totpUserAuthMethod.flowId&&(i(this,r,this.createModal({"data-id":"totp"}),"f"),i(this,n,new k((()=>{var t;return null===(t=e(this,r,"f").ele)||void 0===t?void 0:t.querySelector("descope-wc")}),{logger:this.logger}),"f"),e(this,r,"f").afterClose=e(this,o,"m",c).bind(this),e(this,o,"m",c).call(this),this.syncFlowTheme(e(this,n,"f")))},c=function(){e(this,r,"f").setContent(j({projectId:this.projectId,flowId:this.totpUserAuthMethod.flowId,baseUrl:this.baseUrl,baseStaticUrl:this.baseStaticUrl,baseCdnUrl:this.baseCdnUrl,refreshCookieName:this.refreshCookieName,theme:this.theme})),e(this,n,"f").onSuccess((()=>{e(this,r,"f").close(),this.actions.getMe()}))},f=function(){this.totpUserAuthMethod=new W((()=>{var t;return null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector('descope-user-auth-method[data-id="totp"]')}),{logger:this.logger}),this.totpUserAuthMethod.onButtonClick((()=>{var t;null===(t=e(this,r,"f"))||void 0===t||t.open()}))},p})),pt=r((e=>class extends(a(y,p,G,vt,ht,at,dt,ut,lt,ct,ct,gt,nt)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),mt=a((e=>class extends(pt(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return t(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this);(customElements.get("descope-wc")||(yield import("@descope/web-component").then((t=>t.default)))).sdkConfigOverrides={baseHeaders:{"x-descope-widget-type":"user-profile-widget","x-descope-widget-id":this.getAttribute("widget-id"),"x-descope-widget-version":"0.4.27"}}}))}}))(HTMLElement);customElements.define("descope-user-profile-widget",mt);export{mt as default};
6
6
  //# sourceMappingURL=index.js.map
package/dist/index.d.ts CHANGED
@@ -18,7 +18,7 @@ declare const UserProfileWidget: {
18
18
  logout: _descope_sdk_component_drivers.ButtonDriver;
19
19
  "__#10@#initLogout"(): void;
20
20
  onWidgetRootReady: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
21
- "__#27730@#ModalDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
21
+ "__#29614@#ModalDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
22
22
  logger: {
23
23
  error(...data: any[]): void;
24
24
  warn(...data: any[]): void;
@@ -27,7 +27,7 @@ declare const UserProfileWidget: {
27
27
  };
28
28
  }) => {
29
29
  setContent(template: HTMLTemplateElement): void;
30
- "__#27729@#private": any;
30
+ "__#29613@#private": any;
31
31
  beforeOpen: () => void | Promise<void>;
32
32
  afterClose: () => void;
33
33
  nodeName: string;
@@ -35,7 +35,7 @@ declare const UserProfileWidget: {
35
35
  open(): Promise<void>;
36
36
  reset(): void;
37
37
  remove(): void;
38
- "__#27727@#private": any;
38
+ "__#29611@#private": any;
39
39
  logger: {
40
40
  error(...data: any[]): void;
41
41
  warn(...data: any[]): void;
@@ -46,11 +46,11 @@ declare const UserProfileWidget: {
46
46
  readonly ele: Element;
47
47
  };
48
48
  createModal(config?: Record<string, string>): _descope_sdk_component_drivers.ModalDriver;
49
- "__#27726@#getComponentsVersion": (() => Promise<string>) & (() => Promise<string>) & (() => Promise<string>);
50
- "__#27726@#descopeUi": Promise<any>;
49
+ "__#29610@#getComponentsVersion": (() => Promise<string>) & (() => Promise<string>) & (() => Promise<string>);
50
+ "__#29610@#descopeUi": Promise<any>;
51
51
  readonly descopeUi: Promise<any>;
52
- "__#27726@#loadDescopeUiComponent": ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>);
53
- "__#27726@#getDescopeUi": (() => Promise<any>) & (() => Promise<any>) & (() => Promise<any>);
52
+ "__#29610@#loadDescopeUiComponent": ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>);
53
+ "__#29610@#getDescopeUi": (() => Promise<any>) & (() => Promise<any>) & (() => Promise<any>);
54
54
  loadDescopeUiComponents: ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>);
55
55
  readonly baseCdnUrl: string;
56
56
  injectNpmLib: ((libName: string, version: string, filePath?: string, overrides?: string[]) => Promise<{
@@ -63,10 +63,10 @@ declare const UserProfileWidget: {
63
63
  id: string;
64
64
  url: URL;
65
65
  }>);
66
- "__#27717@#logger": _descope_sdk_mixins.Logger;
67
- "__#27717@#wrapLogger": ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger);
66
+ "__#29600@#logger": _descope_sdk_mixins.Logger;
67
+ "__#29600@#wrapLogger": ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger) & ((logger: Partial<_descope_sdk_mixins.Logger>) => _descope_sdk_mixins.Logger);
68
68
  logger: _descope_sdk_mixins.Logger;
69
- onLogEvent: ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", args: any[]) => void);
69
+ onLogEvent: ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", data: any[]) => void) & ((logLevel: "error" | "warn" | "info" | "debug", args: any[]) => void);
70
70
  accessKey: string;
71
71
  readonly accessKeyLabel: string;
72
72
  autocapitalize: string;
@@ -187,10 +187,10 @@ declare const UserProfileWidget: {
187
187
  (attrName: string, oldValue: string, newValue: string): void;
188
188
  (attrName: string, oldValue: string, newValue: string): void;
189
189
  } & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void) & ((attrName: string, oldValue: string, newValue: string) => void);
190
- connectedCallback: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & {
190
+ connectedCallback: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & {
191
191
  (): void;
192
192
  (): void;
193
- } & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
193
+ } & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
194
194
  readonly attributes: NamedNodeMap;
195
195
  readonly classList: DOMTokenList;
196
196
  className: string;
@@ -1017,25 +1017,25 @@ declare const UserProfileWidget: {
1017
1017
  onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) & ((this: GlobalEventHandlers, ev: WheelEvent) => any) & ((this: GlobalEventHandlers, ev: WheelEvent) => any) & ((this: GlobalEventHandlers, ev: WheelEvent) => any) & ((this: GlobalEventHandlers, ev: WheelEvent) => any) & ((this: GlobalEventHandlers, ev: WheelEvent) => any) & ((this: GlobalEventHandlers, ev: WheelEvent) => any) & ((this: GlobalEventHandlers, ev: WheelEvent) => any) & ((this: GlobalEventHandlers, ev: WheelEvent) => any) & ((this: GlobalEventHandlers, ev: WheelEvent) => any) & ((this: GlobalEventHandlers, ev: WheelEvent) => any) & ((this: GlobalEventHandlers, ev: WheelEvent) => any) & ((this: GlobalEventHandlers, ev: WheelEvent) => any) & ((this: GlobalEventHandlers, ev: WheelEvent) => any) & ((this: GlobalEventHandlers, ev: WheelEvent) => any);
1018
1018
  autofocus: boolean;
1019
1019
  readonly dataset: DOMStringMap;
1020
- nonce?: string;
1020
+ nonce: string;
1021
1021
  tabIndex: number;
1022
1022
  blur: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
1023
1023
  focus: ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void) & ((options?: FocusOptions) => void);
1024
1024
  readonly config: Promise<_descope_sdk_mixins.Config>;
1025
- "__#27723@#configCacheClear": (() => void) & (() => void) & (() => void) & (() => void);
1026
- "__#27723@#_configResource": Promise<_descope_sdk_mixins.Config>;
1027
- "__#27723@#fetchConfig": (() => Promise<_descope_sdk_mixins.Config>) & (() => Promise<_descope_sdk_mixins.Config>) & (() => Promise<_descope_sdk_mixins.Config>) & (() => Promise<_descope_sdk_mixins.Config>);
1028
- "__#27718@#isInit": boolean;
1029
- "__#27722@#callbacks": Map<string, () => void> & Map<string, () => void> & Map<string, () => void> & Map<string, () => void>;
1025
+ "__#29606@#configCacheClear": (() => void) & (() => void) & (() => void) & (() => void);
1026
+ "__#29606@#_configResource": Promise<_descope_sdk_mixins.Config>;
1027
+ "__#29606@#fetchConfig": (() => Promise<_descope_sdk_mixins.Config>) & (() => Promise<_descope_sdk_mixins.Config>) & (() => Promise<_descope_sdk_mixins.Config>) & (() => Promise<_descope_sdk_mixins.Config>);
1028
+ "__#29601@#isInit": boolean;
1029
+ "__#29605@#callbacks": Map<string, () => void> & Map<string, () => void> & Map<string, () => void> & Map<string, () => void>;
1030
1030
  onReset: ((sectionId: string, callback: () => void | Promise<void>) => () => void) & ((sectionId: string, callback: () => void | Promise<void>) => () => void) & ((sectionId: string, callback: () => void | Promise<void>) => () => void) & ((sectionId: string, callback: () => void | Promise<void>) => () => void);
1031
1031
  reset: ((...sectionIds: string[]) => Promise<void>) & ((...sectionIds: string[]) => Promise<void>) & ((...sectionIds: string[]) => Promise<void>) & ((...sectionIds: string[]) => Promise<void>);
1032
- "__#27720@#handleError": ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void);
1033
- "__#27719@#observeMappings": {};
1034
- observeAttribute: ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any);
1035
- observeAttributes: ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void);
1036
- "__#27721@#lastBaseUrl"?: string;
1037
- "__#27721@#workingBaseUrl"?: string;
1038
- "__#27721@#getResourceUrls": ((filename: string) => (URL & {
1032
+ "__#29603@#handleError": ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void);
1033
+ "__#29602@#observeMappings": {};
1034
+ observeAttribute: ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any) & ((attrName: string, onAttrChange: (attrName: string, value: string) => void) => () => any);
1035
+ observeAttributes: ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void) & ((attrs: string[], cb: (attrName: string, value: string) => void) => () => void);
1036
+ "__#29604@#lastBaseUrl"?: string;
1037
+ "__#29604@#workingBaseUrl"?: string;
1038
+ "__#29604@#getResourceUrls": ((filename: string) => (URL & {
1039
1039
  baseUrl: string;
1040
1040
  }) | (URL & {
1041
1041
  baseUrl: string;
@@ -1084,6 +1084,36 @@ declare const UserProfileWidget: {
1084
1084
  readonly projectId: string;
1085
1085
  contentRootElement: HTMLElement;
1086
1086
  rootElement: HTMLElement;
1087
+ injectStyle: ((cssString: string, { prepend }?: {
1088
+ prepend?: boolean;
1089
+ }) => CSSStyleSheet | {
1090
+ styleEle: HTMLStyleElement;
1091
+ ref: HTMLElement | ShadowRoot;
1092
+ replaceSync(cssString: string): void;
1093
+ readonly cssRules: CSSRuleList;
1094
+ }) & ((cssString: string, { prepend }?: {
1095
+ prepend?: boolean;
1096
+ }) => CSSStyleSheet | {
1097
+ styleEle: HTMLStyleElement;
1098
+ ref: HTMLElement | ShadowRoot;
1099
+ replaceSync(cssString: string): void;
1100
+ readonly cssRules: CSSRuleList;
1101
+ }) & ((cssString: string, { prepend }?: {
1102
+ prepend?: boolean;
1103
+ }) => CSSStyleSheet | {
1104
+ styleEle: HTMLStyleElement;
1105
+ ref: HTMLElement | ShadowRoot;
1106
+ replaceSync(cssString: string): void;
1107
+ readonly cssRules: CSSRuleList;
1108
+ }) & ((cssString: string, { prepend }?: {
1109
+ prepend?: boolean;
1110
+ }) => CSSStyleSheet | {
1111
+ styleEle: HTMLStyleElement;
1112
+ ref: HTMLElement | ShadowRoot;
1113
+ replaceSync(cssString: string): void;
1114
+ readonly cssRules: CSSRuleList;
1115
+ });
1116
+ "__#29607@#setNonce": (() => void) & (() => void) & (() => void) & (() => void);
1087
1117
  "__#7@#initWidgetRoot": (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
1088
1118
  state: State;
1089
1119
  "__#5@#api": {
@@ -1848,22 +1878,22 @@ declare const UserProfileWidget: {
1848
1878
  "__#16@#initTotpAuthMethod"(): void;
1849
1879
  "__#16@#onFulfilledUpdate": (hasTotp: any) => void;
1850
1880
  syncFlowTheme: ((flowDriver: _descope_sdk_component_drivers.FlowDriver) => void) & ((flowDriver: _descope_sdk_component_drivers.FlowDriver) => void) & ((flowDriver: _descope_sdk_component_drivers.FlowDriver) => void) & ((flowDriver: _descope_sdk_component_drivers.FlowDriver) => void) & ((flowDriver: _descope_sdk_component_drivers.FlowDriver) => void) & ((flowDriver: _descope_sdk_component_drivers.FlowDriver) => void) & ((flowDriver: _descope_sdk_component_drivers.FlowDriver) => void) & ((flowDriver: _descope_sdk_component_drivers.FlowDriver) => void) & ((flowDriver: _descope_sdk_component_drivers.FlowDriver) => void);
1851
- "__#27732@#globalStyle": CSSStyleSheet;
1881
+ "__#29616@#globalStyle": any;
1852
1882
  readonly theme: _descope_sdk_mixins.ThemeOptions;
1853
1883
  readonly styleId: string;
1854
- "__#27732@#_themeResource": Promise<void | Record<string, any>>;
1855
- "__#27732@#fetchTheme"(): Promise<Record<string, any>>;
1856
- readonly "__#27732@#themeResource": Promise<void | Record<string, any>>;
1857
- "__#27732@#loadGlobalStyle"(): Promise<void>;
1858
- "__#27732@#loadComponentsStyle"(): Promise<void>;
1859
- "__#27732@#getFontsConfig"(): Promise<Record<string, {
1884
+ "__#29616@#_themeResource": Promise<void | Record<string, any>>;
1885
+ "__#29616@#fetchTheme"(): Promise<Record<string, any>>;
1886
+ readonly "__#29616@#themeResource": Promise<void | Record<string, any>>;
1887
+ "__#29616@#loadGlobalStyle"(): Promise<void>;
1888
+ "__#29616@#loadComponentsStyle"(): Promise<void>;
1889
+ "__#29616@#getFontsConfig"(): Promise<Record<string, {
1860
1890
  url?: string;
1861
1891
  }>>;
1862
- "__#27732@#loadFonts"(): Promise<void>;
1863
- "__#27732@#applyTheme"(): Promise<void>;
1864
- "__#27732@#onThemeChange": () => void;
1865
- "__#27732@#loadTheme"(): void;
1866
- "__#27732@#toggleOsThemeChangeListener": (listen: boolean) => void;
1892
+ "__#29616@#loadFonts"(): Promise<void>;
1893
+ "__#29616@#applyTheme"(): Promise<void>;
1894
+ "__#29616@#onThemeChange": () => void;
1895
+ "__#29616@#loadTheme"(): void;
1896
+ "__#29616@#toggleOsThemeChangeListener": (listen: boolean) => void;
1867
1897
  passwordUserAuthMethod: _descope_sdk_component_drivers.UserAuthMethodDriver;
1868
1898
  "__#13@#modal": _descope_sdk_component_drivers.ModalDriver;
1869
1899
  "__#13@#flow": _descope_sdk_component_drivers.FlowDriver;
@@ -1930,7 +1960,7 @@ declare const UserProfileWidget: {
1930
1960
  "__#15@#initEditFlow"(nodeEle: Element, customAttrName: string, compInstance: _descope_sdk_component_drivers.UserAttributeDriver): void;
1931
1961
  "__#15@#initDeleteFlow"(nodeEle: Element, customAttrName: string, compInstance: _descope_sdk_component_drivers.UserAttributeDriver): void;
1932
1962
  "__#6@#createFlowRedirectModal"(widgetFlow: string): void;
1933
- "__#27725@#debuggerEle": HTMLElement & {
1963
+ "__#29609@#debuggerEle": HTMLElement & {
1934
1964
  updateData: (data: {
1935
1965
  title: string;
1936
1966
  description?: string;
@@ -1939,11 +1969,11 @@ declare const UserProfileWidget: {
1939
1969
  description?: string;
1940
1970
  }[]) => void;
1941
1971
  };
1942
- "__#27725@#disableDebugger"(): void;
1943
- "__#27725@#enableDebugger"(): Promise<void>;
1972
+ "__#29609@#disableDebugger"(): void;
1973
+ "__#29609@#enableDebugger"(): Promise<void>;
1944
1974
  readonly debug: boolean;
1945
- "__#27725@#handleDebugMode"(): void;
1946
- "__#27725@#updateDebuggerMessages"(title: string, description: string): void;
1975
+ "__#29609@#handleDebugMode"(): void;
1976
+ "__#29609@#updateDebuggerMessages"(title: string, description: string): void;
1947
1977
  };
1948
1978
  getFormattedValue(type: string, val: any): any;
1949
1979
  };