{"version":3,"file":"application-DQC9DhXg.js","sources":["../../../node_modules/better-dom/dist/better-dom.js","../../../node_modules/better-dateinput-polyfill/dist/better-dateinput-polyfill.js"],"sourcesContent":["/**\n * better-dom: Live extension playground\n * @version 4.1.0 Tue, 24 Mar 2020 09:55:50 GMT\n * @link https://github.com/chemerisuk/better-dom\n * @copyright 2020 Maksim Chemerisuk\n * @license MIT\n */\n(function () {\n \"use strict\";\n var WINDOW = window;\n var DOCUMENT = document;\n var HTML = DOCUMENT.documentElement;\n\n var UNKNOWN_NODE = 0;\n var ELEMENT_NODE = DOCUMENT.ELEMENT_NODE;\n var DOCUMENT_NODE = DOCUMENT.DOCUMENT_NODE;\n var VENDOR_PREFIXES = [\"Webkit\", \"O\", \"Moz\", \"ms\"];\n var FAKE_ANIMATION_NAME = \"v__40100__\";\n var SHEET_PROP_NAME = \"__40100__sheet\";\n\n var WEBKIT_PREFIX = WINDOW.WebKitAnimationEvent ? \"-webkit-\" : \"\";\n\n var util$index$$arrayProto = Array.prototype;\n\n var util$index$$every = util$index$$arrayProto.every;\n var util$index$$each = util$index$$arrayProto.forEach;\n var util$index$$filter = util$index$$arrayProto.filter;\n var util$index$$map = util$index$$arrayProto.map;\n var util$index$$slice = util$index$$arrayProto.slice;\n var util$index$$isArray = Array.isArray;\n var util$index$$keys = Object.keys;\n var util$index$$raf = WINDOW.requestAnimationFrame;\n\n function util$index$$computeStyle(node) {\n return node.ownerDocument.defaultView.getComputedStyle(node);\n }\n\n function util$index$$injectElement(node) {\n if (node && node.nodeType === ELEMENT_NODE) {\n return node.ownerDocument.getElementsByTagName(\"head\")[0].appendChild(node);\n }\n }\n function MethodError(methodName, args, type) {if (type === void 0) {type = \"$Element\";}\n var url = \"http://chemerisuk.github.io/better-dom/\" + type + \".html#\" + methodName,\n line = \"invalid call `\" + type + (type === \"DOM\" ? \".\" : \"#\") + methodName + \"(\";\n\n line += util$index$$map.call(args, String).join(\", \") + \")`. \";\n\n this.message = line + \"Check \" + url + \" to verify the arguments\";\n }\n\n MethodError.prototype = new TypeError();\n\n function StaticMethodError(methodName, args) {\n MethodError.call(this, methodName, args, \"DOM\");\n }\n\n StaticMethodError.prototype = new TypeError();\n\n function DocumentTypeError(methodName, args) {\n MethodError.call(this, methodName, args, \"$Document\");\n }\n\n DocumentTypeError.prototype = new TypeError();\n function $Node(node) {\n if (node) {\n this[0] = node;\n // use a generated property to store a reference\n // to the wrapper for circular object binding\n node[\"__40100__\"] = this;\n }\n }\n\n $Node.prototype = {\n toString: function toString() {return \"\";},\n valueOf: function valueOf() {return UNKNOWN_NODE;} // undefined\n };\n\n // fake animation for live extensions\n var STYLE_NODE_HTML = \"@\" + WEBKIT_PREFIX + \"keyframes \" + FAKE_ANIMATION_NAME + \" {from {opacity:.99} to {opacity:1}}\";\n\n function $Document(node) {\n if (this instanceof $Document) {\n // initialize state and all internal properties\n $Node.call(this, node);\n // add style element to append required css\n var styleNode = node.createElement(\"style\");\n styleNode.innerHTML = STYLE_NODE_HTML;\n util$index$$injectElement(styleNode);\n // store sheet object internally to use in importStyles later\n node[SHEET_PROP_NAME] = styleNode.sheet || styleNode.styleSheet;\n } else if (node) {\n // create a new wrapper or return existing object\n return node[\"__40100__\"] || new $Document(node);\n } else {\n return new $Document();\n }\n }\n\n var DocumentProto = new $Node();\n\n $Document.prototype = DocumentProto;\n\n DocumentProto.valueOf = function () {\n var node = this[0];\n return node ? DOCUMENT_NODE : UNKNOWN_NODE;\n };\n\n DocumentProto.toString = function () {return \"#document\";};\n function $Element(node) {\n if (this instanceof $Element) {\n $Node.call(this, node);\n } else if (node) {\n // create a new wrapper or return existing object\n return node[\"__40100__\"] || new $Element(node);\n } else {\n return new $Element();\n }\n }\n\n var ElementProto = new $Node();\n\n $Element.prototype = ElementProto;\n\n ElementProto.valueOf = function () {\n var node = this[0];\n return node ? ELEMENT_NODE : UNKNOWN_NODE;\n };\n\n ElementProto.toString = function () {\n var node = this[0];\n\n return node ? \"<\" + node.tagName.toLowerCase() + \">\" : \"#unknown\";\n };\n\n var index$$DOM = new $Document(WINDOW.document);\n var index$$_DOM = WINDOW.DOM;\n\n index$$DOM.constructor = function (node) {\n var nodeType = node && node.nodeType;\n\n if (nodeType === ELEMENT_NODE) {\n return $Element(node);\n } else if (nodeType === DOCUMENT_NODE) {\n return $Document(node);\n } else {\n return new $Node(node);\n }\n };\n\n index$$DOM.noConflict = function () {\n if (WINDOW.DOM === index$$DOM) {\n WINDOW.DOM = index$$_DOM;\n }\n\n return index$$DOM;\n };\n\n WINDOW.DOM = index$$DOM;\n\n var document$create$$reQuick = /^<([a-zA-Z-]+)\\/?>$/;\n var document$create$$sandbox = DOCUMENT.createElement(\"body\");\n\n function document$create$$makeMethod(all) {\n return function (value) {\n var node = this[0];\n\n if (!node || typeof value !== \"string\") {\n throw new MethodError(\"create\" + all, arguments);\n }\n\n var result = all ? [] : null;\n\n var quickMatch = !result && document$create$$reQuick.exec(value);\n if (quickMatch) {\n return new $Element(node.createElement(quickMatch[1]));\n }\n\n document$create$$sandbox.innerHTML = value.trim(); // parse HTML string\n\n for (var it; it = document$create$$sandbox.firstElementChild;) {\n document$create$$sandbox.removeChild(it); // detach element from the sandbox\n\n if (node !== DOCUMENT) {\n // adopt node for external documents\n it = node.adoptNode(it);\n }\n\n if (result) {\n result.push(new $Element(it));\n } else {\n result = new $Element(it);\n // need only the first element\n break;\n }\n }\n\n return result || new $Element();\n };\n }\n\n\n $Document.prototype.create = document$create$$makeMethod(\"\");\n\n $Document.prototype.createAll = document$create$$makeMethod(\"All\");\n\n // Helper for css selectors\n\n var util$selectormatcher$$rquickIs = /^(\\w*)(?:#([\\w\\-]+))?(?:\\[([\\w\\-\\=]+)\\])?(?:\\.([\\w\\-]+))?$/,\n util$selectormatcher$$propName = VENDOR_PREFIXES.concat(null).\n map(function (p) {return (p ? p.toLowerCase() + \"M\" : \"m\") + \"atchesSelector\";}).\n reduceRight(function (propName, p) {return propName || p in HTML && p;}, null);\n\n var util$selectormatcher$$default = function util$selectormatcher$$default(selector, context) {\n if (typeof selector !== \"string\") return null;\n\n var quick = util$selectormatcher$$rquickIs.exec(selector);\n\n if (quick) {\n // Quick matching is inspired by jQuery:\n // 0 1 2 3 4\n // [ _, tag, id, attribute, class ]\n if (quick[1]) quick[1] = quick[1].toLowerCase();\n if (quick[3]) quick[3] = quick[3].split(\"=\");\n if (quick[4]) quick[4] = \" \" + quick[4] + \" \";\n }\n\n return function (node) {\n var result, found;\n if (!quick && !util$selectormatcher$$propName) {\n found = (context || node.ownerDocument).querySelectorAll(selector);\n }\n\n for (; node && node.nodeType === 1; node = node.parentNode) {\n if (quick) {\n result =\n (!quick[1] || node.nodeName.toLowerCase() === quick[1]) && (\n !quick[2] || node.id === quick[2]) && (\n !quick[3] || (quick[3][1] ? node.getAttribute(quick[3][0]) === quick[3][1] : node.hasAttribute(quick[3][0]))) && (\n !quick[4] || (\" \" + node.className + \" \").indexOf(quick[4]) >= 0);\n\n } else {\n if (util$selectormatcher$$propName) {\n result = node[util$selectormatcher$$propName](selector);\n } else {\n for (var i = 0, n = found.length; i < n; ++i) {\n var n = found[i];\n\n if (n === node) return n;\n }\n }\n }\n\n if (result || !context || node === context) break;\n }\n\n return result && node;\n };\n };\n\n // Inspired by trick discovered by Daniel Buchner:\n // https://github.com/csuwldcat/SelectorListener\n\n var document$extend$$extensions = [];\n var document$extend$$EVENT_TYPE = WEBKIT_PREFIX ? \"webkitAnimationStart\" : \"animationstart\";\n var document$extend$$CSS_IMPORT_TEXT = [\n WEBKIT_PREFIX + \"animation-name:\" + FAKE_ANIMATION_NAME + \" !important\",\n WEBKIT_PREFIX + \"animation-duration:1ms !important\"].\n join(\";\");\n\n function document$extend$$applyLiveExtension(definition, node) {\n var el = $Element(node);\n var ctr = definition.constructor;\n // apply all element mixins\n Object.keys(definition).forEach(function (mixinName) {\n var mixinProperty = definition[mixinName];\n if (mixinProperty !== ctr) {\n el[mixinName] = mixinProperty;\n }\n });\n\n if (ctr) ctr.call(el);\n }\n\n $Document.prototype.extend = function (selector, definition) {\n var node = this[0];\n\n if (!node) return this;\n\n if (arguments.length === 1 && typeof selector === \"object\") {\n // handle case when $Document protytype is extended\n util$index$$keys(selector).forEach(function (key) {\n $Document.prototype[key] = selector[key];\n });\n\n return this;\n } else if (selector === \"*\") {\n // handle case when $Element protytype is extended\n util$index$$keys(definition).forEach(function (key) {\n $Element.prototype[key] = definition[key];\n });\n\n return this;\n }\n\n if (typeof definition === \"function\") {\n definition = { constructor: definition };\n }\n\n if (!definition || typeof definition !== \"object\") {\n throw new DocumentTypeError(\"extend\", arguments);\n }\n\n var matcher = util$selectormatcher$$default(selector);\n\n document$extend$$extensions.push([matcher, definition]);\n // use capturing to suppress internal animationstart events\n node.addEventListener(document$extend$$EVENT_TYPE, function (e) {\n var node = e.target;\n\n if (e.animationName === FAKE_ANIMATION_NAME && matcher(node)) {\n e.stopPropagation(); // this is an internal event\n // prevent any future events\n node.style.setProperty(WEBKIT_PREFIX + \"animation-name\", \"none\", \"important\");\n\n document$extend$$applyLiveExtension(definition, node);\n }\n }, true);\n\n // initialize extension manually to make sure that all elements\n // have appropriate methods before they are used in other DOM.extend\n // also fix cases when a matched element already has another LE\n util$index$$each.call(node.querySelectorAll(selector), function (node) {\n // prevent any future events\n node.style.setProperty(WEBKIT_PREFIX + \"animation-name\", \"none\", \"important\");\n // use timeout to invoke constructor safe and async\n WINDOW.setTimeout(function () {\n document$extend$$applyLiveExtension(definition, node);\n }, 0);\n });\n\n // subscribe selector to a fake animation\n this.importStyles(selector, document$extend$$CSS_IMPORT_TEXT);\n };\n\n $Document.prototype.mock = function (content) {\n if (!content) return new $Element();\n\n var result = this.create(content),\n applyExtensions = function applyExtensions(node) {\n document$extend$$extensions.forEach(function (args) {\n var matcher = args[0];\n var definition = args[1];\n\n if (matcher(node)) {\n document$extend$$applyLiveExtension(definition, node);\n }\n });\n\n util$index$$each.call(node.children, applyExtensions);\n };\n\n if (document$extend$$extensions.length) {\n applyExtensions(result[0]);\n }\n\n return result;\n };\n\n $Document.prototype.importScripts = function () {var _this = this,_arguments = arguments;for (var _len = arguments.length, urls = new Array(_len), _key = 0; _key < _len; _key++) {urls[_key] = arguments[_key];}\n var callback = function callback() {\n var node = _this[0];\n\n if (!node) return;\n\n var arg = urls.shift(),\n argType = typeof arg,\n script;\n\n if (argType === \"string\") {\n script = node.createElement(\"script\");\n script.src = arg;\n script.onload = callback;\n script.async = true;\n\n util$index$$injectElement(script);\n } else if (argType === \"function\") {\n arg();\n } else if (arg) {\n throw new DocumentTypeError(\"importScripts\", _arguments);\n }\n };\n\n callback();\n };\n\n $Document.prototype.importStyles = function (selector, cssText) {\n var node = this[0];\n\n if (!node) return;\n\n if (!cssText && typeof selector === \"string\") {\n cssText = selector;\n selector = \"@media screen\";\n }\n\n if (typeof selector !== \"string\" || typeof cssText !== \"string\") {\n throw new DocumentTypeError(\"importStyles\", arguments);\n }\n\n var styleSheet = node[SHEET_PROP_NAME];\n var lastIndex = styleSheet.cssRules.length;\n // insert rules one by one:\n // failed selector does not break others\n selector.split(\",\").forEach(function (selector) {\n try {\n lastIndex = styleSheet.insertRule(selector + \"{\" + cssText + \"}\", lastIndex);\n } catch (err) {\n // silently ignore invalid rules\n }\n });\n };\n\n function element$children$$makeMethod(methodName, validSelectorType) {\n return function (selector) {\n if (selector && typeof selector !== validSelectorType) {\n throw new MethodError(methodName, arguments);\n }\n\n var node = this[0];\n var matcher = util$selectormatcher$$default(selector);\n var children = node ? node.children : [];\n\n if (typeof selector === \"number\") {\n if (selector < 0) {\n selector = children.length + selector;\n }\n\n return $Element(children[selector]);\n } else {\n if (matcher) {\n return util$index$$filter.call(children, matcher).map($Element);\n } else {\n return util$index$$map.call(children, $Element);\n }\n }\n };\n }\n\n $Element.prototype.child = element$children$$makeMethod(\"child\", \"number\");\n\n $Element.prototype.children = element$children$$makeMethod(\"children\", \"string\");\n\n var element$classes$$REGEXP_SPACE = /[\\n\\t\\r]/g;\n var element$classes$$normalizedClass = function element$classes$$normalizedClass(node) {return (\" \" + node.className + \" \").replace(element$classes$$REGEXP_SPACE, \" \");};\n\n $Element.prototype.hasClass = function (className) {\n if (typeof className !== \"string\") {\n throw new MethodError(\"hasClass\", arguments);\n }\n\n var node = this[0];\n if (!node) return false;\n\n if (node.classList) {\n return node.classList.contains(className);\n } else {\n return element$classes$$normalizedClass(node).indexOf(\" \" + className + \" \") >= 0;\n }\n };\n\n $Element.prototype.addClass = function () {var _this2 = this,_arguments2 = arguments;for (var _len2 = arguments.length, classNames = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {classNames[_key2] = arguments[_key2];}\n var node = this[0];\n if (node) {\n classNames.forEach(function (className) {\n if (typeof className !== \"string\") {\n throw new MethodError(\"addClass\", _arguments2);\n }\n if (node.classList) {\n node.classList.add(className);\n } else if (!_this2.hasClass(className)) {\n _this2[0].className += \" \" + className;\n }\n });\n }\n\n return this;\n };\n\n $Element.prototype.removeClass = function () {var _arguments3 = arguments;for (var _len3 = arguments.length, classNames = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {classNames[_key3] = arguments[_key3];}\n var node = this[0];\n if (node) {\n classNames.forEach(function (className) {\n if (typeof className !== \"string\") {\n throw new MethodError(\"removeClass\", _arguments3);\n }\n if (node.classList) {\n node.classList.remove(className);\n } else {\n node.className = element$classes$$normalizedClass(node).replace(\" \" + className + \" \", \" \").trim();\n }\n });\n }\n\n return this;\n };\n\n $Element.prototype.toggleClass = function (className, force) {\n if (typeof className !== \"string\") {\n throw new MethodError(\"toggleClass\", arguments);\n }\n\n if (typeof force !== \"boolean\") {\n force = !this.hasClass(className);\n }\n\n var node = this[0];\n if (node) {\n if (force) {\n this.addClass(className);\n } else {\n this.removeClass(className);\n }\n }\n\n return force;\n };\n\n // Helper for CSS properties access\n\n var util$stylehooks$$reDash = /\\-./g,\n util$stylehooks$$hooks = { get: {}, set: {}, find: function find(name, style) {\n var propName = name.replace(util$stylehooks$$reDash, function (str) {return str[1].toUpperCase();});\n\n if (!(propName in style)) {\n propName = VENDOR_PREFIXES.\n map(function (prefix) {return prefix + propName[0].toUpperCase() + propName.slice(1);}).\n filter(function (prop) {return prop in style;})[0];\n }\n\n return this.get[name] = this.set[name] = propName;\n } },\n util$stylehooks$$directions = [\"Top\", \"Right\", \"Bottom\", \"Left\"],\n util$stylehooks$$shortCuts = {\n font: [\"fontStyle\", \"fontSize\", \"/\", \"lineHeight\", \"fontFamily\"],\n padding: util$stylehooks$$directions.map(function (dir) {return \"padding\" + dir;}),\n margin: util$stylehooks$$directions.map(function (dir) {return \"margin\" + dir;}),\n \"border-width\": util$stylehooks$$directions.map(function (dir) {return \"border\" + dir + \"Width\";}),\n \"border-style\": util$stylehooks$$directions.map(function (dir) {return \"border\" + dir + \"Style\";}) };\n\n\n // normalize float css property\n util$stylehooks$$hooks.get.float = util$stylehooks$$hooks.set.float = \"cssFloat\";\n\n // Exclude the following css properties from adding suffix 'px'\n \"fill-opacity font-weight line-height opacity orphans widows z-index zoom\".split(\" \").forEach(function (propName) {\n var stylePropName = propName.replace(util$stylehooks$$reDash, function (str) {return str[1].toUpperCase();});\n\n util$stylehooks$$hooks.get[propName] = stylePropName;\n util$stylehooks$$hooks.set[propName] = function (value, style) {\n style[stylePropName] = value.toString();\n };\n });\n\n // normalize property shortcuts\n util$index$$keys(util$stylehooks$$shortCuts).forEach(function (key) {\n var props = util$stylehooks$$shortCuts[key];\n\n util$stylehooks$$hooks.get[key] = function (style) {\n var result = [],\n hasEmptyStyleValue = function hasEmptyStyleValue(prop, index) {\n result.push(prop === \"/\" ? prop : style[prop]);\n\n return !result[index];\n };\n\n return props.some(hasEmptyStyleValue) ? \"\" : result.join(\" \");\n };\n\n util$stylehooks$$hooks.set[key] = function (value, style) {\n if (value && \"cssText\" in style) {\n // normalize setting a complex property across browsers\n style.cssText += \";\" + key + \":\" + value;\n } else {\n props.forEach(function (name) {return style[name] = typeof value === \"number\" ? value + \"px\" : value.toString();});\n }\n };\n });\n\n var util$stylehooks$$default = util$stylehooks$$hooks;\n\n $Element.prototype.css = function (name, value) {var _this3 = this;\n var len = arguments.length;\n var node = this[0];\n\n if (!node) {\n if (len === 1 && util$index$$isArray(name)) {\n return {};\n }\n\n if (len !== 1 || typeof name !== \"string\") {\n return this;\n }\n\n return;\n }\n\n var style = node.style;\n var computed;\n\n if (len === 1 && (typeof name === \"string\" || util$index$$isArray(name))) {\n var strategy = function strategy(name) {\n var getter = util$stylehooks$$default.get[name] || util$stylehooks$$default.find(name, style),\n value = typeof getter === \"function\" ? getter(style) : style[getter];\n\n if (!value) {\n if (!computed) computed = util$index$$computeStyle(node);\n\n value = typeof getter === \"function\" ? getter(computed) : computed[getter];\n }\n\n return value;\n };\n\n if (typeof name === \"string\") {\n return strategy(name);\n } else {\n return name.map(strategy).reduce(function (memo, value, index) {\n memo[name[index]] = value;\n\n return memo;\n }, {});\n }\n }\n\n if (len === 2 && typeof name === \"string\") {\n var setter = util$stylehooks$$default.set[name] || util$stylehooks$$default.find(name, style);\n\n if (typeof value === \"function\") {\n value = value(this);\n }\n\n if (value == null) value = \"\";\n\n if (typeof setter === \"function\") {\n setter(value, style);\n } else {\n style[setter] = typeof value === \"number\" ? value + \"px\" : value.toString();\n }\n } else if (len === 1 && name && typeof name === \"object\") {\n util$index$$keys(name).forEach(function (key) {_this3.css(key, name[key]);});\n } else {\n throw new MethodError(\"css\", arguments);\n }\n\n return this;\n };\n\n function element$manipulation$$makeMethod(fastStrategy, requiresParent, strategy) {\n return function () {var _this4 = this;\n var node = this[0];\n\n if (!node || requiresParent && !node.parentNode) return this;\n\n // the idea of the algorithm is to construct HTML string\n // when possible or use document fragment as a fallback to\n // invoke manipulation using a single method call\n var fragment = fastStrategy ? \"\" : node.ownerDocument.createDocumentFragment();for (var _len4 = arguments.length, contents = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {contents[_key4] = arguments[_key4];}\n\n contents.forEach(function (content) {\n if (typeof content === \"function\") {\n content = content(_this4);\n }\n\n if (typeof content === \"string\") {\n if (typeof fragment === \"string\") {\n fragment += content.trim();\n } else {\n content = $Document(node.ownerDocument).createAll(content);\n }\n } else if (content instanceof $Element) {\n content = [content];\n }\n\n if (util$index$$isArray(content)) {\n if (typeof fragment === \"string\") {\n // append existing string to fragment\n content = $Document(node.ownerDocument).createAll(fragment).concat(content);\n // fallback to document fragment strategy\n fragment = node.ownerDocument.createDocumentFragment();\n }\n\n content.forEach(function (el) {\n fragment.appendChild(el[0]);\n });\n }\n });\n\n if (typeof fragment === \"string\") {\n node.insertAdjacentHTML(fastStrategy, fragment);\n } else {\n strategy(node, fragment);\n }\n\n return this;\n };\n }\n\n $Element.prototype.after = element$manipulation$$makeMethod(\"afterend\", true, function (node, relatedNode) {\n node.parentNode.insertBefore(relatedNode, node.nextSibling);\n });\n\n $Element.prototype.before = element$manipulation$$makeMethod(\"beforebegin\", true, function (node, relatedNode) {\n node.parentNode.insertBefore(relatedNode, node);\n });\n\n $Element.prototype.prepend = element$manipulation$$makeMethod(\"afterbegin\", false, function (node, relatedNode) {\n node.insertBefore(relatedNode, node.firstChild);\n });\n\n $Element.prototype.append = element$manipulation$$makeMethod(\"beforeend\", false, function (node, relatedNode) {\n node.appendChild(relatedNode);\n });\n\n $Element.prototype.replace = element$manipulation$$makeMethod(\"\", true, function (node, relatedNode) {\n node.parentNode.replaceChild(relatedNode, node);\n });\n\n $Element.prototype.remove = element$manipulation$$makeMethod(\"\", true, function (node) {\n node.parentNode.removeChild(node);\n });\n\n var util$selectorhooks$$default = {\n \":focus\": function focus(node) {return node === node.ownerDocument.activeElement;}\n\n // \":visible\": (node) => !isHidden(node),\n\n // \":hidden\": isHidden\n };\n\n $Element.prototype.matches = function (selector) {\n if (!selector || typeof selector !== \"string\") {\n throw new MethodError(\"matches\", arguments);\n }\n\n var checker = util$selectorhooks$$default[selector] || util$selectormatcher$$default(selector);\n\n return !!checker(this[0]);\n };\n\n $Element.prototype.offset = function () {\n var node = this[0];\n var result = { top: 0, left: 0, right: 0, bottom: 0, width: 0, height: 0 };\n\n if (node) {\n var docEl = (node.ownerDocument || node).documentElement;\n var clientTop = docEl.clientTop;\n var clientLeft = docEl.clientLeft;\n var scrollTop = WINDOW.pageYOffset || docEl.scrollTop;\n var scrollLeft = WINDOW.pageXOffset || docEl.scrollLeft;\n var boundingRect = node.getBoundingClientRect();\n\n result.top = boundingRect.top + scrollTop - clientTop;\n result.left = boundingRect.left + scrollLeft - clientLeft;\n result.right = boundingRect.right + scrollLeft - clientLeft;\n result.bottom = boundingRect.bottom + scrollTop - clientTop;\n result.width = boundingRect.right - boundingRect.left;\n result.height = boundingRect.bottom - boundingRect.top;\n }\n\n return result;\n };\n\n function element$traversing$$makeMethod(methodName, propertyName, all) {\n return function (selector) {\n if (selector && typeof selector !== \"string\") {\n throw new MethodError(methodName, arguments);\n }\n\n var node = this[0];\n var result = all ? [] : null;\n\n if (node) {\n var matcher = util$selectormatcher$$default(selector);\n // method closest starts traversing from the element itself\n // except no selector was specified where it returns parent\n if (node && (!matcher || methodName !== \"closest\")) {\n node = node[propertyName];\n }\n\n for (var it = node; it; it = it[propertyName]) {\n if (!matcher || matcher(it)) {\n if (result) {\n result.push($Element(it));\n } else {\n result = $Element(it);\n // need only the first element\n break;\n }\n }\n }\n }\n\n return result || new $Element();\n };\n }\n\n $Element.prototype.next = element$traversing$$makeMethod(\"next\", \"nextElementSibling\");\n\n $Element.prototype.prev = element$traversing$$makeMethod(\"prev\", \"previousElementSibling\");\n\n $Element.prototype.nextAll = element$traversing$$makeMethod(\"nextAll\", \"nextElementSibling\", true);\n\n $Element.prototype.prevAll = element$traversing$$makeMethod(\"prevAll\", \"previousElementSibling\", true);\n\n $Element.prototype.closest = element$traversing$$makeMethod(\"closest\", \"parentNode\");\n\n $Element.prototype.value = function (content) {\n var node = this[0];\n\n if (!node) return content ? this : void 0;\n\n var tagName = node.tagName;\n\n if (content === void 0) {\n if (tagName === \"SELECT\") {\n return ~node.selectedIndex ? node.options[node.selectedIndex].value : \"\";\n } else if (tagName === \"OPTION\") {\n return node.hasAttribute(\"value\") ? node.value : node.text;\n } else if (tagName === \"INPUT\" || tagName === \"TEXTAREA\") {\n return node.value;\n } else {\n return node.textContent;\n }\n } else {\n switch (tagName) {\n case \"INPUT\":\n case \"OPTION\":\n case \"TEXTAREA\":\n if (typeof content === \"function\") {\n content = content(node.value);\n }\n node.value = content;\n break;\n\n case \"SELECT\":\n if (typeof content === \"function\") {\n content = content(node.value);\n }\n if (util$index$$every.call(node.options, function (o) {return !(o.selected = o.value === content);})) {\n node.selectedIndex = -1;\n }\n break;\n\n default:\n if (typeof content === \"function\") {\n content = content(node.textContent);\n }\n node.textContent = content;}\n\n\n return this;\n }\n };\n\n\n $Element.prototype.empty = function () {\n return this.value(\"\");\n };\n\n var util$animationhandler$$TRANSITION_EVENT_TYPE = WEBKIT_PREFIX ? \"webkitTransitionEnd\" : \"transitionend\";\n var util$animationhandler$$ANIMATION_EVENT_TYPE = WEBKIT_PREFIX ? \"webkitAnimationEnd\" : \"animationend\";\n\n function util$animationhandler$$AnimationHandler(node, animationName) {\n this.node = node;\n this.style = node.style;\n this.eventType = animationName ? util$animationhandler$$ANIMATION_EVENT_TYPE : util$animationhandler$$TRANSITION_EVENT_TYPE;\n this.animationName = animationName;\n }\n\n util$animationhandler$$AnimationHandler.prototype = {\n handleEvent: function handleEvent(e) {\n if (!this.animationName || e.animationName === this.animationName) {\n if (this.animationName) {\n this.style.animationName = \"\";\n this.style.animationDirection = \"\";\n }\n\n this.node.removeEventListener(this.eventType, this, true);\n\n if (typeof this.callback === \"function\") {\n this.callback();\n }\n }\n },\n start: function start(callback, animationDirection) {\n this.callback = callback;\n\n if (this.animationName) {\n this.style.animationName = this.animationName;\n this.style.animationDirection = animationDirection;\n }\n\n this.node.addEventListener(this.eventType, this, true);\n } };\n\n\n var util$animationhandler$$default = util$animationhandler$$AnimationHandler;\n\n function element$visibility$$makeMethod(methodName, condition) {\n return function (animationName, callback) {var _this5 = this;\n if (typeof animationName !== \"string\") {\n callback = animationName;\n animationName = null;\n }\n\n if (callback && typeof callback !== \"function\") {\n throw new MethodError(methodName, arguments);\n }\n\n var node = this[0];\n\n if (!node) return this;\n\n var computed = util$index$$computeStyle(node);\n // Determine of we need animation by checking if an element\n // has non-zero width. Triggers reflow but fixes animation\n // for new elements inserted into the DOM in some browsers\n\n if (node && computed.width) {\n var complete = function complete() {\n node.style.visibility = condition ? \"hidden\" : \"inherit\";\n\n if (typeof callback === \"function\") {\n callback(_this5);\n }\n };\n\n if (!node.ownerDocument.documentElement.contains(node)) {\n util$index$$raf(complete); // skip animating of detached elements\n } else if (!animationName && parseFloat(computed[\"transition-duration\"]) === 0) {\n util$index$$raf(complete); // skip animating with zero transition duration\n } else if (animationName && parseFloat(computed[\"animation-duration\"]) === 0) {\n util$index$$raf(complete); // skip animating with zero animation duration\n } else {\n // always make an element visible before animation start\n node.style.visibility = \"visible\";\n\n new util$animationhandler$$default(node, animationName).\n start(complete, condition ? \"normal\" : \"reverse\");\n }\n }\n // trigger CSS3 transition if it exists\n return this.set(\"aria-hidden\", String(condition));\n };\n }\n\n $Element.prototype.show = element$visibility$$makeMethod(\"show\", false);\n\n $Element.prototype.hide = element$visibility$$makeMethod(\"hide\", true);\n\n $Node.prototype.clone = function (deepCopy) {\n if (typeof deepCopy !== \"boolean\") {\n throw new MethodError(\"clone\", arguments);\n }\n\n var node = this[0];\n\n if (node) {\n var clonedNode = node.cloneNode(deepCopy);\n\n if (this instanceof $Element) {\n return new $Element(clonedNode);\n } else if (this instanceof $Document) {\n return new $Document(clonedNode);\n }\n }\n\n return new $Node();\n };\n\n $Node.prototype.contains = function (element) {\n var node = this[0];\n\n if (!node) return false;\n\n if (element instanceof $Element) {\n var otherNode = element[0];\n\n if (otherNode === node) return true;\n if (node.contains) {\n return node.contains(otherNode);\n } else {\n return node.compareDocumentPosition(otherNode) & 16;\n }\n }\n\n throw new MethodError(\"contains\", arguments);\n };\n\n // big part of code inspired by Sizzle:\n // https://github.com/jquery/sizzle/blob/master/sizzle.js\n\n var node$find$$REGEXP_QUICK = /^(?:(\\w+)|\\.([\\w\\-]+))$/;\n var node$find$$REGEXP_ESCAPE = /'|\\\\/g;\n\n function node$find$$makeMethod(methodName, all) {\n return function (selector) {\n if (typeof selector !== \"string\") {\n throw new MethodError(methodName, arguments);\n }\n\n var node = this[0];\n\n if (!node) return all ? [] : new $Node();\n\n var result;\n\n if (this instanceof $Document || this instanceof $Element) {\n var quickMatch = node$find$$REGEXP_QUICK.exec(selector);\n\n if (quickMatch) {\n if (quickMatch[1]) {\n // speed-up: \"TAG\"\n result = node.getElementsByTagName(selector);\n } else {\n // speed-up: \".CLASS\"\n result = node.getElementsByClassName(quickMatch[2]);\n }\n\n if (result && !all) result = result[0];\n } else if (this instanceof $Element) {\n var id = node.getAttribute(\"id\");\n\n // qSA works strangely on Element-rooted queries\n // We can work around this by specifying an extra ID on the root\n // and working up from there (Thanks to Andrew Dupont for the technique)\n\n var prefix;\n if (id) {\n prefix = id.replace(node$find$$REGEXP_ESCAPE, \"\\\\$&\");\n } else {\n prefix = \"___40100__\";\n // set fake id attribute value\n node.setAttribute(\"id\", prefix);\n }\n\n prefix = \"[id='\" + prefix + \"'] \";\n selector = prefix + selector.split(\",\").join(\",\" + prefix);\n\n result = node[\"querySelector\" + all](selector);\n // cleanup fake id attribute value\n if (!id) node.removeAttribute(\"id\");\n } else {\n result = node[\"querySelector\" + all](selector);\n }\n } else {\n result = node[\"querySelector\" + all](selector);\n }\n\n return all ? util$index$$map.call(result, $Element) : $Element(result);\n };\n }\n\n $Node.prototype.find = node$find$$makeMethod(\"find\", \"\");\n\n $Node.prototype.findAll = node$find$$makeMethod(\"findAll\", \"All\");\n\n var util$eventhooks$$hooks = {};\n if (\"onfocusin\" in HTML) {\n util$eventhooks$$hooks.focus = function (handler) {handler._type = \"focusin\";};\n util$eventhooks$$hooks.blur = function (handler) {handler._type = \"focusout\";};\n } else {\n // firefox doesn't support focusin/focusout events\n util$eventhooks$$hooks.focus = util$eventhooks$$hooks.blur = function (handler) {\n handler.options.capture = true;\n };\n }\n if (DOCUMENT.createElement(\"input\").validity) {\n util$eventhooks$$hooks.invalid = function (handler) {\n handler.options.capture = true;\n };\n }\n\n var util$eventhooks$$default = util$eventhooks$$hooks;\n\n // https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection\n var util$eventhandler$$supportsPassive = false;\n try {\n var util$eventhandler$$opts = Object.defineProperty({}, \"passive\", {\n get: function get() {\n util$eventhandler$$supportsPassive = true;\n } });\n\n WINDOW.addEventListener(\"test\", null, util$eventhandler$$opts);\n } catch (e) {}\n\n function util$eventhandler$$EventHandler(context, node, options, args) {\n this.context = context;\n this.node = node;\n this.options = options;\n this.args = args;\n\n if (options.selector) {\n this.matcher = util$selectormatcher$$default(options.selector, node);\n }\n }\n\n util$eventhandler$$EventHandler.prototype = {\n handleEvent: function handleEvent(e) {\n this.event = e;\n // update value of currentTarget if selector exists\n this.currentTarget = this.matcher ? this.matcher(e.target) : this.node;\n // early stop when target doesn't match selector\n if (this.currentTarget) {\n if (this.options.once === true) {\n this.unsubscribe();\n }\n\n var args = this.args.map(this.getEventProperty, this);\n // prevent default if handler returns false\n if (this.callback.apply(this.context, args) === false) {\n e.preventDefault();\n }\n }\n },\n getEventProperty: function getEventProperty(name) {var _arguments4 = arguments;\n var e = this.event;\n if (name === \"type\") {\n return this.type;\n } else if (name === \"target\" || name === \"relatedTarget\") {\n return $Element(e[name]);\n } else if (name === \"currentTarget\") {\n return $Element(this.currentTarget);\n }\n\n var value = e[name];\n if (typeof value === \"function\") {\n return function () {return value.apply(e, _arguments4);};\n } else {\n return value;\n }\n },\n subscribe: function subscribe(type, callback) {\n var hook = util$eventhooks$$default[type];\n\n this.type = type;\n this.callback = callback;\n\n if (hook) hook(this);\n\n this.node.addEventListener(this._type || this.type, this, this.getLastArgument());\n },\n unsubscribe: function unsubscribe() {\n this.node.removeEventListener(this._type || this.type, this, this.getLastArgument());\n },\n getLastArgument: function getLastArgument() {\n var lastArg = !!this.options.capture;\n if (this.options.passive && util$eventhandler$$supportsPassive) {\n lastArg = { passive: true, capture: lastArg };\n }\n return lastArg;\n } };\n\n\n var util$eventhandler$$default = util$eventhandler$$EventHandler;\n\n $Node.prototype.fire = function (type, detail) {\n var node = this[0];\n var e, eventType, canContinue;\n\n if (typeof type === \"string\") {\n var hook = util$eventhooks$$default[type],\n handler = { options: {} };\n\n if (hook) handler = hook(handler) || handler;\n\n eventType = handler._type || type;\n } else {\n throw new MethodError(\"fire\", arguments);\n }\n\n if (!node) return true;\n\n e = (node.ownerDocument || node).createEvent(\"CustomEvent\");\n e.initCustomEvent(eventType, true, true, detail);\n canContinue = node.dispatchEvent(e);\n\n // call native function to trigger default behavior\n if (canContinue && node[type]) {\n var _handleEvent = util$eventhandler$$default.prototype.handleEvent;\n // intercept handleEvent to prevent double event callbacks\n util$eventhandler$$default.prototype.handleEvent = function (e) {\n // prevent re-triggering of the current event\n if (this.type !== type) {\n return _handleEvent.call(this, e);\n }\n };\n\n node[type]();\n // restore original method\n util$eventhandler$$default.prototype.handleEvent = _handleEvent;\n }\n\n return canContinue;\n };\n var util$accessorhooks$$hooks = { get: {}, set: {} };\n\n // fix camel cased attributes\n \"tabIndex readOnly maxLength cellSpacing cellPadding rowSpan colSpan useMap frameBorder contentEditable\".split(\" \").forEach(function (key) {\n util$accessorhooks$$hooks.get[key.toLowerCase()] = function (node) {return node[key];};\n });\n\n // style hook\n util$accessorhooks$$hooks.get.style = function (node) {return node.style.cssText;};\n util$accessorhooks$$hooks.set.style = function (node, value) {node.style.cssText = value;};\n // some browsers don't recognize input[type=email] etc.\n util$accessorhooks$$hooks.get.type = function (node) {return node.getAttribute(\"type\") || node.type;};\n\n var util$accessorhooks$$default = util$accessorhooks$$hooks;\n\n $Node.prototype.get = function (name, defaultValue) {var _this6 = this;\n var node = this[0];\n var hook = util$accessorhooks$$default.get[name];\n var value;\n\n if (!node) return value;\n\n if (arguments.length === 0) {\n return node.innerHTML;\n }\n\n if (hook) {\n value = hook(node, name);\n } else if (typeof name === \"string\") {\n if (name in node) {\n value = node[name];\n } else if (this instanceof $Element) {\n value = node.getAttribute(name);\n } else {\n value = null;\n }\n } else if (util$index$$isArray(name)) {\n value = name.reduce(function (memo, key) {\n return memo[key] = _this6.get(key), memo;\n }, {});\n } else {\n throw new MethodError(\"get\", arguments);\n }\n\n return value != null ? value : defaultValue;\n };\n\n $Node.prototype.on = function (type, options, args, callback) {\n if (typeof type === \"string\") {\n if (typeof options === \"string\") {\n options = { selector: options };\n } else if (typeof options === \"function\") {\n callback = options;\n options = {};\n args = [];\n } else if (typeof options === \"object\") {\n if (util$index$$isArray(options)) {\n callback = args;\n args = options;\n options = {};\n }\n }\n\n if (typeof args === \"function\") {\n callback = args;\n args = [];\n }\n\n if (options && typeof options === \"object\" && typeof callback === \"function\") {\n var node = this[0];\n\n if (!node) return function () {};\n\n var handler = new util$eventhandler$$default(this, node, options, args);\n handler.subscribe(type, callback);\n return function () {return handler.unsubscribe();};\n }\n }\n\n throw new MethodError(\"on\", arguments);\n };\n\n $Node.prototype.set = function (name, value) {var _this7 = this;\n var node = this[0];\n var len = arguments.length;\n var hook = util$accessorhooks$$default.set[name];\n\n if (node) {\n if (typeof name === \"string\") {\n if (len === 1) {// innerHTML shortcut\n value = name;\n name = \"innerHTML\";\n }\n\n if (typeof value === \"function\") {\n value = value(this.get(name));\n }\n\n if (hook) {\n hook(node, value);\n } else if (value == null && this instanceof $Element) {\n node.removeAttribute(name);\n } else if (name in node) {\n node[name] = value;\n } else if (this instanceof $Element) {\n node.setAttribute(name, value);\n }\n } else if (util$index$$isArray(name)) {\n if (len === 1) {\n node.textContent = \"\"; // clear node children\n this.append.apply(this, name);\n } else {\n name.forEach(function (key) {_this7.set(key, value);});\n }\n } else if (typeof name === \"object\") {\n util$index$$keys(name).forEach(function (key) {_this7.set(key, name[key]);});\n } else {\n throw new MethodError(\"set\", arguments);\n }\n }\n\n return this;\n };\n})();","/**\n * better-dateinput-polyfill: input[type=date] polyfill for better-dom\n * @version 3.3.1 Thu, 03 Sep 2020 09:59:12 GMT\n * @link https://github.com/chemerisuk/better-dateinput-polyfill\n * @copyright 2020 Maksim Chemerisuk\n * @license MIT\n */\n(function () {\n \"use strict\";\n\n /* globals html:false */\n var MAIN_CSS = \"dateinput-picker{display:inline-block;vertical-align:bottom;overflow:hidden;position:absolute;z-index:1000;width:336px;height:320px;max-height:320px;box-shadow:0 8px 24px #888;background:#fff;opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transform-origin:0 0;transform-origin:0 0;transition:.1s ease-out}dateinput-picker[aria-hidden=true]{opacity:0;-webkit-transform:skew(-25deg) scaleX(.75);transform:skew(-25deg) scaleX(.75);visibility:hidden;height:0}dateinput-picker[aria-expanded=true]{height:220px;max-height:220px}dateinput-picker+input{color:transparent!important;caret-color:transparent!important}dateinput-picker+input::selection{color:rgba(0,0,0,.01);background:none}dateinput-picker+input::-moz-selection{background:none}\";\n var HTML = DOM.find(\"html\");\n var DEFAULT_LANGUAGE = HTML.get(\"lang\") || void 0;\n var DEVICE_TYPE = \"orientation\" in window ? \"mobile\" : \"desktop\";\n\n var TYPE_SUPPORTED = function () {\n // use a stronger type support detection that handles old WebKit browsers:\n // http://www.quirksmode.org/blog/archives/2015/03/better_modern_i.html\n return DOM.create(\"\").value(\"_\").value() !== \"_\";\n }();\n\n function formatLocalDate(date) {\n return [date.getFullYear(), (\"0\" + (date.getMonth() + 1)).slice(-2), (\"0\" + date.getDate()).slice(-2)].join(\"-\");\n }\n\n function parseLocalDate(value) {\n var parts = (value || \"?\").split(/\\D/).map(function (s) {\n return parseInt(s);\n });\n var dateValue = new Date(parts[0], parts[1] - 1, parts[2], 0, 0);\n return isNaN(dateValue.getTime()) ? null : dateValue;\n }\n\n var globalFormatters = DOM.findAll(\"meta[name^='data-format:']\").reduce(function (globalFormatters, meta) {\n var key = meta.get(\"name\").split(\":\")[1].trim();\n var formatOptions = JSON.parse(meta.get(\"content\"));\n\n if (key) {\n try {\n globalFormatters[key] = new window.Intl.DateTimeFormat(DEFAULT_LANGUAGE, formatOptions);\n } catch (err) {}\n }\n\n return globalFormatters;\n }, {});\n DOM.extend(\"input[type=date]\", {\n constructor: function constructor() {\n if (this._isPolyfillEnabled()) return false;\n var svgTextOptions = this.css([\"color\", \"font-size\", \"font-family\", \"font-style\", \"line-height\", \"padding-left\", \"border-left-width\", \"text-indent\"]);\n svgTextOptions.dx = [\"padding-left\", \"border-left-width\", \"text-indent\"].map(function (p) {\n return parseFloat(svgTextOptions[p]);\n }).reduce(function (a, b) {\n return a + b;\n });\n svgTextOptions.css = [\"font-family\", \"font-style\", \"line-height\", \"font-size\"].map(function (p) {\n return p + \":\" + svgTextOptions[p];\n }).join(\";\").replace(/\"/g, \"\"); // FIXME: fix issue in html helper and drop replace below\n\n this._backgroundTemplate = (\"\").replace(\">\", \" style=\\\"\" + svgTextOptions.css + \"\\\">\");\n var picker = DOM.create(\"\"); // store reference to the input\n\n picker._parentInput = this; // add to the document\n\n this.before(picker.hide()); // store reference to the picker\n\n this._picker = picker;\n\n var resetDisplayedText = this._syncDisplayedText.bind(this, \"defaultValue\");\n\n var updateDisplayedText = this._syncDisplayedText.bind(this, \"value\"); // patch value property for the input element\n\n\n var valueDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, \"value\");\n Object.defineProperty(this[0], \"value\", {\n configurable: false,\n enumerable: true,\n get: valueDescriptor.get,\n set: this._setValue.bind(this, valueDescriptor.set, updateDisplayedText)\n });\n Object.defineProperty(this[0], \"valueAsDate\", {\n configurable: false,\n enumerable: true,\n get: this._getValueAsDate.bind(this),\n set: this._setValueAsDate.bind(this)\n }); // sync picker visibility on focus/blur\n\n this.on(\"change\", updateDisplayedText);\n this.on(\"focus\", this._focusInput.bind(this));\n this.on(\"blur\", this._blurInput.bind(this));\n this.on(\"keydown\", [\"which\"], this._keydownInput.bind(this));\n this.on(\"click\", this._focusInput.bind(this)); // form events do not trigger any state change\n\n this.closest(\"form\").on(\"reset\", resetDisplayedText);\n resetDisplayedText(); // present initial value\n },\n _isPolyfillEnabled: function _isPolyfillEnabled() {\n var polyfillType = this.get(\"data-polyfill\");\n if (polyfillType === \"none\") return true;\n\n if (polyfillType && (polyfillType === DEVICE_TYPE || polyfillType === \"all\")) {\n // remove native browser implementation\n this.set(\"type\", \"text\"); // force applying the polyfill\n\n return false;\n }\n\n return TYPE_SUPPORTED;\n },\n _setValue: function _setValue(setter, updateDisplayedText, value) {\n var dateValue = parseLocalDate(value);\n\n if (!dateValue) {\n value = \"\";\n } else {\n var min = parseLocalDate(this.get(\"min\"));\n var max = parseLocalDate(this.get(\"max\"));\n\n if (min && dateValue < min) {\n value = formatLocalDate(min);\n } else if (max && dateValue > max) {\n value = formatLocalDate(max);\n }\n }\n\n setter.call(this[0], value);\n updateDisplayedText();\n },\n _getValueAsDate: function _getValueAsDate() {\n return parseLocalDate(this.value());\n },\n _setValueAsDate: function _setValueAsDate(dateValue) {\n if (dateValue instanceof Date && !isNaN(dateValue.getTime())) {\n this.value(formatLocalDate(dateValue));\n }\n },\n _syncDisplayedText: function _syncDisplayedText(propName) {\n var displayText = this.get(propName);\n var dateValue = parseLocalDate(displayText);\n\n if (dateValue) {\n var formatOptions = this.get(\"data-format\");\n var formatter = globalFormatters[formatOptions];\n\n try {\n // set hours to '12' to fix Safari bug in Date#toLocaleString\n var presentedDate = new Date(dateValue.getFullYear(), dateValue.getMonth(), dateValue.getDate(), 12);\n\n if (formatter) {\n displayText = formatter.format(presentedDate);\n } else {\n displayText = presentedDate.toLocaleDateString(DEFAULT_LANGUAGE, formatOptions ? JSON.parse(formatOptions) : {});\n }\n } catch (err) {}\n }\n\n this.css(\"background-image\", \"url('data:image/svg+xml,\" + encodeURIComponent(this._backgroundTemplate.replace(\">\", \">\" + displayText + \"\")) + \"')\");\n },\n _keydownInput: function _keydownInput(which) {\n if (which === 13 && this._picker.get(\"aria-hidden\") === \"true\") {\n // ENTER key should submit form if calendar is hidden\n return true;\n }\n\n if (which === 32) {\n // SPACE key toggles calendar visibility\n if (!this.get(\"readonly\")) {\n this._picker.toggleState(false);\n\n this._picker.invalidateState();\n\n if (this._picker.get(\"aria-hidden\") === \"true\") {\n this._picker.show();\n } else {\n this._picker.hide();\n }\n }\n } else if (which === 27 || which === 9 || which === 13) {\n this._picker.hide(); // ESC, TAB or ENTER keys hide calendar\n\n } else if (which === 8 || which === 46) {\n this.empty().fire(\"change\"); // BACKSPACE, DELETE clear value\n } else if (which === 17) {\n // CONTROL toggles calendar mode\n this._picker.toggleState();\n\n this._picker.invalidateState();\n } else {\n var delta;\n\n if (which === 74 || which === 40) {\n delta = 7;\n } else if (which === 75 || which === 38) {\n delta = -7;\n } else if (which === 76 || which === 39) {\n delta = 1;\n } else if (which === 72 || which === 37) {\n delta = -1;\n }\n\n if (delta) {\n var currentDate = this.get(\"valueAsDate\") || new Date();\n var expanded = this._picker.get(\"aria-expanded\") === \"true\";\n\n if (expanded && (which === 40 || which === 38)) {\n currentDate.setMonth(currentDate.getMonth() + (delta > 0 ? 4 : -4));\n } else if (expanded && (which === 37 || which === 39)) {\n currentDate.setMonth(currentDate.getMonth() + (delta > 0 ? 1 : -1));\n } else {\n currentDate.setDate(currentDate.getDate() + delta);\n }\n\n this.value(formatLocalDate(currentDate)).fire(\"change\");\n }\n } // prevent default action except if it was TAB so\n // do not allow to change the value manually\n\n\n return which === 9;\n },\n _blurInput: function _blurInput() {\n this._picker.hide();\n },\n _focusInput: function _focusInput() {\n if (this.get(\"readonly\")) return false;\n var offset = this.offset();\n\n var pickerOffset = this._picker.offset();\n\n var marginTop = offset.height; // #3: move calendar to the top when passing cross browser window bounds\n\n if (HTML.get(\"clientHeight\") < offset.bottom + pickerOffset.height) {\n marginTop = -pickerOffset.height;\n } // always reset picker mode to the default\n\n\n this._picker.toggleState(false);\n\n this._picker.invalidateState(); // always recalculate picker top position\n\n\n this._picker.css(\"margin-top\", marginTop).show();\n }\n });\n DOM.importStyles(MAIN_CSS);\n})();\n(function () {\n \"use strict\";\n\n /* globals html:false */\n var PICKER_CSS = \"body{overflow:hidden}*{font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;line-height:2.5rem;text-align:center;cursor:default;-webkit-user-select:none;-ms-user-select:none;user-select:none;margin:0}a{position:absolute;width:3rem;height:2.5rem}a[rel=prev]{left:0}a[rel=next]{right:0}b{display:block;cursor:pointer}table{width:100%;table-layout:fixed;border-spacing:0;border-collapse:collapse;text-align:center;line-height:2.5rem}table+table{position:absolute;top:2.5rem;left:0;opacity:1;transition:.1s ease-out;background:#fff}table+table td{line-height:3.75rem}table+table[aria-hidden=true]{visibility:hidden!important;opacity:0}td,th{padding:0}thead{background:#ddd;font-size:smaller;font-weight:700}[aria-selected=false],[aria-disabled=true]{color:#888}[aria-selected=true]{box-shadow:inset 0 0 0 1px #888}a:hover,td:hover,[aria-disabled=true],[aria-selected=true]{background-color:#f5f5f5}\";\n var HTML = DOM.find(\"html\");\n var DEFAULT_LANGUAGE = HTML.get(\"lang\") || void 0;\n var CLICK_EVENT_TYPE = \"orientation\" in window ? \"touchend\" : \"mousedown\";\n var SHADOW_DOM_SUPPORTED = !!HTMLElement.prototype.attachShadow;\n\n var INTL_SUPPORTED = function () {\n try {\n new Date().toLocaleString(\"_\");\n } catch (err) {\n return err instanceof RangeError;\n }\n\n return false;\n }();\n\n function repeat(times, fn) {\n if (typeof fn === \"string\") {\n return Array(times + 1).join(fn);\n } else {\n return Array.apply(null, Array(times)).map(fn).join(\"\");\n }\n }\n\n function ampm(pos, neg) {\n return DEFAULT_LANGUAGE === \"en-US\" ? pos : neg;\n }\n\n function localeWeekday(index) {\n var date = new Date();\n date.setDate(date.getDate() - date.getDay() + index + ampm(0, 1));\n /* istanbul ignore else */\n\n if (INTL_SUPPORTED) {\n try {\n return date.toLocaleDateString(DEFAULT_LANGUAGE, {\n weekday: \"short\"\n });\n } catch (err) {}\n }\n\n return date.toUTCString().split(\",\")[0].slice(0, 2);\n }\n\n function localeMonth(index) {\n var date = new Date(25e8 * (index + 1));\n /* istanbul ignore else */\n\n if (INTL_SUPPORTED) {\n try {\n return date.toLocaleDateString(DEFAULT_LANGUAGE, {\n month: \"short\"\n });\n } catch (err) {}\n }\n\n return date.toUTCString().split(\" \")[2];\n }\n\n function localeMonthYear(dateValue) {\n // set hours to '12' to fix Safari bug in Date#toLocaleString\n var date = new Date(dateValue.getFullYear(), dateValue.getMonth(), 12);\n /* istanbul ignore else */\n\n if (INTL_SUPPORTED) {\n try {\n return date.toLocaleDateString(DEFAULT_LANGUAGE, {\n month: \"long\",\n year: \"numeric\"\n });\n } catch (err) {}\n }\n\n return date.toUTCString().split(\" \").slice(2, 4).join(\" \");\n }\n\n var PICKER_BODY_HTML = \"
\" + repeat(7, function (_, i) {\n return \"
\" + localeWeekday(i);\n }) + \"
\" + repeat(7, \"
\" + repeat(7, \"
\") + \"
\") + \"
\" + repeat(3, function (_, i) {\n return \"
\" + repeat(4, function (_, j) {\n return \"
\" + localeMonth(i * 4 + j);\n });\n }) + \"
\";\n DOM.extend(\"dateinput-picker\", {\n constructor: function constructor() {\n var _this = this;\n\n if (SHADOW_DOM_SUPPORTED) {\n var shadowRoot = this[0].attachShadow({\n mode: \"closed\"\n }); // use set timeout to make sure _parentInput is set\n\n setTimeout(function () {\n _this._initContent(DOM.constructor(shadowRoot));\n }, 0);\n } else {\n var IE = \"ScriptEngineMajorVersion\" in window;\n var object = DOM.create(\"