{"version":3,"sources":["webpack:///./app/javascript/Snackbar/index.js","webpack:///./app/javascript/common-prop-types/default-children-prop-types.js","webpack:///./app/javascript/shared/components/useKeyboardShortcuts.js","webpack:///./app/javascript/common-prop-types/article-prop-types.js","webpack:///./app/javascript/crayons/Button/index.js","webpack:///./app/javascript/crayons/Button/Button.jsx","webpack:///./app/javascript/crayons/Spinner/Spinner.jsx","webpack:///./app/javascript/crayons/Modal/Modal.jsx","webpack:///./app/javascript/shared/components/focusTrap.jsx","webpack:///./app/javascript/crayons/ButtonGroup/ButtonGroup.jsx","webpack:///./app/javascript/crayons/Dropdown/Dropdown.jsx","webpack:///./app/javascript/crayons/formElements/FormField/FormField.jsx","webpack:///./app/javascript/crayons/formElements/RadioButton/RadioButton.jsx","webpack:///./app/javascript/Snackbar/SnackbarItem.jsx","webpack:///./app/javascript/Snackbar/Snackbar.jsx","webpack:///./app/javascript/utilities/viewport.js","webpack:///./app/javascript/utilities/debounceAction.js","webpack:///./app/javascript/common-prop-types/user-prop-types.js","webpack:///./app/javascript/common-prop-types/selected-tags-prop-types.js","webpack:///./app/javascript/utilities/gist.js","webpack:///./app/javascript/utilities/dropdownUtils.js","webpack:///./app/javascript/packs/articlePage.jsx","webpack:///./app/javascript/common-prop-types/organization-prop-type.js","webpack:///./app/javascript/common-prop-types/tag-prop-types.js","webpack:///./app/javascript/utilities/codeFullscreenModeSwitcher.js"],"names":["defaultChildrenPropTypes","PropTypes","oneOfType","arrayOf","node","isFormField","element","HTMLElement","name","nodeName","toLowerCase","type","getAttribute","isContentEditable","callShortcut","e","keys","chain","shortcuts","shortcut","length","join","code","key","defaultOptions","timeout","useKeyboardShortcuts","eventTarget","window","options","useState","storedShortcuts","keyChain","setKeyChain","mergedOptions","setMergedOptions","useEffect","newOptions","setTimeout","clearTimeout","Object","keyEvent","defaultPrevented","ctrlKey","metaKey","altKey","shiftKey","target","Node","newChain","addEventListener","removeEventListener","KeyboardShortcuts","propTypes","object","isRequired","shape","number","instanceOf","Element","defaultProps","articleSnippetResultPropTypes","body_text","string","articlePropTypes","id","title","description","processed_html","path","cloudinary_video_url","video_duration_in_minutes","type_of","oneOf","class_name","flare_tag","tagPropTypes","tag_list","cached_tag_list_array","podcast","slug","image_url","user_id","user","username","organization","organizationPropType","highlight","public_reactions_count","reactions_count","comments_count","reading_time","getAdditionalClassNames","variant","className","contentType","size","inverted","disabled","additionalClassNames","Button","props","children","tagName","icon","url","buttonType","onClick","onMouseOver","onMouseOut","onFocus","onBlur","tabIndex","restOfProps","ComponentName","Icon","otherProps","href","undefined","displayName","bool","func","Spinner","width","height","viewBox","fill","xmlns","d","CloseIcon","role","Modal","overlay","onClose","closeOnClickOutside","focusTrapSelector","onDeactivate","clickOutsideDeactivates","selector","FocusTrap","focusTrap","useRef","deactivate","useCallback","useLayoutEffect","currentLocationHref","document","location","routeChangeObserver","MutationObserver","mutations","some","current","disconnect","createFocusTrap","escapeDeactivates","activate","observe","querySelector","childList","escape","ButtonGroup","Dropdown","FormField","RadioButton","value","checked","snackbarItemProps","actions","message","handler","lifespan","SnackbarItem","map","text","snackbarItems","addSnackbarItem","snackbarItem","Array","isArray","push","Snackbar","snacks","this","initializePolling","pauseLifespan","_event","paused","resumeLifespan","event","stopPropagation","pollingTime","pollingId","setInterval","newSnacks","updateSnackbarItems","forEach","snack","lifespanTimeoutId","decreaseLifespan","addCloseButton","setState","prevState","filter","potentialSnackToFilterOut","updatedSnacks","slice","currentSnack","state","ref","index","Component","isInViewport","offsetTop","allowPartialVisibility","boundingRect","getBoundingClientRect","clientHeight","innerHeight","documentElement","clientWidth","innerWidth","topIsInViewport","top","rightIsInViewport","right","bottomIsInViewport","bottom","leftIsInViewport","left","topIsOutOfViewport","bottomIsOutOfViewport","debounceAction","action","time","config","leading","configs","debounce","userPropTypes","profile_image_url","summary","selectedTagsPropTypes","tags","onKeyPress","postscribeImport","getPostScribe","postscribe","getGistTags","nodes","gistNodes","nodeType","classList","contains","querySelectorAll","loadEmbeddedGists","gistTags","gistTag","firstElementChild","outerHTML","beforeWrite","childElementCount","watchForGistTagInsertion","targetNode","observer","mutationsList","addedNodes","attributes","subtree","InstantClick","on","INTERACTIVE_ELEMENTS_QUERY","closeDropdown","triggerElementId","dropdownContentId","dropdownContent","getElementById","setAttribute","style","removeProperty","fullscreenActionElements","getElementsByClassName","addFullScreenModeControl","snackZone","render","shareDropdownButton","dataset","initialized","Runtime","isNativeAndroid","AndroidBridge","shareText","dropdownContentCloseButtonId","onOpen","triggerButton","keyUpListener","onCloseCleanupActions","focus","activeElement","clickOutsideListener","matches","display","openDropdown","initializeDropdown","hidden","link","ahoy","track","option","trim","inputValue","copyToClipboard","then","input","localName","setSelectionRange","getCsrfToken","body","userStatus","root","isLoggedIn","getCommentSubscriptionStatus","setCommentSubscriptionStatus","CommentSubscription","articleId","subscriptionType","subscriptionRequestHandler","positionType","onSubscribe","onUnsubscribe","toggleArticlePin","button","isPinButton","method","JSON","stringify","fetch","headers","Accept","csrfToken","credentials","ok","innerHTML","actionsContainer","pinTargets","includes","embedGists","profile_image_90","hotness_score","points","bg_color_hex","text_color_hex","isFullScreenModeCodeOn","screenScroll","fullScreenWindow","onPressEscape","fullScreenModeControl","listenToKeyboardForEscape","listen","toggleOverflowForDocument","overflow","elements","codeBlock","currentTarget","closest","cloneNode","codeBlockControls","scrollTo","removeFullScreenModeControl","remove","removeChild","childNodes","scrollY","add","appendChild"],"mappings":"0FAAA,2F,gCCAA,sDAGaA,EAA2BC,IAAUC,UAAU,CAC1DD,IAAUE,QAAQF,IAAUG,MAC5BH,IAAUG,Q,0mECKZ,SAASC,EAAYC,GACnB,GAAIA,aAAmBC,eAAgB,EAAO,OAAO,EAErD,IAAMC,EAAOF,EAAQG,SAASC,cACxBC,GAAQL,EAAQM,aAAa,SAAW,IAAIF,cAClD,MACW,WAATF,GACS,aAATA,GACU,UAATA,GACU,WAATG,GACS,UAATA,GACS,aAATA,GACS,UAATA,GACFL,EAAQO,kBAcZ,IAAMC,EAAe,SAACC,EAAG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,CAA4BF,GAE5BZ,EAAiBtG,UAAUqH,OAAO,WAClCf,EAAiBgB,YAAYhB,EAAiBiB,WAAW,IAEzDnB,GAAyB,IAEzBO,GAA0B,GA5D5BN,EAAerU,OAAOwV,QA8DpBf,GAA0B,GAC1BK,EAAU9G,UAAUyH,IAAI,iBACxBnB,EAAiBoB,YAAYZ,GAC7BR,EAAiBtG,UAAUyH,IAAI,WAE/B3F,EAAyBoF,GAEzBd,GAAyB,M","file":"js/articlePage-b5eb20bd15ec96b65e1b.chunk.js","sourcesContent":["export * from './Snackbar';\nexport * from './SnackbarItem';\n","import PropTypes from 'prop-types';\n\n// Use this whenever you need the standard children prop.\nexport const defaultChildrenPropTypes = PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.node),\n PropTypes.node,\n]);\n","import { useState, useEffect } from 'preact/hooks';\nimport PropTypes from 'prop-types';\n\n/**\n * Checker that return true if element is a form element\n *\n * @param {node} element to be checked\n *\n * @returns {boolean} isFormField\n */\nfunction isFormField(element) {\n if (element instanceof HTMLElement === false) return false;\n\n const name = element.nodeName.toLowerCase();\n const type = (element.getAttribute('type') || '').toLowerCase();\n return (\n name === 'select' ||\n name === 'textarea' ||\n (name === 'input' &&\n type !== 'submit' &&\n type !== 'reset' &&\n type !== 'checkbox' &&\n type !== 'radio') ||\n element.isContentEditable\n );\n}\n\n/**\n * Function to handle converting key presses to callback functions\n *\n * @param {KeyboardEvent} e Keyboard event\n * @param {String} keys special keys formatted in a string\n * @param {Array} chain array of past keys\n * @param {Object} shortcuts object containing callback functions\n *\n * @returns {Array} New chain\n */\nconst callShortcut = (e, keys, chain, shortcuts) => {\n const shortcut =\n chain && chain.length > 0\n ? shortcuts[`${chain.join('~')}~${e.code}`]\n : shortcuts[`${keys}${e.code}`] ||\n shortcuts[`${keys}${e.key.toLowerCase()}`];\n\n // if a valid shortcut is found call it and reset the chain\n if (shortcut) {\n shortcut(e);\n return [];\n }\n\n // if we have keys don't add to the chain\n if (keys || e.key === 'Shift') {\n return [];\n }\n\n return [...chain, e.code];\n};\n\n// Default options to be used if null\nconst defaultOptions = {\n timeout: 0, // The default is zero as we want no delays between keystrokes by default.\n};\n\n/**\n * hook that can be added to a component to listen\n * for keyboard presses\n *\n * @example\n * const shortcuts = {\n * 'ctrl+alt+KeyG': (e) => {\n * e.preventDefault();\n * alert('Control Alt G has been pressed');\n * },\n * 'KeyG~KeyH': (e) => {\n * e.preventDefault();\n * alert('G has been pressed quickly followed by H');\n * },\n * '?': (e) => {\n * setIsHelpVisible(true);\n * }\n * }\n *\n * useKeyboardShortcuts(shortcuts, someElementOrWindowObject, {timeout: 1500});\n *\n * @param {object} shortcuts List of keyboard shortcuts/event\n * @param {EventTarget} [eventTarget=window] An event target.\n * @param {object} [options = {}] An object for extra options\n *\n */\nexport function useKeyboardShortcuts(\n shortcuts,\n eventTarget = window,\n options = {},\n) {\n const [storedShortcuts] = useState(shortcuts);\n const [keyChain, setKeyChain] = useState([]);\n const [mergedOptions, setMergedOptions] = useState({\n ...defaultOptions,\n ...options,\n });\n\n // update mergedOptions if options prop changes\n useEffect(() => {\n const newOptions = {};\n if (typeof options.timeout === 'number')\n newOptions.timeout = options.timeout;\n setMergedOptions({ ...defaultOptions, ...newOptions });\n }, [options.timeout]);\n\n // clear key chain after timeout is reached\n useEffect(() => {\n if (keyChain.length <= 0) return;\n\n const timeout = window.setTimeout(() => {\n clearTimeout(timeout);\n setKeyChain([]);\n }, mergedOptions.timeout);\n\n return () => clearTimeout(timeout);\n }, [keyChain.length, mergedOptions.timeout]);\n\n // set up event listeners\n useEffect(() => {\n if (!storedShortcuts || Object.keys(storedShortcuts).length === 0) return;\n\n const keyEvent = (e) => {\n if (e.defaultPrevented) return;\n\n // Get special keys\n const keys = `${e.ctrlKey || e.metaKey ? 'ctrl+' : ''}${\n e.altKey ? 'alt+' : ''\n }${(e.ctrlKey || e.metaKey || e.altKey) && e.shiftKey ? 'shift+' : ''}`;\n\n // If no special keys, except shift, are pressed and focus is inside a field return\n if (e.target instanceof Node && isFormField(e.target) && !keys) return;\n\n const newChain = callShortcut(e, keys, keyChain, storedShortcuts);\n\n // update keychain with latest chain\n setKeyChain(newChain);\n };\n\n eventTarget.addEventListener('keydown', keyEvent);\n\n return () => eventTarget.removeEventListener('keydown', keyEvent);\n }, [keyChain, storedShortcuts, eventTarget]);\n}\n\n/**\n * A component that can be added to a component to listen\n * for keyboard presses using the useKeyboardShortcuts hook\n *\n * @example\n * const shortcuts = {\n * 'ctrl+alt+KeyG': (e) => {\n * e.preventDefault();\n * alert('Control Alt G has been pressed')\n * }\n * }\n *\n * Some modal content{title}
\n \n