@drawbridge/components 0.1.12 → 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.
- package/components/styles.css +364 -2
- package/dist/advertisement.js +3 -1
- package/dist/advertisement.mjs +3 -1
- package/dist/bridge/advertisements.js +2 -0
- package/dist/bridge/advertisements.mjs +2 -0
- package/dist/bridge/countdown.js +2 -1
- package/dist/bridge/countdown.mjs +2 -1
- package/dist/bridge/form-subdomain-embed.js +18 -20
- package/dist/bridge/form-subdomain-embed.mjs +18 -20
- package/dist/bridge/form-subdomain-header.js +24 -1
- package/dist/bridge/form-subdomain-header.mjs +24 -1
- package/dist/bridge/form-subdomain-missions.js +538 -0
- package/dist/bridge/form-subdomain-missions.mjs +502 -0
- package/dist/bridge/form-subdomain.js +530 -220
- package/dist/bridge/form-subdomain.mjs +533 -222
- package/dist/bridge/lib/entry.js +59 -0
- package/dist/bridge/lib/entry.mjs +29 -0
- package/dist/bridge/lib/location.js +38 -0
- package/dist/bridge/lib/location.mjs +13 -0
- package/dist/bridge/lib/order.js +71 -0
- package/dist/bridge/lib/order.mjs +44 -0
- package/dist/bridge/lib/url.js +9 -0
- package/dist/bridge/lib/url.mjs +7 -0
- package/dist/bridge/share-button.js +5 -3
- package/dist/bridge/share-button.mjs +5 -3
- package/dist/bridge/subdomain-content.js +7 -6
- package/dist/bridge/subdomain-content.mjs +7 -6
- package/dist/bridge/template-layout.js +59 -21
- package/dist/bridge/template-layout.mjs +59 -21
- package/dist/bridge/template-modal.js +42 -76
- package/dist/bridge/template-modal.mjs +39 -73
- package/dist/bridge/template-preview.js +208 -0
- package/dist/bridge/template-preview.mjs +173 -0
- package/dist/bridge/template-subdomain-gallery.js +6 -2
- package/dist/bridge/template-subdomain-gallery.mjs +6 -2
- package/dist/bridge/template-subdomain-link.js +6 -1
- package/dist/bridge/template-subdomain-link.mjs +6 -1
- package/dist/bridge/template-subdomain.js +20 -15
- package/dist/bridge/template-subdomain.mjs +20 -15
- package/dist/dashboard/accordion.js +74 -39
- package/dist/dashboard/accordion.mjs +74 -39
- package/dist/dashboard/avatar.js +109 -3
- package/dist/dashboard/avatar.mjs +106 -4
- package/dist/dashboard/buttons-subscription.js +384 -0
- package/dist/dashboard/buttons-subscription.mjs +349 -0
- package/dist/dashboard/card-campaign-switch.js +265 -0
- package/dist/dashboard/card-campaign-switch.mjs +231 -0
- package/dist/dashboard/card-order.js +28 -11
- package/dist/dashboard/card-order.mjs +28 -11
- package/dist/dashboard/card-section.js +26 -2
- package/dist/dashboard/card-section.mjs +26 -2
- package/dist/dashboard/card-tile.js +6 -7
- package/dist/dashboard/card-tile.mjs +6 -7
- package/dist/dashboard/connection-workflows.js +196 -0
- package/dist/dashboard/connection-workflows.mjs +162 -0
- package/dist/dashboard/device.js +95 -0
- package/dist/dashboard/device.mjs +72 -0
- package/dist/dashboard/form-admin-campaign.js +19 -50
- package/dist/dashboard/form-admin-campaign.mjs +20 -51
- package/dist/dashboard/form-ai.js +9 -6
- package/dist/dashboard/form-ai.mjs +9 -6
- package/dist/dashboard/form-auth.js +35 -25
- package/dist/dashboard/form-auth.mjs +36 -26
- package/dist/dashboard/form-file.js +10 -1
- package/dist/dashboard/form-file.mjs +10 -1
- package/dist/dashboard/form-filters-analytics.js +14 -1
- package/dist/dashboard/form-filters-analytics.mjs +15 -2
- package/dist/dashboard/form-organization-campaign-advertisement.js +15 -1
- package/dist/dashboard/form-organization-campaign-advertisement.mjs +16 -2
- package/dist/dashboard/form-organization-campaign-agreement.js +215 -164
- package/dist/dashboard/form-organization-campaign-agreement.mjs +215 -164
- package/dist/dashboard/form-organization-campaign-field-email.js +0 -34
- package/dist/dashboard/form-organization-campaign-field-email.mjs +0 -34
- package/dist/dashboard/form-organization-campaign-field-list.js +466 -0
- package/dist/dashboard/form-organization-campaign-field-list.mjs +437 -0
- package/dist/dashboard/form-organization-campaign-field-phone.js +0 -34
- package/dist/dashboard/form-organization-campaign-field-phone.mjs +0 -34
- package/dist/dashboard/form-organization-campaign-field-remove.js +66 -0
- package/dist/dashboard/form-organization-campaign-field-remove.mjs +33 -0
- package/dist/dashboard/form-organization-campaign-integration-age.js +6 -12
- package/dist/dashboard/form-organization-campaign-integration-age.mjs +6 -12
- package/dist/dashboard/form-organization-campaign-integration-enable.js +52 -24
- package/dist/dashboard/form-organization-campaign-integration-enable.mjs +54 -26
- package/dist/dashboard/form-organization-campaign-integration-geocode.js +6 -12
- package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +6 -12
- package/dist/dashboard/form-organization-campaign-integration-gtm.js +6 -12
- package/dist/dashboard/form-organization-campaign-integration-gtm.mjs +6 -12
- package/dist/dashboard/form-organization-campaign-link.js +7 -1
- package/dist/dashboard/form-organization-campaign-link.mjs +7 -1
- package/dist/dashboard/form-organization-campaign-mission.js +291 -0
- package/dist/dashboard/form-organization-campaign-mission.mjs +258 -0
- package/dist/dashboard/form-organization-campaign-page-embed.js +13 -2
- package/dist/dashboard/form-organization-campaign-page-embed.mjs +12 -1
- package/dist/dashboard/form-organization-campaign-page.js +20 -11
- package/dist/dashboard/form-organization-campaign-page.mjs +20 -11
- package/dist/dashboard/form-organization-campaign-prize-edit.js +12 -1
- package/dist/dashboard/form-organization-campaign-prize-edit.mjs +12 -1
- package/dist/dashboard/form-organization-campaign-section.js +223 -0
- package/dist/dashboard/form-organization-campaign-section.mjs +194 -0
- package/dist/dashboard/form-organization-campaign.js +114 -469
- package/dist/dashboard/form-organization-campaign.mjs +113 -467
- package/dist/dashboard/form-organization-export.js +4 -7
- package/dist/dashboard/form-organization-export.mjs +4 -7
- package/dist/dashboard/form-organization-identity.js +46 -51
- package/dist/dashboard/form-organization-identity.mjs +46 -51
- package/dist/dashboard/form-organization-workflow.js +518 -686
- package/dist/dashboard/form-organization-workflow.mjs +517 -682
- package/dist/dashboard/form-organization.js +82 -110
- package/dist/dashboard/form-organization.mjs +81 -109
- package/dist/dashboard/form-otc.js +4 -5
- package/dist/dashboard/form-otc.mjs +4 -5
- package/dist/dashboard/form-payment-methods.js +20 -9
- package/dist/dashboard/form-payment-methods.mjs +20 -9
- package/dist/dashboard/form-stripe.js +30 -0
- package/dist/dashboard/form-stripe.mjs +26 -0
- package/dist/dashboard/input-array.js +4 -2
- package/dist/dashboard/input-array.mjs +4 -2
- package/dist/dashboard/input-combobox.js +7 -3
- package/dist/dashboard/input-combobox.mjs +7 -3
- package/dist/dashboard/input-date.js +7 -0
- package/dist/dashboard/input-date.mjs +7 -0
- package/dist/dashboard/input-fields.js +80 -20
- package/dist/dashboard/input-fields.mjs +80 -20
- package/dist/dashboard/input-file.js +21 -1
- package/dist/dashboard/input-file.mjs +21 -1
- package/dist/dashboard/input-font.js +10 -1
- package/dist/dashboard/input-font.mjs +10 -1
- package/dist/dashboard/lib/item-list.js +57 -0
- package/dist/dashboard/lib/item-list.mjs +33 -0
- package/dist/dashboard/lib/menu.js +50 -0
- package/dist/dashboard/lib/menu.mjs +26 -0
- package/dist/dashboard/locked.js +82 -0
- package/dist/dashboard/locked.mjs +53 -0
- package/dist/dashboard/menu.js +72 -19
- package/dist/dashboard/menu.mjs +72 -19
- package/dist/dashboard/note-ai.js +69 -0
- package/dist/dashboard/note-ai.mjs +36 -0
- package/dist/dashboard/preview.js +419 -0
- package/dist/dashboard/preview.mjs +384 -0
- package/dist/dashboard/steps.js +39 -13
- package/dist/dashboard/steps.mjs +37 -12
- package/dist/dashboard/table-contacts.js +136 -0
- package/dist/dashboard/table-contacts.mjs +103 -0
- package/dist/dashboard/template-not-found.js +4 -2
- package/dist/dashboard/template-not-found.mjs +4 -2
- package/dist/dashboard/template-socket.js +51 -7
- package/dist/dashboard/template-socket.mjs +51 -7
- package/dist/icons/desktop.js +46 -0
- package/dist/icons/desktop.mjs +27 -0
- package/dist/icons/phone.js +46 -0
- package/dist/icons/phone.mjs +27 -0
- package/dist/icons/puzzle-piece.js +46 -0
- package/dist/icons/puzzle-piece.mjs +27 -0
- package/dist/icons/tablet.js +46 -0
- package/dist/icons/tablet.mjs +27 -0
- package/dist/icons/users.js +46 -0
- package/dist/icons/users.mjs +27 -0
- package/dist/input-checkbox.js +1 -0
- package/dist/input-checkbox.mjs +1 -0
- package/dist/input-code.js +101 -0
- package/dist/input-code.mjs +78 -0
- package/dist/input-text.js +2 -1
- package/dist/input-text.mjs +2 -1
- package/dist/shared/input-checkbox-list.js +0 -1
- package/dist/shared/input-checkbox-list.mjs +0 -1
- package/dist/shared/input-switch.js +6 -1
- package/dist/shared/input-switch.mjs +6 -1
- package/dist/shared/lib/campaign.js +117 -0
- package/dist/shared/lib/campaign.mjs +91 -0
- package/dist/shared/lib/helpers.js +14 -2
- package/dist/shared/lib/helpers.mjs +13 -2
- package/package.json +133 -13
- package/types/bridge/form-subdomain-header.d.ts +2 -0
- package/types/bridge/form-subdomain-missions.d.ts +36 -0
- package/types/bridge/form-subdomain.d.ts +23 -1
- package/types/bridge/lib/entry.d.ts +26 -0
- package/types/bridge/lib/location.d.ts +13 -0
- package/types/bridge/lib/order.d.ts +30 -0
- package/types/bridge/lib/url.d.ts +19 -0
- package/types/bridge/template-modal.d.ts +1 -1
- package/types/bridge/template-preview.d.ts +10 -0
- package/types/bridge/template-subdomain-link.d.ts +2 -0
- package/types/dashboard/accordion.d.ts +2 -0
- package/types/dashboard/avatar.d.ts +18 -2
- package/types/dashboard/buttons-subscription.d.ts +22 -0
- package/types/dashboard/card-campaign-switch.d.ts +32 -0
- package/types/dashboard/card-order.d.ts +11 -0
- package/types/dashboard/card-section.d.ts +2 -0
- package/types/dashboard/connection-workflows.d.ts +33 -0
- package/types/dashboard/device.d.ts +12 -0
- package/types/dashboard/form-admin-campaign.d.ts +3 -2
- package/types/dashboard/form-ai.d.ts +2 -2
- package/types/dashboard/form-organization-campaign-agreement.d.ts +18 -12
- package/types/dashboard/form-organization-campaign-field-email.d.ts +1 -2
- package/types/dashboard/form-organization-campaign-field-list.d.ts +36 -0
- package/types/dashboard/form-organization-campaign-field-phone.d.ts +1 -2
- package/types/dashboard/form-organization-campaign-field-remove.d.ts +22 -0
- package/types/dashboard/form-organization-campaign-field-select.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-field-textarea.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-integration-age.d.ts +3 -3
- package/types/dashboard/form-organization-campaign-integration-enable.d.ts +3 -3
- package/types/dashboard/form-organization-campaign-mission.d.ts +40 -0
- package/types/dashboard/form-organization-campaign-section.d.ts +27 -0
- package/types/dashboard/form-organization-campaign.d.ts +27 -17
- package/types/dashboard/form-organization-identity.d.ts +2 -0
- package/types/dashboard/form-organization-workflow.d.ts +43 -47
- package/types/dashboard/form-organization.d.ts +7 -2
- package/types/dashboard/form-stripe.d.ts +3 -0
- package/types/dashboard/input-combobox.d.ts +2 -0
- package/types/dashboard/input-date.d.ts +2 -0
- package/types/dashboard/input-fields.d.ts +3 -2
- package/types/dashboard/input-file.d.ts +4 -0
- package/types/dashboard/lib/item-list.d.ts +14 -0
- package/types/dashboard/lib/menu.d.ts +17 -0
- package/types/dashboard/locked.d.ts +10 -0
- package/types/dashboard/menu.d.ts +10 -2
- package/types/dashboard/note-ai.d.ts +15 -0
- package/types/dashboard/preview.d.ts +33 -0
- package/types/dashboard/steps.d.ts +19 -4
- package/types/dashboard/table-cell-title.d.ts +2 -2
- package/types/dashboard/table-contacts.d.ts +2 -0
- package/types/icons/desktop.d.ts +5 -0
- package/types/icons/phone.d.ts +5 -0
- package/types/icons/puzzle-piece.d.ts +5 -0
- package/types/icons/tablet.d.ts +5 -0
- package/types/icons/users.d.ts +5 -0
- package/types/input-code.d.ts +23 -0
- package/types/shared/input-switch.d.ts +2 -0
- package/types/shared/lib/campaign.d.ts +35 -0
- package/types/shared/lib/helpers.d.ts +3 -0
- package/dist/dashboard/card-integration.js +0 -187
- package/dist/dashboard/card-integration.mjs +0 -158
- package/dist/dashboard/iframe.js +0 -159
- package/dist/dashboard/iframe.mjs +0 -130
- package/types/dashboard/card-integration.d.ts +0 -24
- 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
|
+
};
|