treege 3.0.0-beta.39 → 3.0.0-beta.40

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 (30) hide show
  1. package/dist/DefaultInputs-8yJMEyMh.js +1557 -0
  2. package/dist/ThemeContext-Ejgu9Mwr.js +1603 -0
  3. package/dist/editor/constants/nodeTypes.d.ts +3 -3
  4. package/dist/editor/context/TreegeEditorContext.d.ts +18 -1
  5. package/dist/editor/features/TreegeEditor/dialogs/ChangeNodeTypeDialog.d.ts +2 -0
  6. package/dist/editor/features/TreegeEditor/nodes/TreegeNode.d.ts +2 -2
  7. package/dist/editor/features/TreegeEditor/nodes/components/NodeInputPreview.d.ts +7 -0
  8. package/dist/editor/features/TreegeEditor/nodes/components/NodeTypeBadge.d.ts +7 -0
  9. package/dist/editor/hooks/useFlowActions.d.ts +2 -2
  10. package/dist/editor/utils/edge.d.ts +14 -0
  11. package/dist/{editor-CAj1BX2r.js → editor-DWJ95r4g.js} +1340 -1114
  12. package/dist/editor.js +2 -2
  13. package/dist/main.js +4 -5
  14. package/dist/renderer/utils/node.d.ts +9 -0
  15. package/dist/renderer-native.js +680 -681
  16. package/dist/renderer.js +3 -4
  17. package/dist/shared/locales/ar.json.d.ts +7 -0
  18. package/dist/shared/locales/de.json.d.ts +7 -0
  19. package/dist/shared/locales/en.json.d.ts +7 -0
  20. package/dist/shared/locales/es.json.d.ts +7 -0
  21. package/dist/shared/locales/fr.json.d.ts +7 -0
  22. package/dist/shared/locales/it.json.d.ts +7 -0
  23. package/dist/shared/locales/pt.json.d.ts +7 -0
  24. package/package.json +1 -1
  25. package/dist/ThemeContext-PGG6Ht__.js +0 -813
  26. package/dist/editor/features/TreegeEditor/inputs/SelectInputType.d.ts +0 -7
  27. package/dist/editor/features/TreegeEditor/nodes/components/InputTypeBadge.d.ts +0 -7
  28. package/dist/renderer-BOjgk8F8.js +0 -1199
  29. package/dist/separator-Cdfv5nIR.js +0 -351
  30. package/dist/useRenderNode-OgRe_mb5.js +0 -775
@@ -1,37 +1,37 @@
1
- import { a as e, c as t, d as n, i as r, l as i, r as a, t as o, u as s } from "./ThemeContext-PGG6Ht__.js";
2
- import { C as c, D as l, E as u, F as d, M as f, N as p, O as m, S as h, T as ee, _ as g, a as _, b as v, c as y, d as b, f as x, g as S, h as C, i as te, j as w, k as T, l as ne, m as re, n as ie, o as E, p as D, r as O, s as ae, t as oe, u as k, v as A, w as se, x as ce, y as j } from "./separator-Cdfv5nIR.js";
3
- import { Background as le, BackgroundVariant as ue, BaseEdge as de, Controls as fe, EdgeLabelRenderer as pe, Handle as me, MiniMap as he, NodeResizer as ge, Panel as _e, Position as ve, ReactFlow as ye, ReactFlowProvider as be, addEdge as xe, getBezierPath as Se, useEdges as Ce, useNodes as we, useNodesInitialized as Te, useReactFlow as M, useStore as Ee } from "@xyflow/react";
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-Ejgu9Mwr.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 b, M as ee, N as te, 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 oe, at as E, c as D, et as O, it as k, j as se, k as ce, nt as A, o as le, p as ue, q as de, rt as fe, t as pe, tt as j, v as me, z as he } from "./DefaultInputs-8yJMEyMh.js";
3
+ import { Background as ge, BackgroundVariant as _e, BaseEdge 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 M, useStore as Ne } from "@xyflow/react";
4
4
  import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
5
- import { useForm as I } from "@tanstack/react-form";
6
- import { AlignLeft as De, ArrowRightFromLine as Oe, Boxes as ke, Calendar as Ae, CalendarRange as je, CaseSensitive as Me, Check as Ne, CheckSquare as Pe, ChevronDown as Fe, ChevronsUpDown as Ie, CircleDot as Le, Clock as Re, Cloud as ze, Copy as Be, Download as Ve, EllipsisVertical as He, EyeOff as Ue, Hash as We, Heading as Ge, ImagePlus as Ke, KeyRound as qe, Link2 as Je, ListFilter as Ye, Loader2 as Xe, MapPin as Ze, Minus as Qe, MoreVertical as $e, Paperclip as et, Plus as L, PlusCircle as tt, RectangleEllipsis as nt, Save as rt, Search as it, Send as at, Settings as ot, ToggleLeft as st, Trash2 as ct, Upload as lt, Variable as ut, WandSparkles as dt, Waypoints as ft, X as R, XIcon as pt } from "lucide-react";
7
- import { createContext as mt, memo as ht, useCallback as z, useContext as gt, useEffect as _t, useId as vt, useMemo as yt, useRef as bt, useState as B } from "react";
8
- import { Slot as xt } from "@radix-ui/react-slot";
9
- import { cva as St } from "class-variance-authority";
10
- import * as Ct from "@radix-ui/react-scroll-area";
11
- import * as V from "@radix-ui/react-dropdown-menu";
12
- import * as H from "@radix-ui/react-dialog";
13
- import { Toaster as wt, toast as U } from "sonner";
14
- import * as Tt from "@radix-ui/react-collapsible";
15
- import Et from "@dagrejs/dagre";
16
- import { useTheme as Dt } from "next-themes";
5
+ import { useForm as Pe } from "@tanstack/react-form";
6
+ import { AlignLeft as Fe, ArrowRightFromLine as Ie, Boxes as Le, Calendar as Re, CalendarRange as ze, CaseSensitive as Be, Check as Ve, CheckSquare as He, ChevronDown as Ue, ChevronsUpDown as We, CircleDot as Ge, Clock as Ke, ClockFading as qe, Cloud as Je, Copy as Ye, Download as Xe, EllipsisVertical as Ze, EyeOff as Qe, Hash as $e, Heading as et, ImagePlus as tt, KeyRound as nt, Link2 as rt, ListFilter as it, Loader2 as at, MapPin as ot, Minus as st, MoreVertical as ct, Network as lt, Paperclip as ut, Plus as I, PlusCircle as dt, RectangleEllipsis as ft, Save as pt, Search as mt, Send as ht, Settings as gt, ToggleLeft as _t, Trash2 as vt, Upload as yt, Variable as bt, WandSparkles as xt, Waypoints as St, X as L, XIcon as Ct } from "lucide-react";
7
+ import { createContext as wt, memo as Tt, useCallback as R, useContext as Et, useEffect as Dt, useId as Ot, useMemo as kt, useRef as At, useState as z } from "react";
8
+ import { Slot as jt } from "@radix-ui/react-slot";
9
+ import { cva as Mt } from "class-variance-authority";
10
+ import * as Nt from "@radix-ui/react-scroll-area";
11
+ import * as B from "@radix-ui/react-dropdown-menu";
12
+ import * as Pt from "@radix-ui/react-dialog";
13
+ import { Toaster as Ft, toast as V } from "sonner";
14
+ import * as It from "@radix-ui/react-collapsible";
15
+ import Lt from "@dagrejs/dagre";
16
+ import { useTheme as Rt } from "next-themes";
17
17
  //#region src/editor/assets/img/treege-black.svg
18
- var Ot = "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", kt = "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", At = ({ theme: e = "dark" }) => /* @__PURE__ */ P("div", {
18
+ var zt = "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", 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_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", Vt = ({ theme: e = "dark" }) => /* @__PURE__ */ P("div", {
19
19
  className: "absolute top-5 left-5 z-50 select-none",
20
20
  children: /* @__PURE__ */ P("img", {
21
- src: e === "dark" ? kt : Ot,
21
+ src: e === "dark" ? Bt : zt,
22
22
  alt: "Treege",
23
23
  className: "relative h-14 w-auto drop-shadow-[0_0px_35px] drop-shadow-blue-600"
24
24
  })
25
- }), jt = (e) => {
26
- let t = we(), n = Ce();
27
- return yt(() => {
25
+ }), Ht = (e) => {
26
+ let t = je(), n = Ae();
27
+ return kt(() => {
28
28
  if (!e) return [];
29
- let r = (e, t = /* @__PURE__ */ new Set()) => {
29
+ let i = (e, t = /* @__PURE__ */ new Set()) => {
30
30
  if (t.has(e)) return [];
31
- let i = new Set(t).add(e);
32
- return n.filter((t) => t.target === e).flatMap((e) => [e.source, ...r(e.source, i)]);
33
- }, i = r(e);
34
- return t.filter((e) => i.includes(e.id) && s(e)).map((e) => {
31
+ let r = new Set(t).add(e);
32
+ return n.filter((t) => t.target === e).flatMap((e) => [e.source, ...i(e.source, r)]);
33
+ }, a = i(e);
34
+ return t.filter((e) => a.includes(e.id) && r(e)).map((e) => {
35
35
  let t = e.data;
36
36
  return {
37
37
  label: (typeof t.label == "object" ? t.label.en : t.label) || t.name || e.id,
@@ -45,68 +45,75 @@ var Ot = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%20
45
45
  t,
46
46
  n
47
47
  ]);
48
- }, Mt = mt(null), Nt = ({ children: e, value: t }) => {
49
- let [n, r] = B(t?.flowId), [i, a] = B(!1), [o, s] = B(null), c = yt(() => ({
48
+ }, Ut = wt(null), Wt = ({ children: e, value: t }) => {
49
+ let [n, r] = z(t?.flowId), [i, a] = z(!1), [o, s] = z(null), [c, l] = z(null), u = kt(() => ({
50
50
  ...t,
51
51
  ...t?.aiConfig && { aiConfig: {
52
52
  ...t.aiConfig,
53
53
  provider: t?.aiConfig.provider ?? "gemini"
54
54
  } },
55
55
  closeDeleteNodeConfirmation: () => s(null),
56
+ closeNodeTypeChangeConfirmation: () => l(null),
56
57
  flowId: n,
57
58
  isNodeSheetOpen: i,
58
59
  openDeleteNodeConfirmation: (e) => s(e),
60
+ openNodeTypeChangeConfirmation: (e) => l(e),
59
61
  pendingDeleteNodeId: o,
62
+ pendingNodeTypeChange: c,
60
63
  setFlowId: r,
61
64
  setIsNodeSheetOpen: a
62
65
  }), [
63
66
  n,
64
67
  t,
65
68
  i,
66
- o
69
+ o,
70
+ c
67
71
  ]);
68
- return /* @__PURE__ */ P(Mt.Provider, {
69
- value: c,
72
+ return /* @__PURE__ */ P(Ut.Provider, {
73
+ value: u,
70
74
  children: e
71
75
  });
72
- }, W = () => gt(Mt) ?? {
76
+ }, H = () => Et(Ut) ?? {
73
77
  closeDeleteNodeConfirmation: () => {},
78
+ closeNodeTypeChangeConfirmation: () => {},
74
79
  flowId: void 0,
75
80
  isNodeSheetOpen: !1,
76
81
  language: "en",
77
82
  openDeleteNodeConfirmation: () => {},
83
+ openNodeTypeChangeConfirmation: () => {},
78
84
  pendingDeleteNodeId: null,
85
+ pendingNodeTypeChange: null,
79
86
  setFlowId: () => {},
80
87
  setIsNodeSheetOpen: () => {}
81
- }, G = (t) => {
82
- let n = W();
83
- return e(t ?? n.language);
88
+ }, U = (e) => {
89
+ let t = H();
90
+ return c(e ?? t.language);
84
91
  };
85
92
  //#endregion
86
93
  //#region src/shared/components/ui/scroll-area.tsx
87
- function Pt({ className: e, children: t, ...n }) {
88
- return /* @__PURE__ */ F(Ct.Root, {
94
+ function Gt({ className: e, children: t, ...n }) {
95
+ return /* @__PURE__ */ F(Nt.Root, {
89
96
  "data-slot": "scroll-area",
90
- className: d("relative", e),
97
+ className: E("relative", e),
91
98
  ...n,
92
99
  children: [
93
- /* @__PURE__ */ P(Ct.Viewport, {
100
+ /* @__PURE__ */ P(Nt.Viewport, {
94
101
  "data-slot": "scroll-area-viewport",
95
102
  className: "size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px] focus-visible:ring-ring/50",
96
103
  children: t
97
104
  }),
98
- /* @__PURE__ */ P(Ft, {}),
99
- /* @__PURE__ */ P(Ct.Corner, {})
105
+ /* @__PURE__ */ P(Kt, {}),
106
+ /* @__PURE__ */ P(Nt.Corner, {})
100
107
  ]
101
108
  });
102
109
  }
103
- function Ft({ className: e, orientation: t = "vertical", ...n }) {
104
- return /* @__PURE__ */ P(Ct.ScrollAreaScrollbar, {
110
+ function Kt({ className: e, orientation: t = "vertical", ...n }) {
111
+ return /* @__PURE__ */ P(Nt.ScrollAreaScrollbar, {
105
112
  "data-slot": "scroll-area-scrollbar",
106
113
  orientation: t,
107
- className: d("flex touch-none select-none p-px transition-colors", t === "vertical" && "h-full w-2.5 border-l border-l-transparent", t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", e),
114
+ className: E("flex touch-none select-none p-px transition-colors", t === "vertical" && "h-full w-2.5 border-l border-l-transparent", t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", e),
108
115
  ...n,
109
- children: /* @__PURE__ */ P(Ct.ScrollAreaThumb, {
116
+ children: /* @__PURE__ */ P(Nt.ScrollAreaThumb, {
110
117
  "data-slot": "scroll-area-thumb",
111
118
  className: "relative flex-1 rounded-full bg-border"
112
119
  })
@@ -114,24 +121,31 @@ function Ft({ className: e, orientation: t = "vertical", ...n }) {
114
121
  }
115
122
  //#endregion
116
123
  //#region src/editor/features/TreegeEditor/edges/ConditionalEdge.tsx
117
- var It = (e) => !!e.field && e.value !== void 0 && e.value !== "", Lt = {
118
- conditional: ht(({ id: e, target: t, sourceX: n, sourceY: i, targetX: a, targetY: o, sourcePosition: s, targetPosition: _, markerEnd: y, style: b, data: x }) => {
119
- let [S, C, te] = Se({
124
+ var qt = {
125
+ "!==": "≠",
126
+ "<": "<",
127
+ "<=": "≤",
128
+ "===": "=",
129
+ ">": ">",
130
+ ">=": "≥"
131
+ }, Jt = (e) => !!e.field && e.value !== void 0 && e.value !== "", Yt = {
132
+ conditional: Tt(({ id: t, target: n, sourceX: r, sourceY: i, targetX: a, targetY: o, sourcePosition: s, targetPosition: c, markerEnd: l, style: u, data: f }) => {
133
+ let [p, m, _] = ke({
120
134
  sourcePosition: s,
121
- sourceX: n,
135
+ sourceX: r,
122
136
  sourceY: i,
123
- targetPosition: _,
137
+ targetPosition: c,
124
138
  targetX: a,
125
139
  targetY: o
126
- }), [ne, re] = B(!1), { updateEdgeData: ie } = M(), E = jt(t), D = G(), O = !!x?.configured || !!x?.isFallback || !!x?.label || (x?.conditions?.some(It) ?? !1), { handleSubmit: ae, reset: oe, Field: k } = I({
140
+ }), [y, b] = z(!1), { updateEdgeData: ee } = M(), te = Ht(n), x = U(), S = !!f?.configured || !!f?.isFallback || !!f?.label || (f?.conditions?.some(Jt) ?? !1), { handleSubmit: re, reset: w, Field: oe } = Pe({
127
141
  defaultValues: {
128
- conditions: x?.conditions || [{
129
- field: E[0]?.nodeId ?? "",
142
+ conditions: f?.conditions || [{
143
+ field: te[0]?.nodeId ?? "",
130
144
  operator: "===",
131
145
  value: ""
132
146
  }],
133
- isFallback: !!x?.isFallback,
134
- label: x?.label || ""
147
+ isFallback: !!f?.isFallback,
148
+ label: f?.label || ""
135
149
  },
136
150
  listeners: {
137
151
  onChange: ({ formApi: e }) => {
@@ -139,71 +153,71 @@ var It = (e) => !!e.field && e.value !== void 0 && e.value !== "", Lt = {
139
153
  },
140
154
  onChangeDebounceMs: 150
141
155
  },
142
- onSubmit: ({ value: t }) => {
143
- ie(e, {
144
- ...t,
156
+ onSubmit: ({ value: e }) => {
157
+ ee(t, {
158
+ ...e,
145
159
  configured: !0
146
160
  });
147
161
  }
148
- }), ce = (e) => {
162
+ }), D = (e) => {
149
163
  e.stopPropagation();
150
- }, j = () => {
151
- oe({
164
+ }, se = () => {
165
+ w({
152
166
  conditions: [],
153
167
  isFallback: !1,
154
168
  label: ""
155
- }), ie(e, {
169
+ }), ee(t, {
156
170
  conditions: void 0,
157
171
  configured: void 0,
158
172
  isFallback: void 0,
159
173
  label: void 0
160
174
  });
161
- }, le = (t) => {
162
- re(t), !(t || x?.configured) && (x?.isFallback || x?.label || x?.conditions?.length) && ie(e, { configured: !0 });
163
- }, ue = () => {
164
- if (x?.isFallback) return x.label || D("editor.conditionalEdge.fallback");
165
- if (x?.label) return x.label;
166
- let e = x?.conditions ?? [];
167
- if (e.length === 0) return null;
168
- if (e.length === 1) {
169
- let [t] = e, n = E.find((e) => e.nodeId === t.field)?.label ?? t.field ?? "";
170
- return `${n === t.field && n.length > 5 ? `${n.slice(0, 5)}…` : n} ${t.operator} ${t.value ?? ""}`;
175
+ }, ce = (e) => {
176
+ b(e), !(e || f?.configured) && (f?.isFallback || f?.label || f?.conditions?.length) && ee(t, { configured: !0 });
177
+ }, le = () => {
178
+ if (f?.isFallback) return f.label || x("editor.conditionalEdge.fallback");
179
+ if (f?.label) return f.label;
180
+ let t = f?.conditions ?? [];
181
+ if (t.length === 0) return null;
182
+ if (t.length === 1) {
183
+ let [e] = t, n = te.find((t) => t.nodeId === e.field)?.label ?? e.field ?? "";
184
+ return `${n === e.field && n.length > 5 ? `${n.slice(0, 5)}…` : n} ${qt[e.operator] ?? e.operator} ${e.value ?? ""}`;
171
185
  }
172
- let t = e.filter((e) => e.logicalOperator === r.AND).length, n = e.filter((e) => e.logicalOperator === r.OR).length;
173
- return t > 0 && n === 0 ? `${e.length} ${D("editor.conditionalEdge.conditionsAnd")}` : n > 0 && t === 0 ? `${e.length} ${D("editor.conditionalEdge.conditionsOr")}` : `${e.length} ${D("editor.conditionalEdge.conditionsMixed")}`;
174
- }, fe = () => x?.isFallback ? "var(--color-chart-4)" : O ? "var(--color-chart-2)" : "var(--color-chart-3)";
175
- return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(de, {
176
- path: S,
177
- markerEnd: y,
186
+ let n = t.filter((t) => t.logicalOperator === e.AND).length, r = t.filter((t) => t.logicalOperator === e.OR).length;
187
+ 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")}`;
188
+ }, ue = () => f?.isFallback ? "var(--color-chart-4)" : S ? "var(--color-chart-2)" : "var(--color-chart-3)";
189
+ return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(ve, {
190
+ path: p,
191
+ markerEnd: l,
178
192
  style: {
179
- ...b,
180
- stroke: fe(),
181
- strokeDasharray: x?.isFallback ? "5,5" : void 0,
182
- strokeWidth: O ? 2 : b?.strokeWidth
193
+ ...u,
194
+ stroke: ue(),
195
+ strokeDasharray: f?.isFallback ? "5,5" : void 0,
196
+ strokeWidth: S ? 2 : u?.strokeWidth
183
197
  }
184
- }), /* @__PURE__ */ P(pe, { children: /* @__PURE__ */ P("div", {
198
+ }), /* @__PURE__ */ P(be, { children: /* @__PURE__ */ P("div", {
185
199
  className: "nodrag nopan absolute",
186
200
  style: {
187
201
  pointerEvents: "all",
188
- transform: `translate(-50%, -50%) translate(${C}px,${te}px)`
202
+ transform: `translate(-50%, -50%) translate(${m}px,${_}px)`
189
203
  },
190
- children: /* @__PURE__ */ F(se, {
191
- open: ne,
192
- onOpenChange: le,
193
- children: [/* @__PURE__ */ P(u, {
204
+ children: /* @__PURE__ */ F(ie, {
205
+ open: y,
206
+ onOpenChange: ce,
207
+ children: [/* @__PURE__ */ P(ne, {
194
208
  asChild: !0,
195
- children: /* @__PURE__ */ F(p, {
196
- variant: O ? "default" : "secondary",
209
+ children: /* @__PURE__ */ F(k, {
210
+ variant: S ? "default" : "secondary",
197
211
  size: "xs",
198
- className: d("transition-[filter]", O ? "hover:bg-primary hover:brightness-125" : "hover:bg-secondary hover:brightness-90"),
199
- onClick: ce,
200
- children: [/* @__PURE__ */ P(ft, { className: "h-3 w-3" }), O ? ue() : D("editor.conditionalEdge.defineCondition")]
212
+ className: E("transition-[filter]", S ? "hover:bg-primary hover:brightness-125" : "hover:bg-secondary hover:brightness-90"),
213
+ onClick: D,
214
+ children: [/* @__PURE__ */ P(St, { className: "h-3 w-3" }), S ? le() : x("editor.conditionalEdge.defineCondition")]
201
215
  })
202
- }), /* @__PURE__ */ P(ee, {
216
+ }), /* @__PURE__ */ P(ae, {
203
217
  className: "w-96 p-1",
204
218
  align: "center",
205
219
  onClick: (e) => e.stopPropagation(),
206
- children: /* @__PURE__ */ P(Pt, {
220
+ children: /* @__PURE__ */ P(Gt, {
207
221
  className: "flex max-h-150 flex-col p-3",
208
222
  children: /* @__PURE__ */ P("form", {
209
223
  onSubmit: (e) => {
@@ -216,87 +230,87 @@ var It = (e) => !!e.field && e.value !== void 0 && e.value !== "", Lt = {
216
230
  className: "space-y-2",
217
231
  children: [/* @__PURE__ */ P("h4", {
218
232
  className: "font-medium leading-none",
219
- children: D("editor.conditionalEdge.displayConditions")
233
+ children: x("editor.conditionalEdge.displayConditions")
220
234
  }), /* @__PURE__ */ P("p", {
221
235
  className: "text-muted-foreground text-sm",
222
- children: D("editor.conditionalEdge.displayConditionsDesc")
236
+ children: x("editor.conditionalEdge.displayConditionsDesc")
223
237
  })]
224
238
  }),
225
239
  /* @__PURE__ */ F("div", {
226
240
  className: "grid gap-4",
227
241
  children: [
228
- /* @__PURE__ */ P(k, {
242
+ /* @__PURE__ */ P(oe, {
229
243
  name: "label",
230
- children: (e) => /* @__PURE__ */ F(w, { children: [
231
- /* @__PURE__ */ P(l, {
244
+ children: (e) => /* @__PURE__ */ F(A, { children: [
245
+ /* @__PURE__ */ P(d, {
232
246
  htmlFor: e.name,
233
- children: D("editor.conditionalEdge.labelOptional")
247
+ children: x("editor.conditionalEdge.labelOptional")
234
248
  }),
235
- /* @__PURE__ */ P(m, {
249
+ /* @__PURE__ */ P(O, {
236
250
  id: e.name,
237
- placeholder: D("editor.conditionalEdge.labelPlaceholder"),
251
+ placeholder: x("editor.conditionalEdge.labelPlaceholder"),
238
252
  value: e.state.value,
239
253
  onChange: (t) => e.handleChange(t.target.value)
240
254
  }),
241
- /* @__PURE__ */ P(T, { children: D("editor.conditionalEdge.labelDesc") })
255
+ /* @__PURE__ */ P(j, { children: x("editor.conditionalEdge.labelDesc") })
242
256
  ] })
243
257
  }),
244
- /* @__PURE__ */ P(k, {
258
+ /* @__PURE__ */ P(oe, {
245
259
  name: "isFallback",
246
- children: (e) => /* @__PURE__ */ P(w, { children: /* @__PURE__ */ F("div", {
260
+ children: (e) => /* @__PURE__ */ P(A, { children: /* @__PURE__ */ F("div", {
247
261
  className: "flex items-center gap-3 rounded-lg border bg-muted/20 p-3",
248
- children: [/* @__PURE__ */ P(f, {
262
+ children: [/* @__PURE__ */ P(fe, {
249
263
  id: e.name,
250
264
  checked: e.state.value,
251
265
  onCheckedChange: (t) => e.handleChange(t)
252
266
  }), /* @__PURE__ */ F("div", {
253
267
  className: "flex flex-col gap-1",
254
- children: [/* @__PURE__ */ P(l, {
268
+ children: [/* @__PURE__ */ P(d, {
255
269
  htmlFor: e.name,
256
270
  className: "cursor-pointer font-medium",
257
- children: D("editor.conditionalEdge.fallbackPath")
258
- }), /* @__PURE__ */ P(T, {
271
+ children: x("editor.conditionalEdge.fallbackPath")
272
+ }), /* @__PURE__ */ P(j, {
259
273
  className: "text-xs",
260
- children: D("editor.conditionalEdge.fallbackPathDesc")
274
+ children: x("editor.conditionalEdge.fallbackPathDesc")
261
275
  })]
262
276
  })]
263
277
  }) })
264
278
  }),
265
- /* @__PURE__ */ P(k, {
279
+ /* @__PURE__ */ P(oe, {
266
280
  name: "conditions",
267
281
  mode: "array",
268
- children: (e) => {
269
- let t = e.form.getFieldValue("isFallback");
282
+ children: (t) => {
283
+ let n = t.form.getFieldValue("isFallback");
270
284
  return /* @__PURE__ */ F("div", {
271
285
  className: "space-y-3",
272
- children: [/* @__PURE__ */ P(l, {
273
- className: t ? "text-muted-foreground" : "",
274
- children: D("editor.conditionalEdge.conditions")
286
+ children: [/* @__PURE__ */ P(d, {
287
+ className: n ? "text-muted-foreground" : "",
288
+ children: x("editor.conditionalEdge.conditions")
275
289
  }), /* @__PURE__ */ F("div", {
276
290
  className: "space-y-2",
277
- children: [e.state.value?.map((n, i) => /* @__PURE__ */ F("div", {
291
+ children: [t.state.value?.map((r, i) => /* @__PURE__ */ F("div", {
278
292
  className: "space-y-2",
279
293
  children: [/* @__PURE__ */ F("div", {
280
294
  className: "space-y-2 rounded-lg border bg-muted/30 p-3",
281
295
  children: [
282
- /* @__PURE__ */ P(k, {
296
+ /* @__PURE__ */ P(oe, {
283
297
  name: `conditions[${i}].field`,
284
- children: (e) => /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
298
+ children: (e) => /* @__PURE__ */ F(A, { children: [/* @__PURE__ */ P(d, {
285
299
  htmlFor: `field-${i}`,
286
- children: D("editor.conditionalEdge.field")
300
+ children: x("editor.conditionalEdge.field")
287
301
  }), /* @__PURE__ */ F(g, {
288
- disabled: t,
302
+ disabled: n,
289
303
  value: e.state.value || "",
290
304
  onValueChange: (t) => e.handleChange(t),
291
- children: [/* @__PURE__ */ P(h, {
305
+ children: [/* @__PURE__ */ P(v, {
292
306
  id: `field-${i}`,
293
307
  className: "w-full",
294
- children: /* @__PURE__ */ P(c, { placeholder: D("editor.conditionalEdge.selectField") })
295
- }), /* @__PURE__ */ P(A, { children: E.length === 0 ? /* @__PURE__ */ P(v, {
308
+ children: /* @__PURE__ */ P(T, { placeholder: x("editor.conditionalEdge.selectField") })
309
+ }), /* @__PURE__ */ P(C, { children: te.length === 0 ? /* @__PURE__ */ P(h, {
296
310
  value: "none",
297
311
  disabled: !0,
298
- children: D("editor.conditionalEdge.noFieldsAvailable")
299
- }) : E.map((e) => /* @__PURE__ */ F(v, {
312
+ children: x("editor.conditionalEdge.noFieldsAvailable")
313
+ }) : te.map((e) => /* @__PURE__ */ F(h, {
300
314
  value: e.nodeId,
301
315
  children: [
302
316
  e.label,
@@ -309,110 +323,110 @@ var It = (e) => !!e.field && e.value !== void 0 && e.value !== "", Lt = {
309
323
  }),
310
324
  /* @__PURE__ */ F("div", {
311
325
  className: "flex gap-2",
312
- children: [/* @__PURE__ */ P(k, {
326
+ children: [/* @__PURE__ */ P(oe, {
313
327
  name: `conditions[${i}].operator`,
314
- children: (e) => /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
328
+ children: (e) => /* @__PURE__ */ F(A, { children: [/* @__PURE__ */ P(d, {
315
329
  htmlFor: `operator-${i}`,
316
- children: D("editor.conditionalEdge.operator")
330
+ children: x("editor.conditionalEdge.operator")
317
331
  }), /* @__PURE__ */ F(g, {
318
- disabled: t,
332
+ disabled: n,
319
333
  value: e.state.value || "===",
320
334
  onValueChange: (t) => e.handleChange(t),
321
- children: [/* @__PURE__ */ P(h, {
335
+ children: [/* @__PURE__ */ P(v, {
322
336
  id: `operator-${i}`,
323
- children: /* @__PURE__ */ P(c, {})
324
- }), /* @__PURE__ */ F(A, { children: [
325
- /* @__PURE__ */ P(v, {
337
+ children: /* @__PURE__ */ P(T, {})
338
+ }), /* @__PURE__ */ F(C, { children: [
339
+ /* @__PURE__ */ P(h, {
326
340
  value: "===",
327
341
  children: "="
328
342
  }),
329
- /* @__PURE__ */ P(v, {
343
+ /* @__PURE__ */ P(h, {
330
344
  value: "!==",
331
345
  children: "≠"
332
346
  }),
333
- /* @__PURE__ */ P(v, {
347
+ /* @__PURE__ */ P(h, {
334
348
  value: ">",
335
349
  children: ">"
336
350
  }),
337
- /* @__PURE__ */ P(v, {
351
+ /* @__PURE__ */ P(h, {
338
352
  value: "<",
339
353
  children: "<"
340
354
  }),
341
- /* @__PURE__ */ P(v, {
355
+ /* @__PURE__ */ P(h, {
342
356
  value: ">=",
343
357
  children: ">="
344
358
  }),
345
- /* @__PURE__ */ P(v, {
359
+ /* @__PURE__ */ P(h, {
346
360
  value: "<=",
347
361
  children: "<="
348
362
  })
349
363
  ] })]
350
364
  })] })
351
- }), /* @__PURE__ */ P(k, {
365
+ }), /* @__PURE__ */ P(oe, {
352
366
  name: `conditions[${i}].value`,
353
- children: (e) => /* @__PURE__ */ F(w, {
367
+ children: (e) => /* @__PURE__ */ F(A, {
354
368
  className: "w-full",
355
- children: [/* @__PURE__ */ P(l, {
369
+ children: [/* @__PURE__ */ P(d, {
356
370
  htmlFor: `value-${i}`,
357
- children: D("editor.conditionalEdge.value")
358
- }), /* @__PURE__ */ P(m, {
359
- disabled: t,
371
+ children: x("editor.conditionalEdge.value")
372
+ }), /* @__PURE__ */ P(O, {
373
+ disabled: n,
360
374
  id: `value-${i}`,
361
- placeholder: D("editor.conditionalEdge.valuePlaceholder"),
375
+ placeholder: x("editor.conditionalEdge.valuePlaceholder"),
362
376
  value: e.state.value || "",
363
377
  onChange: (t) => e.handleChange(t.target.value)
364
378
  })]
365
379
  })
366
380
  })]
367
381
  }),
368
- e.state.value && e.state.value.length > 1 && /* @__PURE__ */ F(p, {
369
- disabled: t,
382
+ t.state.value && t.state.value.length > 1 && /* @__PURE__ */ F(k, {
383
+ disabled: n,
370
384
  type: "button",
371
385
  variant: "ghost",
372
386
  size: "sm",
373
387
  className: "w-full",
374
388
  onClick: () => {
375
- e.removeValue(i), ae().then();
389
+ t.removeValue(i), re().then();
376
390
  },
377
- children: [/* @__PURE__ */ P(R, { className: "mr-1 h-4 w-4" }), D("editor.conditionalEdge.removeCondition")]
391
+ children: [/* @__PURE__ */ P(L, { className: "mr-1 h-4 w-4" }), x("editor.conditionalEdge.removeCondition")]
378
392
  })
379
393
  ]
380
- }), e.state.value && i < e.state.value.length - 1 && /* @__PURE__ */ P(k, {
394
+ }), t.state.value && i < t.state.value.length - 1 && /* @__PURE__ */ P(oe, {
381
395
  name: `conditions[${i}].logicalOperator`,
382
- children: (e) => /* @__PURE__ */ P("div", {
396
+ children: (t) => /* @__PURE__ */ P("div", {
383
397
  className: "flex justify-center",
384
398
  children: /* @__PURE__ */ F(g, {
385
- disabled: t,
386
- value: e.state.value || r.AND,
387
- onValueChange: (t) => e.handleChange(t),
388
- children: [/* @__PURE__ */ P(h, {
399
+ disabled: n,
400
+ value: t.state.value || e.AND,
401
+ onValueChange: (e) => t.handleChange(e),
402
+ children: [/* @__PURE__ */ P(v, {
389
403
  className: "h-9 w-32 font-semibold",
390
- children: /* @__PURE__ */ P(c, {})
391
- }), /* @__PURE__ */ F(A, { children: [/* @__PURE__ */ P(v, {
392
- value: r.AND,
404
+ children: /* @__PURE__ */ P(T, {})
405
+ }), /* @__PURE__ */ F(C, { children: [/* @__PURE__ */ P(h, {
406
+ value: e.AND,
393
407
  children: "AND"
394
- }), /* @__PURE__ */ P(v, {
395
- value: r.OR,
408
+ }), /* @__PURE__ */ P(h, {
409
+ value: e.OR,
396
410
  children: "OR"
397
411
  })] })]
398
412
  })
399
413
  })
400
414
  })]
401
- }, `condition-${i}`)), /* @__PURE__ */ F(p, {
402
- disabled: t,
415
+ }, `condition-${i}`)), /* @__PURE__ */ F(k, {
416
+ disabled: n,
403
417
  type: "button",
404
418
  variant: "outline",
405
419
  size: "sm",
406
420
  className: "w-full",
407
421
  onClick: () => {
408
- e.pushValue({
409
- field: E[0]?.nodeId ?? "",
410
- logicalOperator: r.AND,
422
+ t.pushValue({
423
+ field: te[0]?.nodeId ?? "",
424
+ logicalOperator: e.AND,
411
425
  operator: "===",
412
426
  value: ""
413
- }), ae().then();
427
+ }), re().then();
414
428
  },
415
- children: [/* @__PURE__ */ P(L, { className: "mr-2 h-4 w-4" }), D("editor.conditionalEdge.addCondition")]
429
+ children: [/* @__PURE__ */ P(I, { className: "mr-2 h-4 w-4" }), x("editor.conditionalEdge.addCondition")]
416
430
  })]
417
431
  })]
418
432
  });
@@ -422,17 +436,17 @@ var It = (e) => !!e.field && e.value !== void 0 && e.value !== "", Lt = {
422
436
  }),
423
437
  /* @__PURE__ */ F("div", {
424
438
  className: "flex justify-end gap-2 pt-2",
425
- children: [/* @__PURE__ */ F(p, {
439
+ children: [/* @__PURE__ */ F(k, {
426
440
  type: "button",
427
441
  size: "sm",
428
442
  variant: "outline",
429
- onClick: j,
430
- children: [/* @__PURE__ */ P(R, { className: "mr-1 h-4 w-4" }), D("common.clear")]
431
- }), /* @__PURE__ */ P(p, {
443
+ onClick: se,
444
+ children: [/* @__PURE__ */ P(L, { className: "mr-1 h-4 w-4" }), x("common.clear")]
445
+ }), /* @__PURE__ */ P(k, {
432
446
  type: "button",
433
447
  size: "sm",
434
- onClick: () => le(!1),
435
- children: D("common.close")
448
+ onClick: () => ce(!1),
449
+ children: x("common.close")
436
450
  })]
437
451
  })
438
452
  ]
@@ -443,8 +457,8 @@ var It = (e) => !!e.field && e.value !== void 0 && e.value !== "", Lt = {
443
457
  })
444
458
  }) })] });
445
459
  }),
446
- default: ht(({ id: e, sourceX: t, sourceY: n, targetX: r, targetY: i, sourcePosition: a, targetPosition: o, style: s, markerEnd: c, selected: l }) => {
447
- let [u, d, f] = Se({
460
+ default: Tt(({ id: e, sourceX: t, sourceY: n, targetX: r, targetY: i, sourcePosition: a, targetPosition: o, style: s, markerEnd: c, selected: l }) => {
461
+ let [u, d, f] = ke({
448
462
  sourcePosition: a,
449
463
  sourceX: t,
450
464
  sourceY: n,
@@ -452,11 +466,11 @@ var It = (e) => !!e.field && e.value !== void 0 && e.value !== "", Lt = {
452
466
  targetX: r,
453
467
  targetY: i
454
468
  }), { setEdges: p } = M();
455
- return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(de, {
469
+ return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(ve, {
456
470
  path: u,
457
471
  markerEnd: c,
458
472
  style: s
459
- }), /* @__PURE__ */ P(pe, { children: l && /* @__PURE__ */ P("div", {
473
+ }), /* @__PURE__ */ P(be, { children: l && /* @__PURE__ */ P("div", {
460
474
  className: "button-edge__label nodrag nopan",
461
475
  style: { transform: `translate(-50%, -50%) translate(${d}px,${f}px)` },
462
476
  children: /* @__PURE__ */ P("button", {
@@ -470,34 +484,33 @@ var It = (e) => !!e.field && e.value !== void 0 && e.value !== "", Lt = {
470
484
  })
471
485
  }) })] });
472
486
  })
473
- }, K = {
474
- address: "address",
475
- autocomplete: "autocomplete",
476
- checkbox: "checkbox",
477
- date: "date",
478
- daterange: "daterange",
479
- file: "file",
480
- hidden: "hidden",
481
- http: "http",
482
- number: "number",
483
- password: "password",
484
- radio: "radio",
485
- select: "select",
486
- submit: "submit",
487
- switch: "switch",
488
- text: "text",
489
- textarea: "textarea",
490
- time: "time",
491
- timerange: "timerange"
492
- }, Rt = { [a.input]: { type: K.text } }, q = () => {
493
- let { setNodes: e, setEdges: t, getNodes: n } = M(), r = z(() => {
487
+ }, Xt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", Zt = (e = 21) => {
488
+ let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
489
+ for (; e--;) t += Xt[n[e] & 63];
490
+ return t;
491
+ }, Qt = (e, t) => {
492
+ if (t.size === 0) return e;
493
+ let n = /* @__PURE__ */ new Map();
494
+ return e.forEach((e) => {
495
+ n.set(e.source, (n.get(e.source) ?? 0) + 1);
496
+ }), e.map((e) => {
497
+ if (!t.has(e.source) || (n.get(e.source) ?? 0) !== 1) return e;
498
+ let { conditions: r, isFallback: i, ...a } = e.data ?? {}, o = a && Object.keys(a).length > 0 ? a : void 0;
499
+ return {
500
+ ...e,
501
+ data: o,
502
+ type: "default"
503
+ };
504
+ });
505
+ }, W = () => {
506
+ let { setNodes: e, setEdges: t, getNodes: n } = M(), r = R(() => {
494
507
  e((e) => e.map(({ selected: e, ...t }) => t)), t((e) => e.map(({ selected: e, ...t }) => t));
495
- }, [t, e]), i = z((n) => {
508
+ }, [t, e]), i = R((n) => {
496
509
  e((e) => e.map((e) => ({
497
510
  ...e,
498
511
  selected: e.id === n
499
512
  }))), t((e) => e.map(({ selected: e, ...t }) => t));
500
- }, [t, e]), a = z((t, n) => {
513
+ }, [t, e]), a = R((t, n) => {
501
514
  e((e) => e.map((e) => e.id === t ? {
502
515
  ...e,
503
516
  data: {
@@ -505,25 +518,45 @@ var It = (e) => !!e.field && e.value !== void 0 && e.value !== "", Lt = {
505
518
  ...n
506
519
  }
507
520
  } : e));
508
- }, [e]), o = z((t, n) => {
509
- e((e) => e.map((e) => e.id === t ? {
510
- ...e,
511
- data: Rt[n] ?? {},
512
- type: n
513
- } : e));
514
- }, [e]), s = z((e) => {
515
- let t = n().find((e) => e.selected);
516
- t && o(t.id, e);
517
- }, [n, o]), c = z((e) => {
521
+ }, [e]), o = R((t, n, r) => {
522
+ e((e) => e.map((e) => {
523
+ if (e.id !== t) return e;
524
+ let i = e.type === n ? e.data : {};
525
+ return {
526
+ ...e,
527
+ data: r === void 0 ? i : {
528
+ ...i,
529
+ type: r
530
+ },
531
+ type: n
532
+ };
533
+ }));
534
+ }, [e]), s = R((e, t) => {
535
+ let r = n().find((e) => e.selected);
536
+ r && o(r.id, e, t);
537
+ }, [n, o]), c = R((e) => {
518
538
  let t = n().find((e) => e.selected);
519
539
  t && a(t.id, e);
520
- }, [n, a]), l = z((n) => {
521
- e((e) => e.filter((e) => e.id !== n)), t((e) => e.filter((e) => e.source !== n && e.target !== n));
540
+ }, [n, a]), l = R((n) => {
541
+ e((e) => e.filter((e) => e.id !== n)), t((e) => {
542
+ 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);
543
+ if (t.length === 1 && r.length === 1) {
544
+ let [e] = t, [n] = r, o = {
545
+ data: e.data,
546
+ id: Zt(),
547
+ source: e.source,
548
+ target: n.target,
549
+ type: e.type
550
+ };
551
+ return Qt([...a, o], i);
552
+ }
553
+ return Qt(a, i);
554
+ });
522
555
  }, [e, t]);
523
556
  return {
524
557
  clearSelection: r,
525
558
  deleteNode: l,
526
- deleteSelectedNode: z(() => {
559
+ deleteSelectedNode: R(() => {
527
560
  let e = n().find((e) => e.selected);
528
561
  e && l(e.id);
529
562
  }, [n, l]),
@@ -533,113 +566,122 @@ var It = (e) => !!e.field && e.value !== void 0 && e.value !== "", Lt = {
533
566
  updateSelectedNodeData: c,
534
567
  updateSelectedNodeType: s
535
568
  };
536
- }, zt = ({ nodeId: e, label: t, placeholder: n, className: r }) => {
537
- let { language: i } = W(), { updateNodeData: a } = q(), o = G(), s = t?.[i] ?? "", c = n || o("editor.treegeNode.labelPlaceholder"), l = (n) => {
538
- a(e, { label: {
539
- ...t,
540
- [i]: n.target.value
541
- } });
542
- }, u = (e) => e.stopPropagation();
543
- return /* @__PURE__ */ P("input", {
569
+ }, $t = ({ nodeId: e, label: t, placeholder: n, className: r }) => {
570
+ let { language: i } = H(), { updateNodeData: a, clearSelection: o } = W(), s = U(), c = At(null), l = t?.[i] ?? "", u = n || s("editor.treegeNode.labelPlaceholder"), d = (e) => e.stopPropagation();
571
+ return Dt(() => {
572
+ let e = setTimeout(() => {
573
+ c.current?.focus();
574
+ }, 300);
575
+ return () => clearTimeout(e);
576
+ }, []), /* @__PURE__ */ P("input", {
577
+ ref: c,
544
578
  type: "text",
545
- value: s,
546
- placeholder: c,
547
- onChange: l,
548
- onClick: u,
549
- onMouseDown: u,
550
- onPointerDown: u,
551
- className: d("nodrag nopan w-full truncate bg-transparent outline-none placeholder:text-muted-foreground/40", r)
579
+ value: l,
580
+ placeholder: u,
581
+ onChange: (n) => {
582
+ a(e, { label: {
583
+ ...t,
584
+ [i]: n.target.value
585
+ } });
586
+ },
587
+ onKeyDown: (e) => {
588
+ e.key === "Enter" && (e.preventDefault(), c.current?.blur(), o());
589
+ },
590
+ onClick: d,
591
+ onMouseDown: d,
592
+ onPointerDown: d,
593
+ className: E("nodrag nopan w-full truncate bg-transparent outline-none placeholder:text-muted-foreground/40", r)
552
594
  });
553
595
  };
554
596
  //#endregion
555
597
  //#region src/shared/components/ui/dropdown-menu.tsx
556
- function J({ ...e }) {
557
- return /* @__PURE__ */ P(V.Root, {
598
+ function G({ ...e }) {
599
+ return /* @__PURE__ */ P(B.Root, {
558
600
  "data-slot": "dropdown-menu",
559
601
  ...e
560
602
  });
561
603
  }
562
- function Y({ ...e }) {
563
- return /* @__PURE__ */ P(V.Trigger, {
604
+ function K({ ...e }) {
605
+ return /* @__PURE__ */ P(B.Trigger, {
564
606
  "data-slot": "dropdown-menu-trigger",
565
607
  ...e
566
608
  });
567
609
  }
568
- function X({ className: e, sideOffset: t = 4, ...n }) {
569
- return /* @__PURE__ */ P(V.Portal, { children: /* @__PURE__ */ P(V.Content, {
610
+ function q({ className: e, sideOffset: t = 4, ...n }) {
611
+ return /* @__PURE__ */ P(B.Portal, { children: /* @__PURE__ */ P(B.Content, {
570
612
  "data-slot": "dropdown-menu-content",
571
613
  sideOffset: t,
572
- className: d("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in", e),
614
+ className: E("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in", e),
573
615
  ...n
574
616
  }) });
575
617
  }
576
- function Bt({ ...e }) {
577
- return /* @__PURE__ */ P(V.Group, {
618
+ function J({ ...e }) {
619
+ return /* @__PURE__ */ P(B.Group, {
578
620
  "data-slot": "dropdown-menu-group",
579
621
  ...e
580
622
  });
581
623
  }
582
- function Z({ className: e, inset: t, variant: n = "default", ...r }) {
583
- return /* @__PURE__ */ P(V.Item, {
624
+ function Y({ className: e, inset: t, variant: n = "default", ...r }) {
625
+ return /* @__PURE__ */ P(B.Item, {
584
626
  "data-slot": "dropdown-menu-item",
585
627
  "data-inset": t,
586
628
  "data-variant": n,
587
- className: d("data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0", e),
629
+ className: E("data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0", e),
588
630
  ...r
589
631
  });
590
632
  }
591
- function Vt({ className: e, inset: t, ...n }) {
592
- return /* @__PURE__ */ P(V.Label, {
633
+ function en({ className: e, inset: t, ...n }) {
634
+ return /* @__PURE__ */ P(B.Label, {
593
635
  "data-slot": "dropdown-menu-label",
594
636
  "data-inset": t,
595
- className: d("px-1.5 py-1 font-medium text-muted-foreground text-xs data-[inset]:pl-7", e),
637
+ className: E("px-1.5 py-1 font-medium text-muted-foreground text-xs data-[inset]:pl-7", e),
596
638
  ...n
597
639
  });
598
640
  }
599
- function Ht({ className: e, ...t }) {
600
- return /* @__PURE__ */ P(V.Separator, {
641
+ function tn({ className: e, ...t }) {
642
+ return /* @__PURE__ */ P(B.Separator, {
601
643
  "data-slot": "dropdown-menu-separator",
602
- className: d("-mx-1 my-1 h-px bg-border", e),
644
+ className: E("-mx-1 my-1 h-px bg-border", e),
603
645
  ...t
604
646
  });
605
647
  }
606
648
  //#endregion
607
649
  //#region src/editor/features/TreegeEditor/nodes/components/NodeMoreMenu.tsx
608
- var Ut = ({ nodeId: e, className: t }) => {
609
- let { selectNode: n } = q(), { setIsNodeSheetOpen: r, openDeleteNodeConfirmation: i } = W(), a = G(), o = (e) => e.stopPropagation();
610
- return /* @__PURE__ */ F(J, {
650
+ var nn = ({ nodeId: e, className: t }) => {
651
+ let { selectNode: n } = W(), { setIsNodeSheetOpen: r, openDeleteNodeConfirmation: i } = H(), a = U(), o = (e) => e.stopPropagation();
652
+ return /* @__PURE__ */ F(G, {
611
653
  modal: !1,
612
- children: [/* @__PURE__ */ P(Y, {
654
+ children: [/* @__PURE__ */ P(K, {
613
655
  asChild: !0,
614
656
  onClick: o,
615
657
  children: /* @__PURE__ */ P("button", {
616
658
  type: "button",
617
659
  "aria-label": a("editor.nodeActionsSheet.editNode"),
618
- className: d("nodrag nopan absolute top-2 right-2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-md opacity-60 transition-all hover:text-[--treege-color-primary] hover:opacity-100", t),
619
- children: /* @__PURE__ */ P($e, { className: "h-3.5 w-3.5" })
660
+ className: E("nodrag nopan absolute top-2 right-2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-md opacity-60 transition-all hover:text-[--treege-color-primary] hover:opacity-100", t),
661
+ children: /* @__PURE__ */ P(ct, { className: "h-3.5 w-3.5" })
620
662
  })
621
- }), /* @__PURE__ */ F(X, {
663
+ }), /* @__PURE__ */ F(q, {
622
664
  align: "end",
623
665
  onClick: o,
624
666
  children: [
625
- /* @__PURE__ */ F(Z, {
667
+ /* @__PURE__ */ F(Y, {
626
668
  onSelect: () => {
627
669
  n(e), r(!0);
628
670
  },
629
- children: [/* @__PURE__ */ P(ot, {}), a("common.settings")]
671
+ children: [/* @__PURE__ */ P(gt, {}), a("common.settings")]
630
672
  }),
631
- /* @__PURE__ */ P(Ht, {}),
632
- /* @__PURE__ */ F(Z, {
673
+ /* @__PURE__ */ P(tn, {}),
674
+ /* @__PURE__ */ F(Y, {
633
675
  variant: "destructive",
634
676
  onSelect: () => {
635
677
  i(e);
636
678
  },
637
- children: [/* @__PURE__ */ P(ct, {}), a("common.delete")]
679
+ children: [/* @__PURE__ */ P(vt, {}), a("common.delete")]
638
680
  })
639
681
  ]
640
682
  })]
641
683
  });
642
- }, Wt = St("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3", {
684
+ }, rn = Mt("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3", {
643
685
  defaultVariants: { variant: "default" },
644
686
  variants: { variant: {
645
687
  blue: "bg-blue-500 text-white dark:bg-blue-600",
@@ -650,52 +692,48 @@ var Ut = ({ nodeId: e, className: t }) => {
650
692
  secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90"
651
693
  } }
652
694
  });
653
- function Gt({ className: e, variant: t, asChild: n = !1, ...r }) {
654
- return /* @__PURE__ */ P(n ? xt : "span", {
695
+ function an({ className: e, variant: t, asChild: n = !1, ...r }) {
696
+ return /* @__PURE__ */ P(n ? jt : "span", {
655
697
  "data-slot": "badge",
656
- className: d(Wt({ variant: t }), e),
698
+ className: E(rn({ variant: t }), e),
657
699
  ...r
658
700
  });
659
701
  }
660
- var Kt = ht(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
661
- /* @__PURE__ */ P(ge, {}),
702
+ var on = Tt(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
703
+ /* @__PURE__ */ P(Ce, {}),
662
704
  /* @__PURE__ */ P("div", {
663
705
  className: "-top-3.5 absolute left-6",
664
- children: /* @__PURE__ */ F(Gt, {
706
+ children: /* @__PURE__ */ F(an, {
665
707
  className: "max-w-50 bg-chart-2",
666
- children: [/* @__PURE__ */ P(ke, { className: "!w-3 !h-3" }), /* @__PURE__ */ P(zt, {
708
+ children: [/* @__PURE__ */ P(Le, { className: "!w-3 !h-3" }), /* @__PURE__ */ P($t, {
667
709
  nodeId: t,
668
710
  label: e?.label,
669
711
  className: "min-w-0 flex-1 text-xs text-white placeholder:text-white/60"
670
712
  })]
671
713
  })
672
714
  }),
673
- /* @__PURE__ */ P(Ut, { nodeId: t })
674
- ] })), qt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", Jt = (e = 21) => {
675
- let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
676
- for (; e--;) t += qt[n[e] & 63];
677
- return t;
678
- }, Yt = {
715
+ /* @__PURE__ */ P(nn, { nodeId: t })
716
+ ] })), sn = {
679
717
  data: { type: "text" },
680
- id: Jt(),
718
+ id: Zt(),
681
719
  position: {
682
720
  x: 0,
683
721
  y: 0
684
722
  },
685
723
  type: "input"
686
- }, Xt = () => {
687
- let { setNodes: e, setEdges: t, screenToFlowPosition: n, getNode: r, getNodes: i, getEdges: a } = M(), o = z((n, r, i = !1, o) => {
688
- let c = n.id, l = a().filter((e) => e.source === c), u = s(n);
724
+ }, cn = () => {
725
+ let { setNodes: e, setEdges: t, screenToFlowPosition: n, getNode: i, getNodes: a, getEdges: o } = M(), s = R((n, i, a = !1, s) => {
726
+ let c = n.id, l = o().filter((e) => e.source === c), u = r(n);
689
727
  if (l.length > 0 && !u) return;
690
- let d = Jt(), f = {
691
- ...Yt,
692
- ...o && {
693
- data: o.data ?? {},
694
- type: o.type
728
+ let d = Zt(), f = {
729
+ ...sn,
730
+ ...s && {
731
+ data: s.data ?? {},
732
+ type: s.type
695
733
  },
696
734
  id: d,
697
- position: r,
698
- selected: i
735
+ position: i,
736
+ selected: a
699
737
  };
700
738
  n?.parentId && (f.parentId = n.parentId, f.extent = "parent"), e((e) => e.concat(f)), t((e) => {
701
739
  let t = e.filter((e) => e.source === c).length > 0, n = {
@@ -704,7 +742,7 @@ var Kt = ht(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
704
742
  operator: "===",
705
743
  value: ""
706
744
  }] } : void 0,
707
- id: Jt(),
745
+ id: Zt(),
708
746
  source: c,
709
747
  target: d,
710
748
  type: t && u ? "conditional" : "default"
@@ -721,26 +759,28 @@ var Kt = ht(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
721
759
  },
722
760
  type: "conditional"
723
761
  } : e).concat(n) : e.concat(n);
724
- }), i && (e((e) => e.map((e) => ({
725
- ...e,
726
- selected: e.id === d
727
- }))), t((e) => e.map((e) => ({
728
- ...e,
729
- selected: !1
730
- }))));
762
+ }), a && requestAnimationFrame(() => {
763
+ e((e) => e.map((e) => ({
764
+ ...e,
765
+ selected: e.id === d
766
+ }))), t((e) => e.map((e) => ({
767
+ ...e,
768
+ selected: !1
769
+ })));
770
+ });
731
771
  }, [
732
- a,
772
+ o,
733
773
  e,
734
774
  t
735
- ]), c = z((e) => {
775
+ ]), c = R((e) => {
736
776
  t((t) => {
737
- let n = xe(e, t), i = e.source, a = r(i);
738
- return n.filter((e) => e.source === i).length > 1 && a && s(a) ? n.map((e) => e.source === i ? {
777
+ let n = Oe(e, t), a = e.source, o = i(a);
778
+ return n.filter((e) => e.source === a).length > 1 && o && r(o) ? n.map((e) => e.source === a ? {
739
779
  ...e,
740
780
  data: {
741
781
  ...e.data,
742
782
  conditions: e.data?.conditions || [{
743
- field: i,
783
+ field: a,
744
784
  operator: "===",
745
785
  value: ""
746
786
  }]
@@ -748,269 +788,357 @@ var Kt = ht(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
748
788
  type: "conditional"
749
789
  } : e) : n;
750
790
  });
751
- }, [t, r]), l = z((e, t) => {
752
- let n = r(e);
791
+ }, [t, i]), l = R((e, t) => {
792
+ let n = i(e);
753
793
  if (!n) return;
754
- let s = getComputedStyle(document.documentElement).getPropertyValue("--node-height"), c = getComputedStyle(document.documentElement).getPropertyValue("--node-width"), l = parseFloat(s) || 100, u = parseFloat(c) || 100, d = n.position.y + l + 100, f = i(), p = a(), m = f.filter((t) => p.some((n) => n.source === e && n.target === t.id)).map((e) => e.position.x);
755
- o(n, {
794
+ 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);
795
+ s(n, {
756
796
  x: m.length === 0 ? n.position.x : m.length % 2 == 1 ? Math.max(...m) + u + 50 : Math.min(...m) - u - 50,
757
797
  y: d
758
798
  }, !0, t);
759
799
  }, [
760
- r,
761
800
  i,
762
801
  a,
763
- o
764
- ]), u = z((e, t) => {
802
+ o,
803
+ s
804
+ ]), u = R((e, t) => {
765
805
  if (!t.isValid) {
766
- let { clientX: i, clientY: a } = "changedTouches" in e ? e.changedTouches[0] : e, s = t.fromNode;
767
- if (!s) return;
806
+ let { clientX: r, clientY: a } = "changedTouches" in e ? e.changedTouches[0] : e, o = t.fromNode;
807
+ if (!o) return;
768
808
  let c = n({
769
- x: i,
809
+ x: r,
770
810
  y: a
771
- }), l = s.parentId ? r(s.parentId) : void 0, u = l?.position ?? {
811
+ }), l = o.parentId ? i(o.parentId) : void 0, u = l?.position ?? {
772
812
  x: 0,
773
813
  y: 0
774
814
  };
775
- o(s, l ? {
815
+ s(o, l ? {
776
816
  x: c.x - u.x,
777
817
  y: c.y - u.y
778
- } : c);
818
+ } : c, !0);
779
819
  }
780
820
  }, [
781
- o,
782
- r,
821
+ s,
822
+ i,
783
823
  n
784
- ]), d = z((e) => {
785
- t((t) => {
786
- let n = t.filter((t) => !e.find((e) => e.id === t.id)), r = new Set(e.map((e) => e.source)), i = /* @__PURE__ */ new Map();
787
- return n.forEach((e) => {
788
- i.set(e.source, (i.get(e.source) ?? 0) + 1);
789
- }), n.map((e) => {
790
- if (r.has(e.source) && (i.get(e.source) ?? 0) === 1) {
791
- let { conditions: t, isFallback: n, ...r } = e.data ?? {}, i = r && Object.keys(r).length > 0 ? r : void 0;
792
- return {
793
- ...e,
794
- data: i,
795
- type: "default"
796
- };
797
- }
798
- return e;
799
- });
800
- });
824
+ ]), d = R((e) => {
825
+ t((t) => Qt(t.filter((t) => !e.find((e) => e.id === t.id)), new Set(e.map((e) => e.source))));
801
826
  }, [t]);
802
827
  return {
803
- isValidConnection: z((e) => {
828
+ isValidConnection: R((e) => {
804
829
  if (e.source === e.target) return !1;
805
- let t = r(e.source);
806
- return t ? !(a().filter((t) => t.source === e.source).length > 0 && !s(t)) : !1;
807
- }, [r, a]),
830
+ let t = i(e.source);
831
+ return t ? !(o().filter((t) => t.source === e.source).length > 0 && !r(t)) : !1;
832
+ }, [i, o]),
808
833
  onAddFromHandle: l,
809
834
  onConnect: c,
810
835
  onConnectEnd: u,
811
836
  onEdgesDelete: d
812
837
  };
813
- }, Zt = {
838
+ }, X = {
839
+ address: "address",
840
+ autocomplete: "autocomplete",
841
+ checkbox: "checkbox",
842
+ date: "date",
843
+ daterange: "daterange",
844
+ file: "file",
845
+ hidden: "hidden",
846
+ http: "http",
847
+ number: "number",
848
+ password: "password",
849
+ radio: "radio",
850
+ select: "select",
851
+ submit: "submit",
852
+ switch: "switch",
853
+ text: "text",
854
+ textarea: "textarea",
855
+ time: "time",
856
+ timerange: "timerange"
857
+ }, ln = {
814
858
  divider: "divider",
815
859
  title: "title"
816
- }, Qt = ({ nodeId: e, isConnectable: t }) => {
817
- let { onAddFromHandle: n } = Xt(), r = G(), [i, o] = B(!1);
818
- return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(me, {
860
+ }, un = {
861
+ [X.address]: ot,
862
+ [X.autocomplete]: mt,
863
+ [X.checkbox]: He,
864
+ [X.date]: Re,
865
+ [X.daterange]: ze,
866
+ [X.file]: ut,
867
+ [X.hidden]: Qe,
868
+ [X.http]: Je,
869
+ [X.number]: $e,
870
+ [X.password]: nt,
871
+ [X.radio]: Ge,
872
+ [X.select]: it,
873
+ [X.submit]: ht,
874
+ [X.switch]: _t,
875
+ [X.text]: Be,
876
+ [X.textarea]: Fe,
877
+ [X.time]: Ke,
878
+ [X.timerange]: qe,
879
+ [ln.divider]: st,
880
+ [ln.title]: et,
881
+ [l.flow]: lt
882
+ }, dn = ft, Z = (e) => e && un[e] || dn, fn = ({ nodeId: e, isConnectable: t }) => {
883
+ let { onAddFromHandle: n } = cn(), r = U(), [i, a] = z(!1), o = Z(l.flow);
884
+ return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(xe, {
819
885
  type: "source",
820
- position: ve.Bottom,
886
+ position: Te.Bottom,
821
887
  isConnectable: t,
822
888
  onClick: (e) => {
823
- e.defaultPrevented || o(!0);
889
+ e.defaultPrevented || a(!0);
824
890
  },
825
891
  className: "flex h-6! w-6! cursor-pointer items-center justify-center rounded-sm transition-colors hover:bg-primary/80!",
826
- children: /* @__PURE__ */ P(L, { className: "h-4 w-4 text-primary-foreground" })
827
- }), /* @__PURE__ */ F(J, {
892
+ children: /* @__PURE__ */ P(I, { className: "h-4 w-4 text-primary-foreground" })
893
+ }), /* @__PURE__ */ F(G, {
828
894
  open: i,
829
- onOpenChange: o,
830
- children: [/* @__PURE__ */ P(Y, {
895
+ onOpenChange: a,
896
+ children: [/* @__PURE__ */ P(K, {
831
897
  asChild: !0,
832
898
  children: /* @__PURE__ */ P("span", {
833
899
  "aria-hidden": !0,
834
900
  className: "-translate-x-1/2 pointer-events-none absolute bottom-0 left-1/2 h-0 w-0"
835
901
  })
836
- }), /* @__PURE__ */ F(X, {
902
+ }), /* @__PURE__ */ F(q, {
837
903
  align: "center",
838
904
  side: "bottom",
839
905
  className: "treege-scrollbar max-h-80",
840
906
  children: [
841
- /* @__PURE__ */ F(Bt, { children: [/* @__PURE__ */ P(Vt, { children: r("editor.selectNodeType.options.input") }), Object.values(K).map((t) => /* @__PURE__ */ P(Z, {
907
+ /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(en, { children: r("editor.selectNodeType.options.input") }), Object.values(X).map((t) => /* @__PURE__ */ F(Y, {
842
908
  onClick: () => n(e, {
843
909
  data: { type: t },
844
- type: a.input
910
+ type: l.input
845
911
  }),
846
912
  className: "capitalize",
847
- children: t
913
+ children: [/* @__PURE__ */ P(Z(t), {}), t]
848
914
  }, t))] }),
849
- /* @__PURE__ */ P(Ht, {}),
850
- /* @__PURE__ */ F(Bt, { children: [/* @__PURE__ */ P(Vt, { children: r("editor.selectNodeType.options.ui") }), Object.values(Zt).map((t) => /* @__PURE__ */ P(Z, {
915
+ /* @__PURE__ */ P(tn, {}),
916
+ /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(en, { children: r("editor.selectNodeType.options.ui") }), Object.values(ln).map((t) => /* @__PURE__ */ F(Y, {
851
917
  onClick: () => n(e, {
852
918
  data: { type: t },
853
- type: a.ui
919
+ type: l.ui
854
920
  }),
855
921
  className: "capitalize",
856
- children: t
922
+ children: [/* @__PURE__ */ P(Z(t), {}), t]
857
923
  }, t))] }),
858
- /* @__PURE__ */ P(Ht, {}),
859
- /* @__PURE__ */ F(Bt, { children: [/* @__PURE__ */ P(Vt, { children: r("common.other") }), /* @__PURE__ */ P(Z, {
924
+ /* @__PURE__ */ P(tn, {}),
925
+ /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(en, { children: r("common.other") }), /* @__PURE__ */ F(Y, {
860
926
  onClick: () => n(e, {
861
927
  data: {},
862
- type: a.flow
928
+ type: l.flow
863
929
  }),
864
- children: r("editor.selectNodeType.options.flow")
930
+ children: [/* @__PURE__ */ P(o, {}), r("editor.selectNodeType.options.flow")]
865
931
  })] })
866
932
  ]
867
933
  })]
868
934
  })] });
869
- }, $t = {
870
- [K.address]: Ze,
871
- [K.autocomplete]: it,
872
- [K.checkbox]: Pe,
873
- [K.date]: Ae,
874
- [K.daterange]: je,
875
- [K.file]: et,
876
- [K.hidden]: Ue,
877
- [K.http]: ze,
878
- [K.number]: We,
879
- [K.password]: qe,
880
- [K.radio]: Le,
881
- [K.select]: Ye,
882
- [K.submit]: at,
883
- [K.switch]: st,
884
- [K.text]: Me,
885
- [K.textarea]: De,
886
- [K.time]: Re,
887
- [K.timerange]: Re,
888
- [Zt.divider]: Qe,
889
- [Zt.title]: Ge
890
- }, en = nt, tn = (e) => e && $t[e] || en, nn = {
891
- input: Object.values(K),
892
- ui: Object.values(Zt)
893
- }, rn = ({ nodeId: e, type: t, inputType: n }) => {
894
- let { updateNodeData: r } = q(), i = G(), a = nn[t], o = (e) => e.stopPropagation();
895
- return /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(Y, {
935
+ }, pn = (e) => {
936
+ switch (e) {
937
+ case "number":
938
+ case "daterange":
939
+ case "timerange":
940
+ case "file": return null;
941
+ case "switch": return !1;
942
+ case "checkbox": return [];
943
+ default: return "";
944
+ }
945
+ }, mn = ({ nodeId: e, data: n }) => {
946
+ let { language: r } = H(), i = n?.type;
947
+ if (!i) return null;
948
+ let o = {
949
+ data: n,
950
+ id: e,
951
+ position: {
952
+ x: 0,
953
+ y: 0
954
+ },
955
+ type: "input"
956
+ }, c = a(n.label, r), l = t(o), u = /* @__PURE__ */ F("div", {
957
+ className: "flex items-center gap-1 text-[10px] text-muted-foreground capitalize [&>svg]:size-3",
958
+ children: [/* @__PURE__ */ P(Z(i), {}), i]
959
+ });
960
+ if (i === "hidden") {
961
+ 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}` : "");
962
+ return /* @__PURE__ */ F("div", {
963
+ className: "pointer-events-none flex select-none flex-col gap-1 text-sm",
964
+ children: [
965
+ u,
966
+ /* @__PURE__ */ P("span", {
967
+ className: "truncate font-medium",
968
+ children: c || l
969
+ }),
970
+ /* @__PURE__ */ P("span", {
971
+ className: "truncate text-muted-foreground text-xs",
972
+ children: r || "—"
973
+ })
974
+ ]
975
+ });
976
+ }
977
+ let d = pe[i];
978
+ if (!d) return null;
979
+ let f = a(n.helperText, r), p = s(n, r);
980
+ return /* @__PURE__ */ F("div", {
981
+ className: E("pointer-events-none flex select-none flex-col gap-1", i === "submit" && "items-center"),
982
+ children: [u, /* @__PURE__ */ P(d, {
983
+ node: o,
984
+ value: pn(i),
985
+ setValue: () => {},
986
+ id: e,
987
+ name: l,
988
+ label: c || void 0,
989
+ placeholder: p || void 0,
990
+ helperText: f || void 0
991
+ })]
992
+ });
993
+ }, hn = Object.values(X), gn = Object.values(ln), _n = ({ nodeId: e, nodeType: t, subType: n }) => {
994
+ let { updateNodeType: r } = W(), { getEdges: i } = M(), { openNodeTypeChangeConfirmation: a } = H(), o = U(), 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) => {
995
+ let o = i().filter((t) => t.source === e).length;
996
+ if ((t === l.ui || t === l.flow) && o > 1) {
997
+ a({
998
+ nodeId: e,
999
+ subType: n,
1000
+ type: t
1001
+ });
1002
+ return;
1003
+ }
1004
+ r(e, t, n);
1005
+ };
1006
+ return /* @__PURE__ */ F(G, { children: [/* @__PURE__ */ P(K, {
896
1007
  asChild: !0,
897
- onClick: o,
898
- children: /* @__PURE__ */ F(Gt, {
1008
+ onClick: s,
1009
+ children: /* @__PURE__ */ F(an, {
899
1010
  variant: "default",
900
1011
  className: "nodrag nopan cursor-pointer px-1.5 py-0 text-[10px] capitalize [&>svg]:size-2.5",
901
1012
  children: [
902
- /* @__PURE__ */ P(tn(n), { className: "mt-0.5" }),
903
- n || i("editor.selectInputType.type"),
904
- /* @__PURE__ */ P(Fe, {})
1013
+ /* @__PURE__ */ P(d, { className: "mt-0.5" }),
1014
+ u || o("editor.selectNodeType.nodeType"),
1015
+ /* @__PURE__ */ P(Ue, {})
905
1016
  ]
906
1017
  })
907
- }), /* @__PURE__ */ P(X, {
1018
+ }), /* @__PURE__ */ F(q, {
908
1019
  align: "start",
909
- className: "treege-scrollbar max-h-60",
910
- onClick: o,
911
- children: a.map((t) => {
912
- let i = tn(t);
913
- return /* @__PURE__ */ F(Z, {
914
- onClick: () => r(e, { type: t }),
915
- className: d("capitalize", t === n && "bg-accent"),
916
- children: [/* @__PURE__ */ P(i, {}), t]
917
- }, t);
918
- })
1020
+ className: "treege-scrollbar max-h-80",
1021
+ onClick: s,
1022
+ children: [
1023
+ /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(en, { children: o("editor.selectNodeType.options.input") }), hn.map((e) => {
1024
+ let r = Z(e);
1025
+ return /* @__PURE__ */ F(Y, {
1026
+ onClick: () => p(l.input, e),
1027
+ className: E("capitalize", t === l.input && e === n && "bg-accent"),
1028
+ children: [/* @__PURE__ */ P(r, {}), e]
1029
+ }, e);
1030
+ })] }),
1031
+ /* @__PURE__ */ P(tn, {}),
1032
+ /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(en, { children: o("editor.selectNodeType.options.ui") }), gn.map((e) => {
1033
+ let r = Z(e);
1034
+ return /* @__PURE__ */ F(Y, {
1035
+ onClick: () => p(l.ui, e),
1036
+ className: E("capitalize", t === l.ui && e === n && "bg-accent"),
1037
+ children: [/* @__PURE__ */ P(r, {}), e]
1038
+ }, e);
1039
+ })] }),
1040
+ /* @__PURE__ */ P(tn, {}),
1041
+ /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(en, { children: o("common.other") }), /* @__PURE__ */ F(Y, {
1042
+ onClick: () => p(l.flow),
1043
+ className: E(t === l.flow && "bg-accent"),
1044
+ children: [/* @__PURE__ */ P(f, {}), o("editor.selectNodeType.options.flow")]
1045
+ })] })
1046
+ ]
919
1047
  })] });
920
- }, an = [
1048
+ }, vn = [
921
1049
  "radio",
922
1050
  "select",
923
1051
  "checkbox",
924
1052
  "autocomplete"
925
- ], on = ({ nodeId: e, data: t }) => {
926
- let [n, r] = B(!1), [i, a] = B(""), [o, s] = B(""), { updateNodeData: c } = q(), { language: d } = W(), f = G(), h = t && "type" in t ? t.type : void 0;
927
- if (!(h && an.includes(h))) return null;
928
- let g = t.options ?? [], _ = () => {
1053
+ ], yn = ({ nodeId: e, data: t }) => {
1054
+ let [n, r] = z(!1), [i, a] = z(""), [o, s] = z(""), { updateNodeData: c } = W(), { language: l } = H(), u = U(), f = t && "type" in t ? t.type : void 0;
1055
+ if (!(f && vn.includes(f))) return null;
1056
+ let p = t.options ?? [], m = () => {
929
1057
  a(""), s("");
930
- }, v = (t) => {
1058
+ }, h = (t) => {
931
1059
  t?.preventDefault();
932
1060
  let n = i.trim(), a = o.trim() || n;
933
1061
  if (!(n || a)) return;
934
1062
  let s = {
935
- label: { [d]: n },
1063
+ label: { [l]: n },
936
1064
  value: a
937
1065
  };
938
- c(e, { options: [...g, s] }), _(), r(!1);
939
- }, y = (e) => {
940
- r(e), e || _();
941
- }, b = (e) => {
942
- e.key === "Enter" && (e.preventDefault(), v());
943
- }, x = (e) => e.stopPropagation();
1066
+ c(e, { options: [...p, s] }), m(), r(!1);
1067
+ }, g = (e) => {
1068
+ r(e), e || m();
1069
+ }, _ = (e) => {
1070
+ e.key === "Enter" && (e.preventDefault(), h());
1071
+ }, v = (e) => e.stopPropagation();
944
1072
  return /* @__PURE__ */ F("div", {
945
1073
  className: "nodrag nopan my-1 flex flex-col gap-0.5",
946
- children: [g.map((e, t) => {
947
- let n = f(e.label) || e.value || "—", r = `${e.value || "opt"}-${t}`;
1074
+ children: [p.map((e, t) => {
1075
+ let n = u(e.label) || e.value || "—", r = `${e.value || "opt"}-${t}`;
948
1076
  return /* @__PURE__ */ P("div", {
949
1077
  className: "truncate text-muted-foreground text-xs",
950
1078
  children: n
951
1079
  }, r);
952
- }), /* @__PURE__ */ F(se, {
1080
+ }), /* @__PURE__ */ F(ie, {
953
1081
  open: n,
954
- onOpenChange: y,
955
- children: [/* @__PURE__ */ P(u, {
1082
+ onOpenChange: g,
1083
+ children: [/* @__PURE__ */ P(ne, {
956
1084
  asChild: !0,
957
- onClick: x,
958
- children: /* @__PURE__ */ F(p, {
1085
+ onClick: v,
1086
+ children: /* @__PURE__ */ F(k, {
959
1087
  type: "button",
960
1088
  variant: "link",
961
1089
  size: "xs",
962
1090
  className: "w-fit p-0! focus-visible:border-transparent! focus-visible:ring-0!",
963
- children: [/* @__PURE__ */ P(L, { className: "size-3" }), f("editor.inputNodeForm.addOption")]
1091
+ children: [/* @__PURE__ */ P(I, { className: "size-3" }), u("editor.inputNodeForm.addOption")]
964
1092
  })
965
- }), /* @__PURE__ */ P(ee, {
1093
+ }), /* @__PURE__ */ P(ae, {
966
1094
  align: "start",
967
1095
  className: "w-64 p-3",
968
- onClick: x,
1096
+ onClick: v,
969
1097
  children: /* @__PURE__ */ F("form", {
970
- onSubmit: v,
1098
+ onSubmit: h,
971
1099
  className: "flex flex-col gap-2",
972
1100
  children: [
973
1101
  /* @__PURE__ */ F("div", {
974
1102
  className: "flex flex-col gap-1",
975
- children: [/* @__PURE__ */ P(l, {
1103
+ children: [/* @__PURE__ */ P(d, {
976
1104
  htmlFor: `${e}-option-label`,
977
1105
  className: "text-xs",
978
- children: f("editor.inputNodeForm.optionLabel")
979
- }), /* @__PURE__ */ P(m, {
1106
+ children: u("editor.inputNodeForm.optionLabel")
1107
+ }), /* @__PURE__ */ P(O, {
980
1108
  id: `${e}-option-label`,
981
1109
  autoFocus: !0,
982
1110
  value: i,
983
1111
  onChange: (e) => a(e.target.value),
984
- onKeyDown: b
1112
+ onKeyDown: _
985
1113
  })]
986
1114
  }),
987
1115
  /* @__PURE__ */ F("div", {
988
1116
  className: "flex flex-col gap-1",
989
- children: [/* @__PURE__ */ P(l, {
1117
+ children: [/* @__PURE__ */ P(d, {
990
1118
  htmlFor: `${e}-option-value`,
991
1119
  className: "text-xs",
992
- children: f("editor.inputNodeForm.optionValue")
993
- }), /* @__PURE__ */ P(m, {
1120
+ children: u("editor.inputNodeForm.optionValue")
1121
+ }), /* @__PURE__ */ P(O, {
994
1122
  id: `${e}-option-value`,
995
1123
  value: o,
996
1124
  onChange: (e) => s(e.target.value),
997
- onKeyDown: b
1125
+ onKeyDown: _
998
1126
  })]
999
1127
  }),
1000
- /* @__PURE__ */ P(p, {
1128
+ /* @__PURE__ */ P(k, {
1001
1129
  type: "submit",
1002
1130
  size: "sm",
1003
1131
  disabled: !(i.trim() || o.trim()),
1004
- children: f("common.create")
1132
+ children: u("common.create")
1005
1133
  })
1006
1134
  ]
1007
1135
  })
1008
1136
  })]
1009
1137
  })]
1010
1138
  });
1011
- }, sn = ({ nodeId: e, required: t }) => {
1012
- let { updateNodeData: n } = q(), r = G();
1013
- return /* @__PURE__ */ P(Gt, {
1139
+ }, bn = ({ nodeId: e, required: t }) => {
1140
+ let { updateNodeData: n } = W(), r = U();
1141
+ return /* @__PURE__ */ P(an, {
1014
1142
  variant: t ? "destructive" : "outline",
1015
1143
  asChild: !0,
1016
1144
  className: "nodrag nopan cursor-pointer px-1.5 py-0 text-[10px] capitalize [&>svg]:size-2.5",
@@ -1022,68 +1150,172 @@ var Kt = ht(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
1022
1150
  children: r(t ? "editor.inputNodeForm.required" : "editor.inputNodeForm.optional")
1023
1151
  })
1024
1152
  });
1025
- }, cn = ({ children: e, inGroup: t, isSubmit: n }) => /* @__PURE__ */ P("div", {
1026
- className: d("react-flow__node__wrapper relative", t && "in-group", n && "submit-type"),
1153
+ }, xn = ({ children: e, inGroup: t, isSubmit: n }) => /* @__PURE__ */ P("div", {
1154
+ className: E("react-flow__node__wrapper relative", t && "in-group", n && "submit-type"),
1027
1155
  children: e
1028
- }), ln = ht(({ data: e, isConnectable: t, parentId: n, type: r, id: i }) => {
1029
- let a = r === "input" || r === "ui" ? e?.type : void 0, o = r === "input" && e?.type === "submit", s = r === "input" ? e?.name : void 0;
1030
- return /* @__PURE__ */ F(cn, {
1031
- inGroup: !!n,
1032
- isSubmit: o,
1156
+ }), Sn = Tt((e) => {
1157
+ 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;
1158
+ return /* @__PURE__ */ F(xn, {
1159
+ inGroup: !!r,
1160
+ isSubmit: l,
1033
1161
  children: [
1034
- /* @__PURE__ */ P(Ut, { nodeId: i }),
1035
- /* @__PURE__ */ P(me, {
1162
+ /* @__PURE__ */ P(nn, { nodeId: t }),
1163
+ /* @__PURE__ */ P(xe, {
1036
1164
  type: "target",
1037
- position: ve.Top,
1038
- isConnectable: t,
1039
- isConnectableStart: r === "ui"
1040
- }),
1041
- /* @__PURE__ */ P(zt, {
1042
- nodeId: i,
1043
- label: e?.label,
1044
- placeholder: s,
1045
- className: d("py-1", r === "ui" && "capitalize")
1165
+ position: Te.Top,
1166
+ isConnectable: n,
1167
+ isConnectableStart: a === "ui"
1046
1168
  }),
1047
- /* @__PURE__ */ F("div", {
1048
- className: "mb-1 flex gap-1",
1049
- children: [(r === "input" || r === "ui") && /* @__PURE__ */ P(rn, {
1050
- nodeId: i,
1051
- type: r,
1052
- inputType: a
1053
- }), r === "input" && !o && /* @__PURE__ */ P(sn, {
1054
- nodeId: i,
1055
- required: e?.required
1056
- })]
1057
- }),
1058
- r === "input" && /* @__PURE__ */ P(on, {
1059
- nodeId: i,
1060
- data: e
1061
- }),
1062
- /* @__PURE__ */ P(Qt, {
1063
- nodeId: i,
1064
- isConnectable: t
1169
+ u && o ? /* @__PURE__ */ P(mn, {
1170
+ nodeId: t,
1171
+ data: o
1172
+ }) : /* @__PURE__ */ F(N, { children: [
1173
+ /* @__PURE__ */ P($t, {
1174
+ nodeId: t,
1175
+ label: e.data?.label,
1176
+ placeholder: o?.name,
1177
+ className: E("py-1", a === "ui" && "capitalize")
1178
+ }),
1179
+ /* @__PURE__ */ F("div", {
1180
+ className: "mb-1 flex gap-1",
1181
+ children: [/* @__PURE__ */ P(_n, {
1182
+ nodeId: t,
1183
+ nodeType: a,
1184
+ subType: c
1185
+ }), o && !l && /* @__PURE__ */ P(bn, {
1186
+ nodeId: t,
1187
+ required: o.required
1188
+ })]
1189
+ }),
1190
+ o && /* @__PURE__ */ P(yn, {
1191
+ nodeId: t,
1192
+ data: o
1193
+ })
1194
+ ] }),
1195
+ /* @__PURE__ */ P(fn, {
1196
+ nodeId: t,
1197
+ isConnectable: n
1065
1198
  })
1066
1199
  ]
1067
1200
  });
1068
- }), un = {
1069
- [a.flow]: ln,
1070
- [a.group]: Kt,
1071
- [a.input]: ln,
1072
- [a.ui]: ln
1073
- }, dn = () => {
1074
- let { pendingDeleteNodeId: e, closeDeleteNodeConfirmation: t } = W(), { deleteNode: n } = q(), r = G();
1075
- return /* @__PURE__ */ P(k, {
1201
+ }), Cn = {
1202
+ [l.flow]: Sn,
1203
+ [l.group]: on,
1204
+ [l.input]: Sn,
1205
+ [l.ui]: Sn
1206
+ }, wn = {
1207
+ "!==": "≠",
1208
+ "<": "<",
1209
+ "<=": "≤",
1210
+ "===": "=",
1211
+ ">": ">",
1212
+ ">=": "≥"
1213
+ }, Tn = (e, t) => {
1214
+ let n = e?.filter((e) => e.value !== void 0 && e.value !== "") ?? [];
1215
+ return n.length === 0 ? "" : n.map((e, n) => {
1216
+ let r = wn[e.operator ?? ""] ?? e.operator ?? "", i = `${e.field ? t(e.field) : ""} ${r} ${e.value ?? ""}`.trim();
1217
+ return `${n === 0 ? "" : ` ${e.logicalOperator ?? "AND"} `}${i}`;
1218
+ }).join("");
1219
+ }, En = () => {
1220
+ let { pendingNodeTypeChange: e, closeNodeTypeChangeConfirmation: t } = H(), { getEdges: n, getNode: r, setEdges: i, updateEdgeData: a } = M(), { updateNodeType: o } = W(), s = U(), c = kt(() => e ? n().filter((t) => t.source === e.nodeId).sort((e, t) => {
1221
+ let n = r(e.target)?.position ?? {
1222
+ x: 0,
1223
+ y: 0
1224
+ }, i = r(t.target)?.position ?? {
1225
+ x: 0,
1226
+ y: 0
1227
+ };
1228
+ return n.x - i.x || n.y - i.y;
1229
+ }) : [], [
1230
+ e,
1231
+ n,
1232
+ r
1233
+ ]), [l, u] = z("");
1234
+ Dt(() => {
1235
+ c.length > 0 && u(c[0].id);
1236
+ }, [c]);
1237
+ let f = (e) => {
1238
+ e || t();
1239
+ }, h = () => {
1240
+ if (!(e && l)) {
1241
+ t();
1242
+ return;
1243
+ }
1244
+ let { nodeId: n, type: r, subType: s } = e;
1245
+ i((e) => e.filter((e) => e.source !== n || e.id === l)), a(l, {
1246
+ conditions: void 0,
1247
+ configured: void 0,
1248
+ isFallback: void 0
1249
+ }), o(n, r, s), t();
1250
+ }, g = (e) => {
1251
+ let t = r(e)?.data;
1252
+ return s(t && "label" in t ? t.label : void 0) || t?.name || (e.length > 5 ? `${e.slice(0, 5)}…` : e);
1253
+ }, v = (e) => {
1254
+ let t = r(e)?.data, n = s(t?.label) || t?.name || e;
1255
+ return n === e && n.length > 5 ? `${n.slice(0, 5)}…` : n;
1256
+ }, y = (e) => e?.isFallback ? s("editor.conditionalEdge.fallback") : e?.label ? e.label : Tn(e?.conditions, v) || s("editor.changeNodeTypeDialog.noConditions");
1257
+ return /* @__PURE__ */ P(m, {
1258
+ open: e !== null,
1259
+ onOpenChange: f,
1260
+ children: /* @__PURE__ */ F(_, {
1261
+ showCloseButton: !1,
1262
+ children: [
1263
+ /* @__PURE__ */ F(he, { children: [/* @__PURE__ */ P(p, { children: s("editor.changeNodeTypeDialog.title") }), /* @__PURE__ */ P(b, { children: s("editor.changeNodeTypeDialog.description") })] }),
1264
+ /* @__PURE__ */ P(Gt, {
1265
+ className: "max-h-80",
1266
+ children: /* @__PURE__ */ P(oe, {
1267
+ value: l,
1268
+ onValueChange: u,
1269
+ className: "gap-2 pr-2",
1270
+ children: c.map((e) => {
1271
+ let t = e.data, n = y(t), r = g(e.target);
1272
+ return /* @__PURE__ */ F(d, {
1273
+ htmlFor: `keep-${e.id}`,
1274
+ className: "flex cursor-pointer items-start gap-3 rounded-lg border bg-muted/20 p-3",
1275
+ children: [/* @__PURE__ */ P(me, {
1276
+ id: `keep-${e.id}`,
1277
+ value: e.id,
1278
+ className: "mt-1"
1279
+ }), /* @__PURE__ */ F("div", {
1280
+ className: "flex flex-col gap-1",
1281
+ children: [/* @__PURE__ */ P("span", {
1282
+ className: "font-medium",
1283
+ children: r
1284
+ }), /* @__PURE__ */ P("span", {
1285
+ className: "text-muted-foreground text-xs",
1286
+ children: n
1287
+ })]
1288
+ })]
1289
+ }, e.id);
1290
+ })
1291
+ })
1292
+ }),
1293
+ /* @__PURE__ */ F(S, { children: [/* @__PURE__ */ P(k, {
1294
+ variant: "outline",
1295
+ onClick: t,
1296
+ children: s("common.cancel")
1297
+ }), /* @__PURE__ */ P(k, {
1298
+ onClick: h,
1299
+ disabled: !l,
1300
+ children: s("editor.changeNodeTypeDialog.keepBranch")
1301
+ })] })
1302
+ ]
1303
+ })
1304
+ });
1305
+ }, Dn = () => {
1306
+ let { pendingDeleteNodeId: e, closeDeleteNodeConfirmation: t } = H(), { deleteNode: n } = W(), r = U();
1307
+ return /* @__PURE__ */ P(m, {
1076
1308
  open: e !== null,
1077
1309
  onOpenChange: (e) => {
1078
1310
  e || t();
1079
1311
  },
1080
- children: /* @__PURE__ */ F(b, {
1312
+ children: /* @__PURE__ */ F(_, {
1081
1313
  showCloseButton: !1,
1082
- children: [/* @__PURE__ */ F(re, { children: [/* @__PURE__ */ P(C, { children: r("editor.nodeActionsSheet.deleteNode") }), /* @__PURE__ */ P(x, { children: r("editor.nodeActionsSheet.deleteNodeConfirm") })] }), /* @__PURE__ */ F(D, { children: [/* @__PURE__ */ P(p, {
1314
+ children: [/* @__PURE__ */ F(he, { children: [/* @__PURE__ */ P(p, { children: r("editor.nodeActionsSheet.deleteNode") }), /* @__PURE__ */ P(b, { children: r("editor.nodeActionsSheet.deleteNodeConfirm") })] }), /* @__PURE__ */ F(S, { children: [/* @__PURE__ */ P(k, {
1083
1315
  variant: "outline",
1084
1316
  onClick: t,
1085
1317
  children: r("common.cancel")
1086
- }), /* @__PURE__ */ P(p, {
1318
+ }), /* @__PURE__ */ P(k, {
1087
1319
  onClick: () => {
1088
1320
  e && n(e), t();
1089
1321
  },
@@ -1091,13 +1323,13 @@ var Kt = ht(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
1091
1323
  })] })]
1092
1324
  })
1093
1325
  });
1094
- }, fn = "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", pn = {
1326
+ }, On = "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", kn = {
1095
1327
  claude: "claude-3-5-haiku-20241022",
1096
1328
  deepseek: "deepseek-chat",
1097
1329
  gemini: "gemini-2.5-flash",
1098
1330
  openai: "gpt-4o-mini"
1099
- }, mn = .3;
1100
- function hn(e) {
1331
+ }, An = .3;
1332
+ function jn(e) {
1101
1333
  try {
1102
1334
  return JSON.parse(e);
1103
1335
  } catch (t) {
@@ -1109,10 +1341,10 @@ function hn(e) {
1109
1341
  }
1110
1342
  }
1111
1343
  }
1112
- async function gn(e) {
1113
- let t = e.config.model || pn.gemini, n = e.config.temperature ?? mn, r = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/${t}:generateContent?key=${e.config.apiKey}`, {
1344
+ async function Mn(e) {
1345
+ let t = e.config.model || kn.gemini, n = e.config.temperature ?? An, r = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/${t}:generateContent?key=${e.config.apiKey}`, {
1114
1346
  body: JSON.stringify({
1115
- contents: [{ parts: [{ text: `${fn}\n\nUser request: ${e.prompt}` }] }],
1347
+ contents: [{ parts: [{ text: `${On}\n\nUser request: ${e.prompt}` }] }],
1116
1348
  generationConfig: {
1117
1349
  responseMimeType: "application/json",
1118
1350
  temperature: n
@@ -1127,13 +1359,13 @@ async function gn(e) {
1127
1359
  }
1128
1360
  let i = (await r.json()).candidates?.[0]?.content?.parts?.[0]?.text;
1129
1361
  if (!i) throw Error("No response from Gemini");
1130
- return hn(i);
1362
+ return jn(i);
1131
1363
  }
1132
- async function _n(e) {
1133
- let t = e.config.model || pn.openai, n = e.config.temperature ?? mn, r = await fetch("https://api.openai.com/v1/chat/completions", {
1364
+ async function Nn(e) {
1365
+ let t = e.config.model || kn.openai, n = e.config.temperature ?? An, r = await fetch("https://api.openai.com/v1/chat/completions", {
1134
1366
  body: JSON.stringify({
1135
1367
  messages: [{
1136
- content: fn,
1368
+ content: On,
1137
1369
  role: "system"
1138
1370
  }, {
1139
1371
  content: e.prompt,
@@ -1155,13 +1387,13 @@ async function _n(e) {
1155
1387
  }
1156
1388
  let i = (await r.json()).choices?.[0]?.message?.content;
1157
1389
  if (!i) throw Error("No response from OpenAI");
1158
- return hn(i);
1390
+ return jn(i);
1159
1391
  }
1160
- async function vn(e) {
1161
- let t = e.config.model || pn.deepseek, n = e.config.temperature ?? mn, r = await fetch("https://api.deepseek.com/v1/chat/completions", {
1392
+ async function Pn(e) {
1393
+ let t = e.config.model || kn.deepseek, n = e.config.temperature ?? An, r = await fetch("https://api.deepseek.com/v1/chat/completions", {
1162
1394
  body: JSON.stringify({
1163
1395
  messages: [{
1164
- content: fn,
1396
+ content: On,
1165
1397
  role: "system"
1166
1398
  }, {
1167
1399
  content: e.prompt,
@@ -1183,10 +1415,10 @@ async function vn(e) {
1183
1415
  }
1184
1416
  let i = (await r.json()).choices?.[0]?.message?.content;
1185
1417
  if (!i) throw Error("No response from DeepSeek");
1186
- return hn(i);
1418
+ return jn(i);
1187
1419
  }
1188
- async function yn(e) {
1189
- let t = e.config.model || pn.claude, n = e.config.temperature ?? mn, r = await fetch("https://api.anthropic.com/v1/messages", {
1420
+ async function Fn(e) {
1421
+ let t = e.config.model || kn.claude, n = e.config.temperature ?? An, r = await fetch("https://api.anthropic.com/v1/messages", {
1190
1422
  body: JSON.stringify({
1191
1423
  max_tokens: 4096,
1192
1424
  messages: [{
@@ -1194,7 +1426,7 @@ async function yn(e) {
1194
1426
  role: "user"
1195
1427
  }],
1196
1428
  model: t,
1197
- system: fn,
1429
+ system: On,
1198
1430
  temperature: n
1199
1431
  }),
1200
1432
  headers: {
@@ -1210,64 +1442,64 @@ async function yn(e) {
1210
1442
  }
1211
1443
  let i = (await r.json()).content?.[0]?.text;
1212
1444
  if (!i) throw Error("No response from Claude");
1213
- return hn(i);
1445
+ return jn(i);
1214
1446
  }
1215
- function bn(e) {
1447
+ function In(e) {
1216
1448
  switch (e.config.provider) {
1217
- case "gemini": return gn(e);
1218
- case "openai": return _n(e);
1219
- case "deepseek": return vn(e);
1220
- case "claude": return yn(e);
1449
+ case "gemini": return Mn(e);
1450
+ case "openai": return Nn(e);
1451
+ case "deepseek": return Pn(e);
1452
+ case "claude": return Fn(e);
1221
1453
  default: throw Error(`Unsupported AI provider: ${e.config.provider}`);
1222
1454
  }
1223
1455
  }
1224
1456
  //#endregion
1225
1457
  //#region src/editor/features/TreegeEditor/panel/AIGeneratorDialog.tsx
1226
- var xn = ({ aiConfig: e, onGenerate: t }) => {
1227
- let [n, r] = B(!1), [i, a] = B(""), [o, s] = B(!1), c = G(), l = async () => {
1458
+ var Ln = ({ aiConfig: e, onGenerate: t }) => {
1459
+ let [n, r] = z(!1), [i, a] = z(""), [o, s] = z(!1), c = U(), l = async () => {
1228
1460
  if (!i.trim()) {
1229
- U.error(c("editor.aiGenerator.enterDescription"));
1461
+ V.error(c("editor.aiGenerator.enterDescription"));
1230
1462
  return;
1231
1463
  }
1232
1464
  if (!e?.apiKey) {
1233
- U.error(c("editor.aiGenerator.missingApiKey"), { description: c("editor.aiGenerator.missingApiKeyDesc") });
1465
+ V.error(c("editor.aiGenerator.missingApiKey"), { description: c("editor.aiGenerator.missingApiKeyDesc") });
1234
1466
  return;
1235
1467
  }
1236
1468
  s(!0);
1237
1469
  try {
1238
- let n = await bn({
1470
+ let n = await In({
1239
1471
  config: e,
1240
1472
  prompt: i.trim()
1241
1473
  });
1242
1474
  t({
1243
1475
  edges: n.edges,
1244
1476
  nodes: n.nodes
1245
- }), U.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);
1477
+ }), V.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);
1246
1478
  } catch (e) {
1247
- console.error("AI generation error:", e), U.error(c("editor.aiGenerator.failedToGenerate"), { description: e instanceof Error ? e.message : c("editor.aiGenerator.unknownError") });
1479
+ console.error("AI generation error:", e), V.error(c("editor.aiGenerator.failedToGenerate"), { description: e instanceof Error ? e.message : c("editor.aiGenerator.unknownError") });
1248
1480
  } finally {
1249
1481
  s(!1);
1250
1482
  }
1251
1483
  };
1252
- return /* @__PURE__ */ F(k, {
1484
+ return /* @__PURE__ */ F(m, {
1253
1485
  open: n,
1254
1486
  onOpenChange: r,
1255
- children: [/* @__PURE__ */ P(S, {
1487
+ children: [/* @__PURE__ */ P(re, {
1256
1488
  asChild: !0,
1257
- children: /* @__PURE__ */ F(p, {
1489
+ children: /* @__PURE__ */ F(k, {
1258
1490
  variant: "outline",
1259
1491
  size: "sm",
1260
1492
  disabled: !e?.apiKey,
1261
1493
  children: [
1262
- /* @__PURE__ */ P(dt, { className: "h-4 w-4 text-[#13d3b4]" }),
1494
+ /* @__PURE__ */ P(xt, { className: "h-4 w-4 text-[#13d3b4]" }),
1263
1495
  " ",
1264
1496
  c("editor.aiGenerator.buttonLabel")
1265
1497
  ]
1266
1498
  })
1267
- }), /* @__PURE__ */ F(b, {
1499
+ }), /* @__PURE__ */ F(_, {
1268
1500
  className: "sm:max-w-[550px]!",
1269
1501
  children: [
1270
- /* @__PURE__ */ F(re, { children: [/* @__PURE__ */ P(C, { children: c("editor.aiGenerator.title") }), /* @__PURE__ */ P(x, { children: c("editor.aiGenerator.titleDescription") })] }),
1502
+ /* @__PURE__ */ F(he, { children: [/* @__PURE__ */ P(p, { children: c("editor.aiGenerator.title") }), /* @__PURE__ */ P(b, { children: c("editor.aiGenerator.titleDescription") })] }),
1271
1503
  /* @__PURE__ */ F("div", {
1272
1504
  className: "grid gap-4 py-4",
1273
1505
  children: [/* @__PURE__ */ F("div", {
@@ -1278,7 +1510,7 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1278
1510
  className: "font-medium text-sm",
1279
1511
  children: c("editor.aiGenerator.description")
1280
1512
  }),
1281
- /* @__PURE__ */ P(ne, {
1513
+ /* @__PURE__ */ P(le, {
1282
1514
  placeholder: c("editor.aiGenerator.descriptionPlaceholder"),
1283
1515
  value: i,
1284
1516
  onChange: (e) => a(e.target.value),
@@ -1312,41 +1544,41 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1312
1544
  })]
1313
1545
  })]
1314
1546
  }),
1315
- /* @__PURE__ */ F(D, { children: [/* @__PURE__ */ P(p, {
1547
+ /* @__PURE__ */ F(S, { children: [/* @__PURE__ */ P(k, {
1316
1548
  variant: "outline",
1317
1549
  onClick: () => r(!1),
1318
1550
  disabled: o,
1319
1551
  children: c("editor.aiGenerator.cancel")
1320
- }), /* @__PURE__ */ P(p, {
1552
+ }), /* @__PURE__ */ P(k, {
1321
1553
  onClick: l,
1322
1554
  disabled: o || !i.trim() || !e?.apiKey,
1323
- children: o ? /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(Xe, { className: "h-4 w-4 animate-spin" }), c("editor.aiGenerator.generating")] }) : /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(dt, { className: "h-4 w-4 text-[--treege-color-primary]" }), c("editor.aiGenerator.generate")] })
1555
+ children: o ? /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(at, { className: "h-4 w-4 animate-spin" }), c("editor.aiGenerator.generating")] }) : /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(xt, { className: "h-4 w-4 text-[--treege-color-primary]" }), c("editor.aiGenerator.generate")] })
1324
1556
  })] })
1325
1557
  ]
1326
1558
  })]
1327
1559
  });
1328
- }, Sn = Jt(), Cn = ({ onExportJson: e, onSave: t }) => {
1329
- let { flowId: n, setFlowId: r, aiConfig: i } = W(), { setNodes: a, setEdges: o, addNodes: s, screenToFlowPosition: c } = M(), l = n || Sn, u = we(), d = Ce(), f = bt(null), m = G(), h = () => {
1560
+ }, Rn = Zt(), zn = ({ onExportJson: e, onSave: t }) => {
1561
+ let { flowId: n, setFlowId: r, aiConfig: i } = H(), { setNodes: a, setEdges: o, addNodes: s, screenToFlowPosition: c } = M(), l = n || Rn, u = je(), d = Ae(), f = At(null), p = U(), m = () => {
1330
1562
  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 = c({
1331
1563
  x: e - n,
1332
1564
  y: t - r
1333
1565
  });
1334
1566
  s([{
1335
- ...Yt,
1336
- id: Jt(),
1567
+ ...sn,
1568
+ id: Zt(),
1337
1569
  position: i,
1338
1570
  selected: !0
1339
1571
  }]);
1340
- }, ee = ({ target: e }) => {
1572
+ }, h = ({ target: e }) => {
1341
1573
  let t = e.files?.[0];
1342
1574
  if (!t) return;
1343
1575
  let n = new FileReader();
1344
1576
  n.onload = (e) => {
1345
1577
  try {
1346
1578
  let t = JSON.parse(e.target?.result);
1347
- t && Array.isArray(t.nodes) && Array.isArray(t.edges) ? (a(t.nodes), o(t.edges), U.success(m("editor.actionsPanel.importSuccess"), { description: m("editor.actionsPanel.importSuccessDesc") })) : U.error(m("editor.actionsPanel.invalidJson"), { description: m("editor.actionsPanel.invalidJsonDesc") });
1579
+ t && Array.isArray(t.nodes) && Array.isArray(t.edges) ? (a(t.nodes), o(t.edges), V.success(p("editor.actionsPanel.importSuccess"), { description: p("editor.actionsPanel.importSuccessDesc") })) : V.error(p("editor.actionsPanel.invalidJson"), { description: p("editor.actionsPanel.invalidJsonDesc") });
1348
1580
  } catch (e) {
1349
- console.warn(e), U.error(m("editor.actionsPanel.parseError"), { description: m("editor.actionsPanel.parseErrorDesc") });
1581
+ console.warn(e), V.error(p("editor.actionsPanel.parseError"), { description: p("editor.actionsPanel.parseErrorDesc") });
1350
1582
  }
1351
1583
  f.current && (f.current.value = "");
1352
1584
  }, n.readAsText(t);
@@ -1356,8 +1588,8 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1356
1588
  id: l,
1357
1589
  nodes: u
1358
1590
  }, i = new Blob([JSON.stringify(t, null, 2)], { type: "application/json" }), a = URL.createObjectURL(i), o = document.createElement("a");
1359
- o.href = a, o.download = "treege.json", o.click(), URL.revokeObjectURL(a), U.success(m("editor.actionsPanel.downloadSuccess"), { description: m("editor.actionsPanel.downloadSuccessDesc") }), n || r?.(l), e?.(t);
1360
- }, _ = z(() => {
1591
+ o.href = a, o.download = "treege.json", o.click(), URL.revokeObjectURL(a), V.success(p("editor.actionsPanel.downloadSuccess"), { description: p("editor.actionsPanel.downloadSuccessDesc") }), n || r?.(l), e?.(t);
1592
+ }, _ = R(() => {
1361
1593
  n || r?.(l), t?.({
1362
1594
  edges: d,
1363
1595
  id: l,
@@ -1371,54 +1603,54 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1371
1603
  t,
1372
1604
  r
1373
1605
  ]);
1374
- return _t(() => {
1606
+ return Dt(() => {
1375
1607
  let e = (e) => {
1376
1608
  (e.ctrlKey || e.metaKey) && e.key === "s" && (e.preventDefault(), _());
1377
1609
  };
1378
1610
  return window.addEventListener("keydown", e), () => {
1379
1611
  window.removeEventListener("keydown", e);
1380
1612
  };
1381
- }, [_]), /* @__PURE__ */ F(_e, {
1613
+ }, [_]), /* @__PURE__ */ F(we, {
1382
1614
  position: "top-right",
1383
1615
  className: "flex gap-2",
1384
1616
  children: [
1385
- /* @__PURE__ */ P(xn, {
1617
+ /* @__PURE__ */ P(Ln, {
1386
1618
  aiConfig: i,
1387
1619
  onGenerate: (e) => {
1388
1620
  a(e.nodes), o(e.edges);
1389
1621
  }
1390
1622
  }),
1391
- /* @__PURE__ */ F(p, {
1623
+ /* @__PURE__ */ F(k, {
1392
1624
  variant: "outline",
1393
1625
  size: "sm",
1394
- onClick: h,
1626
+ onClick: m,
1395
1627
  children: [
1396
- /* @__PURE__ */ P(L, {}),
1628
+ /* @__PURE__ */ P(I, {}),
1397
1629
  " ",
1398
- m("editor.actionsPanel.addNode")
1630
+ p("editor.actionsPanel.addNode")
1399
1631
  ]
1400
1632
  }),
1401
- /* @__PURE__ */ F(p, {
1633
+ /* @__PURE__ */ F(k, {
1402
1634
  variant: "outline",
1403
1635
  size: "sm",
1404
1636
  onClick: _,
1405
1637
  children: [
1406
- /* @__PURE__ */ P(rt, {}),
1638
+ /* @__PURE__ */ P(pt, {}),
1407
1639
  " ",
1408
- m("common.save")
1640
+ p("common.save")
1409
1641
  ]
1410
1642
  }),
1411
- /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(Y, {
1643
+ /* @__PURE__ */ F(G, { children: [/* @__PURE__ */ P(K, {
1412
1644
  asChild: !0,
1413
- children: /* @__PURE__ */ P(p, {
1645
+ children: /* @__PURE__ */ P(k, {
1414
1646
  variant: "outline",
1415
1647
  size: "sm",
1416
- children: /* @__PURE__ */ P(He, {})
1648
+ children: /* @__PURE__ */ P(Ze, {})
1417
1649
  })
1418
- }), /* @__PURE__ */ F(X, {
1650
+ }), /* @__PURE__ */ F(q, {
1419
1651
  align: "start",
1420
1652
  children: [
1421
- /* @__PURE__ */ P(Vt, {
1653
+ /* @__PURE__ */ P(en, {
1422
1654
  className: "font-normal",
1423
1655
  children: /* @__PURE__ */ F("div", {
1424
1656
  className: "flex flex-col gap-1",
@@ -1428,46 +1660,46 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1428
1660
  }), /* @__PURE__ */ F("button", {
1429
1661
  onClick: async () => {
1430
1662
  try {
1431
- await navigator.clipboard.writeText(l), U.success(m("editor.actionsPanel.idCopied"), { description: l });
1663
+ await navigator.clipboard.writeText(l), V.success(p("editor.actionsPanel.idCopied"), { description: l });
1432
1664
  } catch {
1433
- U.error(m("editor.actionsPanel.copyFailed"));
1665
+ V.error(p("editor.actionsPanel.copyFailed"));
1434
1666
  }
1435
1667
  },
1436
1668
  className: "flex items-center gap-2 font-mono text-muted-foreground transition-colors hover:text-primary",
1437
1669
  type: "button",
1438
- children: [/* @__PURE__ */ P(Be, { className: "h-3 w-3" }), /* @__PURE__ */ P("span", {
1670
+ children: [/* @__PURE__ */ P(Ye, { className: "h-3 w-3" }), /* @__PURE__ */ P("span", {
1439
1671
  className: "truncate text-xs",
1440
1672
  children: l
1441
1673
  })]
1442
1674
  })]
1443
1675
  })
1444
1676
  }),
1445
- /* @__PURE__ */ P(Ht, {}),
1446
- /* @__PURE__ */ F(Bt, { children: [/* @__PURE__ */ F(Z, {
1677
+ /* @__PURE__ */ P(tn, {}),
1678
+ /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ F(Y, {
1447
1679
  onClick: () => f?.current?.click(),
1448
1680
  children: [
1449
- /* @__PURE__ */ P(Ve, {}),
1681
+ /* @__PURE__ */ P(Xe, {}),
1450
1682
  " ",
1451
- m("editor.actionsPanel.importJson")
1683
+ p("editor.actionsPanel.importJson")
1452
1684
  ]
1453
- }), /* @__PURE__ */ F(Z, {
1685
+ }), /* @__PURE__ */ F(Y, {
1454
1686
  onClick: g,
1455
1687
  children: [
1456
- /* @__PURE__ */ P(Oe, {}),
1688
+ /* @__PURE__ */ P(Ie, {}),
1457
1689
  " ",
1458
- m("editor.actionsPanel.exportJson")
1690
+ p("editor.actionsPanel.exportJson")
1459
1691
  ]
1460
1692
  })] }),
1461
- /* @__PURE__ */ P(Ht, {}),
1462
- /* @__PURE__ */ P(Bt, { children: /* @__PURE__ */ F(Z, {
1693
+ /* @__PURE__ */ P(tn, {}),
1694
+ /* @__PURE__ */ P(J, { children: /* @__PURE__ */ F(Y, {
1463
1695
  onClick: () => {
1464
- a([]), o([]), U.success(m("editor.actionsPanel.clearSuccess"), { description: m("editor.actionsPanel.clearSuccessDesc") });
1696
+ a([]), o([]), V.success(p("editor.actionsPanel.clearSuccess"), { description: p("editor.actionsPanel.clearSuccessDesc") });
1465
1697
  },
1466
1698
  className: "text-destructive focus:text-destructive",
1467
1699
  children: [
1468
- /* @__PURE__ */ P(ct, { className: "text-destructive" }),
1700
+ /* @__PURE__ */ P(vt, { className: "text-destructive" }),
1469
1701
  " ",
1470
- m("editor.actionsPanel.clear")
1702
+ p("editor.actionsPanel.clear")
1471
1703
  ]
1472
1704
  }) })
1473
1705
  ]
@@ -1477,11 +1709,11 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1477
1709
  accept: "application/json,.json",
1478
1710
  className: "hidden",
1479
1711
  ref: f,
1480
- onChange: ee
1712
+ onChange: h
1481
1713
  })
1482
1714
  ]
1483
1715
  });
1484
- }, wn = {
1716
+ }, Bn = {
1485
1717
  ar: "ar",
1486
1718
  de: "de",
1487
1719
  en: "en",
@@ -1492,25 +1724,25 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1492
1724
  }, Q = ({ value: e = "en", onValueChange: t }) => /* @__PURE__ */ F(g, {
1493
1725
  value: e,
1494
1726
  onValueChange: t,
1495
- children: [/* @__PURE__ */ P(h, {
1727
+ children: [/* @__PURE__ */ P(v, {
1496
1728
  className: "uppercase",
1497
- children: /* @__PURE__ */ P(c, { placeholder: "" })
1498
- }), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ P(j, { children: Object.values(wn).map((e) => /* @__PURE__ */ P(v, {
1729
+ children: /* @__PURE__ */ P(T, { placeholder: "" })
1730
+ }), /* @__PURE__ */ P(C, { children: /* @__PURE__ */ P(w, { children: Object.values(Bn).map((e) => /* @__PURE__ */ P(h, {
1499
1731
  value: e,
1500
1732
  className: "uppercase",
1501
1733
  children: e
1502
1734
  }, e)) }) })]
1503
1735
  }), $ = () => {
1504
- let e = we(), t = yt(() => e.filter(i), [e]), n = yt(() => e.filter((e) => e.selected), [e]), r = yt(() => e.find((e) => e.selected), [e]);
1736
+ let e = je(), t = kt(() => e.filter(n), [e]), r = kt(() => e.filter((e) => e.selected), [e]), i = kt(() => e.find((e) => e.selected), [e]);
1505
1737
  return {
1506
1738
  groupNodes: t,
1507
- hasSelectedNodes: n.length > 0,
1739
+ hasSelectedNodes: r.length > 0,
1508
1740
  nodes: e,
1509
- selectedNode: r,
1510
- selectedNodes: n
1741
+ selectedNode: i,
1742
+ selectedNodes: r
1511
1743
  };
1512
- }, Tn = () => {
1513
- let [e, t] = B("en"), { updateSelectedNodeData: n } = q(), { selectedNode: r } = $(), i = G(), { Field: a } = I({
1744
+ }, Vn = () => {
1745
+ let [e, t] = z("en"), { updateSelectedNodeData: n } = W(), { selectedNode: r } = $(), i = U(), { Field: a } = Pe({
1514
1746
  defaultValues: {
1515
1747
  label: r?.data?.label || { en: "" },
1516
1748
  targetId: r?.data?.targetId || ""
@@ -1535,12 +1767,12 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1535
1767
  className: "flex items-end gap-2",
1536
1768
  children: [/* @__PURE__ */ P(a, {
1537
1769
  name: "label",
1538
- children: (t) => /* @__PURE__ */ F(w, {
1770
+ children: (t) => /* @__PURE__ */ F(A, {
1539
1771
  className: "flex-1",
1540
- children: [/* @__PURE__ */ P(l, {
1772
+ children: [/* @__PURE__ */ P(d, {
1541
1773
  htmlFor: t.name,
1542
1774
  children: i("editor.flowNodeForm.label")
1543
- }), /* @__PURE__ */ P(m, {
1775
+ }), /* @__PURE__ */ P(O, {
1544
1776
  id: t.name,
1545
1777
  name: t.name,
1546
1778
  value: t.state.value?.[e] || "",
@@ -1559,25 +1791,25 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1559
1791
  })]
1560
1792
  }), /* @__PURE__ */ P(a, {
1561
1793
  name: "targetId",
1562
- children: (e) => /* @__PURE__ */ F(w, { children: [
1563
- /* @__PURE__ */ F(l, {
1794
+ children: (e) => /* @__PURE__ */ F(A, { children: [
1795
+ /* @__PURE__ */ F(d, {
1564
1796
  htmlFor: e.name,
1565
1797
  children: [i("editor.flowNodeForm.targetId"), " (Flow ID)"]
1566
1798
  }),
1567
- /* @__PURE__ */ P(m, {
1799
+ /* @__PURE__ */ P(O, {
1568
1800
  id: e.name,
1569
1801
  name: e.name,
1570
1802
  value: e.state.value,
1571
1803
  onBlur: e.handleBlur,
1572
1804
  onChange: ({ target: t }) => e.handleChange(t.value)
1573
1805
  }),
1574
- /* @__PURE__ */ P(T, { children: "Unique identifier of the target flow." })
1806
+ /* @__PURE__ */ P(j, { children: "Unique identifier of the target flow." })
1575
1807
  ] })
1576
1808
  })]
1577
1809
  })
1578
1810
  });
1579
- }, En = () => {
1580
- let [e, t] = B("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = q(), { Field: i } = I({
1811
+ }, Hn = () => {
1812
+ let [e, t] = z("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = W(), { Field: i } = Pe({
1581
1813
  defaultValues: { label: n?.data?.label || { en: "" } },
1582
1814
  listeners: {
1583
1815
  onChange: ({ formApi: e }) => {
@@ -1597,12 +1829,12 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1597
1829
  className: "flex items-end gap-2",
1598
1830
  children: [/* @__PURE__ */ P(i, {
1599
1831
  name: "label",
1600
- children: (t) => /* @__PURE__ */ F(w, {
1832
+ children: (t) => /* @__PURE__ */ F(A, {
1601
1833
  className: "flex-1",
1602
- children: [/* @__PURE__ */ P(l, {
1834
+ children: [/* @__PURE__ */ P(d, {
1603
1835
  htmlFor: t.name,
1604
1836
  children: "Label"
1605
- }), /* @__PURE__ */ P(m, {
1837
+ }), /* @__PURE__ */ P(O, {
1606
1838
  id: t.name,
1607
1839
  name: t.name,
1608
1840
  value: t.state.value?.[e] || "",
@@ -1621,12 +1853,12 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1621
1853
  })]
1622
1854
  })
1623
1855
  });
1624
- }, Dn = [
1856
+ }, Un = [
1625
1857
  "POST",
1626
1858
  "PUT",
1627
1859
  "PATCH"
1628
- ], On = ({ value: e, onChange: t }) => {
1629
- let { selectedNode: n } = $(), r = G(), i = jt(n?.id), { handleSubmit: a, Field: o, Subscribe: s } = I({
1860
+ ], Wn = ({ value: e, onChange: t }) => {
1861
+ let { selectedNode: n } = $(), r = U(), i = Ht(n?.id), { handleSubmit: a, Field: o, Subscribe: s } = Pe({
1630
1862
  defaultValues: {
1631
1863
  body: e?.body || "",
1632
1864
  fetchOnMount: e?.fetchOnMount ?? !e?.searchParam,
@@ -1657,14 +1889,14 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1657
1889
  children: [
1658
1890
  /* @__PURE__ */ P(o, {
1659
1891
  name: "url",
1660
- children: (e) => /* @__PURE__ */ F(w, { children: [
1661
- /* @__PURE__ */ P(l, {
1892
+ children: (e) => /* @__PURE__ */ F(A, { children: [
1893
+ /* @__PURE__ */ P(d, {
1662
1894
  htmlFor: e.name,
1663
1895
  children: r("editor.httpConfigForm.apiUrl")
1664
1896
  }),
1665
1897
  /* @__PURE__ */ F("div", {
1666
1898
  className: "flex gap-2",
1667
- children: [/* @__PURE__ */ P(m, {
1899
+ children: [/* @__PURE__ */ P(O, {
1668
1900
  id: e.name,
1669
1901
  name: e.name,
1670
1902
  value: e.state.value,
@@ -1672,20 +1904,20 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1672
1904
  onChange: ({ target: t }) => e.handleChange(t.value),
1673
1905
  placeholder: r("editor.httpConfigForm.apiUrlPlaceholder"),
1674
1906
  className: "flex-1"
1675
- }), /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(Y, {
1907
+ }), /* @__PURE__ */ F(G, { children: [/* @__PURE__ */ P(K, {
1676
1908
  asChild: !0,
1677
- children: /* @__PURE__ */ P(p, {
1909
+ children: /* @__PURE__ */ P(k, {
1678
1910
  type: "button",
1679
1911
  variant: "outline",
1680
1912
  size: "icon",
1681
- children: /* @__PURE__ */ P(ut, { className: "h-4 w-4" })
1913
+ children: /* @__PURE__ */ P(bt, { className: "h-4 w-4" })
1682
1914
  })
1683
- }), /* @__PURE__ */ P(X, {
1915
+ }), /* @__PURE__ */ P(q, {
1684
1916
  align: "end",
1685
- children: i.length === 0 ? /* @__PURE__ */ P(Z, {
1917
+ children: i.length === 0 ? /* @__PURE__ */ P(Y, {
1686
1918
  disabled: !0,
1687
1919
  children: r("editor.httpConfigForm.noFieldsAvailable")
1688
- }) : i.map((t) => /* @__PURE__ */ P(Z, {
1920
+ }) : i.map((t) => /* @__PURE__ */ P(Y, {
1689
1921
  onClick: () => {
1690
1922
  let n = `{{${t.nodeId}}}`, r = e.state.value || "";
1691
1923
  e.handleChange(r + n);
@@ -1703,38 +1935,38 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1703
1935
  }, t.nodeId))
1704
1936
  })] })]
1705
1937
  }),
1706
- /* @__PURE__ */ P(T, { children: r("editor.httpConfigForm.apiUrlDesc") })
1938
+ /* @__PURE__ */ P(j, { children: r("editor.httpConfigForm.apiUrlDesc") })
1707
1939
  ] })
1708
1940
  }),
1709
1941
  /* @__PURE__ */ P(o, {
1710
1942
  name: "method",
1711
- children: (e) => /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
1943
+ children: (e) => /* @__PURE__ */ F(A, { children: [/* @__PURE__ */ P(d, {
1712
1944
  htmlFor: e.name,
1713
1945
  children: r("editor.httpConfigForm.httpMethod")
1714
1946
  }), /* @__PURE__ */ F(g, {
1715
1947
  value: e.state.value,
1716
1948
  onValueChange: (t) => e.handleChange(t),
1717
- children: [/* @__PURE__ */ P(h, {
1949
+ children: [/* @__PURE__ */ P(v, {
1718
1950
  id: e.name,
1719
- children: /* @__PURE__ */ P(c, { placeholder: r("editor.httpConfigForm.selectMethod") })
1720
- }), /* @__PURE__ */ F(A, { children: [
1721
- /* @__PURE__ */ P(v, {
1951
+ children: /* @__PURE__ */ P(T, { placeholder: r("editor.httpConfigForm.selectMethod") })
1952
+ }), /* @__PURE__ */ F(C, { children: [
1953
+ /* @__PURE__ */ P(h, {
1722
1954
  value: "GET",
1723
1955
  children: r("editor.httpConfigForm.methodGet")
1724
1956
  }),
1725
- /* @__PURE__ */ P(v, {
1957
+ /* @__PURE__ */ P(h, {
1726
1958
  value: "POST",
1727
1959
  children: r("editor.httpConfigForm.methodPost")
1728
1960
  }),
1729
- /* @__PURE__ */ P(v, {
1961
+ /* @__PURE__ */ P(h, {
1730
1962
  value: "PUT",
1731
1963
  children: r("editor.httpConfigForm.methodPut")
1732
1964
  }),
1733
- /* @__PURE__ */ P(v, {
1965
+ /* @__PURE__ */ P(h, {
1734
1966
  value: "DELETE",
1735
1967
  children: r("editor.httpConfigForm.methodDelete")
1736
1968
  }),
1737
- /* @__PURE__ */ P(v, {
1969
+ /* @__PURE__ */ P(h, {
1738
1970
  value: "PATCH",
1739
1971
  children: r("editor.httpConfigForm.methodPatch")
1740
1972
  })
@@ -1758,7 +1990,7 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1758
1990
  children: [
1759
1991
  /* @__PURE__ */ P(o, {
1760
1992
  name: `headers[${n}].key`,
1761
- children: (e) => /* @__PURE__ */ P(m, {
1993
+ children: (e) => /* @__PURE__ */ P(O, {
1762
1994
  placeholder: r("editor.httpConfigForm.headerName"),
1763
1995
  value: e.state.value || "",
1764
1996
  onChange: ({ target: t }) => e.handleChange(t.value)
@@ -1766,24 +1998,24 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1766
1998
  }),
1767
1999
  /* @__PURE__ */ P(o, {
1768
2000
  name: `headers[${n}].value`,
1769
- children: (e) => /* @__PURE__ */ P(m, {
2001
+ children: (e) => /* @__PURE__ */ P(O, {
1770
2002
  placeholder: r("editor.httpConfigForm.headerValue"),
1771
2003
  value: e.state.value || "",
1772
2004
  onChange: ({ target: t }) => e.handleChange(t.value)
1773
2005
  })
1774
2006
  }),
1775
- /* @__PURE__ */ P(p, {
2007
+ /* @__PURE__ */ P(k, {
1776
2008
  type: "button",
1777
2009
  variant: "ghost",
1778
2010
  size: "icon",
1779
2011
  onClick: () => {
1780
2012
  e.removeValue(n);
1781
2013
  },
1782
- children: /* @__PURE__ */ P(R, { className: "h-4 w-4" })
2014
+ children: /* @__PURE__ */ P(L, { className: "h-4 w-4" })
1783
2015
  })
1784
2016
  ]
1785
2017
  }, i);
1786
- }), /* @__PURE__ */ F(p, {
2018
+ }), /* @__PURE__ */ F(k, {
1787
2019
  type: "button",
1788
2020
  variant: "outline",
1789
2021
  size: "sm",
@@ -1793,7 +2025,7 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1793
2025
  value: ""
1794
2026
  });
1795
2027
  },
1796
- children: [/* @__PURE__ */ P(L, { className: "mr-2 h-4 w-4" }), r("editor.httpConfigForm.addHeader")]
2028
+ children: [/* @__PURE__ */ P(I, { className: "mr-2 h-4 w-4" }), r("editor.httpConfigForm.addHeader")]
1797
2029
  })]
1798
2030
  })
1799
2031
  })]
@@ -1803,44 +2035,44 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1803
2035
  method: e.values.method,
1804
2036
  sendAllFormValues: e.values.sendAllFormValues
1805
2037
  }),
1806
- children: ({ method: e, sendAllFormValues: t }) => Dn.includes(e || "") && /* @__PURE__ */ F("div", {
2038
+ children: ({ method: e, sendAllFormValues: t }) => Un.includes(e || "") && /* @__PURE__ */ F("div", {
1807
2039
  className: "space-y-4",
1808
2040
  children: [/* @__PURE__ */ P(o, {
1809
2041
  name: "sendAllFormValues",
1810
2042
  children: (e) => /* @__PURE__ */ F("div", {
1811
2043
  className: "flex items-center space-x-2",
1812
- children: [/* @__PURE__ */ P(y, {
2044
+ children: [/* @__PURE__ */ P(D, {
1813
2045
  id: e.name,
1814
2046
  checked: e.state.value,
1815
2047
  onCheckedChange: (t) => e.handleChange(t)
1816
- }), /* @__PURE__ */ P(l, {
2048
+ }), /* @__PURE__ */ P(d, {
1817
2049
  htmlFor: e.name,
1818
2050
  children: r("editor.httpConfigForm.sendAllFormValues")
1819
2051
  })]
1820
2052
  })
1821
2053
  }), /* @__PURE__ */ P(o, {
1822
2054
  name: "body",
1823
- children: (e) => /* @__PURE__ */ F(w, { children: [
2055
+ children: (e) => /* @__PURE__ */ F(A, { children: [
1824
2056
  /* @__PURE__ */ F("div", {
1825
2057
  className: "mb-2 flex items-center justify-between",
1826
- children: [/* @__PURE__ */ P(l, {
2058
+ children: [/* @__PURE__ */ P(d, {
1827
2059
  htmlFor: e.name,
1828
2060
  children: r("editor.httpConfigForm.requestBody")
1829
- }), /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(Y, {
2061
+ }), /* @__PURE__ */ F(G, { children: [/* @__PURE__ */ P(K, {
1830
2062
  asChild: !0,
1831
- children: /* @__PURE__ */ F(p, {
2063
+ children: /* @__PURE__ */ F(k, {
1832
2064
  type: "button",
1833
2065
  variant: "ghost",
1834
2066
  size: "sm",
1835
2067
  disabled: t,
1836
- children: [/* @__PURE__ */ P(ut, { className: "mr-2 h-4 w-4" }), r("editor.httpConfigForm.insertVariable")]
2068
+ children: [/* @__PURE__ */ P(bt, { className: "mr-2 h-4 w-4" }), r("editor.httpConfigForm.insertVariable")]
1837
2069
  })
1838
- }), /* @__PURE__ */ P(X, {
2070
+ }), /* @__PURE__ */ P(q, {
1839
2071
  align: "end",
1840
- children: i.length === 0 ? /* @__PURE__ */ P(Z, {
2072
+ children: i.length === 0 ? /* @__PURE__ */ P(Y, {
1841
2073
  disabled: !0,
1842
2074
  children: r("editor.httpConfigForm.noFieldsAvailable")
1843
- }) : i.map((t) => /* @__PURE__ */ P(Z, {
2075
+ }) : i.map((t) => /* @__PURE__ */ P(Y, {
1844
2076
  onClick: () => {
1845
2077
  let n = `{{${t.nodeId}}}`, r = e.state.value || "";
1846
2078
  e.handleChange(r + n), a().then();
@@ -1858,7 +2090,7 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1858
2090
  }, t.nodeId))
1859
2091
  })] })]
1860
2092
  }),
1861
- /* @__PURE__ */ P(ne, {
2093
+ /* @__PURE__ */ P(le, {
1862
2094
  id: e.name,
1863
2095
  name: e.name,
1864
2096
  value: e.state.value,
@@ -1868,7 +2100,7 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1868
2100
  rows: 4,
1869
2101
  disabled: t
1870
2102
  }),
1871
- /* @__PURE__ */ P(T, { children: r(t ? "editor.httpConfigForm.sendAllFormValuesDesc" : "editor.httpConfigForm.requestBodyDesc") })
2103
+ /* @__PURE__ */ P(j, { children: r(t ? "editor.httpConfigForm.sendAllFormValuesDesc" : "editor.httpConfigForm.requestBodyDesc") })
1872
2104
  ] })
1873
2105
  })]
1874
2106
  })
@@ -1882,12 +2114,12 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1882
2114
  }),
1883
2115
  /* @__PURE__ */ P(o, {
1884
2116
  name: "responsePath",
1885
- children: (e) => /* @__PURE__ */ F(w, { children: [
1886
- /* @__PURE__ */ P(l, {
2117
+ children: (e) => /* @__PURE__ */ F(A, { children: [
2118
+ /* @__PURE__ */ P(d, {
1887
2119
  htmlFor: e.name,
1888
2120
  children: r("editor.httpConfigForm.responsePath")
1889
2121
  }),
1890
- /* @__PURE__ */ P(m, {
2122
+ /* @__PURE__ */ P(O, {
1891
2123
  id: e.name,
1892
2124
  name: e.name,
1893
2125
  value: e.state.value,
@@ -1895,7 +2127,7 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1895
2127
  onChange: ({ target: t }) => e.handleChange(t.value),
1896
2128
  placeholder: r("editor.httpConfigForm.responsePathPlaceholder")
1897
2129
  }),
1898
- /* @__PURE__ */ P(T, { children: r("editor.httpConfigForm.responsePathDesc") })
2130
+ /* @__PURE__ */ P(j, { children: r("editor.httpConfigForm.responsePathDesc") })
1899
2131
  ] })
1900
2132
  }),
1901
2133
  /* @__PURE__ */ F("div", {
@@ -1907,12 +2139,12 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1907
2139
  }),
1908
2140
  /* @__PURE__ */ P(o, {
1909
2141
  name: "responseMapping.valueField",
1910
- children: (e) => /* @__PURE__ */ F(w, { children: [
1911
- /* @__PURE__ */ P(l, {
2142
+ children: (e) => /* @__PURE__ */ F(A, { children: [
2143
+ /* @__PURE__ */ P(d, {
1912
2144
  htmlFor: e.name,
1913
2145
  children: r("editor.httpConfigForm.valueField")
1914
2146
  }),
1915
- /* @__PURE__ */ P(m, {
2147
+ /* @__PURE__ */ P(O, {
1916
2148
  id: e.name,
1917
2149
  name: e.name,
1918
2150
  value: e.state.value,
@@ -1920,17 +2152,17 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1920
2152
  onChange: ({ target: t }) => e.handleChange(t.value),
1921
2153
  placeholder: r("editor.httpConfigForm.valueFieldPlaceholder")
1922
2154
  }),
1923
- /* @__PURE__ */ P(T, { children: r("editor.httpConfigForm.valueFieldDesc") })
2155
+ /* @__PURE__ */ P(j, { children: r("editor.httpConfigForm.valueFieldDesc") })
1924
2156
  ] })
1925
2157
  }),
1926
2158
  /* @__PURE__ */ P(o, {
1927
2159
  name: "responseMapping.labelField",
1928
- children: (e) => /* @__PURE__ */ F(w, { children: [
1929
- /* @__PURE__ */ P(l, {
2160
+ children: (e) => /* @__PURE__ */ F(A, { children: [
2161
+ /* @__PURE__ */ P(d, {
1930
2162
  htmlFor: e.name,
1931
2163
  children: r("editor.httpConfigForm.labelField")
1932
2164
  }),
1933
- /* @__PURE__ */ P(m, {
2165
+ /* @__PURE__ */ P(O, {
1934
2166
  id: e.name,
1935
2167
  name: e.name,
1936
2168
  value: e.state.value,
@@ -1938,19 +2170,19 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1938
2170
  onChange: ({ target: t }) => e.handleChange(t.value),
1939
2171
  placeholder: r("editor.httpConfigForm.labelFieldPlaceholder")
1940
2172
  }),
1941
- /* @__PURE__ */ P(T, { children: r("editor.httpConfigForm.labelFieldDesc") })
2173
+ /* @__PURE__ */ P(j, { children: r("editor.httpConfigForm.labelFieldDesc") })
1942
2174
  ] })
1943
2175
  })
1944
2176
  ]
1945
2177
  }),
1946
2178
  /* @__PURE__ */ P(o, {
1947
2179
  name: "searchParam",
1948
- children: (e) => /* @__PURE__ */ F(w, { children: [
1949
- /* @__PURE__ */ P(l, {
2180
+ children: (e) => /* @__PURE__ */ F(A, { children: [
2181
+ /* @__PURE__ */ P(d, {
1950
2182
  htmlFor: e.name,
1951
2183
  children: r("editor.httpConfigForm.searchParameter")
1952
2184
  }),
1953
- /* @__PURE__ */ P(m, {
2185
+ /* @__PURE__ */ P(O, {
1954
2186
  id: e.name,
1955
2187
  name: e.name,
1956
2188
  value: e.state.value,
@@ -1958,7 +2190,7 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1958
2190
  onChange: ({ target: t }) => e.handleChange(t.value),
1959
2191
  placeholder: r("editor.httpConfigForm.searchParameterPlaceholder")
1960
2192
  }),
1961
- /* @__PURE__ */ P(T, { children: r("editor.httpConfigForm.searchParameterDesc") })
2193
+ /* @__PURE__ */ P(j, { children: r("editor.httpConfigForm.searchParameterDesc") })
1962
2194
  ] })
1963
2195
  })
1964
2196
  ]
@@ -1978,12 +2210,12 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1978
2210
  let n = !!e?.trim(), i = n ? t.state.value : !0;
1979
2211
  return !n && t.state.value !== !0 && t.handleChange(!0), /* @__PURE__ */ F("div", {
1980
2212
  className: "flex items-center space-x-2",
1981
- children: [/* @__PURE__ */ P(y, {
2213
+ children: [/* @__PURE__ */ P(D, {
1982
2214
  id: t.name,
1983
2215
  checked: i,
1984
2216
  disabled: !n,
1985
2217
  onCheckedChange: (e) => t.handleChange(e)
1986
- }), /* @__PURE__ */ P(l, {
2218
+ }), /* @__PURE__ */ P(d, {
1987
2219
  htmlFor: t.name,
1988
2220
  className: n ? "" : "text-muted-foreground",
1989
2221
  children: r("editor.httpConfigForm.fetchOnMount")
@@ -1996,11 +2228,11 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
1996
2228
  name: "showLoading",
1997
2229
  children: (e) => /* @__PURE__ */ F("div", {
1998
2230
  className: "flex items-center space-x-2",
1999
- children: [/* @__PURE__ */ P(y, {
2231
+ children: [/* @__PURE__ */ P(D, {
2000
2232
  id: e.name,
2001
2233
  checked: e.state.value,
2002
2234
  onCheckedChange: (t) => e.handleChange(t)
2003
- }), /* @__PURE__ */ P(l, {
2235
+ }), /* @__PURE__ */ P(d, {
2004
2236
  htmlFor: e.name,
2005
2237
  children: r("editor.httpConfigForm.showLoadingState")
2006
2238
  })]
@@ -2010,12 +2242,12 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2010
2242
  })
2011
2243
  ]
2012
2244
  }) });
2013
- }, kn = [
2245
+ }, Gn = [
2014
2246
  "POST",
2015
2247
  "PUT",
2016
2248
  "PATCH"
2017
- ], An = ({ value: e, onChange: t }) => {
2018
- let [n, r] = B("en"), { selectedNode: i } = $(), a = G(), o = jt(i?.id), { handleSubmit: s, Field: u, Subscribe: d } = I({
2249
+ ], Kn = ({ value: e, onChange: t }) => {
2250
+ let [n, r] = z("en"), { selectedNode: i } = $(), a = U(), o = Ht(i?.id), { handleSubmit: s, Field: c, Subscribe: l } = Pe({
2019
2251
  defaultValues: {
2020
2252
  body: e?.body || "",
2021
2253
  errorMessage: e?.errorMessage || { en: "" },
@@ -2040,16 +2272,16 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2040
2272
  return /* @__PURE__ */ P("div", { children: /* @__PURE__ */ F("div", {
2041
2273
  className: "grid gap-6",
2042
2274
  children: [
2043
- /* @__PURE__ */ P(u, {
2275
+ /* @__PURE__ */ P(c, {
2044
2276
  name: "url",
2045
- children: (e) => /* @__PURE__ */ F(w, { children: [
2046
- /* @__PURE__ */ P(l, {
2277
+ children: (e) => /* @__PURE__ */ F(A, { children: [
2278
+ /* @__PURE__ */ P(d, {
2047
2279
  htmlFor: e.name,
2048
2280
  children: a("editor.submitConfigForm.apiUrl")
2049
2281
  }),
2050
2282
  /* @__PURE__ */ F("div", {
2051
2283
  className: "flex gap-2",
2052
- children: [/* @__PURE__ */ P(m, {
2284
+ children: [/* @__PURE__ */ P(O, {
2053
2285
  id: e.name,
2054
2286
  name: e.name,
2055
2287
  value: e.state.value,
@@ -2057,20 +2289,20 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2057
2289
  onChange: ({ target: t }) => e.handleChange(t.value),
2058
2290
  placeholder: a("editor.submitConfigForm.apiUrlPlaceholder"),
2059
2291
  className: "flex-1"
2060
- }), /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(Y, {
2292
+ }), /* @__PURE__ */ F(G, { children: [/* @__PURE__ */ P(K, {
2061
2293
  asChild: !0,
2062
- children: /* @__PURE__ */ P(p, {
2294
+ children: /* @__PURE__ */ P(k, {
2063
2295
  type: "button",
2064
2296
  variant: "outline",
2065
2297
  size: "icon",
2066
- children: /* @__PURE__ */ P(ut, { className: "h-4 w-4" })
2298
+ children: /* @__PURE__ */ P(bt, { className: "h-4 w-4" })
2067
2299
  })
2068
- }), /* @__PURE__ */ P(X, {
2300
+ }), /* @__PURE__ */ P(q, {
2069
2301
  align: "end",
2070
- children: o.length === 0 ? /* @__PURE__ */ P(Z, {
2302
+ children: o.length === 0 ? /* @__PURE__ */ P(Y, {
2071
2303
  disabled: !0,
2072
2304
  children: a("editor.submitConfigForm.noFieldsAvailable")
2073
- }) : o.map((t) => /* @__PURE__ */ P(Z, {
2305
+ }) : o.map((t) => /* @__PURE__ */ P(Y, {
2074
2306
  onClick: () => {
2075
2307
  let n = `{{${t.nodeId}}}`, r = e.state.value || "";
2076
2308
  e.handleChange(r + n);
@@ -2088,34 +2320,34 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2088
2320
  }, t.nodeId))
2089
2321
  })] })]
2090
2322
  }),
2091
- /* @__PURE__ */ P(T, { children: a("editor.submitConfigForm.apiUrlDesc") })
2323
+ /* @__PURE__ */ P(j, { children: a("editor.submitConfigForm.apiUrlDesc") })
2092
2324
  ] })
2093
2325
  }),
2094
- /* @__PURE__ */ P(u, {
2326
+ /* @__PURE__ */ P(c, {
2095
2327
  name: "method",
2096
- children: (e) => /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
2328
+ children: (e) => /* @__PURE__ */ F(A, { children: [/* @__PURE__ */ P(d, {
2097
2329
  htmlFor: e.name,
2098
2330
  children: a("editor.submitConfigForm.httpMethod")
2099
2331
  }), /* @__PURE__ */ F(g, {
2100
2332
  value: e.state.value,
2101
2333
  onValueChange: (t) => e.handleChange(t),
2102
- children: [/* @__PURE__ */ P(h, {
2334
+ children: [/* @__PURE__ */ P(v, {
2103
2335
  id: e.name,
2104
- children: /* @__PURE__ */ P(c, { placeholder: a("editor.submitConfigForm.selectMethod") })
2105
- }), /* @__PURE__ */ F(A, { children: [
2106
- /* @__PURE__ */ P(v, {
2336
+ children: /* @__PURE__ */ P(T, { placeholder: a("editor.submitConfigForm.selectMethod") })
2337
+ }), /* @__PURE__ */ F(C, { children: [
2338
+ /* @__PURE__ */ P(h, {
2107
2339
  value: "POST",
2108
2340
  children: a("editor.submitConfigForm.methodPost")
2109
2341
  }),
2110
- /* @__PURE__ */ P(v, {
2342
+ /* @__PURE__ */ P(h, {
2111
2343
  value: "PUT",
2112
2344
  children: a("editor.submitConfigForm.methodPut")
2113
2345
  }),
2114
- /* @__PURE__ */ P(v, {
2346
+ /* @__PURE__ */ P(h, {
2115
2347
  value: "DELETE",
2116
2348
  children: a("editor.submitConfigForm.methodDelete")
2117
2349
  }),
2118
- /* @__PURE__ */ P(v, {
2350
+ /* @__PURE__ */ P(h, {
2119
2351
  value: "PATCH",
2120
2352
  children: a("editor.submitConfigForm.methodPatch")
2121
2353
  })
@@ -2127,7 +2359,7 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2127
2359
  children: [/* @__PURE__ */ P("h4", {
2128
2360
  className: "font-semibold text-sm",
2129
2361
  children: a("editor.submitConfigForm.headers")
2130
- }), /* @__PURE__ */ P(u, {
2362
+ }), /* @__PURE__ */ P(c, {
2131
2363
  name: "headers",
2132
2364
  mode: "array",
2133
2365
  children: (e) => /* @__PURE__ */ F("div", {
@@ -2137,34 +2369,34 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2137
2369
  return /* @__PURE__ */ F("div", {
2138
2370
  className: "flex items-start gap-2",
2139
2371
  children: [
2140
- /* @__PURE__ */ P(u, {
2372
+ /* @__PURE__ */ P(c, {
2141
2373
  name: `headers[${n}].key`,
2142
- children: (e) => /* @__PURE__ */ P(m, {
2374
+ children: (e) => /* @__PURE__ */ P(O, {
2143
2375
  placeholder: a("editor.submitConfigForm.headerName"),
2144
2376
  value: e.state.value || "",
2145
2377
  onChange: ({ target: t }) => e.handleChange(t.value)
2146
2378
  })
2147
2379
  }),
2148
- /* @__PURE__ */ P(u, {
2380
+ /* @__PURE__ */ P(c, {
2149
2381
  name: `headers[${n}].value`,
2150
- children: (e) => /* @__PURE__ */ P(m, {
2382
+ children: (e) => /* @__PURE__ */ P(O, {
2151
2383
  placeholder: a("editor.submitConfigForm.headerValue"),
2152
2384
  value: e.state.value || "",
2153
2385
  onChange: ({ target: t }) => e.handleChange(t.value)
2154
2386
  })
2155
2387
  }),
2156
- /* @__PURE__ */ P(p, {
2388
+ /* @__PURE__ */ P(k, {
2157
2389
  type: "button",
2158
2390
  variant: "ghost",
2159
2391
  size: "icon",
2160
2392
  onClick: () => {
2161
2393
  e.removeValue(n);
2162
2394
  },
2163
- children: /* @__PURE__ */ P(R, { className: "h-4 w-4" })
2395
+ children: /* @__PURE__ */ P(L, { className: "h-4 w-4" })
2164
2396
  })
2165
2397
  ]
2166
2398
  }, r);
2167
- }), /* @__PURE__ */ F(p, {
2399
+ }), /* @__PURE__ */ F(k, {
2168
2400
  type: "button",
2169
2401
  variant: "outline",
2170
2402
  size: "sm",
@@ -2174,54 +2406,54 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2174
2406
  value: ""
2175
2407
  });
2176
2408
  },
2177
- children: [/* @__PURE__ */ P(L, { className: "mr-2 h-4 w-4" }), a("editor.submitConfigForm.addHeader")]
2409
+ children: [/* @__PURE__ */ P(I, { className: "mr-2 h-4 w-4" }), a("editor.submitConfigForm.addHeader")]
2178
2410
  })]
2179
2411
  })
2180
2412
  })]
2181
2413
  }),
2182
- /* @__PURE__ */ P(d, {
2414
+ /* @__PURE__ */ P(l, {
2183
2415
  selector: (e) => ({
2184
2416
  method: e.values.method,
2185
2417
  sendAllFormValues: e.values.sendAllFormValues
2186
2418
  }),
2187
- children: ({ method: e, sendAllFormValues: t }) => kn.includes(e || "") && /* @__PURE__ */ F("div", {
2419
+ children: ({ method: e, sendAllFormValues: t }) => Gn.includes(e || "") && /* @__PURE__ */ F("div", {
2188
2420
  className: "space-y-4",
2189
- children: [/* @__PURE__ */ P(u, {
2421
+ children: [/* @__PURE__ */ P(c, {
2190
2422
  name: "sendAllFormValues",
2191
2423
  children: (e) => /* @__PURE__ */ F("div", {
2192
2424
  className: "flex items-center space-x-2",
2193
- children: [/* @__PURE__ */ P(y, {
2425
+ children: [/* @__PURE__ */ P(D, {
2194
2426
  id: e.name,
2195
2427
  checked: e.state.value,
2196
2428
  onCheckedChange: (t) => e.handleChange(t)
2197
- }), /* @__PURE__ */ P(l, {
2429
+ }), /* @__PURE__ */ P(d, {
2198
2430
  htmlFor: e.name,
2199
2431
  children: a("editor.submitConfigForm.sendAllFormValues")
2200
2432
  })]
2201
2433
  })
2202
- }), /* @__PURE__ */ P(u, {
2434
+ }), /* @__PURE__ */ P(c, {
2203
2435
  name: "body",
2204
- children: (e) => /* @__PURE__ */ F(w, { children: [
2436
+ children: (e) => /* @__PURE__ */ F(A, { children: [
2205
2437
  /* @__PURE__ */ F("div", {
2206
2438
  className: "mb-2 flex items-center justify-between",
2207
- children: [/* @__PURE__ */ P(l, {
2439
+ children: [/* @__PURE__ */ P(d, {
2208
2440
  htmlFor: e.name,
2209
2441
  children: a("editor.submitConfigForm.requestBody")
2210
- }), /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(Y, {
2442
+ }), /* @__PURE__ */ F(G, { children: [/* @__PURE__ */ P(K, {
2211
2443
  asChild: !0,
2212
- children: /* @__PURE__ */ F(p, {
2444
+ children: /* @__PURE__ */ F(k, {
2213
2445
  type: "button",
2214
2446
  variant: "ghost",
2215
2447
  size: "sm",
2216
2448
  disabled: t,
2217
- children: [/* @__PURE__ */ P(ut, { className: "mr-2 h-4 w-4" }), a("editor.submitConfigForm.insertVariable")]
2449
+ children: [/* @__PURE__ */ P(bt, { className: "mr-2 h-4 w-4" }), a("editor.submitConfigForm.insertVariable")]
2218
2450
  })
2219
- }), /* @__PURE__ */ P(X, {
2451
+ }), /* @__PURE__ */ P(q, {
2220
2452
  align: "end",
2221
- children: o.length === 0 ? /* @__PURE__ */ P(Z, {
2453
+ children: o.length === 0 ? /* @__PURE__ */ P(Y, {
2222
2454
  disabled: !0,
2223
2455
  children: a("editor.submitConfigForm.noFieldsAvailable")
2224
- }) : o.map((t) => /* @__PURE__ */ P(Z, {
2456
+ }) : o.map((t) => /* @__PURE__ */ P(Y, {
2225
2457
  onClick: () => {
2226
2458
  let n = `{{${t.nodeId}}}`, r = e.state.value || "";
2227
2459
  e.handleChange(r + n), s().then();
@@ -2239,7 +2471,7 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2239
2471
  }, t.nodeId))
2240
2472
  })] })]
2241
2473
  }),
2242
- /* @__PURE__ */ P(ne, {
2474
+ /* @__PURE__ */ P(le, {
2243
2475
  id: e.name,
2244
2476
  name: e.name,
2245
2477
  value: e.state.value,
@@ -2249,7 +2481,7 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2249
2481
  rows: 4,
2250
2482
  disabled: t
2251
2483
  }),
2252
- /* @__PURE__ */ P(T, { children: a(t ? "editor.submitConfigForm.sendAllFormValuesDesc" : "editor.submitConfigForm.requestBodyDesc") })
2484
+ /* @__PURE__ */ P(j, { children: a(t ? "editor.submitConfigForm.sendAllFormValuesDesc" : "editor.submitConfigForm.requestBodyDesc") })
2253
2485
  ] })
2254
2486
  })]
2255
2487
  })
@@ -2261,14 +2493,14 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2261
2493
  className: "font-semibold text-sm",
2262
2494
  children: a("editor.submitConfigForm.postSubmission")
2263
2495
  }),
2264
- /* @__PURE__ */ P(u, {
2496
+ /* @__PURE__ */ P(c, {
2265
2497
  name: "redirectUrl",
2266
- children: (e) => /* @__PURE__ */ F(w, { children: [
2267
- /* @__PURE__ */ P(l, {
2498
+ children: (e) => /* @__PURE__ */ F(A, { children: [
2499
+ /* @__PURE__ */ P(d, {
2268
2500
  htmlFor: e.name,
2269
2501
  children: a("editor.submitConfigForm.redirectUrl")
2270
2502
  }),
2271
- /* @__PURE__ */ P(m, {
2503
+ /* @__PURE__ */ P(O, {
2272
2504
  id: e.name,
2273
2505
  name: e.name,
2274
2506
  value: e.state.value,
@@ -2276,21 +2508,21 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2276
2508
  onChange: ({ target: t }) => e.handleChange(t.value),
2277
2509
  placeholder: a("editor.submitConfigForm.redirectUrlPlaceholder")
2278
2510
  }),
2279
- /* @__PURE__ */ P(T, { children: a("editor.submitConfigForm.redirectUrlDesc") })
2511
+ /* @__PURE__ */ P(j, { children: a("editor.submitConfigForm.redirectUrlDesc") })
2280
2512
  ] })
2281
2513
  }),
2282
2514
  /* @__PURE__ */ F("div", {
2283
2515
  className: "flex items-center gap-2",
2284
- children: [/* @__PURE__ */ P(u, {
2516
+ children: [/* @__PURE__ */ P(c, {
2285
2517
  name: "successMessage",
2286
- children: (e) => /* @__PURE__ */ F(w, {
2518
+ children: (e) => /* @__PURE__ */ F(A, {
2287
2519
  className: "flex-1",
2288
2520
  children: [
2289
- /* @__PURE__ */ P(l, {
2521
+ /* @__PURE__ */ P(d, {
2290
2522
  htmlFor: e.name,
2291
2523
  children: a("editor.submitConfigForm.successMessage")
2292
2524
  }),
2293
- /* @__PURE__ */ P(m, {
2525
+ /* @__PURE__ */ P(O, {
2294
2526
  id: e.name,
2295
2527
  name: e.name,
2296
2528
  value: e.state.value?.[n] || "",
@@ -2303,7 +2535,7 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2303
2535
  },
2304
2536
  placeholder: a("editor.submitConfigForm.successMessagePlaceholder")
2305
2537
  }),
2306
- /* @__PURE__ */ P(T, { children: a("editor.submitConfigForm.successMessageDesc") })
2538
+ /* @__PURE__ */ P(j, { children: a("editor.submitConfigForm.successMessageDesc") })
2307
2539
  ]
2308
2540
  })
2309
2541
  }), /* @__PURE__ */ P(Q, {
@@ -2313,16 +2545,16 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2313
2545
  }),
2314
2546
  /* @__PURE__ */ F("div", {
2315
2547
  className: "flex items-center gap-2",
2316
- children: [/* @__PURE__ */ P(u, {
2548
+ children: [/* @__PURE__ */ P(c, {
2317
2549
  name: "errorMessage",
2318
- children: (e) => /* @__PURE__ */ F(w, {
2550
+ children: (e) => /* @__PURE__ */ F(A, {
2319
2551
  className: "flex-1",
2320
2552
  children: [
2321
- /* @__PURE__ */ P(l, {
2553
+ /* @__PURE__ */ P(d, {
2322
2554
  htmlFor: e.name,
2323
2555
  children: a("editor.submitConfigForm.errorMessage")
2324
2556
  }),
2325
- /* @__PURE__ */ P(m, {
2557
+ /* @__PURE__ */ P(O, {
2326
2558
  id: e.name,
2327
2559
  name: e.name,
2328
2560
  value: e.state.value?.[n] || "",
@@ -2335,7 +2567,7 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2335
2567
  },
2336
2568
  placeholder: a("editor.submitConfigForm.errorMessagePlaceholder")
2337
2569
  }),
2338
- /* @__PURE__ */ P(T, { children: a("editor.submitConfigForm.errorMessageDesc") })
2570
+ /* @__PURE__ */ P(j, { children: a("editor.submitConfigForm.errorMessageDesc") })
2339
2571
  ]
2340
2572
  })
2341
2573
  }), /* @__PURE__ */ P(Q, {
@@ -2350,15 +2582,15 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2350
2582
  children: [/* @__PURE__ */ P("h4", {
2351
2583
  className: "font-semibold text-sm",
2352
2584
  children: a("editor.submitConfigForm.behavior")
2353
- }), /* @__PURE__ */ P(u, {
2585
+ }), /* @__PURE__ */ P(c, {
2354
2586
  name: "showLoading",
2355
2587
  children: (e) => /* @__PURE__ */ F("div", {
2356
2588
  className: "flex items-center space-x-2",
2357
- children: [/* @__PURE__ */ P(y, {
2589
+ children: [/* @__PURE__ */ P(D, {
2358
2590
  id: e.name,
2359
2591
  checked: e.state.value,
2360
2592
  onCheckedChange: (t) => e.handleChange(t)
2361
- }), /* @__PURE__ */ P(l, {
2593
+ }), /* @__PURE__ */ P(d, {
2362
2594
  htmlFor: e.name,
2363
2595
  children: a("editor.submitConfigForm.showLoadingState")
2364
2596
  })]
@@ -2367,69 +2599,69 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2367
2599
  })
2368
2600
  ]
2369
2601
  }) });
2370
- }, jn = ({ 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: f = !0, allowCreate: m = !0 }) => {
2371
- let [h, g] = B(!1), [v, y] = B(""), b = (e) => e ?? "", x = (e) => e.trim().toLowerCase(), S = b(n), C = n !== null && n !== "", w = C ? e.find((e) => b(e.value) === S) : void 0, T = x(v), ne = m && T !== "" && !e.some((e) => x(e.label) === T || x(e.value ?? "") === T), re = (e) => {
2372
- e === S ? f && r?.("") : r?.(e), g(!1), y("");
2602
+ }, qn = ({ 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 }) => {
2603
+ let [p, m] = z(!1), [h, g] = z(""), _ = (e) => e ?? "", v = (e) => e.trim().toLowerCase(), y = _(n), b = n !== null && n !== "", S = b ? 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) => {
2604
+ e === y ? u && r?.("") : r?.(e), m(!1), g("");
2373
2605
  };
2374
- return /* @__PURE__ */ F(se, {
2375
- open: h,
2376
- onOpenChange: g,
2377
- children: [/* @__PURE__ */ P(u, {
2606
+ return /* @__PURE__ */ F(ie, {
2607
+ open: p,
2608
+ onOpenChange: m,
2609
+ children: [/* @__PURE__ */ P(ne, {
2378
2610
  asChild: !0,
2379
2611
  id: t,
2380
- children: /* @__PURE__ */ F(p, {
2612
+ children: /* @__PURE__ */ F(k, {
2381
2613
  type: "button",
2382
2614
  variant: "outline",
2383
2615
  role: "combobox",
2384
- "aria-expanded": h,
2385
- className: d("w-full justify-between font-normal", l),
2616
+ "aria-expanded": p,
2617
+ className: E("w-full justify-between font-normal", l),
2386
2618
  children: [/* @__PURE__ */ P("span", {
2387
2619
  className: "truncate",
2388
- children: C && w ? w.label : i
2389
- }), /* @__PURE__ */ P(Ie, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })]
2620
+ children: b && S ? S.label : i
2621
+ }), /* @__PURE__ */ P(We, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })]
2390
2622
  })
2391
- }), /* @__PURE__ */ P(ee, {
2623
+ }), /* @__PURE__ */ P(ae, {
2392
2624
  className: "w-full p-0",
2393
2625
  align: "start",
2394
- children: /* @__PURE__ */ F(ie, {
2626
+ children: /* @__PURE__ */ F(ce, {
2395
2627
  shouldFilter: !1,
2396
- children: [/* @__PURE__ */ P(_, {
2628
+ children: [/* @__PURE__ */ P(ee, {
2397
2629
  placeholder: a,
2398
- value: v,
2399
- onValueChange: y
2400
- }), /* @__PURE__ */ F(ae, { children: [
2401
- /* @__PURE__ */ P(O, { children: c }),
2402
- f && C && /* @__PURE__ */ P(te, { children: /* @__PURE__ */ F(E, {
2630
+ value: h,
2631
+ onValueChange: g
2632
+ }), /* @__PURE__ */ F(x, { children: [
2633
+ /* @__PURE__ */ P(f, { children: c }),
2634
+ u && b && /* @__PURE__ */ P(se, { children: /* @__PURE__ */ F(te, {
2403
2635
  value: "__clear__",
2404
2636
  onSelect: () => {
2405
- r?.(""), g(!1), y("");
2637
+ r?.(""), m(!1), g("");
2406
2638
  },
2407
2639
  className: "mt-1 text-muted-foreground",
2408
- children: [/* @__PURE__ */ P(R, { className: "mr-2 h-4 w-4" }), s]
2640
+ children: [/* @__PURE__ */ P(L, { className: "mr-2 h-4 w-4" }), s]
2409
2641
  }) }),
2410
- /* @__PURE__ */ F(te, { children: [ne && /* @__PURE__ */ F(E, {
2411
- value: `__create__${v}`,
2642
+ /* @__PURE__ */ F(se, { children: [re && /* @__PURE__ */ F(te, {
2643
+ value: `__create__${h}`,
2412
2644
  onSelect: () => {
2413
- v.trim() && (r?.(v.trim()), g(!1), y(""));
2645
+ h.trim() && (r?.(h.trim()), m(!1), g(""));
2414
2646
  },
2415
2647
  className: "text-primary",
2416
- children: [/* @__PURE__ */ P(L, { className: "mr-2 h-4 w-4" }), o(v)]
2648
+ children: [/* @__PURE__ */ P(I, { className: "mr-2 h-4 w-4" }), o(h)]
2417
2649
  }), e.filter((e) => {
2418
- let t = v.toLowerCase();
2650
+ let t = h.toLowerCase();
2419
2651
  return e.label.toLowerCase().includes(t) || (e.value?.toLowerCase() ?? "").includes(t);
2420
- }).map((e, t) => /* @__PURE__ */ F(E, {
2652
+ }).map((e, t) => /* @__PURE__ */ F(te, {
2421
2653
  value: e.label,
2422
- onSelect: () => re(e?.value || ""),
2423
- children: [/* @__PURE__ */ P(Ne, {
2654
+ onSelect: () => w(e?.value || ""),
2655
+ children: [/* @__PURE__ */ P(Ve, {
2424
2656
  "aria-hidden": "true",
2425
- className: d("mr-2 h-4 w-4", C && b(e.value) === S ? "opacity-100" : "opacity-0")
2657
+ className: E("mr-2 h-4 w-4", b && _(e.value) === y ? "opacity-100" : "opacity-0")
2426
2658
  }), e.label]
2427
2659
  }, e.value ?? e.label ?? t))] })
2428
2660
  ] })]
2429
2661
  })
2430
2662
  })]
2431
2663
  });
2432
- }, Mn = Object.entries({
2664
+ }, Jn = Object.entries({
2433
2665
  alphanumeric: "^[a-zA-Z0-9]+$",
2434
2666
  email: "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",
2435
2667
  letters: "^[a-zA-Z]+$",
@@ -2438,56 +2670,56 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2438
2670
  }).map(([e, t]) => ({
2439
2671
  label: e.charAt(0).toUpperCase() + e.slice(1).replace(/_/g, " "),
2440
2672
  value: t
2441
- })), Nn = ({ id: e, value: t, onValueChange: n }) => /* @__PURE__ */ P(jn, {
2673
+ })), Yn = ({ id: e, value: t, onValueChange: n }) => /* @__PURE__ */ P(qn, {
2442
2674
  id: e,
2443
- options: yt(() => t && !Mn.some((e) => e.value === t) ? [...Mn, {
2675
+ options: kt(() => t && !Jn.some((e) => e.value === t) ? [...Jn, {
2444
2676
  label: `Custom: ${t}`,
2445
2677
  value: t
2446
- }] : Mn, [t]),
2678
+ }] : Jn, [t]),
2447
2679
  value: t,
2448
2680
  onValueChange: n,
2449
2681
  placeholder: "Select or create a pattern",
2450
2682
  searchPlaceholder: "Search patterns...",
2451
2683
  createLabel: (e) => `Use pattern: ${e}`
2452
- }), Pn = 400, Fn = .8, In = (e) => new Promise((t, n) => {
2684
+ }), Xn = 400, Zn = .8, Qn = (e) => new Promise((t, n) => {
2453
2685
  let r = new FileReader();
2454
2686
  r.onerror = () => n(/* @__PURE__ */ Error("read_failed")), r.onload = () => {
2455
2687
  let e = new Image();
2456
2688
  e.onload = () => t(e), e.onerror = () => n(/* @__PURE__ */ Error("decode_failed")), e.src = r.result;
2457
2689
  }, r.readAsDataURL(e);
2458
- }), Ln = async (e) => {
2690
+ }), $n = async (e) => {
2459
2691
  if (!e.type.startsWith("image/")) throw Error("invalid_type");
2460
2692
  if (e.size > 5242880) throw Error("too_large");
2461
- let t = await In(e), n = Math.min(1, Pn / Math.max(t.width, t.height)), r = document.createElement("canvas");
2693
+ let t = await Qn(e), n = Math.min(1, Xn / Math.max(t.width, t.height)), r = document.createElement("canvas");
2462
2694
  r.width = Math.round(t.width * n), r.height = Math.round(t.height * n);
2463
2695
  let i = r.getContext("2d");
2464
2696
  if (!i) throw Error("canvas_unavailable");
2465
- return i.drawImage(t, 0, 0, r.width, r.height), r.toDataURL("image/jpeg", Fn);
2466
- }, Rn = 400, zn = (e) => {
2697
+ return i.drawImage(t, 0, 0, r.width, r.height), r.toDataURL("image/jpeg", Zn);
2698
+ }, er = 400, tr = (e) => {
2467
2699
  if (!/^https?:\/\//i.test(e)) return !1;
2468
2700
  try {
2469
2701
  return !!new URL(e).hostname;
2470
2702
  } catch {
2471
2703
  return !1;
2472
2704
  }
2473
- }, Bn = ({ value: e, onChange: t }) => {
2474
- let n = bt(null), r = bt(null), [i, a] = B(!1), [o, s] = B(e && /^https?:\/\//i.test(e) ? e : ""), c = G();
2475
- _t(() => {
2705
+ }, nr = ({ value: e, onChange: t }) => {
2706
+ let n = At(null), r = At(null), [i, a] = z(!1), [o, s] = z(e && /^https?:\/\//i.test(e) ? e : ""), c = U();
2707
+ Dt(() => {
2476
2708
  i || s(e && /^https?:\/\//i.test(e) ? e : "");
2477
- }, [i, e]), _t(() => () => {
2709
+ }, [i, e]), Dt(() => () => {
2478
2710
  r.current && clearTimeout(r.current);
2479
2711
  }, []);
2480
2712
  let l = async (e) => {
2481
2713
  let r = e.target.files?.[0];
2482
2714
  if (r) try {
2483
- t(await Ln(r)), a(!1);
2715
+ t(await $n(r)), a(!1);
2484
2716
  } catch (e) {
2485
2717
  let t = e.message;
2486
- t === "too_large" ? U.error(c("editor.inputNodeForm.optionImageTooLarge")) : t === "invalid_type" ? U.error(c("editor.inputNodeForm.optionImageInvalid")) : U.error(c("editor.inputNodeForm.optionImageError"));
2718
+ t === "too_large" ? V.error(c("editor.inputNodeForm.optionImageTooLarge")) : t === "invalid_type" ? V.error(c("editor.inputNodeForm.optionImageInvalid")) : V.error(c("editor.inputNodeForm.optionImageError"));
2487
2719
  } finally {
2488
2720
  n.current && (n.current.value = "");
2489
2721
  }
2490
- }, d = () => {
2722
+ }, u = () => {
2491
2723
  let e = o.trim();
2492
2724
  e && (t(e), a(!1));
2493
2725
  };
@@ -2501,10 +2733,10 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2501
2733
  className: "hidden",
2502
2734
  onChange: l
2503
2735
  }),
2504
- /* @__PURE__ */ F(se, {
2736
+ /* @__PURE__ */ F(ie, {
2505
2737
  open: i,
2506
2738
  onOpenChange: a,
2507
- children: [/* @__PURE__ */ P(u, {
2739
+ children: [/* @__PURE__ */ P(ne, {
2508
2740
  asChild: !0,
2509
2741
  children: e ? /* @__PURE__ */ P("button", {
2510
2742
  type: "button",
@@ -2515,43 +2747,43 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2515
2747
  alt: "",
2516
2748
  className: "h-full w-full object-cover"
2517
2749
  })
2518
- }) : /* @__PURE__ */ P(p, {
2750
+ }) : /* @__PURE__ */ P(k, {
2519
2751
  type: "button",
2520
2752
  variant: "outline",
2521
2753
  size: "icon",
2522
2754
  "aria-label": c("editor.inputNodeForm.optionImageAdd"),
2523
- children: /* @__PURE__ */ P(Ke, { className: "h-4 w-4" })
2755
+ children: /* @__PURE__ */ P(tt, { className: "h-4 w-4" })
2524
2756
  })
2525
- }), /* @__PURE__ */ F(ee, {
2757
+ }), /* @__PURE__ */ F(ae, {
2526
2758
  align: "start",
2527
2759
  className: "w-64 space-y-3 p-3",
2528
2760
  children: [
2529
- /* @__PURE__ */ F(p, {
2761
+ /* @__PURE__ */ F(k, {
2530
2762
  type: "button",
2531
2763
  variant: "outline",
2532
2764
  size: "sm",
2533
2765
  className: "w-full",
2534
2766
  onClick: () => n.current?.click(),
2535
- children: [/* @__PURE__ */ P(lt, { className: "mr-2 h-4 w-4" }), c("editor.inputNodeForm.optionImageUpload")]
2767
+ children: [/* @__PURE__ */ P(yt, { className: "mr-2 h-4 w-4" }), c("editor.inputNodeForm.optionImageUpload")]
2536
2768
  }),
2537
- /* @__PURE__ */ P(oe, {}),
2769
+ /* @__PURE__ */ P(ue, {}),
2538
2770
  /* @__PURE__ */ F("div", {
2539
2771
  className: "flex items-center gap-2",
2540
- children: [/* @__PURE__ */ P(Je, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), /* @__PURE__ */ P(m, {
2772
+ children: [/* @__PURE__ */ P(rt, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), /* @__PURE__ */ P(O, {
2541
2773
  placeholder: c("editor.inputNodeForm.optionImageUrlPlaceholder"),
2542
2774
  value: o,
2543
2775
  onChange: (n) => {
2544
2776
  let i = n.target.value;
2545
2777
  s(i), r.current && clearTimeout(r.current);
2546
2778
  let a = i.trim();
2547
- !zn(a) || a === e || (r.current = setTimeout(() => {
2779
+ !tr(a) || a === e || (r.current = setTimeout(() => {
2548
2780
  t(a);
2549
- }, Rn));
2781
+ }, er));
2550
2782
  },
2551
2783
  onKeyDown: (e) => {
2552
- e.key === "Enter" && (e.preventDefault(), d());
2784
+ e.key === "Enter" && (e.preventDefault(), u());
2553
2785
  },
2554
- onBlur: d
2786
+ onBlur: u
2555
2787
  })]
2556
2788
  })
2557
2789
  ]
@@ -2564,58 +2796,40 @@ var xn = ({ aiConfig: e, onGenerate: t }) => {
2564
2796
  },
2565
2797
  className: "-top-1 -right-1 absolute flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-destructive text-destructive-foreground",
2566
2798
  "aria-label": c("editor.inputNodeForm.optionImageRemove"),
2567
- children: /* @__PURE__ */ P(R, { className: "h-3 w-3" })
2799
+ children: /* @__PURE__ */ P(L, { className: "h-3 w-3" })
2568
2800
  })
2569
2801
  ]
2570
2802
  });
2571
- }, Vn = ({ value: e, onValueChange: t }) => {
2572
- let n = G(), r = vt();
2573
- return /* @__PURE__ */ F(j, { children: [/* @__PURE__ */ P(ce, {
2574
- htmlFor: r,
2575
- children: n("editor.selectInputType.type")
2576
- }), /* @__PURE__ */ F(g, {
2577
- value: e,
2578
- onValueChange: t,
2579
- children: [/* @__PURE__ */ P(h, {
2580
- id: r,
2581
- className: "w-full capitalize",
2582
- children: /* @__PURE__ */ P(c, { placeholder: "" })
2583
- }), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ P(j, { children: Object.values(K).map((e) => /* @__PURE__ */ F(v, {
2584
- value: e,
2585
- className: "capitalize",
2586
- children: [/* @__PURE__ */ P(tn(e), {}), e]
2587
- }, e)) }) })]
2588
- })] });
2589
2803
  };
2590
2804
  //#endregion
2591
2805
  //#region src/shared/components/ui/collapsible.tsx
2592
- function Hn({ ...e }) {
2593
- return /* @__PURE__ */ P(Tt.Root, {
2806
+ function rr({ ...e }) {
2807
+ return /* @__PURE__ */ P(It.Root, {
2594
2808
  "data-slot": "collapsible",
2595
2809
  ...e
2596
2810
  });
2597
2811
  }
2598
- function Un({ ...e }) {
2599
- return /* @__PURE__ */ P(Tt.CollapsibleTrigger, {
2812
+ function ir({ ...e }) {
2813
+ return /* @__PURE__ */ P(It.CollapsibleTrigger, {
2600
2814
  "data-slot": "collapsible-trigger",
2601
2815
  ...e
2602
2816
  });
2603
2817
  }
2604
- function Wn({ ...e }) {
2605
- return /* @__PURE__ */ P(Tt.CollapsibleContent, {
2818
+ function ar({ ...e }) {
2819
+ return /* @__PURE__ */ P(It.CollapsibleContent, {
2606
2820
  "data-slot": "collapsible-content",
2607
2821
  ...e
2608
2822
  });
2609
2823
  }
2610
2824
  //#endregion
2611
2825
  //#region src/editor/features/TreegeEditor/forms/InputNodeForm.tsx
2612
- var Gn = () => {
2613
- let [e, t] = B("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = q(), i = [
2826
+ var or = () => {
2827
+ let [e, t] = z("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = W(), i = [
2614
2828
  "select",
2615
2829
  "radio",
2616
2830
  "autocomplete",
2617
2831
  "checkbox"
2618
- ].includes(n?.data?.type || ""), a = jt(n?.id), o = G(), s = n?.data?.type === "submit", { handleSubmit: u, Field: d } = I({
2832
+ ].includes(n?.data?.type || ""), a = Ht(n?.id), o = U(), s = n?.data?.type === "submit", c = n?.data?.type === "hidden", { handleSubmit: l, Field: u } = Pe({
2619
2833
  defaultValues: {
2620
2834
  defaultValue: n?.data?.defaultValue,
2621
2835
  disablePast: n?.data?.disablePast,
@@ -2630,7 +2844,6 @@ var Gn = () => {
2630
2844
  placeholder: n?.data?.placeholder || { en: "" },
2631
2845
  required: n?.data?.required,
2632
2846
  submitConfig: n?.data?.submitConfig,
2633
- type: n?.data?.type || "",
2634
2847
  variant: n?.data?.variant || "default"
2635
2848
  },
2636
2849
  listeners: {
@@ -2650,23 +2863,16 @@ var Gn = () => {
2650
2863
  children: /* @__PURE__ */ F("div", {
2651
2864
  className: "grid gap-6",
2652
2865
  children: [
2653
- /* @__PURE__ */ P(d, {
2654
- name: "type",
2655
- children: (e) => /* @__PURE__ */ P(w, { children: /* @__PURE__ */ P(Vn, {
2656
- value: e.state.value,
2657
- onValueChange: (t) => e.handleChange(t)
2658
- }) })
2659
- }),
2660
2866
  /* @__PURE__ */ F("div", {
2661
2867
  className: "flex items-end gap-2",
2662
- children: [/* @__PURE__ */ P(d, {
2868
+ children: [/* @__PURE__ */ P(u, {
2663
2869
  name: "label",
2664
- children: (t) => /* @__PURE__ */ F(w, {
2870
+ children: (t) => /* @__PURE__ */ F(A, {
2665
2871
  className: "flex-1",
2666
- children: [/* @__PURE__ */ P(l, {
2872
+ children: [/* @__PURE__ */ P(d, {
2667
2873
  htmlFor: t.name,
2668
2874
  children: o("editor.inputNodeForm.label")
2669
- }), /* @__PURE__ */ P(m, {
2875
+ }), /* @__PURE__ */ P(O, {
2670
2876
  autoFocus: !0,
2671
2877
  id: t.name,
2672
2878
  name: t.name,
@@ -2685,16 +2891,16 @@ var Gn = () => {
2685
2891
  onValueChange: t
2686
2892
  })]
2687
2893
  }),
2688
- !s && n?.data?.type !== "file" && /* @__PURE__ */ F("div", {
2894
+ !(s || c) && n?.data?.type !== "file" && /* @__PURE__ */ F("div", {
2689
2895
  className: "flex items-end gap-2",
2690
- children: [/* @__PURE__ */ P(d, {
2896
+ children: [/* @__PURE__ */ P(u, {
2691
2897
  name: "placeholder",
2692
- children: (t) => /* @__PURE__ */ F(w, {
2898
+ children: (t) => /* @__PURE__ */ F(A, {
2693
2899
  className: "flex-1",
2694
- children: [/* @__PURE__ */ P(l, {
2900
+ children: [/* @__PURE__ */ P(d, {
2695
2901
  htmlFor: t.name,
2696
2902
  children: o("editor.inputNodeForm.placeholder")
2697
- }), /* @__PURE__ */ P(m, {
2903
+ }), /* @__PURE__ */ P(O, {
2698
2904
  id: t.name,
2699
2905
  name: t.name,
2700
2906
  value: t.state.value?.[e] || "",
@@ -2712,16 +2918,16 @@ var Gn = () => {
2712
2918
  onValueChange: t
2713
2919
  })]
2714
2920
  }),
2715
- !s && /* @__PURE__ */ F("div", {
2921
+ !(s || c) && /* @__PURE__ */ F("div", {
2716
2922
  className: "flex items-end gap-2",
2717
- children: [/* @__PURE__ */ P(d, {
2923
+ children: [/* @__PURE__ */ P(u, {
2718
2924
  name: "helperText",
2719
- children: (t) => /* @__PURE__ */ F(w, {
2925
+ children: (t) => /* @__PURE__ */ F(A, {
2720
2926
  className: "flex-1",
2721
- children: [/* @__PURE__ */ P(l, {
2927
+ children: [/* @__PURE__ */ P(d, {
2722
2928
  htmlFor: t.name,
2723
2929
  children: o("editor.inputNodeForm.helperText")
2724
- }), /* @__PURE__ */ P(m, {
2930
+ }), /* @__PURE__ */ P(O, {
2725
2931
  id: t.name,
2726
2932
  name: t.name,
2727
2933
  value: t.state.value?.[e] || "",
@@ -2739,109 +2945,109 @@ var Gn = () => {
2739
2945
  onValueChange: t
2740
2946
  })]
2741
2947
  }),
2742
- n?.data?.type === "http" && /* @__PURE__ */ F(Hn, {
2948
+ n?.data?.type === "http" && /* @__PURE__ */ F(rr, {
2743
2949
  defaultOpen: !0,
2744
2950
  className: "flex w-full max-w-[350px] flex-col gap-2",
2745
- children: [/* @__PURE__ */ P(Un, {
2951
+ children: [/* @__PURE__ */ P(ir, {
2746
2952
  asChild: !0,
2747
2953
  children: /* @__PURE__ */ F("div", {
2748
2954
  className: "flex items-center justify-between gap-4",
2749
2955
  children: [/* @__PURE__ */ P("h4", {
2750
2956
  className: "font-semibold text-sm",
2751
2957
  children: o("editor.inputNodeForm.httpConfiguration")
2752
- }), /* @__PURE__ */ F(p, {
2958
+ }), /* @__PURE__ */ F(k, {
2753
2959
  variant: "ghost",
2754
2960
  size: "icon",
2755
2961
  className: "size-8",
2756
- children: [/* @__PURE__ */ P(Ie, {}), /* @__PURE__ */ P("span", {
2962
+ children: [/* @__PURE__ */ P(We, {}), /* @__PURE__ */ P("span", {
2757
2963
  className: "sr-only",
2758
2964
  children: o("common.toggle")
2759
2965
  })]
2760
2966
  })]
2761
2967
  })
2762
- }), /* @__PURE__ */ P(Wn, {
2968
+ }), /* @__PURE__ */ P(ar, {
2763
2969
  className: "flex flex-col gap-4",
2764
- children: /* @__PURE__ */ P(d, {
2970
+ children: /* @__PURE__ */ P(u, {
2765
2971
  name: "httpConfig",
2766
- children: (e) => /* @__PURE__ */ P(On, {
2972
+ children: (e) => /* @__PURE__ */ P(Wn, {
2767
2973
  value: e.state.value,
2768
2974
  onChange: (t) => {
2769
- e.handleChange(t), u().then();
2975
+ e.handleChange(t), l().then();
2770
2976
  }
2771
2977
  })
2772
2978
  })
2773
2979
  })]
2774
2980
  }),
2775
- s && /* @__PURE__ */ F(Hn, {
2981
+ s && /* @__PURE__ */ F(rr, {
2776
2982
  className: "flex w-full max-w-[350px] flex-col gap-2",
2777
- children: [/* @__PURE__ */ P(Un, {
2983
+ children: [/* @__PURE__ */ P(ir, {
2778
2984
  asChild: !0,
2779
2985
  children: /* @__PURE__ */ F("div", {
2780
2986
  className: "flex items-center justify-between gap-4",
2781
2987
  children: [/* @__PURE__ */ P("h4", {
2782
2988
  className: "font-semibold text-sm",
2783
2989
  children: o("editor.inputNodeForm.submitConfiguration")
2784
- }), /* @__PURE__ */ F(p, {
2990
+ }), /* @__PURE__ */ F(k, {
2785
2991
  variant: "ghost",
2786
2992
  size: "icon",
2787
2993
  className: "size-8",
2788
- children: [/* @__PURE__ */ P(Ie, {}), /* @__PURE__ */ P("span", {
2994
+ children: [/* @__PURE__ */ P(We, {}), /* @__PURE__ */ P("span", {
2789
2995
  className: "sr-only",
2790
2996
  children: o("common.toggle")
2791
2997
  })]
2792
2998
  })]
2793
2999
  })
2794
- }), /* @__PURE__ */ P(Wn, {
3000
+ }), /* @__PURE__ */ P(ar, {
2795
3001
  className: "flex flex-col gap-4",
2796
- children: /* @__PURE__ */ P(d, {
3002
+ children: /* @__PURE__ */ P(u, {
2797
3003
  name: "submitConfig",
2798
- children: (e) => /* @__PURE__ */ P(An, {
3004
+ children: (e) => /* @__PURE__ */ P(Kn, {
2799
3005
  value: e.state.value,
2800
3006
  onChange: (t) => {
2801
- e.handleChange(t), u().then();
3007
+ e.handleChange(t), l().then();
2802
3008
  }
2803
3009
  })
2804
3010
  })
2805
3011
  })]
2806
3012
  }),
2807
- n?.data?.type === "file" && /* @__PURE__ */ P(d, {
3013
+ n?.data?.type === "file" && /* @__PURE__ */ P(u, {
2808
3014
  name: "multiple",
2809
3015
  children: (e) => /* @__PURE__ */ F("div", {
2810
3016
  className: "flex items-center space-x-2",
2811
- children: [/* @__PURE__ */ P(y, {
3017
+ children: [/* @__PURE__ */ P(D, {
2812
3018
  id: e.name,
2813
3019
  checked: e.state.value,
2814
3020
  onCheckedChange: (t) => e.handleChange(t)
2815
- }), /* @__PURE__ */ P(l, {
3021
+ }), /* @__PURE__ */ P(d, {
2816
3022
  htmlFor: e.name,
2817
3023
  children: o("editor.inputNodeForm.multipleFiles")
2818
3024
  })]
2819
3025
  })
2820
3026
  }),
2821
- i && /* @__PURE__ */ F(Hn, {
3027
+ i && /* @__PURE__ */ F(rr, {
2822
3028
  defaultOpen: !0,
2823
3029
  className: "flex w-full max-w-[350px] flex-col gap-2",
2824
- children: [/* @__PURE__ */ P(Un, {
3030
+ children: [/* @__PURE__ */ P(ir, {
2825
3031
  asChild: !0,
2826
3032
  children: /* @__PURE__ */ F("div", {
2827
3033
  className: "flex items-center justify-between gap-4",
2828
3034
  children: [/* @__PURE__ */ P("h4", {
2829
3035
  className: "font-semibold text-sm",
2830
3036
  children: o("editor.inputNodeForm.options")
2831
- }), /* @__PURE__ */ F(p, {
3037
+ }), /* @__PURE__ */ F(k, {
2832
3038
  variant: "ghost",
2833
3039
  size: "icon",
2834
3040
  className: "size-8",
2835
- children: [/* @__PURE__ */ P(Ie, {}), /* @__PURE__ */ P("span", {
3041
+ children: [/* @__PURE__ */ P(We, {}), /* @__PURE__ */ P("span", {
2836
3042
  className: "sr-only",
2837
3043
  children: o("common.toggle")
2838
3044
  })]
2839
3045
  })]
2840
3046
  })
2841
- }), /* @__PURE__ */ F(Wn, {
3047
+ }), /* @__PURE__ */ F(ar, {
2842
3048
  className: "flex flex-col gap-4",
2843
3049
  children: [
2844
- /* @__PURE__ */ P(d, {
3050
+ /* @__PURE__ */ P(u, {
2845
3051
  name: "options",
2846
3052
  mode: "array",
2847
3053
  children: (t) => /* @__PURE__ */ F("div", {
@@ -2853,16 +3059,16 @@ var Gn = () => {
2853
3059
  children: [/* @__PURE__ */ F("div", {
2854
3060
  className: "flex items-start gap-2",
2855
3061
  children: [
2856
- n?.data?.type === "radio" && /* @__PURE__ */ P(d, {
3062
+ n?.data?.type === "radio" && /* @__PURE__ */ P(u, {
2857
3063
  name: `options[${i}].image`,
2858
- children: (e) => /* @__PURE__ */ P(Bn, {
3064
+ children: (e) => /* @__PURE__ */ P(nr, {
2859
3065
  value: e.state.value,
2860
3066
  onChange: (t) => e.handleChange(t)
2861
3067
  })
2862
3068
  }),
2863
- /* @__PURE__ */ P(d, {
3069
+ /* @__PURE__ */ P(u, {
2864
3070
  name: `options[${i}].label`,
2865
- children: (t) => /* @__PURE__ */ P(m, {
3071
+ children: (t) => /* @__PURE__ */ P(O, {
2866
3072
  placeholder: o("editor.inputNodeForm.optionLabel"),
2867
3073
  value: t.state.value?.[e] || "",
2868
3074
  onChange: ({ target: n }) => {
@@ -2873,27 +3079,27 @@ var Gn = () => {
2873
3079
  }
2874
3080
  })
2875
3081
  }),
2876
- /* @__PURE__ */ P(d, {
3082
+ /* @__PURE__ */ P(u, {
2877
3083
  name: `options[${i}].value`,
2878
- children: (e) => /* @__PURE__ */ P(m, {
3084
+ children: (e) => /* @__PURE__ */ P(O, {
2879
3085
  placeholder: o("editor.inputNodeForm.optionValue"),
2880
3086
  value: e.state.value || "",
2881
3087
  onChange: ({ target: t }) => e.handleChange(t.value)
2882
3088
  })
2883
3089
  }),
2884
- /* @__PURE__ */ P(p, {
3090
+ /* @__PURE__ */ P(k, {
2885
3091
  type: "button",
2886
3092
  variant: "ghost",
2887
3093
  size: "icon",
2888
3094
  onClick: () => {
2889
- t.removeValue(i), u().then();
3095
+ t.removeValue(i), l().then();
2890
3096
  },
2891
- children: /* @__PURE__ */ P(R, { className: "h-4 w-4" })
3097
+ children: /* @__PURE__ */ P(L, { className: "h-4 w-4" })
2892
3098
  })
2893
3099
  ]
2894
- }), (n?.data?.type === "radio" || n?.data?.type === "checkbox") && /* @__PURE__ */ P(d, {
3100
+ }), (n?.data?.type === "radio" || n?.data?.type === "checkbox") && /* @__PURE__ */ P(u, {
2895
3101
  name: `options[${i}].description`,
2896
- children: (t) => /* @__PURE__ */ P(m, {
3102
+ children: (t) => /* @__PURE__ */ P(O, {
2897
3103
  placeholder: o("editor.inputNodeForm.optionDescription"),
2898
3104
  value: t.state.value?.[e] || "",
2899
3105
  onChange: ({ target: n }) => {
@@ -2905,7 +3111,7 @@ var Gn = () => {
2905
3111
  })
2906
3112
  })]
2907
3113
  }, a);
2908
- }), /* @__PURE__ */ P(p, {
3114
+ }), /* @__PURE__ */ P(k, {
2909
3115
  type: "button",
2910
3116
  variant: "outline",
2911
3117
  size: "sm",
@@ -2913,42 +3119,42 @@ var Gn = () => {
2913
3119
  t.pushValue({
2914
3120
  label: { en: "" },
2915
3121
  value: ""
2916
- }), u().then();
3122
+ }), l().then();
2917
3123
  },
2918
3124
  children: o("editor.inputNodeForm.addOption")
2919
3125
  })]
2920
3126
  })
2921
3127
  }),
2922
- n?.data?.type === "select" && /* @__PURE__ */ P(d, {
3128
+ n?.data?.type === "select" && /* @__PURE__ */ P(u, {
2923
3129
  name: "multiple",
2924
3130
  children: (e) => /* @__PURE__ */ F("div", {
2925
3131
  className: "flex items-center space-x-2",
2926
- children: [/* @__PURE__ */ P(y, {
3132
+ children: [/* @__PURE__ */ P(D, {
2927
3133
  id: e.name,
2928
3134
  checked: e.state.value,
2929
3135
  onCheckedChange: (t) => e.handleChange(t)
2930
- }), /* @__PURE__ */ P(l, {
3136
+ }), /* @__PURE__ */ P(d, {
2931
3137
  htmlFor: e.name,
2932
3138
  children: o("editor.inputNodeForm.multipleSelection")
2933
3139
  })]
2934
3140
  })
2935
3141
  }),
2936
- n?.data?.type === "radio" && /* @__PURE__ */ P(d, {
3142
+ n?.data?.type === "radio" && /* @__PURE__ */ P(u, {
2937
3143
  name: "variant",
2938
- children: (e) => /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
3144
+ children: (e) => /* @__PURE__ */ F(A, { children: [/* @__PURE__ */ P(d, {
2939
3145
  htmlFor: e.name,
2940
3146
  children: o("editor.inputNodeForm.variant")
2941
3147
  }), /* @__PURE__ */ F(g, {
2942
3148
  value: e.state.value || "default",
2943
3149
  onValueChange: (t) => e.handleChange(t),
2944
- children: [/* @__PURE__ */ P(h, {
3150
+ children: [/* @__PURE__ */ P(v, {
2945
3151
  id: e.name,
2946
3152
  className: "w-full",
2947
- children: /* @__PURE__ */ P(c, {})
2948
- }), /* @__PURE__ */ F(A, { children: [/* @__PURE__ */ P(v, {
3153
+ children: /* @__PURE__ */ P(T, {})
3154
+ }), /* @__PURE__ */ F(C, { children: [/* @__PURE__ */ P(h, {
2949
3155
  value: "default",
2950
3156
  children: o("editor.inputNodeForm.variantDefault")
2951
- }), /* @__PURE__ */ P(v, {
3157
+ }), /* @__PURE__ */ P(h, {
2952
3158
  value: "card",
2953
3159
  children: o("editor.inputNodeForm.variantCard")
2954
3160
  })] })]
@@ -2957,62 +3163,62 @@ var Gn = () => {
2957
3163
  ]
2958
3164
  })]
2959
3165
  }),
2960
- !s && /* @__PURE__ */ F(Hn, {
3166
+ !s && /* @__PURE__ */ F(rr, {
2961
3167
  className: "flex w-full max-w-[350px] flex-col gap-2",
2962
- children: [/* @__PURE__ */ P(Un, {
3168
+ children: [/* @__PURE__ */ P(ir, {
2963
3169
  asChild: !0,
2964
3170
  children: /* @__PURE__ */ F("div", {
2965
3171
  className: "flex items-center justify-between gap-4",
2966
3172
  children: [/* @__PURE__ */ P("h4", {
2967
3173
  className: "font-semibold text-sm",
2968
3174
  children: o("editor.inputNodeForm.validation")
2969
- }), /* @__PURE__ */ F(p, {
3175
+ }), /* @__PURE__ */ F(k, {
2970
3176
  variant: "ghost",
2971
3177
  size: "icon",
2972
3178
  className: "size-8",
2973
- children: [/* @__PURE__ */ P(Ie, {}), /* @__PURE__ */ P("span", {
3179
+ children: [/* @__PURE__ */ P(We, {}), /* @__PURE__ */ P("span", {
2974
3180
  className: "sr-only",
2975
3181
  children: o("common.toggle")
2976
3182
  })]
2977
3183
  })]
2978
3184
  })
2979
- }), /* @__PURE__ */ F(Wn, {
3185
+ }), /* @__PURE__ */ F(ar, {
2980
3186
  className: "flex flex-col gap-6",
2981
3187
  children: [
2982
- /* @__PURE__ */ P(d, {
3188
+ /* @__PURE__ */ P(u, {
2983
3189
  name: "required",
2984
- children: (e) => /* @__PURE__ */ P(w, { children: /* @__PURE__ */ F("div", {
3190
+ children: (e) => /* @__PURE__ */ P(A, { children: /* @__PURE__ */ F("div", {
2985
3191
  className: "flex items-center space-x-2",
2986
- children: [/* @__PURE__ */ P(y, {
3192
+ children: [/* @__PURE__ */ P(D, {
2987
3193
  id: e.name,
2988
3194
  checked: e.state.value,
2989
3195
  onCheckedChange: (t) => e.handleChange(t)
2990
- }), /* @__PURE__ */ P(l, {
3196
+ }), /* @__PURE__ */ P(d, {
2991
3197
  htmlFor: e.name,
2992
3198
  children: o("editor.inputNodeForm.required")
2993
3199
  })]
2994
3200
  }) })
2995
3201
  }),
2996
- (n?.data?.type === "date" || n?.data?.type === "daterange") && /* @__PURE__ */ P(d, {
3202
+ (n?.data?.type === "date" || n?.data?.type === "daterange") && /* @__PURE__ */ P(u, {
2997
3203
  name: "disablePast",
2998
- children: (e) => /* @__PURE__ */ P(w, { children: /* @__PURE__ */ F("div", {
3204
+ children: (e) => /* @__PURE__ */ P(A, { children: /* @__PURE__ */ F("div", {
2999
3205
  className: "flex items-center space-x-2",
3000
- children: [/* @__PURE__ */ P(y, {
3206
+ children: [/* @__PURE__ */ P(D, {
3001
3207
  id: e.name,
3002
3208
  checked: e.state.value,
3003
3209
  onCheckedChange: (t) => e.handleChange(t)
3004
- }), /* @__PURE__ */ P(l, {
3210
+ }), /* @__PURE__ */ P(d, {
3005
3211
  htmlFor: e.name,
3006
3212
  children: o("editor.inputNodeForm.disablePast")
3007
3213
  })]
3008
3214
  }) })
3009
3215
  }),
3010
- /* @__PURE__ */ P(d, {
3216
+ /* @__PURE__ */ P(u, {
3011
3217
  name: "pattern",
3012
- children: (e) => /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
3218
+ children: (e) => /* @__PURE__ */ F(A, { children: [/* @__PURE__ */ P(d, {
3013
3219
  htmlFor: e.name,
3014
3220
  children: o("editor.inputNodeForm.pattern")
3015
- }), /* @__PURE__ */ P(Nn, {
3221
+ }), /* @__PURE__ */ P(Yn, {
3016
3222
  id: e.name,
3017
3223
  value: e.state.value,
3018
3224
  onValueChange: e.handleChange
@@ -3020,14 +3226,14 @@ var Gn = () => {
3020
3226
  }),
3021
3227
  /* @__PURE__ */ F("div", {
3022
3228
  className: "flex items-end gap-2",
3023
- children: [/* @__PURE__ */ P(d, {
3229
+ children: [/* @__PURE__ */ P(u, {
3024
3230
  name: "errorMessage",
3025
- children: (t) => /* @__PURE__ */ F(w, {
3231
+ children: (t) => /* @__PURE__ */ F(A, {
3026
3232
  className: "flex-1",
3027
- children: [/* @__PURE__ */ P(l, {
3233
+ children: [/* @__PURE__ */ P(d, {
3028
3234
  htmlFor: t.name,
3029
3235
  children: o("editor.inputNodeForm.errorMessage")
3030
- }), /* @__PURE__ */ P(m, {
3236
+ }), /* @__PURE__ */ P(O, {
3031
3237
  id: t.name,
3032
3238
  name: t.name,
3033
3239
  value: t.state.value?.[e] || "",
@@ -3048,47 +3254,47 @@ var Gn = () => {
3048
3254
  ]
3049
3255
  })]
3050
3256
  }),
3051
- !s && /* @__PURE__ */ F(Hn, {
3257
+ !s && /* @__PURE__ */ F(rr, {
3052
3258
  className: "flex w-full max-w-[350px] flex-col gap-2",
3053
- children: [/* @__PURE__ */ P(Un, {
3259
+ children: [/* @__PURE__ */ P(ir, {
3054
3260
  asChild: !0,
3055
3261
  children: /* @__PURE__ */ F("div", {
3056
3262
  className: "flex items-center justify-between gap-4",
3057
3263
  children: [/* @__PURE__ */ P("h4", {
3058
3264
  className: "font-semibold text-sm",
3059
3265
  children: o("editor.inputNodeForm.advancedConfiguration")
3060
- }), /* @__PURE__ */ F(p, {
3266
+ }), /* @__PURE__ */ F(k, {
3061
3267
  variant: "ghost",
3062
3268
  size: "icon",
3063
3269
  className: "size-8",
3064
- children: [/* @__PURE__ */ P(Ie, {}), /* @__PURE__ */ P("span", {
3270
+ children: [/* @__PURE__ */ P(We, {}), /* @__PURE__ */ P("span", {
3065
3271
  className: "sr-only",
3066
3272
  children: o("common.toggle")
3067
3273
  })]
3068
3274
  })]
3069
3275
  })
3070
- }), /* @__PURE__ */ F(Wn, {
3276
+ }), /* @__PURE__ */ F(ar, {
3071
3277
  className: "flex flex-col gap-6",
3072
- children: [/* @__PURE__ */ P(d, {
3278
+ children: [/* @__PURE__ */ P(u, {
3073
3279
  name: "name",
3074
- children: (e) => /* @__PURE__ */ F(w, { children: [
3075
- /* @__PURE__ */ P(l, {
3280
+ children: (e) => /* @__PURE__ */ F(A, { children: [
3281
+ /* @__PURE__ */ P(d, {
3076
3282
  htmlFor: e.name,
3077
3283
  children: o("editor.inputNodeForm.name")
3078
3284
  }),
3079
- /* @__PURE__ */ P(m, {
3285
+ /* @__PURE__ */ P(O, {
3080
3286
  id: e.name,
3081
3287
  name: e.name,
3082
3288
  value: e.state.value,
3083
3289
  onBlur: e.handleBlur,
3084
3290
  onChange: ({ target: t }) => e.handleChange(t.value)
3085
3291
  }),
3086
- /* @__PURE__ */ P(T, { children: o("editor.inputNodeForm.nameDescription") })
3292
+ /* @__PURE__ */ P(j, { children: o("editor.inputNodeForm.nameDescription") })
3087
3293
  ] })
3088
- }), /* @__PURE__ */ P(d, {
3294
+ }), /* @__PURE__ */ P(u, {
3089
3295
  name: "defaultValue",
3090
3296
  children: (e) => /* @__PURE__ */ F(N, { children: [
3091
- /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
3297
+ /* @__PURE__ */ F(A, { children: [/* @__PURE__ */ P(d, {
3092
3298
  htmlFor: e.name,
3093
3299
  children: o("editor.inputNodeForm.defaultValueType")
3094
3300
  }), /* @__PURE__ */ F(g, {
@@ -3096,32 +3302,32 @@ var Gn = () => {
3096
3302
  onValueChange: (t) => {
3097
3303
  e.handleChange(t === "none" ? null : { type: t });
3098
3304
  },
3099
- children: [/* @__PURE__ */ P(h, {
3305
+ children: [/* @__PURE__ */ P(v, {
3100
3306
  id: e.name,
3101
- children: /* @__PURE__ */ P(c, { placeholder: o("editor.inputNodeForm.selectType") })
3102
- }), /* @__PURE__ */ F(A, { children: [
3103
- /* @__PURE__ */ P(v, {
3307
+ children: /* @__PURE__ */ P(T, { placeholder: o("editor.inputNodeForm.selectType") })
3308
+ }), /* @__PURE__ */ F(C, { children: [
3309
+ /* @__PURE__ */ P(h, {
3104
3310
  value: "none",
3105
3311
  children: o("editor.inputNodeForm.defaultValueTypeNone")
3106
3312
  }),
3107
- /* @__PURE__ */ P(v, {
3313
+ /* @__PURE__ */ P(h, {
3108
3314
  value: "static",
3109
3315
  children: o("editor.inputNodeForm.defaultValueTypeStatic")
3110
3316
  }),
3111
- /* @__PURE__ */ P(v, {
3317
+ /* @__PURE__ */ P(h, {
3112
3318
  value: "reference",
3113
3319
  children: o("editor.inputNodeForm.defaultValueTypeReference")
3114
3320
  })
3115
3321
  ] })]
3116
3322
  })] }),
3117
- e.state.value?.type === "static" && /* @__PURE__ */ P(d, {
3323
+ e.state.value?.type === "static" && /* @__PURE__ */ P(u, {
3118
3324
  name: "defaultValue.staticValue",
3119
3325
  children: (e) => {
3120
3326
  let t = n?.data?.type;
3121
- return (t === "select" || t === "checkbox") && n?.data?.multiple ? /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
3327
+ return (t === "select" || t === "checkbox") && n?.data?.multiple ? /* @__PURE__ */ F(A, { children: [/* @__PURE__ */ P(d, {
3122
3328
  htmlFor: e.name,
3123
3329
  children: o("editor.inputNodeForm.defaultValuesCommaSeparated")
3124
- }), /* @__PURE__ */ P(m, {
3330
+ }), /* @__PURE__ */ P(O, {
3125
3331
  id: e.name,
3126
3332
  placeholder: o("editor.inputNodeForm.defaultValuesPlaceholder"),
3127
3333
  value: Array.isArray(e.state.value) ? e.state.value.join(", ") : "",
@@ -3129,20 +3335,20 @@ var Gn = () => {
3129
3335
  let n = t.value.split(",").map((e) => e.trim()).filter(Boolean);
3130
3336
  e.handleChange(n.length > 0 ? n : null);
3131
3337
  }
3132
- })] }) : t === "checkbox" ? /* @__PURE__ */ P(w, { children: /* @__PURE__ */ F("div", {
3338
+ })] }) : t === "checkbox" ? /* @__PURE__ */ P(A, { children: /* @__PURE__ */ F("div", {
3133
3339
  className: "flex items-center space-x-2",
3134
- children: [/* @__PURE__ */ P(y, {
3340
+ children: [/* @__PURE__ */ P(D, {
3135
3341
  id: e.name,
3136
3342
  checked: !!e.state.value,
3137
3343
  onCheckedChange: (t) => e.handleChange(t)
3138
- }), /* @__PURE__ */ P(l, {
3344
+ }), /* @__PURE__ */ P(d, {
3139
3345
  htmlFor: e.name,
3140
3346
  children: o("editor.inputNodeForm.defaultChecked")
3141
3347
  })]
3142
- }) }) : /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
3348
+ }) }) : /* @__PURE__ */ F(A, { children: [/* @__PURE__ */ P(d, {
3143
3349
  htmlFor: e.name,
3144
3350
  children: o("editor.inputNodeForm.staticValue")
3145
- }), /* @__PURE__ */ P(m, {
3351
+ }), /* @__PURE__ */ P(O, {
3146
3352
  id: e.name,
3147
3353
  placeholder: o("editor.inputNodeForm.staticValuePlaceholder"),
3148
3354
  value: typeof e.state.value == "string" ? e.state.value : "",
@@ -3151,10 +3357,10 @@ var Gn = () => {
3151
3357
  }
3152
3358
  }),
3153
3359
  e.state.value?.type === "reference" && /* @__PURE__ */ F(N, { children: [
3154
- /* @__PURE__ */ P(d, {
3360
+ /* @__PURE__ */ P(u, {
3155
3361
  name: "defaultValue.referenceField",
3156
- children: (e) => /* @__PURE__ */ F(w, { children: [
3157
- /* @__PURE__ */ P(l, {
3362
+ children: (e) => /* @__PURE__ */ F(A, { children: [
3363
+ /* @__PURE__ */ P(d, {
3158
3364
  htmlFor: e.name,
3159
3365
  children: o("editor.inputNodeForm.referenceField")
3160
3366
  }),
@@ -3163,14 +3369,14 @@ var Gn = () => {
3163
3369
  onValueChange: (t) => {
3164
3370
  e.handleChange(t);
3165
3371
  },
3166
- children: [/* @__PURE__ */ P(h, {
3372
+ children: [/* @__PURE__ */ P(v, {
3167
3373
  id: e.name,
3168
- children: /* @__PURE__ */ P(c, { placeholder: o("editor.inputNodeForm.selectReferenceField") })
3169
- }), /* @__PURE__ */ P(A, { children: a.length === 0 ? /* @__PURE__ */ P(v, {
3374
+ children: /* @__PURE__ */ P(T, { placeholder: o("editor.inputNodeForm.selectReferenceField") })
3375
+ }), /* @__PURE__ */ P(C, { children: a.length === 0 ? /* @__PURE__ */ P(h, {
3170
3376
  value: "none",
3171
3377
  disabled: !0,
3172
3378
  children: o("editor.inputNodeForm.noParentFieldsAvailable")
3173
- }) : a.map((e) => /* @__PURE__ */ F(v, {
3379
+ }) : a.map((e) => /* @__PURE__ */ F(h, {
3174
3380
  value: e.nodeId,
3175
3381
  children: [
3176
3382
  e.label,
@@ -3180,13 +3386,13 @@ var Gn = () => {
3180
3386
  ]
3181
3387
  }, e.nodeId)) })]
3182
3388
  }),
3183
- a.length === 0 && /* @__PURE__ */ P(T, { children: o("editor.inputNodeForm.addInputFieldsBeforeReference") })
3389
+ a.length === 0 && /* @__PURE__ */ P(j, { children: o("editor.inputNodeForm.addInputFieldsBeforeReference") })
3184
3390
  ] })
3185
3391
  }),
3186
- /* @__PURE__ */ P(d, {
3392
+ /* @__PURE__ */ P(u, {
3187
3393
  name: "defaultValue.transformFunction",
3188
- children: (t) => /* @__PURE__ */ F(w, { children: [
3189
- /* @__PURE__ */ P(l, {
3394
+ children: (t) => /* @__PURE__ */ F(A, { children: [
3395
+ /* @__PURE__ */ P(d, {
3190
3396
  htmlFor: t.name,
3191
3397
  children: o("editor.inputNodeForm.transformType")
3192
3398
  }),
@@ -3202,52 +3408,52 @@ var Gn = () => {
3202
3408
  });
3203
3409
  }
3204
3410
  },
3205
- children: [/* @__PURE__ */ P(h, {
3411
+ children: [/* @__PURE__ */ P(v, {
3206
3412
  id: t.name,
3207
- children: /* @__PURE__ */ P(c, { placeholder: o("editor.inputNodeForm.selectTransformation") })
3208
- }), /* @__PURE__ */ F(A, { children: [
3209
- /* @__PURE__ */ P(v, {
3413
+ children: /* @__PURE__ */ P(T, { placeholder: o("editor.inputNodeForm.selectTransformation") })
3414
+ }), /* @__PURE__ */ F(C, { children: [
3415
+ /* @__PURE__ */ P(h, {
3210
3416
  value: "none",
3211
3417
  children: o("editor.inputNodeForm.transformNone")
3212
3418
  }),
3213
- /* @__PURE__ */ P(v, {
3419
+ /* @__PURE__ */ P(h, {
3214
3420
  value: "toString",
3215
3421
  children: o("editor.inputNodeForm.transformString")
3216
3422
  }),
3217
- /* @__PURE__ */ P(v, {
3423
+ /* @__PURE__ */ P(h, {
3218
3424
  value: "toNumber",
3219
3425
  children: o("editor.inputNodeForm.transformNumber")
3220
3426
  }),
3221
- /* @__PURE__ */ P(v, {
3427
+ /* @__PURE__ */ P(h, {
3222
3428
  value: "toBoolean",
3223
3429
  children: o("editor.inputNodeForm.transformBoolean")
3224
3430
  }),
3225
- /* @__PURE__ */ P(v, {
3431
+ /* @__PURE__ */ P(h, {
3226
3432
  value: "toArray",
3227
3433
  children: o("editor.inputNodeForm.transformArray")
3228
3434
  }),
3229
- /* @__PURE__ */ P(v, {
3435
+ /* @__PURE__ */ P(h, {
3230
3436
  value: "toObject",
3231
3437
  children: o("editor.inputNodeForm.transformMapToObject")
3232
3438
  })
3233
3439
  ] })]
3234
3440
  }),
3235
- /* @__PURE__ */ P(T, { children: o("editor.inputNodeForm.transformDesc") })
3441
+ /* @__PURE__ */ P(j, { children: o("editor.inputNodeForm.transformDesc") })
3236
3442
  ] })
3237
3443
  }),
3238
- e.state.value?.transformFunction === "toObject" && /* @__PURE__ */ P(d, {
3444
+ e.state.value?.transformFunction === "toObject" && /* @__PURE__ */ P(u, {
3239
3445
  name: "defaultValue.objectMapping",
3240
3446
  mode: "array",
3241
- children: (e) => /* @__PURE__ */ F(w, { children: [
3242
- /* @__PURE__ */ P(l, { children: o("editor.inputNodeForm.objectMapping") }),
3447
+ children: (e) => /* @__PURE__ */ F(A, { children: [
3448
+ /* @__PURE__ */ P(d, { children: o("editor.inputNodeForm.objectMapping") }),
3243
3449
  /* @__PURE__ */ F("div", {
3244
3450
  className: "space-y-2",
3245
3451
  children: [e.state.value?.map((t, n) => /* @__PURE__ */ F("div", {
3246
3452
  className: "flex items-center gap-2",
3247
3453
  children: [
3248
- /* @__PURE__ */ P(d, {
3454
+ /* @__PURE__ */ P(u, {
3249
3455
  name: `defaultValue.objectMapping[${n}].sourceKey`,
3250
- children: (e) => /* @__PURE__ */ P(m, {
3456
+ children: (e) => /* @__PURE__ */ P(O, {
3251
3457
  placeholder: o("editor.inputNodeForm.sourceKey"),
3252
3458
  value: e.state.value || "",
3253
3459
  onChange: ({ target: t }) => e.handleChange(t.value)
@@ -3257,25 +3463,25 @@ var Gn = () => {
3257
3463
  className: "text-muted-foreground",
3258
3464
  children: "→"
3259
3465
  }),
3260
- /* @__PURE__ */ P(d, {
3466
+ /* @__PURE__ */ P(u, {
3261
3467
  name: `defaultValue.objectMapping[${n}].targetKey`,
3262
- children: (e) => /* @__PURE__ */ P(m, {
3468
+ children: (e) => /* @__PURE__ */ P(O, {
3263
3469
  placeholder: o("editor.inputNodeForm.targetKey"),
3264
3470
  value: e.state.value || "",
3265
3471
  onChange: ({ target: t }) => e.handleChange(t.value)
3266
3472
  })
3267
3473
  }),
3268
- /* @__PURE__ */ P(p, {
3474
+ /* @__PURE__ */ P(k, {
3269
3475
  type: "button",
3270
3476
  variant: "ghost",
3271
3477
  size: "icon",
3272
3478
  onClick: () => {
3273
- e.removeValue(n), u().then();
3479
+ e.removeValue(n), l().then();
3274
3480
  },
3275
- children: /* @__PURE__ */ P(R, { className: "h-4 w-4" })
3481
+ children: /* @__PURE__ */ P(L, { className: "h-4 w-4" })
3276
3482
  })
3277
3483
  ]
3278
- }, `mapping-${n}`)), /* @__PURE__ */ F(p, {
3484
+ }, `mapping-${n}`)), /* @__PURE__ */ F(k, {
3279
3485
  type: "button",
3280
3486
  variant: "outline",
3281
3487
  size: "sm",
@@ -3284,12 +3490,12 @@ var Gn = () => {
3284
3490
  e.pushValue({
3285
3491
  sourceKey: "",
3286
3492
  targetKey: ""
3287
- }), u().then();
3493
+ }), l().then();
3288
3494
  },
3289
- children: [/* @__PURE__ */ P(L, { className: "mr-2 h-4 w-4" }), o("editor.inputNodeForm.addMapping")]
3495
+ children: [/* @__PURE__ */ P(I, { className: "mr-2 h-4 w-4" }), o("editor.inputNodeForm.addMapping")]
3290
3496
  })]
3291
3497
  }),
3292
- /* @__PURE__ */ P(T, { children: o("editor.inputNodeForm.objectMappingDesc") })
3498
+ /* @__PURE__ */ P(j, { children: o("editor.inputNodeForm.objectMappingDesc") })
3293
3499
  ] })
3294
3500
  })
3295
3501
  ] })
@@ -3300,12 +3506,9 @@ var Gn = () => {
3300
3506
  ]
3301
3507
  })
3302
3508
  });
3303
- }, Kn = () => {
3304
- let [e, t] = B("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = q(), { Field: i } = I({
3305
- defaultValues: {
3306
- label: n?.data?.label || { en: "" },
3307
- type: n?.data?.type || ""
3308
- },
3509
+ }, sr = () => {
3510
+ let [e, t] = z("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = W(), { Field: i } = Pe({
3511
+ defaultValues: { label: n?.data?.label || { en: "" } },
3309
3512
  listeners: {
3310
3513
  onChange: ({ formApi: e }) => {
3311
3514
  e.handleSubmit().then();
@@ -3320,18 +3523,18 @@ var Gn = () => {
3320
3523
  onSubmit: (e) => {
3321
3524
  e.preventDefault(), e.stopPropagation();
3322
3525
  },
3323
- children: /* @__PURE__ */ F("div", {
3526
+ children: /* @__PURE__ */ P("div", {
3324
3527
  className: "grid gap-6",
3325
- children: [/* @__PURE__ */ F("div", {
3528
+ children: /* @__PURE__ */ F("div", {
3326
3529
  className: "flex items-end gap-2",
3327
3530
  children: [/* @__PURE__ */ P(i, {
3328
3531
  name: "label",
3329
- children: (t) => /* @__PURE__ */ F(w, {
3532
+ children: (t) => /* @__PURE__ */ F(A, {
3330
3533
  className: "flex-1",
3331
- children: [/* @__PURE__ */ P(l, {
3534
+ children: [/* @__PURE__ */ P(d, {
3332
3535
  htmlFor: t.name,
3333
3536
  children: "Label"
3334
- }), /* @__PURE__ */ P(m, {
3537
+ }), /* @__PURE__ */ P(O, {
3335
3538
  id: t.name,
3336
3539
  name: t.name,
3337
3540
  value: t.state.value?.[e] || "",
@@ -3348,33 +3551,13 @@ var Gn = () => {
3348
3551
  value: e,
3349
3552
  onValueChange: t
3350
3553
  })]
3351
- }), /* @__PURE__ */ P(i, {
3352
- name: "type",
3353
- children: (e) => /* @__PURE__ */ F(j, { children: [/* @__PURE__ */ P(ce, {
3354
- htmlFor: e.name,
3355
- children: "Type"
3356
- }), /* @__PURE__ */ F(g, {
3357
- value: e.state.value,
3358
- onValueChange: (t) => e.handleChange(t),
3359
- children: [/* @__PURE__ */ P(h, {
3360
- id: e.name,
3361
- className: "w-full",
3362
- children: /* @__PURE__ */ P(c, { placeholder: "" })
3363
- }), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ F(j, { children: [/* @__PURE__ */ P(v, {
3364
- value: Zt.title,
3365
- children: "Title"
3366
- }), /* @__PURE__ */ P(v, {
3367
- value: Zt.divider,
3368
- children: "Divider"
3369
- })] }) })]
3370
- })] })
3371
- })]
3554
+ })
3372
3555
  })
3373
3556
  });
3374
- }, qn = () => {
3375
- let [e, t] = B(""), [n, r] = B(!1), { selectedNode: a, groupNodes: o } = $(), { setNodes: s } = M(), d = a?.parentId || "none", f = i(a), _ = G(), y = vt(), b = vt();
3376
- if (f) return null;
3377
- let x = (e) => {
3557
+ }, cr = () => {
3558
+ let [e, t] = z(""), [r, i] = z(!1), { selectedNode: a, groupNodes: o } = $(), { setNodes: s } = M(), c = a?.parentId || "none", l = n(a), u = U(), f = Ot(), p = Ot();
3559
+ if (l) return null;
3560
+ let m = (e) => {
3378
3561
  a && s((t) => e === "none" ? t.map((e) => {
3379
3562
  if (e.id === a.id) {
3380
3563
  let { parentId: t, extent: n, ...r } = e;
@@ -3390,16 +3573,16 @@ var Gn = () => {
3390
3573
  y: 80
3391
3574
  }
3392
3575
  } : t) : t);
3393
- }, S = () => {
3576
+ }, _ = () => {
3394
3577
  if (!(e.trim() && a)) return;
3395
3578
  if (o.find((t) => {
3396
3579
  let n = t.data?.label?.en || t.data?.label;
3397
3580
  return String(n).toLowerCase() === e.trim().toLowerCase();
3398
3581
  })) {
3399
- U.error("This group already exists", { description: "Use the selector to add the node to an existing group." });
3582
+ V.error("This group already exists", { description: "Use the selector to add the node to an existing group." });
3400
3583
  return;
3401
3584
  }
3402
- let n = Jt();
3585
+ let n = Zt();
3403
3586
  s((t) => [{
3404
3587
  data: { label: { en: e.trim() } },
3405
3588
  id: n,
@@ -3420,41 +3603,41 @@ var Gn = () => {
3420
3603
  x: 175,
3421
3604
  y: 30
3422
3605
  }
3423
- } : e)]), t(""), r(!1), U.success("Group created", { description: `The group "${e.trim()}" has been created successfully.` });
3606
+ } : e)]), t(""), i(!1), V.success("Group created", { description: `The group "${e.trim()}" has been created successfully.` });
3424
3607
  };
3425
3608
  return /* @__PURE__ */ F("div", {
3426
3609
  className: "space-y-2",
3427
- children: [/* @__PURE__ */ P(l, {
3428
- htmlFor: y,
3429
- children: _("editor.selectNodeGroup.group")
3610
+ children: [/* @__PURE__ */ P(d, {
3611
+ htmlFor: f,
3612
+ children: u("editor.selectNodeGroup.group")
3430
3613
  }), /* @__PURE__ */ F("div", {
3431
3614
  className: "flex gap-2",
3432
3615
  children: [/* @__PURE__ */ F(g, {
3433
- value: d,
3434
- onValueChange: x,
3435
- children: [/* @__PURE__ */ P(h, {
3436
- id: y,
3616
+ value: c,
3617
+ onValueChange: m,
3618
+ children: [/* @__PURE__ */ P(v, {
3619
+ id: f,
3437
3620
  className: "flex-1",
3438
- children: /* @__PURE__ */ P(c, { placeholder: _("editor.selectNodeGroup.noGroup") })
3439
- }), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ F(j, { children: [/* @__PURE__ */ P(v, {
3621
+ children: /* @__PURE__ */ P(T, { placeholder: u("editor.selectNodeGroup.noGroup") })
3622
+ }), /* @__PURE__ */ P(C, { children: /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(h, {
3440
3623
  value: "none",
3441
- children: _("editor.selectNodeGroup.noGroup")
3442
- }), o.map((e) => /* @__PURE__ */ P(v, {
3624
+ children: u("editor.selectNodeGroup.noGroup")
3625
+ }), o.map((e) => /* @__PURE__ */ P(h, {
3443
3626
  value: e.id,
3444
3627
  children: e.data.label?.en ? String(e.data.label?.en) : e.id
3445
3628
  }, e.id))] }) })]
3446
- }), /* @__PURE__ */ F(se, {
3447
- open: n,
3448
- onOpenChange: r,
3449
- children: [/* @__PURE__ */ P(u, {
3629
+ }), /* @__PURE__ */ F(ie, {
3630
+ open: r,
3631
+ onOpenChange: i,
3632
+ children: [/* @__PURE__ */ P(ne, {
3450
3633
  asChild: !0,
3451
- children: /* @__PURE__ */ P(p, {
3634
+ children: /* @__PURE__ */ P(k, {
3452
3635
  variant: "outline",
3453
3636
  size: "icon",
3454
3637
  title: "Create a new group",
3455
- children: /* @__PURE__ */ P(tt, { className: "h-4 w-4" })
3638
+ children: /* @__PURE__ */ P(dt, { className: "h-4 w-4" })
3456
3639
  })
3457
- }), /* @__PURE__ */ P(ee, {
3640
+ }), /* @__PURE__ */ P(ae, {
3458
3641
  className: "w-80",
3459
3642
  align: "end",
3460
3643
  disablePortal: !0,
@@ -3465,38 +3648,38 @@ var Gn = () => {
3465
3648
  className: "space-y-2",
3466
3649
  children: [/* @__PURE__ */ P("h4", {
3467
3650
  className: "font-medium leading-none",
3468
- children: _("editor.selectNodeGroup.newGroup")
3651
+ children: u("editor.selectNodeGroup.newGroup")
3469
3652
  }), /* @__PURE__ */ P("p", {
3470
3653
  className: "text-muted-foreground text-sm",
3471
- children: _("editor.selectNodeGroup.newGroupDescription")
3654
+ children: u("editor.selectNodeGroup.newGroupDescription")
3472
3655
  })]
3473
3656
  }),
3474
3657
  /* @__PURE__ */ F("div", {
3475
3658
  className: "space-y-2",
3476
- children: [/* @__PURE__ */ P(l, {
3477
- htmlFor: b,
3478
- children: _("editor.selectNodeGroup.groupName")
3479
- }), /* @__PURE__ */ P(m, {
3659
+ children: [/* @__PURE__ */ P(d, {
3660
+ htmlFor: p,
3661
+ children: u("editor.selectNodeGroup.groupName")
3662
+ }), /* @__PURE__ */ P(O, {
3480
3663
  autoFocus: !0,
3481
- id: b,
3664
+ id: p,
3482
3665
  value: e,
3483
3666
  onChange: (e) => t(e.target.value),
3484
3667
  placeholder: "Ex: Step 1 - Personal info",
3485
3668
  onKeyDown: (e) => {
3486
- e.key === "Enter" && (e.preventDefault(), S());
3669
+ e.key === "Enter" && (e.preventDefault(), _());
3487
3670
  }
3488
3671
  })]
3489
3672
  }),
3490
3673
  /* @__PURE__ */ F("div", {
3491
3674
  className: "flex justify-end gap-2",
3492
- children: [/* @__PURE__ */ P(p, {
3675
+ children: [/* @__PURE__ */ P(k, {
3493
3676
  variant: "outline",
3494
3677
  size: "sm",
3495
- onClick: () => r(!1),
3678
+ onClick: () => i(!1),
3496
3679
  children: "Cancel"
3497
- }), /* @__PURE__ */ P(p, {
3680
+ }), /* @__PURE__ */ P(k, {
3498
3681
  size: "sm",
3499
- onClick: S,
3682
+ onClick: _,
3500
3683
  disabled: !e.trim(),
3501
3684
  children: "Create"
3502
3685
  })]
@@ -3507,145 +3690,187 @@ var Gn = () => {
3507
3690
  })]
3508
3691
  })]
3509
3692
  });
3510
- }, Jn = () => {
3511
- let { selectedNode: e } = $(), { updateSelectedNodeType: t } = q(), n = e?.type || "", r = i(e), a = G(), o = vt();
3512
- return /* @__PURE__ */ F(j, { children: [/* @__PURE__ */ P(ce, {
3513
- htmlFor: o,
3514
- children: a("editor.selectNodeType.nodeType")
3693
+ }, lr = Object.values(X), ur = Object.values(ln), dr = () => {
3694
+ let { selectedNode: e } = $(), { updateSelectedNodeType: t } = W(), { getEdges: a } = M(), { openNodeTypeChangeConfirmation: o } = H(), s = n(e), c = U(), u = Ot(), d = Z(l.flow), f = () => e ? r(e) || i(e) ? e.data?.type || "" : e.type || "" : "", p = (n, r) => {
3695
+ if (!e) return;
3696
+ let i = a().filter((t) => t.source === e.id).length;
3697
+ if ((n === l.ui || n === l.flow) && i > 1) {
3698
+ o({
3699
+ nodeId: e.id,
3700
+ subType: r,
3701
+ type: n
3702
+ });
3703
+ return;
3704
+ }
3705
+ t(n, r);
3706
+ };
3707
+ return /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(y, {
3708
+ htmlFor: u,
3709
+ children: c("editor.selectNodeType.nodeType")
3515
3710
  }), /* @__PURE__ */ F(g, {
3516
- value: n,
3517
- onValueChange: (e) => t(e),
3518
- disabled: r,
3519
- children: [/* @__PURE__ */ P(h, {
3520
- className: "w-full",
3521
- id: o,
3522
- children: /* @__PURE__ */ P(c, { placeholder: a("editor.selectNodeType.nodeType") })
3523
- }), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ P(j, { children: Object.keys(un).filter((e) => r ? e === "group" : e !== "group").map((e) => /* @__PURE__ */ P(v, {
3524
- value: e,
3525
- children: a(`editor.selectNodeType.options.${e}`)
3526
- }, e)) }) })]
3711
+ value: f(),
3712
+ onValueChange: (e) => {
3713
+ if (lr.includes(e)) {
3714
+ p(l.input, e);
3715
+ return;
3716
+ }
3717
+ if (ur.includes(e)) {
3718
+ p(l.ui, e);
3719
+ return;
3720
+ }
3721
+ p(e);
3722
+ },
3723
+ disabled: s,
3724
+ children: [/* @__PURE__ */ P(v, {
3725
+ className: "w-full capitalize",
3726
+ id: u,
3727
+ children: /* @__PURE__ */ P(T, { placeholder: c("editor.selectNodeType.nodeType") })
3728
+ }), /* @__PURE__ */ P(C, {
3729
+ className: "treege-scrollbar max-h-80",
3730
+ children: s ? /* @__PURE__ */ P(w, { children: /* @__PURE__ */ P(h, {
3731
+ value: l.group,
3732
+ children: c("editor.selectNodeType.options.group")
3733
+ }) }) : /* @__PURE__ */ F(N, { children: [
3734
+ /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(y, { children: c("editor.selectNodeType.options.input") }), lr.map((e) => /* @__PURE__ */ F(h, {
3735
+ value: e,
3736
+ className: "capitalize",
3737
+ children: [/* @__PURE__ */ P(Z(e), {}), e]
3738
+ }, e))] }),
3739
+ /* @__PURE__ */ P(de, {}),
3740
+ /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(y, { children: c("editor.selectNodeType.options.ui") }), ur.map((e) => /* @__PURE__ */ F(h, {
3741
+ value: e,
3742
+ className: "capitalize",
3743
+ children: [/* @__PURE__ */ P(Z(e), {}), e]
3744
+ }, e))] }),
3745
+ /* @__PURE__ */ P(de, {}),
3746
+ /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(y, { children: c("common.other") }), /* @__PURE__ */ F(h, {
3747
+ value: l.flow,
3748
+ children: [/* @__PURE__ */ P(d, {}), c("editor.selectNodeType.options.flow")]
3749
+ })] })
3750
+ ] })
3751
+ })]
3527
3752
  })] });
3528
3753
  };
3529
3754
  //#endregion
3530
3755
  //#region src/shared/components/ui/sheet.tsx
3531
- function Yn({ ...e }) {
3532
- return /* @__PURE__ */ P(H.Root, {
3756
+ function fr({ ...e }) {
3757
+ return /* @__PURE__ */ P(Pt.Root, {
3533
3758
  "data-slot": "sheet",
3534
3759
  ...e
3535
3760
  });
3536
3761
  }
3537
- function Xn({ ...e }) {
3538
- return /* @__PURE__ */ P(H.Portal, {
3762
+ function pr({ ...e }) {
3763
+ return /* @__PURE__ */ P(Pt.Portal, {
3539
3764
  "data-slot": "sheet-portal",
3540
3765
  ...e
3541
3766
  });
3542
3767
  }
3543
- function Zn({ className: e, ...t }) {
3544
- return /* @__PURE__ */ P(H.Overlay, {
3768
+ function mr({ className: e, ...t }) {
3769
+ return /* @__PURE__ */ P(Pt.Overlay, {
3545
3770
  "data-slot": "sheet-overlay",
3546
- className: d("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in", e),
3771
+ className: E("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in", e),
3547
3772
  ...t
3548
3773
  });
3549
3774
  }
3550
- function Qn({ className: e, children: t, side: n = "right", ...r }) {
3551
- return /* @__PURE__ */ F(Xn, { children: [/* @__PURE__ */ P(Zn, {}), /* @__PURE__ */ F(H.Content, {
3775
+ function hr({ className: e, children: t, side: n = "right", ...r }) {
3776
+ return /* @__PURE__ */ F(pr, { children: [/* @__PURE__ */ P(mr, {}), /* @__PURE__ */ F(Pt.Content, {
3552
3777
  "data-slot": "sheet-content",
3553
- className: d("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:duration-300 data-[state=open]:duration-500", n === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm", n === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm", n === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b", n === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t", e),
3778
+ className: E("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:duration-300 data-[state=open]:duration-500", n === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm", n === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm", n === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b", n === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t", e),
3554
3779
  ...r,
3555
- children: [t, /* @__PURE__ */ F(H.Close, {
3780
+ children: [t, /* @__PURE__ */ F(Pt.Close, {
3556
3781
  className: "absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",
3557
- children: [/* @__PURE__ */ P(pt, { className: "size-4" }), /* @__PURE__ */ P("span", {
3782
+ children: [/* @__PURE__ */ P(Ct, { className: "size-4" }), /* @__PURE__ */ P("span", {
3558
3783
  className: "sr-only",
3559
3784
  children: "Close"
3560
3785
  })]
3561
3786
  })]
3562
3787
  })] });
3563
3788
  }
3564
- function $n({ className: e, ...t }) {
3789
+ function gr({ className: e, ...t }) {
3565
3790
  return /* @__PURE__ */ P("div", {
3566
3791
  "data-slot": "sheet-header",
3567
- className: d("flex flex-col gap-1.5 p-4", e),
3792
+ className: E("flex flex-col gap-1.5 p-4", e),
3568
3793
  ...t
3569
3794
  });
3570
3795
  }
3571
- function er({ className: e, ...t }) {
3796
+ function _r({ className: e, ...t }) {
3572
3797
  return /* @__PURE__ */ P("div", {
3573
3798
  "data-slot": "sheet-footer",
3574
- className: d("mt-auto flex flex-col gap-2 p-4", e),
3799
+ className: E("mt-auto flex flex-col gap-2 p-4", e),
3575
3800
  ...t
3576
3801
  });
3577
3802
  }
3578
- function tr({ className: e, ...t }) {
3579
- return /* @__PURE__ */ P(H.Title, {
3803
+ function vr({ className: e, ...t }) {
3804
+ return /* @__PURE__ */ P(Pt.Title, {
3580
3805
  "data-slot": "sheet-title",
3581
- className: d("font-semibold text-foreground", e),
3806
+ className: E("font-semibold text-foreground", e),
3582
3807
  ...t
3583
3808
  });
3584
3809
  }
3585
- function nr({ className: e, ...t }) {
3586
- return /* @__PURE__ */ P(H.Description, {
3810
+ function yr({ className: e, ...t }) {
3811
+ return /* @__PURE__ */ P(Pt.Description, {
3587
3812
  "data-slot": "sheet-description",
3588
- className: d("text-muted-foreground text-sm", e),
3813
+ className: E("text-muted-foreground text-sm", e),
3589
3814
  ...t
3590
3815
  });
3591
3816
  }
3592
3817
  //#endregion
3593
3818
  //#region src/editor/features/TreegeEditor/sheets/NodeActionsSheet.tsx
3594
- var rr = () => {
3595
- let { selectedNode: e } = $(), { clearSelection: r } = q(), { isNodeSheetOpen: a, setIsNodeSheetOpen: o, openDeleteNodeConfirmation: c } = W(), l = G(), u = l(e?.data?.label), d = () => {
3596
- o(!1), r();
3819
+ var br = () => {
3820
+ let { selectedNode: e } = $(), { clearSelection: t } = W(), { isNodeSheetOpen: a, setIsNodeSheetOpen: s, openDeleteNodeConfirmation: c } = H(), l = U(), u = l(e?.data?.label), d = () => {
3821
+ s(!1), t();
3597
3822
  };
3598
- return /* @__PURE__ */ P(Yn, {
3823
+ return /* @__PURE__ */ P(fr, {
3599
3824
  open: a && !!e,
3600
3825
  onOpenChange: (e) => {
3601
3826
  e || d();
3602
3827
  },
3603
- children: /* @__PURE__ */ F(Qn, {
3828
+ children: /* @__PURE__ */ F(hr, {
3604
3829
  className: "flex flex-col gap-0",
3605
3830
  children: [
3606
- /* @__PURE__ */ F($n, { children: [/* @__PURE__ */ F(tr, { children: [
3831
+ /* @__PURE__ */ F(gr, { children: [/* @__PURE__ */ F(vr, { children: [
3607
3832
  l("editor.nodeActionsSheet.editNode"),
3608
3833
  " ",
3609
3834
  /* @__PURE__ */ P("span", {
3610
3835
  className: "font-light text-muted-foreground text-xs",
3611
3836
  children: e?.id
3612
3837
  })
3613
- ] }), /* @__PURE__ */ P(nr, { children: u || "\xA0" })] }),
3614
- /* @__PURE__ */ P(Pt, {
3838
+ ] }), /* @__PURE__ */ P(yr, { children: u || "\xA0" })] }),
3839
+ /* @__PURE__ */ P(Gt, {
3615
3840
  className: "flex min-h-0 flex-1 flex-col px-4",
3616
3841
  children: /* @__PURE__ */ F("div", {
3617
3842
  className: "space-y-6 py-4",
3618
3843
  children: [
3619
- /* @__PURE__ */ P(Jn, {}),
3620
- /* @__PURE__ */ P(qn, {}),
3621
- /* @__PURE__ */ P(oe, {}),
3622
- s(e) && /* @__PURE__ */ P(Gn, {}),
3623
- n(e) && /* @__PURE__ */ P(Kn, {}),
3624
- t(e) && /* @__PURE__ */ P(Tn, {}),
3625
- i(e) && /* @__PURE__ */ P(En, {})
3844
+ /* @__PURE__ */ P(dr, {}),
3845
+ /* @__PURE__ */ P(cr, {}),
3846
+ /* @__PURE__ */ P(ue, {}),
3847
+ r(e) && /* @__PURE__ */ P(or, {}),
3848
+ i(e) && /* @__PURE__ */ P(sr, {}),
3849
+ o(e) && /* @__PURE__ */ P(Vn, {}),
3850
+ n(e) && /* @__PURE__ */ P(Hn, {})
3626
3851
  ]
3627
3852
  })
3628
3853
  }),
3629
- /* @__PURE__ */ P(er, {
3854
+ /* @__PURE__ */ P(_r, {
3630
3855
  className: "flex items-end border-t",
3631
- children: /* @__PURE__ */ P(p, {
3856
+ children: /* @__PURE__ */ P(k, {
3632
3857
  variant: "ghost",
3633
3858
  size: "icon",
3634
3859
  onClick: () => {
3635
3860
  e && c(e.id);
3636
3861
  },
3637
3862
  "aria-label": l("editor.nodeActionsSheet.deleteNode"),
3638
- children: /* @__PURE__ */ P(ct, {})
3863
+ children: /* @__PURE__ */ P(vt, {})
3639
3864
  })
3640
3865
  })
3641
3866
  ]
3642
3867
  })
3643
3868
  });
3644
- }, ir = 200, ar = 100, or = (e) => !!(e.measured?.width && e.measured?.height), sr = (e, t, n) => {
3869
+ }, xr = 200, Sr = 100, Cr = (e) => !!(e.measured?.width && e.measured?.height), wr = (e, t, n) => {
3645
3870
  let r = n === "TB" ? "y" : "x";
3646
3871
  return e.reduce((e, n) => t.node(n.id)[r] < t.node(e.id)[r] ? n : e, e[0]);
3647
- }, cr = (e, t, n) => {
3648
- let r = new Et.graphlib.Graph().setDefaultEdgeLabel(() => ({}));
3872
+ }, Tr = (e, t, n) => {
3873
+ let r = new Lt.graphlib.Graph().setDefaultEdgeLabel(() => ({}));
3649
3874
  r.setGraph({
3650
3875
  nodesep: n.horizontalSpacing,
3651
3876
  rankdir: n.direction,
@@ -3654,35 +3879,35 @@ var rr = () => {
3654
3879
  let i = /* @__PURE__ */ new Set();
3655
3880
  e.forEach((e) => {
3656
3881
  i.add(e.id), r.setNode(e.id, {
3657
- height: e.measured?.height ?? ar,
3658
- width: e.measured?.width ?? ir
3882
+ height: e.measured?.height ?? Sr,
3883
+ width: e.measured?.width ?? xr
3659
3884
  });
3660
3885
  }), t.forEach((e) => {
3661
3886
  i.has(e.source) && i.has(e.target) && r.setEdge(e.source, e.target);
3662
- }), Et.layout(r);
3663
- let a = sr(e, r, n.direction), o = a.measured?.width ?? ir, s = a.measured?.height ?? ar, 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();
3887
+ }), Lt.layout(r);
3888
+ let a = wr(e, r, n.direction), o = a.measured?.width ?? xr, s = a.measured?.height ?? Sr, 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();
3664
3889
  return e.forEach((e) => {
3665
- let { x: t, y: n } = r.node(e.id), i = e.measured?.width ?? ir, a = e.measured?.height ?? ar;
3890
+ let { x: t, y: n } = r.node(e.id), i = e.measured?.width ?? xr, a = e.measured?.height ?? Sr;
3666
3891
  d.set(e.id, {
3667
3892
  x: t - i / 2 + l,
3668
3893
  y: n - a / 2 + u
3669
3894
  });
3670
3895
  }), d;
3671
- }, lr = (e) => {
3896
+ }, Er = (e) => {
3672
3897
  let t = /* @__PURE__ */ new Map();
3673
3898
  return e.forEach((e) => {
3674
3899
  let n = t.get(e.parentId) ?? [];
3675
3900
  n.push(e), t.set(e.parentId, n);
3676
3901
  }), t;
3677
- }, ur = (e, t, n = {}) => {
3902
+ }, Dr = (e, t, n = {}) => {
3678
3903
  let r = {
3679
3904
  direction: n.direction ?? "TB",
3680
3905
  horizontalSpacing: n.horizontalSpacing ?? 60,
3681
3906
  verticalSpacing: n.verticalSpacing ?? 80
3682
3907
  }, i = /* @__PURE__ */ new Map();
3683
- return lr(e).forEach((e) => {
3684
- let n = e.filter(or);
3685
- n.length !== 0 && cr(n, t, r).forEach((e, t) => {
3908
+ return Er(e).forEach((e) => {
3909
+ let n = e.filter(Cr);
3910
+ n.length !== 0 && Tr(n, t, r).forEach((e, t) => {
3686
3911
  i.set(t, e);
3687
3912
  });
3688
3913
  }), e.map((e) => {
@@ -3692,10 +3917,10 @@ var rr = () => {
3692
3917
  position: t
3693
3918
  } : e;
3694
3919
  });
3695
- }, dr = (e) => Array.from(e.nodeLookup.values()).map((e) => `${e.id}:${e.measured?.width ?? 0}x${e.measured?.height ?? 0}`).join("|"), fr = ({ direction: e, horizontalSpacing: t, verticalSpacing: n } = {}) => {
3696
- let { getNodes: r, getEdges: i, setNodes: a } = M(), o = Te(), s = Ee(dr);
3697
- _t(() => {
3698
- o && s && a(ur(r(), i(), {
3920
+ }, Or = (e) => Array.from(e.nodeLookup.values()).map((e) => `${e.id}:${e.measured?.width ?? 0}x${e.measured?.height ?? 0}`).join("|"), kr = ({ direction: e, horizontalSpacing: t, verticalSpacing: n } = {}) => {
3921
+ let { getNodes: r, getEdges: i, setNodes: a } = M(), o = Me(), s = Ne(Or);
3922
+ Dt(() => {
3923
+ o && s && a(Dr(r(), i(), {
3699
3924
  direction: e,
3700
3925
  horizontalSpacing: t,
3701
3926
  verticalSpacing: n
@@ -3710,9 +3935,9 @@ var rr = () => {
3710
3935
  i,
3711
3936
  a
3712
3937
  ]);
3713
- }, pr = ({ ...e }) => {
3714
- let { theme: t = "system" } = Dt();
3715
- return /* @__PURE__ */ P(wt, {
3938
+ }, Ar = ({ ...e }) => {
3939
+ let { theme: t = "system" } = Rt();
3940
+ return /* @__PURE__ */ P(Ft, {
3716
3941
  theme: t,
3717
3942
  className: "toaster group",
3718
3943
  style: {
@@ -3722,48 +3947,49 @@ var rr = () => {
3722
3947
  },
3723
3948
  ...e
3724
3949
  });
3725
- }, mr = ({ flow: e, onExportJson: t, onSave: n, theme: r, className: i }) => {
3726
- let { onConnect: a, onConnectEnd: o, onEdgesDelete: s, isValidConnection: c } = Xt();
3727
- return fr(), /* @__PURE__ */ F(ye, {
3950
+ }, jr = ({ flow: e, onExportJson: t, onSave: n, theme: r, className: i }) => {
3951
+ let { onConnect: a, onConnectEnd: o, onEdgesDelete: s, isValidConnection: c } = cn();
3952
+ return kr(), /* @__PURE__ */ F(Ee, {
3728
3953
  fitView: !0,
3729
3954
  colorMode: r,
3730
3955
  selectNodesOnDrag: !1,
3731
- nodeTypes: un,
3732
- edgeTypes: Lt,
3956
+ nodeTypes: Cn,
3957
+ edgeTypes: Yt,
3733
3958
  defaultEdges: e?.edges || [],
3734
3959
  defaultNodes: e?.nodes || [],
3735
3960
  onConnect: a,
3736
3961
  onConnectEnd: o,
3737
3962
  onEdgesDelete: s,
3738
3963
  isValidConnection: c,
3739
- className: d(i, "treege"),
3964
+ className: E(i, "treege"),
3740
3965
  children: [
3741
- /* @__PURE__ */ P(le, {
3966
+ /* @__PURE__ */ P(ge, {
3742
3967
  gap: 10,
3743
- variant: ue.Dots
3968
+ variant: _e.Dots
3744
3969
  }),
3745
- /* @__PURE__ */ P(Cn, {
3970
+ /* @__PURE__ */ P(zn, {
3746
3971
  onExportJson: t,
3747
3972
  onSave: n
3748
3973
  }),
3749
- /* @__PURE__ */ P(At, { theme: r }),
3750
- /* @__PURE__ */ P(he, {}),
3751
- /* @__PURE__ */ P(fe, {}),
3752
- /* @__PURE__ */ P(rr, {}),
3753
- /* @__PURE__ */ P(dn, {})
3974
+ /* @__PURE__ */ P(Vt, { theme: r }),
3975
+ /* @__PURE__ */ P(Se, {}),
3976
+ /* @__PURE__ */ P(ye, {}),
3977
+ /* @__PURE__ */ P(br, {}),
3978
+ /* @__PURE__ */ P(Dn, {}),
3979
+ /* @__PURE__ */ P(En, {})
3754
3980
  ]
3755
3981
  });
3756
- }, hr = ({ flow: e, onExportJson: t, onSave: n, theme: r = "dark", language: i = "en", aiConfig: a }) => /* @__PURE__ */ P(o, {
3982
+ }, Mr = ({ flow: e, onExportJson: t, onSave: n, theme: r = "dark", language: i = "en", aiConfig: a }) => /* @__PURE__ */ P(u, {
3757
3983
  defaultTheme: r,
3758
3984
  storageKey: "treege-editor-theme",
3759
3985
  theme: r,
3760
- children: /* @__PURE__ */ F(Nt, {
3986
+ children: /* @__PURE__ */ F(Wt, {
3761
3987
  value: {
3762
3988
  aiConfig: a,
3763
3989
  flowId: e?.id,
3764
3990
  language: i
3765
3991
  },
3766
- children: [/* @__PURE__ */ P(pr, { position: "bottom-center" }), /* @__PURE__ */ P(be, { children: /* @__PURE__ */ P(mr, {
3992
+ children: [/* @__PURE__ */ P(Ar, { position: "bottom-center" }), /* @__PURE__ */ P(De, { children: /* @__PURE__ */ P(jr, {
3767
3993
  onExportJson: t,
3768
3994
  onSave: n,
3769
3995
  flow: e,
@@ -3772,4 +3998,4 @@ var rr = () => {
3772
3998
  })
3773
3999
  });
3774
4000
  //#endregion
3775
- export { hr as t };
4001
+ export { Mr as t };