{"version":3,"file":"460.esm.js","mappings":";oFA4BA,SAASA,EAAcC,IAhBvB,SAA2BA,EAAMC,EAAOC,GAEtCC,YAAW,KAIS,UAAdH,EAAKI,MACPJ,EAAKK,kBAAkBJ,EAAOC,EAChC,GAEJ,CAOEI,CAAkBN,EAAM,EAAGA,EAAKO,MAAMC,OACxC,CAOA,SAASC,EAAmBT,GAC1B,IAAM,OAAEQ,GAAWR,EAAKO,MACxBP,EAAKK,kBAAkBG,EAAQA,EACjC,CAOA,SAASE,IAA6C,IAA3BC,EAAKC,UAAAJ,OAAA,QAAAK,IAAAD,UAAA,GAAAA,UAAA,GAAG,CAAC,EAAGE,EAAEF,UAAAJ,OAAA,QAAAK,IAAAD,UAAA,GAAAA,UAAA,GAAG,OAC1C,MAAkB,UAAdD,EAAMI,KAAiC,MAAdJ,EAAMI,IAC1BD,EAAGH,GAEL,IACT","sources":["webpack:///./lib/dom-utils.js"],"sourcesContent":["/**\n * This is a utilities file for various dom event handlings\n * for autocomplete stubs or a11y usages etc\n */\n\n/**\n * This will take a node and select the given range of text from start to end in a\n * way that works for iOS\n * @param {HTMLInputElement} node - the input to select the text in\n * @param {Number} start - the index to start the selection\n * @param {Number} end - the index to end the selection\n */\nfunction selectRangeOfText(node, start, end) {\n // select all the text, but do it on the next tick because iOS has issues otherwise\n setTimeout(() => {\n // we're using setSelectionRange rather than select because select doesn't work with iOS\n // setSelectionRange method apply only to inputs of types text, search, URL, tel and password\n // This check was added to avoid the console errors as setSelectionRange was used on input type email\n if (node.type !== 'email') {\n node.setSelectionRange(start, end)\n }\n })\n}\n\n/**\n * This will take a node and select all the text in it in a way that works for iOS\n * @param {HTMLInputElement} node - the input to select the text in\n */\nfunction selectAllText(node) {\n selectRangeOfText(node, 0, node.value.length)\n}\n\n/**\n * This moves the cursor position to the end of the text in the input node in a way\n * that works on iOS\n * @param {HTMLInputElement} node - the input to set the cursor position in\n */\nfunction moveCursorToTheEnd(node) {\n const { length } = node.value\n node.setSelectionRange(length, length)\n}\n\n/**\n * This functions add on enter/space event check, it's used when we imitate button behavior\n * @param {object} event - the input to set the cursor position in\n */\n\nfunction isA11yButtonPress(event = {}, cb = () => {}) {\n if (event.key === 'Enter' || event.key === ' ') {\n return cb(event)\n }\n return null\n}\n\nexport {\n selectRangeOfText,\n selectAllText,\n moveCursorToTheEnd,\n isA11yButtonPress,\n}\n"],"names":["selectAllText","node","start","end","setTimeout","type","setSelectionRange","selectRangeOfText","value","length","moveCursorToTheEnd","isA11yButtonPress","event","arguments","undefined","cb","key"],"sourceRoot":""}