@wellesley/host-remote 1.0.494 → 1.0.495
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +1 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{subscribeAfter as vh}from"https://cdn.jsdelivr.net/npm/@wellesley/redux-subscribe-action@1.0.396";import vu,{useRef as _u,useCallback as yu,forwardRef as Bh,createElement as xp,useState as Da,useEffect as xr,memo as Qh}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{getStore as wu,rootReducer as fm,hydrate as dm,createStore as pm}from"https://cdn.jsdelivr.net/npm/@wellesley/store@1.0.651";import{api as yh}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.652";import{cn as kp,Dialog as hm,DialogContent as gm,ButtonLoader as _h}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.614";import{useDispatch as Ua,useSelector as Pi}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{createSlice as Yh,createAction as Vh}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import{getErrorMsg as mm}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.503";import{routerSlice as wo}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.580";import{useLocation as $h,useBlocker as vm,useNavigate as Hh}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";import{handleLogin as ym,handleLogout as _m}from"https://cdn.jsdelivr.net/npm/@wellesley/auth@1.0.708";const Ra="8.48.0",Li=globalThis;function Ap(e,t,n){const r=Li,a=r.__SENTRY__=r.__SENTRY__||{},o=a[Ra]=a[Ra]||{};return o[e]||(o[e]=t())}const Jh=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,wm="Sentry Logger ",wh=["debug","info","warn","error","log","assert","trace"],Sh={};function Sm(e){if(!("console"in Li))return e();const t=Li.console,n={},r=Object.keys(Sh);r.forEach((e=>{const r=Sh[e];n[e]=t[e],t[e]=r}));try{return e()}finally{r.forEach((e=>{t[e]=n[e]}))}}function xm(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return Jh?wh.forEach((n=>{t[n]=(...t)=>{e&&Sm((()=>{Li.console[n](`${wm}[${n}]:`,...t)}))}})):wh.forEach((e=>{t[e]=()=>{}})),t}const Jf=Ap("logger",xm);function Pp(){return Lp(Li),Li}function Lp(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Ra,t[Ra]=t[Ra]||{}}const km=Object.prototype.toString;function Em(e,t){return km.call(e)===`[object ${t}]`}function Cm(e){return Em(e,"Object")}function zm(e){return!(!e||!e.then||"function"!=typeof e.then)}function Mm(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Jh&&Jf.log(`Failed to add non-enumerable property "${t}" to object`,e)}}const Gh=1e3;function Kh(){return Date.now()/Gh}function Nm(){const{performance:e}=Li;if(!e||!e.now)return Kh;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/Gh}const Im=Nm();function Dl(){const e=Li,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch{}return"10000000100040008000100000000000".replace(/[018]/g,(e=>(e^(15&n())>>e/4).toString(16)))}function Am(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Im(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:Dl()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function xh(){return Dl()}function kh(){return Dl().substring(16)}function bh(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&t&&0===Object.keys(t).length)return e;const r={...e};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=bh(r[e],t[e],n-1));return r}(()=>{const{performance:e}=Li;if(!e||!e.now)return;const t=36e5,n=e.now(),r=Date.now(),a=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,o=a<t,i=e.timing&&e.timing.navigationStart,l="number"==typeof i?Math.abs(i+n-r):t;(o||l<t)&&(a<=l&&e.timeOrigin)})();const Ep="_sentrySpan";function Eh(e,t){t?Mm(e,Ep,t):delete e[Ep]}function Ch(e){return e[Ep]}const Pm=100;class jp{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:xh(),spanId:kh()}}clone(){const e=new jp;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,Eh(e,Ch(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Am(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,[n,r]=t instanceof Fa?[t.getScopeData(),t.getRequestSession()]:Cm(t)?[e,e.requestSession]:[],{tags:a,extra:o,user:i,contexts:l,level:u,fingerprint:s=[],propagationContext:c}=n||{};return this._tags={...this._tags,...a},this._extra={...this._extra,...o},this._contexts={...this._contexts,...l},i&&Object.keys(i).length&&(this._user=i),u&&(this._level=u),s.length&&(this._fingerprint=s),c&&(this._propagationContext=c),r&&(this._requestSession=r),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,Eh(this,void 0),this._attachments=[],this.setPropagationContext({traceId:xh()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:Pm;if(n<=0)return this;const r={timestamp:Kh(),...e},a=this._breadcrumbs;return a.push(r),this._breadcrumbs=a.length>n?a.slice(-n):a,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Ch(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=bh(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext={spanId:kh(),...e},this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:Dl();if(!this._client)return Jf.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=n&&n.event_id?n.event_id:Dl();if(!this._client)return Jf.warn("No client configured on scope - will not capture message!"),r;const a=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:a,...n,event_id:r},this),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:Dl();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(Jf.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}const Fa=jp;function Lm(){return Ap("defaultCurrentScope",(()=>new Fa))}function jm(){return Ap("defaultIsolationScope",(()=>new Fa))}class Tm{constructor(e,t){let n,r;n=e||new Fa,r=t||new Fa,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(e){throw this._popScope(),e}return zm(n)?n.then((e=>(this._popScope(),e)),(e=>{throw this._popScope(),e})):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function Fl(){const e=Lp(Pp());return e.stack=e.stack||new Tm(Lm(),jm())}function Om(e){return Fl().withScope(e)}function Rm(e,t){const n=Fl();return n.withScope((()=>(n.getStackTop().scope=e,t(e))))}function zh(e){return Fl().withScope((()=>e(Fl().getIsolationScope())))}function Dm(){return{withIsolationScope:zh,withScope:Om,withSetScope:Rm,withSetIsolationScope:(e,t)=>zh(t),getCurrentScope:()=>Fl().getScope(),getIsolationScope:()=>Fl().getIsolationScope()}}function Zh(e){const t=Lp(e);return t.acs?t.acs:Dm()}function Xh(){return Zh(Pp()).getCurrentScope()}function Fm(){return Zh(Pp()).getIsolationScope()}function Um(e,t){return Xh().captureException(e,void 0)}function Wm(e,t){const n={captureContext:t};return Xh().captureMessage(e,void 0,n)}function Bm(e,t){Fm().setExtra(e,t)}var $f=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};const Qm=(...e)=>{let t="";for(const n of e){if(n instanceof Error){const e=n;return Bm("exceptionMessage",t),void Um(e)}if("object"!=typeof n)t+=n;else try{t+=" "+JSON.stringify(n)}catch{t+=" "+n}}Wm(t)},Ym=()=>"object"!=typeof window,Vm="wlsy",qh=()=>{try{return window.localStorage}catch(e){console.warn("Error getting window.localStorage storage",e)}},$m=()=>{const e=new Set,t=qh();if(!t)return[];for(let n=0;n<(null==t?void 0:t.length);n+=1){const r=null==t?void 0:t.key(n);"string"==typeof r&&e.add(r)}return Array.from(e)},Tp=e=>{const t=`${Vm}${e?`:${e}`:""}`,n=e=>`${t}:${e}`,r=()=>$m().filter((e=>e.startsWith(`${t}:`))),a=e=>e.slice(t.length+1),o=qh(),i=e=>{try{return null==o?void 0:o.getItem(n(e))}catch{return null}},l=(e,t)=>{try{null==o||o.setItem(n(e),String(t))}catch{return}};return{getItem:i,setItem:l,removeItem:e=>{try{null==o||o.removeItem(n(e))}catch{return}},clear:()=>{try{r().forEach((e=>null==o?void 0:o.removeItem(e)))}catch{return}},keys:()=>r().map(a),has:e=>null!==i(e),getJSON:e=>{const t=i(e);if(null==t)return null;try{return JSON.parse(t)}catch{return null}},setJSON:(e,t)=>{try{l(e,JSON.stringify(t))}catch{return}}}},Mh=["debug","info","warn","error"],Hm=(e,t)=>{const n=Mh.indexOf(e);return Mh.indexOf(t)>=n},Hf=(e,t,n,...r)=>{Hm(t,e)&&console.log(`[${e}] ${n}`,...r)},Jm=()=>Tp().getItem("logger_lvl"),Gm=(e=(Ym()?"info":Jm()||"warn"))=>{let t=e;return{debug:(e,...n)=>Hf("debug",t,e,...n),info:(e,...n)=>Hf("info",t,e,...n),warn:(e,...n)=>Hf("warn",t,e,...n),error:(e,...n)=>(Qm(e,...n),Hf("error",t,e,...n)),setLevel:e=>{t=e},getLevel:()=>t}},qf=Gm(),ed="staticState",eg=Tp(),Gf={path:"",baseUrl:"",search:""},Km=e=>{if(!e)return Gf;try{return JSON.parse(decodeURIComponent(e))||Gf}catch(e){return qf.error("Error parsing static state",e),Gf}},tg=()=>new URLSearchParams(window.location.search).get(ed),bm=({path:e,baseUrl:t,search:n}={})=>{const{pathname:r,origin:a,search:o}=window.location;return`${ed}=${encodeURIComponent(JSON.stringify({path:e||r,baseUrl:t||a,search:n||o}))}`},Zm=()=>{const e=tg();return e&&eg.setItem(ed,e),ng()},ng=()=>{try{const e=eg.getItem(ed)||tg();return Km(e)}catch(e){return qf.error("Error parsing static state",e),Gf}},Xm={create:bm,init:Zm,get:ng},Op=({onMessage:e,whitelist:t,sourceWindow:n})=>{const r=r=>{const a=r.origin===window.location.origin,o=!n||r.source===n,i=r.data&&"object"==typeof r.data&&"type"in r.data,l=t.some((({type:e})=>e===r.data.type||"*"===e));!a&&o&&i&&l&&e(r.data)};return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},qm=e=>{try{const{type:t,payload:n}=e,r={type:t};return void 0!==n&&(r.payload=JSON.parse(JSON.stringify(n))),r}catch(t){return qf.warn(`Could not serialize action type: ${e.type}`,t),{type:e.type,payload:`[Non-serializable payload for action: ${e.type}]`}}},Rp=({action:e,windowElement:t,whitelist:n})=>{if(t)try{const{type:r}=e;if(!n.some((({type:e})=>e===r||"*"===e)))return;const a=qm(e);t.postMessage(a,"*")}catch(e){qf.error("Failed to process or send message:",e)}},rg=({sourceWindow:e,sendWhitelist:t,receiveWhitelist:n,onMessage:r,onAction:a,name:o})=>{const i=_u((()=>{})),l=_u((()=>{}));return yu((o=>{if(o)return i.current(),l.current(),i.current=vh((e=>{null==a||a(e),Rp({action:e,windowElement:o,whitelist:t})})),l.current=Op({sourceWindow:e,onMessage:e=>{r?r(e):wu().dispatch(e)},whitelist:n}),()=>{i.current(),l.current()}}),[e,t,n,r,vh,a,o])},ev=e=>{if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)},tv=e=>ev(e)&&"type"in e&&"string"==typeof e.type,Ce=e=>{const t=t=>({type:e,payload:t});return t.toString=()=>`${e}`,t.type=e,t.match=t=>tv(t)&&t.type===e,t},bf=Ce("hostStoreConnect"),ig=Ce("remoteLogin"),og=Ce("remoteLogout"),nv=Ce("wsOnMessage"),ug=Ce("setRouterPath"),rv=Ce("setDeviceType"),iv=Ce("setUserError"),ov=Ce("setUserIsError"),uv=Ce("setUserPending"),lv=Ce("setUserSuccess"),sv=Ce("setUserData"),lg=Ce("updateAccountData"),av=Ce("updateUser"),cv=Ce("addNotification"),fv=Ce("markNotification"),dv=Ce("setNotificationsError"),pv=Ce("setNotificationsList"),hv=Ce("setNotificationsPending"),gv=Ce("setNotificationsTotalCount"),mv=Ce("setNotificationsUnreadCount"),vv=Ce("resetNotificationsState"),yv=Ce("undoNotification"),_v=Ce("setInstanceInfo"),wv=Ce("setInstanceInfoPending"),Sv=Ce("setInstanceInfoError"),xv=Ce("setPlatformSettings"),kv=Ce("setProfileSettings"),Ev=Ce("setGroupData"),Cv=Ce("setGroupLoading"),Zf=Ce("remoteReady"),sg=Ce("askLogin"),ag=Ce("reselectUser"),cg=Ce("requestLogout"),fg=Ce("setConfirmLeavePage"),Dp=Ce("requestChangePath"),zv=Ce("wsSubscribe"),Mv=Ce("wsUnSubscribe"),Fp=[Dp,zv,Mv,Zf,ag,cg,sg,fg],Up=[ig,og,bf,nv,ug,rv,iv,ov,uv,lv,sv,lg,av,cv,fv,dv,pv,hv,gv,mv,vv,yv,_v,wv,Sv,xv,kv,Ev,Cv];if(Up.some((e=>Fp.some((t=>(null==t?void 0:t.toString())===(null==e?void 0:e.toString()))))))throw new Error("Output action is duplicated with input action");var Nh,Oa={exports:{}},Nv=Oa.exports;
|
|
1
|
+
import{subscribeAfter as vh}from"https://cdn.jsdelivr.net/npm/@wellesley/redux-subscribe-action@1.0.397";import vu,{useRef as _u,useCallback as yu,forwardRef as Bh,createElement as xp,useState as Da,useEffect as xr,memo as Qh}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{getStore as wu,rootReducer as fm,hydrate as dm,createStore as pm}from"https://cdn.jsdelivr.net/npm/@wellesley/store@1.0.652";import{api as yh}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.653";import{cn as kp,Dialog as hm,DialogContent as gm,ButtonLoader as _h}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.615";import{useDispatch as Ua,useSelector as Pi}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{createSlice as Yh,createAction as Vh}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import{getErrorMsg as mm}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.504";import{routerSlice as wo}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.581";import{useLocation as $h,useBlocker as vm,useNavigate as Hh}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";import{handleLogin as ym,handleLogout as _m}from"https://cdn.jsdelivr.net/npm/@wellesley/auth@1.0.709";const Ra="8.48.0",Li=globalThis;function Ap(e,t,n){const r=Li,a=r.__SENTRY__=r.__SENTRY__||{},o=a[Ra]=a[Ra]||{};return o[e]||(o[e]=t())}const Jh=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,wm="Sentry Logger ",wh=["debug","info","warn","error","log","assert","trace"],Sh={};function Sm(e){if(!("console"in Li))return e();const t=Li.console,n={},r=Object.keys(Sh);r.forEach((e=>{const r=Sh[e];n[e]=t[e],t[e]=r}));try{return e()}finally{r.forEach((e=>{t[e]=n[e]}))}}function xm(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return Jh?wh.forEach((n=>{t[n]=(...t)=>{e&&Sm((()=>{Li.console[n](`${wm}[${n}]:`,...t)}))}})):wh.forEach((e=>{t[e]=()=>{}})),t}const Jf=Ap("logger",xm);function Pp(){return Lp(Li),Li}function Lp(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Ra,t[Ra]=t[Ra]||{}}const km=Object.prototype.toString;function Em(e,t){return km.call(e)===`[object ${t}]`}function Cm(e){return Em(e,"Object")}function zm(e){return!(!e||!e.then||"function"!=typeof e.then)}function Mm(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Jh&&Jf.log(`Failed to add non-enumerable property "${t}" to object`,e)}}const Gh=1e3;function Kh(){return Date.now()/Gh}function Nm(){const{performance:e}=Li;if(!e||!e.now)return Kh;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/Gh}const Im=Nm();function Dl(){const e=Li,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch{}return"10000000100040008000100000000000".replace(/[018]/g,(e=>(e^(15&n())>>e/4).toString(16)))}function Am(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Im(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:Dl()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function xh(){return Dl()}function kh(){return Dl().substring(16)}function bh(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&t&&0===Object.keys(t).length)return e;const r={...e};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=bh(r[e],t[e],n-1));return r}(()=>{const{performance:e}=Li;if(!e||!e.now)return;const t=36e5,n=e.now(),r=Date.now(),a=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,o=a<t,i=e.timing&&e.timing.navigationStart,l="number"==typeof i?Math.abs(i+n-r):t;(o||l<t)&&(a<=l&&e.timeOrigin)})();const Ep="_sentrySpan";function Eh(e,t){t?Mm(e,Ep,t):delete e[Ep]}function Ch(e){return e[Ep]}const Pm=100;class jp{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:xh(),spanId:kh()}}clone(){const e=new jp;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,Eh(e,Ch(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Am(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,[n,r]=t instanceof Fa?[t.getScopeData(),t.getRequestSession()]:Cm(t)?[e,e.requestSession]:[],{tags:a,extra:o,user:i,contexts:l,level:u,fingerprint:s=[],propagationContext:c}=n||{};return this._tags={...this._tags,...a},this._extra={...this._extra,...o},this._contexts={...this._contexts,...l},i&&Object.keys(i).length&&(this._user=i),u&&(this._level=u),s.length&&(this._fingerprint=s),c&&(this._propagationContext=c),r&&(this._requestSession=r),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,Eh(this,void 0),this._attachments=[],this.setPropagationContext({traceId:xh()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:Pm;if(n<=0)return this;const r={timestamp:Kh(),...e},a=this._breadcrumbs;return a.push(r),this._breadcrumbs=a.length>n?a.slice(-n):a,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Ch(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=bh(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext={spanId:kh(),...e},this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:Dl();if(!this._client)return Jf.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=n&&n.event_id?n.event_id:Dl();if(!this._client)return Jf.warn("No client configured on scope - will not capture message!"),r;const a=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:a,...n,event_id:r},this),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:Dl();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(Jf.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}const Fa=jp;function Lm(){return Ap("defaultCurrentScope",(()=>new Fa))}function jm(){return Ap("defaultIsolationScope",(()=>new Fa))}class Tm{constructor(e,t){let n,r;n=e||new Fa,r=t||new Fa,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(e){throw this._popScope(),e}return zm(n)?n.then((e=>(this._popScope(),e)),(e=>{throw this._popScope(),e})):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function Fl(){const e=Lp(Pp());return e.stack=e.stack||new Tm(Lm(),jm())}function Om(e){return Fl().withScope(e)}function Rm(e,t){const n=Fl();return n.withScope((()=>(n.getStackTop().scope=e,t(e))))}function zh(e){return Fl().withScope((()=>e(Fl().getIsolationScope())))}function Dm(){return{withIsolationScope:zh,withScope:Om,withSetScope:Rm,withSetIsolationScope:(e,t)=>zh(t),getCurrentScope:()=>Fl().getScope(),getIsolationScope:()=>Fl().getIsolationScope()}}function Zh(e){const t=Lp(e);return t.acs?t.acs:Dm()}function Xh(){return Zh(Pp()).getCurrentScope()}function Fm(){return Zh(Pp()).getIsolationScope()}function Um(e,t){return Xh().captureException(e,void 0)}function Wm(e,t){const n={captureContext:t};return Xh().captureMessage(e,void 0,n)}function Bm(e,t){Fm().setExtra(e,t)}var $f=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};const Qm=(...e)=>{let t="";for(const n of e){if(n instanceof Error){const e=n;return Bm("exceptionMessage",t),void Um(e)}if("object"!=typeof n)t+=n;else try{t+=" "+JSON.stringify(n)}catch{t+=" "+n}}Wm(t)},Ym=()=>"object"!=typeof window,Vm="wlsy",qh=()=>{try{return window.localStorage}catch(e){console.warn("Error getting window.localStorage storage",e)}},$m=()=>{const e=new Set,t=qh();if(!t)return[];for(let n=0;n<(null==t?void 0:t.length);n+=1){const r=null==t?void 0:t.key(n);"string"==typeof r&&e.add(r)}return Array.from(e)},Tp=e=>{const t=`${Vm}${e?`:${e}`:""}`,n=e=>`${t}:${e}`,r=()=>$m().filter((e=>e.startsWith(`${t}:`))),a=e=>e.slice(t.length+1),o=qh(),i=e=>{try{return null==o?void 0:o.getItem(n(e))}catch{return null}},l=(e,t)=>{try{null==o||o.setItem(n(e),String(t))}catch{return}};return{getItem:i,setItem:l,removeItem:e=>{try{null==o||o.removeItem(n(e))}catch{return}},clear:()=>{try{r().forEach((e=>null==o?void 0:o.removeItem(e)))}catch{return}},keys:()=>r().map(a),has:e=>null!==i(e),getJSON:e=>{const t=i(e);if(null==t)return null;try{return JSON.parse(t)}catch{return null}},setJSON:(e,t)=>{try{l(e,JSON.stringify(t))}catch{return}}}},Mh=["debug","info","warn","error"],Hm=(e,t)=>{const n=Mh.indexOf(e);return Mh.indexOf(t)>=n},Hf=(e,t,n,...r)=>{Hm(t,e)&&console.log(`[${e}] ${n}`,...r)},Jm=()=>Tp().getItem("logger_lvl"),Gm=(e=(Ym()?"info":Jm()||"warn"))=>{let t=e;return{debug:(e,...n)=>Hf("debug",t,e,...n),info:(e,...n)=>Hf("info",t,e,...n),warn:(e,...n)=>Hf("warn",t,e,...n),error:(e,...n)=>(Qm(e,...n),Hf("error",t,e,...n)),setLevel:e=>{t=e},getLevel:()=>t}},qf=Gm(),ed="staticState",eg=Tp(),Gf={path:"",baseUrl:"",search:""},Km=e=>{if(!e)return Gf;try{return JSON.parse(decodeURIComponent(e))||Gf}catch(e){return qf.error("Error parsing static state",e),Gf}},tg=()=>new URLSearchParams(window.location.search).get(ed),bm=({path:e,baseUrl:t,search:n}={})=>{const{pathname:r,origin:a,search:o}=window.location;return`${ed}=${encodeURIComponent(JSON.stringify({path:e||r,baseUrl:t||a,search:n||o}))}`},Zm=()=>{const e=tg();return e&&eg.setItem(ed,e),ng()},ng=()=>{try{const e=eg.getItem(ed)||tg();return Km(e)}catch(e){return qf.error("Error parsing static state",e),Gf}},Xm={create:bm,init:Zm,get:ng},Op=({onMessage:e,whitelist:t,sourceWindow:n})=>{const r=r=>{const a=r.origin===window.location.origin,o=!n||r.source===n,i=r.data&&"object"==typeof r.data&&"type"in r.data,l=t.some((({type:e})=>e===r.data.type||"*"===e));!a&&o&&i&&l&&e(r.data)};return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},qm=e=>{try{const{type:t,payload:n}=e,r={type:t};return void 0!==n&&(r.payload=JSON.parse(JSON.stringify(n))),r}catch(t){return qf.warn(`Could not serialize action type: ${e.type}`,t),{type:e.type,payload:`[Non-serializable payload for action: ${e.type}]`}}},Rp=({action:e,windowElement:t,whitelist:n})=>{if(t)try{const{type:r}=e;if(!n.some((({type:e})=>e===r||"*"===e)))return;const a=qm(e);t.postMessage(a,"*")}catch(e){qf.error("Failed to process or send message:",e)}},rg=({sourceWindow:e,sendWhitelist:t,receiveWhitelist:n,onMessage:r,onAction:a,name:o})=>{const i=_u((()=>{})),l=_u((()=>{}));return yu((o=>{if(o)return i.current(),l.current(),i.current=vh((e=>{null==a||a(e),Rp({action:e,windowElement:o,whitelist:t})})),l.current=Op({sourceWindow:e,onMessage:e=>{r?r(e):wu().dispatch(e)},whitelist:n}),()=>{i.current(),l.current()}}),[e,t,n,r,vh,a,o])},ev=e=>{if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)},tv=e=>ev(e)&&"type"in e&&"string"==typeof e.type,Ce=e=>{const t=t=>({type:e,payload:t});return t.toString=()=>`${e}`,t.type=e,t.match=t=>tv(t)&&t.type===e,t},bf=Ce("hostStoreConnect"),ig=Ce("remoteLogin"),og=Ce("remoteLogout"),nv=Ce("wsOnMessage"),ug=Ce("setRouterPath"),rv=Ce("setDeviceType"),iv=Ce("setUserError"),ov=Ce("setUserIsError"),uv=Ce("setUserPending"),lv=Ce("setUserSuccess"),sv=Ce("setUserData"),lg=Ce("updateAccountData"),av=Ce("updateUser"),cv=Ce("addNotification"),fv=Ce("markNotification"),dv=Ce("setNotificationsError"),pv=Ce("setNotificationsList"),hv=Ce("setNotificationsPending"),gv=Ce("setNotificationsTotalCount"),mv=Ce("setNotificationsUnreadCount"),vv=Ce("resetNotificationsState"),yv=Ce("undoNotification"),_v=Ce("setInstanceInfo"),wv=Ce("setInstanceInfoPending"),Sv=Ce("setInstanceInfoError"),xv=Ce("setPlatformSettings"),kv=Ce("setProfileSettings"),Ev=Ce("setGroupData"),Cv=Ce("setGroupLoading"),Zf=Ce("remoteReady"),sg=Ce("askLogin"),ag=Ce("reselectUser"),cg=Ce("requestLogout"),fg=Ce("setConfirmLeavePage"),Dp=Ce("requestChangePath"),zv=Ce("wsSubscribe"),Mv=Ce("wsUnSubscribe"),Fp=[Dp,zv,Mv,Zf,ag,cg,sg,fg],Up=[ig,og,bf,nv,ug,rv,iv,ov,uv,lv,sv,lg,av,cv,fv,dv,pv,hv,gv,mv,vv,yv,_v,wv,Sv,xv,kv,Ev,Cv];if(Up.some((e=>Fp.some((t=>(null==t?void 0:t.toString())===(null==e?void 0:e.toString()))))))throw new Error("Output action is duplicated with input action");var Nh,Oa={exports:{}},Nv=Oa.exports;
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Lodash <https://lodash.com/>
|