@microsoft/mgt-spfx
Version:
SharePoint Framework library for Microsoft Graph Toolkit
8 lines • 861 kB
JavaScript
/*! For license information please see mgt-library_bddc01f473120a2fe4a4.js.LICENSE.txt */
define("78b11c7d-7ca8-47cb-a93c-d3beabb519a1_3.1.3",["@microsoft/microsoft-graph-client"],function(n){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="mwqp")}({EKCE:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},EYXE:function(e,t){e.exports=n},mwqp:function(e,t,n){"use strict";n.r(t),n.d(t,"MgtLibrary",function(){return a}),n.d(t,"SharePointProvider",function(){return Ft}),n.d(t,"MgtAgenda",function(){return Wl}),n.d(t,"MgtFile",function(){return pu}),n.d(t,"MgtFileList",function(){return Kf}),n.d(t,"MgtPicker",function(){return kp}),n.d(t,"MgtTaxonomyPicker",function(){return Fp}),n.d(t,"isCollectionResponse",function(){return Np}),n.d(t,"ResponseType",function(){return Bp}),n.d(t,"MgtGet",function(){return Vp}),n.d(t,"MgtLogin",function(){return Jp}),n.d(t,"GroupType",function(){return Xp}),n.d(t,"PersonType",function(){return dn}),n.d(t,"UserType",function(){return ln}),n.d(t,"MgtPeoplePicker",function(){return vm}),n.d(t,"PersonCardInteraction",function(){return Yn}),n.d(t,"MgtPeople",function(){return Ia}),n.d(t,"MgtPersonCard",function(){return Qm}),n.d(t,"defaultPersonProperties",function(){return sa}),n.d(t,"MgtPerson",function(){return ca}),n.d(t,"PersonViewType",function(){return Xn}),n.d(t,"avatarType",function(){return Zn}),n.d(t,"TasksSource",function(){return z_}),n.d(t,"MgtTasks",function(){return J_}),n.d(t,"MgtTeamsChannelPicker",function(){return Sh}),n.d(t,"MgtTodo",function(){return lb}),n.d(t,"MgtContact",function(){return wm}),n.d(t,"MgtMessages",function(){return Lm}),n.d(t,"MgtOrganization",function(){return Pm}),n.d(t,"MgtProfile",function(){return Fm}),n.d(t,"MgtThemeToggle",function(){return Cb}),n.d(t,"MgtSearchBox",function(){return Nb}),n.d(t,"MgtSearchResults",function(){return Kb}),n.d(t,"ViewType",function(){return jn}),n.d(t,"applyTheme",function(){return vb}),n.d(t,"isGroup",function(){return ea}),n.d(t,"isUser",function(){return ta}),n.d(t,"isContact",function(){return na}),n.d(t,"BatchResponse",function(){return i}),n.d(t,"MICROSOFT_GRAPH_DEFAULT_ENDPOINT",function(){return r}),n.d(t,"MICROSOFT_GRAPH_ENDPOINTS",function(){return o}),n.d(t,"Graph",function(){return C}),n.d(t,"createFromProvider",function(){return O}),n.d(t,"BetaGraph",function(){return w}),n.d(t,"ComponentMediaQuery",function(){return Ve}),n.d(t,"MgtBaseComponent",function(){return Ge}),n.d(t,"MgtBaseProvider",function(){return qe}),n.d(t,"MgtTemplatedComponent",function(){return et}),n.d(t,"customElementHelper",function(){return x}),n.d(t,"IProvider",function(){return u}),n.d(t,"LoginType",function(){return s}),n.d(t,"ProviderState",function(){return c}),n.d(t,"Providers",function(){return m}),n.d(t,"ProvidersChangedState",function(){return f}),n.d(t,"SimpleProvider",function(){return tt}),n.d(t,"dbListKey",function(){return yt}),n.d(t,"CacheService",function(){return St}),n.d(t,"CacheStore",function(){return vt}),n.d(t,"EventDispatcher",function(){return l}),n.d(t,"equals",function(){return Qe}),n.d(t,"arraysAreEqual",function(){return Je}),n.d(t,"prepScopes",function(){return _}),n.d(t,"chainMiddleware",function(){return h}),n.d(t,"validateBaseURL",function(){return b}),n.d(t,"TeamsHelper",function(){return Dt}),n.d(t,"TemplateHelper",function(){return Xe}),n.d(t,"GraphPageIterator",function(){return xt}),n.d(t,"LocalizationHelper",function(){return je}),n.d(t,"mgtHtml",function(){return wt}),n.d(t,"customElement",function(){return Et}),n.d(t,"PACKAGE_VERSION",function(){return I}),n.d(t,"MockProvider",function(){return Tt});var a=function(){function e(){}return e.prototype.name=function(){return"MgtLibrary"},e}();class i{}const r="https://graph.microsoft.com",o=new Set([r,"https://graph.microsoft.us","https://dod-graph.microsoft.us","https://graph.microsoft.de","https://microsoftgraph.chinacloudapi.cn","https://canary.graph.microsoft.com"]);var s,c,d=n("EYXE");class l{constructor(){this.eventHandlers=[]}fire(e){for(const t of this.eventHandlers)t(e)}add(e){this.eventHandlers.push(e)}remove(e){for(let t=0;t<this.eventHandlers.length;t++)this.eventHandlers[t]===e&&(this.eventHandlers.splice(t,1),t--)}}class u{get isMultiAccountSupportedAndEnabled(){return!1}set baseURL(e){if(!b(e))throw new Error(`${e} is not a valid Graph URL endpoint.`);this._baseURL=e}get baseURL(){return this._baseURL}set customHosts(e){this._customHosts=e}get customHosts(){return this._customHosts}get isMultiAccountSupported(){return this.isMultipleAccountSupported}get state(){return this._state}get isIncrementalConsentDisabled(){return this._isIncrementalConsentDisabled}set isIncrementalConsentDisabled(e){this._isIncrementalConsentDisabled=e}get name(){return"MgtIProvider"}constructor(){this.isMultipleAccountDisabled=!0,this._loginChangedDispatcher=new l,this._activeAccountChangedDispatcher=new l,this._baseURL=r,this._customHosts=void 0,this._isIncrementalConsentDisabled=!1,this.isMultipleAccountSupported=!1,this._state=c.Loading}setState(e){e!==this._state&&(this._state=e,this._loginChangedDispatcher.fire({}))}onStateChanged(e){this._loginChangedDispatcher.add(e)}removeStateChangedHandler(e){this._loginChangedDispatcher.remove(e)}setActiveAccount(e){this.fireActiveAccountChanged()}onActiveAccountChanged(e){this._activeAccountChangedDispatcher.add(e)}removeActiveAccountChangedHandler(e){this._activeAccountChangedDispatcher.remove(e)}fireActiveAccountChanged(){this._activeAccountChangedDispatcher.fire({})}getAccessTokenForScopes(...e){return this.getAccessToken({scopes:e})}}!function(e){e[e.Popup=0]="Popup",e[e.Redirect=1]="Redirect"}(s||(s={})),function(e){e[e.Loading=0]="Loading",e[e.SignedOut=1]="SignedOut",e[e.SignedIn=2]="SignedIn"}(c||(c={}));var f,p=function(e,t,n,a){return new(n||(n=Promise))(function(i,r){function o(e){try{c(a.next(e))}catch(e){r(e)}}function s(e){try{c(a.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((a=a.apply(e,t||[])).next())})};class m{static get globalProvider(){return this._globalProvider}static set globalProvider(e){e!==this._globalProvider&&(this._globalProvider&&(this._globalProvider.removeStateChangedHandler(this.handleProviderStateChanged),this._globalProvider.isMultiAccountSupportedAndEnabled&&this._globalProvider.removeActiveAccountChangedHandler(this.handleActiveAccountChanged)),e&&(e.onStateChanged(this.handleProviderStateChanged),e.isMultiAccountSupportedAndEnabled&&e.onActiveAccountChanged(this.handleActiveAccountChanged)),this._globalProvider=e,this._eventDispatcher.fire(f.ProviderChanged))}static onProviderUpdated(e){this._eventDispatcher.add(e)}static removeProviderUpdatedListener(e){this._eventDispatcher.remove(e)}static onActiveAccountChanged(e){this._activeAccountChangedDispatcher.add(e)}static removeActiveAccountChangedListener(e){this._activeAccountChangedDispatcher.remove(e)}static me(){return this.client?(this._mePromise||(this._mePromise=this.getMe()),this._mePromise):(this._mePromise=null,null)}static getMe(){return p(this,void 0,void 0,function*(){try{const e=yield this.client.api("me").get();if(null==e?void 0:e.id)return e}catch(e){}return null})}static getCacheId(){var e;return p(this,void 0,void 0,function*(){if(this._cacheId)return this._cacheId;if((null===(e=m.globalProvider)||void 0===e?void 0:e.state)===c.SignedIn&&!this._cacheId&&this.client)try{this._cacheId=yield this.createCacheId()}catch(e){}return this._cacheId})}static unsetCacheId(){this._cacheId=null,this._mePromise=null}static createCacheId(){return p(this,void 0,void 0,function*(){if(m.globalProvider.isMultiAccountSupportedAndEnabled){const e=this.createCacheIdWithAccountDetails();if(e)return e}return yield this.createCacheIdWithUserDetails()})}static createCacheIdWithUserDetails(){return p(this,void 0,void 0,function*(){const e=yield this.me();return(null==e?void 0:e.id)?e.id+"-"+e.userPrincipalName:null})}static createCacheIdWithAccountDetails(){const e=m.globalProvider.getActiveAccount();return e.tenantId&&e.id?e.tenantId+e.id:null}static get client(){return m.globalProvider&&m.globalProvider.state===c.SignedIn?m.globalProvider.graph.client:null}}m._eventDispatcher=new l,m._activeAccountChangedDispatcher=new l,m.handleProviderStateChanged=()=>{m.globalProvider&&m.globalProvider.state===c.SignedIn||(m._mePromise=null),m._eventDispatcher.fire(f.ProviderStateChanged)},m.handleActiveAccountChanged=()=>{m.unsetCacheId(),m._activeAccountChangedDispatcher.fire(null)},function(e){e[e.ProviderChanged=0]="ProviderChanged",e[e.ProviderStateChanged=1]="ProviderStateChanged"}(f||(f={}));const _=(...e)=>{const t={scopes:e};return m.globalProvider.isIncrementalConsentDisabled?[]:[new d.AuthenticationHandlerOptions(void 0,t)]},h=(...e)=>{const t=e[0];let n=t;for(let t=1;t<e.length;++t){const a=e[t];n.setNext&&n.setNext(a),n=a}return t},b=e=>{try{const t=new URL(e).origin;if(o.has(t))return t}catch(e){return}};class g{constructor(e,t,n,a){this.resource=n.startsWith("/")?n:`/${n}`,this.method=a,this.index=e,this.id=t}}var v=function(e,t,n,a){return new(n||(n=Promise))(function(i,r){function o(e){try{c(a.next(e))}catch(e){r(e)}}function s(e){try{c(a.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((a=a.apply(e,t||[])).next())})};class y{static get baseUrl(){return"https://graph.microsoft.com"}constructor(e){this.graph=e,this.allRequests=[],this.requestsQueue=[],this.scopes=[],this.nextIndex=0,this.retryAfter=0}get hasRequests(){return this.requestsQueue.length>0}get(e,t,n,a){const i=this.nextIndex++,r=new g(i,e,t,"GET");r.headers=a,this.allRequests.push(r),this.requestsQueue.push(i),n&&(this.scopes=this.scopes.concat(n))}executeNext(){return v(this,void 0,void 0,function*(){const e=new Map;var t;if(this.retryAfter&&(yield(t=1e3*this.retryAfter,function(e,t,n,a){return new(n||(n=Promise))(function(e,t){function i(e){try{o(a.next(e))}catch(e){t(e)}}function r(e){try{o(a.throw(e))}catch(e){t(e)}}function o(t){var a;t.done?e(t.value):(a=t.value,a instanceof n?a:new n(function(e){e(a)})).then(i,r)}o((a=a.apply(undefined,[])).next())})}(0,0,void 0,function*(){return new Promise(e=>{setTimeout(e,t)})})),this.retryAfter=0),!this.hasRequests)return e;const n=this.requestsQueue.splice(0,20),a=new d.BatchRequestContent;for(const e of n.map(e=>this.allRequests[e]))a.addRequest({id:e.index.toString(),request:new Request(y.baseUrl+e.resource,{method:e.method,headers:e.headers})});const r=this.scopes.length?_(...this.scopes):[],o=this.graph.api("$batch").middlewareOptions(r),s=yield a.getContent(),c=yield o.post(s);for(const t of c.responses){const n=new i,a=parseInt(t.id,10),r=this.allRequests[a];if(n.id=r.id,n.index=r.index,n.headers=t.headers,200===t.status)"string"==typeof t.body?t.headers["Content-Type"].includes("image/jpeg")?n.content="data:image/jpeg;base64,"+t.body:t.headers["Content-Type"].includes("image/pjpeg")?n.content="data:image/pjpeg;base64,"+t.body:t.headers["Content-Type"].includes("image/png")&&(n.content="data:image/png;base64,"+t.body):n.content=t.body,e.set(r.id,n);else if(429===t.status){this.requestsQueue.unshift(a);const e=t.headers["Retry-After"];this.retryAfter=Math.max(this.retryAfter,parseInt(e,10)||1)}}return e})}executeAll(){return v(this,void 0,void 0,function*(){const e=new Map;for(;this.hasRequests;){const t=yield this.executeNext();for(const[n,a]of t)e.set(n,a)}return e})}}class S{constructor(e){this.componentName="string"==typeof e?e:e.tagName.toLowerCase()}}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;class D{constructor(e,t){this._packageVersion=e,this._providerName=t}execute(e){var t;return function(e,t,n,a){return new(n||(n=Promise))(function(t,i){function r(e){try{s(a.next(e))}catch(e){i(e)}}function o(e){try{s(a.throw(e))}catch(e){i(e)}}function s(e){var a;e.done?t(e.value):(a=e.value,a instanceof n?a:new n(function(e){e(a)})).then(r,o)}s((a=a.apply(e,[])).next())})}(this,0,void 0,function*(){try{if("string"==typeof e.request)if(b(e.request)){const t=[],n=e.middlewareControl.getMiddlewareOptions(S);if(n){const e=`${n.componentName}/${this._packageVersion}`;t.push(e)}if(this._providerName){const e=`${this._providerName}/${this._packageVersion}`;t.push(e)}const a=`mgt/${this._packageVersion}`;t.push(a),t.push(((e,t,n)=>{let a=null;if("undefined"!=typeof Request&&e instanceof Request)a=e.headers.get(n);else if(void 0!==t&&void 0!==t.headers)if("undefined"!=typeof Headers&&t.headers instanceof Headers)a=t.headers.get(n);else if(t.headers instanceof Array){const e=t.headers;for(let t=0,i=e.length;t<i;t++)if(e[t][0]===n){a=e[t][1];break}}else void 0!==t.headers[n]&&(a=t.headers[n]);return a})(e.request,e.options,"SdkVersion"));const i=t.join(", ");((e,t,n,a)=>{if("undefined"!=typeof Request&&e instanceof Request)e.headers.set(n,a);else if(void 0!==t)if(void 0===t.headers)t.headers=new Headers({[n]:a});else if("undefined"!=typeof Headers&&t.headers instanceof Headers)t.headers.set(n,a);else if(t.headers instanceof Array){let e=0;const i=t.headers.length;for(;e<i;e++){const i=t.headers[e];if(i[0]===n){i[1]=a;break}}e===i&&t.headers.push([n,a])}else Object.assign(t.headers,{[n]:a})})(e.request,e.options,"SdkVersion",i)}else null===(t=null==e?void 0:e.options)||void 0===t||delete t.headers.SdkVersion}catch(e){}return yield this._nextMiddleware.execute(e)})}setNext(e){this._nextMiddleware=e}}const I="3.1.3",x=new class{constructor(){this._disambiguation=""}get defaultPrefix(){return"mgt"}withDisambiguation(e){return e&&!this._disambiguation&&(this._disambiguation=e),this}get prefix(){return this._disambiguation?`${this.defaultPrefix}-${this._disambiguation}`:this.defaultPrefix}get disambiguation(){return this._disambiguation}get isDisambiguated(){return Boolean(this._disambiguation)}normalize(e){return this.isDisambiguated?e.toUpperCase().replace(this.prefix.toUpperCase(),this.defaultPrefix.toUpperCase()):e}};class C{get client(){return this._client}get componentName(){return this._componentName}get version(){return this._version}constructor(e,t="v1.0"){this._client=e,this._version=t}forComponent(e){const t=new C(this._client,this._version);return t.setComponent(e),t}api(e){let t=this._client.api(e).version(this._version);return this._componentName&&(t.middlewareOptions=e=>(t._middlewareOptions=t._middlewareOptions.concat(e),t),t=t.middlewareOptions([new S(this._componentName)])),t}createBatch(){return new y(this)}setComponent(e){this._componentName=e instanceof Element?x.normalize(e.tagName):e}}const O=(e,t,n)=>{const a=[new d.AuthenticationHandler(e),new d.RetryHandler(new d.RetryHandlerOptions),new d.TelemetryHandler,new D(I,e.name),new d.HTTPMessageHandler],i=e.baseURL?e.baseURL:r,o=d.Client.initWithMiddleware({middleware:h(...a),customHosts:e.customHosts?new Set(e.customHosts):null,baseUrl:i}),s=new C(o,t);return n?s.forComponent(n):s};class w extends C{static fromGraph(e){const t=new w(e.client);return t.setComponent(e.componentName),t}constructor(e,t="beta"){super(e,t)}forComponent(e){const t=new w(this.client);return this.setComponent(e),t}}const E=window,A=E.ShadowRoot&&(void 0===E.ShadyCSS||E.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,L=Symbol(),k=new WeakMap;class M{constructor(e,t,n){if(this._$cssResult$=!0,n!==L)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(A&&void 0===e){const n=void 0!==t&&1===t.length;n&&(e=k.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&k.set(t,e))}return e}toString(){return this.cssText}}const P=(e,...t)=>{const n=1===e.length?e[0]:t.reduce((t,n,a)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+e[a+1],e[0]);return new M(n,e,L)},T=A?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new M("string"==typeof e?e:e+"",void 0,L))(t)})(e):e;var U;const F=window,H=F.trustedTypes,R=H?H.emptyScript:"",N=F.reactiveElementPolyfillSupport,B={toAttribute(e,t){switch(t){case Boolean:e=e?R:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},j=(e,t)=>t!==e&&(t==t||e==e),V={attribute:!0,type:String,converter:B,reflect:!1,hasChanged:j},z="finalized";class G extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((t,n)=>{const a=this._$Ep(n,t);void 0!==a&&(this._$Ev.set(a,n),e.push(a))}),e}static createProperty(e,t=V){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const n="symbol"==typeof e?Symbol():"__"+e,a=this.getPropertyDescriptor(e,n,t);void 0!==a&&Object.defineProperty(this.prototype,e,a)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(a){const i=this[e];this[t]=a,this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||V}static finalize(){if(this.hasOwnProperty(z))return!1;this[z]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const n of t)this.createProperty(n,e[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(T(e))}else void 0!==e&&t.push(T(e));return t}static _$Ep(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach(e=>e(this))}addController(e){var t,n;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;const t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{A?e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(t=>{const n=document.createElement("style"),a=E.litNonce;void 0!==a&&n.setAttribute("nonce",a),n.textContent=t.cssText,e.appendChild(n)})})(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)})}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=V){var a;const i=this.constructor._$Ep(e,n);if(void 0!==i&&!0===n.reflect){const r=(void 0!==(null===(a=n.converter)||void 0===a?void 0:a.toAttribute)?n.converter:B).toAttribute(t,n.type);this._$El=e,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$El=null}}_$AK(e,t){var n;const a=this.constructor,i=a._$Ev.get(e);if(void 0!==i&&this._$El!==i){const e=a.getPropertyOptions(i),r="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(n=e.converter)||void 0===n?void 0:n.fromAttribute)?e.converter:B;this._$El=i,this[i]=r.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,n){let a=!0;void 0!==e&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||j)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===n.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,n))):a=!1),!this.isUpdatePending&&a&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((e,t)=>this[t]=e),this._$Ei=void 0);let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),null===(e=this._$ES)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)}),this.update(n)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach(e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach((e,t)=>this._$EO(t,this[t],e)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}var K;G[z]=!0,G.elementProperties=new Map,G.elementStyles=[],G.shadowRootOptions={mode:"open"},null==N||N({ReactiveElement:G}),(null!==(U=F.reactiveElementVersions)&&void 0!==U?U:F.reactiveElementVersions=[]).push("1.6.3");const W=window,q=W.trustedTypes,Q=q?q.createPolicy("lit-html",{createHTML:e=>e}):void 0,Y="$lit$",J=`lit$${(Math.random()+"").slice(9)}$`,X="?"+J,Z=`<${X}>`,$=document,ee=()=>$.createComment(""),te=e=>null===e||"object"!=typeof e&&"function"!=typeof e,ne=Array.isArray,ae=e=>ne(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]),ie="[ \t\n\f\r]",re=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,oe=/-->/g,se=/>/g,ce=RegExp(`>|${ie}(?:([^\\s"'>=/]+)(${ie}*=${ie}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),de=/'/g,le=/"/g,ue=/^(?:script|style|textarea|title)$/i,fe=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),pe=fe(1),me=(fe(2),Symbol.for("lit-noChange")),_e=Symbol.for("lit-nothing"),he=new WeakMap,be=$.createTreeWalker($,129,null,!1);function ge(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Q?Q.createHTML(t):t}const ve=(e,t)=>{const n=e.length-1,a=[];let i,r=2===t?"<svg>":"",o=re;for(let t=0;t<n;t++){const n=e[t];let s,c,d=-1,l=0;for(;l<n.length&&(o.lastIndex=l,c=o.exec(n),null!==c);)l=o.lastIndex,o===re?"!--"===c[1]?o=oe:void 0!==c[1]?o=se:void 0!==c[2]?(ue.test(c[2])&&(i=RegExp("</"+c[2],"g")),o=ce):void 0!==c[3]&&(o=ce):o===ce?">"===c[0]?(o=null!=i?i:re,d=-1):void 0===c[1]?d=-2:(d=o.lastIndex-c[2].length,s=c[1],o=void 0===c[3]?ce:'"'===c[3]?le:de):o===le||o===de?o=ce:o===oe||o===se?o=re:(o=ce,i=void 0);const u=o===ce&&e[t+1].startsWith("/>")?" ":"";r+=o===re?n+Z:d>=0?(a.push(s),n.slice(0,d)+Y+n.slice(d)+J+u):n+J+(-2===d?(a.push(void 0),t):u)}return[ge(e,r+(e[n]||"<?>")+(2===t?"</svg>":"")),a]};class ye{constructor({strings:e,_$litType$:t},n){let a;this.parts=[];let i=0,r=0;const o=e.length-1,s=this.parts,[c,d]=ve(e,t);if(this.el=ye.createElement(c,n),be.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(a=be.nextNode())&&s.length<o;){if(1===a.nodeType){if(a.hasAttributes()){const e=[];for(const t of a.getAttributeNames())if(t.endsWith(Y)||t.startsWith(J)){const n=d[r++];if(e.push(t),void 0!==n){const e=a.getAttribute(n.toLowerCase()+Y).split(J),t=/([.?@])?(.*)/.exec(n);s.push({type:1,index:i,name:t[2],strings:e,ctor:"."===t[1]?Ce:"?"===t[1]?we:"@"===t[1]?Ee:xe})}else s.push({type:6,index:i})}for(const t of e)a.removeAttribute(t)}if(ue.test(a.tagName)){const e=a.textContent.split(J),t=e.length-1;if(t>0){a.textContent=q?q.emptyScript:"";for(let n=0;n<t;n++)a.append(e[n],ee()),be.nextNode(),s.push({type:2,index:++i});a.append(e[t],ee())}}}else if(8===a.nodeType)if(a.data===X)s.push({type:2,index:i});else{let e=-1;for(;-1!==(e=a.data.indexOf(J,e+1));)s.push({type:7,index:i}),e+=J.length-1}i++}}static createElement(e,t){const n=$.createElement("template");return n.innerHTML=e,n}}function Se(e,t,n=e,a){var i,r,o,s;if(t===me)return t;let c=void 0!==a?null===(i=n._$Co)||void 0===i?void 0:i[a]:n._$Cl;const d=te(t)?void 0:t._$litDirective$;return(null==c?void 0:c.constructor)!==d&&(null===(r=null==c?void 0:c._$AO)||void 0===r||r.call(c,!1),void 0===d?c=void 0:(c=new d(e),c._$AT(e,n,a)),void 0!==a?(null!==(o=(s=n)._$Co)&&void 0!==o?o:s._$Co=[])[a]=c:n._$Cl=c),void 0!==c&&(t=Se(e,c._$AS(e,t.values),c,a)),t}class De{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;const{el:{content:n},parts:a}=this._$AD,i=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:$).importNode(n,!0);be.currentNode=i;let r=be.nextNode(),o=0,s=0,c=a[0];for(;void 0!==c;){if(o===c.index){let t;2===c.type?t=new Ie(r,r.nextSibling,this,e):1===c.type?t=new c.ctor(r,c.name,c.strings,this,e):6===c.type&&(t=new Ae(r,this,e)),this._$AV.push(t),c=a[++s]}o!==(null==c?void 0:c.index)&&(r=be.nextNode(),o++)}return be.currentNode=$,i}v(e){let t=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class Ie{constructor(e,t,n,a){var i;this.type=2,this._$AH=_e,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=a,this._$Cp=null===(i=null==a?void 0:a.isConnected)||void 0===i||i}get _$AU(){var e,t;return null!==(t=null===(e=this._$AM)||void 0===e?void 0:e._$AU)&&void 0!==t?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===(null==e?void 0:e.nodeType)&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Se(this,e,t),te(e)?e===_e||null==e||""===e?(this._$AH!==_e&&this._$AR(),this._$AH=_e):e!==this._$AH&&e!==me&&this._(e):void 0!==e._$litType$?this.g(e):void 0!==e.nodeType?this.$(e):ae(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==_e&&te(this._$AH)?this._$AA.nextSibling.data=e:this.$($.createTextNode(e)),this._$AH=e}g(e){var t;const{values:n,_$litType$:a}=e,i="number"==typeof a?this._$AC(e):(void 0===a.el&&(a.el=ye.createElement(ge(a.h,a.h[0]),this.options)),a);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===i)this._$AH.v(n);else{const e=new De(i,this),t=e.u(this.options);e.v(n),this.$(t),this._$AH=e}}_$AC(e){let t=he.get(e.strings);return void 0===t&&he.set(e.strings,t=new ye(e)),t}T(e){ne(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,a=0;for(const i of e)a===t.length?t.push(n=new Ie(this.k(ee()),this.k(ee()),this,this.options)):n=t[a],n._$AI(i),a++;a<t.length&&(this._$AR(n&&n._$AB.nextSibling,a),t.length=a)}_$AR(e=this._$AA.nextSibling,t){var n;for(null===(n=this._$AP)||void 0===n||n.call(this,!1,!0,t);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){var t;void 0===this._$AM&&(this._$Cp=e,null===(t=this._$AP)||void 0===t||t.call(this,e))}}class xe{constructor(e,t,n,a,i){this.type=1,this._$AH=_e,this._$AN=void 0,this.element=e,this.name=t,this._$AM=a,this.options=i,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=_e}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,n,a){const i=this.strings;let r=!1;if(void 0===i)e=Se(this,e,t,0),r=!te(e)||e!==this._$AH&&e!==me,r&&(this._$AH=e);else{const a=e;let o,s;for(e=i[0],o=0;o<i.length-1;o++)s=Se(this,a[n+o],t,o),s===me&&(s=this._$AH[o]),r||(r=!te(s)||s!==this._$AH[o]),s===_e?e=_e:e!==_e&&(e+=(null!=s?s:"")+i[o+1]),this._$AH[o]=s}r&&!a&&this.j(e)}j(e){e===_e?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}class Ce extends xe{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===_e?void 0:e}}const Oe=q?q.emptyScript:"";class we extends xe{constructor(){super(...arguments),this.type=4}j(e){e&&e!==_e?this.element.setAttribute(this.name,Oe):this.element.removeAttribute(this.name)}}class Ee extends xe{constructor(e,t,n,a,i){super(e,t,n,a,i),this.type=5}_$AI(e,t=this){var n;if((e=null!==(n=Se(this,e,t,0))&&void 0!==n?n:_e)===me)return;const a=this._$AH,i=e===_e&&a!==_e||e.capture!==a.capture||e.once!==a.once||e.passive!==a.passive,r=e!==_e&&(a===_e||i);i&&this.element.removeEventListener(this.name,this,a),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,n;"function"==typeof this._$AH?this._$AH.call(null!==(n=null===(t=this.options)||void 0===t?void 0:t.host)&&void 0!==n?n:this.element,e):this._$AH.handleEvent(e)}}class Ae{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Se(this,e)}}const Le={O:Y,P:J,A:X,C:1,M:ve,L:De,R:ae,D:Se,I:Ie,V:xe,H:we,N:Ee,U:Ce,F:Ae},ke=W.litHtmlPolyfillSupport;var Me,Pe;null==ke||ke(ye,Ie),(null!==(K=W.litHtmlVersions)&&void 0!==K?K:W.litHtmlVersions=[]).push("2.8.0");class Te extends G{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;const n=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=n.firstChild),n}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,n)=>{var a,i;const r=null!==(a=null==n?void 0:n.renderBefore)&&void 0!==a?a:t;let o=r._$litPart$;if(void 0===o){const e=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:null;r._$litPart$=o=new Ie(t.insertBefore(ee(),e),e,void 0,null!=n?n:{})}return o._$AI(e),o})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return me}}Te.finalized=!0,Te._$litElement$=!0,null===(Me=globalThis.litElementHydrateSupport)||void 0===Me||Me.call(globalThis,{LitElement:Te});const Ue=globalThis.litElementPolyfillSupport;null==Ue||Ue({LitElement:Te}),(null!==(Pe=globalThis.litElementVersions)&&void 0!==Pe?Pe:globalThis.litElementVersions=[]).push("3.3.3");const Fe=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(n){n.createProperty(t.key,e)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(n){n.createProperty(t.key,e)}},He=(e,t,n)=>{t.constructor.createProperty(n,e)};function Re(e){return(t,n)=>void 0!==n?He(e,t,n):Fe(e,t)}function Ne(e){return Re({...e,state:!0})}var Be;null===(Be=window.HTMLSlotElement)||void 0===Be||Be.prototype.assignedElements;class je{static get strings(){return this._strings}static set strings(e){this._strings=e,this._stringsEventDispatcher.fire(null)}static getDocumentDirection(){var e,t;switch((null===(e=document.body)||void 0===e?void 0:e.getAttribute("dir"))||(null===(t=document.documentElement)||void 0===t?void 0:t.getAttribute("dir"))){case"rtl":return"rtl";case"auto":return"auto";default:return"ltr"}}static onStringsUpdated(e){this._stringsEventDispatcher.add(e)}static removeOnStringsUpdated(e){this._stringsEventDispatcher.remove(e)}static onDirectionUpdated(e){this._directionEventDispatcher.add(e),this.initDirection()}static removeOnDirectionUpdated(e){this._directionEventDispatcher.remove(e)}static initDirection(){if(this._isDirectionInit)return;this._isDirectionInit=!0,this.mutationObserver=new MutationObserver(e=>{e.forEach(e=>{"dir"===e.attributeName&&this._directionEventDispatcher.fire(null)})});const e={attributes:!0,attributeFilter:["dir"]};this.mutationObserver.observe(document.body,e),this.mutationObserver.observe(document.documentElement,e)}static updateStringsForTag(e,t){var n;if((e=e.toLowerCase()).startsWith("mgt-")&&(e=e.substring(4)),this._strings&&t){for(const e of Object.entries(t)){const n=this._strings[e[0]];"string"==typeof n&&(t[e[0]]=n)}if(null===(n=this._strings._components)||void 0===n?void 0:n[e]){const n=this._strings._components[e];for(const e of Object.keys(n))t[e]&&(t[e]=n[e])}}return t}}je._stringsEventDispatcher=new l,je._directionEventDispatcher=new l,je._isDirectionInit=!1;var Ve,ze=function(e,t,n,a){return new(n||(n=Promise))(function(i,r){function o(e){try{c(a.next(e))}catch(e){r(e)}}function s(e){try{c(a.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((a=a.apply(e,t||[])).next())})};!function(e){e.mobile="",e.tablet="tablet",e.desktop="desktop"}(Ve||(Ve={}));class Ge extends Te{static get packageVersion(){return I}get mediaQuery(){return this.offsetWidth<768?Ve.mobile:this.offsetWidth<1200?Ve.tablet:Ve.desktop}get isLoadingState(){return this._isLoadingState}get isFirstUpdated(){return this._isFirstUpdated}get strings(){return{}}constructor(){super(),this.direction="ltr",this._isLoadingState=!1,this._isFirstUpdated=!1,this.setLoadingState=e=>{this._isLoadingState!==e&&(this._isLoadingState=e,this.requestUpdate("isLoadingState"))},this.handleProviderUpdates=()=>{this.requestStateUpdate()},this.handleActiveAccountUpdates=()=>{this.clearState(),this.requestStateUpdate()},this.handleLocalizationChanged=()=>{je.updateStringsForTag(this.tagName,this.strings),this.requestUpdate()},this.handleDirectionChanged=()=>{this.direction=je.getDocumentDirection()},this.handleDirectionChanged(),this.handleLocalizationChanged()}connectedCallback(){super.connectedCallback(),je.onStringsUpdated(this.handleLocalizationChanged),je.onDirectionUpdated(this.handleDirectionChanged)}disconnectedCallback(){super.disconnectedCallback(),je.removeOnStringsUpdated(this.handleLocalizationChanged),je.removeOnDirectionUpdated(this.handleDirectionChanged),m.removeProviderUpdatedListener(this.handleProviderUpdates),m.removeActiveAccountChangedListener(this.handleActiveAccountUpdates)}firstUpdated(e){super.firstUpdated(e),this._isFirstUpdated=!0,m.onProviderUpdated(this.handleProviderUpdates),m.onActiveAccountChanged(this.handleActiveAccountUpdates),this.requestStateUpdate()}loadState(){return Promise.resolve()}clearState(){}fireCustomEvent(e,t,n=!1,a=!1,i=!1){const r=new CustomEvent(e,{bubbles:n,cancelable:a,composed:i,detail:t});return this.dispatchEvent(r)}updated(e){super.updated(e);const t=new CustomEvent("updated",{bubbles:!0,cancelable:!0});this.dispatchEvent(t)}requestStateUpdate(e=!1){return ze(this,void 0,void 0,function*(){if(!this._isFirstUpdated)return;this.isLoadingState&&!e&&(yield this._currentLoadStatePromise);const t=m.globalProvider;if(!t)return Promise.resolve();if(t.state!==c.SignedOut){if(t.state===c.Loading)return Promise.resolve();{const t=new Promise((n,a)=>ze(this,void 0,void 0,function*(){try{this.setLoadingState(!0),this.fireCustomEvent("loadingInitiated"),yield this.loadState(),this.setLoadingState(!1),this.fireCustomEvent("loadingCompleted"),n()}catch(e){this.clearState(),this.setLoadingState(!1),this.fireCustomEvent("loadingFailed"),a(e)}return this._currentLoadStatePromise=this.isLoadingState&&this._currentLoadStatePromise&&e?this._currentLoadStatePromise.then(()=>t):t}))}}else this.clearState()})}}!function(e,t,n,a){var i,r=arguments.length,o=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(r<3?i(o):r>3?i(t,n,o):i(t,n))||o);r>3&&o&&Object.defineProperty(t,n,o)}([Ne(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata("design:type",t)}(0,String)],Ge.prototype,"direction",void 0);var Ke=function(e,t,n,a){var i,r=arguments.length,o=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(r<3?i(o):r>3?i(t,n,o):i(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o},We=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class qe extends Ge{constructor(){super(...arguments),this.stateChangedHandler=()=>{this.fireCustomEvent("onStateChanged",this.provider.state)}}get provider(){return this._provider}set provider(e){this._provider&&this.provider.removeStateChangedHandler(()=>this.stateChangedHandler),this._provider=e,this._provider&&this.provider.onStateChanged(()=>this.stateChangedHandler)}get isAvailable(){return!0}firstUpdated(e){super.firstUpdated(e);let t=!1;if(this.dependsOn){let e=this.dependsOn;for(;e;){if(e.isAvailable){t=!0;break}e=e.dependsOn}}!t&&this.isAvailable&&this.initializeProvider()}initializeProvider(){}}Ke([Re({attribute:"depends-on",converter:e=>document.querySelector(e),type:String}),We("design:type",qe)],qe.prototype,"dependsOn",void 0),Ke([Re({attribute:"base-url",type:String}),We("design:type",String)],qe.prototype,"baseUrl",void 0),Ke([Re({attribute:"custom-hosts",type:String,converter:e=>e.split(",").map(e=>e.trim())}),We("design:type",Array)],qe.prototype,"customHosts",void 0);const Qe=(e,t)=>Ye(e,t,new Set),Ye=(e,t,n)=>{const a=Object.prototype.toString.call(e),i=Object.prototype.toString.call(t);if("object"==typeof e&&"object"==typeof t&&a===i&&"[object Object]"===a&&!n.has(e)){n.add(e);for(const a in e)if(!Ye(e[a],t[a],n))return!1;for(const n in t)if(!Object.prototype.hasOwnProperty.call(e,n))return!1;return!0}if(Array.isArray(e)&&Array.isArray(t)&&!n.has(e)){if(n.add(e),e.length!==t.length)return!1;for(let a=0;a<e.length;a++)if(!Ye(e[a],t[a],n))return!1;return!0}return e===t},Je=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;if(0===e.length)return!0;const n=new Set(e);for(const e of t)if(!n.has(e))return!1;return!0};class Xe{static renderTemplate(e,t,n){var a;let i;if(t.$parentTemplateContext&&(n=Object.assign(Object.assign({},n),{$parent:t.$parentTemplateContext})),null===(a=t.content)||void 0===a?void 0:a.childNodes.length){const a=t.content.cloneNode(!0);i=this.renderNode(a,e,n)}else if(t.childNodes.length){const a=document.createElement("div");for(const e of t.childNodes)a.appendChild(this.simpleCloneNode(e));i=this.renderNode(a,e,n)}i&&e.appendChild(i)}static setBindingSyntax(e,t){this._startExpression=e,this._endExpression=t;const n=this.escapeRegex(this._startExpression),a=this.escapeRegex(this._endExpression);this._expression=new RegExp(`${n}\\s*([$\\w\\.,'"\\s()\\[\\]]+)\\s*${a}`,"g")}static get globalContext(){return this._globalContext}static get expression(){return this._expression||this.setBindingSyntax("{{","}}"),this._expression}static escapeRegex(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}static simpleCloneNode(e){if(!e)return null;const t=e.cloneNode(!1);for(const n of e.childNodes){const e=this.simpleCloneNode(n);e&&t.appendChild(e)}return t}static expandExpressionsAsString(e,t){return e.replace(this.expression,(e,n)=>{const a=this.evalInContext(n||this.trimExpression(e),t);return a?"object"==typeof a?JSON.stringify(a):a.toString():""})}static renderNode(e,t,n){if("#text"===e.nodeName)return e.textContent=this.expandExpressionsAsString(e.textContent,n),e;if("TEMPLATE"===e.nodeName)return e.$parentTemplateContext=n,e;const a=e;if(a.attributes)for(const e of a.attributes)if("data-props"===e.name){const i=this.trimExpression(e.value);for(const e of i.split(",")){const i=e.trim().split(":");if(2===i.length){const e=i[0].trim(),r=this.evalInContext(i[1].trim(),n);e.startsWith("@")?"function"==typeof r&&a.addEventListener(e.substring(1),e=>r(e,n,t)):a[e]=r}}}else a.setAttribute(e.name,this.expandExpressionsAsString(e.value,n));const i=[],r=[];let o=!1;for(const a of e.childNodes){const e=a;let s=!1;if(e.dataset){let c=!1;if(e.dataset.if){const t=e.dataset.if;this.evalBoolInContext(this.trimExpression(t),n)?(e.removeAttribute("data-if"),o=!0,s=!0):(r.push(e),c=!0)}else void 0!==e.dataset.else&&(o?(r.push(e),c=!0):e.removeAttribute("data-else"));e.dataset.for&&!c?i.push(e):c||this.renderNode(a,t,n)}else this.renderNode(a,t,n);s||"#text"===a.nodeName||(o=!1)}for(const e of r)a.removeChild(e);for(const e of i){const i=e.dataset.for,r=this.trimExpression(i).split(/\s(in|of)\s/i);if(3===r.length){const i=r[0].trim(),o=r[2].trim(),s=this.evalInContext(o,n);if(Array.isArray(s)){e.removeAttribute("data-for");for(let r=0;r<s.length;r++){const o=Object.assign({$index:r},n);o[i]=s[r];const c=e.cloneNode(!0);this.renderNode(c,t,o),a.insertBefore(c,e)}}a.removeChild(e)}}return e}static evalBoolInContext(e,t){return t=Object.assign(Object.assign({},t),this.globalContext),new Function("with(this) { return !!("+e+")}").call(t)}static evalInContext(e,t){t=Object.assign(Object.assign({},t),this.globalContext);const n=new Function("with(this) { return "+e+";}");let a;try{a=n.call(t)}catch(e){}return a}static trimExpression(e){return(e=e.trim()).startsWith(this._startExpression)&&e.endsWith(this._endExpression)&&(e=(e=e.substr(this._startExpression.length,e.length-this._startExpression.length-this._endExpression.length)).trim()),e}}Xe._globalContext={};var Ze=function(e,t,n,a){var i,r=arguments.length,o=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(r<3?i(o):r>3?i(t,n,o):i(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o},$e=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class et extends Ge{constructor(){super(),this.templates={},this._renderedSlots=!1,this._renderedTemplates={},this._slotNamesAddedDuringRender=[],this.templateContext=this.templateContext||{}}update(e){this.templates=this.getTemplates(),this._slotNamesAddedDuringRender=[],super.update(e)}updated(e){super.updated(e),this.removeUnusedSlottedElements()}renderTemplate(e,t,n){if(!this.hasTemplate(e))return null;n=n||e,this._slotNamesAddedDuringRender.push(n),this._renderedSlots=!0;const a=pe`
<slot name=${n}></slot>
`,i=Object.assign(Object.assign({},t),this.templateContext);if(Object.prototype.hasOwnProperty.call(this._renderedTemplates,n)){const{context:e,slot:t}=this._renderedTemplates[n];if(Qe(e,i))return a;this.removeChild(t)}const r=document.createElement("div");r.slot=n,r.dataset.generated="template",Xe.renderTemplate(r,this.templates[e],i),this.appendChild(r),this._renderedTemplates[n]={context:i,slot:r};const o={templateType:e,context:i,element:r};return this.fireCustomEvent("templateRendered",o),a}hasTemplate(e){var t;return Boolean(null===(t=this.templates)||void 0===t?void 0:t[e])}getTemplates(){const e={};for(let t=0;t<this.children.length;t++){const n=this.children[t];if("TEMPLATE"===n.nodeName){const a=n;a.dataset.type?e[a.dataset.type]=a:e.default=a,a.templateOrder=t}}return e}renderError(){return this.hasTemplate("error")?this.renderTemplate("error",this.error):pe`
<div class="error">
${this.error}
</div>
`}removeUnusedSlottedElements(){var e;if(this._renderedSlots){for(let t=0;t<this.children.length;t++){const n=this.children[t];(null===(e=n.dataset)||void 0===e?void 0:e.generated)&&!this._slotNamesAddedDuringRender.includes(n.slot)&&(this.removeChild(n),delete this._renderedTemplates[n.slot],t--)}this._renderedSlots=!1}}}Ze([Re({attribute:!1}),$e("design:type",Object)],et.prototype,"templateContext",void 0),Ze([Ne(),$e("design:type",Object)],et.prototype,"error",void 0);class tt extends u{get name(){return"MgtSimpleProvider"}constructor(e,t,n){super(),this._getAccessTokenHandler=e,this._loginHandler=t,this._logoutHandler=n,this.graph=O(this)}getAccessToken(e){return this._getAccessTokenHandler(null==e?void 0:e.scopes)}login(){return this._loginHandler()}logout(){return this._logoutHandler()}}const nt=(e,t)=>t.some(t=>e instanceof t);let at,it;const rt=new WeakMap,ot=new WeakMap,st=new WeakMap,ct=new WeakMap,dt=new WeakMap;let lt={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return ot.get(e);if("objectStoreNames"===t)return e.objectStoreNames||st.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ut(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function ut(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const a=()=>{e.removeEventListener("success",i),e.removeEventListener("error",r)},i=()=>{t(ut(e.result)),a()},r=()=>{n(e.error),a()};e.addEventListener("success",i),e.addEventListener("error",r)});return t.then(t=>{t instanceof IDBCursor&&rt.set(t,e)}).catch(()=>{}),dt.set(t,e),t}(e);if(ct.has(e))return ct.get(e);const t=function(e){return"function"==typeof e?(t=e)!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(it||(it=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(ft(this),e),ut(rt.get(this))}:function(...e){return ut(t.apply(ft(this),e))}:function(e,...n){const a=t.call(ft(this),e,...n);return st.set(a,e.sort?e.sort():[e]),ut(a)}:(e instanceof IDBTransaction&&function(e){if(ot.has(e))return;const t=new Promise((t,n)=>{const a=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",r),e.removeEventListener("abort",r)},i=()=>{t(),a()},r=()=>{n(e.error||new DOMException("AbortError","AbortError")),a()};e.addEventListener("complete",i),e.addEventListener("error",r),e.addEventListener("abort",r)});ot.set(e,t)}(e),nt(e,at||(at=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,lt):e);var t}(e);return t!==e&&(ct.set(e,t),dt.set(t,e)),t}const ft=e=>dt.get(e),pt=["get","getKey","getAll","getAllKeys","count"],mt=["put","add","delete","clear"],_t=new Map;function ht(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(_t.get(t))return _t.get(t);const n=t.replace(/FromIndex$/,""),a=t!==n,i=mt.includes(n);if(!(n in(a?IDBIndex:IDBObjectStore).prototype)||!i&&!pt.includes(n))return;const r=async function(e,...t){const r=this.transaction(e,i?"readwrite":"readonly");let o=r.store;return a&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&r.done]))[0]};return _t.set(t,r),r}var bt;bt=lt,lt={...bt,get:(e,t,n)=>ht(e,t)||bt.get(e,t,n),has:(e,t)=>!!ht(e,t)||bt.has(e,t)};var gt=function(e,t,n,a){return new(n||(n=Promise))(function(i,r){function o(e){try{c(a.next(e))}catch(e){r(e)}}function s(e){try{c(a.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((a=a.apply(e,t||[])).next())})};class vt{constructor(e,t){if(!(t in e.stores))throw Error('"store" must be defined in the "schema"');this.schema=e,this.store=t}getValue(e){return gt(this,void 0,void 0,function*(){if(!window.indexedDB)return null;try{return(yield this.getDb()).get(this.store,e)}catch(e){return null}})}putValue(e,t){return gt(this,void 0,void 0,function*(){if(window.indexedDB)try{yield(yield this.getDb()).put(this.store,Object.assign(Object.assign({},t),{timeCached:Date.now()}),e)}catch(e){return}})}clearStore(){return gt(this,void 0,void 0,function*(){if(window.indexedDB)try{yield(yield this.getDb()).clear(this.store)}catch(e){return}})}getDBName(){return gt(this,void 0,void 0,function*(){const e=yield m.getCacheId();if(e)return`mgt-${this.schema.name}-${e}`})}getDb(){return gt(this,void 0,void 0,function*(){const e=yield this.getDBName();if(e)return function(e,t,{blocked:n,upgrade:a,blocking:i,terminated:r}={}){const o=indexedDB.open(e,t),s=ut(o);return a&&o.addEventListener("upgradeneeded",e=>{a(ut(o.result),e.oldVersion,e.newVersion,ut(o.transaction))}),n&&o.addEventListener("blocked",()=>n()),s.then(e=>{r&&e.addEventListener("close",()=>r()),i&&e.addEventListener("versionchange",()=>i())}).catch(()=>{}),s}(e,this.schema.version,{upgrade:(t,n,a,i)=>{const r=JSON.parse(localStorage.getItem(yt))||[];r.includes(e)||r.push(e),localStorage.setItem(yt,JSON.stringify(r));for(const e in t