@feelflow/ffid-sdk 2.10.0 → 2.12.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.
@@ -455,9 +455,118 @@ function createBillingMethods(deps) {
455
455
  var EXT_PLANS_ENDPOINT = "/api/v1/subscriptions/ext/plans";
456
456
  var EXT_SUBSCRIPTION_ENDPOINT = "/api/v1/subscriptions/ext";
457
457
  var EXT_SUBSCRIBE_ENDPOINT = "/api/v1/subscriptions/ext/subscribe";
458
+ var FFIDSDKError = class extends Error {
459
+ code;
460
+ constructor(code, message) {
461
+ super(message);
462
+ this.name = "FFIDSDKError";
463
+ this.code = code;
464
+ }
465
+ };
458
466
  function isBlankString(value) {
459
467
  return typeof value !== "string" || value.trim() === "";
460
468
  }
469
+ var MALFORMED_PREVIEW_CODE = "MALFORMED_PLAN_CHANGE_PREVIEW";
470
+ var MALFORMED_SEAT_PREVIEW_CODE = "MALFORMED_SEAT_CHANGE_PREVIEW";
471
+ var SEAT_ESTIMATE_REASONS = /* @__PURE__ */ new Set(["no_stripe_data", "custom_pricing", "stripe_error"]);
472
+ function validatePlanChangePreview(preview) {
473
+ if (preview === null || typeof preview !== "object") {
474
+ throw new FFIDSDKError(
475
+ MALFORMED_PREVIEW_CODE,
476
+ "SDK: server returned malformed PlanChangePreview \u2014 expected object, got " + (preview === null ? "null" : typeof preview)
477
+ );
478
+ }
479
+ const p = preview;
480
+ const flag = p.willApplyAtPeriodEnd;
481
+ if (typeof flag !== "boolean") {
482
+ throw new FFIDSDKError(
483
+ MALFORMED_PREVIEW_CODE,
484
+ `SDK: server returned malformed PlanChangePreview \u2014 willApplyAtPeriodEnd must be boolean (got ${typeof flag})`
485
+ );
486
+ }
487
+ const { proratedAmount, effectiveDate } = p;
488
+ if (flag === true) {
489
+ if (proratedAmount !== 0) {
490
+ throw new FFIDSDKError(
491
+ MALFORMED_PREVIEW_CODE,
492
+ `SDK: server returned malformed PlanChangePreview \u2014 willApplyAtPeriodEnd=true requires proratedAmount=0 (got ${JSON.stringify(proratedAmount)})`
493
+ );
494
+ }
495
+ if (effectiveDate !== null && typeof effectiveDate !== "string") {
496
+ throw new FFIDSDKError(
497
+ MALFORMED_PREVIEW_CODE,
498
+ `SDK: server returned malformed PlanChangePreview \u2014 willApplyAtPeriodEnd=true requires effectiveDate to be string or null (got ${typeof effectiveDate})`
499
+ );
500
+ }
501
+ return;
502
+ }
503
+ if (effectiveDate !== null) {
504
+ throw new FFIDSDKError(
505
+ MALFORMED_PREVIEW_CODE,
506
+ `SDK: server returned malformed PlanChangePreview \u2014 willApplyAtPeriodEnd=false requires effectiveDate=null (got ${JSON.stringify(effectiveDate)})`
507
+ );
508
+ }
509
+ if (typeof proratedAmount !== "number") {
510
+ throw new FFIDSDKError(
511
+ MALFORMED_PREVIEW_CODE,
512
+ `SDK: server returned malformed PlanChangePreview \u2014 willApplyAtPeriodEnd=false requires proratedAmount to be a number (got ${typeof proratedAmount})`
513
+ );
514
+ }
515
+ }
516
+ function validateSeatChangePreview(preview) {
517
+ if (preview === null || typeof preview !== "object") {
518
+ throw new FFIDSDKError(
519
+ MALFORMED_SEAT_PREVIEW_CODE,
520
+ "SDK: server returned malformed SeatChangePreview \u2014 expected object, got " + (preview === null ? "null" : typeof preview)
521
+ );
522
+ }
523
+ const p = preview;
524
+ if (p.type !== "seat-change") {
525
+ throw new FFIDSDKError(
526
+ MALFORMED_SEAT_PREVIEW_CODE,
527
+ `SDK: server returned malformed SeatChangePreview \u2014 type must be 'seat-change' (got ${JSON.stringify(p.type)})`
528
+ );
529
+ }
530
+ const numericFields = [
531
+ "currentQuantity",
532
+ "newQuantity",
533
+ "unitPrice",
534
+ "proratedAmount",
535
+ "nextInvoiceAmount"
536
+ ];
537
+ for (const key of numericFields) {
538
+ if (typeof p[key] !== "number") {
539
+ throw new FFIDSDKError(
540
+ MALFORMED_SEAT_PREVIEW_CODE,
541
+ `SDK: server returned malformed SeatChangePreview \u2014 ${key} must be a number (got ${typeof p[key]})`
542
+ );
543
+ }
544
+ }
545
+ if (p.nextInvoiceDate !== null && typeof p.nextInvoiceDate !== "string") {
546
+ throw new FFIDSDKError(
547
+ MALFORMED_SEAT_PREVIEW_CODE,
548
+ `SDK: server returned malformed SeatChangePreview \u2014 nextInvoiceDate must be string or null (got ${typeof p.nextInvoiceDate})`
549
+ );
550
+ }
551
+ if (typeof p.isEstimate !== "boolean") {
552
+ throw new FFIDSDKError(
553
+ MALFORMED_SEAT_PREVIEW_CODE,
554
+ `SDK: server returned malformed SeatChangePreview \u2014 isEstimate must be boolean (got ${typeof p.isEstimate})`
555
+ );
556
+ }
557
+ if (p.estimateReason !== void 0 && !SEAT_ESTIMATE_REASONS.has(p.estimateReason)) {
558
+ throw new FFIDSDKError(
559
+ MALFORMED_SEAT_PREVIEW_CODE,
560
+ `SDK: server returned malformed SeatChangePreview \u2014 estimateReason must be one of 'no_stripe_data' | 'custom_pricing' | 'stripe_error' (got ${JSON.stringify(p.estimateReason)})`
561
+ );
562
+ }
563
+ if (!Array.isArray(p.lineItems)) {
564
+ throw new FFIDSDKError(
565
+ MALFORMED_SEAT_PREVIEW_CODE,
566
+ `SDK: server returned malformed SeatChangePreview \u2014 lineItems must be an array (got ${typeof p.lineItems})`
567
+ );
568
+ }
569
+ }
461
570
  function createSubscriptionMethods(deps) {
462
571
  const { fetchWithAuth, createError } = deps;
463
572
  async function listPlans() {
@@ -544,7 +653,7 @@ function createSubscriptionMethods(deps) {
544
653
  error: createError("VALIDATION_ERROR", "subscriptionId \u3068 planCode \u306F\u5FC5\u9808\u3067\u3059")
545
654
  };
546
655
  }
547
- return fetchWithAuth(
656
+ const response = await fetchWithAuth(
548
657
  `${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(params.subscriptionId)}/plan/preview`,
549
658
  {
550
659
  method: "POST",
@@ -554,6 +663,36 @@ function createSubscriptionMethods(deps) {
554
663
  })
555
664
  }
556
665
  );
666
+ if (response.data !== void 0) {
667
+ validatePlanChangePreview(response.data.preview);
668
+ }
669
+ return response;
670
+ }
671
+ async function previewSeatChange(params) {
672
+ if (isBlankString(params.subscriptionId)) {
673
+ return {
674
+ error: createError("VALIDATION_ERROR", "subscriptionId \u306F\u5FC5\u9808\u3067\u3059")
675
+ };
676
+ }
677
+ if (typeof params.quantity !== "number" || !Number.isInteger(params.quantity) || params.quantity < 1) {
678
+ return {
679
+ error: createError(
680
+ "VALIDATION_ERROR",
681
+ `quantity \u306F 1 \u4EE5\u4E0A\u306E\u6574\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 (received: ${String(params.quantity)})`
682
+ )
683
+ };
684
+ }
685
+ const response = await fetchWithAuth(
686
+ `${EXT_SUBSCRIPTION_ENDPOINT}/${encodeURIComponent(params.subscriptionId)}/seats/preview`,
687
+ {
688
+ method: "POST",
689
+ body: JSON.stringify({ quantity: params.quantity })
690
+ }
691
+ );
692
+ if (response.data !== void 0) {
693
+ validateSeatChangePreview(response.data.preview);
694
+ }
695
+ return response;
557
696
  }
558
697
  return {
559
698
  listPlans,
@@ -562,7 +701,8 @@ function createSubscriptionMethods(deps) {
562
701
  changePlan,
563
702
  cancelSubscription,
564
703
  cancelPendingDowngrade,
565
- previewPlanChange
704
+ previewPlanChange,
705
+ previewSeatChange
566
706
  };
567
707
  }
568
708
 
@@ -619,7 +759,7 @@ function createMembersMethods(deps) {
619
759
  }
620
760
 
621
761
  // src/client/version-check.ts
622
- var SDK_VERSION = "2.10.0";
762
+ var SDK_VERSION = "2.12.0";
623
763
  var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
624
764
  var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
625
765
  function sdkHeaders() {
@@ -1956,7 +2096,8 @@ function createFFIDClient(config) {
1956
2096
  changePlan,
1957
2097
  cancelSubscription,
1958
2098
  cancelPendingDowngrade,
1959
- previewPlanChange
2099
+ previewPlanChange,
2100
+ previewSeatChange
1960
2101
  } = createSubscriptionMethods({
1961
2102
  fetchWithAuth,
1962
2103
  createError
@@ -2046,6 +2187,7 @@ function createFFIDClient(config) {
2046
2187
  cancelSubscription,
2047
2188
  cancelPendingDowngrade,
2048
2189
  previewPlanChange,
2190
+ previewSeatChange,
2049
2191
  verifyAccessToken,
2050
2192
  getSubscribeUrl,
2051
2193
  redirectToSubscribe,
@@ -3420,43 +3562,9 @@ var FFID_INQUIRY_CATEGORIES = [
3420
3562
  "press",
3421
3563
  "other"
3422
3564
  ];
3423
- var DEFAULT_CATEGORY_LABELS_JA = {
3424
- general: "\u4E00\u822C\u7684\u306A\u304A\u554F\u3044\u5408\u308F\u305B",
3425
- sales: "\u3054\u5C0E\u5165\u30FB\u304A\u898B\u7A4D\u3082\u308A",
3426
- support: "\u30B5\u30DD\u30FC\u30C8",
3427
- partnership: "\u30D1\u30FC\u30C8\u30CA\u30FC\u30B7\u30C3\u30D7",
3428
- press: "\u53D6\u6750\u30FB\u30D7\u30EC\u30B9",
3429
- other: "\u305D\u306E\u4ED6"
3430
- };
3431
- function defaultCategories() {
3432
- return FFID_INQUIRY_CATEGORIES.map((value) => ({
3433
- value,
3434
- label: DEFAULT_CATEGORY_LABELS_JA[value]
3435
- }));
3436
- }
3437
- function renderCategoryOptions(options) {
3438
- const hasAnyGroup = options.some((o) => !!o.group);
3439
- if (!hasAnyGroup) {
3440
- return options.map((opt) => /* @__PURE__ */ jsx("option", { value: opt.value, children: opt.label }, opt.value));
3441
- }
3442
- const ungrouped = options.filter((o) => !o.group);
3443
- const groupKeys = [];
3444
- const groupLabelByKey = /* @__PURE__ */ new Map();
3445
- const itemsByKey = /* @__PURE__ */ new Map();
3446
- for (const opt of options) {
3447
- if (!opt.group) continue;
3448
- if (!itemsByKey.has(opt.group)) {
3449
- groupKeys.push(opt.group);
3450
- itemsByKey.set(opt.group, []);
3451
- groupLabelByKey.set(opt.group, opt.groupLabel ?? opt.group);
3452
- }
3453
- itemsByKey.get(opt.group).push(opt);
3454
- }
3455
- return /* @__PURE__ */ jsxs(Fragment, { children: [
3456
- ungrouped.map((opt) => /* @__PURE__ */ jsx("option", { value: opt.value, children: opt.label }, opt.value)),
3457
- groupKeys.map((key) => /* @__PURE__ */ jsx("optgroup", { label: groupLabelByKey.get(key) ?? key, children: itemsByKey.get(key).map((opt) => /* @__PURE__ */ jsx("option", { value: opt.value, children: opt.label }, opt.value)) }, key))
3458
- ] });
3459
- }
3565
+ var CATEGORY_PLACEHOLDER_LABEL_JA = "\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044";
3566
+ var CATEGORY_REQUIRED_ERROR_JA = "\u304A\u554F\u3044\u5408\u308F\u305B\u7A2E\u5225\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002";
3567
+ var SUBMIT_BUTTON_OPACITY_PENDING = 0.6;
3460
3568
  var labelStyle = {
3461
3569
  display: "block",
3462
3570
  fontSize: FONT_SIZE_SM,
@@ -3496,7 +3604,58 @@ var submitButtonStyle = {
3496
3604
  borderRadius: BORDER_RADIUS_MD,
3497
3605
  cursor: "pointer"
3498
3606
  };
3499
- var SUBMIT_BUTTON_OPACITY_PENDING = 0.6;
3607
+ var successBlockStyle = {
3608
+ padding: SPACING_LG,
3609
+ border: BORDER_DEFAULT,
3610
+ borderRadius: BORDER_RADIUS_MD,
3611
+ background: "#f0fdf4",
3612
+ color: "#166534",
3613
+ fontSize: FONT_SIZE_SM
3614
+ };
3615
+ function cx(...parts) {
3616
+ const joined = parts.filter((p) => !!p).join(" ");
3617
+ return joined.length > 0 ? joined : void 0;
3618
+ }
3619
+ function styleOrUndefined(style, unstyled) {
3620
+ return unstyled ? void 0 : style;
3621
+ }
3622
+ var DEFAULT_CATEGORY_LABELS_JA = {
3623
+ general: "\u4E00\u822C\u7684\u306A\u304A\u554F\u3044\u5408\u308F\u305B",
3624
+ sales: "\u3054\u5C0E\u5165\u30FB\u304A\u898B\u7A4D\u3082\u308A",
3625
+ support: "\u30B5\u30DD\u30FC\u30C8",
3626
+ partnership: "\u30D1\u30FC\u30C8\u30CA\u30FC\u30B7\u30C3\u30D7",
3627
+ press: "\u53D6\u6750\u30FB\u30D7\u30EC\u30B9",
3628
+ other: "\u305D\u306E\u4ED6"
3629
+ };
3630
+ function defaultCategories() {
3631
+ return FFID_INQUIRY_CATEGORIES.map((value) => ({
3632
+ value,
3633
+ label: DEFAULT_CATEGORY_LABELS_JA[value]
3634
+ }));
3635
+ }
3636
+ function renderCategoryOptions(options) {
3637
+ const hasAnyGroup = options.some((o) => !!o.group);
3638
+ if (!hasAnyGroup) {
3639
+ return options.map((opt) => /* @__PURE__ */ jsx("option", { value: opt.value, children: opt.label }, opt.value));
3640
+ }
3641
+ const ungrouped = options.filter((o) => !o.group);
3642
+ const groupKeys = [];
3643
+ const groupLabelByKey = /* @__PURE__ */ new Map();
3644
+ const itemsByKey = /* @__PURE__ */ new Map();
3645
+ for (const opt of options) {
3646
+ if (!opt.group) continue;
3647
+ if (!itemsByKey.has(opt.group)) {
3648
+ groupKeys.push(opt.group);
3649
+ itemsByKey.set(opt.group, []);
3650
+ groupLabelByKey.set(opt.group, opt.groupLabel ?? opt.group);
3651
+ }
3652
+ itemsByKey.get(opt.group).push(opt);
3653
+ }
3654
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3655
+ ungrouped.map((opt) => /* @__PURE__ */ jsx("option", { value: opt.value, children: opt.label }, opt.value)),
3656
+ groupKeys.map((key) => /* @__PURE__ */ jsx("optgroup", { label: groupLabelByKey.get(key) ?? key, children: itemsByKey.get(key).map((opt) => /* @__PURE__ */ jsx("option", { value: opt.value, children: opt.label }, opt.value)) }, key))
3657
+ ] });
3658
+ }
3500
3659
  function FFIDInquiryForm({
3501
3660
  mode,
3502
3661
  prefill,
@@ -3513,6 +3672,9 @@ function FFIDInquiryForm({
3513
3672
  onChange,
3514
3673
  separateLegalCheckboxes = false,
3515
3674
  messagePlaceholder,
3675
+ requireCategorySelection = false,
3676
+ unstyled = false,
3677
+ classNames,
3516
3678
  locale = "ja",
3517
3679
  className
3518
3680
  }) {
@@ -3530,11 +3692,20 @@ function FFIDInquiryForm({
3530
3692
  return null;
3531
3693
  }, [isAuth, organizations, preselectedOrganizationId]);
3532
3694
  const initialCategory = useMemo(() => {
3533
- const fallback = categoryOptions[0]?.value ?? "general";
3534
3695
  const requested = prefill?.category;
3535
- if (!requested) return fallback;
3536
- return categoryOptions.some((opt) => opt.value === requested) ? requested : fallback;
3537
- }, [categoryOptions, prefill?.category]);
3696
+ if (requested && categoryOptions.some((opt) => opt.value === requested)) {
3697
+ return requested;
3698
+ }
3699
+ if (requireCategorySelection) return "";
3700
+ const first = categoryOptions[0]?.value;
3701
+ if (first === void 0) {
3702
+ console.error(
3703
+ "[FFIDInquiryForm] categoryOptions is empty; set requireCategorySelection=true or provide at least one category. Submits will be blocked until a value is picked."
3704
+ );
3705
+ return "";
3706
+ }
3707
+ return first;
3708
+ }, [categoryOptions, prefill?.category, requireCategorySelection]);
3538
3709
  const [name, setName] = useState(prefill?.name ?? "");
3539
3710
  const [email, setEmail] = useState(prefill?.email ?? "");
3540
3711
  const [company, setCompany] = useState(isAuth ? "" : prefill?.company ?? "");
@@ -3553,7 +3724,7 @@ function FFIDInquiryForm({
3553
3724
  const resolvedMessagePlaceholder = useMemo(() => {
3554
3725
  if (messagePlaceholder === void 0) return void 0;
3555
3726
  if (typeof messagePlaceholder === "string") return messagePlaceholder;
3556
- return messagePlaceholder({ category });
3727
+ return messagePlaceholder({ category: category === "" ? null : category });
3557
3728
  }, [messagePlaceholder, category]);
3558
3729
  const [hydrated, setHydrated] = useState(false);
3559
3730
  useEffect(() => {
@@ -3564,6 +3735,7 @@ function FFIDInquiryForm({
3564
3735
  onChangeRef.current = onChange;
3565
3736
  }, [onChange]);
3566
3737
  useEffect(() => {
3738
+ if (category === "") return;
3567
3739
  onChangeRef.current?.({
3568
3740
  name: name.trim(),
3569
3741
  email: email.trim(),
@@ -3594,6 +3766,7 @@ function FFIDInquiryForm({
3594
3766
  turnstileToken,
3595
3767
  locale
3596
3768
  ]);
3769
+ const s = (style) => styleOrUndefined(style, unstyled);
3597
3770
  async function handleSubmit(e) {
3598
3771
  e.preventDefault();
3599
3772
  setFormError(null);
@@ -3614,15 +3787,17 @@ function FFIDInquiryForm({
3614
3787
  setFormError("\u5229\u7528\u898F\u7D04\u3068\u30D7\u30E9\u30A4\u30D0\u30B7\u30FC\u30DD\u30EA\u30B7\u30FC\u3078\u306E\u540C\u610F\u304C\u5FC5\u8981\u3067\u3059\u3002");
3615
3788
  return;
3616
3789
  }
3790
+ if (requireCategorySelection && !category) {
3791
+ setFormError(CATEGORY_REQUIRED_ERROR_JA);
3792
+ return;
3793
+ }
3617
3794
  if (!message.trim()) {
3618
3795
  setFormError("\u304A\u554F\u3044\u5408\u308F\u305B\u5185\u5BB9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
3619
3796
  return;
3620
3797
  }
3621
- if (!isAuth) {
3622
- if (!name.trim() || !email.trim()) {
3623
- setFormError("\u304A\u540D\u524D\u3068\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
3624
- return;
3625
- }
3798
+ if (!isAuth && (!name.trim() || !email.trim())) {
3799
+ setFormError("\u304A\u540D\u524D\u3068\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
3800
+ return;
3626
3801
  }
3627
3802
  setSubmitting(true);
3628
3803
  try {
@@ -3647,9 +3822,7 @@ function FFIDInquiryForm({
3647
3822
  );
3648
3823
  setMessage("");
3649
3824
  } else {
3650
- setFormError(
3651
- result.message ?? "\u9001\u4FE1\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u6642\u9593\u3092\u304A\u3044\u3066\u518D\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002"
3652
- );
3825
+ setFormError(result.message ?? "\u9001\u4FE1\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u6642\u9593\u3092\u304A\u3044\u3066\u518D\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002");
3653
3826
  }
3654
3827
  } catch (err) {
3655
3828
  console.error("[FFIDInquiryForm] onSubmit threw", err);
@@ -3663,35 +3836,56 @@ function FFIDInquiryForm({
3663
3836
  "div",
3664
3837
  {
3665
3838
  role: "status",
3666
- className,
3667
- style: {
3668
- padding: SPACING_LG,
3669
- border: BORDER_DEFAULT,
3670
- borderRadius: BORDER_RADIUS_MD,
3671
- background: "#f0fdf4",
3672
- color: "#166534",
3673
- fontSize: FONT_SIZE_SM
3674
- },
3839
+ className: cx(className, classNames?.form, classNames?.successBlock),
3840
+ style: s(successBlockStyle),
3675
3841
  children: successMessage
3676
3842
  }
3677
3843
  );
3678
3844
  }
3679
3845
  const showOrgBlock = isAuth && organizations.length >= 1;
3846
+ const rowStyle = { display: "flex", alignItems: "center", gap: SPACING_SM, marginBottom: SPACING_SM };
3847
+ const rowStyleLast = { display: "flex", alignItems: "center", gap: SPACING_SM };
3848
+ const legalRowFirst = { display: "flex", alignItems: "flex-start", gap: SPACING_SM, marginBottom: SPACING_SM };
3849
+ const legalRowLast = { display: "flex", alignItems: "flex-start", gap: SPACING_SM };
3850
+ const spanStyle = { fontSize: FONT_SIZE_SM };
3851
+ function renderTermsLink() {
3852
+ return termsHref ? /* @__PURE__ */ jsxs("a", { href: termsHref, target: "_blank", rel: "noopener noreferrer", className: classNames?.legalLink, children: [
3853
+ "\u5229\u7528\u898F\u7D04 (v",
3854
+ termsVersion,
3855
+ ")"
3856
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3857
+ "\u5229\u7528\u898F\u7D04 (v",
3858
+ termsVersion,
3859
+ ")"
3860
+ ] });
3861
+ }
3862
+ function renderPrivacyLink() {
3863
+ return privacyHref ? /* @__PURE__ */ jsxs("a", { href: privacyHref, target: "_blank", rel: "noopener noreferrer", className: classNames?.legalLink, children: [
3864
+ "\u30D7\u30E9\u30A4\u30D0\u30B7\u30FC\u30DD\u30EA\u30B7\u30FC (v",
3865
+ privacyVersion,
3866
+ ")"
3867
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3868
+ "\u30D7\u30E9\u30A4\u30D0\u30B7\u30FC\u30DD\u30EA\u30B7\u30FC (v",
3869
+ privacyVersion,
3870
+ ")"
3871
+ ] });
3872
+ }
3680
3873
  return /* @__PURE__ */ jsxs(
3681
3874
  "form",
3682
3875
  {
3683
3876
  onSubmit: handleSubmit,
3684
- className,
3877
+ className: cx(className, classNames?.form),
3685
3878
  noValidate: true,
3686
3879
  "data-hydrated": hydrated ? "true" : void 0,
3687
3880
  children: [
3688
- showOrgBlock && /* @__PURE__ */ jsxs("div", { style: fieldsetStyle, children: [
3689
- /* @__PURE__ */ jsx("label", { style: labelStyle, htmlFor: "ffid-inquiry-org", children: "\u554F\u3044\u5408\u308F\u305B\u308B\u7ACB\u5834" }),
3881
+ showOrgBlock && /* @__PURE__ */ jsxs("div", { style: s(fieldsetStyle), className: cx(classNames?.field, classNames?.orgSelectWrapper), children: [
3882
+ /* @__PURE__ */ jsx("label", { style: s(labelStyle), className: classNames?.label, htmlFor: "ffid-inquiry-org", children: "\u554F\u3044\u5408\u308F\u305B\u308B\u7ACB\u5834" }),
3690
3883
  /* @__PURE__ */ jsxs(
3691
3884
  "select",
3692
3885
  {
3693
3886
  id: "ffid-inquiry-org",
3694
- style: inputStyle,
3887
+ style: s(inputStyle),
3888
+ className: classNames?.select,
3695
3889
  value: organizationId ?? "",
3696
3890
  onChange: (e) => setOrganizationId(e.target.value || null),
3697
3891
  children: [
@@ -3704,13 +3898,14 @@ function FFIDInquiryForm({
3704
3898
  }
3705
3899
  )
3706
3900
  ] }),
3707
- /* @__PURE__ */ jsxs("div", { style: fieldsetStyle, children: [
3708
- /* @__PURE__ */ jsx("label", { style: labelStyle, htmlFor: "ffid-inquiry-name", children: "\u304A\u540D\u524D" }),
3901
+ /* @__PURE__ */ jsxs("div", { style: s(fieldsetStyle), className: classNames?.field, children: [
3902
+ /* @__PURE__ */ jsx("label", { style: s(labelStyle), className: classNames?.label, htmlFor: "ffid-inquiry-name", children: "\u304A\u540D\u524D" }),
3709
3903
  /* @__PURE__ */ jsx(
3710
3904
  "input",
3711
3905
  {
3712
3906
  id: "ffid-inquiry-name",
3713
- style: isNameReadOnly ? readOnlyStyle : inputStyle,
3907
+ style: s(isNameReadOnly ? readOnlyStyle : inputStyle),
3908
+ className: cx(classNames?.input, isNameReadOnly ? classNames?.readOnlyInput : void 0),
3714
3909
  type: "text",
3715
3910
  value: name,
3716
3911
  onChange: (e) => setName(e.target.value),
@@ -3719,13 +3914,14 @@ function FFIDInquiryForm({
3719
3914
  }
3720
3915
  )
3721
3916
  ] }),
3722
- /* @__PURE__ */ jsxs("div", { style: fieldsetStyle, children: [
3723
- /* @__PURE__ */ jsx("label", { style: labelStyle, htmlFor: "ffid-inquiry-email", children: "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9" }),
3917
+ /* @__PURE__ */ jsxs("div", { style: s(fieldsetStyle), className: classNames?.field, children: [
3918
+ /* @__PURE__ */ jsx("label", { style: s(labelStyle), className: classNames?.label, htmlFor: "ffid-inquiry-email", children: "\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9" }),
3724
3919
  /* @__PURE__ */ jsx(
3725
3920
  "input",
3726
3921
  {
3727
3922
  id: "ffid-inquiry-email",
3728
- style: isEmailReadOnly ? readOnlyStyle : inputStyle,
3923
+ style: s(isEmailReadOnly ? readOnlyStyle : inputStyle),
3924
+ className: cx(classNames?.input, isEmailReadOnly ? classNames?.readOnlyInput : void 0),
3729
3925
  type: "email",
3730
3926
  value: email,
3731
3927
  onChange: (e) => setEmail(e.target.value),
@@ -3735,26 +3931,28 @@ function FFIDInquiryForm({
3735
3931
  )
3736
3932
  ] }),
3737
3933
  !isAuth && /* @__PURE__ */ jsxs(Fragment, { children: [
3738
- /* @__PURE__ */ jsxs("div", { style: fieldsetStyle, children: [
3739
- /* @__PURE__ */ jsx("label", { style: labelStyle, htmlFor: "ffid-inquiry-company", children: "\u4F1A\u793E\u540D (\u4EFB\u610F)" }),
3934
+ /* @__PURE__ */ jsxs("div", { style: s(fieldsetStyle), className: classNames?.field, children: [
3935
+ /* @__PURE__ */ jsx("label", { style: s(labelStyle), className: classNames?.label, htmlFor: "ffid-inquiry-company", children: "\u4F1A\u793E\u540D (\u4EFB\u610F)" }),
3740
3936
  /* @__PURE__ */ jsx(
3741
3937
  "input",
3742
3938
  {
3743
3939
  id: "ffid-inquiry-company",
3744
- style: inputStyle,
3940
+ style: s(inputStyle),
3941
+ className: classNames?.input,
3745
3942
  type: "text",
3746
3943
  value: company,
3747
3944
  onChange: (e) => setCompany(e.target.value)
3748
3945
  }
3749
3946
  )
3750
3947
  ] }),
3751
- /* @__PURE__ */ jsxs("div", { style: fieldsetStyle, children: [
3752
- /* @__PURE__ */ jsx("label", { style: labelStyle, htmlFor: "ffid-inquiry-phone", children: "\u96FB\u8A71\u756A\u53F7 (\u4EFB\u610F)" }),
3948
+ /* @__PURE__ */ jsxs("div", { style: s(fieldsetStyle), className: classNames?.field, children: [
3949
+ /* @__PURE__ */ jsx("label", { style: s(labelStyle), className: classNames?.label, htmlFor: "ffid-inquiry-phone", children: "\u96FB\u8A71\u756A\u53F7 (\u4EFB\u610F)" }),
3753
3950
  /* @__PURE__ */ jsx(
3754
3951
  "input",
3755
3952
  {
3756
3953
  id: "ffid-inquiry-phone",
3757
- style: inputStyle,
3954
+ style: s(inputStyle),
3955
+ className: classNames?.input,
3758
3956
  type: "tel",
3759
3957
  value: phone,
3760
3958
  onChange: (e) => setPhone(e.target.value)
@@ -3762,26 +3960,32 @@ function FFIDInquiryForm({
3762
3960
  )
3763
3961
  ] })
3764
3962
  ] }),
3765
- /* @__PURE__ */ jsxs("div", { style: fieldsetStyle, children: [
3766
- /* @__PURE__ */ jsx("label", { style: labelStyle, htmlFor: "ffid-inquiry-category", children: "\u304A\u554F\u3044\u5408\u308F\u305B\u7A2E\u5225" }),
3767
- /* @__PURE__ */ jsx(
3963
+ /* @__PURE__ */ jsxs("div", { style: s(fieldsetStyle), className: classNames?.field, children: [
3964
+ /* @__PURE__ */ jsx("label", { style: s(labelStyle), className: classNames?.label, htmlFor: "ffid-inquiry-category", children: "\u304A\u554F\u3044\u5408\u308F\u305B\u7A2E\u5225" }),
3965
+ /* @__PURE__ */ jsxs(
3768
3966
  "select",
3769
3967
  {
3770
3968
  id: "ffid-inquiry-category",
3771
- style: inputStyle,
3969
+ style: s(inputStyle),
3970
+ className: classNames?.select,
3772
3971
  value: category,
3773
3972
  onChange: (e) => setCategory(e.target.value),
3774
- children: renderCategoryOptions(categoryOptions)
3973
+ required: requireCategorySelection,
3974
+ children: [
3975
+ requireCategorySelection && /* @__PURE__ */ jsx("option", { value: "", disabled: true, className: classNames?.categoryPlaceholderOption, children: CATEGORY_PLACEHOLDER_LABEL_JA }),
3976
+ renderCategoryOptions(categoryOptions)
3977
+ ]
3775
3978
  }
3776
3979
  )
3777
3980
  ] }),
3778
- /* @__PURE__ */ jsxs("div", { style: fieldsetStyle, children: [
3779
- /* @__PURE__ */ jsx("label", { style: labelStyle, htmlFor: "ffid-inquiry-message", children: "\u304A\u554F\u3044\u5408\u308F\u305B\u5185\u5BB9" }),
3981
+ /* @__PURE__ */ jsxs("div", { style: s(fieldsetStyle), className: classNames?.field, children: [
3982
+ /* @__PURE__ */ jsx("label", { style: s(labelStyle), className: classNames?.label, htmlFor: "ffid-inquiry-message", children: "\u304A\u554F\u3044\u5408\u308F\u305B\u5185\u5BB9" }),
3780
3983
  /* @__PURE__ */ jsx(
3781
3984
  "textarea",
3782
3985
  {
3783
3986
  id: "ffid-inquiry-message",
3784
- style: { ...inputStyle, minHeight: 180, resize: "vertical" },
3987
+ style: s({ ...inputStyle, minHeight: 180, resize: "vertical" }),
3988
+ className: classNames?.textarea,
3785
3989
  value: message,
3786
3990
  onChange: (e) => setMessage(e.target.value),
3787
3991
  placeholder: resolvedMessagePlaceholder,
@@ -3790,138 +3994,118 @@ function FFIDInquiryForm({
3790
3994
  }
3791
3995
  )
3792
3996
  ] }),
3793
- /* @__PURE__ */ jsxs("fieldset", { style: { ...fieldsetStyle, border: "none", padding: 0 }, children: [
3794
- /* @__PURE__ */ jsx("legend", { style: { ...labelStyle, marginBottom: SPACING_SM }, children: "\u30CB\u30E5\u30FC\u30B9\u30EC\u30BF\u30FC\u8CFC\u8AAD (\u4EFB\u610F)" }),
3795
- /* @__PURE__ */ jsxs("label", { style: { display: "flex", alignItems: "center", gap: SPACING_SM, marginBottom: SPACING_SM }, children: [
3997
+ /* @__PURE__ */ jsxs(
3998
+ "fieldset",
3999
+ {
4000
+ style: s({ ...fieldsetStyle, border: "none", padding: 0 }),
4001
+ className: classNames?.newsletterFieldset,
4002
+ children: [
4003
+ /* @__PURE__ */ jsx(
4004
+ "legend",
4005
+ {
4006
+ style: s({ ...labelStyle, marginBottom: SPACING_SM }),
4007
+ className: cx(classNames?.label, classNames?.newsletterLegend),
4008
+ children: "\u30CB\u30E5\u30FC\u30B9\u30EC\u30BF\u30FC\u8CFC\u8AAD (\u4EFB\u610F)"
4009
+ }
4010
+ ),
4011
+ /* @__PURE__ */ jsxs("label", { style: s(rowStyle), className: classNames?.newsletterRow, children: [
4012
+ /* @__PURE__ */ jsx(
4013
+ "input",
4014
+ {
4015
+ type: "checkbox",
4016
+ className: classNames?.newsletterCheckbox,
4017
+ checked: inquiryFollowup,
4018
+ onChange: (e) => setInquiryFollowup(e.target.checked)
4019
+ }
4020
+ ),
4021
+ /* @__PURE__ */ jsx("span", { style: s(spanStyle), children: "\u304A\u554F\u3044\u5408\u308F\u305B\u306B\u95A2\u9023\u3059\u308B\u6848\u5185\u3092\u53D7\u3051\u53D6\u308B" })
4022
+ ] }),
4023
+ /* @__PURE__ */ jsxs("label", { style: s(rowStyleLast), className: classNames?.newsletterRow, children: [
4024
+ /* @__PURE__ */ jsx(
4025
+ "input",
4026
+ {
4027
+ type: "checkbox",
4028
+ className: classNames?.newsletterCheckbox,
4029
+ checked: general,
4030
+ onChange: (e) => setGeneral(e.target.checked)
4031
+ }
4032
+ ),
4033
+ /* @__PURE__ */ jsx("span", { style: s(spanStyle), children: "\u5B9A\u671F\u30CB\u30E5\u30FC\u30B9\u30EC\u30BF\u30FC\u3092\u53D7\u3051\u53D6\u308B" })
4034
+ ] })
4035
+ ]
4036
+ }
4037
+ ),
4038
+ separateLegalCheckboxes ? /* @__PURE__ */ jsxs("div", { style: s(fieldsetStyle), className: classNames?.legalBlock, children: [
4039
+ /* @__PURE__ */ jsxs("label", { style: s(legalRowFirst), className: classNames?.legalRow, children: [
3796
4040
  /* @__PURE__ */ jsx(
3797
4041
  "input",
3798
4042
  {
3799
4043
  type: "checkbox",
3800
- checked: inquiryFollowup,
3801
- onChange: (e) => setInquiryFollowup(e.target.checked)
4044
+ className: classNames?.legalCheckbox,
4045
+ checked: agreedTerms,
4046
+ onChange: (e) => setAgreedTerms(e.target.checked),
4047
+ required: true
3802
4048
  }
3803
4049
  ),
3804
- /* @__PURE__ */ jsx("span", { style: { fontSize: FONT_SIZE_SM }, children: "\u304A\u554F\u3044\u5408\u308F\u305B\u306B\u95A2\u9023\u3059\u308B\u6848\u5185\u3092\u53D7\u3051\u53D6\u308B" })
4050
+ /* @__PURE__ */ jsxs("span", { style: s(spanStyle), children: [
4051
+ renderTermsLink(),
4052
+ " \u306B\u540C\u610F\u3057\u307E\u3059\u3002"
4053
+ ] })
3805
4054
  ] }),
3806
- /* @__PURE__ */ jsxs("label", { style: { display: "flex", alignItems: "center", gap: SPACING_SM }, children: [
3807
- /* @__PURE__ */ jsx(
3808
- "input",
3809
- {
3810
- type: "checkbox",
3811
- checked: general,
3812
- onChange: (e) => setGeneral(e.target.checked)
3813
- }
3814
- ),
3815
- /* @__PURE__ */ jsx("span", { style: { fontSize: FONT_SIZE_SM }, children: "\u5B9A\u671F\u30CB\u30E5\u30FC\u30B9\u30EC\u30BF\u30FC\u3092\u53D7\u3051\u53D6\u308B" })
3816
- ] })
3817
- ] }),
3818
- separateLegalCheckboxes ? /* @__PURE__ */ jsxs("div", { style: fieldsetStyle, children: [
3819
- /* @__PURE__ */ jsxs(
3820
- "label",
3821
- {
3822
- style: {
3823
- display: "flex",
3824
- alignItems: "flex-start",
3825
- gap: SPACING_SM,
3826
- marginBottom: SPACING_SM
3827
- },
3828
- children: [
3829
- /* @__PURE__ */ jsx(
3830
- "input",
3831
- {
3832
- type: "checkbox",
3833
- checked: agreedTerms,
3834
- onChange: (e) => setAgreedTerms(e.target.checked),
3835
- required: true
3836
- }
3837
- ),
3838
- /* @__PURE__ */ jsxs("span", { style: { fontSize: FONT_SIZE_SM }, children: [
3839
- termsHref ? /* @__PURE__ */ jsxs("a", { href: termsHref, target: "_blank", rel: "noopener noreferrer", children: [
3840
- "\u5229\u7528\u898F\u7D04 (v",
3841
- termsVersion,
3842
- ")"
3843
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3844
- "\u5229\u7528\u898F\u7D04 (v",
3845
- termsVersion,
3846
- ")"
3847
- ] }),
3848
- " ",
3849
- "\u306B\u540C\u610F\u3057\u307E\u3059\u3002"
3850
- ] })
3851
- ]
3852
- }
3853
- ),
3854
- /* @__PURE__ */ jsxs("label", { style: { display: "flex", alignItems: "flex-start", gap: SPACING_SM }, children: [
4055
+ /* @__PURE__ */ jsxs("label", { style: s(legalRowLast), className: classNames?.legalRow, children: [
3855
4056
  /* @__PURE__ */ jsx(
3856
4057
  "input",
3857
4058
  {
3858
4059
  type: "checkbox",
4060
+ className: classNames?.legalCheckbox,
3859
4061
  checked: agreedPrivacy,
3860
4062
  onChange: (e) => setAgreedPrivacy(e.target.checked),
3861
4063
  required: true
3862
4064
  }
3863
4065
  ),
3864
- /* @__PURE__ */ jsxs("span", { style: { fontSize: FONT_SIZE_SM }, children: [
3865
- privacyHref ? /* @__PURE__ */ jsxs("a", { href: privacyHref, target: "_blank", rel: "noopener noreferrer", children: [
3866
- "\u30D7\u30E9\u30A4\u30D0\u30B7\u30FC\u30DD\u30EA\u30B7\u30FC (v",
3867
- privacyVersion,
3868
- ")"
3869
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3870
- "\u30D7\u30E9\u30A4\u30D0\u30B7\u30FC\u30DD\u30EA\u30B7\u30FC (v",
3871
- privacyVersion,
3872
- ")"
3873
- ] }),
3874
- " ",
3875
- "\u306B\u540C\u610F\u3057\u307E\u3059\u3002"
4066
+ /* @__PURE__ */ jsxs("span", { style: s(spanStyle), children: [
4067
+ renderPrivacyLink(),
4068
+ " \u306B\u540C\u610F\u3057\u307E\u3059\u3002"
3876
4069
  ] })
3877
4070
  ] })
3878
- ] }) : /* @__PURE__ */ jsx("div", { style: fieldsetStyle, children: /* @__PURE__ */ jsxs("label", { style: { display: "flex", alignItems: "flex-start", gap: SPACING_SM }, children: [
4071
+ ] }) : /* @__PURE__ */ jsx("div", { style: s(fieldsetStyle), className: classNames?.legalBlock, children: /* @__PURE__ */ jsxs("label", { style: s(legalRowLast), className: classNames?.legalRow, children: [
3879
4072
  /* @__PURE__ */ jsx(
3880
4073
  "input",
3881
4074
  {
3882
4075
  type: "checkbox",
4076
+ className: classNames?.legalCheckbox,
3883
4077
  checked: agreedLegal,
3884
4078
  onChange: (e) => setAgreedLegal(e.target.checked),
3885
4079
  required: true
3886
4080
  }
3887
4081
  ),
3888
- /* @__PURE__ */ jsxs("span", { style: { fontSize: FONT_SIZE_SM }, children: [
3889
- termsHref ? /* @__PURE__ */ jsxs("a", { href: termsHref, target: "_blank", rel: "noopener noreferrer", children: [
3890
- "\u5229\u7528\u898F\u7D04 (v",
3891
- termsVersion,
3892
- ")"
3893
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3894
- "\u5229\u7528\u898F\u7D04 (v",
3895
- termsVersion,
3896
- ")"
3897
- ] }),
3898
- " ",
3899
- "\u3068",
3900
- " ",
3901
- privacyHref ? /* @__PURE__ */ jsxs("a", { href: privacyHref, target: "_blank", rel: "noopener noreferrer", children: [
3902
- "\u30D7\u30E9\u30A4\u30D0\u30B7\u30FC\u30DD\u30EA\u30B7\u30FC (v",
3903
- privacyVersion,
3904
- ")"
3905
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3906
- "\u30D7\u30E9\u30A4\u30D0\u30B7\u30FC\u30DD\u30EA\u30B7\u30FC (v",
3907
- privacyVersion,
3908
- ")"
3909
- ] }),
3910
- " ",
3911
- "\u306B\u540C\u610F\u3057\u307E\u3059\u3002"
4082
+ /* @__PURE__ */ jsxs("span", { style: s(spanStyle), children: [
4083
+ renderTermsLink(),
4084
+ " \u3068 ",
4085
+ renderPrivacyLink(),
4086
+ " \u306B\u540C\u610F\u3057\u307E\u3059\u3002"
3912
4087
  ] })
3913
4088
  ] }) }),
3914
- !isAuth && turnstileSlot && /* @__PURE__ */ jsx("div", { style: fieldsetStyle, children: turnstileSlot }),
3915
- formError && /* @__PURE__ */ jsx("p", { role: "alert", style: { ...errorTextStyle, marginBottom: SPACING_MD }, children: formError }),
4089
+ !isAuth && turnstileSlot && /* @__PURE__ */ jsx("div", { style: s(fieldsetStyle), className: classNames?.field, children: turnstileSlot }),
4090
+ formError && /* @__PURE__ */ jsx(
4091
+ "p",
4092
+ {
4093
+ role: "alert",
4094
+ style: s({ ...errorTextStyle, marginBottom: SPACING_MD }),
4095
+ className: classNames?.errorText,
4096
+ children: formError
4097
+ }
4098
+ ),
3916
4099
  /* @__PURE__ */ jsx(
3917
4100
  "button",
3918
4101
  {
3919
4102
  type: "submit",
3920
- style: {
4103
+ style: s({
3921
4104
  ...submitButtonStyle,
3922
4105
  opacity: submitting ? SUBMIT_BUTTON_OPACITY_PENDING : 1,
3923
4106
  cursor: submitting ? "not-allowed" : "pointer"
3924
- },
4107
+ }),
4108
+ className: classNames?.submitButton,
3925
4109
  disabled: submitting,
3926
4110
  children: submitting ? "\u9001\u4FE1\u4E2D..." : "\u9001\u4FE1\u3059\u308B"
3927
4111
  }
@@ -3931,4 +4115,4 @@ function FFIDInquiryForm({
3931
4115
  );
3932
4116
  }
3933
4117
 
3934
- export { DEFAULT_API_BASE_URL, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_INQUIRY_CATEGORIES, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useFFIDContext, useSubscription, withSubscription };
4118
+ export { DEFAULT_API_BASE_URL, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_INQUIRY_CATEGORIES, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, retrieveCodeVerifier, storeCodeVerifier, useFFID, useFFIDAnnouncements, useFFIDContext, useSubscription, withSubscription };