{"version":3,"file":"static/js/85762.880d7fc2.chunk.js","mappings":"0JAeA,MAAMA,EAAoB,CACxBC,QAAQ,EACRC,SAAS,GAGEC,EAAW,SAAUC,GAChC,MAAMC,EAAaD,EAAMH,OACnBK,EAAcF,EAAMF,SAClBD,OAAQM,GAAkB,EAAML,QAASM,GAAmB,GAClEJ,EAAMK,YAAcT,EAEhBU,EAAeN,EAAMO,cAAgBP,EAAMA,EAAMO,eAAiB,KAClEC,EAAyB,CAC7BX,OAAgC,YAAxBG,EAAMO,cACdT,QAAiC,WAAxBE,EAAMO,eAGXE,GAAwBT,EAAMO,eAChCC,EAAuBR,EAAMO,eAGjC,OACEG,EAAAA,EAAAA,MAAAC,EAAAA,SAAA,CAAAC,SAAA,CACGN,GAAgBG,IACfI,EAAAA,EAAAA,KAACC,EAAAA,SAAQ,CAAAF,UACPC,EAAAA,EAAAA,KAACP,EAAY,IAAKN,EAAMe,gBAG5BF,EAAAA,EAAAA,KAACC,EAAAA,SAAQ,CAACE,SAAUhB,EAAMgB,UAAY,KAAKJ,SACvCN,EAIE,MAHAW,EAAAA,EAAAA,KACEd,IAAmBU,EAAAA,EAAAA,KAACZ,EAAU,IAAKD,EAAMe,aACzCX,IAAoBS,EAAAA,EAAAA,KAACX,EAAW,IAAKF,EAAMe,iBAKzD,C","sources":["components/Viewport/index.tsx"],"sourcesContent":["import { ComponentType, ReactElement, Suspense } from 'react';\nimport { isMobile } from 'utils/is-mobile';\n\ntype Props = {\n  mobile: ComponentType<any>;\n  desktop: ComponentType<any>;\n  innerProps?: object;\n  fallback?: ReactElement;\n  conditions?: {\n    mobile?: boolean;\n    desktop?: boolean;\n  };\n  forceViewport?: 'mobile' | 'desktop';\n};\n\nconst defaultConditions = {\n  mobile: true,\n  desktop: true\n};\n\nexport const Viewport = function (props: Props): ReactElement {\n  const MobileView = props.mobile;\n  const DesktopView = props.desktop;\n  const { mobile: mobileCondition = true, desktop: desktopCondition = true } =\n    props.conditions || defaultConditions;\n\n  const ForcedLayout = props.forceViewport ? props[props.forceViewport] : null;\n  const forcedLayoutConditions = {\n    mobile: props.forceViewport !== 'desktop',\n    desktop: props.forceViewport !== 'mobile'\n  };\n\n  const forcedLayoutCondition = props.forceViewport\n    ? forcedLayoutConditions[props.forceViewport]\n    : true;\n\n  return (\n    <>\n      {ForcedLayout && forcedLayoutCondition && (\n        <Suspense>\n          <ForcedLayout {...props.innerProps} />\n        </Suspense>\n      )}\n      <Suspense fallback={props.fallback || null}>\n        {!ForcedLayout\n          ? isMobile()\n            ? mobileCondition && <MobileView {...props.innerProps} />\n            : desktopCondition && <DesktopView {...props.innerProps} />\n          : null}\n      </Suspense>\n    </>\n  );\n};\n"],"names":["defaultConditions","mobile","desktop","Viewport","props","MobileView","DesktopView","mobileCondition","desktopCondition","conditions","ForcedLayout","forceViewport","forcedLayoutConditions","forcedLayoutCondition","_jsxs","_Fragment","children","_jsx","Suspense","innerProps","fallback","isMobile"],"sourceRoot":""}