Ingen beskrivning

186.09c3ea27.chunk.js.map 24KB

1
  1. {"version":3,"file":"static/js/186.09c3ea27.chunk.js","mappings":"sMAMMA,EAAW,IAAIC,QACfC,EAAgB,SAACC,EAAaC,EAASC,GAAoE,IAApDC,EAAiB,UAAH,6CAAG,EAAGC,EAAsB,UAAH,8CAC9FP,EAASQ,IAAIL,KAAiBE,IAG9BA,EACFI,EAASN,EAAaC,EAASE,EAAgBC,GAG/CG,EAAYP,EAAaC,GAE7B,EACMO,EAAY,SAACC,GACjB,OAAOA,IAAUA,EAAMC,cAAcC,aACvC,EACML,EAAW,SAACN,EAAaC,EAASE,GAAgD,IAAhCC,EAAsB,UAAH,8CAUnEQ,EAAWX,EAAQY,WAEnBC,EAAWb,EAAQc,WAAU,GACnCD,EAASE,UAAUC,IAAI,gBACvBH,EAASI,UAAY,EAajBd,IACFU,EAASK,UAAW,GAEtBP,EAASQ,YAAYN,GACrBjB,EAASwB,IAAIrB,EAAac,GAC1B,IAAMQ,EAAMtB,EAAYuB,cAClBC,EAAiB,QAAZF,EAAIG,IAAgB,MAAQ,KACvCzB,EAAY0B,MAAMC,cAAgB,OAClC1B,EAAQyB,MAAME,UAAY,eAAH,OAAkBJ,EAAE,cAAMrB,EAAc,iBACjE,EACMI,EAAc,SAACP,EAAaC,GAChC,IAAM4B,EAAQhC,EAASiC,IAAI9B,GACvB6B,IACFhC,EAASkC,OAAO/B,GAChB6B,EAAMG,UAERhC,EAAY0B,MAAMC,cAAgB,GAClC1B,EAAQyB,MAAME,UAAY,EAC5B,EAEMK,EAA0B,SAACjC,EAAaC,EAASiC,GACrD,IAAKA,IAAajC,EAChB,OAAO,WAEP,EAEF,IAAMkC,EAAkB,SAACC,GACnB5B,EAAUP,IACZF,EAAcC,EAAaC,EAASmC,EAExC,EACMC,EAAS,WAAH,OAAStC,EAAcC,EAAaC,GAAS,EAAM,EACzDqC,EAAY,WAAH,OAASH,GAAgB,EAAK,EACvCI,EAAY,WAAH,OAASJ,GAAgB,EAA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AAGwE,OACdD,IAAWF,IAGXE,EAAOD,QAAQ5G,IAAkB6G,EAAOvG,QAAQN,KAGpDsG,GAAU,EAEVvC,YAAW,WACJuC,GACHK,EAAOI,MAEX,GAAG,KAfH,CARA,CAwBF,GACAjH,EAAAA,EAAAA,GAAiBlB,EAAK,iBAAkB4H,GACxC5H,EAAIkB,iBAAiB,UAAW2G,GAAW,GAC3C7H,EAAIkB,iBAAiB,WAAY4G,GAAY,EAM/C,CA6QIM,GAEEjF,GA9GsB,SAAC5B,GAC3B,IAAMvB,EAAMqG,SACNwB,EAAY,SAACnE,GACjBgC,EAAiBhC,EAAGwE,OAAQ3G,EAC9B,EACM8G,EAAa,SAAC3E,GAClBgC,EAAiBhC,EAAGwE,OAAQ,EAC9B,EACAlI,EAAIkB,iBAAiB,UAAW2G,GAChC7H,EAAIkB,iBAAiB,WAAYmH,EAKnC,CAiGIC,CAAoB/G,GAKtB,IAAK,IAAL,MAAoBqF,EAAM,eAAE,CAAvB,IAAMzH,EAAK,KACd+H,EAAc/H,EAChB,CACAa,EAAIkB,iBAAiB,mBAAoB,SAACwC,GACxCwD,EAAcxD,EAAG6E,OACnB,IACAvI,EAAIkB,iBAAiB,qBAAsB,SAACwC,IA/BpB,SAAChF,GACvB,GAAIsC,EAAW,CACb,IAAMwH,EAAKxB,EAAaxG,IAAI9B,GACxB8J,GACFA,IAEFxB,EAAavG,OAAO/B,EACtB,CACA,GAAI+H,EAAc,CAChB,IAAM+B,EAAKvB,EAAgBzG,IAAI9B,GAC3B8J,GACFA,IAEFvB,EAAgBxG,OAAO/B,EACzB,CACF,CAiBE+J,CAAgB/E,EAAG6E,OACrB,GACF,C","sources":["../node_modules/@ionic/core/components/input-shims.js"],"sourcesContent":["/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { g as getScrollElement, c as scrollByPoint, a as findClosestIonContent } from './index9.js';\nimport { a as addEventListener, b as removeEventListener, r as raf, p as pointerCoord, c as componentOnReady } from './helpers.js';\n\nconst cloneMap = new WeakMap();\nconst relocateInput = (componentEl, inputEl, shouldRelocate, inputRelativeY = 0, disabledClonedInput = false) => {\n if (cloneMap.has(componentEl) === shouldRelocate) {\n return;\n }\n if (shouldRelocate) {\n addClone(componentEl, inputEl, inputRelativeY, disabledClonedInput);\n }\n else {\n removeClone(componentEl, inputEl);\n }\n};\nconst isFocused = (input) => {\n return input === input.getRootNode().activeElement;\n};\nconst addClone = (componentEl, inputEl, inputRelativeY, disabledClonedInput = false) => {\n // this allows for the actual input to receive the focus from\n // the user's touch event, but before it receives focus, it\n // moves the actual input to a location that will not screw\n // up the app's layout, and does not allow the native browser\n // to attempt to scroll the input into place (messing up headers/footers)\n // the cloned input fills the area of where native input should be\n // while the native input fakes out the browser by relocating itself\n // before it receives the actual focus event\n // We hide the focused input (with the visible caret) invisible by making it scale(0),\n const parentEl = inputEl.parentNode;\n // DOM WRITES\n const clonedEl = inputEl.cloneNode(false);\n clonedEl.classList.add('cloned-input');\n clonedEl.tabIndex = -1;\n /**\n * Making the cloned input disabled prevents\n * Chrome for Android from still scrolling\n * the entire page since this cloned input\n * will briefly be hidden by the keyboard\n * even though it is not focused.\n *\n * This is not needed on iOS. While this\n * does not cause functional issues on iOS,\n * the input still appears slightly dimmed even\n * if we set opacity: 1.\n */\n if (disabledClonedInput) {\n clonedEl.disabled = true;\n }\n parentEl.appendChild(clonedEl);\n cloneMap.set(componentEl, clonedEl);\n const doc = componentEl.ownerDocument;\n const tx = doc.dir === 'rtl' ? 9999 : -9999;\n componentEl.style.pointerEvents = 'none';\n inputEl.style.transform = `translate3d(${tx}px,${inputRelativeY}px,0) scale(0)`;\n};\nconst removeClone = (componentEl, inputEl) => {\n const clone = cloneMap.get(componentEl);\n if (clone) {\n cloneMap.delete(componentEl);\n clone.remove();\n }\n componentEl.style.pointerEvents = '';\n inputEl.style.transform = '';\n};\n\nconst enableHideCaretOnScroll = (componentEl, inputEl, scrollEl) => {\n if (!scrollEl || !inputEl) {\n return () => {\n return;\n };\n }\n const scrollHideCaret = (shouldHideCaret) => {\n if (isFocused(inputEl)) {\n relocateInput(componentEl, inputEl, shouldHideCaret);\n }\n };\n const onBlur = () => relocateInput(componentEl, inputEl, false);\n const hideCaret = () => scrollHideCaret(true);\n const showCaret = () => scrollHideCaret(false);\n addEventListener(scrollEl, 'ionScrollStart', hideCaret);\n addEventListener(scrollEl, 'ionScrollEnd', showCaret);\n inputEl.addEventListener('blur', onBlur);\n return () => {\n removeEventListener(scrollEl, 'ionScrollStart', hideCaret);\n removeEventListener(scrollEl, 'ionScrollEnd', showCaret);\n inputEl.addEventListener('ionBlur', onBlur);\n };\n};\n\nconst SKIP_SELECTOR = 'input, textarea, [no-blur], [contenteditable]';\nconst enableInputBlurring = () => {\n let focused = true;\n let didScroll = false;\n const doc = document;\n const onScroll = () => {\n didScroll = true;\n };\n const onFocusin = () => {\n focused = true;\n };\n const onTouchend = (ev) => {\n // if app did scroll return early\n if (didScroll) {\n didScroll = false;\n return;\n }\n const active = doc.activeElement;\n if (!active) {\n return;\n }\n // only blur if the active element is a text-input or a textarea\n if (active.matches(SKIP_SELECTOR)) {\n return;\n }\n // if the selected target is the active element, do not blur\n const tapped = ev.target;\n if (tapped === active) {\n return;\n }\n if (tapped.matches(SKIP_SELECTOR) || tapped.closest(SKIP_SELECTOR)) {\n return;\n }\n focused = false;\n // TODO FW-2796: find a better way, why 50ms?\n setTimeout(() => {\n if (!focused) {\n active.blur();\n }\n }, 50);\n };\n addEventListener(doc, 'ionScrollStart', onScroll);\n doc.addEventListener('focusin', onFocusin, true);\n doc.addEventListener('touchend', onTouchend, false);\n return () => {\n removeEventListener(doc, 'ionScrollStart', onScroll, true);\n doc.removeEventListener('focusin', onFocusin, true);\n doc.removeEventListener('touchend', onTouchend, false);\n };\n};\n\nconst SCROLL_ASSIST_SPEED = 0.3;\nconst getScrollData = (componentEl, contentEl, keyboardHeight) => {\n var _a;\n const itemEl = (_a = componentEl.closest('ion-item,[ion-item]')) !== null && _a !== void 0 ? _a : componentEl;\n return calcScrollData(itemEl.getBoundingClientRect(), contentEl.getBoundingClientRect(), keyboardHeight, componentEl.ownerDocument.defaultView.innerHeight);\n};\nconst calcScrollData = (inputRect, contentRect, keyboardHeight, platformHeight) => {\n // compute input's Y values relative to the body\n const inputTop = inputRect.top;\n const inputBottom = inputRect.bottom;\n // compute visible area\n const visibleAreaTop = contentRect.top;\n const visibleAreaBottom = Math.min(contentRect.bottom, platformHeight - keyboardHeight);\n // compute safe area\n const safeAreaTop = visibleAreaTop + 15;\n const safeAreaBottom = visibleAreaBottom * 0.75;\n // figure out if each edge of the input is within the safe area\n const distanceToBottom = safeAreaBottom - inputBottom;\n const distanceToTop = safeAreaTop - inputTop;\n // desiredScrollAmount is the negated distance to the safe area according to our calculations.\n const desiredScrollAmount = Math.round(distanceToBottom < 0 ? -distanceToBottom : distanceToTop > 0 ? -distanceToTop : 0);\n // our calculations make some assumptions that aren't always true, like the keyboard being closed when an input\n // gets focus, so make sure we don't scroll the input above the visible area\n const scrollAmount = Math.min(desiredScrollAmount, inputTop - visibleAreaTop);\n const distance = Math.abs(scrollAmount);\n const duration = distance / SCROLL_ASSIST_SPEED;\n const scrollDuration = Math.min(400, Math.max(150, duration));\n return {\n scrollAmount,\n scrollDuration,\n scrollPadding: keyboardHeight,\n inputSafeY: -(inputTop - safeAreaTop) + 4,\n };\n};\n\nconst enableScrollAssist = (componentEl, inputEl, contentEl, footerEl, keyboardHeight, disableClonedInput = false) => {\n let coord;\n const touchStart = (ev) => {\n coord = pointerCoord(ev);\n };\n const touchEnd = (ev) => {\n // input cover touchend/mouseup\n if (!coord) {\n return;\n }\n // get where the touchend/mouseup ended\n const endCoord = pointerCoord(ev);\n // focus this input if the pointer hasn't moved XX pixels\n // and the input doesn't already have focus\n if (!hasPointerMoved(6, coord, endCoord) && !isFocused(inputEl)) {\n // begin the input focus process\n jsSetFocus(componentEl, inputEl, contentEl, footerEl, keyboardHeight, disableClonedInput);\n }\n };\n componentEl.addEventListener('touchstart', touchStart, { capture: true, passive: true });\n componentEl.addEventListener('touchend', touchEnd, true);\n return () => {\n componentEl.removeEventListener('touchstart', touchStart, true);\n componentEl.removeEventListener('touchend', touchEnd, true);\n };\n};\nconst jsSetFocus = async (componentEl, inputEl, contentEl, footerEl, keyboardHeight, disableClonedInput = false) => {\n if (!contentEl && !footerEl) {\n return;\n }\n const scrollData = getScrollData(componentEl, (contentEl || footerEl), keyboardHeight);\n if (contentEl && Math.abs(scrollData.scrollAmount) < 4) {\n // the text input is in a safe position that doesn't\n // require it to be scrolled into view, just set focus now\n inputEl.focus();\n return;\n }\n // temporarily move the focus to the focus holder so the browser\n // doesn't freak out while it's trying to get the input in place\n // at this point the native text input still does not have focus\n relocateInput(componentEl, inputEl, true, scrollData.inputSafeY, disableClonedInput);\n inputEl.focus();\n /**\n * Relocating/Focusing input causes the\n * click event to be cancelled, so\n * manually fire one here.\n */\n raf(() => componentEl.click());\n if (typeof window !== 'undefined') {\n let scrollContentTimeout;\n const scrollContent = async () => {\n // clean up listeners and timeouts\n if (scrollContentTimeout !== undefined) {\n clearTimeout(scrollContentTimeout);\n }\n window.removeEventListener('ionKeyboardDidShow', doubleKeyboardEventListener);\n window.removeEventListener('ionKeyboardDidShow', scrollContent);\n // scroll the input into place\n if (contentEl) {\n await scrollByPoint(contentEl, 0, scrollData.scrollAmount, scrollData.scrollDuration);\n }\n // the scroll view is in the correct position now\n // give the native text input focus\n relocateInput(componentEl, inputEl, false, scrollData.inputSafeY);\n // ensure this is the focused input\n inputEl.focus();\n };\n const doubleKeyboardEventListener = () => {\n window.removeEventListener('ionKeyboardDidShow', doubleKeyboardEventListener);\n window.addEventListener('ionKeyboardDidShow', scrollContent);\n };\n if (contentEl) {\n const scrollEl = await getScrollElement(contentEl);\n /**\n * scrollData will only consider the amount we need\n * to scroll in order to properly bring the input\n * into view. It will not consider the amount\n * we can scroll in the content element.\n * As a result, scrollData may request a greater\n * scroll position than is currently available\n * in the DOM. If this is the case, we need to\n * wait for the webview to resize/the keyboard\n * to show in order for additional scroll\n * bandwidth to become available.\n */\n const totalScrollAmount = scrollEl.scrollHeight - scrollEl.clientHeight;\n if (scrollData.scrollAmount > totalScrollAmount - scrollEl.scrollTop) {\n /**\n * On iOS devices, the system will show a \"Passwords\" bar above the keyboard\n * after the initial keyboard is shown. This prevents the webview from resizing\n * until the \"Passwords\" bar is shown, so we need to wait for that to happen first.\n */\n if (inputEl.type === 'password') {\n // Add 50px to account for the \"Passwords\" bar\n scrollData.scrollAmount += 50;\n window.addEventListener('ionKeyboardDidShow', doubleKeyboardEventListener);\n }\n else {\n window.addEventListener('ionKeyboardDidShow', scrollContent);\n }\n /**\n * This should only fire in 2 instances:\n * 1. The app is very slow.\n * 2. The app is running in a browser on an old OS\n * that does not support Ionic Keyboard Events\n */\n scrollContentTimeout = setTimeout(scrollContent, 1000);\n return;\n }\n }\n scrollContent();\n }\n};\nconst hasPointerMoved = (threshold, startCoord, endCoord) => {\n if (startCoord && endCoord) {\n const deltaX = startCoord.x - endCoord.x;\n const deltaY = startCoord.y - endCoord.y;\n const distance = deltaX * deltaX + deltaY * deltaY;\n return distance > threshold * threshold;\n }\n return false;\n};\n\nconst PADDING_TIMER_KEY = '$ionPaddingTimer';\nconst enableScrollPadding = (keyboardHeight) => {\n const doc = document;\n const onFocusin = (ev) => {\n setScrollPadding(ev.target, keyboardHeight);\n };\n const onFocusout = (ev) => {\n setScrollPadding(ev.target, 0);\n };\n doc.addEventListener('focusin', onFocusin);\n doc.addEventListener('focusout', onFocusout);\n return () => {\n doc.removeEventListener('focusin', onFocusin);\n doc.removeEventListener('focusout', onFocusout);\n };\n};\nconst setScrollPadding = (input, keyboardHeight) => {\n var _a, _b;\n if (input.tagName !== 'INPUT') {\n return;\n }\n if (input.parentElement && input.parentElement.tagName === 'ION-INPUT') {\n return;\n }\n if (((_b = (_a = input.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.tagName) === 'ION-SEARCHBAR') {\n return;\n }\n const el = findClosestIonContent(input);\n if (el === null) {\n return;\n }\n const timer = el[PADDING_TIMER_KEY];\n if (timer) {\n clearTimeout(timer);\n }\n if (keyboardHeight > 0) {\n el.style.setProperty('--keyboard-offset', `${keyboardHeight}px`);\n }\n else {\n el[PADDING_TIMER_KEY] = setTimeout(() => {\n el.style.setProperty('--keyboard-offset', '0px');\n }, 120);\n }\n};\n\nconst INPUT_BLURRING = true;\nconst SCROLL_PADDING = true;\nconst startInputShims = (config, platform) => {\n const doc = document;\n const isIOS = platform === 'ios';\n const isAndroid = platform === 'android';\n /**\n * Hide Caret and Input Blurring are needed on iOS.\n * Scroll Assist and Scroll Padding are needed on iOS and Android\n * with Chrome web browser (not Chrome webview).\n */\n const keyboardHeight = config.getNumber('keyboardHeight', 290);\n const scrollAssist = config.getBoolean('scrollAssist', true);\n const hideCaret = config.getBoolean('hideCaretOnScroll', isIOS);\n const inputBlurring = config.getBoolean('inputBlurring', isIOS);\n const scrollPadding = config.getBoolean('scrollPadding', true);\n const inputs = Array.from(doc.querySelectorAll('ion-input, ion-textarea'));\n const hideCaretMap = new WeakMap();\n const scrollAssistMap = new WeakMap();\n const registerInput = async (componentEl) => {\n await new Promise((resolve) => componentOnReady(componentEl, resolve));\n const inputRoot = componentEl.shadowRoot || componentEl;\n const inputEl = inputRoot.querySelector('input') || inputRoot.querySelector('textarea');\n const scrollEl = findClosestIonContent(componentEl);\n const footerEl = !scrollEl ? componentEl.closest('ion-footer') : null;\n if (!inputEl) {\n return;\n }\n if (!!scrollEl && hideCaret && !hideCaretMap.has(componentEl)) {\n const rmFn = enableHideCaretOnScroll(componentEl, inputEl, scrollEl);\n hideCaretMap.set(componentEl, rmFn);\n }\n /**\n * date/datetime-locale inputs on mobile devices show date picker\n * overlays instead of keyboards. As a result, scroll assist is\n * not needed. This also works around a bug in iOS <16 where\n * scroll assist causes the browser to lock up. See FW-1997.\n */\n const isDateInput = inputEl.type === 'date' || inputEl.type === 'datetime-local';\n if (!isDateInput &&\n (!!scrollEl || !!footerEl) &&\n scrollAssist &&\n !scrollAssistMap.has(componentEl)) {\n const rmFn = enableScrollAssist(componentEl, inputEl, scrollEl, footerEl, keyboardHeight, isAndroid);\n scrollAssistMap.set(componentEl, rmFn);\n }\n };\n const unregisterInput = (componentEl) => {\n if (hideCaret) {\n const fn = hideCaretMap.get(componentEl);\n if (fn) {\n fn();\n }\n hideCaretMap.delete(componentEl);\n }\n if (scrollAssist) {\n const fn = scrollAssistMap.get(componentEl);\n if (fn) {\n fn();\n }\n scrollAssistMap.delete(componentEl);\n }\n };\n if (inputBlurring && INPUT_BLURRING) {\n enableInputBlurring();\n }\n if (scrollPadding && SCROLL_PADDING) {\n enableScrollPadding(keyboardHeight);\n }\n // Input might be already loaded in the DOM before ion-device-hacks did.\n // At this point we need to look for all of the inputs not registered yet\n // and register them.\n for (const input of inputs) {\n registerInput(input);\n }\n doc.addEventListener('ionInputDidLoad', ((ev) => {\n registerInput(ev.detail);\n }));\n doc.addEventListener('ionInputDidUnload', ((ev) => {\n unregisterInput(ev.detail);\n }));\n};\n\nexport { startInputShims };\n"],"names":["cloneMap","WeakMap","relocateInput","componentEl","inputEl","shouldRelocate","inputRelativeY","disabledClonedInput","has","addClone","removeClone","isFocused","input","getRootNode","activeElement","parentEl","parentNode","clonedEl","cloneNode","classList","add","tabIndex","disabled","appendChild","set","doc","ownerDocument","tx","dir","style","pointerEvents","transform","clone","get","delete","remove","enableHideCaretOnScroll","scrollEl","scrollHideCaret","shouldHideCaret","onBlur","hideCaret","showCaret","addEventListener","removeEventListener","SKIP_SELECTOR","getScrollData","contentEl","keyboardHeight","_a","itemEl","closest","calcScrollData","getBoundingClientRect","defaultView","innerHeight","inputRect","contentRect","platformHeight","inputTop","top","inputBottom","bottom","visibleAreaTop","safeAreaTop","distanceToBottom","Math","min","distanceToTop","desiredScrollAmount","round","scrollAmount","duration","abs","scrollDuration","max","scrollPadding","inputSafeY","enableScrollAssist","footerEl","coord","disableClonedInput","touchStart","ev","pointerCoord","touchEnd","endCoord","hasPointerMoved","jsSetFocus","capture","passive","scrollData","focus","raf","click","window","scrollContent","undefined","scrollContentTimeout","clearTimeout","doubleKeyboardEventListener","scrollByPoint","getScrollElement","totalScrollAmount","scrollHeight","clientHeight","scrollTop","type","setTimeout","threshold","startCoord","deltaX","x","deltaY","y","setScrollPadding","_b","tagName","parentElement","el","findClosestIonContent","timer","setProperty","startInputShims","config","platform","document","isIOS","isAndroid","getNumber","scrollAssist","getBoolean","inputBlurring","inputs","Array","from","querySelectorAll","hideCaretMap","scrollAssistMap","registerInput","Promise","resolve","componentOnReady","inputRoot","shadowRoot","querySelector","rmFn","focused","didScroll","onScroll","onFocusin","onTouchend","active","matches","tapped","target","blur","enableInputBlurring","onFocusout","enableScrollPadding","detail","fn","unregisterInput"],"sourceRoot":""}