@vio-live/web-sdk 0.26.1 → 0.27.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.
@@ -808,6 +808,43 @@ declare function sameOrigin(a: CartOrigin, b: CartOrigin): boolean;
808
808
  */
809
809
  declare function lineOrigins(line: Pick<CartLineItem, 'origins' | 'quantity'>): CartLineOrigin[];
810
810
 
811
+ /**
812
+ * Who sells — the sponsor's (brand's) display identity: its name and logo.
813
+ *
814
+ * ONE rule for every place that names a sponsor (the product detail, the
815
+ * carousel's retailer line, the cart, the checkout header, the confirmation,
816
+ * the payment event and `getOrderReference`): the bootstrap's sponsor block —
817
+ * the config's primary and secondaries, then every `campaigns[]` primary and
818
+ * secondaries, first match — and, when the bootstrap does not know the id,
819
+ * what this tab remembered of the checkout, then the cart's `sponsorName`.
820
+ *
821
+ * In a checkout and on its confirmation the sponsor is the CHECKOUT's (the
822
+ * cart's sponsor, the one the order is with), never the page's attribution:
823
+ * an article of brand A may sell a product of brand B.
824
+ *
825
+ * Pure helpers and a tiny per-checkout memory in `sessionStorage`; no DOM.
826
+ */
827
+
828
+ /** What a sponsor looks like to a shopper. `name` is the brand's display name. */
829
+ interface SponsorIdentity {
830
+ id: number;
831
+ name: string;
832
+ /** The brand's logo, as the bootstrap gives it (never rewritten); `null` when it has none. */
833
+ logoUrl: string | null;
834
+ avatarUrl: string | null;
835
+ }
836
+ /** The sponsor of a checkout / an order as events and `getOrderReference` carry it. */
837
+ type CheckoutSponsor = Pick<SponsorIdentity, 'id' | 'name' | 'logoUrl'>;
838
+ /** `sessionStorage` key of the per-checkout memory. */
839
+ declare const CHECKOUT_SPONSOR_STORAGE_KEY = "vio.checkoutSponsor.v1";
840
+ /**
841
+ * The identity of a sponsor from a bootstrap (`findSponsorIn`): its trimmed
842
+ * name and its logo / avatar URLs as given (an empty string is `null`).
843
+ * `null` when the bootstrap does not know the id, or the block says neither
844
+ * a name nor a logo. Pure, never throws.
845
+ */
846
+ declare function sponsorIdentityFrom(boot: BootstrapResponse | null | undefined, sponsorId: number | string | null | undefined): SponsorIdentity | null;
847
+
811
848
  /**
812
849
  * What the commerce gateway may not know yet.
813
850
  *
@@ -1397,6 +1434,13 @@ interface PaymentSuccessDetail {
1397
1434
  buyerRef?: string | null;
1398
1435
  buyer_ref?: string | null;
1399
1436
  result?: PaymentSuccessResult | null;
1437
+ /**
1438
+ * The sponsor the order is with — the CHECKOUT's (its cart's sponsor),
1439
+ * never the page's: `{ id, name, logoUrl }` by the `Vio.sponsorIdentity`
1440
+ * rule, when it can be named. For the host's own receipt; analytics does
1441
+ * not read it.
1442
+ */
1443
+ sponsor?: CheckoutSponsor;
1400
1444
  }
1401
1445
  /**
1402
1446
  * What the checkout attaches as `result`. Only `confirmation` carries a Vio
@@ -2295,6 +2339,7 @@ interface AdyenResult {
2295
2339
  * merchant, same as iOS multi-sponsor model). Multiple sponsors → multiple
2296
2340
  * sequential checkouts.
2297
2341
  */
2342
+
2298
2343
  type PaymentMethod = 'apple-pay' | 'klarna' | 'vipps' | 'card' | 'stripe' | 'kustom' | 'qliro' | 'walley' | 'nexi' | 'adyen';
2299
2344
  interface CheckoutAddress {
2300
2345
  firstName: string;
@@ -2333,6 +2378,25 @@ interface CheckoutState {
2333
2378
  */
2334
2379
  session?: number;
2335
2380
  }
2381
+ /**
2382
+ * Detail of `vio:checkout-open` as the SDK's elements emit it (the cart, the
2383
+ * product detail): whose cart to check out, the method to preselect, the
2384
+ * element's attribution — and `sponsor`, the checkout's sponsor as a shopper
2385
+ * sees it (`{ id, name, logoUrl }`, the `Vio.sponsorIdentity` rule), when it
2386
+ * can be named.
2387
+ */
2388
+ interface CheckoutOpenDetail {
2389
+ sponsorId: number;
2390
+ paymentMethod?: PaymentMethod;
2391
+ express?: boolean;
2392
+ sponsor?: CheckoutSponsor;
2393
+ slot?: string;
2394
+ campaignId?: number;
2395
+ contentId?: string;
2396
+ contentTitle?: string;
2397
+ contentUrl?: string;
2398
+ componentTemplateId?: string;
2399
+ }
2336
2400
 
2337
2401
  /**
2338
2402
  * CheckoutManager — orchestrates the checkout flow.
@@ -2404,11 +2468,33 @@ interface KlarnaPaymentsHandle {
2404
2468
  */
2405
2469
  interface CheckoutManagerDeps {
2406
2470
  orderAttribution?: (sponsorId: number) => Promise<CheckoutAttributionWire | undefined> | CheckoutAttributionWire | undefined;
2471
+ /**
2472
+ * Who a sponsor is (`Vio.sponsorIdentity`): remembered per checkout when one
2473
+ * is created, and answered with `getOrderReference`. Optional: without it
2474
+ * the memory keeps only whose checkout it is, and the cart's name.
2475
+ */
2476
+ sponsorIdentity?: (sponsorId: number | undefined, opts?: {
2477
+ checkoutId?: string | null;
2478
+ }) => SponsorIdentity | null;
2407
2479
  }
2480
+ /** What `getOrderReference` answers: the checkout's reference plus, when it can be named, its sponsor. */
2481
+ type OrderReference = CheckoutReference & {
2482
+ /** The sponsor the order is with — the checkout's, by the `Vio.sponsorIdentity` rule. */
2483
+ sponsor?: CheckoutSponsor;
2484
+ };
2408
2485
  declare class CheckoutManager extends EventTarget {
2409
2486
  private readonly cartManager;
2410
2487
  private readonly deps;
2411
- private state;
2488
+ private currentStateValue;
2489
+ /**
2490
+ * Every write of the state goes through here: a state that names its
2491
+ * backend checkout is remembered with its sponsor (see
2492
+ * `rememberSponsorOfCheckout`), whatever path created the checkout.
2493
+ */
2494
+ private get state();
2495
+ private set state(value);
2496
+ /** The last checkout + identity written to the memory — the state is set on every keystroke of the form. */
2497
+ private lastRememberedSponsor;
2412
2498
  /** Counts `open()` calls — see CheckoutState.session. */
2413
2499
  private sessionSeq;
2414
2500
  private applePayAvailableCache;
@@ -2471,7 +2557,24 @@ declare class CheckoutManager extends EventTarget {
2471
2557
  * `vio:payment-success` detail carries as `buyerRef` and analytics sends as
2472
2558
  * `buyer_id`. Never throws; `null` for whatever the API does not say.
2473
2559
  */
2474
- getOrderReference(checkoutId: string, sponsorId?: number): Promise<CheckoutReference>;
2560
+ getOrderReference(checkoutId: string, sponsorId?: number): Promise<OrderReference>;
2561
+ /**
2562
+ * The sponsor of a checkout as `getOrderReference` carries it
2563
+ * (`{ id, name, logoUrl }`): the given sponsor, else the one this tab
2564
+ * remembered for the checkout, else the open checkout's when it IS that
2565
+ * checkout — named by the `Vio.sponsorIdentity` rule. `undefined` when
2566
+ * nothing names it; never throws.
2567
+ */
2568
+ private checkoutSponsor;
2569
+ /** The sponsor id of a checkout: this tab's memory of it, else the open checkout's when it is that one. */
2570
+ private sponsorIdOfCheckout;
2571
+ private withSponsor;
2572
+ /**
2573
+ * Remember whose checkout this is (`rememberCheckoutSponsor`), with the
2574
+ * sponsor's name and logo as known now — so a confirmation after a redirect
2575
+ * or a reload can name the brand. Written again only when something changed.
2576
+ */
2577
+ private rememberSponsorOfCheckout;
2475
2578
  /** In-flight `getOrderReference` per checkout id (see there). */
2476
2579
  private referenceInFlight;
2477
2580
  /**
@@ -2975,6 +3078,22 @@ declare class VioFacade {
2975
3078
  */
2976
3079
  bootstrap(): Promise<BootstrapResponse>;
2977
3080
  get bootstrapCache(): BootstrapResponse | null;
3081
+ /**
3082
+ * Who a sponsor is to a shopper — `{ id, name, logoUrl, avatarUrl }` — by
3083
+ * the ONE rule every element uses (`sponsorIdentityFrom`): the live
3084
+ * bootstrap's sponsor blocks (the config's primary and secondaries, then
3085
+ * every `campaigns[]` primary and secondaries, first match); when the
3086
+ * bootstrap does not know the id (not loaded yet, a redirect return), what
3087
+ * this tab remembered of the checkout (`opts.checkoutId`, else the latest
3088
+ * checkout of that sponsor), then the cart's `sponsorName`. With only
3089
+ * `opts.checkoutId`, the sponsor is the one remembered for that checkout.
3090
+ * In a checkout pass the CHECKOUT's sponsor — never the page's
3091
+ * attribution. URLs as given; an empty logo is `null`. `null` when nothing
3092
+ * names it. Pure over local state, never throws.
3093
+ */
3094
+ sponsorIdentity(sponsorId?: number | string | null, opts?: {
3095
+ checkoutId?: string | null;
3096
+ }): SponsorIdentity | null;
2978
3097
  /**
2979
3098
  * Get a CommerceClient scoped to a specific sponsor (via bootstrap).
2980
3099
  * Throws if bootstrap hasn't been called or the sponsor is unknown.
@@ -3156,7 +3275,7 @@ declare function normalizeBuyerRef(value: unknown): string | undefined;
3156
3275
  *
3157
3276
  * RELEASE CHECKLIST: bump together with package.json (see CONTRIBUTING).
3158
3277
  */
3159
- declare const SDK_VERSION = "0.25.0";
3278
+ declare const SDK_VERSION = "0.27.0";
3160
3279
 
3161
3280
  /**
3162
3281
  * Vipps MobilePay's own button, the way the design guidelines ask for it.
@@ -3185,4 +3304,4 @@ declare function vippsButtonAttributes(verb?: 'buy' | 'pay' | 'express' | 'conti
3185
3304
  language?: string;
3186
3305
  }): Record<string, string>;
3187
3306
 
3188
- export { ADD_ITEM_MUTATION, type AddManualOptions, type AddProductOptions, type AnalyticsCommerce, type AnalyticsContext, type AnalyticsEventName, type AnalyticsItemInput, AnalyticsManager, type AnalyticsStartOptions, type ApplePayConfig, type ApplePayResult, type Attribution, BUYER_REF_MAX_LENGTH, type BootstrapCampaign, type BootstrapCampaignEntry, type BootstrapCampaignStatus, type BootstrapResponse, type BootstrapSlot, CHECKOUT_ATTRIBUTION_CAPS, CLIENT_LANDING_URL_MAX_LENGTH, CONTENT_URL_MAX_LENGTH, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, type CampaignHint, type CartChangeDetail, type CartLineItem, type CartLineOrigin, CartManager, type CartOrigin, type CartQueryOptions, type CartSlice, type CheckoutAddress, type CheckoutAttributionInput, type CheckoutAttributionWire, type CheckoutChangeDetail, CheckoutManager, type CheckoutManagerDeps, type CheckoutReference, type CheckoutState, type ClientContext, CommerceClient, Configuration, type ContentRef, type CreatePaymentVippsResponse, type CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, type EntryContextWire, type Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GRAPHQL_INT_MAX, type GatewayFeature, type GetVippsStatusVariables, type ImageSize, LINE_ORIGIN_CAPS, type Landing, type LineOriginWire, type LineOriginWireOptions, type ManifestLocation, type ManifestRequest, type ManifestResult, type OriginPage, type PaymentCompleteDetail, type PaymentMethod, type PaymentSelectDetail, type PaymentSuccessDetail, type PaymentSuccessResult, type PlacementComponent, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductPrice, type ProductVariant, type RegisterSlotOptions, type ResolvedConfig, SDK_VERSION, type SlotInput, type SlotKind, type Sponsor, type SponsorCartState, type SponsorCommerceBlock, type SurfacePrivacyMode, type SurfaceResponse, type TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_ITEM_WITH_ORIGIN_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, type VioConfig, type VioItem, type VioPlatform, type VippsPaymentState, type VippsStatusResult, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, buyerRefOf, campaignCandidates, capContentUrl, cartSlicesFrom, checkApplePayAvailability, checkoutAttributionOf, componentKindOf, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, dominantCampaignOf, ensureVippsButton, entryContextOf, executeCartGraphQL, formatPrice, gatewayHas, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCheckoutReference, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, isUnknownFeatureError, isUnknownTokenError, landingUrl, lineOriginWire, lineOrigins, normalizeBuyerRef, normalizeOrigin, normalizeScope, normalizeSlotKind, originAndPath, primaryImageUrl, purchaseFromPaymentSuccess, resetGatewayFeatures, resolveCampaignId, resolveClientContext, resolveContent, resolveLanding, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, storedLanding, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes, withGatewayFeature };
3307
+ export { ADD_ITEM_MUTATION, type AddManualOptions, type AddProductOptions, type AnalyticsCommerce, type AnalyticsContext, type AnalyticsEventName, type AnalyticsItemInput, AnalyticsManager, type AnalyticsStartOptions, type ApplePayConfig, type ApplePayResult, type Attribution, BUYER_REF_MAX_LENGTH, type BootstrapCampaign, type BootstrapCampaignEntry, type BootstrapCampaignStatus, type BootstrapResponse, type BootstrapSlot, CHECKOUT_ATTRIBUTION_CAPS, CHECKOUT_SPONSOR_STORAGE_KEY, CLIENT_LANDING_URL_MAX_LENGTH, CONTENT_URL_MAX_LENGTH, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, type CampaignHint, type CartChangeDetail, type CartLineItem, type CartLineOrigin, CartManager, type CartOrigin, type CartQueryOptions, type CartSlice, type CheckoutAddress, type CheckoutAttributionInput, type CheckoutAttributionWire, type CheckoutChangeDetail, CheckoutManager, type CheckoutManagerDeps, type CheckoutOpenDetail, type CheckoutReference, type CheckoutSponsor, type CheckoutState, type ClientContext, CommerceClient, Configuration, type ContentRef, type CreatePaymentVippsResponse, type CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, type EntryContextWire, type Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GRAPHQL_INT_MAX, type GatewayFeature, type GetVippsStatusVariables, type ImageSize, LINE_ORIGIN_CAPS, type Landing, type LineOriginWire, type LineOriginWireOptions, type ManifestLocation, type ManifestRequest, type ManifestResult, type OrderReference, type OriginPage, type PaymentCompleteDetail, type PaymentMethod, type PaymentSelectDetail, type PaymentSuccessDetail, type PaymentSuccessResult, type PlacementComponent, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductPrice, type ProductVariant, type RegisterSlotOptions, type ResolvedConfig, SDK_VERSION, type SlotInput, type SlotKind, type Sponsor, type SponsorCartState, type SponsorCommerceBlock, type SponsorIdentity, type SurfacePrivacyMode, type SurfaceResponse, type TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_ITEM_WITH_ORIGIN_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, type VioConfig, type VioItem, type VioPlatform, type VippsPaymentState, type VippsStatusResult, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, buyerRefOf, campaignCandidates, capContentUrl, cartSlicesFrom, checkApplePayAvailability, checkoutAttributionOf, componentKindOf, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, dominantCampaignOf, ensureVippsButton, entryContextOf, executeCartGraphQL, formatPrice, gatewayHas, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCheckoutReference, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, isUnknownFeatureError, isUnknownTokenError, landingUrl, lineOriginWire, lineOrigins, normalizeBuyerRef, normalizeOrigin, normalizeScope, normalizeSlotKind, originAndPath, primaryImageUrl, purchaseFromPaymentSuccess, resetGatewayFeatures, resolveCampaignId, resolveClientContext, resolveContent, resolveLanding, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, sponsorIdentityFrom, storedLanding, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes, withGatewayFeature };
@@ -1,4 +1,4 @@
1
- import '../chunk-NCP76AXW.js';
2
- export { ADD_ITEM_MUTATION, AnalyticsManager, BUYER_REF_MAX_LENGTH, CHECKOUT_ATTRIBUTION_CAPS, CLIENT_LANDING_URL_MAX_LENGTH, CONTENT_URL_MAX_LENGTH, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GRAPHQL_INT_MAX, LINE_ORIGIN_CAPS, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_ITEM_WITH_ORIGIN_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, buyerRefOf, campaignCandidates, capContentUrl, cartSlicesFrom, checkApplePayAvailability, checkoutAttributionOf, componentKindOf, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, dominantCampaignOf, ensureVippsButton, entryContextOf, executeCartGraphQL, formatPrice, gatewayHas, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCheckoutReference, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, isUnknownFeatureError, isUnknownTokenError, landingUrl, lineOriginWire, lineOrigins, normalizeBuyerRef, normalizeOrigin, normalizeScope, normalizeSlotKind, originAndPath, primaryImageUrl, purchaseFromPaymentSuccess, resetGatewayFeatures, resolveCampaignId, resolveClientContext, resolveContent, resolveLanding, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, storedLanding, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes, withGatewayFeature } from '../chunk-NXIYIY2D.js';
1
+ import '../chunk-67QESEV2.js';
2
+ export { ADD_ITEM_MUTATION, AnalyticsManager, BUYER_REF_MAX_LENGTH, CHECKOUT_ATTRIBUTION_CAPS, CHECKOUT_SPONSOR_STORAGE_KEY, CLIENT_LANDING_URL_MAX_LENGTH, CONTENT_URL_MAX_LENGTH, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GRAPHQL_INT_MAX, LINE_ORIGIN_CAPS, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_ITEM_WITH_ORIGIN_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, buyerRefOf, campaignCandidates, capContentUrl, cartSlicesFrom, checkApplePayAvailability, checkoutAttributionOf, componentKindOf, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, dominantCampaignOf, ensureVippsButton, entryContextOf, executeCartGraphQL, formatPrice, gatewayHas, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCheckoutReference, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, isUnknownFeatureError, isUnknownTokenError, landingUrl, lineOriginWire, lineOrigins, normalizeBuyerRef, normalizeOrigin, normalizeScope, normalizeSlotKind, originAndPath, primaryImageUrl, purchaseFromPaymentSuccess, resetGatewayFeatures, resolveCampaignId, resolveClientContext, resolveContent, resolveLanding, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, sponsorIdentityFrom, storedLanding, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes, withGatewayFeature } from '../chunk-HJRIPCWB.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { ADD_ITEM_MUTATION, AddManualOptions, AddProductOptions, AnalyticsCommerce, AnalyticsContext, AnalyticsEventName, AnalyticsItemInput, AnalyticsManager, AnalyticsStartOptions, ApplePayConfig, ApplePayResult, Attribution, BUYER_REF_MAX_LENGTH, BootstrapCampaign, BootstrapCampaignEntry, BootstrapCampaignStatus, BootstrapResponse, BootstrapSlot, CHECKOUT_ATTRIBUTION_CAPS, CLIENT_LANDING_URL_MAX_LENGTH, CONTENT_URL_MAX_LENGTH, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CampaignHint, CartChangeDetail, CartLineItem, CartLineOrigin, CartManager, CartOrigin, CartQueryOptions, CartSlice, CheckoutAddress, CheckoutAttributionInput, CheckoutAttributionWire, CheckoutChangeDetail, CheckoutManager, CheckoutManagerDeps, CheckoutReference, CheckoutState, ClientContext, CommerceClient, Configuration, ContentRef, CreatePaymentVippsResponse, CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, EntryContextWire, Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GRAPHQL_INT_MAX, GatewayFeature, GetVippsStatusVariables, ImageSize, LINE_ORIGIN_CAPS, Landing, LineOriginWire, LineOriginWireOptions, ManifestLocation, ManifestRequest, ManifestResult, OriginPage, PaymentCompleteDetail, PaymentMethod, PaymentSelectDetail, PaymentSuccessDetail, PaymentSuccessResult, PlacementComponent, Product, ProductCategory, ProductImage, ProductOption, ProductPrice, ProductVariant, RegisterSlotOptions, ResolvedConfig, SDK_VERSION, SlotInput, SlotKind, Sponsor, SponsorCartState, SponsorCommerceBlock, SurfacePrivacyMode, SurfaceResponse, TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_ITEM_WITH_ORIGIN_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, VioConfig, VioItem, VioPlatform, VippsPaymentState, VippsStatusResult, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, buyerRefOf, campaignCandidates, capContentUrl, cartSlicesFrom, checkApplePayAvailability, checkoutAttributionOf, componentKindOf, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, dominantCampaignOf, ensureVippsButton, entryContextOf, executeCartGraphQL, formatPrice, gatewayHas, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCheckoutReference, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, isUnknownFeatureError, isUnknownTokenError, landingUrl, lineOriginWire, lineOrigins, normalizeBuyerRef, normalizeOrigin, normalizeScope, normalizeSlotKind, originAndPath, primaryImageUrl, purchaseFromPaymentSuccess, resetGatewayFeatures, resolveCampaignId, resolveClientContext, resolveContent, resolveLanding, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, storedLanding, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes, withGatewayFeature } from './core/index.js';
1
+ export { ADD_ITEM_MUTATION, AddManualOptions, AddProductOptions, AnalyticsCommerce, AnalyticsContext, AnalyticsEventName, AnalyticsItemInput, AnalyticsManager, AnalyticsStartOptions, ApplePayConfig, ApplePayResult, Attribution, BUYER_REF_MAX_LENGTH, BootstrapCampaign, BootstrapCampaignEntry, BootstrapCampaignStatus, BootstrapResponse, BootstrapSlot, CHECKOUT_ATTRIBUTION_CAPS, CHECKOUT_SPONSOR_STORAGE_KEY, CLIENT_LANDING_URL_MAX_LENGTH, CONTENT_URL_MAX_LENGTH, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CampaignHint, CartChangeDetail, CartLineItem, CartLineOrigin, CartManager, CartOrigin, CartQueryOptions, CartSlice, CheckoutAddress, CheckoutAttributionInput, CheckoutAttributionWire, CheckoutChangeDetail, CheckoutManager, CheckoutManagerDeps, CheckoutOpenDetail, CheckoutReference, CheckoutSponsor, CheckoutState, ClientContext, CommerceClient, Configuration, ContentRef, CreatePaymentVippsResponse, CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, EntryContextWire, Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GRAPHQL_INT_MAX, GatewayFeature, GetVippsStatusVariables, ImageSize, LINE_ORIGIN_CAPS, Landing, LineOriginWire, LineOriginWireOptions, ManifestLocation, ManifestRequest, ManifestResult, OrderReference, OriginPage, PaymentCompleteDetail, PaymentMethod, PaymentSelectDetail, PaymentSuccessDetail, PaymentSuccessResult, PlacementComponent, Product, ProductCategory, ProductImage, ProductOption, ProductPrice, ProductVariant, RegisterSlotOptions, ResolvedConfig, SDK_VERSION, SlotInput, SlotKind, Sponsor, SponsorCartState, SponsorCommerceBlock, SponsorIdentity, SurfacePrivacyMode, SurfaceResponse, TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_ITEM_WITH_ORIGIN_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, VioConfig, VioItem, VioPlatform, VippsPaymentState, VippsStatusResult, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, buyerRefOf, campaignCandidates, capContentUrl, cartSlicesFrom, checkApplePayAvailability, checkoutAttributionOf, componentKindOf, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, dominantCampaignOf, ensureVippsButton, entryContextOf, executeCartGraphQL, formatPrice, gatewayHas, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCheckoutReference, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, isUnknownFeatureError, isUnknownTokenError, landingUrl, lineOriginWire, lineOrigins, normalizeBuyerRef, normalizeOrigin, normalizeScope, normalizeSlotKind, originAndPath, primaryImageUrl, purchaseFromPaymentSuccess, resetGatewayFeatures, resolveCampaignId, resolveClientContext, resolveContent, resolveLanding, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, sponsorIdentityFrom, storedLanding, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes, withGatewayFeature } from './core/index.js';
2
2
  import 'graphql-request';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import './chunk-NCP76AXW.js';
2
- export { ADD_ITEM_MUTATION, AnalyticsManager, BUYER_REF_MAX_LENGTH, CHECKOUT_ATTRIBUTION_CAPS, CLIENT_LANDING_URL_MAX_LENGTH, CONTENT_URL_MAX_LENGTH, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GRAPHQL_INT_MAX, LINE_ORIGIN_CAPS, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_ITEM_WITH_ORIGIN_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, buyerRefOf, campaignCandidates, capContentUrl, cartSlicesFrom, checkApplePayAvailability, checkoutAttributionOf, componentKindOf, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, dominantCampaignOf, ensureVippsButton, entryContextOf, executeCartGraphQL, formatPrice, gatewayHas, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCheckoutReference, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, isUnknownFeatureError, isUnknownTokenError, landingUrl, lineOriginWire, lineOrigins, normalizeBuyerRef, normalizeOrigin, normalizeScope, normalizeSlotKind, originAndPath, primaryImageUrl, purchaseFromPaymentSuccess, resetGatewayFeatures, resolveCampaignId, resolveClientContext, resolveContent, resolveLanding, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, storedLanding, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes, withGatewayFeature } from './chunk-NXIYIY2D.js';
1
+ import './chunk-67QESEV2.js';
2
+ export { ADD_ITEM_MUTATION, AnalyticsManager, BUYER_REF_MAX_LENGTH, CHECKOUT_ATTRIBUTION_CAPS, CHECKOUT_SPONSOR_STORAGE_KEY, CLIENT_LANDING_URL_MAX_LENGTH, CONTENT_URL_MAX_LENGTH, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GRAPHQL_INT_MAX, LINE_ORIGIN_CAPS, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_CHECKOUT_WITH_ATTRIBUTION_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_ITEM_WITH_ORIGIN_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, activeCampaignEntry, addItem, autoSlotDisplayName, autoSlotId, buyerRefOf, campaignCandidates, capContentUrl, cartSlicesFrom, checkApplePayAvailability, checkoutAttributionOf, componentKindOf, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, dominantCampaignOf, ensureVippsButton, entryContextOf, executeCartGraphQL, formatPrice, gatewayHas, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCheckoutReference, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, isUnknownFeatureError, isUnknownTokenError, landingUrl, lineOriginWire, lineOrigins, normalizeBuyerRef, normalizeOrigin, normalizeScope, normalizeSlotKind, originAndPath, primaryImageUrl, purchaseFromPaymentSuccess, resetGatewayFeatures, resolveCampaignId, resolveClientContext, resolveContent, resolveLanding, resolveSlotCampaign, sameOrigin, showApplePaySheet, sponsorCampaignEntry, sponsorIdentityFrom, storedLanding, toCampaignId, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes, withGatewayFeature } from './chunk-HJRIPCWB.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  import * as _lit_react from '@lit/react';
2
- import { V as VioCart$1, a as VioCheckout$1, b as VioProduct$1, c as VioProductCarousel$1, d as VioProductDetail$1 } from '../tokens-Bn7fK9ta.js';
3
- export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-Bn7fK9ta.js';
2
+ import { V as VioCart$1, a as VioCheckout$1, b as VioProduct$1, c as VioProductCarousel$1, d as VioProductDetail$1 } from '../tokens-CihuCU2l.js';
3
+ export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-CihuCU2l.js';
4
4
  import 'lit-html';
5
5
  import 'lit';
6
6
 
@@ -1,6 +1,6 @@
1
- import { registerVioElements, VioProduct, VioProductCarousel, VioProductDetail, VioCart, VioCheckout } from '../chunk-6Q2M3MIK.js';
2
- export { VioTokens, applyVioTheme } from '../chunk-6Q2M3MIK.js';
3
- import '../chunk-NXIYIY2D.js';
1
+ import { registerVioElements, VioProduct, VioProductCarousel, VioProductDetail, VioCart, VioCheckout } from '../chunk-GLAKUYQA.js';
2
+ export { VioTokens, applyVioTheme } from '../chunk-GLAKUYQA.js';
3
+ import '../chunk-HJRIPCWB.js';
4
4
  import * as React from 'react';
5
5
 
6
6
  // node_modules/@lit/react/node/create-component.js
@@ -390,6 +390,14 @@ declare class VioProductDetail extends LitElement {
390
390
  /** The seller's Company name; the brand when there is none; nothing while asking. */
391
391
  private headerName;
392
392
  private loadSeller;
393
+ /**
394
+ * Who sells the product: the brand of the sponsor it was fetched with —
395
+ * its logo, with the name as `alt`. Without a logo that loads, the topbar
396
+ * already names the seller (its Company name, else the brand), so the name
397
+ * goes here only when the topbar names nobody once the seller is known —
398
+ * never the same name twice. Nothing at all when no identity is known.
399
+ */
400
+ private renderSponsorHeader;
393
401
  render(): lit_html.TemplateResult<1>;
394
402
  private renderBody;
395
403
  private renderOptionPickers;
@@ -474,6 +482,8 @@ declare class VioCart extends LitElement {
474
482
  private startVippsExpressOrCheckout;
475
483
  /** Stripe — opens the checkout with Stripe preselected. */
476
484
  private onStripe;
485
+ /** The name over a sponsor's lines: the brand's display name by the one rule, else what the cart kept. */
486
+ private sponsorLabel;
477
487
  private get totalAcrossSponsors();
478
488
  private get primaryCurrency();
479
489
  private onIncrement;
@@ -520,6 +530,16 @@ declare class VioCheckout extends LitElement {
520
530
  private verifyingReturn;
521
531
  /** The checkout whose confirmation is on screen — see fillOrderNumber. */
522
532
  private confirmedCheckoutId;
533
+ /**
534
+ * Whose order is being confirmed (or verified, back from a payment page):
535
+ * the CHECKOUT's sponsor — from the return URL (`vio_sponsor`,
536
+ * `checkout_id`) or the state it was paid in — and how it was named before
537
+ * the cart was cleared. The header and the confirmation name it; never the
538
+ * page's attribution. See checkoutSponsorIdentity.
539
+ */
540
+ private orderSponsor;
541
+ /** The bootstrap that names the checkout's sponsor was asked for (once per checkout) — see watchSponsorBootstrap. */
542
+ private sponsorBootstrapAsked;
523
543
  /** Snapshot of the placed order, for the confirmation screen. */
524
544
  private confirmedOrder;
525
545
  /** Active Klarna Payments widget handle + the subtotal it was mounted for. */
@@ -871,6 +891,42 @@ declare class VioCheckout extends LitElement {
871
891
  /** Total to charge — items + shipping (express). */
872
892
  private payTotalLabel;
873
893
  render(): lit_html.TemplateResult<1>;
894
+ /**
895
+ * Remember whose order this is and how it is named right now, before the
896
+ * cart that names it is cleared. Whose: the sponsor this tab remembered for
897
+ * the checkout when it was created (exact for that checkout id), else the
898
+ * one given (the return URL's `vio_sponsor`, the state it was paid in),
899
+ * else the open state's — a return without `vio_sponsor` (Qliro, Walley)
900
+ * re-opens the state with whichever cart comes first, which is a guess.
901
+ */
902
+ private setOrderSponsor;
903
+ /**
904
+ * Who this checkout is with, as a shopper sees it: the order being
905
+ * confirmed / verified (`orderSponsor`), else the open checkout's own
906
+ * sponsor (`checkoutState.sponsorId`) — named by `Vio.sponsorIdentity`,
907
+ * which falls back to this tab's memory of the checkout and the cart; the
908
+ * name taken before the cart was cleared last. Never the page's
909
+ * attribution. `null` when nothing names it.
910
+ */
911
+ private checkoutSponsorIdentity;
912
+ /**
913
+ * `{ sponsor }` for the payment event — the same sponsor the screen names
914
+ * (`orderSponsor`, set by every path right before it emits): named now, else
915
+ * as named before the cart was cleared; `{}` when nothing names it.
916
+ */
917
+ private sponsorOfOrder;
918
+ /**
919
+ * Ask once per checkout for the bootstrap when it is not there yet and a
920
+ * sponsor has to be named (a redirect return renders before it), then
921
+ * render again — the name and the logo appear when it lands.
922
+ */
923
+ private watchSponsorBootstrap;
924
+ /**
925
+ * The checkout's sponsor in the header — «Du handler hos <logo|name>»
926
+ * («Du har handlet hos» on a provider's receipt). Not on our own
927
+ * confirmation, which says it in its body.
928
+ */
929
+ private renderTopbarSponsor;
874
930
  /**
875
931
  * The provider's receipt on its own. It must not depend on the cart: the
876
932
  * payment step is rendered from the cart, and clearing the cart after a
@@ -1,4 +1,4 @@
1
- export { V as VioCart, a as VioCheckout, b as VioProduct, c as VioProductCarousel, d as VioProductDetail, e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-Bn7fK9ta.js';
1
+ export { V as VioCart, a as VioCheckout, b as VioProduct, c as VioProductCarousel, d as VioProductDetail, e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-CihuCU2l.js';
2
2
  import 'lit-html';
3
3
  import 'lit';
4
4
 
package/dist/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { registerVioElements } from '../chunk-6Q2M3MIK.js';
2
- export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-6Q2M3MIK.js';
3
- import '../chunk-NXIYIY2D.js';
1
+ import { registerVioElements } from '../chunk-GLAKUYQA.js';
2
+ export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-GLAKUYQA.js';
3
+ import '../chunk-HJRIPCWB.js';
4
4
 
5
5
  // src/ui/index.ts
6
6
  registerVioElements();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vio-live/web-sdk",
3
- "version": "0.26.1",
3
+ "version": "0.27.0",
4
4
  "description": "Vio Web SDK — in-site shoppable + native checkout, designed for editorial commerce sites",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",