{"version":3,"file":"WithBanner.BCccnzQD.mjs","names":[],"sources":["https:/framerusercontent.com/modules/ByA1DgnnJniRmvIRNPJd/TOgzJ61ZQZ2bA6TsO62G/WithBanner.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{motion}from\"framer-motion\";const pcHeight=\"60px\";const mobileHeigth=\"116px\";const bannerBgStyle={background:\"linear-gradient(90.04deg, #4C88FF 15.05%, #2456CF 102.84%)\",mixBlendMode:\"normal\",height:pcHeight,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"#FFFFFF\",fontFamily:\"Lark Circular Medium, sans-serif\",textAlign:\"center\",transition:\"all 0.5 ease-in\"};const getBgStyle=isMobile=>({...bannerBgStyle,height:isMobile?\"116px\":pcHeight});const bannerBtnsStyle={display:\"flex\",alignItems:\"center\",justifyContent:\"center\"};const bannerContentStyle={width:\"1000px\",maxWidth:\"95vw\",display:\"flex\",justifyContent:\"space-around\",flexWrap:\"wrap\",alignItems:\"center\"};const bannerTitleStyle={fontWeight:500,fontSize:\"18px\",lineHeight:\"24px\",/* identical to box height, or 133% */color:\"#FFFFFF\"};const bannerContinueStyle={padding:\" 4px 12px\",borderRadius:\"6px\",background:\"#70A0FF\",color:\"#FFFFFF\",fontSize:\"16px\",lineHeight:\"24px\",cursor:\"pointer\"};const bannerCloseStyle={padding:\" 4px 12px\",border:\"1px solid #70A0FF\",background:\"transparent\",borderRadius:\"6px\",color:\"#FFFFFF\",fontSize:\"16px\",lineHeight:\"24px\",marginLeft:\"16px\",cursor:\"pointer\",textDecoration:\"none\"};const bannerContent={title:{en_us:\"You're now visiting www.larksuite.com. Did you mean to visit www.feishu.cn/en?\",ja_jp:\"今ご覧になっているサイトは Lark です。Feishu にアクセスされますか？\"},continue:{en_us:\"Continue with Lark\",ja_jp:\"このまま Lark で\"},close:{en_us:\"Switch to Feishu\",ja_jp:\"Feishu へ移動\"}};export function withBannerEnUs(Component){return props=>{if(!window){return /*#__PURE__*/_jsx(Component,{...props});}const isMobile=window.innerWidth<=1040;console.log(\"see if mobile\",isMobile);let params=document?.location?new URL(document?.location).searchParams:null;let fromSite=params?params.get(\"from_site\"):false;const shouldShowBanner=fromSite===\"feishu\";// fromSite === \"feishu\"\nconst[show,setShow]=useState(!window.closeBanner);useEffect(()=>{if(!shouldShowBanner||!document){return;}const onScroll=()=>{if(window.scrollY>=40){setShow(false);document.body.style.paddingTop=0;}else{setShow(true);}};document.addEventListener(\"scroll\",onScroll);return()=>{document.removeEventListener(\"scroll\",onScroll);};},[shouldShowBanner]);if(shouldShowBanner&&show&&!window.closeBanner){document.body.style.paddingTop=isMobile?mobileHeigth:pcHeight;}console.log(\"mobileHeigth\",shouldShowBanner);return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style??{}},children:[show&&shouldShowBanner&&!window.closeBanner&&/*#__PURE__*/_jsx(\"div\",{style:getBgStyle(isMobile),children:/*#__PURE__*/_jsxs(motion.div,{style:{...bannerContentStyle,justifyContent:isMobile?\"space-around\":\"space-around\"},children:[/*#__PURE__*/_jsx(\"div\",{style:bannerTitleStyle,children:bannerContent.title.en_us}),/*#__PURE__*/_jsxs(\"div\",{style:bannerBtnsStyle,children:[/*#__PURE__*/_jsx(motion.div,{className:\"\",style:bannerContinueStyle,onClick:()=>{setShow(false);window.closeBanner=true;document.body.style.paddingTop=0;},whileHover:{background:\"#4C88FF\"},children:bannerContent.continue.en_us}),/*#__PURE__*/_jsx(motion.a,{className:\"\",style:bannerCloseStyle,href:\"https://www.feishu.cn/en?from_site=lark\",whileHover:{background:\"#245BDB\"},children:bannerContent.close.en_us})]})]})}),/*#__PURE__*/_jsx(Component,{...props})]});};}export function withBannerJaJp(Component){return props=>{if(!window){return /*#__PURE__*/_jsx(Component,{...props});}const isMobile=window.innerWidth<=1040;console.log(\"see if mobile\",isMobile);let params=document?.location?new URL(document?.location).searchParams:null;let fromSite=params?params.get(\"from_site\"):false;const shouldShowBanner=fromSite===\"feishu\";// fromSite === \"feishu\"\nconst[show,setShow]=useState(!window.closeBanner);useEffect(()=>{if(!shouldShowBanner||!document){return;}const onScroll=()=>{if(window.scrollY>=40){setShow(false);document.body.style.paddingTop=0;}else{setShow(true);}};document.addEventListener(\"scroll\",onScroll);return()=>{document.removeEventListener(\"scroll\",onScroll);};},[shouldShowBanner]);if(shouldShowBanner&&show&&!window.closeBanner){document.body.style.paddingTop=isMobile?mobileHeigth:pcHeight;}console.log(\"mobileHeigth\",shouldShowBanner);return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style??{}},children:[show&&shouldShowBanner&&!window.closeBanner&&/*#__PURE__*/_jsx(\"div\",{style:getBgStyle(isMobile),children:/*#__PURE__*/_jsxs(motion.div,{style:{...bannerContentStyle,justifyContent:isMobile?\"space-around\":\"space-around\"},children:[/*#__PURE__*/_jsx(\"div\",{style:bannerTitleStyle,children:bannerContent.title.ja_jp}),/*#__PURE__*/_jsxs(\"div\",{style:bannerBtnsStyle,children:[/*#__PURE__*/_jsx(motion.div,{className:\"\",style:bannerContinueStyle,onClick:()=>{setShow(false);window.closeBanner=true;document.body.style.paddingTop=0;},whileHover:{background:\"#4C88FF\"},children:bannerContent.continue.ja_jp}),/*#__PURE__*/_jsx(motion.a,{className:\"\",style:bannerCloseStyle,href:\"https://www.feishu.cn/en?from_site=lark\",whileHover:{background:\"#245BDB\"},children:bannerContent.close.ja_jp})]})]})}),/*#__PURE__*/_jsx(Component,{...props})]});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withBannerJaJp\":{\"type\":\"reactHoc\",\"name\":\"withBannerJaJp\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBannerEnUs\":{\"type\":\"reactHoc\",\"name\":\"withBannerEnUs\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithBanner.map"],"mappings":"qPAC64C,SAAS,EAAe,EAAU,CAAC,MAAO,CAAA,GAAO,CAAC,I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