@drawbridge/components 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/components/styles.css +364 -2
  2. package/dist/advertisement.js +3 -1
  3. package/dist/advertisement.mjs +3 -1
  4. package/dist/bridge/advertisements.js +2 -0
  5. package/dist/bridge/advertisements.mjs +2 -0
  6. package/dist/bridge/countdown.js +2 -1
  7. package/dist/bridge/countdown.mjs +2 -1
  8. package/dist/bridge/form-subdomain-embed.js +18 -20
  9. package/dist/bridge/form-subdomain-embed.mjs +18 -20
  10. package/dist/bridge/form-subdomain-header.js +24 -1
  11. package/dist/bridge/form-subdomain-header.mjs +24 -1
  12. package/dist/bridge/form-subdomain-missions.js +538 -0
  13. package/dist/bridge/form-subdomain-missions.mjs +502 -0
  14. package/dist/bridge/form-subdomain.js +530 -220
  15. package/dist/bridge/form-subdomain.mjs +533 -222
  16. package/dist/bridge/lib/entry.js +59 -0
  17. package/dist/bridge/lib/entry.mjs +29 -0
  18. package/dist/bridge/lib/location.js +38 -0
  19. package/dist/bridge/lib/location.mjs +13 -0
  20. package/dist/bridge/lib/order.js +71 -0
  21. package/dist/bridge/lib/order.mjs +44 -0
  22. package/dist/bridge/lib/url.js +9 -0
  23. package/dist/bridge/lib/url.mjs +7 -0
  24. package/dist/bridge/share-button.js +5 -3
  25. package/dist/bridge/share-button.mjs +5 -3
  26. package/dist/bridge/subdomain-content.js +7 -6
  27. package/dist/bridge/subdomain-content.mjs +7 -6
  28. package/dist/bridge/template-layout.js +59 -21
  29. package/dist/bridge/template-layout.mjs +59 -21
  30. package/dist/bridge/template-modal.js +42 -76
  31. package/dist/bridge/template-modal.mjs +39 -73
  32. package/dist/bridge/template-preview.js +208 -0
  33. package/dist/bridge/template-preview.mjs +173 -0
  34. package/dist/bridge/template-subdomain-gallery.js +6 -2
  35. package/dist/bridge/template-subdomain-gallery.mjs +6 -2
  36. package/dist/bridge/template-subdomain-link.js +6 -1
  37. package/dist/bridge/template-subdomain-link.mjs +6 -1
  38. package/dist/bridge/template-subdomain.js +20 -15
  39. package/dist/bridge/template-subdomain.mjs +20 -15
  40. package/dist/dashboard/accordion.js +74 -39
  41. package/dist/dashboard/accordion.mjs +74 -39
  42. package/dist/dashboard/avatar.js +109 -3
  43. package/dist/dashboard/avatar.mjs +106 -4
  44. package/dist/dashboard/buttons-subscription.js +384 -0
  45. package/dist/dashboard/buttons-subscription.mjs +349 -0
  46. package/dist/dashboard/card-campaign-switch.js +265 -0
  47. package/dist/dashboard/card-campaign-switch.mjs +231 -0
  48. package/dist/dashboard/card-order.js +28 -11
  49. package/dist/dashboard/card-order.mjs +28 -11
  50. package/dist/dashboard/card-section.js +26 -2
  51. package/dist/dashboard/card-section.mjs +26 -2
  52. package/dist/dashboard/card-tile.js +6 -7
  53. package/dist/dashboard/card-tile.mjs +6 -7
  54. package/dist/dashboard/connection-workflows.js +196 -0
  55. package/dist/dashboard/connection-workflows.mjs +162 -0
  56. package/dist/dashboard/device.js +95 -0
  57. package/dist/dashboard/device.mjs +72 -0
  58. package/dist/dashboard/form-admin-campaign.js +19 -50
  59. package/dist/dashboard/form-admin-campaign.mjs +20 -51
  60. package/dist/dashboard/form-ai.js +9 -6
  61. package/dist/dashboard/form-ai.mjs +9 -6
  62. package/dist/dashboard/form-auth.js +35 -25
  63. package/dist/dashboard/form-auth.mjs +36 -26
  64. package/dist/dashboard/form-file.js +10 -1
  65. package/dist/dashboard/form-file.mjs +10 -1
  66. package/dist/dashboard/form-filters-analytics.js +14 -1
  67. package/dist/dashboard/form-filters-analytics.mjs +15 -2
  68. package/dist/dashboard/form-organization-campaign-advertisement.js +15 -1
  69. package/dist/dashboard/form-organization-campaign-advertisement.mjs +16 -2
  70. package/dist/dashboard/form-organization-campaign-agreement.js +215 -164
  71. package/dist/dashboard/form-organization-campaign-agreement.mjs +215 -164
  72. package/dist/dashboard/form-organization-campaign-field-email.js +0 -34
  73. package/dist/dashboard/form-organization-campaign-field-email.mjs +0 -34
  74. package/dist/dashboard/form-organization-campaign-field-list.js +466 -0
  75. package/dist/dashboard/form-organization-campaign-field-list.mjs +437 -0
  76. package/dist/dashboard/form-organization-campaign-field-phone.js +0 -34
  77. package/dist/dashboard/form-organization-campaign-field-phone.mjs +0 -34
  78. package/dist/dashboard/form-organization-campaign-field-remove.js +66 -0
  79. package/dist/dashboard/form-organization-campaign-field-remove.mjs +33 -0
  80. package/dist/dashboard/form-organization-campaign-integration-age.js +6 -12
  81. package/dist/dashboard/form-organization-campaign-integration-age.mjs +6 -12
  82. package/dist/dashboard/form-organization-campaign-integration-enable.js +52 -24
  83. package/dist/dashboard/form-organization-campaign-integration-enable.mjs +54 -26
  84. package/dist/dashboard/form-organization-campaign-integration-geocode.js +6 -12
  85. package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +6 -12
  86. package/dist/dashboard/form-organization-campaign-integration-gtm.js +6 -12
  87. package/dist/dashboard/form-organization-campaign-integration-gtm.mjs +6 -12
  88. package/dist/dashboard/form-organization-campaign-link.js +7 -1
  89. package/dist/dashboard/form-organization-campaign-link.mjs +7 -1
  90. package/dist/dashboard/form-organization-campaign-mission.js +291 -0
  91. package/dist/dashboard/form-organization-campaign-mission.mjs +258 -0
  92. package/dist/dashboard/form-organization-campaign-page-embed.js +13 -2
  93. package/dist/dashboard/form-organization-campaign-page-embed.mjs +12 -1
  94. package/dist/dashboard/form-organization-campaign-page.js +20 -11
  95. package/dist/dashboard/form-organization-campaign-page.mjs +20 -11
  96. package/dist/dashboard/form-organization-campaign-prize-edit.js +12 -1
  97. package/dist/dashboard/form-organization-campaign-prize-edit.mjs +12 -1
  98. package/dist/dashboard/form-organization-campaign-section.js +223 -0
  99. package/dist/dashboard/form-organization-campaign-section.mjs +194 -0
  100. package/dist/dashboard/form-organization-campaign.js +114 -469
  101. package/dist/dashboard/form-organization-campaign.mjs +113 -467
  102. package/dist/dashboard/form-organization-export.js +4 -7
  103. package/dist/dashboard/form-organization-export.mjs +4 -7
  104. package/dist/dashboard/form-organization-identity.js +46 -51
  105. package/dist/dashboard/form-organization-identity.mjs +46 -51
  106. package/dist/dashboard/form-organization-workflow.js +518 -686
  107. package/dist/dashboard/form-organization-workflow.mjs +517 -682
  108. package/dist/dashboard/form-organization.js +82 -110
  109. package/dist/dashboard/form-organization.mjs +81 -109
  110. package/dist/dashboard/form-otc.js +4 -5
  111. package/dist/dashboard/form-otc.mjs +4 -5
  112. package/dist/dashboard/form-payment-methods.js +20 -9
  113. package/dist/dashboard/form-payment-methods.mjs +20 -9
  114. package/dist/dashboard/form-stripe.js +30 -0
  115. package/dist/dashboard/form-stripe.mjs +26 -0
  116. package/dist/dashboard/input-array.js +4 -2
  117. package/dist/dashboard/input-array.mjs +4 -2
  118. package/dist/dashboard/input-combobox.js +7 -3
  119. package/dist/dashboard/input-combobox.mjs +7 -3
  120. package/dist/dashboard/input-date.js +7 -0
  121. package/dist/dashboard/input-date.mjs +7 -0
  122. package/dist/dashboard/input-fields.js +80 -20
  123. package/dist/dashboard/input-fields.mjs +80 -20
  124. package/dist/dashboard/input-file.js +21 -1
  125. package/dist/dashboard/input-file.mjs +21 -1
  126. package/dist/dashboard/input-font.js +10 -1
  127. package/dist/dashboard/input-font.mjs +10 -1
  128. package/dist/dashboard/lib/item-list.js +57 -0
  129. package/dist/dashboard/lib/item-list.mjs +33 -0
  130. package/dist/dashboard/lib/menu.js +50 -0
  131. package/dist/dashboard/lib/menu.mjs +26 -0
  132. package/dist/dashboard/locked.js +82 -0
  133. package/dist/dashboard/locked.mjs +53 -0
  134. package/dist/dashboard/menu.js +72 -19
  135. package/dist/dashboard/menu.mjs +72 -19
  136. package/dist/dashboard/note-ai.js +69 -0
  137. package/dist/dashboard/note-ai.mjs +36 -0
  138. package/dist/dashboard/preview.js +419 -0
  139. package/dist/dashboard/preview.mjs +384 -0
  140. package/dist/dashboard/steps.js +39 -13
  141. package/dist/dashboard/steps.mjs +37 -12
  142. package/dist/dashboard/table-contacts.js +136 -0
  143. package/dist/dashboard/table-contacts.mjs +103 -0
  144. package/dist/dashboard/template-not-found.js +4 -2
  145. package/dist/dashboard/template-not-found.mjs +4 -2
  146. package/dist/dashboard/template-socket.js +20 -7
  147. package/dist/dashboard/template-socket.mjs +20 -7
  148. package/dist/icons/desktop.js +46 -0
  149. package/dist/icons/desktop.mjs +27 -0
  150. package/dist/icons/phone.js +46 -0
  151. package/dist/icons/phone.mjs +27 -0
  152. package/dist/icons/puzzle-piece.js +46 -0
  153. package/dist/icons/puzzle-piece.mjs +27 -0
  154. package/dist/icons/tablet.js +46 -0
  155. package/dist/icons/tablet.mjs +27 -0
  156. package/dist/icons/users.js +46 -0
  157. package/dist/icons/users.mjs +27 -0
  158. package/dist/input-checkbox.js +1 -0
  159. package/dist/input-checkbox.mjs +1 -0
  160. package/dist/input-code.js +101 -0
  161. package/dist/input-code.mjs +78 -0
  162. package/dist/input-text.js +2 -1
  163. package/dist/input-text.mjs +2 -1
  164. package/dist/shared/input-checkbox-list.js +0 -1
  165. package/dist/shared/input-checkbox-list.mjs +0 -1
  166. package/dist/shared/input-switch.js +6 -1
  167. package/dist/shared/input-switch.mjs +6 -1
  168. package/dist/shared/lib/campaign.js +117 -0
  169. package/dist/shared/lib/campaign.mjs +91 -0
  170. package/dist/shared/lib/helpers.js +14 -2
  171. package/dist/shared/lib/helpers.mjs +13 -2
  172. package/package.json +133 -13
  173. package/types/bridge/form-subdomain-header.d.ts +2 -0
  174. package/types/bridge/form-subdomain-missions.d.ts +36 -0
  175. package/types/bridge/form-subdomain.d.ts +23 -1
  176. package/types/bridge/lib/entry.d.ts +26 -0
  177. package/types/bridge/lib/location.d.ts +13 -0
  178. package/types/bridge/lib/order.d.ts +30 -0
  179. package/types/bridge/lib/url.d.ts +19 -0
  180. package/types/bridge/template-modal.d.ts +1 -1
  181. package/types/bridge/template-preview.d.ts +10 -0
  182. package/types/bridge/template-subdomain-link.d.ts +2 -0
  183. package/types/dashboard/accordion.d.ts +2 -0
  184. package/types/dashboard/avatar.d.ts +18 -2
  185. package/types/dashboard/buttons-subscription.d.ts +22 -0
  186. package/types/dashboard/card-campaign-switch.d.ts +32 -0
  187. package/types/dashboard/card-order.d.ts +11 -0
  188. package/types/dashboard/card-section.d.ts +2 -0
  189. package/types/dashboard/connection-workflows.d.ts +33 -0
  190. package/types/dashboard/device.d.ts +12 -0
  191. package/types/dashboard/form-admin-campaign.d.ts +3 -2
  192. package/types/dashboard/form-ai.d.ts +2 -2
  193. package/types/dashboard/form-organization-campaign-agreement.d.ts +18 -12
  194. package/types/dashboard/form-organization-campaign-field-email.d.ts +1 -2
  195. package/types/dashboard/form-organization-campaign-field-list.d.ts +36 -0
  196. package/types/dashboard/form-organization-campaign-field-phone.d.ts +1 -2
  197. package/types/dashboard/form-organization-campaign-field-remove.d.ts +22 -0
  198. package/types/dashboard/form-organization-campaign-field-select.d.ts +2 -1
  199. package/types/dashboard/form-organization-campaign-field-textarea.d.ts +2 -1
  200. package/types/dashboard/form-organization-campaign-integration-age.d.ts +3 -3
  201. package/types/dashboard/form-organization-campaign-integration-enable.d.ts +3 -3
  202. package/types/dashboard/form-organization-campaign-mission.d.ts +40 -0
  203. package/types/dashboard/form-organization-campaign-section.d.ts +27 -0
  204. package/types/dashboard/form-organization-campaign.d.ts +27 -17
  205. package/types/dashboard/form-organization-identity.d.ts +2 -0
  206. package/types/dashboard/form-organization-workflow.d.ts +43 -47
  207. package/types/dashboard/form-organization.d.ts +7 -2
  208. package/types/dashboard/form-stripe.d.ts +3 -0
  209. package/types/dashboard/input-combobox.d.ts +2 -0
  210. package/types/dashboard/input-date.d.ts +2 -0
  211. package/types/dashboard/input-fields.d.ts +3 -2
  212. package/types/dashboard/input-file.d.ts +4 -0
  213. package/types/dashboard/lib/item-list.d.ts +14 -0
  214. package/types/dashboard/lib/menu.d.ts +17 -0
  215. package/types/dashboard/locked.d.ts +10 -0
  216. package/types/dashboard/menu.d.ts +10 -2
  217. package/types/dashboard/note-ai.d.ts +15 -0
  218. package/types/dashboard/preview.d.ts +33 -0
  219. package/types/dashboard/steps.d.ts +19 -4
  220. package/types/dashboard/table-cell-title.d.ts +2 -2
  221. package/types/dashboard/table-contacts.d.ts +2 -0
  222. package/types/icons/desktop.d.ts +5 -0
  223. package/types/icons/phone.d.ts +5 -0
  224. package/types/icons/puzzle-piece.d.ts +5 -0
  225. package/types/icons/tablet.d.ts +5 -0
  226. package/types/icons/users.d.ts +5 -0
  227. package/types/input-code.d.ts +23 -0
  228. package/types/shared/input-switch.d.ts +2 -0
  229. package/types/shared/lib/campaign.d.ts +35 -0
  230. package/types/shared/lib/helpers.d.ts +3 -0
  231. package/dist/dashboard/card-integration.js +0 -187
  232. package/dist/dashboard/card-integration.mjs +0 -158
  233. package/dist/dashboard/iframe.js +0 -159
  234. package/dist/dashboard/iframe.mjs +0 -130
  235. package/types/dashboard/card-integration.d.ts +0 -24
  236. package/types/dashboard/iframe.d.ts +0 -18
@@ -0,0 +1,502 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { request } from "@drawbridge/drawbridge-utils/fetch";
5
+ import { CODE_CHANNELS, COMPLETIONS, entriesText, missions as manifests } from "@drawbridge/drawbridge-utils/missions";
6
+ import Button from "../shared/button.mjs";
7
+ import CopyToClipboard from "../shared/copy-to-clipboard.mjs";
8
+ import Error from "../shared/error.mjs";
9
+ import Check from "../icons/check.mjs";
10
+ import ChevronLeft from "../icons/chevron-left.mjs";
11
+ import ChevronRight from "../icons/chevron-right.mjs";
12
+ import Loader from "../icons/loader.mjs";
13
+ import Star from "../icons/star.mjs";
14
+ import InputGroup from "../input-group.mjs";
15
+ import InputCode from "../input-code.mjs";
16
+ import ShareButton from "./share-button.mjs";
17
+ import { FormSubdomainHeader } from "./form-subdomain-header.mjs";
18
+ import { missionEndpoint } from "./lib/url.mjs";
19
+ import { inputStyle } from "../styles.mjs";
20
+ const screenFor = (type) => {
21
+ var _a;
22
+ return {
23
+ [COMPLETIONS.code]: "send",
24
+ [COMPLETIONS.referral]: "share"
25
+ }[(_a = manifests[type]) == null ? void 0 : _a.completion] || "missions";
26
+ };
27
+ const openingScreen = (items = [], type) => {
28
+ const item = items.find((row) => row.type === type);
29
+ return item && !item.completed ? screenFor(type) : "missions";
30
+ };
31
+ const pillText = (item, completed) => (completed ? "+" : "") + Number((item == null ? void 0 : item.entries) || 0);
32
+ const Pill = ({ children, style }) => {
33
+ var _a, _b, _c, _d;
34
+ return /* @__PURE__ */ jsx(
35
+ "span",
36
+ {
37
+ ...{
38
+ className: "inline-flex items-center justify-center min-w-8 h-6 px-2 rounded-full text-sm shrink-0",
39
+ style: {
40
+ backgroundColor: ((_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb) || "currentColor",
41
+ color: ((_d = (_c = style == null ? void 0 : style.background) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb) || "white"
42
+ }
43
+ },
44
+ children
45
+ }
46
+ );
47
+ };
48
+ const Back = ({ onClick, style }) => {
49
+ var _a, _b;
50
+ return /* @__PURE__ */ jsx(
51
+ "div",
52
+ {
53
+ ...{
54
+ className: "pb-3 border-b",
55
+ style: {
56
+ borderColor: (_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb
57
+ }
58
+ },
59
+ children: /* @__PURE__ */ jsx(
60
+ Button,
61
+ {
62
+ ...{
63
+ icon: ChevronLeft,
64
+ inline: true,
65
+ onClick,
66
+ reverse: true,
67
+ variant: "link"
68
+ },
69
+ children: "Back to missions"
70
+ }
71
+ )
72
+ }
73
+ );
74
+ };
75
+ const Centre = ({ children }) => /* @__PURE__ */ jsx(
76
+ "div",
77
+ {
78
+ ...{
79
+ className: "space-y-1 text-center"
80
+ },
81
+ children
82
+ }
83
+ );
84
+ const Strong = ({ children, className }) => /* @__PURE__ */ jsx(
85
+ "p",
86
+ {
87
+ ...{
88
+ className: "font-bold " + (className || "")
89
+ },
90
+ children
91
+ }
92
+ );
93
+ const CodeStep = ({ disabled, error, onComplete, style }) => {
94
+ const [code, setCode] = useState("");
95
+ return /* @__PURE__ */ jsx(
96
+ InputGroup,
97
+ {
98
+ ...{
99
+ error,
100
+ input: /* @__PURE__ */ jsx(
101
+ InputCode,
102
+ {
103
+ ...{
104
+ autoFocus: true,
105
+ disabled,
106
+ onChange: setCode,
107
+ onComplete,
108
+ style,
109
+ value: code
110
+ }
111
+ }
112
+ ),
113
+ label: "Verification code",
114
+ style
115
+ }
116
+ }
117
+ );
118
+ };
119
+ const FormSubdomainMissions = ({
120
+ advertisements,
121
+ button,
122
+ contact,
123
+ initial,
124
+ message,
125
+ missions: items = [],
126
+ shareLink,
127
+ slug,
128
+ style,
129
+ subdomain,
130
+ title,
131
+ token
132
+ }) => {
133
+ var _a, _b;
134
+ const [screen, setScreen] = useState(openingScreen(items, initial));
135
+ const [mission, setMission] = useState(initial);
136
+ const [completed, setCompleted] = useState(items.filter((item2) => item2.completed).map((item2) => item2.type));
137
+ const [busy, setBusy] = useState(false);
138
+ const [error, setError] = useState(null);
139
+ const [attempt, setAttempt] = useState(0);
140
+ const manifest = manifests[mission];
141
+ const item = items.find((row) => row.type === mission);
142
+ const words = (manifest == null ? void 0 : manifest.words) || {};
143
+ const go = (next, type = mission) => {
144
+ setError(null);
145
+ setMission(type);
146
+ setScreen(next);
147
+ };
148
+ const back = () => go("missions");
149
+ const header = (text) => /* @__PURE__ */ jsx(
150
+ FormSubdomainHeader,
151
+ {
152
+ ...{
153
+ button,
154
+ style,
155
+ title: text
156
+ }
157
+ }
158
+ );
159
+ const call = async (action, body = {}) => request({
160
+ body: {
161
+ ...body,
162
+ token
163
+ },
164
+ endpoint: missionEndpoint({ action, slug, subdomain, type: mission }),
165
+ method: "POST"
166
+ });
167
+ const send = async () => {
168
+ setBusy(true);
169
+ try {
170
+ await call("send");
171
+ setError(null);
172
+ setAttempt(attempt + 1);
173
+ setScreen("code");
174
+ } catch ({ message: text }) {
175
+ setError(text);
176
+ }
177
+ setBusy(false);
178
+ };
179
+ const confirm = async (code) => {
180
+ setBusy(true);
181
+ try {
182
+ await call("confirm", { code });
183
+ setCompleted([.../* @__PURE__ */ new Set([...completed, mission])]);
184
+ go("done");
185
+ } catch ({ message: text }) {
186
+ setError(text || "Verification code incorrect");
187
+ setAttempt(attempt + 1);
188
+ }
189
+ setBusy(false);
190
+ };
191
+ if (screen === "send") return /* @__PURE__ */ jsxs(
192
+ "div",
193
+ {
194
+ ...{
195
+ className: "space-y-6"
196
+ },
197
+ children: [
198
+ header(words.title),
199
+ /* @__PURE__ */ jsx(Back, { ...{ onClick: back, style } }),
200
+ /* @__PURE__ */ jsxs(Centre, { children: [
201
+ /* @__PURE__ */ jsx(Strong, { children: words.heading }),
202
+ /* @__PURE__ */ jsx("p", { children: words.send }),
203
+ /* @__PURE__ */ jsx(Strong, { ...{ className: "break-all" }, children: contact == null ? void 0 : contact[CODE_CHANNELS[manifest == null ? void 0 : manifest.channel]] })
204
+ ] }),
205
+ error && /* @__PURE__ */ jsx(
206
+ Error,
207
+ {
208
+ ...{
209
+ error,
210
+ style
211
+ }
212
+ }
213
+ ),
214
+ (item == null ? void 0 : item.refused) ? /* @__PURE__ */ jsx(
215
+ "p",
216
+ {
217
+ ...{
218
+ className: "text-center"
219
+ },
220
+ children: words.refused
221
+ }
222
+ ) : /* @__PURE__ */ jsx(
223
+ Button,
224
+ {
225
+ ...{
226
+ loading: busy,
227
+ onClick: send,
228
+ style
229
+ },
230
+ children: "Verify"
231
+ }
232
+ )
233
+ ]
234
+ }
235
+ );
236
+ if (screen === "code") return /* @__PURE__ */ jsxs(
237
+ "div",
238
+ {
239
+ ...{
240
+ className: "space-y-6"
241
+ },
242
+ children: [
243
+ header(words.title),
244
+ /* @__PURE__ */ jsx(Back, { ...{ onClick: back, style } }),
245
+ /* @__PURE__ */ jsxs(Centre, { children: [
246
+ /* @__PURE__ */ jsx(Strong, { children: "Enter verification code" }),
247
+ /* @__PURE__ */ jsx("p", { children: words.sent })
248
+ ] }),
249
+ /* @__PURE__ */ jsx(
250
+ CodeStep,
251
+ {
252
+ ...{
253
+ disabled: busy,
254
+ error,
255
+ onComplete: confirm,
256
+ style
257
+ }
258
+ },
259
+ attempt
260
+ ),
261
+ busy && /* @__PURE__ */ jsx(
262
+ "div",
263
+ {
264
+ ...{
265
+ className: "flex justify-center"
266
+ },
267
+ children: /* @__PURE__ */ jsx(
268
+ Loader,
269
+ {
270
+ ...{
271
+ className: "w-5 h-5 animate-spin"
272
+ }
273
+ }
274
+ )
275
+ }
276
+ ),
277
+ /* @__PURE__ */ jsxs(
278
+ "p",
279
+ {
280
+ ...{
281
+ className: "text-sm text-center"
282
+ },
283
+ children: [
284
+ "Didn't get it? ",
285
+ /* @__PURE__ */ jsx(
286
+ Button,
287
+ {
288
+ ...{
289
+ disabled: busy,
290
+ inline: true,
291
+ onClick: send,
292
+ variant: "link"
293
+ },
294
+ children: "Resend code"
295
+ }
296
+ )
297
+ ]
298
+ }
299
+ )
300
+ ]
301
+ }
302
+ );
303
+ if (screen === "share") return /* @__PURE__ */ jsxs(
304
+ "div",
305
+ {
306
+ ...{
307
+ className: "space-y-6"
308
+ },
309
+ children: [
310
+ header(words.title),
311
+ /* @__PURE__ */ jsx(Back, { ...{ onClick: back, style } }),
312
+ /* @__PURE__ */ jsxs(Centre, { children: [
313
+ /* @__PURE__ */ jsx(Strong, { children: words.title }),
314
+ /* @__PURE__ */ jsx("p", { children: String(words.pays || "").replace("{entries}", entriesText(item == null ? void 0 : item.entries)) })
315
+ ] }),
316
+ shareLink && /* @__PURE__ */ jsx(
317
+ "div",
318
+ {
319
+ ...{
320
+ className: "px-4 py-3 border",
321
+ style: inputStyle(style)
322
+ },
323
+ children: /* @__PURE__ */ jsx(
324
+ CopyToClipboard,
325
+ {
326
+ ...{
327
+ className: "justify-between",
328
+ message: "Copied",
329
+ style,
330
+ value: shareLink
331
+ },
332
+ children: /* @__PURE__ */ jsx(
333
+ "span",
334
+ {
335
+ ...{
336
+ className: "truncate"
337
+ },
338
+ children: shareLink
339
+ }
340
+ )
341
+ }
342
+ )
343
+ }
344
+ ),
345
+ /* @__PURE__ */ jsx(
346
+ ShareButton,
347
+ {
348
+ ...{
349
+ style,
350
+ values: {
351
+ url: shareLink
352
+ }
353
+ }
354
+ }
355
+ )
356
+ ]
357
+ }
358
+ );
359
+ if (screen === "done") return /* @__PURE__ */ jsxs(
360
+ "div",
361
+ {
362
+ ...{
363
+ className: "space-y-6"
364
+ },
365
+ children: [
366
+ header("Thank you!"),
367
+ /* @__PURE__ */ jsx(Back, { ...{ onClick: back, style } }),
368
+ /* @__PURE__ */ jsxs(Centre, { children: [
369
+ /* @__PURE__ */ jsx(Strong, { children: "Mission accomplished!" }),
370
+ /* @__PURE__ */ jsx("p", { children: "Your bonus entries are in. Go back to missions to earn more." })
371
+ ] })
372
+ ]
373
+ }
374
+ );
375
+ return /* @__PURE__ */ jsxs(
376
+ "div",
377
+ {
378
+ ...{
379
+ className: "space-y-6"
380
+ },
381
+ children: [
382
+ header(title),
383
+ message && /* @__PURE__ */ jsxs(
384
+ "div",
385
+ {
386
+ ...{
387
+ className: "flex flex-col items-center gap-3 text-center"
388
+ },
389
+ children: [
390
+ /* @__PURE__ */ jsx(
391
+ Star,
392
+ {
393
+ ...{
394
+ "aria-hidden": true,
395
+ className: "w-7 h-7"
396
+ }
397
+ }
398
+ ),
399
+ /* @__PURE__ */ jsx(
400
+ "p",
401
+ {
402
+ ...{
403
+ "aria-live": "polite",
404
+ role: "alert"
405
+ },
406
+ children: message
407
+ }
408
+ )
409
+ ]
410
+ }
411
+ ),
412
+ /* @__PURE__ */ jsx(
413
+ "ul",
414
+ {
415
+ ...{
416
+ className: "divide-y",
417
+ style: {
418
+ borderColor: (_b = (_a = style == null ? void 0 : style.text) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb
419
+ }
420
+ },
421
+ children: items.filter((row) => manifests[row.type]).map((row, index) => {
422
+ var _a2;
423
+ const finished = completed.includes(row.type);
424
+ const opens = screenFor(row.type);
425
+ const Mark = finished ? Check : ChevronRight;
426
+ const content = /* @__PURE__ */ jsxs(
427
+ "span",
428
+ {
429
+ ...{
430
+ className: "flex w-full items-center gap-4 text-left " + (index ? "py-4" : "pb-4")
431
+ },
432
+ children: [
433
+ /* @__PURE__ */ jsxs(
434
+ "span",
435
+ {
436
+ ...{
437
+ className: "flex items-center gap-4 flex-1 min-w-0" + (finished ? " opacity-40" : "")
438
+ },
439
+ children: [
440
+ /* @__PURE__ */ jsx(Pill, { ...{ style }, children: pillText(row, finished) }),
441
+ /* @__PURE__ */ jsx(
442
+ "span",
443
+ {
444
+ ...{
445
+ className: "text-sm"
446
+ },
447
+ children: manifests[row.type].sentence
448
+ }
449
+ )
450
+ ]
451
+ }
452
+ ),
453
+ (finished || opens !== "missions") && /* @__PURE__ */ jsx(Pill, { ...{ style }, children: /* @__PURE__ */ jsx(
454
+ Mark,
455
+ {
456
+ ...{
457
+ "aria-hidden": true,
458
+ className: "w-4 h-4"
459
+ }
460
+ }
461
+ ) })
462
+ ]
463
+ }
464
+ );
465
+ return /* @__PURE__ */ jsx(
466
+ "li",
467
+ {
468
+ ...{
469
+ style: {
470
+ borderColor: "inherit"
471
+ }
472
+ },
473
+ children: finished || opens === "missions" ? content : /* @__PURE__ */ jsx(
474
+ Button,
475
+ {
476
+ ...{
477
+ "aria-label": ((_a2 = manifests[row.type].words) == null ? void 0 : _a2.title) || manifests[row.type].title,
478
+ onClick: () => go(opens, row.type),
479
+ variant: "link"
480
+ },
481
+ children: content
482
+ }
483
+ )
484
+ },
485
+ row.type
486
+ );
487
+ })
488
+ }
489
+ ),
490
+ advertisements
491
+ ]
492
+ }
493
+ );
494
+ };
495
+ var form_subdomain_missions_default = FormSubdomainMissions;
496
+ export {
497
+ FormSubdomainMissions,
498
+ form_subdomain_missions_default as default,
499
+ openingScreen,
500
+ pillText,
501
+ screenFor
502
+ };