treege 3.0.0-beta.44 → 3.0.0-beta.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +16 -9
  2. package/dist/DefaultInputs-DYKtphqY.js +1701 -0
  3. package/dist/ThemeContext-O482h1XZ.js +1397 -0
  4. package/dist/editor/context/OpenApiContext.d.ts +79 -0
  5. package/dist/editor/context/TreegeEditorContext.d.ts +7 -0
  6. package/dist/editor/features/TreegeEditor/TreegeEditor.d.ts +1 -1
  7. package/dist/editor/features/TreegeEditor/dialogs/AuthorizeDialog.d.ts +20 -0
  8. package/dist/editor/features/TreegeEditor/dialogs/HeadersDialog.d.ts +19 -0
  9. package/dist/editor/features/TreegeEditor/dialogs/OpenApiDialog.d.ts +6 -0
  10. package/dist/editor/features/TreegeEditor/forms/OptionsSourceForm.d.ts +7 -0
  11. package/dist/editor/features/TreegeEditor/inputs/ApiUrlCombobox.d.ts +30 -0
  12. package/dist/editor/features/TreegeEditor/nodes/TreegeNode.d.ts +0 -1
  13. package/dist/editor/features/TreegeEditor/nodes/components/NodeImage.d.ts +5 -0
  14. package/dist/editor/features/TreegeEditor/nodes/components/NodeImageButton.d.ts +6 -0
  15. package/dist/editor/features/TreegeEditor/nodes/components/NodeOptions.d.ts +12 -0
  16. package/dist/editor/features/TreegeEditor/nodes/components/NodeRequiredButton.d.ts +6 -0
  17. package/dist/editor/features/TreegeEditor/panel/ActionsPanel.d.ts +5 -2
  18. package/dist/editor/types/editor.d.ts +39 -1
  19. package/dist/editor/types/openapi.d.ts +81 -0
  20. package/dist/editor/utils/openapi.d.ts +35 -0
  21. package/dist/editor-DBCMmZtt.js +5147 -0
  22. package/dist/editor.js +2 -2
  23. package/dist/main.js +4 -4
  24. package/dist/renderer/context/TreegeConfigContext.d.ts +3 -27
  25. package/dist/renderer/context/TreegeRendererContext.d.ts +99 -2
  26. package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputWrapper.d.ts +9 -0
  27. package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +3 -2
  28. package/dist/renderer/features/TreegeRenderer/web/TreegeRenderer.d.ts +1 -1
  29. package/dist/renderer/features/TreegeRenderer/web/components/DefaultFormWrapper.d.ts +1 -1
  30. package/dist/renderer/features/TreegeRenderer/web/components/DefaultInputWrapper.d.ts +9 -0
  31. package/dist/renderer/hooks/useInputOptions.d.ts +28 -0
  32. package/dist/renderer/hooks/useRenderNode.d.ts +7 -3
  33. package/dist/renderer/hooks/useSubmitHandler.d.ts +3 -2
  34. package/dist/renderer/types/renderer.d.ts +13 -25
  35. package/dist/renderer/utils/http.d.ts +29 -1
  36. package/dist/renderer/utils/submit.d.ts +3 -2
  37. package/dist/renderer-native.js +794 -782
  38. package/dist/renderer.js +3 -3
  39. package/dist/shared/components/ui/button.d.ts +1 -1
  40. package/dist/shared/components/ui/field.d.ts +24 -0
  41. package/dist/shared/components/ui/toggle-group.d.ts +7 -0
  42. package/dist/shared/components/ui/toggle.d.ts +9 -0
  43. package/dist/shared/locales/ar.json.d.ts +80 -0
  44. package/dist/shared/locales/de.json.d.ts +80 -0
  45. package/dist/shared/locales/en.json.d.ts +80 -0
  46. package/dist/shared/locales/es.json.d.ts +80 -0
  47. package/dist/shared/locales/fr.json.d.ts +80 -0
  48. package/dist/shared/locales/it.json.d.ts +80 -0
  49. package/dist/shared/locales/pt.json.d.ts +80 -0
  50. package/dist/shared/types/node.d.ts +44 -0
  51. package/package.json +3 -1
  52. package/dist/DefaultInputs-D6a1ESW-.js +0 -1562
  53. package/dist/ThemeContext-CUHjGVUf.js +0 -1602
  54. package/dist/editor/features/TreegeEditor/nodes/components/OptionsEditor.d.ts +0 -7
  55. package/dist/editor/features/TreegeEditor/nodes/components/RequiredBadge.d.ts +0 -6
  56. package/dist/editor-DjtjUgyb.js +0 -4041
@@ -1,4041 +0,0 @@
1
- import { A as e, E as t, F as n, I as r, L as i, N as a, P as o, T as s, j as c, k as l, t as u } from "./ThemeContext-CUHjGVUf.js";
2
- import { $ as d, A as f, B as p, F as m, G as h, H as g, I as _, J as v, K as y, L as ee, M as te, N as b, P as x, Q as ne, R as S, U as C, V as re, W as w, X as ie, Y as T, Z as ae, _ as E, at as D, c as O, et as k, it as A, j as oe, k as se, nt as j, o as ce, p as le, q as ue, rt as de, t as fe, tt as M, v as pe, z as me } from "./DefaultInputs-D6a1ESW-.js";
3
- import { Background as he, BackgroundVariant as ge, BaseEdge as _e, ControlButton as ve, Controls as ye, EdgeLabelRenderer as be, Handle as xe, MiniMap as Se, NodeResizer as Ce, Panel as we, Position as Te, ReactFlow as Ee, ReactFlowProvider as De, addEdge as Oe, getBezierPath as ke, useEdges as Ae, useNodes as je, useNodesInitialized as Me, useReactFlow as N, useStore as Ne } from "@xyflow/react";
4
- import { createContext as Pe, memo as Fe, useCallback as P, useContext as Ie, useEffect as Le, useId as Re, useMemo as ze, useRef as Be, useState as F } from "react";
5
- import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
6
- import { useForm as Ve } from "@tanstack/react-form";
7
- import { AlignLeft as He, ArrowRightFromLine as Ue, Boxes as We, Calendar as Ge, CalendarRange as Ke, CaseSensitive as qe, Check as Je, CheckSquare as Ye, ChevronDown as Xe, ChevronsUpDown as Ze, CircleDot as Qe, Clock as $e, ClockFading as et, Cloud as tt, Copy as nt, Download as rt, EllipsisVertical as it, EyeOff as at, Hash as ot, Heading as st, ImagePlus as ct, KeyRound as lt, Link2 as ut, ListFilter as dt, Loader2 as ft, MapPin as pt, MapPinMinusInside as mt, Minus as ht, MoreVertical as gt, Network as _t, Paperclip as vt, Plus as z, PlusCircle as yt, RectangleEllipsis as bt, Save as xt, Search as St, Send as Ct, Settings as wt, ToggleLeft as Tt, Trash2 as Et, Upload as Dt, Variable as Ot, WandSparkles as kt, Waypoints as At, X as B, XIcon as jt } from "lucide-react";
8
- import { Slot as Mt } from "@radix-ui/react-slot";
9
- import { cva as Nt } from "class-variance-authority";
10
- import * as Pt from "@radix-ui/react-scroll-area";
11
- import * as V from "@radix-ui/react-dropdown-menu";
12
- import * as Ft from "@radix-ui/react-dialog";
13
- import It from "@dagrejs/dagre";
14
- import { Toaster as Lt, toast as H } from "sonner";
15
- import * as Rt from "@radix-ui/react-collapsible";
16
- import { useTheme as zt } from "next-themes";
17
- //#region src/editor/assets/img/treege-black.svg
18
- var Bt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%200%20462%20144'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1809_3434)'%3e%3cpath%20d='M137%2041.34L116.57%206C116.22%205.39399%20115.717%204.89037%20115.112%204.53942C114.507%204.18847%20113.82%204.00247%20113.12%204H38.83C38.1303%204.00247%2037.4434%204.18847%2036.838%204.53942C36.2326%204.89037%2035.7299%205.39399%2035.38%206L15%2041.34C14.6495%2041.947%2014.4647%2042.6355%2014.4641%2043.3365C14.4635%2044.0374%2014.6471%2044.7262%2014.9965%2045.3339C15.3459%2045.9416%2015.8488%2046.4467%2016.455%2046.7988C17.0611%2047.1509%2017.7491%2047.3375%2018.45%2047.34H133.53C134.233%2047.341%20134.923%2047.157%20135.532%2046.8063C136.141%2046.4557%20136.647%2045.9508%20136.999%2045.3426C137.35%2044.7343%20137.536%2044.0441%20137.536%2043.3415C137.536%2042.6388%20137.351%2041.9485%20137%2041.34V41.34Z'%20fill='%2311D3B4'/%3e%3cpath%20d='M92.48%20140.64H113.1C113.805%20140.643%20114.498%20140.459%20115.109%20140.108C115.72%20139.757%20116.228%20139.251%20116.58%20138.64L151.39%2078.3401C151.741%2077.7316%20151.926%2077.0413%20151.926%2076.3386C151.926%2075.636%20151.74%2074.9458%20151.389%2074.3375C151.037%2073.7293%20150.531%2073.2244%20149.922%2072.8738C149.313%2072.5231%20148.623%2072.3391%20147.92%2072.3401H92.48C91.4191%2072.3401%2090.4017%2072.7615%2089.6516%2073.5117C88.9014%2074.2618%2088.48%2075.2792%2088.48%2076.3401V136.64C88.48%20137.701%2088.9014%20138.718%2089.6516%20139.469C90.4017%20140.219%2091.4191%20140.64%2092.48%20140.64Z'%20fill='%23007EF6'/%3e%3cpath%20d='M59.48%2072.3201H3.99999C3.29819%2072.3208%202.60893%2072.5061%202.00143%2072.8575C1.39392%2073.2089%200.88955%2073.7139%200.538962%2074.3218C0.188375%2074.9298%200.00390931%2075.6193%200.00408949%2076.3211C0.00426966%2077.0229%200.189089%2077.7123%200.539989%2078.3201L35.38%20138.66C35.7299%20139.266%2036.2326%20139.77%2036.838%20140.121C37.4434%20140.472%2038.1302%20140.658%2038.83%20140.66H59.48C60.5409%20140.66%2061.5583%20140.239%2062.3084%20139.489C63.0586%20138.738%2063.48%20137.721%2063.48%20136.66V76.3101C63.4773%2075.2509%2063.0547%2074.2361%2062.3049%2073.4881C61.555%2072.7401%2060.5391%2072.3201%2059.48%2072.3201V72.3201Z'%20fill='%230164A8'/%3e%3c/g%3e%3cpath%20d='M207.52%20106.96C202.272%20106.96%20198.368%20105.584%20195.808%20102.832C193.312%20100.08%20192.064%2096.336%20192.064%2091.6V70.48H185.632V60.496H192.064V50.704L205.024%2046.864V60.496H216.544L215.776%2070.48H205.024V90.736C205.024%2093.232%20205.6%2094.96%20206.752%2095.92C207.904%2096.816%20209.696%2097.264%20212.128%2097.264C213.92%2097.264%20215.776%2096.944%20217.696%2096.304V105.232C216.288%20105.808%20214.752%20106.224%20213.088%20106.48C211.424%20106.8%20209.568%20106.96%20207.52%20106.96ZM224.347%20106V60.496H236.347L236.923%2065.2C238.971%2063.92%20241.499%2062.768%20244.507%2061.744C247.579%2060.656%20250.587%2059.92%20253.531%2059.536V69.328C251.803%2069.584%20249.915%2069.968%20247.867%2070.48C245.819%2070.992%20243.867%2071.568%20242.011%2072.208C240.155%2072.848%20238.587%2073.52%20237.307%2074.224V106H224.347ZM281.997%20106.96C274.125%20106.96%20267.885%20105.008%20263.277%20101.104C258.669%2097.136%20256.365%2091.152%20256.365%2083.152C256.365%2075.92%20258.285%2070.192%20262.125%2065.968C266.029%2061.68%20271.821%2059.536%20279.501%2059.536C286.541%2059.536%20291.917%2061.392%20295.629%2065.104C299.405%2068.752%20301.292%2073.552%20301.292%2079.504V87.76H268.365C269.069%2091.408%20270.733%2093.904%20273.357%2095.248C276.045%2096.592%20279.821%2097.264%20284.685%2097.264C287.117%2097.264%20289.581%2097.04%20292.077%2096.592C294.637%2096.144%20296.813%2095.568%20298.605%2094.864V104.08C296.493%20105.04%20294.029%20105.744%20291.213%20106.192C288.397%20106.704%20285.325%20106.96%20281.997%20106.96ZM268.365%2079.792H289.965V77.296C289.965%2074.672%20289.197%2072.624%20287.661%2071.152C286.125%2069.616%20283.533%2068.848%20279.885%2068.848C275.597%2068.848%20272.589%2069.712%20270.861%2071.44C269.197%2073.168%20268.365%2075.952%20268.365%2079.792ZM334.028%20106.96C326.156%20106.96%20319.916%20105.008%20315.308%20101.104C310.7%2097.136%20308.396%2091.152%20308.396%2083.152C308.396%2075.92%20310.316%2070.192%20314.156%2065.968C318.06%2061.68%20323.852%2059.536%20331.532%2059.536C338.572%2059.536%20343.948%2061.392%20347.66%2065.104C351.436%2068.752%20353.324%2073.552%20353.324%2079.504V87.76H320.396C321.1%2091.408%20322.764%2093.904%20325.388%2095.248C328.076%2096.592%20331.852%2097.264%20336.716%2097.264C339.148%2097.264%20341.612%2097.04%20344.108%2096.592C346.668%2096.144%20348.844%2095.568%20350.636%2094.864V104.08C348.524%20105.04%20346.06%20105.744%20343.244%20106.192C340.428%20106.704%20337.356%20106.96%20334.028%20106.96ZM320.396%2079.792H341.996V77.296C341.996%2074.672%20341.228%2072.624%20339.692%2071.152C338.156%2069.616%20335.564%2068.848%20331.916%2068.848C327.628%2068.848%20324.62%2069.712%20322.892%2071.44C321.228%2073.168%20320.396%2075.952%20320.396%2079.792ZM381.547%20122.896C378.155%20122.896%20374.667%20122.672%20371.083%20122.224C367.563%20121.776%20364.587%20121.136%20362.155%20120.304V110.608C364.715%20111.44%20367.723%20112.08%20371.179%20112.528C374.635%20113.04%20377.867%20113.296%20380.875%20113.296C385.291%20113.296%20388.491%20113.04%20390.475%20112.528C392.459%20112.08%20393.451%20111.248%20393.451%20110.032C393.451%20109.008%20393.003%20108.304%20392.107%20107.92C391.275%20107.536%20389.483%20107.344%20386.731%20107.344H374.347C366.219%20107.344%20362.155%20104.336%20362.155%2098.32C362.155%2096.464%20362.667%2094.768%20363.691%2093.232C364.715%2091.696%20366.347%2090.48%20368.587%2089.584C363.403%2086.96%20360.811%2082.544%20360.811%2076.336C360.811%2070.448%20362.635%2066.192%20366.283%2063.568C369.931%2060.88%20375.339%2059.536%20382.507%2059.536C383.979%2059.536%20385.579%2059.664%20387.307%2059.92C389.099%2060.112%20390.443%2060.304%20391.339%2060.496H408.427L408.139%2068.656H400.939C402.923%2070.512%20403.915%2073.104%20403.915%2076.432C403.915%2081.104%20402.443%2084.848%20399.499%2087.664C396.555%2090.416%20392.203%2091.792%20386.443%2091.792C385.419%2091.792%20384.427%2091.76%20383.467%2091.696C382.571%2091.568%20381.643%2091.44%20380.683%2091.312C378.763%2091.568%20377.131%2092.016%20375.787%2092.656C374.507%2093.296%20373.867%2094.16%20373.867%2095.248C373.867%2096.72%20375.179%2097.456%20377.803%2097.456H390.667C395.275%2097.456%20398.827%2098.512%20401.323%20100.624C403.819%20102.672%20405.067%20105.68%20405.067%20109.648C405.067%20114.128%20403.051%20117.456%20399.019%20119.632C394.987%20121.808%20389.163%20122.896%20381.547%20122.896ZM382.603%2084.496C386.443%2084.496%20389.099%2083.856%20390.571%2082.576C392.107%2081.232%20392.875%2078.992%20392.875%2075.856C392.875%2072.72%20392.107%2070.448%20390.571%2069.04C389.099%2067.632%20386.443%2066.928%20382.603%2066.928C378.955%2066.928%20376.331%2067.632%20374.731%2069.04C373.131%2070.384%20372.331%2072.656%20372.331%2075.856C372.331%2078.8%20373.067%2080.976%20374.539%2082.384C376.075%2083.792%20378.763%2084.496%20382.603%2084.496ZM439.028%20106.96C431.156%20106.96%20424.916%20105.008%20420.308%20101.104C415.7%2097.136%20413.396%2091.152%20413.396%2083.152C413.396%2075.92%20415.316%2070.192%20419.156%2065.968C423.06%2061.68%20428.852%2059.536%20436.532%2059.536C443.572%2059.536%20448.948%2061.392%20452.66%2065.104C456.436%2068.752%20458.324%2073.552%20458.324%2079.504V87.76H425.396C426.1%2091.408%20427.764%2093.904%20430.388%2095.248C433.076%2096.592%20436.852%2097.264%20441.716%2097.264C444.148%2097.264%20446.612%2097.04%20449.108%2096.592C451.668%2096.144%20453.844%2095.568%20455.636%2094.864V104.08C453.524%20105.04%20451.06%20105.744%20448.244%20106.192C445.428%20106.704%20442.356%20106.96%20439.028%20106.96ZM425.396%2079.792H446.996V77.296C446.996%2074.672%20446.228%2072.624%20444.692%2071.152C443.156%2069.616%20440.564%2068.848%20436.916%2068.848C432.628%2068.848%20429.62%2069.712%20427.892%2071.44C426.228%2073.168%20425.396%2075.952%20425.396%2079.792Z'%20fill='black'/%3e%3cdefs%3e%3cclipPath%20id='clip0_1809_3434'%3e%3crect%20width='151.93'%20height='136.64'%20fill='white'%20transform='translate(0%204)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", Vt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%200%20462%20144'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2_65)'%3e%3cpath%20d='M137%2041.34L116.57%206C116.22%205.39399%20115.717%204.89037%20115.112%204.53942C114.507%204.18847%20113.82%204.00247%20113.12%204H38.83C38.1302%204.00247%2037.4434%204.18847%2036.838%204.53942C36.2326%204.89037%2035.7299%205.39399%2035.38%206L15%2041.34C14.6495%2041.947%2014.4647%2042.6355%2014.4641%2043.3365C14.4635%2044.0374%2014.6471%2044.7262%2014.9965%2045.3339C15.3459%2045.9416%2015.8488%2046.4467%2016.4549%2046.7988C17.061%2047.1509%2017.749%2047.3375%2018.45%2047.34H133.53C134.233%2047.341%20134.923%2047.157%20135.532%2046.8063C136.141%2046.4557%20136.647%2045.9508%20136.999%2045.3426C137.35%2044.7343%20137.536%2044.0441%20137.536%2043.3415C137.536%2042.6388%20137.351%2041.9485%20137%2041.34Z'%20fill='%2311D3B4'/%3e%3cpath%20d='M92.48%20140.64H113.1C113.805%20140.643%20114.498%20140.459%20115.109%20140.108C115.72%20139.757%20116.228%20139.25%20116.58%20138.64L151.39%2078.34C151.741%2077.7315%20151.926%2077.0412%20151.926%2076.3385C151.926%2075.6359%20151.74%2074.9457%20151.389%2074.3374C151.037%2073.7292%20150.531%2073.2243%20149.922%2072.8737C149.313%2072.523%20148.623%2072.339%20147.92%2072.34H92.48C91.4191%2072.34%2090.4017%2072.7614%2089.6516%2073.5116C88.9014%2074.2617%2088.48%2075.2791%2088.48%2076.34V136.64C88.48%20137.701%2088.9014%20138.718%2089.6516%20139.468C90.4017%20140.219%2091.4191%20140.64%2092.48%20140.64Z'%20fill='%23007EF6'/%3e%3cpath%20d='M59.48%2072.32H4C3.2982%2072.3207%202.60894%2072.5061%202.00143%2072.8574C1.39393%2073.2088%200.889558%2073.7138%200.53897%2074.3218C0.188382%2074.9297%200.00391694%2075.6192%200.00409712%2076.321C0.00427729%2077.0228%200.189097%2077.7122%200.539997%2078.32L35.38%20138.66C35.7299%20139.266%2036.2326%20139.77%2036.838%20140.121C37.4434%20140.472%2038.1302%20140.658%2038.83%20140.66H59.48C60.5409%20140.66%2061.5583%20140.239%2062.3084%20139.488C63.0586%20138.738%2063.48%20137.721%2063.48%20136.66V76.31C63.4773%2075.2509%2063.0548%2074.236%2062.3049%2073.488C61.555%2072.7401%2060.5391%2072.32%2059.48%2072.32Z'%20fill='%230164A8'/%3e%3c/g%3e%3cpath%20d='M207.52%20106.96C202.272%20106.96%20198.368%20105.584%20195.808%20102.832C193.312%20100.08%20192.064%2096.336%20192.064%2091.6V70.48H185.632V60.496H192.064V50.704L205.024%2046.864V60.496H216.544L215.776%2070.48H205.024V90.736C205.024%2093.232%20205.6%2094.96%20206.752%2095.92C207.904%2096.816%20209.696%2097.264%20212.128%2097.264C213.92%2097.264%20215.776%2096.944%20217.696%2096.304V105.232C216.288%20105.808%20214.752%20106.224%20213.088%20106.48C211.424%20106.8%20209.568%20106.96%20207.52%20106.96ZM224.347%20106V60.496H236.347L236.923%2065.2C238.971%2063.92%20241.499%2062.768%20244.507%2061.744C247.579%2060.656%20250.587%2059.92%20253.531%2059.536V69.328C251.803%2069.584%20249.915%2069.968%20247.867%2070.48C245.819%2070.992%20243.867%2071.568%20242.011%2072.208C240.155%2072.848%20238.587%2073.52%20237.307%2074.224V106H224.347ZM281.997%20106.96C274.125%20106.96%20267.885%20105.008%20263.277%20101.104C258.669%2097.136%20256.365%2091.152%20256.365%2083.152C256.365%2075.92%20258.285%2070.192%20262.125%2065.968C266.029%2061.68%20271.821%2059.536%20279.501%2059.536C286.541%2059.536%20291.917%2061.392%20295.629%2065.104C299.405%2068.752%20301.292%2073.552%20301.292%2079.504V87.76H268.365C269.069%2091.408%20270.733%2093.904%20273.357%2095.248C276.045%2096.592%20279.821%2097.264%20284.685%2097.264C287.117%2097.264%20289.581%2097.04%20292.077%2096.592C294.637%2096.144%20296.813%2095.568%20298.605%2094.864V104.08C296.493%20105.04%20294.029%20105.744%20291.213%20106.192C288.397%20106.704%20285.325%20106.96%20281.997%20106.96ZM268.365%2079.792H289.965V77.296C289.965%2074.672%20289.197%2072.624%20287.661%2071.152C286.125%2069.616%20283.533%2068.848%20279.885%2068.848C275.597%2068.848%20272.589%2069.712%20270.861%2071.44C269.197%2073.168%20268.365%2075.952%20268.365%2079.792ZM334.028%20106.96C326.156%20106.96%20319.916%20105.008%20315.308%20101.104C310.7%2097.136%20308.396%2091.152%20308.396%2083.152C308.396%2075.92%20310.316%2070.192%20314.156%2065.968C318.06%2061.68%20323.852%2059.536%20331.532%2059.536C338.572%2059.536%20343.948%2061.392%20347.66%2065.104C351.436%2068.752%20353.324%2073.552%20353.324%2079.504V87.76H320.396C321.1%2091.408%20322.764%2093.904%20325.388%2095.248C328.076%2096.592%20331.852%2097.264%20336.716%2097.264C339.148%2097.264%20341.612%2097.04%20344.108%2096.592C346.668%2096.144%20348.844%2095.568%20350.636%2094.864V104.08C348.524%20105.04%20346.06%20105.744%20343.244%20106.192C340.428%20106.704%20337.356%20106.96%20334.028%20106.96ZM320.396%2079.792H341.996V77.296C341.996%2074.672%20341.228%2072.624%20339.692%2071.152C338.156%2069.616%20335.564%2068.848%20331.916%2068.848C327.628%2068.848%20324.62%2069.712%20322.892%2071.44C321.228%2073.168%20320.396%2075.952%20320.396%2079.792ZM381.547%20122.896C378.155%20122.896%20374.667%20122.672%20371.083%20122.224C367.563%20121.776%20364.587%20121.136%20362.155%20120.304V110.608C364.715%20111.44%20367.723%20112.08%20371.179%20112.528C374.635%20113.04%20377.867%20113.296%20380.875%20113.296C385.291%20113.296%20388.491%20113.04%20390.475%20112.528C392.459%20112.08%20393.451%20111.248%20393.451%20110.032C393.451%20109.008%20393.003%20108.304%20392.107%20107.92C391.275%20107.536%20389.483%20107.344%20386.731%20107.344H374.347C366.219%20107.344%20362.155%20104.336%20362.155%2098.32C362.155%2096.464%20362.667%2094.768%20363.691%2093.232C364.715%2091.696%20366.347%2090.48%20368.587%2089.584C363.403%2086.96%20360.811%2082.544%20360.811%2076.336C360.811%2070.448%20362.635%2066.192%20366.283%2063.568C369.931%2060.88%20375.339%2059.536%20382.507%2059.536C383.979%2059.536%20385.579%2059.664%20387.307%2059.92C389.099%2060.112%20390.443%2060.304%20391.339%2060.496H408.427L408.139%2068.656H400.939C402.923%2070.512%20403.915%2073.104%20403.915%2076.432C403.915%2081.104%20402.443%2084.848%20399.499%2087.664C396.555%2090.416%20392.203%2091.792%20386.443%2091.792C385.419%2091.792%20384.427%2091.76%20383.467%2091.696C382.571%2091.568%20381.643%2091.44%20380.683%2091.312C378.763%2091.568%20377.131%2092.016%20375.787%2092.656C374.507%2093.296%20373.867%2094.16%20373.867%2095.248C373.867%2096.72%20375.179%2097.456%20377.803%2097.456H390.667C395.275%2097.456%20398.827%2098.512%20401.323%20100.624C403.819%20102.672%20405.067%20105.68%20405.067%20109.648C405.067%20114.128%20403.051%20117.456%20399.019%20119.632C394.987%20121.808%20389.163%20122.896%20381.547%20122.896ZM382.603%2084.496C386.443%2084.496%20389.099%2083.856%20390.571%2082.576C392.107%2081.232%20392.875%2078.992%20392.875%2075.856C392.875%2072.72%20392.107%2070.448%20390.571%2069.04C389.099%2067.632%20386.443%2066.928%20382.603%2066.928C378.955%2066.928%20376.331%2067.632%20374.731%2069.04C373.131%2070.384%20372.331%2072.656%20372.331%2075.856C372.331%2078.8%20373.067%2080.976%20374.539%2082.384C376.075%2083.792%20378.763%2084.496%20382.603%2084.496ZM439.028%20106.96C431.156%20106.96%20424.916%20105.008%20420.308%20101.104C415.7%2097.136%20413.396%2091.152%20413.396%2083.152C413.396%2075.92%20415.316%2070.192%20419.156%2065.968C423.06%2061.68%20428.852%2059.536%20436.532%2059.536C443.572%2059.536%20448.948%2061.392%20452.66%2065.104C456.436%2068.752%20458.324%2073.552%20458.324%2079.504V87.76H425.396C426.1%2091.408%20427.764%2093.904%20430.388%2095.248C433.076%2096.592%20436.852%2097.264%20441.716%2097.264C444.148%2097.264%20446.612%2097.04%20449.108%2096.592C451.668%2096.144%20453.844%2095.568%20455.636%2094.864V104.08C453.524%20105.04%20451.06%20105.744%20448.244%20106.192C445.428%20106.704%20442.356%20106.96%20439.028%20106.96ZM425.396%2079.792H446.996V77.296C446.996%2074.672%20446.228%2072.624%20444.692%2071.152C443.156%2069.616%20440.564%2068.848%20436.916%2068.848C432.628%2068.848%20429.62%2069.712%20427.892%2071.44C426.228%2073.168%20425.396%2075.952%20425.396%2079.792Z'%20fill='white'/%3e%3cdefs%3e%3cclipPath%20id='clip0_2_65'%3e%3crect%20width='151.93'%20height='136.64'%20fill='white'%20transform='translate(0%204)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", Ht = ({ theme: e = "dark" }) => /* @__PURE__ */ L("div", {
19
- className: "tg:absolute tg:top-4 tg:left-5 tg:z-50 tg:select-none tg:md:top-5",
20
- children: /* @__PURE__ */ L("img", {
21
- src: e === "dark" ? Vt : Bt,
22
- alt: "Treege",
23
- className: "tg:relative tg:h-7 tg:w-auto tg:drop-shadow-[0_0px_35px] tg:drop-shadow-blue-600 tg:md:h-14"
24
- })
25
- }), Ut = "/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-outline-style:solid;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}.react-flow{--xy-edge-stroke-default:#b1b1b7;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#555;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:#ffffff80;--xy-minimap-background-color-default:#fff;--xy-minimap-mask-background-color-default:#f0f0f099;--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#e2e2e2;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:transparent;--xy-background-pattern-dots-color-default:#91919a;--xy-background-pattern-lines-color-default:#eee;--xy-background-pattern-cross-color-default:#e2e2e2;background-color:var(--xy-background-color,var(--xy-background-color-default));--xy-node-border-default:1px solid #bbb;--xy-node-border-selected-default:1px solid #555;--xy-handle-background-color-default:#333;--xy-selection-background-color-default:#9696b41a;--xy-selection-border-default:1px dotted #9b9b9bcc;--xy-resize-background-color-default:#3367d9;direction:ltr}.react-flow.dark{--xy-edge-stroke-default:#3e3e3e;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#727272;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:#96969640;--xy-minimap-background-color-default:#141414;--xy-minimap-mask-background-color-default:#3c3c3c99;--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#2b2b2b;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:#141414;--xy-background-pattern-dots-color-default:#777;--xy-background-pattern-lines-color-default:#777;--xy-background-pattern-cross-color-default:#777;--xy-node-color-default:#f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props,var(--xy-background-color,var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__pane{z-index:1}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width,var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke,var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width,var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{pointer-events:none;position:absolute;overflow:visible}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected,var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}svg.react-flow__connectionline{z-index:1001;position:absolute;overflow:visible}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.react-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.react-flow__handle{pointer-events:none;background-color:var(--xy-handle-background-color,var(--xy-handle-background-color-default));min-width:5px;min-height:5px;position:absolute}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;bottom:0;left:50%;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{z-index:5;margin:15px;position:absolute}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px)translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px)translateY(-50%)}.react-flow__attribution{background:var(--xy-attribution-background-color,var(--xy-attribution-background-color-default));margin:0;padding:2px 3px;font-size:10px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.react-flow__edgelabel-renderer{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__viewport-portal{-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__minimap{background:var(--xy-minimap-background-color-props,var(--xy-minimap-background-color,var(--xy-minimap-background-color-default)))}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var(--xy-minimap-mask-background-color-props,var(--xy-minimap-mask-background-color,var(--xy-minimap-mask-background-color-default)));stroke:var(--xy-minimap-mask-stroke-color-props,var(--xy-minimap-mask-stroke-color,var(--xy-minimap-mask-stroke-color-default)));stroke-width:var(--xy-minimap-mask-stroke-width-props,var(--xy-minimap-mask-stroke-width,var(--xy-minimap-mask-stroke-width-default)))}.react-flow__minimap-node{fill:var(--xy-minimap-node-background-color-props,var(--xy-minimap-node-background-color,var(--xy-minimap-node-background-color-default)));stroke:var(--xy-minimap-node-stroke-color-props,var(--xy-minimap-node-stroke-color,var(--xy-minimap-node-stroke-color-default)));stroke-width:var(--xy-minimap-node-stroke-width-props,var(--xy-minimap-node-stroke-width,var(--xy-minimap-node-stroke-width-default)))}.react-flow__background-pattern.dots{fill:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-dots-color-default)))}.react-flow__background-pattern.lines{stroke:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-lines-color-default)))}.react-flow__background-pattern.cross{stroke:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-cross-color-default)))}.react-flow__controls{flex-direction:column;display:flex}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{justify-content:center;align-items:center;width:26px;height:26px;padding:4px;display:flex}.react-flow__controls-button svg{fill:currentColor;width:100%;max-width:12px;max-height:12px}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{border:var(--xy-node-border,var(--xy-node-border-default));color:var(--xy-node-color,var(--xy-node-color-default))}.react-flow__node-input.selected,.react-flow__node-input:focus,.react-flow__node-input:focus-visible,.react-flow__node-default.selected,.react-flow__node-default:focus,.react-flow__node-default:focus-visible,.react-flow__node-output.selected,.react-flow__node-output:focus,.react-flow__node-output:focus-visible,.react-flow__node-group.selected,.react-flow__node-group:focus,.react-flow__node-group:focus-visible{border:var(--xy-node-border-selected,var(--xy-node-border-selected-default));outline:none}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color,var(--xy-selection-background-color-default));border:var(--xy-selection-border,var(--xy-selection-border-default))}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border:1px solid #fff;border-radius:1px;width:5px;height:5px;translate:-50% -50%}.react-flow__resize-control.handle.left{top:50%;left:0}.react-flow__resize-control.handle.right{top:50%;left:100%}.react-flow__resize-control.handle.top{top:0;left:50%}.react-flow__resize-control.handle.bottom{top:100%;left:50%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border-style:solid;border-width:0}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;height:100%;top:0;transform:translate(-50%)}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{width:100%;height:1px;left:0;transform:translateY(-50%)}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}@layer theme{:root,:host{--tg-font-sans:ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";--tg-font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;--tg-color-red-500:oklch(63.7% .237 25.331);--tg-color-blue-300:oklch(80.9% .105 251.813);--tg-color-blue-500:oklch(62.3% .214 259.815);--tg-color-blue-600:oklch(54.6% .245 262.881);--tg-color-purple-600:oklch(55.8% .288 302.321);--tg-color-purple-700:oklch(49.6% .265 301.924);--tg-color-gray-300:oklch(87.2% .01 258.338);--tg-color-gray-400:oklch(70.7% .022 261.325);--tg-color-gray-500:oklch(55.1% .027 264.364);--tg-color-black:#000;--tg-color-white:#fff;--tg-spacing:.25rem;--tg-container-sm:24rem;--tg-container-lg:32rem;--tg-container-2xl:42rem;--tg-text-xs:.75rem;--tg-text-xs--line-height:calc(1 / .75);--tg-text-sm:.875rem;--tg-text-sm--line-height:calc(1.25 / .875);--tg-text-base:1rem;--tg-text-base--line-height:calc(1.5 / 1);--tg-text-lg:1.125rem;--tg-text-lg--line-height:calc(1.75 / 1.125);--tg-text-2xl:1.5rem;--tg-text-2xl--line-height:calc(2 / 1.5);--tg-font-weight-light:300;--tg-font-weight-normal:400;--tg-font-weight-medium:500;--tg-font-weight-semibold:600;--tg-font-weight-bold:700;--tg-tracking-widest:.1em;--tg-radius-xs:.125rem;--tg-ease-in-out:cubic-bezier(.4, 0, .2, 1);--tg-animate-spin:spin 1s linear infinite;--tg-default-transition-duration:.15s;--tg-default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--tg-default-font-family:var(--tg-font-sans);--tg-default-mono-font-family:var(--tg-font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--tg-default-font-family,ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");font-feature-settings:var(--tg-default-font-feature-settings,normal);font-variation-settings:var(--tg-default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--tg-default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);font-feature-settings:var(--tg-default-mono-font-feature-settings,normal);font-variation-settings:var(--tg-default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--treege-border)}body{color:var(--treege-foreground)}}@layer components;@layer utilities{.tg\\:pointer-events-none{pointer-events:none}.tg\\:invisible{visibility:hidden}.tg\\:sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.tg\\:absolute{position:absolute}.tg\\:fixed{position:fixed}.tg\\:relative{position:relative}.tg\\:inset-0{inset:calc(var(--tg-spacing) * 0)}.tg\\:inset-x-0{inset-inline:calc(var(--tg-spacing) * 0)}.tg\\:inset-y-0{inset-block:calc(var(--tg-spacing) * 0)}.tg\\:-top-1{top:calc(var(--tg-spacing) * -1)}.tg\\:-top-3\\.5{top:calc(var(--tg-spacing) * -3.5)}.tg\\:top-0{top:calc(var(--tg-spacing) * 0)}.tg\\:top-1\\/2{top:50%}.tg\\:top-2{top:calc(var(--tg-spacing) * 2)}.tg\\:top-4{top:calc(var(--tg-spacing) * 4)}.tg\\:top-\\[50\\%\\]{top:50%}.tg\\:-right-1{right:calc(var(--tg-spacing) * -1)}.tg\\:right-0{right:calc(var(--tg-spacing) * 0)}.tg\\:right-2{right:calc(var(--tg-spacing) * 2)}.tg\\:right-3{right:calc(var(--tg-spacing) * 3)}.tg\\:right-4{right:calc(var(--tg-spacing) * 4)}.tg\\:bottom-0{bottom:calc(var(--tg-spacing) * 0)}.tg\\:left-0{left:calc(var(--tg-spacing) * 0)}.tg\\:left-1\\/2{left:50%}.tg\\:left-2{left:calc(var(--tg-spacing) * 2)}.tg\\:left-5{left:calc(var(--tg-spacing) * 5)}.tg\\:left-6{left:calc(var(--tg-spacing) * 6)}.tg\\:left-\\[50\\%\\]{left:50%}.tg\\:z-50{z-index:50}.tg\\:-mx-1{margin-inline:calc(var(--tg-spacing) * -1)}.tg\\:mx-auto{margin-inline:auto}.tg\\:my-1{margin-block:calc(var(--tg-spacing) * 1)}.tg\\:my-4{margin-block:calc(var(--tg-spacing) * 4)}.tg\\:my-8{margin-block:calc(var(--tg-spacing) * 8)}.tg\\:mt-0\\.5{margin-top:calc(var(--tg-spacing) * .5)}.tg\\:mt-1{margin-top:calc(var(--tg-spacing) * 1)}.tg\\:mt-2{margin-top:calc(var(--tg-spacing) * 2)}.tg\\:mt-4{margin-top:calc(var(--tg-spacing) * 4)}.tg\\:mt-8{margin-top:calc(var(--tg-spacing) * 8)}.tg\\:mt-10{margin-top:calc(var(--tg-spacing) * 10)}.tg\\:mt-auto{margin-top:auto}.tg\\:mr-1{margin-right:calc(var(--tg-spacing) * 1)}.tg\\:mr-2{margin-right:calc(var(--tg-spacing) * 2)}.tg\\:mb-1{margin-bottom:calc(var(--tg-spacing) * 1)}.tg\\:mb-2{margin-bottom:calc(var(--tg-spacing) * 2)}.tg\\:mb-4{margin-bottom:calc(var(--tg-spacing) * 4)}.tg\\:mb-5{margin-bottom:calc(var(--tg-spacing) * 5)}.tg\\:mb-6{margin-bottom:calc(var(--tg-spacing) * 6)}.tg\\:mb-10{margin-bottom:calc(var(--tg-spacing) * 10)}.tg\\:ml-1{margin-left:calc(var(--tg-spacing) * 1)}.tg\\:ml-2{margin-left:calc(var(--tg-spacing) * 2)}.tg\\:ml-4{margin-left:calc(var(--tg-spacing) * 4)}.tg\\:ml-auto{margin-left:auto}.tg\\:block{display:block}.tg\\:flex{display:flex}.tg\\:grid{display:grid}.tg\\:hidden{display:none}.tg\\:inline-flex{display:inline-flex}.tg\\:field-sizing-content{field-sizing:content}.tg\\:aspect-square{aspect-ratio:1}.tg\\:size-\\(--cell-size\\){width:var(--cell-size);height:var(--cell-size)}.tg\\:size-2{width:calc(var(--tg-spacing) * 2);height:calc(var(--tg-spacing) * 2)}.tg\\:size-2\\.5{width:calc(var(--tg-spacing) * 2.5);height:calc(var(--tg-spacing) * 2.5)}.tg\\:size-3{width:calc(var(--tg-spacing) * 3);height:calc(var(--tg-spacing) * 3)}.tg\\:size-3\\.5{width:calc(var(--tg-spacing) * 3.5);height:calc(var(--tg-spacing) * 3.5)}.tg\\:size-4{width:calc(var(--tg-spacing) * 4);height:calc(var(--tg-spacing) * 4)}.tg\\:size-8{width:calc(var(--tg-spacing) * 8);height:calc(var(--tg-spacing) * 8)}.tg\\:size-9{width:calc(var(--tg-spacing) * 9);height:calc(var(--tg-spacing) * 9)}.tg\\:size-10{width:calc(var(--tg-spacing) * 10);height:calc(var(--tg-spacing) * 10)}.tg\\:size-auto{width:auto;height:auto}.tg\\:size-full{width:100%;height:100%}.tg\\:\\!h-3{height:calc(var(--tg-spacing) * 3)!important}.tg\\:h-\\(--cell-size\\){height:var(--cell-size)}.tg\\:h-0{height:calc(var(--tg-spacing) * 0)}.tg\\:h-2\\.5{height:calc(var(--tg-spacing) * 2.5)}.tg\\:h-3{height:calc(var(--tg-spacing) * 3)}.tg\\:h-3\\.5{height:calc(var(--tg-spacing) * 3.5)}.tg\\:h-4{height:calc(var(--tg-spacing) * 4)}.tg\\:h-6{height:calc(var(--tg-spacing) * 6)}.tg\\:h-6\\!{height:calc(var(--tg-spacing) * 6)!important}.tg\\:h-7{height:calc(var(--tg-spacing) * 7)}.tg\\:h-8{height:calc(var(--tg-spacing) * 8)}.tg\\:h-9{height:calc(var(--tg-spacing) * 9)}.tg\\:h-10{height:calc(var(--tg-spacing) * 10)}.tg\\:h-12{height:calc(var(--tg-spacing) * 12)}.tg\\:h-\\[1\\.15rem\\]{height:1.15rem}.tg\\:h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.tg\\:h-auto{height:auto}.tg\\:h-full{height:100%}.tg\\:h-px{height:1px}.tg\\:h-screen{height:100vh}.tg\\:max-h-\\(--radix-dropdown-menu-content-available-height\\){max-height:var(--radix-dropdown-menu-content-available-height)}.tg\\:max-h-\\(--radix-select-content-available-height\\){max-height:var(--radix-select-content-available-height)}.tg\\:max-h-80{max-height:calc(var(--tg-spacing) * 80)}.tg\\:max-h-150{max-height:calc(var(--tg-spacing) * 150)}.tg\\:max-h-\\[300px\\]{max-height:300px}.tg\\:min-h-0{min-height:calc(var(--tg-spacing) * 0)}.tg\\:min-h-16{min-height:calc(var(--tg-spacing) * 16)}.tg\\:\\!w-3{width:calc(var(--tg-spacing) * 3)!important}.tg\\:w-\\(--cell-size\\){width:var(--cell-size)}.tg\\:w-0{width:calc(var(--tg-spacing) * 0)}.tg\\:w-2\\.5{width:calc(var(--tg-spacing) * 2.5)}.tg\\:w-3{width:calc(var(--tg-spacing) * 3)}.tg\\:w-3\\.5{width:calc(var(--tg-spacing) * 3.5)}.tg\\:w-3\\/4{width:75%}.tg\\:w-4{width:calc(var(--tg-spacing) * 4)}.tg\\:w-4\\/12{width:33.3333%}.tg\\:w-6{width:calc(var(--tg-spacing) * 6)}.tg\\:w-6\\!{width:calc(var(--tg-spacing) * 6)!important}.tg\\:w-8{width:calc(var(--tg-spacing) * 8)}.tg\\:w-8\\/12{width:66.6667%}.tg\\:w-9{width:calc(var(--tg-spacing) * 9)}.tg\\:w-10{width:calc(var(--tg-spacing) * 10)}.tg\\:w-12{width:calc(var(--tg-spacing) * 12)}.tg\\:w-32{width:calc(var(--tg-spacing) * 32)}.tg\\:w-64{width:calc(var(--tg-spacing) * 64)}.tg\\:w-72{width:calc(var(--tg-spacing) * 72)}.tg\\:w-80{width:calc(var(--tg-spacing) * 80)}.tg\\:w-96{width:calc(var(--tg-spacing) * 96)}.tg\\:w-\\[300px\\]{width:300px}.tg\\:w-auto{width:auto}.tg\\:w-fit{width:fit-content}.tg\\:w-full{width:100%}.tg\\:w-screen{width:100vw}.tg\\:max-w-2xl{max-width:var(--tg-container-2xl)}.tg\\:max-w-50{max-width:calc(var(--tg-spacing) * 50)}.tg\\:max-w-\\[350px\\]{max-width:350px}.tg\\:max-w-\\[calc\\(100\\%-2rem\\)\\]{max-width:calc(100% - 2rem)}.tg\\:max-w-none{max-width:none}.tg\\:min-w-\\(--cell-size\\){min-width:var(--cell-size)}.tg\\:min-w-0{min-width:calc(var(--tg-spacing) * 0)}.tg\\:min-w-\\[8rem\\]{min-width:8rem}.tg\\:min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.tg\\:flex-1{flex:1}.tg\\:shrink-0{flex-shrink:0}.tg\\:border-collapse{border-collapse:collapse}.tg\\:origin-\\(--radix-dropdown-menu-content-transform-origin\\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.tg\\:origin-\\(--radix-popover-content-transform-origin\\){transform-origin:var(--radix-popover-content-transform-origin)}.tg\\:origin-\\(--radix-select-content-transform-origin\\){transform-origin:var(--radix-select-content-transform-origin)}.tg\\:origin-\\(--radix-tooltip-content-transform-origin\\){transform-origin:var(--radix-tooltip-content-transform-origin)}.tg\\:-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.tg\\:translate-x-\\[-50\\%\\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.tg\\:-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.tg\\:translate-y-\\[-50\\%\\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.tg\\:translate-y-\\[calc\\(-50\\%_-_2px\\)\\]{--tw-translate-y:calc(-50% - 2px);translate:var(--tw-translate-x) var(--tw-translate-y)}.tg\\:rotate-45{rotate:45deg}.tg\\:animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.tg\\:animate-spin{animation:var(--tg-animate-spin)}.tg\\:cursor-default{cursor:default}.tg\\:cursor-pointer{cursor:pointer}.tg\\:touch-none{touch-action:none}.tg\\:resize-none{resize:none}.tg\\:scroll-my-1{scroll-margin-block:calc(var(--tg-spacing) * 1)}.tg\\:scroll-py-1{scroll-padding-block:calc(var(--tg-spacing) * 1)}.tg\\:list-inside{list-style-position:inside}.tg\\:list-disc{list-style-type:disc}.tg\\:flex-col{flex-direction:column}.tg\\:flex-col-reverse{flex-direction:column-reverse}.tg\\:place-content-center{place-content:center}.tg\\:items-center{align-items:center}.tg\\:items-end{align-items:flex-end}.tg\\:items-start{align-items:flex-start}.tg\\:justify-between{justify-content:space-between}.tg\\:justify-center{justify-content:center}.tg\\:justify-end{justify-content:flex-end}.tg\\:gap-0{gap:calc(var(--tg-spacing) * 0)}.tg\\:gap-0\\.5{gap:calc(var(--tg-spacing) * .5)}.tg\\:gap-1{gap:calc(var(--tg-spacing) * 1)}.tg\\:gap-1\\.5{gap:calc(var(--tg-spacing) * 1.5)}.tg\\:gap-2{gap:calc(var(--tg-spacing) * 2)}.tg\\:gap-3{gap:calc(var(--tg-spacing) * 3)}.tg\\:gap-4{gap:calc(var(--tg-spacing) * 4)}.tg\\:gap-5{gap:calc(var(--tg-spacing) * 5)}.tg\\:gap-6{gap:calc(var(--tg-spacing) * 6)}:where(.tg\\:space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--tg-spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--tg-spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.tg\\:space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--tg-spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--tg-spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.tg\\:space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--tg-spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--tg-spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.tg\\:space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--tg-spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--tg-spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.tg\\:space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--tg-spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--tg-spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.tg\\:gap-x-3{column-gap:calc(var(--tg-spacing) * 3)}:where(.tg\\:space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--tg-spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--tg-spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}.tg\\:gap-y-3{row-gap:calc(var(--tg-spacing) * 3)}.tg\\:truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.tg\\:overflow-auto{overflow:auto}.tg\\:overflow-hidden{overflow:hidden}.tg\\:overflow-x-hidden{overflow-x:hidden}.tg\\:overflow-y-auto{overflow-y:auto}.tg\\:rounded{border-radius:.25rem}.tg\\:rounded-\\[2px\\]{border-radius:2px}.tg\\:rounded-\\[4px\\]{border-radius:4px}.tg\\:rounded-\\[inherit\\]{border-radius:inherit}.tg\\:rounded-full{border-radius:3.40282e38px}.tg\\:rounded-lg{border-radius:var(--treege-radius)}.tg\\:rounded-md{border-radius:calc(var(--treege-radius) - 2px)}.tg\\:rounded-none{border-radius:0}.tg\\:rounded-sm{border-radius:calc(var(--treege-radius) - 4px)}.tg\\:rounded-xs{border-radius:var(--tg-radius-xs)}.tg\\:rounded-l-md{border-top-left-radius:calc(var(--treege-radius) - 2px);border-bottom-left-radius:calc(var(--treege-radius) - 2px)}.tg\\:rounded-r-md{border-top-right-radius:calc(var(--treege-radius) - 2px);border-bottom-right-radius:calc(var(--treege-radius) - 2px)}.tg\\:border{border-style:var(--tw-border-style);border-width:1px}.tg\\:border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.tg\\:border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.tg\\:border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.tg\\:border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.tg\\:border-foreground\\/30{border-color:var(--treege-foreground)}@supports (color:color-mix(in lab, red, red)){.tg\\:border-foreground\\/30{border-color:color-mix(in oklab, var(--treege-foreground) 30%, transparent)}}.tg\\:border-gray-300{border-color:var(--tg-color-gray-300)}.tg\\:border-input{border-color:var(--treege-input)}.tg\\:border-primary{border-color:var(--treege-primary)}.tg\\:border-transparent{border-color:#0000}.tg\\:border-t-transparent{border-top-color:#0000}.tg\\:border-l-transparent{border-left-color:#0000}.tg\\:bg-accent{background-color:var(--treege-accent)}.tg\\:bg-background{background-color:var(--treege-background)}.tg\\:bg-black\\/50{background-color:var(--tg-color-black)}@supports (color:color-mix(in lab, red, red)){.tg\\:bg-black\\/50{background-color:color-mix(in oklab, var(--tg-color-black) 50%, transparent)}}.tg\\:bg-blue-300{background-color:var(--tg-color-blue-300)}.tg\\:bg-blue-500{background-color:var(--tg-color-blue-500)}.tg\\:bg-border{background-color:var(--treege-border)}.tg\\:bg-chart-2{background-color:var(--treege-chart-2)}.tg\\:bg-destructive{background-color:var(--treege-destructive)}.tg\\:bg-foreground{background-color:var(--treege-foreground)}.tg\\:bg-muted,.tg\\:bg-muted\\/20{background-color:var(--treege-muted)}@supports (color:color-mix(in lab, red, red)){.tg\\:bg-muted\\/20{background-color:color-mix(in oklab, var(--treege-muted) 20%, transparent)}}.tg\\:bg-muted\\/30{background-color:var(--treege-muted)}@supports (color:color-mix(in lab, red, red)){.tg\\:bg-muted\\/30{background-color:color-mix(in oklab, var(--treege-muted) 30%, transparent)}}.tg\\:bg-popover{background-color:var(--treege-popover)}.tg\\:bg-primary,.tg\\:bg-primary\\/5{background-color:var(--treege-primary)}@supports (color:color-mix(in lab, red, red)){.tg\\:bg-primary\\/5{background-color:color-mix(in oklab, var(--treege-primary) 5%, transparent)}}.tg\\:bg-purple-600{background-color:var(--tg-color-purple-600)}.tg\\:bg-secondary{background-color:var(--treege-secondary)}.tg\\:bg-transparent{background-color:#0000}.tg\\:fill-current{fill:currentColor}.tg\\:fill-foreground{fill:var(--treege-foreground)}.tg\\:fill-primary{fill:var(--treege-primary)}.tg\\:object-cover{object-fit:cover}.tg\\:p-0{padding:calc(var(--tg-spacing) * 0)}.tg\\:p-0\\!{padding:calc(var(--tg-spacing) * 0)!important}.tg\\:p-1{padding:calc(var(--tg-spacing) * 1)}.tg\\:p-2{padding:calc(var(--tg-spacing) * 2)}.tg\\:p-3{padding:calc(var(--tg-spacing) * 3)}.tg\\:p-4{padding:calc(var(--tg-spacing) * 4)}.tg\\:p-6{padding:calc(var(--tg-spacing) * 6)}.tg\\:p-px{padding:1px}.tg\\:px-\\(--cell-size\\){padding-inline:var(--cell-size)}.tg\\:px-1{padding-inline:calc(var(--tg-spacing) * 1)}.tg\\:px-1\\.5{padding-inline:calc(var(--tg-spacing) * 1.5)}.tg\\:px-2{padding-inline:calc(var(--tg-spacing) * 2)}.tg\\:px-3{padding-inline:calc(var(--tg-spacing) * 3)}.tg\\:px-4{padding-inline:calc(var(--tg-spacing) * 4)}.tg\\:px-6{padding-inline:calc(var(--tg-spacing) * 6)}.tg\\:py-0{padding-block:calc(var(--tg-spacing) * 0)}.tg\\:py-0\\.5{padding-block:calc(var(--tg-spacing) * .5)}.tg\\:py-1{padding-block:calc(var(--tg-spacing) * 1)}.tg\\:py-1\\.5{padding-block:calc(var(--tg-spacing) * 1.5)}.tg\\:py-2{padding-block:calc(var(--tg-spacing) * 2)}.tg\\:py-3{padding-block:calc(var(--tg-spacing) * 3)}.tg\\:py-4{padding-block:calc(var(--tg-spacing) * 4)}.tg\\:py-6{padding-block:calc(var(--tg-spacing) * 6)}.tg\\:pt-2{padding-top:calc(var(--tg-spacing) * 2)}.tg\\:pr-1{padding-right:calc(var(--tg-spacing) * 1)}.tg\\:pr-2{padding-right:calc(var(--tg-spacing) * 2)}.tg\\:pr-8{padding-right:calc(var(--tg-spacing) * 8)}.tg\\:pr-10{padding-right:calc(var(--tg-spacing) * 10)}.tg\\:pb-1\\.5{padding-bottom:calc(var(--tg-spacing) * 1.5)}.tg\\:pl-2{padding-left:calc(var(--tg-spacing) * 2)}.tg\\:pl-8{padding-left:calc(var(--tg-spacing) * 8)}.tg\\:text-center{text-align:center}.tg\\:font-mono{font-family:var(--tg-font-mono)}.tg\\:text-2xl{font-size:var(--tg-text-2xl);line-height:var(--tw-leading,var(--tg-text-2xl--line-height))}.tg\\:text-base{font-size:var(--tg-text-base);line-height:var(--tw-leading,var(--tg-text-base--line-height))}.tg\\:text-lg{font-size:var(--tg-text-lg);line-height:var(--tw-leading,var(--tg-text-lg--line-height))}.tg\\:text-sm{font-size:var(--tg-text-sm);line-height:var(--tw-leading,var(--tg-text-sm--line-height))}.tg\\:text-xs{font-size:var(--tg-text-xs);line-height:var(--tw-leading,var(--tg-text-xs--line-height))}.tg\\:text-\\[0\\.8rem\\]{font-size:.8rem}.tg\\:text-\\[10px\\]{font-size:10px}.tg\\:leading-none{--tw-leading:1;line-height:1}.tg\\:font-bold{--tw-font-weight:var(--tg-font-weight-bold);font-weight:var(--tg-font-weight-bold)}.tg\\:font-light{--tw-font-weight:var(--tg-font-weight-light);font-weight:var(--tg-font-weight-light)}.tg\\:font-medium{--tw-font-weight:var(--tg-font-weight-medium);font-weight:var(--tg-font-weight-medium)}.tg\\:font-normal{--tw-font-weight:var(--tg-font-weight-normal);font-weight:var(--tg-font-weight-normal)}.tg\\:font-semibold{--tw-font-weight:var(--tg-font-weight-semibold);font-weight:var(--tg-font-weight-semibold)}.tg\\:tracking-widest{--tw-tracking:var(--tg-tracking-widest);letter-spacing:var(--tg-tracking-widest)}.tg\\:text-balance{text-wrap:balance}.tg\\:whitespace-nowrap{white-space:nowrap}.tg\\:text-\\[\\#13d3b4\\]{color:#13d3b4}.tg\\:text-\\[--treege-color-primary\\]{color:--treege-color-primary}.tg\\:text-accent-foreground{color:var(--treege-accent-foreground)}.tg\\:text-background{color:var(--treege-background)}.tg\\:text-current{color:currentColor}.tg\\:text-destructive{color:var(--treege-destructive)}.tg\\:text-foreground{color:var(--treege-foreground)}.tg\\:text-gray-300{color:var(--tg-color-gray-300)}.tg\\:text-gray-400{color:var(--tg-color-gray-400)}.tg\\:text-gray-500{color:var(--tg-color-gray-500)}.tg\\:text-muted-foreground{color:var(--treege-muted-foreground)}.tg\\:text-popover-foreground{color:var(--treege-popover-foreground)}.tg\\:text-primary{color:var(--treege-primary)}.tg\\:text-primary-foreground{color:var(--treege-primary-foreground)}.tg\\:text-red-500{color:var(--tg-color-red-500)}.tg\\:text-secondary-foreground{color:var(--treege-secondary-foreground)}.tg\\:text-white{color:var(--tg-color-white)}.tg\\:capitalize{text-transform:capitalize}.tg\\:uppercase{text-transform:uppercase}.tg\\:underline{text-decoration-line:underline}.tg\\:underline-offset-4{text-underline-offset:4px}.tg\\:\\[color-scheme\\:light\\]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}.tg\\:opacity-0{opacity:0}.tg\\:opacity-50{opacity:.5}.tg\\:opacity-60{opacity:.6}.tg\\:opacity-70{opacity:.7}.tg\\:opacity-100{opacity:1}.tg\\:shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.tg\\:shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.tg\\:shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.tg\\:ring-0{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.tg\\:ring-offset-background{--tw-ring-offset-color:var(--treege-background)}.tg\\:outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.tg\\:outline-hidden{outline-offset:2px;outline:2px solid #0000}}.tg\\:drop-shadow-\\[0_0px_35px\\]{--tw-drop-shadow-size:drop-shadow(0 0px 35px var(--tw-drop-shadow-color,currentcolor));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.tg\\:drop-shadow-blue-600{--tw-drop-shadow-color:var(--tg-color-blue-600)}@supports (color:color-mix(in lab, red, red)){.tg\\:drop-shadow-blue-600{--tw-drop-shadow-color:color-mix(in oklab, var(--tg-color-blue-600) var(--tw-drop-shadow-alpha), transparent)}}.tg\\:drop-shadow-blue-600{--tw-drop-shadow:var(--tw-drop-shadow-size)}.tg\\:transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--tg-default-transition-timing-function));transition-duration:var(--tw-duration,var(--tg-default-transition-duration))}.tg\\:transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--tg-default-transition-timing-function));transition-duration:var(--tw-duration,var(--tg-default-transition-duration))}.tg\\:transition-\\[filter\\]{transition-property:filter;transition-timing-function:var(--tw-ease,var(--tg-default-transition-timing-function));transition-duration:var(--tw-duration,var(--tg-default-transition-duration))}.tg\\:transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--tg-default-transition-timing-function));transition-duration:var(--tw-duration,var(--tg-default-transition-duration))}.tg\\:transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--tg-default-transition-timing-function));transition-duration:var(--tw-duration,var(--tg-default-transition-duration))}.tg\\:transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--tg-default-transition-timing-function));transition-duration:var(--tw-duration,var(--tg-default-transition-duration))}.tg\\:transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--tg-default-transition-timing-function));transition-duration:var(--tw-duration,var(--tg-default-transition-duration))}.tg\\:transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--tg-default-transition-timing-function));transition-duration:var(--tw-duration,var(--tg-default-transition-duration))}.tg\\:transition-none{transition-property:none}.tg\\:duration-200{--tw-duration:.2s;transition-duration:.2s}.tg\\:ease-in-out{--tw-ease:var(--tg-ease-in-out);transition-timing-function:var(--tg-ease-in-out)}.tg\\:fade-in-0{--tw-enter-opacity:0}.tg\\:outline-none{--tw-outline-style:none;outline-style:none}.tg\\:select-none{-webkit-user-select:none;user-select:none}.tg\\:zoom-in-95{--tw-enter-scale:.95}.tg\\:\\[--cell-size\\:--spacing\\(8\\)\\]{--cell-size:calc(var(--tg-spacing) * 8)}.tg\\:group-data-\\[disabled\\=true\\]\\:pointer-events-none:is(:where(.tg\\:group)[data-disabled=true] *){pointer-events:none}.tg\\:group-data-\\[disabled\\=true\\]\\:opacity-50:is(:where(.tg\\:group)[data-disabled=true] *){opacity:.5}.tg\\:group-data-\\[focused\\=true\\]\\/day\\:relative:is(:where(.tg\\:group\\/day)[data-focused=true] *){position:relative}.tg\\:group-data-\\[focused\\=true\\]\\/day\\:z-10:is(:where(.tg\\:group\\/day)[data-focused=true] *){z-index:10}.tg\\:group-data-\\[focused\\=true\\]\\/day\\:border-ring:is(:where(.tg\\:group\\/day)[data-focused=true] *){border-color:var(--treege-ring)}.tg\\:group-data-\\[focused\\=true\\]\\/day\\:ring-\\[3px\\]:is(:where(.tg\\:group\\/day)[data-focused=true] *){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.tg\\:group-data-\\[focused\\=true\\]\\/day\\:ring-ring\\/50:is(:where(.tg\\:group\\/day)[data-focused=true] *){--tw-ring-color:var(--treege-ring)}@supports (color:color-mix(in lab, red, red)){.tg\\:group-data-\\[focused\\=true\\]\\/day\\:ring-ring\\/50:is(:where(.tg\\:group\\/day)[data-focused=true] *){--tw-ring-color:color-mix(in oklab, var(--treege-ring) 50%, transparent)}}.tg\\:peer-disabled\\:cursor-not-allowed:is(:where(.tg\\:peer):disabled~*){cursor:not-allowed}.tg\\:peer-disabled\\:opacity-50:is(:where(.tg\\:peer):disabled~*){opacity:.5}.tg\\:selection\\:bg-primary ::selection{background-color:var(--treege-primary)}.tg\\:selection\\:bg-primary::selection{background-color:var(--treege-primary)}.tg\\:selection\\:text-primary-foreground ::selection{color:var(--treege-primary-foreground)}.tg\\:selection\\:text-primary-foreground::selection{color:var(--treege-primary-foreground)}.tg\\:file\\:inline-flex::file-selector-button{display:inline-flex}.tg\\:file\\:h-7::file-selector-button{height:calc(var(--tg-spacing) * 7)}.tg\\:file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.tg\\:file\\:bg-transparent::file-selector-button{background-color:#0000}.tg\\:file\\:text-sm::file-selector-button{font-size:var(--tg-text-sm);line-height:var(--tw-leading,var(--tg-text-sm--line-height))}.tg\\:file\\:font-medium::file-selector-button{--tw-font-weight:var(--tg-font-weight-medium);font-weight:var(--tg-font-weight-medium)}.tg\\:file\\:text-foreground::file-selector-button{color:var(--treege-foreground)}.tg\\:placeholder\\:text-muted-foreground::placeholder,.tg\\:placeholder\\:text-muted-foreground\\/40::placeholder{color:var(--treege-muted-foreground)}@supports (color:color-mix(in lab, red, red)){.tg\\:placeholder\\:text-muted-foreground\\/40::placeholder{color:color-mix(in oklab, var(--treege-muted-foreground) 40%, transparent)}}.tg\\:placeholder\\:text-white\\/60::placeholder{color:var(--tg-color-white)}@supports (color:color-mix(in lab, red, red)){.tg\\:placeholder\\:text-white\\/60::placeholder{color:color-mix(in oklab, var(--tg-color-white) 60%, transparent)}}@media (hover:hover){.tg\\:hover\\:border-primary\\/50:hover{border-color:var(--treege-primary)}@supports (color:color-mix(in lab, red, red)){.tg\\:hover\\:border-primary\\/50:hover{border-color:color-mix(in oklab, var(--treege-primary) 50%, transparent)}}.tg\\:hover\\:bg-accent:hover{background-color:var(--treege-accent)}.tg\\:hover\\:bg-blue-600:hover{background-color:var(--tg-color-blue-600)}.tg\\:hover\\:bg-destructive\\/90:hover{background-color:var(--treege-destructive)}@supports (color:color-mix(in lab, red, red)){.tg\\:hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab, var(--treege-destructive) 90%, transparent)}}.tg\\:hover\\:bg-primary:hover{background-color:var(--treege-primary)}.tg\\:hover\\:bg-primary\\/80\\!:hover{background-color:var(--treege-primary)!important}@supports (color:color-mix(in lab, red, red)){.tg\\:hover\\:bg-primary\\/80\\!:hover{background-color:color-mix(in oklab, var(--treege-primary) 80%, transparent)!important}}.tg\\:hover\\:bg-primary\\/90:hover{background-color:var(--treege-primary)}@supports (color:color-mix(in lab, red, red)){.tg\\:hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab, var(--treege-primary) 90%, transparent)}}.tg\\:hover\\:bg-purple-700:hover{background-color:var(--tg-color-purple-700)}.tg\\:hover\\:bg-secondary:hover,.tg\\:hover\\:bg-secondary\\/80:hover{background-color:var(--treege-secondary)}@supports (color:color-mix(in lab, red, red)){.tg\\:hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab, var(--treege-secondary) 80%, transparent)}}.tg\\:hover\\:text-\\[--treege-color-primary\\]:hover{color:--treege-color-primary}.tg\\:hover\\:text-accent-foreground:hover{color:var(--treege-accent-foreground)}.tg\\:hover\\:text-primary:hover{color:var(--treege-primary)}.tg\\:hover\\:no-underline:hover{text-decoration-line:none}.tg\\:hover\\:underline:hover{text-decoration-line:underline}.tg\\:hover\\:opacity-100:hover{opacity:1}.tg\\:hover\\:brightness-90:hover{--tw-brightness:brightness(90%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.tg\\:hover\\:brightness-125:hover{--tw-brightness:brightness(125%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.tg\\:focus\\:bg-accent:focus{background-color:var(--treege-accent)}.tg\\:focus\\:text-accent-foreground:focus{color:var(--treege-accent-foreground)}.tg\\:focus\\:text-destructive:focus{color:var(--treege-destructive)}.tg\\:focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.tg\\:focus\\:ring-blue-500:focus{--tw-ring-color:var(--tg-color-blue-500)}.tg\\:focus\\:ring-ring:focus{--tw-ring-color:var(--treege-ring)}.tg\\:focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.tg\\:focus\\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.tg\\:focus\\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.tg\\:focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.tg\\:focus-visible\\:border-ring:focus-visible{border-color:var(--treege-ring)}.tg\\:focus-visible\\:border-transparent\\!:focus-visible{border-color:#0000!important}.tg\\:focus-visible\\:ring-0\\!:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor)!important;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)!important}.tg\\:focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.tg\\:focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--treege-destructive)}@supports (color:color-mix(in lab, red, red)){.tg\\:focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--treege-destructive) 20%, transparent)}}.tg\\:focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--treege-ring)}@supports (color:color-mix(in lab, red, red)){.tg\\:focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--treege-ring) 50%, transparent)}}.tg\\:focus-visible\\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.tg\\:disabled\\:pointer-events-none:disabled{pointer-events:none}.tg\\:disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.tg\\:disabled\\:opacity-50:disabled{opacity:.5}.tg\\:has-focus\\:border-ring:has(:focus){border-color:var(--treege-ring)}.tg\\:has-focus\\:ring-\\[3px\\]:has(:focus){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.tg\\:has-focus\\:ring-ring\\/50:has(:focus){--tw-ring-color:var(--treege-ring)}@supports (color:color-mix(in lab, red, red)){.tg\\:has-focus\\:ring-ring\\/50:has(:focus){--tw-ring-color:color-mix(in oklab, var(--treege-ring) 50%, transparent)}}.tg\\:has-\\[\\>svg\\]\\:px-1\\.5:has(>svg){padding-inline:calc(var(--tg-spacing) * 1.5)}.tg\\:has-\\[\\>svg\\]\\:px-2\\.5:has(>svg){padding-inline:calc(var(--tg-spacing) * 2.5)}.tg\\:has-\\[\\>svg\\]\\:px-3:has(>svg){padding-inline:calc(var(--tg-spacing) * 3)}.tg\\:has-\\[\\>svg\\]\\:px-4:has(>svg){padding-inline:calc(var(--tg-spacing) * 4)}.tg\\:aria-disabled\\:opacity-50[aria-disabled=true]{opacity:.5}.tg\\:aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--treege-destructive)}.tg\\:aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--treege-destructive)}@supports (color:color-mix(in lab, red, red)){.tg\\:aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--treege-destructive) 20%, transparent)}}.tg\\:aria-selected\\:text-muted-foreground[aria-selected=true]{color:var(--treege-muted-foreground)}.tg\\:data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.tg\\:data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.tg\\:data-\\[disabled\\=true\\]\\:pointer-events-none[data-disabled=true]{pointer-events:none}.tg\\:data-\\[disabled\\=true\\]\\:opacity-50[data-disabled=true]{opacity:.5}.tg\\:data-\\[inset\\]\\:pl-7[data-inset]{padding-left:calc(var(--tg-spacing) * 7)}.tg\\:data-\\[inset\\]\\:pl-8[data-inset]{padding-left:calc(var(--tg-spacing) * 8)}.tg\\:data-\\[orientation\\=horizontal\\]\\:h-px[data-orientation=horizontal]{height:1px}.tg\\:data-\\[orientation\\=horizontal\\]\\:w-full[data-orientation=horizontal]{width:100%}.tg\\:data-\\[orientation\\=vertical\\]\\:h-full[data-orientation=vertical]{height:100%}.tg\\:data-\\[orientation\\=vertical\\]\\:w-px[data-orientation=vertical]{width:1px}.tg\\:data-\\[placeholder\\]\\:text-muted-foreground[data-placeholder]{color:var(--treege-muted-foreground)}.tg\\:data-\\[range-end\\=true\\]\\:rounded-md[data-range-end=true]{border-radius:calc(var(--treege-radius) - 2px)}.tg\\:data-\\[range-end\\=true\\]\\:rounded-r-md[data-range-end=true]{border-top-right-radius:calc(var(--treege-radius) - 2px);border-bottom-right-radius:calc(var(--treege-radius) - 2px)}.tg\\:data-\\[range-end\\=true\\]\\:bg-primary[data-range-end=true]{background-color:var(--treege-primary)}.tg\\:data-\\[range-end\\=true\\]\\:text-primary-foreground[data-range-end=true]{color:var(--treege-primary-foreground)}.tg\\:data-\\[range-middle\\=true\\]\\:rounded-none[data-range-middle=true]{border-radius:0}.tg\\:data-\\[range-middle\\=true\\]\\:bg-accent[data-range-middle=true]{background-color:var(--treege-accent)}.tg\\:data-\\[range-middle\\=true\\]\\:text-accent-foreground[data-range-middle=true]{color:var(--treege-accent-foreground)}.tg\\:data-\\[range-start\\=true\\]\\:rounded-md[data-range-start=true]{border-radius:calc(var(--treege-radius) - 2px)}.tg\\:data-\\[range-start\\=true\\]\\:rounded-l-md[data-range-start=true]{border-top-left-radius:calc(var(--treege-radius) - 2px);border-bottom-left-radius:calc(var(--treege-radius) - 2px)}.tg\\:data-\\[range-start\\=true\\]\\:bg-primary[data-range-start=true]{background-color:var(--treege-primary)}.tg\\:data-\\[range-start\\=true\\]\\:text-primary-foreground[data-range-start=true]{color:var(--treege-primary-foreground)}.tg\\:data-\\[selected-single\\=true\\]\\:bg-primary[data-selected-single=true]{background-color:var(--treege-primary)}.tg\\:data-\\[selected-single\\=true\\]\\:text-primary-foreground[data-selected-single=true]{color:var(--treege-primary-foreground)}.tg\\:data-\\[selected\\=true\\]\\:rounded-none[data-selected=true]{border-radius:0}.tg\\:data-\\[selected\\=true\\]\\:bg-accent[data-selected=true]{background-color:var(--treege-accent)}.tg\\:data-\\[selected\\=true\\]\\:text-accent-foreground[data-selected=true]{color:var(--treege-accent-foreground)}.tg\\:data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--tg-spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.tg\\:data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.tg\\:data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--tg-spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.tg\\:data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.tg\\:data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--tg-spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.tg\\:data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.tg\\:data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--tg-spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.tg\\:data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.tg\\:data-\\[size\\=default\\]\\:h-9[data-size=default]{height:calc(var(--tg-spacing) * 9)}.tg\\:data-\\[size\\=sm\\]\\:h-8[data-size=sm]{height:calc(var(--tg-spacing) * 8)}:is(.tg\\:\\*\\*\\:data-\\[slot\\=command-input-wrapper\\]\\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--tg-spacing) * 12)}:is(.tg\\:\\*\\:data-\\[slot\\=select-value\\]\\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.tg\\:\\*\\:data-\\[slot\\=select-value\\]\\:flex>*)[data-slot=select-value]{display:flex}:is(.tg\\:\\*\\:data-\\[slot\\=select-value\\]\\:items-center>*)[data-slot=select-value]{align-items:center}:is(.tg\\:\\*\\:data-\\[slot\\=select-value\\]\\:gap-2>*)[data-slot=select-value]{gap:calc(var(--tg-spacing) * 2)}.tg\\:data-\\[state\\=checked\\]\\:translate-x-\\[calc\\(100\\%-2px\\)\\][data-state=checked]{--tw-translate-x:calc(100% - 2px);translate:var(--tw-translate-x) var(--tw-translate-y)}.tg\\:data-\\[state\\=checked\\]\\:border-primary[data-state=checked]{border-color:var(--treege-primary)}.tg\\:data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:var(--treege-primary)}.tg\\:data-\\[state\\=checked\\]\\:text-primary-foreground[data-state=checked]{color:var(--treege-primary-foreground)}.tg\\:data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.tg\\:data-\\[state\\=closed\\]\\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.tg\\:data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.tg\\:data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.tg\\:data-\\[state\\=closed\\]\\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y:100%}.tg\\:data-\\[state\\=closed\\]\\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x:-100%}.tg\\:data-\\[state\\=closed\\]\\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x:100%}.tg\\:data-\\[state\\=closed\\]\\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y:-100%}.tg\\:data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.tg\\:data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:var(--treege-accent)}.tg\\:data-\\[state\\=open\\]\\:bg-secondary[data-state=open]{background-color:var(--treege-secondary)}.tg\\:data-\\[state\\=open\\]\\:text-accent-foreground[data-state=open]{color:var(--treege-accent-foreground)}.tg\\:data-\\[state\\=open\\]\\:text-muted-foreground[data-state=open]{color:var(--treege-muted-foreground)}.tg\\:data-\\[state\\=open\\]\\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}.tg\\:data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.tg\\:data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.tg\\:data-\\[state\\=open\\]\\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y:100%}.tg\\:data-\\[state\\=open\\]\\:slide-in-from-left[data-state=open]{--tw-enter-translate-x:-100%}.tg\\:data-\\[state\\=open\\]\\:slide-in-from-right[data-state=open]{--tw-enter-translate-x:100%}.tg\\:data-\\[state\\=open\\]\\:slide-in-from-top[data-state=open]{--tw-enter-translate-y:-100%}.tg\\:data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--tg-spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.tg\\:data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:var(--treege-input)}.tg\\:data-\\[variant\\=destructive\\]\\:text-destructive[data-variant=destructive]{color:var(--treege-destructive)}.tg\\:data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/10[data-variant=destructive]:focus{background-color:var(--treege-destructive)}@supports (color:color-mix(in lab, red, red)){.tg\\:data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab, var(--treege-destructive) 10%, transparent)}}.tg\\:data-\\[variant\\=destructive\\]\\:focus\\:text-destructive[data-variant=destructive]:focus{color:var(--treege-destructive)}@media (width>=40rem){.tg\\:sm\\:max-w-\\[550px\\]\\!{max-width:550px!important}.tg\\:sm\\:max-w-lg{max-width:var(--tg-container-lg)}.tg\\:sm\\:max-w-none{max-width:none}.tg\\:sm\\:max-w-sm{max-width:var(--tg-container-sm)}.tg\\:sm\\:flex-row{flex-direction:row}.tg\\:sm\\:justify-end{justify-content:flex-end}.tg\\:sm\\:text-left{text-align:left}}@media (width>=48rem){.tg\\:md\\:top-5{top:calc(var(--tg-spacing) * 5)}.tg\\:md\\:inline{display:inline}.tg\\:md\\:h-14{height:calc(var(--tg-spacing) * 14)}.tg\\:md\\:w-3\\/4{width:75%}.tg\\:md\\:flex-row{flex-direction:row}.tg\\:md\\:text-sm{font-size:var(--tg-text-sm);line-height:var(--tw-leading,var(--tg-text-sm--line-height))}}.tg\\:dark\\:border-input:is(.dark *){border-color:var(--treege-input)}.tg\\:dark\\:bg-blue-600:is(.dark *){background-color:var(--tg-color-blue-600)}.tg\\:dark\\:bg-destructive\\/60:is(.dark *){background-color:var(--treege-destructive)}@supports (color:color-mix(in lab, red, red)){.tg\\:dark\\:bg-destructive\\/60:is(.dark *){background-color:color-mix(in oklab, var(--treege-destructive) 60%, transparent)}}.tg\\:dark\\:bg-input\\/30:is(.dark *){background-color:var(--treege-input)}@supports (color:color-mix(in lab, red, red)){.tg\\:dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab, var(--treege-input) 30%, transparent)}}.tg\\:dark\\:\\[color-scheme\\:dark\\]:is(.dark *){--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}@media (hover:hover){.tg\\:dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:var(--treege-accent)}@supports (color:color-mix(in lab, red, red)){.tg\\:dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--treege-accent) 50%, transparent)}}.tg\\:dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:var(--treege-input)}@supports (color:color-mix(in lab, red, red)){.tg\\:dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--treege-input) 50%, transparent)}}.tg\\:dark\\:hover\\:text-accent-foreground:is(.dark *):hover{color:var(--treege-accent-foreground)}}.tg\\:dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:var(--treege-destructive)}@supports (color:color-mix(in lab, red, red)){.tg\\:dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--treege-destructive) 40%, transparent)}}.tg\\:dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--treege-destructive)}@supports (color:color-mix(in lab, red, red)){.tg\\:dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--treege-destructive) 40%, transparent)}}.tg\\:dark\\:data-\\[state\\=checked\\]\\:bg-primary:is(.dark *)[data-state=checked]{background-color:var(--treege-primary)}.tg\\:dark\\:data-\\[state\\=checked\\]\\:bg-primary-foreground:is(.dark *)[data-state=checked]{background-color:var(--treege-primary-foreground)}.tg\\:dark\\:data-\\[state\\=unchecked\\]\\:bg-foreground:is(.dark *)[data-state=unchecked]{background-color:var(--treege-foreground)}.tg\\:dark\\:data-\\[state\\=unchecked\\]\\:bg-input\\/80:is(.dark *)[data-state=unchecked]{background-color:var(--treege-input)}@supports (color:color-mix(in lab, red, red)){.tg\\:dark\\:data-\\[state\\=unchecked\\]\\:bg-input\\/80:is(.dark *)[data-state=unchecked]{background-color:color-mix(in oklab, var(--treege-input) 80%, transparent)}}.tg\\:dark\\:data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/20:is(.dark *)[data-variant=destructive]:focus{background-color:var(--treege-destructive)}@supports (color:color-mix(in lab, red, red)){.tg\\:dark\\:data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/20:is(.dark *)[data-variant=destructive]:focus{background-color:color-mix(in oklab, var(--treege-destructive) 20%, transparent)}}.tg\\:\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--tg-spacing) * 2)}.tg\\:\\[\\&_\\[cmdk-group-heading\\]\\]\\:py-1\\.5 [cmdk-group-heading]{padding-block:calc(var(--tg-spacing) * 1.5)}.tg\\:\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-xs [cmdk-group-heading]{font-size:var(--tg-text-xs);line-height:var(--tw-leading,var(--tg-text-xs--line-height))}.tg\\:\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--tg-font-weight-medium);font-weight:var(--tg-font-weight-medium)}.tg\\:\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted-foreground [cmdk-group-heading]{color:var(--treege-muted-foreground)}.tg\\:\\[\\&_\\[cmdk-group\\]\\]\\:px-2 [cmdk-group]{padding-inline:calc(var(--tg-spacing) * 2)}.tg\\:\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:calc(var(--tg-spacing) * 0)}.tg\\:\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--tg-spacing) * 5)}.tg\\:\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--tg-spacing) * 5)}.tg\\:\\[\\&_\\[cmdk-input\\]\\]\\:h-12 [cmdk-input]{height:calc(var(--tg-spacing) * 12)}.tg\\:\\[\\&_\\[cmdk-item\\]\\]\\:px-2 [cmdk-item]{padding-inline:calc(var(--tg-spacing) * 2)}.tg\\:\\[\\&_\\[cmdk-item\\]\\]\\:py-3 [cmdk-item]{padding-block:calc(var(--tg-spacing) * 3)}.tg\\:\\[\\&_\\[cmdk-item\\]_svg\\]\\:h-5 [cmdk-item] svg{height:calc(var(--tg-spacing) * 5)}.tg\\:\\[\\&_\\[cmdk-item\\]_svg\\]\\:w-5 [cmdk-item] svg{width:calc(var(--tg-spacing) * 5)}.tg\\:\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.tg\\:\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.tg\\:\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--tg-spacing) * 4);height:calc(var(--tg-spacing) * 4)}.tg\\:\\[\\&_svg\\:not\\(\\[class\\*\\=\\'text-\\'\\]\\)\\]\\:text-muted-foreground svg:not([class*=text-]){color:var(--treege-muted-foreground)}.tg\\:\\[\\&\\:first-child\\[data-selected\\=true\\]_button\\]\\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--treege-radius) - 2px);border-bottom-left-radius:calc(var(--treege-radius) - 2px)}:is(.tg\\:rtl\\:\\*\\*\\:\\[\\.rdp-button\\\\_next\\>svg\\]\\:rotate-180:where(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),[dir=rtl],[dir=rtl] *) *):is(.rdp-button_next>svg),:is(.tg\\:rtl\\:\\*\\*\\:\\[\\.rdp-button\\\\_previous\\>svg\\]\\:rotate-180:where(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),[dir=rtl],[dir=rtl] *) *):is(.rdp-button_previous>svg){rotate:180deg}:is(.tg\\:\\*\\:\\[span\\]\\:last\\:flex>*):is(span):last-child{display:flex}:is(.tg\\:\\*\\:\\[span\\]\\:last\\:items-center>*):is(span):last-child{align-items:center}:is(.tg\\:\\*\\:\\[span\\]\\:last\\:gap-2>*):is(span):last-child{gap:calc(var(--tg-spacing) * 2)}:is(.tg\\:data-\\[variant\\=destructive\\]\\:\\*\\:\\[svg\\]\\:\\!text-destructive[data-variant=destructive]>*):is(svg){color:var(--treege-destructive)!important}.tg\\:\\[\\&\\:last-child\\[data-selected\\=true\\]_button\\]\\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--treege-radius) - 2px);border-bottom-right-radius:calc(var(--treege-radius) - 2px)}.tg\\:\\[\\&\\>span\\]\\:text-xs>span{font-size:var(--tg-text-xs);line-height:var(--tw-leading,var(--tg-text-xs--line-height))}.tg\\:\\[\\&\\>span\\]\\:opacity-70>span{opacity:.7}.tg\\:\\[\\&\\>svg\\]\\:pointer-events-none>svg{pointer-events:none}.tg\\:\\[\\&\\>svg\\]\\:size-2\\.5>svg{width:calc(var(--tg-spacing) * 2.5);height:calc(var(--tg-spacing) * 2.5)}.tg\\:\\[\\&\\>svg\\]\\:size-3>svg{width:calc(var(--tg-spacing) * 3);height:calc(var(--tg-spacing) * 3)}.tg\\:\\[\\&\\>svg\\]\\:size-3\\.5>svg{width:calc(var(--tg-spacing) * 3.5);height:calc(var(--tg-spacing) * 3.5)}.tg\\:\\[\\&\\>svg\\]\\:text-muted-foreground>svg{color:var(--treege-muted-foreground)}[data-slot=card-content] .tg\\:\\[\\[data-slot\\=card-content\\]_\\&\\]\\:bg-transparent,[data-slot=popover-content] .tg\\:\\[\\[data-slot\\=popover-content\\]_\\&\\]\\:bg-transparent{background-color:#0000}@media (hover:hover){a.tg\\:\\[a\\&\\]\\:hover\\:bg-accent:hover{background-color:var(--treege-accent)}a.tg\\:\\[a\\&\\]\\:hover\\:bg-destructive\\/90:hover{background-color:var(--treege-destructive)}@supports (color:color-mix(in lab, red, red)){a.tg\\:\\[a\\&\\]\\:hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab, var(--treege-destructive) 90%, transparent)}}a.tg\\:\\[a\\&\\]\\:hover\\:bg-primary\\/90:hover{background-color:var(--treege-primary)}@supports (color:color-mix(in lab, red, red)){a.tg\\:\\[a\\&\\]\\:hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab, var(--treege-primary) 90%, transparent)}}a.tg\\:\\[a\\&\\]\\:hover\\:bg-secondary\\/90:hover{background-color:var(--treege-secondary)}@supports (color:color-mix(in lab, red, red)){a.tg\\:\\[a\\&\\]\\:hover\\:bg-secondary\\/90:hover{background-color:color-mix(in oklab, var(--treege-secondary) 90%, transparent)}}a.tg\\:\\[a\\&\\]\\:hover\\:text-accent-foreground:hover{color:var(--treege-accent-foreground)}}}@property --tw-animation-delay{syntax:\"*\";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:\"*\";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:\"*\";inherits:false}@property --tw-animation-fill-mode{syntax:\"*\";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:\"*\";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:\"*\";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:\"*\";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:\"*\";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:\"*\";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:\"*\";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:\"*\";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:\"*\";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:\"*\";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:\"*\";inherits:false;initial-value:0}:root{--treege-radius:.625rem;--treege-background:oklch(100% 0 0);--treege-foreground:oklch(14.5% 0 0);--treege-card:oklch(100% 0 0);--treege-card-foreground:oklch(14.5% 0 0);--treege-popover:oklch(100% 0 0);--treege-popover-foreground:oklch(14.5% 0 0);--treege-primary:oklch(20.5% 0 0);--treege-primary-foreground:oklch(98.5% 0 0);--treege-secondary:oklch(97% 0 0);--treege-secondary-foreground:oklch(20.5% 0 0);--treege-muted:oklch(97% 0 0);--treege-muted-foreground:oklch(55.6% 0 0);--treege-accent:oklch(97% 0 0);--treege-accent-foreground:oklch(20.5% 0 0);--treege-destructive:oklch(57.7% .245 27.325);--treege-border:oklch(92.2% 0 0);--treege-input:oklch(92.2% 0 0);--treege-ring:oklch(70.8% 0 0);--treege-chart-1:oklch(64.6% .222 41.116);--treege-chart-2:oklch(60% .118 184.704);--treege-chart-3:oklch(39.8% .07 227.392);--treege-chart-4:oklch(82.8% .189 84.429);--treege-chart-5:oklch(76.9% .188 70.08);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0)}.dark{--treege-background:oklch(14.5% 0 0);--treege-foreground:oklch(98.5% 0 0);--treege-card:oklch(20.5% 0 0);--treege-card-foreground:oklch(98.5% 0 0);--treege-popover:oklch(20.5% 0 0);--treege-popover-foreground:oklch(98.5% 0 0);--treege-primary:oklch(92.2% 0 0);--treege-primary-foreground:oklch(20.5% 0 0);--treege-secondary:oklch(26.9% 0 0);--treege-secondary-foreground:oklch(98.5% 0 0);--treege-muted:oklch(26.9% 0 0);--treege-muted-foreground:oklch(70.8% 0 0);--treege-accent:oklch(26.9% 0 0);--treege-accent-foreground:oklch(98.5% 0 0);--treege-destructive:oklch(70.4% .191 22.216);--treege-border:oklch(100% 0 0/.1);--treege-input:oklch(100% 0 0/.15);--treege-ring:oklch(55.6% 0 0);--treege-chart-1:oklch(48.8% .243 264.376);--treege-chart-2:oklch(69.6% .17 162.48);--treege-chart-3:oklch(76.9% .188 70.08);--treege-chart-4:oklch(62.7% .265 303.9);--treege-chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0)}:root{--node-width:280px;--node-height:150px;--node-border-radius:40px;--treege-color-primary:#13d3b4;--treege-color-tertiary:#0065a8;--treege-color-secondary:#007ff6;--treege-color-submit-primary:#ff4757;--treege-color-submit-secondary:#ff6b81;--treege-color-submit-tertiary:#ee5a6f}button{cursor:pointer;-webkit-user-select:none;user-select:none}#root{width:100vw;height:100vh}div.react-flow__node,div.react-flow__node.react-flow__node-input{border:0}div.react-flow__node__wrapper{padding:calc(var(--tg-spacing) * 7);width:270px;min-height:150px;box-shadow:0 0 20px 6px oklch(from var(--treege-color-primary) l c h / 10%), 0 0 20px oklch(from var(--treege-color-tertiary) l c h / 10%);background:linear-gradient(oklch(from var(--treege-card) l c h / 33%), oklch(from var(--treege-card) l c h / 33%)) padding-box, linear-gradient(145deg, oklch(from var(--treege-color-primary) l c h / 40%), oklch(0% 0 0/0), oklch(from var(--treege-color-secondary) l c h / 40%)) border-box;border:3px solid #0000;border-radius:30px;flex-direction:column;justify-content:center;display:flex}div.react-flow__node__wrapper.in-group{background:linear-gradient(oklch(from var(--treege-card) l c h / 33%), oklch(from var(--treege-card) l c h / 33%)) padding-box, linear-gradient(145deg, oklch(from var(--treege-chart-2) l c h / 33%), oklch(0% 0 0/0), oklch(from var(--treege-chart-2) l c h / 33%)) border-box}div.react-flow__node.selected .react-flow__node__wrapper{box-shadow:0 0 20px 6px oklch(from var(--treege-color-primary) l c h / 30%), 0 0 20px oklch(from var(--treege-color-tertiary) l c h / 30%)}div.react-flow__node__wrapper.submit-type{box-shadow:0 0 20px 6px oklch(from var(--treege-color-submit-primary) l c h / 10%), 0 0 20px oklch(from var(--treege-color-submit-tertiary) l c h / 10%);background:linear-gradient(oklch(from var(--treege-card) l c h / 33%), oklch(from var(--treege-card) l c h / 33%)) padding-box, linear-gradient(145deg, oklch(from var(--treege-color-submit-primary) l c h / 40%), oklch(0% 0 0/0), oklch(from var(--treege-color-submit-secondary) l c h / 40%)) border-box}div.react-flow__node.selected .react-flow__node__wrapper.submit-type{box-shadow:0 0 20px 6px oklch(from var(--treege-color-submit-primary) l c h / 30%), 0 0 20px oklch(from var(--treege-color-submit-tertiary) l c h / 30%)}div.react-flow__node-group,div.react-flow__node-group.selected{background:oklch(from var(--treege-chart-2) l c h / 5%);box-shadow:none;border:3px dashed var(--treege-chart-2)}div.react-flow__node-group .react-flow__resize-control{opacity:0;padding:4px;transition:opacity .2s}div.react-flow__node-group:hover .react-flow__resize-control,.react-flow__resize-control:hover{opacity:1}div.react-flow__handle{background-color:var(--treege-muted-foreground);height:calc(var(--tg-spacing) * 6);width:calc(var(--tg-spacing) * 6);cursor:pointer;border-radius:calc(var(--treege-radius) - 4px);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--tg-default-transition-timing-function));transition-duration:var(--tw-duration,var(--tg-default-transition-duration));justify-content:center;align-items:center;display:flex}@media (hover:hover){div.react-flow__handle:hover{background-color:var(--treege-primary)}@supports (color:color-mix(in lab, red, red)){div.react-flow__handle:hover{background-color:color-mix(in oklab, var(--treege-primary) 80%, transparent)}}}path.react-flow__edge-path{stroke:var(--treege-muted-foreground)}.button-edge__label{pointer-events:all;transform-origin:50%;position:absolute}.button-edge__button{border:5px solid var(--xy-minimap-background-color-default);background-color:var(--treege-ring);width:30px;height:30px;color:var(--treege-primary);cursor:pointer;border-radius:50%;padding-top:0;font-size:12px}.button-edge__button:hover{background-color:var(--treege-destructive);color:#fff}.w-tc-editor{border-radius:calc(var(--treege-radius) - 2px);border-style:var(--tw-border-style);border-width:1px;border-color:var(--treege-input);background-color:var(--treege-input)}@supports (color:color-mix(in lab, red, red)){.w-tc-editor{background-color:color-mix(in oklab, var(--treege-input) 30%, transparent)}}.w-tc-editor:is(.dark *){background-color:var(--treege-input)}@supports (color:color-mix(in lab, red, red)){.w-tc-editor:is(.dark *){background-color:color-mix(in oklab, var(--treege-input) 30%, transparent)}}.treege-scrollbar{scrollbar-width:thin;scrollbar-color:var(--treege-border) transparent}.treege-scrollbar::-webkit-scrollbar{width:6px;height:6px}.treege-scrollbar::-webkit-scrollbar-track{background:0 0}.treege-scrollbar::-webkit-scrollbar-thumb{background-color:var(--treege-border);border-radius:3px}.treege-scrollbar::-webkit-scrollbar-thumb:hover{background-color:var(--treege-muted-foreground)}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:\"*\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-tracking{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:\"*\";inherits:false}@property --tw-brightness{syntax:\"*\";inherits:false}@property --tw-contrast{syntax:\"*\";inherits:false}@property --tw-grayscale{syntax:\"*\";inherits:false}@property --tw-hue-rotate{syntax:\"*\";inherits:false}@property --tw-invert{syntax:\"*\";inherits:false}@property --tw-opacity{syntax:\"*\";inherits:false}@property --tw-saturate{syntax:\"*\";inherits:false}@property --tw-sepia{syntax:\"*\";inherits:false}@property --tw-drop-shadow{syntax:\"*\";inherits:false}@property --tw-drop-shadow-color{syntax:\"*\";inherits:false}@property --tw-drop-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:\"*\";inherits:false}@property --tw-duration{syntax:\"*\";inherits:false}@property --tw-ease{syntax:\"*\";inherits:false}@property --tw-outline-style{syntax:\"*\";inherits:false;initial-value:solid}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}", Wt = () => /* @__PURE__ */ L("style", {
26
- href: "treege-editor",
27
- precedence: "default",
28
- children: Ut
29
- }), Gt = (e) => {
30
- let t = je(), n = Ae();
31
- return ze(() => {
32
- if (!e) return [];
33
- let i = (e, t = /* @__PURE__ */ new Set()) => {
34
- if (t.has(e)) return [];
35
- let r = new Set(t).add(e);
36
- return n.filter((t) => t.target === e).flatMap((e) => [e.source, ...i(e.source, r)]);
37
- }, a = i(e);
38
- return t.filter((e) => a.includes(e.id) && r(e)).map((e) => {
39
- let t = e.data;
40
- return {
41
- label: (typeof t.label == "object" ? t.label.en : t.label) || t.name || e.id,
42
- name: t.name,
43
- nodeId: e.id,
44
- type: t.type || "text"
45
- };
46
- });
47
- }, [
48
- e,
49
- t,
50
- n
51
- ]);
52
- }, Kt = Pe(null), qt = ({ children: e, value: t }) => {
53
- let [n, r] = F(t?.flowId), [i, a] = F(!1), [o, s] = F(null), [c, l] = F(null), u = ze(() => ({
54
- ...t,
55
- ...t?.aiConfig && { aiConfig: {
56
- ...t.aiConfig,
57
- provider: t?.aiConfig.provider ?? "gemini"
58
- } },
59
- closeDeleteNodeConfirmation: () => s(null),
60
- closeNodeTypeChangeConfirmation: () => l(null),
61
- flowId: n,
62
- isNodeSheetOpen: i,
63
- openDeleteNodeConfirmation: (e) => s(e),
64
- openNodeTypeChangeConfirmation: (e) => l(e),
65
- pendingDeleteNodeId: o,
66
- pendingNodeTypeChange: c,
67
- setFlowId: r,
68
- setIsNodeSheetOpen: a
69
- }), [
70
- n,
71
- t,
72
- i,
73
- o,
74
- c
75
- ]);
76
- return /* @__PURE__ */ L(Kt.Provider, {
77
- value: u,
78
- children: e
79
- });
80
- }, U = () => Ie(Kt) ?? {
81
- closeDeleteNodeConfirmation: () => {},
82
- closeNodeTypeChangeConfirmation: () => {},
83
- flowId: void 0,
84
- isNodeSheetOpen: !1,
85
- language: "en",
86
- openDeleteNodeConfirmation: () => {},
87
- openNodeTypeChangeConfirmation: () => {},
88
- pendingDeleteNodeId: null,
89
- pendingNodeTypeChange: null,
90
- setFlowId: () => {},
91
- setIsNodeSheetOpen: () => {}
92
- }, W = (e) => {
93
- let t = U();
94
- return c(e ?? t.language);
95
- };
96
- //#endregion
97
- //#region src/shared/components/ui/scroll-area.tsx
98
- function Jt({ className: e, children: t, ...n }) {
99
- return /* @__PURE__ */ R(Pt.Root, {
100
- "data-slot": "scroll-area",
101
- className: D("tg:relative", e),
102
- ...n,
103
- children: [
104
- /* @__PURE__ */ L(Pt.Viewport, {
105
- "data-slot": "scroll-area-viewport",
106
- className: "tg:size-full tg:rounded-[inherit] tg:outline-none tg:transition-[color,box-shadow] tg:focus-visible:outline-1 tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50",
107
- children: t
108
- }),
109
- /* @__PURE__ */ L(Yt, {}),
110
- /* @__PURE__ */ L(Pt.Corner, {})
111
- ]
112
- });
113
- }
114
- function Yt({ className: e, orientation: t = "vertical", ...n }) {
115
- return /* @__PURE__ */ L(Pt.ScrollAreaScrollbar, {
116
- "data-slot": "scroll-area-scrollbar",
117
- orientation: t,
118
- className: D("tg:flex tg:touch-none tg:select-none tg:p-px tg:transition-colors", t === "vertical" && "tg:h-full tg:w-2.5 tg:border-l tg:border-l-transparent", t === "horizontal" && "tg:h-2.5 tg:flex-col tg:border-t tg:border-t-transparent", e),
119
- ...n,
120
- children: /* @__PURE__ */ L(Pt.ScrollAreaThumb, {
121
- "data-slot": "scroll-area-thumb",
122
- className: "tg:relative tg:flex-1 tg:rounded-full tg:bg-border"
123
- })
124
- });
125
- }
126
- //#endregion
127
- //#region src/editor/features/TreegeEditor/edges/ConditionalEdge.tsx
128
- var Xt = {
129
- "!==": "≠",
130
- "<": "<",
131
- "<=": "≤",
132
- "===": "=",
133
- ">": ">",
134
- ">=": "≥"
135
- }, Zt = (e) => !!e.field && e.value !== void 0 && e.value !== "", Qt = {
136
- conditional: Fe(({ id: t, target: n, sourceX: r, sourceY: i, targetX: a, targetY: o, sourcePosition: s, targetPosition: c, markerEnd: l, style: u, data: f }) => {
137
- let [p, m, _] = ke({
138
- sourcePosition: s,
139
- sourceX: r,
140
- sourceY: i,
141
- targetPosition: c,
142
- targetX: a,
143
- targetY: o
144
- }), [y, ee] = F(!1), { updateEdgeData: te } = N(), b = Gt(n), x = W(), S = !!f?.configured || !!f?.isFallback || !!f?.label || (f?.conditions?.some(Zt) ?? !1), { handleSubmit: re, reset: w, Field: E } = Ve({
145
- defaultValues: {
146
- conditions: f?.conditions || [{
147
- field: b[0]?.nodeId ?? "",
148
- operator: "===",
149
- value: ""
150
- }],
151
- isFallback: !!f?.isFallback,
152
- label: f?.label || ""
153
- },
154
- listeners: {
155
- onChange: ({ formApi: e }) => {
156
- e.handleSubmit().then();
157
- },
158
- onChangeDebounceMs: 150
159
- },
160
- onSubmit: ({ value: e }) => {
161
- te(t, {
162
- ...e,
163
- configured: !0
164
- });
165
- }
166
- }), O = (e) => {
167
- e.stopPropagation();
168
- }, oe = () => {
169
- w({
170
- conditions: [],
171
- isFallback: !1,
172
- label: ""
173
- }), te(t, {
174
- conditions: void 0,
175
- configured: void 0,
176
- isFallback: void 0,
177
- label: void 0
178
- });
179
- }, se = (e) => {
180
- ee(e), !(e || f?.configured) && (f?.isFallback || f?.label || f?.conditions?.length) && te(t, { configured: !0 });
181
- }, ce = () => {
182
- if (f?.isFallback) return f.label || x("editor.conditionalEdge.fallback");
183
- if (f?.label) return f.label;
184
- let t = f?.conditions ?? [];
185
- if (t.length === 0) return null;
186
- if (t.length === 1) {
187
- let [e] = t, n = b.find((t) => t.nodeId === e.field)?.label ?? e.field ?? "";
188
- return `${n === e.field && n.length > 5 ? `${n.slice(0, 5)}…` : n} ${Xt[e.operator] ?? e.operator} ${e.value ?? ""}`;
189
- }
190
- let n = t.filter((t) => t.logicalOperator === e.AND).length, r = t.filter((t) => t.logicalOperator === e.OR).length;
191
- return n > 0 && r === 0 ? `${t.length} ${x("editor.conditionalEdge.conditionsAnd")}` : r > 0 && n === 0 ? `${t.length} ${x("editor.conditionalEdge.conditionsOr")}` : `${t.length} ${x("editor.conditionalEdge.conditionsMixed")}`;
192
- }, le = () => f?.isFallback ? "var(--treege-chart-4)" : S ? "var(--treege-chart-2)" : "var(--treege-chart-3)";
193
- return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(_e, {
194
- path: p,
195
- markerEnd: l,
196
- style: {
197
- ...u,
198
- stroke: le(),
199
- strokeDasharray: f?.isFallback ? "5,5" : void 0,
200
- strokeWidth: S ? 2 : u?.strokeWidth
201
- }
202
- }), /* @__PURE__ */ L(be, { children: /* @__PURE__ */ L("div", {
203
- className: "nodrag nopan tg:absolute",
204
- style: {
205
- pointerEvents: "all",
206
- transform: `translate(-50%, -50%) translate(${m}px,${_}px)`
207
- },
208
- children: /* @__PURE__ */ R(ie, {
209
- open: y,
210
- onOpenChange: se,
211
- children: [/* @__PURE__ */ L(ne, {
212
- asChild: !0,
213
- children: /* @__PURE__ */ R(A, {
214
- variant: S ? "default" : "secondary",
215
- size: "xs",
216
- className: D("tg:transition-[filter]", S ? "tg:hover:bg-primary tg:hover:brightness-125" : "tg:hover:bg-secondary tg:hover:brightness-90"),
217
- onClick: O,
218
- children: [/* @__PURE__ */ L(At, { className: "tg:h-3 tg:w-3" }), S ? ce() : x("editor.conditionalEdge.defineCondition")]
219
- })
220
- }), /* @__PURE__ */ L(ae, {
221
- className: "tg:w-96 tg:p-1",
222
- align: "center",
223
- onClick: (e) => e.stopPropagation(),
224
- children: /* @__PURE__ */ L(Jt, {
225
- className: "tg:flex tg:max-h-150 tg:flex-col tg:p-3",
226
- children: /* @__PURE__ */ L("form", {
227
- onSubmit: (e) => {
228
- e.preventDefault(), e.stopPropagation();
229
- },
230
- children: /* @__PURE__ */ R("div", {
231
- className: "tg:grid tg:gap-5",
232
- children: [
233
- /* @__PURE__ */ R("div", {
234
- className: "tg:space-y-2",
235
- children: [/* @__PURE__ */ L("h4", {
236
- className: "tg:font-medium tg:leading-none",
237
- children: x("editor.conditionalEdge.displayConditions")
238
- }), /* @__PURE__ */ L("p", {
239
- className: "tg:text-muted-foreground tg:text-sm",
240
- children: x("editor.conditionalEdge.displayConditionsDesc")
241
- })]
242
- }),
243
- /* @__PURE__ */ R("div", {
244
- className: "tg:grid tg:gap-4",
245
- children: [
246
- /* @__PURE__ */ L(E, {
247
- name: "label",
248
- children: (e) => /* @__PURE__ */ R(j, { children: [
249
- /* @__PURE__ */ L(d, {
250
- htmlFor: e.name,
251
- children: x("editor.conditionalEdge.labelOptional")
252
- }),
253
- /* @__PURE__ */ L(k, {
254
- id: e.name,
255
- placeholder: x("editor.conditionalEdge.labelPlaceholder"),
256
- value: e.state.value,
257
- onChange: (t) => e.handleChange(t.target.value)
258
- }),
259
- /* @__PURE__ */ L(M, { children: x("editor.conditionalEdge.labelDesc") })
260
- ] })
261
- }),
262
- /* @__PURE__ */ L(E, {
263
- name: "isFallback",
264
- children: (e) => /* @__PURE__ */ L(j, { children: /* @__PURE__ */ R("div", {
265
- className: "tg:flex tg:items-center tg:gap-3 tg:rounded-lg tg:border tg:bg-muted/20 tg:p-3",
266
- children: [/* @__PURE__ */ L(de, {
267
- id: e.name,
268
- checked: e.state.value,
269
- onCheckedChange: (t) => e.handleChange(t)
270
- }), /* @__PURE__ */ R("div", {
271
- className: "tg:flex tg:flex-col tg:gap-1",
272
- children: [/* @__PURE__ */ L(d, {
273
- htmlFor: e.name,
274
- className: "tg:cursor-pointer tg:font-medium",
275
- children: x("editor.conditionalEdge.fallbackPath")
276
- }), /* @__PURE__ */ L(M, {
277
- className: "tg:text-xs",
278
- children: x("editor.conditionalEdge.fallbackPathDesc")
279
- })]
280
- })]
281
- }) })
282
- }),
283
- /* @__PURE__ */ L(E, {
284
- name: "conditions",
285
- mode: "array",
286
- children: (t) => {
287
- let n = t.form.getFieldValue("isFallback");
288
- return /* @__PURE__ */ R("div", {
289
- className: "tg:space-y-3",
290
- children: [/* @__PURE__ */ L(d, {
291
- className: n ? "tg:text-muted-foreground" : "",
292
- children: x("editor.conditionalEdge.conditions")
293
- }), /* @__PURE__ */ R("div", {
294
- className: "tg:space-y-2",
295
- children: [t.state.value?.map((r, i) => /* @__PURE__ */ R("div", {
296
- className: "tg:space-y-2",
297
- children: [/* @__PURE__ */ R("div", {
298
- className: "tg:space-y-2 tg:rounded-lg tg:border tg:bg-muted/30 tg:p-3",
299
- children: [
300
- /* @__PURE__ */ L(E, {
301
- name: `conditions[${i}].field`,
302
- children: (e) => /* @__PURE__ */ R(j, { children: [/* @__PURE__ */ L(d, {
303
- htmlFor: `field-${i}`,
304
- children: x("editor.conditionalEdge.field")
305
- }), /* @__PURE__ */ R(g, {
306
- disabled: n,
307
- value: e.state.value || "",
308
- onValueChange: (t) => e.handleChange(t),
309
- children: [/* @__PURE__ */ L(v, {
310
- id: `field-${i}`,
311
- className: "tg:w-full",
312
- children: /* @__PURE__ */ L(T, { placeholder: x("editor.conditionalEdge.selectField") })
313
- }), /* @__PURE__ */ L(C, { children: b.length === 0 ? /* @__PURE__ */ L(h, {
314
- value: "none",
315
- disabled: !0,
316
- children: x("editor.conditionalEdge.noFieldsAvailable")
317
- }) : b.map((e) => /* @__PURE__ */ R(h, {
318
- value: e.nodeId,
319
- children: [
320
- e.label,
321
- " (",
322
- e.type,
323
- ")"
324
- ]
325
- }, e.nodeId)) })]
326
- })] })
327
- }),
328
- /* @__PURE__ */ R("div", {
329
- className: "tg:flex tg:gap-2",
330
- children: [/* @__PURE__ */ L(E, {
331
- name: `conditions[${i}].operator`,
332
- children: (e) => /* @__PURE__ */ R(j, { children: [/* @__PURE__ */ L(d, {
333
- htmlFor: `operator-${i}`,
334
- children: x("editor.conditionalEdge.operator")
335
- }), /* @__PURE__ */ R(g, {
336
- disabled: n,
337
- value: e.state.value || "===",
338
- onValueChange: (t) => e.handleChange(t),
339
- children: [/* @__PURE__ */ L(v, {
340
- id: `operator-${i}`,
341
- children: /* @__PURE__ */ L(T, {})
342
- }), /* @__PURE__ */ R(C, { children: [
343
- /* @__PURE__ */ L(h, {
344
- value: "===",
345
- children: "="
346
- }),
347
- /* @__PURE__ */ L(h, {
348
- value: "!==",
349
- children: "≠"
350
- }),
351
- /* @__PURE__ */ L(h, {
352
- value: ">",
353
- children: ">"
354
- }),
355
- /* @__PURE__ */ L(h, {
356
- value: "<",
357
- children: "<"
358
- }),
359
- /* @__PURE__ */ L(h, {
360
- value: ">=",
361
- children: ">="
362
- }),
363
- /* @__PURE__ */ L(h, {
364
- value: "<=",
365
- children: "<="
366
- })
367
- ] })]
368
- })] })
369
- }), /* @__PURE__ */ L(E, {
370
- name: `conditions[${i}].value`,
371
- children: (e) => /* @__PURE__ */ R(j, {
372
- className: "tg:w-full",
373
- children: [/* @__PURE__ */ L(d, {
374
- htmlFor: `value-${i}`,
375
- children: x("editor.conditionalEdge.value")
376
- }), /* @__PURE__ */ L(k, {
377
- disabled: n,
378
- id: `value-${i}`,
379
- placeholder: x("editor.conditionalEdge.valuePlaceholder"),
380
- value: e.state.value || "",
381
- onChange: (t) => e.handleChange(t.target.value)
382
- })]
383
- })
384
- })]
385
- }),
386
- t.state.value && t.state.value.length > 1 && /* @__PURE__ */ R(A, {
387
- disabled: n,
388
- type: "button",
389
- variant: "ghost",
390
- size: "sm",
391
- className: "tg:w-full",
392
- onClick: () => {
393
- t.removeValue(i), re().then();
394
- },
395
- children: [/* @__PURE__ */ L(B, { className: "tg:mr-1 tg:h-4 tg:w-4" }), x("editor.conditionalEdge.removeCondition")]
396
- })
397
- ]
398
- }), t.state.value && i < t.state.value.length - 1 && /* @__PURE__ */ L(E, {
399
- name: `conditions[${i}].logicalOperator`,
400
- children: (t) => /* @__PURE__ */ L("div", {
401
- className: "tg:flex tg:justify-center",
402
- children: /* @__PURE__ */ R(g, {
403
- disabled: n,
404
- value: t.state.value || e.AND,
405
- onValueChange: (e) => t.handleChange(e),
406
- children: [/* @__PURE__ */ L(v, {
407
- className: "tg:h-9 tg:w-32 tg:font-semibold",
408
- children: /* @__PURE__ */ L(T, {})
409
- }), /* @__PURE__ */ R(C, { children: [/* @__PURE__ */ L(h, {
410
- value: e.AND,
411
- children: "AND"
412
- }), /* @__PURE__ */ L(h, {
413
- value: e.OR,
414
- children: "OR"
415
- })] })]
416
- })
417
- })
418
- })]
419
- }, `condition-${i}`)), /* @__PURE__ */ R(A, {
420
- disabled: n,
421
- type: "button",
422
- variant: "outline",
423
- size: "sm",
424
- className: "tg:w-full",
425
- onClick: () => {
426
- t.pushValue({
427
- field: b[0]?.nodeId ?? "",
428
- logicalOperator: e.AND,
429
- operator: "===",
430
- value: ""
431
- }), re().then();
432
- },
433
- children: [/* @__PURE__ */ L(z, { className: "tg:mr-2 tg:h-4 tg:w-4" }), x("editor.conditionalEdge.addCondition")]
434
- })]
435
- })]
436
- });
437
- }
438
- })
439
- ]
440
- }),
441
- /* @__PURE__ */ R("div", {
442
- className: "tg:flex tg:justify-end tg:gap-2 tg:pt-2",
443
- children: [/* @__PURE__ */ R(A, {
444
- type: "button",
445
- size: "sm",
446
- variant: "outline",
447
- onClick: oe,
448
- children: [/* @__PURE__ */ L(B, { className: "tg:mr-1 tg:h-4 tg:w-4" }), x("common.clear")]
449
- }), /* @__PURE__ */ L(A, {
450
- type: "button",
451
- size: "sm",
452
- onClick: () => se(!1),
453
- children: x("common.close")
454
- })]
455
- })
456
- ]
457
- })
458
- })
459
- })
460
- })]
461
- })
462
- }) })] });
463
- }),
464
- default: Fe(({ id: e, sourceX: t, sourceY: n, targetX: r, targetY: i, sourcePosition: a, targetPosition: o, style: s, markerEnd: c, selected: l }) => {
465
- let [u, d, f] = ke({
466
- sourcePosition: a,
467
- sourceX: t,
468
- sourceY: n,
469
- targetPosition: o,
470
- targetX: r,
471
- targetY: i
472
- }), { setEdges: p } = N();
473
- return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(_e, {
474
- path: u,
475
- markerEnd: c,
476
- style: s
477
- }), /* @__PURE__ */ L(be, { children: l && /* @__PURE__ */ L("div", {
478
- className: "button-edge__label nodrag nopan",
479
- style: { transform: `translate(-50%, -50%) translate(${d}px,${f}px)` },
480
- children: /* @__PURE__ */ L("button", {
481
- type: "button",
482
- className: "button-edge__button",
483
- onClick: () => {
484
- p((t) => t.filter((t) => t.id !== e));
485
- },
486
- "aria-label": "Remove edge",
487
- children: "×"
488
- })
489
- }) })] });
490
- })
491
- }, $t = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", en = (e = 21) => {
492
- let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
493
- for (; e--;) t += $t[n[e] & 63];
494
- return t;
495
- }, tn = (e, t) => {
496
- if (t.size === 0) return e;
497
- let n = /* @__PURE__ */ new Map();
498
- return e.forEach((e) => {
499
- n.set(e.source, (n.get(e.source) ?? 0) + 1);
500
- }), e.map((e) => {
501
- if (!t.has(e.source) || (n.get(e.source) ?? 0) !== 1) return e;
502
- let { conditions: r, isFallback: i, ...a } = e.data ?? {}, o = a && Object.keys(a).length > 0 ? a : void 0;
503
- return {
504
- ...e,
505
- data: o,
506
- type: "default"
507
- };
508
- });
509
- }, G = () => {
510
- let { setNodes: e, setEdges: t, getNodes: n } = N(), r = P(() => {
511
- e((e) => e.map(({ selected: e, ...t }) => t)), t((e) => e.map(({ selected: e, ...t }) => t));
512
- }, [t, e]), i = P((n) => {
513
- e((e) => e.map((e) => ({
514
- ...e,
515
- selected: e.id === n
516
- }))), t((e) => e.map(({ selected: e, ...t }) => t));
517
- }, [t, e]), a = P((t, n) => {
518
- e((e) => e.map((e) => e.id === t ? {
519
- ...e,
520
- data: {
521
- ...e.data,
522
- ...n
523
- }
524
- } : e));
525
- }, [e]), o = P((t, n, r) => {
526
- e((e) => e.map((e) => {
527
- if (e.id !== t) return e;
528
- let i = e.type === n ? e.data : {};
529
- return {
530
- ...e,
531
- data: r === void 0 ? i : {
532
- ...i,
533
- type: r
534
- },
535
- type: n
536
- };
537
- }));
538
- }, [e]), s = P((e, t) => {
539
- let r = n().find((e) => e.selected);
540
- r && o(r.id, e, t);
541
- }, [n, o]), c = P((e) => {
542
- let t = n().find((e) => e.selected);
543
- t && a(t.id, e);
544
- }, [n, a]), l = P((n) => {
545
- e((e) => e.filter((e) => e.id !== n)), t((e) => {
546
- let t = e.filter((e) => e.target === n), r = e.filter((e) => e.source === n), i = new Set(t.map((e) => e.source)), a = e.filter((e) => e.source !== n && e.target !== n);
547
- if (t.length === 1 && r.length === 1) {
548
- let [e] = t, [n] = r, o = {
549
- data: e.data,
550
- id: en(),
551
- source: e.source,
552
- target: n.target,
553
- type: e.type
554
- };
555
- return tn([...a, o], i);
556
- }
557
- return tn(a, i);
558
- });
559
- }, [e, t]);
560
- return {
561
- clearSelection: r,
562
- deleteNode: l,
563
- deleteSelectedNode: P(() => {
564
- let e = n().find((e) => e.selected);
565
- e && l(e.id);
566
- }, [n, l]),
567
- selectNode: i,
568
- updateNodeData: a,
569
- updateNodeType: o,
570
- updateSelectedNodeData: c,
571
- updateSelectedNodeType: s
572
- };
573
- }, nn = ({ nodeId: e, label: t, placeholder: n, className: r }) => {
574
- let { language: i } = U(), { updateNodeData: a, clearSelection: o } = G(), s = W(), c = Be(null), l = t?.[i] ?? "", u = n || s("editor.treegeNode.labelPlaceholder"), d = (e) => e.stopPropagation();
575
- return Le(() => {
576
- let e = setTimeout(() => {
577
- c.current?.focus();
578
- }, 300);
579
- return () => clearTimeout(e);
580
- }, []), /* @__PURE__ */ L("input", {
581
- ref: c,
582
- type: "text",
583
- value: l,
584
- placeholder: u,
585
- onChange: (n) => {
586
- a(e, { label: {
587
- ...t,
588
- [i]: n.target.value
589
- } });
590
- },
591
- onKeyDown: (e) => {
592
- e.key === "Enter" && (e.preventDefault(), c.current?.blur(), o());
593
- },
594
- onClick: d,
595
- onMouseDown: d,
596
- onPointerDown: d,
597
- className: D("nodrag nopan tg:w-full tg:truncate tg:bg-transparent tg:outline-none tg:placeholder:text-muted-foreground/40", r)
598
- });
599
- };
600
- //#endregion
601
- //#region src/shared/components/ui/dropdown-menu.tsx
602
- function K({ ...e }) {
603
- return /* @__PURE__ */ L(V.Root, {
604
- "data-slot": "dropdown-menu",
605
- ...e
606
- });
607
- }
608
- function rn({ ...e }) {
609
- return /* @__PURE__ */ L(V.Trigger, {
610
- "data-slot": "dropdown-menu-trigger",
611
- ...e
612
- });
613
- }
614
- function an({ className: e, sideOffset: t = 4, ...n }) {
615
- return /* @__PURE__ */ L(V.Portal, { children: /* @__PURE__ */ L(V.Content, {
616
- "data-slot": "dropdown-menu-content",
617
- sideOffset: t,
618
- className: D("tg:data-[state=closed]:fade-out-0 tg:data-[state=open]:fade-in-0 tg:data-[state=closed]:zoom-out-95 tg:data-[state=open]:zoom-in-95 tg:data-[side=bottom]:slide-in-from-top-2 tg:data-[side=left]:slide-in-from-right-2 tg:data-[side=right]:slide-in-from-left-2 tg:data-[side=top]:slide-in-from-bottom-2 tg:z-50 tg:max-h-(--radix-dropdown-menu-content-available-height) tg:min-w-[8rem] tg:origin-(--radix-dropdown-menu-content-transform-origin) tg:overflow-y-auto tg:overflow-x-hidden tg:rounded-md tg:border tg:bg-popover tg:p-1 tg:text-popover-foreground tg:shadow-md tg:data-[state=closed]:animate-out tg:data-[state=open]:animate-in", e),
619
- ...n
620
- }) });
621
- }
622
- function q({ ...e }) {
623
- return /* @__PURE__ */ L(V.Group, {
624
- "data-slot": "dropdown-menu-group",
625
- ...e
626
- });
627
- }
628
- function J({ className: e, inset: t, variant: n = "default", ...r }) {
629
- return /* @__PURE__ */ L(V.Item, {
630
- "data-slot": "dropdown-menu-item",
631
- "data-inset": t,
632
- "data-variant": n,
633
- className: D("tg:data-[variant=destructive]:*:[svg]:!text-destructive tg:relative tg:flex tg:cursor-default tg:select-none tg:items-center tg:gap-2 tg:rounded-sm tg:px-2 tg:py-1.5 tg:text-sm tg:outline-hidden tg:focus:bg-accent tg:focus:text-accent-foreground tg:data-[disabled]:pointer-events-none tg:data-[inset]:pl-8 tg:data-[variant=destructive]:text-destructive tg:data-[disabled]:opacity-50 tg:data-[variant=destructive]:focus:bg-destructive/10 tg:data-[variant=destructive]:focus:text-destructive tg:dark:data-[variant=destructive]:focus:bg-destructive/20 tg:[&_svg:not([class*='size-'])]:size-4 tg:[&_svg:not([class*='text-'])]:text-muted-foreground tg:[&_svg]:pointer-events-none tg:[&_svg]:shrink-0", e),
634
- ...r
635
- });
636
- }
637
- function on({ className: e, inset: t, ...n }) {
638
- return /* @__PURE__ */ L(V.Label, {
639
- "data-slot": "dropdown-menu-label",
640
- "data-inset": t,
641
- className: D("tg:px-1.5 tg:py-1 tg:font-medium tg:text-muted-foreground tg:text-xs tg:data-[inset]:pl-7", e),
642
- ...n
643
- });
644
- }
645
- function Y({ className: e, ...t }) {
646
- return /* @__PURE__ */ L(V.Separator, {
647
- "data-slot": "dropdown-menu-separator",
648
- className: D("tg:-mx-1 tg:my-1 tg:h-px tg:bg-border", e),
649
- ...t
650
- });
651
- }
652
- //#endregion
653
- //#region src/editor/features/TreegeEditor/nodes/components/NodeMoreMenu.tsx
654
- var sn = ({ nodeId: e, className: t }) => {
655
- let { selectNode: n } = G(), { setIsNodeSheetOpen: r, openDeleteNodeConfirmation: i } = U(), a = W(), o = (e) => e.stopPropagation();
656
- return /* @__PURE__ */ R(K, {
657
- modal: !1,
658
- children: [/* @__PURE__ */ L(rn, {
659
- asChild: !0,
660
- onClick: o,
661
- children: /* @__PURE__ */ L("button", {
662
- type: "button",
663
- "aria-label": a("editor.nodeActionsSheet.editNode"),
664
- className: D("nodrag nopan tg:absolute tg:top-2 tg:right-2 tg:flex tg:h-6 tg:w-6 tg:cursor-pointer tg:items-center tg:justify-center tg:rounded-md tg:opacity-60 tg:transition-all tg:hover:text-[--treege-color-primary] tg:hover:opacity-100", t),
665
- children: /* @__PURE__ */ L(gt, { className: "tg:h-3.5 tg:w-3.5" })
666
- })
667
- }), /* @__PURE__ */ R(an, {
668
- align: "end",
669
- onClick: o,
670
- children: [
671
- /* @__PURE__ */ R(J, {
672
- onSelect: () => {
673
- n(e), r(!0);
674
- },
675
- children: [/* @__PURE__ */ L(wt, {}), a("common.settings")]
676
- }),
677
- /* @__PURE__ */ L(Y, {}),
678
- /* @__PURE__ */ R(J, {
679
- variant: "destructive",
680
- onSelect: () => {
681
- i(e);
682
- },
683
- children: [/* @__PURE__ */ L(Et, {}), a("common.delete")]
684
- })
685
- ]
686
- })]
687
- });
688
- }, cn = Nt("tg:inline-flex tg:w-fit tg:shrink-0 tg:items-center tg:justify-center tg:gap-1 tg:overflow-hidden tg:rounded-full tg:border tg:border-transparent tg:px-2 tg:py-0.5 tg:text-xs tg:font-medium tg:whitespace-nowrap tg:transition-[color,box-shadow] tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:aria-invalid:border-destructive tg:aria-invalid:ring-destructive/20 tg:dark:aria-invalid:ring-destructive/40 tg:[&>svg]:pointer-events-none tg:[&>svg]:size-3", {
689
- defaultVariants: { variant: "default" },
690
- variants: { variant: {
691
- blue: "tg:bg-blue-500 tg:text-white tg:dark:bg-blue-600",
692
- default: "tg:border-transparent tg:bg-primary tg:text-primary-foreground tg:[a&]:hover:bg-primary/90",
693
- destructive: "tg:border-transparent tg:bg-destructive tg:text-white tg:[a&]:hover:bg-destructive/90 tg:focus-visible:ring-destructive/20 tg:dark:focus-visible:ring-destructive/40 tg:dark:bg-destructive/60",
694
- outline: "tg:border-foreground/30 tg:text-foreground tg:[a&]:hover:bg-accent tg:[a&]:hover:text-accent-foreground",
695
- purple: "tg:bg-purple-600 tg:hover:bg-purple-700 tg:text-white",
696
- secondary: "tg:border-transparent tg:bg-secondary tg:text-secondary-foreground tg:[a&]:hover:bg-secondary/90"
697
- } }
698
- });
699
- function ln({ className: e, variant: t, asChild: n = !1, ...r }) {
700
- return /* @__PURE__ */ L(n ? Mt : "span", {
701
- "data-slot": "badge",
702
- className: D(cn({ variant: t }), e),
703
- ...r
704
- });
705
- }
706
- var un = Fe(({ data: e, id: t }) => /* @__PURE__ */ R(I, { children: [
707
- /* @__PURE__ */ L(Ce, {}),
708
- /* @__PURE__ */ L("div", {
709
- className: "tg:-top-3.5 tg:absolute tg:left-6",
710
- children: /* @__PURE__ */ R(ln, {
711
- className: "tg:max-w-50 tg:bg-chart-2",
712
- children: [/* @__PURE__ */ L(We, { className: "tg:!w-3 tg:!h-3" }), /* @__PURE__ */ L(nn, {
713
- nodeId: t,
714
- label: e?.label,
715
- className: "tg:min-w-0 tg:flex-1 tg:text-xs tg:text-white tg:placeholder:text-white/60"
716
- })]
717
- })
718
- }),
719
- /* @__PURE__ */ L(sn, { nodeId: t })
720
- ] })), dn = {
721
- data: { type: "text" },
722
- id: en(),
723
- position: {
724
- x: 0,
725
- y: 0
726
- },
727
- type: "input"
728
- }, fn = () => {
729
- let { setNodes: e, setEdges: t, screenToFlowPosition: n, getNode: i, getNodes: a, getEdges: o } = N(), s = P((n, i, a = !1, s) => {
730
- let c = n.id, l = o().filter((e) => e.source === c), u = r(n);
731
- if (l.length > 0 && !u) return;
732
- let d = en(), f = {
733
- ...dn,
734
- ...s && {
735
- data: s.data ?? {},
736
- type: s.type
737
- },
738
- id: d,
739
- position: i,
740
- selected: a
741
- };
742
- n?.parentId && (f.parentId = n.parentId, f.extent = "parent"), e((e) => e.concat(f)), t((e) => {
743
- let t = e.filter((e) => e.source === c).length > 0, n = {
744
- data: t && u ? { conditions: [{
745
- field: c,
746
- operator: "===",
747
- value: ""
748
- }] } : void 0,
749
- id: en(),
750
- source: c,
751
- target: d,
752
- type: t && u ? "conditional" : "default"
753
- };
754
- return t && u ? e.map((e) => e.source === c ? {
755
- ...e,
756
- data: {
757
- ...e.data,
758
- conditions: e.data?.conditions || [{
759
- field: c,
760
- operator: "===",
761
- value: ""
762
- }]
763
- },
764
- type: "conditional"
765
- } : e).concat(n) : e.concat(n);
766
- }), a && requestAnimationFrame(() => {
767
- e((e) => e.map((e) => ({
768
- ...e,
769
- selected: e.id === d
770
- }))), t((e) => e.map((e) => ({
771
- ...e,
772
- selected: !1
773
- })));
774
- });
775
- }, [
776
- o,
777
- e,
778
- t
779
- ]), c = P((e) => {
780
- t((t) => {
781
- let n = Oe(e, t), a = e.source, o = i(a);
782
- return n.filter((e) => e.source === a).length > 1 && o && r(o) ? n.map((e) => e.source === a ? {
783
- ...e,
784
- data: {
785
- ...e.data,
786
- conditions: e.data?.conditions || [{
787
- field: a,
788
- operator: "===",
789
- value: ""
790
- }]
791
- },
792
- type: "conditional"
793
- } : e) : n;
794
- });
795
- }, [t, i]), l = P((e, t) => {
796
- let n = i(e);
797
- if (!n) return;
798
- let r = getComputedStyle(document.documentElement).getPropertyValue("--node-height"), c = getComputedStyle(document.documentElement).getPropertyValue("--node-width"), l = parseFloat(r) || 100, u = parseFloat(c) || 100, d = n.position.y + l + 100, f = a(), p = o(), m = f.filter((t) => p.some((n) => n.source === e && n.target === t.id)).map((e) => e.position.x);
799
- s(n, {
800
- x: m.length === 0 ? n.position.x : m.length % 2 == 1 ? Math.max(...m) + u + 50 : Math.min(...m) - u - 50,
801
- y: d
802
- }, !0, t);
803
- }, [
804
- i,
805
- a,
806
- o,
807
- s
808
- ]), u = P((e, t) => {
809
- if (!t.isValid) {
810
- let { clientX: r, clientY: a } = "changedTouches" in e ? e.changedTouches[0] : e, o = t.fromNode;
811
- if (!o) return;
812
- let c = n({
813
- x: r,
814
- y: a
815
- }), l = o.parentId ? i(o.parentId) : void 0, u = l?.position ?? {
816
- x: 0,
817
- y: 0
818
- };
819
- s(o, l ? {
820
- x: c.x - u.x,
821
- y: c.y - u.y
822
- } : c, !0);
823
- }
824
- }, [
825
- s,
826
- i,
827
- n
828
- ]), d = P((e) => {
829
- t((t) => tn(t.filter((t) => !e.find((e) => e.id === t.id)), new Set(e.map((e) => e.source))));
830
- }, [t]);
831
- return {
832
- isValidConnection: P((e) => {
833
- if (e.source === e.target) return !1;
834
- let t = i(e.source);
835
- return t ? !(o().filter((t) => t.source === e.source).length > 0 && !r(t)) : !1;
836
- }, [i, o]),
837
- onAddFromHandle: l,
838
- onConnect: c,
839
- onConnectEnd: u,
840
- onEdgesDelete: d
841
- };
842
- }, X = {
843
- address: "address",
844
- autocomplete: "autocomplete",
845
- checkbox: "checkbox",
846
- date: "date",
847
- daterange: "daterange",
848
- file: "file",
849
- hidden: "hidden",
850
- http: "http",
851
- number: "number",
852
- password: "password",
853
- radio: "radio",
854
- select: "select",
855
- submit: "submit",
856
- switch: "switch",
857
- text: "text",
858
- textarea: "textarea",
859
- time: "time",
860
- timerange: "timerange"
861
- }, pn = {
862
- divider: "divider",
863
- title: "title"
864
- }, mn = {
865
- [X.address]: pt,
866
- [X.autocomplete]: St,
867
- [X.checkbox]: Ye,
868
- [X.date]: Ge,
869
- [X.daterange]: Ke,
870
- [X.file]: vt,
871
- [X.hidden]: at,
872
- [X.http]: tt,
873
- [X.number]: ot,
874
- [X.password]: lt,
875
- [X.radio]: Qe,
876
- [X.select]: dt,
877
- [X.submit]: Ct,
878
- [X.switch]: Tt,
879
- [X.text]: qe,
880
- [X.textarea]: He,
881
- [X.time]: $e,
882
- [X.timerange]: et,
883
- [pn.divider]: ht,
884
- [pn.title]: st,
885
- [l.flow]: _t
886
- }, hn = bt, Z = (e) => e && mn[e] || hn, gn = ({ nodeId: e, isConnectable: t }) => {
887
- let { onAddFromHandle: n } = fn(), r = W(), [i, a] = F(!1), o = Z(l.flow);
888
- return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(xe, {
889
- type: "source",
890
- position: Te.Bottom,
891
- isConnectable: t,
892
- onClick: (e) => {
893
- e.defaultPrevented || a(!0);
894
- },
895
- className: "tg:flex tg:h-6! tg:w-6! tg:cursor-pointer tg:items-center tg:justify-center tg:rounded-sm tg:transition-colors tg:hover:bg-primary/80!",
896
- children: /* @__PURE__ */ L(z, { className: "tg:h-4 tg:w-4 tg:text-primary-foreground" })
897
- }), /* @__PURE__ */ R(K, {
898
- open: i,
899
- onOpenChange: a,
900
- children: [/* @__PURE__ */ L(rn, {
901
- asChild: !0,
902
- children: /* @__PURE__ */ L("span", {
903
- "aria-hidden": !0,
904
- className: "tg:-translate-x-1/2 tg:pointer-events-none tg:absolute tg:bottom-0 tg:left-1/2 tg:h-0 tg:w-0"
905
- })
906
- }), /* @__PURE__ */ R(an, {
907
- align: "center",
908
- side: "bottom",
909
- className: "treege-scrollbar tg:max-h-80",
910
- children: [
911
- /* @__PURE__ */ R(q, { children: [/* @__PURE__ */ L(on, { children: r("editor.selectNodeType.options.input") }), Object.values(X).map((t) => /* @__PURE__ */ R(J, {
912
- onClick: () => n(e, {
913
- data: { type: t },
914
- type: l.input
915
- }),
916
- className: "tg:capitalize",
917
- children: [/* @__PURE__ */ L(Z(t), {}), t]
918
- }, t))] }),
919
- /* @__PURE__ */ L(Y, {}),
920
- /* @__PURE__ */ R(q, { children: [/* @__PURE__ */ L(on, { children: r("editor.selectNodeType.options.ui") }), Object.values(pn).map((t) => /* @__PURE__ */ R(J, {
921
- onClick: () => n(e, {
922
- data: { type: t },
923
- type: l.ui
924
- }),
925
- className: "tg:capitalize",
926
- children: [/* @__PURE__ */ L(Z(t), {}), t]
927
- }, t))] }),
928
- /* @__PURE__ */ L(Y, {}),
929
- /* @__PURE__ */ R(q, { children: [/* @__PURE__ */ L(on, { children: r("common.other") }), /* @__PURE__ */ R(J, {
930
- onClick: () => n(e, {
931
- data: {},
932
- type: l.flow
933
- }),
934
- children: [/* @__PURE__ */ L(o, {}), r("editor.selectNodeType.options.flow")]
935
- })] })
936
- ]
937
- })]
938
- })] });
939
- }, _n = (e) => {
940
- switch (e) {
941
- case "number":
942
- case "daterange":
943
- case "timerange":
944
- case "file": return null;
945
- case "switch": return !1;
946
- case "checkbox": return [];
947
- default: return "";
948
- }
949
- }, vn = ({ nodeId: e, data: n }) => {
950
- let { language: r } = U(), i = n?.type;
951
- if (!i) return null;
952
- let o = {
953
- data: n,
954
- id: e,
955
- position: {
956
- x: 0,
957
- y: 0
958
- },
959
- type: "input"
960
- }, c = a(n.label, r), l = t(o), u = /* @__PURE__ */ R("div", {
961
- className: "tg:flex tg:items-center tg:gap-1 tg:text-[10px] tg:text-muted-foreground tg:capitalize tg:[&>svg]:size-3",
962
- children: [/* @__PURE__ */ L(Z(i), {}), i]
963
- });
964
- if (i === "hidden") {
965
- let e = n.defaultValue?.type === "static" ? n.defaultValue.staticValue : void 0, t = n.defaultValue?.type === "reference" ? n.defaultValue.referenceField : void 0, r = Array.isArray(e) ? e.join(", ") : typeof e == "boolean" ? String(e) : e ?? (t ? `→ ${t}` : "");
966
- return /* @__PURE__ */ R("div", {
967
- className: "tg:pointer-events-none tg:flex tg:select-none tg:flex-col tg:gap-1 tg:text-sm",
968
- children: [
969
- u,
970
- /* @__PURE__ */ L("span", {
971
- className: "tg:truncate tg:font-medium",
972
- children: c || l
973
- }),
974
- /* @__PURE__ */ L("span", {
975
- className: "tg:truncate tg:text-muted-foreground tg:text-xs",
976
- children: r || "—"
977
- })
978
- ]
979
- });
980
- }
981
- let d = fe[i];
982
- if (!d) return null;
983
- let f = a(n.helperText, r), p = s(n, r);
984
- return /* @__PURE__ */ R("div", {
985
- className: D("tg:pointer-events-none tg:flex tg:select-none tg:flex-col tg:gap-1", i === "submit" && "tg:items-center"),
986
- children: [u, /* @__PURE__ */ L(d, {
987
- node: o,
988
- value: _n(i),
989
- setValue: () => {},
990
- id: e,
991
- name: l,
992
- label: c || void 0,
993
- placeholder: p || void 0,
994
- helperText: f || void 0
995
- })]
996
- });
997
- }, yn = Object.values(X), bn = Object.values(pn), xn = ({ nodeId: e, nodeType: t, subType: n }) => {
998
- let { updateNodeType: r } = G(), { getEdges: i } = N(), { openNodeTypeChangeConfirmation: a } = U(), o = W(), s = (e) => e.stopPropagation(), c = n || t, u = t === l.flow ? o("editor.selectNodeType.options.flow") : c, d = Z(c), f = Z(l.flow), p = (t, n) => {
999
- let o = i().filter((t) => t.source === e).length;
1000
- if ((t === l.ui || t === l.flow) && o > 1) {
1001
- a({
1002
- nodeId: e,
1003
- subType: n,
1004
- type: t
1005
- });
1006
- return;
1007
- }
1008
- r(e, t, n);
1009
- };
1010
- return /* @__PURE__ */ R(K, { children: [/* @__PURE__ */ L(rn, {
1011
- asChild: !0,
1012
- onClick: s,
1013
- children: /* @__PURE__ */ R(ln, {
1014
- variant: "default",
1015
- className: "nodrag nopan tg:cursor-pointer tg:px-1.5 tg:py-0 tg:text-[10px] tg:capitalize tg:[&>svg]:size-2.5",
1016
- children: [
1017
- /* @__PURE__ */ L(d, { className: "tg:mt-0.5" }),
1018
- u || o("editor.selectNodeType.nodeType"),
1019
- /* @__PURE__ */ L(Xe, {})
1020
- ]
1021
- })
1022
- }), /* @__PURE__ */ R(an, {
1023
- align: "start",
1024
- className: "treege-scrollbar tg:max-h-80",
1025
- onClick: s,
1026
- children: [
1027
- /* @__PURE__ */ R(q, { children: [/* @__PURE__ */ L(on, { children: o("editor.selectNodeType.options.input") }), yn.map((e) => {
1028
- let r = Z(e);
1029
- return /* @__PURE__ */ R(J, {
1030
- onClick: () => p(l.input, e),
1031
- className: D("tg:capitalize", t === l.input && e === n && "tg:bg-accent"),
1032
- children: [/* @__PURE__ */ L(r, {}), e]
1033
- }, e);
1034
- })] }),
1035
- /* @__PURE__ */ L(Y, {}),
1036
- /* @__PURE__ */ R(q, { children: [/* @__PURE__ */ L(on, { children: o("editor.selectNodeType.options.ui") }), bn.map((e) => {
1037
- let r = Z(e);
1038
- return /* @__PURE__ */ R(J, {
1039
- onClick: () => p(l.ui, e),
1040
- className: D("tg:capitalize", t === l.ui && e === n && "tg:bg-accent"),
1041
- children: [/* @__PURE__ */ L(r, {}), e]
1042
- }, e);
1043
- })] }),
1044
- /* @__PURE__ */ L(Y, {}),
1045
- /* @__PURE__ */ R(q, { children: [/* @__PURE__ */ L(on, { children: o("common.other") }), /* @__PURE__ */ R(J, {
1046
- onClick: () => p(l.flow),
1047
- className: D(t === l.flow && "tg:bg-accent"),
1048
- children: [/* @__PURE__ */ L(f, {}), o("editor.selectNodeType.options.flow")]
1049
- })] })
1050
- ]
1051
- })] });
1052
- }, Sn = [
1053
- "radio",
1054
- "select",
1055
- "checkbox",
1056
- "autocomplete"
1057
- ], Cn = ({ nodeId: e, data: t }) => {
1058
- let [n, r] = F(!1), [i, a] = F(""), [o, s] = F(""), { updateNodeData: c } = G(), { language: l } = U(), u = W(), f = t && "type" in t ? t.type : void 0;
1059
- if (!(f && Sn.includes(f))) return null;
1060
- let p = t.options ?? [], m = () => {
1061
- a(""), s("");
1062
- }, h = (t) => {
1063
- t?.preventDefault();
1064
- let n = i.trim(), a = o.trim() || n;
1065
- if (!(n || a)) return;
1066
- let s = {
1067
- label: { [l]: n },
1068
- value: a
1069
- };
1070
- c(e, { options: [...p, s] }), m(), r(!1);
1071
- }, g = (e) => {
1072
- r(e), e || m();
1073
- }, _ = (e) => {
1074
- e.key === "Enter" && (e.preventDefault(), h());
1075
- }, v = (e) => e.stopPropagation();
1076
- return /* @__PURE__ */ R("div", {
1077
- className: "nodrag nopan tg:my-1 tg:flex tg:flex-col tg:gap-0.5",
1078
- children: [p.map((e, t) => {
1079
- let n = u(e.label) || e.value || "—", r = `${e.value || "opt"}-${t}`;
1080
- return /* @__PURE__ */ L("div", {
1081
- className: "tg:truncate tg:text-muted-foreground tg:text-xs",
1082
- children: n
1083
- }, r);
1084
- }), /* @__PURE__ */ R(ie, {
1085
- open: n,
1086
- onOpenChange: g,
1087
- children: [/* @__PURE__ */ L(ne, {
1088
- asChild: !0,
1089
- onClick: v,
1090
- children: /* @__PURE__ */ R(A, {
1091
- type: "button",
1092
- variant: "link",
1093
- size: "xs",
1094
- className: "tg:w-fit tg:p-0! tg:focus-visible:border-transparent! tg:focus-visible:ring-0!",
1095
- children: [/* @__PURE__ */ L(z, { className: "tg:size-3" }), u("editor.inputNodeForm.addOption")]
1096
- })
1097
- }), /* @__PURE__ */ L(ae, {
1098
- align: "start",
1099
- className: "tg:w-64 tg:p-3",
1100
- onClick: v,
1101
- children: /* @__PURE__ */ R("form", {
1102
- onSubmit: h,
1103
- className: "tg:flex tg:flex-col tg:gap-2",
1104
- children: [
1105
- /* @__PURE__ */ R("div", {
1106
- className: "tg:flex tg:flex-col tg:gap-1",
1107
- children: [/* @__PURE__ */ L(d, {
1108
- htmlFor: `${e}-option-label`,
1109
- className: "tg:text-xs",
1110
- children: u("editor.inputNodeForm.optionLabel")
1111
- }), /* @__PURE__ */ L(k, {
1112
- id: `${e}-option-label`,
1113
- autoFocus: !0,
1114
- value: i,
1115
- onChange: (e) => a(e.target.value),
1116
- onKeyDown: _
1117
- })]
1118
- }),
1119
- /* @__PURE__ */ R("div", {
1120
- className: "tg:flex tg:flex-col tg:gap-1",
1121
- children: [/* @__PURE__ */ L(d, {
1122
- htmlFor: `${e}-option-value`,
1123
- className: "tg:text-xs",
1124
- children: u("editor.inputNodeForm.optionValue")
1125
- }), /* @__PURE__ */ L(k, {
1126
- id: `${e}-option-value`,
1127
- value: o,
1128
- onChange: (e) => s(e.target.value),
1129
- onKeyDown: _
1130
- })]
1131
- }),
1132
- /* @__PURE__ */ L(A, {
1133
- type: "submit",
1134
- size: "sm",
1135
- disabled: !(i.trim() || o.trim()),
1136
- children: u("common.create")
1137
- })
1138
- ]
1139
- })
1140
- })]
1141
- })]
1142
- });
1143
- }, wn = ({ nodeId: e, required: t }) => {
1144
- let { updateNodeData: n } = G(), r = W();
1145
- return /* @__PURE__ */ L(ln, {
1146
- variant: t ? "destructive" : "outline",
1147
- asChild: !0,
1148
- className: "nodrag nopan tg:cursor-pointer tg:px-1.5 tg:py-0 tg:text-[10px] tg:capitalize tg:[&>svg]:size-2.5",
1149
- children: /* @__PURE__ */ L("button", {
1150
- type: "button",
1151
- onClick: (r) => {
1152
- r.stopPropagation(), n(e, { required: !t });
1153
- },
1154
- children: r(t ? "editor.inputNodeForm.required" : "editor.inputNodeForm.optional")
1155
- })
1156
- });
1157
- }, Tn = ({ children: e, inGroup: t, isSubmit: n }) => /* @__PURE__ */ L("div", {
1158
- className: D("react-flow__node__wrapper tg:relative", t && "in-group", n && "submit-type"),
1159
- children: e
1160
- }), En = Fe((e) => {
1161
- let { id: t, isConnectable: n, parentId: r, selected: i, type: a } = e, o = e.type === "input" ? e.data : void 0, s = e.type === "ui" ? e.data : void 0, c = o?.type ?? s?.type, l = o?.type === "submit", u = !i && !!o?.type;
1162
- return /* @__PURE__ */ R(Tn, {
1163
- inGroup: !!r,
1164
- isSubmit: l,
1165
- children: [
1166
- /* @__PURE__ */ L(sn, { nodeId: t }),
1167
- /* @__PURE__ */ L(xe, {
1168
- type: "target",
1169
- position: Te.Top,
1170
- isConnectable: n,
1171
- isConnectableStart: a === "ui"
1172
- }),
1173
- u && o ? /* @__PURE__ */ L(vn, {
1174
- nodeId: t,
1175
- data: o
1176
- }) : /* @__PURE__ */ R(I, { children: [
1177
- /* @__PURE__ */ L(nn, {
1178
- nodeId: t,
1179
- label: e.data?.label,
1180
- placeholder: o?.name,
1181
- className: D("tg:py-1", a === "ui" && "tg:capitalize")
1182
- }),
1183
- /* @__PURE__ */ R("div", {
1184
- className: "tg:mb-1 tg:flex tg:gap-1",
1185
- children: [/* @__PURE__ */ L(xn, {
1186
- nodeId: t,
1187
- nodeType: a,
1188
- subType: c
1189
- }), o && !l && /* @__PURE__ */ L(wn, {
1190
- nodeId: t,
1191
- required: o.required
1192
- })]
1193
- }),
1194
- o && /* @__PURE__ */ L(Cn, {
1195
- nodeId: t,
1196
- data: o
1197
- })
1198
- ] }),
1199
- /* @__PURE__ */ L(gn, {
1200
- nodeId: t,
1201
- isConnectable: n
1202
- })
1203
- ]
1204
- });
1205
- }), Dn = {
1206
- [l.flow]: En,
1207
- [l.group]: un,
1208
- [l.input]: En,
1209
- [l.ui]: En
1210
- }, On = ({ show: e, onToggle: t }) => /* @__PURE__ */ L(ve, {
1211
- onClick: t,
1212
- title: e ? "Hide minimap" : "Show minimap",
1213
- children: L(e ? mt : pt, {})
1214
- }), kn = {
1215
- "!==": "≠",
1216
- "<": "<",
1217
- "<=": "≤",
1218
- "===": "=",
1219
- ">": ">",
1220
- ">=": "≥"
1221
- }, An = (e, t) => {
1222
- let n = e?.filter((e) => e.value !== void 0 && e.value !== "") ?? [];
1223
- return n.length === 0 ? "" : n.map((e, n) => {
1224
- let r = kn[e.operator ?? ""] ?? e.operator ?? "", i = `${e.field ? t(e.field) : ""} ${r} ${e.value ?? ""}`.trim();
1225
- return `${n === 0 ? "" : ` ${e.logicalOperator ?? "AND"} `}${i}`;
1226
- }).join("");
1227
- }, jn = () => {
1228
- let { pendingNodeTypeChange: e, closeNodeTypeChangeConfirmation: t } = U(), { getEdges: n, getNode: r, setEdges: i, updateEdgeData: a } = N(), { updateNodeType: o } = G(), s = W(), c = ze(() => e ? n().filter((t) => t.source === e.nodeId).sort((e, t) => {
1229
- let n = r(e.target)?.position ?? {
1230
- x: 0,
1231
- y: 0
1232
- }, i = r(t.target)?.position ?? {
1233
- x: 0,
1234
- y: 0
1235
- };
1236
- return n.x - i.x || n.y - i.y;
1237
- }) : [], [
1238
- e,
1239
- n,
1240
- r
1241
- ]), [l, u] = F("");
1242
- Le(() => {
1243
- c.length > 0 && u(c[0].id);
1244
- }, [c]);
1245
- let f = (e) => {
1246
- e || t();
1247
- }, h = () => {
1248
- if (!(e && l)) {
1249
- t();
1250
- return;
1251
- }
1252
- let { nodeId: n, type: r, subType: s } = e;
1253
- i((e) => e.filter((e) => e.source !== n || e.id === l)), a(l, {
1254
- conditions: void 0,
1255
- configured: void 0,
1256
- isFallback: void 0
1257
- }), o(n, r, s), t();
1258
- }, g = (e) => {
1259
- let t = r(e)?.data;
1260
- return s(t && "label" in t ? t.label : void 0) || t?.name || (e.length > 5 ? `${e.slice(0, 5)}…` : e);
1261
- }, v = (e) => {
1262
- let t = r(e)?.data, n = s(t?.label) || t?.name || e;
1263
- return n === e && n.length > 5 ? `${n.slice(0, 5)}…` : n;
1264
- }, y = (e) => e?.isFallback ? s("editor.conditionalEdge.fallback") : e?.label ? e.label : An(e?.conditions, v) || s("editor.changeNodeTypeDialog.noConditions");
1265
- return /* @__PURE__ */ L(m, {
1266
- open: e !== null,
1267
- onOpenChange: f,
1268
- children: /* @__PURE__ */ R(_, {
1269
- showCloseButton: !1,
1270
- children: [
1271
- /* @__PURE__ */ R(me, { children: [/* @__PURE__ */ L(p, { children: s("editor.changeNodeTypeDialog.title") }), /* @__PURE__ */ L(ee, { children: s("editor.changeNodeTypeDialog.description") })] }),
1272
- /* @__PURE__ */ L(Jt, {
1273
- className: "tg:max-h-80",
1274
- children: /* @__PURE__ */ L(E, {
1275
- value: l,
1276
- onValueChange: u,
1277
- className: "tg:gap-2 tg:pr-2",
1278
- children: c.map((e) => {
1279
- let t = e.data, n = y(t), r = g(e.target);
1280
- return /* @__PURE__ */ R(d, {
1281
- htmlFor: `keep-${e.id}`,
1282
- className: "tg:flex tg:cursor-pointer tg:items-start tg:gap-3 tg:rounded-lg tg:border tg:bg-muted/20 tg:p-3",
1283
- children: [/* @__PURE__ */ L(pe, {
1284
- id: `keep-${e.id}`,
1285
- value: e.id,
1286
- className: "tg:mt-1"
1287
- }), /* @__PURE__ */ R("div", {
1288
- className: "tg:flex tg:flex-col tg:gap-1",
1289
- children: [/* @__PURE__ */ L("span", {
1290
- className: "tg:font-medium",
1291
- children: r
1292
- }), /* @__PURE__ */ L("span", {
1293
- className: "tg:text-muted-foreground tg:text-xs",
1294
- children: n
1295
- })]
1296
- })]
1297
- }, e.id);
1298
- })
1299
- })
1300
- }),
1301
- /* @__PURE__ */ R(S, { children: [/* @__PURE__ */ L(A, {
1302
- variant: "outline",
1303
- onClick: t,
1304
- children: s("common.cancel")
1305
- }), /* @__PURE__ */ L(A, {
1306
- onClick: h,
1307
- disabled: !l,
1308
- children: s("editor.changeNodeTypeDialog.keepBranch")
1309
- })] })
1310
- ]
1311
- })
1312
- });
1313
- }, Mn = () => {
1314
- let { pendingDeleteNodeId: e, closeDeleteNodeConfirmation: t } = U(), { deleteNode: n } = G(), r = W();
1315
- return /* @__PURE__ */ L(m, {
1316
- open: e !== null,
1317
- onOpenChange: (e) => {
1318
- e || t();
1319
- },
1320
- children: /* @__PURE__ */ R(_, {
1321
- showCloseButton: !1,
1322
- children: [/* @__PURE__ */ R(me, { children: [/* @__PURE__ */ L(p, { children: r("editor.nodeActionsSheet.deleteNode") }), /* @__PURE__ */ L(ee, { children: r("editor.nodeActionsSheet.deleteNodeConfirm") })] }), /* @__PURE__ */ R(S, { children: [/* @__PURE__ */ L(A, {
1323
- variant: "outline",
1324
- onClick: t,
1325
- children: r("common.cancel")
1326
- }), /* @__PURE__ */ L(A, {
1327
- onClick: () => {
1328
- e && n(e), t();
1329
- },
1330
- children: r("common.delete")
1331
- })] })]
1332
- })
1333
- });
1334
- }, Nn = 200, Pn = 100, Fn = (e) => !!(e.measured?.width && e.measured?.height), In = (e, t, n) => {
1335
- let r = n === "TB" ? "y" : "x";
1336
- return e.reduce((e, n) => t.node(n.id)[r] < t.node(e.id)[r] ? n : e, e[0]);
1337
- }, Ln = (e, t, n) => {
1338
- let r = new It.graphlib.Graph().setDefaultEdgeLabel(() => ({}));
1339
- r.setGraph({
1340
- nodesep: n.horizontalSpacing,
1341
- rankdir: n.direction,
1342
- ranksep: n.verticalSpacing
1343
- });
1344
- let i = /* @__PURE__ */ new Set();
1345
- e.forEach((e) => {
1346
- i.add(e.id), r.setNode(e.id, {
1347
- height: e.measured?.height ?? Pn,
1348
- width: e.measured?.width ?? Nn
1349
- });
1350
- }), t.forEach((e) => {
1351
- i.has(e.source) && i.has(e.target) && r.setEdge(e.source, e.target);
1352
- }), It.layout(r);
1353
- let a = In(e, r, n.direction), o = a.measured?.width ?? Nn, s = a.measured?.height ?? Pn, c = r.node(a.id), l = a.position.x - (c.x - o / 2), u = a.position.y - (c.y - s / 2), d = /* @__PURE__ */ new Map();
1354
- return e.forEach((e) => {
1355
- let { x: t, y: n } = r.node(e.id), i = e.measured?.width ?? Nn, a = e.measured?.height ?? Pn;
1356
- d.set(e.id, {
1357
- x: t - i / 2 + l,
1358
- y: n - a / 2 + u
1359
- });
1360
- }), d;
1361
- }, Rn = (e) => {
1362
- let t = /* @__PURE__ */ new Map();
1363
- return e.forEach((e) => {
1364
- let n = t.get(e.parentId) ?? [];
1365
- n.push(e), t.set(e.parentId, n);
1366
- }), t;
1367
- }, zn = (e, t, n = {}) => {
1368
- let r = {
1369
- direction: n.direction ?? "TB",
1370
- horizontalSpacing: n.horizontalSpacing ?? 60,
1371
- verticalSpacing: n.verticalSpacing ?? 80
1372
- }, i = /* @__PURE__ */ new Map();
1373
- return Rn(e).forEach((e) => {
1374
- let n = e.filter(Fn);
1375
- n.length !== 0 && Ln(n, t, r).forEach((e, t) => {
1376
- i.set(t, e);
1377
- });
1378
- }), e.map((e) => {
1379
- let t = i.get(e.id);
1380
- return t ? {
1381
- ...e,
1382
- position: t
1383
- } : e;
1384
- });
1385
- }, Bn = (e) => Array.from(e.nodeLookup.values()).map((e) => `${e.id}:${e.measured?.width ?? 0}x${e.measured?.height ?? 0}`).join("|"), Vn = ({ direction: e, horizontalSpacing: t, verticalSpacing: n } = {}) => {
1386
- let { getNodes: r, getEdges: i, setNodes: a } = N(), o = Me(), s = Ne(Bn);
1387
- return Le(() => {
1388
- o && s && a(zn(r(), i(), {
1389
- direction: e,
1390
- horizontalSpacing: t,
1391
- verticalSpacing: n
1392
- }));
1393
- }, [
1394
- o,
1395
- s,
1396
- e,
1397
- t,
1398
- n,
1399
- r,
1400
- i,
1401
- a
1402
- ]), null;
1403
- }, Hn = "You are a Treege decision tree generator. You must generate valid JSON structures for decision trees.\n\nIMPORTANT RULES:\n1. Always respond with valid JSON only, no markdown, no code blocks, no explanations outside the JSON\n2. The JSON must have this exact structure: { \"nodes\": [...], \"edges\": [...] }\n3. Every node must have: id (string), type (string), position ({ x: number, y: number }), data (object)\n4. Every edge must have: id (string), source (string), target (string)\n5. For regex patterns: ALWAYS use double backslashes (\\\\) for special characters (\\\\s, \\\\d, etc.)\n6. AVOID using \"pattern\" field unless specifically requested - prefer using simple validation\n7. For submit buttons, use type \"input\" with data.type \"submit\", NOT type \"flow\"\n8. For conditional logic, use conditional edges with proper operators (===, !==, >, <, >=, <=)\n\nNODE TYPES:\n- \"input\": Form input fields (text, number, select, checkbox, etc.)\n- \"ui\": UI elements (title, divider)\n- \"flow\": Navigation/flow control nodes\n- \"group\": Container for organizing nodes\n\nINPUT NODE TYPES (data.type):\n- \"text\", \"number\", \"textarea\", \"password\"\n- \"select\", \"radio\", \"checkbox\", \"switch\"\n- \"autocomplete\", \"date\", \"daterange\", \"time\", \"timerange\"\n- \"file\", \"address\", \"http\", \"hidden\", \"submit\"\n\nINPUT NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Field Label\",\n \"name\": \"fieldName\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter value...\",\n \"helperText\": \"Optional helper text\",\n \"pattern\": \"regex pattern (optional)\",\n \"errorMessage\": \"Error message if validation fails\",\n \"options\": [{ \"value\": \"val\", \"label\": \"Label\" }], // for select/radio/checkbox\n \"multiple\": false // for select/checkbox\n }\n}\n\nUI NODE TYPES (data.type):\n- \"title\": Display a title\n- \"divider\": Display a divider line\n\nUI NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"UI Element Label\",\n \"type\": \"title\" // or \"divider\"\n }\n}\n\nFLOW NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"flow\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Flow Step Label\",\n \"targetId\": \"next-node-id\" // optional\n }\n}\n\nGROUP NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"group\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Group Label\"\n }\n}\n\nEDGE STRUCTURE:\n{\n \"id\": \"edge-id\",\n \"source\": \"source-node-id\",\n \"target\": \"target-node-id\",\n \"type\": \"default\" // or \"conditional\" for conditional logic\n}\n\nCONDITIONAL EDGE STRUCTURE:\n{\n \"id\": \"edge-id\",\n \"source\": \"source-node-id\",\n \"target\": \"target-node-id\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If condition is true\", // optional label for the edge\n \"conditions\": [\n {\n \"field\": \"field-node-id\", // ID of the field to check\n \"operator\": \">=\", // operators: ===, !==, >, <, >=, <=\n \"value\": \"18\" // value to compare (as string)\n }\n ],\n \"operator\": \"AND\" // optional: \"AND\" or \"OR\" for multiple conditions (default: AND)\n }\n}\n\nIMPORTANT: For conditional edges, the value must ALWAYS be a string, even for numbers.\nExample: For \"age >= 18\", use \"value\": \"18\" (not value: 18)\n\nLAYOUT GUIDELINES:\n- Position nodes in a vertical flow (top to bottom)\n- Start at position { x: 0, y: 0 }\n- Space nodes vertically by exactly 250 pixels between each position (node height 150px + 100px spacing)\n- For horizontal spacing, use 350 pixels\n- Create logical flow from top to bottom\n- IMPORTANT: Keep consistent vertical spacing to avoid overlap\n- Each node position Y should increment by 250: first at y:0, second at y:250, third at y:500, etc.\n\nEXAMPLES:\n\nUser: \"Create a simple contact form with name, email and message\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"Contact Form\", \"type\": \"title\" }\n },\n {\n \"id\": \"name-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Name\",\n \"name\": \"name\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter your name\"\n }\n },\n {\n \"id\": \"email-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Email\",\n \"name\": \"email\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"your@email.com\"\n }\n },\n {\n \"id\": \"message-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 750 },\n \"data\": {\n \"label\": \"Message\",\n \"name\": \"message\",\n \"type\": \"textarea\",\n \"required\": true,\n \"placeholder\": \"Enter your message\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"name-1\" },\n { \"id\": \"e2\", \"source\": \"name-1\", \"target\": \"email-1\" },\n { \"id\": \"e3\", \"source\": \"email-1\", \"target\": \"message-1\" }\n ]\n}\n\nUser: \"Create a user registration form with age, address and country selector\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"User Registration\", \"type\": \"title\" }\n },\n {\n \"id\": \"age-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Age\",\n \"name\": \"age\",\n \"type\": \"number\",\n \"required\": true,\n \"placeholder\": \"Enter your age\"\n }\n },\n {\n \"id\": \"address-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Address\",\n \"name\": \"address\",\n \"type\": \"address\",\n \"required\": true,\n \"placeholder\": \"Enter your address\"\n }\n },\n {\n \"id\": \"country-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 750 },\n \"data\": {\n \"label\": \"Country\",\n \"name\": \"country\",\n \"type\": \"select\",\n \"required\": true,\n \"options\": [\n { \"value\": \"us\", \"label\": \"United States\" },\n { \"value\": \"ca\", \"label\": \"Canada\" },\n { \"value\": \"uk\", \"label\": \"United Kingdom\" },\n { \"value\": \"fr\", \"label\": \"France\" },\n { \"value\": \"de\", \"label\": \"Germany\" }\n ]\n }\n },\n {\n \"id\": \"submit-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 1000 },\n \"data\": {\n \"label\": \"Submit\",\n \"type\": \"submit\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"age-1\" },\n { \"id\": \"e2\", \"source\": \"age-1\", \"target\": \"address-1\" },\n { \"id\": \"e3\", \"source\": \"address-1\", \"target\": \"country-1\" },\n { \"id\": \"e4\", \"source\": \"country-1\", \"target\": \"submit-1\" }\n ]\n}\n\nUser: \"Create a form with name, age, and show different questions based on age (movie for 18+, color for under 18)\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"Survey Form\", \"type\": \"title\" }\n },\n {\n \"id\": \"name-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Name\",\n \"name\": \"name\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter your name\"\n }\n },\n {\n \"id\": \"age-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Age\",\n \"name\": \"age\",\n \"type\": \"number\",\n \"required\": true,\n \"placeholder\": \"Enter your age\"\n }\n },\n {\n \"id\": \"movie-1\",\n \"type\": \"input\",\n \"position\": { \"x\": -350, \"y\": 750 },\n \"data\": {\n \"label\": \"Favorite Movie\",\n \"name\": \"favoriteMovie\",\n \"type\": \"text\",\n \"required\": true,\n \"helperText\": \"For adults 18 and over\"\n }\n },\n {\n \"id\": \"color-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 350, \"y\": 750 },\n \"data\": {\n \"label\": \"Favorite Color\",\n \"name\": \"favoriteColor\",\n \"type\": \"text\",\n \"required\": true,\n \"helperText\": \"For those under 18\"\n }\n },\n {\n \"id\": \"submit-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 1000 },\n \"data\": {\n \"label\": \"Submit\",\n \"type\": \"submit\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"name-1\" },\n { \"id\": \"e2\", \"source\": \"name-1\", \"target\": \"age-1\" },\n {\n \"id\": \"e3\",\n \"source\": \"age-1\",\n \"target\": \"movie-1\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If 18 or older\",\n \"conditions\": [\n {\n \"field\": \"age-1\",\n \"operator\": \">=\",\n \"value\": \"18\"\n }\n ]\n }\n },\n {\n \"id\": \"e4\",\n \"source\": \"age-1\",\n \"target\": \"color-1\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If under 18\",\n \"conditions\": [\n {\n \"field\": \"age-1\",\n \"operator\": \"<\",\n \"value\": \"18\"\n }\n ]\n }\n },\n { \"id\": \"e5\", \"source\": \"movie-1\", \"target\": \"submit-1\" },\n { \"id\": \"e6\", \"source\": \"color-1\", \"target\": \"submit-1\" }\n ]\n}\n\nRemember:\n- Always respond with ONLY valid JSON\n- No markdown code blocks\n- No explanations outside the JSON\n- Follow the exact structure shown above\n- For submit buttons, ALWAYS use type \"input\" with data.type \"submit\"\n- For conditional edges, ALWAYS specify the value as a string and use proper operators (>=, <, ===, etc.)\n- Never leave condition values empty - always provide the comparison value\n", Un = {
1404
- claude: "claude-3-5-haiku-20241022",
1405
- deepseek: "deepseek-chat",
1406
- gemini: "gemini-2.5-flash",
1407
- openai: "gpt-4o-mini"
1408
- }, Wn = .3;
1409
- function Gn(e) {
1410
- try {
1411
- return JSON.parse(e);
1412
- } catch (t) {
1413
- let n = e.replace(/```json\n?/g, "").replace(/```\n?/g, "").trim();
1414
- try {
1415
- return JSON.parse(n);
1416
- } catch {
1417
- throw console.error("Failed to parse AI response:", e.substring(0, 500)), Error(`Invalid JSON response from AI: ${t instanceof Error ? t.message : "Unknown error"}`);
1418
- }
1419
- }
1420
- }
1421
- async function Kn(e) {
1422
- let t = e.config.model || Un.gemini, n = e.config.temperature ?? Wn, r = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/${t}:generateContent?key=${e.config.apiKey}`, {
1423
- body: JSON.stringify({
1424
- contents: [{ parts: [{ text: `${Hn}\n\nUser request: ${e.prompt}` }] }],
1425
- generationConfig: {
1426
- responseMimeType: "application/json",
1427
- temperature: n
1428
- }
1429
- }),
1430
- headers: { "Content-Type": "application/json" },
1431
- method: "POST"
1432
- });
1433
- if (!r.ok) {
1434
- let e = await r.text();
1435
- throw Error(`Gemini API error: ${e}`);
1436
- }
1437
- let i = (await r.json()).candidates?.[0]?.content?.parts?.[0]?.text;
1438
- if (!i) throw Error("No response from Gemini");
1439
- return Gn(i);
1440
- }
1441
- async function qn(e) {
1442
- let t = e.config.model || Un.openai, n = e.config.temperature ?? Wn, r = await fetch("https://api.openai.com/v1/chat/completions", {
1443
- body: JSON.stringify({
1444
- messages: [{
1445
- content: Hn,
1446
- role: "system"
1447
- }, {
1448
- content: e.prompt,
1449
- role: "user"
1450
- }],
1451
- model: t,
1452
- response_format: { type: "json_object" },
1453
- temperature: n
1454
- }),
1455
- headers: {
1456
- Authorization: `Bearer ${e.config.apiKey}`,
1457
- "Content-Type": "application/json"
1458
- },
1459
- method: "POST"
1460
- });
1461
- if (!r.ok) {
1462
- let e = await r.text();
1463
- throw Error(`OpenAI API error: ${e}`);
1464
- }
1465
- let i = (await r.json()).choices?.[0]?.message?.content;
1466
- if (!i) throw Error("No response from OpenAI");
1467
- return Gn(i);
1468
- }
1469
- async function Jn(e) {
1470
- let t = e.config.model || Un.deepseek, n = e.config.temperature ?? Wn, r = await fetch("https://api.deepseek.com/v1/chat/completions", {
1471
- body: JSON.stringify({
1472
- messages: [{
1473
- content: Hn,
1474
- role: "system"
1475
- }, {
1476
- content: e.prompt,
1477
- role: "user"
1478
- }],
1479
- model: t,
1480
- response_format: { type: "json_object" },
1481
- temperature: n
1482
- }),
1483
- headers: {
1484
- Authorization: `Bearer ${e.config.apiKey}`,
1485
- "Content-Type": "application/json"
1486
- },
1487
- method: "POST"
1488
- });
1489
- if (!r.ok) {
1490
- let e = await r.text();
1491
- throw Error(`DeepSeek API error: ${e}`);
1492
- }
1493
- let i = (await r.json()).choices?.[0]?.message?.content;
1494
- if (!i) throw Error("No response from DeepSeek");
1495
- return Gn(i);
1496
- }
1497
- async function Yn(e) {
1498
- let t = e.config.model || Un.claude, n = e.config.temperature ?? Wn, r = await fetch("https://api.anthropic.com/v1/messages", {
1499
- body: JSON.stringify({
1500
- max_tokens: 4096,
1501
- messages: [{
1502
- content: e.prompt,
1503
- role: "user"
1504
- }],
1505
- model: t,
1506
- system: Hn,
1507
- temperature: n
1508
- }),
1509
- headers: {
1510
- "anthropic-version": "2023-06-01",
1511
- "Content-Type": "application/json",
1512
- "x-api-key": e.config.apiKey
1513
- },
1514
- method: "POST"
1515
- });
1516
- if (!r.ok) {
1517
- let e = await r.text();
1518
- throw Error(`Claude API error: ${e}`);
1519
- }
1520
- let i = (await r.json()).content?.[0]?.text;
1521
- if (!i) throw Error("No response from Claude");
1522
- return Gn(i);
1523
- }
1524
- function Xn(e) {
1525
- switch (e.config.provider) {
1526
- case "gemini": return Kn(e);
1527
- case "openai": return qn(e);
1528
- case "deepseek": return Jn(e);
1529
- case "claude": return Yn(e);
1530
- default: throw Error(`Unsupported AI provider: ${e.config.provider}`);
1531
- }
1532
- }
1533
- //#endregion
1534
- //#region src/editor/features/TreegeEditor/panel/AIGeneratorDialog.tsx
1535
- var Zn = ({ aiConfig: e, onGenerate: t }) => {
1536
- let [n, r] = F(!1), [i, a] = F(""), [o, s] = F(!1), c = W(), l = async () => {
1537
- if (!i.trim()) {
1538
- H.error(c("editor.aiGenerator.enterDescription"));
1539
- return;
1540
- }
1541
- if (!e?.apiKey) {
1542
- H.error(c("editor.aiGenerator.missingApiKey"), { description: c("editor.aiGenerator.missingApiKeyDesc") });
1543
- return;
1544
- }
1545
- s(!0);
1546
- try {
1547
- let n = await Xn({
1548
- config: e,
1549
- prompt: i.trim()
1550
- });
1551
- t({
1552
- edges: n.edges,
1553
- nodes: n.nodes
1554
- }), H.success(c("editor.aiGenerator.successTitle"), { description: c("editor.aiGenerator.successDescription").replace("{nodes}", String(n.nodes.length)).replace("{edges}", String(n.edges.length)) }), a(""), r(!1);
1555
- } catch (e) {
1556
- console.error("AI generation error:", e), H.error(c("editor.aiGenerator.failedToGenerate"), { description: e instanceof Error ? e.message : c("editor.aiGenerator.unknownError") });
1557
- } finally {
1558
- s(!1);
1559
- }
1560
- };
1561
- return /* @__PURE__ */ R(m, {
1562
- open: n,
1563
- onOpenChange: r,
1564
- children: [/* @__PURE__ */ L(re, {
1565
- asChild: !0,
1566
- children: /* @__PURE__ */ R(A, {
1567
- variant: "outline",
1568
- size: "sm",
1569
- disabled: !e?.apiKey,
1570
- children: [
1571
- /* @__PURE__ */ L(kt, { className: "tg:h-4 tg:w-4 tg:text-[#13d3b4]" }),
1572
- " ",
1573
- /* @__PURE__ */ L("span", {
1574
- className: "tg:hidden tg:md:inline",
1575
- children: c("editor.aiGenerator.buttonLabel")
1576
- })
1577
- ]
1578
- })
1579
- }), /* @__PURE__ */ R(_, {
1580
- className: "tg:sm:max-w-[550px]!",
1581
- children: [
1582
- /* @__PURE__ */ R(me, { children: [/* @__PURE__ */ L(p, { children: c("editor.aiGenerator.title") }), /* @__PURE__ */ L(ee, { children: c("editor.aiGenerator.titleDescription") })] }),
1583
- /* @__PURE__ */ R("div", {
1584
- className: "tg:grid tg:gap-4 tg:py-4",
1585
- children: [/* @__PURE__ */ R("div", {
1586
- className: "tg:grid tg:gap-2",
1587
- children: [
1588
- /* @__PURE__ */ L("label", {
1589
- htmlFor: "ai-prompt",
1590
- className: "tg:font-medium tg:text-sm",
1591
- children: c("editor.aiGenerator.description")
1592
- }),
1593
- /* @__PURE__ */ L(ce, {
1594
- placeholder: c("editor.aiGenerator.descriptionPlaceholder"),
1595
- value: i,
1596
- onChange: (e) => a(e.target.value),
1597
- onKeyDown: (e) => {
1598
- (e.metaKey || e.ctrlKey) && e.key === "Enter" && (e.preventDefault(), l());
1599
- },
1600
- rows: 6,
1601
- disabled: o,
1602
- className: "tg:resize-none"
1603
- }),
1604
- /* @__PURE__ */ L("p", {
1605
- className: "tg:text-muted-foreground tg:text-xs",
1606
- children: c("editor.aiGenerator.keyboardShortcut").replace("{cmdEnter}", "⌘ Enter").replace("{ctrlEnter}", "Ctrl Enter")
1607
- })
1608
- ]
1609
- }), !e?.apiKey && /* @__PURE__ */ R("div", {
1610
- className: "tg:rounded-md tg:bg-muted tg:p-3 tg:text-sm",
1611
- children: [/* @__PURE__ */ L("p", {
1612
- className: "tg:font-medium",
1613
- children: c("editor.aiGenerator.aiNotConfigured")
1614
- }), /* @__PURE__ */ R("p", {
1615
- className: "tg:mt-1 tg:text-muted-foreground tg:text-xs",
1616
- children: [
1617
- c("editor.aiGenerator.aiNotConfiguredDesc").replace("{code}", ""),
1618
- " ",
1619
- /* @__PURE__ */ L("code", {
1620
- className: "tg:rounded tg:bg-background tg:px-1 tg:py-0.5",
1621
- children: "aiConfig"
1622
- })
1623
- ]
1624
- })]
1625
- })]
1626
- }),
1627
- /* @__PURE__ */ R(S, { children: [/* @__PURE__ */ L(A, {
1628
- variant: "outline",
1629
- onClick: () => r(!1),
1630
- disabled: o,
1631
- children: c("editor.aiGenerator.cancel")
1632
- }), /* @__PURE__ */ L(A, {
1633
- onClick: l,
1634
- disabled: o || !i.trim() || !e?.apiKey,
1635
- children: o ? /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(ft, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), c("editor.aiGenerator.generating")] }) : /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(kt, { className: "tg:h-4 tg:w-4 tg:text-[--treege-color-primary]" }), c("editor.aiGenerator.generate")] })
1636
- })] })
1637
- ]
1638
- })]
1639
- });
1640
- }, Qn = en(), $n = ({ onExportJson: e, onSave: t, extraMenuItems: n }) => {
1641
- let { flowId: r, setFlowId: i, aiConfig: a } = U(), { setNodes: o, setEdges: s, addNodes: c, screenToFlowPosition: l } = N(), u = r || Qn, d = je(), f = Ae(), p = Be(null), m = W(), h = () => {
1642
- let e = (window.innerWidth || 0) / 2, t = (window.innerHeight || 0) / 2, n = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--node-width"), 10), r = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--node-height"), 10), i = l({
1643
- x: e - n,
1644
- y: t - r
1645
- });
1646
- c([{
1647
- ...dn,
1648
- id: en(),
1649
- position: i,
1650
- selected: !0
1651
- }]);
1652
- }, g = ({ target: e }) => {
1653
- let t = e.files?.[0];
1654
- if (!t) return;
1655
- let n = new FileReader();
1656
- n.onload = (e) => {
1657
- try {
1658
- let t = JSON.parse(e.target?.result);
1659
- t && Array.isArray(t.nodes) && Array.isArray(t.edges) ? (o(t.nodes), s(t.edges), H.success(m("editor.actionsPanel.importSuccess"), { description: m("editor.actionsPanel.importSuccessDesc") })) : H.error(m("editor.actionsPanel.invalidJson"), { description: m("editor.actionsPanel.invalidJsonDesc") });
1660
- } catch (e) {
1661
- console.warn(e), H.error(m("editor.actionsPanel.parseError"), { description: m("editor.actionsPanel.parseErrorDesc") });
1662
- }
1663
- p.current && (p.current.value = "");
1664
- }, n.readAsText(t);
1665
- }, _ = () => {
1666
- let t = {
1667
- edges: f,
1668
- id: u,
1669
- nodes: d
1670
- }, n = new Blob([JSON.stringify(t, null, 2)], { type: "application/json" }), a = URL.createObjectURL(n), o = document.createElement("a");
1671
- o.href = a, o.download = "treege.json", o.click(), URL.revokeObjectURL(a), H.success(m("editor.actionsPanel.downloadSuccess"), { description: m("editor.actionsPanel.downloadSuccessDesc") }), r || i?.(u), e?.(t);
1672
- }, v = P(() => {
1673
- r || i?.(u), t?.({
1674
- edges: f,
1675
- id: u,
1676
- nodes: d
1677
- });
1678
- }, [
1679
- f,
1680
- r,
1681
- u,
1682
- d,
1683
- t,
1684
- i
1685
- ]);
1686
- return Le(() => {
1687
- let e = (e) => {
1688
- (e.ctrlKey || e.metaKey) && e.key === "s" && (e.preventDefault(), v());
1689
- };
1690
- return window.addEventListener("keydown", e), () => {
1691
- window.removeEventListener("keydown", e);
1692
- };
1693
- }, [v]), /* @__PURE__ */ R(we, {
1694
- position: "top-right",
1695
- className: "tg:flex tg:gap-2",
1696
- children: [
1697
- /* @__PURE__ */ L(Zn, {
1698
- aiConfig: a,
1699
- onGenerate: (e) => {
1700
- o(e.nodes), s(e.edges);
1701
- }
1702
- }),
1703
- /* @__PURE__ */ R(A, {
1704
- variant: "outline",
1705
- size: "sm",
1706
- onClick: h,
1707
- children: [
1708
- /* @__PURE__ */ L(z, {}),
1709
- " ",
1710
- /* @__PURE__ */ L("span", {
1711
- className: "tg:hidden tg:md:inline",
1712
- children: m("editor.actionsPanel.addNode")
1713
- })
1714
- ]
1715
- }),
1716
- /* @__PURE__ */ R(A, {
1717
- variant: "outline",
1718
- size: "sm",
1719
- onClick: v,
1720
- children: [
1721
- /* @__PURE__ */ L(xt, {}),
1722
- " ",
1723
- /* @__PURE__ */ L("span", {
1724
- className: "tg:hidden tg:md:inline",
1725
- children: m("common.save")
1726
- })
1727
- ]
1728
- }),
1729
- /* @__PURE__ */ R(K, { children: [/* @__PURE__ */ L(rn, {
1730
- asChild: !0,
1731
- children: /* @__PURE__ */ L(A, {
1732
- variant: "outline",
1733
- size: "sm",
1734
- children: /* @__PURE__ */ L(it, {})
1735
- })
1736
- }), /* @__PURE__ */ R(an, {
1737
- align: "start",
1738
- children: [
1739
- /* @__PURE__ */ L(on, {
1740
- className: "tg:font-normal",
1741
- children: /* @__PURE__ */ R("div", {
1742
- className: "tg:flex tg:flex-col tg:gap-1",
1743
- children: [/* @__PURE__ */ L("span", {
1744
- className: "tg:text-muted-foreground tg:text-xs",
1745
- children: "Flow ID"
1746
- }), /* @__PURE__ */ R("button", {
1747
- onClick: async () => {
1748
- try {
1749
- await navigator.clipboard.writeText(u), H.success(m("editor.actionsPanel.idCopied"), { description: u });
1750
- } catch {
1751
- H.error(m("editor.actionsPanel.copyFailed"));
1752
- }
1753
- },
1754
- className: "tg:flex tg:items-center tg:gap-2 tg:font-mono tg:text-muted-foreground tg:transition-colors tg:hover:text-primary",
1755
- type: "button",
1756
- children: [/* @__PURE__ */ L(nt, { className: "tg:h-3 tg:w-3" }), /* @__PURE__ */ L("span", {
1757
- className: "tg:truncate tg:text-xs",
1758
- children: u
1759
- })]
1760
- })]
1761
- })
1762
- }),
1763
- /* @__PURE__ */ L(Y, {}),
1764
- /* @__PURE__ */ R(q, { children: [/* @__PURE__ */ R(J, {
1765
- onClick: () => p?.current?.click(),
1766
- children: [
1767
- /* @__PURE__ */ L(rt, {}),
1768
- " ",
1769
- m("editor.actionsPanel.importJson")
1770
- ]
1771
- }), /* @__PURE__ */ R(J, {
1772
- onClick: _,
1773
- children: [
1774
- /* @__PURE__ */ L(Ue, {}),
1775
- " ",
1776
- m("editor.actionsPanel.exportJson")
1777
- ]
1778
- })] }),
1779
- n && n.length > 0 && /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(Y, {}), /* @__PURE__ */ L(q, { children: n.map((e, t) => /* @__PURE__ */ R(J, {
1780
- onClick: e.onClick,
1781
- className: e.destructive ? "tg:text-destructive tg:focus:text-destructive" : void 0,
1782
- children: [e.icon, e.label]
1783
- }, t)) })] }),
1784
- /* @__PURE__ */ L(Y, {}),
1785
- /* @__PURE__ */ L(q, { children: /* @__PURE__ */ R(J, {
1786
- onClick: () => {
1787
- o([]), s([]), H.success(m("editor.actionsPanel.clearSuccess"), { description: m("editor.actionsPanel.clearSuccessDesc") });
1788
- },
1789
- className: "tg:text-destructive tg:focus:text-destructive",
1790
- children: [
1791
- /* @__PURE__ */ L(Et, { className: "tg:text-destructive" }),
1792
- " ",
1793
- m("editor.actionsPanel.clear")
1794
- ]
1795
- }) })
1796
- ]
1797
- })] }),
1798
- /* @__PURE__ */ L("input", {
1799
- type: "file",
1800
- accept: "application/json,.json",
1801
- className: "tg:hidden",
1802
- ref: p,
1803
- onChange: g
1804
- })
1805
- ]
1806
- });
1807
- }, er = {
1808
- ar: "ar",
1809
- de: "de",
1810
- en: "en",
1811
- es: "es",
1812
- fr: "fr",
1813
- it: "it",
1814
- pt: "pt"
1815
- }, Q = ({ value: e = "en", onValueChange: t }) => /* @__PURE__ */ R(g, {
1816
- value: e,
1817
- onValueChange: t,
1818
- children: [/* @__PURE__ */ L(v, {
1819
- className: "tg:uppercase",
1820
- children: /* @__PURE__ */ L(T, { placeholder: "" })
1821
- }), /* @__PURE__ */ L(C, { children: /* @__PURE__ */ L(w, { children: Object.values(er).map((e) => /* @__PURE__ */ L(h, {
1822
- value: e,
1823
- className: "tg:uppercase",
1824
- children: e
1825
- }, e)) }) })]
1826
- }), $ = () => {
1827
- let e = je(), t = ze(() => e.filter(n), [e]), r = ze(() => e.filter((e) => e.selected), [e]), i = ze(() => e.find((e) => e.selected), [e]);
1828
- return {
1829
- groupNodes: t,
1830
- hasSelectedNodes: r.length > 0,
1831
- nodes: e,
1832
- selectedNode: i,
1833
- selectedNodes: r
1834
- };
1835
- }, tr = () => {
1836
- let [e, t] = F("en"), { updateSelectedNodeData: n } = G(), { selectedNode: r } = $(), i = W(), { Field: a } = Ve({
1837
- defaultValues: {
1838
- label: r?.data?.label || { en: "" },
1839
- targetId: r?.data?.targetId || ""
1840
- },
1841
- listeners: {
1842
- onChange: ({ formApi: e }) => {
1843
- e.handleSubmit().then();
1844
- },
1845
- onChangeDebounceMs: 150
1846
- },
1847
- onSubmit: ({ value: e }) => {
1848
- n(e);
1849
- }
1850
- });
1851
- return /* @__PURE__ */ L("form", {
1852
- onSubmit: (e) => {
1853
- e.preventDefault(), e.stopPropagation();
1854
- },
1855
- children: /* @__PURE__ */ R("div", {
1856
- className: "tg:grid tg:gap-6",
1857
- children: [/* @__PURE__ */ R("div", {
1858
- className: "tg:flex tg:items-end tg:gap-2",
1859
- children: [/* @__PURE__ */ L(a, {
1860
- name: "label",
1861
- children: (t) => /* @__PURE__ */ R(j, {
1862
- className: "tg:flex-1",
1863
- children: [/* @__PURE__ */ L(d, {
1864
- htmlFor: t.name,
1865
- children: i("editor.flowNodeForm.label")
1866
- }), /* @__PURE__ */ L(k, {
1867
- id: t.name,
1868
- name: t.name,
1869
- value: t.state.value?.[e] || "",
1870
- onBlur: t.handleBlur,
1871
- onChange: ({ target: n }) => {
1872
- t.handleChange({
1873
- ...t.state.value,
1874
- [e]: n.value
1875
- });
1876
- }
1877
- })]
1878
- })
1879
- }), /* @__PURE__ */ L(Q, {
1880
- value: e,
1881
- onValueChange: t
1882
- })]
1883
- }), /* @__PURE__ */ L(a, {
1884
- name: "targetId",
1885
- children: (e) => /* @__PURE__ */ R(j, { children: [
1886
- /* @__PURE__ */ R(d, {
1887
- htmlFor: e.name,
1888
- children: [i("editor.flowNodeForm.targetId"), " (Flow ID)"]
1889
- }),
1890
- /* @__PURE__ */ L(k, {
1891
- id: e.name,
1892
- name: e.name,
1893
- value: e.state.value,
1894
- onBlur: e.handleBlur,
1895
- onChange: ({ target: t }) => e.handleChange(t.value)
1896
- }),
1897
- /* @__PURE__ */ L(M, { children: "Unique identifier of the target flow." })
1898
- ] })
1899
- })]
1900
- })
1901
- });
1902
- }, nr = () => {
1903
- let [e, t] = F("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = G(), { Field: i } = Ve({
1904
- defaultValues: { label: n?.data?.label || { en: "" } },
1905
- listeners: {
1906
- onChange: ({ formApi: e }) => {
1907
- e.handleSubmit().then();
1908
- },
1909
- onChangeDebounceMs: 150
1910
- },
1911
- onSubmit: ({ value: e }) => {
1912
- r(e);
1913
- }
1914
- });
1915
- return /* @__PURE__ */ L("form", {
1916
- onSubmit: (e) => {
1917
- e.preventDefault(), e.stopPropagation();
1918
- },
1919
- children: /* @__PURE__ */ R("div", {
1920
- className: "tg:flex tg:items-end tg:gap-2",
1921
- children: [/* @__PURE__ */ L(i, {
1922
- name: "label",
1923
- children: (t) => /* @__PURE__ */ R(j, {
1924
- className: "tg:flex-1",
1925
- children: [/* @__PURE__ */ L(d, {
1926
- htmlFor: t.name,
1927
- children: "Label"
1928
- }), /* @__PURE__ */ L(k, {
1929
- id: t.name,
1930
- name: t.name,
1931
- value: t.state.value?.[e] || "",
1932
- onBlur: t.handleBlur,
1933
- onChange: ({ target: n }) => {
1934
- t.handleChange({
1935
- ...t.state.value,
1936
- [e]: n.value
1937
- });
1938
- }
1939
- })]
1940
- })
1941
- }), /* @__PURE__ */ L(Q, {
1942
- value: e,
1943
- onValueChange: t
1944
- })]
1945
- })
1946
- });
1947
- }, rr = [
1948
- "POST",
1949
- "PUT",
1950
- "PATCH"
1951
- ], ir = ({ value: e, onChange: t }) => {
1952
- let { selectedNode: n } = $(), r = W(), i = Gt(n?.id), { handleSubmit: a, Field: o, Subscribe: s } = Ve({
1953
- defaultValues: {
1954
- body: e?.body || "",
1955
- fetchOnMount: e?.fetchOnMount ?? !e?.searchParam,
1956
- headers: e?.headers || [],
1957
- method: e?.method || "GET",
1958
- responseMapping: e?.responseMapping || {
1959
- labelField: "",
1960
- valueField: ""
1961
- },
1962
- responsePath: e?.responsePath || "",
1963
- searchParam: e?.searchParam || "",
1964
- sendAllFormValues: !!e?.sendAllFormValues,
1965
- showLoading: e?.showLoading !== !1,
1966
- url: e?.url || ""
1967
- },
1968
- listeners: {
1969
- onChange: ({ formApi: e }) => {
1970
- e.handleSubmit().then();
1971
- },
1972
- onChangeDebounceMs: 150
1973
- },
1974
- onSubmit: ({ value: e }) => {
1975
- t(e);
1976
- }
1977
- });
1978
- return /* @__PURE__ */ L("div", { children: /* @__PURE__ */ R("div", {
1979
- className: "tg:grid tg:gap-6",
1980
- children: [
1981
- /* @__PURE__ */ L(o, {
1982
- name: "url",
1983
- children: (e) => /* @__PURE__ */ R(j, { children: [
1984
- /* @__PURE__ */ L(d, {
1985
- htmlFor: e.name,
1986
- children: r("editor.httpConfigForm.apiUrl")
1987
- }),
1988
- /* @__PURE__ */ R("div", {
1989
- className: "tg:flex tg:gap-2",
1990
- children: [/* @__PURE__ */ L(k, {
1991
- id: e.name,
1992
- name: e.name,
1993
- value: e.state.value,
1994
- onBlur: e.handleBlur,
1995
- onChange: ({ target: t }) => e.handleChange(t.value),
1996
- placeholder: r("editor.httpConfigForm.apiUrlPlaceholder"),
1997
- className: "tg:flex-1"
1998
- }), /* @__PURE__ */ R(K, { children: [/* @__PURE__ */ L(rn, {
1999
- asChild: !0,
2000
- children: /* @__PURE__ */ L(A, {
2001
- type: "button",
2002
- variant: "outline",
2003
- size: "icon",
2004
- children: /* @__PURE__ */ L(Ot, { className: "tg:h-4 tg:w-4" })
2005
- })
2006
- }), /* @__PURE__ */ L(an, {
2007
- align: "end",
2008
- children: i.length === 0 ? /* @__PURE__ */ L(J, {
2009
- disabled: !0,
2010
- children: r("editor.httpConfigForm.noFieldsAvailable")
2011
- }) : i.map((t) => /* @__PURE__ */ L(J, {
2012
- onClick: () => {
2013
- let n = `{{${t.nodeId}}}`, r = e.state.value || "";
2014
- e.handleChange(r + n);
2015
- },
2016
- children: /* @__PURE__ */ R("div", {
2017
- className: "tg:flex tg:flex-col",
2018
- children: [/* @__PURE__ */ L("span", {
2019
- className: "tg:font-medium",
2020
- children: t.label
2021
- }), /* @__PURE__ */ L("span", {
2022
- className: "tg:text-muted-foreground tg:text-xs",
2023
- children: `{{${t.nodeId}}}`
2024
- })]
2025
- })
2026
- }, t.nodeId))
2027
- })] })]
2028
- }),
2029
- /* @__PURE__ */ L(M, { children: r("editor.httpConfigForm.apiUrlDesc") })
2030
- ] })
2031
- }),
2032
- /* @__PURE__ */ L(o, {
2033
- name: "method",
2034
- children: (e) => /* @__PURE__ */ R(j, { children: [/* @__PURE__ */ L(d, {
2035
- htmlFor: e.name,
2036
- children: r("editor.httpConfigForm.httpMethod")
2037
- }), /* @__PURE__ */ R(g, {
2038
- value: e.state.value,
2039
- onValueChange: (t) => e.handleChange(t),
2040
- children: [/* @__PURE__ */ L(v, {
2041
- id: e.name,
2042
- children: /* @__PURE__ */ L(T, { placeholder: r("editor.httpConfigForm.selectMethod") })
2043
- }), /* @__PURE__ */ R(C, { children: [
2044
- /* @__PURE__ */ L(h, {
2045
- value: "GET",
2046
- children: r("editor.httpConfigForm.methodGet")
2047
- }),
2048
- /* @__PURE__ */ L(h, {
2049
- value: "POST",
2050
- children: r("editor.httpConfigForm.methodPost")
2051
- }),
2052
- /* @__PURE__ */ L(h, {
2053
- value: "PUT",
2054
- children: r("editor.httpConfigForm.methodPut")
2055
- }),
2056
- /* @__PURE__ */ L(h, {
2057
- value: "DELETE",
2058
- children: r("editor.httpConfigForm.methodDelete")
2059
- }),
2060
- /* @__PURE__ */ L(h, {
2061
- value: "PATCH",
2062
- children: r("editor.httpConfigForm.methodPatch")
2063
- })
2064
- ] })]
2065
- })] })
2066
- }),
2067
- /* @__PURE__ */ R("div", {
2068
- className: "tg:space-y-4",
2069
- children: [/* @__PURE__ */ L("h4", {
2070
- className: "tg:font-semibold tg:text-sm",
2071
- children: r("editor.httpConfigForm.headers")
2072
- }), /* @__PURE__ */ L(o, {
2073
- name: "headers",
2074
- mode: "array",
2075
- children: (e) => /* @__PURE__ */ R("div", {
2076
- className: "tg:space-y-2",
2077
- children: [e.state.value?.map((t, n) => {
2078
- let i = `headers[${n}]`;
2079
- return /* @__PURE__ */ R("div", {
2080
- className: "tg:flex tg:items-start tg:gap-2",
2081
- children: [
2082
- /* @__PURE__ */ L(o, {
2083
- name: `headers[${n}].key`,
2084
- children: (e) => /* @__PURE__ */ L(k, {
2085
- placeholder: r("editor.httpConfigForm.headerName"),
2086
- value: e.state.value || "",
2087
- onChange: ({ target: t }) => e.handleChange(t.value)
2088
- })
2089
- }),
2090
- /* @__PURE__ */ L(o, {
2091
- name: `headers[${n}].value`,
2092
- children: (e) => /* @__PURE__ */ L(k, {
2093
- placeholder: r("editor.httpConfigForm.headerValue"),
2094
- value: e.state.value || "",
2095
- onChange: ({ target: t }) => e.handleChange(t.value)
2096
- })
2097
- }),
2098
- /* @__PURE__ */ L(A, {
2099
- type: "button",
2100
- variant: "ghost",
2101
- size: "icon",
2102
- onClick: () => {
2103
- e.removeValue(n);
2104
- },
2105
- children: /* @__PURE__ */ L(B, { className: "tg:h-4 tg:w-4" })
2106
- })
2107
- ]
2108
- }, i);
2109
- }), /* @__PURE__ */ R(A, {
2110
- type: "button",
2111
- variant: "outline",
2112
- size: "sm",
2113
- onClick: () => {
2114
- e.pushValue({
2115
- key: "",
2116
- value: ""
2117
- });
2118
- },
2119
- children: [/* @__PURE__ */ L(z, { className: "tg:mr-2 tg:h-4 tg:w-4" }), r("editor.httpConfigForm.addHeader")]
2120
- })]
2121
- })
2122
- })]
2123
- }),
2124
- /* @__PURE__ */ L(s, {
2125
- selector: (e) => ({
2126
- method: e.values.method,
2127
- sendAllFormValues: e.values.sendAllFormValues
2128
- }),
2129
- children: ({ method: e, sendAllFormValues: t }) => rr.includes(e || "") && /* @__PURE__ */ R("div", {
2130
- className: "tg:space-y-4",
2131
- children: [/* @__PURE__ */ L(o, {
2132
- name: "sendAllFormValues",
2133
- children: (e) => /* @__PURE__ */ R("div", {
2134
- className: "tg:flex tg:items-center tg:space-x-2",
2135
- children: [/* @__PURE__ */ L(O, {
2136
- id: e.name,
2137
- checked: e.state.value,
2138
- onCheckedChange: (t) => e.handleChange(t)
2139
- }), /* @__PURE__ */ L(d, {
2140
- htmlFor: e.name,
2141
- children: r("editor.httpConfigForm.sendAllFormValues")
2142
- })]
2143
- })
2144
- }), /* @__PURE__ */ L(o, {
2145
- name: "body",
2146
- children: (e) => /* @__PURE__ */ R(j, { children: [
2147
- /* @__PURE__ */ R("div", {
2148
- className: "tg:mb-2 tg:flex tg:items-center tg:justify-between",
2149
- children: [/* @__PURE__ */ L(d, {
2150
- htmlFor: e.name,
2151
- children: r("editor.httpConfigForm.requestBody")
2152
- }), /* @__PURE__ */ R(K, { children: [/* @__PURE__ */ L(rn, {
2153
- asChild: !0,
2154
- children: /* @__PURE__ */ R(A, {
2155
- type: "button",
2156
- variant: "ghost",
2157
- size: "sm",
2158
- disabled: t,
2159
- children: [/* @__PURE__ */ L(Ot, { className: "tg:mr-2 tg:h-4 tg:w-4" }), r("editor.httpConfigForm.insertVariable")]
2160
- })
2161
- }), /* @__PURE__ */ L(an, {
2162
- align: "end",
2163
- children: i.length === 0 ? /* @__PURE__ */ L(J, {
2164
- disabled: !0,
2165
- children: r("editor.httpConfigForm.noFieldsAvailable")
2166
- }) : i.map((t) => /* @__PURE__ */ L(J, {
2167
- onClick: () => {
2168
- let n = `{{${t.nodeId}}}`, r = e.state.value || "";
2169
- e.handleChange(r + n), a().then();
2170
- },
2171
- children: /* @__PURE__ */ R("div", {
2172
- className: "tg:flex tg:flex-col",
2173
- children: [/* @__PURE__ */ L("span", {
2174
- className: "tg:font-medium",
2175
- children: t.label
2176
- }), /* @__PURE__ */ L("span", {
2177
- className: "tg:text-muted-foreground tg:text-xs",
2178
- children: `{{${t.nodeId}}}`
2179
- })]
2180
- })
2181
- }, t.nodeId))
2182
- })] })]
2183
- }),
2184
- /* @__PURE__ */ L(ce, {
2185
- id: e.name,
2186
- name: e.name,
2187
- value: e.state.value,
2188
- onBlur: e.handleBlur,
2189
- onChange: ({ target: t }) => e.handleChange(t.value),
2190
- placeholder: r("editor.httpConfigForm.requestBodyPlaceholder"),
2191
- rows: 4,
2192
- disabled: t
2193
- }),
2194
- /* @__PURE__ */ L(M, { children: r(t ? "editor.httpConfigForm.sendAllFormValuesDesc" : "editor.httpConfigForm.requestBodyDesc") })
2195
- ] })
2196
- })]
2197
- })
2198
- }),
2199
- /* @__PURE__ */ R("div", {
2200
- className: "tg:space-y-4",
2201
- children: [
2202
- /* @__PURE__ */ L("h4", {
2203
- className: "tg:font-semibold tg:text-sm",
2204
- children: r("editor.httpConfigForm.responseConfiguration")
2205
- }),
2206
- /* @__PURE__ */ L(o, {
2207
- name: "responsePath",
2208
- children: (e) => /* @__PURE__ */ R(j, { children: [
2209
- /* @__PURE__ */ L(d, {
2210
- htmlFor: e.name,
2211
- children: r("editor.httpConfigForm.responsePath")
2212
- }),
2213
- /* @__PURE__ */ L(k, {
2214
- id: e.name,
2215
- name: e.name,
2216
- value: e.state.value,
2217
- onBlur: e.handleBlur,
2218
- onChange: ({ target: t }) => e.handleChange(t.value),
2219
- placeholder: r("editor.httpConfigForm.responsePathPlaceholder")
2220
- }),
2221
- /* @__PURE__ */ L(M, { children: r("editor.httpConfigForm.responsePathDesc") })
2222
- ] })
2223
- }),
2224
- /* @__PURE__ */ R("div", {
2225
- className: "tg:space-y-4",
2226
- children: [
2227
- /* @__PURE__ */ L("h5", {
2228
- className: "tg:font-medium tg:text-sm",
2229
- children: r("editor.httpConfigForm.mapToOptions")
2230
- }),
2231
- /* @__PURE__ */ L(o, {
2232
- name: "responseMapping.valueField",
2233
- children: (e) => /* @__PURE__ */ R(j, { children: [
2234
- /* @__PURE__ */ L(d, {
2235
- htmlFor: e.name,
2236
- children: r("editor.httpConfigForm.valueField")
2237
- }),
2238
- /* @__PURE__ */ L(k, {
2239
- id: e.name,
2240
- name: e.name,
2241
- value: e.state.value,
2242
- onBlur: e.handleBlur,
2243
- onChange: ({ target: t }) => e.handleChange(t.value),
2244
- placeholder: r("editor.httpConfigForm.valueFieldPlaceholder")
2245
- }),
2246
- /* @__PURE__ */ L(M, { children: r("editor.httpConfigForm.valueFieldDesc") })
2247
- ] })
2248
- }),
2249
- /* @__PURE__ */ L(o, {
2250
- name: "responseMapping.labelField",
2251
- children: (e) => /* @__PURE__ */ R(j, { children: [
2252
- /* @__PURE__ */ L(d, {
2253
- htmlFor: e.name,
2254
- children: r("editor.httpConfigForm.labelField")
2255
- }),
2256
- /* @__PURE__ */ L(k, {
2257
- id: e.name,
2258
- name: e.name,
2259
- value: e.state.value,
2260
- onBlur: e.handleBlur,
2261
- onChange: ({ target: t }) => e.handleChange(t.value),
2262
- placeholder: r("editor.httpConfigForm.labelFieldPlaceholder")
2263
- }),
2264
- /* @__PURE__ */ L(M, { children: r("editor.httpConfigForm.labelFieldDesc") })
2265
- ] })
2266
- })
2267
- ]
2268
- }),
2269
- /* @__PURE__ */ L(o, {
2270
- name: "searchParam",
2271
- children: (e) => /* @__PURE__ */ R(j, { children: [
2272
- /* @__PURE__ */ L(d, {
2273
- htmlFor: e.name,
2274
- children: r("editor.httpConfigForm.searchParameter")
2275
- }),
2276
- /* @__PURE__ */ L(k, {
2277
- id: e.name,
2278
- name: e.name,
2279
- value: e.state.value,
2280
- onBlur: e.handleBlur,
2281
- onChange: ({ target: t }) => e.handleChange(t.value),
2282
- placeholder: r("editor.httpConfigForm.searchParameterPlaceholder")
2283
- }),
2284
- /* @__PURE__ */ L(M, { children: r("editor.httpConfigForm.searchParameterDesc") })
2285
- ] })
2286
- })
2287
- ]
2288
- }),
2289
- /* @__PURE__ */ R("div", {
2290
- className: "tg:space-y-4",
2291
- children: [
2292
- /* @__PURE__ */ L("h4", {
2293
- className: "tg:font-semibold tg:text-sm",
2294
- children: r("editor.httpConfigForm.behavior")
2295
- }),
2296
- /* @__PURE__ */ L(s, {
2297
- selector: (e) => e.values.searchParam,
2298
- children: (e) => /* @__PURE__ */ L(o, {
2299
- name: "fetchOnMount",
2300
- children: (t) => {
2301
- let n = !!e?.trim(), i = n ? t.state.value : !0;
2302
- return !n && t.state.value !== !0 && t.handleChange(!0), /* @__PURE__ */ R("div", {
2303
- className: "tg:flex tg:items-center tg:space-x-2",
2304
- children: [/* @__PURE__ */ L(O, {
2305
- id: t.name,
2306
- checked: i,
2307
- disabled: !n,
2308
- onCheckedChange: (e) => t.handleChange(e)
2309
- }), /* @__PURE__ */ L(d, {
2310
- htmlFor: t.name,
2311
- className: n ? "" : "tg:text-muted-foreground",
2312
- children: r("editor.httpConfigForm.fetchOnMount")
2313
- })]
2314
- });
2315
- }
2316
- })
2317
- }),
2318
- /* @__PURE__ */ L(o, {
2319
- name: "showLoading",
2320
- children: (e) => /* @__PURE__ */ R("div", {
2321
- className: "tg:flex tg:items-center tg:space-x-2",
2322
- children: [/* @__PURE__ */ L(O, {
2323
- id: e.name,
2324
- checked: e.state.value,
2325
- onCheckedChange: (t) => e.handleChange(t)
2326
- }), /* @__PURE__ */ L(d, {
2327
- htmlFor: e.name,
2328
- children: r("editor.httpConfigForm.showLoadingState")
2329
- })]
2330
- })
2331
- })
2332
- ]
2333
- })
2334
- ]
2335
- }) });
2336
- }, ar = [
2337
- "POST",
2338
- "PUT",
2339
- "PATCH"
2340
- ], or = ({ value: e, onChange: t }) => {
2341
- let [n, r] = F("en"), { selectedNode: i } = $(), a = W(), o = Gt(i?.id), { handleSubmit: s, Field: c, Subscribe: l } = Ve({
2342
- defaultValues: {
2343
- body: e?.body || "",
2344
- errorMessage: e?.errorMessage || { en: "" },
2345
- headers: e?.headers || [],
2346
- method: e?.method || "POST",
2347
- redirectUrl: e?.redirectUrl || "",
2348
- sendAllFormValues: !!e?.sendAllFormValues,
2349
- showLoading: e?.showLoading !== !1,
2350
- successMessage: e?.successMessage || { en: "" },
2351
- url: e?.url || ""
2352
- },
2353
- listeners: {
2354
- onChange: ({ formApi: e }) => {
2355
- e.handleSubmit().then();
2356
- },
2357
- onChangeDebounceMs: 150
2358
- },
2359
- onSubmit: ({ value: e }) => {
2360
- t(e);
2361
- }
2362
- });
2363
- return /* @__PURE__ */ L("div", { children: /* @__PURE__ */ R("div", {
2364
- className: "tg:grid tg:gap-6",
2365
- children: [
2366
- /* @__PURE__ */ L(c, {
2367
- name: "url",
2368
- children: (e) => /* @__PURE__ */ R(j, { children: [
2369
- /* @__PURE__ */ L(d, {
2370
- htmlFor: e.name,
2371
- children: a("editor.submitConfigForm.apiUrl")
2372
- }),
2373
- /* @__PURE__ */ R("div", {
2374
- className: "tg:flex tg:gap-2",
2375
- children: [/* @__PURE__ */ L(k, {
2376
- id: e.name,
2377
- name: e.name,
2378
- value: e.state.value,
2379
- onBlur: e.handleBlur,
2380
- onChange: ({ target: t }) => e.handleChange(t.value),
2381
- placeholder: a("editor.submitConfigForm.apiUrlPlaceholder"),
2382
- className: "tg:flex-1"
2383
- }), /* @__PURE__ */ R(K, { children: [/* @__PURE__ */ L(rn, {
2384
- asChild: !0,
2385
- children: /* @__PURE__ */ L(A, {
2386
- type: "button",
2387
- variant: "outline",
2388
- size: "icon",
2389
- children: /* @__PURE__ */ L(Ot, { className: "tg:h-4 tg:w-4" })
2390
- })
2391
- }), /* @__PURE__ */ L(an, {
2392
- align: "end",
2393
- children: o.length === 0 ? /* @__PURE__ */ L(J, {
2394
- disabled: !0,
2395
- children: a("editor.submitConfigForm.noFieldsAvailable")
2396
- }) : o.map((t) => /* @__PURE__ */ L(J, {
2397
- onClick: () => {
2398
- let n = `{{${t.nodeId}}}`, r = e.state.value || "";
2399
- e.handleChange(r + n);
2400
- },
2401
- children: /* @__PURE__ */ R("div", {
2402
- className: "tg:flex tg:flex-col",
2403
- children: [/* @__PURE__ */ L("span", {
2404
- className: "tg:font-medium",
2405
- children: t.label
2406
- }), /* @__PURE__ */ L("span", {
2407
- className: "tg:text-muted-foreground tg:text-xs",
2408
- children: `{{${t.nodeId}}}`
2409
- })]
2410
- })
2411
- }, t.nodeId))
2412
- })] })]
2413
- }),
2414
- /* @__PURE__ */ L(M, { children: a("editor.submitConfigForm.apiUrlDesc") })
2415
- ] })
2416
- }),
2417
- /* @__PURE__ */ L(c, {
2418
- name: "method",
2419
- children: (e) => /* @__PURE__ */ R(j, { children: [/* @__PURE__ */ L(d, {
2420
- htmlFor: e.name,
2421
- children: a("editor.submitConfigForm.httpMethod")
2422
- }), /* @__PURE__ */ R(g, {
2423
- value: e.state.value,
2424
- onValueChange: (t) => e.handleChange(t),
2425
- children: [/* @__PURE__ */ L(v, {
2426
- id: e.name,
2427
- children: /* @__PURE__ */ L(T, { placeholder: a("editor.submitConfigForm.selectMethod") })
2428
- }), /* @__PURE__ */ R(C, { children: [
2429
- /* @__PURE__ */ L(h, {
2430
- value: "POST",
2431
- children: a("editor.submitConfigForm.methodPost")
2432
- }),
2433
- /* @__PURE__ */ L(h, {
2434
- value: "PUT",
2435
- children: a("editor.submitConfigForm.methodPut")
2436
- }),
2437
- /* @__PURE__ */ L(h, {
2438
- value: "DELETE",
2439
- children: a("editor.submitConfigForm.methodDelete")
2440
- }),
2441
- /* @__PURE__ */ L(h, {
2442
- value: "PATCH",
2443
- children: a("editor.submitConfigForm.methodPatch")
2444
- })
2445
- ] })]
2446
- })] })
2447
- }),
2448
- /* @__PURE__ */ R("div", {
2449
- className: "tg:space-y-4",
2450
- children: [/* @__PURE__ */ L("h4", {
2451
- className: "tg:font-semibold tg:text-sm",
2452
- children: a("editor.submitConfigForm.headers")
2453
- }), /* @__PURE__ */ L(c, {
2454
- name: "headers",
2455
- mode: "array",
2456
- children: (e) => /* @__PURE__ */ R("div", {
2457
- className: "tg:space-y-2",
2458
- children: [e.state.value?.map((t, n) => {
2459
- let r = `headers[${n}]`;
2460
- return /* @__PURE__ */ R("div", {
2461
- className: "tg:flex tg:items-start tg:gap-2",
2462
- children: [
2463
- /* @__PURE__ */ L(c, {
2464
- name: `headers[${n}].key`,
2465
- children: (e) => /* @__PURE__ */ L(k, {
2466
- placeholder: a("editor.submitConfigForm.headerName"),
2467
- value: e.state.value || "",
2468
- onChange: ({ target: t }) => e.handleChange(t.value)
2469
- })
2470
- }),
2471
- /* @__PURE__ */ L(c, {
2472
- name: `headers[${n}].value`,
2473
- children: (e) => /* @__PURE__ */ L(k, {
2474
- placeholder: a("editor.submitConfigForm.headerValue"),
2475
- value: e.state.value || "",
2476
- onChange: ({ target: t }) => e.handleChange(t.value)
2477
- })
2478
- }),
2479
- /* @__PURE__ */ L(A, {
2480
- type: "button",
2481
- variant: "ghost",
2482
- size: "icon",
2483
- onClick: () => {
2484
- e.removeValue(n);
2485
- },
2486
- children: /* @__PURE__ */ L(B, { className: "tg:h-4 tg:w-4" })
2487
- })
2488
- ]
2489
- }, r);
2490
- }), /* @__PURE__ */ R(A, {
2491
- type: "button",
2492
- variant: "outline",
2493
- size: "sm",
2494
- onClick: () => {
2495
- e.pushValue({
2496
- key: "",
2497
- value: ""
2498
- });
2499
- },
2500
- children: [/* @__PURE__ */ L(z, { className: "tg:mr-2 tg:h-4 tg:w-4" }), a("editor.submitConfigForm.addHeader")]
2501
- })]
2502
- })
2503
- })]
2504
- }),
2505
- /* @__PURE__ */ L(l, {
2506
- selector: (e) => ({
2507
- method: e.values.method,
2508
- sendAllFormValues: e.values.sendAllFormValues
2509
- }),
2510
- children: ({ method: e, sendAllFormValues: t }) => ar.includes(e || "") && /* @__PURE__ */ R("div", {
2511
- className: "tg:space-y-4",
2512
- children: [/* @__PURE__ */ L(c, {
2513
- name: "sendAllFormValues",
2514
- children: (e) => /* @__PURE__ */ R("div", {
2515
- className: "tg:flex tg:items-center tg:space-x-2",
2516
- children: [/* @__PURE__ */ L(O, {
2517
- id: e.name,
2518
- checked: e.state.value,
2519
- onCheckedChange: (t) => e.handleChange(t)
2520
- }), /* @__PURE__ */ L(d, {
2521
- htmlFor: e.name,
2522
- children: a("editor.submitConfigForm.sendAllFormValues")
2523
- })]
2524
- })
2525
- }), /* @__PURE__ */ L(c, {
2526
- name: "body",
2527
- children: (e) => /* @__PURE__ */ R(j, { children: [
2528
- /* @__PURE__ */ R("div", {
2529
- className: "tg:mb-2 tg:flex tg:items-center tg:justify-between",
2530
- children: [/* @__PURE__ */ L(d, {
2531
- htmlFor: e.name,
2532
- children: a("editor.submitConfigForm.requestBody")
2533
- }), /* @__PURE__ */ R(K, { children: [/* @__PURE__ */ L(rn, {
2534
- asChild: !0,
2535
- children: /* @__PURE__ */ R(A, {
2536
- type: "button",
2537
- variant: "ghost",
2538
- size: "sm",
2539
- disabled: t,
2540
- children: [/* @__PURE__ */ L(Ot, { className: "tg:mr-2 tg:h-4 tg:w-4" }), a("editor.submitConfigForm.insertVariable")]
2541
- })
2542
- }), /* @__PURE__ */ L(an, {
2543
- align: "end",
2544
- children: o.length === 0 ? /* @__PURE__ */ L(J, {
2545
- disabled: !0,
2546
- children: a("editor.submitConfigForm.noFieldsAvailable")
2547
- }) : o.map((t) => /* @__PURE__ */ L(J, {
2548
- onClick: () => {
2549
- let n = `{{${t.nodeId}}}`, r = e.state.value || "";
2550
- e.handleChange(r + n), s().then();
2551
- },
2552
- children: /* @__PURE__ */ R("div", {
2553
- className: "tg:flex tg:flex-col",
2554
- children: [/* @__PURE__ */ L("span", {
2555
- className: "tg:font-medium",
2556
- children: t.label
2557
- }), /* @__PURE__ */ L("span", {
2558
- className: "tg:text-muted-foreground tg:text-xs",
2559
- children: `{{${t.nodeId}}}`
2560
- })]
2561
- })
2562
- }, t.nodeId))
2563
- })] })]
2564
- }),
2565
- /* @__PURE__ */ L(ce, {
2566
- id: e.name,
2567
- name: e.name,
2568
- value: e.state.value,
2569
- onBlur: e.handleBlur,
2570
- onChange: ({ target: t }) => e.handleChange(t.value),
2571
- placeholder: a("editor.submitConfigForm.requestBodyPlaceholder"),
2572
- rows: 4,
2573
- disabled: t
2574
- }),
2575
- /* @__PURE__ */ L(M, { children: a(t ? "editor.submitConfigForm.sendAllFormValuesDesc" : "editor.submitConfigForm.requestBodyDesc") })
2576
- ] })
2577
- })]
2578
- })
2579
- }),
2580
- /* @__PURE__ */ R("div", {
2581
- className: "tg:space-y-4",
2582
- children: [
2583
- /* @__PURE__ */ L("h4", {
2584
- className: "tg:font-semibold tg:text-sm",
2585
- children: a("editor.submitConfigForm.postSubmission")
2586
- }),
2587
- /* @__PURE__ */ L(c, {
2588
- name: "redirectUrl",
2589
- children: (e) => /* @__PURE__ */ R(j, { children: [
2590
- /* @__PURE__ */ L(d, {
2591
- htmlFor: e.name,
2592
- children: a("editor.submitConfigForm.redirectUrl")
2593
- }),
2594
- /* @__PURE__ */ L(k, {
2595
- id: e.name,
2596
- name: e.name,
2597
- value: e.state.value,
2598
- onBlur: e.handleBlur,
2599
- onChange: ({ target: t }) => e.handleChange(t.value),
2600
- placeholder: a("editor.submitConfigForm.redirectUrlPlaceholder")
2601
- }),
2602
- /* @__PURE__ */ L(M, { children: a("editor.submitConfigForm.redirectUrlDesc") })
2603
- ] })
2604
- }),
2605
- /* @__PURE__ */ R("div", {
2606
- className: "tg:flex tg:items-center tg:gap-2",
2607
- children: [/* @__PURE__ */ L(c, {
2608
- name: "successMessage",
2609
- children: (e) => /* @__PURE__ */ R(j, {
2610
- className: "tg:flex-1",
2611
- children: [
2612
- /* @__PURE__ */ L(d, {
2613
- htmlFor: e.name,
2614
- children: a("editor.submitConfigForm.successMessage")
2615
- }),
2616
- /* @__PURE__ */ L(k, {
2617
- id: e.name,
2618
- name: e.name,
2619
- value: e.state.value?.[n] || "",
2620
- onBlur: e.handleBlur,
2621
- onChange: ({ target: t }) => {
2622
- e.handleChange({
2623
- ...typeof e.state.value == "object" && e.state.value !== null ? e.state.value : {},
2624
- [n]: t.value
2625
- });
2626
- },
2627
- placeholder: a("editor.submitConfigForm.successMessagePlaceholder")
2628
- }),
2629
- /* @__PURE__ */ L(M, { children: a("editor.submitConfigForm.successMessageDesc") })
2630
- ]
2631
- })
2632
- }), /* @__PURE__ */ L(Q, {
2633
- value: n,
2634
- onValueChange: r
2635
- })]
2636
- }),
2637
- /* @__PURE__ */ R("div", {
2638
- className: "tg:flex tg:items-center tg:gap-2",
2639
- children: [/* @__PURE__ */ L(c, {
2640
- name: "errorMessage",
2641
- children: (e) => /* @__PURE__ */ R(j, {
2642
- className: "tg:flex-1",
2643
- children: [
2644
- /* @__PURE__ */ L(d, {
2645
- htmlFor: e.name,
2646
- children: a("editor.submitConfigForm.errorMessage")
2647
- }),
2648
- /* @__PURE__ */ L(k, {
2649
- id: e.name,
2650
- name: e.name,
2651
- value: e.state.value?.[n] || "",
2652
- onBlur: e.handleBlur,
2653
- onChange: ({ target: t }) => {
2654
- e.handleChange({
2655
- ...typeof e.state.value == "object" && e.state.value !== null ? e.state.value : {},
2656
- [n]: t.value
2657
- });
2658
- },
2659
- placeholder: a("editor.submitConfigForm.errorMessagePlaceholder")
2660
- }),
2661
- /* @__PURE__ */ L(M, { children: a("editor.submitConfigForm.errorMessageDesc") })
2662
- ]
2663
- })
2664
- }), /* @__PURE__ */ L(Q, {
2665
- value: n,
2666
- onValueChange: r
2667
- })]
2668
- })
2669
- ]
2670
- }),
2671
- /* @__PURE__ */ R("div", {
2672
- className: "tg:space-y-4",
2673
- children: [/* @__PURE__ */ L("h4", {
2674
- className: "tg:font-semibold tg:text-sm",
2675
- children: a("editor.submitConfigForm.behavior")
2676
- }), /* @__PURE__ */ L(c, {
2677
- name: "showLoading",
2678
- children: (e) => /* @__PURE__ */ R("div", {
2679
- className: "tg:flex tg:items-center tg:space-x-2",
2680
- children: [/* @__PURE__ */ L(O, {
2681
- id: e.name,
2682
- checked: e.state.value,
2683
- onCheckedChange: (t) => e.handleChange(t)
2684
- }), /* @__PURE__ */ L(d, {
2685
- htmlFor: e.name,
2686
- children: a("editor.submitConfigForm.showLoadingState")
2687
- })]
2688
- })
2689
- })]
2690
- })
2691
- ]
2692
- }) });
2693
- }, sr = ({ options: e, id: t, value: n, onValueChange: r, placeholder: i = "Select...", searchPlaceholder: a = "Search or create...", createLabel: o = (e) => `Use: ${e}`, clearLabel: s = "Clear selection", emptyLabel: c = "No results found", className: l, allowClear: u = !0, allowCreate: d = !0 }) => {
2694
- let [p, m] = F(!1), [h, g] = F(""), _ = (e) => e ?? "", v = (e) => e.trim().toLowerCase(), y = _(n), ee = n !== null && n !== "", S = ee ? e.find((e) => _(e.value) === y) : void 0, C = v(h), re = d && C !== "" && !e.some((e) => v(e.label) === C || v(e.value ?? "") === C), w = (e) => {
2695
- e === y ? u && r?.("") : r?.(e), m(!1), g("");
2696
- };
2697
- return /* @__PURE__ */ R(ie, {
2698
- open: p,
2699
- onOpenChange: m,
2700
- children: [/* @__PURE__ */ L(ne, {
2701
- asChild: !0,
2702
- id: t,
2703
- children: /* @__PURE__ */ R(A, {
2704
- type: "button",
2705
- variant: "outline",
2706
- role: "combobox",
2707
- "aria-expanded": p,
2708
- className: D("tg:w-full tg:justify-between tg:font-normal", l),
2709
- children: [/* @__PURE__ */ L("span", {
2710
- className: "tg:truncate",
2711
- children: ee && S ? S.label : i
2712
- }), /* @__PURE__ */ L(Ze, { className: "tg:ml-2 tg:h-4 tg:w-4 tg:shrink-0 tg:opacity-50" })]
2713
- })
2714
- }), /* @__PURE__ */ L(ae, {
2715
- className: "tg:w-full tg:p-0",
2716
- align: "start",
2717
- children: /* @__PURE__ */ R(se, {
2718
- shouldFilter: !1,
2719
- children: [/* @__PURE__ */ L(te, {
2720
- placeholder: a,
2721
- value: h,
2722
- onValueChange: g
2723
- }), /* @__PURE__ */ R(x, { children: [
2724
- /* @__PURE__ */ L(f, { children: c }),
2725
- u && ee && /* @__PURE__ */ L(oe, { children: /* @__PURE__ */ R(b, {
2726
- value: "__clear__",
2727
- onSelect: () => {
2728
- r?.(""), m(!1), g("");
2729
- },
2730
- className: "tg:mt-1 tg:text-muted-foreground",
2731
- children: [/* @__PURE__ */ L(B, { className: "tg:mr-2 tg:h-4 tg:w-4" }), s]
2732
- }) }),
2733
- /* @__PURE__ */ R(oe, { children: [re && /* @__PURE__ */ R(b, {
2734
- value: `__create__${h}`,
2735
- onSelect: () => {
2736
- h.trim() && (r?.(h.trim()), m(!1), g(""));
2737
- },
2738
- className: "tg:text-primary",
2739
- children: [/* @__PURE__ */ L(z, { className: "tg:mr-2 tg:h-4 tg:w-4" }), o(h)]
2740
- }), e.filter((e) => {
2741
- let t = h.toLowerCase();
2742
- return e.label.toLowerCase().includes(t) || (e.value?.toLowerCase() ?? "").includes(t);
2743
- }).map((e, t) => /* @__PURE__ */ R(b, {
2744
- value: e.label,
2745
- onSelect: () => w(e?.value || ""),
2746
- children: [/* @__PURE__ */ L(Je, {
2747
- "aria-hidden": "true",
2748
- className: D("tg:mr-2 tg:h-4 tg:w-4", ee && _(e.value) === y ? "tg:opacity-100" : "tg:opacity-0")
2749
- }), e.label]
2750
- }, e.value ?? e.label ?? t))] })
2751
- ] })]
2752
- })
2753
- })]
2754
- });
2755
- }, cr = Object.entries({
2756
- alphanumeric: "^[a-zA-Z0-9]+$",
2757
- email: "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",
2758
- letters: "^[a-zA-Z]+$",
2759
- number: "^[0-9]+$",
2760
- url: "^https?:\\/\\/.+$"
2761
- }).map(([e, t]) => ({
2762
- label: e.charAt(0).toUpperCase() + e.slice(1).replace(/_/g, " "),
2763
- value: t
2764
- })), lr = ({ id: e, value: t, onValueChange: n }) => /* @__PURE__ */ L(sr, {
2765
- id: e,
2766
- options: ze(() => t && !cr.some((e) => e.value === t) ? [...cr, {
2767
- label: `Custom: ${t}`,
2768
- value: t
2769
- }] : cr, [t]),
2770
- value: t,
2771
- onValueChange: n,
2772
- placeholder: "Select or create a pattern",
2773
- searchPlaceholder: "Search patterns...",
2774
- createLabel: (e) => `Use pattern: ${e}`
2775
- }), ur = 400, dr = .8, fr = (e) => new Promise((t, n) => {
2776
- let r = new FileReader();
2777
- r.onerror = () => n(/* @__PURE__ */ Error("read_failed")), r.onload = () => {
2778
- let e = new Image();
2779
- e.onload = () => t(e), e.onerror = () => n(/* @__PURE__ */ Error("decode_failed")), e.src = r.result;
2780
- }, r.readAsDataURL(e);
2781
- }), pr = async (e) => {
2782
- if (!e.type.startsWith("image/")) throw Error("invalid_type");
2783
- if (e.size > 5242880) throw Error("too_large");
2784
- let t = await fr(e), n = Math.min(1, ur / Math.max(t.width, t.height)), r = document.createElement("canvas");
2785
- r.width = Math.round(t.width * n), r.height = Math.round(t.height * n);
2786
- let i = r.getContext("2d");
2787
- if (!i) throw Error("canvas_unavailable");
2788
- return i.drawImage(t, 0, 0, r.width, r.height), r.toDataURL("image/jpeg", dr);
2789
- }, mr = 400, hr = (e) => {
2790
- if (!/^https?:\/\//i.test(e)) return !1;
2791
- try {
2792
- return !!new URL(e).hostname;
2793
- } catch {
2794
- return !1;
2795
- }
2796
- }, gr = ({ value: e, onChange: t }) => {
2797
- let n = Be(null), r = Be(null), [i, a] = F(!1), [o, s] = F(e && /^https?:\/\//i.test(e) ? e : ""), c = W();
2798
- Le(() => {
2799
- i || s(e && /^https?:\/\//i.test(e) ? e : "");
2800
- }, [i, e]), Le(() => () => {
2801
- r.current && clearTimeout(r.current);
2802
- }, []);
2803
- let l = async (e) => {
2804
- let r = e.target.files?.[0];
2805
- if (r) try {
2806
- t(await pr(r)), a(!1);
2807
- } catch (e) {
2808
- let t = e.message;
2809
- t === "too_large" ? H.error(c("editor.inputNodeForm.optionImageTooLarge")) : t === "invalid_type" ? H.error(c("editor.inputNodeForm.optionImageInvalid")) : H.error(c("editor.inputNodeForm.optionImageError"));
2810
- } finally {
2811
- n.current && (n.current.value = "");
2812
- }
2813
- }, u = () => {
2814
- let e = o.trim();
2815
- e && (t(e), a(!1));
2816
- };
2817
- return /* @__PURE__ */ R("div", {
2818
- className: "tg:relative",
2819
- children: [
2820
- /* @__PURE__ */ L("input", {
2821
- ref: n,
2822
- type: "file",
2823
- accept: "image/*",
2824
- className: "tg:hidden",
2825
- onChange: l
2826
- }),
2827
- /* @__PURE__ */ R(ie, {
2828
- open: i,
2829
- onOpenChange: a,
2830
- children: [/* @__PURE__ */ L(ne, {
2831
- asChild: !0,
2832
- children: e ? /* @__PURE__ */ L("button", {
2833
- type: "button",
2834
- className: "tg:h-9 tg:w-9 tg:cursor-pointer tg:overflow-hidden tg:rounded-md tg:border tg:border-input",
2835
- "aria-label": c("editor.inputNodeForm.optionImageReplace"),
2836
- children: /* @__PURE__ */ L("img", {
2837
- src: e,
2838
- alt: "",
2839
- className: "tg:h-full tg:w-full tg:object-cover"
2840
- })
2841
- }) : /* @__PURE__ */ L(A, {
2842
- type: "button",
2843
- variant: "outline",
2844
- size: "icon",
2845
- "aria-label": c("editor.inputNodeForm.optionImageAdd"),
2846
- children: /* @__PURE__ */ L(ct, { className: "tg:h-4 tg:w-4" })
2847
- })
2848
- }), /* @__PURE__ */ R(ae, {
2849
- align: "start",
2850
- className: "tg:w-64 tg:space-y-3 tg:p-3",
2851
- children: [
2852
- /* @__PURE__ */ R(A, {
2853
- type: "button",
2854
- variant: "outline",
2855
- size: "sm",
2856
- className: "tg:w-full",
2857
- onClick: () => n.current?.click(),
2858
- children: [/* @__PURE__ */ L(Dt, { className: "tg:mr-2 tg:h-4 tg:w-4" }), c("editor.inputNodeForm.optionImageUpload")]
2859
- }),
2860
- /* @__PURE__ */ L(le, {}),
2861
- /* @__PURE__ */ R("div", {
2862
- className: "tg:flex tg:items-center tg:gap-2",
2863
- children: [/* @__PURE__ */ L(ut, { className: "tg:h-4 tg:w-4 tg:shrink-0 tg:text-muted-foreground" }), /* @__PURE__ */ L(k, {
2864
- placeholder: c("editor.inputNodeForm.optionImageUrlPlaceholder"),
2865
- value: o,
2866
- onChange: (n) => {
2867
- let i = n.target.value;
2868
- s(i), r.current && clearTimeout(r.current);
2869
- let a = i.trim();
2870
- !hr(a) || a === e || (r.current = setTimeout(() => {
2871
- t(a);
2872
- }, mr));
2873
- },
2874
- onKeyDown: (e) => {
2875
- e.key === "Enter" && (e.preventDefault(), u());
2876
- },
2877
- onBlur: u
2878
- })]
2879
- })
2880
- ]
2881
- })]
2882
- }),
2883
- e && /* @__PURE__ */ L("button", {
2884
- type: "button",
2885
- onClick: (e) => {
2886
- e.stopPropagation(), t("");
2887
- },
2888
- className: "tg:-top-1 tg:-right-1 tg:absolute tg:flex tg:h-4 tg:w-4 tg:cursor-pointer tg:items-center tg:justify-center tg:rounded-full tg:bg-destructive tg:text-destructive-foreground",
2889
- "aria-label": c("editor.inputNodeForm.optionImageRemove"),
2890
- children: /* @__PURE__ */ L(B, { className: "tg:h-3 tg:w-3" })
2891
- })
2892
- ]
2893
- });
2894
- };
2895
- //#endregion
2896
- //#region src/shared/components/ui/collapsible.tsx
2897
- function _r({ ...e }) {
2898
- return /* @__PURE__ */ L(Rt.Root, {
2899
- "data-slot": "collapsible",
2900
- ...e
2901
- });
2902
- }
2903
- function vr({ ...e }) {
2904
- return /* @__PURE__ */ L(Rt.CollapsibleTrigger, {
2905
- "data-slot": "collapsible-trigger",
2906
- ...e
2907
- });
2908
- }
2909
- function yr({ ...e }) {
2910
- return /* @__PURE__ */ L(Rt.CollapsibleContent, {
2911
- "data-slot": "collapsible-content",
2912
- ...e
2913
- });
2914
- }
2915
- //#endregion
2916
- //#region src/editor/features/TreegeEditor/forms/InputNodeForm.tsx
2917
- var br = () => {
2918
- let [e, t] = F("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = G(), i = [
2919
- "select",
2920
- "radio",
2921
- "autocomplete",
2922
- "checkbox"
2923
- ].includes(n?.data?.type || ""), a = Gt(n?.id), o = W(), s = n?.data?.type === "submit", c = n?.data?.type === "hidden", { handleSubmit: l, Field: u } = Ve({
2924
- defaultValues: {
2925
- defaultValue: n?.data?.defaultValue,
2926
- disablePast: n?.data?.disablePast,
2927
- errorMessage: n?.data?.errorMessage || { en: "" },
2928
- helperText: n?.data?.helperText || { en: "" },
2929
- httpConfig: n?.data?.httpConfig,
2930
- label: n?.data?.label || { en: "" },
2931
- multiple: n?.data?.multiple,
2932
- name: n?.data?.name || "",
2933
- options: n?.data?.options || [],
2934
- pattern: n?.data?.pattern || "",
2935
- placeholder: n?.data?.placeholder || { en: "" },
2936
- required: n?.data?.required,
2937
- submitConfig: n?.data?.submitConfig,
2938
- variant: n?.data?.variant || "default"
2939
- },
2940
- listeners: {
2941
- onChange: ({ formApi: e }) => {
2942
- e.handleSubmit().then();
2943
- },
2944
- onChangeDebounceMs: 150
2945
- },
2946
- onSubmit: ({ value: e }) => {
2947
- r(e);
2948
- }
2949
- });
2950
- return /* @__PURE__ */ L("form", {
2951
- onSubmit: (e) => {
2952
- e.preventDefault(), e.stopPropagation();
2953
- },
2954
- children: /* @__PURE__ */ R("div", {
2955
- className: "tg:grid tg:gap-6",
2956
- children: [
2957
- /* @__PURE__ */ R("div", {
2958
- className: "tg:flex tg:items-end tg:gap-2",
2959
- children: [/* @__PURE__ */ L(u, {
2960
- name: "label",
2961
- children: (t) => /* @__PURE__ */ R(j, {
2962
- className: "tg:flex-1",
2963
- children: [/* @__PURE__ */ L(d, {
2964
- htmlFor: t.name,
2965
- children: o("editor.inputNodeForm.label")
2966
- }), /* @__PURE__ */ L(k, {
2967
- autoFocus: !0,
2968
- id: t.name,
2969
- name: t.name,
2970
- value: t.state.value?.[e] || "",
2971
- onBlur: t.handleBlur,
2972
- onChange: ({ target: n }) => {
2973
- t.handleChange({
2974
- ...typeof t.state.value == "object" && t.state.value !== null ? t.state.value : {},
2975
- [e]: n.value
2976
- });
2977
- }
2978
- })]
2979
- })
2980
- }), /* @__PURE__ */ L(Q, {
2981
- value: e,
2982
- onValueChange: t
2983
- })]
2984
- }),
2985
- !(s || c) && n?.data?.type !== "file" && /* @__PURE__ */ R("div", {
2986
- className: "tg:flex tg:items-end tg:gap-2",
2987
- children: [/* @__PURE__ */ L(u, {
2988
- name: "placeholder",
2989
- children: (t) => /* @__PURE__ */ R(j, {
2990
- className: "tg:flex-1",
2991
- children: [/* @__PURE__ */ L(d, {
2992
- htmlFor: t.name,
2993
- children: o("editor.inputNodeForm.placeholder")
2994
- }), /* @__PURE__ */ L(k, {
2995
- id: t.name,
2996
- name: t.name,
2997
- value: t.state.value?.[e] || "",
2998
- onBlur: t.handleBlur,
2999
- onChange: ({ target: n }) => {
3000
- t.handleChange({
3001
- ...typeof t.state.value == "object" && t.state.value !== null ? t.state.value : {},
3002
- [e]: n.value
3003
- });
3004
- }
3005
- })]
3006
- })
3007
- }), /* @__PURE__ */ L(Q, {
3008
- value: e,
3009
- onValueChange: t
3010
- })]
3011
- }),
3012
- !(s || c) && /* @__PURE__ */ R("div", {
3013
- className: "tg:flex tg:items-end tg:gap-2",
3014
- children: [/* @__PURE__ */ L(u, {
3015
- name: "helperText",
3016
- children: (t) => /* @__PURE__ */ R(j, {
3017
- className: "tg:flex-1",
3018
- children: [/* @__PURE__ */ L(d, {
3019
- htmlFor: t.name,
3020
- children: o("editor.inputNodeForm.helperText")
3021
- }), /* @__PURE__ */ L(k, {
3022
- id: t.name,
3023
- name: t.name,
3024
- value: t.state.value?.[e] || "",
3025
- onBlur: t.handleBlur,
3026
- onChange: ({ target: n }) => {
3027
- t.handleChange({
3028
- ...typeof t.state.value == "object" && t.state.value !== null ? t.state.value : {},
3029
- [e]: n.value
3030
- });
3031
- }
3032
- })]
3033
- })
3034
- }), /* @__PURE__ */ L(Q, {
3035
- value: e,
3036
- onValueChange: t
3037
- })]
3038
- }),
3039
- n?.data?.type === "http" && /* @__PURE__ */ R(_r, {
3040
- defaultOpen: !0,
3041
- className: "tg:flex tg:w-full tg:max-w-[350px] tg:flex-col tg:gap-2",
3042
- children: [/* @__PURE__ */ L(vr, {
3043
- asChild: !0,
3044
- children: /* @__PURE__ */ R("div", {
3045
- className: "tg:flex tg:items-center tg:justify-between tg:gap-4",
3046
- children: [/* @__PURE__ */ L("h4", {
3047
- className: "tg:font-semibold tg:text-sm",
3048
- children: o("editor.inputNodeForm.httpConfiguration")
3049
- }), /* @__PURE__ */ R(A, {
3050
- variant: "ghost",
3051
- size: "icon",
3052
- className: "tg:size-8",
3053
- children: [/* @__PURE__ */ L(Ze, {}), /* @__PURE__ */ L("span", {
3054
- className: "tg:sr-only",
3055
- children: o("common.toggle")
3056
- })]
3057
- })]
3058
- })
3059
- }), /* @__PURE__ */ L(yr, {
3060
- className: "tg:flex tg:flex-col tg:gap-4",
3061
- children: /* @__PURE__ */ L(u, {
3062
- name: "httpConfig",
3063
- children: (e) => /* @__PURE__ */ L(ir, {
3064
- value: e.state.value,
3065
- onChange: (t) => {
3066
- e.handleChange(t), l().then();
3067
- }
3068
- })
3069
- })
3070
- })]
3071
- }),
3072
- s && /* @__PURE__ */ R(_r, {
3073
- className: "tg:flex tg:w-full tg:max-w-[350px] tg:flex-col tg:gap-2",
3074
- children: [/* @__PURE__ */ L(vr, {
3075
- asChild: !0,
3076
- children: /* @__PURE__ */ R("div", {
3077
- className: "tg:flex tg:items-center tg:justify-between tg:gap-4",
3078
- children: [/* @__PURE__ */ L("h4", {
3079
- className: "tg:font-semibold tg:text-sm",
3080
- children: o("editor.inputNodeForm.submitConfiguration")
3081
- }), /* @__PURE__ */ R(A, {
3082
- variant: "ghost",
3083
- size: "icon",
3084
- className: "tg:size-8",
3085
- children: [/* @__PURE__ */ L(Ze, {}), /* @__PURE__ */ L("span", {
3086
- className: "tg:sr-only",
3087
- children: o("common.toggle")
3088
- })]
3089
- })]
3090
- })
3091
- }), /* @__PURE__ */ L(yr, {
3092
- className: "tg:flex tg:flex-col tg:gap-4",
3093
- children: /* @__PURE__ */ L(u, {
3094
- name: "submitConfig",
3095
- children: (e) => /* @__PURE__ */ L(or, {
3096
- value: e.state.value,
3097
- onChange: (t) => {
3098
- e.handleChange(t), l().then();
3099
- }
3100
- })
3101
- })
3102
- })]
3103
- }),
3104
- n?.data?.type === "file" && /* @__PURE__ */ L(u, {
3105
- name: "multiple",
3106
- children: (e) => /* @__PURE__ */ R("div", {
3107
- className: "tg:flex tg:items-center tg:space-x-2",
3108
- children: [/* @__PURE__ */ L(O, {
3109
- id: e.name,
3110
- checked: e.state.value,
3111
- onCheckedChange: (t) => e.handleChange(t)
3112
- }), /* @__PURE__ */ L(d, {
3113
- htmlFor: e.name,
3114
- children: o("editor.inputNodeForm.multipleFiles")
3115
- })]
3116
- })
3117
- }),
3118
- i && /* @__PURE__ */ R(_r, {
3119
- defaultOpen: !0,
3120
- className: "tg:flex tg:w-full tg:max-w-[350px] tg:flex-col tg:gap-2",
3121
- children: [/* @__PURE__ */ L(vr, {
3122
- asChild: !0,
3123
- children: /* @__PURE__ */ R("div", {
3124
- className: "tg:flex tg:items-center tg:justify-between tg:gap-4",
3125
- children: [/* @__PURE__ */ L("h4", {
3126
- className: "tg:font-semibold tg:text-sm",
3127
- children: o("editor.inputNodeForm.options")
3128
- }), /* @__PURE__ */ R(A, {
3129
- variant: "ghost",
3130
- size: "icon",
3131
- className: "tg:size-8",
3132
- children: [/* @__PURE__ */ L(Ze, {}), /* @__PURE__ */ L("span", {
3133
- className: "tg:sr-only",
3134
- children: o("common.toggle")
3135
- })]
3136
- })]
3137
- })
3138
- }), /* @__PURE__ */ R(yr, {
3139
- className: "tg:flex tg:flex-col tg:gap-4",
3140
- children: [
3141
- /* @__PURE__ */ L(u, {
3142
- name: "options",
3143
- mode: "array",
3144
- children: (t) => /* @__PURE__ */ R("div", {
3145
- className: "tg:space-y-2",
3146
- children: [t.state.value?.map((r, i) => {
3147
- let a = `options[${i}]`;
3148
- return /* @__PURE__ */ R("div", {
3149
- className: "tg:flex tg:flex-col tg:gap-2",
3150
- children: [/* @__PURE__ */ R("div", {
3151
- className: "tg:flex tg:items-start tg:gap-2",
3152
- children: [
3153
- n?.data?.type === "radio" && /* @__PURE__ */ L(u, {
3154
- name: `options[${i}].image`,
3155
- children: (e) => /* @__PURE__ */ L(gr, {
3156
- value: e.state.value,
3157
- onChange: (t) => e.handleChange(t)
3158
- })
3159
- }),
3160
- /* @__PURE__ */ L(u, {
3161
- name: `options[${i}].label`,
3162
- children: (t) => /* @__PURE__ */ L(k, {
3163
- placeholder: o("editor.inputNodeForm.optionLabel"),
3164
- value: t.state.value?.[e] || "",
3165
- onChange: ({ target: n }) => {
3166
- t.handleChange({
3167
- ...typeof t.state.value == "object" && t.state.value !== null ? t.state.value : {},
3168
- [e]: n.value
3169
- });
3170
- }
3171
- })
3172
- }),
3173
- /* @__PURE__ */ L(u, {
3174
- name: `options[${i}].value`,
3175
- children: (e) => /* @__PURE__ */ L(k, {
3176
- placeholder: o("editor.inputNodeForm.optionValue"),
3177
- value: e.state.value || "",
3178
- onChange: ({ target: t }) => e.handleChange(t.value)
3179
- })
3180
- }),
3181
- /* @__PURE__ */ L(A, {
3182
- type: "button",
3183
- variant: "ghost",
3184
- size: "icon",
3185
- onClick: () => {
3186
- t.removeValue(i), l().then();
3187
- },
3188
- children: /* @__PURE__ */ L(B, { className: "tg:h-4 tg:w-4" })
3189
- })
3190
- ]
3191
- }), (n?.data?.type === "radio" || n?.data?.type === "checkbox") && /* @__PURE__ */ L(u, {
3192
- name: `options[${i}].description`,
3193
- children: (t) => /* @__PURE__ */ L(k, {
3194
- placeholder: o("editor.inputNodeForm.optionDescription"),
3195
- value: t.state.value?.[e] || "",
3196
- onChange: ({ target: n }) => {
3197
- t.handleChange({
3198
- ...typeof t.state.value == "object" && t.state.value !== null ? t.state.value : {},
3199
- [e]: n.value
3200
- });
3201
- }
3202
- })
3203
- })]
3204
- }, a);
3205
- }), /* @__PURE__ */ L(A, {
3206
- type: "button",
3207
- variant: "outline",
3208
- size: "sm",
3209
- onClick: () => {
3210
- t.pushValue({
3211
- label: { en: "" },
3212
- value: ""
3213
- }), l().then();
3214
- },
3215
- children: o("editor.inputNodeForm.addOption")
3216
- })]
3217
- })
3218
- }),
3219
- n?.data?.type === "select" && /* @__PURE__ */ L(u, {
3220
- name: "multiple",
3221
- children: (e) => /* @__PURE__ */ R("div", {
3222
- className: "tg:flex tg:items-center tg:space-x-2",
3223
- children: [/* @__PURE__ */ L(O, {
3224
- id: e.name,
3225
- checked: e.state.value,
3226
- onCheckedChange: (t) => e.handleChange(t)
3227
- }), /* @__PURE__ */ L(d, {
3228
- htmlFor: e.name,
3229
- children: o("editor.inputNodeForm.multipleSelection")
3230
- })]
3231
- })
3232
- }),
3233
- n?.data?.type === "radio" && /* @__PURE__ */ L(u, {
3234
- name: "variant",
3235
- children: (e) => /* @__PURE__ */ R(j, { children: [/* @__PURE__ */ L(d, {
3236
- htmlFor: e.name,
3237
- children: o("editor.inputNodeForm.variant")
3238
- }), /* @__PURE__ */ R(g, {
3239
- value: e.state.value || "default",
3240
- onValueChange: (t) => e.handleChange(t),
3241
- children: [/* @__PURE__ */ L(v, {
3242
- id: e.name,
3243
- className: "tg:w-full",
3244
- children: /* @__PURE__ */ L(T, {})
3245
- }), /* @__PURE__ */ R(C, { children: [/* @__PURE__ */ L(h, {
3246
- value: "default",
3247
- children: o("editor.inputNodeForm.variantDefault")
3248
- }), /* @__PURE__ */ L(h, {
3249
- value: "card",
3250
- children: o("editor.inputNodeForm.variantCard")
3251
- })] })]
3252
- })] })
3253
- })
3254
- ]
3255
- })]
3256
- }),
3257
- !s && /* @__PURE__ */ R(_r, {
3258
- className: "tg:flex tg:w-full tg:max-w-[350px] tg:flex-col tg:gap-2",
3259
- children: [/* @__PURE__ */ L(vr, {
3260
- asChild: !0,
3261
- children: /* @__PURE__ */ R("div", {
3262
- className: "tg:flex tg:items-center tg:justify-between tg:gap-4",
3263
- children: [/* @__PURE__ */ L("h4", {
3264
- className: "tg:font-semibold tg:text-sm",
3265
- children: o("editor.inputNodeForm.validation")
3266
- }), /* @__PURE__ */ R(A, {
3267
- variant: "ghost",
3268
- size: "icon",
3269
- className: "tg:size-8",
3270
- children: [/* @__PURE__ */ L(Ze, {}), /* @__PURE__ */ L("span", {
3271
- className: "tg:sr-only",
3272
- children: o("common.toggle")
3273
- })]
3274
- })]
3275
- })
3276
- }), /* @__PURE__ */ R(yr, {
3277
- className: "tg:flex tg:flex-col tg:gap-6",
3278
- children: [
3279
- /* @__PURE__ */ L(u, {
3280
- name: "required",
3281
- children: (e) => /* @__PURE__ */ L(j, { children: /* @__PURE__ */ R("div", {
3282
- className: "tg:flex tg:items-center tg:space-x-2",
3283
- children: [/* @__PURE__ */ L(O, {
3284
- id: e.name,
3285
- checked: e.state.value,
3286
- onCheckedChange: (t) => e.handleChange(t)
3287
- }), /* @__PURE__ */ L(d, {
3288
- htmlFor: e.name,
3289
- children: o("editor.inputNodeForm.required")
3290
- })]
3291
- }) })
3292
- }),
3293
- (n?.data?.type === "date" || n?.data?.type === "daterange") && /* @__PURE__ */ L(u, {
3294
- name: "disablePast",
3295
- children: (e) => /* @__PURE__ */ L(j, { children: /* @__PURE__ */ R("div", {
3296
- className: "tg:flex tg:items-center tg:space-x-2",
3297
- children: [/* @__PURE__ */ L(O, {
3298
- id: e.name,
3299
- checked: e.state.value,
3300
- onCheckedChange: (t) => e.handleChange(t)
3301
- }), /* @__PURE__ */ L(d, {
3302
- htmlFor: e.name,
3303
- children: o("editor.inputNodeForm.disablePast")
3304
- })]
3305
- }) })
3306
- }),
3307
- /* @__PURE__ */ L(u, {
3308
- name: "pattern",
3309
- children: (e) => /* @__PURE__ */ R(j, { children: [/* @__PURE__ */ L(d, {
3310
- htmlFor: e.name,
3311
- children: o("editor.inputNodeForm.pattern")
3312
- }), /* @__PURE__ */ L(lr, {
3313
- id: e.name,
3314
- value: e.state.value,
3315
- onValueChange: e.handleChange
3316
- })] })
3317
- }),
3318
- /* @__PURE__ */ R("div", {
3319
- className: "tg:flex tg:items-end tg:gap-2",
3320
- children: [/* @__PURE__ */ L(u, {
3321
- name: "errorMessage",
3322
- children: (t) => /* @__PURE__ */ R(j, {
3323
- className: "tg:flex-1",
3324
- children: [/* @__PURE__ */ L(d, {
3325
- htmlFor: t.name,
3326
- children: o("editor.inputNodeForm.errorMessage")
3327
- }), /* @__PURE__ */ L(k, {
3328
- id: t.name,
3329
- name: t.name,
3330
- value: t.state.value?.[e] || "",
3331
- onBlur: t.handleBlur,
3332
- onChange: ({ target: n }) => {
3333
- t.handleChange({
3334
- ...typeof t.state.value == "object" && t.state.value !== null ? t.state.value : {},
3335
- [e]: n.value
3336
- });
3337
- }
3338
- })]
3339
- })
3340
- }), /* @__PURE__ */ L(Q, {
3341
- value: e,
3342
- onValueChange: t
3343
- })]
3344
- })
3345
- ]
3346
- })]
3347
- }),
3348
- !s && /* @__PURE__ */ R(_r, {
3349
- className: "tg:flex tg:w-full tg:max-w-[350px] tg:flex-col tg:gap-2",
3350
- children: [/* @__PURE__ */ L(vr, {
3351
- asChild: !0,
3352
- children: /* @__PURE__ */ R("div", {
3353
- className: "tg:flex tg:items-center tg:justify-between tg:gap-4",
3354
- children: [/* @__PURE__ */ L("h4", {
3355
- className: "tg:font-semibold tg:text-sm",
3356
- children: o("editor.inputNodeForm.advancedConfiguration")
3357
- }), /* @__PURE__ */ R(A, {
3358
- variant: "ghost",
3359
- size: "icon",
3360
- className: "tg:size-8",
3361
- children: [/* @__PURE__ */ L(Ze, {}), /* @__PURE__ */ L("span", {
3362
- className: "tg:sr-only",
3363
- children: o("common.toggle")
3364
- })]
3365
- })]
3366
- })
3367
- }), /* @__PURE__ */ R(yr, {
3368
- className: "tg:flex tg:flex-col tg:gap-6",
3369
- children: [/* @__PURE__ */ L(u, {
3370
- name: "name",
3371
- children: (e) => /* @__PURE__ */ R(j, { children: [
3372
- /* @__PURE__ */ L(d, {
3373
- htmlFor: e.name,
3374
- children: o("editor.inputNodeForm.name")
3375
- }),
3376
- /* @__PURE__ */ L(k, {
3377
- id: e.name,
3378
- name: e.name,
3379
- value: e.state.value,
3380
- onBlur: e.handleBlur,
3381
- onChange: ({ target: t }) => e.handleChange(t.value)
3382
- }),
3383
- /* @__PURE__ */ L(M, { children: o("editor.inputNodeForm.nameDescription") })
3384
- ] })
3385
- }), /* @__PURE__ */ L(u, {
3386
- name: "defaultValue",
3387
- children: (e) => /* @__PURE__ */ R(I, { children: [
3388
- /* @__PURE__ */ R(j, { children: [/* @__PURE__ */ L(d, {
3389
- htmlFor: e.name,
3390
- children: o("editor.inputNodeForm.defaultValueType")
3391
- }), /* @__PURE__ */ R(g, {
3392
- value: e.state.value?.type || "none",
3393
- onValueChange: (t) => {
3394
- e.handleChange(t === "none" ? null : { type: t });
3395
- },
3396
- children: [/* @__PURE__ */ L(v, {
3397
- id: e.name,
3398
- children: /* @__PURE__ */ L(T, { placeholder: o("editor.inputNodeForm.selectType") })
3399
- }), /* @__PURE__ */ R(C, { children: [
3400
- /* @__PURE__ */ L(h, {
3401
- value: "none",
3402
- children: o("editor.inputNodeForm.defaultValueTypeNone")
3403
- }),
3404
- /* @__PURE__ */ L(h, {
3405
- value: "static",
3406
- children: o("editor.inputNodeForm.defaultValueTypeStatic")
3407
- }),
3408
- /* @__PURE__ */ L(h, {
3409
- value: "reference",
3410
- children: o("editor.inputNodeForm.defaultValueTypeReference")
3411
- })
3412
- ] })]
3413
- })] }),
3414
- e.state.value?.type === "static" && /* @__PURE__ */ L(u, {
3415
- name: "defaultValue.staticValue",
3416
- children: (e) => {
3417
- let t = n?.data?.type;
3418
- return (t === "select" || t === "checkbox") && n?.data?.multiple ? /* @__PURE__ */ R(j, { children: [/* @__PURE__ */ L(d, {
3419
- htmlFor: e.name,
3420
- children: o("editor.inputNodeForm.defaultValuesCommaSeparated")
3421
- }), /* @__PURE__ */ L(k, {
3422
- id: e.name,
3423
- placeholder: o("editor.inputNodeForm.defaultValuesPlaceholder"),
3424
- value: Array.isArray(e.state.value) ? e.state.value.join(", ") : "",
3425
- onChange: ({ target: t }) => {
3426
- let n = t.value.split(",").map((e) => e.trim()).filter(Boolean);
3427
- e.handleChange(n.length > 0 ? n : null);
3428
- }
3429
- })] }) : t === "checkbox" ? /* @__PURE__ */ L(j, { children: /* @__PURE__ */ R("div", {
3430
- className: "tg:flex tg:items-center tg:space-x-2",
3431
- children: [/* @__PURE__ */ L(O, {
3432
- id: e.name,
3433
- checked: !!e.state.value,
3434
- onCheckedChange: (t) => e.handleChange(t)
3435
- }), /* @__PURE__ */ L(d, {
3436
- htmlFor: e.name,
3437
- children: o("editor.inputNodeForm.defaultChecked")
3438
- })]
3439
- }) }) : /* @__PURE__ */ R(j, { children: [/* @__PURE__ */ L(d, {
3440
- htmlFor: e.name,
3441
- children: o("editor.inputNodeForm.staticValue")
3442
- }), /* @__PURE__ */ L(k, {
3443
- id: e.name,
3444
- placeholder: o("editor.inputNodeForm.staticValuePlaceholder"),
3445
- value: typeof e.state.value == "string" ? e.state.value : "",
3446
- onChange: ({ target: t }) => e.handleChange(t.value || "")
3447
- })] });
3448
- }
3449
- }),
3450
- e.state.value?.type === "reference" && /* @__PURE__ */ R(I, { children: [
3451
- /* @__PURE__ */ L(u, {
3452
- name: "defaultValue.referenceField",
3453
- children: (e) => /* @__PURE__ */ R(j, { children: [
3454
- /* @__PURE__ */ L(d, {
3455
- htmlFor: e.name,
3456
- children: o("editor.inputNodeForm.referenceField")
3457
- }),
3458
- /* @__PURE__ */ R(g, {
3459
- value: e.state.value || "",
3460
- onValueChange: (t) => {
3461
- e.handleChange(t);
3462
- },
3463
- children: [/* @__PURE__ */ L(v, {
3464
- id: e.name,
3465
- children: /* @__PURE__ */ L(T, { placeholder: o("editor.inputNodeForm.selectReferenceField") })
3466
- }), /* @__PURE__ */ L(C, { children: a.length === 0 ? /* @__PURE__ */ L(h, {
3467
- value: "none",
3468
- disabled: !0,
3469
- children: o("editor.inputNodeForm.noParentFieldsAvailable")
3470
- }) : a.map((e) => /* @__PURE__ */ R(h, {
3471
- value: e.nodeId,
3472
- children: [
3473
- e.label,
3474
- " (",
3475
- e.type,
3476
- ")"
3477
- ]
3478
- }, e.nodeId)) })]
3479
- }),
3480
- a.length === 0 && /* @__PURE__ */ L(M, { children: o("editor.inputNodeForm.addInputFieldsBeforeReference") })
3481
- ] })
3482
- }),
3483
- /* @__PURE__ */ L(u, {
3484
- name: "defaultValue.transformFunction",
3485
- children: (t) => /* @__PURE__ */ R(j, { children: [
3486
- /* @__PURE__ */ L(d, {
3487
- htmlFor: t.name,
3488
- children: o("editor.inputNodeForm.transformType")
3489
- }),
3490
- /* @__PURE__ */ R(g, {
3491
- value: t.state.value || "none",
3492
- onValueChange: (n) => {
3493
- let r = n === "none" ? null : n;
3494
- if (t.handleChange(r), n === "toObject") {
3495
- let t = e.state.value;
3496
- e.handleChange({
3497
- ...t,
3498
- objectMapping: []
3499
- });
3500
- }
3501
- },
3502
- children: [/* @__PURE__ */ L(v, {
3503
- id: t.name,
3504
- children: /* @__PURE__ */ L(T, { placeholder: o("editor.inputNodeForm.selectTransformation") })
3505
- }), /* @__PURE__ */ R(C, { children: [
3506
- /* @__PURE__ */ L(h, {
3507
- value: "none",
3508
- children: o("editor.inputNodeForm.transformNone")
3509
- }),
3510
- /* @__PURE__ */ L(h, {
3511
- value: "toString",
3512
- children: o("editor.inputNodeForm.transformString")
3513
- }),
3514
- /* @__PURE__ */ L(h, {
3515
- value: "toNumber",
3516
- children: o("editor.inputNodeForm.transformNumber")
3517
- }),
3518
- /* @__PURE__ */ L(h, {
3519
- value: "toBoolean",
3520
- children: o("editor.inputNodeForm.transformBoolean")
3521
- }),
3522
- /* @__PURE__ */ L(h, {
3523
- value: "toArray",
3524
- children: o("editor.inputNodeForm.transformArray")
3525
- }),
3526
- /* @__PURE__ */ L(h, {
3527
- value: "toObject",
3528
- children: o("editor.inputNodeForm.transformMapToObject")
3529
- })
3530
- ] })]
3531
- }),
3532
- /* @__PURE__ */ L(M, { children: o("editor.inputNodeForm.transformDesc") })
3533
- ] })
3534
- }),
3535
- e.state.value?.transformFunction === "toObject" && /* @__PURE__ */ L(u, {
3536
- name: "defaultValue.objectMapping",
3537
- mode: "array",
3538
- children: (e) => /* @__PURE__ */ R(j, { children: [
3539
- /* @__PURE__ */ L(d, { children: o("editor.inputNodeForm.objectMapping") }),
3540
- /* @__PURE__ */ R("div", {
3541
- className: "tg:space-y-2",
3542
- children: [e.state.value?.map((t, n) => /* @__PURE__ */ R("div", {
3543
- className: "tg:flex tg:items-center tg:gap-2",
3544
- children: [
3545
- /* @__PURE__ */ L(u, {
3546
- name: `defaultValue.objectMapping[${n}].sourceKey`,
3547
- children: (e) => /* @__PURE__ */ L(k, {
3548
- placeholder: o("editor.inputNodeForm.sourceKey"),
3549
- value: e.state.value || "",
3550
- onChange: ({ target: t }) => e.handleChange(t.value)
3551
- })
3552
- }),
3553
- /* @__PURE__ */ L("span", {
3554
- className: "tg:text-muted-foreground",
3555
- children: "→"
3556
- }),
3557
- /* @__PURE__ */ L(u, {
3558
- name: `defaultValue.objectMapping[${n}].targetKey`,
3559
- children: (e) => /* @__PURE__ */ L(k, {
3560
- placeholder: o("editor.inputNodeForm.targetKey"),
3561
- value: e.state.value || "",
3562
- onChange: ({ target: t }) => e.handleChange(t.value)
3563
- })
3564
- }),
3565
- /* @__PURE__ */ L(A, {
3566
- type: "button",
3567
- variant: "ghost",
3568
- size: "icon",
3569
- onClick: () => {
3570
- e.removeValue(n), l().then();
3571
- },
3572
- children: /* @__PURE__ */ L(B, { className: "tg:h-4 tg:w-4" })
3573
- })
3574
- ]
3575
- }, `mapping-${n}`)), /* @__PURE__ */ R(A, {
3576
- type: "button",
3577
- variant: "outline",
3578
- size: "sm",
3579
- className: "tg:w-full",
3580
- onClick: () => {
3581
- e.pushValue({
3582
- sourceKey: "",
3583
- targetKey: ""
3584
- }), l().then();
3585
- },
3586
- children: [/* @__PURE__ */ L(z, { className: "tg:mr-2 tg:h-4 tg:w-4" }), o("editor.inputNodeForm.addMapping")]
3587
- })]
3588
- }),
3589
- /* @__PURE__ */ L(M, { children: o("editor.inputNodeForm.objectMappingDesc") })
3590
- ] })
3591
- })
3592
- ] })
3593
- ] })
3594
- })]
3595
- })]
3596
- })
3597
- ]
3598
- })
3599
- });
3600
- }, xr = () => {
3601
- let [e, t] = F("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = G(), { Field: i } = Ve({
3602
- defaultValues: { label: n?.data?.label || { en: "" } },
3603
- listeners: {
3604
- onChange: ({ formApi: e }) => {
3605
- e.handleSubmit().then();
3606
- },
3607
- onChangeDebounceMs: 150
3608
- },
3609
- onSubmit: ({ value: e }) => {
3610
- r(e);
3611
- }
3612
- });
3613
- return /* @__PURE__ */ L("form", {
3614
- onSubmit: (e) => {
3615
- e.preventDefault(), e.stopPropagation();
3616
- },
3617
- children: /* @__PURE__ */ L("div", {
3618
- className: "tg:grid tg:gap-6",
3619
- children: /* @__PURE__ */ R("div", {
3620
- className: "tg:flex tg:items-end tg:gap-2",
3621
- children: [/* @__PURE__ */ L(i, {
3622
- name: "label",
3623
- children: (t) => /* @__PURE__ */ R(j, {
3624
- className: "tg:flex-1",
3625
- children: [/* @__PURE__ */ L(d, {
3626
- htmlFor: t.name,
3627
- children: "Label"
3628
- }), /* @__PURE__ */ L(k, {
3629
- id: t.name,
3630
- name: t.name,
3631
- value: t.state.value?.[e] || "",
3632
- onBlur: t.handleBlur,
3633
- onChange: ({ target: n }) => {
3634
- t.handleChange({
3635
- ...t.state.value,
3636
- [e]: n.value
3637
- });
3638
- }
3639
- })]
3640
- })
3641
- }), /* @__PURE__ */ L(Q, {
3642
- value: e,
3643
- onValueChange: t
3644
- })]
3645
- })
3646
- })
3647
- });
3648
- }, Sr = () => {
3649
- let [e, t] = F(""), [r, i] = F(!1), { selectedNode: a, groupNodes: o } = $(), { setNodes: s } = N(), c = a?.parentId || "none", l = n(a), u = W(), f = Re(), p = Re();
3650
- if (l) return null;
3651
- let m = (e) => {
3652
- a && s((t) => e === "none" ? t.map((e) => {
3653
- if (e.id === a.id) {
3654
- let { parentId: t, extent: n, ...r } = e;
3655
- return r;
3656
- }
3657
- return e;
3658
- }) : t.find((t) => t.id === e) ? t.map((t) => t.id === a.id ? {
3659
- ...t,
3660
- extent: "parent",
3661
- parentId: e,
3662
- position: {
3663
- x: 50,
3664
- y: 80
3665
- }
3666
- } : t) : t);
3667
- }, _ = () => {
3668
- if (!(e.trim() && a)) return;
3669
- if (o.find((t) => {
3670
- let n = t.data?.label?.en || t.data?.label;
3671
- return String(n).toLowerCase() === e.trim().toLowerCase();
3672
- })) {
3673
- H.error("This group already exists", { description: "Use the selector to add the node to an existing group." });
3674
- return;
3675
- }
3676
- let n = en();
3677
- s((t) => [{
3678
- data: { label: { en: e.trim() } },
3679
- id: n,
3680
- position: {
3681
- x: a.position.x - 300,
3682
- y: a.position.y
3683
- },
3684
- style: {
3685
- height: 400,
3686
- width: 600
3687
- },
3688
- type: "group"
3689
- }, ...t.map((e) => e.id === a.id ? {
3690
- ...e,
3691
- extent: "parent",
3692
- parentId: n,
3693
- position: {
3694
- x: 175,
3695
- y: 30
3696
- }
3697
- } : e)]), t(""), i(!1), H.success("Group created", { description: `The group "${e.trim()}" has been created successfully.` });
3698
- };
3699
- return /* @__PURE__ */ R("div", {
3700
- className: "tg:space-y-2",
3701
- children: [/* @__PURE__ */ L(d, {
3702
- htmlFor: f,
3703
- children: u("editor.selectNodeGroup.group")
3704
- }), /* @__PURE__ */ R("div", {
3705
- className: "tg:flex tg:gap-2",
3706
- children: [/* @__PURE__ */ R(g, {
3707
- value: c,
3708
- onValueChange: m,
3709
- children: [/* @__PURE__ */ L(v, {
3710
- id: f,
3711
- className: "tg:flex-1",
3712
- children: /* @__PURE__ */ L(T, { placeholder: u("editor.selectNodeGroup.noGroup") })
3713
- }), /* @__PURE__ */ L(C, { children: /* @__PURE__ */ R(w, { children: [/* @__PURE__ */ L(h, {
3714
- value: "none",
3715
- children: u("editor.selectNodeGroup.noGroup")
3716
- }), o.map((e) => /* @__PURE__ */ L(h, {
3717
- value: e.id,
3718
- children: e.data.label?.en ? String(e.data.label?.en) : e.id
3719
- }, e.id))] }) })]
3720
- }), /* @__PURE__ */ R(ie, {
3721
- open: r,
3722
- onOpenChange: i,
3723
- children: [/* @__PURE__ */ L(ne, {
3724
- asChild: !0,
3725
- children: /* @__PURE__ */ L(A, {
3726
- variant: "outline",
3727
- size: "icon",
3728
- title: "Create a new group",
3729
- children: /* @__PURE__ */ L(yt, { className: "tg:h-4 tg:w-4" })
3730
- })
3731
- }), /* @__PURE__ */ L(ae, {
3732
- className: "tg:w-80",
3733
- align: "end",
3734
- disablePortal: !0,
3735
- children: /* @__PURE__ */ R("div", {
3736
- className: "tg:space-y-4",
3737
- children: [
3738
- /* @__PURE__ */ R("div", {
3739
- className: "tg:space-y-2",
3740
- children: [/* @__PURE__ */ L("h4", {
3741
- className: "tg:font-medium tg:leading-none",
3742
- children: u("editor.selectNodeGroup.newGroup")
3743
- }), /* @__PURE__ */ L("p", {
3744
- className: "tg:text-muted-foreground tg:text-sm",
3745
- children: u("editor.selectNodeGroup.newGroupDescription")
3746
- })]
3747
- }),
3748
- /* @__PURE__ */ R("div", {
3749
- className: "tg:space-y-2",
3750
- children: [/* @__PURE__ */ L(d, {
3751
- htmlFor: p,
3752
- children: u("editor.selectNodeGroup.groupName")
3753
- }), /* @__PURE__ */ L(k, {
3754
- autoFocus: !0,
3755
- id: p,
3756
- value: e,
3757
- onChange: (e) => t(e.target.value),
3758
- placeholder: "Ex: Step 1 - Personal info",
3759
- onKeyDown: (e) => {
3760
- e.key === "Enter" && (e.preventDefault(), _());
3761
- }
3762
- })]
3763
- }),
3764
- /* @__PURE__ */ R("div", {
3765
- className: "tg:flex tg:justify-end tg:gap-2",
3766
- children: [/* @__PURE__ */ L(A, {
3767
- variant: "outline",
3768
- size: "sm",
3769
- onClick: () => i(!1),
3770
- children: "Cancel"
3771
- }), /* @__PURE__ */ L(A, {
3772
- size: "sm",
3773
- onClick: _,
3774
- disabled: !e.trim(),
3775
- children: "Create"
3776
- })]
3777
- })
3778
- ]
3779
- })
3780
- })]
3781
- })]
3782
- })]
3783
- });
3784
- }, Cr = Object.values(X), wr = Object.values(pn), Tr = () => {
3785
- let { selectedNode: e } = $(), { updateSelectedNodeType: t } = G(), { getEdges: a } = N(), { openNodeTypeChangeConfirmation: o } = U(), s = n(e), c = W(), u = Re(), d = Z(l.flow), f = () => e ? r(e) || i(e) ? e.data?.type || "" : e.type || "" : "", p = (n, r) => {
3786
- if (!e) return;
3787
- let i = a().filter((t) => t.source === e.id).length;
3788
- if ((n === l.ui || n === l.flow) && i > 1) {
3789
- o({
3790
- nodeId: e.id,
3791
- subType: r,
3792
- type: n
3793
- });
3794
- return;
3795
- }
3796
- t(n, r);
3797
- };
3798
- return /* @__PURE__ */ R(w, { children: [/* @__PURE__ */ L(y, {
3799
- htmlFor: u,
3800
- children: c("editor.selectNodeType.nodeType")
3801
- }), /* @__PURE__ */ R(g, {
3802
- value: f(),
3803
- onValueChange: (e) => {
3804
- if (Cr.includes(e)) {
3805
- p(l.input, e);
3806
- return;
3807
- }
3808
- if (wr.includes(e)) {
3809
- p(l.ui, e);
3810
- return;
3811
- }
3812
- p(e);
3813
- },
3814
- disabled: s,
3815
- children: [/* @__PURE__ */ L(v, {
3816
- className: "tg:w-full tg:capitalize",
3817
- id: u,
3818
- children: /* @__PURE__ */ L(T, { placeholder: c("editor.selectNodeType.nodeType") })
3819
- }), /* @__PURE__ */ L(C, {
3820
- className: "treege-scrollbar tg:max-h-80",
3821
- children: s ? /* @__PURE__ */ L(w, { children: /* @__PURE__ */ L(h, {
3822
- value: l.group,
3823
- children: c("editor.selectNodeType.options.group")
3824
- }) }) : /* @__PURE__ */ R(I, { children: [
3825
- /* @__PURE__ */ R(w, { children: [/* @__PURE__ */ L(y, { children: c("editor.selectNodeType.options.input") }), Cr.map((e) => /* @__PURE__ */ R(h, {
3826
- value: e,
3827
- className: "tg:capitalize",
3828
- children: [/* @__PURE__ */ L(Z(e), {}), e]
3829
- }, e))] }),
3830
- /* @__PURE__ */ L(ue, {}),
3831
- /* @__PURE__ */ R(w, { children: [/* @__PURE__ */ L(y, { children: c("editor.selectNodeType.options.ui") }), wr.map((e) => /* @__PURE__ */ R(h, {
3832
- value: e,
3833
- className: "tg:capitalize",
3834
- children: [/* @__PURE__ */ L(Z(e), {}), e]
3835
- }, e))] }),
3836
- /* @__PURE__ */ L(ue, {}),
3837
- /* @__PURE__ */ R(w, { children: [/* @__PURE__ */ L(y, { children: c("common.other") }), /* @__PURE__ */ R(h, {
3838
- value: l.flow,
3839
- children: [/* @__PURE__ */ L(d, {}), c("editor.selectNodeType.options.flow")]
3840
- })] })
3841
- ] })
3842
- })]
3843
- })] });
3844
- };
3845
- //#endregion
3846
- //#region src/shared/components/ui/sheet.tsx
3847
- function Er({ ...e }) {
3848
- return /* @__PURE__ */ L(Ft.Root, {
3849
- "data-slot": "sheet",
3850
- ...e
3851
- });
3852
- }
3853
- function Dr({ ...e }) {
3854
- return /* @__PURE__ */ L(Ft.Portal, {
3855
- "data-slot": "sheet-portal",
3856
- ...e
3857
- });
3858
- }
3859
- function Or({ className: e, ...t }) {
3860
- return /* @__PURE__ */ L(Ft.Overlay, {
3861
- "data-slot": "sheet-overlay",
3862
- className: D("tg:data-[state=closed]:fade-out-0 tg:data-[state=open]:fade-in-0 tg:fixed tg:inset-0 tg:z-50 tg:bg-black/50 tg:data-[state=closed]:animate-out tg:data-[state=open]:animate-in", e),
3863
- ...t
3864
- });
3865
- }
3866
- function kr({ className: e, children: t, side: n = "right", ...r }) {
3867
- return /* @__PURE__ */ R(Dr, { children: [/* @__PURE__ */ L(Or, {}), /* @__PURE__ */ R(Ft.Content, {
3868
- "data-slot": "sheet-content",
3869
- className: D("tg:fixed tg:z-50 tg:flex tg:flex-col tg:gap-4 tg:bg-background tg:shadow-lg tg:transition tg:ease-in-out tg:data-[state=closed]:animate-out tg:data-[state=open]:animate-in tg:data-[state=closed]:duration-300 tg:data-[state=open]:duration-500", n === "right" && "tg:data-[state=closed]:slide-out-to-right tg:data-[state=open]:slide-in-from-right tg:inset-y-0 tg:right-0 tg:h-full tg:w-3/4 tg:border-l tg:sm:max-w-sm", n === "left" && "tg:data-[state=closed]:slide-out-to-left tg:data-[state=open]:slide-in-from-left tg:inset-y-0 tg:left-0 tg:h-full tg:w-3/4 tg:border-r tg:sm:max-w-sm", n === "top" && "tg:data-[state=closed]:slide-out-to-top tg:data-[state=open]:slide-in-from-top tg:inset-x-0 tg:top-0 tg:h-auto tg:border-b", n === "bottom" && "tg:data-[state=closed]:slide-out-to-bottom tg:data-[state=open]:slide-in-from-bottom tg:inset-x-0 tg:bottom-0 tg:h-auto tg:border-t", e),
3870
- ...r,
3871
- children: [t, /* @__PURE__ */ R(Ft.Close, {
3872
- className: "tg:absolute tg:top-4 tg:right-4 tg:rounded-xs tg:opacity-70 tg:ring-offset-background tg:transition-opacity tg:hover:opacity-100 tg:focus:outline-hidden tg:focus:ring-2 tg:focus:ring-ring tg:focus:ring-offset-2 tg:disabled:pointer-events-none tg:data-[state=open]:bg-secondary",
3873
- children: [/* @__PURE__ */ L(jt, { className: "tg:size-4" }), /* @__PURE__ */ L("span", {
3874
- className: "tg:sr-only",
3875
- children: "Close"
3876
- })]
3877
- })]
3878
- })] });
3879
- }
3880
- function Ar({ className: e, ...t }) {
3881
- return /* @__PURE__ */ L("div", {
3882
- "data-slot": "sheet-header",
3883
- className: D("tg:flex tg:flex-col tg:gap-1.5 tg:p-4", e),
3884
- ...t
3885
- });
3886
- }
3887
- function jr({ className: e, ...t }) {
3888
- return /* @__PURE__ */ L("div", {
3889
- "data-slot": "sheet-footer",
3890
- className: D("tg:mt-auto tg:flex tg:flex-col tg:gap-2 tg:p-4", e),
3891
- ...t
3892
- });
3893
- }
3894
- function Mr({ className: e, ...t }) {
3895
- return /* @__PURE__ */ L(Ft.Title, {
3896
- "data-slot": "sheet-title",
3897
- className: D("tg:font-semibold tg:text-foreground", e),
3898
- ...t
3899
- });
3900
- }
3901
- function Nr({ className: e, ...t }) {
3902
- return /* @__PURE__ */ L(Ft.Description, {
3903
- "data-slot": "sheet-description",
3904
- className: D("tg:text-muted-foreground tg:text-sm", e),
3905
- ...t
3906
- });
3907
- }
3908
- //#endregion
3909
- //#region src/editor/features/TreegeEditor/sheets/NodeActionsSheet.tsx
3910
- var Pr = () => {
3911
- let { selectedNode: e } = $(), { clearSelection: t } = G(), { isNodeSheetOpen: a, setIsNodeSheetOpen: s, openDeleteNodeConfirmation: c } = U(), l = W(), u = l(e?.data?.label), d = () => {
3912
- s(!1), t();
3913
- };
3914
- return /* @__PURE__ */ L(Er, {
3915
- open: a && !!e,
3916
- onOpenChange: (e) => {
3917
- e || d();
3918
- },
3919
- children: /* @__PURE__ */ R(kr, {
3920
- className: "tg:flex tg:flex-col tg:gap-0",
3921
- children: [
3922
- /* @__PURE__ */ R(Ar, { children: [/* @__PURE__ */ R(Mr, { children: [
3923
- l("editor.nodeActionsSheet.editNode"),
3924
- " ",
3925
- /* @__PURE__ */ L("span", {
3926
- className: "tg:font-light tg:text-muted-foreground tg:text-xs",
3927
- children: e?.id
3928
- })
3929
- ] }), /* @__PURE__ */ L(Nr, { children: u || "\xA0" })] }),
3930
- /* @__PURE__ */ L(Jt, {
3931
- className: "tg:flex tg:min-h-0 tg:flex-1 tg:flex-col tg:px-4",
3932
- children: /* @__PURE__ */ R("div", {
3933
- className: "tg:space-y-6 tg:py-4",
3934
- children: [
3935
- /* @__PURE__ */ L(Tr, {}),
3936
- /* @__PURE__ */ L(Sr, {}),
3937
- /* @__PURE__ */ L(le, {}),
3938
- r(e) && /* @__PURE__ */ L(br, {}),
3939
- i(e) && /* @__PURE__ */ L(xr, {}),
3940
- o(e) && /* @__PURE__ */ L(tr, {}),
3941
- n(e) && /* @__PURE__ */ L(nr, {})
3942
- ]
3943
- })
3944
- }),
3945
- /* @__PURE__ */ L(jr, {
3946
- className: "tg:flex tg:items-end tg:border-t",
3947
- children: /* @__PURE__ */ L(A, {
3948
- variant: "ghost",
3949
- size: "icon",
3950
- onClick: () => {
3951
- e && c(e.id);
3952
- },
3953
- "aria-label": l("editor.nodeActionsSheet.deleteNode"),
3954
- children: /* @__PURE__ */ L(Et, {})
3955
- })
3956
- })
3957
- ]
3958
- })
3959
- });
3960
- }, Fr = ({ ...e }) => {
3961
- let { theme: t = "system" } = zt();
3962
- return /* @__PURE__ */ L(Lt, {
3963
- theme: t,
3964
- className: "toaster tg:group",
3965
- style: {
3966
- "--normal-bg": "var(--treege-popover)",
3967
- "--normal-border": "var(--treege-border)",
3968
- "--normal-text": "var(--treege-popover-foreground)"
3969
- },
3970
- ...e
3971
- });
3972
- }, Ir = {
3973
- desktop: "(min-width: 1024px)",
3974
- mobile: "(max-width: 767px)",
3975
- tablet: "(min-width: 768px) and (max-width: 1023px)"
3976
- }, Lr = (e) => e in Ir, Rr = (e) => {
3977
- let [t, n] = F(void 0), r = Lr(e) ? Ir[e] : e;
3978
- return Le(() => {
3979
- let e = window.matchMedia(r), t = () => n(e.matches);
3980
- return e.addEventListener("change", t), n(e.matches), () => e.removeEventListener("change", t);
3981
- }, [r]), !!t;
3982
- }, zr = ({ flow: e, onExportJson: t, onSave: n, theme: r, className: i, extraMenuItems: a }) => {
3983
- let { onConnect: o, onConnectEnd: s, onEdgesDelete: c, isValidConnection: l } = fn(), [u, d] = F(!1);
3984
- return /* @__PURE__ */ R(Ee, {
3985
- fitView: !0,
3986
- minZoom: .1,
3987
- fitViewOptions: { maxZoom: Rr("mobile") ? .6 : 1 },
3988
- colorMode: r,
3989
- selectNodesOnDrag: !1,
3990
- nodeTypes: Dn,
3991
- edgeTypes: Qt,
3992
- defaultEdges: e?.edges || [],
3993
- defaultNodes: e?.nodes || [],
3994
- onConnect: o,
3995
- onConnectEnd: s,
3996
- onEdgesDelete: c,
3997
- isValidConnection: l,
3998
- className: D(i, "treege"),
3999
- children: [
4000
- /* @__PURE__ */ L(Vn, {}),
4001
- /* @__PURE__ */ L(he, {
4002
- gap: 10,
4003
- variant: ge.Dots
4004
- }),
4005
- /* @__PURE__ */ L($n, {
4006
- onExportJson: t,
4007
- onSave: n,
4008
- extraMenuItems: a
4009
- }),
4010
- /* @__PURE__ */ L(Ht, { theme: r }),
4011
- u && /* @__PURE__ */ L(Se, {}),
4012
- /* @__PURE__ */ L(ye, { children: /* @__PURE__ */ L(On, {
4013
- show: u,
4014
- onToggle: () => d((e) => !e)
4015
- }) }),
4016
- /* @__PURE__ */ L(Pr, {}),
4017
- /* @__PURE__ */ L(Mn, {}),
4018
- /* @__PURE__ */ L(jn, {})
4019
- ]
4020
- });
4021
- }, Br = ({ flow: e, onExportJson: t, onSave: n, theme: r = "dark", language: i = "en", aiConfig: a, extraMenuItems: o }) => /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(Wt, {}), /* @__PURE__ */ L(u, {
4022
- defaultTheme: r,
4023
- storageKey: "treege-editor-theme",
4024
- theme: r,
4025
- children: /* @__PURE__ */ R(qt, {
4026
- value: {
4027
- aiConfig: a,
4028
- flowId: e?.id,
4029
- language: i
4030
- },
4031
- children: [/* @__PURE__ */ L(Fr, { position: "bottom-center" }), /* @__PURE__ */ L(De, { children: /* @__PURE__ */ L(zr, {
4032
- onExportJson: t,
4033
- onSave: n,
4034
- flow: e,
4035
- theme: r,
4036
- extraMenuItems: o
4037
- }) })]
4038
- })
4039
- })] });
4040
- //#endregion
4041
- export { Br as t };