{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/aTZhm0Q4WtwZtUBtj31N/ECrNrnITcgkdvyBzIIY8/Layout.js"],
  "sourcesContent": ["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport * as React from \"react\";\nimport { createStore } from \"https://framer.com/m/framer/store.js@^1.0.0\";\nconst useStore = createStore({\n  useGrid: false,\n  useWheel: true\n});\nexport function Layout(Component) {\n  return props => {\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      layout: true,\n      transition: {\n        type: \"spring\",\n        stiffness: 178,\n        damping: 28\n      }\n    });\n  };\n}\nexport function Layout_Toggle(Component) {\n  return props => {\n    const [store, setStore] = useStore();\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      onClick: () => setStore({\n        useGrid: !store.useGrid\n      })\n    });\n  };\n}\nexport function Layout_Viewport(Component) {\n  return props => {\n    const [store, setStore] = useStore();\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      layout: true,\n      style: {\n        height: store.useGrid ? \"auto\" : \"100vh\"\n      },\n      transition: {\n        type: \"spring\",\n        stiffness: 178,\n        damping: 28\n      }\n    });\n  };\n}\nexport function Layout_Content(Component) {\n  return props => {\n    const [store, setStore] = useStore();\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      layout: true,\n      style: {\n        alignItems: store.useGrid ? \"center\" : \"flex-start\"\n      },\n      transition: {\n        type: \"spring\",\n        stiffness: 178,\n        damping: 28\n      }\n    });\n  };\n}\nexport function Layout_Frame(Component) {\n  return props => {\n    const [store, setStore] = useStore();\n    const layout = {\n      stack: {\n        ...props.style,\n        gridAutoFlow: \"column\",\n        gridAutoColumns: \"min-content\"\n      },\n      grid: {\n        ...props.style,\n        gridTemplateColumns: \"repeat(3, minmax(300px, 1fr))\",\n        gridAutoRows: 300,\n        gridTemplateRows: \"repeat(1, 300px)\"\n      }\n    };\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      style: store.useGrid ? layout.grid : layout.stack,\n      layout: true,\n      transition: {\n        type: \"spring\",\n        stiffness: 178,\n        damping: 28\n      }\n    });\n  };\n}\nexport function Layout_Wheel_Toggle(Component) {\n  return props => {\n    const [store, setStore] = useStore();\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      onClick: () => setStore({\n        useWheel: !store.useWheel\n      })\n    });\n  };\n}\nexport function Layout_Wheel_Control(Component) {\n  return props => {\n    const [store, setStore] = useStore();\n    const ref = React.useRef(null);\n    React.useEffect(() => {\n      const current = ref.current;\n      let frameId;\n      let lastTime = Date.now();\n      let velocity = 0;\n      let acceleration = 0;\n      function handleWheel(event) {\n        if (store.useWheel) {\n          event.preventDefault();\n          const deltaTime = Date.now() - lastTime;\n          lastTime = Date.now();\n          acceleration = event.deltaY / deltaTime;\n          velocity += acceleration;\n          velocity = Math.min(Math.max(velocity, -800), 800);\n        }\n      }\n      function animate() {\n        if (Math.abs(velocity) > .01) {\n          current.scrollLeft += velocity;\n          velocity *= .7;\n          frameId = requestAnimationFrame(animate);\n        }\n      }\n      current.addEventListener(\"wheel\", handleWheel);\n      current.addEventListener(\"wheel\", () => {\n        cancelAnimationFrame(frameId);\n        frameId = requestAnimationFrame(animate);\n      });\n      return () => {\n        current.removeEventListener(\"wheel\", handleWheel);\n        cancelAnimationFrame(frameId);\n      };\n    }, [store.useWheel]);\n    return /*#__PURE__*/_jsx(Component, {\n      ...props,\n      ref: ref\n    });\n  };\n}\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"Layout_Wheel_Control\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"Layout_Wheel_Control\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"Layout_Toggle\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"Layout_Toggle\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"Layout_Frame\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"Layout_Frame\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"Layout_Viewport\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"Layout_Viewport\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"Layout_Content\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"Layout_Content\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"Layout_Wheel_Toggle\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"Layout_Wheel_Toggle\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"Layout\": {\n      \"type\": \"reactHoc\",\n      \"name\": \"Layout\",\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\n  }\n};\n//# sourceMappingURL=./Layout.map"],
  "mappings": "kIAGA,IAAMA,EAAWC,EAAY,CAC3B,QAAS,GACT,SAAU,EACZ,CAAC,EACM,SAASC,EAAOC,EAAW,CAChC,OAAOC,GACeC,EAAKF,EAAW,CAClC,GAAGC,EACH,OAAQ,GACR,WAAY,CACV,KAAM,SACN,UAAW,IACX,QAAS,EACX,CACF,CAAC,CAEL,CACO,SAASE,EAAcH,EAAW,CACvC,OAAOC,GAAS,CACd,GAAM,CAACG,EAAOC,CAAQ,EAAIR,EAAS,EACnC,OAAoBK,EAAKF,EAAW,CAClC,GAAGC,EACH,QAAS,IAAMI,EAAS,CACtB,QAAS,CAACD,EAAM,OAClB,CAAC,CACH,CAAC,CACH,CACF,CACO,SAASE,EAAgBN,EAAW,CACzC,OAAOC,GAAS,CACd,GAAM,CAACG,EAAOC,CAAQ,EAAIR,EAAS,EACnC,OAAoBK,EAAKF,EAAW,CAClC,GAAGC,EACH,OAAQ,GACR,MAAO,CACL,OAAQG,EAAM,QAAU,OAAS,OACnC,EACA,WAAY,CACV,KAAM,SACN,UAAW,IACX,QAAS,EACX,CACF,CAAC,CACH,CACF,CACO,SAASG,EAAeP,EAAW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eE,EAAM,OAASC,EAC9BJ,GAAYC,EACZD,EAAW,KAAK,IAAI,KAAK,IAAIA,EAAU,IAAI,EAAG,GAAG,EAErD,CACA,SAASK,GAAU,CACb,KAAK,IAAIL,CAAQ,EAAI,MACvBH,EAAQ,YAAcG,EACtBA,GAAY,GACZF,EAAU,sBAAsBO,CAAO,EAE3C,CACA,OAAAR,EAAQ,iBAAiB,QAASK,CAAW,EAC7CL,EAAQ,iBAAiB,QAAS,IAAM,CACtC,qBAAqBC,CAAO,EAC5BA,EAAU,sBAAsBO,CAAO,CACzC,CAAC,EACM,IAAM,CACXR,EAAQ,oBAAoB,QAASK,CAAW,EAChD,qBAAqBJ,CAAO,CAC9B,CACF,EAAG,CAACZ,EAAM,QAAQ,CAAC,EACCF,EAAKF,EAAW,CAClC,GAAGC,EACH,IAAKW,CACP,CAAC,CACH,CACF",
  "names": ["useStore", "createStore", "Layout", "Component", "props", "p", "Layout_Toggle", "store", "setStore", "Layout_Viewport", "Layout_Content", "Layout_Frame", "layout", "Layout_Wheel_Toggle", "Layout_Wheel_Control", "ref", "pe", "ue", "current", "frameId", "lastTime", "velocity", "acceleration", "handleWheel", "event", "deltaTime", "animate"]
}
