@xapp/chat-widget 1.105.3 → 1.105.4

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/dist/index.js CHANGED
@@ -10906,7 +10906,6 @@ class Socket extends Emitter_1 {
10906
10906
  case PacketType.CONNECT_ERROR:
10907
10907
  this.destroy();
10908
10908
  const err = new Error(packet.data.message);
10909
- // @ts-ignore
10910
10909
  err.data = packet.data.data;
10911
10910
  this.emitReserved("connect_error", err);
10912
10911
  break;
@@ -36958,182 +36957,144 @@ function createThunkMiddleware(extraArgument) {
36958
36957
  var thunk = createThunkMiddleware();
36959
36958
  var withExtraArgument = createThunkMiddleware;
36960
36959
 
36961
- // src/index.ts
36962
-
36963
- // src/devtoolsExtension.ts
36964
- var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {
36965
- if (arguments.length === 0) return void 0;
36966
- if (typeof arguments[0] === "object") return compose;
36967
- return compose.apply(null, arguments);
36960
+ //#endregion
36961
+ //#region src/devtoolsExtension.ts
36962
+ const composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {
36963
+ if (arguments.length === 0) return void 0;
36964
+ if (typeof arguments[0] === "object") return compose;
36965
+ return compose.apply(null, arguments);
36968
36966
  };
36969
- var Tuple = class _Tuple extends Array {
36970
- constructor(...items) {
36971
- super(...items);
36972
- Object.setPrototypeOf(this, _Tuple.prototype);
36973
- }
36974
- static get [Symbol.species]() {
36975
- return _Tuple;
36976
- }
36977
- concat(...arr) {
36978
- return super.concat.apply(this, arr);
36979
- }
36980
- prepend(...arr) {
36981
- if (arr.length === 1 && Array.isArray(arr[0])) {
36982
- return new _Tuple(...arr[0].concat(this));
36983
- }
36984
- return new _Tuple(...arr.concat(this));
36985
- }
36967
+ var Tuple = class Tuple extends Array {
36968
+ constructor(...items) {
36969
+ super(...items);
36970
+ Object.setPrototypeOf(this, Tuple.prototype);
36971
+ }
36972
+ static get [Symbol.species]() {
36973
+ return Tuple;
36974
+ }
36975
+ concat(...arr) {
36976
+ return super.concat.apply(this, arr);
36977
+ }
36978
+ prepend(...arr) {
36979
+ if (arr.length === 1 && Array.isArray(arr[0])) return new Tuple(...arr[0].concat(this));
36980
+ return new Tuple(...arr.concat(this));
36981
+ }
36986
36982
  };
36987
-
36988
- // src/getDefaultMiddleware.ts
36983
+ //#endregion
36984
+ //#region src/getDefaultMiddleware.ts
36989
36985
  function isBoolean(x) {
36990
- return typeof x === "boolean";
36991
- }
36992
- var buildGetDefaultMiddleware = () => function getDefaultMiddleware(options) {
36993
- const {
36994
- thunk: thunk$1 = true,
36995
- immutableCheck = true,
36996
- serializableCheck = true,
36997
- actionCreatorCheck = true
36998
- } = options ?? {};
36999
- let middlewareArray = new Tuple();
37000
- if (thunk$1) {
37001
- if (isBoolean(thunk$1)) {
37002
- middlewareArray.push(thunk);
37003
- } else {
37004
- middlewareArray.push(withExtraArgument(thunk$1.extraArgument));
37005
- }
37006
- }
37007
- return middlewareArray;
36986
+ return typeof x === "boolean";
36987
+ }
36988
+ const buildGetDefaultMiddleware = () => function getDefaultMiddleware(options) {
36989
+ const { thunk: thunk$1 = true, immutableCheck = true, serializableCheck = true, actionCreatorCheck = true } = options ?? {};
36990
+ let middlewareArray = new Tuple();
36991
+ if (thunk$1) {
36992
+ if (isBoolean(thunk$1)) middlewareArray.push(thunk);
36993
+ else middlewareArray.push(withExtraArgument(thunk$1.extraArgument));
36994
+ }
36995
+ return middlewareArray;
37008
36996
  };
37009
-
37010
- // src/autoBatchEnhancer.ts
37011
- var SHOULD_AUTOBATCH = "RTK_autoBatch";
37012
- var createQueueWithTimer = (timeout) => {
37013
- return (notify) => {
37014
- setTimeout(notify, timeout);
37015
- };
36997
+ //#endregion
36998
+ //#region src/autoBatchEnhancer.ts
36999
+ const SHOULD_AUTOBATCH = "RTK_autoBatch";
37000
+ const createQueueWithTimer = (timeout) => {
37001
+ return (notify) => {
37002
+ setTimeout(notify, timeout);
37003
+ };
37016
37004
  };
37017
- var createRafWithFallbackTimer = (raf, timeout) => {
37018
- return (notify) => {
37019
- let called = false;
37020
- const callback = () => {
37021
- if (called) return;
37022
- called = true;
37023
- cancelAnimationFrame(rafId);
37024
- clearTimeout(timerId);
37025
- notify();
37026
- };
37027
- const rafId = raf(callback);
37028
- const timerId = setTimeout(callback, timeout);
37029
- };
37005
+ const createRafWithFallbackTimer = (raf, timeout) => {
37006
+ return (notify) => {
37007
+ let called = false;
37008
+ let rafId;
37009
+ let timerId;
37010
+ const callback = () => {
37011
+ if (called) return;
37012
+ called = true;
37013
+ cancelAnimationFrame(rafId);
37014
+ clearTimeout(timerId);
37015
+ notify();
37016
+ };
37017
+ rafId = raf(callback);
37018
+ timerId = setTimeout(callback, timeout);
37019
+ };
37030
37020
  };
37031
- var autoBatchEnhancer = (options = {
37032
- type: "raf"
37033
- }) => (next) => (...args) => {
37034
- const store = next(...args);
37035
- let notifying = true;
37036
- let shouldNotifyAtEndOfTick = false;
37037
- let notificationQueued = false;
37038
- const listeners = /* @__PURE__ */ new Set();
37039
- const queueCallback = options.type === "tick" ? queueMicrotask : options.type === "raf" ? (
37040
- // requestAnimationFrame won't exist in SSR environments. Fall back to a vague approximation just to keep from erroring.
37041
- typeof window !== "undefined" && window.requestAnimationFrame ? createRafWithFallbackTimer(window.requestAnimationFrame, 100) : createQueueWithTimer(10)
37042
- ) : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout);
37043
- const notifyListeners = () => {
37044
- notificationQueued = false;
37045
- if (shouldNotifyAtEndOfTick) {
37046
- shouldNotifyAtEndOfTick = false;
37047
- listeners.forEach((l) => l());
37048
- }
37049
- };
37050
- return Object.assign({}, store, {
37051
- // Override the base `store.subscribe` method to keep original listeners
37052
- // from running if we're delaying notifications
37053
- subscribe(listener2) {
37054
- const wrappedListener = () => notifying && listener2();
37055
- const unsubscribe = store.subscribe(wrappedListener);
37056
- listeners.add(listener2);
37057
- return () => {
37058
- unsubscribe();
37059
- listeners.delete(listener2);
37060
- };
37061
- },
37062
- // Override the base `store.dispatch` method so that we can check actions
37063
- // for the `shouldAutoBatch` flag and determine if batching is active
37064
- dispatch(action) {
37065
- try {
37066
- notifying = !action?.meta?.[SHOULD_AUTOBATCH];
37067
- shouldNotifyAtEndOfTick = !notifying;
37068
- if (shouldNotifyAtEndOfTick) {
37069
- if (!notificationQueued) {
37070
- notificationQueued = true;
37071
- queueCallback(notifyListeners);
37072
- }
37073
- }
37074
- return store.dispatch(action);
37075
- } finally {
37076
- notifying = true;
37077
- }
37078
- }
37079
- });
37021
+ const autoBatchEnhancer = (options = { type: "raf" }) => (next) => (...args) => {
37022
+ const store = next(...args);
37023
+ let notifying = true;
37024
+ let shouldNotifyAtEndOfTick = false;
37025
+ let notificationQueued = false;
37026
+ const listeners = /* @__PURE__ */ new Set();
37027
+ const queueCallback = options.type === "tick" ? queueMicrotask : options.type === "raf" ? typeof window !== "undefined" && window.requestAnimationFrame ? createRafWithFallbackTimer(window.requestAnimationFrame, 100) : createQueueWithTimer(10) : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout);
37028
+ const notifyListeners = () => {
37029
+ notificationQueued = false;
37030
+ if (shouldNotifyAtEndOfTick) {
37031
+ shouldNotifyAtEndOfTick = false;
37032
+ listeners.forEach((l) => l());
37033
+ }
37034
+ };
37035
+ return Object.assign({}, store, {
37036
+ subscribe(listener) {
37037
+ const wrappedListener = () => notifying && listener();
37038
+ const unsubscribe = store.subscribe(wrappedListener);
37039
+ listeners.add(listener);
37040
+ return () => {
37041
+ unsubscribe();
37042
+ listeners.delete(listener);
37043
+ };
37044
+ },
37045
+ dispatch(action) {
37046
+ try {
37047
+ notifying = !action?.meta?.[SHOULD_AUTOBATCH];
37048
+ shouldNotifyAtEndOfTick = !notifying;
37049
+ if (shouldNotifyAtEndOfTick) {
37050
+ if (!notificationQueued) {
37051
+ notificationQueued = true;
37052
+ queueCallback(notifyListeners);
37053
+ }
37054
+ }
37055
+ return store.dispatch(action);
37056
+ } finally {
37057
+ notifying = true;
37058
+ }
37059
+ }
37060
+ });
37080
37061
  };
37081
-
37082
- // src/getDefaultEnhancers.ts
37083
- var buildGetDefaultEnhancers = (middlewareEnhancer) => function getDefaultEnhancers(options) {
37084
- const {
37085
- autoBatch = true
37086
- } = options ?? {};
37087
- let enhancerArray = new Tuple(middlewareEnhancer);
37088
- if (autoBatch) {
37089
- enhancerArray.push(autoBatchEnhancer(typeof autoBatch === "object" ? autoBatch : void 0));
37090
- }
37091
- return enhancerArray;
37062
+ //#endregion
37063
+ //#region src/getDefaultEnhancers.ts
37064
+ const buildGetDefaultEnhancers = (middlewareEnhancer) => function getDefaultEnhancers(options) {
37065
+ const { autoBatch = true } = options ?? {};
37066
+ let enhancerArray = new Tuple(middlewareEnhancer);
37067
+ if (autoBatch) enhancerArray.push(autoBatchEnhancer(typeof autoBatch === "object" ? autoBatch : void 0));
37068
+ return enhancerArray;
37092
37069
  };
37093
-
37094
- // src/configureStore.ts
37070
+ //#endregion
37071
+ //#region src/configureStore.ts
37095
37072
  function configureStore(options) {
37096
- const getDefaultMiddleware = buildGetDefaultMiddleware();
37097
- const {
37098
- reducer = void 0,
37099
- middleware,
37100
- devTools = true,
37101
- duplicateMiddlewareCheck = true,
37102
- preloadedState = void 0,
37103
- enhancers = void 0
37104
- } = options || {};
37105
- let rootReducer;
37106
- if (typeof reducer === "function") {
37107
- rootReducer = reducer;
37108
- } else if (isPlainObject(reducer)) {
37109
- rootReducer = combineReducers(reducer);
37110
- } else {
37111
- throw new Error(formatProdErrorMessage(1) );
37112
- }
37113
- let finalMiddleware;
37114
- if (typeof middleware === "function") {
37115
- finalMiddleware = middleware(getDefaultMiddleware);
37116
- } else {
37117
- finalMiddleware = getDefaultMiddleware();
37118
- }
37119
- let finalCompose = compose;
37120
- if (devTools) {
37121
- finalCompose = composeWithDevTools({
37122
- // Enable capture of stack traces for dispatched Redux actions
37123
- trace: "production" !== "production",
37124
- ...typeof devTools === "object" && devTools
37125
- });
37126
- }
37127
- const middlewareEnhancer = applyMiddleware(...finalMiddleware);
37128
- const getDefaultEnhancers = buildGetDefaultEnhancers(middlewareEnhancer);
37129
- let storeEnhancers = typeof enhancers === "function" ? enhancers(getDefaultEnhancers) : getDefaultEnhancers();
37130
- const composedEnhancer = finalCompose(...storeEnhancers);
37131
- return createStore(rootReducer, preloadedState, composedEnhancer);
37132
- }
37133
-
37134
- // src/formatProdErrorMessage.ts
37073
+ const getDefaultMiddleware = buildGetDefaultMiddleware();
37074
+ const { reducer = void 0, middleware, devTools = true, duplicateMiddlewareCheck = true, preloadedState = void 0, enhancers = void 0 } = options || {};
37075
+ let rootReducer;
37076
+ if (typeof reducer === "function") rootReducer = reducer;
37077
+ else if (isPlainObject(reducer)) rootReducer = combineReducers(reducer);
37078
+ else throw new Error(formatProdErrorMessage(1) );
37079
+ let finalMiddleware;
37080
+ if (typeof middleware === "function") {
37081
+ finalMiddleware = middleware(getDefaultMiddleware);
37082
+ } else finalMiddleware = getDefaultMiddleware();
37083
+ let finalCompose = compose;
37084
+ if (devTools) finalCompose = composeWithDevTools({
37085
+ trace: "production" !== "production",
37086
+ ...typeof devTools === "object" && devTools
37087
+ });
37088
+ const middlewareEnhancer = applyMiddleware(...finalMiddleware);
37089
+ const getDefaultEnhancers = buildGetDefaultEnhancers(middlewareEnhancer);
37090
+ let storeEnhancers = typeof enhancers === "function" ? enhancers(getDefaultEnhancers) : getDefaultEnhancers();
37091
+ const composedEnhancer = finalCompose(...storeEnhancers);
37092
+ return createStore(rootReducer, preloadedState, composedEnhancer);
37093
+ }
37094
+ //#endregion
37095
+ //#region src/formatProdErrorMessage.ts
37135
37096
  function formatProdErrorMessage(code) {
37136
- return `Minified Redux Toolkit error #${code}; visit https://redux-toolkit.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
37097
+ return `Minified Redux Toolkit error #${code}; visit https://redux-toolkit.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
37137
37098
  }
37138
37099
 
37139
37100
  // Function to create a static reducer