@r2u/javascript-ar-sdk 6.22.0 → 6.22.2

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 (180) hide show
  1. package/dist/ar.bundle.js +1 -1
  2. package/dist/assets/icons.js +18 -0
  3. package/dist/assets/icons.js.map +1 -0
  4. package/dist/components/Modal/Canvas/index.js +11 -0
  5. package/dist/components/Modal/Canvas/index.js.map +1 -0
  6. package/dist/components/Modal/Canvas/styles.js +34 -0
  7. package/dist/components/Modal/Canvas/styles.js.map +1 -0
  8. package/dist/components/Modal/Context.js +27 -0
  9. package/dist/components/Modal/Context.js.map +1 -0
  10. package/dist/components/Modal/Feedback/Confirm.js +16 -0
  11. package/dist/components/Modal/Feedback/Confirm.js.map +1 -0
  12. package/dist/components/Modal/Feedback/Main.js +16 -0
  13. package/dist/components/Modal/Feedback/Main.js.map +1 -0
  14. package/dist/components/Modal/Feedback/index.js +31 -0
  15. package/dist/components/Modal/Feedback/index.js.map +1 -0
  16. package/dist/components/Modal/Feedback/styles.js +100 -0
  17. package/dist/components/Modal/Feedback/styles.js.map +1 -0
  18. package/dist/components/Modal/Instructions/index.js +50 -0
  19. package/dist/components/Modal/Instructions/index.js.map +1 -0
  20. package/dist/components/Modal/Instructions/styles.js +137 -0
  21. package/dist/components/Modal/Instructions/styles.js.map +1 -0
  22. package/dist/components/Modal/InstructionsAmericanas/index.js +50 -0
  23. package/dist/components/Modal/InstructionsAmericanas/index.js.map +1 -0
  24. package/dist/components/Modal/InstructionsAmericanas/styles.js +116 -0
  25. package/dist/components/Modal/InstructionsAmericanas/styles.js.map +1 -0
  26. package/dist/components/Modal/InstructionsMolduraMinuto/index.js +103 -0
  27. package/dist/components/Modal/InstructionsMolduraMinuto/index.js.map +1 -0
  28. package/dist/components/Modal/InstructionsMolduraMinuto/styles.js +77 -0
  29. package/dist/components/Modal/InstructionsMolduraMinuto/styles.js.map +1 -0
  30. package/dist/components/Modal/InstructionsYDigital/index.js +50 -0
  31. package/dist/components/Modal/InstructionsYDigital/index.js.map +1 -0
  32. package/dist/components/Modal/InstructionsYDigital/styles.js +137 -0
  33. package/dist/components/Modal/InstructionsYDigital/styles.js.map +1 -0
  34. package/dist/components/Modal/InstructionsYDigitalVideo/index.js +44 -0
  35. package/dist/components/Modal/InstructionsYDigitalVideo/index.js.map +1 -0
  36. package/dist/components/Modal/InstructionsYDigitalVideo/styles.js +137 -0
  37. package/dist/components/Modal/InstructionsYDigitalVideo/styles.js.map +1 -0
  38. package/dist/components/Modal/Social/index.js +20 -0
  39. package/dist/components/Modal/Social/index.js.map +1 -0
  40. package/dist/components/Modal/Social/styles.js +85 -0
  41. package/dist/components/Modal/Social/styles.js.map +1 -0
  42. package/dist/components/Modal/Viewer/index.js +26 -0
  43. package/dist/components/Modal/Viewer/index.js.map +1 -0
  44. package/dist/components/Modal/Viewer/styles.js +56 -0
  45. package/dist/components/Modal/Viewer/styles.js.map +1 -0
  46. package/dist/components/Modal/ViewerFull/index.js +15 -0
  47. package/dist/components/Modal/ViewerFull/index.js.map +1 -0
  48. package/dist/components/Modal/ViewerFull/styles.js +12 -0
  49. package/dist/components/Modal/ViewerFull/styles.js.map +1 -0
  50. package/dist/components/R2UModelViewer/ProgressBar/index.js +9 -0
  51. package/dist/components/R2UModelViewer/ProgressBar/index.js.map +1 -0
  52. package/dist/components/R2UModelViewer/ProgressBar/styles.js +54 -0
  53. package/dist/components/R2UModelViewer/ProgressBar/styles.js.map +1 -0
  54. package/dist/components/R2UModelViewer/ProgressBar/types.js +1 -0
  55. package/dist/components/R2UModelViewer/ProgressBar/types.js.map +1 -0
  56. package/dist/components/R2UModelViewer/index.js +63 -0
  57. package/dist/components/R2UModelViewer/index.js.map +1 -0
  58. package/dist/components/R2UModelViewer/styles.js +128 -0
  59. package/dist/components/R2UModelViewer/styles.js.map +1 -0
  60. package/dist/components/WaterMark/index.js +9 -0
  61. package/dist/components/WaterMark/index.js.map +1 -0
  62. package/dist/components/WaterMark/styles.js +26 -0
  63. package/dist/components/WaterMark/styles.js.map +1 -0
  64. package/dist/config/i18n.js +69 -0
  65. package/dist/config/i18n.js.map +1 -0
  66. package/dist/error/ViewerError.js +7 -0
  67. package/dist/error/ViewerError.js.map +1 -0
  68. package/dist/fonts/index.js +9 -0
  69. package/dist/fonts/index.js.map +1 -0
  70. package/dist/{src/index.d.ts → index.d.ts} +1 -1
  71. package/dist/index.js +25 -1
  72. package/dist/index.js.map +1 -0
  73. package/dist/init.bundle.js +1 -1
  74. package/dist/locales/en/translation.json +36 -0
  75. package/dist/methods/analytics.js +17 -0
  76. package/dist/methods/analytics.js.map +1 -0
  77. package/dist/methods/ar.js +372 -0
  78. package/dist/methods/ar.js.map +1 -0
  79. package/dist/methods/config.js +40 -0
  80. package/dist/methods/config.js.map +1 -0
  81. package/dist/methods/init.js +51 -0
  82. package/dist/methods/init.js.map +1 -0
  83. package/dist/methods/qrCode.js +48 -0
  84. package/dist/methods/qrCode.js.map +1 -0
  85. package/dist/{src/methods → methods}/sku.d.ts +1 -1
  86. package/dist/methods/sku.js +47 -0
  87. package/dist/methods/sku.js.map +1 -0
  88. package/dist/methods/types.js +1 -0
  89. package/dist/methods/types.js.map +1 -0
  90. package/dist/methods/viewer.js +310 -0
  91. package/dist/methods/viewer.js.map +1 -0
  92. package/dist/screens/Fallback/index.js +22 -0
  93. package/dist/screens/Fallback/index.js.map +1 -0
  94. package/dist/{src/screens → screens}/Feedback/index.d.ts +1 -1
  95. package/dist/screens/Feedback/index.js +21 -0
  96. package/dist/screens/Feedback/index.js.map +1 -0
  97. package/dist/{src/screens → screens}/Instructions/index.d.ts +1 -1
  98. package/dist/screens/Instructions/index.js +48 -0
  99. package/dist/screens/Instructions/index.js.map +1 -0
  100. package/dist/screens/Social/index.js +9 -0
  101. package/dist/screens/Social/index.js.map +1 -0
  102. package/dist/services/analytics.js +219 -0
  103. package/dist/services/analytics.js.map +1 -0
  104. package/dist/services/constants.js +65 -0
  105. package/dist/services/constants.js.map +1 -0
  106. package/dist/services/cookies.js +19 -0
  107. package/dist/services/cookies.js.map +1 -0
  108. package/dist/services/customer.js +17 -0
  109. package/dist/services/customer.js.map +1 -0
  110. package/dist/services/customization.js +73 -0
  111. package/dist/services/customization.js.map +1 -0
  112. package/dist/services/product.js +49 -0
  113. package/dist/services/product.js.map +1 -0
  114. package/dist/services/requests.js +55 -0
  115. package/dist/services/requests.js.map +1 -0
  116. package/dist/sku.bundle.js +1 -1
  117. package/dist/{src/state.d.ts → state.d.ts} +1 -1
  118. package/dist/state.js +23 -0
  119. package/dist/state.js.map +1 -0
  120. package/dist/types/Viewer.js +1 -0
  121. package/dist/types/Viewer.js.map +1 -0
  122. package/dist/types/index.js +1 -0
  123. package/dist/types/index.js.map +1 -0
  124. package/dist/utils/sortCustomization.js +10 -0
  125. package/dist/utils/sortCustomization.js.map +1 -0
  126. package/dist/{vendors.fe050b32669a2a3c34a3.bundle.js → vendors.7d567adcf040d43f7345.bundle.js} +1 -1
  127. package/package.json +5 -3
  128. /package/dist/{src/assets → assets}/icons.d.ts +0 -0
  129. /package/dist/{src/components → components}/Modal/Canvas/index.d.ts +0 -0
  130. /package/dist/{src/components → components}/Modal/Canvas/styles.d.ts +0 -0
  131. /package/dist/{src/components → components}/Modal/Context.d.ts +0 -0
  132. /package/dist/{src/components → components}/Modal/Feedback/Confirm.d.ts +0 -0
  133. /package/dist/{src/components → components}/Modal/Feedback/Main.d.ts +0 -0
  134. /package/dist/{src/components → components}/Modal/Feedback/index.d.ts +0 -0
  135. /package/dist/{src/components → components}/Modal/Feedback/styles.d.ts +0 -0
  136. /package/dist/{src/components → components}/Modal/Instructions/index.d.ts +0 -0
  137. /package/dist/{src/components → components}/Modal/Instructions/styles.d.ts +0 -0
  138. /package/dist/{src/components → components}/Modal/InstructionsAmericanas/index.d.ts +0 -0
  139. /package/dist/{src/components → components}/Modal/InstructionsAmericanas/styles.d.ts +0 -0
  140. /package/dist/{src/components → components}/Modal/InstructionsMolduraMinuto/index.d.ts +0 -0
  141. /package/dist/{src/components → components}/Modal/InstructionsMolduraMinuto/styles.d.ts +0 -0
  142. /package/dist/{src/components → components}/Modal/InstructionsYDigital/index.d.ts +0 -0
  143. /package/dist/{src/components → components}/Modal/InstructionsYDigital/styles.d.ts +0 -0
  144. /package/dist/{src/components → components}/Modal/InstructionsYDigitalVideo/index.d.ts +0 -0
  145. /package/dist/{src/components → components}/Modal/InstructionsYDigitalVideo/styles.d.ts +0 -0
  146. /package/dist/{src/components → components}/Modal/Social/index.d.ts +0 -0
  147. /package/dist/{src/components → components}/Modal/Social/styles.d.ts +0 -0
  148. /package/dist/{src/components → components}/Modal/Viewer/index.d.ts +0 -0
  149. /package/dist/{src/components → components}/Modal/Viewer/styles.d.ts +0 -0
  150. /package/dist/{src/components → components}/Modal/ViewerFull/index.d.ts +0 -0
  151. /package/dist/{src/components → components}/Modal/ViewerFull/styles.d.ts +0 -0
  152. /package/dist/{src/components → components}/R2UModelViewer/ProgressBar/index.d.ts +0 -0
  153. /package/dist/{src/components → components}/R2UModelViewer/ProgressBar/styles.d.ts +0 -0
  154. /package/dist/{src/components → components}/R2UModelViewer/ProgressBar/types.d.ts +0 -0
  155. /package/dist/{src/components → components}/R2UModelViewer/index.d.ts +0 -0
  156. /package/dist/{src/components → components}/R2UModelViewer/styles.d.ts +0 -0
  157. /package/dist/{src/components → components}/WaterMark/index.d.ts +0 -0
  158. /package/dist/{src/components → components}/WaterMark/styles.d.ts +0 -0
  159. /package/dist/{src/config → config}/i18n.d.ts +0 -0
  160. /package/dist/{src/error → error}/ViewerError.d.ts +0 -0
  161. /package/dist/{src/fonts → fonts}/index.d.ts +0 -0
  162. /package/dist/{src/methods → methods}/analytics.d.ts +0 -0
  163. /package/dist/{src/methods → methods}/ar.d.ts +0 -0
  164. /package/dist/{src/methods → methods}/config.d.ts +0 -0
  165. /package/dist/{src/methods → methods}/init.d.ts +0 -0
  166. /package/dist/{src/methods → methods}/qrCode.d.ts +0 -0
  167. /package/dist/{src/methods → methods}/types.d.ts +0 -0
  168. /package/dist/{src/methods → methods}/viewer.d.ts +0 -0
  169. /package/dist/{src/screens → screens}/Fallback/index.d.ts +0 -0
  170. /package/dist/{src/screens → screens}/Social/index.d.ts +0 -0
  171. /package/dist/{src/services → services}/analytics.d.ts +0 -0
  172. /package/dist/{src/services → services}/constants.d.ts +0 -0
  173. /package/dist/{src/services → services}/cookies.d.ts +0 -0
  174. /package/dist/{src/services → services}/customer.d.ts +0 -0
  175. /package/dist/{src/services → services}/customization.d.ts +0 -0
  176. /package/dist/{src/services → services}/product.d.ts +0 -0
  177. /package/dist/{src/services → services}/requests.d.ts +0 -0
  178. /package/dist/{src/types → types}/Viewer.d.ts +0 -0
  179. /package/dist/{src/types → types}/index.d.ts +0 -0
  180. /package/dist/{src/utils → utils}/sortCustomization.d.ts +0 -0
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { Icon } from './styles';
3
+ const WaterMark = ({ position }) => {
4
+ return (React.createElement(Icon, { position: position },
5
+ React.createElement("a", { href: "https://r2u.io", target: "_blank", rel: "noopener noreferrer" },
6
+ React.createElement("img", { alt: "" }))));
7
+ };
8
+ export default WaterMark;
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/WaterMark/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAM/B,MAAM,SAAS,GAAoB,CAAC,EAAE,QAAQ,EAAS,EAAE,EAAE;IACzD,OAAO,CACL,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ;QACtB,2BAAG,IAAI,EAAC,gBAAgB,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB;YAChE,6BAAK,GAAG,EAAC,EAAE,GAAG,CACZ,CACC,CACR,CAAA;AACH,CAAC,CAAA;AAED,eAAe,SAAS,CAAA"}
@@ -0,0 +1,26 @@
1
+ /* eslint-disable @typescript-eslint/explicit-function-return-type */
2
+ import styled, { css } from 'styled-components';
3
+ export const Icon = styled.div `
4
+ a {
5
+ content: url('https://sdk.r2u.io/assets/r2u-icon-gray.svg');
6
+ height: 22px;
7
+ position: absolute;
8
+ z-index: 999999;
9
+ margin: 10px;
10
+ ${(props) => {
11
+ const position = props.position ? props.position.toLowerCase() : '';
12
+ return css `
13
+ ${position.includes('left') && 'left: 0;'}
14
+ ${position.includes('right') && 'right: 0;'}
15
+ ${position.includes('bottom') && 'bottom: 0;'}
16
+ ${position.includes('top') && 'top: 0;'}
17
+ ${position.includes('center') && 'left: 0; right: 0; margin: auto;'}
18
+ ${position.includes('absolute') && 'position: absolute;'}
19
+ `;
20
+ }};
21
+ }
22
+ a:hover {
23
+ content: url('https://sdk.r2u.io/assets/r2u-icon.svg');
24
+ }
25
+ `;
26
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/WaterMark/styles.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAM/C,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAgB;;;;;;;MAOxC,CAAC,KAAK,EAAE,EAAE;IACV,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IACnE,OAAO,GAAG,CAAA;UACN,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,UAAU;UACvC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,WAAW;UACzC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,YAAY;UAC3C,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,SAAS;UACrC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,kCAAkC;UACjE,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,qBAAqB;OACzD,CAAA;AACH,CAAC;;;;;CAKJ,CAAA"}
@@ -0,0 +1,69 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import i18next from 'i18next';
11
+ import ChainedBackend from 'i18next-chained-backend';
12
+ import HttpBackend from 'i18next-http-backend';
13
+ import LocalStorageBackend from 'i18next-localstorage-backend';
14
+ import { getRoute } from '../services/requests';
15
+ import state from '../state';
16
+ export const i18nInstance = i18next.createInstance();
17
+ export const init = ({ language }) => __awaiter(void 0, void 0, void 0, function* () {
18
+ const customerLng = state.customer.language;
19
+ const customerNS = state.customer.slug;
20
+ const lng = language || customerLng || 'en';
21
+ const route = getRoute();
22
+ // const nsFileExists = await fileExists(
23
+ // `${route}/locales/${lng}/${customerNS}.json`
24
+ // )
25
+ const nsFileExists = false;
26
+ const defaultNS = nsFileExists ? customerNS : 'translation';
27
+ const ns = ['translation', ...(nsFileExists ? [customerNS] : [])];
28
+ return new Promise((resolve, reject) => {
29
+ i18nInstance.use(ChainedBackend).init({
30
+ debug: process.env.NODE_ENV === 'development',
31
+ react: {
32
+ useSuspense: false,
33
+ },
34
+ lng,
35
+ fallbackLng: false,
36
+ supportedLngs: ['pt', 'en', 'es'],
37
+ ns,
38
+ defaultNS,
39
+ fallbackNS: 'translation',
40
+ load: 'currentOnly',
41
+ preload: [lng],
42
+ interpolation: {
43
+ escapeValue: false,
44
+ },
45
+ backend: {
46
+ backends: [LocalStorageBackend, HttpBackend],
47
+ backendOptions: [
48
+ {
49
+ prefix: 'i18next_res_r2u_sdk_',
50
+ enabled: process.env.NODE_ENV !== 'development',
51
+ expirationTime: 7 * 24 * 60 * 60 * 1000,
52
+ },
53
+ {
54
+ loadPath: `${route}/locales/{{lng}}/{{ns}}.json`,
55
+ allowMultiloading: true,
56
+ },
57
+ ],
58
+ },
59
+ }, (err) => {
60
+ if (err)
61
+ reject(new Error('R2U - Translation init failed'));
62
+ resolve();
63
+ });
64
+ });
65
+ });
66
+ export default {
67
+ init,
68
+ };
69
+ //# sourceMappingURL=i18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/config/i18n.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,cAAc,MAAM,yBAAyB,CAAA;AACpD,OAAO,WAAW,MAAM,sBAAsB,CAAA;AAC9C,OAAO,mBAAmB,MAAM,8BAA8B,CAAA;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,KAAK,MAAM,UAAU,CAAA;AAc5B,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,EAAE,CAAA;AAEpD,MAAM,CAAC,MAAM,IAAI,GAAG,CAAO,EAAE,QAAQ,EAAS,EAAiB,EAAE;IAC/D,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAA;IAC3C,MAAM,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAA;IACtC,MAAM,GAAG,GAAG,QAAQ,IAAI,WAAW,IAAI,IAAI,CAAA;IAE3C,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IAExB,yCAAyC;IACzC,iDAAiD;IACjD,IAAI;IACJ,MAAM,YAAY,GAAG,KAAK,CAAA;IAE1B,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,aAAa,CAAA;IAC3D,MAAM,EAAE,GAAG,CAAC,aAAa,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAEjE,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,YAAY,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,IAAI,CACnC;YACE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa;YAC7C,KAAK,EAAE;gBACL,WAAW,EAAE,KAAK;aACnB;YACD,GAAG;YACH,WAAW,EAAE,KAAK;YAClB,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;YACjC,EAAE;YACF,SAAS;YACT,UAAU,EAAE,aAAa;YACzB,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,CAAC,GAAG,CAAC;YACd,aAAa,EAAE;gBACb,WAAW,EAAE,KAAK;aACnB;YACD,OAAO,EAAE;gBACP,QAAQ,EAAE,CAAC,mBAAmB,EAAE,WAAW,CAAC;gBAC5C,cAAc,EAAE;oBACd;wBACE,MAAM,EAAE,sBAAsB;wBAC9B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa;wBAC/C,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;qBACxC;oBACD;wBACE,QAAQ,EAAE,GAAG,KAAK,8BAA8B;wBAChD,iBAAiB,EAAE,IAAI;qBACxB;iBACF;aACF;SACF,EACD,CAAC,GAAG,EAAE,EAAE;YACN,IAAI,GAAG;gBAAE,MAAM,CAAC,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC,CAAA;YAC3D,OAAO,EAAE,CAAA;QACX,CAAC,CACF,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA,CAAA;AAED,eAAe;IACb,IAAI;CACL,CAAA"}
@@ -0,0 +1,7 @@
1
+ export class ViewerError extends Error {
2
+ constructor(message) {
3
+ super(message);
4
+ this.name = 'ViewerError';
5
+ }
6
+ }
7
+ //# sourceMappingURL=ViewerError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewerError.js","sourceRoot":"","sources":["../../src/error/ViewerError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,aAAa,CAAA;IAC3B,CAAC;CACF"}
@@ -0,0 +1,9 @@
1
+ import { createGlobalStyle } from 'styled-components';
2
+ import Roboto from './Roboto.ttf';
3
+ export default createGlobalStyle `
4
+ @font-face {
5
+ font-family: 'Roboto';
6
+ src: url(${Roboto}) format('truetype');
7
+ }
8
+ `;
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fonts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,MAAM,MAAM,cAAc,CAAA;AAEjC,eAAe,iBAAiB,CAAA;;;eAGjB,MAAM;;CAEpB,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import type { CallToAction } from '@r2u/react-ar-components';
2
2
  import { SKUHandler, ViewerProps } from './methods/types';
3
- import { Product } from '@services/product';
3
+ import { Product } from './services/product';
4
4
  import { ViewerFunctions } from './methods/viewer';
5
5
  export default interface R2U {
6
6
  init: (params: {
package/dist/index.js CHANGED
@@ -1 +1,25 @@
1
- !function(){"use strict";var e,n,t,r,o={},u={};function i(e){var n=u[e];if(void 0!==n)return n.exports;var t=u[e]={exports:{}};return o[e].call(t.exports,t,t.exports,i),t.exports}i.m=o,i.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(n,{a:n}),n},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},i.t=function(t,r){if(1&r&&(t=this(t)),8&r)return t;if("object"==typeof t&&t){if(4&r&&t.__esModule)return t;if(16&r&&"function"==typeof t.then)return t}var o=Object.create(null);i.r(o);var u={};e=e||[null,n({}),n([]),n(n)];for(var a=2&r&&t;"object"==typeof a&&!~e.indexOf(a);a=n(a))Object.getOwnPropertyNames(a).forEach((function(e){u[e]=function(){return t[e]}}));return u.default=function(){return t},i.d(o,u),o},i.d=function(e,n){for(var t in n)i.o(n,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},i.f={},i.e=function(e){return Promise.all(Object.keys(i.f).reduce((function(n,t){return i.f[t](e,n),n}),[]))},i.u=function(e){return 691===e?"vendors.72e0cdbf51fef996d405.bundle.js":665===e?"vendors.6c46067ffeb7a1054cd1.bundle.js":215===e?"vendors.2864f1aaf3fa743e1983.bundle.js":410===e?"init.bundle.js":497===e?"config.bundle.js":30===e?"vendors.d0043338c48c5993c6a9.bundle.js":10===e?"vendors.f18e74fe48ceb07d8c70.bundle.js":603===e?"vendors.5861a640ff3844504854.bundle.js":593===e?"vendors.fe050b32669a2a3c34a3.bundle.js":850===e?"ar.bundle.js":465===e?"sku.bundle.js":361===e?"vendors.6e3f8af05556e404968a.bundle.js":428===e?"viewer.bundle.js":142===e?"analytics.bundle.js":869===e?"qrCode.bundle.js":void 0},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t={},r="R2U:",i.l=function(e,n,o,u){if(t[e])t[e].push(n);else{var a,d;if(void 0!==o)for(var c=document.getElementsByTagName("script"),f=0;f<c.length;f++){var l=c[f];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==r+o){a=l;break}}a||(d=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.setAttribute("data-webpack",r+o),a.src=e),t[e]=[n];var s=function(n,r){a.onerror=a.onload=null,clearTimeout(b);var o=t[e];if(delete t[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((function(e){return e(r)})),n)return n(r)},b=setTimeout(s.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=s.bind(null,a.onerror),a.onload=s.bind(null,a.onload),d&&document.head.appendChild(a)}},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.p="https://unpkg.com/@r2u/javascript-ar-sdk@6.22.0/dist/",function(){var e={179:0};i.f.j=function(n,t){var r=i.o(e,n)?e[n]:void 0;if(0!==r)if(r)t.push(r[2]);else{var o=new Promise((function(t,o){r=e[n]=[t,o]}));t.push(r[2]=o);var u=i.p+i.u(n),a=new Error;i.l(u,(function(t){if(i.o(e,n)&&(0!==(r=e[n])&&(e[n]=void 0),r)){var o=t&&("load"===t.type?"missing":t.type),u=t&&t.target&&t.target.src;a.message="Loading chunk "+n+" failed.\n("+o+": "+u+")",a.name="ChunkLoadError",a.type=o,a.request=u,r[1](a)}}),"chunk-"+n,n)}};var n=function(n,t){var r,o,u=t[0],a=t[1],d=t[2],c=0;if(u.some((function(n){return 0!==e[n]}))){for(r in a)i.o(a,r)&&(i.m[r]=a[r]);if(d)d(i)}for(n&&n(t);c<u.length;c++)o=u[c],i.o(e,o)&&e[o]&&e[o][0](),e[u[c]]=0},t=self.webpackChunkR2U=self.webpackChunkR2U||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))}();var a={};i.r(a),i.d(a,{init:function(){return d},sku:function(){return l},ar:function(){return f},viewer:function(){return s},analytics:function(){return b},qrCode:function(){return h},config:function(){return c}});const d=e=>Promise.all([i.e(691),i.e(665),i.e(215),i.e(410)]).then(i.bind(i,6526)).then((n=>n.default(e))),c={changeLanguage:e=>Promise.all([i.e(665),i.e(497)]).then(i.bind(i,7328)).then((n=>n.default.changeLanguage(e)))},f={open:e=>Promise.all([i.e(691),i.e(30),i.e(665),i.e(10),i.e(215),i.e(603),i.e(593),i.e(850)]).then(i.bind(i,9408)).then((n=>n.default.open(e))),attach:e=>Promise.all([i.e(691),i.e(30),i.e(665),i.e(10),i.e(215),i.e(603),i.e(593),i.e(850)]).then(i.bind(i,9408)).then((n=>n.default.attach(e))),getLink:e=>Promise.all([i.e(691),i.e(30),i.e(665),i.e(10),i.e(215),i.e(603),i.e(593),i.e(850)]).then(i.bind(i,9408)).then((n=>n.default.getLink(e)))},l={isActive:e=>Promise.all([i.e(691),i.e(465)]).then(i.bind(i,6025)).then((n=>n.default.isActive(e))),getData:e=>Promise.all([i.e(691),i.e(465)]).then(i.bind(i,6025)).then((n=>n.default.getData(e)))},s={create:e=>Promise.all([i.e(691),i.e(30),i.e(10),i.e(361),i.e(593),i.e(428)]).then(i.bind(i,8305)).then((n=>n.default.create(e)))},b={send:e=>i.e(142).then(i.bind(i,9448)).then((n=>n.default.send(e)))},h={create:e=>Promise.all([i.e(30),i.e(361),i.e(869)]).then(i.bind(i,5004)).then((n=>n.default.create(e)))};document.dispatchEvent(new CustomEvent("r2u-sdk-loaded")),window.R2U=a}();
1
+ const init = (params) => import(/* webpackChunkName: "init" */ './methods/init').then((Init) => Init.default(params));
2
+ const config = {
3
+ changeLanguage: (language) => import(/* webpackChunkName: "./config" */ './methods/config').then((Config) => Config.default.changeLanguage(language)),
4
+ };
5
+ const ar = {
6
+ open: (params) => import(/* webpackChunkName: "ar" */ './methods/ar').then((Ar) => Ar.default.open(params)),
7
+ attach: (params) => import(/* webpackChunkName: "ar" */ './methods/ar').then((Ar) => Ar.default.attach(params)),
8
+ getLink: (sku) => import(/* webpackChunkName: "ar" */ './methods/ar').then((Ar) => Ar.default.getLink(sku)),
9
+ };
10
+ const sku = {
11
+ isActive: (sku) => import(/* webpackChunkName: "sku" */ './methods/sku').then((Sku) => Sku.default.isActive(sku)),
12
+ getData: (sku) => import(/* webpackChunkName: "sku" */ './methods/sku').then((Sku) => Sku.default.getData(sku)),
13
+ };
14
+ const viewer = {
15
+ create: (params) => import(/* webpackChunkName: "viewer" */ './methods/viewer').then((Viewer) => Viewer.default.create(params)),
16
+ };
17
+ const analytics = {
18
+ send: (params) => import(/* webpackChunkName: "analytics" */ './methods/analytics').then((Analytics) => Analytics.default.send(params)),
19
+ };
20
+ const qrCode = {
21
+ create: (params) => import(/* webpackChunkName: "qrCode" */ './methods/qrCode').then((QrCode) => QrCode.default.create(params)),
22
+ };
23
+ export { init, sku, ar, viewer, analytics, qrCode, config };
24
+ document.dispatchEvent(new CustomEvent('r2u-sdk-loaded'));
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA6EA,MAAM,IAAI,GAAG,CAAC,MAQb,EAAiB,EAAE,CAClB,MAAM,CAAC,8BAA8B,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CACpE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CACrB,CAAA;AAEH,MAAM,MAAM,GAAG;IACb,cAAc,EAAE,CAAC,QAA4B,EAAiB,EAAE,CAC9D,MAAM,CAAC,gCAAgC,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAC1E,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CACxC;CACJ,CAAA;AAED,MAAM,EAAE,GAAG;IACT,IAAI,EAAE,CAAC,MAA+C,EAAiB,EAAE,CACvE,MAAM,CAAC,4BAA4B,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAC9D,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CACxB;IACH,MAAM,EAAE,CAAC,MAaR,EAAuB,EAAE,CACxB,MAAM,CAAC,4BAA4B,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAC9D,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAC1B;IACH,OAAO,EAAE,CAAC,GAAW,EAAmB,EAAE,CACxC,MAAM,CAAC,4BAA4B,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAC9D,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CACxB;CACJ,CAAA;AAED,MAAM,GAAG,GAAG;IACV,QAAQ,EAAE,CAAC,GAAW,EAAoB,EAAE,CAC1C,MAAM,CAAC,6BAA6B,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CACjE,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAC1B;IACH,OAAO,EAAE,CAAC,GAAW,EAAoB,EAAE,CACzC,MAAM,CAAC,6BAA6B,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CACjE,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CACzB;CACJ,CAAA;AAED,MAAM,MAAM,GAAG;IACb,MAAM,EAAE,CAAC,MAYR,EAA4B,EAAE,CAC7B,MAAM,CAAC,gCAAgC,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAC1E,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAC9B;CACJ,CAAA;AAED,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,CAAC,MAIN,EAAiB,EAAE,CAClB,MAAM,CAAC,mCAAmC,CAAC,qBAAqB,CAAC,CAAC,IAAI,CACpE,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAC9C;CACJ,CAAA;AAED,MAAM,MAAM,GAAG;IACb,MAAM,EAAE,CAAC,MAIR,EAAuB,EAAE,CACxB,MAAM,CAAC,gCAAgC,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAC1E,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAC9B;CACJ,CAAA;AAED,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AAE3D,QAAQ,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAA"}
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkR2U=self.webpackChunkR2U||[]).push([[410],{6504:function(e,n,t){t.d(n,{f2:function(){return u}});var i=t(8665),a=t(1580),r=t(5538),s=t(660),o=t(2297),c=t(2367),l=function(e,n,t,i){return new(t||(t=Promise))((function(a,r){function s(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,o)}c((i=i.apply(e,n||[])).next())}))};const u=i.Z.createInstance();n.ZP={init:({language:e})=>l(void 0,void 0,void 0,(function*(){const n=c.Z.customer.language,t=(c.Z.customer.slug,e||n||"en"),i=(0,o.Bv)(),l=["translation"];return new Promise(((e,n)=>{u.use(a.Z).init({debug:!1,react:{useSuspense:!1},lng:t,fallbackLng:!1,supportedLngs:["pt","en","es"],ns:l,defaultNS:"translation",fallbackNS:"translation",load:"currentOnly",preload:[t],interpolation:{escapeValue:!1},backend:{backends:[s.Z,r.Z],backendOptions:[{prefix:"i18next_res_r2u_sdk_",enabled:!0,expirationTime:6048e5},{loadPath:`${i}/locales/{{lng}}/{{ns}}.json`,allowMultiloading:!0}]}},(t=>{t&&n(new Error("R2U - Translation init failed")),e()}))}))}))}},6526:function(e,n,t){t.r(n),t.d(n,{default:function(){return l}});var i=t(2367),a=t(7374),r=t(2297),s=function(e,n,t,i){return new(t||(t=Promise))((function(a,r){function s(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,o)}c((i=i.apply(e,n||[])).next())}))};var o=t(6504),c=function(e,n,t,i){return new(t||(t=Promise))((function(a,r){function s(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,o)}c((i=i.apply(e,n||[])).next())}))};function l({customerId:e,language:n,analyticsParams:t={dataLayerIntegration:!0,sessionDuration:30},refreshCache:l=!1}){return c(this,void 0,void 0,(function*(){if(!/^(?=[a-f\d]{24}$)(\d+[a-f]|[a-f]+\d)/i.test(e)&&!/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i.test(e))throw new Error(`Invalid customer '${e}'`);i.Z.init=!0,i.Z.refreshCache=l;const c=yield function(e){return s(this,void 0,void 0,(function*(){return yield(0,r.U2)(`/customers/${e}`)}))}(e),u=yield(0,a.ZP)({client:e,dataLayerIntegration:t.dataLayerIntegration,sessionDurationMinutes:t.sessionDuration});i.Z.analytics=u,i.Z.customer=c,yield Promise.all([o.ZP.init({language:n})])}))}},7374:function(e,n,t){t.d(n,{J1:function(){return u},E9:function(){return d},XH:function(){return p},ar:function(){return f},KN:function(){return b},fQ:function(){return g},hN:function(){return v},lY:function(){return y},G0:function(){return w},fm:function(){return m}});var i=t(2085),a=t(5877),r=t(2367),s=function(e,n,t,i){return new(t||(t=Promise))((function(a,r){function s(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,o)}c((i=i.apply(e,n||[])).next())}))};const o="ar_link",c="ar_model_viewer",l="cta",u={componentDidMount:()=>r.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:o},scope:"page"}),onClick:()=>r.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:o}}),onFallback:()=>r.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o}}),onLike:()=>r.Z.analytics.send({event:i.U3.like,data:{[i.MB.placement]:o}}),onDislike:()=>r.Z.analytics.send({event:i.U3.dislike,data:{[i.MB.placement]:o}}),onSessionTimeCollect:e=>r.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:o}})},d={componentDidMount:()=>r.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:c},scope:"page"}),onClick:()=>r.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:c}}),onSessionTimeCollect:e=>r.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:c}})},p={onSessionStart:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.session_start}),onSessionEnd:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.session_end}),setSession:()=>{r.Z.analytics.webxrSet(i.D1.session_id,(0,a.v4)())},setCompatible:e=>{r.Z.analytics.webxrSet(i.D1.compatible,`${e}`)},onSceneViewerFallback:()=>Promise.all([r.Z.analytics.webxrSend({webxrEvent:i.Ui.scene_viewer_fallback}),r.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o},context:"webxr"})]),onFallback:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.fallback}),setPlaneMapped:()=>{r.Z.analytics.webxrSet(i.D1.plane_mapped,(new Date).toISOString())},setObjectPlaced:()=>{r.Z.analytics.webxrSet(i.D1.object_placed,(new Date).toISOString())},setTranslateInstructions:()=>{r.Z.analytics.webxrSet(i.D1.translate_instructions,(new Date).toISOString())},setRotateInstructions:()=>{r.Z.analytics.webxrSet(i.D1.rotate_instructions,(new Date).toISOString())},setFirstTranslation:()=>{r.Z.analytics.webxrSet(i.D1.first_translation,(new Date).toISOString())},setFirstRotation:()=>{r.Z.analytics.webxrSet(i.D1.first_rotation,(new Date).toISOString())},setReset:()=>{r.Z.analytics.webxrSet(i.D1.reset,(new Date).toISOString())},onShare:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.share}),onExit:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.exit}),onLike:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.like}),onDislike:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.dislike}),onCallToAction:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.call_to_action}),onTranslation:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.translation}),onRotation:()=>r.Z.analytics.webxrSend({webxrEvent:i.Ui.rotation})},f={onClick:()=>r.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:l},context:"cart"})},v=e=>{r.Z.analytics.set(i.MB.sku,e)},y=e=>{r.Z.analytics.set(i.MB.manufacturer_id,e)},w=e=>{r.Z.analytics.set(i.MB.is_active_3d,`${e}`),r.Z.analytics.send({event:i.U3.product_page_view})},b=e=>{r.Z.analytics.set(i.MB.experiment_id,e)},g=e=>{r.Z.analytics.set(i.MB.variation_id,e)},m=()=>s(void 0,void 0,void 0,(function*(){const e=yield(0,i.cE)();return r.Z.analytics.set(i.MB.fingerprint,e),e}));n.ZP=({client:e,dataLayerIntegration:n,sessionDurationMinutes:t,info:a={}})=>s(void 0,void 0,void 0,(function*(){const r={version:"6.22.0",gcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportEvent",webxrGcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportWebXREvent",debug:!!new URLSearchParams(window.location.search).get("realidade-aumentada-debug"),sessionDurationMinutes:t,dataLayerIntegration:n},s=new i.ZP(r,Object.assign(Object.assign({},a),{[i.MB.client]:e}));return yield s.init(),s}))},2297:function(e,n,t){t.d(n,{U2:function(){return s},v_:function(){return o},Bv:function(){return c}});var i=t(2367),a=function(e,n,t,i){return new(t||(t=Promise))((function(a,r){function s(e){try{c(i.next(e))}catch(e){r(e)}}function o(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,o)}c((i=i.apply(e,n||[])).next())}))};const r="https://api.r2u.io";function s(e){return a(this,void 0,void 0,(function*(){const n={};i.Z.refreshCache&&(n["Cache-Control"]="max-age=0");return(yield fetch(`${r}${e}`,{method:"get",headers:n})).json()}))}function o(e,n){return a(this,void 0,void 0,(function*(){return(yield fetch(`${r}${e}`,{method:"POST",body:JSON.stringify(n)})).json()}))}const c=()=>"https://sdk.r2u.io"},2367:function(e,n){const t={init:!1,customer:{_id:"",slug:"",language:"en",hdri:null,exposure:null,bloom:null,experiments:{overrides:{}},viewerOptions:{}},analytics:{set:(e,n)=>{},send:({event:e,data:n,scope:t})=>Promise.resolve()},products:{},hasAutoOpenedAR:!1,growthbook:{},refreshCache:!1};n.Z=t},4147:function(e){e.exports=JSON.parse('{"name":"@r2u/javascript-ar-sdk","version":"6.22.0","main":"dist/index.js","unpkg":"dist/index.js","types":"dist/index.d.ts","repository":"https://github.com/r2u-io/javascript-ar-sdk","files":["dist"],"scripts":{"dev":"yarn build:dev && webpack serve --mode=development","build:dev":"REACT_APP_VERSION=$(jq -r \\".version\\" package.json) webpack --mode=development","build":"REACT_APP_VERSION=$(jq -r \\".version\\" package.json) webpack --mode=production","clean":"rm -rf dist/ public/dist/","test":"jest --config ./jest.config.js","stage":"yarn build:dev && gsutil -m cp -R ./public gs://r2u-integrations-bucket/_staging/sdk/","prettier":"prettier --write src","lint":"eslint \\"./src/**/*.{js,ts,tsx}\\"","eject":"rescripts eject"},"peerDependencies":{"react":"^16.13.1","react-dom":"^16.13.1"},"dependencies":{"@r2u/analytics":"^4.3.3","@r2u/react-ar-components":"^5.4.16","@r2u/viewer":"^1.12.3","@types/react-slick":"^0.23.10","i18next":"^20.2.1","i18next-chained-backend":"^2.1.0","i18next-http-backend":"^1.2.1","i18next-localstorage-backend":"^3.1.2","qrcode.react":"^1.0.1","querystring":"^0.2.0","react":"^17.0.2","react-dom":"^17.0.2","react-i18next":"^11.8.13","react-shadow":"^19.0.2","react-slick":"^0.29.0","styled-components":"^5.2.3"},"devDependencies":{"@fingerprintjs/fingerprintjs":"^3.3.0","@growthbook/growthbook":"^0.12.0","@types/jest":"^26.0.15","@types/node":"^13.11.1","@types/qrcode.react":"^1.0.1","@types/react":"^16.9.33","@types/react-dom":"^16.9.6","@types/styled-components":"^5.1.9","@typescript-eslint/eslint-plugin":"^2.3.1","@typescript-eslint/parser":"^2.3.1","eslint":"^7.22.0","eslint-config-prettier":"^6.12.0","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.17.2","eslint-plugin-jest":"^22.17.0","eslint-plugin-node":"^8.0.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-promise":"^4.1.1","eslint-plugin-react":"^7.14.3","eslint-plugin-standard":"^4.0.0","file-loader":"^6.2.0","jest":"^24.9.0","prettier":"^2.1.2","process":"^0.11.10","three":"^0.131.2","ts-jest":"^26.4.4","ts-loader":"^8.0.17","tsconfig-paths-webpack-plugin":"^3.5.1","typescript":"^3.8.3","util":"^0.12.3","webpack":"^5.24.3","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0","webpack-dev-server":"3.10.3"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]}}')}}]);
1
+ "use strict";(self.webpackChunkR2U=self.webpackChunkR2U||[]).push([[410],{6504:function(e,n,t){t.d(n,{f2:function(){return u}});var i=t(8665),a=t(1580),s=t(5538),r=t(660),o=t(2297),c=t(2367),l=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};const u=i.Z.createInstance();n.ZP={init:({language:e})=>l(void 0,void 0,void 0,(function*(){const n=c.Z.customer.language,t=(c.Z.customer.slug,e||n||"en"),i=(0,o.Bv)(),l=["translation"];return new Promise(((e,n)=>{u.use(a.Z).init({debug:!1,react:{useSuspense:!1},lng:t,fallbackLng:!1,supportedLngs:["pt","en","es"],ns:l,defaultNS:"translation",fallbackNS:"translation",load:"currentOnly",preload:[t],interpolation:{escapeValue:!1},backend:{backends:[r.Z,s.Z],backendOptions:[{prefix:"i18next_res_r2u_sdk_",enabled:!0,expirationTime:6048e5},{loadPath:`${i}/locales/{{lng}}/{{ns}}.json`,allowMultiloading:!0}]}},(t=>{t&&n(new Error("R2U - Translation init failed")),e()}))}))}))}},6526:function(e,n,t){t.r(n),t.d(n,{default:function(){return l}});var i=t(2367),a=t(7374),s=t(2297),r=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};var o=t(6504),c=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};function l({customerId:e,language:n,analyticsParams:t={dataLayerIntegration:!0,sessionDuration:30},refreshCache:l=!1}){return c(this,void 0,void 0,(function*(){if(!/^(?=[a-f\d]{24}$)(\d+[a-f]|[a-f]+\d)/i.test(e)&&!/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i.test(e))throw new Error(`Invalid customer '${e}'`);i.Z.init=!0,i.Z.refreshCache=l;const c=yield function(e){return r(this,void 0,void 0,(function*(){return yield(0,s.U2)(`/customers/${e}`)}))}(e),u=yield(0,a.ZP)({client:e,dataLayerIntegration:t.dataLayerIntegration,sessionDurationMinutes:t.sessionDuration});i.Z.analytics=u,i.Z.customer=c,yield Promise.all([o.ZP.init({language:n})])}))}},7374:function(e,n,t){t.d(n,{J1:function(){return u},E9:function(){return d},XH:function(){return p},ar:function(){return f},KN:function(){return w},fQ:function(){return g},hN:function(){return y},lY:function(){return v},G0:function(){return b},fm:function(){return m}});var i=t(2085),a=t(5877),s=t(2367),r=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};const o="ar_link",c="ar_model_viewer",l="cta",u={componentDidMount:()=>s.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:o},scope:"page"}),onClick:()=>s.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:o}}),onFallback:()=>s.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o}}),onLike:()=>s.Z.analytics.send({event:i.U3.like,data:{[i.MB.placement]:o}}),onDislike:()=>s.Z.analytics.send({event:i.U3.dislike,data:{[i.MB.placement]:o}}),onSessionTimeCollect:e=>s.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:o}})},d={componentDidMount:()=>s.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:c},scope:"page"}),onClick:()=>s.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:c}}),onSessionTimeCollect:e=>s.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:c}})},p={onSessionStart:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.session_start}),onSessionEnd:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.session_end}),setSession:()=>{s.Z.analytics.webxrSet(i.D1.session_id,(0,a.v4)())},setCompatible:e=>{s.Z.analytics.webxrSet(i.D1.compatible,`${e}`)},onSceneViewerFallback:()=>Promise.all([s.Z.analytics.webxrSend({webxrEvent:i.Ui.scene_viewer_fallback}),s.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o},context:"webxr"})]),onFallback:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.fallback}),setPlaneMapped:()=>{s.Z.analytics.webxrSet(i.D1.plane_mapped,(new Date).toISOString())},setObjectPlaced:()=>{s.Z.analytics.webxrSet(i.D1.object_placed,(new Date).toISOString())},setTranslateInstructions:()=>{s.Z.analytics.webxrSet(i.D1.translate_instructions,(new Date).toISOString())},setRotateInstructions:()=>{s.Z.analytics.webxrSet(i.D1.rotate_instructions,(new Date).toISOString())},setFirstTranslation:()=>{s.Z.analytics.webxrSet(i.D1.first_translation,(new Date).toISOString())},setFirstRotation:()=>{s.Z.analytics.webxrSet(i.D1.first_rotation,(new Date).toISOString())},setReset:()=>{s.Z.analytics.webxrSet(i.D1.reset,(new Date).toISOString())},onShare:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.share}),onExit:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.exit}),onLike:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.like}),onDislike:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.dislike}),onCallToAction:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.call_to_action}),onTranslation:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.translation}),onRotation:()=>s.Z.analytics.webxrSend({webxrEvent:i.Ui.rotation})},f={onClick:()=>s.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:l},context:"cart"})},y=e=>{s.Z.analytics.set(i.MB.sku,e)},v=e=>{s.Z.analytics.set(i.MB.manufacturer_id,e)},b=e=>{s.Z.analytics.set(i.MB.is_active_3d,`${e}`),s.Z.analytics.send({event:i.U3.product_page_view})},w=e=>{s.Z.analytics.set(i.MB.experiment_id,e)},g=e=>{s.Z.analytics.set(i.MB.variation_id,e)},m=()=>r(void 0,void 0,void 0,(function*(){const e=yield(0,i.cE)();return s.Z.analytics.set(i.MB.fingerprint,e),e}));n.ZP=({client:e,dataLayerIntegration:n,sessionDurationMinutes:t,info:a={}})=>r(void 0,void 0,void 0,(function*(){const s={version:"6.22.2",gcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportEvent",webxrGcpAnalyticsUrl:"https://us-central1-r2u-analytics.cloudfunctions.net/reportWebXREvent",debug:!!new URLSearchParams(window.location.search).get("realidade-aumentada-debug"),sessionDurationMinutes:t,dataLayerIntegration:n},r=new i.ZP(s,Object.assign(Object.assign({},a),{[i.MB.client]:e}));return yield r.init(),r}))},2297:function(e,n,t){t.d(n,{U2:function(){return r},v_:function(){return o},Bv:function(){return c}});var i=t(2367),a=function(e,n,t,i){return new(t||(t=Promise))((function(a,s){function r(e){try{c(i.next(e))}catch(e){s(e)}}function o(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var n;e.done?a(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,o)}c((i=i.apply(e,n||[])).next())}))};const s="https://api.r2u.io";function r(e){return a(this,void 0,void 0,(function*(){const n={};i.Z.refreshCache&&(n["Cache-Control"]="max-age=0");return(yield fetch(`${s}${e}`,{method:"get",headers:n})).json()}))}function o(e,n){return a(this,void 0,void 0,(function*(){return(yield fetch(`${s}${e}`,{method:"POST",body:JSON.stringify(n)})).json()}))}const c=()=>"https://sdk.r2u.io"},2367:function(e,n){const t={init:!1,customer:{_id:"",slug:"",language:"en",hdri:null,exposure:null,bloom:null,experiments:{overrides:{}},viewerOptions:{}},analytics:{set:(e,n)=>{},send:({event:e,data:n,scope:t})=>Promise.resolve()},products:{},hasAutoOpenedAR:!1,growthbook:{},refreshCache:!1};n.Z=t},4147:function(e){e.exports=JSON.parse('{"name":"@r2u/javascript-ar-sdk","version":"6.22.2","main":"dist/index.js","unpkg":"dist/index.js","types":"dist/index.d.ts","repository":"https://github.com/r2u-io/javascript-ar-sdk","files":["dist"],"scripts":{"dev":"yarn build:dev && webpack serve --mode=development","build:dev":"REACT_APP_VERSION=$(jq -r \\".version\\" package.json) webpack --mode=development && yarn build:types","build":"REACT_APP_VERSION=$(jq -r \\".version\\" package.json) webpack --mode=production && yarn build:types","build:types":"tsc && npx tsc-alias","clean":"rm -rf dist/ public/dist/","test":"jest --config ./jest.config.js","stage":"yarn build:dev && gsutil -m cp -R ./public gs://r2u-integrations-bucket/_staging/sdk/","prettier":"prettier --write src","lint":"eslint \\"./src/**/*.{js,ts,tsx}\\"","eject":"rescripts eject"},"peerDependencies":{"react":"^16.13.1","react-dom":"^16.13.1"},"dependencies":{"@r2u/analytics":"^4.3.3","@r2u/react-ar-components":"^5.4.16","@r2u/viewer":"^1.12.3","@types/react-slick":"^0.23.10","i18next":"^20.2.1","i18next-chained-backend":"^2.1.0","i18next-http-backend":"^1.2.1","i18next-localstorage-backend":"^3.1.2","qrcode.react":"^1.0.1","querystring":"^0.2.0","react":"^17.0.2","react-dom":"^17.0.2","react-i18next":"^11.8.13","react-shadow":"^19.0.2","react-slick":"^0.29.0","styled-components":"^5.2.3"},"devDependencies":{"@fingerprintjs/fingerprintjs":"^3.3.0","@growthbook/growthbook":"^0.12.0","@types/jest":"^26.0.15","@types/node":"^13.11.1","@types/qrcode.react":"^1.0.1","@types/react":"^16.9.33","@types/react-dom":"^16.9.6","@types/styled-components":"^5.1.9","@typescript-eslint/eslint-plugin":"^2.3.1","@typescript-eslint/parser":"^2.3.1","eslint":"^7.22.0","eslint-config-prettier":"^6.12.0","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.17.2","eslint-plugin-jest":"^22.17.0","eslint-plugin-node":"^8.0.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-promise":"^4.1.1","eslint-plugin-react":"^7.14.3","eslint-plugin-standard":"^4.0.0","file-loader":"^6.2.0","jest":"^24.9.0","prettier":"^2.1.2","process":"^0.11.10","three":"^0.131.2","ts-jest":"^26.4.4","ts-loader":"^8.0.17","tsc-alias":"^1.8.11","tsconfig-paths-webpack-plugin":"^3.5.1","typescript":"^3.8.3","util":"^0.12.3","webpack":"^5.24.3","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^4.5.0","webpack-dev-server":"3.10.3"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]}}')}}]);
@@ -0,0 +1,36 @@
1
+ {
2
+ "instructions": {
3
+ "handMove": "Hold and drag the product to move",
4
+ "handRotate": "Hold the product with two fingers to rotate",
5
+ "text": "Place the product in your surroundings to check all dimensions",
6
+ "button": "Check this product in your space!",
7
+ "loading": "Loading ..."
8
+ },
9
+ "fallback": {
10
+ "viewer": {
11
+ "title": "Augmented Reality will soon be available",
12
+ "topText": "Sorry... we are still building an Augmented Reality experience compatible with your device. Soon, you will be able to use this functionality to test our products.",
13
+ "bottomText": "Meanwhile, you can check every detail of this product in our 3D model above."
14
+ },
15
+ "social": {
16
+ "title": "To open this experience, please open this page on your browser",
17
+ "text": "Click on the menu button located at the top right corner of the screen and select the option to open in the browser.",
18
+ "button": "OK"
19
+ }
20
+ },
21
+ "feedback": {
22
+ "main": {
23
+ "title": "Were you able to visualize and interact with this product?",
24
+ "button": "Close"
25
+ },
26
+ "confirm": {
27
+ "title": "Thank you for your feedback!",
28
+ "text": "We are always improving so you can have the best experience",
29
+ "button": "Finish"
30
+ }
31
+ },
32
+ "callToAction": {
33
+ "visit": "Visit"
34
+ },
35
+ "poweredBy": "powered by"
36
+ }
@@ -0,0 +1,17 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import state from '../state';
11
+ function send({ event, data, scope }) {
12
+ return __awaiter(this, void 0, void 0, function* () {
13
+ state.analytics.send({ event, data, scope });
14
+ });
15
+ }
16
+ export default { send };
17
+ //# sourceMappingURL=analytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/methods/analytics.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,MAAM,UAAU,CAAA;AAG5B,SAAe,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAmB;;QACzD,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;IAC9C,CAAC;CAAA;AAED,eAAe,EAAE,IAAI,EAAE,CAAA"}