@ws-ui/http-handlers-editor 1.11.3-rc1
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/Editor.d.ts +7 -0
- package/dist/Handler/index.d.ts +3 -0
- package/dist/Provider/index.d.ts +59 -0
- package/dist/Standalone/index.d.ts +6 -0
- package/dist/SwitchToEditorIcon.d.ts +12 -0
- package/dist/http-handlers-editor.css +1 -0
- package/dist/index.cjs.js +6 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +1150 -0
- package/dist/index.es.js.map +1 -0
- package/dist/main.d.ts +0 -0
- package/package.json +60 -0
package/dist/Editor.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Subject } from 'rxjs';
|
|
3
|
+
export type HTTPVerb = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
4
|
+
export type HTTPHandler = {
|
|
5
|
+
id: string;
|
|
6
|
+
class: string;
|
|
7
|
+
method: string;
|
|
8
|
+
pattern: string;
|
|
9
|
+
regexPattern: string;
|
|
10
|
+
verbs: HTTPVerb[];
|
|
11
|
+
isExpanded: boolean;
|
|
12
|
+
asRegex?: boolean;
|
|
13
|
+
};
|
|
14
|
+
type HandlerState = {
|
|
15
|
+
content: HTTPHandler[];
|
|
16
|
+
editing: string | null;
|
|
17
|
+
newlyCreatedHandlerID: string | null;
|
|
18
|
+
};
|
|
19
|
+
type HandlerContextType = {
|
|
20
|
+
state: HandlerState;
|
|
21
|
+
dispatch: React.Dispatch<HandlerAction>;
|
|
22
|
+
};
|
|
23
|
+
export declare const $handlerSubject: Subject<unknown>;
|
|
24
|
+
type HandlerAction = {
|
|
25
|
+
type: 'ADD_HANDLER';
|
|
26
|
+
payload: Omit<HTTPHandler, 'id'>;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'UPDATE_HANDLER';
|
|
29
|
+
id: string;
|
|
30
|
+
payload: Partial<HTTPHandler>;
|
|
31
|
+
} | {
|
|
32
|
+
type: 'DELETE_HANDLER';
|
|
33
|
+
id: string;
|
|
34
|
+
} | {
|
|
35
|
+
type: 'TOGGLE_EXPANDED';
|
|
36
|
+
id: string;
|
|
37
|
+
} | {
|
|
38
|
+
type: 'DUPLICATE_HANDLER';
|
|
39
|
+
id: string;
|
|
40
|
+
} | {
|
|
41
|
+
type: 'TOGGLE_ALL_EXPANDED';
|
|
42
|
+
payload: boolean;
|
|
43
|
+
} | {
|
|
44
|
+
type: 'UPDATE_HANDLERS';
|
|
45
|
+
payload: HTTPHandler[];
|
|
46
|
+
} | {
|
|
47
|
+
type: 'SYNC_DATA';
|
|
48
|
+
payload: HTTPHandler[];
|
|
49
|
+
} | {
|
|
50
|
+
type: 'SET_EDITING_HANDLER';
|
|
51
|
+
payload: string | null;
|
|
52
|
+
};
|
|
53
|
+
type HandlerProviderProps = {
|
|
54
|
+
children: ReactNode;
|
|
55
|
+
content: HTTPHandler[];
|
|
56
|
+
};
|
|
57
|
+
export declare const HandlerProvider: React.FC<HandlerProviderProps>;
|
|
58
|
+
export declare const useHTTPHandlers: () => HandlerContextType;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IconType } from '@ws-ui/icons';
|
|
2
|
+
import { IEditor, ITab } from '@ws-ui/shared';
|
|
3
|
+
import { FC } from 'react';
|
|
4
|
+
interface SwitchToEditorIconProps {
|
|
5
|
+
label: string;
|
|
6
|
+
Icon: IconType;
|
|
7
|
+
tab: ITab;
|
|
8
|
+
editor: IEditor;
|
|
9
|
+
onBeforeClick?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const SwitchToEditorIcon: FC<SwitchToEditorIconProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px var(--tw-prose-kbd-shadows),0 3px 0 var(--tw-prose-kbd-shadows);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: rgb(17 24 39 / 10%);--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: rgb(255 255 255 / 10%);--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em;color:#ccc}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2;color:#fff}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4;color:#fff}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-bottom:.4444444em;line-height:1.5555556;color:#fff;margin-top:0}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714;color:#fff}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:5px;margin-bottom:5px}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:#ccc}.prose-sm :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:#bfdbfe}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.static{position:static}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.left-1{left:.25rem}.right-0{right:0}.right-1{right:.25rem}.right-6{right:1.5rem}.top-1{top:.25rem}.top-\[25px\]{top:25px}.isolate{isolation:isolate}.z-10{z-index:10}.z-50{z-index:50}.z-\[1999\]{z-index:1999}.z-\[1\]{z-index:1}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.-mt-6{margin-top:-1.5rem}.mb-1{margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.mt-3{margin-top:.75rem}.mt-6{margin-top:1.5rem}.mt-px{margin-top:1px}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.size-4{width:1rem;height:1rem}.size-6{width:1.5rem;height:1.5rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-4\.5{height:1.125rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-full{height:100%}.h-screen{height:100vh}.max-h-60{max-height:15rem}.max-h-\[10rem\]{max-height:10rem}.min-h-\[10rem\]{min-height:10rem}.w-10{width:2.5rem}.w-16{width:4rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-\[--width\]{width:var(--width)}.w-\[1px\]{width:1px}.w-full{width:100%}.w-screen{width:100vw}.min-w-0{min-width:0px}.min-w-\[1200px\]{min-width:1200px}.max-w-\[240px\]{max-width:240px}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-2\.5{--tw-translate-x: .625rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-3{--tw-translate-x: .75rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[0\.85rem\]{--tw-translate-x: .85rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.list-disc{list-style-type:disc}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.place-content-center{place-content:center}.content-center{align-content:center}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-wrap{text-wrap:wrap}.rounded{border-radius:4px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-b{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-b-sm{border-bottom-right-radius:.125rem;border-bottom-left-radius:.125rem}.border{border-width:.5px}.border-2{border-width:2px}.border-b{border-bottom-width:.5px}.border-t{border-top-width:.5px}.border-none{border-style:none}.border-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity, 1))}.border-grey-50{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity, 1))}.border-grey-900{--tw-border-opacity: 1;border-color:rgb(38 38 38 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.\!bg-red-300{--tw-bg-opacity: 1 !important;background-color:rgb(252 165 165 / var(--tw-bg-opacity, 1))!important}.\!bg-yellow-100{--tw-bg-opacity: 1 !important;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))!important}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-fd-gray-default{--tw-bg-opacity: 1;background-color:rgb(49 49 49 / var(--tw-bg-opacity, 1))}.bg-grey-200{--tw-bg-opacity: 1;background-color:rgb(136 136 136 / var(--tw-bg-opacity, 1))}.bg-grey-300{--tw-bg-opacity: 1;background-color:rgb(83 83 83 / var(--tw-bg-opacity, 1))}.bg-grey-50{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-grey-600{--tw-bg-opacity: 1;background-color:rgb(63 63 63 / var(--tw-bg-opacity, 1))}.bg-grey-700{--tw-bg-opacity: 1;background-color:rgb(57 57 57 / var(--tw-bg-opacity, 1))}.bg-grey-800{--tw-bg-opacity: 1;background-color:rgb(56 56 56 / var(--tw-bg-opacity, 1))}.bg-grey-900{--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity, 1))}.bg-primary-dark{--tw-bg-opacity: 1;background-color:rgb(177 116 229 / var(--tw-bg-opacity, 1))}.bg-primary-hover{--tw-bg-opacity: 1;background-color:rgb(117 73 154 / var(--tw-bg-opacity, 1))}.bg-primary-light,.bg-purple-200{--tw-bg-opacity: 1;background-color:rgb(232 195 255 / var(--tw-bg-opacity, 1))}.bg-purple-800{--tw-bg-opacity: 1;background-color:rgb(146 95 190 / var(--tw-bg-opacity, 1))}.bg-red-200{--tw-bg-opacity: 1;background-color:rgb(254 202 202 / var(--tw-bg-opacity, 1))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(240 82 82 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-opacity-40{--tw-bg-opacity: .4}.bg-opacity-80{--tw-bg-opacity: .8}.stroke-current{stroke:currentColor}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-6{padding:1.5rem}.p-px{padding:1px}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-12{padding-left:3rem;padding-right:3rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-0{padding-bottom:0}.pb-0\.5{padding-bottom:.125rem}.pb-8{padding-bottom:2rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-6{padding-left:1.5rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-poppins{font-family:Poppins,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[12px\]{font-size:12px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-s{font-size:.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.65rem}.text-xxs{font-size:.55rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-6{line-height:1.5rem}.\!text-red-400{--tw-text-opacity: 1 !important;color:rgb(240 82 82 / var(--tw-text-opacity, 1))!important}.\!text-yellow-500{--tw-text-opacity: 1 !important;color:rgb(234 179 8 / var(--tw-text-opacity, 1))!important}.text-fd-gray-lighter{--tw-text-opacity: 1;color:rgb(234 234 234 / var(--tw-text-opacity, 1))}.text-fd-gray-mild{--tw-text-opacity: 1;color:rgb(179 179 179 / var(--tw-text-opacity, 1))}.text-gray-100{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.text-gray-50{--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-grey-100{--tw-text-opacity: 1;color:rgb(204 204 204 / var(--tw-text-opacity, 1))}.text-grey-200{--tw-text-opacity: 1;color:rgb(136 136 136 / var(--tw-text-opacity, 1))}.text-grey-50{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:rgb(187 11 209 / var(--tw-text-opacity, 1))}.text-primary-dark{--tw-text-opacity: 1;color:rgb(177 116 229 / var(--tw-text-opacity, 1))}.text-purple-900{--tw-text-opacity: 1;color:rgb(187 11 209 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(240 82 82 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(206 81 81 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(251 115 115 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-100{opacity:1}.opacity-50{opacity:.5}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-primary-dark{--tw-ring-opacity: 1;--tw-ring-color: rgb(177 116 229 / var(--tw-ring-opacity, 1))}.ring-red-400{--tw-ring-opacity: 1;--tw-ring-color: rgb(240 82 82 / var(--tw-ring-opacity, 1))}.ring-red-600{--tw-ring-opacity: 1;--tw-ring-color: rgb(251 115 115 / var(--tw-ring-opacity, 1))}.ring-yellow-500{--tw-ring-opacity: 1;--tw-ring-color: rgb(234 179 8 / var(--tw-ring-opacity, 1))}.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,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.odd\:bg-grey-500:nth-child(odd){--tw-bg-opacity: 1;background-color:rgb(68 68 68 / var(--tw-bg-opacity, 1))}.focus-within\:ring-1:focus-within{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-within\:ring-primary-dark:focus-within{--tw-ring-opacity: 1;--tw-ring-color: rgb(177 116 229 / var(--tw-ring-opacity, 1))}.hover\:border-white:hover{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.hover\:bg-gray-400\/30:hover{background-color:#9ca3af4d}.hover\:bg-primary-hover:hover{--tw-bg-opacity: 1;background-color:rgb(117 73 154 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-800:hover{--tw-bg-opacity: 1;background-color:rgb(146 95 190 / var(--tw-bg-opacity, 1))}.hover\:bg-red-400\/30:hover{background-color:#f052524d}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:font-bold:hover{font-weight:700}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-primary-dark:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(177 116 229 / var(--tw-ring-opacity, 1))}.focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(240 82 82 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-white:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-opacity-75:focus-visible{--tw-ring-opacity: .75}.active\:outline-none:active{outline:2px solid transparent;outline-offset:2px}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.group:hover .group-hover\:block{display:block}@media (min-width: 640px){.sm\:text-s{font-size:.75rem}}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),Z=require("@chakra-ui/react"),_=require("@dnd-kit/core"),q=require("@dnd-kit/sortable"),x=require("@ws-ui/icons"),C=require("@ws-ui/store"),K=require("@ws-ui/webform-editor"),v=require("react"),G=require("short-uuid"),L=require("zod"),ee=require("@dnd-kit/utilities"),H=require("@headlessui/react"),j=require("@ws-ui/shared"),T=require("classnames"),S=require("downshift"),B=require("lodash"),te=require("rxjs"),V=require("randexp"),se=({label:t,Icon:r,tab:n,editor:i,onBeforeClick:d})=>{const g=C.useAppDispatch();return e.jsx(K.ToolbarIcon,{label:t,Icon:r,as:"button",onClick:()=>{d==null||d(),g(C.switchEditor({tab:n,editor:i}))}})},J=v.createContext(void 0),O=new te.Subject,ne=(t,r)=>{switch(r.type){case"UPDATE_HANDLERS":return{...t,content:r.payload};case"SET_EDITING_HANDLER":{if(r.payload&&r.payload!==t.editing){const n=t.content.find(i=>i.id===t.editing);if(n&&!Object.values(B.omit(n,["id","verbs","asRegex","isExpanded"])).some(Boolean)&&n.verbs.length===0)return{...t,content:t.content.filter(d=>d.id!==n.id),editing:r.payload}}return{...t,editing:r.payload}}case"ADD_HANDLER":{const n=G.generate();return{...t,content:[...t.content,{...r.payload,id:n}],editing:n,newlyCreatedHandlerID:n}}case"UPDATE_HANDLER":return{...t,content:t.content.map(n=>n.id===r.id?{...n,...r.payload}:n),newlyCreatedHandlerID:null};case"DELETE_HANDLER":return{...t,content:t.content.filter(n=>n.id!==r.id)};case"TOGGLE_EXPANDED":return{...t,content:t.content.map(n=>n.id===r.id?{...n,isExpanded:!n.isExpanded}:n)};case"DUPLICATE_HANDLER":{const n=t.content.find(i=>i.id===r.id);return n?{...t,content:[...t.content,{...n,id:G.generate(),isExpanded:!0}]}:t}case"TOGGLE_ALL_EXPANDED":return{...t,content:t.content.map(n=>({...n,isExpanded:r.payload}))};case"SYNC_DATA":return{...t,content:r.payload.map(n=>{const i=t.content.find(d=>d.id===n.id);return i?{...n,...i}:n})};default:throw new Error("Unknown action type")}},re=({children:t,content:r})=>{const n={content:r,editing:null,newlyCreatedHandlerID:null},[i,d]=v.useReducer(ne,n);return v.useEffect(()=>{d({type:"SYNC_DATA",payload:r})},[r]),e.jsx(J.Provider,{value:{state:i,dispatch:d},children:t})},U=()=>{const t=v.useContext(J);if(!t)throw new Error("useHTTPHandlers must be used within a HandlerProvider");return t},ae=({initialSelectedItems:t,onChange:r,touched:n,onBlur:i})=>{const d=["GET","POST","PUT","DELETE"];function g(p,u){const w=u.toLowerCase();return d.filter(function(a){return!p.includes(a)&&a.toLowerCase().includes(w)})}const[f,m]=v.useState(""),[o,s]=v.useState(t);v.useEffect(()=>{s(t)},[t]);const l=v.useMemo(()=>g(o,f),[o,f]),{getSelectedItemProps:c,getDropdownProps:b,removeSelectedItem:N}=S.useMultipleSelection({selectedItems:o,onStateChange({selectedItems:p=[],type:u}){switch(u){case S.useMultipleSelection.stateChangeTypes.SelectedItemKeyDownBackspace:case S.useMultipleSelection.stateChangeTypes.SelectedItemKeyDownDelete:case S.useMultipleSelection.stateChangeTypes.DropdownKeyDownBackspace:case S.useMultipleSelection.stateChangeTypes.FunctionRemoveSelectedItem:s(p);break}}}),{isOpen:y,getToggleButtonProps:E,getMenuProps:I,getInputProps:D,highlightedIndex:P,getItemProps:R,selectedItem:k}=S.useCombobox({items:l,itemToString(p){return p||""},defaultHighlightedIndex:0,selectedItem:null,inputValue:f,stateReducer(p,u){const{changes:w,type:A}=u;switch(A){case S.useCombobox.stateChangeTypes.InputKeyDownEnter:case S.useCombobox.stateChangeTypes.ItemClick:return{...w,isOpen:!0,highlightedIndex:0};default:return w}},onStateChange({inputValue:p="",type:u,selectedItem:w}){switch(u){case S.useCombobox.stateChangeTypes.InputKeyDownEnter:case S.useCombobox.stateChangeTypes.ItemClick:case S.useCombobox.stateChangeTypes.InputBlur:w&&(s([...o,w]),m(""));break;case S.useCombobox.stateChangeTypes.InputChange:m(p);break}}});return v.useEffect(()=>{r(o)},[o]),e.jsxs("div",{className:"relative flex-1",children:[e.jsxs("div",{className:T("bg-grey-300 focus-within:ring-1 focus-within:ring-primary-dark relative flex items-center w-full cursor-default overflow-hidden rounded p-px text-left focus:outline-none",{"ring-1 ring-primary-dark rounded-b-none":y&&l.length,"ring-1 ring-red-400 overflow-visible":o.length===0&&n}),onBlur:i,children:[o.length===0&&!y&&n&&e.jsx("div",{className:"absolute inset-x-0 top-[25px] z-[1] rounded-b-sm bg-red-200 px-1 text-xs text-red-600 ring-1 ring-red-600",children:o.length===0&&"At least one HTTP verb is required"}),o.map(function(u,w){return e.jsxs("span",{className:T("bg-grey-600 text-s mr-1 flex items-center rounded px-1 py-0.5 uppercase",{"bg-red-400":!d.includes(u)}),...c({selectedItem:u,index:w}),children:[u,e.jsx("span",{onClick:A=>{A.stopPropagation(),N(u)},className:"hover:bg-primary-hover ml-2 inline-block cursor-pointer rounded p-0.5 text-gray-100 hover:text-white active:outline-none",children:e.jsx(x.FdCloseNaked,{})})]},`selected-item-${w}-${u}`)}),e.jsx("input",{...D(b({preventKeyAction:y},{suppressRefError:!0})),className:"flex-grow border-none bg-transparent px-1 py-1 text-xs outline-none",placeholder:o.length===0?"Select HTTP verbs":"",size:1}),e.jsx("button",{className:"absolute inset-y-0 right-0 flex items-center pr-2",type:"button",...E(),children:e.jsx(x.FdDown,{className:"h-3 w-3 text-gray-50","aria-hidden":"true"})})]}),e.jsx("ul",{className:`ring-primary-dark bg-grey-900 text-s absolute z-10 w-full rounded-b ring-1 p-1 text-white ${!(y&&l.length)&&"hidden"}`,...I(),children:y&&l.map((p,u)=>e.jsx("li",{className:T(P===u&&"bg-primary-hover",k===p&&"font-bold","flex flex-col p-1 shadow-sm"),...R({item:p,index:u}),children:e.jsx("span",{children:p})},`${p}${u}`))})]})},le=({value:t,options:r,errorMessage:n="",onChange:i,onBlur:d})=>{const[g,f]=v.useState(""),m=r.find(s=>s.name===t),o=g===""?r:r.filter(s=>s.name.toLowerCase().includes(g.toLowerCase()));return e.jsx(H.Combobox,{value:{name:t},onChange:s=>i(s.name),children:({open:s})=>e.jsxs("div",{className:"relative w-full",children:[e.jsxs("div",{className:T("bg-grey-300 focus-within:ring-1 focus-within:ring-primary-dark relative w-full cursor-default overflow-hidden rounded text-left inline-flex",{"ring-1 ring-red-400":!m&&t||n,"ring-1 ring-primary-dark rounded-b-none":s,"overflow-visible":!m&&!s&&n}),children:[e.jsx(H.Combobox.Input,{className:T("bg-grey-300 text-s w-full border-none py-1 px-2 focus:outline-none rounded",{"!text-red-400":!m}),displayValue:l=>l.name,onChange:l=>f(l.target.value),style:{caretColor:"white"},onBlur:d}),e.jsxs("span",{className:"inset-y-0 right-0 flex items-center gap-1 pr-2",children:[!m&&!s&&n&&e.jsx("div",{className:"absolute inset-x-0 top-[25px] z-[1] rounded-b-sm bg-red-200 px-1 text-xs text-red-600 ring-1 ring-red-600",children:n}),t?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>{f(""),i("")},children:e.jsx(x.FdCloseNaked,{className:"text-grey-50 h-3 w-3","aria-hidden":"true"})}),e.jsx("span",{className:"bg-grey-50 h-3 w-[1px] rounded-full"})]}):null,e.jsx(H.Combobox.Button,{children:e.jsx(x.FdDown,{className:"text-grey-50 h-3 w-3","aria-hidden":"true"})})]})]}),e.jsx(H.Transition,{as:v.Fragment,leave:"transition ease-in durati pb-0.5on-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>f(""),children:e.jsx(H.Combobox.Options,{className:"bg-grey-900 text-s text-grey-100 sm:text-s absolute z-50 max-h-60 w-full overflow-auto rounded-b ring-1 ring-primary-dark p-1 focus:outline-none",children:o.length===0?e.jsxs("div",{className:"text-s text-grey-200 relative cursor-default select-none px-0.5 py-0.5 ",children:[e.jsx(x.FdEmpty,{className:"inline h-4 w-4"})," Nothing found."]}):o.map((l,c)=>e.jsx(H.Combobox.Option,{className:({active:b})=>`relative cursor-default select-none ${b?"bg-primary-hover":""}`,value:l,children:({selected:b})=>e.jsx(e.Fragment,{children:e.jsx("span",{className:`block truncate p-2 py-1 ${b?"bg-primary-dark font-medium text-white":"font-normal"}`,children:l.name})})},c))})})]})},t)},ie=({value:t,options:r,onChange:n,errorMessage:i,onBlur:d})=>{const[g,f]=v.useState(""),m=r.find(l=>l.name===t),o=m&&m.exposed,s=g===""?r:r.filter(l=>l.name.toLowerCase().includes(g.toLowerCase()));return e.jsx(H.Combobox,{value:{name:t},onChange:l=>n(l.name),children:({open:l})=>e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:T("bg-grey-300 focus-within:ring-1 focus-within:ring-primary-dark relative w-full cursor-default overflow-hidden rounded text-left inline-flex",{"ring-1 ring-red-400":i,"ring-1 ring-yellow-500":o,"ring-1 ring-primary-dark rounded-b-none":l,"overflow-visible":!l&&i}),children:[e.jsx(H.Combobox.Input,{className:T("bg-grey-300 text-s w-full border-none py-1 px-2 focus:outline-none truncate rounded",{"!text-red-400":i,"!text-yellow-500":o}),style:{caretColor:"white"},displayValue:c=>c.name,onChange:c=>f(c.target.value),onBlur:d}),!l&&i&&e.jsx("div",{className:T("absolute inset-x-0 top-[25px] z-[1] rounded-b-sm bg-red-200 px-1 text-xs text-red-600 ring-1 ring-red-600",{"!text-yellow-500 ring-yellow-500 bg-white":o}),children:i}),e.jsxs("span",{className:"inset-y-0 right-0 flex items-center gap-1 pr-2",children:[t?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>{f(""),n("")},children:e.jsx(x.FdCloseNaked,{className:"text-grey-50 h-3 w-3","aria-hidden":"true"})}),e.jsx("span",{className:"bg-grey-50 h-3 w-[1px] rounded-full"})]}):null,e.jsx(H.Combobox.Button,{children:e.jsx(x.FdDown,{className:"text-grey-50 h-3 w-3","aria-hidden":"true"})})]})]}),e.jsx(H.Transition,{as:v.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>f(""),children:e.jsx(H.Combobox.Options,{className:"bg-grey-900 text-s text-grey-100 sm:text-s absolute z-50 max-h-60 w-full overflow-auto rounded-b ring-1 ring-primary-dark p-1 focus:outline-none",children:s.length?s.map((c,b)=>e.jsx(H.Combobox.Option,{className:({active:N})=>`relative cursor-default select-none ${N?"bg-primary-hover":""}`,value:c,children:({selected:N})=>e.jsx(e.Fragment,{children:e.jsxs("span",{className:`text-s flex items-center gap-2 truncate p-2 py-1 ${N?"bg-primary-dark font-medium text-white":"font-normal"}`,children:[c.exposed&&e.jsx(x.FdWarningDanger,{className:"text-yellow-500"}),e.jsx("span",{className:"flex-1 truncate",title:c.name,children:c.name})]})})},b)):e.jsxs("div",{className:"text-s text-grey-200 relative cursor-default select-none px-0.5 py-0.5",children:[e.jsx(x.FdEmpty,{className:"inline h-4 w-4"})," Nothing found."]})})})]})})},Q=({listeners:t,attributes:r})=>e.jsx("button",{...r,...t,children:e.jsx(x.FdDragHandle,{})}),X=t=>{var n;if(!t)return"";let r;V.prototype.max=8;try{r=(n=new V(t))==null?void 0:n.gen()}catch{r=""}return`Requests matching regex will be handled example: ${r}`},oe=({id:t,class:r,method:n,pattern:i,verbs:d,regexPattern:g,asRegex:f,listeners:m,attributes:o})=>{var A;const[s,l]=v.useState({className:r,method:n,pattern:i,verbs:d,asRegex:f,regexPattern:g}),c=C.useAppSelector(C.selectCatalog),b=Object.values((c==null?void 0:c.singletons)||{}),N=(A=b.find(a=>a.name===s.className))==null?void 0:A.methods.map(({name:a,exposed:h})=>({name:a,exposed:h})),{dispatch:y,state:{newlyCreatedHandlerID:E}}=U(),I=C.useAppDispatch();function D(){const{className:a,method:h,asRegex:F,regexPattern:$,pattern:z,verbs:M}=s;return!!(a&&h&&(F?$:!z.endsWith("/"))&&M.length)}function P(){if(D()){const{className:a,method:h,asRegex:F,regexPattern:$,pattern:z,verbs:M}=s;y({type:"UPDATE_HANDLER",id:t,payload:{class:a,method:h,verbs:M,asRegex:F,...F?{regexPattern:$}:{pattern:z}}}),y({type:"SET_EDITING_HANDLER",payload:null})}}const R=async()=>{const a={className:r,method:n,pattern:i,regexPattern:g,verbs:d},h=B.omit(s,["id","isExpanded"]);if(!D()){y({type:"DELETE_HANDLER",id:`${E}`}),y({type:"SET_EDITING_HANDLER",payload:null});return}if(!B.isEqual(a,h)){const{confirmed:F}=await I(C.openModal({title:"Cancel Changes",type:j.ModalType.CONFIRM,color:j.ModalColor.DANGER,message:"Are you sure you want to cancel changes made to this Handler?",icon:"FdWarningDanger"})).unwrap();if(F){E===t&&y({type:"DELETE_HANDLER",id:t}),y({type:"SET_EDITING_HANDLER",payload:null});return}}};j.useHotkeys("esc",()=>{setTimeout(()=>{R()},100)},[]),v.useEffect(()=>{O.subscribe(a=>{a===t&&P()})},[s,t]);const[k,p]=v.useState({className:!1,method:!1,pattern:!1,verbs:!1}),u=()=>{if(k.method&&!s.method)return"Method is required";if(N){const a=N==null?void 0:N.find(h=>h.name===s.method);if(s.method&&!a)return`The method "${s.method}" doesn't exist.`;if(a&&a.exposed)return`Method "${s.method}" is already exposed`}},w=()=>{if(k.pattern){if(s.asRegex&&!s.regexPattern)return"Pattern is required";if(!s.asRegex&&s.pattern.endsWith("/"))return'Pattern should not end with a "/"'}};return e.jsxs("div",{className:"flex items-center gap-2 rounded-b py-2",children:[e.jsxs("div",{className:"flex w-60 flex-shrink-0 items-center gap-1",children:[e.jsx(Q,{listeners:m,attributes:o},"grab-handle"),e.jsx(le,{value:s.className,onChange:a=>{l(h=>({...h,className:a}))},onBlur:()=>p(a=>({...a,className:!0})),options:b,errorMessage:k.className&&!s.className?"Class name is required":s.className!==""&&!b.find(a=>a.name===s.className)?`The singleton "${s.className}" doesn't exist.`:void 0},r)]}),e.jsx("div",{className:"w-60 flex-shrink-0",children:e.jsx(ie,{value:s.method,onChange:a=>{l(h=>({...h,method:a}))},options:N||[],errorMessage:u(),onBlur:()=>p(a=>({...a,method:!0}))})}),e.jsxs("div",{className:"relative w-60 flex-shrink-0 flex items-center gap-1 overflow-visible",children:[e.jsx(j.Tooltip,{label:s.asRegex?X(s.regexPattern):s.pattern&&!s.pattern.endsWith("/")?`Requests starting with /${s.pattern}/ will be handled`:"",children:e.jsxs("div",{className:"relative w-full",children:[!s.asRegex&&e.jsx("span",{className:"absolute text-s inset-y-0 left-1 flex items-center gap-2",children:"/"}),e.jsx("input",{type:"text",className:T("bg-grey-300 text-s block w-full rounded p-1 pl-3 focus:outline-none focus:ring-1 focus:ring-primary-dark",{"focus:ring-red-400 ring-1 ring-red-400":k.pattern&&s.asRegex&&!s.regexPattern}),value:s.asRegex?s.regexPattern:s.pattern,onChange:a=>{l(h=>({...h,[s.asRegex?"regexPattern":"pattern"]:a.target.value}))},onBlur:()=>p(a=>({...a,pattern:!0})),placeholder:s.asRegex?"Required":""}),w()&&e.jsx("div",{className:"absolute inset-x-0 top-[25px] z-[1] rounded-b-sm bg-red-200 px-1 text-xs text-red-600 ring-1 ring-red-600",children:w()})]})}),(f?g:i)&&e.jsx("button",{onClick:a=>{a.stopPropagation(),l(h=>({...h,[s.asRegex?"regexPattern":"pattern"]:""}))},className:"absolute inset-y-0 right-6 flex items-center gap-2 pr-2",children:e.jsx(x.FdCloseNaked,{className:"text-grey-200 h-3 w-3","aria-hidden":"true"})}),e.jsx(j.Tooltip,{label:s.asRegex?"Requests matching this regex will be handled. Check the match with the __[Match regex command](https://developer.4d.com/docs/commands/match-regex)__":`Prefixes are considered as regular expressions already containing starting and ending /
|
|
2
|
+
|
|
3
|
+
__[documentation](https://developer.qodly.com/docs/studio/httpHandlers)__`,children:e.jsx("span",{className:"rounded hover:bg-gray-400/30 w-6 h-6 flex items-center content-center justify-center",children:e.jsx(x.FdInfoCircle,{className:"inline h-4 w-4 text-gray-100"})})})]}),e.jsx("div",{className:"w-20 px-2 flex justify-center",children:e.jsx(j.ControlledSwitch,{value:!!s.asRegex,onChange:a=>{const h=a?{regexPattern:i,asRegex:a}:{pattern:g,asRegex:a};l(F=>({...F,...h}))},className:`${s.asRegex?"bg-primary-dark":"bg-grey-300"}
|
|
4
|
+
relative inline-flex h-5 w-8 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,children:e.jsx("span",{"aria-hidden":"true",className:`${s.asRegex?"translate-x-3":"translate-x-0"}
|
|
5
|
+
pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0 transition duration-200 ease-in-out`})})}),e.jsxs("div",{className:"flex flex-1 items-center",children:[e.jsx(ae,{initialSelectedItems:s.verbs||[],onChange:a=>{l(h=>({...h,verbs:a}))},touched:k.verbs,onBlur:()=>p(a=>({...a,verbs:!0}))}),e.jsxs("div",{className:"flex items-center gap-0.5 px-2",children:[e.jsx(j.Tooltip,{label:"Duplicate Handler",className:"px-1 py-3",children:e.jsx("button",{className:T("hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none opacity-50 cursor-not-allowed"),children:e.jsx(x.FdDuplicate,{})})}),e.jsx(j.Tooltip,{label:"Confirm Changes",className:"px-1 py-3",children:e.jsx("button",{className:T("hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",{"opacity-50 cursor-not-allowed":!D()}),onClick:P,children:e.jsx(x.FdCheckCircle,{})})}),e.jsx(j.Tooltip,{label:"Cancel Changes",className:"px-1 py-3",children:e.jsx("button",{className:"hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",onClick:R,children:e.jsx(x.FdClose,{})})})]})]})]})},W=({id:t,class:r,method:n,pattern:i,verbs:d,isExpanded:g,regexPattern:f,asRegex:m})=>{var A;const{attributes:o,listeners:s,setNodeRef:l,transform:c,transition:b}=q.useSortable({id:t}),N={transform:ee.CSS.Transform.toString(c),transition:b},{dispatch:y,state:{editing:E}}=U(),I=C.useAppDispatch(),D=m?f:i,P=C.useAppSelector(C.selectCatalog),R=Object.values((P==null?void 0:P.singletons)||{}),k=(A=R==null?void 0:R.find(a=>a.name===r))==null?void 0:A.methods.map(({name:a,exposed:h})=>({name:a,exposed:h})),p=R==null?void 0:R.find(a=>a.name===r),u=k==null?void 0:k.find(a=>a.name===n),w=u&&u.exposed;return e.jsx("div",{className:"odd:bg-grey-500",ref:l,style:N,children:E===t?e.jsx(oe,{id:t,class:r,method:n,pattern:i,verbs:d,isExpanded:g,regexPattern:f,asRegex:m,listeners:s,attributes:o}):e.jsxs("div",{className:"flex items-center gap-2 rounded-b py-2.5 text-grey-50",onDoubleClick:()=>{O.next(E),y({type:"SET_EDITING_HANDLER",payload:t})},children:[e.jsxs("div",{className:"flex w-60 flex-shrink-0 items-center gap-1 ",children:[e.jsx(Q,{listeners:s,attributes:o},"grab-handle"),e.jsx("div",{className:"text-s w-full",children:r?e.jsxs("div",{className:T("flex items-center gap-2",!p&&"text-red-400"),children:[!p&&e.jsx(j.Tooltip,{label:`The singleton "${r}" doesn't exist.`,className:"!bg-red-300 !text-red-400",children:e.jsx("span",{className:"rounded p-0.5 hover:bg-red-400/30 pt-0.5 h-5 w-5 flex justify-center content-center",children:e.jsx(x.FdWarningDanger,{className:"inline h-4 w-4 pb-0.5 text-red-400"})})})," ",r]}):e.jsx("span",{className:"text-grey-200 italic",children:"undefined"})})]}),e.jsx("div",{className:"w-60 flex-shrink-0 ",children:e.jsx("div",{className:"text-s w-full",children:n?e.jsxs("div",{className:T("flex items-center gap-2",!u&&"text-red-400",w&&"text-yellow-400"),children:[!u&&e.jsx(j.Tooltip,{label:`The method "${n}" doesn't exist.`,className:"!bg-red-300 !text-red-400",children:e.jsx("span",{className:"rounded p-0.5 hover:bg-red-400/30 pt-0.5 h-5 w-5 flex justify-center content-center",children:e.jsx(x.FdWarningDanger,{className:"inline h-4 w-4 pb-0.5 text-red-400"})})})," ",w&&e.jsx(j.Tooltip,{label:`Method "${n}" is already exposed`,className:"!bg-yellow-100 !text-yellow-500",children:e.jsx("span",{className:"rounded p-0.5 hover:bg-red-400/30 pt-0.5 h-5 w-5 flex justify-center content-center",children:e.jsx(x.FdWarningDanger,{className:"inline h-4 w-4 pb-0.5 text-yellow-500"})})})," ",n]}):e.jsx("span",{className:"text-grey-200 italic",children:"undefined"})})}),e.jsx("div",{className:"text-s relative w-60 flex-shrink-0 ",children:D?e.jsx(j.Tooltip,{label:m?X(D):`Requests starting with /${D}/ will be handled`,children:e.jsx("span",{children:D})}):e.jsx("span",{className:"text-grey-200 italic",children:"/"})}),e.jsx("div",{className:"px-5 w-20 flex justify-center text-grey-200",children:m?e.jsx(x.FdRegex,{}):e.jsx(x.FdUnRegex,{})}),e.jsxs("div",{className:"flex flex-1 items-center",children:[e.jsx("div",{className:"text-s w-full",children:d.length?d.join(","):e.jsx("span",{className:"text-grey-200 italic",children:"undefined"})}),e.jsxs("div",{className:"flex items-center gap-0.5 px-2",children:[e.jsx(j.Tooltip,{label:"Duplicate Handler",className:"px-1 py-3",children:e.jsx("button",{className:"hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",onClick:()=>y({type:"DUPLICATE_HANDLER",id:t}),children:e.jsx(x.FdDuplicate,{})})}),e.jsx(j.Tooltip,{label:"Edit Handler",className:"px-1 py-3",children:e.jsx("button",{className:"hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",onClick:()=>{O.next(E),y({type:"SET_EDITING_HANDLER",payload:t})},children:e.jsx(x.FdPen,{})})}),e.jsx(j.Tooltip,{label:"Delete Handler",className:"px-1 py-3",placement:"top-end",children:e.jsx("button",{className:"hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",onClick:async()=>{const{confirmed:a}=await I(C.openModal({title:"Delete Handler",type:j.ModalType.CONFIRM,color:j.ModalColor.DANGER,message:"Are you sure you want to remove this Handler?",icon:"FdWarningDanger"})).unwrap();a&&y({type:"DELETE_HANDLER",id:t})},children:e.jsx(x.FdTrash,{})})})]})]})]})})},de=L.z.object({class:L.z.string().optional(),method:L.z.string().optional(),verbs:L.z.string().optional(),id:L.z.string().optional(),pattern:L.z.string().optional(),regexPattern:L.z.string().optional()}),ce=L.z.array(de),xe=({path:t})=>{const r=C.useAppSelector(C.selectTabByPath(t)),{dispatch:n,state:{content:i,editing:d}}=U(),g=_.useSensors(_.useSensor(_.PointerSensor),_.useSensor(_.KeyboardSensor,{coordinateGetter:q.sortableKeyboardCoordinates})),[f,m]=v.useState(null),o=i.find(l=>l.id===f),s=C.useAppDispatch();return v.useEffect(()=>{const l=JSON.stringify(i.map(({isExpanded:b,asRegex:N,pattern:y,regexPattern:E,...I})=>{var P;const D=N?{regexPattern:E}:{pattern:y};return{...I,verbs:(P=I.verbs)==null?void 0:P.join(","),...D}}),null,2),c=typeof(r==null?void 0:r.content)=="string"?r.content:JSON.stringify(r==null?void 0:r.content,null,2);l!==c&&s(C.setContent({path:t,content:l}))},[i]),e.jsxs("div",{className:"bg-grey-700 flex h-full w-full flex-col text-white",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-black p-2",children:[r&&e.jsx(se,{label:"Switch to text Editor",Icon:x.FdCode,tab:r,editor:{config:{language:"json"},key:"editors:code"}}),e.jsxs("p",{className:"text-grey-100 text-s flex items-center gap-1",children:[e.jsx(x.FdInfoCircle,{className:"inline text-base text-white"})," HTTP handlers are evaluated in the order they are declared"]})]}),e.jsx("div",{className:"mt-1 flex flex-1 flex-col overflow-x-auto px-4",children:i.length?e.jsxs("div",{className:"flex h-full min-w-[1200px] flex-1 flex-col",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2 border-b",children:[e.jsx("div",{className:"w-60 flex-shrink-0 text-xs",children:e.jsx("span",{className:"pl-6",children:"Class"})}),e.jsx("div",{className:"w-60 flex-shrink-0 text-xs",children:"Method"}),e.jsx("div",{className:"w-60 flex-shrink-0 text-xs",children:"Pattern"}),e.jsx("div",{className:"w-20 px-2 text-center text-xs",children:"As Regex"}),e.jsxs("div",{className:"flex flex-1 items-center justify-between text-xs",children:[e.jsx("span",{children:"Verbs"}),e.jsx("div",{className:"flex items-center gap-2 text-2xl",children:e.jsx(j.Tooltip,{label:"Add a new HTTP Handler",children:e.jsx("button",{disabled:!!d,onClick:()=>{O.next(d),n({type:"ADD_HANDLER",payload:{class:"",isExpanded:!0,method:"",pattern:"",verbs:[],regexPattern:""}})},className:"hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none disabled:cursor-not-allowed disabled:opacity-30",children:e.jsx(x.FdPlus,{className:"h-5 w-5"})})})})]})]}),e.jsx("div",{className:"py-3",children:e.jsxs(_.DndContext,{sensors:g,collisionDetection:_.closestCenter,onDragStart:l=>{m(l.active.id)},onDragEnd:l=>{const{active:c,over:b}=l;if(m(null),!(!c||!b)&&c.id!==(b==null?void 0:b.id)){const N=i.map(E=>E.id).indexOf(c.id),y=i.map(E=>E.id).indexOf(b.id);n({type:"UPDATE_HANDLERS",payload:q.arrayMove(i,N,y)})}},children:[e.jsx(q.SortableContext,{items:i,strategy:q.verticalListSortingStrategy,children:i.map(({id:l,...c})=>e.jsx(W,{id:l,...c},l))}),e.jsx(_.DragOverlay,{children:f&&o?e.jsx("div",{className:"opacity-10",children:e.jsx(W,{...o})}):null})]})})]}):e.jsxs("div",{className:"mt-6",children:[e.jsx("div",{children:e.jsx(x.FdEmpty,{className:"text-grey-200 mx-auto h-9 w-9"})}),e.jsxs("div",{className:"text-s text-grey-200 mx-auto mt-3 max-w-sm text-center",children:["There are no http handlers configured yet ",e.jsx("br",{}),"Please add a new one to add a new one."]}),e.jsx("div",{className:"mt-3 flex items-center justify-center",children:e.jsxs("button",{onClick:()=>{O.next(d),n({type:"ADD_HANDLER",payload:{class:"",isExpanded:!0,method:"",pattern:"",verbs:[],regexPattern:""}})},className:"bg-primary-dark text-s rounded px-2 py-1 flex items-center gap-1",children:[e.jsx(x.FdPlus,{className:"inline text-white h-4 w-4"})," Add New Handler"]})})]})})]})},Y=({content:t,path:r})=>{const[n,i]=v.useState(null);function d(o){let s;try{s=JSON.parse(o)}catch{i("HTTP Handler JSON is invalid"),s=[]}return s}const g=typeof t=="string"?d(t):t;if(!ce.safeParse(g).success||n)throw new Error("Invalid JSON");const m=g.map(o=>{var l;const s=!!o.regexPattern;return{...o,id:o.id??G.generate(),verbs:(l=o.verbs)==null?void 0:l.split(",").map(c=>c.toLocaleUpperCase()).filter(Boolean),asRegex:s}});return e.jsx(Z.ChakraProvider,{theme:K.chakraTheme,children:e.jsx(re,{content:m,children:e.jsx(xe,{path:r})})})},ue=t=>e.jsx(C.ReduxProvider,{store:C.getStore(),children:e.jsx("div",{className:"h-screen bg-grey-900",children:e.jsx(Y,{path:j.HTTP_HANDLERS_TAB_PATH,...t})})});exports.HTTPHandlersEditor=Y;exports.Standalone=ue;
|
|
6
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/SwitchToEditorIcon.tsx","../src/Provider/index.tsx","../src/Handler/index.tsx","../src/Editor.tsx","../src/Standalone/index.tsx"],"sourcesContent":["import { IconType } from '@ws-ui/icons';\nimport { IEditor, ITab } from '@ws-ui/shared';\nimport { switchEditor, useAppDispatch } from '@ws-ui/store';\nimport { ToolbarIcon } from '@ws-ui/webform-editor';\nimport { FC } from 'react';\n\ninterface SwitchToEditorIconProps {\n label: string;\n Icon: IconType;\n tab: ITab;\n editor: IEditor;\n onBeforeClick?: () => void;\n}\n\nexport const SwitchToEditorIcon: FC<SwitchToEditorIconProps> = ({\n label,\n Icon,\n tab,\n editor,\n onBeforeClick,\n}) => {\n const dispatch = useAppDispatch();\n\n return (\n <ToolbarIcon\n label={label}\n Icon={Icon}\n as=\"button\"\n onClick={() => {\n onBeforeClick?.();\n dispatch(\n switchEditor({\n tab,\n editor,\n }),\n );\n }}\n />\n );\n};\n","import { omit } from 'lodash';\r\nimport {\r\n createContext,\r\n useReducer,\r\n useContext,\r\n ReactNode,\r\n useEffect,\r\n} from 'react';\r\nimport { Subject } from 'rxjs';\r\nimport { generate } from 'short-uuid';\r\n\r\n// Define types\r\nexport type HTTPVerb = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';\r\n\r\nexport type HTTPHandler = {\r\n id: string; // Unique identifier\r\n class: string;\r\n method: string;\r\n pattern: string;\r\n regexPattern: string;\r\n verbs: HTTPVerb[];\r\n isExpanded: boolean;\r\n asRegex?: boolean;\r\n};\r\n\r\ntype HandlerState = {\r\n content: HTTPHandler[];\r\n editing: string | null;\r\n newlyCreatedHandlerID: string | null;\r\n};\r\n\r\ntype HandlerContextType = {\r\n state: HandlerState;\r\n dispatch: React.Dispatch<HandlerAction>;\r\n};\r\n\r\n// Create Context\r\nconst HandlerContext = createContext<HandlerContextType | undefined>(undefined);\r\n\r\nexport const $handlerSubject = new Subject();\r\n\r\n// Define action types\r\ntype HandlerAction =\r\n | { type: 'ADD_HANDLER'; payload: Omit<HTTPHandler, 'id'> }\r\n | { type: 'UPDATE_HANDLER'; id: string; payload: Partial<HTTPHandler> }\r\n | { type: 'DELETE_HANDLER'; id: string }\r\n | { type: 'TOGGLE_EXPANDED'; id: string }\r\n | { type: 'DUPLICATE_HANDLER'; id: string }\r\n | { type: 'TOGGLE_ALL_EXPANDED'; payload: boolean }\r\n | { type: 'UPDATE_HANDLERS'; payload: HTTPHandler[] }\r\n | { type: 'SYNC_DATA'; payload: HTTPHandler[] }\r\n | { type: 'SET_EDITING_HANDLER'; payload: string | null };\r\n\r\n// Reducer function\r\nconst handlerReducer = (\r\n state: HandlerState,\r\n action: HandlerAction,\r\n): HandlerState => {\r\n switch (action.type) {\r\n case 'UPDATE_HANDLERS':\r\n return {\r\n ...state,\r\n content: action.payload,\r\n };\r\n case 'SET_EDITING_HANDLER': {\r\n // $handlerSubject.next(lastEditing.id);\r\n\r\n if (action.payload && action.payload !== state.editing) {\r\n const lastEditing = state.content.find(\r\n (item) => item.id === state.editing,\r\n );\r\n\r\n if (lastEditing) {\r\n const isEmpty =\r\n !Object.values(\r\n omit(lastEditing, ['id', 'verbs', 'asRegex', 'isExpanded']),\r\n ).some(Boolean) && lastEditing.verbs.length === 0;\r\n\r\n if (isEmpty) {\r\n return {\r\n ...state,\r\n content: state.content.filter((t) => t.id !== lastEditing.id),\r\n editing: action.payload,\r\n };\r\n }\r\n }\r\n }\r\n\r\n return {\r\n ...state,\r\n editing: action.payload,\r\n };\r\n }\r\n case 'ADD_HANDLER': {\r\n const id = generate();\r\n return {\r\n ...state,\r\n content: [...state.content, { ...action.payload, id }],\r\n editing: id,\r\n newlyCreatedHandlerID: id,\r\n };\r\n }\r\n case 'UPDATE_HANDLER':\r\n return {\r\n ...state,\r\n content: state.content.map((handler) =>\r\n handler.id === action.id\r\n ? { ...handler, ...action.payload }\r\n : handler,\r\n ),\r\n newlyCreatedHandlerID: null,\r\n };\r\n case 'DELETE_HANDLER':\r\n return {\r\n ...state,\r\n content: state.content.filter((handler) => handler.id !== action.id),\r\n };\r\n case 'TOGGLE_EXPANDED':\r\n return {\r\n ...state,\r\n content: state.content.map((handler) =>\r\n handler.id === action.id\r\n ? { ...handler, isExpanded: !handler.isExpanded }\r\n : handler,\r\n ),\r\n };\r\n\r\n case 'DUPLICATE_HANDLER': {\r\n const handlerToDuplicate = state.content.find(\r\n (handler) => handler.id === action.id,\r\n );\r\n\r\n if (!handlerToDuplicate) return state;\r\n return {\r\n ...state,\r\n content: [\r\n ...state.content,\r\n { ...handlerToDuplicate, id: generate(), isExpanded: true },\r\n ],\r\n };\r\n }\r\n case 'TOGGLE_ALL_EXPANDED':\r\n return {\r\n ...state,\r\n content: state.content.map((handler) => ({\r\n ...handler,\r\n isExpanded: action.payload,\r\n })),\r\n };\r\n case 'SYNC_DATA':\r\n return {\r\n ...state,\r\n content: action.payload.map((handler) => {\r\n const found = state.content.find((item) => item.id === handler.id);\r\n\r\n if (found) {\r\n return {\r\n ...handler,\r\n ...found,\r\n };\r\n }\r\n\r\n return handler;\r\n }),\r\n };\r\n default:\r\n throw new Error('Unknown action type');\r\n }\r\n};\r\n\r\ntype HandlerProviderProps = {\r\n children: ReactNode;\r\n content: HTTPHandler[];\r\n};\r\n\r\nexport const HandlerProvider: React.FC<HandlerProviderProps> = ({\r\n children,\r\n content,\r\n}) => {\r\n const initialState: HandlerState = {\r\n content,\r\n editing: null,\r\n newlyCreatedHandlerID: null,\r\n };\r\n const [state, dispatch] = useReducer(handlerReducer, initialState);\r\n\r\n useEffect(() => {\r\n dispatch({\r\n type: 'SYNC_DATA',\r\n payload: content,\r\n });\r\n }, [content]);\r\n\r\n return (\r\n <HandlerContext.Provider value={{ state, dispatch }}>\r\n {children}\r\n </HandlerContext.Provider>\r\n );\r\n};\r\n\r\n// Custom Hook to Use Handler Context\r\nexport const useHTTPHandlers = (): HandlerContextType => {\r\n const context = useContext(HandlerContext);\r\n if (!context) {\r\n throw new Error('useHTTPHandlers must be used within a HandlerProvider');\r\n }\r\n return context;\r\n};\r\n","import { useSortable } from '@dnd-kit/sortable';\r\nimport { CSS } from '@dnd-kit/utilities';\r\nimport { Combobox, Transition } from '@headlessui/react';\r\nimport {\r\n FdCheckCircle,\r\n FdClose,\r\n FdCloseNaked,\r\n FdDown,\r\n FdDragHandle,\r\n FdDuplicate,\r\n FdEmpty,\r\n FdInfoCircle,\r\n FdPen,\r\n FdRegex,\r\n FdTrash,\r\n FdUnRegex,\r\n FdWarningDanger,\r\n} from '@ws-ui/icons';\r\nimport {\r\n ControlledSwitch,\r\n ModalColor,\r\n ModalType,\r\n useHotkeys,\r\n Tooltip,\r\n} from '@ws-ui/shared';\r\nimport {\r\n openModal,\r\n selectCatalog,\r\n useAppDispatch,\r\n useAppSelector,\r\n} from '@ws-ui/store';\r\nimport cn from 'classnames';\r\nimport { useCombobox, useMultipleSelection } from 'downshift';\r\nimport { FC, Fragment, useEffect, useMemo, useState } from 'react';\r\nimport {\r\n $handlerSubject,\r\n HTTPHandler,\r\n HTTPVerb,\r\n useHTTPHandlers,\r\n} from '../Provider';\r\nimport { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';\r\nimport { DraggableAttributes } from '@dnd-kit/core';\r\nimport { omit, isEqual } from 'lodash';\r\nimport RandExp from 'randexp';\r\n\r\nconst MultipleComboBox: FC<{\r\n initialSelectedItems: HTTPVerb[];\r\n onChange: (val: HTTPVerb[]) => void;\r\n touched?: boolean;\r\n onBlur?: () => void;\r\n}> = ({ initialSelectedItems, onChange, touched, onBlur }) => {\r\n const verbs: HTTPVerb[] = ['GET', 'POST', 'PUT', 'DELETE'];\r\n\r\n function getFilteredverbs(selectedItems: string[], inputValue: string) {\r\n const lowerCasedInputValue = inputValue.toLowerCase();\r\n\r\n return verbs.filter(function filtermethod(method) {\r\n return (\r\n !selectedItems.includes(method) &&\r\n method.toLowerCase().includes(lowerCasedInputValue)\r\n );\r\n });\r\n }\r\n\r\n const [inputValue, setInputValue] = useState('');\r\n const [selectedItems, setSelectedItems] = useState(initialSelectedItems);\r\n\r\n useEffect(() => {\r\n setSelectedItems(initialSelectedItems);\r\n }, [initialSelectedItems]);\r\n\r\n const items: string[] = useMemo(\r\n () => getFilteredverbs(selectedItems, inputValue),\r\n [selectedItems, inputValue],\r\n );\r\n\r\n const { getSelectedItemProps, getDropdownProps, removeSelectedItem } =\r\n useMultipleSelection({\r\n selectedItems,\r\n onStateChange({ selectedItems: newSelectedItems = [], type }) {\r\n switch (type) {\r\n case useMultipleSelection.stateChangeTypes\r\n .SelectedItemKeyDownBackspace:\r\n case useMultipleSelection.stateChangeTypes.SelectedItemKeyDownDelete:\r\n case useMultipleSelection.stateChangeTypes.DropdownKeyDownBackspace:\r\n case useMultipleSelection.stateChangeTypes.FunctionRemoveSelectedItem:\r\n setSelectedItems(newSelectedItems);\r\n break;\r\n default:\r\n break;\r\n }\r\n },\r\n });\r\n\r\n const {\r\n isOpen,\r\n getToggleButtonProps,\r\n getMenuProps,\r\n getInputProps,\r\n highlightedIndex,\r\n getItemProps,\r\n selectedItem,\r\n } = useCombobox({\r\n items,\r\n itemToString(item) {\r\n return item ? item : '';\r\n },\r\n defaultHighlightedIndex: 0, // after selection, highlight the first item.\r\n selectedItem: null,\r\n inputValue,\r\n stateReducer(state, actionAndChanges) {\r\n const { changes, type } = actionAndChanges;\r\n\r\n switch (type) {\r\n case useCombobox.stateChangeTypes.InputKeyDownEnter:\r\n case useCombobox.stateChangeTypes.ItemClick:\r\n return {\r\n ...changes,\r\n isOpen: true, // keep the menu open after selection.\r\n highlightedIndex: 0, // with the first option highlighted.\r\n };\r\n default:\r\n return changes;\r\n }\r\n },\r\n onStateChange({\r\n inputValue: newInputValue = '',\r\n type,\r\n selectedItem: newSelectedItem,\r\n }) {\r\n switch (type) {\r\n case useCombobox.stateChangeTypes.InputKeyDownEnter:\r\n case useCombobox.stateChangeTypes.ItemClick:\r\n case useCombobox.stateChangeTypes.InputBlur:\r\n if (newSelectedItem) {\r\n setSelectedItems([...selectedItems, newSelectedItem as HTTPVerb]);\r\n setInputValue('');\r\n }\r\n break;\r\n\r\n case useCombobox.stateChangeTypes.InputChange:\r\n setInputValue(newInputValue);\r\n\r\n break;\r\n default:\r\n break;\r\n }\r\n },\r\n });\r\n\r\n useEffect(() => {\r\n onChange(selectedItems);\r\n }, [selectedItems]);\r\n\r\n return (\r\n <div className=\"relative flex-1\">\r\n <div\r\n className={cn(\r\n 'bg-grey-300 focus-within:ring-1 focus-within:ring-primary-dark relative flex items-center w-full cursor-default overflow-hidden rounded p-px text-left focus:outline-none',\r\n {\r\n 'ring-1 ring-primary-dark rounded-b-none': isOpen && items.length,\r\n 'ring-1 ring-red-400 overflow-visible':\r\n selectedItems.length === 0 && touched,\r\n },\r\n )}\r\n onBlur={onBlur}\r\n >\r\n {selectedItems.length === 0 && !isOpen && touched && (\r\n <div className=\"absolute inset-x-0 top-[25px] z-[1] rounded-b-sm bg-red-200 px-1 text-xs text-red-600 ring-1 ring-red-600\">\r\n {selectedItems.length === 0 && 'At least one HTTP verb is required'}\r\n </div>\r\n )}\r\n\r\n {selectedItems.map(\r\n function renderSelectedItem(selectedItemForRender, index) {\r\n return (\r\n <span\r\n className={cn(\r\n 'bg-grey-600 text-s mr-1 flex items-center rounded px-1 py-0.5 uppercase',\r\n {\r\n 'bg-red-400': !verbs.includes(selectedItemForRender),\r\n },\r\n )}\r\n key={`selected-item-${index}-${selectedItemForRender}`}\r\n {...getSelectedItemProps({\r\n selectedItem: selectedItemForRender,\r\n index,\r\n })}\r\n >\r\n {selectedItemForRender}\r\n\r\n <span\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n removeSelectedItem(selectedItemForRender);\r\n }}\r\n className=\"hover:bg-primary-hover ml-2 inline-block cursor-pointer rounded p-0.5 text-gray-100 hover:text-white active:outline-none\"\r\n >\r\n <FdCloseNaked />\r\n </span>\r\n </span>\r\n );\r\n },\r\n )}\r\n <input\r\n {...getInputProps(\r\n getDropdownProps(\r\n { preventKeyAction: isOpen },\r\n { suppressRefError: true },\r\n ),\r\n )}\r\n className=\"flex-grow border-none bg-transparent px-1 py-1 text-xs outline-none\"\r\n placeholder={selectedItems.length === 0 ? 'Select HTTP verbs' : ''}\r\n size={1}\r\n />\r\n <button\r\n className=\"absolute inset-y-0 right-0 flex items-center pr-2\"\r\n type=\"button\"\r\n {...getToggleButtonProps()}\r\n >\r\n <FdDown className=\"h-3 w-3 text-gray-50\" aria-hidden=\"true\" />\r\n </button>\r\n </div>\r\n <ul\r\n className={`ring-primary-dark bg-grey-900 text-s absolute z-10 w-full rounded-b ring-1 p-1 text-white ${\r\n !(isOpen && items.length) && 'hidden'\r\n }`}\r\n {...getMenuProps()}\r\n >\r\n {isOpen &&\r\n items.map((item, index) => (\r\n <li\r\n className={cn(\r\n highlightedIndex === index && 'bg-primary-hover',\r\n selectedItem === item && 'font-bold',\r\n 'flex flex-col p-1 shadow-sm',\r\n )}\r\n key={`${item}${index}`}\r\n {...getItemProps({ item, index })}\r\n >\r\n <span>{item}</span>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n );\r\n};\r\n\r\nconst Select = ({\r\n value,\r\n options,\r\n errorMessage = '',\r\n onChange,\r\n onBlur,\r\n}: {\r\n value: string;\r\n onChange: (val: string) => void;\r\n options: { name: string }[];\r\n errorMessage?: string;\r\n onBlur?: () => void;\r\n}) => {\r\n const [query, setQuery] = useState('');\r\n\r\n const notFound = options.find((item) => item.name === value);\r\n\r\n const filteredOptions =\r\n query === ''\r\n ? options\r\n : options.filter((sgltn) => {\r\n return sgltn.name.toLowerCase().includes(query.toLowerCase());\r\n });\r\n\r\n return (\r\n <Combobox\r\n key={value}\r\n value={{ name: value }}\r\n onChange={(s) => onChange(s.name)}\r\n >\r\n {({ open }) => (\r\n <div className=\"relative w-full\">\r\n <div\r\n className={cn(\r\n 'bg-grey-300 focus-within:ring-1 focus-within:ring-primary-dark relative w-full cursor-default overflow-hidden rounded text-left inline-flex',\r\n {\r\n 'ring-1 ring-red-400': (!notFound && value) || errorMessage,\r\n 'ring-1 ring-primary-dark rounded-b-none': open,\r\n 'overflow-visible': !notFound && !open && errorMessage,\r\n },\r\n )}\r\n >\r\n <Combobox.Input\r\n className={cn(\r\n 'bg-grey-300 text-s w-full border-none py-1 px-2 focus:outline-none rounded',\r\n {\r\n '!text-red-400': !notFound,\r\n },\r\n )}\r\n displayValue={(sngltn: { name: string }) => sngltn.name}\r\n onChange={(event) => setQuery(event.target.value)}\r\n style={{ caretColor: 'white' }}\r\n onBlur={onBlur}\r\n />\r\n <span className=\"inset-y-0 right-0 flex items-center gap-1 pr-2\">\r\n {!notFound && !open && errorMessage && (\r\n <div className=\"absolute inset-x-0 top-[25px] z-[1] rounded-b-sm bg-red-200 px-1 text-xs text-red-600 ring-1 ring-red-600\">\r\n {errorMessage}\r\n </div>\r\n )}\r\n\r\n {value ? (\r\n <>\r\n <button\r\n onClick={() => {\r\n setQuery('');\r\n onChange('');\r\n }}\r\n >\r\n <FdCloseNaked\r\n className=\"text-grey-50 h-3 w-3\"\r\n aria-hidden=\"true\"\r\n />\r\n </button>\r\n <span className=\"bg-grey-50 h-3 w-[1px] rounded-full\"></span>\r\n </>\r\n ) : null}\r\n <Combobox.Button>\r\n <FdDown className=\"text-grey-50 h-3 w-3\" aria-hidden=\"true\" />\r\n </Combobox.Button>\r\n </span>\r\n </div>\r\n\r\n <Transition\r\n as={Fragment}\r\n leave=\"transition ease-in durati pb-0.5on-100\"\r\n leaveFrom=\"opacity-100\"\r\n leaveTo=\"opacity-0\"\r\n afterLeave={() => setQuery('')}\r\n >\r\n <Combobox.Options className=\"bg-grey-900 text-s text-grey-100 sm:text-s absolute z-50 max-h-60 w-full overflow-auto rounded-b ring-1 ring-primary-dark p-1 focus:outline-none\">\r\n {filteredOptions.length === 0 ? (\r\n <div className=\"text-s text-grey-200 relative cursor-default select-none px-0.5 py-0.5 \">\r\n <FdEmpty className=\"inline h-4 w-4\" /> Nothing found.\r\n </div>\r\n ) : (\r\n filteredOptions.map((option, index) => (\r\n <Combobox.Option\r\n key={index}\r\n className={({ active }) =>\r\n `relative cursor-default select-none ${\r\n active ? 'bg-primary-hover' : ''\r\n }`\r\n }\r\n value={option}\r\n >\r\n {({ selected }) => (\r\n <>\r\n <span\r\n className={`block truncate p-2 py-1 ${\r\n selected\r\n ? 'bg-primary-dark font-medium text-white'\r\n : 'font-normal'\r\n }`}\r\n >\r\n {option.name}\r\n </span>\r\n </>\r\n )}\r\n </Combobox.Option>\r\n ))\r\n )}\r\n </Combobox.Options>\r\n </Transition>\r\n </div>\r\n )}\r\n </Combobox>\r\n );\r\n};\r\n\r\nconst MethodSelector = ({\r\n value,\r\n options,\r\n onChange,\r\n errorMessage,\r\n onBlur,\r\n}: {\r\n value: string;\r\n onChange: (val: string) => void;\r\n options: { name: string; exposed: boolean }[];\r\n errorMessage?: string;\r\n onBlur?: () => void;\r\n}) => {\r\n const [query, setQuery] = useState('');\r\n\r\n const found = options.find((item) => item.name === value);\r\n\r\n const exposed = found && found.exposed;\r\n\r\n const filteredOptions =\r\n query === ''\r\n ? options\r\n : options.filter((sgltn) => {\r\n return sgltn.name.toLowerCase().includes(query.toLowerCase());\r\n });\r\n\r\n return (\r\n <Combobox value={{ name: value }} onChange={(val) => onChange(val.name)}>\r\n {({ open }) => (\r\n <div className=\"relative\">\r\n <div\r\n className={cn(\r\n 'bg-grey-300 focus-within:ring-1 focus-within:ring-primary-dark relative w-full cursor-default overflow-hidden rounded text-left inline-flex',\r\n {\r\n 'ring-1 ring-red-400': errorMessage,\r\n 'ring-1 ring-yellow-500': exposed,\r\n 'ring-1 ring-primary-dark rounded-b-none': open,\r\n 'overflow-visible': !open && errorMessage,\r\n },\r\n )}\r\n >\r\n <Combobox.Input\r\n className={cn(\r\n 'bg-grey-300 text-s w-full border-none py-1 px-2 focus:outline-none truncate rounded',\r\n {\r\n '!text-red-400': errorMessage,\r\n '!text-yellow-500': exposed,\r\n },\r\n )}\r\n style={{ caretColor: 'white' }}\r\n displayValue={(sngltn: { name: string }) => sngltn.name}\r\n onChange={(event) => setQuery(event.target.value)}\r\n onBlur={onBlur}\r\n />\r\n {!open && errorMessage && (\r\n <div\r\n className={cn(\r\n 'absolute inset-x-0 top-[25px] z-[1] rounded-b-sm bg-red-200 px-1 text-xs text-red-600 ring-1 ring-red-600',\r\n { '!text-yellow-500 ring-yellow-500 bg-white': exposed },\r\n )}\r\n >\r\n {errorMessage}\r\n </div>\r\n )}\r\n <span className=\"inset-y-0 right-0 flex items-center gap-1 pr-2\">\r\n {value ? (\r\n <>\r\n <button\r\n onClick={() => {\r\n setQuery('');\r\n onChange('');\r\n }}\r\n >\r\n <FdCloseNaked\r\n className=\"text-grey-50 h-3 w-3\"\r\n aria-hidden=\"true\"\r\n />\r\n </button>\r\n <span className=\"bg-grey-50 h-3 w-[1px] rounded-full\"></span>\r\n </>\r\n ) : null}\r\n <Combobox.Button>\r\n <FdDown className=\"text-grey-50 h-3 w-3\" aria-hidden=\"true\" />\r\n </Combobox.Button>\r\n </span>\r\n </div>\r\n\r\n <Transition\r\n as={Fragment}\r\n leave=\"transition ease-in duration-100\"\r\n leaveFrom=\"opacity-100\"\r\n leaveTo=\"opacity-0\"\r\n afterLeave={() => setQuery('')}\r\n >\r\n <Combobox.Options className=\"bg-grey-900 text-s text-grey-100 sm:text-s absolute z-50 max-h-60 w-full overflow-auto rounded-b ring-1 ring-primary-dark p-1 focus:outline-none\">\r\n {!filteredOptions.length ? (\r\n <div className=\"text-s text-grey-200 relative cursor-default select-none px-0.5 py-0.5\">\r\n <FdEmpty className=\"inline h-4 w-4\" /> Nothing found.\r\n </div>\r\n ) : (\r\n filteredOptions.map((option, index) => (\r\n <Combobox.Option\r\n key={index}\r\n className={({ active }) =>\r\n `relative cursor-default select-none ${\r\n active ? 'bg-primary-hover' : ''\r\n }`\r\n }\r\n value={option}\r\n >\r\n {({ selected }) => (\r\n <>\r\n <span\r\n className={`text-s flex items-center gap-2 truncate p-2 py-1 ${\r\n selected\r\n ? 'bg-primary-dark font-medium text-white'\r\n : 'font-normal'\r\n }`}\r\n >\r\n {option.exposed && (\r\n <FdWarningDanger className=\"text-yellow-500\" />\r\n )}\r\n <span className=\"flex-1 truncate\" title={option.name}>\r\n {option.name}\r\n </span>\r\n </span>\r\n </>\r\n )}\r\n </Combobox.Option>\r\n ))\r\n )}\r\n </Combobox.Options>\r\n </Transition>\r\n </div>\r\n )}\r\n </Combobox>\r\n );\r\n};\r\n\r\nconst GrabHandle: FC<{\r\n attributes: DraggableAttributes;\r\n listeners: SyntheticListenerMap | undefined;\r\n}> = ({ listeners, attributes }) => {\r\n return (\r\n <button {...attributes} {...listeners}>\r\n <FdDragHandle />\r\n </button>\r\n );\r\n};\r\n\r\nconst generateRegexExample = (regex: string) => {\r\n if (!regex) return '';\r\n let regexExample;\r\n RandExp.prototype.max = 8;\r\n try {\r\n regexExample = new RandExp(regex)?.gen();\r\n } catch {\r\n regexExample = '';\r\n }\r\n return `Requests matching regex will be handled example: ${regexExample}`;\r\n};\r\n\r\nconst HandlerEdit: FC<\r\n HTTPHandler & {\r\n attributes: DraggableAttributes;\r\n listeners: SyntheticListenerMap | undefined;\r\n }\r\n> = ({\r\n id,\r\n class: className,\r\n method,\r\n pattern,\r\n verbs,\r\n regexPattern,\r\n asRegex,\r\n listeners,\r\n attributes,\r\n}) => {\r\n const [handler, setHandler] = useState({\r\n className,\r\n method,\r\n pattern,\r\n verbs,\r\n asRegex,\r\n regexPattern,\r\n });\r\n\r\n const catalog = useAppSelector(selectCatalog);\r\n\r\n const singletons = Object.values(catalog?.singletons || {});\r\n\r\n const singletonMethods = singletons\r\n .find((item) => item.name === handler.className)\r\n ?.methods.map(({ name, exposed }) => ({ name, exposed }));\r\n\r\n const {\r\n dispatch,\r\n state: { newlyCreatedHandlerID },\r\n } = useHTTPHandlers();\r\n\r\n const appDispatch = useAppDispatch();\r\n\r\n function isValid() {\r\n const { className, method, asRegex, regexPattern, pattern, verbs } =\r\n handler;\r\n return !!(\r\n className &&\r\n method &&\r\n (asRegex ? regexPattern : !pattern.endsWith('/')) &&\r\n verbs.length\r\n );\r\n }\r\n\r\n function onConfirm() {\r\n if (isValid()) {\r\n const { className, method, asRegex, regexPattern, pattern, verbs } =\r\n handler;\r\n const rest = asRegex ? { regexPattern } : { pattern };\r\n dispatch({\r\n type: 'UPDATE_HANDLER',\r\n id,\r\n payload: {\r\n class: className,\r\n method,\r\n verbs,\r\n asRegex,\r\n ...rest,\r\n },\r\n });\r\n\r\n dispatch({ type: 'SET_EDITING_HANDLER', payload: null });\r\n }\r\n }\r\n\r\n const onCancel = async () => {\r\n const oldHandler = {\r\n className,\r\n method,\r\n pattern,\r\n regexPattern,\r\n verbs,\r\n };\r\n\r\n const newHandler = omit(handler, ['id', 'isExpanded']);\r\n if (!isValid()) {\r\n dispatch({ type: 'DELETE_HANDLER', id: `${newlyCreatedHandlerID}` });\r\n dispatch({ type: 'SET_EDITING_HANDLER', payload: null });\r\n return;\r\n }\r\n\r\n if (!isEqual(oldHandler, newHandler)) {\r\n const { confirmed } = await appDispatch(\r\n openModal({\r\n title: 'Cancel Changes',\r\n type: ModalType.CONFIRM,\r\n color: ModalColor.DANGER,\r\n message:\r\n 'Are you sure you want to cancel changes made to this Handler?',\r\n icon: 'FdWarningDanger',\r\n }),\r\n ).unwrap();\r\n\r\n if (confirmed) {\r\n if (newlyCreatedHandlerID === id) {\r\n dispatch({ type: 'DELETE_HANDLER', id });\r\n }\r\n\r\n dispatch({ type: 'SET_EDITING_HANDLER', payload: null });\r\n\r\n return;\r\n }\r\n }\r\n };\r\n\r\n useHotkeys(\r\n 'esc',\r\n () => {\r\n setTimeout(() => {\r\n onCancel();\r\n }, 100);\r\n },\r\n [],\r\n );\r\n\r\n useEffect(() => {\r\n $handlerSubject.subscribe((lastEditingID) => {\r\n if (lastEditingID === id) {\r\n onConfirm();\r\n }\r\n });\r\n }, [handler, id]);\r\n const [touchedFields, setTouchedFields] = useState<{\r\n [key: string]: boolean;\r\n }>({ className: false, method: false, pattern: false, verbs: false });\r\n\r\n const methodErrors = () => {\r\n if (touchedFields.method && !handler.method) {\r\n return 'Method is required';\r\n }\r\n if (singletonMethods) {\r\n const found = singletonMethods?.find(\r\n (item) => item.name === handler.method,\r\n );\r\n if (handler.method && !found)\r\n return `The method \"${handler.method}\" doesn't exist.`;\r\n if (found && found.exposed)\r\n return `Method \"${handler.method}\" is already exposed`;\r\n }\r\n };\r\n const patternErrors = () => {\r\n if (touchedFields.pattern) {\r\n if (handler.asRegex && !handler.regexPattern) {\r\n return 'Pattern is required';\r\n }\r\n if (!handler.asRegex && handler.pattern.endsWith('/')) {\r\n return 'Pattern should not end with a \"/\"';\r\n }\r\n }\r\n return undefined;\r\n };\r\n\r\n return (\r\n <div className=\"flex items-center gap-2 rounded-b py-2\">\r\n <div className=\"flex w-60 flex-shrink-0 items-center gap-1\">\r\n <GrabHandle\r\n key=\"grab-handle\"\r\n listeners={listeners}\r\n attributes={attributes}\r\n />\r\n <Select\r\n value={handler.className}\r\n onChange={(val) => {\r\n setHandler((state) => ({ ...state, className: val }));\r\n }}\r\n onBlur={() =>\r\n setTouchedFields((state) => ({ ...state, className: true }))\r\n }\r\n key={className}\r\n options={singletons}\r\n errorMessage={\r\n touchedFields.className && !handler.className\r\n ? 'Class name is required'\r\n : handler.className !== '' &&\r\n !singletons.find((item) => item.name === handler.className)\r\n ? `The singleton \"${handler.className}\" doesn't exist.`\r\n : undefined\r\n }\r\n />\r\n </div>\r\n <div className=\"w-60 flex-shrink-0\">\r\n <MethodSelector\r\n value={handler.method}\r\n onChange={(val) => {\r\n setHandler((state) => ({ ...state, method: val }));\r\n }}\r\n options={singletonMethods || []}\r\n errorMessage={methodErrors()}\r\n onBlur={() =>\r\n setTouchedFields((state) => ({ ...state, method: true }))\r\n }\r\n />\r\n </div>\r\n\r\n <div className=\"relative w-60 flex-shrink-0 flex items-center gap-1 overflow-visible\">\r\n <Tooltip\r\n label={\r\n handler.asRegex\r\n ? generateRegexExample(handler.regexPattern)\r\n : handler.pattern && !handler.pattern.endsWith('/')\r\n ? `Requests starting with /${handler.pattern}/ will be handled`\r\n : ''\r\n }\r\n >\r\n <div className=\"relative w-full\">\r\n {!handler.asRegex && (\r\n <span className=\"absolute text-s inset-y-0 left-1 flex items-center gap-2\">\r\n /\r\n </span>\r\n )}\r\n <input\r\n type=\"text\"\r\n className={cn(\r\n 'bg-grey-300 text-s block w-full rounded p-1 pl-3 focus:outline-none focus:ring-1 focus:ring-primary-dark',\r\n {\r\n 'focus:ring-red-400 ring-1 ring-red-400':\r\n touchedFields.pattern &&\r\n handler.asRegex &&\r\n !handler['regexPattern'],\r\n },\r\n )}\r\n value={handler.asRegex ? handler.regexPattern : handler.pattern}\r\n onChange={(e) => {\r\n setHandler((state) => ({\r\n ...state,\r\n [handler.asRegex ? 'regexPattern' : 'pattern']:\r\n e.target.value,\r\n }));\r\n }}\r\n onBlur={() =>\r\n setTouchedFields((state) => ({ ...state, pattern: true }))\r\n }\r\n placeholder={handler.asRegex ? 'Required' : ''}\r\n />\r\n {patternErrors() && (\r\n <div className=\"absolute inset-x-0 top-[25px] z-[1] rounded-b-sm bg-red-200 px-1 text-xs text-red-600 ring-1 ring-red-600\">\r\n {patternErrors()}\r\n </div>\r\n )}\r\n </div>\r\n </Tooltip>\r\n {(asRegex ? regexPattern : pattern) && (\r\n <button\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n\r\n setHandler((state) => ({\r\n ...state,\r\n [handler.asRegex ? 'regexPattern' : 'pattern']: '',\r\n }));\r\n }}\r\n className=\"absolute inset-y-0 right-6 flex items-center gap-2 pr-2\"\r\n >\r\n <FdCloseNaked\r\n className=\"text-grey-200 h-3 w-3\"\r\n aria-hidden=\"true\"\r\n />\r\n </button>\r\n )}\r\n <Tooltip\r\n label={\r\n handler.asRegex\r\n ? `Requests matching this regex will be handled. Check the match with the __[Match regex command](https://developer.4d.com/docs/commands/match-regex)__`\r\n : `Prefixes are considered as regular expressions already containing starting and ending / \\n\\n __[documentation](https://developer.qodly.com/docs/studio/httpHandlers)__`\r\n }\r\n >\r\n <span className=\"rounded hover:bg-gray-400/30 w-6 h-6 flex items-center content-center justify-center\">\r\n <FdInfoCircle className=\"inline h-4 w-4 text-gray-100\" />\r\n </span>\r\n </Tooltip>\r\n </div>\r\n\r\n <div className=\"w-20 px-2 flex justify-center\">\r\n <ControlledSwitch\r\n value={!!handler.asRegex}\r\n onChange={(value) => {\r\n const rest = value\r\n ? { regexPattern: pattern, asRegex: value }\r\n : { pattern: regexPattern, asRegex: value };\r\n\r\n setHandler((state) => ({ ...state, ...rest }));\r\n\r\n // dispatch({\r\n // type: 'UPDATE_HANDLER',\r\n // payload: { asRegex: value },\r\n // id,\r\n // });\r\n }}\r\n className={`${handler.asRegex ? 'bg-primary-dark' : 'bg-grey-300'}\r\nrelative inline-flex h-5 w-8 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`}\r\n >\r\n <span\r\n aria-hidden=\"true\"\r\n className={`${handler.asRegex ? 'translate-x-3' : 'translate-x-0'}\r\npointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0 transition duration-200 ease-in-out`}\r\n />\r\n </ControlledSwitch>\r\n </div>\r\n <div className=\"flex flex-1 items-center\">\r\n <MultipleComboBox\r\n initialSelectedItems={handler.verbs || []}\r\n onChange={(val) => {\r\n setHandler((state) => ({ ...state, verbs: val }));\r\n }}\r\n touched={touchedFields.verbs}\r\n onBlur={() =>\r\n setTouchedFields((state) => ({ ...state, verbs: true }))\r\n }\r\n />\r\n <div className=\"flex items-center gap-0.5 px-2\">\r\n <Tooltip label=\"Duplicate Handler\" className=\"px-1 py-3\">\r\n <button\r\n className={cn(\r\n 'hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none opacity-50 cursor-not-allowed',\r\n )}\r\n >\r\n <FdDuplicate />\r\n </button>\r\n </Tooltip>\r\n <Tooltip label=\"Confirm Changes\" className=\"px-1 py-3\">\r\n <button\r\n className={cn(\r\n 'hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none',\r\n {\r\n 'opacity-50 cursor-not-allowed': !isValid(),\r\n },\r\n )}\r\n onClick={onConfirm}\r\n >\r\n <FdCheckCircle />\r\n </button>\r\n </Tooltip>\r\n <Tooltip label=\"Cancel Changes\" className=\"px-1 py-3\">\r\n <button\r\n className=\"hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none\"\r\n onClick={onCancel}\r\n >\r\n <FdClose />\r\n </button>\r\n </Tooltip>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport const Handler: FC<HTTPHandler> = ({\r\n id,\r\n class: className,\r\n method,\r\n pattern,\r\n verbs,\r\n isExpanded,\r\n regexPattern,\r\n asRegex,\r\n}) => {\r\n const { attributes, listeners, setNodeRef, transform, transition } =\r\n useSortable({ id: id });\r\n\r\n const style = {\r\n transform: CSS.Transform.toString(transform),\r\n transition,\r\n };\r\n\r\n const {\r\n dispatch,\r\n state: { editing },\r\n } = useHTTPHandlers();\r\n\r\n const appDispatch = useAppDispatch();\r\n\r\n const patternValue = asRegex ? regexPattern : pattern;\r\n\r\n const catalog = useAppSelector(selectCatalog);\r\n\r\n const singletons = Object.values(catalog?.singletons || {});\r\n\r\n const singletonMethods = singletons\r\n ?.find((item) => item.name === className)\r\n ?.methods.map(({ name, exposed }) => ({ name, exposed }));\r\n\r\n const notFoundSingltonError = singletons?.find(\r\n (item) => item.name === className,\r\n );\r\n\r\n const found = singletonMethods?.find((item) => item.name === method);\r\n\r\n const exposedError = found && found.exposed;\r\n\r\n return (\r\n <div className=\"odd:bg-grey-500\" ref={setNodeRef} style={style}>\r\n {editing === id ? (\r\n <HandlerEdit\r\n {...{\r\n id,\r\n class: className,\r\n method,\r\n pattern,\r\n verbs,\r\n isExpanded,\r\n regexPattern,\r\n asRegex,\r\n listeners,\r\n attributes,\r\n }}\r\n />\r\n ) : (\r\n <div\r\n className=\"flex items-center gap-2 rounded-b py-2.5 text-grey-50\"\r\n onDoubleClick={() => {\r\n $handlerSubject.next(editing);\r\n dispatch({ type: 'SET_EDITING_HANDLER', payload: id });\r\n }}\r\n >\r\n <div className=\"flex w-60 flex-shrink-0 items-center gap-1 \">\r\n <GrabHandle\r\n key=\"grab-handle\"\r\n listeners={listeners}\r\n attributes={attributes}\r\n />\r\n\r\n <div className=\"text-s w-full\">\r\n {className ? (\r\n <div\r\n className={cn(\r\n 'flex items-center gap-2',\r\n !notFoundSingltonError && 'text-red-400',\r\n )}\r\n >\r\n {!notFoundSingltonError && (\r\n <Tooltip\r\n label={`The singleton \"${className}\" doesn't exist.`}\r\n className=\"!bg-red-300 !text-red-400\"\r\n >\r\n <span className=\"rounded p-0.5 hover:bg-red-400/30 pt-0.5 h-5 w-5 flex justify-center content-center\">\r\n <FdWarningDanger className=\"inline h-4 w-4 pb-0.5 text-red-400\" />\r\n </span>\r\n </Tooltip>\r\n )}{' '}\r\n {className}\r\n </div>\r\n ) : (\r\n <span className=\"text-grey-200 italic\">undefined</span>\r\n )}\r\n </div>\r\n </div>\r\n <div className=\"w-60 flex-shrink-0 \">\r\n <div className=\"text-s w-full\">\r\n {method ? (\r\n <div\r\n className={cn(\r\n 'flex items-center gap-2',\r\n !found && 'text-red-400',\r\n exposedError && 'text-yellow-400',\r\n )}\r\n >\r\n {!found && (\r\n <Tooltip\r\n label={`The method \"${method}\" doesn't exist.`}\r\n className=\"!bg-red-300 !text-red-400\"\r\n >\r\n <span className=\"rounded p-0.5 hover:bg-red-400/30 pt-0.5 h-5 w-5 flex justify-center content-center\">\r\n <FdWarningDanger className=\"inline h-4 w-4 pb-0.5 text-red-400\" />\r\n </span>\r\n </Tooltip>\r\n )}{' '}\r\n {exposedError && (\r\n <Tooltip\r\n label={`Method \"${method}\" is already exposed`}\r\n className=\"!bg-yellow-100 !text-yellow-500\"\r\n >\r\n <span className=\"rounded p-0.5 hover:bg-red-400/30 pt-0.5 h-5 w-5 flex justify-center content-center\">\r\n <FdWarningDanger className=\"inline h-4 w-4 pb-0.5 text-yellow-500\" />\r\n </span>\r\n </Tooltip>\r\n )}{' '}\r\n {method}\r\n </div>\r\n ) : (\r\n <span className=\"text-grey-200 italic\">undefined</span>\r\n )}\r\n </div>\r\n </div>\r\n\r\n <div className=\"text-s relative w-60 flex-shrink-0 \">\r\n {patternValue ? (\r\n <Tooltip\r\n label={\r\n asRegex\r\n ? generateRegexExample(patternValue)\r\n : `Requests starting with /${patternValue}/ will be handled`\r\n }\r\n >\r\n <span>{patternValue}</span>\r\n </Tooltip>\r\n ) : (\r\n <span className=\"text-grey-200 italic\">/</span>\r\n )}\r\n </div>\r\n\r\n <div className=\"px-5 w-20 flex justify-center text-grey-200\">\r\n {asRegex ? <FdRegex /> : <FdUnRegex />}\r\n </div>\r\n <div className=\"flex flex-1 items-center\">\r\n <div className=\"text-s w-full\">\r\n {verbs.length ? (\r\n verbs.join(',')\r\n ) : (\r\n <span className=\"text-grey-200 italic\">undefined</span>\r\n )}\r\n </div>\r\n\r\n <div className=\"flex items-center gap-0.5 px-2\">\r\n <Tooltip label=\"Duplicate Handler\" className=\"px-1 py-3\">\r\n <button\r\n className=\"hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none\"\r\n onClick={() => dispatch({ type: 'DUPLICATE_HANDLER', id })}\r\n >\r\n <FdDuplicate />\r\n </button>\r\n </Tooltip>\r\n <Tooltip label=\"Edit Handler\" className=\"px-1 py-3\">\r\n <button\r\n className=\"hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none\"\r\n onClick={() => {\r\n $handlerSubject.next(editing);\r\n dispatch({ type: 'SET_EDITING_HANDLER', payload: id });\r\n }}\r\n >\r\n <FdPen />\r\n </button>\r\n </Tooltip>\r\n <Tooltip label=\"Delete Handler\" className=\"px-1 py-3\" placement=\"top-end\">\r\n <button\r\n className=\"hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none\"\r\n onClick={async () => {\r\n const { confirmed } = await appDispatch(\r\n openModal({\r\n title: 'Delete Handler',\r\n type: ModalType.CONFIRM,\r\n color: ModalColor.DANGER,\r\n message:\r\n 'Are you sure you want to remove this Handler?',\r\n icon: 'FdWarningDanger',\r\n }),\r\n ).unwrap();\r\n if (confirmed) {\r\n dispatch({ type: 'DELETE_HANDLER', id });\r\n }\r\n }}\r\n >\r\n <FdTrash />\r\n </button>\r\n </Tooltip>\r\n </div>\r\n </div>\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\n","import { ChakraProvider } from '@chakra-ui/react';\nimport {\n closestCenter,\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport {\n arrayMove,\n SortableContext,\n sortableKeyboardCoordinates,\n verticalListSortingStrategy,\n} from '@dnd-kit/sortable';\nimport { FdCode, FdEmpty, FdInfoCircle, FdPlus } from '@ws-ui/icons';\nimport {\n selectTabByPath,\n setContent,\n useAppDispatch,\n useAppSelector,\n} from '@ws-ui/store';\nimport { chakraTheme } from '@ws-ui/webform-editor';\nimport { FC, useEffect, useState } from 'react';\nimport { generate } from 'short-uuid';\nimport { z } from 'zod';\nimport { SwitchToEditorIcon } from './SwitchToEditorIcon';\nimport { Handler } from './Handler';\nimport {\n $handlerSubject,\n HandlerProvider,\n HTTPHandler,\n useHTTPHandlers,\n} from './Provider';\nimport { Tooltip } from '@ws-ui/shared';\nimport './index.css';\n\nconst HandlerSchema = z.object({\n class: z.string().optional(),\n method: z.string().optional(),\n verbs: z.string().optional(),\n id: z.string().optional(),\n pattern: z.string().optional(),\n regexPattern: z.string().optional(),\n});\n\nconst HandlersSchema = z.array(HandlerSchema);\n\nexport type Props = {\n content: string | HTTPHandler[];\n path: string;\n};\n\nconst Editor: FC<{ path: string }> = ({ path }) => {\n const tab = useAppSelector(selectTabByPath(path));\n const {\n dispatch,\n state: { content: items, editing },\n } = useHTTPHandlers();\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n );\n const [activeId, setActiveId] = useState<string | null>(null);\n\n const activeItem = items.find((item) => item.id === activeId);\n\n const appDispatch = useAppDispatch();\n\n useEffect(() => {\n const newContent = JSON.stringify(\n items.map(\n ({ isExpanded: _, asRegex, pattern, regexPattern, ...item }) => {\n const rest = asRegex ? { regexPattern } : { pattern };\n\n return {\n ...item,\n verbs: item.verbs?.join(','),\n ...rest,\n };\n },\n ),\n null,\n 2,\n );\n\n const oldContent =\n typeof tab?.content === 'string'\n ? tab.content\n : JSON.stringify(tab?.content, null, 2);\n\n if (newContent === oldContent) {\n return;\n }\n\n appDispatch(\n setContent({\n path,\n content: newContent,\n }),\n );\n }, [items]);\n\n return (\n <div className=\"bg-grey-700 flex h-full w-full flex-col text-white\">\n <div className=\"flex items-center justify-between border-b border-black p-2\">\n {tab && (\n <SwitchToEditorIcon\n label=\"Switch to text Editor\"\n Icon={FdCode}\n tab={tab}\n editor={{\n config: { language: 'json' },\n key: 'editors:code',\n }}\n />\n )}\n <p className=\"text-grey-100 text-s flex items-center gap-1\">\n <FdInfoCircle className=\"inline text-base text-white\" /> HTTP handlers\n are evaluated in the order they are declared\n </p>\n </div>\n <div className=\"mt-1 flex flex-1 flex-col overflow-x-auto px-4\">\n {items.length ? (\n <div className=\"flex h-full min-w-[1200px] flex-1 flex-col\">\n <div className=\"mb-3 flex items-center gap-2 border-b\">\n <div className=\"w-60 flex-shrink-0 text-xs\">\n <span className=\"pl-6\">Class</span>\n </div>\n <div className=\"w-60 flex-shrink-0 text-xs\">Method</div>\n <div className=\"w-60 flex-shrink-0 text-xs\">Pattern</div>\n <div className=\"w-20 px-2 text-center text-xs\">As Regex</div>\n <div className=\"flex flex-1 items-center justify-between text-xs\">\n <span>Verbs</span>\n <div className=\"flex items-center gap-2 text-2xl\">\n <Tooltip label=\"Add a new HTTP Handler\">\n <button\n disabled={Boolean(editing)}\n onClick={() => {\n $handlerSubject.next(editing);\n dispatch({\n type: 'ADD_HANDLER',\n payload: {\n class: '',\n isExpanded: true,\n method: '',\n pattern: '',\n verbs: [],\n regexPattern: '',\n },\n });\n }}\n className=\"hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none disabled:cursor-not-allowed disabled:opacity-30\"\n >\n <FdPlus className=\"h-5 w-5\" />\n </button>\n </Tooltip>\n </div>\n </div>\n </div>\n <div className=\"py-3\">\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragStart={(event) => {\n setActiveId(event.active.id);\n }}\n onDragEnd={(event) => {\n const { active, over } = event;\n\n setActiveId(null);\n\n if (!active || !over) return;\n\n if (active.id !== over?.id) {\n const oldIndex = items\n .map((item) => item.id)\n .indexOf(active.id);\n const newIndex = items\n .map((item) => item.id)\n .indexOf(over.id);\n\n dispatch({\n type: 'UPDATE_HANDLERS',\n payload: arrayMove(items, oldIndex, newIndex),\n });\n }\n }}\n >\n <SortableContext\n items={items}\n strategy={verticalListSortingStrategy}\n >\n {items.map(({ id, ...props }) => (\n <Handler key={id} id={id} {...props} />\n ))}\n </SortableContext>\n <DragOverlay>\n {activeId && activeItem ? (\n <div className=\"opacity-10\">\n <Handler {...activeItem} />\n </div>\n ) : null}\n </DragOverlay>\n </DndContext>\n </div>\n </div>\n ) : (\n <div className=\"mt-6\">\n <div>\n <FdEmpty className=\"text-grey-200 mx-auto h-9 w-9\" />\n </div>\n <div className=\"text-s text-grey-200 mx-auto mt-3 max-w-sm text-center\">\n There are no http handlers configured yet <br />\n Please add a new one to add a new one.\n </div>\n <div className=\"mt-3 flex items-center justify-center\">\n <button\n onClick={() => {\n $handlerSubject.next(editing);\n dispatch({\n type: 'ADD_HANDLER',\n payload: {\n class: '',\n isExpanded: true,\n method: '',\n pattern: '',\n verbs: [],\n regexPattern: '',\n },\n });\n }}\n className=\"bg-primary-dark text-s rounded px-2 py-1 flex items-center gap-1\"\n >\n <FdPlus className=\"inline text-white h-4 w-4\" /> Add New Handler\n </button>\n </div>\n </div>\n )}\n </div>\n </div>\n );\n};\n\nexport const HTTPHandlersEditor: FC<Props> = ({ content, path }) => {\n const [error, setError] = useState<string | null>(null);\n\n function safeParseJSON(json: string) {\n let parsed;\n\n try {\n parsed = JSON.parse(json);\n } catch (e) {\n setError('HTTP Handler JSON is invalid');\n parsed = [];\n }\n\n return parsed;\n }\n\n const contentToRender =\n typeof content === 'string' ? safeParseJSON(content) : content;\n\n const validationResult = HandlersSchema.safeParse(contentToRender);\n\n if (!validationResult.success || error) {\n throw new Error('Invalid JSON');\n }\n\n const initialContent = contentToRender.map((item: HTTPHandler) => {\n const asRegex = Boolean(item.regexPattern);\n return {\n ...item,\n id: item.id ?? generate(),\n verbs: (item.verbs as unknown as string | undefined)\n ?.split(',')\n .map((item) => item.toLocaleUpperCase())\n .filter(Boolean),\n asRegex,\n };\n });\n\n return (\n <ChakraProvider theme={chakraTheme}>\n <HandlerProvider content={initialContent}>\n <Editor path={path} />\n </HandlerProvider>\n </ChakraProvider>\n );\n};\n","import { FC } from 'react';\r\nimport { HTTP_HANDLERS_TAB_PATH } from '@ws-ui/shared';\r\nimport { getStore, ReduxProvider } from '@ws-ui/store';\r\nimport { HTTPHandlersEditor, Props } from '../Editor';\r\n\r\ninterface IStandaloneProps extends Omit<Props, 'path'> {}\r\n\r\nexport const Standalone: FC<IStandaloneProps> = (props) => {\r\n return (\r\n <ReduxProvider store={getStore()}>\r\n <div className=\"h-screen bg-grey-900\">\r\n <HTTPHandlersEditor\r\n path={HTTP_HANDLERS_TAB_PATH}\r\n {...props}\r\n />\r\n </div>\r\n </ReduxProvider>\r\n );\r\n};\r\n"],"names":["SwitchToEditorIcon","label","Icon","tab","editor","onBeforeClick","dispatch","useAppDispatch","jsx","ToolbarIcon","switchEditor","HandlerContext","createContext","$handlerSubject","Subject","handlerReducer","state","action","lastEditing","item","omit","t","id","generate","handler","handlerToDuplicate","found","HandlerProvider","children","content","initialState","useReducer","useEffect","useHTTPHandlers","context","useContext","MultipleComboBox","initialSelectedItems","onChange","touched","onBlur","verbs","getFilteredverbs","selectedItems","inputValue","lowerCasedInputValue","method","setInputValue","useState","setSelectedItems","items","useMemo","getSelectedItemProps","getDropdownProps","removeSelectedItem","useMultipleSelection","newSelectedItems","type","isOpen","getToggleButtonProps","getMenuProps","getInputProps","highlightedIndex","getItemProps","selectedItem","useCombobox","actionAndChanges","changes","newInputValue","newSelectedItem","jsxs","cn","selectedItemForRender","index","e","FdCloseNaked","FdDown","Select","value","options","errorMessage","query","setQuery","notFound","filteredOptions","sgltn","Combobox","open","sngltn","event","Fragment","Transition","FdEmpty","option","active","selected","MethodSelector","exposed","val","FdWarningDanger","GrabHandle","listeners","attributes","FdDragHandle","generateRegexExample","regex","regexExample","RandExp","_a","HandlerEdit","className","pattern","regexPattern","asRegex","setHandler","catalog","useAppSelector","selectCatalog","singletons","singletonMethods","name","newlyCreatedHandlerID","appDispatch","isValid","onConfirm","onCancel","oldHandler","newHandler","isEqual","confirmed","openModal","ModalType","ModalColor","useHotkeys","lastEditingID","touchedFields","setTouchedFields","methodErrors","patternErrors","Tooltip","FdInfoCircle","ControlledSwitch","rest","FdDuplicate","FdCheckCircle","FdClose","Handler","isExpanded","setNodeRef","transform","transition","useSortable","style","CSS","editing","patternValue","notFoundSingltonError","exposedError","FdRegex","FdUnRegex","FdPen","FdTrash","HandlerSchema","z","HandlersSchema","Editor","path","selectTabByPath","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","sortableKeyboardCoordinates","activeId","setActiveId","activeItem","newContent","_","oldContent","setContent","FdCode","FdPlus","DndContext","closestCenter","over","oldIndex","newIndex","arrayMove","SortableContext","verticalListSortingStrategy","props","DragOverlay","HTTPHandlersEditor","error","setError","safeParseJSON","json","parsed","contentToRender","initialContent","ChakraProvider","chakraTheme","Standalone","ReduxProvider","getStore","HTTP_HANDLERS_TAB_PATH"],"mappings":"siBAcaA,GAAkD,CAAC,CAC9D,MAAAC,EACA,KAAAC,EACA,IAAAC,EACA,OAAAC,EACA,cAAAC,CACF,IAAM,CACJ,MAAMC,EAAWC,EAAAA,eAAA,EAEjB,OACEC,EAAAA,IAACC,EAAAA,YAAA,CACC,MAAAR,EACA,KAAAC,EACA,GAAG,SACH,QAAS,IAAM,CACbG,GAAA,MAAAA,IACAC,EACEI,eAAa,CACX,IAAAP,EACA,OAAAC,CAAA,CACD,CAAA,CAEL,CAAA,CAAA,CAGN,ECFMO,EAAiBC,EAAAA,cAA8C,MAAS,EAEjEC,EAAkB,IAAIC,GAAAA,QAe7BC,GAAiB,CACrBC,EACAC,IACiB,CACjB,OAAQA,EAAO,KAAA,CACb,IAAK,kBACH,MAAO,CACL,GAAGD,EACH,QAASC,EAAO,OAAA,EAEpB,IAAK,sBAAuB,CAG1B,GAAIA,EAAO,SA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