@r2u/javascript-ar-sdk 6.23.0 → 6.23.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.
package/dist/ar.bundle.js CHANGED
@@ -1,5 +1,24 @@
1
1
  /*! For license information please see ar.bundle.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkR2U=self.webpackChunkR2U||[]).push([[850],{6504:function(e,t,n){n.d(t,{f2:function(){return d}});var o=n(8665),r=n(1580),a=n(5538),i=n(660),l=n(2297),s=n(2367),c=function(e,t,n,o){return new(n||(n=Promise))((function(r,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((o=o.apply(e,t||[])).next())}))};const d=o.Z.createInstance();t.ZP={init:({language:e})=>c(void 0,void 0,void 0,(function*(){const t=s.Z.customer.language,n=(s.Z.customer.slug,e||t||"en"),o=(0,l.Bv)(),c=["translation"];return new Promise(((e,t)=>{d.use(r.Z).init({debug:!1,react:{useSuspense:!1},lng:n,fallbackLng:!1,supportedLngs:["pt","en","es"],ns:c,defaultNS:"translation",fallbackNS:"translation",load:"currentOnly",preload:[n],interpolation:{escapeValue:!1},backend:{backends:[i.Z,a.Z],backendOptions:[{prefix:"i18next_res_r2u_sdk_",enabled:!0,expirationTime:6048e5},{loadPath:`${o}/locales/{{lng}}/{{ns}}.json`,allowMultiloading:!0}]}},(n=>{n&&t(new Error("R2U - Translation init failed")),e()}))}))}))}},9408:function(e,t,n){n.r(t),n.d(t,{default:function(){return Pe}});var o=n(7294),r=n(3935),a=n(5865),i=n(2367);function l(e){const t=`r2u-webxr-seen-${e}`;return Boolean(JSON.parse(localStorage.getItem(t)||"false"))}function s(e){const t=`r2u-webxr-seen-${e}`;localStorage.setItem(t,JSON.stringify(!0))}function c(e){const t=`r2u-ar-opened-${e}`;return Boolean(JSON.parse(localStorage.getItem(t)||"false"))}function d(e){const t=`r2u-ar-opened-${e}`;localStorage.setItem(t,JSON.stringify(!0))}var m=n(7523),p=n(7374),u=n(2297),f=n(6339),h=n(6504);const g=(0,o.createContext)({}),b=({children:e,openerElement:t,openerEvent:n,onClose:r=(()=>{})})=>{const[a,i]=(0,o.useState)(!1),l=()=>{i(!0)};return t&&n&&t.addEventListener(n,l),o.createElement(g.Provider,{value:{isOpen:a,openModal:l,closeModal:()=>{r(),i(!1)},toggleModal:()=>{i(!a)}}},o.createElement(f.a,{i18n:h.f2},a?e:null))};var v=n(6793),x=n(1841),w=n.n(x),E=n(9163);const y=E.default.div`
2
+ "use strict";(self.webpackChunkR2U=self.webpackChunkR2U||[]).push([[850],{3026:function(e,t,n){n.d(t,{Ao:function(){return r},mn:function(){return a},L7:function(){return i},Ov:function(){return l},H_:function(){return s},cu:function(){return c},yY:function(){return d}});var o=n(7294);const r=e=>o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e),o.createElement("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),o.createElement("polyline",{points:"12 19 5 12 12 5"})),a=e=>o.createElement("svg",Object.assign({viewBox:"0 0 1024 1024",fill:"#8ec396"},e),o.createElement("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 0 1-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})),i=e=>o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",className:"icon",viewBox:"0 0 1024 1024",fill:"#fff"},e),o.createElement("path",{d:"M885.9 533.7c16.8-22.2 26.1-49.4 26.1-77.7 0-44.9-25.1-87.4-65.5-111.1a67.67 67.67 0 0 0-34.3-9.3H572.4l6-122.9c1.4-29.7-9.1-57.9-29.5-79.4A106.62 106.62 0 0 0 471 99.9c-52 0-98 35-111.8 85.1l-85.9 311h-.3v428h472.3c9.2 0 18.2-1.8 26.5-5.4 47.6-20.3 78.3-66.8 78.3-118.4 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7-.2-12.6-2-25.1-5.6-37.1zM112 528v364c0 17.7 14.3 32 32 32h65V496h-65c-17.7 0-32 14.3-32 32z"})),l=e=>o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",className:"icon",viewBox:"0 0 1024 1024",fill:"#fff"},e),o.createElement("path",{d:"M885.9 490.3c3.6-12 5.4-24.4 5.4-37 0-28.3-9.3-55.5-26.1-77.7 3.6-12 5.4-24.4 5.4-37 0-28.3-9.3-55.5-26.1-77.7 3.6-12 5.4-24.4 5.4-37 0-51.6-30.7-98.1-78.3-118.4a66.1 66.1 0 0 0-26.5-5.4H273v428h.3l85.8 310.8C372.9 889 418.9 924 470.9 924c29.7 0 57.4-11.8 77.9-33.4 20.5-21.5 31-49.7 29.5-79.4l-6-122.9h239.9c12.1 0 23.9-3.2 34.3-9.3 40.4-23.5 65.5-66.1 65.5-111 0-28.3-9.3-55.5-26.1-77.7zM112 132v364c0 17.7 14.3 32 32 32h65V100h-65c-17.7 0-32 14.3-32 32z"})),s=e=>o.createElement("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),o.createElement("path",{d:"M15.0002 37.4C15.0002 38.3167 15.7502 39.0667 16.6668 39.0667H23.3335C24.2502 39.0667 25.0002 38.3167 25.0002 37.4V35.7334H15.0002V37.4ZM20.0002 6.93335C13.5668 6.93335 8.3335 12.1667 8.3335 18.6C8.3335 22.5667 10.3168 26.05 13.3335 28.1667V31.9334C13.3335 32.85 14.0835 33.6 15.0002 33.6H25.0002C25.9168 33.6 26.6668 32.85 26.6668 31.9334V28.1667C29.6835 26.05 31.6668 22.5667 31.6668 18.6C31.6668 12.1667 26.4335 6.93335 20.0002 6.93335ZM24.7502 25.4334L23.3335 26.4334V30.2667H16.6668V26.4334L15.2502 25.4334C13.0002 23.8667 11.6668 21.3167 11.6668 18.6C11.6668 14 15.4002 10.2667 20.0002 10.2667C24.6002 10.2667 28.3335 14 28.3335 18.6C28.3335 21.3167 27.0002 23.8667 24.7502 25.4334Z",fill:"#AFAFAF"})),c=e=>o.createElement("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),o.createElement("path",{d:"M15.3716 37.26C15.3716 38.107 16.0659 38.8 16.9145 38.8H23.0859C23.9345 38.8 24.6288 38.107 24.6288 37.26V35.72H15.3716V37.26ZM20.0002 8C14.0448 8 9.2002 12.8356 9.2002 18.78C9.2002 22.4452 11.0362 25.6638 13.8288 27.6196V31.1C13.8288 31.947 14.5231 32.64 15.3716 32.64H24.6288C25.4773 32.64 26.1716 31.947 26.1716 31.1V27.6196C28.9642 25.6638 30.8002 22.4452 30.8002 18.78C30.8002 12.8356 25.9556 8 20.0002 8ZM24.3973 25.094L23.0859 26.018V29.56H16.9145V26.018L15.6031 25.094C13.5202 23.6464 12.2859 21.2902 12.2859 18.78C12.2859 14.5296 15.7419 11.08 20.0002 11.08C24.2585 11.08 27.7145 14.5296 27.7145 18.78C27.7145 21.2902 26.4802 23.6464 24.3973 25.094Z",fill:"#003E58"}),o.createElement("path",{d:"M34.0166 6.51666L31.6666 4.16666L28.6833 7.16666L31.0333 9.51666L34.0166 6.51666ZM21.5999 5L18.2666 5L18.2666 -5.134e-06L21.5999 -4.84259e-06L21.5999 5ZM38.2666 20L33.2666 20L33.2666 16.6667L38.2666 16.6667L38.2666 20ZM6.59993 20L1.59993 20L1.59993 16.6667L6.59993 16.6667L6.59993 20ZM11.1999 7.15L8.2166 4.14999L5.8666 6.49999L8.8666 9.48333L11.1999 7.15Z",fill:"#003E58"})),d=e=>o.createElement("svg",Object.assign({width:"137",height:"27",viewBox:"0 0 137 27",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.0906369 23.7492V27H137V23.7492H0.0906369ZM129.725 6.59205C133.546 6.59205 135.365 8.127 135.546 10.9262H132.089C131.907 9.66195 131.089 9.21038 129.724 9.21038C128.268 9.21038 127.543 9.66195 127.543 10.2938C127.543 11.3771 128.633 11.3771 131.728 12.1898C134.275 12.8216 135.822 13.9961 135.913 16.1629C135.731 19.5946 133.275 20.6779 129.909 20.6779C126.088 20.6779 123.905 19.0526 123.814 15.982H127.362C127.544 17.8781 128.997 17.9685 130.182 17.9685C131.366 17.9685 132.363 17.6074 132.363 16.7042C132.453 15.44 130.27 15.44 128.269 14.8082C126.361 14.3566 124.084 13.6343 124.175 11.0153C124.358 7.58498 127.178 6.59205 129.725 6.59205ZM115.988 6.59205C118.08 6.59205 121.628 6.95318 121.628 10.746V18.5119C121.645 18.7407 121.711 18.9633 121.821 19.1655C121.93 19.3676 122.081 19.5448 122.264 19.6857V20.2257H118.535C118.327 19.7064 118.205 19.1577 118.171 18.6003C117.681 19.2188 117.061 19.7249 116.355 20.0837C115.649 20.4425 114.873 20.6454 114.08 20.6786C111.714 20.6786 109.895 19.2341 109.895 16.7056C109.985 13.5452 111.803 12.823 114.807 12.281C116.263 12.1905 118.173 12.011 118.173 10.8365C118.173 9.39195 116.99 9.39195 115.899 9.3015C114.443 9.39195 113.807 9.8415 113.625 11.1976H110.259C110.53 7.94678 112.531 6.59205 115.988 6.59205ZM86.8771 6.59205C89.5152 6.59205 92.4264 7.4952 92.4264 10.3849V18.2412C92.3921 18.5138 92.4435 18.7902 92.5738 19.0327C92.7041 19.2752 92.9068 19.4719 93.1542 19.5959V20.1359H89.3332C89.2061 19.6313 89.115 19.1183 89.0606 18.601C88.5409 19.202 87.9004 19.6891 87.1799 20.0312C86.4594 20.3732 85.6749 20.5627 84.8763 20.5875C82.3289 20.4971 80.6913 19.2328 80.6913 16.6145C80.782 13.6343 82.5995 12.4605 86.7865 12.0994C87.8769 12.0089 88.8787 11.6478 88.8787 10.7447C88.8787 9.38993 87.6049 9.38993 86.6979 9.30015C84.9697 9.3906 84.7898 10.0224 84.5172 11.1962H81.0553C81.3285 7.94678 83.3294 6.59205 86.8771 6.59205ZM73.2312 6.5016C77.4161 6.5016 78.9624 8.57858 79.235 11.5587L75.5959 11.6492C75.3233 10.1142 74.4136 9.48173 73.3218 9.48173C70.8685 9.48173 70.5959 11.8294 70.5959 13.7261C70.5959 16.2547 71.4137 17.6992 73.2339 17.6992C74.8695 17.6087 75.2354 17.0674 75.5993 15.3515H79.1471C78.6919 18.5119 76.5997 20.5889 73.1433 20.5889C68.8677 20.4984 66.9575 17.9699 66.9575 13.7261C66.9547 8.9397 69.4108 6.59205 73.2319 6.5016H73.2312ZM42.2102 6.59205C45.576 6.59205 48.5779 8.21745 48.4873 14.4484H43.9844H39.4816C39.4816 16.5254 40.6639 17.7896 42.4835 17.7896C42.9893 17.8059 43.4879 17.6672 43.9112 17.3925C44.3345 17.1178 44.662 16.7205 44.8489 16.2547H48.3967C47.9421 18.6023 45.6708 20.5889 42.3928 20.5889C41.2105 20.5889 35.9338 20.2277 35.9338 13.6363C35.9338 8.48812 39.0263 6.59205 42.2109 6.59205H42.2102ZM6.09175 6.59205C8.72976 6.59205 11.7317 7.3143 11.7317 10.2944V18.2412C11.6973 18.5138 11.7488 18.7902 11.8791 19.0327C12.0093 19.2752 12.2121 19.4719 12.4595 19.5959V20.1359H8.64253C8.49995 19.6346 8.40862 19.1204 8.36994 18.601C7.85016 19.2021 7.20952 19.6893 6.48893 20.0313C5.76834 20.3734 4.98364 20.5628 4.18497 20.5875C1.72823 20.5875 0 19.2341 0 16.6151C0 12.7325 3.27519 12.3707 6.09516 12.1C7.27753 12.0096 8.2759 11.6485 8.2759 10.7453C8.2759 9.3906 7.00221 9.3906 6.09516 9.30083C4.36692 9.39128 4.18701 10.0231 3.82106 11.1969H0.454547C0.727821 7.2225 3.6391 6.59205 6.09516 6.59205H6.09175ZM102.976 6.59205C105.523 6.6825 107.524 7.58565 107.524 11.288V20.2277H103.98V12.1007C104.071 10.5658 103.526 9.48173 101.8 9.48173C99.6188 9.48173 99.0736 11.288 99.0736 13.0032V20.2257H95.5258V6.9525H98.9829V8.84858C99.3599 8.13204 99.9372 7.53819 100.646 7.13802C101.355 6.73786 102.165 6.54832 102.979 6.59205H102.976ZM29.6532 6.59205C33.1104 6.86205 34.0202 9.21105 33.8382 11.8294V20.2271H30.2932V11.7389C30.3094 11.4655 30.2701 11.1917 30.1777 10.9336C30.0852 10.6755 29.9414 10.4384 29.7548 10.2363C29.5682 10.0342 29.3425 9.87127 29.0912 9.75708C28.8399 9.64289 28.568 9.57978 28.2917 9.5715C26.4721 9.8415 26.1995 10.7453 26.0176 12.2803V20.2271H22.4698V12.281C22.5604 10.746 22.1059 9.57218 20.5616 9.57218C18.3441 9.65993 18.2889 10.6927 18.2875 12.0832V20.2277H14.737V6.9525H18.1028V8.84858C18.4402 8.13805 18.9842 7.54356 19.665 7.14138C20.3458 6.7392 21.1324 6.54767 21.9239 6.59137C22.6967 6.51854 23.4722 6.70025 24.1301 7.10835C24.7881 7.51645 25.2917 8.12813 25.563 8.84858C25.9642 8.13104 26.5604 7.53927 27.284 7.14041C28.0076 6.74155 28.8296 6.55157 29.6567 6.59205H29.6532ZM64.222 6.86205V20.1366H60.6776V6.86273L64.222 6.86205ZM58.4908 6.59205H58.5814V10.1135C56.6733 10.0231 54.3058 9.84353 54.3058 13.8159V20.1373H50.8527V6.86273H54.1279V9.21038C55.4043 6.9525 56.6753 6.5016 58.4942 6.59205H58.4908ZM8.36926 13.7255C6.91362 14.7191 3.54779 14.0866 3.54779 16.4342C3.63842 17.6081 4.18429 18.0596 5.27602 18.0596C7.82339 17.6087 8.46058 16.8865 8.36926 13.7255ZM88.8787 13.7255C88.1504 14.1286 87.3443 14.3748 86.5132 14.4477C85.0576 14.5382 84.1478 14.9877 84.1478 16.3438C84.2384 17.6081 84.8756 18.0596 85.876 18.0596C88.4241 17.6087 89.1519 16.6151 88.8787 13.7255ZM118.171 13.7255C117.407 14.1178 116.575 14.3629 115.718 14.4477C114.718 14.5382 113.353 14.8993 113.353 16.3438C113.353 17.7883 114.353 17.9692 115.081 18.0596C117.444 17.8794 118.169 16.796 118.169 13.7255H118.171ZM42.3015 9.39128C40.3934 9.39128 39.7541 10.746 39.6635 12.1905H45.0308C45.0395 11.8286 44.9756 11.4686 44.8427 11.1313C44.7098 10.7941 44.5106 10.4864 44.2567 10.226C44.0028 9.96557 43.6993 9.7577 43.3636 9.61442C43.028 9.47113 42.667 9.39528 42.3015 9.39128ZM0.0906369 0V3.2508H137V0H0.0906369Z",fill:"white"}))},5060:function(e,t,n){n.d(t,{Z:function(){return i}});var o=n(7294),r=n(9163);const a=r.default.div`
3
+ a {
4
+ content: url('https://sdk.r2u.io/assets/r2u-icon-gray.svg');
5
+ height: 22px;
6
+ position: absolute;
7
+ z-index: 999999;
8
+ margin: 10px;
9
+ ${e=>{const t=e.position?e.position.toLowerCase():"";return r.css`
10
+ ${t.includes("left")&&"left: 0;"}
11
+ ${t.includes("right")&&"right: 0;"}
12
+ ${t.includes("bottom")&&"bottom: 0;"}
13
+ ${t.includes("top")&&"top: 0;"}
14
+ ${t.includes("center")&&"left: 0; right: 0; margin: auto;"}
15
+ ${t.includes("absolute")&&"position: absolute;"}
16
+ `}};
17
+ }
18
+ a:hover {
19
+ content: url('https://sdk.r2u.io/assets/r2u-icon.svg');
20
+ }
21
+ `;var i=({position:e})=>o.createElement(a,{position:e},o.createElement("a",{href:"https://r2u.io",target:"_blank",rel:"noopener noreferrer"},o.createElement("img",{alt:""})))},6504:function(e,t,n){n.d(t,{f2:function(){return d}});var o=n(8665),r=n(1580),a=n(5538),i=n(660),l=n(2297),s=n(2367),c=function(e,t,n,o){return new(n||(n=Promise))((function(r,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((o=o.apply(e,t||[])).next())}))};const d=o.Z.createInstance();t.ZP={init:({language:e})=>c(void 0,void 0,void 0,(function*(){const t=s.Z.customer.language,n=(s.Z.customer.slug,e||t||"en"),o=(0,l.Bv)(),c=["translation"];return new Promise(((e,t)=>{d.use(r.Z).init({debug:!1,react:{useSuspense:!1},lng:n,fallbackLng:!1,supportedLngs:["pt","en","es"],ns:c,defaultNS:"translation",fallbackNS:"translation",load:"currentOnly",preload:[n],interpolation:{escapeValue:!1},backend:{backends:[i.Z,a.Z],backendOptions:[{prefix:"i18next_res_r2u_sdk_",enabled:!0,expirationTime:6048e5},{loadPath:`${o}/locales/{{lng}}/{{ns}}.json`,allowMultiloading:!0}]}},(n=>{n&&t(new Error("R2U - Translation init failed")),e()}))}))}))}},9408:function(e,t,n){n.r(t),n.d(t,{default:function(){return He}});var o=n(7294),r=n(3935),a=n(5865),i=n(2367);function l(e){const t=`r2u-webxr-seen-${e}`;return Boolean(JSON.parse(localStorage.getItem(t)||"false"))}function s(e){const t=`r2u-webxr-seen-${e}`;localStorage.setItem(t,JSON.stringify(!0))}function c(e){const t=`r2u-ar-opened-${e}`;return Boolean(JSON.parse(localStorage.getItem(t)||"false"))}function d(e){const t=`r2u-ar-opened-${e}`;localStorage.setItem(t,JSON.stringify(!0))}var m=n(7523),p=n(7374),u=n(2297),f=n(6339),h=n(6504);const g=(0,o.createContext)({}),b=({children:e,openerElement:t,openerEvent:n,onClose:r=(()=>{})})=>{const[a,i]=(0,o.useState)(!1),l=()=>{i(!0)};return t&&n&&t.addEventListener(n,l),o.createElement(g.Provider,{value:{isOpen:a,openModal:l,closeModal:()=>{r(),i(!1)},toggleModal:()=>{i(!a)}}},o.createElement(f.a,{i18n:h.f2},a?e:null))};var v=n(6793),x=n(1841),w=n.n(x),E=n(9163);const y=E.default.div`
3
22
  .text {
4
23
  margin: auto;
5
24
  padding: 10px;
@@ -52,7 +71,7 @@
52
71
  margin-bottom: 20px;
53
72
  padding-bottom: 22px;
54
73
  }
55
- `;var k=n(5060),O=n(3026);const N=E.default.div`
74
+ `;var k=n(5060),C=n(3026);const O=E.default.div`
56
75
  display: block;
57
76
  position: fixed;
58
77
  top: 0;
@@ -74,14 +93,14 @@
74
93
  border: none;
75
94
  outline: none;
76
95
  }
77
- `,j=E.createGlobalStyle`
96
+ `,N=E.createGlobalStyle`
78
97
  html {
79
98
  overflow: hidden;
80
99
  }
81
100
  body {
82
101
  overflow: hidden;
83
102
  }
84
- `;var S=n(9429);var C=({children:e,color:t="white"})=>o.createElement(S.ZP.div,null,o.createElement(N,{color:t},o.createElement(j,null),e));var L=({glb:e})=>{const{closeModal:t}=(0,o.useContext)(g),{t:n}=(0,v.$)();return o.createElement(C,null,o.createElement(y,null,o.createElement(O.Ao,{width:30,height:30,color:"#707070",cursor:"pointer",className:"exit",onClick:()=>{t()}}),o.createElement("div",{className:"text error"},n("fallback.viewer.title")),o.createElement("div",{className:"text top"},n("fallback.viewer.topText")),o.createElement("div",{className:"fallback-viewer-container"},o.createElement(w(),{glbSrc:e})),o.createElement("div",{className:"text bottom"},n("fallback.viewer.bottomText")),o.createElement("div",{className:"watermark"},o.createElement(k.Z,{position:"centerAbsolute"}))))};const P=E.default.div`
103
+ `;var j=n(9429);var L=({children:e,color:t="white"})=>o.createElement(j.ZP.div,null,o.createElement(O,{color:t},o.createElement(N,null),e));var S=({glb:e})=>{const{closeModal:t}=(0,o.useContext)(g),{t:n}=(0,v.$)();return o.createElement(L,null,o.createElement(y,null,o.createElement(C.Ao,{width:30,height:30,color:"#707070",cursor:"pointer",className:"exit",onClick:()=>{t()}}),o.createElement("div",{className:"text error"},n("fallback.viewer.title")),o.createElement("div",{className:"text top"},n("fallback.viewer.topText")),o.createElement("div",{className:"fallback-viewer-container"},o.createElement(w(),{glbSrc:e})),o.createElement("div",{className:"text bottom"},n("fallback.viewer.bottomText")),o.createElement("div",{className:"watermark"},o.createElement(k.Z,{position:"centerAbsolute"}))))};const H=E.default.div`
85
104
  width: 100%;
86
105
  height: 100%;
87
106
  background-image: linear-gradient(to bottom, #e9eaeb, #e4e5e7);
@@ -90,7 +109,7 @@
90
109
  width: 100%;
91
110
  height: 100%;
92
111
  }
93
- `;var z=({glb:e})=>{const{closeModal:t}=(0,o.useContext)(g);return o.createElement(C,null,o.createElement(O.Ao,{width:30,height:30,color:"#707070",cursor:"pointer",className:"exit",onClick:t}),o.createElement(P,null,o.createElement(w(),{glbSrc:e})))};var R=({openerElement:e,openerEvent:t,fallbackOptions:{alertMessage:n,fallback:r},glb:a})=>(n&&e.addEventListener(t,(()=>{alert(n)})),"viewer"===r&&a?o.createElement(b,{openerElement:e,openerEvent:t},o.createElement(L,{glb:a})):"full"===r&&a?o.createElement(b,{openerElement:e,openerEvent:t},o.createElement(z,{glb:a})):null);const A=E.default.div`
112
+ `;var M=({glb:e})=>{const{closeModal:t}=(0,o.useContext)(g);return o.createElement(L,null,o.createElement(C.Ao,{width:30,height:30,color:"#707070",cursor:"pointer",className:"exit",onClick:t}),o.createElement(H,null,o.createElement(w(),{glbSrc:e})))};var z=({openerElement:e,openerEvent:t,fallbackOptions:{alertMessage:n,fallback:r},glb:a})=>(n&&e.addEventListener(t,(()=>{alert(n)})),"viewer"===r&&a?o.createElement(b,{openerElement:e,openerEvent:t},o.createElement(S,{glb:a})):"full"===r&&a?o.createElement(b,{openerElement:e,openerEvent:t},o.createElement(M,{glb:a})):null);const P=E.default.div`
94
113
  display: flex;
95
114
  flex-direction: column;
96
115
  align-items: center;
@@ -224,7 +243,7 @@
224
243
  color: #ffffff;
225
244
  }
226
245
  }
227
- `;var M=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var I=e=>{var{hasWaterMark:t=!0,onOpen:n,activateAR:r}=e,a=M(e,["hasWaterMark","onOpen","activateAR"]);const{closeModal:i}=(0,o.useContext)(g),{t:l}=(0,v.$)(),[s,c]=(0,o.useState)(!1);return(0,o.useEffect)(n,[]),document.addEventListener("visibilitychange",(()=>i()),{once:!0}),window.addEventListener("hashchange",(()=>i()),{once:!0}),o.createElement(C,null,o.createElement(A,null,o.createElement(O.Ao,{width:30,height:30,color:"#707070",cursor:"pointer",className:"exit",onClick:i}),o.createElement("a",{href:"https://r2u.io",className:"powered",target:"_blank",rel:"noopener noreferrer",style:{visibility:t?void 0:"hidden"}},o.createElement("h1",null,l("poweredBy")),o.createElement("img",{src:"https://sdk.r2u.io/assets/r2u-full-white-logo.png",alt:"",className:"icon"})),o.createElement("div",{className:`instructions ${!t&&"no-watermark"}`},o.createElement("div",{className:"border"},o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-cover.jpg",alt:"",className:"example"}),o.createElement("div",{className:"instructionsColumn"},o.createElement("span",null,l("instructions.handMove")),o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-move.png",alt:"",className:"icon"}),o.createElement("span",null,l("instructions.handRotate")),o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-rotate.png",alt:"",className:"icon"})))),o.createElement("div",{className:"text"},o.createElement("h3",null,l("instructions.text"))),o.createElement("button",{type:"button",className:"ar-button",disabled:s,onClick:()=>{r(a),c(!0)}},s?o.createElement("span",null,l("instructions.loading")):o.createElement("span",null,l("instructions.button")))))};const T=E.default.div`
246
+ `;var Z=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var R=e=>{var{hasWaterMark:t=!0,onOpen:n,activateAR:r}=e,a=Z(e,["hasWaterMark","onOpen","activateAR"]);const{closeModal:i}=(0,o.useContext)(g),{t:l}=(0,v.$)(),[s,c]=(0,o.useState)(!1);return(0,o.useEffect)(n,[]),document.addEventListener("visibilitychange",(()=>i()),{once:!0}),window.addEventListener("hashchange",(()=>i()),{once:!0}),o.createElement(L,null,o.createElement(P,null,o.createElement(C.Ao,{width:30,height:30,color:"#707070",cursor:"pointer",className:"exit",onClick:i}),o.createElement("a",{href:"https://r2u.io",className:"powered",target:"_blank",rel:"noopener noreferrer",style:{visibility:t?void 0:"hidden"}},o.createElement("h1",null,l("poweredBy")),o.createElement("img",{src:"https://sdk.r2u.io/assets/r2u-full-white-logo.png",alt:"",className:"icon"})),o.createElement("div",{className:`instructions ${!t&&"no-watermark"}`},o.createElement("div",{className:"border"},o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-cover.jpg",alt:"",className:"example"}),o.createElement("div",{className:"instructionsColumn"},o.createElement("span",null,l("instructions.handMove")),o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-move.png",alt:"",className:"icon"}),o.createElement("span",null,l("instructions.handRotate")),o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-rotate.png",alt:"",className:"icon"})))),o.createElement("div",{className:"text"},o.createElement("h3",null,l("instructions.text"))),o.createElement("button",{type:"button",className:"ar-button",disabled:s,onClick:()=>{r(a),c(!0)}},s?o.createElement("span",null,l("instructions.loading")):o.createElement("span",null,l("instructions.button")))))};const A=E.default.div`
228
247
  display: flex;
229
248
  flex-direction: column;
230
249
  align-items: center;
@@ -337,12 +356,12 @@
337
356
  }
338
357
  }
339
358
  }
340
- `;var W=n.p+"fonts/Roboto.ttf",H=E.createGlobalStyle`
359
+ `;var V=n.p+"fonts/Roboto.ttf",I=E.createGlobalStyle`
341
360
  @font-face {
342
361
  font-family: 'Roboto';
343
- src: url(${W}) format('truetype');
362
+ src: url(${V}) format('truetype');
344
363
  }
345
- `,X=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var Z=e=>{var{onOpen:t,activateAR:n}=e,r=X(e,["onOpen","activateAR"]);const{closeModal:a}=(0,o.useContext)(g),[i,l]=(0,o.useState)(!1);return(0,o.useEffect)(t,[]),document.addEventListener("visibilitychange",(()=>a()),{once:!0}),window.addEventListener("hashchange",(()=>a()),{once:!0}),o.createElement(C,{color:"#F1F1F1"},o.createElement(H,null),o.createElement(T,null,o.createElement("div",{className:"logo"},o.createElement(O.yY,null)),o.createElement("div",{className:"instructions"},o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-cover.jpg",alt:"",className:"example"}),o.createElement("div",{className:"instructions-column"},o.createElement("div",{className:"instruction-unit"},o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-move.png",alt:"",className:"icon"}),o.createElement("span",null,"segure e arraste o produto para mover")),o.createElement("div",{className:"instruction-unit"},o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-rotate.png",alt:"",className:"icon"}),o.createElement("span",null,"segure o produto com dois dedos para girar")))),o.createElement("div",{className:"footer"},o.createElement("span",null,"coloque o produto em seu espaço para verificar todas as dimensões"),o.createElement("button",{type:"button",className:"ar-button",disabled:i,onClick:()=>{n(r),l(!0)}},i?o.createElement("span",null,"carregando ..."):o.createElement("span",null,"veja como fica no seu espaço")))))},$=n.p+"82702c4b09713a8e6a2429734fd2d0f5.png",_=n.p+"a084c0aa29ee4c4dac200f2842cfe66e.png";const U=E.default.div`
364
+ `,T=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var W=e=>{var{onOpen:t,activateAR:n}=e,r=T(e,["onOpen","activateAR"]);const{closeModal:a}=(0,o.useContext)(g),[i,l]=(0,o.useState)(!1);return(0,o.useEffect)(t,[]),document.addEventListener("visibilitychange",(()=>a()),{once:!0}),window.addEventListener("hashchange",(()=>a()),{once:!0}),o.createElement(L,{color:"#F1F1F1"},o.createElement(I,null),o.createElement(A,null,o.createElement("div",{className:"logo"},o.createElement(C.yY,null)),o.createElement("div",{className:"instructions"},o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-cover.jpg",alt:"",className:"example"}),o.createElement("div",{className:"instructions-column"},o.createElement("div",{className:"instruction-unit"},o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-move.png",alt:"",className:"icon"}),o.createElement("span",null,"segure e arraste o produto para mover")),o.createElement("div",{className:"instruction-unit"},o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-rotate.png",alt:"",className:"icon"}),o.createElement("span",null,"segure o produto com dois dedos para girar")))),o.createElement("div",{className:"footer"},o.createElement("span",null,"coloque o produto em seu espaço para verificar todas as dimensões"),o.createElement("button",{type:"button",className:"ar-button",disabled:i,onClick:()=>{n(r),l(!0)}},i?o.createElement("span",null,"carregando ..."):o.createElement("span",null,"veja como fica no seu espaço")))))},$=n.p+"82702c4b09713a8e6a2429734fd2d0f5.png",X=n.p+"a084c0aa29ee4c4dac200f2842cfe66e.png";const _=E.default.div`
346
365
  position: fixed;
347
366
  z-index: 1000;
348
367
  top: 0px;
@@ -407,14 +426,14 @@
407
426
  height: 1.5vh !important;
408
427
 
409
428
  &.slick-active {
410
- background-image: url(${_});
429
+ background-image: url(${X});
411
430
  }
412
431
 
413
432
  button:before {
414
433
  content: '' !important;
415
434
  }
416
435
  }
417
- `;var F=n(6066),J=n.p+"83f0399669efdba15c656d7c17423195.png",D=n.p+"ad55b6672b7bd0340ba4780a05326dc5.png",B=n.p+"d620f91e28306433451f02b1daba365a.png",V=n.p+"b51da9ff8634426464c8c961e247a5ad.png",q=n.p+"1efd7d6f1d3140590592827519a99ae0.png",Y=n.p+"14d30dedf2d3ff75f65eac0bfea1cd79.jpg",G=n.p+"f3338f821a8950fe14196747564ad00c.png",K=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var Q=e=>{var{onOpen:t,activateAR:n}=e,r=K(e,["onOpen","activateAR"]);const{closeModal:a}=(0,o.useContext)(g),[i,l]=(0,o.useState)(!1),[s,c]=(0,o.useState)(!1);let d;(0,o.useEffect)(t,[]),document.addEventListener("visibilitychange",(()=>a()),{once:!0}),window.addEventListener("hashchange",(()=>a()),{once:!0});const m=()=>{null==d||d.slickNext(),console.log(d)};return o.createElement(o.Fragment,null,o.createElement("link",{rel:"stylesheet",type:"text/css",href:"https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css"}),o.createElement("link",{rel:"stylesheet",type:"text/css",href:"https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css"}),o.createElement(U,{background:i?G:Y},o.createElement("div",{style:{width:"100vw",position:"absolute",top:"6vh"}},!i&&o.createElement("img",{src:D,alt:"Realidade Aumentada",style:{width:"60vw",display:"block",margin:"auto",maxHeight:"12vh"}})),i&&o.createElement(F.Z,Object.assign({ref:e=>{d=e}},{dots:!0,infinite:!1,speed:500,slidesToShow:1,slidesToScroll:1,arrows:!1,style:{position:"relative",margin:"auto",top:"50%",msTransform:"translateY(-50%)",transform:"translateY(-50%)"}}),o.createElement("div",{className:"slide"},o.createElement("img",{src:B,alt:"Tutorial 1"}),o.createElement("button",{className:"red-button next",onClick:m},"Próximo")),o.createElement("div",{className:"slide"},o.createElement("img",{src:V,alt:"Tutorial 2"}),o.createElement("button",{className:"red-button next",onClick:m},"Próximo")),o.createElement("div",{className:"slide"},o.createElement("img",{src:q,alt:"Tutorial 3"}),o.createElement("button",{className:"red-button next",disabled:s,onClick:()=>{c(!0),n(r)}},s?"Carregando...":"Começar!"))),!i&&o.createElement("button",{className:"red-button",style:{msTransform:"translateY(-50%)",transform:"translateY(-50%)",position:"absolute",bottom:"22vh",left:"25vw",display:i?"hidden":"auto"},onClick:()=>{l(!0)}},"Veja como usar"),o.createElement("div",{style:{width:"100vw",position:"absolute",bottom:"14vh"}},!i&&o.createElement("img",{src:J,alt:"Logo",style:{width:"50vw",display:"block",margin:"auto",maxHeight:"9vh"}})),o.createElement(O.Ao,{width:40,height:40,color:"#505050",cursor:"pointer",className:"exit",onClick:a,style:{position:"absolute",top:"10px",left:"10px"}})))};const ee=E.default.div`
436
+ `;var B=n(6066),U=n.p+"83f0399669efdba15c656d7c17423195.png",F=n.p+"ad55b6672b7bd0340ba4780a05326dc5.png",J=n.p+"d620f91e28306433451f02b1daba365a.png",D=n.p+"b51da9ff8634426464c8c961e247a5ad.png",q=n.p+"1efd7d6f1d3140590592827519a99ae0.png",Y=n.p+"14d30dedf2d3ff75f65eac0bfea1cd79.jpg",G=n.p+"f3338f821a8950fe14196747564ad00c.png",K=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var Q=e=>{var{onOpen:t,activateAR:n}=e,r=K(e,["onOpen","activateAR"]);const{closeModal:a}=(0,o.useContext)(g),[i,l]=(0,o.useState)(!1),[s,c]=(0,o.useState)(!1);let d;(0,o.useEffect)(t,[]),document.addEventListener("visibilitychange",(()=>a()),{once:!0}),window.addEventListener("hashchange",(()=>a()),{once:!0});const m=()=>{null==d||d.slickNext(),console.log(d)};return o.createElement(o.Fragment,null,o.createElement("link",{rel:"stylesheet",type:"text/css",href:"https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css"}),o.createElement("link",{rel:"stylesheet",type:"text/css",href:"https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css"}),o.createElement(_,{background:i?G:Y},o.createElement("div",{style:{width:"100vw",position:"absolute",top:"6vh"}},!i&&o.createElement("img",{src:F,alt:"Realidade Aumentada",style:{width:"60vw",display:"block",margin:"auto",maxHeight:"12vh"}})),i&&o.createElement(B.Z,Object.assign({ref:e=>{d=e}},{dots:!0,infinite:!1,speed:500,slidesToShow:1,slidesToScroll:1,arrows:!1,style:{position:"relative",margin:"auto",top:"50%",msTransform:"translateY(-50%)",transform:"translateY(-50%)"}}),o.createElement("div",{className:"slide"},o.createElement("img",{src:J,alt:"Tutorial 1"}),o.createElement("button",{className:"red-button next",onClick:m},"Próximo")),o.createElement("div",{className:"slide"},o.createElement("img",{src:D,alt:"Tutorial 2"}),o.createElement("button",{className:"red-button next",onClick:m},"Próximo")),o.createElement("div",{className:"slide"},o.createElement("img",{src:q,alt:"Tutorial 3"}),o.createElement("button",{className:"red-button next",disabled:s,onClick:()=>{c(!0),n(r)}},s?"Carregando...":"Começar!"))),!i&&o.createElement("button",{className:"red-button",style:{msTransform:"translateY(-50%)",transform:"translateY(-50%)",position:"absolute",bottom:"22vh",left:"25vw",display:i?"hidden":"auto"},onClick:()=>{l(!0)}},"Veja como usar"),o.createElement("div",{style:{width:"100vw",position:"absolute",bottom:"14vh"}},!i&&o.createElement("img",{src:U,alt:"Logo",style:{width:"50vw",display:"block",margin:"auto",maxHeight:"9vh"}})),o.createElement(C.Ao,{width:40,height:40,color:"#505050",cursor:"pointer",className:"exit",onClick:a,style:{position:"absolute",top:"10px",left:"10px"}})))};const ee=E.default.div`
418
437
  display: flex;
419
438
  flex-direction: column;
420
439
  align-items: center;
@@ -548,7 +567,7 @@
548
567
  color: #ffffff;
549
568
  }
550
569
  }
551
- `;var te=n.p+"f91bfc6bd31271563d950a9321ba989b.jpg",ne=JSON.parse('{"NE":{"fu":"Hold and drag the product to move","SS":"Hold the product with two fingers to rotate","fL":"Place the product in your surroundings to check all dimensions","LI":"Check this product in your space!","V_":"Loading ..."},"Pn":"powered by"}'),oe=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var re=e=>{var{hasWaterMark:t=!0,onOpen:n,activateAR:r}=e,a=oe(e,["hasWaterMark","onOpen","activateAR"]);const{closeModal:i}=(0,o.useContext)(g),[l,s]=(0,o.useState)(!1);return(0,o.useEffect)(n,[]),document.addEventListener("visibilitychange",(()=>i()),{once:!0}),window.addEventListener("hashchange",(()=>i()),{once:!0}),o.createElement(C,null,o.createElement(ee,null,o.createElement(O.Ao,{width:30,height:30,color:"#707070",cursor:"pointer",className:"exit",onClick:i}),o.createElement("a",{href:"https://r2u.io",className:"powered",target:"_blank",rel:"noopener noreferrer",style:{visibility:t?void 0:"hidden"}},o.createElement("h1",null,ne.Pn),o.createElement("img",{src:"https://sdk.r2u.io/assets/r2u-full-white-logo.png",alt:"",className:"icon"})),o.createElement("div",{className:`instructions ${!t&&"no-watermark"}`},o.createElement("div",{className:"border"},o.createElement("img",{src:te,alt:"",className:"example"}),o.createElement("div",{className:"instructionsColumn"},o.createElement("span",null,ne.NE.fu),o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-move.png",alt:"",className:"icon"}),o.createElement("span",null,ne.NE.SS),o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-rotate.png",alt:"",className:"icon"})))),o.createElement("div",{className:"text"},o.createElement("h3",null,ne.NE.fL)),o.createElement("button",{type:"button",className:"ar-button",disabled:l,onClick:()=>{r(a),s(!0)}},l?o.createElement("span",null,ne.NE.V_):o.createElement("span",null,ne.NE.LI))))};const ae=E.default.div`
570
+ `;var te=n.p+"f91bfc6bd31271563d950a9321ba989b.jpg",ne=JSON.parse('{"NE":{"fu":"Hold and drag the product to move","SS":"Hold the product with two fingers to rotate","fL":"Place the product in your surroundings to check all dimensions","LI":"Check this product in your space!","V_":"Loading ..."},"Pn":"powered by"}'),oe=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var re=e=>{var{hasWaterMark:t=!0,onOpen:n,activateAR:r}=e,a=oe(e,["hasWaterMark","onOpen","activateAR"]);const{closeModal:i}=(0,o.useContext)(g),[l,s]=(0,o.useState)(!1);return(0,o.useEffect)(n,[]),document.addEventListener("visibilitychange",(()=>i()),{once:!0}),window.addEventListener("hashchange",(()=>i()),{once:!0}),o.createElement(L,null,o.createElement(ee,null,o.createElement(C.Ao,{width:30,height:30,color:"#707070",cursor:"pointer",className:"exit",onClick:i}),o.createElement("a",{href:"https://r2u.io",className:"powered",target:"_blank",rel:"noopener noreferrer",style:{visibility:t?void 0:"hidden"}},o.createElement("h1",null,ne.Pn),o.createElement("img",{src:"https://sdk.r2u.io/assets/r2u-full-white-logo.png",alt:"",className:"icon"})),o.createElement("div",{className:`instructions ${!t&&"no-watermark"}`},o.createElement("div",{className:"border"},o.createElement("img",{src:te,alt:"",className:"example"}),o.createElement("div",{className:"instructionsColumn"},o.createElement("span",null,ne.NE.fu),o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-move.png",alt:"",className:"icon"}),o.createElement("span",null,ne.NE.SS),o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-hand-rotate.png",alt:"",className:"icon"})))),o.createElement("div",{className:"text"},o.createElement("h3",null,ne.NE.fL)),o.createElement("button",{type:"button",className:"ar-button",disabled:l,onClick:()=>{r(a),s(!0)}},l?o.createElement("span",null,ne.NE.V_):o.createElement("span",null,ne.NE.LI))))};const ae=E.default.div`
552
571
  display: flex;
553
572
  flex-direction: column;
554
573
  align-items: center;
@@ -682,7 +701,7 @@
682
701
  color: #ffffff;
683
702
  }
684
703
  }
685
- `;var ie=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var le=e=>{var{hasWaterMark:t=!0,onOpen:n,activateAR:r}=e,a=ie(e,["hasWaterMark","onOpen","activateAR"]);const{closeModal:i}=(0,o.useContext)(g),[l,s]=(0,o.useState)(!1);(0,o.useEffect)(n,[]),document.addEventListener("visibilitychange",(()=>i()),{once:!0}),window.addEventListener("hashchange",(()=>i()),{once:!0});return o.createElement(C,null,o.createElement(ae,null,o.createElement(O.Ao,{width:30,height:30,color:"#707070",cursor:"pointer",className:"exit",onClick:i}),o.createElement("a",{href:"https://r2u.io",className:"powered",target:"_blank",rel:"noopener noreferrer",style:{visibility:t?void 0:"hidden"}},o.createElement("h1",null,ne.Pn),o.createElement("img",{src:"https://sdk.r2u.io/assets/r2u-full-white-logo.png",alt:"",className:"icon"})),o.createElement("div",{className:`instructions ${!t&&"no-watermark"}`},o.createElement("div",{className:"border"},o.createElement("video",{autoPlay:!0,muted:!0,loop:!0,playsInline:!0,style:{width:"100%",height:"auto"}},o.createElement("source",{src:"https://storage.googleapis.com/r2u-integrations-bucket/y-digital/V-UP.mp4",type:"video/mp4"})))),o.createElement("button",{type:"button",className:"ar-button",disabled:l,onClick:()=>{r(a),s(!0)}},l?o.createElement("span",null,ne.NE.V_):o.createElement("span",null,"Start the experience"))))},se=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const ce=({customerId:e,sku:t})=>{switch(e){case"89e502ed-f9ae-4147-82e1-f0868d2bb74b":switch(t){case"rav4":return re;case"vodacom-portal":return le;default:return I}case"701ba5cb-152f-4724-9a5f-bb5b1c42d81c":return Z;case"60f02fd9ff756f00088eb928":return Q;default:return I}};var de=e=>{var{openerElement:t,openerEvent:n,customerId:r,sku:a}=e,i=se(e,["openerElement","openerEvent","customerId","sku"]);const l=ce({customerId:r,sku:a});return o.createElement(b,{openerElement:t,openerEvent:n},o.createElement(l,Object.assign({},i,"89e502ed-f9ae-4147-82e1-f0868d2bb74b"===r||"c46943ac-ac1a-4170-8f52-c8705b963538"===r?{hasWaterMark:!1}:{})))};const me=E.default.div`
704
+ `;var ie=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var le=e=>{var{hasWaterMark:t=!0,onOpen:n,activateAR:r}=e,a=ie(e,["hasWaterMark","onOpen","activateAR"]);const{closeModal:i}=(0,o.useContext)(g),[l,s]=(0,o.useState)(!1);(0,o.useEffect)(n,[]),document.addEventListener("visibilitychange",(()=>i()),{once:!0}),window.addEventListener("hashchange",(()=>i()),{once:!0});return o.createElement(L,null,o.createElement(ae,null,o.createElement(C.Ao,{width:30,height:30,color:"#707070",cursor:"pointer",className:"exit",onClick:i}),o.createElement("a",{href:"https://r2u.io",className:"powered",target:"_blank",rel:"noopener noreferrer",style:{visibility:t?void 0:"hidden"}},o.createElement("h1",null,ne.Pn),o.createElement("img",{src:"https://sdk.r2u.io/assets/r2u-full-white-logo.png",alt:"",className:"icon"})),o.createElement("div",{className:`instructions ${!t&&"no-watermark"}`},o.createElement("div",{className:"border"},o.createElement("video",{autoPlay:!0,muted:!0,loop:!0,playsInline:!0,style:{width:"100%",height:"auto"}},o.createElement("source",{src:"https://storage.googleapis.com/r2u-integrations-bucket/y-digital/V-UP.mp4",type:"video/mp4"})))),o.createElement("button",{type:"button",className:"ar-button",disabled:l,onClick:()=>{r(a),s(!0)}},l?o.createElement("span",null,ne.NE.V_):o.createElement("span",null,"Start the experience"))))},se=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const ce=({customerId:e,sku:t})=>{switch(e){case"89e502ed-f9ae-4147-82e1-f0868d2bb74b":switch(t){case"rav4":return re;case"vodacom-portal":return le;default:return R}case"701ba5cb-152f-4724-9a5f-bb5b1c42d81c":return W;case"60f02fd9ff756f00088eb928":return Q;default:return R}};var de=e=>{var{openerElement:t,openerEvent:n,customerId:r,sku:a}=e,i=se(e,["openerElement","openerEvent","customerId","sku"]);const l=ce({customerId:r,sku:a});return o.createElement(b,{openerElement:t,openerEvent:n},o.createElement(l,Object.assign({},i,"89e502ed-f9ae-4147-82e1-f0868d2bb74b"===r||"c46943ac-ac1a-4170-8f52-c8705b963538"===r?{hasWaterMark:!1}:{})))};const me=E.default.div`
686
705
  display: grid;
687
706
  place-content: center;
688
707
  margin-top: 45%;
@@ -777,7 +796,7 @@
777
796
  text-align: center;
778
797
  width: 100%;
779
798
  height: 100%;
780
- `;var fe=()=>{const{closeModal:e}=(0,o.useContext)(g),{t:t}=(0,v.$)();return setTimeout(e,2e3),o.createElement(ue,null,o.createElement(O.mn,{width:60,height:60,cursor:"pointer"}),o.createElement("span",{className:"title"},t("feedback.confirm.title")),o.createElement("span",null,t("feedback.confirm.text")))};var he=({onLike:e,onDislike:t})=>{const{t:n}=(0,v.$)();return o.createElement(pe,null,o.createElement("span",{className:"title"},n("feedback.main.title")),o.createElement("div",{className:"buttons"},o.createElement("button",{type:"button",className:"dislike",onClick:t},o.createElement(O.Ov,{width:30,height:30,cursor:"pointer"})),o.createElement("button",{type:"button",className:"like",onClick:e},o.createElement(O.L7,{width:30,height:30,cursor:"pointer"}))))};var ge=({onLike:e,onDislike:t,onOpen:n})=>{const{closeModal:r}=(0,o.useContext)(g),{t:a}=(0,v.$)(),[i,l]=(0,o.useState)(!1);(0,o.useEffect)(n,[]);return o.createElement(C,{color:"RGBA(0, 0, 0, 0.5)"},o.createElement(me,null,o.createElement("div",{className:"balloon"},i?o.createElement(fe,null):o.createElement(he,{onLike:()=>{l(!0),e()},onDislike:()=>{l(!0),t()}}),o.createElement("button",{type:"button",className:"close",onClick:()=>r()},o.createElement("span",{className:"finish"},a(i?"feedback.confirm.button":"feedback.main.button"))))))},be=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var ve=e=>{var{openerElement:t,openerEvent:n,onClose:r}=e,a=be(e,["openerElement","openerEvent","onClose"]);return o.createElement(b,{onClose:r,openerElement:t,openerEvent:n},o.createElement(ge,Object.assign({onClose:r},a)))};const xe=E.default.div`
799
+ `;var fe=()=>{const{closeModal:e}=(0,o.useContext)(g),{t:t}=(0,v.$)();return setTimeout(e,2e3),o.createElement(ue,null,o.createElement(C.mn,{width:60,height:60,cursor:"pointer"}),o.createElement("span",{className:"title"},t("feedback.confirm.title")),o.createElement("span",null,t("feedback.confirm.text")))};var he=({onLike:e,onDislike:t})=>{const{t:n}=(0,v.$)();return o.createElement(pe,null,o.createElement("span",{className:"title"},n("feedback.main.title")),o.createElement("div",{className:"buttons"},o.createElement("button",{type:"button",className:"dislike",onClick:t},o.createElement(C.Ov,{width:30,height:30,cursor:"pointer"})),o.createElement("button",{type:"button",className:"like",onClick:e},o.createElement(C.L7,{width:30,height:30,cursor:"pointer"}))))};var ge=({onLike:e,onDislike:t,onOpen:n})=>{const{closeModal:r}=(0,o.useContext)(g),{t:a}=(0,v.$)(),[i,l]=(0,o.useState)(!1);(0,o.useEffect)(n,[]);return o.createElement(L,{color:"RGBA(0, 0, 0, 0.5)"},o.createElement(me,null,o.createElement("div",{className:"balloon"},i?o.createElement(fe,null):o.createElement(he,{onLike:()=>{l(!0),e()},onDislike:()=>{l(!0),t()}}),o.createElement("button",{type:"button",className:"close",onClick:()=>r()},o.createElement("span",{className:"finish"},a(i?"feedback.confirm.button":"feedback.main.button"))))))},be=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};var ve=e=>{var{openerElement:t,openerEvent:n,onClose:r}=e,a=be(e,["openerElement","openerEvent","onClose"]);return o.createElement(b,{onClose:r,openerElement:t,openerEvent:n},o.createElement(ge,Object.assign({onClose:r},a)))};const xe=E.default.div`
781
800
  display: flex;
782
801
  width: 100%;
783
802
  height: 100%;
@@ -859,4 +878,4 @@
859
878
  text-align: center;
860
879
  color: #3d71ba;
861
880
  }
862
- `;var we=()=>{const{closeModal:e}=(0,o.useContext)(g),{t:t}=(0,v.$)();return o.createElement(C,{color:"rgba(0, 0, 0, 0.3)"},o.createElement(xe,null,o.createElement("div",{className:"balloon"},o.createElement("div",{className:"info"},o.createElement("h2",null,t("fallback.social.title")),o.createElement("p",null,t("fallback.social.text")),o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-open-safari.png",alt:""})),o.createElement("button",{type:"button",onClick:e},t("fallback.social.button")))))};var Ee=({openerElement:e,openerEvent:t})=>o.createElement(b,{openerElement:e,openerEvent:t},o.createElement(we,null)),ye=n(2151);null!=navigator.xr&&null!=self.XRSession&&null!=navigator.xr.isSessionSupported&&self.XRSession.prototype.requestHitTestSource,self.ResizeObserver,self.IntersectionObserver,(()=>{const e=navigator.userAgent||navigator.vendor||self.opera;let t=!1;(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0)})(),/\bCrOS\b/.test(navigator.userAgent);const ke=/android/i.test(navigator.userAgent),Oe=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!self.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;(()=>{const e=document.createElement("a");Boolean(e.relList&&e.relList.supports&&e.relList.supports("ar"))})(),/Safari\//.test(navigator.userAgent),/firefox/i.test(navigator.userAgent),/OculusBrowser/.test(navigator.userAgent),Oe&&/CriOS\//.test(navigator.userAgent);var Ne=function(e,t,n,o){return new(n||(n=Promise))((function(r,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((o=o.apply(e,t||[])).next())}))},je=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const Se="#no-ar-fallback",Ce=e=>{var{container:t}=e,n=je(e,["container"]);const a="r2u-feedback-open",i=document.createElement("div");return i.className="feedback",t.appendChild(i),r.render(o.createElement(ve,Object.assign({openerElement:i,openerEvent:a},n)),i),{open:()=>{i.dispatchEvent(new Event(a))},render:()=>{}}};function Le({element:e,event:t="click"}){return Ne(this,void 0,void 0,(function*(){e.dispatchEvent(new Event(t))}))}var Pe={attach:function({sku:e,price:t,element:n,callToAction:u,event:f="click",showInstructions:h="once",showFeedback:g=!0,fallbackOptions:b={alertMessage:"Sentimos muito, mas infelizmente seu dispositivo não é compatível com a visualização em Realidade Aumentada"},resize:v}){return Ne(this,void 0,void 0,(function*(){if(!i.Z.init)return Promise.reject(new Error("R2U - Not initialized"));if(!e)return Promise.reject(new Error("R2U - Missing SKU"));const{activateWebXR:x,activateAR:w,WebXREvents:E}=yield a,y=()=>Ne(this,void 0,void 0,(function*(){const e=new URLSearchParams(window.location.search);if(e.has("r2u_ar_mode"))return"webxr"===e.get("r2u_ar_mode");const t=yield p.fm();i.Z.growthbook=new ye.Z({user:{id:t},overrides:i.Z.customer.experiments.overrides});const n="webxr-vs-sceneviewer-v3",{value:o}=i.Z.growthbook.run({key:n,variations:["sceneviewer-v3","webxr-v3"]});return p.KN(n),p.fQ(o),"webxr-v3"===o})),{glb:k,usdz:O,name:N,placement:j,sound:S,resize:C,pdpUrl:L}=yield(0,m.Z)(e),P=v||C,z=P?"resizable":"fixed",[A,M]="pt"===i.Z.customer.language?["pt-BR","BRL"]:["en-US","USD"],I=u?Object.assign(Object.assign({},u),{onClick:()=>{u.onClick(),document.dispatchEvent(new Event("r2u-webxr-close")),p.ar.onClick()}}):void 0,T={glb:k,usdz:O,price:t,placement:j,scale:z,sound:S,callToAction:I,pdpUrl:L,title:N,mode:"ar_preferred"},W=Boolean(i.Z.customer.waterMarkPosition),H=()=>{const e=c("feedback");return g&&!e},X={model:{name:N,description:t?new Intl.NumberFormat(A,{style:"currency",currency:M}).format(Number(t)):"",glb:k,placement:j,resizable:P,url:L,showInstructions:(()=>{switch(h){case"always":return{translate:!0,rotate:!0};case"never":return{translate:!1,rotate:!1};default:const e=l("translate"),t=l("rotate");return{translate:!e,rotate:!t}}})()},beforeClose:e=>{const{open:t}=Ce({container:e,onLike:()=>{p.J1.onLike(),p.XH.onLike()},onDislike:()=>{p.J1.onDislike(),p.XH.onDislike()},onClose:()=>document.dispatchEvent(new Event("r2u-webxr-close")),onOpen:()=>d("feedback")});H()?t():document.dispatchEvent(new Event("r2u-webxr-close"))},callToAction:I,language:i.Z.customer.language};p.J1.componentDidMount();const{open:Z,render:$}=(({glb:e,fallbackOptions:t})=>{const n=document.createElement("div"),a="r2u-open-fallback";document.body.appendChild(n);const i=e=>{r.render(o.createElement(R,Object.assign({openerElement:n,openerEvent:a,fallbackOptions:t},e)),n)};return i({glb:e}),{open:()=>{n.dispatchEvent(new Event(a))},render:i}})({fallbackOptions:b,glb:T.glb}),{open:_,render:U}=(e=>{var{hasWaterMark:t,onOpen:n,activateAR:a,sku:l}=e,s=je(e,["hasWaterMark","onOpen","activateAR","sku"]);const c=document.createElement("div"),d="r2u-open-instructions";document.body.appendChild(c);const m=e=>{r.render(o.createElement(de,Object.assign({openerElement:c,openerEvent:d,onOpen:n,hasWaterMark:t,activateAR:a,customerId:i.Z.customer._id,sku:l},e)),c)};return m(s),{open:()=>{c.dispatchEvent(new Event(d))},render:m}})(Object.assign({hasWaterMark:W,sku:e,activateAR:w,onOpen:()=>d("instructions")},T)),{open:F}=Ce({container:document.body.appendChild(document.createElement("div")),onLike:()=>p.J1.onLike(),onDislike:()=>p.J1.onDislike(),onClose:()=>{},onOpen:()=>d("feedback")}),{open:J}=(()=>{const e=document.createElement("div"),t="r2u-open-social-fallback";return document.body.appendChild(e),r.render(o.createElement(Ee,{openerElement:e,openerEvent:t}),e),{open:()=>{e.dispatchEvent(new Event(t))},render:()=>{}}})(),D=e=>Ne(this,void 0,void 0,(function*(){const t=yield(0,m.Z)(e);T.glb=t.glb,T.usdz=t.usdz,T.placement=t.placement,T.sound=t.sound,T.scale=t.resize?"resizable":"fixed",T.title=t.name,X.model.glb=t.glb,X.model.name=t.name,X.model.placement=t.placement,X.model.url=t.pdpUrl,X.model.resizable=t.resize,U(T),$(T)})),B=()=>Ne(this,void 0,void 0,(function*(){if(Oe&&/instagram|FBAN|FBAV|LinkedInApp/i.test(navigator.userAgent))return void J();var e;ke&&"wall"!==j&&(yield y())?(e=E,p.XH.setSession(),document.addEventListener(e.r2uWebxrSessionStart,p.XH.onSessionStart,{once:!0}),document.addEventListener(e.r2uWebxrSessionEnd,p.XH.onSessionEnd,{once:!0}),document.addEventListener(e.r2uWebxrCompatible,(()=>p.XH.setCompatible(!0)),{once:!0}),document.addEventListener(e.r2uWebxrNotCompatible,(()=>p.XH.setCompatible(!1)),{once:!0}),document.addEventListener(e.r2uWebxrPlaneMapped,p.XH.setPlaneMapped,{once:!0}),document.addEventListener(e.r2uWebxrObjectPlaced,p.XH.setObjectPlaced,{once:!0}),document.addEventListener(e.r2uWebxrShowTranslatingInstructions,(()=>{p.XH.setTranslateInstructions(),s("translate")}),{once:!0}),document.addEventListener(e.r2uWebxrShowRotatingInstructions,(()=>{p.XH.setRotateInstructions(),s("rotate")}),{once:!0}),document.addEventListener(e.r2uWebxrTranslating,(()=>{p.XH.setFirstTranslation(),s("translate")}),{once:!0}),document.addEventListener(e.r2uWebxrRotating,(()=>{p.XH.setFirstRotation(),s("rotate")}),{once:!0}),document.addEventListener(e.r2uWebxrReset,p.XH.setReset,{once:!0}),document.addEventListener(e.r2uWebxrFallbackToSceneviewer,p.XH.onSceneViewerFallback,{once:!0}),window.addEventListener("hashchange",(()=>{window.location.hash===Se&&p.XH.onFallback()}),{once:!0}),document.addEventListener(e.r2uWebxrShare,p.XH.onShare),document.addEventListener(e.r2uWebxrExit,p.XH.onExit),document.addEventListener(e.r2uWebxrCallToAction,p.XH.onCallToAction),document.addEventListener(e.r2uWebxrTranslating,p.XH.onTranslation),document.addEventListener(e.r2uWebxrRotating,p.XH.onRotation),x(X)):(()=>{switch(h){case"always":return!0;case"never":return!1;default:return!c("instructions")}})()?_():w(T),yield p.J1.onClick();const t=(new Date).getTime(),n=()=>{if(document.hidden)return;const e=(new Date).getTime();p.J1.onSessionTimeCollect(e-t),H()&&F(),document.removeEventListener("visibilitychange",n)},o=()=>{const e=(new Date).getTime();p.J1.onSessionTimeCollect(e-t),document.removeEventListener("r2u-webxr-close",o),document.removeEventListener("visibilitychange",n)};document.addEventListener("r2u-webxr-close",o),document.addEventListener("visibilitychange",n)}));n.addEventListener(f,B);const V=new URL(window.location.href),q="true"===V.searchParams.get("r2u_redirect"),Y=V.searchParams.get("r2u_sku");return q&&!i.Z.hasAutoOpenedAR&&(i.Z.hasAutoOpenedAR=!0,Y&&(yield D(Y)),Le({element:n,event:f})),window.addEventListener("hashchange",(()=>{window.location.hash===Se&&(p.J1.onFallback(),n.removeEventListener(f,B),n.addEventListener(f,Z),Le({element:n,event:f}))}),{once:!0}),{setSku:D}}))},open:Le,getLink:function(e){return Ne(this,void 0,void 0,(function*(){if(!i.Z.init)return Promise.reject(new Error("R2U - Not initialized"));if(!e)return Promise.reject(new Error("R2U - Missing SKU"));const t=i.Z.customer._id,n=yield(0,u.U2)(`/sdk-ar/openar-link?customerId=${t}&productSku=${e}`);return Promise.resolve(n)}))}}}}]);
881
+ `;var we=()=>{const{closeModal:e}=(0,o.useContext)(g),{t:t}=(0,v.$)();return o.createElement(L,{color:"rgba(0, 0, 0, 0.3)"},o.createElement(xe,null,o.createElement("div",{className:"balloon"},o.createElement("div",{className:"info"},o.createElement("h2",null,t("fallback.social.title")),o.createElement("p",null,t("fallback.social.text")),o.createElement("img",{src:"https://sdk.r2u.io/assets/instruction-open-safari.png",alt:""})),o.createElement("button",{type:"button",onClick:e},t("fallback.social.button")))))};var Ee=({openerElement:e,openerEvent:t})=>o.createElement(b,{openerElement:e,openerEvent:t},o.createElement(we,null)),ye=n(2151);null!=navigator.xr&&null!=self.XRSession&&null!=navigator.xr.isSessionSupported&&self.XRSession.prototype.requestHitTestSource,self.ResizeObserver,self.IntersectionObserver,(()=>{const e=navigator.userAgent||navigator.vendor||self.opera;let t=!1;(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0)})(),/\bCrOS\b/.test(navigator.userAgent);const ke=/android/i.test(navigator.userAgent),Ce=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!self.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;(()=>{const e=document.createElement("a");Boolean(e.relList&&e.relList.supports&&e.relList.supports("ar"))})(),/Safari\//.test(navigator.userAgent),/firefox/i.test(navigator.userAgent),/OculusBrowser/.test(navigator.userAgent),Ce&&/CriOS\//.test(navigator.userAgent);var Oe=function(e,t,n,o){return new(n||(n=Promise))((function(r,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function l(e){try{s(o.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((o=o.apply(e,t||[])).next())}))},Ne=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const je="#no-ar-fallback",Le=e=>{var{container:t}=e,n=Ne(e,["container"]);const a="r2u-feedback-open",i=document.createElement("div");return i.className="feedback",t.appendChild(i),r.render(o.createElement(ve,Object.assign({openerElement:i,openerEvent:a},n)),i),{open:()=>{i.dispatchEvent(new Event(a))},render:()=>{}}};function Se({element:e,event:t="click"}){return Oe(this,void 0,void 0,(function*(){e.dispatchEvent(new Event(t))}))}var He={attach:function({sku:e,price:t,element:n,callToAction:u,event:f="click",showInstructions:h="once",showFeedback:g=!0,fallbackOptions:b={alertMessage:"Sentimos muito, mas infelizmente seu dispositivo não é compatível com a visualização em Realidade Aumentada"},resize:v}){return Oe(this,void 0,void 0,(function*(){if(!i.Z.init)return Promise.reject(new Error("R2U - Not initialized"));if(!e)return Promise.reject(new Error("R2U - Missing SKU"));const{activateWebXR:x,activateAR:w,WebXREvents:E}=yield a,y=()=>Oe(this,void 0,void 0,(function*(){const e=new URLSearchParams(window.location.search);if(e.has("r2u_ar_mode"))return"webxr"===e.get("r2u_ar_mode");const t=yield p.fm();i.Z.growthbook=new ye.Z({user:{id:t},overrides:i.Z.customer.experiments.overrides});const n="webxr-vs-sceneviewer-v3",{value:o}=i.Z.growthbook.run({key:n,variations:["sceneviewer-v3","webxr-v3"]});return p.KN(n),p.fQ(o),"webxr-v3"===o})),{glb:k,usdz:C,name:O,placement:N,sound:j,resize:L,pdpUrl:S}=yield(0,m.Z)(e),H=v||L,M=H?"resizable":"fixed",[P,Z]="pt"===i.Z.customer.language?["pt-BR","BRL"]:["en-US","USD"],R=u?Object.assign(Object.assign({},u),{onClick:()=>{u.onClick(),document.dispatchEvent(new Event("r2u-webxr-close")),p.ar.onClick()}}):void 0,A={glb:k,usdz:C,price:t,placement:N,scale:M,sound:j,callToAction:R,pdpUrl:S,title:O,mode:"ar_preferred"},V=Boolean(i.Z.customer.waterMarkPosition),I=()=>{const e=c("feedback");return g&&!e},T={model:{name:O,description:t?new Intl.NumberFormat(P,{style:"currency",currency:Z}).format(Number(t)):"",glb:k,placement:N,resizable:H,url:S,showInstructions:(()=>{switch(h){case"always":return{translate:!0,rotate:!0};case"never":return{translate:!1,rotate:!1};default:const e=l("translate"),t=l("rotate");return{translate:!e,rotate:!t}}})()},beforeClose:e=>{const{open:t}=Le({container:e,onLike:()=>{p.J1.onLike(),p.XH.onLike()},onDislike:()=>{p.J1.onDislike(),p.XH.onDislike()},onClose:()=>document.dispatchEvent(new Event("r2u-webxr-close")),onOpen:()=>d("feedback")});I()?t():document.dispatchEvent(new Event("r2u-webxr-close"))},callToAction:R,language:i.Z.customer.language};p.J1.componentDidMount();const{open:W,render:$}=(({glb:e,fallbackOptions:t})=>{const n=document.createElement("div"),a="r2u-open-fallback";document.body.appendChild(n);const i=e=>{r.render(o.createElement(z,Object.assign({openerElement:n,openerEvent:a,fallbackOptions:t},e)),n)};return i({glb:e}),{open:()=>{n.dispatchEvent(new Event(a))},render:i}})({fallbackOptions:b,glb:A.glb}),{open:X,render:_}=(e=>{var{hasWaterMark:t,onOpen:n,activateAR:a,sku:l}=e,s=Ne(e,["hasWaterMark","onOpen","activateAR","sku"]);const c=document.createElement("div"),d="r2u-open-instructions";document.body.appendChild(c);const m=e=>{r.render(o.createElement(de,Object.assign({openerElement:c,openerEvent:d,onOpen:n,hasWaterMark:t,activateAR:a,customerId:i.Z.customer._id,sku:l},e)),c)};return m(s),{open:()=>{c.dispatchEvent(new Event(d))},render:m}})(Object.assign({hasWaterMark:V,sku:e,activateAR:w,onOpen:()=>d("instructions")},A)),{open:B}=Le({container:document.body.appendChild(document.createElement("div")),onLike:()=>p.J1.onLike(),onDislike:()=>p.J1.onDislike(),onClose:()=>{},onOpen:()=>d("feedback")}),{open:U}=(()=>{const e=document.createElement("div"),t="r2u-open-social-fallback";return document.body.appendChild(e),r.render(o.createElement(Ee,{openerElement:e,openerEvent:t}),e),{open:()=>{e.dispatchEvent(new Event(t))},render:()=>{}}})(),F=e=>Oe(this,void 0,void 0,(function*(){const t=yield(0,m.Z)(e);A.glb=t.glb,A.usdz=t.usdz,A.placement=t.placement,A.sound=t.sound,A.scale=t.resize?"resizable":"fixed",A.title=t.name,T.model.glb=t.glb,T.model.name=t.name,T.model.placement=t.placement,T.model.url=t.pdpUrl,T.model.resizable=t.resize,_(A),$(A)})),J=()=>Oe(this,void 0,void 0,(function*(){if(Ce&&/instagram|FBAN|FBAV|LinkedInApp/i.test(navigator.userAgent))return void U();var e;ke&&"wall"!==N&&(yield y())?(e=E,p.XH.setSession(),document.addEventListener(e.r2uWebxrSessionStart,p.XH.onSessionStart,{once:!0}),document.addEventListener(e.r2uWebxrSessionEnd,p.XH.onSessionEnd,{once:!0}),document.addEventListener(e.r2uWebxrCompatible,(()=>p.XH.setCompatible(!0)),{once:!0}),document.addEventListener(e.r2uWebxrNotCompatible,(()=>p.XH.setCompatible(!1)),{once:!0}),document.addEventListener(e.r2uWebxrPlaneMapped,p.XH.setPlaneMapped,{once:!0}),document.addEventListener(e.r2uWebxrObjectPlaced,p.XH.setObjectPlaced,{once:!0}),document.addEventListener(e.r2uWebxrShowTranslatingInstructions,(()=>{p.XH.setTranslateInstructions(),s("translate")}),{once:!0}),document.addEventListener(e.r2uWebxrShowRotatingInstructions,(()=>{p.XH.setRotateInstructions(),s("rotate")}),{once:!0}),document.addEventListener(e.r2uWebxrTranslating,(()=>{p.XH.setFirstTranslation(),s("translate")}),{once:!0}),document.addEventListener(e.r2uWebxrRotating,(()=>{p.XH.setFirstRotation(),s("rotate")}),{once:!0}),document.addEventListener(e.r2uWebxrReset,p.XH.setReset,{once:!0}),document.addEventListener(e.r2uWebxrFallbackToSceneviewer,p.XH.onSceneViewerFallback,{once:!0}),window.addEventListener("hashchange",(()=>{window.location.hash===je&&p.XH.onFallback()}),{once:!0}),document.addEventListener(e.r2uWebxrShare,p.XH.onShare),document.addEventListener(e.r2uWebxrExit,p.XH.onExit),document.addEventListener(e.r2uWebxrCallToAction,p.XH.onCallToAction),document.addEventListener(e.r2uWebxrTranslating,p.XH.onTranslation),document.addEventListener(e.r2uWebxrRotating,p.XH.onRotation),x(T)):(()=>{switch(h){case"always":return!0;case"never":return!1;default:return!c("instructions")}})()?X():w(A),yield p.J1.onClick();const t=(new Date).getTime(),n=()=>{if(document.hidden)return;const e=(new Date).getTime();p.J1.onSessionTimeCollect(e-t),I()&&B(),document.removeEventListener("visibilitychange",n)},o=()=>{const e=(new Date).getTime();p.J1.onSessionTimeCollect(e-t),document.removeEventListener("r2u-webxr-close",o),document.removeEventListener("visibilitychange",n)};document.addEventListener("r2u-webxr-close",o),document.addEventListener("visibilitychange",n)}));n.addEventListener(f,J);const D=new URL(window.location.href),q="true"===D.searchParams.get("r2u_redirect"),Y=D.searchParams.get("r2u_sku");return q&&!i.Z.hasAutoOpenedAR&&(i.Z.hasAutoOpenedAR=!0,Y&&(yield F(Y)),Se({element:n,event:f})),window.addEventListener("hashchange",(()=>{window.location.hash===je&&(p.J1.onFallback(),n.removeEventListener(f,J),n.addEventListener(f,W),Se({element:n,event:f}))}),{once:!0}),{setSku:F}}))},open:Se,getLink:function(e){return Oe(this,void 0,void 0,(function*(){if(!i.Z.init)return Promise.reject(new Error("R2U - Not initialized"));if(!e)return Promise.reject(new Error("R2U - Missing SKU"));const t=i.Z.customer._id,n=yield(0,u.U2)(`/sdk-ar/openar-link?customerId=${t}&productSku=${e}`);return Promise.resolve(n)}))}}}}]);
package/dist/index.js CHANGED
@@ -1 +1 @@
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.c07573b5d759d2703806.bundle.js":603===e?"vendors.5861a640ff3844504854.bundle.js":593===e?"vendors.3c46d05b4bb689659a29.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.23.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
+ !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.74899dd75aec843bf8a8.bundle.js":603===e?"vendors.5861a640ff3844504854.bundle.js":74===e?"vendors.5a5d3beed91e455e8aa4.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.23.2/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(74),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(74),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(74),i.e(850)]).then(i.bind(i,9408)).then((n=>n.default.getLink(e)))},l={isActive:e=>Promise.all([i.e(691),i.e(74),i.e(465)]).then(i.bind(i,6025)).then((n=>n.default.isActive(e))),getData:e=>Promise.all([i.e(691),i.e(74),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(74),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 +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),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.23.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},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.23.0","main":"dist/index.js","unpkg":"dist/index.js","types":"dist/src/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=$(node -p \\"require(\'./package.json\').version\\") 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.13.1","@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"]}}')}}]);
1
+ "use strict";(self.webpackChunkR2U=self.webpackChunkR2U||[]).push([[410],{6504:function(e,t,n){n.d(t,{f2:function(){return u}});var i=n(8665),r=n(1580),a=n(5538),o=n(660),s=n(2297),c=n(2367),l=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function o(e){try{c(i.next(e))}catch(e){a(e)}}function s(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((i=i.apply(e,t||[])).next())}))};const u=i.Z.createInstance();t.ZP={init:({language:e})=>l(void 0,void 0,void 0,(function*(){const t=c.Z.customer.language,n=(c.Z.customer.slug,e||t||"en"),i=(0,s.Bv)(),l=["translation"];return new Promise(((e,t)=>{u.use(r.Z).init({debug:!1,react:{useSuspense:!1},lng:n,fallbackLng:!1,supportedLngs:["pt","en","es"],ns:l,defaultNS:"translation",fallbackNS:"translation",load:"currentOnly",preload:[n],interpolation:{escapeValue:!1},backend:{backends:[o.Z,a.Z],backendOptions:[{prefix:"i18next_res_r2u_sdk_",enabled:!0,expirationTime:6048e5},{loadPath:`${i}/locales/{{lng}}/{{ns}}.json`,allowMultiloading:!0}]}},(n=>{n&&t(new Error("R2U - Translation init failed")),e()}))}))}))}},6526:function(e,t,n){n.r(t),n.d(t,{default:function(){return u}});var i=n(2367),r=n(7374),a=n(2297),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function o(e){try{c(i.next(e))}catch(e){a(e)}}function s(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((i=i.apply(e,t||[])).next())}))};var s=n(188),c=n(6504),l=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function o(e){try{c(i.next(e))}catch(e){a(e)}}function s(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((i=i.apply(e,t||[])).next())}))};function u({customerId:e,language:t,analyticsParams:n={dataLayerIntegration:!0,sessionDuration:30},refreshCache:u=!1}){return l(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}'`);const l=u||(0,s.x1)();i.Z.init=!0,i.Z.refreshCache=l,l&&(yield(0,s.z6)());const d=yield function(e){return o(this,void 0,void 0,(function*(){return yield(0,a.U2)(`/customers/${e}`)}))}(e),f=yield(0,r.ZP)({client:e,dataLayerIntegration:n.dataLayerIntegration,sessionDurationMinutes:n.sessionDuration});i.Z.analytics=f,i.Z.customer=d,yield Promise.all([c.ZP.init({language:t})])}))}},7374:function(e,t,n){n.d(t,{J1:function(){return u},E9:function(){return d},XH:function(){return f},ar:function(){return p},KN:function(){return w},fQ:function(){return g},hN:function(){return v},lY:function(){return y},G0:function(){return h},fm:function(){return b}});var i=n(2085),r=n(5877),a=n(2367),o=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function o(e){try{c(i.next(e))}catch(e){a(e)}}function s(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((i=i.apply(e,t||[])).next())}))};const s="ar_link",c="ar_model_viewer",l="cta",u={componentDidMount:()=>a.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:s},scope:"page"}),onClick:()=>a.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:s}}),onFallback:()=>a.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:s}}),onLike:()=>a.Z.analytics.send({event:i.U3.like,data:{[i.MB.placement]:s}}),onDislike:()=>a.Z.analytics.send({event:i.U3.dislike,data:{[i.MB.placement]:s}}),onSessionTimeCollect:e=>a.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:s}})},d={componentDidMount:()=>a.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:c},scope:"page"}),onClick:()=>a.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:c}}),onSessionTimeCollect:e=>a.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:c}})},f={onSessionStart:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.session_start}),onSessionEnd:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.session_end}),setSession:()=>{a.Z.analytics.webxrSet(i.D1.session_id,(0,r.v4)())},setCompatible:e=>{a.Z.analytics.webxrSet(i.D1.compatible,`${e}`)},onSceneViewerFallback:()=>Promise.all([a.Z.analytics.webxrSend({webxrEvent:i.Ui.scene_viewer_fallback}),a.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:s},context:"webxr"})]),onFallback:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.fallback}),setPlaneMapped:()=>{a.Z.analytics.webxrSet(i.D1.plane_mapped,(new Date).toISOString())},setObjectPlaced:()=>{a.Z.analytics.webxrSet(i.D1.object_placed,(new Date).toISOString())},setTranslateInstructions:()=>{a.Z.analytics.webxrSet(i.D1.translate_instructions,(new Date).toISOString())},setRotateInstructions:()=>{a.Z.analytics.webxrSet(i.D1.rotate_instructions,(new Date).toISOString())},setFirstTranslation:()=>{a.Z.analytics.webxrSet(i.D1.first_translation,(new Date).toISOString())},setFirstRotation:()=>{a.Z.analytics.webxrSet(i.D1.first_rotation,(new Date).toISOString())},setReset:()=>{a.Z.analytics.webxrSet(i.D1.reset,(new Date).toISOString())},onShare:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.share}),onExit:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.exit}),onLike:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.like}),onDislike:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.dislike}),onCallToAction:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.call_to_action}),onTranslation:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.translation}),onRotation:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.rotation})},p={onClick:()=>a.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:l},context:"cart"})},v=e=>{a.Z.analytics.set(i.MB.sku,e)},y=e=>{a.Z.analytics.set(i.MB.manufacturer_id,e)},h=e=>{a.Z.analytics.set(i.MB.is_active_3d,`${e}`),a.Z.analytics.send({event:i.U3.product_page_view})},w=e=>{a.Z.analytics.set(i.MB.experiment_id,e)},g=e=>{a.Z.analytics.set(i.MB.variation_id,e)},b=()=>o(void 0,void 0,void 0,(function*(){const e=yield(0,i.cE)();return a.Z.analytics.set(i.MB.fingerprint,e),e}));t.ZP=({client:e,dataLayerIntegration:t,sessionDurationMinutes:n,info:r={}})=>o(void 0,void 0,void 0,(function*(){const a={version:"6.23.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:n,dataLayerIntegration:t},o=new i.ZP(a,Object.assign(Object.assign({},r),{[i.MB.client]:e}));return yield o.init(),o}))},188:function(e,t,n){n.d(t,{Lu:function(){return d},x1:function(){return f},z6:function(){return u},vj:function(){return l}});var i=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function o(e){try{c(i.next(e))}catch(e){a(e)}}function s(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((i=i.apply(e,t||[])).next())}))};var r=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function o(e){try{c(i.next(e))}catch(e){a(e)}}function s(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((i=i.apply(e,t||[])).next())}))};const a="r2u-sdk-cache",o=new Map,s={get(e){try{return localStorage.getItem(e)}catch(e){return null}},set(e,t){try{localStorage.setItem(e,t)}catch(e){}},remove(e){try{localStorage.removeItem(e)}catch(e){}}};function c(e){return r(this,void 0,void 0,(function*(){return`r2u-sdk-cache-v6.23.2-${yield function(e){return i(this,void 0,void 0,(function*(){try{const t=(new TextEncoder).encode(e),n=yield crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map((e=>e.toString(16).padStart(2,"0"))).join("")}catch(t){return e}}))}(e)}`}))}function l(e){return r(this,void 0,void 0,(function*(){const{path:t,value:n,status:i="ok"}=e,r="notfound"===i?3e4:3e5,a=yield c(t),o={value:n,expiresAt:Date.now()+r};s.set(a,JSON.stringify(o))}))}function u(e){return r(this,void 0,void 0,(function*(){if(e)return s.remove(yield c(e)),void o.delete(e);o.clear();try{for(let e=localStorage.length-1;e>=0;e-=1){const t=localStorage.key(e);t&&t.startsWith(a)&&localStorage.removeItem(t)}}catch(e){}}))}function d(e){return r(this,void 0,void 0,(function*(){const{path:t,fetcher:n,options:i={}}=e;if(!i.refreshCache){const e=yield function(e){return r(this,void 0,void 0,(function*(){const t=s.get(yield c(e));if(t)try{const n=JSON.parse(t);return n.expiresAt<Date.now()?void s.remove(yield c(e)):n.value}catch(t){return void s.remove(yield c(e))}}))}(t);if(void 0!==e)return e}const a=o.get(t);if(a)return a;const l=function(e){return r(this,void 0,void 0,(function*(){try{return yield e.fetcher()}finally{o.delete(e.path)}}))}({path:t,fetcher:n});return o.set(t,l),l}))}function f(){try{return"true"===sessionStorage.getItem("r2u-sdk-refresh-cache")}catch(e){return!1}}},2297:function(e,t,n){n.d(t,{U2:function(){return c},v_:function(){return l},Bv:function(){return u}});var i=n(2367),r=n(188),a=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function o(e){try{c(i.next(e))}catch(e){a(e)}}function s(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((i=i.apply(e,t||[])).next())}))};const o="https://api.r2u.io";function s(e){return a(this,void 0,void 0,(function*(){const t={};i.Z.refreshCache&&(t["Cache-Control"]="max-age=0");const n=yield fetch(`${o}${e}`,{method:"get",headers:t});if(!n.ok&&404!==n.status)throw new Error(`R2U - HTTP ${n.status}`);const a=yield n.json();return yield(0,r.vj)({path:e,value:a,status:404===n.status?"notfound":"ok"}),a}))}function c(e){return a(this,void 0,void 0,(function*(){return(0,r.Lu)({path:e,fetcher:s.bind(null,e),options:{refreshCache:i.Z.refreshCache}})}))}function l(e,t){return a(this,void 0,void 0,(function*(){return(yield fetch(`${o}${e}`,{method:"POST",body:JSON.stringify(t)})).json()}))}const u=()=>"https://sdk.r2u.io"},2367:function(e,t){const n={init:!1,customer:{_id:"",slug:"",language:"en",hdri:null,exposure:null,bloom:null,experiments:{overrides:{}},viewerOptions:{}},analytics:{set:(e,t)=>{},send:({event:e,data:t,scope:n})=>Promise.resolve()},products:{},hasAutoOpenedAR:!1,growthbook:{},refreshCache:!1};t.Z=n},4147:function(e){e.exports=JSON.parse('{"name":"@r2u/javascript-ar-sdk","version":"6.23.2","main":"dist/index.js","unpkg":"dist/index.js","types":"dist/src/index.d.ts","repository":"https://github.com/r2u-io/javascript-ar-sdk","files":["dist"],"scripts":{"dev":"yarn build:dev && webpack serve --mode=development","dev:watch":"REACT_APP_VERSION=$(node -p \\"require(\'./package.json\').version\\") webpack serve --mode=development","build:dev":"REACT_APP_VERSION=$(node -p \\"require(\'./package.json\').version\\") 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.13.2","@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"]}}')}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkR2U=self.webpackChunkR2U||[]).push([[465],{2587:function(e){function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,n,i,r){n=n||"&",i=i||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(n);var o=1e3;r&&"number"==typeof r.maxKeys&&(o=r.maxKeys);var c=e.length;o>0&&c>o&&(c=o);for(var l=0;l<c;++l){var u,d,p,f,v=e[l].replace(s,"%20"),y=v.indexOf(i);y>=0?(u=v.substr(0,y),d=v.substr(y+1)):(u=v,d=""),p=decodeURIComponent(u),f=decodeURIComponent(d),t(a,p)?Array.isArray(a[p])?a[p].push(f):a[p]=[a[p],f]:a[p]=f}return a}},2361:function(e){var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,i,r){return n=n||"&",i=i||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(r){var a=encodeURIComponent(t(r))+i;return Array.isArray(e[r])?e[r].map((function(e){return a+encodeURIComponent(t(e))})).join(n):a+encodeURIComponent(t(e[r]))})).filter(Boolean).join(n):r?encodeURIComponent(t(r))+i+encodeURIComponent(t(e)):""}},7673:function(e,t,n){t.decode=t.parse=n(2587),t.encode=t.stringify=n(2361)},6025:function(e,t,n){n.r(t);var i=n(2367),r=n(7523),a=n(7374),s=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function s(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}c((i=i.apply(e,t||[])).next())}))};t.default={isActive:function(e){return s(this,void 0,void 0,(function*(){if(!i.Z.init)return Promise.reject(new Error("R2U - Not initialized"));if(!e)return Promise.reject(new Error("R2U - Missing SKU"));a.hN(e);try{const{isActive:t,manufacturerId:n}=yield(0,r.Z)(e);return n&&a.lY(n),a.G0(t),t}catch(e){return!1}}))},getData:function(e){return s(this,void 0,void 0,(function*(){if(!i.Z.init)return Promise.reject(new Error("R2U - Not initialized"));if(!e)return Promise.reject(new Error("R2U - Missing SKU"));return yield(0,r.Z)(e)}))}}},7374:function(e,t,n){n.d(t,{J1:function(){return u},E9:function(){return d},XH:function(){return p},ar:function(){return f},KN:function(){return m},fQ:function(){return w},hN:function(){return v},lY:function(){return y},G0:function(){return b},fm:function(){return x}});var i=n(2085),r=n(5877),a=n(2367),s=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function s(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}c((i=i.apply(e,t||[])).next())}))};const o="ar_link",c="ar_model_viewer",l="cta",u={componentDidMount:()=>a.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:o},scope:"page"}),onClick:()=>a.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:o}}),onFallback:()=>a.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o}}),onLike:()=>a.Z.analytics.send({event:i.U3.like,data:{[i.MB.placement]:o}}),onDislike:()=>a.Z.analytics.send({event:i.U3.dislike,data:{[i.MB.placement]:o}}),onSessionTimeCollect:e=>a.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:o}})},d={componentDidMount:()=>a.Z.analytics.send({event:i.U3.impression,data:{[i.MB.placement]:c},scope:"page"}),onClick:()=>a.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:c}}),onSessionTimeCollect:e=>a.Z.analytics.send({event:i.U3.interaction_duration,eventCount:e,data:{[i.MB.placement]:c}})},p={onSessionStart:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.session_start}),onSessionEnd:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.session_end}),setSession:()=>{a.Z.analytics.webxrSet(i.D1.session_id,(0,r.v4)())},setCompatible:e=>{a.Z.analytics.webxrSet(i.D1.compatible,`${e}`)},onSceneViewerFallback:()=>Promise.all([a.Z.analytics.webxrSend({webxrEvent:i.Ui.scene_viewer_fallback}),a.Z.analytics.send({event:i.U3.fallback,data:{[i.MB.placement]:o},context:"webxr"})]),onFallback:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.fallback}),setPlaneMapped:()=>{a.Z.analytics.webxrSet(i.D1.plane_mapped,(new Date).toISOString())},setObjectPlaced:()=>{a.Z.analytics.webxrSet(i.D1.object_placed,(new Date).toISOString())},setTranslateInstructions:()=>{a.Z.analytics.webxrSet(i.D1.translate_instructions,(new Date).toISOString())},setRotateInstructions:()=>{a.Z.analytics.webxrSet(i.D1.rotate_instructions,(new Date).toISOString())},setFirstTranslation:()=>{a.Z.analytics.webxrSet(i.D1.first_translation,(new Date).toISOString())},setFirstRotation:()=>{a.Z.analytics.webxrSet(i.D1.first_rotation,(new Date).toISOString())},setReset:()=>{a.Z.analytics.webxrSet(i.D1.reset,(new Date).toISOString())},onShare:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.share}),onExit:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.exit}),onLike:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.like}),onDislike:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.dislike}),onCallToAction:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.call_to_action}),onTranslation:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.translation}),onRotation:()=>a.Z.analytics.webxrSend({webxrEvent:i.Ui.rotation})},f={onClick:()=>a.Z.analytics.send({event:i.U3.click,data:{[i.MB.placement]:l},context:"cart"})},v=e=>{a.Z.analytics.set(i.MB.sku,e)},y=e=>{a.Z.analytics.set(i.MB.manufacturer_id,e)},b=e=>{a.Z.analytics.set(i.MB.is_active_3d,`${e}`),a.Z.analytics.send({event:i.U3.product_page_view})},m=e=>{a.Z.analytics.set(i.MB.experiment_id,e)},w=e=>{a.Z.analytics.set(i.MB.variation_id,e)},x=()=>s(void 0,void 0,void 0,(function*(){const e=yield(0,i.cE)();return a.Z.analytics.set(i.MB.fingerprint,e),e}));t.ZP=({client:e,dataLayerIntegration:t,sessionDurationMinutes:n,info:r={}})=>s(void 0,void 0,void 0,(function*(){const a={version:"6.23.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:n,dataLayerIntegration:t},s=new i.ZP(a,Object.assign(Object.assign({},r),{[i.MB.client]:e}));return yield s.init(),s}))},7523:function(e,t,n){n.d(t,{Z:function(){return o}});var i=n(2297),r=n(2367),a=n(7673),s=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function s(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}c((i=i.apply(e,t||[])).next())}))};function o(e){return s(this,void 0,void 0,(function*(){if(r.Z.products[e])return Promise.resolve(r.Z.products[e]);const t=a.encode({"product.sku":e,"asset.types":["GLB","USDZ"].join(","),"product_review.status":"RUNNING"}),[n]=yield(0,i.U2)(`/customers/${r.Z.customer._id}/products/assets?${t}`);if(!n)throw new Error("R2U - SKU not found");const s=n.assets||[],o=n.product_reviews||[],c=s.find((e=>"GLB"===e.type)),l=s.find((e=>"USDZ"===e.type)),u={glb:c?c.url:"",usdz:l?l.url:"",isActive:o.length>0,name:n.name,placement:n.placement||"floor",resize:n.resize||!1,sound:n.soundUrl,modelId:n.modelId,manufacturerId:n.manufacturerId,pdpUrl:n.pdpUrl,hdri:n.hdri,exposure:n.exposure,bloom:n.bloom,viewerOptions:n.viewerOptions||{}};return r.Z.products[e]=u,u}))}},2297:function(e,t,n){n.d(t,{U2:function(){return s},v_:function(){return o},Bv:function(){return c}});var i=n(2367),r=function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function s(e){try{c(i.next(e))}catch(e){a(e)}}function o(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,o)}c((i=i.apply(e,t||[])).next())}))};const a="https://api.r2u.io";function s(e){return r(this,void 0,void 0,(function*(){const t={};i.Z.refreshCache&&(t["Cache-Control"]="max-age=0");return(yield fetch(`${a}${e}`,{method:"get",headers:t})).json()}))}function o(e,t){return r(this,void 0,void 0,(function*(){return(yield fetch(`${a}${e}`,{method:"POST",body:JSON.stringify(t)})).json()}))}const c=()=>"https://sdk.r2u.io"},2367:function(e,t){const n={init:!1,customer:{_id:"",slug:"",language:"en",hdri:null,exposure:null,bloom:null,experiments:{overrides:{}},viewerOptions:{}},analytics:{set:(e,t)=>{},send:({event:e,data:t,scope:n})=>Promise.resolve()},products:{},hasAutoOpenedAR:!1,growthbook:{},refreshCache:!1};t.Z=n},4147:function(e){e.exports=JSON.parse('{"name":"@r2u/javascript-ar-sdk","version":"6.23.0","main":"dist/index.js","unpkg":"dist/index.js","types":"dist/src/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=$(node -p \\"require(\'./package.json\').version\\") 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.13.1","@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"]}}')}}]);
1
+ "use strict";(self.webpackChunkR2U=self.webpackChunkR2U||[]).push([[465],{2587:function(e){function n(e,n){return Object.prototype.hasOwnProperty.call(e,n)}e.exports=function(e,r,t,o){r=r||"&",t=t||"=";var i={};if("string"!=typeof e||0===e.length)return i;var u=/\+/g;e=e.split(r);var c=1e3;o&&"number"==typeof o.maxKeys&&(c=o.maxKeys);var a=e.length;c>0&&a>c&&(a=c);for(var s=0;s<a;++s){var f,p,d,l,y=e[s].replace(u,"%20"),m=y.indexOf(t);m>=0?(f=y.substr(0,m),p=y.substr(m+1)):(f=y,p=""),d=decodeURIComponent(f),l=decodeURIComponent(p),n(i,d)?Array.isArray(i[d])?i[d].push(l):i[d]=[i[d],l]:i[d]=l}return i}},2361:function(e){var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,r,t,o){return r=r||"&",t=t||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(o){var i=encodeURIComponent(n(o))+t;return Array.isArray(e[o])?e[o].map((function(e){return i+encodeURIComponent(n(e))})).join(r):i+encodeURIComponent(n(e[o]))})).filter(Boolean).join(r):o?encodeURIComponent(n(o))+t+encodeURIComponent(n(e)):""}},7673:function(e,n,r){n.decode=n.parse=r(2587),n.encode=n.stringify=r(2361)},6025:function(e,n,r){r.r(n);var t=r(2367),o=r(7523),i=r(7374),u=function(e,n,r,t){return new(r||(r=Promise))((function(o,i){function u(e){try{a(t.next(e))}catch(e){i(e)}}function c(e){try{a(t.throw(e))}catch(e){i(e)}}function a(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(u,c)}a((t=t.apply(e,n||[])).next())}))};n.default={isActive:function(e){return u(this,void 0,void 0,(function*(){if(!t.Z.init)return Promise.reject(new Error("R2U - Not initialized"));if(!e)return Promise.reject(new Error("R2U - Missing SKU"));i.hN(e);try{const{isActive:n,manufacturerId:r}=yield(0,o.Z)(e);return r&&i.lY(r),i.G0(n),n}catch(e){return!1}}))},getData:function(e){return u(this,void 0,void 0,(function*(){if(!t.Z.init)return Promise.reject(new Error("R2U - Not initialized"));if(!e)return Promise.reject(new Error("R2U - Missing SKU"));return yield(0,o.Z)(e)}))}}}}]);
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import state from '../state';
11
11
  import getAnalytics from '../services/analytics';
12
12
  import { getCustomer } from '../services/customer';
13
+ import { getSessionRefreshCache, invalidate as invalidateRequestCache, } from '../services/cache';
13
14
  import i18n from '../config/i18n';
14
15
  export default function init({ customerId, language, analyticsParams = {
15
16
  dataLayerIntegration: true,
@@ -21,23 +22,12 @@ export default function init({ customerId, language, analyticsParams = {
21
22
  if (!ObjectIdRegex.test(customerId) && !UUIDv4Regex.test(customerId)) {
22
23
  throw new Error(`Invalid customer '${customerId}'`);
23
24
  }
25
+ const shouldRefreshCache = refreshCache || getSessionRefreshCache();
24
26
  state.init = true;
25
- state.refreshCache = refreshCache;
27
+ state.refreshCache = shouldRefreshCache;
28
+ if (shouldRefreshCache)
29
+ yield invalidateRequestCache();
26
30
  const customer = yield getCustomer(customerId);
27
- // Uncomment block to run a growthbook experiment
28
- // Remember to change values to current running experiment
29
- // const userId = await getUserId()
30
- // state.growthbook = new GrowthBook({
31
- // user: {
32
- // id: userId,
33
- // },
34
- // overrides: customer.experiments.overrides,
35
- // })
36
- // const experimentId = 'experiment-id'
37
- // const { value: variationId } = state.growthbook.run({
38
- // key: experimentId,
39
- // variations: ['A', 'B', 'C'],
40
- // })
41
31
  const analytics = yield getAnalytics({
42
32
  client: customerId,
43
33
  dataLayerIntegration: analyticsParams.dataLayerIntegration,
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/methods/init.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,MAAM,UAAU,CAAA;AAE5B,OAAO,YAAY,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,IAAI,MAAM,gBAAgB,CAAA;AAYjC,MAAM,CAAC,OAAO,UAAgB,IAAI,CAAC,EACjC,UAAU,EACV,QAAQ,EACR,eAAe,GAAG;IAChB,oBAAoB,EAAE,IAAI;IAC1B,eAAe,EAAE,EAAE;CACpB,EACD,YAAY,GAAG,KAAK,GACb;;QACP,MAAM,aAAa,GAAG,uCAAuC,CAAA;QAC7D,MAAM,WAAW,GACf,0EAA0E,CAAA;QAC5E,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;YACpE,MAAM,IAAI,KAAK,CAAC,qBAAqB,UAAU,GAAG,CAAC,CAAA;SACpD;QAED,KAAK,CAAC,IAAI,GAAG,IAAI,CAAA;QACjB,KAAK,CAAC,YAAY,GAAG,YAAY,CAAA;QAEjC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,UAAU,CAAC,CAAA;QAE9C,iDAAiD;QACjD,0DAA0D;QAE1D,mCAAmC;QAEnC,sCAAsC;QACtC,YAAY;QACZ,kBAAkB;QAClB,OAAO;QACP,+CAA+C;QAC/C,KAAK;QAEL,uCAAuC;QACvC,wDAAwD;QACxD,uBAAuB;QACvB,iCAAiC;QACjC,KAAK;QAEL,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC;YACnC,MAAM,EAAE,UAAU;YAClB,oBAAoB,EAAE,eAAe,CAAC,oBAAoB;YAC1D,sBAAsB,EAAE,eAAe,CAAC,eAAe;SAMxD,CAAC,CAAA;QAEF,KAAK,CAAC,SAAS,GAAG,SAAS,CAAA;QAC3B,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAA;QAEzB,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAA;IAC9C,CAAC;CAAA"}
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/methods/init.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,MAAM,UAAU,CAAA;AAE5B,OAAO,YAAY,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EACL,sBAAsB,EACtB,UAAU,IAAI,sBAAsB,GACrC,MAAM,iBAAiB,CAAA;AAExB,OAAO,IAAI,MAAM,gBAAgB,CAAA;AAYjC,MAAM,CAAC,OAAO,UAAgB,IAAI,CAAC,EACjC,UAAU,EACV,QAAQ,EACR,eAAe,GAAG;IAChB,oBAAoB,EAAE,IAAI;IAC1B,eAAe,EAAE,EAAE;CACpB,EACD,YAAY,GAAG,KAAK,GACb;;QACP,MAAM,aAAa,GAAG,uCAAuC,CAAA;QAC7D,MAAM,WAAW,GACf,0EAA0E,CAAA;QAC5E,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;YACpE,MAAM,IAAI,KAAK,CAAC,qBAAqB,UAAU,GAAG,CAAC,CAAA;SACpD;QAED,MAAM,kBAAkB,GAAG,YAAY,IAAI,sBAAsB,EAAE,CAAA;QAEnE,KAAK,CAAC,IAAI,GAAG,IAAI,CAAA;QACjB,KAAK,CAAC,YAAY,GAAG,kBAAkB,CAAA;QAEvC,IAAI,kBAAkB;YAAE,MAAM,sBAAsB,EAAE,CAAA;QAEtD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,UAAU,CAAC,CAAA;QAE9C,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC;YACnC,MAAM,EAAE,UAAU;YAClB,oBAAoB,EAAE,eAAe,CAAC,oBAAoB;YAC1D,sBAAsB,EAAE,eAAe,CAAC,eAAe;SACxD,CAAC,CAAA;QAEF,KAAK,CAAC,SAAS,GAAG,SAAS,CAAA;QAC3B,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAA;QAEzB,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAA;IAC9C,CAAC;CAAA"}
@@ -0,0 +1,18 @@
1
+ export declare function readCache(path: string): Promise<unknown | undefined>;
2
+ interface WriteCacheArgs {
3
+ path: string;
4
+ value: unknown;
5
+ status?: 'ok' | 'notfound';
6
+ }
7
+ export declare function writeCache(args: WriteCacheArgs): Promise<void>;
8
+ export declare function invalidate(path?: string): Promise<void>;
9
+ interface DedupedFetchArgs<T> {
10
+ path: string;
11
+ fetcher: () => Promise<T>;
12
+ options?: {
13
+ refreshCache?: boolean;
14
+ };
15
+ }
16
+ export declare function dedupedFetch<T>(args: DedupedFetchArgs<T>): Promise<T>;
17
+ export declare function getSessionRefreshCache(): boolean;
18
+ export {};