bitsnap-react 1.8.0 → 1.10.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/README.md +162 -0
- package/dist/CartProvider-HXLGQ4EX.mjs +2 -0
- package/dist/CartProvider-OHHYOMSG.js +2 -0
- package/dist/CartProvider-OHHYOMSG.js.map +1 -0
- package/dist/analytics.d.mts +45 -0
- package/dist/analytics.d.ts +45 -0
- package/dist/analytics.js +2 -0
- package/dist/analytics.js.map +1 -0
- package/dist/analytics.mjs +2 -0
- package/dist/catalog.d.mts +14 -1
- package/dist/catalog.d.ts +14 -1
- package/dist/catalog.js +1 -1
- package/dist/catalog.js.map +1 -1
- package/dist/catalog.mjs +1 -1
- package/dist/chunk-3Z6VNXBP.js +2 -0
- package/dist/chunk-3Z6VNXBP.js.map +1 -0
- package/dist/chunk-43IIYJ6J.mjs +2 -0
- package/dist/chunk-43IIYJ6J.mjs.map +1 -0
- package/dist/chunk-6D3OORMK.mjs +2 -0
- package/dist/chunk-6D3OORMK.mjs.map +1 -0
- package/dist/chunk-ADYVTMGH.mjs +2 -0
- package/dist/chunk-ADYVTMGH.mjs.map +1 -0
- package/dist/{chunk-WRCXZMKK.js → chunk-AJNULBC3.js} +2 -2
- package/dist/chunk-AJNULBC3.js.map +1 -0
- package/dist/chunk-B32ACCW2.js +2 -0
- package/dist/chunk-B32ACCW2.js.map +1 -0
- package/dist/chunk-DDY7IBMG.mjs +2 -0
- package/dist/chunk-DDY7IBMG.mjs.map +1 -0
- package/dist/chunk-DPKT6ITB.js +4 -0
- package/dist/chunk-DPKT6ITB.js.map +1 -0
- package/dist/{chunk-T2POA6RW.js → chunk-F46RJVWC.js} +2 -2
- package/dist/chunk-F46RJVWC.js.map +1 -0
- package/dist/chunk-F6GQLKA6.js +2 -0
- package/dist/chunk-F6GQLKA6.js.map +1 -0
- package/dist/chunk-JSDGZ4NY.js.map +1 -1
- package/dist/chunk-JXCHRSPW.mjs +4 -0
- package/dist/chunk-JXCHRSPW.mjs.map +1 -0
- package/dist/chunk-KOYBZORL.js.map +1 -1
- package/dist/chunk-RLEC25JI.mjs +2 -0
- package/dist/chunk-RLEC25JI.mjs.map +1 -0
- package/dist/chunk-RVILRUW3.js +2 -0
- package/dist/chunk-RVILRUW3.js.map +1 -0
- package/dist/chunk-T2OUOO4X.mjs +2 -0
- package/dist/chunk-T2OUOO4X.mjs.map +1 -0
- package/dist/chunk-VIII45AC.js +2 -0
- package/dist/chunk-VIII45AC.js.map +1 -0
- package/dist/chunk-XIHGWNTS.js +2 -0
- package/dist/chunk-XIHGWNTS.js.map +1 -0
- package/dist/chunk-YXFJG4MF.mjs +2 -0
- package/dist/chunk-YXFJG4MF.mjs.map +1 -0
- package/dist/chunk-ZPTHK4OX.mjs +2 -0
- package/dist/{chunk-OJT3YO2R.mjs.map → chunk-ZPTHK4OX.mjs.map} +1 -1
- package/dist/consent.d.mts +165 -0
- package/dist/consent.d.ts +165 -0
- package/dist/consent.js +75 -0
- package/dist/consent.js.map +1 -0
- package/dist/consent.mjs +75 -0
- package/dist/consent.mjs.map +1 -0
- package/dist/course.d.mts +13 -3
- package/dist/course.d.ts +13 -3
- package/dist/course.js +1 -1
- package/dist/course.js.map +1 -1
- package/dist/course.mjs +1 -1
- package/dist/course.mjs.map +1 -1
- package/dist/embed/analytics.js +1 -0
- package/dist/embed/consent.js +74 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +54 -7
- package/dist/index.d.ts +54 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/instrument-CmxK7S4T.d.mts +929 -0
- package/dist/instrument-CmxK7S4T.d.ts +929 -0
- package/dist/internal.js.map +1 -1
- package/dist/methods-A5KGZBAM.js +2 -0
- package/dist/methods-A5KGZBAM.js.map +1 -0
- package/dist/methods-AOHKV7IN.mjs +2 -0
- package/dist/methods-AOHKV7IN.mjs.map +1 -0
- package/dist/models.js.map +1 -1
- package/dist/returns.d.mts +9 -1
- package/dist/returns.d.ts +9 -1
- package/dist/returns.js +1 -1
- package/dist/returns.js.map +1 -1
- package/dist/returns.mjs +1 -1
- package/dist/{types-PSBBDdQm.d.mts → types-BnVWLcoB.d.mts} +13 -0
- package/dist/{types-BTm_ZolC.d.ts → types-i-IuN4Im.d.ts} +13 -0
- package/package.json +46 -45
- package/dist/CartProvider-5KAG5QGA.mjs +0 -2
- package/dist/CartProvider-7GJXW2IP.js +0 -2
- package/dist/CartProvider-7GJXW2IP.js.map +0 -1
- package/dist/chunk-45AP7UZE.mjs +0 -2
- package/dist/chunk-45AP7UZE.mjs.map +0 -1
- package/dist/chunk-7XTDFTQU.js +0 -4
- package/dist/chunk-7XTDFTQU.js.map +0 -1
- package/dist/chunk-C6Z7LOHB.mjs +0 -2
- package/dist/chunk-C6Z7LOHB.mjs.map +0 -1
- package/dist/chunk-HB6KQT26.mjs +0 -4
- package/dist/chunk-HB6KQT26.mjs.map +0 -1
- package/dist/chunk-LWK4E5G5.js +0 -2
- package/dist/chunk-LWK4E5G5.js.map +0 -1
- package/dist/chunk-OJT3YO2R.mjs +0 -2
- package/dist/chunk-OUYRKNZJ.mjs +0 -2
- package/dist/chunk-OUYRKNZJ.mjs.map +0 -1
- package/dist/chunk-P2YB25KZ.js +0 -2
- package/dist/chunk-P2YB25KZ.js.map +0 -1
- package/dist/chunk-T2POA6RW.js.map +0 -1
- package/dist/chunk-VPKE2ZOR.mjs +0 -2
- package/dist/chunk-VPKE2ZOR.mjs.map +0 -1
- package/dist/chunk-WRCXZMKK.js.map +0 -1
- package/dist/chunk-WSM4OM72.mjs +0 -2
- package/dist/chunk-WSM4OM72.mjs.map +0 -1
- package/dist/chunk-XRNTUSBH.js +0 -2
- package/dist/chunk-XRNTUSBH.js.map +0 -1
- package/dist/chunk-Z2BKIX6F.js +0 -2
- package/dist/chunk-Z2BKIX6F.js.map +0 -1
- package/dist/methods-ITD6WFIY.mjs +0 -2
- package/dist/methods-JENIGNF7.js +0 -2
- package/dist/methods-JENIGNF7.js.map +0 -1
- /package/dist/{CartProvider-5KAG5QGA.mjs.map → CartProvider-HXLGQ4EX.mjs.map} +0 -0
- /package/dist/{methods-ITD6WFIY.mjs.map → analytics.mjs.map} +0 -0
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/emems/
|
|
1
|
+
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/visitor-cookie/dist/internal.js","../src/internal.ts"],"names":["require_internal","__commonJSMin"],"mappings":"AAAA,+HAAkC,ICAlCA,CAAAA,CAAAC,gCAAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,SAAA,UAAA,CAAA,CAAA,CAAA","file":"/home/emems/.t3/worktrees/bitsnap-react/visitor-cookie/dist/internal.js","sourcesContent":[null,""]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkDPKT6ITBjs = require('./chunk-DPKT6ITB.js');require('./chunk-RVILRUW3.js');require('./chunk-KOYBZORL.js');require('./chunk-F6GQLKA6.js');require('./chunk-AJNULBC3.js');require('./chunk-VIII45AC.js');require('./chunk-B32ACCW2.js');require('./chunk-XIHGWNTS.js');require('./chunk-JSDGZ4NY.js');exports.Bitsnap = _chunkDPKT6ITBjs.w; exports.createCheckout = _chunkDPKT6ITBjs.y; exports.createPaymentURL = _chunkDPKT6ITBjs.x; exports.getReferenceIfPossible = _chunkDPKT6ITBjs.z; exports.injectReferenceToRequestIfNeeded = _chunkDPKT6ITBjs.A;
|
|
2
|
+
//# sourceMappingURL=methods-A5KGZBAM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/visitor-cookie/dist/methods-A5KGZBAM.js"],"names":[],"mappings":"AAAA,+HAAmE,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,qPAAiI","file":"/home/emems/.t3/worktrees/bitsnap-react/visitor-cookie/dist/methods-A5KGZBAM.js"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A as e,w as a,x as b,y as c,z as d}from"./chunk-JXCHRSPW.mjs";import"./chunk-DDY7IBMG.mjs";import"./chunk-KOVKUJAW.mjs";import"./chunk-YXFJG4MF.mjs";import"./chunk-T2OUOO4X.mjs";import"./chunk-43IIYJ6J.mjs";import"./chunk-RLEC25JI.mjs";import"./chunk-ADYVTMGH.mjs";import"./chunk-U6FLIRIV.mjs";export{a as Bitsnap,c as createCheckout,b as createPaymentURL,d as getReferenceIfPossible,e as injectReferenceToRequestIfNeeded};
|
|
2
|
+
//# sourceMappingURL=methods-AOHKV7IN.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/models.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/models.js","../src/models.ts"],"names":["BitsnapModels"],"mappings":"AAAA,0XAA2B,iECAR,IAEFA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CACFA,CAAAA,CAAA,sBAAA,CAA2B,CAAA,CAAA,MAAA,CAAO,CAC7C,SAAA,CAAa,CAAA,CAAA,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CACjC,CAAC,CAAA,CAGYA,CAAAA,CAAA,cAAA,CAAmB,CAAA,CAAA,MAAA,CAAS,CAAA,CAAA,MAAA,CAAO,CAAA,CAAK,CAAA,CAAA,GAAA,CAAI,CAAC,CAAA,CAE7CA,CAAAA,CAAA,oBAAA,CAAyB,CAAA,CAAA,MAAA,CAAO,CAC3C,YAAA,CAAgB,CAAA,CAAA,MAAA,CAAO,CAAA,CACvB,cAAA,CAAkB,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AC,CAAC,CAAA,CACvD,KAAA,CAAS,CAAA,CAAA,MAAA,CAAO,CAAA,CAChB,QAAA,CAAY,CAAA,CAAA,MAAA,CAAO,CAAA,CACnB,cAAA,CAAkB,CAAA,CAAA,KAAA,CAAM,CAAG,CAAA,CAAA,MAAA,CAAO,CAAA,CAAK,CAAA,CAAA,IAAA,CAAK,CAAC,CAAC,CAAA,CAE9C,SAAA,CAAa,CAAA,CAAA,OAAA,CAAQ,CAAA,CACrB,YAAA,CAAgB,CAAA,CAAA,MAAA,CAAO,CAAA,CACvB,WAAA,CAAe,CAAA,CAAA,OAAA,CAAQ,CAAA,CACvB,SAAA,CAAa,CAAA,CAAA,OAAA,CAAQ,CAAA,CAErB,SAAA,CAAa,CAAA,CAAA,OAAA,CAAQ,CACvB,CAAC,CAAA,CAGYA,CAAAA,CAAA,yBAAA,CAA8B,CAAA,CAAA,MAAA,CAAO,CAChD,KAAA,CAAS,CAAA,CAAA,KAAA,CAAMA,CAAAA,CAAA,uBAAuB,CAAA,CACtC,UAAA,CAAc,CAAA,CAAA,MAAA,CAAO,CACvB,CAAC,CAAA,CAAA,CAAA,CApJcA,yBAAAA,GAAA,CAAA,CAAA,CAAA,CAAA,0BAAA","file":"/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/models.js","sourcesContent":[null,"import * as z from \"zod\";\n\nexport namespace BitsnapModels {\n export const BaselinkerFieldsSchema = z.object({\n storageID: z.string().optional(),\n });\n export type BaselinkerFields = z.infer<typeof BaselinkerFieldsSchema>;\n\n export const MetadataSchema = z.record(z.string(), z.any());\n\n export const ProductPricingSchema = z.object({\n regularPrice: z.number(),\n effectivePrice: z.number(),\n currency: z.string(),\n discount: z.object({\n id: z.string(),\n type: z.enum([\"FIXED\", \"PERCENTAGE\"]),\n value: z.number(),\n status: z.enum([\"ACTIVE\", \"SCHEDULED\", \"EXPIRED\", \"DISABLED\"]),\n startsAt: z.number().optional(),\n endsAt: z.number().optional(),\n }).optional(),\n referencePrice: z.object({\n amount: z.number().optional(),\n windowDays: z.literal(30),\n asOf: z.number(),\n basis: z.literal(\"observed-history\"),\n historyAvailable: z.boolean(),\n }),\n priceVersion: z.string(),\n nextPriceChangeAt: z.number().optional(),\n });\n export type ProductPricing = z.infer<typeof ProductPricingSchema>;\n\n export const VariantSchema = z.object({\n id: z.string(),\n name: z.string(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n images: z.array(z.string()),\n availableQuantity: z.number().optional(),\n isDeliverable: z.boolean().optional(),\n estimatedDeliveryAt: z.number().optional(),\n pricing: ProductPricingSchema.optional(),\n });\n export type Variant = z.infer<typeof VariantSchema>;\n\n export const AdditionalSchema = z.object({\n sku: z.string().optional(),\n baselinkerFields: BaselinkerFieldsSchema.optional(),\n isPresale: z.boolean().optional(),\n });\n export type Additional = z.infer<typeof AdditionalSchema>;\n\n export const ItemSchema = z.object({\n id: z.string(),\n ownerID: z.string().optional(),\n name: z.string(),\n description: z.union([z.string(), z.null()]).optional(),\n createdAt: z.number().optional(),\n updatedAt: z.number().optional(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n image_url: z.string(),\n images: z.array(z.string()),\n isDeliverable: z.boolean().optional(),\n availableQuantity: z.number().optional(),\n additional: AdditionalSchema.optional(),\n variants: z.array(VariantSchema).optional(),\n estimatedDeliveryAt: z.number().optional(),\n pricing: ProductPricingSchema.optional(),\n });\n export type Item = z.infer<typeof ItemSchema>;\n\n export const DataSchema = z.object({\n success: z.boolean(),\n result: z.array(ItemSchema),\n totalCount: z.number(),\n });\n export type Data = z.infer<typeof DataSchema>;\n\n export const ProductsResultResultSchema = z.object({\n data: DataSchema,\n });\n export type ProductsResultResult = z.infer<typeof ProductsResultResultSchema>;\n\n export const ProductsResultElementSchema = z.array(\n z.object({\n result: ProductsResultResultSchema,\n }),\n );\n export type ProductsResultElement = z.infer<\n typeof ProductsResultElementSchema\n >;\n\n export const ProductResultSchema = z.array(\n z.object({\n result: z.object({\n data: z.object({\n success: z.boolean(),\n message: z.string().optional(),\n result: ItemSchema.optional(),\n }),\n }),\n }),\n );\n\n export const PublicListProductImageSchema = z.object({\n url: z.string(),\n thumbnailUrl: z.union([z.string(), z.null()]),\n });\n export type PublicListProductImage = z.infer<\n typeof PublicListProductImageSchema\n >;\n\n /**\n * One card of the public product catalog\n * (`GET /api/integrations/{projectID}/public-commerce/product-list`).\n * `price` and `compareAtPrice` are in minor units (grosze, cents), like the\n * prices of the cart.\n */\n export const PublicListProductSchema = z.object({\n id: z.string(),\n /**\n * ID the cart should add: the variant ID for single-variant products.\n * Older backends omit it; use `cartItemId ?? id`.\n */\n cartItemId: z.string().optional(),\n uniqueSlug: z.string(),\n name: z.string(),\n shortDescription: z.union([z.string(), z.null()]),\n image: z.union([PublicListProductImageSchema, z.null()]),\n price: z.number(),\n currency: z.string(),\n compareAtPrice: z.union([z.number(), z.null()]),\n /** `true` when the variants have different prices: show \"from {price}\". */\n priceFrom: z.boolean(),\n variantCount: z.number(),\n isRecurring: z.boolean(),\n available: z.boolean(),\n /** `true` when the product can be added to the cart straight from the list. */\n addToCart: z.boolean(),\n });\n export type PublicListProduct = z.infer<typeof PublicListProductSchema>;\n\n export const ProductListResponseSchema = z.object({\n items: z.array(PublicListProductSchema),\n totalCount: z.number(),\n });\n export type ProductListResponse = z.infer<typeof ProductListResponseSchema>;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/visitor-cookie/dist/models.js","../src/models.ts"],"names":["BitsnapModels"],"mappings":"AAAA,0XAA2B,iECAR,IAEFA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CACFA,CAAAA,CAAA,sBAAA,CAA2B,CAAA,CAAA,MAAA,CAAO,CAC7C,SAAA,CAAa,CAAA,CAAA,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CACjC,CAAC,CAAA,CAGYA,CAAAA,CAAA,cAAA,CAAmB,CAAA,CAAA,MAAA,CAAS,CAAA,CAAA,MAAA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AAG,CAAA,CAAA,MAAA,CAAO,CAAA,CAAK,CAAA,CAAA,IAAA,CAAK,CAAC,CAAC,CAAA,CAChD,KAAA,CAAS,CAAA,CAAA,KAAA,CAAM,CAACA,CAAAA,CAAA,4BAAA,CAAgC,CAAA,CAAA,IAAA,CAAK,CAAC,CAAC,CAAA,CACvD,KAAA,CAAS,CAAA,CAAA,MAAA,CAAO,CAAA,CAChB,QAAA,CAAY,CAAA,CAAA,MAAA,CAAO,CAAA,CACnB,cAAA,CAAkB,CAAA,CAAA,KAAA,CAAM,CAAG,CAAA,CAAA,MAAA,CAAO,CAAA,CAAK,CAAA,CAAA,IAAA,CAAK,CAAC,CAAC,CAAA,CAE9C,SAAA,CAAa,CAAA,CAAA,OAAA,CAAQ,CAAA,CACrB,YAAA,CAAgB,CAAA,CAAA,MAAA,CAAO,CAAA,CACvB,WAAA,CAAe,CAAA,CAAA,OAAA,CAAQ,CAAA,CACvB,SAAA,CAAa,CAAA,CAAA,OAAA,CAAQ,CAAA,CAErB,SAAA,CAAa,CAAA,CAAA,OAAA,CAAQ,CACvB,CAAC,CAAA,CAGYA,CAAAA,CAAA,yBAAA,CAA8B,CAAA,CAAA,MAAA,CAAO,CAChD,KAAA,CAAS,CAAA,CAAA,KAAA,CAAMA,CAAAA,CAAA,uBAAuB,CAAA,CACtC,UAAA,CAAc,CAAA,CAAA,MAAA,CAAO,CACvB,CAAC,CAAA,CAAA,CAAA,CApJcA,yBAAAA,GAAA,CAAA,CAAA,CAAA,CAAA,0BAAA","file":"/home/emems/.t3/worktrees/bitsnap-react/visitor-cookie/dist/models.js","sourcesContent":[null,"import * as z from \"zod\";\n\nexport namespace BitsnapModels {\n export const BaselinkerFieldsSchema = z.object({\n storageID: z.string().optional(),\n });\n export type BaselinkerFields = z.infer<typeof BaselinkerFieldsSchema>;\n\n export const MetadataSchema = z.record(z.string(), z.any());\n\n export const ProductPricingSchema = z.object({\n regularPrice: z.number(),\n effectivePrice: z.number(),\n currency: z.string(),\n discount: z.object({\n id: z.string(),\n type: z.enum([\"FIXED\", \"PERCENTAGE\"]),\n value: z.number(),\n status: z.enum([\"ACTIVE\", \"SCHEDULED\", \"EXPIRED\", \"DISABLED\"]),\n startsAt: z.number().optional(),\n endsAt: z.number().optional(),\n }).optional(),\n referencePrice: z.object({\n amount: z.number().optional(),\n windowDays: z.literal(30),\n asOf: z.number(),\n basis: z.literal(\"observed-history\"),\n historyAvailable: z.boolean(),\n }),\n priceVersion: z.string(),\n nextPriceChangeAt: z.number().optional(),\n });\n export type ProductPricing = z.infer<typeof ProductPricingSchema>;\n\n export const VariantSchema = z.object({\n id: z.string(),\n name: z.string(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n images: z.array(z.string()),\n availableQuantity: z.number().optional(),\n isDeliverable: z.boolean().optional(),\n estimatedDeliveryAt: z.number().optional(),\n pricing: ProductPricingSchema.optional(),\n });\n export type Variant = z.infer<typeof VariantSchema>;\n\n export const AdditionalSchema = z.object({\n sku: z.string().optional(),\n baselinkerFields: BaselinkerFieldsSchema.optional(),\n isPresale: z.boolean().optional(),\n });\n export type Additional = z.infer<typeof AdditionalSchema>;\n\n export const ItemSchema = z.object({\n id: z.string(),\n ownerID: z.string().optional(),\n name: z.string(),\n description: z.union([z.string(), z.null()]).optional(),\n createdAt: z.number().optional(),\n updatedAt: z.number().optional(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n image_url: z.string(),\n images: z.array(z.string()),\n isDeliverable: z.boolean().optional(),\n availableQuantity: z.number().optional(),\n additional: AdditionalSchema.optional(),\n variants: z.array(VariantSchema).optional(),\n estimatedDeliveryAt: z.number().optional(),\n pricing: ProductPricingSchema.optional(),\n });\n export type Item = z.infer<typeof ItemSchema>;\n\n export const DataSchema = z.object({\n success: z.boolean(),\n result: z.array(ItemSchema),\n totalCount: z.number(),\n });\n export type Data = z.infer<typeof DataSchema>;\n\n export const ProductsResultResultSchema = z.object({\n data: DataSchema,\n });\n export type ProductsResultResult = z.infer<typeof ProductsResultResultSchema>;\n\n export const ProductsResultElementSchema = z.array(\n z.object({\n result: ProductsResultResultSchema,\n }),\n );\n export type ProductsResultElement = z.infer<\n typeof ProductsResultElementSchema\n >;\n\n export const ProductResultSchema = z.array(\n z.object({\n result: z.object({\n data: z.object({\n success: z.boolean(),\n message: z.string().optional(),\n result: ItemSchema.optional(),\n }),\n }),\n }),\n );\n\n export const PublicListProductImageSchema = z.object({\n url: z.string(),\n thumbnailUrl: z.union([z.string(), z.null()]),\n });\n export type PublicListProductImage = z.infer<\n typeof PublicListProductImageSchema\n >;\n\n /**\n * One card of the public product catalog\n * (`GET /api/integrations/{projectID}/public-commerce/product-list`).\n * `price` and `compareAtPrice` are in minor units (grosze, cents), like the\n * prices of the cart.\n */\n export const PublicListProductSchema = z.object({\n id: z.string(),\n /**\n * ID the cart should add: the variant ID for single-variant products.\n * Older backends omit it; use `cartItemId ?? id`.\n */\n cartItemId: z.string().optional(),\n uniqueSlug: z.string(),\n name: z.string(),\n shortDescription: z.union([z.string(), z.null()]),\n image: z.union([PublicListProductImageSchema, z.null()]),\n price: z.number(),\n currency: z.string(),\n compareAtPrice: z.union([z.number(), z.null()]),\n /** `true` when the variants have different prices: show \"from {price}\". */\n priceFrom: z.boolean(),\n variantCount: z.number(),\n isRecurring: z.boolean(),\n available: z.boolean(),\n /** `true` when the product can be added to the cart straight from the list. */\n addToCart: z.boolean(),\n });\n export type PublicListProduct = z.infer<typeof PublicListProductSchema>;\n\n export const ProductListResponseSchema = z.object({\n items: z.array(PublicListProductSchema),\n totalCount: z.number(),\n });\n export type ProductListResponse = z.infer<typeof ProductListResponseSchema>;\n}\n"]}
|
package/dist/returns.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { A as AnalyticsOption } from './instrument-CmxK7S4T.mjs';
|
|
3
4
|
import { a as ReturnsTexts, R as ReturnsAppearance, h as ReturnsTextKey, i as ResolvedReturnsAppearance, f as ReturnsSlotName, e as ReturnsSlotAppearance } from './texts-tQtAGJCT.mjs';
|
|
4
5
|
export { b as RETURNS_SLOT_NAMES, c as ReturnsAppearanceElements, d as ReturnsAppearanceTokens, g as ReturnsTheme } from './texts-tQtAGJCT.mjs';
|
|
5
6
|
import { Timestamp } from '@bufbuild/protobuf/wkt';
|
|
@@ -96,6 +97,13 @@ type ReturnsProviderProps = {
|
|
|
96
97
|
panelAccessToken?: string;
|
|
97
98
|
/** Class of the themed root element. */
|
|
98
99
|
className?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Usage statistics for your Bitsnap dashboard (return started, return
|
|
102
|
+
* submitted). On by default; `false` turns it off. An object lets you
|
|
103
|
+
* forward every event: `{ onEvent }`. Inside `<Panel>` the panel's setting
|
|
104
|
+
* applies unless this is given. Nothing is stored on the visitor's device.
|
|
105
|
+
*/
|
|
106
|
+
analytics?: AnalyticsOption;
|
|
99
107
|
children?: ReactNode;
|
|
100
108
|
};
|
|
101
109
|
/**
|
|
@@ -110,7 +118,7 @@ type ReturnsProviderProps = {
|
|
|
110
118
|
* </ReturnsProvider>
|
|
111
119
|
* ```
|
|
112
120
|
*/
|
|
113
|
-
declare function ReturnsProvider({ projectID, host, environment, appearance, texts, theme, locale, panelAccessToken, className, children, }: ReturnsProviderProps): react_jsx_runtime.JSX.Element;
|
|
121
|
+
declare function ReturnsProvider({ projectID, host, environment, appearance, texts, theme, locale, panelAccessToken, className, analytics, children, }: ReturnsProviderProps): react_jsx_runtime.JSX.Element;
|
|
114
122
|
/** Name of {@link ReturnsProvider} in `bitsnap-react` 1.6.0. */
|
|
115
123
|
declare const BitsnapReturnsProvider: typeof ReturnsProvider;
|
|
116
124
|
type BitsnapReturnsProviderProps = ReturnsProviderProps;
|
package/dist/returns.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { A as AnalyticsOption } from './instrument-CmxK7S4T.js';
|
|
3
4
|
import { a as ReturnsTexts, R as ReturnsAppearance, h as ReturnsTextKey, i as ResolvedReturnsAppearance, f as ReturnsSlotName, e as ReturnsSlotAppearance } from './texts-CIEFbJTN.js';
|
|
4
5
|
export { b as RETURNS_SLOT_NAMES, c as ReturnsAppearanceElements, d as ReturnsAppearanceTokens, g as ReturnsTheme } from './texts-CIEFbJTN.js';
|
|
5
6
|
import { Timestamp } from '@bufbuild/protobuf/wkt';
|
|
@@ -96,6 +97,13 @@ type ReturnsProviderProps = {
|
|
|
96
97
|
panelAccessToken?: string;
|
|
97
98
|
/** Class of the themed root element. */
|
|
98
99
|
className?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Usage statistics for your Bitsnap dashboard (return started, return
|
|
102
|
+
* submitted). On by default; `false` turns it off. An object lets you
|
|
103
|
+
* forward every event: `{ onEvent }`. Inside `<Panel>` the panel's setting
|
|
104
|
+
* applies unless this is given. Nothing is stored on the visitor's device.
|
|
105
|
+
*/
|
|
106
|
+
analytics?: AnalyticsOption;
|
|
99
107
|
children?: ReactNode;
|
|
100
108
|
};
|
|
101
109
|
/**
|
|
@@ -110,7 +118,7 @@ type ReturnsProviderProps = {
|
|
|
110
118
|
* </ReturnsProvider>
|
|
111
119
|
* ```
|
|
112
120
|
*/
|
|
113
|
-
declare function ReturnsProvider({ projectID, host, environment, appearance, texts, theme, locale, panelAccessToken, className, children, }: ReturnsProviderProps): react_jsx_runtime.JSX.Element;
|
|
121
|
+
declare function ReturnsProvider({ projectID, host, environment, appearance, texts, theme, locale, panelAccessToken, className, analytics, children, }: ReturnsProviderProps): react_jsx_runtime.JSX.Element;
|
|
114
122
|
/** Name of {@link ReturnsProvider} in `bitsnap-react` 1.6.0. */
|
|
115
123
|
declare const BitsnapReturnsProvider: typeof ReturnsProvider;
|
|
116
124
|
type BitsnapReturnsProviderProps = ReturnsProviderProps;
|
package/dist/returns.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkF46RJVWCjs = require('./chunk-F46RJVWC.js');var _chunkRVILRUW3js = require('./chunk-RVILRUW3.js');require('./chunk-KOYBZORL.js');var _chunkAJNULBC3js = require('./chunk-AJNULBC3.js');require('./chunk-VIII45AC.js');require('./chunk-B32ACCW2.js');require('./chunk-XIHGWNTS.js');require('./chunk-JSDGZ4NY.js');exports.BitsnapReturns = _chunkF46RJVWCjs.a; exports.BitsnapReturnsProvider = _chunkRVILRUW3js.l; exports.Environment = _chunkAJNULBC3js.h; exports.RETURNS_SLOT_NAMES = _chunkRVILRUW3js.c; exports.ReturnsAppearanceProvider = _chunkRVILRUW3js.d; exports.ReturnsCodeStep = _chunkRVILRUW3js.u; exports.ReturnsConfirmation = _chunkRVILRUW3js.x; exports.ReturnsEmailStep = _chunkRVILRUW3js.t; exports.ReturnsMyReturnDetail = _chunkRVILRUW3js.A; exports.ReturnsMyReturnsList = _chunkRVILRUW3js.z; exports.ReturnsOrderDetail = _chunkRVILRUW3js.w; exports.ReturnsOrderList = _chunkRVILRUW3js.v; exports.ReturnsProvider = _chunkRVILRUW3js.k; exports.ReturnsResult = _chunkRVILRUW3js.y; exports.useCreateReturn = _chunkRVILRUW3js.p; exports.useMyReturn = _chunkRVILRUW3js.r; exports.useMyReturns = _chunkRVILRUW3js.q; exports.useReturnOrders = _chunkRVILRUW3js.n; exports.useReturnSession = _chunkRVILRUW3js.m; exports.useReturnableOrder = _chunkRVILRUW3js.o; exports.useReturnsAppearance = _chunkRVILRUW3js.e; exports.useReturnsSlot = _chunkRVILRUW3js.f; exports.useReturnsText = _chunkRVILRUW3js.i;
|
|
2
2
|
//# sourceMappingURL=returns.js.map
|
package/dist/returns.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/emems/
|
|
1
|
+
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/visitor-cookie/dist/returns.js"],"names":[],"mappings":"AAAA,+HAAuC,sDAAoL,+BAA4B,sDAAwC,+BAA4B,+BAA4B,+BAA4B,+BAA4B,kkCAA4gB","file":"/home/emems/.t3/worktrees/bitsnap-react/visitor-cookie/dist/returns.js"}
|
package/dist/returns.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as L}from"./chunk-
|
|
1
|
+
import{a as L}from"./chunk-ZPTHK4OX.mjs";import{A as C,c as t,d as r,e as s,f as n,i as p,k as u,l as R,m as o,n as y,o as a,p as i,q as m,r as l,t as x,u as d,v as P,w as f,x as S,y as c,z as T}from"./chunk-DDY7IBMG.mjs";import"./chunk-KOVKUJAW.mjs";import{h as e}from"./chunk-T2OUOO4X.mjs";import"./chunk-43IIYJ6J.mjs";import"./chunk-RLEC25JI.mjs";import"./chunk-ADYVTMGH.mjs";import"./chunk-U6FLIRIV.mjs";export{L as BitsnapReturns,R as BitsnapReturnsProvider,e as Environment,t as RETURNS_SLOT_NAMES,r as ReturnsAppearanceProvider,d as ReturnsCodeStep,S as ReturnsConfirmation,x as ReturnsEmailStep,C as ReturnsMyReturnDetail,T as ReturnsMyReturnsList,f as ReturnsOrderDetail,P as ReturnsOrderList,u as ReturnsProvider,c as ReturnsResult,i as useCreateReturn,l as useMyReturn,m as useMyReturns,y as useReturnOrders,o as useReturnSession,a as useReturnableOrder,s as useReturnsAppearance,n as useReturnsSlot,p as useReturnsText};
|
|
2
2
|
//# sourceMappingURL=returns.mjs.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { A as AnalyticsOption } from './instrument-CmxK7S4T.mjs';
|
|
1
2
|
import { R as ReturnsAppearance, a as ReturnsTexts } from './texts-tQtAGJCT.mjs';
|
|
2
3
|
|
|
3
4
|
interface GetThemeOutput {
|
|
@@ -31,10 +32,22 @@ interface PanelProps {
|
|
|
31
32
|
returnsAppearance?: ReturnsAppearance;
|
|
32
33
|
/** Text overrides of the Returns screen. */
|
|
33
34
|
returnsTexts?: Partial<ReturnsTexts>;
|
|
35
|
+
/**
|
|
36
|
+
* Usage statistics for your Bitsnap dashboard (panel logins, orders viewed, downloads). On by default;
|
|
37
|
+
* `false` turns it off. An object lets you forward every event:
|
|
38
|
+
* `{ onEvent }`. Nothing is stored on the visitor's device.
|
|
39
|
+
*/
|
|
40
|
+
analytics?: AnalyticsOption;
|
|
34
41
|
}
|
|
35
42
|
interface PanelLoginProps {
|
|
36
43
|
projectID: string;
|
|
37
44
|
theme?: GetThemeOutput;
|
|
45
|
+
/**
|
|
46
|
+
* Usage statistics for your Bitsnap dashboard (panel logins). On by default;
|
|
47
|
+
* `false` turns it off. An object lets you forward every event:
|
|
48
|
+
* `{ onEvent }`. Nothing is stored on the visitor's device.
|
|
49
|
+
*/
|
|
50
|
+
analytics?: AnalyticsOption;
|
|
38
51
|
}
|
|
39
52
|
|
|
40
53
|
export type { GetThemeOutput as G, PanelProps as P, PanelLoginProps as a, PanelScreen as b, PanelSearchParamsType as c };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { A as AnalyticsOption } from './instrument-CmxK7S4T.js';
|
|
1
2
|
import { R as ReturnsAppearance, a as ReturnsTexts } from './texts-CIEFbJTN.js';
|
|
2
3
|
|
|
3
4
|
interface GetThemeOutput {
|
|
@@ -31,10 +32,22 @@ interface PanelProps {
|
|
|
31
32
|
returnsAppearance?: ReturnsAppearance;
|
|
32
33
|
/** Text overrides of the Returns screen. */
|
|
33
34
|
returnsTexts?: Partial<ReturnsTexts>;
|
|
35
|
+
/**
|
|
36
|
+
* Usage statistics for your Bitsnap dashboard (panel logins, orders viewed, downloads). On by default;
|
|
37
|
+
* `false` turns it off. An object lets you forward every event:
|
|
38
|
+
* `{ onEvent }`. Nothing is stored on the visitor's device.
|
|
39
|
+
*/
|
|
40
|
+
analytics?: AnalyticsOption;
|
|
34
41
|
}
|
|
35
42
|
interface PanelLoginProps {
|
|
36
43
|
projectID: string;
|
|
37
44
|
theme?: GetThemeOutput;
|
|
45
|
+
/**
|
|
46
|
+
* Usage statistics for your Bitsnap dashboard (panel logins). On by default;
|
|
47
|
+
* `false` turns it off. An object lets you forward every event:
|
|
48
|
+
* `{ onEvent }`. Nothing is stored on the visitor's device.
|
|
49
|
+
*/
|
|
50
|
+
analytics?: AnalyticsOption;
|
|
38
51
|
}
|
|
39
52
|
|
|
40
53
|
export type { GetThemeOutput as G, PanelProps as P, PanelLoginProps as a, PanelScreen as b, PanelSearchParamsType as c };
|
package/package.json
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bitsnap-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "This is Bitsnap React library for easy integration with any website which is using React framework",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
7
|
"type": "commonjs",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "node scripts/write-version.mjs && tsup",
|
|
10
|
+
"test:returns-ssr": "pnpm build && node --test test/returns-widget.ssr.test.cjs",
|
|
11
|
+
"test:catalog-ssr": "pnpm build && node --test test/catalog.ssr.test.cjs",
|
|
12
|
+
"test:course-ssr": "pnpm build && node --test test/course.ssr.test.cjs",
|
|
13
|
+
"build:publish": "pnpm build --env.publish",
|
|
14
|
+
"clean": "rimraf ./dist",
|
|
15
|
+
"dev": "node scripts/write-version.mjs && tsup --watch",
|
|
16
|
+
"dev:publish": "pnpm dev --env.publish",
|
|
17
|
+
"test": "tsup src/components/checkout/appearance.test.ts src/components/checkout/texts.test.ts src/lib/appearance-core.test.ts src/lib/texts.test.ts src/components/returns/appearance.test.ts src/components/returns/texts.test.ts src/components/returns/errors.test.ts src/components/returns/money.test.ts src/components/returns/session-storage.test.ts src/components/returns/state-machine.test.ts src/components/returns/selection.test.ts src/components/returns/legacy.test.ts src/panel/returns-appearance.test.ts src/components/products/appearance.test.ts src/components/products/texts.test.ts src/components/products/format.test.ts src/components/products/fetch.test.ts src/components/products/useProducts.test.ts src/components/products/cart-target.test.ts src/components/checkout/cart-items.test.ts src/course/logic.test.ts src/course/accent.test.ts src/course/texts.test.ts src/course/datasource.test.ts src/course/sanitize.test.ts src/course/VideoPlayer.test.tsx src/course/PanelCourse.test.tsx src/consent/core/cookie.test.ts src/consent/core/texts.test.ts src/consent/core/activate.test.ts src/consent/core/gcm.test.ts src/consent/core/contrast.test.ts src/consent/core/controller.test.ts src/consent/embed.test.ts src/consent/react.test.tsx src/analytics/core.test.ts src/analytics/embed.test.ts src/analytics/instrument.test.tsx src/analytics/page-views.test.tsx src/analytics/visitor.test.ts src/components/checkout/visitor-header.test.ts src/components/products/impressions.test.ts src/components/products/ProductList.analytics.test.tsx src/components/checkout/cart-analytics.test.tsx src/components/checkout/apple-pay-analytics.test.tsx src/components/notifications/notifications-analytics.test.tsx src/components/returns/returns-analytics.test.tsx src/panel/panel-analytics.test.tsx src/course/course-analytics.test.tsx --format esm --out-dir .test-dist --no-config --external jsdom --silent && node --test --test-force-exit \".test-dist/**/*.test.mjs\"",
|
|
18
|
+
"test:types": "tsc -p test/consumer/tsconfig.json",
|
|
19
|
+
"test:package": "node test/consumer/verify-package.mjs"
|
|
20
|
+
},
|
|
8
21
|
"repository": {
|
|
9
22
|
"type": "git",
|
|
10
23
|
"url": "git+https://github.com/emmems/bitsnap-react.git"
|
|
11
24
|
},
|
|
12
|
-
"keywords": [
|
|
13
|
-
"bitsnap",
|
|
14
|
-
"checkout",
|
|
15
|
-
"shop",
|
|
16
|
-
"ecommerce"
|
|
17
|
-
],
|
|
25
|
+
"keywords": ["bitsnap", "checkout", "shop", "ecommerce"],
|
|
18
26
|
"author": "Piotr Michalik",
|
|
19
27
|
"license": "SEE LICENSE IN LICENSE file",
|
|
20
28
|
"bugs": {
|
|
21
29
|
"url": "https://github.com/emmems/bitsnap-react/issues"
|
|
22
30
|
},
|
|
23
|
-
"sideEffects": [
|
|
24
|
-
|
|
25
|
-
],
|
|
26
|
-
"files": [
|
|
27
|
-
"dist"
|
|
28
|
-
],
|
|
31
|
+
"sideEffects": ["*.css"],
|
|
32
|
+
"files": ["dist"],
|
|
29
33
|
"types": "./dist/index.d.ts",
|
|
30
34
|
"homepage": "https://github.com/emmems/bitsnap-react#readme",
|
|
31
35
|
"devDependencies": {
|
|
@@ -164,41 +168,38 @@
|
|
|
164
168
|
"default": "./dist/course.js"
|
|
165
169
|
}
|
|
166
170
|
},
|
|
171
|
+
"./consent": {
|
|
172
|
+
"import": {
|
|
173
|
+
"types": "./dist/consent.d.mts",
|
|
174
|
+
"default": "./dist/consent.mjs"
|
|
175
|
+
},
|
|
176
|
+
"require": {
|
|
177
|
+
"types": "./dist/consent.d.ts",
|
|
178
|
+
"default": "./dist/consent.js"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"./analytics": {
|
|
182
|
+
"import": {
|
|
183
|
+
"types": "./dist/analytics.d.mts",
|
|
184
|
+
"default": "./dist/analytics.mjs"
|
|
185
|
+
},
|
|
186
|
+
"require": {
|
|
187
|
+
"types": "./dist/analytics.d.ts",
|
|
188
|
+
"default": "./dist/analytics.js"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
167
191
|
"./package.json": "./package.json"
|
|
168
192
|
},
|
|
169
193
|
"typesVersions": {
|
|
170
194
|
"*": {
|
|
171
|
-
"models": [
|
|
172
|
-
|
|
173
|
-
],
|
|
174
|
-
"
|
|
175
|
-
|
|
176
|
-
],
|
|
177
|
-
"
|
|
178
|
-
|
|
179
|
-
],
|
|
180
|
-
"returns": [
|
|
181
|
-
"./dist/returns.d.ts"
|
|
182
|
-
],
|
|
183
|
-
"catalog": [
|
|
184
|
-
"./dist/catalog.d.ts"
|
|
185
|
-
],
|
|
186
|
-
"course": [
|
|
187
|
-
"./dist/course.d.ts"
|
|
188
|
-
]
|
|
195
|
+
"models": ["./dist/models.d.ts"],
|
|
196
|
+
"internal": ["./dist/internal.d.ts"],
|
|
197
|
+
"errors": ["./dist/errors.d.ts"],
|
|
198
|
+
"returns": ["./dist/returns.d.ts"],
|
|
199
|
+
"catalog": ["./dist/catalog.d.ts"],
|
|
200
|
+
"course": ["./dist/course.d.ts"],
|
|
201
|
+
"consent": ["./dist/consent.d.ts"],
|
|
202
|
+
"analytics": ["./dist/analytics.d.ts"]
|
|
189
203
|
}
|
|
190
|
-
},
|
|
191
|
-
"scripts": {
|
|
192
|
-
"build": "tsup",
|
|
193
|
-
"test:returns-ssr": "pnpm build && node --test test/returns-widget.ssr.test.cjs",
|
|
194
|
-
"test:catalog-ssr": "pnpm build && node --test test/catalog.ssr.test.cjs",
|
|
195
|
-
"test:course-ssr": "pnpm build && node --test test/course.ssr.test.cjs",
|
|
196
|
-
"build:publish": "pnpm build --env.publish",
|
|
197
|
-
"clean": "rimraf ./dist",
|
|
198
|
-
"dev": "tsup --watch",
|
|
199
|
-
"dev:publish": "pnpm dev --env.publish",
|
|
200
|
-
"test": "tsup src/components/checkout/appearance.test.ts src/components/checkout/texts.test.ts src/lib/appearance-core.test.ts src/lib/texts.test.ts src/components/returns/appearance.test.ts src/components/returns/texts.test.ts src/components/returns/errors.test.ts src/components/returns/money.test.ts src/components/returns/session-storage.test.ts src/components/returns/state-machine.test.ts src/components/returns/selection.test.ts src/components/returns/legacy.test.ts src/panel/returns-appearance.test.ts src/components/products/appearance.test.ts src/components/products/texts.test.ts src/components/products/format.test.ts src/components/products/fetch.test.ts src/components/products/useProducts.test.ts src/components/products/cart-target.test.ts src/components/checkout/cart-items.test.ts src/course/logic.test.ts src/course/accent.test.ts src/course/texts.test.ts src/course/datasource.test.ts src/course/sanitize.test.ts src/course/VideoPlayer.test.tsx src/course/PanelCourse.test.tsx --format esm --out-dir .test-dist --no-config --external jsdom --silent && node --test \".test-dist/**/*.test.mjs\"",
|
|
201
|
-
"test:types": "tsc -p test/consumer/tsconfig.json",
|
|
202
|
-
"test:package": "node test/consumer/verify-package.mjs"
|
|
203
204
|
}
|
|
204
|
-
}
|
|
205
|
+
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{B as c,C as d,D as e,E as f,F as g,G as h,H as i}from"./chunk-HB6KQT26.mjs";import"./chunk-45AP7UZE.mjs";import"./chunk-KOVKUJAW.mjs";import"./chunk-C6Z7LOHB.mjs";import"./chunk-WSM4OM72.mjs";import{i as a,j as b}from"./chunk-OUYRKNZJ.mjs";import"./chunk-U6FLIRIV.mjs";export{c as MARKETING_AGREEMENT_ID,d as bitsnapProjectID,h as default,i as getCheckoutMethods,b as getLocale,f as getProjectID,a as setLocale,e as setProjectID,g as useCartProvider};
|
|
2
|
-
//# sourceMappingURL=CartProvider-5KAG5QGA.mjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7XTDFTQUjs = require('./chunk-7XTDFTQU.js');require('./chunk-LWK4E5G5.js');require('./chunk-KOYBZORL.js');require('./chunk-XRNTUSBH.js');require('./chunk-WRCXZMKK.js');var _chunkZ2BKIX6Fjs = require('./chunk-Z2BKIX6F.js');require('./chunk-JSDGZ4NY.js');exports.MARKETING_AGREEMENT_ID = _chunk7XTDFTQUjs.B; exports.bitsnapProjectID = _chunk7XTDFTQUjs.C; exports.default = _chunk7XTDFTQUjs.G; exports.getCheckoutMethods = _chunk7XTDFTQUjs.H; exports.getLocale = _chunkZ2BKIX6Fjs.j; exports.getProjectID = _chunk7XTDFTQUjs.E; exports.setLocale = _chunkZ2BKIX6Fjs.i; exports.setProjectID = _chunk7XTDFTQUjs.D; exports.useCartProvider = _chunk7XTDFTQUjs.F;
|
|
2
|
-
//# sourceMappingURL=CartProvider-7GJXW2IP.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/CartProvider-7GJXW2IP.js"],"names":[],"mappings":"AAAA,+HAAiF,+BAA4B,+BAA4B,+BAA4B,+BAA4B,sDAA+C,+BAA4B,8YAAsL","file":"/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/CartProvider-7GJXW2IP.js"}
|
package/dist/chunk-45AP7UZE.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as He,b as We}from"./chunk-KOVKUJAW.mjs";import{i as Re,j as _,m as je,n as Ue,q as N,r as be,t as Qe,u as Ve,v as Ye}from"./chunk-WSM4OM72.mjs";import{a as i,f as Ze,j as $e}from"./chunk-OUYRKNZJ.mjs";var gr=["root","header","title","description","backButton","stepIndicator","error","emptyState","skeleton","emailForm","emailInput","codeForm","codeInput","resendButton","logoutButton","orderList","orderCard","orderReference","orderDate","orderTotal","pagination","lineList","line","lineName","linePrice","lineQuantityControl","quantityButton","quantityInput","lineIneligibleReason","noteInput","summary","submitButton","secondaryButton","successState","returnReference","returnInstructions","returnList","returnCard","statusBadge","history","historyEntry"],Pt={fontFamily:"--bitsnap-returns-font-family",fontSize:"--bitsnap-returns-font-size",background:"--bitsnap-returns-background",surface:"--bitsnap-returns-surface",foreground:"--bitsnap-returns-foreground",mutedForeground:"--bitsnap-returns-muted-foreground",border:"--bitsnap-returns-border",buttonBackground:"--bitsnap-returns-button-background",buttonForeground:"--bitsnap-returns-button-foreground",buttonHoverBackground:"--bitsnap-returns-button-hover-background",hoverSurface:"--bitsnap-returns-hover-surface",focusRing:"--bitsnap-returns-focus-ring",error:"--bitsnap-returns-error",success:"--bitsnap-returns-success",warning:"--bitsnap-returns-warning",badgeBackground:"--bitsnap-returns-badge-background",badgeForeground:"--bitsnap-returns-badge-foreground",inputBackground:"--bitsnap-returns-input-background",radius:"--bitsnap-returns-radius"},Lt={light:{background:"#ffffff",surface:"#f9fafb",foreground:"#18181b",mutedForeground:"#71717a",border:"#e4e4e7",buttonBackground:"#18181b",buttonForeground:"#fafafa",buttonHoverBackground:"#000000",hoverSurface:"#f4f4f5",focusRing:"#71717a",error:"#dc2626",success:"#16a34a",warning:"#d97706",badgeBackground:"#f4f4f5",badgeForeground:"#3f3f46",inputBackground:"#ffffff",radius:"8px"},dark:{background:"#18181b",surface:"#27272a",foreground:"#fafafa",mutedForeground:"#a1a1aa",border:"#3f3f46",buttonBackground:"#fafafa",buttonForeground:"#18181b",buttonHoverBackground:"#e4e4e7",hoverSurface:"#3f3f46",focusRing:"#a1a1aa",error:"#f87171",success:"#4ade80",warning:"#fbbf24",badgeBackground:"#3f3f46",badgeForeground:"#e4e4e7",inputBackground:"#27272a",radius:"8px"}},At=[{token:"background",variable:"--background"},{token:"foreground",variable:"--foreground"},{token:"surface",variable:"--card"},{token:"foreground",variable:"--card-foreground"},{token:"surface",variable:"--popover"},{token:"foreground",variable:"--popover-foreground"},{token:"buttonBackground",variable:"--primary"},{token:"buttonForeground",variable:"--primary-foreground"},{token:"surface",variable:"--secondary"},{token:"foreground",variable:"--secondary-foreground"},{token:"hoverSurface",variable:"--accent"},{token:"foreground",variable:"--accent-foreground"},{token:"mutedForeground",variable:"--muted-foreground"},{token:"border",variable:"--border"},{token:"border",variable:"--input"},{token:"focusRing",variable:"--ring"},{token:"error",variable:"--destructive"},{token:"radius",variable:"--radius"}];function Se(e){let r=He(e,{defaultTheme:"light",presets:Lt,variables:Pt,shadcnVariables:At});return{theme:r.theme,tokens:r.tokens,elements:r.elements,boundaryClassName:r.theme,boundaryStyle:r.boundaryStyle}}function Xe(e,r){return We(e.elements,r)}import{createContext as Bt,useContext as zt,useMemo as Dt}from"react";import{jsx as Ot}from"react/jsx-runtime";var Ge=Bt(Se());function Je({appearance:e,children:r}){let t=Dt(()=>Se(e),[e]);return Ot(Ge.Provider,{value:t,children:r})}function xe(){return zt(Ge)}function l(e){let r=xe();return Xe(r,e)??{}}function tt(e){return e==="test"||e===1?1:0}var et={title:["emailStepTitle"],email:["emailLabel"],sendCode:["emailSubmit"],code:["codeLabel"],verify:["codeSubmit"],orders:["ordersTitle"],submit:["confirmationSubmit"],note:["noteLabel"],history:["myReturnsTitle","myReturnsLink"]};function rt(e){if(e==null)return;let r={};for(let[t,n]of Object.entries(et)){let o=e[t];if(typeof o=="string")for(let u of n)r[u]=o}for(let t of Object.keys(e)){if(t in et)continue;let n=e[t];typeof n=="string"&&(r[t]=n)}return r}function nt(e,r){let t=r?.brandColor?.trim();return t==null||t===""?e:{...e,tokens:{...Qe(t),...e?.tokens}}}function ve(e,r){return typeof e=="object"&&e!=null?{pageSize:e.pageSize??20,explicitPageToken:void 0}:typeof e=="number"||r!==void 0?{pageSize:e??20,explicitPageToken:r??""}:{pageSize:20,explicitPageToken:void 0}}var Ft={en:{back:"Back",stepIndicator:"Step {current} of {total}",loading:"Loading",myReturnsLink:"My returns",emailStepTitle:"Return a product",emailStepDescription:"Enter the email address you used for the order. We will send you a verification code.",emailLabel:"Email address",emailPlaceholder:"name@example.com",emailSubmit:"Send code",codeStepTitle:"Enter the code",codeStepDescription:"We sent a verification code to {email}.",codeLabel:"Verification code",codeSubmit:"Verify",resend:"Send the code again",resendIn:"Send again in {seconds} s",logout:"Sign out",ordersTitle:"Your orders",ordersDescription:"Choose the order that contains the product to return.",ordersEmpty:"There are no orders eligible for return.",orderTitle:"Order {reference}",orderReturnableLines:"Products available to return: {count}",orderSelect:"Choose",paginationPrevious:"Previous",paginationNext:"Next",paginationInfo:"Page {page}, {total} orders",orderDetailTitle:"Order {reference}",orderDetailDescription:"Select the products and quantities to return.",quantityLabel:"Quantity to return: {name}",quantityDecrease:"Decrease quantity: {name}",quantityIncrease:"Increase quantity: {name}",quantityOfAvailable:"of {available}",lineIneligibleFallback:"This product cannot be returned.",noteLabel:"Note (optional)",notePlaceholder:"Tell us why you are returning the product",selectionContinue:"Continue",selectionEmpty:"Select at least one item to return.",previousReturnsTitle:"Earlier returns for this order",confirmationTitle:"Confirm the return",confirmationDescription:"Check the products before you submit the request.",confirmationSummary:"Products to return",confirmationQuantity:"Quantity: {quantity}",confirmationNote:"Your note",confirmationSubmit:"Submit return request",successTitle:"Return request submitted",successDescription:"We received your request and will keep you posted.",successReference:"Request number",successInstructions:"What to do next",successDone:"Back to orders",myReturnsTitle:"My returns",myReturnsDescription:"Track the status of your return requests.",myReturnsEmpty:"You have not submitted any return requests yet.",myReturnOpen:"Details",myReturnDetailTitle:"Return details",myReturnTitle:"Return {reference}",myReturnCreatedAt:"Submitted",myReturnRefund:"Refund",myReturnLines:"Products",myReturnLineQuantities:"Requested: {requested}, approved: {approved}, received: {received}",myReturnNote:"Your note",myReturnHistory:"History",statusSubmitted:"Submitted",statusApproved:"Approved",statusRejected:"Rejected",statusAwaitingReceipt:"Awaiting the package",statusReceived:"Package received",statusCompleted:"Completed",statusCancelled:"Cancelled",statusRefunded:"Refunded",statusFallback:"In progress",refundStatusNotStarted:"Not started",refundStatusPending:"Refund in progress",refundStatusSucceeded:"Refunded",refundStatusFailed:"Refund failed",refundStatusFallback:"Unknown",errorGeneric:"Something went wrong. Please try again.",errorInvalidEmail:"Enter a valid email address.",errorInvalidCode:"The code is invalid or has expired.",errorSessionExpired:"Your session has expired. Verify your email again.",errorOrderNotFound:"We could not find this order.",errorReturnNotFound:"We could not find this return request.",errorQuantityUnavailable:"The selected quantity is no longer available for return.",errorItemNotReturnable:"One of the selected products cannot be returned.",errorReturnsDisabled:"Returns are not available in this shop.",errorRateLimited:"Too many attempts. Please try again later.",errorIdempotencyConflict:"This request was already submitted with different contents. Reload and try again.",errorDeliveryFailed:"We could not send the code. Please try again.",errorRetry:"Try again"},pl:{back:"Wstecz",stepIndicator:"Krok {current} z {total}",loading:"\u0141adowanie",myReturnsLink:"Moje zwroty",emailStepTitle:"Zwr\xF3\u0107 produkt",emailStepDescription:"Podaj adres e-mail u\u017Cyty w zam\xF3wieniu. Wy\u015Blemy na niego kod weryfikacyjny.",emailLabel:"Adres e-mail",emailPlaceholder:"jan@example.com",emailSubmit:"Wy\u015Blij kod",codeStepTitle:"Wpisz kod",codeStepDescription:"Wys\u0142ali\u015Bmy kod weryfikacyjny na adres {email}.",codeLabel:"Kod weryfikacyjny",codeSubmit:"Zweryfikuj",resend:"Wy\u015Blij kod ponownie",resendIn:"Wy\u015Blij ponownie za {seconds} s",logout:"Wyloguj si\u0119",ordersTitle:"Twoje zam\xF3wienia",ordersDescription:"Wybierz zam\xF3wienie z produktem do zwrotu.",ordersEmpty:"Brak zam\xF3wie\u0144, kt\xF3re mo\u017Cna zwr\xF3ci\u0107.",orderTitle:"Zam\xF3wienie {reference}",orderReturnableLines:"Produkty do zwrotu: {count}",orderSelect:"Wybierz",paginationPrevious:"Poprzednia",paginationNext:"Nast\u0119pna",paginationInfo:"Strona {page}, zam\xF3wie\u0144: {total}",orderDetailTitle:"Zam\xF3wienie {reference}",orderDetailDescription:"Wybierz produkty i ilo\u015Bci do zwrotu.",quantityLabel:"Ilo\u015B\u0107 do zwrotu: {name}",quantityDecrease:"Zmniejsz ilo\u015B\u0107: {name}",quantityIncrease:"Zwi\u0119ksz ilo\u015B\u0107: {name}",quantityOfAvailable:"z {available}",lineIneligibleFallback:"Ten produkt nie podlega zwrotowi.",noteLabel:"Uwagi (opcjonalnie)",notePlaceholder:"Napisz, dlaczego zwracasz produkt",selectionContinue:"Dalej",selectionEmpty:"Wybierz co najmniej jedn\u0105 sztuk\u0119 do zwrotu.",previousReturnsTitle:"Wcze\u015Bniejsze zwroty tego zam\xF3wienia",confirmationTitle:"Potwierd\u017A zwrot",confirmationDescription:"Sprawd\u017A produkty przed wys\u0142aniem zg\u0142oszenia.",confirmationSummary:"Produkty do zwrotu",confirmationQuantity:"Ilo\u015B\u0107: {quantity}",confirmationNote:"Twoje uwagi",confirmationSubmit:"Wy\u015Blij zg\u0142oszenie zwrotu",successTitle:"Zg\u0142oszenie zwrotu zosta\u0142o wys\u0142ane",successDescription:"Otrzymali\u015Bmy zg\u0142oszenie i b\u0119dziemy informowa\u0107 o jego statusie.",successReference:"Numer zg\u0142oszenia",successInstructions:"Co dalej",successDone:"Wr\xF3\u0107 do zam\xF3wie\u0144",myReturnsTitle:"Moje zwroty",myReturnsDescription:"Sprawd\u017A status swoich zg\u0142osze\u0144 zwrotu.",myReturnsEmpty:"Nie masz jeszcze \u017Cadnych zg\u0142osze\u0144 zwrotu.",myReturnOpen:"Szczeg\xF3\u0142y",myReturnDetailTitle:"Szczeg\xF3\u0142y zwrotu",myReturnTitle:"Zwrot {reference}",myReturnCreatedAt:"Zg\u0142oszono",myReturnRefund:"Zwrot \u015Brodk\xF3w",myReturnLines:"Produkty",myReturnLineQuantities:"Zg\u0142oszono: {requested}, zaakceptowano: {approved}, odebrano: {received}",myReturnNote:"Twoje uwagi",myReturnHistory:"Historia",statusSubmitted:"Zg\u0142oszony",statusApproved:"Zaakceptowany",statusRejected:"Odrzucony",statusAwaitingReceipt:"Oczekiwanie na paczk\u0119",statusReceived:"Paczka odebrana",statusCompleted:"Zako\u0144czony",statusCancelled:"Anulowany",statusRefunded:"\u015Arodki zwr\xF3cone",statusFallback:"W trakcie",refundStatusNotStarted:"Nie rozpocz\u0119to",refundStatusPending:"Zwrot \u015Brodk\xF3w w toku",refundStatusSucceeded:"\u015Arodki zwr\xF3cone",refundStatusFailed:"Zwrot \u015Brodk\xF3w nie powi\xF3d\u0142 si\u0119",refundStatusFallback:"Nieznany",errorGeneric:"Co\u015B posz\u0142o nie tak. Spr\xF3buj ponownie.",errorInvalidEmail:"Podaj poprawny adres e-mail.",errorInvalidCode:"Kod jest nieprawid\u0142owy lub wygas\u0142.",errorSessionExpired:"Sesja wygas\u0142a. Zweryfikuj adres e-mail ponownie.",errorOrderNotFound:"Nie znaleziono tego zam\xF3wienia.",errorReturnNotFound:"Nie znaleziono tego zg\u0142oszenia zwrotu.",errorQuantityUnavailable:"Wybrana ilo\u015B\u0107 nie jest ju\u017C dost\u0119pna do zwrotu.",errorItemNotReturnable:"Jeden z wybranych produkt\xF3w nie podlega zwrotowi.",errorReturnsDisabled:"Zwroty nie s\u0105 dost\u0119pne w tym sklepie.",errorRateLimited:"Zbyt wiele pr\xF3b. Spr\xF3buj ponownie p\xF3\u017Aniej.",errorIdempotencyConflict:"To zg\u0142oszenie zosta\u0142o ju\u017C wys\u0142ane z inn\u0105 zawarto\u015Bci\u0105. Od\u015Bwie\u017C stron\u0119 i spr\xF3buj ponownie.",errorDeliveryFailed:"Nie uda\u0142o si\u0119 wys\u0142a\u0107 kodu. Spr\xF3buj ponownie.",errorRetry:"Spr\xF3buj ponownie"}};function Ne(e,r){return Ze(Ft,e,r)}function st(e,r){return e.replace(/\{(\w+)\}/g,(t,n)=>Object.prototype.hasOwnProperty.call(r,n)?String(r[n]):t)}var Mt={submitted:"statusSubmitted",approved:"statusApproved",rejected:"statusRejected",awaiting_receipt:"statusAwaitingReceipt",received:"statusReceived",completed:"statusCompleted",cancelled:"statusCancelled",refunded:"statusRefunded"},qt={not_started:"refundStatusNotStarted",pending:"refundStatusPending",succeeded:"refundStatusSucceeded",failed:"refundStatusFailed"};function ot(e){return Mt[e]??"statusFallback"}function at(e){return qt[e]??"refundStatusFallback"}import{createContext as Kt,useCallback as _t,useContext as it,useMemo as jt}from"react";import{jsx as Ut}from"react/jsx-runtime";var he=Kt({locale:"pl-PL",texts:Ne("pl-PL")});function ut({texts:e,locale:r,children:t}){let n=r??$e(),o=jt(()=>({locale:n,texts:Ne(n,e)}),[n,e]);return Ut(he.Provider,{value:o,children:t})}function h(){let{texts:e}=it(he);return _t((r,t)=>t==null?e[r]:st(e[r],t),[e])}function V(){return it(he).locale}import{createClient as Yt}from"@connectrpc/connect";import{createConnectQueryKey as Ht,TransportProvider as Wt}from"@connectrpc/connect-query";import{QueryClient as Zt,QueryClientContext as $t,QueryClientProvider as Xt,useQueryClient as Gt}from"@tanstack/react-query";import{createContext as Jt,useCallback as we,useContext as pt,useEffect as dt,useMemo as oe,useRef as er,useState as ae}from"react";import{timestampMs as Qt}from"@bufbuild/protobuf/wkt";var Vt="bitsnap-returns-session:";function ke(e){return`${Vt}${e}`}function ne(){try{return typeof window<"u"?window.sessionStorage:void 0}catch{return}}function lt(e,r,t=Date.now()){if(e==null)return;let n=ke(r);try{let o=e.getItem(n);if(o==null)return;let u=JSON.parse(o);if(u!=null&&typeof u=="object"&&typeof u.token=="string"&&u.token.length>0&&typeof u.expiresAt=="number"&&u.expiresAt>t){let{token:s,expiresAt:a}=u;return{token:s,expiresAt:a}}e.removeItem(n)}catch{try{e.removeItem(n)}catch{}}}function ct(e,r,t){try{e?.setItem(ke(r),JSON.stringify(t))}catch{}}function Te(e,r){try{e?.removeItem(ke(r))}catch{}}function se(e){return e==null?void 0:Qt(e)}import{jsx as Y}from"react/jsx-runtime";var mt=Jt(void 0);function T(e){let r=pt(mt);if(r==null)throw new Error(`${e} must be rendered inside <ReturnsProvider>`);return r}function Ee(){return Ht({schema:Re,cardinality:void 0})}var tr=2**31-1;function rr({projectID:e,environment:r,transport:t,panelAccessToken:n,className:o,children:u}){let s=Gt(),{boundaryClassName:a,boundaryStyle:y}=xe(),d=l("root"),[p,f]=ae({status:"hydrating"}),[m,R]=ae(),[b,E]=ae(),C=er(void 0),v=we(()=>{s.removeQueries({queryKey:Ee()})},[s]),D=we(()=>{Te(ne(),e),E(void 0),f({status:"anonymous"}),v()},[e,v]),I=we(k=>{ct(ne(),e,k),R(void 0),E(void 0),f({status:"authenticated",token:k.token,expiresAt:k.expiresAt})},[e]);dt(()=>{let k=!1,U=ne();if(n==null||n===""){let F=C.current!=null;if(C.current=void 0,F){D();return}let O=lt(U,e);f(O!=null?{status:"authenticated",token:O.token,expiresAt:O.expiresAt}:{status:"anonymous"});return}return C.current=n,Te(U,e),v(),R(void 0),f({status:"exchanging"}),Yt(Re,t).exchangePanelSession({projectId:e,accessToken:n,environment:r}).then(F=>{if(k)return;let O=se(F.expiresAt);if(F.sessionToken===""||O==null)throw new Error("EMPTY_SESSION");I({token:F.sessionToken,expiresAt:O})}).catch(F=>{k||(R(F),f({status:"anonymous"}))}),()=>{k=!0}},[n,e,r,t]),dt(()=>{if(p.status!=="authenticated"||p.expiresAt==null)return;let k=p.expiresAt-Date.now();if(k<=0){D();return}let U=setTimeout(D,Math.min(k,tr));return()=>clearTimeout(U)},[p.status,p.expiresAt,D]);let P=oe(()=>({projectID:e,environment:r,status:p.status,token:p.token,exchangeError:m,challenge:b,setChallenge:E,authenticate:I,clearSession:D}),[e,r,p.status,p.token,m,b,I,D]);return Y(mt.Provider,{value:P,children:Y("div",{"data-bitsnap-returns":"root","data-bitsnap-returns-slot":"root",className:i("bitsnap-react",a,o,d.className),style:{...y,...d.style},children:u})})}function nr({projectID:e,host:r,environment:t,appearance:n,texts:o,theme:u,locale:s,panelAccessToken:a,className:y,children:d}){let p=pt($t),[f]=ae(()=>p==null?new Zt({defaultOptions:{queries:{staleTime:5e3}}}):void 0),m=r??je(),R=oe(()=>Ue(m),[m]),b=u?.brandColor,E=oe(()=>nt(n,{brandColor:b}),[n,b]),C=oe(()=>rt(o),[o]),v=Y(Wt,{transport:R,children:Y(Je,{appearance:E,children:Y(ut,{texts:C,locale:s,children:Y(rr,{projectID:e,environment:tt(t),transport:R,panelAccessToken:a,className:y,children:d})})})});return p==null&&f!=null?Y(Xt,{client:f,children:v}):v}var Vr=nr;import{useMutation as Pe,useQuery as ie}from"@connectrpc/connect-query";import{useQueryClient as or}from"@tanstack/react-query";import{useCallback as K,useEffect as Rt,useRef as ar,useState as ir}from"react";var sr="SESSION_EXPIRED",yt={INVALID_EMAIL:"errorInvalidEmail",INVALID_OR_EXPIRED_CODE:"errorInvalidCode",SESSION_EXPIRED:"errorSessionExpired",ORDER_NOT_FOUND:"errorOrderNotFound",RETURN_NOT_FOUND:"errorReturnNotFound",QUANTITY_UNAVAILABLE:"errorQuantityUnavailable",ITEM_NOT_RETURNABLE:"errorItemNotReturnable",INVALID_RETURN_ITEMS:"errorItemNotReturnable",RETURNS_DISABLED:"errorReturnsDisabled",SUBMISSION_RATE_LIMITED:"errorRateLimited",IDEMPOTENCY_CONFLICT:"errorIdempotencyConflict",VERIFICATION_DELIVERY_FAILED:"errorDeliveryFailed"};function ft(e){if(e==null||typeof e!="object")return;let{rawMessage:r,message:t}=e;if(typeof r=="string"&&r.length>0)return r;if(typeof t=="string")return Object.keys(yt).find(n=>t.includes(n))}function Ie(e){return ft(e)===sr}function gt(e){let r=ft(e);return(r!=null?yt[r]:void 0)??"errorGeneric"}function Ce(){let e=typeof globalThis<"u"?globalThis.crypto:void 0;if(typeof e?.randomUUID=="function")return e.randomUUID();let r=new Uint8Array(16);if(typeof e?.getRandomValues=="function")e.getRandomValues(r);else for(let t=0;t<r.length;t++)r[t]=Math.floor(Math.random()*256);return Array.from(r,t=>t.toString(16).padStart(2,"0")).join("")}function $(e){return e==null?null:e instanceof Error?e:new Error(String(e))}function X(e){return e==null?void 0:gt(e)}function ue(e,r){Rt(()=>{Ie(e)&&r()},[e,r])}function bt(e){let[r,t]=ir([""]);return Rt(()=>{t([""])},[e]),{pageToken:r[r.length-1]??"",page:r.length,push:n=>t(o=>[...o,n]),pop:()=>t(n=>n.length>1?n.slice(0,-1):n)}}function le(){let e=T("useReturnSession"),r=Pe(_.returns.startReturnSession),t=Pe(_.returns.verifyReturnSession),{setChallenge:n,authenticate:o,clearSession:u}=e,s=K(async m=>{t.reset();let R=m.trim(),b=await r.mutateAsync({projectId:e.projectID,email:R,environment:e.environment});return n({challengeId:b.challengeId,email:R,resendAvailableAt:Date.now()+Math.max(0,b.resendAfterSeconds)*1e3}),b},[e.projectID,e.environment,n,r,t]),a=K(async m=>{let R=await t.mutateAsync({projectId:e.projectID,challengeId:m.challengeId,code:m.code,environment:e.environment}),b=se(R.expiresAt);if(R.sessionToken===""||b==null)throw new Error("EMPTY_SESSION");return o({token:R.sessionToken,expiresAt:b}),R},[e.projectID,e.environment,o,t]),y=K(async m=>{try{return await s(m),!0}catch{return!1}},[s]),d=K(async m=>{if(e.challenge==null)return!1;try{return await a({challengeId:e.challenge.challengeId,code:m.trim()}),!0}catch{return!1}},[e.challenge,a]),p=K(()=>e.challenge!=null?y(e.challenge.email):Promise.resolve(!1),[e.challenge,y]),f=$(r.error??t.error??e.exchangeError);return{status:e.status,isAuthenticated:e.status==="authenticated",challenge:e.challenge,isStarting:r.isPending,isVerifying:t.isPending,starting:r.isPending,verifying:t.isPending,error:f,errorKey:X(f),start:y,startSession:s,verifySession:a,verify:d,resend:p,logout:u}}function ce(e){return e.status==="hydrating"||e.status==="exchanging"}function St(e,r){let t=T("useReturnOrders"),{pageSize:n,explicitPageToken:o}=ve(e,r),u=bt(t.token),s=ie(_.returns.listReturnOrders,{projectId:t.projectID,sessionToken:t.token??"",pageSize:n,pageToken:o??u.pageToken},{enabled:t.token!=null});ue(s.error,t.clearSession);let a=s.data?.nextPageToken??"";return{orders:s.data?.orders??[],total:s.data?.total??0,data:s.data,isLoading:ce(t)||s.isLoading,isFetching:s.isFetching,error:$(s.error),errorKey:X(s.error),status:s.status,isError:s.isError,isSuccess:s.isSuccess,page:u.page,hasNext:a!=="",hasPrevious:u.page>1,next:()=>{a!==""&&u.push(a)},previous:u.pop,refetch:()=>s.refetch()}}function Le(e){let r=T("useReturnableOrder"),t=ie(_.returns.getReturnableOrder,{projectId:r.projectID,sessionToken:r.token??"",canonicalOrderId:e??""},{enabled:r.token!=null&&e!=null&&e!==""});return ue(t.error,r.clearSession),{order:t.data?.order,returnHistory:t.data?.returnHistory??[],data:t.data,isLoading:e!=null&&e!==""&&(ce(r)||t.isLoading),error:$(t.error),errorKey:X(t.error),status:t.status,isError:t.isError,isSuccess:t.isSuccess,refetch:()=>t.refetch()}}function xt(){let e=T("useCreateReturn"),r=or(),t=Pe(_.returns.createReturnRequest),n=ar(void 0),{clearSession:o}=e,u=K(async(d,p)=>{try{let f=await t.mutateAsync({projectId:e.projectID,sessionToken:e.token??"",canonicalOrderId:d.orderId,items:d.items,note:d.note??"",idempotencyKey:p});return r.invalidateQueries({queryKey:Ee()}),f}catch(f){throw Ie(f)&&o(),f}},[e.projectID,e.token,t,r,o]),s=K(async d=>{n.current??=Ce();try{let p=await u(d,n.current);return n.current=void 0,p.request}catch{return}},[u]),a=K(async d=>{if(e.token==null)throw new Error("Verify your email to continue.");return u({orderId:d.canonicalOrderID,items:d.items,note:d.note},d.idempotencyKey??Ce())},[e.token,u]),y=K((d,p)=>{a(d).then(f=>p?.onSuccess?.(f),f=>p?.onError?.($(f)))},[a]);return{submit:s,isPending:t.isPending,error:$(t.error),errorKey:X(t.error),mutateAsync:a,mutate:y,data:t.data,reset:t.reset,status:t.status,isError:t.isError,isSuccess:t.isSuccess}}function vt(e,r){let t=T("useMyReturns"),{pageSize:n,explicitPageToken:o}=ve(e,r),u=bt(t.token),s=ie(_.returns.listMyReturns,{projectId:t.projectID,sessionToken:t.token??"",pageSize:n,pageToken:o??u.pageToken},{enabled:t.token!=null});ue(s.error,t.clearSession);let a=s.data?.nextPageToken??"";return{returns:s.data?.returns??[],total:s.data?.total??0,data:s.data,isLoading:ce(t)||s.isLoading,isFetching:s.isFetching,error:$(s.error),errorKey:X(s.error),status:s.status,isError:s.isError,isSuccess:s.isSuccess,page:u.page,hasNext:a!=="",hasPrevious:u.page>1,next:()=>{a!==""&&u.push(a)},previous:u.pop,refetch:()=>s.refetch()}}function de(e){let r=T("useMyReturn"),t=ie(_.returns.getMyReturn,{projectId:r.projectID,sessionToken:r.token??"",returnId:e},{enabled:r.token!=null});return ue(t.error,r.clearSession),{request:t.data?.request,isLoading:ce(r)||t.isLoading,error:t.error,errorKey:X(t.error),refetch:()=>t.refetch()}}import{useEffect as dr,useState as Be}from"react";import*as Nt from"@radix-ui/react-label";import{jsx as ur}from"react/jsx-runtime";function te({className:e,...r}){return ur(Nt.Root,{"data-slot":"label",className:i("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...r})}import{Loader2Icon as lr}from"lucide-react";import{jsx as cr}from"react/jsx-runtime";function re({className:e,...r}){return cr(lr,{role:"status","aria-label":"Loading",className:i("size-4 animate-spin",e),...r})}import{jsx as B,jsxs as pe}from"react/jsx-runtime";var H="bg-[var(--bitsnap-returns-button-background,#18181b)] text-[color:var(--bitsnap-returns-button-foreground,#fafafa)] hover:bg-[var(--bitsnap-returns-button-hover-background,#000000)] focus-visible:ring-[color:var(--bitsnap-returns-focus-ring,#71717a)]/50",L="border border-[color:var(--bitsnap-returns-border,#e4e4e7)] bg-transparent text-[color:var(--bitsnap-returns-foreground,#18181b)] hover:bg-[var(--bitsnap-returns-hover-surface,#f4f4f5)] focus-visible:ring-[color:var(--bitsnap-returns-focus-ring,#71717a)]/50",G="bg-[var(--bitsnap-returns-input-background,#ffffff)] dark:bg-[var(--bitsnap-returns-input-background,#ffffff)] border-[color:var(--bitsnap-returns-border,#e4e4e7)] text-[color:var(--bitsnap-returns-foreground,#18181b)] placeholder:text-[color:var(--bitsnap-returns-muted-foreground,#71717a)] focus-visible:border-[color:var(--bitsnap-returns-focus-ring,#71717a)] focus-visible:ring-[color:var(--bitsnap-returns-focus-ring,#71717a)]/50";function q({title:e,description:r,onBack:t,className:n,children:o}){let u=h(),s=l("header"),a=l("title"),y=l("description"),d=l("backButton");return pe("section",{className:i("flex flex-col gap-5",n),children:[pe("div",{"data-bitsnap-returns-slot":"header",className:i("flex flex-col gap-2",s.className),style:s.style,children:[t!=null&&B(N,{type:"button",variant:"ghost",size:"sm","data-bitsnap-returns-slot":"backButton",className:i("self-start -ml-3 text-[color:var(--bitsnap-returns-muted-foreground,#71717a)] hover:bg-[var(--bitsnap-returns-hover-surface,#f4f4f5)]",d.className),style:d.style,onClick:t,children:u("back")}),B("h2",{"data-bitsnap-returns-slot":"title",className:i("text-2xl font-semibold",a.className),style:a.style,children:e}),r!=null&&B("p",{"data-bitsnap-returns-slot":"description",className:i("text-sm",y.className),style:y.style,children:r})]}),o]})}function A({errorKey:e,onRetry:r}){let t=h(),n=l("error"),o=l("secondaryButton");return pe("div",{role:"alert","data-bitsnap-returns-slot":"error",className:i("flex flex-col items-start gap-2 text-sm",n.className),style:n.style,children:[B("p",{children:t(e)}),r!=null&&B(N,{type:"button",variant:"secondary",size:"sm","data-bitsnap-returns-slot":"secondaryButton",className:i(L,o.className),style:o.style,onClick:r,children:t("errorRetry")})]})}function me({children:e}){let r=l("emptyState");return B("p",{"data-bitsnap-returns-slot":"emptyState",className:i("py-6 text-center text-sm",r.className),style:r.style,children:e})}function j({rows:e=3}){let r=h(),t=l("skeleton");return B("div",{role:"status","aria-busy":"true","aria-label":r("loading"),className:"flex flex-col gap-3",children:Array.from({length:e},(n,o)=>B(Ve,{"data-bitsnap-returns-slot":"skeleton",className:i("h-16 w-full bg-[var(--bitsnap-returns-hover-surface,#f4f4f5)]",t.className),style:t.style},o))})}function J({status:e}){let r=h(),t=l("statusBadge");return B("span",{"data-bitsnap-returns-slot":"statusBadge","data-status":e,className:i("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",t.className),style:t.style,children:r(ot(e))})}function Ae(){let e=h();return r=>e(at(r))}function ye({page:e,total:r,hasNext:t,hasPrevious:n,isFetching:o,onNext:u,onPrevious:s}){let a=h(),y=l("pagination"),d=l("secondaryButton");return!t&&!n?null:pe("nav",{"data-bitsnap-returns-slot":"pagination",className:i("flex items-center justify-between gap-3 text-sm",y.className),style:y.style,children:[B(N,{type:"button",variant:"secondary",size:"sm","data-bitsnap-returns-slot":"secondaryButton",className:i(L,d.className),style:d.style,disabled:!n||o,onClick:s,children:a("paginationPrevious")}),B("span",{"aria-live":"polite",children:a("paginationInfo",{page:e,total:r})}),B(N,{type:"button",variant:"secondary",size:"sm","data-bitsnap-returns-slot":"secondaryButton",className:i(L,d.className),style:d.style,disabled:!t||o,onClick:u,children:a("paginationNext")})]})}import{jsx as z,jsxs as W}from"react/jsx-runtime";function Bn({onSubmitted:e,className:r}){T("ReturnsEmailStep");let t=h(),n=le(),[o,u]=Be(""),s=l("emailForm"),a=l("emailInput"),y=l("submitButton");async function d(p){p.preventDefault(),!n.isStarting&&await n.start(o)&&e?.(o.trim())}return z(q,{className:r,title:t("emailStepTitle"),description:t("emailStepDescription"),children:W("form",{"data-bitsnap-returns-slot":"emailForm",className:i("flex flex-col gap-4",s.className),style:s.style,onSubmit:d,children:[W("div",{className:"flex flex-col gap-2",children:[z(te,{htmlFor:"bitsnap-returns-email",children:t("emailLabel")}),z(be,{id:"bitsnap-returns-email",type:"email",name:"email",autoComplete:"email",required:!0,value:o,placeholder:t("emailPlaceholder"),disabled:n.isStarting,"data-bitsnap-returns-slot":"emailInput",className:i(G,a.className),style:a.style,onChange:p=>u(p.target.value)})]}),n.errorKey!=null&&z(A,{errorKey:n.errorKey}),W(N,{type:"submit",disabled:n.isStarting,"data-bitsnap-returns-slot":"submitButton",className:i(H,y.className),style:y.style,children:[n.isStarting&&z(re,{}),t("emailSubmit")]})]})})}function pr(e){let[r,t]=Be();return dr(()=>{if(e==null)return;t(Date.now());let n=setInterval(()=>{let o=Date.now();t(o),o>=e&&clearInterval(n)},1e3);return()=>clearInterval(n)},[e]),e!=null&&r!=null?Math.max(0,Math.ceil((e-r)/1e3)):0}function zn({onVerified:e,onBack:r,className:t}){T("ReturnsCodeStep");let n=h(),o=le(),[u,s]=Be(""),a=pr(o.challenge?.resendAvailableAt),y=l("codeForm"),d=l("codeInput"),p=l("submitButton"),f=l("resendButton"),m=o.isVerifying||o.isStarting;async function R(b){b.preventDefault(),!m&&await o.verify(u)&&e?.()}return z(q,{className:t,onBack:r,title:n("codeStepTitle"),description:n("codeStepDescription",{email:o.challenge?.email??""}),children:W("form",{"data-bitsnap-returns-slot":"codeForm",className:i("flex flex-col gap-4",y.className),style:y.style,onSubmit:R,children:[W("div",{className:"flex flex-col gap-2",children:[z(te,{htmlFor:"bitsnap-returns-code",children:n("codeLabel")}),z(be,{id:"bitsnap-returns-code",name:"code",inputMode:"numeric",autoComplete:"one-time-code",required:!0,value:u,disabled:m,"data-bitsnap-returns-slot":"codeInput",className:i(G,d.className),style:d.style,onChange:b=>s(b.target.value)})]}),o.errorKey!=null&&z(A,{errorKey:o.errorKey}),W("div",{className:"flex flex-wrap items-center gap-3",children:[W(N,{type:"submit",disabled:m||o.challenge==null,"data-bitsnap-returns-slot":"submitButton",className:i(H,p.className),style:p.style,children:[o.isVerifying&&z(re,{}),n("codeSubmit")]}),z(N,{type:"button",variant:"secondary",disabled:m||a>0||o.challenge==null,"data-bitsnap-returns-slot":"resendButton",className:i(L,f.className),style:f.style,onClick:()=>void o.resend(),children:a>0?n("resendIn",{seconds:a}):n("resend")})]})]})})}function ht(){let e=h(),r=le(),t=l("logoutButton");return z(N,{type:"button",variant:"ghost",size:"sm","data-bitsnap-returns-slot":"logoutButton",className:i("text-[color:var(--bitsnap-returns-muted-foreground,#71717a)] hover:bg-[var(--bitsnap-returns-hover-surface,#f4f4f5)]",t.className),style:t.style,onClick:r.logout,children:e("logout")})}import{useState as De}from"react";import{timestampDate as mr}from"@bufbuild/protobuf/wkt";function Z(e,r){if(e==null)return"";let t=mr(e);try{return new Intl.DateTimeFormat(r,{dateStyle:"medium"}).format(t)}catch{return t.toISOString().slice(0,10)}}function ee(e,r,t){let n=typeof e=="bigint"?e:BigInt(Math.trunc(e));try{let o=new Intl.NumberFormat(t,{style:"currency",currency:r}),u=o.resolvedOptions().maximumFractionDigits??2;return o.format(kt(n,u))}catch{return`${kt(n,2)} ${r}`}}function kt(e,r){let t=e<BigInt(0),n=t?-e:e;if(r<=0)return`${t?"-":""}${n}`;let o=BigInt(10)**BigInt(r),u=n/o,s=(n%o).toString().padStart(r,"0");return`${t?"-":""}${u}.${s}`}function Tt(e,r){return Number.isFinite(e)?Math.min(Math.max(0,Math.trunc(e)),Math.max(0,r)):0}function ze(e){return e.eligible&&e.availableQuantity>0}function wt(e,r){return e.map(t=>({lineId:t,quantity:r[t]??0})).filter(t=>t.quantity>0)}import{Fragment as Et,jsx as c,jsxs as S}from"react/jsx-runtime";function rs({onSelectOrder:e,onOpenMyReturns:r,showLogout:t=!0,pageSize:n,className:o}){T("ReturnsOrderList");let u=h(),s=V(),a=St({pageSize:n}),y=l("orderList"),d=l("orderCard"),p=l("orderReference"),f=l("orderDate"),m=l("orderTotal"),R=l("secondaryButton");return S(q,{className:o,title:u("ordersTitle"),description:u("ordersDescription"),children:[(t||r!=null)&&S("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[r!=null?c(N,{type:"button",variant:"secondary",size:"sm","data-bitsnap-returns-slot":"secondaryButton",className:i(L,R.className),style:R.style,onClick:r,children:u("myReturnsLink")}):c("span",{}),t&&c(ht,{})]}),a.isLoading?c(j,{}):a.errorKey!=null?c(A,{errorKey:a.errorKey,onRetry:a.refetch}):a.orders.length===0?c(me,{children:u("ordersEmpty")}):S(Et,{children:[c("ul",{"data-bitsnap-returns-slot":"orderList",className:i("flex flex-col gap-3",y.className),style:y.style,children:a.orders.map(b=>S("li",{"data-bitsnap-returns-slot":"orderCard",className:i("flex flex-wrap items-center justify-between gap-3 border p-4",d.className),style:d.style,children:[S("div",{className:"flex flex-col gap-1",children:[c("span",{"data-bitsnap-returns-slot":"orderReference",className:i("font-medium",p.className),style:p.style,children:u("orderTitle",{reference:b.displayReference})}),c("span",{"data-bitsnap-returns-slot":"orderDate",className:i("text-sm",f.className),style:f.style,children:Z(b.purchasedAt,s)}),c("span",{className:"text-sm",children:u("orderReturnableLines",{count:b.returnableLineCount})})]}),S("div",{className:"flex items-center gap-4",children:[c("span",{"data-bitsnap-returns-slot":"orderTotal",className:i("font-medium",m.className),style:m.style,children:ee(b.totalMinor,b.currency,s)}),c(N,{type:"button",variant:"secondary",size:"sm","aria-label":`${u("orderSelect")}: ${u("orderTitle",{reference:b.displayReference})}`,"data-bitsnap-returns-slot":"secondaryButton",className:i(L,R.className),style:R.style,onClick:()=>e?.(b.canonicalOrderId),children:u("orderSelect")})]})]},b.canonicalOrderId))}),c(ye,{page:a.page,total:a.total,hasNext:a.hasNext,hasPrevious:a.hasPrevious,isFetching:a.isFetching,onNext:a.next,onPrevious:a.previous})]})]})}function ns({orderId:e,onContinue:r,onBack:t,initialItems:n,initialNote:o,className:u}){T("ReturnsOrderDetail");let s=h(),a=V(),{order:y,returnHistory:d,isLoading:p,errorKey:f,refetch:m}=Le(e),[R,b]=De(()=>Object.fromEntries((n??[]).map(g=>[g.lineId,g.quantity]))),[E,C]=De(o??""),[v,D]=De(!1),I=l("lineList"),P=l("line"),k=l("lineName"),U=l("linePrice"),F=l("lineQuantityControl"),O=l("quantityButton"),Oe=l("quantityInput"),Fe=l("lineIneligibleReason"),Me=l("noteInput"),qe=l("submitButton"),Ke=l("history"),_e=l("historyEntry");function fe(g,Q){D(!1),b(M=>({...M,[g.lineId]:Tt(Q,g.availableQuantity)}))}function It(g){if(g.preventDefault(),y==null)return;let Q=wt(y.lines.filter(ze).map(M=>M.lineId),R);if(Q.length===0){D(!0);return}r?.({items:Q,note:E.trim()})}return c(q,{className:u,onBack:t,title:s("orderDetailTitle",{reference:y?.displayReference??""}),description:s("orderDetailDescription"),children:p?c(j,{}):f!=null?c(A,{errorKey:f,onRetry:m}):y==null?null:S("form",{className:"flex flex-col gap-5",onSubmit:It,children:[c("ul",{"data-bitsnap-returns-slot":"lineList",className:i("flex flex-col gap-3",I.className),style:I.style,children:y.lines.map(g=>{let Q=ze(g),M=R[g.lineId]??0,ge=`bitsnap-returns-quantity-${g.lineId}`;return S("li",{"data-bitsnap-returns-slot":"line","data-selected":M>0?"":void 0,"data-ineligible":Q?void 0:"",className:i("flex flex-col gap-3 border p-4",P.className),style:P.style,children:[S("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[c("span",{"data-bitsnap-returns-slot":"lineName",className:i("font-medium",k.className),style:k.style,children:g.name}),c("span",{"data-bitsnap-returns-slot":"linePrice",className:i("text-sm",U.className),style:U.style,children:ee(g.paidUnitMinor,g.currency,a)})]}),Q?S("div",{role:"group","aria-label":s("quantityLabel",{name:g.name}),"data-bitsnap-returns-slot":"lineQuantityControl",className:i("flex items-center gap-2",F.className),style:F.style,children:[c(N,{type:"button",variant:"secondary",size:"icon-sm","aria-label":s("quantityDecrease",{name:g.name}),"aria-controls":ge,disabled:M<=0,"data-bitsnap-returns-slot":"quantityButton",className:i(L,O.className),style:O.style,onClick:()=>fe(g,M-1),children:c("span",{"aria-hidden":"true",children:"-"})}),c("input",{id:ge,type:"number",inputMode:"numeric",min:0,max:g.availableQuantity,step:1,value:M,"aria-label":s("quantityLabel",{name:g.name}),"data-bitsnap-returns-slot":"quantityInput",className:i("h-8 w-16 rounded-md border px-2 text-center text-sm outline-none focus-visible:ring-[3px]",G,Oe.className),style:Oe.style,onChange:Ct=>fe(g,Ct.target.valueAsNumber)}),c(N,{type:"button",variant:"secondary",size:"icon-sm","aria-label":s("quantityIncrease",{name:g.name}),"aria-controls":ge,disabled:M>=g.availableQuantity,"data-bitsnap-returns-slot":"quantityButton",className:i(L,O.className),style:O.style,onClick:()=>fe(g,M+1),children:c("span",{"aria-hidden":"true",children:"+"})}),c("span",{className:"text-sm",children:s("quantityOfAvailable",{available:g.availableQuantity})})]}):c("p",{"data-bitsnap-returns-slot":"lineIneligibleReason",className:i("text-sm",Fe.className),style:Fe.style,children:g.exclusionReason!==""?g.exclusionReason:s("lineIneligibleFallback")})]},g.lineId)})}),S("div",{className:"flex flex-col gap-2",children:[c(te,{htmlFor:"bitsnap-returns-note",children:s("noteLabel")}),c(Ye,{id:"bitsnap-returns-note",name:"note",rows:3,maxLength:1e3,value:E,placeholder:s("notePlaceholder"),"data-bitsnap-returns-slot":"noteInput",className:i(G,"dark:border-[color:var(--bitsnap-returns-border,#e4e4e7)] dark:placeholder:text-[color:var(--bitsnap-returns-muted-foreground,#71717a)] dark:focus-visible:ring-[color:var(--bitsnap-returns-focus-ring,#71717a)]",Me.className),style:Me.style,onChange:g=>C(g.target.value)})]}),v&&c(A,{errorKey:"selectionEmpty"}),c(N,{type:"submit","data-bitsnap-returns-slot":"submitButton",className:i(H,qe.className),style:qe.style,children:s("selectionContinue")}),d.length>0&&S("div",{className:"flex flex-col gap-2",children:[c("h3",{className:"text-sm font-medium",children:s("previousReturnsTitle")}),c("ul",{"data-bitsnap-returns-slot":"history",className:i("flex flex-col gap-2",Ke.className),style:Ke.style,children:d.map(g=>S("li",{"data-bitsnap-returns-slot":"historyEntry",className:i("flex flex-wrap items-center justify-between gap-2 text-sm",_e.className),style:_e.style,children:[c("span",{children:g.reference}),c("span",{children:Z(g.createdAt,a)}),c(J,{status:g.status})]},g.id))})]})]})})}function ss({orderId:e,items:r,note:t,onSubmitted:n,onBack:o,className:u}){T("ReturnsConfirmation");let s=h(),a=V(),{order:y,isLoading:d,errorKey:p,refetch:f}=Le(e),m=xt(),R=l("summary"),b=l("line"),E=l("lineName"),C=l("linePrice"),v=l("submitButton");async function D(I){if(I.preventDefault(),m.isPending)return;let P=await m.submit({orderId:e,items:r.map(k=>({lineId:k.lineId,quantity:k.quantity})),note:t});P!=null&&n?.(P.id,P)}return c(q,{className:u,onBack:o,title:s("confirmationTitle"),description:s("confirmationDescription"),children:d?c(j,{rows:2}):p!=null?c(A,{errorKey:p,onRetry:f}):S("form",{className:"flex flex-col gap-5",onSubmit:D,children:[S("div",{"data-bitsnap-returns-slot":"summary",className:i("flex flex-col gap-3 border p-4",R.className),style:R.style,children:[c("h3",{className:"text-sm font-medium",children:s("confirmationSummary")}),c("ul",{className:"flex flex-col gap-3",children:r.map(I=>{let P=y?.lines.find(k=>k.lineId===I.lineId);return S("li",{"data-bitsnap-returns-slot":"line",className:i("flex flex-wrap items-baseline justify-between gap-2",b.className),style:b.style,children:[c("span",{"data-bitsnap-returns-slot":"lineName",className:i("font-medium",E.className),style:E.style,children:P?.name??I.lineId}),S("span",{"data-bitsnap-returns-slot":"linePrice",className:i("text-sm",C.className),style:C.style,children:[s("confirmationQuantity",{quantity:I.quantity}),P!=null&&` \xB7 ${ee(P.paidUnitMinor*BigInt(I.quantity),P.currency,a)}`]})]},I.lineId)})}),t!=null&&t!==""&&S("div",{className:"flex flex-col gap-1 text-sm",children:[c("span",{className:"font-medium",children:s("confirmationNote")}),c("span",{className:"whitespace-pre-wrap",children:t})]})]}),m.errorKey!=null&&c(A,{errorKey:m.errorKey}),S(N,{type:"submit",disabled:m.isPending||r.length===0,"data-bitsnap-returns-slot":"submitButton",className:i(H,v.className),style:v.style,children:[m.isPending&&c(re,{}),s("confirmationSubmit")]})]})})}function os({returnId:e,onContinue:r,onOpenMyReturns:t,className:n}){T("ReturnsResult");let o=h(),{request:u,isLoading:s,errorKey:a,refetch:y}=de(e),d=l("successState"),p=l("returnReference"),f=l("returnInstructions"),m=l("submitButton"),R=l("secondaryButton");return S("section",{className:i("flex flex-col gap-5",n),children:[S("div",{role:"status","data-bitsnap-returns-slot":"successState",className:i("flex flex-col gap-4 border p-5",d.className),style:d.style,children:[c("h2",{className:"text-2xl font-semibold",children:o("successTitle")}),c("p",{className:"text-sm",children:o("successDescription")}),s?c(j,{rows:2}):a!=null?c(A,{errorKey:a,onRetry:y}):u!=null&&S(Et,{children:[S("div",{className:"flex flex-col gap-1",children:[c("span",{className:"text-sm",children:o("successReference")}),c("span",{"data-bitsnap-returns-slot":"returnReference",className:i("text-lg font-semibold",p.className),style:p.style,children:u.reference})]}),u.returnInstructions!==""&&S("div",{className:"flex flex-col gap-1",children:[c("span",{className:"text-sm font-medium",children:o("successInstructions")}),c("p",{"data-bitsnap-returns-slot":"returnInstructions",className:i("whitespace-pre-wrap border p-3 text-sm",f.className),style:f.style,children:u.returnInstructions})]})]})]}),S("div",{className:"flex flex-wrap gap-3",children:[c(N,{type:"button","data-bitsnap-returns-slot":"submitButton",className:i(H,m.className),style:m.style,onClick:r,children:o("successDone")}),t!=null&&c(N,{type:"button",variant:"secondary","data-bitsnap-returns-slot":"secondaryButton",className:i(L,R.className),style:R.style,onClick:t,children:o("myReturnsLink")})]})]})}import{Fragment as yr,jsx as x,jsxs as w}from"react/jsx-runtime";function Rs({onSelectReturn:e,onBack:r,pageSize:t,className:n}){T("ReturnsMyReturnsList");let o=h(),u=V(),s=Ae(),a=vt({pageSize:t}),y=l("returnList"),d=l("returnCard"),p=l("returnReference"),f=l("secondaryButton");return x(q,{className:n,onBack:r,title:o("myReturnsTitle"),description:o("myReturnsDescription"),children:a.isLoading?x(j,{}):a.errorKey!=null?x(A,{errorKey:a.errorKey,onRetry:a.refetch}):a.returns.length===0?x(me,{children:o("myReturnsEmpty")}):w(yr,{children:[x("ul",{"data-bitsnap-returns-slot":"returnList",className:i("flex flex-col gap-3",y.className),style:y.style,children:a.returns.map(m=>w("li",{"data-bitsnap-returns-slot":"returnCard",className:i("flex flex-wrap items-center justify-between gap-3 border p-4",d.className),style:d.style,children:[w("div",{className:"flex flex-col gap-1",children:[x("span",{"data-bitsnap-returns-slot":"returnReference",className:i("font-medium",p.className),style:p.style,children:m.reference}),x("span",{className:"text-sm",children:Z(m.createdAt,u)}),w("span",{className:"text-sm",children:[o("myReturnRefund"),": ",s(m.refundStatus)]})]}),w("div",{className:"flex items-center gap-3",children:[x(J,{status:m.status}),x(N,{type:"button",variant:"secondary",size:"sm","aria-label":`${o("myReturnOpen")}: ${m.reference}`,"data-bitsnap-returns-slot":"secondaryButton",className:i(L,f.className),style:f.style,onClick:()=>e?.(m.id),children:o("myReturnOpen")})]})]},m.id))}),x(ye,{page:a.page,total:a.total,hasNext:a.hasNext,hasPrevious:a.hasPrevious,isFetching:a.isFetching,onNext:a.next,onPrevious:a.previous})]})})}function bs({returnId:e,onBack:r,className:t}){T("ReturnsMyReturnDetail");let n=h(),o=V(),u=Ae(),{request:s,isLoading:a,errorKey:y,refetch:d}=de(e),p=l("summary"),f=l("lineList"),m=l("line"),R=l("lineName"),b=l("returnInstructions"),E=l("history"),C=l("historyEntry");return x(q,{className:t,onBack:r,title:s!=null?n("myReturnTitle",{reference:s.reference}):n("myReturnDetailTitle"),children:a?x(j,{}):y!=null?x(A,{errorKey:y,onRetry:d}):s!=null&&w("div",{className:"flex flex-col gap-5",children:[w("div",{"data-bitsnap-returns-slot":"summary",className:i("flex flex-col gap-2 border p-4 text-sm",p.className),style:p.style,children:[w("div",{className:"flex items-center justify-between gap-2",children:[x(J,{status:s.status}),w("span",{children:[n("myReturnCreatedAt"),":"," ",Z(s.createdAt,o)]})]}),w("span",{children:[n("myReturnRefund"),": ",u(s.refundStatus),s.refundAmountMinor>BigInt(0)&&` \xB7 ${ee(s.refundAmountMinor,s.currency,o)}`]}),s.customerNote!==""&&w("span",{className:"whitespace-pre-wrap",children:[n("myReturnNote"),": ",s.customerNote]})]}),s.returnInstructions!==""&&x("p",{"data-bitsnap-returns-slot":"returnInstructions",className:i("whitespace-pre-wrap border p-3 text-sm",b.className),style:b.style,children:s.returnInstructions}),w("div",{className:"flex flex-col gap-2",children:[x("h3",{className:"text-sm font-medium",children:n("myReturnLines")}),x("ul",{"data-bitsnap-returns-slot":"lineList",className:i("flex flex-col gap-3",f.className),style:f.style,children:s.lines.map(v=>w("li",{"data-bitsnap-returns-slot":"line",className:i("flex flex-wrap items-baseline justify-between gap-2 border p-4",m.className),style:m.style,children:[x("span",{"data-bitsnap-returns-slot":"lineName",className:i("font-medium",R.className),style:R.style,children:v.name}),x("span",{className:"text-sm",children:n("myReturnLineQuantities",{requested:v.requestedQuantity,approved:v.approvedQuantity,received:v.receivedQuantity})})]},v.lineId))})]}),s.history.length>0&&w("div",{className:"flex flex-col gap-2",children:[x("h3",{className:"text-sm font-medium",children:n("myReturnHistory")}),x("ul",{"data-bitsnap-returns-slot":"history",className:i("flex flex-col gap-2",E.className),style:E.style,children:s.history.map(v=>w("li",{"data-bitsnap-returns-slot":"historyEntry",className:i("flex flex-wrap items-center justify-between gap-2 text-sm",C.className),style:C.style,children:[x(J,{status:v.status}),x("span",{children:Z(v.createdAt,o)})]},v.id))})]})]})})}export{te as a,re as b,gr as c,Je as d,xe as e,l as f,Ie as g,gt as h,h as i,T as j,nr as k,Vr as l,le as m,St as n,Le as o,xt as p,vt as q,de as r,j as s,Bn as t,zn as u,rs as v,ns as w,ss as x,os as y,Rs as z,bs as A};
|
|
2
|
-
//# sourceMappingURL=chunk-45AP7UZE.mjs.map
|