@medialane/ui 0.243.0 → 0.245.0

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 (41) hide show
  1. package/dist/components/account/input-otp.d.cts +2 -2
  2. package/dist/components/account/input-otp.d.ts +2 -2
  3. package/dist/components/button.d.cts +2 -2
  4. package/dist/components/button.d.ts +2 -2
  5. package/dist/components/fast-mint/fast-mint.d.cts +2 -2
  6. package/dist/components/fast-mint/fast-mint.d.ts +2 -2
  7. package/dist/components/launchpad/coin-create.cjs +424 -0
  8. package/dist/components/launchpad/coin-create.cjs.map +1 -0
  9. package/dist/components/launchpad/coin-create.d.cts +10 -0
  10. package/dist/components/launchpad/coin-create.d.ts +10 -0
  11. package/dist/components/launchpad/coin-create.js +402 -0
  12. package/dist/components/launchpad/coin-create.js.map +1 -0
  13. package/dist/components/launchpad/edition-mint-schema.d.cts +2 -2
  14. package/dist/components/launchpad/edition-mint-schema.d.ts +2 -2
  15. package/dist/components/launchpad/pop-create-fields.cjs +295 -0
  16. package/dist/components/launchpad/pop-create-fields.cjs.map +1 -0
  17. package/dist/components/launchpad/pop-create-fields.d.cts +25 -0
  18. package/dist/components/launchpad/pop-create-fields.d.ts +25 -0
  19. package/dist/components/launchpad/pop-create-fields.js +273 -0
  20. package/dist/components/launchpad/pop-create-fields.js.map +1 -0
  21. package/dist/components/launchpad/pop-create-schema.cjs +71 -0
  22. package/dist/components/launchpad/pop-create-schema.cjs.map +1 -0
  23. package/dist/components/launchpad/pop-create-schema.d.cts +41 -0
  24. package/dist/components/launchpad/pop-create-schema.d.ts +41 -0
  25. package/dist/components/launchpad/pop-create-schema.js +37 -0
  26. package/dist/components/launchpad/pop-create-schema.js.map +1 -0
  27. package/dist/components/launchpad/pop-create.cjs +191 -0
  28. package/dist/components/launchpad/pop-create.cjs.map +1 -0
  29. package/dist/components/launchpad/pop-create.d.cts +8 -0
  30. package/dist/components/launchpad/pop-create.d.ts +8 -0
  31. package/dist/components/launchpad/pop-create.js +167 -0
  32. package/dist/components/launchpad/pop-create.js.map +1 -0
  33. package/dist/components/sheet.d.cts +1 -1
  34. package/dist/components/sheet.d.ts +1 -1
  35. package/dist/index.cjs +6 -0
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.d.cts +2 -0
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.js +4 -0
  40. package/dist/index.js.map +1 -1
  41. package/package.json +1 -1
@@ -0,0 +1,402 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useMemo, useState } from "react";
4
+ import { ArrowRight, Coins, ImagePlus, Loader2, X } from "lucide-react";
5
+ import { SUPPORTED_TOKENS, acceptFor, formatAmount, getTokenBySymbol, normalizeAddress } from "@medialane/sdk";
6
+ import {
7
+ SUGGESTED_DEFAULT_PRICE,
8
+ buybackQuoteRaw,
9
+ coinToRaw as toRaw,
10
+ fdvHuman,
11
+ parseCreatorCoinCreated,
12
+ teamCoinsRaw,
13
+ validateCoinName as validateName,
14
+ validateCoinSupply as validateSupply,
15
+ validateCoinSymbol as validateSymbol,
16
+ validatePrice,
17
+ assertTransactionSucceeded
18
+ } from "@medialane/sdk/starknet";
19
+ import Image from "../image.js";
20
+ import Link from "../link.js";
21
+ import { Input } from "../input.js";
22
+ import { Label } from "../label.js";
23
+ import { Textarea } from "../textarea.js";
24
+ import { CoinLaunchPreview } from "../coin-launch-preview.js";
25
+ import { CurrencyAmount, CurrencyIcon } from "../currency-icon.js";
26
+ import { GradientButton } from "../gradient-button.js";
27
+ import { ClaimRouteShell } from "../claim-route-shell.js";
28
+ import { CreationSuccess } from "../creation-success.js";
29
+ import { TransactionDialog } from "../transaction-dialog.js";
30
+ import { WalletRequired } from "../wallet-required.js";
31
+ import { useMedialaneApp } from "../medialane-app.js";
32
+ import { RewardEarned } from "../rewards/reward-earned.js";
33
+ import { cn } from "../../utils/cn.js";
34
+ import { suggestLaunchpadSymbol } from "../../utils/launchpad-defaults.js";
35
+ import { runIntentCalls } from "../../utils/run-intent-calls.js";
36
+ import { useTransaction } from "../../utils/use-transaction.js";
37
+ import { useLaunchpadImageUpload } from "../../utils/use-launchpad-image-upload.js";
38
+ import { useTokenBalance } from "../../utils/media-wallet/use-erc20-balance.js";
39
+ const QUOTE_OPTIONS = SUPPORTED_TOKENS.map((t) => t.symbol);
40
+ const SUPPLY_PRESETS = [
41
+ { label: "1M", value: "1000000" },
42
+ { label: "100M", value: "100000000" },
43
+ { label: "1B", value: "1000000000" }
44
+ ];
45
+ function CoinCreate({ aside, tradeHref }) {
46
+ const app = useMedialaneApp();
47
+ const walletAddress = app.walletAddress;
48
+ const tx = useTransaction();
49
+ const [name, setName] = useState("");
50
+ const [symbol, setSymbol] = useState("");
51
+ const [autoSymbol, setAutoSymbol] = useState("");
52
+ const [description, setDescription] = useState("");
53
+ const [supply, setSupply] = useState("");
54
+ const [quote, setQuote] = useState("STRK");
55
+ const [price, setPrice] = useState(String(SUGGESTED_DEFAULT_PRICE));
56
+ const [teamPct, setTeamPct] = useState(5);
57
+ const [coinAddress, setCoinAddress] = useState(null);
58
+ const [profileStatus, setProfileStatus] = useState("idle");
59
+ const upload = useLaunchpadImageUpload({ successMessage: "Image ready" });
60
+ const { imagePreview, imageUri, imageUploading, uploadError, uploadSuccess, fileInputRef, handleImageSelect, clearImage } = upload;
61
+ const quoteToken = getTokenBySymbol(quote);
62
+ const { rawBalance } = useTokenBalance(quote, walletAddress ?? null);
63
+ const priceNum = Number(price);
64
+ const nameErr = name ? validateName(name) : null;
65
+ const symErr = symbol ? validateSymbol(symbol) : null;
66
+ const supplyErr = supply ? validateSupply(supply) : null;
67
+ const priceErr = price ? validatePrice(quoteToken.decimals, priceNum) : "Price is required";
68
+ const identityValid = !validateName(name) && !validateSymbol(symbol);
69
+ const economicsValid = !validateSupply(supply) && !priceErr;
70
+ const handleNameChange = (v) => {
71
+ setName(v);
72
+ const suggested = suggestLaunchpadSymbol(v);
73
+ if (suggested && (!symbol || symbol === autoSymbol)) {
74
+ setSymbol(suggested);
75
+ setAutoSymbol(suggested);
76
+ }
77
+ };
78
+ const preview = useMemo(() => {
79
+ if (validateSupply(supply) || validatePrice(quoteToken.decimals, priceNum)) return null;
80
+ const supplyHuman = Number(supply);
81
+ const supplyRaw = toRaw(BigInt(supply));
82
+ const teamRaw = teamCoinsRaw(supplyRaw, teamPct);
83
+ const buybackRaw = buybackQuoteRaw(teamRaw, priceNum, quoteToken.decimals);
84
+ return {
85
+ fdv: fdvHuman(supplyHuman, priceNum),
86
+ teamCoins: supplyHuman * (teamPct / 100),
87
+ buybackRaw,
88
+ buybackHuman: formatAmount(buybackRaw.toString(), quoteToken.decimals)
89
+ };
90
+ }, [supply, priceNum, teamPct, quoteToken.decimals]);
91
+ const insufficient = preview != null && rawBalance != null && rawBalance < preview.buybackRaw;
92
+ const canLaunch = identityValid && economicsValid && preview != null && teamPct > 0 && !insufficient && !imageUploading;
93
+ const previewData = {
94
+ name,
95
+ symbol,
96
+ description,
97
+ imageUrl: imagePreview,
98
+ supplyHuman: economicsValid && supply ? Number(supply) : null,
99
+ price: priceErr ? SUGGESTED_DEFAULT_PRICE : priceNum,
100
+ quoteSymbol: quote,
101
+ teamPct
102
+ };
103
+ const handleLaunchClick = () => {
104
+ if (!canLaunch || !walletAddress || !preview) return;
105
+ const owner = normalizeAddress("STARKNET", walletAddress);
106
+ const supplyRaw = toRaw(BigInt(supply));
107
+ const teamRaw = teamCoinsRaw(supplyRaw, teamPct);
108
+ const buybackRaw = buybackQuoteRaw(teamRaw, priceNum, quoteToken.decimals);
109
+ void tx.run(async (signer) => {
110
+ await app.ensureSignedIn?.();
111
+ const client = app.getClient();
112
+ const api = client.api;
113
+ const { txHash: deployHash } = await runIntentCalls(
114
+ signer,
115
+ () => api.intents.create("create-coin", { owner, name, symbol, initialSupply: supplyRaw.toString() })
116
+ );
117
+ const deployReceipt = await assertTransactionSucceeded(client.provider, deployHash);
118
+ const address = parseCreatorCoinCreated(deployReceipt);
119
+ await runIntentCalls(
120
+ signer,
121
+ () => api.intents.create("launch-coin", {
122
+ owner,
123
+ creatorCoin: address,
124
+ quoteToken: quoteToken.address,
125
+ price: priceNum,
126
+ initialHolders: teamPct > 0 ? [owner] : [],
127
+ initialHoldersAmounts: teamPct > 0 ? [teamRaw.toString()] : [],
128
+ transferRestrictionDelay: 0,
129
+ quoteFundAmount: buybackRaw.toString()
130
+ })
131
+ );
132
+ await api.coins.sync(address, owner).catch(() => {
133
+ });
134
+ setCoinAddress(address);
135
+ if (imageUri || description) {
136
+ setProfileStatus("saving");
137
+ await api.collections.updateProfile(address, { ...imageUri ? { image: imageUri } : {}, ...description ? { description } : {} }).then(() => setProfileStatus("saved")).catch(() => setProfileStatus("failed"));
138
+ }
139
+ });
140
+ };
141
+ const handleReset = () => {
142
+ tx.reset();
143
+ setCoinAddress(null);
144
+ setProfileStatus("idle");
145
+ setName("");
146
+ setSymbol("");
147
+ setAutoSymbol("");
148
+ setDescription("");
149
+ setSupply("");
150
+ setPrice(String(SUGGESTED_DEFAULT_PRICE));
151
+ setTeamPct(5);
152
+ clearImage();
153
+ };
154
+ return /* @__PURE__ */ jsxs(
155
+ WalletRequired,
156
+ {
157
+ icon: Coins,
158
+ iconClassName: "text-brand-orange",
159
+ title: "Launch a Creator Coin",
160
+ description: "Secure your account to design and launch your own coin with permanently-locked liquidity, in a few clicks.",
161
+ children: [
162
+ /* @__PURE__ */ jsx(TransactionDialog, { tx, title: "Launch your coin", workingLabel: "Launching your coin\u2026", firstStepLabel: "Deploy your coin", children: /* @__PURE__ */ jsxs(
163
+ CreationSuccess,
164
+ {
165
+ name: name || "Your coin",
166
+ image: imagePreview,
167
+ caption: "Your coin is live",
168
+ primary: coinAddress ? { href: tradeHref(coinAddress), label: "View & trade your coin" } : { href: "/launchpad", label: "Back to Launchpad" },
169
+ secondary: coinAddress ? { href: "/launchpad", label: "Back to Launchpad" } : void 0,
170
+ onAgain: handleReset,
171
+ againLabel: "Launch another coin",
172
+ children: [
173
+ profileStatus === "saving" && /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground flex items-center justify-center gap-1.5", children: [
174
+ /* @__PURE__ */ jsx(Loader2, { className: "h-3 w-3 animate-spin" }),
175
+ " Saving your coin's image & description\u2026"
176
+ ] }),
177
+ profileStatus === "failed" && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground text-center", children: "Couldn't save the image & description right now. Add them anytime from your collection settings." }),
178
+ /* @__PURE__ */ jsx(RewardEarned, { actionType: "launch_coin" })
179
+ ]
180
+ }
181
+ ) }),
182
+ /* @__PURE__ */ jsx(
183
+ ClaimRouteShell,
184
+ {
185
+ icon: /* @__PURE__ */ jsx(Coins, { className: "h-4 w-4 text-white" }),
186
+ title: "Design your Creator Coin",
187
+ subtitle: "A few steps to design and launch your coin.",
188
+ aside: /* @__PURE__ */ jsxs(Fragment, { children: [
189
+ /* @__PURE__ */ jsx(CoinLaunchPreview, { data: previewData }),
190
+ aside
191
+ ] }),
192
+ children: /* @__PURE__ */ jsxs("div", { className: "space-y-7", children: [
193
+ /* @__PURE__ */ jsxs("section", { className: "space-y-4", children: [
194
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h3", { className: "text-lg font-bold", children: "Give it a face" }) }),
195
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
196
+ /* @__PURE__ */ jsx(Label, { children: "Coin image" }),
197
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
198
+ /* @__PURE__ */ jsxs(
199
+ "button",
200
+ {
201
+ type: "button",
202
+ onClick: () => fileInputRef.current?.click(),
203
+ className: "relative h-24 w-24 shrink-0 rounded-full overflow-hidden border border-dashed border-border bg-muted/20 flex items-center justify-center",
204
+ children: [
205
+ imagePreview ? /* @__PURE__ */ jsx(Image, { src: imagePreview, alt: "Coin", fill: true, unoptimized: true, className: "object-cover" }) : /* @__PURE__ */ jsx(ImagePlus, { className: "h-6 w-6 text-muted-foreground" }),
206
+ imageUploading && /* @__PURE__ */ jsx("span", { className: "absolute inset-0 bg-background/70 flex items-center justify-center", children: /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin text-primary" }) })
207
+ ]
208
+ }
209
+ ),
210
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1 text-xs text-muted-foreground", children: [
211
+ /* @__PURE__ */ jsx("p", { children: "JPG, PNG, GIF, SVG or WebP" }),
212
+ imagePreview && /* @__PURE__ */ jsxs("button", { type: "button", onClick: clearImage, className: "inline-flex items-center gap-1 text-muted-foreground active:text-foreground", children: [
213
+ /* @__PURE__ */ jsx(X, { className: "h-3 w-3" }),
214
+ " Remove"
215
+ ] }),
216
+ uploadError && /* @__PURE__ */ jsx("p", { className: "text-destructive", children: uploadError }),
217
+ uploadSuccess && /* @__PURE__ */ jsxs("p", { className: "text-emerald-500", children: [
218
+ "\u2713 ",
219
+ uploadSuccess
220
+ ] })
221
+ ] }),
222
+ /* @__PURE__ */ jsx(
223
+ "input",
224
+ {
225
+ ref: fileInputRef,
226
+ type: "file",
227
+ accept: acceptFor("image"),
228
+ className: "hidden",
229
+ onChange: (e) => {
230
+ const f = e.target.files?.[0];
231
+ if (f) void handleImageSelect(f);
232
+ }
233
+ }
234
+ )
235
+ ] })
236
+ ] }),
237
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [
238
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
239
+ /* @__PURE__ */ jsx(Label, { htmlFor: "name", children: "Name" }),
240
+ /* @__PURE__ */ jsx(Input, { id: "name", value: name, onChange: (e) => handleNameChange(e.target.value), placeholder: "My Coin" }),
241
+ nameErr && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: nameErr })
242
+ ] }),
243
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
244
+ /* @__PURE__ */ jsx(Label, { htmlFor: "symbol", children: "Symbol" }),
245
+ /* @__PURE__ */ jsx(Input, { id: "symbol", value: symbol, onChange: (e) => setSymbol(e.target.value.toUpperCase()), placeholder: "COIN" }),
246
+ symErr && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: symErr })
247
+ ] })
248
+ ] }),
249
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
250
+ /* @__PURE__ */ jsx(Label, { htmlFor: "description", children: "Description" }),
251
+ /* @__PURE__ */ jsx(
252
+ Textarea,
253
+ {
254
+ id: "description",
255
+ value: description,
256
+ onChange: (e) => setDescription(e.target.value.slice(0, 500)),
257
+ placeholder: "Tell your community what this coin is about\u2026",
258
+ rows: 3
259
+ }
260
+ )
261
+ ] })
262
+ ] }),
263
+ /* @__PURE__ */ jsx("div", { className: "h-px bg-border/60" }),
264
+ /* @__PURE__ */ jsxs("section", { className: "space-y-4", children: [
265
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("h3", { className: "text-lg font-bold", children: "Set the numbers" }) }),
266
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
267
+ /* @__PURE__ */ jsx(Label, { htmlFor: "supply", children: "Total supply" }),
268
+ /* @__PURE__ */ jsx("div", { className: "flex gap-2 mb-1", children: SUPPLY_PRESETS.map((p) => /* @__PURE__ */ jsx(
269
+ "button",
270
+ {
271
+ type: "button",
272
+ onClick: () => setSupply(p.value),
273
+ className: cn(
274
+ "rounded-lg border px-3.5 py-1.5 text-sm font-medium",
275
+ supply === p.value ? "border-brand-orange bg-brand-orange/10 text-brand-orange" : "border-border text-muted-foreground"
276
+ ),
277
+ children: p.label
278
+ },
279
+ p.label
280
+ )) }),
281
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
282
+ /* @__PURE__ */ jsx(
283
+ Input,
284
+ {
285
+ id: "supply",
286
+ inputMode: "numeric",
287
+ value: supply ? Number(supply).toLocaleString() : "",
288
+ onChange: (e) => setSupply(e.target.value.replace(/[^\d]/g, "")),
289
+ placeholder: "1,000,000",
290
+ className: "pr-16 text-lg font-semibold tabular-nums"
291
+ }
292
+ ),
293
+ /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm font-medium text-muted-foreground", children: "coins" })
294
+ ] }),
295
+ supplyErr && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: supplyErr })
296
+ ] }),
297
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
298
+ /* @__PURE__ */ jsx(Label, { children: "Pair" }),
299
+ /* @__PURE__ */ jsx("div", { className: "flex gap-2 flex-wrap", children: QUOTE_OPTIONS.map((q) => /* @__PURE__ */ jsxs(
300
+ "button",
301
+ {
302
+ type: "button",
303
+ onClick: () => setQuote(q),
304
+ className: cn(
305
+ "inline-flex items-center gap-1.5 rounded-lg border px-3.5 py-1.5 text-sm font-medium",
306
+ quote === q ? "border-brand-maeve bg-brand-maeve/10 text-brand-maeve" : "border-border text-muted-foreground"
307
+ ),
308
+ children: [
309
+ /* @__PURE__ */ jsx(CurrencyIcon, { symbol: q, size: 16 }),
310
+ q
311
+ ]
312
+ },
313
+ q
314
+ )) })
315
+ ] }),
316
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
317
+ /* @__PURE__ */ jsxs(Label, { htmlFor: "price", children: [
318
+ "Price (",
319
+ quote,
320
+ " per coin)"
321
+ ] }),
322
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
323
+ /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2", children: /* @__PURE__ */ jsx(CurrencyIcon, { symbol: quote, size: 16 }) }),
324
+ /* @__PURE__ */ jsx(
325
+ Input,
326
+ {
327
+ id: "price",
328
+ inputMode: "decimal",
329
+ value: price,
330
+ onChange: (e) => setPrice(e.target.value.replace(/[^0-9.]/g, "")),
331
+ placeholder: String(SUGGESTED_DEFAULT_PRICE),
332
+ className: "pl-9"
333
+ }
334
+ )
335
+ ] }),
336
+ priceErr && price && /* @__PURE__ */ jsx("p", { className: "text-xs text-destructive", children: priceErr })
337
+ ] }),
338
+ preview && /* @__PURE__ */ jsxs("div", { className: "rounded-xl bg-muted/50 dark:bg-muted/30 p-4", children: [
339
+ /* @__PURE__ */ jsx("p", { className: "text-2xs uppercase tracking-wide text-muted-foreground", children: "Starting market cap" }),
340
+ /* @__PURE__ */ jsx("p", { className: "text-2xl font-bold tabular-nums text-brand-maeve", children: /* @__PURE__ */ jsx(CurrencyAmount, { amount: preview.fdv.toLocaleString(), symbol: quote, iconSize: 18 }) })
341
+ ] }),
342
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
343
+ /* @__PURE__ */ jsxs(Label, { htmlFor: "alloc", children: [
344
+ "Your allocation: ",
345
+ teamPct,
346
+ "%"
347
+ ] }),
348
+ /* @__PURE__ */ jsx(
349
+ "input",
350
+ {
351
+ id: "alloc",
352
+ type: "range",
353
+ min: 1,
354
+ max: 10,
355
+ step: 1,
356
+ value: teamPct,
357
+ onChange: (e) => setTeamPct(Number(e.target.value)),
358
+ className: "w-full accent-[hsl(var(--brand-orange))]"
359
+ }
360
+ ),
361
+ preview && /* @__PURE__ */ jsxs("p", { className: cn("text-sm font-semibold", insufficient ? "text-destructive" : "text-foreground"), children: [
362
+ /* @__PURE__ */ jsx(CurrencyAmount, { amount: preview.buybackHuman, symbol: quote, iconSize: 14 }),
363
+ " required"
364
+ ] }),
365
+ insufficient && /* @__PURE__ */ jsxs("p", { className: "text-xs text-destructive", children: [
366
+ "Your wallet doesn't have enough ",
367
+ quote,
368
+ ". Add funds, or adjust the numbers above."
369
+ ] })
370
+ ] })
371
+ ] }),
372
+ /* @__PURE__ */ jsx("div", { className: "h-px bg-border/60" }),
373
+ /* @__PURE__ */ jsxs("section", { className: "space-y-4", children: [
374
+ /* @__PURE__ */ jsx(
375
+ GradientButton,
376
+ {
377
+ big: true,
378
+ onClick: handleLaunchClick,
379
+ disabled: !canLaunch || tx.phase !== "idle",
380
+ className: !canLaunch || tx.phase !== "idle" ? "opacity-40 pointer-events-none" : "",
381
+ children: tx.phase !== "idle" ? /* @__PURE__ */ jsxs(Fragment, { children: [
382
+ /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 mr-1.5 animate-spin" }),
383
+ " Launching\u2026"
384
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
385
+ "Launch your coin ",
386
+ /* @__PURE__ */ jsx(ArrowRight, { className: "h-4 w-4 ml-1.5" })
387
+ ] })
388
+ }
389
+ ),
390
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground text-center", children: /* @__PURE__ */ jsx(Link, { href: "/claim/memecoin", className: "underline active:text-foreground", children: "Already launched a coin? Claim it instead." }) })
391
+ ] })
392
+ ] })
393
+ }
394
+ )
395
+ ]
396
+ }
397
+ );
398
+ }
399
+ export {
400
+ CoinCreate
401
+ };
402
+ //# sourceMappingURL=coin-create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/launchpad/coin-create.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMemo, useState, type ReactNode } from \"react\";\nimport { ArrowRight, Coins, ImagePlus, Loader2, X } from \"lucide-react\";\nimport { SUPPORTED_TOKENS, acceptFor, formatAmount, getTokenBySymbol, normalizeAddress } from \"@medialane/sdk\";\nimport {\n SUGGESTED_DEFAULT_PRICE,\n buybackQuoteRaw,\n coinToRaw as toRaw,\n fdvHuman,\n parseCreatorCoinCreated,\n teamCoinsRaw,\n validateCoinName as validateName,\n validateCoinSupply as validateSupply,\n validateCoinSymbol as validateSymbol,\n validatePrice,\n assertTransactionSucceeded,\n type CreatorCoinReceiptLike,\n} from \"@medialane/sdk/starknet\";\nimport Image from \"../image.js\";\nimport Link from \"../link.js\";\nimport { Input } from \"../input.js\";\nimport { Label } from \"../label.js\";\nimport { Textarea } from \"../textarea.js\";\nimport { CoinLaunchPreview, type CoinPreviewData } from \"../coin-launch-preview.js\";\nimport { CurrencyAmount, CurrencyIcon } from \"../currency-icon.js\";\nimport { GradientButton } from \"../gradient-button.js\";\nimport { ClaimRouteShell } from \"../claim-route-shell.js\";\nimport { CreationSuccess } from \"../creation-success.js\";\nimport { TransactionDialog } from \"../transaction-dialog.js\";\nimport { WalletRequired } from \"../wallet-required.js\";\nimport { useMedialaneApp } from \"../medialane-app.js\";\nimport { RewardEarned } from \"../rewards/reward-earned.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport { suggestLaunchpadSymbol } from \"../../utils/launchpad-defaults.js\";\nimport { runIntentCalls } from \"../../utils/run-intent-calls.js\";\nimport { useTransaction } from \"../../utils/use-transaction.js\";\nimport { useLaunchpadImageUpload } from \"../../utils/use-launchpad-image-upload.js\";\nimport { useTokenBalance } from \"../../utils/media-wallet/use-erc20-balance.js\";\n\nconst QUOTE_OPTIONS = SUPPORTED_TOKENS.map((t) => t.symbol);\ntype Quote = (typeof QUOTE_OPTIONS)[number];\n\nconst SUPPLY_PRESETS = [\n { label: \"1M\", value: \"1000000\" },\n { label: \"100M\", value: \"100000000\" },\n { label: \"1B\", value: \"1000000000\" },\n];\n\ntype ProfileStatus = \"idle\" | \"saving\" | \"saved\" | \"failed\";\n\nexport interface CoinCreateProps {\n aside?: ReactNode;\n tradeHref: (coinAddress: string) => string;\n}\n\nexport function CoinCreate({ aside, tradeHref }: CoinCreateProps) {\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const tx = useTransaction();\n const [name, setName] = useState(\"\");\n const [symbol, setSymbol] = useState(\"\");\n const [autoSymbol, setAutoSymbol] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [supply, setSupply] = useState(\"\");\n const [quote, setQuote] = useState<Quote>(\"STRK\");\n const [price, setPrice] = useState(String(SUGGESTED_DEFAULT_PRICE));\n const [teamPct, setTeamPct] = useState(5);\n const [coinAddress, setCoinAddress] = useState<string | null>(null);\n const [profileStatus, setProfileStatus] = useState<ProfileStatus>(\"idle\");\n\n const upload = useLaunchpadImageUpload({ successMessage: \"Image ready\" });\n const { imagePreview, imageUri, imageUploading, uploadError, uploadSuccess, fileInputRef, handleImageSelect, clearImage } = upload;\n\n const quoteToken = getTokenBySymbol(quote)!;\n const { rawBalance } = useTokenBalance(quote, walletAddress ?? null);\n\n const priceNum = Number(price);\n const nameErr = name ? validateName(name) : null;\n const symErr = symbol ? validateSymbol(symbol) : null;\n const supplyErr = supply ? validateSupply(supply) : null;\n const priceErr = price ? validatePrice(quoteToken.decimals, priceNum) : \"Price is required\";\n const identityValid = !validateName(name) && !validateSymbol(symbol);\n const economicsValid = !validateSupply(supply) && !priceErr;\n\n const handleNameChange = (v: string) => {\n setName(v);\n const suggested = suggestLaunchpadSymbol(v);\n if (suggested && (!symbol || symbol === autoSymbol)) {\n setSymbol(suggested);\n setAutoSymbol(suggested);\n }\n };\n\n const preview = useMemo(() => {\n if (validateSupply(supply) || validatePrice(quoteToken.decimals, priceNum)) return null;\n const supplyHuman = Number(supply);\n const supplyRaw = toRaw(BigInt(supply));\n const teamRaw = teamCoinsRaw(supplyRaw, teamPct);\n const buybackRaw = buybackQuoteRaw(teamRaw, priceNum, quoteToken.decimals);\n return {\n fdv: fdvHuman(supplyHuman, priceNum),\n teamCoins: supplyHuman * (teamPct / 100),\n buybackRaw,\n buybackHuman: formatAmount(buybackRaw.toString(), quoteToken.decimals),\n };\n }, [supply, priceNum, teamPct, quoteToken.decimals]);\n\n const insufficient = preview != null && rawBalance != null && rawBalance < preview.buybackRaw;\n const canLaunch = identityValid && economicsValid && preview != null && teamPct > 0 && !insufficient && !imageUploading;\n\n const previewData: CoinPreviewData = {\n name,\n symbol,\n description,\n imageUrl: imagePreview,\n supplyHuman: economicsValid && supply ? Number(supply) : null,\n price: priceErr ? SUGGESTED_DEFAULT_PRICE : priceNum,\n quoteSymbol: quote,\n teamPct,\n };\n\n const handleLaunchClick = () => {\n if (!canLaunch || !walletAddress || !preview) return;\n const owner = normalizeAddress(\"STARKNET\", walletAddress);\n const supplyRaw = toRaw(BigInt(supply));\n const teamRaw = teamCoinsRaw(supplyRaw, teamPct);\n const buybackRaw = buybackQuoteRaw(teamRaw, priceNum, quoteToken.decimals);\n void tx.run(async (signer) => {\n await app.ensureSignedIn?.();\n const client = app.getClient();\n const api = client.api;\n\n const { txHash: deployHash } = await runIntentCalls(signer, () =>\n api.intents.create(\"create-coin\", { owner, name, symbol, initialSupply: supplyRaw.toString() }),\n );\n const deployReceipt = await assertTransactionSucceeded(client.provider, deployHash);\n const address = parseCreatorCoinCreated(deployReceipt as CreatorCoinReceiptLike);\n\n await runIntentCalls(signer, () =>\n api.intents.create(\"launch-coin\", {\n owner,\n creatorCoin: address,\n quoteToken: quoteToken.address,\n price: priceNum,\n initialHolders: teamPct > 0 ? [owner] : [],\n initialHoldersAmounts: teamPct > 0 ? [teamRaw.toString()] : [],\n transferRestrictionDelay: 0,\n quoteFundAmount: buybackRaw.toString(),\n }),\n );\n await api.coins.sync(address, owner).catch(() => {});\n setCoinAddress(address);\n\n if (imageUri || description) {\n setProfileStatus(\"saving\");\n await api.collections\n .updateProfile(address, { ...(imageUri ? { image: imageUri } : {}), ...(description ? { description } : {}) })\n .then(() => setProfileStatus(\"saved\"))\n .catch(() => setProfileStatus(\"failed\"));\n }\n });\n };\n\n const handleReset = () => {\n tx.reset();\n setCoinAddress(null);\n setProfileStatus(\"idle\");\n setName(\"\");\n setSymbol(\"\");\n setAutoSymbol(\"\");\n setDescription(\"\");\n setSupply(\"\");\n setPrice(String(SUGGESTED_DEFAULT_PRICE));\n setTeamPct(5);\n clearImage();\n };\n\n return (\n <WalletRequired\n icon={Coins}\n iconClassName=\"text-brand-orange\"\n title=\"Launch a Creator Coin\"\n description=\"Secure your account to design and launch your own coin with permanently-locked liquidity, in a few clicks.\"\n >\n <TransactionDialog tx={tx} title=\"Launch your coin\" workingLabel=\"Launching your coin…\" firstStepLabel=\"Deploy your coin\">\n <CreationSuccess\n name={name || \"Your coin\"}\n image={imagePreview}\n caption=\"Your coin is live\"\n primary={coinAddress ? { href: tradeHref(coinAddress), label: \"View & trade your coin\" } : { href: \"/launchpad\", label: \"Back to Launchpad\" }}\n secondary={coinAddress ? { href: \"/launchpad\", label: \"Back to Launchpad\" } : undefined}\n onAgain={handleReset}\n againLabel=\"Launch another coin\"\n >\n {profileStatus === \"saving\" && (\n <p className=\"text-xs text-muted-foreground flex items-center justify-center gap-1.5\">\n <Loader2 className=\"h-3 w-3 animate-spin\" /> Saving your coin&apos;s image &amp; description…\n </p>\n )}\n {profileStatus === \"failed\" && (\n <p className=\"text-xs text-muted-foreground text-center\">\n Couldn&apos;t save the image &amp; description right now. Add them anytime from your collection settings.\n </p>\n )}\n <RewardEarned actionType=\"launch_coin\" />\n </CreationSuccess>\n </TransactionDialog>\n\n <ClaimRouteShell\n icon={<Coins className=\"h-4 w-4 text-white\" />}\n title=\"Design your Creator Coin\"\n subtitle=\"A few steps to design and launch your coin.\"\n aside={\n <>\n <CoinLaunchPreview data={previewData} />\n {aside}\n </>\n }\n >\n <div className=\"space-y-7\">\n\n <section className=\"space-y-4\">\n <div>\n <h3 className=\"text-lg font-bold\">Give it a face</h3>\n </div>\n\n <div className=\"space-y-1.5\">\n <Label>Coin image</Label>\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => fileInputRef.current?.click()}\n className=\"relative h-24 w-24 shrink-0 rounded-full overflow-hidden border border-dashed border-border bg-muted/20 flex items-center justify-center\"\n >\n {imagePreview ? (\n\n <Image src={imagePreview} alt=\"Coin\" fill unoptimized className=\"object-cover\" />\n ) : (\n <ImagePlus className=\"h-6 w-6 text-muted-foreground\" />\n )}\n {imageUploading && (\n <span className=\"absolute inset-0 bg-background/70 flex items-center justify-center\">\n <Loader2 className=\"h-4 w-4 animate-spin text-primary\" />\n </span>\n )}\n </button>\n <div className=\"space-y-1 text-xs text-muted-foreground\">\n <p>JPG, PNG, GIF, SVG or WebP</p>\n {imagePreview && (\n <button type=\"button\" onClick={clearImage} className=\"inline-flex items-center gap-1 text-muted-foreground active:text-foreground\">\n <X className=\"h-3 w-3\" /> Remove\n </button>\n )}\n {uploadError && <p className=\"text-destructive\">{uploadError}</p>}\n {uploadSuccess && <p className=\"text-emerald-500\">✓ {uploadSuccess}</p>}\n </div>\n <input\n ref={fileInputRef}\n type=\"file\"\n accept={acceptFor(\"image\")}\n className=\"hidden\"\n onChange={(e) => { const f = e.target.files?.[0]; if (f) void handleImageSelect(f); }}\n />\n </div>\n </div>\n\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"name\">Name</Label>\n <Input id=\"name\" value={name} onChange={(e) => handleNameChange(e.target.value)} placeholder=\"My Coin\" />\n {nameErr && <p className=\"text-xs text-destructive\">{nameErr}</p>}\n </div>\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"symbol\">Symbol</Label>\n <Input id=\"symbol\" value={symbol} onChange={(e) => setSymbol(e.target.value.toUpperCase())} placeholder=\"COIN\" />\n {symErr && <p className=\"text-xs text-destructive\">{symErr}</p>}\n </div>\n </div>\n\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"description\">Description</Label>\n <Textarea\n id=\"description\"\n value={description}\n onChange={(e) => setDescription(e.target.value.slice(0, 500))}\n placeholder=\"Tell your community what this coin is about…\"\n rows={3}\n />\n </div>\n\n </section>\n\n <div className=\"h-px bg-border/60\" />\n\n <section className=\"space-y-4\">\n <div>\n <h3 className=\"text-lg font-bold\">Set the numbers</h3>\n </div>\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"supply\">Total supply</Label>\n <div className=\"flex gap-2 mb-1\">\n {SUPPLY_PRESETS.map((p) => (\n <button\n key={p.label}\n type=\"button\"\n onClick={() => setSupply(p.value)}\n className={cn(\n \"rounded-lg border px-3.5 py-1.5 text-sm font-medium\",\n supply === p.value ? \"border-brand-orange bg-brand-orange/10 text-brand-orange\" : \"border-border text-muted-foreground\",\n )}\n >\n {p.label}\n </button>\n ))}\n </div>\n <div className=\"relative\">\n <Input\n id=\"supply\" inputMode=\"numeric\"\n value={supply ? Number(supply).toLocaleString() : \"\"}\n onChange={(e) => setSupply(e.target.value.replace(/[^\\d]/g, \"\"))}\n placeholder=\"1,000,000\"\n className=\"pr-16 text-lg font-semibold tabular-nums\"\n />\n <span className=\"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm font-medium text-muted-foreground\">\n coins\n </span>\n </div>\n {supplyErr && <p className=\"text-xs text-destructive\">{supplyErr}</p>}\n </div>\n\n <div className=\"space-y-1.5\">\n <Label>Pair</Label>\n <div className=\"flex gap-2 flex-wrap\">\n {QUOTE_OPTIONS.map((q) => (\n <button\n key={q}\n type=\"button\"\n onClick={() => setQuote(q)}\n className={cn(\n \"inline-flex items-center gap-1.5 rounded-lg border px-3.5 py-1.5 text-sm font-medium\",\n quote === q ? \"border-brand-maeve bg-brand-maeve/10 text-brand-maeve\" : \"border-border text-muted-foreground\",\n )}\n >\n <CurrencyIcon symbol={q} size={16} />\n {q}\n </button>\n ))}\n </div>\n </div>\n\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"price\">Price ({quote} per coin)</Label>\n <div className=\"relative\">\n <span className=\"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2\">\n <CurrencyIcon symbol={quote} size={16} />\n </span>\n <Input\n id=\"price\" inputMode=\"decimal\" value={price}\n onChange={(e) => setPrice(e.target.value.replace(/[^0-9.]/g, \"\"))}\n placeholder={String(SUGGESTED_DEFAULT_PRICE)}\n className=\"pl-9\"\n />\n </div>\n {priceErr && price && <p className=\"text-xs text-destructive\">{priceErr}</p>}\n </div>\n\n {preview && (\n <div className=\"rounded-xl bg-muted/50 dark:bg-muted/30 p-4\">\n <p className=\"text-2xs uppercase tracking-wide text-muted-foreground\">Starting market cap</p>\n <p className=\"text-2xl font-bold tabular-nums text-brand-maeve\">\n <CurrencyAmount amount={preview.fdv.toLocaleString()} symbol={quote} iconSize={18} />\n </p>\n </div>\n )}\n\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"alloc\">Your allocation: {teamPct}%</Label>\n <input\n id=\"alloc\" type=\"range\" min={1} max={10} step={1}\n value={teamPct} onChange={(e) => setTeamPct(Number(e.target.value))}\n className=\"w-full accent-[hsl(var(--brand-orange))]\"\n />\n {preview && (\n <p className={cn(\"text-sm font-semibold\", insufficient ? \"text-destructive\" : \"text-foreground\")}>\n <CurrencyAmount amount={preview.buybackHuman} symbol={quote} iconSize={14} /> required\n </p>\n )}\n {insufficient && (\n <p className=\"text-xs text-destructive\">\n Your wallet doesn&apos;t have enough {quote}. Add funds, or adjust the numbers above.\n </p>\n )}\n </div>\n\n </section>\n\n <div className=\"h-px bg-border/60\" />\n\n <section className=\"space-y-4\">\n <GradientButton\n big\n onClick={handleLaunchClick}\n disabled={!canLaunch || tx.phase !== \"idle\"}\n className={!canLaunch || tx.phase !== \"idle\" ? \"opacity-40 pointer-events-none\" : \"\"}\n >\n {tx.phase !== \"idle\" ? <><Loader2 className=\"h-4 w-4 mr-1.5 animate-spin\" /> Launching…</> : <>Launch your coin <ArrowRight className=\"h-4 w-4 ml-1.5\" /></>}\n </GradientButton>\n <p className=\"text-xs text-muted-foreground text-center\">\n <Link href=\"/claim/memecoin\" className=\"underline active:text-foreground\">\n Already launched a coin? Claim it instead.\n </Link>\n </p>\n </section>\n </div>\n </ClaimRouteShell>\n </WalletRequired>\n );\n}\n"],"mappings":";AAoMY,SAkBF,UAjBI,KADF;AAlMZ,SAAS,SAAS,gBAAgC;AAClD,SAAS,YAAY,OAAO,WAAW,SAAS,SAAS;AACzD,SAAS,kBAAkB,WAAW,cAAc,kBAAkB,wBAAwB;AAC9F;AAAA,EACE;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAoB;AAAA,EACpB,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB;AAAA,EACA;AAAA,OAEK;AACP,OAAO,WAAW;AAClB,OAAO,UAAU;AACjB,SAAS,aAAa;AACtB,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAS,yBAA+C;AACxD,SAAS,g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BAAqB,iBAAiB,GAC7F;AAAA,wCAAC,kBAAe,QAAQ,QAAQ,cAAc,QAAQ,OAAO,UAAU,IAAI;AAAA,oBAAE;AAAA,qBAC/E;AAAA,kBAED,gBACC,qBAAC,OAAE,WAAU,4BAA2B;AAAA;AAAA,oBACA;AAAA,oBAAM;AAAA,qBAC9C;AAAA,mBAEJ;AAAA,iBAEJ;AAAA,cAEA,oBAAC,SAAI,WAAU,qBAAoB;AAAA,cAEnC,qBAAC,aAAQ,WAAU,aACf;AAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,KAAG;AAAA,oBACH,SAAS;AAAA,oBACT,UAAU,CAAC,aAAa,GAAG,UAAU;AAAA,oBACrC,WAAW,CAAC,aAAa,GAAG,UAAU,SAAS,mCAAmC;AAAA,oBAEjF,aAAG,UAAU,SAAS,iCAAE;AAAA,0CAAC,WAAQ,WAAU,+BAA8B;AAAA,sBAAE;AAAA,uBAAW,IAAM,iCAAE;AAAA;AAAA,sBAAiB,oBAAC,cAAW,WAAU,kBAAiB;AAAA,uBAAE;AAAA;AAAA,gBAC3J;AAAA,gBACA,oBAAC,OAAE,WAAU,6CACX,8BAAC,QAAK,MAAK,mBAAkB,WAAU,oCAAmC,wDAE1E,GACF;AAAA,iBACJ;AAAA,eACF;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -16,7 +16,6 @@ declare const editionMintSchema: zod.ZodObject<{
16
16
  royalty: zod.ZodNumber;
17
17
  }, "strip", zod.ZodTypeAny, {
18
18
  name: string;
19
- value: string;
20
19
  ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
21
20
  licenseType: string;
22
21
  commercialUse: "Yes" | "No";
@@ -25,12 +24,12 @@ declare const editionMintSchema: zod.ZodObject<{
25
24
  geographicScope: string;
26
25
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
27
26
  royalty: number;
27
+ value: string;
28
28
  recipient: string;
29
29
  description?: string | undefined;
30
30
  external_url?: string | undefined;
31
31
  }, {
32
32
  name: string;
33
- value: string;
34
33
  ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
35
34
  licenseType: string;
36
35
  commercialUse: "Yes" | "No";
@@ -39,6 +38,7 @@ declare const editionMintSchema: zod.ZodObject<{
39
38
  geographicScope: string;
40
39
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
41
40
  royalty: number;
41
+ value: string;
42
42
  recipient: string;
43
43
  description?: string | undefined;
44
44
  external_url?: string | undefined;
@@ -16,7 +16,6 @@ declare const editionMintSchema: zod.ZodObject<{
16
16
  royalty: zod.ZodNumber;
17
17
  }, "strip", zod.ZodTypeAny, {
18
18
  name: string;
19
- value: string;
20
19
  ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
21
20
  licenseType: string;
22
21
  commercialUse: "Yes" | "No";
@@ -25,12 +24,12 @@ declare const editionMintSchema: zod.ZodObject<{
25
24
  geographicScope: string;
26
25
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
27
26
  royalty: number;
27
+ value: string;
28
28
  recipient: string;
29
29
  description?: string | undefined;
30
30
  external_url?: string | undefined;
31
31
  }, {
32
32
  name: string;
33
- value: string;
34
33
  ipType: "Audio" | "Video" | "Art" | "Photography" | "NFT" | "Software" | "RWA" | "Patents" | "Posts" | "Publications" | "Documents" | "Custom";
35
34
  licenseType: string;
36
35
  commercialUse: "Yes" | "No";
@@ -39,6 +38,7 @@ declare const editionMintSchema: zod.ZodObject<{
39
38
  geographicScope: string;
40
39
  aiPolicy: "Allowed" | "Not Allowed" | "Training Only";
41
40
  royalty: number;
41
+ value: string;
42
42
  recipient: string;
43
43
  description?: string | undefined;
44
44
  external_url?: string | undefined;