@misiki/gocommerce-connector 0.15.0 → 0.19.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.
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AddOn, a as Address, b as AddressService, c as AppliedDiscount, d as Approval, e as AuthResponse, f as AuthService, g as AutocompleteService, B as B2bPlaced, h as B2bRole, i as B2bService, j as BannerService, k as BaseService, l as BlogService, C as Cart, m as CartLine, n as CartOffer, o as CartService, p as CatalogService, q as Category, r as CategoryService, s as ChatService, t as CheckoutOptions, u as CheckoutResult, v as CheckoutService, w as CmsPage, x as Collection, y as CollectionService, z as Company, D as CompanyOrder, E as ContactService, F as CountryService, G as CouponService, H as Credentials, I as Credit, J as CurrencyService, K as Customer, L as DealService, M as DemoRequestService, N as EngineRequest, O as EnquiryService, P as Envelope, Q as FacetValue, R as Faq, S as FaqService, T as FeedbackService, U as FooterSettings, V as FreeShipping, W as Fulfillment, X as GalleryService, Y as HeaderSettings, Z as HomeLayout, _ as HomeLayoutSection, $ as HomeService, a0 as IdentityAddress, a1 as InitService, a2 as Invitation, a3 as LayoutCollection, a4 as LayoutPage, a5 as LayoutService, a6 as Lead, a7 as ListMeta, a8 as MeilisearchService, a9 as Member, aa as Menu, ab as MenuItem, ac as MenuService, ad as MenuSummary, ae as Money, af as NewsletterService, ag as Offer, ah as Order, ai as OrderLine, aj as OrderService, ak as PageLayout, al as PageService, am as PaymentIntent, an as PaymentMethodService, ao as Plugin, ap as PluginService, ap as PluginsService, aq as PopularSearchService, ar as PopularityService, as as Postcode, at as Product, au as ProductFacets, av as ProductOption, aw as ProductService, ax as ProfileService, ay as Quote, az as REDIRECT_GATEWAYS, aA as ReelsService, aB as RegionService, aC as RejectedLine, aD as Review, aE as ReviewPage, aF as ReviewService, aG as SearchDoc, aH as SearchResult, aI as SearchService, aJ as SettingService, aJ as SettingsService, aK as ShippingRate, aL as SiteChrome, aM as SiteFooter, aN as SiteHeader, aO as SocialLink, aP as StateService, aQ as StoreProfile, aR as StoreService, aS as StorefrontCategory, aT as StorefrontMenu, aU as StorefrontOrder, aV as StorefrontProduct, aW as ThemeSettings, aX as ThemeSettingsResult, aY as UploadService, aZ as UserService, a_ as Variant, a$ as VariantImage, b0 as VariantService, b1 as VarniCustomDesignService, b2 as VarniCustomProductService, b3 as Vendor, b4 as VendorService, b5 as WarrantyService, b6 as Wishlist, b7 as WishlistItem, b8 as WishlistService, b9 as addressService, ba as authService, bb as autocompleteService, bc as b2bService, bd as bannerService, be as blogService, bf as cartService, bg as categoryService, bh as chatService, bi as checkoutService, bj as collectionService, bk as contactService, bl as countryService, bm as couponService, bn as currencyExponent, bo as currencyService, bp as dealService, bq as demoRequestService, br as emptyCart, bs as emptyPage, bt as enquiryService, bu as faqService, bv as feedbackService, bw as fromEngineAddress, bx as fromIdentityAddress, by as fromSearchDoc, bz as galleryService, bA as homeService, bB as initService, bC as layoutService, bD as mediaUrl, bE as meilisearchService, bF as menuService, bG as minorToMajor, bH as newsletterService, bI as orderService, bJ as ownDomain, bK as pageService, bL as paymentMethodService, bM as pluginService, bN as pluginsService, bO as popularSearchService, bP as popularityService, bQ as priceOf, bR as productImages, bS as productService, bT as productVideos, bU as profileService, bV as qs, bW as reelsService, bX as regionService, bY as reviewService, bZ as searchService, b_ as setRequestHost, b$ as settingService, c0 as settingsService, c1 as stateService, c2 as staticStore, c3 as storeForHost, c4 as storeService, c5 as toAddOn, c6 as toCart, c7 as toCartLine, c8 as toCartOffer, c9 as toCategory, ca as toCmsPage, cb as toCollection, cc as toEngineAddress, cd as toFreeShipping, ce as toIdentityAddress, cf as toMajor, cg as toMinor, ch as toOrder, ci as toPage, cj as toProduct, ck as toRating, cl as toStorefrontFacets, cm as toUser, cn as toVariant, co as toVendor, cp as uploadService, cq as userService, cr as variantService, cs as varniCustomDesignService, ct as varniCustomProductService, cu as vendorService, cv as warrantyService, cw as wishlistService } from './index-GdjWgh5b.cjs';
1
+ export { A as AddOn, a as Address, b as AddressService, c as AppliedDiscount, d as Approval, e as AuthResponse, f as AuthService, g as AutocompleteService, B as B2bPlaced, h as B2bRole, i as B2bService, j as BannerService, k as BaseService, l as BlogService, C as Cart, m as CartLine, n as CartOffer, o as CartService, p as CatalogService, q as Category, r as CategoryService, s as ChatService, t as CheckoutOptions, u as CheckoutResult, v as CheckoutService, w as CmsPage, x as Collection, y as CollectionService, z as Company, D as CompanyOrder, E as ContactService, F as CountryService, G as CouponService, H as Credentials, I as Credit, J as CurrencyService, K as Customer, L as DealService, M as DemoRequestService, N as EngineRequest, O as EnquiryService, P as Envelope, Q as FacetValue, R as Faq, S as FaqService, T as FeedbackService, U as FooterSettings, V as FreeShipping, W as Fulfillment, X as GalleryService, Y as GooglePlace, Z as GoogleReview, _ as GoogleReviewService, $ as GoogleReviews, a0 as GoogleSurvey, a1 as HeaderSettings, a2 as HomeLayout, a3 as HomeLayoutSection, a4 as HomeService, a5 as IdentityAddress, a6 as InitService, a7 as Invitation, a8 as LayoutCollection, a9 as LayoutPage, aa as LayoutService, ab as Lead, ac as ListMeta, ad as MeilisearchService, ae as Member, af as Menu, ag as MenuItem, ah as MenuService, ai as MenuSummary, aj as Money, ak as NewsletterService, al as Offer, am as OpeningHours, an as Order, ao as OrderLine, ap as OrderService, aq as PageLayout, ar as PageService, as as PaymentIntent, at as PaymentMethodService, au as Plugin, av as PluginService, av as PluginsService, aw as PopularSearchService, ax as PopularityService, ay as Postcode, az as Product, aA as ProductFacets, aB as ProductOption, aC as ProductService, aD as ProfileService, aE as Quote, aF as REDIRECT_GATEWAYS, aG as ReelsService, aH as RegionService, aI as RejectedLine, aJ as Review, aK as ReviewPage, aL as ReviewService, aM as SearchDoc, aN as SearchResult, aO as SearchService, aP as SettingService, aP as SettingsService, aQ as ShippingRate, aR as SiteChrome, aS as SiteFooter, aT as SiteHeader, aU as SocialLink, aV as StateService, aW as StoreProfile, aX as StoreService, aY as StorefrontCategory, aZ as StorefrontMenu, a_ as StorefrontOrder, a$ as StorefrontProduct, b0 as ThemeSettings, b1 as ThemeSettingsResult, b2 as UploadService, b3 as UserService, b4 as Variant, b5 as VariantImage, b6 as VariantService, b7 as VarniCustomDesignService, b8 as VarniCustomProductService, b9 as Vendor, ba as VendorService, bb as WarrantyService, bc as Wishlist, bd as WishlistItem, be as WishlistService, bf as addressService, bg as authService, bh as autocompleteService, bi as b2bService, bj as bannerService, bk as blogService, bl as cartService, bm as categoryService, bn as chatService, bo as checkoutService, bp as collectionService, bq as contactService, br as countryService, bs as couponService, bt as currencyExponent, bu as currencyService, bv as dealService, bw as demoRequestService, bx as emptyCart, by as emptyPage, bz as enquiryService, bA as faqService, bB as feedbackService, bC as fromEngineAddress, bD as fromIdentityAddress, bE as fromSearchDoc, bF as galleryService, bG as googleReviewService, bH as homeService, bI as initService, bJ as layoutService, bK as mediaUrl, bL as meilisearchService, bM as menuService, bN as minorToMajor, bO as newsletterService, bP as orderService, bQ as ownDomain, bR as pageService, bS as paymentMethodService, bT as pluginService, bU as pluginsService, bV as popularSearchService, bW as popularityService, bX as priceOf, bY as productImages, bZ as productService, b_ as productVideos, b$ as profileService, c0 as qs, c1 as reelsService, c2 as regionService, c3 as reviewService, c4 as searchService, c5 as setRequestHost, c6 as settingService, c7 as settingsService, c8 as stateService, c9 as staticStore, ca as storeForHost, cb as storeService, cc as toAddOn, cd as toCart, ce as toCartLine, cf as toCartOffer, cg as toCategory, ch as toCmsPage, ci as toCollection, cj as toEngineAddress, ck as toFreeShipping, cl as toIdentityAddress, cm as toMajor, cn as toMinor, co as toOrder, cp as toPage, cq as toProduct, cr as toRating, cs as toStorefrontFacets, ct as toUser, cu as toVariant, cv as toVendor, cw as uploadService, cx as userService, cy as variantService, cz as varniCustomDesignService, cA as varniCustomProductService, cB as vendorService, cC as warrantyService, cD as wishlistService } from './index-BsvUnF4H.cjs';
2
2
 
3
3
  /**
4
4
  * The two ways a call through this connector fails.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AddOn, a as Address, b as AddressService, c as AppliedDiscount, d as Approval, e as AuthResponse, f as AuthService, g as AutocompleteService, B as B2bPlaced, h as B2bRole, i as B2bService, j as BannerService, k as BaseService, l as BlogService, C as Cart, m as CartLine, n as CartOffer, o as CartService, p as CatalogService, q as Category, r as CategoryService, s as ChatService, t as CheckoutOptions, u as CheckoutResult, v as CheckoutService, w as CmsPage, x as Collection, y as CollectionService, z as Company, D as CompanyOrder, E as ContactService, F as CountryService, G as CouponService, H as Credentials, I as Credit, J as CurrencyService, K as Customer, L as DealService, M as DemoRequestService, N as EngineRequest, O as EnquiryService, P as Envelope, Q as FacetValue, R as Faq, S as FaqService, T as FeedbackService, U as FooterSettings, V as FreeShipping, W as Fulfillment, X as GalleryService, Y as HeaderSettings, Z as HomeLayout, _ as HomeLayoutSection, $ as HomeService, a0 as IdentityAddress, a1 as InitService, a2 as Invitation, a3 as LayoutCollection, a4 as LayoutPage, a5 as LayoutService, a6 as Lead, a7 as ListMeta, a8 as MeilisearchService, a9 as Member, aa as Menu, ab as MenuItem, ac as MenuService, ad as MenuSummary, ae as Money, af as NewsletterService, ag as Offer, ah as Order, ai as OrderLine, aj as OrderService, ak as PageLayout, al as PageService, am as PaymentIntent, an as PaymentMethodService, ao as Plugin, ap as PluginService, ap as PluginsService, aq as PopularSearchService, ar as PopularityService, as as Postcode, at as Product, au as ProductFacets, av as ProductOption, aw as ProductService, ax as ProfileService, ay as Quote, az as REDIRECT_GATEWAYS, aA as ReelsService, aB as RegionService, aC as RejectedLine, aD as Review, aE as ReviewPage, aF as ReviewService, aG as SearchDoc, aH as SearchResult, aI as SearchService, aJ as SettingService, aJ as SettingsService, aK as ShippingRate, aL as SiteChrome, aM as SiteFooter, aN as SiteHeader, aO as SocialLink, aP as StateService, aQ as StoreProfile, aR as StoreService, aS as StorefrontCategory, aT as StorefrontMenu, aU as StorefrontOrder, aV as StorefrontProduct, aW as ThemeSettings, aX as ThemeSettingsResult, aY as UploadService, aZ as UserService, a_ as Variant, a$ as VariantImage, b0 as VariantService, b1 as VarniCustomDesignService, b2 as VarniCustomProductService, b3 as Vendor, b4 as VendorService, b5 as WarrantyService, b6 as Wishlist, b7 as WishlistItem, b8 as WishlistService, b9 as addressService, ba as authService, bb as autocompleteService, bc as b2bService, bd as bannerService, be as blogService, bf as cartService, bg as categoryService, bh as chatService, bi as checkoutService, bj as collectionService, bk as contactService, bl as countryService, bm as couponService, bn as currencyExponent, bo as currencyService, bp as dealService, bq as demoRequestService, br as emptyCart, bs as emptyPage, bt as enquiryService, bu as faqService, bv as feedbackService, bw as fromEngineAddress, bx as fromIdentityAddress, by as fromSearchDoc, bz as galleryService, bA as homeService, bB as initService, bC as layoutService, bD as mediaUrl, bE as meilisearchService, bF as menuService, bG as minorToMajor, bH as newsletterService, bI as orderService, bJ as ownDomain, bK as pageService, bL as paymentMethodService, bM as pluginService, bN as pluginsService, bO as popularSearchService, bP as popularityService, bQ as priceOf, bR as productImages, bS as productService, bT as productVideos, bU as profileService, bV as qs, bW as reelsService, bX as regionService, bY as reviewService, bZ as searchService, b_ as setRequestHost, b$ as settingService, c0 as settingsService, c1 as stateService, c2 as staticStore, c3 as storeForHost, c4 as storeService, c5 as toAddOn, c6 as toCart, c7 as toCartLine, c8 as toCartOffer, c9 as toCategory, ca as toCmsPage, cb as toCollection, cc as toEngineAddress, cd as toFreeShipping, ce as toIdentityAddress, cf as toMajor, cg as toMinor, ch as toOrder, ci as toPage, cj as toProduct, ck as toRating, cl as toStorefrontFacets, cm as toUser, cn as toVariant, co as toVendor, cp as uploadService, cq as userService, cr as variantService, cs as varniCustomDesignService, ct as varniCustomProductService, cu as vendorService, cv as warrantyService, cw as wishlistService } from './index-GdjWgh5b.js';
1
+ export { A as AddOn, a as Address, b as AddressService, c as AppliedDiscount, d as Approval, e as AuthResponse, f as AuthService, g as AutocompleteService, B as B2bPlaced, h as B2bRole, i as B2bService, j as BannerService, k as BaseService, l as BlogService, C as Cart, m as CartLine, n as CartOffer, o as CartService, p as CatalogService, q as Category, r as CategoryService, s as ChatService, t as CheckoutOptions, u as CheckoutResult, v as CheckoutService, w as CmsPage, x as Collection, y as CollectionService, z as Company, D as CompanyOrder, E as ContactService, F as CountryService, G as CouponService, H as Credentials, I as Credit, J as CurrencyService, K as Customer, L as DealService, M as DemoRequestService, N as EngineRequest, O as EnquiryService, P as Envelope, Q as FacetValue, R as Faq, S as FaqService, T as FeedbackService, U as FooterSettings, V as FreeShipping, W as Fulfillment, X as GalleryService, Y as GooglePlace, Z as GoogleReview, _ as GoogleReviewService, $ as GoogleReviews, a0 as GoogleSurvey, a1 as HeaderSettings, a2 as HomeLayout, a3 as HomeLayoutSection, a4 as HomeService, a5 as IdentityAddress, a6 as InitService, a7 as Invitation, a8 as LayoutCollection, a9 as LayoutPage, aa as LayoutService, ab as Lead, ac as ListMeta, ad as MeilisearchService, ae as Member, af as Menu, ag as MenuItem, ah as MenuService, ai as MenuSummary, aj as Money, ak as NewsletterService, al as Offer, am as OpeningHours, an as Order, ao as OrderLine, ap as OrderService, aq as PageLayout, ar as PageService, as as PaymentIntent, at as PaymentMethodService, au as Plugin, av as PluginService, av as PluginsService, aw as PopularSearchService, ax as PopularityService, ay as Postcode, az as Product, aA as ProductFacets, aB as ProductOption, aC as ProductService, aD as ProfileService, aE as Quote, aF as REDIRECT_GATEWAYS, aG as ReelsService, aH as RegionService, aI as RejectedLine, aJ as Review, aK as ReviewPage, aL as ReviewService, aM as SearchDoc, aN as SearchResult, aO as SearchService, aP as SettingService, aP as SettingsService, aQ as ShippingRate, aR as SiteChrome, aS as SiteFooter, aT as SiteHeader, aU as SocialLink, aV as StateService, aW as StoreProfile, aX as StoreService, aY as StorefrontCategory, aZ as StorefrontMenu, a_ as StorefrontOrder, a$ as StorefrontProduct, b0 as ThemeSettings, b1 as ThemeSettingsResult, b2 as UploadService, b3 as UserService, b4 as Variant, b5 as VariantImage, b6 as VariantService, b7 as VarniCustomDesignService, b8 as VarniCustomProductService, b9 as Vendor, ba as VendorService, bb as WarrantyService, bc as Wishlist, bd as WishlistItem, be as WishlistService, bf as addressService, bg as authService, bh as autocompleteService, bi as b2bService, bj as bannerService, bk as blogService, bl as cartService, bm as categoryService, bn as chatService, bo as checkoutService, bp as collectionService, bq as contactService, br as countryService, bs as couponService, bt as currencyExponent, bu as currencyService, bv as dealService, bw as demoRequestService, bx as emptyCart, by as emptyPage, bz as enquiryService, bA as faqService, bB as feedbackService, bC as fromEngineAddress, bD as fromIdentityAddress, bE as fromSearchDoc, bF as galleryService, bG as googleReviewService, bH as homeService, bI as initService, bJ as layoutService, bK as mediaUrl, bL as meilisearchService, bM as menuService, bN as minorToMajor, bO as newsletterService, bP as orderService, bQ as ownDomain, bR as pageService, bS as paymentMethodService, bT as pluginService, bU as pluginsService, bV as popularSearchService, bW as popularityService, bX as priceOf, bY as productImages, bZ as productService, b_ as productVideos, b$ as profileService, c0 as qs, c1 as reelsService, c2 as regionService, c3 as reviewService, c4 as searchService, c5 as setRequestHost, c6 as settingService, c7 as settingsService, c8 as stateService, c9 as staticStore, ca as storeForHost, cb as storeService, cc as toAddOn, cd as toCart, ce as toCartLine, cf as toCartOffer, cg as toCategory, ch as toCmsPage, ci as toCollection, cj as toEngineAddress, ck as toFreeShipping, cl as toIdentityAddress, cm as toMajor, cn as toMinor, co as toOrder, cp as toPage, cq as toProduct, cr as toRating, cs as toStorefrontFacets, ct as toUser, cu as toVariant, cv as toVendor, cw as uploadService, cx as userService, cy as variantService, cz as varniCustomDesignService, cA as varniCustomProductService, cB as vendorService, cC as warrantyService, cD as wishlistService } from './index-BsvUnF4H.js';
2
2
 
3
3
  /**
4
4
  * The two ways a call through this connector fails.
package/dist/index.js CHANGED
@@ -2871,6 +2871,71 @@ var ReviewService = class extends BaseService {
2871
2871
  };
2872
2872
  var reviewService = new ReviewService();
2873
2873
 
2874
+ // src/services/google-review-service.ts
2875
+ var PLUGIN = "google-reviews";
2876
+ var GoogleReviewService = class extends BaseService {
2877
+ facts = new StoreFacts(this._fetch);
2878
+ /**
2879
+ * Google's rating and its most relevant reviews, read live. Google's terms
2880
+ * forbid keeping them, so nothing here caches them either, and every call
2881
+ * is one the store pays Google for: call it when the section is in view.
2882
+ */
2883
+ async place() {
2884
+ if (!await this.switchOn("show_place")) return null;
2885
+ const p = await this.orNull(() => this.data("/x/google-reviews/place"));
2886
+ if (!p?.user_rating_count) return null;
2887
+ return {
2888
+ rating: p.rating,
2889
+ count: p.user_rating_count,
2890
+ mapsUrl: p.google_maps_uri ?? "",
2891
+ reviews: (p.reviews ?? []).map((r) => ({
2892
+ author: r.author?.name ?? "",
2893
+ authorUrl: r.author?.uri ?? "",
2894
+ authorPhoto: r.author?.photo_uri ?? "",
2895
+ rating: r.rating,
2896
+ text: r.text ?? "",
2897
+ language: r.language ?? "",
2898
+ when: r.relative_time ?? "",
2899
+ visited: r.visit_date ?? "",
2900
+ url: r.google_maps_uri ?? "",
2901
+ reportUrl: r.flag_uri ?? ""
2902
+ }))
2903
+ };
2904
+ }
2905
+ /**
2906
+ * What Google Customer Reviews' opt-in is rendered with, for an order placed
2907
+ * in this browser: its access token is kept here, and nowhere else can ask.
2908
+ * Every field is the order's own; the keys are Google's, to pass unchanged
2909
+ * to `gapi.surveyoptin.render`.
2910
+ */
2911
+ async survey(orderNumber) {
2912
+ const kept = orderNumber ? placedOrder(orderNumber) : void 0;
2913
+ if (!kept || !await this.switchOn("customer_reviews")) return null;
2914
+ return this.orNull(
2915
+ () => this.data(`/x/google-reviews/survey/${encodeURIComponent(orderNumber)}`, {
2916
+ query: { token: kept.token }
2917
+ })
2918
+ );
2919
+ }
2920
+ async switchOn(setting) {
2921
+ try {
2922
+ return (await this.facts.plugins()).get(PLUGIN)?.settings?.[setting] === true;
2923
+ } catch {
2924
+ return false;
2925
+ }
2926
+ }
2927
+ /** Off, used up for the day, or refused by Google: nothing to show. Anything else still throws. */
2928
+ async orNull(call) {
2929
+ try {
2930
+ return await call();
2931
+ } catch (err) {
2932
+ if (err instanceof GoCommerceError && [404, 429, 502].includes(err.status)) return null;
2933
+ throw err;
2934
+ }
2935
+ }
2936
+ };
2937
+ var googleReviewService = new GoogleReviewService();
2938
+
2874
2939
  // src/services/menu-service.ts
2875
2940
  function linkFor(item) {
2876
2941
  const t = item.target ?? "";
@@ -3047,6 +3112,21 @@ var StoreService = class extends BaseService {
3047
3112
  ...profile?.logo_url ? { logo: mediaUrl(profile.logo_url), logoDark: void 0 } : {},
3048
3113
  ...profile?.logo_dark_url ? { logoDark: mediaUrl(profile.logo_dark_url) } : {},
3049
3114
  ...profile?.icon_url ? { favicon: mediaUrl(profile.icon_url) } : {},
3115
+ // What the contact page shows (D156), only what the store published. The address
3116
+ // in the shape the storefront's contact page and home-page JSON-LD already read. The
3117
+ // country beside it, not over `country`: that is the address form's default country.
3118
+ ...profile?.country ? { businessCountry: profile.country } : {},
3119
+ ...profile?.address ? {
3120
+ address: {
3121
+ street: [profile.address.line1, profile.address.line2].filter(Boolean).join(", "),
3122
+ city: profile.address.city,
3123
+ state: profile.address.state,
3124
+ pincode: profile.address.postal_code,
3125
+ country: profile.address.country
3126
+ }
3127
+ } : {},
3128
+ ...profile?.map_location ? { mapLocation: profile.map_location } : {},
3129
+ ...profile?.opening_hours?.length ? { openingHours: profile.opening_hours } : {},
3050
3130
  currencyCode: code,
3051
3131
  currencySymbol: sameCurrency ? base.currencySymbol ?? symbolFor(code) : symbolFor(code),
3052
3132
  currency: {
@@ -3060,10 +3140,28 @@ var StoreService = class extends BaseService {
3060
3140
  // Features this connector serves from a module: on exactly when the
3061
3141
  // module is installed and switched on, whatever the static record says.
3062
3142
  isWishlist: { ...basePlugins.isWishlist, ...flag(plugins.has("wishlist")) },
3143
+ // The corner button and the contact page's WhatsApp card read the number from
3144
+ // here; the engine's plugin holds it, in international digits.
3145
+ whatsappChatButton: {
3146
+ ...basePlugins.whatsappChatButton,
3147
+ ...flag(plugins.has("whatsapp-chat")),
3148
+ ...plugins.has("whatsapp-chat") ? {
3149
+ phone: String(plugins.get("whatsapp-chat")?.settings?.phone ?? ""),
3150
+ message: String(plugins.get("whatsapp-chat")?.settings?.message ?? "")
3151
+ } : {}
3152
+ },
3063
3153
  isProductReviewsAndRatings: {
3064
3154
  ...basePlugins.isProductReviewsAndRatings,
3065
3155
  ...flag(plugins.has("product-reviews"))
3066
3156
  },
3157
+ // Google Customer Reviews (ext/google-reviews): the confirmation page's survey offer,
3158
+ // whose fields the engine builds from the order, and Google's store widget, which
3159
+ // belongs to the same programme and so needs the survey on.
3160
+ googleReviewsOptIn: {
3161
+ ...basePlugins.googleReviewsOptIn,
3162
+ ...flag(googleSetting(plugins, "customer_reviews") === true)
3163
+ },
3164
+ googleStoreWidget: storeWidget(plugins),
3067
3165
  // The footer's sign-up box posts to ext/newsletter, and the theme editor's footer
3068
3166
  // switch (D131) can only show it while that is on.
3069
3167
  newsletter: { ...basePlugins.newsletter, ...flag(plugins.has("newsletter")) },
@@ -3106,6 +3204,12 @@ function regionName(code) {
3106
3204
  return code;
3107
3205
  }
3108
3206
  }
3207
+ var googleSetting = (plugins, key) => plugins.get("google-reviews")?.settings?.[key];
3208
+ function storeWidget(plugins) {
3209
+ const where = googleSetting(plugins, "store_widget");
3210
+ if (googleSetting(plugins, "customer_reviews") !== true || !where) return { active: false };
3211
+ return { active: true, position: where === "Bottom left" ? "LEFT_BOTTOM" : "RIGHT_BOTTOM" };
3212
+ }
3109
3213
  var LOGIN_TYPES = { phone_otp: "PHONE", email_or_phone: "BOTH", email_password: "EMAIL" };
3110
3214
 
3111
3215
  // src/services/page-service.ts
@@ -3286,7 +3390,8 @@ var ContactService = class extends BaseService {
3286
3390
  email,
3287
3391
  phone,
3288
3392
  message,
3289
- subject
3393
+ subject,
3394
+ website
3290
3395
  }) {
3291
3396
  return this.data("/x/contact/messages", {
3292
3397
  method: "POST",
@@ -3295,7 +3400,8 @@ var ContactService = class extends BaseService {
3295
3400
  email: String(email ?? ""),
3296
3401
  ...phone ? { phone: String(phone) } : {},
3297
3402
  ...subject ? { subject: String(subject) } : {},
3298
- body: String(message ?? "")
3403
+ body: String(message ?? ""),
3404
+ ...website ? { website: String(website) } : {}
3299
3405
  }
3300
3406
  });
3301
3407
  }
@@ -3786,6 +3892,6 @@ function attemptKey(request) {
3786
3892
  }
3787
3893
  var b2bService = new B2bService();
3788
3894
 
3789
- export { AddressService, AuthService, AutocompleteService, B2bService, BannerService, BaseService, BlogService, CartService, CatalogService, CategoryService, ChatService, CheckoutService, CollectionService, ContactService, CountryService, CouponService, CurrencyService, DealService, DemoRequestService, EnquiryService, FaqService, FeedbackService, GalleryService, GoCommerceError, HomeService, InitService, LayoutService, MeilisearchService, MenuService, NewsletterService, NotSupportedError, OrderService, PageService, PaymentMethodService, PluginService, PluginService as PluginsService, PopularSearchService, PopularityService, ProductService, ProfileService, REDIRECT_GATEWAYS, ReelsService, RegionService, ReviewService, SearchService, SettingService, SettingService as SettingsService, StateService, StoreService, UploadService, UserService, VariantService, VarniCustomDesignService, VarniCustomProductService, VendorService, WarrantyService, WishlistService, addressService, authService, autocompleteService, b2bService, bannerService, blogService, cartService, categoryService, chatService, checkoutService, forgetAll as clearStoreCache, collectionService, connectorName, contactService, countryService, couponService, currencyExponent, currencyService, dealService, demoRequestService, emptyCart, emptyPage, enquiryService, faqService, feedbackService, fromEngineAddress, fromIdentityAddress, fromSearchDoc, galleryService, hasStaticStore, homeService, initService, layoutService, mediaUrl, meilisearchService, menuService, minorToMajor, newsletterService, orderService, ownDomain, pageService, paymentMethodService, pluginService, pluginsService, popularSearchService, popularityService, priceOf, productImages, productService, productVideos, profileService, qs, readStaticStore, reelsService, regionService, reviewService, searchService, serveRestLocally, setRequestHost, setStaticStore, settingService, settingsService, stateService, staticStore, storeForHost, storeService, toAddOn, toCart, toCartLine, toCartOffer, toCategory, toCmsPage, toCollection, toEngineAddress, toFreeShipping, toIdentityAddress, toMajor, toMinor, toOrder, toPage, toProduct, toRating, toStorefrontFacets, toUser, toVariant, toVendor, uploadService, userService, variantService, varniCustomDesignService, varniCustomProductService, vendorService, warrantyService, wishlistService };
3895
+ export { AddressService, AuthService, AutocompleteService, B2bService, BannerService, BaseService, BlogService, CartService, CatalogService, CategoryService, ChatService, CheckoutService, CollectionService, ContactService, CountryService, CouponService, CurrencyService, DealService, DemoRequestService, EnquiryService, FaqService, FeedbackService, GalleryService, GoCommerceError, GoogleReviewService, HomeService, InitService, LayoutService, MeilisearchService, MenuService, NewsletterService, NotSupportedError, OrderService, PageService, PaymentMethodService, PluginService, PluginService as PluginsService, PopularSearchService, PopularityService, ProductService, ProfileService, REDIRECT_GATEWAYS, ReelsService, RegionService, ReviewService, SearchService, SettingService, SettingService as SettingsService, StateService, StoreService, UploadService, UserService, VariantService, VarniCustomDesignService, VarniCustomProductService, VendorService, WarrantyService, WishlistService, addressService, authService, autocompleteService, b2bService, bannerService, blogService, cartService, categoryService, chatService, checkoutService, forgetAll as clearStoreCache, collectionService, connectorName, contactService, countryService, couponService, currencyExponent, currencyService, dealService, demoRequestService, emptyCart, emptyPage, enquiryService, faqService, feedbackService, fromEngineAddress, fromIdentityAddress, fromSearchDoc, galleryService, googleReviewService, hasStaticStore, homeService, initService, layoutService, mediaUrl, meilisearchService, menuService, minorToMajor, newsletterService, orderService, ownDomain, pageService, paymentMethodService, pluginService, pluginsService, popularSearchService, popularityService, priceOf, productImages, productService, productVideos, profileService, qs, readStaticStore, reelsService, regionService, reviewService, searchService, serveRestLocally, setRequestHost, setStaticStore, settingService, settingsService, stateService, staticStore, storeForHost, storeService, toAddOn, toCart, toCartLine, toCartOffer, toCategory, toCmsPage, toCollection, toEngineAddress, toFreeShipping, toIdentityAddress, toMajor, toMinor, toOrder, toPage, toProduct, toRating, toStorefrontFacets, toUser, toVariant, toVendor, uploadService, userService, variantService, varniCustomDesignService, varniCustomProductService, vendorService, warrantyService, wishlistService };
3790
3896
  //# sourceMappingURL=index.js.map
3791
3897
  //# sourceMappingURL=index.js.map