{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/pBX1sOvJlhX5oLAYaJF1/8NT37o2kJoKv2bFOdhKz/Switch.js"],
  "sourcesContent": ["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useState } from \"react\";\nimport { useEffect } from \"react\";\nimport { createStore } from \"https://framer.com/m/framer/store.js@^1.0.0\";\nimport { isBrowser } from \"framer-motion\";\nimport { useNavigateTo } from \"https://framerusercontent.com/modules/neeAIfdZNySBGLN5HMi5/PpRgzzLAu6jbYZeIp2z5/useNavigateTo.js\";\nconst companies = [\"MessageBird\", \"Superhuman\", \"Twingate\", \"Whereby\", \"Lark\"];\nconst useStore = createStore({\n  activeIndex: 0\n});\nexport function withActiveIndex(Component) {\n  return props => {\n    const [{\n      activeIndex\n    }, setStore] = useStore();\n    function handleSlideChange(index) {\n      setStore({\n        activeIndex: index\n      });\n    }\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      onSlideChange: handleSlideChange\n    });\n  };\n}\nfunction createBackground(Component, index) {\n  return props => {\n    const [{\n      activeIndex\n    }, setStore] = useStore();\n    const isActive = activeIndex === index;\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      animate: {\n        opacity: isActive ? 1 : 0\n      }\n    });\n  };\n}\nexport function background0(Component) {\n  return createBackground(Component, 0);\n}\nexport function background1(Component) {\n  return createBackground(Component, 1);\n}\nexport function background2(Component) {\n  return createBackground(Component, 2);\n}\nexport function background3(Component) {\n  return createBackground(Component, 3);\n}\nexport function background4(Component) {\n  return createBackground(Component, 4);\n}\nexport function background5(Component) {\n  return createBackground(Component, 5);\n}\nconst formSessionStorageKey = \"__framer-form-submitted\";\nconst formTopicSessionStorageKey = \"__framer-form-topic\";\nexport function withSetSessionStorageOnSubmit(Component) {\n  return props => {\n    function handleClick() {\n      sessionStorage.setItem(formSessionStorageKey, \"true\");\n    }\n    return /*#__PURE__*/_jsx(Component, {\n      onClick: handleClick,\n      ...props\n    });\n  };\n}\nexport function withToast(Component) {\n  return props => {\n    const [show, setShow] = useState(false);\n    useEffect(() => {\n      if (isBrowser) {\n        const viaForm = sessionStorage.getItem(formSessionStorageKey);\n        if (viaForm && !show) {\n          setShow(true);\n          setTimeout(() => {\n            setShow(false);\n            sessionStorage.removeItem(formSessionStorageKey);\n          }, 4e3);\n        }\n      }\n    }, []);\n    return /*#__PURE__*/_jsx(Component, {\n      variant: show ? \"Show\" : \"Hide\",\n      style: {\n        width: \"100%\",\n        height: \"100%\"\n      }\n    });\n  };\n}\nexport function withBlurHandler(Component) {\n  return props => {\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      onChange: e => {\n        if (isBrowser) {\n          sessionStorage.setItem(formTopicSessionStorageKey, e.target.value);\n        }\n      }\n    });\n  };\n}\nexport function withRedirect(Component) {\n  return props => {\n    const navigateTo = useNavigateTo();\n    const routes = {\n      addons: \"/business/addons/\",\n      business: \"/sales/pricing/\"\n    };\n    useEffect(() => {\n      if (isBrowser) {\n        const topicFromLocalStorage = sessionStorage.getItem(formTopicSessionStorageKey);\n        const topic = topicFromLocalStorage || \"business\";\n        navigateTo(routes[topic]);\n      }\n    }, []);\n    return /*#__PURE__*/_jsx(Component, {\n      ...props\n    });\n  };\n}\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"withBlurHandler\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"withBlurHandler\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"background2\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"background2\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"background5\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"background5\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"background4\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"background4\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"withRedirect\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"withRedirect\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"withToast\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"withToast\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"background3\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"background3\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"background0\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"background0\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"withSetSessionStorageOnSubmit\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"withSetSessionStorageOnSubmit\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"withActiveIndex\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"withActiveIndex\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"background1\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"background1\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\n  }\n};\n//# sourceMappingURL=./Switch.map"],
  "mappings": "kFAOA,IAAMA,EAAWC,EAAY,CAC3B,YAAa,CACf,CAAC,EAiDD,IAAMC,EAAwB,0BAEvB,SAASC,EAA8BC,EAAW,CACvD,OAAOC,GAAS,CACd,SAASC,GAAc,CACrB,eAAe,QAAQC,EAAuB,MAAM,CACtD,CACA,OAAoBC,EAAKJ,EAAW,CAClC,QAASE,EACT,GAAGD,CACL,CAAC,CACH,CACF",
  "names": ["useStore", "createStore", "formSessionStorageKey", "withSetSessionStorageOnSubmit", "Component", "props", "handleClick", "formSessionStorageKey", "p"]
}
