@descope/user-management-widget 0.6.14 → 0.6.16

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/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * @descope/user-management-widget v0.6.14
3
+ * @descope/user-management-widget v0.6.16
4
4
  */
5
- import{pluralize as e,compareArrays as t,createSingletonMixin as s,compose as i,createTemplate as o,withMemCache as r,debounce as a}from"@descope/sdk-helpers";import{__awaiter as n,__classPrivateFieldGet as d,__classPrivateFieldSet as l,__rest as u}from"tslib";import{projectIdMixin as c,observeAttributesMixin as h,loggerMixin as v,baseUrlMixin as g,createValidateAttributesMixin as m,createStateManagementMixin as p,initLifecycleMixin as y,staticResourcesMixin as f,descopeUiMixin as b,initElementMixin as w,modalMixin as R,formMixin as M,notificationsMixin as W,debuggerMixin as P,themeMixin as U}from"@descope/sdk-mixins";import{ButtonDriver as k,MultiSelectDriver as C,TextDriver as S,TextFieldDriver as x,GridDriver as I}from"@descope/sdk-component-drivers";import{createSelector as j}from"reselect";import{createAsyncThunk as N}from"@reduxjs/toolkit";import O from"@descope/web-js-sdk";import L from"libphonenumber-js/min";var T;!function(e){e[e.text=1]="text",e[e.numeric=2]="numeric",e[e.bool=3]="bool",e[e.singleSelect=4]="singleSelect",e[e.array=5]="array",e[e.date=6]="date"}(T||(T={}));const A=(e,t)=>Object.entries(e).reduce(((e,[s,i])=>{const[o,...r]=s.split(".");return t!==o?Object.assign(e,{[s]:i}):(e[o]||(e[o]={}),e[o][r.join(".")]=i,e)}),{}),$=(e,t)=>Object.fromEntries(Object.entries(e||{}).map((([e,s])=>[`${t}.${e}`,s]))),q=(e,t)=>e===T.date?(e=>new Date(Number(e)).toLocaleDateString("en-US"))(`${t}`):t,F={enabled:"active",disabled:"disabled",invited:"invited"},B=e=>e.tenantRoles.data,E=e=>e.selectedUsersLoginIds,D=e=>e.notifications,H=e=>e.customAttributes.data,Z=j(H,(e=>Object.fromEntries(e.map((e=>[e.name,e.type]))))),V=j((e=>e.usersList.data),Z,((e,t)=>e.map((e=>Object.assign(Object.assign({},e),{customAttributes:Object.fromEntries(Object.entries(e.customAttributes).map((([e,s])=>[e,q(t[e],s)])))}))))),z=j(V,(e=>e.map((e=>Object.assign(Object.assign(Object.assign({},e),$(null==e?void 0:e.customAttributes,"customAttributes")),{status:F[e.status]||e.status,roles:e.roleNames}))))),J=j(E,z,((e,t)=>t.filter((t=>e.includes(t.loginIds))))),G=j(J,(e=>e.map((e=>e.userId)))),K=j(J,(e=>e.map((e=>e.status)))),Q=j(J,(e=>e.every((e=>e.editable)))),X=j(E,(e=>!!e.length)),Y=j(E,(e=>1===e.length)),_=j(E,(e=>{var t;return null===(t=null==e?void 0:e[0])||void 0===t?void 0:t[0]})),ee=j(Y,K,((e,t)=>e&&t.every((e=>e===F.enabled)))),te=j(K,(e=>e.every((e=>e===F.disabled)))),se=j(J,(e=>{var t;return 1===e.length?e[0].name||e[0].email||(null===(t=e[0].loginIds)||void 0===t?void 0:t[0]):`${e.length} users`})),ie=j(Y,te,Q,((e,t,s)=>e&&t&&s)),oe=j(Y,ee,Q,((e,t,s)=>e&&t&&s)),re=j(Y,Q,((e,t)=>e&&t)),ae=j(Y,Q,((e,t)=>e&&t)),ne=j(Y,Q,((e,t)=>e&&t)),de=X,le=e=>(...t)=>s=>{s.addCase(e.pending,((e,s)=>{t.forEach((({onPending:t})=>{null==t||t(e,s)}))})),s.addCase(e.fulfilled,((e,s)=>{t.forEach((({onFulfilled:t})=>{null==t||t(e,s)}))})),s.addCase(e.rejected,((e,s)=>{t.forEach((({onRejected:t})=>{null==t||t(e,s)}))}))},ue=e=>({onFulfilled:t=>{e(t).loading=!1},onPending:t=>{e(t).loading=!0,e(t).error=null},onRejected:(t,s)=>{e(t).loading=!1,e(t).error=s.error}}),ce=({getErrorMsg:e,getSuccessMsg:t})=>({onFulfilled:(e,s)=>{t&&e.notifications.push({type:"success",msg:t(s)})},onRejected:(t,s)=>{e&&t.notifications.push({type:"error",msg:e(s)})}}),he=N("users/create",((e,{extra:{api:t}})=>t.user.create(e))),ve=le(he)({onFulfilled:(e,t)=>{e.usersList.data.unshift(t.payload)}},ue((e=>e.createUser)),ce({getSuccessMsg:()=>"User created successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to create user</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),ge={action:he,reducer:ve},me=N("users/delete",((e,{extra:{api:t}})=>t.user.deleteBatch(e))),pe=le(me)({onFulfilled:(e,t)=>{e.usersList.data=e.usersList.data.filter((e=>!t.meta.arg.includes(e.userId))),e.selectedUsersLoginIds=[]}},ue((e=>e.deleteUser)),ce({getSuccessMsg:t=>e(t.meta.arg.length)`${["",t.meta.arg.length]} ${["U","u"]}ser${["","s"]} deleted successfully`,getErrorMsg:t=>e(t.meta.arg.length)`Failed to delete user${["","s"]}`})),ye={action:me,reducer:pe},fe=N("users/setTempPassword",((e,{extra:{api:t}})=>t.user.setTempPassword(e))),be=le(fe)(ue((e=>e.setTempUserPassword)),ce({getSuccessMsg:()=>"Successfully reset user password",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to reset user's password</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),we={action:fe,reducer:be},Re=N("users/getCustomAttributes",((e,{extra:{api:t}})=>t.user.getCustomAttributes())),Me=le(Re)({onFulfilled:(e,t)=>{e.customAttributes.data=t.payload}},ue((e=>e.customAttributes))),We={action:Re,reducer:Me},Pe=N("users/search",((e,{extra:{api:t},getState:s})=>{const i=s().searchParams;return t.user.search(Object.assign(Object.assign({},i),e))})),Ue=le(Pe)({onPending:(e,t)=>{e.searchParams=Object.assign(Object.assign({},e.searchParams),t.meta.arg)},onFulfilled:(e,t)=>{e.usersList.data=t.payload}},ue((e=>e.usersList))),ke={action:Pe,reducer:Ue},Ce=N("tenant/getTenantRoles",((e,{extra:{api:t}})=>t.tenant.getTenantRoles())),Se=le(Ce)({onFulfilled:(e,t)=>{e.tenantRoles.data=t.payload.roles}},ue((e=>e.tenantRoles))),xe={action:Ce,reducer:Se},Ie=N("users/update",((e,{extra:{api:t}})=>t.user.update(e))),je=le(Ie)({onFulfilled:(e,s)=>{const i=e.usersList.data.findIndex((e=>t(e.loginIds,s.payload.loginIds)));-1!==i&&(e.usersList.data[i]=s.payload)}},ue((e=>e.updateUser)),ce({getSuccessMsg:()=>"User updated successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to update user</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),Ne={action:Ie,reducer:je},Oe=N("users/enable",((e,{extra:{api:t}})=>t.user.enable(e))),Le=le(Oe)({onFulfilled:(e,s)=>{var i;const o=e.usersList.data.findIndex((e=>{var i;return t(e.loginIds,null===(i=s.payload.user)||void 0===i?void 0:i.loginIds)}));-1!==o&&(e.usersList.data[o].status=null===(i=s.payload.user)||void 0===i?void 0:i.status)}},ue((e=>e.enableUser)),ce({getSuccessMsg:()=>"User enabled successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to enable user</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),Te={action:Oe,reducer:Le},Ae=N("users/disable",((e,{extra:{api:t}})=>t.user.disable(e))),$e=le(Ae)({onFulfilled:(e,s)=>{var i;const o=e.usersList.data.findIndex((e=>{var i;return t(e.loginIds,null===(i=s.payload.user)||void 0===i?void 0:i.loginIds)}));-1!==o&&(e.usersList.data[o].status=null===(i=s.payload.user)||void 0===i?void 0:i.status)}},ue((e=>e.disableUser)),ce({getSuccessMsg:()=>"User disabled successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to disable user</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),qe={action:Ae,reducer:$e},Fe=N("users/removePasskey",((e,{extra:{api:t}})=>t.user.removePasskey(e))),Be={action:Fe,reducer:le(Fe)(ue((e=>e.removePasskey)),ce({getSuccessMsg:()=>"Successfully removed user's passkey",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to remove user's passkey</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}}))},Ee={usersList:{data:[],loading:!1,error:null},createUser:{loading:!1,error:null},updateUser:{loading:!1,error:null},deleteUser:{loading:!1,error:null},enableUser:{loading:!1,error:null},disableUser:{loading:!1,error:null},removePasskey:{loading:!1,error:null},setTempUserPassword:{loading:!1,error:null},customAttributes:{loading:!1,error:null,data:[]},tenantRoles:{loading:!1,error:null,data:[]},searchParams:{text:"",sort:[]},selectedUsersLoginIds:[],notifications:[]},De={search:"/v1/mgmt/user/search",deleteBatch:"/v1/mgmt/user/delete/batch",create:"/v1/mgmt/user/create",update:"/v1/mgmt/user/update",status:"/v1/mgmt/user/update/status",setTempPassword:"/v1/mgmt/user/password/set/temporary",removePasskey:"/v1/mgmt/user/passkeys/delete",customAttributes:"/v1/mgmt/user/customattributes"},He={roles:"/v1/mgmt/role/all"},Ze=e=>n(void 0,void 0,void 0,(function*(){const t=yield e.text(),s=JSON.parse(t);if(!e.ok){const t=`${s.errorDescription}${s.errorMessage?`: ${s.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(s),e.text=()=>Promise.resolve(t)})),Ve=e=>n(void 0,[e],void 0,(function*({text:e,sort:t}){return new Promise((s=>{const i=[];for(let e=1;e<10;e+=1)i.push({loginIds:[`user${e}@company.com`],externalIds:[`user${e}@company.com`],userId:`user-${e}`,name:`User ${e}`,email:`user${e}@company.com`,roleNames:[`Role ${e}`],phone:`+1-202-555-010${e}`,verifiedEmail:!0,verifiedPhone:!0,userTenants:[],status:"enabled",editable:!0,createdTime:(new Date).getTime(),customAttributes:{},familyName:"",givenName:"",middleName:"",picture:"",password:!0,SAML:!1,test:!1,TOTP:!1,webauthn:!1});t.forEach((e=>{i.sort(((t,s)=>{var i,o;return e.desc?null===(o=s[e.field])||void 0===o?void 0:o.localeCompare(t[e.field]):null===(i=t[e.field])||void 0===i?void 0:i.localeCompare(s[e.field])}))})),s(i.filter((t=>t.name.toLowerCase().includes(e.toLowerCase())||t.phone.toLowerCase().includes(e.toLowerCase())||t.status.toLowerCase().includes(e.toLowerCase())||"active"===e.toLowerCase()||t.familyName.toLowerCase().includes(e.toLowerCase())||t.givenName.toLowerCase().includes(e.toLowerCase())||t.middleName.toLowerCase().includes(e.toLowerCase())||t.email.toLowerCase().includes(e.toLowerCase()))))}))})),ze=e=>n(void 0,[e],void 0,(function*({loginId:e,email:t,phone:s,displayName:i,roles:o,customAttributes:r,picture:a,verifiedEmail:n,verifiedPhone:d,givenName:l,middleName:u,familyName:c}){return new Promise((h=>{const v=Math.random().toString(10).substring(15);h({loginIds:[e],externalIds:[e],userId:`user-${v}`,email:t,phone:s,name:i,roleNames:o,customAttributes:r,picture:a,verifiedEmail:n,verifiedPhone:d,givenName:l,middleName:u,familyName:c,createdTime:(new Date).getTime(),editable:!0,password:!0,SAML:!1,status:"enabled",test:!1,TOTP:!1,userTenants:[],webauthn:!1})}))})),Je=e=>n(void 0,[e],void 0,(function*({loginId:e,email:t,phone:s,displayName:i,roles:o,customAttributes:r,picture:a,verifiedEmail:n,verifiedPhone:d,givenName:l,middleName:u,familyName:c}){return new Promise((h=>{h({loginIds:[e],externalIds:[e],userId:e,email:t,phone:s,name:i,roleNames:o,customAttributes:r,picture:a,verifiedEmail:n,verifiedPhone:d,givenName:l,middleName:u,familyName:c,createdTime:(new Date).getTime(),editable:!0,password:!0,SAML:!1,status:"enabled",test:!1,TOTP:!1,userTenants:[],webauthn:!1})}))})),Ge=()=>n(void 0,void 0,void 0,(function*(){})),Ke=()=>n(void 0,void 0,void 0,(function*(){return new Promise((e=>{e({cleartext:Math.random().toString(20).substring(2)})}))})),Qe=()=>n(void 0,void 0,void 0,(function*(){})),Xe=e=>n(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({user:{loginIds:[e],status:"enabled"}})}))})),Ye=e=>n(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({user:{loginIds:[e],status:"disabled"}})}))})),_e=()=>n(void 0,void 0,void 0,(function*(){return new Promise((e=>{e([])}))})),et=e=>new Promise((t=>{const s=[];for(let t=1;t<5;t+=1)s.push({name:`Role ${t}`,description:`Role description ${t}`,createdTime:new Date,permissionNames:[`Permission ${t}`],tenantId:e});t({roles:s})})),tt=({httpClient:e,tenant:t,mock:s})=>({search:(...i)=>n(void 0,[...i],void 0,(function*({page:i,limit:o=1e4,customAttributes:r,statuses:a,emails:n,phones:d,text:l,sort:u}={}){if(s)return Ve({page:i,limit:o,customAttributes:r,statuses:a,emails:n,phones:d,text:l,sort:u});const c=yield e.post(De.search,{limit:o,page:i,withTestUser:!1,customAttributes:r,statuses:a,emails:n,phones:d,text:l,sort:u},{queryParams:{tenant:t}});yield Ze(c);return(yield c.json()).users})),deleteBatch:i=>n(void 0,void 0,void 0,(function*(){if(s)return Ge();const o=yield e.post(De.deleteBatch,{userIds:i},{queryParams:{tenant:t}});return yield Ze(o),o.json()})),create:i=>n(void 0,[i],void 0,(function*({loginId:i,email:o,phone:r,displayName:a,roles:n,customAttributes:d,picture:l,verifiedEmail:u,verifiedPhone:c,givenName:h,middleName:v,familyName:g,additionalLoginIds:m,sendSMS:p,sendMail:y,inviteUrl:f,invite:b}){if(s)return ze({loginId:i,email:o,phone:r,displayName:a,roles:n,customAttributes:d,picture:l,verifiedEmail:u,verifiedPhone:c,givenName:h,middleName:v,familyName:g,additionalLoginIds:m,sendSMS:p,sendMail:y,inviteUrl:f,invite:b});const w=yield e.post(De.create,{loginId:i,email:o,phone:r,displayName:a,givenName:h,middleName:v,familyName:g,roleNames:n,userTenants:[{tenantId:t}],customAttributes:d,picture:l,verifiedEmail:u,verifiedPhone:c,additionalLoginIds:m,sendSMS:p,sendMail:y,inviteUrl:f,invite:b},{queryParams:{tenant:t}});yield Ze(w);return(yield w.json()).user})),update:i=>n(void 0,[i],void 0,(function*({loginId:i,email:o,phone:r,displayName:a,roles:n,customAttributes:d,picture:l,verifiedEmail:u,verifiedPhone:c,givenName:h,middleName:v,familyName:g,additionalLoginIds:m}){if(s)return Je({loginId:i,email:o,phone:r,displayName:a,roles:n,customAttributes:d,picture:l,verifiedEmail:u,verifiedPhone:c,givenName:h,middleName:v,familyName:g,additionalLoginIds:m});const p=yield e.post(De.update,{loginId:i,email:o,phone:r,displayName:a,givenName:h,middleName:v,familyName:g,roleNames:n,customAttributes:d,picture:l,verifiedEmail:u,verifiedPhone:c,additionalLoginIds:m},{queryParams:{tenant:t}});yield Ze(p);return(yield p.json()).user})),enable:i=>n(void 0,void 0,void 0,(function*(){if(s)return Xe(i);const o=yield e.post(De.status,{loginId:i,status:"enabled"},{queryParams:{tenant:t}});return yield Ze(o),o.json()})),disable:i=>n(void 0,void 0,void 0,(function*(){if(s)return Ye(i);const o=yield e.post(De.status,{loginId:i,status:"disabled"},{queryParams:{tenant:t}});return yield Ze(o),o.json()})),removePasskey:i=>n(void 0,void 0,void 0,(function*(){if(s)return Qe();const o=yield e.post(De.removePasskey,{loginId:i},{queryParams:{tenant:t}});return yield Ze(o),o.json()})),setTempPassword:i=>n(void 0,void 0,void 0,(function*(){if(s)return Ke();const o=yield e.post(De.setTempPassword,{loginId:i},{queryParams:{tenant:t}});return yield Ze(o),o.json()})),getCustomAttributes:()=>n(void 0,void 0,void 0,(function*(){if(s)return _e();const i=yield e.get(De.customAttributes,{queryParams:{tenant:t}});yield Ze(i);return(yield i.json()).data}))}),st=({httpClient:e,tenant:t,mock:s})=>({getTenantRoles:()=>n(void 0,void 0,void 0,(function*(){if(s)return et(t);const i=yield e.get(He.roles,{queryParams:{tenant:t}});return yield Ze(i),i.json()}))}),it=s((e=>{var t,s,o,r;const a=i(c,h,v,g,m({tenant:m.missingAttrValidator}))(e);return r=class extends a{constructor(){super(...arguments),t.add(this),s.set(this,void 0)}get tenantId(){return this.getAttribute("tenant")}get widgetId(){return this.getAttribute("widget-id")}get mock(){return this.getAttribute("mock")}get api(){return d(this,s,"f")||d(this,t,"m",o).call(this),d(this,s,"f")}init(){const e=Object.create(null,{init:{get:()=>super.init}});return n(this,void 0,void 0,(function*(){var i;yield null===(i=e.init)||void 0===i?void 0:i.call(this),this.observeAttributes(["project-id","base-url","tenant"],(()=>{d(this,s,"f")&&d(this,t,"m",o).call(this)}))}))}},s=new WeakMap,t=new WeakSet,o=function(){this.logger.debug("creating an sdk instance"),l(this,s,((e,t,s,i)=>{const o=O(Object.assign(Object.assign({},e),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"user-management-widget","x-descope-widget-id":i,"x-descope-widget-version":"0.6.14"}}));return{user:tt({httpClient:o.httpClient,tenant:t,mock:s}),tenant:st({httpClient:o.httpClient,tenant:t,mock:s})}})({projectId:this.projectId,baseUrl:this.baseUrl},this.tenantId,"true"===this.mock,this.widgetId),"f")},r})),ot=s((e=>{const t=i(p({name:"widget",initialState:Ee,reducers:{setSelectedUsersIds:(e,{payload:t})=>{e.selectedUsersLoginIds=t},clearNotifications:e=>{e.notifications=[]}},extraReducers:e=>{ge.reducer(e),Ne.reducer(e),Te.reducer(e),qe.reducer(e),ye.reducer(e),ke.reducer(e),we.reducer(e),Be.reducer(e),We.reducer(e),xe.reducer(e)},asyncActions:{searchUsers:ke.action,createUser:ge.action,updateUser:Ne.action,enableUser:Te.action,disableUser:qe.action,deleteUsers:ye.action,removePasskey:Be.action,getCustomAttributes:We.action,getTenantRoles:xe.action,setTempUserPassword:we.action}}),y,v,it)(e);return class extends t{constructor(...e){super(...e),this.state=Ee,this.subscribe((e=>{this.logger.debug("State update:",e),this.state=e}))}}})),rt=s((e=>{const t=i(f,m({"widget-id":m.missingAttrValidator}))(e);return class extends t{get widgetId(){return this.getAttribute("widget-id")}fetchWidgetPage(e){return n(this,void 0,void 0,(function*(){return(yield this.fetchStaticResource(`user-management-widget/${this.widgetId}/${e}`,"text")).body}))}}})),at=s((e=>{var t,s,r;return r=class extends(i(v,y,b,w,rt,ot)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){return n(this,void 0,void 0,(function*(){}))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return n(this,void 0,void 0,(function*(){var i;yield null===(i=e.init)||void 0===i?void 0:i.call(this),yield Promise.all([d(this,t,"m",s).call(this),this.actions.searchUsers(),this.actions.getTenantRoles(),this.actions.getCustomAttributes()]),this.onWidgetRootReady()}))}},t=new WeakSet,s=function(){return n(this,void 0,void 0,(function*(){const e=o(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(e),this.contentRootElement.append(e.content.cloneNode(!0))}))},r})),nt=s((e=>{var t,s,r,a,u,c;return c=class extends(i(ot,R,M,v,at)(e)){constructor(){super(...arguments),t.add(this),s.set(this,void 0),u.set(this,(()=>n(this,void 0,void 0,(function*(){yield d(this,s,"f").setData(B(this.state).map((({name:e})=>({value:e,label:e}))))}))))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",r).call(this)}))}},s=new WeakMap,u=new WeakMap,t=new WeakSet,r=function(){return n(this,void 0,void 0,(function*(){this.createUserModal=this.createModal(),this.createUserModal.setContent(o(yield this.fetchWidgetPage("create-user-modal.html")));new k((()=>{var e;return null===(e=this.createUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>{this.createUserModal.close(),this.resetFormData(this.createUserModal.ele)}));new k((()=>{var e;return null===(e=this.createUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>n(this,void 0,void 0,(function*(){if(this.validateForm(this.createUserModal.ele)){const e=this.getFormData(this.createUserModal.ele);this.actions.createUser(Object.assign(Object.assign({},A(e,"customAttributes")),{invite:!0,verifiedEmail:!0,verifiedPhone:!0})),this.createUserModal.close(),this.resetFormData(this.createUserModal.ele)}})))),l(this,s,new C((()=>{var e;return null===(e=this.createUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="roles-multiselect"]')}),{logger:this.logger}),"f"),d(this,u,"f").call(this),this.createUserModal.beforeOpen=()=>n(this,void 0,void 0,(function*(){yield d(this,u,"f").call(this),d(this,t,"m",a).call(this)}))}))},a=function(){const e=H(this.state);this.getFormFieldNames(this.createUserModal.ele).forEach((t=>{const[s,i]=t.split(".");if("customAttributes"!==s)return;const o=e.find((e=>e.name===i));o?o.editable||this.disableFormField(this.createUserModal.ele,t):this.removeFormField(this.createUserModal.ele,t)}))},c})),dt=s((e=>{var t,s,o;return o=class extends(i(v,nt,at)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),d(this,t,"m",s).call(this)}))}},t=new WeakSet,s=function(){var e;this.createButton=new k(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="create-user"]'),{logger:this.logger}),this.createButton.onClick((()=>this.createUserModal.open()))},o})),lt=s((e=>{var t,s,r;return r=class extends(i(ot,R,v,at)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),yield d(this,t,"m",s).call(this)}))}},t=new WeakSet,s=function(){return n(this,void 0,void 0,(function*(){var e;this.deleteUsersModal=this.createModal(),this.deleteUsersModal.setContent(o(yield this.fetchWidgetPage("delete-users-modal.html")));const t=new k((()=>{var e;return null===(e=this.deleteUsersModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.deleteUsersModal.close()));const s=new k((()=>{var e;return null===(e=this.deleteUsersModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});s.onClick((()=>{const e=G(this.state);this.actions.deleteUsers(e),this.deleteUsersModal.close()}));const i=new S(null===(e=this.deleteUsersModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.deleteUsersModal.beforeOpen=()=>{const e=se(this.state);i.text=`Delete ${e}?`}}))},r})),ut=s((e=>{var t,s,o,a;return a=class extends(i(v,at,ot,lt)(e)){constructor(){super(...arguments),t.add(this),o.set(this,r((e=>{e?this.deleteButton.enable():this.deleteButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;d(this,t,"m",s).call(this),yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),this.subscribe(d(this,o,"f").bind(this),de)}))}},o=new WeakMap,t=new WeakSet,s=function(){var e;this.deleteButton=new k(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="delete-users"]'),{logger:this.logger}),this.deleteButton.disable(),this.deleteButton.onClick((()=>{this.deleteUsersModal.open()}))},a})),ct=s((e=>{var t,s,r,a,l;return l=class extends(i(ot,R,v,M,at)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",a).call(this)}))}},t=new WeakSet,s=function(){new k((()=>{var e;return null===(e=this.disableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.disableUserModal.close()))},r=function(){new k((()=>{var e;return null===(e=this.disableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>{const e=_(this.state);this.actions.disableUser(e),this.disableUserModal.close()}))},a=function(){return n(this,void 0,void 0,(function*(){var e;this.disableUserModal=this.createModal(),this.disableUserModal.setContent(o(yield this.fetchWidgetPage("disable-user-modal.html"))),d(this,t,"m",s).call(this),d(this,t,"m",r).call(this);const i=new S(null===(e=this.disableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.disableUserModal.beforeOpen=()=>n(this,void 0,void 0,(function*(){const e=se(this.state);i.text=`Disable ${e}?`}))}))},l})),ht=s((e=>{var t,s,o,a;return a=class extends(i(v,at,ot,ct,M)(e)){constructor(){super(...arguments),t.add(this),o.set(this,r((e=>{e?this.disableButton.enable():this.disableButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;d(this,t,"m",s).call(this),yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),this.subscribe(d(this,o,"f").bind(this),oe)}))}},o=new WeakMap,t=new WeakSet,s=function(){var e;this.disableButton=new k(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="disable-user"]'),{logger:this.logger}),this.disableButton.disable(),this.disableButton.onClick((()=>{this.disableUserModal.open()}))},a})),vt=e=>{if(!e)return e;const t=L(e),s=new RegExp(`(\\+?${null==t?void 0:t.countryCallingCode})(.*)`);return t.number.replace(s,"$1-$2")},gt=s((e=>{var t,s,r,a,c,h,g,m,p,y;return y=class extends(i(ot,R,v,M,at)(e)){constructor(){super(...arguments),t.add(this),s.set(this,void 0),r.set(this,void 0),h.set(this,(()=>n(this,void 0,void 0,(function*(){yield d(this,r,"f").setData(B(this.state).map((({name:e})=>({value:e,label:e}))))})))),m.set(this,(()=>{var e,t;const s=null===(e=J(this.state))||void 0===e?void 0:e[0],i=Object.assign({loginId:null===(t=null==s?void 0:s.loginIds)||void 0===t?void 0:t.join(", "),displayName:null==s?void 0:s.name,email:null==s?void 0:s.email,phone:vt(null==s?void 0:s.phone),roles:null==s?void 0:s.roles},$(s.customAttributes,"customAttributes"));this.setFormData(this.editUserModal.ele,i)}))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",p).call(this)}))}},s=new WeakMap,r=new WeakMap,h=new WeakMap,m=new WeakMap,t=new WeakSet,a=function(){new k((()=>{var e;return null===(e=this.editUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.editUserModal.close()))},c=function(){new k((()=>{var e;return null===(e=this.editUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>{if(this.validateForm(this.editUserModal.ele)){const e=this.getFormData(this.editUserModal.ele),{loginId:t}=e,s=u(e,["loginId"]);this.actions.updateUser(Object.assign({loginId:t.split(", ")[0]},A(s,"customAttributes"))),this.editUserModal.close(),this.resetFormData(this.editUserModal.ele)}}))},g=function(){const e=H(this.state);this.getFormFieldNames(this.editUserModal.ele).forEach((t=>{const[s,i]=t.split(".");if("customAttributes"!==s)return;const o=e.find((e=>e.name===i));o?o.editable||this.disableFormField(this.editUserModal.ele,t):this.removeFormField(this.editUserModal.ele,t)}))},p=function(){return n(this,void 0,void 0,(function*(){var e;this.editUserModal=this.createModal(),this.editUserModal.setContent(o(yield this.fetchWidgetPage("edit-user-modal.html"))),d(this,t,"m",a).call(this),d(this,t,"m",c).call(this),l(this,s,new x(null===(e=this.editUserModal.ele)||void 0===e?void 0:e.querySelector('[name="loginId"]'),{logger:this.logger}),"f"),l(this,r,new C((()=>{var e;return null===(e=this.editUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="roles-multiselect"]')}),{logger:this.logger}),"f"),this.editUserModal.beforeOpen=()=>n(this,void 0,void 0,(function*(){yield d(this,h,"f").call(this),d(this,s,"f").disable(),d(this,m,"f").call(this),d(this,t,"m",g).call(this)}))}))},y})),mt=s((e=>{var t,s,o,a;return a=class extends(i(v,at,ot,gt,M)(e)){constructor(){super(...arguments),t.add(this),o.set(this,r((e=>{e?this.editButton.enable():this.editButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;d(this,t,"m",s).call(this),yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),this.subscribe(d(this,o,"f").bind(this),re)}))}},o=new WeakMap,t=new WeakSet,s=function(){var e;this.editButton=new k(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="edit-user"]'),{logger:this.logger}),this.editButton.disable(),this.editButton.onClick((()=>{this.editUserModal.open()}))},a})),pt=s((e=>{var t,s,r,a,l;return l=class extends(i(ot,R,v,M,at)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",a).call(this)}))}},t=new WeakSet,s=function(){new k((()=>{var e;return null===(e=this.enableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.enableUserModal.close()))},r=function(){new k((()=>{var e;return null===(e=this.enableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>{const e=_(this.state);this.actions.enableUser(e),this.enableUserModal.close()}))},a=function(){return n(this,void 0,void 0,(function*(){var e;this.enableUserModal=this.createModal(),this.enableUserModal.setContent(o(yield this.fetchWidgetPage("enable-user-modal.html"))),d(this,t,"m",s).call(this),d(this,t,"m",r).call(this);const i=new S(null===(e=this.enableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.enableUserModal.beforeOpen=()=>n(this,void 0,void 0,(function*(){const e=se(this.state);i.text=`Activate ${e}?`}))}))},l})),yt=s((e=>{var t,s,o,a;return a=class extends(i(v,at,ot,pt,M)(e)){constructor(){super(...arguments),t.add(this),o.set(this,r((e=>{e?this.enableButton.enable():this.enableButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;d(this,t,"m",s).call(this),yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),this.subscribe(d(this,o,"f").bind(this),ie)}))}},o=new WeakMap,t=new WeakSet,s=function(){var e;this.enableButton=new k(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="enable-user"]'),{logger:this.logger}),this.enableButton.disable(),this.enableButton.onClick((()=>{this.enableUserModal.open()}))},a})),ft=s((e=>{var t,s,o,r;return r=class extends(i(v,at,ot)(e)){constructor(){super(...arguments),t.add(this),s.set(this,a((()=>{this.actions.searchUsers({text:this.searchInput.value})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",o).call(this)}))}},s=new WeakMap,t=new WeakSet,o=function(){var e;this.searchInput=new x(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="search-input"]'),{logger:this.logger}),this.searchInput.onInput(d(this,s,"f"))},r}));const bt={success:(new DOMParser).parseFromString('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Checkmark">\n<path id="Shape" d="M10.0485 15.6396C9.5799 15.171 8.8201 15.171 8.35147 15.6396C7.88284 16.1082 7.88284 16.868 8.35147 17.3367L12.7072 21.6924C13.1759 22.1611 13.9357 22.1611 14.4043 21.6924L24.7152 11.3815C25.1838 10.9129 25.1838 10.1531 24.7152 9.68448C24.2466 9.21585 23.4868 9.21585 23.0181 9.68448L13.5558 19.1469L10.0485 15.6396Z" fill="currentcolor"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild,error:(new DOMParser).parseFromString('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Icon">\n<path id="Vector" d="M15.9998 26.6558C10.1118 26.6558 5.34375 21.8878 5.34375 15.9998C5.34375 10.1118 10.1118 5.34375 15.9998 5.34375C21.8878 5.34375 26.6558 10.1118 26.6558 15.9998C26.6558 21.8878 21.8878 26.6558 15.9998 26.6558ZM15.9998 24.4798C20.6718 24.4798 24.4798 20.7038 24.4798 15.9998C24.4798 11.3278 20.7038 7.51975 15.9998 7.51975C11.3278 7.51975 7.51975 11.2958 7.51975 15.9998C7.51975 20.6718 11.2958 24.4798 15.9998 24.4798ZM15.3278 9.34375H16.6718C17.0558 9.34375 17.3438 9.63175 17.3118 9.98375L16.9598 16.9278C16.9598 17.1838 16.7678 17.3438 16.5438 17.3438H15.4558C15.2318 17.3438 15.0398 17.1518 15.0398 16.9278L14.6878 9.98375C14.6878 9.63175 14.9758 9.34375 15.3278 9.34375ZM15.4558 19.4558H16.5438C16.9278 19.4558 17.2158 19.7438 17.1838 20.1278V21.1838C17.1838 21.5678 16.8958 21.8558 16.5438 21.8558H15.4558C15.0718 21.8558 14.7838 21.5678 14.7838 21.1838V20.1278C14.7838 19.7438 15.0718 19.4558 15.4558 19.4558Z" fill="currentcolor"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild},wt=s((e=>{var t,s,o,a,l;return l=class extends(i(v,ot,W,y)(e)){constructor(){super(...arguments),t.add(this),a.set(this,r((e=>{e.length&&(e.forEach((({type:e,msg:i})=>{const r=d(this,t,"m",o).call(this,e);r.setContent(d(this,t,"m",s).call(this,{type:e,msg:i})),r.show()})),setTimeout((()=>this.actions.clearNotifications())))})))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return n(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this),this.subscribe(d(this,a,"f").bind(this),D)}))}},a=new WeakMap,t=new WeakSet,s=function({type:e,msg:t}){const s=bt[e],i=Object.assign((new DOMParser).parseFromString('<svg width="2em" height="2em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Icon">\n<path id="Shape" d="M10.6712 12L7.27521 8.60406C6.90826 8.23711 6.90826 7.64216 7.27521 7.27521C7.64216 6.90826 8.23711 6.90826 8.60406 7.27521L12 10.6712L15.3959 7.27521C15.7629 6.90826 16.3578 6.90826 16.7248 7.27521C17.0917 7.64216 17.0917 8.23711 16.7248 8.60406L13.3288 12L16.7248 15.3959C17.0917 15.7629 17.0917 16.3578 16.7248 16.7248C16.3578 17.0917 15.7629 17.0917 15.3959 16.7248L12 13.3288L8.60406 16.7248C8.23711 17.0917 7.64216 17.0917 7.27521 16.7248C6.90826 16.3578 6.90826 15.7629 7.27521 15.3959L10.6712 12Z" fill="currentcolor"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild,{slot:"close"});return`${(null==s?void 0:s.outerHTML)||""}${t}${i.outerHTML}`},o=function(e){return this.createNotification({mode:e,duration:"error"===e?0:3e3,position:"bottom-start",size:"sm"})},l})),Rt=s((e=>{var t,s,r,a,l;return l=class extends(i(ot,R,v,M,at)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",a).call(this)}))}},t=new WeakSet,s=function(){new k((()=>{var e;return null===(e=this.removePasskeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.removePasskeyModal.close()))},r=function(){new k((()=>{var e;return null===(e=this.removePasskeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>{const e=_(this.state);this.actions.removePasskey(e),this.removePasskeyModal.close()}))},a=function(){return n(this,void 0,void 0,(function*(){var e;this.removePasskeyModal=this.createModal(),this.removePasskeyModal.setContent(o(yield this.fetchWidgetPage("remove-passkey-modal.html"))),d(this,t,"m",s).call(this),d(this,t,"m",r).call(this);const i=new S(null===(e=this.removePasskeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.removePasskeyModal.beforeOpen=()=>n(this,void 0,void 0,(function*(){const e=se(this.state);i.text=`Remove passkey for ${e}?`}))}))},l})),Mt=s((e=>{var t,s,o,a;return a=class extends(i(v,at,ot,Rt,M)(e)){constructor(){super(...arguments),t.add(this),o.set(this,r((e=>{e?this.removePasskeyButton.enable():this.removePasskeyButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;d(this,t,"m",s).call(this),yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),this.subscribe(d(this,o,"f").bind(this),ae)}))}},o=new WeakMap,t=new WeakSet,s=function(){var e;this.removePasskeyButton=new k(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="remove-passkey"]'),{logger:this.logger}),this.removePasskeyButton.disable(),this.removePasskeyButton.onClick((()=>{this.removePasskeyModal.open()}))},a})),Wt=s((e=>{var t,s,o,l,u,c,h,g;return g=class extends(i(ot,v,at)(e)){constructor(){super(...arguments),t.add(this),l.set(this,r((e=>{this.usersTable.data=e}))),u.set(this,a(((e,t)=>{const s=[],{value:i}=t;if(i){const t=e.path;s.push({field:t,desc:"desc"===i})}this.actions.searchUsers({sort:s})}))),c.set(this,r((e=>{this.usersTable.filterColumns((t=>{var s;const[i,o]=(null===(s=t.path)||void 0===s?void 0:s.split("."))||[];return"customAttributes"!==i||!!(null==e?void 0:e.find((e=>e.name===o)))}))})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",o).call(this),d(this,l,"f").call(this,z(this.state)),d(this,c,"f").call(this,H(this.state)),this.subscribe(d(this,c,"f").bind(this),H),this.subscribe(d(this,l,"f").bind(this),z)}))}},l=new WeakMap,u=new WeakMap,c=new WeakMap,t=new WeakSet,s=function(){const e=e=>{var t;return null===(t=this.usersTable.ele)||void 0===t?void 0:t.querySelector(`[path="${e}"]`)},t=e=>{var t;const s=`descope-grid-${e}-column`;return null===(t=this.usersTable.ele)||void 0===t?void 0:t.querySelector(s)},s=this.usersTable.renderColumn;this.usersTable.renderColumn=({path:i,header:o,type:r,attrs:a})=>{const n=e(i)||t(r);if(!n)return s({path:i,header:o,type:r,attrs:a});const d=n.cloneNode(!0),l=Object.assign(Object.assign({},a),{header:o});return Object.entries(l).forEach((([e,t])=>{d.setAttribute(e,t)})),d.outerHTML}},o=function(){var e;this.usersTable=new I(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="users-table"]'),{logger:this.logger}),this.usersTable.onSelectedItemsChange((e=>{this.actions.setSelectedUsersIds(e.detail.value.map((({loginIds:e})=>e)))})),this.usersTable.onColumnsChange(d(this,t,"m",h).bind(this)),d(this,t,"m",s).call(this),d(this,t,"m",h).call(this)},h=function(){this.usersTable.columns.forEach((e=>{e.onSortDirectionChange((e=>{d(this,u,"f").call(this,e.target,e.detail)}))}))},g})),Pt=s((e=>{var t,s,r;return r=class extends(i(ot,R,v,M,at)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),yield d(this,t,"m",s).call(this)}))}},t=new WeakSet,s=function(){return n(this,void 0,void 0,(function*(){this.generatedPasswordModal=this.createModal(),this.generatedPasswordModal.setContent(o(yield this.fetchWidgetPage("generated-password-modal.html")));new k((()=>{var e;return null===(e=this.generatedPasswordModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-close"]')}),{logger:this.logger}).onClick((()=>{navigator.clipboard.writeText(this.getFormData(this.generatedPasswordModal.ele)["generated-password"]),this.resetFormData(this.generatedPasswordModal.ele),this.generatedPasswordModal.close()}))}))},r})),Ut=s((e=>{var t,s,r,a,l;return l=class extends(i(ot,R,v,M,at,Pt)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",a).call(this)}))}},t=new WeakSet,s=function(){new k((()=>{var e;return null===(e=this.resetPasswordModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.resetPasswordModal.close()))},r=function(){new k((()=>{var e;return null===(e=this.resetPasswordModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>n(this,void 0,void 0,(function*(){var e;const t=_(this.state),s=yield this.actions.setTempUserPassword(t);this.resetPasswordModal.close(),this.setFormData(this.generatedPasswordModal.ele,{"generated-password":null===(e=null==s?void 0:s.payload)||void 0===e?void 0:e.cleartext}),this.generatedPasswordModal.open()}))))},a=function(){return n(this,void 0,void 0,(function*(){var e;this.resetPasswordModal=this.createModal(),this.resetPasswordModal.setContent(o(yield this.fetchWidgetPage("reset-password-modal.html"))),d(this,t,"m",s).call(this),d(this,t,"m",r).call(this);const i=new S(null===(e=this.resetPasswordModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.resetPasswordModal.beforeOpen=()=>n(this,void 0,void 0,(function*(){const e=se(this.state);i.text=`This will generate a new temporary password for ${e}?`}))}))},l})),kt=s((e=>{var t,s,o,a;return a=class extends(i(v,at,ot,Ut,M)(e)){constructor(){super(...arguments),t.add(this),o.set(this,r((e=>{e?this.resetPasswordButton.enable():this.resetPasswordButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;d(this,t,"m",s).call(this),yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),this.subscribe(d(this,o,"f").bind(this),ne)}))}},o=new WeakMap,t=new WeakSet,s=function(){var e;this.resetPasswordButton=new k(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="reset-password"]'),{logger:this.logger}),this.resetPasswordButton.disable(),this.resetPasswordButton.onClick((()=>{this.resetPasswordModal.open()}))},a})),Ct=s((e=>class extends(i(P,U,Wt,dt,ut,mt,yt,ht,kt,Mt,ft,wt)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return n(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),St=i((e=>class extends(Ct(e)){}))(HTMLElement);customElements.define("descope-user-management-widget",St);export{St as default};
5
+ import{pluralize as e,compareArrays as t,createSingletonMixin as s,compose as i,createTemplate as o,withMemCache as r,debounce as a}from"@descope/sdk-helpers";import{__awaiter as n,__classPrivateFieldGet as d,__classPrivateFieldSet as l,__rest as u}from"tslib";import{projectIdMixin as c,observeAttributesMixin as h,loggerMixin as v,baseUrlMixin as g,createValidateAttributesMixin as m,createStateManagementMixin as p,initLifecycleMixin as y,staticResourcesMixin as f,descopeUiMixin as b,initElementMixin as w,modalMixin as R,formMixin as M,notificationsMixin as W,debuggerMixin as P,themeMixin as U}from"@descope/sdk-mixins";import{ButtonDriver as k,MultiSelectDriver as C,TextDriver as S,TextFieldDriver as x,GridDriver as I}from"@descope/sdk-component-drivers";import{createSelector as j}from"reselect";import{createAsyncThunk as N}from"@reduxjs/toolkit";import O from"@descope/web-js-sdk";import L from"libphonenumber-js/min";var T;!function(e){e[e.text=1]="text",e[e.numeric=2]="numeric",e[e.bool=3]="bool",e[e.singleSelect=4]="singleSelect",e[e.array=5]="array",e[e.date=6]="date"}(T||(T={}));const A=(e,t)=>Object.entries(e).reduce(((e,[s,i])=>{const[o,...r]=s.split(".");return t!==o?Object.assign(e,{[s]:i}):(e[o]||(e[o]={}),e[o][r.join(".")]=i,e)}),{}),$=(e,t)=>Object.fromEntries(Object.entries(e||{}).map((([e,s])=>[`${t}.${e}`,s]))),q=(e,t)=>e===T.date?(e=>new Date(Number(e)).toLocaleDateString("en-US"))(`${t}`):t,F={enabled:"active",disabled:"disabled",invited:"invited"},B=e=>e.tenantRoles.data,E=e=>e.selectedUsersLoginIds,D=e=>e.notifications,H=e=>e.customAttributes.data,Z=j(H,(e=>Object.fromEntries(e.map((e=>[e.name,e.type]))))),V=j((e=>e.usersList.data),Z,((e,t)=>e.map((e=>Object.assign(Object.assign({},e),{customAttributes:Object.fromEntries(Object.entries(e.customAttributes).map((([e,s])=>[e,q(t[e],s)])))}))))),z=j(V,(e=>e.map((e=>Object.assign(Object.assign(Object.assign({},e),$(null==e?void 0:e.customAttributes,"customAttributes")),{status:F[e.status]||e.status,roles:e.roleNames}))))),J=j(E,z,((e,t)=>t.filter((t=>e.includes(t.loginIds))))),G=j(J,(e=>e.map((e=>e.userId)))),K=j(J,(e=>e.map((e=>e.status)))),Q=j(J,(e=>e.every((e=>e.editable)))),X=j(E,(e=>!!e.length)),Y=j(E,(e=>1===e.length)),_=j(E,(e=>{var t;return null===(t=null==e?void 0:e[0])||void 0===t?void 0:t[0]})),ee=j(Y,K,((e,t)=>e&&t.every((e=>e===F.enabled)))),te=j(K,(e=>e.every((e=>e===F.disabled)))),se=j(J,(e=>{var t;return 1===e.length?e[0].name||e[0].email||(null===(t=e[0].loginIds)||void 0===t?void 0:t[0]):`${e.length} users`})),ie=j(Y,te,Q,((e,t,s)=>e&&t&&s)),oe=j(Y,ee,Q,((e,t,s)=>e&&t&&s)),re=j(Y,Q,((e,t)=>e&&t)),ae=j(Y,Q,((e,t)=>e&&t)),ne=j(Y,Q,((e,t)=>e&&t)),de=X,le=e=>(...t)=>s=>{s.addCase(e.pending,((e,s)=>{t.forEach((({onPending:t})=>{null==t||t(e,s)}))})),s.addCase(e.fulfilled,((e,s)=>{t.forEach((({onFulfilled:t})=>{null==t||t(e,s)}))})),s.addCase(e.rejected,((e,s)=>{t.forEach((({onRejected:t})=>{null==t||t(e,s)}))}))},ue=e=>({onFulfilled:t=>{e(t).loading=!1},onPending:t=>{e(t).loading=!0,e(t).error=null},onRejected:(t,s)=>{e(t).loading=!1,e(t).error=s.error}}),ce=({getErrorMsg:e,getSuccessMsg:t})=>({onFulfilled:(e,s)=>{t&&e.notifications.push({type:"success",msg:t(s)})},onRejected:(t,s)=>{e&&t.notifications.push({type:"error",msg:e(s)})}}),he=N("users/create",((e,{extra:{api:t}})=>t.user.create(e))),ve=le(he)({onFulfilled:(e,t)=>{e.usersList.data.unshift(t.payload)}},ue((e=>e.createUser)),ce({getSuccessMsg:()=>"User created successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to create user</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),ge={action:he,reducer:ve},me=N("users/delete",((e,{extra:{api:t}})=>t.user.deleteBatch(e))),pe=le(me)({onFulfilled:(e,t)=>{e.usersList.data=e.usersList.data.filter((e=>!t.meta.arg.includes(e.userId))),e.selectedUsersLoginIds=[]}},ue((e=>e.deleteUser)),ce({getSuccessMsg:t=>e(t.meta.arg.length)`${["",t.meta.arg.length]} ${["U","u"]}ser${["","s"]} deleted successfully`,getErrorMsg:t=>e(t.meta.arg.length)`Failed to delete user${["","s"]}`})),ye={action:me,reducer:pe},fe=N("users/setTempPassword",((e,{extra:{api:t}})=>t.user.setTempPassword(e))),be=le(fe)(ue((e=>e.setTempUserPassword)),ce({getSuccessMsg:()=>"Successfully reset user password",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to reset user's password</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),we={action:fe,reducer:be},Re=N("users/getCustomAttributes",((e,{extra:{api:t}})=>t.user.getCustomAttributes())),Me=le(Re)({onFulfilled:(e,t)=>{e.customAttributes.data=t.payload}},ue((e=>e.customAttributes))),We={action:Re,reducer:Me},Pe=N("users/search",((e,{extra:{api:t},getState:s})=>{const i=s().searchParams;return t.user.search(Object.assign(Object.assign({},i),e))})),Ue=le(Pe)({onPending:(e,t)=>{e.searchParams=Object.assign(Object.assign({},e.searchParams),t.meta.arg)},onFulfilled:(e,t)=>{e.usersList.data=t.payload}},ue((e=>e.usersList))),ke={action:Pe,reducer:Ue},Ce=N("tenant/getTenantRoles",((e,{extra:{api:t}})=>t.tenant.getTenantRoles())),Se=le(Ce)({onFulfilled:(e,t)=>{e.tenantRoles.data=t.payload.roles}},ue((e=>e.tenantRoles))),xe={action:Ce,reducer:Se},Ie=N("users/update",((e,{extra:{api:t}})=>t.user.update(e))),je=le(Ie)({onFulfilled:(e,s)=>{const i=e.usersList.data.findIndex((e=>t(e.loginIds,s.payload.loginIds)));-1!==i&&(e.usersList.data[i]=s.payload)}},ue((e=>e.updateUser)),ce({getSuccessMsg:()=>"User updated successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to update user</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),Ne={action:Ie,reducer:je},Oe=N("users/enable",((e,{extra:{api:t}})=>t.user.enable(e))),Le=le(Oe)({onFulfilled:(e,s)=>{var i;const o=e.usersList.data.findIndex((e=>{var i;return t(e.loginIds,null===(i=s.payload.user)||void 0===i?void 0:i.loginIds)}));-1!==o&&(e.usersList.data[o].status=null===(i=s.payload.user)||void 0===i?void 0:i.status)}},ue((e=>e.enableUser)),ce({getSuccessMsg:()=>"User enabled successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to enable user</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),Te={action:Oe,reducer:Le},Ae=N("users/disable",((e,{extra:{api:t}})=>t.user.disable(e))),$e=le(Ae)({onFulfilled:(e,s)=>{var i;const o=e.usersList.data.findIndex((e=>{var i;return t(e.loginIds,null===(i=s.payload.user)||void 0===i?void 0:i.loginIds)}));-1!==o&&(e.usersList.data[o].status=null===(i=s.payload.user)||void 0===i?void 0:i.status)}},ue((e=>e.disableUser)),ce({getSuccessMsg:()=>"User disabled successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to disable user</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),qe={action:Ae,reducer:$e},Fe=N("users/removePasskey",((e,{extra:{api:t}})=>t.user.removePasskey(e))),Be={action:Fe,reducer:le(Fe)(ue((e=>e.removePasskey)),ce({getSuccessMsg:()=>"Successfully removed user's passkey",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to remove user's passkey</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}}))},Ee={usersList:{data:[],loading:!1,error:null},createUser:{loading:!1,error:null},updateUser:{loading:!1,error:null},deleteUser:{loading:!1,error:null},enableUser:{loading:!1,error:null},disableUser:{loading:!1,error:null},removePasskey:{loading:!1,error:null},setTempUserPassword:{loading:!1,error:null},customAttributes:{loading:!1,error:null,data:[]},tenantRoles:{loading:!1,error:null,data:[]},searchParams:{text:"",sort:[]},selectedUsersLoginIds:[],notifications:[]},De={search:"/v1/mgmt/user/search",deleteBatch:"/v1/mgmt/user/delete/batch",create:"/v1/mgmt/user/create",update:"/v1/mgmt/user/update",status:"/v1/mgmt/user/update/status",setTempPassword:"/v1/mgmt/user/password/set/temporary",removePasskey:"/v1/mgmt/user/passkeys/delete",customAttributes:"/v1/mgmt/user/customattributes"},He={roles:"/v1/mgmt/role/all"},Ze=e=>n(void 0,void 0,void 0,(function*(){const t=yield e.text(),s=JSON.parse(t);if(!e.ok){const t=`${s.errorDescription}${s.errorMessage?`: ${s.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(s),e.text=()=>Promise.resolve(t)})),Ve=e=>n(void 0,[e],void 0,(function*({text:e,sort:t}){return new Promise((s=>{const i=[];for(let e=1;e<10;e+=1)i.push({loginIds:[`user${e}@company.com`],externalIds:[`user${e}@company.com`],userId:`user-${e}`,name:`User ${e}`,email:`user${e}@company.com`,roleNames:[`Role ${e}`],phone:`+1-202-555-010${e}`,verifiedEmail:!0,verifiedPhone:!0,userTenants:[],status:"enabled",editable:!0,createdTime:(new Date).getTime(),customAttributes:{},familyName:"",givenName:"",middleName:"",picture:"",password:!0,SAML:!1,test:!1,TOTP:!1,webauthn:!1});t.forEach((e=>{i.sort(((t,s)=>{var i,o;return e.desc?null===(o=s[e.field])||void 0===o?void 0:o.localeCompare(t[e.field]):null===(i=t[e.field])||void 0===i?void 0:i.localeCompare(s[e.field])}))})),s(i.filter((t=>t.name.toLowerCase().includes(e.toLowerCase())||t.phone.toLowerCase().includes(e.toLowerCase())||t.status.toLowerCase().includes(e.toLowerCase())||"active"===e.toLowerCase()||t.familyName.toLowerCase().includes(e.toLowerCase())||t.givenName.toLowerCase().includes(e.toLowerCase())||t.middleName.toLowerCase().includes(e.toLowerCase())||t.email.toLowerCase().includes(e.toLowerCase()))))}))})),ze=e=>n(void 0,[e],void 0,(function*({loginId:e,email:t,phone:s,displayName:i,roles:o,customAttributes:r,picture:a,verifiedEmail:n,verifiedPhone:d,givenName:l,middleName:u,familyName:c}){return new Promise((h=>{const v=Math.random().toString(10).substring(15);h({loginIds:[e],externalIds:[e],userId:`user-${v}`,email:t,phone:s,name:i,roleNames:o,customAttributes:r,picture:a,verifiedEmail:n,verifiedPhone:d,givenName:l,middleName:u,familyName:c,createdTime:(new Date).getTime(),editable:!0,password:!0,SAML:!1,status:"enabled",test:!1,TOTP:!1,userTenants:[],webauthn:!1})}))})),Je=e=>n(void 0,[e],void 0,(function*({loginId:e,email:t,phone:s,displayName:i,roles:o,customAttributes:r,picture:a,verifiedEmail:n,verifiedPhone:d,givenName:l,middleName:u,familyName:c}){return new Promise((h=>{h({loginIds:[e],externalIds:[e],userId:e,email:t,phone:s,name:i,roleNames:o,customAttributes:r,picture:a,verifiedEmail:n,verifiedPhone:d,givenName:l,middleName:u,familyName:c,createdTime:(new Date).getTime(),editable:!0,password:!0,SAML:!1,status:"enabled",test:!1,TOTP:!1,userTenants:[],webauthn:!1})}))})),Ge=()=>n(void 0,void 0,void 0,(function*(){})),Ke=()=>n(void 0,void 0,void 0,(function*(){return new Promise((e=>{e({cleartext:Math.random().toString(20).substring(2)})}))})),Qe=()=>n(void 0,void 0,void 0,(function*(){})),Xe=e=>n(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({user:{loginIds:[e],status:"enabled"}})}))})),Ye=e=>n(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({user:{loginIds:[e],status:"disabled"}})}))})),_e=()=>n(void 0,void 0,void 0,(function*(){return new Promise((e=>{e([])}))})),et=e=>new Promise((t=>{const s=[];for(let t=1;t<5;t+=1)s.push({name:`Role ${t}`,description:`Role description ${t}`,createdTime:new Date,permissionNames:[`Permission ${t}`],tenantId:e});t({roles:s})})),tt=({httpClient:e,tenant:t,mock:s})=>({search:(...i)=>n(void 0,[...i],void 0,(function*({page:i,limit:o=1e4,customAttributes:r,statuses:a,emails:n,phones:d,text:l,sort:u}={}){if(s)return Ve({page:i,limit:o,customAttributes:r,statuses:a,emails:n,phones:d,text:l,sort:u});const c=yield e.post(De.search,{limit:o,page:i,withTestUser:!1,customAttributes:r,statuses:a,emails:n,phones:d,text:l,sort:u},{queryParams:{tenant:t}});yield Ze(c);return(yield c.json()).users})),deleteBatch:i=>n(void 0,void 0,void 0,(function*(){if(s)return Ge();const o=yield e.post(De.deleteBatch,{userIds:i},{queryParams:{tenant:t}});return yield Ze(o),o.json()})),create:i=>n(void 0,[i],void 0,(function*({loginId:i,email:o,phone:r,displayName:a,roles:n,customAttributes:d,picture:l,verifiedEmail:u,verifiedPhone:c,givenName:h,middleName:v,familyName:g,additionalLoginIds:m,sendSMS:p,sendMail:y,inviteUrl:f,invite:b}){if(s)return ze({loginId:i,email:o,phone:r,displayName:a,roles:n,customAttributes:d,picture:l,verifiedEmail:u,verifiedPhone:c,givenName:h,middleName:v,familyName:g,additionalLoginIds:m,sendSMS:p,sendMail:y,inviteUrl:f,invite:b});const w=yield e.post(De.create,{loginId:i,email:o,phone:r,displayName:a,givenName:h,middleName:v,familyName:g,roleNames:n,userTenants:[{tenantId:t}],customAttributes:d,picture:l,verifiedEmail:u,verifiedPhone:c,additionalLoginIds:m,sendSMS:p,sendMail:y,inviteUrl:f,invite:b},{queryParams:{tenant:t}});yield Ze(w);return(yield w.json()).user})),update:i=>n(void 0,[i],void 0,(function*({loginId:i,email:o,phone:r,displayName:a,roles:n,customAttributes:d,picture:l,verifiedEmail:u,verifiedPhone:c,givenName:h,middleName:v,familyName:g,additionalLoginIds:m}){if(s)return Je({loginId:i,email:o,phone:r,displayName:a,roles:n,customAttributes:d,picture:l,verifiedEmail:u,verifiedPhone:c,givenName:h,middleName:v,familyName:g,additionalLoginIds:m});const p=yield e.post(De.update,{loginId:i,email:o,phone:r,displayName:a,givenName:h,middleName:v,familyName:g,roleNames:n,customAttributes:d,picture:l,verifiedEmail:u,verifiedPhone:c,additionalLoginIds:m},{queryParams:{tenant:t}});yield Ze(p);return(yield p.json()).user})),enable:i=>n(void 0,void 0,void 0,(function*(){if(s)return Xe(i);const o=yield e.post(De.status,{loginId:i,status:"enabled"},{queryParams:{tenant:t}});return yield Ze(o),o.json()})),disable:i=>n(void 0,void 0,void 0,(function*(){if(s)return Ye(i);const o=yield e.post(De.status,{loginId:i,status:"disabled"},{queryParams:{tenant:t}});return yield Ze(o),o.json()})),removePasskey:i=>n(void 0,void 0,void 0,(function*(){if(s)return Qe();const o=yield e.post(De.removePasskey,{loginId:i},{queryParams:{tenant:t}});return yield Ze(o),o.json()})),setTempPassword:i=>n(void 0,void 0,void 0,(function*(){if(s)return Ke();const o=yield e.post(De.setTempPassword,{loginId:i},{queryParams:{tenant:t}});return yield Ze(o),o.json()})),getCustomAttributes:()=>n(void 0,void 0,void 0,(function*(){if(s)return _e();const i=yield e.get(De.customAttributes,{queryParams:{tenant:t}});yield Ze(i);return(yield i.json()).data}))}),st=({httpClient:e,tenant:t,mock:s})=>({getTenantRoles:()=>n(void 0,void 0,void 0,(function*(){if(s)return et(t);const i=yield e.get(He.roles,{queryParams:{tenant:t}});return yield Ze(i),i.json()}))}),it=s((e=>{var t,s,o,r;const a=i(c,h,v,g,m({tenant:m.missingAttrValidator}))(e);return r=class extends a{constructor(){super(...arguments),t.add(this),s.set(this,void 0)}get tenantId(){return this.getAttribute("tenant")}get widgetId(){return this.getAttribute("widget-id")}get mock(){return this.getAttribute("mock")}get api(){return d(this,s,"f")||d(this,t,"m",o).call(this),d(this,s,"f")}init(){const e=Object.create(null,{init:{get:()=>super.init}});return n(this,void 0,void 0,(function*(){var i;yield null===(i=e.init)||void 0===i?void 0:i.call(this),this.observeAttributes(["project-id","base-url","tenant"],(()=>{d(this,s,"f")&&d(this,t,"m",o).call(this)}))}))}},s=new WeakMap,t=new WeakSet,o=function(){this.logger.debug("creating an sdk instance"),l(this,s,((e,t,s,i)=>{const o=O(Object.assign(Object.assign({},e),{persistTokens:!0,baseHeaders:{"x-descope-widget-type":"user-management-widget","x-descope-widget-id":i,"x-descope-widget-version":"0.6.16"}}));return{user:tt({httpClient:o.httpClient,tenant:t,mock:s}),tenant:st({httpClient:o.httpClient,tenant:t,mock:s})}})({projectId:this.projectId,baseUrl:this.baseUrl},this.tenantId,"true"===this.mock,this.widgetId),"f")},r})),ot=s((e=>{const t=i(p({name:"widget",initialState:Ee,reducers:{setSelectedUsersIds:(e,{payload:t})=>{e.selectedUsersLoginIds=t},clearNotifications:e=>{e.notifications=[]}},extraReducers:e=>{ge.reducer(e),Ne.reducer(e),Te.reducer(e),qe.reducer(e),ye.reducer(e),ke.reducer(e),we.reducer(e),Be.reducer(e),We.reducer(e),xe.reducer(e)},asyncActions:{searchUsers:ke.action,createUser:ge.action,updateUser:Ne.action,enableUser:Te.action,disableUser:qe.action,deleteUsers:ye.action,removePasskey:Be.action,getCustomAttributes:We.action,getTenantRoles:xe.action,setTempUserPassword:we.action}}),y,v,it)(e);return class extends t{constructor(...e){super(...e),this.state=Ee,this.subscribe((e=>{this.logger.debug("State update:",e),this.state=e}))}}})),rt=s((e=>{const t=i(f,m({"widget-id":m.missingAttrValidator}))(e);return class extends t{get widgetId(){return this.getAttribute("widget-id")}fetchWidgetPage(e){return n(this,void 0,void 0,(function*(){return(yield this.fetchStaticResource(`user-management-widget/${this.widgetId}/${e}`,"text")).body}))}}})),at=s((e=>{var t,s,r;return r=class extends(i(v,y,b,w,rt,ot)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){return n(this,void 0,void 0,(function*(){}))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return n(this,void 0,void 0,(function*(){var i;yield null===(i=e.init)||void 0===i?void 0:i.call(this),yield Promise.all([d(this,t,"m",s).call(this),this.actions.searchUsers(),this.actions.getTenantRoles(),this.actions.getCustomAttributes()]),this.onWidgetRootReady()}))}},t=new WeakSet,s=function(){return n(this,void 0,void 0,(function*(){const e=o(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(e),this.contentRootElement.append(e.content.cloneNode(!0))}))},r})),nt=s((e=>{var t,s,r,a,u,c;return c=class extends(i(ot,R,M,v,at)(e)){constructor(){super(...arguments),t.add(this),s.set(this,void 0),u.set(this,(()=>n(this,void 0,void 0,(function*(){yield d(this,s,"f").setData(B(this.state).map((({name:e})=>({value:e,label:e}))))}))))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",r).call(this)}))}},s=new WeakMap,u=new WeakMap,t=new WeakSet,r=function(){return n(this,void 0,void 0,(function*(){this.createUserModal=this.createModal(),this.createUserModal.setContent(o(yield this.fetchWidgetPage("create-user-modal.html")));new k((()=>{var e;return null===(e=this.createUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>{this.createUserModal.close(),this.resetFormData(this.createUserModal.ele)}));new k((()=>{var e;return null===(e=this.createUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>n(this,void 0,void 0,(function*(){if(this.validateForm(this.createUserModal.ele)){const e=this.getFormData(this.createUserModal.ele);this.actions.createUser(Object.assign(Object.assign({},A(e,"customAttributes")),{invite:!0,verifiedEmail:!0,verifiedPhone:!0})),this.createUserModal.close(),this.resetFormData(this.createUserModal.ele)}})))),l(this,s,new C((()=>{var e;return null===(e=this.createUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="roles-multiselect"]')}),{logger:this.logger}),"f"),d(this,u,"f").call(this),this.createUserModal.beforeOpen=()=>n(this,void 0,void 0,(function*(){yield d(this,u,"f").call(this),d(this,t,"m",a).call(this)}))}))},a=function(){const e=H(this.state);this.getFormFieldNames(this.createUserModal.ele).forEach((t=>{const[s,i]=t.split(".");if("customAttributes"!==s)return;const o=e.find((e=>e.name===i));o?o.editable||this.disableFormField(this.createUserModal.ele,t):this.removeFormField(this.createUserModal.ele,t)}))},c})),dt=s((e=>{var t,s,o;return o=class extends(i(v,nt,at)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),d(this,t,"m",s).call(this)}))}},t=new WeakSet,s=function(){var e;this.createButton=new k(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="create-user"]'),{logger:this.logger}),this.createButton.onClick((()=>this.createUserModal.open()))},o})),lt=s((e=>{var t,s,r;return r=class extends(i(ot,R,v,at)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),yield d(this,t,"m",s).call(this)}))}},t=new WeakSet,s=function(){return n(this,void 0,void 0,(function*(){var e;this.deleteUsersModal=this.createModal(),this.deleteUsersModal.setContent(o(yield this.fetchWidgetPage("delete-users-modal.html")));const t=new k((()=>{var e;return null===(e=this.deleteUsersModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.deleteUsersModal.close()));const s=new k((()=>{var e;return null===(e=this.deleteUsersModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});s.onClick((()=>{const e=G(this.state);this.actions.deleteUsers(e),this.deleteUsersModal.close()}));const i=new S(null===(e=this.deleteUsersModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.deleteUsersModal.beforeOpen=()=>{const e=se(this.state);i.text=`Delete ${e}?`}}))},r})),ut=s((e=>{var t,s,o,a;return a=class extends(i(v,at,ot,lt)(e)){constructor(){super(...arguments),t.add(this),o.set(this,r((e=>{e?this.deleteButton.enable():this.deleteButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;d(this,t,"m",s).call(this),yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),this.subscribe(d(this,o,"f").bind(this),de)}))}},o=new WeakMap,t=new WeakSet,s=function(){var e;this.deleteButton=new k(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="delete-users"]'),{logger:this.logger}),this.deleteButton.disable(),this.deleteButton.onClick((()=>{this.deleteUsersModal.open()}))},a})),ct=s((e=>{var t,s,r,a,l;return l=class extends(i(ot,R,v,M,at)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",a).call(this)}))}},t=new WeakSet,s=function(){new k((()=>{var e;return null===(e=this.disableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.disableUserModal.close()))},r=function(){new k((()=>{var e;return null===(e=this.disableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>{const e=_(this.state);this.actions.disableUser(e),this.disableUserModal.close()}))},a=function(){return n(this,void 0,void 0,(function*(){var e;this.disableUserModal=this.createModal(),this.disableUserModal.setContent(o(yield this.fetchWidgetPage("disable-user-modal.html"))),d(this,t,"m",s).call(this),d(this,t,"m",r).call(this);const i=new S(null===(e=this.disableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.disableUserModal.beforeOpen=()=>n(this,void 0,void 0,(function*(){const e=se(this.state);i.text=`Disable ${e}?`}))}))},l})),ht=s((e=>{var t,s,o,a;return a=class extends(i(v,at,ot,ct,M)(e)){constructor(){super(...arguments),t.add(this),o.set(this,r((e=>{e?this.disableButton.enable():this.disableButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;d(this,t,"m",s).call(this),yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),this.subscribe(d(this,o,"f").bind(this),oe)}))}},o=new WeakMap,t=new WeakSet,s=function(){var e;this.disableButton=new k(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="disable-user"]'),{logger:this.logger}),this.disableButton.disable(),this.disableButton.onClick((()=>{this.disableUserModal.open()}))},a})),vt=e=>{if(!e)return e;const t=L(e),s=new RegExp(`(\\+?${null==t?void 0:t.countryCallingCode})(.*)`);return t.number.replace(s,"$1-$2")},gt=s((e=>{var t,s,r,a,c,h,g,m,p,y;return y=class extends(i(ot,R,v,M,at)(e)){constructor(){super(...arguments),t.add(this),s.set(this,void 0),r.set(this,void 0),h.set(this,(()=>n(this,void 0,void 0,(function*(){yield d(this,r,"f").setData(B(this.state).map((({name:e})=>({value:e,label:e}))))})))),m.set(this,(()=>{var e,t;const s=null===(e=J(this.state))||void 0===e?void 0:e[0],i=Object.assign({loginId:null===(t=null==s?void 0:s.loginIds)||void 0===t?void 0:t.join(", "),displayName:null==s?void 0:s.name,email:null==s?void 0:s.email,phone:vt(null==s?void 0:s.phone),roles:null==s?void 0:s.roles},$(s.customAttributes,"customAttributes"));this.setFormData(this.editUserModal.ele,i)}))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",p).call(this)}))}},s=new WeakMap,r=new WeakMap,h=new WeakMap,m=new WeakMap,t=new WeakSet,a=function(){new k((()=>{var e;return null===(e=this.editUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.editUserModal.close()))},c=function(){new k((()=>{var e;return null===(e=this.editUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>{if(this.validateForm(this.editUserModal.ele)){const e=this.getFormData(this.editUserModal.ele),{loginId:t}=e,s=u(e,["loginId"]);this.actions.updateUser(Object.assign({loginId:t.split(", ")[0]},A(s,"customAttributes"))),this.editUserModal.close(),this.resetFormData(this.editUserModal.ele)}}))},g=function(){const e=H(this.state);this.getFormFieldNames(this.editUserModal.ele).forEach((t=>{const[s,i]=t.split(".");if("customAttributes"!==s)return;const o=e.find((e=>e.name===i));o?o.editable||this.disableFormField(this.editUserModal.ele,t):this.removeFormField(this.editUserModal.ele,t)}))},p=function(){return n(this,void 0,void 0,(function*(){var e;this.editUserModal=this.createModal(),this.editUserModal.setContent(o(yield this.fetchWidgetPage("edit-user-modal.html"))),d(this,t,"m",a).call(this),d(this,t,"m",c).call(this),l(this,s,new x(null===(e=this.editUserModal.ele)||void 0===e?void 0:e.querySelector('[name="loginId"]'),{logger:this.logger}),"f"),l(this,r,new C((()=>{var e;return null===(e=this.editUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="roles-multiselect"]')}),{logger:this.logger}),"f"),this.editUserModal.beforeOpen=()=>n(this,void 0,void 0,(function*(){yield d(this,h,"f").call(this),d(this,s,"f").disable(),d(this,m,"f").call(this),d(this,t,"m",g).call(this)}))}))},y})),mt=s((e=>{var t,s,o,a;return a=class extends(i(v,at,ot,gt,M)(e)){constructor(){super(...arguments),t.add(this),o.set(this,r((e=>{e?this.editButton.enable():this.editButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;d(this,t,"m",s).call(this),yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),this.subscribe(d(this,o,"f").bind(this),re)}))}},o=new WeakMap,t=new WeakSet,s=function(){var e;this.editButton=new k(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="edit-user"]'),{logger:this.logger}),this.editButton.disable(),this.editButton.onClick((()=>{this.editUserModal.open()}))},a})),pt=s((e=>{var t,s,r,a,l;return l=class extends(i(ot,R,v,M,at)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",a).call(this)}))}},t=new WeakSet,s=function(){new k((()=>{var e;return null===(e=this.enableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.enableUserModal.close()))},r=function(){new k((()=>{var e;return null===(e=this.enableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>{const e=_(this.state);this.actions.enableUser(e),this.enableUserModal.close()}))},a=function(){return n(this,void 0,void 0,(function*(){var e;this.enableUserModal=this.createModal(),this.enableUserModal.setContent(o(yield this.fetchWidgetPage("enable-user-modal.html"))),d(this,t,"m",s).call(this),d(this,t,"m",r).call(this);const i=new S(null===(e=this.enableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.enableUserModal.beforeOpen=()=>n(this,void 0,void 0,(function*(){const e=se(this.state);i.text=`Activate ${e}?`}))}))},l})),yt=s((e=>{var t,s,o,a;return a=class extends(i(v,at,ot,pt,M)(e)){constructor(){super(...arguments),t.add(this),o.set(this,r((e=>{e?this.enableButton.enable():this.enableButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;d(this,t,"m",s).call(this),yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),this.subscribe(d(this,o,"f").bind(this),ie)}))}},o=new WeakMap,t=new WeakSet,s=function(){var e;this.enableButton=new k(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="enable-user"]'),{logger:this.logger}),this.enableButton.disable(),this.enableButton.onClick((()=>{this.enableUserModal.open()}))},a})),ft=s((e=>{var t,s,o,r;return r=class extends(i(v,at,ot)(e)){constructor(){super(...arguments),t.add(this),s.set(this,a((()=>{this.actions.searchUsers({text:this.searchInput.value})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",o).call(this)}))}},s=new WeakMap,t=new WeakSet,o=function(){var e;this.searchInput=new x(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="search-input"]'),{logger:this.logger}),this.searchInput.onInput(d(this,s,"f"))},r}));const bt={success:(new DOMParser).parseFromString('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Checkmark">\n<path id="Shape" d="M10.0485 15.6396C9.5799 15.171 8.8201 15.171 8.35147 15.6396C7.88284 16.1082 7.88284 16.868 8.35147 17.3367L12.7072 21.6924C13.1759 22.1611 13.9357 22.1611 14.4043 21.6924L24.7152 11.3815C25.1838 10.9129 25.1838 10.1531 24.7152 9.68448C24.2466 9.21585 23.4868 9.21585 23.0181 9.68448L13.5558 19.1469L10.0485 15.6396Z" fill="currentcolor"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild,error:(new DOMParser).parseFromString('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Icon">\n<path id="Vector" d="M15.9998 26.6558C10.1118 26.6558 5.34375 21.8878 5.34375 15.9998C5.34375 10.1118 10.1118 5.34375 15.9998 5.34375C21.8878 5.34375 26.6558 10.1118 26.6558 15.9998C26.6558 21.8878 21.8878 26.6558 15.9998 26.6558ZM15.9998 24.4798C20.6718 24.4798 24.4798 20.7038 24.4798 15.9998C24.4798 11.3278 20.7038 7.51975 15.9998 7.51975C11.3278 7.51975 7.51975 11.2958 7.51975 15.9998C7.51975 20.6718 11.2958 24.4798 15.9998 24.4798ZM15.3278 9.34375H16.6718C17.0558 9.34375 17.3438 9.63175 17.3118 9.98375L16.9598 16.9278C16.9598 17.1838 16.7678 17.3438 16.5438 17.3438H15.4558C15.2318 17.3438 15.0398 17.1518 15.0398 16.9278L14.6878 9.98375C14.6878 9.63175 14.9758 9.34375 15.3278 9.34375ZM15.4558 19.4558H16.5438C16.9278 19.4558 17.2158 19.7438 17.1838 20.1278V21.1838C17.1838 21.5678 16.8958 21.8558 16.5438 21.8558H15.4558C15.0718 21.8558 14.7838 21.5678 14.7838 21.1838V20.1278C14.7838 19.7438 15.0718 19.4558 15.4558 19.4558Z" fill="currentcolor"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild},wt=s((e=>{var t,s,o,a,l;return l=class extends(i(v,ot,W,y)(e)){constructor(){super(...arguments),t.add(this),a.set(this,r((e=>{e.length&&(e.forEach((({type:e,msg:i})=>{const r=d(this,t,"m",o).call(this,e);r.setContent(d(this,t,"m",s).call(this,{type:e,msg:i})),r.show()})),setTimeout((()=>this.actions.clearNotifications())))})))}init(){const e=Object.create(null,{init:{get:()=>super.init}});return n(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this),this.subscribe(d(this,a,"f").bind(this),D)}))}},a=new WeakMap,t=new WeakSet,s=function({type:e,msg:t}){const s=bt[e],i=Object.assign((new DOMParser).parseFromString('<svg width="2em" height="2em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Icon">\n<path id="Shape" d="M10.6712 12L7.27521 8.60406C6.90826 8.23711 6.90826 7.64216 7.27521 7.27521C7.64216 6.90826 8.23711 6.90826 8.60406 7.27521L12 10.6712L15.3959 7.27521C15.7629 6.90826 16.3578 6.90826 16.7248 7.27521C17.0917 7.64216 17.0917 8.23711 16.7248 8.60406L13.3288 12L16.7248 15.3959C17.0917 15.7629 17.0917 16.3578 16.7248 16.7248C16.3578 17.0917 15.7629 17.0917 15.3959 16.7248L12 13.3288L8.60406 16.7248C8.23711 17.0917 7.64216 17.0917 7.27521 16.7248C6.90826 16.3578 6.90826 15.7629 7.27521 15.3959L10.6712 12Z" fill="currentcolor"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild,{slot:"close"});return`${(null==s?void 0:s.outerHTML)||""}${t}${i.outerHTML}`},o=function(e){return this.createNotification({mode:e,duration:"error"===e?0:3e3,position:"bottom-start",size:"sm"})},l})),Rt=s((e=>{var t,s,r,a,l;return l=class extends(i(ot,R,v,M,at)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",a).call(this)}))}},t=new WeakSet,s=function(){new k((()=>{var e;return null===(e=this.removePasskeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.removePasskeyModal.close()))},r=function(){new k((()=>{var e;return null===(e=this.removePasskeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>{const e=_(this.state);this.actions.removePasskey(e),this.removePasskeyModal.close()}))},a=function(){return n(this,void 0,void 0,(function*(){var e;this.removePasskeyModal=this.createModal(),this.removePasskeyModal.setContent(o(yield this.fetchWidgetPage("remove-passkey-modal.html"))),d(this,t,"m",s).call(this),d(this,t,"m",r).call(this);const i=new S(null===(e=this.removePasskeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.removePasskeyModal.beforeOpen=()=>n(this,void 0,void 0,(function*(){const e=se(this.state);i.text=`Remove passkey for ${e}?`}))}))},l})),Mt=s((e=>{var t,s,o,a;return a=class extends(i(v,at,ot,Rt,M)(e)){constructor(){super(...arguments),t.add(this),o.set(this,r((e=>{e?this.removePasskeyButton.enable():this.removePasskeyButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;d(this,t,"m",s).call(this),yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),this.subscribe(d(this,o,"f").bind(this),ae)}))}},o=new WeakMap,t=new WeakSet,s=function(){var e;this.removePasskeyButton=new k(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="remove-passkey"]'),{logger:this.logger}),this.removePasskeyButton.disable(),this.removePasskeyButton.onClick((()=>{this.removePasskeyModal.open()}))},a})),Wt=s((e=>{var t,s,o,l,u,c,h,g;return g=class extends(i(ot,v,at)(e)){constructor(){super(...arguments),t.add(this),l.set(this,r((e=>{this.usersTable.data=e}))),u.set(this,a(((e,t)=>{const s=[],{value:i}=t;if(i){const t=e.path;s.push({field:t,desc:"desc"===i})}this.actions.searchUsers({sort:s})}))),c.set(this,r((e=>{this.usersTable.filterColumns((t=>{var s;const[i,o]=(null===(s=t.path)||void 0===s?void 0:s.split("."))||[];return"customAttributes"!==i||!!(null==e?void 0:e.find((e=>e.name===o)))}))})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),d(this,t,"m",o).call(this),d(this,l,"f").call(this,z(this.state)),d(this,c,"f").call(this,H(this.state)),this.subscribe(d(this,c,"f").bind(this),H),this.subscribe(d(this,l,"f").bind(this),z)}))}},l=new WeakMap,u=new WeakMap,c=new WeakMap,t=new WeakSet,s=function(){const e=e=>{var t;return null===(t=this.usersTable.ele)||void 0===t?void 0:t.querySelector(`[path="${e}"]`)},t=e=>{var t;const s=`descope-grid-${e}-column`;return null===(t=this.usersTable.ele)||void 0===t?void 0:t.querySelector(s)},s=this.usersTable.renderColumn;this.usersTable.renderColumn=({path:i,header:o,type:r,attrs:a})=>{const n=e(i)||t(r);if(!n)return s({path:i,header:o,type:r,attrs:a});const d=n.cloneNode(!0),l=Object.assign(Object.assign({},a),{header:o});return Object.entries(l).forEach((([e,t])=>{d.setAttribute(e,t)})),d.outerHTML}},o=function(){var e;this.usersTable=new I(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="users-table"]'),{logger:this.logger}),this.usersTable.onSelectedItemsChange((e=>{this.actions.setSelectedUsersIds(e.detail.value.map((({loginIds:e})=>e)))})),this.usersTable.onColumnsChange(d(this,t,"m",h).bind(this)),d(this,t,"m",s).call(this),d(this,t,"m",h).call(this)},h=function(){this.usersTable.columns.forEach((e=>{e.onSortDirectionChange((e=>{d(this,u,"f").call(this,e.target,e.detail)}))}))},g})),Pt=s((e=>{var t,s,r;return r=class extends(i(ot,R,v,M,at)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),yield d(this,t,"m",s).call(this)}))}},t=new WeakSet,s=function(){return n(this,void 0,void 0,(function*(){this.generatedPasswordModal=this.createModal(),this.generatedPasswordModal.setContent(o(yield this.fetchWidgetPage("generated-password-modal.html")));new k((()=>{var e;return null===(e=this.generatedPasswordModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-close"]')}),{logger:this.logger}).onClick((()=>{navigator.clipboard.writeText(this.getFormData(this.generatedPasswordModal.ele)["generated-password"]),this.resetFormData(this.generatedPasswordModal.ele),this.generatedPasswordModal.close()}))}))},r})),Ut=s((e=>{var t,s,r,a,l;return l=class extends(i(ot,R,v,M,at,Pt)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var s;yield null===(s=e.onWidgetRootReady)||void 0===s?void 0:s.call(this),yield d(this,t,"m",a).call(this)}))}},t=new WeakSet,s=function(){new k((()=>{var e;return null===(e=this.resetPasswordModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.resetPasswordModal.close()))},r=function(){new k((()=>{var e;return null===(e=this.resetPasswordModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>n(this,void 0,void 0,(function*(){var e;const t=_(this.state),s=yield this.actions.setTempUserPassword(t);this.resetPasswordModal.close(),this.setFormData(this.generatedPasswordModal.ele,{"generated-password":null===(e=null==s?void 0:s.payload)||void 0===e?void 0:e.cleartext}),this.generatedPasswordModal.open()}))))},a=function(){return n(this,void 0,void 0,(function*(){var e;this.resetPasswordModal=this.createModal(),this.resetPasswordModal.setContent(o(yield this.fetchWidgetPage("reset-password-modal.html"))),d(this,t,"m",s).call(this),d(this,t,"m",r).call(this);const i=new S(null===(e=this.resetPasswordModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.resetPasswordModal.beforeOpen=()=>n(this,void 0,void 0,(function*(){const e=se(this.state);i.text=`This will generate a new temporary password for ${e}?`}))}))},l})),kt=s((e=>{var t,s,o,a;return a=class extends(i(v,at,ot,Ut,M)(e)){constructor(){super(...arguments),t.add(this),o.set(this,r((e=>{e?this.resetPasswordButton.enable():this.resetPasswordButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});return n(this,void 0,void 0,(function*(){var i;d(this,t,"m",s).call(this),yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),this.subscribe(d(this,o,"f").bind(this),ne)}))}},o=new WeakMap,t=new WeakSet,s=function(){var e;this.resetPasswordButton=new k(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="reset-password"]'),{logger:this.logger}),this.resetPasswordButton.disable(),this.resetPasswordButton.onClick((()=>{this.resetPasswordModal.open()}))},a})),Ct=s((e=>class extends(i(P,U,Wt,dt,ut,mt,yt,ht,kt,Mt,ft,wt)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});return n(this,void 0,void 0,(function*(){var t;yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),St=i((e=>class extends(Ct(e)){}))(HTMLElement);customElements.define("descope-user-management-widget",St);export{St as default};
6
6
  //# sourceMappingURL=index.js.map
package/dist/index.d.ts CHANGED
@@ -161,7 +161,7 @@ declare const UserManagementWidget: {
161
161
  close(): void;
162
162
  show(): void;
163
163
  remove(): void;
164
- "__#24341@#private": any;
164
+ "__#27133@#private": any;
165
165
  logger: {
166
166
  error(...data: any[]): void;
167
167
  warn(...data: any[]): void;
@@ -175,11 +175,11 @@ declare const UserManagementWidget: {
175
175
  type: "success" | "error";
176
176
  msg: string;
177
177
  }[]) => void;
178
- "__#24333@#isInit": boolean;
179
- connectedCallback: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & {
178
+ "__#27124@#isInit": boolean;
179
+ connectedCallback: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & {
180
180
  (): void;
181
181
  (): void;
182
- } & (() => 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);
182
+ } & (() => 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);
183
183
  accessKey: string;
184
184
  readonly accessKeyLabel: string;
185
185
  autocapitalize: string;
@@ -1173,7 +1173,7 @@ declare const UserManagementWidget: {
1173
1173
  tabIndex: number;
1174
1174
  blur: (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
1175
1175
  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) & ((options?: FocusOptions) => void);
1176
- "__#24345@#NotificationDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
1176
+ "__#27137@#NotificationDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
1177
1177
  logger: {
1178
1178
  error(...data: any[]): void;
1179
1179
  warn(...data: any[]): void;
@@ -1186,7 +1186,7 @@ declare const UserManagementWidget: {
1186
1186
  close(): void;
1187
1187
  show(): void;
1188
1188
  remove(): void;
1189
- "__#24341@#private": any;
1189
+ "__#27133@#private": any;
1190
1190
  logger: {
1191
1191
  error(...data: any[]): void;
1192
1192
  warn(...data: any[]): void;
@@ -1211,7 +1211,7 @@ declare const UserManagementWidget: {
1211
1211
  close(): void;
1212
1212
  show(): void;
1213
1213
  remove(): void;
1214
- "__#24341@#private": any;
1214
+ "__#27133@#private": any;
1215
1215
  logger: {
1216
1216
  error(...data: any[]): void;
1217
1217
  warn(...data: any[]): void;
@@ -1221,49 +1221,36 @@ declare const UserManagementWidget: {
1221
1221
  readonly asyncEle: Promise<Element>;
1222
1222
  readonly ele: Element;
1223
1223
  };
1224
- "__#24340@#errorCbsSym": symbol;
1225
- "__#24340@#loadCbsSym": symbol;
1226
- "__#24340@#getComponentsVersion": (() => Promise<any>) & (() => Promise<any>) & (() => Promise<any>) & (() => Promise<any>);
1227
- "__#24340@#exposeAlternateEvents": ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void);
1228
- "__#24340@#handleFallbackScript": ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[], elemId: string, scriptUrl: string) => Promise<void>) & ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[], elemId: string, scriptUrl: string) => Promise<void>) & ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[], elemId: string, scriptUrl: string) => Promise<void>) & ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[], elemId: string, scriptUrl: string) => Promise<void>);
1229
- "__#24340@#registerEvents": ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void);
1230
- "__#24340@#getDescopeUiLoadingScript": (() => Promise<HTMLElement>) & (() => Promise<HTMLElement>) & (() => Promise<HTMLElement>) & (() => Promise<HTMLElement>);
1231
- "__#24340@#descopeUi": Promise<any>;
1224
+ "__#27132@#errorCbsSym": symbol;
1225
+ "__#27132@#loadCbsSym": symbol;
1226
+ "__#27132@#getComponentsVersion": (() => Promise<string>) & (() => Promise<string>) & (() => Promise<string>) & (() => Promise<string>);
1227
+ "__#27132@#exposeAlternateEvents": ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void);
1228
+ "__#27132@#handleFallbackScript": ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[], elemId: string, scriptUrl: string) => Promise<void>) & ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[], elemId: string, scriptUrl: string) => Promise<void>) & ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[], elemId: string, scriptUrl: string) => Promise<void>) & ((errorCbs: ((error: string) => void)[], loadCbs: (() => void)[], elemId: string, scriptUrl: string) => Promise<void>);
1229
+ "__#27132@#registerEvents": ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void) & ((scriptEle: HTMLScriptElement) => void);
1230
+ "__#27132@#getDescopeUiLoadingScript": (() => Promise<HTMLElement>) & (() => Promise<HTMLElement>) & (() => Promise<HTMLElement>) & (() => Promise<HTMLElement>);
1231
+ "__#27132@#descopeUi": Promise<any>;
1232
1232
  readonly descopeUi: Promise<any>;
1233
- "__#24340@#loadDescopeUiComponent": ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>);
1233
+ "__#27132@#loadDescopeUiComponent": ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>) & ((componentName: string) => Promise<any>);
1234
1234
  loadDescopeUiComponents: ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>) & ((templateOrComponentNames: string[] | HTMLTemplateElement) => Promise<any[]>);
1235
- "__#24340@#getDescopeUi": (() => Promise<unknown>) & (() => Promise<unknown>) & (() => Promise<unknown>) & (() => Promise<unknown>);
1236
- readonly config: any;
1237
- "__#24337@#_configResource": any;
1238
- "__#24337@#fetchConfig": (() => Promise<{
1239
- projectConfig: _descope_sdk_mixins.ProjectConfiguration;
1240
- executionContext: {
1241
- geo: any;
1242
- };
1243
- }>) & (() => Promise<{
1244
- projectConfig: _descope_sdk_mixins.ProjectConfiguration;
1245
- executionContext: {
1246
- geo: any;
1247
- };
1248
- }>) & (() => Promise<{
1249
- projectConfig: _descope_sdk_mixins.ProjectConfiguration;
1250
- executionContext: {
1251
- geo: any;
1252
- };
1253
- }>) & (() => Promise<{
1254
- projectConfig: _descope_sdk_mixins.ProjectConfiguration;
1255
- executionContext: {
1256
- geo: any;
1257
- };
1258
- }>) & (() => Promise<{
1259
- projectConfig: _descope_sdk_mixins.ProjectConfiguration;
1260
- executionContext: {
1261
- geo: any;
1262
- };
1263
- }>);
1264
- "__#24336@#lastBaseUrl"?: string;
1265
- "__#24336@#workingBaseUrl"?: string;
1266
- "__#24336@#getResourceUrls": ((filename: string) => (URL & {
1235
+ "__#27132@#getDescopeUi": (() => Promise<unknown>) & (() => Promise<unknown>) & (() => Promise<unknown>) & (() => Promise<unknown>);
1236
+ readonly config: Promise<_descope_sdk_mixins.Config>;
1237
+ "__#27129@#configCacheClear": (() => void) & (() => void) & (() => void) & (() => void) & (() => void);
1238
+ "__#27129@#_configResource": Promise<_descope_sdk_mixins.Config>;
1239
+ "__#27129@#fetchConfig": (() => Promise<_descope_sdk_mixins.Config>) & (() => Promise<_descope_sdk_mixins.Config>) & (() => Promise<_descope_sdk_mixins.Config>) & (() => Promise<_descope_sdk_mixins.Config>) & (() => Promise<_descope_sdk_mixins.Config>);
1240
+ "__#27128@#callbacks": Map<string, () => void> & Map<string, () => void> & Map<string, () => void> & Map<string, () => void> & Map<string, () => void>;
1241
+ 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) & ((sectionId: string, callback: () => void | Promise<void>) => () => void);
1242
+ reset: ((...sectionIds: string[]) => Promise<void>) & ((...sectionIds: string[]) => Promise<void>) & ((...sectionIds: string[]) => Promise<void>) & ((...sectionIds: string[]) => Promise<void>) & ((...sectionIds: string[]) => Promise<void>);
1243
+ "__#27126@#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) & ((attrName: string, newValue: string) => void) & ((attrName: string, newValue: string) => void);
1244
+ "__#27125@#observeMappings": {};
1245
+ 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);
1246
+ 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);
1247
+ "__#27123@#logger": _descope_sdk_mixins.Logger;
1248
+ "__#27123@#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);
1249
+ logger: _descope_sdk_mixins.Logger;
1250
+ 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);
1251
+ "__#27127@#lastBaseUrl"?: string;
1252
+ "__#27127@#workingBaseUrl"?: string;
1253
+ "__#27127@#getResourceUrls": ((filename: string) => (URL & {
1267
1254
  baseUrl: string;
1268
1255
  }) | (URL & {
1269
1256
  baseUrl: string;
@@ -1317,14 +1304,6 @@ declare const UserManagementWidget: {
1317
1304
  readonly baseStaticUrl: string;
1318
1305
  readonly baseUrl: string;
1319
1306
  readonly projectId: string;
1320
- "__#24335@#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);
1321
- "__#24334@#observeMappings": {};
1322
- 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);
1323
- 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);
1324
- "__#24332@#logger": _descope_sdk_mixins.Logger;
1325
- "__#24332@#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);
1326
- logger: _descope_sdk_mixins.Logger;
1327
- 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", args: any[]) => void);
1328
1307
  contentRootElement: HTMLElement;
1329
1308
  rootElement: HTMLElement;
1330
1309
  state: State;
@@ -18596,7 +18575,7 @@ declare const UserManagementWidget: {
18596
18575
  "__#19@#initCancelButton"(): void;
18597
18576
  "__#19@#initSubmitButton"(): void;
18598
18577
  "__#19@#initRemovePasskeyModal"(): Promise<void>;
18599
- "__#24344@#ModalDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
18578
+ "__#27136@#ModalDriverWrapper": new (refOrRefFn: Element | (() => HTMLElement), config: {
18600
18579
  logger: {
18601
18580
  error(...data: any[]): void;
18602
18581
  warn(...data: any[]): void;
@@ -18605,7 +18584,7 @@ declare const UserManagementWidget: {
18605
18584
  };
18606
18585
  }) => {
18607
18586
  setContent(template: HTMLTemplateElement): void;
18608
- "__#24343@#private": any;
18587
+ "__#27135@#private": any;
18609
18588
  beforeOpen: () => void | Promise<void>;
18610
18589
  afterClose: () => void;
18611
18590
  nodeName: string;
@@ -18613,7 +18592,7 @@ declare const UserManagementWidget: {
18613
18592
  open(): Promise<void>;
18614
18593
  reset(): void;
18615
18594
  remove(): void;
18616
- "__#24341@#private": any;
18595
+ "__#27133@#private": any;
18617
18596
  logger: {
18618
18597
  error(...data: any[]): void;
18619
18598
  warn(...data: any[]): void;
@@ -18707,23 +18686,23 @@ declare const UserManagementWidget: {
18707
18686
  "__#21@#onColumnSortChange": (this: any, ...args: any[]) => void;
18708
18687
  "__#21@#onCustomAttrsUpdate": (customAttrs: CustomAttr[]) => void;
18709
18688
  "__#21@#registerSortColumnEvent"(): void;
18710
- "__#24346@#globalStyleTag": HTMLStyleElement;
18689
+ "__#27138@#globalStyleTag": HTMLStyleElement;
18711
18690
  readonly theme: _descope_sdk_mixins.ThemeOptions;
18712
18691
  readonly styleId: string;
18713
- "__#24346@#_themeResource": Promise<void | Record<string, any>>;
18714
- "__#24346@#fetchTheme"(): Promise<Record<string, any>>;
18715
- readonly "__#24346@#themeResource": Promise<void | Record<string, any>>;
18716
- "__#24346@#loadGlobalStyle"(): Promise<void>;
18717
- "__#24346@#loadComponentsStyle"(): Promise<void>;
18718
- "__#24346@#getFontsConfig"(): Promise<Record<string, {
18692
+ "__#27138@#_themeResource": Promise<void | Record<string, any>>;
18693
+ "__#27138@#fetchTheme"(): Promise<Record<string, any>>;
18694
+ readonly "__#27138@#themeResource": Promise<void | Record<string, any>>;
18695
+ "__#27138@#loadGlobalStyle"(): Promise<void>;
18696
+ "__#27138@#loadComponentsStyle"(): Promise<void>;
18697
+ "__#27138@#getFontsConfig"(): Promise<Record<string, {
18719
18698
  url?: string;
18720
18699
  }>>;
18721
- "__#24346@#loadFonts"(): Promise<void>;
18722
- "__#24346@#applyTheme"(): Promise<void>;
18723
- "__#24346@#onThemeChange": () => void;
18724
- "__#24346@#loadTheme"(): void;
18725
- "__#24346@#toggleOsThemeChangeListener": (listen: boolean) => void;
18726
- "__#24339@#debuggerEle": HTMLElement & {
18700
+ "__#27138@#loadFonts"(): Promise<void>;
18701
+ "__#27138@#applyTheme"(): Promise<void>;
18702
+ "__#27138@#onThemeChange": () => void;
18703
+ "__#27138@#loadTheme"(): void;
18704
+ "__#27138@#toggleOsThemeChangeListener": (listen: boolean) => void;
18705
+ "__#27131@#debuggerEle": HTMLElement & {
18727
18706
  updateData: (data: {
18728
18707
  title: string;
18729
18708
  description?: string;
@@ -18732,11 +18711,11 @@ declare const UserManagementWidget: {
18732
18711
  description?: string;
18733
18712
  }[]) => void;
18734
18713
  };
18735
- "__#24339@#disableDebugger"(): void;
18736
- "__#24339@#enableDebugger"(): Promise<void>;
18714
+ "__#27131@#disableDebugger"(): void;
18715
+ "__#27131@#enableDebugger"(): Promise<void>;
18737
18716
  readonly debug: boolean;
18738
- "__#24339@#handleDebugMode"(): void;
18739
- "__#24339@#updateDebuggerMessages"(title: string, description: string): void;
18717
+ "__#27131@#handleDebugMode"(): void;
18718
+ "__#27131@#updateDebuggerMessages"(title: string, description: string): void;
18740
18719
  };
18741
18720
  };
18742
18721