@abtnode/webapp 1.16.26 → 1.16.27-beta-e0e33468
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/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/build/asset-manifest.json +4 -4
- package/build/index.html +1 -1
- package/build/service-worker.js +1 -1
- package/build/static/js/{4296.d10d8d5e.chunk.js → 4296.2dd20fb1.chunk.js} +1 -1
- package/build/static/js/{9132.37a79b4e.chunk.js → 9132.7199c98e.chunk.js} +1 -1
- package/build/static/js/main.78f8a9a1.js +2 -0
- package/package.json +1 -1
- package/build/static/js/main.c0cb47f8.js +0 -2
- /package/build/static/js/{main.c0cb47f8.js.LICENSE.txt → main.78f8a9a1.js.LICENSE.txt} +0 -0
package/blocklet.yml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
3
|
"main.css": "./static/css/main.d5f27ae7.css",
|
|
4
|
-
"main.js": "./static/js/main.
|
|
4
|
+
"main.js": "./static/js/main.78f8a9a1.js",
|
|
5
5
|
"static/js/9041.62504f43.chunk.js": "./static/js/9041.62504f43.chunk.js",
|
|
6
6
|
"static/js/7327.d1805380.chunk.js": "./static/js/7327.d1805380.chunk.js",
|
|
7
7
|
"static/js/3389.659cab57.chunk.js": "./static/js/3389.659cab57.chunk.js",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"static/js/556.cfa178eb.chunk.js": "./static/js/556.cfa178eb.chunk.js",
|
|
89
89
|
"static/js/8249.b3efc43c.chunk.js": "./static/js/8249.b3efc43c.chunk.js",
|
|
90
90
|
"static/js/3732.d5b401f7.chunk.js": "./static/js/3732.d5b401f7.chunk.js",
|
|
91
|
-
"static/js/9132.
|
|
91
|
+
"static/js/9132.7199c98e.chunk.js": "./static/js/9132.7199c98e.chunk.js",
|
|
92
92
|
"static/js/8139.94d2309f.chunk.js": "./static/js/8139.94d2309f.chunk.js",
|
|
93
93
|
"static/js/9517.ac659c32.chunk.js": "./static/js/9517.ac659c32.chunk.js",
|
|
94
94
|
"static/js/7718.43bea793.chunk.js": "./static/js/7718.43bea793.chunk.js",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"static/js/9450.5a43999b.chunk.js": "./static/js/9450.5a43999b.chunk.js",
|
|
144
144
|
"static/js/5706.f5e6f131.chunk.js": "./static/js/5706.f5e6f131.chunk.js",
|
|
145
145
|
"static/css/4665.5d6e9197.chunk.css": "./static/css/4665.5d6e9197.chunk.css",
|
|
146
|
-
"static/js/4296.
|
|
146
|
+
"static/js/4296.2dd20fb1.chunk.js": "./static/js/4296.2dd20fb1.chunk.js",
|
|
147
147
|
"static/js/5979.a7c1a387.chunk.js": "./static/js/5979.a7c1a387.chunk.js",
|
|
148
148
|
"static/js/2098.a38c7200.chunk.js": "./static/js/2098.a38c7200.chunk.js",
|
|
149
149
|
"static/js/6179.fbea7365.chunk.js": "./static/js/6179.fbea7365.chunk.js",
|
|
@@ -187,6 +187,6 @@
|
|
|
187
187
|
},
|
|
188
188
|
"entrypoints": [
|
|
189
189
|
"static/css/main.d5f27ae7.css",
|
|
190
|
-
"static/js/main.
|
|
190
|
+
"static/js/main.78f8a9a1.js"
|
|
191
191
|
]
|
|
192
192
|
}
|
package/build/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><base href="/"/><meta charset="utf-8"/><link rel="shortcut icon" href="favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"/><meta name="theme-color" content="#000000"/><script>"https:"===window.location.protocol&&document.write('<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />')</script><link rel="stylesheet" href="icons/css/all.css"/><title>Blocklet Server</title><script src="api/env"></script><script defer="defer" src="./static/js/main.
|
|
1
|
+
<!doctype html><html lang="en"><head><base href="/"/><meta charset="utf-8"/><link rel="shortcut icon" href="favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"/><meta name="theme-color" content="#000000"/><script>"https:"===window.location.protocol&&document.write('<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />')</script><link rel="stylesheet" href="icons/css/all.css"/><title>Blocklet Server</title><script src="api/env"></script><script defer="defer" src="./static/js/main.78f8a9a1.js"></script><link href="./static/css/main.d5f27ae7.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
package/build/service-worker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={522:()=>{try{self["workbox:core:7.0.0"]&&_()}catch(e){}},434:()=>{try{self["workbox:expiration:7.0.0"]&&_()}catch(e){}},290:()=>{try{self["workbox:precaching:7.0.0"]&&_()}catch(e){}},92:()=>{try{self["workbox:routing:7.0.0"]&&_()}catch(e){}},559:()=>{try{self["workbox:strategies:7.0.0"]&&_()}catch(e){}}},t={};function s(n){var a=t[n];if(void 0!==a)return a.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,s),r.exports}(()=>{s(522);const e=function(e){let t=e;for(var s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];return n.length>0&&(t+=" :: ".concat(JSON.stringify(n))),t};class t extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}const n=new Set;const a={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!==typeof registration?registration.scope:""},r=e=>[a.prefix,e,a.suffix].filter((e=>e&&e.length>0)).join("-"),i=e=>e||r(a.precache),c=e=>e||r(a.runtime);function o(e,t){const s=new URL(e);for(const n of t)s.searchParams.delete(n);return s.href}let h;function l(e){e.then((()=>{}))}class u{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}const d=e=>new URL(String(e),location.href).href.replace(new RegExp("^".concat(location.origin)),"");function f(e,t){const s=t();return e.waitUntil(s),s}async function p(e,s){let n=null;if(e.url){n=new URL(e.url).origin}if(n!==self.location.origin)throw new t("cross-origin-copy-response",{origin:n});const a=e.clone(),r={headers:new Headers(a.headers),status:a.status,statusText:a.statusText},i=s?s(r):r,c=function(){if(void 0===h){const t=new Response("");if("body"in t)try{new Response(t.body),h=!0}catch(e){h=!1}h=!1}return h}()?a.body:await a.blob();return new Response(c,i)}s(290);function g(e){if(!e)throw new t("add-to-cache-list-unexpected-type",{entry:e});if("string"===typeof e){const t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}const{revision:s,url:n}=e;if(!n)throw new t("add-to-cache-list-unexpected-type",{entry:e});if(!s){const e=new URL(n,location.href);return{cacheKey:e.href,url:e.href}}const a=new URL(n,location.href),r=new URL(n,location.href);return a.searchParams.set("__WB_REVISION__",s),{cacheKey:a.href,url:r.href}}class w{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async e=>{let{request:t,state:s}=e;s&&(s.originalRequest=t)},this.cachedResponseWillBeUsed=async e=>{let{event:t,state:s,cachedResponse:n}=e;if("install"===t.type&&s&&s.originalRequest&&s.originalRequest instanceof Request){const e=s.originalRequest.url;n?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return n}}}class y{constructor(e){let{precacheController:t}=e;this.cacheKeyWillBeUsed=async e=>{let{request:t,params:s}=e;const n=(null===s||void 0===s?void 0:s.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return n?new Request(n,{headers:t.headers}):t},this._precacheController=t}}s(559);function m(e){return"string"===typeof e?new Request(e):e}class _{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new u,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const s of this._plugins)this._pluginStateMap.set(s,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:s}=this;let n=m(e);if("navigate"===n.mode&&s instanceof FetchEvent&&s.preloadResponse){const e=await s.preloadResponse;if(e)return e}const a=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))n=await e({request:n.clone(),event:s})}catch(i){if(i instanceof Error)throw new t("plugin-error-request-will-fetch",{thrownErrorMessage:i.message})}const r=n.clone();try{let e;e=await fetch(n,"navigate"===n.mode?void 0:this._strategy.fetchOptions);for(const t of this.iterateCallbacks("fetchDidSucceed"))e=await t({event:s,request:r,response:e});return e}catch(c){throw a&&await this.runCallbacks("fetchDidFail",{error:c,event:s,originalRequest:a.clone(),request:r.clone()}),c}}async fetchAndCachePut(e){const t=await this.fetch(e),s=t.clone();return this.waitUntil(this.cachePut(e,s)),t}async cacheMatch(e){const t=m(e);let s;const{cacheName:n,matchOptions:a}=this._strategy,r=await this.getCacheKey(t,"read"),i=Object.assign(Object.assign({},a),{cacheName:n});s=await caches.match(r,i);for(const c of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await c({cacheName:n,matchOptions:a,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(e,s){const a=m(e);var r;await(r=0,new Promise((e=>setTimeout(e,r))));const i=await this.getCacheKey(a,"write");if(!s)throw new t("cache-put-with-no-response",{url:d(i.url)});const c=await this._ensureResponseSafeToCache(s);if(!c)return!1;const{cacheName:h,matchOptions:l}=this._strategy,u=await self.caches.open(h),f=this.hasCallback("cacheDidUpdate"),p=f?await async function(e,t,s,n){const a=o(t.url,s);if(t.url===a)return e.match(t,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),i=await e.keys(t,r);for(const c of i)if(a===o(c.url,s))return e.match(c,n)}(u,i.clone(),["__WB_REVISION__"],l):null;try{await u.put(i,f?c.clone():c)}catch(g){if(g instanceof Error)throw"QuotaExceededError"===g.name&&await async function(){for(const e of n)await e()}(),g}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:h,oldResponse:p,newResponse:c.clone(),request:i,event:this.event});return!0}async getCacheKey(e,t){const s="".concat(e.url," | ").concat(t);if(!this._cacheKeys[s]){let n=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))n=m(await e({mode:t,request:n,event:this.event,params:this.params}));this._cacheKeys[s]=n}return this._cacheKeys[s]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const s of this.iterateCallbacks(e))await s(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if("function"===typeof t[e]){const s=this._pluginStateMap.get(t),n=n=>{const a=Object.assign(Object.assign({},n),{state:s});return t[e](a)};yield n}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,s=!1;for(const n of this.iterateCallbacks("cacheWillUpdate"))if(t=await n({request:this.request,response:t,event:this.event})||void 0,s=!0,!t)break;return s||t&&200!==t.status&&(t=void 0),t}}class v{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.cacheName=c(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,s="string"===typeof e.request?new Request(e.request):e.request,n="params"in e?e.params:void 0,a=new _(this,{event:t,request:s,params:n}),r=this._getResponse(a,s,t);return[r,this._awaitComplete(r,a,s,t)]}async _getResponse(e,s,n){let a;await e.runCallbacks("handlerWillStart",{event:n,request:s});try{if(a=await this._handle(s,e),!a||"error"===a.type)throw new t("no-response",{url:s.url})}catch(r){if(r instanceof Error)for(const t of e.iterateCallbacks("handlerDidError"))if(a=await t({error:r,event:n,request:s}),a)break;if(!a)throw r}for(const t of e.iterateCallbacks("handlerWillRespond"))a=await t({event:n,request:s,response:a});return a}async _awaitComplete(e,t,s,n){let a,r;try{a=await e}catch(r){}try{await t.runCallbacks("handlerDidRespond",{event:n,request:s,response:a}),await t.doneWaiting()}catch(i){i instanceof Error&&(r=i)}if(await t.runCallbacks("handlerDidComplete",{event:n,request:s,response:a,error:r}),t.destroy(),r)throw r}}class b extends v{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.cacheName=i(e.cacheName),super(e),this._fallbackToNetwork=!1!==e.fallbackToNetwork,this.plugins.push(b.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const s=await t.cacheMatch(e);return s||(t.event&&"install"===t.event.type?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,s){let n;const a=s.params||{};if(!this._fallbackToNetwork)throw new t("missing-precache-entry",{cacheName:this.cacheName,url:e.url});{0;const t=a.integrity,r=e.integrity,i=!r||r===t;if(n=await s.fetch(new Request(e,{integrity:"no-cors"!==e.mode?r||t:void 0})),t&&i&&"no-cors"!==e.mode){this._useDefaultCacheabilityPluginIfNeeded();await s.cachePut(e,n.clone());0}}return n}async _handleInstall(e,s){this._useDefaultCacheabilityPluginIfNeeded();const n=await s.fetch(e);if(!await s.cachePut(e,n.clone()))throw new t("bad-precaching-response",{url:e.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[s,n]of this.plugins.entries())n!==b.copyRedirectedCacheableResponsesPlugin&&(n===b.defaultPrecacheCacheabilityPlugin&&(e=s),n.cacheWillUpdate&&t++);0===t?this.plugins.push(b.defaultPrecacheCacheabilityPlugin):t>1&&null!==e&&this.plugins.splice(e,1)}}b.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate(e){let{response:t}=e;return!t||t.status>=400?null:t}},b.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate(e){let{response:t}=e;return t.redirected?await p(t):t}};class R{constructor(){let{cacheName:e,plugins:t=[],fallbackToNetwork:s=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new b({cacheName:i(e),plugins:[...t,new y({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const s=[];for(const n of e){"string"===typeof n?s.push(n):n&&void 0===n.revision&&s.push(n.url);const{cacheKey:e,url:a}=g(n),r="string"!==typeof n&&n.revision?"reload":"default";if(this._urlsToCacheKeys.has(a)&&this._urlsToCacheKeys.get(a)!==e)throw new t("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(a),secondEntry:e});if("string"!==typeof n&&n.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==n.integrity)throw new t("add-to-cache-list-conflicting-integrities",{url:a});this._cacheKeysToIntegrities.set(e,n.integrity)}if(this._urlsToCacheKeys.set(a,e),this._urlsToCacheModes.set(a,r),s.length>0){const e="Workbox is precaching URLs without revision "+"info: ".concat(s.join(", "),"\nThis is generally NOT safe. ")+"Learn more at https://bit.ly/wb-precache";console.warn(e)}}}install(e){return f(e,(async()=>{const t=new w;this.strategy.plugins.push(t);for(const[a,r]of this._urlsToCacheKeys){const t=this._cacheKeysToIntegrities.get(r),s=this._urlsToCacheModes.get(a),n=new Request(a,{integrity:t,cache:s,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:r},request:n,event:e}))}const{updatedURLs:s,notUpdatedURLs:n}=t;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(e){return f(e,(async()=>{const e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),s=new Set(this._urlsToCacheKeys.values()),n=[];for(const a of t)s.has(a.url)||(await e.delete(a),n.push(a.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(e){const s=this.getCacheKeyForURL(e);if(!s)throw new t("non-precached-url",{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:s},t.params),this.strategy.handle(t))}}let x;const C=()=>(x||(x=new R),x);s(92);const E=e=>e&&"object"===typeof e?e:{handle:e};class L{constructor(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"GET";this.handler=E(t),this.match=e,this.method=s}setCatchHandler(e){this.catchHandler=E(e)}}class q extends L{constructor(e,t,s){super((t=>{let{url:s}=t;const n=e.exec(s.href);if(n&&(s.origin===location.origin||0===n.index))return n.slice(1)}),t,s)}}class D{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,s=this.handleRequest({request:t,event:e});s&&e.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&"CACHE_URLS"===e.data.type){const{payload:t}=e.data;0;const s=Promise.all(t.urlsToCache.map((t=>{"string"===typeof t&&(t=[t]);const s=new Request(...t);return this.handleRequest({request:s,event:e})})));e.waitUntil(s),e.ports&&e.ports[0]&&s.then((()=>e.ports[0].postMessage(!0)))}}))}handleRequest(e){let{request:t,event:s}=e;const n=new URL(t.url,location.href);if(!n.protocol.startsWith("http"))return void 0;const a=n.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:s,request:t,sameOrigin:a,url:n});let c=i&&i.handler;const o=t.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return void 0;let h;try{h=c.handle({url:n,request:t,event:s,params:r})}catch(u){h=Promise.reject(u)}const l=i&&i.catchHandler;return h instanceof Promise&&(this._catchHandler||l)&&(h=h.catch((async e=>{if(l){0;try{return await l.handle({url:n,request:t,event:s,params:r})}catch(a){a instanceof Error&&(e=a)}}if(this._catchHandler)return this._catchHandler.handle({url:n,request:t,event:s});throw e}))),h}findMatchingRoute(e){let{url:t,sameOrigin:s,request:n,event:a}=e;const r=this._routes.get(n.method)||[];for(const i of r){let e;const r=i.match({url:t,sameOrigin:s,request:n,event:a});if(r)return e=r,(Array.isArray(e)&&0===e.length||r.constructor===Object&&0===Object.keys(r).length||"boolean"===typeof r)&&(e=void 0),{route:i,params:e}}return{}}setDefaultHandler(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET";this._defaultHandlerMap.set(t,E(e))}setCatchHandler(e){this._catchHandler=E(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new t("unregister-route-but-not-found-with-method",{method:e.method});const s=this._routes.get(e.method).indexOf(e);if(!(s>-1))throw new t("unregister-route-route-not-registered");this._routes.get(e.method).splice(s,1)}}let U;const k=()=>(U||(U=new D,U.addFetchListener(),U.addCacheListener()),U);function T(e,s,n){let a;if("string"===typeof e){const t=new URL(e,location.href);0;a=new L((e=>{let{url:s}=e;return s.href===t.href}),s,n)}else if(e instanceof RegExp)a=new q(e,s,n);else if("function"===typeof e)a=new L(e,s,n);else{if(!(e instanceof L))throw new t("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});a=e}return k().registerRoute(a),a}class N extends L{constructor(e,t){super((s=>{let{request:n}=s;const a=e.getURLsToCacheKeys();for(const r of function(e){let{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){const r=new URL(e,location.href);r.hash="",yield r.href;const i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];for(const s of[...e.searchParams.keys()])t.some((e=>e.test(s)))&&e.searchParams.delete(s);return e}(r,t);if(yield i.href,s&&i.pathname.endsWith("/")){const e=new URL(i.href);e.pathname+=s,yield e.href}if(n){const e=new URL(i.href);e.pathname+=".html",yield e.href}if(a){const e=a({url:r});for(const t of e)yield t.href}}()}(n.url,t)){const t=a.get(r);if(t){return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}}}),e.strategy)}}const I=(e,t)=>t.some((t=>e instanceof t));let K,M;const A=new WeakMap,P=new WeakMap,S=new WeakMap,O=new WeakMap,W=new WeakMap;let B={get(e,t,s){if(e instanceof IDBTransaction){if("done"===t)return P.get(e);if("objectStoreNames"===t)return e.objectStoreNames||S.get(e);if("store"===t)return s.objectStoreNames[1]?void 0:s.objectStore(s.objectStoreNames[0])}return H(e[t])},set:(e,t,s)=>(e[t]=s,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function j(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(M||(M=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(){for(var t=arguments.length,s=new Array(t),n=0;n<t;n++)s[n]=arguments[n];return e.apply(V(this),s),H(A.get(this))}:function(){for(var t=arguments.length,s=new Array(t),n=0;n<t;n++)s[n]=arguments[n];return H(e.apply(V(this),s))}:function(t){for(var s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];const r=e.call(V(this),t,...n);return S.set(r,t.sort?t.sort():[t]),H(r)}}function F(e){return"function"===typeof e?j(e):(e instanceof IDBTransaction&&function(e){if(P.has(e))return;const t=new Promise(((t,s)=>{const n=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",r),e.removeEventListener("abort",r)},a=()=>{t(),n()},r=()=>{s(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",a),e.addEventListener("error",r),e.addEventListener("abort",r)}));P.set(e,t)}(e),I(e,K||(K=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,B):e)}function H(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,s)=>{const n=()=>{e.removeEventListener("success",a),e.removeEventListener("error",r)},a=()=>{t(H(e.result)),n()},r=()=>{s(e.error),n()};e.addEventListener("success",a),e.addEventListener("error",r)}));return t.then((t=>{t instanceof IDBCursor&&A.set(t,e)})).catch((()=>{})),W.set(t,e),t}(e);if(O.has(e))return O.get(e);const t=F(e);return t!==e&&(O.set(e,t),W.set(t,e)),t}const V=e=>W.get(e);const G=["get","getKey","getAll","getAllKeys","count"],Q=["put","add","delete","clear"],$=new Map;function J(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!==typeof t)return;if($.get(t))return $.get(t);const s=t.replace(/FromIndex$/,""),n=t!==s,a=Q.includes(s);if(!(s in(n?IDBIndex:IDBObjectStore).prototype)||!a&&!G.includes(s))return;const r=async function(e){const t=this.transaction(e,a?"readwrite":"readonly");let r=t.store;for(var i=arguments.length,c=new Array(i>1?i-1:0),o=1;o<i;o++)c[o-1]=arguments[o];return n&&(r=r.index(c.shift())),(await Promise.all([r[s](...c),a&&t.done]))[0]};return $.set(t,r),r}B=(e=>({...e,get:(t,s,n)=>J(t,s)||e.get(t,s,n),has:(t,s)=>!!J(t,s)||e.has(t,s)}))(B);s(434);const z="cache-entries",X=e=>{const t=new URL(e,location.href);return t.hash="",t.href};class Y{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(z,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&function(e){let{blocked:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=indexedDB.deleteDatabase(e);t&&s.addEventListener("blocked",(e=>t(e.oldVersion,e))),H(s).then((()=>{}))}(this._cacheName)}async setTimestamp(e,t){const s={url:e=X(e),timestamp:t,cacheName:this._cacheName,id:this._getId(e)},n=(await this.getDb()).transaction(z,"readwrite",{durability:"relaxed"});await n.store.put(s),await n.done}async getTimestamp(e){const t=await this.getDb(),s=await t.get(z,this._getId(e));return null===s||void 0===s?void 0:s.timestamp}async expireEntries(e,t){const s=await this.getDb();let n=await s.transaction(z).store.index("timestamp").openCursor(null,"prev");const a=[];let r=0;for(;n;){const s=n.value;s.cacheName===this._cacheName&&(e&&s.timestamp<e||t&&r>=t?a.push(n.value):r++),n=await n.continue()}const i=[];for(const c of a)await s.delete(z,c.id),i.push(c.url);return i}_getId(e){return this._cacheName+"|"+X(e)}async getDb(){return this._db||(this._db=await function(e,t){let{blocked:s,upgrade:n,blocking:a,terminated:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=indexedDB.open(e,t),c=H(i);return n&&i.addEventListener("upgradeneeded",(e=>{n(H(i.result),e.oldVersion,e.newVersion,H(i.transaction),e)})),s&&i.addEventListener("blocked",(e=>s(e.oldVersion,e.newVersion,e))),c.then((e=>{r&&e.addEventListener("close",(()=>r())),a&&e.addEventListener("versionchange",(e=>a(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),c}("workbox-expiration",1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class Z{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new Y(e)}async expireEntries(){if(this._isRunning)return void(this._rerunRequested=!0);this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-1e3*this._maxAgeSeconds:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),s=await self.caches.open(this._cacheName);for(const n of t)await s.delete(n,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,l(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),s=Date.now()-1e3*this._maxAgeSeconds;return void 0===t||t<s}return!1}async delete(){this._rerunRequested=!1,await this._timestampModel.expireEntries(1/0)}}const ee={cacheWillUpdate:async e=>{let{response:t}=e;return 200===t.status||0===t.status?t:null}};var te;(function(e){C().precache(e)})(([{'revision':'9781b79bcf08227827ed0e85b6047063','url':'./index.html'},{'revision':null,'url':'./static/css/1371.f696fdbf.chunk.css'},{'revision':null,'url':'./static/css/4665.5d6e9197.chunk.css'},{'revision':null,'url':'./static/css/4804.c723f709.chunk.css'},{'revision':null,'url':'./static/css/5312.9cab926a.chunk.css'},{'revision':null,'url':'./static/css/5570.bceba133.chunk.css'},{'revision':null,'url':'./static/css/7676.7f909312.chunk.css'},{'revision':null,'url':'./static/css/8219.f696fdbf.chunk.css'},{'revision':null,'url':'./static/css/main.d5f27ae7.css'},{'revision':null,'url':'./static/js/1059.35f4a575.chunk.js'},{'revision':null,'url':'./static/js/1294.03fe6694.chunk.js'},{'revision':null,'url':'./static/js/1361.c522d24a.chunk.js'},{'revision':null,'url':'./static/js/1366.b27f4401.chunk.js'},{'revision':null,'url':'./static/js/1371.c21feb0c.chunk.js'},{'revision':null,'url':'./static/js/1575.e3606f95.chunk.js'},{'revision':null,'url':'./static/js/1641.529fa061.chunk.js'},{'revision':null,'url':'./static/js/1667.dd9ab75a.chunk.js'},{'revision':null,'url':'./static/js/1685.d0fc9f5b.chunk.js'},{'revision':null,'url':'./static/js/175.ecbbae16.chunk.js'},{'revision':null,'url':'./static/js/1826.2ee3d019.chunk.js'},{'revision':null,'url':'./static/js/1846.6e3f3612.chunk.js'},{'revision':null,'url':'./static/js/1986.8a971924.chunk.js'},{'revision':null,'url':'./static/js/2019.820c27fc.chunk.js'},{'revision':null,'url':'./static/js/2098.a38c7200.chunk.js'},{'revision':null,'url':'./static/js/2129.fd2cfa2b.chunk.js'},{'revision':null,'url':'./static/js/2168.642bfc2e.chunk.js'},{'revision':null,'url':'./static/js/2183.0f4144d9.chunk.js'},{'revision':null,'url':'./static/js/2217.6a22ef31.chunk.js'},{'revision':null,'url':'./static/js/2294.c34a84c9.chunk.js'},{'revision':null,'url':'./static/js/233.a4eb89c7.chunk.js'},{'revision':null,'url':'./static/js/2362.e2682916.chunk.js'},{'revision':null,'url':'./static/js/2365.a3571172.chunk.js'},{'revision':null,'url':'./static/js/243.7a6f7438.chunk.js'},{'revision':null,'url':'./static/js/253.4a3aa017.chunk.js'},{'revision':null,'url':'./static/js/2537.10cf10fb.chunk.js'},{'revision':null,'url':'./static/js/2564.777b4d9f.chunk.js'},{'revision':null,'url':'./static/js/2611.b0ece77c.chunk.js'},{'revision':null,'url':'./static/js/2661.6a4f6166.chunk.js'},{'revision':null,'url':'./static/js/2720.147ae463.chunk.js'},{'revision':null,'url':'./static/js/2828.89d42424.chunk.js'},{'revision':null,'url':'./static/js/2842.1eebcd69.chunk.js'},{'revision':null,'url':'./static/js/2911.92a82b04.chunk.js'},{'revision':null,'url':'./static/js/2978.4e3df936.chunk.js'},{'revision':null,'url':'./static/js/31.39d475aa.chunk.js'},{'revision':null,'url':'./static/js/3111.f44a8d78.chunk.js'},{'revision':null,'url':'./static/js/3135.77d2718d.chunk.js'},{'revision':null,'url':'./static/js/3389.659cab57.chunk.js'},{'revision':null,'url':'./static/js/3476.47d6170f.chunk.js'},{'revision':null,'url':'./static/js/3555.91119c44.chunk.js'},{'revision':null,'url':'./static/js/3633.02809898.chunk.js'},{'revision':null,'url':'./static/js/3732.d5b401f7.chunk.js'},{'revision':null,'url':'./static/js/3803.ab7edaa3.chunk.js'},{'revision':null,'url':'./static/js/3829.2ca489ad.chunk.js'},{'revision':null,'url':'./static/js/3930.52f47c4a.chunk.js'},{'revision':null,'url':'./static/js/4074.e94a9635.chunk.js'},{'revision':null,'url':'./static/js/4104.d4d484aa.chunk.js'},{'revision':null,'url':'./static/js/4232.e30e2ef3.chunk.js'},{'revision':null,'url':'./static/js/4241.fe0e853e.chunk.js'},{'revision':null,'url':'./static/js/4274.75f87895.chunk.js'},{'revision':null,'url':'./static/js/4296.d10d8d5e.chunk.js'},{'revision':null,'url':'./static/js/4317.91732893.chunk.js'},{'revision':null,'url':'./static/js/4349.b225724a.chunk.js'},{'revision':null,'url':'./static/js/436.e7d7ead3.chunk.js'},{'revision':null,'url':'./static/js/440.09c3a54d.chunk.js'},{'revision':null,'url':'./static/js/442.d95b0c5a.chunk.js'},{'revision':null,'url':'./static/js/4423.cd5bf3f2.chunk.js'},{'revision':null,'url':'./static/js/4465.d149319d.chunk.js'},{'revision':null,'url':'./static/js/4512.d09c80a3.chunk.js'},{'revision':null,'url':'./static/js/4527.6d3ce631.chunk.js'},{'revision':null,'url':'./static/js/4545.4f5c0bd5.chunk.js'},{'revision':null,'url':'./static/js/4549.3a768671.chunk.js'},{'revision':null,'url':'./static/js/4550.5981074d.chunk.js'},{'revision':null,'url':'./static/js/4590.39f2b68f.chunk.js'},{'revision':null,'url':'./static/js/4631.f627efb4.chunk.js'},{'revision':null,'url':'./static/js/4654.24f11775.chunk.js'},{'revision':null,'url':'./static/js/4657.1be0470f.chunk.js'},{'revision':null,'url':'./static/js/4775.6cffbd67.chunk.js'},{'revision':null,'url':'./static/js/4804.0799b676.chunk.js'},{'revision':null,'url':'./static/js/4852.f41ccaf2.chunk.js'},{'revision':null,'url':'./static/js/4901.dce8c299.chunk.js'},{'revision':null,'url':'./static/js/4906.7f0752d1.chunk.js'},{'revision':null,'url':'./static/js/5015.0b517513.chunk.js'},{'revision':null,'url':'./static/js/5059.92ba11ba.chunk.js'},{'revision':null,'url':'./static/js/506.fe1f4c17.chunk.js'},{'revision':null,'url':'./static/js/5074.217389e9.chunk.js'},{'revision':null,'url':'./static/js/5163.cca32038.chunk.js'},{'revision':null,'url':'./static/js/5312.fa7da622.chunk.js'},{'revision':null,'url':'./static/js/5374.cc49abd9.chunk.js'},{'revision':null,'url':'./static/js/5526.1aec6323.chunk.js'},{'revision':null,'url':'./static/js/556.cfa178eb.chunk.js'},{'revision':null,'url':'./static/js/5570.744c0299.chunk.js'},{'revision':null,'url':'./static/js/5706.f5e6f131.chunk.js'},{'revision':null,'url':'./static/js/5748.7d3c9c26.chunk.js'},{'revision':null,'url':'./static/js/5760.b43b20af.chunk.js'},{'revision':null,'url':'./static/js/5784.372681fa.chunk.js'},{'revision':null,'url':'./static/js/5904.02123820.chunk.js'},{'revision':null,'url':'./static/js/592.083d62e1.chunk.js'},{'revision':null,'url':'./static/js/5979.a7c1a387.chunk.js'},{'revision':null,'url':'./static/js/6179.fbea7365.chunk.js'},{'revision':null,'url':'./static/js/6511.7e5a293c.chunk.js'},{'revision':null,'url':'./static/js/6547.7b4a8db4.chunk.js'},{'revision':null,'url':'./static/js/6602.34495e3d.chunk.js'},{'revision':null,'url':'./static/js/662.72ee2e58.chunk.js'},{'revision':null,'url':'./static/js/6629.5fc65d11.chunk.js'},{'revision':null,'url':'./static/js/6703.7c9ac00a.chunk.js'},{'revision':null,'url':'./static/js/6743.5a8d8d86.chunk.js'},{'revision':null,'url':'./static/js/6780.aa9fb3ec.chunk.js'},{'revision':null,'url':'./static/js/6830.1a23c027.chunk.js'},{'revision':null,'url':'./static/js/6906.f1f89f90.chunk.js'},{'revision':null,'url':'./static/js/6944.7f3fe691.chunk.js'},{'revision':null,'url':'./static/js/7020.30a59f59.chunk.js'},{'revision':null,'url':'./static/js/7022.7b668dae.chunk.js'},{'revision':null,'url':'./static/js/7082.bc59e4c9.chunk.js'},{'revision':null,'url':'./static/js/7327.d1805380.chunk.js'},{'revision':null,'url':'./static/js/744.74c12fbb.chunk.js'},{'revision':null,'url':'./static/js/754.95d43c7d.chunk.js'},{'revision':null,'url':'./static/js/7638.9fd0dda5.chunk.js'},{'revision':null,'url':'./static/js/7641.a0822ba8.chunk.js'},{'revision':null,'url':'./static/js/7676.f117fb2d.chunk.js'},{'revision':null,'url':'./static/js/7718.43bea793.chunk.js'},{'revision':null,'url':'./static/js/7865.9cfee717.chunk.js'},{'revision':null,'url':'./static/js/7913.554f4e7d.chunk.js'},{'revision':null,'url':'./static/js/8139.94d2309f.chunk.js'},{'revision':null,'url':'./static/js/8170.29705904.chunk.js'},{'revision':null,'url':'./static/js/8219.0110ce93.chunk.js'},{'revision':null,'url':'./static/js/8249.b3efc43c.chunk.js'},{'revision':null,'url':'./static/js/8262.39716df6.chunk.js'},{'revision':null,'url':'./static/js/8537.a9d1958b.chunk.js'},{'revision':null,'url':'./static/js/8542.9ee442f2.chunk.js'},{'revision':null,'url':'./static/js/8590.0bffbd32.chunk.js'},{'revision':null,'url':'./static/js/8606.a872b105.chunk.js'},{'revision':null,'url':'./static/js/8646.4850021f.chunk.js'},{'revision':null,'url':'./static/js/8809.82c05cab.chunk.js'},{'revision':null,'url':'./static/js/8986.41d2268d.chunk.js'},{'revision':null,'url':'./static/js/9038.aa97e3e5.chunk.js'},{'revision':null,'url':'./static/js/9041.62504f43.chunk.js'},{'revision':null,'url':'./static/js/9085.d0aa2a89.chunk.js'},{'revision':null,'url':'./static/js/9132.37a79b4e.chunk.js'},{'revision':null,'url':'./static/js/9248.6cfcd5b2.chunk.js'},{'revision':null,'url':'./static/js/9282.9940b6e0.chunk.js'},{'revision':null,'url':'./static/js/9327.93934827.chunk.js'},{'revision':null,'url':'./static/js/9371.a03ab63e.chunk.js'},{'revision':null,'url':'./static/js/9450.5a43999b.chunk.js'},{'revision':null,'url':'./static/js/9517.ac659c32.chunk.js'},{'revision':null,'url':'./static/js/9552.becd4013.chunk.js'},{'revision':null,'url':'./static/js/9586.ba21307f.chunk.js'},{'revision':null,'url':'./static/js/9590.694b5369.chunk.js'},{'revision':null,'url':'./static/js/9651.0cb999aa.chunk.js'},{'revision':null,'url':'./static/js/9662.0639afb1.chunk.js'},{'revision':null,'url':'./static/js/9725.85b47edf.chunk.js'},{'revision':null,'url':'./static/js/main.c0cb47f8.js'},{'revision':'8e707674580ac8fed33fddf8cdf26b38','url':'./static/media/empty-spaces-nft.f2f7da76d96b54cf8a379d6b32edc7f1.svg'},{'revision':null,'url':'./static/media/inter-latin-300-normal.2d4c4e1b0312ac8dc566.woff2'},{'revision':null,'url':'./static/media/inter-latin-300-normal.cf40b5e95ba0d5016b19.woff'},{'revision':null,'url':'./static/media/inter-latin-400-normal.08a02fd275ecea6ef662.woff'},{'revision':null,'url':'./static/media/inter-latin-400-normal.f1535355a7df553be385.woff2'},{'revision':null,'url':'./static/media/inter-latin-500-normal.4eedffe43452a87e61bd.woff'},{'revision':null,'url':'./static/media/inter-latin-500-normal.6629df60b0706dec8113.woff2'},{'revision':null,'url':'./static/media/inter-latin-700-normal.91c4ed20ea233963e54f.woff'},{'revision':null,'url':'./static/media/inter-latin-700-normal.b4118e4ad76754e71d0b.woff2'},{'revision':null,'url':'./static/media/inter-latin-ext-300-normal.1325a175af98c903b8fd.woff2'},{'revision':null,'url':'./static/media/inter-latin-ext-300-normal.88505150df5d39d11f1c.woff'},{'revision':null,'url':'./static/media/inter-latin-ext-400-normal.0f9e8d4e940df8f6edfe.woff2'},{'revision':null,'url':'./static/media/inter-latin-ext-400-normal.40b3b0d5e09a90fb6e3e.woff'},{'revision':null,'url':'./static/media/inter-latin-ext-500-normal.abd2dd4838a0148febb9.woff'},{'revision':null,'url':'./static/media/inter-latin-ext-500-normal.bed85b98c34f434a1c80.woff2'},{'revision':null,'url':'./static/media/inter-latin-ext-700-normal.4c2578dbd1ff5ea14172.woff'},{'revision':null,'url':'./static/media/inter-latin-ext-700-normal.65678f6198b402319e15.woff2'},{'revision':null,'url':'./static/media/login-bg.9936fc84e60f5cea6739.png'},{'revision':'3f75f5574309bf1ab1a642cae6cec338','url':'./static/media/logo.60f66bbe1ce9674a4df4e374c9d97fc4.svg'},{'revision':'893e153699e6c3cbf74132eacdb77fa6','url':'./static/media/space-connected.9a4e18fd2bc7d065191b0d241a131c28.svg'},{'revision':null,'url':'./static/media/ubuntu-mono-cyrillic-400-normal.3d8a2767436c97526e5e.woff'},{'revision':null,'url':'./static/media/ubuntu-mono-cyrillic-400-normal.c367f416832eb8f1b846.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-cyrillic-ext-400-normal.e06671814416d634c36e.woff'},{'revision':null,'url':'./static/media/ubuntu-mono-cyrillic-ext-400-normal.eda1c4946b1f7bf58386.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-greek-400-normal.229eedabb26a787909cf.woff'},{'revision':null,'url':'./static/media/ubuntu-mono-greek-400-normal.22f3bfc91f79c342bdf4.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-greek-ext-400-normal.1bfcab2ece1ff3d4cc92.woff'},{'revision':null,'url':'./static/media/ubuntu-mono-greek-ext-400-normal.b3459900ea8a25d1f7c2.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-latin-400-normal.18e32d9d743af28f913e.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-latin-400-normal.3d12a93009cd936623de.woff'},{'revision':null,'url':'./static/media/ubuntu-mono-latin-ext-400-normal.691ea3fbf57333b3b408.woff'},{'revision':null,'url':'./static/media/ubuntu-mono-latin-ext-400-normal.7203caccc2b5871be756.woff2'}]||[]).filter((e=>"/"!==e.url&&!e.url.includes("index.html")))),function(e){const t=C();T(new N(t,e))}(te),self.addEventListener("activate",(()=>self.clients.claim())),self.addEventListener("activate",(()=>{console.log("Service Worker activated")})),self.addEventListener("install",(e=>{console.log("Service Worker installed"),e.waitUntil(self.skipWaiting())}));const se=e=>"GET"!==e.method||(!!e.url.includes("/api")||(!!e.url.includes("__meta__.js")||!!e.url.includes("__blocklet__.js")));T((e=>{const{request:t}=e;return!se(t)&&t.url.includes("/static/")}),new class extends v{async _handle(e,s){let n,a=await s.cacheMatch(e);if(a)0;else{0;try{a=await s.fetchAndCachePut(e)}catch(r){r instanceof Error&&(n=r)}0}if(!a)throw new t("no-response",{url:e.url,error:n});return a}}({cacheName:"static",plugins:[new class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.cachedResponseWillBeUsed=async e=>{let{event:t,request:s,cacheName:n,cachedResponse:a}=e;if(!a)return null;const r=this._isResponseDateFresh(a),i=this._getCacheExpiration(n);l(i.expireEntries());const c=i.updateTimestamp(s.url);if(t)try{t.waitUntil(c)}catch(o){0}return r?a:null},this.cacheDidUpdate=async e=>{let{cacheName:t,request:s}=e;const n=this._getCacheExpiration(t);await n.updateTimestamp(s.url),await n.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&function(e){n.add(e)}((()=>this.deleteCacheAndMetadata()))}_getCacheExpiration(e){if(e===c())throw new t("expire-custom-caches-only");let s=this._cacheExpirations.get(e);return s||(s=new Z(e,this._config),this._cacheExpirations.set(e,s)),s}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(null===t)return!0;return t>=Date.now()-1e3*this._maxAgeSeconds}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),s=new Date(t).getTime();return isNaN(s)?null:s}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}({maxEntries:200})]})),T((e=>{const{request:t}=e;return!se(t)&&(t.url.includes("/images/")||t.url.includes("/icons/"))}),new class extends v{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.plugins.some((e=>"cacheWillUpdate"in e))||this.plugins.unshift(ee)}async _handle(e,s){const n=s.fetchAndCachePut(e).catch((()=>{}));s.waitUntil(n);let a,r=await s.cacheMatch(e);if(r)0;else{0;try{r=await n}catch(i){i instanceof Error&&(a=i)}}if(!r)throw new t("no-response",{url:e.url,error:a});return r}})})()})();
|
|
1
|
+
(()=>{"use strict";var e={522:()=>{try{self["workbox:core:7.0.0"]&&_()}catch(e){}},434:()=>{try{self["workbox:expiration:7.0.0"]&&_()}catch(e){}},290:()=>{try{self["workbox:precaching:7.0.0"]&&_()}catch(e){}},92:()=>{try{self["workbox:routing:7.0.0"]&&_()}catch(e){}},559:()=>{try{self["workbox:strategies:7.0.0"]&&_()}catch(e){}}},t={};function s(n){var a=t[n];if(void 0!==a)return a.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,s),r.exports}(()=>{s(522);const e=function(e){let t=e;for(var s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];return n.length>0&&(t+=" :: ".concat(JSON.stringify(n))),t};class t extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}const n=new Set;const a={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!==typeof registration?registration.scope:""},r=e=>[a.prefix,e,a.suffix].filter((e=>e&&e.length>0)).join("-"),i=e=>e||r(a.precache),c=e=>e||r(a.runtime);function o(e,t){const s=new URL(e);for(const n of t)s.searchParams.delete(n);return s.href}let h;function l(e){e.then((()=>{}))}class u{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}const d=e=>new URL(String(e),location.href).href.replace(new RegExp("^".concat(location.origin)),"");function f(e,t){const s=t();return e.waitUntil(s),s}async function p(e,s){let n=null;if(e.url){n=new URL(e.url).origin}if(n!==self.location.origin)throw new t("cross-origin-copy-response",{origin:n});const a=e.clone(),r={headers:new Headers(a.headers),status:a.status,statusText:a.statusText},i=s?s(r):r,c=function(){if(void 0===h){const t=new Response("");if("body"in t)try{new Response(t.body),h=!0}catch(e){h=!1}h=!1}return h}()?a.body:await a.blob();return new Response(c,i)}s(290);function g(e){if(!e)throw new t("add-to-cache-list-unexpected-type",{entry:e});if("string"===typeof e){const t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}const{revision:s,url:n}=e;if(!n)throw new t("add-to-cache-list-unexpected-type",{entry:e});if(!s){const e=new URL(n,location.href);return{cacheKey:e.href,url:e.href}}const a=new URL(n,location.href),r=new URL(n,location.href);return a.searchParams.set("__WB_REVISION__",s),{cacheKey:a.href,url:r.href}}class w{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async e=>{let{request:t,state:s}=e;s&&(s.originalRequest=t)},this.cachedResponseWillBeUsed=async e=>{let{event:t,state:s,cachedResponse:n}=e;if("install"===t.type&&s&&s.originalRequest&&s.originalRequest instanceof Request){const e=s.originalRequest.url;n?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return n}}}class y{constructor(e){let{precacheController:t}=e;this.cacheKeyWillBeUsed=async e=>{let{request:t,params:s}=e;const n=(null===s||void 0===s?void 0:s.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return n?new Request(n,{headers:t.headers}):t},this._precacheController=t}}s(559);function m(e){return"string"===typeof e?new Request(e):e}class _{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new u,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const s of this._plugins)this._pluginStateMap.set(s,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:s}=this;let n=m(e);if("navigate"===n.mode&&s instanceof FetchEvent&&s.preloadResponse){const e=await s.preloadResponse;if(e)return e}const a=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))n=await e({request:n.clone(),event:s})}catch(i){if(i instanceof Error)throw new t("plugin-error-request-will-fetch",{thrownErrorMessage:i.message})}const r=n.clone();try{let e;e=await fetch(n,"navigate"===n.mode?void 0:this._strategy.fetchOptions);for(const t of this.iterateCallbacks("fetchDidSucceed"))e=await t({event:s,request:r,response:e});return e}catch(c){throw a&&await this.runCallbacks("fetchDidFail",{error:c,event:s,originalRequest:a.clone(),request:r.clone()}),c}}async fetchAndCachePut(e){const t=await this.fetch(e),s=t.clone();return this.waitUntil(this.cachePut(e,s)),t}async cacheMatch(e){const t=m(e);let s;const{cacheName:n,matchOptions:a}=this._strategy,r=await this.getCacheKey(t,"read"),i=Object.assign(Object.assign({},a),{cacheName:n});s=await caches.match(r,i);for(const c of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await c({cacheName:n,matchOptions:a,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(e,s){const a=m(e);var r;await(r=0,new Promise((e=>setTimeout(e,r))));const i=await this.getCacheKey(a,"write");if(!s)throw new t("cache-put-with-no-response",{url:d(i.url)});const c=await this._ensureResponseSafeToCache(s);if(!c)return!1;const{cacheName:h,matchOptions:l}=this._strategy,u=await self.caches.open(h),f=this.hasCallback("cacheDidUpdate"),p=f?await async function(e,t,s,n){const a=o(t.url,s);if(t.url===a)return e.match(t,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),i=await e.keys(t,r);for(const c of i)if(a===o(c.url,s))return e.match(c,n)}(u,i.clone(),["__WB_REVISION__"],l):null;try{await u.put(i,f?c.clone():c)}catch(g){if(g instanceof Error)throw"QuotaExceededError"===g.name&&await async function(){for(const e of n)await e()}(),g}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:h,oldResponse:p,newResponse:c.clone(),request:i,event:this.event});return!0}async getCacheKey(e,t){const s="".concat(e.url," | ").concat(t);if(!this._cacheKeys[s]){let n=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))n=m(await e({mode:t,request:n,event:this.event,params:this.params}));this._cacheKeys[s]=n}return this._cacheKeys[s]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const s of this.iterateCallbacks(e))await s(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if("function"===typeof t[e]){const s=this._pluginStateMap.get(t),n=n=>{const a=Object.assign(Object.assign({},n),{state:s});return t[e](a)};yield n}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,s=!1;for(const n of this.iterateCallbacks("cacheWillUpdate"))if(t=await n({request:this.request,response:t,event:this.event})||void 0,s=!0,!t)break;return s||t&&200!==t.status&&(t=void 0),t}}class v{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.cacheName=c(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,s="string"===typeof e.request?new Request(e.request):e.request,n="params"in e?e.params:void 0,a=new _(this,{event:t,request:s,params:n}),r=this._getResponse(a,s,t);return[r,this._awaitComplete(r,a,s,t)]}async _getResponse(e,s,n){let a;await e.runCallbacks("handlerWillStart",{event:n,request:s});try{if(a=await this._handle(s,e),!a||"error"===a.type)throw new t("no-response",{url:s.url})}catch(r){if(r instanceof Error)for(const t of e.iterateCallbacks("handlerDidError"))if(a=await t({error:r,event:n,request:s}),a)break;if(!a)throw r}for(const t of e.iterateCallbacks("handlerWillRespond"))a=await t({event:n,request:s,response:a});return a}async _awaitComplete(e,t,s,n){let a,r;try{a=await e}catch(r){}try{await t.runCallbacks("handlerDidRespond",{event:n,request:s,response:a}),await t.doneWaiting()}catch(i){i instanceof Error&&(r=i)}if(await t.runCallbacks("handlerDidComplete",{event:n,request:s,response:a,error:r}),t.destroy(),r)throw r}}class b extends v{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.cacheName=i(e.cacheName),super(e),this._fallbackToNetwork=!1!==e.fallbackToNetwork,this.plugins.push(b.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const s=await t.cacheMatch(e);return s||(t.event&&"install"===t.event.type?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,s){let n;const a=s.params||{};if(!this._fallbackToNetwork)throw new t("missing-precache-entry",{cacheName:this.cacheName,url:e.url});{0;const t=a.integrity,r=e.integrity,i=!r||r===t;if(n=await s.fetch(new Request(e,{integrity:"no-cors"!==e.mode?r||t:void 0})),t&&i&&"no-cors"!==e.mode){this._useDefaultCacheabilityPluginIfNeeded();await s.cachePut(e,n.clone());0}}return n}async _handleInstall(e,s){this._useDefaultCacheabilityPluginIfNeeded();const n=await s.fetch(e);if(!await s.cachePut(e,n.clone()))throw new t("bad-precaching-response",{url:e.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[s,n]of this.plugins.entries())n!==b.copyRedirectedCacheableResponsesPlugin&&(n===b.defaultPrecacheCacheabilityPlugin&&(e=s),n.cacheWillUpdate&&t++);0===t?this.plugins.push(b.defaultPrecacheCacheabilityPlugin):t>1&&null!==e&&this.plugins.splice(e,1)}}b.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate(e){let{response:t}=e;return!t||t.status>=400?null:t}},b.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate(e){let{response:t}=e;return t.redirected?await p(t):t}};class R{constructor(){let{cacheName:e,plugins:t=[],fallbackToNetwork:s=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new b({cacheName:i(e),plugins:[...t,new y({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const s=[];for(const n of e){"string"===typeof n?s.push(n):n&&void 0===n.revision&&s.push(n.url);const{cacheKey:e,url:a}=g(n),r="string"!==typeof n&&n.revision?"reload":"default";if(this._urlsToCacheKeys.has(a)&&this._urlsToCacheKeys.get(a)!==e)throw new t("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(a),secondEntry:e});if("string"!==typeof n&&n.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==n.integrity)throw new t("add-to-cache-list-conflicting-integrities",{url:a});this._cacheKeysToIntegrities.set(e,n.integrity)}if(this._urlsToCacheKeys.set(a,e),this._urlsToCacheModes.set(a,r),s.length>0){const e="Workbox is precaching URLs without revision "+"info: ".concat(s.join(", "),"\nThis is generally NOT safe. ")+"Learn more at https://bit.ly/wb-precache";console.warn(e)}}}install(e){return f(e,(async()=>{const t=new w;this.strategy.plugins.push(t);for(const[a,r]of this._urlsToCacheKeys){const t=this._cacheKeysToIntegrities.get(r),s=this._urlsToCacheModes.get(a),n=new Request(a,{integrity:t,cache:s,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:r},request:n,event:e}))}const{updatedURLs:s,notUpdatedURLs:n}=t;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(e){return f(e,(async()=>{const e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),s=new Set(this._urlsToCacheKeys.values()),n=[];for(const a of t)s.has(a.url)||(await e.delete(a),n.push(a.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(e){const s=this.getCacheKeyForURL(e);if(!s)throw new t("non-precached-url",{url:e});return t=>(t.request=new Request(e),t.params=Object.assign({cacheKey:s},t.params),this.strategy.handle(t))}}let x;const C=()=>(x||(x=new R),x);s(92);const E=e=>e&&"object"===typeof e?e:{handle:e};class L{constructor(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"GET";this.handler=E(t),this.match=e,this.method=s}setCatchHandler(e){this.catchHandler=E(e)}}class q extends L{constructor(e,t,s){super((t=>{let{url:s}=t;const n=e.exec(s.href);if(n&&(s.origin===location.origin||0===n.index))return n.slice(1)}),t,s)}}class D{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,s=this.handleRequest({request:t,event:e});s&&e.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&"CACHE_URLS"===e.data.type){const{payload:t}=e.data;0;const s=Promise.all(t.urlsToCache.map((t=>{"string"===typeof t&&(t=[t]);const s=new Request(...t);return this.handleRequest({request:s,event:e})})));e.waitUntil(s),e.ports&&e.ports[0]&&s.then((()=>e.ports[0].postMessage(!0)))}}))}handleRequest(e){let{request:t,event:s}=e;const n=new URL(t.url,location.href);if(!n.protocol.startsWith("http"))return void 0;const a=n.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:s,request:t,sameOrigin:a,url:n});let c=i&&i.handler;const o=t.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return void 0;let h;try{h=c.handle({url:n,request:t,event:s,params:r})}catch(u){h=Promise.reject(u)}const l=i&&i.catchHandler;return h instanceof Promise&&(this._catchHandler||l)&&(h=h.catch((async e=>{if(l){0;try{return await l.handle({url:n,request:t,event:s,params:r})}catch(a){a instanceof Error&&(e=a)}}if(this._catchHandler)return this._catchHandler.handle({url:n,request:t,event:s});throw e}))),h}findMatchingRoute(e){let{url:t,sameOrigin:s,request:n,event:a}=e;const r=this._routes.get(n.method)||[];for(const i of r){let e;const r=i.match({url:t,sameOrigin:s,request:n,event:a});if(r)return e=r,(Array.isArray(e)&&0===e.length||r.constructor===Object&&0===Object.keys(r).length||"boolean"===typeof r)&&(e=void 0),{route:i,params:e}}return{}}setDefaultHandler(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET";this._defaultHandlerMap.set(t,E(e))}setCatchHandler(e){this._catchHandler=E(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new t("unregister-route-but-not-found-with-method",{method:e.method});const s=this._routes.get(e.method).indexOf(e);if(!(s>-1))throw new t("unregister-route-route-not-registered");this._routes.get(e.method).splice(s,1)}}let U;const k=()=>(U||(U=new D,U.addFetchListener(),U.addCacheListener()),U);function T(e,s,n){let a;if("string"===typeof e){const t=new URL(e,location.href);0;a=new L((e=>{let{url:s}=e;return s.href===t.href}),s,n)}else if(e instanceof RegExp)a=new q(e,s,n);else if("function"===typeof e)a=new L(e,s,n);else{if(!(e instanceof L))throw new t("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});a=e}return k().registerRoute(a),a}class N extends L{constructor(e,t){super((s=>{let{request:n}=s;const a=e.getURLsToCacheKeys();for(const r of function(e){let{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){const r=new URL(e,location.href);r.hash="",yield r.href;const i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];for(const s of[...e.searchParams.keys()])t.some((e=>e.test(s)))&&e.searchParams.delete(s);return e}(r,t);if(yield i.href,s&&i.pathname.endsWith("/")){const e=new URL(i.href);e.pathname+=s,yield e.href}if(n){const e=new URL(i.href);e.pathname+=".html",yield e.href}if(a){const e=a({url:r});for(const t of e)yield t.href}}()}(n.url,t)){const t=a.get(r);if(t){return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}}}),e.strategy)}}const I=(e,t)=>t.some((t=>e instanceof t));let K,M;const A=new WeakMap,P=new WeakMap,S=new WeakMap,O=new WeakMap,W=new WeakMap;let B={get(e,t,s){if(e instanceof IDBTransaction){if("done"===t)return P.get(e);if("objectStoreNames"===t)return e.objectStoreNames||S.get(e);if("store"===t)return s.objectStoreNames[1]?void 0:s.objectStore(s.objectStoreNames[0])}return H(e[t])},set:(e,t,s)=>(e[t]=s,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function j(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(M||(M=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(){for(var t=arguments.length,s=new Array(t),n=0;n<t;n++)s[n]=arguments[n];return e.apply(V(this),s),H(A.get(this))}:function(){for(var t=arguments.length,s=new Array(t),n=0;n<t;n++)s[n]=arguments[n];return H(e.apply(V(this),s))}:function(t){for(var s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];const r=e.call(V(this),t,...n);return S.set(r,t.sort?t.sort():[t]),H(r)}}function F(e){return"function"===typeof e?j(e):(e instanceof IDBTransaction&&function(e){if(P.has(e))return;const t=new Promise(((t,s)=>{const n=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",r),e.removeEventListener("abort",r)},a=()=>{t(),n()},r=()=>{s(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",a),e.addEventListener("error",r),e.addEventListener("abort",r)}));P.set(e,t)}(e),I(e,K||(K=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,B):e)}function H(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,s)=>{const n=()=>{e.removeEventListener("success",a),e.removeEventListener("error",r)},a=()=>{t(H(e.result)),n()},r=()=>{s(e.error),n()};e.addEventListener("success",a),e.addEventListener("error",r)}));return t.then((t=>{t instanceof IDBCursor&&A.set(t,e)})).catch((()=>{})),W.set(t,e),t}(e);if(O.has(e))return O.get(e);const t=F(e);return t!==e&&(O.set(e,t),W.set(t,e)),t}const V=e=>W.get(e);const G=["get","getKey","getAll","getAllKeys","count"],Q=["put","add","delete","clear"],$=new Map;function J(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!==typeof t)return;if($.get(t))return $.get(t);const s=t.replace(/FromIndex$/,""),n=t!==s,a=Q.includes(s);if(!(s in(n?IDBIndex:IDBObjectStore).prototype)||!a&&!G.includes(s))return;const r=async function(e){const t=this.transaction(e,a?"readwrite":"readonly");let r=t.store;for(var i=arguments.length,c=new Array(i>1?i-1:0),o=1;o<i;o++)c[o-1]=arguments[o];return n&&(r=r.index(c.shift())),(await Promise.all([r[s](...c),a&&t.done]))[0]};return $.set(t,r),r}B=(e=>({...e,get:(t,s,n)=>J(t,s)||e.get(t,s,n),has:(t,s)=>!!J(t,s)||e.has(t,s)}))(B);s(434);const z="cache-entries",X=e=>{const t=new URL(e,location.href);return t.hash="",t.href};class Y{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(z,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&function(e){let{blocked:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=indexedDB.deleteDatabase(e);t&&s.addEventListener("blocked",(e=>t(e.oldVersion,e))),H(s).then((()=>{}))}(this._cacheName)}async setTimestamp(e,t){const s={url:e=X(e),timestamp:t,cacheName:this._cacheName,id:this._getId(e)},n=(await this.getDb()).transaction(z,"readwrite",{durability:"relaxed"});await n.store.put(s),await n.done}async getTimestamp(e){const t=await this.getDb(),s=await t.get(z,this._getId(e));return null===s||void 0===s?void 0:s.timestamp}async expireEntries(e,t){const s=await this.getDb();let n=await s.transaction(z).store.index("timestamp").openCursor(null,"prev");const a=[];let r=0;for(;n;){const s=n.value;s.cacheName===this._cacheName&&(e&&s.timestamp<e||t&&r>=t?a.push(n.value):r++),n=await n.continue()}const i=[];for(const c of a)await s.delete(z,c.id),i.push(c.url);return i}_getId(e){return this._cacheName+"|"+X(e)}async getDb(){return this._db||(this._db=await function(e,t){let{blocked:s,upgrade:n,blocking:a,terminated:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=indexedDB.open(e,t),c=H(i);return n&&i.addEventListener("upgradeneeded",(e=>{n(H(i.result),e.oldVersion,e.newVersion,H(i.transaction),e)})),s&&i.addEventListener("blocked",(e=>s(e.oldVersion,e.newVersion,e))),c.then((e=>{r&&e.addEventListener("close",(()=>r())),a&&e.addEventListener("versionchange",(e=>a(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),c}("workbox-expiration",1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class Z{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new Y(e)}async expireEntries(){if(this._isRunning)return void(this._rerunRequested=!0);this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-1e3*this._maxAgeSeconds:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),s=await self.caches.open(this._cacheName);for(const n of t)await s.delete(n,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,l(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),s=Date.now()-1e3*this._maxAgeSeconds;return void 0===t||t<s}return!1}async delete(){this._rerunRequested=!1,await this._timestampModel.expireEntries(1/0)}}const ee={cacheWillUpdate:async e=>{let{response:t}=e;return 200===t.status||0===t.status?t:null}};var te;(function(e){C().precache(e)})(([{'revision':'c2ca424d3fa27ee786d3ea32f95fbda4','url':'./index.html'},{'revision':null,'url':'./static/css/1371.f696fdbf.chunk.css'},{'revision':null,'url':'./static/css/4665.5d6e9197.chunk.css'},{'revision':null,'url':'./static/css/4804.c723f709.chunk.css'},{'revision':null,'url':'./static/css/5312.9cab926a.chunk.css'},{'revision':null,'url':'./static/css/5570.bceba133.chunk.css'},{'revision':null,'url':'./static/css/7676.7f909312.chunk.css'},{'revision':null,'url':'./static/css/8219.f696fdbf.chunk.css'},{'revision':null,'url':'./static/css/main.d5f27ae7.css'},{'revision':null,'url':'./static/js/1059.35f4a575.chunk.js'},{'revision':null,'url':'./static/js/1294.03fe6694.chunk.js'},{'revision':null,'url':'./static/js/1361.c522d24a.chunk.js'},{'revision':null,'url':'./static/js/1366.b27f4401.chunk.js'},{'revision':null,'url':'./static/js/1371.c21feb0c.chunk.js'},{'revision':null,'url':'./static/js/1575.e3606f95.chunk.js'},{'revision':null,'url':'./static/js/1641.529fa061.chunk.js'},{'revision':null,'url':'./static/js/1667.dd9ab75a.chunk.js'},{'revision':null,'url':'./static/js/1685.d0fc9f5b.chunk.js'},{'revision':null,'url':'./static/js/175.ecbbae16.chunk.js'},{'revision':null,'url':'./static/js/1826.2ee3d019.chunk.js'},{'revision':null,'url':'./static/js/1846.6e3f3612.chunk.js'},{'revision':null,'url':'./static/js/1986.8a971924.chunk.js'},{'revision':null,'url':'./static/js/2019.820c27fc.chunk.js'},{'revision':null,'url':'./static/js/2098.a38c7200.chunk.js'},{'revision':null,'url':'./static/js/2129.fd2cfa2b.chunk.js'},{'revision':null,'url':'./static/js/2168.642bfc2e.chunk.js'},{'revision':null,'url':'./static/js/2183.0f4144d9.chunk.js'},{'revision':null,'url':'./static/js/2217.6a22ef31.chunk.js'},{'revision':null,'url':'./static/js/2294.c34a84c9.chunk.js'},{'revision':null,'url':'./static/js/233.a4eb89c7.chunk.js'},{'revision':null,'url':'./static/js/2362.e2682916.chunk.js'},{'revision':null,'url':'./static/js/2365.a3571172.chunk.js'},{'revision':null,'url':'./static/js/243.7a6f7438.chunk.js'},{'revision':null,'url':'./static/js/253.4a3aa017.chunk.js'},{'revision':null,'url':'./static/js/2537.10cf10fb.chunk.js'},{'revision':null,'url':'./static/js/2564.777b4d9f.chunk.js'},{'revision':null,'url':'./static/js/2611.b0ece77c.chunk.js'},{'revision':null,'url':'./static/js/2661.6a4f6166.chunk.js'},{'revision':null,'url':'./static/js/2720.147ae463.chunk.js'},{'revision':null,'url':'./static/js/2828.89d42424.chunk.js'},{'revision':null,'url':'./static/js/2842.1eebcd69.chunk.js'},{'revision':null,'url':'./static/js/2911.92a82b04.chunk.js'},{'revision':null,'url':'./static/js/2978.4e3df936.chunk.js'},{'revision':null,'url':'./static/js/31.39d475aa.chunk.js'},{'revision':null,'url':'./static/js/3111.f44a8d78.chunk.js'},{'revision':null,'url':'./static/js/3135.77d2718d.chunk.js'},{'revision':null,'url':'./static/js/3389.659cab57.chunk.js'},{'revision':null,'url':'./static/js/3476.47d6170f.chunk.js'},{'revision':null,'url':'./static/js/3555.91119c44.chunk.js'},{'revision':null,'url':'./static/js/3633.02809898.chunk.js'},{'revision':null,'url':'./static/js/3732.d5b401f7.chunk.js'},{'revision':null,'url':'./static/js/3803.ab7edaa3.chunk.js'},{'revision':null,'url':'./static/js/3829.2ca489ad.chunk.js'},{'revision':null,'url':'./static/js/3930.52f47c4a.chunk.js'},{'revision':null,'url':'./static/js/4074.e94a9635.chunk.js'},{'revision':null,'url':'./static/js/4104.d4d484aa.chunk.js'},{'revision':null,'url':'./static/js/4232.e30e2ef3.chunk.js'},{'revision':null,'url':'./static/js/4241.fe0e853e.chunk.js'},{'revision':null,'url':'./static/js/4274.75f87895.chunk.js'},{'revision':null,'url':'./static/js/4296.2dd20fb1.chunk.js'},{'revision':null,'url':'./static/js/4317.91732893.chunk.js'},{'revision':null,'url':'./static/js/4349.b225724a.chunk.js'},{'revision':null,'url':'./static/js/436.e7d7ead3.chunk.js'},{'revision':null,'url':'./static/js/440.09c3a54d.chunk.js'},{'revision':null,'url':'./static/js/442.d95b0c5a.chunk.js'},{'revision':null,'url':'./static/js/4423.cd5bf3f2.chunk.js'},{'revision':null,'url':'./static/js/4465.d149319d.chunk.js'},{'revision':null,'url':'./static/js/4512.d09c80a3.chunk.js'},{'revision':null,'url':'./static/js/4527.6d3ce631.chunk.js'},{'revision':null,'url':'./static/js/4545.4f5c0bd5.chunk.js'},{'revision':null,'url':'./static/js/4549.3a768671.chunk.js'},{'revision':null,'url':'./static/js/4550.5981074d.chunk.js'},{'revision':null,'url':'./static/js/4590.39f2b68f.chunk.js'},{'revision':null,'url':'./static/js/4631.f627efb4.chunk.js'},{'revision':null,'url':'./static/js/4654.24f11775.chunk.js'},{'revision':null,'url':'./static/js/4657.1be0470f.chunk.js'},{'revision':null,'url':'./static/js/4775.6cffbd67.chunk.js'},{'revision':null,'url':'./static/js/4804.0799b676.chunk.js'},{'revision':null,'url':'./static/js/4852.f41ccaf2.chunk.js'},{'revision':null,'url':'./static/js/4901.dce8c299.chunk.js'},{'revision':null,'url':'./static/js/4906.7f0752d1.chunk.js'},{'revision':null,'url':'./static/js/5015.0b517513.chunk.js'},{'revision':null,'url':'./static/js/5059.92ba11ba.chunk.js'},{'revision':null,'url':'./static/js/506.fe1f4c17.chunk.js'},{'revision':null,'url':'./static/js/5074.217389e9.chunk.js'},{'revision':null,'url':'./static/js/5163.cca32038.chunk.js'},{'revision':null,'url':'./static/js/5312.fa7da622.chunk.js'},{'revision':null,'url':'./static/js/5374.cc49abd9.chunk.js'},{'revision':null,'url':'./static/js/5526.1aec6323.chunk.js'},{'revision':null,'url':'./static/js/556.cfa178eb.chunk.js'},{'revision':null,'url':'./static/js/5570.744c0299.chunk.js'},{'revision':null,'url':'./static/js/5706.f5e6f131.chunk.js'},{'revision':null,'url':'./static/js/5748.7d3c9c26.chunk.js'},{'revision':null,'url':'./static/js/5760.b43b20af.chunk.js'},{'revision':null,'url':'./static/js/5784.372681fa.chunk.js'},{'revision':null,'url':'./static/js/5904.02123820.chunk.js'},{'revision':null,'url':'./static/js/592.083d62e1.chunk.js'},{'revision':null,'url':'./static/js/5979.a7c1a387.chunk.js'},{'revision':null,'url':'./static/js/6179.fbea7365.chunk.js'},{'revision':null,'url':'./static/js/6511.7e5a293c.chunk.js'},{'revision':null,'url':'./static/js/6547.7b4a8db4.chunk.js'},{'revision':null,'url':'./static/js/6602.34495e3d.chunk.js'},{'revision':null,'url':'./static/js/662.72ee2e58.chunk.js'},{'revision':null,'url':'./static/js/6629.5fc65d11.chunk.js'},{'revision':null,'url':'./static/js/6703.7c9ac00a.chunk.js'},{'revision':null,'url':'./static/js/6743.5a8d8d86.chunk.js'},{'revision':null,'url':'./static/js/6780.aa9fb3ec.chunk.js'},{'revision':null,'url':'./static/js/6830.1a23c027.chunk.js'},{'revision':null,'url':'./static/js/6906.f1f89f90.chunk.js'},{'revision':null,'url':'./static/js/6944.7f3fe691.chunk.js'},{'revision':null,'url':'./static/js/7020.30a59f59.chunk.js'},{'revision':null,'url':'./static/js/7022.7b668dae.chunk.js'},{'revision':null,'url':'./static/js/7082.bc59e4c9.chunk.js'},{'revision':null,'url':'./static/js/7327.d1805380.chunk.js'},{'revision':null,'url':'./static/js/744.74c12fbb.chunk.js'},{'revision':null,'url':'./static/js/754.95d43c7d.chunk.js'},{'revision':null,'url':'./static/js/7638.9fd0dda5.chunk.js'},{'revision':null,'url':'./static/js/7641.a0822ba8.chunk.js'},{'revision':null,'url':'./static/js/7676.f117fb2d.chunk.js'},{'revision':null,'url':'./static/js/7718.43bea793.chunk.js'},{'revision':null,'url':'./static/js/7865.9cfee717.chunk.js'},{'revision':null,'url':'./static/js/7913.554f4e7d.chunk.js'},{'revision':null,'url':'./static/js/8139.94d2309f.chunk.js'},{'revision':null,'url':'./static/js/8170.29705904.chunk.js'},{'revision':null,'url':'./static/js/8219.0110ce93.chunk.js'},{'revision':null,'url':'./static/js/8249.b3efc43c.chunk.js'},{'revision':null,'url':'./static/js/8262.39716df6.chunk.js'},{'revision':null,'url':'./static/js/8537.a9d1958b.chunk.js'},{'revision':null,'url':'./static/js/8542.9ee442f2.chunk.js'},{'revision':null,'url':'./static/js/8590.0bffbd32.chunk.js'},{'revision':null,'url':'./static/js/8606.a872b105.chunk.js'},{'revision':null,'url':'./static/js/8646.4850021f.chunk.js'},{'revision':null,'url':'./static/js/8809.82c05cab.chunk.js'},{'revision':null,'url':'./static/js/8986.41d2268d.chunk.js'},{'revision':null,'url':'./static/js/9038.aa97e3e5.chunk.js'},{'revision':null,'url':'./static/js/9041.62504f43.chunk.js'},{'revision':null,'url':'./static/js/9085.d0aa2a89.chunk.js'},{'revision':null,'url':'./static/js/9132.7199c98e.chunk.js'},{'revision':null,'url':'./static/js/9248.6cfcd5b2.chunk.js'},{'revision':null,'url':'./static/js/9282.9940b6e0.chunk.js'},{'revision':null,'url':'./static/js/9327.93934827.chunk.js'},{'revision':null,'url':'./static/js/9371.a03ab63e.chunk.js'},{'revision':null,'url':'./static/js/9450.5a43999b.chunk.js'},{'revision':null,'url':'./static/js/9517.ac659c32.chunk.js'},{'revision':null,'url':'./static/js/9552.becd4013.chunk.js'},{'revision':null,'url':'./static/js/9586.ba21307f.chunk.js'},{'revision':null,'url':'./static/js/9590.694b5369.chunk.js'},{'revision':null,'url':'./static/js/9651.0cb999aa.chunk.js'},{'revision':null,'url':'./static/js/9662.0639afb1.chunk.js'},{'revision':null,'url':'./static/js/9725.85b47edf.chunk.js'},{'revision':null,'url':'./static/js/main.78f8a9a1.js'},{'revision':'8e707674580ac8fed33fddf8cdf26b38','url':'./static/media/empty-spaces-nft.f2f7da76d96b54cf8a379d6b32edc7f1.svg'},{'revision':null,'url':'./static/media/inter-latin-300-normal.2d4c4e1b0312ac8dc566.woff2'},{'revision':null,'url':'./static/media/inter-latin-300-normal.cf40b5e95ba0d5016b19.woff'},{'revision':null,'url':'./static/media/inter-latin-400-normal.08a02fd275ecea6ef662.woff'},{'revision':null,'url':'./static/media/inter-latin-400-normal.f1535355a7df553be385.woff2'},{'revision':null,'url':'./static/media/inter-latin-500-normal.4eedffe43452a87e61bd.woff'},{'revision':null,'url':'./static/media/inter-latin-500-normal.6629df60b0706dec8113.woff2'},{'revision':null,'url':'./static/media/inter-latin-700-normal.91c4ed20ea233963e54f.woff'},{'revision':null,'url':'./static/media/inter-latin-700-normal.b4118e4ad76754e71d0b.woff2'},{'revision':null,'url':'./static/media/inter-latin-ext-300-normal.1325a175af98c903b8fd.woff2'},{'revision':null,'url':'./static/media/inter-latin-ext-300-normal.88505150df5d39d11f1c.woff'},{'revision':null,'url':'./static/media/inter-latin-ext-400-normal.0f9e8d4e940df8f6edfe.woff2'},{'revision':null,'url':'./static/media/inter-latin-ext-400-normal.40b3b0d5e09a90fb6e3e.woff'},{'revision':null,'url':'./static/media/inter-latin-ext-500-normal.abd2dd4838a0148febb9.woff'},{'revision':null,'url':'./static/media/inter-latin-ext-500-normal.bed85b98c34f434a1c80.woff2'},{'revision':null,'url':'./static/media/inter-latin-ext-700-normal.4c2578dbd1ff5ea14172.woff'},{'revision':null,'url':'./static/media/inter-latin-ext-700-normal.65678f6198b402319e15.woff2'},{'revision':null,'url':'./static/media/login-bg.9936fc84e60f5cea6739.png'},{'revision':'3f75f5574309bf1ab1a642cae6cec338','url':'./static/media/logo.60f66bbe1ce9674a4df4e374c9d97fc4.svg'},{'revision':'893e153699e6c3cbf74132eacdb77fa6','url':'./static/media/space-connected.9a4e18fd2bc7d065191b0d241a131c28.svg'},{'revision':null,'url':'./static/media/ubuntu-mono-cyrillic-400-normal.3d8a2767436c97526e5e.woff'},{'revision':null,'url':'./static/media/ubuntu-mono-cyrillic-400-normal.c367f416832eb8f1b846.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-cyrillic-ext-400-normal.e06671814416d634c36e.woff'},{'revision':null,'url':'./static/media/ubuntu-mono-cyrillic-ext-400-normal.eda1c4946b1f7bf58386.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-greek-400-normal.229eedabb26a787909cf.woff'},{'revision':null,'url':'./static/media/ubuntu-mono-greek-400-normal.22f3bfc91f79c342bdf4.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-greek-ext-400-normal.1bfcab2ece1ff3d4cc92.woff'},{'revision':null,'url':'./static/media/ubuntu-mono-greek-ext-400-normal.b3459900ea8a25d1f7c2.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-latin-400-normal.18e32d9d743af28f913e.woff2'},{'revision':null,'url':'./static/media/ubuntu-mono-latin-400-normal.3d12a93009cd936623de.woff'},{'revision':null,'url':'./static/media/ubuntu-mono-latin-ext-400-normal.691ea3fbf57333b3b408.woff'},{'revision':null,'url':'./static/media/ubuntu-mono-latin-ext-400-normal.7203caccc2b5871be756.woff2'}]||[]).filter((e=>"/"!==e.url&&!e.url.includes("index.html")))),function(e){const t=C();T(new N(t,e))}(te),self.addEventListener("activate",(()=>self.clients.claim())),self.addEventListener("activate",(()=>{console.log("Service Worker activated")})),self.addEventListener("install",(e=>{console.log("Service Worker installed"),e.waitUntil(self.skipWaiting())}));const se=e=>"GET"!==e.method||(!!e.url.includes("/api")||(!!e.url.includes("__meta__.js")||!!e.url.includes("__blocklet__.js")));T((e=>{const{request:t}=e;return!se(t)&&t.url.includes("/static/")}),new class extends v{async _handle(e,s){let n,a=await s.cacheMatch(e);if(a)0;else{0;try{a=await s.fetchAndCachePut(e)}catch(r){r instanceof Error&&(n=r)}0}if(!a)throw new t("no-response",{url:e.url,error:n});return a}}({cacheName:"static",plugins:[new class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.cachedResponseWillBeUsed=async e=>{let{event:t,request:s,cacheName:n,cachedResponse:a}=e;if(!a)return null;const r=this._isResponseDateFresh(a),i=this._getCacheExpiration(n);l(i.expireEntries());const c=i.updateTimestamp(s.url);if(t)try{t.waitUntil(c)}catch(o){0}return r?a:null},this.cacheDidUpdate=async e=>{let{cacheName:t,request:s}=e;const n=this._getCacheExpiration(t);await n.updateTimestamp(s.url),await n.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&function(e){n.add(e)}((()=>this.deleteCacheAndMetadata()))}_getCacheExpiration(e){if(e===c())throw new t("expire-custom-caches-only");let s=this._cacheExpirations.get(e);return s||(s=new Z(e,this._config),this._cacheExpirations.set(e,s)),s}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(null===t)return!0;return t>=Date.now()-1e3*this._maxAgeSeconds}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),s=new Date(t).getTime();return isNaN(s)?null:s}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}({maxEntries:200})]})),T((e=>{const{request:t}=e;return!se(t)&&(t.url.includes("/images/")||t.url.includes("/icons/"))}),new class extends v{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.plugins.some((e=>"cacheWillUpdate"in e))||this.plugins.unshift(ee)}async _handle(e,s){const n=s.fetchAndCachePut(e).catch((()=>{}));s.waitUntil(n);let a,r=await s.cacheMatch(e);if(r)0;else{0;try{r=await n}catch(i){i instanceof Error&&(a=i)}}if(!r)throw new t("no-response",{url:e.url,error:a});return r}})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[4296,9132],{32322:(e,n,t)=>{"use strict";n.h1=void 0;const s=t(77277);function i(e){return(null===e||void 0===e?void 0:e.connectedAccounts)||[]}function o(e){return i(e).find((e=>e.provider===s.LOGIN_PROVIDER.WALLET))}n.h1=function(e){const n=o(e);return null===n||void 0===n?void 0:n.did}},15098:(e,n,t)=>{const{ROLES:s,PASSPORT_STATUS:i}=t(35432);e.exports={hasActiveOwnerPassport:e=>((null===e||void 0===e?void 0:e.passports)||[]).some((e=>e.role===s.OWNER&&e.status===i.VALID))}},92726:(e,n,t)=>{"use strict";t.d(n,{Z:()=>g});var s,i=t(71171),o=t(5057),r=t(55898),a=t.n(r),l=t(33518),c=t(67680),d=t(61533),m=t(74490),u=t(45267),p=t(46954),f=t(44067),h=t(96266);function g(e){let{actions:n,size:t,...s}=e;const[i,r]=(0,o.useState)(null),a=Boolean(i),l=e=>{try{e.stopPropagation(),e.preventDefault()}catch{}r(null)};return(0,h.jsxs)(x,{...s,children:[(0,h.jsx)(c.Z,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"actions-menu-icon",onClick:e=>{try{e.stopPropagation(),e.preventDefault()}catch{}r(e.currentTarget)},size:t,children:(0,h.jsx)(u.Z,{})}),(0,h.jsx)(d.Z,{id:"actions-menu","data-cy":"actions-menu",anchorEl:i,keepMounted:!0,open:a,onClose:l,slotProps:{paper:{}},children:n.map(((e,n)=>{if("function"===typeof e)return e({close:l});const{icon:t,text:s,onClick:i,disabled:r=!1,...a}=e;return(0,o.createElement)(m.Z,{...a,disabled:r,dense:!0,onClick:async e=>{await i(e),l()},key:n,"data-cy":"actions-menu-".concat(n)},(0,h.jsx)(p.Z,{style:{minWidth:24,marginRight:8},children:t}),(0,h.jsx)(f.Z,{primary:s}))}))})]})}g.propTypes={actions:a().array,size:a().oneOf(["small","medium","large"])},g.defaultProps={actions:[],size:"small"};const x=l.Z.div(s||(s=(0,i.Z)([""])))},50185:(e,n,t)=>{"use strict";t.d(n,{Z:()=>c});var s=t(5057),i=t(55898),o=t.n(i),r=t(12937),a=t(68420),l=t(96266);function c(e){let{children:n,...t}=e;const{t:i}=(0,s.useContext)(a.RD);return(0,l.jsx)(r.Z,{tip:i("common.copyTip"),copiedTip:i("common.copiedTip"),...t,children:n})}c.propTypes={children:o().any.isRequired}},9729:(e,n,t)=>{"use strict";t.d(n,{Z:()=>d});var s,i=t(71171),o=t(55898),r=t.n(o),a=t(33518),l=t(13727),c=t(96266);function d(e){const{passport:n,onDelete:t,...s}=e;return(0,c.jsxs)(m,{...s,children:[n.title||n.name," ",!!t&&(0,c.jsx)(l.default,{"data-cy":"delete-issuance",className:"delete",onClick:t})]})}d.propTypes={passport:r().object.isRequired,onDelete:r().func},d.defaultProps={onDelete:null};const m=a.Z.span(s||(s=(0,i.Z)(["\n display: inline-flex;\n padding: 2px 8px;\n background: ",";\n border-radius: 100vw;\n font-weight: 400;\n font-size: 12px;\n line-height: 22px;\n color: #fff;\n align-items: center;\n .delete {\n font-size: 1em;\n margin-left: 6px;\n cursor: pointer;\n }\n"])),(e=>e.theme.palette.primary.main))},75672:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>yn});var s,i=t(71171),o=t(5057),r=t(33518),a=t(75506),l=t.n(a),c=t(55898),d=t.n(c),m=t(52277),u=t.n(m),p=t(75239),f=t(39948),h=t(15715),g=t(67680),x=t(83407),v=t(26174),y=t(88092),b=t(13128),j=t(44919),Z=t(80578),S=t(64185),R=t(72333),k=t(68420),w=t(28726),T=t(68051),P=t(18945),C=t(49777),D=t(75760),E=t(49384),I=t(86229),N=t(35432),_=t(77277),A=t(10381),O=t(42061),L=t(99360),z=t(4962),B=t(22228),U=t(17450),W=t(58238),q=t(17425),K=t(29054),F=t(63406),M=t(46090),V=t(44846),H=t(55372),Y=t(11750),G=t(74490),J=t(51177),X=t(47020),Q=t(6041),$=t(80576),ee=t(88574),ne=t(50185),te=t(96266);function se(e){let{teamDid:n,roles:t,onCancel:s,onSuccess:i,onError:r,endpoint:a}=e;const{api:l}=(0,W.h6)(),[c,d]=(0,o.useState)(!1),[m,u]=(0,o.useState)(""),{t:p,locale:f}=(0,k.PE)(),[h,g]=(0,o.useState)(0),[x,v]=(0,o.useState)(""),[y,j]=(0,o.useState)(""),[Z,S]=(0,o.useState)(""),R=async()=>{if(!y)return void u(p("team.member.error.passportEmpty"));const e=Z.trim();u(null),d(!0);try{const{inviteInfo:t}=await l.createMemberInvitation({input:{teamDid:n,role:y,remark:e}});v(t),g(1)}catch(t){const e=(0,M.Z)(t);u(e),r(t)}finally{d(!1)}},T=[{body:(0,te.jsxs)(Y.Z,{component:"div",children:[(0,te.jsxs)($.Z,{style:{width:"100%"},variant:"outlined",children:[(0,te.jsx)(Q.Z,{children:p("common.passport")}),(0,te.jsx)(J.Z,{"data-cy":"invite-member-select-role",value:y,onChange:e=>{u(null),j(e.target.value)},fullWidth:!0,label:p("common.passport"),disabled:c,onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),R())},children:t.filter((e=>"owner"!==e.name)).map((e=>(0,te.jsx)(G.Z,{value:e.name,"data-cy":"invite-member-select-option-".concat(e.name),children:(0,te.jsx)("span",{children:e.title||e.name})},e.name)))})]}),(0,te.jsx)("div",{style:{marginTop:20,marginBottom:10}}),(0,te.jsx)(X.Z,{label:p("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:Z,onChange:e=>{u(null),S(e.target.value)},disabled:c,"data-cy":"invite-member-input-remark"}),(0,te.jsx)("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:p("common.cancel"),confirm:p("team.member.inviteDialog.createInviteLink"),onCancel:s,onConfirm:R},{body:()=>{const e=(0,M.ly)({inviteId:x.inviteId,endpoint:a});return(0,te.jsxs)("div",{children:[(0,te.jsx)(ie,{children:p("team.member.inviteDialog.createSuccessTip",{expireDate:(0,M.B2)(x.expireDate,f)})}),(0,te.jsx)("div",{style:{marginTop:"40px"}}),(0,te.jsx)(ne.Z,{children:e})]})},confirm:p("common.confirm"),onConfirm:i}][h];return(0,te.jsxs)(b.ZP,{title:p("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:(0,te.jsxs)(te.Fragment,{children:[T.cancel&&(0,te.jsx)(w.Z,{onClick:T.onCancel,color:"inherit",children:T.cancel}),(0,te.jsxs)(w.Z,{onClick:T.onConfirm,color:"primary",disabled:c||!y,variant:"contained",autoFocus:!0,children:[c&&(0,te.jsx)(V.Z,{size:16}),T.confirm]})]}),children:[(0,te.jsx)(H.Z,{component:"div",children:"function"===typeof T.body?T.body():T.body}),!!m&&(0,te.jsx)(ee.Z,{type:"error",variant:"icon",children:m})]})}se.propTypes={teamDid:d().string.isRequired,onCancel:d().func.isRequired,onSuccess:d().func.isRequired,onError:d().func,roles:d().array,endpoint:d().string},se.defaultProps={onError:()=>{},roles:[],endpoint:""};const ie=r.Z.div(s||(s=(0,i.Z)(["\n font-size: 16px;\n font-weight: bold;\n"])));var oe,re=t(26796),ae=t(43681),le=t.n(ae),ce=t(88577),de=t(73545);function me(e){let{teamDid:n,onCancel:t,onSuccess:s,onError:i,endpoint:r}=e;const{api:a,info:l}=(0,W.h6)(),{api:c}=(0,o.useContext)(de.B),[d,m]=(0,o.useState)(!1),{t:u,locale:p}=(0,k.PE)(),[f,h]=(0,o.useState)(""),[g,x]=(0,o.useState)(!1),[v,y]=(0,o.useState)(0),[j,Z]=(0,o.useState)(""),[S,R]=(0,o.useState)(""),T=!!le()(l,"ownerNft.did"),P=(0,re.default)((async()=>{if(T){const{state:e}=await a.getDelegationState();return e}return{delegated:!0}}));if(P.loading)return(0,te.jsx)(b.ZP,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:t,children:(0,te.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,te.jsx)(V.Z,{})})});if(P.error)return(0,te.jsx)(b.ZP,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:t,children:(0,te.jsx)(ee.Z,{type:"error",variant:"icon",children:(0,M.Z)(P.error)})});const C=async()=>{h(null),m(!0);try{const{inviteInfo:e}=await a.createTransferInvitation({input:{teamDid:n,role:"owner",remark:S.trim()}});Z(e),y(E.length-1)}catch(e){const n=(0,M.Z)(e);h(n),i(e)}finally{m(!1)}},D=()=>{x(!1),y(0)},E=[{body:(0,te.jsxs)(Y.Z,{component:"div",children:[(0,te.jsxs)(ee.Z,{type:"warning",children:[(0,te.jsx)(Y.Z,{children:u("team.transferNode.inviteDialog.tips.progress")}),(0,te.jsx)(Y.Z,{children:u("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),(0,te.jsx)(ee.Z,{type:"warning",children:(0,te.jsx)(Y.Z,{children:u("team.transferNode.inviteDialog.tips.revoke")})}),(0,te.jsx)("div",{style:{marginTop:20,marginBottom:10}}),(0,te.jsx)(X.Z,{label:u("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:S,onChange:e=>{h(null),R(e.target.value)},disabled:d,"data-cy":"transfer-node-input-remark"}),(0,te.jsx)("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:u("common.cancel"),confirm:u("team.transferNode.inviteDialog.createInviteLink"),onCancel:t,onConfirm:T&&!le()(P,"value.delegated")?()=>{x(!0),y(1)}:C},{body:()=>(0,te.jsx)(ce.Z,{action:"delegate-transfer-nft",open:g,locale:p,checkFn:c.get,onClose:D,onSuccess:C,checkTimeout:3e5,webWalletUrl:(0,M.yP)(l),extraParams:{targetDID:l.did},messages:{title:u("team.transferNode.delegateDialog.title"),scan:u("team.transferNode.delegateDialog.scan"),confirm:u("team.transferNode.delegateDialog.confirm"),success:u("team.transferNode.delegateDialog.success")},popup:!0})},{body:()=>{const e=(0,M.ly)({inviteId:j.inviteId,endpoint:r});return(0,te.jsxs)("div",{children:[(0,te.jsx)(ue,{children:u("team.transferNode.inviteDialog.createSuccessTip",{expireDate:(0,M.B2)(j.expireDate,p)})}),(0,te.jsx)("div",{style:{marginTop:"40px"}}),(0,te.jsx)(ne.Z,{children:e})]})},confirm:u("common.confirm"),onConfirm:s}],I=E[v];return(0,te.jsxs)(b.ZP,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:(0,te.jsxs)(te.Fragment,{children:[I.cancel&&(0,te.jsx)(w.Z,{onClick:I.onCancel,color:"inherit",children:I.cancel}),(0,te.jsxs)(w.Z,{onClick:I.onConfirm,color:"primary",disabled:d,variant:"contained",autoFocus:!0,children:[d&&(0,te.jsx)(V.Z,{size:16}),I.confirm]})]}),children:[(0,te.jsx)(H.Z,{component:"div",children:"function"===typeof I.body?I.body():I.body}),!!f&&(0,te.jsx)(ee.Z,{type:"error",variant:"icon",children:f})]})}me.propTypes={teamDid:d().string.isRequired,onCancel:d().func.isRequired,onSuccess:d().func.isRequired,onError:d().func,endpoint:d().string},me.defaultProps={onError:()=>{},endpoint:""};const ue=r.Z.div(oe||(oe=(0,i.Z)(["\n font-size: 16px;\n font-weight: bold;\n"])));var pe,fe=t(62681),he=t(94464),ge=t(64886),xe=t(12987),ve=t(71246),ye=t(12673),be=t(70461),je=t(9729);function Ze(e){let{issuances:n,teamDid:t,onRefresh:s}=e;const{api:i,inService:r}=(0,W.h6)(),{t:a,locale:l}=(0,o.useContext)(k.RD),[c,d]=(0,o.useState)(null),[m,u]=(0,o.useState)(!1),{endpoint:p}=(0,q.DJ)(),h=()=>{u(!1),d(null)},g=e=>p?(0,M._)({id:e.id,endpoint:p}):"";function x(e){let{data:n}=e;return(0,te.jsxs)("div",{className:"issuance",children:[(0,te.jsxs)(f.Z,{display:"flex",justifyContent:"space-between",children:[(0,te.jsx)(F.Z,{permission:r?"":"mutate_team",role:r?M.Wf:[],children:e=>e?(0,te.jsx)(je.Z,{passport:{title:n.title,name:n.name},onDelete:()=>d({title:a("team.passport.issuance.delete.title"),description:a("team.passport.issuance.delete.description",{link:g(n)}),confirm:a("common.delConfirm"),cancel:a("common.cancel"),onConfirm:()=>{(async e=>{let{id:n}=e;if(!m){u(!0);try{await i.deletePassportIssuance({input:{teamDid:t,sessionId:n}}),s()}catch(o){I.Z.error(o.message)}finally{u(!1),d(null)}}})(n)},onCancel:h})}):(0,te.jsx)(je.Z,{passport:{title:n.title,name:n.name}})}),(0,te.jsxs)("div",{style:{color:"#999"},children:[a("common.expires"),":\xa0",(0,M.B2)(n.expireDate,l)]})]}),(0,te.jsx)(f.Z,{mt:2,children:(0,te.jsx)(ne.Z,{children:g(n)})})]})}return(0,te.jsxs)(Se,{children:[n.map((e=>(0,te.jsx)(x,{data:e}))),c&&(0,te.jsx)(be.Z,{title:c.title,description:c.description,confirm:c.confirm,cancel:c.cancel,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel})]})}const Se=r.Z.div(pe||(pe=(0,i.Z)(["\n .MuiTableHead-root {\n display: none;\n }\n .issuance {\n padding: 16px 0;\n border-bottom: 1px solid #f0f0f0;\n .MuiTypography-root {\n display: inline-block;\n width: 100%;\n background: #f3f3f3;\n border-radius: 4px;\n padding-top: 6px;\n padding-bottom: 6px;\n }\n }\n"])));Ze.propTypes={teamDid:d().string.isRequired,issuances:d().array,onRefresh:d().func},Ze.defaultProps={issuances:[],onRefresh:()=>{}};var Re=t(5178),ke=t(32322),we=t(87806),Te=t(25710),Pe=t(82638),Ce=t(18901);function De(e){let{teamDid:n,ownerDid:t,needReceive:s,roles:i,onCancel:r,onSuccess:a,onError:l,showOwnerPassport:c}=e;const{api:d}=(0,W.h6)(),[m,u]=(0,o.useState)(!1),[p,f]=(0,o.useState)(""),{t:h}=(0,k.PE)(),[g,x]=(0,o.useState)(""),v=async()=>{if(g){f(null),u(!0);try{await d.createPassportIssuance({input:{teamDid:n,name:g,ownerDid:t}}),a()}catch(e){const n=(0,M.Z)(e);f(n),l(e)}finally{u(!1)}}else f(h("team.member.error.passportEmpty"))};return(0,te.jsxs)(b.ZP,{title:h("team.passport.issue"),fullWidth:!0,open:!0,onClick:e=>e.stopPropagation(),onClose:r,disableEscapeKeyDown:!0,PaperProps:{style:{minHeight:"auto"}},actions:(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(w.Z,{onClick:r,color:"inherit",size:"small",children:h("common.cancel")}),(0,te.jsxs)(w.Z,{onClick:v,color:"primary",size:"small",disabled:m||!g,variant:"contained",autoFocus:!0,"data-cy":"issue-passport-create-btn",children:[m&&(0,te.jsx)(V.Z,{size:16}),h(s?"team.passport.issuance.create.title":"oauth.issued")]})]}),children:[(0,te.jsx)(H.Z,{component:"div",children:(0,te.jsx)(Y.Z,{component:"div",children:(0,te.jsxs)($.Z,{style:{width:"100%"},variant:"outlined",children:[(0,te.jsx)(Q.Z,{children:h("common.passport")}),(0,te.jsx)(J.Z,{"data-cy":"issue-passport-select-passport",value:g,onChange:e=>{f(null),x(e.target.value)},fullWidth:!0,label:h("common.passport"),disabled:m,onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),v())},children:i.filter((e=>c||"owner"!==e.name)).map((e=>(0,te.jsx)(G.Z,{value:e.name,"data-cy":"issue-passport-select-option-".concat(e.name),children:(0,te.jsx)("span",{children:e.title||e.name})},e.name)))})]})})}),!!p&&(0,te.jsx)(ee.Z,{type:"error",variant:"icon",children:p})]})}De.propTypes={teamDid:d().string.isRequired,ownerDid:d().string.isRequired,needReceive:d().bool,onCancel:d().func.isRequired,onSuccess:d().func.isRequired,onError:d().func,roles:d().array,showOwnerPassport:d().bool},De.defaultProps={onError:()=>{},roles:[],showOwnerPassport:!1,needReceive:!0};var Ee,Ie=t(26538),Ne=t.n(Ie);function _e(e){let{passport:n,user:t,color:s,width:i,icon:o,children:r,createPassportSvg:a,...l}=e;const{t:c}=(0,k.PE)();return(0,te.jsxs)(Ae,{display:"flex",alignItems:"center",...l,children:[(0,te.jsx)("div",{dangerouslySetInnerHTML:{__html:a({title:n.title||n.name,issuer:n.issuer&&n.issuer.name,issuerDid:n.issuer&&n.issuer.id,ownerName:t.fullName,ownerDid:t.did,ownerAvatarUrl:t.avatar,revoked:n.revoked,preferredColor:s,width:i})}}),(0,te.jsxs)("div",{className:"body",children:[(0,te.jsxs)(f.Z,{className:"title",display:"flex",alignItems:"center",children:[Ne()(n.title),(0,te.jsxs)("div",{className:"status-icons",children:[o,n.revoked&&(0,te.jsx)(we.Z,{})]})]}),n.expirationDate&&(0,te.jsx)(f.Z,{className:"title",display:"flex",alignItems:"center",children:c("team.passport.validUntil",{date:n.expirationDate})}),r]})]})}_e.propTypes={passport:d().any.isRequired,user:d().any.isRequired,color:d().string.isRequired,createPassportSvg:d().func.isRequired,icon:d().any,children:d().any,width:d().number},_e.defaultProps={icon:null,children:null,width:150};const Ae=(0,r.Z)(f.Z)(Ee||(Ee=(0,i.Z)(["\n .body {\n padding: 0;\n margin-left: 24px;\n margin-top: 0;\n }\n .title {\n font-weight: 400;\n font-size: 16px;\n line-height: 19px;\n color: #222222;\n }\n .tip {\n display: flex;\n align-items: center;\n font-size: 14px;\n margin-top: 6px;\n color: #bbb;\n }\n .status-icons {\n svg {\n fill: #bfbfbf;\n height: 1.2em;\n margin-left: 0.4em;\n }\n }\n"])));var Oe;function Le(e){let{action:n,passport:t}=e;const{t:s}=(0,k.PE)(),{roles:i}=(0,q.DJ)(),o=i.find((e=>e.name===t.role));return(0,te.jsxs)("div",{children:[(0,te.jsx)("div",{children:s("enable"===n?"team.member.enablePassportDescription":"team.member.revokePassportDescription")}),o&&(0,te.jsx)(f.Z,{mt:3,fontWeight:"bold",children:s("team.member.passportPermissionTitle")}),o&&(0,te.jsx)(f.Z,{mt:1,children:o.description})]})}function ze(e){var n;let{user:t,onCreate:s,createPassportSvg:i}=e;const{t:r}=(0,k.PE)(),{session:a}=(0,de.T)(),{roles:l,teamDid:c,teamIssuerDid:d,refresh:m,enablePassportIssuance:u,trustedPassports:h,passportColor:g,blocklet:x}=(0,q.DJ)(),{appIdList:v}=(0,K.y0)(),{api:y,inService:b}=(0,W.h6)(),[Z,S]=(0,o.useState)(!1),[R,T]=(0,o.useState)(null),[C,D]=(0,o.useState)(!1),[E,_]=(0,o.useState)(""),A=[d,...v||[]].filter(Boolean),O=(le()(t,"passports")||[]).map((e=>({...e,revoked:e.status===N.PASSPORT_STATUS.REVOKED}))),L=async e=>{if(!Z){S(!0);try{const n=e.status===N.PASSPORT_STATUS.REVOKED?"enableUserPassport":"revokeUserPassport";await y[n]({input:{teamDid:c,userDid:t.did,passportId:e.id}}),m()}catch(n){I.Z.error((0,M.Z)(n))}finally{S(!1),T(null)}}},z=(e,n)=>t.did===a.user.did&&a.user.passportId&&a.user.passportId===n.id?{revokable:!1,message:r("team.passport.shouldNotDeleteCurrent")}:e?c===n.issuer.id&&"owner"===n.name?{revokable:!1,message:r("team.passport.noPermission")}:{revokable:!0}:{revokable:!1,message:r("team.passport.noPermission")},B=O.filter((e=>!E||e.title.includes(E)||e.name.includes(E)));return(0,te.jsxs)(Be,{children:[(0,te.jsxs)(Ce.Z,{children:[(0,te.jsx)("div",{className:"left",children:(0,te.jsx)(Pe.Z,{placeholder:r("team.passport.search"),value:E,onChange:e=>_(e.target.value)})}),(0,te.jsx)("div",{className:"right",children:u&&!!t.approved&&(0,te.jsx)(F.Z,{permission:b?"":"mutate_team",role:b?M.Wf:[],children:(0,te.jsxs)(w.Z,{variant:"contained",color:"primary","data-cy":"issue-passport",onClick:()=>D(!0),children:[(0,te.jsx)(j.Z,{style:{fontSize:16,marginRight:4}}),r("team.passport.issue")]})})})]}),(0,te.jsxs)(f.Z,{children:[B.map((e=>(0,te.jsx)(F.Z,{permission:b?"":"mutate_team",role:b?M.Wf:[],children:n=>(0,te.jsxs)(f.Z,{className:"passport-item",display:"flex",justifyContent:"space-between",alignItems:"center",mt:3,children:[(0,te.jsx)(_e,{passport:e,user:t,color:g,createPassportSvg:i,icon:A.length&&!A.includes(e.issuer.id)?(0,te.jsx)(P.Z,{}):null,children:!!A.length&&!A.includes(e.issuer.id)&&(0,te.jsxs)("div",{className:"tip",children:[e.issuer.id!==d&&!h.some((n=>n.issuerDid===e.issuer.id))&&(0,te.jsx)(p.Z,{title:r("team.passport.notTrustedIssuerTip"),children:(0,te.jsx)(f.Z,{component:Re.Z,style:{fontSize:"1.3em"},color:"error.main",mr:.5})}),(0,te.jsx)("span",{children:r("team.passport.issueBy",{name:e.issuer.name})})]})}),(0,te.jsx)(f.Z,{children:z(n,e).revokable?(0,te.jsxs)(w.Z,{variant:"outlined",color:e.revoked?"primary":"secondary",onClick:()=>{return(n=e).status===N.PASSPORT_STATUS.REVOKED?T({title:r("team.member.enablePassport"),description:(0,te.jsx)(Le,{action:"enable",passport:n}),confirm:r("common.enable"),cancel:r("common.cancel"),onConfirm:()=>{L(n)},onCancel:()=>{S(!1),T(null)},color:"primary"}):T({title:r("team.member.revokePassport"),description:(0,te.jsx)(Le,{action:"revoke",passport:n}),confirm:r("common.revoke"),cancel:r("common.cancel"),onConfirm:()=>{L(n)},onCancel:()=>{S(!1),T(null)}});var n},children:[e.revoked?(0,te.jsx)(j.Z,{style:{fontSize:16,marginRight:4}}):(0,te.jsx)(we.Z,{style:{height:16,marginRight:4}}),e.revoked?r("common.enable"):r("common.revoke")]}):(0,te.jsx)(p.Z,{title:z(n,e).message,children:(0,te.jsx)(Re.Z,{style:{color:"#ddd"}})})})]})},e.id))),!B.length&&(0,te.jsx)(Te.Z,{children:r("common.empty")})]}),C&&(0,te.jsx)(De,{teamDid:c,ownerDid:t.did,needReceive:(0,ke.h1)(t)===t.did,roles:l,onCancel:()=>D(!1),onSuccess:()=>{s(),D(!1)},showOwnerPassport:x&&!(null!==(n=x.settings)&&void 0!==n&&n.owner)}),R&&(0,te.jsx)(be.Z,{title:R.title,description:R.description,confirm:R.confirm,cancel:R.cancel,params:R.params,onConfirm:R.onConfirm,onCancel:R.onCancel,color:R.color})]})}Le.propTypes={action:d().string.isRequired,passport:d().object.isRequired},Le.defaultProps={},ze.propTypes={user:d().object.isRequired,createPassportSvg:d().func.isRequired,onCreate:d().func},ze.defaultProps={onCreate:()=>{}};const Be=r.Z.div(Oe||(Oe=(0,i.Z)(["\n .passport-item {\n .MuiButton-outlinedSecondary {\n color: #f16e6e;\n fill: #f16e6e;\n background: #fcf3f3;\n border: 0;\n &:hover {\n border: 0;\n }\n }\n }\n"])));var Ue=t(15098);const We=(e,n)=>e.nodeOwner&&e.nodeOwner.did===n,qe=(e,n)=>e&&e.did===n;function Ke(e){let{user:n,onCancel:t,onSuccess:s,onError:i,children:r}=e;const{api:a,info:l,inService:c}=(0,W.h6)(),{session:d}=(0,de.T)(),{teamDid:m,refresh:u}=(0,q.DJ)(),{t:p}=(0,k.PE)(),[f,h]=(0,o.useState)(!1),[g,x]=(0,o.useState)(!1),v={title:n.approved?p("team.member.forbidLogin"):p("team.member.allowLogin"),description:n.approved?p("team.member.forbidLoginDescription"):p("team.member.allowLoginDescription"),confirm:p("common.confirm"),cancel:p("common.cancel"),onConfirm:()=>{(async e=>{const{did:n,approved:t}=e;if(!f){h(!0);try{await a.updateUserApproval({input:{teamDid:m,user:{did:n,approved:!t}}}),x(!1),s(),u()}catch(o){I.Z.error((0,M.Z)(o)),i()}finally{h(!1)}}})(n)},onCancel:()=>{h(!1),x(!1),t()},color:n.approved?"error":"primary"};let y;return y=!(0,Ue.hasActiveOwnerPassport)(n)&&((c||l.nodeOwner&&!We(l,n.did))&&!qe(d.user,n.did)),y?(0,te.jsxs)(te.Fragment,{children:["function"===typeof r?r({can:y,open:()=>x(!0)}):r,g?(0,te.jsx)(be.Z,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel,color:v.color}):null]}):null}Ke.propTypes={user:d().object,onSuccess:d().func,onCancel:d().func,onError:d().func,children:d().oneOfType([d().object,d().func])},Ke.defaultProps={user:{},onSuccess:()=>{},onCancel:()=>{},onError:()=>{},children:null};var Fe,Me,Ve,He=t(6352),Ye=t.n(He);function Ge(e,n,t){if(e&&e.startsWith(N.USER_AVATAR_URL_PREFIX)){const s=window.env.apiPrefix||"/";return t?Ye()(s,N.USER_AVATAR_PATH_PREFIX,e.replace(N.USER_AVATAR_URL_PREFIX,"")):Ye()(s,N.USER_AVATAR_PATH_PREFIX,n,e.replace(N.USER_AVATAR_URL_PREFIX,""))}return e}function Je(e){let{user:n}=e;return(n.connectedAccounts||[]).map((e=>(0,te.jsx)(ge.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:e.provider,children:(0,te.jsx)(U.Z,{did:e.did,showQrcode:!0})},e.did)))}Je.propTypes={user:d().object.isRequired},Je.defaultProps={},d().string.isRequired;const Xe="info";function Qe(e){let{userDid:n,onCancel:t,initTab:s,createPassportSvg:i}=e;const{api:r,ws:{useSubscription:a},inService:l}=(0,W.h6)(),{roles:c,teamDid:d,enablePassportIssuance:m}=(0,q.DJ)(),{t:u,locale:p}=(0,k.PE)(),h=(0,ye.Z)({user:null,issuances:null,tab:s||Xe}),g=async(e,n)=>{try{const t=await r.doBatchQuery({getUser:{input:{teamDid:e,user:{did:n},options:{includeTags:!0}}},getPassportIssuances:{input:{teamDid:e,ownerDid:n}}});t.getUser.user&&(t.getUser.user.avatar=Ge(t.getUser.user.avatar,e,l),t.getUser.user.passports=(t.getUser.user.passports||[]).filter((e=>e.issuer))),h.user=t.getUser.user||{},h.issuances=t.getPassportIssuances.list||[]}catch(t){I.Z.error((0,M.Z)(t))}};(0,o.useEffect)((()=>{d&&g(d,n)}),[n,d]);a(_.TeamEvents.userUpdated,(e=>{e.teamDid===d&&e.user&&e.user.did===n&&g(d,n)}),[n,d]),(0,o.useEffect)((()=>{h.issuances&&!h.issuances.length&&"issuances"===h.tab&&(h.tab=Xe)}),[h.issuances]);const x=async e=>{await g(d,e.did),h.tab=Xe},v={info:{label:u("common.basicInfo"),value:Xe,component:()=>{var e,n;return(h.user?[{name:u("team.member.name"),value:h.user.fullName},{name:u("common.email"),value:h.user.email},{name:u("team.member.source"),value:(0,te.jsx)(f.Z,{display:"flex",alignItems:"center",children:_.PROVIDER_NAME[(null===(e=h.user)||void 0===e?void 0:e.sourceProvider)||N.USER_TYPE.WALLET]||(null===(n=h.user)||void 0===n?void 0:n.sourceProvider)})},{name:u("team.member.allowLogin"),value:h.user.approved?u("common.yes"):u("common.no")},{name:u("team.member.lastLogin"),value:(0,M.B2)(h.user.lastLoginAt,p)},{name:u("team.member.lastLoginIp"),value:h.user.lastLoginIp||""},{name:u("common.createdAt"),value:(0,M.B2)(h.user.createdAt,p)},{name:u("common.remark"),value:h.user.remark||"--"},Array.isArray(h.user.tags)&&h.user.tags.length>0?{name:u("common.tags"),value:h.user.tags.map((e=>(0,te.jsx)(B.Z,{style:{background:e.color,color:(0,C.getTextColor)(e.color),marginRight:4},children:e.title},e.id)))}:null].filter(Boolean):[]).map((e=>e.name===u("common.did")?(0,te.jsx)(ge.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:()=>u("common.did"),children:e.value},e.name):(0,te.jsx)(ge.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name)))}},oauth:{label:u("team.member.connectedAccounts"),value:"oauth",component:()=>(0,te.jsx)(Je,{user:h.user,onChangeUser:x})},passports:{label:u("common.passport"),value:"passports",component:()=>(0,te.jsx)(ze,{user:h.user,teamDid:d,roles:c,createPassportSvg:i,onCreate:()=>{g(d,n).then((()=>{m&&h.issuances&&h.issuances.length&&(h.tab="issuances")}))},onRefresh:()=>{g(d,n)}})},issuances:{label:u("team.passport.issuance.pending"),value:"issuances",component:()=>(0,te.jsx)(Ze,{issuances:h.issuances||[],teamDid:d,onRefresh:()=>g(d,n)})}},y=Object.values(v).map((e=>{let{label:n,value:t}=e;return{label:n,value:t}})).filter((e=>{if("issuances"===e.value)return m&&h.issuances&&!!h.issuances.length;if("oauth"===e.value){var n;return((null===(n=h.user)||void 0===n?void 0:n.connectedAccounts)||[]).find((e=>{var n;return e.provider!==((null===(n=h.user)||void 0===n?void 0:n.sourceProvider)||_.LOGIN_PROVIDER.WALLET)}))}return!0})),j=v[h.tab]||v.info;return(0,te.jsx)(b.ZP,{title:u("common.member"),onClose:t,open:!0,PaperProps:{style:{maxWidth:632,minHeight:"80vh"}},fullWidth:!0,actions:h.user&&(0,te.jsx)(F.Z,{permission:l?"":"mutate_team",role:l?M.Wf:[],children:(0,te.jsx)(Ke,{user:h.user,children:e=>{let{open:n}=e;return(0,te.jsxs)(nn,{onClick:n,children:[h.user.approved?(0,te.jsx)(xe.Z,{style:{fontSize:"1.2em",marginRight:"0.4em"}}):(0,te.jsx)(ve.Z,{style:{fontSize:"1.2em",marginRight:"0.4em"}}),h.user.approved?u("team.member.forbidLogin"):u("team.member.allowLogin")]})}})}),children:(0,te.jsxs)($e,{children:[!h.user&&(0,te.jsx)(en,{children:(0,te.jsx)(V.Z,{})}),h.user&&(0,te.jsxs)("div",{children:[(0,te.jsxs)(f.Z,{display:"flex",alignItems:"center",className:"info",children:[(0,te.jsx)(fe.Z,{src:h.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),(0,te.jsxs)(f.Z,{children:[(0,te.jsx)(f.Z,{className:"name",children:h.user.fullName}),(0,te.jsx)(f.Z,{className:"did",mt:1,children:(0,te.jsx)(U.Z,{did:h.user.did,showQrcode:!0})})]})]}),(0,te.jsx)(f.Z,{mx:3,className:"tabs",children:(0,te.jsx)(he.Z,{tabs:y,current:h.tab,onChange:e=>{h.tab=e},scrollButtons:"auto"})}),(0,te.jsx)("div",{className:"body",children:(0,te.jsx)(j.component,{})})]})]})})}Qe.propTypes={userDid:d().string.isRequired,onCancel:d().func.isRequired,createPassportSvg:d().func.isRequired,initTab:d().string},Qe.defaultProps={initTab:Xe};const $e=r.Z.div(Fe||(Fe=(0,i.Z)(["\n .info {\n .name {\n font-weight: 400;\n font-size: 18px;\n line-height: 25px;\n color: #222222;\n }\n }\n\n .tabs {\n margin-top: 24px;\n margin-left: 0;\n margin-right: 0;\n }\n\n .body {\n margin-top: 24px;\n }\n"]))),en=r.Z.div(Me||(Me=(0,i.Z)(["\n flex: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 200px;\n"]))),nn=r.Z.div(Ve||(Ve=(0,i.Z)(["\n flex-shrink: 0;\n width: 100%;\n height: 64px;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n color: #999;\n fill: #999;\n font-size: 16px;\n border-top: 1px solid #f0f0f0;\n position: sticky;\n bottom: 0;\n background: #fff;\n z-index: 10;\n"])));var tn,sn=t(27773);function on(){const{api:e,inService:n}=(0,W.h6)(),{t:t,locale:s}=(0,o.useContext)(k.RD),{teamDid:i,invitations:r,refresh:a,endpoint:l}=(0,q.DJ)(),[c,d]=(0,o.useState)(null),[m,u]=(0,o.useState)(!1),p=()=>{u(!1),d(null)},f=e=>l?(0,M.ly)({inviteId:e.inviteId,endpoint:l}):"",h=[{label:t("team.inviting.link"),name:"inviteId",options:{sort:!1,customBodyRenderLite:e=>{const n=r[e];return l?(0,te.jsx)(ne.Z,{children:f(n)}):(0,te.jsx)(V.Z,{size:16})}}},{label:t("common.role"),name:"role",widtn:70},{label:t("common.remark"),name:"remark",options:{customBodyRender:e=>e||"--"}},{label:t("team.inviting.inviter"),name:"inviter.fullName",options:{sort:!1,customBodyRender:(e,n)=>{var t;let{rowIndex:s}=n;const i=r[s];return null===i||void 0===i||null===(t=i.inviter)||void 0===t?void 0:t.fullName}}},{label:t("common.expires"),name:"expireDate",options:{customBodyRender:e=>(0,te.jsx)(E.Z,{value:e,locale:s})}},{label:t("common.actions"),name:"",width:100,align:"center",options:{sort:!1,customBodyRenderLite:s=>{const o=r[s];return(0,te.jsx)(F.Z,{permission:n?"":"mutate_team",role:n?M.Wf:[],children:(0,te.jsxs)(w.Z,{onClick:()=>d({title:t("team.inviting.delete.title"),description:t("team.inviting.delete.description",{link:f(o)}),confirm:t("common.delConfirm"),cancel:t("common.cancel"),onConfirm:()=>(async n=>{let{inviteId:t}=n;if(!m){u(!0);try{await e.deleteInvitation({input:{teamDid:i,inviteId:t}}),a(),await(0,M._v)(800)}catch(s){console.error(s)}finally{u(!1),d(null)}}})(o),onCancel:p}),size:"small",color:"error",variant:"text",children:[(0,te.jsx)(sn.default,{style:{fontSize:"1.2em"}}),t("common.delete")]})})}}}];return(0,te.jsxs)(rn,{children:[r.length?(0,te.jsx)(D.Z,{locale:s,data:[...r],columns:h,verticalKeyWidth:100,options:{download:!1,filter:!1,print:!1}}):(0,te.jsx)(Te.Z,{children:t("common.empty")}),c&&(0,te.jsx)(be.Z,{title:c.title,description:c.description,confirm:c.confirm,cancel:c.cancel,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel})]})}const rn=r.Z.div(tn||(tn=(0,i.Z)(["\n margin-top: -20px;\n"])));on.propTypes={},on.defaultProps={};var an,ln=t(53047),cn=t(46954),dn=t(44067),mn=t(36299),un=t(92726);function pn(e){let{type:n,user:t,onIssuePassport:s,onRefresh:i}=e;const{teamDid:r,roles:a}=(0,q.DJ)(),{confirmHolder:l,confirmApi:c}=(0,b.N4)(),{t:d}=(0,o.useContext)(k.RD),[m,u]=(0,o.useState)(!1),{api:p}=(0,W.h6)(),f=(0,L.Z)((async()=>{const{userSessions:e=[]}=t,n=e.map((e=>()=>p.logoutUser({input:{teamDid:r,appPid:r,userDid:t.did,visitorId:e.visitorId}})));await(0,mn.Z)(n,{concurrency:3,stopOnError:!1})}));return(0,te.jsxs)(te.Fragment,{children:[l,(0,te.jsx)(un.Z,{"data-cy":"member-actions",actions:[{icon:(0,te.jsx)(j.Z,{fontSize:"small"}),text:d("team.passport.issue"),"data-cy":"action-issue-passport",onClick:e=>{e.stopPropagation(),u(!0)}},e=>{let{close:n}=e;return(0,te.jsx)(Ke,{user:t,children:e=>{let{open:s}=e;return(0,te.jsxs)(G.Z,{dense:!0,onClick:e=>{e.stopPropagation(),n(),s(e)},"data-cy":"action-toggle-block",children:[(0,te.jsx)(cn.Z,{style:{minWidth:24,marginRight:8},children:t.approved?(0,te.jsx)(xe.Z,{}):(0,te.jsx)(ve.Z,{})}),(0,te.jsx)(dn.Z,{primary:t.approved?d("team.member.forbidLogin"):d("team.member.allowLogin")})]})}},"toggle-approval")},"blocklet"===n&&{icon:(0,te.jsx)(ln.Z,{fontSize:"small"}),text:d("team.member.forceLogout"),onClick:e=>{e.stopPropagation(),c.open({title:d("team.member.forceLogout"),content:d("team.member.forceLogoutDescription"),confirmButtonText:d("common.confirm"),cancelButtonText:d("common.cancel"),onClick:e=>e.stopPropagation(),onConfirm:async()=>{await f(),await c.close(),i()}})}}].filter(Boolean)}),m&&(0,te.jsx)(De,{teamDid:r,ownerDid:t.did,needReceive:(0,ke.h1)(t)===t.did,roles:a,onCancel:()=>u(!1),onSuccess:()=>{s(),u(!1)}})]})}pn.propTypes={type:d().oneOf(["server","blocklet"]).isRequired,user:d().object.isRequired,onIssuePassport:d().func,onRefresh:d().func},pn.defaultProps={onIssuePassport:()=>{},onRefresh:()=>{}};const fn="$all",hn="$none",gn=(e,n)=>{const t=e.find((e=>e.key===n));return(null===t||void 0===t?void 0:t.value)||0},xn=(e,n)=>{const t=e.passports||[];return!!t.length&&!t.some((e=>{var t;return n.includes(null===(t=e.issuer)||void 0===t?void 0:t.id)}))};function vn(e){let{user:n}=e;const{t:t}=(0,o.useContext)(k.RD),s=(0,te.jsxs)("div",{className:"member-block",children:[(0,te.jsxs)("div",{className:"member-avatar",children:[(0,te.jsx)(R.Z,{src:"".concat(n.avatar,"?imageFilter=resize&w=48&h=48"),size:32,did:n.did,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),!n.approved&&(0,te.jsx)("did",{className:"badge-block"}),n.isFromExternal&&(0,te.jsx)(p.Z,{title:t("team.passport.externalPassport"),children:(0,te.jsx)(f.Z,{ml:1,className:"icon",children:(0,te.jsx)(P.Z,{})})})]}),(0,te.jsxs)("div",{className:"member-meta",children:[(0,te.jsx)("div",{className:"member-text",children:n.fullName}),Array.isArray(n.tags)&&n.tags.length>0&&(0,te.jsx)("div",{className:"member-tags",children:n.tags.map((e=>(0,te.jsx)(B.Z,{style:{background:e.color,color:(0,C.getTextColor)(e.color),marginRight:4},children:e.title},e.id)))})]})]});return n.approved?s:(0,te.jsx)(f.Z,{display:"flex",alignItems:"center",children:(0,te.jsx)(p.Z,{title:t("team.member.forbidLoginDescription"),children:s})})}function yn(e){let{type:n,createPassportSvg:t}=e;const{confirmApi:s,confirmHolder:i}=(0,b.N4)({sx:{".MuiDialog-paper":{borderRadius:2,maxWidth:1e3},".ux-dialog_title":{fontWeight:600},".ux-dialog_closeButton":{p:1},".MuiDialogActions-root":{display:{xs:"none",md:"flex"}}}}),{appIdList:r=[]}=(0,K.y0)(),a=(0,h.Z)((e=>e.breakpoints.down("md"))),{teamDid:c,invitations:d,teamIssuerDid:m,roles:p,refresh:R,enablePassportIssuance:P,endpoint:C,api:B}=(0,q.DJ)(),{inService:V,ws:{useSubscription:H}}=(0,W.h6)(),{t:Y,locale:G}=(0,o.useContext)(k.RD),[J,X]=(0,o.useState)(!1),[Q,$]=(0,o.useState)(!1),[ee,ne]=(0,o.useState)(!1),[ie,oe]=(0,o.useState)(!1),[re,ae]=(0,o.useState)(!1),[le,ce]=(0,o.useState)([]),[de,ue]=(0,o.useState)(),[pe,fe]=(0,o.useState)([]),[he]=(0,A.Z)({did:void 0}),ge="members-".concat(c),xe=(0,D.$)(ge),[ve,ye]=(0,o.useState)({role:fn,searchText:xe.searchText||"",hideBlocked:!1,pageSize:xe.rowsPerPage||10,page:xe.page?xe.page+1:1});(0,O.Z)((async()=>{if(he.did){const{user:e}=await B.getUser({did:he.did});e&&oe(e)}}));const be=(p||[]).map((e=>({name:e.name,title:e.title,num:gn(pe,e.name)})));be.unshift({name:fn,title:"All Members",num:gn(pe,fn)}),be.push({name:hn,title:"Other",num:gn(pe,hn)});const je=()=>{const e={includeTags:!0,includeUserSessions:"blocklet"===n};ve.hideBlocked&&(e.approved=!0),e.role=ve.role,ve.searchText&&(e.search=ve.searchText),ae(!0),B.getUsers({query:e,paging:{page:ve.page,pageSize:ve.pageSize}}).then((e=>{ae(!1),(e.users||[]).forEach((e=>{e.isFromExternal=xn(e,l()(r)?[m]:r),e.avatar=Ge(e.avatar,c,V),e.passports=(e.passports||[]).filter((e=>e.issuer))})),ce(e.users||[]),ue(e.paging.total)})).catch((e=>{ae(!1),I.Z.error(e.message)}))},Ze=()=>{B.getUsersCountPerRole().then((e=>{fe(e.counts||[])})).catch((e=>{I.Z.error(e.message)}))},Se=e=>{e.teamDid===c&&(je(),Ze())};(0,o.useEffect)((()=>{je()}),["".concat(ve.hideBlocked,"-").concat(ve.role,"-").concat(ve.page,"-").concat(ve.pageSize,"-").concat(ve.searchText)]),(0,o.useEffect)((()=>{Ze()}),[]),H(_.TeamEvents.userUpdated,Se,[ve]),H(_.TeamEvents.userAdded,Se,[ve]);const Re=P,ke=(0,L.Z)((e=>{s.open({title:"User Sessions",content:(0,te.jsx)(z.YZ,{user:e,showAction:!1,showUser:!1}),onConfirm(){s.close()},confirmButtonText:Y("common.close"),showCancelButton:!1})})),we=[{label:Y("common.name"),name:"fullName",options:{customBodyRenderLite:e=>{const n=le[e];return(0,te.jsx)("div",{"data-cy":"member-name-".concat(n.fullName),children:(0,te.jsx)(vn,{user:n})},n.did)}}},{label:Y("common.address"),name:"did",options:{customBodyRender:e=>(0,te.jsx)(U.Z,{size:14,responsive:!a,compact:a,copyable:!1,did:e})}},{label:Y("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:e=>(0,te.jsx)(f.Z,{sx:{minWidth:"100px"},children:(0,te.jsx)(E.Z,{value:e,locale:G})})}},{label:Y("team.member.lastLoginIp"),name:"lastLoginIp",options:{customBodyRender:e=>e||"-"}},{label:Y("team.member.source"),name:"sourceProvider",options:{customBodyRenderLite:e=>{const n=le[e],t=n.sourceProvider||N.USER_TYPE.WALLET,s=_.PROVIDER_NAME[t]||t;return n.sourceAppPid?"".concat(s," (").concat(Y("team.member.federated"),")"):s}}},"blocklet"===n&&{label:Y("team.member.activeUserSessions"),name:"userSessions",options:{customBodyRenderLite:e=>{var n,t,s;const i=le[e];return(0,te.jsx)(g.Z,{onClick:e=>{e.stopPropagation(),ke(i)},children:(0,te.jsx)(x.Z,{badgeContent:null===i||void 0===i||null===(n=i.userSessions)||void 0===n?void 0:n.length,color:(null===i||void 0===i||null===(t=i.userSessions)||void 0===t?void 0:t.length)>0?"primary":"default",sx:(null===i||void 0===i||null===(s=i.userSessions)||void 0===s?void 0:s.length)>0?{}:{".MuiBadge-badge":{backgroundColor:"grey",color:"white"}},showZero:!0,children:(0,te.jsx)(S.Z,{})})})}}},{label:Y("common.actions"),name:"",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:e=>{const t=le[e];return(0,te.jsx)(F.Z,{permission:V?"":"mutate_team",role:V?M.Wf:[],children:(0,te.jsx)(pn,{type:n,user:t,onIssuePassport:()=>oe({...t,initTab:"issuances"}),onRefresh:()=>Se({teamDid:c})})})}}}].filter(Boolean),Te=[];Re&&(Te.push((0,te.jsxs)(w.Z,{variant:"outlined",style:{flexShrink:0,marginRight:16},color:"primary",size:"small",onClick:()=>{ne(!0)},children:[(0,te.jsx)(T.Z,{style:{height:"1em",marginRight:4}}),Y("common.inviting"),d.length?" (".concat(d.length,")"):""]}),(0,te.jsx)(F.Z,{permission:V?"":"mutate_team",role:V?M.Wf:[],children:(0,te.jsxs)(w.Z,{style:{flexShrink:0,marginRight:16},variant:"contained",edge:"end",color:"primary",size:"small","data-cy":"invite-member",onClick:()=>X(!0),children:[(0,te.jsx)(j.Z,{style:{fontSize:"1.3em",marginRight:4}}),Y("team.invite")]})})),"server"===n&&Te.push((0,te.jsx)(F.Z,{role:"owner",children:(0,te.jsxs)(w.Z,{style:{flexShrink:0},variant:"contained",edge:"end",color:"error",size:"small","data-cy":"invite-member",onClick:()=>$(!0),children:[(0,te.jsx)(Z.Z,{style:{fontSize:"1.3em",marginRight:4}}),Y("team.transferNode.name")]})})));const Pe=(0,o.useRef)(null),Ce={sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick(e,n,t){var s;let{dataIndex:i}=n;if(null!==(s=Pe.current)&&void 0!==s&&s.contains(t.target)){const e=le[i];oe(e)}},page:ve.page-1,rowsPerPage:ve.pageSize,count:de,searchDebounceTime:600};return(0,te.jsxs)(bn,{children:[i,(0,te.jsxs)(f.Z,{className:"main",display:"flex",sx:{mt:V?4:0},children:[(0,te.jsx)("div",{className:"left",children:(0,te.jsx)("div",{className:"tabs",children:be.map((e=>(0,te.jsxs)("div",{className:"tab ".concat(ve.role===e.name?"active":""),onClick:()=>{return n=e.name,void(re||ye((e=>({...e,role:n,hideBlocked:!1,searchText:"",page:1}))));var n},children:[(0,te.jsx)("span",{className:"text",children:e.title}),(0,te.jsx)("span",{className:u()("badge",{"is-rect":e.num>999}),children:e.num})]},e.name)))})}),(0,te.jsx)("div",{ref:Pe,className:"right",children:(0,te.jsx)(D.Z,{className:"main-table",verticalKeyWidth:100,locale:G,durable:ge,durableKeys:["page","rowsPerPage"],title:(0,te.jsx)("div",{className:"table-toolbar-left",children:(0,te.jsx)(v.Z,{control:(0,te.jsx)(y.Z,{sx:{display:"flex !important"},disabled:re,color:"primary",checked:ve.hideBlocked,onChange:e=>{return n=e.target.checked,void ye((e=>({...e,hideBlocked:n,page:1})));var n}}),label:Y("team.member.hideBlockedMember")})}),data:le,columns:we,customButtons:Te,options:Ce,loading:re,onChange:e=>{let{page:n,rowsPerPage:t,searchText:s}=e;ve.pageSize!==t?ye((e=>({...e,pageSize:t,page:1}))):ve.page!==n+1?ye((e=>({...e,page:n+1}))):ve.searchText!==s&&ye((e=>({...e,searchText:s,page:1})))}})})]}),(0,te.jsx)(b.ZP,{title:Y("common.inviting"),onClose:()=>ne(!1),open:ee,maxWidth:"lg",fullWidth:!0,children:(0,te.jsx)(on,{})}),ie&&(0,te.jsx)(Qe,{onCancel:()=>oe(null),userDid:ie.did,createPassportSvg:t,initTab:ie.initTab}),J&&(0,te.jsx)(se,{teamDid:c,endpoint:C,roles:p,onCancel:()=>X(!1),onSuccess:()=>{R(),X(!1)}}),Q&&(0,te.jsx)(me,{teamDid:c,endpoint:C,roles:p,onCancel:()=>$(!1),onSuccess:()=>{R(),$(!1)}})]})}vn.propTypes={user:d().object.isRequired};const bn=r.Z.div(an||(an=(0,i.Z)(["\n .main {\n .left {\n width: 168px;\n flex-shrink: 0;\n margin-right: 65px;\n .tabs {\n padding-top: 16px;\n .tab {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 16px;\n transition: background 0.4s;\n\n width: 168px;\n height: 36px;\n border-radius: 8px;\n\n cursor: pointer;\n user-select: none;\n\n &:nth-child(n + 2) {\n margin-top: 24px;\n }\n\n &.active {\n background: #f2f2f2;\n }\n\n &:hover {\n background: #f2f2f2;\n }\n\n .text {\n font-weight: 400;\n font-size: 16px;\n line-height: 19px;\n\n color: #222222;\n }\n\n .badge {\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n align-items: center;\n width: 20px;\n height: 20px;\n border-radius: 100%;\n color: #fff;\n background: #666666;\n font-size: 10px;\n font-weight: 400;\n &.is-rect {\n width: auto;\n border-radius: 8px;\n padding: 0 4px;\n }\n }\n }\n }\n @media (max-width: ","px) {\n display: none;\n }\n }\n .right {\n flex: 1;\n overflow: auto;\n }\n }\n\n .member-block {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n .member-avatar {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .member-meta {\n margin-left: 10px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n }\n .badge-block {\n width: 14px;\n height: 14px;\n position: absolute;\n right: -4px;\n top: -4px;\n background: #ff5757;\n border-radius: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n &::after {\n content: '';\n width: 6px;\n height: 2px;\n background: #fefefe;\n }\n }\n }\n\n .table-toolbar-left {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 7px 0;\n }\n"])),(e=>e.theme.breakpoints.values.md));yn.propTypes={type:d().oneOf(["server","blocklet"]).isRequired,createPassportSvg:d().func.isRequired}},82638:(e,n,t)=>{"use strict";t.d(n,{Z:()=>c});var s,i=t(71171),o=t(33518),r=t(47020),a=t(57201),l=t(96266);const c=(0,o.Z)((e=>{let{children:n,...t}=e;return(0,l.jsx)(r.Z,{...t,id:"outlined-basic",variant:"outlined",InputProps:{startAdornment:(0,l.jsx)(a.default,{})},size:"small",children:n})}))(s||(s=(0,i.Z)(["\n .MuiOutlinedInput-root {\n color: #999;\n &.MuiInputBase-adornedStart .MuiSvgIcon-root {\n color: #bfbfbf;\n }\n opacity: 1;\n border-radius: 36px;\n background: #f8f8f8;\n padding-left: 16px;\n input {\n padding-left: 8px;\n font-weight: bold;\n &::placeholder {\n opacity: 1;\n color: #bfbfbf;\n }\n padding-top: 8.5px;\n padding-bottom: 8.5px;\n }\n }\n\n .MuiOutlinedInput-notchedOutline,\n .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline,\n .Mui-focused .MuiOutlinedInput-notchedOutline {\n border-color: #eee;\n border-width: 1px;\n }\n"])))},18901:(e,n,t)=>{"use strict";t.d(n,{Z:()=>o});var s,i=t(71171);const o=t(33518).Z.div(s||(s=(0,i.Z)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 14px;\n .left,\n .right {\n }\n .right {\n display: flex;\n align-items: center;\n }\n .tabs {\n .MuiButton-root {\n border: none;\n color: #999;\n &.active {\n color: #222;\n }\n }\n }\n\n @media (max-width: 600px) {\n display: block;\n .right {\n margin-top: 12px;\n }\n }\n"])))},99132:(e,n,t)=>{"use strict";t.d(n,{xb:()=>S});var s=t(35432),i=t(2842),o=t(81534),r=t(10458),a=Object.defineProperty,l=(e,n,t)=>(((e,n,t)=>{n in e?a(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t})(e,"symbol"!==typeof n?n+"":n,t),t);class c{constructor(e){let{api:n}=e;l(this,"api"),this.api=n}async getUserPublicInfo(e){let{did:n}=e;const{data:t}=await this.api.get("/api/user",{params:{did:n}});return t}async getUserPrivacyConfig(e){let{did:n}=e;const{data:t}=await this.api.get("/api/user/privacy/config",{params:{did:n}});return t}async saveUserPrivacyConfig(e){const{data:n}=await this.api.post("/api/user/privacy/config",e);return n}async getUserNotificationConfig(){const{data:e}=await this.api.get("/api/user/notification/config");return e}async saveUserNotificationConfig(e){const{data:n}=await this.api.post("/api/user/notification/config",e);return n}async testNotificationWebhook(e){const{data:n}=await this.api.put("/api/user/notification/webhook",e);return n}async getProfileUrl(e){let{did:n,locale:t}=e;const o="".concat(s.WELLKNOWN_SERVICE_PATH_PREFIX,"/user");return(0,i.jb)(o,{did:n,locale:t})}async logout(e){let{visitorId:n}=e;const{data:t}=await this.api.post("/api/user/logout",{visitorId:n});return t}}class d{getSessionToken(){return o.Z.get(s.SESSION_TOKEN_STORAGE_KEY)}setSessionToken(e){o.Z.set(s.SESSION_TOKEN_STORAGE_KEY,e)}removeSessionToken(){o.Z.remove(s.SESSION_TOKEN_STORAGE_KEY)}getRefreshToken(){return localStorage.getItem(s.REFRESH_TOKEN_STORAGE_KEY)}setRefreshToken(e){localStorage.setItem(s.REFRESH_TOKEN_STORAGE_KEY,e)}removeRefreshToken(){localStorage.removeItem(s.REFRESH_TOKEN_STORAGE_KEY)}}var m=Object.defineProperty,u=(e,n,t)=>(((e,n,t)=>{n in e?m(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t})(e,"symbol"!==typeof n?n+"":n,t),t);class p{constructor(e){let{api:n}=e;u(this,"api"),this.api=n}async getUserSessions(e){let{did:n}=e;const{data:t}=await this.api.get("/api/user-session",{params:{userDid:n}});return t}}const f="1.16.25",h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((n=>{setTimeout((()=>{n()}),e)}))},g=e=>"Bearer ".concat(encodeURIComponent(e)),x=()=>localStorage.getItem("__visitor_id");async function v(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;e.metaData.endTime=+new Date;const{startTime:t,endTime:s}=e.metaData,i=s-t;i<n&&await h(n-i),delete e.metaData}const y=(e,n)=>{const t={...null===e||void 0===e?void 0:e.headers,"x-blocklet-js-sdk-version":f},s=x();[void 0,null].includes(s)||(t["x-blocklet-visitor-id"]=s);const i=r.create({...e,headers:t});return null!==n&&void 0!==n&&n.lazy&&(i.interceptors.request.use((e=>(e.metaData={startTime:+new Date},e)),(e=>Promise.reject(e))),i.interceptors.response.use((async e=>(await v(e.config,null===n||void 0===n?void 0:n.lazyTime),e)),(async e=>(await v(e.response.config,null===n||void 0===n?void 0:n.lazyTime),Promise.reject(e))))),i};function b(e,n,t){let{getSessionToken:i,setSessionToken:r,removeSessionToken:a,getRefreshToken:l,setRefreshToken:c,removeRefreshToken:d,onRefreshTokenError:m,onRefreshTokenSuccess:u}=e,p=null;const f=y({timeout:3e4,...n},t);return f.interceptors.request.use((async e=>{if(!o.Z.get(s.SESSION_TOKEN_STORAGE_KEY)){const n=i();n&&(e.headers.authorization=g(n))}return p&&await p,e}),(e=>Promise.reject(e))),f.interceptors.response.use((e=>e),(async e=>{var n;const t=e.config;if(t.headers={...null===t||void 0===t?void 0:t.headers},401===(null===e||void 0===e||null===(n=e.response)||void 0===n?void 0:n.status)&&!t._retry){t._retry=!0;try{p||(p=async function(e){if(!e)throw new Error("Refresh token not found");const n=y({baseURL:s.WELLKNOWN_SERVICE_PATH_PREFIX,timeout:1e4,headers:{authorization:g(e)}}),{data:t}=await n.post("/api/did/refreshSession");return t}(l()));const e=await p;return r(e.nextToken),c(e.nextRefreshToken),"function"===typeof u&&u(e),f(t)}catch(i){return a(),d(),"function"===typeof m&&m(i),Promise.reject(e)}finally{p=null}}return Promise.reject(e)})),f}var j=Object.defineProperty,Z=(e,n,t)=>(((e,n,t)=>{n in e?j(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t})(e,"symbol"!==typeof n?n+"":n,t),t);class S{constructor(){Z(this,"api"),Z(this,"user"),Z(this,"userSession"),Z(this,"token");const e=new d,n=b({getSessionToken:e.getSessionToken,setSessionToken:e.setSessionToken,removeSessionToken:e.removeSessionToken,getRefreshToken:e.getRefreshToken,setRefreshToken:e.setRefreshToken,removeRefreshToken:e.removeRefreshToken,onRefreshTokenError:()=>{console.error("Failed to refresh token")},onRefreshTokenSuccess:()=>{}},{baseURL:s.WELLKNOWN_SERVICE_PATH_PREFIX});this.user=new c({api:n}),this.userSession=new p({api:n}),this.token=e,this.api=n}}}}]);
|
|
1
|
+
(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[4296,9132],{32322:(e,n,t)=>{"use strict";n.h1=void 0;const s=t(77277);function i(e){return(null===e||void 0===e?void 0:e.connectedAccounts)||[]}function o(e){return i(e).find((e=>e.provider===s.LOGIN_PROVIDER.WALLET))}n.h1=function(e){const n=o(e);return null===n||void 0===n?void 0:n.did}},15098:(e,n,t)=>{const{ROLES:s,PASSPORT_STATUS:i}=t(35432);e.exports={hasActiveOwnerPassport:e=>((null===e||void 0===e?void 0:e.passports)||[]).some((e=>e.role===s.OWNER&&e.status===i.VALID))}},92726:(e,n,t)=>{"use strict";t.d(n,{Z:()=>g});var s,i=t(71171),o=t(5057),r=t(55898),a=t.n(r),l=t(33518),c=t(67680),d=t(61533),m=t(74490),u=t(45267),p=t(46954),f=t(44067),h=t(96266);function g(e){let{actions:n,size:t,...s}=e;const[i,r]=(0,o.useState)(null),a=Boolean(i),l=e=>{try{e.stopPropagation(),e.preventDefault()}catch{}r(null)};return(0,h.jsxs)(x,{...s,children:[(0,h.jsx)(c.Z,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"actions-menu-icon",onClick:e=>{try{e.stopPropagation(),e.preventDefault()}catch{}r(e.currentTarget)},size:t,children:(0,h.jsx)(u.Z,{})}),(0,h.jsx)(d.Z,{id:"actions-menu","data-cy":"actions-menu",anchorEl:i,keepMounted:!0,open:a,onClose:l,slotProps:{paper:{}},children:n.map(((e,n)=>{if("function"===typeof e)return e({close:l});const{icon:t,text:s,onClick:i,disabled:r=!1,...a}=e;return(0,o.createElement)(m.Z,{...a,disabled:r,dense:!0,onClick:async e=>{await i(e),l()},key:n,"data-cy":"actions-menu-".concat(n)},(0,h.jsx)(p.Z,{style:{minWidth:24,marginRight:8},children:t}),(0,h.jsx)(f.Z,{primary:s}))}))})]})}g.propTypes={actions:a().array,size:a().oneOf(["small","medium","large"])},g.defaultProps={actions:[],size:"small"};const x=l.Z.div(s||(s=(0,i.Z)([""])))},50185:(e,n,t)=>{"use strict";t.d(n,{Z:()=>c});var s=t(5057),i=t(55898),o=t.n(i),r=t(12937),a=t(68420),l=t(96266);function c(e){let{children:n,...t}=e;const{t:i}=(0,s.useContext)(a.RD);return(0,l.jsx)(r.Z,{tip:i("common.copyTip"),copiedTip:i("common.copiedTip"),...t,children:n})}c.propTypes={children:o().any.isRequired}},9729:(e,n,t)=>{"use strict";t.d(n,{Z:()=>d});var s,i=t(71171),o=t(55898),r=t.n(o),a=t(33518),l=t(13727),c=t(96266);function d(e){const{passport:n,onDelete:t,...s}=e;return(0,c.jsxs)(m,{...s,children:[n.title||n.name," ",!!t&&(0,c.jsx)(l.default,{"data-cy":"delete-issuance",className:"delete",onClick:t})]})}d.propTypes={passport:r().object.isRequired,onDelete:r().func},d.defaultProps={onDelete:null};const m=a.Z.span(s||(s=(0,i.Z)(["\n display: inline-flex;\n padding: 2px 8px;\n background: ",";\n border-radius: 100vw;\n font-weight: 400;\n font-size: 12px;\n line-height: 22px;\n color: #fff;\n align-items: center;\n .delete {\n font-size: 1em;\n margin-left: 6px;\n cursor: pointer;\n }\n"])),(e=>e.theme.palette.primary.main))},75672:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>yn});var s,i=t(71171),o=t(5057),r=t(33518),a=t(75506),l=t.n(a),c=t(55898),d=t.n(c),m=t(52277),u=t.n(m),p=t(75239),f=t(39948),h=t(15715),g=t(67680),x=t(83407),v=t(26174),y=t(88092),b=t(13128),j=t(44919),Z=t(80578),S=t(64185),R=t(72333),k=t(68420),w=t(28726),T=t(68051),P=t(18945),C=t(49777),D=t(75760),E=t(49384),I=t(86229),N=t(35432),_=t(77277),A=t(10381),O=t(42061),L=t(99360),z=t(4962),B=t(22228),U=t(17450),W=t(58238),q=t(17425),K=t(29054),F=t(63406),M=t(46090),V=t(44846),H=t(55372),Y=t(11750),G=t(74490),J=t(51177),X=t(47020),Q=t(6041),$=t(80576),ee=t(88574),ne=t(50185),te=t(96266);function se(e){let{teamDid:n,roles:t,onCancel:s,onSuccess:i,onError:r,endpoint:a}=e;const{api:l}=(0,W.h6)(),[c,d]=(0,o.useState)(!1),[m,u]=(0,o.useState)(""),{t:p,locale:f}=(0,k.PE)(),[h,g]=(0,o.useState)(0),[x,v]=(0,o.useState)(""),[y,j]=(0,o.useState)(""),[Z,S]=(0,o.useState)(""),R=async()=>{if(!y)return void u(p("team.member.error.passportEmpty"));const e=Z.trim();u(null),d(!0);try{const{inviteInfo:t}=await l.createMemberInvitation({input:{teamDid:n,role:y,remark:e}});v(t),g(1)}catch(t){const e=(0,M.Z)(t);u(e),r(t)}finally{d(!1)}},T=[{body:(0,te.jsxs)(Y.Z,{component:"div",children:[(0,te.jsxs)($.Z,{style:{width:"100%"},variant:"outlined",children:[(0,te.jsx)(Q.Z,{children:p("common.passport")}),(0,te.jsx)(J.Z,{"data-cy":"invite-member-select-role",value:y,onChange:e=>{u(null),j(e.target.value)},fullWidth:!0,label:p("common.passport"),disabled:c,onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),R())},children:t.filter((e=>"owner"!==e.name)).map((e=>(0,te.jsx)(G.Z,{value:e.name,"data-cy":"invite-member-select-option-".concat(e.name),children:(0,te.jsx)("span",{children:e.title||e.name})},e.name)))})]}),(0,te.jsx)("div",{style:{marginTop:20,marginBottom:10}}),(0,te.jsx)(X.Z,{label:p("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:Z,onChange:e=>{u(null),S(e.target.value)},disabled:c,"data-cy":"invite-member-input-remark"}),(0,te.jsx)("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:p("common.cancel"),confirm:p("team.member.inviteDialog.createInviteLink"),onCancel:s,onConfirm:R},{body:()=>{const e=(0,M.ly)({inviteId:x.inviteId,endpoint:a});return(0,te.jsxs)("div",{children:[(0,te.jsx)(ie,{children:p("team.member.inviteDialog.createSuccessTip",{expireDate:(0,M.B2)(x.expireDate,f)})}),(0,te.jsx)("div",{style:{marginTop:"40px"}}),(0,te.jsx)(ne.Z,{children:e})]})},confirm:p("common.confirm"),onConfirm:i}][h];return(0,te.jsxs)(b.ZP,{title:p("common.invite"),fullWidth:!0,open:!0,showCloseButton:!1,actions:(0,te.jsxs)(te.Fragment,{children:[T.cancel&&(0,te.jsx)(w.Z,{onClick:T.onCancel,color:"inherit",children:T.cancel}),(0,te.jsxs)(w.Z,{onClick:T.onConfirm,color:"primary",disabled:c||!y,variant:"contained",autoFocus:!0,children:[c&&(0,te.jsx)(V.Z,{size:16}),T.confirm]})]}),children:[(0,te.jsx)(H.Z,{component:"div",children:"function"===typeof T.body?T.body():T.body}),!!m&&(0,te.jsx)(ee.Z,{type:"error",variant:"icon",children:m})]})}se.propTypes={teamDid:d().string.isRequired,onCancel:d().func.isRequired,onSuccess:d().func.isRequired,onError:d().func,roles:d().array,endpoint:d().string},se.defaultProps={onError:()=>{},roles:[],endpoint:""};const ie=r.Z.div(s||(s=(0,i.Z)(["\n font-size: 16px;\n font-weight: bold;\n"])));var oe,re=t(26796),ae=t(43681),le=t.n(ae),ce=t(88577),de=t(73545);function me(e){let{teamDid:n,onCancel:t,onSuccess:s,onError:i,endpoint:r}=e;const{api:a,info:l}=(0,W.h6)(),{api:c}=(0,o.useContext)(de.B),[d,m]=(0,o.useState)(!1),{t:u,locale:p}=(0,k.PE)(),[f,h]=(0,o.useState)(""),[g,x]=(0,o.useState)(!1),[v,y]=(0,o.useState)(0),[j,Z]=(0,o.useState)(""),[S,R]=(0,o.useState)(""),T=!!le()(l,"ownerNft.did"),P=(0,re.default)((async()=>{if(T){const{state:e}=await a.getDelegationState();return e}return{delegated:!0}}));if(P.loading)return(0,te.jsx)(b.ZP,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:t,children:(0,te.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,te.jsx)(V.Z,{})})});if(P.error)return(0,te.jsx)(b.ZP,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,onClose:t,children:(0,te.jsx)(ee.Z,{type:"error",variant:"icon",children:(0,M.Z)(P.error)})});const C=async()=>{h(null),m(!0);try{const{inviteInfo:e}=await a.createTransferInvitation({input:{teamDid:n,role:"owner",remark:S.trim()}});Z(e),y(E.length-1)}catch(e){const n=(0,M.Z)(e);h(n),i(e)}finally{m(!1)}},D=()=>{x(!1),y(0)},E=[{body:(0,te.jsxs)(Y.Z,{component:"div",children:[(0,te.jsxs)(ee.Z,{type:"warning",children:[(0,te.jsx)(Y.Z,{children:u("team.transferNode.inviteDialog.tips.progress")}),(0,te.jsx)(Y.Z,{children:u("team.transferNode.inviteDialog.tips.newOwnerPermissions")})]}),(0,te.jsx)(ee.Z,{type:"warning",children:(0,te.jsx)(Y.Z,{children:u("team.transferNode.inviteDialog.tips.revoke")})}),(0,te.jsx)("div",{style:{marginTop:20,marginBottom:10}}),(0,te.jsx)(X.Z,{label:u("common.remark"),autoComplete:"off",variant:"outlined",fullWidth:!0,style:{marginBottom:8},value:S,onChange:e=>{h(null),R(e.target.value)},disabled:d,"data-cy":"transfer-node-input-remark"}),(0,te.jsx)("div",{style:{marginTop:20,marginBottom:10}})]}),cancel:u("common.cancel"),confirm:u("team.transferNode.inviteDialog.createInviteLink"),onCancel:t,onConfirm:T&&!le()(P,"value.delegated")?()=>{x(!0),y(1)}:C},{body:()=>(0,te.jsx)(ce.Z,{action:"delegate-transfer-nft",open:g,locale:p,checkFn:c.get,onClose:D,onSuccess:C,checkTimeout:3e5,webWalletUrl:(0,M.yP)(l),extraParams:{targetDID:l.did},messages:{title:u("team.transferNode.delegateDialog.title"),scan:u("team.transferNode.delegateDialog.scan"),confirm:u("team.transferNode.delegateDialog.confirm"),success:u("team.transferNode.delegateDialog.success")},popup:!0})},{body:()=>{const e=(0,M.ly)({inviteId:j.inviteId,endpoint:r});return(0,te.jsxs)("div",{children:[(0,te.jsx)(ue,{children:u("team.transferNode.inviteDialog.createSuccessTip",{expireDate:(0,M.B2)(j.expireDate,p)})}),(0,te.jsx)("div",{style:{marginTop:"40px"}}),(0,te.jsx)(ne.Z,{children:e})]})},confirm:u("common.confirm"),onConfirm:s}],I=E[v];return(0,te.jsxs)(b.ZP,{title:u("team.transferNode.inviteDialog.title"),fullWidth:!0,open:!0,showCloseButton:!1,actions:(0,te.jsxs)(te.Fragment,{children:[I.cancel&&(0,te.jsx)(w.Z,{onClick:I.onCancel,color:"inherit",children:I.cancel}),(0,te.jsxs)(w.Z,{onClick:I.onConfirm,color:"primary",disabled:d,variant:"contained",autoFocus:!0,children:[d&&(0,te.jsx)(V.Z,{size:16}),I.confirm]})]}),children:[(0,te.jsx)(H.Z,{component:"div",children:"function"===typeof I.body?I.body():I.body}),!!f&&(0,te.jsx)(ee.Z,{type:"error",variant:"icon",children:f})]})}me.propTypes={teamDid:d().string.isRequired,onCancel:d().func.isRequired,onSuccess:d().func.isRequired,onError:d().func,endpoint:d().string},me.defaultProps={onError:()=>{},endpoint:""};const ue=r.Z.div(oe||(oe=(0,i.Z)(["\n font-size: 16px;\n font-weight: bold;\n"])));var pe,fe=t(62681),he=t(94464),ge=t(64886),xe=t(12987),ve=t(71246),ye=t(12673),be=t(70461),je=t(9729);function Ze(e){let{issuances:n,teamDid:t,onRefresh:s}=e;const{api:i,inService:r}=(0,W.h6)(),{t:a,locale:l}=(0,o.useContext)(k.RD),[c,d]=(0,o.useState)(null),[m,u]=(0,o.useState)(!1),{endpoint:p}=(0,q.DJ)(),h=()=>{u(!1),d(null)},g=e=>p?(0,M._)({id:e.id,endpoint:p}):"";function x(e){let{data:n}=e;return(0,te.jsxs)("div",{className:"issuance",children:[(0,te.jsxs)(f.Z,{display:"flex",justifyContent:"space-between",children:[(0,te.jsx)(F.Z,{permission:r?"":"mutate_team",role:r?M.Wf:[],children:e=>e?(0,te.jsx)(je.Z,{passport:{title:n.title,name:n.name},onDelete:()=>d({title:a("team.passport.issuance.delete.title"),description:a("team.passport.issuance.delete.description",{link:g(n)}),confirm:a("common.delConfirm"),cancel:a("common.cancel"),onConfirm:()=>{(async e=>{let{id:n}=e;if(!m){u(!0);try{await i.deletePassportIssuance({input:{teamDid:t,sessionId:n}}),s()}catch(o){I.Z.error(o.message)}finally{u(!1),d(null)}}})(n)},onCancel:h})}):(0,te.jsx)(je.Z,{passport:{title:n.title,name:n.name}})}),(0,te.jsxs)("div",{style:{color:"#999"},children:[a("common.expires"),":\xa0",(0,M.B2)(n.expireDate,l)]})]}),(0,te.jsx)(f.Z,{mt:2,children:(0,te.jsx)(ne.Z,{children:g(n)})})]})}return(0,te.jsxs)(Se,{children:[n.map((e=>(0,te.jsx)(x,{data:e}))),c&&(0,te.jsx)(be.Z,{title:c.title,description:c.description,confirm:c.confirm,cancel:c.cancel,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel})]})}const Se=r.Z.div(pe||(pe=(0,i.Z)(["\n .MuiTableHead-root {\n display: none;\n }\n .issuance {\n padding: 16px 0;\n border-bottom: 1px solid #f0f0f0;\n .MuiTypography-root {\n display: inline-block;\n width: 100%;\n background: #f3f3f3;\n border-radius: 4px;\n padding-top: 6px;\n padding-bottom: 6px;\n }\n }\n"])));Ze.propTypes={teamDid:d().string.isRequired,issuances:d().array,onRefresh:d().func},Ze.defaultProps={issuances:[],onRefresh:()=>{}};var Re=t(5178),ke=t(32322),we=t(87806),Te=t(25710),Pe=t(82638),Ce=t(18901);function De(e){let{teamDid:n,ownerDid:t,needReceive:s,roles:i,onCancel:r,onSuccess:a,onError:l,showOwnerPassport:c}=e;const{api:d}=(0,W.h6)(),[m,u]=(0,o.useState)(!1),[p,f]=(0,o.useState)(""),{t:h}=(0,k.PE)(),[g,x]=(0,o.useState)(""),v=async()=>{if(g){f(null),u(!0);try{await d.createPassportIssuance({input:{teamDid:n,name:g,ownerDid:t}}),a()}catch(e){const n=(0,M.Z)(e);f(n),l(e)}finally{u(!1)}}else f(h("team.member.error.passportEmpty"))};return(0,te.jsxs)(b.ZP,{title:h("team.passport.issue"),fullWidth:!0,open:!0,onClick:e=>e.stopPropagation(),onClose:r,disableEscapeKeyDown:!0,PaperProps:{style:{minHeight:"auto"}},actions:(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(w.Z,{onClick:r,color:"inherit",size:"small",children:h("common.cancel")}),(0,te.jsxs)(w.Z,{onClick:v,color:"primary",size:"small",disabled:m||!g,variant:"contained",autoFocus:!0,"data-cy":"issue-passport-create-btn",children:[m&&(0,te.jsx)(V.Z,{size:16}),h(s?"team.passport.issuance.create.title":"oauth.issued")]})]}),children:[(0,te.jsx)(H.Z,{component:"div",children:(0,te.jsx)(Y.Z,{component:"div",children:(0,te.jsxs)($.Z,{style:{width:"100%"},variant:"outlined",children:[(0,te.jsx)(Q.Z,{children:h("common.passport")}),(0,te.jsx)(J.Z,{"data-cy":"issue-passport-select-passport",value:g,onChange:e=>{f(null),x(e.target.value)},fullWidth:!0,label:h("common.passport"),disabled:m,onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),v())},children:i.filter((e=>c||"owner"!==e.name)).map((e=>(0,te.jsx)(G.Z,{value:e.name,"data-cy":"issue-passport-select-option-".concat(e.name),children:(0,te.jsx)("span",{children:e.title||e.name})},e.name)))})]})})}),!!p&&(0,te.jsx)(ee.Z,{type:"error",variant:"icon",children:p})]})}De.propTypes={teamDid:d().string.isRequired,ownerDid:d().string.isRequired,needReceive:d().bool,onCancel:d().func.isRequired,onSuccess:d().func.isRequired,onError:d().func,roles:d().array,showOwnerPassport:d().bool},De.defaultProps={onError:()=>{},roles:[],showOwnerPassport:!1,needReceive:!0};var Ee,Ie=t(26538),Ne=t.n(Ie);function _e(e){let{passport:n,user:t,color:s,width:i,icon:o,children:r,createPassportSvg:a,...l}=e;const{t:c}=(0,k.PE)();return(0,te.jsxs)(Ae,{display:"flex",alignItems:"center",...l,children:[(0,te.jsx)("div",{dangerouslySetInnerHTML:{__html:a({title:n.title||n.name,issuer:n.issuer&&n.issuer.name,issuerDid:n.issuer&&n.issuer.id,ownerName:t.fullName,ownerDid:t.did,ownerAvatarUrl:t.avatar,revoked:n.revoked,preferredColor:s,width:i})}}),(0,te.jsxs)("div",{className:"body",children:[(0,te.jsxs)(f.Z,{className:"title",display:"flex",alignItems:"center",children:[Ne()(n.title),(0,te.jsxs)("div",{className:"status-icons",children:[o,n.revoked&&(0,te.jsx)(we.Z,{})]})]}),n.expirationDate&&(0,te.jsx)(f.Z,{className:"title",display:"flex",alignItems:"center",children:c("team.passport.validUntil",{date:n.expirationDate})}),r]})]})}_e.propTypes={passport:d().any.isRequired,user:d().any.isRequired,color:d().string.isRequired,createPassportSvg:d().func.isRequired,icon:d().any,children:d().any,width:d().number},_e.defaultProps={icon:null,children:null,width:150};const Ae=(0,r.Z)(f.Z)(Ee||(Ee=(0,i.Z)(["\n .body {\n padding: 0;\n margin-left: 24px;\n margin-top: 0;\n }\n .title {\n font-weight: 400;\n font-size: 16px;\n line-height: 19px;\n color: #222222;\n }\n .tip {\n display: flex;\n align-items: center;\n font-size: 14px;\n margin-top: 6px;\n color: #bbb;\n }\n .status-icons {\n svg {\n fill: #bfbfbf;\n height: 1.2em;\n margin-left: 0.4em;\n }\n }\n"])));var Oe;function Le(e){let{action:n,passport:t}=e;const{t:s}=(0,k.PE)(),{roles:i}=(0,q.DJ)(),o=i.find((e=>e.name===t.role));return(0,te.jsxs)("div",{children:[(0,te.jsx)("div",{children:s("enable"===n?"team.member.enablePassportDescription":"team.member.revokePassportDescription")}),o&&(0,te.jsx)(f.Z,{mt:3,fontWeight:"bold",children:s("team.member.passportPermissionTitle")}),o&&(0,te.jsx)(f.Z,{mt:1,children:o.description})]})}function ze(e){var n;let{user:t,onCreate:s,createPassportSvg:i}=e;const{t:r}=(0,k.PE)(),{session:a}=(0,de.T)(),{roles:l,teamDid:c,teamIssuerDid:d,refresh:m,enablePassportIssuance:u,trustedPassports:h,passportColor:g,blocklet:x}=(0,q.DJ)(),{appIdList:v}=(0,K.y0)(),{api:y,inService:b}=(0,W.h6)(),[Z,S]=(0,o.useState)(!1),[R,T]=(0,o.useState)(null),[C,D]=(0,o.useState)(!1),[E,_]=(0,o.useState)(""),A=[d,...v||[]].filter(Boolean),O=(le()(t,"passports")||[]).map((e=>({...e,revoked:e.status===N.PASSPORT_STATUS.REVOKED}))),L=async e=>{if(!Z){S(!0);try{const n=e.status===N.PASSPORT_STATUS.REVOKED?"enableUserPassport":"revokeUserPassport";await y[n]({input:{teamDid:c,userDid:t.did,passportId:e.id}}),m()}catch(n){I.Z.error((0,M.Z)(n))}finally{S(!1),T(null)}}},z=(e,n)=>t.did===a.user.did&&a.user.passportId&&a.user.passportId===n.id?{revokable:!1,message:r("team.passport.shouldNotDeleteCurrent")}:e?c===n.issuer.id&&"owner"===n.name?{revokable:!1,message:r("team.passport.noPermission")}:{revokable:!0}:{revokable:!1,message:r("team.passport.noPermission")},B=O.filter((e=>!E||e.title.includes(E)||e.name.includes(E)));return(0,te.jsxs)(Be,{children:[(0,te.jsxs)(Ce.Z,{children:[(0,te.jsx)("div",{className:"left",children:(0,te.jsx)(Pe.Z,{placeholder:r("team.passport.search"),value:E,onChange:e=>_(e.target.value)})}),(0,te.jsx)("div",{className:"right",children:u&&!!t.approved&&(0,te.jsx)(F.Z,{permission:b?"":"mutate_team",role:b?M.Wf:[],children:(0,te.jsxs)(w.Z,{variant:"contained",color:"primary","data-cy":"issue-passport",onClick:()=>D(!0),children:[(0,te.jsx)(j.Z,{style:{fontSize:16,marginRight:4}}),r("team.passport.issue")]})})})]}),(0,te.jsxs)(f.Z,{children:[B.map((e=>(0,te.jsx)(F.Z,{permission:b?"":"mutate_team",role:b?M.Wf:[],children:n=>(0,te.jsxs)(f.Z,{className:"passport-item",display:"flex",justifyContent:"space-between",alignItems:"center",mt:3,children:[(0,te.jsx)(_e,{passport:e,user:t,color:g,createPassportSvg:i,icon:A.length&&!A.includes(e.issuer.id)?(0,te.jsx)(P.Z,{}):null,children:!!A.length&&!A.includes(e.issuer.id)&&(0,te.jsxs)("div",{className:"tip",children:[e.issuer.id!==d&&!h.some((n=>n.issuerDid===e.issuer.id))&&(0,te.jsx)(p.Z,{title:r("team.passport.notTrustedIssuerTip"),children:(0,te.jsx)(f.Z,{component:Re.Z,style:{fontSize:"1.3em"},color:"error.main",mr:.5})}),(0,te.jsx)("span",{children:r("team.passport.issueBy",{name:e.issuer.name})})]})}),(0,te.jsx)(f.Z,{children:z(n,e).revokable?(0,te.jsxs)(w.Z,{variant:"outlined",color:e.revoked?"primary":"secondary",onClick:()=>{return(n=e).status===N.PASSPORT_STATUS.REVOKED?T({title:r("team.member.enablePassport"),description:(0,te.jsx)(Le,{action:"enable",passport:n}),confirm:r("common.enable"),cancel:r("common.cancel"),onConfirm:()=>{L(n)},onCancel:()=>{S(!1),T(null)},color:"primary"}):T({title:r("team.member.revokePassport"),description:(0,te.jsx)(Le,{action:"revoke",passport:n}),confirm:r("common.revoke"),cancel:r("common.cancel"),onConfirm:()=>{L(n)},onCancel:()=>{S(!1),T(null)}});var n},children:[e.revoked?(0,te.jsx)(j.Z,{style:{fontSize:16,marginRight:4}}):(0,te.jsx)(we.Z,{style:{height:16,marginRight:4}}),e.revoked?r("common.enable"):r("common.revoke")]}):(0,te.jsx)(p.Z,{title:z(n,e).message,children:(0,te.jsx)(Re.Z,{style:{color:"#ddd"}})})})]})},e.id))),!B.length&&(0,te.jsx)(Te.Z,{children:r("common.empty")})]}),C&&(0,te.jsx)(De,{teamDid:c,ownerDid:t.did,needReceive:(0,ke.h1)(t)===t.did,roles:l,onCancel:()=>D(!1),onSuccess:()=>{s(),D(!1)},showOwnerPassport:x&&!(null!==(n=x.settings)&&void 0!==n&&n.owner)}),R&&(0,te.jsx)(be.Z,{title:R.title,description:R.description,confirm:R.confirm,cancel:R.cancel,params:R.params,onConfirm:R.onConfirm,onCancel:R.onCancel,color:R.color})]})}Le.propTypes={action:d().string.isRequired,passport:d().object.isRequired},Le.defaultProps={},ze.propTypes={user:d().object.isRequired,createPassportSvg:d().func.isRequired,onCreate:d().func},ze.defaultProps={onCreate:()=>{}};const Be=r.Z.div(Oe||(Oe=(0,i.Z)(["\n .passport-item {\n .MuiButton-outlinedSecondary {\n color: #f16e6e;\n fill: #f16e6e;\n background: #fcf3f3;\n border: 0;\n &:hover {\n border: 0;\n }\n }\n }\n"])));var Ue=t(15098);const We=(e,n)=>e.nodeOwner&&e.nodeOwner.did===n,qe=(e,n)=>e&&e.did===n;function Ke(e){let{user:n,onCancel:t,onSuccess:s,onError:i,children:r}=e;const{api:a,info:l,inService:c}=(0,W.h6)(),{session:d}=(0,de.T)(),{teamDid:m,refresh:u}=(0,q.DJ)(),{t:p}=(0,k.PE)(),[f,h]=(0,o.useState)(!1),[g,x]=(0,o.useState)(!1),v={title:n.approved?p("team.member.forbidLogin"):p("team.member.allowLogin"),description:n.approved?p("team.member.forbidLoginDescription"):p("team.member.allowLoginDescription"),confirm:p("common.confirm"),cancel:p("common.cancel"),onConfirm:()=>{(async e=>{const{did:n,approved:t}=e;if(!f){h(!0);try{await a.updateUserApproval({input:{teamDid:m,user:{did:n,approved:!t}}}),x(!1),s(),u()}catch(o){I.Z.error((0,M.Z)(o)),i()}finally{h(!1)}}})(n)},onCancel:()=>{h(!1),x(!1),t()},color:n.approved?"error":"primary"};let y;return y=!(0,Ue.hasActiveOwnerPassport)(n)&&((c||l.nodeOwner&&!We(l,n.did))&&!qe(d.user,n.did)),y?(0,te.jsxs)(te.Fragment,{children:["function"===typeof r?r({can:y,open:()=>x(!0)}):r,g?(0,te.jsx)(be.Z,{title:v.title,description:v.description,confirm:v.confirm,cancel:v.cancel,params:v.params,onConfirm:v.onConfirm,onCancel:v.onCancel,color:v.color}):null]}):null}Ke.propTypes={user:d().object,onSuccess:d().func,onCancel:d().func,onError:d().func,children:d().oneOfType([d().object,d().func])},Ke.defaultProps={user:{},onSuccess:()=>{},onCancel:()=>{},onError:()=>{},children:null};var Fe,Me,Ve,He=t(6352),Ye=t.n(He);function Ge(e,n,t){if(e&&e.startsWith(N.USER_AVATAR_URL_PREFIX)){const s=window.env.apiPrefix||"/";return t?Ye()(s,N.USER_AVATAR_PATH_PREFIX,e.replace(N.USER_AVATAR_URL_PREFIX,"")):Ye()(s,N.USER_AVATAR_PATH_PREFIX,n,e.replace(N.USER_AVATAR_URL_PREFIX,""))}return e}function Je(e){let{user:n}=e;return(n.connectedAccounts||[]).map((e=>(0,te.jsx)(ge.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:e.provider,children:(0,te.jsx)(U.Z,{did:e.did,showQrcode:!0})},e.did)))}Je.propTypes={user:d().object.isRequired},Je.defaultProps={},d().string.isRequired;const Xe="info";function Qe(e){let{userDid:n,onCancel:t,initTab:s,createPassportSvg:i}=e;const{api:r,ws:{useSubscription:a},inService:l}=(0,W.h6)(),{roles:c,teamDid:d,enablePassportIssuance:m}=(0,q.DJ)(),{t:u,locale:p}=(0,k.PE)(),h=(0,ye.Z)({user:null,issuances:null,tab:s||Xe}),g=async(e,n)=>{try{const t=await r.doBatchQuery({getUser:{input:{teamDid:e,user:{did:n},options:{includeTags:!0}}},getPassportIssuances:{input:{teamDid:e,ownerDid:n}}});t.getUser.user&&(t.getUser.user.avatar=Ge(t.getUser.user.avatar,e,l),t.getUser.user.passports=(t.getUser.user.passports||[]).filter((e=>e.issuer))),h.user=t.getUser.user||{},h.issuances=t.getPassportIssuances.list||[]}catch(t){I.Z.error((0,M.Z)(t))}};(0,o.useEffect)((()=>{d&&g(d,n)}),[n,d]);a(_.TeamEvents.userUpdated,(e=>{e.teamDid===d&&e.user&&e.user.did===n&&g(d,n)}),[n,d]),(0,o.useEffect)((()=>{h.issuances&&!h.issuances.length&&"issuances"===h.tab&&(h.tab=Xe)}),[h.issuances]);const x=async e=>{await g(d,e.did),h.tab=Xe},v={info:{label:u("common.basicInfo"),value:Xe,component:()=>{var e,n;return(h.user?[{name:u("team.member.name"),value:h.user.fullName},{name:u("common.email"),value:h.user.email},{name:u("team.member.source"),value:(0,te.jsx)(f.Z,{display:"flex",alignItems:"center",children:_.PROVIDER_NAME[(null===(e=h.user)||void 0===e?void 0:e.sourceProvider)||N.USER_TYPE.WALLET]||(null===(n=h.user)||void 0===n?void 0:n.sourceProvider)})},{name:u("team.member.allowLogin"),value:h.user.approved?u("common.yes"):u("common.no")},{name:u("team.member.lastLogin"),value:(0,M.B2)(h.user.lastLoginAt,p)},{name:u("team.member.lastLoginIp"),value:h.user.lastLoginIp||""},{name:u("common.createdAt"),value:(0,M.B2)(h.user.createdAt,p)},{name:u("common.remark"),value:h.user.remark||"--"},Array.isArray(h.user.tags)&&h.user.tags.length>0?{name:u("common.tags"),value:h.user.tags.map((e=>(0,te.jsx)(B.Z,{style:{background:e.color,color:(0,C.getTextColor)(e.color),marginRight:4},children:e.title},e.id)))}:null].filter(Boolean):[]).map((e=>e.name===u("common.did")?(0,te.jsx)(ge.Z,{valueComponent:"div",nameWidth:120,name:e.name,nameFormatter:()=>u("common.did"),children:e.value},e.name):(0,te.jsx)(ge.Z,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:e.name,children:e.value},e.name)))}},oauth:{label:u("team.member.connectedAccounts"),value:"oauth",component:()=>(0,te.jsx)(Je,{user:h.user,onChangeUser:x})},passports:{label:u("common.passport"),value:"passports",component:()=>(0,te.jsx)(ze,{user:h.user,teamDid:d,roles:c,createPassportSvg:i,onCreate:()=>{g(d,n).then((()=>{m&&h.issuances&&h.issuances.length&&(h.tab="issuances")}))},onRefresh:()=>{g(d,n)}})},issuances:{label:u("team.passport.issuance.pending"),value:"issuances",component:()=>(0,te.jsx)(Ze,{issuances:h.issuances||[],teamDid:d,onRefresh:()=>g(d,n)})}},y=Object.values(v).map((e=>{let{label:n,value:t}=e;return{label:n,value:t}})).filter((e=>{if("issuances"===e.value)return m&&h.issuances&&!!h.issuances.length;if("oauth"===e.value){var n;return((null===(n=h.user)||void 0===n?void 0:n.connectedAccounts)||[]).find((e=>{var n;return e.provider!==((null===(n=h.user)||void 0===n?void 0:n.sourceProvider)||_.LOGIN_PROVIDER.WALLET)}))}return!0})),j=v[h.tab]||v.info;return(0,te.jsx)(b.ZP,{title:u("common.member"),onClose:t,open:!0,PaperProps:{style:{maxWidth:632,minHeight:"80vh"}},fullWidth:!0,actions:h.user&&(0,te.jsx)(F.Z,{permission:l?"":"mutate_team",role:l?M.Wf:[],children:(0,te.jsx)(Ke,{user:h.user,children:e=>{let{open:n}=e;return(0,te.jsxs)(nn,{onClick:n,children:[h.user.approved?(0,te.jsx)(xe.Z,{style:{fontSize:"1.2em",marginRight:"0.4em"}}):(0,te.jsx)(ve.Z,{style:{fontSize:"1.2em",marginRight:"0.4em"}}),h.user.approved?u("team.member.forbidLogin"):u("team.member.allowLogin")]})}})}),children:(0,te.jsxs)($e,{children:[!h.user&&(0,te.jsx)(en,{children:(0,te.jsx)(V.Z,{})}),h.user&&(0,te.jsxs)("div",{children:[(0,te.jsxs)(f.Z,{display:"flex",alignItems:"center",className:"info",children:[(0,te.jsx)(fe.Z,{src:h.user.avatar,style:{width:48,height:48,backgroundColor:"transparent",marginRight:16}}),(0,te.jsxs)(f.Z,{children:[(0,te.jsx)(f.Z,{className:"name",children:h.user.fullName}),(0,te.jsx)(f.Z,{className:"did",mt:1,children:(0,te.jsx)(U.Z,{did:h.user.did,showQrcode:!0})})]})]}),(0,te.jsx)(f.Z,{mx:3,className:"tabs",children:(0,te.jsx)(he.Z,{tabs:y,current:h.tab,onChange:e=>{h.tab=e},scrollButtons:"auto"})}),(0,te.jsx)("div",{className:"body",children:(0,te.jsx)(j.component,{})})]})]})})}Qe.propTypes={userDid:d().string.isRequired,onCancel:d().func.isRequired,createPassportSvg:d().func.isRequired,initTab:d().string},Qe.defaultProps={initTab:Xe};const $e=r.Z.div(Fe||(Fe=(0,i.Z)(["\n .info {\n .name {\n font-weight: 400;\n font-size: 18px;\n line-height: 25px;\n color: #222222;\n }\n }\n\n .tabs {\n margin-top: 24px;\n margin-left: 0;\n margin-right: 0;\n }\n\n .body {\n margin-top: 24px;\n }\n"]))),en=r.Z.div(Me||(Me=(0,i.Z)(["\n flex: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 200px;\n"]))),nn=r.Z.div(Ve||(Ve=(0,i.Z)(["\n flex-shrink: 0;\n width: 100%;\n height: 64px;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n color: #999;\n fill: #999;\n font-size: 16px;\n border-top: 1px solid #f0f0f0;\n position: sticky;\n bottom: 0;\n background: #fff;\n z-index: 10;\n"])));var tn,sn=t(27773);function on(){const{api:e,inService:n}=(0,W.h6)(),{t:t,locale:s}=(0,o.useContext)(k.RD),{teamDid:i,invitations:r,refresh:a,endpoint:l}=(0,q.DJ)(),[c,d]=(0,o.useState)(null),[m,u]=(0,o.useState)(!1),p=()=>{u(!1),d(null)},f=e=>l?(0,M.ly)({inviteId:e.inviteId,endpoint:l}):"",h=[{label:t("team.inviting.link"),name:"inviteId",options:{sort:!1,customBodyRenderLite:e=>{const n=r[e];return l?(0,te.jsx)(ne.Z,{children:f(n)}):(0,te.jsx)(V.Z,{size:16})}}},{label:t("common.role"),name:"role",widtn:70},{label:t("common.remark"),name:"remark",options:{customBodyRender:e=>e||"--"}},{label:t("team.inviting.inviter"),name:"inviter.fullName",options:{sort:!1,customBodyRender:(e,n)=>{var t;let{rowIndex:s}=n;const i=r[s];return null===i||void 0===i||null===(t=i.inviter)||void 0===t?void 0:t.fullName}}},{label:t("common.expires"),name:"expireDate",options:{customBodyRender:e=>(0,te.jsx)(E.Z,{value:e,locale:s})}},{label:t("common.actions"),name:"",width:100,align:"center",options:{sort:!1,customBodyRenderLite:s=>{const o=r[s];return(0,te.jsx)(F.Z,{permission:n?"":"mutate_team",role:n?M.Wf:[],children:(0,te.jsxs)(w.Z,{onClick:()=>d({title:t("team.inviting.delete.title"),description:t("team.inviting.delete.description",{link:f(o)}),confirm:t("common.delConfirm"),cancel:t("common.cancel"),onConfirm:()=>(async n=>{let{inviteId:t}=n;if(!m){u(!0);try{await e.deleteInvitation({input:{teamDid:i,inviteId:t}}),a(),await(0,M._v)(800)}catch(s){console.error(s)}finally{u(!1),d(null)}}})(o),onCancel:p}),size:"small",color:"error",variant:"text",children:[(0,te.jsx)(sn.default,{style:{fontSize:"1.2em"}}),t("common.delete")]})})}}}];return(0,te.jsxs)(rn,{children:[r.length?(0,te.jsx)(D.Z,{locale:s,data:[...r],columns:h,verticalKeyWidth:100,options:{download:!1,filter:!1,print:!1}}):(0,te.jsx)(Te.Z,{children:t("common.empty")}),c&&(0,te.jsx)(be.Z,{title:c.title,description:c.description,confirm:c.confirm,cancel:c.cancel,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel})]})}const rn=r.Z.div(tn||(tn=(0,i.Z)(["\n margin-top: -20px;\n"])));on.propTypes={},on.defaultProps={};var an,ln=t(53047),cn=t(46954),dn=t(44067),mn=t(36299),un=t(92726);function pn(e){let{type:n,user:t,onIssuePassport:s,onRefresh:i}=e;const{teamDid:r,roles:a}=(0,q.DJ)(),{confirmHolder:l,confirmApi:c}=(0,b.N4)(),{t:d}=(0,o.useContext)(k.RD),[m,u]=(0,o.useState)(!1),{api:p}=(0,W.h6)(),f=(0,L.Z)((async()=>{const{userSessions:e=[]}=t,n=e.map((e=>()=>p.logoutUser({input:{teamDid:r,appPid:r,userDid:t.did,visitorId:e.visitorId}})));await(0,mn.Z)(n,{concurrency:3,stopOnError:!1})}));return(0,te.jsxs)(te.Fragment,{children:[l,(0,te.jsx)(un.Z,{"data-cy":"member-actions",actions:[{icon:(0,te.jsx)(j.Z,{fontSize:"small"}),text:d("team.passport.issue"),"data-cy":"action-issue-passport",onClick:e=>{e.stopPropagation(),u(!0)}},e=>{let{close:n}=e;return(0,te.jsx)(Ke,{user:t,children:e=>{let{open:s}=e;return(0,te.jsxs)(G.Z,{dense:!0,onClick:e=>{e.stopPropagation(),n(),s(e)},"data-cy":"action-toggle-block",children:[(0,te.jsx)(cn.Z,{style:{minWidth:24,marginRight:8},children:t.approved?(0,te.jsx)(xe.Z,{}):(0,te.jsx)(ve.Z,{})}),(0,te.jsx)(dn.Z,{primary:t.approved?d("team.member.forbidLogin"):d("team.member.allowLogin")})]})}},"toggle-approval")},"blocklet"===n&&{icon:(0,te.jsx)(ln.Z,{fontSize:"small"}),text:d("team.member.forceLogout"),onClick:e=>{e.stopPropagation(),c.open({title:d("team.member.forceLogout"),content:d("team.member.forceLogoutDescription"),confirmButtonText:d("common.confirm"),cancelButtonText:d("common.cancel"),onClick:e=>e.stopPropagation(),onConfirm:async()=>{await f(),await c.close(),i()}})}}].filter(Boolean)}),m&&(0,te.jsx)(De,{teamDid:r,ownerDid:t.did,needReceive:(0,ke.h1)(t)===t.did,roles:a,onCancel:()=>u(!1),onSuccess:()=>{s(),u(!1)}})]})}pn.propTypes={type:d().oneOf(["server","blocklet"]).isRequired,user:d().object.isRequired,onIssuePassport:d().func,onRefresh:d().func},pn.defaultProps={onIssuePassport:()=>{},onRefresh:()=>{}};const fn="$all",hn="$none",gn=(e,n)=>{const t=e.find((e=>e.key===n));return(null===t||void 0===t?void 0:t.value)||0},xn=(e,n)=>{const t=e.passports||[];return!!t.length&&!t.some((e=>{var t;return n.includes(null===(t=e.issuer)||void 0===t?void 0:t.id)}))};function vn(e){let{user:n}=e;const{t:t}=(0,o.useContext)(k.RD),s=(0,te.jsxs)("div",{className:"member-block",children:[(0,te.jsxs)("div",{className:"member-avatar",children:[(0,te.jsx)(R.Z,{src:"".concat(n.avatar,"?imageFilter=resize&w=48&h=48"),size:32,did:n.did,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),!n.approved&&(0,te.jsx)("did",{className:"badge-block"}),n.isFromExternal&&(0,te.jsx)(p.Z,{title:t("team.passport.externalPassport"),children:(0,te.jsx)(f.Z,{ml:1,className:"icon",children:(0,te.jsx)(P.Z,{})})})]}),(0,te.jsxs)("div",{className:"member-meta",children:[(0,te.jsx)("div",{className:"member-text",children:n.fullName}),Array.isArray(n.tags)&&n.tags.length>0&&(0,te.jsx)("div",{className:"member-tags",children:n.tags.map((e=>(0,te.jsx)(B.Z,{style:{background:e.color,color:(0,C.getTextColor)(e.color),marginRight:4},children:e.title},e.id)))})]})]});return n.approved?s:(0,te.jsx)(f.Z,{display:"flex",alignItems:"center",children:(0,te.jsx)(p.Z,{title:t("team.member.forbidLoginDescription"),children:s})})}function yn(e){let{type:n,createPassportSvg:t}=e;const{confirmApi:s,confirmHolder:i}=(0,b.N4)({sx:{".MuiDialog-paper":{borderRadius:2,maxWidth:1e3},".ux-dialog_title":{fontWeight:600},".ux-dialog_closeButton":{p:1},".MuiDialogActions-root":{display:{xs:"none",md:"flex"}}}}),{appIdList:r=[]}=(0,K.y0)(),a=(0,h.Z)((e=>e.breakpoints.down("md"))),{teamDid:c,invitations:d,teamIssuerDid:m,roles:p,refresh:R,enablePassportIssuance:P,endpoint:C,api:B}=(0,q.DJ)(),{inService:V,ws:{useSubscription:H}}=(0,W.h6)(),{t:Y,locale:G}=(0,o.useContext)(k.RD),[J,X]=(0,o.useState)(!1),[Q,$]=(0,o.useState)(!1),[ee,ne]=(0,o.useState)(!1),[ie,oe]=(0,o.useState)(!1),[re,ae]=(0,o.useState)(!1),[le,ce]=(0,o.useState)([]),[de,ue]=(0,o.useState)(),[pe,fe]=(0,o.useState)([]),[he]=(0,A.Z)({did:void 0}),ge="members-".concat(c),xe=(0,D.$)(ge),[ve,ye]=(0,o.useState)({role:fn,searchText:xe.searchText||"",hideBlocked:!1,pageSize:xe.rowsPerPage||10,page:xe.page?xe.page+1:1});(0,O.Z)((async()=>{if(he.did){const{user:e}=await B.getUser({did:he.did});e&&oe(e)}}));const be=(p||[]).map((e=>({name:e.name,title:e.title,num:gn(pe,e.name)})));be.unshift({name:fn,title:"All Members",num:gn(pe,fn)}),be.push({name:hn,title:"Other",num:gn(pe,hn)});const je=()=>{const e={includeTags:!0,includeUserSessions:"blocklet"===n};ve.hideBlocked&&(e.approved=!0),e.role=ve.role,ve.searchText&&(e.search=ve.searchText),ae(!0),B.getUsers({query:e,paging:{page:ve.page,pageSize:ve.pageSize}}).then((e=>{ae(!1),(e.users||[]).forEach((e=>{e.isFromExternal=xn(e,l()(r)?[m]:r),e.avatar=Ge(e.avatar,c,V),e.passports=(e.passports||[]).filter((e=>e.issuer))})),ce(e.users||[]),ue(e.paging.total)})).catch((e=>{ae(!1),I.Z.error(e.message)}))},Ze=()=>{B.getUsersCountPerRole().then((e=>{fe(e.counts||[])})).catch((e=>{I.Z.error(e.message)}))},Se=e=>{e.teamDid===c&&(je(),Ze())};(0,o.useEffect)((()=>{je()}),["".concat(ve.hideBlocked,"-").concat(ve.role,"-").concat(ve.page,"-").concat(ve.pageSize,"-").concat(ve.searchText)]),(0,o.useEffect)((()=>{Ze()}),[]),H(_.TeamEvents.userUpdated,Se,[ve]),H(_.TeamEvents.userAdded,Se,[ve]);const Re=P,ke=(0,L.Z)((e=>{s.open({title:"User Sessions",content:(0,te.jsx)(z.YZ,{user:e,showAction:!1,showUser:!1}),onConfirm(){s.close()},confirmButtonText:Y("common.close"),showCancelButton:!1})})),we=[{label:Y("common.name"),name:"fullName",options:{customBodyRenderLite:e=>{const n=le[e];return(0,te.jsx)("div",{"data-cy":"member-name-".concat(n.fullName),children:(0,te.jsx)(vn,{user:n})},n.did)}}},{label:Y("common.address"),name:"did",options:{customBodyRender:e=>(0,te.jsx)(U.Z,{size:14,responsive:!a,compact:a,copyable:!1,did:e})}},{label:Y("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:e=>(0,te.jsx)(f.Z,{sx:{minWidth:"100px"},children:(0,te.jsx)(E.Z,{value:e,locale:G})})}},{label:Y("team.member.lastLoginIp"),name:"lastLoginIp",options:{customBodyRender:e=>e||"-"}},{label:Y("team.member.source"),name:"sourceProvider",options:{customBodyRenderLite:e=>{const n=le[e],t=n.sourceProvider||N.USER_TYPE.WALLET,s=_.PROVIDER_NAME[t]||t;return n.sourceAppPid?"".concat(s," (").concat(Y("team.member.federated"),")"):s}}},"blocklet"===n&&{label:Y("team.member.activeUserSessions"),name:"userSessions",options:{customBodyRenderLite:e=>{var n,t,s;const i=le[e];return(0,te.jsx)(g.Z,{onClick:e=>{e.stopPropagation(),ke(i)},children:(0,te.jsx)(x.Z,{badgeContent:null===i||void 0===i||null===(n=i.userSessions)||void 0===n?void 0:n.length,color:(null===i||void 0===i||null===(t=i.userSessions)||void 0===t?void 0:t.length)>0?"primary":"default",sx:(null===i||void 0===i||null===(s=i.userSessions)||void 0===s?void 0:s.length)>0?{}:{".MuiBadge-badge":{backgroundColor:"grey",color:"white"}},showZero:!0,children:(0,te.jsx)(S.Z,{})})})}}},{label:Y("common.actions"),name:"",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:e=>{const t=le[e];return(0,te.jsx)(F.Z,{permission:V?"":"mutate_team",role:V?M.Wf:[],children:(0,te.jsx)(pn,{type:n,user:t,onIssuePassport:()=>oe({...t,initTab:"issuances"}),onRefresh:()=>Se({teamDid:c})})})}}}].filter(Boolean),Te=[];Re&&(Te.push((0,te.jsxs)(w.Z,{variant:"outlined",style:{flexShrink:0,marginRight:16},color:"primary",size:"small",onClick:()=>{ne(!0)},children:[(0,te.jsx)(T.Z,{style:{height:"1em",marginRight:4}}),Y("common.inviting"),d.length?" (".concat(d.length,")"):""]}),(0,te.jsx)(F.Z,{permission:V?"":"mutate_team",role:V?M.Wf:[],children:(0,te.jsxs)(w.Z,{style:{flexShrink:0,marginRight:16},variant:"contained",edge:"end",color:"primary",size:"small","data-cy":"invite-member",onClick:()=>X(!0),children:[(0,te.jsx)(j.Z,{style:{fontSize:"1.3em",marginRight:4}}),Y("team.invite")]})})),"server"===n&&Te.push((0,te.jsx)(F.Z,{role:"owner",children:(0,te.jsxs)(w.Z,{style:{flexShrink:0},variant:"contained",edge:"end",color:"error",size:"small","data-cy":"invite-member",onClick:()=>$(!0),children:[(0,te.jsx)(Z.Z,{style:{fontSize:"1.3em",marginRight:4}}),Y("team.transferNode.name")]})})));const Pe=(0,o.useRef)(null),Ce={sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick(e,n,t){var s;let{dataIndex:i}=n;if(null!==(s=Pe.current)&&void 0!==s&&s.contains(t.target)){const e=le[i];oe(e)}},page:ve.page-1,rowsPerPage:ve.pageSize,count:de,searchDebounceTime:600};return(0,te.jsxs)(bn,{children:[i,(0,te.jsxs)(f.Z,{className:"main",display:"flex",sx:{mt:V?4:0},children:[(0,te.jsx)("div",{className:"left",children:(0,te.jsx)("div",{className:"tabs",children:be.map((e=>(0,te.jsxs)("div",{className:"tab ".concat(ve.role===e.name?"active":""),onClick:()=>{return n=e.name,void(re||ye((e=>({...e,role:n,hideBlocked:!1,searchText:"",page:1}))));var n},children:[(0,te.jsx)("span",{className:"text",children:e.title}),(0,te.jsx)("span",{className:u()("badge",{"is-rect":e.num>999}),children:e.num})]},e.name)))})}),(0,te.jsx)("div",{ref:Pe,className:"right",children:(0,te.jsx)(D.Z,{className:"main-table",verticalKeyWidth:100,locale:G,durable:ge,durableKeys:["page","rowsPerPage"],title:(0,te.jsx)("div",{className:"table-toolbar-left",children:(0,te.jsx)(v.Z,{control:(0,te.jsx)(y.Z,{sx:{display:"flex !important"},disabled:re,color:"primary",checked:ve.hideBlocked,onChange:e=>{return n=e.target.checked,void ye((e=>({...e,hideBlocked:n,page:1})));var n}}),label:Y("team.member.hideBlockedMember")})}),data:le,columns:we,customButtons:Te,options:Ce,loading:re,onChange:e=>{let{page:n,rowsPerPage:t,searchText:s}=e;ve.pageSize!==t?ye((e=>({...e,pageSize:t,page:1}))):ve.page!==n+1?ye((e=>({...e,page:n+1}))):ve.searchText!==s&&ye((e=>({...e,searchText:s,page:1})))}})})]}),(0,te.jsx)(b.ZP,{title:Y("common.inviting"),onClose:()=>ne(!1),open:ee,maxWidth:"lg",fullWidth:!0,children:(0,te.jsx)(on,{})}),ie&&(0,te.jsx)(Qe,{onCancel:()=>oe(null),userDid:ie.did,createPassportSvg:t,initTab:ie.initTab}),J&&(0,te.jsx)(se,{teamDid:c,endpoint:C,roles:p,onCancel:()=>X(!1),onSuccess:()=>{R(),X(!1)}}),Q&&(0,te.jsx)(me,{teamDid:c,endpoint:C,roles:p,onCancel:()=>$(!1),onSuccess:()=>{R(),$(!1)}})]})}vn.propTypes={user:d().object.isRequired};const bn=r.Z.div(an||(an=(0,i.Z)(["\n .main {\n .left {\n width: 168px;\n flex-shrink: 0;\n margin-right: 65px;\n .tabs {\n padding-top: 16px;\n .tab {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 16px;\n transition: background 0.4s;\n\n width: 168px;\n height: 36px;\n border-radius: 8px;\n\n cursor: pointer;\n user-select: none;\n\n &:nth-child(n + 2) {\n margin-top: 24px;\n }\n\n &.active {\n background: #f2f2f2;\n }\n\n &:hover {\n background: #f2f2f2;\n }\n\n .text {\n font-weight: 400;\n font-size: 16px;\n line-height: 19px;\n\n color: #222222;\n }\n\n .badge {\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n align-items: center;\n width: 20px;\n height: 20px;\n border-radius: 100%;\n color: #fff;\n background: #666666;\n font-size: 10px;\n font-weight: 400;\n &.is-rect {\n width: auto;\n border-radius: 8px;\n padding: 0 4px;\n }\n }\n }\n }\n @media (max-width: ","px) {\n display: none;\n }\n }\n .right {\n flex: 1;\n overflow: auto;\n }\n }\n\n .member-block {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n .member-avatar {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .member-meta {\n margin-left: 10px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n }\n .badge-block {\n width: 14px;\n height: 14px;\n position: absolute;\n right: -4px;\n top: -4px;\n background: #ff5757;\n border-radius: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n &::after {\n content: '';\n width: 6px;\n height: 2px;\n background: #fefefe;\n }\n }\n }\n\n .table-toolbar-left {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 7px 0;\n }\n"])),(e=>e.theme.breakpoints.values.md));yn.propTypes={type:d().oneOf(["server","blocklet"]).isRequired,createPassportSvg:d().func.isRequired}},82638:(e,n,t)=>{"use strict";t.d(n,{Z:()=>c});var s,i=t(71171),o=t(33518),r=t(47020),a=t(57201),l=t(96266);const c=(0,o.Z)((e=>{let{children:n,...t}=e;return(0,l.jsx)(r.Z,{...t,id:"outlined-basic",variant:"outlined",InputProps:{startAdornment:(0,l.jsx)(a.default,{})},size:"small",children:n})}))(s||(s=(0,i.Z)(["\n .MuiOutlinedInput-root {\n color: #999;\n &.MuiInputBase-adornedStart .MuiSvgIcon-root {\n color: #bfbfbf;\n }\n opacity: 1;\n border-radius: 36px;\n background: #f8f8f8;\n padding-left: 16px;\n input {\n padding-left: 8px;\n font-weight: bold;\n &::placeholder {\n opacity: 1;\n color: #bfbfbf;\n }\n padding-top: 8.5px;\n padding-bottom: 8.5px;\n }\n }\n\n .MuiOutlinedInput-notchedOutline,\n .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline,\n .Mui-focused .MuiOutlinedInput-notchedOutline {\n border-color: #eee;\n border-width: 1px;\n }\n"])))},18901:(e,n,t)=>{"use strict";t.d(n,{Z:()=>o});var s,i=t(71171);const o=t(33518).Z.div(s||(s=(0,i.Z)(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 14px;\n .left,\n .right {\n }\n .right {\n display: flex;\n align-items: center;\n }\n .tabs {\n .MuiButton-root {\n border: none;\n color: #999;\n &.active {\n color: #222;\n }\n }\n }\n\n @media (max-width: 600px) {\n display: block;\n .right {\n margin-top: 12px;\n }\n }\n"])))},99132:(e,n,t)=>{"use strict";t.d(n,{xb:()=>S});var s=t(35432),i=t(2842),o=t(81534),r=t(10458),a=Object.defineProperty,l=(e,n,t)=>(((e,n,t)=>{n in e?a(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t})(e,"symbol"!==typeof n?n+"":n,t),t);class c{constructor(e){let{api:n}=e;l(this,"api"),this.api=n}async getUserPublicInfo(e){let{did:n}=e;const{data:t}=await this.api.get("/api/user",{params:{did:n}});return t}async getUserPrivacyConfig(e){let{did:n}=e;const{data:t}=await this.api.get("/api/user/privacy/config",{params:{did:n}});return t}async saveUserPrivacyConfig(e){const{data:n}=await this.api.post("/api/user/privacy/config",e);return n}async getUserNotificationConfig(){const{data:e}=await this.api.get("/api/user/notification/config");return e}async saveUserNotificationConfig(e){const{data:n}=await this.api.post("/api/user/notification/config",e);return n}async testNotificationWebhook(e){const{data:n}=await this.api.put("/api/user/notification/webhook",e);return n}async getProfileUrl(e){let{did:n,locale:t}=e;const o="".concat(s.WELLKNOWN_SERVICE_PATH_PREFIX,"/user");return(0,i.jb)(o,{did:n,locale:t})}async logout(e){let{visitorId:n}=e;const{data:t}=await this.api.post("/api/user/logout",{visitorId:n});return t}}class d{getSessionToken(){return o.Z.get(s.SESSION_TOKEN_STORAGE_KEY)}setSessionToken(e){o.Z.set(s.SESSION_TOKEN_STORAGE_KEY,e)}removeSessionToken(){o.Z.remove(s.SESSION_TOKEN_STORAGE_KEY)}getRefreshToken(){return localStorage.getItem(s.REFRESH_TOKEN_STORAGE_KEY)}setRefreshToken(e){localStorage.setItem(s.REFRESH_TOKEN_STORAGE_KEY,e)}removeRefreshToken(){localStorage.removeItem(s.REFRESH_TOKEN_STORAGE_KEY)}}var m=Object.defineProperty,u=(e,n,t)=>(((e,n,t)=>{n in e?m(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t})(e,"symbol"!==typeof n?n+"":n,t),t);class p{constructor(e){let{api:n}=e;u(this,"api"),this.api=n}async getUserSessions(e){let{did:n}=e;const{data:t}=await this.api.get("/api/user-session",{params:{userDid:n}});return t}}const f="1.16.26",h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((n=>{setTimeout((()=>{n()}),e)}))},g=e=>"Bearer ".concat(encodeURIComponent(e)),x=()=>localStorage.getItem("__visitor_id");async function v(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;e.metaData.endTime=+new Date;const{startTime:t,endTime:s}=e.metaData,i=s-t;i<n&&await h(n-i),delete e.metaData}const y=(e,n)=>{const t={...null===e||void 0===e?void 0:e.headers,"x-blocklet-js-sdk-version":f},s=x();[void 0,null].includes(s)||(t["x-blocklet-visitor-id"]=s);const i=r.create({...e,headers:t});return null!==n&&void 0!==n&&n.lazy&&(i.interceptors.request.use((e=>(e.metaData={startTime:+new Date},e)),(e=>Promise.reject(e))),i.interceptors.response.use((async e=>(await v(e.config,null===n||void 0===n?void 0:n.lazyTime),e)),(async e=>(await v(e.response.config,null===n||void 0===n?void 0:n.lazyTime),Promise.reject(e))))),i};function b(e,n,t){let{getSessionToken:i,setSessionToken:r,removeSessionToken:a,getRefreshToken:l,setRefreshToken:c,removeRefreshToken:d,onRefreshTokenError:m,onRefreshTokenSuccess:u}=e,p=null;const f=y({timeout:3e4,...n},t);return f.interceptors.request.use((async e=>{if(!o.Z.get(s.SESSION_TOKEN_STORAGE_KEY)){const n=i();n&&(e.headers.authorization=g(n))}return p&&await p,e}),(e=>Promise.reject(e))),f.interceptors.response.use((e=>e),(async e=>{var n;const t=e.config;if(t.headers={...null===t||void 0===t?void 0:t.headers},401===(null===e||void 0===e||null===(n=e.response)||void 0===n?void 0:n.status)&&!t._retry){t._retry=!0;try{p||(p=async function(e){if(!e)throw new Error("Refresh token not found");const n=y({baseURL:s.WELLKNOWN_SERVICE_PATH_PREFIX,timeout:1e4,headers:{authorization:g(e)}}),{data:t}=await n.post("/api/did/refreshSession");return t}(l()));const e=await p;return r(e.nextToken),c(e.nextRefreshToken),"function"===typeof u&&u(e),f(t)}catch(i){return a(),d(),"function"===typeof m&&m(i),Promise.reject(e)}finally{p=null}}return Promise.reject(e)})),f}var j=Object.defineProperty,Z=(e,n,t)=>(((e,n,t)=>{n in e?j(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t})(e,"symbol"!==typeof n?n+"":n,t),t);class S{constructor(){Z(this,"api"),Z(this,"user"),Z(this,"userSession"),Z(this,"token");const e=new d,n=b({getSessionToken:e.getSessionToken,setSessionToken:e.setSessionToken,removeSessionToken:e.removeSessionToken,getRefreshToken:e.getRefreshToken,setRefreshToken:e.setRefreshToken,removeRefreshToken:e.removeRefreshToken,onRefreshTokenError:()=>{console.error("Failed to refresh token")},onRefreshTokenSuccess:()=>{}},{baseURL:s.WELLKNOWN_SERVICE_PATH_PREFIX});this.user=new c({api:n}),this.userSession=new p({api:n}),this.token=e,this.api=n}}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[9132],{99132:(e,t,s)=>{s.d(t,{xb:()=>_});var o=s(35432),n=s(2842),i=s(81534),r=s(10458),a=Object.defineProperty,c=(e,t,s)=>(((e,t,s)=>{t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s})(e,"symbol"!==typeof t?t+"":t,s),s);class u{constructor(e){let{api:t}=e;c(this,"api"),this.api=t}async getUserPublicInfo(e){let{did:t}=e;const{data:s}=await this.api.get("/api/user",{params:{did:t}});return s}async getUserPrivacyConfig(e){let{did:t}=e;const{data:s}=await this.api.get("/api/user/privacy/config",{params:{did:t}});return s}async saveUserPrivacyConfig(e){const{data:t}=await this.api.post("/api/user/privacy/config",e);return t}async getUserNotificationConfig(){const{data:e}=await this.api.get("/api/user/notification/config");return e}async saveUserNotificationConfig(e){const{data:t}=await this.api.post("/api/user/notification/config",e);return t}async testNotificationWebhook(e){const{data:t}=await this.api.put("/api/user/notification/webhook",e);return t}async getProfileUrl(e){let{did:t,locale:s}=e;const i="".concat(o.WELLKNOWN_SERVICE_PATH_PREFIX,"/user");return(0,n.jb)(i,{did:t,locale:s})}async logout(e){let{visitorId:t}=e;const{data:s}=await this.api.post("/api/user/logout",{visitorId:t});return s}}class l{getSessionToken(){return i.Z.get(o.SESSION_TOKEN_STORAGE_KEY)}setSessionToken(e){i.Z.set(o.SESSION_TOKEN_STORAGE_KEY,e)}removeSessionToken(){i.Z.remove(o.SESSION_TOKEN_STORAGE_KEY)}getRefreshToken(){return localStorage.getItem(o.REFRESH_TOKEN_STORAGE_KEY)}setRefreshToken(e){localStorage.setItem(o.REFRESH_TOKEN_STORAGE_KEY,e)}removeRefreshToken(){localStorage.removeItem(o.REFRESH_TOKEN_STORAGE_KEY)}}var d=Object.defineProperty,f=(e,t,s)=>(((e,t,s)=>{t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s})(e,"symbol"!==typeof t?t+"":t,s),s);class p{constructor(e){let{api:t}=e;f(this,"api"),this.api=t}async getUserSessions(e){let{did:t}=e;const{data:s}=await this.api.get("/api/user-session",{params:{userDid:t}});return s}}const h="1.16.
|
|
1
|
+
"use strict";(self.webpackChunk_abtnode_webapp=self.webpackChunk_abtnode_webapp||[]).push([[9132],{99132:(e,t,s)=>{s.d(t,{xb:()=>_});var o=s(35432),n=s(2842),i=s(81534),r=s(10458),a=Object.defineProperty,c=(e,t,s)=>(((e,t,s)=>{t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s})(e,"symbol"!==typeof t?t+"":t,s),s);class u{constructor(e){let{api:t}=e;c(this,"api"),this.api=t}async getUserPublicInfo(e){let{did:t}=e;const{data:s}=await this.api.get("/api/user",{params:{did:t}});return s}async getUserPrivacyConfig(e){let{did:t}=e;const{data:s}=await this.api.get("/api/user/privacy/config",{params:{did:t}});return s}async saveUserPrivacyConfig(e){const{data:t}=await this.api.post("/api/user/privacy/config",e);return t}async getUserNotificationConfig(){const{data:e}=await this.api.get("/api/user/notification/config");return e}async saveUserNotificationConfig(e){const{data:t}=await this.api.post("/api/user/notification/config",e);return t}async testNotificationWebhook(e){const{data:t}=await this.api.put("/api/user/notification/webhook",e);return t}async getProfileUrl(e){let{did:t,locale:s}=e;const i="".concat(o.WELLKNOWN_SERVICE_PATH_PREFIX,"/user");return(0,n.jb)(i,{did:t,locale:s})}async logout(e){let{visitorId:t}=e;const{data:s}=await this.api.post("/api/user/logout",{visitorId:t});return s}}class l{getSessionToken(){return i.Z.get(o.SESSION_TOKEN_STORAGE_KEY)}setSessionToken(e){i.Z.set(o.SESSION_TOKEN_STORAGE_KEY,e)}removeSessionToken(){i.Z.remove(o.SESSION_TOKEN_STORAGE_KEY)}getRefreshToken(){return localStorage.getItem(o.REFRESH_TOKEN_STORAGE_KEY)}setRefreshToken(e){localStorage.setItem(o.REFRESH_TOKEN_STORAGE_KEY,e)}removeRefreshToken(){localStorage.removeItem(o.REFRESH_TOKEN_STORAGE_KEY)}}var d=Object.defineProperty,f=(e,t,s)=>(((e,t,s)=>{t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s})(e,"symbol"!==typeof t?t+"":t,s),s);class p{constructor(e){let{api:t}=e;f(this,"api"),this.api=t}async getUserSessions(e){let{did:t}=e;const{data:s}=await this.api.get("/api/user-session",{params:{userDid:t}});return s}}const h="1.16.26",T=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((t=>{setTimeout((()=>{t()}),e)}))},S=e=>"Bearer ".concat(encodeURIComponent(e)),E=()=>localStorage.getItem("__visitor_id");async function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;e.metaData.endTime=+new Date;const{startTime:s,endTime:o}=e.metaData,n=o-s;n<t&&await T(t-n),delete e.metaData}const k=(e,t)=>{const s={...null===e||void 0===e?void 0:e.headers,"x-blocklet-js-sdk-version":h},o=E();[void 0,null].includes(o)||(s["x-blocklet-visitor-id"]=o);const n=r.create({...e,headers:s});return null!==t&&void 0!==t&&t.lazy&&(n.interceptors.request.use((e=>(e.metaData={startTime:+new Date},e)),(e=>Promise.reject(e))),n.interceptors.response.use((async e=>(await g(e.config,null===t||void 0===t?void 0:t.lazyTime),e)),(async e=>(await g(e.response.config,null===t||void 0===t?void 0:t.lazyTime),Promise.reject(e))))),n};function m(e,t,s){let{getSessionToken:n,setSessionToken:r,removeSessionToken:a,getRefreshToken:c,setRefreshToken:u,removeRefreshToken:l,onRefreshTokenError:d,onRefreshTokenSuccess:f}=e,p=null;const h=k({timeout:3e4,...t},s);return h.interceptors.request.use((async e=>{if(!i.Z.get(o.SESSION_TOKEN_STORAGE_KEY)){const t=n();t&&(e.headers.authorization=S(t))}return p&&await p,e}),(e=>Promise.reject(e))),h.interceptors.response.use((e=>e),(async e=>{var t;const s=e.config;if(s.headers={...null===s||void 0===s?void 0:s.headers},401===(null===e||void 0===e||null===(t=e.response)||void 0===t?void 0:t.status)&&!s._retry){s._retry=!0;try{p||(p=async function(e){if(!e)throw new Error("Refresh token not found");const t=k({baseURL:o.WELLKNOWN_SERVICE_PATH_PREFIX,timeout:1e4,headers:{authorization:S(e)}}),{data:s}=await t.post("/api/did/refreshSession");return s}(c()));const e=await p;return r(e.nextToken),u(e.nextRefreshToken),"function"===typeof f&&f(e),h(s)}catch(n){return a(),l(),"function"===typeof d&&d(n),Promise.reject(e)}finally{p=null}}return Promise.reject(e)})),h}var v=Object.defineProperty,R=(e,t,s)=>(((e,t,s)=>{t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s})(e,"symbol"!==typeof t?t+"":t,s),s);class _{constructor(){R(this,"api"),R(this,"user"),R(this,"userSession"),R(this,"token");const e=new l,t=m({getSessionToken:e.getSessionToken,setSessionToken:e.setSessionToken,removeSessionToken:e.removeSessionToken,getRefreshToken:e.getRefreshToken,setRefreshToken:e.setRefreshToken,removeRefreshToken:e.removeRefreshToken,onRefreshTokenError:()=>{console.error("Failed to refresh token")},onRefreshTokenSuccess:()=>{}},{baseURL:o.WELLKNOWN_SERVICE_PATH_PREFIX});this.user=new u({api:t}),this.userSession=new p({api:t}),this.token=e,this.api=t}}}}]);
|