@seamly/web-ui 25.1.0 → 25.2.0-beta.2

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.
Files changed (29) hide show
  1. package/build/dist/lib/index.debug.js +279 -116
  2. package/build/dist/lib/index.debug.js.map +1 -1
  3. package/build/dist/lib/index.debug.min.js +1 -1
  4. package/build/dist/lib/index.debug.min.js.LICENSE.txt +2 -2
  5. package/build/dist/lib/index.debug.min.js.map +1 -1
  6. package/build/dist/lib/index.js +846 -691
  7. package/build/dist/lib/index.js.map +1 -1
  8. package/build/dist/lib/index.min.js +1 -1
  9. package/build/dist/lib/index.min.js.LICENSE.txt +2 -2
  10. package/build/dist/lib/index.min.js.map +1 -1
  11. package/build/dist/lib/style-guide.js +1300 -41
  12. package/build/dist/lib/style-guide.js.map +1 -1
  13. package/build/dist/lib/style-guide.min.js +1 -1
  14. package/build/dist/lib/style-guide.min.js.map +1 -1
  15. package/build/dist/lib/styles.css +1 -1
  16. package/package.json +16 -16
  17. package/src/javascripts/core/domains/store/slice.ts +1 -0
  18. package/src/javascripts/core/domains/store/store.types.ts +1 -0
  19. package/src/javascripts/core/ui/components/conversation/conversation.tsx +5 -2
  20. package/src/javascripts/core/ui/components/conversation/loader.tsx +12 -2
  21. package/src/javascripts/core/ui/components/entry/text-entry/index.tsx +2 -2
  22. package/src/javascripts/core/ui/components/entry/upload/index.tsx +2 -2
  23. package/src/javascripts/core/ui/components/layout/chat.tsx +21 -1
  24. package/src/javascripts/core/ui/components/view/window-view/window-open-button.tsx +20 -5
  25. package/src/javascripts/core/ui/components/warnings/prompt.tsx +2 -2
  26. package/src/javascripts/core/ui/hooks/focus-helper-hooks.ts +11 -2
  27. package/src/javascripts/core/ui/hooks/seamly-hooks.ts +2 -1
  28. package/src/javascripts/core/ui/hooks/seamly-state-hooks.ts +4 -1
  29. package/src/stylesheets/5-components/_conversation.scss +6 -2
@@ -3001,10 +3001,10 @@ var SHARED = '__core-js_shared__';
3001
3001
  var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
3002
3002
 
3003
3003
  (store.versions || (store.versions = [])).push({
3004
- version: '3.45.1',
3004
+ version: '3.46.0',
3005
3005
  mode: IS_PURE ? 'pure' : 'global',
3006
- copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)',
3007
- license: 'https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE',
3006
+ copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)',
3007
+ license: 'https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE',
3008
3008
  source: 'https://github.com/zloirock/core-js'
3009
3009
  });
3010
3010
 
@@ -5837,7 +5837,7 @@ class API {
5837
5837
  return {
5838
5838
  clientName: "@seamly/web-ui",
5839
5839
  clientVariant: this.#layoutMode,
5840
- clientVersion: "25.1.0",
5840
+ clientVersion: "25.2.0-beta.2",
5841
5841
  currentUrl: window.location.toString(),
5842
5842
  screenResolution: `${window.screen.width}x${window.screen.height}`,
5843
5843
  timezone: getTimeZone(),
@@ -5846,608 +5846,227 @@ class API {
5846
5846
  };
5847
5847
  }
5848
5848
  }
5849
- ;// ./node_modules/redux/dist/redux.mjs
5850
- // src/utils/formatProdErrorMessage.ts
5851
- function formatProdErrorMessage(code) {
5852
- return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
5853
- }
5854
-
5855
- // src/utils/symbol-observable.ts
5856
- var $$observable = /* @__PURE__ */ (() => typeof Symbol === "function" && Symbol.observable || "@@observable")();
5857
- var symbol_observable_default = $$observable;
5849
+ ;// ./node_modules/immer/dist/immer.mjs
5850
+ // src/utils/env.ts
5851
+ var NOTHING = Symbol.for("immer-nothing");
5852
+ var DRAFTABLE = Symbol.for("immer-draftable");
5853
+ var DRAFT_STATE = Symbol.for("immer-state");
5858
5854
 
5859
- // src/utils/actionTypes.ts
5860
- var randomString = () => Math.random().toString(36).substring(7).split("").join(".");
5861
- var ActionTypes = {
5862
- INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,
5863
- REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,
5864
- PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`
5865
- };
5866
- var actionTypes_default = ActionTypes;
5855
+ // src/utils/errors.ts
5856
+ var errors = false ? 0 : [];
5857
+ function die(error, ...args) {
5858
+ if (false) // removed by dead control flow
5859
+ {}
5860
+ throw new Error(
5861
+ `[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`
5862
+ );
5863
+ }
5867
5864
 
5868
- // src/utils/isPlainObject.ts
5869
- function redux_isPlainObject(obj) {
5870
- if (typeof obj !== "object" || obj === null)
5865
+ // src/utils/common.ts
5866
+ var getPrototypeOf = Object.getPrototypeOf;
5867
+ function immer_isDraft(value) {
5868
+ return !!value && !!value[DRAFT_STATE];
5869
+ }
5870
+ function isDraftable(value) {
5871
+ if (!value)
5871
5872
  return false;
5872
- let proto = obj;
5873
- while (Object.getPrototypeOf(proto) !== null) {
5874
- proto = Object.getPrototypeOf(proto);
5875
- }
5876
- return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;
5873
+ return immer_isPlainObject(value) || Array.isArray(value) || !!value[DRAFTABLE] || !!value.constructor?.[DRAFTABLE] || isMap(value) || isSet(value);
5877
5874
  }
5878
-
5879
- // src/utils/kindOf.ts
5880
- function miniKindOf(val) {
5881
- if (val === void 0)
5882
- return "undefined";
5883
- if (val === null)
5884
- return "null";
5885
- const type = typeof val;
5886
- switch (type) {
5887
- case "boolean":
5888
- case "string":
5889
- case "number":
5890
- case "symbol":
5891
- case "function": {
5892
- return type;
5893
- }
5875
+ var objectCtorString = Object.prototype.constructor.toString();
5876
+ var cachedCtorStrings = /* @__PURE__ */ new WeakMap();
5877
+ function immer_isPlainObject(value) {
5878
+ if (!value || typeof value !== "object")
5879
+ return false;
5880
+ const proto = Object.getPrototypeOf(value);
5881
+ if (proto === null || proto === Object.prototype)
5882
+ return true;
5883
+ const Ctor = Object.hasOwnProperty.call(proto, "constructor") && proto.constructor;
5884
+ if (Ctor === Object)
5885
+ return true;
5886
+ if (typeof Ctor !== "function")
5887
+ return false;
5888
+ let ctorString = cachedCtorStrings.get(Ctor);
5889
+ if (ctorString === void 0) {
5890
+ ctorString = Function.toString.call(Ctor);
5891
+ cachedCtorStrings.set(Ctor, ctorString);
5894
5892
  }
5895
- if (Array.isArray(val))
5896
- return "array";
5897
- if (isDate(val))
5898
- return "date";
5899
- if (isError(val))
5900
- return "error";
5901
- const constructorName = ctorName(val);
5902
- switch (constructorName) {
5903
- case "Symbol":
5904
- case "Promise":
5905
- case "WeakMap":
5906
- case "WeakSet":
5907
- case "Map":
5908
- case "Set":
5909
- return constructorName;
5893
+ return ctorString === objectCtorString;
5894
+ }
5895
+ function original(value) {
5896
+ if (!immer_isDraft(value))
5897
+ die(15, value);
5898
+ return value[DRAFT_STATE].base_;
5899
+ }
5900
+ function each(obj, iter, strict = true) {
5901
+ if (getArchtype(obj) === 0 /* Object */) {
5902
+ const keys = strict ? Reflect.ownKeys(obj) : Object.keys(obj);
5903
+ keys.forEach((key) => {
5904
+ iter(key, obj[key], obj);
5905
+ });
5906
+ } else {
5907
+ obj.forEach((entry, index) => iter(index, entry, obj));
5910
5908
  }
5911
- return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, "");
5912
5909
  }
5913
- function ctorName(val) {
5914
- return typeof val.constructor === "function" ? val.constructor.name : null;
5910
+ function getArchtype(thing) {
5911
+ const state = thing[DRAFT_STATE];
5912
+ return state ? state.type_ : Array.isArray(thing) ? 1 /* Array */ : isMap(thing) ? 2 /* Map */ : isSet(thing) ? 3 /* Set */ : 0 /* Object */;
5915
5913
  }
5916
- function isError(val) {
5917
- return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
5914
+ function has(thing, prop) {
5915
+ return getArchtype(thing) === 2 /* Map */ ? thing.has(prop) : Object.prototype.hasOwnProperty.call(thing, prop);
5918
5916
  }
5919
- function isDate(val) {
5920
- if (val instanceof Date)
5921
- return true;
5922
- return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
5917
+ function get(thing, prop) {
5918
+ return getArchtype(thing) === 2 /* Map */ ? thing.get(prop) : thing[prop];
5923
5919
  }
5924
- function kindOf(val) {
5925
- let typeOfVal = typeof val;
5926
- if (false) // removed by dead control flow
5927
- {}
5928
- return typeOfVal;
5920
+ function set(thing, propOrOldValue, value) {
5921
+ const t = getArchtype(thing);
5922
+ if (t === 2 /* Map */)
5923
+ thing.set(propOrOldValue, value);
5924
+ else if (t === 3 /* Set */) {
5925
+ thing.add(value);
5926
+ } else
5927
+ thing[propOrOldValue] = value;
5929
5928
  }
5930
-
5931
- // src/createStore.ts
5932
- function createStore(reducer, preloadedState, enhancer) {
5933
- if (typeof reducer !== "function") {
5934
- throw new Error( true ? formatProdErrorMessage(2) : 0);
5935
- }
5936
- if (typeof preloadedState === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") {
5937
- throw new Error( true ? formatProdErrorMessage(0) : 0);
5929
+ function is(x, y) {
5930
+ if (x === y) {
5931
+ return x !== 0 || 1 / x === 1 / y;
5932
+ } else {
5933
+ return x !== x && y !== y;
5938
5934
  }
5939
- if (typeof preloadedState === "function" && typeof enhancer === "undefined") {
5940
- enhancer = preloadedState;
5941
- preloadedState = void 0;
5935
+ }
5936
+ function isMap(target) {
5937
+ return target instanceof Map;
5938
+ }
5939
+ function isSet(target) {
5940
+ return target instanceof Set;
5941
+ }
5942
+ function latest(state) {
5943
+ return state.copy_ || state.base_;
5944
+ }
5945
+ function shallowCopy(base, strict) {
5946
+ if (isMap(base)) {
5947
+ return new Map(base);
5942
5948
  }
5943
- if (typeof enhancer !== "undefined") {
5944
- if (typeof enhancer !== "function") {
5945
- throw new Error( true ? formatProdErrorMessage(1) : 0);
5946
- }
5947
- return enhancer(createStore)(reducer, preloadedState);
5949
+ if (isSet(base)) {
5950
+ return new Set(base);
5948
5951
  }
5949
- let currentReducer = reducer;
5950
- let currentState = preloadedState;
5951
- let currentListeners = /* @__PURE__ */ new Map();
5952
- let nextListeners = currentListeners;
5953
- let listenerIdCounter = 0;
5954
- let isDispatching = false;
5955
- function ensureCanMutateNextListeners() {
5956
- if (nextListeners === currentListeners) {
5957
- nextListeners = /* @__PURE__ */ new Map();
5958
- currentListeners.forEach((listener, key) => {
5959
- nextListeners.set(key, listener);
5960
- });
5952
+ if (Array.isArray(base))
5953
+ return Array.prototype.slice.call(base);
5954
+ const isPlain = immer_isPlainObject(base);
5955
+ if (strict === true || strict === "class_only" && !isPlain) {
5956
+ const descriptors = Object.getOwnPropertyDescriptors(base);
5957
+ delete descriptors[DRAFT_STATE];
5958
+ let keys = Reflect.ownKeys(descriptors);
5959
+ for (let i = 0; i < keys.length; i++) {
5960
+ const key = keys[i];
5961
+ const desc = descriptors[key];
5962
+ if (desc.writable === false) {
5963
+ desc.writable = true;
5964
+ desc.configurable = true;
5965
+ }
5966
+ if (desc.get || desc.set)
5967
+ descriptors[key] = {
5968
+ configurable: true,
5969
+ writable: true,
5970
+ // could live with !!desc.set as well here...
5971
+ enumerable: desc.enumerable,
5972
+ value: base[key]
5973
+ };
5961
5974
  }
5962
- }
5963
- function getState() {
5964
- if (isDispatching) {
5965
- throw new Error( true ? formatProdErrorMessage(3) : 0);
5975
+ return Object.create(getPrototypeOf(base), descriptors);
5976
+ } else {
5977
+ const proto = getPrototypeOf(base);
5978
+ if (proto !== null && isPlain) {
5979
+ return { ...base };
5966
5980
  }
5967
- return currentState;
5981
+ const obj = Object.create(proto);
5982
+ return Object.assign(obj, base);
5968
5983
  }
5969
- function subscribe(listener) {
5970
- if (typeof listener !== "function") {
5971
- throw new Error( true ? formatProdErrorMessage(4) : 0);
5972
- }
5973
- if (isDispatching) {
5974
- throw new Error( true ? formatProdErrorMessage(5) : 0);
5975
- }
5976
- let isSubscribed = true;
5977
- ensureCanMutateNextListeners();
5978
- const listenerId = listenerIdCounter++;
5979
- nextListeners.set(listenerId, listener);
5980
- return function unsubscribe() {
5981
- if (!isSubscribed) {
5982
- return;
5983
- }
5984
- if (isDispatching) {
5985
- throw new Error( true ? formatProdErrorMessage(6) : 0);
5986
- }
5987
- isSubscribed = false;
5988
- ensureCanMutateNextListeners();
5989
- nextListeners.delete(listenerId);
5990
- currentListeners = null;
5991
- };
5984
+ }
5985
+ function freeze(obj, deep = false) {
5986
+ if (isFrozen(obj) || immer_isDraft(obj) || !isDraftable(obj))
5987
+ return obj;
5988
+ if (getArchtype(obj) > 1) {
5989
+ Object.defineProperties(obj, {
5990
+ set: dontMutateMethodOverride,
5991
+ add: dontMutateMethodOverride,
5992
+ clear: dontMutateMethodOverride,
5993
+ delete: dontMutateMethodOverride
5994
+ });
5992
5995
  }
5993
- function dispatch(action) {
5994
- if (!redux_isPlainObject(action)) {
5995
- throw new Error( true ? formatProdErrorMessage(7) : 0);
5996
- }
5997
- if (typeof action.type === "undefined") {
5998
- throw new Error( true ? formatProdErrorMessage(8) : 0);
5999
- }
6000
- if (typeof action.type !== "string") {
6001
- throw new Error( true ? formatProdErrorMessage(17) : 0);
6002
- }
6003
- if (isDispatching) {
6004
- throw new Error( true ? formatProdErrorMessage(9) : 0);
6005
- }
6006
- try {
6007
- isDispatching = true;
6008
- currentState = currentReducer(currentState, action);
6009
- } finally {
6010
- isDispatching = false;
6011
- }
6012
- const listeners = currentListeners = nextListeners;
6013
- listeners.forEach((listener) => {
6014
- listener();
6015
- });
6016
- return action;
6017
- }
6018
- function replaceReducer(nextReducer) {
6019
- if (typeof nextReducer !== "function") {
6020
- throw new Error( true ? formatProdErrorMessage(10) : 0);
6021
- }
6022
- currentReducer = nextReducer;
6023
- dispatch({
6024
- type: actionTypes_default.REPLACE
6025
- });
6026
- }
6027
- function observable() {
6028
- const outerSubscribe = subscribe;
6029
- return {
6030
- /**
6031
- * The minimal observable subscription method.
6032
- * @param observer Any object that can be used as an observer.
6033
- * The observer object should have a `next` method.
6034
- * @returns An object with an `unsubscribe` method that can
6035
- * be used to unsubscribe the observable from the store, and prevent further
6036
- * emission of values from the observable.
6037
- */
6038
- subscribe(observer) {
6039
- if (typeof observer !== "object" || observer === null) {
6040
- throw new Error( true ? formatProdErrorMessage(11) : 0);
6041
- }
6042
- function observeState() {
6043
- const observerAsObserver = observer;
6044
- if (observerAsObserver.next) {
6045
- observerAsObserver.next(getState());
6046
- }
6047
- }
6048
- observeState();
6049
- const unsubscribe = outerSubscribe(observeState);
6050
- return {
6051
- unsubscribe
6052
- };
6053
- },
6054
- [symbol_observable_default]() {
6055
- return this;
6056
- }
6057
- };
6058
- }
6059
- dispatch({
6060
- type: actionTypes_default.INIT
6061
- });
6062
- const store = {
6063
- dispatch,
6064
- subscribe,
6065
- getState,
6066
- replaceReducer,
6067
- [symbol_observable_default]: observable
6068
- };
6069
- return store;
5996
+ Object.freeze(obj);
5997
+ if (deep)
5998
+ Object.values(obj).forEach((value) => freeze(value, true));
5999
+ return obj;
6070
6000
  }
6071
- function legacy_createStore(reducer, preloadedState, enhancer) {
6072
- return createStore(reducer, preloadedState, enhancer);
6001
+ function dontMutateFrozenCollections() {
6002
+ die(2);
6073
6003
  }
6074
-
6075
- // src/utils/warning.ts
6076
- function warning(message) {
6077
- if (typeof console !== "undefined" && typeof console.error === "function") {
6078
- console.error(message);
6079
- }
6080
- try {
6081
- throw new Error(message);
6082
- } catch (e) {
6083
- }
6004
+ var dontMutateMethodOverride = {
6005
+ value: dontMutateFrozenCollections
6006
+ };
6007
+ function isFrozen(obj) {
6008
+ if (obj === null || typeof obj !== "object")
6009
+ return true;
6010
+ return Object.isFrozen(obj);
6084
6011
  }
6085
6012
 
6086
- // src/combineReducers.ts
6087
- function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
6088
- const reducerKeys = Object.keys(reducers);
6089
- const argumentName = action && action.type === actionTypes_default.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
6090
- if (reducerKeys.length === 0) {
6091
- return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";
6092
- }
6093
- if (!redux_isPlainObject(inputState)) {
6094
- return `The ${argumentName} has unexpected type of "${kindOf(inputState)}". Expected argument to be an object with the following keys: "${reducerKeys.join('", "')}"`;
6095
- }
6096
- const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);
6097
- unexpectedKeys.forEach((key) => {
6098
- unexpectedKeyCache[key] = true;
6099
- });
6100
- if (action && action.type === actionTypes_default.REPLACE)
6101
- return;
6102
- if (unexpectedKeys.length > 0) {
6103
- return `Unexpected ${unexpectedKeys.length > 1 ? "keys" : "key"} "${unexpectedKeys.join('", "')}" found in ${argumentName}. Expected to find one of the known reducer keys instead: "${reducerKeys.join('", "')}". Unexpected keys will be ignored.`;
6013
+ // src/utils/plugins.ts
6014
+ var plugins = {};
6015
+ function getPlugin(pluginKey) {
6016
+ const plugin = plugins[pluginKey];
6017
+ if (!plugin) {
6018
+ die(0, pluginKey);
6104
6019
  }
6020
+ return plugin;
6105
6021
  }
6106
- function assertReducerShape(reducers) {
6107
- Object.keys(reducers).forEach((key) => {
6108
- const reducer = reducers[key];
6109
- const initialState = reducer(void 0, {
6110
- type: actionTypes_default.INIT
6111
- });
6112
- if (typeof initialState === "undefined") {
6113
- throw new Error( true ? formatProdErrorMessage(12) : 0);
6114
- }
6115
- if (typeof reducer(void 0, {
6116
- type: actionTypes_default.PROBE_UNKNOWN_ACTION()
6117
- }) === "undefined") {
6118
- throw new Error( true ? formatProdErrorMessage(13) : 0);
6119
- }
6120
- });
6121
- }
6122
- function combineReducers(reducers) {
6123
- const reducerKeys = Object.keys(reducers);
6124
- const finalReducers = {};
6125
- for (let i = 0; i < reducerKeys.length; i++) {
6126
- const key = reducerKeys[i];
6127
- if (false) // removed by dead control flow
6128
- {}
6129
- if (typeof reducers[key] === "function") {
6130
- finalReducers[key] = reducers[key];
6131
- }
6132
- }
6133
- const finalReducerKeys = Object.keys(finalReducers);
6134
- let unexpectedKeyCache;
6135
- if (false) // removed by dead control flow
6136
- {}
6137
- let shapeAssertionError;
6138
- try {
6139
- assertReducerShape(finalReducers);
6140
- } catch (e) {
6141
- shapeAssertionError = e;
6142
- }
6143
- return function combination(state = {}, action) {
6144
- if (shapeAssertionError) {
6145
- throw shapeAssertionError;
6146
- }
6147
- if (false) // removed by dead control flow
6148
- {}
6149
- let hasChanged = false;
6150
- const nextState = {};
6151
- for (let i = 0; i < finalReducerKeys.length; i++) {
6152
- const key = finalReducerKeys[i];
6153
- const reducer = finalReducers[key];
6154
- const previousStateForKey = state[key];
6155
- const nextStateForKey = reducer(previousStateForKey, action);
6156
- if (typeof nextStateForKey === "undefined") {
6157
- const actionType = action && action.type;
6158
- throw new Error( true ? formatProdErrorMessage(14) : 0);
6159
- }
6160
- nextState[key] = nextStateForKey;
6161
- hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
6162
- }
6163
- hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
6164
- return hasChanged ? nextState : state;
6165
- };
6022
+ function loadPlugin(pluginKey, implementation) {
6023
+ if (!plugins[pluginKey])
6024
+ plugins[pluginKey] = implementation;
6166
6025
  }
6167
6026
 
6168
- // src/bindActionCreators.ts
6169
- function bindActionCreator(actionCreator, dispatch) {
6170
- return function(...args) {
6171
- return dispatch(actionCreator.apply(this, args));
6027
+ // src/core/scope.ts
6028
+ var currentScope;
6029
+ function getCurrentScope() {
6030
+ return currentScope;
6031
+ }
6032
+ function createScope(parent_, immer_) {
6033
+ return {
6034
+ drafts_: [],
6035
+ parent_,
6036
+ immer_,
6037
+ // Whenever the modified draft contains a draft from another scope, we
6038
+ // need to prevent auto-freezing so the unowned draft can be finalized.
6039
+ canAutoFreeze_: true,
6040
+ unfinalizedDrafts_: 0
6172
6041
  };
6173
6042
  }
6174
- function bindActionCreators(actionCreators, dispatch) {
6175
- if (typeof actionCreators === "function") {
6176
- return bindActionCreator(actionCreators, dispatch);
6177
- }
6178
- if (typeof actionCreators !== "object" || actionCreators === null) {
6179
- throw new Error( true ? formatProdErrorMessage(16) : 0);
6180
- }
6181
- const boundActionCreators = {};
6182
- for (const key in actionCreators) {
6183
- const actionCreator = actionCreators[key];
6184
- if (typeof actionCreator === "function") {
6185
- boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
6186
- }
6043
+ function usePatchesInScope(scope, patchListener) {
6044
+ if (patchListener) {
6045
+ getPlugin("Patches");
6046
+ scope.patches_ = [];
6047
+ scope.inversePatches_ = [];
6048
+ scope.patchListener_ = patchListener;
6187
6049
  }
6188
- return boundActionCreators;
6189
6050
  }
6190
-
6191
- // src/compose.ts
6192
- function compose(...funcs) {
6193
- if (funcs.length === 0) {
6194
- return (arg) => arg;
6195
- }
6196
- if (funcs.length === 1) {
6197
- return funcs[0];
6051
+ function revokeScope(scope) {
6052
+ leaveScope(scope);
6053
+ scope.drafts_.forEach(revokeDraft);
6054
+ scope.drafts_ = null;
6055
+ }
6056
+ function leaveScope(scope) {
6057
+ if (scope === currentScope) {
6058
+ currentScope = scope.parent_;
6198
6059
  }
6199
- return funcs.reduce((a, b) => (...args) => a(b(...args)));
6200
6060
  }
6201
-
6202
- // src/applyMiddleware.ts
6203
- function applyMiddleware(...middlewares) {
6204
- return (createStore2) => (reducer, preloadedState) => {
6205
- const store = createStore2(reducer, preloadedState);
6206
- let dispatch = () => {
6207
- throw new Error( true ? formatProdErrorMessage(15) : 0);
6208
- };
6209
- const middlewareAPI = {
6210
- getState: store.getState,
6211
- dispatch: (action, ...args) => dispatch(action, ...args)
6212
- };
6213
- const chain = middlewares.map((middleware) => middleware(middlewareAPI));
6214
- dispatch = compose(...chain)(store.dispatch);
6215
- return {
6216
- ...store,
6217
- dispatch
6218
- };
6219
- };
6061
+ function enterScope(immer2) {
6062
+ return currentScope = createScope(currentScope, immer2);
6220
6063
  }
6221
-
6222
- // src/utils/isAction.ts
6223
- function redux_isAction(action) {
6224
- return redux_isPlainObject(action) && "type" in action && typeof action.type === "string";
6225
- }
6226
-
6227
- //# sourceMappingURL=redux.mjs.map
6228
- ;// ./node_modules/redux-thunk/dist/redux-thunk.mjs
6229
- // src/index.ts
6230
- function createThunkMiddleware(extraArgument) {
6231
- const middleware = ({ dispatch, getState }) => (next) => (action) => {
6232
- if (typeof action === "function") {
6233
- return action(dispatch, getState, extraArgument);
6234
- }
6235
- return next(action);
6236
- };
6237
- return middleware;
6238
- }
6239
- var redux_thunk_thunk = createThunkMiddleware();
6240
- var withExtraArgument = createThunkMiddleware;
6241
-
6242
-
6243
- ;// ./node_modules/immer/dist/immer.mjs
6244
- // src/utils/env.ts
6245
- var NOTHING = Symbol.for("immer-nothing");
6246
- var DRAFTABLE = Symbol.for("immer-draftable");
6247
- var DRAFT_STATE = Symbol.for("immer-state");
6248
-
6249
- // src/utils/errors.ts
6250
- var errors = false ? 0 : [];
6251
- function die(error, ...args) {
6252
- if (false) // removed by dead control flow
6253
- {}
6254
- throw new Error(
6255
- `[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`
6256
- );
6257
- }
6258
-
6259
- // src/utils/common.ts
6260
- var getPrototypeOf = Object.getPrototypeOf;
6261
- function immer_isDraft(value) {
6262
- return !!value && !!value[DRAFT_STATE];
6263
- }
6264
- function isDraftable(value) {
6265
- if (!value)
6266
- return false;
6267
- return immer_isPlainObject(value) || Array.isArray(value) || !!value[DRAFTABLE] || !!value.constructor?.[DRAFTABLE] || isMap(value) || isSet(value);
6268
- }
6269
- var objectCtorString = Object.prototype.constructor.toString();
6270
- function immer_isPlainObject(value) {
6271
- if (!value || typeof value !== "object")
6272
- return false;
6273
- const proto = getPrototypeOf(value);
6274
- if (proto === null) {
6275
- return true;
6276
- }
6277
- const Ctor = Object.hasOwnProperty.call(proto, "constructor") && proto.constructor;
6278
- if (Ctor === Object)
6279
- return true;
6280
- return typeof Ctor == "function" && Function.toString.call(Ctor) === objectCtorString;
6281
- }
6282
- function original(value) {
6283
- if (!immer_isDraft(value))
6284
- die(15, value);
6285
- return value[DRAFT_STATE].base_;
6286
- }
6287
- function each(obj, iter) {
6288
- if (getArchtype(obj) === 0 /* Object */) {
6289
- Reflect.ownKeys(obj).forEach((key) => {
6290
- iter(key, obj[key], obj);
6291
- });
6292
- } else {
6293
- obj.forEach((entry, index) => iter(index, entry, obj));
6294
- }
6295
- }
6296
- function getArchtype(thing) {
6297
- const state = thing[DRAFT_STATE];
6298
- return state ? state.type_ : Array.isArray(thing) ? 1 /* Array */ : isMap(thing) ? 2 /* Map */ : isSet(thing) ? 3 /* Set */ : 0 /* Object */;
6299
- }
6300
- function has(thing, prop) {
6301
- return getArchtype(thing) === 2 /* Map */ ? thing.has(prop) : Object.prototype.hasOwnProperty.call(thing, prop);
6302
- }
6303
- function get(thing, prop) {
6304
- return getArchtype(thing) === 2 /* Map */ ? thing.get(prop) : thing[prop];
6305
- }
6306
- function set(thing, propOrOldValue, value) {
6307
- const t = getArchtype(thing);
6308
- if (t === 2 /* Map */)
6309
- thing.set(propOrOldValue, value);
6310
- else if (t === 3 /* Set */) {
6311
- thing.add(value);
6312
- } else
6313
- thing[propOrOldValue] = value;
6314
- }
6315
- function is(x, y) {
6316
- if (x === y) {
6317
- return x !== 0 || 1 / x === 1 / y;
6318
- } else {
6319
- return x !== x && y !== y;
6320
- }
6321
- }
6322
- function isMap(target) {
6323
- return target instanceof Map;
6324
- }
6325
- function isSet(target) {
6326
- return target instanceof Set;
6327
- }
6328
- function latest(state) {
6329
- return state.copy_ || state.base_;
6330
- }
6331
- function shallowCopy(base, strict) {
6332
- if (isMap(base)) {
6333
- return new Map(base);
6334
- }
6335
- if (isSet(base)) {
6336
- return new Set(base);
6337
- }
6338
- if (Array.isArray(base))
6339
- return Array.prototype.slice.call(base);
6340
- const isPlain = immer_isPlainObject(base);
6341
- if (strict === true || strict === "class_only" && !isPlain) {
6342
- const descriptors = Object.getOwnPropertyDescriptors(base);
6343
- delete descriptors[DRAFT_STATE];
6344
- let keys = Reflect.ownKeys(descriptors);
6345
- for (let i = 0; i < keys.length; i++) {
6346
- const key = keys[i];
6347
- const desc = descriptors[key];
6348
- if (desc.writable === false) {
6349
- desc.writable = true;
6350
- desc.configurable = true;
6351
- }
6352
- if (desc.get || desc.set)
6353
- descriptors[key] = {
6354
- configurable: true,
6355
- writable: true,
6356
- // could live with !!desc.set as well here...
6357
- enumerable: desc.enumerable,
6358
- value: base[key]
6359
- };
6360
- }
6361
- return Object.create(getPrototypeOf(base), descriptors);
6362
- } else {
6363
- const proto = getPrototypeOf(base);
6364
- if (proto !== null && isPlain) {
6365
- return { ...base };
6366
- }
6367
- const obj = Object.create(proto);
6368
- return Object.assign(obj, base);
6369
- }
6370
- }
6371
- function freeze(obj, deep = false) {
6372
- if (isFrozen(obj) || immer_isDraft(obj) || !isDraftable(obj))
6373
- return obj;
6374
- if (getArchtype(obj) > 1) {
6375
- Object.defineProperties(obj, {
6376
- set: { value: dontMutateFrozenCollections },
6377
- add: { value: dontMutateFrozenCollections },
6378
- clear: { value: dontMutateFrozenCollections },
6379
- delete: { value: dontMutateFrozenCollections }
6380
- });
6381
- }
6382
- Object.freeze(obj);
6383
- if (deep)
6384
- Object.values(obj).forEach((value) => freeze(value, true));
6385
- return obj;
6386
- }
6387
- function dontMutateFrozenCollections() {
6388
- die(2);
6389
- }
6390
- function isFrozen(obj) {
6391
- return Object.isFrozen(obj);
6392
- }
6393
-
6394
- // src/utils/plugins.ts
6395
- var plugins = {};
6396
- function getPlugin(pluginKey) {
6397
- const plugin = plugins[pluginKey];
6398
- if (!plugin) {
6399
- die(0, pluginKey);
6400
- }
6401
- return plugin;
6402
- }
6403
- function loadPlugin(pluginKey, implementation) {
6404
- if (!plugins[pluginKey])
6405
- plugins[pluginKey] = implementation;
6406
- }
6407
-
6408
- // src/core/scope.ts
6409
- var currentScope;
6410
- function getCurrentScope() {
6411
- return currentScope;
6412
- }
6413
- function createScope(parent_, immer_) {
6414
- return {
6415
- drafts_: [],
6416
- parent_,
6417
- immer_,
6418
- // Whenever the modified draft contains a draft from another scope, we
6419
- // need to prevent auto-freezing so the unowned draft can be finalized.
6420
- canAutoFreeze_: true,
6421
- unfinalizedDrafts_: 0
6422
- };
6423
- }
6424
- function usePatchesInScope(scope, patchListener) {
6425
- if (patchListener) {
6426
- getPlugin("Patches");
6427
- scope.patches_ = [];
6428
- scope.inversePatches_ = [];
6429
- scope.patchListener_ = patchListener;
6430
- }
6431
- }
6432
- function revokeScope(scope) {
6433
- leaveScope(scope);
6434
- scope.drafts_.forEach(revokeDraft);
6435
- scope.drafts_ = null;
6436
- }
6437
- function leaveScope(scope) {
6438
- if (scope === currentScope) {
6439
- currentScope = scope.parent_;
6440
- }
6441
- }
6442
- function enterScope(immer2) {
6443
- return currentScope = createScope(currentScope, immer2);
6444
- }
6445
- function revokeDraft(draft) {
6446
- const state = draft[DRAFT_STATE];
6447
- if (state.type_ === 0 /* Object */ || state.type_ === 1 /* Array */)
6448
- state.revoke_();
6449
- else
6450
- state.revoked_ = true;
6064
+ function revokeDraft(draft) {
6065
+ const state = draft[DRAFT_STATE];
6066
+ if (state.type_ === 0 /* Object */ || state.type_ === 1 /* Array */)
6067
+ state.revoke_();
6068
+ else
6069
+ state.revoked_ = true;
6451
6070
  }
6452
6071
 
6453
6072
  // src/core/finalize.ts
@@ -6485,11 +6104,13 @@ function processResult(result, scope) {
6485
6104
  function finalize(rootScope, value, path) {
6486
6105
  if (isFrozen(value))
6487
6106
  return value;
6107
+ const useStrictIteration = rootScope.immer_.shouldUseStrictIteration();
6488
6108
  const state = value[DRAFT_STATE];
6489
6109
  if (!state) {
6490
6110
  each(
6491
6111
  value,
6492
- (key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path)
6112
+ (key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path),
6113
+ useStrictIteration
6493
6114
  );
6494
6115
  return value;
6495
6116
  }
@@ -6512,7 +6133,16 @@ function finalize(rootScope, value, path) {
6512
6133
  }
6513
6134
  each(
6514
6135
  resultEach,
6515
- (key, childValue) => finalizeProperty(rootScope, state, result, key, childValue, path, isSet2)
6136
+ (key, childValue) => finalizeProperty(
6137
+ rootScope,
6138
+ state,
6139
+ result,
6140
+ key,
6141
+ childValue,
6142
+ path,
6143
+ isSet2
6144
+ ),
6145
+ useStrictIteration
6516
6146
  );
6517
6147
  maybeFreeze(rootScope, result, false);
6518
6148
  if (path && rootScope.patches_) {
@@ -6527,6 +6157,16 @@ function finalize(rootScope, value, path) {
6527
6157
  return state.copy_;
6528
6158
  }
6529
6159
  function finalizeProperty(rootScope, parentState, targetObject, prop, childValue, rootPath, targetIsSet) {
6160
+ if (childValue == null) {
6161
+ return;
6162
+ }
6163
+ if (typeof childValue !== "object" && !targetIsSet) {
6164
+ return;
6165
+ }
6166
+ const childIsFrozen = isFrozen(childValue);
6167
+ if (childIsFrozen && !targetIsSet) {
6168
+ return;
6169
+ }
6530
6170
  if (false)
6531
6171
  // removed by dead control flow
6532
6172
  {}
@@ -6542,10 +6182,13 @@ function finalizeProperty(rootScope, parentState, targetObject, prop, childValue
6542
6182
  } else if (targetIsSet) {
6543
6183
  targetObject.add(childValue);
6544
6184
  }
6545
- if (isDraftable(childValue) && !isFrozen(childValue)) {
6185
+ if (isDraftable(childValue) && !childIsFrozen) {
6546
6186
  if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {
6547
6187
  return;
6548
6188
  }
6189
+ if (parentState && parentState.base_ && parentState.base_[prop] === childValue && childIsFrozen) {
6190
+ return;
6191
+ }
6549
6192
  finalize(rootScope, childValue);
6550
6193
  if ((!parentState || !parentState.scope_.parent_) && typeof prop !== "symbol" && (isMap(targetObject) ? targetObject.has(prop) : Object.prototype.propertyIsEnumerable.call(targetObject, prop)))
6551
6194
  maybeFreeze(rootScope, childValue);
@@ -6748,6 +6391,7 @@ var Immer2 = class {
6748
6391
  constructor(config) {
6749
6392
  this.autoFreeze_ = true;
6750
6393
  this.useStrictShallowCopy_ = false;
6394
+ this.useStrictIteration_ = true;
6751
6395
  /**
6752
6396
  * The `produce` function takes a value and a "recipe function" (whose
6753
6397
  * return value often depends on the base state). The recipe function is
@@ -6829,6 +6473,8 @@ var Immer2 = class {
6829
6473
  this.setAutoFreeze(config.autoFreeze);
6830
6474
  if (typeof config?.useStrictShallowCopy === "boolean")
6831
6475
  this.setUseStrictShallowCopy(config.useStrictShallowCopy);
6476
+ if (typeof config?.useStrictIteration === "boolean")
6477
+ this.setUseStrictIteration(config.useStrictIteration);
6832
6478
  }
6833
6479
  createDraft(base) {
6834
6480
  if (!isDraftable(base))
@@ -6865,6 +6511,18 @@ var Immer2 = class {
6865
6511
  setUseStrictShallowCopy(value) {
6866
6512
  this.useStrictShallowCopy_ = value;
6867
6513
  }
6514
+ /**
6515
+ * Pass false to use faster iteration that skips non-enumerable properties
6516
+ * but still handles symbols for compatibility.
6517
+ *
6518
+ * By default, strict iteration is enabled (includes all own properties).
6519
+ */
6520
+ setUseStrictIteration(value) {
6521
+ this.useStrictIteration_ = value;
6522
+ }
6523
+ shouldUseStrictIteration() {
6524
+ return this.useStrictIteration_;
6525
+ }
6868
6526
  applyPatches(base, patches) {
6869
6527
  let i;
6870
6528
  for (i = patches.length - 1; i >= 0; i--) {
@@ -6905,17 +6563,23 @@ function currentImpl(value) {
6905
6563
  return value;
6906
6564
  const state = value[DRAFT_STATE];
6907
6565
  let copy;
6566
+ let strict = true;
6908
6567
  if (state) {
6909
6568
  if (!state.modified_)
6910
6569
  return state.base_;
6911
6570
  state.finalized_ = true;
6912
6571
  copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);
6572
+ strict = state.scope_.immer_.shouldUseStrictIteration();
6913
6573
  } else {
6914
6574
  copy = shallowCopy(value, true);
6915
6575
  }
6916
- each(copy, (key, childValue) => {
6917
- set(copy, key, currentImpl(childValue));
6918
- });
6576
+ each(
6577
+ copy,
6578
+ (key, childValue) => {
6579
+ set(copy, key, currentImpl(childValue));
6580
+ },
6581
+ strict
6582
+ );
6919
6583
  if (state) {
6920
6584
  state.finalized_ = false;
6921
6585
  }
@@ -7353,81 +7017,484 @@ function enableMapSet() {
7353
7017
  prepareSetCopy(state);
7354
7018
  return state.copy_.values();
7355
7019
  }
7356
- entries() {
7357
- const state = this[DRAFT_STATE];
7358
- assertUnrevoked(state);
7359
- prepareSetCopy(state);
7360
- return state.copy_.entries();
7020
+ entries() {
7021
+ const state = this[DRAFT_STATE];
7022
+ assertUnrevoked(state);
7023
+ prepareSetCopy(state);
7024
+ return state.copy_.entries();
7025
+ }
7026
+ keys() {
7027
+ return this.values();
7028
+ }
7029
+ [(DRAFT_STATE, Symbol.iterator)]() {
7030
+ return this.values();
7031
+ }
7032
+ forEach(cb, thisArg) {
7033
+ const iterator = this.values();
7034
+ let result = iterator.next();
7035
+ while (!result.done) {
7036
+ cb.call(thisArg, result.value, result.value, this);
7037
+ result = iterator.next();
7038
+ }
7039
+ }
7040
+ }
7041
+ function proxySet_(target, parent) {
7042
+ return new DraftSet(target, parent);
7043
+ }
7044
+ function prepareSetCopy(state) {
7045
+ if (!state.copy_) {
7046
+ state.copy_ = /* @__PURE__ */ new Set();
7047
+ state.base_.forEach((value) => {
7048
+ if (isDraftable(value)) {
7049
+ const draft = createProxy(value, state);
7050
+ state.drafts_.set(value, draft);
7051
+ state.copy_.add(draft);
7052
+ } else {
7053
+ state.copy_.add(value);
7054
+ }
7055
+ });
7056
+ }
7057
+ }
7058
+ function assertUnrevoked(state) {
7059
+ if (state.revoked_)
7060
+ die(3, JSON.stringify(latest(state)));
7061
+ }
7062
+ loadPlugin("MapSet", { proxyMap_, proxySet_ });
7063
+ }
7064
+
7065
+ // src/immer.ts
7066
+ var immer = new Immer2();
7067
+ var immer_produce = immer.produce;
7068
+ var produceWithPatches = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.produceWithPatches.bind(
7069
+ immer
7070
+ )));
7071
+ var setAutoFreeze = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.setAutoFreeze.bind(immer)));
7072
+ var setUseStrictShallowCopy = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.setUseStrictShallowCopy.bind(
7073
+ immer
7074
+ )));
7075
+ var setUseStrictIteration = /* @__PURE__ */ immer.setUseStrictIteration.bind(
7076
+ immer
7077
+ );
7078
+ var applyPatches = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.applyPatches.bind(immer)));
7079
+ var createDraft = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.createDraft.bind(immer)));
7080
+ var finishDraft = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.finishDraft.bind(immer)));
7081
+ function castDraft(value) {
7082
+ return value;
7083
+ }
7084
+ function castImmutable(value) {
7085
+ return value;
7086
+ }
7087
+
7088
+ //# sourceMappingURL=immer.mjs.map
7089
+ ;// ./node_modules/redux/dist/redux.mjs
7090
+ // src/utils/formatProdErrorMessage.ts
7091
+ function formatProdErrorMessage(code) {
7092
+ return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;
7093
+ }
7094
+
7095
+ // src/utils/symbol-observable.ts
7096
+ var $$observable = /* @__PURE__ */ (() => typeof Symbol === "function" && Symbol.observable || "@@observable")();
7097
+ var symbol_observable_default = $$observable;
7098
+
7099
+ // src/utils/actionTypes.ts
7100
+ var randomString = () => Math.random().toString(36).substring(7).split("").join(".");
7101
+ var ActionTypes = {
7102
+ INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,
7103
+ REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,
7104
+ PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`
7105
+ };
7106
+ var actionTypes_default = ActionTypes;
7107
+
7108
+ // src/utils/isPlainObject.ts
7109
+ function redux_isPlainObject(obj) {
7110
+ if (typeof obj !== "object" || obj === null)
7111
+ return false;
7112
+ let proto = obj;
7113
+ while (Object.getPrototypeOf(proto) !== null) {
7114
+ proto = Object.getPrototypeOf(proto);
7115
+ }
7116
+ return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;
7117
+ }
7118
+
7119
+ // src/utils/kindOf.ts
7120
+ function miniKindOf(val) {
7121
+ if (val === void 0)
7122
+ return "undefined";
7123
+ if (val === null)
7124
+ return "null";
7125
+ const type = typeof val;
7126
+ switch (type) {
7127
+ case "boolean":
7128
+ case "string":
7129
+ case "number":
7130
+ case "symbol":
7131
+ case "function": {
7132
+ return type;
7133
+ }
7134
+ }
7135
+ if (Array.isArray(val))
7136
+ return "array";
7137
+ if (isDate(val))
7138
+ return "date";
7139
+ if (isError(val))
7140
+ return "error";
7141
+ const constructorName = ctorName(val);
7142
+ switch (constructorName) {
7143
+ case "Symbol":
7144
+ case "Promise":
7145
+ case "WeakMap":
7146
+ case "WeakSet":
7147
+ case "Map":
7148
+ case "Set":
7149
+ return constructorName;
7150
+ }
7151
+ return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, "");
7152
+ }
7153
+ function ctorName(val) {
7154
+ return typeof val.constructor === "function" ? val.constructor.name : null;
7155
+ }
7156
+ function isError(val) {
7157
+ return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
7158
+ }
7159
+ function isDate(val) {
7160
+ if (val instanceof Date)
7161
+ return true;
7162
+ return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
7163
+ }
7164
+ function kindOf(val) {
7165
+ let typeOfVal = typeof val;
7166
+ if (false) // removed by dead control flow
7167
+ {}
7168
+ return typeOfVal;
7169
+ }
7170
+
7171
+ // src/createStore.ts
7172
+ function createStore(reducer, preloadedState, enhancer) {
7173
+ if (typeof reducer !== "function") {
7174
+ throw new Error( true ? formatProdErrorMessage(2) : 0);
7175
+ }
7176
+ if (typeof preloadedState === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") {
7177
+ throw new Error( true ? formatProdErrorMessage(0) : 0);
7178
+ }
7179
+ if (typeof preloadedState === "function" && typeof enhancer === "undefined") {
7180
+ enhancer = preloadedState;
7181
+ preloadedState = void 0;
7182
+ }
7183
+ if (typeof enhancer !== "undefined") {
7184
+ if (typeof enhancer !== "function") {
7185
+ throw new Error( true ? formatProdErrorMessage(1) : 0);
7186
+ }
7187
+ return enhancer(createStore)(reducer, preloadedState);
7188
+ }
7189
+ let currentReducer = reducer;
7190
+ let currentState = preloadedState;
7191
+ let currentListeners = /* @__PURE__ */ new Map();
7192
+ let nextListeners = currentListeners;
7193
+ let listenerIdCounter = 0;
7194
+ let isDispatching = false;
7195
+ function ensureCanMutateNextListeners() {
7196
+ if (nextListeners === currentListeners) {
7197
+ nextListeners = /* @__PURE__ */ new Map();
7198
+ currentListeners.forEach((listener, key) => {
7199
+ nextListeners.set(key, listener);
7200
+ });
7201
+ }
7202
+ }
7203
+ function getState() {
7204
+ if (isDispatching) {
7205
+ throw new Error( true ? formatProdErrorMessage(3) : 0);
7206
+ }
7207
+ return currentState;
7208
+ }
7209
+ function subscribe(listener) {
7210
+ if (typeof listener !== "function") {
7211
+ throw new Error( true ? formatProdErrorMessage(4) : 0);
7212
+ }
7213
+ if (isDispatching) {
7214
+ throw new Error( true ? formatProdErrorMessage(5) : 0);
7215
+ }
7216
+ let isSubscribed = true;
7217
+ ensureCanMutateNextListeners();
7218
+ const listenerId = listenerIdCounter++;
7219
+ nextListeners.set(listenerId, listener);
7220
+ return function unsubscribe() {
7221
+ if (!isSubscribed) {
7222
+ return;
7223
+ }
7224
+ if (isDispatching) {
7225
+ throw new Error( true ? formatProdErrorMessage(6) : 0);
7226
+ }
7227
+ isSubscribed = false;
7228
+ ensureCanMutateNextListeners();
7229
+ nextListeners.delete(listenerId);
7230
+ currentListeners = null;
7231
+ };
7232
+ }
7233
+ function dispatch(action) {
7234
+ if (!redux_isPlainObject(action)) {
7235
+ throw new Error( true ? formatProdErrorMessage(7) : 0);
7236
+ }
7237
+ if (typeof action.type === "undefined") {
7238
+ throw new Error( true ? formatProdErrorMessage(8) : 0);
7239
+ }
7240
+ if (typeof action.type !== "string") {
7241
+ throw new Error( true ? formatProdErrorMessage(17) : 0);
7242
+ }
7243
+ if (isDispatching) {
7244
+ throw new Error( true ? formatProdErrorMessage(9) : 0);
7245
+ }
7246
+ try {
7247
+ isDispatching = true;
7248
+ currentState = currentReducer(currentState, action);
7249
+ } finally {
7250
+ isDispatching = false;
7251
+ }
7252
+ const listeners = currentListeners = nextListeners;
7253
+ listeners.forEach((listener) => {
7254
+ listener();
7255
+ });
7256
+ return action;
7257
+ }
7258
+ function replaceReducer(nextReducer) {
7259
+ if (typeof nextReducer !== "function") {
7260
+ throw new Error( true ? formatProdErrorMessage(10) : 0);
7261
+ }
7262
+ currentReducer = nextReducer;
7263
+ dispatch({
7264
+ type: actionTypes_default.REPLACE
7265
+ });
7266
+ }
7267
+ function observable() {
7268
+ const outerSubscribe = subscribe;
7269
+ return {
7270
+ /**
7271
+ * The minimal observable subscription method.
7272
+ * @param observer Any object that can be used as an observer.
7273
+ * The observer object should have a `next` method.
7274
+ * @returns An object with an `unsubscribe` method that can
7275
+ * be used to unsubscribe the observable from the store, and prevent further
7276
+ * emission of values from the observable.
7277
+ */
7278
+ subscribe(observer) {
7279
+ if (typeof observer !== "object" || observer === null) {
7280
+ throw new Error( true ? formatProdErrorMessage(11) : 0);
7281
+ }
7282
+ function observeState() {
7283
+ const observerAsObserver = observer;
7284
+ if (observerAsObserver.next) {
7285
+ observerAsObserver.next(getState());
7286
+ }
7287
+ }
7288
+ observeState();
7289
+ const unsubscribe = outerSubscribe(observeState);
7290
+ return {
7291
+ unsubscribe
7292
+ };
7293
+ },
7294
+ [symbol_observable_default]() {
7295
+ return this;
7296
+ }
7297
+ };
7298
+ }
7299
+ dispatch({
7300
+ type: actionTypes_default.INIT
7301
+ });
7302
+ const store = {
7303
+ dispatch,
7304
+ subscribe,
7305
+ getState,
7306
+ replaceReducer,
7307
+ [symbol_observable_default]: observable
7308
+ };
7309
+ return store;
7310
+ }
7311
+ function legacy_createStore(reducer, preloadedState, enhancer) {
7312
+ return createStore(reducer, preloadedState, enhancer);
7313
+ }
7314
+
7315
+ // src/utils/warning.ts
7316
+ function warning(message) {
7317
+ if (typeof console !== "undefined" && typeof console.error === "function") {
7318
+ console.error(message);
7319
+ }
7320
+ try {
7321
+ throw new Error(message);
7322
+ } catch (e) {
7323
+ }
7324
+ }
7325
+
7326
+ // src/combineReducers.ts
7327
+ function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
7328
+ const reducerKeys = Object.keys(reducers);
7329
+ const argumentName = action && action.type === actionTypes_default.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
7330
+ if (reducerKeys.length === 0) {
7331
+ return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";
7332
+ }
7333
+ if (!redux_isPlainObject(inputState)) {
7334
+ return `The ${argumentName} has unexpected type of "${kindOf(inputState)}". Expected argument to be an object with the following keys: "${reducerKeys.join('", "')}"`;
7335
+ }
7336
+ const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);
7337
+ unexpectedKeys.forEach((key) => {
7338
+ unexpectedKeyCache[key] = true;
7339
+ });
7340
+ if (action && action.type === actionTypes_default.REPLACE)
7341
+ return;
7342
+ if (unexpectedKeys.length > 0) {
7343
+ return `Unexpected ${unexpectedKeys.length > 1 ? "keys" : "key"} "${unexpectedKeys.join('", "')}" found in ${argumentName}. Expected to find one of the known reducer keys instead: "${reducerKeys.join('", "')}". Unexpected keys will be ignored.`;
7344
+ }
7345
+ }
7346
+ function assertReducerShape(reducers) {
7347
+ Object.keys(reducers).forEach((key) => {
7348
+ const reducer = reducers[key];
7349
+ const initialState = reducer(void 0, {
7350
+ type: actionTypes_default.INIT
7351
+ });
7352
+ if (typeof initialState === "undefined") {
7353
+ throw new Error( true ? formatProdErrorMessage(12) : 0);
7354
+ }
7355
+ if (typeof reducer(void 0, {
7356
+ type: actionTypes_default.PROBE_UNKNOWN_ACTION()
7357
+ }) === "undefined") {
7358
+ throw new Error( true ? formatProdErrorMessage(13) : 0);
7361
7359
  }
7362
- keys() {
7363
- return this.values();
7360
+ });
7361
+ }
7362
+ function combineReducers(reducers) {
7363
+ const reducerKeys = Object.keys(reducers);
7364
+ const finalReducers = {};
7365
+ for (let i = 0; i < reducerKeys.length; i++) {
7366
+ const key = reducerKeys[i];
7367
+ if (false) // removed by dead control flow
7368
+ {}
7369
+ if (typeof reducers[key] === "function") {
7370
+ finalReducers[key] = reducers[key];
7364
7371
  }
7365
- [(DRAFT_STATE, Symbol.iterator)]() {
7366
- return this.values();
7372
+ }
7373
+ const finalReducerKeys = Object.keys(finalReducers);
7374
+ let unexpectedKeyCache;
7375
+ if (false) // removed by dead control flow
7376
+ {}
7377
+ let shapeAssertionError;
7378
+ try {
7379
+ assertReducerShape(finalReducers);
7380
+ } catch (e) {
7381
+ shapeAssertionError = e;
7382
+ }
7383
+ return function combination(state = {}, action) {
7384
+ if (shapeAssertionError) {
7385
+ throw shapeAssertionError;
7367
7386
  }
7368
- forEach(cb, thisArg) {
7369
- const iterator = this.values();
7370
- let result = iterator.next();
7371
- while (!result.done) {
7372
- cb.call(thisArg, result.value, result.value, this);
7373
- result = iterator.next();
7387
+ if (false) // removed by dead control flow
7388
+ {}
7389
+ let hasChanged = false;
7390
+ const nextState = {};
7391
+ for (let i = 0; i < finalReducerKeys.length; i++) {
7392
+ const key = finalReducerKeys[i];
7393
+ const reducer = finalReducers[key];
7394
+ const previousStateForKey = state[key];
7395
+ const nextStateForKey = reducer(previousStateForKey, action);
7396
+ if (typeof nextStateForKey === "undefined") {
7397
+ const actionType = action && action.type;
7398
+ throw new Error( true ? formatProdErrorMessage(14) : 0);
7374
7399
  }
7400
+ nextState[key] = nextStateForKey;
7401
+ hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
7375
7402
  }
7403
+ hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
7404
+ return hasChanged ? nextState : state;
7405
+ };
7406
+ }
7407
+
7408
+ // src/bindActionCreators.ts
7409
+ function bindActionCreator(actionCreator, dispatch) {
7410
+ return function(...args) {
7411
+ return dispatch(actionCreator.apply(this, args));
7412
+ };
7413
+ }
7414
+ function bindActionCreators(actionCreators, dispatch) {
7415
+ if (typeof actionCreators === "function") {
7416
+ return bindActionCreator(actionCreators, dispatch);
7376
7417
  }
7377
- function proxySet_(target, parent) {
7378
- return new DraftSet(target, parent);
7418
+ if (typeof actionCreators !== "object" || actionCreators === null) {
7419
+ throw new Error( true ? formatProdErrorMessage(16) : 0);
7379
7420
  }
7380
- function prepareSetCopy(state) {
7381
- if (!state.copy_) {
7382
- state.copy_ = /* @__PURE__ */ new Set();
7383
- state.base_.forEach((value) => {
7384
- if (isDraftable(value)) {
7385
- const draft = createProxy(value, state);
7386
- state.drafts_.set(value, draft);
7387
- state.copy_.add(draft);
7388
- } else {
7389
- state.copy_.add(value);
7390
- }
7391
- });
7421
+ const boundActionCreators = {};
7422
+ for (const key in actionCreators) {
7423
+ const actionCreator = actionCreators[key];
7424
+ if (typeof actionCreator === "function") {
7425
+ boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
7392
7426
  }
7393
7427
  }
7394
- function assertUnrevoked(state) {
7395
- if (state.revoked_)
7396
- die(3, JSON.stringify(latest(state)));
7428
+ return boundActionCreators;
7429
+ }
7430
+
7431
+ // src/compose.ts
7432
+ function redux_compose(...funcs) {
7433
+ if (funcs.length === 0) {
7434
+ return (arg) => arg;
7397
7435
  }
7398
- loadPlugin("MapSet", { proxyMap_, proxySet_ });
7436
+ if (funcs.length === 1) {
7437
+ return funcs[0];
7438
+ }
7439
+ return funcs.reduce((a, b) => (...args) => a(b(...args)));
7399
7440
  }
7400
7441
 
7401
- // src/immer.ts
7402
- var immer = new Immer2();
7403
- var produce = immer.produce;
7404
- var produceWithPatches = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.produceWithPatches.bind(
7405
- immer
7406
- )));
7407
- var setAutoFreeze = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.setAutoFreeze.bind(immer)));
7408
- var setUseStrictShallowCopy = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.setUseStrictShallowCopy.bind(
7409
- immer
7410
- )));
7411
- var applyPatches = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.applyPatches.bind(immer)));
7412
- var createDraft = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.createDraft.bind(immer)));
7413
- var finishDraft = /* @__PURE__ */ (/* unused pure expression or super */ null && (immer.finishDraft.bind(immer)));
7414
- function castDraft(value) {
7415
- return value;
7442
+ // src/applyMiddleware.ts
7443
+ function applyMiddleware(...middlewares) {
7444
+ return (createStore2) => (reducer, preloadedState) => {
7445
+ const store = createStore2(reducer, preloadedState);
7446
+ let dispatch = () => {
7447
+ throw new Error( true ? formatProdErrorMessage(15) : 0);
7448
+ };
7449
+ const middlewareAPI = {
7450
+ getState: store.getState,
7451
+ dispatch: (action, ...args) => dispatch(action, ...args)
7452
+ };
7453
+ const chain = middlewares.map((middleware) => middleware(middlewareAPI));
7454
+ dispatch = redux_compose(...chain)(store.dispatch);
7455
+ return {
7456
+ ...store,
7457
+ dispatch
7458
+ };
7459
+ };
7416
7460
  }
7417
- function castImmutable(value) {
7418
- return value;
7461
+
7462
+ // src/utils/isAction.ts
7463
+ function redux_isAction(action) {
7464
+ return redux_isPlainObject(action) && "type" in action && typeof action.type === "string";
7419
7465
  }
7420
7466
 
7421
- //# sourceMappingURL=immer.mjs.map
7467
+ //# sourceMappingURL=redux.mjs.map
7468
+ ;// ./node_modules/redux-thunk/dist/redux-thunk.mjs
7469
+ // src/index.ts
7470
+ function createThunkMiddleware(extraArgument) {
7471
+ const middleware = ({ dispatch, getState }) => (next) => (action) => {
7472
+ if (typeof action === "function") {
7473
+ return action(dispatch, getState, extraArgument);
7474
+ }
7475
+ return next(action);
7476
+ };
7477
+ return middleware;
7478
+ }
7479
+ var redux_thunk_thunk = createThunkMiddleware();
7480
+ var withExtraArgument = createThunkMiddleware;
7481
+
7482
+
7422
7483
  ;// ./node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.mjs
7423
7484
  // src/index.ts
7424
7485
 
7425
7486
 
7426
7487
 
7488
+ // src/immerImports.ts
7427
7489
 
7428
- // src/createDraftSafeSelector.ts
7490
+
7491
+ // src/index.ts
7429
7492
 
7430
7493
 
7494
+ // src/reselectImports.ts
7495
+
7496
+
7497
+ // src/createDraftSafeSelector.ts
7431
7498
  var createDraftSafeSelectorCreator = (...args) => {
7432
7499
  const createSelector2 = createSelectorCreator(...args);
7433
7500
  const createDraftSafeSelector2 = Object.assign((...args2) => {
@@ -7442,15 +7509,14 @@ var createDraftSafeSelectorCreator = (...args) => {
7442
7509
  };
7443
7510
  var createDraftSafeSelector = /* @__PURE__ */ (/* unused pure expression or super */ null && (createDraftSafeSelectorCreator(weakMapMemoize)));
7444
7511
 
7445
- // src/configureStore.ts
7512
+ // src/reduxImports.ts
7446
7513
 
7447
7514
 
7448
7515
  // src/devtoolsExtension.ts
7449
-
7450
7516
  var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {
7451
7517
  if (arguments.length === 0) return void 0;
7452
- if (typeof arguments[0] === "object") return compose;
7453
- return compose.apply(null, arguments);
7518
+ if (typeof arguments[0] === "object") return redux_compose;
7519
+ return redux_compose.apply(null, arguments);
7454
7520
  };
7455
7521
  var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function() {
7456
7522
  return function(noop3) {
@@ -7461,9 +7527,6 @@ var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_
7461
7527
  // src/getDefaultMiddleware.ts
7462
7528
 
7463
7529
 
7464
- // src/createAction.ts
7465
-
7466
-
7467
7530
  // src/tsHelpers.ts
7468
7531
  var hasMatchFunction = (v) => {
7469
7532
  return v && typeof v.match === "function";
@@ -7527,7 +7590,6 @@ function createActionCreatorInvariantMiddleware(options = {}) {
7527
7590
  }
7528
7591
 
7529
7592
  // src/utils.ts
7530
-
7531
7593
  function getTimeMeasureUtils(maxDelay, fnName) {
7532
7594
  let elapsed = 0;
7533
7595
  return {
@@ -7568,7 +7630,7 @@ var Tuple = class _Tuple extends Array {
7568
7630
  }
7569
7631
  };
7570
7632
  function freezeDraftable(val) {
7571
- return isDraftable(val) ? produce(val, () => {
7633
+ return isDraftable(val) ? immer_produce(val, () => {
7572
7634
  }) : val;
7573
7635
  }
7574
7636
  function getOrInsertComputed(map, key, compute) {
@@ -7657,7 +7719,6 @@ function createImmutableStateInvariantMiddleware(options = {}) {
7657
7719
  }
7658
7720
 
7659
7721
  // src/serializableStateInvariantMiddleware.ts
7660
-
7661
7722
  function isPlain(val) {
7662
7723
  const type = typeof val;
7663
7724
  return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject(val);
@@ -7853,7 +7914,7 @@ function configureStore(options) {
7853
7914
  {}
7854
7915
  if (false) // removed by dead control flow
7855
7916
  {}
7856
- let finalCompose = compose;
7917
+ let finalCompose = redux_compose;
7857
7918
  if (devTools) {
7858
7919
  finalCompose = composeWithDevTools({
7859
7920
  // Enable capture of stack traces for dispatched Redux actions
@@ -7876,9 +7937,6 @@ function configureStore(options) {
7876
7937
  return createStore(rootReducer, preloadedState, composedEnhancer);
7877
7938
  }
7878
7939
 
7879
- // src/createReducer.ts
7880
-
7881
-
7882
7940
  // src/mapBuilders.ts
7883
7941
  function executeReducerBuilderCallback(builderCallback) {
7884
7942
  const actionsMap = {};
@@ -7931,6 +7989,7 @@ function executeReducerBuilderCallback(builderCallback) {
7931
7989
  }
7932
7990
 
7933
7991
  // src/createReducer.ts
7992
+ setUseStrictIteration(false);
7934
7993
  function isStateFunction(x) {
7935
7994
  return typeof x === "function";
7936
7995
  }
@@ -7973,7 +8032,7 @@ function createReducer(initialState, mapOrBuilderCallback) {
7973
8032
  }
7974
8033
  return result;
7975
8034
  } else {
7976
- return produce(previousState, (draft) => {
8035
+ return immer_produce(previousState, (draft) => {
7977
8036
  return caseReducer(draft, action);
7978
8037
  });
7979
8038
  }
@@ -8595,8 +8654,7 @@ function createSelectorsFactory() {
8595
8654
  }
8596
8655
 
8597
8656
  // src/entities/state_adapter.ts
8598
-
8599
- var isDraftTyped = (/* unused pure expression or super */ null && (isDraft3));
8657
+ var isDraftTyped = (/* unused pure expression or super */ null && (isDraft));
8600
8658
  function createSingleArgumentStateOperator(mutator) {
8601
8659
  const operator = createStateOperator((_, state) => mutator(state));
8602
8660
  return function operation(state) {
@@ -8619,12 +8677,11 @@ function createStateOperator(mutator) {
8619
8677
  runMutator(state);
8620
8678
  return state;
8621
8679
  }
8622
- return createNextState3(state, runMutator);
8680
+ return produce(state, runMutator);
8623
8681
  };
8624
8682
  }
8625
8683
 
8626
8684
  // src/entities/utils.ts
8627
-
8628
8685
  function selectIdValue(entity, selectId) {
8629
8686
  const key = selectId(entity);
8630
8687
  if (false) // removed by dead control flow
@@ -8638,7 +8695,7 @@ function ensureEntitiesArray(entities) {
8638
8695
  return entities;
8639
8696
  }
8640
8697
  function getCurrent(value) {
8641
- return isDraft4(value) ? current2(value) : value;
8698
+ return isDraft(value) ? current(value) : value;
8642
8699
  }
8643
8700
  function splitAddedUpdatedEntities(newEntities, selectId, state) {
8644
8701
  newEntities = ensureEntitiesArray(newEntities);
@@ -8820,7 +8877,13 @@ function createSortedStateAdapter(selectId, comparer) {
8820
8877
  function addManyMutably(newEntities, state, existingIds) {
8821
8878
  newEntities = ensureEntitiesArray(newEntities);
8822
8879
  const existingKeys = new Set(existingIds ?? getCurrent(state.ids));
8823
- const models = newEntities.filter((model) => !existingKeys.has(selectIdValue(model, selectId)));
8880
+ const addedKeys = /* @__PURE__ */ new Set();
8881
+ const models = newEntities.filter((model) => {
8882
+ const modelId = selectIdValue(model, selectId);
8883
+ const notAdded = !addedKeys.has(modelId);
8884
+ if (notAdded) addedKeys.add(modelId);
8885
+ return !existingKeys.has(modelId) && notAdded;
8886
+ });
8824
8887
  if (models.length !== 0) {
8825
8888
  mergeFunction(state, models);
8826
8889
  }
@@ -8829,11 +8892,15 @@ function createSortedStateAdapter(selectId, comparer) {
8829
8892
  return setManyMutably([entity], state);
8830
8893
  }
8831
8894
  function setManyMutably(newEntities, state) {
8895
+ let deduplicatedEntities = {};
8832
8896
  newEntities = ensureEntitiesArray(newEntities);
8833
8897
  if (newEntities.length !== 0) {
8834
8898
  for (const item of newEntities) {
8835
- delete state.entities[selectId(item)];
8899
+ const entityId = selectId(item);
8900
+ deduplicatedEntities[entityId] = item;
8901
+ delete state.entities[entityId];
8836
8902
  }
8903
+ newEntities = ensureEntitiesArray(deduplicatedEntities);
8837
8904
  mergeFunction(state, newEntities);
8838
8905
  }
8839
8906
  }
@@ -8963,9 +9030,6 @@ function createEntityAdapter(options = {}) {
8963
9030
  };
8964
9031
  }
8965
9032
 
8966
- // src/listenerMiddleware/index.ts
8967
-
8968
-
8969
9033
  // src/listenerMiddleware/exceptions.ts
8970
9034
  var task = "task";
8971
9035
  var listener = "listener";
@@ -9202,9 +9266,11 @@ var cancelActiveListeners = (entry) => {
9202
9266
  abortControllerWithReason(controller, listenerCancelled);
9203
9267
  });
9204
9268
  };
9205
- var createClearListenerMiddleware = (listenerMap) => {
9269
+ var createClearListenerMiddleware = (listenerMap, executingListeners) => {
9206
9270
  return () => {
9207
- listenerMap.forEach(cancelActiveListeners);
9271
+ for (const listener2 of executingListeners.keys()) {
9272
+ cancelActiveListeners(listener2);
9273
+ }
9208
9274
  listenerMap.clear();
9209
9275
  };
9210
9276
  };
@@ -9229,6 +9295,19 @@ var defaultErrorHandler = (...args) => {
9229
9295
  };
9230
9296
  var createListenerMiddleware = (middlewareOptions = {}) => {
9231
9297
  const listenerMap = /* @__PURE__ */ new Map();
9298
+ const executingListeners = /* @__PURE__ */ new Map();
9299
+ const trackExecutingListener = (entry) => {
9300
+ const count = executingListeners.get(entry) ?? 0;
9301
+ executingListeners.set(entry, count + 1);
9302
+ };
9303
+ const untrackExecutingListener = (entry) => {
9304
+ const count = executingListeners.get(entry) ?? 1;
9305
+ if (count === 1) {
9306
+ executingListeners.delete(entry);
9307
+ } else {
9308
+ executingListeners.set(entry, count - 1);
9309
+ }
9310
+ };
9232
9311
  const {
9233
9312
  extra,
9234
9313
  onError = defaultErrorHandler
@@ -9270,6 +9349,7 @@ var createListenerMiddleware = (middlewareOptions = {}) => {
9270
9349
  const autoJoinPromises = [];
9271
9350
  try {
9272
9351
  entry.pending.add(internalTaskController);
9352
+ trackExecutingListener(entry);
9273
9353
  await Promise.resolve(entry.effect(
9274
9354
  action,
9275
9355
  // Use assign() rather than ... to avoid extra helper functions added to bundle
@@ -9312,12 +9392,13 @@ var createListenerMiddleware = (middlewareOptions = {}) => {
9312
9392
  } finally {
9313
9393
  await Promise.all(autoJoinPromises);
9314
9394
  abortControllerWithReason(internalTaskController, listenerCompleted);
9395
+ untrackExecutingListener(entry);
9315
9396
  entry.pending.delete(internalTaskController);
9316
9397
  }
9317
9398
  };
9318
- const clearListenerMiddleware = createClearListenerMiddleware(listenerMap);
9399
+ const clearListenerMiddleware = createClearListenerMiddleware(listenerMap, executingListeners);
9319
9400
  const middleware = (api) => (next) => (action) => {
9320
- if (!isAction3(action)) {
9401
+ if (!isAction(action)) {
9321
9402
  return next(action);
9322
9403
  }
9323
9404
  if (addListener.match(action)) {
@@ -9373,7 +9454,6 @@ var createListenerMiddleware = (middlewareOptions = {}) => {
9373
9454
  };
9374
9455
 
9375
9456
  // src/dynamicMiddleware/index.ts
9376
-
9377
9457
  var createMiddlewareEntry = (middleware) => ({
9378
9458
  middleware,
9379
9459
  applied: /* @__PURE__ */ new Map()
@@ -9399,7 +9479,7 @@ var createDynamicMiddleware = () => {
9399
9479
  });
9400
9480
  const getFinalMiddleware = (api) => {
9401
9481
  const appliedMiddleware = Array.from(middlewareMap.values()).map((entry) => getOrInsertComputed(entry.applied, api, entry.middleware));
9402
- return compose3(...appliedMiddleware);
9482
+ return compose(...appliedMiddleware);
9403
9483
  };
9404
9484
  const isWithMiddleware = isAllOf(withMiddleware, matchInstance(instanceId));
9405
9485
  const middleware = (api) => (next) => (action) => {
@@ -11600,7 +11680,8 @@ const useSeamlyIsLoading = () => useSeamlyStateContext().isLoading;
11600
11680
  const useSeamlyHeaderData = () => useSeamlyStateContext().headerTitles;
11601
11681
  const useSeamlyUnreadCount = () => useSeamlyStateContext().unreadEvents;
11602
11682
  const useLoadedImageEventIds = () => useSeamlyStateContext().loadedImageEventIds;
11603
- const useSkiplink = () => useSeamlyStateContext().skiplinkTargetId;
11683
+ const useSkiplinkElement = () => useSeamlyStateContext().skiplinkElementId;
11684
+ const useSkiplinkTarget = () => useSeamlyStateContext().skiplinkTargetId;
11604
11685
  const useSeamlyParticipant = participantId => useSeamlyStateContext().participantInfo.participants[participantId];
11605
11686
  const useSeamlyServiceInfo = () => useSeamlyStateContext().serviceInfo;
11606
11687
  const selectLastMessageEventId = createSelector(selectEvents, events => {
@@ -12554,6 +12635,7 @@ const initialStoreState = {
12554
12635
  subTitle: ''
12555
12636
  },
12556
12637
  historyLoaded: false,
12638
+ skiplinkElementId: randomId(),
12557
12639
  skiplinkTargetId: randomId(),
12558
12640
  optionsButtonId: randomId(),
12559
12641
  headerCollapseButtonId: randomId(),
@@ -14580,8 +14662,12 @@ const useSeamlyContainerElement = () => {
14580
14662
  const useElementFocusingById = elementId => (0,hooks_.useCallback)(() => {
14581
14663
  focusWithRaf(elementId);
14582
14664
  }, [elementId]);
14665
+ const useSkiplinkElementFocusing = () => {
14666
+ const skiplinkElementId = useSkiplinkElement();
14667
+ return useElementFocusingById(skiplinkElementId);
14668
+ };
14583
14669
  const useSkiplinkTargetFocusing = () => {
14584
- const skiplinkTargetId = useSkiplink();
14670
+ const skiplinkTargetId = useSkiplinkTarget();
14585
14671
  return useElementFocusingById(skiplinkTargetId);
14586
14672
  };
14587
14673
  const useWindowOpenButtonFocusing = () => {
@@ -16451,7 +16537,7 @@ const TimeIndicator = ({
16451
16537
  /* harmony default export */ const time_indicator = (TimeIndicator);
16452
16538
  ;// ./node_modules/tabbable/dist/index.esm.js
16453
16539
  /*!
16454
- * tabbable 6.2.0
16540
+ * tabbable 6.3.0
16455
16541
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
16456
16542
  */
16457
16543
  // NOTE: separate `:not()` selectors has broader browser support than the newer
@@ -16478,7 +16564,7 @@ var getRootNode = !NoElement && Element.prototype.getRootNode ? function (elemen
16478
16564
  * @returns {boolean} True if inert itself or by way of being in an inert ancestor.
16479
16565
  * False if `node` is falsy.
16480
16566
  */
16481
- var isInert = function isInert(node, lookUp) {
16567
+ var _isInert = function isInert(node, lookUp) {
16482
16568
  var _node$getAttribute;
16483
16569
  if (lookUp === void 0) {
16484
16570
  lookUp = true;
@@ -16494,7 +16580,7 @@ var isInert = function isInert(node, lookUp) {
16494
16580
  // code works for any kind of node
16495
16581
  // CAREFUL: JSDom does not appear to support certain selectors like `:not([inert] *)`
16496
16582
  // so it likely would not support `:is([inert] *)` either...
16497
- var result = inert || lookUp && node && isInert(node.parentNode); // recursive
16583
+ var result = inert || lookUp && node && _isInert(node.parentNode); // recursive
16498
16584
 
16499
16585
  return result;
16500
16586
  };
@@ -16522,7 +16608,7 @@ var isContentEditable = function isContentEditable(node) {
16522
16608
  var getCandidates = function getCandidates(el, includeContainer, filter) {
16523
16609
  // even if `includeContainer=false`, we still have to check it for inertness because
16524
16610
  // if it's inert, all its children are inert
16525
- if (isInert(el)) {
16611
+ if (_isInert(el)) {
16526
16612
  return [];
16527
16613
  }
16528
16614
  var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
@@ -16567,12 +16653,12 @@ var getCandidates = function getCandidates(el, includeContainer, filter) {
16567
16653
  * @param {IterativeOptions} options
16568
16654
  * @returns {Array.<Element|CandidateScope>}
16569
16655
  */
16570
- var getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
16656
+ var _getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {
16571
16657
  var candidates = [];
16572
16658
  var elementsToCheck = Array.from(elements);
16573
16659
  while (elementsToCheck.length) {
16574
16660
  var element = elementsToCheck.shift();
16575
- if (isInert(element, false)) {
16661
+ if (_isInert(element, false)) {
16576
16662
  // no need to look up since we're drilling down
16577
16663
  // anything inside this container will also be inert
16578
16664
  continue;
@@ -16581,7 +16667,7 @@ var getCandidatesIteratively = function getCandidatesIteratively(elements, inclu
16581
16667
  // add shadow dom slot scope (slot itself cannot be focusable)
16582
16668
  var assigned = element.assignedElements();
16583
16669
  var content = assigned.length ? assigned : element.children;
16584
- var nestedCandidates = getCandidatesIteratively(content, true, options);
16670
+ var nestedCandidates = _getCandidatesIteratively(content, true, options);
16585
16671
  if (options.flatten) {
16586
16672
  candidates.push.apply(candidates, nestedCandidates);
16587
16673
  } else {
@@ -16605,7 +16691,7 @@ var getCandidatesIteratively = function getCandidatesIteratively(elements, inclu
16605
16691
  // no inert look up because we're already drilling down and checking for inertness
16606
16692
  // on the way down, so all containers to this root node should have already been
16607
16693
  // vetted as non-inert
16608
- var validShadowRoot = !isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));
16694
+ var validShadowRoot = !_isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));
16609
16695
  if (shadowRoot && validShadowRoot) {
16610
16696
  // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed
16611
16697
  // shadow exists, so look at light dom children as fallback BUT create a scope for any
@@ -16613,7 +16699,7 @@ var getCandidatesIteratively = function getCandidatesIteratively(elements, inclu
16613
16699
  // children of the web component element (which has the shadow), in the light dom, but
16614
16700
  // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,
16615
16701
  // _after_ we return from this recursive call
16616
- var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
16702
+ var _nestedCandidates = _getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);
16617
16703
  if (options.flatten) {
16618
16704
  candidates.push.apply(candidates, _nestedCandidates);
16619
16705
  } else {
@@ -16790,6 +16876,28 @@ var isZeroArea = function isZeroArea(node) {
16790
16876
  var isHidden = function isHidden(node, _ref) {
16791
16877
  var displayCheck = _ref.displayCheck,
16792
16878
  getShadowRoot = _ref.getShadowRoot;
16879
+ if (displayCheck === 'full-native') {
16880
+ if ('checkVisibility' in node) {
16881
+ // Chrome >= 105, Edge >= 105, Firefox >= 106, Safari >= 17.4
16882
+ // @see https://developer.mozilla.org/en-US/docs/Web/API/Element/checkVisibility#browser_compatibility
16883
+ var visible = node.checkVisibility({
16884
+ // Checking opacity might be desirable for some use cases, but natively,
16885
+ // opacity zero elements _are_ focusable and tabbable.
16886
+ checkOpacity: false,
16887
+ opacityProperty: false,
16888
+ contentVisibilityAuto: true,
16889
+ visibilityProperty: true,
16890
+ // This is an alias for `visibilityProperty`. Contemporary browsers
16891
+ // support both. However, this alias has wider browser support (Chrome
16892
+ // >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so
16893
+ // we include it anyway.
16894
+ checkVisibilityCSS: true
16895
+ });
16896
+ return !visible;
16897
+ }
16898
+ // Fall through to manual visibility checks
16899
+ }
16900
+
16793
16901
  // NOTE: visibility will be `undefined` if node is detached from the document
16794
16902
  // (see notes about this further down), which means we will consider it visible
16795
16903
  // (this is legacy behavior from a very long way back)
@@ -16803,7 +16911,10 @@ var isHidden = function isHidden(node, _ref) {
16803
16911
  if (index_esm_matches.call(nodeUnderDetails, 'details:not([open]) *')) {
16804
16912
  return true;
16805
16913
  }
16806
- if (!displayCheck || displayCheck === 'full' || displayCheck === 'legacy-full') {
16914
+ if (!displayCheck || displayCheck === 'full' ||
16915
+ // full-native can run this branch when it falls through in case
16916
+ // Element#checkVisibility is unsupported
16917
+ displayCheck === 'full-native' || displayCheck === 'legacy-full') {
16807
16918
  if (typeof getShadowRoot === 'function') {
16808
16919
  // figure out if we should consider the node to be in an undisclosed shadow and use the
16809
16920
  // 'non-zero-area' fallback
@@ -16916,7 +17027,7 @@ var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(o
16916
17027
  // we must do an inert look up to filter out any elements inside an inert ancestor
16917
17028
  // because we're limited in the type of selectors we can use in JSDom (see related
16918
17029
  // note related to `candidateSelectors`)
16919
- isInert(node) || isHiddenInput(node) || isHidden(node, options) ||
17030
+ _isInert(node) || isHiddenInput(node) || isHidden(node, options) ||
16920
17031
  // For a details element with a summary, the summary element gets the focus
16921
17032
  isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
16922
17033
  return false;
@@ -16929,7 +17040,7 @@ var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(opt
16929
17040
  }
16930
17041
  return true;
16931
17042
  };
16932
- var isValidShadowRootTabbable = function isValidShadowRootTabbable(shadowHostNode) {
17043
+ var isShadowRootTabbable = function isShadowRootTabbable(shadowHostNode) {
16933
17044
  var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);
16934
17045
  if (isNaN(tabIndex) || tabIndex >= 0) {
16935
17046
  return true;
@@ -16943,14 +17054,14 @@ var isValidShadowRootTabbable = function isValidShadowRootTabbable(shadowHostNod
16943
17054
  * @param {Array.<Element|CandidateScope>} candidates
16944
17055
  * @returns Element[]
16945
17056
  */
16946
- var sortByOrder = function sortByOrder(candidates) {
17057
+ var _sortByOrder = function sortByOrder(candidates) {
16947
17058
  var regularTabbables = [];
16948
17059
  var orderedTabbables = [];
16949
17060
  candidates.forEach(function (item, i) {
16950
17061
  var isScope = !!item.scopeParent;
16951
17062
  var element = isScope ? item.scopeParent : item;
16952
17063
  var candidateTabindex = getSortOrderTabIndex(element, isScope);
16953
- var elements = isScope ? sortByOrder(item.candidates) : element;
17064
+ var elements = isScope ? _sortByOrder(item.candidates) : element;
16954
17065
  if (candidateTabindex === 0) {
16955
17066
  isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
16956
17067
  } else {
@@ -16972,22 +17083,22 @@ var tabbable = function tabbable(container, options) {
16972
17083
  options = options || {};
16973
17084
  var candidates;
16974
17085
  if (options.getShadowRoot) {
16975
- candidates = getCandidatesIteratively([container], options.includeContainer, {
17086
+ candidates = _getCandidatesIteratively([container], options.includeContainer, {
16976
17087
  filter: isNodeMatchingSelectorTabbable.bind(null, options),
16977
17088
  flatten: false,
16978
17089
  getShadowRoot: options.getShadowRoot,
16979
- shadowRootFilter: isValidShadowRootTabbable
17090
+ shadowRootFilter: isShadowRootTabbable
16980
17091
  });
16981
17092
  } else {
16982
17093
  candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
16983
17094
  }
16984
- return sortByOrder(candidates);
17095
+ return _sortByOrder(candidates);
16985
17096
  };
16986
17097
  var focusable = function focusable(container, options) {
16987
17098
  options = options || {};
16988
17099
  var candidates;
16989
17100
  if (options.getShadowRoot) {
16990
- candidates = getCandidatesIteratively([container], options.includeContainer, {
17101
+ candidates = _getCandidatesIteratively([container], options.includeContainer, {
16991
17102
  filter: isNodeMatchingSelectorFocusable.bind(null, options),
16992
17103
  flatten: true,
16993
17104
  getShadowRoot: options.getShadowRoot
@@ -17024,7 +17135,7 @@ var isFocusable = function isFocusable(node, options) {
17024
17135
 
17025
17136
  ;// ./node_modules/focus-trap/dist/focus-trap.esm.js
17026
17137
  /*!
17027
- * focus-trap 7.6.5
17138
+ * focus-trap 7.6.6
17028
17139
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
17029
17140
  */
17030
17141
 
@@ -20011,10 +20122,26 @@ const event_Event = ({
20011
20122
 
20012
20123
 
20013
20124
 
20125
+
20126
+
20014
20127
  const Loader = () => {
20015
20128
  const {
20016
- id
20129
+ t
20130
+ } = useI18n();
20131
+ const {
20132
+ sendPolite
20133
+ } = useLiveRegion();
20134
+ const {
20135
+ id,
20136
+ name
20017
20137
  } = useSeamlyCurrentAgent() || {};
20138
+ (0,hooks_.useEffect)(() => {
20139
+ if (name) {
20140
+ sendPolite(t('typing.srText', {
20141
+ name
20142
+ }));
20143
+ }
20144
+ }, [name, sendPolite, t]);
20018
20145
  return /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)("li", {
20019
20146
  className: css_className('conversation__item', 'conversation__item--source-agent'),
20020
20147
  children: /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsxs)("div", {
@@ -20095,7 +20222,8 @@ const Conversation = () => {
20095
20222
  const {
20096
20223
  isOpen
20097
20224
  } = useVisibility();
20098
- const skiplinkTargetId = useSkiplink();
20225
+ const skiplinkElementId = useSkiplinkElement();
20226
+ const skiplinkTargetId = useSkiplinkTarget();
20099
20227
  const focusSkiplinkTarget = useSkiplinkTargetFocusing();
20100
20228
  const onClickHandler = e => {
20101
20229
  e.preventDefault();
@@ -20103,6 +20231,7 @@ const Conversation = () => {
20103
20231
  };
20104
20232
  return /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
20105
20233
  children: [isOpen && /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)("a", {
20234
+ id: skiplinkElementId,
20106
20235
  className: css_className('skip-link'),
20107
20236
  href: `#${skiplinkTargetId}`,
20108
20237
  onClick: onClickHandler,
@@ -20442,10 +20571,12 @@ const Suggestions = ({
20442
20571
 
20443
20572
 
20444
20573
 
20574
+
20445
20575
  const Chat = (0,compat_namespaceObject.forwardRef)(({
20446
20576
  children,
20447
20577
  className: givenClassName = ''
20448
20578
  }, forwardedRef) => {
20579
+ const focusTrap = (0,compat_namespaceObject.useRef)(null);
20449
20580
  const {
20450
20581
  closeChat,
20451
20582
  isOpen,
@@ -20460,6 +20591,7 @@ const Chat = (0,compat_namespaceObject.forwardRef)(({
20460
20591
  isInline
20461
20592
  } = useSeamlyLayoutMode();
20462
20593
  const appContainerClassNames = useSeamlyAppContainerClassNames();
20594
+ const chatSectionId = useGeneratedId();
20463
20595
  const headingId = useGeneratedId();
20464
20596
  const userHasResponded = useUserHasResponded();
20465
20597
  const {
@@ -20482,7 +20614,22 @@ const Chat = (0,compat_namespaceObject.forwardRef)(({
20482
20614
  focusWindowOpenButton();
20483
20615
  }
20484
20616
  };
20617
+ (0,compat_namespaceObject.useEffect)(() => {
20618
+ if (isVisible && layoutMode === 'window') {
20619
+ focusTrap.current = createFocusTrap(`#${chatSectionId}`, {
20620
+ // We set the initialFocus to false, as the `WindowOpenButton` takes care of that
20621
+ initialFocus: false
20622
+ });
20623
+ focusTrap.current.activate();
20624
+ }
20625
+ return () => {
20626
+ if (focusTrap.current) {
20627
+ focusTrap.current.deactivate();
20628
+ }
20629
+ };
20630
+ }, [chatSectionId, isVisible, layoutMode]);
20485
20631
  return isVisible && /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsxs)("section", {
20632
+ id: chatSectionId,
20486
20633
  className: css_className(classNames),
20487
20634
  onKeyDown: onKeyDownHandler,
20488
20635
  tabIndex: -1,
@@ -21835,7 +21982,7 @@ const Prompt = ({
21835
21982
  children,
21836
21983
  title
21837
21984
  }) => {
21838
- const skiplinkTargetId = useSkiplink();
21985
+ const skiplinkTargetId = useSkiplinkTarget();
21839
21986
  const containerHeadingId = useGeneratedId();
21840
21987
  return /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsxs)("section", {
21841
21988
  id: skiplinkTargetId,
@@ -22191,7 +22338,7 @@ function TextEntry({
22191
22338
  isOpen,
22192
22339
  setVisibility
22193
22340
  } = useVisibility();
22194
- const skipLinkId = useSkiplink();
22341
+ const skipLinkId = useSkiplinkTarget();
22195
22342
  const focusSkipLinkTarget = useSkiplinkTargetFocusing();
22196
22343
  const {
22197
22344
  sendMessage
@@ -22484,7 +22631,7 @@ const upload_Upload = () => {
22484
22631
  sendPolite,
22485
22632
  sendAssertive
22486
22633
  } = useLiveRegion();
22487
- const skiplinkTargetId = useSkiplink();
22634
+ const skiplinkTargetId = useSkiplinkTarget();
22488
22635
  const focusSkiplinkTarget = useSkiplinkTargetFocusing();
22489
22636
  // This hook should be refactored at some point
22490
22637
  const {
@@ -23113,6 +23260,7 @@ const WindowOpenButton = ({
23113
23260
  t
23114
23261
  } = useI18n();
23115
23262
  const ariaLabel = hasConversation() ? t('window.openButton.srContinue') : t('window.openButton.srStart');
23263
+ const focusSkipLinkELement = useSkiplinkElementFocusing();
23116
23264
  const focusSkiplinkTarget = useSkiplinkTargetFocusing();
23117
23265
  const {
23118
23266
  isOpen
@@ -23121,10 +23269,17 @@ const WindowOpenButton = ({
23121
23269
  windowOpenButtonId
23122
23270
  } = useSeamlyStateContext();
23123
23271
  const count = useSeamlyUnreadCount();
23124
- const handleClick = (0,hooks_.useCallback)(() => {
23272
+ const handleClick = (0,hooks_.useCallback)(event => {
23125
23273
  onClick();
23126
- focusSkiplinkTarget();
23127
- }, [focusSkiplinkTarget, onClick]);
23274
+ if (event.detail > 0) {
23275
+ // Mouse was used: focus the input element
23276
+ focusSkiplinkTarget();
23277
+ } else {
23278
+ // Keyboard was used: focus the skiplink element instead to improve
23279
+ // accessibility for keyboard users.
23280
+ focusSkipLinkELement();
23281
+ }
23282
+ }, [focusSkipLinkELement, focusSkiplinkTarget, onClick]);
23128
23283
  return /*#__PURE__*/(0,jsx_runtime_namespaceObject.jsx)(in_out_transition, {
23129
23284
  isActive: !isOpen,
23130
23285
  transitionStartState: transitionStartStates.rendered,