From d77ca01c79d1be13aa7b7d036c503181b30c099d Mon Sep 17 00:00:00 2001 From: Tristan Yang Date: Fri, 30 Aug 2024 22:28:21 +0800 Subject: [PATCH] Updates --- VERSION | 2 +- asset-manifest.json | 12 +- index.html | 2 +- service-worker.js | 2 +- ...245e14f.chunk.js => 227.0c4a9b19.chunk.js} | 4 +- ....txt => 227.0c4a9b19.chunk.js.LICENSE.txt} | 0 ...5085ca5.chunk.js => 911.37412f4d.chunk.js} | 2 +- ...fd03b0a.chunk.js => 957.8873847c.chunk.js} | 2 +- static/js/main.3b8a8ab7.js | 172 ++++++++++++++++++ ...CENSE.txt => main.3b8a8ab7.js.LICENSE.txt} | 0 static/js/main.e14963a9.js | 172 ------------------ ...{widget.08af0e63.js => widget.1847c7b8.js} | 6 +- ...NSE.txt => widget.1847c7b8.js.LICENSE.txt} | 0 web.vocechat.md5 | 2 +- widget.html | 2 +- 15 files changed, 190 insertions(+), 190 deletions(-) rename static/js/{227.4245e14f.chunk.js => 227.0c4a9b19.chunk.js} (82%) rename static/js/{227.4245e14f.chunk.js.LICENSE.txt => 227.0c4a9b19.chunk.js.LICENSE.txt} (100%) rename static/js/{911.85085ca5.chunk.js => 911.37412f4d.chunk.js} (90%) rename static/js/{957.9fd03b0a.chunk.js => 957.8873847c.chunk.js} (99%) create mode 100644 static/js/main.3b8a8ab7.js rename static/js/{main.e14963a9.js.LICENSE.txt => main.3b8a8ab7.js.LICENSE.txt} (100%) delete mode 100644 static/js/main.e14963a9.js rename static/js/{widget.08af0e63.js => widget.1847c7b8.js} (75%) rename static/js/{widget.08af0e63.js.LICENSE.txt => widget.1847c7b8.js.LICENSE.txt} (100%) diff --git a/VERSION b/VERSION index 85c4193d4..ffb821f0b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.7.28 \ No newline at end of file +0.7.29 \ No newline at end of file diff --git a/asset-manifest.json b/asset-manifest.json index 340a09155..007440632 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,9 +1,9 @@ { "files": { "main.css": "/static/css/main.34b80300.css", - "main.js": "/static/js/main.e14963a9.js", + "main.js": "/static/js/main.3b8a8ab7.js", "widget.css": "/static/css/widget.d13f8dd3.css", - "widget.js": "/static/js/widget.08af0e63.js", + "widget.js": "/static/js/widget.1847c7b8.js", "static/js/308.4d112326.chunk.js": "/static/js/308.4d112326.chunk.js", "static/js/549.5615531f.chunk.js": "/static/js/549.5615531f.chunk.js", "static/js/694.1e89ad69.chunk.js": "/static/js/694.1e89ad69.chunk.js", @@ -17,12 +17,12 @@ "static/js/264.91f3546c.chunk.js": "/static/js/264.91f3546c.chunk.js", "static/js/879.c94b008c.chunk.js": "/static/js/879.c94b008c.chunk.js", "static/css/957.cdf1fe26.chunk.css": "/static/css/957.cdf1fe26.chunk.css", - "static/js/957.9fd03b0a.chunk.js": "/static/js/957.9fd03b0a.chunk.js", + "static/js/957.8873847c.chunk.js": "/static/js/957.8873847c.chunk.js", "static/js/812.edacbb15.chunk.js": "/static/js/812.edacbb15.chunk.js", "static/js/566.551a69d5.chunk.js": "/static/js/566.551a69d5.chunk.js", "static/js/64.78198cfe.chunk.js": "/static/js/64.78198cfe.chunk.js", "static/js/200.7fd884c2.chunk.js": "/static/js/200.7fd884c2.chunk.js", - "static/js/911.85085ca5.chunk.js": "/static/js/911.85085ca5.chunk.js", + "static/js/911.37412f4d.chunk.js": "/static/js/911.37412f4d.chunk.js", "static/js/29.0622ef4f.chunk.js": "/static/js/29.0622ef4f.chunk.js", "static/js/409.8aa153f9.chunk.js": "/static/js/409.8aa153f9.chunk.js", "static/js/973.7e1412c7.chunk.js": "/static/js/973.7e1412c7.chunk.js", @@ -33,7 +33,7 @@ "static/js/446.25c397da.chunk.js": "/static/js/446.25c397da.chunk.js", "static/js/610.3ea800a8.chunk.js": "/static/js/610.3ea800a8.chunk.js", "static/js/128.0e928812.chunk.js": "/static/js/128.0e928812.chunk.js", - "static/js/227.4245e14f.chunk.js": "/static/js/227.4245e14f.chunk.js", + "static/js/227.0c4a9b19.chunk.js": "/static/js/227.0c4a9b19.chunk.js", "static/js/945.7925cf56.chunk.js": "/static/js/945.7925cf56.chunk.js", "static/js/919.23e2f4de.chunk.js": "/static/js/919.23e2f4de.chunk.js", "static/js/887.968f913c.chunk.js": "/static/js/887.968f913c.chunk.js", @@ -60,6 +60,6 @@ }, "entrypoints": [ "static/css/main.34b80300.css", - "static/js/main.e14963a9.js" + "static/js/main.3b8a8ab7.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index 2f6d54962..c674d7805 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -VoceChat WebAPP
\ No newline at end of file +VoceChat WebAPP
\ No newline at end of file diff --git a/service-worker.js b/service-worker.js index e4d7db004..baea98ac5 100644 --- a/service-worker.js +++ b/service-worker.js @@ -1 +1 @@ -(()=>{"use strict";var e={142:()=>{try{self["workbox:core:7.0.0"]&&_()}catch(e){}},558:()=>{try{self["workbox:expiration:7.0.0"]&&_()}catch(e){}},434:()=>{try{self["workbox:precaching:7.0.0"]&&_()}catch(e){}},636:()=>{try{self["workbox:routing:7.0.0"]&&_()}catch(e){}},642:()=>{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(142);const n=(e,...t)=>{let s=e;return t.length>0&&(s+=` :: ${JSON.stringify(t)}`),s};class a extends Error{constructor(e,t){super(n(e,t)),this.name=e,this.details=t}}const r=new Set;const i={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!==typeof registration?registration.scope:""},c=e=>[i.prefix,e,i.suffix].filter((e=>e&&e.length>0)).join("-"),o=e=>e||c(i.precache),h=e=>e||c(i.runtime);function l(e,t){const s=new URL(e);for(const n of t)s.searchParams.delete(n);return s.href}let u;function d(e){e.then((()=>{}))}class f{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}const p=e=>new URL(String(e),location.href).href.replace(new RegExp(`^${location.origin}`),"");function g(e){return new Promise((t=>setTimeout(t,e)))}function w(e,t){const s=t();return e.waitUntil(s),s}async function m(e,t){let s=null;if(e.url){s=new URL(e.url).origin}if(s!==self.location.origin)throw new a("cross-origin-copy-response",{origin:s});const n=e.clone(),r={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},i=t?t(r):r,c=function(){if(void 0===u){const t=new Response("");if("body"in t)try{new Response(t.body),u=!0}catch(e){u=!1}u=!1}return u}()?n.body:await n.blob();return new Response(c,i)}const y=(e,t)=>t.some((t=>e instanceof t));let v,b;const R=new WeakMap,x=new WeakMap,C=new WeakMap,E=new WeakMap,L=new WeakMap;let q={get(e,t,s){if(e instanceof IDBTransaction){if("done"===t)return x.get(e);if("objectStoreNames"===t)return e.objectStoreNames||C.get(e);if("store"===t)return s.objectStoreNames[1]?void 0:s.objectStore(s.objectStoreNames[0])}return T(e[t])},set:(e,t,s)=>(e[t]=s,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function D(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(b||(b=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(k(this),t),T(R.get(this))}:function(...t){return T(e.apply(k(this),t))}:function(t,...s){const n=e.call(k(this),t,...s);return C.set(n,t.sort?t.sort():[t]),T(n)}}function U(e){return"function"===typeof e?D(e):(e instanceof IDBTransaction&&function(e){if(x.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)}));x.set(e,t)}(e),y(e,v||(v=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,q):e)}function T(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(T(e.result)),n()},r=()=>{s(e.error),n()};e.addEventListener("success",a),e.addEventListener("error",r)}));return t.then((t=>{t instanceof IDBCursor&&R.set(t,e)})).catch((()=>{})),L.set(t,e),t}(e);if(E.has(e))return E.get(e);const t=U(e);return t!==e&&(E.set(e,t),L.set(t,e)),t}const k=e=>L.get(e);const N=["get","getKey","getAll","getAllKeys","count"],I=["put","add","delete","clear"],K=new Map;function M(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!==typeof t)return;if(K.get(t))return K.get(t);const s=t.replace(/FromIndex$/,""),n=t!==s,a=I.includes(s);if(!(s in(n?IDBIndex:IDBObjectStore).prototype)||!a&&!N.includes(s))return;const r=async function(e,...t){const r=this.transaction(e,a?"readwrite":"readonly");let i=r.store;return n&&(i=i.index(t.shift())),(await Promise.all([i[s](...t),a&&r.done]))[0]};return K.set(t,r),r}q=(e=>({...e,get:(t,s,n)=>M(t,s)||e.get(t,s,n),has:(t,s)=>!!M(t,s)||e.has(t,s)}))(q);s(558);const P="cache-entries",S=e=>{const t=new URL(e,location.href);return t.hash="",t.href};class O{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(P,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&function(e,{blocked:t}={}){const s=indexedDB.deleteDatabase(e);t&&s.addEventListener("blocked",(e=>t(e.oldVersion,e))),T(s).then((()=>{}))}(this._cacheName)}async setTimestamp(e,t){const s={url:e=S(e),timestamp:t,cacheName:this._cacheName,id:this._getId(e)},n=(await this.getDb()).transaction(P,"readwrite",{durability:"relaxed"});await n.store.put(s),await n.done}async getTimestamp(e){const t=await this.getDb(),s=await t.get(P,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(P).store.index("timestamp").openCursor(null,"prev");const a=[];let r=0;for(;n;){const s=n.value;s.cacheName===this._cacheName&&(e&&s.timestamp=t?a.push(n.value):r++),n=await n.continue()}const i=[];for(const c of a)await s.delete(P,c.id),i.push(c.url);return i}_getId(e){return this._cacheName+"|"+S(e)}async getDb(){return this._db||(this._db=await function(e,t,{blocked:s,upgrade:n,blocking:a,terminated:r}={}){const i=indexedDB.open(e,t),c=T(i);return n&&i.addEventListener("upgradeneeded",(e=>{n(T(i.result),e.oldVersion,e.newVersion,T(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 W{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new O(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,d(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{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:s})=>{if("install"===e.type&&t&&t.originalRequest&&t.originalRequest instanceof Request){const e=t.originalRequest.url;s?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return s}}}class j{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{const s=(null===t||void 0===t?void 0:t.cacheKey)||this._precacheController.getCacheKeyForURL(e.url);return s?new Request(s,{headers:e.headers}):e},this._precacheController=e}}s(642);function F(e){return"string"===typeof e?new Request(e):e}class H{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new f,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:t}=this;let s=F(e);if("navigate"===s.mode&&t instanceof FetchEvent&&t.preloadResponse){const e=await t.preloadResponse;if(e)return e}const n=this.hasCallback("fetchDidFail")?s.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))s=await e({request:s.clone(),event:t})}catch(i){if(i instanceof Error)throw new a("plugin-error-request-will-fetch",{thrownErrorMessage:i.message})}const r=s.clone();try{let e;e=await fetch(s,"navigate"===s.mode?void 0:this._strategy.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))e=await s({event:t,request:r,response:e});return e}catch(c){throw n&&await this.runCallbacks("fetchDidFail",{error:c,event:t,originalRequest:n.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=F(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,t){const s=F(e);await g(0);const n=await this.getCacheKey(s,"write");if(!t)throw new a("cache-put-with-no-response",{url:p(n.url)});const i=await this._ensureResponseSafeToCache(t);if(!i)return!1;const{cacheName:c,matchOptions:o}=this._strategy,h=await self.caches.open(c),u=this.hasCallback("cacheDidUpdate"),d=u?await async function(e,t,s,n){const a=l(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===l(c.url,s))return e.match(c,n)}(h,n.clone(),["__WB_REVISION__"],o):null;try{await h.put(n,u?i.clone():i)}catch(f){if(f instanceof Error)throw"QuotaExceededError"===f.name&&await async function(){for(const e of r)await e()}(),f}for(const a of this.iterateCallbacks("cacheDidUpdate"))await a({cacheName:c,oldResponse:d,newResponse:i.clone(),request:n,event:this.event});return!0}async getCacheKey(e,t){const s=`${e.url} | ${t}`;if(!this._cacheKeys[s]){let n=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))n=F(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(e={}){this.cacheName=h(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 H(this,{event:t,request:s,params:n}),r=this._getResponse(a,s,t);return[r,this._awaitComplete(r,a,s,t)]}async _getResponse(e,t,s){let n;await e.runCallbacks("handlerWillStart",{event:s,request:t});try{if(n=await this._handle(t,e),!n||"error"===n.type)throw new a("no-response",{url:t.url})}catch(r){if(r instanceof Error)for(const a of e.iterateCallbacks("handlerDidError"))if(n=await a({error:r,event:s,request:t}),n)break;if(!n)throw r}for(const a of e.iterateCallbacks("handlerWillRespond"))n=await a({event:s,request:t,response:n});return n}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 $ extends V{constructor(e={}){e.cacheName=o(e.cacheName),super(e),this._fallbackToNetwork=!1!==e.fallbackToNetwork,this.plugins.push($.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,t){let s;const n=t.params||{};if(!this._fallbackToNetwork)throw new a("missing-precache-entry",{cacheName:this.cacheName,url:e.url});{0;const a=n.integrity,r=e.integrity,i=!r||r===a;if(s=await t.fetch(new Request(e,{integrity:"no-cors"!==e.mode?r||a:void 0})),a&&i&&"no-cors"!==e.mode){this._useDefaultCacheabilityPluginIfNeeded();await t.cachePut(e,s.clone());0}}return s}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const s=await t.fetch(e);if(!await t.cachePut(e,s.clone()))throw new a("bad-precaching-response",{url:e.url,status:s.status});return s}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[s,n]of this.plugins.entries())n!==$.copyRedirectedCacheableResponsesPlugin&&(n===$.defaultPrecacheCacheabilityPlugin&&(e=s),n.cacheWillUpdate&&t++);0===t?this.plugins.push($.defaultPrecacheCacheabilityPlugin):t>1&&null!==e&&this.plugins.splice(e,1)}}$.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:e})=>!e||e.status>=400?null:e},$.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:e})=>e.redirected?await m(e):e};class G{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:s=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new $({cacheName:o(e),plugins:[...t,new j({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 t=[];for(const s of e){"string"===typeof s?t.push(s):s&&void 0===s.revision&&t.push(s.url);const{cacheKey:e,url:n}=A(s),r="string"!==typeof s&&s.revision?"reload":"default";if(this._urlsToCacheKeys.has(n)&&this._urlsToCacheKeys.get(n)!==e)throw new a("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(n),secondEntry:e});if("string"!==typeof s&&s.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==s.integrity)throw new a("add-to-cache-list-conflicting-integrities",{url:n});this._cacheKeysToIntegrities.set(e,s.integrity)}if(this._urlsToCacheKeys.set(n,e),this._urlsToCacheModes.set(n,r),t.length>0){const e=`Workbox is precaching URLs without revision info: ${t.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return w(e,(async()=>{const t=new B;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 w(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 t=this.getCacheKeyForURL(e);if(!t)throw new a("non-precached-url",{url:e});return s=>(s.request=new Request(e),s.params=Object.assign({cacheKey:t},s.params),this.strategy.handle(s))}}let Q;const J=()=>(Q||(Q=new G),Q);s(636);const z=e=>e&&"object"===typeof e?e:{handle:e};class X{constructor(e,t,s="GET"){this.handler=z(t),this.match=e,this.method=s}setCatchHandler(e){this.catchHandler=z(e)}}class Y extends X{constructor(e,t,s){super((({url:t})=>{const s=e.exec(t.href);if(s&&(t.origin===location.origin||0===s.index))return s.slice(1)}),t,s)}}class Z{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({request:e,event:t}){const s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return void 0;const n=s.origin===location.origin,{params:a,route:r}=this.findMatchingRoute({event:t,request:e,sameOrigin:n,url:s});let i=r&&r.handler;const c=e.method;if(!i&&this._defaultHandlerMap.has(c)&&(i=this._defaultHandlerMap.get(c)),!i)return void 0;let o;try{o=i.handle({url:s,request:e,event:t,params:a})}catch(l){o=Promise.reject(l)}const h=r&&r.catchHandler;return o instanceof Promise&&(this._catchHandler||h)&&(o=o.catch((async n=>{if(h){0;try{return await h.handle({url:s,request:e,event:t,params:a})}catch(r){r instanceof Error&&(n=r)}}if(this._catchHandler)return this._catchHandler.handle({url:s,request:e,event:t});throw n}))),o}findMatchingRoute({url:e,sameOrigin:t,request:s,event:n}){const a=this._routes.get(s.method)||[];for(const r of a){let a;const i=r.match({url:e,sameOrigin:t,request:s,event:n});if(i)return a=i,(Array.isArray(a)&&0===a.length||i.constructor===Object&&0===Object.keys(i).length||"boolean"===typeof i)&&(a=void 0),{route:r,params:a}}return{}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,z(e))}setCatchHandler(e){this._catchHandler=z(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 a("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(!(t>-1))throw new a("unregister-route-route-not-registered");this._routes.get(e.method).splice(t,1)}}let ee;const te=()=>(ee||(ee=new Z,ee.addFetchListener(),ee.addCacheListener()),ee);function se(e,t,s){let n;if("string"===typeof e){const a=new URL(e,location.href);0;n=new X((({url:e})=>e.href===a.href),t,s)}else if(e instanceof RegExp)n=new Y(e,t,s);else if("function"===typeof e)n=new X(e,t,s);else{if(!(e instanceof X))throw new a("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});n=e}return te().registerRoute(n),n}class ne extends X{constructor(e,t){super((({request:s})=>{const n=e.getURLsToCacheKeys();for(const a of function*(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:a}={}){const r=new URL(e,location.href);r.hash="",yield r.href;const i=function(e,t=[]){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}}(s.url,t)){const t=n.get(a);if(t){return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}}}),e.strategy)}}const ae={cacheWillUpdate:async({response:e})=>200===e.status||0===e.status?e:null};var re;self.addEventListener("activate",(()=>self.clients.claim())),function(e){J().precache(e)}([{'revision':'aa56c573142cace00de3263f95a2ac70','url':'/index.html'},{'revision':null,'url':'/static/css/446.319a0232.chunk.css'},{'revision':null,'url':'/static/css/664.8a09720a.chunk.css'},{'revision':null,'url':'/static/css/957.cdf1fe26.chunk.css'},{'revision':null,'url':'/static/css/main.34b80300.css'},{'revision':null,'url':'/static/css/widget.d13f8dd3.css'},{'revision':null,'url':'/static/js/128.0e928812.chunk.js'},{'revision':null,'url':'/static/js/200.7fd884c2.chunk.js'},{'revision':null,'url':'/static/js/227.4245e14f.chunk.js'},{'revision':null,'url':'/static/js/261.fa5e8388.chunk.js'},{'revision':null,'url':'/static/js/264.91f3546c.chunk.js'},{'revision':null,'url':'/static/js/265.e5ddcab0.chunk.js'},{'revision':null,'url':'/static/js/29.0622ef4f.chunk.js'},{'revision':null,'url':'/static/js/308.4d112326.chunk.js'},{'revision':null,'url':'/static/js/318.23e14e69.chunk.js'},{'revision':null,'url':'/static/js/400.6fec3118.chunk.js'},{'revision':null,'url':'/static/js/409.8aa153f9.chunk.js'},{'revision':null,'url':'/static/js/446.25c397da.chunk.js'},{'revision':null,'url':'/static/js/487.93e50bd5.chunk.js'},{'revision':null,'url':'/static/js/489.b843221e.chunk.js'},{'revision':null,'url':'/static/js/549.5615531f.chunk.js'},{'revision':null,'url':'/static/js/566.551a69d5.chunk.js'},{'revision':null,'url':'/static/js/574.71823edd.chunk.js'},{'revision':null,'url':'/static/js/610.3ea800a8.chunk.js'},{'revision':null,'url':'/static/js/625.a6bbf2f1.chunk.js'},{'revision':null,'url':'/static/js/64.78198cfe.chunk.js'},{'revision':null,'url':'/static/js/658.0a3095f3.chunk.js'},{'revision':null,'url':'/static/js/664.79d15709.chunk.js'},{'revision':null,'url':'/static/js/694.1e89ad69.chunk.js'},{'revision':null,'url':'/static/js/757.2756e1f7.chunk.js'},{'revision':null,'url':'/static/js/770.16942382.chunk.js'},{'revision':null,'url':'/static/js/812.edacbb15.chunk.js'},{'revision':null,'url':'/static/js/875.63eefd4c.chunk.js'},{'revision':null,'url':'/static/js/879.c94b008c.chunk.js'},{'revision':null,'url':'/static/js/88.75be6853.chunk.js'},{'revision':null,'url':'/static/js/887.968f913c.chunk.js'},{'revision':null,'url':'/static/js/911.85085ca5.chunk.js'},{'revision':null,'url':'/static/js/919.23e2f4de.chunk.js'},{'revision':null,'url':'/static/js/945.7925cf56.chunk.js'},{'revision':null,'url':'/static/js/957.9fd03b0a.chunk.js'},{'revision':null,'url':'/static/js/973.7e1412c7.chunk.js'},{'revision':null,'url':'/static/js/main.e14963a9.js'},{'revision':null,'url':'/static/js/widget.08af0e63.js'},{'revision':null,'url':'/static/media/edit.18de09b48249f213cf85.svg'},{'revision':null,'url':'/static/media/getFetch.c4cca45e22bc1b2c7d0d.cjs'},{'revision':null,'url':'/static/media/index.294a0edb7af7d19b781b.cjs'},{'revision':null,'url':'/static/media/index.40b335a788697b39d89d.cjs'},{'revision':null,'url':'/static/media/index.4a92f16a45a8dc264e40.cjs'},{'revision':null,'url':'/static/media/index.675293235c1d3a61a78f.cjs'},{'revision':null,'url':'/static/media/index.c05687ef19f5bac24939.cjs'},{'revision':null,'url':'/static/media/join.32e45d691d059a55188a.wav'},{'revision':null,'url':'/static/media/metamask.f04d5fb63394197766d0.svg'},{'revision':null,'url':'/static/media/more.d35b0228affb89f48593.svg'},{'revision':null,'url':'/static/media/msg.sound.2c23efd582318e940e57.wav'},{'revision':null,'url':'/static/media/picture.57a395fb7f41e8e3c5d1.svg'},{'revision':null,'url':'/static/media/play.ada446bc1d007eef6447.svg'},{'revision':null,'url':'/static/media/reaction.dfc99cbb32dd13e55782.svg'},{'revision':null,'url':'/static/media/reply.c7c79a9d5cee92f51ec5.svg'},{'revision':null,'url':'/static/media/upload.image.9f8c7fc90042d2ff4eb7.svg'},{'revision':'f6255468382e8a8805669fe7f3e46627','url':'/widget.html'}]),function(e){const t=J();se(new ne(t,e))}(re);const ie=new RegExp("/[^/?]+\\.[^/]+$");var ce;se((({request:e,url:t})=>{if("navigate"!==e.mode)return!1;const s=t.pathname;return!(s.startsWith("/_")||s.startsWith("/VERSION")||s.startsWith("/api")||s.startsWith("/locales/")||s.startsWith("/widget"))&&!s.match(ie)}),(ce="/index.html",J().createHandlerBoundToURL(ce))),se((({url:e})=>e.origin===self.location.origin&&e.pathname.endsWith(".png")),new class extends V{constructor(e={}){super(e),this.plugins.some((e=>"cacheWillUpdate"in e))||this.plugins.unshift(ae)}async _handle(e,t){const s=t.fetchAndCachePut(e).catch((()=>{}));t.waitUntil(s);let n,r=await t.cacheMatch(e);if(r)0;else{0;try{r=await s}catch(i){i instanceof Error&&(n=i)}}if(!r)throw new a("no-response",{url:e.url,error:n});return r}}({cacheName:"images",plugins:[new class{constructor(e={}){this.cachedResponseWillBeUsed=async({event:e,request:t,cacheName:s,cachedResponse:n})=>{if(!n)return null;const a=this._isResponseDateFresh(n),r=this._getCacheExpiration(s);d(r.expireEntries());const i=r.updateTimestamp(t.url);if(e)try{e.waitUntil(i)}catch(c){0}return a?n:null},this.cacheDidUpdate=async({cacheName:e,request:t})=>{const s=this._getCacheExpiration(e);await s.updateTimestamp(t.url),await s.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&function(e){r.add(e)}((()=>this.deleteCacheAndMetadata()))}_getCacheExpiration(e){if(e===h())throw new a("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new W(e,this._config),this._cacheExpirations.set(e,t)),t}_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:50})]})),self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}))})(); \ No newline at end of file +(()=>{"use strict";var e={142:()=>{try{self["workbox:core:7.0.0"]&&_()}catch(e){}},558:()=>{try{self["workbox:expiration:7.0.0"]&&_()}catch(e){}},434:()=>{try{self["workbox:precaching:7.0.0"]&&_()}catch(e){}},636:()=>{try{self["workbox:routing:7.0.0"]&&_()}catch(e){}},642:()=>{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(142);const n=(e,...t)=>{let s=e;return t.length>0&&(s+=` :: ${JSON.stringify(t)}`),s};class a extends Error{constructor(e,t){super(n(e,t)),this.name=e,this.details=t}}const r=new Set;const i={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!==typeof registration?registration.scope:""},c=e=>[i.prefix,e,i.suffix].filter((e=>e&&e.length>0)).join("-"),o=e=>e||c(i.precache),h=e=>e||c(i.runtime);function l(e,t){const s=new URL(e);for(const n of t)s.searchParams.delete(n);return s.href}let u;function d(e){e.then((()=>{}))}class f{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}const p=e=>new URL(String(e),location.href).href.replace(new RegExp(`^${location.origin}`),"");function g(e){return new Promise((t=>setTimeout(t,e)))}function w(e,t){const s=t();return e.waitUntil(s),s}async function m(e,t){let s=null;if(e.url){s=new URL(e.url).origin}if(s!==self.location.origin)throw new a("cross-origin-copy-response",{origin:s});const n=e.clone(),r={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},i=t?t(r):r,c=function(){if(void 0===u){const t=new Response("");if("body"in t)try{new Response(t.body),u=!0}catch(e){u=!1}u=!1}return u}()?n.body:await n.blob();return new Response(c,i)}const y=(e,t)=>t.some((t=>e instanceof t));let v,b;const R=new WeakMap,x=new WeakMap,C=new WeakMap,E=new WeakMap,L=new WeakMap;let q={get(e,t,s){if(e instanceof IDBTransaction){if("done"===t)return x.get(e);if("objectStoreNames"===t)return e.objectStoreNames||C.get(e);if("store"===t)return s.objectStoreNames[1]?void 0:s.objectStore(s.objectStoreNames[0])}return T(e[t])},set:(e,t,s)=>(e[t]=s,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function D(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(b||(b=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(k(this),t),T(R.get(this))}:function(...t){return T(e.apply(k(this),t))}:function(t,...s){const n=e.call(k(this),t,...s);return C.set(n,t.sort?t.sort():[t]),T(n)}}function U(e){return"function"===typeof e?D(e):(e instanceof IDBTransaction&&function(e){if(x.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)}));x.set(e,t)}(e),y(e,v||(v=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,q):e)}function T(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(T(e.result)),n()},r=()=>{s(e.error),n()};e.addEventListener("success",a),e.addEventListener("error",r)}));return t.then((t=>{t instanceof IDBCursor&&R.set(t,e)})).catch((()=>{})),L.set(t,e),t}(e);if(E.has(e))return E.get(e);const t=U(e);return t!==e&&(E.set(e,t),L.set(t,e)),t}const k=e=>L.get(e);const N=["get","getKey","getAll","getAllKeys","count"],I=["put","add","delete","clear"],K=new Map;function M(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!==typeof t)return;if(K.get(t))return K.get(t);const s=t.replace(/FromIndex$/,""),n=t!==s,a=I.includes(s);if(!(s in(n?IDBIndex:IDBObjectStore).prototype)||!a&&!N.includes(s))return;const r=async function(e,...t){const r=this.transaction(e,a?"readwrite":"readonly");let i=r.store;return n&&(i=i.index(t.shift())),(await Promise.all([i[s](...t),a&&r.done]))[0]};return K.set(t,r),r}q=(e=>({...e,get:(t,s,n)=>M(t,s)||e.get(t,s,n),has:(t,s)=>!!M(t,s)||e.has(t,s)}))(q);s(558);const P="cache-entries",S=e=>{const t=new URL(e,location.href);return t.hash="",t.href};class O{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(P,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&function(e,{blocked:t}={}){const s=indexedDB.deleteDatabase(e);t&&s.addEventListener("blocked",(e=>t(e.oldVersion,e))),T(s).then((()=>{}))}(this._cacheName)}async setTimestamp(e,t){const s={url:e=S(e),timestamp:t,cacheName:this._cacheName,id:this._getId(e)},n=(await this.getDb()).transaction(P,"readwrite",{durability:"relaxed"});await n.store.put(s),await n.done}async getTimestamp(e){const t=await this.getDb(),s=await t.get(P,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(P).store.index("timestamp").openCursor(null,"prev");const a=[];let r=0;for(;n;){const s=n.value;s.cacheName===this._cacheName&&(e&&s.timestamp=t?a.push(n.value):r++),n=await n.continue()}const i=[];for(const c of a)await s.delete(P,c.id),i.push(c.url);return i}_getId(e){return this._cacheName+"|"+S(e)}async getDb(){return this._db||(this._db=await function(e,t,{blocked:s,upgrade:n,blocking:a,terminated:r}={}){const i=indexedDB.open(e,t),c=T(i);return n&&i.addEventListener("upgradeneeded",(e=>{n(T(i.result),e.oldVersion,e.newVersion,T(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 W{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new O(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,d(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{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:s})=>{if("install"===e.type&&t&&t.originalRequest&&t.originalRequest instanceof Request){const e=t.originalRequest.url;s?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return s}}}class j{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{const s=(null===t||void 0===t?void 0:t.cacheKey)||this._precacheController.getCacheKeyForURL(e.url);return s?new Request(s,{headers:e.headers}):e},this._precacheController=e}}s(642);function F(e){return"string"===typeof e?new Request(e):e}class H{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new f,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:t}=this;let s=F(e);if("navigate"===s.mode&&t instanceof FetchEvent&&t.preloadResponse){const e=await t.preloadResponse;if(e)return e}const n=this.hasCallback("fetchDidFail")?s.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))s=await e({request:s.clone(),event:t})}catch(i){if(i instanceof Error)throw new a("plugin-error-request-will-fetch",{thrownErrorMessage:i.message})}const r=s.clone();try{let e;e=await fetch(s,"navigate"===s.mode?void 0:this._strategy.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))e=await s({event:t,request:r,response:e});return e}catch(c){throw n&&await this.runCallbacks("fetchDidFail",{error:c,event:t,originalRequest:n.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=F(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,t){const s=F(e);await g(0);const n=await this.getCacheKey(s,"write");if(!t)throw new a("cache-put-with-no-response",{url:p(n.url)});const i=await this._ensureResponseSafeToCache(t);if(!i)return!1;const{cacheName:c,matchOptions:o}=this._strategy,h=await self.caches.open(c),u=this.hasCallback("cacheDidUpdate"),d=u?await async function(e,t,s,n){const a=l(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===l(c.url,s))return e.match(c,n)}(h,n.clone(),["__WB_REVISION__"],o):null;try{await h.put(n,u?i.clone():i)}catch(f){if(f instanceof Error)throw"QuotaExceededError"===f.name&&await async function(){for(const e of r)await e()}(),f}for(const a of this.iterateCallbacks("cacheDidUpdate"))await a({cacheName:c,oldResponse:d,newResponse:i.clone(),request:n,event:this.event});return!0}async getCacheKey(e,t){const s=`${e.url} | ${t}`;if(!this._cacheKeys[s]){let n=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))n=F(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(e={}){this.cacheName=h(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 H(this,{event:t,request:s,params:n}),r=this._getResponse(a,s,t);return[r,this._awaitComplete(r,a,s,t)]}async _getResponse(e,t,s){let n;await e.runCallbacks("handlerWillStart",{event:s,request:t});try{if(n=await this._handle(t,e),!n||"error"===n.type)throw new a("no-response",{url:t.url})}catch(r){if(r instanceof Error)for(const a of e.iterateCallbacks("handlerDidError"))if(n=await a({error:r,event:s,request:t}),n)break;if(!n)throw r}for(const a of e.iterateCallbacks("handlerWillRespond"))n=await a({event:s,request:t,response:n});return n}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 $ extends V{constructor(e={}){e.cacheName=o(e.cacheName),super(e),this._fallbackToNetwork=!1!==e.fallbackToNetwork,this.plugins.push($.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,t){let s;const n=t.params||{};if(!this._fallbackToNetwork)throw new a("missing-precache-entry",{cacheName:this.cacheName,url:e.url});{0;const a=n.integrity,r=e.integrity,i=!r||r===a;if(s=await t.fetch(new Request(e,{integrity:"no-cors"!==e.mode?r||a:void 0})),a&&i&&"no-cors"!==e.mode){this._useDefaultCacheabilityPluginIfNeeded();await t.cachePut(e,s.clone());0}}return s}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const s=await t.fetch(e);if(!await t.cachePut(e,s.clone()))throw new a("bad-precaching-response",{url:e.url,status:s.status});return s}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[s,n]of this.plugins.entries())n!==$.copyRedirectedCacheableResponsesPlugin&&(n===$.defaultPrecacheCacheabilityPlugin&&(e=s),n.cacheWillUpdate&&t++);0===t?this.plugins.push($.defaultPrecacheCacheabilityPlugin):t>1&&null!==e&&this.plugins.splice(e,1)}}$.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:e})=>!e||e.status>=400?null:e},$.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:e})=>e.redirected?await m(e):e};class G{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:s=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new $({cacheName:o(e),plugins:[...t,new j({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 t=[];for(const s of e){"string"===typeof s?t.push(s):s&&void 0===s.revision&&t.push(s.url);const{cacheKey:e,url:n}=A(s),r="string"!==typeof s&&s.revision?"reload":"default";if(this._urlsToCacheKeys.has(n)&&this._urlsToCacheKeys.get(n)!==e)throw new a("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(n),secondEntry:e});if("string"!==typeof s&&s.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==s.integrity)throw new a("add-to-cache-list-conflicting-integrities",{url:n});this._cacheKeysToIntegrities.set(e,s.integrity)}if(this._urlsToCacheKeys.set(n,e),this._urlsToCacheModes.set(n,r),t.length>0){const e=`Workbox is precaching URLs without revision info: ${t.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return w(e,(async()=>{const t=new B;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 w(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 t=this.getCacheKeyForURL(e);if(!t)throw new a("non-precached-url",{url:e});return s=>(s.request=new Request(e),s.params=Object.assign({cacheKey:t},s.params),this.strategy.handle(s))}}let Q;const J=()=>(Q||(Q=new G),Q);s(636);const z=e=>e&&"object"===typeof e?e:{handle:e};class X{constructor(e,t,s="GET"){this.handler=z(t),this.match=e,this.method=s}setCatchHandler(e){this.catchHandler=z(e)}}class Y extends X{constructor(e,t,s){super((({url:t})=>{const s=e.exec(t.href);if(s&&(t.origin===location.origin||0===s.index))return s.slice(1)}),t,s)}}class Z{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({request:e,event:t}){const s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return void 0;const n=s.origin===location.origin,{params:a,route:r}=this.findMatchingRoute({event:t,request:e,sameOrigin:n,url:s});let i=r&&r.handler;const c=e.method;if(!i&&this._defaultHandlerMap.has(c)&&(i=this._defaultHandlerMap.get(c)),!i)return void 0;let o;try{o=i.handle({url:s,request:e,event:t,params:a})}catch(l){o=Promise.reject(l)}const h=r&&r.catchHandler;return o instanceof Promise&&(this._catchHandler||h)&&(o=o.catch((async n=>{if(h){0;try{return await h.handle({url:s,request:e,event:t,params:a})}catch(r){r instanceof Error&&(n=r)}}if(this._catchHandler)return this._catchHandler.handle({url:s,request:e,event:t});throw n}))),o}findMatchingRoute({url:e,sameOrigin:t,request:s,event:n}){const a=this._routes.get(s.method)||[];for(const r of a){let a;const i=r.match({url:e,sameOrigin:t,request:s,event:n});if(i)return a=i,(Array.isArray(a)&&0===a.length||i.constructor===Object&&0===Object.keys(i).length||"boolean"===typeof i)&&(a=void 0),{route:r,params:a}}return{}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,z(e))}setCatchHandler(e){this._catchHandler=z(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 a("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(!(t>-1))throw new a("unregister-route-route-not-registered");this._routes.get(e.method).splice(t,1)}}let ee;const te=()=>(ee||(ee=new Z,ee.addFetchListener(),ee.addCacheListener()),ee);function se(e,t,s){let n;if("string"===typeof e){const a=new URL(e,location.href);0;n=new X((({url:e})=>e.href===a.href),t,s)}else if(e instanceof RegExp)n=new Y(e,t,s);else if("function"===typeof e)n=new X(e,t,s);else{if(!(e instanceof X))throw new a("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});n=e}return te().registerRoute(n),n}class ne extends X{constructor(e,t){super((({request:s})=>{const n=e.getURLsToCacheKeys();for(const a of function*(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:a}={}){const r=new URL(e,location.href);r.hash="",yield r.href;const i=function(e,t=[]){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}}(s.url,t)){const t=n.get(a);if(t){return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}}}),e.strategy)}}const ae={cacheWillUpdate:async({response:e})=>200===e.status||0===e.status?e:null};var re;self.addEventListener("activate",(()=>self.clients.claim())),function(e){J().precache(e)}([{'revision':'a4c2a64d0e9bc6baf98bd3124ca29bf1','url':'/index.html'},{'revision':null,'url':'/static/css/446.319a0232.chunk.css'},{'revision':null,'url':'/static/css/664.8a09720a.chunk.css'},{'revision':null,'url':'/static/css/957.cdf1fe26.chunk.css'},{'revision':null,'url':'/static/css/main.34b80300.css'},{'revision':null,'url':'/static/css/widget.d13f8dd3.css'},{'revision':null,'url':'/static/js/128.0e928812.chunk.js'},{'revision':null,'url':'/static/js/200.7fd884c2.chunk.js'},{'revision':null,'url':'/static/js/227.0c4a9b19.chunk.js'},{'revision':null,'url':'/static/js/261.fa5e8388.chunk.js'},{'revision':null,'url':'/static/js/264.91f3546c.chunk.js'},{'revision':null,'url':'/static/js/265.e5ddcab0.chunk.js'},{'revision':null,'url':'/static/js/29.0622ef4f.chunk.js'},{'revision':null,'url':'/static/js/308.4d112326.chunk.js'},{'revision':null,'url':'/static/js/318.23e14e69.chunk.js'},{'revision':null,'url':'/static/js/400.6fec3118.chunk.js'},{'revision':null,'url':'/static/js/409.8aa153f9.chunk.js'},{'revision':null,'url':'/static/js/446.25c397da.chunk.js'},{'revision':null,'url':'/static/js/487.93e50bd5.chunk.js'},{'revision':null,'url':'/static/js/489.b843221e.chunk.js'},{'revision':null,'url':'/static/js/549.5615531f.chunk.js'},{'revision':null,'url':'/static/js/566.551a69d5.chunk.js'},{'revision':null,'url':'/static/js/574.71823edd.chunk.js'},{'revision':null,'url':'/static/js/610.3ea800a8.chunk.js'},{'revision':null,'url':'/static/js/625.a6bbf2f1.chunk.js'},{'revision':null,'url':'/static/js/64.78198cfe.chunk.js'},{'revision':null,'url':'/static/js/658.0a3095f3.chunk.js'},{'revision':null,'url':'/static/js/664.79d15709.chunk.js'},{'revision':null,'url':'/static/js/694.1e89ad69.chunk.js'},{'revision':null,'url':'/static/js/757.2756e1f7.chunk.js'},{'revision':null,'url':'/static/js/770.16942382.chunk.js'},{'revision':null,'url':'/static/js/812.edacbb15.chunk.js'},{'revision':null,'url':'/static/js/875.63eefd4c.chunk.js'},{'revision':null,'url':'/static/js/879.c94b008c.chunk.js'},{'revision':null,'url':'/static/js/88.75be6853.chunk.js'},{'revision':null,'url':'/static/js/887.968f913c.chunk.js'},{'revision':null,'url':'/static/js/911.37412f4d.chunk.js'},{'revision':null,'url':'/static/js/919.23e2f4de.chunk.js'},{'revision':null,'url':'/static/js/945.7925cf56.chunk.js'},{'revision':null,'url':'/static/js/957.8873847c.chunk.js'},{'revision':null,'url':'/static/js/973.7e1412c7.chunk.js'},{'revision':null,'url':'/static/js/main.3b8a8ab7.js'},{'revision':null,'url':'/static/js/widget.1847c7b8.js'},{'revision':null,'url':'/static/media/edit.18de09b48249f213cf85.svg'},{'revision':null,'url':'/static/media/getFetch.c4cca45e22bc1b2c7d0d.cjs'},{'revision':null,'url':'/static/media/index.294a0edb7af7d19b781b.cjs'},{'revision':null,'url':'/static/media/index.40b335a788697b39d89d.cjs'},{'revision':null,'url':'/static/media/index.4a92f16a45a8dc264e40.cjs'},{'revision':null,'url':'/static/media/index.675293235c1d3a61a78f.cjs'},{'revision':null,'url':'/static/media/index.c05687ef19f5bac24939.cjs'},{'revision':null,'url':'/static/media/join.32e45d691d059a55188a.wav'},{'revision':null,'url':'/static/media/metamask.f04d5fb63394197766d0.svg'},{'revision':null,'url':'/static/media/more.d35b0228affb89f48593.svg'},{'revision':null,'url':'/static/media/msg.sound.2c23efd582318e940e57.wav'},{'revision':null,'url':'/static/media/picture.57a395fb7f41e8e3c5d1.svg'},{'revision':null,'url':'/static/media/play.ada446bc1d007eef6447.svg'},{'revision':null,'url':'/static/media/reaction.dfc99cbb32dd13e55782.svg'},{'revision':null,'url':'/static/media/reply.c7c79a9d5cee92f51ec5.svg'},{'revision':null,'url':'/static/media/upload.image.9f8c7fc90042d2ff4eb7.svg'},{'revision':'d052233c7ccc309dc7b456c83c37b663','url':'/widget.html'}]),function(e){const t=J();se(new ne(t,e))}(re);const ie=new RegExp("/[^/?]+\\.[^/]+$");var ce;se((({request:e,url:t})=>{if("navigate"!==e.mode)return!1;const s=t.pathname;return!(s.startsWith("/_")||s.startsWith("/VERSION")||s.startsWith("/api")||s.startsWith("/locales/")||s.startsWith("/widget"))&&!s.match(ie)}),(ce="/index.html",J().createHandlerBoundToURL(ce))),se((({url:e})=>e.origin===self.location.origin&&e.pathname.endsWith(".png")),new class extends V{constructor(e={}){super(e),this.plugins.some((e=>"cacheWillUpdate"in e))||this.plugins.unshift(ae)}async _handle(e,t){const s=t.fetchAndCachePut(e).catch((()=>{}));t.waitUntil(s);let n,r=await t.cacheMatch(e);if(r)0;else{0;try{r=await s}catch(i){i instanceof Error&&(n=i)}}if(!r)throw new a("no-response",{url:e.url,error:n});return r}}({cacheName:"images",plugins:[new class{constructor(e={}){this.cachedResponseWillBeUsed=async({event:e,request:t,cacheName:s,cachedResponse:n})=>{if(!n)return null;const a=this._isResponseDateFresh(n),r=this._getCacheExpiration(s);d(r.expireEntries());const i=r.updateTimestamp(t.url);if(e)try{e.waitUntil(i)}catch(c){0}return a?n:null},this.cacheDidUpdate=async({cacheName:e,request:t})=>{const s=this._getCacheExpiration(e);await s.updateTimestamp(t.url),await s.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&function(e){r.add(e)}((()=>this.deleteCacheAndMetadata()))}_getCacheExpiration(e){if(e===h())throw new a("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new W(e,this._config),this._cacheExpirations.set(e,t)),t}_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:50})]})),self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}))})(); \ No newline at end of file diff --git a/static/js/227.4245e14f.chunk.js b/static/js/227.0c4a9b19.chunk.js similarity index 82% rename from static/js/227.4245e14f.chunk.js rename to static/js/227.0c4a9b19.chunk.js index 3326c41ab..0f9d30e93 100644 --- a/static/js/227.4245e14f.chunk.js +++ b/static/js/227.0c4a9b19.chunk.js @@ -1,2 +1,2 @@ -/*! For license information please see 227.4245e14f.chunk.js.LICENSE.txt */ -(globalThis.webpackChunkvocechat_web=globalThis.webpackChunkvocechat_web||[]).push([[227],{77009:function(e,n,t){!function(e,n){"use strict";function t(e){return t.result?t.result:e&&"function"===typeof e.getSerializer?(t.result=e.getSerializer(),t.result):Promise.reject(new Error("localforage.getSerializer() was not available! localforage v1.4+ is required!"))}function r(e,n){n&&e.then((function(e){n(null,e)}),(function(e){n(e)}))}function o(e,n,t,r){function o(e,n){var t=e||n;return e&&"function"===typeof e||"string"!==typeof t||(e=function(e){return e[t]}),e}var i=[];if("[object Array]"===Object.prototype.toString.call(e)){n=o(n,"key"),t=o(t,"value");for(var a=0,u=e.length;a{e.exports=function e(n,t,r){function o(a,u){if(!t[a]){if(!n[a]){if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var f=t[a]={exports:{}};n[a][0].call(f.exports,(function(e){var t=n[a][1][e];return o(t||e)}),f,f.exports,e,n,t,r)}return t[a].exports}for(var i=void 0,a=0;a=43)}})).catch((function(){return!1}))}function S(e){return"boolean"===typeof p?f.resolve(p):w(e).then((function(e){return p=e}))}function I(e){var n=y[e.name],t={};t.promise=new f((function(e,n){t.resolve=e,t.reject=n})),n.deferredOperations.push(t),n.dbReady?n.dbReady=n.dbReady.then((function(){return t.promise})):n.dbReady=t.promise}function E(e){var n=y[e.name].deferredOperations.pop();if(n)return n.resolve(),n.promise}function N(e,n){var t=y[e.name].deferredOperations.pop();if(t)return t.reject(n),t.promise}function j(e,n){return new f((function(t,r){if(y[e.name]=y[e.name]||z(),e.db){if(!n)return t(e.db);I(e),e.db.close()}var o=[e.name];n&&o.push(e.version);var i=a.open.apply(a,o);n&&(i.onupgradeneeded=function(n){var t=i.result;try{t.createObjectStore(e.storeName),n.oldVersion<=1&&t.createObjectStore(h)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+e.name+'" has been upgraded from version '+n.oldVersion+" to version "+n.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),i.onerror=function(e){e.preventDefault(),r(i.error)},i.onsuccess=function(){var n=i.result;n.onversionchange=function(e){e.target.close()},t(n),E(e)}}))}function R(e){return j(e,!1)}function x(e){return j(e,!0)}function O(e,n){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),r=e.versione.db.version;if(r&&(e.version!==n&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||t){if(t){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function A(e){return new f((function(n,t){var r=new FileReader;r.onerror=t,r.onloadend=function(t){var r=btoa(t.target.result||"");n({__local_forage_encoded_blob:!0,data:r,type:e.type})},r.readAsBinaryString(e)}))}function D(e){return c([_(atob(e.data))],{type:e.type})}function k(e){return e&&e.__local_forage_encoded_blob}function B(e){var n=this,t=n._initReady().then((function(){var e=y[n._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return l(t,e,e),t}function C(e){I(e);for(var n=y[e.name],t=n.forages,r=0;r0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return f.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),x(e)})).then((function(){return C(e).then((function(){T(e,n,t,r-1)}))})).catch(t);t(i)}}function z(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function F(e){var n=this,t={db:null};if(e)for(var r in e)t[r]=e[r];var o=y[t.name];o||(o=z(),y[t.name]=o),o.forages.push(n),n._initReady||(n._initReady=n.ready,n.ready=B);var i=[];function a(){return f.resolve()}for(var u=0;u>4,s[c++]=(15&r)<<4|o>>2,s[c++]=(3&o)<<6|63&i;return f}function he(e){var n,t=new Uint8Array(e),r="";for(n=0;n>2],r+=V[(3&t[n])<<4|t[n+1]>>4],r+=V[(15&t[n+1])<<2|t[n+2]>>6],r+=V[63&t[n+2]];return t.length%3===2?r=r.substring(0,r.length-1)+"=":t.length%3===1&&(r=r.substring(0,r.length-2)+"=="),r}function pe(e,n){var t="";if(e&&(t=de.call(e)),e&&("[object ArrayBuffer]"===t||e.buffer&&"[object ArrayBuffer]"===de.call(e.buffer))){var r,o=Z;e instanceof ArrayBuffer?(r=e,o+=ee):(r=e.buffer,"[object Int8Array]"===t?o+=te:"[object Uint8Array]"===t?o+=re:"[object Uint8ClampedArray]"===t?o+=oe:"[object Int16Array]"===t?o+=ie:"[object Uint16Array]"===t?o+=ue:"[object Int32Array]"===t?o+=ae:"[object Uint32Array]"===t?o+=ce:"[object Float32Array]"===t?o+=fe:"[object Float64Array]"===t?o+=se:n(new Error("Failed to get type for BinaryArray"))),n(o+he(r))}else if("[object Blob]"===t){var i=new FileReader;i.onload=function(){var t=J+e.type+"~"+he(this.result);n(Z+ne+t)},i.readAsArrayBuffer(e)}else try{n(JSON.stringify(e))}catch(a){console.error("Couldn't convert value into a JSON string: ",e),n(null,a)}}function ye(e){if(e.substring(0,$)!==Z)return JSON.parse(e);var n,t=e.substring(le),r=e.substring($,le);if(r===ne&&Y.test(t)){var o=t.match(Y);n=o[1],t=t.substring(o[0].length)}var i=ve(t);switch(r){case ee:return i;case ne:return c([i],{type:n});case te:return new Int8Array(i);case re:return new Uint8Array(i);case oe:return new Uint8ClampedArray(i);case ie:return new Int16Array(i);case ue:return new Uint16Array(i);case ae:return new Int32Array(i);case ce:return new Uint32Array(i);case fe:return new Float32Array(i);case se:return new Float64Array(i);default:throw new Error("Unkown type: "+r)}}var be={serialize:pe,deserialize:ye,stringToBuffer:ve,bufferToString:he};function ge(e,n,t,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+n.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,r)}function me(e){var n=this,t={db:null};if(e)for(var r in e)t[r]="string"!==typeof e[r]?e[r].toString():e[r];var o=new f((function(e,r){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(o){return r(o)}t.db.transaction((function(o){ge(o,t,(function(){n._dbInfo=t,e()}),(function(e,n){r(n)}))}),r)}));return t.serializer=be,o}function _e(e,n,t,r,o,i){e.executeSql(t,r,o,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[n.storeName],(function(e,u){u.rows.length?i(e,a):ge(e,n,(function(){e.executeSql(t,r,o,i)}),i)}),i):i(e,a)}),i)}function we(e,n){var t=this;e=d(e);var r=new f((function(n,r){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){_e(t,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,t){var r=t.rows.length?t.rows.item(0).value:null;r&&(r=o.serializer.deserialize(r)),n(r)}),(function(e,n){r(n)}))}))})).catch(r)}));return s(r,n),r}function Se(e,n){var t=this,r=new f((function(n,r){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){_e(t,o,"SELECT * FROM "+o.storeName,[],(function(t,r){for(var i=r.rows,a=i.length,u=0;u0)return void i(Ie.apply(o,[e,u,t,r-1]));a(n)}}))}))})).catch(a)}));return s(i,t),i}function Ee(e,n,t){return Ie.apply(this,[e,n,t,1])}function Ne(e,n){var t=this;e=d(e);var r=new f((function(n,r){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){_e(t,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],(function(){n()}),(function(e,n){r(n)}))}))})).catch(r)}));return s(r,n),r}function je(e){var n=this,t=new f((function(e,t){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){_e(n,r,"DELETE FROM "+r.storeName,[],(function(){e()}),(function(e,n){t(n)}))}))})).catch(t)}));return s(t,e),t}function Re(e){var n=this,t=new f((function(e,t){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){_e(n,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],(function(n,t){var r=t.rows.item(0).c;e(r)}),(function(e,n){t(n)}))}))})).catch(t)}));return s(t,e),t}function xe(e,n){var t=this,r=new f((function(n,r){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){_e(t,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,t){var r=t.rows.length?t.rows.item(0).key:null;n(r)}),(function(e,n){r(n)}))}))})).catch(r)}));return s(r,n),r}function Oe(e){var n=this,t=new f((function(e,t){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){_e(n,r,"SELECT key FROM "+r.storeName,[],(function(n,t){for(var r=[],o=0;o '__WebKitDatabaseInfoTable__'",[],(function(t,r){for(var o=[],i=0;i0}function Fe(e){var n=this,t={};if(e)for(var r in e)t[r]=e[r];return t.keyPrefix=Ce(e,n._defaultConfig),ze()?(n._dbInfo=t,t.serializer=be,f.resolve()):f.reject()}function Le(e){var n=this,t=n.ready().then((function(){for(var e=n._dbInfo.keyPrefix,t=localStorage.length-1;t>=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}}));return s(t,e),t}function Pe(e,n){var t=this;e=d(e);var r=t.ready().then((function(){var n=t._dbInfo,r=localStorage.getItem(n.keyPrefix+e);return r&&(r=n.serializer.deserialize(r)),r}));return s(r,n),r}function Me(e,n){var t=this,r=t.ready().then((function(){for(var n=t._dbInfo,r=n.keyPrefix,o=r.length,i=localStorage.length,a=1,u=0;u=0;n--){var t=localStorage.key(n);0===t.indexOf(e)&&localStorage.removeItem(t)}})):f.reject("Invalid arguments"),s(r,n),r}var Xe={_driver:"localStorageWrapper",_initStorage:Fe,_support:Be(),iterate:Me,getItem:Pe,setItem:Ke,removeItem:He,clear:Le,length:qe,key:We,keys:Ue,dropInstance:Qe},Ge=function(e,n){return e===n||"number"===typeof e&&"number"===typeof n&&isNaN(e)&&isNaN(n)},Ve=function(e,n){for(var t=e.length,r=0;r{"use strict";t.d(n,{A:()=>_});var r=t(95265),o=t(64032),i=t(81084);const a=i.useLayoutEffect;var u=function(e,n){"function"!==typeof e?e.current=n:e(n)};const c=function(e,n){var t=(0,i.useRef)();return(0,i.useCallback)((function(r){e.current=r,t.current&&u(t.current,null),t.current=n,n&&u(n,r)}),[n])};var f={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},s=function(e){Object.keys(f).forEach((function(n){e.style.setProperty(n,f[n],"important")}))},l=null,d=function(e,n){var t=e.scrollHeight;return"border-box"===n.sizingStyle.boxSizing?t+n.borderSize:t-n.paddingSize};var v=function(){},h=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],p=!!document.documentElement.currentStyle,y=function(e){var n=window.getComputedStyle(e);if(null===n)return null;var t,r=(t=n,h.reduce((function(e,n){return e[n]=t[n],e}),{})),o=r.boxSizing;return""===o?null:(p&&"border-box"===o&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px"),{sizingStyle:r,paddingSize:parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),borderSize:parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth)})};function b(e,n,t){var r=function(e){var n=i.useRef(e);return a((function(){n.current=e})),n}(t);i.useLayoutEffect((function(){var t=function(e){return r.current(e)};if(e)return e.addEventListener(n,t),function(){return e.removeEventListener(n,t)}}),[])}var g=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],m=function(e,n){var t=e.cacheMeasurements,a=e.maxRows,u=e.minRows,f=e.onChange,h=void 0===f?v:f,p=e.onHeightChange,m=void 0===p?v:p,_=(0,o.A)(e,g),w=void 0!==_.value,S=i.useRef(null),I=c(S,n),E=i.useRef(0),N=i.useRef(),j=function(){var e=S.current,n=t&&N.current?N.current:y(e);if(n){N.current=n;var r=function(e,n,t,r){void 0===t&&(t=1),void 0===r&&(r=1/0),l||((l=document.createElement("textarea")).setAttribute("tabindex","-1"),l.setAttribute("aria-hidden","true"),s(l)),null===l.parentNode&&document.body.appendChild(l);var o=e.paddingSize,i=e.borderSize,a=e.sizingStyle,u=a.boxSizing;Object.keys(a).forEach((function(e){var n=e;l.style[n]=a[n]})),s(l),l.value=n;var c=d(l,e);l.value=n,c=d(l,e),l.value="x";var f=l.scrollHeight-o,v=f*t;"border-box"===u&&(v=v+o+i),c=Math.max(v,c);var h=f*r;return"border-box"===u&&(h=h+o+i),[c=Math.min(h,c),f]}(n,e.value||e.placeholder||"x",u,a),o=r[0],i=r[1];E.current!==o&&(E.current=o,e.style.setProperty("height",o+"px","important"),m(o,{rowHeight:i}))}};return i.useLayoutEffect(j),b(window,"resize",j),function(e){b(document.fonts,"loadingdone",e)}(j),i.createElement("textarea",(0,r.A)({},_,{onChange:function(e){w||j(),h(e)},ref:I}))},_=i.forwardRef(m)},95265:(e,n,t)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var n=1;nr})},64032:(e,n,t)=>{"use strict";function r(e,n){if(null==e)return{};var t={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(n.indexOf(r)>=0)continue;t[r]=e[r]}return t}t.d(n,{A:()=>r})}}]); \ No newline at end of file +/*! For license information please see 227.0c4a9b19.chunk.js.LICENSE.txt */ +(globalThis.webpackChunkvocechat_web=globalThis.webpackChunkvocechat_web||[]).push([[227],{77009:function(e,n,t){!function(e,n){"use strict";function t(e){return t.result?t.result:e&&"function"===typeof e.getSerializer?(t.result=e.getSerializer(),t.result):Promise.reject(new Error("localforage.getSerializer() was not available! localforage v1.4+ is required!"))}function r(e,n){n&&e.then((function(e){n(null,e)}),(function(e){n(e)}))}function o(e,n,t,r){function o(e,n){var t=e||n;return e&&"function"===typeof e||"string"!==typeof t||(e=function(e){return e[t]}),e}var i=[];if("[object Array]"===Object.prototype.toString.call(e)){n=o(n,"key"),t=o(t,"value");for(var a=0,u=e.length;a{e.exports=function e(n,t,r){function o(a,u){if(!t[a]){if(!n[a]){if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var f=t[a]={exports:{}};n[a][0].call(f.exports,(function(e){var t=n[a][1][e];return o(t||e)}),f,f.exports,e,n,t,r)}return t[a].exports}for(var i=void 0,a=0;a=43)}})).catch((function(){return!1}))}function S(e){return"boolean"===typeof p?f.resolve(p):w(e).then((function(e){return p=e}))}function I(e){var n=y[e.name],t={};t.promise=new f((function(e,n){t.resolve=e,t.reject=n})),n.deferredOperations.push(t),n.dbReady?n.dbReady=n.dbReady.then((function(){return t.promise})):n.dbReady=t.promise}function E(e){var n=y[e.name].deferredOperations.pop();if(n)return n.resolve(),n.promise}function N(e,n){var t=y[e.name].deferredOperations.pop();if(t)return t.reject(n),t.promise}function j(e,n){return new f((function(t,r){if(y[e.name]=y[e.name]||z(),e.db){if(!n)return t(e.db);I(e),e.db.close()}var o=[e.name];n&&o.push(e.version);var i=a.open.apply(a,o);n&&(i.onupgradeneeded=function(n){var t=i.result;try{t.createObjectStore(e.storeName),n.oldVersion<=1&&t.createObjectStore(h)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+e.name+'" has been upgraded from version '+n.oldVersion+" to version "+n.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),i.onerror=function(e){e.preventDefault(),r(i.error)},i.onsuccess=function(){var n=i.result;n.onversionchange=function(e){e.target.close()},t(n),E(e)}}))}function x(e){return j(e,!1)}function R(e){return j(e,!0)}function O(e,n){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),r=e.versione.db.version;if(r&&(e.version!==n&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||t){if(t){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function A(e){return new f((function(n,t){var r=new FileReader;r.onerror=t,r.onloadend=function(t){var r=btoa(t.target.result||"");n({__local_forage_encoded_blob:!0,data:r,type:e.type})},r.readAsBinaryString(e)}))}function D(e){return c([_(atob(e.data))],{type:e.type})}function k(e){return e&&e.__local_forage_encoded_blob}function B(e){var n=this,t=n._initReady().then((function(){var e=y[n._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return l(t,e,e),t}function C(e){I(e);for(var n=y[e.name],t=n.forages,r=0;r0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return f.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),R(e)})).then((function(){return C(e).then((function(){T(e,n,t,r-1)}))})).catch(t);t(i)}}function z(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function F(e){var n=this,t={db:null};if(e)for(var r in e)t[r]=e[r];var o=y[t.name];o||(o=z(),y[t.name]=o),o.forages.push(n),n._initReady||(n._initReady=n.ready,n.ready=B);var i=[];function a(){return f.resolve()}for(var u=0;u>4,s[c++]=(15&r)<<4|o>>2,s[c++]=(3&o)<<6|63&i;return f}function he(e){var n,t=new Uint8Array(e),r="";for(n=0;n>2],r+=V[(3&t[n])<<4|t[n+1]>>4],r+=V[(15&t[n+1])<<2|t[n+2]>>6],r+=V[63&t[n+2]];return t.length%3===2?r=r.substring(0,r.length-1)+"=":t.length%3===1&&(r=r.substring(0,r.length-2)+"=="),r}function pe(e,n){var t="";if(e&&(t=de.call(e)),e&&("[object ArrayBuffer]"===t||e.buffer&&"[object ArrayBuffer]"===de.call(e.buffer))){var r,o=Z;e instanceof ArrayBuffer?(r=e,o+=ee):(r=e.buffer,"[object Int8Array]"===t?o+=te:"[object Uint8Array]"===t?o+=re:"[object Uint8ClampedArray]"===t?o+=oe:"[object Int16Array]"===t?o+=ie:"[object Uint16Array]"===t?o+=ue:"[object Int32Array]"===t?o+=ae:"[object Uint32Array]"===t?o+=ce:"[object Float32Array]"===t?o+=fe:"[object Float64Array]"===t?o+=se:n(new Error("Failed to get type for BinaryArray"))),n(o+he(r))}else if("[object Blob]"===t){var i=new FileReader;i.onload=function(){var t=J+e.type+"~"+he(this.result);n(Z+ne+t)},i.readAsArrayBuffer(e)}else try{n(JSON.stringify(e))}catch(a){console.error("Couldn't convert value into a JSON string: ",e),n(null,a)}}function ye(e){if(e.substring(0,$)!==Z)return JSON.parse(e);var n,t=e.substring(le),r=e.substring($,le);if(r===ne&&Y.test(t)){var o=t.match(Y);n=o[1],t=t.substring(o[0].length)}var i=ve(t);switch(r){case ee:return i;case ne:return c([i],{type:n});case te:return new Int8Array(i);case re:return new Uint8Array(i);case oe:return new Uint8ClampedArray(i);case ie:return new Int16Array(i);case ue:return new Uint16Array(i);case ae:return new Int32Array(i);case ce:return new Uint32Array(i);case fe:return new Float32Array(i);case se:return new Float64Array(i);default:throw new Error("Unkown type: "+r)}}var be={serialize:pe,deserialize:ye,stringToBuffer:ve,bufferToString:he};function ge(e,n,t,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+n.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,r)}function me(e){var n=this,t={db:null};if(e)for(var r in e)t[r]="string"!==typeof e[r]?e[r].toString():e[r];var o=new f((function(e,r){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(o){return r(o)}t.db.transaction((function(o){ge(o,t,(function(){n._dbInfo=t,e()}),(function(e,n){r(n)}))}),r)}));return t.serializer=be,o}function _e(e,n,t,r,o,i){e.executeSql(t,r,o,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[n.storeName],(function(e,u){u.rows.length?i(e,a):ge(e,n,(function(){e.executeSql(t,r,o,i)}),i)}),i):i(e,a)}),i)}function we(e,n){var t=this;e=d(e);var r=new f((function(n,r){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){_e(t,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,t){var r=t.rows.length?t.rows.item(0).value:null;r&&(r=o.serializer.deserialize(r)),n(r)}),(function(e,n){r(n)}))}))})).catch(r)}));return s(r,n),r}function Se(e,n){var t=this,r=new f((function(n,r){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){_e(t,o,"SELECT * FROM "+o.storeName,[],(function(t,r){for(var i=r.rows,a=i.length,u=0;u0)return void i(Ie.apply(o,[e,u,t,r-1]));a(n)}}))}))})).catch(a)}));return s(i,t),i}function Ee(e,n,t){return Ie.apply(this,[e,n,t,1])}function Ne(e,n){var t=this;e=d(e);var r=new f((function(n,r){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){_e(t,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],(function(){n()}),(function(e,n){r(n)}))}))})).catch(r)}));return s(r,n),r}function je(e){var n=this,t=new f((function(e,t){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){_e(n,r,"DELETE FROM "+r.storeName,[],(function(){e()}),(function(e,n){t(n)}))}))})).catch(t)}));return s(t,e),t}function xe(e){var n=this,t=new f((function(e,t){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){_e(n,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],(function(n,t){var r=t.rows.item(0).c;e(r)}),(function(e,n){t(n)}))}))})).catch(t)}));return s(t,e),t}function Re(e,n){var t=this,r=new f((function(n,r){t.ready().then((function(){var o=t._dbInfo;o.db.transaction((function(t){_e(t,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,t){var r=t.rows.length?t.rows.item(0).key:null;n(r)}),(function(e,n){r(n)}))}))})).catch(r)}));return s(r,n),r}function Oe(e){var n=this,t=new f((function(e,t){n.ready().then((function(){var r=n._dbInfo;r.db.transaction((function(n){_e(n,r,"SELECT key FROM "+r.storeName,[],(function(n,t){for(var r=[],o=0;o '__WebKitDatabaseInfoTable__'",[],(function(t,r){for(var o=[],i=0;i0}function Fe(e){var n=this,t={};if(e)for(var r in e)t[r]=e[r];return t.keyPrefix=Ce(e,n._defaultConfig),ze()?(n._dbInfo=t,t.serializer=be,f.resolve()):f.reject()}function Le(e){var n=this,t=n.ready().then((function(){for(var e=n._dbInfo.keyPrefix,t=localStorage.length-1;t>=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}}));return s(t,e),t}function Pe(e,n){var t=this;e=d(e);var r=t.ready().then((function(){var n=t._dbInfo,r=localStorage.getItem(n.keyPrefix+e);return r&&(r=n.serializer.deserialize(r)),r}));return s(r,n),r}function Me(e,n){var t=this,r=t.ready().then((function(){for(var n=t._dbInfo,r=n.keyPrefix,o=r.length,i=localStorage.length,a=1,u=0;u=0;n--){var t=localStorage.key(n);0===t.indexOf(e)&&localStorage.removeItem(t)}})):f.reject("Invalid arguments"),s(r,n),r}var Xe={_driver:"localStorageWrapper",_initStorage:Fe,_support:Be(),iterate:Me,getItem:Pe,setItem:Ke,removeItem:He,clear:Le,length:qe,key:We,keys:Ue,dropInstance:Qe},Ge=function(e,n){return e===n||"number"===typeof e&&"number"===typeof n&&isNaN(e)&&isNaN(n)},Ve=function(e,n){for(var t=e.length,r=0;r{"use strict";t.d(n,{A:()=>_});var r=t(95265),o=t(64032),i=t(81084);const a=i.useLayoutEffect;var u=function(e,n){"function"!==typeof e?e.current=n:e(n)};const c=function(e,n){var t=(0,i.useRef)();return(0,i.useCallback)((function(r){e.current=r,t.current&&u(t.current,null),t.current=n,n&&u(n,r)}),[n])};var f={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},s=function(e){Object.keys(f).forEach((function(n){e.style.setProperty(n,f[n],"important")}))},l=null,d=function(e,n){var t=e.scrollHeight;return"border-box"===n.sizingStyle.boxSizing?t+n.borderSize:t-n.paddingSize};var v=function(){},h=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],p=!!document.documentElement.currentStyle,y=function(e){var n=window.getComputedStyle(e);if(null===n)return null;var t,r=(t=n,h.reduce((function(e,n){return e[n]=t[n],e}),{})),o=r.boxSizing;return""===o?null:(p&&"border-box"===o&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px"),{sizingStyle:r,paddingSize:parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),borderSize:parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth)})};function b(e,n,t){var r=function(e){var n=i.useRef(e);return a((function(){n.current=e})),n}(t);i.useLayoutEffect((function(){var t=function(e){return r.current(e)};if(e)return e.addEventListener(n,t),function(){return e.removeEventListener(n,t)}}),[])}var g=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],m=function(e,n){var t=e.cacheMeasurements,a=e.maxRows,u=e.minRows,f=e.onChange,h=void 0===f?v:f,p=e.onHeightChange,m=void 0===p?v:p,_=(0,o.A)(e,g),w=void 0!==_.value,S=i.useRef(null),I=c(S,n),E=i.useRef(0),N=i.useRef(),j=function(){var e=S.current,n=t&&N.current?N.current:y(e);if(n){N.current=n;var r=function(e,n,t,r){void 0===t&&(t=1),void 0===r&&(r=1/0),l||((l=document.createElement("textarea")).setAttribute("tabindex","-1"),l.setAttribute("aria-hidden","true"),s(l)),null===l.parentNode&&document.body.appendChild(l);var o=e.paddingSize,i=e.borderSize,a=e.sizingStyle,u=a.boxSizing;Object.keys(a).forEach((function(e){var n=e;l.style[n]=a[n]})),s(l),l.value=n;var c=d(l,e);l.value=n,c=d(l,e),l.value="x";var f=l.scrollHeight-o,v=f*t;"border-box"===u&&(v=v+o+i),c=Math.max(v,c);var h=f*r;return"border-box"===u&&(h=h+o+i),[c=Math.min(h,c),f]}(n,e.value||e.placeholder||"x",u,a),o=r[0],i=r[1];E.current!==o&&(E.current=o,e.style.setProperty("height",o+"px","important"),m(o,{rowHeight:i}))}};return i.useLayoutEffect(j),b(window,"resize",j),function(e){b(document.fonts,"loadingdone",e)}(j),i.createElement("textarea",(0,r.A)({},_,{onChange:function(e){w||j(),h(e)},ref:I}))},_=i.forwardRef(m)},95265:(e,n,t)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var n=1;nr})},64032:(e,n,t)=>{"use strict";function r(e,n){if(null==e)return{};var t={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(n.indexOf(r)>=0)continue;t[r]=e[r]}return t}t.d(n,{A:()=>r})}}]); \ No newline at end of file diff --git a/static/js/227.4245e14f.chunk.js.LICENSE.txt b/static/js/227.0c4a9b19.chunk.js.LICENSE.txt similarity index 100% rename from static/js/227.4245e14f.chunk.js.LICENSE.txt rename to static/js/227.0c4a9b19.chunk.js.LICENSE.txt diff --git a/static/js/911.85085ca5.chunk.js b/static/js/911.37412f4d.chunk.js similarity index 90% rename from static/js/911.85085ca5.chunk.js rename to static/js/911.37412f4d.chunk.js index 84e7bf139..3127ea489 100644 --- a/static/js/911.85085ca5.chunk.js +++ b/static/js/911.37412f4d.chunk.js @@ -1 +1 @@ -"use strict";(globalThis.webpackChunkvocechat_web=globalThis.webpackChunkvocechat_web||[]).push([[911],{37822:(e,t,s)=>{s.d(t,{A:()=>l});var a,r=s(81084);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;tr.createElement("svg",n({width:24,height:24,viewBox:"0 0 24 24",fill:"#70707B",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":t},s),e?r.createElement("title",{id:t},e):null,a||(a=r.createElement("path",{d:"M8.79053 19.3376C10.0779 20.3775 11.7161 21.0002 13.4999 21.0002C14.6315 21.0002 15.7064 20.7491 16.6701 20.299L20.1027 20.9856C20.3486 21.0348 20.6029 20.9579 20.7802 20.7806C20.9575 20.6032 21.0345 20.349 20.9853 20.1031L20.2988 16.6702C20.7488 15.7065 20.9999 14.6318 20.9999 13.5002C20.9999 11.7168 20.3774 10.0788 19.338 8.79163C19.4443 9.3448 19.4999 9.91599 19.4999 10.5002C19.4999 11.0652 19.4479 11.618 19.3483 12.1541C19.4475 12.5868 19.4999 13.0374 19.4999 13.5002C19.4999 14.4837 19.2638 15.41 18.8458 16.2274C18.7689 16.3779 18.745 16.5501 18.7782 16.7159L19.2938 19.2941L16.7159 18.7784C16.55 18.7452 16.3778 18.7691 16.2273 18.8461C15.4098 19.2641 14.4835 19.5002 13.4999 19.5002C13.037 19.5002 12.5864 19.4478 12.1537 19.3486C11.6176 19.4481 11.0648 19.5002 10.4999 19.5002C9.91613 19.5002 9.34454 19.4443 8.79053 19.3376ZM10.5 3C6.35788 3 3.00001 6.35786 3.00001 10.5C3.00001 11.6316 3.2511 12.7064 3.70112 13.6701L3.01458 17.103C2.9654 17.3489 3.04237 17.6031 3.2197 17.7804C3.39702 17.9577 3.65123 18.0347 3.89713 17.9855L7.32974 17.2988C8.29349 17.7489 9.36836 18 10.5 18C14.6421 18 18 14.6421 18 10.5C18 6.35786 14.6421 3 10.5 3Z"}))),l=(0,r.forwardRef)(i)},68416:(e,t,s)=>{s.d(t,{A:()=>l});var a,r=s(81084);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;tr.createElement("svg",n({width:16,height:16,viewBox:"0 0 16 16",fill:"#344054",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":t},s),e?r.createElement("title",{id:t},e):null,a||(a=r.createElement("path",{d:"M2.2672 6.15302C2.52892 5.34708 2.96005 4.60729 3.52891 3.98033C3.62511 3.87431 3.77603 3.83652 3.91115 3.88463L5.27062 4.36863C5.6392 4.49978 6.04476 4.30859 6.17647 3.9416C6.18942 3.90551 6.1994 3.86844 6.20629 3.8308L6.46529 2.41527C6.49104 2.27452 6.5996 2.1632 6.74013 2.13341C7.1513 2.04627 7.57289 2.00195 8 2.00195C8.42685 2.00195 8.84818 2.04621 9.25912 2.13325C9.39961 2.16301 9.50816 2.27427 9.53397 2.41496L9.7937 3.83074C9.86392 4.21413 10.233 4.46825 10.618 4.39833C10.6559 4.39146 10.6931 4.38153 10.7293 4.36865L12.0888 3.88463C12.224 3.83652 12.3749 3.87431 12.4711 3.98033C13.04 4.60729 13.4711 5.34708 13.7328 6.15302C13.777 6.28899 13.7344 6.43805 13.625 6.53053L12.5231 7.46205C12.2247 7.7143 12.1882 8.1596 12.4416 8.45667C12.4665 8.48589 12.4937 8.51303 12.5231 8.53782L13.625 9.46935C13.7344 9.56183 13.777 9.71089 13.7328 9.84685C13.4711 10.6528 13.04 11.3926 12.4711 12.0196C12.3749 12.1256 12.224 12.1634 12.0888 12.1153L10.7294 11.6312C10.3608 11.5001 9.95524 11.6913 9.82353 12.0583C9.81058 12.0944 9.8006 12.1314 9.79368 12.1692L9.53397 13.5849C9.50816 13.7256 9.39961 13.8369 9.25912 13.8666C8.84818 13.9537 8.42685 13.9979 8 13.9979C7.57289 13.9979 7.1513 13.9536 6.74013 13.8665C6.5996 13.8367 6.49104 13.7254 6.46529 13.5846L6.2063 12.1691C6.13608 11.7857 5.76701 11.5316 5.38196 11.6015C5.3441 11.6084 5.30687 11.6184 5.27068 11.6312L3.91115 12.1153C3.77603 12.1634 3.62511 12.1256 3.52891 12.0196C2.96005 11.3926 2.52892 10.6528 2.2672 9.84685C2.22305 9.71089 2.26562 9.56183 2.37502 9.46935L3.47693 8.53783C3.77528 8.28558 3.81177 7.84027 3.55843 7.5432C3.53352 7.51399 3.50626 7.48685 3.47694 7.46206L2.37502 6.53053C2.26562 6.43805 2.22305 6.28899 2.2672 6.15302ZM6.24988 7.99988C6.24988 8.96638 7.03338 9.74988 7.99988 9.74988C8.96638 9.74988 9.74988 8.96638 9.74988 7.99988C9.74988 7.03338 8.96638 6.24988 7.99988 6.24988C7.03338 6.24988 6.24988 7.03338 6.24988 7.99988Z"}))),l=(0,r.forwardRef)(i)},52053:(e,t,s)=>{s.d(t,{A:()=>l});var a,r=s(81084);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;tr.createElement("svg",n({width:24,height:24,viewBox:"0 0 24 24",fill:"#70707B",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":t},s),e?r.createElement("title",{id:t},e):null,a||(a=r.createElement("path",{d:"M17.7541 13.9999C18.9961 13.9999 20.0029 15.0068 20.0029 16.2488V17.1673C20.0029 17.7406 19.8237 18.2997 19.4903 18.7662C17.9445 20.9294 15.4202 22.0011 11.9999 22.0011C8.57891 22.0011 6.05595 20.9289 4.51379 18.7646C4.18182 18.2987 4.00342 17.7409 4.00342 17.1688V16.2488C4.00342 15.0068 5.01027 13.9999 6.25229 13.9999H17.7541ZM11.9999 2.00464C14.7613 2.00464 16.9999 4.24321 16.9999 7.00464C16.9999 9.76606 14.7613 12.0046 11.9999 12.0046C9.23845 12.0046 6.99988 9.76606 6.99988 7.00464C6.99988 4.24321 9.23845 2.00464 11.9999 2.00464Z"}))),l=(0,r.forwardRef)(i)},98916:(e,t,s)=>{s.d(t,{A:()=>u});s(81084);var a=s(76644),r=s(80772),n=s(45774),i=s(37822),l=s(68416),c=s(52053),o=s(80724),d=s(52205),m=s(99264);const u=()=>{const e=(0,a.RQ)("/"),{pathname:t}=(0,a.zy)(),s=(0,a.RQ)("/chat"),u=(0,a.RQ)("/chat/dm/:user_id"),h=(0,a.RQ)("/chat/channel/:channel_id"),{chat:g,user:f}=(0,o.GV)((e=>e.ui.rememberedNavs),d.bN),v="flex",p=e||t.startsWith("/chat"),x=!!u||!!h,b=s?"/chat":g||"/chat",C=f||"/users";return(0,m.jsxs)("ul",{className:(0,n.A)("flex justify-around py-2 fixed bottom-0 left-0 w-full bg-gray-100 dark:bg-gray-800 md:hidden",x&&"hidden"),children:[(0,m.jsx)("li",{children:(0,m.jsx)(r.k2,{className:()=>`${v}`,to:b,children:({isActive:e})=>{const t=e||p;return(0,m.jsxs)("div",{className:"flex flex-col gap-1 items-center",children:[(0,m.jsx)(i.A,{className:t?"fill-primary-500":"fill-gray-500"}),(0,m.jsx)("span",{className:(0,n.A)("text-xs",t?"text-primary-500":"text-gray-500"),children:"Chats"})]})}})}),(0,m.jsx)("li",{children:(0,m.jsx)(r.k2,{className:()=>`${v}`,to:C,children:({isActive:e})=>(0,m.jsxs)("div",{className:"flex flex-col gap-1 items-center",children:[(0,m.jsx)(c.A,{className:e?"fill-primary-500":"fill-gray-500"}),(0,m.jsx)("span",{className:(0,n.A)("text-xs",e?"text-primary-500":"text-gray-500"),children:"Contacts"})]})})}),(0,m.jsx)("li",{children:(0,m.jsx)(r.k2,{className:()=>`${v}`,to:"/setting",children:({isActive:e})=>(0,m.jsxs)("div",{className:"flex flex-col gap-1 items-center",children:[(0,m.jsx)(l.A,{className:(0,n.A)("w-6 h-6",e?"fill-primary-500":"fill-gray-500")}),(0,m.jsx)("span",{className:(0,n.A)("text-xs",e?"text-primary-500":"text-gray-500"),children:"Settings"})]})})})]})}},46911:(e,t,s)=>{s.r(t),s.d(t,{default:()=>xe});var a=s(81084),r=s(43307),n=s(52205),i=s(76644),l=s(80772),c=s(859),o=s(80724),d=s(23894),m=s(45123);var u=s(31192),h=s(26521),g=s(32642),f=s(99264);const v=({handleInstall:e,closePrompt:t})=>{const{t:s}=(0,r.Bd)();return(0,f.jsx)(h.A,{mask:!1,children:(0,f.jsxs)("div",{className:"relative pointer-events-auto mt-4 w-[406px] p-4 rounded-md bg-white dark:bg-gray-900 shadow-md flex flex-col gap-3",children:[(0,f.jsx)(u.A,{className:"absolute top-4 right-4 cursor-pointer",onClick:t}),(0,f.jsxs)("div",{className:"flex flex-col gap-4 text-gray-600 dark:text-gray-300",children:[(0,f.jsx)("h2",{className:"font-semibold",children:s("tip.pwa_install_title")}),(0,f.jsx)("p",{className:"text-sm",children:s("tip.pwa_install_desc")})]}),(0,f.jsxs)("div",{className:"w-full flex justify-end gap-4",children:[(0,f.jsx)(g.A,{className:"ghost cancel small",onClick:t,children:s("action.cancel")}),(0,f.jsx)(g.A,{className:"main small",onClick:e,children:s("action.install")})]})]})})},p=()=>{const{setCanceled:e,prompted:t,setDeferredPrompt:s,showPrompt:r}=function(){const e=(0,a.useRef)(null),t=t=>{e.current=t};return(0,a.useEffect)((()=>{const e=e=>{e.preventDefault(),t(e)};return window.addEventListener("beforeinstallprompt",e,!0),()=>{window.removeEventListener("beforeinstallprompt",e,!0)}}),[]),{setCanceled:()=>{localStorage.setItem(m.sM,"true")},prompted:!!localStorage.getItem(m.sM),resetPrompt:()=>{localStorage.removeItem(m.sM),e.current=null},deferredPrompt:e.current,setDeferredPrompt:t,showPrompt:async()=>{if(!e.current)return;e.current.prompt();const{outcome:s}=await e.current.userChoice;t(null)}}}(),[n,i]=(0,a.useState)(!1);(0,a.useEffect)((()=>{const e=e=>{e.preventDefault(),s(e),i(!0)},t=()=>{s(null),i(!1)};return window.addEventListener("beforeinstallprompt",e,!0),window.addEventListener("appinstalled",t),()=>{window.removeEventListener("beforeinstallprompt",e,!0),window.removeEventListener("appinstalled",t)}}),[]);return!n||t?null:(0,f.jsx)(v,{handleInstall:async()=>{i(!1),await r()},closePrompt:async()=>{e(),i(!1)}})};var x=s(97282),b=s(45851);let C=!1,w=!1;const j=()=>{const e=(0,i.Zp)(),t=(0,b.A)(m.Er),[s]=(0,x.pz)();return(0,a.useEffect)((()=>{(async e=>{if(e&&!w&&!C)try{w=!0,await s(e),C=!0}catch{w=!1,C=!0}})(t)}),[t]),(0,a.useEffect)((()=>{var t;const s=t=>{const{newPath:s}=t.data;s&&document.hidden&&e(s)};return null===(t=navigator.serviceWorker)||void 0===t||t.addEventListener("message",s),()=>{var e;null===(e=navigator.serviceWorker)||void 0===e||e.removeEventListener("message",s)}}),[]),null},y=(0,a.memo)(j);var N=s(71017),A=s(50809),L=s(93335),E=s(55371);const k=({reasonType:e="role_changed"})=>{const t=(0,n.wA)(),{t:s}=(0,r.Bd)("auth"),{t:i}=(0,r.Bd)(),{logout:l,exited:c,exiting:o}=(0,L.A)();return(0,a.useEffect)((()=>{c&&N.Ay.success(i("tip.logout"))}),[c]),(0,f.jsx)(h.A,{id:"modal-modal",children:(0,f.jsx)(E.A,{buttons:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(g.A,{className:"cancel",onClick:()=>{t((0,A.yG)(!1))},children:s("logout.later")}),(0,f.jsx)(g.A,{onClick:()=>{l()},className:"danger",children:o?"Logging out":i("action.re_login")})]}),children:(0,f.jsx)("div",{className:"text-sm text-gray-400 flex justify-end items-center",children:s(`logout.${e}`)})})})};var V=s(58111),M=s(29734);let G=0,I="";const D=()=>{const e=(0,o.GV)((e=>{var t,s;return null!==(t=null===(s=e.authData.user)||void 0===s?void 0:s.uid)&&void 0!==t?t:0}),n.bN),t=(0,o.GV)((e=>e.footprint.muteChannels),n.bN),s=(0,o.GV)((e=>e.footprint.muteUsers),n.bN),r=(0,o.GV)((e=>e.footprint.readChannels),n.bN),i=(0,o.GV)((e=>e.footprint.readUsers),n.bN),l=(0,o.GV)((e=>e.users.byId),n.bN),c=(0,o.GV)((e=>e.userMessage.byId),n.bN),d=(0,o.GV)((e=>e.channelMessage),n.bN),m=(0,o.GV)((e=>e.message),n.bN);return(0,a.useEffect)((()=>{if(0===e)return void(I&&(document.title=I));G=0,Object.entries(c).forEach((([t,a])=>{if(!s[+t]&&l[+t]){const{unreads:s=0}=(0,M.Ay)({mids:a,readIndex:i[+t],messageData:m,loginUid:e});G+=s}})),Object.entries(d).map((([s,a])=>{if(!t[+s]){const{unreads:t=0}=(0,M.Ay)({mids:a,readIndex:r[+s],messageData:m,loginUid:e});G+=t}}));const a=()=>{document.hidden,document.hidden?(I=document.title,G>0&&(document.title=`[${G}]-${I}`)):document.title=I};return document.addEventListener("visibilitychange",a),document.hidden&&G>0&&(document.title=`[${G}]-${I}`),()=>{document.removeEventListener("visibilitychange",a)}}),[l,c,d,r,m,e,i,t,s]),null};var $=s(47789),_=s(32664),S=s.n(_),O=s(32787),P=s(77009),R=s(99609),B=s(13050),H=s(4206),Z=s(94939),T=s(908),Q=s(43737),U=s(34441),z=s(82018),F=s(67697);const W=()=>{const[e,t]=(0,a.useState)(!1),s=(0,n.wA)();return{rehydrate:async()=>{const e={channels:[],users:[],fileMessage:{},channelMessage:{},userMessage:{},reactionMessage:{},message:{replying:{}},footprint:{},ui:{},server:{}};if(!window.CACHE)return void t(!0);const a=Object.keys(window.CACHE);await Promise.all(a.map((t=>{var s;return null===(s=window.CACHE[t])||void 0===s?void 0:s.iterate(((s,a)=>{switch(t){case"channels":s&&e.channels.push(s);break;case"users":s&&e.users.push(s);break;case"footprint":e.footprint[a]=s;break;case"ui":e.ui[a]=s;break;case"messageChannel":e.channelMessage[a]=s;break;case"messageFile":e.fileMessage[a]=s||[];break;case"messageDM":e.userMessage[a]=s;break;case"messageReaction":e.reactionMessage[a]=s;break;case"message":e.message[a]=s;break;case"server":e.server[a]=s}}))}))),s((0,F.yi)(e.users)),s((0,z.Ts)(e.server)),s((0,R.I9)(e.channels)),s((0,T.fl)(e.fileMessage.list)),s((0,Z.oT)(e.channelMessage)),s((0,U.Ur)(e.userMessage)),s((0,H.fu)(e.message)),s((0,B.hh)(e.footprint)),s((0,c.eV)(e.ui)),s((0,Q.Is)(e.reactionMessage)),t(!0)},rehydrated:e}};(0,P.extendPrototype)(O);const q=[{storeName:"channels",description:"store channel list"},{storeName:"users",description:"store user list"},{storeName:"messageDM",description:"store DM message with IDs"},{storeName:"messageChannel",description:"store channel message with IDs"},{storeName:"message",description:"store message with key-val full data"},{storeName:"messageFile",description:"store file message list"},{storeName:"messageArchive",description:"store archive message"},{storeName:"messageReaction",description:"store message reaction with key-val full data"},{storeName:"footprint",description:"store user visit data"},{storeName:"server",description:"store server data"},{storeName:"ui",description:"store UI state"}],J=()=>{const e=localStorage.getItem(m.n9)||"";if(!e)return;const t=`local_db_${e}_v_${m.yL.split(".").join("_")}`;window.CACHE={},q.forEach((({storeName:e,description:s})=>{window.CACHE[e]=O.createInstance({name:t,storeName:e,description:s})}))};var Y=s(54697),K=s(13631),X=s(25303),ee=s(85666),te=s(60890);let se=!1;var ae,re=s(42716),ne=s(37822);function ie(){return ie=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.createElement("svg",ie({width:24,height:24,viewBox:"0 0 24 24",fill:"#70707B",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t},s),e?a.createElement("title",{id:t},e):null,ae||(ae=a.createElement("path",{d:"M13.821 6.5H19.75C20.8867 6.5 21.8266 7.34297 21.9785 8.43788L21.9948 8.59595L22 8.75V17.75C22 18.9409 21.0748 19.9156 19.904 19.9948L19.75 20H4.25C3.05914 20 2.08436 19.0748 2.00519 17.904L2 17.75V10.499L8.20693 10.5L8.40335 10.4914C8.79396 10.4572 9.16896 10.3214 9.49094 10.0977L9.64734 9.9785L13.821 6.5ZM8.20693 4C8.66749 4 9.1153 4.14129 9.49094 4.40235L9.64734 4.5215L11.75 6.273L8.68706 8.82617L8.60221 8.88738C8.51363 8.94232 8.41452 8.9782 8.31129 8.9927L8.20693 9L2 8.999V6.25C2 5.05914 2.92516 4.08436 4.09595 4.00519L4.25 4H8.20693Z"}))),ce=(0,a.forwardRef)(le);var oe=s(52053),de=s(68416);const me=()=>{const{pathname:e}=(0,i.zy)();return(0,f.jsx)("ul",{className:"flex flex-col absolute left-0 bottom-0 w-full px-3 py-2",children:(0,f.jsx)("li",{className:"cursor-pointer flex items-center p-2.5 gap-2.5 link_navs",children:(0,f.jsx)(l.k2,{className:"link",to:`/setting/overview?f=${e}`,children:(0,f.jsx)(V.A,{placement:"right",tip:"Settings",children:(0,f.jsx)(de.A,{className:"w-6 h-6 dark:fill-gray-400"})})})})})};var ue=s(98916),he=s(47003);const ge=({uid:e})=>{const{pathname:t}=(0,i.zy)(),s=(0,o.GV)((t=>t.users.byId[e]),n.bN);return s?(0,f.jsx)("div",{className:"px-3 py-2.5 invisible md:visible",children:(0,f.jsx)(l.k2,{to:`/setting/my_account?f=${t}`,children:(0,f.jsx)("div",{className:"w-8 h-8",children:(0,f.jsx)(he.A,{className:" object-cover w-full h-full rounded-full",width:32,height:32,src:s.avatar,name:s.name})})})}):null};var fe=s(45774);const ve=()=>{const e=(0,o.GV)((e=>e.ui.SSEStatus),n.bN);return(0,f.jsx)("aside",{className:"fixed right-2 bottom-2",children:(0,f.jsx)("div",{className:(0,fe.A)("w-1 h-1 rounded-full","connected"===e&&"bg-green-500","disconnected"===e&&"bg-red-500","reconnecting"===e&&"bg-blue-500","connecting"===e&&"bg-yellow-500")})})};function pe(){const{t:e}=(0,r.Bd)(),t=(0,n.wA)(),s=(0,i.RQ)("/"),m=(0,i.RQ)("/chat"),{pathname:u}=(0,i.zy)(),h=(0,o.GV)((e=>e.authData.roleChanged),n.bN),g=(0,o.GV)((e=>e.authData.guest),n.bN),v=(0,o.GV)((e=>{var t,s;return null!==(t=null===(s=e.authData.user)||void 0===s?void 0:s.uid)&&void 0!==t?t:0}),n.bN),{chat:x,user:b}=(0,o.GV)((e=>e.ui.rememberedNavs),n.bN),{success:C}=function(){const{isLoading:e}=(0,ee.A)(!1),[t]=(0,Y.V0)(),{rehydrate:s,rehydrated:r}=W(),i=(0,o.GV)((e=>e.ui.ready),n.bN),l=(0,o.GV)((e=>{var t;return null===(t=e.authData.user)||void 0===t?void 0:t.uid}),n.bN),c=(0,o.GV)((e=>e.server.contact_verification_enable),n.bN),d=(0,o.GV)((e=>{var t;return null!==(t=e.authData.expireTime)&&void 0!==t?t:+new Date}),n.bN),m=(0,o.GV)((e=>e.channels.ids),n.bN),u=(0,o.GV)((e=>e.authData.token),n.bN),h=(0,o.GV)((e=>e.authData.guest),n.bN),g=(0,o.GV)((e=>e.channelMessage),n.bN),{startStreaming:f,stopStreaming:v}=(0,te.A)(),[p,{isLoading:x,isSuccess:b,isError:C,data:w}]=(0,Y.JY)(),[j,{isLoading:y,isSuccess:N,isError:A,data:L}]=(0,X.Ii)(),[E,{data:k}]=(0,X.F2)(),[V,{data:M,isSuccess:G,isLoading:I}]=(0,K.hC)(),[D]=(0,K.qp)();(0,a.useEffect)((()=>{J(),s(),V()}),[]),(0,a.useEffect)((()=>{h&&m.length>0&&!se&&(m.filter((e=>!g[e])).forEach((e=>{e&&t({id:e,limit:50})})),se=!0)}),[m,g,h]),(0,a.useEffect)((()=>{r&&M&&(j().then((()=>{h||E()})),p(),D())}),[r,M,h]);const $=S()().isAfter(new Date(d-2e4)),_=!!l&&r&&!!u&&!$&&!i;return(0,a.useEffect)((()=>{_&&(v(),setTimeout((()=>{f()}),100))}),[_]),{loading:y||x||!r||e||I,error:A&&C,success:N&&b&&G,data:{users:c?k:L,favorites:w}}}();if((0,a.useEffect)((()=>{m&&t((0,c.u2)({key:"chat",path:"/chat"}))}),[m]),console.info("preload success",C),!C)return(0,f.jsx)(d.A,{reload:!0,fullscreen:!0,context:"home-route"});const w=u.startsWith("/setting"),j=s||u.startsWith("/chat");if(w)return(0,f.jsx)(i.sv,{});const N=m?"/chat":x||"/chat",A=b||"/users",L="flex items-center gap-2.5 px-3 py-2 font-semibold text-sm text-gray-600 rounded-lg md:hover:bg-gray-800/10";return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ve,{}),h&&(0,f.jsx)(k,{}),!g&&(0,f.jsx)(D,{}),!g&&(0,f.jsx)($.A,{}),(0,f.jsx)(p,{}),!g&&(0,f.jsx)(y,{}),(0,f.jsxs)("div",{className:"vocechat-container flex w-screen h-screen bg-neutral-100 dark:bg-neutral-900",children:[!g&&(0,f.jsxs)("div",{className:"hidden md:flex h-full flex-col items-center relative w-16 transition-all",children:[v&&(0,f.jsx)(ge,{uid:v}),(0,f.jsxs)("nav",{className:"flex flex-col gap-1 px-3 py-6",children:[(0,f.jsx)(l.k2,{className:({isActive:e})=>`${L} ${e||j?"bg-primary-400 md:hover:bg-primary-400":""}`,to:N,children:({isActive:t})=>(0,f.jsx)(V.A,{tip:e("chat"),children:(0,f.jsx)(ne.A,{className:t||j?"fill-white":""})})}),(0,f.jsx)(l.k2,{className:({isActive:e})=>`${L} ${e?"bg-primary-400 md:hover:bg-primary-400":""}`,to:A,children:({isActive:t})=>(0,f.jsx)(V.A,{tip:e("members"),children:(0,f.jsx)(oe.A,{className:t?"fill-white":""})})}),(0,f.jsx)(l.k2,{className:({isActive:e})=>`${L} ${e?"bg-primary-400 md:hover:bg-primary-400":""}`,to:"/favs",children:({isActive:t})=>(0,f.jsx)(V.A,{tip:e("favs"),children:(0,f.jsx)(re.A,{className:t?"fill-white":""})})}),(0,f.jsx)(l.k2,{className:({isActive:e})=>`${L} ${e?"bg-primary-400 md:hover:bg-primary-400":""}`,to:"/files",children:({isActive:t})=>(0,f.jsx)(V.A,{tip:e("files"),children:(0,f.jsx)(ce,{className:t?"fill-white":""})})})]}),(0,f.jsx)(me,{})]}),(0,f.jsx)("div",{className:"h-full flex flex-col w-full",children:(0,f.jsx)(i.sv,{})})]}),!g&&(0,f.jsx)(ue.A,{})]})}const xe=(0,a.memo)(pe)}}]); \ No newline at end of file +"use strict";(globalThis.webpackChunkvocechat_web=globalThis.webpackChunkvocechat_web||[]).push([[911],{37822:(e,t,s)=>{s.d(t,{A:()=>l});var a,r=s(81084);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;tr.createElement("svg",n({width:24,height:24,viewBox:"0 0 24 24",fill:"#70707B",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":t},s),e?r.createElement("title",{id:t},e):null,a||(a=r.createElement("path",{d:"M8.79053 19.3376C10.0779 20.3775 11.7161 21.0002 13.4999 21.0002C14.6315 21.0002 15.7064 20.7491 16.6701 20.299L20.1027 20.9856C20.3486 21.0348 20.6029 20.9579 20.7802 20.7806C20.9575 20.6032 21.0345 20.349 20.9853 20.1031L20.2988 16.6702C20.7488 15.7065 20.9999 14.6318 20.9999 13.5002C20.9999 11.7168 20.3774 10.0788 19.338 8.79163C19.4443 9.3448 19.4999 9.91599 19.4999 10.5002C19.4999 11.0652 19.4479 11.618 19.3483 12.1541C19.4475 12.5868 19.4999 13.0374 19.4999 13.5002C19.4999 14.4837 19.2638 15.41 18.8458 16.2274C18.7689 16.3779 18.745 16.5501 18.7782 16.7159L19.2938 19.2941L16.7159 18.7784C16.55 18.7452 16.3778 18.7691 16.2273 18.8461C15.4098 19.2641 14.4835 19.5002 13.4999 19.5002C13.037 19.5002 12.5864 19.4478 12.1537 19.3486C11.6176 19.4481 11.0648 19.5002 10.4999 19.5002C9.91613 19.5002 9.34454 19.4443 8.79053 19.3376ZM10.5 3C6.35788 3 3.00001 6.35786 3.00001 10.5C3.00001 11.6316 3.2511 12.7064 3.70112 13.6701L3.01458 17.103C2.9654 17.3489 3.04237 17.6031 3.2197 17.7804C3.39702 17.9577 3.65123 18.0347 3.89713 17.9855L7.32974 17.2988C8.29349 17.7489 9.36836 18 10.5 18C14.6421 18 18 14.6421 18 10.5C18 6.35786 14.6421 3 10.5 3Z"}))),l=(0,r.forwardRef)(i)},68416:(e,t,s)=>{s.d(t,{A:()=>l});var a,r=s(81084);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;tr.createElement("svg",n({width:16,height:16,viewBox:"0 0 16 16",fill:"#344054",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":t},s),e?r.createElement("title",{id:t},e):null,a||(a=r.createElement("path",{d:"M2.2672 6.15302C2.52892 5.34708 2.96005 4.60729 3.52891 3.98033C3.62511 3.87431 3.77603 3.83652 3.91115 3.88463L5.27062 4.36863C5.6392 4.49978 6.04476 4.30859 6.17647 3.9416C6.18942 3.90551 6.1994 3.86844 6.20629 3.8308L6.46529 2.41527C6.49104 2.27452 6.5996 2.1632 6.74013 2.13341C7.1513 2.04627 7.57289 2.00195 8 2.00195C8.42685 2.00195 8.84818 2.04621 9.25912 2.13325C9.39961 2.16301 9.50816 2.27427 9.53397 2.41496L9.7937 3.83074C9.86392 4.21413 10.233 4.46825 10.618 4.39833C10.6559 4.39146 10.6931 4.38153 10.7293 4.36865L12.0888 3.88463C12.224 3.83652 12.3749 3.87431 12.4711 3.98033C13.04 4.60729 13.4711 5.34708 13.7328 6.15302C13.777 6.28899 13.7344 6.43805 13.625 6.53053L12.5231 7.46205C12.2247 7.7143 12.1882 8.1596 12.4416 8.45667C12.4665 8.48589 12.4937 8.51303 12.5231 8.53782L13.625 9.46935C13.7344 9.56183 13.777 9.71089 13.7328 9.84685C13.4711 10.6528 13.04 11.3926 12.4711 12.0196C12.3749 12.1256 12.224 12.1634 12.0888 12.1153L10.7294 11.6312C10.3608 11.5001 9.95524 11.6913 9.82353 12.0583C9.81058 12.0944 9.8006 12.1314 9.79368 12.1692L9.53397 13.5849C9.50816 13.7256 9.39961 13.8369 9.25912 13.8666C8.84818 13.9537 8.42685 13.9979 8 13.9979C7.57289 13.9979 7.1513 13.9536 6.74013 13.8665C6.5996 13.8367 6.49104 13.7254 6.46529 13.5846L6.2063 12.1691C6.13608 11.7857 5.76701 11.5316 5.38196 11.6015C5.3441 11.6084 5.30687 11.6184 5.27068 11.6312L3.91115 12.1153C3.77603 12.1634 3.62511 12.1256 3.52891 12.0196C2.96005 11.3926 2.52892 10.6528 2.2672 9.84685C2.22305 9.71089 2.26562 9.56183 2.37502 9.46935L3.47693 8.53783C3.77528 8.28558 3.81177 7.84027 3.55843 7.5432C3.53352 7.51399 3.50626 7.48685 3.47694 7.46206L2.37502 6.53053C2.26562 6.43805 2.22305 6.28899 2.2672 6.15302ZM6.24988 7.99988C6.24988 8.96638 7.03338 9.74988 7.99988 9.74988C8.96638 9.74988 9.74988 8.96638 9.74988 7.99988C9.74988 7.03338 8.96638 6.24988 7.99988 6.24988C7.03338 6.24988 6.24988 7.03338 6.24988 7.99988Z"}))),l=(0,r.forwardRef)(i)},52053:(e,t,s)=>{s.d(t,{A:()=>l});var a,r=s(81084);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;tr.createElement("svg",n({width:24,height:24,viewBox:"0 0 24 24",fill:"#70707B",xmlns:"http://www.w3.org/2000/svg",ref:i,"aria-labelledby":t},s),e?r.createElement("title",{id:t},e):null,a||(a=r.createElement("path",{d:"M17.7541 13.9999C18.9961 13.9999 20.0029 15.0068 20.0029 16.2488V17.1673C20.0029 17.7406 19.8237 18.2997 19.4903 18.7662C17.9445 20.9294 15.4202 22.0011 11.9999 22.0011C8.57891 22.0011 6.05595 20.9289 4.51379 18.7646C4.18182 18.2987 4.00342 17.7409 4.00342 17.1688V16.2488C4.00342 15.0068 5.01027 13.9999 6.25229 13.9999H17.7541ZM11.9999 2.00464C14.7613 2.00464 16.9999 4.24321 16.9999 7.00464C16.9999 9.76606 14.7613 12.0046 11.9999 12.0046C9.23845 12.0046 6.99988 9.76606 6.99988 7.00464C6.99988 4.24321 9.23845 2.00464 11.9999 2.00464Z"}))),l=(0,r.forwardRef)(i)},98916:(e,t,s)=>{s.d(t,{A:()=>u});s(81084);var a=s(76644),r=s(80772),n=s(45774),i=s(37822),l=s(68416),c=s(52053),o=s(80724),d=s(52205),m=s(99264);const u=()=>{const e=(0,a.RQ)("/"),{pathname:t}=(0,a.zy)(),s=(0,a.RQ)("/chat"),u=(0,a.RQ)("/chat/dm/:user_id"),h=(0,a.RQ)("/chat/channel/:channel_id"),{chat:g,user:f}=(0,o.GV)((e=>e.ui.rememberedNavs),d.bN),v="flex",p=e||t.startsWith("/chat"),x=!!u||!!h,b=s?"/chat":g||"/chat",C=f||"/users";return(0,m.jsxs)("ul",{className:(0,n.A)("flex justify-around py-2 fixed bottom-0 left-0 w-full bg-gray-100 dark:bg-gray-800 md:hidden",x&&"hidden"),children:[(0,m.jsx)("li",{children:(0,m.jsx)(r.k2,{className:()=>`${v}`,to:b,children:({isActive:e})=>{const t=e||p;return(0,m.jsxs)("div",{className:"flex flex-col gap-1 items-center",children:[(0,m.jsx)(i.A,{className:t?"fill-primary-500":"fill-gray-500"}),(0,m.jsx)("span",{className:(0,n.A)("text-xs",t?"text-primary-500":"text-gray-500"),children:"Chats"})]})}})}),(0,m.jsx)("li",{children:(0,m.jsx)(r.k2,{className:()=>`${v}`,to:C,children:({isActive:e})=>(0,m.jsxs)("div",{className:"flex flex-col gap-1 items-center",children:[(0,m.jsx)(c.A,{className:e?"fill-primary-500":"fill-gray-500"}),(0,m.jsx)("span",{className:(0,n.A)("text-xs",e?"text-primary-500":"text-gray-500"),children:"Contacts"})]})})}),(0,m.jsx)("li",{children:(0,m.jsx)(r.k2,{className:()=>`${v}`,to:"/setting",children:({isActive:e})=>(0,m.jsxs)("div",{className:"flex flex-col gap-1 items-center",children:[(0,m.jsx)(l.A,{className:(0,n.A)("w-6 h-6",e?"fill-primary-500":"fill-gray-500")}),(0,m.jsx)("span",{className:(0,n.A)("text-xs",e?"text-primary-500":"text-gray-500"),children:"Settings"})]})})})]})}},46911:(e,t,s)=>{s.r(t),s.d(t,{default:()=>xe});var a=s(81084),r=s(43307),n=s(52205),i=s(76644),l=s(80772),c=s(859),o=s(80724),d=s(23894),m=s(45123);var u=s(31192),h=s(26521),g=s(32642),f=s(99264);const v=({handleInstall:e,closePrompt:t})=>{const{t:s}=(0,r.Bd)();return(0,f.jsx)(h.A,{mask:!1,children:(0,f.jsxs)("div",{className:"relative pointer-events-auto mt-4 w-[406px] p-4 rounded-md bg-white dark:bg-gray-900 shadow-md flex flex-col gap-3",children:[(0,f.jsx)(u.A,{className:"absolute top-4 right-4 cursor-pointer",onClick:t}),(0,f.jsxs)("div",{className:"flex flex-col gap-4 text-gray-600 dark:text-gray-300",children:[(0,f.jsx)("h2",{className:"font-semibold",children:s("tip.pwa_install_title")}),(0,f.jsx)("p",{className:"text-sm",children:s("tip.pwa_install_desc")})]}),(0,f.jsxs)("div",{className:"w-full flex justify-end gap-4",children:[(0,f.jsx)(g.A,{className:"ghost cancel small",onClick:t,children:s("action.cancel")}),(0,f.jsx)(g.A,{className:"main small",onClick:e,children:s("action.install")})]})]})})},p=()=>{const{setCanceled:e,prompted:t,setDeferredPrompt:s,showPrompt:r}=function(){const e=(0,a.useRef)(null),t=t=>{e.current=t};return(0,a.useEffect)((()=>{const e=e=>{e.preventDefault(),t(e)};return window.addEventListener("beforeinstallprompt",e,!0),()=>{window.removeEventListener("beforeinstallprompt",e,!0)}}),[]),{setCanceled:()=>{localStorage.setItem(m.sM,"true")},prompted:!!localStorage.getItem(m.sM),resetPrompt:()=>{localStorage.removeItem(m.sM),e.current=null},deferredPrompt:e.current,setDeferredPrompt:t,showPrompt:async()=>{if(!e.current)return;e.current.prompt();const{outcome:s}=await e.current.userChoice;t(null)}}}(),[n,i]=(0,a.useState)(!1);(0,a.useEffect)((()=>{const e=e=>{e.preventDefault(),s(e),i(!0)},t=()=>{s(null),i(!1)};return window.addEventListener("beforeinstallprompt",e,!0),window.addEventListener("appinstalled",t),()=>{window.removeEventListener("beforeinstallprompt",e,!0),window.removeEventListener("appinstalled",t)}}),[]);return!n||t?null:(0,f.jsx)(v,{handleInstall:async()=>{i(!1),await r()},closePrompt:async()=>{e(),i(!1)}})};var x=s(97282),b=s(45851);let C=!1,w=!1;const j=()=>{const e=(0,i.Zp)(),t=(0,b.A)(m.Er),[s]=(0,x.pz)();return(0,a.useEffect)((()=>{(async e=>{if(e&&!w&&!C)try{w=!0,await s(e),C=!0}catch{w=!1,C=!0}})(t)}),[t]),(0,a.useEffect)((()=>{var t;const s=t=>{const{newPath:s}=t.data;s&&document.hidden&&e(s)};return null===(t=navigator.serviceWorker)||void 0===t||t.addEventListener("message",s),()=>{var e;null===(e=navigator.serviceWorker)||void 0===e||e.removeEventListener("message",s)}}),[]),null},y=(0,a.memo)(j);var N=s(71017),A=s(50809),L=s(93335),E=s(55371);const k=({reasonType:e="role_changed"})=>{const t=(0,n.wA)(),{t:s}=(0,r.Bd)("auth"),{t:i}=(0,r.Bd)(),{logout:l,exited:c,exiting:o}=(0,L.A)();return(0,a.useEffect)((()=>{c&&N.Ay.success(i("tip.logout"))}),[c]),(0,f.jsx)(h.A,{id:"modal-modal",children:(0,f.jsx)(E.A,{buttons:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(g.A,{className:"cancel",onClick:()=>{t((0,A.yG)(!1))},children:s("logout.later")}),(0,f.jsx)(g.A,{onClick:()=>{l()},className:"danger",children:o?"Logging out":i("action.re_login")})]}),children:(0,f.jsx)("div",{className:"text-sm text-gray-400 flex justify-end items-center",children:s(`logout.${e}`)})})})};var V=s(58111),M=s(29734);let G=0,I="";const D=()=>{const e=(0,o.GV)((e=>{var t,s;return null!==(t=null===(s=e.authData.user)||void 0===s?void 0:s.uid)&&void 0!==t?t:0}),n.bN),t=(0,o.GV)((e=>e.footprint.muteChannels),n.bN),s=(0,o.GV)((e=>e.footprint.muteUsers),n.bN),r=(0,o.GV)((e=>e.footprint.readChannels),n.bN),i=(0,o.GV)((e=>e.footprint.readUsers),n.bN),l=(0,o.GV)((e=>e.users.byId),n.bN),c=(0,o.GV)((e=>e.userMessage.byId),n.bN),d=(0,o.GV)((e=>e.channelMessage),n.bN),m=(0,o.GV)((e=>e.message),n.bN);return(0,a.useEffect)((()=>{if(0===e)return void(I&&(document.title=I));G=0,Object.entries(c).forEach((([t,a])=>{if(!s[+t]&&l[+t]){const{unreads:s=0}=(0,M.Ay)({mids:a,readIndex:i[+t],messageData:m,loginUid:e});G+=s}})),Object.entries(d).map((([s,a])=>{if(!t[+s]){const{unreads:t=0}=(0,M.Ay)({mids:a,readIndex:r[+s],messageData:m,loginUid:e});G+=t}}));const a=()=>{document.hidden,document.hidden?(I=document.title,G>0&&(document.title=`[${G}]-${I}`)):document.title=I};return document.addEventListener("visibilitychange",a),document.hidden&&G>0&&(document.title=`[${G}]-${I}`),()=>{document.removeEventListener("visibilitychange",a)}}),[l,c,d,r,m,e,i,t,s]),null};var $=s(47789),_=s(32664),S=s.n(_),O=s(32787),P=s(77009),R=s(99609),B=s(13050),H=s(4206),Z=s(94939),T=s(908),Q=s(43737),U=s(34441),z=s(82018),F=s(67697);const W=()=>{const[e,t]=(0,a.useState)(!1),s=(0,n.wA)();return{rehydrate:async()=>{const e={channels:[],users:[],fileMessage:{},channelMessage:{},userMessage:{},reactionMessage:{},message:{replying:{}},footprint:{},ui:{},server:{}};if(!window.CACHE)return void t(!0);const a=Object.keys(window.CACHE);await Promise.all(a.map((t=>{var s;return null===(s=window.CACHE[t])||void 0===s?void 0:s.iterate(((s,a)=>{switch(t){case"channels":s&&e.channels.push(s);break;case"users":s&&e.users.push(s);break;case"footprint":e.footprint[a]=s;break;case"ui":e.ui[a]=s;break;case"messageChannel":e.channelMessage[a]=s;break;case"messageFile":e.fileMessage[a]=s||[];break;case"messageDM":e.userMessage[a]=s;break;case"messageReaction":e.reactionMessage[a]=s;break;case"message":e.message[a]=s;break;case"server":e.server[a]=s}}))}))),s((0,F.yi)(e.users)),s((0,z.Ts)(e.server)),s((0,R.I9)(e.channels)),s((0,T.fl)(e.fileMessage.list)),s((0,Z.oT)(e.channelMessage)),s((0,U.Ur)(e.userMessage)),s((0,H.fu)(e.message)),s((0,B.hh)(e.footprint)),s((0,c.eV)(e.ui)),s((0,Q.Is)(e.reactionMessage)),t(!0)},rehydrated:e}};(0,P.extendPrototype)(O);const q=[{storeName:"channels",description:"store channel list"},{storeName:"users",description:"store user list"},{storeName:"messageDM",description:"store DM message with IDs"},{storeName:"messageChannel",description:"store channel message with IDs"},{storeName:"message",description:"store message with key-val full data"},{storeName:"messageFile",description:"store file message list"},{storeName:"messageArchive",description:"store archive message"},{storeName:"messageReaction",description:"store message reaction with key-val full data"},{storeName:"footprint",description:"store user visit data"},{storeName:"server",description:"store server data"},{storeName:"ui",description:"store UI state"}],J=()=>{const e=localStorage.getItem(m.n9)||"";if(!e)return;const t=`local_db_${e}_v_${m.yL.split(".").join("_")}`;window.CACHE={},q.forEach((({storeName:e,description:s})=>{window.CACHE[e]=O.createInstance({name:t,storeName:e,description:s})}))};var Y=s(54697),K=s(13631),X=s(25303),ee=s(85666),te=s(60890);let se=!1;var ae,re=s(42716),ne=s(37822);function ie(){return ie=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.createElement("svg",ie({width:24,height:24,viewBox:"0 0 24 24",fill:"#70707B",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t},s),e?a.createElement("title",{id:t},e):null,ae||(ae=a.createElement("path",{d:"M13.821 6.5H19.75C20.8867 6.5 21.8266 7.34297 21.9785 8.43788L21.9948 8.59595L22 8.75V17.75C22 18.9409 21.0748 19.9156 19.904 19.9948L19.75 20H4.25C3.05914 20 2.08436 19.0748 2.00519 17.904L2 17.75V10.499L8.20693 10.5L8.40335 10.4914C8.79396 10.4572 9.16896 10.3214 9.49094 10.0977L9.64734 9.9785L13.821 6.5ZM8.20693 4C8.66749 4 9.1153 4.14129 9.49094 4.40235L9.64734 4.5215L11.75 6.273L8.68706 8.82617L8.60221 8.88738C8.51363 8.94232 8.41452 8.9782 8.31129 8.9927L8.20693 9L2 8.999V6.25C2 5.05914 2.92516 4.08436 4.09595 4.00519L4.25 4H8.20693Z"}))),ce=(0,a.forwardRef)(le);var oe=s(52053),de=s(68416);const me=()=>{const{pathname:e}=(0,i.zy)();return(0,f.jsx)("ul",{className:"flex flex-col absolute left-0 bottom-0 w-full px-3 py-2",children:(0,f.jsx)("li",{className:"cursor-pointer flex items-center p-2.5 gap-2.5 link_navs",children:(0,f.jsx)(l.k2,{className:"link",to:`/setting/overview?f=${e}`,children:(0,f.jsx)(V.A,{placement:"right",tip:"Settings",children:(0,f.jsx)(de.A,{className:"w-6 h-6 dark:fill-gray-400"})})})})})};var ue=s(98916),he=s(47003);const ge=({uid:e})=>{const{pathname:t}=(0,i.zy)(),s=(0,o.GV)((t=>t.users.byId[e]),n.bN);return s?(0,f.jsx)("div",{className:"px-3 py-2.5 invisible md:visible",children:(0,f.jsx)(l.k2,{to:`/setting/my_account?f=${t}`,children:(0,f.jsx)("div",{className:"w-8 h-8",children:(0,f.jsx)(he.A,{className:" object-cover w-full h-full rounded-full",width:32,height:32,src:s.avatar,name:s.name})})})}):null};var fe=s(45774);const ve=()=>{const e=(0,o.GV)((e=>e.ui.SSEStatus),n.bN);return(0,f.jsx)("aside",{className:"fixed right-2 bottom-2",children:(0,f.jsx)("div",{className:(0,fe.A)("w-1 h-1 rounded-full","connected"===e&&"bg-green-500","disconnected"===e&&"bg-red-500","reconnecting"===e&&"bg-blue-500","connecting"===e&&"bg-yellow-500")})})};function pe(){const{t:e}=(0,r.Bd)(),t=(0,n.wA)(),s=(0,i.RQ)("/"),m=(0,i.RQ)("/chat"),{pathname:u}=(0,i.zy)(),h=(0,o.GV)((e=>e.authData.roleChanged),n.bN),g=(0,o.GV)((e=>e.authData.guest),n.bN),v=(0,o.GV)((e=>{var t,s;return null!==(t=null===(s=e.authData.user)||void 0===s?void 0:s.uid)&&void 0!==t?t:0}),n.bN),{chat:x,user:b}=(0,o.GV)((e=>e.ui.rememberedNavs),n.bN),{success:C}=function(){const{isLoading:e}=(0,ee.A)(!1),[t]=(0,Y.V0)(),{rehydrate:s,rehydrated:r}=W(),i=(0,o.GV)((e=>e.ui.ready),n.bN),l=(0,o.GV)((e=>{var t;return null===(t=e.authData.user)||void 0===t?void 0:t.uid}),n.bN),c=(0,o.GV)((e=>e.server.contact_verification_enable),n.bN),d=(0,o.GV)((e=>{var t;return null!==(t=e.authData.expireTime)&&void 0!==t?t:+new Date}),n.bN),m=(0,o.GV)((e=>e.channels.ids),n.bN),u=(0,o.GV)((e=>e.authData.token),n.bN),h=(0,o.GV)((e=>e.authData.guest),n.bN),g=(0,o.GV)((e=>e.channelMessage),n.bN),{startStreaming:f,stopStreaming:v}=(0,te.A)(),[p,{isLoading:x,isSuccess:b,isError:C,data:w}]=(0,Y.JY)(),[j,{isLoading:y,isSuccess:N,isError:A,data:L}]=(0,X.Ii)(),[E,{data:k}]=(0,X.F2)(),[V,{data:M,isSuccess:G,isLoading:I}]=(0,K.hC)(),[D]=(0,K.qp)();(0,a.useEffect)((()=>{J(),s(),V()}),[]),(0,a.useEffect)((()=>{h&&m.length>0&&!se&&(m.filter((e=>!g[e])).forEach((e=>{e&&t({id:e,limit:50})})),se=!0)}),[m,g,h]),(0,a.useEffect)((()=>{r&&M&&(j().then((()=>{h||E()})),p(),D())}),[r,M,h]);const $=S()().isAfter(new Date(d-2e4)),_=!!l&&r&&!!u&&!$&&!i;return(0,a.useEffect)((()=>{_&&(v(),setTimeout((()=>{f()}),100))}),[_]),{loading:y||x||!r||e||I,error:A&&C,success:N&&b&&G,data:{users:c?k:L,favorites:w}}}();if((0,a.useEffect)((()=>{m&&t((0,c.u2)({key:"chat",path:"/chat"}))}),[m]),!C)return(0,f.jsx)(d.A,{reload:!0,fullscreen:!0,context:"home-route"});const w=u.startsWith("/setting"),j=s||u.startsWith("/chat");if(w)return(0,f.jsx)(i.sv,{});const N=m?"/chat":x||"/chat",A=b||"/users",L="flex items-center gap-2.5 px-3 py-2 font-semibold text-sm text-gray-600 rounded-lg md:hover:bg-gray-800/10";return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ve,{}),h&&(0,f.jsx)(k,{}),!g&&(0,f.jsx)(D,{}),!g&&(0,f.jsx)($.A,{}),(0,f.jsx)(p,{}),!g&&(0,f.jsx)(y,{}),(0,f.jsxs)("div",{className:"vocechat-container flex w-screen h-screen bg-neutral-100 dark:bg-neutral-900",children:[!g&&(0,f.jsxs)("div",{className:"hidden md:flex h-full flex-col items-center relative w-16 transition-all",children:[v&&(0,f.jsx)(ge,{uid:v}),(0,f.jsxs)("nav",{className:"flex flex-col gap-1 px-3 py-6",children:[(0,f.jsx)(l.k2,{className:({isActive:e})=>`${L} ${e||j?"bg-primary-400 md:hover:bg-primary-400":""}`,to:N,children:({isActive:t})=>(0,f.jsx)(V.A,{tip:e("chat"),children:(0,f.jsx)(ne.A,{className:t||j?"fill-white":""})})}),(0,f.jsx)(l.k2,{className:({isActive:e})=>`${L} ${e?"bg-primary-400 md:hover:bg-primary-400":""}`,to:A,children:({isActive:t})=>(0,f.jsx)(V.A,{tip:e("members"),children:(0,f.jsx)(oe.A,{className:t?"fill-white":""})})}),(0,f.jsx)(l.k2,{className:({isActive:e})=>`${L} ${e?"bg-primary-400 md:hover:bg-primary-400":""}`,to:"/favs",children:({isActive:t})=>(0,f.jsx)(V.A,{tip:e("favs"),children:(0,f.jsx)(re.A,{className:t?"fill-white":""})})}),(0,f.jsx)(l.k2,{className:({isActive:e})=>`${L} ${e?"bg-primary-400 md:hover:bg-primary-400":""}`,to:"/files",children:({isActive:t})=>(0,f.jsx)(V.A,{tip:e("files"),children:(0,f.jsx)(ce,{className:t?"fill-white":""})})})]}),(0,f.jsx)(me,{})]}),(0,f.jsx)("div",{className:"h-full flex flex-col w-full",children:(0,f.jsx)(i.sv,{})})]}),!g&&(0,f.jsx)(ue.A,{})]})}const xe=(0,a.memo)(pe)}}]); \ No newline at end of file diff --git a/static/js/957.9fd03b0a.chunk.js b/static/js/957.8873847c.chunk.js similarity index 99% rename from static/js/957.9fd03b0a.chunk.js rename to static/js/957.8873847c.chunk.js index 92a83bd03..cebc06922 100644 --- a/static/js/957.9fd03b0a.chunk.js +++ b/static/js/957.8873847c.chunk.js @@ -1 +1 @@ -"use strict";(globalThis.webpackChunkvocechat_web=globalThis.webpackChunkvocechat_web||[]).push([[957],{63734:(e,s,t)=>{t.d(s,{A:()=>c});var a,l=t(81084);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var s=1;sl.createElement("svg",i({width:16,height:16,viewBox:"0 0 16 16",fill:"#6C737F",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":s},t),e?l.createElement("title",{id:s},e):null,a||(a=l.createElement("path",{d:"M8.11904 0C3.91105 0 0.5 3.41105 0.5 7.61905C0.5 11.827 3.91105 15.2381 8.11904 15.2381C12.3271 15.2381 15.7381 11.827 15.7381 7.61905C15.7381 3.41105 12.3263 0 8.11904 0ZM11.7053 10.128L10.628 11.2053L8.11904 8.69714L5.61009 11.2053L4.53277 10.128L7.04095 7.61905L4.532 5.1101L5.60934 4.03353L8.11829 6.54248L10.6272 4.03353L11.7045 5.1101L9.19638 7.61905L11.7053 10.128Z"}))),c=(0,l.forwardRef)(r)},6691:(e,s,t)=>{t.d(s,{A:()=>c});var a,l=t(81084);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var s=1;sl.createElement("svg",i({width:20,height:20,viewBox:"0 0 20 20",fill:"#667085",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":s},t),e?l.createElement("title",{id:s},e):null,a||(a=l.createElement("path",{d:"M6 4C6 2.89543 6.89543 2 8 2H14C15.1046 2 16 2.89543 16 4V14C16 15.1046 15.1046 16 14 16H8C6.89543 16 6 15.1046 6 14V4ZM4 6.00001C4 5.25973 4.4022 4.61339 5 4.26758V14.5C5 15.8807 6.11929 17 7.5 17H13.7324C13.3866 17.5978 12.7403 18 12 18H7.5C5.567 18 4 16.433 4 14.5V6.00001Z"}))),c=(0,l.forwardRef)(r)},71389:(e,s,t)=>{t.d(s,{A:()=>c});var a,l=t(81084);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var s=1;sl.createElement("svg",i({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":s},t),e?l.createElement("title",{id:s},e):null,a||(a=l.createElement("path",{d:"M12 3.25C13.4346 3.25 14.6126 4.34848 14.7388 5.75019L19 5.75C19.4142 5.75 19.75 6.08579 19.75 6.5C19.75 6.8797 19.4678 7.19349 19.1018 7.24315L19 7.25H18.417L17.1499 18.2292C17.0335 19.2384 16.179 20 15.1631 20H8.83688C7.821 20 6.9665 19.2384 6.85006 18.2292L5.582 7.25H5C4.6203 7.25 4.30651 6.96785 4.25685 6.60177L4.25 6.5C4.25 6.1203 4.53215 5.80651 4.89823 5.75685L5 5.75L9.26119 5.75019C9.38741 4.34848 10.5654 3.25 12 3.25ZM10.5 9.5C10.2545 9.5 10.0504 9.65477 10.0081 9.85886L10 9.9375V16.0625L10.0081 16.1411C10.0504 16.3452 10.2545 16.5 10.5 16.5C10.7455 16.5 10.9496 16.3452 10.9919 16.1411L11 16.0625V9.9375L10.9919 9.85886C10.9496 9.65477 10.7455 9.5 10.5 9.5ZM13.5 9.5C13.2545 9.5 13.0504 9.65477 13.0081 9.85886L13 9.9375V16.0625L13.0081 16.1411C13.0504 16.3452 13.2545 16.5 13.5 16.5C13.7455 16.5 13.9496 16.3452 13.9919 16.1411L14 16.0625V9.9375L13.9919 9.85886C13.9496 9.65477 13.7455 9.5 13.5 9.5ZM12 4.75C11.3952 4.75 10.8908 5.17947 10.775 5.75005H13.225C13.1092 5.17947 12.6048 4.75 12 4.75Z",fill:"#D92D20"}))),c=(0,l.forwardRef)(r)},31872:(e,s,t)=>{t.d(s,{A:()=>c});var a,l=t(81084);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var s=1;sl.createElement("svg",i({width:24,height:24,viewBox:"0 0 24 24",fill:"#667085",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":s},t),e?l.createElement("title",{id:s},e):null,a||(a=l.createElement("path",{d:"M13.7036 5.75927L18.2405 10.2962L9.33146 19.2052C9.08325 19.4534 8.77457 19.6325 8.43593 19.7249L3.84998 20.9756C3.34808 21.1124 2.88755 20.6519 3.02443 20.15L4.27515 15.5641C4.3675 15.2254 4.54664 14.9167 4.79484 14.6685L13.7036 5.75927ZM20.0604 3.93956C21.3132 5.19232 21.3132 7.22343 20.0604 8.47618L19.1907 9.34506L14.6538 4.80903L15.5238 3.93956C16.7766 2.68681 18.8077 2.68681 20.0604 3.93956Z"}))),c=(0,l.forwardRef)(r)},27820:(e,s,t)=>{t.d(s,{A:()=>m});var a=t(2497),l=(t(45347),t(95380)),i=t(80724),r=t(92316),c=t(52205),n=t(99264);const d=({uid:e,popover:s=!0,cid:t,textOnly:a=!1})=>{const d=(0,i.GV)((e=>e.users.byId),c.bN)[e];return d?a?(0,n.jsx)(n.Fragment,{children:`@${d.name}`}):s?(0,n.jsx)(l.Ay,{interactive:!0,placement:"top",trigger:"click",content:(0,n.jsx)(r.A,{uid:e,type:"card",cid:t}),children:(0,n.jsx)("span",{className:"px-0.5 text-primary-400 cursor-pointer",children:`@${d.name}`})}):(0,n.jsx)("span",{className:"px-0.5 text-primary-400",children:`@${d.name}`}):null};var o=t(81084),u=t(54697),x=t(13050);const j="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAA51BMVEUAAABGiMdGiMdGiMdOiMdHicdHh8dGh8dGiMdGiMZGh8dGh8dGh8dHiMdGh8dGiMdGh8dHiMdGh8dGiMdGichHisRHiMZEhsZGh8hHiMZHh8dHiMff8P5HiMdKisnc7v3a7PzU6PpYlM5UkcxNjMqHtN+/2vOaweWpy+qew+aNuOFgmdB/rtx8rdt4qtqmyunP5fjK4vey0u50p9hrodXC3PNlndNblc9QjsuWvuRwpNa82PGCsN3D3fSTvOJon9RhmtFdmNCgxefF3/W21O+v0O2QuuKEst6jx+iJteDV6vuszey31fCy8/ecAAAAHHRSTlMAMP34CD21kdnn5O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,{isLoading:r}]=(0,u.Q5)(),d=(0,i.GV)((s=>s.footprint.og[e]),c.bN),[M,m]=(0,o.useState)(null);(0,o.useEffect)((()=>{if(d){var s;const e=(null===d||void 0===d?void 0:d.title)||(null===d||void 0===d?void 0:d.site_name)||"",t=(null===d||void 0===d?void 0:d.description)||"",l=(null===d||void 0===d||null===(s=d.images.find((e=>!!e.url)))||void 0===s?void 0:s.url)||"",i=(null===d||void 0===d?void 0:d.favicon_url)||j;a(i),m({title:e,description:t,ogImage:l})}else e&&l(e)}),[e,d]);if(r)return(0,n.jsx)("div",{className:"h-28"});if(!e||!M||!M.title)return null;const{title:g,description:N,ogImage:h}=M,p="flex items-center border border-solid border-gray-300 dark:border-gray-600 box-border rounded-md w-[80%] md:w-[380px]";return h?(0,n.jsxs)("a",{className:`${p} flex-col !items-start p-3`,href:e,target:"_blank",rel:"noreferrer",children:[(0,n.jsx)("h3",{className:"text-primary-500 w-full truncate",children:g}),(0,n.jsx)("p",{className:"text-xs text-gray-400 mb-2 w-full truncate",children:N}),(0,n.jsx)("div",{className:"w-full h-[180px]",children:(0,n.jsx)("img",{className:"w-full h-full object-cover",onError:()=>{s((0,x.M3)({key:e,value:{...d,images:[]}}))},src:h,alt:"og image"})})]}):(0,n.jsxs)("a",{className:`${p} gap-2 px-2 py-3`,href:e,target:"_blank",rel:"noreferrer",children:[t&&(0,n.jsx)("div",{className:"flex rounded",children:(0,n.jsx)("img",{className:"object-contain w-12 h-12",onError:()=>{a(j)},src:t,alt:"favicon"})}),(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)("h3",{className:"text-sm text-gray-900 dark:text-gray-100",children:g}),(0,n.jsx)("p",{className:"hidden md:block text-xs text-gray-500 w-[288px] truncate",children:N}),(0,n.jsx)("span",{className:"text-[10px] text-gray-500 w-[288px] truncate",children:e})]})]})}const m=({url:e=!0,mention:s=!0,mentionTextOnly:t=!1,mentionPopOver:l=!0,linkPreview:i=!0,text:r,cid:c})=>(0,n.jsx)(a.A,{options:{render:{email:({content:e,attributes:{href:s}})=>t?(0,n.jsx)(n.Fragment,{children:e}):(0,n.jsx)("a",{className:"text-primary-500",href:s,rel:"noreferrer",children:e}),url:({content:s,attributes:{href:t}})=>e&&s.startsWith("http")?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("a",{className:"text-primary-500",target:"_blank",href:t,rel:"noreferrer",children:s}),i&&(0,n.jsx)(M,{url:t})]}):(0,n.jsx)(n.Fragment,{children:s}),mention:({content:e})=>{if(!s)return(0,n.jsx)(n.Fragment,{children:e});if(/@[0-9]+/.test(e)){const s=e.trim().slice(1);return(0,n.jsx)(d,{uid:+s,cid:c,popover:l,textOnly:t})}return(0,n.jsx)(n.Fragment,{children:e})}}},children:r})},61082:(e,s,t)=>{t.d(s,{A:()=>i});var a=t(81084),l=t(13631);function i(){const[e,s]=(0,a.useState)(!1),[t,i]=(0,a.useState)(),{data:r}=(0,l.Hx)(void 0,{refetchOnMountOrArgChange:!0}),[c,{isSuccess:n}]=(0,l.Vi)();(0,a.useEffect)((()=>{r&&i(r)}),[r]),(0,a.useEffect)((()=>{s(!n&&JSON.stringify(r)!==JSON.stringify(t))}),[r,t,n]);return{config:t,changed:e,updateGithubAuthConfig:e=>{i((s=>s?{...s,...e}:e))},updateGithubAuthConfigToServer:async()=>{t&&await c(t)},isSuccess:n}}},55146:(e,s,t)=>{t.d(s,{A:()=>i});var a=t(81084),l=t(13631);function i(){const[e,s]=(0,a.useState)(!1),[t,i]=(0,a.useState)(""),{data:r}=(0,l.LX)(void 0,{refetchOnMountOrArgChange:!0}),[c,{isSuccess:n}]=(0,l.pA)();(0,a.useEffect)((()=>{r&&i(r.client_id)}),[r]),(0,a.useEffect)((()=>{s(!n&&(null===r||void 0===r?void 0:r.client_id)!==t)}),[r,t,n]);return{config:r,changed:e,clientId:t,updateClientId:i,updateClientIdToServer:async()=>{t&&await c({client_id:t})},updateGoogleAuthConfig:c,isSuccess:n}}},85666:(e,s,t)=>{t.d(s,{A:()=>c});var a=t(81084),l=t(13631),i=t(80724),r=t(52205);const c=(e=!1)=>{var s;const t=(0,i.GV)((e=>e.users.ids.length),r.bN),c=(0,i.GV)((e=>e.server.upgraded),r.bN),n=(0,i.GV)((e=>e.authData.guest),r.bN),{data:d,refetch:o,isLoading:u}=(0,l.xI)(void 0,{refetchOnMountOrArgChange:e,skip:n}),[x,{isLoading:j,isSuccess:M}]=(0,l._8)(),[m,{isSuccess:g,isLoading:N,reset:h}]=(0,l.bb)();(0,a.useEffect)((()=>{g&&(o(),h())}),[g]);return{upgraded:c,reachLimit:t>=(null!==(s=null===d||void 0===d?void 0:d.user_limit)&&void 0!==s?s:Number.MAX_SAFE_INTEGER),license:d,checked:M,isLoading:u,checking:j,upserting:N,upserted:g,checkLicense:e=>{x(e)},upsertLicense:async e=>{const s=await x(e);return!(!("data"in s)||!s.data.sign)&&await m(e)}}}},2890:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>MyAccount});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(81084),react_hot_toast__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(71017),react_i18next__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(43307),_app_services_user__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(25303),_app_store__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(80724),_components_AvatarUploader__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(87965),_components_styled_Button__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(32642),_ProfileBasicEditModal__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(97507),_RemoveAccountConfirmModal__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(5427),_UpdatePasswordModal__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(29690),react_redux__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(52205),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(99264);function MyAccount(){const{t:t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.Bd)("member"),{t:ct}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.Bd)(),[passwordModal,setPasswordModal]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[editModal,setEditModal]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(""),[removeConfirmVisible,setRemoveConfirmVisible]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[uploadAvatar,{isSuccess:uploadSuccess}]=(0,_app_services_user__WEBPACK_IMPORTED_MODULE_3__.pl)(),EditModalInfo={name:{label:t("username"),title:t("change_name"),intro:t("change_name_desc")},email:{label:t("email"),title:t("change_email"),intro:t("change_email_desc")}},loginUser=(0,_app_store__WEBPACK_IMPORTED_MODULE_4__.GV)((e=>{var s;return e.users.byId[(null===(s=e.authData.user)||void 0===s?void 0:s.uid)||0]}),react_redux__WEBPACK_IMPORTED_MODULE_11__.bN);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{uploadSuccess&&react_hot_toast__WEBPACK_IMPORTED_MODULE_1__.Ay.success(ct("tip.update"))}),[uploadSuccess]);const handleBasicEdit=e=>{const{edit:s}=e.currentTarget.dataset;setEditModal(s)},closeBasicEditModal=()=>{setEditModal("")},togglePasswordModal=()=>{setPasswordModal((e=>!e))},toggleRemoveAccountModalVisible=()=>{setRemoveConfirmVisible((e=>!e))};if(!loginUser)return null;const{uid:uid,avatar:avatar,name:name,email:email}=loginUser;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{className:"flex flex-col items-start gap-8",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{className:"md:p-6 flex flex-col items-center w-full md:w-[512px] md:bg-gray-100 md:dark:bg-gray-800 md:rounded-2xl",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_AvatarUploader__WEBPACK_IMPORTED_MODULE_5__.A,{url:avatar,name:name,uploadImage:uploadAvatar}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{className:"mt-2 mb-16 font-bold text-lg text-gray-800 dark:text-white",children:[name," ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("span",{className:"font-normal text-gray-500",children:["#",uid]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{className:"w-full flex items-start justify-between mb-6",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{className:"flex flex-col text-gray-500 dark:text-gray-50",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span",{className:"text-xs uppercase font-semibold",children:t("username")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("span",{className:"text-sm ",children:[name," ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("span",{className:"text-gray-600 dark:text-gray-400",children:[" #",uid]})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_styled_Button__WEBPACK_IMPORTED_MODULE_6__.A,{"data-edit":"name",onClick:handleBasicEdit,className:"",children:ct("action.edit")})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{className:"w-full flex items-start justify-between mb-6",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{className:"flex flex-col text-gray-500 dark:text-gray-50",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span",{className:"text-xs uppercase font-semibold",children:t("email")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span",{className:"text-sm",children:email})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_styled_Button__WEBPACK_IMPORTED_MODULE_6__.A,{"data-edit":"email",onClick:handleBasicEdit,children:ct("action.edit")})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{className:"w-full flex items-start justify-between mb-6",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div",{className:"flex flex-col text-gray-500 dark:text-gray-50",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span",{className:"text-xs uppercase font-semibold",children:t("password")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span",{className:"text-sm",children:"*********"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_styled_Button__WEBPACK_IMPORTED_MODULE_6__.A,{onClick:togglePasswordModal,children:ct("action.edit")})]})]}),1!=uid&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_components_styled_Button__WEBPACK_IMPORTED_MODULE_6__.A,{className:"danger",onClick:toggleRemoveAccountModalVisible,children:t("delete_account")})]}),editModal&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ProfileBasicEditModal__WEBPACK_IMPORTED_MODULE_7__.A,{type:"email"==editModal?"email":"text",valueKey:editModal,...EditModalInfo[editModal],value:eval(editModal),closeModal:closeBasicEditModal}),passwordModal&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_UpdatePasswordModal__WEBPACK_IMPORTED_MODULE_9__.A,{closeModal:togglePasswordModal}),removeConfirmVisible&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_RemoveAccountConfirmModal__WEBPACK_IMPORTED_MODULE_8__.A,{closeModal:toggleRemoveAccountModalVisible})]})}},97507:(e,s,t)=>{t.d(s,{A:()=>x});var a=t(81084),l=t(71017),i=t(43307),r=t(25303),c=t(26521),n=t(32642),d=t(87740),o=t(55371),u=t(99264);const x=({label:e="Username",valueKey:s="name",value:t="",type:x="text",title:j="Change your username",intro:M="Enter a new username and your existing password.",closeModal:m})=>{const g=(0,a.useRef)(null),{t:N}=(0,i.Bd)(),[h,p]=(0,a.useState)(t),[_,{isLoading:D,isSuccess:y}]=(0,r.sU)();return(0,a.useEffect)((()=>{y&&(l.Ay.success(N("tip.update")),m())}),[y]),(0,u.jsx)(c.A,{id:"modal-modal",children:(0,u.jsx)(o.A,{title:j,description:M,buttons:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(n.A,{className:"cancel",onClick:m,children:N("action.cancel")}),(0,u.jsx)(n.A,{onClick:()=>{if(!g||!g.current)return;const e=g.current;e.checkValidity()?_({[s]:h}):e.reportValidity()},children:D?"Updating":N("action.done")})]}),children:(0,u.jsxs)("form",{ref:g,className:"flex flex-col gap-2 w-full",action:"/",children:[(0,u.jsx)("label",{htmlFor:s,className:"text-sm text-left text-gray-500",children:e}),(0,u.jsx)(d.A,{name:s,value:h,onChange:e=>{p(e.target.value)},type:x,required:!0})]})})})}},5427:(e,s,t)=>{t.d(s,{A:()=>x});var a=t(81084),l=t(71017),i=t(43307),r=t(97282),c=t(26521),n=t(32642),d=t(55371),o=t(93335),u=t(99264);const x=({closeModal:e})=>{const{t:s}=(0,i.Bd)("member"),[t,{isLoading:x,isSuccess:j}]=(0,r.fe)(),{clearLocalData:M}=(0,o.A)();return(0,a.useEffect)((()=>{j&&M(!0)}),[j]),(0,u.jsx)(c.A,{id:"modal-modal",children:(0,u.jsx)(d.A,{title:s("remove_account"),description:s("remove_account_desc"),buttons:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(n.A,{onClick:e,children:s("action.cancel",{ns:"common"})}),(0,u.jsx)(n.A,{disabled:x,onClick:async()=>{try{await t()}catch(e){l.Ay.error("Remove Account Failed!")}},className:"danger",children:s("remove")})]})})})}},29690:(e,s,t)=>{t.d(s,{A:()=>x});var a=t(81084),l=t(71017),i=t(43307),r=t(97282),c=t(26521),n=t(32642),d=t(87740),o=t(55371),u=t(99264);const x=({closeModal:e})=>{const{t:s}=(0,i.Bd)("member"),{t:t}=(0,i.Bd)(),{data:x}=(0,r.kU)(),[j,M]=(0,a.useState)({current:"",newPassword:"",confirmPassword:""}),[m,{isLoading:g,isSuccess:N}]=(0,r.zo)(),h=e=>{const{type:s}=e.target.dataset;M((t=>({...t,[s]:e.target.value})))};(0,a.useEffect)((()=>{N&&(l.Ay.success(t("tip.update")),e())}),[N]);const{current:p,newPassword:_,confirmPassword:D}=j,y=(null===x||void 0===x?void 0:x.password)&&!p||!_||!D||_!==D||g,w="my-4 w-full flex flex-col items-start gap-2",f="text-gray-400 font-semibold";return(0,u.jsx)(c.A,{id:"modal-modal",children:(0,u.jsxs)(o.A,{title:s("change_pwd"),description:s("change_pwd_desc"),buttons:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(n.A,{className:"cancel",onClick:e,children:s("action.cancel",{ns:"common"})}),(0,u.jsx)(n.A,{disabled:y,onClick:()=>{const{current:e,newPassword:s}=j;m({old_password:e,new_password:s})},children:g?"Updating":s("action.update",{ns:"common"})})]}),children:[(null===x||void 0===x?void 0:x.password)&&(0,u.jsxs)("div",{className:w,children:[(0,u.jsx)("label",{className:f,htmlFor:"current",children:s("current_pwd")}),(0,u.jsx)(d.A,{type:"password",id:"current",name:"current",value:p,"data-type":"current",onChange:h})]}),(0,u.jsxs)("div",{className:w,children:[(0,u.jsx)("label",{className:f,htmlFor:"newPassword",children:s("new_pwd")}),(0,u.jsx)(d.A,{type:"password",name:"newPassword",value:_,"data-type":"newPassword",onChange:h})]}),(0,u.jsxs)("div",{className:w,children:[(0,u.jsx)("label",{className:f,htmlFor:"confirmPassword",children:s("confirm_new_pwd")}),(0,u.jsx)(d.A,{onBlur:()=>{const{newPassword:e,confirmPassword:s}=j;e!==s&&l.Ay.error("Not same with new password")},type:"password",name:"confirmPassword",value:D,"data-type":"confirmPassword",onChange:h})]})]})})}},21181:(e,s,t)=>{t.r(s),t.d(s,{default:()=>os});var a=t(81084),l=t(43307),i=t(80772),r=t(76644),c=t(212),n=t(71017),d=t(26521),o=t(32642),u=t(99765),x=t(55371),j=t(93335),M=t(99264);const m=({closeModal:e})=>{const{t:s}=(0,l.Bd)("auth"),{t:t}=(0,l.Bd)(),[i,r]=(0,a.useState)(!1),{logout:c,exited:m,exiting:g,clearLocalData:N}=(0,j.A)();return(0,a.useEffect)((()=>{m&&(i&&N(),n.Ay.success(t("tip.logout")))}),[m,i]),(0,M.jsx)(d.A,{id:"modal-modal",children:(0,M.jsx)(x.A,{title:s("logout.title"),description:s("logout.desc"),buttons:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(o.A,{className:"cancel",onClick:e,children:t("action.cancel")}),(0,M.jsx)(o.A,{onClick:()=>{c()},className:"danger",children:g?"Logging out":t("action.logout")})]}),children:(0,M.jsxs)("div",{className:"text-sm text-gray-400 flex justify-end items-center",children:[(0,M.jsx)("label",{htmlFor:"clear_cb",className:"cursor-pointer text-orange-500 mr-3",children:s("logout.clear_local")}),(0,M.jsx)(u.A,{className:" cursor-pointer",name:"clear_cb",checked:i,onChange:e=>{r(e.target.checked)}})]})})})};var g=t(80724),N=t(71610),h=t(3632),p=t(32664),_=t.n(p),D=t(2589),y=t(52205),w=t(21444);const f=()=>{var e;const s=(0,g.GV)((e=>e.server.version),y.bN),[t,i]=(0,a.useState)(!1),{t:r}=(0,l.Bd)("setting",{keyPrefix:"version"}),c=null!==(e="1724032531")?e:0;return(0,M.jsxs)("ul",{className:"flex flex-col gap-2 dark:text-white",children:[(0,M.jsxs)("li",{children:[r("client_version"),": ","0.7.28"]}),(0,M.jsxs)("li",{children:[r("server_version"),": ",s]}),(0,M.jsxs)("li",{children:[r("build_time"),": ",c," ",(0,M.jsxs)("span",{className:"text-gray-700 dark:text-gray-300",children:["(",_()(1e3*c).fromNow(),")"]})]}),(0,M.jsx)("li",{children:(0,M.jsxs)(o.A,{disabled:t,onClick:()=>{i(!0),(0,D.h)(),setTimeout((()=>{(0,w.Mm)()}),2e3)},children:[" ",t?(0,M.jsx)(h.A,{size:18,color:"#fff"}):r("sync")]})})]})};var A=t(95380),v=t(30968),I=t(13631),b=t(87740),T=t(34334),L=t(4709);let k;function E(e="smtp"){const{t:s}=(0,l.Bd)(),[t,i]=(0,a.useState)(!1),[r,c]=(0,a.useState)(void 0),[d,{isSuccess:o,isLoading:u}]=(0,I.n6)(),[x,{isSuccess:j,isLoading:M}]=(0,I.q)(),[m,{isSuccess:g,isLoading:N}]=(0,I.u9)(),[h,{isSuccess:p,isLoading:_}]=(0,I.JW)(),{refetch:D,data:y}=(0,I.ud)(void 0,{skip:"agora"!==e}),{refetch:w,data:f}=(0,I.T7)(void 0,{skip:"login"!==e}),{refetch:A,data:v}=(0,I.Mu)(void 0,{skip:"smtp"!==e}),{refetch:b,data:T}=(0,I.rt)(void 0,{skip:"firebase"!==e}),E={login:d,smtp:x,agora:m,firebase:h}[e],O={smtp:A,agora:D,firebase:b,login:w}[e],C={login:o,smtp:j,agora:g,firebase:p}[e],z={login:u,smtp:M,agora:N,firebase:_}[e];return(0,a.useEffect)((()=>{C&&(n.Ay.success(s("tip.update")),O())}),[C]),(0,a.useEffect)((()=>{const e=v||T||f||y;e&&(k=e,c(e))}),[v,T,f,y]),(0,a.useEffect)((()=>{r&&0!=Object.keys(r).length&&((0,L.isEqual)(k,r)?i(!1):i(!0))}),[r]),{originalValues:k,updating:z,updated:C,reset:()=>{c(void 0)},changed:t,updateConfig:E,agoraConfig:y,values:r,setValues:c,toggleEnable:()=>{c((e=>e&&"enabled"in e?{...e,enabled:!e.enabled}:e))}}}function O(){const{t:e}=(0,l.Bd)("setting"),{t:s}=(0,l.Bd)(),{updateConfig:t,values:i}=E("login"),{data:r}=(0,I.B)(),[c,{data:d,isSuccess:u,isLoading:x}]=(0,I.jJ)();(0,a.useEffect)((()=>{u&&((0,v.cJ)(),n.Ay.success(s("tip.update")))}),[u]);const j=null===i||void 0===i?void 0:i.third_party;return(0,M.jsxs)("div",{className:"max-w-[500px] flex flex-col gap-4 items-start",children:[(0,M.jsx)(T.A,{onClick:(e=>{t({...i,...e})}).bind(null,{third_party:!j}),checked:j}),(0,M.jsxs)("div",{className:"w-full flex flex-col items-start gap-2",children:[(0,M.jsxs)("label",{htmlFor:"secret",className:"text-sm text-gray-500 dark:text-gray-100",children:[" ",e("third_app.key"),":"]}),(0,M.jsx)(b.A,{disabled:!j,type:"password",id:"secret",value:d||r})]}),(0,M.jsx)(A.Ay,{interactive:!0,placement:"right-start",trigger:"click",content:(0,M.jsxs)("div",{className:"p-3 rounded-lg border border-orange-400 border-solid flex flex-col gap-3 w-[250px] bg-white",children:[(0,M.jsx)("div",{className:"text-orange-500 text-xs",children:e("third_app.update_tip")}),(0,M.jsxs)("div",{className:"flex justify-end gap-3 w-full",children:[(0,M.jsx)(o.A,{onClick:()=>(0,v.cJ)(),className:"cancel mini",children:s("action.cancel")}),(0,M.jsx)(o.A,{disabled:x,className:"mini danger",onClick:()=>c(),children:s("action.yes")})]})]}),children:(0,M.jsxs)(o.A,{disabled:!j,children:[" ",e("third_app.update")]})}),(0,M.jsxs)("div",{className:"text-xs text-orange-400",children:[e("third_app.key_tip"),(0,M.jsxs)("a",{className:"text-primary-500 font-bold",href:"https://doc.voce.chat/login-with-other-account",target:"_blank",rel:"noopener noreferrer",children:["\ud83d\udd17 ",e("third_app.how_to")]})]})]})}var C=t(6691),z=t(58156);const S=`${location.origin}/api/swagger`,U=()=>{const e=(0,g.GV)((e=>e.authData.token),y.bN),{copy:s}=(0,z.A)(),{t:t}=(0,l.Bd)("setting");return(0,M.jsxs)("section",{className:"flex flex-col justify-start items-start gap-4",children:[(0,M.jsx)("div",{className:"font-semibold dark:text-white",children:t("api_doc.desc")}),(0,M.jsx)("div",{className:"flex flex-col gap-2 w-full",children:(0,M.jsxs)("h2",{className:"text-gray-700 dark:text-white text-lg font-semibold flex gap-1",children:[t("api_doc.access"),(0,M.jsx)("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"underline text-primary-600",children:S})]})}),(0,M.jsxs)("div",{className:"flex flex-col gap-2 w-full",children:[(0,M.jsx)("h2",{className:"text-gray-700 dark:text-white text-lg font-semibold",children:t("api_doc.use_method")}),(0,M.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,M.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,M.jsx)("h3",{className:"text-gray-700 dark:text-white ",children:t("api_doc.step_1")}),(0,M.jsx)("img",{className:"border border-solid rounded-md border-gray-300 shadow-lg md:w-[50%]",src:"https://s.voce.chat/web_client/assets/img/api.doc.step1.png",alt:"step 1"})]}),(0,M.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,M.jsxs)("h3",{className:"text-gray-700 dark:text-white flex flex-col items-start gap-2",children:[t("api_doc.step_2")," ",(0,M.jsxs)("span",{className:"text-gray-400 dark:text-white text-xs",children:["(",t("api_doc.step_2_desc"),")"]})]}),(0,M.jsx)("div",{className:"flex flex-col border border-solid border-green-500 bg-green-100 rounded-md p-2 w-fit break-words text-sm relative",children:(0,M.jsxs)("p",{className:"break-all md:max-w-4xl font-bold",children:[e,(0,M.jsx)(C.A,{onClick:()=>{s(e)},className:"absolute right-2 bottom-2 cursor-pointer"})]})}),(0,M.jsx)("img",{className:"border border-solid rounded-md border-gray-300 shadow-lg md:w-[85%]",src:"https://s.voce.chat/web_client/assets/img/api.doc.step2.jpg",alt:"step 2"})]}),(0,M.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,M.jsx)("h3",{className:"text-gray-700 dark:text-white flex items-center gap-2",children:t("api_doc.last")}),(0,M.jsx)("img",{className:"border border-solid rounded-md border-gray-300 shadow-lg md:w-[85%]",src:"https://s.voce.chat/web_client/assets/img/api.doc.step3.png",alt:"step 3"})]})]})]})]})};var P=t(25303),Y=t(87965),B=t(71389),Q=t(45774),R=t(3661);const G=({closeModal:e,uid:s})=>{const{copy:t}=(0,z.A)(),[i,{error:r,isSuccess:c,isLoading:u,data:j=""}]=(0,P.zr)(),m=(0,a.useRef)(null),{t:g}=(0,l.Bd)("setting",{keyPrefix:"bot"}),{t:N}=(0,l.Bd)();(0,a.useEffect)((()=>{if(r)switch(r.status){case 406:n.oR.error("Invalid Webhook URL!");break;case 409:n.oR.error("Name Already Exists!")}}),[r]);return(0,M.jsx)(d.A,{id:"modal-modal",children:(0,M.jsx)(x.A,{title:g("create_key_title"),description:g("create_key_desc"),buttons:c?(0,M.jsx)(o.A,{onClick:()=>{t(j),n.oR.success("API Key Copied!"),e()},children:g("key_copy_and_close")}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(o.A,{className:"cancel",onClick:e,children:N("action.cancel")}),(0,M.jsx)(o.A,{onClick:()=>{var e;if(!m||!m.current)return;const t=m.current;t.checkValidity()?i({uid:s,name:(null===(e=t.querySelector("input"))||void 0===e?void 0:e.value)||""}):t.reportValidity()},children:u?"...":N("action.done")})]}),children:c?(0,M.jsxs)("div",{className:"flex flex-col gap-2 text-sm",children:[(0,M.jsx)("div",{className:"border-green-600 bg-green-200/50 rounded border border-solid p-2 max-w-md w-full whitespace-pre-wrap break-all",children:j})," ",(0,M.jsxs)("div",{className:"text-red-400",children:["\u26a0\ufe0f ",g("create_key_warning")]})]}):(0,M.jsx)("form",{ref:m,className:"w-full flex flex-col gap-2 items-center",action:"/",children:(0,M.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,M.jsx)("label",{htmlFor:"name",className:"text-sm text-gray-500",children:"Name"}),(0,M.jsx)(b.A,{name:"name",required:!0,placeholder:"Please input API Key name"})]})})})})},W=({closeModal:e,uid:s,kid:t})=>{const[i,{isSuccess:r,isLoading:c}]=(0,P.fM)(),{t:u}=(0,l.Bd)("setting",{keyPrefix:"bot"}),{t:j}=(0,l.Bd)();return(0,a.useEffect)((()=>{r&&(n.oR.success(j("tip.delete")),e())}),[r]),(0,M.jsx)(d.A,{id:"modal-modal",children:(0,M.jsx)(x.A,{title:`${u("delete_key_title")} ${name}`,description:u("delete_key_desc"),buttons:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(o.A,{className:"cancel",onClick:e,children:j("action.cancel")}),(0,M.jsx)(o.A,{className:"danger",onClick:()=>{i({uid:s,kid:t})},children:c?"Deleting":j("action.done")})]})})})},V="p-1 whitespace-nowrap text-xs text-gray-500 dark:text-gray-200 align-middle px-1",K=({uid:e})=>{const{t:s}=(0,l.Bd)("setting",{keyPrefix:"bot"}),[t,i]=(0,a.useState)(),[r,c]=(0,a.useState)(),{data:n,refetch:d}=(0,P.Xf)(e),o=e=>{e||d(),i(e)},u=e=>{e||d(),c(e)};if(!n)return null;const x=["w-20","w-[166px]","w-36","w-15","w-10"];return(0,M.jsxs)("div",{className:"flex flex-col gap-2 items-start",children:[(0,M.jsxs)("div",{className:"border-t border-solid border-b border-gray-100 dark:border-gray-500 py-2 w-full",children:[(0,M.jsxs)("table",{className:"min-w-full table-fixed font-mono",children:[(0,M.jsx)("thead",{children:(0,M.jsx)("tr",{children:[s("col_key_name"),s("col_key_value"),s("col_key_create_time"),s("col_key_last_used"),""].map(((e,s)=>(0,M.jsx)("th",{scope:"col",className:(0,Q.A)("text-xs text-gray-900 dark:text-gray-50 px-1 text-left pb-2",x[s]),children:e},e)))})}),(0,M.jsx)("tbody",{children:n.length>0?n.map((s=>{const{id:t,name:a,key:l,created_at:i,last_used:r}=s;return(0,M.jsxs)("tr",{className:"group",children:[(0,M.jsx)("td",{className:V,children:a}),(0,M.jsx)("td",{className:`${V} w-40`,children:`${l.slice(0,4)} ... ... ${l.slice(-6)}`}),(0,M.jsx)("td",{className:V,children:_()(i).format("YYYY-MM-DD HH:mm:ss")}),(0,M.jsx)("td",{className:V,children:r?_()(r).format("YYYY-MM-DD HH:mm:ss"):"Unused"}),(0,M.jsx)("td",{className:`${V} invisible group-hover:visible`,children:(0,M.jsx)("button",{onClick:u.bind(null,{kid:t,uid:e}),children:(0,M.jsx)(B.A,{})})})]},t)})):(0,M.jsx)("tr",{children:(0,M.jsx)("td",{colSpan:4,className:"text-center text-xs text-gray-400 py-2",children:s("no_api_key")})})})]}),(0,M.jsxs)("button",{onClick:o.bind(null,e),className:"text-green-600 text-xs py-0.5 flex items-center gap-1 m-auto my-2 bg-green-50 rounded-full px-2 ",children:[(0,M.jsx)(R.A,{className:"!w-4 !h-4 fill-green-600"})," ",s("add_api_key")]})]}),t&&(0,M.jsx)(G,{uid:t,closeModal:o.bind(null,void 0)}),r&&(0,M.jsx)(W,{uid:r.uid,kid:r.kid,closeModal:u.bind(null,void 0)})]})};var F=t(45123);const Z=({closeModal:e})=>{const[s,{isSuccess:t,isLoading:i,error:r}]=(0,P.i0)(),{t:c}=(0,l.Bd)("setting",{keyPrefix:"bot"}),[u,j]=(0,a.useState)({name:"",webhook_url:""}),{t:m}=(0,l.Bd)(),g=e=>{const{value:s}=e.target,{name:t=""}=e.target.dataset;j((e=>({...e,[t]:s})))};(0,a.useEffect)((()=>{if(r)switch(r.status){case 406:n.oR.error("Invalid Webhook URL!");break;case 409:n.oR.error("Name conflict with existed username, try the proposed name below."),j((e=>({...e,name:`${e.name}-bot`})))}}),[r]),(0,a.useEffect)((()=>{t&&(n.oR.success("Create Bot Successfully!"),e())}),[t]);const{name:N,webhook_url:h}=u;return(0,M.jsx)(d.A,{id:"modal-modal",children:(0,M.jsx)(x.A,{title:c("create_title"),description:c("create_desc"),buttons:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(o.A,{className:"cancel",onClick:e,children:m("action.cancel")}),(0,M.jsx)(o.A,{disabled:!u.name,onClick:()=>{if(""===u.name.trim())return;const{name:e,webhook_url:t}=u,a=new URL(F.tx).hostname;s({is_bot:!0,is_admin:!1,gender:1,email:`bot_${(new Date).getTime()}@${a}`,password:"",name:e,webhook_url:""===t.trim()?void 0:t})},children:i?"Creating":m("action.done")})]}),children:(0,M.jsxs)("div",{className:"w-full flex flex-col gap-2",children:[(0,M.jsxs)("div",{className:"flex flex-col items-start gap-1 w-full",children:[(0,M.jsx)("label",{htmlFor:"name",className:"text-sm text-gray-500",children:"Name"}),(0,M.jsx)(b.A,{onChange:g,value:N,"data-name":"name",placeholder:"Please input bot name"})]}),(0,M.jsxs)("div",{className:"flex flex-col items-start gap-1 w-full",children:[(0,M.jsx)("label",{htmlFor:"webhook_url",className:"text-sm text-gray-500",children:"Webhook URL (Optional)"}),(0,M.jsx)(b.A,{onChange:g,value:h,"data-name":"webhook_url",type:"url",placeholder:"Please input webhook url"})]})]})})})},H=({closeModal:e,uid:s,name:t})=>{const[i,{isSuccess:r,isLoading:c}]=(0,P.Gv)(),{t:u}=(0,l.Bd)("setting",{keyPrefix:"bot"}),{t:j}=(0,l.Bd)();return(0,a.useEffect)((()=>{r&&(n.oR.success(j("tip.delete")),e())}),[r]),(0,M.jsx)(d.A,{id:"modal-modal",children:(0,M.jsx)(x.A,{title:`${u("delete_title")} ${t}`,description:u("delete_desc"),buttons:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(o.A,{className:"cancel",onClick:e.bind(null),children:j("action.cancel")}),(0,M.jsx)(o.A,{className:"danger",onClick:()=>{i(s)},children:c?"Deleting":j("action.done")})]})})})};var J,X=t(93604),q=t(63734),$=t(31872);function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var s=1;sa.createElement("svg",ee({width:24,height:24,viewBox:"0 0 24 24",stroke:"#616161",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:l,"aria-labelledby":s},t),e?a.createElement("title",{id:s},e):null,J||(J=a.createElement("path",{d:"M17 21V13H7V21M7 3V8H15M19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H16L21 8V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21Z",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}))),te=(0,a.forwardRef)(se),ae=({uid:e})=>{const s=(0,a.useRef)(null),[t,l]=(0,a.useState)(!1),[i,r]=(0,a.useState)(""),{data:c,isSuccess:d,refetch:o}=(0,P.pR)(e),[u,{isSuccess:x,isLoading:j}]=(0,P.H7)();(0,a.useEffect)((()=>{d&&c&&r(c.name||"")}),[c,d]),(0,a.useEffect)((()=>{x&&o()}),[x]);const m=async()=>{if(t&&s){const t=s.current;if(null===t||void 0===t||!t.checkValidity())return void(null===t||void 0===t||t.reportValidity());const a=new FormData(t).get("name"),l=await u({id:e,name:a});if("error"in l){if(409===l.error.status)n.oR.error("Conflict with existed username");return}}l((e=>!e))};return(0,M.jsxs)("div",{className:"flex gap-2",children:[(0,M.jsx)("form",{action:"/",ref:s,onSubmit:e=>{e.preventDefault(),m()},children:(0,M.jsx)("input",{readOnly:!t,required:!0,autoFocus:!0,name:"name",defaultValue:i,className:(0,Q.A)("text-gray-900 dark:text-gray-100 w-auto",t?"ring-1 ring-gray-500 bg-gray-50 px-2 py-1 dark:bg-slate-900":"bg-transparent")})}),(0,M.jsx)("button",{type:"button",title:"edit name",disabled:j,onClick:m,children:j?(0,M.jsx)(X.A,{size:16}):t?(0,M.jsx)(te,{className:"stroke-gray-500 !w-5 !h-5"}):(0,M.jsx)($.A,{className:"fill-gray-500 !w-5 !h-5"})}),t&&!j&&(0,M.jsx)("button",{type:"button",disabled:j,onClick:()=>{l(!1);const e=s.current;if(e){e.querySelector("input").value=(null===c||void 0===c?void 0:c.name)||""}},children:(0,M.jsx)(q.A,{className:"!w-5 !h-5 fill-gray-500"})})]})},le=({uid:e})=>{const s=(0,a.useRef)(null),[t,l]=(0,a.useState)(!1),[i,r]=(0,a.useState)(""),{data:c,isSuccess:d,refetch:o}=(0,P.pR)(e),[u,{isSuccess:x,isLoading:j}]=(0,P.H7)();(0,a.useEffect)((()=>{d&&c&&r(c.webhook_url||"")}),[c,d]),(0,a.useEffect)((()=>{x&&o()}),[x]);const m=async()=>{if(t&&s){const t=s.current;if(null===t||void 0===t||!t.checkValidity())return void(null===t||void 0===t||t.reportValidity());const a=new FormData(t).get("webhook"),l=await u({id:e,webhook_url:a});if("error"in l){if(406===l.error.status)n.oR.error("Not Valid URL!");return}}l((e=>!e))};return(0,M.jsx)("div",{children:i||t||x?(0,M.jsxs)("div",{className:"flex gap-2",children:[(0,M.jsx)("form",{action:"/",ref:s,onSubmit:e=>{e.preventDefault(),m()},children:(0,M.jsx)("input",{readOnly:!t,required:!0,autoFocus:!0,type:"url",name:"webhook",defaultValue:i,className:(0,Q.A)("text-sm text-gray-400 dark:text-gray-100 dark:bg-slate-900 px-2 py-1",t?"ring-1 ring-gray-500 bg-gray-50":"bg-transparent")})}),(0,M.jsx)("button",{type:"button",disabled:j,onClick:m,children:j?(0,M.jsx)(X.A,{size:16}):t?(0,M.jsx)(te,{className:"stroke-gray-500 !w-5 !h-5"}):(0,M.jsx)($.A,{className:"fill-gray-500 !w-5 !h-5"})}),t&&!j&&(0,M.jsx)("button",{type:"button",disabled:j,onClick:()=>{l(!1);const e=s.current;if(e){e.querySelector("input").value=(null===c||void 0===c?void 0:c.webhook_url)||""}},children:(0,M.jsx)(q.A,{className:"!w-5 !h-5 fill-gray-500"})})]}):(0,M.jsx)("button",{type:"button",className:"rounded-full bg-primary-50 text-green-600 text-xs py-0.5 px-2",onClick:()=>{l(!0)},children:"Set Webhook"})})},ie=({uid:e,webhook:s,closeModal:t})=>{const[i,r]=(0,a.useState)(s),[c,{isSuccess:u,isLoading:j}]=(0,P.H7)(),m=(0,a.useRef)(null),{t:g}=(0,l.Bd)("setting",{keyPrefix:"bot"}),{t:N}=(0,l.Bd)();return(0,a.useEffect)((()=>{u&&(n.oR.success(N("tip.update")),t())}),[u]),(0,M.jsx)(d.A,{id:"modal-modal",children:(0,M.jsx)(x.A,{title:g("webhook_title"),description:g("webhook_desc"),buttons:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(o.A,{className:"cancel",onClick:t.bind(null,void 0),children:N("action.cancel")}),(0,M.jsx)(o.A,{disabled:!i,onClick:()=>{var s;if(!m||!m.current)return;const t=m.current;if(!t.checkValidity())return void t.reportValidity();const a=(null===(s=new FormData(t).get("webhook"))||void 0===s?void 0:s.toString())||"";c({id:e,webhook_url:a})},children:j?"Updating":N("action.done")})]}),children:(0,M.jsxs)("form",{ref:m,className:"w-full flex flex-col gap-2",action:"/",children:[(0,M.jsx)("label",{htmlFor:"webhook",className:"text-sm text-gray-500",children:"Webhook URL"}),(0,M.jsx)(b.A,{name:"webhook",value:i,onChange:e=>{r(e.target.value)},type:"url"})]})})})},re=({title:e,desc:s})=>(0,M.jsxs)("div",{className:"flex flex-col text-sm",children:[(0,M.jsx)("h2",{className:"font-semibold dark:text-white",children:e}),(0,M.jsx)("p",{className:"text-gray-400 text-xs",children:s})]}),ce="p-6 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-100 align-top";function ne(){const[e,{isSuccess:s}]=(0,P.tt)(),[t,i]=(0,a.useState)(!1),[r,c]=(0,a.useState)(void 0),[d,u]=(0,a.useState)(void 0),x=(0,g.GV)((e=>Object.values(e.users.byId).filter((e=>!!e.is_bot))),y.bN),{t:j}=(0,l.Bd)("setting",{keyPrefix:"bot"}),{t:m}=(0,l.Bd)(),N=()=>{i((e=>!e))},h=e=>{u(e)};return(0,a.useEffect)((()=>{s&&n.oR.success(m("tip.update"))}),[s]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)("div",{className:"flex flex-col justify-start items-start gap-4",children:[(0,M.jsxs)("div",{className:"flex flex-col gap-4 max-w-[634px] mb-4",children:[(0,M.jsx)(re,{title:j("bot_tip_title"),desc:j("bot_tip_desc")}),(0,M.jsx)(re,{title:j("webhook_tip_title"),desc:j("webhook_tip_desc")})]}),(0,M.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,M.jsxs)("h2",{className:"font-semibold flex gap-4 items-center dark:text-white",children:[j("manage"),(0,M.jsxs)("a",{href:"https://doc.voce.chat/bot/bot-and-webhook",target:"_blank",className:"text-sm text-blue-400 underline-offset-1 underline",rel:"noopener noreferrer",children:["\ud83d\udd17 ",j("how_to_use")]})]}),(0,M.jsx)("p",{className:"text-gray-400 text-xs",children:j("manage_desc")})]}),(0,M.jsx)("div",{className:"w-full md:w-fit overflow-auto md:overflow-hidden",children:(0,M.jsxs)("table",{className:"min-w-full table-auto",children:[(0,M.jsx)("thead",{className:"border-b dark:border-b-gray-500 bg-gray-50 dark:bg-gray-600",children:(0,M.jsx)("tr",{children:[j("col_avatar"),j("col_name"),j("col_api_key"),j("col_webhook"),j("col_opt")].map((e=>(0,M.jsx)("th",{scope:"col",className:"text-sm font-bold text-gray-900 dark:text-gray-100 px-6 py-4 text-left",children:e},e)))})}),(0,M.jsx)("tbody",{children:x.map((s=>{const{uid:t,name:a,avatar:l}=s;return(0,M.jsxs)("tr",{className:"bg-white dark:bg-gray-800 border-b dark:border-b-gray-500 transition duration-300 ease-in-out md:hover:bg-gray-100 dark:md:hover:bg-transparent",children:[(0,M.jsx)("td",{className:"px-4 py-2",children:(0,M.jsx)(Y.A,{size:60,uid:t,url:l,uploadImage:e,name:a})}),(0,M.jsxs)("td",{className:`${ce}`,children:[(0,M.jsx)(ae,{uid:t}),(0,M.jsxs)("div",{className:"text-xs text-gray-500",children:["#",t]})]}),(0,M.jsx)("td",{className:`${ce} py-2`,children:(0,M.jsx)(K,{uid:t})}),(0,M.jsx)("td",{className:ce,children:(0,M.jsx)(le,{uid:t})}),(0,M.jsx)("td",{className:ce,children:(0,M.jsx)("button",{type:"button",onClick:h.bind(null,{uid:t,name:a}),children:(0,M.jsx)(B.A,{className:"hover:opacity-80"})})})]},t)}))})]})}),(0,M.jsx)("div",{className:"flex gap-4",children:(0,M.jsx)(o.A,{onClick:N,className:"small",children:m("action.add")})})]}),t&&(0,M.jsx)(Z,{closeModal:N}),r&&(0,M.jsx)(ie,{closeModal:e=>{c(e)},...r}),d&&(0,M.jsx)(H,{closeModal:h,...d})]})}var de=t(90800),oe=t(73050),ue=t(216);const xe=({link:e,text:s})=>(0,M.jsxs)("div",{className:"tip",children:[(0,M.jsx)(ue.A,{className:"dark:fill-gray-300"}),(0,M.jsx)("a",{href:e,target:"_blank",className:"link",rel:"noreferrer",children:s})]});function je(){const{t:e}=(0,l.Bd)("setting",{keyPrefix:"agora"}),{changed:s,reset:t,values:a,setValues:i,toggleEnable:r,updateConfig:c}=E("agora"),n=e=>{const s=e.target.value,{type:t=""}=e.target.dataset;i((e=>e?{...e,[t]:s}:e))};if(!a)return null;const{url:d,project_id:o,app_id:u,app_certificate:x,customer_id:j,customer_secret:m,enabled:g=!1}=a,N=d||"https://api.agora.io";return(0,M.jsxs)("div",{className:"setting-container",children:[(0,M.jsxs)("div",{className:"inputs",children:[(0,M.jsxs)("div",{className:"input row",children:[(0,M.jsxs)(oe.A,{className:"flex items-center gap-2",children:["Enable",(0,M.jsx)(xe,{link:"https://doc.voce.chat/setting/setting-agora",text:e("how_to")})]}),(0,M.jsx)(T.A,{onClick:r,checked:g})]}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsx)(oe.A,{htmlFor:"url",children:"Agora URL"}),(0,M.jsx)(b.A,{disabled:!g,"data-type":"url",onChange:n,value:N,name:"url",placeholder:"Agora URL"})]}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsx)(oe.A,{htmlFor:"project_id",children:"Project ID"}),(0,M.jsx)(b.A,{spellCheck:!1,disabled:!g,"data-type":"project_id",onChange:n,value:o,name:"project_id",placeholder:"Project ID"})]}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsx)(oe.A,{htmlFor:"app_id",children:"App ID"}),(0,M.jsx)(b.A,{spellCheck:!1,disabled:!g,"data-type":"app_id",onChange:n,value:u,name:"app_id",placeholder:"APP ID"})]}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsx)(oe.A,{htmlFor:"app_certificate",children:"APP Certificate"}),(0,M.jsx)(b.A,{spellCheck:!1,disabled:!g,"data-type":"app_certificate",onChange:n,value:x,name:"app_certificate",placeholder:"APP Certificate"})]}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsx)(oe.A,{htmlFor:"customer_id",children:"Customer ID"}),(0,M.jsx)(b.A,{spellCheck:!1,disabled:!g,"data-type":"customer_id",onChange:n,value:j,name:"customer_id",placeholder:"Customer ID for RESTful API"})]}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsx)(oe.A,{htmlFor:"customer_secret",children:"Customer Secret"}),(0,M.jsx)(b.A,{spellCheck:!1,disabled:!g,"data-type":"customer_secret",onChange:n,value:m,name:"customer_secret",placeholder:"Customer Secret for RESTful API"})]})]}),s&&(0,M.jsx)(de.A,{saveHandler:()=>{const e=a;e.url||(e.url="https://api.agora.io"),c(e)},resetHandler:t})]})}var Me=t(11433),me=t(49912);function ge(){const{values:e,setValues:s,updateConfig:t,changed:a,reset:i}=E("firebase"),{t:r}=(0,l.Bd)("setting"),c={disable:r("firebase.disable"),official:r("firebase.use_official"),custom:r("firebase.custom")};let n="";if(e){const{use_official:s,enabled:t=!1}=e;n=t?s?"official":"custom":"disable"}const d=e=>{const t=e.target.value,{type:a=""}=e.target.dataset;s((e=>e?{...e,[a]:t}:e))};if(!e)return null;const{token_url:o,project_id:u,private_key:x,client_email:j}=e;return(0,M.jsxs)("div",{className:"setting-container max-md:w-full max-md:h-auto",children:[(0,M.jsx)(Me.A,{options:Object.values(c),values:Object.keys(c),value:n,onChange:t=>{let a=null;switch(t){case"custom":a={...e,enabled:!0,use_official:!1};break;case"official":a={...e,enabled:!0,use_official:!0};break;case"disable":a={...e,enabled:!1}}a&&s(a)}}),(0,M.jsxs)("fieldset",{className:"inputs",disabled:"custom"!==n,children:[(0,M.jsxs)("div",{className:"input",children:[(0,M.jsx)(oe.A,{htmlFor:"name",children:r("firebase.token_url")}),(0,M.jsx)(b.A,{"data-type":"token_url",onChange:d,value:o,name:"token_url",placeholder:r("firebase.token_url")})]}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsx)(oe.A,{htmlFor:"project_id",children:r("firebase.project_id")}),(0,M.jsx)(b.A,{"data-type":"project_id",onChange:d,value:u,name:"project_id",placeholder:r("firebase.project_id")})]}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsx)(oe.A,{htmlFor:"private_key",children:r("firebase.private_key")}),(0,M.jsx)(me.A,{rows:10,spellCheck:!1,"data-type":"private_key",onChange:d,value:x,name:"private_key",placeholder:r("firebase.private_key")})]}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsx)(oe.A,{htmlFor:"client_email",children:r("firebase.client_email")}),(0,M.jsx)(b.A,{"data-type":"client_email",onChange:d,value:j,name:"client_email",placeholder:r("firebase.client_email")})]})]}),a&&(0,M.jsx)(de.A,{saveHandler:()=>{t(e)},resetHandler:()=>{i()}})]})}var Ne,he=t(61082),pe=t(55146),_e=t(96018);function De(){return De=Object.assign?Object.assign.bind():function(e){for(var s=1;sa.createElement("svg",De({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:l,"aria-labelledby":s},t),e?a.createElement("title",{id:s},e):null,Ne||(Ne=a.createElement("path",{d:"M8.00004 1.33301C4.32004 1.33301 1.33337 4.31967 1.33337 7.99967C1.33337 11.6797 4.32004 14.6663 8.00004 14.6663C11.68 14.6663 14.6667 11.6797 14.6667 7.99967C14.6667 4.31967 11.68 1.33301 8.00004 1.33301ZM11.3334 8.66634H4.66671V7.33301H11.3334V8.66634Z",fill:"#D0D5DD"}))),we=(0,a.forwardRef)(ye),fe=JSON.parse('[{"title":"Google","value":"accounts.google.com","selected":false,"icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzE1OTA1XzI0Njk1KSI+CjxwYXRoIGQ9Ik0yMy43NjYgMTIuMjc2M0MyMy43NjYgMTEuNDYwNSAyMy42OTk5IDEwLjY0MDQgMjM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OTV6TTE0NC4zNTkxOCAxMDEuNjY2OThsNDAuNTY1ODIgNDAuNTY1ODFoMTMuNzY0OHoiLz4KICA8L2c+Cjwvc3ZnPg==","underline":true},{"title":"Custom","value":"","selected":false}]'),Ae=({issuers:e=[],onChange:s})=>{const{t:t}=(0,l.Bd)(),[i,r]=(0,a.useState)(null),[c,n]=(0,a.useState)(""),d=!c&&!(null!==i&&void 0!==i&&i.value)||!(null!==i&&void 0!==i&&i.title)||e.some((e=>e.domain===c));return(0,M.jsx)("div",{className:"py-4 w-full flex flex-col gap-4",children:(0,M.jsxs)("ul",{className:"flex flex-col gap-4",children:[e.map((({enable:t,favicon:a,domain:l})=>(0,M.jsxs)("li",{className:"flex items-center justify-between gap-10",children:[(0,M.jsxs)("div",{className:"flex-1 flex items-center justify-between",children:[(0,M.jsx)(we,{className:"cursor-pointer",onClick:()=>{s(e.filter((e=>e.domain!==l)))}}),(0,M.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[Boolean(a)&&(0,M.jsx)("img",{src:a,alt:"logo",className:"w-8 h-8"}),(0,M.jsx)(b.A,{readOnly:!0,value:l,prefix:"https://",placeholder:"Issuer Domain",className:"w-[280px]"})]})]}),(0,M.jsx)("div",{className:"w-14 flex justify-end",children:(0,M.jsx)(T.A,{checked:t,onClick:()=>{s(e.map((e=>({...e,enable:e.domain===l?!t:e.enable}))))}})})]},l))),(0,M.jsxs)("li",{className:"flex items-center justify-between gap-10 cursor-pointer",children:[(0,M.jsxs)("div",{className:"flex-1 flex items-center justify-between",children:[(0,M.jsx)(_e.A,{options:fe.map((s=>({...s,selected:e.some((e=>e.domain===s.value))}))),current:i,updateSelect:r}),(0,M.jsx)("div",{className:"flex items-center justify-between gap-4",children:(0,M.jsx)(b.A,{onChange:e=>{n(e.target.value)},readOnly:!(null===i||void 0===i||!i.value),value:(null===i||void 0===i?void 0:i.value)||c,prefix:"https://",placeholder:"domain.com",className:"w-[280px]"})})]}),(0,M.jsx)("div",{className:"w-14 flex justify-end",children:(0,M.jsx)(o.A,{disabled:d,onClick:()=>{const t=fe.find((e=>e.value===(null===i||void 0===i?void 0:i.value)));if(!t)return;const{icon:a,value:l}=t;s(e.concat({enable:!0,favicon:a||"",domain:l||c})),r(null),n("")},children:t("action.add")})})]})]})})};t(24555);const ve=({to:e,children:s})=>(0,M.jsx)("a",{href:e,className:"text-primary-500",target:"_blank",rel:"noreferrer",children:s});function Ie({link:e="#"}){return(0,M.jsx)(A.Ay,{delay:[0,500],interactive:!0,arrow:v.qO,placement:"bottom",content:(0,M.jsx)("div",{className:"py-2 px-3 bg-gray-800 text-xs text-white rounded-lg",children:(0,M.jsx)(l.x6,{ns:"setting",i18nKey:"login.more_details",children:(0,M.jsx)(ve,{to:e})})}),children:(0,M.jsx)(ue.A,{className:"icon"})})}function be(){const{t:e}=(0,l.Bd)("setting",{keyPrefix:"login"}),{t:s}=(0,l.Bd)(),{changed:t,clientId:a,updateClientId:i,updateClientIdToServer:r}=(0,pe.A)(),{config:c,changed:d,updateGithubAuthConfigToServer:o,updateGithubAuthConfig:u}=(0,he.A)(),{values:x,updateConfig:j,setValues:m,reset:g,changed:N}=E("login"),h=e=>{const{key:s}=e.target.dataset;s&&u({[s]:e.target.value})},p=e=>{m((s=>s?{...s,...e}:s))};if(!x)return null;const{google:_,magic_link:D,github:y,metamask:w,password:f,oidc:A=[]}=x,v=t||N||d;return(0,M.jsxs)("div",{className:"setting-container max-md:w-full max-md:h-auto",children:[(0,M.jsxs)("div",{className:"inputs",children:[(0,M.jsx)("div",{className:"input",children:(0,M.jsxs)("div",{className:"row",children:[(0,M.jsxs)("div",{className:"title",children:[(0,M.jsx)("div",{className:"txt",children:(0,M.jsx)(oe.A,{children:e("password")})}),(0,M.jsx)("span",{className:"desc dark:!text-gray-400",children:e("password_desc")})]}),(0,M.jsx)(T.A,{onClick:p.bind(null,{password:!f}),checked:f})]})}),(0,M.jsx)("div",{className:"input",children:(0,M.jsxs)("div",{className:"row",children:[(0,M.jsxs)("div",{className:"title",children:[(0,M.jsx)("div",{className:"txt",children:(0,M.jsx)(oe.A,{children:e("magic_link")})}),(0,M.jsx)("span",{className:"desc dark:!text-gray-400",children:e("magic_link_desc")})]}),(0,M.jsx)(T.A,{onClick:p.bind(null,{magic_link:!D}),checked:D})]})}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsxs)("div",{className:"row",children:[(0,M.jsxs)("div",{className:"title",children:[(0,M.jsxs)("div",{className:"txt",children:[(0,M.jsx)(oe.A,{children:e("google")}),(0,M.jsx)(Ie,{link:"https://doc.voce.chat/setting/third_login/login-google"})]}),(0,M.jsx)("span",{className:"desc dark:!text-gray-400",children:e("google_desc")})]}),(0,M.jsx)(T.A,{onClick:p.bind(null,{google:!_}),checked:_})]}),(0,M.jsx)("div",{className:"row",children:(0,M.jsx)(b.A,{disabled:!_,onChange:e=>{i(e.target.value)},placeholder:"Client ID",value:a})})]}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsxs)("div",{className:"row",children:[(0,M.jsxs)("div",{className:"title",children:[(0,M.jsxs)("div",{className:"txt",children:[(0,M.jsx)(oe.A,{children:e("github")}),(0,M.jsx)(Ie,{link:"https://doc.voce.chat/setting/third_login/login-github"})]}),(0,M.jsx)("span",{className:"desc dark:!text-gray-400",children:e("github_desc")})]}),(0,M.jsx)(T.A,{onClick:p.bind(null,{github:!y}),checked:y})]}),(0,M.jsxs)("div",{className:"row inputs",children:[(0,M.jsx)(b.A,{disabled:!y,"data-key":"client_id",onChange:h,placeholder:"GitHub Client ID",value:null===c||void 0===c?void 0:c.client_id}),(0,M.jsx)(b.A,{disabled:!y,"data-key":"client_secret",onChange:h,placeholder:"GitHub Client Secret",value:null===c||void 0===c?void 0:c.client_secret})]})]}),(0,M.jsx)("div",{className:"input",children:(0,M.jsxs)("div",{className:"row",children:[(0,M.jsxs)("div",{className:"title",children:[(0,M.jsxs)("div",{className:"txt",children:[(0,M.jsx)(oe.A,{children:e("metamask")}),(0,M.jsx)(Ie,{link:"https://doc.voce.chat/setting/third_login/login-metamask"})]}),(0,M.jsx)("span",{className:"desc dark:!text-gray-400",children:e("metamask_desc")})]}),(0,M.jsx)(T.A,{onClick:p.bind(null,{metamask:!w}),checked:w})]})}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsx)("div",{className:"row",children:(0,M.jsxs)("div",{className:"title",children:[(0,M.jsxs)("div",{className:"txt",children:[(0,M.jsx)(oe.A,{children:e("oidc")}),(0,M.jsx)(Ie,{link:"https://doc.voce.chat/setting/third_login/login-webid"})]}),(0,M.jsx)("span",{className:"desc dark:!text-gray-400",children:e("oidc_desc")})]})}),(0,M.jsx)("div",{className:"row",children:(0,M.jsx)(Ae,{issuers:A,onChange:e=>{m((s=>s?{...s,oidc:e}:s))}})})]})]}),v&&(0,M.jsx)(de.A,{saveHandler:async()=>{const{google:e}=x;N&&j(x),e&&t&&(await r(),N||n.Ay.success(s("tip.update"))),y&&d&&(await o(),N||n.Ay.success(s("tip.update")))},resetHandler:g})]})}function Te(){const{t:e}=(0,l.Bd)("setting",{keyPrefix:"smtp"}),[s,t]=(0,a.useState)(""),[i,{isSuccess:r,isError:c}]=(0,I.lg)(),{reset:d,updateConfig:u,values:x,originalValues:j,setValues:m,changed:g,toggleEnable:N}=E("smtp"),h=e=>{const s=e.target.value,{type:t=""}=e.target.dataset;m((e=>e?{...e,[t]:s}:e))};if((0,a.useEffect)((()=>{r&&n.Ay.success("Send Test Email Successfully"),c&&n.Ay.error("Send Test Email Fail")}),[r,c]),!x)return null;const{host:p,port:_,from:D,username:y,password:w,enabled:f=!1}=x;return(0,M.jsxs)("div",{className:"setting-container max-md:w-full",children:[(0,M.jsxs)("div",{className:"inputs",children:[(0,M.jsxs)("div",{className:"input row",children:[(0,M.jsxs)(oe.A,{className:"flex items-center gap-2",children:[e("enable")," ",(0,M.jsx)(xe,{link:"https://doc.voce.chat/setting/smtp/smtp-gmail",text:e("how_to")})]}),(0,M.jsx)(T.A,{onClick:N,checked:f})]}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsx)(oe.A,{htmlFor:"host",children:e("host")}),(0,M.jsx)(b.A,{disabled:!f,"data-type":"host",onChange:h,value:p,name:"host",placeholder:"SMTP Host"})]}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsx)(oe.A,{htmlFor:"port",children:e("port")}),(0,M.jsx)(b.A,{disabled:!f,type:"number","data-type":"port",onChange:h,value:_,name:"port",placeholder:"SMTP Port"})]}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsx)(oe.A,{htmlFor:"from",children:e("from")}),(0,M.jsx)(b.A,{disabled:!f,"data-type":"from",onChange:h,value:D,name:"from",placeholder:"SMTP From"})]}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsx)(oe.A,{htmlFor:"username",children:e("username")}),(0,M.jsx)(b.A,{disabled:!f,"data-type":"username",onChange:h,value:y,name:"username",placeholder:"SMTP Username"})]}),(0,M.jsxs)("div",{className:"input",children:[(0,M.jsx)(oe.A,{htmlFor:"password",children:e("password")}),(0,M.jsx)(b.A,{type:"password",disabled:!f,"data-type":"password",onChange:h,value:w,name:"password",placeholder:"SMTP Password"})]})]}),(0,M.jsxs)("div",{className:"flex gap-4 whitespace-nowrap mt-6",children:[(0,M.jsx)(b.A,{type:"email",disabled:!j.enabled,onChange:e=>{const s=e.target.value;t(s)},value:s,name:"email",placeholder:"test@email.com"}),(0,M.jsx)(o.A,{disabled:!f||!s,onClick:()=>{i({to:s,subject:"test title",content:"test content"})},children:e("send_test_email")})]}),g&&(0,M.jsx)(de.A,{saveHandler:()=>{var e;u({...x,port:Number(null!==(e=null===x||void 0===x?void 0:x.port)&&void 0!==e?e:0)})},resetHandler:d})]})}const Le=({title:e,desc:s,children:t})=>(0,M.jsxs)("div",{className:"text-sm",children:[(0,M.jsx)("p",{className:"text-gray-600 dark:text-gray-100 font-semibold",children:e}),(0,M.jsx)("p",{className:"flex justify-between w-full text-gray-400 mb-2 text-xs",children:s}),t]}),ke=()=>{const e=(0,g.GV)((e=>{var s;return null!==(s=e.server.max_file_expiry_mode)&&void 0!==s?s:"Off"}),y.bN),{t:s}=(0,l.Bd)("setting",{keyPrefix:"data.auto_delete_file"}),{t:t}=(0,l.Bd)(),{refetch:i}=(0,I.Mv)(),[r,c]=(0,a.useState)(e),[u,{isSuccess:j,isLoading:m}]=(0,I.u3)();(0,a.useEffect)((()=>{j&&(i(),n.oR.success(t("tip.update")))}),[j]);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Le,{title:s("title"),desc:s("desc"),children:(0,M.jsx)(Me.A,{options:[s("off"),s("day1"),s("day7"),s("day30"),s("day90"),s("day180")],values:["Off","Day1","Day7","Day30","Day90","Day180"],value:e,onChange:e=>{c(e)}})}),r!==e&&(0,M.jsx)(d.A,{id:"modal-modal",children:(0,M.jsx)(x.A,{title:"Are you sure?",description:"Off"==r?"":s("confirm_desc"),buttons:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(o.A,{className:"cancel",onClick:()=>{c(e)},children:t("action.cancel")}),(0,M.jsx)(o.A,{onClick:()=>{u({max_file_expiry_mode:r})},className:"danger",children:m?"Updating":t("action.yes")})]})})})]})},Ee=({context:e,title:s,desc:t,closeModal:i})=>{const{t:r}=(0,l.Bd)(),[c,{isLoading:u,isSuccess:j}]=(0,I.J9)(),[m,{isLoading:g,isSuccess:N}]=(0,I.kw)(),h=j||N;(0,a.useEffect)((()=>{h&&(n.Ay.success("Clear success"),i())}),[h]);const p=g||u;return(0,M.jsx)(d.A,{id:"modal-modal",children:(0,M.jsx)(x.A,{title:s,description:t,buttons:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(o.A,{className:"cancel",onClick:i,children:r("action.cancel")}),(0,M.jsx)(o.A,{onClick:()=>{switch(e){case"chat":m();break;case"files":c()}},className:"danger",children:p?"Clearing":r("action.remove")})]})})})},Oe=({empty:e=!1,version:s,children:t})=>{const{t:a}=(0,l.Bd)(),i=(0,g.GV)((e=>e.server.version),y.bN);if(!i)return null;return(0,w.Gm)(i,s)<0?e?null:(0,M.jsxs)("div",{className:"flex flex-col gap-2 items-start border border-solid border-orange-500 p-3 rounded-lg w-fit",children:[(0,M.jsx)("span",{className:"text-gray-400 text-sm",children:(0,M.jsx)(l.x6,{i18nKey:"server_update.version_needed",children:(0,M.jsx)("strong",{className:"font-bold",children:{version:s}})})}),(0,M.jsx)("span",{className:"text-gray-400 text-sm",children:(0,M.jsx)(l.x6,{i18nKey:"server_update.current_version",children:(0,M.jsx)("strong",{className:"font-bold",children:{version:i}})})}),(0,M.jsx)("span",{className:"text-gray-400 text-sm",children:a("server_update.update_tip")}),(0,M.jsxs)("a",{className:"text-blue-500 underline",href:"https://doc.voce.chat/install/install-by-docker#update-vocechat-docker",target:"_blank",rel:"noopener noreferrer",children:[a("server_update.howto")," \ud83d\udcd6"," "]})]}):t};function Ce(){const[e,s]=(0,a.useState)(null),{t:t}=(0,l.Bd)("setting"),i=e=>{s(e)},r={chat:t("data.clear_msgs.desc"),files:t("data.clear_files.desc")};return(0,M.jsxs)("div",{className:"relative w-full md:w-[512px] flex flex-col gap-6",children:[(0,M.jsx)(Oe,{version:"0.3.10",empty:!0,children:(0,M.jsx)(Le,{title:t("data.clear_msgs.title"),desc:t("data.clear_msgs.desc"),children:(0,M.jsx)(o.A,{onClick:i.bind(null,"chat"),className:"danger",children:t("data.clear_msgs.btn")})})}),(0,M.jsx)(Le,{title:t("data.clear_files.title"),desc:t("data.clear_files.desc"),children:(0,M.jsx)(o.A,{onClick:i.bind(null,"files"),className:"danger",children:t("data.clear_files.btn")})}),(0,M.jsx)(ke,{}),e&&(0,M.jsx)(Ee,{closeModal:i.bind(null,null),context:e,title:"Are you sure?",desc:r[e]})]})}var ze=t(85666),Se=t(53374);const Ue=e=>{const s=_()();let t=s;switch(e){case"year":t=s.add(100,"year");break;case"month":t=s.add(1,"month");break;case"quarter":t=s.add(3,"month")}return t.format("YYYY-MM-DD")},Pe=(0,F.JZ)(),Ye=({closeModal:e})=>{const{t:s}=(0,l.Bd)("setting"),{t:t}=(0,l.Bd)(),[i,{isLoading:r,isSuccess:c}]=(0,I.Bh)(),[u,j]=(0,a.useState)(location.hostname),[m,g]=(0,a.useState)(!1),[N,h]=(0,a.useState)(`${Pe[0].pid}|${Pe[0].limit}|${Pe[0].type}|${Pe[0].sub_dur||""}`),p=()=>{g((e=>!e))},_=N.includes("booking");return(0,M.jsx)(d.A,{id:"modal-modal",children:(0,M.jsx)(x.A,{title:s("license.renew"),description:s("license.renew_select"),buttons:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(o.A,{onClick:e,className:"ghost",children:t("action.cancel")}),_?(0,M.jsx)(o.A,{onClick:()=>{window.open("https://calendly.com/hansu","_blank")},children:"Booking a meeting!"}):(0,M.jsx)(A.Ay,{visible:m,interactive:!0,placement:"top-end",offset:[-50,-40],trigger:"click",content:(0,M.jsxs)("div",{className:"p-3 rounded-lg border border-solid border-gray-200 dark:border-gray-900 flex flex-col items-start gap-3 w-[430px] bg-white dark:bg-gray-800 shadow shadow-gray-200 dark:shadow-gray-900 drop-shadow-xl",children:[(0,M.jsx)("div",{className:"text-gray-500 text-sm",children:s("license.tip_domain")}),(0,M.jsx)(b.A,{value:u,onChange:e=>{j(e.target.value)}}),(0,M.jsxs)("div",{className:"flex justify-between items-center w-full mt-4",children:[(0,M.jsxs)("span",{className:"text-xs text-orange-500 text-left",children:[" ",s("license.tip_port")]}),(0,M.jsxs)("div",{className:"flex gap-3 whitespace-nowrap",children:[(0,M.jsx)(o.A,{className:"mini cancel",onClick:p,children:t("action.cancel")}),(0,M.jsx)(o.A,{className:"mini",disabled:r||c,onClick:async()=>{const e=`https://${u}`;if(!Se.t6(e))return void n.Ay.error("Invalid Host");if(""!==new URL(e).port||u.endsWith(":443"))return void n.Ay.error(s("license.tip_port"));const[t,a,l,r="month"]=N.split("|"),c={user_limit:Number(a),expire:Ue("subscription"==l?r:"year"),domain:u.startsWith("localhost")?"*":u},d=await i({type:l,priceId:t,metadata:c,cancel_url:location.href,success_url:`${location.origin}/#/cb/payment_success`});"error"in d?n.Ay.error("Payment link initialized failed!"):(d.data,location.href=d.data.session_url)},children:r?"Initialize Payment URL":c?"Redirecting":s("license.tip_confirm")})]})]})]}),children:(0,M.jsxs)("button",{onClick:p,className:"text-sm text-white bg-primary-400 break-keep shadow rounded-lg px-3.5 py-2.5 md:hover:bg-primary-500 active:bg-primary-500 disabled:bg-gray-300",children:[" ",s("license.renew")]})})]}),children:(0,M.jsx)(Me.A,{options:Pe.map((({title:e,desc:s,price:t})=>`${e} ${s?`[${s}]`:""}${t?`[${t}]`:""}`)),values:Pe.map((({pid:e,limit:s,type:t="payment",sub_dur:a="month"})=>`${e}|${s}|${t}|${a}`)),value:N,onChange:e=>{h(e)}})})})},Be=({closeModal:e,updateLicense:s,updating:t,updated:i})=>{const[r,c]=(0,a.useState)(""),{t:u}=(0,l.Bd)("setting"),{t:j}=(0,l.Bd)();return(0,a.useEffect)((()=>{i&&(n.Ay.success(j("tip.update")),e())}),[i]),(0,M.jsx)(d.A,{id:"modal-modal",children:(0,M.jsx)(x.A,{buttons:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(o.A,{onClick:e,className:"ghost",children:j("action.cancel")}),(0,M.jsx)(o.A,{disabled:t||i||!r,onClick:async()=>{const e=await s(r);"boolean"!=typeof e||e||n.Ay.error("Check License Invalid!")},children:t?"Updating":i?"Update Successfully":u("license.update")})]}),children:(0,M.jsx)(me.A,{rows:18,placeholder:u("license.update_placeholder"),value:r,onChange:e=>{c(e.target.value)}})})})},Qe=({label:e,data:s,foldable:t=!1,...a})=>{const l=(0,Q.A)("font-bold w-full cursor-pointer dark:text-green-500",t?"truncate":"whitespace-pre-wrap break-all");return s?(0,M.jsxs)("div",{className:"whitespace-nowrap flex flex-col items-start justify-start text-lg",children:[(0,M.jsx)("span",{className:"text-sm text-green-500",children:e}),Array.isArray(s)?(0,M.jsx)("ul",{className:l,children:s.map((e=>(0,M.jsx)("li",{children:e},e)))}):(0,M.jsx)("span",{className:l,...a,children:s})]}):null};function Re(){var e;const{t:s,i18n:t}=(0,l.Bd)("setting"),{license:i,reachLimit:r,upsertLicense:c,upserting:n,upserted:d}=(0,ze.A)(!0),[u,x]=(0,a.useState)(!1),[j,m]=(0,a.useState)(!1),[g,N]=(0,a.useState)(!0),h=()=>{x((e=>!e))},p=()=>{m((e=>!e))};return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)("div",{className:"max-w-3xl flex flex-col justify-start items-start gap-4",children:[(0,M.jsxs)("div",{className:(0,Q.A)("relative w-full p-3 rounded border-solid border flex flex-col gap-4 shadow",r?"border-red-600 bg-red-200/50":"border-green-600 bg-green-100 dark:bg-green-900"),children:[(0,M.jsx)(Qe,{label:s("license.signed"),data:null!==i&&void 0!==i&&i.sign?"Yes":"Not Yet"}),(0,M.jsx)(Qe,{label:s("license.domain"),data:null===i||void 0===i?void 0:i.domains}),(0,M.jsx)(Qe,{label:s("license.user_limit"),data:(null!==(e=null===i||void 0===i?void 0:i.user_limit)&&void 0!==e?e:0)>=999999?"No Limit":null===i||void 0===i?void 0:i.user_limit}),(0,M.jsx)(Qe,{label:s("license.expire"),data:_()(null===i||void 0===i?void 0:i.expired_at).format("YYYY-MM-DD h:mm:ss A")}),(0,M.jsx)(Qe,{label:s("license.create"),data:_()(null===i||void 0===i?void 0:i.created_at).format("YYYY-MM-DD h:mm:ss A")}),(0,M.jsx)(Qe,{label:s("license.value"),data:null===i||void 0===i?void 0:i.base58,foldable:g,title:g?"Click to see full text":"Click to fold text",onClick:()=>{N((e=>!e))}})]}),(0,M.jsxs)("div",{className:"flex gap-2",children:[(0,M.jsx)(o.A,{onClick:h,children:s("license.renew")}),(0,M.jsx)(o.A,{onClick:p,className:"ghost",children:s("license.update")})]}),(0,M.jsxs)("div",{className:"flex flex-col gap-4 bg-primary-500 text-white rounded drop-shadow-xl p-5",children:[(0,M.jsxs)("h2",{className:"text-2xl font-bold",children:[s("license.tip.title")," \ud83c\udf81"]}),(0,M.jsxs)("p",{className:"flex flex-col",children:[(0,M.jsx)("span",{children:s("license.tip.user_test")}),(0,M.jsxs)("span",{children:[s("license.tip.contact"),t.language.startsWith("zh")?"Privoce":(0,M.jsx)("a",{className:"underline text-lg text-green-200",href:"https://calendly.com/hansu/han-meeting",target:"_blank",rel:"noopener noreferrer",children:"https://calendly.com/hansu/han-meeting"})]})]})]})]}),u&&(0,M.jsx)(Ye,{closeModal:h}),j&&(0,M.jsx)(Be,{updated:d,updating:n,updateLicense:c,closeModal:p})]})}var Ge=t(2890);const We=()=>{const e=(0,g.GV)((e=>{var s;return null!==(s=e.server.chat_layout_mode)&&void 0!==s?s:"Left"}),y.bN),{t:s}=(0,l.Bd)("setting",{keyPrefix:"overview.chat_layout"}),{t:t}=(0,l.Bd)(),{refetch:i}=(0,I.Mv)(),[r,{isSuccess:c}]=(0,I.u3)();(0,a.useEffect)((()=>{c&&(i(),n.oR.success(t("tip.update")))}),[c]);return(0,M.jsx)(Le,{title:s("title"),desc:s("desc"),children:(0,M.jsx)(Me.A,{options:[s("left"),s("self_right")],values:["Left","SelfRight"],value:e,onChange:e=>{r({chat_layout_mode:e})}})})},Ve=()=>{const e=(0,g.GV)((e=>!!e.server.contact_verification_enable),y.bN),{t:s}=(0,l.Bd)("setting",{keyPrefix:"overview.contact_verify"}),{t:t}=(0,l.Bd)(),{refetch:i}=(0,I.Mv)(),[r,{isSuccess:c}]=(0,I.u3)();(0,a.useEffect)((()=>{c&&(i(),n.oR.success(t("tip.update")))}),[c]);return(0,M.jsx)(Le,{title:s("title"),desc:s("desc"),children:(0,M.jsx)(Me.A,{options:[s("enable"),s("disable")],values:["true","false"],value:`${e}`,onChange:()=>{r({contact_verification_enable:!e})}})})},Ke=()=>{const[e,s]=(0,a.useState)(localStorage.theme||"auto"),{t:t}=(0,l.Bd)("setting");return(0,M.jsx)(Le,{title:t("overview.theme.title"),desc:t("overview.theme.desc"),children:(0,M.jsx)(Me.A,{options:[t("overview.theme.auto"),t("overview.theme.dark"),t("overview.theme.light")],values:["auto","dark","light"],value:e,onChange:e=>{(e=>{if(s(e),localStorage.theme=e,document.documentElement.classList.remove("dark"),document.documentElement.classList.remove("light"),"auto"!==e)document.documentElement.classList.add(e);else{const e=window.matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.classList.add(e?"dark":"light")}})(e)}})})},Fe=()=>{const{data:e,isSuccess:s}=(0,I.X)(),[t,i]=(0,a.useState)(location.origin),{t:r}=(0,l.Bd)("setting"),{t:c}=(0,l.Bd)(),[d,{isLoading:u,isSuccess:x}]=(0,I.PX)();return(0,a.useEffect)((()=>{x&&n.oR.success(c("tip.update"))}),[x]),(0,a.useEffect)((()=>{s&&e&&i(e)}),[s,e]),(0,M.jsx)(Le,{title:r("overview.url.title"),desc:r("overview.url.desc"),children:(0,M.jsxs)("div",{className:"flex items-center gap-4 mt-2",children:[(0,M.jsx)(b.A,{placeholder:"frontend url",value:t,onChange:e=>{i(e.target.value)}}),(0,M.jsxs)(o.A,{disabled:!t||u,className:"small",onClick:()=>{d(t)},children:[" ",c("action.update")]})]})})},Ze=["en","zh","jp","tr","pt","es"],He=()=>{const{t:e,i18n:s}=(0,l.Bd)("setting");return(0,M.jsx)(Le,{title:e("overview.lang.title"),desc:e("overview.lang.desc"),children:(0,M.jsx)(Me.A,{options:[e("overview.lang.en"),e("overview.lang.zh"),e("overview.lang.jp"),e("overview.lang.tr"),e("overview.lang.pt"),e("overview.lang.es")],values:Ze,value:s.language.split("-")[0],onChange:e=>{(e=>{s.changeLanguage(e)})(e)}})})},Je=()=>{const e=(0,g.GV)((e=>!!e.server.show_user_online_status),y.bN),{t:s}=(0,l.Bd)("setting",{keyPrefix:"overview.online_status"}),{t:t}=(0,l.Bd)(),{refetch:i}=(0,I.Mv)(),[r,{isSuccess:c}]=(0,I.u3)();(0,a.useEffect)((()=>{c&&(i(),n.oR.success(t("tip.update")))}),[c]);return(0,M.jsx)(Le,{title:s("title"),desc:s("desc"),children:(0,M.jsx)(Me.A,{options:[s("enable"),s("disable")],values:["true","false"],value:`${e}`,onChange:()=>{r({show_user_online_status:!e})}})})};var Xe=t(859);const qe=()=>{const e=(0,y.wA)(),s=(0,g.GV)((e=>!!e.ui.msgSound),y.bN),{t:t}=(0,l.Bd)("setting",{keyPrefix:"overview.message_sound"});return(0,M.jsx)(Le,{title:t("title"),desc:t("desc"),children:(0,M.jsx)(Me.A,{options:[t("enable"),t("disable")],values:["true","false"],value:`${s}`,onChange:()=>{e((0,Xe.iy)(!s))}})})},$e=()=>{const{t:e}=(0,l.Bd)("setting"),{t:s}=(0,l.Bd)(),t=(0,g.GV)((e=>{var s;return null===(s=e.authData.user)||void 0===s?void 0:s.is_admin}),y.bN),i=(0,g.GV)((e=>e.server),y.bN),[r,{isSuccess:c}]=(0,I.PZ)(),[d]=(0,I.NI)(),[o,u]=(0,a.useState)(!1),[x,j]=(0,a.useState)(i),m=e=>{const s=e.target.value,{type:t=""}=e.target.dataset;j((e=>({...e,[t]:s})))};(0,a.useEffect)((()=>{i&&j(i)}),[i]),(0,a.useEffect)((()=>{c&&n.Ay.success(s("tip.update"))}),[c]),(0,a.useEffect)((()=>{if(i&&x){const{name:e,description:s}=x,{name:t,description:a}=i;u(t!==e||a!==s)}}),[i,x]);const{name:N,description:h,logo:p}=x;return x?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)("div",{className:"flex gap-4",children:[(0,M.jsx)("div",{className:"w-24 h-24",children:(0,M.jsx)(Y.A,{disabled:!t,url:c?`${p}?t=${+new Date}`:p,name:N,uploadImage:r})}),t&&(0,M.jsx)("div",{className:"flex flex-col justify-between items-start",children:(0,M.jsx)("div",{className:"text-sm text-gray-600 dark:text-gray-100",children:e("overview.upload_desc")})})]}),(0,M.jsxs)("div",{className:"flex flex-col items-start gap-6 mb-3",children:[(0,M.jsxs)("div",{className:"w-full flex flex-col items-start gap-2",children:[(0,M.jsx)(oe.A,{htmlFor:"name",children:e("overview.name")}),(0,M.jsx)(b.A,{disabled:!t,"data-type":"name",onChange:m,value:N,name:"name",id:"name",placeholder:"Server Name"})]}),(0,M.jsxs)("div",{className:"w-full flex flex-col items-start gap-2",children:[(0,M.jsx)(oe.A,{htmlFor:"desc",children:e("overview.desc")}),(0,M.jsx)(me.A,{disabled:!t,"data-type":"description",onChange:m,value:null!==h&&void 0!==h?h:"",rows:4,name:"desc",id:"desc",placeholder:"Tell the world a bit about this server"})]})]}),o&&(0,M.jsx)(de.A,{saveHandler:()=>{const{name:e,description:s}=x;d({name:e,description:s})},resetHandler:()=>{j(i)}})]}):null};function es(){const{t:e}=(0,l.Bd)("setting"),s=(0,g.GV)((e=>{var s;return null===(s=e.authData.user)||void 0===s?void 0:s.is_admin}),y.bN),{values:t,updateConfig:a}=E("login");if(!t)return null;const{who_can_sign_up:i,guest:r=!1}=t;return(0,M.jsxs)("div",{className:"relative w-full md:w-[512px] flex flex-col gap-6",children:[(0,M.jsx)($e,{}),s&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Fe,{}),(0,M.jsx)("div",{className:"flex flex-col",children:(0,M.jsx)("h4",{className:"font-bold text-gray-700 dark:text-white",children:e("overview.title_feat")})}),(0,M.jsx)(Le,{title:e("overview.sign_up.title"),desc:e("overview.sign_up.desc"),children:(0,M.jsx)(Me.A,{options:[e("overview.sign_up.everyone"),e("overview.sign_up.invite")],values:["EveryOne","InvitationOnly"],value:i,onChange:e=>{var s;s=e,a({...t,who_can_sign_up:s})}})}),(0,M.jsx)(Le,{title:e("overview.guest_mode.title"),desc:e("overview.guest_mode.desc"),children:(0,M.jsx)(Me.A,{options:[e("overview.guest_mode.enable"),e("overview.guest_mode.disable")],values:["true","false"],value:`${r}`,onChange:e=>{(e=>{const s="true"===e;a({...t,guest:s})})(e)}})}),(0,M.jsx)(Je,{}),(0,M.jsx)(We,{}),(0,M.jsx)(Ve,{})]}),(0,M.jsx)(He,{}),(0,M.jsx)(Ke,{}),(0,M.jsx)(qe,{})]})}var ss=t(63101),ts=t(26375),as=t(27820);const ls=({paramKey:e,paramDefault:s,remarks:t})=>(0,M.jsxs)("tr",{className:"bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-50 border-b transition duration-300 ease-in-out md:hover:bg-gray-100 dark:md:hover:bg-gray-900",children:[(0,M.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:e}),(0,M.jsx)("td",{className:"text-sm font-light px-6 py-4 whitespace-nowrap",children:"theme-color"==e?(0,M.jsxs)("span",{style:{color:s},children:[" ",s]}):s}),(0,M.jsx)("td",{className:"text-sm font-light px-6 py-4",children:(0,M.jsx)(as.A,{linkPreview:!1,text:t,mention:!1})})]});function is(){const e=(0,g.GV)((e=>{var s;return null===(s=e.authData.user)||void 0===s?void 0:s.uid}),y.bN),s=`${location.origin}/widget.html?host=${e}`,{t:t}=(0,l.Bd)("setting",{keyPrefix:"widget"}),{t:a}=(0,l.Bd)("widget"),{t:i}=(0,l.Bd)(),{copied:r,copy:c}=(0,z.A)({enableToast:!1});return(0,M.jsxs)("div",{className:"flex flex-col justify-start items-start",children:[(0,M.jsx)("div",{className:"font-semibold dark:text-white",children:t("tip")}),(0,M.jsxs)("label",{htmlFor:"code",className:"font-semibold dark:text-white",children:[t("code"),":"]}),(0,M.jsx)(ss.A,{id:"code",language:"html",style:ts.A,className:"rounded",children:`\x3c!-- ${t("code_comment")} --\x3e\n
\ No newline at end of file +VoceChat Widget
\ No newline at end of file