{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/24WIgql6N2IQ8AmZLDj8/kXzFJnNgTBYlRJtGRyYh/Shortcuts.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import React from\"react\";export function withKeyboardShortcuts(Component){const handleKeyDown=event=>{// Don't capture input if the user is typing in an input field or a meta key is pressed\nif(event.target instanceof HTMLInputElement)return;if(event.shiftKey||event.ctrlKey||event.altKey||event.metaKey)return;// Save pressed keys to session storage\nlet pressedKeys=JSON.parse(sessionStorage.getItem(\"pressedKeys\")||\"[]\");pressedKeys.push(event.key);if(pressedKeys.length>1)pressedKeys.shift();sessionStorage.setItem(\"pressedKeys\",JSON.stringify(pressedKeys));if(typeof window!==\"undefined\"){// Notify other components\nconst customEvent=new CustomEvent(\"pressedKeysChanged\",{detail:pressedKeys});window.dispatchEvent(customEvent);}};const handleBeforeUnload=()=>{sessionStorage.removeItem(\"pressedKeys\");};return props=>{if(typeof window!==\"undefined\"){React.useEffect(()=>{// Focus window on load\nwindow.focus();window.addEventListener(\"keydown\",handleKeyDown);window.addEventListener(\"beforeunload\",handleBeforeUnload);return()=>{window.removeEventListener(\"keydown\",handleKeyDown);window.removeEventListener(\"beforeunload\",handleBeforeUnload);};},[]);}return /*#__PURE__*/_jsx(Component,{...props});};}export function withShortcutTrigger(Component){const handlePressedKeysChanged=(event,key,containerRef)=>{const pressedKeys=event.detail;// Check if the last pressed key matches the shortcut\nif(pressedKeys[pressedKeys.length-1]===key){event.preventDefault();setTimeout(()=>{console.log(\"click\");if(containerRef.current){const button=containerRef.current.querySelector(\"button\");const link=containerRef.current.querySelector(\"a\");if(button){button.click();}else if(link){link.click();}else{console.error(`\uD83E\uDD8E Error: The shortcut trigger element ${key} isn't working properly. Check the docs for help.`);}}else{console.error(`\uD83E\uDD8E Error: The shortcut trigger element ${key} isn't working properly. Check the docs for help.`);}sessionStorage.removeItem(\"pressedKeys\");},0);}};return props=>{var _props_name;const regExp=/\\[(.*?)\\]/;let lizardKeyRegex=(_props_name=props.name)===null||_props_name===void 0?void 0:_props_name.match(regExp);let lizardKey=\"\";let lizardContainerRef=React.useRef(null);if(lizardKeyRegex){lizardKey=lizardKeyRegex[1];}else{console.error(`\uD83E\uDD8E Error: Your shortcut trigger layer (${props.name}) is missing a key in its layer name.`);}if(typeof window!==\"undefined\"){React.useEffect(()=>{const handlePressedKeysEvent=event=>{const customEvent=event;handlePressedKeysChanged(customEvent,lizardKey,lizardContainerRef);};window.addEventListener(\"pressedKeysChanged\",handlePressedKeysEvent);},[]);}return /*#__PURE__*/_jsx(\"span\",{ref:lizardContainerRef,children:/*#__PURE__*/_jsx(Component,{...props})});};}/*\nShortcuts \u2013 keyboard-enabled navigation for Framer (https://hoferdo.link/shortcuts-framer)\n\u00A9 2023 by Dominik Hofer (https://hoferdo.link/me \u2013 Contact: https://hoferdo.link/hi)\nDisclaimer:\nThis software is provided as-is, without any warranty. Use of this software and its constituent components is subject to the following terms:\n1. Upon purchase of a license (Core, Commercial or Creator), the purchaser is granted the right to use this component in an unlimited number of Framer projects that are owned by the purchaser.\n2. Modification, redistribution, or re-use of the source code, in whole or in part, without explicit written permission from the copyright holder (Dominik Hofer) is strictly prohibited.\n3. This component may not be used in a commercial Framer project (i.e. a project that is used to generate revenue) unless the purchaser has purchased a Commercial or Creator license.\n4. This component may not be used in a Framer project that is owned by a third party (e.g. a client) unless the third party has purchased a license for this component.\n5. This component may not be used in a Framer template that you plan to distribute (either for free or for sale) unless you have purchased a Creator license.\nBy using this software, you agree to these terms. Failure to comply with these terms may result in legal consequences. If you have any questions regarding these terms, please contact Dominik Hofer through the provided link above.\n*/\nexport const __FramerMetadata__ = {\"exports\":{\"withShortcutTrigger\":{\"type\":\"reactHoc\",\"name\":\"withShortcutTrigger\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withKeyboardShortcuts\":{\"type\":\"reactHoc\",\"name\":\"withKeyboardShortcuts\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__F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M,EAAWC,EAAMA,EAAK,MAAM,EAAQ,QAAQ,MAAM,iDAA0CH,CAAG,mDAAmD,CAAG,MAAM,QAAQ,MAAM,iDAA0CA,CAAG,mDAAmD,EAAG,eAAe,WAAW,aAAa,CAAE,EAAE,CAAC,EAAG,EAAE,OAAOL,GAAO,CAAC,IAAIS,EAAY,IAAMC,EAAO,YAAgBC,GAAgBF,EAAYT,EAAM,QAAQ,MAAMS,IAAc,OAAO,OAAOA,EAAY,MAAMC,CAAM,EAAME,EAAU,GAAOC,EAAmBZ,EAAM,OAAO,IAAI,EAAE,OAAGU,EAAgBC,EAAUD,EAAe,CAAC,EAAQ,QAAQ,MAAM,iDAA0CX,EAAM,IAAI,uCAAuC,EAAM,OAAOH,EAAS,KAAaI,EAAM,UAAU,IAAI,CAAC,IAAMa,EAAuBnB,GAAO,CAAyBS,EAANT,EAA2CiB,EAAUC,CAAkB,CAAE,EAAEhB,EAAO,iBAAiB,qBAAqBiB,CAAsB,CAAE,EAAE,CAAC,CAAC,EAAuBZ,EAAK,OAAO,CAAC,IAAIW,EAAmB,SAAsBX,EAAKT,EAAU,CAAC,GAAGO,CAAK,CAAC,CAAC,CAAC,CAAE,CAAE",
  "names": ["withKeyboardShortcuts", "Component", "handleKeyDown", "event", "pressedKeys", "window", "customEvent", "handleBeforeUnload", "props", "e", "p", "withShortcutTrigger", "handlePressedKeysChanged", "key", "containerRef", "button", "link", "_props_name", "regExp", "lizardKeyRegex", "lizardKey", "lizardContainerRef", "handlePressedKeysEvent"]
}
