@cimplify/sdk 0.100.3 → 0.100.5
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/README.md +17 -0
- package/dist/advanced.d.mts +1 -1
- package/dist/advanced.d.ts +1 -1
- package/dist/advanced.js +20 -20
- package/dist/advanced.mjs +1 -1
- package/dist/{chunk-FWKSBF3F.js → chunk-3HU5I5VG.js} +20 -4
- package/dist/{chunk-NOGCGI4J.mjs → chunk-HSDQWJLA.mjs} +2 -2
- package/dist/{chunk-CNY2XFN4.js → chunk-JEVCHTKZ.js} +48 -47
- package/dist/{chunk-KNCW5DI7.js → chunk-LMD7B33E.js} +4 -4
- package/dist/{chunk-XCS56XSS.js → chunk-PNTINRAU.js} +31 -1
- package/dist/{chunk-HFTRLRLM.mjs → chunk-RQPXLXB2.mjs} +31 -1
- package/dist/{chunk-XG4DZT4I.mjs → chunk-RWR7JF7F.mjs} +2 -1
- package/dist/{chunk-FFRQNNUQ.mjs → chunk-Z7M6GAHS.mjs} +20 -4
- package/dist/{client-Bx4NRdl8.d.mts → client-BwRAAk4y.d.mts} +15 -0
- package/dist/{client-Cvp8W1r9.d.ts → client-CPcZIrjC.d.ts} +2 -2
- package/dist/{client-BWdeCgmo.d.ts → client-CrPglBBz.d.ts} +15 -0
- package/dist/{client-BGeSemVv.d.mts → client-DGrvLiJv.d.mts} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +69 -69
- package/dist/index.mjs +3 -3
- package/dist/lint-rules.json +1 -0
- package/dist/lint.d.mts +540 -0
- package/dist/lint.d.ts +540 -0
- package/dist/lint.js +540 -0
- package/dist/lint.mjs +524 -0
- package/dist/mock/cli.mjs +31 -1
- package/dist/mock/library.js +31 -1
- package/dist/mock/library.mjs +31 -1
- package/dist/mock/msw.js +31 -1
- package/dist/mock/msw.mjs +31 -1
- package/dist/react.d.mts +10 -5
- package/dist/react.d.ts +10 -5
- package/dist/react.js +40 -35
- package/dist/react.mjs +14 -9
- package/dist/{server-BRJ61o2J.d.mts → server-DRAW2OOX.d.mts} +4 -1
- package/dist/{server-CXrVYtNo.d.ts → server-zyrpzJVn.d.ts} +4 -1
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +7 -7
- package/dist/server.mjs +2 -2
- package/dist/styles.css +1 -1
- package/dist/testing/msw.d.mts +1 -1
- package/dist/testing/msw.d.ts +1 -1
- package/dist/testing/msw.js +2 -2
- package/dist/testing/msw.mjs +1 -1
- package/dist/testing/suite.d.mts +4 -4
- package/dist/testing/suite.d.ts +4 -4
- package/dist/testing/suite.js +23 -23
- package/dist/testing/suite.mjs +4 -4
- package/dist/testing.d.mts +18 -18
- package/dist/testing.d.ts +18 -18
- package/dist/testing.js +79 -79
- package/dist/testing.mjs +5 -5
- package/package.json +10 -2
package/dist/mock/msw.js
CHANGED
|
@@ -5714,6 +5714,13 @@ function createLiteService(opts) {
|
|
|
5714
5714
|
}
|
|
5715
5715
|
|
|
5716
5716
|
// src/mock/domain/link.ts
|
|
5717
|
+
var LOCATION_FIELDS = [
|
|
5718
|
+
"street_address",
|
|
5719
|
+
"city",
|
|
5720
|
+
"region",
|
|
5721
|
+
"postal_code",
|
|
5722
|
+
"country"
|
|
5723
|
+
];
|
|
5717
5724
|
var NOT_ENROLLED_ERROR = () => {
|
|
5718
5725
|
throw {
|
|
5719
5726
|
code: "NOT_ENROLLED",
|
|
@@ -5890,7 +5897,30 @@ function createLinkService({ clock, ids }) {
|
|
|
5890
5897
|
},
|
|
5891
5898
|
updateAddress(customerId, id, patch) {
|
|
5892
5899
|
const a = this.getAddressById(customerId, id);
|
|
5893
|
-
|
|
5900
|
+
const {
|
|
5901
|
+
clear_coordinates: clearCoordinates = false,
|
|
5902
|
+
latitude,
|
|
5903
|
+
longitude,
|
|
5904
|
+
...changes
|
|
5905
|
+
} = patch;
|
|
5906
|
+
const hasLatitude = latitude !== void 0;
|
|
5907
|
+
const hasLongitude = longitude !== void 0;
|
|
5908
|
+
if (hasLatitude !== hasLongitude) {
|
|
5909
|
+
throw new Error("latitude and longitude must be supplied together");
|
|
5910
|
+
}
|
|
5911
|
+
if (clearCoordinates && hasLatitude) {
|
|
5912
|
+
throw new Error("clear_coordinates cannot be combined with coordinates");
|
|
5913
|
+
}
|
|
5914
|
+
const locationChanged = LOCATION_FIELDS.some((field) => field in changes);
|
|
5915
|
+
Object.assign(a, changes);
|
|
5916
|
+
if (hasLatitude && hasLongitude) {
|
|
5917
|
+
a.latitude = latitude ?? null;
|
|
5918
|
+
a.longitude = longitude ?? null;
|
|
5919
|
+
} else if (clearCoordinates || locationChanged) {
|
|
5920
|
+
a.latitude = null;
|
|
5921
|
+
a.longitude = null;
|
|
5922
|
+
}
|
|
5923
|
+
a.updated_at = clock.iso();
|
|
5894
5924
|
return a;
|
|
5895
5925
|
},
|
|
5896
5926
|
deleteAddress(customerId, id) {
|
package/dist/mock/msw.mjs
CHANGED
|
@@ -5712,6 +5712,13 @@ function createLiteService(opts) {
|
|
|
5712
5712
|
}
|
|
5713
5713
|
|
|
5714
5714
|
// src/mock/domain/link.ts
|
|
5715
|
+
var LOCATION_FIELDS = [
|
|
5716
|
+
"street_address",
|
|
5717
|
+
"city",
|
|
5718
|
+
"region",
|
|
5719
|
+
"postal_code",
|
|
5720
|
+
"country"
|
|
5721
|
+
];
|
|
5715
5722
|
var NOT_ENROLLED_ERROR = () => {
|
|
5716
5723
|
throw {
|
|
5717
5724
|
code: "NOT_ENROLLED",
|
|
@@ -5888,7 +5895,30 @@ function createLinkService({ clock, ids }) {
|
|
|
5888
5895
|
},
|
|
5889
5896
|
updateAddress(customerId, id, patch) {
|
|
5890
5897
|
const a = this.getAddressById(customerId, id);
|
|
5891
|
-
|
|
5898
|
+
const {
|
|
5899
|
+
clear_coordinates: clearCoordinates = false,
|
|
5900
|
+
latitude,
|
|
5901
|
+
longitude,
|
|
5902
|
+
...changes
|
|
5903
|
+
} = patch;
|
|
5904
|
+
const hasLatitude = latitude !== void 0;
|
|
5905
|
+
const hasLongitude = longitude !== void 0;
|
|
5906
|
+
if (hasLatitude !== hasLongitude) {
|
|
5907
|
+
throw new Error("latitude and longitude must be supplied together");
|
|
5908
|
+
}
|
|
5909
|
+
if (clearCoordinates && hasLatitude) {
|
|
5910
|
+
throw new Error("clear_coordinates cannot be combined with coordinates");
|
|
5911
|
+
}
|
|
5912
|
+
const locationChanged = LOCATION_FIELDS.some((field) => field in changes);
|
|
5913
|
+
Object.assign(a, changes);
|
|
5914
|
+
if (hasLatitude && hasLongitude) {
|
|
5915
|
+
a.latitude = latitude ?? null;
|
|
5916
|
+
a.longitude = longitude ?? null;
|
|
5917
|
+
} else if (clearCoordinates || locationChanged) {
|
|
5918
|
+
a.latitude = null;
|
|
5919
|
+
a.longitude = null;
|
|
5920
|
+
}
|
|
5921
|
+
a.updated_at = clock.iso();
|
|
5892
5922
|
return a;
|
|
5893
5923
|
},
|
|
5894
5924
|
deleteAddress(customerId, id) {
|
package/dist/react.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default, { ReactNode, PointerEvent, MouseEvent } from 'react';
|
|
3
3
|
import { d as AdSlot, c as AdPosition, a as AdContextValue, S as SignInOptions } from './sign-in-DQlIdqsi.mjs';
|
|
4
4
|
export { A as AdConfig, g as getVariantDisplayName } from './sign-in-DQlIdqsi.mjs';
|
|
5
|
-
import { af as CimplifyClient, cb as OrderType, cw as ProcessCheckoutResult, ac as CheckoutStatus, ad as CheckoutStatusContext, a$ as EnrichedOrderItem, a_ as EnrichedOrder, w as Business, bA as Location, cN as ReorderResult, c9 as OrderStatus, bQ as Order, cy as QuoteBundleSelectionInput, cz as QuoteCompositeSelectionInput, cs as PriceQuote, cC as QuoteUiMessage, d7 as Service, r as AvailableSlot, ay as DayAvailability, aq as CustomerBooking, L as CancelBookingResult, f as ActivityStateResponse, dg as SessionMessage, c as ActivityRecommendation, aA as DeliveryFeeResponse, aD as DeliveryOptionsResponse, bd as FxRateResponse, dq as StoreCreditBalance, ds as StorefrontBootstrap, _ as ChatWidgetStarter, W as ChatMessage, Z as ChatUploadAttachment, h as AddressInfo, n as AuthenticatedData, aZ as ElementsOptions, cm as PaymentMethodInfo, aX as ElementsCheckoutResult, cv as ProcessCheckoutOptions, ai as CimplifyElements, T as ChatAttachment, bp as LineItem, dj as Staff, d2 as Room, Y as ChatReplyContext } from './client-
|
|
5
|
+
import { af as CimplifyClient, cb as OrderType, cw as ProcessCheckoutResult, ac as CheckoutStatus, ad as CheckoutStatusContext, a$ as EnrichedOrderItem, a_ as EnrichedOrder, w as Business, bA as Location, cN as ReorderResult, c9 as OrderStatus, bQ as Order, cy as QuoteBundleSelectionInput, cz as QuoteCompositeSelectionInput, cs as PriceQuote, cC as QuoteUiMessage, d7 as Service, r as AvailableSlot, ay as DayAvailability, aq as CustomerBooking, L as CancelBookingResult, f as ActivityStateResponse, dg as SessionMessage, c as ActivityRecommendation, aA as DeliveryFeeResponse, aD as DeliveryOptionsResponse, bd as FxRateResponse, dq as StoreCreditBalance, ds as StorefrontBootstrap, _ as ChatWidgetStarter, W as ChatMessage, Z as ChatUploadAttachment, h as AddressInfo, n as AuthenticatedData, aZ as ElementsOptions, cm as PaymentMethodInfo, aX as ElementsCheckoutResult, cv as ProcessCheckoutOptions, ai as CimplifyElements, T as ChatAttachment, bp as LineItem, dj as Staff, d2 as Room, Y as ChatReplyContext } from './client-BwRAAk4y.mjs';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
import { ad as CurrencyCode, aZ as Product, aQ as Pagination, V as CimplifyError, bb as ProductWithDetails, S as Category, aO as Money, U as ChosenPrice, E as BundleSelectionInput, a1 as ComponentSelectionInput, D as BundleSelectionData, aa as CompositeSelectionData, W as Collection, b6 as ProductTaxonomy, bx as TaxonomyWithChildren, b7 as ProductTimeProfile, aj as Deal, b2 as ProductDealInfo, ap as DiscountValidation, G as BundleSummary, a8 as CompositePriceResult, bs as SubscriptionWithDetails, br as SubscriptionStatus, bo as Subscription, ae as CustomAttributeDefinition, bc as PropertyFacet, b1 as ProductBillingPlan, bQ as VariantView, bK as VariantAxisWithValues, f as AddOnWithOptions, y as BundleComponentView, z as BundlePriceType, a6 as CompositeGroupView, as as DisplayCart, b3 as ProductInputField, h as AddressValue, bi as SaleInfo, bD as UpcomingSale, av as DurationUnit, t as BoundaryKind, bk as SchedulingMode, al as DepositType, af as CustomAttributeValue, b4 as ProductProperty, be as QuantityPricingTier } from './product-CeV8euw4.mjs';
|
|
8
8
|
import { P as ProductWithPrice } from './price-D96h6c6L.mjs';
|
|
@@ -1990,10 +1990,16 @@ interface AddressAutocompleteClassNames {
|
|
|
1990
1990
|
activeOption?: string;
|
|
1991
1991
|
}
|
|
1992
1992
|
interface AddressAutocompleteProps {
|
|
1993
|
+
/** Explicit transport for non-storefront surfaces such as Cimplify Link. */
|
|
1994
|
+
client?: CimplifyClient;
|
|
1993
1995
|
/** The currently resolved address, if any. Seeds the input text. */
|
|
1994
1996
|
value?: AddressValue | null;
|
|
1997
|
+
/** Initial free-text value when the address has no resolved map pin. */
|
|
1998
|
+
initialInputValue?: string;
|
|
1995
1999
|
/** Fires when the customer picks a suggestion and details resolve. */
|
|
1996
2000
|
onSelect: (address: AddressValue) => void;
|
|
2001
|
+
/** Mirrors the text field for flows that also accept an unmapped address. */
|
|
2002
|
+
onInputChange?: (value: string) => void;
|
|
1997
2003
|
/**
|
|
1998
2004
|
* Fires on every keystroke after a selection existed — the previous
|
|
1999
2005
|
* coordinates no longer describe what's typed, so consumers should clear
|
|
@@ -2012,14 +2018,13 @@ interface AddressAutocompleteProps {
|
|
|
2012
2018
|
declare function createPlacesSessionToken(): string;
|
|
2013
2019
|
/**
|
|
2014
2020
|
* AddressAutocomplete — a Places-backed address search that resolves to a
|
|
2015
|
-
* full {@link AddressValue} with coordinates.
|
|
2016
|
-
*
|
|
2017
|
-
* an order; this is the canonical way to capture a deliverable address.
|
|
2021
|
+
* full {@link AddressValue} with coordinates. Consumers may also mirror the
|
|
2022
|
+
* text through `onInputChange` when coordinate-free delivery is supported.
|
|
2018
2023
|
*
|
|
2019
2024
|
* Headless by default: style via `classNames` or the `data-cimplify-address-*`
|
|
2020
2025
|
* attributes.
|
|
2021
2026
|
*/
|
|
2022
|
-
declare function AddressAutocomplete({ value, onSelect, onDirty, placeholder, required, autoFocus, id, className, classNames, }: AddressAutocompleteProps): React__default.ReactElement;
|
|
2027
|
+
declare function AddressAutocomplete({ client: explicitClient, value, initialInputValue, onSelect, onInputChange, onDirty, placeholder, required, autoFocus, id, className, classNames, }: AddressAutocompleteProps): React__default.ReactElement;
|
|
2023
2028
|
|
|
2024
2029
|
interface SaleBadgeClassNames {
|
|
2025
2030
|
root?: string;
|
package/dist/react.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default, { ReactNode, PointerEvent, MouseEvent } from 'react';
|
|
3
3
|
import { d as AdSlot, c as AdPosition, a as AdContextValue, S as SignInOptions } from './sign-in-DQlIdqsi.js';
|
|
4
4
|
export { A as AdConfig, g as getVariantDisplayName } from './sign-in-DQlIdqsi.js';
|
|
5
|
-
import { af as CimplifyClient, cb as OrderType, cw as ProcessCheckoutResult, ac as CheckoutStatus, ad as CheckoutStatusContext, a$ as EnrichedOrderItem, a_ as EnrichedOrder, w as Business, bA as Location, cN as ReorderResult, c9 as OrderStatus, bQ as Order, cy as QuoteBundleSelectionInput, cz as QuoteCompositeSelectionInput, cs as PriceQuote, cC as QuoteUiMessage, d7 as Service, r as AvailableSlot, ay as DayAvailability, aq as CustomerBooking, L as CancelBookingResult, f as ActivityStateResponse, dg as SessionMessage, c as ActivityRecommendation, aA as DeliveryFeeResponse, aD as DeliveryOptionsResponse, bd as FxRateResponse, dq as StoreCreditBalance, ds as StorefrontBootstrap, _ as ChatWidgetStarter, W as ChatMessage, Z as ChatUploadAttachment, h as AddressInfo, n as AuthenticatedData, aZ as ElementsOptions, cm as PaymentMethodInfo, aX as ElementsCheckoutResult, cv as ProcessCheckoutOptions, ai as CimplifyElements, T as ChatAttachment, bp as LineItem, dj as Staff, d2 as Room, Y as ChatReplyContext } from './client-
|
|
5
|
+
import { af as CimplifyClient, cb as OrderType, cw as ProcessCheckoutResult, ac as CheckoutStatus, ad as CheckoutStatusContext, a$ as EnrichedOrderItem, a_ as EnrichedOrder, w as Business, bA as Location, cN as ReorderResult, c9 as OrderStatus, bQ as Order, cy as QuoteBundleSelectionInput, cz as QuoteCompositeSelectionInput, cs as PriceQuote, cC as QuoteUiMessage, d7 as Service, r as AvailableSlot, ay as DayAvailability, aq as CustomerBooking, L as CancelBookingResult, f as ActivityStateResponse, dg as SessionMessage, c as ActivityRecommendation, aA as DeliveryFeeResponse, aD as DeliveryOptionsResponse, bd as FxRateResponse, dq as StoreCreditBalance, ds as StorefrontBootstrap, _ as ChatWidgetStarter, W as ChatMessage, Z as ChatUploadAttachment, h as AddressInfo, n as AuthenticatedData, aZ as ElementsOptions, cm as PaymentMethodInfo, aX as ElementsCheckoutResult, cv as ProcessCheckoutOptions, ai as CimplifyElements, T as ChatAttachment, bp as LineItem, dj as Staff, d2 as Room, Y as ChatReplyContext } from './client-CrPglBBz.js';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
import { ad as CurrencyCode, aZ as Product, aQ as Pagination, V as CimplifyError, bb as ProductWithDetails, S as Category, aO as Money, U as ChosenPrice, E as BundleSelectionInput, a1 as ComponentSelectionInput, D as BundleSelectionData, aa as CompositeSelectionData, W as Collection, b6 as ProductTaxonomy, bx as TaxonomyWithChildren, b7 as ProductTimeProfile, aj as Deal, b2 as ProductDealInfo, ap as DiscountValidation, G as BundleSummary, a8 as CompositePriceResult, bs as SubscriptionWithDetails, br as SubscriptionStatus, bo as Subscription, ae as CustomAttributeDefinition, bc as PropertyFacet, b1 as ProductBillingPlan, bQ as VariantView, bK as VariantAxisWithValues, f as AddOnWithOptions, y as BundleComponentView, z as BundlePriceType, a6 as CompositeGroupView, as as DisplayCart, b3 as ProductInputField, h as AddressValue, bi as SaleInfo, bD as UpcomingSale, av as DurationUnit, t as BoundaryKind, bk as SchedulingMode, al as DepositType, af as CustomAttributeValue, b4 as ProductProperty, be as QuantityPricingTier } from './product-CeV8euw4.js';
|
|
8
8
|
import { P as ProductWithPrice } from './price-CJLfcYKd.js';
|
|
@@ -1990,10 +1990,16 @@ interface AddressAutocompleteClassNames {
|
|
|
1990
1990
|
activeOption?: string;
|
|
1991
1991
|
}
|
|
1992
1992
|
interface AddressAutocompleteProps {
|
|
1993
|
+
/** Explicit transport for non-storefront surfaces such as Cimplify Link. */
|
|
1994
|
+
client?: CimplifyClient;
|
|
1993
1995
|
/** The currently resolved address, if any. Seeds the input text. */
|
|
1994
1996
|
value?: AddressValue | null;
|
|
1997
|
+
/** Initial free-text value when the address has no resolved map pin. */
|
|
1998
|
+
initialInputValue?: string;
|
|
1995
1999
|
/** Fires when the customer picks a suggestion and details resolve. */
|
|
1996
2000
|
onSelect: (address: AddressValue) => void;
|
|
2001
|
+
/** Mirrors the text field for flows that also accept an unmapped address. */
|
|
2002
|
+
onInputChange?: (value: string) => void;
|
|
1997
2003
|
/**
|
|
1998
2004
|
* Fires on every keystroke after a selection existed — the previous
|
|
1999
2005
|
* coordinates no longer describe what's typed, so consumers should clear
|
|
@@ -2012,14 +2018,13 @@ interface AddressAutocompleteProps {
|
|
|
2012
2018
|
declare function createPlacesSessionToken(): string;
|
|
2013
2019
|
/**
|
|
2014
2020
|
* AddressAutocomplete — a Places-backed address search that resolves to a
|
|
2015
|
-
* full {@link AddressValue} with coordinates.
|
|
2016
|
-
*
|
|
2017
|
-
* an order; this is the canonical way to capture a deliverable address.
|
|
2021
|
+
* full {@link AddressValue} with coordinates. Consumers may also mirror the
|
|
2022
|
+
* text through `onInputChange` when coordinate-free delivery is supported.
|
|
2018
2023
|
*
|
|
2019
2024
|
* Headless by default: style via `classNames` or the `data-cimplify-address-*`
|
|
2020
2025
|
* attributes.
|
|
2021
2026
|
*/
|
|
2022
|
-
declare function AddressAutocomplete({ value, onSelect, onDirty, placeholder, required, autoFocus, id, className, classNames, }: AddressAutocompleteProps): React__default.ReactElement;
|
|
2027
|
+
declare function AddressAutocomplete({ client: explicitClient, value, initialInputValue, onSelect, onInputChange, onDirty, placeholder, required, autoFocus, id, className, classNames, }: AddressAutocompleteProps): React__default.ReactElement;
|
|
2023
2028
|
|
|
2024
2029
|
interface SaleBadgeClassNames {
|
|
2025
2030
|
root?: string;
|
package/dist/react.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var chunkQPRI2NII_js = require('./chunk-QPRI2NII.js');
|
|
5
4
|
var chunkXREIZ56K_js = require('./chunk-XREIZ56K.js');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var chunkQPRI2NII_js = require('./chunk-QPRI2NII.js');
|
|
6
|
+
var chunkJEVCHTKZ_js = require('./chunk-JEVCHTKZ.js');
|
|
7
|
+
var chunk3HU5I5VG_js = require('./chunk-3HU5I5VG.js');
|
|
8
8
|
var chunkWMEC5JWN_js = require('./chunk-WMEC5JWN.js');
|
|
9
9
|
var chunkNIOUSKQQ_js = require('./chunk-NIOUSKQQ.js');
|
|
10
10
|
require('./chunk-OWW5GUSB.js');
|
|
@@ -845,7 +845,7 @@ async function syncFromServer(entry) {
|
|
|
845
845
|
return next;
|
|
846
846
|
}
|
|
847
847
|
function emitMutationError(entry, operation, opId, idempotencyKey, error) {
|
|
848
|
-
entry.client.events.emit(
|
|
848
|
+
entry.client.events.emit(chunkJEVCHTKZ_js.MUTATION_ERROR, {
|
|
849
849
|
service: "cart",
|
|
850
850
|
operation,
|
|
851
851
|
opId,
|
|
@@ -885,10 +885,10 @@ function getOrCreateStore(params) {
|
|
|
885
885
|
syncTail: Promise.resolve(),
|
|
886
886
|
failedOpRemovers: /* @__PURE__ */ new Set()
|
|
887
887
|
};
|
|
888
|
-
client.events.on(
|
|
888
|
+
client.events.on(chunkJEVCHTKZ_js.SESSION_CLAIMED, () => {
|
|
889
889
|
if (entry.initialized) void syncFromServer(entry);
|
|
890
890
|
});
|
|
891
|
-
client.events.on(
|
|
891
|
+
client.events.on(chunkJEVCHTKZ_js.SESSION_CLEARED, () => {
|
|
892
892
|
if (entry.initialized) void syncFromServer(entry);
|
|
893
893
|
});
|
|
894
894
|
cartStores.set(storeKey, entry);
|
|
@@ -1192,7 +1192,7 @@ var DEFAULT_COUNTRY = "US";
|
|
|
1192
1192
|
function createDefaultClient() {
|
|
1193
1193
|
const processRef = globalThis.process;
|
|
1194
1194
|
const envPublicKey = processRef?.env?.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY || "";
|
|
1195
|
-
return
|
|
1195
|
+
return chunkJEVCHTKZ_js.createCimplifyClient({ publicKey: envPublicKey });
|
|
1196
1196
|
}
|
|
1197
1197
|
function getStoredLocationId() {
|
|
1198
1198
|
if (typeof window === "undefined" || !window.localStorage) {
|
|
@@ -3504,7 +3504,7 @@ function CimplifySignInButton({
|
|
|
3504
3504
|
const onClick = async () => {
|
|
3505
3505
|
if (busy || disabled || !signInOpts.clientId) return;
|
|
3506
3506
|
setBusy(true);
|
|
3507
|
-
await
|
|
3507
|
+
await chunk3HU5I5VG_js.startSignIn({
|
|
3508
3508
|
...signInOpts,
|
|
3509
3509
|
onSuccess: () => {
|
|
3510
3510
|
setBusy(false);
|
|
@@ -4972,9 +4972,9 @@ function useClientSessionEpoch(client) {
|
|
|
4972
4972
|
const subscribe = React14.useCallback(
|
|
4973
4973
|
(notify) => {
|
|
4974
4974
|
const unsubscribe = [
|
|
4975
|
-
client.events.on(
|
|
4976
|
-
client.events.on(
|
|
4977
|
-
client.events.on(
|
|
4975
|
+
client.events.on(chunkJEVCHTKZ_js.AUTH_TOKEN_CHANGED, notify),
|
|
4976
|
+
client.events.on(chunkJEVCHTKZ_js.SESSION_CLAIMED, notify),
|
|
4977
|
+
client.events.on(chunkJEVCHTKZ_js.SESSION_CLEARED, notify)
|
|
4978
4978
|
];
|
|
4979
4979
|
return () => {
|
|
4980
4980
|
for (const stopListening of unsubscribe) {
|
|
@@ -6304,7 +6304,7 @@ function useChat(options = {}) {
|
|
|
6304
6304
|
const watchSessionClaims = React14.useCallback(() => {
|
|
6305
6305
|
const c = clientRef.current;
|
|
6306
6306
|
if (!c || claimUnsubRef.current) return;
|
|
6307
|
-
const unsubClaimed = c.events.on(
|
|
6307
|
+
const unsubClaimed = c.events.on(chunkJEVCHTKZ_js.SESSION_CLAIMED, (event) => {
|
|
6308
6308
|
setClaimedAs(event.customerName || c.support.claimedCustomerName || null);
|
|
6309
6309
|
if (!openedRef.current) {
|
|
6310
6310
|
void openIfExisting();
|
|
@@ -6313,7 +6313,7 @@ function useChat(options = {}) {
|
|
|
6313
6313
|
connectWebSocket();
|
|
6314
6314
|
void resyncConversation();
|
|
6315
6315
|
});
|
|
6316
|
-
const unsubCleared = c.events.on(
|
|
6316
|
+
const unsubCleared = c.events.on(chunkJEVCHTKZ_js.SESSION_CLEARED, resetConversation);
|
|
6317
6317
|
claimUnsubRef.current = () => {
|
|
6318
6318
|
unsubClaimed();
|
|
6319
6319
|
unsubCleared();
|
|
@@ -6365,7 +6365,7 @@ function useChat(options = {}) {
|
|
|
6365
6365
|
if (!openedRef.current) return false;
|
|
6366
6366
|
}
|
|
6367
6367
|
const replyTo = opts?.replyTo;
|
|
6368
|
-
const clientId =
|
|
6368
|
+
const clientId = chunk3HU5I5VG_js.generateIdempotencyKey();
|
|
6369
6369
|
const localId = optimisticId(clientId);
|
|
6370
6370
|
const optimistic = {
|
|
6371
6371
|
id: localId,
|
|
@@ -6554,15 +6554,15 @@ function AuthElement({
|
|
|
6554
6554
|
}, [onReady, onAuthenticated, onError]);
|
|
6555
6555
|
React14.useEffect(() => {
|
|
6556
6556
|
if (!elements || !containerRef.current) return;
|
|
6557
|
-
const element = elements.create(
|
|
6557
|
+
const element = elements.create(chunk3HU5I5VG_js.ELEMENT_TYPES.AUTH, { prefillEmail });
|
|
6558
6558
|
elementRef.current = element;
|
|
6559
|
-
element.on(
|
|
6559
|
+
element.on(chunk3HU5I5VG_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6560
6560
|
element.on(
|
|
6561
|
-
|
|
6561
|
+
chunk3HU5I5VG_js.EVENT_TYPES.AUTHENTICATED,
|
|
6562
6562
|
(data) => onAuthenticatedRef.current?.(data)
|
|
6563
6563
|
);
|
|
6564
6564
|
element.on(
|
|
6565
|
-
|
|
6565
|
+
chunk3HU5I5VG_js.EVENT_TYPES.ERROR,
|
|
6566
6566
|
(data) => onErrorRef.current?.(data)
|
|
6567
6567
|
);
|
|
6568
6568
|
element.mount(containerRef.current);
|
|
@@ -6591,15 +6591,15 @@ function AddressElement({
|
|
|
6591
6591
|
}, [onReady, onChange, onError]);
|
|
6592
6592
|
React14.useEffect(() => {
|
|
6593
6593
|
if (!elements || !containerRef.current) return;
|
|
6594
|
-
const element = elements.create(
|
|
6594
|
+
const element = elements.create(chunk3HU5I5VG_js.ELEMENT_TYPES.ADDRESS, { mode });
|
|
6595
6595
|
elementRef.current = element;
|
|
6596
|
-
element.on(
|
|
6596
|
+
element.on(chunk3HU5I5VG_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6597
6597
|
element.on(
|
|
6598
|
-
|
|
6598
|
+
chunk3HU5I5VG_js.EVENT_TYPES.CHANGE,
|
|
6599
6599
|
(data) => onChangeRef.current?.(data)
|
|
6600
6600
|
);
|
|
6601
6601
|
element.on(
|
|
6602
|
-
|
|
6602
|
+
chunk3HU5I5VG_js.EVENT_TYPES.ERROR,
|
|
6603
6603
|
(data) => onErrorRef.current?.(data)
|
|
6604
6604
|
);
|
|
6605
6605
|
element.mount(containerRef.current);
|
|
@@ -6629,15 +6629,15 @@ function PaymentElement({
|
|
|
6629
6629
|
}, [onReady, onChange, onError]);
|
|
6630
6630
|
React14.useEffect(() => {
|
|
6631
6631
|
if (!elements || !containerRef.current) return;
|
|
6632
|
-
const element = elements.create(
|
|
6632
|
+
const element = elements.create(chunk3HU5I5VG_js.ELEMENT_TYPES.PAYMENT, { amount, currency });
|
|
6633
6633
|
elementRef.current = element;
|
|
6634
|
-
element.on(
|
|
6634
|
+
element.on(chunk3HU5I5VG_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6635
6635
|
element.on(
|
|
6636
|
-
|
|
6636
|
+
chunk3HU5I5VG_js.EVENT_TYPES.CHANGE,
|
|
6637
6637
|
(data) => onChangeRef.current?.(data)
|
|
6638
6638
|
);
|
|
6639
6639
|
element.on(
|
|
6640
|
-
|
|
6640
|
+
chunk3HU5I5VG_js.EVENT_TYPES.ERROR,
|
|
6641
6641
|
(data) => onErrorRef.current?.(data)
|
|
6642
6642
|
);
|
|
6643
6643
|
element.mount(containerRef.current);
|
|
@@ -8219,8 +8219,11 @@ var MIN_QUERY_LENGTH = 3;
|
|
|
8219
8219
|
var DEBOUNCE_MS = 300;
|
|
8220
8220
|
var BLUR_CLOSE_MS = 120;
|
|
8221
8221
|
function AddressAutocomplete({
|
|
8222
|
+
client: explicitClient,
|
|
8222
8223
|
value,
|
|
8224
|
+
initialInputValue,
|
|
8223
8225
|
onSelect,
|
|
8226
|
+
onInputChange,
|
|
8224
8227
|
onDirty,
|
|
8225
8228
|
placeholder,
|
|
8226
8229
|
required,
|
|
@@ -8230,7 +8233,10 @@ function AddressAutocomplete({
|
|
|
8230
8233
|
classNames
|
|
8231
8234
|
}) {
|
|
8232
8235
|
const clientContext = useOptionalCimplifyClient();
|
|
8233
|
-
const
|
|
8236
|
+
const client = explicitClient ?? clientContext?.client;
|
|
8237
|
+
const [inputText, setInputText] = React14__default.default.useState(
|
|
8238
|
+
value?.formatted_address ?? initialInputValue ?? ""
|
|
8239
|
+
);
|
|
8234
8240
|
const [suggestions, setSuggestions] = React14__default.default.useState([]);
|
|
8235
8241
|
const [isOpen, setIsOpen] = React14__default.default.useState(false);
|
|
8236
8242
|
const [highlightedIndex, setHighlightedIndex] = React14__default.default.useState(-1);
|
|
@@ -8247,7 +8253,6 @@ function AddressAutocomplete({
|
|
|
8247
8253
|
}, []);
|
|
8248
8254
|
const fetchSuggestions = React14__default.default.useCallback(
|
|
8249
8255
|
async (query) => {
|
|
8250
|
-
const client = clientContext?.client;
|
|
8251
8256
|
if (!client || query.length < MIN_QUERY_LENGTH) {
|
|
8252
8257
|
setSuggestions([]);
|
|
8253
8258
|
setIsOpen(false);
|
|
@@ -8265,10 +8270,11 @@ function AddressAutocomplete({
|
|
|
8265
8270
|
setIsOpen(false);
|
|
8266
8271
|
}
|
|
8267
8272
|
},
|
|
8268
|
-
[
|
|
8273
|
+
[client]
|
|
8269
8274
|
);
|
|
8270
8275
|
const handleInputChange = (nextValue) => {
|
|
8271
8276
|
setInputText(nextValue);
|
|
8277
|
+
onInputChange?.(nextValue);
|
|
8272
8278
|
onDirty?.();
|
|
8273
8279
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
8274
8280
|
debounceRef.current = setTimeout(() => void fetchSuggestions(nextValue.trim()), DEBOUNCE_MS);
|
|
@@ -8281,7 +8287,6 @@ function AddressAutocomplete({
|
|
|
8281
8287
|
setInputText(fallback);
|
|
8282
8288
|
setSuggestions([]);
|
|
8283
8289
|
setIsOpen(false);
|
|
8284
|
-
const client = clientContext?.client;
|
|
8285
8290
|
if (!client) return;
|
|
8286
8291
|
const result = await client.places.details(suggestion.place_id, sessionTokenRef.current);
|
|
8287
8292
|
sessionTokenRef.current = createPlacesSessionToken();
|
|
@@ -8303,7 +8308,7 @@ function AddressAutocomplete({
|
|
|
8303
8308
|
onSelect(address);
|
|
8304
8309
|
}
|
|
8305
8310
|
},
|
|
8306
|
-
[
|
|
8311
|
+
[client, onSelect]
|
|
8307
8312
|
);
|
|
8308
8313
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-address-autocomplete": true, className: cn("relative", className, classNames?.root), children: [
|
|
8309
8314
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -21241,10 +21246,6 @@ async function genUIFingerprint(manifest) {
|
|
|
21241
21246
|
return Array.from(new Uint8Array(digest)).map((byte) => byte.toString(16).padStart(2, "0")).join("").slice(0, 16);
|
|
21242
21247
|
}
|
|
21243
21248
|
|
|
21244
|
-
Object.defineProperty(exports, "getVariantDisplayName", {
|
|
21245
|
-
enumerable: true,
|
|
21246
|
-
get: function () { return chunkQPRI2NII_js.getVariantDisplayName; }
|
|
21247
|
-
});
|
|
21248
21249
|
Object.defineProperty(exports, "messagePreview", {
|
|
21249
21250
|
enumerable: true,
|
|
21250
21251
|
get: function () { return chunkXREIZ56K_js.messagePreview; }
|
|
@@ -21253,6 +21254,10 @@ Object.defineProperty(exports, "splitGenUIContent", {
|
|
|
21253
21254
|
enumerable: true,
|
|
21254
21255
|
get: function () { return chunkXREIZ56K_js.splitGenUIContent; }
|
|
21255
21256
|
});
|
|
21257
|
+
Object.defineProperty(exports, "getVariantDisplayName", {
|
|
21258
|
+
enumerable: true,
|
|
21259
|
+
get: function () { return chunkQPRI2NII_js.getVariantDisplayName; }
|
|
21260
|
+
});
|
|
21256
21261
|
exports.AccommodationCard = AccommodationCard;
|
|
21257
21262
|
exports.AccountContent = AccountContent;
|
|
21258
21263
|
exports.AccountDashboardPage = AccountDashboardPage;
|
package/dist/react.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { DURATION_UNIT, getVariantDisplayName, INPUT_FIELD_TYPE, isMultiDayService, serviceBillingMultiplier, PRODUCT_TYPE, BOUNDARY_KIND, resolveGallery, chatMessageCards, RENDER_HINT, DEFAULT_CDN_BASE_URL } from './chunk-4G5UWFC3.mjs';
|
|
3
|
-
export { getVariantDisplayName } from './chunk-4G5UWFC3.mjs';
|
|
4
2
|
import { splitGenUIContent, messagePreview } from './chunk-U4MW6PYU.mjs';
|
|
5
3
|
export { messagePreview, splitGenUIContent } from './chunk-U4MW6PYU.mjs';
|
|
6
|
-
import {
|
|
7
|
-
|
|
4
|
+
import { DURATION_UNIT, getVariantDisplayName, INPUT_FIELD_TYPE, isMultiDayService, serviceBillingMultiplier, PRODUCT_TYPE, BOUNDARY_KIND, resolveGallery, chatMessageCards, RENDER_HINT, DEFAULT_CDN_BASE_URL } from './chunk-4G5UWFC3.mjs';
|
|
5
|
+
export { getVariantDisplayName } from './chunk-4G5UWFC3.mjs';
|
|
6
|
+
import { SESSION_CLAIMED, SESSION_CLEARED, createCimplifyClient, AUTH_TOKEN_CHANGED, MUTATION_ERROR } from './chunk-RWR7JF7F.mjs';
|
|
7
|
+
import { generateIdempotencyKey, ELEMENT_TYPES, EVENT_TYPES, startSignIn } from './chunk-Z7M6GAHS.mjs';
|
|
8
8
|
import { parsePrice, formatMoney, formatPrice, getVariantUnitPrice, getProductCurrency, getUnitPriceAtQuantity, isOnSale, getDiscountPercentage, getBasePrice, getPriceRange, formatPriceRange } from './chunk-DLW3RWRK.mjs';
|
|
9
9
|
import { isSupportedCurrency, currencyCode, CimplifyError } from './chunk-O3YUHLZL.mjs';
|
|
10
10
|
import './chunk-3G6RQLXK.mjs';
|
|
@@ -8195,8 +8195,11 @@ var MIN_QUERY_LENGTH = 3;
|
|
|
8195
8195
|
var DEBOUNCE_MS = 300;
|
|
8196
8196
|
var BLUR_CLOSE_MS = 120;
|
|
8197
8197
|
function AddressAutocomplete({
|
|
8198
|
+
client: explicitClient,
|
|
8198
8199
|
value,
|
|
8200
|
+
initialInputValue,
|
|
8199
8201
|
onSelect,
|
|
8202
|
+
onInputChange,
|
|
8200
8203
|
onDirty,
|
|
8201
8204
|
placeholder,
|
|
8202
8205
|
required,
|
|
@@ -8206,7 +8209,10 @@ function AddressAutocomplete({
|
|
|
8206
8209
|
classNames
|
|
8207
8210
|
}) {
|
|
8208
8211
|
const clientContext = useOptionalCimplifyClient();
|
|
8209
|
-
const
|
|
8212
|
+
const client = explicitClient ?? clientContext?.client;
|
|
8213
|
+
const [inputText, setInputText] = React14.useState(
|
|
8214
|
+
value?.formatted_address ?? initialInputValue ?? ""
|
|
8215
|
+
);
|
|
8210
8216
|
const [suggestions, setSuggestions] = React14.useState([]);
|
|
8211
8217
|
const [isOpen, setIsOpen] = React14.useState(false);
|
|
8212
8218
|
const [highlightedIndex, setHighlightedIndex] = React14.useState(-1);
|
|
@@ -8223,7 +8229,6 @@ function AddressAutocomplete({
|
|
|
8223
8229
|
}, []);
|
|
8224
8230
|
const fetchSuggestions = React14.useCallback(
|
|
8225
8231
|
async (query) => {
|
|
8226
|
-
const client = clientContext?.client;
|
|
8227
8232
|
if (!client || query.length < MIN_QUERY_LENGTH) {
|
|
8228
8233
|
setSuggestions([]);
|
|
8229
8234
|
setIsOpen(false);
|
|
@@ -8241,10 +8246,11 @@ function AddressAutocomplete({
|
|
|
8241
8246
|
setIsOpen(false);
|
|
8242
8247
|
}
|
|
8243
8248
|
},
|
|
8244
|
-
[
|
|
8249
|
+
[client]
|
|
8245
8250
|
);
|
|
8246
8251
|
const handleInputChange = (nextValue) => {
|
|
8247
8252
|
setInputText(nextValue);
|
|
8253
|
+
onInputChange?.(nextValue);
|
|
8248
8254
|
onDirty?.();
|
|
8249
8255
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
8250
8256
|
debounceRef.current = setTimeout(() => void fetchSuggestions(nextValue.trim()), DEBOUNCE_MS);
|
|
@@ -8257,7 +8263,6 @@ function AddressAutocomplete({
|
|
|
8257
8263
|
setInputText(fallback);
|
|
8258
8264
|
setSuggestions([]);
|
|
8259
8265
|
setIsOpen(false);
|
|
8260
|
-
const client = clientContext?.client;
|
|
8261
8266
|
if (!client) return;
|
|
8262
8267
|
const result = await client.places.details(suggestion.place_id, sessionTokenRef.current);
|
|
8263
8268
|
sessionTokenRef.current = createPlacesSessionToken();
|
|
@@ -8279,7 +8284,7 @@ function AddressAutocomplete({
|
|
|
8279
8284
|
onSelect(address);
|
|
8280
8285
|
}
|
|
8281
8286
|
},
|
|
8282
|
-
[
|
|
8287
|
+
[client, onSelect]
|
|
8283
8288
|
);
|
|
8284
8289
|
return /* @__PURE__ */ jsxs("div", { "data-cimplify-address-autocomplete": true, className: cn("relative", className, classNames?.root), children: [
|
|
8285
8290
|
/* @__PURE__ */ jsx(
|
|
@@ -1012,6 +1012,9 @@ interface MockAddress {
|
|
|
1012
1012
|
created_at: string;
|
|
1013
1013
|
updated_at: string;
|
|
1014
1014
|
}
|
|
1015
|
+
type MockAddressPatch = Partial<MockAddress> & {
|
|
1016
|
+
clear_coordinates?: boolean;
|
|
1017
|
+
};
|
|
1015
1018
|
interface MockMobileMoney {
|
|
1016
1019
|
id: string;
|
|
1017
1020
|
customer_id: string;
|
|
@@ -1098,7 +1101,7 @@ interface LinkService {
|
|
|
1098
1101
|
getAddresses(customerId: string): MockAddress[];
|
|
1099
1102
|
getAddressById(customerId: string, id: string): MockAddress;
|
|
1100
1103
|
createAddress(customerId: string, input: Partial<MockAddress>): MockAddress;
|
|
1101
|
-
updateAddress(customerId: string, id: string, patch:
|
|
1104
|
+
updateAddress(customerId: string, id: string, patch: MockAddressPatch): MockAddress;
|
|
1102
1105
|
deleteAddress(customerId: string, id: string): void;
|
|
1103
1106
|
setDefaultAddress(customerId: string, id: string): void;
|
|
1104
1107
|
trackAddressUsage(customerId: string, id: string): void;
|
|
@@ -1012,6 +1012,9 @@ interface MockAddress {
|
|
|
1012
1012
|
created_at: string;
|
|
1013
1013
|
updated_at: string;
|
|
1014
1014
|
}
|
|
1015
|
+
type MockAddressPatch = Partial<MockAddress> & {
|
|
1016
|
+
clear_coordinates?: boolean;
|
|
1017
|
+
};
|
|
1015
1018
|
interface MockMobileMoney {
|
|
1016
1019
|
id: string;
|
|
1017
1020
|
customer_id: string;
|
|
@@ -1098,7 +1101,7 @@ interface LinkService {
|
|
|
1098
1101
|
getAddresses(customerId: string): MockAddress[];
|
|
1099
1102
|
getAddressById(customerId: string, id: string): MockAddress;
|
|
1100
1103
|
createAddress(customerId: string, input: Partial<MockAddress>): MockAddress;
|
|
1101
|
-
updateAddress(customerId: string, id: string, patch:
|
|
1104
|
+
updateAddress(customerId: string, id: string, patch: MockAddressPatch): MockAddress;
|
|
1102
1105
|
deleteAddress(customerId: string, id: string): void;
|
|
1103
1106
|
setDefaultAddress(customerId: string, id: string): void;
|
|
1104
1107
|
trackAddressUsage(customerId: string, id: string): void;
|
package/dist/server.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { af as CimplifyClient } from './client-
|
|
2
|
-
export { J as CacheOptions, cD as ReadRequestOptions, c_ as Result } from './client-
|
|
1
|
+
import { af as CimplifyClient } from './client-BwRAAk4y.mjs';
|
|
2
|
+
export { J as CacheOptions, cD as ReadRequestOptions, c_ as Result } from './client-BwRAAk4y.mjs';
|
|
3
3
|
export { S as Category, V as CimplifyError, W as Collection, aZ as Product, bb as ProductWithDetails } from './product-CeV8euw4.mjs';
|
|
4
4
|
import { JWTVerifyResult } from 'jose';
|
|
5
5
|
import './payment-BSzy7sly.mjs';
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { af as CimplifyClient } from './client-
|
|
2
|
-
export { J as CacheOptions, cD as ReadRequestOptions, c_ as Result } from './client-
|
|
1
|
+
import { af as CimplifyClient } from './client-CrPglBBz.js';
|
|
2
|
+
export { J as CacheOptions, cD as ReadRequestOptions, c_ as Result } from './client-CrPglBBz.js';
|
|
3
3
|
export { S as Category, V as CimplifyError, W as Collection, aZ as Product, bb as ProductWithDetails } from './product-CeV8euw4.js';
|
|
4
4
|
import { JWTVerifyResult } from 'jose';
|
|
5
5
|
import './payment-jK8ztICx.js';
|
package/dist/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkJEVCHTKZ_js = require('./chunk-JEVCHTKZ.js');
|
|
4
|
+
var chunk3HU5I5VG_js = require('./chunk-3HU5I5VG.js');
|
|
5
5
|
require('./chunk-WMEC5JWN.js');
|
|
6
6
|
var chunkNIOUSKQQ_js = require('./chunk-NIOUSKQQ.js');
|
|
7
7
|
require('./chunk-OWW5GUSB.js');
|
|
@@ -26,7 +26,7 @@ function readEnv(...keys) {
|
|
|
26
26
|
var getServerClient = react.cache((opts = {}) => {
|
|
27
27
|
const baseUrl = opts.apiUrl ?? readEnv("CIMPLIFY_API_URL", "NEXT_PUBLIC_CIMPLIFY_API_URL") ?? defaultBaseUrl();
|
|
28
28
|
const publicKey = opts.secretKey ?? readEnv("CIMPLIFY_SECRET_KEY", "NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY") ?? "mock-dev";
|
|
29
|
-
const client =
|
|
29
|
+
const client = chunkJEVCHTKZ_js.createCimplifyClient({
|
|
30
30
|
baseUrl,
|
|
31
31
|
publicKey,
|
|
32
32
|
suppressPublicKeyWarning: true
|
|
@@ -250,7 +250,7 @@ var QUERY_AUTH_ERROR = "cimplify_auth_error";
|
|
|
250
250
|
var discoveryCache = /* @__PURE__ */ new Map();
|
|
251
251
|
var jwksCache = /* @__PURE__ */ new Map();
|
|
252
252
|
function issuerBase(cfg) {
|
|
253
|
-
return (cfg.issuer ?? cfg.authUrl ??
|
|
253
|
+
return (cfg.issuer ?? cfg.authUrl ?? chunk3HU5I5VG_js.DEFAULT_ISSUER).replace(/\/$/, "");
|
|
254
254
|
}
|
|
255
255
|
function cookieName(cfg) {
|
|
256
256
|
return cfg.cookieName ?? SESSION_COOKIE;
|
|
@@ -465,12 +465,12 @@ async function handleOidcCallback(req, opts) {
|
|
|
465
465
|
}
|
|
466
466
|
function readPkceCookie(cookieHeader) {
|
|
467
467
|
if (!cookieHeader) return null;
|
|
468
|
-
const match = cookieHeader.split(/;\s*/).find((p) => p.startsWith(`${
|
|
468
|
+
const match = cookieHeader.split(/;\s*/).find((p) => p.startsWith(`${chunk3HU5I5VG_js.PKCE_COOKIE}=`));
|
|
469
469
|
if (!match) return null;
|
|
470
|
-
return
|
|
470
|
+
return chunk3HU5I5VG_js.decodePkceState(match.slice(chunk3HU5I5VG_js.PKCE_COOKIE.length + 1));
|
|
471
471
|
}
|
|
472
472
|
function buildPkceClearCookie() {
|
|
473
|
-
return `${
|
|
473
|
+
return `${chunk3HU5I5VG_js.PKCE_COOKIE}=; Path=${chunk3HU5I5VG_js.PKCE_COOKIE_PATH}; Max-Age=0; Secure; SameSite=Lax`;
|
|
474
474
|
}
|
|
475
475
|
function safeReturnPath(returnTo, fallback) {
|
|
476
476
|
if (returnTo && returnTo.startsWith("/") && !returnTo.startsWith("//")) return returnTo;
|
package/dist/server.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createCimplifyClient } from './chunk-
|
|
2
|
-
import { PKCE_COOKIE, decodePkceState, PKCE_COOKIE_PATH, DEFAULT_ISSUER } from './chunk-
|
|
1
|
+
import { createCimplifyClient } from './chunk-RWR7JF7F.mjs';
|
|
2
|
+
import { PKCE_COOKIE, decodePkceState, PKCE_COOKIE_PATH, DEFAULT_ISSUER } from './chunk-Z7M6GAHS.mjs';
|
|
3
3
|
import './chunk-DLW3RWRK.mjs';
|
|
4
4
|
export { CimplifyError } from './chunk-O3YUHLZL.mjs';
|
|
5
5
|
import './chunk-3G6RQLXK.mjs';
|