treege 3.0.0-beta.10 → 3.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ThemeContext-mnnnxuZU.js +758 -0
- package/dist/TreegeEditor-Bgl5solk.js +2734 -0
- package/dist/TreegeRenderer-DJaR2FqI.js +1441 -0
- package/dist/editor/constants/defaultNode.d.ts +1 -1
- package/dist/editor/constants/edgeTypes.d.ts +1 -1
- package/dist/editor/constants/nodeSpacing.d.ts +20 -0
- package/dist/editor/constants/nodeTypes.d.ts +4 -4
- package/dist/editor/context/TreegeEditorContext.d.ts +15 -0
- package/dist/editor/features/TreegeEditor/TreegeEditor.d.ts +1 -1
- package/dist/editor/features/TreegeEditor/nodes/FlowNode.d.ts +1 -1
- package/dist/editor/features/TreegeEditor/nodes/InputNode.d.ts +1 -1
- package/dist/editor/features/TreegeEditor/nodes/UINode.d.ts +1 -1
- package/dist/editor/features/TreegeEditor/nodes/hooks/useBottomHandleClick.d.ts +8 -0
- package/dist/editor/features/TreegeEditor/panel/AIGeneratorDialog.d.ts +16 -0
- package/dist/editor/hooks/useFlowConnections.d.ts +1 -0
- package/dist/editor/types/ai.d.ts +65 -0
- package/dist/editor/types/editor.d.ts +5 -0
- package/dist/editor/utils/aiFlowGenerator.d.ts +5 -0
- package/dist/editor.js +2 -2
- package/dist/main.js +3 -3
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAutocompleteInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateRangeInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultFileInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHiddenInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHttpInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultNumberInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultPasswordInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSelectInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeInput.d.ts +1 -1
- package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeRangeInput.d.ts +1 -1
- package/dist/renderer/types/renderer.d.ts +9 -0
- package/dist/renderer/utils/form.d.ts +3 -2
- package/dist/renderer/utils/node.d.ts +9 -1
- package/dist/renderer.js +2 -2
- package/dist/shared/locales/ar.json.d.ts +22 -1
- package/dist/shared/locales/de.json.d.ts +22 -1
- package/dist/shared/locales/en.json.d.ts +22 -1
- package/dist/shared/locales/es.json.d.ts +22 -1
- package/dist/shared/locales/fr.json.d.ts +22 -1
- package/dist/shared/locales/it.json.d.ts +22 -1
- package/dist/shared/locales/pt.json.d.ts +22 -1
- package/package.json +2 -2
- package/dist/ThemeContext-BIvs8Kw-.js +0 -758
- package/dist/TreegeEditor--L4cWrS3.js +0 -2152
- package/dist/TreegeRenderer-BVaqgInZ.js +0 -1405
|
@@ -0,0 +1,2734 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}.react-flow{--xy-edge-stroke-default:#b1b1b7;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#555;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:#ffffff80;--xy-minimap-background-color-default:#fff;--xy-minimap-mask-background-color-default:#f0f0f099;--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#e2e2e2;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:transparent;--xy-background-pattern-dots-color-default:#91919a;--xy-background-pattern-lines-color-default:#eee;--xy-background-pattern-cross-color-default:#e2e2e2;background-color:var(--xy-background-color,var(--xy-background-color-default));--xy-node-border-default:1px solid #bbb;--xy-node-border-selected-default:1px solid #555;--xy-handle-background-color-default:#333;--xy-selection-background-color-default:#9696b41a;--xy-selection-border-default:1px dotted #9b9b9bcc;--xy-resize-background-color-default:#3367d9;direction:ltr}.react-flow.dark{--xy-edge-stroke-default:#3e3e3e;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#727272;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:#96969640;--xy-minimap-background-color-default:#141414;--xy-minimap-mask-background-color-default:#3c3c3c99;--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#2b2b2b;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:#141414;--xy-background-pattern-dots-color-default:#777;--xy-background-pattern-lines-color-default:#777;--xy-background-pattern-cross-color-default:#777;--xy-node-color-default:#f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props,var(--xy-background-color,var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__pane{z-index:1}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width,var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke,var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width,var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{pointer-events:none;position:absolute;overflow:visible}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected,var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}svg.react-flow__connectionline{z-index:1001;position:absolute;overflow:visible}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.react-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.react-flow__handle{pointer-events:none;background-color:var(--xy-handle-background-color,var(--xy-handle-background-color-default));min-width:5px;min-height:5px;position:absolute}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;bottom:0;left:50%;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{z-index:5;margin:15px;position:absolute}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px)translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px)translateY(-50%)}.react-flow__attribution{background:var(--xy-attribution-background-color,var(--xy-attribution-background-color-default));margin:0;padding:2px 3px;font-size:10px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.react-flow__edgelabel-renderer{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__viewport-portal{-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__minimap{background:var(--xy-minimap-background-color-props,var(--xy-minimap-background-color,var(--xy-minimap-background-color-default)))}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var(--xy-minimap-mask-background-color-props,var(--xy-minimap-mask-background-color,var(--xy-minimap-mask-background-color-default)));stroke:var(--xy-minimap-mask-stroke-color-props,var(--xy-minimap-mask-stroke-color,var(--xy-minimap-mask-stroke-color-default)));stroke-width:var(--xy-minimap-mask-stroke-width-props,var(--xy-minimap-mask-stroke-width,var(--xy-minimap-mask-stroke-width-default)))}.react-flow__minimap-node{fill:var(--xy-minimap-node-background-color-props,var(--xy-minimap-node-background-color,var(--xy-minimap-node-background-color-default)));stroke:var(--xy-minimap-node-stroke-color-props,var(--xy-minimap-node-stroke-color,var(--xy-minimap-node-stroke-color-default)));stroke-width:var(--xy-minimap-node-stroke-width-props,var(--xy-minimap-node-stroke-width,var(--xy-minimap-node-stroke-width-default)))}.react-flow__background-pattern.dots{fill:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-dots-color-default)))}.react-flow__background-pattern.lines{stroke:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-lines-color-default)))}.react-flow__background-pattern.cross{stroke:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-cross-color-default)))}.react-flow__controls{flex-direction:column;display:flex}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{justify-content:center;align-items:center;width:26px;height:26px;padding:4px;display:flex}.react-flow__controls-button svg{fill:currentColor;width:100%;max-width:12px;max-height:12px}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{border:var(--xy-node-border,var(--xy-node-border-default));color:var(--xy-node-color,var(--xy-node-color-default))}.react-flow__node-input.selected,.react-flow__node-input:focus,.react-flow__node-input:focus-visible,.react-flow__node-default.selected,.react-flow__node-default:focus,.react-flow__node-default:focus-visible,.react-flow__node-output.selected,.react-flow__node-output:focus,.react-flow__node-output:focus-visible,.react-flow__node-group.selected,.react-flow__node-group:focus,.react-flow__node-group:focus-visible{border:var(--xy-node-border-selected,var(--xy-node-border-selected-default));outline:none}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color,var(--xy-selection-background-color-default));border:var(--xy-selection-border,var(--xy-selection-border-default))}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border:1px solid #fff;border-radius:1px;width:5px;height:5px;translate:-50% -50%}.react-flow__resize-control.handle.left{top:50%;left:0}.react-flow__resize-control.handle.right{top:50%;left:100%}.react-flow__resize-control.handle.top{top:0;left:50%}.react-flow__resize-control.handle.bottom{top:100%;left:50%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border-style:solid;border-width:0}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;height:100%;top:0;transform:translate(-50%)}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{width:100%;height:1px;left:0;transform:translateY(-50%)}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-500:oklch(63.7% .237 25.331);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-lg:32rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-widest:.1em;--radius-xs:.125rem;--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-card:var(--card);--color-chart-2:var(--chart-2);--color-chart-3:var(--chart-3);--color-chart-4:var(--chart-4)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}body{background-color:var(--background);color:var(--foreground)}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.inset-y-0{inset-block:calc(var(--spacing)*0)}.-top-3\\.5{top:calc(var(--spacing)*-3.5)}.top-0{top:calc(var(--spacing)*0)}.top-1\\/2{top:50%}.top-4{top:calc(var(--spacing)*4)}.top-5{top:calc(var(--spacing)*5)}.top-\\[50\\%\\]{top:50%}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.right-3{right:calc(var(--spacing)*3)}.right-4{right:calc(var(--spacing)*4)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-5{left:calc(var(--spacing)*5)}.left-6{left:calc(var(--spacing)*6)}.left-\\[50\\%\\]{left:50%}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing)*-1)}.mx-auto{margin-inline:auto}.my-1{margin-block:calc(var(--spacing)*1)}.my-8{margin-block:calc(var(--spacing)*8)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-8{margin-top:calc(var(--spacing)*8)}.mt-10{margin-top:calc(var(--spacing)*10)}.mt-auto{margin-top:auto}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-10{margin-bottom:calc(var(--spacing)*10)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.table{display:table}.field-sizing-content{field-sizing:content}.aspect-square{aspect-ratio:1}.size-\\(--cell-size\\){width:var(--cell-size);height:var(--cell-size)}.size-2{width:calc(var(--spacing)*2);height:calc(var(--spacing)*2)}.size-2\\.5{width:calc(var(--spacing)*2.5);height:calc(var(--spacing)*2.5)}.size-3\\.5{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.size-auto{width:auto;height:auto}.size-full{width:100%;height:100%}.\\!h-3{height:calc(var(--spacing)*3)!important}.\\!h-6{height:calc(var(--spacing)*6)!important}.h-\\(--cell-size\\){height:var(--cell-size)}.h-2\\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-\\[1\\.15rem\\]{height:1.15rem}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\\(--radix-dropdown-menu-content-available-height\\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\\(--radix-select-content-available-height\\){max-height:var(--radix-select-content-available-height)}.max-h-150{max-height:calc(var(--spacing)*150)}.max-h-\\[300px\\]{max-height:300px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-16{min-height:calc(var(--spacing)*16)}.\\!w-3{width:calc(var(--spacing)*3)!important}.\\!w-6{width:calc(var(--spacing)*6)!important}.w-\\(--cell-size\\){width:var(--cell-size)}.w-2\\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-3\\/4{width:75%}.w-4{width:calc(var(--spacing)*4)}.w-4\\/12{width:33.3333%}.w-8{width:calc(var(--spacing)*8)}.w-8\\/12{width:66.6667%}.w-12{width:calc(var(--spacing)*12)}.w-32{width:calc(var(--spacing)*32)}.w-72{width:calc(var(--spacing)*72)}.w-80{width:calc(var(--spacing)*80)}.w-96{width:calc(var(--spacing)*96)}.w-\\[300px\\]{width:300px}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-50{max-width:calc(var(--spacing)*50)}.max-w-\\[350px\\]{max-width:350px}.max-w-\\[calc\\(100\\%-2rem\\)\\]{max-width:calc(100% - 2rem)}.max-w-full{max-width:100%}.min-w-\\(--cell-size\\){min-width:var(--cell-size)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.origin-\\(--radix-dropdown-menu-content-transform-origin\\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\\(--radix-popover-content-transform-origin\\){transform-origin:var(--radix-popover-content-transform-origin)}.origin-\\(--radix-select-content-transform-origin\\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\\(--radix-tooltip-content-transform-origin\\){transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-\\[-50\\%\\]{--tw-translate-x:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\\[-50\\%\\]{--tw-translate-y:-50%;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-y-\\[calc\\(-50\\%_-_2px\\)\\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-45{rotate:45deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize-none{resize:none}.scroll-my-1{scroll-margin-block:calc(var(--spacing)*1)}.scroll-py-1{scroll-padding-block:calc(var(--spacing)*1)}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.place-content-center{place-content:center}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-5{gap:calc(var(--spacing)*5)}.gap-6{gap:calc(var(--spacing)*6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing)*3)}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.gap-y-3{row-gap:calc(var(--spacing)*3)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[2px\\]{border-radius:2px}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xs{border-radius:var(--radius-xs)}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-gray-300{border-color:var(--color-gray-300)}.border-input{border-color:var(--input)}.border-transparent{border-color:#0000}.border-t-transparent{border-top-color:#0000}.border-l-transparent{border-left-color:#0000}.\\!bg-primary{background-color:var(--primary)!important}.bg-accent{background-color:var(--accent)}.bg-background{background-color:var(--background)}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-blue-300{background-color:var(--color-blue-300)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-border{background-color:var(--border)}.bg-chart-2{background-color:var(--chart-2)}.bg-destructive{background-color:var(--destructive)}.bg-foreground{background-color:var(--foreground)}.bg-muted,.bg-muted\\/20{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\\/20{background-color:color-mix(in oklab,var(--muted)20%,transparent)}}.bg-muted\\/30{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\\/30{background-color:color-mix(in oklab,var(--muted)30%,transparent)}}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-purple-600{background-color:var(--color-purple-600)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.fill-current{fill:currentColor}.fill-foreground{fill:var(--foreground)}.fill-primary{fill:var(--primary)}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-px{padding:1px}.px-\\(--cell-size\\){padding-inline:var(--cell-size)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-6{padding-block:calc(var(--spacing)*6)}.pt-2{padding-top:calc(var(--spacing)*2)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-8{padding-right:calc(var(--spacing)*8)}.pr-10{padding-right:calc(var(--spacing)*10)}.pb-1\\.5{padding-bottom:calc(var(--spacing)*1.5)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-8{padding-left:calc(var(--spacing)*8)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.8rem\\]{font-size:.8rem}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.text-nowrap{text-wrap:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-\\[\\#13d3b4\\]{color:#13d3b4}.text-\\[--treege-color-primary\\]{color:--treege-color-primary}.text-accent-foreground{color:var(--accent-foreground)}.text-background{color:var(--background)}.text-current{color:currentColor}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-500{color:var(--color-red-500)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.underline-offset-4{text-underline-offset:4px}.\\[color-scheme\\:light\\]{color-scheme:light}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-100{opacity:1}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.drop-shadow-\\[0_0px_35px\\]{--tw-drop-shadow-size:drop-shadow(0 0px 35px var(--tw-drop-shadow-color,currentcolor));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow-blue-600{--tw-drop-shadow-color:oklch(54.6% .245 262.881)}@supports (color:color-mix(in lab,red,red)){.drop-shadow-blue-600{--tw-drop-shadow-color:color-mix(in oklab,var(--color-blue-600)var(--tw-drop-shadow-alpha),transparent)}}.drop-shadow-blue-600{--tw-drop-shadow:var(--tw-drop-shadow-size)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.\\[--cell-size\\:--spacing\\(8\\)\\]{--cell-size:calc(var(--spacing)*8)}.group-data-\\[disabled\\=true\\]\\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\\[disabled\\=true\\]\\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.group-data-\\[focused\\=true\\]\\/day\\:relative:is(:where(.group\\/day)[data-focused=true] *){position:relative}.group-data-\\[focused\\=true\\]\\/day\\:z-10:is(:where(.group\\/day)[data-focused=true] *){z-index:10}.group-data-\\[focused\\=true\\]\\/day\\:border-ring:is(:where(.group\\/day)[data-focused=true] *){border-color:var(--ring)}.group-data-\\[focused\\=true\\]\\/day\\:ring-\\[3px\\]:is(:where(.group\\/day)[data-focused=true] *){--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\\[focused\\=true\\]\\/day\\:ring-ring\\/50:is(:where(.group\\/day)[data-focused=true] *){--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.group-data-\\[focused\\=true\\]\\/day\\:ring-ring\\/50:is(:where(.group\\/day)[data-focused=true] *){--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.peer-disabled\\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.selection\\:bg-primary ::selection{background-color:var(--primary)}.selection\\:bg-primary::selection{background-color:var(--primary)}.selection\\:text-primary-foreground ::selection{color:var(--primary-foreground)}.selection\\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\\:inline-flex::file-selector-button{display:inline-flex}.file\\:h-7::file-selector-button{height:calc(var(--spacing)*7)}.file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\\:bg-transparent::file-selector-button{background-color:#0000}.file\\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\\:text-muted-foreground::placeholder{color:var(--muted-foreground)}@media(hover:hover){.hover\\:\\!bg-primary\\/80:hover{background-color:var(--primary)!important}@supports (color:color-mix(in lab,red,red)){.hover\\:\\!bg-primary\\/80:hover{background-color:color-mix(in oklab,var(--primary)80%,transparent)!important}}.hover\\:bg-accent:hover{background-color:var(--accent)}.hover\\:bg-blue-600:hover{background-color:var(--color-blue-600)}.hover\\:bg-destructive\\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}.hover\\:bg-primary\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}.hover\\:bg-purple-700:hover{background-color:var(--color-purple-700)}.hover\\:bg-secondary\\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}}.hover\\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\\:text-primary:hover{color:var(--primary)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}}.focus\\:bg-accent:focus{background-color:var(--accent)}.focus\\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\\:text-destructive:focus{color:var(--destructive)}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.focus\\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus\\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.focus-visible\\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-focus\\:border-ring:has(:focus){border-color:var(--ring)}.has-focus\\:ring-\\[3px\\]:has(:focus){--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.has-focus\\:ring-ring\\/50:has(:focus){--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.has-focus\\:ring-ring\\/50:has(:focus){--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.has-\\[\\>svg\\]\\:px-2\\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\\[\\>svg\\]\\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\\[\\>svg\\]\\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.aria-disabled\\:opacity-50[aria-disabled=true]{opacity:.5}.aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.aria-selected\\:text-muted-foreground[aria-selected=true]{color:var(--muted-foreground)}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[disabled\\=true\\]\\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\\[disabled\\=true\\]\\:opacity-50[data-disabled=true]{opacity:.5}.data-\\[inset\\]\\:pl-8[data-inset]{padding-left:calc(var(--spacing)*8)}.data-\\[orientation\\=horizontal\\]\\:h-px[data-orientation=horizontal]{height:1px}.data-\\[orientation\\=horizontal\\]\\:w-full[data-orientation=horizontal]{width:100%}.data-\\[orientation\\=vertical\\]\\:h-full[data-orientation=vertical]{height:100%}.data-\\[orientation\\=vertical\\]\\:w-px[data-orientation=vertical]{width:1px}.data-\\[placeholder\\]\\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\\[range-end\\=true\\]\\:rounded-md[data-range-end=true]{border-radius:calc(var(--radius) - 2px)}.data-\\[range-end\\=true\\]\\:rounded-r-md[data-range-end=true]{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\\[range-end\\=true\\]\\:bg-primary[data-range-end=true]{background-color:var(--primary)}.data-\\[range-end\\=true\\]\\:text-primary-foreground[data-range-end=true]{color:var(--primary-foreground)}.data-\\[range-middle\\=true\\]\\:rounded-none[data-range-middle=true]{border-radius:0}.data-\\[range-middle\\=true\\]\\:bg-accent[data-range-middle=true]{background-color:var(--accent)}.data-\\[range-middle\\=true\\]\\:text-accent-foreground[data-range-middle=true]{color:var(--accent-foreground)}.data-\\[range-start\\=true\\]\\:rounded-md[data-range-start=true]{border-radius:calc(var(--radius) - 2px)}.data-\\[range-start\\=true\\]\\:rounded-l-md[data-range-start=true]{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.data-\\[range-start\\=true\\]\\:bg-primary[data-range-start=true]{background-color:var(--primary)}.data-\\[range-start\\=true\\]\\:text-primary-foreground[data-range-start=true]{color:var(--primary-foreground)}.data-\\[selected-single\\=true\\]\\:bg-primary[data-selected-single=true]{background-color:var(--primary)}.data-\\[selected-single\\=true\\]\\:text-primary-foreground[data-selected-single=true]{color:var(--primary-foreground)}.data-\\[selected\\=true\\]\\:rounded-none[data-selected=true]{border-radius:0}.data-\\[selected\\=true\\]\\:bg-accent[data-selected=true]{background-color:var(--accent)}.data-\\[selected\\=true\\]\\:text-accent-foreground[data-selected=true]{color:var(--accent-foreground)}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\\[size\\=default\\]\\:h-9[data-size=default]{height:calc(var(--spacing)*9)}.data-\\[size\\=sm\\]\\:h-8[data-size=sm]{height:calc(var(--spacing)*8)}:is(.\\*\\*\\:data-\\[slot\\=command-input-wrapper\\]\\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing)*12)}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:flex>*)[data-slot=select-value]{display:flex}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing)*2)}.data-\\[state\\=checked\\]\\:translate-x-\\[calc\\(100\\%-2px\\)\\][data-state=checked]{--tw-translate-x: calc(100% - 2px) ;translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[state\\=checked\\]\\:border-primary[data-state=checked]{border-color:var(--primary)}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\\[state\\=checked\\]\\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\\[state\\=closed\\]\\:duration-300[data-state=closed]{--tw-duration:.3s;transition-duration:.3s}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=closed\\]\\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y:100%}.data-\\[state\\=closed\\]\\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x:-100%}.data-\\[state\\=closed\\]\\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x:100%}.data-\\[state\\=closed\\]\\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y:-100%}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\\[state\\=open\\]\\:bg-secondary[data-state=open]{background-color:var(--secondary)}.data-\\[state\\=open\\]\\:text-accent-foreground[data-state=open]{color:var(--accent-foreground)}.data-\\[state\\=open\\]\\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\\[state\\=open\\]\\:duration-500[data-state=open]{--tw-duration:.5s;transition-duration:.5s}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[state\\=open\\]\\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y:100%}.data-\\[state\\=open\\]\\:slide-in-from-left[data-state=open]{--tw-enter-translate-x:-100%}.data-\\[state\\=open\\]\\:slide-in-from-right[data-state=open]{--tw-enter-translate-x:100%}.data-\\[state\\=open\\]\\:slide-in-from-top[data-state=open]{--tw-enter-translate-y:-100%}.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:var(--input)}.data-\\[variant\\=destructive\\]\\:text-destructive[data-variant=destructive]{color:var(--destructive)}.data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/10[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive)10%,transparent)}}.data-\\[variant\\=destructive\\]\\:focus\\:text-destructive[data-variant=destructive]:focus{color:var(--destructive)}@media(min-width:40rem){.sm\\:max-w-\\[550px\\]{max-width:550px}.sm\\:max-w-lg{max-width:var(--container-lg)}.sm\\:max-w-sm{max-width:var(--container-sm)}.sm\\:flex-row{flex-direction:row}.sm\\:justify-end{justify-content:flex-end}.sm\\:text-left{text-align:left}}@media(min-width:48rem){.md\\:flex-row{flex-direction:row}.md\\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.dark\\:border-input:is(.dark *){border-color:var(--input)}.dark\\:bg-blue-600:is(.dark *){background-color:var(--color-blue-600)}.dark\\:bg-destructive\\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\\:bg-destructive\\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive)60%,transparent)}}.dark\\:bg-input\\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab,var(--input)30%,transparent)}}.dark\\:\\[color-scheme\\:dark\\]:is(.dark *){color-scheme:dark}@media(hover:hover){.dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input)50%,transparent)}}.dark\\:hover\\:text-accent-foreground:is(.dark *):hover{color:var(--accent-foreground)}}.dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\\:data-\\[state\\=checked\\]\\:bg-primary:is(.dark *)[data-state=checked]{background-color:var(--primary)}.dark\\:data-\\[state\\=checked\\]\\:bg-primary-foreground:is(.dark *)[data-state=checked]{background-color:var(--primary-foreground)}.dark\\:data-\\[state\\=unchecked\\]\\:bg-foreground:is(.dark *)[data-state=unchecked]{background-color:var(--foreground)}.dark\\:data-\\[state\\=unchecked\\]\\:bg-input\\/80:is(.dark *)[data-state=unchecked]{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\\:data-\\[state\\=unchecked\\]\\:bg-input\\/80:is(.dark *)[data-state=unchecked]{background-color:color-mix(in oklab,var(--input)80%,transparent)}}.dark\\:data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/20:is(.dark *)[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\\:data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/20:is(.dark *)[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing)*2)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:py-1\\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing)*1.5)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted-foreground [cmdk-group-heading]{color:var(--muted-foreground)}.\\[\\&_\\[cmdk-group\\]\\]\\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing)*2)}.\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:calc(var(--spacing)*0)}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing)*5)}.\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing)*5)}.\\[\\&_\\[cmdk-input\\]\\]\\:h-12 [cmdk-input]{height:calc(var(--spacing)*12)}.\\[\\&_\\[cmdk-item\\]\\]\\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing)*2)}.\\[\\&_\\[cmdk-item\\]\\]\\:py-3 [cmdk-item]{padding-block:calc(var(--spacing)*3)}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:h-5 [cmdk-item] svg{height:calc(var(--spacing)*5)}.\\[\\&_\\[cmdk-item\\]_svg\\]\\:w-5 [cmdk-item] svg{width:calc(var(--spacing)*5)}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'text-\\'\\]\\)\\]\\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\\[\\&\\:first-child\\[data-selected\\=true\\]_button\\]\\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}:is(.rtl\\:\\*\\*\\:\\[\\.rdp-button\\\\_next\\>svg\\]\\:rotate-180:where(:dir(rtl),[dir=rtl],[dir=rtl] *) *):is(.rdp-button_next>svg),:is(.rtl\\:\\*\\*\\:\\[\\.rdp-button\\\\_previous\\>svg\\]\\:rotate-180:where(:dir(rtl),[dir=rtl],[dir=rtl] *) *):is(.rdp-button_previous>svg){rotate:180deg}:is(.\\*\\:\\[span\\]\\:last\\:flex>*):is(span):last-child{display:flex}:is(.\\*\\:\\[span\\]\\:last\\:items-center>*):is(span):last-child{align-items:center}:is(.\\*\\:\\[span\\]\\:last\\:gap-2>*):is(span):last-child{gap:calc(var(--spacing)*2)}:is(.data-\\[variant\\=destructive\\]\\:\\*\\:\\[svg\\]\\:\\!text-destructive[data-variant=destructive]>*):is(svg){color:var(--destructive)!important}.\\[\\&\\:last-child\\[data-selected\\=true\\]_button\\]\\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\\[\\&\\>span\\]\\:text-xs>span{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\\[\\&\\>span\\]\\:opacity-70>span{opacity:.7}.\\[\\&\\>svg\\]\\:pointer-events-none>svg{pointer-events:none}.\\[\\&\\>svg\\]\\:size-3>svg{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.\\[\\&\\>svg\\]\\:size-3\\.5>svg{width:calc(var(--spacing)*3.5);height:calc(var(--spacing)*3.5)}.\\[\\&\\>svg\\]\\:text-muted-foreground>svg{color:var(--muted-foreground)}[data-slot=card-content] .\\[\\[data-slot\\=card-content\\]_\\&\\]\\:bg-transparent,[data-slot=popover-content] .\\[\\[data-slot\\=popover-content\\]_\\&\\]\\:bg-transparent{background-color:#0000}@media(hover:hover){a.\\[a\\&\\]\\:hover\\:bg-accent:hover{background-color:var(--accent)}a.\\[a\\&\\]\\:hover\\:bg-destructive\\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){a.\\[a\\&\\]\\:hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}a.\\[a\\&\\]\\:hover\\:bg-primary\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){a.\\[a\\&\\]\\:hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}a.\\[a\\&\\]\\:hover\\:bg-secondary\\/90:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){a.\\[a\\&\\]\\:hover\\:bg-secondary\\/90:hover{background-color:color-mix(in oklab,var(--secondary)90%,transparent)}}a.\\[a\\&\\]\\:hover\\:text-accent-foreground:hover{color:var(--accent-foreground)}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0)}.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0)}:root{--node-width:280px;--node-height:150px;--node-border-radius:40px;--treege-color-primary:#13d3b4;--treege-color-tertiary:#0065a8;--treege-color-secondary:#007ff6}button{cursor:pointer;-webkit-user-select:none;user-select:none}#root{width:100vw;height:100vh}div.react-flow__node{border:0!important}div.react-flow__node__wrapper{padding:calc(var(--spacing)*7);width:270px;height:150px;box-shadow:0 0 20px 6px oklch(from var(--treege-color-primary)l c h/10%),0 0 20px oklch(from var(--treege-color-tertiary)l c h/10%);background:linear-gradient(oklch(from var(--color-card)l c h/33%),oklch(from var(--color-card)l c h/33%))padding-box,linear-gradient(145deg,oklch(from var(--treege-color-primary)l c h/40%),#0000,oklch(from var(--treege-color-secondary)l c h/40%))border-box;border-radius:40px;flex-direction:column;justify-content:center;display:flex;border:3px solid #0000!important}div.react-flow__node__wrapper.in-group{background:linear-gradient(oklch(from var(--color-card)l c h/33%),oklch(from var(--color-card)l c h/33%))padding-box,linear-gradient(145deg,oklch(from var(--color-chart-2)l c h/33%),#0000,oklch(from var(--color-chart-2)l c h/33%))border-box}div.react-flow__node.selected .react-flow__node__wrapper{box-shadow:0 0 20px 6px oklch(from var(--treege-color-primary)l c h/30%),0 0 20px oklch(from var(--treege-color-tertiary)l c h/30%)}div.react-flow__node-group,div.react-flow__node-group.selected{background:oklch(from var(--color-chart-2)l c h/5%);box-shadow:none;border:3px dashed var(--color-chart-2)!important}div.react-flow__node-group .react-flow__resize-control{opacity:0;padding:4px;transition:opacity .2s}div.react-flow__node-group:hover .react-flow__resize-control,.react-flow__resize-control:hover{opacity:1}div.react-flow__handle{background-color:var(--muted-foreground);height:calc(var(--spacing)*6);width:calc(var(--spacing)*6);cursor:pointer;border-radius:calc(var(--radius) - 4px);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));justify-content:center;align-items:center;display:flex}@media(hover:hover){div.react-flow__handle:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){div.react-flow__handle:hover{background-color:color-mix(in oklab,var(--primary)80%,transparent)}}}path.react-flow__edge-path{stroke:var(--muted-foreground)}.w-tc-editor{border-radius:calc(var(--radius) - 2px);border-style:var(--tw-border-style);border-width:1px;border-color:var(--input);background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.w-tc-editor{background-color:color-mix(in oklab,var(--input)30%,transparent)}}.w-tc-editor:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.w-tc-editor:is(.dark *){background-color:color-mix(in oklab,var(--input)30%,transparent)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}`)),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
import { j as e, i as he, e as et, s as T, P as Pe, p as Te, B as k, q as De, F as S, f as b, I as P, o as B, t as tt, S as U, w as R, x as Z, y as K, A as w, L as te, N as xe, E as Ue, z as J, c as fe, D as ae, C as at, r as nt, h as st, k as ot, l as Ge, m as we, H as Ve, a as rt, b as lt, G as it, T as dt } from "./ThemeContext-mnnnxuZU.js";
|
|
3
|
+
import { useNodes as Oe, useEdges as Re, getBezierPath as ct, useReactFlow as pe, BaseEdge as ut, EdgeLabelRenderer as ht, addEdge as mt, Handle as se, Position as oe, NodeResizer as pt, Panel as xt, ReactFlowProvider as gt, ReactFlow as jt, Background as Ct, BackgroundVariant as ft, MiniMap as vt, Controls as bt } from "@xyflow/react";
|
|
4
|
+
import { useForm as de } from "@tanstack/react-form";
|
|
5
|
+
import { Waypoints as Nt, X as re, Plus as W, Network as yt, Boxes as wt, RectangleEllipsis as Ft, Type as Ze, LucidePencilRuler as St, XIcon as Ke, WandSparkles as He, Loader2 as Et, Save as kt, EllipsisVertical as Pt, Copy as Tt, Download as Dt, ArrowRightFromLine as Vt, Trash2 as Ot, Variable as Be, ChevronsUpDown as ue, Check as It, PlusCircle as At } from "lucide-react";
|
|
6
|
+
import { useMemo as ne, createContext as Lt, useState as $, useContext as Mt, useCallback as z, useRef as Gt, useEffect as Ht } from "react";
|
|
7
|
+
import * as me from "@radix-ui/react-scroll-area";
|
|
8
|
+
import { Slot as Bt } from "@radix-ui/react-slot";
|
|
9
|
+
import { cva as zt } from "class-variance-authority";
|
|
10
|
+
import { toast as H, Toaster as $t } from "sonner";
|
|
11
|
+
import * as A from "@radix-ui/react-dialog";
|
|
12
|
+
import * as Y from "@radix-ui/react-dropdown-menu";
|
|
13
|
+
import * as Ie from "@radix-ui/react-collapsible";
|
|
14
|
+
import { useTheme as _t } from "next-themes";
|
|
15
|
+
const Ut = "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", Rt = "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", Zt = ({ theme: t = "dark" }) => /* @__PURE__ */ e.jsx("div", { className: "absolute top-5 left-5 z-50 select-none", children: /* @__PURE__ */ e.jsx(
|
|
16
|
+
"img",
|
|
17
|
+
{
|
|
18
|
+
src: t === "dark" ? Rt : Ut,
|
|
19
|
+
alt: "Treege",
|
|
20
|
+
className: "relative h-14 w-auto drop-shadow-[0_0px_35px] drop-shadow-blue-600"
|
|
21
|
+
}
|
|
22
|
+
) }), Ae = (t) => {
|
|
23
|
+
const s = Oe(), r = Re();
|
|
24
|
+
return ne(() => {
|
|
25
|
+
if (!t)
|
|
26
|
+
return [];
|
|
27
|
+
const o = (l, n = /* @__PURE__ */ new Set()) => {
|
|
28
|
+
if (n.has(l))
|
|
29
|
+
return [];
|
|
30
|
+
const c = new Set(n).add(l);
|
|
31
|
+
return r.filter((a) => a.target === l).flatMap((a) => [a.source, ...o(a.source, c)]);
|
|
32
|
+
}, h = o(t);
|
|
33
|
+
return s.filter((l) => h.includes(l.id) && he(l)).map((l) => {
|
|
34
|
+
const n = l.data;
|
|
35
|
+
return {
|
|
36
|
+
label: (typeof n.label == "object" ? n.label.en : n.label) || n.name || l.id,
|
|
37
|
+
name: n.name,
|
|
38
|
+
nodeId: l.id,
|
|
39
|
+
type: n.type || "text"
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
}, [t, s, r]);
|
|
43
|
+
}, Je = Lt(null), Kt = ({ children: t, value: s }) => {
|
|
44
|
+
const [r, o] = $(s?.flowId), h = ne(
|
|
45
|
+
() => ({
|
|
46
|
+
...s,
|
|
47
|
+
...s?.aiConfig && {
|
|
48
|
+
aiConfig: {
|
|
49
|
+
...s.aiConfig,
|
|
50
|
+
provider: s?.aiConfig.provider ?? "gemini"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
flowId: r,
|
|
54
|
+
setFlowId: o
|
|
55
|
+
}),
|
|
56
|
+
[r, s]
|
|
57
|
+
);
|
|
58
|
+
return /* @__PURE__ */ e.jsx(Je.Provider, { value: h, children: t });
|
|
59
|
+
}, Ye = () => Mt(Je) ?? {
|
|
60
|
+
flowId: void 0,
|
|
61
|
+
language: "en",
|
|
62
|
+
setFlowId: () => {
|
|
63
|
+
}
|
|
64
|
+
}, M = (t) => {
|
|
65
|
+
const r = Ye().language;
|
|
66
|
+
return et(r);
|
|
67
|
+
};
|
|
68
|
+
function We({ className: t, children: s, ...r }) {
|
|
69
|
+
return /* @__PURE__ */ e.jsxs(me.Root, { "data-slot": "scroll-area", className: T("relative", t), ...r, children: [
|
|
70
|
+
/* @__PURE__ */ e.jsx(
|
|
71
|
+
me.Viewport,
|
|
72
|
+
{
|
|
73
|
+
"data-slot": "scroll-area-viewport",
|
|
74
|
+
className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
|
|
75
|
+
children: s
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ e.jsx(Jt, {}),
|
|
79
|
+
/* @__PURE__ */ e.jsx(me.Corner, {})
|
|
80
|
+
] });
|
|
81
|
+
}
|
|
82
|
+
function Jt({
|
|
83
|
+
className: t,
|
|
84
|
+
orientation: s = "vertical",
|
|
85
|
+
...r
|
|
86
|
+
}) {
|
|
87
|
+
return /* @__PURE__ */ e.jsx(
|
|
88
|
+
me.ScrollAreaScrollbar,
|
|
89
|
+
{
|
|
90
|
+
"data-slot": "scroll-area-scrollbar",
|
|
91
|
+
orientation: s,
|
|
92
|
+
className: T(
|
|
93
|
+
"flex touch-none p-px transition-colors select-none",
|
|
94
|
+
s === "vertical" && "h-full w-2.5 border-l border-l-transparent",
|
|
95
|
+
s === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
|
|
96
|
+
t
|
|
97
|
+
),
|
|
98
|
+
...r,
|
|
99
|
+
children: /* @__PURE__ */ e.jsx(me.ScrollAreaThumb, { "data-slot": "scroll-area-thumb", className: "bg-border relative flex-1 rounded-full" })
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
const Yt = ({
|
|
104
|
+
id: t,
|
|
105
|
+
target: s,
|
|
106
|
+
sourceX: r,
|
|
107
|
+
sourceY: o,
|
|
108
|
+
targetX: h,
|
|
109
|
+
targetY: l,
|
|
110
|
+
sourcePosition: n,
|
|
111
|
+
targetPosition: c,
|
|
112
|
+
markerEnd: i,
|
|
113
|
+
style: a,
|
|
114
|
+
data: d
|
|
115
|
+
}) => {
|
|
116
|
+
const [p, m, u] = ct({
|
|
117
|
+
sourcePosition: n,
|
|
118
|
+
sourceX: r,
|
|
119
|
+
sourceY: o,
|
|
120
|
+
targetPosition: c,
|
|
121
|
+
targetX: h,
|
|
122
|
+
targetY: l
|
|
123
|
+
}), [f, x] = $(!1), { updateEdgeData: E } = pe(), j = Ae(s), y = d?.conditions && d.conditions.length > 0, v = M(), { handleSubmit: I, reset: N, Field: F } = de({
|
|
124
|
+
defaultValues: {
|
|
125
|
+
conditions: d?.conditions || [{ field: j[0]?.nodeId ?? "", operator: "===", value: "" }],
|
|
126
|
+
isFallback: !!d?.isFallback,
|
|
127
|
+
label: d?.label || ""
|
|
128
|
+
},
|
|
129
|
+
listeners: {
|
|
130
|
+
onChange: ({ formApi: C }) => {
|
|
131
|
+
C.handleSubmit().then();
|
|
132
|
+
},
|
|
133
|
+
onChangeDebounceMs: 150
|
|
134
|
+
},
|
|
135
|
+
onSubmit: ({ value: C }) => {
|
|
136
|
+
E(t, C);
|
|
137
|
+
}
|
|
138
|
+
}), D = (C) => {
|
|
139
|
+
C.stopPropagation();
|
|
140
|
+
}, V = () => {
|
|
141
|
+
N({ conditions: [], isFallback: !1, label: "" }), E(t, { conditions: void 0, isFallback: void 0, label: void 0 });
|
|
142
|
+
}, g = () => {
|
|
143
|
+
if (d?.isFallback)
|
|
144
|
+
return d.label || v("editor.conditionalEdge.fallback");
|
|
145
|
+
if (!y)
|
|
146
|
+
return null;
|
|
147
|
+
if (d.label)
|
|
148
|
+
return d.label;
|
|
149
|
+
const C = d.conditions;
|
|
150
|
+
if (C.length === 1)
|
|
151
|
+
return `${j.find((G) => G.nodeId === C[0].field)?.label || C[0].field} ${C[0].operator} ${C[0].value}`;
|
|
152
|
+
const L = C.filter((O) => O.logicalOperator === te.AND).length, ye = C.filter((O) => O.logicalOperator === te.OR).length;
|
|
153
|
+
return L > 0 && ye === 0 ? `${C.length} ${v("editor.conditionalEdge.conditionsAnd")}` : ye > 0 && L === 0 ? `${C.length} ${v("editor.conditionalEdge.conditionsOr")}` : `${C.length} ${v("editor.conditionalEdge.conditionsMixed")}`;
|
|
154
|
+
}, ee = () => d?.isFallback ? "var(--color-chart-4)" : y ? "var(--color-chart-2)" : "var(--color-chart-3)";
|
|
155
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
156
|
+
/* @__PURE__ */ e.jsx(
|
|
157
|
+
ut,
|
|
158
|
+
{
|
|
159
|
+
path: p,
|
|
160
|
+
markerEnd: i,
|
|
161
|
+
style: {
|
|
162
|
+
...a,
|
|
163
|
+
stroke: ee(),
|
|
164
|
+
strokeDasharray: d?.isFallback ? "5,5" : void 0,
|
|
165
|
+
strokeWidth: y || d?.isFallback ? 2 : a?.strokeWidth
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
),
|
|
169
|
+
/* @__PURE__ */ e.jsx(ht, { children: /* @__PURE__ */ e.jsx(
|
|
170
|
+
"div",
|
|
171
|
+
{
|
|
172
|
+
className: "nodrag nopan absolute",
|
|
173
|
+
style: {
|
|
174
|
+
pointerEvents: "all",
|
|
175
|
+
transform: `translate(-50%, -50%) translate(${m}px,${u}px)`
|
|
176
|
+
},
|
|
177
|
+
children: /* @__PURE__ */ e.jsxs(Pe, { open: f, onOpenChange: x, children: [
|
|
178
|
+
/* @__PURE__ */ e.jsx(Te, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
179
|
+
k,
|
|
180
|
+
{
|
|
181
|
+
variant: y || d?.isFallback ? "default" : "secondary",
|
|
182
|
+
className: "h-8 px-2 text-xs",
|
|
183
|
+
onClick: D,
|
|
184
|
+
children: [
|
|
185
|
+
/* @__PURE__ */ e.jsx(Nt, { className: "mr-1 h-3 w-3" }),
|
|
186
|
+
y || d?.isFallback ? g() : v("editor.conditionalEdge.condition")
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
) }),
|
|
190
|
+
/* @__PURE__ */ e.jsx(De, { className: "w-96 p-1", align: "center", onClick: (C) => C.stopPropagation(), children: /* @__PURE__ */ e.jsx(We, { className: "flex max-h-150 flex-col p-3", children: /* @__PURE__ */ e.jsx(
|
|
191
|
+
"form",
|
|
192
|
+
{
|
|
193
|
+
onSubmit: (C) => {
|
|
194
|
+
C.preventDefault(), C.stopPropagation();
|
|
195
|
+
},
|
|
196
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-5", children: [
|
|
197
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
198
|
+
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: v("editor.conditionalEdge.displayConditions") }),
|
|
199
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-sm", children: v("editor.conditionalEdge.displayConditionsDesc") })
|
|
200
|
+
] }),
|
|
201
|
+
/* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
|
|
202
|
+
/* @__PURE__ */ e.jsx(F, { name: "label", children: (C) => /* @__PURE__ */ e.jsxs(S, { children: [
|
|
203
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: C.name, children: v("editor.conditionalEdge.labelOptional") }),
|
|
204
|
+
/* @__PURE__ */ e.jsx(
|
|
205
|
+
P,
|
|
206
|
+
{
|
|
207
|
+
id: C.name,
|
|
208
|
+
placeholder: v("editor.conditionalEdge.labelPlaceholder"),
|
|
209
|
+
value: C.state.value,
|
|
210
|
+
onChange: (L) => C.handleChange(L.target.value)
|
|
211
|
+
}
|
|
212
|
+
),
|
|
213
|
+
/* @__PURE__ */ e.jsx(B, { children: v("editor.conditionalEdge.labelDesc") })
|
|
214
|
+
] }) }),
|
|
215
|
+
/* @__PURE__ */ e.jsx(F, { name: "isFallback", children: (C) => /* @__PURE__ */ e.jsx(S, { children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3 rounded-lg border bg-muted/20 p-3", children: [
|
|
216
|
+
/* @__PURE__ */ e.jsx(
|
|
217
|
+
tt,
|
|
218
|
+
{
|
|
219
|
+
id: C.name,
|
|
220
|
+
checked: C.state.value,
|
|
221
|
+
onCheckedChange: (L) => C.handleChange(L)
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
225
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: C.name, className: "cursor-pointer font-medium", children: v("editor.conditionalEdge.fallbackPath") }),
|
|
226
|
+
/* @__PURE__ */ e.jsx(B, { className: "text-xs", children: v("editor.conditionalEdge.fallbackPathDesc") })
|
|
227
|
+
] })
|
|
228
|
+
] }) }) }),
|
|
229
|
+
/* @__PURE__ */ e.jsx(F, { name: "conditions", mode: "array", children: (C) => {
|
|
230
|
+
const L = C.form.getFieldValue("isFallback");
|
|
231
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
232
|
+
/* @__PURE__ */ e.jsx(b, { className: L ? "text-muted-foreground" : "", children: v("editor.conditionalEdge.conditions") }),
|
|
233
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
234
|
+
C.state.value?.map((ye, O) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
235
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2 rounded-lg border bg-muted/30 p-3", children: [
|
|
236
|
+
/* @__PURE__ */ e.jsx(F, { name: `conditions[${O}].field`, children: (G) => /* @__PURE__ */ e.jsxs(S, { children: [
|
|
237
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: `field-${O}`, children: v("editor.conditionalEdge.field") }),
|
|
238
|
+
/* @__PURE__ */ e.jsxs(
|
|
239
|
+
U,
|
|
240
|
+
{
|
|
241
|
+
disabled: L,
|
|
242
|
+
value: G.state.value || "",
|
|
243
|
+
onValueChange: (_) => G.handleChange(_),
|
|
244
|
+
children: [
|
|
245
|
+
/* @__PURE__ */ e.jsx(R, { id: `field-${O}`, className: "w-full", children: /* @__PURE__ */ e.jsx(Z, { placeholder: v("editor.conditionalEdge.selectField") }) }),
|
|
246
|
+
/* @__PURE__ */ e.jsx(K, { children: j.length === 0 ? /* @__PURE__ */ e.jsx(w, { value: "none", disabled: !0, children: v("editor.conditionalEdge.noFieldsAvailable") }) : j.map((_) => /* @__PURE__ */ e.jsxs(w, { value: _.nodeId, children: [
|
|
247
|
+
_.label,
|
|
248
|
+
" (",
|
|
249
|
+
_.type,
|
|
250
|
+
")"
|
|
251
|
+
] }, _.nodeId)) })
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
)
|
|
255
|
+
] }) }),
|
|
256
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
257
|
+
/* @__PURE__ */ e.jsx(F, { name: `conditions[${O}].operator`, children: (G) => /* @__PURE__ */ e.jsxs(S, { children: [
|
|
258
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: `operator-${O}`, children: v("editor.conditionalEdge.operator") }),
|
|
259
|
+
/* @__PURE__ */ e.jsxs(
|
|
260
|
+
U,
|
|
261
|
+
{
|
|
262
|
+
disabled: L,
|
|
263
|
+
value: G.state.value || "===",
|
|
264
|
+
onValueChange: (_) => G.handleChange(_),
|
|
265
|
+
children: [
|
|
266
|
+
/* @__PURE__ */ e.jsx(R, { id: `operator-${O}`, children: /* @__PURE__ */ e.jsx(Z, {}) }),
|
|
267
|
+
/* @__PURE__ */ e.jsxs(K, { children: [
|
|
268
|
+
/* @__PURE__ */ e.jsx(w, { value: "===", children: "=" }),
|
|
269
|
+
/* @__PURE__ */ e.jsx(w, { value: "!==", children: "≠" }),
|
|
270
|
+
/* @__PURE__ */ e.jsx(w, { value: ">", children: ">" }),
|
|
271
|
+
/* @__PURE__ */ e.jsx(w, { value: "<", children: "<" }),
|
|
272
|
+
/* @__PURE__ */ e.jsx(w, { value: ">=", children: ">=" }),
|
|
273
|
+
/* @__PURE__ */ e.jsx(w, { value: "<=", children: "<=" })
|
|
274
|
+
] })
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
)
|
|
278
|
+
] }) }),
|
|
279
|
+
/* @__PURE__ */ e.jsx(F, { name: `conditions[${O}].value`, children: (G) => /* @__PURE__ */ e.jsxs(S, { className: "w-full", children: [
|
|
280
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: `value-${O}`, children: v("editor.conditionalEdge.value") }),
|
|
281
|
+
/* @__PURE__ */ e.jsx(
|
|
282
|
+
P,
|
|
283
|
+
{
|
|
284
|
+
disabled: L,
|
|
285
|
+
id: `value-${O}`,
|
|
286
|
+
placeholder: v("editor.conditionalEdge.valuePlaceholder"),
|
|
287
|
+
value: G.state.value || "",
|
|
288
|
+
onChange: (_) => G.handleChange(_.target.value)
|
|
289
|
+
}
|
|
290
|
+
)
|
|
291
|
+
] }) })
|
|
292
|
+
] }),
|
|
293
|
+
C.state.value && C.state.value.length > 1 && /* @__PURE__ */ e.jsxs(
|
|
294
|
+
k,
|
|
295
|
+
{
|
|
296
|
+
disabled: L,
|
|
297
|
+
type: "button",
|
|
298
|
+
variant: "ghost",
|
|
299
|
+
size: "sm",
|
|
300
|
+
className: "w-full",
|
|
301
|
+
onClick: () => {
|
|
302
|
+
C.removeValue(O), I().then();
|
|
303
|
+
},
|
|
304
|
+
children: [
|
|
305
|
+
/* @__PURE__ */ e.jsx(re, { className: "mr-1 h-4 w-4" }),
|
|
306
|
+
v("editor.conditionalEdge.removeCondition")
|
|
307
|
+
]
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
] }),
|
|
311
|
+
C.state.value && O < C.state.value.length - 1 && /* @__PURE__ */ e.jsx(F, { name: `conditions[${O}].logicalOperator`, children: (G) => /* @__PURE__ */ e.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ e.jsxs(
|
|
312
|
+
U,
|
|
313
|
+
{
|
|
314
|
+
disabled: L,
|
|
315
|
+
value: G.state.value || te.AND,
|
|
316
|
+
onValueChange: (_) => G.handleChange(_),
|
|
317
|
+
children: [
|
|
318
|
+
/* @__PURE__ */ e.jsx(R, { className: "h-9 w-32 font-semibold", children: /* @__PURE__ */ e.jsx(Z, {}) }),
|
|
319
|
+
/* @__PURE__ */ e.jsxs(K, { children: [
|
|
320
|
+
/* @__PURE__ */ e.jsx(w, { value: te.AND, children: "AND" }),
|
|
321
|
+
/* @__PURE__ */ e.jsx(w, { value: te.OR, children: "OR" })
|
|
322
|
+
] })
|
|
323
|
+
]
|
|
324
|
+
}
|
|
325
|
+
) }) })
|
|
326
|
+
] }, `condition-${O}`)),
|
|
327
|
+
/* @__PURE__ */ e.jsxs(
|
|
328
|
+
k,
|
|
329
|
+
{
|
|
330
|
+
disabled: L,
|
|
331
|
+
type: "button",
|
|
332
|
+
variant: "outline",
|
|
333
|
+
size: "sm",
|
|
334
|
+
className: "w-full",
|
|
335
|
+
onClick: () => {
|
|
336
|
+
C.pushValue({
|
|
337
|
+
field: j[0]?.nodeId ?? "",
|
|
338
|
+
logicalOperator: te.AND,
|
|
339
|
+
operator: "===",
|
|
340
|
+
value: ""
|
|
341
|
+
}), I().then();
|
|
342
|
+
},
|
|
343
|
+
children: [
|
|
344
|
+
/* @__PURE__ */ e.jsx(W, { className: "mr-2 h-4 w-4" }),
|
|
345
|
+
v("editor.conditionalEdge.addCondition")
|
|
346
|
+
]
|
|
347
|
+
}
|
|
348
|
+
)
|
|
349
|
+
] })
|
|
350
|
+
] });
|
|
351
|
+
} })
|
|
352
|
+
] }),
|
|
353
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-end gap-2 pt-2", children: [
|
|
354
|
+
/* @__PURE__ */ e.jsxs(k, { type: "button", size: "sm", variant: "outline", onClick: V, children: [
|
|
355
|
+
/* @__PURE__ */ e.jsx(re, { className: "mr-1 h-4 w-4" }),
|
|
356
|
+
v("common.clear")
|
|
357
|
+
] }),
|
|
358
|
+
/* @__PURE__ */ e.jsx(k, { type: "button", size: "sm", onClick: () => x(!1), children: v("common.close") })
|
|
359
|
+
] })
|
|
360
|
+
] })
|
|
361
|
+
}
|
|
362
|
+
) }) })
|
|
363
|
+
] })
|
|
364
|
+
}
|
|
365
|
+
) })
|
|
366
|
+
] });
|
|
367
|
+
}, Wt = {
|
|
368
|
+
conditional: Yt
|
|
369
|
+
}, Xt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
370
|
+
let le = (t = 21) => {
|
|
371
|
+
let s = "", r = crypto.getRandomValues(new Uint8Array(t |= 0));
|
|
372
|
+
for (; t--; )
|
|
373
|
+
s += Xt[r[t] & 63];
|
|
374
|
+
return s;
|
|
375
|
+
};
|
|
376
|
+
const Xe = {
|
|
377
|
+
data: {
|
|
378
|
+
type: "text"
|
|
379
|
+
},
|
|
380
|
+
id: le(),
|
|
381
|
+
position: { x: 0, y: 0 },
|
|
382
|
+
type: "input"
|
|
383
|
+
}, qt = 100, Qt = 50, qe = () => {
|
|
384
|
+
const { setNodes: t, setEdges: s, screenToFlowPosition: r, getNode: o, getNodes: h, getEdges: l } = pe(), n = z(
|
|
385
|
+
(m, u, f = !1) => {
|
|
386
|
+
const x = m.id, j = l().filter((N) => N.source === x), y = he(m);
|
|
387
|
+
if (j.length > 0 && !y)
|
|
388
|
+
return;
|
|
389
|
+
const v = le(), I = {
|
|
390
|
+
...Xe,
|
|
391
|
+
id: v,
|
|
392
|
+
position: u,
|
|
393
|
+
selected: f
|
|
394
|
+
};
|
|
395
|
+
m?.parentId && (I.parentId = m.parentId, I.extent = "parent"), t((N) => N.concat(I)), s((N) => {
|
|
396
|
+
const D = N.filter((g) => g.source === x).length > 0, V = {
|
|
397
|
+
data: D && y ? {
|
|
398
|
+
conditions: [{ field: x, operator: "===", value: "" }]
|
|
399
|
+
} : void 0,
|
|
400
|
+
id: le(),
|
|
401
|
+
source: x,
|
|
402
|
+
target: v,
|
|
403
|
+
type: D && y ? "conditional" : "default"
|
|
404
|
+
};
|
|
405
|
+
return D && y ? N.map((g) => g.source === x ? {
|
|
406
|
+
...g,
|
|
407
|
+
data: {
|
|
408
|
+
...g.data,
|
|
409
|
+
conditions: g.data?.conditions || [{ field: x, operator: "===", value: "" }]
|
|
410
|
+
},
|
|
411
|
+
type: "conditional"
|
|
412
|
+
} : g).concat(V) : N.concat(V);
|
|
413
|
+
}), f && (t((N) => N.map((F) => ({ ...F, selected: F.id === v }))), s((N) => N.map((F) => ({ ...F, selected: !1 }))));
|
|
414
|
+
},
|
|
415
|
+
[l, t, s]
|
|
416
|
+
), c = z(
|
|
417
|
+
(m) => {
|
|
418
|
+
s((u) => {
|
|
419
|
+
const f = mt(m, u), x = m.source, E = o(x);
|
|
420
|
+
return f.filter((y) => y.source === x).length > 1 && E && he(E) ? f.map((y) => y.source === x ? {
|
|
421
|
+
...y,
|
|
422
|
+
data: {
|
|
423
|
+
...y.data,
|
|
424
|
+
conditions: y.data?.conditions || [{ field: x, operator: "===", value: "" }]
|
|
425
|
+
},
|
|
426
|
+
type: "conditional"
|
|
427
|
+
} : y) : f;
|
|
428
|
+
});
|
|
429
|
+
},
|
|
430
|
+
[s, o]
|
|
431
|
+
), i = z(
|
|
432
|
+
(m) => {
|
|
433
|
+
const u = o(m);
|
|
434
|
+
if (!u)
|
|
435
|
+
return;
|
|
436
|
+
const f = getComputedStyle(document.documentElement).getPropertyValue("--node-height"), x = getComputedStyle(document.documentElement).getPropertyValue("--node-width"), E = parseFloat(f) || 100, j = parseFloat(x) || 100, y = u.position.y + E + qt, v = h(), I = l(), N = v.filter((D) => I.some((V) => V.source === m && V.target === D.id)), F = N.length > 0 ? N.reduce((D, V) => V.position.x > D.position.x ? V : D, N[0]).position.x + j + Qt : u.position.x;
|
|
437
|
+
n(u, { x: F, y }, !0);
|
|
438
|
+
},
|
|
439
|
+
[o, h, l, n]
|
|
440
|
+
), a = z(
|
|
441
|
+
(m, u) => {
|
|
442
|
+
if (!u.isValid) {
|
|
443
|
+
const { clientX: f, clientY: x } = "changedTouches" in m ? m.changedTouches[0] : m, E = u.fromNode;
|
|
444
|
+
if (!E)
|
|
445
|
+
return;
|
|
446
|
+
const j = r({ x: f, y: x }), y = E.parentId ? o(E.parentId) : void 0, v = y?.position ?? { x: 0, y: 0 }, I = y ? { x: j.x - v.x, y: j.y - v.y } : j;
|
|
447
|
+
n(E, I);
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
[n, o, r]
|
|
451
|
+
), d = z(
|
|
452
|
+
(m) => {
|
|
453
|
+
s((u) => {
|
|
454
|
+
const f = u.filter((j) => !m.find((y) => y.id === j.id)), x = new Set(m.map((j) => j.source)), E = /* @__PURE__ */ new Map();
|
|
455
|
+
return f.forEach((j) => {
|
|
456
|
+
E.set(j.source, (E.get(j.source) ?? 0) + 1);
|
|
457
|
+
}), f.map((j) => {
|
|
458
|
+
if (x.has(j.source) && (E.get(j.source) ?? 0) === 1) {
|
|
459
|
+
const { conditions: v, isFallback: I, ...N } = j.data ?? {}, F = N && Object.keys(N).length > 0 ? N : void 0;
|
|
460
|
+
return { ...j, data: F, type: "default" };
|
|
461
|
+
}
|
|
462
|
+
return j;
|
|
463
|
+
});
|
|
464
|
+
});
|
|
465
|
+
},
|
|
466
|
+
[s]
|
|
467
|
+
);
|
|
468
|
+
return {
|
|
469
|
+
isValidConnection: z(
|
|
470
|
+
(m) => {
|
|
471
|
+
if (m.source === m.target)
|
|
472
|
+
return !1;
|
|
473
|
+
const u = o(m.source);
|
|
474
|
+
return u ? !(l().filter((E) => E.source === m.source).length > 0 && !he(u)) : !1;
|
|
475
|
+
},
|
|
476
|
+
[o, l]
|
|
477
|
+
),
|
|
478
|
+
onAddFromHandle: i,
|
|
479
|
+
onConnect: c,
|
|
480
|
+
onConnectEnd: a,
|
|
481
|
+
onEdgesDelete: d
|
|
482
|
+
};
|
|
483
|
+
}, Le = (t) => {
|
|
484
|
+
const { onAddFromHandle: s } = qe();
|
|
485
|
+
return z(
|
|
486
|
+
(r) => {
|
|
487
|
+
r.defaultPrevented || s(t);
|
|
488
|
+
},
|
|
489
|
+
[s, t]
|
|
490
|
+
);
|
|
491
|
+
}, Me = ({ children: t, inGroup: s }) => /* @__PURE__ */ e.jsx("div", { className: T("react-flow__node__wrapper", s ? "in-group" : ""), children: t }), ea = zt(
|
|
492
|
+
"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
493
|
+
{
|
|
494
|
+
defaultVariants: {
|
|
495
|
+
variant: "default"
|
|
496
|
+
},
|
|
497
|
+
variants: {
|
|
498
|
+
variant: {
|
|
499
|
+
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
500
|
+
destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
501
|
+
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
502
|
+
purple: "bg-purple-600 hover:bg-purple-700 text-white",
|
|
503
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90"
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
);
|
|
508
|
+
function ie({
|
|
509
|
+
className: t,
|
|
510
|
+
variant: s,
|
|
511
|
+
asChild: r = !1,
|
|
512
|
+
...o
|
|
513
|
+
}) {
|
|
514
|
+
const h = r ? Bt : "span";
|
|
515
|
+
return /* @__PURE__ */ e.jsx(h, { "data-slot": "badge", className: T(ea({ variant: s }), t), ...o });
|
|
516
|
+
}
|
|
517
|
+
const ta = ({ data: t, isConnectable: s, type: r, parentId: o, id: h }) => {
|
|
518
|
+
const n = M()(t?.label), c = Le(h);
|
|
519
|
+
return /* @__PURE__ */ e.jsxs(Me, { inGroup: !!o, children: [
|
|
520
|
+
/* @__PURE__ */ e.jsx(se, { type: "target", position: oe.Top, isConnectable: s, isConnectableStart: !1 }),
|
|
521
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-1 max-w-full overflow-hidden text-ellipsis text-nowrap text-2xl", children: n }),
|
|
522
|
+
/* @__PURE__ */ e.jsxs(ie, { variant: "destructive", children: [
|
|
523
|
+
/* @__PURE__ */ e.jsx(yt, {}),
|
|
524
|
+
r
|
|
525
|
+
] }),
|
|
526
|
+
/* @__PURE__ */ e.jsx(
|
|
527
|
+
se,
|
|
528
|
+
{
|
|
529
|
+
type: "source",
|
|
530
|
+
position: oe.Bottom,
|
|
531
|
+
isConnectable: s,
|
|
532
|
+
onClick: c,
|
|
533
|
+
className: "hover:!bg-primary/80 !w-6 !h-6 flex cursor-pointer items-center justify-center rounded-sm transition-colors",
|
|
534
|
+
children: /* @__PURE__ */ e.jsx(W, { className: "h-4 w-4 text-primary-foreground" })
|
|
535
|
+
}
|
|
536
|
+
)
|
|
537
|
+
] });
|
|
538
|
+
}, aa = ({ data: t }) => {
|
|
539
|
+
const r = M()(t?.label);
|
|
540
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
541
|
+
/* @__PURE__ */ e.jsx(pt, {}),
|
|
542
|
+
/* @__PURE__ */ e.jsx("div", { className: "-top-3.5 absolute left-6", children: /* @__PURE__ */ e.jsxs(ie, { className: "max-w-50 bg-chart-2", children: [
|
|
543
|
+
/* @__PURE__ */ e.jsx(wt, { className: "!w-3 !h-3" }),
|
|
544
|
+
r
|
|
545
|
+
] }) })
|
|
546
|
+
] });
|
|
547
|
+
}, na = ({ data: t, isConnectable: s, type: r, parentId: o, id: h }) => {
|
|
548
|
+
const n = M()(t?.label), c = Le(h);
|
|
549
|
+
return /* @__PURE__ */ e.jsxs(Me, { inGroup: !!o, children: [
|
|
550
|
+
/* @__PURE__ */ e.jsx(se, { type: "target", position: oe.Top, isConnectable: s, isConnectableStart: !1 }),
|
|
551
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-1 max-w-full overflow-hidden text-ellipsis text-nowrap text-2xl", children: n || t?.name }),
|
|
552
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
553
|
+
r && /* @__PURE__ */ e.jsxs(ie, { variant: "secondary", className: "bg-blue-500 text-white dark:bg-blue-600", children: [
|
|
554
|
+
/* @__PURE__ */ e.jsx(Ft, {}),
|
|
555
|
+
r
|
|
556
|
+
] }),
|
|
557
|
+
t?.type && /* @__PURE__ */ e.jsxs(ie, { variant: "outline", children: [
|
|
558
|
+
/* @__PURE__ */ e.jsx(Ze, {}),
|
|
559
|
+
t.type
|
|
560
|
+
] })
|
|
561
|
+
] }),
|
|
562
|
+
/* @__PURE__ */ e.jsx(
|
|
563
|
+
se,
|
|
564
|
+
{
|
|
565
|
+
type: "source",
|
|
566
|
+
position: oe.Bottom,
|
|
567
|
+
isConnectable: s,
|
|
568
|
+
onClick: c,
|
|
569
|
+
className: "hover:!bg-primary/80 flex cursor-pointer items-center justify-center rounded-sm transition-colors",
|
|
570
|
+
children: /* @__PURE__ */ e.jsx(W, { className: "h-4 w-4 text-primary-foreground" })
|
|
571
|
+
}
|
|
572
|
+
)
|
|
573
|
+
] });
|
|
574
|
+
}, sa = ({ data: t, isConnectable: s, type: r, parentId: o, id: h }) => {
|
|
575
|
+
const n = M()(t?.label), c = Le(h);
|
|
576
|
+
return /* @__PURE__ */ e.jsxs(Me, { inGroup: !!o, children: [
|
|
577
|
+
/* @__PURE__ */ e.jsx(se, { type: "target", position: oe.Top, isConnectable: s }),
|
|
578
|
+
/* @__PURE__ */ e.jsx("div", { className: "mb-1 max-w-full overflow-hidden text-ellipsis text-nowrap text-2xl capitalize", children: n }),
|
|
579
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
580
|
+
/* @__PURE__ */ e.jsxs(ie, { variant: "purple", children: [
|
|
581
|
+
/* @__PURE__ */ e.jsx(St, {}),
|
|
582
|
+
r
|
|
583
|
+
] }),
|
|
584
|
+
t?.type && /* @__PURE__ */ e.jsxs(ie, { variant: "outline", children: [
|
|
585
|
+
/* @__PURE__ */ e.jsx(Ze, {}),
|
|
586
|
+
t.type
|
|
587
|
+
] })
|
|
588
|
+
] }),
|
|
589
|
+
/* @__PURE__ */ e.jsx(
|
|
590
|
+
se,
|
|
591
|
+
{
|
|
592
|
+
type: "source",
|
|
593
|
+
position: oe.Bottom,
|
|
594
|
+
isConnectable: s,
|
|
595
|
+
onClick: c,
|
|
596
|
+
className: "!bg-primary hover:!bg-primary/80 !w-6 !h-6 flex items-center justify-center cursor-pointer transition-colors",
|
|
597
|
+
children: /* @__PURE__ */ e.jsx(W, { className: "w-4 h-4 text-primary-foreground" })
|
|
598
|
+
}
|
|
599
|
+
)
|
|
600
|
+
] });
|
|
601
|
+
}, Qe = {
|
|
602
|
+
[xe.flow]: ta,
|
|
603
|
+
[xe.group]: aa,
|
|
604
|
+
[xe.input]: na,
|
|
605
|
+
[xe.ui]: sa
|
|
606
|
+
}, ve = `You are a Treege decision tree generator. You must generate valid JSON structures for decision trees.
|
|
607
|
+
|
|
608
|
+
IMPORTANT RULES:
|
|
609
|
+
1. Always respond with valid JSON only, no markdown, no code blocks, no explanations outside the JSON
|
|
610
|
+
2. The JSON must have this exact structure: { "nodes": [...], "edges": [...] }
|
|
611
|
+
3. Every node must have: id (string), type (string), position ({ x: number, y: number }), data (object)
|
|
612
|
+
4. Every edge must have: id (string), source (string), target (string)
|
|
613
|
+
5. For regex patterns: ALWAYS use double backslashes (\\\\) for special characters (\\\\s, \\\\d, etc.)
|
|
614
|
+
6. AVOID using "pattern" field unless specifically requested - prefer using simple validation
|
|
615
|
+
|
|
616
|
+
NODE TYPES:
|
|
617
|
+
- "input": Form input fields (text, number, select, checkbox, etc.)
|
|
618
|
+
- "ui": UI elements (title, divider)
|
|
619
|
+
- "flow": Navigation/flow control nodes
|
|
620
|
+
- "group": Container for organizing nodes
|
|
621
|
+
|
|
622
|
+
INPUT NODE TYPES (data.type):
|
|
623
|
+
- "text", "number", "textarea", "password"
|
|
624
|
+
- "select", "radio", "checkbox", "switch"
|
|
625
|
+
- "autocomplete", "date", "daterange", "time", "timerange"
|
|
626
|
+
- "file", "address", "http", "hidden"
|
|
627
|
+
|
|
628
|
+
INPUT NODE DATA STRUCTURE:
|
|
629
|
+
{
|
|
630
|
+
"id": "unique-id",
|
|
631
|
+
"type": "input",
|
|
632
|
+
"position": { "x": 0, "y": 0 },
|
|
633
|
+
"data": {
|
|
634
|
+
"label": "Field Label",
|
|
635
|
+
"name": "fieldName",
|
|
636
|
+
"type": "text",
|
|
637
|
+
"required": true,
|
|
638
|
+
"placeholder": "Enter value...",
|
|
639
|
+
"helperText": "Optional helper text",
|
|
640
|
+
"pattern": "regex pattern (optional)",
|
|
641
|
+
"errorMessage": "Error message if validation fails",
|
|
642
|
+
"options": [{ "value": "val", "label": "Label" }], // for select/radio/checkbox
|
|
643
|
+
"multiple": false // for select/checkbox
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
UI NODE TYPES (data.type):
|
|
648
|
+
- "title": Display a title
|
|
649
|
+
- "divider": Display a divider line
|
|
650
|
+
|
|
651
|
+
UI NODE DATA STRUCTURE:
|
|
652
|
+
{
|
|
653
|
+
"id": "unique-id",
|
|
654
|
+
"type": "ui",
|
|
655
|
+
"position": { "x": 0, "y": 0 },
|
|
656
|
+
"data": {
|
|
657
|
+
"label": "UI Element Label",
|
|
658
|
+
"type": "title" // or "divider"
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
FLOW NODE DATA STRUCTURE:
|
|
663
|
+
{
|
|
664
|
+
"id": "unique-id",
|
|
665
|
+
"type": "flow",
|
|
666
|
+
"position": { "x": 0, "y": 0 },
|
|
667
|
+
"data": {
|
|
668
|
+
"label": "Flow Step Label",
|
|
669
|
+
"targetId": "next-node-id" // optional
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
GROUP NODE DATA STRUCTURE:
|
|
674
|
+
{
|
|
675
|
+
"id": "unique-id",
|
|
676
|
+
"type": "group",
|
|
677
|
+
"position": { "x": 0, "y": 0 },
|
|
678
|
+
"data": {
|
|
679
|
+
"label": "Group Label"
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
EDGE STRUCTURE:
|
|
684
|
+
{
|
|
685
|
+
"id": "edge-id",
|
|
686
|
+
"source": "source-node-id",
|
|
687
|
+
"target": "target-node-id",
|
|
688
|
+
"type": "default" // or "conditional" for advanced flows
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
LAYOUT GUIDELINES:
|
|
692
|
+
- Position nodes in a vertical flow (top to bottom)
|
|
693
|
+
- Start at position { x: 0, y: 0 }
|
|
694
|
+
- Space nodes vertically by exactly 250 pixels between each position (node height 150px + 100px spacing)
|
|
695
|
+
- For horizontal spacing, use 350 pixels
|
|
696
|
+
- Create logical flow from top to bottom
|
|
697
|
+
- IMPORTANT: Keep consistent vertical spacing to avoid overlap
|
|
698
|
+
- Each node position Y should increment by 250: first at y:0, second at y:250, third at y:500, etc.
|
|
699
|
+
|
|
700
|
+
EXAMPLES:
|
|
701
|
+
|
|
702
|
+
User: "Create a simple contact form with name, email and message"
|
|
703
|
+
Response:
|
|
704
|
+
{
|
|
705
|
+
"nodes": [
|
|
706
|
+
{
|
|
707
|
+
"id": "title-1",
|
|
708
|
+
"type": "ui",
|
|
709
|
+
"position": { "x": 0, "y": 0 },
|
|
710
|
+
"data": { "label": "Contact Form", "type": "title" }
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
"id": "name-1",
|
|
714
|
+
"type": "input",
|
|
715
|
+
"position": { "x": 0, "y": 250 },
|
|
716
|
+
"data": {
|
|
717
|
+
"label": "Name",
|
|
718
|
+
"name": "name",
|
|
719
|
+
"type": "text",
|
|
720
|
+
"required": true,
|
|
721
|
+
"placeholder": "Enter your name"
|
|
722
|
+
}
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"id": "email-1",
|
|
726
|
+
"type": "input",
|
|
727
|
+
"position": { "x": 0, "y": 500 },
|
|
728
|
+
"data": {
|
|
729
|
+
"label": "Email",
|
|
730
|
+
"name": "email",
|
|
731
|
+
"type": "text",
|
|
732
|
+
"required": true,
|
|
733
|
+
"placeholder": "your@email.com"
|
|
734
|
+
}
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"id": "message-1",
|
|
738
|
+
"type": "input",
|
|
739
|
+
"position": { "x": 0, "y": 750 },
|
|
740
|
+
"data": {
|
|
741
|
+
"label": "Message",
|
|
742
|
+
"name": "message",
|
|
743
|
+
"type": "textarea",
|
|
744
|
+
"required": true,
|
|
745
|
+
"placeholder": "Enter your message"
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
],
|
|
749
|
+
"edges": [
|
|
750
|
+
{ "id": "e1", "source": "title-1", "target": "name-1" },
|
|
751
|
+
{ "id": "e2", "source": "name-1", "target": "email-1" },
|
|
752
|
+
{ "id": "e3", "source": "email-1", "target": "message-1" }
|
|
753
|
+
]
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
User: "Create a user registration form with age, address and country selector"
|
|
757
|
+
Response:
|
|
758
|
+
{
|
|
759
|
+
"nodes": [
|
|
760
|
+
{
|
|
761
|
+
"id": "title-1",
|
|
762
|
+
"type": "ui",
|
|
763
|
+
"position": { "x": 0, "y": 0 },
|
|
764
|
+
"data": { "label": "User Registration", "type": "title" }
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
"id": "age-1",
|
|
768
|
+
"type": "input",
|
|
769
|
+
"position": { "x": 0, "y": 250 },
|
|
770
|
+
"data": {
|
|
771
|
+
"label": "Age",
|
|
772
|
+
"name": "age",
|
|
773
|
+
"type": "number",
|
|
774
|
+
"required": true,
|
|
775
|
+
"placeholder": "Enter your age"
|
|
776
|
+
}
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
"id": "address-1",
|
|
780
|
+
"type": "input",
|
|
781
|
+
"position": { "x": 0, "y": 500 },
|
|
782
|
+
"data": {
|
|
783
|
+
"label": "Address",
|
|
784
|
+
"name": "address",
|
|
785
|
+
"type": "address",
|
|
786
|
+
"required": true,
|
|
787
|
+
"placeholder": "Enter your address"
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
"id": "country-1",
|
|
792
|
+
"type": "input",
|
|
793
|
+
"position": { "x": 0, "y": 750 },
|
|
794
|
+
"data": {
|
|
795
|
+
"label": "Country",
|
|
796
|
+
"name": "country",
|
|
797
|
+
"type": "select",
|
|
798
|
+
"required": true,
|
|
799
|
+
"options": [
|
|
800
|
+
{ "value": "us", "label": "United States" },
|
|
801
|
+
{ "value": "ca", "label": "Canada" },
|
|
802
|
+
{ "value": "uk", "label": "United Kingdom" },
|
|
803
|
+
{ "value": "fr", "label": "France" },
|
|
804
|
+
{ "value": "de", "label": "Germany" }
|
|
805
|
+
]
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
],
|
|
809
|
+
"edges": [
|
|
810
|
+
{ "id": "e1", "source": "title-1", "target": "age-1" },
|
|
811
|
+
{ "id": "e2", "source": "age-1", "target": "address-1" },
|
|
812
|
+
{ "id": "e3", "source": "address-1", "target": "country-1" }
|
|
813
|
+
]
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
Remember:
|
|
817
|
+
- Always respond with ONLY valid JSON
|
|
818
|
+
- No markdown code blocks
|
|
819
|
+
- No explanations outside the JSON
|
|
820
|
+
- Follow the exact structure shown above
|
|
821
|
+
`, be = {
|
|
822
|
+
claude: "claude-3-5-haiku-20241022",
|
|
823
|
+
deepseek: "deepseek-chat",
|
|
824
|
+
gemini: "gemini-2.5-flash",
|
|
825
|
+
openai: "gpt-4o-mini"
|
|
826
|
+
};
|
|
827
|
+
function Ne(t) {
|
|
828
|
+
try {
|
|
829
|
+
return JSON.parse(t);
|
|
830
|
+
} catch (s) {
|
|
831
|
+
const r = t.replace(/```json\n?/g, "").replace(/```\n?/g, "").trim();
|
|
832
|
+
try {
|
|
833
|
+
return JSON.parse(r);
|
|
834
|
+
} catch {
|
|
835
|
+
throw console.error("Failed to parse AI response:", t.substring(0, 500)), new Error(`Invalid JSON response from AI: ${s instanceof Error ? s.message : "Unknown error"}`);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
async function oa(t) {
|
|
840
|
+
const s = t.config.model || be.gemini, r = t.config.temperature ?? 0.7, o = await fetch(
|
|
841
|
+
`https://generativelanguage.googleapis.com/v1beta/models/${s}:generateContent?key=${t.config.apiKey}`,
|
|
842
|
+
{
|
|
843
|
+
body: JSON.stringify({
|
|
844
|
+
contents: [
|
|
845
|
+
{
|
|
846
|
+
parts: [
|
|
847
|
+
{
|
|
848
|
+
text: `${ve}
|
|
849
|
+
|
|
850
|
+
User request: ${t.prompt}`
|
|
851
|
+
}
|
|
852
|
+
]
|
|
853
|
+
}
|
|
854
|
+
],
|
|
855
|
+
generationConfig: {
|
|
856
|
+
responseMimeType: "application/json",
|
|
857
|
+
temperature: r
|
|
858
|
+
}
|
|
859
|
+
}),
|
|
860
|
+
headers: { "Content-Type": "application/json" },
|
|
861
|
+
method: "POST"
|
|
862
|
+
}
|
|
863
|
+
);
|
|
864
|
+
if (!o.ok) {
|
|
865
|
+
const n = await o.text();
|
|
866
|
+
throw new Error(`Gemini API error: ${n}`);
|
|
867
|
+
}
|
|
868
|
+
const l = (await o.json()).candidates?.[0]?.content?.parts?.[0]?.text;
|
|
869
|
+
if (!l)
|
|
870
|
+
throw new Error("No response from Gemini");
|
|
871
|
+
return Ne(l);
|
|
872
|
+
}
|
|
873
|
+
async function ra(t) {
|
|
874
|
+
const s = t.config.model || be.openai, r = t.config.temperature ?? 0.7, o = await fetch("https://api.openai.com/v1/chat/completions", {
|
|
875
|
+
body: JSON.stringify({
|
|
876
|
+
messages: [
|
|
877
|
+
{ content: ve, role: "system" },
|
|
878
|
+
{ content: t.prompt, role: "user" }
|
|
879
|
+
],
|
|
880
|
+
model: s,
|
|
881
|
+
response_format: { type: "json_object" },
|
|
882
|
+
temperature: r
|
|
883
|
+
}),
|
|
884
|
+
headers: {
|
|
885
|
+
Authorization: `Bearer ${t.config.apiKey}`,
|
|
886
|
+
"Content-Type": "application/json"
|
|
887
|
+
},
|
|
888
|
+
method: "POST"
|
|
889
|
+
});
|
|
890
|
+
if (!o.ok) {
|
|
891
|
+
const n = await o.text();
|
|
892
|
+
throw new Error(`OpenAI API error: ${n}`);
|
|
893
|
+
}
|
|
894
|
+
const l = (await o.json()).choices?.[0]?.message?.content;
|
|
895
|
+
if (!l)
|
|
896
|
+
throw new Error("No response from OpenAI");
|
|
897
|
+
return Ne(l);
|
|
898
|
+
}
|
|
899
|
+
async function la(t) {
|
|
900
|
+
const s = t.config.model || be.deepseek, r = t.config.temperature ?? 0.7, o = await fetch("https://api.deepseek.com/v1/chat/completions", {
|
|
901
|
+
body: JSON.stringify({
|
|
902
|
+
messages: [
|
|
903
|
+
{ content: ve, role: "system" },
|
|
904
|
+
{ content: t.prompt, role: "user" }
|
|
905
|
+
],
|
|
906
|
+
model: s,
|
|
907
|
+
response_format: { type: "json_object" },
|
|
908
|
+
temperature: r
|
|
909
|
+
}),
|
|
910
|
+
headers: {
|
|
911
|
+
Authorization: `Bearer ${t.config.apiKey}`,
|
|
912
|
+
"Content-Type": "application/json"
|
|
913
|
+
},
|
|
914
|
+
method: "POST"
|
|
915
|
+
});
|
|
916
|
+
if (!o.ok) {
|
|
917
|
+
const n = await o.text();
|
|
918
|
+
throw new Error(`DeepSeek API error: ${n}`);
|
|
919
|
+
}
|
|
920
|
+
const l = (await o.json()).choices?.[0]?.message?.content;
|
|
921
|
+
if (!l)
|
|
922
|
+
throw new Error("No response from DeepSeek");
|
|
923
|
+
return Ne(l);
|
|
924
|
+
}
|
|
925
|
+
async function ia(t) {
|
|
926
|
+
const s = t.config.model || be.claude, r = t.config.temperature ?? 0.7, o = await fetch("https://api.anthropic.com/v1/messages", {
|
|
927
|
+
body: JSON.stringify({
|
|
928
|
+
max_tokens: 4096,
|
|
929
|
+
messages: [{ content: t.prompt, role: "user" }],
|
|
930
|
+
model: s,
|
|
931
|
+
system: ve,
|
|
932
|
+
temperature: r
|
|
933
|
+
}),
|
|
934
|
+
headers: {
|
|
935
|
+
"anthropic-version": "2023-06-01",
|
|
936
|
+
"Content-Type": "application/json",
|
|
937
|
+
"x-api-key": t.config.apiKey
|
|
938
|
+
},
|
|
939
|
+
method: "POST"
|
|
940
|
+
});
|
|
941
|
+
if (!o.ok) {
|
|
942
|
+
const n = await o.text();
|
|
943
|
+
throw new Error(`Claude API error: ${n}`);
|
|
944
|
+
}
|
|
945
|
+
const l = (await o.json()).content?.[0]?.text;
|
|
946
|
+
if (!l)
|
|
947
|
+
throw new Error("No response from Claude");
|
|
948
|
+
return Ne(l);
|
|
949
|
+
}
|
|
950
|
+
function da(t) {
|
|
951
|
+
switch (t.config.provider) {
|
|
952
|
+
case "gemini":
|
|
953
|
+
return oa(t);
|
|
954
|
+
case "openai":
|
|
955
|
+
return ra(t);
|
|
956
|
+
case "deepseek":
|
|
957
|
+
return la(t);
|
|
958
|
+
case "claude":
|
|
959
|
+
return ia(t);
|
|
960
|
+
default:
|
|
961
|
+
throw new Error(`Unsupported AI provider: ${t.config.provider}`);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
function ca({ ...t }) {
|
|
965
|
+
return /* @__PURE__ */ e.jsx(A.Root, { "data-slot": "dialog", ...t });
|
|
966
|
+
}
|
|
967
|
+
function ua({ ...t }) {
|
|
968
|
+
return /* @__PURE__ */ e.jsx(A.Trigger, { "data-slot": "dialog-trigger", ...t });
|
|
969
|
+
}
|
|
970
|
+
function ha({ ...t }) {
|
|
971
|
+
return /* @__PURE__ */ e.jsx(A.Portal, { "data-slot": "dialog-portal", ...t });
|
|
972
|
+
}
|
|
973
|
+
function ma({ className: t, ...s }) {
|
|
974
|
+
return /* @__PURE__ */ e.jsx(
|
|
975
|
+
A.Overlay,
|
|
976
|
+
{
|
|
977
|
+
"data-slot": "dialog-overlay",
|
|
978
|
+
className: T(
|
|
979
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
980
|
+
t
|
|
981
|
+
),
|
|
982
|
+
...s
|
|
983
|
+
}
|
|
984
|
+
);
|
|
985
|
+
}
|
|
986
|
+
function pa({
|
|
987
|
+
className: t,
|
|
988
|
+
children: s,
|
|
989
|
+
showCloseButton: r = !0,
|
|
990
|
+
...o
|
|
991
|
+
}) {
|
|
992
|
+
return /* @__PURE__ */ e.jsxs(ha, { "data-slot": "dialog-portal", children: [
|
|
993
|
+
/* @__PURE__ */ e.jsx(ma, {}),
|
|
994
|
+
/* @__PURE__ */ e.jsxs(
|
|
995
|
+
A.Content,
|
|
996
|
+
{
|
|
997
|
+
"data-slot": "dialog-content",
|
|
998
|
+
className: T(
|
|
999
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
1000
|
+
t
|
|
1001
|
+
),
|
|
1002
|
+
...o,
|
|
1003
|
+
children: [
|
|
1004
|
+
s,
|
|
1005
|
+
r && /* @__PURE__ */ e.jsxs(
|
|
1006
|
+
A.Close,
|
|
1007
|
+
{
|
|
1008
|
+
"data-slot": "dialog-close",
|
|
1009
|
+
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1010
|
+
children: [
|
|
1011
|
+
/* @__PURE__ */ e.jsx(Ke, {}),
|
|
1012
|
+
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Close" })
|
|
1013
|
+
]
|
|
1014
|
+
}
|
|
1015
|
+
)
|
|
1016
|
+
]
|
|
1017
|
+
}
|
|
1018
|
+
)
|
|
1019
|
+
] });
|
|
1020
|
+
}
|
|
1021
|
+
function xa({ className: t, ...s }) {
|
|
1022
|
+
return /* @__PURE__ */ e.jsx("div", { "data-slot": "dialog-header", className: T("flex flex-col gap-2 text-center sm:text-left", t), ...s });
|
|
1023
|
+
}
|
|
1024
|
+
function ga({ className: t, ...s }) {
|
|
1025
|
+
return /* @__PURE__ */ e.jsx("div", { "data-slot": "dialog-footer", className: T("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", t), ...s });
|
|
1026
|
+
}
|
|
1027
|
+
function ja({ className: t, ...s }) {
|
|
1028
|
+
return /* @__PURE__ */ e.jsx(A.Title, { "data-slot": "dialog-title", className: T("text-lg leading-none font-semibold", t), ...s });
|
|
1029
|
+
}
|
|
1030
|
+
function Ca({ className: t, ...s }) {
|
|
1031
|
+
return /* @__PURE__ */ e.jsx(A.Description, { "data-slot": "dialog-description", className: T("text-muted-foreground text-sm", t), ...s });
|
|
1032
|
+
}
|
|
1033
|
+
const fa = ({ aiConfig: t, onGenerate: s }) => {
|
|
1034
|
+
const [r, o] = $(!1), [h, l] = $(""), [n, c] = $(!1), i = M(), a = async () => {
|
|
1035
|
+
if (!h.trim()) {
|
|
1036
|
+
H.error(i("editor.aiGenerator.enterDescription"));
|
|
1037
|
+
return;
|
|
1038
|
+
}
|
|
1039
|
+
if (!t?.apiKey) {
|
|
1040
|
+
H.error(i("editor.aiGenerator.missingApiKey"), {
|
|
1041
|
+
description: i("editor.aiGenerator.missingApiKeyDesc")
|
|
1042
|
+
});
|
|
1043
|
+
return;
|
|
1044
|
+
}
|
|
1045
|
+
c(!0);
|
|
1046
|
+
try {
|
|
1047
|
+
const p = await da({
|
|
1048
|
+
config: t,
|
|
1049
|
+
prompt: h.trim()
|
|
1050
|
+
});
|
|
1051
|
+
s({
|
|
1052
|
+
edges: p.edges,
|
|
1053
|
+
nodes: p.nodes
|
|
1054
|
+
}), H.success(i("editor.aiGenerator.successTitle"), {
|
|
1055
|
+
description: i("editor.aiGenerator.successDescription").replace("{nodes}", String(p.nodes.length)).replace("{edges}", String(p.edges.length))
|
|
1056
|
+
}), l(""), o(!1);
|
|
1057
|
+
} catch (p) {
|
|
1058
|
+
console.error("AI generation error:", p), H.error(i("editor.aiGenerator.failedToGenerate"), {
|
|
1059
|
+
description: p instanceof Error ? p.message : i("editor.aiGenerator.unknownError")
|
|
1060
|
+
});
|
|
1061
|
+
} finally {
|
|
1062
|
+
c(!1);
|
|
1063
|
+
}
|
|
1064
|
+
}, d = (p) => {
|
|
1065
|
+
(p.metaKey || p.ctrlKey) && p.key === "Enter" && (p.preventDefault(), a());
|
|
1066
|
+
};
|
|
1067
|
+
return /* @__PURE__ */ e.jsxs(ca, { open: r, onOpenChange: o, children: [
|
|
1068
|
+
/* @__PURE__ */ e.jsx(ua, { asChild: !0, children: /* @__PURE__ */ e.jsxs(k, { variant: "outline", size: "sm", disabled: !t?.apiKey, children: [
|
|
1069
|
+
/* @__PURE__ */ e.jsx(He, { className: "h-4 w-4 text-[#13d3b4]" }),
|
|
1070
|
+
" ",
|
|
1071
|
+
i("editor.aiGenerator.buttonLabel")
|
|
1072
|
+
] }) }),
|
|
1073
|
+
/* @__PURE__ */ e.jsxs(pa, { className: "sm:max-w-[550px]", children: [
|
|
1074
|
+
/* @__PURE__ */ e.jsxs(xa, { children: [
|
|
1075
|
+
/* @__PURE__ */ e.jsx(ja, { children: i("editor.aiGenerator.title") }),
|
|
1076
|
+
/* @__PURE__ */ e.jsx(Ca, { children: i("editor.aiGenerator.titleDescription") })
|
|
1077
|
+
] }),
|
|
1078
|
+
/* @__PURE__ */ e.jsxs("div", { className: "grid gap-4 py-4", children: [
|
|
1079
|
+
/* @__PURE__ */ e.jsxs("div", { className: "grid gap-2", children: [
|
|
1080
|
+
/* @__PURE__ */ e.jsx("label", { htmlFor: "ai-prompt", className: "font-medium text-sm", children: i("editor.aiGenerator.description") }),
|
|
1081
|
+
/* @__PURE__ */ e.jsx(
|
|
1082
|
+
Ue,
|
|
1083
|
+
{
|
|
1084
|
+
placeholder: i("editor.aiGenerator.descriptionPlaceholder"),
|
|
1085
|
+
value: h,
|
|
1086
|
+
onChange: (p) => l(p.target.value),
|
|
1087
|
+
onKeyDown: d,
|
|
1088
|
+
rows: 6,
|
|
1089
|
+
disabled: n,
|
|
1090
|
+
className: "resize-none"
|
|
1091
|
+
}
|
|
1092
|
+
),
|
|
1093
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-xs", children: i("editor.aiGenerator.keyboardShortcut").replace("{cmdEnter}", "⌘ Enter").replace("{ctrlEnter}", "Ctrl Enter") })
|
|
1094
|
+
] }),
|
|
1095
|
+
!t?.apiKey && /* @__PURE__ */ e.jsxs("div", { className: "rounded-md bg-muted p-3 text-sm", children: [
|
|
1096
|
+
/* @__PURE__ */ e.jsx("p", { className: "font-medium", children: i("editor.aiGenerator.aiNotConfigured") }),
|
|
1097
|
+
/* @__PURE__ */ e.jsxs("p", { className: "mt-1 text-muted-foreground text-xs", children: [
|
|
1098
|
+
i("editor.aiGenerator.aiNotConfiguredDesc").replace("{code}", ""),
|
|
1099
|
+
" ",
|
|
1100
|
+
/* @__PURE__ */ e.jsx("code", { className: "rounded bg-background px-1 py-0.5", children: "aiConfig" })
|
|
1101
|
+
] })
|
|
1102
|
+
] })
|
|
1103
|
+
] }),
|
|
1104
|
+
/* @__PURE__ */ e.jsxs(ga, { children: [
|
|
1105
|
+
/* @__PURE__ */ e.jsx(k, { variant: "outline", onClick: () => o(!1), disabled: n, children: i("editor.aiGenerator.cancel") }),
|
|
1106
|
+
/* @__PURE__ */ e.jsx(k, { onClick: a, disabled: n || !h.trim() || !t?.apiKey, children: n ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1107
|
+
/* @__PURE__ */ e.jsx(Et, { className: "h-4 w-4 animate-spin" }),
|
|
1108
|
+
i("editor.aiGenerator.generating")
|
|
1109
|
+
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1110
|
+
/* @__PURE__ */ e.jsx(He, { className: "h-4 w-4 text-[--treege-color-primary]" }),
|
|
1111
|
+
i("editor.aiGenerator.generate")
|
|
1112
|
+
] }) })
|
|
1113
|
+
] })
|
|
1114
|
+
] })
|
|
1115
|
+
] });
|
|
1116
|
+
};
|
|
1117
|
+
function Se({ ...t }) {
|
|
1118
|
+
return /* @__PURE__ */ e.jsx(Y.Root, { "data-slot": "dropdown-menu", ...t });
|
|
1119
|
+
}
|
|
1120
|
+
function Ee({ ...t }) {
|
|
1121
|
+
return /* @__PURE__ */ e.jsx(Y.Trigger, { "data-slot": "dropdown-menu-trigger", ...t });
|
|
1122
|
+
}
|
|
1123
|
+
function ke({ className: t, sideOffset: s = 4, ...r }) {
|
|
1124
|
+
return /* @__PURE__ */ e.jsx(Y.Portal, { children: /* @__PURE__ */ e.jsx(
|
|
1125
|
+
Y.Content,
|
|
1126
|
+
{
|
|
1127
|
+
"data-slot": "dropdown-menu-content",
|
|
1128
|
+
sideOffset: s,
|
|
1129
|
+
className: T(
|
|
1130
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
1131
|
+
t
|
|
1132
|
+
),
|
|
1133
|
+
...r
|
|
1134
|
+
}
|
|
1135
|
+
) });
|
|
1136
|
+
}
|
|
1137
|
+
function ze({ ...t }) {
|
|
1138
|
+
return /* @__PURE__ */ e.jsx(Y.Group, { "data-slot": "dropdown-menu-group", ...t });
|
|
1139
|
+
}
|
|
1140
|
+
function q({
|
|
1141
|
+
className: t,
|
|
1142
|
+
inset: s,
|
|
1143
|
+
variant: r = "default",
|
|
1144
|
+
...o
|
|
1145
|
+
}) {
|
|
1146
|
+
return /* @__PURE__ */ e.jsx(
|
|
1147
|
+
Y.Item,
|
|
1148
|
+
{
|
|
1149
|
+
"data-slot": "dropdown-menu-item",
|
|
1150
|
+
"data-inset": s,
|
|
1151
|
+
"data-variant": r,
|
|
1152
|
+
className: T(
|
|
1153
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1154
|
+
t
|
|
1155
|
+
),
|
|
1156
|
+
...o
|
|
1157
|
+
}
|
|
1158
|
+
);
|
|
1159
|
+
}
|
|
1160
|
+
function va({
|
|
1161
|
+
className: t,
|
|
1162
|
+
inset: s,
|
|
1163
|
+
...r
|
|
1164
|
+
}) {
|
|
1165
|
+
return /* @__PURE__ */ e.jsx(
|
|
1166
|
+
Y.Label,
|
|
1167
|
+
{
|
|
1168
|
+
"data-slot": "dropdown-menu-label",
|
|
1169
|
+
"data-inset": s,
|
|
1170
|
+
className: T("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", t),
|
|
1171
|
+
...r
|
|
1172
|
+
}
|
|
1173
|
+
);
|
|
1174
|
+
}
|
|
1175
|
+
function $e({ className: t, ...s }) {
|
|
1176
|
+
return /* @__PURE__ */ e.jsx(
|
|
1177
|
+
Y.Separator,
|
|
1178
|
+
{
|
|
1179
|
+
"data-slot": "dropdown-menu-separator",
|
|
1180
|
+
className: T("bg-border -mx-1 my-1 h-px", t),
|
|
1181
|
+
...s
|
|
1182
|
+
}
|
|
1183
|
+
);
|
|
1184
|
+
}
|
|
1185
|
+
const ba = le(), Na = ({ onExportJson: t, onSave: s }) => {
|
|
1186
|
+
const { flowId: r, setFlowId: o, aiConfig: h } = Ye(), { setNodes: l, setEdges: n, addNodes: c, screenToFlowPosition: i } = pe(), a = r || ba, d = Oe(), p = Re(), m = Gt(null), u = M(), f = () => {
|
|
1187
|
+
const N = (window.innerWidth || 0) / 2, F = (window.innerHeight || 0) / 2, D = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--node-width"), 10), V = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--node-height"), 10), g = i({ x: N - D, y: F - V });
|
|
1188
|
+
c([
|
|
1189
|
+
{
|
|
1190
|
+
...Xe,
|
|
1191
|
+
id: le(),
|
|
1192
|
+
position: g,
|
|
1193
|
+
selected: !0
|
|
1194
|
+
}
|
|
1195
|
+
]);
|
|
1196
|
+
}, x = ({ target: N }) => {
|
|
1197
|
+
const F = N.files?.[0];
|
|
1198
|
+
if (!F)
|
|
1199
|
+
return;
|
|
1200
|
+
const D = new FileReader();
|
|
1201
|
+
D.onload = (V) => {
|
|
1202
|
+
try {
|
|
1203
|
+
const g = JSON.parse(V.target?.result);
|
|
1204
|
+
g && Array.isArray(g.nodes) && Array.isArray(g.edges) ? (l(g.nodes), n(g.edges), H.success(u("editor.actionsPanel.importSuccess"), {
|
|
1205
|
+
description: u("editor.actionsPanel.importSuccessDesc")
|
|
1206
|
+
})) : H.error(u("editor.actionsPanel.invalidJson"), {
|
|
1207
|
+
description: u("editor.actionsPanel.invalidJsonDesc")
|
|
1208
|
+
});
|
|
1209
|
+
} catch (g) {
|
|
1210
|
+
console.warn(g), H.error(u("editor.actionsPanel.parseError"), {
|
|
1211
|
+
description: u("editor.actionsPanel.parseErrorDesc")
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
m.current && (m.current.value = "");
|
|
1215
|
+
}, D.readAsText(F);
|
|
1216
|
+
}, E = () => {
|
|
1217
|
+
const N = { edges: p, id: a, nodes: d }, F = new Blob([JSON.stringify(N, null, 2)], { type: "application/json" }), D = URL.createObjectURL(F), V = document.createElement("a");
|
|
1218
|
+
V.href = D, V.download = "treege.json", V.click(), URL.revokeObjectURL(D), H.success(u("editor.actionsPanel.downloadSuccess"), {
|
|
1219
|
+
description: u("editor.actionsPanel.downloadSuccessDesc")
|
|
1220
|
+
}), r || o?.(a), t?.(N);
|
|
1221
|
+
}, j = z(() => {
|
|
1222
|
+
r || o?.(a), s?.({ edges: p, id: a, nodes: d });
|
|
1223
|
+
}, [p, r, a, d, s, o]), y = async () => {
|
|
1224
|
+
try {
|
|
1225
|
+
await navigator.clipboard.writeText(a), H.success(u("editor.actionsPanel.idCopied"), {
|
|
1226
|
+
description: a
|
|
1227
|
+
});
|
|
1228
|
+
} catch {
|
|
1229
|
+
H.error(u("editor.actionsPanel.copyFailed"));
|
|
1230
|
+
}
|
|
1231
|
+
}, v = () => {
|
|
1232
|
+
l([]), n([]), H.success(u("editor.actionsPanel.clearSuccess"), {
|
|
1233
|
+
description: u("editor.actionsPanel.clearSuccessDesc")
|
|
1234
|
+
});
|
|
1235
|
+
}, I = (N) => {
|
|
1236
|
+
l(N.nodes), n(N.edges);
|
|
1237
|
+
};
|
|
1238
|
+
return Ht(() => {
|
|
1239
|
+
const N = (F) => {
|
|
1240
|
+
(F.ctrlKey || F.metaKey) && F.key === "s" && (F.preventDefault(), j());
|
|
1241
|
+
};
|
|
1242
|
+
return window.addEventListener("keydown", N), () => {
|
|
1243
|
+
window.removeEventListener("keydown", N);
|
|
1244
|
+
};
|
|
1245
|
+
}, [j]), /* @__PURE__ */ e.jsxs(xt, { position: "top-right", className: "flex gap-2", children: [
|
|
1246
|
+
/* @__PURE__ */ e.jsx(fa, { aiConfig: h, onGenerate: I }),
|
|
1247
|
+
/* @__PURE__ */ e.jsxs(k, { variant: "outline", size: "sm", onClick: f, children: [
|
|
1248
|
+
/* @__PURE__ */ e.jsx(W, {}),
|
|
1249
|
+
" ",
|
|
1250
|
+
u("editor.actionsPanel.addNode")
|
|
1251
|
+
] }),
|
|
1252
|
+
/* @__PURE__ */ e.jsxs(k, { variant: "outline", size: "sm", onClick: j, children: [
|
|
1253
|
+
/* @__PURE__ */ e.jsx(kt, {}),
|
|
1254
|
+
" ",
|
|
1255
|
+
u("common.save")
|
|
1256
|
+
] }),
|
|
1257
|
+
/* @__PURE__ */ e.jsxs(Se, { children: [
|
|
1258
|
+
/* @__PURE__ */ e.jsx(Ee, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "outline", size: "sm", children: /* @__PURE__ */ e.jsx(Pt, {}) }) }),
|
|
1259
|
+
/* @__PURE__ */ e.jsxs(ke, { align: "start", children: [
|
|
1260
|
+
/* @__PURE__ */ e.jsx(va, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
1261
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs", children: "Treege ID" }),
|
|
1262
|
+
/* @__PURE__ */ e.jsxs(
|
|
1263
|
+
"button",
|
|
1264
|
+
{
|
|
1265
|
+
onClick: y,
|
|
1266
|
+
className: "flex items-center gap-2 font-mono text-muted-foreground transition-colors hover:text-primary",
|
|
1267
|
+
type: "button",
|
|
1268
|
+
children: [
|
|
1269
|
+
/* @__PURE__ */ e.jsx(Tt, { className: "h-3 w-3" }),
|
|
1270
|
+
/* @__PURE__ */ e.jsx("span", { className: "truncate text-xs", children: a })
|
|
1271
|
+
]
|
|
1272
|
+
}
|
|
1273
|
+
)
|
|
1274
|
+
] }) }),
|
|
1275
|
+
/* @__PURE__ */ e.jsx($e, {}),
|
|
1276
|
+
/* @__PURE__ */ e.jsxs(ze, { children: [
|
|
1277
|
+
/* @__PURE__ */ e.jsxs(q, { onClick: () => m?.current?.click(), children: [
|
|
1278
|
+
/* @__PURE__ */ e.jsx(Dt, {}),
|
|
1279
|
+
" ",
|
|
1280
|
+
u("editor.actionsPanel.importJson")
|
|
1281
|
+
] }),
|
|
1282
|
+
/* @__PURE__ */ e.jsxs(q, { onClick: E, children: [
|
|
1283
|
+
/* @__PURE__ */ e.jsx(Vt, {}),
|
|
1284
|
+
" ",
|
|
1285
|
+
u("editor.actionsPanel.exportJson")
|
|
1286
|
+
] })
|
|
1287
|
+
] }),
|
|
1288
|
+
/* @__PURE__ */ e.jsx($e, {}),
|
|
1289
|
+
/* @__PURE__ */ e.jsx(ze, { children: /* @__PURE__ */ e.jsxs(q, { onClick: v, className: "text-destructive focus:text-destructive", children: [
|
|
1290
|
+
/* @__PURE__ */ e.jsx(Ot, { className: "text-destructive" }),
|
|
1291
|
+
" ",
|
|
1292
|
+
u("editor.actionsPanel.clear")
|
|
1293
|
+
] }) })
|
|
1294
|
+
] })
|
|
1295
|
+
] }),
|
|
1296
|
+
/* @__PURE__ */ e.jsx("input", { type: "file", accept: "application/json,.json", className: "hidden", ref: m, onChange: x })
|
|
1297
|
+
] });
|
|
1298
|
+
}, ya = {
|
|
1299
|
+
ar: "ar",
|
|
1300
|
+
de: "de",
|
|
1301
|
+
en: "en",
|
|
1302
|
+
es: "es",
|
|
1303
|
+
fr: "fr",
|
|
1304
|
+
it: "it",
|
|
1305
|
+
pt: "pt"
|
|
1306
|
+
}, Q = ({ value: t = "en", onValueChange: s }) => /* @__PURE__ */ e.jsxs(U, { value: t, onValueChange: s, children: [
|
|
1307
|
+
/* @__PURE__ */ e.jsx(R, { className: "uppercase", children: /* @__PURE__ */ e.jsx(Z, { placeholder: "" }) }),
|
|
1308
|
+
/* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsx(J, { children: Object.values(ya).map((r) => /* @__PURE__ */ e.jsx(w, { value: r, className: "uppercase", children: r }, r)) }) })
|
|
1309
|
+
] }), ce = () => {
|
|
1310
|
+
const { setNodes: t, setEdges: s, getNodes: r } = pe(), o = z(() => {
|
|
1311
|
+
t((i) => i.map(({ selected: a, ...d }) => d)), s((i) => i.map(({ selected: a, ...d }) => d));
|
|
1312
|
+
}, [s, t]), h = z(
|
|
1313
|
+
(i, a) => {
|
|
1314
|
+
t(
|
|
1315
|
+
(d) => d.map((p) => p.id === i ? {
|
|
1316
|
+
...p,
|
|
1317
|
+
data: {
|
|
1318
|
+
...p.data,
|
|
1319
|
+
...a
|
|
1320
|
+
}
|
|
1321
|
+
} : p)
|
|
1322
|
+
);
|
|
1323
|
+
},
|
|
1324
|
+
[t]
|
|
1325
|
+
), l = z(
|
|
1326
|
+
(i, a) => {
|
|
1327
|
+
t(
|
|
1328
|
+
(d) => d.map((p) => p.id === i ? {
|
|
1329
|
+
...p,
|
|
1330
|
+
data: {},
|
|
1331
|
+
type: a
|
|
1332
|
+
} : p)
|
|
1333
|
+
);
|
|
1334
|
+
},
|
|
1335
|
+
[t]
|
|
1336
|
+
), n = z(
|
|
1337
|
+
(i) => {
|
|
1338
|
+
const a = r().find((d) => d.selected);
|
|
1339
|
+
a && l(a.id, i);
|
|
1340
|
+
},
|
|
1341
|
+
[r, l]
|
|
1342
|
+
), c = z(
|
|
1343
|
+
(i) => {
|
|
1344
|
+
const a = r().find((d) => d.selected);
|
|
1345
|
+
a && h(a.id, i);
|
|
1346
|
+
},
|
|
1347
|
+
[r, h]
|
|
1348
|
+
);
|
|
1349
|
+
return {
|
|
1350
|
+
clearSelection: o,
|
|
1351
|
+
updateNodeData: h,
|
|
1352
|
+
updateNodeType: l,
|
|
1353
|
+
updateSelectedNodeData: c,
|
|
1354
|
+
updateSelectedNodeType: n
|
|
1355
|
+
};
|
|
1356
|
+
}, X = () => {
|
|
1357
|
+
const t = Oe(), s = ne(() => t.filter(fe), [t]), r = ne(() => t.filter((h) => h.selected), [t]), o = ne(() => t.find((h) => h.selected), [t]);
|
|
1358
|
+
return {
|
|
1359
|
+
groupNodes: s,
|
|
1360
|
+
hasSelectedNodes: r.length > 0,
|
|
1361
|
+
nodes: t,
|
|
1362
|
+
selectedNode: o,
|
|
1363
|
+
selectedNodes: r
|
|
1364
|
+
};
|
|
1365
|
+
}, wa = () => {
|
|
1366
|
+
const [t, s] = $("en"), { updateSelectedNodeData: r } = ce(), { selectedNode: o } = X(), h = M(), { Field: l } = de({
|
|
1367
|
+
defaultValues: {
|
|
1368
|
+
label: o?.data?.label || { en: "" },
|
|
1369
|
+
targetId: o?.data?.targetId || ""
|
|
1370
|
+
},
|
|
1371
|
+
listeners: {
|
|
1372
|
+
onChange: ({ formApi: n }) => {
|
|
1373
|
+
n.handleSubmit().then();
|
|
1374
|
+
},
|
|
1375
|
+
onChangeDebounceMs: 150
|
|
1376
|
+
},
|
|
1377
|
+
onSubmit: ({ value: n }) => {
|
|
1378
|
+
r(n);
|
|
1379
|
+
}
|
|
1380
|
+
});
|
|
1381
|
+
return /* @__PURE__ */ e.jsx(
|
|
1382
|
+
"form",
|
|
1383
|
+
{
|
|
1384
|
+
onSubmit: (n) => {
|
|
1385
|
+
n.preventDefault(), n.stopPropagation();
|
|
1386
|
+
},
|
|
1387
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-6", children: [
|
|
1388
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
1389
|
+
/* @__PURE__ */ e.jsx(
|
|
1390
|
+
l,
|
|
1391
|
+
{
|
|
1392
|
+
name: "label",
|
|
1393
|
+
children: (n) => /* @__PURE__ */ e.jsxs(S, { className: "flex-1", children: [
|
|
1394
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: n.name, children: h("editor.flowNodeForm.label") }),
|
|
1395
|
+
/* @__PURE__ */ e.jsx(
|
|
1396
|
+
P,
|
|
1397
|
+
{
|
|
1398
|
+
id: n.name,
|
|
1399
|
+
name: n.name,
|
|
1400
|
+
value: n.state.value?.[t] || "",
|
|
1401
|
+
onBlur: n.handleBlur,
|
|
1402
|
+
onChange: ({ target: c }) => {
|
|
1403
|
+
n.handleChange({
|
|
1404
|
+
...n.state.value,
|
|
1405
|
+
[t]: c.value
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
)
|
|
1410
|
+
] })
|
|
1411
|
+
}
|
|
1412
|
+
),
|
|
1413
|
+
/* @__PURE__ */ e.jsx(Q, { value: t, onValueChange: s })
|
|
1414
|
+
] }),
|
|
1415
|
+
/* @__PURE__ */ e.jsx(
|
|
1416
|
+
l,
|
|
1417
|
+
{
|
|
1418
|
+
name: "targetId",
|
|
1419
|
+
children: (n) => /* @__PURE__ */ e.jsxs(S, { children: [
|
|
1420
|
+
/* @__PURE__ */ e.jsxs(b, { htmlFor: n.name, children: [
|
|
1421
|
+
h("editor.flowNodeForm.targetId"),
|
|
1422
|
+
" (Flow ID)"
|
|
1423
|
+
] }),
|
|
1424
|
+
/* @__PURE__ */ e.jsx(
|
|
1425
|
+
P,
|
|
1426
|
+
{
|
|
1427
|
+
id: n.name,
|
|
1428
|
+
name: n.name,
|
|
1429
|
+
value: n.state.value,
|
|
1430
|
+
onBlur: n.handleBlur,
|
|
1431
|
+
onChange: ({ target: c }) => n.handleChange(c.value)
|
|
1432
|
+
}
|
|
1433
|
+
),
|
|
1434
|
+
/* @__PURE__ */ e.jsx(B, { children: "Unique identifier of the target flow." })
|
|
1435
|
+
] })
|
|
1436
|
+
}
|
|
1437
|
+
)
|
|
1438
|
+
] })
|
|
1439
|
+
}
|
|
1440
|
+
);
|
|
1441
|
+
}, Fa = () => {
|
|
1442
|
+
const [t, s] = $("en"), { selectedNode: r } = X(), { updateSelectedNodeData: o } = ce(), { Field: h } = de({
|
|
1443
|
+
defaultValues: {
|
|
1444
|
+
label: r?.data?.label || { en: "" }
|
|
1445
|
+
},
|
|
1446
|
+
listeners: {
|
|
1447
|
+
onChange: ({ formApi: l }) => {
|
|
1448
|
+
l.handleSubmit().then();
|
|
1449
|
+
},
|
|
1450
|
+
onChangeDebounceMs: 150
|
|
1451
|
+
},
|
|
1452
|
+
onSubmit: ({ value: l }) => {
|
|
1453
|
+
o(l);
|
|
1454
|
+
}
|
|
1455
|
+
});
|
|
1456
|
+
return /* @__PURE__ */ e.jsx(
|
|
1457
|
+
"form",
|
|
1458
|
+
{
|
|
1459
|
+
onSubmit: (l) => {
|
|
1460
|
+
l.preventDefault(), l.stopPropagation();
|
|
1461
|
+
},
|
|
1462
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
1463
|
+
/* @__PURE__ */ e.jsx(
|
|
1464
|
+
h,
|
|
1465
|
+
{
|
|
1466
|
+
name: "label",
|
|
1467
|
+
children: (l) => /* @__PURE__ */ e.jsxs(S, { className: "flex-1", children: [
|
|
1468
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: l.name, children: "Label" }),
|
|
1469
|
+
/* @__PURE__ */ e.jsx(
|
|
1470
|
+
P,
|
|
1471
|
+
{
|
|
1472
|
+
id: l.name,
|
|
1473
|
+
name: l.name,
|
|
1474
|
+
value: l.state.value?.[t] || "",
|
|
1475
|
+
onBlur: l.handleBlur,
|
|
1476
|
+
onChange: ({ target: n }) => {
|
|
1477
|
+
l.handleChange({
|
|
1478
|
+
...l.state.value,
|
|
1479
|
+
[t]: n.value
|
|
1480
|
+
});
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
)
|
|
1484
|
+
] })
|
|
1485
|
+
}
|
|
1486
|
+
),
|
|
1487
|
+
/* @__PURE__ */ e.jsx(Q, { value: t, onValueChange: s })
|
|
1488
|
+
] })
|
|
1489
|
+
}
|
|
1490
|
+
);
|
|
1491
|
+
}, Sa = ["POST", "PUT", "PATCH"], Ea = ({ value: t, onChange: s }) => {
|
|
1492
|
+
const { selectedNode: r } = X(), o = M(), h = Ae(r?.id), { handleSubmit: l, Field: n } = de({
|
|
1493
|
+
defaultValues: {
|
|
1494
|
+
body: t?.body || "",
|
|
1495
|
+
// fetchOnMount should be true by default if there's no searchParam
|
|
1496
|
+
fetchOnMount: t?.fetchOnMount ?? !t?.searchParam,
|
|
1497
|
+
headers: t?.headers || [],
|
|
1498
|
+
method: t?.method || "GET",
|
|
1499
|
+
responseMapping: t?.responseMapping || {
|
|
1500
|
+
labelField: "",
|
|
1501
|
+
valueField: ""
|
|
1502
|
+
},
|
|
1503
|
+
responsePath: t?.responsePath || "",
|
|
1504
|
+
searchParam: t?.searchParam || "",
|
|
1505
|
+
showLoading: t?.showLoading !== !1,
|
|
1506
|
+
url: t?.url || ""
|
|
1507
|
+
},
|
|
1508
|
+
listeners: {
|
|
1509
|
+
onChange: ({ formApi: c }) => {
|
|
1510
|
+
c.handleSubmit().then();
|
|
1511
|
+
},
|
|
1512
|
+
onChangeDebounceMs: 150
|
|
1513
|
+
},
|
|
1514
|
+
onSubmit: ({ value: c }) => {
|
|
1515
|
+
s(c);
|
|
1516
|
+
}
|
|
1517
|
+
});
|
|
1518
|
+
return /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-6", children: [
|
|
1519
|
+
/* @__PURE__ */ e.jsx(
|
|
1520
|
+
n,
|
|
1521
|
+
{
|
|
1522
|
+
name: "url",
|
|
1523
|
+
children: (c) => /* @__PURE__ */ e.jsxs(S, { children: [
|
|
1524
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: c.name, children: o("editor.httpConfigForm.apiUrl") }),
|
|
1525
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
1526
|
+
/* @__PURE__ */ e.jsx(
|
|
1527
|
+
P,
|
|
1528
|
+
{
|
|
1529
|
+
id: c.name,
|
|
1530
|
+
name: c.name,
|
|
1531
|
+
value: c.state.value,
|
|
1532
|
+
onBlur: c.handleBlur,
|
|
1533
|
+
onChange: ({ target: i }) => c.handleChange(i.value),
|
|
1534
|
+
placeholder: o("editor.httpConfigForm.apiUrlPlaceholder"),
|
|
1535
|
+
className: "flex-1"
|
|
1536
|
+
}
|
|
1537
|
+
),
|
|
1538
|
+
/* @__PURE__ */ e.jsxs(Se, { children: [
|
|
1539
|
+
/* @__PURE__ */ e.jsx(Ee, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { type: "button", variant: "outline", size: "icon", children: /* @__PURE__ */ e.jsx(Be, { className: "h-4 w-4" }) }) }),
|
|
1540
|
+
/* @__PURE__ */ e.jsx(ke, { align: "end", children: h.length === 0 ? /* @__PURE__ */ e.jsx(q, { disabled: !0, children: o("editor.httpConfigForm.noFieldsAvailable") }) : h.map((i) => /* @__PURE__ */ e.jsx(
|
|
1541
|
+
q,
|
|
1542
|
+
{
|
|
1543
|
+
onClick: () => {
|
|
1544
|
+
const a = `{{${i.nodeId}}}`, d = c.state.value || "";
|
|
1545
|
+
c.handleChange(d + a);
|
|
1546
|
+
},
|
|
1547
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
1548
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-medium", children: i.label }),
|
|
1549
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs", children: `{{${i.nodeId}}}` })
|
|
1550
|
+
] })
|
|
1551
|
+
},
|
|
1552
|
+
i.nodeId
|
|
1553
|
+
)) })
|
|
1554
|
+
] })
|
|
1555
|
+
] }),
|
|
1556
|
+
/* @__PURE__ */ e.jsx(B, { children: o("editor.httpConfigForm.apiUrlDesc") })
|
|
1557
|
+
] })
|
|
1558
|
+
}
|
|
1559
|
+
),
|
|
1560
|
+
/* @__PURE__ */ e.jsx(
|
|
1561
|
+
n,
|
|
1562
|
+
{
|
|
1563
|
+
name: "method",
|
|
1564
|
+
children: (c) => /* @__PURE__ */ e.jsxs(S, { children: [
|
|
1565
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: c.name, children: o("editor.httpConfigForm.httpMethod") }),
|
|
1566
|
+
/* @__PURE__ */ e.jsxs(
|
|
1567
|
+
U,
|
|
1568
|
+
{
|
|
1569
|
+
value: c.state.value,
|
|
1570
|
+
onValueChange: (i) => c.handleChange(i),
|
|
1571
|
+
children: [
|
|
1572
|
+
/* @__PURE__ */ e.jsx(R, { id: c.name, children: /* @__PURE__ */ e.jsx(Z, { placeholder: o("editor.httpConfigForm.selectMethod") }) }),
|
|
1573
|
+
/* @__PURE__ */ e.jsxs(K, { children: [
|
|
1574
|
+
/* @__PURE__ */ e.jsx(w, { value: "GET", children: o("editor.httpConfigForm.methodGet") }),
|
|
1575
|
+
/* @__PURE__ */ e.jsx(w, { value: "POST", children: o("editor.httpConfigForm.methodPost") }),
|
|
1576
|
+
/* @__PURE__ */ e.jsx(w, { value: "PUT", children: o("editor.httpConfigForm.methodPut") }),
|
|
1577
|
+
/* @__PURE__ */ e.jsx(w, { value: "DELETE", children: o("editor.httpConfigForm.methodDelete") }),
|
|
1578
|
+
/* @__PURE__ */ e.jsx(w, { value: "PATCH", children: o("editor.httpConfigForm.methodPatch") })
|
|
1579
|
+
] })
|
|
1580
|
+
]
|
|
1581
|
+
}
|
|
1582
|
+
)
|
|
1583
|
+
] })
|
|
1584
|
+
}
|
|
1585
|
+
),
|
|
1586
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
1587
|
+
/* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: o("editor.httpConfigForm.headers") }),
|
|
1588
|
+
/* @__PURE__ */ e.jsx(n, { name: "headers", mode: "array", children: (c) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
1589
|
+
c.state.value?.map((i, a) => {
|
|
1590
|
+
const d = `headers[${a}]`;
|
|
1591
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2", children: [
|
|
1592
|
+
/* @__PURE__ */ e.jsx(n, { name: `headers[${a}].key`, children: (p) => /* @__PURE__ */ e.jsx(
|
|
1593
|
+
P,
|
|
1594
|
+
{
|
|
1595
|
+
placeholder: o("editor.httpConfigForm.headerName"),
|
|
1596
|
+
value: p.state.value || "",
|
|
1597
|
+
onChange: ({ target: m }) => p.handleChange(m.value)
|
|
1598
|
+
}
|
|
1599
|
+
) }),
|
|
1600
|
+
/* @__PURE__ */ e.jsx(n, { name: `headers[${a}].value`, children: (p) => /* @__PURE__ */ e.jsx(
|
|
1601
|
+
P,
|
|
1602
|
+
{
|
|
1603
|
+
placeholder: o("editor.httpConfigForm.headerValue"),
|
|
1604
|
+
value: p.state.value || "",
|
|
1605
|
+
onChange: ({ target: m }) => p.handleChange(m.value)
|
|
1606
|
+
}
|
|
1607
|
+
) }),
|
|
1608
|
+
/* @__PURE__ */ e.jsx(
|
|
1609
|
+
k,
|
|
1610
|
+
{
|
|
1611
|
+
type: "button",
|
|
1612
|
+
variant: "ghost",
|
|
1613
|
+
size: "icon",
|
|
1614
|
+
onClick: () => {
|
|
1615
|
+
c.removeValue(a);
|
|
1616
|
+
},
|
|
1617
|
+
children: /* @__PURE__ */ e.jsx(re, { className: "h-4 w-4" })
|
|
1618
|
+
}
|
|
1619
|
+
)
|
|
1620
|
+
] }, d);
|
|
1621
|
+
}),
|
|
1622
|
+
/* @__PURE__ */ e.jsxs(
|
|
1623
|
+
k,
|
|
1624
|
+
{
|
|
1625
|
+
type: "button",
|
|
1626
|
+
variant: "outline",
|
|
1627
|
+
size: "sm",
|
|
1628
|
+
onClick: () => {
|
|
1629
|
+
c.pushValue({ key: "", value: "" });
|
|
1630
|
+
},
|
|
1631
|
+
children: [
|
|
1632
|
+
/* @__PURE__ */ e.jsx(W, { className: "mr-2 h-4 w-4" }),
|
|
1633
|
+
o("editor.httpConfigForm.addHeader")
|
|
1634
|
+
]
|
|
1635
|
+
}
|
|
1636
|
+
)
|
|
1637
|
+
] }) })
|
|
1638
|
+
] }),
|
|
1639
|
+
/* @__PURE__ */ e.jsx(n, { name: "method", children: (c) => Sa.includes(c.state.value || "") && /* @__PURE__ */ e.jsx(n, { name: "body", children: (i) => /* @__PURE__ */ e.jsxs(S, { children: [
|
|
1640
|
+
/* @__PURE__ */ e.jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
1641
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: i.name, children: o("editor.httpConfigForm.requestBody") }),
|
|
1642
|
+
/* @__PURE__ */ e.jsxs(Se, { children: [
|
|
1643
|
+
/* @__PURE__ */ e.jsx(Ee, { asChild: !0, children: /* @__PURE__ */ e.jsxs(k, { type: "button", variant: "ghost", size: "sm", children: [
|
|
1644
|
+
/* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4" }),
|
|
1645
|
+
o("editor.httpConfigForm.insertVariable")
|
|
1646
|
+
] }) }),
|
|
1647
|
+
/* @__PURE__ */ e.jsx(ke, { align: "end", children: h.length === 0 ? /* @__PURE__ */ e.jsx(q, { disabled: !0, children: o("editor.httpConfigForm.noFieldsAvailable") }) : h.map((a) => /* @__PURE__ */ e.jsx(
|
|
1648
|
+
q,
|
|
1649
|
+
{
|
|
1650
|
+
onClick: () => {
|
|
1651
|
+
const p = `\${${a.name || a.nodeId}}`, m = i.state.value || "";
|
|
1652
|
+
i.handleChange(m + p), l().then();
|
|
1653
|
+
},
|
|
1654
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
1655
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-medium", children: a.label }),
|
|
1656
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground text-xs", children: `\${${a.name || a.nodeId}}` })
|
|
1657
|
+
] })
|
|
1658
|
+
},
|
|
1659
|
+
a.nodeId
|
|
1660
|
+
)) })
|
|
1661
|
+
] })
|
|
1662
|
+
] }),
|
|
1663
|
+
/* @__PURE__ */ e.jsx(
|
|
1664
|
+
Ue,
|
|
1665
|
+
{
|
|
1666
|
+
id: i.name,
|
|
1667
|
+
name: i.name,
|
|
1668
|
+
value: i.state.value,
|
|
1669
|
+
onBlur: i.handleBlur,
|
|
1670
|
+
onChange: ({ target: a }) => i.handleChange(a.value),
|
|
1671
|
+
placeholder: o("editor.httpConfigForm.requestBodyPlaceholder"),
|
|
1672
|
+
rows: 4
|
|
1673
|
+
}
|
|
1674
|
+
),
|
|
1675
|
+
/* @__PURE__ */ e.jsx(B, { children: o("editor.httpConfigForm.requestBodyDesc") })
|
|
1676
|
+
] }) }) }),
|
|
1677
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
1678
|
+
/* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: o("editor.httpConfigForm.responseConfiguration") }),
|
|
1679
|
+
/* @__PURE__ */ e.jsx(
|
|
1680
|
+
n,
|
|
1681
|
+
{
|
|
1682
|
+
name: "responsePath",
|
|
1683
|
+
children: (c) => /* @__PURE__ */ e.jsxs(S, { children: [
|
|
1684
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: c.name, children: o("editor.httpConfigForm.responsePath") }),
|
|
1685
|
+
/* @__PURE__ */ e.jsx(
|
|
1686
|
+
P,
|
|
1687
|
+
{
|
|
1688
|
+
id: c.name,
|
|
1689
|
+
name: c.name,
|
|
1690
|
+
value: c.state.value,
|
|
1691
|
+
onBlur: c.handleBlur,
|
|
1692
|
+
onChange: ({ target: i }) => c.handleChange(i.value),
|
|
1693
|
+
placeholder: o("editor.httpConfigForm.responsePathPlaceholder")
|
|
1694
|
+
}
|
|
1695
|
+
),
|
|
1696
|
+
/* @__PURE__ */ e.jsx(B, { children: o("editor.httpConfigForm.responsePathDesc") })
|
|
1697
|
+
] })
|
|
1698
|
+
}
|
|
1699
|
+
),
|
|
1700
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
1701
|
+
/* @__PURE__ */ e.jsx("h5", { className: "font-medium text-sm", children: o("editor.httpConfigForm.mapToOptions") }),
|
|
1702
|
+
/* @__PURE__ */ e.jsx(
|
|
1703
|
+
n,
|
|
1704
|
+
{
|
|
1705
|
+
name: "responseMapping.valueField",
|
|
1706
|
+
children: (c) => /* @__PURE__ */ e.jsxs(S, { children: [
|
|
1707
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: c.name, children: o("editor.httpConfigForm.valueField") }),
|
|
1708
|
+
/* @__PURE__ */ e.jsx(
|
|
1709
|
+
P,
|
|
1710
|
+
{
|
|
1711
|
+
id: c.name,
|
|
1712
|
+
name: c.name,
|
|
1713
|
+
value: c.state.value,
|
|
1714
|
+
onBlur: c.handleBlur,
|
|
1715
|
+
onChange: ({ target: i }) => c.handleChange(i.value),
|
|
1716
|
+
placeholder: o("editor.httpConfigForm.valueFieldPlaceholder")
|
|
1717
|
+
}
|
|
1718
|
+
),
|
|
1719
|
+
/* @__PURE__ */ e.jsx(B, { children: o("editor.httpConfigForm.valueFieldDesc") })
|
|
1720
|
+
] })
|
|
1721
|
+
}
|
|
1722
|
+
),
|
|
1723
|
+
/* @__PURE__ */ e.jsx(
|
|
1724
|
+
n,
|
|
1725
|
+
{
|
|
1726
|
+
name: "responseMapping.labelField",
|
|
1727
|
+
children: (c) => /* @__PURE__ */ e.jsxs(S, { children: [
|
|
1728
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: c.name, children: o("editor.httpConfigForm.labelField") }),
|
|
1729
|
+
/* @__PURE__ */ e.jsx(
|
|
1730
|
+
P,
|
|
1731
|
+
{
|
|
1732
|
+
id: c.name,
|
|
1733
|
+
name: c.name,
|
|
1734
|
+
value: c.state.value,
|
|
1735
|
+
onBlur: c.handleBlur,
|
|
1736
|
+
onChange: ({ target: i }) => c.handleChange(i.value),
|
|
1737
|
+
placeholder: o("editor.httpConfigForm.labelFieldPlaceholder")
|
|
1738
|
+
}
|
|
1739
|
+
),
|
|
1740
|
+
/* @__PURE__ */ e.jsx(B, { children: o("editor.httpConfigForm.labelFieldDesc") })
|
|
1741
|
+
] })
|
|
1742
|
+
}
|
|
1743
|
+
)
|
|
1744
|
+
] }),
|
|
1745
|
+
/* @__PURE__ */ e.jsx(
|
|
1746
|
+
n,
|
|
1747
|
+
{
|
|
1748
|
+
name: "searchParam",
|
|
1749
|
+
children: (c) => /* @__PURE__ */ e.jsxs(S, { children: [
|
|
1750
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: c.name, children: o("editor.httpConfigForm.searchParameter") }),
|
|
1751
|
+
/* @__PURE__ */ e.jsx(
|
|
1752
|
+
P,
|
|
1753
|
+
{
|
|
1754
|
+
id: c.name,
|
|
1755
|
+
name: c.name,
|
|
1756
|
+
value: c.state.value,
|
|
1757
|
+
onBlur: c.handleBlur,
|
|
1758
|
+
onChange: ({ target: i }) => c.handleChange(i.value),
|
|
1759
|
+
placeholder: o("editor.httpConfigForm.searchParameterPlaceholder")
|
|
1760
|
+
}
|
|
1761
|
+
),
|
|
1762
|
+
/* @__PURE__ */ e.jsx(B, { children: o("editor.httpConfigForm.searchParameterDesc") })
|
|
1763
|
+
] })
|
|
1764
|
+
}
|
|
1765
|
+
)
|
|
1766
|
+
] }),
|
|
1767
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
1768
|
+
/* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: o("editor.httpConfigForm.behavior") }),
|
|
1769
|
+
/* @__PURE__ */ e.jsx(n, { name: "searchParam", children: (c) => /* @__PURE__ */ e.jsx(n, { name: "fetchOnMount", children: (i) => {
|
|
1770
|
+
const a = !!c.state.value?.trim(), d = a ? i.state.value : !0;
|
|
1771
|
+
return !a && i.state.value !== !0 && i.handleChange(!0), /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
1772
|
+
/* @__PURE__ */ e.jsx(
|
|
1773
|
+
ae,
|
|
1774
|
+
{
|
|
1775
|
+
id: i.name,
|
|
1776
|
+
checked: d,
|
|
1777
|
+
disabled: !a,
|
|
1778
|
+
onCheckedChange: (p) => i.handleChange(p)
|
|
1779
|
+
}
|
|
1780
|
+
),
|
|
1781
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: i.name, className: a ? "" : "text-muted-foreground", children: o("editor.httpConfigForm.fetchOnMount") })
|
|
1782
|
+
] });
|
|
1783
|
+
} }) }),
|
|
1784
|
+
/* @__PURE__ */ e.jsx(
|
|
1785
|
+
n,
|
|
1786
|
+
{
|
|
1787
|
+
name: "showLoading",
|
|
1788
|
+
children: (c) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
1789
|
+
/* @__PURE__ */ e.jsx(ae, { id: c.name, checked: c.state.value, onCheckedChange: (i) => c.handleChange(i) }),
|
|
1790
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: c.name, children: o("editor.httpConfigForm.showLoadingState") })
|
|
1791
|
+
] })
|
|
1792
|
+
}
|
|
1793
|
+
)
|
|
1794
|
+
] })
|
|
1795
|
+
] }) });
|
|
1796
|
+
}, ka = ({
|
|
1797
|
+
options: t,
|
|
1798
|
+
value: s,
|
|
1799
|
+
onValueChange: r,
|
|
1800
|
+
placeholder: o = "Select...",
|
|
1801
|
+
searchPlaceholder: h = "Search or create...",
|
|
1802
|
+
createLabel: l = (p) => `Use: ${p}`,
|
|
1803
|
+
clearLabel: n = "Clear selection",
|
|
1804
|
+
emptyLabel: c = "No results found",
|
|
1805
|
+
className: i,
|
|
1806
|
+
allowClear: a = !0,
|
|
1807
|
+
allowCreate: d = !0
|
|
1808
|
+
}) => {
|
|
1809
|
+
const [p, m] = $(!1), [u, f] = $(""), x = (g) => g ?? "", E = (g) => g.trim().toLowerCase(), j = x(s), y = s !== null && s !== "", v = y ? t.find((g) => x(g.value) === j) : void 0, I = E(u), N = d && I !== "" && !t.some((g) => E(g.label) === I || E(g.value ?? "") === I), F = (g) => {
|
|
1810
|
+
g === j ? a && r?.("") : r?.(g), m(!1), f("");
|
|
1811
|
+
}, D = () => {
|
|
1812
|
+
u.trim() && (r?.(u.trim()), m(!1), f(""));
|
|
1813
|
+
}, V = () => {
|
|
1814
|
+
r?.(""), m(!1), f("");
|
|
1815
|
+
};
|
|
1816
|
+
return /* @__PURE__ */ e.jsxs(Pe, { open: p, onOpenChange: m, children: [
|
|
1817
|
+
/* @__PURE__ */ e.jsx(Te, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
1818
|
+
k,
|
|
1819
|
+
{
|
|
1820
|
+
type: "button",
|
|
1821
|
+
variant: "outline",
|
|
1822
|
+
role: "combobox",
|
|
1823
|
+
"aria-expanded": p,
|
|
1824
|
+
className: T("w-full justify-between font-normal", i),
|
|
1825
|
+
children: [
|
|
1826
|
+
/* @__PURE__ */ e.jsx("span", { className: "truncate", children: y && v ? v.label : o }),
|
|
1827
|
+
/* @__PURE__ */ e.jsx(ue, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
1828
|
+
]
|
|
1829
|
+
}
|
|
1830
|
+
) }),
|
|
1831
|
+
/* @__PURE__ */ e.jsx(De, { className: "w-full p-0", align: "start", children: /* @__PURE__ */ e.jsxs(at, { shouldFilter: !1, children: [
|
|
1832
|
+
/* @__PURE__ */ e.jsx(nt, { placeholder: h, value: u, onValueChange: f }),
|
|
1833
|
+
/* @__PURE__ */ e.jsxs(st, { children: [
|
|
1834
|
+
/* @__PURE__ */ e.jsx(ot, { children: c }),
|
|
1835
|
+
a && y && /* @__PURE__ */ e.jsx(Ge, { children: /* @__PURE__ */ e.jsxs(we, { value: "__clear__", onSelect: V, className: "text-muted-foreground mt-1", children: [
|
|
1836
|
+
/* @__PURE__ */ e.jsx(re, { className: "mr-2 h-4 w-4" }),
|
|
1837
|
+
n
|
|
1838
|
+
] }) }),
|
|
1839
|
+
/* @__PURE__ */ e.jsxs(Ge, { children: [
|
|
1840
|
+
N && /* @__PURE__ */ e.jsxs(we, { value: `__create__${u}`, onSelect: D, className: "text-primary", children: [
|
|
1841
|
+
/* @__PURE__ */ e.jsx(W, { className: "mr-2 h-4 w-4" }),
|
|
1842
|
+
l(u)
|
|
1843
|
+
] }),
|
|
1844
|
+
t.filter((g) => {
|
|
1845
|
+
const ee = u.toLowerCase();
|
|
1846
|
+
return g.label.toLowerCase().includes(ee) || (g.value?.toLowerCase() ?? "").includes(ee);
|
|
1847
|
+
}).map((g, ee) => /* @__PURE__ */ e.jsxs(
|
|
1848
|
+
we,
|
|
1849
|
+
{
|
|
1850
|
+
value: g.label,
|
|
1851
|
+
onSelect: () => F(g?.value || ""),
|
|
1852
|
+
children: [
|
|
1853
|
+
/* @__PURE__ */ e.jsx(
|
|
1854
|
+
It,
|
|
1855
|
+
{
|
|
1856
|
+
"aria-hidden": "true",
|
|
1857
|
+
className: T(
|
|
1858
|
+
"mr-2 h-4 w-4",
|
|
1859
|
+
y && x(g.value) === j ? "opacity-100" : "opacity-0"
|
|
1860
|
+
)
|
|
1861
|
+
}
|
|
1862
|
+
),
|
|
1863
|
+
g.label
|
|
1864
|
+
]
|
|
1865
|
+
},
|
|
1866
|
+
g.value ?? g.label ?? ee
|
|
1867
|
+
))
|
|
1868
|
+
] })
|
|
1869
|
+
] })
|
|
1870
|
+
] }) })
|
|
1871
|
+
] });
|
|
1872
|
+
}, Pa = {
|
|
1873
|
+
alphanumeric: "^[a-zA-Z0-9]+$",
|
|
1874
|
+
email: "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",
|
|
1875
|
+
letters: "^[a-zA-Z]+$",
|
|
1876
|
+
number: "^[0-9]+$",
|
|
1877
|
+
url: "^https?:\\/\\/.+$"
|
|
1878
|
+
}, Fe = Object.entries(Pa).map(([t, s]) => ({
|
|
1879
|
+
label: t.charAt(0).toUpperCase() + t.slice(1).replace(/_/g, " "),
|
|
1880
|
+
value: s
|
|
1881
|
+
})), Ta = ({ value: t, onValueChange: s }) => {
|
|
1882
|
+
const r = ne(() => t && !Fe.some((o) => o.value === t) ? [
|
|
1883
|
+
...Fe,
|
|
1884
|
+
{
|
|
1885
|
+
label: `Custom: ${t}`,
|
|
1886
|
+
value: t
|
|
1887
|
+
}
|
|
1888
|
+
] : Fe, [t]);
|
|
1889
|
+
return /* @__PURE__ */ e.jsx(
|
|
1890
|
+
ka,
|
|
1891
|
+
{
|
|
1892
|
+
options: r,
|
|
1893
|
+
value: t,
|
|
1894
|
+
onValueChange: s,
|
|
1895
|
+
placeholder: "Select or create a pattern",
|
|
1896
|
+
searchPlaceholder: "Search patterns...",
|
|
1897
|
+
createLabel: (o) => `Use pattern: ${o}`
|
|
1898
|
+
}
|
|
1899
|
+
);
|
|
1900
|
+
}, Da = {
|
|
1901
|
+
address: "address",
|
|
1902
|
+
autocomplete: "autocomplete",
|
|
1903
|
+
checkbox: "checkbox",
|
|
1904
|
+
date: "date",
|
|
1905
|
+
daterange: "daterange",
|
|
1906
|
+
file: "file",
|
|
1907
|
+
hidden: "hidden",
|
|
1908
|
+
http: "http",
|
|
1909
|
+
number: "number",
|
|
1910
|
+
password: "password",
|
|
1911
|
+
radio: "radio",
|
|
1912
|
+
select: "select",
|
|
1913
|
+
switch: "switch",
|
|
1914
|
+
text: "text",
|
|
1915
|
+
textarea: "textarea",
|
|
1916
|
+
time: "time",
|
|
1917
|
+
timerange: "timerange"
|
|
1918
|
+
}, Va = ({ value: t, onValueChange: s }) => {
|
|
1919
|
+
const r = M();
|
|
1920
|
+
return /* @__PURE__ */ e.jsxs(J, { children: [
|
|
1921
|
+
/* @__PURE__ */ e.jsx(Ve, { children: r("editor.selectInputType.type") }),
|
|
1922
|
+
/* @__PURE__ */ e.jsxs(U, { value: t, onValueChange: s, children: [
|
|
1923
|
+
/* @__PURE__ */ e.jsx(R, { className: "w-full capitalize", children: /* @__PURE__ */ e.jsx(Z, { placeholder: "" }) }),
|
|
1924
|
+
/* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsx(J, { children: Object.values(Da).map((o) => /* @__PURE__ */ e.jsx(w, { value: o, className: "capitalize", children: o }, o)) }) })
|
|
1925
|
+
] })
|
|
1926
|
+
] });
|
|
1927
|
+
};
|
|
1928
|
+
function ge({ ...t }) {
|
|
1929
|
+
return /* @__PURE__ */ e.jsx(Ie.Root, { "data-slot": "collapsible", ...t });
|
|
1930
|
+
}
|
|
1931
|
+
function je({ ...t }) {
|
|
1932
|
+
return /* @__PURE__ */ e.jsx(Ie.CollapsibleTrigger, { "data-slot": "collapsible-trigger", ...t });
|
|
1933
|
+
}
|
|
1934
|
+
function Ce({ ...t }) {
|
|
1935
|
+
return /* @__PURE__ */ e.jsx(Ie.CollapsibleContent, { "data-slot": "collapsible-content", ...t });
|
|
1936
|
+
}
|
|
1937
|
+
const Oa = () => {
|
|
1938
|
+
const [t, s] = $("en"), { selectedNode: r } = X(), { updateSelectedNodeData: o } = ce(), h = ["select", "radio", "autocomplete", "checkbox"].includes(r?.data?.type || ""), l = Ae(r?.id), n = M(), { handleSubmit: c, Field: i } = de({
|
|
1939
|
+
defaultValues: {
|
|
1940
|
+
defaultValue: r?.data?.defaultValue,
|
|
1941
|
+
errorMessage: r?.data?.errorMessage || { en: "" },
|
|
1942
|
+
helperText: r?.data?.helperText || { en: "" },
|
|
1943
|
+
httpConfig: r?.data?.httpConfig,
|
|
1944
|
+
label: r?.data?.label || { en: "" },
|
|
1945
|
+
multiple: r?.data?.multiple,
|
|
1946
|
+
name: r?.data?.name || "",
|
|
1947
|
+
options: r?.data?.options || [],
|
|
1948
|
+
pattern: r?.data?.pattern || "",
|
|
1949
|
+
placeholder: r?.data?.placeholder || { en: "" },
|
|
1950
|
+
required: r?.data?.required,
|
|
1951
|
+
type: r?.data?.type || ""
|
|
1952
|
+
},
|
|
1953
|
+
listeners: {
|
|
1954
|
+
onChange: ({ formApi: a }) => {
|
|
1955
|
+
a.handleSubmit().then();
|
|
1956
|
+
},
|
|
1957
|
+
onChangeDebounceMs: 150
|
|
1958
|
+
},
|
|
1959
|
+
onSubmit: ({ value: a }) => {
|
|
1960
|
+
o(a);
|
|
1961
|
+
}
|
|
1962
|
+
});
|
|
1963
|
+
return /* @__PURE__ */ e.jsx(
|
|
1964
|
+
"form",
|
|
1965
|
+
{
|
|
1966
|
+
onSubmit: (a) => {
|
|
1967
|
+
a.preventDefault(), a.stopPropagation();
|
|
1968
|
+
},
|
|
1969
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-6", children: [
|
|
1970
|
+
/* @__PURE__ */ e.jsx(
|
|
1971
|
+
i,
|
|
1972
|
+
{
|
|
1973
|
+
name: "type",
|
|
1974
|
+
children: (a) => /* @__PURE__ */ e.jsx(S, { children: /* @__PURE__ */ e.jsx(Va, { value: a.state.value, onValueChange: (d) => a.handleChange(d) }) })
|
|
1975
|
+
}
|
|
1976
|
+
),
|
|
1977
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
1978
|
+
/* @__PURE__ */ e.jsx(
|
|
1979
|
+
i,
|
|
1980
|
+
{
|
|
1981
|
+
name: "label",
|
|
1982
|
+
children: (a) => /* @__PURE__ */ e.jsxs(S, { className: "flex-1", children: [
|
|
1983
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: a.name, children: n("editor.inputNodeForm.label") }),
|
|
1984
|
+
/* @__PURE__ */ e.jsx(
|
|
1985
|
+
P,
|
|
1986
|
+
{
|
|
1987
|
+
autoFocus: !0,
|
|
1988
|
+
id: a.name,
|
|
1989
|
+
name: a.name,
|
|
1990
|
+
value: a.state.value?.[t] || "",
|
|
1991
|
+
onBlur: a.handleBlur,
|
|
1992
|
+
onChange: ({ target: d }) => {
|
|
1993
|
+
a.handleChange({
|
|
1994
|
+
...typeof a.state.value == "object" && a.state.value !== null ? a.state.value : {},
|
|
1995
|
+
[t]: d.value
|
|
1996
|
+
});
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
)
|
|
2000
|
+
] })
|
|
2001
|
+
}
|
|
2002
|
+
),
|
|
2003
|
+
/* @__PURE__ */ e.jsx(Q, { value: t, onValueChange: s })
|
|
2004
|
+
] }),
|
|
2005
|
+
r?.data?.type !== "file" && /* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
2006
|
+
/* @__PURE__ */ e.jsx(
|
|
2007
|
+
i,
|
|
2008
|
+
{
|
|
2009
|
+
name: "placeholder",
|
|
2010
|
+
children: (a) => /* @__PURE__ */ e.jsxs(S, { className: "flex-1", children: [
|
|
2011
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: a.name, children: n("editor.inputNodeForm.placeholder") }),
|
|
2012
|
+
/* @__PURE__ */ e.jsx(
|
|
2013
|
+
P,
|
|
2014
|
+
{
|
|
2015
|
+
id: a.name,
|
|
2016
|
+
name: a.name,
|
|
2017
|
+
value: a.state.value?.[t] || "",
|
|
2018
|
+
onBlur: a.handleBlur,
|
|
2019
|
+
onChange: ({ target: d }) => {
|
|
2020
|
+
a.handleChange({
|
|
2021
|
+
...typeof a.state.value == "object" && a.state.value !== null ? a.state.value : {},
|
|
2022
|
+
[t]: d.value
|
|
2023
|
+
});
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
)
|
|
2027
|
+
] })
|
|
2028
|
+
}
|
|
2029
|
+
),
|
|
2030
|
+
/* @__PURE__ */ e.jsx(Q, { value: t, onValueChange: s })
|
|
2031
|
+
] }),
|
|
2032
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
2033
|
+
/* @__PURE__ */ e.jsx(
|
|
2034
|
+
i,
|
|
2035
|
+
{
|
|
2036
|
+
name: "helperText",
|
|
2037
|
+
children: (a) => /* @__PURE__ */ e.jsxs(S, { className: "flex-1", children: [
|
|
2038
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: a.name, children: n("editor.inputNodeForm.helperText") }),
|
|
2039
|
+
/* @__PURE__ */ e.jsx(
|
|
2040
|
+
P,
|
|
2041
|
+
{
|
|
2042
|
+
id: a.name,
|
|
2043
|
+
name: a.name,
|
|
2044
|
+
value: a.state.value?.[t] || "",
|
|
2045
|
+
onBlur: a.handleBlur,
|
|
2046
|
+
onChange: ({ target: d }) => {
|
|
2047
|
+
a.handleChange({
|
|
2048
|
+
...typeof a.state.value == "object" && a.state.value !== null ? a.state.value : {},
|
|
2049
|
+
[t]: d.value
|
|
2050
|
+
});
|
|
2051
|
+
}
|
|
2052
|
+
}
|
|
2053
|
+
)
|
|
2054
|
+
] })
|
|
2055
|
+
}
|
|
2056
|
+
),
|
|
2057
|
+
/* @__PURE__ */ e.jsx(Q, { value: t, onValueChange: s })
|
|
2058
|
+
] }),
|
|
2059
|
+
r?.data?.type === "http" && /* @__PURE__ */ e.jsxs(ge, { defaultOpen: !0, className: "flex w-full max-w-[350px] flex-col gap-2", children: [
|
|
2060
|
+
/* @__PURE__ */ e.jsx(je, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
2061
|
+
/* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: n("editor.inputNodeForm.httpConfiguration") }),
|
|
2062
|
+
/* @__PURE__ */ e.jsxs(k, { variant: "ghost", size: "icon", className: "size-8", children: [
|
|
2063
|
+
/* @__PURE__ */ e.jsx(ue, {}),
|
|
2064
|
+
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: n("common.toggle") })
|
|
2065
|
+
] })
|
|
2066
|
+
] }) }),
|
|
2067
|
+
/* @__PURE__ */ e.jsx(Ce, { className: "flex flex-col gap-4", children: /* @__PURE__ */ e.jsx(i, { name: "httpConfig", children: (a) => /* @__PURE__ */ e.jsx(
|
|
2068
|
+
Ea,
|
|
2069
|
+
{
|
|
2070
|
+
value: a.state.value,
|
|
2071
|
+
onChange: (d) => {
|
|
2072
|
+
a.handleChange(d), c().then();
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
) }) })
|
|
2076
|
+
] }),
|
|
2077
|
+
r?.data?.type === "file" && /* @__PURE__ */ e.jsx(
|
|
2078
|
+
i,
|
|
2079
|
+
{
|
|
2080
|
+
name: "multiple",
|
|
2081
|
+
children: (a) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
2082
|
+
/* @__PURE__ */ e.jsx(ae, { id: a.name, checked: a.state.value, onCheckedChange: (d) => a.handleChange(d) }),
|
|
2083
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: a.name, children: n("editor.inputNodeForm.multipleFiles") })
|
|
2084
|
+
] })
|
|
2085
|
+
}
|
|
2086
|
+
),
|
|
2087
|
+
h && /* @__PURE__ */ e.jsxs(ge, { defaultOpen: !0, className: "flex w-full max-w-[350px] flex-col gap-2", children: [
|
|
2088
|
+
/* @__PURE__ */ e.jsx(je, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
2089
|
+
/* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: n("editor.inputNodeForm.options") }),
|
|
2090
|
+
/* @__PURE__ */ e.jsxs(k, { variant: "ghost", size: "icon", className: "size-8", children: [
|
|
2091
|
+
/* @__PURE__ */ e.jsx(ue, {}),
|
|
2092
|
+
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: n("common.toggle") })
|
|
2093
|
+
] })
|
|
2094
|
+
] }) }),
|
|
2095
|
+
/* @__PURE__ */ e.jsxs(Ce, { className: "flex flex-col gap-4", children: [
|
|
2096
|
+
/* @__PURE__ */ e.jsx(i, { name: "options", mode: "array", children: (a) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
2097
|
+
a.state.value?.map((d, p) => {
|
|
2098
|
+
const m = `options[${p}]`;
|
|
2099
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2", children: [
|
|
2100
|
+
/* @__PURE__ */ e.jsx(i, { name: `options[${p}].label`, children: (u) => /* @__PURE__ */ e.jsx(
|
|
2101
|
+
P,
|
|
2102
|
+
{
|
|
2103
|
+
placeholder: n("editor.inputNodeForm.optionLabel"),
|
|
2104
|
+
value: u.state.value?.[t] || "",
|
|
2105
|
+
onChange: ({ target: f }) => {
|
|
2106
|
+
u.handleChange({
|
|
2107
|
+
...typeof u.state.value == "object" && u.state.value !== null ? u.state.value : {},
|
|
2108
|
+
[t]: f.value
|
|
2109
|
+
});
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
) }),
|
|
2113
|
+
/* @__PURE__ */ e.jsx(i, { name: `options[${p}].value`, children: (u) => /* @__PURE__ */ e.jsx(
|
|
2114
|
+
P,
|
|
2115
|
+
{
|
|
2116
|
+
placeholder: n("editor.inputNodeForm.optionValue"),
|
|
2117
|
+
value: u.state.value || "",
|
|
2118
|
+
onChange: ({ target: f }) => u.handleChange(f.value)
|
|
2119
|
+
}
|
|
2120
|
+
) }),
|
|
2121
|
+
/* @__PURE__ */ e.jsx(
|
|
2122
|
+
k,
|
|
2123
|
+
{
|
|
2124
|
+
type: "button",
|
|
2125
|
+
variant: "ghost",
|
|
2126
|
+
size: "icon",
|
|
2127
|
+
onClick: () => {
|
|
2128
|
+
a.removeValue(p), c().then();
|
|
2129
|
+
},
|
|
2130
|
+
children: /* @__PURE__ */ e.jsx(re, { className: "h-4 w-4" })
|
|
2131
|
+
}
|
|
2132
|
+
)
|
|
2133
|
+
] }, m);
|
|
2134
|
+
}),
|
|
2135
|
+
/* @__PURE__ */ e.jsx(
|
|
2136
|
+
k,
|
|
2137
|
+
{
|
|
2138
|
+
type: "button",
|
|
2139
|
+
variant: "outline",
|
|
2140
|
+
size: "sm",
|
|
2141
|
+
onClick: () => {
|
|
2142
|
+
a.pushValue({ label: { en: "" }, value: "" }), c().then();
|
|
2143
|
+
},
|
|
2144
|
+
children: n("editor.inputNodeForm.addOption")
|
|
2145
|
+
}
|
|
2146
|
+
)
|
|
2147
|
+
] }) }),
|
|
2148
|
+
r?.data?.type === "select" && /* @__PURE__ */ e.jsx(
|
|
2149
|
+
i,
|
|
2150
|
+
{
|
|
2151
|
+
name: "multiple",
|
|
2152
|
+
children: (a) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
2153
|
+
/* @__PURE__ */ e.jsx(ae, { id: a.name, checked: a.state.value, onCheckedChange: (d) => a.handleChange(d) }),
|
|
2154
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: a.name, children: n("editor.inputNodeForm.multipleSelection") })
|
|
2155
|
+
] })
|
|
2156
|
+
}
|
|
2157
|
+
)
|
|
2158
|
+
] })
|
|
2159
|
+
] }),
|
|
2160
|
+
/* @__PURE__ */ e.jsxs(ge, { className: "flex w-full max-w-[350px] flex-col gap-2", children: [
|
|
2161
|
+
/* @__PURE__ */ e.jsx(je, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
2162
|
+
/* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: n("editor.inputNodeForm.validation") }),
|
|
2163
|
+
/* @__PURE__ */ e.jsxs(k, { variant: "ghost", size: "icon", className: "size-8", children: [
|
|
2164
|
+
/* @__PURE__ */ e.jsx(ue, {}),
|
|
2165
|
+
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: n("common.toggle") })
|
|
2166
|
+
] })
|
|
2167
|
+
] }) }),
|
|
2168
|
+
/* @__PURE__ */ e.jsxs(Ce, { className: "flex flex-col gap-6", children: [
|
|
2169
|
+
/* @__PURE__ */ e.jsx(
|
|
2170
|
+
i,
|
|
2171
|
+
{
|
|
2172
|
+
name: "required",
|
|
2173
|
+
children: (a) => /* @__PURE__ */ e.jsx(S, { children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
2174
|
+
/* @__PURE__ */ e.jsx(ae, { id: a.name, checked: a.state.value, onCheckedChange: (d) => a.handleChange(d) }),
|
|
2175
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: a.name, children: n("editor.inputNodeForm.required") })
|
|
2176
|
+
] }) })
|
|
2177
|
+
}
|
|
2178
|
+
),
|
|
2179
|
+
/* @__PURE__ */ e.jsx(
|
|
2180
|
+
i,
|
|
2181
|
+
{
|
|
2182
|
+
name: "pattern",
|
|
2183
|
+
children: (a) => /* @__PURE__ */ e.jsxs(S, { children: [
|
|
2184
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: a.name, children: n("editor.inputNodeForm.pattern") }),
|
|
2185
|
+
/* @__PURE__ */ e.jsx(Ta, { value: a.state.value, onValueChange: a.handleChange })
|
|
2186
|
+
] })
|
|
2187
|
+
}
|
|
2188
|
+
),
|
|
2189
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
2190
|
+
/* @__PURE__ */ e.jsx(
|
|
2191
|
+
i,
|
|
2192
|
+
{
|
|
2193
|
+
name: "errorMessage",
|
|
2194
|
+
children: (a) => /* @__PURE__ */ e.jsxs(S, { className: "flex-1", children: [
|
|
2195
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: a.name, children: n("editor.inputNodeForm.errorMessage") }),
|
|
2196
|
+
/* @__PURE__ */ e.jsx(
|
|
2197
|
+
P,
|
|
2198
|
+
{
|
|
2199
|
+
id: a.name,
|
|
2200
|
+
name: a.name,
|
|
2201
|
+
value: a.state.value?.[t] || "",
|
|
2202
|
+
onBlur: a.handleBlur,
|
|
2203
|
+
onChange: ({ target: d }) => {
|
|
2204
|
+
a.handleChange({
|
|
2205
|
+
...typeof a.state.value == "object" && a.state.value !== null ? a.state.value : {},
|
|
2206
|
+
[t]: d.value
|
|
2207
|
+
});
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
)
|
|
2211
|
+
] })
|
|
2212
|
+
}
|
|
2213
|
+
),
|
|
2214
|
+
/* @__PURE__ */ e.jsx(Q, { value: t, onValueChange: s })
|
|
2215
|
+
] })
|
|
2216
|
+
] })
|
|
2217
|
+
] }),
|
|
2218
|
+
/* @__PURE__ */ e.jsxs(ge, { className: "flex w-full max-w-[350px] flex-col gap-2", children: [
|
|
2219
|
+
/* @__PURE__ */ e.jsx(je, { asChild: !0, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
2220
|
+
/* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-sm", children: n("editor.inputNodeForm.advancedConfiguration") }),
|
|
2221
|
+
/* @__PURE__ */ e.jsxs(k, { variant: "ghost", size: "icon", className: "size-8", children: [
|
|
2222
|
+
/* @__PURE__ */ e.jsx(ue, {}),
|
|
2223
|
+
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: n("common.toggle") })
|
|
2224
|
+
] })
|
|
2225
|
+
] }) }),
|
|
2226
|
+
/* @__PURE__ */ e.jsxs(Ce, { className: "flex flex-col gap-6", children: [
|
|
2227
|
+
/* @__PURE__ */ e.jsx(
|
|
2228
|
+
i,
|
|
2229
|
+
{
|
|
2230
|
+
name: "name",
|
|
2231
|
+
children: (a) => /* @__PURE__ */ e.jsxs(S, { children: [
|
|
2232
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: a.name, children: n("editor.inputNodeForm.name") }),
|
|
2233
|
+
/* @__PURE__ */ e.jsx(
|
|
2234
|
+
P,
|
|
2235
|
+
{
|
|
2236
|
+
id: a.name,
|
|
2237
|
+
name: a.name,
|
|
2238
|
+
value: a.state.value,
|
|
2239
|
+
onBlur: a.handleBlur,
|
|
2240
|
+
onChange: ({ target: d }) => a.handleChange(d.value)
|
|
2241
|
+
}
|
|
2242
|
+
),
|
|
2243
|
+
/* @__PURE__ */ e.jsx(B, { children: n("editor.inputNodeForm.nameDescription") })
|
|
2244
|
+
] })
|
|
2245
|
+
}
|
|
2246
|
+
),
|
|
2247
|
+
/* @__PURE__ */ e.jsx(i, { name: "defaultValue", children: (a) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2248
|
+
/* @__PURE__ */ e.jsxs(S, { children: [
|
|
2249
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: a.name, children: n("editor.inputNodeForm.defaultValueType") }),
|
|
2250
|
+
/* @__PURE__ */ e.jsxs(
|
|
2251
|
+
U,
|
|
2252
|
+
{
|
|
2253
|
+
value: a.state.value?.type || "none",
|
|
2254
|
+
onValueChange: (d) => {
|
|
2255
|
+
a.handleChange(d === "none" ? null : { type: d });
|
|
2256
|
+
},
|
|
2257
|
+
children: [
|
|
2258
|
+
/* @__PURE__ */ e.jsx(R, { id: a.name, children: /* @__PURE__ */ e.jsx(Z, { placeholder: n("editor.inputNodeForm.selectType") }) }),
|
|
2259
|
+
/* @__PURE__ */ e.jsxs(K, { children: [
|
|
2260
|
+
/* @__PURE__ */ e.jsx(w, { value: "none", children: n("editor.inputNodeForm.defaultValueTypeNone") }),
|
|
2261
|
+
/* @__PURE__ */ e.jsx(w, { value: "static", children: n("editor.inputNodeForm.defaultValueTypeStatic") }),
|
|
2262
|
+
/* @__PURE__ */ e.jsx(w, { value: "reference", children: n("editor.inputNodeForm.defaultValueTypeReference") })
|
|
2263
|
+
] })
|
|
2264
|
+
]
|
|
2265
|
+
}
|
|
2266
|
+
)
|
|
2267
|
+
] }),
|
|
2268
|
+
a.state.value?.type === "static" && /* @__PURE__ */ e.jsx(i, { name: "defaultValue.staticValue", children: (d) => {
|
|
2269
|
+
const p = r?.data?.type;
|
|
2270
|
+
return (p === "select" || p === "checkbox") && r?.data?.multiple ? /* @__PURE__ */ e.jsxs(S, { children: [
|
|
2271
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: d.name, children: n("editor.inputNodeForm.defaultValuesCommaSeparated") }),
|
|
2272
|
+
/* @__PURE__ */ e.jsx(
|
|
2273
|
+
P,
|
|
2274
|
+
{
|
|
2275
|
+
id: d.name,
|
|
2276
|
+
placeholder: n("editor.inputNodeForm.defaultValuesPlaceholder"),
|
|
2277
|
+
value: Array.isArray(d.state.value) ? d.state.value.join(", ") : "",
|
|
2278
|
+
onChange: ({ target: m }) => {
|
|
2279
|
+
const u = m.value.split(",").map((f) => f.trim()).filter(Boolean);
|
|
2280
|
+
d.handleChange(u.length > 0 ? u : null);
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
)
|
|
2284
|
+
] }) : p === "checkbox" ? /* @__PURE__ */ e.jsx(S, { children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
2285
|
+
/* @__PURE__ */ e.jsx(
|
|
2286
|
+
ae,
|
|
2287
|
+
{
|
|
2288
|
+
id: d.name,
|
|
2289
|
+
checked: !!d.state.value,
|
|
2290
|
+
onCheckedChange: (m) => d.handleChange(m)
|
|
2291
|
+
}
|
|
2292
|
+
),
|
|
2293
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: d.name, children: n("editor.inputNodeForm.defaultChecked") })
|
|
2294
|
+
] }) }) : /* @__PURE__ */ e.jsxs(S, { children: [
|
|
2295
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: d.name, children: n("editor.inputNodeForm.staticValue") }),
|
|
2296
|
+
/* @__PURE__ */ e.jsx(
|
|
2297
|
+
P,
|
|
2298
|
+
{
|
|
2299
|
+
id: d.name,
|
|
2300
|
+
placeholder: n("editor.inputNodeForm.staticValuePlaceholder"),
|
|
2301
|
+
value: typeof d.state.value == "string" ? d.state.value : "",
|
|
2302
|
+
onChange: ({ target: m }) => d.handleChange(m.value || "")
|
|
2303
|
+
}
|
|
2304
|
+
)
|
|
2305
|
+
] });
|
|
2306
|
+
} }),
|
|
2307
|
+
a.state.value?.type === "reference" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2308
|
+
/* @__PURE__ */ e.jsx(i, { name: "defaultValue.referenceField", children: (d) => /* @__PURE__ */ e.jsxs(S, { children: [
|
|
2309
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: d.name, children: n("editor.inputNodeForm.referenceField") }),
|
|
2310
|
+
/* @__PURE__ */ e.jsxs(
|
|
2311
|
+
U,
|
|
2312
|
+
{
|
|
2313
|
+
value: d.state.value || "",
|
|
2314
|
+
onValueChange: (p) => {
|
|
2315
|
+
d.handleChange(p);
|
|
2316
|
+
},
|
|
2317
|
+
children: [
|
|
2318
|
+
/* @__PURE__ */ e.jsx(R, { id: d.name, children: /* @__PURE__ */ e.jsx(Z, { placeholder: n("editor.inputNodeForm.selectReferenceField") }) }),
|
|
2319
|
+
/* @__PURE__ */ e.jsx(K, { children: l.length === 0 ? /* @__PURE__ */ e.jsx(w, { value: "none", disabled: !0, children: n("editor.inputNodeForm.noParentFieldsAvailable") }) : l.map((p) => /* @__PURE__ */ e.jsxs(w, { value: p.nodeId, children: [
|
|
2320
|
+
p.label,
|
|
2321
|
+
" (",
|
|
2322
|
+
p.type,
|
|
2323
|
+
")"
|
|
2324
|
+
] }, p.nodeId)) })
|
|
2325
|
+
]
|
|
2326
|
+
}
|
|
2327
|
+
),
|
|
2328
|
+
l.length === 0 && /* @__PURE__ */ e.jsx(B, { children: n("editor.inputNodeForm.addInputFieldsBeforeReference") })
|
|
2329
|
+
] }) }),
|
|
2330
|
+
/* @__PURE__ */ e.jsx(i, { name: "defaultValue.transformFunction", children: (d) => /* @__PURE__ */ e.jsxs(S, { children: [
|
|
2331
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: d.name, children: n("editor.inputNodeForm.transformType") }),
|
|
2332
|
+
/* @__PURE__ */ e.jsxs(
|
|
2333
|
+
U,
|
|
2334
|
+
{
|
|
2335
|
+
value: d.state.value || "none",
|
|
2336
|
+
onValueChange: (p) => {
|
|
2337
|
+
const m = p === "none" ? null : p;
|
|
2338
|
+
if (d.handleChange(m), p === "toObject") {
|
|
2339
|
+
const u = a.state.value;
|
|
2340
|
+
a.handleChange({
|
|
2341
|
+
...u,
|
|
2342
|
+
objectMapping: []
|
|
2343
|
+
});
|
|
2344
|
+
}
|
|
2345
|
+
},
|
|
2346
|
+
children: [
|
|
2347
|
+
/* @__PURE__ */ e.jsx(R, { id: d.name, children: /* @__PURE__ */ e.jsx(Z, { placeholder: n("editor.inputNodeForm.selectTransformation") }) }),
|
|
2348
|
+
/* @__PURE__ */ e.jsxs(K, { children: [
|
|
2349
|
+
/* @__PURE__ */ e.jsx(w, { value: "none", children: n("editor.inputNodeForm.transformNone") }),
|
|
2350
|
+
/* @__PURE__ */ e.jsx(w, { value: "toString", children: n("editor.inputNodeForm.transformString") }),
|
|
2351
|
+
/* @__PURE__ */ e.jsx(w, { value: "toNumber", children: n("editor.inputNodeForm.transformNumber") }),
|
|
2352
|
+
/* @__PURE__ */ e.jsx(w, { value: "toBoolean", children: n("editor.inputNodeForm.transformBoolean") }),
|
|
2353
|
+
/* @__PURE__ */ e.jsx(w, { value: "toArray", children: n("editor.inputNodeForm.transformArray") }),
|
|
2354
|
+
/* @__PURE__ */ e.jsx(w, { value: "toObject", children: n("editor.inputNodeForm.transformMapToObject") })
|
|
2355
|
+
] })
|
|
2356
|
+
]
|
|
2357
|
+
}
|
|
2358
|
+
),
|
|
2359
|
+
/* @__PURE__ */ e.jsx(B, { children: n("editor.inputNodeForm.transformDesc") })
|
|
2360
|
+
] }) }),
|
|
2361
|
+
a.state.value?.transformFunction === "toObject" && /* @__PURE__ */ e.jsx(i, { name: "defaultValue.objectMapping", mode: "array", children: (d) => /* @__PURE__ */ e.jsxs(S, { children: [
|
|
2362
|
+
/* @__PURE__ */ e.jsx(b, { children: n("editor.inputNodeForm.objectMapping") }),
|
|
2363
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
2364
|
+
d.state.value?.map((p, m) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2365
|
+
/* @__PURE__ */ e.jsx(i, { name: `defaultValue.objectMapping[${m}].sourceKey`, children: (u) => /* @__PURE__ */ e.jsx(
|
|
2366
|
+
P,
|
|
2367
|
+
{
|
|
2368
|
+
placeholder: n("editor.inputNodeForm.sourceKey"),
|
|
2369
|
+
value: u.state.value || "",
|
|
2370
|
+
onChange: ({ target: f }) => u.handleChange(f.value)
|
|
2371
|
+
}
|
|
2372
|
+
) }),
|
|
2373
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "→" }),
|
|
2374
|
+
/* @__PURE__ */ e.jsx(i, { name: `defaultValue.objectMapping[${m}].targetKey`, children: (u) => /* @__PURE__ */ e.jsx(
|
|
2375
|
+
P,
|
|
2376
|
+
{
|
|
2377
|
+
placeholder: n("editor.inputNodeForm.targetKey"),
|
|
2378
|
+
value: u.state.value || "",
|
|
2379
|
+
onChange: ({ target: f }) => u.handleChange(f.value)
|
|
2380
|
+
}
|
|
2381
|
+
) }),
|
|
2382
|
+
/* @__PURE__ */ e.jsx(
|
|
2383
|
+
k,
|
|
2384
|
+
{
|
|
2385
|
+
type: "button",
|
|
2386
|
+
variant: "ghost",
|
|
2387
|
+
size: "icon",
|
|
2388
|
+
onClick: () => {
|
|
2389
|
+
d.removeValue(m), c().then();
|
|
2390
|
+
},
|
|
2391
|
+
children: /* @__PURE__ */ e.jsx(re, { className: "h-4 w-4" })
|
|
2392
|
+
}
|
|
2393
|
+
)
|
|
2394
|
+
] }, `mapping-${m}`)),
|
|
2395
|
+
/* @__PURE__ */ e.jsxs(
|
|
2396
|
+
k,
|
|
2397
|
+
{
|
|
2398
|
+
type: "button",
|
|
2399
|
+
variant: "outline",
|
|
2400
|
+
size: "sm",
|
|
2401
|
+
className: "w-full",
|
|
2402
|
+
onClick: () => {
|
|
2403
|
+
d.pushValue({ sourceKey: "", targetKey: "" }), c().then();
|
|
2404
|
+
},
|
|
2405
|
+
children: [
|
|
2406
|
+
/* @__PURE__ */ e.jsx(W, { className: "mr-2 h-4 w-4" }),
|
|
2407
|
+
n("editor.inputNodeForm.addMapping")
|
|
2408
|
+
]
|
|
2409
|
+
}
|
|
2410
|
+
)
|
|
2411
|
+
] }),
|
|
2412
|
+
/* @__PURE__ */ e.jsx(B, { children: n("editor.inputNodeForm.objectMappingDesc") })
|
|
2413
|
+
] }) })
|
|
2414
|
+
] })
|
|
2415
|
+
] }) })
|
|
2416
|
+
] })
|
|
2417
|
+
] })
|
|
2418
|
+
] })
|
|
2419
|
+
}
|
|
2420
|
+
);
|
|
2421
|
+
}, _e = {
|
|
2422
|
+
divider: "divider",
|
|
2423
|
+
title: "title"
|
|
2424
|
+
}, Ia = () => {
|
|
2425
|
+
const [t, s] = $("en"), { selectedNode: r } = X(), { updateSelectedNodeData: o } = ce(), { Field: h } = de({
|
|
2426
|
+
defaultValues: {
|
|
2427
|
+
label: r?.data?.label || { en: "" },
|
|
2428
|
+
type: r?.data?.type
|
|
2429
|
+
},
|
|
2430
|
+
listeners: {
|
|
2431
|
+
onChange: ({ formApi: l }) => {
|
|
2432
|
+
l.handleSubmit().then();
|
|
2433
|
+
},
|
|
2434
|
+
onChangeDebounceMs: 150
|
|
2435
|
+
},
|
|
2436
|
+
onSubmit: ({ value: l }) => {
|
|
2437
|
+
o(l);
|
|
2438
|
+
}
|
|
2439
|
+
});
|
|
2440
|
+
return /* @__PURE__ */ e.jsx(
|
|
2441
|
+
"form",
|
|
2442
|
+
{
|
|
2443
|
+
onSubmit: (l) => {
|
|
2444
|
+
l.preventDefault(), l.stopPropagation();
|
|
2445
|
+
},
|
|
2446
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-6", children: [
|
|
2447
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
|
|
2448
|
+
/* @__PURE__ */ e.jsx(
|
|
2449
|
+
h,
|
|
2450
|
+
{
|
|
2451
|
+
name: "label",
|
|
2452
|
+
children: (l) => /* @__PURE__ */ e.jsxs(S, { className: "flex-1", children: [
|
|
2453
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: l.name, children: "Label" }),
|
|
2454
|
+
/* @__PURE__ */ e.jsx(
|
|
2455
|
+
P,
|
|
2456
|
+
{
|
|
2457
|
+
id: l.name,
|
|
2458
|
+
name: l.name,
|
|
2459
|
+
value: l.state.value?.[t] || "",
|
|
2460
|
+
onBlur: l.handleBlur,
|
|
2461
|
+
onChange: ({ target: n }) => {
|
|
2462
|
+
l.handleChange({
|
|
2463
|
+
...l.state.value,
|
|
2464
|
+
[t]: n.value
|
|
2465
|
+
});
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
)
|
|
2469
|
+
] })
|
|
2470
|
+
}
|
|
2471
|
+
),
|
|
2472
|
+
/* @__PURE__ */ e.jsx(Q, { value: t, onValueChange: s })
|
|
2473
|
+
] }),
|
|
2474
|
+
/* @__PURE__ */ e.jsx(
|
|
2475
|
+
h,
|
|
2476
|
+
{
|
|
2477
|
+
name: "type",
|
|
2478
|
+
children: (l) => /* @__PURE__ */ e.jsxs(J, { children: [
|
|
2479
|
+
/* @__PURE__ */ e.jsx(Ve, { children: "Type" }),
|
|
2480
|
+
/* @__PURE__ */ e.jsxs(U, { value: l.state.value, onValueChange: (n) => l.handleChange(n), children: [
|
|
2481
|
+
/* @__PURE__ */ e.jsx(R, { className: "w-full", children: /* @__PURE__ */ e.jsx(Z, { placeholder: "" }) }),
|
|
2482
|
+
/* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsxs(J, { children: [
|
|
2483
|
+
/* @__PURE__ */ e.jsx(w, { value: _e.title, children: "Title" }),
|
|
2484
|
+
/* @__PURE__ */ e.jsx(w, { value: _e.divider, children: "Divider" })
|
|
2485
|
+
] }) })
|
|
2486
|
+
] })
|
|
2487
|
+
] })
|
|
2488
|
+
}
|
|
2489
|
+
)
|
|
2490
|
+
] })
|
|
2491
|
+
}
|
|
2492
|
+
);
|
|
2493
|
+
}, Aa = () => {
|
|
2494
|
+
const [t, s] = $(""), [r, o] = $(!1), { selectedNode: h, groupNodes: l } = X(), { setNodes: n } = pe(), c = h?.parentId || "none", i = fe(h), a = M();
|
|
2495
|
+
if (i)
|
|
2496
|
+
return null;
|
|
2497
|
+
const d = (m) => {
|
|
2498
|
+
h && n((u) => m === "none" ? u.map((x) => {
|
|
2499
|
+
if (x.id === h.id) {
|
|
2500
|
+
const { parentId: E, extent: j, ...y } = x;
|
|
2501
|
+
return y;
|
|
2502
|
+
}
|
|
2503
|
+
return x;
|
|
2504
|
+
}) : u.find((x) => x.id === m) ? u.map((x) => x.id === h.id ? {
|
|
2505
|
+
...x,
|
|
2506
|
+
extent: "parent",
|
|
2507
|
+
parentId: m,
|
|
2508
|
+
position: {
|
|
2509
|
+
x: 50,
|
|
2510
|
+
y: 80
|
|
2511
|
+
}
|
|
2512
|
+
} : x) : u);
|
|
2513
|
+
}, p = () => {
|
|
2514
|
+
if (!(t.trim() && h))
|
|
2515
|
+
return;
|
|
2516
|
+
if (l.find((f) => {
|
|
2517
|
+
const x = f.data?.label?.en || f.data?.label;
|
|
2518
|
+
return String(x).toLowerCase() === t.trim().toLowerCase();
|
|
2519
|
+
})) {
|
|
2520
|
+
H.error("This group already exists", {
|
|
2521
|
+
description: "Use the selector to add the node to an existing group."
|
|
2522
|
+
});
|
|
2523
|
+
return;
|
|
2524
|
+
}
|
|
2525
|
+
const u = le();
|
|
2526
|
+
n((f) => {
|
|
2527
|
+
const x = {
|
|
2528
|
+
data: {
|
|
2529
|
+
label: {
|
|
2530
|
+
en: t.trim()
|
|
2531
|
+
}
|
|
2532
|
+
},
|
|
2533
|
+
id: u,
|
|
2534
|
+
position: {
|
|
2535
|
+
x: h.position.x - 300,
|
|
2536
|
+
y: h.position.y
|
|
2537
|
+
},
|
|
2538
|
+
style: {
|
|
2539
|
+
height: 400,
|
|
2540
|
+
width: 600
|
|
2541
|
+
},
|
|
2542
|
+
type: "group"
|
|
2543
|
+
}, E = f.map((j) => j.id === h.id ? {
|
|
2544
|
+
...j,
|
|
2545
|
+
extent: "parent",
|
|
2546
|
+
parentId: u,
|
|
2547
|
+
position: {
|
|
2548
|
+
x: 175,
|
|
2549
|
+
y: 30
|
|
2550
|
+
}
|
|
2551
|
+
} : j);
|
|
2552
|
+
return [x, ...E];
|
|
2553
|
+
}), s(""), o(!1), H.success("Group created", {
|
|
2554
|
+
description: `The group "${t.trim()}" has been created successfully.`
|
|
2555
|
+
});
|
|
2556
|
+
};
|
|
2557
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
2558
|
+
/* @__PURE__ */ e.jsx(b, { children: a("editor.selectNodeGroup.group") }),
|
|
2559
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
2560
|
+
/* @__PURE__ */ e.jsxs(U, { value: c, onValueChange: d, children: [
|
|
2561
|
+
/* @__PURE__ */ e.jsx(R, { className: "flex-1", children: /* @__PURE__ */ e.jsx(Z, { placeholder: a("editor.selectNodeGroup.noGroup") }) }),
|
|
2562
|
+
/* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsxs(J, { children: [
|
|
2563
|
+
/* @__PURE__ */ e.jsx(w, { value: "none", children: a("editor.selectNodeGroup.noGroup") }),
|
|
2564
|
+
l.map((m) => /* @__PURE__ */ e.jsx(w, { value: m.id, children: m.data.label?.en ? String(m.data.label?.en) : m.id }, m.id))
|
|
2565
|
+
] }) })
|
|
2566
|
+
] }),
|
|
2567
|
+
/* @__PURE__ */ e.jsxs(Pe, { open: r, onOpenChange: o, children: [
|
|
2568
|
+
/* @__PURE__ */ e.jsx(Te, { asChild: !0, children: /* @__PURE__ */ e.jsx(k, { variant: "outline", size: "icon", title: "Create a new group", children: /* @__PURE__ */ e.jsx(At, { className: "h-4 w-4" }) }) }),
|
|
2569
|
+
/* @__PURE__ */ e.jsx(De, { className: "w-80", align: "end", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
2570
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
2571
|
+
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: a("editor.selectNodeGroup.newGroup") }),
|
|
2572
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-muted-foreground text-sm", children: a("editor.selectNodeGroup.newGroupDescription") })
|
|
2573
|
+
] }),
|
|
2574
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
2575
|
+
/* @__PURE__ */ e.jsx(b, { htmlFor: "group-label", children: a("editor.selectNodeGroup.groupName") }),
|
|
2576
|
+
/* @__PURE__ */ e.jsx(
|
|
2577
|
+
P,
|
|
2578
|
+
{
|
|
2579
|
+
autoFocus: !0,
|
|
2580
|
+
value: t,
|
|
2581
|
+
onChange: (m) => s(m.target.value),
|
|
2582
|
+
placeholder: "Ex: Step 1 - Personal info",
|
|
2583
|
+
onKeyDown: (m) => {
|
|
2584
|
+
m.key === "Enter" && (m.preventDefault(), p());
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
)
|
|
2588
|
+
] }),
|
|
2589
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
2590
|
+
/* @__PURE__ */ e.jsx(k, { variant: "outline", size: "sm", onClick: () => o(!1), children: "Cancel" }),
|
|
2591
|
+
/* @__PURE__ */ e.jsx(k, { size: "sm", onClick: p, disabled: !t.trim(), children: "Create" })
|
|
2592
|
+
] })
|
|
2593
|
+
] }) })
|
|
2594
|
+
] })
|
|
2595
|
+
] })
|
|
2596
|
+
] });
|
|
2597
|
+
}, La = () => {
|
|
2598
|
+
const { selectedNode: t } = X(), { updateSelectedNodeType: s } = ce(), r = t?.type || "", o = fe(t), h = M();
|
|
2599
|
+
return /* @__PURE__ */ e.jsxs(J, { children: [
|
|
2600
|
+
/* @__PURE__ */ e.jsx(Ve, { children: h("editor.selectNodeType.nodeType") }),
|
|
2601
|
+
/* @__PURE__ */ e.jsxs(U, { value: r, onValueChange: (l) => s(l), disabled: o, children: [
|
|
2602
|
+
/* @__PURE__ */ e.jsx(R, { className: "w-full", children: /* @__PURE__ */ e.jsx(Z, { placeholder: h("editor.selectNodeType.nodeType") }) }),
|
|
2603
|
+
/* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsx(J, { children: Object.keys(Qe).filter((l) => o ? l === "group" : l !== "group").map((l) => /* @__PURE__ */ e.jsx(w, { value: l, children: l.charAt(0).toUpperCase() + l.slice(1) }, l)) }) })
|
|
2604
|
+
] })
|
|
2605
|
+
] });
|
|
2606
|
+
};
|
|
2607
|
+
function Ma({ ...t }) {
|
|
2608
|
+
return /* @__PURE__ */ e.jsx(A.Root, { "data-slot": "sheet", ...t });
|
|
2609
|
+
}
|
|
2610
|
+
function Ga({ ...t }) {
|
|
2611
|
+
return /* @__PURE__ */ e.jsx(A.Portal, { "data-slot": "sheet-portal", ...t });
|
|
2612
|
+
}
|
|
2613
|
+
function Ha({ className: t, ...s }) {
|
|
2614
|
+
return /* @__PURE__ */ e.jsx(
|
|
2615
|
+
A.Overlay,
|
|
2616
|
+
{
|
|
2617
|
+
"data-slot": "sheet-overlay",
|
|
2618
|
+
className: T(
|
|
2619
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
2620
|
+
t
|
|
2621
|
+
),
|
|
2622
|
+
...s
|
|
2623
|
+
}
|
|
2624
|
+
);
|
|
2625
|
+
}
|
|
2626
|
+
function Ba({
|
|
2627
|
+
className: t,
|
|
2628
|
+
children: s,
|
|
2629
|
+
side: r = "right",
|
|
2630
|
+
...o
|
|
2631
|
+
}) {
|
|
2632
|
+
return /* @__PURE__ */ e.jsxs(Ga, { children: [
|
|
2633
|
+
/* @__PURE__ */ e.jsx(Ha, {}),
|
|
2634
|
+
/* @__PURE__ */ e.jsxs(
|
|
2635
|
+
A.Content,
|
|
2636
|
+
{
|
|
2637
|
+
"data-slot": "sheet-content",
|
|
2638
|
+
className: T(
|
|
2639
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
2640
|
+
r === "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",
|
|
2641
|
+
r === "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",
|
|
2642
|
+
r === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
2643
|
+
r === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
|
|
2644
|
+
t
|
|
2645
|
+
),
|
|
2646
|
+
...o,
|
|
2647
|
+
children: [
|
|
2648
|
+
s,
|
|
2649
|
+
/* @__PURE__ */ e.jsxs(A.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
|
|
2650
|
+
/* @__PURE__ */ e.jsx(Ke, { className: "size-4" }),
|
|
2651
|
+
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Close" })
|
|
2652
|
+
] })
|
|
2653
|
+
]
|
|
2654
|
+
}
|
|
2655
|
+
)
|
|
2656
|
+
] });
|
|
2657
|
+
}
|
|
2658
|
+
function za({ className: t, ...s }) {
|
|
2659
|
+
return /* @__PURE__ */ e.jsx("div", { "data-slot": "sheet-header", className: T("flex flex-col gap-1.5 p-4", t), ...s });
|
|
2660
|
+
}
|
|
2661
|
+
function $a({ className: t, ...s }) {
|
|
2662
|
+
return /* @__PURE__ */ e.jsx(A.Title, { "data-slot": "sheet-title", className: T("text-foreground font-semibold", t), ...s });
|
|
2663
|
+
}
|
|
2664
|
+
function _a({ className: t, ...s }) {
|
|
2665
|
+
return /* @__PURE__ */ e.jsx(A.Description, { "data-slot": "sheet-description", className: T("text-muted-foreground text-sm", t), ...s });
|
|
2666
|
+
}
|
|
2667
|
+
const Ua = () => {
|
|
2668
|
+
const { selectedNode: t, hasSelectedNodes: s } = X(), { clearSelection: r } = ce(), h = M()(t?.data?.label);
|
|
2669
|
+
return /* @__PURE__ */ e.jsx(Ma, { open: s, onOpenChange: r, children: /* @__PURE__ */ e.jsxs(Ba, { children: [
|
|
2670
|
+
/* @__PURE__ */ e.jsxs(za, { children: [
|
|
2671
|
+
/* @__PURE__ */ e.jsxs($a, { children: [
|
|
2672
|
+
"Edit node ",
|
|
2673
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-light text-muted-foreground text-xs", children: t?.id })
|
|
2674
|
+
] }),
|
|
2675
|
+
/* @__PURE__ */ e.jsx(_a, { children: h || " " })
|
|
2676
|
+
] }),
|
|
2677
|
+
/* @__PURE__ */ e.jsx(We, { className: "flex min-h-0 flex-1 flex-col px-4 py-6", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
|
|
2678
|
+
/* @__PURE__ */ e.jsx(La, {}),
|
|
2679
|
+
/* @__PURE__ */ e.jsx(Aa, {}),
|
|
2680
|
+
/* @__PURE__ */ e.jsx(it, {}),
|
|
2681
|
+
he(t) && /* @__PURE__ */ e.jsx(Oa, {}),
|
|
2682
|
+
rt(t) && /* @__PURE__ */ e.jsx(Ia, {}),
|
|
2683
|
+
lt(t) && /* @__PURE__ */ e.jsx(wa, {}),
|
|
2684
|
+
fe(t) && /* @__PURE__ */ e.jsx(Fa, {})
|
|
2685
|
+
] }) })
|
|
2686
|
+
] }) });
|
|
2687
|
+
}, Ra = ({ ...t }) => {
|
|
2688
|
+
const { theme: s = "system" } = _t();
|
|
2689
|
+
return /* @__PURE__ */ e.jsx(
|
|
2690
|
+
$t,
|
|
2691
|
+
{
|
|
2692
|
+
theme: s,
|
|
2693
|
+
className: "toaster group",
|
|
2694
|
+
style: {
|
|
2695
|
+
"--normal-bg": "var(--popover)",
|
|
2696
|
+
"--normal-border": "var(--border)",
|
|
2697
|
+
"--normal-text": "var(--popover-foreground)"
|
|
2698
|
+
},
|
|
2699
|
+
...t
|
|
2700
|
+
}
|
|
2701
|
+
);
|
|
2702
|
+
}, Za = ({ flow: t, onExportJson: s, onSave: r, theme: o }) => {
|
|
2703
|
+
const { onConnect: h, onConnectEnd: l, onEdgesDelete: n, isValidConnection: c } = qe();
|
|
2704
|
+
return /* @__PURE__ */ e.jsxs(
|
|
2705
|
+
jt,
|
|
2706
|
+
{
|
|
2707
|
+
fitView: !0,
|
|
2708
|
+
colorMode: o,
|
|
2709
|
+
selectNodesOnDrag: !1,
|
|
2710
|
+
nodeTypes: Qe,
|
|
2711
|
+
edgeTypes: Wt,
|
|
2712
|
+
defaultEdges: t?.edges || [],
|
|
2713
|
+
defaultNodes: t?.nodes || [],
|
|
2714
|
+
onConnect: h,
|
|
2715
|
+
onConnectEnd: l,
|
|
2716
|
+
onEdgesDelete: n,
|
|
2717
|
+
isValidConnection: c,
|
|
2718
|
+
children: [
|
|
2719
|
+
/* @__PURE__ */ e.jsx(Ct, { gap: 10, variant: ft.Dots }),
|
|
2720
|
+
/* @__PURE__ */ e.jsx(Na, { onExportJson: s, onSave: r }),
|
|
2721
|
+
/* @__PURE__ */ e.jsx(Zt, { theme: o }),
|
|
2722
|
+
/* @__PURE__ */ e.jsx(vt, {}),
|
|
2723
|
+
/* @__PURE__ */ e.jsx(bt, {}),
|
|
2724
|
+
/* @__PURE__ */ e.jsx(Ua, {})
|
|
2725
|
+
]
|
|
2726
|
+
}
|
|
2727
|
+
);
|
|
2728
|
+
}, an = ({ flow: t, onExportJson: s, onSave: r, theme: o = "dark", language: h = "en", aiConfig: l }) => /* @__PURE__ */ e.jsx(dt, { defaultTheme: o, storageKey: "treege-editor-theme", theme: o, children: /* @__PURE__ */ e.jsxs(Kt, { value: { aiConfig: l, flowId: t?.id, language: h }, children: [
|
|
2729
|
+
/* @__PURE__ */ e.jsx(Ra, { position: "bottom-center" }),
|
|
2730
|
+
/* @__PURE__ */ e.jsx(gt, { children: /* @__PURE__ */ e.jsx(Za, { onExportJson: s, onSave: r, flow: t, theme: o }) })
|
|
2731
|
+
] }) });
|
|
2732
|
+
export {
|
|
2733
|
+
an as T
|
|
2734
|
+
};
|