@wix/himalaya-cli 0.1656.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 (85) 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 +46 -45
  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/recipe-auth.md +120 -0
  14. package/guides/recipe-checkout.md +108 -0
  15. package/guides/sdk-reference.json +21 -3
  16. package/package.json +2 -2
  17. package/templates/beauty-salon/dev/index.ts +2151 -2596
  18. package/templates/beauty-salon/l10n/en.json +208 -180
  19. package/templates/beauty-salon/l10n/he.json +300 -138
  20. package/templates/beauty-salon/tier5-src/_shared/pricing-plan-display.ts +64 -0
  21. package/templates/beauty-salon/tier5-src/himi-branded-lite-plans/index.ts +101 -31
  22. package/templates/beauty-salon/tier5-src/wix-spaces-my-subscriptions/index.ts +72 -70
  23. package/templates/beauty-salon/tier5-src/wix-spaces-subscription-detail/index.ts +129 -31
  24. package/templates/beauty-salon/tokens.json +17 -1
  25. package/templates/branded-lite/dev/index.ts +2272 -2685
  26. package/templates/branded-lite/l10n/en.json +225 -52
  27. package/templates/branded-lite/l10n/he.json +305 -39
  28. package/templates/branded-lite/tier5-src/_shared/pricing-plan-display.ts +64 -0
  29. package/templates/branded-lite/tier5-src/himi-branded-lite-plans/index.ts +101 -31
  30. package/templates/branded-lite/tier5-src/wix-spaces-my-subscriptions/index.ts +72 -70
  31. package/templates/branded-lite/tier5-src/wix-spaces-subscription-detail/index.ts +129 -31
  32. package/templates/branded-lite/tokens.json +5 -1
  33. package/templates/community-club/l10n/en.json +6 -1
  34. package/templates/community-club/l10n/he.json +23 -2
  35. package/templates/community-club/tokens.json +17 -1
  36. package/templates/events-meetups/l10n/en.json +6 -1
  37. package/templates/events-meetups/l10n/he.json +23 -2
  38. package/templates/events-meetups/tokens.json +17 -1
  39. package/templates/gym-fitness/dev/index.ts +2149 -2594
  40. package/templates/gym-fitness/l10n/en.json +215 -77
  41. package/templates/gym-fitness/l10n/he.json +300 -59
  42. package/templates/gym-fitness/tier5-src/_shared/pricing-plan-display.ts +64 -0
  43. package/templates/gym-fitness/tier5-src/himi-branded-lite-plans/index.ts +101 -31
  44. package/templates/gym-fitness/tier5-src/wix-spaces-my-subscriptions/index.ts +72 -70
  45. package/templates/gym-fitness/tier5-src/wix-spaces-subscription-detail/index.ts +129 -31
  46. package/templates/gym-fitness/tokens.json +17 -1
  47. package/templates/nonprofit-cause/dev/index.ts +2163 -2608
  48. package/templates/nonprofit-cause/l10n/en.json +216 -38
  49. package/templates/nonprofit-cause/l10n/he.json +300 -30
  50. package/templates/nonprofit-cause/tier5-src/_shared/pricing-plan-display.ts +64 -0
  51. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-plans/index.ts +101 -31
  52. package/templates/nonprofit-cause/tier5-src/wix-spaces-my-subscriptions/index.ts +72 -70
  53. package/templates/nonprofit-cause/tier5-src/wix-spaces-subscription-detail/index.ts +129 -31
  54. package/templates/nonprofit-cause/tokens.json +17 -1
  55. package/templates/podcast-creator/dev/index.ts +2147 -2592
  56. package/templates/podcast-creator/l10n/en.json +216 -38
  57. package/templates/podcast-creator/l10n/he.json +300 -30
  58. package/templates/podcast-creator/tier5-src/_shared/pricing-plan-display.ts +64 -0
  59. package/templates/podcast-creator/tier5-src/himi-branded-lite-plans/index.ts +101 -31
  60. package/templates/podcast-creator/tier5-src/wix-spaces-my-subscriptions/index.ts +72 -70
  61. package/templates/podcast-creator/tier5-src/wix-spaces-subscription-detail/index.ts +129 -31
  62. package/templates/podcast-creator/tokens.json +17 -1
  63. package/templates/portfolio-creative/l10n/en.json +15 -8
  64. package/templates/portfolio-creative/l10n/he.json +28 -6
  65. package/templates/portfolio-creative/tokens.json +17 -1
  66. package/templates/restaurant/l10n/en.json +14 -7
  67. package/templates/restaurant/l10n/he.json +28 -6
  68. package/templates/restaurant/tokens.json +17 -1
  69. package/templates/retail-store/l10n/en.json +15 -8
  70. package/templates/retail-store/l10n/he.json +28 -6
  71. package/templates/retail-store/tokens.json +17 -1
  72. package/templates/yoga-studio/dev/index.ts +2204 -2649
  73. package/templates/yoga-studio/l10n/en.json +216 -43
  74. package/templates/yoga-studio/l10n/he.json +300 -30
  75. package/templates/yoga-studio/tier5-src/_shared/pricing-plan-display.ts +64 -0
  76. package/templates/yoga-studio/tier5-src/himi-branded-lite-plans/index.ts +101 -31
  77. package/templates/yoga-studio/tier5-src/wix-spaces-my-subscriptions/index.ts +72 -70
  78. package/templates/yoga-studio/tier5-src/wix-spaces-subscription-detail/index.ts +129 -31
  79. package/templates/yoga-studio/tokens.json +17 -1
  80. package/templates/beauty-salon/tier5-src/wix-spaces-plan-detail/index.ts +0 -63
  81. package/templates/branded-lite/tier5-src/wix-spaces-plan-detail/index.ts +0 -63
  82. package/templates/gym-fitness/tier5-src/wix-spaces-plan-detail/index.ts +0 -63
  83. package/templates/nonprofit-cause/tier5-src/wix-spaces-plan-detail/index.ts +0 -63
  84. package/templates/podcast-creator/tier5-src/wix-spaces-plan-detail/index.ts +0 -63
  85. 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",
@@ -684,7 +669,8 @@
684
669
  "h_badd385121c5": {
685
670
  "source": "View details",
686
671
  "translation": "צפייה בפרטים",
687
- "key": "collection.viewDetails"
672
+ "key": "collection.viewDetails",
673
+ "keyOrigin": "string-table"
688
674
  },
689
675
  "h_bbfa773e5a63": {
690
676
  "source": "Close",
@@ -896,11 +882,6 @@
896
882
  "translation": "שמירה",
897
883
  "key": "collection.save"
898
884
  },
899
- "h_f014740803c5": {
900
- "source": "Plan details",
901
- "key": "planDetail.chromeTitle",
902
- "translation": "פרטי התוכנית"
903
- },
904
885
  "h_f32d5a3b17e6": {
905
886
  "source": "Support",
906
887
  "key": "appInfo.supportLink",
@@ -926,6 +907,11 @@
926
907
  "translation": "הזמנה",
927
908
  "key": "tab.book"
928
909
  },
910
+ "h_f840ac65b3e5": {
911
+ "source": "Canceled",
912
+ "translation": "בוטל",
913
+ "key": "subscriptionDetail.status.CANCELED"
914
+ },
929
915
  "h_f8ee0f6d49b3": {
930
916
  "source": "Loading your summary…",
931
917
  "key": "placeSummary.loading",
@@ -946,6 +932,11 @@
946
932
  "translation": "קהילה",
947
933
  "key": "drawer.section.community"
948
934
  },
935
+ "h_a733b809d2f1": {
936
+ "source": "Active",
937
+ "key": "mySubscriptions.active",
938
+ "translation": "פעיל"
939
+ },
949
940
  "h_947849cd96b2": {
950
941
  "source": "No image available",
951
942
  "key": "collection.noImage",
@@ -1128,6 +1119,141 @@
1128
1119
  "key": "blog.categoriesLabel",
1129
1120
  "translation": "קטגוריות פוסטים"
1130
1121
  },
1122
+ "h_a689a999a5e6": {
1123
+ "source": "Expired",
1124
+ "key": "mySubscriptions.expired",
1125
+ "translation": "פג תוקף"
1126
+ },
1127
+ "h_0febe76e354b": {
1128
+ "source": "You do not have access to this subscription.",
1129
+ "key": "subscriptionDetail.accessDenied",
1130
+ "translation": "אין לך גישה למנוי הזה."
1131
+ },
1132
+ "h_168ec872ecc7": {
1133
+ "source": "Plan price",
1134
+ "key": "planDetail.planPrice",
1135
+ "translation": "מחיר התוכנית"
1136
+ },
1137
+ "h_3fdb5e335327": {
1138
+ "source": "More Details",
1139
+ "key": "mySubscriptions.moreDetails",
1140
+ "translation": "פרטים נוספים"
1141
+ },
1142
+ "h_5697fd85adbd": {
1143
+ "source": "Subscriptions",
1144
+ "key": "mySubscriptions.title",
1145
+ "translation": "מנויים"
1146
+ },
1147
+ "h_6d7f058cd1f9": {
1148
+ "source": "Cancel subscription",
1149
+ "key": "subscriptionDetail.cancel",
1150
+ "translation": "ביטול המנוי"
1151
+ },
1152
+ "h_8048c6e22689": {
1153
+ "source": "Keep subscription",
1154
+ "key": "subscriptionDetail.keep",
1155
+ "translation": "השארת המנוי"
1156
+ },
1157
+ "h_8cfbc985903e": {
1158
+ "source": "Next payment date",
1159
+ "key": "subscriptionDetail.cancelNextPayment",
1160
+ "translation": "מועד התשלום הבא"
1161
+ },
1162
+ "h_90977a5334eb": {
1163
+ "source": "Confirm cancellation",
1164
+ "key": "subscriptionDetail.confirmCancel",
1165
+ "translation": "אישור הביטול"
1166
+ },
1167
+ "h_92d0286da122": {
1168
+ "source": "Terms and conditions",
1169
+ "key": "planDetail.terms",
1170
+ "translation": "תנאים והגבלות"
1171
+ },
1172
+ "h_9e6d2be10412": {
1173
+ "source": "Pricing Plan",
1174
+ "key": "mySubscriptions.type",
1175
+ "translation": "תוכנית תמחור"
1176
+ },
1177
+ "h_a1ba61405311": {
1178
+ "source": "SUBSCRIPTION DETAILS",
1179
+ "key": "subscriptionDetail.sectionTitle",
1180
+ "translation": "פרטי המנוי"
1181
+ },
1182
+ "h_ac3cff89b598": {
1183
+ "source": "Check back later.",
1184
+ "key": "plans.emptyBody",
1185
+ "translation": "בדקו שוב מאוחר יותר."
1186
+ },
1187
+ "h_b1b85d6dca11": {
1188
+ "source": "Cancel subscription?",
1189
+ "key": "subscriptionDetail.cancelTitle",
1190
+ "translation": "לבטל את המנוי?"
1191
+ },
1192
+ "h_b52174d6f8ee": {
1193
+ "source": "Sign in to see your subscriptions.",
1194
+ "key": "mySubscriptions.guestBody",
1195
+ "translation": "התחברו כדי לראות את המנויים שלכם."
1196
+ },
1197
+ "h_b5cd0764d53b": {
1198
+ "source": "The final price, including taxes, is determined at checkout.",
1199
+ "key": "planDetail.taxNote",
1200
+ "translation": "המחיר הסופי, כולל מיסים, נקבע בעת התשלום."
1201
+ },
1202
+ "h_be063c39a40c": {
1203
+ "source": "View plan benefits",
1204
+ "key": "plans.viewBenefits",
1205
+ "translation": "הצגת הטבות התוכנית"
1206
+ },
1207
+ "h_e3b82040565b": {
1208
+ "source": "Now",
1209
+ "key": "subscriptionDetail.cancelNow",
1210
+ "translation": "עכשיו"
1211
+ },
1212
+ "h_e5a3dc6c4148": {
1213
+ "source": "No plans available",
1214
+ "key": "plans.emptyTitle",
1215
+ "translation": "אין תוכניות זמינות"
1216
+ },
1217
+ "h_e61470df7f9a": {
1218
+ "source": "Browse plans",
1219
+ "key": "mySubscriptions.browsePlans",
1220
+ "translation": "עיון בתוכניות"
1221
+ },
1222
+ "h_26f0f757637b": {
1223
+ "source": "No expired subscriptions",
1224
+ "key": "mySubscriptions.expiredEmpty",
1225
+ "translation": "אין מנויים שפג תוקפם"
1226
+ },
1227
+ "h_2d237a1790e7": {
1228
+ "source": "No active subscriptions",
1229
+ "key": "mySubscriptions.activeEmpty",
1230
+ "translation": "אין מנויים פעילים"
1231
+ },
1232
+ "h_3a59df4808b7": {
1233
+ "source": "Subscriptions are unavailable for this account.",
1234
+ "key": "mySubscriptions.accessDenied",
1235
+ "translation": "המנויים אינם זמינים לחשבון הזה."
1236
+ },
1237
+ "h_87855219fc0e": {
1238
+ "source": "Cancellation requested, but the latest status could not be loaded. Refresh the details.",
1239
+ "key": "subscriptionDetail.cancelRefreshFailed",
1240
+ "translation": "בקשת הביטול נשלחה, אך לא ניתן לטעון את המצב העדכני. רעננו את הפרטים."
1241
+ },
1242
+ "h_c4ec5bbde22f": {
1243
+ "source": "This subscription cannot be canceled from this account. Contact the business for help.",
1244
+ "key": "subscriptionDetail.cancelDenied",
1245
+ "translation": "לא ניתן לבטל את המנוי מהחשבון הזה. פנו לעסק לקבלת עזרה."
1246
+ },
1247
+ "h_f5871873a63a": {
1248
+ "source": "Cancellation failed. Try again.",
1249
+ "key": "subscriptionDetail.cancelFailed",
1250
+ "translation": "ביטול המנוי נכשל. נסו שוב."
1251
+ },
1252
+ "h_c72863dbd9e1": {
1253
+ "source": "Hide plan benefits",
1254
+ "key": "plans.hideBenefits",
1255
+ "translation": "הסתרת הטבות התוכנית"
1256
+ },
1131
1257
  "h_03e89418ffdf": {
1132
1258
  "source": "Your Home",
1133
1259
  "translation": "הבית שלך"
@@ -1230,7 +1356,7 @@
1230
1356
  },
1231
1357
  "h_09fef5d8d9a3": {
1232
1358
  "source": "Failed",
1233
- "translation": "נכשלה"
1359
+ "translation": "נכשל"
1234
1360
  },
1235
1361
  "h_7c08f81c17ab": {
1236
1362
  "source": "Access paused",
@@ -1324,6 +1450,10 @@
1324
1450
  "source": "Policies",
1325
1451
  "translation": "מדיניות"
1326
1452
  },
1453
+ "h_8fde48f31aff": {
1454
+ "source": "Subscription",
1455
+ "translation": "מנוי"
1456
+ },
1327
1457
  "h_958812bfab20": {
1328
1458
  "source": "Return to the event list and choose another event.",
1329
1459
  "translation": "יש לחזור לרשימת האירועים ולבחור אירוע אחר."
@@ -1645,10 +1775,6 @@
1645
1775
  "source": "Sign in to see your bookings",
1646
1776
  "translation": "יש להתחבר כדי לראות את ההרשמות שלך"
1647
1777
  },
1648
- "h_a733b809d2f1": {
1649
- "source": "Active",
1650
- "translation": "פעיל"
1651
- },
1652
1778
  "h_7a7938b5bc22": {
1653
1779
  "source": "+{count} more",
1654
1780
  "translation": "+ עוד {count}"
@@ -1849,10 +1975,6 @@
1849
1975
  "source": "Public",
1850
1976
  "translation": "ציבורית"
1851
1977
  },
1852
- "h_e0d73143de80": {
1853
- "source": "Join",
1854
- "translation": "הצטרפות"
1855
- },
1856
1978
  "h_eee52995478b": {
1857
1979
  "source": "Signed in as {email}",
1858
1980
  "translation": "מחובר/ת בתור {email}"
@@ -2572,6 +2694,154 @@
2572
2694
  "h_176803b3e3b1": {
2573
2695
  "source": "Browsing as a guest",
2574
2696
  "translation": "גולשים כאורחים"
2697
+ },
2698
+ "h_c8214d35a16e": {
2699
+ "source": "Valid until",
2700
+ "translation": "בתוקף עד"
2701
+ },
2702
+ "h_513a2ae3716f": {
2703
+ "source": "Subscriptions could not be loaded.",
2704
+ "translation": "לא ניתן לטעון את המנויים."
2705
+ },
2706
+ "h_071cd4f24599": {
2707
+ "source": "Unlimited duration",
2708
+ "translation": "ללא הגבלת זמן"
2709
+ },
2710
+ "h_7527b5f3de8b": {
2711
+ "source": "Until canceled",
2712
+ "translation": "עד לביטול"
2713
+ },
2714
+ "h_3f28deaf6308": {
2715
+ "source": "Valid for {count} {unit}",
2716
+ "translation": "בתוקף למשך {count} {unit}"
2717
+ },
2718
+ "h_d8fdaaf936d1": {
2719
+ "source": "Current period ends",
2720
+ "translation": "סיום התקופה הנוכחית"
2721
+ },
2722
+ "h_89d10cd6c1e1": {
2723
+ "source": "End date",
2724
+ "translation": "תאריך סיום"
2725
+ },
2726
+ "h_b3b67b1ec371": {
2727
+ "source": "Expired on",
2728
+ "translation": "התוקף פג בתאריך"
2729
+ },
2730
+ "h_d00c682cdd14": {
2731
+ "source": "Your subscription ends on {date}.",
2732
+ "translation": "המנוי שלך יסתיים בתאריך {date}."
2733
+ },
2734
+ "h_d19252fd8086": {
2735
+ "source": "Request cancellation at the next payment date, {date}?",
2736
+ "translation": "לבקש ביטול במועד התשלום הבא, {date}?"
2737
+ },
2738
+ "h_cc0e4eda9f22": {
2739
+ "source": "Request cancellation now? Your access can end immediately.",
2740
+ "translation": "לבקש ביטול עכשיו? הגישה שלך עשויה להסתיים מיד."
2741
+ },
2742
+ "h_d60aef23d316": {
2743
+ "source": "Open a subscription from My Subscriptions.",
2744
+ "translation": "פתחו מנוי מתוך המנויים שלי."
2745
+ },
2746
+ "h_ecd7f5c76e70": {
2747
+ "source": "This subscription could not be loaded.",
2748
+ "translation": "לא ניתן לטעון את המנוי."
2749
+ },
2750
+ "h_c8763e04f1f2": {
2751
+ "source": "Your subscription changed. Review the details before canceling.",
2752
+ "translation": "המנוי שלך השתנה. בדקו את הפרטים לפני הביטול."
2753
+ },
2754
+ "h_4fc3530ad6c9": {
2755
+ "source": "Cancellation requested. Refresh to see the latest status.",
2756
+ "translation": "בקשת הביטול נשלחה. רעננו כדי לראות את המצב העדכני."
2757
+ },
2758
+ "h_a2620cbc10f5": {
2759
+ "source": "day",
2760
+ "translation": "יום"
2761
+ },
2762
+ "h_5548ae4f34cb": {
2763
+ "source": "days",
2764
+ "translation": "ימים"
2765
+ },
2766
+ "h_c0ee32d825d6": {
2767
+ "source": "week",
2768
+ "translation": "שבוע"
2769
+ },
2770
+ "h_0af64388b588": {
2771
+ "source": "weeks",
2772
+ "translation": "שבועות"
2773
+ },
2774
+ "h_021710fa7866": {
2775
+ "source": "month",
2776
+ "translation": "חודש"
2777
+ },
2778
+ "h_f1494311e45e": {
2779
+ "source": "months",
2780
+ "translation": "חודשים"
2781
+ },
2782
+ "h_4ff0b1538469": {
2783
+ "source": "year",
2784
+ "translation": "שנה"
2785
+ },
2786
+ "h_e21ee77d5009": {
2787
+ "source": "years",
2788
+ "translation": "שנים"
2789
+ },
2790
+ "h_96f608c16cef": {
2791
+ "source": "Pending",
2792
+ "translation": "ממתין"
2793
+ },
2794
+ "h_c7dfb6f1d9c5": {
2795
+ "source": "Paused",
2796
+ "translation": "מושהה"
2797
+ },
2798
+ "h_3a8de059a4c1": {
2799
+ "source": "Pending payment",
2800
+ "translation": "ממתין לתשלום"
2801
+ },
2802
+ "h_c3e839df6084": {
2803
+ "source": "Online",
2804
+ "translation": "מקוון"
2805
+ },
2806
+ "h_e01fa717bacc": {
2807
+ "source": "Offline",
2808
+ "translation": "לא מקוון"
2809
+ },
2810
+ "h_8d10c693b773": {
2811
+ "source": "External",
2812
+ "translation": "חיצוני"
2813
+ },
2814
+ "h_50cc12f69e8f": {
2815
+ "source": "Unpaid",
2816
+ "translation": "לא שולם"
2817
+ },
2818
+ "h_67c4d0506a44": {
2819
+ "source": "Not applicable",
2820
+ "translation": "לא רלוונטי"
2821
+ },
2822
+ "h_a40d89b298e7": {
2823
+ "source": "Purchase date",
2824
+ "translation": "תאריך רכישה"
2825
+ },
2826
+ "h_ff99f5b5f794": {
2827
+ "source": "Start date",
2828
+ "translation": "תאריך התחלה"
2829
+ },
2830
+ "h_0e55fb3b04e2": {
2831
+ "source": "Payment method",
2832
+ "translation": "אמצעי תשלום"
2833
+ },
2834
+ "h_6c0477b0ed78": {
2835
+ "source": "Last payment status",
2836
+ "translation": "מצב התשלום האחרון"
2837
+ },
2838
+ "h_7939a8affae6": {
2839
+ "source": "Scheduled end",
2840
+ "translation": "מועד סיום מתוכנן"
2841
+ },
2842
+ "h_760205a2fb62": {
2843
+ "source": "One-time payment",
2844
+ "translation": "תשלום חד-פעמי"
2575
2845
  }
2576
2846
  }
2577
2847
  }
@@ -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
+ }