/*! For license information please see ar.bundle.js.LICENSE.txt */
"use strict";(self.webpackChunkR2U=self.webpackChunkR2U||[]).push([[850],{6504:function(e,t,n){n.d(t,{f2:function(){return d}});var o=n(8665),a=n(1580),r=n(5538),i=n(660),l=n(2297),s=n(2367),c=function(e,t,n,o){return new(n||(n=Promise))((function(a,r){function i(e){try{s(o.next(e))}catch(e){r(e)}}function l(e){try{s(o.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?a(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,o=e||t||"en",c=(0,l.Bv)(),m=yield(0,l.ki)(`${c}/locales/${o}/${n}.json`),u=m?n:"translation",p=["translation",...m?[n]:[]];return new Promise(((e,t)=>{d.use(a.Z).init({debug:!1,react:{useSuspense:!1},lng:o,fallbackLng:!1,supportedLngs:["pt","en","es"],ns:p,defaultNS:u,fallbackNS:"translation",load:"currentOnly",preload:[o],interpolation:{escapeValue:!1},backend:{backends:[i.Z,r.Z],backendOptions:[{prefix:"i18next_res_r2u_sdk_",enabled:!0,expirationTime:6048e5},{loadPath:`${c}/locales/{{lng}}/{{ns}}.json`,allowMultiloading:!0}]}},(n=>{n&&t(new Error("R2U - Translation init failed")),e()}))}))}))}},4804:function(e,t,n){n.r(t),n.d(t,{default:function(){return ye}});var o=n(7294),a=n(3935),r=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),u=n(7374),p=n(2297),f=n(6339),g=n(6504);const b=(0,o.createContext)({}),h=({children:e,openerElement:t,openerEvent:n,onClose:a=(()=>{})})=>{const[r,i]=(0,o.useState)(!1),l=()=>{i(!0)};return t&&n&&t.addEventListener(n,l),o.createElement(b.Provider,{value:{isOpen:r,openModal:l,closeModal:()=>{a(),i(!1)},toggleModal:()=>{i(!r)}}},o.createElement(f.a,{i18n:g.f2},r?e:null))};var v=n(6793),x=n(1841),w=n.n(x),E=n(9163);const y=E.default.div`
  .text {
    margin: auto;
    padding: 10px;
    font-family: proxima-nova, sans-serif;
    font-size: 16px;
    font-weight: 300;
    font-stretch: normal;
    font-style: normal;
    line-height: 1.25;
    letter-spacing: normal;
    text-align: center;
    color: #222222;
    b {
      font-weight: bold;
    }
  }

  .error {
    margin-top: 100px;
    font-size: 24px;
    font-weight: bold;
    line-height: 1.21;
    color: #d45b5b;
  }

  .top {
    width: 250px;
  }

  .bottom {
    width: 250px;
  }

  .fallback-viewer-container {
    width: 324px;
    height: 324px;
    margin: auto;
    margin-top: 10px;
    margin-bottom: 10px;
    background-image: linear-gradient(to bottom, #e9eaeb, #e4e5e7);

    model-viewer {
      width: 100%;
      height: 100%;
    }
  }

  .watermark {
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 22px;
  }
`;var k=n(5060),O=n(3026);const j=E.default.div`
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: ${({color:e})=>e};
  z-index: 9999999;
  overflow: auto;

  .exit {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999999;
    margin: 12px;
    padding: 3px;
    background: none;
    border: none;
    outline: none;
  }
`,N=E.createGlobalStyle`
  html {
    overflow: hidden;
  }
  body {
    overflow: hidden;
  }
`;var S=n(9429);var C=({children:e,color:t="white"})=>o.createElement(S.ZP.div,null,o.createElement(j,{color:t},o.createElement(N,null),e));var L=({glb:e})=>{const{closeModal:t}=(0,o.useContext)(b),{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`
  width: 100%;
  height: 100%;
  background-image: linear-gradient(to bottom, #e9eaeb, #e4e5e7);

  model-viewer {
    width: 100%;
    height: 100%;
  }
`;var z=({glb:e})=>{const{closeModal:t}=(0,o.useContext)(b);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:a},glb:r})=>(n&&e.addEventListener(t,(()=>{alert(n)})),"viewer"===a&&r?o.createElement(h,{openerElement:e,openerEvent:t},o.createElement(L,{glb:r})):"full"===a&&r?o.createElement(h,{openerElement:e,openerEvent:t},o.createElement(z,{glb:r})):null);const A=E.default.div`
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;

  .powered {
    display: flex;
    text-decoration: unset;
    flex-direction: row;
    align-items: center;
    margin-top: 2%;

    img {
      width: 32.9px;
      height: 17px;
      object-fit: contain;
      margin: 5px;
      filter: brightness(85%);
    }
    h1 {
      width: 90px;
      height: 20px;
      font-family: proxima-Nova, sans-serif;
      font-size: 16px;
      font-weight: bold;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.25;
      letter-spacing: normal;
      text-align: center;
      color: #d8d8d8;
    }
  }

  .instructions {
    width: min(90vw, 50vh);
    height: min(90vw, 50vh);
    border: solid 20px #f2f2f2;
    margin: 12px;

    .border {
      border-radius: 20px;
      box-shadow: 0 0 0 20px #f2f2f2;
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
    }

    .example {
      height: 100%;
      object-fit: contain;
      border-radius: 20px;
    }

    .instructionsColumn {
      display: flex;
      flex-direction: column;
      justify-content: space-evenly;
      align-items: center;
      width: 50%;
      span {
        font-family: proxima-Nova, sans-serif;
        font-size: 14px;
        font-weight: bold;
        font-stretch: normal;
        font-style: normal;
        line-height: 1.22;
        letter-spacing: normal;
        text-align: center;
        color: #000000;
      }
      .icon {
        width: 50%;
        object-fit: contain;
      }
    }
  }

  .no-watermark {
    margin-top: 60px;
  }

  .text {
    h1 {
      font-family: proxima-Nova, sans-serif;
      font-size: 26px;
      font-weight: bold;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.23;
      letter-spacing: normal;
      text-align: center;
      color: #000000;
    }
    h3 {
      font-family: proxima-Nova, sans-serif;
      font-size: 18px;
      font-weight: 300;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.22;
      letter-spacing: normal;
      text-align: center;
      color: #707070;
      margin: 5px 20px 30px 20px;
    }
  }

  .ar-button {
    width: calc(100vw - 40px);
    height: 50px;
    border: none;
    margin: auto;
    border-radius: 23px;
    background-color: #000000;
    &:disabled {
      background-color: gray;
    }

    span {
      font-family: proxima-Nova, sans-serif;
      font-size: 18px;
      font-weight: bold;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.22;
      letter-spacing: normal;
      text-align: center;
      color: #ffffff;
    }
  }
`;var 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 a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]])}return n};var M=e=>{var{hasWaterMark:t=!0,onOpen:n,activateAR:a}=e,r=T(e,["hasWaterMark","onOpen","activateAR"]);const{closeModal:i}=(0,o.useContext)(b),{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}),t?o.createElement("a",{href:"https://r2u.io",className:"powered",target:"_blank",rel:"noopener noreferrer"},o.createElement("h1",null,l("poweredBy")),o.createElement("img",{src:"https://sdk.r2u.io/assets/r2u-full-white-logo.png",alt:"",className:"icon"})):null,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:()=>{a(r),c(!0)}},s?o.createElement("span",null,l("instructions.loading")):o.createElement("span",null,l("instructions.button")))))};const I=E.default.div`
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100vh;

  .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f80032;
    width: 100%;
    border-radius: 0px 0px 16px 16px;
    padding: 28px 0px;
  }

  .instructions {
    overflow: hidden;
    width: 100%;
    margin: 29px 0;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;

    .example {
      width: 25vh;
      height: auto;
      border-radius: 16px;
    }

    @media screen and (max-width: 359px) {
      .example {
        width: 20vh;
      }
    }

    .instructions-column {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-evenly;

      .instruction-unit {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;

        .icon {
          width: 50px;
          height: auto;
        }

        span {
          font-family: 'Roboto', sans-serif;
          font-weight: 400;
          margin-top: 12px;
          color: #333333;
          width: 140px;
          font-size: 14px;
          text-align: center;
        }

        @media screen and (max-width: 359px) {
          span {
            width: 130px;
          }
        }
      }
    }
  }

  .footer {
    padding-top: 32px;
    margin-top: 28px;
    border-radius: 16px 16px 0px 0px;
    width: 100%;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;

    span {
      font-family: 'Roboto', sans-serif;
      font-weight: 400;
      width: 280px;
      font-size: 16px;
      color: #333333;
      text-align: center;
    }

    @media screen and (max-width: 359px) {
      span {
        width: 200px;
      }
    }

    .ar-button {
      margin: 24px;
      width: 90%;
      border: none;
      height: 54px;
      border-radius: 12px;
      background-color: #f80032;
      span {
        font-family: 'Roboto', sans-serif;
        font-weight: 700;
        color: #ffffff;
        font-size: 17px;
      }
    }
  }
`;var W=n.p+"fonts/Roboto.ttf",X=E.createGlobalStyle`
  @font-face {
    font-family: 'Roboto';
    src: url(${W}) format('truetype');
  }
`,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 a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]])}return n};var H=e=>{var{onOpen:t,activateAR:n}=e,a=Z(e,["onOpen","activateAR"]);const{closeModal:r}=(0,o.useContext)(b),[i,l]=(0,o.useState)(!1);return(0,o.useEffect)(t,[]),document.addEventListener("visibilitychange",(()=>r()),{once:!0}),window.addEventListener("hashchange",(()=>r()),{once:!0}),o.createElement(C,{color:"#F1F1F1"},o.createElement(X,null),o.createElement(I,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(a),l(!0)}},i?o.createElement("span",null,"carregando ..."):o.createElement("span",null,"veja como fica no seu espaço")))))},$=n.p+"82702c4b09713a8e6a2429734fd2d0f5.png",U=n.p+"a084c0aa29ee4c4dac200f2842cfe66e.png";const _=E.default.div`
  position: fixed;
  z-index: 1000;
  top: 0px;
  left: 0px;
  height: 100vh;
  width: 100vw;
  background-size: cover;
  background-position: center;
  background-image: url(${({background:e})=>e});

  img {
    object-fit: contain;
  }

  .slide {
    height: 100vh;
    position: relative;

    img {
      width: 90vw;
      max-width: 500px;
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
    }
  }

  .red-button {
    background-color: rgb(227, 7, 24);
    border: none;
    border-radius: 2.5vw;
    padding: 1.2vh 5vw;
    color: #fff;
    margin: 0 auto;
    display: block;
    font-size: 2.3vh;
    width: 50vw;
    box-shadow: 0 0 20px #00000030;

    &.next {
      position: absolute;
      left: 50%;
      bottom: 17vh;
      transform: translatex(-50%);
    }
  }

  .red-button:disabled {
    opacity: 0.6;
  }

  .slick-dots {
    position: absolute;
    bottom: 13vh;
  }

  li {
    background-image: url(${$});
    background-size: 100% 100%;
    width: 1.5vh !important;
    height: 1.5vh !important;

    &.slick-active {
      background-image: url(${U});
    }

    button:before {
      content: '' !important;
    }
  }
`;var F=n(6066),D=n.p+"83f0399669efdba15c656d7c17423195.png",J=n.p+"ad55b6672b7bd0340ba4780a05326dc5.png",B=n.p+"d620f91e28306433451f02b1daba365a.png",q=n.p+"b51da9ff8634426464c8c961e247a5ad.png",Y=n.p+"1efd7d6f1d3140590592827519a99ae0.png",V=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 a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]])}return n};var Q=e=>{var{onOpen:t,activateAR:n}=e,a=K(e,["onOpen","activateAR"]);const{closeModal:r}=(0,o.useContext)(b),[i,l]=(0,o.useState)(!1),[s,c]=(0,o.useState)(!1);let d;(0,o.useEffect)(t,[]),document.addEventListener("visibilitychange",(()=>r()),{once:!0}),window.addEventListener("hashchange",(()=>r()),{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:V},o.createElement("div",{style:{width:"100vw",position:"absolute",top:"6vh"}},!i&&o.createElement("img",{src:J,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:q,alt:"Tutorial 2"}),o.createElement("button",{className:"red-button next",onClick:m},"Próximo")),o.createElement("div",{className:"slide"},o.createElement("img",{src:Y,alt:"Tutorial 3"}),o.createElement("button",{className:"red-button next",disabled:s,onClick:()=>{c(!0),n(a)}},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:D,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:r,style:{position:"absolute",top:"10px",left:"10px"}})))},ee=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 a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]])}return n};const te=({customerId:e})=>{switch(e){case"701ba5cb-152f-4724-9a5f-bb5b1c42d81c":return H;case"60f02fd9ff756f00088eb928":return Q;default:return M}};var ne=e=>{var{openerElement:t,openerEvent:n,customerId:a}=e,r=ee(e,["openerElement","openerEvent","customerId"]);const i=te({customerId:a});return o.createElement(h,{openerElement:t,openerEvent:n},o.createElement(i,Object.assign({},r)))};const oe=E.default.div`
  display: grid;
  place-content: center;
  margin-top: 45%;

  span {
    font-family: Proxima-Nova, sans-serif;
    font-stretch: normal;
    font-style: normal;
    line-height: 1.25;
  }

  .balloon {
    width: min(90vh, 38vh);
    height: min(90vw, 32vh);
    border-radius: 10px;
    box-shadow: 0 0 32px 0 rgba(0, 0, 0, 0.49);
    background-color: #ffffff;
    display: flex;
    flex-direction: column;

    .title {
      font-weight: bold;
      line-height: 1.25;
      letter-spacing: normal;
      text-align: center;
      color: #000000;
      margin-bottom: 2px;
    }

    button.close {
      border: none;
      border-top: solid 1px #c9c9c9;
      outline: none;
      background: none;
      display: flex;
      justify-content: center;
      align-items: center;
      margin-top: auto;
      height: 50px;

      span {
        font-size: 14px;
        line-height: 1.25;
        letter-spacing: normal;
        text-align: center;
        color: #000000;
      }
    }
  }
`,ae=E.default.div`
  display: flex;
  flex-direction: column;
  justify-content: left;
  align-items: center;
  width: 100%;
  height: 100%;

  .title {
    padding: 20px;
    padding-bottom: 0;
  }

  .buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
    width: 100%;
    height: 100%;

    & > button {
      width: 24%;
      height: 55px;
      border-radius: 5px;
      border: none;
      margin: none;
    }

    .dislike {
      background-color: #d96a6a;
    }

    .like {
      background-color: #a9ce8f;
    }
  }
`,re=E.default.div`
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  text-align: center;
  width: 100%;
  height: 100%;
`;var ie=()=>{const{closeModal:e}=(0,o.useContext)(b),{t:t}=(0,v.$)();return setTimeout(e,2e3),o.createElement(re,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 le=({onLike:e,onDislike:t})=>{const{t:n}=(0,v.$)();return o.createElement(ae,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 se=({onLike:e,onDislike:t,onOpen:n})=>{const{closeModal:a}=(0,o.useContext)(b),{t:r}=(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(oe,null,o.createElement("div",{className:"balloon"},i?o.createElement(ie,null):o.createElement(le,{onLike:()=>{l(!0),e()},onDislike:()=>{l(!0),t()}}),o.createElement("button",{type:"button",className:"close",onClick:()=>a()},o.createElement("span",{className:"finish"},r(i?"feedback.confirm.button":"feedback.main.button"))))))},ce=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 a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]])}return n};var de=e=>{var{openerElement:t,openerEvent:n,onClose:a}=e,r=ce(e,["openerElement","openerEvent","onClose"]);return o.createElement(h,{onClose:a,openerElement:t,openerEvent:n},o.createElement(se,Object.assign({onClose:a},r)))};const me=E.default.div`
  display: flex;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;

  .balloon {
    height: max-content;
    width: 90%;
    height: 50%;
    background-color: white;
    border-radius: 10px;

    position: relative;

    display: flex;
    flex-direction: column;
  }

  .info {
    padding: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    img {
      max-width: 100%;
      margin: 0;
    }

    h2 {
      margin: 5px 10px 5px 10px;
      font-family: Proxima-Nova, sans-serif;
      font-size: 18px;
      font-weight: bold;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.22;
      letter-spacing: normal;
      text-align: center;
      color: #222222;
    }

    p {
      margin: 5px 3px 15px 3px;
      font-family: Proxima-Nova, sans-serif;
      font-size: 14px;
      font-weight: normal;
      font-stretch: normal;
      font-style: normal;
      line-height: 1.21;
      letter-spacing: normal;
      text-align: center;
      color: #222222;

      u {
        font-weight: bold;
      }
    }
  }

  button {
    padding: 20px;
    border: none;
    border-top: solid 0.1px rgba(0, 0, 0, 0.2);
    margin-top: auto;
    height: 20%;
    outline: none;
    background: none;

    font-family: Proxima-Nova, sans-serif;
    font-size: 16px;
    font-weight: normal;
    font-stretch: normal;
    font-style: normal;
    line-height: 1.19;
    letter-spacing: normal;
    text-align: center;
    color: #3d71ba;
  }
`;var ue=()=>{const{closeModal:e}=(0,o.useContext)(b),{t:t}=(0,v.$)();return o.createElement(C,{color:"rgba(0, 0, 0, 0.3)"},o.createElement(me,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 pe=({openerElement:e,openerEvent:t})=>o.createElement(h,{openerElement:e,openerEvent:t},o.createElement(ue,null)),fe=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 ge=/android/i.test(navigator.userAgent),be=/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),be&&/CriOS\//.test(navigator.userAgent);var he=function(e,t,n,o){return new(n||(n=Promise))((function(a,r){function i(e){try{s(o.next(e))}catch(e){r(e)}}function l(e){try{s(o.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?a(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())}))},ve=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 a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]])}return n};const xe="#no-ar-fallback",we=e=>{var{container:t}=e,n=ve(e,["container"]);const r="r2u-feedback-open",i=document.createElement("div");return i.className="feedback",t.appendChild(i),a.render(o.createElement(de,Object.assign({openerElement:i,openerEvent:r},n)),i),{open:()=>{i.dispatchEvent(new Event(r))},render:()=>{}}};function Ee({element:e,event:t="click"}){return he(this,void 0,void 0,(function*(){e.dispatchEvent(new Event(t))}))}var ye={attach:function({sku:e,price:t,element:n,callToAction:p,event:f="click",showInstructions:g="once",showFeedback:b=!0,fallbackOptions:h={alertMessage:"Sentimos muito, mas infelizmente seu dispositivo não é compatível com a visualização em Realidade Aumentada"}}){return he(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:v,activateAR:x,WebXREvents:w}=yield r,E=()=>he(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 u.fm();i.Z.growthbook=new fe.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 u.KN(n),u.fQ(o),"webxr-v3"===o})),{glb:y,usdz:k,name:O,placement:j,sound:N,resize:S,pdpUrl:C}=yield(0,m.Z)(e),L=S?"resizable":"fixed",[P,z]="pt"===i.Z.customer.language?["pt-BR","BRL"]:["en-US","USD"],A=p?Object.assign(Object.assign({},p),{onClick:()=>{p.onClick(),document.dispatchEvent(new Event("r2u-webxr-close")),u.ar.onClick()}}):void 0,T={glb:y,usdz:k,price:t,placement:j,scale:L,sound:N,callToAction:A,pdpUrl:C,title:O,mode:"ar_preferred"},M=Boolean(i.Z.customer.waterMarkPosition),I=()=>{const e=c("feedback");return b&&!e},W={model:{name:O,description:t?new Intl.NumberFormat(P,{style:"currency",currency:z}).format(Number(t)):"",glb:y,placement:j,resizable:S,url:C,showInstructions:(()=>{switch(g){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}=we({container:e,onLike:()=>{u.J1.onLike(),u.XH.onLike()},onDislike:()=>{u.J1.onDislike(),u.XH.onDislike()},onClose:()=>document.dispatchEvent(new Event("r2u-webxr-close")),onOpen:()=>d("feedback")});I()?t():document.dispatchEvent(new Event("r2u-webxr-close"))},callToAction:A,language:i.Z.customer.language};u.J1.componentDidMount();const{open:X,render:Z}=(({glb:e,fallbackOptions:t})=>{const n=document.createElement("div"),r="r2u-open-fallback";document.body.appendChild(n);const i=e=>{a.render(o.createElement(R,Object.assign({openerElement:n,openerEvent:r,fallbackOptions:t},e)),n)};return i({glb:e}),{open:()=>{n.dispatchEvent(new Event(r))},render:i}})({fallbackOptions:h,glb:T.glb}),{open:H,render:$}=(e=>{var{hasWaterMark:t,onOpen:n,activateAR:r}=e,l=ve(e,["hasWaterMark","onOpen","activateAR"]);const s=document.createElement("div"),c="r2u-open-instructions";document.body.appendChild(s);const d=e=>{a.render(o.createElement(ne,Object.assign({openerElement:s,openerEvent:c,onOpen:n,hasWaterMark:t,activateAR:r,customerId:i.Z.customer._id},e)),s)};return d(l),{open:()=>{s.dispatchEvent(new Event(c))},render:d}})(Object.assign({hasWaterMark:M,activateAR:x,onOpen:()=>d("instructions")},T)),{open:U}=we({container:document.body.appendChild(document.createElement("div")),onLike:()=>u.J1.onLike(),onDislike:()=>u.J1.onDislike(),onClose:()=>{},onOpen:()=>d("feedback")}),{open:_}=(()=>{const e=document.createElement("div"),t="r2u-open-social-fallback";return document.body.appendChild(e),a.render(o.createElement(pe,{openerElement:e,openerEvent:t}),e),{open:()=>{e.dispatchEvent(new Event(t))},render:()=>{}}})(),F=e=>he(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,W.model.glb=t.glb,W.model.name=t.name,W.model.placement=t.placement,W.model.url=t.pdpUrl,W.model.resizable=t.resize,$(T),Z(T)})),D=()=>he(this,void 0,void 0,(function*(){if(be&&/instagram|FBAN|FBAV|LinkedInApp/i.test(navigator.userAgent))return void _();var e;ge&&"wall"!==j&&(yield E())?(e=w,u.XH.setSession(),document.addEventListener(e.r2uWebxrSessionStart,u.XH.onSessionStart,{once:!0}),document.addEventListener(e.r2uWebxrSessionEnd,u.XH.onSessionEnd,{once:!0}),document.addEventListener(e.r2uWebxrCompatible,(()=>u.XH.setCompatible(!0)),{once:!0}),document.addEventListener(e.r2uWebxrNotCompatible,(()=>u.XH.setCompatible(!1)),{once:!0}),document.addEventListener(e.r2uWebxrPlaneMapped,u.XH.setPlaneMapped,{once:!0}),document.addEventListener(e.r2uWebxrObjectPlaced,u.XH.setObjectPlaced,{once:!0}),document.addEventListener(e.r2uWebxrShowTranslatingInstructions,(()=>{u.XH.setTranslateInstructions(),s("translate")}),{once:!0}),document.addEventListener(e.r2uWebxrShowRotatingInstructions,(()=>{u.XH.setRotateInstructions(),s("rotate")}),{once:!0}),document.addEventListener(e.r2uWebxrTranslating,(()=>{u.XH.setFirstTranslation(),s("translate")}),{once:!0}),document.addEventListener(e.r2uWebxrRotating,(()=>{u.XH.setFirstRotation(),s("rotate")}),{once:!0}),document.addEventListener(e.r2uWebxrReset,u.XH.setReset,{once:!0}),document.addEventListener(e.r2uWebxrFallbackToSceneviewer,u.XH.onSceneViewerFallback,{once:!0}),window.addEventListener("hashchange",(()=>{window.location.hash===xe&&u.XH.onFallback()}),{once:!0}),document.addEventListener(e.r2uWebxrShare,u.XH.onShare),document.addEventListener(e.r2uWebxrExit,u.XH.onExit),document.addEventListener(e.r2uWebxrCallToAction,u.XH.onCallToAction),document.addEventListener(e.r2uWebxrTranslating,u.XH.onTranslation),document.addEventListener(e.r2uWebxrRotating,u.XH.onRotation),v(W)):(()=>{switch(g){case"always":return!0;case"never":return!1;default:return!c("instructions")}})()?H():x(T),yield u.J1.onClick();const t=(new Date).getTime(),n=()=>{if(document.hidden)return;const e=(new Date).getTime();u.J1.onSessionTimeCollect(e-t),I()&&U(),document.removeEventListener("visibilitychange",n)},o=()=>{const e=(new Date).getTime();u.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,D);const J=new URL(window.location.href),B="true"===J.searchParams.get("r2u_redirect"),q=J.searchParams.get("r2u_sku");return B&&!i.Z.hasAutoOpenedAR&&(i.Z.hasAutoOpenedAR=!0,q&&(yield F(q)),Ee({element:n,event:f})),window.addEventListener("hashchange",(()=>{window.location.hash===xe&&(u.J1.onFallback(),n.removeEventListener(f,D),n.addEventListener(f,X),Ee({element:n,event:f}))}),{once:!0}),{setSku:F}}))},open:Ee,getLink:function(e){return he(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,p.U2)(`/sdk-ar/openar-link?customerId=${t}&productSku=${e}`);return Promise.resolve(n)}))}}}}]);