@baasix/baasix 0.1.71 → 0.1.72
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.
- package/README.md +1 -1
- package/dist/README.md +1 -1
- package/dist/app/404/index.html +1 -1
- package/dist/app/404.html +1 -1
- package/dist/app/_next/static/chunks/1303-7995fedb9f2f2f71.js +1 -0
- package/dist/app/_next/static/chunks/{4033-ea89dd457b87cead.js → 1407-cec5715f4fa2cd05.js} +1 -1
- package/dist/app/_next/static/chunks/{9599-24678970361fee69.js → 9599-c79f18993362c1ed.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/all-activity/{page-8e1f084e807ff5ee.js → page-f4aea4f863211cec.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/email-log/{page-4e08df2865fe9d0f.js → page-18600e8a50202067.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/notifications/{page-3a5070a5088835ae.js → page-30c71e8db4068db9.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/sessions/{page-edfa379cab0d3ccb.js → page-5357cdaabafac8b2.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/workflow-executions/{page-d007890f17b60862.js → page-8b8a0149514ed992.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/workflow-logs/{page-976e9829706ac8f2.js → page-1f5f247089844a4b.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/data-browser/{page-fbb7a4d4f2a4353d.js → page-74e35ca26c4d1a9f.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/file-manager/{page-cea6a2c1670d4ef5.js → page-8cc3a301b2a369a7.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/permissions/{page-ed80f4bd5d81df95.js → page-fe065574e33b43e4.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/project/{page-310b8ce72d0516ea.js → page-3d0f42580482a37a.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/roles/{page-fd62dc19ac88dd64.js → page-87a5cb104f9f4b49.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/schema/page-5cca04eb90158d28.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/tasks/{page-1479604bbfc53a83.js → page-1a1a5b0b39308a7c.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/templates/{page-6787b62a4960304f.js → page-84e453f00c231c83.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/tenants/{page-856d4af5fbd76c8e.js → page-710aebd539a6c2aa.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/users/invites/{page-ed5493d55f6c1db8.js → page-2c9325780d4034ae.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/users/list/{page-02e6ef533bdc3bbc.js → page-44612afdab8a0f34.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/users/{page-faf321b61a6fdeef.js → page-65f20e3184bf0474.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/users/preferences/{page-2116015e962a2ecc.js → page-a1494aedec6698f2.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/users/user-roles/{page-7d1bcbbfc8f0694b.js → page-abb35554727c4365.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/workflows/{page-7f9cb24aaa798f42.js → page-52121976736277c5.js} +1 -1
- package/dist/app/_next/static/chunks/app/layout-1af2638eaca64bf1.js +1 -0
- package/dist/app/_next/static/chunks/{webpack-7a100cbf9402e7ea.js → webpack-706ae56cbfc92c86.js} +1 -1
- package/dist/app/activity-log/all-activity/index.html +1 -1
- package/dist/app/activity-log/all-activity/index.txt +3 -3
- package/dist/app/activity-log/email-log/index.html +1 -1
- package/dist/app/activity-log/email-log/index.txt +3 -3
- package/dist/app/activity-log/index.html +1 -1
- package/dist/app/activity-log/index.txt +2 -2
- package/dist/app/activity-log/notifications/index.html +1 -1
- package/dist/app/activity-log/notifications/index.txt +3 -3
- package/dist/app/activity-log/sessions/index.html +1 -1
- package/dist/app/activity-log/sessions/index.txt +3 -3
- package/dist/app/activity-log/workflow-executions/index.html +1 -1
- package/dist/app/activity-log/workflow-executions/index.txt +3 -3
- package/dist/app/activity-log/workflow-logs/index.html +1 -1
- package/dist/app/activity-log/workflow-logs/index.txt +3 -3
- package/dist/app/change-password/index.html +1 -1
- package/dist/app/change-password/index.txt +2 -2
- package/dist/app/dashboard/index.html +1 -1
- package/dist/app/dashboard/index.txt +2 -2
- package/dist/app/data-browser/index.html +1 -1
- package/dist/app/data-browser/index.txt +3 -3
- package/dist/app/file-manager/index.html +1 -1
- package/dist/app/file-manager/index.txt +3 -3
- package/dist/app/forgot-password/index.html +1 -1
- package/dist/app/forgot-password/index.txt +2 -2
- package/dist/app/index.html +1 -1
- package/dist/app/index.txt +2 -2
- package/dist/app/login/index.html +1 -1
- package/dist/app/login/index.txt +2 -2
- package/dist/app/register/index.html +1 -1
- package/dist/app/register/index.txt +2 -2
- package/dist/app/settings/migrations/index.html +1 -1
- package/dist/app/settings/migrations/index.txt +2 -2
- package/dist/app/settings/permissions/index.html +1 -1
- package/dist/app/settings/permissions/index.txt +3 -3
- package/dist/app/settings/project/index.html +1 -1
- package/dist/app/settings/project/index.txt +3 -3
- package/dist/app/settings/roles/index.html +1 -1
- package/dist/app/settings/roles/index.txt +3 -3
- package/dist/app/settings/schema/index.html +1 -1
- package/dist/app/settings/schema/index.txt +3 -3
- package/dist/app/settings/schema-diff/index.html +1 -1
- package/dist/app/settings/schema-diff/index.txt +2 -2
- package/dist/app/settings/tasks/index.html +1 -1
- package/dist/app/settings/tasks/index.txt +3 -3
- package/dist/app/settings/templates/edit/index.html +1 -1
- package/dist/app/settings/templates/edit/index.txt +2 -2
- package/dist/app/settings/templates/index.html +1 -1
- package/dist/app/settings/templates/index.txt +3 -3
- package/dist/app/settings/tenants/index.html +1 -1
- package/dist/app/settings/tenants/index.txt +3 -3
- package/dist/app/users/index.html +1 -1
- package/dist/app/users/index.txt +3 -3
- package/dist/app/users/invites/index.html +1 -1
- package/dist/app/users/invites/index.txt +3 -3
- package/dist/app/users/list/index.html +1 -1
- package/dist/app/users/list/index.txt +3 -3
- package/dist/app/users/preferences/index.html +1 -1
- package/dist/app/users/preferences/index.txt +3 -3
- package/dist/app/users/user-roles/index.html +1 -1
- package/dist/app/users/user-roles/index.txt +3 -3
- package/dist/app/workflows/detail/index.html +1 -1
- package/dist/app/workflows/detail/index.txt +2 -2
- package/dist/app/workflows/edit/index.html +1 -1
- package/dist/app/workflows/edit/index.txt +2 -2
- package/dist/app/workflows/execution/index.html +1 -1
- package/dist/app/workflows/execution/index.txt +2 -2
- package/dist/app/workflows/index.html +1 -1
- package/dist/app/workflows/index.txt +3 -3
- package/dist/auth/core.d.ts.map +1 -1
- package/dist/auth/core.js +11 -0
- package/dist/auth/core.js.map +1 -1
- package/dist/auth/routes.d.ts.map +1 -1
- package/dist/auth/routes.js +3 -0
- package/dist/auth/routes.js.map +1 -1
- package/dist/routes/schema.route.d.ts.map +1 -1
- package/dist/routes/schema.route.js +2 -1
- package/dist/routes/schema.route.js.map +1 -1
- package/dist/services/MCPService.d.ts.map +1 -1
- package/dist/services/MCPService.js +4 -1
- package/dist/services/MCPService.js.map +1 -1
- package/dist/utils/tenantUtils.d.ts.map +1 -1
- package/dist/utils/tenantUtils.js +5 -8
- package/dist/utils/tenantUtils.js.map +1 -1
- package/package.json +2 -2
- package/dist/app/_next/static/chunks/7304-bdd00a7504bc4081.js +0 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/schema/page-3d91124704c2e853.js +0 -1
- package/dist/app/_next/static/chunks/app/layout-64ac14a534e2809b.js +0 -1
- /package/dist/app/_next/static/{MOjte1maseOzDogE76k_j → hX9XuIu3767zdhQ9snZUx}/_buildManifest.js +0 -0
- /package/dist/app/_next/static/{MOjte1maseOzDogE76k_j → hX9XuIu3767zdhQ9snZUx}/_ssgManifest.js +0 -0
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
- **🌍 PostGIS Geospatial Support** — Advanced spatial data operations
|
|
42
42
|
- **📊 Reporting & Analytics** — Generate complex reports with grouping and aggregation
|
|
43
43
|
- **🪝 Hooks System** — Extend functionality with custom hooks on CRUD operations
|
|
44
|
-
- **🏢 Multi-tenant Architecture** — Host multiple isolated organizations in a single instance
|
|
44
|
+
- **🏢 Multi-tenant Architecture** — Host multiple isolated organizations in a single instance with schema-level tenant scoping
|
|
45
45
|
- **⚡ Real-time Updates** — Socket.IO integration with Redis clustering, plus WAL-based CDC for database changes
|
|
46
46
|
- **🚀 High Performance** — Redis-based caching with configurable TTL
|
|
47
47
|
- **🖥️ CLI Tools** — Project scaffolding, TypeScript type generation, and migration management
|
package/dist/README.md
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
- **🌍 PostGIS Geospatial Support** — Advanced spatial data operations
|
|
42
42
|
- **📊 Reporting & Analytics** — Generate complex reports with grouping and aggregation
|
|
43
43
|
- **🪝 Hooks System** — Extend functionality with custom hooks on CRUD operations
|
|
44
|
-
- **🏢 Multi-tenant Architecture** — Host multiple isolated organizations in a single instance
|
|
44
|
+
- **🏢 Multi-tenant Architecture** — Host multiple isolated organizations in a single instance with schema-level tenant scoping
|
|
45
45
|
- **⚡ Real-time Updates** — Socket.IO integration with Redis clustering, plus WAL-based CDC for database changes
|
|
46
46
|
- **🚀 High Performance** — Redis-based caching with configurable TTL
|
|
47
47
|
- **🖥️ CLI Tools** — Project scaffolding, TypeScript type generation, and migration management
|
package/dist/app/404/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/admin/_next/static/css/268abf03bd241f28.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/admin/_next/static/chunks/webpack-
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/admin/_next/static/css/268abf03bd241f28.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/admin/_next/static/chunks/webpack-706ae56cbfc92c86.js"/><script src="/admin/_next/static/chunks/fd9d1056-54169f07cd680d6c.js" async=""></script><script src="/admin/_next/static/chunks/2117-29b5fa47421595ad.js" async=""></script><script src="/admin/_next/static/chunks/main-app-55bcae20c77aaf0e.js" async=""></script><script src="/admin/_next/static/chunks/6fcbdc68-90be1a5480b8d353.js" async=""></script><script src="/admin/_next/static/chunks/5094-8d53e403235d4ca6.js" async=""></script><script src="/admin/_next/static/chunks/4438-c9a12ca15b6e9160.js" async=""></script><script src="/admin/_next/static/chunks/6530-a91e10cffa4200c4.js" async=""></script><script src="/admin/_next/static/chunks/6241-30d7169d1010e5a4.js" async=""></script><script src="/admin/_next/static/chunks/1668-e3eabd0f6753c780.js" async=""></script><script src="/admin/_next/static/chunks/6869-4f920a71fdc6b538.js" async=""></script><script src="/admin/_next/static/chunks/8473-6598318371eca31b.js" async=""></script><script src="/admin/_next/static/chunks/4883-8a924721bb21b3b0.js" async=""></script><script src="/admin/_next/static/chunks/1303-7995fedb9f2f2f71.js" async=""></script><script src="/admin/_next/static/chunks/app/layout-1af2638eaca64bf1.js" async=""></script><link rel="preload" href="https://www.googletagmanager.com/gtag/js?id=G-FBCW8DT7KT" as="script"/><meta name="robots" content="noindex"/><title>Baasix</title><script src="/admin/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="min-h-screen bg-background font-sans antialiased"><!--$--><div class="flex items-center justify-center min-h-screen bg-background"><div class="text-center"><div class="inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-primary border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]"></div><p class="mt-4 text-muted-foreground">Loading...</p></div></div><!--/$--><script src="/admin/_next/static/chunks/webpack-706ae56cbfc92c86.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/admin/_next/static/css/268abf03bd241f28.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[12846,[],\"\"]\n4:I[4707,[],\"\"]\n5:I[36423,[],\"\"]\n6:I[84821,[\"7999\",\"static/chunks/6fcbdc68-90be1a5480b8d353.js\",\"5094\",\"static/chunks/5094-8d53e403235d4ca6.js\",\"4438\",\"static/chunks/4438-c9a12ca15b6e9160.js\",\"6530\",\"static/chunks/6530-a91e10cffa4200c4.js\",\"6241\",\"static/chunks/6241-30d7169d1010e5a4.js\",\"1668\",\"static/chunks/1668-e3eabd0f6753c780.js\",\"6869\",\"static/chunks/6869-4f920a71fdc6b538.js\",\"8473\",\"static/chunks/8473-6598318371eca31b.js\",\"4883\",\"static/chunks/4883-8a924721bb21b3b0.js\",\"1303\",\"static/chunks/1303-7995fedb9f2f2f71.js\",\"3185\",\"static/chunks/app/layout-1af2638eaca64bf1.js\"],\"default\",1]\nc:I[61060,[],\"\"]\n7:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n8:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n9:{\"display\":\"inline-block\"}\na:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"hX9XuIu3767zdhQ9snZUx\",\"assetPrefix\":\"/admin\",\"urlParts\":[\"\",\"_not-found\",\"\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/admin/_next/static/css/268abf03bd241f28.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$8\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$9\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$a\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}],\"params\":{}}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}]]\n3:null\n"])</script></body></html>
|
package/dist/app/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/admin/_next/static/css/268abf03bd241f28.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/admin/_next/static/chunks/webpack-
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/admin/_next/static/css/268abf03bd241f28.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/admin/_next/static/chunks/webpack-706ae56cbfc92c86.js"/><script src="/admin/_next/static/chunks/fd9d1056-54169f07cd680d6c.js" async=""></script><script src="/admin/_next/static/chunks/2117-29b5fa47421595ad.js" async=""></script><script src="/admin/_next/static/chunks/main-app-55bcae20c77aaf0e.js" async=""></script><script src="/admin/_next/static/chunks/6fcbdc68-90be1a5480b8d353.js" async=""></script><script src="/admin/_next/static/chunks/5094-8d53e403235d4ca6.js" async=""></script><script src="/admin/_next/static/chunks/4438-c9a12ca15b6e9160.js" async=""></script><script src="/admin/_next/static/chunks/6530-a91e10cffa4200c4.js" async=""></script><script src="/admin/_next/static/chunks/6241-30d7169d1010e5a4.js" async=""></script><script src="/admin/_next/static/chunks/1668-e3eabd0f6753c780.js" async=""></script><script src="/admin/_next/static/chunks/6869-4f920a71fdc6b538.js" async=""></script><script src="/admin/_next/static/chunks/8473-6598318371eca31b.js" async=""></script><script src="/admin/_next/static/chunks/4883-8a924721bb21b3b0.js" async=""></script><script src="/admin/_next/static/chunks/1303-7995fedb9f2f2f71.js" async=""></script><script src="/admin/_next/static/chunks/app/layout-1af2638eaca64bf1.js" async=""></script><link rel="preload" href="https://www.googletagmanager.com/gtag/js?id=G-FBCW8DT7KT" as="script"/><meta name="robots" content="noindex"/><title>Baasix</title><script src="/admin/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="min-h-screen bg-background font-sans antialiased"><!--$--><div class="flex items-center justify-center min-h-screen bg-background"><div class="text-center"><div class="inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-primary border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]"></div><p class="mt-4 text-muted-foreground">Loading...</p></div></div><!--/$--><script src="/admin/_next/static/chunks/webpack-706ae56cbfc92c86.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/admin/_next/static/css/268abf03bd241f28.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[12846,[],\"\"]\n4:I[4707,[],\"\"]\n5:I[36423,[],\"\"]\n6:I[84821,[\"7999\",\"static/chunks/6fcbdc68-90be1a5480b8d353.js\",\"5094\",\"static/chunks/5094-8d53e403235d4ca6.js\",\"4438\",\"static/chunks/4438-c9a12ca15b6e9160.js\",\"6530\",\"static/chunks/6530-a91e10cffa4200c4.js\",\"6241\",\"static/chunks/6241-30d7169d1010e5a4.js\",\"1668\",\"static/chunks/1668-e3eabd0f6753c780.js\",\"6869\",\"static/chunks/6869-4f920a71fdc6b538.js\",\"8473\",\"static/chunks/8473-6598318371eca31b.js\",\"4883\",\"static/chunks/4883-8a924721bb21b3b0.js\",\"1303\",\"static/chunks/1303-7995fedb9f2f2f71.js\",\"3185\",\"static/chunks/app/layout-1af2638eaca64bf1.js\"],\"default\",1]\nc:I[61060,[],\"\"]\n7:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n8:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n9:{\"display\":\"inline-block\"}\na:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"hX9XuIu3767zdhQ9snZUx\",\"assetPrefix\":\"/admin\",\"urlParts\":[\"\",\"_not-found\",\"\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/admin/_next/static/css/268abf03bd241f28.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$8\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$9\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$a\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}],\"params\":{}}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}]]\n3:null\n"])</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1303],{83434:function(e,t,a){a.d(t,{G:function(){return o}});var s=a(49112);let n="token",i="baasix_access_token",o=(0,s.ql)({url:window.location.origin,authMode:"jwt",autoRefresh:!0,onAuthStateChange:(e,t)=>{console.log("[SDK] Auth state changed:",e,null==t?void 0:t.email)}});{let e=localStorage.getItem(n)||localStorage.getItem(i);e&&(o.setToken(e),localStorage.setItem(n,e),localStorage.setItem(i,e)),window.addEventListener("storage",e=>{(e.key===n||e.key===i)&&(e.newValue?(o.setToken(e.newValue),localStorage.setItem(n,e.newValue),localStorage.setItem(i,e.newValue)):o.setToken(""))})}},28757:function(e,t,a){a.d(t,{DG:function(){return u},LR:function(){return r},fO:function(){return f},gm:function(){return o}});let s=(e,t)=>"collections"===e||"baasix_SchemaDefinition"===e?{type:"schemas"}:"files"===e||"baasix_File"===e?{type:"files"}:"permissions"===e||"baasix_Permission"===e?{type:"permissions"}:"baasix_Settings"===e?{type:"items",collection:"baasix_Settings"}:"roles"===e?{type:"items",collection:"baasix_Role"}:"users"===e?{type:"items",collection:"baasix_User"}:"indexes"===e?{type:"indexes",collectionName:null==t?void 0:t.collectionName}:"relationships"===e?{type:"relationships",collectionName:null==t?void 0:t.collectionName}:{type:"items",collection:e},n={eq:"eq",ne:"ne",lt:"lt",gt:"gt",lte:"lte",gte:"gte",in:"in",notIn:"notIn",like:"like",notLike:"notLike",iLike:"iLike",notILike:"notILike",startsWith:"startsWith",nstartsWith:"nstartsWith",endsWith:"endsWith",nendsWith:"nendsWith",between:"between",notBetween:"notBetween",isNull:"isNull",isNotNull:"isNotNull",_true:"eq",_false:"eq",or:"OR",and:"AND",intersects:"intersects",nIntersects:"nIntersects",dwithin:"dwithin",containsGEO:"containsGEO",within:"within",arraycontains:"arraycontains",arraycontained:"arraycontained",jsonbContains:"jsonbContains",jsonbContainedBy:"jsonbContainedBy",jsonbNotContains:"jsonbNotContains",jsonbHasKey:"jsonbHasKey",jsonbHasAnyKeys:"jsonbHasAnyKeys",jsonbHasAllKeys:"jsonbHasAllKeys",nin:"notIn",contains:"like",containss:"iLike",ncontains:"notLike",ncontainss:"notILike",null:"isNull",nnull:"isNotNull",nbetween:"notBetween",startswith:"startsWith",startswiths:"startsWiths",nstartswith:"nstartsWith",nstartswiths:"nstartsWiths",endswith:"endsWith",endswiths:"endsWiths",nendswith:"nendsWith",nendswiths:"nendsWiths",true:"eq",false:"eq"},i={eq:"eq",ne:"ne",lt:"lt",gt:"gt",lte:"lte",gte:"gte",in:"in",notIn:"notIn",like:"like",notLike:"notLike",iLike:"iLike",notILike:"notILike",startsWith:"startsWith",nstartsWith:"nstartsWith",endsWith:"endsWith",nendsWith:"nendsWith",between:"between",notBetween:"notBetween",isNull:"isNull",isNotNull:"isNotNull",OR:"or",AND:"and",intersects:"intersects",nIntersects:"nIntersects",dwithin:"dwithin",containsGEO:"containsGEO",within:"within",arraycontains:"arraycontains",arraycontained:"arraycontained",jsonbContains:"jsonbContains",jsonbContainedBy:"jsonbContainedBy",jsonbNotContains:"jsonbNotContains",jsonbHasKey:"jsonbHasKey",jsonbHasAnyKeys:"jsonbHasAnyKeys",jsonbHasAllKeys:"jsonbHasAllKeys"},o=e=>{if(!e||0===e.length)return{};let t={AND:[]};return(e.forEach(e=>{if("field"in e){let a=n[e.operator]||e.operator;t.AND.push({[e.field]:{[a]:e.value}})}else if("operator"in e&&("and"===e.operator||"or"===e.operator)){let a=n[e.operator]||e.operator,s={[a]:[]};e.value.forEach(e=>{if("field"in e){let t=n[e.operator]||e.operator;s[a].push({[e.field]:{[t]:e.value}})}else if("operator"in e){let t=o([e]);t.AND&&t.AND.length>0?s[a].push(...t.AND):s[a].push(t)}}),t.AND.push(s)}}),1===t.AND.length)?t.AND[0]:t},r=e=>{if(!e||0===Object.keys(e).length)return[];let t=e=>{let a=[];return Object.entries(e).forEach(e=>{let[s,n]=e;if("AND"===s||"OR"===s){let e=i[s]||s.toLowerCase(),o=[];Array.isArray(n)&&n.forEach(e=>{let a=t(e);o.push(...a)}),o.length>0&&a.push({operator:e,value:o})}else"object"==typeof n&&null!==n&&Object.entries(n).forEach(e=>{let[t,n]=e,o=i[t]||t;a.push({field:s,operator:o,value:n})})}),a};return t(e)},l=e=>{if(void 0===e)return null;let{field:t,operator:a,value:s}=e;return{[t]:{[n[a]||a]:s}}},c=e=>{if(void 0===e)return null;let{operator:t,value:a}=e,s=n[t]||t,i={};return i[s]=[],a.forEach(e=>{if("field"in e){let t=l(e);t&&i[s].push(t)}else{let t=c(e);t&&i[s].push(t)}}),i},h=e=>{let t={},a="";return e&&(t.AND=[],e.forEach(e=>{if("or"!==e.operator&&"and"!==e.operator&&"field"in e){let{field:s,value:n}=e;if(n){if("search"===s)a=n;else{let a=l(e);a&&t.AND.push(a)}}}else{let a=c(e);a&&t.AND.push(a)}})),{search:a,filters:t}},d=e=>{if(!e||0===e.length)return;let t={};return e.forEach(e=>{t[e.field]=e.order}),t},u=e=>({getList:async t=>{let{resource:a,pagination:n,filters:i,sorters:o,meta:r}=t,l=s(a,r),c=h(i),u=10;("collections"===a||"baasix_SchemaDefinition"===a)&&(u=50);let f={page:(null==n?void 0:n.current)||1,limit:(null==n?void 0:n.pageSize)||u,filter:c.filters,sort:d(o),...r};c.search&&(f.search=c.search);try{let t;switch(l.type){case"schemas":t=await e.schemas.find(f);break;case"files":t=await e.files.find(f);break;case"permissions":t=await e.permissions.find(f);break;default:t=await e.items(l.collection).find(f)}return{data:t.data||[],total:t.totalCount||0}}catch(e){throw console.error("getList error for ".concat(a,":"),e),e}},getOne:async t=>{let{resource:a,id:n,meta:i}=t,o=s(a,i),r=(null==i?void 0:i.fields)&&Array.isArray(i.fields)?i.fields.filter(e=>"string"==typeof e):["*"];try{let t;switch(o.type){case"schemas":t=await e.schemas.findOne(n);break;case"files":t=await e.files.findOne(n);break;case"permissions":t=await e.permissions.findOne(n);break;default:t=await e.items(o.collection).findOne(n,{fields:r})}return{data:t}}catch(e){throw console.error("getOne error for ".concat(a,"/").concat(n,":"),e),e}},create:async t=>{let{resource:a,variables:n,meta:i}=t,o=s(a,i);try{let t;switch(o.type){case"schemas":t=await e.schemas.create(n);break;case"files":if(n instanceof FormData){let a=n.get("file");if(a)t=await e.files.upload(a);else throw Error("No file provided in FormData")}else t=await e.files.upload(n);break;case"permissions":t=await e.permissions.create(n);break;case"indexes":t=await e.schemas.createIndex(o.collectionName,n);break;case"relationships":t=await e.schemas.createRelationship(o.collectionName,n);break;default:t={id:await e.items(o.collection).create(n)}}return{data:t}}catch(e){throw console.error("create error for ".concat(a,":"),e),e}},update:async t=>{let{resource:a,id:n,variables:i,meta:o}=t,r=s(a,o);try{let t;switch(r.type){case"schemas":t=await e.schemas.update(n,i);break;case"files":t=await e.files.update(n,i);break;case"permissions":t=await e.permissions.update(n,i);break;case"relationships":t=await e.schemas.updateRelationship(r.collectionName,n,i);break;default:await e.items(r.collection).update(n,i),t={id:n}}return{data:t}}catch(e){throw console.error("update error for ".concat(a,"/").concat(n,":"),e),e}},deleteOne:async t=>{let{resource:a,id:n,meta:i}=t,o=s(a,i);try{switch(o.type){case"schemas":await e.schemas.delete(n);break;case"files":await e.files.delete(n);break;case"permissions":await e.permissions.delete(n);break;case"indexes":await e.schemas.deleteIndex(o.collectionName,n);break;case"relationships":await e.schemas.deleteRelationship(o.collectionName,n);break;default:await e.items(o.collection).delete(n)}return{data:{id:n}}}catch(e){throw console.error("deleteOne error for ".concat(a,"/").concat(n,":"),e),e}},getMany:async t=>{let{resource:a,ids:n,meta:i}=t,o=s(a,i),r={id:{in:n}};try{let t;switch(o.type){case"schemas":t=await e.schemas.find({filter:r});break;case"files":t=await e.files.find({filter:r});break;case"permissions":t=await e.permissions.find({filter:r});break;default:t=await e.items(o.collection).find({filter:r})}return{data:t.data||[]}}catch(e){throw console.error("getMany error for ".concat(a,":"),e),e}},createMany:async t=>{let{resource:a,variables:n,meta:i}=t,o=s(a,i);try{if("items"!==o.type)throw Error("createMany not supported for ".concat(o.type));return{data:(await e.items(o.collection).createMany(n)).map(e=>({id:e}))}}catch(e){throw console.error("createMany error for ".concat(a,":"),e),e}},updateMany:async t=>{let{resource:a,ids:n,variables:i,meta:o}=t,r=s(a,o);try{if("items"!==r.type&&"files"!==r.type)throw Error("updateMany not supported for ".concat(r.type));let t="files"===r.type?"baasix_File":r.collection;return await e.items(t).updateMany(n,i),{data:n.map(e=>({id:e}))}}catch(e){throw console.error("updateMany error for ".concat(a,":"),e),e}},deleteMany:async t=>{let{resource:a,ids:n,meta:i}=t,o=s(a,i);try{if("items"!==o.type&&"files"!==o.type)throw Error("deleteMany not supported for ".concat(o.type));let t="files"===o.type?"baasix_File":o.collection;return await e.items(t).deleteMany(n),{data:n.map(e=>({id:e}))}}catch(e){throw console.error("deleteMany error for ".concat(a,":"),e),e}},custom:async t=>{let{url:a,method:s,filters:n,sorters:i,payload:o,query:r,headers:l}=t,c=e.request,h={...r,filter:n,sort:i};try{let e;let t=o instanceof FormData;switch(s){case"get":e=await c.get(a,{params:h});break;case"post":e=t?await c.upload(a,o,{params:h}):await c.post(a,o,{params:h});break;case"put":e=await c.put(a,o,{params:h});break;case"patch":e=await c.patch(a,o,{params:h});break;case"delete":e=await c.delete(a,{params:h});break;default:throw Error("Unsupported method: ".concat(s))}return{data:e}}catch(e){throw console.error("custom request error:",e),e}},getApiUrl:()=>window.location.origin}),f=e=>async function(t,a,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"before";await e.items(t).sortItem(a,s,n)}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4033],{79622:function(e,t,a){a.d(t,{OF:function(){return q},o_:function(){return F},Zl:function(){return eK},XG:function(){return eo},mq:function(){return L},sU:function(){return em}});var r=a(57437),s=a(2265),l=a(40279),n=a(71096),i=a.n(n),o=a(45721),d=a.n(o),c=a(13257),u=a.n(c);i().extend(d()),i().extend(u());let m=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null==e)return"";if(Array.isArray(e)){if("count"===t)return e.length.toString();if("list"===t){let t=a.separator||", ",r=a.limit,s=(r?e.slice(0,r):e).map(e=>"object"==typeof e&&null!==e?e.name||e.title||e.label||e.id||JSON.stringify(e):String(e)).join(t),l=r&&e.length>r?e.length-r:0;return l>0?"".concat(s," (+").concat(l," more)"):s}return"".concat(e.length," item").concat(1!==e.length?"s":"")}switch(t){case"raw":case"badge":case"color":case"image":case"file":default:return String(e);case"email":case"url":case"phone":return e;case"truncate":let r=String(e),s=a.maxLength||50;return r.length>s?"".concat(r.substring(0,s),"..."):r;case"uppercase":return String(e).toUpperCase();case"lowercase":return String(e).toLowerCase();case"capitalize":return String(e).charAt(0).toUpperCase()+String(e).slice(1).toLowerCase();case"currency":let l=a.currency||"USD";return new Intl.NumberFormat("en-US",{style:"currency",currency:l,minimumFractionDigits:a.decimals||2,maximumFractionDigits:a.decimals||2}).format(Number(e));case"percentage":return"".concat((100*Number(e)).toFixed(a.decimals||1),"%");case"decimal":return Number(e).toFixed(a.decimals||2);case"integer":return Math.round(Number(e)).toString();case"filesize":return h(Number(e));case"date":return i()(e).format(a.format||"YYYY-MM-DD");case"datetime":let n=a.format||(a.use24Hour?"YYYY-MM-DD HH:mm":"YYYY-MM-DD h:mm A");return i()(e).format(a.showSeconds?n+":ss":n);case"time":let o=a.use24Hour?"HH:mm":"h:mm A";return i()(e).format(a.showSeconds?o+":ss":o);case"relative":return i()(e).fromNow();case"age":let d=i()().diff(i()(e),"years");return"".concat(d," year").concat(1!==d?"s":"");case"duration":let c=i().duration(Number(e),"milliseconds");if(c.asHours()>=1)return"".concat(Math.floor(c.asHours()),"h ").concat(c.minutes(),"m");if(c.asMinutes()>=1)return"".concat(Math.floor(c.asMinutes()),"m ").concat(c.seconds(),"s");return"".concat(c.seconds(),"s");case"iso":return i()(e).toISOString();case"timestamp":return i()(e).unix().toString();case"boolean":case"check":return e?"✓":"✗";case"yesno":return e?a.trueText||"Yes":a.falseText||"No";case"truefalse":return e?a.trueText||"True":a.falseText||"False";case"list":if(!Array.isArray(e))return String(e);let u=a.separator||", ",m=a.limit,p=(m?e.slice(0,m):e).join(u);return m&&e.length>m?"".concat(p,"... (+").concat(e.length-m," more)"):p;case"count":return Array.isArray(e)?e.length.toString():"0";case"json":return JSON.stringify(e,null,2)}},h=e=>{if(0===e)return"0 Bytes";let t=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,t)).toFixed(2))," ").concat(["Bytes","KB","MB","GB","TB"][t])};var p=e=>{let{value:t,format:a,options:s}=e,l=m(t,a,s);switch(a){case"email":return(0,r.jsx)("a",{href:"mailto:".concat(t),className:"text-primary hover:underline",children:l});case"url":return(0,r.jsx)("a",{href:t,target:(null==s?void 0:s.target)||"_blank",rel:(null==s?void 0:s.rel)||"noopener noreferrer",className:"text-primary hover:underline",children:l});case"phone":return(0,r.jsx)("a",{href:"tel:".concat(t),className:"text-primary hover:underline",children:l});case"color":return(0,r.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,r.jsx)("span",{className:"h-4 w-4 rounded border border-border",style:{backgroundColor:t}}),(0,r.jsx)("span",{children:t})]});case"check":return(0,r.jsx)("span",{className:t?"text-green-600":"text-red-600",children:l});case"badge":return(0,r.jsx)("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:l});default:return(0,r.jsx)("span",{children:l})}};let f=s.memo(e=>{let{value:t,onChange:a,placeholder:s,disabled:n,readOnly:i,maxLength:o,showCount:d,size:c,displayFormat:u,displayOptions:m}=e;return i?u&&"raw"!==u?(0,r.jsx)(p,{value:t,format:u,options:m}):(0,r.jsx)("span",{className:"text-sm",children:t||""}):(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(l.I,{value:t||"",onChange:e=>null==a?void 0:a(e.target.value),placeholder:s,disabled:n,maxLength:o,className:c?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[c]:""}),d&&o&&(0,r.jsxs)("span",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-muted-foreground",children:[(null==t?void 0:t.length)||0,"/",o]})]})});f.displayName="TextField";let x=s.memo(e=>{let{value:t,onChange:a,placeholder:s,disabled:n,readOnly:i,size:o,min:d,max:c,step:u,precision:m}=e;if(i){let e=(null==t?void 0:t.toString())||"";return void 0!==m&&null!=t&&(e=t.toFixed(m)),(0,r.jsx)("span",{className:"text-sm",children:e})}return(0,r.jsx)(l.I,{type:"number",value:null!=t?t:"",onChange:e=>{let t=e.target.value;if(""===t)null==a||a(null);else{let e=parseFloat(t);isNaN(e)||(void 0!==m?null==a||a(parseFloat(e.toFixed(m))):null==a||a(e))}},placeholder:s,disabled:n,min:d,max:c,step:u,className:o?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[o]:""})});x.displayName="NumberField";var g=a(94589),v=a(69174),y=e=>{let{value:t,onChange:a,disabled:s,size:l,readOnly:n}=e;return n?(0,r.jsx)(v.C,{variant:t?"default":"destructive",children:t?"Yes":"No"}):(0,r.jsx)(g.r,{checked:t||!1,onCheckedChange:a,disabled:s,className:"small"===l?"h-4 w-7":""})},j=a(12381),N=a(46291),b=a(12749),w=a(31047),C=a(60936),k=a(27107),S=a(93448),A=e=>{let{value:t,onChange:a,placeholder:s,disabled:l,readOnly:n,size:i,displayFormat:o,displayOptions:d}=e,c=t?"string"==typeof t?(0,C.D)(t):t:void 0;return n?c&&o&&"raw"!==o?(0,r.jsx)(p,{value:c,format:o,options:d}):(0,r.jsx)("span",{className:"text-sm",children:c?(0,k.WU)(c,"PPP"):""}):(0,r.jsxs)(b.J2,{children:[(0,r.jsx)(b.xo,{asChild:!0,children:(0,r.jsxs)(j.z,{variant:"outline",disabled:l,className:(0,S.cn)("w-full justify-start text-left font-normal",!c&&"text-muted-foreground",i?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[i]:""),children:[(0,r.jsx)(w.Z,{className:"mr-2 h-4 w-4"}),c?(0,k.WU)(c,"PPP"):s||"Pick a date"]})}),(0,r.jsx)(b.yk,{className:"w-auto p-0",align:"start",children:(0,r.jsx)(N.f,{mode:"single",selected:c,onSelect:e=>null==a?void 0:a(e?e.toISOString():null),initialFocus:!0})})]})},O=e=>{let{value:t,onChange:a,placeholder:n,disabled:i,readOnly:o,size:d,displayFormat:c,displayOptions:u}=e,m=t?"string"==typeof t?(0,C.D)(t):t:void 0,[h,f]=s.useState(m?(0,k.WU)(m,"HH:mm"):"");if(s.useEffect(()=>{m&&f((0,k.WU)(m,"HH:mm"))},[t]),o)return m&&c&&"raw"!==c?(0,r.jsx)(p,{value:m,format:c,options:u}):(0,r.jsx)("span",{className:"text-sm",children:m?(0,k.WU)(m,"PPP HH:mm"):""});let x={small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"};return(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)(b.J2,{children:[(0,r.jsx)(b.xo,{asChild:!0,children:(0,r.jsxs)(j.z,{variant:"outline",disabled:i,className:(0,S.cn)("flex-1 justify-start text-left font-normal",!m&&"text-muted-foreground",d?x[d]:""),children:[(0,r.jsx)(w.Z,{className:"mr-2 h-4 w-4"}),m?(0,k.WU)(m,"PPP"):n||"Pick a date"]})}),(0,r.jsx)(b.yk,{className:"w-auto p-0",align:"start",children:(0,r.jsx)(N.f,{mode:"single",selected:m,onSelect:e=>{if(e){let[t,r]=h.split(":").map(Number);e.setHours(t||0,r||0,0,0),null==a||a(e.toISOString())}else null==a||a(null)},initialFocus:!0})})]}),(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)(l.I,{type:"time",value:h,onChange:e=>{let t=e.target.value;if(f(t),m&&t){let[e,r]=t.split(":").map(Number),s=new Date(m);s.setHours(e,r,0,0),null==a||a(s.toISOString())}},disabled:i,className:(0,S.cn)("w-32",d?x[d]:"")})})]})},z=e=>{let{value:t,onChange:a,placeholder:s,disabled:n,readOnly:i,size:o}=e;return i?(0,r.jsx)("span",{className:"text-sm",children:t||""}):(0,r.jsx)(l.I,{type:"time",value:t||"",onChange:e=>null==a?void 0:a(e.target.value||null),placeholder:s,disabled:n,className:(0,S.cn)(o?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[o]:"")})},_=a(23675),I=a(47416),T=a(74440),Z=a(74291),L=e=>{let{value:t,onChange:a,placeholder:l,disabled:n,readOnly:i}=e,[o,d]=(0,s.useState)(""),[c,u]=(0,s.useState)(null),[m,h]=(0,s.useState)(!1);(0,s.useEffect)(()=>{try{d(t?JSON.stringify(t,null,2):""),u(null)}catch(e){d(String(t))}},[t]);let p=e=>{if(d(e),!e.trim()){null==a||a(null),u(null);return}try{let t=JSON.parse(e);null==a||a(t),u(null)}catch(e){u("Invalid JSON")}};if(i)return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)("pre",{className:"rounded bg-muted p-2 pr-7 text-xs overflow-auto max-h-32 max-w-[400px] whitespace-pre-wrap break-all",children:o||"-"}),o&&(0,r.jsx)(j.z,{type:"button",variant:"ghost",size:"sm",className:"absolute right-1 top-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>h(!0),children:(0,r.jsx)(I.Z,{className:"h-3 w-3"})})]}),(0,r.jsx)(Z.Vq,{open:m,onOpenChange:h,children:(0,r.jsxs)(Z.cZ,{className:"max-w-3xl",children:[(0,r.jsx)(Z.fK,{children:(0,r.jsx)(Z.$N,{children:"View JSON"})}),(0,r.jsx)("pre",{className:"rounded bg-muted p-4 text-sm font-mono overflow-auto max-h-[60vh] whitespace-pre-wrap",children:o||"-"})]})})]});let f=(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(_.g,{value:o,onChange:e=>p(e.target.value),placeholder:l||'{"key": "value"}',disabled:n,className:"min-h-[120px] font-mono text-sm ".concat(c?"border-destructive":"")}),c&&(0,r.jsx)("p",{className:"mt-1 text-xs text-destructive",children:c}),(0,r.jsx)(j.z,{type:"button",variant:"ghost",size:"sm",className:"absolute right-1 top-1 h-6 w-6 p-0",onClick:()=>h(!m),children:m?(0,r.jsx)(T.Z,{className:"h-3 w-3"}):(0,r.jsx)(I.Z,{className:"h-3 w-3"})})]});return m?(0,r.jsx)(Z.Vq,{open:m,onOpenChange:h,children:(0,r.jsxs)(Z.cZ,{className:"max-w-3xl",children:[(0,r.jsx)(Z.fK,{children:(0,r.jsx)(Z.$N,{children:"Edit JSON"})}),(0,r.jsx)(_.g,{value:o,onChange:e=>p(e.target.value),placeholder:l||'{"key": "value"}',disabled:n,className:"min-h-[400px] font-mono text-sm ".concat(c?"border-destructive":"")}),c&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:c})]})}):f},R=e=>{let{value:t,onChange:a,placeholder:s,disabled:l,readOnly:n,autoSize:i}=e;if(n)return(0,r.jsx)("div",{className:"whitespace-pre-wrap text-sm rounded bg-muted p-2",children:t||""});let o=(null==i?void 0:i.minRows)?24*i.minRows:72,d=(null==i?void 0:i.maxRows)?24*i.maxRows:200;return(0,r.jsx)(_.g,{value:t||"",onChange:e=>null==a?void 0:a(e.target.value),placeholder:s,disabled:l,style:{minHeight:o,maxHeight:d},className:"resize-y"})},E=a(24156),M=a(99397),P=a(30401),D=a(2596),F=e=>{let{value:t,onChange:a,options:l=[],disabled:n,readOnly:i,size:o,placeholder:d,allowCustom:c=!0,allowNull:u=!1}=e,[m,h]=(0,s.useState)(!1),[p,f]=(0,s.useState)("");if((0,s.useEffect)(()=>{m||f("")},[m]),i)return t?(0,r.jsx)(v.C,{variant:"secondary",children:t}):(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"});let x=e=>{null==a||a(e),h(!1),f("")},g=()=>{p.trim()&&(null==a||a(p.trim()),h(!1),f(""))},y=Array.isArray(l)?l:[],N=p.trim()&&!y.some(e=>e.toLowerCase()===p.trim().toLowerCase()),w=p.trim()?y.filter(e=>e.toLowerCase().includes(p.toLowerCase())):y;return(0,r.jsxs)(b.J2,{open:m,onOpenChange:h,children:[(0,r.jsx)(b.xo,{asChild:!0,children:(0,r.jsxs)(j.z,{variant:"outline",role:"combobox","aria-expanded":m,disabled:n,className:(0,S.cn)("w-full justify-between font-normal","small"===o?"h-8 text-sm":"h-10",!t&&"text-muted-foreground"),children:[t||d||"Select an option...",(0,r.jsx)(E.Z,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,r.jsx)(b.yk,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:(0,r.jsxs)(D.mY,{shouldFilter:!1,children:[(0,r.jsx)(D.sZ,{placeholder:"Search or type custom value...",value:p,onValueChange:f}),(0,r.jsxs)(D.e8,{children:[(0,r.jsx)(D.rb,{children:c&&p.trim()?(0,r.jsxs)("button",{onClick:g,className:"flex w-full items-center gap-2 px-2 py-1.5 text-sm hover:bg-accent rounded cursor-pointer",children:[(0,r.jsx)(M.Z,{className:"h-4 w-4"}),'Add "',p.trim(),'"']}):"No options found."}),(0,r.jsxs)(D.fu,{children:[u&&(0,r.jsxs)(D.di,{value:"",onSelect:()=>x(""),children:[(0,r.jsx)(P.Z,{className:(0,S.cn)("mr-2 h-4 w-4",""!==t&&t?"opacity-0":"opacity-100")}),(0,r.jsx)("span",{className:"text-muted-foreground italic",children:"None"})]}),w.map(e=>(0,r.jsxs)(D.di,{value:e,onSelect:()=>x(e),children:[(0,r.jsx)(P.Z,{className:(0,S.cn)("mr-2 h-4 w-4",t===e?"opacity-100":"opacity-0")}),e]},e))]}),c&&N&&w.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(D.zz,{}),(0,r.jsx)(D.fu,{children:(0,r.jsxs)(D.di,{value:"add-custom-".concat(p),onSelect:g,children:[(0,r.jsx)(M.Z,{className:"mr-2 h-4 w-4"}),'Add "',p.trim(),'"']})})]})]})]})})]})},U=a(69658),Y=a(96362),H=e=>{let{value:t,onChange:a,disabled:s,readOnly:l}=e,n=t?"string"==typeof t?t:t.url:null,i=(()=>{if(!t)return null;if("string"==typeof t){let e=t.split("/");return e[e.length-1]}return t.name||"File"})();return l?n?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(U.Z,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline truncate max-w-[200px]",children:i}),(0,r.jsx)(j.z,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>window.open(n,"_blank"),children:(0,r.jsx)(Y.Z,{className:"h-3 w-3"})})]}):(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,r.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-input p-2",children:[(0,r.jsx)(U.Z,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)("span",{className:"text-sm text-muted-foreground",children:i||"No file selected"}),(0,r.jsx)(j.z,{type:"button",variant:"outline",size:"sm",disabled:s,children:"Upload"})]})},J=a(53113),B=e=>{let{value:t,onChange:a,disabled:s,readOnly:l}=e,n=t?"string"==typeof t?t:t.url:null;return l?n?(0,r.jsx)("div",{className:"relative inline-block",children:(0,r.jsx)("img",{src:n,alt:"Preview",className:"h-12 w-12 rounded object-cover border border-border",onError:e=>{e.target.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Crect fill='%23eee' width='48' height='48'/%3E%3Ctext x='50%25' y='50%25' dominant-baseline='middle' text-anchor='middle' fill='%23999' font-size='12'%3E?%3C/text%3E%3C/svg%3E"}})}):(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,r.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-input p-2",children:[n?(0,r.jsx)("img",{src:n,alt:"Preview",className:"h-10 w-10 rounded object-cover"}):(0,r.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded bg-muted",children:(0,r.jsx)(J.Z,{className:"h-5 w-5 text-muted-foreground"})}),(0,r.jsx)("span",{className:"flex-1 text-sm text-muted-foreground truncate",children:n?"Image uploaded":"No image selected"}),(0,r.jsx)(j.z,{type:"button",variant:"outline",size:"sm",disabled:s,children:"Upload"})]})},V=e=>{let{value:t,onChange:a,disabled:s,readOnly:n}=e;return n?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"h-6 w-6 rounded border border-border",style:{backgroundColor:t||"transparent"}}),(0,r.jsx)("span",{className:"text-sm font-mono",children:t||"-"})]}):(0,r.jsxs)(b.J2,{children:[(0,r.jsx)(b.xo,{asChild:!0,children:(0,r.jsxs)(j.z,{variant:"outline",className:"w-full justify-start gap-2",disabled:s,children:[(0,r.jsx)("div",{className:"h-4 w-4 rounded border border-border",style:{backgroundColor:t||"transparent"}}),(0,r.jsx)("span",{className:"font-mono text-sm",children:t||"Select color"})]})}),(0,r.jsx)(b.yk,{className:"w-auto p-3",children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(l.I,{type:"color",value:t||"#000000",onChange:e=>null==a?void 0:a(e.target.value),className:"h-10 w-full cursor-pointer"}),(0,r.jsx)(l.I,{value:t||"",onChange:e=>null==a?void 0:a(e.target.value),placeholder:"#000000",className:"font-mono"})]})})]})},G=e=>{let{value:t,onChange:a,disabled:s,readOnly:n,size:i}=e;return n?(0,r.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:t||"-"}):(0,r.jsx)(l.I,{value:t||"",onChange:e=>null==a?void 0:a(e.target.value),disabled:s,className:(0,S.cn)("font-mono",i?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[i]:""),placeholder:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"})},W=a(32489),q=e=>{let{value:t=[],onChange:a,itemType:n="string",disabled:i,readOnly:o,size:d,placeholder:c}=e,[u,m]=(0,s.useState)(""),h=e=>{if(null==e)return"";if("date"===n||"datetime"===n){let t=new Date(e);return isNaN(t.getTime())?String(e):"datetime"===n?t.toLocaleString():t.toLocaleDateString()}return"boolean"===n?e?"true":"false":String(e)};if(o){let e=Array.isArray(t)?t:[];return(0,r.jsxs)("div",{className:"flex flex-wrap gap-1 max-w-[250px] overflow-hidden",children:[e.length>0?e.slice(0,5).map((e,t)=>(0,r.jsx)(v.C,{variant:"secondary",className:"truncate max-w-[120px]",children:h(e)},t)):(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"}),e.length>5&&(0,r.jsxs)(v.C,{variant:"outline",children:["+",e.length-5]})]})}let p=()=>{let e;if("date"===n||"datetime"===n||"time"===n){if(!u)return}else if("boolean"!==n&&!u.trim())return;switch(n){case"number":if(isNaN(e=parseFloat(u.trim())))return;break;case"boolean":e="true"===u.trim().toLowerCase();break;case"date":case"time":if(!u)return;e=u;break;case"datetime":if(!u)return;e=new Date(u).toISOString();break;default:e=u.trim()}null==a||a([...Array.isArray(t)?t:[],e]),m("")},f=e=>{let r=[...Array.isArray(t)?t:[]];r.splice(e,1),null==a||a(r)};return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.I,{type:(()=>{switch(n){case"number":return"number";case"date":return"date";case"datetime":return"datetime-local";case"time":return"time";default:return"text"}})(),value:u,onChange:e=>{m(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),p())},placeholder:(()=>{if(c)return c;switch(n){case"number":return"Enter a number";case"date":return"Select a date";case"datetime":return"Select date and time";case"time":return"Select a time";case"boolean":return"Enter true or false";default:return"Enter a value"}})(),disabled:i,className:(0,S.cn)(d?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[d]:"")}),(0,r.jsx)(j.z,{type:"button",variant:"outline",size:"icon",onClick:()=>{p()},disabled:i||!u,className:(0,S.cn)("small"===d?"h-8 w-8":""),children:(0,r.jsx)(M.Z,{className:"h-4 w-4"})})]}),Array.isArray(t)&&t.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:t.map((e,t)=>(0,r.jsxs)(v.C,{variant:"secondary",className:"gap-1 pr-1",children:[h(e),(0,r.jsx)("button",{type:"button",onClick:()=>f(t),className:"ml-1 rounded-full hover:bg-muted",disabled:i,children:(0,r.jsx)(W.Z,{className:"h-3 w-3"})})]},t))})]})},K=a(71488),$=a(49322),X=e=>{let{value:t,onChange:a,field:l,disabled:n,readOnly:i,size:o,displayFormat:d,displayOptions:c}=e,u=s.useMemo(()=>{if(!t)return(null==l?void 0:l.showAs)&&(Array.isArray(l.showAs)?l.showAs.length>0:l.showAs)?null:"not-configured";if(Array.isArray(t))return{isArray:!0,items:t,field:l};if("object"==typeof t&&null!==t){if(null==l?void 0:l.showAs){if(Array.isArray(l.showAs)){let e=[" - "," ",", ","_"," & "," | "," (",") ","(",")"],a=[];l.showAs.forEach(r=>{if(e.includes(r))a.push(r);else{let e;if(r.includes(".")){let a=r.split("."),s=t;for(let e of a)if(null==(s=null==s?void 0:s[e]))break;e=s}else e=t[r];null!=e&&""!==e&&a.push(String(e))}});let r=a.filter((t,r)=>{let s=e.includes(t),l=r>0&&e.includes(a[r-1]),n=r===a.length-1;return!s||0!==r&&!n&&!l});return r.length>0?r.join(""):null}if("string"==typeof l.showAs){let e=l.showAs.split(",").map(e=>e.trim()).map(e=>t[e]).filter(Boolean);return e.length>0?e.join("-"):null}}return t.id||t.name||t.title||(Object.keys(t)[0]?t[Object.keys(t)[0]]:null)}return String(t)},[t,l]);if(i){if(u&&"object"==typeof u&&u.isArray){let{items:e,field:t}=u;if(!e||0===e.length)return(0,r.jsxs)(K.u,{children:[(0,r.jsx)(K.aJ,{children:(0,r.jsx)(v.C,{variant:"secondary",children:"Empty"})}),(0,r.jsx)(K._v,{children:"No related items"})]});let a=e.slice(0,3),s=e.length-3;return(0,r.jsxs)("div",{className:"flex flex-wrap gap-1",children:[a.map((e,a)=>{let s="";if((null==t?void 0:t.showAs)&&Array.isArray(t.showAs)){let a=[" - "," ",", ","_"," & "," | "," (",") ","(",")"],r=[];t.showAs.forEach(t=>{if(a.includes(t))r.push(t);else{let a;if(t.includes(".")){let r=t.split("."),s=e;for(let e of r)if(null==(s=null==s?void 0:s[e]))break;a=s}else a=e[t];null!=a&&""!==a&&r.push(String(a))}}),s=r.filter((e,t)=>{let s=a.includes(e),l=t>0&&a.includes(r[t-1]),n=t===r.length-1;return!s||0!==t&&!n&&!l}).join("")}else s=(null==t?void 0:t.showAs)&&"string"==typeof t.showAs?e[t.showAs]||e.name||e.title||e.id||"Item":e.name||e.title||e.id||"Item ".concat(a+1);return(0,r.jsx)(v.C,{variant:"default",children:s||"Item ".concat(a+1)},e.id||a)}),s>0&&(0,r.jsxs)(v.C,{variant:"secondary",children:["+",s," more"]})]})}return"not-configured"===u?(0,r.jsxs)(K.u,{children:[(0,r.jsxs)(K.aJ,{className:"flex items-center gap-1",children:[(0,r.jsx)($.Z,{className:"h-4 w-4 text-yellow-500"}),(0,r.jsx)(v.C,{variant:"outline",className:"text-yellow-600",children:"Not Configured"})]}),(0,r.jsxs)(K._v,{children:["Display format not configured for relation '",null==l?void 0:l.name,"'. Configure 'showAs' field in schema management."]})]}):u&&""!==u?(0,r.jsx)("span",{className:"text-sm",children:u}):(0,r.jsxs)(K.u,{children:[(0,r.jsx)(K.aJ,{children:(0,r.jsx)(v.C,{variant:"secondary",children:"No Data"})}),(0,r.jsx)(K._v,{children:"Related data not found or not loaded"})]})}return(0,r.jsx)(f,{value:"not-configured"!==u&&u?String(u):"",onChange:a,disabled:n,readOnly:i,size:o,placeholder:"Select ".concat((null==l?void 0:l.name)||"relation"),displayFormat:d,displayOptions:c})},Q=a(89345),ee=e=>{let{value:t,onChange:a,disabled:s,readOnly:n,size:i,displayFormat:o,displayOptions:d}=e;return n?o&&"raw"!==o?(0,r.jsx)(p,{value:t,format:o,options:d}):t?(0,r.jsx)("a",{href:"mailto:".concat(t),className:"text-primary hover:underline",children:t}):(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(Q.Z,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,r.jsx)(l.I,{type:"email",value:t||"",onChange:e=>null==a?void 0:a(e.target.value),disabled:s,className:(0,S.cn)("pl-8",i?({small:"h-8 text-sm pl-8",middle:"h-10 pl-9",large:"h-12 text-lg pl-10"})[i]:""),placeholder:"email@example.com"})]})},et=a(98335),ea=e=>{let{value:t,onChange:a,disabled:s,readOnly:n,size:i,displayFormat:o,displayOptions:d}=e;return n?o&&"raw"!==o?(0,r.jsx)(p,{value:t,format:o,options:d}):t?(0,r.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t}):(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(et.Z,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,r.jsx)(l.I,{type:"url",value:t||"",onChange:e=>null==a?void 0:a(e.target.value),disabled:s,className:(0,S.cn)("pl-8",i?({small:"h-8 text-sm pl-8",middle:"h-10 pl-9",large:"h-12 text-lg pl-10"})[i]:""),placeholder:"https://example.com"})]})},er=a(13041),es=e=>{let{value:t,onChange:a,disabled:s,readOnly:n,size:i,displayFormat:o,displayOptions:d}=e;return n?o&&"raw"!==o?(0,r.jsx)(p,{value:t,format:o,options:d}):t?(0,r.jsx)("a",{href:"tel:".concat(t),className:"text-primary hover:underline",children:t}):(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(er.Z,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,r.jsx)(l.I,{type:"tel",value:t||"",onChange:e=>null==a?void 0:a(e.target.value),disabled:s,className:(0,S.cn)("pl-8",i?({small:"h-8 text-sm pl-8",middle:"h-10 pl-9",large:"h-12 text-lg pl-10"})[i]:""),placeholder:"+1 (555) 123-4567"})]})},el=e=>{let{value:t,onChange:a,disabled:s,readOnly:l,language:n="javascript"}=e;return l?(0,r.jsx)("pre",{className:"rounded bg-muted p-3 font-mono text-xs overflow-auto max-h-48",children:(0,r.jsx)("code",{children:t||""})}):(0,r.jsx)(_.g,{value:t||"",onChange:e=>null==a?void 0:a(e.target.value),disabled:s,className:"font-mono text-sm min-h-[120px]",placeholder:"// Enter ".concat(n," code here")})},en=a(83774),ei=a(83724),eo=e=>{let{value:t,onChange:a,disabled:l,readOnly:n,geometryType:i="Point",fieldName:o="Location"}=e,[d,c]=(0,s.useState)(!1),u=t?JSON.stringify(t,null,2):"",m=()=>{t&&c(!0)};if(n)return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("pre",{className:"rounded bg-muted p-2 text-xs overflow-auto max-h-32 max-w-[250px] whitespace-pre-wrap break-all flex-1",children:u||"-"}),t&&(0,r.jsxs)(j.z,{variant:"ghost",size:"sm",className:"ml-2 h-8 text-xs gap-1",onClick:m,children:[(0,r.jsx)(en.Z,{className:"h-3 w-3"}),"Map"]})]}),(0,r.jsx)(ei.Z,{open:d,onOpenChange:c,value:t,fieldName:o,fieldType:i})]});let h=e=>{if(!e.trim()){null==a||a(null);return}try{let t=JSON.parse(e);null==a||a(t)}catch(e){}},p=s.useMemo(()=>{switch(i){case"Point":return'{"type": "Point", "coordinates": [longitude, latitude]}';case"Polygon":return'{"type": "Polygon", "coordinates": [[[lng1, lat1], [lng2, lat2], ...]]}';case"LineString":return'{"type": "LineString", "coordinates": [[lng1, lat1], [lng2, lat2]]}';default:return'{"type": "'.concat(i,'", "coordinates": [...]}')}},[i]);return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[(0,r.jsx)(_.g,{value:u,onChange:e=>h(e.target.value),disabled:l,className:"font-mono text-sm min-h-[100px] flex-1",placeholder:p}),t&&(0,r.jsxs)(j.z,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs gap-1 shrink-0",onClick:m,children:[(0,r.jsx)(en.Z,{className:"h-3 w-3"}),"Map"]})]}),(0,r.jsx)(ei.Z,{open:d,onOpenChange:c,value:t,fieldName:o,fieldType:i})]})},ed=a(75060),ec=a(68245);let eu=s.memo(e=>{let{value:t,onChange:a,disabled:s,readOnly:n,size:i,rangeType:o="integer"}=e,d=e=>{if(null==e)return"";if("date"===o||"datetime"===o){if(e instanceof Date)return"datetime"===o?e.toLocaleString():e.toLocaleDateString();if("string"==typeof e){let t=new Date(e);return"datetime"===o?t.toLocaleString():t.toLocaleDateString()}}return String(e)};if(n){if(!t)return(0,r.jsx)("span",{className:"text-sm text-muted-foreground",children:"-"});let e=!1!==t.lowerInclusive?"[":"(",a=!1!==t.upperInclusive?"]":")";return(0,r.jsxs)(v.C,{variant:"secondary",className:"font-mono text-xs",children:[e,d(t.lower)," – ",d(t.upper),a]})}let c={small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"},u=()=>{switch(o){case"date":return"date";case"datetime":return"datetime-local";case"time":return"time";default:return"number"}},m=e=>{if(!e)return null;switch(o){case"integer":return parseInt(e,10);case"double":case"decimal":return parseFloat(e);case"date":case"datetime":return new Date(e).toISOString();default:return e}},h=e=>null==e?"":"date"===o&&e?new Date(e).toISOString().split("T")[0]:"datetime"===o&&e?new Date(e).toISOString().slice(0,16):String(e);return(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,r.jsx)(ed._,{className:"text-xs text-muted-foreground",children:"Lower"}),(0,r.jsx)(l.I,{type:u(),value:h(null==t?void 0:t.lower),onChange:e=>{var r,s,l;let n=m(e.target.value);null==a||a({lower:n,upper:null!==(r=null==t?void 0:t.upper)&&void 0!==r?r:null,lowerInclusive:null===(s=null==t?void 0:t.lowerInclusive)||void 0===s||s,upperInclusive:null===(l=null==t?void 0:t.upperInclusive)||void 0===l||l})},disabled:s,className:i?c[i]:"",placeholder:"Lower bound"})]}),(0,r.jsx)("span",{className:"text-muted-foreground pt-5",children:"–"}),(0,r.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,r.jsx)(ed._,{className:"text-xs text-muted-foreground",children:"Upper"}),(0,r.jsx)(l.I,{type:u(),value:h(null==t?void 0:t.upper),onChange:e=>{var r,s,l;let n=m(e.target.value);null==a||a({lower:null!==(r=null==t?void 0:t.lower)&&void 0!==r?r:null,upper:n,lowerInclusive:null===(s=null==t?void 0:t.lowerInclusive)||void 0===s||s,upperInclusive:null===(l=null==t?void 0:t.upperInclusive)||void 0===l||l})},disabled:s,className:i?c[i]:"",placeholder:"Upper bound"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(ec.X,{id:"lowerInclusive",checked:(null==t?void 0:t.lowerInclusive)!==!1,onCheckedChange:e=>{var r,s,l;return null==a?void 0:a({lower:null!==(r=null==t?void 0:t.lower)&&void 0!==r?r:null,upper:null!==(s=null==t?void 0:t.upper)&&void 0!==s?s:null,lowerInclusive:!0===e,upperInclusive:null===(l=null==t?void 0:t.upperInclusive)||void 0===l||l})},disabled:s}),(0,r.jsx)(ed._,{htmlFor:"lowerInclusive",className:"text-xs",children:"Lower inclusive"})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(ec.X,{id:"upperInclusive",checked:(null==t?void 0:t.upperInclusive)!==!1,onCheckedChange:e=>{var r,s,l;return null==a?void 0:a({lower:null!==(r=null==t?void 0:t.lower)&&void 0!==r?r:null,upper:null!==(s=null==t?void 0:t.upper)&&void 0!==s?s:null,lowerInclusive:null===(l=null==t?void 0:t.lowerInclusive)||void 0===l||l,upperInclusive:!0===e})},disabled:s}),(0,r.jsx)(ed._,{htmlFor:"upperInclusive",className:"text-xs",children:"Upper inclusive"})]})]})]})});eu.displayName="RangeField";var em=eu,eh=a(46938),ep=a(78302),ef=a(54816),ex=a(63676),eg=a(65318),ev=a(78234),ey=a(13694),ej=a(24475),eN=a(71190),eb=a(5172),ew=a(75965),eC=a(44353),ek=a(84519),eS=a(29747),eA=a(79022),eO=a(81328),ez=a(19680),e_=a(17494),eI=a(18778),eT=a(64935),eZ=a(12805),eL=a(6387),eR=a(31734),eE=a(58310),eM=a(17881),eP=a(13720),eD=a(7586),eF=a(28645),eU=a(74656),eY=a(21047),eH=a(25330);let eJ=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"],eB=e=>{let{onClick:t,isActive:a,disabled:s,children:l,title:n}=e;return(0,r.jsx)(j.z,{type:"button",variant:"ghost",size:"sm",onClick:t,disabled:s,className:(0,S.cn)("h-8 w-8 p-0",a&&"bg-muted text-foreground"),title:n,children:l})},eV=()=>(0,r.jsx)("div",{className:"w-px h-6 bg-border mx-1"}),eG=e=>{let{editor:t,onSourceToggle:a,isSourceMode:n,onFullscreenToggle:i,isFullscreen:o}=e,[d,c]=(0,s.useState)(""),[u,m]=(0,s.useState)(!1),[h,p]=(0,s.useState)(""),[f,x]=(0,s.useState)(!1),g=(0,s.useCallback)(()=>{t&&(d?t.chain().focus().extendMarkRange("link").setLink({href:d}).run():t.chain().focus().extendMarkRange("link").unsetLink().run(),m(!1),c(""))},[t,d]),v=(0,s.useCallback)(()=>{t&&(h&&t.chain().focus().setImage({src:h}).run(),x(!1),p(""))},[t,h]);return t?(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-0.5 p-1 border-b bg-muted/30",children:[(0,r.jsx)(eB,{onClick:()=>t.chain().focus().undo().run(),disabled:!t.can().undo(),title:"Undo",children:(0,r.jsx)(ew.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().redo().run(),disabled:!t.can().redo(),title:"Redo",children:(0,r.jsx)(eC.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eV,{}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleHeading({level:1}).run(),isActive:t.isActive("heading",{level:1}),title:"Heading 1",children:(0,r.jsx)(ek.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleHeading({level:2}).run(),isActive:t.isActive("heading",{level:2}),title:"Heading 2",children:(0,r.jsx)(eS.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleHeading({level:3}).run(),isActive:t.isActive("heading",{level:3}),title:"Heading 3",children:(0,r.jsx)(eA.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eV,{}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleBold().run(),isActive:t.isActive("bold"),title:"Bold",children:(0,r.jsx)(eO.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleItalic().run(),isActive:t.isActive("italic"),title:"Italic",children:(0,r.jsx)(ez.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleUnderline().run(),isActive:t.isActive("underline"),title:"Underline",children:(0,r.jsx)(e_.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleStrike().run(),isActive:t.isActive("strike"),title:"Strikethrough",children:(0,r.jsx)(eI.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleCode().run(),isActive:t.isActive("code"),title:"Inline Code",children:(0,r.jsx)(eT.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eV,{}),(0,r.jsxs)(b.J2,{children:[(0,r.jsx)(b.xo,{asChild:!0,children:(0,r.jsx)(j.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",title:"Text Color",children:(0,r.jsx)(eZ.Z,{className:"h-4 w-4"})})}),(0,r.jsxs)(b.yk,{className:"w-auto p-2",children:[(0,r.jsx)("div",{className:"grid grid-cols-10 gap-1",children:eJ.map(e=>(0,r.jsx)("button",{className:"w-5 h-5 rounded border border-border hover:scale-110 transition-transform",style:{backgroundColor:e},onClick:()=>t.chain().focus().setColor(e).run()},e))}),(0,r.jsx)(j.z,{variant:"ghost",size:"sm",className:"w-full mt-2",onClick:()=>t.chain().focus().unsetColor().run(),children:"Remove color"})]})]}),(0,r.jsxs)(b.J2,{children:[(0,r.jsx)(b.xo,{asChild:!0,children:(0,r.jsx)(j.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",title:"Highlight",children:(0,r.jsx)(eL.Z,{className:"h-4 w-4"})})}),(0,r.jsxs)(b.yk,{className:"w-auto p-2",children:[(0,r.jsx)("div",{className:"grid grid-cols-10 gap-1",children:eJ.slice(10).map(e=>(0,r.jsx)("button",{className:"w-5 h-5 rounded border border-border hover:scale-110 transition-transform",style:{backgroundColor:e},onClick:()=>t.chain().focus().toggleHighlight({color:e}).run()},e))}),(0,r.jsx)(j.z,{variant:"ghost",size:"sm",className:"w-full mt-2",onClick:()=>t.chain().focus().unsetHighlight().run(),children:"Remove highlight"})]})]}),(0,r.jsx)(eV,{}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().setTextAlign("left").run(),isActive:t.isActive({textAlign:"left"}),title:"Align Left",children:(0,r.jsx)(eR.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().setTextAlign("center").run(),isActive:t.isActive({textAlign:"center"}),title:"Align Center",children:(0,r.jsx)(eE.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().setTextAlign("right").run(),isActive:t.isActive({textAlign:"right"}),title:"Align Right",children:(0,r.jsx)(eM.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().setTextAlign("justify").run(),isActive:t.isActive({textAlign:"justify"}),title:"Justify",children:(0,r.jsx)(eP.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eV,{}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleBulletList().run(),isActive:t.isActive("bulletList"),title:"Bullet List",children:(0,r.jsx)(eD.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleOrderedList().run(),isActive:t.isActive("orderedList"),title:"Ordered List",children:(0,r.jsx)(eF.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleBlockquote().run(),isActive:t.isActive("blockquote"),title:"Blockquote",children:(0,r.jsx)(eU.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().setHorizontalRule().run(),title:"Horizontal Rule",children:(0,r.jsx)(eY.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eV,{}),(0,r.jsxs)(b.J2,{open:u,onOpenChange:m,children:[(0,r.jsx)(b.xo,{asChild:!0,children:(0,r.jsx)(j.z,{variant:"ghost",size:"sm",className:(0,S.cn)("h-8 w-8 p-0",t.isActive("link")&&"bg-muted"),title:"Link",children:(0,r.jsx)(et.Z,{className:"h-4 w-4"})})}),(0,r.jsx)(b.yk,{className:"w-80",children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(ed._,{children:"URL"}),(0,r.jsx)(l.I,{value:d,onChange:e=>c(e.target.value),placeholder:"https://example.com",onKeyDown:e=>"Enter"===e.key&&g()}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)(j.z,{size:"sm",onClick:g,children:[t.isActive("link")?"Update":"Add"," Link"]}),t.isActive("link")&&(0,r.jsx)(j.z,{size:"sm",variant:"outline",onClick:()=>{t.chain().focus().unsetLink().run(),m(!1)},children:"Remove"})]})]})})]}),(0,r.jsxs)(b.J2,{open:f,onOpenChange:x,children:[(0,r.jsx)(b.xo,{asChild:!0,children:(0,r.jsx)(j.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",title:"Image",children:(0,r.jsx)(J.Z,{className:"h-4 w-4"})})}),(0,r.jsx)(b.yk,{className:"w-80",children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(ed._,{children:"Image URL"}),(0,r.jsx)(l.I,{value:h,onChange:e=>p(e.target.value),placeholder:"https://example.com/image.jpg",onKeyDown:e=>"Enter"===e.key&&v()}),(0,r.jsx)(j.z,{size:"sm",onClick:v,children:"Add Image"})]})})]}),(0,r.jsx)("div",{className:"flex-1"}),(0,r.jsx)(eB,{onClick:a,isActive:n,title:"Source Code",children:(0,r.jsx)(eH.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:i,title:o?"Exit Fullscreen":"Fullscreen",children:o?(0,r.jsx)(T.Z,{className:"h-4 w-4"}):(0,r.jsx)(I.Z,{className:"h-4 w-4"})})]}):null};var eW=e=>{let{value:t,onChange:a,disabled:l,readOnly:n,placeholder:i="Enter content...",className:o,minHeight:d=300}=e,[c,u]=(0,s.useState)(!1),[m,h]=(0,s.useState)(t||""),[p,f]=(0,s.useState)(!1),[x,g]=(0,s.useState)(!1),v=(0,eh.jE)({immediatelyRender:!1,extensions:[ep.Z.configure({heading:{levels:[1,2,3,4,5,6]}}),ef.ZP.configure({openOnClick:!1,HTMLAttributes:{rel:"noopener noreferrer"}}),ex.ZP.configure({HTMLAttributes:{style:"max-width: 100%; height: auto;"}}),eg.Z.configure({types:["heading","paragraph"]}),ev.Z,ey.pn,ej.Z,eN.ZP.configure({multicolor:!0}),eb.Z.configure({placeholder:i})],content:t||"",editable:!l&&!n,onUpdate:e=>{let{editor:t}=e,r=t.getHTML();null==a||a(r)}});(0,s.useEffect)(()=>{v&&t!==v.getHTML()&&!c&&v.commands.setContent(t||"")},[t,v,c]),(0,s.useEffect)(()=>{c&&h(t||"")},[c,t]),(0,s.useEffect)(()=>{g(!0)},[]),(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&p&&f(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p]);let y=()=>{null==a||a(m),null==v||v.commands.setContent(m),u(!1)};return n?(0,r.jsx)("div",{className:(0,S.cn)("prose prose-sm dark:prose-invert max-w-none","border rounded-md p-3 bg-muted/30","overflow-auto",o),style:{minHeight:d/2},dangerouslySetInnerHTML:{__html:t||"<em>No content</em>"}}):x?(0,r.jsxs)("div",{className:(0,S.cn)("html-field border rounded-md overflow-hidden flex flex-col bg-background",p&&"fixed inset-0 z-50 rounded-none",o),style:{height:p?"100vh":d},children:[(0,r.jsx)(eG,{editor:v,onSourceToggle:()=>{c?y():(h((null==v?void 0:v.getHTML())||""),u(!0))},isSourceMode:c,onFullscreenToggle:()=>f(!p),isFullscreen:p}),c?(0,r.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,r.jsx)(_.g,{value:m,onChange:e=>{h(e.target.value)},className:"flex-1 font-mono text-sm resize-none rounded-none border-0 focus-visible:ring-0",placeholder:"Enter HTML source code..."}),(0,r.jsxs)("div",{className:"flex justify-end gap-2 p-2 border-t bg-muted/30",children:[(0,r.jsx)(j.z,{variant:"outline",size:"sm",onClick:()=>u(!1),children:"Cancel"}),(0,r.jsx)(j.z,{size:"sm",onClick:y,children:"Apply"})]})]}):(0,r.jsx)(eh.kg,{editor:v,className:(0,S.cn)("flex-1 overflow-auto","[&_.tiptap]:outline-none [&_.tiptap]:p-3 [&_.tiptap]:min-h-full","[&_.tiptap_p.is-editor-empty:first-child::before]:text-muted-foreground","[&_.tiptap_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.tiptap_p.is-editor-empty:first-child::before]:float-left","[&_.tiptap_p.is-editor-empty:first-child::before]:h-0","[&_.tiptap_p.is-editor-empty:first-child::before]:pointer-events-none")})]}):(0,r.jsx)("div",{className:(0,S.cn)("animate-pulse bg-muted rounded border",o),style:{height:d}})};let eq=s.memo(e=>{let{field:t,value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o,displayFormat:d,displayOptions:c}=e,u=d||t.displayFormat,m=c||t.displayOptions;if(t.relType)return(0,r.jsx)(X,{value:a,onChange:s,field:t,disabled:l,readOnly:n,size:i,displayFormat:u,displayOptions:m});switch(t.type){case"UUID":return(0,r.jsx)(G,{value:a,onChange:s,disabled:l,readOnly:n,size:i});case"String":case"VARCHAR":case"CHAR":return(0,r.jsx)(f,{value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o,maxLength:t.maxLength,showCount:!!t.maxLength,displayFormat:u,displayOptions:m});case"Text":case"LONGTEXT":case"MEDIUMTEXT":return(0,r.jsx)(R,{value:a,onChange:s,disabled:l,readOnly:n,placeholder:o,autoSize:{minRows:3,maxRows:8}});case"HTML":return(0,r.jsx)(eW,{value:a,onChange:s,disabled:l,readOnly:n,placeholder:o});case"Number":case"INTEGER":case"INT":case"BIGINT":case"SMALLINT":case"TINYINT":return(0,r.jsx)(x,{value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o,precision:0});case"Float":case"DOUBLE":case"REAL":return(0,r.jsx)(x,{value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o,step:.1});case"Decimal":case"NUMERIC":return(0,r.jsx)(x,{value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o,precision:t.scale,step:t.scale?Math.pow(10,-t.scale):.01});case"Boolean":case"BOOLEAN":return(0,r.jsx)(y,{value:a,onChange:s,disabled:l,readOnly:n,size:"small"===i?"small":"default"});case"Date":return(0,r.jsx)(A,{value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o,displayFormat:u,displayOptions:m});case"DateTime":case"DateTime_NO_TZ":case"DATETIME":case"TIMESTAMP":return(0,r.jsx)(O,{value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o,displayFormat:u,displayOptions:m});case"Time":case"Time_NO_TZ":return(0,r.jsx)(z,{value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o});case"JSON":case"JSONB":return(0,r.jsx)(L,{value:a,onChange:s,disabled:l,readOnly:n,placeholder:o});case"ENUM":case"Enum":return(0,r.jsx)(F,{value:a,onChange:s,options:t.values||[],disabled:l,readOnly:n,size:i,placeholder:o,allowNull:t.allowNull});case"File":return(0,r.jsx)(H,{value:a,onChange:s,disabled:l,readOnly:n});case"Image":return(0,r.jsx)(B,{value:a,onChange:s,disabled:l,readOnly:n});case"Color":return(0,r.jsx)(V,{value:a,onChange:s,disabled:l,readOnly:n});case"Array_String":return(0,r.jsx)(q,{value:a,onChange:s,itemType:"string",disabled:l,readOnly:n,size:i,placeholder:o||"Enter string values"});case"Array_Integer":case"Array_Number":case"Array_Double":case"Array_Decimal":return(0,r.jsx)(q,{value:a,onChange:s,itemType:"number",disabled:l,readOnly:n,size:i,placeholder:o||"Enter number values"});case"Array_UUID":return(0,r.jsx)(q,{value:a,onChange:s,itemType:"string",disabled:l,readOnly:n,size:i,placeholder:o||"Enter UUID values"});case"Array_Boolean":return(0,r.jsx)(q,{value:a,onChange:s,itemType:"boolean",disabled:l,readOnly:n,size:i,placeholder:o||"Enter true or false"});case"Array_Date":return(0,r.jsx)(q,{value:a,onChange:s,itemType:"date",disabled:l,readOnly:n,size:i,placeholder:o||"Select dates"});case"Array_DateTime":case"Array_DateTime_NO_TZ":return(0,r.jsx)(q,{value:a,onChange:s,itemType:"datetime",disabled:l,readOnly:n,size:i,placeholder:o||"Select date and time"});case"Array_Time":case"Array_Time_NO_TZ":return(0,r.jsx)(q,{value:a,onChange:s,itemType:"time",disabled:l,readOnly:n,size:i,placeholder:o||"Select times"});case"Email":return(0,r.jsx)(ee,{value:a,onChange:s,disabled:l,readOnly:n,size:i,displayFormat:u,displayOptions:m});case"URL":return(0,r.jsx)(ea,{value:a,onChange:s,disabled:l,readOnly:n,size:i,displayFormat:u,displayOptions:m});case"Phone":return(0,r.jsx)(es,{value:a,onChange:s,disabled:l,readOnly:n,size:i,displayFormat:u,displayOptions:m});case"Code":return(0,r.jsx)(el,{value:a,onChange:s,disabled:l,readOnly:n,language:t.language||"javascript"});case"Point":case"Polygon":case"LineString":case"MultiPoint":case"MultiPolygon":case"MultiLineString":case"GeometryCollection":return(0,r.jsx)(eo,{value:a,onChange:s,disabled:l,readOnly:n,geometryType:t.type});case"Range_Integer":return(0,r.jsx)(em,{value:a,onChange:s,disabled:l,readOnly:n,size:i,rangeType:"integer"});case"Range_Double":return(0,r.jsx)(em,{value:a,onChange:s,disabled:l,readOnly:n,size:i,rangeType:"double"});case"Range_Decimal":return(0,r.jsx)(em,{value:a,onChange:s,disabled:l,readOnly:n,size:i,rangeType:"decimal"});case"Range_Date":return(0,r.jsx)(em,{value:a,onChange:s,disabled:l,readOnly:n,size:i,rangeType:"date"});case"Range_DateTime":case"Range_DateTime_NO_TZ":return(0,r.jsx)(em,{value:a,onChange:s,disabled:l,readOnly:n,size:i,rangeType:"datetime"});case"Range_Time":case"Range_Time_NO_TZ":return(0,r.jsx)(em,{value:a,onChange:s,disabled:l,readOnly:n,size:i,rangeType:"time"});default:return(0,r.jsx)(f,{value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o,displayFormat:u,displayOptions:m})}});eq.displayName="FieldRenderer";var eK=eq},95937:function(e,t,a){a.d(t,{Cd:function(){return d},X:function(){return c},bZ:function(){return o}});var r=a(57437),s=a(2265),l=a(90535),n=a(93448);let i=(0,l.j)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),o=s.forwardRef((e,t)=>{let{className:a,variant:s,...l}=e;return(0,r.jsx)("div",{ref:t,role:"alert",className:(0,n.cn)(i({variant:s}),a),...l})});o.displayName="Alert";let d=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("h5",{ref:t,className:(0,n.cn)("mb-1 font-medium leading-none tracking-tight",a),...s})});d.displayName="AlertTitle";let c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("text-sm [&_p]:leading-relaxed",a),...s})});c.displayName="AlertDescription"},46291:function(e,t,a){a.d(t,{f:function(){return d}});var r=a(57437);a(2265);var s=a(92451),l=a(10407),n=a(61013),i=a(93448),o=a(12381);function d(e){let{className:t,classNames:a,showOutsideDays:d=!0,...c}=e;return(0,r.jsx)(n._W,{showOutsideDays:d,className:(0,i.cn)("p-3",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:(0,i.cn)((0,o.d)({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:(0,i.cn)("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md","range"===c.mode?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:(0,i.cn)((0,o.d)({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...a},components:{IconLeft:()=>(0,r.jsx)(s.Z,{className:"h-4 w-4"}),IconRight:()=>(0,r.jsx)(l.Z,{className:"h-4 w-4"})},...c})}d.displayName="Calendar"},68245:function(e,t,a){a.d(t,{X:function(){return o}});var r=a(57437),s=a(2265),l=a(9270),n=a(30401),i=a(93448);let o=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.fC,{ref:t,className:(0,i.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",a),...s,children:(0,r.jsx)(l.z$,{className:(0,i.cn)("flex items-center justify-center text-current"),children:(0,r.jsx)(n.Z,{className:"h-4 w-4"})})})});o.displayName=l.fC.displayName},2596:function(e,t,a){a.d(t,{di:function(){return p},e8:function(){return c},fu:function(){return m},mY:function(){return o},rb:function(){return u},sZ:function(){return d},zz:function(){return h}});var r=a(57437),s=a(2265),l=a(46343),n=a(73247),i=a(93448);a(74291);let o=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.mY,{ref:t,className:(0,i.cn)("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",a),...s})});o.displayName=l.mY.displayName;let d=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,r.jsx)(n.Z,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,r.jsx)(l.mY.Input,{ref:t,className:(0,i.cn)("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",a),...s})]})});d.displayName=l.mY.Input.displayName;let c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.mY.List,{ref:t,className:(0,i.cn)("max-h-[300px] overflow-y-auto overflow-x-hidden",a),...s})});c.displayName=l.mY.List.displayName;let u=s.forwardRef((e,t)=>(0,r.jsx)(l.mY.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));u.displayName=l.mY.Empty.displayName;let m=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.mY.Group,{ref:t,className:(0,i.cn)("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",a),...s})});m.displayName=l.mY.Group.displayName;let h=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.mY.Separator,{ref:t,className:(0,i.cn)("-mx-1 h-px bg-border",a),...s})});h.displayName=l.mY.Separator.displayName;let p=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.mY.Item,{ref:t,className:(0,i.cn)("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a),...s})});p.displayName=l.mY.Item.displayName},75060:function(e,t,a){a.d(t,{_:function(){return d}});var r=a(57437),s=a(2265),l=a(370),n=a(90535),i=a(93448);let o=(0,n.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.f,{ref:t,className:(0,i.cn)(o(),a),...s})});d.displayName=l.f.displayName},83724:function(e,t,a){var r=a(57437),s=a(2265),l=a(74291),n=a(12381),i=a(83774),o=a(78406),d=a(50417),c=a(51817),u=a(3609);let m=null,h=e=>{try{let t=e.replace(/^SRID=\d+;/i,"").trim().match(/^(\w+)\s*\((.+)\)$/i);if(!t)return null;let[,a,r]=t,s=a.toUpperCase();if("POINT"===s){let e=r.trim().split(/\s+/).map(Number);if(e.length>=2&&!e.some(isNaN))return{type:"Point",coordinates:e.slice(0,2)}}if("LINESTRING"===s){let e=r.split(",").map(e=>e.trim().split(/\s+/).map(Number).slice(0,2));if(e.every(e=>2===e.length&&!e.some(isNaN)))return{type:"LineString",coordinates:e}}if("POLYGON"===s){let e=[],t=r.match(/\(([^()]+)\)/g);if(t)for(let a of t){let t=a.replace(/[()]/g,"").split(",").map(e=>e.trim().split(/\s+/).map(Number).slice(0,2));t.every(e=>2===e.length&&!e.some(isNaN))&&e.push(t)}if(e.length>0)return{type:"Polygon",coordinates:e}}if("MULTIPOINT"===s){let e=[],t=r.match(/\(([^()]+)\)/g);if(t)for(let a of t){let t=a.replace(/[()]/g,"").trim().split(/\s+/).map(Number);t.length>=2&&!t.some(isNaN)&&e.push(t.slice(0,2))}else{let t=r.split(",").map(e=>e.trim().split(/\s+/).map(Number).slice(0,2));e.push(...t.filter(e=>2===e.length&&!e.some(isNaN)))}if(e.length>0)return{type:"MultiPoint",coordinates:e}}if("MULTILINESTRING"===s){let e=[],t=r.match(/\(([^()]+)\)/g);if(t)for(let a of t){let t=a.replace(/[()]/g,"").split(",").map(e=>e.trim().split(/\s+/).map(Number).slice(0,2));t.every(e=>2===e.length&&!e.some(isNaN))&&e.push(t)}if(e.length>0)return{type:"MultiLineString",coordinates:e}}if("MULTIPOLYGON"===s){let e=[];for(let t of r.split(/\)\s*,\s*\(/)){let a=[],r=t.replace(/^\(+|\)+$/g,"").match(/\(([^()]+)\)|[^,()]+(?:,[^,()]+)*/g);if(r)for(let e of r){let t=e.replace(/[()]/g,"").split(",").map(e=>e.trim().split(/\s+/).map(Number).slice(0,2)).filter(e=>2===e.length&&!e.some(isNaN));t.length>0&&a.push(t)}a.length>0&&e.push(a)}if(e.length>0)return{type:"MultiPolygon",coordinates:e}}return null}catch(e){return console.error("Error parsing WKT:",e),null}},p=(e,t)=>{if(!e)return null;if(e&&"object"==typeof e&&e.type&&e.coordinates)return e;if("string"==typeof e){if(e.trim().startsWith("{"))try{let t=JSON.parse(e);if(t.type&&t.coordinates)return t}catch(e){}if(/^(SRID=\d+;)?(POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON)/i.test(e))return h(e);if(/^[0-9A-Fa-f]+$/.test(e))return console.warn("Received WKB hex format - cannot parse client-side. API should return GeoJSON."),null}if("object"==typeof e&&"x"in e&&"y"in e)return{type:"Point",coordinates:[e.x,e.y]};if(Array.isArray(e)){if(2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1])return{type:t||"Point",coordinates:e};if(Array.isArray(e[0])&&"number"==typeof e[0][0]){let a=t||"LineString";return"Polygon"===a?{type:"Polygon",coordinates:[e]}:{type:a,coordinates:e}}if(Array.isArray(e[0])&&Array.isArray(e[0][0]))return{type:t||"Polygon",coordinates:e}}return null};t.Z=e=>{let{open:t,onOpenChange:h,value:f,fieldName:x="Location",fieldType:g}=e,v=(0,s.useRef)(null),y=(0,s.useRef)(null),j=(0,s.useRef)(null),[N,b]=(0,s.useState)(!0),w=(0,s.useMemo)(()=>p(f,g),[f,g]),{icon:C,title:k}=(0,s.useMemo)(()=>{let e=(null==w?void 0:w.type)||g,t=(0,r.jsx)(i.Z,{className:"h-4 w-4"});switch(e){case"Point":case"MultiPoint":t=(0,r.jsx)(i.Z,{className:"h-4 w-4"});break;case"LineString":case"MultiLineString":t=(0,r.jsx)(o.Z,{className:"h-4 w-4"});break;case"Polygon":case"MultiPolygon":t=(0,r.jsx)(d.Z,{className:"h-4 w-4"})}return{icon:t,title:"".concat(x," (").concat(e||"Geometry",")")}},[w,x,g]);(0,s.useEffect)(()=>{if(!t)return;let e=!0;return b(!0),(async()=>{try{if(await new Promise(e=>requestAnimationFrame(e)),!e||!v.current){b(!1);return}if(!document.querySelector('link[href*="leaflet.css"]')){let e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",document.head.appendChild(e),await new Promise(t=>{e.onload=()=>t(),e.onerror=()=>t(),setTimeout(t,1e3)})}if(m||(m=await a.e(4212).then(a.t.bind(a,60759,23)),delete m.Icon.Default.prototype._getIconUrl,m.Icon.Default.mergeOptions({iconRetinaUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-icon-2x.png",iconUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-icon.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-shadow.png"})),!e||!v.current){b(!1);return}let t=m;y.current&&(y.current.remove(),y.current=null);let r=t.map(v.current,{zoomControl:!0,scrollWheelZoom:!0});if(y.current=r,t.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',maxZoom:19}).addTo(r),w){let e=t.geoJSON({type:"Feature",geometry:w,properties:{}},{style:{color:"#3b82f6",weight:3,opacity:.8,fillColor:"#3b82f6",fillOpacity:.3},pointToLayer:(e,a)=>t.circleMarker(a,{radius:10,fillColor:"#3b82f6",color:"#1e40af",weight:2,opacity:1,fillOpacity:.8})}).addTo(r).getBounds();e.isValid()?(j.current=e,r.fitBounds(e,{padding:[50,50],maxZoom:16})):(j.current=null,r.setView([0,0],2))}else j.current=null,r.setView([0,0],2);requestAnimationFrame(()=>{y.current&&e&&y.current.invalidateSize(),b(!1)})}catch(e){console.error("Error initializing map:",e),b(!1)}})(),()=>{e=!1,y.current&&(y.current.remove(),y.current=null)}},[t,w]);let S=(0,s.useMemo)(()=>{if(!w)return"";let e=w.coordinates;if(!e)return"";try{switch(w.type){case"Point":return"[".concat(Number(e[0]).toFixed(6),", ").concat(Number(e[1]).toFixed(6),"]");case"LineString":case"MultiPoint":return"".concat(e.length," points");case"Polygon":var t;let a=e.length,r=(null===(t=e[0])||void 0===t?void 0:t.length)||0;return a>1?"".concat(r," points, ").concat(a-1," hole(s)"):"".concat(r," points");case"MultiLineString":return"".concat(e.length," lines");case"MultiPolygon":return"".concat(e.length," polygons");default:return""}}catch(e){return""}},[w]);return(0,r.jsx)(l.Vq,{open:t,onOpenChange:h,children:(0,r.jsxs)(l.cZ,{className:"max-w-3xl max-h-[85vh]",children:[(0,r.jsx)(l.fK,{children:(0,r.jsxs)(l.$N,{className:"flex items-center gap-2",children:[C,k]})}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"relative",children:[N&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-muted rounded-md z-10",children:(0,r.jsx)(c.Z,{className:"h-8 w-8 animate-spin text-muted-foreground"})}),(0,r.jsx)("div",{ref:v,className:"w-full h-[400px] rounded-md border overflow-hidden bg-muted",style:{minHeight:"400px"}}),!N&&(0,r.jsx)(n.z,{variant:"secondary",size:"icon",className:"absolute top-2 right-2 z-[1000] shadow-md",onClick:()=>{y.current&&(j.current?y.current.fitBounds(j.current,{padding:[50,50],maxZoom:16}):y.current.setView([0,0],2))},title:"Reset to initial view",children:(0,r.jsx)(u.Z,{className:"h-4 w-4"})})]}),S&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,r.jsx)("span",{className:"font-medium",children:"Details:"}),(0,r.jsx)("span",{children:S})]}),(0,r.jsxs)("details",{className:"text-sm",children:[(0,r.jsx)("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"View raw GeoJSON"}),(0,r.jsx)("pre",{className:"mt-2 p-3 bg-muted rounded-md overflow-auto max-h-[200px] text-xs",children:JSON.stringify(w||f,null,2)})]})]})]})})}},12749:function(e,t,a){a.d(t,{J2:function(){return i},xo:function(){return o},yk:function(){return d}});var r=a(57437),s=a(2265),l=a(51777),n=a(93448);let i=l.fC,o=l.xz;l.ee;let d=s.forwardRef((e,t)=>{let{className:a,align:s="center",sideOffset:i=4,...o}=e;return(0,r.jsx)(l.h_,{children:(0,r.jsx)(l.VY,{ref:t,align:s,sideOffset:i,className:(0,n.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...o})})});d.displayName=l.VY.displayName},15291:function(e,t,a){a.d(t,{Bw:function(){return x},DI:function(){return u},Ph:function(){return c},Ql:function(){return v},i4:function(){return h},ki:function(){return m},n5:function(){return g}});var r=a(57437),s=a(2265),l=a(74797),n=a(40875),i=a(22135),o=a(30401),d=a(93448);let c=l.fC,u=l.ZA,m=l.B4,h=s.forwardRef((e,t)=>{let{className:a,children:s,...i}=e;return(0,r.jsxs)(l.xz,{ref:t,className:(0,d.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...i,children:[s,(0,r.jsx)(l.JO,{asChild:!0,children:(0,r.jsx)(n.Z,{className:"h-4 w-4 opacity-50"})})]})});h.displayName=l.xz.displayName;let p=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.u_,{ref:t,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",a),...s,children:(0,r.jsx)(i.Z,{className:"h-4 w-4"})})});p.displayName=l.u_.displayName;let f=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.$G,{ref:t,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",a),...s,children:(0,r.jsx)(n.Z,{className:"h-4 w-4"})})});f.displayName=l.$G.displayName;let x=s.forwardRef((e,t)=>{let{className:a,children:s,position:n="popper",...i}=e;return(0,r.jsx)(l.h_,{children:(0,r.jsxs)(l.VY,{ref:t,className:(0,d.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:n,...i,children:[(0,r.jsx)(p,{}),(0,r.jsx)(l.l_,{className:(0,d.cn)("p-1 max-h-[300px] overflow-y-auto","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),style:{overscrollBehavior:"contain",touchAction:"pan-y",WebkitOverflowScrolling:"touch",willChange:"scroll-position",pointerEvents:"auto"},children:s}),(0,r.jsx)(f,{})]})})});x.displayName=l.VY.displayName;let g=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.__,{ref:t,className:(0,d.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...s})});g.displayName=l.__.displayName;let v=s.forwardRef((e,t)=>{let{className:a,children:s,...n}=e;return(0,r.jsxs)(l.ck,{ref:t,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...n,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(l.wU,{children:(0,r.jsx)(o.Z,{className:"h-4 w-4"})})}),(0,r.jsx)(l.eT,{children:s})]})});v.displayName=l.ck.displayName,s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.Z0,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",a),...s})}).displayName=l.Z0.displayName},91032:function(e,t,a){a.d(t,{Ei:function(){return v},FF:function(){return x},Tu:function(){return f},bC:function(){return g},sw:function(){return c},ue:function(){return p},yo:function(){return d}});var r=a(57437),s=a(2265),l=a(70001),n=a(90535),i=a(32489),o=a(93448);let d=l.fC;l.xz;let c=l.x8,u=l.h_,m=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.aV,{className:(0,o.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...s,ref:t})});m.displayName=l.aV.displayName;let h=(0,n.j)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out overflow-hidden",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-full sm:w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-full sm:w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right"}},defaultVariants:{side:"right"}}),p=s.forwardRef((e,t)=>{let{side:a="right",className:s,children:n,hideDefaultClose:d=!1,...c}=e;return(0,r.jsxs)(u,{children:[(0,r.jsx)(m,{}),(0,r.jsxs)(l.VY,{ref:t,className:(0,o.cn)(h({side:a}),s),...c,children:[!d&&(0,r.jsxs)(l.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,r.jsx)(i.Z,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]}),n]})]})});p.displayName=l.VY.displayName;let f=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...a})};f.displayName="SheetHeader";let x=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,o.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};x.displayName="SheetFooter";let g=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.Dx,{ref:t,className:(0,o.cn)("text-lg font-semibold text-foreground",a),...s})});g.displayName=l.Dx.displayName;let v=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.dk,{ref:t,className:(0,o.cn)("text-sm text-muted-foreground",a),...s})});v.displayName=l.dk.displayName},94589:function(e,t,a){a.d(t,{r:function(){return i}});var r=a(57437),s=a(2265),l=a(50721),n=a(93448);let i=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.fC,{className:(0,n.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",a),...s,ref:t,children:(0,r.jsx)(l.bU,{className:(0,n.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});i.displayName=l.fC.displayName},23675:function(e,t,a){a.d(t,{g:function(){return n}});var r=a(57437),s=a(2265),l=a(93448);let n=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("textarea",{className:(0,l.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...s})});n.displayName="Textarea"},71488:function(e,t,a){a.d(t,{_v:function(){return c},aJ:function(){return d},pn:function(){return i},u:function(){return o}});var r=a(57437),s=a(2265),l=a(91668),n=a(93448);let i=l.zt,o=l.fC,d=l.xz,c=s.forwardRef((e,t)=>{let{className:a,sideOffset:s=4,...i}=e;return(0,r.jsx)(l.VY,{ref:t,sideOffset:s,className:(0,n.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...i})});c.displayName=l.VY.displayName},29696:function(e,t,a){a.d(t,{A1:function(){return o},I_:function(){return i}});var r=a(57437),s=a(2265),l=a(72135);let n=(0,s.createContext)(void 0),i=()=>{let e=(0,s.useContext)(n);if(!e)throw Error("useSchema must be used within a SchemaProvider");return e};function o(e){let{children:t}=e,{data:a,isLoading:s,refetch:i}=(0,l.sm)({resource:"collections",queryOptions:{enabled:!0},sorters:[{field:"collectionName",order:"asc"}],pagination:{pageSize:500}}),o=(null==a?void 0:a.data)||[],d=e=>o.find(t=>t.collectionName===e),c=e=>{let t=d(e),a=null==t?void 0:t.schema.fields;if(a){let t={...a};for(let[e,a]of Object.entries(t))a.hidden&&delete t[e];return"baasix_Account"===e&&(delete t.password,delete t.accessToken,delete t.refreshToken,delete t.idToken),"baasix_Verification"===e&&delete t.value,"baasix_Sessions"===e&&delete t.token,t}return a},u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(0===a)return[];let s=c(e);return s?Object.entries(s).map(e=>{let[s,l]=e,n=t?"".concat(t,".").concat(s):s,i=r?{title:l.relType?n+".*":n,value:l.relType?n+".*":n,key:l.relType?n+".*":n,isLeaf:!l.relType}:{title:n,value:n,key:n,isLeaf:!l.relType};return l.relType&&l.target&&(i.children=u(l.target,n,a-1,r)),i}):[]};return(0,r.jsx)(n.Provider,{value:{schemas:o,isLoading:s,refetch:i,getSchemaByName:d,getFieldsByCollection:c,getCollectionChoices:()=>o.map(e=>({label:e.schema.name,value:e.collectionName})),getTargetFields:e=>{let t=c(e);return t?Object.entries(t).map(e=>{let[t]=e;return{label:t,value:t}}):[]},formatRelationshipDisplay:(e,t)=>e&&t?null==t?void 0:t.split(",").map(t=>{let a=t.trim();return e[a]||a}).join(""):"",getNestedFields:e=>u(e),getPermissionFields:e=>[{title:"*",value:"*",key:"*",isLeaf:!0},...u(e,"",6,!0),{title:"*.*",value:"*.*",key:"*.*",isLeaf:!0},{title:"*.*.*",value:"*.*.*",key:"*.*.*",isLeaf:!0},{title:"*.*.*.*",value:"*.*.*.*",key:"*.*.*.*",isLeaf:!0}],isSortEnabled:e=>{var t;let a=d(e);return(null==a?void 0:null===(t=a.schema)||void 0===t?void 0:t.sortEnabled)===!0}},children:t})}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1407],{79622:function(e,t,a){a.d(t,{OF:function(){return q},o_:function(){return F},Zl:function(){return eK},XG:function(){return eo},mq:function(){return L},sU:function(){return em}});var r=a(57437),s=a(2265),l=a(40279),n=a(71096),i=a.n(n),o=a(45721),c=a.n(o),d=a(13257),u=a.n(d);i().extend(c()),i().extend(u());let m=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null==e)return"";if(Array.isArray(e)){if("count"===t)return e.length.toString();if("list"===t){let t=a.separator||", ",r=a.limit,s=(r?e.slice(0,r):e).map(e=>"object"==typeof e&&null!==e?e.name||e.title||e.label||e.id||JSON.stringify(e):String(e)).join(t),l=r&&e.length>r?e.length-r:0;return l>0?"".concat(s," (+").concat(l," more)"):s}return"".concat(e.length," item").concat(1!==e.length?"s":"")}switch(t){case"raw":case"badge":case"color":case"image":case"file":default:return String(e);case"email":case"url":case"phone":return e;case"truncate":let r=String(e),s=a.maxLength||50;return r.length>s?"".concat(r.substring(0,s),"..."):r;case"uppercase":return String(e).toUpperCase();case"lowercase":return String(e).toLowerCase();case"capitalize":return String(e).charAt(0).toUpperCase()+String(e).slice(1).toLowerCase();case"currency":let l=a.currency||"USD";return new Intl.NumberFormat("en-US",{style:"currency",currency:l,minimumFractionDigits:a.decimals||2,maximumFractionDigits:a.decimals||2}).format(Number(e));case"percentage":return"".concat((100*Number(e)).toFixed(a.decimals||1),"%");case"decimal":return Number(e).toFixed(a.decimals||2);case"integer":return Math.round(Number(e)).toString();case"filesize":return h(Number(e));case"date":return i()(e).format(a.format||"YYYY-MM-DD");case"datetime":let n=a.format||(a.use24Hour?"YYYY-MM-DD HH:mm":"YYYY-MM-DD h:mm A");return i()(e).format(a.showSeconds?n+":ss":n);case"time":let o=a.use24Hour?"HH:mm":"h:mm A";return i()(e).format(a.showSeconds?o+":ss":o);case"relative":return i()(e).fromNow();case"age":let c=i()().diff(i()(e),"years");return"".concat(c," year").concat(1!==c?"s":"");case"duration":let d=i().duration(Number(e),"milliseconds");if(d.asHours()>=1)return"".concat(Math.floor(d.asHours()),"h ").concat(d.minutes(),"m");if(d.asMinutes()>=1)return"".concat(Math.floor(d.asMinutes()),"m ").concat(d.seconds(),"s");return"".concat(d.seconds(),"s");case"iso":return i()(e).toISOString();case"timestamp":return i()(e).unix().toString();case"boolean":case"check":return e?"✓":"✗";case"yesno":return e?a.trueText||"Yes":a.falseText||"No";case"truefalse":return e?a.trueText||"True":a.falseText||"False";case"list":if(!Array.isArray(e))return String(e);let u=a.separator||", ",m=a.limit,f=(m?e.slice(0,m):e).join(u);return m&&e.length>m?"".concat(f,"... (+").concat(e.length-m," more)"):f;case"count":return Array.isArray(e)?e.length.toString():"0";case"json":return JSON.stringify(e,null,2)}},h=e=>{if(0===e)return"0 Bytes";let t=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,t)).toFixed(2))," ").concat(["Bytes","KB","MB","GB","TB"][t])};var f=e=>{let{value:t,format:a,options:s}=e,l=m(t,a,s);switch(a){case"email":return(0,r.jsx)("a",{href:"mailto:".concat(t),className:"text-primary hover:underline",children:l});case"url":return(0,r.jsx)("a",{href:t,target:(null==s?void 0:s.target)||"_blank",rel:(null==s?void 0:s.rel)||"noopener noreferrer",className:"text-primary hover:underline",children:l});case"phone":return(0,r.jsx)("a",{href:"tel:".concat(t),className:"text-primary hover:underline",children:l});case"color":return(0,r.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,r.jsx)("span",{className:"h-4 w-4 rounded border border-border",style:{backgroundColor:t}}),(0,r.jsx)("span",{children:t})]});case"check":return(0,r.jsx)("span",{className:t?"text-green-600":"text-red-600",children:l});case"badge":return(0,r.jsx)("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:l});default:return(0,r.jsx)("span",{children:l})}};let p=s.memo(e=>{let{value:t,onChange:a,placeholder:s,disabled:n,readOnly:i,maxLength:o,showCount:c,size:d,displayFormat:u,displayOptions:m}=e;return i?u&&"raw"!==u?(0,r.jsx)(f,{value:t,format:u,options:m}):(0,r.jsx)("span",{className:"text-sm",children:t||""}):(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(l.I,{value:t||"",onChange:e=>null==a?void 0:a(e.target.value),placeholder:s,disabled:n,maxLength:o,className:d?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[d]:""}),c&&o&&(0,r.jsxs)("span",{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-muted-foreground",children:[(null==t?void 0:t.length)||0,"/",o]})]})});p.displayName="TextField";let x=s.memo(e=>{let{value:t,onChange:a,placeholder:s,disabled:n,readOnly:i,size:o,min:c,max:d,step:u,precision:m}=e;if(i){let e=(null==t?void 0:t.toString())||"";return void 0!==m&&null!=t&&(e=t.toFixed(m)),(0,r.jsx)("span",{className:"text-sm",children:e})}return(0,r.jsx)(l.I,{type:"number",value:null!=t?t:"",onChange:e=>{let t=e.target.value;if(""===t)null==a||a(null);else{let e=parseFloat(t);isNaN(e)||(void 0!==m?null==a||a(parseFloat(e.toFixed(m))):null==a||a(e))}},placeholder:s,disabled:n,min:c,max:d,step:u,className:o?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[o]:""})});x.displayName="NumberField";var g=a(94589),v=a(69174),y=e=>{let{value:t,onChange:a,disabled:s,size:l,readOnly:n}=e;return n?(0,r.jsx)(v.C,{variant:t?"default":"destructive",children:t?"Yes":"No"}):(0,r.jsx)(g.r,{checked:t||!1,onCheckedChange:a,disabled:s,className:"small"===l?"h-4 w-7":""})},j=a(12381),N=a(46291),b=a(12749),w=a(31047),C=a(60936),k=a(27107),S=a(93448),A=e=>{let{value:t,onChange:a,placeholder:s,disabled:l,readOnly:n,size:i,displayFormat:o,displayOptions:c}=e,d=t?"string"==typeof t?(0,C.D)(t):t:void 0;return n?d&&o&&"raw"!==o?(0,r.jsx)(f,{value:d,format:o,options:c}):(0,r.jsx)("span",{className:"text-sm",children:d?(0,k.WU)(d,"PPP"):""}):(0,r.jsxs)(b.J2,{children:[(0,r.jsx)(b.xo,{asChild:!0,children:(0,r.jsxs)(j.z,{variant:"outline",disabled:l,className:(0,S.cn)("w-full justify-start text-left font-normal",!d&&"text-muted-foreground",i?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[i]:""),children:[(0,r.jsx)(w.Z,{className:"mr-2 h-4 w-4"}),d?(0,k.WU)(d,"PPP"):s||"Pick a date"]})}),(0,r.jsx)(b.yk,{className:"w-auto p-0",align:"start",children:(0,r.jsx)(N.f,{mode:"single",selected:d,onSelect:e=>null==a?void 0:a(e?e.toISOString():null),initialFocus:!0})})]})},O=e=>{let{value:t,onChange:a,placeholder:n,disabled:i,readOnly:o,size:c,displayFormat:d,displayOptions:u}=e,m=t?"string"==typeof t?(0,C.D)(t):t:void 0,[h,p]=s.useState(m?(0,k.WU)(m,"HH:mm"):"");if(s.useEffect(()=>{m&&p((0,k.WU)(m,"HH:mm"))},[t]),o)return m&&d&&"raw"!==d?(0,r.jsx)(f,{value:m,format:d,options:u}):(0,r.jsx)("span",{className:"text-sm",children:m?(0,k.WU)(m,"PPP HH:mm"):""});let x={small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"};return(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)(b.J2,{children:[(0,r.jsx)(b.xo,{asChild:!0,children:(0,r.jsxs)(j.z,{variant:"outline",disabled:i,className:(0,S.cn)("flex-1 justify-start text-left font-normal",!m&&"text-muted-foreground",c?x[c]:""),children:[(0,r.jsx)(w.Z,{className:"mr-2 h-4 w-4"}),m?(0,k.WU)(m,"PPP"):n||"Pick a date"]})}),(0,r.jsx)(b.yk,{className:"w-auto p-0",align:"start",children:(0,r.jsx)(N.f,{mode:"single",selected:m,onSelect:e=>{if(e){let[t,r]=h.split(":").map(Number);e.setHours(t||0,r||0,0,0),null==a||a(e.toISOString())}else null==a||a(null)},initialFocus:!0})})]}),(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)(l.I,{type:"time",value:h,onChange:e=>{let t=e.target.value;if(p(t),m&&t){let[e,r]=t.split(":").map(Number),s=new Date(m);s.setHours(e,r,0,0),null==a||a(s.toISOString())}},disabled:i,className:(0,S.cn)("w-32",c?x[c]:"")})})]})},z=e=>{let{value:t,onChange:a,placeholder:s,disabled:n,readOnly:i,size:o}=e;return i?(0,r.jsx)("span",{className:"text-sm",children:t||""}):(0,r.jsx)(l.I,{type:"time",value:t||"",onChange:e=>null==a?void 0:a(e.target.value||null),placeholder:s,disabled:n,className:(0,S.cn)(o?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[o]:"")})},_=a(23675),I=a(47416),T=a(74440),Z=a(74291),L=e=>{let{value:t,onChange:a,placeholder:l,disabled:n,readOnly:i}=e,[o,c]=(0,s.useState)(""),[d,u]=(0,s.useState)(null),[m,h]=(0,s.useState)(!1);(0,s.useEffect)(()=>{try{c(t?JSON.stringify(t,null,2):""),u(null)}catch(e){c(String(t))}},[t]);let f=e=>{if(c(e),!e.trim()){null==a||a(null),u(null);return}try{let t=JSON.parse(e);null==a||a(t),u(null)}catch(e){u("Invalid JSON")}};if(i)return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)("pre",{className:"rounded bg-muted p-2 pr-7 text-xs overflow-auto max-h-32 max-w-[400px] whitespace-pre-wrap break-all",children:o||"-"}),o&&(0,r.jsx)(j.z,{type:"button",variant:"ghost",size:"sm",className:"absolute right-1 top-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>h(!0),children:(0,r.jsx)(I.Z,{className:"h-3 w-3"})})]}),(0,r.jsx)(Z.Vq,{open:m,onOpenChange:h,children:(0,r.jsxs)(Z.cZ,{className:"max-w-3xl",children:[(0,r.jsx)(Z.fK,{children:(0,r.jsx)(Z.$N,{children:"View JSON"})}),(0,r.jsx)("pre",{className:"rounded bg-muted p-4 text-sm font-mono overflow-auto max-h-[60vh] whitespace-pre-wrap",children:o||"-"})]})})]});let p=(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(_.g,{value:o,onChange:e=>f(e.target.value),placeholder:l||'{"key": "value"}',disabled:n,className:"min-h-[120px] font-mono text-sm ".concat(d?"border-destructive":"")}),d&&(0,r.jsx)("p",{className:"mt-1 text-xs text-destructive",children:d}),(0,r.jsx)(j.z,{type:"button",variant:"ghost",size:"sm",className:"absolute right-1 top-1 h-6 w-6 p-0",onClick:()=>h(!m),children:m?(0,r.jsx)(T.Z,{className:"h-3 w-3"}):(0,r.jsx)(I.Z,{className:"h-3 w-3"})})]});return m?(0,r.jsx)(Z.Vq,{open:m,onOpenChange:h,children:(0,r.jsxs)(Z.cZ,{className:"max-w-3xl",children:[(0,r.jsx)(Z.fK,{children:(0,r.jsx)(Z.$N,{children:"Edit JSON"})}),(0,r.jsx)(_.g,{value:o,onChange:e=>f(e.target.value),placeholder:l||'{"key": "value"}',disabled:n,className:"min-h-[400px] font-mono text-sm ".concat(d?"border-destructive":"")}),d&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:d})]})}):p},R=e=>{let{value:t,onChange:a,placeholder:s,disabled:l,readOnly:n,autoSize:i}=e;if(n)return(0,r.jsx)("div",{className:"whitespace-pre-wrap text-sm rounded bg-muted p-2",children:t||""});let o=(null==i?void 0:i.minRows)?24*i.minRows:72,c=(null==i?void 0:i.maxRows)?24*i.maxRows:200;return(0,r.jsx)(_.g,{value:t||"",onChange:e=>null==a?void 0:a(e.target.value),placeholder:s,disabled:l,style:{minHeight:o,maxHeight:c},className:"resize-y"})},E=a(24156),P=a(99397),M=a(30401),D=a(2596),F=e=>{let{value:t,onChange:a,options:l=[],disabled:n,readOnly:i,size:o,placeholder:c,allowCustom:d=!0,allowNull:u=!1}=e,[m,h]=(0,s.useState)(!1),[f,p]=(0,s.useState)("");if((0,s.useEffect)(()=>{m||p("")},[m]),i)return t?(0,r.jsx)(v.C,{variant:"secondary",children:t}):(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"});let x=e=>{null==a||a(e),h(!1),p("")},g=()=>{f.trim()&&(null==a||a(f.trim()),h(!1),p(""))},y=Array.isArray(l)?l:[],N=f.trim()&&!y.some(e=>e.toLowerCase()===f.trim().toLowerCase()),w=f.trim()?y.filter(e=>e.toLowerCase().includes(f.toLowerCase())):y;return(0,r.jsxs)(b.J2,{open:m,onOpenChange:h,children:[(0,r.jsx)(b.xo,{asChild:!0,children:(0,r.jsxs)(j.z,{variant:"outline",role:"combobox","aria-expanded":m,disabled:n,className:(0,S.cn)("w-full justify-between font-normal","small"===o?"h-8 text-sm":"h-10",!t&&"text-muted-foreground"),children:[t||c||"Select an option...",(0,r.jsx)(E.Z,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,r.jsx)(b.yk,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:(0,r.jsxs)(D.mY,{shouldFilter:!1,children:[(0,r.jsx)(D.sZ,{placeholder:"Search or type custom value...",value:f,onValueChange:p}),(0,r.jsxs)(D.e8,{children:[(0,r.jsx)(D.rb,{children:d&&f.trim()?(0,r.jsxs)("button",{onClick:g,className:"flex w-full items-center gap-2 px-2 py-1.5 text-sm hover:bg-accent rounded cursor-pointer",children:[(0,r.jsx)(P.Z,{className:"h-4 w-4"}),'Add "',f.trim(),'"']}):"No options found."}),(0,r.jsxs)(D.fu,{children:[u&&(0,r.jsxs)(D.di,{value:"",onSelect:()=>x(""),children:[(0,r.jsx)(M.Z,{className:(0,S.cn)("mr-2 h-4 w-4",""!==t&&t?"opacity-0":"opacity-100")}),(0,r.jsx)("span",{className:"text-muted-foreground italic",children:"None"})]}),w.map(e=>(0,r.jsxs)(D.di,{value:e,onSelect:()=>x(e),children:[(0,r.jsx)(M.Z,{className:(0,S.cn)("mr-2 h-4 w-4",t===e?"opacity-100":"opacity-0")}),e]},e))]}),d&&N&&w.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(D.zz,{}),(0,r.jsx)(D.fu,{children:(0,r.jsxs)(D.di,{value:"add-custom-".concat(f),onSelect:g,children:[(0,r.jsx)(P.Z,{className:"mr-2 h-4 w-4"}),'Add "',f.trim(),'"']})})]})]})]})})]})},U=a(69658),Y=a(96362),H=e=>{let{value:t,onChange:a,disabled:s,readOnly:l}=e,n=t?"string"==typeof t?t:t.url:null,i=(()=>{if(!t)return null;if("string"==typeof t){let e=t.split("/");return e[e.length-1]}return t.name||"File"})();return l?n?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(U.Z,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline truncate max-w-[200px]",children:i}),(0,r.jsx)(j.z,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>window.open(n,"_blank"),children:(0,r.jsx)(Y.Z,{className:"h-3 w-3"})})]}):(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,r.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-input p-2",children:[(0,r.jsx)(U.Z,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)("span",{className:"text-sm text-muted-foreground",children:i||"No file selected"}),(0,r.jsx)(j.z,{type:"button",variant:"outline",size:"sm",disabled:s,children:"Upload"})]})},J=a(53113),B=e=>{let{value:t,onChange:a,disabled:s,readOnly:l}=e,n=t?"string"==typeof t?t:t.url:null;return l?n?(0,r.jsx)("div",{className:"relative inline-block",children:(0,r.jsx)("img",{src:n,alt:"Preview",className:"h-12 w-12 rounded object-cover border border-border",onError:e=>{e.target.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Crect fill='%23eee' width='48' height='48'/%3E%3Ctext x='50%25' y='50%25' dominant-baseline='middle' text-anchor='middle' fill='%23999' font-size='12'%3E?%3C/text%3E%3C/svg%3E"}})}):(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,r.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-input p-2",children:[n?(0,r.jsx)("img",{src:n,alt:"Preview",className:"h-10 w-10 rounded object-cover"}):(0,r.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded bg-muted",children:(0,r.jsx)(J.Z,{className:"h-5 w-5 text-muted-foreground"})}),(0,r.jsx)("span",{className:"flex-1 text-sm text-muted-foreground truncate",children:n?"Image uploaded":"No image selected"}),(0,r.jsx)(j.z,{type:"button",variant:"outline",size:"sm",disabled:s,children:"Upload"})]})},V=e=>{let{value:t,onChange:a,disabled:s,readOnly:n}=e;return n?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"h-6 w-6 rounded border border-border",style:{backgroundColor:t||"transparent"}}),(0,r.jsx)("span",{className:"text-sm font-mono",children:t||"-"})]}):(0,r.jsxs)(b.J2,{children:[(0,r.jsx)(b.xo,{asChild:!0,children:(0,r.jsxs)(j.z,{variant:"outline",className:"w-full justify-start gap-2",disabled:s,children:[(0,r.jsx)("div",{className:"h-4 w-4 rounded border border-border",style:{backgroundColor:t||"transparent"}}),(0,r.jsx)("span",{className:"font-mono text-sm",children:t||"Select color"})]})}),(0,r.jsx)(b.yk,{className:"w-auto p-3",children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(l.I,{type:"color",value:t||"#000000",onChange:e=>null==a?void 0:a(e.target.value),className:"h-10 w-full cursor-pointer"}),(0,r.jsx)(l.I,{value:t||"",onChange:e=>null==a?void 0:a(e.target.value),placeholder:"#000000",className:"font-mono"})]})})]})},G=e=>{let{value:t,onChange:a,disabled:s,readOnly:n,size:i}=e;return n?(0,r.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:t||"-"}):(0,r.jsx)(l.I,{value:t||"",onChange:e=>null==a?void 0:a(e.target.value),disabled:s,className:(0,S.cn)("font-mono",i?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[i]:""),placeholder:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"})},W=a(32489),q=e=>{let{value:t=[],onChange:a,itemType:n="string",disabled:i,readOnly:o,size:c,placeholder:d}=e,[u,m]=(0,s.useState)(""),h=e=>{if(null==e)return"";if("date"===n||"datetime"===n){let t=new Date(e);return isNaN(t.getTime())?String(e):"datetime"===n?t.toLocaleString():t.toLocaleDateString()}return"boolean"===n?e?"true":"false":String(e)};if(o){let e=Array.isArray(t)?t:[];return(0,r.jsxs)("div",{className:"flex flex-wrap gap-1 max-w-[250px] overflow-hidden",children:[e.length>0?e.slice(0,5).map((e,t)=>(0,r.jsx)(v.C,{variant:"secondary",className:"truncate max-w-[120px]",children:h(e)},t)):(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"}),e.length>5&&(0,r.jsxs)(v.C,{variant:"outline",children:["+",e.length-5]})]})}let f=()=>{let e;if("date"===n||"datetime"===n||"time"===n){if(!u)return}else if("boolean"!==n&&!u.trim())return;switch(n){case"number":if(isNaN(e=parseFloat(u.trim())))return;break;case"boolean":e="true"===u.trim().toLowerCase();break;case"date":case"time":if(!u)return;e=u;break;case"datetime":if(!u)return;e=new Date(u).toISOString();break;default:e=u.trim()}null==a||a([...Array.isArray(t)?t:[],e]),m("")},p=e=>{let r=[...Array.isArray(t)?t:[]];r.splice(e,1),null==a||a(r)};return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.I,{type:(()=>{switch(n){case"number":return"number";case"date":return"date";case"datetime":return"datetime-local";case"time":return"time";default:return"text"}})(),value:u,onChange:e=>{m(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),f())},placeholder:(()=>{if(d)return d;switch(n){case"number":return"Enter a number";case"date":return"Select a date";case"datetime":return"Select date and time";case"time":return"Select a time";case"boolean":return"Enter true or false";default:return"Enter a value"}})(),disabled:i,className:(0,S.cn)(c?({small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"})[c]:"")}),(0,r.jsx)(j.z,{type:"button",variant:"outline",size:"icon",onClick:()=>{f()},disabled:i||!u,className:(0,S.cn)("small"===c?"h-8 w-8":""),children:(0,r.jsx)(P.Z,{className:"h-4 w-4"})})]}),Array.isArray(t)&&t.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:t.map((e,t)=>(0,r.jsxs)(v.C,{variant:"secondary",className:"gap-1 pr-1",children:[h(e),(0,r.jsx)("button",{type:"button",onClick:()=>p(t),className:"ml-1 rounded-full hover:bg-muted",disabled:i,children:(0,r.jsx)(W.Z,{className:"h-3 w-3"})})]},t))})]})},K=a(71488),$=a(49322),X=e=>{let{value:t,onChange:a,field:l,disabled:n,readOnly:i,size:o,displayFormat:c,displayOptions:d}=e,u=s.useMemo(()=>{if(!t)return(null==l?void 0:l.showAs)&&(Array.isArray(l.showAs)?l.showAs.length>0:l.showAs)?null:"not-configured";if(Array.isArray(t))return{isArray:!0,items:t,field:l};if("object"==typeof t&&null!==t){if(null==l?void 0:l.showAs){if(Array.isArray(l.showAs)){let e=[" - "," ",", ","_"," & "," | "," (",") ","(",")"],a=[];l.showAs.forEach(r=>{if(e.includes(r))a.push(r);else{let e;if(r.includes(".")){let a=r.split("."),s=t;for(let e of a)if(null==(s=null==s?void 0:s[e]))break;e=s}else e=t[r];null!=e&&""!==e&&a.push(String(e))}});let r=a.filter((t,r)=>{let s=e.includes(t),l=r>0&&e.includes(a[r-1]),n=r===a.length-1;return!s||0!==r&&!n&&!l});return r.length>0?r.join(""):null}if("string"==typeof l.showAs){let e=l.showAs.split(",").map(e=>e.trim()).map(e=>t[e]).filter(Boolean);return e.length>0?e.join("-"):null}}return t.id||t.name||t.title||(Object.keys(t)[0]?t[Object.keys(t)[0]]:null)}return String(t)},[t,l]);if(i){if(u&&"object"==typeof u&&u.isArray){let{items:e,field:t}=u;if(!e||0===e.length)return(0,r.jsxs)(K.u,{children:[(0,r.jsx)(K.aJ,{children:(0,r.jsx)(v.C,{variant:"secondary",children:"Empty"})}),(0,r.jsx)(K._v,{children:"No related items"})]});let a=e.slice(0,3),s=e.length-3;return(0,r.jsxs)("div",{className:"flex flex-wrap gap-1",children:[a.map((e,a)=>{let s="";if((null==t?void 0:t.showAs)&&Array.isArray(t.showAs)){let a=[" - "," ",", ","_"," & "," | "," (",") ","(",")"],r=[];t.showAs.forEach(t=>{if(a.includes(t))r.push(t);else{let a;if(t.includes(".")){let r=t.split("."),s=e;for(let e of r)if(null==(s=null==s?void 0:s[e]))break;a=s}else a=e[t];null!=a&&""!==a&&r.push(String(a))}}),s=r.filter((e,t)=>{let s=a.includes(e),l=t>0&&a.includes(r[t-1]),n=t===r.length-1;return!s||0!==t&&!n&&!l}).join("")}else s=(null==t?void 0:t.showAs)&&"string"==typeof t.showAs?e[t.showAs]||e.name||e.title||e.id||"Item":e.name||e.title||e.id||"Item ".concat(a+1);return(0,r.jsx)(v.C,{variant:"default",children:s||"Item ".concat(a+1)},e.id||a)}),s>0&&(0,r.jsxs)(v.C,{variant:"secondary",children:["+",s," more"]})]})}return"not-configured"===u?(0,r.jsxs)(K.u,{children:[(0,r.jsxs)(K.aJ,{className:"flex items-center gap-1",children:[(0,r.jsx)($.Z,{className:"h-4 w-4 text-yellow-500"}),(0,r.jsx)(v.C,{variant:"outline",className:"text-yellow-600",children:"Not Configured"})]}),(0,r.jsxs)(K._v,{children:["Display format not configured for relation '",null==l?void 0:l.name,"'. Configure 'showAs' field in schema management."]})]}):u&&""!==u?(0,r.jsx)("span",{className:"text-sm",children:u}):(0,r.jsxs)(K.u,{children:[(0,r.jsx)(K.aJ,{children:(0,r.jsx)(v.C,{variant:"secondary",children:"No Data"})}),(0,r.jsx)(K._v,{children:"Related data not found or not loaded"})]})}return(0,r.jsx)(p,{value:"not-configured"!==u&&u?String(u):"",onChange:a,disabled:n,readOnly:i,size:o,placeholder:"Select ".concat((null==l?void 0:l.name)||"relation"),displayFormat:c,displayOptions:d})},Q=a(89345),ee=e=>{let{value:t,onChange:a,disabled:s,readOnly:n,size:i,displayFormat:o,displayOptions:c}=e;return n?o&&"raw"!==o?(0,r.jsx)(f,{value:t,format:o,options:c}):t?(0,r.jsx)("a",{href:"mailto:".concat(t),className:"text-primary hover:underline",children:t}):(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(Q.Z,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,r.jsx)(l.I,{type:"email",value:t||"",onChange:e=>null==a?void 0:a(e.target.value),disabled:s,className:(0,S.cn)("pl-8",i?({small:"h-8 text-sm pl-8",middle:"h-10 pl-9",large:"h-12 text-lg pl-10"})[i]:""),placeholder:"email@example.com"})]})},et=a(98335),ea=e=>{let{value:t,onChange:a,disabled:s,readOnly:n,size:i,displayFormat:o,displayOptions:c}=e;return n?o&&"raw"!==o?(0,r.jsx)(f,{value:t,format:o,options:c}):t?(0,r.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t}):(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(et.Z,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,r.jsx)(l.I,{type:"url",value:t||"",onChange:e=>null==a?void 0:a(e.target.value),disabled:s,className:(0,S.cn)("pl-8",i?({small:"h-8 text-sm pl-8",middle:"h-10 pl-9",large:"h-12 text-lg pl-10"})[i]:""),placeholder:"https://example.com"})]})},er=a(13041),es=e=>{let{value:t,onChange:a,disabled:s,readOnly:n,size:i,displayFormat:o,displayOptions:c}=e;return n?o&&"raw"!==o?(0,r.jsx)(f,{value:t,format:o,options:c}):t?(0,r.jsx)("a",{href:"tel:".concat(t),className:"text-primary hover:underline",children:t}):(0,r.jsx)("span",{className:"text-muted-foreground",children:"-"}):(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(er.Z,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,r.jsx)(l.I,{type:"tel",value:t||"",onChange:e=>null==a?void 0:a(e.target.value),disabled:s,className:(0,S.cn)("pl-8",i?({small:"h-8 text-sm pl-8",middle:"h-10 pl-9",large:"h-12 text-lg pl-10"})[i]:""),placeholder:"+1 (555) 123-4567"})]})},el=e=>{let{value:t,onChange:a,disabled:s,readOnly:l,language:n="javascript"}=e;return l?(0,r.jsx)("pre",{className:"rounded bg-muted p-3 font-mono text-xs overflow-auto max-h-48",children:(0,r.jsx)("code",{children:t||""})}):(0,r.jsx)(_.g,{value:t||"",onChange:e=>null==a?void 0:a(e.target.value),disabled:s,className:"font-mono text-sm min-h-[120px]",placeholder:"// Enter ".concat(n," code here")})},en=a(83774),ei=a(83724),eo=e=>{let{value:t,onChange:a,disabled:l,readOnly:n,geometryType:i="Point",fieldName:o="Location"}=e,[c,d]=(0,s.useState)(!1),u=t?JSON.stringify(t,null,2):"",m=()=>{t&&d(!0)};if(n)return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("pre",{className:"rounded bg-muted p-2 text-xs overflow-auto max-h-32 max-w-[250px] whitespace-pre-wrap break-all flex-1",children:u||"-"}),t&&(0,r.jsxs)(j.z,{variant:"ghost",size:"sm",className:"ml-2 h-8 text-xs gap-1",onClick:m,children:[(0,r.jsx)(en.Z,{className:"h-3 w-3"}),"Map"]})]}),(0,r.jsx)(ei.Z,{open:c,onOpenChange:d,value:t,fieldName:o,fieldType:i})]});let h=e=>{if(!e.trim()){null==a||a(null);return}try{let t=JSON.parse(e);null==a||a(t)}catch(e){}},f=s.useMemo(()=>{switch(i){case"Point":return'{"type": "Point", "coordinates": [longitude, latitude]}';case"Polygon":return'{"type": "Polygon", "coordinates": [[[lng1, lat1], [lng2, lat2], ...]]}';case"LineString":return'{"type": "LineString", "coordinates": [[lng1, lat1], [lng2, lat2]]}';default:return'{"type": "'.concat(i,'", "coordinates": [...]}')}},[i]);return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[(0,r.jsx)(_.g,{value:u,onChange:e=>h(e.target.value),disabled:l,className:"font-mono text-sm min-h-[100px] flex-1",placeholder:f}),t&&(0,r.jsxs)(j.z,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs gap-1 shrink-0",onClick:m,children:[(0,r.jsx)(en.Z,{className:"h-3 w-3"}),"Map"]})]}),(0,r.jsx)(ei.Z,{open:c,onOpenChange:d,value:t,fieldName:o,fieldType:i})]})},ec=a(75060),ed=a(68245);let eu=s.memo(e=>{let{value:t,onChange:a,disabled:s,readOnly:n,size:i,rangeType:o="integer"}=e,c=e=>{if(null==e)return"";if("date"===o||"datetime"===o){if(e instanceof Date)return"datetime"===o?e.toLocaleString():e.toLocaleDateString();if("string"==typeof e){let t=new Date(e);return"datetime"===o?t.toLocaleString():t.toLocaleDateString()}}return String(e)};if(n){if(!t)return(0,r.jsx)("span",{className:"text-sm text-muted-foreground",children:"-"});let e=!1!==t.lowerInclusive?"[":"(",a=!1!==t.upperInclusive?"]":")";return(0,r.jsxs)(v.C,{variant:"secondary",className:"font-mono text-xs",children:[e,c(t.lower)," – ",c(t.upper),a]})}let d={small:"h-8 text-sm",middle:"h-10",large:"h-12 text-lg"},u=()=>{switch(o){case"date":return"date";case"datetime":return"datetime-local";case"time":return"time";default:return"number"}},m=e=>{if(!e)return null;switch(o){case"integer":return parseInt(e,10);case"double":case"decimal":return parseFloat(e);case"date":case"datetime":return new Date(e).toISOString();default:return e}},h=e=>null==e?"":"date"===o&&e?new Date(e).toISOString().split("T")[0]:"datetime"===o&&e?new Date(e).toISOString().slice(0,16):String(e);return(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,r.jsx)(ec._,{className:"text-xs text-muted-foreground",children:"Lower"}),(0,r.jsx)(l.I,{type:u(),value:h(null==t?void 0:t.lower),onChange:e=>{var r,s,l;let n=m(e.target.value);null==a||a({lower:n,upper:null!==(r=null==t?void 0:t.upper)&&void 0!==r?r:null,lowerInclusive:null===(s=null==t?void 0:t.lowerInclusive)||void 0===s||s,upperInclusive:null===(l=null==t?void 0:t.upperInclusive)||void 0===l||l})},disabled:s,className:i?d[i]:"",placeholder:"Lower bound"})]}),(0,r.jsx)("span",{className:"text-muted-foreground pt-5",children:"–"}),(0,r.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,r.jsx)(ec._,{className:"text-xs text-muted-foreground",children:"Upper"}),(0,r.jsx)(l.I,{type:u(),value:h(null==t?void 0:t.upper),onChange:e=>{var r,s,l;let n=m(e.target.value);null==a||a({lower:null!==(r=null==t?void 0:t.lower)&&void 0!==r?r:null,upper:n,lowerInclusive:null===(s=null==t?void 0:t.lowerInclusive)||void 0===s||s,upperInclusive:null===(l=null==t?void 0:t.upperInclusive)||void 0===l||l})},disabled:s,className:i?d[i]:"",placeholder:"Upper bound"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(ed.X,{id:"lowerInclusive",checked:(null==t?void 0:t.lowerInclusive)!==!1,onCheckedChange:e=>{var r,s,l;return null==a?void 0:a({lower:null!==(r=null==t?void 0:t.lower)&&void 0!==r?r:null,upper:null!==(s=null==t?void 0:t.upper)&&void 0!==s?s:null,lowerInclusive:!0===e,upperInclusive:null===(l=null==t?void 0:t.upperInclusive)||void 0===l||l})},disabled:s}),(0,r.jsx)(ec._,{htmlFor:"lowerInclusive",className:"text-xs",children:"Lower inclusive"})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(ed.X,{id:"upperInclusive",checked:(null==t?void 0:t.upperInclusive)!==!1,onCheckedChange:e=>{var r,s,l;return null==a?void 0:a({lower:null!==(r=null==t?void 0:t.lower)&&void 0!==r?r:null,upper:null!==(s=null==t?void 0:t.upper)&&void 0!==s?s:null,lowerInclusive:null===(l=null==t?void 0:t.lowerInclusive)||void 0===l||l,upperInclusive:!0===e})},disabled:s}),(0,r.jsx)(ec._,{htmlFor:"upperInclusive",className:"text-xs",children:"Upper inclusive"})]})]})]})});eu.displayName="RangeField";var em=eu,eh=a(46938),ef=a(78302),ep=a(54816),ex=a(63676),eg=a(65318),ev=a(78234),ey=a(13694),ej=a(24475),eN=a(71190),eb=a(5172),ew=a(75965),eC=a(44353),ek=a(84519),eS=a(29747),eA=a(79022),eO=a(81328),ez=a(19680),e_=a(17494),eI=a(18778),eT=a(64935),eZ=a(12805),eL=a(6387),eR=a(31734),eE=a(58310),eP=a(17881),eM=a(13720),eD=a(7586),eF=a(28645),eU=a(74656),eY=a(21047),eH=a(25330);let eJ=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"],eB=e=>{let{onClick:t,isActive:a,disabled:s,children:l,title:n}=e;return(0,r.jsx)(j.z,{type:"button",variant:"ghost",size:"sm",onClick:t,disabled:s,className:(0,S.cn)("h-8 w-8 p-0",a&&"bg-muted text-foreground"),title:n,children:l})},eV=()=>(0,r.jsx)("div",{className:"w-px h-6 bg-border mx-1"}),eG=e=>{let{editor:t,onSourceToggle:a,isSourceMode:n,onFullscreenToggle:i,isFullscreen:o}=e,[c,d]=(0,s.useState)(""),[u,m]=(0,s.useState)(!1),[h,f]=(0,s.useState)(""),[p,x]=(0,s.useState)(!1),g=(0,s.useCallback)(()=>{t&&(c?t.chain().focus().extendMarkRange("link").setLink({href:c}).run():t.chain().focus().extendMarkRange("link").unsetLink().run(),m(!1),d(""))},[t,c]),v=(0,s.useCallback)(()=>{t&&(h&&t.chain().focus().setImage({src:h}).run(),x(!1),f(""))},[t,h]);return t?(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-0.5 p-1 border-b bg-muted/30",children:[(0,r.jsx)(eB,{onClick:()=>t.chain().focus().undo().run(),disabled:!t.can().undo(),title:"Undo",children:(0,r.jsx)(ew.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().redo().run(),disabled:!t.can().redo(),title:"Redo",children:(0,r.jsx)(eC.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eV,{}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleHeading({level:1}).run(),isActive:t.isActive("heading",{level:1}),title:"Heading 1",children:(0,r.jsx)(ek.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleHeading({level:2}).run(),isActive:t.isActive("heading",{level:2}),title:"Heading 2",children:(0,r.jsx)(eS.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleHeading({level:3}).run(),isActive:t.isActive("heading",{level:3}),title:"Heading 3",children:(0,r.jsx)(eA.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eV,{}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleBold().run(),isActive:t.isActive("bold"),title:"Bold",children:(0,r.jsx)(eO.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleItalic().run(),isActive:t.isActive("italic"),title:"Italic",children:(0,r.jsx)(ez.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleUnderline().run(),isActive:t.isActive("underline"),title:"Underline",children:(0,r.jsx)(e_.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleStrike().run(),isActive:t.isActive("strike"),title:"Strikethrough",children:(0,r.jsx)(eI.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleCode().run(),isActive:t.isActive("code"),title:"Inline Code",children:(0,r.jsx)(eT.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eV,{}),(0,r.jsxs)(b.J2,{children:[(0,r.jsx)(b.xo,{asChild:!0,children:(0,r.jsx)(j.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",title:"Text Color",children:(0,r.jsx)(eZ.Z,{className:"h-4 w-4"})})}),(0,r.jsxs)(b.yk,{className:"w-auto p-2",children:[(0,r.jsx)("div",{className:"grid grid-cols-10 gap-1",children:eJ.map(e=>(0,r.jsx)("button",{className:"w-5 h-5 rounded border border-border hover:scale-110 transition-transform",style:{backgroundColor:e},onClick:()=>t.chain().focus().setColor(e).run()},e))}),(0,r.jsx)(j.z,{variant:"ghost",size:"sm",className:"w-full mt-2",onClick:()=>t.chain().focus().unsetColor().run(),children:"Remove color"})]})]}),(0,r.jsxs)(b.J2,{children:[(0,r.jsx)(b.xo,{asChild:!0,children:(0,r.jsx)(j.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",title:"Highlight",children:(0,r.jsx)(eL.Z,{className:"h-4 w-4"})})}),(0,r.jsxs)(b.yk,{className:"w-auto p-2",children:[(0,r.jsx)("div",{className:"grid grid-cols-10 gap-1",children:eJ.slice(10).map(e=>(0,r.jsx)("button",{className:"w-5 h-5 rounded border border-border hover:scale-110 transition-transform",style:{backgroundColor:e},onClick:()=>t.chain().focus().toggleHighlight({color:e}).run()},e))}),(0,r.jsx)(j.z,{variant:"ghost",size:"sm",className:"w-full mt-2",onClick:()=>t.chain().focus().unsetHighlight().run(),children:"Remove highlight"})]})]}),(0,r.jsx)(eV,{}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().setTextAlign("left").run(),isActive:t.isActive({textAlign:"left"}),title:"Align Left",children:(0,r.jsx)(eR.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().setTextAlign("center").run(),isActive:t.isActive({textAlign:"center"}),title:"Align Center",children:(0,r.jsx)(eE.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().setTextAlign("right").run(),isActive:t.isActive({textAlign:"right"}),title:"Align Right",children:(0,r.jsx)(eP.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().setTextAlign("justify").run(),isActive:t.isActive({textAlign:"justify"}),title:"Justify",children:(0,r.jsx)(eM.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eV,{}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleBulletList().run(),isActive:t.isActive("bulletList"),title:"Bullet List",children:(0,r.jsx)(eD.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleOrderedList().run(),isActive:t.isActive("orderedList"),title:"Ordered List",children:(0,r.jsx)(eF.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().toggleBlockquote().run(),isActive:t.isActive("blockquote"),title:"Blockquote",children:(0,r.jsx)(eU.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:()=>t.chain().focus().setHorizontalRule().run(),title:"Horizontal Rule",children:(0,r.jsx)(eY.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eV,{}),(0,r.jsxs)(b.J2,{open:u,onOpenChange:m,children:[(0,r.jsx)(b.xo,{asChild:!0,children:(0,r.jsx)(j.z,{variant:"ghost",size:"sm",className:(0,S.cn)("h-8 w-8 p-0",t.isActive("link")&&"bg-muted"),title:"Link",children:(0,r.jsx)(et.Z,{className:"h-4 w-4"})})}),(0,r.jsx)(b.yk,{className:"w-80",children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(ec._,{children:"URL"}),(0,r.jsx)(l.I,{value:c,onChange:e=>d(e.target.value),placeholder:"https://example.com",onKeyDown:e=>"Enter"===e.key&&g()}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)(j.z,{size:"sm",onClick:g,children:[t.isActive("link")?"Update":"Add"," Link"]}),t.isActive("link")&&(0,r.jsx)(j.z,{size:"sm",variant:"outline",onClick:()=>{t.chain().focus().unsetLink().run(),m(!1)},children:"Remove"})]})]})})]}),(0,r.jsxs)(b.J2,{open:p,onOpenChange:x,children:[(0,r.jsx)(b.xo,{asChild:!0,children:(0,r.jsx)(j.z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",title:"Image",children:(0,r.jsx)(J.Z,{className:"h-4 w-4"})})}),(0,r.jsx)(b.yk,{className:"w-80",children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(ec._,{children:"Image URL"}),(0,r.jsx)(l.I,{value:h,onChange:e=>f(e.target.value),placeholder:"https://example.com/image.jpg",onKeyDown:e=>"Enter"===e.key&&v()}),(0,r.jsx)(j.z,{size:"sm",onClick:v,children:"Add Image"})]})})]}),(0,r.jsx)("div",{className:"flex-1"}),(0,r.jsx)(eB,{onClick:a,isActive:n,title:"Source Code",children:(0,r.jsx)(eH.Z,{className:"h-4 w-4"})}),(0,r.jsx)(eB,{onClick:i,title:o?"Exit Fullscreen":"Fullscreen",children:o?(0,r.jsx)(T.Z,{className:"h-4 w-4"}):(0,r.jsx)(I.Z,{className:"h-4 w-4"})})]}):null};var eW=e=>{let{value:t,onChange:a,disabled:l,readOnly:n,placeholder:i="Enter content...",className:o,minHeight:c=300}=e,[d,u]=(0,s.useState)(!1),[m,h]=(0,s.useState)(t||""),[f,p]=(0,s.useState)(!1),[x,g]=(0,s.useState)(!1),v=(0,eh.jE)({immediatelyRender:!1,extensions:[ef.Z.configure({heading:{levels:[1,2,3,4,5,6]}}),ep.ZP.configure({openOnClick:!1,HTMLAttributes:{rel:"noopener noreferrer"}}),ex.ZP.configure({HTMLAttributes:{style:"max-width: 100%; height: auto;"}}),eg.Z.configure({types:["heading","paragraph"]}),ev.Z,ey.pn,ej.Z,eN.ZP.configure({multicolor:!0}),eb.Z.configure({placeholder:i})],content:t||"",editable:!l&&!n,onUpdate:e=>{let{editor:t}=e,r=t.getHTML();null==a||a(r)}});(0,s.useEffect)(()=>{v&&t!==v.getHTML()&&!d&&v.commands.setContent(t||"")},[t,v,d]),(0,s.useEffect)(()=>{d&&h(t||"")},[d,t]),(0,s.useEffect)(()=>{g(!0)},[]),(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&f&&p(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[f]);let y=()=>{null==a||a(m),null==v||v.commands.setContent(m),u(!1)};return n?(0,r.jsx)("div",{className:(0,S.cn)("prose prose-sm dark:prose-invert max-w-none","border rounded-md p-3 bg-muted/30","overflow-auto",o),style:{minHeight:c/2},dangerouslySetInnerHTML:{__html:t||"<em>No content</em>"}}):x?(0,r.jsxs)("div",{className:(0,S.cn)("html-field border rounded-md overflow-hidden flex flex-col bg-background",f&&"fixed inset-0 z-50 rounded-none",o),style:{height:f?"100vh":c},children:[(0,r.jsx)(eG,{editor:v,onSourceToggle:()=>{d?y():(h((null==v?void 0:v.getHTML())||""),u(!0))},isSourceMode:d,onFullscreenToggle:()=>p(!f),isFullscreen:f}),d?(0,r.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,r.jsx)(_.g,{value:m,onChange:e=>{h(e.target.value)},className:"flex-1 font-mono text-sm resize-none rounded-none border-0 focus-visible:ring-0",placeholder:"Enter HTML source code..."}),(0,r.jsxs)("div",{className:"flex justify-end gap-2 p-2 border-t bg-muted/30",children:[(0,r.jsx)(j.z,{variant:"outline",size:"sm",onClick:()=>u(!1),children:"Cancel"}),(0,r.jsx)(j.z,{size:"sm",onClick:y,children:"Apply"})]})]}):(0,r.jsx)(eh.kg,{editor:v,className:(0,S.cn)("flex-1 overflow-auto","[&_.tiptap]:outline-none [&_.tiptap]:p-3 [&_.tiptap]:min-h-full","[&_.tiptap_p.is-editor-empty:first-child::before]:text-muted-foreground","[&_.tiptap_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]","[&_.tiptap_p.is-editor-empty:first-child::before]:float-left","[&_.tiptap_p.is-editor-empty:first-child::before]:h-0","[&_.tiptap_p.is-editor-empty:first-child::before]:pointer-events-none")})]}):(0,r.jsx)("div",{className:(0,S.cn)("animate-pulse bg-muted rounded border",o),style:{height:c}})};let eq=s.memo(e=>{let{field:t,value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o,displayFormat:c,displayOptions:d}=e,u=c||t.displayFormat,m=d||t.displayOptions;if(t.relType)return(0,r.jsx)(X,{value:a,onChange:s,field:t,disabled:l,readOnly:n,size:i,displayFormat:u,displayOptions:m});switch(t.type){case"UUID":return(0,r.jsx)(G,{value:a,onChange:s,disabled:l,readOnly:n,size:i});case"String":case"VARCHAR":case"CHAR":return(0,r.jsx)(p,{value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o,maxLength:t.maxLength,showCount:!!t.maxLength,displayFormat:u,displayOptions:m});case"Text":case"LONGTEXT":case"MEDIUMTEXT":return(0,r.jsx)(R,{value:a,onChange:s,disabled:l,readOnly:n,placeholder:o,autoSize:{minRows:3,maxRows:8}});case"HTML":return(0,r.jsx)(eW,{value:a,onChange:s,disabled:l,readOnly:n,placeholder:o});case"Number":case"INTEGER":case"INT":case"BIGINT":case"SMALLINT":case"TINYINT":return(0,r.jsx)(x,{value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o,precision:0});case"Float":case"DOUBLE":case"REAL":return(0,r.jsx)(x,{value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o,step:.1});case"Decimal":case"NUMERIC":return(0,r.jsx)(x,{value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o,precision:t.scale,step:t.scale?Math.pow(10,-t.scale):.01});case"Boolean":case"BOOLEAN":return(0,r.jsx)(y,{value:a,onChange:s,disabled:l,readOnly:n,size:"small"===i?"small":"default"});case"Date":return(0,r.jsx)(A,{value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o,displayFormat:u,displayOptions:m});case"DateTime":case"DateTime_NO_TZ":case"DATETIME":case"TIMESTAMP":return(0,r.jsx)(O,{value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o,displayFormat:u,displayOptions:m});case"Time":case"Time_NO_TZ":return(0,r.jsx)(z,{value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o});case"JSON":case"JSONB":return(0,r.jsx)(L,{value:a,onChange:s,disabled:l,readOnly:n,placeholder:o});case"ENUM":case"Enum":return(0,r.jsx)(F,{value:a,onChange:s,options:t.values||[],disabled:l,readOnly:n,size:i,placeholder:o,allowNull:t.allowNull});case"File":return(0,r.jsx)(H,{value:a,onChange:s,disabled:l,readOnly:n});case"Image":return(0,r.jsx)(B,{value:a,onChange:s,disabled:l,readOnly:n});case"Color":return(0,r.jsx)(V,{value:a,onChange:s,disabled:l,readOnly:n});case"Array_String":return(0,r.jsx)(q,{value:a,onChange:s,itemType:"string",disabled:l,readOnly:n,size:i,placeholder:o||"Enter string values"});case"Array_Integer":case"Array_Number":case"Array_Double":case"Array_Decimal":return(0,r.jsx)(q,{value:a,onChange:s,itemType:"number",disabled:l,readOnly:n,size:i,placeholder:o||"Enter number values"});case"Array_UUID":return(0,r.jsx)(q,{value:a,onChange:s,itemType:"string",disabled:l,readOnly:n,size:i,placeholder:o||"Enter UUID values"});case"Array_Boolean":return(0,r.jsx)(q,{value:a,onChange:s,itemType:"boolean",disabled:l,readOnly:n,size:i,placeholder:o||"Enter true or false"});case"Array_Date":return(0,r.jsx)(q,{value:a,onChange:s,itemType:"date",disabled:l,readOnly:n,size:i,placeholder:o||"Select dates"});case"Array_DateTime":case"Array_DateTime_NO_TZ":return(0,r.jsx)(q,{value:a,onChange:s,itemType:"datetime",disabled:l,readOnly:n,size:i,placeholder:o||"Select date and time"});case"Array_Time":case"Array_Time_NO_TZ":return(0,r.jsx)(q,{value:a,onChange:s,itemType:"time",disabled:l,readOnly:n,size:i,placeholder:o||"Select times"});case"Email":return(0,r.jsx)(ee,{value:a,onChange:s,disabled:l,readOnly:n,size:i,displayFormat:u,displayOptions:m});case"URL":return(0,r.jsx)(ea,{value:a,onChange:s,disabled:l,readOnly:n,size:i,displayFormat:u,displayOptions:m});case"Phone":return(0,r.jsx)(es,{value:a,onChange:s,disabled:l,readOnly:n,size:i,displayFormat:u,displayOptions:m});case"Code":return(0,r.jsx)(el,{value:a,onChange:s,disabled:l,readOnly:n,language:t.language||"javascript"});case"Point":case"Polygon":case"LineString":case"MultiPoint":case"MultiPolygon":case"MultiLineString":case"GeometryCollection":return(0,r.jsx)(eo,{value:a,onChange:s,disabled:l,readOnly:n,geometryType:t.type});case"Range_Integer":return(0,r.jsx)(em,{value:a,onChange:s,disabled:l,readOnly:n,size:i,rangeType:"integer"});case"Range_Double":return(0,r.jsx)(em,{value:a,onChange:s,disabled:l,readOnly:n,size:i,rangeType:"double"});case"Range_Decimal":return(0,r.jsx)(em,{value:a,onChange:s,disabled:l,readOnly:n,size:i,rangeType:"decimal"});case"Range_Date":return(0,r.jsx)(em,{value:a,onChange:s,disabled:l,readOnly:n,size:i,rangeType:"date"});case"Range_DateTime":case"Range_DateTime_NO_TZ":return(0,r.jsx)(em,{value:a,onChange:s,disabled:l,readOnly:n,size:i,rangeType:"datetime"});case"Range_Time":case"Range_Time_NO_TZ":return(0,r.jsx)(em,{value:a,onChange:s,disabled:l,readOnly:n,size:i,rangeType:"time"});default:return(0,r.jsx)(p,{value:a,onChange:s,disabled:l,readOnly:n,size:i,placeholder:o,displayFormat:u,displayOptions:m})}});eq.displayName="FieldRenderer";var eK=eq},95937:function(e,t,a){a.d(t,{Cd:function(){return c},X:function(){return d},bZ:function(){return o}});var r=a(57437),s=a(2265),l=a(90535),n=a(93448);let i=(0,l.j)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),o=s.forwardRef((e,t)=>{let{className:a,variant:s,...l}=e;return(0,r.jsx)("div",{ref:t,role:"alert",className:(0,n.cn)(i({variant:s}),a),...l})});o.displayName="Alert";let c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("h5",{ref:t,className:(0,n.cn)("mb-1 font-medium leading-none tracking-tight",a),...s})});c.displayName="AlertTitle";let d=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("text-sm [&_p]:leading-relaxed",a),...s})});d.displayName="AlertDescription"},46291:function(e,t,a){a.d(t,{f:function(){return c}});var r=a(57437);a(2265);var s=a(92451),l=a(10407),n=a(61013),i=a(93448),o=a(12381);function c(e){let{className:t,classNames:a,showOutsideDays:c=!0,...d}=e;return(0,r.jsx)(n._W,{showOutsideDays:c,className:(0,i.cn)("p-3",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:(0,i.cn)((0,o.d)({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:(0,i.cn)("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md","range"===d.mode?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:(0,i.cn)((0,o.d)({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...a},components:{IconLeft:()=>(0,r.jsx)(s.Z,{className:"h-4 w-4"}),IconRight:()=>(0,r.jsx)(l.Z,{className:"h-4 w-4"})},...d})}c.displayName="Calendar"},68245:function(e,t,a){a.d(t,{X:function(){return o}});var r=a(57437),s=a(2265),l=a(9270),n=a(30401),i=a(93448);let o=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.fC,{ref:t,className:(0,i.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",a),...s,children:(0,r.jsx)(l.z$,{className:(0,i.cn)("flex items-center justify-center text-current"),children:(0,r.jsx)(n.Z,{className:"h-4 w-4"})})})});o.displayName=l.fC.displayName},2596:function(e,t,a){a.d(t,{di:function(){return f},e8:function(){return d},fu:function(){return m},mY:function(){return o},rb:function(){return u},sZ:function(){return c},zz:function(){return h}});var r=a(57437),s=a(2265),l=a(46343),n=a(73247),i=a(93448);a(74291);let o=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.mY,{ref:t,className:(0,i.cn)("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",a),...s})});o.displayName=l.mY.displayName;let c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,r.jsx)(n.Z,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,r.jsx)(l.mY.Input,{ref:t,className:(0,i.cn)("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",a),...s})]})});c.displayName=l.mY.Input.displayName;let d=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.mY.List,{ref:t,className:(0,i.cn)("max-h-[300px] overflow-y-auto overflow-x-hidden",a),...s})});d.displayName=l.mY.List.displayName;let u=s.forwardRef((e,t)=>(0,r.jsx)(l.mY.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));u.displayName=l.mY.Empty.displayName;let m=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.mY.Group,{ref:t,className:(0,i.cn)("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",a),...s})});m.displayName=l.mY.Group.displayName;let h=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.mY.Separator,{ref:t,className:(0,i.cn)("-mx-1 h-px bg-border",a),...s})});h.displayName=l.mY.Separator.displayName;let f=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.mY.Item,{ref:t,className:(0,i.cn)("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a),...s})});f.displayName=l.mY.Item.displayName},75060:function(e,t,a){a.d(t,{_:function(){return c}});var r=a(57437),s=a(2265),l=a(370),n=a(90535),i=a(93448);let o=(0,n.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.f,{ref:t,className:(0,i.cn)(o(),a),...s})});c.displayName=l.f.displayName},83724:function(e,t,a){var r=a(57437),s=a(2265),l=a(74291),n=a(12381),i=a(83774),o=a(78406),c=a(50417),d=a(51817),u=a(3609);let m=null,h=e=>{try{let t=e.replace(/^SRID=\d+;/i,"").trim().match(/^(\w+)\s*\((.+)\)$/i);if(!t)return null;let[,a,r]=t,s=a.toUpperCase();if("POINT"===s){let e=r.trim().split(/\s+/).map(Number);if(e.length>=2&&!e.some(isNaN))return{type:"Point",coordinates:e.slice(0,2)}}if("LINESTRING"===s){let e=r.split(",").map(e=>e.trim().split(/\s+/).map(Number).slice(0,2));if(e.every(e=>2===e.length&&!e.some(isNaN)))return{type:"LineString",coordinates:e}}if("POLYGON"===s){let e=[],t=r.match(/\(([^()]+)\)/g);if(t)for(let a of t){let t=a.replace(/[()]/g,"").split(",").map(e=>e.trim().split(/\s+/).map(Number).slice(0,2));t.every(e=>2===e.length&&!e.some(isNaN))&&e.push(t)}if(e.length>0)return{type:"Polygon",coordinates:e}}if("MULTIPOINT"===s){let e=[],t=r.match(/\(([^()]+)\)/g);if(t)for(let a of t){let t=a.replace(/[()]/g,"").trim().split(/\s+/).map(Number);t.length>=2&&!t.some(isNaN)&&e.push(t.slice(0,2))}else{let t=r.split(",").map(e=>e.trim().split(/\s+/).map(Number).slice(0,2));e.push(...t.filter(e=>2===e.length&&!e.some(isNaN)))}if(e.length>0)return{type:"MultiPoint",coordinates:e}}if("MULTILINESTRING"===s){let e=[],t=r.match(/\(([^()]+)\)/g);if(t)for(let a of t){let t=a.replace(/[()]/g,"").split(",").map(e=>e.trim().split(/\s+/).map(Number).slice(0,2));t.every(e=>2===e.length&&!e.some(isNaN))&&e.push(t)}if(e.length>0)return{type:"MultiLineString",coordinates:e}}if("MULTIPOLYGON"===s){let e=[];for(let t of r.split(/\)\s*,\s*\(/)){let a=[],r=t.replace(/^\(+|\)+$/g,"").match(/\(([^()]+)\)|[^,()]+(?:,[^,()]+)*/g);if(r)for(let e of r){let t=e.replace(/[()]/g,"").split(",").map(e=>e.trim().split(/\s+/).map(Number).slice(0,2)).filter(e=>2===e.length&&!e.some(isNaN));t.length>0&&a.push(t)}a.length>0&&e.push(a)}if(e.length>0)return{type:"MultiPolygon",coordinates:e}}return null}catch(e){return console.error("Error parsing WKT:",e),null}},f=(e,t)=>{if(!e)return null;if(e&&"object"==typeof e&&e.type&&e.coordinates)return e;if("string"==typeof e){if(e.trim().startsWith("{"))try{let t=JSON.parse(e);if(t.type&&t.coordinates)return t}catch(e){}if(/^(SRID=\d+;)?(POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON)/i.test(e))return h(e);if(/^[0-9A-Fa-f]+$/.test(e))return console.warn("Received WKB hex format - cannot parse client-side. API should return GeoJSON."),null}if("object"==typeof e&&"x"in e&&"y"in e)return{type:"Point",coordinates:[e.x,e.y]};if(Array.isArray(e)){if(2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1])return{type:t||"Point",coordinates:e};if(Array.isArray(e[0])&&"number"==typeof e[0][0]){let a=t||"LineString";return"Polygon"===a?{type:"Polygon",coordinates:[e]}:{type:a,coordinates:e}}if(Array.isArray(e[0])&&Array.isArray(e[0][0]))return{type:t||"Polygon",coordinates:e}}return null};t.Z=e=>{let{open:t,onOpenChange:h,value:p,fieldName:x="Location",fieldType:g}=e,v=(0,s.useRef)(null),y=(0,s.useRef)(null),j=(0,s.useRef)(null),[N,b]=(0,s.useState)(!0),w=(0,s.useMemo)(()=>f(p,g),[p,g]),{icon:C,title:k}=(0,s.useMemo)(()=>{let e=(null==w?void 0:w.type)||g,t=(0,r.jsx)(i.Z,{className:"h-4 w-4"});switch(e){case"Point":case"MultiPoint":t=(0,r.jsx)(i.Z,{className:"h-4 w-4"});break;case"LineString":case"MultiLineString":t=(0,r.jsx)(o.Z,{className:"h-4 w-4"});break;case"Polygon":case"MultiPolygon":t=(0,r.jsx)(c.Z,{className:"h-4 w-4"})}return{icon:t,title:"".concat(x," (").concat(e||"Geometry",")")}},[w,x,g]);(0,s.useEffect)(()=>{if(!t)return;let e=!0;return b(!0),(async()=>{try{if(await new Promise(e=>requestAnimationFrame(e)),!e||!v.current){b(!1);return}if(!document.querySelector('link[href*="leaflet.css"]')){let e=document.createElement("link");e.rel="stylesheet",e.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",document.head.appendChild(e),await new Promise(t=>{e.onload=()=>t(),e.onerror=()=>t(),setTimeout(t,1e3)})}if(m||(m=await a.e(4212).then(a.t.bind(a,60759,23)),delete m.Icon.Default.prototype._getIconUrl,m.Icon.Default.mergeOptions({iconRetinaUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-icon-2x.png",iconUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-icon.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-shadow.png"})),!e||!v.current){b(!1);return}let t=m;y.current&&(y.current.remove(),y.current=null);let r=t.map(v.current,{zoomControl:!0,scrollWheelZoom:!0});if(y.current=r,t.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',maxZoom:19}).addTo(r),w){let e=t.geoJSON({type:"Feature",geometry:w,properties:{}},{style:{color:"#3b82f6",weight:3,opacity:.8,fillColor:"#3b82f6",fillOpacity:.3},pointToLayer:(e,a)=>t.circleMarker(a,{radius:10,fillColor:"#3b82f6",color:"#1e40af",weight:2,opacity:1,fillOpacity:.8})}).addTo(r).getBounds();e.isValid()?(j.current=e,r.fitBounds(e,{padding:[50,50],maxZoom:16})):(j.current=null,r.setView([0,0],2))}else j.current=null,r.setView([0,0],2);requestAnimationFrame(()=>{y.current&&e&&y.current.invalidateSize(),b(!1)})}catch(e){console.error("Error initializing map:",e),b(!1)}})(),()=>{e=!1,y.current&&(y.current.remove(),y.current=null)}},[t,w]);let S=(0,s.useMemo)(()=>{if(!w)return"";let e=w.coordinates;if(!e)return"";try{switch(w.type){case"Point":return"[".concat(Number(e[0]).toFixed(6),", ").concat(Number(e[1]).toFixed(6),"]");case"LineString":case"MultiPoint":return"".concat(e.length," points");case"Polygon":var t;let a=e.length,r=(null===(t=e[0])||void 0===t?void 0:t.length)||0;return a>1?"".concat(r," points, ").concat(a-1," hole(s)"):"".concat(r," points");case"MultiLineString":return"".concat(e.length," lines");case"MultiPolygon":return"".concat(e.length," polygons");default:return""}}catch(e){return""}},[w]);return(0,r.jsx)(l.Vq,{open:t,onOpenChange:h,children:(0,r.jsxs)(l.cZ,{className:"max-w-3xl max-h-[85vh]",children:[(0,r.jsx)(l.fK,{children:(0,r.jsxs)(l.$N,{className:"flex items-center gap-2",children:[C,k]})}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"relative",children:[N&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-muted rounded-md z-10",children:(0,r.jsx)(d.Z,{className:"h-8 w-8 animate-spin text-muted-foreground"})}),(0,r.jsx)("div",{ref:v,className:"w-full h-[400px] rounded-md border overflow-hidden bg-muted",style:{minHeight:"400px"}}),!N&&(0,r.jsx)(n.z,{variant:"secondary",size:"icon",className:"absolute top-2 right-2 z-[1000] shadow-md",onClick:()=>{y.current&&(j.current?y.current.fitBounds(j.current,{padding:[50,50],maxZoom:16}):y.current.setView([0,0],2))},title:"Reset to initial view",children:(0,r.jsx)(u.Z,{className:"h-4 w-4"})})]}),S&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,r.jsx)("span",{className:"font-medium",children:"Details:"}),(0,r.jsx)("span",{children:S})]}),(0,r.jsxs)("details",{className:"text-sm",children:[(0,r.jsx)("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"View raw GeoJSON"}),(0,r.jsx)("pre",{className:"mt-2 p-3 bg-muted rounded-md overflow-auto max-h-[200px] text-xs",children:JSON.stringify(w||p,null,2)})]})]})]})})}},12749:function(e,t,a){a.d(t,{J2:function(){return i},xo:function(){return o},yk:function(){return c}});var r=a(57437),s=a(2265),l=a(51777),n=a(93448);let i=l.fC,o=l.xz;l.ee;let c=s.forwardRef((e,t)=>{let{className:a,align:s="center",sideOffset:i=4,...o}=e;return(0,r.jsx)(l.h_,{children:(0,r.jsx)(l.VY,{ref:t,align:s,sideOffset:i,className:(0,n.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...o})})});c.displayName=l.VY.displayName},15291:function(e,t,a){a.d(t,{Bw:function(){return x},DI:function(){return u},Ph:function(){return d},Ql:function(){return v},i4:function(){return h},ki:function(){return m},n5:function(){return g}});var r=a(57437),s=a(2265),l=a(74797),n=a(40875),i=a(22135),o=a(30401),c=a(93448);let d=l.fC,u=l.ZA,m=l.B4,h=s.forwardRef((e,t)=>{let{className:a,children:s,...i}=e;return(0,r.jsxs)(l.xz,{ref:t,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...i,children:[s,(0,r.jsx)(l.JO,{asChild:!0,children:(0,r.jsx)(n.Z,{className:"h-4 w-4 opacity-50"})})]})});h.displayName=l.xz.displayName;let f=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.u_,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",a),...s,children:(0,r.jsx)(i.Z,{className:"h-4 w-4"})})});f.displayName=l.u_.displayName;let p=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.$G,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",a),...s,children:(0,r.jsx)(n.Z,{className:"h-4 w-4"})})});p.displayName=l.$G.displayName;let x=s.forwardRef((e,t)=>{let{className:a,children:s,position:n="popper",...i}=e;return(0,r.jsx)(l.h_,{children:(0,r.jsxs)(l.VY,{ref:t,className:(0,c.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:n,...i,children:[(0,r.jsx)(f,{}),(0,r.jsx)(l.l_,{className:(0,c.cn)("p-1 max-h-[300px] overflow-y-auto","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),style:{overscrollBehavior:"contain",touchAction:"pan-y",WebkitOverflowScrolling:"touch",willChange:"scroll-position",pointerEvents:"auto"},children:s}),(0,r.jsx)(p,{})]})})});x.displayName=l.VY.displayName;let g=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.__,{ref:t,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...s})});g.displayName=l.__.displayName;let v=s.forwardRef((e,t)=>{let{className:a,children:s,...n}=e;return(0,r.jsxs)(l.ck,{ref:t,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...n,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(l.wU,{children:(0,r.jsx)(o.Z,{className:"h-4 w-4"})})}),(0,r.jsx)(l.eT,{children:s})]})});v.displayName=l.ck.displayName,s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.Z0,{ref:t,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",a),...s})}).displayName=l.Z0.displayName},91032:function(e,t,a){a.d(t,{Ei:function(){return v},FF:function(){return x},Tu:function(){return p},bC:function(){return g},sw:function(){return d},ue:function(){return f},yo:function(){return c}});var r=a(57437),s=a(2265),l=a(70001),n=a(90535),i=a(32489),o=a(93448);let c=l.fC;l.xz;let d=l.x8,u=l.h_,m=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.aV,{className:(0,o.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...s,ref:t})});m.displayName=l.aV.displayName;let h=(0,n.j)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out overflow-hidden",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-full sm:w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-full sm:w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right"}},defaultVariants:{side:"right"}}),f=s.forwardRef((e,t)=>{let{side:a="right",className:s,children:n,hideDefaultClose:c=!1,...d}=e;return(0,r.jsxs)(u,{children:[(0,r.jsx)(m,{}),(0,r.jsxs)(l.VY,{ref:t,className:(0,o.cn)(h({side:a}),s),...d,children:[!c&&(0,r.jsxs)(l.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,r.jsx)(i.Z,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]}),n]})]})});f.displayName=l.VY.displayName;let p=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...a})};p.displayName="SheetHeader";let x=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,o.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};x.displayName="SheetFooter";let g=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.Dx,{ref:t,className:(0,o.cn)("text-lg font-semibold text-foreground",a),...s})});g.displayName=l.Dx.displayName;let v=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.dk,{ref:t,className:(0,o.cn)("text-sm text-muted-foreground",a),...s})});v.displayName=l.dk.displayName},94589:function(e,t,a){a.d(t,{r:function(){return i}});var r=a(57437),s=a(2265),l=a(50721),n=a(93448);let i=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(l.fC,{className:(0,n.cn)("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",a),...s,ref:t,children:(0,r.jsx)(l.bU,{className:(0,n.cn)("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});i.displayName=l.fC.displayName},23675:function(e,t,a){a.d(t,{g:function(){return n}});var r=a(57437),s=a(2265),l=a(93448);let n=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("textarea",{className:(0,l.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...s})});n.displayName="Textarea"},71488:function(e,t,a){a.d(t,{_v:function(){return d},aJ:function(){return c},pn:function(){return i},u:function(){return o}});var r=a(57437),s=a(2265),l=a(91668),n=a(93448);let i=l.zt,o=l.fC,c=l.xz,d=s.forwardRef((e,t)=>{let{className:a,sideOffset:s=4,...i}=e;return(0,r.jsx)(l.VY,{ref:t,sideOffset:s,className:(0,n.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...i})});d.displayName=l.VY.displayName},81853:function(e,t,a){a.d(t,{Ml:function(){return i},PY:function(){return n}});var r=a(57437),s=a(2265);let l=(0,s.createContext)({projectSettings:null,isMultiTenant:!1,isLoading:!0,refetch:()=>{}}),n=()=>s.useContext(l)||(console.warn("useProject used outside of ProjectContextProvider, using defaults"),{projectSettings:null,isMultiTenant:!1,isLoading:!1,refetch:()=>{}}),i=e=>{let{children:t,baasixClient:a}=e,[n,i]=(0,s.useState)(null),[o,c]=(0,s.useState)(!0),d=(0,s.useCallback)(async()=>{try{c(!0);let e=await a.server.info();i(null==e?void 0:e.project)}catch(e){console.error("Failed to fetch project settings",e)}finally{c(!1)}},[a]);(0,s.useEffect)(()=>{d()},[d]);let u=(null==n?void 0:n.multitenant)===!0||(null==n?void 0:n.multitenant)==="true";return(0,r.jsx)(l.Provider,{value:{projectSettings:n,isMultiTenant:u,isLoading:o,refetch:d},children:t})}},29696:function(e,t,a){a.d(t,{A1:function(){return o},I_:function(){return i}});var r=a(57437),s=a(2265),l=a(72135);let n=(0,s.createContext)(void 0),i=()=>{let e=(0,s.useContext)(n);if(!e)throw Error("useSchema must be used within a SchemaProvider");return e};function o(e){let{children:t}=e,{data:a,isLoading:s,refetch:i}=(0,l.sm)({resource:"collections",queryOptions:{enabled:!0},sorters:[{field:"collectionName",order:"asc"}],pagination:{pageSize:500}}),o=(null==a?void 0:a.data)||[],c=e=>o.find(t=>t.collectionName===e),d=e=>{let t=c(e),a=null==t?void 0:t.schema.fields;if(a){let t={...a};for(let[e,a]of Object.entries(t))a.hidden&&delete t[e];return"baasix_Account"===e&&(delete t.password,delete t.accessToken,delete t.refreshToken,delete t.idToken),"baasix_Verification"===e&&delete t.value,"baasix_Sessions"===e&&delete t.token,t}return a},u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(0===a)return[];let s=d(e);return s?Object.entries(s).map(e=>{let[s,l]=e,n=t?"".concat(t,".").concat(s):s,i=r?{title:l.relType?n+".*":n,value:l.relType?n+".*":n,key:l.relType?n+".*":n,isLeaf:!l.relType}:{title:n,value:n,key:n,isLeaf:!l.relType};return l.relType&&l.target&&(i.children=u(l.target,n,a-1,r)),i}):[]};return(0,r.jsx)(n.Provider,{value:{schemas:o,isLoading:s,refetch:i,getSchemaByName:c,getFieldsByCollection:d,getCollectionChoices:()=>o.map(e=>({label:e.schema.name,value:e.collectionName})),getTargetFields:e=>{let t=d(e);return t?Object.entries(t).map(e=>{let[t]=e;return{label:t,value:t}}):[]},formatRelationshipDisplay:(e,t)=>e&&t?null==t?void 0:t.split(",").map(t=>{let a=t.trim();return e[a]||a}).join(""):"",getNestedFields:e=>u(e),getPermissionFields:e=>[{title:"*",value:"*",key:"*",isLeaf:!0},...u(e,"",6,!0),{title:"*.*",value:"*.*",key:"*.*",isLeaf:!0},{title:"*.*.*",value:"*.*.*",key:"*.*.*",isLeaf:!0},{title:"*.*.*.*",value:"*.*.*.*",key:"*.*.*.*",isLeaf:!0}],isSortEnabled:e=>{var t;let a=c(e);return(null==a?void 0:null===(t=a.schema)||void 0===t?void 0:t.sortEnabled)===!0}},children:t})}}}]);
|