"use strict";
exports.id = 4180;
exports.ids = [4180];
exports.modules = {

/***/ 7817:
/***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "re": () => (/* binding */ createStoreContext)
/* harmony export */ });
/* unused harmony exports createContext, createOptionalUseState, createProvider, createUseState, useContext, useOptionalContext */
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6689);
/* harmony import */ var _leight_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5666);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(997);
/* harmony import */ var zustand__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6912);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([zustand__WEBPACK_IMPORTED_MODULE_3__]);
zustand__WEBPACK_IMPORTED_MODULE_3__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
// src/utils/createContext.ts

var createContext = () => (0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(null);

// src/utils/createProvider.tsx



var createProvider = ({
  name,
  createStore: createStore2,
  Context: Context2
}) => {
  return function StoreProvider({
    children,
    defaults,
    state
  }) {
    const Children = children;
    const memo = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
      const store = createStore2({ defaults, state });
      return { name, state: store.getState(), store };
    }, []);
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Context2.Provider, { value: memo, children: (0,_leight_utils__WEBPACK_IMPORTED_MODULE_2__/* .isCallable */ .GV)(Children) ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Children, { ...memo }) : Children });
  };
};

// src/utils/createStoreContext.ts


// src/utils/createUseState.ts


// src/utils/useContext.ts

function useContext(context, name, hint) {
  const $context = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(context);
  if (!$context) {
    throw new Error(
      `There is no [${name}] context available.${hint ? ` ${hint}` : ""} `
    );
  }
  return $context;
}

// src/utils/useOptionalContext.ts

function useOptionalContext(context) {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(context);
}

// src/utils/createUseState.ts
var createUseState = (Context2, name, hint) => {
  return (selector) => {
    const { store } = useContext(Context2, name, hint);
    return selector ? (0,zustand__WEBPACK_IMPORTED_MODULE_3__.useStore)(store, selector) : (0,zustand__WEBPACK_IMPORTED_MODULE_3__.useStore)(store);
  };
};
var createOptionalUseState = (Context2) => {
  return (selector) => {
    const { store } = useOptionalContext(Context2) || {};
    if (store) {
      return selector ? (0,zustand__WEBPACK_IMPORTED_MODULE_3__.useStore)(store, selector) : (0,zustand__WEBPACK_IMPORTED_MODULE_3__.useStore)(store);
    }
    return null;
  };
};

// src/utils/createStoreContext.ts
var createStoreContext = ({
  state,
  name,
  hint
}) => {
  const Context2 = createContext();
  return {
    Provider: createProvider({
      name,
      Context: Context2,
      createStore: ({ defaults: $defaults, state: $state }) => (0,zustand__WEBPACK_IMPORTED_MODULE_3__.createStore)(($set, $get, $store) => ({
        ...state({ defaults: $defaults, state: $state })($set, $get, $store),
        ...$defaults
      }))
    }),
    useState: createUseState(Context2, name, hint),
    useOptionalState: createOptionalUseState(Context2),
    useStore: () => useContext(Context2, name, hint).store,
    useOptionalStore: () => useOptionalContext(Context2)?.store || null
  };
};

//# sourceMappingURL=index.js.map

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 6994:
/***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Wb": () => (/* binding */ Translation),
/* harmony export */   "Yo": () => (/* binding */ DateInline),
/* harmony export */   "pk": () => (/* binding */ DateTimeProvider)
/* harmony export */ });
/* unused harmony exports DateTimeInline, DateTimeStore, useTranslation */
/* harmony import */ var _leight_context_client__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7817);
/* harmony import */ var _leight_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2353);
/* harmony import */ var _leight_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7680);
/* harmony import */ var _leight_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5666);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var next_i18next__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1377);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_leight_i18n__WEBPACK_IMPORTED_MODULE_2__, _leight_i18n__WEBPACK_IMPORTED_MODULE_3__, _leight_context_client__WEBPACK_IMPORTED_MODULE_4__]);
([_leight_i18n__WEBPACK_IMPORTED_MODULE_2__, _leight_i18n__WEBPACK_IMPORTED_MODULE_3__, _leight_context_client__WEBPACK_IMPORTED_MODULE_4__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
// src/context/DateTimeContext.tsx




var iso2locale = (date, fallback, opts) => {
  if (!date) {
    date = fallback;
  }
  if (!date) {
    return void 0;
  }
  if ((0,_leight_utils__WEBPACK_IMPORTED_MODULE_1__/* .isString */ .HD)(date)) {
    return _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.DateTime.fromISO(date).toLocaleString(opts);
  } else if ((0,_leight_i18n__WEBPACK_IMPORTED_MODULE_3__.isDateTime)(date)) {
    return date.toLocaleString(opts);
  }
  return _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.DateTime.fromJSDate(date).toLocaleString(opts);
};
var DateTimeStore = (0,_leight_context_client__WEBPACK_IMPORTED_MODULE_4__/* .createStoreContext */ .re)({
  state: () => () => ({
    toLocalDate(date, fallback, opts = _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.DateTime.DATE_MED) {
      return iso2locale(date, fallback, opts);
    },
    toLocalDateTime(date, fallback, opts = _leight_i18n__WEBPACK_IMPORTED_MODULE_2__.DateTime.DATETIME_MED) {
      return iso2locale(date, fallback, opts);
    }
  }),
  name: "DateTimeStore",
  hint: "Add DateTimeStore.Provider."
});
var DateTimeProvider = ({ ...props }) => {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    DateTimeStore.Provider,
    {
      ...props
    }
  );
};

// src/hook/useTranslation.ts

var useTranslation = (namespace) => {
  return (0,next_i18next__WEBPACK_IMPORTED_MODULE_5__.useTranslation)(Array.isArray(namespace) ? namespace.filter(Boolean) : namespace);
};

// src/ui/DateInline.tsx

var DateInline = ({ date, fallback, options, ...props }) => {
  const { toLocalDate } = DateTimeStore.useState(({ toLocalDate: toLocalDate2 }) => ({ toLocalDate: toLocalDate2 }));
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { ...props, children: toLocalDate(date, fallback, options) });
};

// src/ui/DateTimeInline.tsx

var DateTimeInline = ({ date, fallback, options }) => {
  const { toLocalDateTime } = DateTimeStore.useState(({ toLocalDateTime: toLocalDateTime2 }) => ({ toLocalDateTime: toLocalDateTime2 }));
  return /* @__PURE__ */ jsx3(Fragment, { children: toLocalDateTime(date, fallback, options) });
};

// src/Translation.tsx


var Translation = ({
  label,
  withLabel,
  namespace,
  withLabelFallback,
  values
}) => {
  const { t } = useTranslation(namespace);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: label ? (0,_leight_utils__WEBPACK_IMPORTED_MODULE_1__/* .isString */ .HD)(label) ? withLabelFallback ? (0,_leight_utils__WEBPACK_IMPORTED_MODULE_1__/* .isString */ .HD)(withLabel) ? t(
    withLabel ? `${label}.${withLabel}` : label,
    withLabelFallback,
    values
  ) : withLabel : t(withLabel ? `${label}.${withLabel}` : label, values) : label : (0,_leight_utils__WEBPACK_IMPORTED_MODULE_1__/* .isString */ .HD)(withLabel) ? t(withLabel) : withLabel });
};

//# sourceMappingURL=index.js.map

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 7680:
/***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "isDateTime": () => (/* binding */ isDateTime)
/* harmony export */ });
/* unused harmony exports RangeOfList, fromISO, rangeOf, withISO, wrapJsDate */
/* harmony import */ var luxon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2353);
/* harmony import */ var _leight_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5666);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([luxon__WEBPACK_IMPORTED_MODULE_0__]);
luxon__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
// src/utils/fromISO.ts

var fromISO = (input) => {
  return input ? DateTime.fromISO(input) : void 0;
};
var withISO = (input) => {
  return DateTime.fromISO(input);
};

// src/utils/isDateTime.ts

var isDateTime = (input) => {
  return (0,_leight_utils__WEBPACK_IMPORTED_MODULE_1__/* .isObject */ .Kn)(input) && "toJSDate" in input;
};

// src/utils/rangeOf.ts

var RangeOfList = (/* unused pure expression or super */ null && ([
  "none",
  "last-week",
  "last-month",
  "last-year",
  "current-week",
  "current-month",
  "current-year"
]));
var rangeOf = ({
  range
}) => {
  const now = DateTime2.now();
  switch (range) {
    case "last-week": {
      const date = now.startOf("week");
      const from = date.minus({ week: 1 });
      return {
        from,
        to: from.endOf("week")
      };
    }
    case "last-month": {
      const date = now.startOf("month");
      const from = date.minus({ month: 1 });
      return {
        from,
        to: from.endOf("month")
      };
    }
    case "last-year": {
      const date = now.startOf("year");
      const from = date.minus({ year: 1 });
      return {
        from,
        to: from.endOf("year")
      };
    }
    case "current-week": {
      const date = now.startOf("week");
      return {
        from: date,
        to: date.endOf("week")
      };
    }
    case "current-month": {
      const date = now.startOf("month");
      return {
        from: date,
        to: date.endOf("month")
      };
    }
    case "current-year": {
      const date = now.startOf("year");
      return {
        from: date,
        to: date.endOf("year")
      };
    }
  }
};

// src/utils/wrapJsDate.ts

var wrapJsDate = (input) => {
  return input ? DateTime3.fromISO(input)?.toJSDate() : void 0;
};

// src/index.ts


//# sourceMappingURL=index.js.map

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 9335:
/***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "$$": () => (/* binding */ withPrimaryColor),
/* harmony export */   "N2": () => (/* binding */ Shell),
/* harmony export */   "QJ": () => (/* binding */ withSecondaryPrimaryColor),
/* harmony export */   "rm": () => (/* binding */ switchScheme)
/* harmony export */ });
/* unused harmony exports DeleteModal, Drawer, DrawerButton, DrawerMenuItem, DrawerStore, DrawerStoreProvider, DropZone, Fulltext, MainMenu, MenuItem, MenuLabel, Modal, ModalMenuItem, ModalStore, ModalStoreProvider, PageShell, Paper, RouterTransition, TabLinkMenu, Upload, WithHighlight, WithIcon, withErrorNotification, withSuccessNotification */
/* harmony import */ var _mantine_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2247);
/* harmony import */ var _leight_context_client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7817);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(997);
/* harmony import */ var _mantine_dropzone__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7932);
/* harmony import */ var _mantine_notifications__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(914);
/* harmony import */ var _tabler_icons_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2236);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6689);
/* harmony import */ var _leight_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5666);
/* harmony import */ var next_auth_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1649);
/* harmony import */ var next_head__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(968);
/* harmony import */ var _mantine_nprogress__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7587);
/* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(1853);
/* harmony import */ var _leight_i18n_client__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(6994);
/* harmony import */ var _mantine_modals__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(1280);
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(9097);
/* harmony import */ var _mantine_hooks__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(32);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_leight_context_client__WEBPACK_IMPORTED_MODULE_2__, _leight_i18n_client__WEBPACK_IMPORTED_MODULE_13__]);
([_leight_context_client__WEBPACK_IMPORTED_MODULE_2__, _leight_i18n_client__WEBPACK_IMPORTED_MODULE_13__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
// src/button/DrawerButton.tsx



// src/context/DrawerStore.tsx


var DrawerStore = (0,_leight_context_client__WEBPACK_IMPORTED_MODULE_2__/* .createStoreContext */ .re)({
  state: () => (set) => ({
    isOpened: {},
    open: (id) => set((state) => ({
      isOpened: {
        ...state.isOpened,
        [id]: true
      }
    })),
    close: (id) => set((state) => ({
      isOpened: {
        ...state.isOpened,
        [id]: false
      }
    })),
    setOpen: (id, isOpened) => set((state) => ({
      isOpened: {
        ...state.isOpened,
        [id]: isOpened
      }
    }))
  }),
  name: "DrawerStore",
  hint: "Add DrawerStoreProvider"
});
var DrawerStoreProvider = ({ defaultOpened, ...props }) => {
  return /* @__PURE__ */ jsx(
    DrawerStore.Provider,
    {
      defaults: {
        isOpened: defaultOpened || {}
      },
      ...props
    }
  );
};

// src/context/ModalStore.tsx


var ModalStore = (0,_leight_context_client__WEBPACK_IMPORTED_MODULE_2__/* .createStoreContext */ .re)({
  state: () => (set) => ({
    isOpened: {},
    open: (id) => set((state) => ({
      isOpened: {
        ...state.isOpened,
        [id]: true
      }
    })),
    close: (id) => set((state) => ({
      isOpened: {
        ...state.isOpened,
        [id]: false
      }
    })),
    setOpen: (id, isOpened) => set((state) => ({
      isOpened: {
        ...state.isOpened,
        [id]: isOpened
      }
    }))
  }),
  name: "ModalStore",
  hint: "Add ModalStoreProvider"
});
var ModalStoreProvider = ({ defaultOpened, ...props }) => {
  return /* @__PURE__ */ jsx2(
    ModalStore.Provider,
    {
      defaults: {
        isOpened: defaultOpened || {}
      },
      ...props
    }
  );
};

// src/button/DrawerButton.tsx

var DrawerButton = ({ drawerId, withTranslation, label, ...props }) => {
  const { open } = DrawerStore.useState(({ open: open2 }) => ({ open: open2 }));
  return /* @__PURE__ */ jsx3(
    Button,
    {
      ...props,
      onClick: () => open(drawerId),
      children: /* @__PURE__ */ jsx3(Translation, { ...withTranslation, label: "drawer", withLabel: label })
    }
  );
};

// src/component/Drawer.tsx




// src/component/WithIcon.tsx


var WithIcon = ({ icon, ...props }) => {
  return icon ? /* @__PURE__ */ jsx4(
    ThemeIcon,
    {
      variant: "outline",
      color: "gray",
      sx: { border: "none" },
      ...props,
      children: icon
    }
  ) : null;
};

// src/component/Drawer.tsx

var Drawer = ({
  drawerId,
  icon,
  withTranslation,
  title,
  children,
  ...props
}) => {
  const { isOpened, close } = DrawerStore.useState(({ isOpened: isOpened2, close: close2 }) => ({ isOpened: isOpened2, close: close2 }));
  return /* @__PURE__ */ jsxs(
    CoolDrawer,
    {
      opened: isOpened[drawerId] || false,
      onClose: () => close(drawerId),
      position: "right",
      title: /* @__PURE__ */ jsxs(Group, { spacing: 4, children: [
        /* @__PURE__ */ jsx5(WithIcon, { icon }),
        /* @__PURE__ */ jsx5(Translation2, { ...withTranslation, withLabel: title })
      ] }),
      size: "lg",
      zIndex: 500,
      ...props,
      children: [
        /* @__PURE__ */ jsx5(Divider, {}),
        /* @__PURE__ */ jsx5(BlockProvider, { children })
      ]
    }
  );
};

// src/component/DropZone.tsx








// src/utils/index.tsx





var switchScheme = (theme, onDark, onLight) => theme.colorScheme === "dark" ? onDark : onLight;
var withPrimaryColor = (theme, offset = 0) => {
  return theme.colors[theme.primaryColor]?.[(0,_leight_utils__WEBPACK_IMPORTED_MODULE_7__/* .minMaxOf */ .Fl)({ value: theme.primaryShade + offset, max: 9 })];
};
var withSecondaryPrimaryColor = (theme, offset = 0) => {
  return theme.colors[theme.primaryColor]?.[(0,_leight_utils__WEBPACK_IMPORTED_MODULE_7__/* .minMaxOf */ .Fl)({ value: theme.primaryShade + offset, max: 9 }) >= 5 ? 0 : 9];
};
var withSuccessNotification = ({
  withTranslation,
  ...props
}) => {
  notifications.show({
    title: /* @__PURE__ */ jsx6(Translation3, { ...withTranslation, label: `${withTranslation.label}.success.title` }),
    message: /* @__PURE__ */ jsx6(Translation3, { ...withTranslation, label: `${withTranslation.label}.success.message` }),
    icon: /* @__PURE__ */ jsx6(IconCheck, { size: "1.1rem" }),
    color: "teal",
    ...props
  });
};
var withErrorNotification = ({
  withTranslation,
  ...props
}) => {
  notifications.show({
    title: /* @__PURE__ */ jsx6(Translation3, { ...withTranslation, label: `${withTranslation.label}.error.title` }),
    message: /* @__PURE__ */ jsx6(Translation3, { ...withTranslation, label: `${withTranslation.label}.error.message` }),
    icon: /* @__PURE__ */ jsx6(IconCross, { size: "1.1rem" }),
    color: "red",
    ...props
  });
};

// src/component/Upload.tsx



var Upload = ({ upload }) => {
  const { isRunning, isSuccess, isError, percent } = useUpload(upload);
  return /* @__PURE__ */ jsx7(
    Progress,
    {
      color: isError ? "red" : isRunning ? "blue" : isSuccess ? "green" : void 0,
      radius: "md",
      size: "md",
      value: percent(),
      animate: isRunning
    }
  );
};

// src/component/DropZone.tsx

var DropZone = ({
  withTranslation,
  path,
  limit = 5,
  onDrop = () => null,
  onUpload,
  ...props
}) => {
  const theme = useMantineTheme();
  const { t } = useTranslation(withTranslation.namespace);
  const [files, setFiles] = useState([]);
  const { current: loops } = LoopsStore.useState();
  useEffect(() => {
    if (files.length > 0 && !loops) {
      setTimeout(() => {
        notifications2.show({
          icon: /* @__PURE__ */ jsx8(IconCheck2, { size: "1.1rem" }),
          color: "teal",
          title: t("dropzone.upload.success.title"),
          message: t("dropzone.upload.success.message")
        });
        setFiles([]);
      }, 750);
    }
  }, [loops]);
  return /* @__PURE__ */ jsxs2(Fragment, { children: [
    !files.length && /* @__PURE__ */ jsx8(
      CoolDropzone,
      {
        maxSize: 8 * 1024 ** 2,
        onDrop: (files2) => {
          setFiles(files2.slice(0, limit));
          onDrop?.(files2, () => {
          });
        },
        ...props,
        children: /* @__PURE__ */ jsxs2(
          Group2,
          {
            position: "center",
            spacing: "xl",
            style: { minHeight: 220, pointerEvents: "none" },
            children: [
              /* @__PURE__ */ jsx8(CoolDropzone.Accept, { children: /* @__PURE__ */ jsx8(
                IconUpload,
                {
                  size: 50,
                  stroke: "1.5",
                  color: switchScheme(
                    theme,
                    theme.colors.green[4],
                    theme.colors.green[6]
                  )
                }
              ) }),
              /* @__PURE__ */ jsx8(CoolDropzone.Reject, { children: /* @__PURE__ */ jsx8(
                IconX,
                {
                  size: 50,
                  stroke: "1.5",
                  color: switchScheme(
                    theme,
                    theme.colors.red[4],
                    theme.colors.red[6]
                  )
                }
              ) }),
              /* @__PURE__ */ jsx8(CoolDropzone.Idle, { children: /* @__PURE__ */ jsx8(
                IconUpload,
                {
                  size: 50,
                  stroke: "1.5",
                  color: switchScheme(
                    theme,
                    theme.colors.gray[4],
                    theme.colors.gray[6]
                  )
                }
              ) }),
              /* @__PURE__ */ jsxs2("div", { children: [
                /* @__PURE__ */ jsx8(Text, { size: "xl", inline: true, children: /* @__PURE__ */ jsx8(Translation4, { ...withTranslation }) }),
                /* @__PURE__ */ jsx8(
                  Text,
                  {
                    size: "sm",
                    color: "dimmed",
                    inline: true,
                    mt: 7,
                    children: /* @__PURE__ */ jsx8(
                      Translation4,
                      {
                        ...withTranslation,
                        label: `${withTranslation.label}.hint`
                      }
                    )
                  }
                )
              ] })
            ]
          }
        )
      }
    ),
    files.length > 0 && /* @__PURE__ */ jsxs2(Fragment, { children: [
      /* @__PURE__ */ jsx8(Divider2, { m: "md" }),
      /* @__PURE__ */ jsxs2(Table, { fontSize: "xs", highlightOnHover: true, children: [
        /* @__PURE__ */ jsx8("thead", { children: /* @__PURE__ */ jsxs2("tr", { children: [
          /* @__PURE__ */ jsx8("th", { style: { width: "420px" }, children: /* @__PURE__ */ jsx8(
            Translation4,
            {
              ...withTranslation,
              label: `${withTranslation.label}.file`
            }
          ) }),
          /* @__PURE__ */ jsx8("th", { children: /* @__PURE__ */ jsx8(
            Translation4,
            {
              ...withTranslation,
              label: `${withTranslation.label}.progress`
            }
          ) })
        ] }) }),
        /* @__PURE__ */ jsx8("tbody", { children: files.map((file) => /* @__PURE__ */ jsx8(
          LoopProvider,
          {
            children: /* @__PURE__ */ jsxs2("tr", { children: [
              /* @__PURE__ */ jsx8("td", { children: file.path }),
              /* @__PURE__ */ jsx8("td", { children: /* @__PURE__ */ jsx8(
                Upload,
                {
                  upload: {
                    file,
                    path,
                    async onFinish({ file: file2 }) {
                      onUpload?.(file2);
                    }
                  }
                }
              ) })
            ] })
          },
          file.path
        )) })
      ] })
    ] })
  ] });
};

// src/component/Modal.tsx





var Modal = ({
  modalId,
  icon,
  withTranslation,
  title,
  children,
  ...props
}) => {
  const { isOpened, close } = ModalStore.useState(({ isOpened: isOpened2, close: close2 }) => ({ isOpened: isOpened2, close: close2 }));
  return /* @__PURE__ */ jsxs3(
    CoolModal,
    {
      opened: isOpened[modalId] ?? false,
      onClose: () => close(modalId),
      title: /* @__PURE__ */ jsxs3(Group3, { spacing: 4, children: [
        /* @__PURE__ */ jsx9(WithIcon, { icon }),
        isString(title) ? /* @__PURE__ */ jsx9(Translation5, { ...withTranslation, withLabel: title }) : title
      ] }),
      size: "lg",
      zIndex: 500,
      ...props,
      children: [
        /* @__PURE__ */ jsx9(Divider3, {}),
        /* @__PURE__ */ jsx9(BlockProvider2, { children })
      ]
    }
  );
};

// src/component/PageShell.tsx



// src/RouterTransition.tsx




function RouterTransition() {
  const router = useRouter();
  useEffect2(() => {
    const handleStart = (url) => url !== router.asPath && startNavigationProgress();
    const handleComplete = () => completeNavigationProgress();
    router.events.on("routeChangeStart", handleStart);
    router.events.on("routeChangeComplete", handleComplete);
    router.events.on("routeChangeError", handleComplete);
    return () => {
      router.events.off("routeChangeStart", handleStart);
      router.events.off("routeChangeComplete", handleComplete);
      router.events.off("routeChangeError", handleComplete);
    };
  }, [router.asPath]);
  return /* @__PURE__ */ jsx10(NavigationProgress, { autoReset: true });
}

// src/component/Shell.tsx





var Shell = ({ theme, emotionCache, children }) => {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(
    _mantine_core__WEBPACK_IMPORTED_MODULE_0__.MantineProvider,
    {
      theme: {
        colorScheme: "light",
        primaryColor: "green",
        primaryShade: 8,
        ...theme
      },
      withGlobalStyles: true,
      withNormalizeCSS: true,
      emotionCache,
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_mantine_modals__WEBPACK_IMPORTED_MODULE_12__.ModalsProvider, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_leight_i18n_client__WEBPACK_IMPORTED_MODULE_13__/* .DateTimeProvider */ .pk, { children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_mantine_notifications__WEBPACK_IMPORTED_MODULE_4__.Notifications, { position: "top-right" }),
        children
      ] }) })
    }
  );
};

// src/component/PageShell.tsx

var PageShell = ({
  title,
  Component,
  pageProps,
  ...props
}) => {
  return /* @__PURE__ */ jsxs5(Fragment2, { children: [
    /* @__PURE__ */ jsxs5(Head, { children: [
      /* @__PURE__ */ jsx12("title", { children: title }),
      /* @__PURE__ */ jsx12(
        "meta",
        {
          name: "viewport",
          content: "minimum-scale=1, initial-scale=1, width=device-width"
        }
      ),
      /* @__PURE__ */ jsx12("link", { rel: "shortcut icon", href: "/favicon.ico" })
    ] }),
    /* @__PURE__ */ jsx12(RouterTransition, {}),
    /* @__PURE__ */ jsx12(
      SessionProvider,
      {
        refetchInterval: 30,
        refetchOnWindowFocus: true,
        children: /* @__PURE__ */ jsx12(
          Shell,
          {
            ...props,
            children: (Component.layout || ((page) => page))(/* @__PURE__ */ jsx12(Component, { ...pageProps }))
          }
        )
      }
    )
  ] });
};

// src/component/Paper.tsx


var useStyles = (0,_mantine_core__WEBPACK_IMPORTED_MODULE_0__.createStyles)((theme) => ({
  paper: {
    "&:hover": {
      boxShadow: theme.shadows.lg
    }
  }
}));
var Paper = (props) => {
  const { classes } = useStyles();
  return /* @__PURE__ */ jsx13(
    CoolPaper,
    {
      shadow: "sm",
      className: classes.paper,
      radius: "md",
      withBorder: true,
      m: "md",
      p: "md",
      ...props
    }
  );
};

// src/component/TabLinkMenu.tsx





var TabLinkMenu = ({ active, items }) => {
  const router = useRouter2();
  return /* @__PURE__ */ jsx14(
    Tabs,
    {
      defaultValue: active || router.pathname,
      onTabChange: (href) => href && router.push(href),
      children: /* @__PURE__ */ jsx14(Tabs.List, { children: items.map(({ icon, href, withTranslation }) => /* @__PURE__ */ jsx14(
        Tabs.Tab,
        {
          icon: /* @__PURE__ */ jsx14(WithIcon, { icon }),
          value: toHref(href),
          children: withTranslation && /* @__PURE__ */ jsx14(Translation6, { ...withTranslation })
        },
        href.href
      )) })
    }
  );
};

// src/menu/MenuItem.tsx



var MenuItem = ({ withTranslation, ...props }) => {
  return /* @__PURE__ */ jsx15(
    Menu.Item,
    {
      ...props,
      children: /* @__PURE__ */ jsx15(Translation7, { ...withTranslation })
    }
  );
};

// src/menu/DrawerMenuItem.tsx

var DrawerMenuItem = ({ drawerId, ...props }) => {
  const { open } = DrawerStore.useState(({ open: open2 }) => ({ open: open2 }));
  return /* @__PURE__ */ jsx16(
    MenuItem,
    {
      onClick: () => open(drawerId),
      ...props
    }
  );
};

// src/menu/MainMenu.tsx





var useStyles2 = (0,_mantine_core__WEBPACK_IMPORTED_MODULE_0__.createStyles)((theme) => ({
  link: {
    display: "flex",
    alignItems: "center",
    height: "50%",
    margin: theme.spacing.xs,
    paddingLeft: theme.spacing.md,
    paddingRight: theme.spacing.md,
    textDecoration: "none",
    fontWeight: 500,
    fontSize: theme.fontSizes.md,
    color: switchScheme(theme, theme.white, theme.black),
    "&:hover": {
      borderBottom: "1px solid",
      borderBottomColor: switchScheme(
        theme,
        theme.colors.dark[4],
        withPrimaryColor(theme)
      )
    }
  },
  linkActive: {
    "&, &:hover": {
      fontWeight: "bold",
      borderBottom: "2px solid",
      borderBottomColor: switchScheme(
        theme,
        theme.colors.dark[4],
        withPrimaryColor(theme)
      )
    }
  }
}));
var MainMenu = ({
  links,
  active,
  withTranslation
}) => {
  const router = useRouter3();
  const { classes, cx } = useStyles2();
  const $active = active || router.pathname;
  return /* @__PURE__ */ jsx17(
    Group4,
    {
      sx: { height: "100%" },
      spacing: 0,
      children: Object.entries(links).map(([id, link]) => /* @__PURE__ */ jsx17(
        Link,
        {
          href: link.href,
          className: cx(classes.link, {
            [classes.linkActive]: $active.includes(link.href)
          }),
          children: /* @__PURE__ */ jsxs6(
            Group4,
            {
              position: "apart",
              children: [
                /* @__PURE__ */ jsx17(
                  WithIcon,
                  {
                    icon: link.icon
                  }
                ),
                /* @__PURE__ */ jsx17(
                  Translation8,
                  {
                    ...withTranslation,
                    label: link.label || id
                  }
                )
              ]
            }
          )
        },
        id
      ))
    }
  );
};

// src/menu/MenuLabel.tsx



var MenuLabel = ({ withTranslation, ...props }) => {
  return /* @__PURE__ */ jsx18(
    Menu2.Label,
    {
      ...props,
      children: /* @__PURE__ */ jsx18(Translation9, { ...withTranslation })
    }
  );
};

// src/menu/ModalMenuItem.tsx

var ModalMenuItem = ({ modalId, ...props }) => {
  const { open } = ModalStore.useState(({ open: open2 }) => ({ open: open2 }));
  return /* @__PURE__ */ jsx19(
    MenuItem,
    {
      onClick: () => open(modalId),
      ...props
    }
  );
};

// src/ui/DeleteModal.tsx




var DeleteModal = ({
  invalidator,
  withTranslation,
  SourceStore,
  entity,
  ...props
}) => {
  const { close } = ModalStore.useState(({ close: close2 }) => ({ close: close2 }));
  const deleteMutation = SourceStore.use.useDelete();
  return /* @__PURE__ */ jsxs7(
    Modal,
    {
      withTranslation: {
        ...withTranslation,
        label: withTranslation?.label ? `${withTranslation.label}.delete` : "delete"
      },
      closeOnClickOutside: !deleteMutation.isLoading,
      title: "title",
      ...props,
      children: [
        /* @__PURE__ */ jsx20(Divider4, { mb: "sm" }),
        /* @__PURE__ */ jsx20(Translation10, { ...withTranslation, withLabel: "delete.content", values: entity }),
        /* @__PURE__ */ jsx20(Divider4, { mt: "sm", mb: "sm" }),
        /* @__PURE__ */ jsxs7(Group5, { position: "apart", children: [
          /* @__PURE__ */ jsx20(
            Button2,
            {
              size: "md",
              color: "blue",
              variant: "outline",
              disabled: deleteMutation.isLoading,
              onClick: () => close(props.modalId),
              children: /* @__PURE__ */ jsx20(Translation10, { namespace: "common", label: "cancel.button" })
            }
          ),
          /* @__PURE__ */ jsx20(
            Button2,
            {
              size: "lg",
              color: "red",
              leftIcon: /* @__PURE__ */ jsx20(IconTrash, {}),
              loading: deleteMutation.isLoading,
              onClick: () => {
                deleteMutation.mutate({
                  id: entity.id
                }, {
                  onSuccess: (dto) => {
                    invalidator();
                    withSuccessNotification({
                      withTranslation: {
                        ...withTranslation,
                        label: withTranslation?.label ? `${withTranslation.label}.delete` : "delete",
                        values: dto
                      }
                    });
                  },
                  onSettled: () => close(props.modalId)
                });
              },
              children: /* @__PURE__ */ jsx20(Translation10, { ...withTranslation, withLabel: "delete.confirm.button" })
            }
          )
        ] })
      ]
    }
  );
};

// src/ui/Fulltext.tsx








var Fulltext = ({
  SourceStore,
  loading,
  debounce = 500,
  withTranslation,
  onSearch,
  ...props
}) => {
  const { t } = useTranslation2(withTranslation?.namespace);
  const { fulltext, setFulltext } = FulltextStoreContext.useState(({ fulltext: fulltext2, setFulltext: setFulltext2 }) => ({ fulltext: fulltext2, setFulltext: setFulltext2 }));
  const { setPage } = SourceStore.Query.useState(({ setPage: setPage2 }) => ({ setPage: setPage2 }));
  const [debounced, setDebounced] = useDebouncedState(fulltext || "", debounce);
  useEffect3(() => {
    setFulltext(debounced || void 0);
    onSearch?.(debounced || void 0);
    setPage(0);
  }, [debounced]);
  return /* @__PURE__ */ jsx21(
    TextInput,
    {
      autoFocus: true,
      defaultValue: fulltext || void 0,
      onChange: (event) => setDebounced(event.currentTarget.value),
      placeholder: t(`${withTranslation?.label || "table"}.fulltext.placeholder`),
      icon: loading ? /* @__PURE__ */ jsx21(Loader, { size: "xs" }) : /* @__PURE__ */ jsx21(WithIcon, { icon: /* @__PURE__ */ jsx21(IconSearch, {}) }),
      rightSection: fulltext ? /* @__PURE__ */ jsx21(
        ActionIcon,
        {
          onClick: () => setFulltext(""),
          children: /* @__PURE__ */ jsx21(WithIcon, { icon: /* @__PURE__ */ jsx21(IconX2, {}) })
        }
      ) : void 0,
      ...props
    },
    generateId()
  );
};

// src/ui/WithHighlight.tsx


var WithHighlight = ({ text, ...props }) => {
  return text ? /* @__PURE__ */ jsx22(
    Highlight,
    {
      ...props,
      children: text
    }
  ) : null;
};

//# sourceMappingURL=index.js.map

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 8972:
/***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "AK": () => (/* binding */ classNames),
/* harmony export */   "G": () => (/* binding */ BlockStore),
/* harmony export */   "ZJ": () => (/* binding */ BlockProvider)
/* harmony export */ });
/* unused harmony exports LoopProvider, LoopStore, LoopsProvider, LoopsStore, toHref, useChunk, useLoop */
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9003);
/* harmony import */ var _leight_context_client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7817);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(997);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6689);
/* harmony import */ var path_to_regexp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(99);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_leight_context_client__WEBPACK_IMPORTED_MODULE_2__]);
_leight_context_client__WEBPACK_IMPORTED_MODULE_2__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
// src/index.ts


// src/context/BlockStore.tsx


var BlockStore = (0,_leight_context_client__WEBPACK_IMPORTED_MODULE_2__/* .createStoreContext */ .re)({
  state: () => (set) => ({
    isBlock: false,
    block: (block = true) => {
      set({ isBlock: block });
    },
    unblock: () => {
      set({ isBlock: false });
    }
  }),
  name: "BlockStore",
  hint: "Add BlockProvider."
});
var BlockProvider = ({ isBlock = false, ...props }) => {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(
    BlockStore.Provider,
    {
      defaults: { isBlock },
      ...props
    }
  );
};

// src/context/LoopStore.tsx


var LoopStore = (0,_leight_context_client__WEBPACK_IMPORTED_MODULE_2__/* .createStoreContext */ .re)({
  state: () => (set, get) => ({
    total: 0,
    isRunning: false,
    isDone: false,
    isError: false,
    isSuccess: false,
    current: 0,
    progress: () => set(({ current }) => ({ current: current + 1 })),
    start: (total) => set({ isRunning: true, total }),
    finish: (withError = false) => set({
      isDone: true,
      isRunning: false,
      isError: withError,
      isSuccess: !withError
    }),
    error: (isError = true) => set({ isError, isSuccess: !isError }),
    percent: () => {
      const { current, total } = get();
      return 100 * current / total;
    }
  }),
  name: "LoopStore",
  hint: "Add LoopProvider."
});
var LoopProvider = (props) => {
  return /* @__PURE__ */ jsx2(
    LoopStore.Provider,
    {
      ...props
    }
  );
};

// src/context/LoopsStore.tsx


var LoopsStore = (0,_leight_context_client__WEBPACK_IMPORTED_MODULE_2__/* .createStoreContext */ .re)({
  state: () => (set, get) => ({
    current: 0,
    isRunning() {
      return get().current > 0;
    },
    inc: () => set(({ current }) => ({ current: current + 1 })),
    dec: () => set(({ current }) => ({ current: current - 1 }))
  }),
  name: "LoopsStore",
  hint: "Add LoopsProvider."
});
var LoopsProvider = (props) => {
  return /* @__PURE__ */ jsx3(
    LoopsStore.Provider,
    {
      ...props
    }
  );
};

// src/hook/useLoop.ts

var useLoop = ({
  total,
  throttle = 0,
  onStart = () => Promise.resolve(),
  onTick,
  onError = () => Promise.resolve(),
  onFinish = () => Promise.resolve()
}) => {
  const isMountedRef = useRef(false);
  const loopState = LoopStore.useState();
  const loopsState = LoopsStore.useOptionalState();
  useEffect(() => {
    if (isMountedRef.current || loopState.isRunning) {
      return;
    }
    isMountedRef.current = true;
    loopState.start(total);
    loopsState?.inc();
    (async () => {
      try {
        await onStart({ total });
      } catch (e) {
        console.error(e);
      }
    })();
  }, []);
  useEffect(() => {
    if (!loopState.isRunning) {
      return;
    }
    if (loopState.current === total) {
      onFinish?.({}).then(() => loopState.finish()).catch((e) => {
        console.error(e);
        loopState.finish(true);
        onError(e);
      }).finally(() => {
        loopsState?.dec();
      });
      return;
    }
    setTimeout(() => {
      onTick({
        current: loopState.current,
        total,
        percent: loopState.percent()
      }).then(() => loopState.progress()).catch((e) => {
        loopsState?.dec();
        console.error(e);
        loopState.finish(true);
        onError(e);
      });
    }, throttle);
  }, [
    loopState.isRunning,
    loopState.current
  ]);
  return loopState;
};

// src/hook/useChunk.ts
var useChunk = ({
  size,
  throttle,
  chunk,
  onStart,
  onTick,
  onFinish,
  onError
}) => {
  return useLoop({
    total: Math.ceil(size / chunk),
    throttle,
    onStart,
    async onTick({ total, current, percent }) {
      return onTick({
        start: current * chunk,
        end: Math.min(current * chunk + chunk, size),
        total,
        current,
        size,
        percent
      });
    },
    onFinish,
    onError
  });
};

// src/toHref.ts

var toHref = ({
  href,
  query
}) => {
  return href === "/" ? href : compile(href.replace(/\[(.*?)\]/g, ":$1").replace(/{(.*?)}/g, ":$1"))(
    query || {}
  );
};

// src/index.ts
var classNames = classnames__WEBPACK_IMPORTED_MODULE_0__;

//# sourceMappingURL=index.js.map

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 5666:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Fl": () => (/* binding */ minMaxOf),
/* harmony export */   "GV": () => (/* binding */ isCallable),
/* harmony export */   "HD": () => (/* binding */ isString),
/* harmony export */   "Kn": () => (/* binding */ isObject),
/* harmony export */   "Ox": () => (/* binding */ generateId),
/* harmony export */   "ls": () => (/* binding */ withBool)
/* harmony export */ });
/* unused harmony exports Pack, chain, cleanOf, diffOf, intersectOf, keywordsOf, toHumanBytes, toHumanNumber, toPercent */
/* harmony import */ var fast_clean__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3281);
/* harmony import */ var _paralleldrive_cuid2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3303);
/* harmony import */ var is_callable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2789);
/* harmony import */ var is_object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3460);
/* harmony import */ var is_string__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(550);
/* harmony import */ var filesize__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9716);
// src/utils/chain.ts
var chain = (value, chain2) => {
  if (!chain2.length) {
    console.warn("Chain does not have chaining values (an empty array).");
    return value;
  }
  const index = chain2.indexOf(value);
  if (index === -1) {
    return chain2[0];
  } else if (index + 1 === chain2.length) {
    return chain2[0];
  }
  return chain2[index + 1];
};

// src/utils/cleanOf.ts

var cleanOf = (obj, options) => cleaner.clean(obj || {}, {
  nullCleaner: false,
  ...options
});

// src/utils/diffOf.ts
var diffOf = (alfa, beta) => alfa.filter((x) => !beta.includes(x));

// src/utils/generateId.ts

var generateId = _paralleldrive_cuid2__WEBPACK_IMPORTED_MODULE_1__.createId;

// src/utils/intersectOf.ts
var intersectOf = (alfa, beta) => alfa.filter((x) => beta.includes(x));

// src/utils/isCallable.ts

var isCallable = (val) => is_callable__WEBPACK_IMPORTED_MODULE_2__(val);

// src/utils/isObject.ts

var isObject = is_object__WEBPACK_IMPORTED_MODULE_3__;

// src/utils/isString.ts

var isString = (val) => is_string__WEBPACK_IMPORTED_MODULE_4__(val);

// src/utils/keywordsOf.tsx
var keywordsOf = (keywords) => {
  if (!keywords) {
    return void 0;
  }
  return keywords.split(/\s+/g).map((item) => item.trim()).filter(Boolean);
};

// src/utils/minMaxOf.ts
var minMaxOf = ({ min = 0, max, value }) => {
  return Math.min(Math.max(value, min), max);
};

// src/utils/Pack.ts
var Pack = class {
  static async pack(input) {
    return Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 4482)).then(({ stringify }) => stringify(input));
  }
  static async unpack(input) {
    return Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 4482)).then(({ parse }) => parse(input));
  }
};

// src/utils/toHumanBytes.ts

var toHumanBytes = (size) => filesize(size);

// src/utils/toHumanNumber.ts
function toHumanNumber({ number, empty = "-", fraction = 2 }) {
  if (number === null || number === void 0) {
    return empty;
  }
  try {
    return number.toLocaleString(void 0, {
      maximumFractionDigits: fraction
    });
  } catch (e) {
    console.error("toHumanNumber", number, e);
    return number.toFixed(2);
  }
}

// src/utils/toPercent.ts
var toPercent = (value, total) => 100 * value / total;

// src/utils/withBool.ts
var withBool = (boolish, fallback) => {
  return boolish === void 0 ? fallback : boolish;
};

//# sourceMappingURL=index.js.map


/***/ })

};
;