wcz-test 6.20.0 → 6.22.0

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 (42) hide show
  1. package/dist/{DialogsHooks-Bi8dZoyu.js → DialogsContext-DMZRefiY.js} +3 -35
  2. package/dist/DialogsContext-DMZRefiY.js.map +1 -0
  3. package/dist/DialogsHooks-DBK6rBoU.js +37 -0
  4. package/dist/DialogsHooks-DBK6rBoU.js.map +1 -0
  5. package/dist/{FileHooks-hWKTwLCr.js → FileHooks-BM2Oyvh6.js} +2 -3
  6. package/dist/FileHooks-BM2Oyvh6.js.map +1 -0
  7. package/dist/{RouterListItemButton-CHS7rofI.js → RouterListItemButton-Vj6OoqkV.js} +2 -2
  8. package/dist/{RouterListItemButton-CHS7rofI.js.map → RouterListItemButton-Vj6OoqkV.js.map} +1 -1
  9. package/dist/UseHook-DB7btKDE.js +11 -0
  10. package/dist/UseHook-DB7btKDE.js.map +1 -0
  11. package/dist/client.d.ts +0 -705
  12. package/dist/client.js +2 -4
  13. package/dist/client.js.map +1 -1
  14. package/dist/components.js +4 -3
  15. package/dist/components.js.map +1 -1
  16. package/dist/hooks.d.ts +15 -0
  17. package/dist/hooks.js +5 -3
  18. package/dist/hooks.js.map +1 -1
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.js +145 -54
  21. package/dist/index.js.map +1 -1
  22. package/dist/models.d.ts +0 -9
  23. package/dist/queries.js +2 -3
  24. package/dist/queries.js.map +1 -1
  25. package/dist/server.d.ts +0 -36
  26. package/dist/server.js +1 -8732
  27. package/dist/server.js.map +1 -1
  28. package/dist/{utils-DKyKGba7.js → utils-CKW5pi6k.js} +21 -2
  29. package/dist/utils-CKW5pi6k.js.map +1 -0
  30. package/dist/utils.js +1 -1
  31. package/package.json +117 -120
  32. package/dist/DialogsHooks-Bi8dZoyu.js.map +0 -1
  33. package/dist/FileHooks-hWKTwLCr.js.map +0 -1
  34. package/dist/auth-client-B6cIXYDV.js +0 -1417
  35. package/dist/auth-client-B6cIXYDV.js.map +0 -1
  36. package/dist/env-CoxTjaDr.js +0 -27
  37. package/dist/env-CoxTjaDr.js.map +0 -1
  38. package/dist/error-BhAKg8LX-X0sdNXNa.js +0 -195
  39. package/dist/error-BhAKg8LX-X0sdNXNa.js.map +0 -1
  40. package/dist/server-mxQ3s5dx-CC81W42s.js +0 -644
  41. package/dist/server-mxQ3s5dx-CC81W42s.js.map +0 -1
  42. package/dist/utils-DKyKGba7.js.map +0 -1
@@ -1,6 +1,4 @@
1
- import React, { createContext, useContext } from "react";
2
- import { useEventCallback, Dialog, DialogTitle, DialogContent, DialogActions, Button } from "@mui/material";
3
- import { useTranslation } from "react-i18next";
1
+ import React, { createContext } from "react";
4
2
  var jsxRuntime = { exports: {} };
5
3
  var reactJsxRuntime_production = {};
6
4
  var hasRequiredReactJsxRuntime_production;
@@ -301,38 +299,8 @@ function requireJsxRuntime() {
301
299
  }
302
300
  var jsxRuntimeExports = requireJsxRuntime();
303
301
  const DialogsContext = createContext({});
304
- function AlertDialog({ open, payload, onClose }) {
305
- const { t } = useTranslation();
306
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(), disableRestoreFocus: true, children: [
307
- /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { children: payload.title ?? t("Layout.Dialog.Alert") }),
308
- /* @__PURE__ */ jsxRuntimeExports.jsx(DialogContent, { children: payload.message }),
309
- /* @__PURE__ */ jsxRuntimeExports.jsx(DialogActions, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => onClose(), autoFocus: true, children: t("Layout.Dialog.Confirm") }) })
310
- ] });
311
- }
312
- function ConfirmDialog({ open, payload, onClose }) {
313
- const { t } = useTranslation();
314
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(false), disableRestoreFocus: true, children: [
315
- /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { children: payload.title ?? t("Layout.Dialog.Confirm") }),
316
- /* @__PURE__ */ jsxRuntimeExports.jsx(DialogContent, { children: payload.message }),
317
- /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogActions, { children: [
318
- /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => onClose(false), children: payload.cancelText ?? t("Layout.Dialog.Cancel") }),
319
- /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => onClose(true), autoFocus: true, children: t("Layout.Dialog.Confirm") })
320
- ] })
321
- ] });
322
- }
323
- function useDialogs() {
324
- const { open, close } = useContext(DialogsContext);
325
- const alert = useEventCallback(
326
- (message, { ...options } = {}) => open(AlertDialog, { ...options, message })
327
- );
328
- const confirm = useEventCallback(
329
- (message, { ...options } = {}) => open(ConfirmDialog, { ...options, message })
330
- );
331
- return { alert, confirm, open, close };
332
- }
333
302
  export {
334
303
  DialogsContext as D,
335
- jsxRuntimeExports as j,
336
- useDialogs as u
304
+ jsxRuntimeExports as j
337
305
  };
338
- //# sourceMappingURL=DialogsHooks-Bi8dZoyu.js.map
306
+ //# sourceMappingURL=DialogsContext-DMZRefiY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogsContext-DMZRefiY.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../src/contexts/DialogsContext.ts"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import { createContext } from \"react\";\nimport type { CloseDialog, OpenDialog } from \"../hooks/DialogsHooks\";\n\nexport interface DialogsContextValue {\n open: OpenDialog;\n close: CloseDialog;\n}\n\nexport const DialogsContext = createContext<DialogsContextValue>({} as DialogsContextValue);"],"names":["React","require$$0","jsxRuntimeModule","require$$1"],"mappings":";;;;;;;AAWA,MAAI,qBAAqB,OAAO,IAAI,4BAA4B,GAC9D,sBAAsB,OAAO,IAAI,gBAAgB;AACnD,WAAS,QAAQ,MAAM,QAAQ,UAAU;AACvC,QAAI,MAAM;AACV,eAAW,aAAa,MAAM,KAAK;AACnC,eAAW,OAAO,QAAQ,MAAM,KAAK,OAAO;AAC5C,QAAI,SAAS,QAAQ;AACnB,iBAAW,CAAA;AACX,eAAS,YAAY;AACnB,kBAAU,aAAa,SAAS,QAAQ,IAAI,OAAO,QAAQ;AAAA,IACjE,MAAS,YAAW;AAClB,aAAS,SAAS;AAClB,WAAO;AAAA,MACL,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,KAAK,WAAW,SAAS,SAAS;AAAA,MAClC,OAAO;AAAA;EAEX;AACA,6BAAA,WAAmB;AACnB,6BAAA,MAAc;AACd,6BAAA,OAAe;;;;;;;;ACtBf,mBAAiB,QAAQ,IAAI,aAC1B,WAAY;AACX,aAAS,yBAAyB,MAAM;AACtC,UAAI,QAAQ,KAAM,QAAO;AACzB,UAAI,eAAe,OAAO;AACxB,eAAO,KAAK,aAAa,yBACrB,OACA,KA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QAAQ,UAAU;AAC/C,UAAI,mBACF,MAAM,qBAAqB;AAC7B,aAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,mBACI,MAAM,uBAAuB,IAC7B;AAAA,QACJ,mBAAmB,WAAW,YAAY,IAAI,CAAC,IAAI;AAAA;IAE3D;AAAA,EACA,GAAG;;;;;;;AC7VH,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzCE,eAAA,UAAiBD,kCAAA;AAAA,EACnB,OAAO;AACLC,eAAA,UAAiBC,mCAAA;AAAA,EACnB;;;;ACEO,MAAM,iBAAiB,cAAmC,CAAA,CAAyB;","x_google_ignoreList":[0,1,2]}
@@ -0,0 +1,37 @@
1
+ import { D as DialogsContext, j as jsxRuntimeExports } from "./DialogsContext-DMZRefiY.js";
2
+ import { useEventCallback, Dialog, DialogTitle, DialogContent, DialogActions, Button } from "@mui/material";
3
+ import { useContext } from "react";
4
+ import { useTranslation } from "react-i18next";
5
+ function AlertDialog({ open, payload, onClose }) {
6
+ const { t } = useTranslation();
7
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(), disableRestoreFocus: true, children: [
8
+ /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { children: payload.title ?? t("Layout.Dialog.Alert") }),
9
+ /* @__PURE__ */ jsxRuntimeExports.jsx(DialogContent, { children: payload.message }),
10
+ /* @__PURE__ */ jsxRuntimeExports.jsx(DialogActions, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => onClose(), autoFocus: true, children: t("Layout.Dialog.Confirm") }) })
11
+ ] });
12
+ }
13
+ function ConfirmDialog({ open, payload, onClose }) {
14
+ const { t } = useTranslation();
15
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(false), disableRestoreFocus: true, children: [
16
+ /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { children: payload.title ?? t("Layout.Dialog.Confirm") }),
17
+ /* @__PURE__ */ jsxRuntimeExports.jsx(DialogContent, { children: payload.message }),
18
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogActions, { children: [
19
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => onClose(false), children: payload.cancelText ?? t("Layout.Dialog.Cancel") }),
20
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => onClose(true), autoFocus: true, children: t("Layout.Dialog.Confirm") })
21
+ ] })
22
+ ] });
23
+ }
24
+ function useDialogs() {
25
+ const { open, close } = useContext(DialogsContext);
26
+ const alert = useEventCallback(
27
+ (message, { ...options } = {}) => open(AlertDialog, { ...options, message })
28
+ );
29
+ const confirm = useEventCallback(
30
+ (message, { ...options } = {}) => open(ConfirmDialog, { ...options, message })
31
+ );
32
+ return { alert, confirm, open, close };
33
+ }
34
+ export {
35
+ useDialogs as u
36
+ };
37
+ //# sourceMappingURL=DialogsHooks-DBK6rBoU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogsHooks-DBK6rBoU.js","sources":["../src/hooks/DialogsHooks.tsx"],"sourcesContent":["import { Button, Dialog, DialogActions, DialogContent, DialogTitle, useEventCallback } from \"@mui/material\";\nimport { useContext } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { DialogsContext } from \"../contexts/DialogsContext\";\nimport type { ReactNode } from \"react\";\n\nexport interface OpenDialogOptions<TResult> {\n onClose?: (result: TResult) => Promise<void>;\n}\n\nexport interface AlertOptions {\n title?: ReactNode;\n}\n\nexport interface ConfirmOptions {\n title?: ReactNode;\n cancelText?: ReactNode;\n}\n\nexport interface DialogProps<TPayload = undefined, TResult = void> {\n payload: TPayload;\n open: boolean;\n onClose: (result: TResult) => Promise<void>;\n}\n\nexport type OpenAlertDialog = (message: ReactNode, options?: AlertOptions) => Promise<void>;\n\nexport type OpenConfirmDialog = (message: ReactNode, options?: ConfirmOptions) => Promise<boolean>;\n\nexport type DialogComponent<TPayload, TResult> = React.ComponentType<DialogProps<TPayload, TResult>>;\n\nexport interface OpenDialog {\n <TPayload extends undefined, TResult>(Component: DialogComponent<TPayload, TResult>, payload?: TPayload, options?: OpenDialogOptions<TResult>): Promise<TResult>;\n <TPayload, TResult>(Component: DialogComponent<TPayload, TResult>, payload: TPayload, options?: OpenDialogOptions<TResult>): Promise<TResult>;\n}\n\nexport type CloseDialog = <TResult>(dialog: Promise<TResult>, result: TResult) => Promise<TResult>;\n\nexport interface AlertDialogPayload extends AlertOptions {\n message: ReactNode;\n}\n\nexport type AlertDialogProps = DialogProps<AlertDialogPayload, void>\n\nexport function AlertDialog({ open, payload, onClose }: Readonly<AlertDialogProps>) {\n const { t } = useTranslation();\n\n return (\n <Dialog maxWidth=\"xs\" fullWidth open={open} onClose={() => onClose()} disableRestoreFocus>\n <DialogTitle>{payload.title ?? t(\"Layout.Dialog.Alert\")}</DialogTitle>\n <DialogContent>{payload.message}</DialogContent>\n <DialogActions>\n <Button onClick={() => onClose()} autoFocus>\n {t(\"Layout.Dialog.Confirm\")}\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n\nexport interface ConfirmDialogPayload extends ConfirmOptions {\n message: ReactNode;\n}\n\nexport type ConfirmDialogProps = DialogProps<ConfirmDialogPayload, boolean>\n\nexport function ConfirmDialog({ open, payload, onClose }: Readonly<ConfirmDialogProps>) {\n const { t } = useTranslation();\n\n return (\n <Dialog maxWidth=\"xs\" fullWidth open={open} onClose={() => onClose(false)} disableRestoreFocus>\n <DialogTitle>{payload.title ?? t(\"Layout.Dialog.Confirm\")}</DialogTitle>\n <DialogContent>{payload.message}</DialogContent>\n <DialogActions>\n <Button onClick={() => onClose(false)}>\n {payload.cancelText ?? t(\"Layout.Dialog.Cancel\")}\n </Button>\n <Button onClick={() => onClose(true)} autoFocus>\n {t(\"Layout.Dialog.Confirm\")}\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n\ninterface DialogHook {\n alert: OpenAlertDialog;\n confirm: OpenConfirmDialog;\n open: OpenDialog;\n close: CloseDialog;\n}\n\nexport function useDialogs(): DialogHook {\n const { open, close } = useContext(DialogsContext);\n\n const alert = useEventCallback<OpenAlertDialog>((message, { ...options } = {}) =>\n open(AlertDialog, { ...options, message }),\n );\n\n const confirm = useEventCallback<OpenConfirmDialog>((message, { ...options } = {}) =>\n open(ConfirmDialog, { ...options, message }),\n );\n\n return { alert, confirm, open, close };\n}\n"],"names":["jsxs","jsx"],"mappings":";;;;AA4CO,SAAS,YAAY,EAAE,MAAM,SAAS,WAAuC;AAChF,QAAM,EAAE,EAAA,IAAM,eAAA;AAEd,SACIA,kCAAAA,KAAC,QAAA,EAAO,UAAS,MAAK,WAAS,MAAC,MAAY,SAAS,MAAM,QAAA,GAAW,qBAAmB,MACrF,UAAA;AAAA,IAAAC,sCAAC,aAAA,EAAa,UAAA,QAAQ,SAAS,EAAE,qBAAqB,GAAE;AAAA,IACxDA,kCAAAA,IAAC,eAAA,EAAe,UAAA,QAAQ,QAAA,CAAQ;AAAA,IAChCA,kCAAAA,IAAC,eAAA,EACG,UAAAA,kCAAAA,IAAC,QAAA,EAAO,SAAS,MAAM,QAAA,GAAW,WAAS,MACtC,UAAA,EAAE,uBAAuB,GAC9B,EAAA,CACJ;AAAA,EAAA,GACJ;AAER;AAQO,SAAS,cAAc,EAAE,MAAM,SAAS,WAAyC;AACpF,QAAM,EAAE,EAAA,IAAM,eAAA;AAEd,SACID,kCAAAA,KAAC,QAAA,EAAO,UAAS,MAAK,WAAS,MAAC,MAAY,SAAS,MAAM,QAAQ,KAAK,GAAG,qBAAmB,MAC1F,UAAA;AAAA,IAAAC,sCAAC,aAAA,EAAa,UAAA,QAAQ,SAAS,EAAE,uBAAuB,GAAE;AAAA,IAC1DA,kCAAAA,IAAC,eAAA,EAAe,UAAA,QAAQ,QAAA,CAAQ;AAAA,2CAC/B,eAAA,EACG,UAAA;AAAA,MAAAA,kCAAAA,IAAC,QAAA,EAAO,SAAS,MAAM,QAAQ,KAAK,GAC/B,UAAA,QAAQ,cAAc,EAAE,sBAAsB,EAAA,CACnD;AAAA,MACAA,kCAAAA,IAAC,QAAA,EAAO,SAAS,MAAM,QAAQ,IAAI,GAAG,WAAS,MAC1C,UAAA,EAAE,uBAAuB,EAAA,CAC9B;AAAA,IAAA,EAAA,CACJ;AAAA,EAAA,GACJ;AAER;AASO,SAAS,aAAyB;AACrC,QAAM,EAAE,MAAM,UAAU,WAAW,cAAc;AAEjD,QAAM,QAAQ;AAAA,IAAkC,CAAC,SAAS,EAAE,GAAG,YAAY,CAAA,MACvE,KAAK,aAAa,EAAE,GAAG,SAAS,SAAS;AAAA,EAAA;AAG7C,QAAM,UAAU;AAAA,IAAoC,CAAC,SAAS,EAAE,GAAG,YAAY,CAAA,MAC3E,KAAK,eAAe,EAAE,GAAG,SAAS,SAAS;AAAA,EAAA;AAG/C,SAAO,EAAE,OAAO,SAAS,MAAM,MAAA;AACnC;"}
@@ -5,8 +5,7 @@ import { Upload } from "tus-js-client";
5
5
  import { uuidv7 } from "uuidv7";
6
6
  import z__default from "zod";
7
7
  import { F as FileMetaSchema } from "./FileMeta-G1oT3mYK.js";
8
- import { t as toKebabCase, h as httpClient } from "./utils-DKyKGba7.js";
9
- import { c as clientEnv } from "./env-CoxTjaDr.js";
8
+ import { t as toKebabCase, h as httpClient, c as clientEnv } from "./utils-CKW5pi6k.js";
10
9
  const QUERY_KEY = "file";
11
10
  const HOUR = 1e3 * 60 * 60;
12
11
  const APP_NAME = toKebabCase(clientEnv.VITE_APP_TITLE);
@@ -192,4 +191,4 @@ export {
192
191
  useUploadFile as h,
193
192
  useGetFileMetas as u
194
193
  };
195
- //# sourceMappingURL=FileHooks-hWKTwLCr.js.map
194
+ //# sourceMappingURL=FileHooks-BM2Oyvh6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileHooks-BM2Oyvh6.js","sources":["../src/queries/FileHooks.ts"],"sourcesContent":["import { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\r\nimport saveAs from \"file-saver\";\r\nimport { useState } from \"react\";\r\nimport { Upload as TusUpload } from \"tus-js-client\";\r\nimport { uuidv7 } from \"uuidv7\";\r\nimport z from \"zod\";\r\nimport type { DetailedError } from \"tus-js-client\";\r\nimport type { DefinedInitialDataOptions, UseMutationOptions } from \"@tanstack/react-query\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport { FileMetaSchema } from \"~/models/file/FileMeta\";\r\nimport { httpClient, toKebabCase } from \"~/lib/utils\";\r\nimport { clientEnv } from \"~/env\";\r\n\r\nconst QUERY_KEY = \"file\";\r\nconst HOUR = 1000 * 60 * 60;\r\nconst APP_NAME = toKebabCase(clientEnv.VITE_APP_TITLE);\r\n\r\ntype OptionalId = string | undefined | null;\r\n\r\ntype BaseFileMetaArrayQueryOptions = Omit<DefinedInitialDataOptions<Array<FileMeta>>, \"queryKey\" | \"queryFn\" | \"staleTime\" | \"gcTime\" | \"refetchOnWindowFocus\" | \"initialData\">;\r\ntype BaseBlobQueryOptions = Omit<DefinedInitialDataOptions<Blob, Error, string>, \"queryKey\" | \"queryFn\" | \"select\" | \"staleTime\" | \"gcTime\" | \"refetchOnWindowFocus\" | \"initialData\">;\r\ntype BaseFileMetaMutationOptions = Omit<UseMutationOptions<FileMeta, Error, FileMeta>, \"mutationFn\" | \"onSettled\">;\r\ntype BaseBlobMutationOptions = Omit<UseMutationOptions<Blob, Error, FileMeta>, \"mutationFn\" | \"onSuccess\">;\r\ntype BaseStringMutationOptions = Omit<UseMutationOptions<string, Error, string>, \"mutationFn\" | \"onSettled\">;\r\n\r\nexport const GetFileMetasParamsSchema = z.object({\r\n appName: z.string().min(1).max(255).default(APP_NAME).optional(),\r\n subId: z.uuid(),\r\n});\r\n\r\nexport type GetFileMetasParams = z.infer<typeof GetFileMetasParamsSchema>;\r\n\r\nexport const useGetFileMetas = (params: GetFileMetasParams, options?: BaseFileMetaArrayQueryOptions) => {\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", params.appName ?? APP_NAME);\r\n queryParams.append(\"subId\", params.subId);\r\n\r\n return useQuery<Array<FileMeta>>({\r\n ...options,\r\n queryKey: [QUERY_KEY, \"meta\", params.appName ?? APP_NAME, params.subId],\r\n queryFn: ({ signal }) => httpClient.request({\r\n url: `/${QUERY_KEY}/v1/meta?${queryParams.toString()}`,\r\n method: \"GET\",\r\n signal,\r\n }),\r\n staleTime: HOUR,\r\n gcTime: HOUR,\r\n refetchOnWindowFocus: false,\r\n });\r\n};\r\n\r\nexport const GetFileThumbnailParamsSchema = z.object({\r\n appName: z.string().min(1).max(255).default(APP_NAME).optional(),\r\n meta: FileMetaSchema.nullish(),\r\n});\r\n\r\nexport type GetFileThumbnailParams = z.infer<typeof GetFileThumbnailParamsSchema>;\r\n\r\nexport const useGetFileThumbnail = (params: GetFileThumbnailParams, options?: BaseBlobQueryOptions) => {\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", params.appName ?? APP_NAME);\r\n queryParams.append(\"id\", params.meta?.id ?? \"\");\r\n\r\n return useQuery<Blob, Error, string>({\r\n ...options,\r\n queryKey: [QUERY_KEY, \"thumbnail\", params.appName ?? APP_NAME, params.meta?.id],\r\n queryFn: ({ signal }) => httpClient.request({\r\n url: `/${QUERY_KEY}/v1/thumbnail?${queryParams.toString()}`,\r\n method: \"GET\",\r\n signal,\r\n responseType: \"blob\"\r\n }),\r\n select: data => URL.createObjectURL(data),\r\n staleTime: HOUR,\r\n gcTime: HOUR,\r\n refetchOnWindowFocus: false,\r\n enabled: !!params.meta && options?.enabled !== false,\r\n });\r\n};\r\n\r\nexport const GetFileParamsSchema = z.object({\r\n appName: z.string().min(1).max(255).default(APP_NAME).optional(),\r\n meta: FileMetaSchema.nullish(),\r\n});\r\n\r\nexport type GetFileParams = z.infer<typeof GetFileParamsSchema>;\r\n\r\nexport const useGetFile = (params: GetFileParams, options?: BaseBlobQueryOptions) => {\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", params.appName ?? APP_NAME);\r\n queryParams.append(\"id\", params.meta?.id ?? \"\");\r\n\r\n return useQuery<Blob, Error, string>({\r\n ...options,\r\n queryKey: [QUERY_KEY, params.appName ?? APP_NAME, params.meta?.id],\r\n queryFn: ({ signal }) => httpClient.request({\r\n url: `/${QUERY_KEY}/v1?${queryParams.toString()}`,\r\n method: \"GET\",\r\n signal,\r\n responseType: \"blob\"\r\n }),\r\n select: data => URL.createObjectURL(data),\r\n staleTime: HOUR,\r\n gcTime: HOUR,\r\n refetchOnWindowFocus: false,\r\n enabled: !!params.meta && options?.enabled !== false,\r\n });\r\n};\r\n\r\nexport const useDownloadFile = (options?: BaseBlobMutationOptions) => {\r\n return useMutation<Blob, Error, FileMeta>({\r\n ...options,\r\n mutationFn: meta => httpClient.request({\r\n url: `/${QUERY_KEY}/v1/download?appName=${APP_NAME}&id=${meta.id}`,\r\n method: \"GET\",\r\n responseType: \"blob\"\r\n }),\r\n onSuccess: (data, variables) => saveAs(data, `${variables.fileName}.${variables.fileExtension}`)\r\n });\r\n};\r\n\r\nexport const useOpenFile = (options?: BaseBlobMutationOptions) => {\r\n return useMutation<Blob, Error, FileMeta>({\r\n ...options,\r\n mutationFn: meta => httpClient.request({\r\n url: `/${QUERY_KEY}/v1?appName=${APP_NAME}&id=${meta.id}`,\r\n method: \"GET\",\r\n responseType: \"blob\"\r\n }),\r\n onSuccess: data => { window.open(URL.createObjectURL(data)); }\r\n });\r\n};\r\n\r\nexport const useUpdateFileMeta = (options?: BaseFileMetaMutationOptions) => {\r\n const queryClient = useQueryClient();\r\n\r\n return useMutation<FileMeta, Error, FileMeta>({\r\n ...options,\r\n mutationFn: meta => httpClient.request({\r\n url: `/${QUERY_KEY}/v1/meta?appName=${APP_NAME}&id=${meta.id}`,\r\n method: \"PUT\",\r\n data: meta\r\n }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, \"meta\"], exact: false })\r\n });\r\n};\r\n\r\nexport const useDeleteFile = (options?: BaseFileMetaMutationOptions) => {\r\n const queryClient = useQueryClient();\r\n\r\n return useMutation<FileMeta, Error, FileMeta>({\r\n ...options,\r\n mutationFn: meta => httpClient.request({\r\n url: `/${QUERY_KEY}/v1?appName=${APP_NAME}&id=${meta.id}`,\r\n method: \"DELETE\"\r\n }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, \"meta\"], exact: false }),\r\n });\r\n};\r\n\r\nexport const useDeleteFiles = (options?: BaseStringMutationOptions) => {\r\n const queryClient = useQueryClient();\r\n\r\n return useMutation<string, Error, string>({\r\n ...options,\r\n mutationFn: subId => httpClient.request({\r\n url: `/${QUERY_KEY}/v1?appName=${APP_NAME}&subId=${subId}`,\r\n method: \"DELETE\"\r\n }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, \"meta\"], exact: false })\r\n });\r\n};\r\n\r\ninterface UseUploadFileProps {\r\n subId: OptionalId;\r\n onSuccess?: (meta: Pick<FileMeta, \"id\" | \"appName\" | \"subId\" | \"fileName\">) => void;\r\n onError?: (error: Error | DetailedError) => void;\r\n}\r\n\r\nexport const useUploadFile = ({ subId, onSuccess, onError }: UseUploadFileProps) => {\r\n const [progress, setProgress] = useState<number>(0);\r\n const queryClient = useQueryClient();\r\n\r\n const mutate = async (file: File) => {\r\n if (!subId) throw new Error(\"subId is required for file upload\");\r\n\r\n const metadata: Pick<FileMeta, \"id\" | \"appName\" | \"subId\" | \"fileName\"> = {\r\n id: uuidv7(),\r\n appName: APP_NAME,\r\n subId: subId,\r\n fileName: file.name,\r\n };\r\n\r\n const upload = new TusUpload(file, {\r\n endpoint: `${clientEnv.VITE_API_URL}/${QUERY_KEY}/v1/upload`,\r\n chunkSize: 1_048_576, // 1 MB\r\n metadata: {\r\n id: metadata.id,\r\n appName: metadata.appName,\r\n subId: metadata.subId,\r\n fileName: metadata.fileName,\r\n fileExtension: file.type\r\n },\r\n // headers: { \"Authorization\": `Bearer ${await getToken()}` }, //TODO: implement token retrieval\r\n onError: (error) => {\r\n setProgress(0);\r\n onError?.(error);\r\n },\r\n onProgress: (bytesUploaded, bytesTotal) => {\r\n setProgress((bytesUploaded / bytesTotal) * 100);\r\n },\r\n onSuccess: () => {\r\n setProgress(0);\r\n queryClient.invalidateQueries({ queryKey: [QUERY_KEY, \"meta\", subId], exact: false });\r\n onSuccess?.(metadata);\r\n },\r\n });\r\n\r\n const previousUploads = await upload.findPreviousUploads();\r\n if (previousUploads.length > 0) {\r\n upload.resumeFromPreviousUpload(previousUploads[0]);\r\n }\r\n\r\n upload.start();\r\n };\r\n\r\n return { mutate, progress };\r\n};\r\n"],"names":["z","TusUpload"],"mappings":";;;;;;;;AAaA,MAAM,YAAY;AAClB,MAAM,OAAO,MAAO,KAAK;AACzB,MAAM,WAAW,YAAY,UAAU,cAAc;AAUbA,WAAE,OAAO;AAAA,EAC7C,SAASA,WAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,QAAQ,QAAQ,EAAE,SAAA;AAAA,EACtD,OAAOA,WAAE,KAAA;AACb,CAAC;AAIM,MAAM,kBAAkB,CAAC,QAA4B,YAA4C;AACpG,QAAM,cAAc,IAAI,gBAAA;AACxB,cAAY,OAAO,WAAW,OAAO,WAAW,QAAQ;AACxD,cAAY,OAAO,SAAS,OAAO,KAAK;AAExC,SAAO,SAA0B;AAAA,IAC7B,GAAG;AAAA,IACH,UAAU,CAAC,WAAW,QAAQ,OAAO,WAAW,UAAU,OAAO,KAAK;AAAA,IACtE,SAAS,CAAC,EAAE,aAAa,WAAW,QAAQ;AAAA,MACxC,KAAK,IAAI,SAAS,YAAY,YAAY,UAAU;AAAA,MACpD,QAAQ;AAAA,MACR;AAAA,IAAA,CACH;AAAA,IACD,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,sBAAsB;AAAA,EAAA,CACzB;AACL;AAE4CA,WAAE,OAAO;AAAA,EACjD,SAASA,WAAE,OAAA,EAAS,IAAI,CAAC,EAAE,I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I,SAAS;AAAA,QACb,SAAS,SAAS;AAAA,QAClB,OAAO,SAAS;AAAA,QAChB,UAAU,SAAS;AAAA,QACnB,eAAe,KAAK;AAAA,MAAA;AAAA;AAAA,MAGxB,SAAS,CAAC,UAAU;AAChB,oBAAY,CAAC;AACb,kBAAU,KAAK;AAAA,MACnB;AAAA,MACA,YAAY,CAAC,eAAe,eAAe;AACvC,oBAAa,gBAAgB,aAAc,GAAG;AAAA,MAClD;AAAA,MACA,WAAW,MAAM;AACb,oBAAY,CAAC;AACb,oBAAY,kBAAkB,EAAE,UAAU,CAAC,WAAW,QAAQ,KAAK,GAAG,OAAO,OAAO;AACpF,oBAAY,QAAQ;AAAA,MACxB;AAAA,IAAA,CACH;AAED,UAAM,kBAAkB,MAAM,OAAO,oBAAA;AACrC,QAAI,gBAAgB,SAAS,GAAG;AAC5B,aAAO,yBAAyB,gBAAgB,CAAC,CAAC;AAAA,IACtD;AAEA,WAAO,MAAA;AAAA,EACX;AAEA,SAAO,EAAE,QAAQ,SAAA;AACrB;"}
@@ -1,4 +1,4 @@
1
- import { j as jsxRuntimeExports } from "./DialogsHooks-Bi8dZoyu.js";
1
+ import { j as jsxRuntimeExports } from "./DialogsContext-DMZRefiY.js";
2
2
  import { ListItemButton } from "@mui/material";
3
3
  import { createLink } from "@tanstack/react-router";
4
4
  import React from "react";
@@ -12,4 +12,4 @@ const RouterListItemButton = (props) => {
12
12
  export {
13
13
  RouterListItemButton as R
14
14
  };
15
- //# sourceMappingURL=RouterListItemButton-CHS7rofI.js.map
15
+ //# sourceMappingURL=RouterListItemButton-Vj6OoqkV.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RouterListItemButton-CHS7rofI.js","sources":["../src/components/router/RouterListItemButton.tsx"],"sourcesContent":["import { ListItemButton } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { ListItemButtonProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, ListItemButtonProps<\"a\">>(function ButtonComponent(props, reference) {\n return <ListItemButton ref={reference} component=\"a\" {...props} />;\n});\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterListItemButton: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n"],"names":["jsx"],"mappings":";;;;AAMA,MAAM,YAAY,MAAM,WAAwD,SAAS,gBAAgB,OAAO,WAAW;AACvH,+CAAQ,gBAAA,EAAe,KAAK,WAAW,WAAU,KAAK,GAAG,OAAO;AACpE,CAAC;AAED,MAAM,mBAAmB,WAAW,SAAS;AAEtC,MAAM,uBAAwD,CAAC,UAAU;AAC5E,SAAOA,sCAAC,kBAAA,EAAkB,GAAG,MAAA,CAAO;AACxC;"}
1
+ {"version":3,"file":"RouterListItemButton-Vj6OoqkV.js","sources":["../src/components/router/RouterListItemButton.tsx"],"sourcesContent":["import { ListItemButton } from \"@mui/material\";\nimport { createLink } from \"@tanstack/react-router\";\nimport React from \"react\";\nimport type { ListItemButtonProps } from \"@mui/material\";\nimport type { LinkComponent } from \"@tanstack/react-router\";\n\nconst Component = React.forwardRef<HTMLAnchorElement, ListItemButtonProps<\"a\">>(function ButtonComponent(props, reference) {\n return <ListItemButton ref={reference} component=\"a\" {...props} />;\n});\n\nconst CreatedComponent = createLink(Component);\n\nexport const RouterListItemButton: LinkComponent<typeof Component> = (props) => {\n return <CreatedComponent {...props} />;\n};\n"],"names":["jsx"],"mappings":";;;;AAMA,MAAM,YAAY,MAAM,WAAwD,SAAS,gBAAgB,OAAO,WAAW;AACvH,+CAAQ,gBAAA,EAAe,KAAK,WAAW,WAAU,KAAK,GAAG,OAAO;AACpE,CAAC;AAED,MAAM,mBAAmB,WAAW,SAAS;AAEtC,MAAM,uBAAwD,CAAC,UAAU;AAC5E,SAAOA,sCAAC,kBAAA,EAAkB,GAAG,MAAA,CAAO;AACxC;"}
@@ -0,0 +1,11 @@
1
+ import { createContext, useContext } from "react";
2
+ const UserContext = createContext({});
3
+ function useUser() {
4
+ const { user } = useContext(UserContext);
5
+ return user;
6
+ }
7
+ export {
8
+ UserContext as U,
9
+ useUser as u
10
+ };
11
+ //# sourceMappingURL=UseHook-DB7btKDE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UseHook-DB7btKDE.js","sources":["../src/contexts/UserContext.ts","../src/hooks/UseHook.tsx"],"sourcesContent":["import { createContext } from \"react\";\nimport type { Dispatch, SetStateAction } from \"react\";\nimport type { User } from \"~/models/User\";\n\nexport interface UserContextValue {\n user: User;\n setUser: Dispatch<SetStateAction<User>>;\n}\n\nexport const UserContext = createContext<UserContextValue>({} as UserContextValue);\n","import { useContext } from \"react\";\nimport type { User } from \"~/models/User\";\nimport { UserContext } from \"~/contexts/UserContext\";\n\nexport function useUser(): User {\n const { user } = useContext(UserContext);\n return user;\n}\n"],"names":[],"mappings":";AASO,MAAM,cAAc,cAAgC,CAAA,CAAsB;ACL1E,SAAS,UAAgB;AAC5B,QAAM,EAAE,KAAA,IAAS,WAAW,WAAW;AACvC,SAAO;AACX;"}