@wix/himalaya-cli 0.1655.0 → 0.1657.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 (86) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/pricing-plans/src/index.d.ts +37 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/checkout.mjs +2 -1
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +2 -1
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-pricing-plans.mjs +10 -1
  5. package/dist/browser-plane/assets.json +5 -5
  6. package/dist/browser-plane/preview-deferred/{3912fa5f6ddb60106c630fb5e48edbf12ebfd57c616d8b7aee0d32088cd3bbdf.bin → c04dd5fc5ad48e6b19678d4313159302e9a513ada94bfe515d8dfd5a54d46f5d.bin} +1 -1
  7. package/dist/browser-plane/sw.js +5 -5
  8. package/dist/cli.mjs +109 -62
  9. package/dist/preview-assets.generated.bin +0 -0
  10. package/guides/getting-started.md +4 -1
  11. package/guides/himi-skill.md +4 -1
  12. package/guides/index.json +12 -0
  13. package/guides/qa-builds.md +7 -4
  14. package/guides/recipe-auth.md +120 -0
  15. package/guides/recipe-checkout.md +108 -0
  16. package/guides/sdk-reference.json +21 -3
  17. package/package.json +2 -2
  18. package/templates/beauty-salon/dev/index.ts +2151 -2596
  19. package/templates/beauty-salon/l10n/en.json +208 -180
  20. package/templates/beauty-salon/l10n/he.json +300 -138
  21. package/templates/beauty-salon/tier5-src/_shared/pricing-plan-display.ts +64 -0
  22. package/templates/beauty-salon/tier5-src/himi-branded-lite-plans/index.ts +101 -31
  23. package/templates/beauty-salon/tier5-src/wix-spaces-my-subscriptions/index.ts +72 -70
  24. package/templates/beauty-salon/tier5-src/wix-spaces-subscription-detail/index.ts +129 -31
  25. package/templates/beauty-salon/tokens.json +17 -1
  26. package/templates/branded-lite/dev/index.ts +2272 -2685
  27. package/templates/branded-lite/l10n/en.json +225 -52
  28. package/templates/branded-lite/l10n/he.json +305 -39
  29. package/templates/branded-lite/tier5-src/_shared/pricing-plan-display.ts +64 -0
  30. package/templates/branded-lite/tier5-src/himi-branded-lite-plans/index.ts +101 -31
  31. package/templates/branded-lite/tier5-src/wix-spaces-my-subscriptions/index.ts +72 -70
  32. package/templates/branded-lite/tier5-src/wix-spaces-subscription-detail/index.ts +129 -31
  33. package/templates/branded-lite/tokens.json +5 -1
  34. package/templates/community-club/l10n/en.json +6 -1
  35. package/templates/community-club/l10n/he.json +23 -2
  36. package/templates/community-club/tokens.json +17 -1
  37. package/templates/events-meetups/l10n/en.json +6 -1
  38. package/templates/events-meetups/l10n/he.json +23 -2
  39. package/templates/events-meetups/tokens.json +17 -1
  40. package/templates/gym-fitness/dev/index.ts +2149 -2594
  41. package/templates/gym-fitness/l10n/en.json +215 -77
  42. package/templates/gym-fitness/l10n/he.json +300 -59
  43. package/templates/gym-fitness/tier5-src/_shared/pricing-plan-display.ts +64 -0
  44. package/templates/gym-fitness/tier5-src/himi-branded-lite-plans/index.ts +101 -31
  45. package/templates/gym-fitness/tier5-src/wix-spaces-my-subscriptions/index.ts +72 -70
  46. package/templates/gym-fitness/tier5-src/wix-spaces-subscription-detail/index.ts +129 -31
  47. package/templates/gym-fitness/tokens.json +17 -1
  48. package/templates/nonprofit-cause/dev/index.ts +2163 -2608
  49. package/templates/nonprofit-cause/l10n/en.json +216 -38
  50. package/templates/nonprofit-cause/l10n/he.json +300 -30
  51. package/templates/nonprofit-cause/tier5-src/_shared/pricing-plan-display.ts +64 -0
  52. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-plans/index.ts +101 -31
  53. package/templates/nonprofit-cause/tier5-src/wix-spaces-my-subscriptions/index.ts +72 -70
  54. package/templates/nonprofit-cause/tier5-src/wix-spaces-subscription-detail/index.ts +129 -31
  55. package/templates/nonprofit-cause/tokens.json +17 -1
  56. package/templates/podcast-creator/dev/index.ts +2147 -2592
  57. package/templates/podcast-creator/l10n/en.json +216 -38
  58. package/templates/podcast-creator/l10n/he.json +300 -30
  59. package/templates/podcast-creator/tier5-src/_shared/pricing-plan-display.ts +64 -0
  60. package/templates/podcast-creator/tier5-src/himi-branded-lite-plans/index.ts +101 -31
  61. package/templates/podcast-creator/tier5-src/wix-spaces-my-subscriptions/index.ts +72 -70
  62. package/templates/podcast-creator/tier5-src/wix-spaces-subscription-detail/index.ts +129 -31
  63. package/templates/podcast-creator/tokens.json +17 -1
  64. package/templates/portfolio-creative/l10n/en.json +15 -8
  65. package/templates/portfolio-creative/l10n/he.json +28 -6
  66. package/templates/portfolio-creative/tokens.json +17 -1
  67. package/templates/restaurant/l10n/en.json +14 -7
  68. package/templates/restaurant/l10n/he.json +28 -6
  69. package/templates/restaurant/tokens.json +17 -1
  70. package/templates/retail-store/l10n/en.json +15 -8
  71. package/templates/retail-store/l10n/he.json +28 -6
  72. package/templates/retail-store/tokens.json +17 -1
  73. package/templates/yoga-studio/dev/index.ts +2204 -2649
  74. package/templates/yoga-studio/l10n/en.json +216 -43
  75. package/templates/yoga-studio/l10n/he.json +300 -30
  76. package/templates/yoga-studio/tier5-src/_shared/pricing-plan-display.ts +64 -0
  77. package/templates/yoga-studio/tier5-src/himi-branded-lite-plans/index.ts +101 -31
  78. package/templates/yoga-studio/tier5-src/wix-spaces-my-subscriptions/index.ts +72 -70
  79. package/templates/yoga-studio/tier5-src/wix-spaces-subscription-detail/index.ts +129 -31
  80. package/templates/yoga-studio/tokens.json +17 -1
  81. package/templates/beauty-salon/tier5-src/wix-spaces-plan-detail/index.ts +0 -63
  82. package/templates/branded-lite/tier5-src/wix-spaces-plan-detail/index.ts +0 -63
  83. package/templates/gym-fitness/tier5-src/wix-spaces-plan-detail/index.ts +0 -63
  84. package/templates/nonprofit-cause/tier5-src/wix-spaces-plan-detail/index.ts +0 -63
  85. package/templates/podcast-creator/tier5-src/wix-spaces-plan-detail/index.ts +0 -63
  86. package/templates/yoga-studio/tier5-src/wix-spaces-plan-detail/index.ts +0 -63
@@ -41,11 +41,6 @@
41
41
  "key": "accountSettings.confirmPrivacyCta",
42
42
  "translation": "אישור"
43
43
  },
44
- "h_075a188de01e": {
45
- "source": "My Subscriptions",
46
- "key": "mySubscriptions.title",
47
- "translation": "המנויים שלי"
48
- },
49
44
  "h_085f317f41a0": {
50
45
  "source": "Update the app to change your password.",
51
46
  "key": "accountSettings.passwordUpgradeRequired",
@@ -71,11 +66,6 @@
71
66
  "translation": "שיתוף",
72
67
  "key": "blogPost.shareCta"
73
68
  },
74
- "h_09cb227b060e": {
75
- "source": "Loading plans...",
76
- "key": "plans.loadingText",
77
- "translation": "טוען תוכניות..."
78
- },
79
69
  "h_0a3c313dce38": {
80
70
  "source": "Sending reset link…",
81
71
  "key": "accountSettings.passwordResetSending",
@@ -501,11 +491,6 @@
501
491
  "key": "accountSettings.changeEmailCta",
502
492
  "translation": "שינוי כתובת אימייל"
503
493
  },
504
- "h_8fde48f31aff": {
505
- "source": "Subscription",
506
- "key": "subscriptionDetail.chromeTitle",
507
- "translation": "מנוי"
508
- },
509
494
  "h_9092d98ced48": {
510
495
  "source": "Add to Calendar",
511
496
  "key": "agenda.addToCalendarCta",
@@ -674,7 +659,8 @@
674
659
  "h_badd385121c5": {
675
660
  "source": "View details",
676
661
  "translation": "צפייה בפרטים",
677
- "key": "collection.viewDetails"
662
+ "key": "collection.viewDetails",
663
+ "keyOrigin": "string-table"
678
664
  },
679
665
  "h_bbfa773e5a63": {
680
666
  "source": "Close",
@@ -871,11 +857,6 @@
871
857
  "translation": "שמירה",
872
858
  "key": "collection.save"
873
859
  },
874
- "h_f014740803c5": {
875
- "source": "Plan details",
876
- "key": "planDetail.chromeTitle",
877
- "translation": "פרטי התוכנית"
878
- },
879
860
  "h_f32d5a3b17e6": {
880
861
  "source": "Support",
881
862
  "key": "appInfo.supportLink",
@@ -896,6 +877,11 @@
896
877
  "translation": "הזמנה",
897
878
  "key": "tab.book"
898
879
  },
880
+ "h_f840ac65b3e5": {
881
+ "source": "Canceled",
882
+ "translation": "בוטל",
883
+ "key": "subscriptionDetail.status.CANCELED"
884
+ },
899
885
  "h_f8d7466bcdc7": {
900
886
  "source": "What's happening?",
901
887
  "key": "feed.composerPlaceholder",
@@ -931,6 +917,11 @@
931
917
  "translation": "מדיה",
932
918
  "key": "drawer.section.media"
933
919
  },
920
+ "h_a733b809d2f1": {
921
+ "source": "Active",
922
+ "key": "mySubscriptions.active",
923
+ "translation": "פעיל"
924
+ },
934
925
  "h_947849cd96b2": {
935
926
  "source": "No image available",
936
927
  "key": "collection.noImage",
@@ -1063,6 +1054,141 @@
1063
1054
  "key": "blog.categoriesLabel",
1064
1055
  "translation": "קטגוריות פוסטים"
1065
1056
  },
1057
+ "h_a689a999a5e6": {
1058
+ "source": "Expired",
1059
+ "key": "mySubscriptions.expired",
1060
+ "translation": "פג תוקף"
1061
+ },
1062
+ "h_0febe76e354b": {
1063
+ "source": "You do not have access to this subscription.",
1064
+ "key": "subscriptionDetail.accessDenied",
1065
+ "translation": "אין לך גישה למנוי הזה."
1066
+ },
1067
+ "h_168ec872ecc7": {
1068
+ "source": "Plan price",
1069
+ "key": "planDetail.planPrice",
1070
+ "translation": "מחיר התוכנית"
1071
+ },
1072
+ "h_3fdb5e335327": {
1073
+ "source": "More Details",
1074
+ "key": "mySubscriptions.moreDetails",
1075
+ "translation": "פרטים נוספים"
1076
+ },
1077
+ "h_5697fd85adbd": {
1078
+ "source": "Subscriptions",
1079
+ "key": "mySubscriptions.title",
1080
+ "translation": "מנויים"
1081
+ },
1082
+ "h_6d7f058cd1f9": {
1083
+ "source": "Cancel subscription",
1084
+ "key": "subscriptionDetail.cancel",
1085
+ "translation": "ביטול המנוי"
1086
+ },
1087
+ "h_8048c6e22689": {
1088
+ "source": "Keep subscription",
1089
+ "key": "subscriptionDetail.keep",
1090
+ "translation": "השארת המנוי"
1091
+ },
1092
+ "h_8cfbc985903e": {
1093
+ "source": "Next payment date",
1094
+ "key": "subscriptionDetail.cancelNextPayment",
1095
+ "translation": "מועד התשלום הבא"
1096
+ },
1097
+ "h_90977a5334eb": {
1098
+ "source": "Confirm cancellation",
1099
+ "key": "subscriptionDetail.confirmCancel",
1100
+ "translation": "אישור הביטול"
1101
+ },
1102
+ "h_92d0286da122": {
1103
+ "source": "Terms and conditions",
1104
+ "key": "planDetail.terms",
1105
+ "translation": "תנאים והגבלות"
1106
+ },
1107
+ "h_9e6d2be10412": {
1108
+ "source": "Pricing Plan",
1109
+ "key": "mySubscriptions.type",
1110
+ "translation": "תוכנית תמחור"
1111
+ },
1112
+ "h_a1ba61405311": {
1113
+ "source": "SUBSCRIPTION DETAILS",
1114
+ "key": "subscriptionDetail.sectionTitle",
1115
+ "translation": "פרטי המנוי"
1116
+ },
1117
+ "h_ac3cff89b598": {
1118
+ "source": "Check back later.",
1119
+ "key": "plans.emptyBody",
1120
+ "translation": "בדקו שוב מאוחר יותר."
1121
+ },
1122
+ "h_b1b85d6dca11": {
1123
+ "source": "Cancel subscription?",
1124
+ "key": "subscriptionDetail.cancelTitle",
1125
+ "translation": "לבטל את המנוי?"
1126
+ },
1127
+ "h_b52174d6f8ee": {
1128
+ "source": "Sign in to see your subscriptions.",
1129
+ "key": "mySubscriptions.guestBody",
1130
+ "translation": "התחברו כדי לראות את המנויים שלכם."
1131
+ },
1132
+ "h_b5cd0764d53b": {
1133
+ "source": "The final price, including taxes, is determined at checkout.",
1134
+ "key": "planDetail.taxNote",
1135
+ "translation": "המחיר הסופי, כולל מיסים, נקבע בעת התשלום."
1136
+ },
1137
+ "h_be063c39a40c": {
1138
+ "source": "View plan benefits",
1139
+ "key": "plans.viewBenefits",
1140
+ "translation": "הצגת הטבות התוכנית"
1141
+ },
1142
+ "h_e3b82040565b": {
1143
+ "source": "Now",
1144
+ "key": "subscriptionDetail.cancelNow",
1145
+ "translation": "עכשיו"
1146
+ },
1147
+ "h_e5a3dc6c4148": {
1148
+ "source": "No plans available",
1149
+ "key": "plans.emptyTitle",
1150
+ "translation": "אין תוכניות זמינות"
1151
+ },
1152
+ "h_e61470df7f9a": {
1153
+ "source": "Browse plans",
1154
+ "key": "mySubscriptions.browsePlans",
1155
+ "translation": "עיון בתוכניות"
1156
+ },
1157
+ "h_26f0f757637b": {
1158
+ "source": "No expired subscriptions",
1159
+ "key": "mySubscriptions.expiredEmpty",
1160
+ "translation": "אין מנויים שפג תוקפם"
1161
+ },
1162
+ "h_2d237a1790e7": {
1163
+ "source": "No active subscriptions",
1164
+ "key": "mySubscriptions.activeEmpty",
1165
+ "translation": "אין מנויים פעילים"
1166
+ },
1167
+ "h_3a59df4808b7": {
1168
+ "source": "Subscriptions are unavailable for this account.",
1169
+ "key": "mySubscriptions.accessDenied",
1170
+ "translation": "המנויים אינם זמינים לחשבון הזה."
1171
+ },
1172
+ "h_87855219fc0e": {
1173
+ "source": "Cancellation requested, but the latest status could not be loaded. Refresh the details.",
1174
+ "key": "subscriptionDetail.cancelRefreshFailed",
1175
+ "translation": "בקשת הביטול נשלחה, אך לא ניתן לטעון את המצב העדכני. רעננו את הפרטים."
1176
+ },
1177
+ "h_c4ec5bbde22f": {
1178
+ "source": "This subscription cannot be canceled from this account. Contact the business for help.",
1179
+ "key": "subscriptionDetail.cancelDenied",
1180
+ "translation": "לא ניתן לבטל את המנוי מהחשבון הזה. פנו לעסק לקבלת עזרה."
1181
+ },
1182
+ "h_f5871873a63a": {
1183
+ "source": "Cancellation failed. Try again.",
1184
+ "key": "subscriptionDetail.cancelFailed",
1185
+ "translation": "ביטול המנוי נכשל. נסו שוב."
1186
+ },
1187
+ "h_c72863dbd9e1": {
1188
+ "source": "Hide plan benefits",
1189
+ "key": "plans.hideBenefits",
1190
+ "translation": "הסתרת הטבות התוכנית"
1191
+ },
1066
1192
  "h_03e89418ffdf": {
1067
1193
  "source": "Your Home",
1068
1194
  "translation": "הבית שלך"
@@ -1165,7 +1291,7 @@
1165
1291
  },
1166
1292
  "h_09fef5d8d9a3": {
1167
1293
  "source": "Failed",
1168
- "translation": "נכשלה"
1294
+ "translation": "נכשל"
1169
1295
  },
1170
1296
  "h_7c08f81c17ab": {
1171
1297
  "source": "Access paused",
@@ -1263,6 +1389,10 @@
1263
1389
  "source": "Policies",
1264
1390
  "translation": "מדיניות"
1265
1391
  },
1392
+ "h_8fde48f31aff": {
1393
+ "source": "Subscription",
1394
+ "translation": "מנוי"
1395
+ },
1266
1396
  "h_958812bfab20": {
1267
1397
  "source": "Return to the event list and choose another event.",
1268
1398
  "translation": "יש לחזור לרשימת האירועים ולבחור אירוע אחר."
@@ -1620,10 +1750,6 @@
1620
1750
  "source": "Sign in to see your bookings",
1621
1751
  "translation": "יש להתחבר כדי לראות את ההרשמות שלך"
1622
1752
  },
1623
- "h_a733b809d2f1": {
1624
- "source": "Active",
1625
- "translation": "פעיל"
1626
- },
1627
1753
  "h_7a7938b5bc22": {
1628
1754
  "source": "+{count} more",
1629
1755
  "translation": "+ עוד {count}"
@@ -1820,10 +1946,6 @@
1820
1946
  "source": "This site is not accepting online payments. Go back or contact the business for other payment options.",
1821
1947
  "translation": "האתר הזה אינו מקבל תשלומים מקוונים. אפשר לחזור אחורה או לפנות לעסק לבירור אפשרויות תשלום אחרות."
1822
1948
  },
1823
- "h_e0d73143de80": {
1824
- "source": "Join",
1825
- "translation": "הצטרפות"
1826
- },
1827
1949
  "h_eee52995478b": {
1828
1950
  "source": "Signed in as {email}",
1829
1951
  "translation": "מחובר/ת בתור {email}"
@@ -2439,6 +2561,154 @@
2439
2561
  "h_176803b3e3b1": {
2440
2562
  "source": "Browsing as a guest",
2441
2563
  "translation": "גולשים כאורחים"
2564
+ },
2565
+ "h_c8214d35a16e": {
2566
+ "source": "Valid until",
2567
+ "translation": "בתוקף עד"
2568
+ },
2569
+ "h_513a2ae3716f": {
2570
+ "source": "Subscriptions could not be loaded.",
2571
+ "translation": "לא ניתן לטעון את המנויים."
2572
+ },
2573
+ "h_071cd4f24599": {
2574
+ "source": "Unlimited duration",
2575
+ "translation": "ללא הגבלת זמן"
2576
+ },
2577
+ "h_7527b5f3de8b": {
2578
+ "source": "Until canceled",
2579
+ "translation": "עד לביטול"
2580
+ },
2581
+ "h_3f28deaf6308": {
2582
+ "source": "Valid for {count} {unit}",
2583
+ "translation": "בתוקף למשך {count} {unit}"
2584
+ },
2585
+ "h_d8fdaaf936d1": {
2586
+ "source": "Current period ends",
2587
+ "translation": "סיום התקופה הנוכחית"
2588
+ },
2589
+ "h_89d10cd6c1e1": {
2590
+ "source": "End date",
2591
+ "translation": "תאריך סיום"
2592
+ },
2593
+ "h_b3b67b1ec371": {
2594
+ "source": "Expired on",
2595
+ "translation": "התוקף פג בתאריך"
2596
+ },
2597
+ "h_d00c682cdd14": {
2598
+ "source": "Your subscription ends on {date}.",
2599
+ "translation": "המנוי שלך יסתיים בתאריך {date}."
2600
+ },
2601
+ "h_d19252fd8086": {
2602
+ "source": "Request cancellation at the next payment date, {date}?",
2603
+ "translation": "לבקש ביטול במועד התשלום הבא, {date}?"
2604
+ },
2605
+ "h_cc0e4eda9f22": {
2606
+ "source": "Request cancellation now? Your access can end immediately.",
2607
+ "translation": "לבקש ביטול עכשיו? הגישה שלך עשויה להסתיים מיד."
2608
+ },
2609
+ "h_d60aef23d316": {
2610
+ "source": "Open a subscription from My Subscriptions.",
2611
+ "translation": "פתחו מנוי מתוך המנויים שלי."
2612
+ },
2613
+ "h_ecd7f5c76e70": {
2614
+ "source": "This subscription could not be loaded.",
2615
+ "translation": "לא ניתן לטעון את המנוי."
2616
+ },
2617
+ "h_c8763e04f1f2": {
2618
+ "source": "Your subscription changed. Review the details before canceling.",
2619
+ "translation": "המנוי שלך השתנה. בדקו את הפרטים לפני הביטול."
2620
+ },
2621
+ "h_4fc3530ad6c9": {
2622
+ "source": "Cancellation requested. Refresh to see the latest status.",
2623
+ "translation": "בקשת הביטול נשלחה. רעננו כדי לראות את המצב העדכני."
2624
+ },
2625
+ "h_a2620cbc10f5": {
2626
+ "source": "day",
2627
+ "translation": "יום"
2628
+ },
2629
+ "h_5548ae4f34cb": {
2630
+ "source": "days",
2631
+ "translation": "ימים"
2632
+ },
2633
+ "h_c0ee32d825d6": {
2634
+ "source": "week",
2635
+ "translation": "שבוע"
2636
+ },
2637
+ "h_0af64388b588": {
2638
+ "source": "weeks",
2639
+ "translation": "שבועות"
2640
+ },
2641
+ "h_021710fa7866": {
2642
+ "source": "month",
2643
+ "translation": "חודש"
2644
+ },
2645
+ "h_f1494311e45e": {
2646
+ "source": "months",
2647
+ "translation": "חודשים"
2648
+ },
2649
+ "h_4ff0b1538469": {
2650
+ "source": "year",
2651
+ "translation": "שנה"
2652
+ },
2653
+ "h_e21ee77d5009": {
2654
+ "source": "years",
2655
+ "translation": "שנים"
2656
+ },
2657
+ "h_96f608c16cef": {
2658
+ "source": "Pending",
2659
+ "translation": "ממתין"
2660
+ },
2661
+ "h_c7dfb6f1d9c5": {
2662
+ "source": "Paused",
2663
+ "translation": "מושהה"
2664
+ },
2665
+ "h_3a8de059a4c1": {
2666
+ "source": "Pending payment",
2667
+ "translation": "ממתין לתשלום"
2668
+ },
2669
+ "h_c3e839df6084": {
2670
+ "source": "Online",
2671
+ "translation": "מקוון"
2672
+ },
2673
+ "h_e01fa717bacc": {
2674
+ "source": "Offline",
2675
+ "translation": "לא מקוון"
2676
+ },
2677
+ "h_8d10c693b773": {
2678
+ "source": "External",
2679
+ "translation": "חיצוני"
2680
+ },
2681
+ "h_50cc12f69e8f": {
2682
+ "source": "Unpaid",
2683
+ "translation": "לא שולם"
2684
+ },
2685
+ "h_67c4d0506a44": {
2686
+ "source": "Not applicable",
2687
+ "translation": "לא רלוונטי"
2688
+ },
2689
+ "h_a40d89b298e7": {
2690
+ "source": "Purchase date",
2691
+ "translation": "תאריך רכישה"
2692
+ },
2693
+ "h_ff99f5b5f794": {
2694
+ "source": "Start date",
2695
+ "translation": "תאריך התחלה"
2696
+ },
2697
+ "h_0e55fb3b04e2": {
2698
+ "source": "Payment method",
2699
+ "translation": "אמצעי תשלום"
2700
+ },
2701
+ "h_6c0477b0ed78": {
2702
+ "source": "Last payment status",
2703
+ "translation": "מצב התשלום האחרון"
2704
+ },
2705
+ "h_7939a8affae6": {
2706
+ "source": "Scheduled end",
2707
+ "translation": "מועד סיום מתוכנן"
2708
+ },
2709
+ "h_760205a2fb62": {
2710
+ "source": "One-time payment",
2711
+ "translation": "תשלום חד-פעמי"
2442
2712
  }
2443
2713
  }
2444
2714
  }
@@ -0,0 +1,64 @@
1
+ import type { WixPlanOrder, WixPlanPricing } from "@himalaya/wix-pricing-plans";
2
+ import { copyParam, copyTemplate } from "./himi-copy.js";
3
+ import { formatCurrency, formatDateMedium } from "./engine-intl.js";
4
+
5
+ export function planDuration(pricing?: WixPlanPricing): string {
6
+ if (pricing?.singlePaymentUnlimited) return copyParam("plans.unlimited", "Unlimited duration");
7
+ const cycle = pricing?.subscription;
8
+ if (cycle && !cycle.cycleCount) return copyParam("plans.untilCanceled", "Until canceled");
9
+ const duration = cycle?.cycleDuration ?? pricing?.singlePaymentForDuration;
10
+ const count = (duration?.count ?? 0) * (cycle ? cycle.cycleCount ?? 0 : 1);
11
+ const unit = duration?.unit?.toLowerCase().replace(/s$/, "");
12
+ if (!count || !unit) return "";
13
+ const units: Record<string, [string, string]> = { day: ["day", "days"], week: ["week", "weeks"], month: ["month", "months"], year: ["year", "years"] };
14
+ const pair = units[unit];
15
+ if (!pair) return "";
16
+ return copyTemplate("plans.validFor", "Valid for {count} {unit}", { count, unit: copyParam(`plans.${unit}.${count === 1 ? "one" : "other"}`, pair[count === 1 ? 0 : 1]) });
17
+ }
18
+
19
+ export function orderDate(value?: string): string {
20
+ return value && Number.isFinite(Date.parse(value)) ? formatDateMedium(new Date(value)) : "";
21
+ }
22
+
23
+ /** The purchased order owns its price; today's plan is never a price fallback. */
24
+ export function orderPrice(order: WixPlanOrder): string {
25
+ const cycle = order.currentCycle?.index ?? 1;
26
+ const span = order.pricing?.prices?.find(({ duration }) => {
27
+ const from = duration?.cycleFrom ?? 1;
28
+ return cycle >= from && (!duration?.numberOfCycles || cycle < from + duration.numberOfCycles);
29
+ });
30
+ const currency = order.priceDetails?.currency ?? order.pricing?.currency ?? span?.price?.currency;
31
+ return purchasedMoney(span?.price?.total, span?.price?.currency) || span?.price?.formattedTotal
32
+ || purchasedMoney(order.priceDetails?.total, order.priceDetails?.currency)
33
+ || purchasedMoney(order.pricing?.total, order.pricing?.currency)
34
+ || purchasedMoney(order.priceDetails?.planPrice, currency)
35
+ || purchasedMoney(order.planPrice, currency);
36
+ }
37
+ function purchasedMoney(value?: string, currency?: string): string {
38
+ return value !== undefined && value !== "" && Number.isFinite(Number(value)) && currency
39
+ ? formatCurrency(Number(value), currency) : "";
40
+ }
41
+
42
+ export function orderStatus(order: WixPlanOrder): string {
43
+ const status = order.status ?? "";
44
+ const labels: Record<string, string> = { ACTIVE: "Active", PENDING: "Pending", PAUSED: "Paused", CANCELED: "Canceled", ENDED: "Expired", DRAFT: "Pending payment" };
45
+ return copyParam(`subscriptionDetail.status.${status}`, labels[status] ?? "Status unavailable");
46
+ }
47
+
48
+ export function orderFacts(order: WixPlanOrder): Array<{ id: string; label: string; value: string; positive: boolean; notPositive: boolean }> {
49
+ const payment: Record<string, string> = { ONLINE: "Online", OFFLINE: "Offline", EXTERNAL: "External" };
50
+ const statuses: Record<string, string> = { PAID: "Paid", UNPAID: "Unpaid", FAILED: "Failed", PENDING: "Pending", REFUNDED: "Refunded", NOT_APPLICABLE: "Not applicable" };
51
+ const pairs: Array<[string, string, string]> = [
52
+ ["purchaseDate", "Purchase date", orderDate(order.createdDate)],
53
+ ["startDate", "Start date", orderDate(order.startDate)],
54
+ ["endDate", "End date", orderDate(order.earliestEndDate ?? order.endDate)],
55
+ ["paymentMethod", "Payment method", payment[order.type ?? ""] ? copyParam(`subscriptionDetail.payment.${order.type}`, payment[order.type!]) : ""],
56
+ ["lastPaymentStatus", "Last payment status", statuses[order.lastPaymentStatus ?? ""] ? copyParam(`subscriptionDetail.paymentStatus.${order.lastPaymentStatus}`, statuses[order.lastPaymentStatus!]) : ""],
57
+ ];
58
+ if (order.autoRenewCanceled || order.cancellation?.effectiveAt === "NEXT_PAYMENT_DATE") {
59
+ pairs.push(["scheduledEnd", "Scheduled end", orderDate(order.earliestEndDate ?? order.endDate ?? order.currentCycle?.endedDate)]);
60
+ } else if (order.status === "ACTIVE" && (order.pricing?.subscription ?? order.priceDetails?.subscription) && order.currentCycle?.endedDate) {
61
+ pairs.push(["periodEnd", "Current period ends", orderDate(order.currentCycle.endedDate)]);
62
+ }
63
+ return pairs.filter(([, , value]) => Boolean(value)).map(([id, label, value]) => ({ id, label: copyParam(`subscriptionDetail.${id}`, label), value, positive: id === "lastPaymentStatus" && order.lastPaymentStatus === "PAID", notPositive: id !== "lastPaymentStatus" || order.lastPaymentStatus !== "PAID" }));
64
+ }