sera-components 1.1.6 → 1.1.8

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.
@@ -1,4 +1,4 @@
1
- (function(b,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("react"),require("@mantine/core"),require("@tabler/icons-react"),require("mobx-react-lite"),require("sera-route"),require("react-imask"),require("sera-db"),require("@tanstack/react-table")):typeof define=="function"&&define.amd?define(["exports","react","@mantine/core","@tabler/icons-react","mobx-react-lite","sera-route","react-imask","sera-db","@tanstack/react-table"],j):(b=typeof globalThis<"u"?globalThis:b||self,j(b["sera-components"]={},b.React,b["@mantine/core"],b["@tabler/icons-react"],b["mobx-react-lite"],b["sera-route"],b.ReactIMask,b["sera-db"],b["@tanstack/react-table"]))})(this,function(b,j,d,M,K,Ke,Gt,X,Z){"use strict";var ca=Object.defineProperty;var fa=(b,j,d)=>j in b?ca(b,j,{enumerable:!0,configurable:!0,writable:!0,value:d}):b[j]=d;var J=(b,j,d)=>fa(b,typeof j!="symbol"?j+"":j,d);function Kt(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const h=Kt(j);var fe={exports:{}},oe={};/**
1
+ (function(b,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("react"),require("@mantine/core"),require("@tabler/icons-react"),require("mobx-react-lite"),require("sera-db"),require("sera-route"),require("react-imask"),require("@tanstack/react-table")):typeof define=="function"&&define.amd?define(["exports","react","@mantine/core","@tabler/icons-react","mobx-react-lite","sera-db","sera-route","react-imask","@tanstack/react-table"],j):(b=typeof globalThis<"u"?globalThis:b||self,j(b["sera-components"]={},b.React,b["@mantine/core"],b["@tabler/icons-react"],b["mobx-react-lite"],b["sera-db"],b["sera-route"],b.ReactIMask,b["@tanstack/react-table"]))})(this,function(b,j,d,M,K,W,Ke,Gt,Z){"use strict";var fa=Object.defineProperty;var ha=(b,j,d)=>j in b?fa(b,j,{enumerable:!0,configurable:!0,writable:!0,value:d}):b[j]=d;var X=(b,j,d)=>ha(b,typeof j!="symbol"?j+"":j,d);function Kt(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const h=Kt(j);var ce={exports:{}},oe={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -14,12 +14,12 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Ve;function Vt(){return Ve||(Ve=1,process.env.NODE_ENV!=="production"&&function(){function e(g){if(g==null)return null;if(typeof g=="function")return g.$$typeof===H?null:g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case m:return"Fragment";case S:return"Profiler";case k:return"StrictMode";case R:return"Suspense";case G:return"SuspenseList";case O:return"Activity"}if(typeof g=="object")switch(typeof g.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),g.$$typeof){case y:return"Portal";case w:return(g.displayName||"Context")+".Provider";case T:return(g._context.displayName||"Context")+".Consumer";case C:var E=g.render;return g=g.displayName,g||(g=E.displayName||E.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case D:return E=g.displayName||null,E!==null?E:e(g.type)||"Memo";case Q:E=g._payload,g=g._init;try{return e(g(E))}catch{}}return null}function n(g){return""+g}function t(g){try{n(g);var E=!1}catch{E=!0}if(E){E=console;var N=E.error,L=typeof Symbol=="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object";return N.call(E,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",L),n(g)}}function a(g){if(g===m)return"<>";if(typeof g=="object"&&g!==null&&g.$$typeof===Q)return"<...>";try{var E=e(g);return E?"<"+E+">":"<...>"}catch{return"<...>"}}function r(){var g=re.A;return g===null?null:g.getOwner()}function o(){return Error("react-stack-top-frame")}function l(g){if(_t.call(g,"key")){var E=Object.getOwnPropertyDescriptor(g,"key").get;if(E&&E.isReactWarning)return!1}return g.key!==void 0}function s(g,E){function N(){$t||($t=!0,console.error("%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)",E))}N.isReactWarning=!0,Object.defineProperty(g,"key",{get:N,configurable:!0})}function u(){var g=e(this.type);return zt[g]||(zt[g]=!0,console.error("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.")),g=this.props.ref,g!==void 0?g:null}function c(g,E,N,L,Y,_,qe,Ue){return N=_.ref,g={$$typeof:x,type:g,key:E,props:_,_owner:Y},(N!==void 0?N:null)!==null?Object.defineProperty(g,"ref",{enumerable:!1,get:u}):Object.defineProperty(g,"ref",{enumerable:!1,value:null}),g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(g,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(g,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:qe}),Object.defineProperty(g,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ue}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g}function f(g,E,N,L,Y,_,qe,Ue){var F=E.children;if(F!==void 0)if(L)if(ua(F)){for(L=0;L<F.length;L++)v(F[L]);Object.freeze&&Object.freeze(F)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else v(F);if(_t.call(E,"key")){F=e(g);var ae=Object.keys(E).filter(function(da){return da!=="key"});L=0<ae.length?"{key: someKey, "+ae.join(": ..., ")+": ...}":"{key: someKey}",Ut[F+L]||(ae=0<ae.length?"{"+ae.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var Ve;function Vt(){return Ve||(Ve=1,process.env.NODE_ENV!=="production"&&function(){function e(g){if(g==null)return null;if(typeof g=="function")return g.$$typeof===Y?null:g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case m:return"Fragment";case S:return"Profiler";case k:return"StrictMode";case R:return"Suspense";case G:return"SuspenseList";case A:return"Activity"}if(typeof g=="object")switch(typeof g.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),g.$$typeof){case y:return"Portal";case w:return(g.displayName||"Context")+".Provider";case T:return(g._context.displayName||"Context")+".Consumer";case C:var E=g.render;return g=g.displayName,g||(g=E.displayName||E.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case D:return E=g.displayName||null,E!==null?E:e(g.type)||"Memo";case Q:E=g._payload,g=g._init;try{return e(g(E))}catch{}}return null}function n(g){return""+g}function t(g){try{n(g);var E=!1}catch{E=!0}if(E){E=console;var N=E.error,L=typeof Symbol=="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object";return N.call(E,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",L),n(g)}}function a(g){if(g===m)return"<>";if(typeof g=="object"&&g!==null&&g.$$typeof===Q)return"<...>";try{var E=e(g);return E?"<"+E+">":"<...>"}catch{return"<...>"}}function r(){var g=re.A;return g===null?null:g.getOwner()}function o(){return Error("react-stack-top-frame")}function l(g){if($t.call(g,"key")){var E=Object.getOwnPropertyDescriptor(g,"key").get;if(E&&E.isReactWarning)return!1}return g.key!==void 0}function s(g,E){function N(){_t||(_t=!0,console.error("%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)",E))}N.isReactWarning=!0,Object.defineProperty(g,"key",{get:N,configurable:!0})}function u(){var g=e(this.type);return zt[g]||(zt[g]=!0,console.error("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.")),g=this.props.ref,g!==void 0?g:null}function c(g,E,N,L,J,$,qe,Ue){return N=$.ref,g={$$typeof:x,type:g,key:E,props:$,_owner:J},(N!==void 0?N:null)!==null?Object.defineProperty(g,"ref",{enumerable:!1,get:u}):Object.defineProperty(g,"ref",{enumerable:!1,value:null}),g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(g,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(g,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:qe}),Object.defineProperty(g,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ue}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g}function f(g,E,N,L,J,$,qe,Ue){var F=E.children;if(F!==void 0)if(L)if(da(F)){for(L=0;L<F.length;L++)v(F[L]);Object.freeze&&Object.freeze(F)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else v(F);if($t.call(E,"key")){F=e(g);var ae=Object.keys(E).filter(function(ca){return ca!=="key"});L=0<ae.length?"{key: someKey, "+ae.join(": ..., ")+": ...}":"{key: someKey}",Ut[F+L]||(ae=0<ae.length?"{"+ae.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,L,F,ae,F),Ut[F+L]=!0)}if(F=null,N!==void 0&&(t(N),F=""+N),l(E)&&(t(E.key),F=""+E.key),"key"in E){N={};for(var Ge in E)Ge!=="key"&&(N[Ge]=E[Ge])}else N=E;return F&&s(N,typeof g=="function"?g.displayName||g.name||"Unknown":g),c(g,F,_,Y,r(),N,qe,Ue)}function v(g){typeof g=="object"&&g!==null&&g.$$typeof===x&&g._store&&(g._store.validated=1)}var p=j,x=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),w=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),H=Symbol.for("react.client.reference"),re=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_t=Object.prototype.hasOwnProperty,ua=Array.isArray,Be=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(g){return g()}};var $t,zt={},Bt=p.react_stack_bottom_frame.bind(p,o)(),qt=Be(a(o)),Ut={};ie.Fragment=m,ie.jsx=function(g,E,N,L,Y){var _=1e4>re.recentlyCreatedOwnerStacks++;return f(g,E,N,!1,L,Y,_?Error("react-stack-top-frame"):Bt,_?Be(a(g)):qt)},ie.jsxs=function(g,E,N,L,Y){var _=1e4>re.recentlyCreatedOwnerStacks++;return f(g,E,N,!0,L,Y,_?Error("react-stack-top-frame"):Bt,_?Be(a(g)):qt)}}()),ie}var He;function Ht(){return He||(He=1,process.env.NODE_ENV==="production"?fe.exports=Wt():fe.exports=Vt()),fe.exports}var i=Ht();const P={UK:{svgFlag:"https://flagcdn.com/gb.svg",emojiFlag:"🇬🇧"},VN:{svgFlag:"https://flagcdn.com/vn.svg",emojiFlag:"🇻🇳"},US:{svgFlag:"https://flagcdn.com/us.svg",emojiFlag:"🇺🇸"},CA:{svgFlag:"https://flagcdn.com/ca.svg",emojiFlag:"🇨🇦"},BR:{svgFlag:"https://flagcdn.com/br.svg",emojiFlag:"🇧🇷"},ES:{svgFlag:"https://flagcdn.com/es.svg",emojiFlag:"🇪🇸"},IT:{svgFlag:"https://flagcdn.com/it.svg",emojiFlag:"🇮🇹"},NZ:{svgFlag:"https://flagcdn.com/nz.svg",emojiFlag:"🇳🇿"},MX:{svgFlag:"https://flagcdn.com/mx.svg",emojiFlag:"🇲🇽"},CN:{svgFlag:"https://flagcdn.com/cn.svg",emojiFlag:"🇨🇳"},AU:{svgFlag:"https://flagcdn.com/au.svg",emojiFlag:"🇦🇺"},JP:{svgFlag:"https://flagcdn.com/jp.svg",emojiFlag:"🇯🇵"},FR:{svgFlag:"https://flagcdn.com/fr.svg",emojiFlag:"🇫🇷"},DE:{svgFlag:"https://flagcdn.com/de.svg",emojiFlag:"🇩🇪"},IN:{svgFlag:"https://flagcdn.com/in.svg",emojiFlag:"🇮🇳"}},Ye=({flag:e})=>i.jsx(d.Paper,{shadow:"xs",w:20,h:14,children:i.jsx(d.Image,{src:e.svgFlag,w:20,h:14,fit:"cover"})}),Je=({flag:e})=>i.jsx(d.Text,{component:"span",style:n=>({textShadow:n.shadows.xs}),children:e.emojiFlag}),he=navigator.userAgent.includes("Windows")?Ye:Je,ee=j.createContext(new Intl.Locale("en-US")),Yt=K.observer(({value:e,children:n})=>i.jsx(ee.Provider,{value:e.locale,children:n})),Jt={lang2value:{en:"Choose Language",vi:"Chọn ngôn ngữ"}},me={en:{name:"English",flag:P.US,locale:new Intl.Locale("en-US")},vi:{name:"Tiếng Việt",flag:P.VN,locale:new Intl.Locale("vi-VN")}},Xt=({locale:e,setLocale:n})=>{const t=j.useMemo(()=>Object.entries(me).map(([a,{flag:r,name:o,locale:l}])=>i.jsx(d.Menu.Item,{onClick:()=>n(l),leftSection:i.jsx(he,{flag:r}),rightSection:e.language===a&&i.jsx(M.IconCheck,{size:"15",color:"#2986cc",stroke:2}),children:i.jsx(d.Text,{size:"sm",children:o})},a)),[me,e]);return i.jsxs(d.Menu,{width:170,children:[i.jsx(d.Menu.Target,{children:i.jsx(d.Button,{variant:"subtle",size:"sm",leftSection:i.jsx(he,{flag:me[e.language].flag}),children:i.jsx(d.Text,{size:"sm",children:me[e.language].name})})}),i.jsxs(d.Menu.Dropdown,{children:[i.jsx(d.Menu.Label,{children:i.jsx(d.Text,{size:"sm",children:Jt.lang2value[e.language]})}),t]})]})},A=({value:e})=>{const n=j.useContext(ee);return e.lang2value[n.language]||e.lang2value[e.lang]};/**
22
+ <%s key={someKey} {...props} />`,L,F,ae,F),Ut[F+L]=!0)}if(F=null,N!==void 0&&(t(N),F=""+N),l(E)&&(t(E.key),F=""+E.key),"key"in E){N={};for(var Ge in E)Ge!=="key"&&(N[Ge]=E[Ge])}else N=E;return F&&s(N,typeof g=="function"?g.displayName||g.name||"Unknown":g),c(g,F,$,J,r(),N,qe,Ue)}function v(g){typeof g=="object"&&g!==null&&g.$$typeof===x&&g._store&&(g._store.validated=1)}var p=j,x=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),w=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),Y=Symbol.for("react.client.reference"),re=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$t=Object.prototype.hasOwnProperty,da=Array.isArray,Be=console.createTask?console.createTask:function(){return null};p={"react-stack-bottom-frame":function(g){return g()}};var _t,zt={},Bt=p["react-stack-bottom-frame"].bind(p,o)(),qt=Be(a(o)),Ut={};ie.Fragment=m,ie.jsx=function(g,E,N,L,J){var $=1e4>re.recentlyCreatedOwnerStacks++;return f(g,E,N,!1,L,J,$?Error("react-stack-top-frame"):Bt,$?Be(a(g)):qt)},ie.jsxs=function(g,E,N,L,J){var $=1e4>re.recentlyCreatedOwnerStacks++;return f(g,E,N,!0,L,J,$?Error("react-stack-top-frame"):Bt,$?Be(a(g)):qt)}}()),ie}var He;function Ht(){return He||(He=1,process.env.NODE_ENV==="production"?ce.exports=Wt():ce.exports=Vt()),ce.exports}var i=Ht();const P={UK:{svgFlag:"https://flagcdn.com/gb.svg",emojiFlag:"🇬🇧"},VN:{svgFlag:"https://flagcdn.com/vn.svg",emojiFlag:"🇻🇳"},US:{svgFlag:"https://flagcdn.com/us.svg",emojiFlag:"🇺🇸"},CA:{svgFlag:"https://flagcdn.com/ca.svg",emojiFlag:"🇨🇦"},BR:{svgFlag:"https://flagcdn.com/br.svg",emojiFlag:"🇧🇷"},ES:{svgFlag:"https://flagcdn.com/es.svg",emojiFlag:"🇪🇸"},IT:{svgFlag:"https://flagcdn.com/it.svg",emojiFlag:"🇮🇹"},NZ:{svgFlag:"https://flagcdn.com/nz.svg",emojiFlag:"🇳🇿"},MX:{svgFlag:"https://flagcdn.com/mx.svg",emojiFlag:"🇲🇽"},CN:{svgFlag:"https://flagcdn.com/cn.svg",emojiFlag:"🇨🇳"},AU:{svgFlag:"https://flagcdn.com/au.svg",emojiFlag:"🇦🇺"},JP:{svgFlag:"https://flagcdn.com/jp.svg",emojiFlag:"🇯🇵"},FR:{svgFlag:"https://flagcdn.com/fr.svg",emojiFlag:"🇫🇷"},DE:{svgFlag:"https://flagcdn.com/de.svg",emojiFlag:"🇩🇪"},IN:{svgFlag:"https://flagcdn.com/in.svg",emojiFlag:"🇮🇳"}},Ye=({flag:e})=>i.jsx(d.Paper,{shadow:"xs",w:20,h:14,children:i.jsx(d.Image,{src:e.svgFlag,w:20,h:14,fit:"cover"})}),Je=({flag:e})=>i.jsx(d.Text,{component:"span",style:n=>({textShadow:n.shadows.xs}),children:e.emojiFlag}),fe=navigator.userAgent.includes("Windows")?Ye:Je,ee=j.createContext(new Intl.Locale("en-US")),Yt=K.observer(({value:e,children:n})=>i.jsx(ee.Provider,{value:e.locale,children:n})),Jt={lang2value:{en:"Choose Language",vi:"Chọn ngôn ngữ"}},he={en:{name:"English",flag:P.US,locale:new Intl.Locale("en-US")},vi:{name:"Tiếng Việt",flag:P.VN,locale:new Intl.Locale("vi-VN")}},Xt=({locale:e,setLocale:n})=>{const t=j.useMemo(()=>Object.entries(he).map(([a,{flag:r,name:o,locale:l}])=>i.jsx(d.Menu.Item,{onClick:()=>n(l),leftSection:i.jsx(fe,{flag:r}),rightSection:e.language===a&&i.jsx(M.IconCheck,{size:"15",color:"#2986cc",stroke:2}),children:i.jsx(d.Text,{size:"sm",children:o})},a)),[he,e]);return i.jsxs(d.Menu,{width:170,children:[i.jsx(d.Menu.Target,{children:i.jsx(d.Button,{variant:"subtle",size:"sm",leftSection:i.jsx(fe,{flag:he[e.language].flag}),children:i.jsx(d.Text,{size:"sm",children:he[e.language].name})})}),i.jsxs(d.Menu.Dropdown,{children:[i.jsx(d.Menu.Label,{children:i.jsx(d.Text,{size:"sm",children:Jt.lang2value[e.language]})}),t]})]})},O=({value:e})=>{const n=j.useContext(ee);return e.lang2value[n.language]||e.lang2value[e.lang]};/**
23
23
  * react-router v7.7.1
24
24
  *
25
25
  * Copyright (c) Remix Software Inc.
@@ -28,6 +28,6 @@ React keys must be passed directly to JSX without using spread:
28
28
  * LICENSE.md file in the root directory of this source tree.
29
29
  *
30
30
  * @license MIT
31
- */function I(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function $(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function Se({pathname:e="/",search:n="",hash:t=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),t&&t!=="#"&&(e+=t.charAt(0)==="#"?t:"#"+t),e}function je(e){let n={};if(e){let t=e.indexOf("#");t>=0&&(n.hash=e.substring(t),e=e.substring(0,t));let a=e.indexOf("?");a>=0&&(n.search=e.substring(a),e=e.substring(0,a)),e&&(n.pathname=e)}return n}function Xe(e,n,t="/"){return Zt(e,n,t,!1)}function Zt(e,n,t,a){let r=typeof n=="string"?je(n):n,o=W(r.pathname||"/",t);if(o==null)return null;let l=Ze(e);Qt(l);let s=null;for(let u=0;s==null&&u<l.length;++u){let c=cn(o);s=un(l[u],c,a)}return s}function Ze(e,n=[],t=[],a=""){let r=(o,l,s)=>{let u={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};u.relativePath.startsWith("/")&&(I(u.relativePath.startsWith(a),`Absolute route path "${u.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(a.length));let c=z([a,u.relativePath]),f=t.concat(u);o.children&&o.children.length>0&&(I(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),Ze(o.children,n,f,c)),!(o.path==null&&!o.index)&&n.push({path:c,score:ln(c,o.index),routesMeta:f})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))r(o,l);else for(let u of Qe(o.path))r(o,l,u)}),n}function Qe(e){let n=e.split("/");if(n.length===0)return[];let[t,...a]=n,r=t.endsWith("?"),o=t.replace(/\?$/,"");if(a.length===0)return r?[o,""]:[o];let l=Qe(a.join("/")),s=[];return s.push(...l.map(u=>u===""?o:[o,u].join("/"))),r&&s.push(...l),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function Qt(e){e.sort((n,t)=>n.score!==t.score?t.score-n.score:sn(n.routesMeta.map(a=>a.childrenIndex),t.routesMeta.map(a=>a.childrenIndex)))}var en=/^:[\w-]+$/,tn=3,nn=2,rn=1,an=10,on=-2,et=e=>e==="*";function ln(e,n){let t=e.split("/"),a=t.length;return t.some(et)&&(a+=on),n&&(a+=nn),t.filter(r=>!et(r)).reduce((r,o)=>r+(en.test(o)?tn:o===""?rn:an),a)}function sn(e,n){return e.length===n.length&&e.slice(0,-1).every((a,r)=>a===n[r])?e[e.length-1]-n[n.length-1]:0}function un(e,n,t=!1){let{routesMeta:a}=e,r={},o="/",l=[];for(let s=0;s<a.length;++s){let u=a[s],c=s===a.length-1,f=o==="/"?n:n.slice(o.length)||"/",v=ge({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},f),p=u.route;if(!v&&c&&t&&!a[a.length-1].route.index&&(v=ge({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},f)),!v)return null;Object.assign(r,v.params),l.push({params:r,pathname:z([o,v.pathname]),pathnameBase:gn(z([o,v.pathnameBase])),route:p}),v.pathnameBase!=="/"&&(o=z([o,v.pathnameBase]))}return l}function ge(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[t,a]=dn(e.path,e.caseSensitive,e.end),r=n.match(t);if(!r)return null;let o=r[0],l=o.replace(/(.)\/+$/,"$1"),s=r.slice(1);return{params:a.reduce((c,{paramName:f,isOptional:v},p)=>{if(f==="*"){let y=s[p]||"";l=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const x=s[p];return v&&!x?c[f]=void 0:c[f]=(x||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:l,pattern:e}}function dn(e,n=!1,t=!0){$(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,u)=>(a.push({paramName:s,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(a.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,n?void 0:"i"),a]}function cn(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return $(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function W(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let t=n.endsWith("/")?n.length-1:n.length,a=e.charAt(t);return a&&a!=="/"?null:e.slice(t)||"/"}function fn(e,n="/"){let{pathname:t,search:a="",hash:r=""}=typeof e=="string"?je(e):e;return{pathname:t?t.startsWith("/")?t:hn(t,n):n,search:pn(a),hash:xn(r)}}function hn(e,n){let t=n.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function Ce(e,n,t,a){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function mn(e){return e.filter((n,t)=>t===0||n.route.path&&n.route.path.length>0)}function tt(e){let n=mn(e);return n.map((t,a)=>a===n.length-1?t.pathname:t.pathnameBase)}function nt(e,n,t,a=!1){let r;typeof e=="string"?r=je(e):(r={...e},I(!r.pathname||!r.pathname.includes("?"),Ce("?","pathname","search",r)),I(!r.pathname||!r.pathname.includes("#"),Ce("#","pathname","hash",r)),I(!r.search||!r.search.includes("#"),Ce("#","search","hash",r)));let o=e===""||r.pathname==="",l=o?"/":r.pathname,s;if(l==null)s=t;else{let v=n.length-1;if(!a&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),v-=1;r.pathname=p.join("/")}s=v>=0?n[v]:"/"}let u=fn(r,s),c=l&&l!=="/"&&l.endsWith("/"),f=(o||l===".")&&t.endsWith("/");return!u.pathname.endsWith("/")&&(c||f)&&(u.pathname+="/"),u}var z=e=>e.join("/").replace(/\/\/+/g,"/"),gn=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),pn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,xn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function vn(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var rt=["POST","PUT","PATCH","DELETE"];new Set(rt);var yn=["GET",...rt];new Set(yn);var te=h.createContext(null);te.displayName="DataRouter";var pe=h.createContext(null);pe.displayName="DataRouterState",h.createContext(!1);var at=h.createContext({isTransitioning:!1});at.displayName="ViewTransition";var bn=h.createContext(new Map);bn.displayName="Fetchers";var wn=h.createContext(null);wn.displayName="Await";var B=h.createContext(null);B.displayName="Navigation";var ke=h.createContext(null);ke.displayName="Location";var q=h.createContext({outlet:null,matches:[],isDataRoute:!1});q.displayName="Route";var Ee=h.createContext(null);Ee.displayName="RouteError";function Sn(e,{relative:n}={}){I(xe(),"useHref() may be used only in the context of a <Router> component.");let{basename:t,navigator:a}=h.useContext(B),{hash:r,pathname:o,search:l}=le(e,{relative:n}),s=o;return t!=="/"&&(s=o==="/"?t:z([t,o])),a.createHref({pathname:s,search:l,hash:r})}function xe(){return h.useContext(ke)!=null}function V(){return I(xe(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(ke).location}var ot="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function it(e){h.useContext(B).static||h.useLayoutEffect(e)}function Te(){let{isDataRoute:e}=h.useContext(q);return e?An():jn()}function jn(){I(xe(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(te),{basename:n,navigator:t}=h.useContext(B),{matches:a}=h.useContext(q),{pathname:r}=V(),o=JSON.stringify(tt(a)),l=h.useRef(!1);return it(()=>{l.current=!0}),h.useCallback((u,c={})=>{if($(l.current,ot),!l.current)return;if(typeof u=="number"){t.go(u);return}let f=nt(u,JSON.parse(o),r,c.relative==="path");e==null&&n!=="/"&&(f.pathname=f.pathname==="/"?n:z([n,f.pathname])),(c.replace?t.replace:t.push)(f,c.state,c)},[n,t,o,r,e])}h.createContext(null);function le(e,{relative:n}={}){let{matches:t}=h.useContext(q),{pathname:a}=V(),r=JSON.stringify(tt(t));return h.useMemo(()=>nt(e,JSON.parse(r),a,n==="path"),[e,r,a,n])}function Cn(e,n,t,a){I(xe(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=h.useContext(B),{matches:o}=h.useContext(q),l=o[o.length-1],s=l?l.params:{},u=l?l.pathname:"/",c=l?l.pathnameBase:"/",f=l&&l.route;{let S=f&&f.path||"";st(u,!f||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
31
+ */function I(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function _(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function Se({pathname:e="/",search:n="",hash:t=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),t&&t!=="#"&&(e+=t.charAt(0)==="#"?t:"#"+t),e}function je(e){let n={};if(e){let t=e.indexOf("#");t>=0&&(n.hash=e.substring(t),e=e.substring(0,t));let a=e.indexOf("?");a>=0&&(n.search=e.substring(a),e=e.substring(0,a)),e&&(n.pathname=e)}return n}function Xe(e,n,t="/"){return Zt(e,n,t,!1)}function Zt(e,n,t,a){let r=typeof n=="string"?je(n):n,o=V(r.pathname||"/",t);if(o==null)return null;let l=Ze(e);Qt(l);let s=null;for(let u=0;s==null&&u<l.length;++u){let c=cn(o);s=un(l[u],c,a)}return s}function Ze(e,n=[],t=[],a=""){let r=(o,l,s)=>{let u={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};u.relativePath.startsWith("/")&&(I(u.relativePath.startsWith(a),`Absolute route path "${u.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(a.length));let c=z([a,u.relativePath]),f=t.concat(u);o.children&&o.children.length>0&&(I(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),Ze(o.children,n,f,c)),!(o.path==null&&!o.index)&&n.push({path:c,score:ln(c,o.index),routesMeta:f})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))r(o,l);else for(let u of Qe(o.path))r(o,l,u)}),n}function Qe(e){let n=e.split("/");if(n.length===0)return[];let[t,...a]=n,r=t.endsWith("?"),o=t.replace(/\?$/,"");if(a.length===0)return r?[o,""]:[o];let l=Qe(a.join("/")),s=[];return s.push(...l.map(u=>u===""?o:[o,u].join("/"))),r&&s.push(...l),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function Qt(e){e.sort((n,t)=>n.score!==t.score?t.score-n.score:sn(n.routesMeta.map(a=>a.childrenIndex),t.routesMeta.map(a=>a.childrenIndex)))}var en=/^:[\w-]+$/,tn=3,nn=2,rn=1,an=10,on=-2,et=e=>e==="*";function ln(e,n){let t=e.split("/"),a=t.length;return t.some(et)&&(a+=on),n&&(a+=nn),t.filter(r=>!et(r)).reduce((r,o)=>r+(en.test(o)?tn:o===""?rn:an),a)}function sn(e,n){return e.length===n.length&&e.slice(0,-1).every((a,r)=>a===n[r])?e[e.length-1]-n[n.length-1]:0}function un(e,n,t=!1){let{routesMeta:a}=e,r={},o="/",l=[];for(let s=0;s<a.length;++s){let u=a[s],c=s===a.length-1,f=o==="/"?n:n.slice(o.length)||"/",v=me({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},f),p=u.route;if(!v&&c&&t&&!a[a.length-1].route.index&&(v=me({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},f)),!v)return null;Object.assign(r,v.params),l.push({params:r,pathname:z([o,v.pathname]),pathnameBase:gn(z([o,v.pathnameBase])),route:p}),v.pathnameBase!=="/"&&(o=z([o,v.pathnameBase]))}return l}function me(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[t,a]=dn(e.path,e.caseSensitive,e.end),r=n.match(t);if(!r)return null;let o=r[0],l=o.replace(/(.)\/+$/,"$1"),s=r.slice(1);return{params:a.reduce((c,{paramName:f,isOptional:v},p)=>{if(f==="*"){let y=s[p]||"";l=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const x=s[p];return v&&!x?c[f]=void 0:c[f]=(x||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:l,pattern:e}}function dn(e,n=!1,t=!0){_(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,u)=>(a.push({paramName:s,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(a.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,n?void 0:"i"),a]}function cn(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return _(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function V(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let t=n.endsWith("/")?n.length-1:n.length,a=e.charAt(t);return a&&a!=="/"?null:e.slice(t)||"/"}function fn(e,n="/"){let{pathname:t,search:a="",hash:r=""}=typeof e=="string"?je(e):e;return{pathname:t?t.startsWith("/")?t:hn(t,n):n,search:pn(a),hash:xn(r)}}function hn(e,n){let t=n.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function Ce(e,n,t,a){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function mn(e){return e.filter((n,t)=>t===0||n.route.path&&n.route.path.length>0)}function tt(e){let n=mn(e);return n.map((t,a)=>a===n.length-1?t.pathname:t.pathnameBase)}function nt(e,n,t,a=!1){let r;typeof e=="string"?r=je(e):(r={...e},I(!r.pathname||!r.pathname.includes("?"),Ce("?","pathname","search",r)),I(!r.pathname||!r.pathname.includes("#"),Ce("#","pathname","hash",r)),I(!r.search||!r.search.includes("#"),Ce("#","search","hash",r)));let o=e===""||r.pathname==="",l=o?"/":r.pathname,s;if(l==null)s=t;else{let v=n.length-1;if(!a&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),v-=1;r.pathname=p.join("/")}s=v>=0?n[v]:"/"}let u=fn(r,s),c=l&&l!=="/"&&l.endsWith("/"),f=(o||l===".")&&t.endsWith("/");return!u.pathname.endsWith("/")&&(c||f)&&(u.pathname+="/"),u}var z=e=>e.join("/").replace(/\/\/+/g,"/"),gn=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),pn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,xn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function vn(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var rt=["POST","PUT","PATCH","DELETE"];new Set(rt);var yn=["GET",...rt];new Set(yn);var te=h.createContext(null);te.displayName="DataRouter";var ge=h.createContext(null);ge.displayName="DataRouterState",h.createContext(!1);var at=h.createContext({isTransitioning:!1});at.displayName="ViewTransition";var bn=h.createContext(new Map);bn.displayName="Fetchers";var wn=h.createContext(null);wn.displayName="Await";var B=h.createContext(null);B.displayName="Navigation";var ke=h.createContext(null);ke.displayName="Location";var q=h.createContext({outlet:null,matches:[],isDataRoute:!1});q.displayName="Route";var Ee=h.createContext(null);Ee.displayName="RouteError";function Sn(e,{relative:n}={}){I(pe(),"useHref() may be used only in the context of a <Router> component.");let{basename:t,navigator:a}=h.useContext(B),{hash:r,pathname:o,search:l}=le(e,{relative:n}),s=o;return t!=="/"&&(s=o==="/"?t:z([t,o])),a.createHref({pathname:s,search:l,hash:r})}function pe(){return h.useContext(ke)!=null}function H(){return I(pe(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(ke).location}var ot="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function it(e){h.useContext(B).static||h.useLayoutEffect(e)}function Te(){let{isDataRoute:e}=h.useContext(q);return e?On():jn()}function jn(){I(pe(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(te),{basename:n,navigator:t}=h.useContext(B),{matches:a}=h.useContext(q),{pathname:r}=H(),o=JSON.stringify(tt(a)),l=h.useRef(!1);return it(()=>{l.current=!0}),h.useCallback((u,c={})=>{if(_(l.current,ot),!l.current)return;if(typeof u=="number"){t.go(u);return}let f=nt(u,JSON.parse(o),r,c.relative==="path");e==null&&n!=="/"&&(f.pathname=f.pathname==="/"?n:z([n,f.pathname])),(c.replace?t.replace:t.push)(f,c.state,c)},[n,t,o,r,e])}h.createContext(null);function le(e,{relative:n}={}){let{matches:t}=h.useContext(q),{pathname:a}=H(),r=JSON.stringify(tt(t));return h.useMemo(()=>nt(e,JSON.parse(r),a,n==="path"),[e,r,a,n])}function Cn(e,n,t,a){I(pe(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=h.useContext(B),{matches:o}=h.useContext(q),l=o[o.length-1],s=l?l.params:{},u=l?l.pathname:"/",c=l?l.pathnameBase:"/",f=l&&l.route;{let S=f&&f.path||"";st(u,!f||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
32
32
 
33
- Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let v=V(),p;p=v;let x=p.pathname||"/",y=x;if(c!=="/"){let S=c.replace(/^\//,"").split("/");y="/"+x.replace(/^\//,"").split("/").slice(S.length).join("/")}let m=Xe(e,{pathname:y});return $(f||m!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),$(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Nn(m&&m.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:z([c,r.encodeLocation?r.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?c:z([c,r.encodeLocation?r.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,t,a)}function kn(){let e=Mn(),n=vn(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),t=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:o},"ErrorBoundary")," or"," ",h.createElement("code",{style:o},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},n),t?h.createElement("pre",{style:r},t):null,l)}var En=h.createElement(kn,null),Tn=class extends h.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?h.createElement(q.Provider,{value:this.props.routeContext},h.createElement(Ee.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Rn({routeContext:e,match:n,children:t}){let a=h.useContext(te);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(q.Provider,{value:e},t)}function Nn(e,n=[],t=null,a=null){if(e==null){if(!t)return null;if(t.errors)e=t.matches;else if(n.length===0&&!t.initialized&&t.matches.length>0)e=t.matches;else return null}let r=e,o=t==null?void 0:t.errors;if(o!=null){let u=r.findIndex(c=>c.route.id&&(o==null?void 0:o[c.route.id])!==void 0);I(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),r=r.slice(0,Math.min(r.length,u+1))}let l=!1,s=-1;if(t)for(let u=0;u<r.length;u++){let c=r[u];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(s=u),c.route.id){let{loaderData:f,errors:v}=t,p=c.route.loader&&!f.hasOwnProperty(c.route.id)&&(!v||v[c.route.id]===void 0);if(c.route.lazy||p){l=!0,s>=0?r=r.slice(0,s+1):r=[r[0]];break}}}return r.reduceRight((u,c,f)=>{let v,p=!1,x=null,y=null;t&&(v=o&&c.route.id?o[c.route.id]:void 0,x=c.route.errorElement||En,l&&(s<0&&f===0?(st("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,y=null):s===f&&(p=!0,y=c.route.hydrateFallbackElement||null)));let m=n.concat(r.slice(0,f+1)),k=()=>{let S;return v?S=x:p?S=y:c.route.Component?S=h.createElement(c.route.Component,null):c.route.element?S=c.route.element:S=u,h.createElement(Rn,{match:c,routeContext:{outlet:u,matches:m,isDataRoute:t!=null},children:S})};return t&&(c.route.ErrorBoundary||c.route.errorElement||f===0)?h.createElement(Tn,{location:t.location,revalidation:t.revalidation,component:x,error:v,children:k(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):k()},null)}function Re(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Pn(e){let n=h.useContext(te);return I(n,Re(e)),n}function In(e){let n=h.useContext(pe);return I(n,Re(e)),n}function Ln(e){let n=h.useContext(q);return I(n,Re(e)),n}function Ne(e){let n=Ln(e),t=n.matches[n.matches.length-1];return I(t.route.id,`${e} can only be used on routes that contain a unique "id"`),t.route.id}function Fn(){return Ne("useRouteId")}function Mn(){var a;let e=h.useContext(Ee),n=In("useRouteError"),t=Ne("useRouteError");return e!==void 0?e:(a=n.errors)==null?void 0:a[t]}function An(){let{router:e}=Pn("useNavigate"),n=Ne("useNavigate"),t=h.useRef(!1);return it(()=>{t.current=!0}),h.useCallback(async(r,o={})=>{$(t.current,ot),t.current&&(typeof r=="number"?e.navigate(r):await e.navigate(r,{fromRouteId:n,...o}))},[e,n])}var lt={};function st(e,n,t){!n&&!lt[e]&&(lt[e]=!0,$(!1,t))}h.memo(On);function On({routes:e,future:n,state:t}){return Cn(e,void 0,t,n)}var ve="get",ye="application/x-www-form-urlencoded";function be(e){return e!=null&&typeof e.tagName=="string"}function Dn(e){return be(e)&&e.tagName.toLowerCase()==="button"}function _n(e){return be(e)&&e.tagName.toLowerCase()==="form"}function $n(e){return be(e)&&e.tagName.toLowerCase()==="input"}function zn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Bn(e,n){return e.button===0&&(!n||n==="_self")&&!zn(e)}var we=null;function qn(){if(we===null)try{new FormData(document.createElement("form"),0),we=!1}catch{we=!0}return we}var Un=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Pe(e){return e!=null&&!Un.has(e)?($(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ye}"`),null):e}function Gn(e,n){let t,a,r,o,l;if(_n(e)){let s=e.getAttribute("action");a=s?W(s,n):null,t=e.getAttribute("method")||ve,r=Pe(e.getAttribute("enctype"))||ye,o=new FormData(e)}else if(Dn(e)||$n(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||s.getAttribute("action");if(a=u?W(u,n):null,t=e.getAttribute("formmethod")||s.getAttribute("method")||ve,r=Pe(e.getAttribute("formenctype"))||Pe(s.getAttribute("enctype"))||ye,o=new FormData(s,e),!qn()){let{name:c,type:f,value:v}=e;if(f==="image"){let p=c?`${c}.`:"";o.append(`${p}x`,"0"),o.append(`${p}y`,"0")}else c&&o.append(c,v)}}else{if(be(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t=ve,a=null,r=ye,l=e}return o&&r==="text/plain"&&(l=o,o=void 0),{action:a,method:t.toLowerCase(),encType:r,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ie(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Kn(e,n,t){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a.pathname==="/"?a.pathname=`_root.${t}`:n&&W(a.pathname,n)==="/"?a.pathname=`${n.replace(/\/$/,"")}/_root.${t}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${t}`,a}async function Wn(e,n){if(e.id in n)return n[e.id];try{let t=await import(e.module);return n[e.id]=t,t}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Vn(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Hn(e,n,t){let a=await Promise.all(e.map(async r=>{let o=n.routes[r.route.id];if(o){let l=await Wn(o,t);return l.links?l.links():[]}return[]}));return Zn(a.flat(1).filter(Vn).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function ut(e,n,t,a,r,o){let l=(u,c)=>t[c]?u.route.id!==t[c].route.id:!0,s=(u,c)=>{var f;return t[c].pathname!==u.pathname||((f=t[c].route.path)==null?void 0:f.endsWith("*"))&&t[c].params["*"]!==u.params["*"]};return o==="assets"?n.filter((u,c)=>l(u,c)||s(u,c)):o==="data"?n.filter((u,c)=>{var v;let f=a.routes[u.route.id];if(!f||!f.hasLoader)return!1;if(l(u,c)||s(u,c))return!0;if(u.route.shouldRevalidate){let p=u.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((v=t[0])==null?void 0:v.params)||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function Yn(e,n,{includeHydrateFallback:t}={}){return Jn(e.map(a=>{let r=n.routes[a.route.id];if(!r)return[];let o=[r.module];return r.clientActionModule&&(o=o.concat(r.clientActionModule)),r.clientLoaderModule&&(o=o.concat(r.clientLoaderModule)),t&&r.hydrateFallbackModule&&(o=o.concat(r.hydrateFallbackModule)),r.imports&&(o=o.concat(r.imports)),o}).flat(1))}function Jn(e){return[...new Set(e)]}function Xn(e){let n={},t=Object.keys(e).sort();for(let a of t)n[a]=e[a];return n}function Zn(e,n){let t=new Set;return new Set(n),e.reduce((a,r)=>{let o=JSON.stringify(Xn(r));return t.has(o)||(t.add(o),a.push({key:o,link:r})),a},[])}function dt(){let e=h.useContext(te);return Ie(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Qn(){let e=h.useContext(pe);return Ie(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Le=h.createContext(void 0);Le.displayName="FrameworkContext";function ct(){let e=h.useContext(Le);return Ie(e,"You must render this element inside a <HydratedRouter> element"),e}function er(e,n){let t=h.useContext(Le),[a,r]=h.useState(!1),[o,l]=h.useState(!1),{onFocus:s,onBlur:u,onMouseEnter:c,onMouseLeave:f,onTouchStart:v}=n,p=h.useRef(null);h.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let m=S=>{S.forEach(T=>{l(T.isIntersecting)})},k=new IntersectionObserver(m,{threshold:.5});return p.current&&k.observe(p.current),()=>{k.disconnect()}}},[e]),h.useEffect(()=>{if(a){let m=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(m)}}},[a]);let x=()=>{r(!0)},y=()=>{r(!1),l(!1)};return t?e!=="intent"?[o,p,{}]:[o,p,{onFocus:se(s,x),onBlur:se(u,y),onMouseEnter:se(c,x),onMouseLeave:se(f,y),onTouchStart:se(v,x)}]:[!1,p,{}]}function se(e,n){return t=>{e&&e(t),t.defaultPrevented||n(t)}}function tr({page:e,...n}){let{router:t}=dt(),a=h.useMemo(()=>Xe(t.routes,e,t.basename),[t.routes,e,t.basename]);return a?h.createElement(rr,{page:e,matches:a,...n}):null}function nr(e){let{manifest:n,routeModules:t}=ct(),[a,r]=h.useState([]);return h.useEffect(()=>{let o=!1;return Hn(e,n,t).then(l=>{o||r(l)}),()=>{o=!0}},[e,n,t]),a}function rr({page:e,matches:n,...t}){let a=V(),{manifest:r,routeModules:o}=ct(),{basename:l}=dt(),{loaderData:s,matches:u}=Qn(),c=h.useMemo(()=>ut(e,n,u,r,a,"data"),[e,n,u,r,a]),f=h.useMemo(()=>ut(e,n,u,r,a,"assets"),[e,n,u,r,a]),v=h.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let y=new Set,m=!1;if(n.forEach(S=>{var w;let T=r.routes[S.route.id];!T||!T.hasLoader||(!c.some(C=>C.route.id===S.route.id)&&S.route.id in s&&((w=o[S.route.id])!=null&&w.shouldRevalidate)||T.hasClientLoader?m=!0:y.add(S.route.id))}),y.size===0)return[];let k=Kn(e,l,"data");return m&&y.size>0&&k.searchParams.set("_routes",n.filter(S=>y.has(S.route.id)).map(S=>S.route.id).join(",")),[k.pathname+k.search]},[l,s,a,r,c,n,e,o]),p=h.useMemo(()=>Yn(f,r),[f,r]),x=nr(f);return h.createElement(h.Fragment,null,v.map(y=>h.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...t})),p.map(y=>h.createElement("link",{key:y,rel:"modulepreload",href:y,...t})),x.map(({key:y,link:m})=>h.createElement("link",{key:y,...m})))}function ar(...e){return n=>{e.forEach(t=>{typeof t=="function"?t(n):t!=null&&(t.current=n)})}}var ft=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ft&&(window.__reactRouterVersion="7.7.1")}catch{}var ht=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,mt=h.forwardRef(function({onClick:n,discover:t="render",prefetch:a="none",relative:r,reloadDocument:o,replace:l,state:s,target:u,to:c,preventScrollReset:f,viewTransition:v,...p},x){let{basename:y}=h.useContext(B),m=typeof c=="string"&&ht.test(c),k,S=!1;if(typeof c=="string"&&m&&(k=c,ft))try{let O=new URL(window.location.href),H=c.startsWith("//")?new URL(O.protocol+c):new URL(c),re=W(H.pathname,y);H.origin===O.origin&&re!=null?c=re+H.search+H.hash:S=!0}catch{$(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let T=Sn(c,{relative:r}),[w,C,R]=er(a,p),G=sr(c,{replace:l,state:s,target:u,preventScrollReset:f,relative:r,viewTransition:v});function D(O){n&&n(O),O.defaultPrevented||G(O)}let Q=h.createElement("a",{...p,...R,href:k||T,onClick:S||o?n:D,ref:ar(x,C),target:u,"data-discover":!m&&t==="render"?"true":void 0});return w&&!m?h.createElement(h.Fragment,null,Q,h.createElement(tr,{page:T})):Q});mt.displayName="Link";var or=h.forwardRef(function({"aria-current":n="page",caseSensitive:t=!1,className:a="",end:r=!1,style:o,to:l,viewTransition:s,children:u,...c},f){let v=le(l,{relative:c.relative}),p=V(),x=h.useContext(pe),{navigator:y,basename:m}=h.useContext(B),k=x!=null&&hr(v)&&s===!0,S=y.encodeLocation?y.encodeLocation(v).pathname:v.pathname,T=p.pathname,w=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;t||(T=T.toLowerCase(),w=w?w.toLowerCase():null,S=S.toLowerCase()),w&&m&&(w=W(w,m)||w);const C=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let R=T===S||!r&&T.startsWith(S)&&T.charAt(C)==="/",G=w!=null&&(w===S||!r&&w.startsWith(S)&&w.charAt(S.length)==="/"),D={isActive:R,isPending:G,isTransitioning:k},Q=R?n:void 0,O;typeof a=="function"?O=a(D):O=[a,R?"active":null,G?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let H=typeof o=="function"?o(D):o;return h.createElement(mt,{...c,"aria-current":Q,className:O,ref:f,style:H,to:l,viewTransition:s},typeof u=="function"?u(D):u)});or.displayName="NavLink";var ir=h.forwardRef(({discover:e="render",fetcherKey:n,navigate:t,reloadDocument:a,replace:r,state:o,method:l=ve,action:s,onSubmit:u,relative:c,preventScrollReset:f,viewTransition:v,...p},x)=>{let y=cr(),m=fr(s,{relative:c}),k=l.toLowerCase()==="get"?"get":"post",S=typeof s=="string"&&ht.test(s),T=w=>{if(u&&u(w),w.defaultPrevented)return;w.preventDefault();let C=w.nativeEvent.submitter,R=(C==null?void 0:C.getAttribute("formmethod"))||l;y(C||w.currentTarget,{fetcherKey:n,method:R,navigate:t,replace:r,state:o,relative:c,preventScrollReset:f,viewTransition:v})};return h.createElement("form",{ref:x,method:k,action:m,onSubmit:a?u:T,...p,"data-discover":!S&&e==="render"?"true":void 0})});ir.displayName="Form";function lr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gt(e){let n=h.useContext(te);return I(n,lr(e)),n}function sr(e,{target:n,replace:t,state:a,preventScrollReset:r,relative:o,viewTransition:l}={}){let s=Te(),u=V(),c=le(e,{relative:o});return h.useCallback(f=>{if(Bn(f,n)){f.preventDefault();let v=t!==void 0?t:Se(u)===Se(c);s(e,{replace:v,state:a,preventScrollReset:r,relative:o,viewTransition:l})}},[u,s,c,t,a,n,e,r,o,l])}var ur=0,dr=()=>`__${String(++ur)}__`;function cr(){let{router:e}=gt("useSubmit"),{basename:n}=h.useContext(B),t=Fn();return h.useCallback(async(a,r={})=>{let{action:o,method:l,encType:s,formData:u,body:c}=Gn(a,n);if(r.navigate===!1){let f=r.fetcherKey||dr();await e.fetch(f,t,r.action||o,{preventScrollReset:r.preventScrollReset,formData:u,body:c,formMethod:r.method||l,formEncType:r.encType||s,flushSync:r.flushSync})}else await e.navigate(r.action||o,{preventScrollReset:r.preventScrollReset,formData:u,body:c,formMethod:r.method||l,formEncType:r.encType||s,replace:r.replace,state:r.state,fromRouteId:t,flushSync:r.flushSync,viewTransition:r.viewTransition})},[e,n,t])}function fr(e,{relative:n}={}){let{basename:t}=h.useContext(B),a=h.useContext(q);I(a,"useFormAction must be used inside a RouteContext");let[r]=a.matches.slice(-1),o={...le(e||".",{relative:n})},l=V();if(e==null){o.search=l.search;let s=new URLSearchParams(o.search),u=s.getAll("index");if(u.some(f=>f==="")){s.delete("index"),u.filter(v=>v).forEach(v=>s.append("index",v));let f=s.toString();o.search=f?`?${f}`:""}}return(!e||e===".")&&r.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),t!=="/"&&(o.pathname=o.pathname==="/"?t:z([t,o.pathname])),Se(o)}function hr(e,{relative:n}={}){let t=h.useContext(at);I(t!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=gt("useViewTransitionState"),r=le(e,{relative:n});if(!t.isTransitioning)return!1;let o=W(t.currentLocation.pathname,a)||t.currentLocation.pathname,l=W(t.nextLocation.pathname,a)||t.nextLocation.pathname;return ge(r.pathname,l)!=null||ge(r.pathname,o)!=null}const mr=({message:e})=>{const n=Te();return i.jsx(d.Container,{size:"xs",style:{height:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx(d.Alert,{color:"red",title:"Not Found",variant:"404 - Not Found",icon:i.jsx(M.IconInfoCircle,{size:12,stroke:1.5}),children:i.jsxs(d.Stack,{align:"flex-start",children:[e||"Sorry, the page you are looking for does not exist.",i.jsx(d.Button,{variant:"filled",onClick:()=>n("/"),size:"xs",children:"Back Home"})]})})})},gr=({message:e})=>i.jsx(d.Alert,{color:"red",title:"Not Found",variant:"404 - Not Found",icon:i.jsx(M.IconInfoCircle,{size:12,stroke:1.5}),children:e||"Sorry, the page you are looking for does not exist."}),Fe=({message:e})=>i.jsx(d.Text,{c:"red",size:"sm",children:e||"Not Found"}),pr=({tip:e})=>e===void 0?i.jsx(d.Flex,{justify:"center",align:"center",children:i.jsx(d.Loader,{color:"blue",size:"md"})}):i.jsxs(d.Flex,{gap:"md",direction:"column",justify:"center",align:"center",style:{height:"100%"},children:[i.jsx(d.Loader,{color:"blue",size:"md"}),e]}),xr=({tip:e})=>e===void 0?i.jsx(d.Loader,{color:"blue",size:"xs"}):i.jsxs(d.Flex,{gap:"md",direction:"column",justify:"center",align:"center",children:[i.jsx(d.Loader,{color:"blue",size:"xs"}),e]}),vr=({message:e})=>i.jsx(d.Alert,{color:"red",title:"Not Found",variant:"403 - Not Authorized",icon:i.jsx(M.IconInfoCircle,{size:12,stroke:1.5}),children:e||"Sorry, you are not authorized to access this page."});function yr(e,n){return e.reduce((t,a)=>{const r=n(a);return t[r]||(t[r]=[]),t[r].push(a),t},{})}function br(e,n){const t=[];let a;return e.reduce((r,o)=>{const l=n(o);return l===void 0?(a===void 0&&(a=t.length,t.push([])),t[a].push(o)):(r[l]===void 0&&(r[l]=t.length,t.push([])),t[r[l]].push(o)),r},{}),t}function wr(e,n){const t=new Set;return e.filter(a=>{const r=n(a);return t.has(r)?!1:(t.add(r),!0)})}class Sr{constructor(){J(this,"items",[]);J(this,"seen",new Set)}add(n,t){const a=t(n);this.seen.has(a)||(this.items.push(n),this.seen.add(a))}toArray(){return this.items}}class Me{constructor(){J(this,"children",new Map);J(this,"isEndOfWord",!1);J(this,"value","")}}class Ae{constructor(){J(this,"root",new Me)}insert(n){let t=this.root;for(const a of n){let r=t.children.get(a);r===void 0&&(r=new Me,t.children.set(a,r)),t=r}t.isEndOfWord=!0,t.value=n}findLongestPrefix(n){let t=this.root,a={match:"",remaining:n};for(let r=0;r<n.length;r++){const o=n[r];if(!t.children.has(o))break;t=t.children.get(o),t.isEndOfWord&&(a={match:t.value,remaining:n.slice(r+1)})}return a}}var pt=(e=>(e[e.Allow=0]="Allow",e[e.Denied=1]="Denied",e[e.Pending=2]="Pending",e))(pt||{});class xt extends Ae{constructor(){super(...arguments);J(this,"pathToKey",new Map)}normalizePath(t){return t==="/"?"/":t.replace(/\/$/,"")}insertRoute(t,a){const r=this.normalizePath(t);this.insert(r),this.pathToKey.set(r,a)}findMatchingKey(t){const a=this.normalizePath(t),r=this.findLongestPrefix(a);if(r.match&&this.pathToKey.has(r.match)&&(a===r.match||r.remaining.startsWith("/")||r.remaining===""))return this.pathToKey.get(r.match)}}function vt(e){const n={},t={},a={},r=(o,l=[])=>{o.forEach(s=>{const u=[...l,s.key];n[s.key]=s,t[s.key]=u,s.route!==void 0&&(a[s.key]=s.route),s.children!==void 0&&s.children.length>0&&r(s.children,u)})};return r(e),{key2item:n,key2fullpath:t,key2route:a}}function jr(e){const n=new xt,t=a=>{a.forEach(r=>{if(r.route!==void 0){const o=r.route.path.getURL();n.insertRoute(o,r.key)}r.children!==void 0&&r.children.length>0&&t(r.children)})};return t(e),n}function yt(e,n){return e.map(t=>{if(t.route!==void 0)return n(t.route.role)===0?t:null;if(t.children!==void 0){const a=t.children.filter(r=>r.route!==void 0?n(r.route.role)===0:!0);return a.length>0?{...t,children:a}:null}return t}).filter(t=>t!==null)}const Cr=e=>{const n=Te(),t=V(),[a,r]=j.useState(new Set),[o,l]=j.useState(new Set),[s,u]=j.useState(),c=j.useMemo(()=>yt(e.items,e.checkPermission),[e.items,e.checkPermission]),f=j.useMemo(()=>jr(e.items),[e.items]),{key2fullpath:v,key2route:p}=j.useMemo(()=>vt(c),[c]);j.useEffect(()=>{const y=t.pathname,m=f.findMatchingKey(y);m!==void 0&&(l(new Set(v[m])),u(m))},[t,p]);const x=j.useMemo(()=>{function y(m,k){var T,w;const S=m.children!==void 0&&m.children.length>0;return S?i.jsxs("div",{onMouseEnter:()=>{o.has(m.key)||r(C=>{const R=new Set(C);return R.add(m.key),R})},onMouseLeave:()=>{o.has(m.key)||r(C=>{const R=new Set(C);return R.delete(m.key),R})},children:[i.jsx(d.NavLink,{active:s===m.key,href:(T=m.route)==null?void 0:T.path.getURL(),label:m.label,leftSection:m.icon,styles:{label:{fontSize:"md"},root:{borderRadius:"var(--mantine-radius-sm)"}},ml:k===0?void 0:k===1?"md":`calc(var(--mantine-spacing-md) * ${k})`,w:"unset",rightSection:S?i.jsx(M.IconChevronRight,{size:12,stroke:1.5,className:"mantine-rotate-rtl"}):void 0,opened:a.has(m.key)||o.has(m.key),onClick:C=>{C.ctrlKey||C.metaKey||(C.preventDefault(),l(G=>{const D=new Set(G);return G.has(m.key)?D.delete(m.key):D.add(m.key),D}))}},m.key),(o.has(m.key)||a.has(m.key))&&m.children.map(C=>y(C,k+1))]},`container-${m.key}`):i.jsx(d.NavLink,{active:s===m.key,href:(w=m.route)==null?void 0:w.path.getURL(),label:m.label,leftSection:m.icon,styles:{label:{fontSize:"md"},root:{borderRadius:"var(--mantine-radius-sm)"}},ml:k===0?void 0:k===1?"md":`calc(var(--mantine-spacing-md) * ${k})`,w:"unset",onClick:C=>{C.ctrlKey||C.metaKey||(C.preventDefault(),m.route!=null&&m.route.path.path().open(n))}},m.key)}return c.map(m=>y(m,0))},[c,s,o,a,n]);return i.jsx(i.Fragment,{children:x})},ue=({value:e})=>i.jsx(d.Text,{size:"sm",children:e});function Oe(e,n){const t=n.getDate().toString().padStart(2,"0"),a=(n.getMonth()+1).toString().padStart(2,"0"),r=n.getFullYear();return e.baseName==="en-US"?`${a}/${t}/${r}`:e.baseName==="vi-VN"?`${t}/${a}/${r}`:`${a}/${t}/${r}`}const bt=({value:e})=>{const n=j.useContext(ee),t=j.useMemo(()=>{const a=e.getHours().toString().padStart(2,"0"),r=e.getMinutes().toString().padStart(2,"0"),o=e.getSeconds().toString().padStart(2,"0");return Oe(n,e)+`${a}:${r}:${o}`},[n,e]);return i.jsx(d.Text,{size:"sm",children:t})},wt=({value:e})=>{const n=j.useContext(ee),t=j.useMemo(()=>Oe(n,e),[n,e]);return i.jsx(d.Text,{size:"sm",children:t})},kr=({value:e})=>{const n=j.useContext(ee),[t,a]=j.useMemo(()=>{const r=Oe(n,e),o=e.getHours().toString().padStart(2,"0"),l=e.getMinutes().toString().padStart(2,"0"),s=e.getSeconds().toString().padStart(2,"0");return[r,`${o}:${l}:${s}`]},[n,e]);return i.jsx(d.Text,{size:"sm",title:a,children:t})},Er={yes:{lang2value:{en:"Yes",vi:"Có"},lang:"en"},no:{lang2value:{en:"No",vi:"Không"},lang:"en"}},Tr=({value:e})=>i.jsx(d.Checkbox,{checked:e,label:i.jsx(A,{value:Er[e?"yes":"no"]}),readOnly:!0});function St(e,n,t,a){const r=e.getByName(n.targetClass),o=a[n.targetClass];j.useEffect(()=>{r.fetchByIds(t)},[t]);const l={};for(const s of t)l[s]=r.get(s);return[l,o]}const de=K.observer(({db:e,property:n,value:t,entityRoutes:a})=>{const r=j.useMemo(()=>[t],[t]),[o,l]=St(e,n,r,a),s=o[t];return s===void 0?i.jsx(d.Text,{size:"sm",children:t}):s===null?i.jsx(Fe,{}):l===void 0?i.jsx(d.Text,{size:"sm",children:s.name}):i.jsx(Ke.InternalLink,{path:l,openInNewPage:!1,urlArgs:{id:s.id},queryArgs:{},children:s.name})}),ce=K.observer(({db:e,property:n,value:t,entityRoutes:a})=>{const[r,o]=St(e,n,t,a);return i.jsx(d.Group,{gap:"xs",children:t.map((l,s)=>{const u=r[l];return u===void 0?i.jsx(d.Text,{size:"sm",children:t},l):u===null?i.jsx(Fe,{},l):o===void 0?i.jsx(d.Text,{size:"sm",children:u.name},s):i.jsx(Ke.InternalLink,{path:o,openInNewPage:!1,urlArgs:{id:u.id},queryArgs:{},children:u.name},s)})})}),U={string:ue,integer:ue,float:ue,boolean:Tr,"string[]":ue,enum:ue,datetime:bt,date:wt},Rr=({property:e,value:n,onChange:t})=>i.jsx(d.Input,{id:e.name,type:"checkbox",checked:n,onChange:a=>{const r=a.target.checked;t(r)}}),jt=({property:e,value:n,onChange:t})=>i.jsx(d.Input,{id:e.name,type:"number",value:n,onChange:a=>{const r=a.target.value;t(r===""?void 0:Number(r))}}),Nr={lang2value:{en:"The leading zero is not necessary in international phone number format. For example, if your phone number is 0123456789, you should enter it as 123-456-789.",vi:"Số 0 đầu tiên không cần thiết trong định dạng điện thoại quốc tế. Ví dụ, nếu số điện thoại của bạn là 0123456789, bạn nên nhập nó là 123-456-789."},lang:"en"},Pr={lang2value:{en:"No valid country code found.",vi:"Không tìm thấy mã quốc gia hợp lệ. "},lang:"en"},ne={84:{name:"Vietnam",flags:[P.VN]},1:{name:"US, Canada",flags:[P.US,P.CA]},61:{name:"Australia",flags:[P.AU]},81:{name:"Japan",flags:[P.JP]},44:{name:"UK",flags:[P.UK]},33:{name:"France",flags:[P.FR]},49:{name:"Germany",flags:[P.DE]},91:{name:"India",flags:[P.IN]},55:{name:"Brazil",flags:[P.BR]},34:{name:"Spain",flags:[P.ES]},39:{name:"Italy",flags:[P.IT]},64:{name:"New Zealand",flags:[P.NZ]},52:{name:"Mexico",flags:[P.MX]},86:{name:"China",flags:[P.CN]}},Ir=(e,n)=>{if(e==="")return{match:"84",remaining:""};const t=e.replace(/[^\d]/g,""),a=n.findLongestPrefix(t);if(a.match==="")throw new Error(`No valid country code found for phone number: ${e}`);return a},Ct=({value:e})=>{const n=ne[e];if(n!==void 0)return i.jsxs(d.Group,{gap:"sm",wrap:"nowrap",align:"center",children:[i.jsxs(d.Text,{size:"sm",children:["+",e]}),i.jsx(d.Group,{gap:4,wrap:"nowrap",children:n.flags.map((t,a)=>i.jsx(he,{flag:t},a))})]})},Lr=({value:e,onChange:n,error:t,id:a})=>{const[r,o]=j.useState(""),[l,s]=j.useState(!1),[u,c]=j.useState(""),[f,v]=j.useState(!1),p=j.useMemo(()=>{const w=new Ae;return Object.keys(ne).forEach(C=>{w.insert(C)}),w},[ne]),{rawInput:x}=j.useMemo(()=>{try{const{match:w,remaining:C}=Ir(e,p);return c(w),v(!1),{rawInput:C}}catch{return v(!0),c(""),{rawInput:e}}},[e]),y=d.useCombobox({onDropdownClose:()=>{y.resetSelectedOption(),o("")},onDropdownOpen:()=>{y.updateSelectedOptionIndex("active")}}),m=j.useMemo(()=>Object.keys(ne),[ne]),k=(w,C)=>{const R=w.replace(/[^\d]/g,"");return R.length===0?`+${C}`:R.startsWith("0")?(s(!0),`+${C}${R}`):(s(!1),`+${C}${R}`)},S=j.useMemo(()=>m.filter(w=>ne[w].name.toLowerCase().includes(r.toLowerCase())||w.includes(r)),[r,m]),T=j.useMemo(()=>S.map((w,C)=>i.jsx(d.Combobox.Option,{value:w,children:i.jsx(Ct,{value:w})},C)),[S]);return i.jsxs("div",{children:[i.jsx(d.Grid,{gutter:"xs",children:i.jsx(d.Grid.Col,{children:i.jsxs(d.Group,{gap:5,children:[i.jsxs(d.Combobox,{store:y,position:"top-start",onOptionSubmit:w=>{o(""),y.closeDropdown(),n({target:{value:k(x,w)}})},children:[i.jsx(d.Combobox.Target,{children:i.jsx(d.InputBase,{component:"button",type:"button",pointer:!0,rightSection:i.jsx(d.Combobox.Chevron,{}),onClick:()=>y.toggleDropdown(),rightSectionPointerEvents:"none",w:110,children:i.jsx(Ct,{value:u})})}),i.jsxs(d.Combobox.Dropdown,{children:[i.jsx(d.Combobox.Search,{leftSection:i.jsx(M.IconSearch,{size:14,stroke:1.5}),placeholder:".....",value:r,onChange:w=>o(w.currentTarget.value)}),i.jsx(d.Combobox.Options,{children:T.length>0?T:i.jsx(d.Combobox.Empty,{children:i.jsx(d.Text,{size:"sm",children:"Nothing found"})})})]})]}),u===""?i.jsx(d.Input,{id:a,value:x,type:"phone_number",onChange:w=>{n({target:{value:w.target.value}})},error:t,flex:1}):i.jsx(d.Input,{id:a,value:x,type:"phone_number",onAccept:w=>{const C=w.replace(/[^\d]/g,"");n({target:{value:k(C,u)}})},component:Gt.IMaskInput,mask:"000-000-0000",error:t,flex:1})]})})}),(l||f||t&&typeof t=="string")&&i.jsx(d.Grid,{gutter:"xs",children:i.jsx(d.Grid.Col,{children:i.jsx(d.Input.Error,{children:l?i.jsx(A,{value:Nr}):f?i.jsx(A,{value:Pr}):t})})})]})},De=({property:e,error:n,value:t,onChange:a})=>{const[r,o]=j.useMemo(()=>e.constraints.includes("password")?["password",d.PasswordInput]:e.constraints.includes("phone_number")?["phone_number",Lr]:[e.constraints.includes("email")?"email":e.constraints.includes("url")?"url":"text",d.Input],[e.constraints]);return i.jsx(o,{id:e.name,value:t,type:r,onChange:l=>a(l.target.value),error:n})},_e={integer:jt,float:jt,string:De,boolean:Rr,"string[]":De,enum:De};function Fr(e,n){const[t,a]=j.useState(""),[r,o]=j.useState([]);return j.useEffect(()=>{e.getByName(n.targetClass).fetch({limit:100,offset:0}).then(s=>o(s.records))},[n.name]),{data:r,query:t,setQuery:s=>{a(s);const u=e.getByName(n.targetClass);o(u.filter(c=>c.name.toLowerCase().includes(s.toLowerCase())))},table:e.getByName(n.targetClass)}}const Mr=e=>e.name,Ar=e=>i.jsx(d.Text,{size:"sm",children:e.name}),Or=K.observer(e=>i.jsx("h1",{children:"SingleForeignKey"})),Dr=K.observer(({db:e,property:n,value:t,onChange:a})=>{const{table:r,data:o,query:l,setQuery:s}=Fr(e,n);return i.jsxs(d.Stack,{gap:"sm",children:[i.jsx(_r,{name:n.name,query:l,setQuery:s,data:o,onSelect:u=>{t.includes(u)||a([...t,u])},renderOption:Mr,isIdInteger:n.datatype==="integer"}),i.jsx($r,{items:t.map(u=>r.get(u)),onDelete:u=>{a(t.filter(c=>c!==u.id))},render:Ar})]})}),_r=({name:e,data:n,onSelect:t,renderOption:a,isIdInteger:r,query:o,setQuery:l})=>{const s=d.useCombobox({onDropdownClose:()=>s.resetSelectedOption()}),u=j.useMemo(()=>n.map(c=>i.jsx(d.Combobox.Option,{value:c.id.toString(),children:a(c)},c.id)),[n]);return i.jsxs(d.Combobox,{store:s,onOptionSubmit:c=>{t(r?parseInt(c):c),l(""),s.closeDropdown()},offset:0,shadow:"sm",children:[i.jsx(d.Combobox.Target,{children:i.jsx(d.Input,{id:e,pointer:!0,rightSection:i.jsx(M.IconSearch,{size:16,stroke:1.5}),rightSectionPointerEvents:"none",onClick:()=>s.toggleDropdown(),placeholder:"Type to search...",value:o,onChange:c=>{l(c.currentTarget.value)}})}),i.jsx(d.Combobox.Dropdown,{children:i.jsx(d.Combobox.Options,{children:u.length===0?i.jsx(d.Combobox.Empty,{children:"Nothing found"}):u})})]})},$r=({items:e,onDelete:n,render:t})=>{const a=j.useMemo(()=>{const r=[];for(let o=0;o<e.length;o++){const l=e[o];r.push(i.jsxs(d.Group,{justify:"space-between",p:"sm",children:[t(l),i.jsx(d.CloseButton,{size:"sm",onClick:()=>n(l)})]},o)),o<e.length-1&&r.push(i.jsx(d.Divider,{},`divider-${o}`))}return r},[e]);if(a.length!==0)return i.jsx(d.Paper,{bd:"1px solid #ddd",children:a})},kt={requiredLabelLeft:"_requiredLabelLeft_l5p83_1",requiredLabelRight:"_requiredLabelRight_l5p83_11"},Et=({label:e,name:n,required:t=!1,tooltip:a,style:r,align:o="left"})=>{const l=t?o==="left"?kt.requiredLabelRight:kt.requiredLabelLeft:"";return i.jsx(d.Flex,{align:"center",h:36,children:i.jsx("label",{htmlFor:n,style:r,children:i.jsxs(d.Group,{gap:4,children:[i.jsx(d.Text,{size:"sm",className:l,children:e}),a!==void 0&&i.jsx(d.Tooltip,{label:a,withArrow:!0,children:i.jsx(M.IconHelpOctagonFilled,{size:16,stroke:1.5,style:{color:"var(--mantine-color-dimmed)"}})})]})})})},zr={type:"vertical",helpAlwaysVisible:!1},Tt=K.observer(({store:e,record:n,property:t,layout:a=zr,InputComponent:r,validator:o})=>{const[l,s]=j.useState(void 0),u=n[t.tsName],c=v=>{var x;if(X.isDraftRecord(n))n[t.updateFuncName](v);else{const y=n.toDraft();y[t.updateFuncName](v),e.setDraft(y)}const p=o(v);p.isValid?s(void 0):s((x=p.errorMessage)==null?void 0:x.t({args:{name:t.label}}))};if(Br(a))return i.jsxs(d.Stack,{gap:5,children:[i.jsxs(d.Grid,{gutter:"sm",children:[i.jsx(d.Grid.Col,{span:a.labelCol,style:{display:"flex",justifyContent:a.align||"left"},children:i.jsx(Et,{label:i.jsx(A,{value:t.label}),name:t.name,required:t.isRequired,tooltip:t.description!==void 0?i.jsx(A,{value:t.description}):void 0,align:a.align})}),i.jsx(d.Grid.Col,{span:a.itemCol,children:i.jsx(r,{db:e.db,property:t,value:u,error:l!==void 0,onChange:c})})]}),l!==void 0&&i.jsxs(d.Grid,{gutter:"sm",children:[i.jsx(d.Grid.Col,{span:a.labelCol}),i.jsx(d.Grid.Col,{span:a.itemCol,children:i.jsx(d.Input.Error,{children:l})})]})]});let f=i.jsx(A,{value:t.label});return!a.helpAlwaysVisible&&t.description!==void 0&&(f=i.jsxs(d.Group,{gap:4,style:{display:"inline-flex"},children:[f,i.jsx(d.Tooltip,{label:i.jsx(A,{value:t.description}),withArrow:!0,children:i.jsx(M.IconHelpOctagonFilled,{size:16,stroke:1.5,style:{color:"var(--mantine-color-dimmed)"}})})]})),i.jsx(d.Input.Wrapper,{label:f,description:a.helpAlwaysVisible&&t.description!==void 0?i.jsx(A,{value:t.description}):void 0,required:t.isRequired,children:i.jsx(r,{db:e.db,property:t,value:u,error:l,onChange:c})})});function Br(e){return e.type==="horizontal"}const Rt=12,qr=e=>{const n=e.schema,t=j.useMemo(()=>{const a=Math.max(...e.fieldGroups.map(r=>Math.max(...r.fields.map(o=>o.length))));return e.fieldGroups.map((r,o)=>Ur(n,e.store,e.record,o,r,a,e.layout))},[n,e.store,e.record,e.fieldGroups,e.layout]);return i.jsx("form",{onSubmit:e.onSubmit===void 0?void 0:a=>{a.preventDefault(),e.onSubmit!==void 0&&X.isDraftRecord(e.record)&&e.onSubmit(e.record)},children:i.jsxs(d.Stack,{gap:"sm",className:e.className,style:e.styles,children:[t,i.jsx(d.Group,{gap:"sm",children:e.actions.map((a,r)=>i.jsx(d.Button,{variant:a.variant,onClick:()=>{a.onClick!==void 0&&a.onClick()},disabled:a.disabled,children:a.label},r))})]})})};function Ur(e,n,t,a,r,o,l){const s=r.fields,u=[];for(let f=0;f<s.length;f++){const v=Rt/s[f].length;if(!Number.isInteger(v))throw new Error(`Span must be an integer, but got ${v} for row ${f}`);let p;l!==void 0&&typeof l=="object"&&l.type==="horizontal"?p={...l,labelCol:Math.floor(l.labelCol*s[f].length/o),itemCol:Rt-Math.floor(l.labelCol*s[f].length/o)}:p=l;for(let x=0;x<s[f].length;x++){const y=s[f][x],m=e.allProperties[y];let k;if(X.isObjectProperty(m))k=m.cardinality==="N:N"||m.cardinality==="1:N"?Dr:Or;else{if(_e[m.datatype]===void 0)throw new Error(`No input component found for datatype ${m.datatype}`);k=_e[m.datatype]}u.push(i.jsx(d.Grid.Col,{span:v,children:i.jsx(Tt,{store:n,record:t,property:m,layout:p,InputComponent:k,validator:e.validators[y]})},`${f}-${x}`))}}const c=i.jsx(d.Grid,{gutter:"sm",children:u},a);return r.name!==void 0?i.jsx(d.Fieldset,{legend:r.name,children:c},a):c}const Nt=({actions:e,reloadData:n,selectedRowKeys:t,size:a="xs"})=>i.jsxs(d.Group,{gap:a,children:[(e==null?void 0:e.add)&&i.jsx(d.Button,{variant:"light",leftSection:i.jsx(M.IconPlus,{size:16,stroke:1.5}),size:a,onClick:e.add,children:"Add"}),(e==null?void 0:e.edit)&&i.jsx(d.Button,{leftSection:i.jsx(M.IconPencil,{size:16,stroke:1.5}),size:a,variant:"light",onClick:()=>e.edit!==void 0&&e.edit(t[0]),disabled:t.length!==1,children:"Edit"}),(e==null?void 0:e.reload)&&i.jsx(d.Button,{leftSection:i.jsx(M.IconReload,{size:16,stroke:1.5}),size:a,onClick:n,variant:"light",children:"Reload"}),(e==null?void 0:e.import)&&i.jsx(d.Button,{leftSection:i.jsx(M.IconDatabaseImport,{size:16,stroke:1.5}),size:a,variant:"light",onClick:e.import,children:"Import"}),(e==null?void 0:e.export)&&i.jsx(d.Button,{leftSection:i.jsx(M.IconDownload,{size:16,stroke:1.5}),size:a,variant:"light",onClick:e.export,children:"Export"})]}),Pt=e=>e!==void 0&&(e.add!==void 0||e.edit!==void 0||e.delete!==void 0||e.export!==void 0||e.reload===!0||e.import!==void 0),Gr="__selectcol__",{Thead:Kr,Tr:It,Th:Wr,Tbody:Vr,Td:Hr}=d.Table,Lt=e=>{const n=i.jsxs(d.Table,{striped:!0,highlightOnHover:!0,verticalSpacing:"xs",tabularNums:!0,children:[i.jsx(Kr,{children:e.table.getHeaderGroups().map(a=>i.jsx(It,{children:a.headers.map(r=>i.jsx(Wr,{w:r.id===Gr?"1%":void 0,children:r.isPlaceholder?null:Z.flexRender(r.column.columnDef.header,r.getContext())},r.id))},a.id))}),i.jsx(Vr,{pos:"relative",children:e.table.getRowModel().rows.map(a=>i.jsx(It,{bg:e.selectedRowKeys[a.id]?"var(--mantine-color-blue-light)":void 0,children:a.getVisibleCells().map(r=>i.jsx(Hr,{children:Z.flexRender(r.column.columnDef.cell,r.getContext())},r.id))},a.id))})]});if(!e.bordered)return n;const t={};return e.hasTopSection&&(t.borderTopLeftRadius=0,t.borderTopRightRadius=0),e.hasBottomSection&&(t.borderBottomLeftRadius=0,t.borderBottomRightRadius=0),i.jsx(d.Paper,{withBorder:!0,p:0,style:t,children:n})},Yr={pageSizeSelectorActive:"_pageSizeSelectorActive_1wv6j_1"},Ft=({total:e,pageIndex:n,pageSize:t,allowPageSizeChange:a=!0,onUpdatePagination:r})=>{const o=i.jsx(d.Pagination,{size:"sm",total:e,value:n+1,onChange:l=>r(l-1,t)});return a?i.jsxs(d.Group,{gap:"sm",children:[i.jsxs("div",{children:[i.jsx(d.Text,{size:"sm",component:"span",pr:"xs",c:"dimmed",children:"Records per page"}),i.jsx(Jr,{size:"sm",values:["10","20","50","100"],value:t.toString(),onChange:l=>{r(0,parseInt(l,10))}})]}),o]}):o},Mt={xs:d.rem(22),sm:d.rem(26),md:d.rem(32),lg:d.rem(38),xl:d.rem(44)};function Jr({size:e,values:n,value:t,onChange:a}){return i.jsxs(d.Menu,{withinPortal:!0,withArrow:!0,offset:2,children:[i.jsx(d.MenuTarget,{children:i.jsx(d.Button,{size:e,variant:"default",rightSection:i.jsx(M.IconSelector,{size:16,stroke:1.5}),style:[{fontWeight:"normal"},r=>({height:Mt[e],paddingLeft:r.spacing[e],paddingRight:r.spacing[e]})],styles:{section:{marginInlineStart:2}},children:t})}),i.jsx(d.MenuDropdown,{children:n.map(r=>{const o=r===t;return i.jsx(d.MenuItem,{className:o?Yr.pageSizeSelectorActive:void 0,style:[{height:Mt[e]}],disabled:o,onClick:()=>a(r),children:i.jsx(d.Text,{component:"div",size:e,children:r})},r)})})]})}const At=new Set(["topRight","bottomRight"]),Xr=e=>{var S,T;const[n,t]=j.useState({records:[],total:0}),[a,r]=j.useState(!1),[o,l]=j.useState({}),s=w=>{r(!0),e.getData(w).then(C=>{t(C),r(!1)})},u=(w,C)=>{const R={...e.query.query,limit:C,offset:w*C};e.query.update(R)},[c,f,v]=j.useMemo(()=>{const w=e.query.query.limit,C=Math.floor((e.query.query.offset||0)/e.query.query.limit),R=Math.ceil(n.total/e.query.query.limit);return[w,C,R]},[e.query.query.limit,e.query.query.offset,n.total]);j.useEffect(()=>(n.total==0&&s(e.query.query),e.query.subscribe(s)),[e.query]);const p=j.useMemo(()=>Object.keys(o).filter(w=>o[w]).map(w=>e.normalizeRowId(w)),[o]);let x,y;Pt(e.actions)&&(x=i.jsx(Nt,{actions:e.actions,reloadData:()=>s(e.query.query),selectedRowKeys:p}));const m=((S=e.pagination)==null?void 0:S.positions)||At;if(m.size>0){const w=i.jsx(Ft,{total:v,pageIndex:f,pageSize:c,onUpdatePagination:u,allowPageSizeChange:(T=e.pagination)==null?void 0:T.showSizeChanger});m.has("topRight")&&(x!==void 0?x=i.jsxs(d.Group,{justify:"space-between",gap:"sm",children:[x,w]}):x=i.jsx(d.Flex,{justify:"flex-end",children:w})),(m.has("bottomRight")||m.has("bottomLeft")||m.has("bottomCenter"))&&(m.has("bottomLeft")?y=i.jsxs(d.Flex,{justify:"space-between",align:"center",children:[w,i.jsxs(d.Text,{size:"sm",c:"dimmed",children:["Showing ",f*c+1," to"," ",Math.min((f+1)*c,n.total)," of ",n.total," ","records"]})]}):y=i.jsxs(d.Flex,{justify:"space-between",align:"center",children:[i.jsxs(d.Text,{size:"sm",c:"dimmed",children:["Showing ",f*c+1," to"," ",Math.min((f+1)*c,n.total)," of ",n.total," ","records"]}),w]}))}const k=j.useMemo(()=>i.jsx(Zr,{data:n,loading:a,columns:e.columns,getRowId:e.getRowId,selectedRowKeys:o,setSelectedRowKeys:l,hasTopSection:x!==void 0,hasBottomSection:y!==void 0}),[n,a,e.columns,e.getRowId,o,l,x!==void 0,y!==void 0]);return x===void 0||y===void 0?k:i.jsxs("div",{children:[x!==void 0&&i.jsx(d.Paper,{withBorder:!0,p:"xs",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:"none"},children:x}),k,y!==void 0&&i.jsx(d.Paper,{withBorder:!0,p:"xs",style:{borderTopLeftRadius:0,borderTopRightRadius:0,borderTop:"none"},children:y})]})},Zr=e=>{const n=j.useMemo(()=>{const a=[{id:"selection",header:({table:r})=>i.jsx(d.Checkbox,{checked:r.getIsAllRowsSelected(),indeterminate:r.getIsSomeRowsSelected(),onChange:r.getToggleAllRowsSelectedHandler()}),cell:({row:r})=>i.jsx(d.Checkbox,{checked:r.getIsSelected(),disabled:!r.getCanSelect(),onChange:r.getToggleSelectedHandler()})}];return e.columns.forEach(r=>{a.push({id:r.key,header:r.title,accessorFn:r.render,cell:({row:o})=>r.render(o.original)})}),a},[e.columns]),t=Z.useReactTable({data:e.data.records,columns:n,getCoreRowModel:Z.getCoreRowModel(),getRowId:a=>e.getRowId(a).toString(),state:{rowSelection:e.selectedRowKeys},onRowSelectionChange:e.setSelectedRowKeys,manualPagination:!0});return i.jsx(Lt,{table:t,selectedRowKeys:e.selectedRowKeys,bordered:!0,hasTopSection:e.hasTopSection,hasBottomSection:e.hasBottomSection})};function $e(e,n,t,{title:a,nestedKey:r,component:o}={}){let l;if(o!==void 0)l=o;else if(X.isObjectProperty(t))t.cardinality==="1:N"||t.cardinality==="N:N"?l=ce:l=de;else{if(U[t.datatype]===void 0)throw new Error(`No display component found for datatype ${t.datatype}`);l=U[t.datatype]}const s={key:t.name,title:a||i.jsx(A,{value:t.label}),accessorFn:u=>u[t.tsName],render:u=>{const c=u[t.tsName];return i.jsx(l,{db:e,property:t,value:c,entityRoutes:n})}};return r!==void 0&&(s.accessorFn=u=>u[r][t.tsName],s.render=u=>{const c=u[r][t.tsName];return i.jsx(l,{db:e,property:t,value:c,entityRoutes:n})}),s}function Qr(e,n,t,a,{title:r,nestedKey:o,component:l}={}){let s;if(l!==void 0)s=l;else if(X.isObjectProperty(a))a.cardinality==="1:N"||a.cardinality==="N:N"?s=ce:s=de;else{if(U[a.datatype]===void 0)throw new Error(`No display component found for datatype ${a.datatype}`);s=U[a.datatype]}const u={key:t+"."+a.name,title:r||i.jsx(A,{value:a.label}),accessorFn:c=>c[t.tsName][a.tsName],render:c=>{const f=c[t.tsName][a.tsName];return i.jsx(s,{db:e,property:a,value:f,entityRoutes:n})}};return o!==void 0&&(u.accessorFn=c=>c[o][t.tsName][a.tsName],u.render=c=>{const f=c[o][t.tsName][a.tsName];return i.jsx(s,{db:e,property:a,value:f,entityRoutes:n})}),u}function ea(e,n,t,a,r={}){return a.map(o=>ze(o)?o:$e(e,t,n.publicProperties[o],r))}function ta(e,n,t,a=[],r={}){return a.map(o=>ze(o)?o:$e(e,t,n.publicProperties[o],r))}function ze(e){return typeof e=="object"&&"key"in e&&"title"in e}const na=new Set(["topRight","bottomRight"]),ra=e=>{var f,v;const[n,t]=j.useState({}),a=j.useMemo(()=>{const p=[{id:"selection",header:({table:x})=>i.jsx(d.Checkbox,{checked:x.getIsAllRowsSelected(),indeterminate:x.getIsSomeRowsSelected(),onChange:x.getToggleAllRowsSelectedHandler()}),cell:({row:x})=>i.jsx(d.Checkbox,{checked:x.getIsSelected(),disabled:!x.getCanSelect(),onChange:x.getToggleSelectedHandler()})}];return e.columns.forEach(x=>{p.push({id:x.key,header:x.title,accessorFn:x.render,cell:({row:y})=>x.render(y.original)})}),p},[e.columns]),r=Z.useReactTable({data:e.data,columns:a,getCoreRowModel:Z.getCoreRowModel(),getPaginationRowModel:Z.getPaginationRowModel(),state:{rowSelection:n},onRowSelectionChange:t}),o=j.useMemo(()=>Object.keys(n).filter(p=>n[p]).map(Number),[n]);let l,s;Pt(e.actions)&&(l=i.jsx(Nt,{actions:e.actions,selectedRowKeys:o}));const u=((f=e.pagination)==null?void 0:f.positions)||na;if(u.size>0){const p=r.getState().pagination,x=i.jsx(Ft,{total:r.getPageCount(),pageIndex:p.pageIndex,pageSize:p.pageSize,onUpdatePagination:(y,m)=>r.setPagination({pageIndex:y,pageSize:m}),allowPageSizeChange:(v=e.pagination)==null?void 0:v.showSizeChanger});u.has("topRight")&&(l!==void 0?l=i.jsxs(d.Group,{justify:"space-between",gap:"sm",children:[l,x]}):l=i.jsx(d.Flex,{justify:"flex-end",children:x})),(u.has("bottomRight")||u.has("bottomLeft")||u.has("bottomCenter"))&&(u.has("bottomLeft")?s=i.jsxs(d.Flex,{justify:"space-between",align:"center",children:[x,i.jsxs(d.Text,{size:"sm",c:"dimmed",children:["Showing ",p.pageIndex*p.pageSize+1," to"," ",Math.min((p.pageIndex+1)*p.pageSize,e.data.length)," ","of ",e.data.length," records"]})]}):s=i.jsxs(d.Flex,{justify:"space-between",align:"center",children:[i.jsxs(d.Text,{size:"sm",c:"dimmed",children:["Showing ",p.pageIndex*p.pageSize+1," to"," ",Math.min((p.pageIndex+1)*p.pageSize,e.data.length)," ","of ",e.data.length," records"]}),x]}))}const c=i.jsx(Lt,{selectedRowKeys:n,table:r,bordered:!0,hasTopSection:l!==void 0,hasBottomSection:s!==void 0});return l===void 0&&s===void 0?c:i.jsxs("div",{children:[l!==void 0&&i.jsx(d.Paper,{withBorder:!0,p:"xs",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:"none"},children:l}),c,s!==void 0&&i.jsx(d.Paper,{withBorder:!0,p:"xs",style:{borderTopLeftRadius:0,borderTopRightRadius:0,borderTop:"none"},children:s})]})},Ot=K.observer(({store:e,record:n,property:t,DisplayComponent:a,entityRoutes:r})=>{const o=n[t.tsName];return i.jsxs("div",{children:[i.jsx(d.Text,{size:"sm",fw:500,children:i.jsx(A,{value:t.label})}),i.jsx(a,{db:e.db,entityRoutes:r,property:t,value:o})]})}),aa=K.observer(({store:e,record:n,properties:t,DisplayComponent:a,entityRoutes:r})=>{const o=t[t.length-1],l=t.reduce((s,u)=>{if(s!=null)return s[u.tsName]},n);return i.jsxs("div",{children:[i.jsx(d.Text,{size:"sm",fw:500,children:i.jsx(A,{value:o.label})}),l!==void 0&&i.jsx(a,{db:e.db,property:o,value:l,entityRoutes:r})]})}),oa=12,Dt=e=>{const n=e.schema,t=j.useMemo(()=>e.fieldGroups.map((a,r)=>ia(n,e.store,e.record,r,a,e.entityRoutes)),[n,e.store,e.record,e.fieldGroups]);return i.jsx(d.Stack,{gap:"sm",className:e.className,style:e.styles,children:t})};function ia(e,n,t,a,r,o){const l=r.fields,s=[];for(let u=0;u<l.length;u++){const c=oa/l[u].length;if(!Number.isInteger(c))throw new Error(`Span must be an integer, but got ${c} for row ${u}`);for(let f=0;f<l[u].length;f++){const v=l[u][f];let p;if(typeof v=="function")p=v(n,t);else if(typeof v=="object"&&"prop"in v){const x=e.allProperties[v.prop],y=v.display;p=i.jsx(Ot,{store:n,record:t,property:x,DisplayComponent:y,entityRoutes:o})}else{const x=e.allProperties[v];let y;if(X.isObjectProperty(x))y=x.cardinality==="N:N"||x.cardinality==="1:N"?ce:de;else{if(U[x.datatype]===void 0)throw new Error(`No display component found for datatype ${x.datatype}`);y=U[x.datatype]}p=i.jsx(Ot,{store:n,record:t,property:x,DisplayComponent:y,entityRoutes:o})}s.push(i.jsx(d.Grid.Col,{span:c,children:p},`${u}-${f}`))}}return i.jsx(d.Grid,{gutter:"sm",children:s},a)}function la(e,n,t){const a=e[e.length-1];let r;if(t!==void 0)r=t;else if(X.isObjectProperty(a))r=a.cardinality==="N:N"||a.cardinality==="1:N"?ce:de;else{if(U[a.datatype]===void 0)throw new Error(`No display component found for datatype ${a.datatype}`);r=U[a.datatype]}return(o,l)=>i.jsx(aa,{store:o,record:l,properties:e,DisplayComponent:r,entityRoutes:n})}const sa=e=>i.jsxs(d.Tabs,{defaultValue:e.fieldTabs[0].tabName,children:[i.jsx(d.Tabs.List,{children:e.fieldTabs.map((n,t)=>i.jsx(d.Tabs.Tab,{value:n.tabName,children:n.tabName},t))}),e.fieldTabs.map((n,t)=>i.jsx(d.Tabs.Panel,{value:n.tabName,pt:"sm",children:i.jsx(Dt,{schema:e.schema,store:e.store,record:e.record,fieldGroups:n.fieldGroups,styles:e.tabStyles,className:e.tabClassName,entityRoutes:e.entityRoutes})},t))]});b.CountryFlagComponent=he,b.DEFAULT_PAGINATION_POSITIONS=At,b.DataType2Component=_e,b.DataType2DisplayComponent=U,b.DateDisplay=wt,b.DateTimeDisplay=bt,b.DateTimeHideTimeDisplay=kr,b.EmojiCountryFlag=Je,b.FormItem=Tt,b.FormItemLabel=Et,b.LanguageSelector=Xt,b.Loading=pr,b.LoadingInline=xr,b.LocaleContext=ee,b.LocaleProvider=Yt,b.MenuTrie=xt,b.MultiForeignKeyDisplay=ce,b.MultiLingualString=A,b.NotAuthorized=vr,b.NotFound=mr,b.NotFoundInline=Fe,b.NotFoundSubPage=gr,b.OrderedUniqueList=Sr,b.Permission=pt,b.SVGCountryFlag=Ye,b.SeraEmbeddedTable=ra,b.SeraForm=qr,b.SeraTable=Xr,b.SeraVerticalMenu=Cr,b.SeraView=Dt,b.SeraViewTab=sa,b.SingleForeignKeyDisplay=de,b.Trie=Ae,b.TrieNode=Me,b.buildMenuItemIndex=vt,b.countryFlags=P,b.filterAllowedItems=yt,b.groupBy=yr,b.groupByAsList=br,b.isSeraColumn=ze,b.makeEmbeddedTableColumns=ta,b.makeFieldDisplay=la,b.makeTableColumn=$e,b.makeTableColumnFromNestedProperty=Qr,b.makeTableColumns=ea,b.uniqueList=wr,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
33
+ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let v=H(),p;p=v;let x=p.pathname||"/",y=x;if(c!=="/"){let S=c.replace(/^\//,"").split("/");y="/"+x.replace(/^\//,"").split("/").slice(S.length).join("/")}let m=Xe(e,{pathname:y});return _(f||m!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),_(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Nn(m&&m.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:z([c,r.encodeLocation?r.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?c:z([c,r.encodeLocation?r.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,t,a)}function kn(){let e=Mn(),n=vn(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),t=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:o},"ErrorBoundary")," or"," ",h.createElement("code",{style:o},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},n),t?h.createElement("pre",{style:r},t):null,l)}var En=h.createElement(kn,null),Tn=class extends h.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?h.createElement(q.Provider,{value:this.props.routeContext},h.createElement(Ee.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Rn({routeContext:e,match:n,children:t}){let a=h.useContext(te);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(q.Provider,{value:e},t)}function Nn(e,n=[],t=null,a=null){if(e==null){if(!t)return null;if(t.errors)e=t.matches;else if(n.length===0&&!t.initialized&&t.matches.length>0)e=t.matches;else return null}let r=e,o=t==null?void 0:t.errors;if(o!=null){let u=r.findIndex(c=>c.route.id&&(o==null?void 0:o[c.route.id])!==void 0);I(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),r=r.slice(0,Math.min(r.length,u+1))}let l=!1,s=-1;if(t)for(let u=0;u<r.length;u++){let c=r[u];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(s=u),c.route.id){let{loaderData:f,errors:v}=t,p=c.route.loader&&!f.hasOwnProperty(c.route.id)&&(!v||v[c.route.id]===void 0);if(c.route.lazy||p){l=!0,s>=0?r=r.slice(0,s+1):r=[r[0]];break}}}return r.reduceRight((u,c,f)=>{let v,p=!1,x=null,y=null;t&&(v=o&&c.route.id?o[c.route.id]:void 0,x=c.route.errorElement||En,l&&(s<0&&f===0?(st("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,y=null):s===f&&(p=!0,y=c.route.hydrateFallbackElement||null)));let m=n.concat(r.slice(0,f+1)),k=()=>{let S;return v?S=x:p?S=y:c.route.Component?S=h.createElement(c.route.Component,null):c.route.element?S=c.route.element:S=u,h.createElement(Rn,{match:c,routeContext:{outlet:u,matches:m,isDataRoute:t!=null},children:S})};return t&&(c.route.ErrorBoundary||c.route.errorElement||f===0)?h.createElement(Tn,{location:t.location,revalidation:t.revalidation,component:x,error:v,children:k(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):k()},null)}function Re(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Pn(e){let n=h.useContext(te);return I(n,Re(e)),n}function In(e){let n=h.useContext(ge);return I(n,Re(e)),n}function Ln(e){let n=h.useContext(q);return I(n,Re(e)),n}function Ne(e){let n=Ln(e),t=n.matches[n.matches.length-1];return I(t.route.id,`${e} can only be used on routes that contain a unique "id"`),t.route.id}function Fn(){return Ne("useRouteId")}function Mn(){var a;let e=h.useContext(Ee),n=In("useRouteError"),t=Ne("useRouteError");return e!==void 0?e:(a=n.errors)==null?void 0:a[t]}function On(){let{router:e}=Pn("useNavigate"),n=Ne("useNavigate"),t=h.useRef(!1);return it(()=>{t.current=!0}),h.useCallback(async(r,o={})=>{_(t.current,ot),t.current&&(typeof r=="number"?e.navigate(r):await e.navigate(r,{fromRouteId:n,...o}))},[e,n])}var lt={};function st(e,n,t){!n&&!lt[e]&&(lt[e]=!0,_(!1,t))}h.memo(An);function An({routes:e,future:n,state:t}){return Cn(e,void 0,t,n)}var xe="get",ve="application/x-www-form-urlencoded";function ye(e){return e!=null&&typeof e.tagName=="string"}function Dn(e){return ye(e)&&e.tagName.toLowerCase()==="button"}function $n(e){return ye(e)&&e.tagName.toLowerCase()==="form"}function _n(e){return ye(e)&&e.tagName.toLowerCase()==="input"}function zn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Bn(e,n){return e.button===0&&(!n||n==="_self")&&!zn(e)}var be=null;function qn(){if(be===null)try{new FormData(document.createElement("form"),0),be=!1}catch{be=!0}return be}var Un=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Pe(e){return e!=null&&!Un.has(e)?(_(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ve}"`),null):e}function Gn(e,n){let t,a,r,o,l;if($n(e)){let s=e.getAttribute("action");a=s?V(s,n):null,t=e.getAttribute("method")||xe,r=Pe(e.getAttribute("enctype"))||ve,o=new FormData(e)}else if(Dn(e)||_n(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||s.getAttribute("action");if(a=u?V(u,n):null,t=e.getAttribute("formmethod")||s.getAttribute("method")||xe,r=Pe(e.getAttribute("formenctype"))||Pe(s.getAttribute("enctype"))||ve,o=new FormData(s,e),!qn()){let{name:c,type:f,value:v}=e;if(f==="image"){let p=c?`${c}.`:"";o.append(`${p}x`,"0"),o.append(`${p}y`,"0")}else c&&o.append(c,v)}}else{if(ye(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t=xe,a=null,r=ve,l=e}return o&&r==="text/plain"&&(l=o,o=void 0),{action:a,method:t.toLowerCase(),encType:r,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ie(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Kn(e,n,t){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a.pathname==="/"?a.pathname=`_root.${t}`:n&&V(a.pathname,n)==="/"?a.pathname=`${n.replace(/\/$/,"")}/_root.${t}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${t}`,a}async function Wn(e,n){if(e.id in n)return n[e.id];try{let t=await import(e.module);return n[e.id]=t,t}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Vn(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Hn(e,n,t){let a=await Promise.all(e.map(async r=>{let o=n.routes[r.route.id];if(o){let l=await Wn(o,t);return l.links?l.links():[]}return[]}));return Zn(a.flat(1).filter(Vn).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function ut(e,n,t,a,r,o){let l=(u,c)=>t[c]?u.route.id!==t[c].route.id:!0,s=(u,c)=>{var f;return t[c].pathname!==u.pathname||((f=t[c].route.path)==null?void 0:f.endsWith("*"))&&t[c].params["*"]!==u.params["*"]};return o==="assets"?n.filter((u,c)=>l(u,c)||s(u,c)):o==="data"?n.filter((u,c)=>{var v;let f=a.routes[u.route.id];if(!f||!f.hasLoader)return!1;if(l(u,c)||s(u,c))return!0;if(u.route.shouldRevalidate){let p=u.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((v=t[0])==null?void 0:v.params)||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function Yn(e,n,{includeHydrateFallback:t}={}){return Jn(e.map(a=>{let r=n.routes[a.route.id];if(!r)return[];let o=[r.module];return r.clientActionModule&&(o=o.concat(r.clientActionModule)),r.clientLoaderModule&&(o=o.concat(r.clientLoaderModule)),t&&r.hydrateFallbackModule&&(o=o.concat(r.hydrateFallbackModule)),r.imports&&(o=o.concat(r.imports)),o}).flat(1))}function Jn(e){return[...new Set(e)]}function Xn(e){let n={},t=Object.keys(e).sort();for(let a of t)n[a]=e[a];return n}function Zn(e,n){let t=new Set;return new Set(n),e.reduce((a,r)=>{let o=JSON.stringify(Xn(r));return t.has(o)||(t.add(o),a.push({key:o,link:r})),a},[])}function dt(){let e=h.useContext(te);return Ie(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Qn(){let e=h.useContext(ge);return Ie(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Le=h.createContext(void 0);Le.displayName="FrameworkContext";function ct(){let e=h.useContext(Le);return Ie(e,"You must render this element inside a <HydratedRouter> element"),e}function er(e,n){let t=h.useContext(Le),[a,r]=h.useState(!1),[o,l]=h.useState(!1),{onFocus:s,onBlur:u,onMouseEnter:c,onMouseLeave:f,onTouchStart:v}=n,p=h.useRef(null);h.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let m=S=>{S.forEach(T=>{l(T.isIntersecting)})},k=new IntersectionObserver(m,{threshold:.5});return p.current&&k.observe(p.current),()=>{k.disconnect()}}},[e]),h.useEffect(()=>{if(a){let m=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(m)}}},[a]);let x=()=>{r(!0)},y=()=>{r(!1),l(!1)};return t?e!=="intent"?[o,p,{}]:[o,p,{onFocus:se(s,x),onBlur:se(u,y),onMouseEnter:se(c,x),onMouseLeave:se(f,y),onTouchStart:se(v,x)}]:[!1,p,{}]}function se(e,n){return t=>{e&&e(t),t.defaultPrevented||n(t)}}function tr({page:e,...n}){let{router:t}=dt(),a=h.useMemo(()=>Xe(t.routes,e,t.basename),[t.routes,e,t.basename]);return a?h.createElement(rr,{page:e,matches:a,...n}):null}function nr(e){let{manifest:n,routeModules:t}=ct(),[a,r]=h.useState([]);return h.useEffect(()=>{let o=!1;return Hn(e,n,t).then(l=>{o||r(l)}),()=>{o=!0}},[e,n,t]),a}function rr({page:e,matches:n,...t}){let a=H(),{manifest:r,routeModules:o}=ct(),{basename:l}=dt(),{loaderData:s,matches:u}=Qn(),c=h.useMemo(()=>ut(e,n,u,r,a,"data"),[e,n,u,r,a]),f=h.useMemo(()=>ut(e,n,u,r,a,"assets"),[e,n,u,r,a]),v=h.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let y=new Set,m=!1;if(n.forEach(S=>{var w;let T=r.routes[S.route.id];!T||!T.hasLoader||(!c.some(C=>C.route.id===S.route.id)&&S.route.id in s&&((w=o[S.route.id])!=null&&w.shouldRevalidate)||T.hasClientLoader?m=!0:y.add(S.route.id))}),y.size===0)return[];let k=Kn(e,l,"data");return m&&y.size>0&&k.searchParams.set("_routes",n.filter(S=>y.has(S.route.id)).map(S=>S.route.id).join(",")),[k.pathname+k.search]},[l,s,a,r,c,n,e,o]),p=h.useMemo(()=>Yn(f,r),[f,r]),x=nr(f);return h.createElement(h.Fragment,null,v.map(y=>h.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...t})),p.map(y=>h.createElement("link",{key:y,rel:"modulepreload",href:y,...t})),x.map(({key:y,link:m})=>h.createElement("link",{key:y,...m})))}function ar(...e){return n=>{e.forEach(t=>{typeof t=="function"?t(n):t!=null&&(t.current=n)})}}var ft=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ft&&(window.__reactRouterVersion="7.7.1")}catch{}var ht=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,mt=h.forwardRef(function({onClick:n,discover:t="render",prefetch:a="none",relative:r,reloadDocument:o,replace:l,state:s,target:u,to:c,preventScrollReset:f,viewTransition:v,...p},x){let{basename:y}=h.useContext(B),m=typeof c=="string"&&ht.test(c),k,S=!1;if(typeof c=="string"&&m&&(k=c,ft))try{let A=new URL(window.location.href),Y=c.startsWith("//")?new URL(A.protocol+c):new URL(c),re=V(Y.pathname,y);Y.origin===A.origin&&re!=null?c=re+Y.search+Y.hash:S=!0}catch{_(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let T=Sn(c,{relative:r}),[w,C,R]=er(a,p),G=sr(c,{replace:l,state:s,target:u,preventScrollReset:f,relative:r,viewTransition:v});function D(A){n&&n(A),A.defaultPrevented||G(A)}let Q=h.createElement("a",{...p,...R,href:k||T,onClick:S||o?n:D,ref:ar(x,C),target:u,"data-discover":!m&&t==="render"?"true":void 0});return w&&!m?h.createElement(h.Fragment,null,Q,h.createElement(tr,{page:T})):Q});mt.displayName="Link";var or=h.forwardRef(function({"aria-current":n="page",caseSensitive:t=!1,className:a="",end:r=!1,style:o,to:l,viewTransition:s,children:u,...c},f){let v=le(l,{relative:c.relative}),p=H(),x=h.useContext(ge),{navigator:y,basename:m}=h.useContext(B),k=x!=null&&hr(v)&&s===!0,S=y.encodeLocation?y.encodeLocation(v).pathname:v.pathname,T=p.pathname,w=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;t||(T=T.toLowerCase(),w=w?w.toLowerCase():null,S=S.toLowerCase()),w&&m&&(w=V(w,m)||w);const C=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let R=T===S||!r&&T.startsWith(S)&&T.charAt(C)==="/",G=w!=null&&(w===S||!r&&w.startsWith(S)&&w.charAt(S.length)==="/"),D={isActive:R,isPending:G,isTransitioning:k},Q=R?n:void 0,A;typeof a=="function"?A=a(D):A=[a,R?"active":null,G?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let Y=typeof o=="function"?o(D):o;return h.createElement(mt,{...c,"aria-current":Q,className:A,ref:f,style:Y,to:l,viewTransition:s},typeof u=="function"?u(D):u)});or.displayName="NavLink";var ir=h.forwardRef(({discover:e="render",fetcherKey:n,navigate:t,reloadDocument:a,replace:r,state:o,method:l=xe,action:s,onSubmit:u,relative:c,preventScrollReset:f,viewTransition:v,...p},x)=>{let y=cr(),m=fr(s,{relative:c}),k=l.toLowerCase()==="get"?"get":"post",S=typeof s=="string"&&ht.test(s),T=w=>{if(u&&u(w),w.defaultPrevented)return;w.preventDefault();let C=w.nativeEvent.submitter,R=(C==null?void 0:C.getAttribute("formmethod"))||l;y(C||w.currentTarget,{fetcherKey:n,method:R,navigate:t,replace:r,state:o,relative:c,preventScrollReset:f,viewTransition:v})};return h.createElement("form",{ref:x,method:k,action:m,onSubmit:a?u:T,...p,"data-discover":!S&&e==="render"?"true":void 0})});ir.displayName="Form";function lr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gt(e){let n=h.useContext(te);return I(n,lr(e)),n}function sr(e,{target:n,replace:t,state:a,preventScrollReset:r,relative:o,viewTransition:l}={}){let s=Te(),u=H(),c=le(e,{relative:o});return h.useCallback(f=>{if(Bn(f,n)){f.preventDefault();let v=t!==void 0?t:Se(u)===Se(c);s(e,{replace:v,state:a,preventScrollReset:r,relative:o,viewTransition:l})}},[u,s,c,t,a,n,e,r,o,l])}var ur=0,dr=()=>`__${String(++ur)}__`;function cr(){let{router:e}=gt("useSubmit"),{basename:n}=h.useContext(B),t=Fn();return h.useCallback(async(a,r={})=>{let{action:o,method:l,encType:s,formData:u,body:c}=Gn(a,n);if(r.navigate===!1){let f=r.fetcherKey||dr();await e.fetch(f,t,r.action||o,{preventScrollReset:r.preventScrollReset,formData:u,body:c,formMethod:r.method||l,formEncType:r.encType||s,flushSync:r.flushSync})}else await e.navigate(r.action||o,{preventScrollReset:r.preventScrollReset,formData:u,body:c,formMethod:r.method||l,formEncType:r.encType||s,replace:r.replace,state:r.state,fromRouteId:t,flushSync:r.flushSync,viewTransition:r.viewTransition})},[e,n,t])}function fr(e,{relative:n}={}){let{basename:t}=h.useContext(B),a=h.useContext(q);I(a,"useFormAction must be used inside a RouteContext");let[r]=a.matches.slice(-1),o={...le(e||".",{relative:n})},l=H();if(e==null){o.search=l.search;let s=new URLSearchParams(o.search),u=s.getAll("index");if(u.some(f=>f==="")){s.delete("index"),u.filter(v=>v).forEach(v=>s.append("index",v));let f=s.toString();o.search=f?`?${f}`:""}}return(!e||e===".")&&r.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),t!=="/"&&(o.pathname=o.pathname==="/"?t:z([t,o.pathname])),Se(o)}function hr(e,{relative:n}={}){let t=h.useContext(at);I(t!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=gt("useViewTransitionState"),r=le(e,{relative:n});if(!t.isTransitioning)return!1;let o=V(t.currentLocation.pathname,a)||t.currentLocation.pathname,l=V(t.nextLocation.pathname,a)||t.nextLocation.pathname;return me(r.pathname,l)!=null||me(r.pathname,o)!=null}const mr=({message:e})=>{const n=Te();return i.jsx(d.Container,{size:"xs",style:{height:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx(d.Alert,{color:"red",title:"Not Found",variant:"404 - Not Found",icon:i.jsx(M.IconInfoCircle,{size:12,stroke:1.5}),children:i.jsxs(d.Stack,{align:"flex-start",children:[e||"Sorry, the page you are looking for does not exist.",i.jsx(d.Button,{variant:"filled",onClick:()=>n("/"),size:"xs",children:"Back Home"})]})})})},gr=({message:e})=>i.jsx(d.Alert,{color:"red",title:"Not Found",variant:"404 - Not Found",icon:i.jsx(M.IconInfoCircle,{size:12,stroke:1.5}),children:e||"Sorry, the page you are looking for does not exist."}),Fe=({message:e})=>i.jsx(d.Text,{c:"red",size:"sm",children:e||"Not Found"}),pr=({tip:e})=>e===void 0?i.jsx(d.Flex,{justify:"center",align:"center",children:i.jsx(d.Loader,{color:"blue",size:"md"})}):i.jsxs(d.Flex,{gap:"md",direction:"column",justify:"center",align:"center",style:{height:"100%"},children:[i.jsx(d.Loader,{color:"blue",size:"md"}),e]}),xr=({tip:e})=>e===void 0?i.jsx(d.Loader,{color:"blue",size:"xs"}):i.jsxs(d.Flex,{gap:"md",direction:"column",justify:"center",align:"center",children:[i.jsx(d.Loader,{color:"blue",size:"xs"}),e]}),vr=({message:e})=>i.jsx(d.Alert,{color:"red",title:"Not Found",variant:"403 - Not Authorized",icon:i.jsx(M.IconInfoCircle,{size:12,stroke:1.5}),children:e||"Sorry, you are not authorized to access this page."});function yr(e,n){return e.reduce((t,a)=>{const r=n(a);return t[r]||(t[r]=[]),t[r].push(a),t},{})}function br(e,n){const t=[];let a;return e.reduce((r,o)=>{const l=n(o);return l===void 0?(a===void 0&&(a=t.length,t.push([])),t[a].push(o)):(r[l]===void 0&&(r[l]=t.length,t.push([])),t[r[l]].push(o)),r},{}),t}function wr(e,n){const t=new Set;return e.filter(a=>{const r=n(a);return t.has(r)?!1:(t.add(r),!0)})}class Sr{constructor(){X(this,"items",[]);X(this,"seen",new Set)}add(n,t){const a=t(n);this.seen.has(a)||(this.items.push(n),this.seen.add(a))}toArray(){return this.items}}class Me{constructor(){X(this,"children",new Map);X(this,"isEndOfWord",!1);X(this,"value","")}}class Oe{constructor(){X(this,"root",new Me)}insert(n){let t=this.root;for(const a of n){let r=t.children.get(a);r===void 0&&(r=new Me,t.children.set(a,r)),t=r}t.isEndOfWord=!0,t.value=n}findLongestPrefix(n){let t=this.root,a={match:"",remaining:n};for(let r=0;r<n.length;r++){const o=n[r];if(!t.children.has(o))break;t=t.children.get(o),t.isEndOfWord&&(a={match:t.value,remaining:n.slice(r+1)})}return a}}var pt=(e=>(e[e.Allow=0]="Allow",e[e.Denied=1]="Denied",e[e.Pending=2]="Pending",e))(pt||{});class xt extends Oe{constructor(){super(...arguments);X(this,"pathToKey",new Map)}normalizePath(t){return t==="/"?"/":t.replace(/\/$/,"")}insertRoute(t,a){const r=this.normalizePath(t);this.insert(r),this.pathToKey.set(r,a)}findMatchingKey(t){const a=this.normalizePath(t),r=this.findLongestPrefix(a);if(r.match&&this.pathToKey.has(r.match)&&(a===r.match||r.remaining.startsWith("/")||r.remaining===""))return this.pathToKey.get(r.match)}}function vt(e){const n={},t={},a={},r=(o,l=[])=>{o.forEach(s=>{const u=[...l,s.key];n[s.key]=s,t[s.key]=u,s.route!==void 0&&(a[s.key]=s.route),s.children!==void 0&&s.children.length>0&&r(s.children,u)})};return r(e),{key2item:n,key2fullpath:t,key2route:a}}function jr(e){const n=new xt,t=a=>{a.forEach(r=>{if(r.route!==void 0){const o=r.route.path.getURL();n.insertRoute(o,r.key)}r.children!==void 0&&r.children.length>0&&t(r.children)})};return t(e),n}function yt(e,n){return e.map(t=>{if(t.route!==void 0)return n(t.route.role)===0?t:null;if(t.children!==void 0){const a=t.children.filter(r=>r.route!==void 0?n(r.route.role)===0:!0);return a.length>0?{...t,children:a}:null}return t}).filter(t=>t!==null)}const Cr=e=>{const n=Te(),t=H(),[a,r]=j.useState(new Set),[o,l]=j.useState(new Set),[s,u]=j.useState(),c=j.useMemo(()=>yt(e.items,e.checkPermission),[e.items,e.checkPermission]),f=j.useMemo(()=>jr(e.items),[e.items]),{key2fullpath:v,key2route:p}=j.useMemo(()=>vt(c),[c]);j.useEffect(()=>{const y=t.pathname,m=f.findMatchingKey(y);m!==void 0&&(l(new Set(v[m])),u(m))},[t,p]);const x=j.useMemo(()=>{function y(m,k){var T,w;const S=m.children!==void 0&&m.children.length>0;return S?i.jsxs("div",{onMouseEnter:()=>{o.has(m.key)||r(C=>{const R=new Set(C);return R.add(m.key),R})},onMouseLeave:()=>{o.has(m.key)||r(C=>{const R=new Set(C);return R.delete(m.key),R})},children:[i.jsx(d.NavLink,{active:s===m.key,href:(T=m.route)==null?void 0:T.path.getURL(),label:m.label,leftSection:m.icon,styles:{label:{fontSize:"md"},root:{borderRadius:"var(--mantine-radius-sm)"}},ml:k===0?void 0:k===1?"md":`calc(var(--mantine-spacing-md) * ${k})`,w:"unset",rightSection:S?i.jsx(M.IconChevronRight,{size:12,stroke:1.5,className:"mantine-rotate-rtl"}):void 0,opened:a.has(m.key)||o.has(m.key),onClick:C=>{C.ctrlKey||C.metaKey||(C.preventDefault(),l(G=>{const D=new Set(G);return G.has(m.key)?D.delete(m.key):D.add(m.key),D}))}},m.key),(o.has(m.key)||a.has(m.key))&&m.children.map(C=>y(C,k+1))]},`container-${m.key}`):i.jsx(d.NavLink,{active:s===m.key,href:(w=m.route)==null?void 0:w.path.getURL(),label:m.label,leftSection:m.icon,styles:{label:{fontSize:"md"},root:{borderRadius:"var(--mantine-radius-sm)"}},ml:k===0?void 0:k===1?"md":`calc(var(--mantine-spacing-md) * ${k})`,w:"unset",onClick:C=>{C.ctrlKey||C.metaKey||(C.preventDefault(),m.route!=null&&m.route.path.path().open(n))}},m.key)}return c.map(m=>y(m,0))},[c,s,o,a,n]);return i.jsx(i.Fragment,{children:x})},we=({value:e})=>i.jsx(d.Text,{size:"sm",children:e});function Ae(e,n){const t=n.getDate().toString().padStart(2,"0"),a=(n.getMonth()+1).toString().padStart(2,"0"),r=n.getFullYear();return e.baseName==="en-US"?`${a}/${t}/${r}`:e.baseName==="vi-VN"?`${t}/${a}/${r}`:`${a}/${t}/${r}`}const bt=({value:e})=>{const n=j.useContext(ee),t=j.useMemo(()=>{const a=e.getHours().toString().padStart(2,"0"),r=e.getMinutes().toString().padStart(2,"0"),o=e.getSeconds().toString().padStart(2,"0");return Ae(n,e)+`${a}:${r}:${o}`},[n,e]);return i.jsx(d.Text,{size:"sm",children:t})},wt=({value:e})=>{const n=j.useContext(ee),t=j.useMemo(()=>Ae(n,e),[n,e]);return i.jsx(d.Text,{size:"sm",children:t})},kr=({value:e})=>{const n=j.useContext(ee),[t,a]=j.useMemo(()=>{const r=Ae(n,e),o=e.getHours().toString().padStart(2,"0"),l=e.getMinutes().toString().padStart(2,"0"),s=e.getSeconds().toString().padStart(2,"0");return[r,`${o}:${l}:${s}`]},[n,e]);return i.jsx(d.Text,{size:"sm",title:a,children:t})},Er={yes:{lang2value:{en:"Yes",vi:"Có"},lang:"en"},no:{lang2value:{en:"No",vi:"Không"},lang:"en"}},Tr=({value:e})=>i.jsx(d.Checkbox,{checked:e,label:i.jsx(O,{value:Er[e?"yes":"no"]}),readOnly:!0}),Rr=({nestedProperty:e,property:n,value:t})=>{const a=e||n;if(W.isObjectProperty(a)||a.enumType===void 0)throw new Error("Invalid usage of EnumDisplay. Expect a property of type enum");return i.jsx(d.Text,{size:"sm",children:i.jsx(O,{value:a.enumType.label[t]})})};function St(e,n,t,a){const r=e.getByName(n.targetClass),o=a[n.targetClass];j.useEffect(()=>{r.fetchByIds(t)},[t]);const l={};for(const s of t)l[s]=r.get(s);return[l,o]}const ue=K.observer(({db:e,property:n,value:t,entityRoutes:a})=>{const r=j.useMemo(()=>[t],[t]),[o,l]=St(e,n,r,a),s=o[t];return s===void 0?i.jsx(d.Text,{size:"sm",children:t}):s===null?i.jsx(Fe,{}):l===void 0?i.jsx(d.Text,{size:"sm",children:s.name}):i.jsx(Ke.InternalLink,{path:l,openInNewPage:!1,urlArgs:{id:s.id},queryArgs:{},children:s.name})}),de=K.observer(({db:e,property:n,value:t,entityRoutes:a})=>{const[r,o]=St(e,n,t,a);return i.jsx(d.Group,{gap:"xs",children:t.map((l,s)=>{const u=r[l];return u===void 0?i.jsx(d.Text,{size:"sm",children:t},l):u===null?i.jsx(Fe,{},l):o===void 0?i.jsx(d.Text,{size:"sm",children:u.name},s):i.jsx(Ke.InternalLink,{path:o,openInNewPage:!1,urlArgs:{id:u.id},queryArgs:{},children:u.name},s)})})}),U={string:we,integer:we,float:we,boolean:Tr,"string[]":we,enum:Rr,datetime:bt,date:wt},Nr=({property:e,value:n,onChange:t})=>i.jsx(d.Input,{id:e.name,type:"checkbox",checked:n,onChange:a=>{const r=a.target.checked;t(r)}}),jt=({property:e,value:n,onChange:t})=>i.jsx(d.Input,{id:e.name,type:"number",value:n,onChange:a=>{const r=a.target.value;t(r===""?void 0:Number(r))}}),Pr={lang2value:{en:"The leading zero is not necessary in international phone number format. For example, if your phone number is 0123456789, you should enter it as 123-456-789.",vi:"Số 0 đầu tiên không cần thiết trong định dạng điện thoại quốc tế. Ví dụ, nếu số điện thoại của bạn là 0123456789, bạn nên nhập nó là 123-456-789."},lang:"en"},Ir={lang2value:{en:"No valid country code found.",vi:"Không tìm thấy mã quốc gia hợp lệ. "},lang:"en"},ne={84:{name:"Vietnam",flags:[P.VN]},1:{name:"US, Canada",flags:[P.US,P.CA]},61:{name:"Australia",flags:[P.AU]},81:{name:"Japan",flags:[P.JP]},44:{name:"UK",flags:[P.UK]},33:{name:"France",flags:[P.FR]},49:{name:"Germany",flags:[P.DE]},91:{name:"India",flags:[P.IN]},55:{name:"Brazil",flags:[P.BR]},34:{name:"Spain",flags:[P.ES]},39:{name:"Italy",flags:[P.IT]},64:{name:"New Zealand",flags:[P.NZ]},52:{name:"Mexico",flags:[P.MX]},86:{name:"China",flags:[P.CN]}},Lr=(e,n)=>{if(e==="")return{match:"84",remaining:""};const t=e.replace(/[^\d]/g,""),a=n.findLongestPrefix(t);if(a.match==="")throw new Error(`No valid country code found for phone number: ${e}`);return a},Ct=({value:e})=>{const n=ne[e];if(n!==void 0)return i.jsxs(d.Group,{gap:"sm",wrap:"nowrap",align:"center",children:[i.jsxs(d.Text,{size:"sm",children:["+",e]}),i.jsx(d.Group,{gap:4,wrap:"nowrap",children:n.flags.map((t,a)=>i.jsx(fe,{flag:t},a))})]})},Fr=({value:e,onChange:n,error:t,id:a})=>{const[r,o]=j.useState(""),[l,s]=j.useState(!1),[u,c]=j.useState(""),[f,v]=j.useState(!1),p=j.useMemo(()=>{const w=new Oe;return Object.keys(ne).forEach(C=>{w.insert(C)}),w},[ne]),{rawInput:x}=j.useMemo(()=>{try{const{match:w,remaining:C}=Lr(e,p);return c(w),v(!1),{rawInput:C}}catch{return v(!0),c(""),{rawInput:e}}},[e]),y=d.useCombobox({onDropdownClose:()=>{y.resetSelectedOption(),o("")},onDropdownOpen:()=>{y.updateSelectedOptionIndex("active")}}),m=j.useMemo(()=>Object.keys(ne),[ne]),k=(w,C)=>{const R=w.replace(/[^\d]/g,"");return R.length===0?`+${C}`:R.startsWith("0")?(s(!0),`+${C}${R}`):(s(!1),`+${C}${R}`)},S=j.useMemo(()=>m.filter(w=>ne[w].name.toLowerCase().includes(r.toLowerCase())||w.includes(r)),[r,m]),T=j.useMemo(()=>S.map((w,C)=>i.jsx(d.Combobox.Option,{value:w,children:i.jsx(Ct,{value:w})},C)),[S]);return i.jsxs("div",{children:[i.jsx(d.Grid,{gutter:"xs",children:i.jsx(d.Grid.Col,{children:i.jsxs(d.Group,{gap:5,children:[i.jsxs(d.Combobox,{store:y,position:"top-start",onOptionSubmit:w=>{o(""),y.closeDropdown(),n({target:{value:k(x,w)}})},children:[i.jsx(d.Combobox.Target,{children:i.jsx(d.InputBase,{component:"button",type:"button",pointer:!0,rightSection:i.jsx(d.Combobox.Chevron,{}),onClick:()=>y.toggleDropdown(),rightSectionPointerEvents:"none",w:110,children:i.jsx(Ct,{value:u})})}),i.jsxs(d.Combobox.Dropdown,{children:[i.jsx(d.Combobox.Search,{leftSection:i.jsx(M.IconSearch,{size:14,stroke:1.5}),placeholder:".....",value:r,onChange:w=>o(w.currentTarget.value)}),i.jsx(d.Combobox.Options,{children:T.length>0?T:i.jsx(d.Combobox.Empty,{children:i.jsx(d.Text,{size:"sm",children:"Nothing found"})})})]})]}),u===""?i.jsx(d.Input,{id:a,value:x,type:"phone_number",onChange:w=>{n({target:{value:w.target.value}})},error:t,flex:1}):i.jsx(d.Input,{id:a,value:x,type:"phone_number",onAccept:w=>{const C=w.replace(/[^\d]/g,"");n({target:{value:k(C,u)}})},component:Gt.IMaskInput,mask:"000-000-0000",error:t,flex:1})]})})}),(l||f||t&&typeof t=="string")&&i.jsx(d.Grid,{gutter:"xs",children:i.jsx(d.Grid.Col,{children:i.jsx(d.Input.Error,{children:l?i.jsx(O,{value:Pr}):f?i.jsx(O,{value:Ir}):t})})})]})},De=({property:e,error:n,value:t,onChange:a})=>{const[r,o]=j.useMemo(()=>e.constraints.includes("password")?["password",d.PasswordInput]:e.constraints.includes("phone_number")?["phone_number",Fr]:[e.constraints.includes("email")?"email":e.constraints.includes("url")?"url":"text",d.Input],[e.constraints]);return i.jsx(o,{id:e.name,value:t,type:r,onChange:l=>a(l.target.value),error:n})},$e={integer:jt,float:jt,string:De,boolean:Nr,"string[]":De,enum:De};function Mr(e,n){const[t,a]=j.useState(""),[r,o]=j.useState([]);return j.useEffect(()=>{e.getByName(n.targetClass).fetch({limit:100,offset:0}).then(s=>o(s.records))},[n.name]),{data:r,query:t,setQuery:s=>{a(s);const u=e.getByName(n.targetClass);o(u.filter(c=>c.name.toLowerCase().includes(s.toLowerCase())))},table:e.getByName(n.targetClass)}}const Or=e=>e.name,Ar=e=>i.jsx(d.Text,{size:"sm",children:e.name}),Dr=K.observer(e=>i.jsx("h1",{children:"SingleForeignKey"})),$r=K.observer(({db:e,property:n,value:t,onChange:a})=>{const{table:r,data:o,query:l,setQuery:s}=Mr(e,n);return i.jsxs(d.Stack,{gap:"sm",children:[i.jsx(_r,{name:n.name,query:l,setQuery:s,data:o,onSelect:u=>{t.includes(u)||a([...t,u])},renderOption:Or,isIdInteger:n.datatype==="integer"}),i.jsx(zr,{items:t.map(u=>r.get(u)),onDelete:u=>{a(t.filter(c=>c!==u.id))},render:Ar})]})}),_r=({name:e,data:n,onSelect:t,renderOption:a,isIdInteger:r,query:o,setQuery:l})=>{const s=d.useCombobox({onDropdownClose:()=>s.resetSelectedOption()}),u=j.useMemo(()=>n.map(c=>i.jsx(d.Combobox.Option,{value:c.id.toString(),children:a(c)},c.id)),[n]);return i.jsxs(d.Combobox,{store:s,onOptionSubmit:c=>{t(r?parseInt(c):c),l(""),s.closeDropdown()},offset:0,shadow:"sm",children:[i.jsx(d.Combobox.Target,{children:i.jsx(d.Input,{id:e,pointer:!0,rightSection:i.jsx(M.IconSearch,{size:16,stroke:1.5}),rightSectionPointerEvents:"none",onClick:()=>s.toggleDropdown(),placeholder:"Type to search...",value:o,onChange:c=>{l(c.currentTarget.value)}})}),i.jsx(d.Combobox.Dropdown,{children:i.jsx(d.Combobox.Options,{children:u.length===0?i.jsx(d.Combobox.Empty,{children:"Nothing found"}):u})})]})},zr=({items:e,onDelete:n,render:t})=>{const a=j.useMemo(()=>{const r=[];for(let o=0;o<e.length;o++){const l=e[o];r.push(i.jsxs(d.Group,{justify:"space-between",p:"sm",children:[t(l),i.jsx(d.CloseButton,{size:"sm",onClick:()=>n(l)})]},o)),o<e.length-1&&r.push(i.jsx(d.Divider,{},`divider-${o}`))}return r},[e]);if(a.length!==0)return i.jsx(d.Paper,{bd:"1px solid #ddd",children:a})},kt={requiredLabelLeft:"_requiredLabelLeft_l5p83_1",requiredLabelRight:"_requiredLabelRight_l5p83_11"},Et=({label:e,name:n,required:t=!1,tooltip:a,style:r,align:o="left"})=>{const l=t?o==="left"?kt.requiredLabelRight:kt.requiredLabelLeft:"";return i.jsx(d.Flex,{align:"center",h:36,children:i.jsx("label",{htmlFor:n,style:r,children:i.jsxs(d.Group,{gap:4,children:[i.jsx(d.Text,{size:"sm",className:l,children:e}),a!==void 0&&i.jsx(d.Tooltip,{label:a,withArrow:!0,children:i.jsx(M.IconHelpOctagonFilled,{size:16,stroke:1.5,style:{color:"var(--mantine-color-dimmed)"}})})]})})})},Br={type:"vertical",helpAlwaysVisible:!1},Tt=K.observer(({store:e,record:n,property:t,layout:a=Br,InputComponent:r,validator:o})=>{const[l,s]=j.useState(void 0),u=n[t.tsName],c=v=>{var x;if(W.isDraftRecord(n))n[t.updateFuncName](v);else{const y=n.toDraft();y[t.updateFuncName](v),e.setDraft(y)}const p=o(v);p.isValid?s(void 0):s((x=p.errorMessage)==null?void 0:x.t({args:{name:t.label}}))};if(qr(a))return i.jsxs(d.Stack,{gap:5,children:[i.jsxs(d.Grid,{gutter:"sm",children:[i.jsx(d.Grid.Col,{span:a.labelCol,style:{display:"flex",justifyContent:a.align||"left"},children:i.jsx(Et,{label:i.jsx(O,{value:t.label}),name:t.name,required:t.isRequired,tooltip:t.description!==void 0?i.jsx(O,{value:t.description}):void 0,align:a.align})}),i.jsx(d.Grid.Col,{span:a.itemCol,children:i.jsx(r,{db:e.db,property:t,value:u,error:l!==void 0,onChange:c})})]}),l!==void 0&&i.jsxs(d.Grid,{gutter:"sm",children:[i.jsx(d.Grid.Col,{span:a.labelCol}),i.jsx(d.Grid.Col,{span:a.itemCol,children:i.jsx(d.Input.Error,{children:l})})]})]});let f=i.jsx(O,{value:t.label});return!a.helpAlwaysVisible&&t.description!==void 0&&(f=i.jsxs(d.Group,{gap:4,style:{display:"inline-flex"},children:[f,i.jsx(d.Tooltip,{label:i.jsx(O,{value:t.description}),withArrow:!0,children:i.jsx(M.IconHelpOctagonFilled,{size:16,stroke:1.5,style:{color:"var(--mantine-color-dimmed)"}})})]})),i.jsx(d.Input.Wrapper,{label:f,description:a.helpAlwaysVisible&&t.description!==void 0?i.jsx(O,{value:t.description}):void 0,required:t.isRequired,children:i.jsx(r,{db:e.db,property:t,value:u,error:l,onChange:c})})});function qr(e){return e.type==="horizontal"}const Rt=12,Ur=e=>{const n=e.schema,t=j.useMemo(()=>{const a=Math.max(...e.fieldGroups.map(r=>Math.max(...r.fields.map(o=>o.length))));return e.fieldGroups.map((r,o)=>Gr(n,e.store,e.record,o,r,a,e.layout))},[n,e.store,e.record,e.fieldGroups,e.layout]);return i.jsx("form",{onSubmit:e.onSubmit===void 0?void 0:a=>{a.preventDefault(),e.onSubmit!==void 0&&W.isDraftRecord(e.record)&&e.onSubmit(e.record)},children:i.jsxs(d.Stack,{gap:"sm",className:e.className,style:e.styles,children:[t,i.jsx(d.Group,{gap:"sm",children:e.actions.map((a,r)=>i.jsx(d.Button,{variant:a.variant,onClick:()=>{a.onClick!==void 0&&a.onClick()},disabled:a.disabled,children:a.label},r))})]})})};function Gr(e,n,t,a,r,o,l){const s=r.fields,u=[];for(let f=0;f<s.length;f++){const v=Rt/s[f].length;if(!Number.isInteger(v))throw new Error(`Span must be an integer, but got ${v} for row ${f}`);let p;l!==void 0&&typeof l=="object"&&l.type==="horizontal"?p={...l,labelCol:Math.floor(l.labelCol*s[f].length/o),itemCol:Rt-Math.floor(l.labelCol*s[f].length/o)}:p=l;for(let x=0;x<s[f].length;x++){const y=s[f][x],m=e.allProperties[y];let k;if(W.isObjectProperty(m))k=m.cardinality==="N:N"||m.cardinality==="1:N"?$r:Dr;else{if($e[m.datatype]===void 0)throw new Error(`No input component found for datatype ${m.datatype}`);k=$e[m.datatype]}u.push(i.jsx(d.Grid.Col,{span:v,children:i.jsx(Tt,{store:n,record:t,property:m,layout:p,InputComponent:k,validator:e.validators[y]})},`${f}-${x}`))}}const c=i.jsx(d.Grid,{gutter:"sm",children:u},a);return r.name!==void 0?i.jsx(d.Fieldset,{legend:r.name,children:c},a):c}const Nt=({actions:e,reloadData:n,selectedRowKeys:t,size:a="xs"})=>i.jsxs(d.Group,{gap:a,children:[(e==null?void 0:e.add)&&i.jsx(d.Button,{variant:"light",leftSection:i.jsx(M.IconPlus,{size:16,stroke:1.5}),size:a,onClick:e.add,children:"Add"}),(e==null?void 0:e.edit)&&i.jsx(d.Button,{leftSection:i.jsx(M.IconPencil,{size:16,stroke:1.5}),size:a,variant:"light",onClick:()=>e.edit!==void 0&&e.edit(t[0]),disabled:t.length!==1,children:"Edit"}),(e==null?void 0:e.reload)&&i.jsx(d.Button,{leftSection:i.jsx(M.IconReload,{size:16,stroke:1.5}),size:a,onClick:n,variant:"light",children:"Reload"}),(e==null?void 0:e.import)&&i.jsx(d.Button,{leftSection:i.jsx(M.IconDatabaseImport,{size:16,stroke:1.5}),size:a,variant:"light",onClick:e.import,children:"Import"}),(e==null?void 0:e.export)&&i.jsx(d.Button,{leftSection:i.jsx(M.IconDownload,{size:16,stroke:1.5}),size:a,variant:"light",onClick:e.export,children:"Export"})]}),Pt=e=>e!==void 0&&(e.add!==void 0||e.edit!==void 0||e.delete!==void 0||e.export!==void 0||e.reload===!0||e.import!==void 0),Kr="__selectcol__",{Thead:Wr,Tr:It,Th:Vr,Tbody:Hr,Td:Yr}=d.Table,Lt=e=>{const n=i.jsxs(d.Table,{striped:!0,highlightOnHover:!0,verticalSpacing:"xs",tabularNums:!0,children:[i.jsx(Wr,{children:e.table.getHeaderGroups().map(a=>i.jsx(It,{children:a.headers.map(r=>i.jsx(Vr,{w:r.id===Kr?"1%":void 0,children:r.isPlaceholder?null:Z.flexRender(r.column.columnDef.header,r.getContext())},r.id))},a.id))}),i.jsx(Hr,{pos:"relative",children:e.table.getRowModel().rows.map(a=>i.jsx(It,{bg:e.selectedRowKeys[a.id]?"var(--mantine-color-blue-light)":void 0,children:a.getVisibleCells().map(r=>i.jsx(Yr,{children:Z.flexRender(r.column.columnDef.cell,r.getContext())},r.id))},a.id))})]});if(!e.bordered)return n;const t={};return e.hasTopSection&&(t.borderTopLeftRadius=0,t.borderTopRightRadius=0),e.hasBottomSection&&(t.borderBottomLeftRadius=0,t.borderBottomRightRadius=0),i.jsx(d.Paper,{withBorder:!0,p:0,style:t,children:n})},Jr={pageSizeSelectorActive:"_pageSizeSelectorActive_1wv6j_1"},Ft=({total:e,pageIndex:n,pageSize:t,allowPageSizeChange:a=!0,onUpdatePagination:r})=>{const o=i.jsx(d.Pagination,{size:"sm",total:e,value:n+1,onChange:l=>r(l-1,t)});return a?i.jsxs(d.Group,{gap:"sm",children:[i.jsxs("div",{children:[i.jsx(d.Text,{size:"sm",component:"span",pr:"xs",c:"dimmed",children:"Records per page"}),i.jsx(Xr,{size:"sm",values:["10","20","50","100"],value:t.toString(),onChange:l=>{r(0,parseInt(l,10))}})]}),o]}):o},Mt={xs:d.rem(22),sm:d.rem(26),md:d.rem(32),lg:d.rem(38),xl:d.rem(44)};function Xr({size:e,values:n,value:t,onChange:a}){return i.jsxs(d.Menu,{withinPortal:!0,withArrow:!0,offset:2,children:[i.jsx(d.MenuTarget,{children:i.jsx(d.Button,{size:e,variant:"default",rightSection:i.jsx(M.IconSelector,{size:16,stroke:1.5}),style:[{fontWeight:"normal"},r=>({height:Mt[e],paddingLeft:r.spacing[e],paddingRight:r.spacing[e]})],styles:{section:{marginInlineStart:2}},children:t})}),i.jsx(d.MenuDropdown,{children:n.map(r=>{const o=r===t;return i.jsx(d.MenuItem,{className:o?Jr.pageSizeSelectorActive:void 0,style:[{height:Mt[e]}],disabled:o,onClick:()=>a(r),children:i.jsx(d.Text,{component:"div",size:e,children:r})},r)})})]})}const Ot=new Set(["topRight","bottomRight"]),Zr=e=>{var S,T;const[n,t]=j.useState({records:[],total:0}),[a,r]=j.useState(!1),[o,l]=j.useState({}),s=w=>{r(!0),e.getData(w).then(C=>{t(C),r(!1)})},u=(w,C)=>{const R={...e.query.query,limit:C,offset:w*C};e.query.update(R)},[c,f,v]=j.useMemo(()=>{const w=e.query.query.limit,C=Math.floor((e.query.query.offset||0)/e.query.query.limit),R=Math.ceil(n.total/e.query.query.limit);return[w,C,R]},[e.query.query.limit,e.query.query.offset,n.total]);j.useEffect(()=>(n.total==0&&s(e.query.query),e.query.subscribe(s)),[e.query]);const p=j.useMemo(()=>Object.keys(o).filter(w=>o[w]).map(w=>e.normalizeRowId(w)),[o]);let x,y;Pt(e.actions)&&(x=i.jsx(Nt,{actions:e.actions,reloadData:()=>s(e.query.query),selectedRowKeys:p}));const m=((S=e.pagination)==null?void 0:S.positions)||Ot;if(m.size>0){const w=i.jsx(Ft,{total:v,pageIndex:f,pageSize:c,onUpdatePagination:u,allowPageSizeChange:(T=e.pagination)==null?void 0:T.showSizeChanger});m.has("topRight")&&(x!==void 0?x=i.jsxs(d.Group,{justify:"space-between",gap:"sm",children:[x,w]}):x=i.jsx(d.Flex,{justify:"flex-end",children:w})),(m.has("bottomRight")||m.has("bottomLeft")||m.has("bottomCenter"))&&(m.has("bottomLeft")?y=i.jsxs(d.Flex,{justify:"space-between",align:"center",children:[w,i.jsxs(d.Text,{size:"sm",c:"dimmed",children:["Showing ",f*c+1," to"," ",Math.min((f+1)*c,n.total)," of ",n.total," ","records"]})]}):y=i.jsxs(d.Flex,{justify:"space-between",align:"center",children:[i.jsxs(d.Text,{size:"sm",c:"dimmed",children:["Showing ",f*c+1," to"," ",Math.min((f+1)*c,n.total)," of ",n.total," ","records"]}),w]}))}const k=j.useMemo(()=>i.jsx(Qr,{data:n,loading:a,columns:e.columns,getRowId:e.getRowId,selectedRowKeys:o,setSelectedRowKeys:l,hasTopSection:x!==void 0,hasBottomSection:y!==void 0}),[n,a,e.columns,e.getRowId,o,l,x!==void 0,y!==void 0]);return x===void 0||y===void 0?k:i.jsxs("div",{children:[x!==void 0&&i.jsx(d.Paper,{withBorder:!0,p:"xs",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:"none"},children:x}),k,y!==void 0&&i.jsx(d.Paper,{withBorder:!0,p:"xs",style:{borderTopLeftRadius:0,borderTopRightRadius:0,borderTop:"none"},children:y})]})},Qr=e=>{const n=j.useMemo(()=>{const a=[{id:"selection",header:({table:r})=>i.jsx(d.Checkbox,{checked:r.getIsAllRowsSelected(),indeterminate:r.getIsSomeRowsSelected(),onChange:r.getToggleAllRowsSelectedHandler()}),cell:({row:r})=>i.jsx(d.Checkbox,{checked:r.getIsSelected(),disabled:!r.getCanSelect(),onChange:r.getToggleSelectedHandler()})}];return e.columns.forEach(r=>{a.push({id:r.key,header:r.title,accessorFn:r.render,cell:({row:o})=>r.render(o.original)})}),a},[e.columns]),t=Z.useReactTable({data:e.data.records,columns:n,getCoreRowModel:Z.getCoreRowModel(),getRowId:a=>e.getRowId(a).toString(),state:{rowSelection:e.selectedRowKeys},onRowSelectionChange:e.setSelectedRowKeys,manualPagination:!0});return i.jsx(Lt,{table:t,selectedRowKeys:e.selectedRowKeys,bordered:!0,hasTopSection:e.hasTopSection,hasBottomSection:e.hasBottomSection})};function _e(e,n,t,{title:a,nestedKey:r,component:o}={}){let l;if(o!==void 0)l=o;else if(W.isObjectProperty(t))t.cardinality==="1:N"||t.cardinality==="N:N"?l=de:l=ue;else{if(U[t.datatype]===void 0)throw new Error(`No display component found for datatype ${t.datatype}`);l=U[t.datatype]}const s={key:t.name,title:a||i.jsx(O,{value:t.label}),accessorFn:u=>u[t.tsName],render:u=>{const c=u[t.tsName];return i.jsx(l,{db:e,property:t,value:c,entityRoutes:n})}};return r!==void 0&&(s.accessorFn=u=>u[r][t.tsName],s.render=u=>{const c=u[r][t.tsName];return i.jsx(l,{db:e,property:t,value:c,entityRoutes:n})}),s}function ea(e,n,t,a,{title:r,nestedKey:o,component:l}={}){let s;if(l!==void 0)s=l;else if(W.isObjectProperty(a))a.cardinality==="1:N"||a.cardinality==="N:N"?s=de:s=ue;else{if(U[a.datatype]===void 0)throw new Error(`No display component found for datatype ${a.datatype}`);s=U[a.datatype]}const u={key:t+"."+a.name,title:r||i.jsx(O,{value:a.label}),accessorFn:c=>c[t.tsName][a.tsName],render:c=>{const f=c[t.tsName][a.tsName];return i.jsx(s,{db:e,property:a,value:f,entityRoutes:n})}};return o!==void 0&&(u.accessorFn=c=>c[o][t.tsName][a.tsName],u.render=c=>{const f=c[o][t.tsName][a.tsName];return i.jsx(s,{db:e,property:a,value:f,entityRoutes:n})}),u}function ta(e,n,t,a,r={}){return a.map(o=>ze(o)?o:_e(e,t,n.publicProperties[o],r))}function na(e,n,t,a=[],r={}){return a.map(o=>ze(o)?o:_e(e,t,n.publicProperties[o],r))}function ze(e){return typeof e=="object"&&"key"in e&&"title"in e}const ra=new Set(["topRight","bottomRight"]),aa=e=>{var f,v;const[n,t]=j.useState({}),a=j.useMemo(()=>{const p=[{id:"selection",header:({table:x})=>i.jsx(d.Checkbox,{checked:x.getIsAllRowsSelected(),indeterminate:x.getIsSomeRowsSelected(),onChange:x.getToggleAllRowsSelectedHandler()}),cell:({row:x})=>i.jsx(d.Checkbox,{checked:x.getIsSelected(),disabled:!x.getCanSelect(),onChange:x.getToggleSelectedHandler()})}];return e.columns.forEach(x=>{p.push({id:x.key,header:x.title,accessorFn:x.render,cell:({row:y})=>x.render(y.original)})}),p},[e.columns]),r=Z.useReactTable({data:e.data,columns:a,getCoreRowModel:Z.getCoreRowModel(),getPaginationRowModel:Z.getPaginationRowModel(),state:{rowSelection:n},onRowSelectionChange:t}),o=j.useMemo(()=>Object.keys(n).filter(p=>n[p]).map(Number),[n]);let l,s;Pt(e.actions)&&(l=i.jsx(Nt,{actions:e.actions,selectedRowKeys:o}));const u=((f=e.pagination)==null?void 0:f.positions)||ra;if(u.size>0){const p=r.getState().pagination,x=i.jsx(Ft,{total:r.getPageCount(),pageIndex:p.pageIndex,pageSize:p.pageSize,onUpdatePagination:(y,m)=>r.setPagination({pageIndex:y,pageSize:m}),allowPageSizeChange:(v=e.pagination)==null?void 0:v.showSizeChanger});u.has("topRight")&&(l!==void 0?l=i.jsxs(d.Group,{justify:"space-between",gap:"sm",children:[l,x]}):l=i.jsx(d.Flex,{justify:"flex-end",children:x})),(u.has("bottomRight")||u.has("bottomLeft")||u.has("bottomCenter"))&&(u.has("bottomLeft")?s=i.jsxs(d.Flex,{justify:"space-between",align:"center",children:[x,i.jsxs(d.Text,{size:"sm",c:"dimmed",children:["Showing ",p.pageIndex*p.pageSize+1," to"," ",Math.min((p.pageIndex+1)*p.pageSize,e.data.length)," ","of ",e.data.length," records"]})]}):s=i.jsxs(d.Flex,{justify:"space-between",align:"center",children:[i.jsxs(d.Text,{size:"sm",c:"dimmed",children:["Showing ",p.pageIndex*p.pageSize+1," to"," ",Math.min((p.pageIndex+1)*p.pageSize,e.data.length)," ","of ",e.data.length," records"]}),x]}))}const c=i.jsx(Lt,{selectedRowKeys:n,table:r,bordered:!0,hasTopSection:l!==void 0,hasBottomSection:s!==void 0});return l===void 0&&s===void 0?c:i.jsxs("div",{children:[l!==void 0&&i.jsx(d.Paper,{withBorder:!0,p:"xs",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0,borderBottom:"none"},children:l}),c,s!==void 0&&i.jsx(d.Paper,{withBorder:!0,p:"xs",style:{borderTopLeftRadius:0,borderTopRightRadius:0,borderTop:"none"},children:s})]})},At=K.observer(({store:e,record:n,property:t,DisplayComponent:a,entityRoutes:r})=>{const o=n[t.tsName];return i.jsxs("div",{children:[i.jsx(d.Text,{size:"sm",fw:550,children:i.jsx(O,{value:t.label})}),i.jsx(a,{db:e.db,entityRoutes:r,property:t,value:o})]})}),oa=K.observer(({store:e,record:n,properties:t,DisplayComponent:a,entityRoutes:r})=>{const o=t[t.length-1],l=t.reduce((s,u)=>{if(s!=null)return s[u.tsName]},n);return i.jsxs("div",{children:[i.jsx(d.Text,{size:"sm",fw:550,children:i.jsx(O,{value:o.label})}),l!==void 0&&i.jsx(a,{db:e.db,property:o,value:l,entityRoutes:r})]})}),ia=12,Dt=e=>{const n=e.schema,t=j.useMemo(()=>e.fieldGroups.map((a,r)=>la(n,e.store,e.record,r,a,e.entityRoutes)),[n,e.store,e.record,e.fieldGroups]);return i.jsx(d.Stack,{gap:"sm",className:e.className,style:e.styles,children:t})};function la(e,n,t,a,r,o){const l=r.fields,s=[];for(let u=0;u<l.length;u++){const c=ia/l[u].length;if(!Number.isInteger(c))throw new Error(`Span must be an integer, but got ${c} for row ${u}`);for(let f=0;f<l[u].length;f++){const v=l[u][f];let p;if(typeof v=="function")p=v(n,t);else if(typeof v=="object"&&"prop"in v){const x=e.allProperties[v.prop],y=v.display;p=i.jsx(At,{store:n,record:t,property:x,DisplayComponent:y,entityRoutes:o})}else{const x=e.allProperties[v];let y;if(W.isObjectProperty(x))y=x.cardinality==="N:N"||x.cardinality==="1:N"?de:ue;else{if(U[x.datatype]===void 0)throw new Error(`No display component found for datatype ${x.datatype}`);y=U[x.datatype]}p=i.jsx(At,{store:n,record:t,property:x,DisplayComponent:y,entityRoutes:o})}s.push(i.jsx(d.Grid.Col,{span:c,children:p},`${u}-${f}`))}}return i.jsx(d.Grid,{gutter:"sm",children:s},a)}function sa(e,n,t){const a=e[e.length-1];let r;if(t!==void 0)r=t;else if(W.isObjectProperty(a))r=a.cardinality==="N:N"||a.cardinality==="1:N"?de:ue;else{if(U[a.datatype]===void 0)throw new Error(`No display component found for datatype ${a.datatype}`);r=U[a.datatype]}return(o,l)=>i.jsx(oa,{store:o,record:l,properties:e,DisplayComponent:r,entityRoutes:n})}const ua=e=>i.jsxs(d.Tabs,{defaultValue:e.fieldTabs[0].tabName,children:[i.jsx(d.Tabs.List,{children:e.fieldTabs.map((n,t)=>i.jsx(d.Tabs.Tab,{value:n.tabName,children:n.tabName},t))}),e.fieldTabs.map((n,t)=>i.jsx(d.Tabs.Panel,{value:n.tabName,pt:"sm",children:i.jsx(Dt,{schema:e.schema,store:e.store,record:e.record,fieldGroups:n.fieldGroups,styles:e.tabStyles,className:e.tabClassName,entityRoutes:e.entityRoutes})},t))]});b.CountryFlagComponent=fe,b.DEFAULT_PAGINATION_POSITIONS=Ot,b.DataType2Component=$e,b.DataType2DisplayComponent=U,b.DateDisplay=wt,b.DateTimeDisplay=bt,b.DateTimeHideTimeDisplay=kr,b.EmojiCountryFlag=Je,b.FormItem=Tt,b.FormItemLabel=Et,b.LanguageSelector=Xt,b.Loading=pr,b.LoadingInline=xr,b.LocaleContext=ee,b.LocaleProvider=Yt,b.MenuTrie=xt,b.MultiForeignKeyDisplay=de,b.MultiLingualString=O,b.NotAuthorized=vr,b.NotFound=mr,b.NotFoundInline=Fe,b.NotFoundSubPage=gr,b.OrderedUniqueList=Sr,b.Permission=pt,b.SVGCountryFlag=Ye,b.SeraEmbeddedTable=aa,b.SeraForm=Ur,b.SeraTable=Zr,b.SeraVerticalMenu=Cr,b.SeraView=Dt,b.SeraViewTab=ua,b.SingleForeignKeyDisplay=ue,b.Trie=Oe,b.TrieNode=Me,b.buildMenuItemIndex=vt,b.countryFlags=P,b.filterAllowedItems=yt,b.groupBy=yr,b.groupByAsList=br,b.isSeraColumn=ze,b.makeEmbeddedTableColumns=na,b.makeFieldDisplay=sa,b.makeTableColumn=_e,b.makeTableColumnFromNestedProperty=ea,b.makeTableColumns=ta,b.uniqueList=wr,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sera-components",
3
3
  "private": false,
4
- "version": "1.1.6",
4
+ "version": "1.1.8",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -35,14 +35,14 @@
35
35
  "dependencies": {
36
36
  "@mantine/core": "^8.1.0",
37
37
  "@mantine/form": "^8.1.0",
38
- "react": "^19.0.0",
39
- "react-dom": "^19.0.0",
40
- "react-router": "^7.7.1",
38
+ "react": "==19.1.0",
39
+ "react-dom": "==19.1.0",
40
+ "react-router": "==7.7.1",
41
41
  "react-imask": "^7.6.1",
42
42
  "@tabler/icons-react": "^3.31.0",
43
43
  "@tanstack/react-table": "^8.21.3",
44
44
  "mobx-react-lite": "^4.1.0",
45
- "sera-db": "^1.11.11",
46
- "sera-route": "^1.3.3"
45
+ "sera-db": "^1.12.0",
46
+ "sera-route": "^1.3.4"
47
47
  }
48
48
  }