bitsnap-react 1.14.1 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/AGENTS.md +3 -0
  2. package/README.md +76 -2
  3. package/dist/CartProvider-VGZMDVFJ.js +2 -0
  4. package/dist/CartProvider-VGZMDVFJ.js.map +1 -0
  5. package/dist/CartProvider-ZY5OLTAF.mjs +2 -0
  6. package/dist/PanelModelFiles-NYCOFPLY.js +2 -0
  7. package/dist/PanelModelFiles-NYCOFPLY.js.map +1 -0
  8. package/dist/PanelModelFiles-RV7OHUUZ.mjs +2 -0
  9. package/dist/PanelModelFiles-RV7OHUUZ.mjs.map +1 -0
  10. package/dist/Viewer3D-2IDEH6W3.mjs +2 -0
  11. package/dist/Viewer3D-2IDEH6W3.mjs.map +1 -0
  12. package/dist/analytics.js +1 -1
  13. package/dist/analytics.js.map +1 -1
  14. package/dist/analytics.mjs +1 -1
  15. package/dist/catalog.d.mts +5 -1
  16. package/dist/catalog.d.ts +5 -1
  17. package/dist/catalog.js +1 -1
  18. package/dist/catalog.js.map +1 -1
  19. package/dist/catalog.mjs +1 -1
  20. package/dist/chunk-5AYH23UJ.mjs +4 -0
  21. package/dist/chunk-5AYH23UJ.mjs.map +1 -0
  22. package/dist/chunk-5ED7FWNY.mjs +2 -0
  23. package/dist/chunk-5ED7FWNY.mjs.map +1 -0
  24. package/dist/chunk-5R6AGO3Z.mjs +2 -0
  25. package/dist/chunk-5R6AGO3Z.mjs.map +1 -0
  26. package/dist/chunk-6Q3VGPSF.js +2 -0
  27. package/dist/chunk-6Q3VGPSF.js.map +1 -0
  28. package/dist/chunk-6YIRRDCL.mjs +2 -0
  29. package/dist/chunk-6YIRRDCL.mjs.map +1 -0
  30. package/dist/chunk-7RXW6XFY.js +2 -0
  31. package/dist/chunk-7RXW6XFY.js.map +1 -0
  32. package/dist/chunk-AGYS7Z6G.mjs +2 -0
  33. package/dist/{chunk-L7LZG6MR.mjs.map → chunk-AGYS7Z6G.mjs.map} +1 -1
  34. package/dist/chunk-CUPG4B5W.mjs +2 -0
  35. package/dist/chunk-CUPG4B5W.mjs.map +1 -0
  36. package/dist/chunk-DPKWYLN7.mjs +2 -0
  37. package/dist/chunk-DPKWYLN7.mjs.map +1 -0
  38. package/dist/{chunk-PVJ2I46C.js → chunk-GQJDFLSL.js} +2 -2
  39. package/dist/chunk-GQJDFLSL.js.map +1 -0
  40. package/dist/chunk-GXUNRJ5S.js +2 -0
  41. package/dist/chunk-GXUNRJ5S.js.map +1 -0
  42. package/dist/chunk-I3QXJJ7U.mjs +2 -0
  43. package/dist/{chunk-ONTCJSSD.mjs.map → chunk-I3QXJJ7U.mjs.map} +1 -1
  44. package/dist/chunk-JSDGZ4NY.js.map +1 -1
  45. package/dist/chunk-KOYBZORL.js.map +1 -1
  46. package/dist/{chunk-KKOIDDOW.js → chunk-LL7ASBGY.js} +2 -2
  47. package/dist/chunk-LL7ASBGY.js.map +1 -0
  48. package/dist/chunk-OZHXRKMX.js +2 -0
  49. package/dist/chunk-OZHXRKMX.js.map +1 -0
  50. package/dist/chunk-QERYM7RC.js +2 -0
  51. package/dist/chunk-QERYM7RC.js.map +1 -0
  52. package/dist/{chunk-JZBU5SZJ.mjs → chunk-QQQ2JSPQ.mjs} +2 -2
  53. package/dist/{chunk-JZBU5SZJ.mjs.map → chunk-QQQ2JSPQ.mjs.map} +1 -1
  54. package/dist/chunk-QXGK337V.mjs +2 -0
  55. package/dist/{chunk-4TZAGNEU.mjs.map → chunk-QXGK337V.mjs.map} +1 -1
  56. package/dist/{chunk-5DBLZ3VL.js → chunk-SRQOFCMO.js} +2 -2
  57. package/dist/chunk-SRQOFCMO.js.map +1 -0
  58. package/dist/chunk-SULHGFYN.mjs +2 -0
  59. package/dist/chunk-SULHGFYN.mjs.map +1 -0
  60. package/dist/chunk-SXKJ26OA.mjs +2 -0
  61. package/dist/chunk-SXKJ26OA.mjs.map +1 -0
  62. package/dist/chunk-VNYHJT6V.mjs +2 -0
  63. package/dist/chunk-VNYHJT6V.mjs.map +1 -0
  64. package/dist/chunk-W3RGQYPD.js.map +1 -1
  65. package/dist/chunk-WKE6ECID.mjs +2 -0
  66. package/dist/chunk-WKE6ECID.mjs.map +1 -0
  67. package/dist/{chunk-QQDZIVWY.js → chunk-WPOXLITY.js} +2 -2
  68. package/dist/chunk-WPOXLITY.js.map +1 -0
  69. package/dist/chunk-Y5KWVTXT.js +4 -0
  70. package/dist/chunk-Y5KWVTXT.js.map +1 -0
  71. package/dist/consent.js +14 -7
  72. package/dist/consent.js.map +1 -1
  73. package/dist/consent.mjs +14 -7
  74. package/dist/consent.mjs.map +1 -1
  75. package/dist/course.js +1 -1
  76. package/dist/course.js.map +1 -1
  77. package/dist/course.mjs +1 -1
  78. package/dist/course.mjs.map +1 -1
  79. package/dist/embed/analytics.js +1 -1
  80. package/dist/embed/consent.js +14 -7
  81. package/dist/errors.js.map +1 -1
  82. package/dist/index.css +1 -1
  83. package/dist/index.css.map +1 -1
  84. package/dist/index.js +1 -1
  85. package/dist/index.js.map +1 -1
  86. package/dist/index.mjs +1 -1
  87. package/dist/index.mjs.map +1 -1
  88. package/dist/internal.js.map +1 -1
  89. package/dist/methods-NJEP64AG.mjs +2 -0
  90. package/dist/methods-WRONKK3D.js +2 -0
  91. package/dist/methods-WRONKK3D.js.map +1 -0
  92. package/dist/model-files-client-HHDXJDTS.mjs +2 -0
  93. package/dist/model-files-client-HHDXJDTS.mjs.map +1 -0
  94. package/dist/model-files-client-P4PORZJ6.js +2 -0
  95. package/dist/model-files-client-P4PORZJ6.js.map +1 -0
  96. package/dist/models.d.mts +2 -0
  97. package/dist/models.d.ts +2 -0
  98. package/dist/models.js +1 -1
  99. package/dist/models.js.map +1 -1
  100. package/dist/models.mjs +1 -1
  101. package/dist/models.mjs.map +1 -1
  102. package/dist/returns.js +1 -1
  103. package/dist/returns.js.map +1 -1
  104. package/dist/returns.mjs +1 -1
  105. package/dist/viewer3d.css +2 -0
  106. package/dist/viewer3d.css.map +1 -0
  107. package/dist/viewer3d.d.mts +318 -0
  108. package/dist/viewer3d.d.ts +318 -0
  109. package/dist/viewer3d.js +2 -0
  110. package/dist/viewer3d.js.map +1 -0
  111. package/dist/viewer3d.mjs +63 -0
  112. package/dist/viewer3d.mjs.map +1 -0
  113. package/package.json +30 -3
  114. package/dist/CartProvider-2RNAKU3U.js +0 -2
  115. package/dist/CartProvider-2RNAKU3U.js.map +0 -1
  116. package/dist/CartProvider-OSGG573S.mjs +0 -2
  117. package/dist/chunk-2OOQPXCQ.js +0 -4
  118. package/dist/chunk-2OOQPXCQ.js.map +0 -1
  119. package/dist/chunk-4MU2YAQT.js +0 -2
  120. package/dist/chunk-4MU2YAQT.js.map +0 -1
  121. package/dist/chunk-4TZAGNEU.mjs +0 -2
  122. package/dist/chunk-5DBLZ3VL.js.map +0 -1
  123. package/dist/chunk-7WJSK6SJ.mjs +0 -4
  124. package/dist/chunk-7WJSK6SJ.mjs.map +0 -1
  125. package/dist/chunk-EJRI366W.js +0 -2
  126. package/dist/chunk-EJRI366W.js.map +0 -1
  127. package/dist/chunk-FIWADPQX.mjs +0 -2
  128. package/dist/chunk-FIWADPQX.mjs.map +0 -1
  129. package/dist/chunk-GTOZ5BZX.js +0 -2
  130. package/dist/chunk-GTOZ5BZX.js.map +0 -1
  131. package/dist/chunk-KKOIDDOW.js.map +0 -1
  132. package/dist/chunk-L7LZG6MR.mjs +0 -2
  133. package/dist/chunk-ONTCJSSD.mjs +0 -2
  134. package/dist/chunk-PVJ2I46C.js.map +0 -1
  135. package/dist/chunk-QQDZIVWY.js.map +0 -1
  136. package/dist/chunk-TBYY3RL2.mjs +0 -2
  137. package/dist/chunk-TBYY3RL2.mjs.map +0 -1
  138. package/dist/chunk-WJGC6EHC.mjs +0 -2
  139. package/dist/chunk-WJGC6EHC.mjs.map +0 -1
  140. package/dist/methods-4WVTFI3Q.mjs +0 -2
  141. package/dist/methods-W5JTLIIX.js +0 -2
  142. package/dist/methods-W5JTLIIX.js.map +0 -1
  143. /package/dist/{CartProvider-OSGG573S.mjs.map → CartProvider-ZY5OLTAF.mjs.map} +0 -0
  144. /package/dist/{methods-4WVTFI3Q.mjs.map → methods-NJEP64AG.mjs.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/dx/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/dx/dist/internal.js","sourcesContent":[null,""]}
1
+ {"version":3,"sources":["/home/emems/web/bitsnap/bitsnap/bitsnap-react/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/web/bitsnap/bitsnap/bitsnap-react/dist/internal.js","sourcesContent":[null,""]}
@@ -0,0 +1,2 @@
1
+ import{B as a,C as b,D as c,E as d,F as e,G as f}from"./chunk-5AYH23UJ.mjs";import"./chunk-QXGK337V.mjs";import"./chunk-KOVKUJAW.mjs";import"./chunk-SULHGFYN.mjs";import"./chunk-CUPG4B5W.mjs";import"./chunk-AGYS7Z6G.mjs";import"./chunk-5R6AGO3Z.mjs";import"./chunk-SXKJ26OA.mjs";import"./chunk-QQQ2JSPQ.mjs";import"./chunk-VNYHJT6V.mjs";import"./chunk-MDCP5JNP.mjs";import"./chunk-U6FLIRIV.mjs";export{a as Bitsnap,d as createCheckout,c as createPaymentURL,b as getPaymentMethodChoice,e as getReferenceIfPossible,f as injectReferenceToRequestIfNeeded};
2
+ //# sourceMappingURL=methods-NJEP64AG.mjs.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY5KWVTXTjs = require('./chunk-Y5KWVTXT.js');require('./chunk-QERYM7RC.js');require('./chunk-KOYBZORL.js');require('./chunk-SRQOFCMO.js');require('./chunk-WPOXLITY.js');require('./chunk-GXUNRJ5S.js');require('./chunk-GQJDFLSL.js');require('./chunk-7RXW6XFY.js');require('./chunk-W3RGQYPD.js');require('./chunk-JSDGZ4NY.js');exports.Bitsnap = _chunkY5KWVTXTjs.B; exports.createCheckout = _chunkY5KWVTXTjs.E; exports.createPaymentURL = _chunkY5KWVTXTjs.D; exports.getPaymentMethodChoice = _chunkY5KWVTXTjs.C; exports.getReferenceIfPossible = _chunkY5KWVTXTjs.F; exports.injectReferenceToRequestIfNeeded = _chunkY5KWVTXTjs.G;
2
+ //# sourceMappingURL=methods-WRONKK3D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/methods-WRONKK3D.js"],"names":[],"mappings":"AAAA,+HAA0E,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,0SAA6J","file":"/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/methods-WRONKK3D.js"}
@@ -0,0 +1,2 @@
1
+ import{b as t}from"./chunk-6YIRRDCL.mjs";import"./chunk-U6FLIRIV.mjs";import{Code as o,ConnectError as d,createClient as n}from"@connectrpc/connect";async function m(s,l,i){try{let e=await n(t,s).listModelFiles({accessToken:l,projectId:i});return e.result.case==="success"?{status:"ready",models:e.result.value.models}:e.result.case==="failure"&&e.result.value===1?{status:"unauthorized"}:{status:"hidden"}}catch(e){let r=d.from(e).code;return r!==o.Unimplemented&&r!==o.NotFound&&console.warn("[bitsnap-react] 3D files could not be loaded",e),{status:"hidden"}}}export{m as listModelFiles};
2
+ //# sourceMappingURL=model-files-client-HHDXJDTS.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/panel/components/model-files-client.ts"],"sourcesContent":["import { Code, ConnectError, createClient, type Transport } from \"@connectrpc/connect\";\n\nimport {\n ModelDeliveryFailure,\n ModelDeliveryService,\n} from \"../../gen/proto/public/v1/model_delivery_pb\";\nimport type { ModelFilesLoad } from \"./model-files-load\";\n\n/**\n * Lists the buyer's 3D files (`public.v1.ModelDeliveryService`). Loaded with\n * `import()` by `useModelFiles`, so the service descriptor stays out of the\n * main bundle. A transport error (an older server without the service\n * answers 404 / unimplemented) or any failure other than an expired session\n * hides the section.\n */\nexport async function listModelFiles(\n transport: Transport,\n accessToken: string,\n projectID: string,\n): Promise<ModelFilesLoad> {\n try {\n const response = await createClient(ModelDeliveryService, transport).listModelFiles({\n accessToken,\n projectId: projectID,\n });\n if (response.result.case === \"success\") {\n return { status: \"ready\", models: response.result.value.models };\n }\n if (\n response.result.case === \"failure\" &&\n response.result.value === ModelDeliveryFailure.UNAUTHORIZED\n ) {\n return { status: \"unauthorized\" };\n }\n return { status: \"hidden\" };\n } catch (error) {\n const code = ConnectError.from(error).code;\n if (code !== Code.Unimplemented && code !== Code.NotFound) {\n console.warn(\"[bitsnap-react] 3D files could not be loaded\", error);\n }\n return { status: \"hidden\" };\n }\n}\n"],"mappings":"sEAAA,OAAS,QAAAA,EAAM,gBAAAC,EAAc,gBAAAC,MAAoC,sBAejE,eAAsBC,EACpBC,EACAC,EACAC,EACyB,CACzB,GAAI,CACF,IAAMC,EAAW,MAAMC,EAAaC,EAAsBL,CAAS,EAAE,eAAe,CAClF,YAAAC,EACA,UAAWC,CACb,CAAC,EACD,OAAIC,EAAS,OAAO,OAAS,UACpB,CAAE,OAAQ,QAAS,OAAQA,EAAS,OAAO,MAAM,MAAO,EAG/DA,EAAS,OAAO,OAAS,WACzBA,EAAS,OAAO,QAAU,EAEnB,CAAE,OAAQ,cAAe,EAE3B,CAAE,OAAQ,QAAS,CAC5B,OAASG,EAAO,CACd,IAAMC,EAAOC,EAAa,KAAKF,CAAK,EAAE,KACtC,OAAIC,IAASE,EAAK,eAAiBF,IAASE,EAAK,UAC/C,QAAQ,KAAK,+CAAgDH,CAAK,EAE7D,CAAE,OAAQ,QAAS,CAC5B,CACF","names":["Code","ConnectError","createClient","listModelFiles","transport","accessToken","projectID","response","createClient","ModelDeliveryService","error","code","ConnectError","Code"]}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6Q3VGPSFjs = require('./chunk-6Q3VGPSF.js');require('./chunk-JSDGZ4NY.js');var _connect = require('@connectrpc/connect');async function m(s,l,i){try{let e=await _connect.createClient.call(void 0, _chunk6Q3VGPSFjs.b,s).listModelFiles({accessToken:l,projectId:i});return e.result.case==="success"?{status:"ready",models:e.result.value.models}:e.result.case==="failure"&&e.result.value===1?{status:"unauthorized"}:{status:"hidden"}}catch(e){let r=_connect.ConnectError.from(e).code;return r!==_connect.Code.Unimplemented&&r!==_connect.Code.NotFound&&console.warn("[bitsnap-react] 3D files could not be loaded",e),{status:"hidden"}}}exports.listModelFiles = m;
2
+ //# sourceMappingURL=model-files-client-P4PORZJ6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/model-files-client-P4PORZJ6.js","../src/panel/components/model-files-client.ts"],"names":["listModelFiles","transport","accessToken","projectID","response","createClient","ModelDeliveryService","error","code","ConnectError","Code"],"mappings":"AAAA,+HAAuC,+BAA4B,8CCAF,MAejE,SAAsBA,CAAAA,CACpBC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CACyB,CACzB,GAAI,CACF,IAAMC,CAAAA,CAAW,MAAMC,mCAAAA,kBAAaC,CAAsBL,CAAS,CAAA,CAAE,cAAA,CAAe,CAClF,WAAA,CAAAC,CAAAA,CACA,SAAA,CAAWC,CACb,CAAC,CAAA,CACD,OAAIC,CAAAA,CAAS,MAAA,CAAO,IAAA,GAAS,SAAA,CACpB,CAAE,MAAA,CAAQ,OAAA,CAAS,MAAA,CAAQA,CAAAA,CAAS,MAAA,CAAO,KAAA,CAAM,MAAO,CAAA,CAG/DA,CAAAA,CAAS,MAAA,CAAO,IAAA,GAAS,SAAA,EACzBA,CAAAA,CAAS,MAAA,CAAO,KAAA,GAAU,CAAA,CAEnB,CAAE,MAAA,CAAQ,cAAe,CAAA,CAE3B,CAAE,MAAA,CAAQ,QAAS,CAC5B,CAAA,KAAA,CAASG,CAAAA,CAAO,CACd,IAAMC,CAAAA,CAAOC,qBAAAA,CAAa,IAAA,CAAKF,CAAK,CAAA,CAAE,IAAA,CACtC,OAAIC,CAAAA,GAASE,aAAAA,CAAK,aAAA,EAAiBF,CAAAA,GAASE,aAAAA,CAAK,QAAA,EAC/C,OAAA,CAAQ,IAAA,CAAK,8CAAA,CAAgDH,CAAK,CAAA,CAE7D,CAAE,MAAA,CAAQ,QAAS,CAC5B,CACF,CAAA,2BAAA","file":"/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/model-files-client-P4PORZJ6.js","sourcesContent":[null,"import { Code, ConnectError, createClient, type Transport } from \"@connectrpc/connect\";\n\nimport {\n ModelDeliveryFailure,\n ModelDeliveryService,\n} from \"../../gen/proto/public/v1/model_delivery_pb\";\nimport type { ModelFilesLoad } from \"./model-files-load\";\n\n/**\n * Lists the buyer's 3D files (`public.v1.ModelDeliveryService`). Loaded with\n * `import()` by `useModelFiles`, so the service descriptor stays out of the\n * main bundle. A transport error (an older server without the service\n * answers 404 / unimplemented) or any failure other than an expired session\n * hides the section.\n */\nexport async function listModelFiles(\n transport: Transport,\n accessToken: string,\n projectID: string,\n): Promise<ModelFilesLoad> {\n try {\n const response = await createClient(ModelDeliveryService, transport).listModelFiles({\n accessToken,\n projectId: projectID,\n });\n if (response.result.case === \"success\") {\n return { status: \"ready\", models: response.result.value.models };\n }\n if (\n response.result.case === \"failure\" &&\n response.result.value === ModelDeliveryFailure.UNAUTHORIZED\n ) {\n return { status: \"unauthorized\" };\n }\n return { status: \"hidden\" };\n } catch (error) {\n const code = ConnectError.from(error).code;\n if (code !== Code.Unimplemented && code !== Code.NotFound) {\n console.warn(\"[bitsnap-react] 3D files could not be loaded\", error);\n }\n return { status: \"hidden\" };\n }\n}\n"]}
package/dist/models.d.mts CHANGED
@@ -616,6 +616,7 @@ declare namespace BitsnapModels {
616
616
  isRecurring: z.ZodBoolean;
617
617
  available: z.ZodBoolean;
618
618
  addToCart: z.ZodBoolean;
619
+ has3d: z.ZodOptional<z.ZodBoolean>;
619
620
  }, z.core.$strip>;
620
621
  type PublicListProduct = z.infer<typeof PublicListProductSchema>;
621
622
  const ProductListResponseSchema: z.ZodObject<{
@@ -637,6 +638,7 @@ declare namespace BitsnapModels {
637
638
  isRecurring: z.ZodBoolean;
638
639
  available: z.ZodBoolean;
639
640
  addToCart: z.ZodBoolean;
641
+ has3d: z.ZodOptional<z.ZodBoolean>;
640
642
  }, z.core.$strip>>;
641
643
  totalCount: z.ZodNumber;
642
644
  }, z.core.$strip>;
package/dist/models.d.ts CHANGED
@@ -616,6 +616,7 @@ declare namespace BitsnapModels {
616
616
  isRecurring: z.ZodBoolean;
617
617
  available: z.ZodBoolean;
618
618
  addToCart: z.ZodBoolean;
619
+ has3d: z.ZodOptional<z.ZodBoolean>;
619
620
  }, z.core.$strip>;
620
621
  type PublicListProduct = z.infer<typeof PublicListProductSchema>;
621
622
  const ProductListResponseSchema: z.ZodObject<{
@@ -637,6 +638,7 @@ declare namespace BitsnapModels {
637
638
  isRecurring: z.ZodBoolean;
638
639
  available: z.ZodBoolean;
639
640
  addToCart: z.ZodBoolean;
641
+ has3d: z.ZodOptional<z.ZodBoolean>;
640
642
  }, z.core.$strip>>;
641
643
  totalCount: z.ZodNumber;
642
644
  }, z.core.$strip>;
package/dist/models.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }require('./chunk-JSDGZ4NY.js');var _zod = require('zod'); var e = _interopRequireWildcard(_zod);var s;(t=>(t.BaselinkerFieldsSchema=e.object({storageID:e.string().optional()}),t.MetadataSchema=e.record(e.string(),e.any()),t.ProductPricingSchema=e.object({regularPrice:e.number(),effectivePrice:e.number(),currency:e.string(),discount:e.object({id:e.string(),type:e.enum(["FIXED","PERCENTAGE"]),value:e.number(),status:e.enum(["ACTIVE","SCHEDULED","EXPIRED","DISABLED"]),startsAt:e.number().optional(),endsAt:e.number().optional()}).optional(),referencePrice:e.object({amount:e.number().optional(),windowDays:e.literal(30),asOf:e.number(),basis:e.literal("observed-history"),historyAvailable:e.boolean()}),priceVersion:e.string(),nextPriceChangeAt:e.number().optional()}),t.VariantSchema=e.object({id:e.string(),name:e.string(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),images:e.array(e.string()),availableQuantity:e.number().optional(),isDeliverable:e.boolean().optional(),estimatedDeliveryAt:e.number().optional(),pricing:t.ProductPricingSchema.optional()}),t.AdditionalSchema=e.object({sku:e.string().optional(),baselinkerFields:t.BaselinkerFieldsSchema.optional(),isPresale:e.boolean().optional()}),t.ItemSchema=e.object({id:e.string(),ownerID:e.string().optional(),name:e.string(),description:e.union([e.string(),e.null()]).optional(),createdAt:e.number().optional(),updatedAt:e.number().optional(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),image_url:e.string(),images:e.array(e.string()),isDeliverable:e.boolean().optional(),availableQuantity:e.number().optional(),additional:t.AdditionalSchema.optional(),variants:e.array(t.VariantSchema).optional(),estimatedDeliveryAt:e.number().optional(),pricing:t.ProductPricingSchema.optional()}),t.DataSchema=e.object({success:e.boolean(),result:e.array(t.ItemSchema),totalCount:e.number()}),t.ProductsResultResultSchema=e.object({data:t.DataSchema}),t.ProductsResultElementSchema=e.array(e.object({result:t.ProductsResultResultSchema})),t.ProductResultSchema=e.array(e.object({result:e.object({data:e.object({success:e.boolean(),message:e.string().optional(),result:t.ItemSchema.optional()})})})),t.PublicListProductImageSchema=e.object({url:e.string(),thumbnailUrl:e.union([e.string(),e.null()])}),t.PublicListProductSchema=e.object({id:e.string(),cartItemId:e.string().optional(),uniqueSlug:e.string(),name:e.string(),shortDescription:e.union([e.string(),e.null()]),image:e.union([t.PublicListProductImageSchema,e.null()]),price:e.number(),currency:e.string(),compareAtPrice:e.union([e.number(),e.null()]),priceFrom:e.boolean(),variantCount:e.number(),isRecurring:e.boolean(),available:e.boolean(),addToCart:e.boolean()}),t.ProductListResponseSchema=e.object({items:e.array(t.PublicListProductSchema),totalCount:e.number()})))(s = exports.BitsnapModels||={});exports.BitsnapModels = s;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }require('./chunk-JSDGZ4NY.js');var _zod = require('zod'); var e = _interopRequireWildcard(_zod);var s;(t=>(t.BaselinkerFieldsSchema=e.object({storageID:e.string().optional()}),t.MetadataSchema=e.record(e.string(),e.any()),t.ProductPricingSchema=e.object({regularPrice:e.number(),effectivePrice:e.number(),currency:e.string(),discount:e.object({id:e.string(),type:e.enum(["FIXED","PERCENTAGE"]),value:e.number(),status:e.enum(["ACTIVE","SCHEDULED","EXPIRED","DISABLED"]),startsAt:e.number().optional(),endsAt:e.number().optional()}).optional(),referencePrice:e.object({amount:e.number().optional(),windowDays:e.literal(30),asOf:e.number(),basis:e.literal("observed-history"),historyAvailable:e.boolean()}),priceVersion:e.string(),nextPriceChangeAt:e.number().optional()}),t.VariantSchema=e.object({id:e.string(),name:e.string(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),images:e.array(e.string()),availableQuantity:e.number().optional(),isDeliverable:e.boolean().optional(),estimatedDeliveryAt:e.number().optional(),pricing:t.ProductPricingSchema.optional()}),t.AdditionalSchema=e.object({sku:e.string().optional(),baselinkerFields:t.BaselinkerFieldsSchema.optional(),isPresale:e.boolean().optional()}),t.ItemSchema=e.object({id:e.string(),ownerID:e.string().optional(),name:e.string(),description:e.union([e.string(),e.null()]).optional(),createdAt:e.number().optional(),updatedAt:e.number().optional(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),image_url:e.string(),images:e.array(e.string()),isDeliverable:e.boolean().optional(),availableQuantity:e.number().optional(),additional:t.AdditionalSchema.optional(),variants:e.array(t.VariantSchema).optional(),estimatedDeliveryAt:e.number().optional(),pricing:t.ProductPricingSchema.optional()}),t.DataSchema=e.object({success:e.boolean(),result:e.array(t.ItemSchema),totalCount:e.number()}),t.ProductsResultResultSchema=e.object({data:t.DataSchema}),t.ProductsResultElementSchema=e.array(e.object({result:t.ProductsResultResultSchema})),t.ProductResultSchema=e.array(e.object({result:e.object({data:e.object({success:e.boolean(),message:e.string().optional(),result:t.ItemSchema.optional()})})})),t.PublicListProductImageSchema=e.object({url:e.string(),thumbnailUrl:e.union([e.string(),e.null()])}),t.PublicListProductSchema=e.object({id:e.string(),cartItemId:e.string().optional(),uniqueSlug:e.string(),name:e.string(),shortDescription:e.union([e.string(),e.null()]),image:e.union([t.PublicListProductImageSchema,e.null()]),price:e.number(),currency:e.string(),compareAtPrice:e.union([e.number(),e.null()]),priceFrom:e.boolean(),variantCount:e.number(),isRecurring:e.boolean(),available:e.boolean(),addToCart:e.boolean(),has3d:e.boolean().optional()}),t.ProductListResponseSchema=e.object({items:e.array(t.PublicListProductSchema),totalCount:e.number()})))(s = exports.BitsnapModels||={});exports.BitsnapModels = s;
2
2
  //# sourceMappingURL=models.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/dx/dist/models.js","../src/models.ts"],"names":["BitsnapModels"],"mappings":"AAAA,0XAA2B,iECAR,IAEFA,CAAAA,CAAAA,CAAAA,CAAAA,EAAA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\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 ProductListResponse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AA,CAAA,KAAA,CAAMA,CAAAA,CAAA,uBAAuB,CAAA,CACtC,UAAA,CAAc,CAAA,CAAA,MAAA,CAAO,CACvB,CAAC,CAAA,CAAA,CAAA,CAzJcA,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 * `true` when the product or one of its variants has a ready 3D model\n * (the card shows a \"3D\" badge). Older backends omit it.\n */\n has3d: z.boolean().optional(),\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/models.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import"./chunk-U6FLIRIV.mjs";import*as e from"zod";var s;(t=>(t.BaselinkerFieldsSchema=e.object({storageID:e.string().optional()}),t.MetadataSchema=e.record(e.string(),e.any()),t.ProductPricingSchema=e.object({regularPrice:e.number(),effectivePrice:e.number(),currency:e.string(),discount:e.object({id:e.string(),type:e.enum(["FIXED","PERCENTAGE"]),value:e.number(),status:e.enum(["ACTIVE","SCHEDULED","EXPIRED","DISABLED"]),startsAt:e.number().optional(),endsAt:e.number().optional()}).optional(),referencePrice:e.object({amount:e.number().optional(),windowDays:e.literal(30),asOf:e.number(),basis:e.literal("observed-history"),historyAvailable:e.boolean()}),priceVersion:e.string(),nextPriceChangeAt:e.number().optional()}),t.VariantSchema=e.object({id:e.string(),name:e.string(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),images:e.array(e.string()),availableQuantity:e.number().optional(),isDeliverable:e.boolean().optional(),estimatedDeliveryAt:e.number().optional(),pricing:t.ProductPricingSchema.optional()}),t.AdditionalSchema=e.object({sku:e.string().optional(),baselinkerFields:t.BaselinkerFieldsSchema.optional(),isPresale:e.boolean().optional()}),t.ItemSchema=e.object({id:e.string(),ownerID:e.string().optional(),name:e.string(),description:e.union([e.string(),e.null()]).optional(),createdAt:e.number().optional(),updatedAt:e.number().optional(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),image_url:e.string(),images:e.array(e.string()),isDeliverable:e.boolean().optional(),availableQuantity:e.number().optional(),additional:t.AdditionalSchema.optional(),variants:e.array(t.VariantSchema).optional(),estimatedDeliveryAt:e.number().optional(),pricing:t.ProductPricingSchema.optional()}),t.DataSchema=e.object({success:e.boolean(),result:e.array(t.ItemSchema),totalCount:e.number()}),t.ProductsResultResultSchema=e.object({data:t.DataSchema}),t.ProductsResultElementSchema=e.array(e.object({result:t.ProductsResultResultSchema})),t.ProductResultSchema=e.array(e.object({result:e.object({data:e.object({success:e.boolean(),message:e.string().optional(),result:t.ItemSchema.optional()})})})),t.PublicListProductImageSchema=e.object({url:e.string(),thumbnailUrl:e.union([e.string(),e.null()])}),t.PublicListProductSchema=e.object({id:e.string(),cartItemId:e.string().optional(),uniqueSlug:e.string(),name:e.string(),shortDescription:e.union([e.string(),e.null()]),image:e.union([t.PublicListProductImageSchema,e.null()]),price:e.number(),currency:e.string(),compareAtPrice:e.union([e.number(),e.null()]),priceFrom:e.boolean(),variantCount:e.number(),isRecurring:e.boolean(),available:e.boolean(),addToCart:e.boolean()}),t.ProductListResponseSchema=e.object({items:e.array(t.PublicListProductSchema),totalCount:e.number()})))(s||={});export{s as BitsnapModels};
1
+ import"./chunk-U6FLIRIV.mjs";import*as e from"zod";var s;(t=>(t.BaselinkerFieldsSchema=e.object({storageID:e.string().optional()}),t.MetadataSchema=e.record(e.string(),e.any()),t.ProductPricingSchema=e.object({regularPrice:e.number(),effectivePrice:e.number(),currency:e.string(),discount:e.object({id:e.string(),type:e.enum(["FIXED","PERCENTAGE"]),value:e.number(),status:e.enum(["ACTIVE","SCHEDULED","EXPIRED","DISABLED"]),startsAt:e.number().optional(),endsAt:e.number().optional()}).optional(),referencePrice:e.object({amount:e.number().optional(),windowDays:e.literal(30),asOf:e.number(),basis:e.literal("observed-history"),historyAvailable:e.boolean()}),priceVersion:e.string(),nextPriceChangeAt:e.number().optional()}),t.VariantSchema=e.object({id:e.string(),name:e.string(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),images:e.array(e.string()),availableQuantity:e.number().optional(),isDeliverable:e.boolean().optional(),estimatedDeliveryAt:e.number().optional(),pricing:t.ProductPricingSchema.optional()}),t.AdditionalSchema=e.object({sku:e.string().optional(),baselinkerFields:t.BaselinkerFieldsSchema.optional(),isPresale:e.boolean().optional()}),t.ItemSchema=e.object({id:e.string(),ownerID:e.string().optional(),name:e.string(),description:e.union([e.string(),e.null()]).optional(),createdAt:e.number().optional(),updatedAt:e.number().optional(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),image_url:e.string(),images:e.array(e.string()),isDeliverable:e.boolean().optional(),availableQuantity:e.number().optional(),additional:t.AdditionalSchema.optional(),variants:e.array(t.VariantSchema).optional(),estimatedDeliveryAt:e.number().optional(),pricing:t.ProductPricingSchema.optional()}),t.DataSchema=e.object({success:e.boolean(),result:e.array(t.ItemSchema),totalCount:e.number()}),t.ProductsResultResultSchema=e.object({data:t.DataSchema}),t.ProductsResultElementSchema=e.array(e.object({result:t.ProductsResultResultSchema})),t.ProductResultSchema=e.array(e.object({result:e.object({data:e.object({success:e.boolean(),message:e.string().optional(),result:t.ItemSchema.optional()})})})),t.PublicListProductImageSchema=e.object({url:e.string(),thumbnailUrl:e.union([e.string(),e.null()])}),t.PublicListProductSchema=e.object({id:e.string(),cartItemId:e.string().optional(),uniqueSlug:e.string(),name:e.string(),shortDescription:e.union([e.string(),e.null()]),image:e.union([t.PublicListProductImageSchema,e.null()]),price:e.number(),currency:e.string(),compareAtPrice:e.union([e.number(),e.null()]),priceFrom:e.boolean(),variantCount:e.number(),isRecurring:e.boolean(),available:e.boolean(),addToCart:e.boolean(),has3d:e.boolean().optional()}),t.ProductListResponseSchema=e.object({items:e.array(t.PublicListProductSchema),totalCount:e.number()})))(s||={});export{s as BitsnapModels};
2
2
  //# sourceMappingURL=models.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/models.ts"],"sourcesContent":["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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,CAAC,CAAC,EACvD,MAAS,SAAO,EAChB,SAAY,SAAO,EACnB,eAAkB,QAAM,CAAG,SAAO,EAAK,OAAK,CAAC,CAAC,EAE9C,UAAa,UAAQ,EACrB,aAAgB,SAAO,EACvB,YAAe,UAAQ,EACvB,UAAa,UAAQ,EAErB,UAAa,UAAQ,CACvB,CAAC,EAGYA,EAAA,0BAA8B,SAAO,CAChD,MAAS,QAAMA,EAAA,uBAAuB,EACtC,WAAc,SAAO,CACvB,CAAC,IApJcA,IAAA","names":["z","BitsnapModels"]}
1
+ {"version":3,"sources":["../src/models.ts"],"sourcesContent":["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 * `true` when the product or one of its variants has a ready 3D model\n * (the card shows a \"3D\" badge). Older backends omit it.\n */\n has3d: z.boolean().optional(),\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"],"mappings":"6BAAA,UAAYA,MAAO,MAEZ,IAAUC,OACFA,EAAA,uBAA2B,SAAO,CAC7C,UAAa,SAAO,EAAE,SAAS,CACjC,CAAC,EAGYA,EAAA,eAAmB,SAAS,SAAO,EAAK,MAAI,CAAC,EAE7CA,EAAA,qBAAyB,SAAO,CAC3C,aAAgB,SAAO,EACvB,eAAkB,SAAO,EACzB,SAAY,SAAO,EACnB,SAAY,SAAO,CACjB,GAAM,SAAO,EACb,KAAQ,OAAK,CAAC,QAAS,YAAY,CAAC,EACpC,MAAS,SAAO,EAChB,OAAU,OAAK,CAAC,SAAU,YAAa,UAAW,UAAU,CAAC,EAC7D,SAAY,SAAO,EAAE,SAAS,EAC9B,OAAU,SAAO,EAAE,SAAS,CAC9B,CAAC,EAAE,SAAS,EACZ,eAAkB,SAAO,CACvB,OAAU,SAAO,EAAE,SAAS,EAC5B,WAAc,UAAQ,EAAE,EACxB,KAAQ,SAAO,EACf,MAAS,UAAQ,kBAAkB,EACnC,iBAAoB,UAAQ,CAC9B,CAAC,EACD,aAAgB,SAAO,EACvB,kBAAqB,SAAO,EAAE,SAAS,CACzC,CAAC,EAGYA,EAAA,cAAkB,SAAO,CACpC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O,CACP,OAAU,SAAO,CACf,KAAQ,SAAO,CACb,QAAW,UAAQ,EACnB,QAAW,SAAO,EAAE,SAAS,EAC7B,OAAQA,EAAA,WAAW,SAAS,CAC9B,CAAC,CACH,CAAC,CACH,CAAC,CACH,EAEaA,EAAA,6BAAiC,SAAO,CACnD,IAAO,SAAO,EACd,aAAgB,QAAM,CAAG,SAAO,EAAK,OAAK,CAAC,CAAC,CAC9C,CAAC,EAWYA,EAAA,wBAA4B,SAAO,CAC9C,GAAM,SAAO,EAKb,WAAc,SAAO,EAAE,SAAS,EAChC,WAAc,SAAO,EACrB,KAAQ,SAAO,EACf,iBAAoB,QAAM,CAAG,SAAO,EAAK,OAAK,CAAC,CAAC,EAChD,MAAS,QAAM,CAACA,EAAA,6BAAgC,OAAK,CAAC,CAAC,EACvD,MAAS,SAAO,EAChB,SAAY,SAAO,EACnB,eAAkB,QAAM,CAAG,SAAO,EAAK,OAAK,CAAC,CAAC,EAE9C,UAAa,UAAQ,EACrB,aAAgB,SAAO,EACvB,YAAe,UAAQ,EACvB,UAAa,UAAQ,EAErB,UAAa,UAAQ,EAKrB,MAAS,UAAQ,EAAE,SAAS,CAC9B,CAAC,EAGYA,EAAA,0BAA8B,SAAO,CAChD,MAAS,QAAMA,EAAA,uBAAuB,EACtC,WAAc,SAAO,CACvB,CAAC,IAzJcA,IAAA","names":["z","BitsnapModels"]}
package/dist/returns.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKKOIDDOWjs = require('./chunk-KKOIDDOW.js');var _chunkGTOZ5BZXjs = require('./chunk-GTOZ5BZX.js');require('./chunk-KOYBZORL.js');var _chunkQQDZIVWYjs = require('./chunk-QQDZIVWY.js');require('./chunk-EJRI366W.js');require('./chunk-PVJ2I46C.js');require('./chunk-W3RGQYPD.js');require('./chunk-JSDGZ4NY.js');exports.BitsnapReturns = _chunkKKOIDDOWjs.a; exports.BitsnapReturnsProvider = _chunkGTOZ5BZXjs.l; exports.Environment = _chunkQQDZIVWYjs.h; exports.RETURNS_SLOT_NAMES = _chunkGTOZ5BZXjs.c; exports.ReturnsAppearanceProvider = _chunkGTOZ5BZXjs.d; exports.ReturnsCodeStep = _chunkGTOZ5BZXjs.u; exports.ReturnsConfirmation = _chunkGTOZ5BZXjs.x; exports.ReturnsEmailStep = _chunkGTOZ5BZXjs.t; exports.ReturnsMyReturnDetail = _chunkGTOZ5BZXjs.A; exports.ReturnsMyReturnsList = _chunkGTOZ5BZXjs.z; exports.ReturnsOrderDetail = _chunkGTOZ5BZXjs.w; exports.ReturnsOrderList = _chunkGTOZ5BZXjs.v; exports.ReturnsProvider = _chunkGTOZ5BZXjs.k; exports.ReturnsResult = _chunkGTOZ5BZXjs.y; exports.useCreateReturn = _chunkGTOZ5BZXjs.p; exports.useMyReturn = _chunkGTOZ5BZXjs.r; exports.useMyReturns = _chunkGTOZ5BZXjs.q; exports.useReturnOrders = _chunkGTOZ5BZXjs.n; exports.useReturnSession = _chunkGTOZ5BZXjs.m; exports.useReturnableOrder = _chunkGTOZ5BZXjs.o; exports.useReturnsAppearance = _chunkGTOZ5BZXjs.e; exports.useReturnsSlot = _chunkGTOZ5BZXjs.f; exports.useReturnsText = _chunkGTOZ5BZXjs.i;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkLL7ASBGYjs = require('./chunk-LL7ASBGY.js');var _chunkQERYM7RCjs = require('./chunk-QERYM7RC.js');require('./chunk-KOYBZORL.js');var _chunkWPOXLITYjs = require('./chunk-WPOXLITY.js');require('./chunk-GXUNRJ5S.js');require('./chunk-GQJDFLSL.js');require('./chunk-7RXW6XFY.js');require('./chunk-W3RGQYPD.js');require('./chunk-JSDGZ4NY.js');exports.BitsnapReturns = _chunkLL7ASBGYjs.a; exports.BitsnapReturnsProvider = _chunkQERYM7RCjs.l; exports.Environment = _chunkWPOXLITYjs.h; exports.RETURNS_SLOT_NAMES = _chunkQERYM7RCjs.c; exports.ReturnsAppearanceProvider = _chunkQERYM7RCjs.d; exports.ReturnsCodeStep = _chunkQERYM7RCjs.u; exports.ReturnsConfirmation = _chunkQERYM7RCjs.x; exports.ReturnsEmailStep = _chunkQERYM7RCjs.t; exports.ReturnsMyReturnDetail = _chunkQERYM7RCjs.A; exports.ReturnsMyReturnsList = _chunkQERYM7RCjs.z; exports.ReturnsOrderDetail = _chunkQERYM7RCjs.w; exports.ReturnsOrderList = _chunkQERYM7RCjs.v; exports.ReturnsProvider = _chunkQERYM7RCjs.k; exports.ReturnsResult = _chunkQERYM7RCjs.y; exports.useCreateReturn = _chunkQERYM7RCjs.p; exports.useMyReturn = _chunkQERYM7RCjs.r; exports.useMyReturns = _chunkQERYM7RCjs.q; exports.useReturnOrders = _chunkQERYM7RCjs.n; exports.useReturnSession = _chunkQERYM7RCjs.m; exports.useReturnableOrder = _chunkQERYM7RCjs.o; exports.useReturnsAppearance = _chunkQERYM7RCjs.e; exports.useReturnsSlot = _chunkQERYM7RCjs.f; exports.useReturnsText = _chunkQERYM7RCjs.i;
2
2
  //# sourceMappingURL=returns.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/dx/dist/returns.js"],"names":[],"mappings":"AAAA,+HAAuC,sDAAoL,+BAA4B,sDAAwC,+BAA4B,+BAA4B,+BAA4B,+BAA4B,kkCAA4gB","file":"/home/emems/.t3/worktrees/bitsnap-react/dx/dist/returns.js"}
1
+ {"version":3,"sources":["/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/returns.js"],"names":[],"mappings":"AAAA,+HAAuC,sDAAoL,+BAA4B,sDAAwC,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,kkCAA4gB","file":"/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/returns.js"}
package/dist/returns.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{a as L}from"./chunk-ONTCJSSD.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-4TZAGNEU.mjs";import"./chunk-KOVKUJAW.mjs";import{h as e}from"./chunk-L7LZG6MR.mjs";import"./chunk-TBYY3RL2.mjs";import"./chunk-JZBU5SZJ.mjs";import"./chunk-MDCP5JNP.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};
1
+ import{a as L}from"./chunk-I3QXJJ7U.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-QXGK337V.mjs";import"./chunk-KOVKUJAW.mjs";import{h as e}from"./chunk-AGYS7Z6G.mjs";import"./chunk-5R6AGO3Z.mjs";import"./chunk-SXKJ26OA.mjs";import"./chunk-QQQ2JSPQ.mjs";import"./chunk-VNYHJT6V.mjs";import"./chunk-MDCP5JNP.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
@@ -0,0 +1,2 @@
1
+ .bitsnap-react #audio-player-container{--seek-before-width: 0%;--buffered-width: 0%}.bitsnap-react input[type=range]{position:relative;-webkit-appearance:none;width:100%;margin:0;padding:0;height:19px;float:left;outline:none;background:transparent}.bitsnap-react input[type=range]::-webkit-slider-runnable-track{width:100%;height:3px;cursor:pointer;background:#d9d9d9}.bitsnap-react input[type=range]:before{position:absolute;content:"";top:8px;left:0;width:var(--seek-before-width);height:3px;background-color:#8c8c8c;cursor:pointer}.bitsnap-react input[type=range]::-webkit-slider-thumb{position:relative;-webkit-appearance:none;box-sizing:content-box;border:1px solid #d9d9d9;height:15px;width:15px;border-radius:50%;background-color:#8c8c8c;cursor:pointer;margin:-7px 0 0}.bitsnap-react input[type=range]:active::-webkit-slider-thumb{transform:scale(1.2);background:#e2e8f0}.bitsnap-react input[type=range]::-moz-range-track{width:100%;height:3px;cursor:pointer;background:linear-gradient(to right,rgba(0,125,181,.6) var(--buffered-width),rgba(0,125,181,.2) var(--buffered-width))}.bitsnap-react input[type=range]::-moz-range-progress{background-color:#007db5}.bitsnap-react input[type=range]::-moz-focus-outer{border:0}.bitsnap-react input[type=range]::-moz-range-thumb{box-sizing:content-box;border:1px solid #007db5;height:15px;width:15px;border-radius:50%;background-color:#fff;cursor:pointer}.bitsnap-react input[type=range]:active::-moz-range-thumb{transform:scale(1.2);background:#007db5}.bitsnap-react input[type=range]::-ms-track{width:100%;height:3px;cursor:pointer;background:transparent;border:solid transparent;color:transparent}.bitsnap-react input[type=range]::-ms-fill-lower{background-color:#007db5}.bitsnap-react input[type=range]::-ms-fill-upper{background:linear-gradient(to right,rgba(0,125,181,.6) var(--buffered-width),rgba(0,125,181,.2) var(--buffered-width))}.bitsnap-react input[type=range]::-ms-thumb{box-sizing:content-box;border:1px solid #007db5;height:15px;width:15px;border-radius:50%;background-color:#fff;cursor:pointer}.bitsnap-react input[type=range]:active::-ms-thumb{transform:scale(1.2);background:#007db5}.bitsnap-react .SliderRoot{position:relative;display:flex;align-items:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:none;width:200px;height:20px}.bitsnap-react .SliderTrack{background-color:var(--black-a10);position:relative;flex-grow:1;border-radius:9999px;height:3px}.bitsnap-react .SliderRange{position:absolute;background-color:#fff;border-radius:9999px;height:100%}.bitsnap-react .SliderThumb{display:block;width:20px;height:20px;background-color:#fff;box-shadow:0 2px 10px var(--black-a7);border-radius:10px}.bitsnap-react .SliderThumb:hover{background-color:var(--violet-3)}.bitsnap-react .SliderThumb:focus{outline:none;box-shadow:0 0 0 5px var(--black-a8)}
2
+ /*# sourceMappingURL=viewer3d.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/panel/audio-player/audio-player.css"],"sourcesContent":[".bitsnap-react #audio-player-container {\n --seek-before-width: 0%;\n --buffered-width: 0%;\n}\n\n.bitsnap-react input[type=\"range\"] {\n position: relative;\n -webkit-appearance: none;\n width: 100%;\n margin: 0;\n padding: 0;\n height: 19px;\n float: left;\n outline: none;\n background: transparent;\n}\n.bitsnap-react input[type=\"range\"]::-webkit-slider-runnable-track {\n width: 100%;\n height: 3px;\n cursor: pointer;\n /*background: linear-gradient(to right, rgba(0, 125, 181, 0.6) var(--buffered-width), rgba(0, 125, 181, 0.2) var(--buffered-width));*/\n background: #d9d9d9;\n}\n.bitsnap-react input[type=\"range\"]::before {\n position: absolute;\n content: \"\";\n top: 8px;\n left: 0;\n width: var(--seek-before-width);\n height: 3px;\n background-color: #8c8c8c;\n cursor: pointer;\n}\n.bitsnap-react input[type=\"range\"]::-webkit-slider-thumb {\n position: relative;\n -webkit-appearance: none;\n box-sizing: content-box;\n border: 1px solid #d9d9d9;\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background-color: #8c8c8c;\n cursor: pointer;\n margin: -7px 0 0 0;\n}\n.bitsnap-react input[type=\"range\"]:active::-webkit-slider-thumb {\n transform: scale(1.2);\n background: #e2e8f0;\n}\n.bitsnap-react input[type=\"range\"]::-moz-range-track {\n width: 100%;\n height: 3px;\n cursor: pointer;\n background: linear-gradient(\n to right,\n rgba(0, 125, 181, 0.6) var(--buffered-width),\n rgba(0, 125, 181, 0.2) var(--buffered-width)\n );\n}\n.bitsnap-react input[type=\"range\"]::-moz-range-progress {\n background-color: #007db5;\n}\n.bitsnap-react input[type=\"range\"]::-moz-focus-outer {\n border: 0;\n}\n.bitsnap-react input[type=\"range\"]::-moz-range-thumb {\n box-sizing: content-box;\n border: 1px solid #007db5;\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background-color: #fff;\n cursor: pointer;\n}\n.bitsnap-react input[type=\"range\"]:active::-moz-range-thumb {\n transform: scale(1.2);\n background: #007db5;\n}\n.bitsnap-react input[type=\"range\"]::-ms-track {\n width: 100%;\n height: 3px;\n cursor: pointer;\n background: transparent;\n border: solid transparent;\n color: transparent;\n}\n.bitsnap-react input[type=\"range\"]::-ms-fill-lower {\n background-color: #007db5;\n}\n.bitsnap-react input[type=\"range\"]::-ms-fill-upper {\n background: linear-gradient(\n to right,\n rgba(0, 125, 181, 0.6) var(--buffered-width),\n rgba(0, 125, 181, 0.2) var(--buffered-width)\n );\n}\n.bitsnap-react input[type=\"range\"]::-ms-thumb {\n box-sizing: content-box;\n border: 1px solid #007db5;\n height: 15px;\n width: 15px;\n border-radius: 50%;\n background-color: #fff;\n cursor: pointer;\n}\n.bitsnap-react input[type=\"range\"]:active::-ms-thumb {\n transform: scale(1.2);\n background: #007db5;\n}\n\n.bitsnap-react .SliderRoot {\n position: relative;\n display: flex;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n touch-action: none;\n width: 200px;\n height: 20px;\n}\n\n.bitsnap-react .SliderTrack {\n background-color: var(--black-a10);\n position: relative;\n flex-grow: 1;\n border-radius: 9999px;\n height: 3px;\n}\n\n.bitsnap-react .SliderRange {\n position: absolute;\n background-color: white;\n border-radius: 9999px;\n height: 100%;\n}\n\n.bitsnap-react .SliderThumb {\n display: block;\n width: 20px;\n height: 20px;\n background-color: white;\n box-shadow: 0 2px 10px var(--black-a7);\n border-radius: 10px;\n}\n.bitsnap-react .SliderThumb:hover {\n background-color: var(--violet-3);\n}\n.bitsnap-react .SliderThumb:focus {\n outline: none;\n box-shadow: 0 0 0 5px var(--black-a8);\n}\n"],"mappings":"AAAA,CAAC,cAAc,CAAC,uBACd,qBAAqB,GACrB,kBAAkB,EACpB,CAEA,CALC,cAKc,KAAK,CAAC,YACnB,SAAU,SACV,mBAAoB,KACpB,MAAO,KART,OASU,EATV,QAUW,EACT,OAAQ,KACR,MAAO,KACP,QAAS,KACT,WAAY,WACd,CACA,CAhBC,cAgBc,KAAK,CAAC,WAAa,gCAChC,MAAO,KACP,OAAQ,IACR,OAAQ,QAER,WAAY,OACd,CACA,CAvBC,cAuBc,KAAK,CAAC,WAAa,QAChC,SAAU,SACV,QAAS,GACT,IAAK,IACL,KAAM,EACN,MAAO,IAAI,qBACX,OAAQ,IACR,iBAAkB,QAClB,OAAQ,OACV,CACA,CAjCC,cAiCc,KAAK,CAAC,WAAa,uBAChC,SAAU,SACV,mBAAoB,KACpB,WAAY,YACZ,OAAQ,IAAI,MAAM,QAClB,OAAQ,KACR,MAAO,KAvCT,cAwCiB,IACf,iBAAkB,QAClB,OAAQ,QA1CV,OA2CU,KAAK,EAAE,CACjB,CACA,CA7CC,cA6Cc,KAAK,CAAC,WAAa,OAAO,uBACvC,UAAW,MAAM,KACjB,WAAY,OACd,CACA,CAjDC,cAiDc,KAAK,CAAC,WAAa,mBAChC,MAAO,KACP,OAAQ,IACR,OAAQ,QACR,WAAY,gBACV,GAAG,KAAK,CACR,KAAK,CAAC,CAAE,GAAG,CAAE,GAAG,CAAE,IAAK,IAAI,iBAAiB,CAC5C,KAAK,CAAC,CAAE,GAAG,CAAE,GAAG,CAAE,IAAK,IAAI,kBAE/B,CACA,CA3DC,cA2Dc,KAAK,CAAC,WAAa,sBAChC,iBAAkB,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C,cAyIc,CAAC,YACd,QAAS,MACT,MAAO,KACP,OAAQ,KACR,iBAAkB,KAClB,WAAY,EAAE,IAAI,KAAK,IAAI,YA9I7B,cA+IiB,IACjB,CACA,CAjJC,cAiJc,CARC,WAQW,OACzB,iBAAkB,IAAI,WACxB,CACA,CApJC,cAoJc,CAXC,WAWW,OACzB,QAAS,KACT,WAAY,EAAE,EAAE,EAAE,IAAI,IAAI,WAC5B","names":[]}
@@ -0,0 +1,318 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode, CSSProperties, ComponentType } from 'react';
3
+
4
+ /**
5
+ * What the 3D viewer needs about one ready model. The Bitsnap backend sends it
6
+ * as `model3d` on a product and on each variant of
7
+ * `GET /api/integrations/{projectID}/public-commerce/products?include=model3d`.
8
+ * Public data only: no keys, no asset id, never the original file.
9
+ */
10
+ type Model3DUnit = "meters" | "centimeters" | "millimeters" | "inches";
11
+ type Model3DFacts = {
12
+ /** Bytes of the original file. */
13
+ fileSize: number;
14
+ triangleCount: number;
15
+ /** x, y, z in millimetres; empty when unknown. */
16
+ dimensionsMm: number[];
17
+ /** The unit the merchant made the model in; dimensions are shown in it. */
18
+ unit: Model3DUnit;
19
+ };
20
+ type Model3DView = {
21
+ /** Display copy (GLB) on the Bitsnap file host. */
22
+ previewUrl: string;
23
+ /** Bytes of the display copy; over 10 MB it loads only on a click. */
24
+ previewSize: number;
25
+ thumbnailUrl?: string;
26
+ /** The product does not sell the file: the viewer shows the "illustrative" note. */
27
+ illustrative: boolean;
28
+ /** Only when the merchant turned the model facts on. */
29
+ facts?: Model3DFacts;
30
+ };
31
+
32
+ /**
33
+ * The public product data the 3D viewer reads:
34
+ * `GET {host}/api/integrations/{projectID}/public-commerce/products?ids=…&include=model3d`,
35
+ * the endpoint the cart already uses. Servers without 3D support ignore
36
+ * `include` and send no `model3d`: the viewer then shows nothing.
37
+ */
38
+ type Product3DVariant = {
39
+ id: string;
40
+ name: string;
41
+ /** Minor units (grosze, cents). */
42
+ price: number;
43
+ currency: string;
44
+ availableQuantity?: number;
45
+ priceType?: string;
46
+ model3d?: Model3DView;
47
+ };
48
+ type Product3DProduct = {
49
+ id: string;
50
+ name: string;
51
+ price: number;
52
+ currency: string;
53
+ availableQuantity?: number;
54
+ priceType?: string;
55
+ recurring?: unknown;
56
+ model3d?: Model3DView;
57
+ variants?: Product3DVariant[];
58
+ };
59
+ type Product3DQuery = {
60
+ projectID: string;
61
+ /** Origin of the Bitsnap backend (or of a custom domain), without a path. */
62
+ host: string;
63
+ productId: string;
64
+ locale?: string;
65
+ };
66
+ declare class Product3DError extends Error {
67
+ readonly status: number | undefined;
68
+ constructor(message: string, status?: number);
69
+ }
70
+ declare function buildProduct3DURL(query: Product3DQuery): string;
71
+ /**
72
+ * The model to show: the chosen variant's (the server already gives a variant
73
+ * the product's model when it has none of its own), else the product's, else
74
+ * the first variant with one. A chosen variant without a model shows none.
75
+ */
76
+ declare function resolveModel(product: Product3DProduct, variantId?: string): Model3DView | undefined;
77
+ /**
78
+ * Loads the product with a credential-less `fetch`, once per URL per page
79
+ * (several viewers of one product share the request). A failed request is
80
+ * forgotten so a retry asks again.
81
+ */
82
+ declare function fetchProduct3D(query: Product3DQuery): Promise<Product3DProduct[]>;
83
+
84
+ /**
85
+ * Every string of the 3D viewer. Polish is the default, English for `en*`
86
+ * locales; pass `texts` to `Product3DViewer` to override any of them.
87
+ */
88
+ type Viewer3DCopy = {
89
+ sectionLabel: string;
90
+ show: (size: string) => string;
91
+ heroPill: string;
92
+ heroPillWithSize: (size: string) => string;
93
+ loading: string;
94
+ loadingProgress: (percent: number) => string;
95
+ error: string;
96
+ retry: string;
97
+ unsupported: string;
98
+ hintDrag: string;
99
+ hintTap: string;
100
+ touchDone: string;
101
+ reset: string;
102
+ fullscreen: string;
103
+ closeFullscreen: string;
104
+ disclaimer: string;
105
+ report: string;
106
+ factsTitle: string;
107
+ factsFormat: string;
108
+ factsFileSize: string;
109
+ factsTriangles: string;
110
+ factsDimensions: string;
111
+ triangles: (count: string) => string;
112
+ licence: string;
113
+ licenceShow: string;
114
+ licenceOpen: string;
115
+ licenceClose: string;
116
+ licenceDefaultName: string;
117
+ units: Record<Model3DUnit, string>;
118
+ /** Fullscreen bar: add to the cart. */
119
+ addToCart: string;
120
+ addingToCart: string;
121
+ addedToCart: string;
122
+ addToCartError: string;
123
+ };
124
+ declare const VIEWER3D_COPY_PL: Viewer3DCopy;
125
+ declare const VIEWER3D_COPY_EN: Viewer3DCopy;
126
+
127
+ type Viewer3DProps = {
128
+ url: string;
129
+ /** Draco decoder folder; default: three's decoder on jsDelivr for the installed revision. */
130
+ decoderPath?: string;
131
+ /** Bytes the server reported; the progress total when the response has none. */
132
+ expectedSize: number;
133
+ /** Bumped by the shell on retry; a failed download is not reused. */
134
+ attempt: number;
135
+ /** Rotation may run: on screen, tab visible, no reduced motion. */
136
+ motionAllowed: boolean;
137
+ /** The buyer can drag (on a phone only after a tap, so the page scrolls). */
138
+ interactive: boolean;
139
+ /** Wheel and pinch zoom: full screen and active touch only, so the page keeps its scroll. */
140
+ allowZoom: boolean;
141
+ /** Bumped by "Reset widoku". */
142
+ resetSignal: number;
143
+ onProgress: (loaded: number, total: number) => void;
144
+ /** The first frame with the model is on screen. */
145
+ onLoaded: () => void;
146
+ onError: (error: unknown) => void;
147
+ /** The buyer dragged or zoomed (hides the gesture hint). */
148
+ onInteract: () => void;
149
+ className?: string;
150
+ };
151
+
152
+ /** Theme of the viewer; each value sets one `--bitsnap-viewer3d-*` property. */
153
+ type Viewer3DAppearance = {
154
+ background?: string;
155
+ foreground?: string;
156
+ muted?: string;
157
+ border?: string;
158
+ accent?: string;
159
+ radius?: string;
160
+ };
161
+ type Model3DViewerProps = {
162
+ model: Model3DView;
163
+ /** The product name: the alt text of the poster. */
164
+ productName: string;
165
+ /** `pl-PL` (default) or an `en*` locale. */
166
+ locale?: string;
167
+ /** Overrides of any viewer string. */
168
+ texts?: Partial<Viewer3DCopy>;
169
+ appearance?: Viewer3DAppearance;
170
+ /**
171
+ * Draco decoder folder (trailing slash). Default: three's decoder files on
172
+ * jsDelivr for the installed `three` revision.
173
+ */
174
+ decoderPath?: string;
175
+ /**
176
+ * "Report this model" link (DSA notice form); the viewer adds the page URL
177
+ * as `url`. Absent = no link.
178
+ */
179
+ reportHref?: string;
180
+ /** Bump to start loading now, whatever the size (e.g. from a "View in 3D" button). */
181
+ startSignal?: number;
182
+ /**
183
+ * The bar at the bottom of the full screen view (name, price, buy button).
184
+ * `close` leaves full screen. Absent = no bar.
185
+ */
186
+ renderFullscreenBar?: (args: {
187
+ close: () => void;
188
+ }) => ReactNode;
189
+ /** Hide the notes under the viewer (disclaimer, report link, model facts). */
190
+ hideNotes?: boolean;
191
+ id?: string;
192
+ className?: string;
193
+ style?: CSSProperties;
194
+ /** @internal Tests replace the three viewer. */
195
+ loadViewer?: () => Promise<{
196
+ default: ComponentType<Viewer3DProps>;
197
+ }>;
198
+ };
199
+ /**
200
+ * The 3D viewer of one model, without data fetching (see `Product3DViewer`
201
+ * for the product-id version). No three import: the poster, the states and
202
+ * the controls live here; `Viewer3D` is loaded with `import()` in an effect
203
+ * once the model may load, so the server render and the page's main chunk
204
+ * never touch three.
205
+ */
206
+ declare function Model3DViewer({ model, productName, locale, texts, appearance, decoderPath, reportHref, startSignal, renderFullscreenBar, hideNotes, id, className, style, loadViewer, }: Model3DViewerProps): react_jsx_runtime.JSX.Element;
207
+
208
+ type UseProduct3DModelOptions = {
209
+ /**
210
+ * Project (shop) ID. Defaults to the one set with `setProjectID` from
211
+ * `bitsnap-react`.
212
+ */
213
+ projectID?: string;
214
+ /**
215
+ * Origin of the Bitsnap backend. Defaults to the library host
216
+ * (`https://bitsnap.pl`, or what `setCustomHost` had set). On a custom
217
+ * domain pass the domain itself, or `""` for same-origin requests.
218
+ */
219
+ host?: string;
220
+ /** Locale of the product name. Defaults to the library locale. */
221
+ locale?: string;
222
+ };
223
+ type Product3DStatus =
224
+ /** Waiting for the product (also on the server and the first render). */
225
+ "loading"
226
+ /** `model` is set. */
227
+ | "ready"
228
+ /** The product (or the chosen variant) has no 3D model, or the server has no 3D support. */
229
+ | "none"
230
+ /** The product could not be loaded; `retry()` asks again. */
231
+ | "error";
232
+ type UseProduct3DModelResult = {
233
+ status: Product3DStatus;
234
+ model?: Model3DView;
235
+ /** The product as the public endpoint sent it (name, price, variants). */
236
+ product?: Product3DProduct;
237
+ /** The chosen variant, when `variantId` matches one. */
238
+ variant?: Product3DVariant;
239
+ error?: Error;
240
+ retry: () => void;
241
+ };
242
+ /**
243
+ * The public 3D model of a product (and variant). Fetches in the browser
244
+ * only; switching `variantId` does not fetch again.
245
+ */
246
+ declare function useProduct3DModel(productId: string, variantId?: string, options?: UseProduct3DModelOptions): UseProduct3DModelResult;
247
+
248
+ type Product3DBuyBarArgs = {
249
+ product: Product3DProduct;
250
+ variant?: Product3DVariant;
251
+ /** Leaves full screen (e.g. before the page shows its own error or dialog). */
252
+ close: () => void;
253
+ };
254
+ type Product3DViewerProps = UseProduct3DModelOptions & Omit<Model3DViewerProps, "model" | "productName" | "renderFullscreenBar" | "loadViewer"> & {
255
+ /** Bitsnap product ID (`prodv2_…`), or a variant ID. */
256
+ productId: string;
257
+ /** The variant the page shows; switching it swaps the model in place. */
258
+ variantId?: string;
259
+ /**
260
+ * The bar of the full screen view. Default: name, price and an
261
+ * "Add to cart" button that uses the Bitsnap cart (loaded on the first
262
+ * click). Return `null` for no bar.
263
+ */
264
+ renderBuyBar?: (args: Product3DBuyBarArgs) => ReactNode;
265
+ /** Rendered while loading, when there is no model, and on error. Default: nothing. */
266
+ fallback?: ReactNode;
267
+ /** Product page URL stored with the cart item (default buy bar). */
268
+ productUrl?: string;
269
+ /** Called after the default buy bar added the product. */
270
+ onAddedToCart?: (args: {
271
+ product: Product3DProduct;
272
+ variant?: Product3DVariant;
273
+ }) => void;
274
+ /** @internal Tests replace the three viewer. */
275
+ loadViewer?: Model3DViewerProps["loadViewer"];
276
+ };
277
+ /**
278
+ * The 3D viewer of a Bitsnap product: loads the product's public model and
279
+ * shows it (auto-rotate, click-to-load over 10 MB, reduced motion, full screen
280
+ * with a buy bar, gesture hint). Renders `fallback` (nothing by default) when
281
+ * the product has no ready model or the server has no 3D support.
282
+ *
283
+ * Needs the optional peer dependencies `three`, `@react-three/fiber` and
284
+ * `@react-three/drei`; they load only once the model may be shown.
285
+ */
286
+ declare function Product3DViewer({ productId, variantId, projectID, host, locale, renderBuyBar, fallback, productUrl, onAddedToCart, ...viewer }: Product3DViewerProps): react_jsx_runtime.JSX.Element;
287
+ /** Whether the default bar may add the item straight to the cart. */
288
+ declare function isCartable(product: Product3DProduct, variant: Product3DVariant | undefined): boolean;
289
+ /** The cart id: the chosen variant, else the first (default) variant, else the product. */
290
+ declare function cartItemIdFor(product: Product3DProduct, variant: Product3DVariant | undefined): string;
291
+
292
+ /**
293
+ * Shared numbers of the 3D viewer. No three import: the shell, the hook and
294
+ * the tests use them.
295
+ */
296
+ /**
297
+ * Display copies up to this size load on their own when the viewer scrolls
298
+ * into view; bigger ones wait for "Pokaż model 3D (24 MB)".
299
+ */
300
+ declare const AUTO_LOAD_MAX_BYTES: number;
301
+ /** True when the model must wait for the buyer's click. */
302
+ declare function needsClickToLoad(previewSize: number): boolean;
303
+ /**
304
+ * Default Draco decoder: three's own decoder files on jsDelivr, for the
305
+ * `three` revision the page has installed (`REVISION` "187" → three@0.187.0),
306
+ * so the decoder always matches the loader. jsDelivr answers with
307
+ * `Access-Control-Allow-Origin: *`, which the decoder worker needs on any
308
+ * domain. Pass `decoderPath` to self-host (copy
309
+ * `three/examples/jsm/libs/draco/gltf/` to your site, e.g. `/draco/`).
310
+ */
311
+ declare function defaultDecoderPath(revision: string): string;
312
+ /**
313
+ * "24 MB", "4,2 MB", "820 kB": the size the click-to-load button shows.
314
+ * Decimal for small values only, in the locale's style.
315
+ */
316
+ declare function formatModelSize(bytes: number, locale?: string): string;
317
+
318
+ export { AUTO_LOAD_MAX_BYTES, type Model3DFacts, type Model3DUnit, type Model3DView, Model3DViewer, type Model3DViewerProps, type Product3DBuyBarArgs, Product3DError, type Product3DProduct, type Product3DStatus, type Product3DVariant, Product3DViewer, type Product3DViewerProps, type UseProduct3DModelOptions, type UseProduct3DModelResult, VIEWER3D_COPY_EN, VIEWER3D_COPY_PL, type Viewer3DAppearance, type Viewer3DCopy, buildProduct3DURL, cartItemIdFor, defaultDecoderPath, fetchProduct3D, formatModelSize, isCartable, needsClickToLoad, resolveModel, useProduct3DModel };