mattermost-community-enterp.../client/1820.c008ce837b180cbc246e.js
2025-12-18 00:51:24 +09:00

2 lines
9.4 KiB
JavaScript

"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[1820],{27795:(e,t,n)=>{n.d(t,{v:()=>r});var i=n(84390),o=n.n(i);function r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const i=e=>o().createElement(o().Suspense,{fallback:n},o().createElement(t,e));return i.displayName=e,i}},8243:(e,t,n)=>{n.d(t,{s:()=>w}),n(14078),n(92189);var i=n(34348),o=n(96323),r=n(7709),s=n(5647),d=n(21214);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){var i,o,r;i=e,o=t,r=n[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o))in i?Object.defineProperty(i,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[o]=r})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const l=(0,i.createBrowserHistory)({basename:window.basename}),p=(0,d.P)()&&(0,s.l)((0,d.zF)(),"5.0.0"),c=u(u({},l),{},{push:function(e){if(p)r.Z.doBrowserHistoryPush("object"==typeof e?e.pathname:e);else{for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];l.push(e,...n)}}});function w(){var e;return null!==(e=(0,o.getModule)("utils/browser_history"))&&void 0!==e?e:c}p&&r.Z.onBrowserHistoryPush((e=>l.push(e)))},7709:(e,t,n)=>{n.d(t,{Z:()=>d}),n(61418),n(14078),n(92189);var i=n(81249),o=n.n(i),r=n(21214);function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d=new class{constructor(){var e,t;s(this,"getAppName",(()=>this.name)),s(this,"getAppVersion",(()=>this.version)),s(this,"isDev",(()=>this.dev)),s(this,"getDesktopAppInfo",(()=>{var e;return null!==(e=window.desktopAPI)&&void 0!==e&&e.getAppInfo?window.desktopAPI.getAppInfo():this.invokeWithMessaging("webapp-ready",void 0,"register-desktop")})),s(this,"getBrowserHistoryStatus",(async()=>{var e;if(null!==(e=window.desktopAPI)&&void 0!==e&&e.requestBrowserHistoryStatus)return window.desktopAPI.requestBrowserHistoryStatus();const{enableBack:t,enableForward:n}=await this.invokeWithMessaging("history-button",void 0,"history-button-return");return{canGoBack:t,canGoForward:n}})),s(this,"onUserActivityUpdate",(e=>{var t;if(null!==(t=window.desktopAPI)&&void 0!==t&&t.onUserActivityUpdate)return window.desktopAPI.onUserActivityUpdate(e);const n=t=>{let{userIsActive:n,manual:i}=t;return e(n,0,i)};return this.addPostMessageListener("user-activity-update",n),()=>this.removePostMessageListener("user-activity-update",n)})),s(this,"onNotificationClicked",(e=>{var t;if(null!==(t=window.desktopAPI)&&void 0!==t&&t.onNotificationClicked)return window.desktopAPI.onNotificationClicked(e);const n=t=>{let{channel:n,teamId:i,url:o}=t;return e(n.id,i,o)};return this.addPostMessageListener("notification-clicked",n),()=>this.removePostMessageListener("notification-clicked",n)})),s(this,"onBrowserHistoryPush",(e=>{var t;if(null!==(t=window.desktopAPI)&&void 0!==t&&t.onBrowserHistoryPush)return window.desktopAPI.onBrowserHistoryPush(e);const n=t=>{let{pathName:n}=t;return e(n)};return this.addPostMessageListener("browser-history-push-return",n),()=>this.removePostMessageListener("browser-history-push-return",n)})),s(this,"onBrowserHistoryStatusUpdated",(e=>{var t;if(null!==(t=window.desktopAPI)&&void 0!==t&&t.onBrowserHistoryStatusUpdated)return window.desktopAPI.onBrowserHistoryStatusUpdated(e);const n=t=>{let{enableBack:n,enableForward:i}=t;return e(n,i)};return this.addPostMessageListener("history-button-return",n),()=>this.removePostMessageListener("history-button-return",n)})),s(this,"dispatchNotification",(async(e,t,n,i,o,r,s)=>{var d;if(null!==(d=window.desktopAPI)&&void 0!==d&&d.sendNotification){const d=await window.desktopAPI.sendNotification(e,t,n,i,s,o,r);return null!=d?d:{status:"unsupported",reason:"desktop_app_unsupported"}}return window.postMessage({type:"dispatch-notification",message:{title:e,body:t,channel:{id:n},teamId:i,silent:o,data:{soundName:r},url:s}},window.location.origin),{status:"unsupported",reason:"desktop_app_unsupported"}})),s(this,"doBrowserHistoryPush",(e=>{var t;null!==(t=window.desktopAPI)&&void 0!==t&&t.sendBrowserHistoryPush?window.desktopAPI.sendBrowserHistoryPush(e):window.postMessage({type:"browser-history-push",message:{path:e}},window.location.origin)})),s(this,"updateUnreadsAndMentions",((e,t)=>{var n;return(null===(n=window.desktopAPI)||void 0===n?void 0:n.setUnreadsAndMentions)&&window.desktopAPI.setUnreadsAndMentions(e,t)})),s(this,"setSessionExpired",(e=>{var t;return(null===(t=window.desktopAPI)||void 0===t?void 0:t.setSessionExpired)&&window.desktopAPI.setSessionExpired(e)})),s(this,"signalLogin",(()=>{var e,t;return(null===(e=window.desktopAPI)||void 0===e?void 0:e.onLogin)&&(null===(t=window.desktopAPI)||void 0===t?void 0:t.onLogin())})),s(this,"signalLogout",(()=>{var e,t;return(null===(e=window.desktopAPI)||void 0===e?void 0:e.onLogout)&&(null===(t=window.desktopAPI)||void 0===t?void 0:t.onLogout())})),s(this,"postMessageListener",(e=>{var t;let{origin:n,data:{type:i,message:o}}=e;if(n!==window.location.origin)return;const r=null===(t=this.postMessageListeners)||void 0===t?void 0:t.get(i);r&&r.forEach((e=>{e(o)}))})),s(this,"addPostMessageListener",((e,t)=>{var n,i;null!==(n=this.postMessageListeners)&&void 0!==n&&n.has(e)?this.postMessageListeners.set(e,this.postMessageListeners.get(e).add(t)):null===(i=this.postMessageListeners)||void 0===i||i.set(e,new Set([t]))})),s(this,"removePostMessageListener",((e,t)=>{var n;const i=null===(n=this.postMessageListeners)||void 0===n?void 0:n.get(e);var o,r;null==i||i.delete(t),null!=i&&i.size?null===(o=this.postMessageListeners)||void 0===o||o.set(e,i):null===(r=this.postMessageListeners)||void 0===r||r.delete(e)})),s(this,"invokeWithMessaging",((e,t,n)=>new Promise((i=>{const o=t=>{let{origin:r,data:{type:s,message:d}}=t;r===window.location.origin&&s===(null!=n?n:e)&&(window.removeEventListener("message",o),i(d))};window.addEventListener("message",o),window.postMessage({type:e,message:t},window.location.origin)})))),(0,r.P)()&&(this.getDesktopAppInfo().then((e=>{let{name:t,version:n}=e;this.name=t,this.version=o().valid(o().coerce(n)),window.desktop||(window.desktop={}),window.desktop.version=o().valid(o().coerce(n))})),null===(e=window.desktopAPI)||void 0===e||null===(t=e.isDev)||void 0===t||t.call(e).then((e=>{this.dev=e})),this.postMessageListeners=new Map,window.addEventListener("message",this.postMessageListener),window.addEventListener("beforeunload",(()=>{window.removeEventListener("message",this.postMessageListener)})))}}},5647:(e,t,n)=>{function i(e,t){if(e===t)return!0;const n=(e||"").split(".").filter((e=>null!==/^[0-9]+$/.exec(e))),i=(t||"").split(".").filter((e=>null!==/^[0-9]+$/.exec(e)));for(let e=0;e<Math.max(n.length,i.length);e++){const t=parseInt(n[e],10)||0,o=parseInt(i[e],10)||0;if(t>o)return!0;if(t<o)return!1}return!0}n.d(t,{l:()=>i}),n(52077),n(32081)},21214:(e,t,n)=>{n.d(t,{Dt:()=>p,ED:()=>O,G6:()=>r,IJ:()=>A,IT:()=>s,P:()=>m,Qz:()=>h,V3:()=>a,V5:()=>k,Vg:()=>u,eL:()=>c,i7:()=>o,k:()=>w,my:()=>d,s:()=>l,tN:()=>P,tq:()=>f,un:()=>y,vU:()=>v,w6:()=>g,xE:()=>b,zF:()=>x}),n(52077);const i=()=>window.navigator.userAgent;function o(){return i().indexOf("Chrome")>-1&&-1===i().indexOf("Edge")}function r(){return-1!==i().indexOf("Safari")&&-1===i().indexOf("Chrome")}function s(){return(-1!==i().indexOf("iPhone")||-1!==i().indexOf("iPad"))&&-1!==i().indexOf("Safari")&&-1===i().indexOf("CriOS")}function d(){return-1!==i().indexOf("CriOS")}function a(){return-1!==i().indexOf("FxiOS")}function u(){return s()||d()}function l(){return-1!==i().indexOf("iPhone")||-1!==i().indexOf("iPad")}function p(){return-1!==i().indexOf("Android")}function c(){return-1!==i().indexOf("Android")&&-1!==i().indexOf("Chrome")&&-1===i().indexOf("Version")||-1!==i().indexOf("Android")&&-1!==i().indexOf("Firefox")}function w(){return f()&&!u()&&!c()}function f(){return l()||p()}function v(){return-1!==i().indexOf("Firefox")}function h(){return-1!==i().indexOf("CrOS")}function g(){return-1!==i().indexOf("Trident")}function y(){return-1!==i().indexOf("Edge")}function P(){return-1!==i().indexOf("Edg")&&-1===i().indexOf("Edge")}function m(){return-1!==i().indexOf("Mattermost")&&-1!==i().indexOf("Electron")}function b(){return m()&&k()}function O(){return-1!==i().indexOf("Windows")}function k(){return-1!==i().indexOf("Macintosh")}function A(){return navigator.platform.toUpperCase().indexOf("LINUX")>=0}function x(){var e;return(null===(e=/Mattermost\/(\d+\.\d+\.\d+)/gm.exec(window.navigator.appVersion))||void 0===e?void 0:e[1])||""}}}]);
//# sourceMappingURL=1820.c008ce837b180cbc246e.js.map