@midsummer-ai/sdk 0.1.0-staging.3781 → 0.1.0-staging.3787
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/auth/contract.mjs +1 -1
- package/auth/index.mjs +1 -1
- package/auth/password.mjs +1 -1
- package/auth/react.d.mts +50 -27
- package/auth/react.mjs +1047 -532
- package/{auth-DUEJfZvB.mjs → auth-BoKoF1zJ.mjs} +411 -122
- package/{client-CrJkXd5h.mjs → client-cU04Dzrt.mjs} +163 -9
- package/database/client.mjs +1 -1
- package/{engine-o-3LFoL3.mjs → engine-9WBvqNSV.mjs} +15 -21
- package/package.json +1 -1
- package/{qr-Br1sOBmT.mjs → qr-BySxqLW6.mjs} +86 -271
- package/style-CCFT-5rG.mjs +684 -0
|
@@ -1,286 +1,101 @@
|
|
|
1
|
-
//#region src/auth/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
.msa section:first-of-type{border-top:0;padding-top:0}
|
|
24
|
-
.msa form{display:grid;gap:12px;margin:0}
|
|
25
|
-
.msa label{display:grid;gap:6px;font-weight:500;font-size:14px}
|
|
26
|
-
.msa input,.msa select{font:inherit;color:var(--_text);background:var(--_surface);border:1px solid var(--_border);border-radius:var(--_radius);padding:9px 12px;min-height:40px;width:100%}
|
|
27
|
-
.msa input:focus-visible,.msa select:focus-visible,.msa button:focus-visible,.msa a:focus-visible{outline:2px solid var(--_accent);outline-offset:2px}
|
|
28
|
-
.msa button{font:inherit;font-weight:500;border-radius:var(--_radius);padding:9px 14px;min-height:40px;cursor:pointer;border:1px solid var(--_border);background:var(--_surface);color:var(--_text)}
|
|
29
|
-
.msa button[disabled]{opacity:.6;cursor:default}
|
|
30
|
-
.msa .msa-primary{background:var(--_accent);color:var(--_accent-text);border-color:var(--_accent);width:100%}
|
|
31
|
-
.msa .msa-danger{color:var(--_danger)}
|
|
32
|
-
.msa .msa-quiet{border-color:transparent;background:transparent;padding:6px 8px;min-height:32px}
|
|
33
|
-
.msa .msa-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-top:1px solid var(--_border)}
|
|
34
|
-
.msa .msa-row:first-child{border-top:0}
|
|
35
|
-
.msa .msa-row strong{font-weight:500}
|
|
36
|
-
.msa .msa-row span{display:block;color:var(--_muted);font-size:13px}
|
|
37
|
-
.msa .msa-or{display:flex;align-items:center;gap:12px;color:var(--_muted);font-size:13px;margin:16px 0}
|
|
38
|
-
.msa .msa-or::before,.msa .msa-or::after{content:"";flex:1;border-top:1px solid var(--_border)}
|
|
39
|
-
.msa .msa-stack{display:grid;gap:8px}
|
|
40
|
-
.msa .msa-error{color:var(--_danger);font-size:14px;margin:0}
|
|
41
|
-
.msa .msa-note{font-size:14px;margin:0}
|
|
42
|
-
.msa .msa-foot{margin:20px 0 0;font-size:14px;text-align:center}
|
|
43
|
-
.msa a{color:var(--_text);text-decoration:underline;text-underline-offset:2px}
|
|
44
|
-
.msa code{font-family:ui-monospace,monospace;font-size:13px;word-break:break-all}
|
|
45
|
-
.msa .msa-secret{display:flex;gap:8px;align-items:center}
|
|
46
|
-
.msa .msa-secret code{flex:1;white-space:nowrap;overflow-x:auto;word-break:normal;padding:8px 10px;border:1px solid var(--_border);border-radius:var(--_radius)}
|
|
47
|
-
.msa .msa-codes{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:4px 12px;margin:0;padding:0;list-style:none}
|
|
48
|
-
.msa .msa-codes code{word-break:normal}
|
|
49
|
-
.msa .msa-qr{display:block;border-radius:var(--_radius);border:1px solid var(--_border)}
|
|
50
|
-
.msa details>summary{list-style:none;cursor:pointer}
|
|
51
|
-
.msa details>summary::-webkit-details-marker{display:none}
|
|
52
|
-
.msa details[open]>summary{margin-bottom:8px}
|
|
53
|
-
.msa .msa-back{display:inline-block;margin:0 0 16px;font-size:14px}
|
|
54
|
-
.msa-menu{position:relative;display:inline-block}
|
|
55
|
-
.msa-menu [role=menu]{position:absolute;right:0;top:calc(100% + 6px);min-width:220px;background:var(--_surface);border:1px solid var(--_border);border-radius:var(--_radius);padding:6px;z-index:50;box-shadow:0 8px 24px rgb(0 0 0 / .12)}
|
|
56
|
-
.msa-menu [role=menuitem]{display:block;width:100%;text-align:left;border:0;background:transparent;padding:8px 10px;min-height:36px}
|
|
57
|
-
.msa-menu [role=menuitem]:hover,.msa-menu [role=menuitem]:focus-visible{background:var(--_bg)}
|
|
58
|
-
.msa-avatar{display:inline-grid;place-items:center;width:32px;height:32px;border-radius:999px;background:var(--_accent);color:var(--_accent-text);font-weight:600;overflow:hidden;border:0;padding:0;min-height:0}
|
|
59
|
-
.msa-avatar img{width:100%;height:100%;object-fit:cover}
|
|
60
|
-
.msa .msa-bones{display:grid;gap:12px}
|
|
61
|
-
.msa .msa-bone{display:block;height:1lh;border-radius:6px;background:var(--_border)}
|
|
62
|
-
/* As tall as an input or a button: its line, padding and border. */
|
|
63
|
-
.msa .msa-bone-control{height:calc(1lh + 20px);border-radius:var(--_radius)}
|
|
64
|
-
.msa .msa-bone-inline{margin:0 auto}
|
|
65
|
-
.msa-loading{animation:msa-appear .2s ease-out .15s both}
|
|
66
|
-
.msa-appear{animation:msa-appear .2s ease-out both}
|
|
67
|
-
@keyframes msa-appear{from{opacity:0}to{opacity:1}}
|
|
68
|
-
@media (prefers-reduced-motion:reduce){.msa-loading,.msa-appear{animation-duration:0s}}
|
|
69
|
-
@media (prefers-reduced-motion:no-preference){.msa button{transition:background-color .15s,border-color .15s}}
|
|
70
|
-
`;
|
|
71
|
-
/**
|
|
72
|
-
* An app's name when nothing sets one: the host it serves at (`shop.acme.dev`), so "Create your shop.acme.dev
|
|
73
|
-
* account" and "Your shop.acme.dev code" read right, where a stand-in like "your app" would not.
|
|
74
|
-
*/
|
|
75
|
-
function defaultAppName(origin) {
|
|
76
|
-
return URL.parse(origin)?.hostname || origin;
|
|
77
|
-
}
|
|
78
|
-
/** Every word the screens show, once, so the components and the hosted pages say the same. */
|
|
79
|
-
const WORDS = {
|
|
80
|
-
signIn: {
|
|
81
|
-
title: (app) => `Sign in to ${app}`,
|
|
82
|
-
loading: "Loading sign-in",
|
|
83
|
-
submit: "Sign in",
|
|
84
|
-
noAccount: "Don't have an account?",
|
|
85
|
-
signUp: "Sign up",
|
|
86
|
-
forgot: "Forgot your password?"
|
|
87
|
-
},
|
|
88
|
-
signUp: {
|
|
89
|
-
title: (app) => `Create your ${app} account`,
|
|
90
|
-
loading: "Loading sign-up",
|
|
91
|
-
submit: "Create account",
|
|
92
|
-
haveAccount: "Already have an account?",
|
|
93
|
-
signIn: "Sign in",
|
|
94
|
-
waitlist: "Join the waitlist",
|
|
95
|
-
invite: "You need an invitation to sign up."
|
|
96
|
-
},
|
|
97
|
-
fields: {
|
|
98
|
-
email: "Email",
|
|
99
|
-
password: "Password",
|
|
100
|
-
name: "Name",
|
|
101
|
-
code: "Code",
|
|
102
|
-
newPassword: "New password",
|
|
103
|
-
currentPassword: "Current password",
|
|
104
|
-
keyName: "Key name",
|
|
105
|
-
organization: "Organization name",
|
|
106
|
-
slug: "Address name",
|
|
107
|
-
role: "Role",
|
|
108
|
-
inviteEmail: "Email to invite"
|
|
109
|
-
},
|
|
110
|
-
ways: {
|
|
111
|
-
code: "Email me a code",
|
|
112
|
-
link: "Email me a sign-in link",
|
|
113
|
-
passkey: "Sign in with a passkey",
|
|
114
|
-
google: "Continue with Google",
|
|
115
|
-
github: "Continue with GitHub",
|
|
116
|
-
or: "or",
|
|
117
|
-
password: "Use a password instead"
|
|
118
|
-
},
|
|
119
|
-
code: {
|
|
120
|
-
sent: (email) => `We sent a code to ${email}. Enter it below.`,
|
|
121
|
-
submit: "Sign in",
|
|
122
|
-
again: "Send a new code"
|
|
1
|
+
//#region src/auth/icons.ts
|
|
2
|
+
const ICONS = {
|
|
3
|
+
google: {
|
|
4
|
+
viewBox: "0 0 15 15",
|
|
5
|
+
shapes: [
|
|
6
|
+
{
|
|
7
|
+
d: "M14.117 7.661c0-.456-.045-.926-.118-1.368H7.63v2.604h3.648a3.07 3.07 0 0 1-1.353 2.044l2.177 1.692c1.28-1.192 2.015-2.927 2.015-4.972",
|
|
8
|
+
fill: "#4280EF"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
d: "M7.63 14.252c1.824 0 3.354-.604 4.472-1.633l-2.177-1.677c-.603.412-1.383.647-2.295.647-1.765 0-3.25-1.191-3.794-2.78L1.6 10.53a6.74 6.74 0 0 0 6.03 3.722",
|
|
12
|
+
fill: "#34A353"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
d: "M3.836 8.794a4.1 4.1 0 0 1 0-2.588L1.6 4.47a6.76 6.76 0 0 0 0 6.06z",
|
|
16
|
+
fill: "#F6B704"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
d: "M7.63 3.426A3.68 3.68 0 0 1 10.22 4.44L12.146 2.5A6.5 6.5 0 0 0 7.63.749a6.74 6.74 0 0 0-6.03 3.72l2.236 1.736c.544-1.603 2.03-2.78 3.794-2.78",
|
|
20
|
+
fill: "#E54335"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
123
23
|
},
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
24
|
+
github: {
|
|
25
|
+
viewBox: "0 0 24 24",
|
|
26
|
+
shapes: [{
|
|
27
|
+
d: "M12 1.95068C17.525 1.95068 22 6.42568 22 11.9507C21.9995 14.0459 21.3419 16.0883 20.1198 17.7902C18.8977 19.4922 17.1727 20.768 15.1875 21.4382C14.6875 21.5382 14.5 21.2257 14.5 20.9632C14.5 20.6257 14.5125 19.5507 14.5125 18.2132C14.5125 17.2757 14.2 16.6757 13.8375 16.3632C16.0625 16.1132 18.4 15.2632 18.4 11.4257C18.4 10.3257 18.0125 9.43818 17.375 8.73818C17.475 8.48818 17.825 7.46318 17.275 6.08818C17.275 6.08818 16.4375 5.81318 14.525 7.11318C13.725 6.88818 12.875 6.77568 12.025 6.77568C11.175 6.77568 10.325 6.88818 9.525 7.11318C7.6125 5.82568 6.775 6.08818 6.775 6.08818C6.225 7.46318 6.575 8.48818 6.675 8.73818C6.0375 9.43818 5.65 10.3382 5.65 11.4257C5.65 15.2507 7.975 16.1132 10.2 16.3632C9.9125 16.6132 9.65 17.0507 9.5625 17.7007C8.9875 17.9632 7.55 18.3882 6.65 16.8757C6.4625 16.5757 5.9 15.8382 5.1125 15.8507C4.275 15.8632 4.775 16.3257 5.125 16.5132C5.55 16.7507 6.0375 17.6382 6.15 17.9257C6.35 18.4882 7 19.5632 9.5125 19.1007C9.5125 19.9382 9.525 20.7257 9.525 20.9632C9.525 21.2257 9.3375 21.5257 8.8375 21.4382C6.8458 20.7752 5.11342 19.502 3.88611 17.799C2.65881 16.096 1.9989 14.0498 2 11.9507C2 6.42568 6.475 1.95068 12 1.95068Z",
|
|
28
|
+
fill: "currentColor"
|
|
29
|
+
}]
|
|
128
30
|
},
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
mailed: "We sent a code to your email. Enter it below.",
|
|
133
|
-
submit: "Confirm",
|
|
134
|
-
byMail: "Email me a code instead",
|
|
135
|
-
backup: "Use a backup code",
|
|
136
|
-
backupField: "Backup code"
|
|
31
|
+
passkey: {
|
|
32
|
+
viewBox: "0 0 24 24",
|
|
33
|
+
shapes: [{ d: "M12.9996 12.8145C12.675 12.7719 12.3415 12.75 11.9996 12.75C8.55174 12.75 5.94978 14.981 4.9305 18.114C4.56744 19.23 5.50919 20.25 6.68275 20.25H13.9996M15.7496 6.5C15.7496 8.57107 14.0706 10.25 11.9996 10.25C9.92851 10.25 8.24958 8.57107 8.24958 6.5C8.24958 4.42893 9.92851 2.75 11.9996 2.75C14.0706 2.75 15.7496 4.42893 15.7496 6.5ZM15.7496 14C15.7496 12.7574 16.7569 11.75 17.9996 11.75C19.2422 11.75 20.2496 12.7574 20.2496 14C20.2496 14.7801 19.8526 15.4675 19.2496 15.8711V17L18.7496 17.9356L19.2496 18.9678V20L17.9996 21L16.7496 20V15.8711C16.1466 15.4675 15.7496 14.7801 15.7496 14Z" }]
|
|
137
34
|
},
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
submit: "Send reset link",
|
|
142
|
-
sent: (email) => `If ${email} has an account, a reset link is on its way.`,
|
|
143
|
-
choose: "Choose a new password",
|
|
144
|
-
save: "Save password",
|
|
145
|
-
done: "Your password is changed. Sign in with it now."
|
|
35
|
+
eye: {
|
|
36
|
+
viewBox: "0 0 24 24",
|
|
37
|
+
shapes: [{ d: "M21.5298 11.1188C16.6909 2.62714 7.30917 2.62704 2.47032 11.1187C2.15898 11.665 2.15898 12.3348 2.47032 12.8811C7.30917 21.3728 16.6909 21.3729 21.5298 12.8812C21.8411 12.3349 21.8411 11.6652 21.5298 11.1188Z" }, { d: "M15.25 12C15.25 13.7949 13.7949 15.25 12 15.25C10.2051 15.25 8.75 13.7949 8.75 12C8.75 10.2051 10.2051 8.75 12 8.75C13.7949 8.75 15.25 10.2051 15.25 12Z" }]
|
|
146
38
|
},
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
signOutOthers: "Sign out of my other sessions",
|
|
156
|
-
twoFactorOn: "Two-step sign-in is on",
|
|
157
|
-
twoFactorOff: "Two-step sign-in is off",
|
|
158
|
-
turnOn: "Turn on",
|
|
159
|
-
turnOff: "Turn off",
|
|
160
|
-
twoFactorSetup: "Scan this code with your authenticator app, or add an account with the setup key. Then enter the code it shows to finish.",
|
|
161
|
-
setupKey: "Setup key",
|
|
162
|
-
qr: "Code to scan with your authenticator app",
|
|
163
|
-
copyCodes: "Copy codes",
|
|
164
|
-
openInApp: "Open in authenticator app",
|
|
165
|
-
backupCodes: "Keep these backup codes somewhere safe. Each works once if you lose your authenticator.",
|
|
166
|
-
yourPassword: "Your password",
|
|
167
|
-
passkeys: "Passkeys",
|
|
168
|
-
passkey: "Passkey",
|
|
169
|
-
addPasskey: "Add a passkey",
|
|
170
|
-
noPasskeys: "No passkeys yet.",
|
|
171
|
-
remove: "Remove",
|
|
172
|
-
removeForGood: "Remove passkey",
|
|
173
|
-
copy: "Copy",
|
|
174
|
-
copied: "Copied",
|
|
175
|
-
cancel: "Cancel",
|
|
176
|
-
back: (app) => `Back to ${app}`,
|
|
177
|
-
sessions: "Sessions",
|
|
178
|
-
thisDevice: "This device",
|
|
179
|
-
signOut: "Sign out",
|
|
180
|
-
signOutEverywhere: "Sign out of other sessions",
|
|
181
|
-
signedInBy: (by) => `Signed in as you by ${by}`,
|
|
182
|
-
unknownDevice: "A device",
|
|
183
|
-
agents: "Agents",
|
|
184
|
-
keys: "API keys",
|
|
185
|
-
noKeys: "No API keys yet.",
|
|
186
|
-
createKey: "Create key",
|
|
187
|
-
keyShown: "Copy this key now. It won't be shown again.",
|
|
188
|
-
revoke: "Revoke",
|
|
189
|
-
revokeForGood: "Revoke key",
|
|
190
|
-
apps: "Apps you let in",
|
|
191
|
-
noApps: "No apps have access.",
|
|
192
|
-
removeAccess: "Remove access",
|
|
193
|
-
removeAccessForGood: "Remove this app's access",
|
|
194
|
-
lastUsed: (when) => `Last used ${when}`,
|
|
195
|
-
neverUsed: "Never used",
|
|
196
|
-
scopes: "What it may do"
|
|
39
|
+
eyeSlash: {
|
|
40
|
+
viewBox: "0 0 24 24",
|
|
41
|
+
shapes: [
|
|
42
|
+
{ d: "M9.38159 5.13889C13.5844 3.87389 18.1952 5.69502 21.2234 10.6022C21.4836 11.0238 21.6136 11.2346 21.6871 11.5612C21.7414 11.8029 21.7414 12.1969 21.6871 12.4386C21.6137 12.7652 21.4839 12.9757 21.2242 13.3966C20.7534 14.1596 20.2444 14.848 19.7046 15.4619" },
|
|
43
|
+
{ d: "M9.5 9.92322C9.03166 10.4864 8.75 11.2103 8.75 12C8.75 13.7949 10.2051 15.25 12 15.25C12.8035 15.25 13.5389 14.9584 14.1061 14.4753" },
|
|
44
|
+
{ d: "M6.22301 6.75C4.94909 7.69766 3.77614 8.98208 2.7759 10.6033C2.51619 11.0242 2.38634 11.2347 2.31292 11.5613C2.25859 11.803 2.25861 12.197 2.31296 12.4387C2.3864 12.7653 2.51649 12.9761 2.77667 13.3977C6.43137 19.3202 12.3913 20.7475 17.1571 17.6795" },
|
|
45
|
+
{ d: "M2.75 2.75L21.25 21.25" }
|
|
46
|
+
]
|
|
197
47
|
},
|
|
198
48
|
user: {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
menu: "Account menu"
|
|
49
|
+
viewBox: "0 0 24 24",
|
|
50
|
+
shapes: [{ d: "M6.5 20.25C5.39543 20.25 4.47594 19.3452 4.69524 18.2626C5.37179 14.9227 7.80671 12.25 12 12.25C16.1924 12.25 18.4514 14.9215 19.0718 18.2605C19.2736 19.3464 18.3546 20.25 17.25 20.25H6.5Z" }, { d: "M16.5 7.75a4.5 4.5 0 1 1-9 0a4.5 4.5 0 1 1 9 0Z" }]
|
|
202
51
|
},
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
roles: {
|
|
221
|
-
owner: "Owner",
|
|
222
|
-
admin: "Admin",
|
|
223
|
-
member: "Member"
|
|
224
|
-
}
|
|
52
|
+
door: {
|
|
53
|
+
viewBox: "0 0 24 24",
|
|
54
|
+
shapes: [
|
|
55
|
+
{ d: "M2.75 21.25L21.25 21.25" },
|
|
56
|
+
{ d: "M4.75 21.25V4.75C4.75 3.64543 5.64543 2.75 6.75 2.75H17.25C18.3546 2.75 19.25 3.64543 19.25 4.75V21.25" },
|
|
57
|
+
{ d: "M7.75 12.25H8.75" }
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
buildings: {
|
|
61
|
+
viewBox: "0 0 24 24",
|
|
62
|
+
shapes: [
|
|
63
|
+
{ d: "M10.25 8.75H7.75" },
|
|
64
|
+
{ d: "M7.75 12.75H10.25" },
|
|
65
|
+
{ d: "M22.25 19.25H1.75" },
|
|
66
|
+
{ d: "M3.75 19.25V5.75C3.75 4.64543 4.64543 3.75 5.75 3.75H12.25C13.3546 3.75 14.25 4.64543 14.25 5.75V19.25" },
|
|
67
|
+
{ d: "M14.25 7.75H18.25C19.3546 7.75 20.25 8.64543 20.25 9.75V19.25" }
|
|
68
|
+
]
|
|
225
69
|
},
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
accept: "Accept invitation",
|
|
230
|
-
reject: "Decline",
|
|
231
|
-
signInFirst: "Sign in or create an account with the invited email to accept.",
|
|
232
|
-
gone: "This invitation has ended. Ask for a new one."
|
|
70
|
+
grabber: {
|
|
71
|
+
viewBox: "0 0 24 24",
|
|
72
|
+
shapes: [{ d: "M8 8.99985L11.2929 5.70696C11.6834 5.31643 12.3166 5.31643 12.7071 5.70696L16 8.99985" }, { d: "M16 15L12.7071 18.2929C12.3166 18.6834 11.6834 18.6834 11.2929 18.2929L8 15" }]
|
|
233
73
|
},
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
notFound: "Page not found",
|
|
238
|
-
nothingHere: "There's nothing at this address.",
|
|
239
|
-
otherSite: "This form was sent from another site. Go back to the page and try again."
|
|
74
|
+
plus: {
|
|
75
|
+
viewBox: "0 0 24 24",
|
|
76
|
+
shapes: [{ d: "M12 5.25V12M12 12V18.75M12 12H5.25M12 12H18.75" }]
|
|
240
77
|
}
|
|
241
78
|
};
|
|
242
|
-
/** The
|
|
243
|
-
function
|
|
244
|
-
return
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
79
|
+
/** The attributes a shape is drawn with: its fill, or the set's 1.5px round stroke in the text's colour. */
|
|
80
|
+
function shapeAttributes(shape) {
|
|
81
|
+
return shape.fill ? {
|
|
82
|
+
d: shape.d,
|
|
83
|
+
fill: shape.fill
|
|
84
|
+
} : {
|
|
85
|
+
d: shape.d,
|
|
86
|
+
fill: "none",
|
|
87
|
+
stroke: "currentColor",
|
|
88
|
+
"stroke-width": "1.5",
|
|
89
|
+
"stroke-linecap": "round",
|
|
90
|
+
"stroke-linejoin": "round"
|
|
91
|
+
};
|
|
255
92
|
}
|
|
256
|
-
/**
|
|
257
|
-
function
|
|
258
|
-
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
return browser && system ? `${browser} on ${system}` : browser ?? system;
|
|
93
|
+
/** An icon as markup, hidden from screen readers: the control it sits in carries the words. */
|
|
94
|
+
function iconSvg(name) {
|
|
95
|
+
const drawing = ICONS[name];
|
|
96
|
+
const shapes = drawing.shapes.map((shape) => `<path ${Object.entries(shapeAttributes(shape)).map(([key, value]) => `${key}="${value}"`).join(" ")}/>`).join("");
|
|
97
|
+
return `<svg class="msa-icon" aria-hidden="true" focusable="false" viewBox="${drawing.viewBox}">${shapes}</svg>`;
|
|
262
98
|
}
|
|
263
|
-
/** The provider's script and the form field its widget fills, for each bot check an app may set. */
|
|
264
|
-
const CAPTCHA_WIDGETS = {
|
|
265
|
-
turnstile: {
|
|
266
|
-
script: "https://challenges.cloudflare.com/turnstile/v0/api.js",
|
|
267
|
-
className: "cf-turnstile",
|
|
268
|
-
field: "cf-turnstile-response",
|
|
269
|
-
global: "turnstile"
|
|
270
|
-
},
|
|
271
|
-
hcaptcha: {
|
|
272
|
-
script: "https://js.hcaptcha.com/1/api.js",
|
|
273
|
-
className: "h-captcha",
|
|
274
|
-
field: "h-captcha-response",
|
|
275
|
-
global: "hcaptcha"
|
|
276
|
-
},
|
|
277
|
-
recaptcha: {
|
|
278
|
-
script: "https://www.google.com/recaptcha/api.js",
|
|
279
|
-
className: "g-recaptcha",
|
|
280
|
-
field: "g-recaptcha-response",
|
|
281
|
-
global: "grecaptcha"
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
99
|
//#endregion
|
|
285
100
|
//#region ../../node_modules/.bun/uqr@0.1.2/node_modules/uqr/dist/index.mjs
|
|
286
101
|
var QrCodeDataType = /* @__PURE__ */ ((QrCodeDataType2) => {
|
|
@@ -1182,4 +997,4 @@ function qrSvg(value, label, pixels = 176) {
|
|
|
1182
997
|
})[c])}" viewBox="0 0 ${size} ${size}" width="${pixels}" height="${pixels}" shape-rendering="crispEdges"><rect width="${size}" height="${size}" fill="#ffffff"/><path d="${d}" fill="#111111"/></svg>`;
|
|
1183
998
|
}
|
|
1184
999
|
//#endregion
|
|
1185
|
-
export {
|
|
1000
|
+
export { shapeAttributes as a, iconSvg as i, qrSvg as n, ICONS as r, qrPath as t };
|