@chaibuilder/sdk 1.2.10 → 1.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -12
- package/dist/AddBlocks-TSt8uJY4.js +218 -0
- package/dist/AddBlocks-k2p8Hy1n.cjs +1 -0
- package/dist/BrandingOptions-WyVWfFVz.cjs +1 -0
- package/dist/{BrandingOptions-10jJO8mG.js → BrandingOptions-uFTyYJZj.js} +18 -21
- package/dist/{CanvasArea-6O8dMPug.cjs → CanvasArea-5erOZYLy.cjs} +4 -4
- package/dist/{CanvasArea-jgBDM5Qd.js → CanvasArea-iRQqpOak.js} +187 -188
- package/dist/{utils-AvyFzbPC.js → Class-17XFhL48.js} +15 -16
- package/dist/Class-5ARpH_Tu.cjs +1 -0
- package/dist/CurrentPage-NzmJloN7.cjs +1 -0
- package/dist/{CurrentPage-lakeZviD.js → CurrentPage-RCxTz9Mc.js} +24 -25
- package/dist/{Layers-R7TfREUd.js → Layers-tXB5Pwid.js} +40 -41
- package/dist/Layers-xDG7oltg.cjs +1 -0
- package/dist/PagesPanel-72nzYB1k.cjs +1 -0
- package/dist/{PagesPanel-4mqxCFHq.js → PagesPanel-Jaz9jvye.js} +14 -15
- package/dist/{ProjectPanel-Wy2nw-1w.js → ProjectPanel--S014Xx3.js} +17 -18
- package/dist/ProjectPanel-RU0QvH6e.cjs +1 -0
- package/dist/Settings-5EuwaVb3.cjs +1 -0
- package/dist/{Settings-_K28Ontt.js → Settings-gjvl5V1k.js} +153 -154
- package/dist/{SidePanels-6slnxdSj.js → SidePanels-Fq3kRwR0.js} +37 -38
- package/dist/SidePanels-uNCxnGte.cjs +1 -0
- package/dist/Topbar-JqW89xI5.cjs +1 -0
- package/dist/{Topbar-bwt6HjlL.js → Topbar-m5dbbI1f.js} +14 -15
- package/dist/{UnsplashImages-V29UE-57.js → UnsplashImages-GhBD6owT.js} +28 -29
- package/dist/UnsplashImages-vACw5hbK.cjs +1 -0
- package/dist/UploadImages-PzHdEKHT.cjs +1 -0
- package/dist/{UploadImages-E0mi_qn8.js → UploadImages-S1HgxeGb.js} +23 -24
- package/dist/{add-page-modal-FJEAqfD3.js → add-page-modal-2P5hGXOQ.js} +19 -20
- package/dist/add-page-modal-GAizM2Jw.cjs +1 -0
- package/dist/{confirm-alert-5hfE116f.js → confirm-alert-57Xq5foA.js} +12 -13
- package/dist/confirm-alert-Uf84DpdR.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -50
- package/dist/core.js +45 -56
- package/dist/defaultTheme-IH19g4fv.cjs +1 -0
- package/dist/defaultTheme-YY8mlQS3.js +1055 -0
- package/dist/delete-page-modal-MG42FdnU.cjs +1 -0
- package/dist/{delete-page-modal-wH0yLiQI.js → delete-page-modal-ix5IjaFW.js} +14 -15
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +100 -81
- package/dist/email.cjs +1 -0
- package/dist/email.d.ts +116 -0
- package/dist/email.js +79 -0
- package/dist/{controls-XPXGHKht.js → empty-slot-MWycClTb.js} +61 -50
- package/dist/empty-slot-TF2kd-0X.cjs +1 -0
- package/dist/{form-1j01gADS.cjs → form-KBb3kA8g.cjs} +1 -1
- package/dist/{form-UVHCD9N3.js → form-SYcFyACJ.js} +1 -1
- package/dist/{index-c2VLKuhY.js → index-Fj3ead-J.js} +5 -5
- package/dist/index-aiHDvS5v.cjs +1 -0
- package/dist/{index-xbQL0wpz.cjs → index-cM3eKmlx.cjs} +2 -2
- package/dist/{index-B4sL0YTN.js → index-pNYv0oAF.js} +1427 -1557
- package/dist/lib.cjs +3 -3
- package/dist/lib.js +95 -1125
- package/dist/page-viewer-Sh99FGYk.cjs +1 -0
- package/dist/{page-viewer-TcK0I240.js → page-viewer-VxqOevr4.js} +16 -17
- package/dist/project-general-setting-VTLHa-Ik.cjs +1 -0
- package/dist/{project-general-setting-4ruKl033.js → project-general-setting-nWOjPiin.js} +15 -16
- package/dist/{project-seo-setting-d1EZlacB.js → project-seo-setting-70bWTwsB.js} +14 -15
- package/dist/project-seo-setting-ENAKc2Dl.cjs +1 -0
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.js +111 -70
- package/dist/{single-page-detail-PihQi-dP.js → single-page-detail-3z7TF-Yy.js} +44 -45
- package/dist/single-page-detail-6L38HJC4.cjs +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +13 -14
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +138 -139
- package/dist/{useAddBlockByDrop-nLzs79He.cjs → useAddBlockByDrop-7mUMwNSG.cjs} +1 -1
- package/dist/{useAddBlockByDrop-rcDR-z9_.js → useAddBlockByDrop-tjQ5DgiO.js} +1 -1
- package/dist/web-blocks.cjs +1 -1
- package/dist/web-blocks.js +313 -322
- package/package.json +8 -2
- package/dist/AddBlocks-GiMnBMeQ.js +0 -224
- package/dist/AddBlocks-SzURo9Bj.cjs +0 -1
- package/dist/BrandingOptions-yK-54R-c.cjs +0 -1
- package/dist/CurrentPage-1y62Ne77.cjs +0 -1
- package/dist/Layers-Z4nmm9xK.cjs +0 -1
- package/dist/PagesPanel-ouHdxyOH.cjs +0 -1
- package/dist/ProjectPanel-hHolYZjt.cjs +0 -1
- package/dist/Settings-EYOw02iE.cjs +0 -1
- package/dist/SidePanels-U-_O1QN8.cjs +0 -1
- package/dist/Topbar-dQEoY2P8.cjs +0 -1
- package/dist/UnsplashImages-pGgaUPQy.cjs +0 -1
- package/dist/UploadImages-7oLycdSh.cjs +0 -1
- package/dist/add-page-modal-In6XI-vZ.cjs +0 -1
- package/dist/confirm-alert-Vwd3OzL9.cjs +0 -1
- package/dist/controls-Dy1qa8Dc.cjs +0 -1
- package/dist/delete-page-modal-tl7FLK9J.cjs +0 -1
- package/dist/functions-Ox_svtKm.cjs +0 -1
- package/dist/functions-xIebp8Aw.js +0 -23
- package/dist/index-7ogwGh39.cjs +0 -1
- package/dist/page-viewer-SfQUe0SI.cjs +0 -1
- package/dist/project-general-setting-t7E2Y_w9.cjs +0 -1
- package/dist/project-seo-setting-4b_BJZDF.cjs +0 -1
- package/dist/single-page-detail-KuXd9Mur.cjs +0 -1
- package/dist/utils-PTxFk6qT.cjs +0 -1
package/dist/ui.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./jsx-runtime-WbnYoNE9.js";
|
|
3
|
-
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
1
|
+
import { b7 as z, ba as q, b8 as U, b9 as W, bl as X, bx as Y, A as Z, ah as _, H as $, C as J, F as K, G as N, D as O, E as Q, z as aa, bm as ea, by as oa, B as ta, bf as ra, bi as sa, bh as na, bk as ia, bg as ba, bA as pa, aV as ua, cb as ma, aY as la, aZ as ca, aW as da, a_ as ga, aX as Ca, cd as Ma, cc as Sa, bq as Da, ce as Ta, bp as xa, cj as Aa, bo as ha, cg as wa, ck as Ia, co as Fa, cf as Ga, ch as Pa, ci as ka, cl as Ha, cm as va, cn as La, br as Ra, ac as Ba, ad as Va, ag as Ea, a$ as fa, ae as ya, af as ja, b0 as za, aD as qa, aI as Ua, aF as Wa, c2 as Xa, b$ as Ya, aG as Za, c3 as _a, c7 as $a, c0 as Ja, aH as Ka, c1 as Na, c4 as Oa, c5 as Qa, c6 as ae, aE as ee, aA as oe, aC as te, aB as re, b4 as se, b5 as ne, bb as ie, ay as be, b6 as pe, bC as ue, bJ as me, bF as le, bP as ce, bG as de, bI as ge, bD as Ce, bM as Me, bK as Se, bL as De, bH as Te, bR as xe, bQ as Ae, bN as he, bO as we, bE as Ie, aS as Fe, aU as Ge, aT as Pe, b3 as ke, be as He, bB as ve, ai as Le, al as Re, as as Be, am as Ve, at as Ee, bS as fe, aj as ye, ak as je, ax as ze, bT as qe, bV as Ue, bW as We, b_ as Xe, bY as Ye, bX as Ze, bZ as _e, bU as $e, S as Je, az as Ke, ao as Ne, ar as Oe, ap as Qe, aq as ao, bj as eo, y as oo, bu as to, au as ro, aw as so, bc as no, T as io, av as bo, bz as po, bw as uo, c8 as mo, ca as lo, bv as co, c9 as go } from "./index-pNYv0oAF.js";
|
|
4
2
|
import "react";
|
|
5
|
-
import "@radix-ui/react-toggle";
|
|
6
|
-
import "class-variance-authority";
|
|
7
|
-
import "./utils-AvyFzbPC.js";
|
|
8
3
|
import "lodash-es";
|
|
9
|
-
import "./
|
|
4
|
+
import "./Functions-7jnEwJyw.js";
|
|
10
5
|
import "clsx";
|
|
11
6
|
import "tailwind-merge";
|
|
7
|
+
import "@chaibuilder/runtime";
|
|
8
|
+
import "jotai";
|
|
9
|
+
import "flat-to-nested";
|
|
10
|
+
import "./MODIFIERS-RiXS5Mn1.js";
|
|
11
|
+
import "./_commonjsHelpers-UyOWmZb0.js";
|
|
12
|
+
import "@react-hookz/web";
|
|
13
|
+
import "./jsx-runtime-WbnYoNE9.js";
|
|
14
|
+
import "@radix-ui/react-toggle";
|
|
15
|
+
import "class-variance-authority";
|
|
16
|
+
import "./Class-17XFhL48.js";
|
|
12
17
|
import "@radix-ui/react-switch";
|
|
13
18
|
import "@radix-ui/react-slot";
|
|
14
19
|
import "@radix-ui/react-accordion";
|
|
@@ -31,149 +36,143 @@ import "@radix-ui/react-context-menu";
|
|
|
31
36
|
import "react-icons-picker";
|
|
32
37
|
import "react-dom";
|
|
33
38
|
import "react-quill";
|
|
34
|
-
import "jotai";
|
|
35
|
-
import "flat-to-nested";
|
|
36
|
-
import "./Functions-7jnEwJyw.js";
|
|
37
|
-
import "redux-undo";
|
|
38
|
-
import "@chaibuilder/runtime";
|
|
39
|
-
import "@react-hookz/web";
|
|
40
39
|
import "react-i18next";
|
|
41
40
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
41
|
+
z as Accordion,
|
|
42
|
+
q as AccordionContent,
|
|
43
|
+
U as AccordionItem,
|
|
44
|
+
W as AccordionTrigger,
|
|
45
|
+
X as Alert,
|
|
46
|
+
Y as AlertDescription,
|
|
47
|
+
Z as AlertDialog,
|
|
48
|
+
_ as AlertDialogAction,
|
|
49
|
+
$ as AlertDialogCancel,
|
|
50
|
+
J as AlertDialogContent,
|
|
51
|
+
K as AlertDialogDescription,
|
|
52
|
+
N as AlertDialogFooter,
|
|
53
|
+
O as AlertDialogHeader,
|
|
54
|
+
Q as AlertDialogTitle,
|
|
55
|
+
aa as AlertDialogTrigger,
|
|
56
|
+
ea as AlertTitle,
|
|
57
|
+
oa as Badge,
|
|
58
|
+
ta as Button,
|
|
59
|
+
ra as Card,
|
|
60
|
+
sa as CardContent,
|
|
61
|
+
na as CardDescription,
|
|
62
|
+
ia as CardFooter,
|
|
63
|
+
ba as CardHeader,
|
|
64
|
+
pa as CardTitle,
|
|
65
|
+
ua as Command,
|
|
66
|
+
ma as CommandDialog,
|
|
68
67
|
la as CommandEmpty,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
68
|
+
ca as CommandGroup,
|
|
69
|
+
da as CommandInput,
|
|
70
|
+
ga as CommandItem,
|
|
71
|
+
Ca as CommandList,
|
|
72
|
+
Ma as CommandSeparator,
|
|
73
|
+
Sa as CommandShortcut,
|
|
74
|
+
Da as ContextMenu,
|
|
75
|
+
Ta as ContextMenuCheckboxItem,
|
|
76
|
+
xa as ContextMenuContent,
|
|
77
|
+
Aa as ContextMenuGroup,
|
|
79
78
|
ha as ContextMenuItem,
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
wa as ContextMenuLabel,
|
|
80
|
+
Ia as ContextMenuPortal,
|
|
82
81
|
Fa as ContextMenuRadioGroup,
|
|
83
82
|
Ga as ContextMenuRadioItem,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
83
|
+
Pa as ContextMenuSeparator,
|
|
84
|
+
ka as ContextMenuShortcut,
|
|
85
|
+
Ha as ContextMenuSub,
|
|
86
|
+
va as ContextMenuSubContent,
|
|
87
|
+
La as ContextMenuSubTrigger,
|
|
88
|
+
Ra as ContextMenuTrigger,
|
|
89
|
+
Ba as Dialog,
|
|
90
|
+
Va as DialogContent,
|
|
91
|
+
Ea as DialogDescription,
|
|
93
92
|
fa as DialogFooter,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
93
|
+
ya as DialogHeader,
|
|
94
|
+
ja as DialogTitle,
|
|
95
|
+
za as DialogTrigger,
|
|
96
|
+
qa as DropdownMenu,
|
|
97
|
+
Ua as DropdownMenuCheckboxItem,
|
|
98
|
+
Wa as DropdownMenuContent,
|
|
99
|
+
Xa as DropdownMenuGroup,
|
|
100
|
+
Ya as DropdownMenuItem,
|
|
101
|
+
Za as DropdownMenuLabel,
|
|
102
|
+
_a as DropdownMenuPortal,
|
|
103
|
+
$a as DropdownMenuRadioGroup,
|
|
104
|
+
Ja as DropdownMenuRadioItem,
|
|
105
|
+
Ka as DropdownMenuSeparator,
|
|
106
|
+
Na as DropdownMenuShortcut,
|
|
107
|
+
Oa as DropdownMenuSub,
|
|
108
|
+
Qa as DropdownMenuSubContent,
|
|
109
|
+
ae as DropdownMenuSubTrigger,
|
|
110
|
+
ee as DropdownMenuTrigger,
|
|
111
|
+
oe as HoverCard,
|
|
112
|
+
te as HoverCardContent,
|
|
113
|
+
re as HoverCardTrigger,
|
|
114
|
+
se as IconPickerField,
|
|
115
|
+
ne as ImagePickerField,
|
|
116
|
+
ie as Input,
|
|
117
|
+
be as Label,
|
|
118
|
+
pe as LinkField,
|
|
119
|
+
ue as Menubar,
|
|
120
|
+
me as MenubarCheckboxItem,
|
|
122
121
|
le as MenubarContent,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
122
|
+
ce as MenubarGroup,
|
|
123
|
+
de as MenubarItem,
|
|
124
|
+
ge as MenubarLabel,
|
|
125
|
+
Ce as MenubarMenu,
|
|
126
|
+
Me as MenubarPortal,
|
|
127
|
+
Se as MenubarRadioGroup,
|
|
128
|
+
De as MenubarRadioItem,
|
|
129
|
+
Te as MenubarSeparator,
|
|
130
|
+
xe as MenubarShortcut,
|
|
131
|
+
Ae as MenubarSub,
|
|
133
132
|
he as MenubarSubContent,
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
we as MenubarSubTrigger,
|
|
134
|
+
Ie as MenubarTrigger,
|
|
136
135
|
Fe as Popover,
|
|
137
136
|
Ge as PopoverContent,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
137
|
+
Pe as PopoverTrigger,
|
|
138
|
+
ke as RTEField,
|
|
139
|
+
He as ScrollArea,
|
|
140
|
+
ve as ScrollBar,
|
|
141
|
+
Le as Select,
|
|
142
|
+
Re as SelectContent,
|
|
143
|
+
Be as SelectGroup,
|
|
144
|
+
Ve as SelectItem,
|
|
145
|
+
Ee as SelectLabel,
|
|
147
146
|
fe as SelectSeparator,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
147
|
+
ye as SelectTrigger,
|
|
148
|
+
je as SelectValue,
|
|
149
|
+
ze as Separator,
|
|
150
|
+
qe as Sheet,
|
|
151
|
+
Ue as SheetClose,
|
|
152
|
+
We as SheetContent,
|
|
153
|
+
Xe as SheetDescription,
|
|
154
|
+
Ye as SheetFooter,
|
|
155
|
+
Ze as SheetHeader,
|
|
156
|
+
_e as SheetTitle,
|
|
157
|
+
$e as SheetTrigger,
|
|
158
|
+
Je as Skeleton,
|
|
159
|
+
Ke as Switch,
|
|
160
|
+
Ne as Tabs,
|
|
161
|
+
Oe as TabsContent,
|
|
162
|
+
Qe as TabsList,
|
|
163
|
+
ao as TabsTrigger,
|
|
164
|
+
eo as Textarea,
|
|
165
|
+
oo as Toaster,
|
|
166
|
+
to as Toggle,
|
|
167
|
+
ro as Tooltip,
|
|
168
|
+
so as TooltipContent,
|
|
169
|
+
no as TooltipPortal,
|
|
170
|
+
io as TooltipProvider,
|
|
171
|
+
bo as TooltipTrigger,
|
|
172
|
+
po as badgeVariants,
|
|
173
|
+
uo as buttonVariants,
|
|
174
|
+
mo as reducer,
|
|
176
175
|
lo as toast,
|
|
177
|
-
|
|
178
|
-
|
|
176
|
+
co as toggleVariants,
|
|
177
|
+
go as useToast
|
|
179
178
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("react"),u=require("lodash-es"),t=require("./index-
|
|
1
|
+
"use strict";const n=require("react"),u=require("lodash-es"),t=require("./index-aiHDvS5v.cjs"),a=()=>{const{addCoreBlock:r}=t.useAddBlock(),l=t.useBuilderProp("getExternalPredefinedBlock");return n.useCallback(async s=>{const{block:o,dropTargetId:e,relativeIndex:c}=s;if(u.has(o,"format")){const d=await l(o);return r({blocks:d},e===0?null:e,c)}return r(o,e===0?null:e,c)},[r])};exports.useAddBlockByDrop=a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback as n } from "react";
|
|
2
2
|
import { has as s } from "lodash-es";
|
|
3
|
-
import {
|
|
3
|
+
import { K as a, i as u } from "./index-pNYv0oAF.js";
|
|
4
4
|
const B = () => {
|
|
5
5
|
const { addCoreBlock: r } = a(), l = u("getExternalPredefinedBlock");
|
|
6
6
|
return n(
|
package/dist/web-blocks.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("lodash-es"),n=require("./jsx-runtime-Z_BpKhVy.cjs"),v=require("react"),l=require("./controls-Dy1qa8Dc.cjs"),d=require("@chaibuilder/runtime"),y=require("./Functions-N3yhPYKY.cjs"),p=require("@radix-ui/react-icons");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");function S(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const u=S(v),g=({blockProps:e,className:t="",styles:s={}})=>n.jsxRuntimeExports.jsx("div",{...e,className:y.cn("flex h-20 flex-col items-center justify-center",t),...h.omit(s,["className"]),children:n.jsxRuntimeExports.jsx("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300",children:n.jsxRuntimeExports.jsx("span",{className:"opacit flex items-center gap-x-1.5 text-xs font-semibold text-gray-400"})})}),R=u.memo(e=>{const{blockProps:t,backgroundImage:s,children:o,tag:a="div",styles:r}=e;if(!o&&h.isEmpty(r==null?void 0:r.className))return n.jsxRuntimeExports.jsx(g,{blockProps:t,styles:r});let i={};return s&&(i={backgroundImage:`url(${s})`}),u.createElement(a,{...t,...r,style:i},o)});d.registerChaiBlock(R,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:l.S({default:""}),tag:l.f({title:"Tag",default:"div",options:[{value:"div",title:"div"},{value:"header",title:"header"},{value:"footer",title:"footer"},{value:"section",title:"section"},{value:"article",title:"article"},{value:"aside",title:"aside"},{value:"main",title:"main"},{value:"nav",title:"nav"},{value:"figure",title:"figure"},{value:"details",title:"details"},{value:"summary",title:"summary"},{value:"dialog",title:"dialog"},{value:"strike",title:"strike"},{value:"caption",title:"caption"},{value:"legend",title:"legend"},{value:"figcaption",title:"figcaption"},{value:"mark",title:"mark"}]}),backgroundImage:l.o({title:"Background Image"})},canAcceptBlock:()=>!0});const L=e=>{const{blockProps:t,styles:s,content:o,level:a="h1",children:r=null}=e;return r?u.createElement(a,{...s,...t},r):u.createElement(a,{...s,...t,dangerouslySetInnerHTML:{__html:o}})};d.registerChaiBlock(L,{type:"Heading",label:"Heading",category:"core",icon:p.HeadingIcon,group:"basic",props:{level:l.f({title:"Level",default:"h1",binding:!1,options:[{value:"h1",title:"h1"},{value:"h2",title:"h2"},{value:"h3",title:"h3"},{value:"h4",title:"h4"},{value:"h5",title:"h5"},{value:"h6",title:"h6"}]}),styles:l.S({default:"text-3xl"}),content:l.g({title:"Content",default:"Heading goes here"})},canAcceptBlock:e=>e==="Span"||e==="Text"});const T=e=>{const{blockProps:t,styles:s,content:o}=e;return h.isNull(e.children)?u.createElement("div",{...s,...t,dangerouslySetInnerHTML:{__html:o}}):u.createElement("p",{...s,...t},e.children)};d.registerChaiBlock(T,{type:"Paragraph",label:"Paragraph",category:"core",icon:p.TextIcon,group:"basic",props:{styles:l.S({default:""}),content:l.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."})},canAcceptBlock:e=>e==="Span"||e==="Link"});const w=e=>{const{blockProps:t,styles:s,content:o,children:a=null,tag:r}=e;return a?u.createElement("span",{...s,...t},a):u.createElement(r||"span",{...s,...t,dangerouslySetInnerHTML:{__html:o}})};d.registerChaiBlock(w,{type:"Span",label:"Span",category:"core",group:"basic",props:{styles:l.S({default:""}),content:l.g({title:"Content",default:"Enter your content"})}});const _=e=>{const{blockProps:t,content:s,styles:o}=e;return n.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:n.jsxRuntimeExports.jsx("div",{...t,...o,dangerouslySetInnerHTML:{__html:s}})})};d.registerChaiBlock(_,{type:"RichText",label:"Rich Text",category:"core",icon:p.CursorTextIcon,group:"basic",props:{styles:l.S({default:""}),content:l.m({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const C=e=>{const{blockProps:t,iconSize:s,icon:o,content:a,iconPos:r,styles:i,children:c}=e,m=o,f=c||n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{children:a}),m&&n.jsxRuntimeExports.jsx("div",{style:{width:s+"px"},className:r+" "+(r==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:m}})]});return u.createElement("button",{...t,...i,type:"button"},f)};d.registerChaiBlock(C,{type:"Button",label:"Button",category:"core",icon:p.ButtonIcon,group:"basic",props:{content:l.u({title:"Label",default:"Button",multiLingual:!0}),styles:l.S({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:l.T({title:"Icon",default:""}),iconSize:l.c({title:"Icon Size",default:24}),iconPos:l.f({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const P=e=>{const{blockProps:t,link:s,children:o,styles:a,inBuilder:r,content:i}=e;return!o&&h.isEmpty(a==null?void 0:a.className)&&h.isEmpty(i)?n.jsxRuntimeExports.jsx(g,{blockProps:t}):r?o?n.jsxRuntimeExports.jsx("span",{"data-simulate":"a",...t,...a,children:o}):u.createElement("span",{...t,...a,href:s.href||"#",target:s.target||"_self",dangerouslySetInnerHTML:{__html:i},"data-simulate":"a"}):o?n.jsxRuntimeExports.jsx("a",{href:s.href||"#/",target:s.target,...t,...a,children:o}):u.createElement("a",{...t,...a,href:s.href||"#",target:s.target||"_self",dangerouslySetInnerHTML:{__html:i}})};d.registerChaiBlock(P,{type:"Link",label:"Link",category:"core",icon:p.Link1Icon,group:"basic",props:{styles:l.S({default:""}),content:l.u({title:"Content",default:""}),link:l.q({title:"Link",default:{type:"page",target:"_self",href:""}})},canAcceptBlock:()=>!0});const N=e=>{const{blockProps:t,children:s,listType:o,styles:a,tag:r}=e,i=y.cn(h.get(a,"className",""),o);return!s&&h.isEmpty(a==null?void 0:a.className)?n.jsxRuntimeExports.jsx(g,{blockProps:t,text:"LIST ITEM"}):u.createElement(r||(o==="list-decimal"?"ol":"ul"),{...t,...a,className:i},s)};d.registerChaiBlock(N,{type:"List",label:"List",icon:p.RowsIcon,category:"core",group:"basic",props:{styles:l.S({default:""}),listType:l.f({title:"List type",default:"list-disc",options:[{value:"list-none",title:"None"},{value:"list-disc",title:"Disc"},{value:"list-decimal",title:"Number"}]})},canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]});const M=e=>{const{blockProps:t,content:s,styles:o,children:a,tag:r}=e;return a?u.createElement(r||"li",{...o,...t},a):u.createElement(r||"li",{...o,...t,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(M,{type:"ListItem",label:"List Item",icon:p.ColumnsIcon,category:"core",group:"basic",props:{styles:l.S({default:""}),content:l.g({title:"Content",default:"List item"})},canAcceptBlock:()=>!0});const H=e=>{const{blockProps:t,icon:s,styles:o,width:a,height:r}=e,i={...o,className:y.cn(o.className,"inline-block c-inline-block",`w-[${a}px]`,`h-[${r}px]`)};return h.isEmpty(s)?n.jsxRuntimeExports.jsx(g,{blockProps:t,text:"",className:"h-8 w-14"}):u.createElement("span",{...t,...i,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(H,{type:"Icon",label:"Icon",category:"core",icon:p.SketchLogoIcon,group:"basic",props:{styles:l.S({default:"text-black"}),icon:l.T({title:"Icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'}),width:l.c({title:"Width",default:40}),height:l.c({title:"Height",default:40})}});const U=e=>{const{blockProps:t,image:s,styles:o,alt:a,height:r,width:i}=e;return h.isEmpty(s)?n.jsxRuntimeExports.jsx(g,{blockProps:t,text:"IMAGE URL",className:"h-36"}):u.createElement("img",{...t,...o,src:s,alt:a,height:r,width:i})};d.registerChaiBlock(U,{type:"Image",label:"Image",category:"core",icon:p.ImageIcon,group:"basic",props:{styles:l.S({default:""}),image:l.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:l.u({title:"Alt",default:""}),width:l.u({title:"Width",default:""}),height:l.u({title:"Height",default:""})}});const D=e=>{var r;const{blockProps:t,styles:s,children:o}=e;let a=null;return o||(a=n.jsxRuntimeExports.jsx("div",{className:y.cn("flex flex-col items-center justify-center",(r=e.emptyStyles)==null?void 0:r.className),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded-md border-4 border-dashed",children:n.jsxRuntimeExports.jsxs("p",{className:"truncate p-1 text-left text-xs text-gray-400",children:["Slot: ",e.name]})})})),u.createElement("div",{...s,...t,droppable:"yes"},o||a)};d.registerChaiBlock(D,{type:"Slot",label:"Slot",group:"basic",category:"core",hidden:!0,props:{styles:l.S({default:""}),emptyStyles:l.S({default:""})},canAcceptBlock:()=>!0});const E=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,B=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,I=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,q=e=>{if(E.test(e)){const t=e.match(E);return t?`https://www.youtube.com/embed/${t[4]}`:e}if(B.test(e)){const t=e.match(B);return t?`https://player.vimeo.com/video/${t[3]}`:e}if(I.test(e)){const t=e.match(I);return t?`https://www.dailymotion.com/embed/video/${t[4]}`:e}return null},A=u.memo(e=>{const{blockProps:t,inBuilder:s,styles:o,url:a,controls:r}=e,i=h.get(r,"autoPlay",!1),c=h.get(r,"controls",!1),m=i||h.get(r,"muted",!0),f=h.get(r,"loop",!1);if(h.isEmpty(a))return n.jsxRuntimeExports.jsx(g,{blockProps:t,text:"VIDEO URL",className:"h-36"});let b=q(a),x=null;if(b){if(!h.isEmpty(b)){const k=[];k.push(`autoplay=${i?1:0}`),k.push(`controls=${r?1:0}`),k.push(`mute=${m?1:0}&muted=${m?1:0}`),k.push(`loop=${f?1:0}`),b=`${b}?${k.join("&")}`}x=u.createElement("iframe",{...t,className:"absolute inset-0 w-full h-full",src:b,allow:s?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else x=u.createElement("video",{...t,className:"absolute inset-0 w-full h-full",src:a,controls:c,muted:m,autoPlay:s?!1:i,loop:f});return n.jsxRuntimeExports.jsx("div",{...h.pick(o,["className"]),children:n.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[s?n.jsxRuntimeExports.jsx("div",{...t,...h.omit(o,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,x]})})});d.registerChaiBlock(A,{type:"Video",label:"Video",category:"core",icon:p.VideoIcon,group:"basic",props:{styles:l.S({default:""}),url:l.u({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:l.b({title:"Controls",properties:{autoPlay:l.r({title:"Autoplay",default:!0}),controls:l.r({title:"Show controls",default:!1}),loop:l.r({title:"Loop",default:!1}),muted:l.r({title:"Muted",default:!0})}})}});const F=u.memo(e=>{const{blockProps:t,styles:s,content:o,inBuilder:a}=e;return n.jsxRuntimeExports.jsxs("div",{className:"relative",children:[a?n.jsxRuntimeExports.jsx("div",{...t,...s,className:"absolute h-full w-full z-20"}):null,u.createElement("div",{...s,dangerouslySetInnerHTML:{__html:o}})]})});d.registerChaiBlock(F,{type:"CustomHTML",label:"CustomHTML",category:"core",icon:p.CodeIcon,group:"basic",props:{styles:l.S({default:""}),content:l.g({title:"HTML Content",default:"<div><p>HTML Snippet goes here...</p></div>",placeholder:"Enter custom HTML code here"})}});const O=e=>{const{blockProps:t,styles:s}=e;return u.createElement("hr",{...s,...t})};d.registerChaiBlock(O,{type:"Divider",label:"Divider",category:"core",icon:p.DividerHorizontalIcon,group:"basic",props:{styles:l.S({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const z=e=>e.inBuilder?n.jsxRuntimeExports.jsx("span",{className:"inline",...e.blockProps,children:e.content}):`${e.content}`;d.registerChaiBlock(z,{type:"Text",label:"Text",hidden:!0,category:"core",group:"basic",icon:p.SpaceBetweenVerticallyIcon,props:{content:l.g({title:"Content",defaultValue:""})}});const $=e=>{const{blockProps:t,backgroundImage:s,children:o,styles:a}=e;let r={};return s&&(r={backgroundImage:`url(${s})`}),u.createElement("div",{...t,...a,style:r},o)};d.registerChaiBlock($,{type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:l.S({default:"font-body antialiased"}),backgroundImage:l.o({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const V=e=>{const{blockProps:t,styles:s}=e;return u.createElement("br",{...t,...s})};d.registerChaiBlock(V,{type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:p.SpaceBetweenVerticallyIcon,props:{styles:l.S({default:""})}});const j=e=>{const t=(r,i)=>({_id:y.generateUUID(),_parent:r,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+i}`}),s=r=>{const i=y.generateUUID(),c={_type:"TableRow",_id:i,styles:"#styles:,border-b"};return r&&(c._parent=r),[c,t(i,"1"),t(i,"2"),t(i,"3")]},o=r=>{const i=y.generateUUID(),c={_id:i,_type:"TableHead",styles:"#styles:,font-medium"};return r&&(c._parent=r),[c,...s(i)]},a=r=>{const i=y.generateUUID(),c={_id:i,_type:"TableBody",styles:"#styles:,"};return r&&(c._parent=r),[c,...s(i),...s(i)]};if(e==="Table"){const r=y.generateUUID();return[{_id:r,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...o(r),...a(r)]}return e==="TableRow"?s():e==="TableHead"?o():e==="TableBody"?a():[]},W=e=>{const{blockProps:t,children:s,styles:o}=e;return s?u.createElement("table",{...t,...o},s):n.jsxRuntimeExports.jsx(g,{blockProps:t,text:"TABLE HEAD / BODY"})};d.registerChaiBlock(W,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:p.TableIcon,props:{styles:l.S({default:""})},blocks:j("Table")});const G=e=>{const{blockProps:t,children:s,styles:o}=e;return s?u.createElement("thead",{...t,...o},s):n.jsxRuntimeExports.jsx(g,{blockProps:t,text:"TABLE ROW"})};d.registerChaiBlock(G,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:p.BorderTopIcon,props:{styles:l.S({default:""})},blocks:j("TableHead")});const Y=e=>{const{blockProps:t,children:s,styles:o}=e;return s?u.createElement("tbody",{...t,...o},s):n.jsxRuntimeExports.jsx(g,{blockProps:t,text:"TABLE ROW"})};d.registerChaiBlock(Y,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:p.BorderAllIcon,props:{styles:l.S({default:""})},blocks:j("TableBody")});const X=e=>{const{blockProps:t,children:s,styles:o}=e;return s?u.createElement("tr",{...t,...o},s):n.jsxRuntimeExports.jsx(g,{blockProps:t,text:"TABLE CELL"})};d.registerChaiBlock(X,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:p.ViewHorizontalIcon,props:{styles:l.S({default:"w-full"})},blocks:j("TableRow")});const Z=e=>{const{blockProps:t,children:s,content:o,styles:a}=e;return!s&&h.isEmpty(o)?n.jsxRuntimeExports.jsx(g,{blockProps:t}):s?u.createElement("td",{...t,...a},s):u.createElement("td",{...t,...a,dangerouslySetInnerHTML:{__html:o}})};d.registerChaiBlock(Z,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:p.DragHandleHorizontalIcon,props:{styles:l.S({default:""}),content:l.m({title:"Content",default:"Table cell item"})}});const J=e=>{const{blockProps:t,errorMessage:s,name:o,_type:a,successMessage:r,action:i,styles:c,children:m}=e;if(!m&&h.isEmpty(c==null?void 0:c.className))return n.jsxRuntimeExports.jsx(g,{blockProps:t,text:"FORM FIELDS"});const f={"x-data":"useForm","x-on:submit.prevent":"post"},b={"x-html":"formResponse",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return n.jsxRuntimeExports.jsxs("form",{...f,"data-error":s,"data-success":r,method:"post",action:i,...t,...c,children:[n.jsxRuntimeExports.jsx("div",{...b}),n.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:o||a}),m]})};d.registerChaiBlock(J,{type:"Form",label:"Form",category:"core",icon:p.GroupIcon,group:"form",hidden:!0,props:{styles:l.S({default:""}),action:l.u({title:"Submit URL",default:"/api/form/submit"}),errorMessage:l.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:l.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0});const K=e=>{const{blockProps:t,content:s,styles:o,children:a}=e,r={...o,...t};return a?u.createElement("label",r,a):u.createElement("label",{...r,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(K,{type:"Label",label:"Label",category:"core",icon:p.LetterCaseToggleIcon,group:"form",hidden:!0,props:{styles:l.S({default:""}),content:l.u({title:"Content",default:"Label"})}});const Q=e=>{const{blockProps:t,inBuilder:s,label:o,placeholder:a,styles:r,inputStyles:i,icon:c,iconPos:m}=e,f=y.generateUUID(),b={"x-bind:disabled":"formLoading"};return n.jsxRuntimeExports.jsxs("button",{id:f,...b,...i,...r,...t||{},type:s?"button":"submit",placeholder:a,children:[o,c&&n.jsxRuntimeExports.jsx("span",{className:m,dangerouslySetInnerHTML:{__html:c}})]})};d.registerChaiBlock(Q,{type:"FormButton",label:"Submit Button",category:"core",icon:p.ButtonIcon,group:"form",hidden:!0,props:{label:l.u({title:"Label",default:"Submit"}),styles:l.S({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:l.T({title:"Icon",default:""}),iconPos:l.f({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const ee=e=>{const{blockProps:t,fieldName:s,label:o,styles:a,inputStyles:r,required:i,checked:c,showLabel:m=!0}=e,f=y.generateUUID();return m?n.jsxRuntimeExports.jsxs("div",{...a,...t,children:[n.jsxRuntimeExports.jsx("input",{...r,name:s,id:f,type:"checkbox",required:i,defaultChecked:c}),o&&o!=="Label"&&n.jsxRuntimeExports.jsx("label",{htmlFor:f,children:o})]}):n.jsxRuntimeExports.jsx("input",{id:f,...t,...r,...a,type:"checkbox",required:i,name:s})};d.registerChaiBlock(ee,{type:"Checkbox",label:"Checkbox",category:"core",icon:p.CheckboxIcon,group:"form",hidden:!0,props:{fieldName:l.u({title:"Field Name",default:"checkbox"}),styles:l.S({default:"flex items-center gap-x-2"}),label:l.u({title:"Label",default:"Label"}),checked:l.r({title:"Checked",default:!1}),required:l.r({title:"Required",default:!1})}});const te=e=>{const{blockProps:t,label:s,placeholder:o,styles:a,inputStyles:r,showLabel:i,required:c,inputType:m="text",inBuilder:f,fieldName:b}=e,x=y.generateUUID();return!i||m==="submit"?(m==="submit"&&(t.value=s),n.jsxRuntimeExports.jsx("input",{id:x,name:b,readOnly:f,...t,...r,...a,type:m,placeholder:o,required:c})):n.jsxRuntimeExports.jsxs("div",{...a,...t,children:[i&&n.jsxRuntimeExports.jsx("label",{htmlFor:x,children:s}),n.jsxRuntimeExports.jsx("input",{name:b,readOnly:f,...r,id:x,type:m,placeholder:o,required:c})]})};d.registerChaiBlock(te,{type:"Input",label:"Input",category:"core",icon:p.InputIcon,group:"form",hidden:!0,props:{styles:l.S({default:""}),fieldName:l.u({title:"Field Name",default:"input"}),inputType:l.f({title:"Type",options:h.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],e=>({value:e,title:e})),default:"text"}),value:l.u({title:"Value",default:""}),showLabel:l.r({title:"Show label",default:!0}),inputStyles:l.S({default:"w-full p-1"}),label:l.u({title:"Label",default:"Label"}),placeholder:l.u({title:"Placeholder",default:"Placeholder"}),required:l.r({title:"Required",default:!1})}});const le=e=>{const{blockProps:t,fieldName:s,label:o,styles:a,inputStyles:r,checked:i,required:c,showLabel:m=!0}=e,f=y.generateUUID();return m?n.jsxRuntimeExports.jsxs("div",{...a,...t,children:[n.jsxRuntimeExports.jsx("input",{...r,name:s,id:f,type:"radio",required:c,defaultChecked:i}),o&&n.jsxRuntimeExports.jsx("label",{htmlFor:f,children:o})]}):n.jsxRuntimeExports.jsx("input",{id:f,...t,...r,...a,type:"radio",required:c,checked:i,name:s})};d.registerChaiBlock(le,{type:"Radio",label:"Radio",category:"core",icon:p.RadiobuttonIcon,group:"form",hidden:!0,props:{styles:l.S({default:"flex items-center w-max gap-x-2"}),fieldName:l.u({title:"Field Name",default:"radio"}),label:l.u({title:"Label",default:"Label"}),checked:l.r({title:"Checked",default:!1}),required:l.r({title:"Required",default:!1})}});const se=e=>{const{blockProps:t,fieldName:s,label:o,placeholder:a,styles:r,inputStyles:i,required:c,showLabel:m,_multiple:f=!1}=e,b=y.generateUUID();return m?n.jsxRuntimeExports.jsxs("div",{...r,children:[m&&n.jsxRuntimeExports.jsx("label",{htmlFor:b,children:o}),n.jsxRuntimeExports.jsxs("select",{...i,id:b,placeholder:a,required:c,multiple:f,name:s,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:a}),h.map(e.options,x=>n.jsxRuntimeExports.jsx("option",{selected:h.get(x,"selected",!1),value:x.value,dangerouslySetInnerHTML:{__html:x.label}},x.value))]})]}):n.jsxRuntimeExports.jsxs("select",{id:b,...r,...t,placeholder:a,required:c,multiple:f,name:s,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:a}),h.map(e.options,x=>n.jsxRuntimeExports.jsx("option",{selected:h.get(x,"selected",!1),value:x.value,dangerouslySetInnerHTML:{__html:x.label}},x.value))]})};d.registerChaiBlock(se,{type:"Select",label:"Select",category:"core",icon:p.DropdownMenuIcon,group:"form",hidden:!0,props:{styles:l.S({default:""}),fieldName:l.u({title:"Field Name",default:"select"}),showLabel:l.r({title:"Show label",default:!0}),inputStyles:l.S({default:"w-full p-1"}),label:l.u({title:"Label",default:"Label"}),placeholder:l.u({title:"Placeholder",default:"Placeholder"}),required:l.r({title:"Required",default:!1}),_multiple:l.r({title:"Multiple Choice",default:!1}),options:l.h({title:"Options",itemProperties:{label:l.u({title:"Label",default:""}),value:l.u({title:"Value",default:""})}})}});const oe=e=>{const{blockProps:t,fieldName:s,label:o,placeholder:a,styles:r,inputStyles:i,_rows:c,showLabel:m}=e,f=y.generateUUID();return m?n.jsxRuntimeExports.jsxs("div",{...r,...t,children:[m&&n.jsxRuntimeExports.jsx("label",{htmlFor:f,children:o}),n.jsxRuntimeExports.jsx("textarea",{name:s,...i,id:f,placeholder:a,rows:c})]}):n.jsxRuntimeExports.jsx("textarea",{id:f,name:s,...t,...i,...r,placeholder:a,rows:c})};d.registerChaiBlock(oe,{type:"TextArea",label:"TextArea",category:"core",icon:p.InputIcon,group:"form",hidden:!0,props:{fieldName:l.u({title:"Field Name",default:"textarea"}),showLabel:l.r({title:"Show label",default:!0}),styles:l.S({default:""}),inputStyles:l.S({default:"w-full p-1"}),label:l.u({title:"Label",default:"Label"}),placeholder:l.u({title:"Placeholder",default:"Placeholder"}),_rows:l.c({title:"Rows",default:3})}});const re=h.noop;exports.loadWebBlocks=re;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("lodash-es"),n=require("./jsx-runtime-Z_BpKhVy.cjs"),S=require("react"),e=require("./empty-slot-TF2kd-0X.cjs"),d=require("@chaibuilder/runtime"),m=require("@radix-ui/react-icons"),x=require("./Functions-N3yhPYKY.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");function I(t){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(l,o,s.get?s:{enumerable:!0,get:()=>t[o]})}}return l.default=t,Object.freeze(l)}const u=I(S),v=u.memo(t=>{const{blockProps:l,backgroundImage:o,children:s,tag:r="div",styles:a}=t;let i=s;s||(i=n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:{},styles:{}}));let c={};return o&&(c={backgroundImage:`url(${o})`}),u.createElement(r,{...l,...a,style:c},i)});d.registerChaiBlock(v,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:e.S({default:""}),tag:e.f({title:"Tag",default:"div",options:[{value:"div",title:"div"},{value:"header",title:"header"},{value:"footer",title:"footer"},{value:"section",title:"section"},{value:"article",title:"article"},{value:"aside",title:"aside"},{value:"main",title:"main"},{value:"nav",title:"nav"},{value:"figure",title:"figure"},{value:"details",title:"details"},{value:"summary",title:"summary"},{value:"dialog",title:"dialog"},{value:"strike",title:"strike"},{value:"caption",title:"caption"},{value:"legend",title:"legend"},{value:"figcaption",title:"figcaption"},{value:"mark",title:"mark"}]}),backgroundImage:e.o({title:"Background Image"})},canAcceptBlock:()=>!0});const R=t=>{const{blockProps:l,styles:o,content:s,level:r="h1",children:a=null}=t;return a?u.createElement(r,{...o,...l},a):u.createElement(r,{...o,...l,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(R,{type:"Heading",label:"Heading",category:"core",icon:m.HeadingIcon,group:"typography",props:{level:e.f({title:"Level",default:"h1",binding:!1,options:[{value:"h1",title:"h1"},{value:"h2",title:"h2"},{value:"h3",title:"h3"},{value:"h4",title:"h4"},{value:"h5",title:"h5"},{value:"h6",title:"h6"}]}),styles:e.S({default:"text-3xl"}),content:e.g({title:"Content",default:"Heading goes here"})},canAcceptBlock:t=>t==="Span"||t==="Text"});const L=t=>{const{blockProps:l,styles:o,content:s}=t;return f.isNull(t.children)?u.createElement("div",{...o,...l,dangerouslySetInnerHTML:{__html:s}}):u.createElement("p",{...o,...l},t.children)};d.registerChaiBlock(L,{type:"Paragraph",label:"Paragraph",category:"core",icon:m.TextIcon,group:"typography",props:{styles:e.S({default:""}),content:e.g({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."})},canAcceptBlock:t=>t==="Span"||t==="Link"});const T=t=>{const{blockProps:l,styles:o,content:s,children:r=null,tag:a}=t;return r?u.createElement("span",{...o,...l},r):u.createElement(a||"span",{...o,...l,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(T,{type:"Span",label:"Span",category:"core",group:"typography",props:{styles:e.S({default:""}),content:e.g({title:"Content",default:"Enter your content"})}});const w=t=>{const{blockProps:l,content:o,styles:s}=t;return n.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:n.jsxRuntimeExports.jsx("div",{...l,...s,dangerouslySetInnerHTML:{__html:o}})})};d.registerChaiBlock(w,{type:"RichText",label:"Rich Text",category:"core",icon:m.CursorTextIcon,group:"typography",props:{styles:e.S({default:""}),content:e.m({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const C=t=>{const{blockProps:l,iconSize:o,icon:s,content:r,iconPos:a,styles:i,children:c}=t,y=s,p=c||n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx("span",{children:r}),y&&n.jsxRuntimeExports.jsx("div",{style:{width:o+"px"},className:a+" "+(a==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:y}})]});return u.createElement("button",{...l,...i,type:"button"},p)};d.registerChaiBlock(C,{type:"Button",label:"Button",category:"core",icon:m.ButtonIcon,group:"basic",props:{content:e.u({title:"Label",default:"Button",multiLingual:!0}),styles:e.S({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:e.T({title:"Icon",default:""}),iconSize:e.c({title:"Icon Size",default:24}),iconPos:e.f({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const _=t=>{const{blockProps:l,link:o,children:s,styles:r,inBuilder:a,content:i}=t;return!s&&f.isEmpty(r==null?void 0:r.className)&&f.isEmpty(i)?n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l}):a?s?n.jsxRuntimeExports.jsx("span",{"data-simulate":"a",...l,...r,children:s}):u.createElement("span",{...l,...r,dangerouslySetInnerHTML:{__html:i},"data-simulate":"a"}):s?n.jsxRuntimeExports.jsx("a",{href:o.href||"#/",target:o.target,...l,...r,children:s}):u.createElement("a",{...l,...r,href:o.href||"#",target:o.target||"_self",dangerouslySetInnerHTML:{__html:i}})};d.registerChaiBlock(_,{type:"Link",label:"Link",category:"core",icon:m.Link1Icon,group:"basic",props:{styles:e.S({default:""}),content:e.u({title:"Content",default:""}),link:e.q({title:"Link",default:{type:"page",target:"_self",href:""}})},canAcceptBlock:()=>!0});const P=t=>{const{blockProps:l,children:o,listType:s,styles:r,tag:a}=t,i=x.cn(f.get(r,"className",""),s);return!o&&f.isEmpty(r==null?void 0:r.className)?n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l,text:"LIST ITEM"}):u.createElement(a||(s==="list-decimal"?"ol":"ul"),{...l,...r,className:i},o)};d.registerChaiBlock(P,{type:"List",label:"List",icon:m.RowsIcon,category:"core",group:"basic",props:{styles:e.S({default:""}),listType:e.f({title:"List type",default:"list-disc",options:[{value:"list-none",title:"None"},{value:"list-disc",title:"Disc"},{value:"list-decimal",title:"Number"}]})},canAcceptBlock:t=>t==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]});const N=t=>{const{blockProps:l,content:o,styles:s,children:r,tag:a}=t;return r?u.createElement(a||"li",{...s,...l},r):u.createElement(a||"li",{...s,...l,dangerouslySetInnerHTML:{__html:o}})};d.registerChaiBlock(N,{type:"ListItem",label:"List Item",icon:m.ColumnsIcon,category:"core",group:"basic",props:{styles:e.S({default:""}),content:e.g({title:"Content",default:"List item"})},canAcceptBlock:()=>!0,canBeNested:t=>t==="List"});const M=t=>{const{blockProps:l,icon:o,styles:s,width:r,height:a}=t,i={...s,className:x.cn(s.className,"inline-block c-inline-block",`w-[${r}px]`,`h-[${a}px]`)};return f.isEmpty(o)?n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l,text:"",className:"h-8 w-14"}):u.createElement("span",{...l,...i,dangerouslySetInnerHTML:{__html:o}})};d.registerChaiBlock(M,{type:"Icon",label:"Icon",category:"core",icon:m.SketchLogoIcon,group:"media",props:{styles:e.S({default:"text-black"}),icon:e.T({title:"Icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'}),width:e.c({title:"Width",default:40}),height:e.c({title:"Height",default:40})}});const H=t=>{const{blockProps:l,image:o,styles:s,alt:r,height:a,width:i}=t;return f.isEmpty(o)?n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l,text:"IMAGE URL",className:"h-36"}):u.createElement("img",{...l,...s,src:o,alt:r,height:a,width:i})};d.registerChaiBlock(H,{type:"Image",label:"Image",category:"core",icon:m.ImageIcon,group:"media",props:{styles:e.S({default:""}),image:e.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:e.u({title:"Alt",default:""}),width:e.u({title:"Width",default:""}),height:e.u({title:"Height",default:""})}});const U=t=>{var a;const{blockProps:l,styles:o,children:s}=t;let r=null;return s||(r=n.jsxRuntimeExports.jsx("div",{className:x.cn("flex flex-col items-center justify-center",(a=t.emptyStyles)==null?void 0:a.className),children:n.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded-md border-4 border-dashed",children:n.jsxRuntimeExports.jsxs("p",{className:"truncate p-1 text-left text-xs text-gray-400",children:["Slot: ",t.name]})})})),u.createElement("div",{...o,...l,droppable:"yes"},s||r)};d.registerChaiBlock(U,{type:"Slot",label:"Slot",group:"basic",category:"core",hidden:!0,props:{styles:e.S({default:""}),emptyStyles:e.S({default:""})},canAcceptBlock:()=>!0});const E=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,j=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,B=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,D=t=>{if(E.test(t)){const l=t.match(E);return l?`https://www.youtube.com/embed/${l[4]}`:t}if(j.test(t)){const l=t.match(j);return l?`https://player.vimeo.com/video/${l[3]}`:t}if(B.test(t)){const l=t.match(B);return l?`https://www.dailymotion.com/embed/video/${l[4]}`:t}return null},q=u.memo(t=>{const{blockProps:l,inBuilder:o,styles:s,url:r,controls:a}=t,i=f.get(a,"autoPlay",!1),c=f.get(a,"controls",!1),y=i||f.get(a,"muted",!0),p=f.get(a,"loop",!1);if(f.isEmpty(r))return n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l,text:"VIDEO URL",className:"h-36"});let b=D(r),h=null;if(b){if(!f.isEmpty(b)){const g=[];g.push(`autoplay=${i?1:0}`),g.push(`controls=${a?1:0}`),g.push(`mute=${y?1:0}&muted=${y?1:0}`),g.push(`loop=${p?1:0}`),b=`${b}?${g.join("&")}`}h=u.createElement("iframe",{...l,className:"absolute inset-0 w-full h-full",src:b,allow:o?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else h=u.createElement("video",{...l,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:y,autoPlay:o?!1:i,loop:p});return n.jsxRuntimeExports.jsx("div",{...f.pick(s,["className"]),children:n.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[o?n.jsxRuntimeExports.jsx("div",{...l,...f.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,h]})})});d.registerChaiBlock(q,{type:"Video",label:"Video",category:"core",icon:m.VideoIcon,group:"media",props:{styles:e.S({default:""}),url:e.u({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:e.b({title:"Controls",properties:{autoPlay:e.r({title:"Autoplay",default:!0}),controls:e.r({title:"Show controls",default:!1}),loop:e.r({title:"Loop",default:!1}),muted:e.r({title:"Muted",default:!0})}})}});const A=u.memo(t=>{const{blockProps:l,styles:o,content:s,inBuilder:r}=t;return n.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?n.jsxRuntimeExports.jsx("div",{...l,...o,className:"absolute z-20 h-full w-full"}):null,u.createElement("div",{...o,dangerouslySetInnerHTML:{__html:s}})]})});d.registerChaiBlock(A,{type:"CustomHTML",label:"Custom HTML",category:"core",icon:m.CodeIcon,group:"advanced",props:{styles:e.S({default:""}),content:e.g({title:"HTML Content",default:"<div><p>HTML Snippet goes here...</p></div>",placeholder:"Enter custom HTML code here"})}});const F=t=>{const{blockProps:l,styles:o}=t;return u.createElement("hr",{...o,...l})};d.registerChaiBlock(F,{type:"Divider",label:"Divider",category:"core",icon:m.DividerHorizontalIcon,group:"basic",props:{styles:e.S({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const O=t=>t.inBuilder?n.jsxRuntimeExports.jsx("span",{className:"inline",...t.blockProps,children:t.content}):`${t.content}`;d.registerChaiBlock(O,{type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:m.SpaceBetweenVerticallyIcon,props:{content:e.g({title:"Content",defaultValue:""})}});const z=t=>{const{blockProps:l,backgroundImage:o,children:s,styles:r}=t;let a={};return o&&(a={backgroundImage:`url(${o})`}),u.createElement("div",{...l,...r,style:a},s)};d.registerChaiBlock(z,{type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:e.S({default:"font-body antialiased"}),backgroundImage:e.o({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const $=t=>{const{blockProps:l,styles:o}=t;return u.createElement("br",{...l,...o})};d.registerChaiBlock($,{type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:m.SpaceBetweenVerticallyIcon,props:{styles:e.S({default:""})}});const k=t=>{const l=(a,i)=>({_id:x.generateUUID(),_parent:a,_type:"TableCell",styles:"#styles:,",content:`${t==="TableHead"?"Table Head":"Table Cell "+i}`}),o=a=>{const i=x.generateUUID(),c={_type:"TableRow",_id:i,styles:"#styles:,border-b"};return a&&(c._parent=a),[c,l(i,"1"),l(i,"2"),l(i,"3")]},s=a=>{const i=x.generateUUID(),c={_id:i,_type:"TableHead",styles:"#styles:,font-medium"};return a&&(c._parent=a),[c,...o(i)]},r=a=>{const i=x.generateUUID(),c={_id:i,_type:"TableBody",styles:"#styles:,"};return a&&(c._parent=a),[c,...o(i),...o(i)]};if(t==="Table"){const a=x.generateUUID();return[{_id:a,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...s(a),...r(a)]}return t==="TableRow"?o():t==="TableHead"?s():t==="TableBody"?r():[]},V=t=>{const{blockProps:l,children:o,styles:s}=t;return o?u.createElement("table",{...l,...s},o):n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l,text:"TABLE HEAD / BODY"})};d.registerChaiBlock(V,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:m.TableIcon,props:{styles:e.S({default:""})},blocks:k("Table")});const W=t=>{const{blockProps:l,children:o,styles:s}=t;return o?u.createElement("thead",{...l,...s},o):n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l,text:"TABLE ROW"})};d.registerChaiBlock(W,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:m.BorderTopIcon,props:{styles:e.S({default:""})},blocks:k("TableHead")});const G=t=>{const{blockProps:l,children:o,styles:s}=t;return o?u.createElement("tbody",{...l,...s},o):n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l,text:"TABLE ROW"})};d.registerChaiBlock(G,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:m.BorderAllIcon,props:{styles:e.S({default:""})},blocks:k("TableBody")});const Y=t=>{const{blockProps:l,children:o,styles:s}=t;return o?u.createElement("tr",{...l,...s},o):n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l,text:"TABLE CELL"})};d.registerChaiBlock(Y,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:m.ViewHorizontalIcon,props:{styles:e.S({default:"w-full"})},blocks:k("TableRow")});const X=t=>{const{blockProps:l,children:o,content:s,styles:r}=t;return!o&&f.isEmpty(s)?n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:l}):o?u.createElement("td",{...l,...r},o):u.createElement("td",{...l,...r,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(X,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:m.DragHandleHorizontalIcon,props:{styles:e.S({default:""}),content:e.m({title:"Content",default:"Table cell item"})}});const Z=t=>{const{blockProps:l,errorMessage:o,name:s,_type:r,successMessage:a,action:i,styles:c,children:y}=t;let p=y;y||(p=n.jsxRuntimeExports.jsx(e.EmptySlot,{blockProps:{},text:"FORM FIELDS"}));const b={"x-data":"useForm","x-on:submit.prevent":"post"},h={"x-html":"formResponse",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return n.jsxRuntimeExports.jsxs("form",{...b,"data-error":o,"data-success":a,method:"post",action:i,...l,...c,children:[n.jsxRuntimeExports.jsx("div",{...h}),n.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),p]})};d.registerChaiBlock(Z,{type:"Form",label:"Form",category:"core",icon:m.GroupIcon,group:"form",hidden:!0,props:{styles:e.S({default:""}),action:e.u({title:"Submit URL",default:"/api/form/submit"}),errorMessage:e.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:e.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0});const J=t=>{const{blockProps:l,content:o,styles:s,children:r}=t,a={...s,...l};return r?u.createElement("label",a,r):u.createElement("label",{...a,dangerouslySetInnerHTML:{__html:o}})};d.registerChaiBlock(J,{type:"Label",label:"Label",category:"core",icon:m.LetterCaseToggleIcon,group:"form",hidden:!0,props:{styles:e.S({default:""}),content:e.u({title:"Content",default:"Label"})}});const K=t=>{const{blockProps:l,inBuilder:o,label:s,placeholder:r,styles:a,inputStyles:i,icon:c,iconPos:y}=t,p=x.generateUUID(),b={"x-bind:disabled":"formLoading"};return n.jsxRuntimeExports.jsxs("button",{id:p,...b,...i,...a,...l||{},type:o?"button":"submit",placeholder:r,children:[s,c&&n.jsxRuntimeExports.jsx("span",{className:y,dangerouslySetInnerHTML:{__html:c}})]})};d.registerChaiBlock(K,{type:"FormButton",label:"Submit Button",category:"core",icon:m.ButtonIcon,group:"form",hidden:!0,props:{label:e.u({title:"Label",default:"Submit"}),styles:e.S({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:e.T({title:"Icon",default:""}),iconPos:e.f({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const Q=t=>{const{blockProps:l,fieldName:o,label:s,styles:r,inputStyles:a,required:i,checked:c,showLabel:y=!0}=t,p=x.generateUUID();return y?n.jsxRuntimeExports.jsxs("div",{...r,...l,children:[n.jsxRuntimeExports.jsx("input",{...a,name:o,id:p,type:"checkbox",required:i,defaultChecked:c}),s&&s!=="Label"&&n.jsxRuntimeExports.jsx("label",{htmlFor:p,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:p,...l,...a,...r,type:"checkbox",required:i,name:o})};d.registerChaiBlock(Q,{type:"Checkbox",label:"Checkbox",category:"core",icon:m.CheckboxIcon,group:"form",hidden:!0,props:{fieldName:e.u({title:"Field Name",default:"checkbox"}),styles:e.S({default:"flex items-center gap-x-2"}),label:e.u({title:"Label",default:"Label"}),checked:e.r({title:"Checked",default:!1}),required:e.r({title:"Required",default:!1})}});const ee=t=>{const{blockProps:l,label:o,placeholder:s,styles:r,inputStyles:a,showLabel:i,required:c,inputType:y="text",inBuilder:p,fieldName:b}=t,h=x.generateUUID();return!i||y==="submit"?(y==="submit"&&(l.value=o),n.jsxRuntimeExports.jsx("input",{id:h,name:b,readOnly:p,...l,...a,...r,type:y,placeholder:s,required:c})):n.jsxRuntimeExports.jsxs("div",{...r,...l,children:[i&&n.jsxRuntimeExports.jsx("label",{htmlFor:h,children:o}),n.jsxRuntimeExports.jsx("input",{name:b,readOnly:p,...a,id:h,type:y,placeholder:s,required:c})]})};d.registerChaiBlock(ee,{type:"Input",label:"Input",category:"core",icon:m.InputIcon,group:"form",hidden:!0,props:{styles:e.S({default:""}),fieldName:e.u({title:"Field Name",default:"input"}),inputType:e.f({title:"Type",options:f.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],t=>({value:t,title:t})),default:"text"}),value:e.u({title:"Value",default:""}),showLabel:e.r({title:"Show label",default:!0}),inputStyles:e.S({default:"w-full p-1"}),label:e.u({title:"Label",default:"Label"}),placeholder:e.u({title:"Placeholder",default:"Placeholder"}),required:e.r({title:"Required",default:!1})}});const te=t=>{const{blockProps:l,fieldName:o,label:s,styles:r,inputStyles:a,checked:i,required:c,showLabel:y=!0}=t,p=x.generateUUID();return y?n.jsxRuntimeExports.jsxs("div",{...r,...l,children:[n.jsxRuntimeExports.jsx("input",{...a,name:o,id:p,type:"radio",required:c,defaultChecked:i}),s&&n.jsxRuntimeExports.jsx("label",{htmlFor:p,children:s})]}):n.jsxRuntimeExports.jsx("input",{id:p,...l,...a,...r,type:"radio",required:c,checked:i,name:o})};d.registerChaiBlock(te,{type:"Radio",label:"Radio",category:"core",icon:m.RadiobuttonIcon,group:"form",hidden:!0,props:{styles:e.S({default:"flex items-center w-max gap-x-2"}),fieldName:e.u({title:"Field Name",default:"radio"}),label:e.u({title:"Label",default:"Label"}),checked:e.r({title:"Checked",default:!1}),required:e.r({title:"Required",default:!1})}});const le=t=>{const{blockProps:l,fieldName:o,label:s,placeholder:r,styles:a,inputStyles:i,required:c,showLabel:y,_multiple:p=!1}=t,b=x.generateUUID();return y?n.jsxRuntimeExports.jsxs("div",{...a,children:[y&&n.jsxRuntimeExports.jsx("label",{htmlFor:b,children:s}),n.jsxRuntimeExports.jsxs("select",{...i,id:b,placeholder:r,required:c,multiple:p,name:o,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),f.map(t.options,h=>n.jsxRuntimeExports.jsx("option",{selected:f.get(h,"selected",!1),value:h.value,dangerouslySetInnerHTML:{__html:h.label}},h.value))]})]}):n.jsxRuntimeExports.jsxs("select",{id:b,...a,...l,placeholder:r,required:c,multiple:p,name:o,children:[n.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),f.map(t.options,h=>n.jsxRuntimeExports.jsx("option",{selected:f.get(h,"selected",!1),value:h.value,dangerouslySetInnerHTML:{__html:h.label}},h.value))]})};d.registerChaiBlock(le,{type:"Select",label:"Select",category:"core",icon:m.DropdownMenuIcon,group:"form",hidden:!0,props:{styles:e.S({default:""}),fieldName:e.u({title:"Field Name",default:"select"}),showLabel:e.r({title:"Show label",default:!0}),inputStyles:e.S({default:"w-full p-1"}),label:e.u({title:"Label",default:"Label"}),placeholder:e.u({title:"Placeholder",default:"Placeholder"}),required:e.r({title:"Required",default:!1}),_multiple:e.r({title:"Multiple Choice",default:!1}),options:e.h({title:"Options",itemProperties:{label:e.u({title:"Label",default:""}),value:e.u({title:"Value",default:""})}})}});const oe=t=>{const{blockProps:l,fieldName:o,label:s,placeholder:r,styles:a,inputStyles:i,_rows:c,showLabel:y}=t,p=x.generateUUID();return y?n.jsxRuntimeExports.jsxs("div",{...a,...l,children:[y&&n.jsxRuntimeExports.jsx("label",{htmlFor:p,children:s}),n.jsxRuntimeExports.jsx("textarea",{name:o,...i,id:p,placeholder:r,rows:c})]}):n.jsxRuntimeExports.jsx("textarea",{id:p,name:o,...l,...i,...a,placeholder:r,rows:c})};d.registerChaiBlock(oe,{type:"TextArea",label:"TextArea",category:"core",icon:m.InputIcon,group:"form",hidden:!0,props:{fieldName:e.u({title:"Field Name",default:"textarea"}),showLabel:e.r({title:"Show label",default:!0}),styles:e.S({default:""}),inputStyles:e.S({default:"w-full p-1"}),label:e.u({title:"Label",default:"Label"}),placeholder:e.u({title:"Placeholder",default:"Placeholder"}),_rows:e.c({title:"Rows",default:3})}});const se=f.noop;exports.loadWebBlocks=se;
|