@wellesley/host-remote 1.0.633 → 1.0.634
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 Is}from"https://cdn.jsdelivr.net/npm/@wellesley/redux-subscribe-action@1.0.535";import ev,{useRef as lr,useCallback as Ue,forwardRef as Ks,createElement as To,useEffect as le,useState as Mo,memo as Gs}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{getStore as ze,hydrate as rv,createStore as nv}from"https://cdn.jsdelivr.net/npm/@wellesley/store@1.0.790";import{api as Es}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.791";import{toast as ti}from"https://cdn.jsdelivr.net/npm/@wellesley/system-toast@1.0.135";import{createSlice as iv,createAction as Hs}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import{getErrorMsg as ov}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.640";import{useDispatch as ni,useSelector as Ee}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{routerSlice as Re}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.717";import{useLocation as Qs,useBlocker as uv,useNavigate as Ys}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";import{Dialog as av,DialogContent as sv,cn as Rs,ButtonLoader as ks}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.753";import{handleLogin as cv,handleLogout as fv}from"https://cdn.jsdelivr.net/npm/@wellesley/auth@1.0.847";const $r="8.48.0",he=globalThis;function Uo(t,e,n){const r=he,i=r.__SENTRY__=r.__SENTRY__||{},o=i[$r]=i[$r]||{};return o[t]||(o[t]=e())}const Zs=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,lv="Sentry Logger ",Os=["debug","info","warn","error","log","assert","trace"],Cs={};function hv(t){if(!("console"in he))return t();const e=he.console,n={},r=Object.keys(Cs);r.forEach((t=>{const r=Cs[t];n[t]=e[t],e[t]=r}));try{return t()}finally{r.forEach((t=>{e[t]=n[t]}))}}function pv(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return Zs?Os.forEach((n=>{e[n]=(...e)=>{t&&hv((()=>{he.console[n](`${lv}[${n}]:`,...e)}))}})):Os.forEach((t=>{e[t]=()=>{}})),e}const Yn=Uo("logger",pv);function zo(){return qo(he),he}function qo(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||$r,e[$r]=e[$r]||{}}const dv=Object.prototype.toString;function gv(t,e){return dv.call(t)===`[object ${e}]`}function _v(t){return gv(t,"Object")}function vv(t){return!(!t||!t.then||"function"!=typeof t.then)}function yv(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{Zs&&Yn.log(`Failed to add non-enumerable property "${e}" to object`,t)}}const Xs=1e3;function tc(){return Date.now()/Xs}function mv(){const{performance:t}=he;if(!t||!t.now)return tc;const e=Date.now()-t.now(),n=null==t.timeOrigin?e:t.timeOrigin;return()=>(n+t.now())/Xs}const wv=mv();function fr(){const t=he,e=t.crypto||t.msCrypto;let n=()=>16*Math.random();try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const t=new Uint8Array(1);return e.getRandomValues(t),t[0]})}catch{}return"10000000100040008000100000000000".replace(/[018]/g,(t=>(t^(15&n())>>t/4).toString(16)))}function bv(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||wv(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=32===e.sid.length?e.sid:fr()),void 0!==e.init&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),"number"==typeof e.started&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof e.duration)t.duration=e.duration;else{const e=t.timestamp-t.started;t.duration=e>=0?e:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),"number"==typeof e.errors&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Ls(){return fr()}function Ps(){return fr().substring(16)}function ec(t,e,n=2){if(!e||"object"!=typeof e||n<=0)return e;if(t&&e&&0===Object.keys(e).length)return t;const r={...t};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=ec(r[t],e[t],n-1));return r}(()=>{const{performance:t}=he;if(!t||!t.now)return;const e=36e5,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,o=i<e,u=t.timing&&t.timing.navigationStart,a="number"==typeof u?Math.abs(u+n-r):e;(o||a<e)&&(i<=a&&t.timeOrigin)})();const No="_sentrySpan";function js(t,e){e?yv(t,No,e):delete t[No]}function Ws(t){return t[No]}const Sv=100;class $o{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:Ls(),spanId:Ps()}}clone(){const t=new $o;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,js(t,Ws(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&bv(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,e){return this._tags={...this._tags,[t]:e},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,e){return this._extra={...this._extra,[t]:e},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,e){return null===e?delete this._contexts[t]:this._contexts[t]=e,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const e="function"==typeof t?t(this):t,[n,r]=e instanceof Vr?[e.getScopeData(),e.getRequestSession()]:_v(e)?[t,t.requestSession]:[],{tags:i,extra:o,user:u,contexts:a,level:s,fingerprint:c=[],propagationContext:l}=n||{};return this._tags={...this._tags,...i},this._extra={...this._extra,...o},this._contexts={...this._contexts,...a},u&&Object.keys(u).length&&(this._user=u),s&&(this._level=s),c.length&&(this._fingerprint=c),l&&(this._propagationContext=l),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,js(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ls()}),this._notifyScopeListeners(),this}addBreadcrumb(t,e){const n="number"==typeof e?e:Sv;if(n<=0)return this;const r={timestamp:tc(),...t},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),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:Ws(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=ec(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext={spanId:Ps(),...t},this}getPropagationContext(){return this._propagationContext}captureException(t,e){const n=e&&e.event_id?e.event_id:fr();if(!this._client)return Yn.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:r,...e,event_id:n},this),n}captureMessage(t,e,n){const r=n&&n.event_id?n.event_id:fr();if(!this._client)return Yn.warn("No client configured on scope - will not capture message!"),r;const i=new Error(t);return this._client.captureMessage(t,e,{originalException:t,syntheticException:i,...n,event_id:r},this),r}captureEvent(t,e){const n=e&&e.event_id?e.event_id:fr();return this._client?(this._client.captureEvent(t,{...e,event_id:n},this),n):(Yn.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((t=>{t(this)})),this._notifyingListeners=!1)}}const Vr=$o;function xv(){return Uo("defaultCurrentScope",(()=>new Vr))}function Av(){return Uo("defaultIsolationScope",(()=>new Vr))}class Iv{constructor(t,e){let n,r;n=t||new Vr,r=e||new Vr,this._stack=[{scope:n}],this._isolationScope=r}withScope(t){const e=this._pushScope();let n;try{n=t(e)}catch(t){throw this._popScope(),t}return vv(n)?n.then((t=>(this._popScope(),t)),(t=>{throw this._popScope(),t})):(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 t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function hr(){const t=qo(zo());return t.stack=t.stack||new Iv(xv(),Av())}function Ev(t){return hr().withScope(t)}function Rv(t,e){const n=hr();return n.withScope((()=>(n.getStackTop().scope=t,e(t))))}function Ts(t){return hr().withScope((()=>t(hr().getIsolationScope())))}function kv(){return{withIsolationScope:Ts,withScope:Ev,withSetScope:Rv,withSetIsolationScope:(t,e)=>Ts(e),getCurrentScope:()=>hr().getScope(),getIsolationScope:()=>hr().getIsolationScope()}}function rc(t){const e=qo(t);return e.acs?e.acs:kv()}function nc(){return rc(zo()).getCurrentScope()}function Ov(){return rc(zo()).getIsolationScope()}function Cv(t,e){return nc().captureException(t,void 0)}function Lv(t,e){const n={captureContext:e};return nc().captureMessage(t,void 0,n)}function Pv(t,e){Ov().setExtra(t,e)}var Hn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};const jv=(...t)=>{let e="";for(const n of t){if(n instanceof Error){const t=n;return Pv("exceptionMessage",e),void Cv(t)}if("object"!=typeof n)e+=n;else try{e+=" "+JSON.stringify(n)}catch{e+=" "+n}}Lv(e)},ii=()=>"object"!=typeof window,Wv="wlsy",ic=()=>{try{return window.localStorage}catch(t){console.warn("Error getting window.localStorage storage",t)}},Tv=()=>{const t=new Set,e=ic();if(!e)return[];for(let n=0;n<(null==e?void 0:e.length);n+=1){const r=null==e?void 0:e.key(n);"string"==typeof r&&t.add(r)}return Array.from(t)},oc=t=>{const e=`${Wv}`,n=t=>`${e}:${t}`,r=()=>Tv().filter((t=>t.startsWith(`${e}:`))),i=t=>t.slice(e.length+1),o=ic(),u=t=>{try{return null==o?void 0:o.getItem(n(t))}catch{return null}},a=(t,e)=>{try{null==o||o.setItem(n(t),String(e))}catch{return}};return{getItem:u,setItem:a,removeItem:t=>{try{null==o||o.removeItem(n(t))}catch{return}},clear:()=>{try{r().forEach((t=>null==o?void 0:o.removeItem(t)))}catch{return}},keys:()=>r().map(i),has:t=>null!==u(t),getJSON:t=>{const e=u(t);if(null==e)return null;try{return JSON.parse(e)}catch{return null}},setJSON:(t,e)=>{try{a(t,JSON.stringify(e))}catch{return}}}},Ns=["debug","info","warn","error"],Nv=(t,e)=>{const n=Ns.indexOf(t);return Ns.indexOf(e)>=n},Qn=(t,e,n,...r)=>{Nv(e,t)&&console.log(`[${t}] ${n}`,...r)},Fv=()=>oc().getItem("logger_lvl"),Dv=(t=(ii()?"info":Fv()||"warn"))=>{let e=t;return{debug:(t,...n)=>Qn("debug",e,t,...n),info:(t,...n)=>Qn("info",e,t,...n),warn:(t,...n)=>Qn("warn",e,t,...n),error:(t,...n)=>(jv(t,...n),Qn("error",e,t,...n)),setLevel:t=>{e=t},getLevel:()=>e}},oi=Dv(),ui="staticState",uc=oc(),Zn={path:"",baseUrl:"",search:""},Bv=t=>{if(!t)return Zn;try{return JSON.parse(decodeURIComponent(t))||Zn}catch(t){return oi.error("Error parsing static state",t),Zn}},ac=()=>new URLSearchParams(window.location.search).get(ui),Mv=({path:t,baseUrl:e,search:n}={})=>{const{pathname:r,origin:i,search:o}=window.location;return`${ui}=${encodeURIComponent(JSON.stringify({path:t||r,baseUrl:e||i,search:n||o}))}`},Uv=()=>{const t=ac();return t&&uc.setItem(ui,t),sc()},sc=()=>{try{const t=uc.getItem(ui)||ac();return Bv(t)}catch(t){return oi.error("Error parsing static state",t),Zn}},zv={create:Mv,init:Uv,get:sc},Vo=({onMessage:t,whitelist:e,sourceWindow:n})=>{const r=r=>{const i=r.origin===window.location.origin,o=!n||r.source===n,u=r.data&&"object"==typeof r.data&&"type"in r.data,a=e.some((({type:t})=>t===r.data.type||"*"===t));!i&&o&&u&&a&&t(r.data)};return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},qv=t=>{try{const{type:e,payload:n}=t,r={type:e};return void 0!==n&&(r.payload=JSON.parse(JSON.stringify(n))),r}catch(e){return oi.warn(`Could not serialize action type: ${t.type}`,e),{type:t.type,payload:`[Non-serializable payload for action: ${t.type}]`}}},Jo=({action:t,windowElement:e,whitelist:n})=>{if(e)try{const{type:r}=t;if(!n.some((({type:t})=>t===r||"*"===t)))return;const i=qv(t);e.postMessage(i,"*")}catch(t){oi.error("Failed to process or send message:",t)}},cc=({sourceWindow:t,sendWhitelist:e,receiveWhitelist:n,onMessage:r,onAction:i,name:o})=>{const u=lr((()=>{})),a=lr((()=>{}));return Ue((o=>{if(o)return u.current(),a.current(),u.current=Is((t=>{null==i||i(t),Jo({action:t,windowElement:o,whitelist:e})})),a.current=Vo({sourceWindow:t,onMessage:t=>{r?r(t):ze().dispatch(t)},whitelist:n}),()=>{u.current(),a.current()}}),[t,e,n,r,Is,i,o])},$v=t=>{if("object"!=typeof t||null===t)return!1;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||null===Object.getPrototypeOf(t)},Vv=t=>$v(t)&&"type"in t&&"string"==typeof t.type,J=t=>{const e=e=>({type:t,payload:e});return e.toString=()=>`${t}`,e.type=t,e.match=e=>Vv(e)&&e.type===t,e},ei=J("hostStoreConnect"),fc=J("remoteLogin"),lc=J("remoteLogout"),Jv=J("wsOnMessage"),hc=J("setRouterPath"),Kv=J("setDeviceType"),Gv=J("setDeviceWidth"),Hv=J("setUserError"),Qv=J("setUserIsError"),Yv=J("setUserPending"),Zv=J("setUserSuccess"),Xv=J("setUserData"),pc=J("updateAccountData"),t0=J("updateUser"),e0=J("addNotification"),r0=J("markNotification"),n0=J("setNotificationsError"),i0=J("setNotificationsList"),o0=J("setNotificationsPending"),u0=J("setNotificationsTotalCount"),a0=J("setNotificationsUnreadCount"),s0=J("acceptAllFollowRequests"),c0=J("resetNotificationsState"),f0=J("undoNotification"),l0=J("setInstanceInfo"),h0=J("setInstanceInfoPending"),p0=J("setInstanceInfoError"),d0=J("setPlatformSettings"),g0=J("setProfileSettings"),_0=J("setGroupData"),v0=J("setGroupLoading"),ri=J("remoteReady"),dc=J("askLogin"),gc=J("reselectUser"),_c=J("requestLogout"),vc=J("setConfirmLeavePage"),Ko=J("requestChangePath"),y0=J("wsSubscribe"),m0=J("wsUnSubscribe"),Go=[Ko,y0,m0,ri,gc,_c,dc,vc,s0],Ho=[fc,lc,ei,Jv,hc,Kv,Gv,Hv,Qv,Yv,Zv,Xv,pc,t0,e0,r0,n0,i0,o0,u0,a0,c0,f0,l0,h0,p0,d0,g0,_0,v0];if(Ho.some((t=>Go.some((e=>(null==e?void 0:e.toString())===(null==t?void 0:t.toString()))))))throw new Error("Output action is duplicated with input action");var Fs,qr={exports:{}},w0=qr.exports;
|
|
1
|
+
import{subscribeAfter as Is}from"https://cdn.jsdelivr.net/npm/@wellesley/redux-subscribe-action@1.0.536";import ev,{useRef as lr,useCallback as Ue,forwardRef as Ks,createElement as To,useEffect as le,useState as Mo,memo as Gs}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{getStore as ze,hydrate as rv,createStore as nv}from"https://cdn.jsdelivr.net/npm/@wellesley/store@1.0.791";import{api as Es}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.792";import{toast as ti}from"https://cdn.jsdelivr.net/npm/@wellesley/system-toast@1.0.136";import{createSlice as iv,createAction as Hs}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import{getErrorMsg as ov}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.641";import{useDispatch as ni,useSelector as Ee}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{routerSlice as Re}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.718";import{useLocation as Qs,useBlocker as uv,useNavigate as Ys}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";import{Dialog as av,DialogContent as sv,cn as Rs,ButtonLoader as ks}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.754";import{handleLogin as cv,handleLogout as fv}from"https://cdn.jsdelivr.net/npm/@wellesley/auth@1.0.848";const $r="8.48.0",he=globalThis;function Uo(t,e,n){const r=he,i=r.__SENTRY__=r.__SENTRY__||{},o=i[$r]=i[$r]||{};return o[t]||(o[t]=e())}const Zs=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,lv="Sentry Logger ",Os=["debug","info","warn","error","log","assert","trace"],Cs={};function hv(t){if(!("console"in he))return t();const e=he.console,n={},r=Object.keys(Cs);r.forEach((t=>{const r=Cs[t];n[t]=e[t],e[t]=r}));try{return t()}finally{r.forEach((t=>{e[t]=n[t]}))}}function pv(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return Zs?Os.forEach((n=>{e[n]=(...e)=>{t&&hv((()=>{he.console[n](`${lv}[${n}]:`,...e)}))}})):Os.forEach((t=>{e[t]=()=>{}})),e}const Yn=Uo("logger",pv);function zo(){return qo(he),he}function qo(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||$r,e[$r]=e[$r]||{}}const dv=Object.prototype.toString;function gv(t,e){return dv.call(t)===`[object ${e}]`}function _v(t){return gv(t,"Object")}function vv(t){return!(!t||!t.then||"function"!=typeof t.then)}function yv(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{Zs&&Yn.log(`Failed to add non-enumerable property "${e}" to object`,t)}}const Xs=1e3;function tc(){return Date.now()/Xs}function mv(){const{performance:t}=he;if(!t||!t.now)return tc;const e=Date.now()-t.now(),n=null==t.timeOrigin?e:t.timeOrigin;return()=>(n+t.now())/Xs}const wv=mv();function fr(){const t=he,e=t.crypto||t.msCrypto;let n=()=>16*Math.random();try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const t=new Uint8Array(1);return e.getRandomValues(t),t[0]})}catch{}return"10000000100040008000100000000000".replace(/[018]/g,(t=>(t^(15&n())>>t/4).toString(16)))}function bv(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||wv(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=32===e.sid.length?e.sid:fr()),void 0!==e.init&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),"number"==typeof e.started&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof e.duration)t.duration=e.duration;else{const e=t.timestamp-t.started;t.duration=e>=0?e:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),"number"==typeof e.errors&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Ls(){return fr()}function Ps(){return fr().substring(16)}function ec(t,e,n=2){if(!e||"object"!=typeof e||n<=0)return e;if(t&&e&&0===Object.keys(e).length)return t;const r={...t};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=ec(r[t],e[t],n-1));return r}(()=>{const{performance:t}=he;if(!t||!t.now)return;const e=36e5,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,o=i<e,u=t.timing&&t.timing.navigationStart,a="number"==typeof u?Math.abs(u+n-r):e;(o||a<e)&&(i<=a&&t.timeOrigin)})();const No="_sentrySpan";function js(t,e){e?yv(t,No,e):delete t[No]}function Ws(t){return t[No]}const Sv=100;class $o{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:Ls(),spanId:Ps()}}clone(){const t=new $o;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,js(t,Ws(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&bv(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,e){return this._tags={...this._tags,[t]:e},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,e){return this._extra={...this._extra,[t]:e},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,e){return null===e?delete this._contexts[t]:this._contexts[t]=e,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const e="function"==typeof t?t(this):t,[n,r]=e instanceof Vr?[e.getScopeData(),e.getRequestSession()]:_v(e)?[t,t.requestSession]:[],{tags:i,extra:o,user:u,contexts:a,level:s,fingerprint:c=[],propagationContext:l}=n||{};return this._tags={...this._tags,...i},this._extra={...this._extra,...o},this._contexts={...this._contexts,...a},u&&Object.keys(u).length&&(this._user=u),s&&(this._level=s),c.length&&(this._fingerprint=c),l&&(this._propagationContext=l),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,js(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ls()}),this._notifyScopeListeners(),this}addBreadcrumb(t,e){const n="number"==typeof e?e:Sv;if(n<=0)return this;const r={timestamp:tc(),...t},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),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:Ws(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=ec(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext={spanId:Ps(),...t},this}getPropagationContext(){return this._propagationContext}captureException(t,e){const n=e&&e.event_id?e.event_id:fr();if(!this._client)return Yn.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:r,...e,event_id:n},this),n}captureMessage(t,e,n){const r=n&&n.event_id?n.event_id:fr();if(!this._client)return Yn.warn("No client configured on scope - will not capture message!"),r;const i=new Error(t);return this._client.captureMessage(t,e,{originalException:t,syntheticException:i,...n,event_id:r},this),r}captureEvent(t,e){const n=e&&e.event_id?e.event_id:fr();return this._client?(this._client.captureEvent(t,{...e,event_id:n},this),n):(Yn.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((t=>{t(this)})),this._notifyingListeners=!1)}}const Vr=$o;function xv(){return Uo("defaultCurrentScope",(()=>new Vr))}function Av(){return Uo("defaultIsolationScope",(()=>new Vr))}class Iv{constructor(t,e){let n,r;n=t||new Vr,r=e||new Vr,this._stack=[{scope:n}],this._isolationScope=r}withScope(t){const e=this._pushScope();let n;try{n=t(e)}catch(t){throw this._popScope(),t}return vv(n)?n.then((t=>(this._popScope(),t)),(t=>{throw this._popScope(),t})):(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 t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function hr(){const t=qo(zo());return t.stack=t.stack||new Iv(xv(),Av())}function Ev(t){return hr().withScope(t)}function Rv(t,e){const n=hr();return n.withScope((()=>(n.getStackTop().scope=t,e(t))))}function Ts(t){return hr().withScope((()=>t(hr().getIsolationScope())))}function kv(){return{withIsolationScope:Ts,withScope:Ev,withSetScope:Rv,withSetIsolationScope:(t,e)=>Ts(e),getCurrentScope:()=>hr().getScope(),getIsolationScope:()=>hr().getIsolationScope()}}function rc(t){const e=qo(t);return e.acs?e.acs:kv()}function nc(){return rc(zo()).getCurrentScope()}function Ov(){return rc(zo()).getIsolationScope()}function Cv(t,e){return nc().captureException(t,void 0)}function Lv(t,e){const n={captureContext:e};return nc().captureMessage(t,void 0,n)}function Pv(t,e){Ov().setExtra(t,e)}var Hn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};const jv=(...t)=>{let e="";for(const n of t){if(n instanceof Error){const t=n;return Pv("exceptionMessage",e),void Cv(t)}if("object"!=typeof n)e+=n;else try{e+=" "+JSON.stringify(n)}catch{e+=" "+n}}Lv(e)},ii=()=>"object"!=typeof window,Wv="wlsy",ic=()=>{try{return window.localStorage}catch(t){console.warn("Error getting window.localStorage storage",t)}},Tv=()=>{const t=new Set,e=ic();if(!e)return[];for(let n=0;n<(null==e?void 0:e.length);n+=1){const r=null==e?void 0:e.key(n);"string"==typeof r&&t.add(r)}return Array.from(t)},oc=t=>{const e=`${Wv}`,n=t=>`${e}:${t}`,r=()=>Tv().filter((t=>t.startsWith(`${e}:`))),i=t=>t.slice(e.length+1),o=ic(),u=t=>{try{return null==o?void 0:o.getItem(n(t))}catch{return null}},a=(t,e)=>{try{null==o||o.setItem(n(t),String(e))}catch{return}};return{getItem:u,setItem:a,removeItem:t=>{try{null==o||o.removeItem(n(t))}catch{return}},clear:()=>{try{r().forEach((t=>null==o?void 0:o.removeItem(t)))}catch{return}},keys:()=>r().map(i),has:t=>null!==u(t),getJSON:t=>{const e=u(t);if(null==e)return null;try{return JSON.parse(e)}catch{return null}},setJSON:(t,e)=>{try{a(t,JSON.stringify(e))}catch{return}}}},Ns=["debug","info","warn","error"],Nv=(t,e)=>{const n=Ns.indexOf(t);return Ns.indexOf(e)>=n},Qn=(t,e,n,...r)=>{Nv(e,t)&&console.log(`[${t}] ${n}`,...r)},Fv=()=>oc().getItem("logger_lvl"),Dv=(t=(ii()?"info":Fv()||"warn"))=>{let e=t;return{debug:(t,...n)=>Qn("debug",e,t,...n),info:(t,...n)=>Qn("info",e,t,...n),warn:(t,...n)=>Qn("warn",e,t,...n),error:(t,...n)=>(jv(t,...n),Qn("error",e,t,...n)),setLevel:t=>{e=t},getLevel:()=>e}},oi=Dv(),ui="staticState",uc=oc(),Zn={path:"",baseUrl:"",search:""},Bv=t=>{if(!t)return Zn;try{return JSON.parse(decodeURIComponent(t))||Zn}catch(t){return oi.error("Error parsing static state",t),Zn}},ac=()=>new URLSearchParams(window.location.search).get(ui),Mv=({path:t,baseUrl:e,search:n}={})=>{const{pathname:r,origin:i,search:o}=window.location;return`${ui}=${encodeURIComponent(JSON.stringify({path:t||r,baseUrl:e||i,search:n||o}))}`},Uv=()=>{const t=ac();return t&&uc.setItem(ui,t),sc()},sc=()=>{try{const t=uc.getItem(ui)||ac();return Bv(t)}catch(t){return oi.error("Error parsing static state",t),Zn}},zv={create:Mv,init:Uv,get:sc},Vo=({onMessage:t,whitelist:e,sourceWindow:n})=>{const r=r=>{const i=r.origin===window.location.origin,o=!n||r.source===n,u=r.data&&"object"==typeof r.data&&"type"in r.data,a=e.some((({type:t})=>t===r.data.type||"*"===t));!i&&o&&u&&a&&t(r.data)};return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},qv=t=>{try{const{type:e,payload:n}=t,r={type:e};return void 0!==n&&(r.payload=JSON.parse(JSON.stringify(n))),r}catch(e){return oi.warn(`Could not serialize action type: ${t.type}`,e),{type:t.type,payload:`[Non-serializable payload for action: ${t.type}]`}}},Jo=({action:t,windowElement:e,whitelist:n})=>{if(e)try{const{type:r}=t;if(!n.some((({type:t})=>t===r||"*"===t)))return;const i=qv(t);e.postMessage(i,"*")}catch(t){oi.error("Failed to process or send message:",t)}},cc=({sourceWindow:t,sendWhitelist:e,receiveWhitelist:n,onMessage:r,onAction:i,name:o})=>{const u=lr((()=>{})),a=lr((()=>{}));return Ue((o=>{if(o)return u.current(),a.current(),u.current=Is((t=>{null==i||i(t),Jo({action:t,windowElement:o,whitelist:e})})),a.current=Vo({sourceWindow:t,onMessage:t=>{r?r(t):ze().dispatch(t)},whitelist:n}),()=>{u.current(),a.current()}}),[t,e,n,r,Is,i,o])},$v=t=>{if("object"!=typeof t||null===t)return!1;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||null===Object.getPrototypeOf(t)},Vv=t=>$v(t)&&"type"in t&&"string"==typeof t.type,J=t=>{const e=e=>({type:t,payload:e});return e.toString=()=>`${t}`,e.type=t,e.match=e=>Vv(e)&&e.type===t,e},ei=J("hostStoreConnect"),fc=J("remoteLogin"),lc=J("remoteLogout"),Jv=J("wsOnMessage"),hc=J("setRouterPath"),Kv=J("setDeviceType"),Gv=J("setDeviceWidth"),Hv=J("setUserError"),Qv=J("setUserIsError"),Yv=J("setUserPending"),Zv=J("setUserSuccess"),Xv=J("setUserData"),pc=J("updateAccountData"),t0=J("updateUser"),e0=J("addNotification"),r0=J("markNotification"),n0=J("setNotificationsError"),i0=J("setNotificationsList"),o0=J("setNotificationsPending"),u0=J("setNotificationsTotalCount"),a0=J("setNotificationsUnreadCount"),s0=J("acceptAllFollowRequests"),c0=J("resetNotificationsState"),f0=J("undoNotification"),l0=J("setInstanceInfo"),h0=J("setInstanceInfoPending"),p0=J("setInstanceInfoError"),d0=J("setPlatformSettings"),g0=J("setProfileSettings"),_0=J("setGroupData"),v0=J("setGroupLoading"),ri=J("remoteReady"),dc=J("askLogin"),gc=J("reselectUser"),_c=J("requestLogout"),vc=J("setConfirmLeavePage"),Ko=J("requestChangePath"),y0=J("wsSubscribe"),m0=J("wsUnSubscribe"),Go=[Ko,y0,m0,ri,gc,_c,dc,vc,s0],Ho=[fc,lc,ei,Jv,hc,Kv,Gv,Hv,Qv,Yv,Zv,Xv,pc,t0,e0,r0,n0,i0,o0,u0,a0,c0,f0,l0,h0,p0,d0,g0,_0,v0];if(Ho.some((t=>Go.some((e=>(null==e?void 0:e.toString())===(null==t?void 0:t.toString()))))))throw new Error("Output action is duplicated with input action");var Fs,qr={exports:{}},w0=qr.exports;
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Lodash <https://lodash.com/>
|