import { createStore as x } from "zustand";
import { devtools as N } from "zustand/middleware";
import { immer as b } from "zustand/middleware/immer";
import { getCookiesContainer as E, getDataFromResponse as R, getParmsFromValue as $, setColapsedLayoutBreakPoints as F, COOKIE_BREAKPOINT_LAYOUTS as B, DEBOUCED_SAVE_TIME as H, DEFAULT_WINDOW as I, MARGIN_GRIDLAYOUT as y, COOKIE_WINDOWS as U, deleteLayoutFromBreakPoints as G, RESPONSIVE_ROW_HEIGHTS as K, PADDING_GRIDLAYOUT as P, NORMALIZED_COLS as Q, addArea as S, DEFAULT_AREA as z, getSelectedAreaIdFromCookies as V, COOKIE_WINDOW_SELECTED as Y, COOKIE_AREAS_ADMIN_CONTAINER_ID as T, COOKIE_AREAS_ADMIN_ID as D } from "./helpers/helper.js";
import { createDynamicMFStore as O } from "../../../WindowBase/contexts/DynamicMFParmsContext/store.js";
import j from "lodash-es/cloneDeep";
import q from "lodash-es/debounce";
import { generateModuleCount as L } from "./helpers/generateModuleCount.js";
import { AREAS_STORE_ID as Z } from "../../constants.js";
import { helperSelectLayout as v } from "./helpers/selectLayout.js";
import { deleteCookie as M, setCookie as C, getCookie as _ } from "../../../../helpers/cookies/cookies.js";
import { isEqualLayouts as J } from "../../../GridLayout/utils.js";
import { cloneLayouts as X, addLayoutItemToBreakPoints as g } from "../../../GridLayout/subcomponents/Responsive/responsiveUtils.js";
const ee = (k, W) => {
  const { enabled: w = !1 } = W;
  return w && process.env.NODE_ENV === "development" ? N(k, W) : k;
}, pe = (k, W = !1) => {
  const w = {
    currentAreaId: "",
    currentModuleId: "",
    areasIds: [],
    hashAreas: {},
    hashWindows: {},
    windowsModalsIds: [],
    ...k
  };
  return x(
    ee(
      b((i, a) => ({
        ...w,
        areasActions: {
          /**
           * Initialize the Areas store.
           */
          init: () => {
            if (a().ownerState?.status !== "init")
              return;
            if (!a().loadAreasFromNetwork) {
              a().areasActions.addArea(), i((r) => {
                r.ownerState.status = "loaded";
              });
              return;
            }
            i((r) => {
              r.ownerState.status = "loading";
            });
            const e = _({
              networkOperation: a().networkOperation,
              params: {
                f: [
                  { n: "container_id", o: "e", o1: T },
                  { n: "id", o: "e", o1: D }
                ]
              }
            }), o = a().networkOperation({
              method: "GET",
              endPoint: "areas",
              parms: {},
              toastSuccess: !1
            });
            let s;
            Promise.allSettled([o, e]).then(([r, n]) => {
              if (r?.status === "fulfilled") {
                const t = r?.value?.data;
                i((d) => {
                  if (t && Array.isArray(t) && t.length > 0)
                    for (let c = 0; c < t.length; c++) {
                      const l = {
                        ...z,
                        ...t[c],
                        // API-backed areas should lazily load windows on first selection.
                        loadWindows: !0
                      };
                      d.hashAreas[l.id] = l, d.areasIds.push(l.id);
                    }
                  else
                    S(d);
                });
              }
              n.status === "fulfilled" && (s = V(n?.value));
            }).finally(() => {
              if (i((r) => {
                r.ownerState.status = "loaded";
              }), a().areasIds.length > 0 && a().currentAreaId === "") {
                const r = s && a().areasIds?.includes?.(s) ? s : a().areasIds[0];
                a().areasActions.selectArea(r);
              }
            });
          },
          /**
           * Add a blank work area and select it.
           */
          addArea: () => {
            let e = "";
            return i((o) => {
              e = S(o);
            }), a().areasActions.selectArea(e), e;
          },
          /**
           * editArea store
           */
          editArea: (e, o) => {
            i((s) => {
              s.hashAreas[e] && (s.hashAreas[e].name = o, s.loadAreasFromNetwork && s.networkOperation({
                method: "PATCH",
                endPoint: `areas/${e}`,
                data: { name: o },
                toastSuccess: !1,
                toastError: !1
              }));
            });
          },
          /**
           * deleteArea store
           */
          deleteArea: (e) => {
            let o = "";
            i((s) => {
              if (!s.hashAreas[e] || s.areasIds.length < 2)
                return;
              const n = s.areasIds.indexOf(e);
              if (n > -1) {
                for (const d in s.hashWindows)
                  s.hashWindows[d].areaId === e && delete s.hashWindows[d];
                const t = s.areasIds.findIndex((d) => d === e);
                s.areasIds.splice(n, 1), delete s.hashAreas[e], s.currentAreaId === e && (o = s.areasIds[t <= s.areasIds.length - 1 ? t : s.areasIds.length - 1]);
              }
              s.loadAreasFromNetwork && s.networkOperation({
                method: "DELETE",
                endPoint: `areas/${e}`,
                parms: {},
                toastSuccess: !1,
                toastError: !1
              }), s.loadCookiesFromNetwork && M({
                networkOperation: a().networkOperation,
                data: { f: [{ n: "container_id", o: "c", o1: e }] }
              }).catch(() => {
              });
            }), o && a().areasActions.selectArea(o);
          },
          /**
           * selectArea store
           */
          selectArea: (e) => {
            i((o) => {
              o.currentAreaId = e, o.hashAreas[e].currentLayoutId ? o.currentModuleId = o.hashWindows[o.hashAreas[e].currentLayoutId].moduleId : o.currentModuleId = "";
            }), a().hashAreas[e].status === "init" && (a().hashAreas[e].loadWindows ? a().areaActions.loadWindowsFromApi(e) : i((o) => {
              o.hashAreas[e].status = "loaded";
            })), a().loadCookiesFromNetwork && C({
              networkOperation: a().networkOperation,
              endPoint: `${T}/${D}`,
              value: { selectedAreaId: e }
            }).catch(() => {
            });
          },
          /**
           * setHandlerGetLabel
           */
          setHandlerGetLabel: (e) => {
            i((o) => {
              o.getLabel = e;
            });
          },
          /**
           * setExternalState
           */
          setExternalState: (e) => {
            i((o) => {
              o.ownerState = { ...o.ownerState, ...e };
            });
          }
        },
        areaActions: {
          /**
           * addWindow store
           */
          addWindow: (e) => {
            const o = `${a().currentAreaId}_window_${(/* @__PURE__ */ new Date()).getTime()}_${(Math.random() * 1e3).toFixed(0)}`;
            e.emergeType === "layout" ? a().areaActions.addLayout(
              a().currentAreaId,
              o,
              e
            ) : e.emergeType === "popup" ? a().areaActions.addPopup(
              a().currentAreaId,
              o,
              e
            ) : e.emergeType === "panel" ? a().areaActions.addPanel(
              a().currentAreaId,
              o,
              e
            ) : e.emergeType === "modal" && a().areaActions.addWindowModal(
              a().currentAreaId,
              o,
              e
            );
          },
          /**
           * addLayout store
           */
          addLayout: (e, o, s) => {
            let r = o;
            const n = !1, t = L(
              a().currentAreaId,
              s.moduleId,
              a().hashWindows
            ), d = {
              ...s.layoutProps,
              i: o,
              isDraggable: !0,
              isResizable: !0,
              freeMove: n
            };
            i((c) => {
              const l = c.hashAreas[e];
              if (l) {
                if (s.replaceMeId)
                  for (let m = 0; m < l.layoutItemsIds.length; m++) {
                    const h = l.layoutItemsIds[m], f = c.hashWindows[h];
                    if (f.replaceMeId === s.replaceMeId) {
                      r = h, f.dynamicMFStore.getState().actions.changeData(s.dynamicParams);
                      break;
                    }
                  }
                if (r === o) {
                  const m = O({
                    dynamicMFParameters: s.dynamicParams
                  });
                  c.hashWindows[o] = {
                    ...s,
                    areaId: e,
                    windowId: o,
                    onClose: (h) => {
                      a().areaActions.closeLayout(e, h);
                    },
                    ...I,
                    dynamicMFStore: m,
                    moduleCount: t
                  }, l.layoutItemsIds.push(o), l.maximizedId && (l.maximizedId = o), l.layouts = g(
                    l.layouts,
                    d,
                    Q,
                    [y, y],
                    [P, P],
                    K,
                    l.containerHeight,
                    l.currentBreakpoint
                  ), l.currentBreakpoint === "xxs" && (l.maximizedId = o), v(c, e, o, !0), a().popupsProviderMethods.setSelectedPopupId(e, void 0);
                }
              }
            }), a().areaActions.saveLayouts(e), a().areaActions.bouncedSaveBreakpointsLayouts(e);
          },
          /**
           * closeLayout
           */
          closeLayout: (e, o) => {
            i((s) => {
              const r = s.hashAreas[e];
              if (!r)
                return;
              const n = r.layoutItemsIds.indexOf(o);
              n > -1 && r.layoutItemsIds.splice(n, 1), G(r, o), delete s.hashWindows[o], s.hashAreas[e].currentLayoutId === o && v(s, e, "");
            }), a().areaActions.saveLayouts(e), a().hashAreas[e].maximizedId === o && a().areaActions.maximizeLayout(e);
            for (let s = 0; s < a().hashAreas[e].layoutItemsIds.length; s++) {
              const r = a().hashAreas[e].layoutItemsIds[s], n = a().hashWindows[r];
              n && n.parentId === o && a().areaActions.closeLayout(e, n.windowId);
            }
            a().popupsProviderMethods.closeAllPopupsByParentId(o);
          },
          /**
           * saveLayouts
           */
          saveLayouts: (e) => {
            if (!a().loadCookiesFromNetwork)
              return;
            let o = 0;
            const s = a().hashAreas[e];
            if (!s)
              return;
            const r = {};
            for (let n = 0; n < s.layoutItemsIds.length; n++) {
              const t = s.layoutItemsIds[n], d = a().hashWindows[t];
              d?.emergeType === "layout" && d.winType === "microfrontend" && (r[t] = {
                winType: d.winType,
                emergeType: d.emergeType,
                title: d.title,
                url_icon: d.iconUrl,
                windowOptions: d.windowOptions,
                moduleId: d.moduleId,
                windowId: d.windowId,
                mfProps: d.mfProps,
                moduleCount: d.moduleCount,
                iconUrl: d.iconUrl
              }, o++);
            }
            o > 0 ? C({
              networkOperation: a().networkOperation,
              endPoint: `${s.id}/${U}`,
              value: r
            }).catch(() => {
            }) : M({
              networkOperation: a().networkOperation,
              data: { f: [{ n: "container_id", o: "c", o1: s.id }] }
            }).catch(() => {
            });
          },
          /**
           * addPopup store
           */
          addPopup: (e, o, s) => {
            let r = o;
            i((n) => {
              if (n.hashAreas[e]) {
                if (s.replaceMeId) {
                  for (const d in n.hashWindows)
                    if (n.hashWindows[d].replaceMeId === s.replaceMeId) {
                      const c = n.hashWindows[d];
                      r = d, c.dynamicMFStore.getState().actions.changeData(s.dynamicParams), a().popupsProviderMethods.bringPopupOnFront(d, !0);
                      break;
                    }
                }
                if (r === o) {
                  const d = O({
                    dynamicMFParameters: s.dynamicParams
                  });
                  n.hashWindows[o] = {
                    ...s,
                    ...I,
                    areaId: e,
                    windowId: o,
                    // Legacy behavior: popup close requests issued through Areas
                    // still reuse the layout-style close path. This matches the
                    // previous contract, but teardown ownership and close-veto
                    // orchestration remain explicit follow-up debt.
                    onClose: (u) => {
                      a().areaActions.closeLayout(e, u);
                    },
                    dynamicMFStore: d
                  };
                  const { emergeType: c, popupProps: l, ...m } = s, h = s.parentId, f = (u, p, A) => {
                    h ? A === "select" && a().areaActions.selectLayout(u, h) : a().areaActions.selectLayout(u, "");
                  };
                  a().popupsProviderMethods.addPopup({
                    ...m,
                    ...l,
                    popupId: o,
                    groupId: e,
                    dynamicMFStore: d,
                    dynamicParams: s.dynamicParams,
                    onRemove: () => a().areaActions.closePopup(e, o),
                    onSelectedPopupIdChange: f,
                    allowHeightResizeContainer: !0,
                    allowWidthResizeContainer: !1,
                    bounds: {
                      left: y,
                      top: y,
                      right: -y,
                      bottom: -y
                    }
                  });
                }
              }
            });
          },
          /**
           * addPanel store
           */
          addPanel: (e, o, s) => {
            let r = o, n;
            if (i((h) => {
              const f = h.hashAreas[e];
              if (f) {
                if (s.replaceMeId)
                  for (let u = 0; u < f.panelItemsIds.length; u++) {
                    const p = f.panelItemsIds[u], A = h.hashWindows[p];
                    if (A?.replaceMeId === s.replaceMeId) {
                      r = p, A.dynamicMFStore.getState().actions.changeData(s.dynamicParams);
                      break;
                    }
                  }
                if (n = f.panelItemsIds.find((u) => {
                  const p = h.hashWindows[u];
                  return p?.emergeType === "panel" && p.panelProps.side === s.panelProps.side;
                }), !(n && r === o) && r === o) {
                  const u = O({
                    dynamicMFParameters: s.dynamicParams
                  }), p = L(
                    e,
                    s.moduleId,
                    h.hashWindows
                  );
                  h.hashWindows[o] = {
                    ...s,
                    areaId: e,
                    windowId: o,
                    onClose: (A) => {
                      a().areaActions.closePanel(e, A);
                    },
                    ...I,
                    dynamicMFStore: u,
                    moduleCount: p
                  }, f.panelItemsIds.push(o);
                }
              }
            }), r !== o || !n)
              return;
            const t = n, d = a().hashWindows[t];
            if (!d || d.emergeType !== "panel")
              return;
            let c = !1;
            const l = () => {
              c || (c = !0, a().areaActions.addPanel(e, o, s));
            };
            if (!d.fnQueryClose) {
              a().windowActions.close(t, !1), l();
              return;
            }
            const m = {
              reason: "same-side-replace",
              /**
               * Close the occupied panel and mount the newest same-side intent
               * once the guard explicitly approves the replacement.
               */
              proceed() {
                a().windowActions.close(t, !1), l();
              },
              cancel: () => {
              }
            };
            a().windowActions.close(
              t,
              !0,
              m
            );
          },
          /**
           * closePopup
           */
          closePopup: (e, o) => {
            i((s) => {
              s.hashAreas[e] && delete s.hashWindows[o];
            });
          },
          /**
           * closePanel
           */
          closePanel: (e, o) => {
            i((s) => {
              const r = s.hashAreas[e];
              if (!r)
                return;
              const n = r.panelItemsIds.indexOf(o);
              n > -1 && r.panelItemsIds.splice(n, 1), delete s.hashWindows[o];
            });
          },
          /**
           * setPanelPinned
           */
          setPanelPinned: (e, o, s) => {
            i((r) => {
              const n = r.hashAreas[e], t = r.hashWindows[o];
              !n || t?.emergeType !== "panel" || (t.panelProps.pinned = s);
            });
          },
          /**
           * setPanelSize
           */
          setPanelSize: (e, o, s) => {
            i((r) => {
              const n = r.hashAreas[e], t = r.hashWindows[o];
              if (!(!n || t?.emergeType !== "panel")) {
                if (t.panelProps.side === "left" || t.panelProps.side === "right") {
                  "width" in s && s.width !== void 0 && (t.panelProps.width = s.width), "maxWidth" in s && s.maxWidth !== void 0 && (t.panelProps.maxWidth = s.maxWidth);
                  return;
                }
                "height" in s && s.height !== void 0 && (t.panelProps.height = s.height), "maxHeight" in s && s.maxHeight !== void 0 && (t.panelProps.maxHeight = s.maxHeight);
              }
            });
          },
          /**
           * closeWindowModal
           */
          closeWindowModal: (e) => {
            i((o) => {
              const s = o.windowsModalsIds.findIndex((r) => r === e);
              s > -1 && o.windowsModalsIds.splice(s, 1), delete o.hashWindows[e];
            });
          },
          /**
           * addWindowModal
           */
          addWindowModal: (e, o, s) => {
            i((r) => {
              const n = O({
                dynamicMFParameters: s.dynamicParams
              });
              r.windowsModalsIds.push(o);
              const t = L(
                a().currentAreaId,
                s.moduleId,
                a().hashWindows
              );
              r.hashWindows[o] = {
                ...s,
                areaId: e,
                windowId: o,
                ...I,
                onClose: a().areaActions.closeWindowModal,
                dynamicMFStore: n,
                moduleCount: t
              };
            });
          },
          bouncedSaveBreakpointsLayouts: q(
            (e) => {
              if (!a().loadCookiesFromNetwork)
                return;
              const o = {
                ...a().hashAreas[e].layouts
              }, s = {};
              for (const r in o) {
                const n = o[r];
                o[r] = n.filter((t) => t.i === "none" ? !1 : a().hashAreas[e].layoutItemsIds.indexOf(t.i) > -1), o[r].length > 0 && (s[r] = o[r]);
              }
              Object.keys(s).length > 0 && C({
                networkOperation: a().networkOperation,
                endPoint: `${a().hashAreas[e].id}/${B}`,
                value: s
              }).catch(() => {
              });
            },
            H,
            {
              leading: !0,
              trailing: !0
            }
          ),
          /**
           * onBreakpointsLayoutsChange
           */
          onBreakpointsLayoutsChange: (e, o, s) => {
            J(a().hashAreas[e].layouts, s) || (i((r) => {
              r.hashAreas[e].layouts = X(s);
            }), a().hashAreas[e].maximizedId || a().areaActions.bouncedSaveBreakpointsLayouts(e));
          },
          /**
           * containerChange
           */
          onContainerChange: (e, o) => {
            i((s) => {
              s.hashAreas[e].containerHeight = o.containerHeight, s.hashAreas[e].currentBreakpoint = o.breakpoint;
            });
          },
          /**
           * selectLayout
           */
          selectLayout: (e, o) => {
            a().hashAreas[e].currentLayoutId !== o && i((s) => {
              v(s, e, o);
            });
          },
          /**
           * unColapseLayoutItem
           */
          unColapseLayoutItem: (e, o) => {
            i((s) => {
              F(s.hashAreas[e], o, !1);
            });
          },
          /**
           * colapseLayoutItem
           */
          colapseLayoutItem: (e, o) => {
            !a().hashAreas[e].maximizedId && a().hashWindows[o] && i((s) => {
              F(s.hashAreas[e], o, !0);
            });
          },
          /**
           * minimizeLayout
           */
          maximizeLayout: (e, o) => {
            i((s) => {
              const r = s.hashAreas[e];
              r && (r.maximizedId = o);
            }), o && a().areaActions.selectLayout(e, o);
          },
          /**
           * normalizeLayouts
           */
          normalizeLayouts: (e) => {
            i((o) => {
              const s = o.hashAreas[e];
              s && (s.maximizedId = void 0);
            });
          },
          /**
           * loadWindowsFromApi
           */
          loadWindowsFromApi: (e) => {
            const o = a().hashAreas[e];
            if (o && o.status === "init") {
              if (!a().loadAreasFromNetwork || !a().loadCookiesFromNetwork || !o.loadWindows) {
                i((s) => {
                  s.hashAreas[e].status = "loaded";
                });
                return;
              }
              i((s) => {
                s.hashAreas[e].status = "loading";
              }), _({
                networkOperation: a().networkOperation,
                params: { f: [{ n: "container_id", o: "e", o1: e }] }
              }).then((s) => {
                if (!a().hashAreas[e])
                  return;
                const n = s.data;
                i((t) => {
                  const d = t.hashAreas[e], { newBreakPointsLayouts: c, newHashLayoutItems: l } = R(
                    n,
                    t,
                    e
                  );
                  d.layouts = c, d.layoutItemsIds = l, d.status = "loaded";
                  const m = $(Y, n) || { currentLayoutId: "" };
                  v(t, e, m?.currentLayoutId || "", !1);
                });
              }).catch((s) => {
                i((r) => {
                  r.hashAreas[e].status = "loaded";
                });
              });
            }
          }
          // /**
          //  * setIsDraggingResizingPopup
          //  */
          // setIsDraggingResizingPopup: (areaId: string, newIsDraggingResizingPopup: boolean) => {
          //   set(state => {
          //     state.hashAreas[areaId].isDraggingResizingPopup = newIsDraggingResizingPopup;
          //   });
          // },
        },
        windowActions: {
          /**
           * setActions
           */
          setActions: (e, o, s, r) => {
            i((n) => {
              n.hashWindows[e] && (n.hashWindows[e].moduleActions = j(o), n.hashWindows[e].version = s, n.hashWindows[e].buildTime = r);
            });
          },
          /**
           * getCookie
           */
          getCookie: (e, o) => a().hashWindows[e] ? a().hashWindows[e].cookies.windowCookies[o] || a().hashWindows[e].cookies.moduleCookies[o] : {},
          /**
           * getCookies
           */
          getCookies: (e, o) => a().hashWindows[e] ? o === "window" ? a().hashWindows[e].cookies.windowCookies : a().hashWindows[e].cookies.moduleCookies : {},
          /**
           * setCookie
           */
          setCookie: (e, o, s, r) => {
            i((n) => {
              const t = n.hashWindows[e];
              t && (a().loadCookiesFromNetwork && C({
                networkOperation: a().networkOperation,
                endPoint: `${s === "module" ? t.moduleId : e}/${o}`,
                value: r
              }).catch(() => {
              }), s === "window" ? t.cookies.windowCookies[o] = r : t.cookies.moduleCookies[o] = r);
            });
          },
          /**
           * close window
           */
          close: (e, o = !0, s) => {
            const r = a().hashWindows[e];
            if (r) {
              if (r.fnQueryClose && o) {
                r.fnQueryClose(s);
                return;
              }
              const n = r.onClose;
              n && n(r.windowId);
            }
          },
          /**
           * startProgress
           */
          startProgress: (e) => {
            i((o) => {
              o.hashWindows[e] && (o.hashWindows[e].loading = !0);
            });
          },
          /**
           * stopProgress
           */
          stopProgress: (e) => {
            i((o) => {
              o.hashWindows[e] && (o.hashWindows[e].loading = !1);
            });
          },
          /**
           * loadCookiesFromApi
           */
          loadCookiesFromApi: (e) => {
            const o = a().hashWindows[e];
            if (o && o.status === "init") {
              if (!a().loadCookiesFromNetwork) {
                i((s) => {
                  s.hashWindows[e].status = "loaded";
                });
                return;
              }
              i((s) => {
                s.hashWindows[e].status = "loading";
              }), _({
                networkOperation: a().networkOperation,
                params: {
                  f: [
                    { n: "container_id", o: "e", o1: o.windowId },
                    { n: "container_id", o: "e", o1: o.moduleId }
                  ]
                }
              }).then((s) => {
                i((r) => {
                  const n = r.hashWindows[e];
                  n && (n.cookies.moduleCookies = E(
                    s.data,
                    n.moduleId
                  ), n.cookies.windowCookies = E(s.data, e), n.status = "loaded");
                });
              }).catch((s) => {
                i((r) => {
                  r.hashWindows[e] && (r.hashWindows[e].status = "loaded");
                });
              });
            }
          },
          /**
           * saveModuleCookies
           */
          saveModuleCookies: (e) => {
            const o = a().hashWindows[e];
            if (o) {
              if (!a().loadCookiesFromNetwork)
                return;
              for (const s in o.cookies.windowCookies) {
                const r = o.cookies.windowCookies[s];
                C({
                  networkOperation: a().networkOperation,
                  endPoint: `${o.moduleId}/${s}`,
                  value: r
                }).catch(() => {
                });
              }
            }
          },
          /**
           * setModuleCookies
           */
          resetModuleCookies: (e) => {
            const o = a().hashWindows[e];
            if (o) {
              if (!a().loadCookiesFromNetwork)
                return;
              M({
                networkOperation: a().networkOperation,
                data: {
                  f: [
                    {
                      n: "id",
                      o: "c",
                      o1: o.moduleId
                    }
                  ]
                }
              }).catch(() => {
              });
            }
          },
          /**
           * setFnQueryClose
           */
          setFnQueryClose: (e, o) => {
            i((s) => {
              s.hashWindows[e].fnQueryClose = o;
            });
          },
          /**
           * setWindowTitle
           */
          setWindowTitle: (e, o) => {
            i((s) => {
              s.hashWindows[e].title = o;
            });
          },
          /**
           * setWindowSubtitle
           */
          setWindowSubTitle: (e, o) => {
            i((s) => {
              s.hashWindows[e].subTitle = o;
            });
          },
          /**
           * setWindowEditionInfo
           */
          setWindowEditionInfo: (e, o) => {
            i((s) => {
              s.hashWindows[e].editionInfo = o;
            });
          }
        }
      })),
      { name: `${Z}: ${k.storeId}`, enabled: W }
    )
  );
};
export {
  pe as createAreasStore
};
