@tbox.cn/app-module-member 1.0.0-alpha.1 → 1.0.0-alpha.10

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.
@@ -1,767 +0,0 @@
1
- // src/client/index.ts
2
- import "./member-372B74DY.css";
3
-
4
- // src/client/cards/member-info/index.tsx
5
- import { CalendarBlank, Phone, Tag, UserCircle } from "@phosphor-icons/react";
6
-
7
- // src/client/components/ImageWithFallback.tsx
8
- import { useEffect, useState } from "react";
9
- import { ImageSquare } from "@phosphor-icons/react";
10
- import { jsx } from "react/jsx-runtime";
11
- function ImageWithFallback(props) {
12
- const { src, alt, className, size = 40, loading = "lazy", fallback } = props;
13
- const [failed, setFailed] = useState(false);
14
- useEffect(() => setFailed(false), [src]);
15
- if (!src || failed) {
16
- return /* @__PURE__ */ jsx("div", { className: `img-fallback ${className ?? ""}`.trim(), "aria-label": alt, role: "img", children: fallback ?? /* @__PURE__ */ jsx(ImageSquare, { weight: "duotone", size: Math.round(size * 0.45) }) });
17
- }
18
- return /* @__PURE__ */ jsx(
19
- "img",
20
- {
21
- className,
22
- src,
23
- alt,
24
- loading,
25
- referrerPolicy: "no-referrer",
26
- onError: () => setFailed(true)
27
- }
28
- );
29
- }
30
-
31
- // src/client/cards/view.ts
32
- function pointAmountClass(amount) {
33
- return amount.startsWith("-") ? "member-pu__amount--spend" : "member-pu__amount--income";
34
- }
35
- function formatMemberDate(value) {
36
- if (!value) return "";
37
- const match = /^(\d{4})-(\d{2})-(\d{2})/u.exec(value);
38
- return match ? `${match[1]}.${match[2]}.${match[3]}` : value;
39
- }
40
- function enrollmentStateText(state) {
41
- switch (state) {
42
- case "active":
43
- return "\u5165\u4F1A\u6210\u529F";
44
- case "pending_confirmation":
45
- return "\u5382\u5546\u786E\u8BA4\u4E2D";
46
- case "confirmation_timeout":
47
- return "\u786E\u8BA4\u8D85\u65F6";
48
- default:
49
- return "\u672A\u5B8C\u6210";
50
- }
51
- }
52
- function enrollmentTone(state) {
53
- if (state === "active") return "success";
54
- if (state === "pending_confirmation") return "warning";
55
- return "neutral";
56
- }
57
- function memberStateText(state, authState) {
58
- if (state === "active") return "\u5DF2\u5165\u4F1A";
59
- if (state === "closed") return "\u5DF2\u6CE8\u9500";
60
- if (state === "unknown") return authState === "unauthenticated" ? "\u672A\u767B\u5F55" : "\u72B6\u6001\u5F85\u786E\u8BA4";
61
- return "\u672A\u5165\u4F1A";
62
- }
63
-
64
- // src/client/cards/member-info/index.tsx
65
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
66
- function MemberInfoCard(props) {
67
- const { data } = props;
68
- return /* @__PURE__ */ jsxs("section", { className: "member-card member-info", children: [
69
- /* @__PURE__ */ jsxs("div", { className: "member-info__head", children: [
70
- data.avatarUrl ? /* @__PURE__ */ jsx2(ImageWithFallback, { src: data.avatarUrl, alt: data.displayName ?? "\u4F1A\u5458\u5934\u50CF", className: "member-info__avatar", size: 48 }) : /* @__PURE__ */ jsx2("div", { className: "member-info__avatar member-info__avatar--fallback", "aria-hidden": "true", children: /* @__PURE__ */ jsx2(UserCircle, { size: 34, weight: "duotone" }) }),
71
- /* @__PURE__ */ jsxs("div", { className: "member-info__body", children: [
72
- /* @__PURE__ */ jsx2("span", { className: "member-info__eyebrow", children: "\u4F1A\u5458\u8D44\u6599" }),
73
- /* @__PURE__ */ jsxs("div", { className: "member-info__name-row", children: [
74
- /* @__PURE__ */ jsx2("strong", { children: data.displayName ?? "\u4F1A\u5458" }),
75
- /* @__PURE__ */ jsx2("span", { className: `member-status member-status--${data.state === "active" ? "active" : "inactive"}`, children: memberStateText(data.state, data.authState) })
76
- ] })
77
- ] })
78
- ] }),
79
- (data.contactDisplay || data.registeredAt) && /* @__PURE__ */ jsxs("dl", { className: "member-info__details", children: [
80
- data.contactDisplay && /* @__PURE__ */ jsxs("div", { children: [
81
- /* @__PURE__ */ jsxs("dt", { children: [
82
- /* @__PURE__ */ jsx2(Phone, { size: 16, weight: "duotone" }),
83
- "\u8054\u7CFB\u65B9\u5F0F"
84
- ] }),
85
- /* @__PURE__ */ jsx2("dd", { children: data.contactDisplay })
86
- ] }),
87
- data.registeredAt && /* @__PURE__ */ jsxs("div", { children: [
88
- /* @__PURE__ */ jsxs("dt", { children: [
89
- /* @__PURE__ */ jsx2(CalendarBlank, { size: 16, weight: "duotone" }),
90
- "\u5165\u4F1A\u65F6\u95F4"
91
- ] }),
92
- /* @__PURE__ */ jsx2("dd", { children: formatMemberDate(data.registeredAt) })
93
- ] })
94
- ] }),
95
- data.labels.length > 0 && /* @__PURE__ */ jsxs("div", { className: "member-info__labels", children: [
96
- /* @__PURE__ */ jsxs("div", { className: "member-info__section-title", children: [
97
- /* @__PURE__ */ jsx2(Tag, { size: 16, weight: "duotone" }),
98
- "\u4F1A\u5458\u6807\u7B7E"
99
- ] }),
100
- /* @__PURE__ */ jsx2("div", { className: "member-tags", children: data.labels.map((l) => /* @__PURE__ */ jsx2("span", { children: l.name }, l.labelRef)) })
101
- ] })
102
- ] });
103
- }
104
- var member_info_default = MemberInfoCard;
105
-
106
- // src/client/cards/member-card-summary/index.tsx
107
- import { useEffect as useEffect2, useMemo, useRef, useState as useState2 } from "react";
108
- import { createPortal } from "react-dom";
109
- import { X } from "@phosphor-icons/react";
110
- import { markSelfRendering, sendCardAction } from "@tbox.cn/app-agent-sdk-client";
111
- import { Car, Confetti, Coins, Gift, Sparkle } from "@phosphor-icons/react";
112
- import { MEMBER_PREFERENCE_PROMPTS } from "@tbox.cn/app-contracts-mall";
113
- import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
114
- function isProviderMiniappUrl(value) {
115
- return /^(alipays|alipayrisk):\/\/[^/?#]/u.test(value);
116
- }
117
- function renderBenefitText(text) {
118
- const parts = text.split(/(\d{3,4}-\d{7,8}|\d{7,12})/u);
119
- return parts.map((part, index) => /^\d{3,4}-\d{7,8}$|^\d{7,12}$/u.test(part) ? /* @__PURE__ */ jsx3("a", { href: `tel:${part.replace(/-/gu, "")}`, children: part }, `${part}-${String(index)}`) : /* @__PURE__ */ jsx3("span", { children: part }, `${String(index)}-${part}`));
120
- }
121
- function BenefitFallbackIcon({ name }) {
122
- const props = {
123
- "aria-hidden": true,
124
- className: "member-card-summary__benefit-icon-fallback",
125
- size: 28,
126
- weight: "duotone"
127
- };
128
- if (/停车|泊车/.test(name)) return /* @__PURE__ */ jsx3(Car, { ...props });
129
- if (/积分|消费/.test(name)) return /* @__PURE__ */ jsx3(Coins, { ...props });
130
- if (/活动|派对/.test(name)) return /* @__PURE__ */ jsx3(Confetti, { ...props });
131
- return /* @__PURE__ */ jsx3(Gift, { ...props });
132
- }
133
- var BENEFITS_PER_PAGE = 8;
134
- function MemberCardSummaryCard(props) {
135
- const { data, cardId = "", isHistory = false } = props;
136
- const dynamicFace = data.presentation !== void 0;
137
- const labelsEmbedded = data.presentation?.labelsEmbedded === true;
138
- const benefitPages = useMemo(() => {
139
- const items = data.benefits;
140
- if (!items?.length) return [];
141
- const pages = [];
142
- for (let i = 0; i < items.length; i += BENEFITS_PER_PAGE) {
143
- pages.push(items.slice(i, i + BENEFITS_PER_PAGE));
144
- }
145
- return pages;
146
- }, [data.benefits]);
147
- const [benefitPage, setBenefitPage] = useState2(0);
148
- const onBenefitsScroll = (event) => {
149
- const el = event.currentTarget;
150
- if (el.clientWidth === 0) return;
151
- const next = Math.round(el.scrollLeft / el.clientWidth);
152
- setBenefitPage((prev) => prev === next ? prev : next);
153
- };
154
- const preferencePrompts = data.preferencePrompts ?? MEMBER_PREFERENCE_PROMPTS;
155
- const [pointsRuleOpen, setPointsRuleOpen] = useState2(false);
156
- const [pointsRuleClosing, setPointsRuleClosing] = useState2(false);
157
- const [benefitAction, setBenefitAction] = useState2();
158
- const benefitActionCloseTimerRef = useRef();
159
- const pointsRuleTriggerRef = useRef(null);
160
- const pointsRuleCloseRef = useRef(null);
161
- const pointsRuleCloseTimerRef = useRef();
162
- useEffect2(() => {
163
- if (!pointsRuleOpen) return;
164
- const previousOverflow = document.body.style.overflow;
165
- document.body.style.overflow = "hidden";
166
- pointsRuleCloseRef.current?.focus();
167
- const onKeyDown = (event) => {
168
- if (event.key !== "Escape") return;
169
- closePointsRule();
170
- };
171
- window.addEventListener("keydown", onKeyDown);
172
- return () => {
173
- document.body.style.overflow = previousOverflow;
174
- window.removeEventListener("keydown", onKeyDown);
175
- };
176
- }, [pointsRuleOpen]);
177
- useEffect2(() => () => {
178
- window.clearTimeout(pointsRuleCloseTimerRef.current);
179
- window.clearTimeout(benefitActionCloseTimerRef.current);
180
- }, []);
181
- const closeBenefitAction = () => {
182
- if (!benefitAction || benefitAction.closing) return;
183
- setBenefitAction({ ...benefitAction, closing: true });
184
- benefitActionCloseTimerRef.current = window.setTimeout(() => setBenefitAction(void 0), 180);
185
- };
186
- const finishClosePointsRule = () => {
187
- window.clearTimeout(pointsRuleCloseTimerRef.current);
188
- setPointsRuleOpen(false);
189
- setPointsRuleClosing(false);
190
- pointsRuleTriggerRef.current?.focus();
191
- };
192
- const closePointsRule = () => {
193
- if (pointsRuleClosing) return;
194
- setPointsRuleClosing(true);
195
- pointsRuleCloseTimerRef.current = window.setTimeout(finishClosePointsRule, 220);
196
- };
197
- const openPointsRule = (event) => {
198
- event.preventDefault();
199
- event.stopPropagation();
200
- setPointsRuleClosing(false);
201
- setPointsRuleOpen(true);
202
- };
203
- const pointsRuleTrigger = data.pointsRuleImageUrl || data.pointsRuleContent ? /* @__PURE__ */ jsx3(
204
- "button",
205
- {
206
- ref: pointsRuleTriggerRef,
207
- type: "button",
208
- className: labelsEmbedded ? "member-card-summary__rule-hotspot" : "member-card-summary__rule-trigger",
209
- "aria-label": "\u79EF\u5206\u89C4\u5219",
210
- "aria-haspopup": "dialog",
211
- onClick: openPointsRule,
212
- children: labelsEmbedded ? null : /* @__PURE__ */ jsx3("span", { children: "\u79EF\u5206\u89C4\u5219" })
213
- }
214
- ) : null;
215
- return /* @__PURE__ */ jsxs2("section", { className: `member-card member-card-summary${dynamicFace ? ` member-card-summary--dynamic member-card-summary--${data.presentation.variant}` : ""}`, children: [
216
- dynamicFace ? /* @__PURE__ */ jsxs2(
217
- "div",
218
- {
219
- className: `member-card-summary__face member-card-summary__face--dynamic member-card-summary__face--${data.presentation.variant}${labelsEmbedded ? " member-card-summary__face--embedded" : ""}`,
220
- "aria-label": `${data.cardDisplay}\uFF0C\u53EF\u7528\u79EF\u5206 ${String(data.availablePoints)}`,
221
- children: [
222
- data.cardImageUrl ? /* @__PURE__ */ jsx3(
223
- ImageWithFallback,
224
- {
225
- src: data.cardImageUrl,
226
- alt: "",
227
- className: "member-card-summary__background",
228
- size: 96,
229
- loading: "eager"
230
- }
231
- ) : /* @__PURE__ */ jsx3("span", { className: "member-card-summary__background member-card-summary__background--fallback" }),
232
- /* @__PURE__ */ jsxs2("div", { className: "member-card-summary__overlay", children: [
233
- !labelsEmbedded && /* @__PURE__ */ jsxs2(Fragment, { children: [
234
- /* @__PURE__ */ jsx3("strong", { className: "member-card-summary__level", children: data.cardDisplay }),
235
- data.pointsUrl ? /* @__PURE__ */ jsxs2("button", { type: "button", className: "member-card-summary__points-label", onClick: () => sendCardAction(cardId, { type: "openLink", url: data.pointsUrl }), children: [
236
- "\u6211\u7684\u79EF\u5206 ",
237
- /* @__PURE__ */ jsx3("span", { "aria-hidden": "true", children: ">" })
238
- ] }) : /* @__PURE__ */ jsxs2("span", { className: "member-card-summary__points-label", children: [
239
- "\u6211\u7684\u79EF\u5206 ",
240
- /* @__PURE__ */ jsx3("span", { "aria-hidden": "true", children: ">" })
241
- ] })
242
- ] }),
243
- /* @__PURE__ */ jsx3("b", { className: `member-card-summary__balance${labelsEmbedded ? " member-card-summary__balance--embedded" : ""}`, children: String(data.availablePoints) }),
244
- data.progress && /* @__PURE__ */ jsxs2("div", { className: "member-card-summary__progress", children: [
245
- /* @__PURE__ */ jsx3("div", { className: `member-card-summary__progress-text${data.progress.message.length > 24 ? " member-card-summary__progress-text--scroll" : ""}`, children: /* @__PURE__ */ jsx3("span", { children: data.progress.message }) }),
246
- /* @__PURE__ */ jsx3(
247
- "div",
248
- {
249
- className: "member-card-summary__progress-track",
250
- role: "progressbar",
251
- "aria-label": "\u4F1A\u5458\u7B49\u7EA7\u6D88\u8D39\u8FDB\u5EA6",
252
- "aria-valuemin": 0,
253
- "aria-valuemax": 100,
254
- "aria-valuenow": Math.round(data.progress.percent),
255
- children: /* @__PURE__ */ jsx3("span", { style: { width: `${data.progress.percent}%` } })
256
- }
257
- )
258
- ] }),
259
- labelsEmbedded && data.pointsUrl && /* @__PURE__ */ jsx3(
260
- "button",
261
- {
262
- type: "button",
263
- className: "member-card-summary__points-hotspot",
264
- "aria-label": "\u6253\u5F00\u6211\u7684\u79EF\u5206",
265
- onClick: () => sendCardAction(cardId, { type: "openLink", url: data.pointsUrl })
266
- }
267
- ),
268
- pointsRuleTrigger
269
- ] })
270
- ]
271
- }
272
- ) : data.cardImageUrl ? /* @__PURE__ */ jsx3(
273
- ImageWithFallback,
274
- {
275
- src: data.cardImageUrl,
276
- alt: data.cardDisplay,
277
- className: "member-card-summary__face",
278
- size: 96,
279
- loading: "eager"
280
- }
281
- ) : /* @__PURE__ */ jsx3("div", { className: "member-card-summary__face member-card-summary__face--gradient", children: /* @__PURE__ */ jsx3("strong", { children: data.cardDisplay }) }),
282
- !dynamicFace && /* @__PURE__ */ jsxs2("div", { className: "member-card-summary__metric", children: [
283
- /* @__PURE__ */ jsx3("b", { className: "member-card-summary__points-value", children: String(data.availablePoints) }),
284
- /* @__PURE__ */ jsx3("span", { className: "member-card-summary__metric-label", children: "\u79EF\u5206" }),
285
- data.status !== "active" && /* @__PURE__ */ jsx3("em", { className: "member-card-summary__status", children: data.status }),
286
- pointsRuleTrigger
287
- ] }),
288
- benefitPages.length > 0 && /* @__PURE__ */ jsxs2(Fragment, { children: [
289
- /* @__PURE__ */ jsx3(
290
- "div",
291
- {
292
- className: "member-card-summary__benefit-pager",
293
- role: "group",
294
- "aria-label": "\u5F53\u524D\u4F1A\u5458\u6743\u76CA",
295
- onScroll: benefitPages.length > 1 ? onBenefitsScroll : void 0,
296
- children: benefitPages.map((page) => /* @__PURE__ */ jsx3("ul", { className: "member-card-summary__benefits", children: page.map((benefit) => /* @__PURE__ */ jsx3("li", { children: benefit.action?.kind === "miniapp" && benefit.action.url && isProviderMiniappUrl(benefit.action.url) ? /* @__PURE__ */ jsxs2(
297
- "button",
298
- {
299
- type: "button",
300
- className: "member-card-summary__benefit-button",
301
- "aria-label": `\u6253\u5F00${benefit.name}`,
302
- onClick: () => sendCardAction(cardId, { type: "openLink", url: benefit.action.url }),
303
- children: [
304
- /* @__PURE__ */ jsx3("span", { className: "member-card-summary__benefit-icon", children: /* @__PURE__ */ jsx3(
305
- ImageWithFallback,
306
- {
307
- src: benefit.iconUrl,
308
- alt: `${benefit.name}\u6743\u76CA\u56FE\u6807`,
309
- size: 48,
310
- loading: "eager",
311
- fallback: /* @__PURE__ */ jsx3(BenefitFallbackIcon, { name: benefit.name })
312
- }
313
- ) }),
314
- /* @__PURE__ */ jsxs2("span", { className: "member-card-summary__benefit-copy", children: [
315
- /* @__PURE__ */ jsx3("span", { children: benefit.name }),
316
- benefit.description && /* @__PURE__ */ jsx3("small", { className: "member-card-summary__benefit-description", children: benefit.description })
317
- ] })
318
- ]
319
- }
320
- ) : benefit.action?.kind === "toast" ? /* @__PURE__ */ jsxs2("button", { type: "button", className: "member-card-summary__benefit-button", onClick: () => sendCardAction(cardId, { type: "toast", content: benefit.action?.text ?? "\u656C\u8BF7\u671F\u5F85~" }), children: [
321
- /* @__PURE__ */ jsx3("span", { className: "member-card-summary__benefit-icon", children: /* @__PURE__ */ jsx3(ImageWithFallback, { src: benefit.iconUrl, alt: `${benefit.name}\u6743\u76CA\u56FE\u6807`, size: 48, loading: "eager", fallback: /* @__PURE__ */ jsx3(BenefitFallbackIcon, { name: benefit.name }) }) }),
322
- /* @__PURE__ */ jsx3("span", { className: "member-card-summary__benefit-copy", children: /* @__PURE__ */ jsx3("span", { children: benefit.name }) })
323
- ] }) : benefit.action?.kind === "dialog" ? /* @__PURE__ */ jsxs2("button", { type: "button", className: "member-card-summary__benefit-button", onClick: () => setBenefitAction({ name: benefit.action?.title ?? benefit.name, url: "", title: benefit.action?.title, text: benefit.action?.text }), children: [
324
- /* @__PURE__ */ jsx3("span", { className: "member-card-summary__benefit-icon", children: /* @__PURE__ */ jsx3(ImageWithFallback, { src: benefit.iconUrl, alt: `${benefit.name}\u6743\u76CA\u56FE\u6807`, size: 48, loading: "eager", fallback: /* @__PURE__ */ jsx3(BenefitFallbackIcon, { name: benefit.name }) }) }),
325
- /* @__PURE__ */ jsx3("span", { className: "member-card-summary__benefit-copy", children: /* @__PURE__ */ jsx3("span", { children: benefit.name }) })
326
- ] }) : /* @__PURE__ */ jsxs2(Fragment, { children: [
327
- /* @__PURE__ */ jsx3("span", { className: "member-card-summary__benefit-icon", children: /* @__PURE__ */ jsx3(ImageWithFallback, { src: benefit.iconUrl, alt: `${benefit.name}\u6743\u76CA\u56FE\u6807`, size: 48, loading: "eager", fallback: /* @__PURE__ */ jsx3(BenefitFallbackIcon, { name: benefit.name }) }) }),
328
- /* @__PURE__ */ jsxs2("span", { className: "member-card-summary__benefit-copy", children: [
329
- /* @__PURE__ */ jsx3("span", { children: benefit.name }),
330
- benefit.description && /* @__PURE__ */ jsx3("small", { className: "member-card-summary__benefit-description", children: benefit.description })
331
- ] })
332
- ] }) }, benefit.benefitRef)) }, page[0].benefitRef))
333
- }
334
- ),
335
- benefitPages.length > 1 && /* @__PURE__ */ jsx3("div", { className: "member-card-summary__benefit-dots", "aria-hidden": "true", children: benefitPages.map((page, index) => /* @__PURE__ */ jsx3("span", { "data-active": index === benefitPage }, page[0].benefitRef)) })
336
- ] }),
337
- /* @__PURE__ */ jsxs2("div", { className: "member-card-summary__preferences", children: [
338
- /* @__PURE__ */ jsxs2("strong", { children: [
339
- /* @__PURE__ */ jsx3(Sparkle, { size: 15, weight: "fill", "aria-hidden": "true" }),
340
- /* @__PURE__ */ jsx3("span", { children: "\u8BF4\u8BF4\u4F60\u7684\u504F\u597D" })
341
- ] }),
342
- /* @__PURE__ */ jsx3("p", { className: "member-card-summary__preference-hint", children: "\u8BF7\u9009\u62E9\u4F60\u7684\u504F\u597D\uFF0C\u6216\u76F4\u63A5\u544A\u8BC9\u6211" }),
343
- /* @__PURE__ */ jsx3("div", { className: "member-card-summary__preference-list", children: preferencePrompts.map((prompt) => /* @__PURE__ */ jsx3(
344
- "button",
345
- {
346
- type: "button",
347
- disabled: isHistory || !cardId,
348
- onClick: () => sendCardAction(cardId, {
349
- type: "sendMessage",
350
- value: prompt.query,
351
- displayText: prompt.value,
352
- visible: true
353
- }),
354
- children: /* @__PURE__ */ jsx3("span", { children: prompt.value })
355
- },
356
- prompt.value
357
- )) })
358
- ] }),
359
- pointsRuleOpen && (data.pointsRuleImageUrl || data.pointsRuleContent) && createPortal(
360
- /* @__PURE__ */ jsx3(
361
- "div",
362
- {
363
- className: `member-points-rule${pointsRuleClosing ? " member-points-rule--closing" : ""}`,
364
- role: "dialog",
365
- "aria-modal": "true",
366
- "aria-labelledby": "member-points-rule-title",
367
- onAnimationEnd: (event) => {
368
- if (pointsRuleClosing && event.target === event.currentTarget) finishClosePointsRule();
369
- },
370
- onMouseDown: (event) => {
371
- if (event.target === event.currentTarget) closePointsRule();
372
- },
373
- children: /* @__PURE__ */ jsxs2("div", { className: "member-points-rule__panel", children: [
374
- /* @__PURE__ */ jsxs2("header", { className: "member-points-rule__header", children: [
375
- /* @__PURE__ */ jsx3("strong", { id: "member-points-rule-title", children: "\u79EF\u5206\u89C4\u5219" }),
376
- /* @__PURE__ */ jsx3(
377
- "button",
378
- {
379
- ref: pointsRuleCloseRef,
380
- type: "button",
381
- className: "member-points-rule__close",
382
- "aria-label": "\u5173\u95ED\u79EF\u5206\u89C4\u5219",
383
- onClick: closePointsRule,
384
- children: /* @__PURE__ */ jsx3(X, { size: 20, weight: "bold", "aria-hidden": "true" })
385
- }
386
- )
387
- ] }),
388
- /* @__PURE__ */ jsx3("div", { className: "member-points-rule__body", children: data.pointsRuleImageUrl ? /* @__PURE__ */ jsx3(ImageWithFallback, { src: data.pointsRuleImageUrl, alt: "\u79EF\u5206\u89C4\u5219\u8BE6\u60C5", className: "member-points-rule__image", size: 96, loading: "eager" }) : /* @__PURE__ */ jsx3("div", { className: "member-points-rule__content", children: renderBenefitText(data.pointsRuleContent ?? "") }) })
389
- ] })
390
- }
391
- ),
392
- document.body
393
- ),
394
- benefitAction && createPortal(
395
- /* @__PURE__ */ jsx3("div", { className: "member-miniapp-dialog", role: "dialog", "aria-modal": "true", "aria-label": benefitAction.title ?? benefitAction.name, onMouseDown: (event) => {
396
- if (event.target === event.currentTarget) closeBenefitAction();
397
- }, children: /* @__PURE__ */ jsxs2("div", { className: `member-miniapp-dialog__panel${benefitAction.url ? " member-miniapp-dialog__panel--miniapp" : " member-miniapp-dialog__panel--text"}${benefitAction.closing ? " member-miniapp-dialog__panel--closing" : ""}`, children: [
398
- /* @__PURE__ */ jsxs2("header", { className: "member-miniapp-dialog__header", children: [
399
- /* @__PURE__ */ jsx3("strong", { children: benefitAction.title ?? benefitAction.name }),
400
- /* @__PURE__ */ jsx3("button", { type: "button", "aria-label": "\u5173\u95ED", onClick: closeBenefitAction, children: /* @__PURE__ */ jsx3(X, { size: 20, weight: "bold", "aria-hidden": "true" }) })
401
- ] }),
402
- benefitAction.url ? /* @__PURE__ */ jsx3("iframe", { className: "member-miniapp-dialog__frame", src: benefitAction.url, title: benefitAction.title ?? benefitAction.name }) : /* @__PURE__ */ jsx3("div", { className: "member-miniapp-dialog__text", children: renderBenefitText(benefitAction.text ?? "") }),
403
- !benefitAction.url && /* @__PURE__ */ jsx3("button", { type: "button", className: "member-miniapp-dialog__confirm", onClick: closeBenefitAction, children: "\u6211\u77E5\u9053\u4E86" })
404
- ] }) }),
405
- document.body
406
- )
407
- ] });
408
- }
409
- var member_card_summary_default = markSelfRendering(MemberCardSummaryCard);
410
-
411
- // src/client/cards/member-point-usage-list/index.tsx
412
- import { ArrowDownRight, ArrowUpRight, Coins as Coins2 } from "@phosphor-icons/react";
413
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
414
- function MemberPointUsageListCard(props) {
415
- const { data } = props;
416
- return /* @__PURE__ */ jsxs3("section", { className: "member-card member-point-usage", children: [
417
- /* @__PURE__ */ jsxs3("header", { className: "member-pu__head", children: [
418
- /* @__PURE__ */ jsx4("div", { className: "member-pu__head-icon", children: /* @__PURE__ */ jsx4(Coins2, { size: 22, weight: "duotone" }) }),
419
- /* @__PURE__ */ jsxs3("div", { children: [
420
- /* @__PURE__ */ jsx4("span", { children: "\u79EF\u5206\u8D26\u6237" }),
421
- /* @__PURE__ */ jsx4("strong", { children: "\u6211\u7684\u79EF\u5206" })
422
- ] }),
423
- data.membershipLabel && /* @__PURE__ */ jsx4("em", { children: data.membershipLabel })
424
- ] }),
425
- /* @__PURE__ */ jsxs3("div", { className: "member-pu__metric", children: [
426
- /* @__PURE__ */ jsx4("b", { children: String(data.balance) }),
427
- /* @__PURE__ */ jsx4("span", { children: "\u79EF\u5206" })
428
- ] }),
429
- /* @__PURE__ */ jsxs3("div", { className: "member-pu__section-title", children: [
430
- /* @__PURE__ */ jsx4("strong", { children: "\u6700\u8FD1\u79EF\u5206\u8BB0\u5F55" }),
431
- /* @__PURE__ */ jsxs3("span", { children: [
432
- "\u5171 ",
433
- data.total ?? data.items.length,
434
- " \u6761"
435
- ] })
436
- ] }),
437
- data.items.length > 0 ? /* @__PURE__ */ jsx4("ul", { className: "member-pu__list", children: data.items.map((u) => {
438
- const isSpend = u.amount.startsWith("-");
439
- const Icon = isSpend ? ArrowUpRight : ArrowDownRight;
440
- return /* @__PURE__ */ jsxs3("li", { className: "member-pu__row", children: [
441
- /* @__PURE__ */ jsx4("span", { className: `member-pu__flow-icon member-pu__flow-icon--${isSpend ? "spend" : "income"}`, children: /* @__PURE__ */ jsx4(Icon, { size: 16, weight: "bold" }) }),
442
- /* @__PURE__ */ jsxs3("span", { className: "member-pu__copy", children: [
443
- /* @__PURE__ */ jsx4("strong", { children: u.title }),
444
- u.usedAt && /* @__PURE__ */ jsx4("small", { children: formatMemberDate(u.usedAt) })
445
- ] }),
446
- /* @__PURE__ */ jsx4("b", { className: pointAmountClass(u.amount), children: u.amount })
447
- ] }, u.usageRecordRef);
448
- }) }) : /* @__PURE__ */ jsx4("p", { className: "member-pu__empty", children: "\u6682\u65E0\u79EF\u5206\u8BB0\u5F55" })
449
- ] });
450
- }
451
- var member_point_usage_list_default = MemberPointUsageListCard;
452
-
453
- // src/client/cards/member-enrollment-form/index.tsx
454
- import { useRef as useRef2, useState as useState3 } from "react";
455
- import { Lock, ShieldCheck, UserPlus } from "@phosphor-icons/react";
456
- import { sendCardAction as sendCardAction2, markSelfRendering as markSelfRendering2 } from "@tbox.cn/app-agent-sdk-client";
457
- import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
458
- var AUTO_AUTH_ACTION = "member.request-alipay-authorization";
459
- function MemberEnrollmentFormCard(props) {
460
- const { data, cardId, isHistory, actionTokens } = props;
461
- const [values, setValues] = useState3(
462
- () => Object.fromEntries(data.fields.map((f) => [f.fieldId, f.prefill ?? ""]))
463
- );
464
- const [consented, setConsented] = useState3({});
465
- const [authRequesting, setAuthRequesting] = useState3(false);
466
- const [submitAttempted, setSubmitAttempted] = useState3(false);
467
- const [submitting, setSubmitting] = useState3(false);
468
- const authRequestingRef = useRef2(false);
469
- const submittingRef = useRef2(false);
470
- const authToken = actionTokens?.[AUTO_AUTH_ACTION];
471
- const enrollToken = actionTokens?.["member.enroll"];
472
- const fireAuth = () => {
473
- if (!authToken || isHistory || authRequestingRef.current) return;
474
- authRequestingRef.current = true;
475
- setAuthRequesting(true);
476
- sendCardAction2(cardId, { type: "moduleAction", actionId: AUTO_AUTH_ACTION, contextToken: authToken });
477
- };
478
- if (data.state === "active") {
479
- return /* @__PURE__ */ jsx5("section", { className: "member-card member-enrollment-form", children: /* @__PURE__ */ jsxs4("div", { className: "member-enrollment-form__done", children: [
480
- /* @__PURE__ */ jsx5("span", { className: "member-enrollment-form__done-icon", children: /* @__PURE__ */ jsx5(ShieldCheck, { size: 30, weight: "duotone" }) }),
481
- /* @__PURE__ */ jsxs4("span", { children: [
482
- /* @__PURE__ */ jsx5("small", { children: "\u4F1A\u5458\u72B6\u6001" }),
483
- /* @__PURE__ */ jsx5("strong", { children: "\u60A8\u5DF2\u662F\u4F1A\u5458" })
484
- ] })
485
- ] }) });
486
- }
487
- const missingFields = data.fields.filter((field) => field.required && !(values[field.fieldId] ?? "").trim());
488
- const missingConsents = data.consents.filter((consent) => consent.required && !consented[consent.consentId]);
489
- const submit = () => {
490
- if (!enrollToken || isHistory || submittingRef.current) return;
491
- setSubmitAttempted(true);
492
- if (missingFields.length > 0 || missingConsents.length > 0) return;
493
- submittingRef.current = true;
494
- setSubmitting(true);
495
- sendCardAction2(
496
- cardId,
497
- { type: "moduleAction", actionId: "member.enroll", contextToken: enrollToken },
498
- {
499
- fieldValues: values,
500
- acceptedConsentIds: data.consents.filter((c) => consented[c.consentId]).map((c) => c.consentId),
501
- formVersion: data.formVersion
502
- }
503
- );
504
- };
505
- const authStatus = data.authorization.status;
506
- return /* @__PURE__ */ jsxs4("section", { className: "member-card member-enrollment-form", children: [
507
- /* @__PURE__ */ jsxs4("header", { className: "member-enrollment-form__head", children: [
508
- /* @__PURE__ */ jsx5("span", { className: "member-enrollment-form__head-icon", children: /* @__PURE__ */ jsx5(UserPlus, { size: 22, weight: "duotone" }) }),
509
- /* @__PURE__ */ jsxs4("div", { children: [
510
- /* @__PURE__ */ jsx5("span", { children: "\u4F1A\u5458" }),
511
- /* @__PURE__ */ jsx5("strong", { children: "\u5F00\u5361\u5165\u4F1A" })
512
- ] })
513
- ] }),
514
- /* @__PURE__ */ jsx5("p", { className: "member-enrollment-form__subtitle", children: "\u5B8C\u5584\u57FA\u7840\u8D44\u6599\uFF0C\u5F00\u542F\u4F1A\u5458\u670D\u52A1" }),
515
- /* @__PURE__ */ jsx5("div", { className: `member-enrollment-form__auth member-enrollment-form__auth--${authStatus}`, children: authStatus === "authorized" ? /* @__PURE__ */ jsxs4(Fragment2, { children: [
516
- /* @__PURE__ */ jsx5(ShieldCheck, { size: 16 }),
517
- /* @__PURE__ */ jsxs4("span", { children: [
518
- "\u5DF2\u901A\u8FC7\u652F\u4ED8\u5B9D\u6388\u6743\u9884\u586B\u624B\u673A\u53F7",
519
- data.authorization.mobileMasked ? `\uFF08${data.authorization.mobileMasked}\uFF09` : ""
520
- ] })
521
- ] }) : authStatus === "required" ? /* @__PURE__ */ jsxs4(
522
- "button",
523
- {
524
- type: "button",
525
- className: "member-enrollment-form__auth-btn",
526
- disabled: isHistory || !authToken || authRequesting,
527
- onClick: fireAuth,
528
- children: [
529
- /* @__PURE__ */ jsx5(ShieldCheck, { size: 16 }),
530
- authRequesting ? "\u6B63\u5728\u8BF7\u6C42\u652F\u4ED8\u5B9D\u6388\u6743\u2026" : "\u652F\u4ED8\u5B9D\u6388\u6743\u5E76\u586B\u5145"
531
- ]
532
- }
533
- ) : /* @__PURE__ */ jsx5("span", { children: "\u652F\u4ED8\u5B9D\u6388\u6743\u4E0D\u53EF\u7528\uFF0C\u8BF7\u624B\u52A8\u586B\u5199" }) }),
534
- data.manualNotice && /* @__PURE__ */ jsx5("p", { className: "member-enrollment-form__notice", children: data.manualNotice }),
535
- data.fields.map((f) => /* @__PURE__ */ jsxs4("div", { className: "member-ef-field", children: [
536
- /* @__PURE__ */ jsxs4("label", { className: "member-ef-field__label", children: [
537
- f.label,
538
- f.required && /* @__PURE__ */ jsx5("em", { children: "*" })
539
- ] }),
540
- f.type === "select" ? /* @__PURE__ */ jsxs4(
541
- "select",
542
- {
543
- className: "member-ef-field__control",
544
- value: values[f.fieldId] ?? "",
545
- disabled: f.readOnly || isHistory,
546
- onChange: (e) => setValues((v) => ({ ...v, [f.fieldId]: e.target.value })),
547
- children: [
548
- /* @__PURE__ */ jsx5("option", { value: "", children: "\u8BF7\u9009\u62E9" }),
549
- (f.options ?? []).map((opt) => /* @__PURE__ */ jsx5("option", { value: opt, children: opt }, opt))
550
- ]
551
- }
552
- ) : /* @__PURE__ */ jsx5(
553
- "input",
554
- {
555
- className: "member-ef-field__control",
556
- type: f.type === "tel" ? "tel" : f.type === "date" ? "date" : "text",
557
- value: values[f.fieldId] ?? "",
558
- readOnly: f.readOnly || isHistory,
559
- placeholder: f.placeholder ?? "",
560
- onChange: (e) => setValues((v) => ({ ...v, [f.fieldId]: e.target.value }))
561
- }
562
- ),
563
- f.readOnly && /* @__PURE__ */ jsx5(Lock, { className: "member-ef-field__lock", size: 13, weight: "fill" }),
564
- submitAttempted && f.required && !(values[f.fieldId] ?? "").trim() && /* @__PURE__ */ jsxs4("p", { className: "member-ef-field__error", role: "alert", children: [
565
- "\u8BF7\u586B\u5199",
566
- f.label
567
- ] })
568
- ] }, f.fieldId)),
569
- /* @__PURE__ */ jsx5("div", { className: "member-ef-consents", children: data.consents.map((c) => /* @__PURE__ */ jsxs4("label", { className: "member-ef-consents__item", children: [
570
- /* @__PURE__ */ jsx5(
571
- "input",
572
- {
573
- type: "checkbox",
574
- checked: !!consented[c.consentId],
575
- disabled: isHistory,
576
- onChange: (e) => setConsented((s) => ({ ...s, [c.consentId]: e.target.checked }))
577
- }
578
- ),
579
- /* @__PURE__ */ jsxs4("span", { children: [
580
- c.title,
581
- c.required && /* @__PURE__ */ jsx5("em", { children: "\uFF08\u5FC5\u9009\uFF09" })
582
- ] })
583
- ] }, c.consentId)) }),
584
- submitAttempted && missingConsents.length > 0 && /* @__PURE__ */ jsxs4("p", { className: "member-ef-validation", role: "alert", children: [
585
- "\u8BF7\u5148\u540C\u610F\uFF1A",
586
- missingConsents.map((consent) => consent.title).join("\u3001")
587
- ] }),
588
- /* @__PURE__ */ jsx5(
589
- "button",
590
- {
591
- type: "button",
592
- className: "member-ef-submit",
593
- disabled: isHistory || !enrollToken || submitting,
594
- onClick: submit,
595
- children: submitting ? "\u6B63\u5728\u63D0\u4EA4\u2026" : "\u63D0\u4EA4\u5165\u4F1A"
596
- }
597
- )
598
- ] });
599
- }
600
- var member_enrollment_form_default = markSelfRendering2(MemberEnrollmentFormCard);
601
-
602
- // src/client/cards/member-enrollment-status/index.tsx
603
- import { useRef as useRef3, useState as useState4 } from "react";
604
- import { ArrowClockwise, CheckCircle, Clock, WarningCircle } from "@phosphor-icons/react";
605
- import { sendCardAction as sendCardAction3, markSelfRendering as markSelfRendering3 } from "@tbox.cn/app-agent-sdk-client";
606
- import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
607
- var ICONS = { success: CheckCircle, warning: Clock, neutral: WarningCircle };
608
- function MemberEnrollmentStatusCard(props) {
609
- const { data, cardId, isHistory, actionTokens } = props;
610
- const tone = enrollmentTone(data.state);
611
- const Icon = ICONS[tone];
612
- const refreshToken = actionTokens?.["member.query-enrollment-status"];
613
- const [refreshing, setRefreshing] = useState4(false);
614
- const refreshingRef = useRef3(false);
615
- return /* @__PURE__ */ jsxs5("section", { className: `member-card member-es member-es--${data.state}`, children: [
616
- /* @__PURE__ */ jsx6("span", { className: "member-es__eyebrow", children: "\u5165\u4F1A\u7533\u8BF7" }),
617
- /* @__PURE__ */ jsx6("div", { className: `member-es__icon member-es__icon--${tone}`, children: /* @__PURE__ */ jsx6(Icon, { size: 30, weight: "duotone" }) }),
618
- /* @__PURE__ */ jsx6("h4", { children: enrollmentStateText(data.state) }),
619
- data.message && /* @__PURE__ */ jsx6("p", { className: "member-es__message", children: data.message }),
620
- data.state === "active" && /* @__PURE__ */ jsx6("p", { className: "member-es__support", children: "\u4F1A\u5458\u72B6\u6001\u5DF2\u66F4\u65B0\uFF0C\u53EF\u7EE7\u7EED\u67E5\u8BE2\u4F1A\u5458\u5361\u6216\u79EF\u5206" }),
621
- (data.state === "failed" || data.state === "confirmation_timeout") && /* @__PURE__ */ jsx6("p", { className: "member-es__support", children: "\u672C\u6B21\u672A\u786E\u8BA4\u6210\u529F\uFF0C\u8BF7\u6839\u636E\u63D0\u793A\u91CD\u65B0\u53D1\u8D77\u6216\u7A0D\u540E\u518D\u8BD5" }),
622
- data.state === "pending_confirmation" && data.attemptRef && /* @__PURE__ */ jsxs5(
623
- "button",
624
- {
625
- type: "button",
626
- className: "member-es__refresh",
627
- disabled: isHistory || !refreshToken || refreshing,
628
- onClick: () => {
629
- if (!refreshToken || isHistory || refreshingRef.current) return;
630
- refreshingRef.current = true;
631
- setRefreshing(true);
632
- sendCardAction3(
633
- cardId,
634
- { type: "moduleAction", actionId: "member.query-enrollment-status", contextToken: refreshToken },
635
- { attemptRef: data.attemptRef }
636
- );
637
- },
638
- children: [
639
- /* @__PURE__ */ jsx6(ArrowClockwise, { size: 16, weight: "bold" }),
640
- refreshing ? "\u6B63\u5728\u5237\u65B0\u2026" : "\u5237\u65B0\u72B6\u6001"
641
- ]
642
- }
643
- ),
644
- isHistory && data.state === "pending_confirmation" && /* @__PURE__ */ jsx6("p", { className: "member-es__support", children: "\u5386\u53F2\u7533\u8BF7\u4E0D\u53EF\u5237\u65B0\uFF0C\u8BF7\u91CD\u65B0\u67E5\u8BE2\u5F53\u524D\u4F1A\u5458\u72B6\u6001" })
645
- ] });
646
- }
647
- var member_enrollment_status_default = markSelfRendering3(MemberEnrollmentStatusCard);
648
-
649
- // src/client/cards/member-enrollment-cta/index.tsx
650
- import { useRef as useRef4, useState as useState5 } from "react";
651
- import { ArrowSquareOut, IdentificationCard, ShieldCheck as ShieldCheck2, WarningCircle as WarningCircle2 } from "@phosphor-icons/react";
652
- import { sendCardAction as sendCardAction4 } from "@tbox.cn/app-agent-sdk-client";
653
- import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
654
- function MemberEnrollmentCtaCard(props) {
655
- const { data, cardId, isHistory } = props;
656
- const [opening, setOpening] = useState5(false);
657
- const openingRef = useRef4(false);
658
- function handleEnroll() {
659
- if (isHistory || openingRef.current || !data.enrollUrl) return;
660
- openingRef.current = true;
661
- setOpening(true);
662
- sendCardAction4(cardId, { type: "openLink", url: data.enrollUrl });
663
- }
664
- return /* @__PURE__ */ jsxs6("section", { className: "member-card member-enroll-cta", children: [
665
- /* @__PURE__ */ jsxs6("div", { className: "member-enroll-cta__hero", children: [
666
- /* @__PURE__ */ jsx7("span", { className: "member-enroll-cta__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx7(IdentificationCard, { size: 28, weight: "duotone" }) }),
667
- /* @__PURE__ */ jsx7("span", { className: "member-enroll-cta__eyebrow", children: "\u4F1A\u5458\u670D\u52A1" }),
668
- /* @__PURE__ */ jsx7("h4", { children: data.title ?? "\u5F00\u5361\u5165\u4F1A" }),
669
- /* @__PURE__ */ jsx7("p", { children: "\u524D\u5F80\u652F\u4ED8\u5B9D\u4F1A\u5458\u9875\u9762\u5B8C\u6210\u5F00\u5361\uFF0C\u7ED3\u679C\u4EE5\u9875\u9762\u4E3A\u51C6" })
670
- ] }),
671
- /* @__PURE__ */ jsxs6("div", { className: "member-enroll-cta__footer", children: [
672
- /* @__PURE__ */ jsxs6("p", { className: "member-enroll-cta__hint", children: [
673
- /* @__PURE__ */ jsx7(ShieldCheck2, { size: 16, weight: "fill", "aria-hidden": "true" }),
674
- "\u767B\u5F55\u72B6\u6001\u4E0D\u53D7\u5165\u4F1A\u7ED3\u679C\u5F71\u54CD\uFF0C\u5F00\u5361\u7ED3\u679C\u4EE5\u652F\u4ED8\u5B9D\u4F1A\u5458\u9875\u9762\u4E3A\u51C6"
675
- ] }),
676
- /* @__PURE__ */ jsxs6(
677
- "button",
678
- {
679
- type: "button",
680
- className: "member-enroll-cta__btn",
681
- disabled: isHistory || opening || !data.enrollUrl,
682
- onClick: handleEnroll,
683
- "aria-label": data.enrollUrl ? "\u7ACB\u5373\u5F00\u5361\u5165\u4F1A" : "\u5165\u4F1A\u6682\u4E0D\u53EF\u7528\uFF08\u8BF7\u8054\u7CFB\u5546\u573A\u5BA2\u670D\uFF09",
684
- children: [
685
- opening ? "\u6B63\u5728\u6253\u5F00\u652F\u4ED8\u5B9D\u2026" : data.enrollUrl ? "\u7ACB\u5373\u5F00\u5361\u5165\u4F1A" : "\u6682\u4E0D\u53EF\u7528\uFF08\u8BF7\u8054\u7CFB\u5546\u573A\u5BA2\u670D\uFF09",
686
- data.enrollUrl ? /* @__PURE__ */ jsx7(ArrowSquareOut, { size: 18, weight: "bold", "aria-hidden": "true" }) : /* @__PURE__ */ jsx7(WarningCircle2, { size: 18, weight: "fill", "aria-hidden": "true" })
687
- ]
688
- }
689
- ),
690
- isHistory && /* @__PURE__ */ jsx7("p", { className: "member-enroll-cta__history", children: "\u5386\u53F2\u5361\u7247\u4E0D\u53EF\u91CD\u590D\u64CD\u4F5C" })
691
- ] })
692
- ] });
693
- }
694
- var member_enrollment_cta_default = MemberEnrollmentCtaCard;
695
-
696
- // src/client/cards/member-login-cta/index.tsx
697
- import { useRef as useRef5, useState as useState6 } from "react";
698
- import { ArrowSquareOut as ArrowSquareOut2, WarningCircle as WarningCircle3 } from "@phosphor-icons/react";
699
- import { sendCardAction as sendCardAction5 } from "@tbox.cn/app-agent-sdk-client";
700
- import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
701
- function MemberLoginCtaCard(props) {
702
- const { data, cardId, isHistory } = props;
703
- const [opening, setOpening] = useState6(false);
704
- const openingRef = useRef5(false);
705
- function handleLogin() {
706
- if (isHistory || openingRef.current || !data.loginUrl) return;
707
- openingRef.current = true;
708
- setOpening(true);
709
- sendCardAction5(cardId, { type: "openLink", url: data.loginUrl });
710
- }
711
- return /* @__PURE__ */ jsxs7("section", { className: "member-card member-login-cta", children: [
712
- /* @__PURE__ */ jsxs7("div", { className: "member-login-cta__stage", children: [
713
- /* @__PURE__ */ jsx8("span", { className: "member-login-cta__sky", "aria-hidden": "true" }),
714
- /* @__PURE__ */ jsxs7("svg", { className: "member-login-cta__doodle", viewBox: "0 0 390 170", "aria-hidden": "true", children: [
715
- /* @__PURE__ */ jsx8("path", { d: "M50 40 l5,11 12,2 -9,9 3,12 -11,-6 -11,6 3,-12 -9,-9 12,-2 Z" }),
716
- /* @__PURE__ */ jsx8("path", { d: "M318 56 c10,-12 23,-11 29,-1 c6,10 -3,20 -12,17" }),
717
- /* @__PURE__ */ jsx8("path", { d: "M40 122 c12,-8 20,2 11,9" })
718
- ] }),
719
- /* @__PURE__ */ jsx8("span", { className: "member-login-cta__ground", "aria-hidden": "true" }),
720
- /* @__PURE__ */ jsx8("span", { className: "member-login-cta__mascot", "aria-hidden": "true" }),
721
- /* @__PURE__ */ jsx8("span", { className: "member-login-cta__grain", "aria-hidden": "true" })
722
- ] }),
723
- /* @__PURE__ */ jsx8("svg", { className: "member-login-cta__tear", viewBox: "0 0 390 16", preserveAspectRatio: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx8("path", { d: "M0,16 L390,16 L390,6 L358,10 L330,4 L298,11 L266,5 L236,12 L204,6 L174,12 L144,6 L112,13 L82,7 L52,14 L24,8 L0,12 Z" }) }),
724
- /* @__PURE__ */ jsxs7("div", { className: "member-login-cta__body", children: [
725
- /* @__PURE__ */ jsx8("h4", { children: data.title ?? "\u767B\u5F55\u540E\u7EE7\u7EED" }),
726
- /* @__PURE__ */ jsx8("p", { className: "member-login-cta__reason", children: "\u767B\u5F55\u540E\u53EF\u89E3\u9501\u5168\u90E8\u529F\u80FD" }),
727
- /* @__PURE__ */ jsxs7(
728
- "button",
729
- {
730
- type: "button",
731
- className: "member-login-cta__btn",
732
- disabled: isHistory || opening || !data.loginUrl,
733
- onClick: handleLogin,
734
- "aria-label": data.loginUrl ? "\u524D\u5F80\u767B\u5F55" : "\u767B\u5F55\u6682\u4E0D\u53EF\u7528\uFF08\u8BF7\u8054\u7CFB\u5546\u573A\u5BA2\u670D\uFF09",
735
- children: [
736
- opening ? "\u6B63\u5728\u6253\u5F00\u5546\u573A\u5C0F\u7A0B\u5E8F\u2026" : data.loginUrl ? "\u7ACB\u5373\u767B\u5F55" : "\u6682\u4E0D\u53EF\u7528\uFF08\u8BF7\u8054\u7CFB\u5546\u573A\u5BA2\u670D\uFF09",
737
- data.loginUrl ? /* @__PURE__ */ jsx8(ArrowSquareOut2, { size: 18, weight: "bold", "aria-hidden": "true" }) : /* @__PURE__ */ jsx8(WarningCircle3, { size: 18, weight: "fill", "aria-hidden": "true" })
738
- ]
739
- }
740
- ),
741
- /* @__PURE__ */ jsx8("p", { className: "member-login-cta__hint", children: "\u767B\u5F55\u5728\u5546\u573A\u5C0F\u7A0B\u5E8F\u5185\u5B8C\u6210\uFF0C\u5B8C\u6210\u540E\u56DE\u5230\u8FD9\u91CC\u7EE7\u7EED" }),
742
- isHistory && /* @__PURE__ */ jsx8("p", { className: "member-login-cta__history", children: "\u5386\u53F2\u5361\u7247\u4E0D\u53EF\u91CD\u590D\u64CD\u4F5C" })
743
- ] })
744
- ] });
745
- }
746
- var member_login_cta_default = MemberLoginCtaCard;
747
-
748
- // src/client/index.ts
749
- var cards = {
750
- "member-info": member_info_default,
751
- "member-card-summary": member_card_summary_default,
752
- "member-point-usage-list": member_point_usage_list_default,
753
- "member-enrollment-form": member_enrollment_form_default,
754
- "member-enrollment-status": member_enrollment_status_default,
755
- "member-enrollment-cta": member_enrollment_cta_default,
756
- "member-login-cta": member_login_cta_default
757
- };
758
- var clientModule = {
759
- cards,
760
- register(ctx) {
761
- ctx.cards.registerMap(cards);
762
- }
763
- };
764
-
765
- export {
766
- clientModule
767
- };