\");\n\n this._addClass(axis, \"ui-resizable-handle \" + hname);\n\n axis.css({\n zIndex: o.zIndex\n });\n this.handles[handle] = \".ui-resizable-\" + handle;\n this.element.append(axis);\n }\n }\n\n this._renderAxis = function (target) {\n var i, axis, padPos, padWrapper;\n target = target || this.element;\n\n for (i in this.handles) {\n if (this.handles[i].constructor === String) {\n this.handles[i] = this.element.children(this.handles[i]).first().show();\n } else if (this.handles[i].jquery || this.handles[i].nodeType) {\n this.handles[i] = $(this.handles[i]);\n\n this._on(this.handles[i], {\n \"mousedown\": that._mouseDown\n });\n }\n\n if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)) {\n axis = $(this.handles[i], this.element);\n padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();\n padPos = [\"padding\", /ne|nw|n/.test(i) ? \"Top\" : /se|sw|s/.test(i) ? \"Bottom\" : /^e$/.test(i) ? \"Right\" : \"Left\"].join(\"\");\n target.css(padPos, padWrapper);\n\n this._proportionallyResize();\n }\n\n this._handles = this._handles.add(this.handles[i]);\n }\n }; // TODO: make renderAxis a prototype function\n\n\n this._renderAxis(this.element);\n\n this._handles = this._handles.add(this.element.find(\".ui-resizable-handle\"));\n\n this._handles.disableSelection();\n\n this._handles.on(\"mouseover\", function () {\n if (!that.resizing) {\n if (this.className) {\n axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);\n }\n\n that.axis = axis && axis[1] ? axis[1] : \"se\";\n }\n });\n\n if (o.autoHide) {\n this._handles.hide();\n\n this._addClass(\"ui-resizable-autohide\");\n }\n },\n _removeHandles: function _removeHandles() {\n this._handles.remove();\n },\n _mouseCapture: function _mouseCapture(event) {\n var i,\n handle,\n capture = false;\n\n for (i in this.handles) {\n handle = $(this.handles[i])[0];\n\n if (handle === event.target || $.contains(handle, event.target)) {\n capture = true;\n }\n }\n\n return !this.options.disabled && capture;\n },\n _mouseStart: function _mouseStart(event) {\n var curleft,\n curtop,\n cursor,\n o = this.options,\n el = this.element;\n this.resizing = true;\n\n this._renderProxy();\n\n curleft = this._num(this.helper.css(\"left\"));\n curtop = this._num(this.helper.css(\"top\"));\n\n if (o.containment) {\n curleft += $(o.containment).scrollLeft() || 0;\n curtop += $(o.containment).scrollTop() || 0;\n }\n\n this.offset = this.helper.offset();\n this.position = {\n left: curleft,\n top: curtop\n };\n this.size = this._helper ? {\n width: this.helper.width(),\n height: this.helper.height()\n } : {\n width: el.width(),\n height: el.height()\n };\n this.originalSize = this._helper ? {\n width: el.outerWidth(),\n height: el.outerHeight()\n } : {\n width: el.width(),\n height: el.height()\n };\n this.sizeDiff = {\n width: el.outerWidth() - el.width(),\n height: el.outerHeight() - el.height()\n };\n this.originalPosition = {\n left: curleft,\n top: curtop\n };\n this.originalMousePosition = {\n left: event.pageX,\n top: event.pageY\n };\n this.aspectRatio = typeof o.aspectRatio === \"number\" ? o.aspectRatio : this.originalSize.width / this.originalSize.height || 1;\n cursor = $(\".ui-resizable-\" + this.axis).css(\"cursor\");\n $(\"body\").css(\"cursor\", cursor === \"auto\" ? this.axis + \"-resize\" : cursor);\n\n this._addClass(\"ui-resizable-resizing\");\n\n this._propagate(\"start\", event);\n\n return true;\n },\n _mouseDrag: function _mouseDrag(event) {\n var data,\n props,\n smp = this.originalMousePosition,\n a = this.axis,\n dx = event.pageX - smp.left || 0,\n dy = event.pageY - smp.top || 0,\n trigger = this._change[a];\n\n this._updatePrevProperties();\n\n if (!trigger) {\n return false;\n }\n\n data = trigger.apply(this, [event, dx, dy]);\n\n this._updateVirtualBoundaries(event.shiftKey);\n\n if (this._aspectRatio || event.shiftKey) {\n data = this._updateRatio(data, event);\n }\n\n data = this._respectSize(data, event);\n\n this._updateCache(data);\n\n this._propagate(\"resize\", event);\n\n props = this._applyChanges();\n\n if (!this._helper && this._proportionallyResizeElements.length) {\n this._proportionallyResize();\n }\n\n if (!$.isEmptyObject(props)) {\n this._updatePrevProperties();\n\n this._trigger(\"resize\", event, this.ui());\n\n this._applyChanges();\n }\n\n return false;\n },\n _mouseStop: function _mouseStop(event) {\n this.resizing = false;\n var pr,\n ista,\n soffseth,\n soffsetw,\n s,\n left,\n top,\n o = this.options,\n that = this;\n\n if (this._helper) {\n pr = this._proportionallyResizeElements;\n ista = pr.length && /textarea/i.test(pr[0].nodeName);\n soffseth = ista && this._hasScroll(pr[0], \"left\") ? 0 : that.sizeDiff.height;\n soffsetw = ista ? 0 : that.sizeDiff.width;\n s = {\n width: that.helper.width() - soffsetw,\n height: that.helper.height() - soffseth\n };\n left = parseFloat(that.element.css(\"left\")) + (that.position.left - that.originalPosition.left) || null;\n top = parseFloat(that.element.css(\"top\")) + (that.position.top - that.originalPosition.top) || null;\n\n if (!o.animate) {\n this.element.css($.extend(s, {\n top: top,\n left: left\n }));\n }\n\n that.helper.height(that.size.height);\n that.helper.width(that.size.width);\n\n if (this._helper && !o.animate) {\n this._proportionallyResize();\n }\n }\n\n $(\"body\").css(\"cursor\", \"auto\");\n\n this._removeClass(\"ui-resizable-resizing\");\n\n this._propagate(\"stop\", event);\n\n if (this._helper) {\n this.helper.remove();\n }\n\n return false;\n },\n _updatePrevProperties: function _updatePrevProperties() {\n this.prevPosition = {\n top: this.position.top,\n left: this.position.left\n };\n this.prevSize = {\n width: this.size.width,\n height: this.size.height\n };\n },\n _applyChanges: function _applyChanges() {\n var props = {};\n\n if (this.position.top !== this.prevPosition.top) {\n props.top = this.position.top + \"px\";\n }\n\n if (this.position.left !== this.prevPosition.left) {\n props.left = this.position.left + \"px\";\n }\n\n if (this.size.width !== this.prevSize.width) {\n props.width = this.size.width + \"px\";\n }\n\n if (this.size.height !== this.prevSize.height) {\n props.height = this.size.height + \"px\";\n }\n\n this.helper.css(props);\n return props;\n },\n _updateVirtualBoundaries: function _updateVirtualBoundaries(forceAspectRatio) {\n var pMinWidth,\n pMaxWidth,\n pMinHeight,\n pMaxHeight,\n b,\n o = this.options;\n b = {\n minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,\n maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,\n minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,\n maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity\n };\n\n if (this._aspectRatio || forceAspectRatio) {\n pMinWidth = b.minHeight * this.aspectRatio;\n pMinHeight = b.minWidth / this.aspectRatio;\n pMaxWidth = b.maxHeight * this.aspectRatio;\n pMaxHeight = b.maxWidth / this.aspectRatio;\n\n if (pMinWidth > b.minWidth) {\n b.minWidth = pMinWidth;\n }\n\n if (pMinHeight > b.minHeight) {\n b.minHeight = pMinHeight;\n }\n\n if (pMaxWidth < b.maxWidth) {\n b.maxWidth = pMaxWidth;\n }\n\n if (pMaxHeight < b.maxHeight) {\n b.maxHeight = pMaxHeight;\n }\n }\n\n this._vBoundaries = b;\n },\n _updateCache: function _updateCache(data) {\n this.offset = this.helper.offset();\n\n if (this._isNumber(data.left)) {\n this.position.left = data.left;\n }\n\n if (this._isNumber(data.top)) {\n this.position.top = data.top;\n }\n\n if (this._isNumber(data.height)) {\n this.size.height = data.height;\n }\n\n if (this._isNumber(data.width)) {\n this.size.width = data.width;\n }\n },\n _updateRatio: function _updateRatio(data) {\n var cpos = this.position,\n csize = this.size,\n a = this.axis;\n\n if (this._isNumber(data.height)) {\n data.width = data.height * this.aspectRatio;\n } else if (this._isNumber(data.width)) {\n data.height = data.width / this.aspectRatio;\n }\n\n if (a === \"sw\") {\n data.left = cpos.left + (csize.width - data.width);\n data.top = null;\n }\n\n if (a === \"nw\") {\n data.top = cpos.top + (csize.height - data.height);\n data.left = cpos.left + (csize.width - data.width);\n }\n\n return data;\n },\n _respectSize: function _respectSize(data) {\n var o = this._vBoundaries,\n a = this.axis,\n ismaxw = this._isNumber(data.width) && o.maxWidth && o.maxWidth < data.width,\n ismaxh = this._isNumber(data.height) && o.maxHeight && o.maxHeight < data.height,\n isminw = this._isNumber(data.width) && o.minWidth && o.minWidth > data.width,\n isminh = this._isNumber(data.height) && o.minHeight && o.minHeight > data.height,\n dw = this.originalPosition.left + this.originalSize.width,\n dh = this.originalPosition.top + this.originalSize.height,\n cw = /sw|nw|w/.test(a),\n ch = /nw|ne|n/.test(a);\n\n if (isminw) {\n data.width = o.minWidth;\n }\n\n if (isminh) {\n data.height = o.minHeight;\n }\n\n if (ismaxw) {\n data.width = o.maxWidth;\n }\n\n if (ismaxh) {\n data.height = o.maxHeight;\n }\n\n if (isminw && cw) {\n data.left = dw - o.minWidth;\n }\n\n if (ismaxw && cw) {\n data.left = dw - o.maxWidth;\n }\n\n if (isminh && ch) {\n data.top = dh - o.minHeight;\n }\n\n if (ismaxh && ch) {\n data.top = dh - o.maxHeight;\n } // Fixing jump error on top/left - bug #2330\n\n\n if (!data.width && !data.height && !data.left && data.top) {\n data.top = null;\n } else if (!data.width && !data.height && !data.top && data.left) {\n data.left = null;\n }\n\n return data;\n },\n _getPaddingPlusBorderDimensions: function _getPaddingPlusBorderDimensions(element) {\n var i = 0,\n widths = [],\n borders = [element.css(\"borderTopWidth\"), element.css(\"borderRightWidth\"), element.css(\"borderBottomWidth\"), element.css(\"borderLeftWidth\")],\n paddings = [element.css(\"paddingTop\"), element.css(\"paddingRight\"), element.css(\"paddingBottom\"), element.css(\"paddingLeft\")];\n\n for (; i < 4; i++) {\n widths[i] = parseFloat(borders[i]) || 0;\n widths[i] += parseFloat(paddings[i]) || 0;\n }\n\n return {\n height: widths[0] + widths[2],\n width: widths[1] + widths[3]\n };\n },\n _proportionallyResize: function _proportionallyResize() {\n if (!this._proportionallyResizeElements.length) {\n return;\n }\n\n var prel,\n i = 0,\n element = this.helper || this.element;\n\n for (; i < this._proportionallyResizeElements.length; i++) {\n prel = this._proportionallyResizeElements[i]; // TODO: Seems like a bug to cache this.outerDimensions\n // considering that we are in a loop.\n\n if (!this.outerDimensions) {\n this.outerDimensions = this._getPaddingPlusBorderDimensions(prel);\n }\n\n prel.css({\n height: element.height() - this.outerDimensions.height || 0,\n width: element.width() - this.outerDimensions.width || 0\n });\n }\n },\n _renderProxy: function _renderProxy() {\n var el = this.element,\n o = this.options;\n this.elementOffset = el.offset();\n\n if (this._helper) {\n this.helper = this.helper || $(\"
\");\n\n this._addClass(this.helper, this._helper);\n\n this.helper.css({\n width: this.element.outerWidth(),\n height: this.element.outerHeight(),\n position: \"absolute\",\n left: this.elementOffset.left + \"px\",\n top: this.elementOffset.top + \"px\",\n zIndex: ++o.zIndex //TODO: Don't modify option\n\n });\n this.helper.appendTo(\"body\").disableSelection();\n } else {\n this.helper = this.element;\n }\n },\n _change: {\n e: function e(event, dx) {\n return {\n width: this.originalSize.width + dx\n };\n },\n w: function w(event, dx) {\n var cs = this.originalSize,\n sp = this.originalPosition;\n return {\n left: sp.left + dx,\n width: cs.width - dx\n };\n },\n n: function n(event, dx, dy) {\n var cs = this.originalSize,\n sp = this.originalPosition;\n return {\n top: sp.top + dy,\n height: cs.height - dy\n };\n },\n s: function s(event, dx, dy) {\n return {\n height: this.originalSize.height + dy\n };\n },\n se: function se(event, dx, dy) {\n return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));\n },\n sw: function sw(event, dx, dy) {\n return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));\n },\n ne: function ne(event, dx, dy) {\n return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));\n },\n nw: function nw(event, dx, dy) {\n return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));\n }\n },\n _propagate: function _propagate(n, event) {\n $.ui.plugin.call(this, n, [event, this.ui()]);\n n !== \"resize\" && this._trigger(n, event, this.ui());\n },\n plugins: {},\n ui: function ui() {\n return {\n originalElement: this.originalElement,\n element: this.element,\n helper: this.helper,\n position: this.position,\n size: this.size,\n originalSize: this.originalSize,\n originalPosition: this.originalPosition\n };\n }\n });\n /*\n * Resizable Extensions\n */\n\n $.ui.plugin.add(\"resizable\", \"animate\", {\n stop: function stop(event) {\n var that = $(this).resizable(\"instance\"),\n o = that.options,\n pr = that._proportionallyResizeElements,\n ista = pr.length && /textarea/i.test(pr[0].nodeName),\n soffseth = ista && that._hasScroll(pr[0], \"left\") ? 0 : that.sizeDiff.height,\n soffsetw = ista ? 0 : that.sizeDiff.width,\n style = {\n width: that.size.width - soffsetw,\n height: that.size.height - soffseth\n },\n left = parseFloat(that.element.css(\"left\")) + (that.position.left - that.originalPosition.left) || null,\n top = parseFloat(that.element.css(\"top\")) + (that.position.top - that.originalPosition.top) || null;\n that.element.animate($.extend(style, top && left ? {\n top: top,\n left: left\n } : {}), {\n duration: o.animateDuration,\n easing: o.animateEasing,\n step: function step() {\n var data = {\n width: parseFloat(that.element.css(\"width\")),\n height: parseFloat(that.element.css(\"height\")),\n top: parseFloat(that.element.css(\"top\")),\n left: parseFloat(that.element.css(\"left\"))\n };\n\n if (pr && pr.length) {\n $(pr[0]).css({\n width: data.width,\n height: data.height\n });\n } // Propagating resize, and updating values for each animation step\n\n\n that._updateCache(data);\n\n that._propagate(\"resize\", event);\n }\n });\n }\n });\n $.ui.plugin.add(\"resizable\", \"containment\", {\n start: function start() {\n var element,\n p,\n co,\n ch,\n cw,\n width,\n height,\n that = $(this).resizable(\"instance\"),\n o = that.options,\n el = that.element,\n oc = o.containment,\n ce = oc instanceof $ ? oc.get(0) : /parent/.test(oc) ? el.parent().get(0) : oc;\n\n if (!ce) {\n return;\n }\n\n that.containerElement = $(ce);\n\n if (/document/.test(oc) || oc === document) {\n that.containerOffset = {\n left: 0,\n top: 0\n };\n that.containerPosition = {\n left: 0,\n top: 0\n };\n that.parentData = {\n element: $(document),\n left: 0,\n top: 0,\n width: $(document).width(),\n height: $(document).height() || document.body.parentNode.scrollHeight\n };\n } else {\n element = $(ce);\n p = [];\n $([\"Top\", \"Right\", \"Left\", \"Bottom\"]).each(function (i, name) {\n p[i] = that._num(element.css(\"padding\" + name));\n });\n that.containerOffset = element.offset();\n that.containerPosition = element.position();\n that.containerSize = {\n height: element.innerHeight() - p[3],\n width: element.innerWidth() - p[1]\n };\n co = that.containerOffset;\n ch = that.containerSize.height;\n cw = that.containerSize.width;\n width = that._hasScroll(ce, \"left\") ? ce.scrollWidth : cw;\n height = that._hasScroll(ce) ? ce.scrollHeight : ch;\n that.parentData = {\n element: ce,\n left: co.left,\n top: co.top,\n width: width,\n height: height\n };\n }\n },\n resize: function resize(event) {\n var woset,\n hoset,\n isParent,\n isOffsetRelative,\n that = $(this).resizable(\"instance\"),\n o = that.options,\n co = that.containerOffset,\n cp = that.position,\n pRatio = that._aspectRatio || event.shiftKey,\n cop = {\n top: 0,\n left: 0\n },\n ce = that.containerElement,\n continueResize = true;\n\n if (ce[0] !== document && /static/.test(ce.css(\"position\"))) {\n cop = co;\n }\n\n if (cp.left < (that._helper ? co.left : 0)) {\n that.size.width = that.size.width + (that._helper ? that.position.left - co.left : that.position.left - cop.left);\n\n if (pRatio) {\n that.size.height = that.size.width / that.aspectRatio;\n continueResize = false;\n }\n\n that.position.left = o.helper ? co.left : 0;\n }\n\n if (cp.top < (that._helper ? co.top : 0)) {\n that.size.height = that.size.height + (that._helper ? that.position.top - co.top : that.position.top);\n\n if (pRatio) {\n that.size.width = that.size.height * that.aspectRatio;\n continueResize = false;\n }\n\n that.position.top = that._helper ? co.top : 0;\n }\n\n isParent = that.containerElement.get(0) === that.element.parent().get(0);\n isOffsetRelative = /relative|absolute/.test(that.containerElement.css(\"position\"));\n\n if (isParent && isOffsetRelative) {\n that.offset.left = that.parentData.left + that.position.left;\n that.offset.top = that.parentData.top + that.position.top;\n } else {\n that.offset.left = that.element.offset().left;\n that.offset.top = that.element.offset().top;\n }\n\n woset = Math.abs(that.sizeDiff.width + (that._helper ? that.offset.left - cop.left : that.offset.left - co.left));\n hoset = Math.abs(that.sizeDiff.height + (that._helper ? that.offset.top - cop.top : that.offset.top - co.top));\n\n if (woset + that.size.width >= that.parentData.width) {\n that.size.width = that.parentData.width - woset;\n\n if (pRatio) {\n that.size.height = that.size.width / that.aspectRatio;\n continueResize = false;\n }\n }\n\n if (hoset + that.size.height >= that.parentData.height) {\n that.size.height = that.parentData.height - hoset;\n\n if (pRatio) {\n that.size.width = that.size.height * that.aspectRatio;\n continueResize = false;\n }\n }\n\n if (!continueResize) {\n that.position.left = that.prevPosition.left;\n that.position.top = that.prevPosition.top;\n that.size.width = that.prevSize.width;\n that.size.height = that.prevSize.height;\n }\n },\n stop: function stop() {\n var that = $(this).resizable(\"instance\"),\n o = that.options,\n co = that.containerOffset,\n cop = that.containerPosition,\n ce = that.containerElement,\n helper = $(that.helper),\n ho = helper.offset(),\n w = helper.outerWidth() - that.sizeDiff.width,\n h = helper.outerHeight() - that.sizeDiff.height;\n\n if (that._helper && !o.animate && /relative/.test(ce.css(\"position\"))) {\n $(this).css({\n left: ho.left - cop.left - co.left,\n width: w,\n height: h\n });\n }\n\n if (that._helper && !o.animate && /static/.test(ce.css(\"position\"))) {\n $(this).css({\n left: ho.left - cop.left - co.left,\n width: w,\n height: h\n });\n }\n }\n });\n $.ui.plugin.add(\"resizable\", \"alsoResize\", {\n start: function start() {\n var that = $(this).resizable(\"instance\"),\n o = that.options;\n $(o.alsoResize).each(function () {\n var el = $(this);\n el.data(\"ui-resizable-alsoresize\", {\n width: parseFloat(el.width()),\n height: parseFloat(el.height()),\n left: parseFloat(el.css(\"left\")),\n top: parseFloat(el.css(\"top\"))\n });\n });\n },\n resize: function resize(event, ui) {\n var that = $(this).resizable(\"instance\"),\n o = that.options,\n os = that.originalSize,\n op = that.originalPosition,\n delta = {\n height: that.size.height - os.height || 0,\n width: that.size.width - os.width || 0,\n top: that.position.top - op.top || 0,\n left: that.position.left - op.left || 0\n };\n $(o.alsoResize).each(function () {\n var el = $(this),\n start = $(this).data(\"ui-resizable-alsoresize\"),\n style = {},\n css = el.parents(ui.originalElement[0]).length ? [\"width\", \"height\"] : [\"width\", \"height\", \"top\", \"left\"];\n $.each(css, function (i, prop) {\n var sum = (start[prop] || 0) + (delta[prop] || 0);\n\n if (sum && sum >= 0) {\n style[prop] = sum || null;\n }\n });\n el.css(style);\n });\n },\n stop: function stop() {\n $(this).removeData(\"ui-resizable-alsoresize\");\n }\n });\n $.ui.plugin.add(\"resizable\", \"ghost\", {\n start: function start() {\n var that = $(this).resizable(\"instance\"),\n cs = that.size;\n that.ghost = that.originalElement.clone();\n that.ghost.css({\n opacity: 0.25,\n display: \"block\",\n position: \"relative\",\n height: cs.height,\n width: cs.width,\n margin: 0,\n left: 0,\n top: 0\n });\n\n that._addClass(that.ghost, \"ui-resizable-ghost\"); // DEPRECATED\n // TODO: remove after 1.12\n\n\n if ($.uiBackCompat !== false && typeof that.options.ghost === \"string\") {\n // Ghost option\n that.ghost.addClass(this.options.ghost);\n }\n\n that.ghost.appendTo(that.helper);\n },\n resize: function resize() {\n var that = $(this).resizable(\"instance\");\n\n if (that.ghost) {\n that.ghost.css({\n position: \"relative\",\n height: that.size.height,\n width: that.size.width\n });\n }\n },\n stop: function stop() {\n var that = $(this).resizable(\"instance\");\n\n if (that.ghost && that.helper) {\n that.helper.get(0).removeChild(that.ghost.get(0));\n }\n }\n });\n $.ui.plugin.add(\"resizable\", \"grid\", {\n resize: function resize() {\n var outerDimensions,\n that = $(this).resizable(\"instance\"),\n o = that.options,\n cs = that.size,\n os = that.originalSize,\n op = that.originalPosition,\n a = that.axis,\n grid = typeof o.grid === \"number\" ? [o.grid, o.grid] : o.grid,\n gridX = grid[0] || 1,\n gridY = grid[1] || 1,\n ox = Math.round((cs.width - os.width) / gridX) * gridX,\n oy = Math.round((cs.height - os.height) / gridY) * gridY,\n newWidth = os.width + ox,\n newHeight = os.height + oy,\n isMaxWidth = o.maxWidth && o.maxWidth < newWidth,\n isMaxHeight = o.maxHeight && o.maxHeight < newHeight,\n isMinWidth = o.minWidth && o.minWidth > newWidth,\n isMinHeight = o.minHeight && o.minHeight > newHeight;\n o.grid = grid;\n\n if (isMinWidth) {\n newWidth += gridX;\n }\n\n if (isMinHeight) {\n newHeight += gridY;\n }\n\n if (isMaxWidth) {\n newWidth -= gridX;\n }\n\n if (isMaxHeight) {\n newHeight -= gridY;\n }\n\n if (/^(se|s|e)$/.test(a)) {\n that.size.width = newWidth;\n that.size.height = newHeight;\n } else if (/^(ne)$/.test(a)) {\n that.size.width = newWidth;\n that.size.height = newHeight;\n that.position.top = op.top - oy;\n } else if (/^(sw)$/.test(a)) {\n that.size.width = newWidth;\n that.size.height = newHeight;\n that.position.left = op.left - ox;\n } else {\n if (newHeight - gridY <= 0 || newWidth - gridX <= 0) {\n outerDimensions = that._getPaddingPlusBorderDimensions(this);\n }\n\n if (newHeight - gridY > 0) {\n that.size.height = newHeight;\n that.position.top = op.top - oy;\n } else {\n newHeight = gridY - outerDimensions.height;\n that.size.height = newHeight;\n that.position.top = op.top + os.height - newHeight;\n }\n\n if (newWidth - gridX > 0) {\n that.size.width = newWidth;\n that.position.left = op.left - ox;\n } else {\n newWidth = gridX - outerDimensions.width;\n that.size.width = newWidth;\n that.position.left = op.left + os.width - newWidth;\n }\n }\n }\n });\n return $.ui.resizable;\n});","/*!\n * jQuery UI Disable Selection 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n//>>label: disableSelection\n//>>group: Core\n//>>description: Disable selection of text content within the set of matched elements.\n//>>docs: http://api.jqueryui.com/disableSelection/\n// This file is deprecated\n(function (factory) {\n if (typeof define === \"function\" && define.amd) {\n // AMD. Register as an anonymous module.\n define([\"jquery\", \"./version\"], factory);\n } else {\n // Browser globals\n factory(jQuery);\n }\n})(function ($) {\n return $.fn.extend({\n disableSelection: function () {\n var eventType = \"onselectstart\" in document.createElement(\"div\") ? \"selectstart\" : \"mousedown\";\n return function () {\n return this.on(eventType + \".ui-disableSelection\", function (event) {\n event.preventDefault();\n });\n };\n }(),\n enableSelection: function enableSelection() {\n return this.off(\".ui-disableSelection\");\n }\n });\n});","/*!\n * jQuery UI Sortable 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n//>>label: Sortable\n//>>group: Interactions\n//>>description: Enables items in a list to be sorted using the mouse.\n//>>docs: http://api.jqueryui.com/sortable/\n//>>demos: http://jqueryui.com/sortable/\n//>>css.structure: ../../themes/base/sortable.css\n(function (factory) {\n if (typeof define === \"function\" && define.amd) {\n // AMD. Register as an anonymous module.\n define([\"jquery\", \"./mouse\", \"../data\", \"../ie\", \"../scroll-parent\", \"../version\", \"../widget\"], factory);\n } else {\n // Browser globals\n factory(jQuery);\n }\n})(function ($) {\n return $.widget(\"ui.sortable\", $.ui.mouse, {\n version: \"1.12.1\",\n widgetEventPrefix: \"sort\",\n ready: false,\n options: {\n appendTo: \"parent\",\n axis: false,\n connectWith: false,\n containment: false,\n cursor: \"auto\",\n cursorAt: false,\n dropOnEmpty: true,\n forcePlaceholderSize: false,\n forceHelperSize: false,\n grid: false,\n handle: false,\n helper: \"original\",\n items: \"> *\",\n opacity: false,\n placeholder: false,\n revert: false,\n scroll: true,\n scrollSensitivity: 20,\n scrollSpeed: 20,\n scope: \"default\",\n tolerance: \"intersect\",\n zIndex: 1000,\n // Callbacks\n activate: null,\n beforeStop: null,\n change: null,\n deactivate: null,\n out: null,\n over: null,\n receive: null,\n remove: null,\n sort: null,\n start: null,\n stop: null,\n update: null\n },\n _isOverAxis: function _isOverAxis(x, reference, size) {\n return x >= reference && x < reference + size;\n },\n _isFloating: function _isFloating(item) {\n return /left|right/.test(item.css(\"float\")) || /inline|table-cell/.test(item.css(\"display\"));\n },\n _create: function _create() {\n this.containerCache = {};\n\n this._addClass(\"ui-sortable\"); //Get the items\n\n\n this.refresh(); //Let's determine the parent's offset\n\n this.offset = this.element.offset(); //Initialize mouse events for interaction\n\n this._mouseInit();\n\n this._setHandleClassName(); //We're ready to go\n\n\n this.ready = true;\n },\n _setOption: function _setOption(key, value) {\n this._super(key, value);\n\n if (key === \"handle\") {\n this._setHandleClassName();\n }\n },\n _setHandleClassName: function _setHandleClassName() {\n var that = this;\n\n this._removeClass(this.element.find(\".ui-sortable-handle\"), \"ui-sortable-handle\");\n\n $.each(this.items, function () {\n that._addClass(this.instance.options.handle ? this.item.find(this.instance.options.handle) : this.item, \"ui-sortable-handle\");\n });\n },\n _destroy: function _destroy() {\n this._mouseDestroy();\n\n for (var i = this.items.length - 1; i >= 0; i--) {\n this.items[i].item.removeData(this.widgetName + \"-item\");\n }\n\n return this;\n },\n _mouseCapture: function _mouseCapture(event, overrideHandle) {\n var currentItem = null,\n validHandle = false,\n that = this;\n\n if (this.reverting) {\n return false;\n }\n\n if (this.options.disabled || this.options.type === \"static\") {\n return false;\n } //We have to refresh the items data once first\n\n\n this._refreshItems(event); //Find out if the clicked node (or one of its parents) is a actual item in this.items\n\n\n $(event.target).parents().each(function () {\n if ($.data(this, that.widgetName + \"-item\") === that) {\n currentItem = $(this);\n return false;\n }\n });\n\n if ($.data(event.target, that.widgetName + \"-item\") === that) {\n currentItem = $(event.target);\n }\n\n if (!currentItem) {\n return false;\n }\n\n if (this.options.handle && !overrideHandle) {\n $(this.options.handle, currentItem).find(\"*\").addBack().each(function () {\n if (this === event.target) {\n validHandle = true;\n }\n });\n\n if (!validHandle) {\n return false;\n }\n }\n\n this.currentItem = currentItem;\n\n this._removeCurrentsFromItems();\n\n return true;\n },\n _mouseStart: function _mouseStart(event, overrideHandle, noActivation) {\n var i,\n body,\n o = this.options;\n this.currentContainer = this; //We only need to call refreshPositions, because the refreshItems call has been moved to\n // mouseCapture\n\n this.refreshPositions(); //Create and append the visible helper\n\n this.helper = this._createHelper(event); //Cache the helper size\n\n this._cacheHelperProportions();\n /*\n * - Position generation -\n * This block generates everything position related - it's the core of draggables.\n */\n //Cache the margins of the original element\n\n\n this._cacheMargins(); //Get the next scrolling parent\n\n\n this.scrollParent = this.helper.scrollParent(); //The element's absolute position on the page minus margins\n\n this.offset = this.currentItem.offset();\n this.offset = {\n top: this.offset.top - this.margins.top,\n left: this.offset.left - this.margins.left\n };\n $.extend(this.offset, {\n click: {\n //Where the click happened, relative to the element\n left: event.pageX - this.offset.left,\n top: event.pageY - this.offset.top\n },\n parent: this._getParentOffset(),\n // This is a relative to absolute position minus the actual position calculation -\n // only used for relative positioned helper\n relative: this._getRelativeOffset()\n }); // Only after we got the offset, we can change the helper's position to absolute\n // TODO: Still need to figure out a way to make relative sorting possible\n\n this.helper.css(\"position\", \"absolute\");\n this.cssPosition = this.helper.css(\"position\"); //Generate the original position\n\n this.originalPosition = this._generatePosition(event);\n this.originalPageX = event.pageX;\n this.originalPageY = event.pageY; //Adjust the mouse offset relative to the helper if \"cursorAt\" is supplied\n\n o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt); //Cache the former DOM position\n\n this.domPosition = {\n prev: this.currentItem.prev()[0],\n parent: this.currentItem.parent()[0]\n }; // If the helper is not the original, hide the original so it's not playing any role during\n // the drag, won't cause anything bad this way\n\n if (this.helper[0] !== this.currentItem[0]) {\n this.currentItem.hide();\n } //Create the placeholder\n\n\n this._createPlaceholder(); //Set a containment if given in the options\n\n\n if (o.containment) {\n this._setContainment();\n }\n\n if (o.cursor && o.cursor !== \"auto\") {\n // cursor option\n body = this.document.find(\"body\"); // Support: IE\n\n this.storedCursor = body.css(\"cursor\");\n body.css(\"cursor\", o.cursor);\n this.storedStylesheet = $(\"\").appendTo(body);\n }\n\n if (o.opacity) {\n // opacity option\n if (this.helper.css(\"opacity\")) {\n this._storedOpacity = this.helper.css(\"opacity\");\n }\n\n this.helper.css(\"opacity\", o.opacity);\n }\n\n if (o.zIndex) {\n // zIndex option\n if (this.helper.css(\"zIndex\")) {\n this._storedZIndex = this.helper.css(\"zIndex\");\n }\n\n this.helper.css(\"zIndex\", o.zIndex);\n } //Prepare scrolling\n\n\n if (this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== \"HTML\") {\n this.overflowOffset = this.scrollParent.offset();\n } //Call callbacks\n\n\n this._trigger(\"start\", event, this._uiHash()); //Recache the helper size\n\n\n if (!this._preserveHelperProportions) {\n this._cacheHelperProportions();\n } //Post \"activate\" events to possible containers\n\n\n if (!noActivation) {\n for (i = this.containers.length - 1; i >= 0; i--) {\n this.containers[i]._trigger(\"activate\", event, this._uiHash(this));\n }\n } //Prepare possible droppables\n\n\n if ($.ui.ddmanager) {\n $.ui.ddmanager.current = this;\n }\n\n if ($.ui.ddmanager && !o.dropBehaviour) {\n $.ui.ddmanager.prepareOffsets(this, event);\n }\n\n this.dragging = true;\n\n this._addClass(this.helper, \"ui-sortable-helper\"); // Execute the drag once - this causes the helper not to be visiblebefore getting its\n // correct position\n\n\n this._mouseDrag(event);\n\n return true;\n },\n _mouseDrag: function _mouseDrag(event) {\n var i,\n item,\n itemElement,\n intersection,\n o = this.options,\n scrolled = false; //Compute the helpers position\n\n this.position = this._generatePosition(event);\n this.positionAbs = this._convertPositionTo(\"absolute\");\n\n if (!this.lastPositionAbs) {\n this.lastPositionAbs = this.positionAbs;\n } //Do scrolling\n\n\n if (this.options.scroll) {\n if (this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== \"HTML\") {\n if (this.overflowOffset.top + this.scrollParent[0].offsetHeight - event.pageY < o.scrollSensitivity) {\n this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;\n } else if (event.pageY - this.overflowOffset.top < o.scrollSensitivity) {\n this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;\n }\n\n if (this.overflowOffset.left + this.scrollParent[0].offsetWidth - event.pageX < o.scrollSensitivity) {\n this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;\n } else if (event.pageX - this.overflowOffset.left < o.scrollSensitivity) {\n this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;\n }\n } else {\n if (event.pageY - this.document.scrollTop() < o.scrollSensitivity) {\n scrolled = this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed);\n } else if (this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity) {\n scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed);\n }\n\n if (event.pageX - this.document.scrollLeft() < o.scrollSensitivity) {\n scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed);\n } else if (this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) {\n scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed);\n }\n }\n\n if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {\n $.ui.ddmanager.prepareOffsets(this, event);\n }\n } //Regenerate the absolute position used for position checks\n\n\n this.positionAbs = this._convertPositionTo(\"absolute\"); //Set the helper position\n\n if (!this.options.axis || this.options.axis !== \"y\") {\n this.helper[0].style.left = this.position.left + \"px\";\n }\n\n if (!this.options.axis || this.options.axis !== \"x\") {\n this.helper[0].style.top = this.position.top + \"px\";\n } //Rearrange\n\n\n for (i = this.items.length - 1; i >= 0; i--) {\n //Cache variables and intersection, continue if no intersection\n item = this.items[i];\n itemElement = item.item[0];\n intersection = this._intersectsWithPointer(item);\n\n if (!intersection) {\n continue;\n } // Only put the placeholder inside the current Container, skip all\n // items from other containers. This works because when moving\n // an item from one container to another the\n // currentContainer is switched before the placeholder is moved.\n //\n // Without this, moving items in \"sub-sortables\" can cause\n // the placeholder to jitter between the outer and inner container.\n\n\n if (item.instance !== this.currentContainer) {\n continue;\n } // Cannot intersect with itself\n // no useless actions that have been done before\n // no action if the item moved is the parent of the item checked\n\n\n if (itemElement !== this.currentItem[0] && this.placeholder[intersection === 1 ? \"next\" : \"prev\"]()[0] !== itemElement && !$.contains(this.placeholder[0], itemElement) && (this.options.type === \"semi-dynamic\" ? !$.contains(this.element[0], itemElement) : true)) {\n this.direction = intersection === 1 ? \"down\" : \"up\";\n\n if (this.options.tolerance === \"pointer\" || this._intersectsWithSides(item)) {\n this._rearrange(event, item);\n } else {\n break;\n }\n\n this._trigger(\"change\", event, this._uiHash());\n\n break;\n }\n } //Post events to containers\n\n\n this._contactContainers(event); //Interconnect with droppables\n\n\n if ($.ui.ddmanager) {\n $.ui.ddmanager.drag(this, event);\n } //Call callbacks\n\n\n this._trigger(\"sort\", event, this._uiHash());\n\n this.lastPositionAbs = this.positionAbs;\n return false;\n },\n _mouseStop: function _mouseStop(event, noPropagation) {\n if (!event) {\n return;\n } //If we are using droppables, inform the manager about the drop\n\n\n if ($.ui.ddmanager && !this.options.dropBehaviour) {\n $.ui.ddmanager.drop(this, event);\n }\n\n if (this.options.revert) {\n var that = this,\n cur = this.placeholder.offset(),\n axis = this.options.axis,\n animation = {};\n\n if (!axis || axis === \"x\") {\n animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft);\n }\n\n if (!axis || axis === \"y\") {\n animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop);\n }\n\n this.reverting = true;\n $(this.helper).animate(animation, parseInt(this.options.revert, 10) || 500, function () {\n that._clear(event);\n });\n } else {\n this._clear(event, noPropagation);\n }\n\n return false;\n },\n cancel: function cancel() {\n if (this.dragging) {\n this._mouseUp(new $.Event(\"mouseup\", {\n target: null\n }));\n\n if (this.options.helper === \"original\") {\n this.currentItem.css(this._storedCSS);\n\n this._removeClass(this.currentItem, \"ui-sortable-helper\");\n } else {\n this.currentItem.show();\n } //Post deactivating events to containers\n\n\n for (var i = this.containers.length - 1; i >= 0; i--) {\n this.containers[i]._trigger(\"deactivate\", null, this._uiHash(this));\n\n if (this.containers[i].containerCache.over) {\n this.containers[i]._trigger(\"out\", null, this._uiHash(this));\n\n this.containers[i].containerCache.over = 0;\n }\n }\n }\n\n if (this.placeholder) {\n //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,\n // it unbinds ALL events from the original node!\n if (this.placeholder[0].parentNode) {\n this.placeholder[0].parentNode.removeChild(this.placeholder[0]);\n }\n\n if (this.options.helper !== \"original\" && this.helper && this.helper[0].parentNode) {\n this.helper.remove();\n }\n\n $.extend(this, {\n helper: null,\n dragging: false,\n reverting: false,\n _noFinalSort: null\n });\n\n if (this.domPosition.prev) {\n $(this.domPosition.prev).after(this.currentItem);\n } else {\n $(this.domPosition.parent).prepend(this.currentItem);\n }\n }\n\n return this;\n },\n serialize: function serialize(o) {\n var items = this._getItemsAsjQuery(o && o.connected),\n str = [];\n\n o = o || {};\n $(items).each(function () {\n var res = ($(o.item || this).attr(o.attribute || \"id\") || \"\").match(o.expression || /(.+)[\\-=_](.+)/);\n\n if (res) {\n str.push((o.key || res[1] + \"[]\") + \"=\" + (o.key && o.expression ? res[1] : res[2]));\n }\n });\n\n if (!str.length && o.key) {\n str.push(o.key + \"=\");\n }\n\n return str.join(\"&\");\n },\n toArray: function toArray(o) {\n var items = this._getItemsAsjQuery(o && o.connected),\n ret = [];\n\n o = o || {};\n items.each(function () {\n ret.push($(o.item || this).attr(o.attribute || \"id\") || \"\");\n });\n return ret;\n },\n\n /* Be careful with the following core functions */\n _intersectsWith: function _intersectsWith(item) {\n var x1 = this.positionAbs.left,\n x2 = x1 + this.helperProportions.width,\n y1 = this.positionAbs.top,\n y2 = y1 + this.helperProportions.height,\n l = item.left,\n r = l + item.width,\n t = item.top,\n b = t + item.height,\n dyClick = this.offset.click.top,\n dxClick = this.offset.click.left,\n isOverElementHeight = this.options.axis === \"x\" || y1 + dyClick > t && y1 + dyClick < b,\n isOverElementWidth = this.options.axis === \"y\" || x1 + dxClick > l && x1 + dxClick < r,\n isOverElement = isOverElementHeight && isOverElementWidth;\n\n if (this.options.tolerance === \"pointer\" || this.options.forcePointerForContainers || this.options.tolerance !== \"pointer\" && this.helperProportions[this.floating ? \"width\" : \"height\"] > item[this.floating ? \"width\" : \"height\"]) {\n return isOverElement;\n } else {\n return l < x1 + this.helperProportions.width / 2 && // Right Half\n x2 - this.helperProportions.width / 2 < r && // Left Half\n t < y1 + this.helperProportions.height / 2 && // Bottom Half\n y2 - this.helperProportions.height / 2 < b; // Top Half\n }\n },\n _intersectsWithPointer: function _intersectsWithPointer(item) {\n var verticalDirection,\n horizontalDirection,\n isOverElementHeight = this.options.axis === \"x\" || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),\n isOverElementWidth = this.options.axis === \"y\" || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),\n isOverElement = isOverElementHeight && isOverElementWidth;\n\n if (!isOverElement) {\n return false;\n }\n\n verticalDirection = this._getDragVerticalDirection();\n horizontalDirection = this._getDragHorizontalDirection();\n return this.floating ? horizontalDirection === \"right\" || verticalDirection === \"down\" ? 2 : 1 : verticalDirection && (verticalDirection === \"down\" ? 2 : 1);\n },\n _intersectsWithSides: function _intersectsWithSides(item) {\n var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + item.height / 2, item.height),\n isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + item.width / 2, item.width),\n verticalDirection = this._getDragVerticalDirection(),\n horizontalDirection = this._getDragHorizontalDirection();\n\n if (this.floating && horizontalDirection) {\n return horizontalDirection === \"right\" && isOverRightHalf || horizontalDirection === \"left\" && !isOverRightHalf;\n } else {\n return verticalDirection && (verticalDirection === \"down\" && isOverBottomHalf || verticalDirection === \"up\" && !isOverBottomHalf);\n }\n },\n _getDragVerticalDirection: function _getDragVerticalDirection() {\n var delta = this.positionAbs.top - this.lastPositionAbs.top;\n return delta !== 0 && (delta > 0 ? \"down\" : \"up\");\n },\n _getDragHorizontalDirection: function _getDragHorizontalDirection() {\n var delta = this.positionAbs.left - this.lastPositionAbs.left;\n return delta !== 0 && (delta > 0 ? \"right\" : \"left\");\n },\n refresh: function refresh(event) {\n this._refreshItems(event);\n\n this._setHandleClassName();\n\n this.refreshPositions();\n return this;\n },\n _connectWith: function _connectWith() {\n var options = this.options;\n return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;\n },\n _getItemsAsjQuery: function _getItemsAsjQuery(connected) {\n var i,\n j,\n cur,\n inst,\n items = [],\n queries = [],\n connectWith = this._connectWith();\n\n if (connectWith && connected) {\n for (i = connectWith.length - 1; i >= 0; i--) {\n cur = $(connectWith[i], this.document[0]);\n\n for (j = cur.length - 1; j >= 0; j--) {\n inst = $.data(cur[j], this.widgetFullName);\n\n if (inst && inst !== this && !inst.options.disabled) {\n queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(\".ui-sortable-helper\").not(\".ui-sortable-placeholder\"), inst]);\n }\n }\n }\n }\n\n queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, {\n options: this.options,\n item: this.currentItem\n }) : $(this.options.items, this.element).not(\".ui-sortable-helper\").not(\".ui-sortable-placeholder\"), this]);\n\n function addItems() {\n items.push(this);\n }\n\n for (i = queries.length - 1; i >= 0; i--) {\n queries[i][0].each(addItems);\n }\n\n return $(items);\n },\n _removeCurrentsFromItems: function _removeCurrentsFromItems() {\n var list = this.currentItem.find(\":data(\" + this.widgetName + \"-item)\");\n this.items = $.grep(this.items, function (item) {\n for (var j = 0; j < list.length; j++) {\n if (list[j] === item.item[0]) {\n return false;\n }\n }\n\n return true;\n });\n },\n _refreshItems: function _refreshItems(event) {\n this.items = [];\n this.containers = [this];\n\n var i,\n j,\n cur,\n inst,\n targetData,\n _queries,\n item,\n queriesLength,\n items = this.items,\n queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, {\n item: this.currentItem\n }) : $(this.options.items, this.element), this]],\n connectWith = this._connectWith(); //Shouldn't be run the first time through due to massive slow-down\n\n\n if (connectWith && this.ready) {\n for (i = connectWith.length - 1; i >= 0; i--) {\n cur = $(connectWith[i], this.document[0]);\n\n for (j = cur.length - 1; j >= 0; j--) {\n inst = $.data(cur[j], this.widgetFullName);\n\n if (inst && inst !== this && !inst.options.disabled) {\n queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, {\n item: this.currentItem\n }) : $(inst.options.items, inst.element), inst]);\n this.containers.push(inst);\n }\n }\n }\n }\n\n for (i = queries.length - 1; i >= 0; i--) {\n targetData = queries[i][1];\n _queries = queries[i][0];\n\n for (j = 0, queriesLength = _queries.length; j < queriesLength; j++) {\n item = $(_queries[j]); // Data for target checking (mouse manager)\n\n item.data(this.widgetName + \"-item\", targetData);\n items.push({\n item: item,\n instance: targetData,\n width: 0,\n height: 0,\n left: 0,\n top: 0\n });\n }\n }\n },\n refreshPositions: function refreshPositions(fast) {\n // Determine whether items are being displayed horizontally\n this.floating = this.items.length ? this.options.axis === \"x\" || this._isFloating(this.items[0].item) : false; //This has to be redone because due to the item being moved out/into the offsetParent,\n // the offsetParent's position will change\n\n if (this.offsetParent && this.helper) {\n this.offset.parent = this._getParentOffset();\n }\n\n var i, item, t, p;\n\n for (i = this.items.length - 1; i >= 0; i--) {\n item = this.items[i]; //We ignore calculating positions of all connected containers when we're not over them\n\n if (item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {\n continue;\n }\n\n t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;\n\n if (!fast) {\n item.width = t.outerWidth();\n item.height = t.outerHeight();\n }\n\n p = t.offset();\n item.left = p.left;\n item.top = p.top;\n }\n\n if (this.options.custom && this.options.custom.refreshContainers) {\n this.options.custom.refreshContainers.call(this);\n } else {\n for (i = this.containers.length - 1; i >= 0; i--) {\n p = this.containers[i].element.offset();\n this.containers[i].containerCache.left = p.left;\n this.containers[i].containerCache.top = p.top;\n this.containers[i].containerCache.width = this.containers[i].element.outerWidth();\n this.containers[i].containerCache.height = this.containers[i].element.outerHeight();\n }\n }\n\n return this;\n },\n _createPlaceholder: function _createPlaceholder(that) {\n that = that || this;\n var className,\n o = that.options;\n\n if (!o.placeholder || o.placeholder.constructor === String) {\n className = o.placeholder;\n o.placeholder = {\n element: function element() {\n var nodeName = that.currentItem[0].nodeName.toLowerCase(),\n element = $(\"<\" + nodeName + \">\", that.document[0]);\n\n that._addClass(element, \"ui-sortable-placeholder\", className || that.currentItem[0].className)._removeClass(element, \"ui-sortable-helper\");\n\n if (nodeName === \"tbody\") {\n that._createTrPlaceholder(that.currentItem.find(\"tr\").eq(0), $(\"
\", that.document[0]).appendTo(element));\n } else if (nodeName === \"tr\") {\n that._createTrPlaceholder(that.currentItem, element);\n } else if (nodeName === \"img\") {\n element.attr(\"src\", that.currentItem.attr(\"src\"));\n }\n\n if (!className) {\n element.css(\"visibility\", \"hidden\");\n }\n\n return element;\n },\n update: function update(container, p) {\n // 1. If a className is set as 'placeholder option, we don't force sizes -\n // the class is responsible for that\n // 2. The option 'forcePlaceholderSize can be enabled to force it even if a\n // class name is specified\n if (className && !o.forcePlaceholderSize) {\n return;\n } //If the element doesn't have a actual height by itself (without styles coming\n // from a stylesheet), it receives the inline height from the dragged item\n\n\n if (!p.height()) {\n p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css(\"paddingTop\") || 0, 10) - parseInt(that.currentItem.css(\"paddingBottom\") || 0, 10));\n }\n\n if (!p.width()) {\n p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css(\"paddingLeft\") || 0, 10) - parseInt(that.currentItem.css(\"paddingRight\") || 0, 10));\n }\n }\n };\n } //Create the placeholder\n\n\n that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem)); //Append it after the actual current item\n\n that.currentItem.after(that.placeholder); //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)\n\n o.placeholder.update(that, that.placeholder);\n },\n _createTrPlaceholder: function _createTrPlaceholder(sourceTr, targetTr) {\n var that = this;\n sourceTr.children().each(function () {\n $(\" | \", that.document[0]).attr(\"colspan\", $(this).attr(\"colspan\") || 1).appendTo(targetTr);\n });\n },\n _contactContainers: function _contactContainers(event) {\n var i,\n j,\n dist,\n itemWithLeastDistance,\n posProperty,\n sizeProperty,\n cur,\n nearBottom,\n floating,\n axis,\n innermostContainer = null,\n innermostIndex = null; // Get innermost container that intersects with item\n\n for (i = this.containers.length - 1; i >= 0; i--) {\n // Never consider a container that's located within the item itself\n if ($.contains(this.currentItem[0], this.containers[i].element[0])) {\n continue;\n }\n\n if (this._intersectsWith(this.containers[i].containerCache)) {\n // If we've already found a container and it's more \"inner\" than this, then continue\n if (innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {\n continue;\n }\n\n innermostContainer = this.containers[i];\n innermostIndex = i;\n } else {\n // container doesn't intersect. trigger \"out\" event if necessary\n if (this.containers[i].containerCache.over) {\n this.containers[i]._trigger(\"out\", event, this._uiHash(this));\n\n this.containers[i].containerCache.over = 0;\n }\n }\n } // If no intersecting containers found, return\n\n\n if (!innermostContainer) {\n return;\n } // Move the item into the container if it's not there already\n\n\n if (this.containers.length === 1) {\n if (!this.containers[innermostIndex].containerCache.over) {\n this.containers[innermostIndex]._trigger(\"over\", event, this._uiHash(this));\n\n this.containers[innermostIndex].containerCache.over = 1;\n }\n } else {\n // When entering a new container, we will find the item with the least distance and\n // append our item near it\n dist = 10000;\n itemWithLeastDistance = null;\n floating = innermostContainer.floating || this._isFloating(this.currentItem);\n posProperty = floating ? \"left\" : \"top\";\n sizeProperty = floating ? \"width\" : \"height\";\n axis = floating ? \"pageX\" : \"pageY\";\n\n for (j = this.items.length - 1; j >= 0; j--) {\n if (!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {\n continue;\n }\n\n if (this.items[j].item[0] === this.currentItem[0]) {\n continue;\n }\n\n cur = this.items[j].item.offset()[posProperty];\n nearBottom = false;\n\n if (event[axis] - cur > this.items[j][sizeProperty] / 2) {\n nearBottom = true;\n }\n\n if (Math.abs(event[axis] - cur) < dist) {\n dist = Math.abs(event[axis] - cur);\n itemWithLeastDistance = this.items[j];\n this.direction = nearBottom ? \"up\" : \"down\";\n }\n } //Check if dropOnEmpty is enabled\n\n\n if (!itemWithLeastDistance && !this.options.dropOnEmpty) {\n return;\n }\n\n if (this.currentContainer === this.containers[innermostIndex]) {\n if (!this.currentContainer.containerCache.over) {\n this.containers[innermostIndex]._trigger(\"over\", event, this._uiHash());\n\n this.currentContainer.containerCache.over = 1;\n }\n\n return;\n }\n\n itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);\n\n this._trigger(\"change\", event, this._uiHash());\n\n this.containers[innermostIndex]._trigger(\"change\", event, this._uiHash(this));\n\n this.currentContainer = this.containers[innermostIndex]; //Update the placeholder\n\n this.options.placeholder.update(this.currentContainer, this.placeholder);\n\n this.containers[innermostIndex]._trigger(\"over\", event, this._uiHash(this));\n\n this.containers[innermostIndex].containerCache.over = 1;\n }\n },\n _createHelper: function _createHelper(event) {\n var o = this.options,\n helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : o.helper === \"clone\" ? this.currentItem.clone() : this.currentItem; //Add the helper to the DOM if that didn't happen already\n\n if (!helper.parents(\"body\").length) {\n $(o.appendTo !== \"parent\" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);\n }\n\n if (helper[0] === this.currentItem[0]) {\n this._storedCSS = {\n width: this.currentItem[0].style.width,\n height: this.currentItem[0].style.height,\n position: this.currentItem.css(\"position\"),\n top: this.currentItem.css(\"top\"),\n left: this.currentItem.css(\"left\")\n };\n }\n\n if (!helper[0].style.width || o.forceHelperSize) {\n helper.width(this.currentItem.width());\n }\n\n if (!helper[0].style.height || o.forceHelperSize) {\n helper.height(this.currentItem.height());\n }\n\n return helper;\n },\n _adjustOffsetFromHelper: function _adjustOffsetFromHelper(obj) {\n if (typeof obj === \"string\") {\n obj = obj.split(\" \");\n }\n\n if ($.isArray(obj)) {\n obj = {\n left: +obj[0],\n top: +obj[1] || 0\n };\n }\n\n if (\"left\" in obj) {\n this.offset.click.left = obj.left + this.margins.left;\n }\n\n if (\"right\" in obj) {\n this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;\n }\n\n if (\"top\" in obj) {\n this.offset.click.top = obj.top + this.margins.top;\n }\n\n if (\"bottom\" in obj) {\n this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;\n }\n },\n _getParentOffset: function _getParentOffset() {\n //Get the offsetParent and cache its position\n this.offsetParent = this.helper.offsetParent();\n var po = this.offsetParent.offset(); // This is a special case where we need to modify a offset calculated on start, since the\n // following happened:\n // 1. The position of the helper is absolute, so it's position is calculated based on the\n // next positioned parent\n // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't\n // the document, which means that the scroll is included in the initial calculation of the\n // offset of the parent, and never recalculated upon drag\n\n if (this.cssPosition === \"absolute\" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) {\n po.left += this.scrollParent.scrollLeft();\n po.top += this.scrollParent.scrollTop();\n } // This needs to be actually done for all browsers, since pageX/pageY includes this\n // information with an ugly IE fix\n\n\n if (this.offsetParent[0] === this.document[0].body || this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === \"html\" && $.ui.ie) {\n po = {\n top: 0,\n left: 0\n };\n }\n\n return {\n top: po.top + (parseInt(this.offsetParent.css(\"borderTopWidth\"), 10) || 0),\n left: po.left + (parseInt(this.offsetParent.css(\"borderLeftWidth\"), 10) || 0)\n };\n },\n _getRelativeOffset: function _getRelativeOffset() {\n if (this.cssPosition === \"relative\") {\n var p = this.currentItem.position();\n return {\n top: p.top - (parseInt(this.helper.css(\"top\"), 10) || 0) + this.scrollParent.scrollTop(),\n left: p.left - (parseInt(this.helper.css(\"left\"), 10) || 0) + this.scrollParent.scrollLeft()\n };\n } else {\n return {\n top: 0,\n left: 0\n };\n }\n },\n _cacheMargins: function _cacheMargins() {\n this.margins = {\n left: parseInt(this.currentItem.css(\"marginLeft\"), 10) || 0,\n top: parseInt(this.currentItem.css(\"marginTop\"), 10) || 0\n };\n },\n _cacheHelperProportions: function _cacheHelperProportions() {\n this.helperProportions = {\n width: this.helper.outerWidth(),\n height: this.helper.outerHeight()\n };\n },\n _setContainment: function _setContainment() {\n var ce,\n co,\n over,\n o = this.options;\n\n if (o.containment === \"parent\") {\n o.containment = this.helper[0].parentNode;\n }\n\n if (o.containment === \"document\" || o.containment === \"window\") {\n this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, o.containment === \"document\" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left, (o.containment === \"document\" ? this.document.height() || document.body.parentNode.scrollHeight : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];\n }\n\n if (!/^(document|window|parent)$/.test(o.containment)) {\n ce = $(o.containment)[0];\n co = $(o.containment).offset();\n over = $(ce).css(\"overflow\") !== \"hidden\";\n this.containment = [co.left + (parseInt($(ce).css(\"borderLeftWidth\"), 10) || 0) + (parseInt($(ce).css(\"paddingLeft\"), 10) || 0) - this.margins.left, co.top + (parseInt($(ce).css(\"borderTopWidth\"), 10) || 0) + (parseInt($(ce).css(\"paddingTop\"), 10) || 0) - this.margins.top, co.left + (over ? Math.max(ce.scrollWidth, ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css(\"borderLeftWidth\"), 10) || 0) - (parseInt($(ce).css(\"paddingRight\"), 10) || 0) - this.helperProportions.width - this.margins.left, co.top + (over ? Math.max(ce.scrollHeight, ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css(\"borderTopWidth\"), 10) || 0) - (parseInt($(ce).css(\"paddingBottom\"), 10) || 0) - this.helperProportions.height - this.margins.top];\n }\n },\n _convertPositionTo: function _convertPositionTo(d, pos) {\n if (!pos) {\n pos = this.position;\n }\n\n var mod = d === \"absolute\" ? 1 : -1,\n scroll = this.cssPosition === \"absolute\" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,\n scrollIsRootNode = /(html|body)/i.test(scroll[0].tagName);\n return {\n top: // The absolute mouse position\n pos.top + // Only for relative positioned nodes: Relative offset from element to offset parent\n this.offset.relative.top * mod + // The offsetParent's offset without borders (offset + border)\n this.offset.parent.top * mod - (this.cssPosition === \"fixed\" ? -this.scrollParent.scrollTop() : scrollIsRootNode ? 0 : scroll.scrollTop()) * mod,\n left: // The absolute mouse position\n pos.left + // Only for relative positioned nodes: Relative offset from element to offset parent\n this.offset.relative.left * mod + // The offsetParent's offset without borders (offset + border)\n this.offset.parent.left * mod - (this.cssPosition === \"fixed\" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft()) * mod\n };\n },\n _generatePosition: function _generatePosition(event) {\n var top,\n left,\n o = this.options,\n pageX = event.pageX,\n pageY = event.pageY,\n scroll = this.cssPosition === \"absolute\" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,\n scrollIsRootNode = /(html|body)/i.test(scroll[0].tagName); // This is another very weird special case that only happens for relative elements:\n // 1. If the css position is relative\n // 2. and the scroll parent is the document or similar to the offset parent\n // we have to refresh the relative offset during the scroll so there are no jumps\n\n if (this.cssPosition === \"relative\" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) {\n this.offset.relative = this._getRelativeOffset();\n }\n /*\n * - Position constraining -\n * Constrain the position to a mix of grid, containment.\n */\n\n\n if (this.originalPosition) {\n //If we are not dragging yet, we won't check for options\n if (this.containment) {\n if (event.pageX - this.offset.click.left < this.containment[0]) {\n pageX = this.containment[0] + this.offset.click.left;\n }\n\n if (event.pageY - this.offset.click.top < this.containment[1]) {\n pageY = this.containment[1] + this.offset.click.top;\n }\n\n if (event.pageX - this.offset.click.left > this.containment[2]) {\n pageX = this.containment[2] + this.offset.click.left;\n }\n\n if (event.pageY - this.offset.click.top > this.containment[3]) {\n pageY = this.containment[3] + this.offset.click.top;\n }\n }\n\n if (o.grid) {\n top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];\n pageY = this.containment ? top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3] ? top : top - this.offset.click.top >= this.containment[1] ? top - o.grid[1] : top + o.grid[1] : top;\n left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];\n pageX = this.containment ? left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2] ? left : left - this.offset.click.left >= this.containment[0] ? left - o.grid[0] : left + o.grid[0] : left;\n }\n }\n\n return {\n top: // The absolute mouse position\n pageY - // Click offset (relative to the element)\n this.offset.click.top - // Only for relative positioned nodes: Relative offset from element to offset parent\n this.offset.relative.top - // The offsetParent's offset without borders (offset + border)\n this.offset.parent.top + (this.cssPosition === \"fixed\" ? -this.scrollParent.scrollTop() : scrollIsRootNode ? 0 : scroll.scrollTop()),\n left: // The absolute mouse position\n pageX - // Click offset (relative to the element)\n this.offset.click.left - // Only for relative positioned nodes: Relative offset from element to offset parent\n this.offset.relative.left - // The offsetParent's offset without borders (offset + border)\n this.offset.parent.left + (this.cssPosition === \"fixed\" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft())\n };\n },\n _rearrange: function _rearrange(event, i, a, hardRefresh) {\n a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], this.direction === \"down\" ? i.item[0] : i.item[0].nextSibling); //Various things done here to improve the performance:\n // 1. we create a setTimeout, that calls refreshPositions\n // 2. on the instance, we have a counter variable, that get's higher after every append\n // 3. on the local scope, we copy the counter variable, and check in the timeout,\n // if it's still the same\n // 4. this lets only the last addition to the timeout stack through\n\n this.counter = this.counter ? ++this.counter : 1;\n var counter = this.counter;\n\n this._delay(function () {\n if (counter === this.counter) {\n //Precompute after each DOM insertion, NOT on mousemove\n this.refreshPositions(!hardRefresh);\n }\n });\n },\n _clear: function _clear(event, noPropagation) {\n this.reverting = false; // We delay all events that have to be triggered to after the point where the placeholder\n // has been removed and everything else normalized again\n\n var i,\n delayedTriggers = []; // We first have to update the dom position of the actual currentItem\n // Note: don't do it if the current item is already removed (by a user), or it gets\n // reappended (see #4088)\n\n if (!this._noFinalSort && this.currentItem.parent().length) {\n this.placeholder.before(this.currentItem);\n }\n\n this._noFinalSort = null;\n\n if (this.helper[0] === this.currentItem[0]) {\n for (i in this._storedCSS) {\n if (this._storedCSS[i] === \"auto\" || this._storedCSS[i] === \"static\") {\n this._storedCSS[i] = \"\";\n }\n }\n\n this.currentItem.css(this._storedCSS);\n\n this._removeClass(this.currentItem, \"ui-sortable-helper\");\n } else {\n this.currentItem.show();\n }\n\n if (this.fromOutside && !noPropagation) {\n delayedTriggers.push(function (event) {\n this._trigger(\"receive\", event, this._uiHash(this.fromOutside));\n });\n }\n\n if ((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(\".ui-sortable-helper\")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {\n // Trigger update callback if the DOM position has changed\n delayedTriggers.push(function (event) {\n this._trigger(\"update\", event, this._uiHash());\n });\n } // Check if the items Container has Changed and trigger appropriate\n // events.\n\n\n if (this !== this.currentContainer) {\n if (!noPropagation) {\n delayedTriggers.push(function (event) {\n this._trigger(\"remove\", event, this._uiHash());\n });\n delayedTriggers.push(function (c) {\n return function (event) {\n c._trigger(\"receive\", event, this._uiHash(this));\n };\n }.call(this, this.currentContainer));\n delayedTriggers.push(function (c) {\n return function (event) {\n c._trigger(\"update\", event, this._uiHash(this));\n };\n }.call(this, this.currentContainer));\n }\n } //Post events to containers\n\n\n function delayEvent(type, instance, container) {\n return function (event) {\n container._trigger(type, event, instance._uiHash(instance));\n };\n }\n\n for (i = this.containers.length - 1; i >= 0; i--) {\n if (!noPropagation) {\n delayedTriggers.push(delayEvent(\"deactivate\", this, this.containers[i]));\n }\n\n if (this.containers[i].containerCache.over) {\n delayedTriggers.push(delayEvent(\"out\", this, this.containers[i]));\n this.containers[i].containerCache.over = 0;\n }\n } //Do what was originally in plugins\n\n\n if (this.storedCursor) {\n this.document.find(\"body\").css(\"cursor\", this.storedCursor);\n this.storedStylesheet.remove();\n }\n\n if (this._storedOpacity) {\n this.helper.css(\"opacity\", this._storedOpacity);\n }\n\n if (this._storedZIndex) {\n this.helper.css(\"zIndex\", this._storedZIndex === \"auto\" ? \"\" : this._storedZIndex);\n }\n\n this.dragging = false;\n\n if (!noPropagation) {\n this._trigger(\"beforeStop\", event, this._uiHash());\n } //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,\n // it unbinds ALL events from the original node!\n\n\n this.placeholder[0].parentNode.removeChild(this.placeholder[0]);\n\n if (!this.cancelHelperRemoval) {\n if (this.helper[0] !== this.currentItem[0]) {\n this.helper.remove();\n }\n\n this.helper = null;\n }\n\n if (!noPropagation) {\n for (i = 0; i < delayedTriggers.length; i++) {\n // Trigger all delayed events\n delayedTriggers[i].call(this, event);\n }\n\n this._trigger(\"stop\", event, this._uiHash());\n }\n\n this.fromOutside = false;\n return !this.cancelHelperRemoval;\n },\n _trigger: function _trigger() {\n if ($.Widget.prototype._trigger.apply(this, arguments) === false) {\n this.cancel();\n }\n },\n _uiHash: function _uiHash(_inst) {\n var inst = _inst || this;\n return {\n helper: inst.helper,\n placeholder: inst.placeholder || $([]),\n position: inst.position,\n originalPosition: inst.originalPosition,\n offset: inst.positionAbs,\n item: inst.currentItem,\n sender: _inst ? _inst.element : null\n };\n }\n });\n});","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n(function () {\n var t = this;\n (function () {\n (function () {\n var t = [].slice;\n this.LocalTime = {\n config: {},\n run: function run() {\n return this.getController().processElements();\n },\n process: function process() {\n var e, n, r, a;\n\n for (n = 1 <= arguments.length ? t.call(arguments, 0) : [], r = 0, a = n.length; r < a; r++) {\n e = n[r], this.getController().processElement(e);\n }\n\n return n.length;\n },\n getController: function getController() {\n return null != this.controller ? this.controller : this.controller = new e.Controller();\n }\n };\n }).call(this);\n }).call(t);\n var e = t.LocalTime;\n (function () {\n (function () {\n e.config.i18n = {\n en: {\n date: {\n dayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n abbrDayNames: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n monthNames: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n abbrMonthNames: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n yesterday: \"yesterday\",\n today: \"today\",\n tomorrow: \"tomorrow\",\n on: \"on {date}\",\n formats: {\n \"default\": \"%b %e, %Y\",\n thisYear: \"%b %e\"\n }\n },\n time: {\n am: \"am\",\n pm: \"pm\",\n singular: \"a {time}\",\n singularAn: \"an {time}\",\n elapsed: \"{time} ago\",\n second: \"second\",\n seconds: \"seconds\",\n minute: \"minute\",\n minutes: \"minutes\",\n hour: \"hour\",\n hours: \"hours\",\n formats: {\n \"default\": \"%l:%M%P\"\n }\n },\n datetime: {\n at: \"{date} at {time}\",\n formats: {\n \"default\": \"%B %e, %Y at %l:%M%P %Z\"\n }\n }\n }\n };\n }).call(this), function () {\n e.config.locale = \"en\", e.config.defaultLocale = \"en\";\n }.call(this), function () {\n e.config.timerInterval = 6e4;\n }.call(this), function () {\n var t, n, r;\n r = !isNaN(Date.parse(\"2011-01-01T12:00:00-05:00\")), e.parseDate = function (t) {\n return t = t.toString(), r || (t = n(t)), new Date(Date.parse(t));\n }, t = /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(Z|[-+]?[\\d:]+)$/, n = function n(e) {\n var n, r, a, i, o, s, u, c, l;\n if (a = e.match(t)) return a[0], c = a[1], o = a[2], n = a[3], r = a[4], i = a[5], u = a[6], l = a[7], \"Z\" !== l && (s = l.replace(\":\", \"\")), c + \"/\" + o + \"/\" + n + \" \" + r + \":\" + i + \":\" + u + \" GMT\" + [s];\n };\n }.call(this), function () {\n e.elementMatchesSelector = function () {\n var t, e, n, r, a, i;\n return t = document.documentElement, e = null != (n = null != (r = null != (a = null != (i = t.matches) ? i : t.matchesSelector) ? a : t.webkitMatchesSelector) ? r : t.mozMatchesSelector) ? n : t.msMatchesSelector, function (t, n) {\n if ((null != t ? t.nodeType : void 0) === Node.ELEMENT_NODE) return e.call(t, n);\n };\n }();\n }.call(this), function () {\n var t, n, r;\n t = e.config, r = t.i18n, e.getI18nValue = function (a, i) {\n var o, s;\n return null == a && (a = \"\"), o = (null != i ? i : {\n locale: t.locale\n }).locale, s = n(r[o], a), null != s ? s : o !== t.defaultLocale ? e.getI18nValue(a, {\n locale: t.defaultLocale\n }) : void 0;\n }, e.translate = function (t, n, r) {\n var a, i, o;\n null == n && (n = {}), o = e.getI18nValue(t, r);\n\n for (a in n) {\n i = n[a], o = o.replace(\"{\" + a + \"}\", i);\n }\n\n return o;\n }, n = function n(t, e) {\n var n, r, a, i, o;\n\n for (o = t, i = e.split(\".\"), n = 0, a = i.length; n < a; n++) {\n if (r = i[n], null == o[r]) return null;\n o = o[r];\n }\n\n return o;\n };\n }.call(this), function () {\n var t, n, r, _a, i;\n\n t = e.getI18nValue, i = e.translate, e.strftime = _a = function a(e, o) {\n var s, u, c, l, d, h, f;\n return u = e.getDay(), s = e.getDate(), d = e.getMonth(), f = e.getFullYear(), c = e.getHours(), l = e.getMinutes(), h = e.getSeconds(), o.replace(/%(-?)([%aAbBcdeHIlmMpPSwyYZ])/g, function (o, m, p) {\n switch (p) {\n case \"%\":\n return \"%\";\n\n case \"a\":\n return t(\"date.abbrDayNames\")[u];\n\n case \"A\":\n return t(\"date.dayNames\")[u];\n\n case \"b\":\n return t(\"date.abbrMonthNames\")[d];\n\n case \"B\":\n return t(\"date.monthNames\")[d];\n\n case \"c\":\n return e.toString();\n\n case \"d\":\n return n(s, m);\n\n case \"e\":\n return s;\n\n case \"H\":\n return n(c, m);\n\n case \"I\":\n return n(_a(e, \"%l\"), m);\n\n case \"l\":\n return 0 === c || 12 === c ? 12 : (c + 12) % 12;\n\n case \"m\":\n return n(d + 1, m);\n\n case \"M\":\n return n(l, m);\n\n case \"p\":\n return i(\"time.\" + (c > 11 ? \"pm\" : \"am\")).toUpperCase();\n\n case \"P\":\n return i(\"time.\" + (c > 11 ? \"pm\" : \"am\"));\n\n case \"S\":\n return n(h, m);\n\n case \"w\":\n return u;\n\n case \"y\":\n return n(f % 100, m);\n\n case \"Y\":\n return f;\n\n case \"Z\":\n return r(e);\n }\n });\n }, n = function n(t, e) {\n switch (e) {\n case \"-\":\n return t;\n\n default:\n return (\"0\" + t).slice(-2);\n }\n }, r = function r(t) {\n var e, n, r, a, i;\n return i = t.toString(), (e = null != (n = i.match(/\\(([\\w\\s]+)\\)$/)) ? n[1] : void 0) ? /\\s/.test(e) ? e.match(/\\b(\\w)/g).join(\"\") : e : (e = null != (r = i.match(/(\\w{3,4})\\s\\d{4}$/)) ? r[1] : void 0) ? e : (e = null != (a = i.match(/(UTC[\\+\\-]\\d+)/)) ? a[1] : void 0) ? e : \"\";\n };\n }.call(this), function () {\n e.CalendarDate = function () {\n function t(t, e, n) {\n this.date = new Date(Date.UTC(t, e - 1)), this.date.setUTCDate(n), this.year = this.date.getUTCFullYear(), this.month = this.date.getUTCMonth() + 1, this.day = this.date.getUTCDate(), this.value = this.date.getTime();\n }\n\n return t.fromDate = function (t) {\n return new this(t.getFullYear(), t.getMonth() + 1, t.getDate());\n }, t.today = function () {\n return this.fromDate(new Date());\n }, t.prototype.equals = function (t) {\n return (null != t ? t.value : void 0) === this.value;\n }, t.prototype.is = function (t) {\n return this.equals(t);\n }, t.prototype.isToday = function () {\n return this.is(this.constructor.today());\n }, t.prototype.occursOnSameYearAs = function (t) {\n return this.year === (null != t ? t.year : void 0);\n }, t.prototype.occursThisYear = function () {\n return this.occursOnSameYearAs(this.constructor.today());\n }, t.prototype.daysSince = function (t) {\n if (t) return (this.date - t.date) / 864e5;\n }, t.prototype.daysPassed = function () {\n return this.constructor.today().daysSince(this);\n }, t;\n }();\n }.call(this), function () {\n var t, n, r;\n n = e.strftime, r = e.translate, t = e.getI18nValue, e.RelativeTime = function () {\n function a(t) {\n this.date = t, this.calendarDate = e.CalendarDate.fromDate(this.date);\n }\n\n return a.prototype.toString = function () {\n var t, e;\n return (e = this.toTimeElapsedString()) ? r(\"time.elapsed\", {\n time: e\n }) : (t = this.toWeekdayString()) ? (e = this.toTimeString(), r(\"datetime.at\", {\n date: t,\n time: e\n })) : r(\"date.on\", {\n date: this.toDateString()\n });\n }, a.prototype.toTimeOrDateString = function () {\n return this.calendarDate.isToday() ? this.toTimeString() : this.toDateString();\n }, a.prototype.toTimeElapsedString = function () {\n var t, e, n, a, i;\n return n = new Date().getTime() - this.date.getTime(), a = Math.round(n / 1e3), e = Math.round(a / 60), t = Math.round(e / 60), n < 0 ? null : a < 10 ? (i = r(\"time.second\"), r(\"time.singular\", {\n time: i\n })) : a < 45 ? a + \" \" + r(\"time.seconds\") : a < 90 ? (i = r(\"time.minute\"), r(\"time.singular\", {\n time: i\n })) : e < 45 ? e + \" \" + r(\"time.minutes\") : e < 90 ? (i = r(\"time.hour\"), r(\"time.singularAn\", {\n time: i\n })) : t < 24 ? t + \" \" + r(\"time.hours\") : \"\";\n }, a.prototype.toWeekdayString = function () {\n switch (this.calendarDate.daysPassed()) {\n case 0:\n return r(\"date.today\");\n\n case 1:\n return r(\"date.yesterday\");\n\n case -1:\n return r(\"date.tomorrow\");\n\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n return n(this.date, \"%A\");\n\n default:\n return \"\";\n }\n }, a.prototype.toDateString = function () {\n var e;\n return e = t(this.calendarDate.occursThisYear() ? \"date.formats.thisYear\" : \"date.formats.default\"), n(this.date, e);\n }, a.prototype.toTimeString = function () {\n return n(this.date, t(\"time.formats.default\"));\n }, a;\n }();\n }.call(this), function () {\n var t,\n n = function n(t, e) {\n return function () {\n return t.apply(e, arguments);\n };\n };\n\n t = e.elementMatchesSelector, e.PageObserver = function () {\n function e(t, e) {\n this.selector = t, this.callback = e, this.processInsertion = n(this.processInsertion, this), this.processMutations = n(this.processMutations, this);\n }\n\n return e.prototype.start = function () {\n if (!this.started) return this.observeWithMutationObserver() || this.observeWithMutationEvent(), this.started = !0;\n }, e.prototype.observeWithMutationObserver = function () {\n var t;\n if (\"undefined\" != typeof MutationObserver && null !== MutationObserver) return t = new MutationObserver(this.processMutations), t.observe(document.documentElement, {\n childList: !0,\n subtree: !0\n }), !0;\n }, e.prototype.observeWithMutationEvent = function () {\n return addEventListener(\"DOMNodeInserted\", this.processInsertion, !1), !0;\n }, e.prototype.findSignificantElements = function (e) {\n var n;\n return n = [], (null != e ? e.nodeType : void 0) === Node.ELEMENT_NODE && (t(e, this.selector) && n.push(e), n.push.apply(n, e.querySelectorAll(this.selector))), n;\n }, e.prototype.processMutations = function (t) {\n var e, n, r, a, i, o, s, u;\n\n for (e = [], n = 0, a = t.length; n < a; n++) {\n switch (o = t[n], o.type) {\n case \"childList\":\n for (u = o.addedNodes, r = 0, i = u.length; r < i; r++) {\n s = u[r], e.push.apply(e, this.findSignificantElements(s));\n }\n\n }\n }\n\n return this.notify(e);\n }, e.prototype.processInsertion = function (t) {\n var e;\n return e = this.findSignificantElements(t.target), this.notify(e);\n }, e.prototype.notify = function (t) {\n if (null != t ? t.length : void 0) return \"function\" == typeof this.callback ? this.callback(t) : void 0;\n }, e;\n }();\n }.call(this), function () {\n var t,\n n,\n r,\n a,\n i = function i(t, e) {\n return function () {\n return t.apply(e, arguments);\n };\n };\n\n r = e.parseDate, a = e.strftime, n = e.getI18nValue, t = e.config, e.Controller = function () {\n function o() {\n this.processElements = i(this.processElements, this), this.pageObserver = new e.PageObserver(s, this.processElements);\n }\n\n var s, u, c;\n return s = \"time[data-local]:not([data-localized])\", o.prototype.start = function () {\n if (!this.started) return this.processElements(), this.startTimer(), this.pageObserver.start(), this.started = !0;\n }, o.prototype.startTimer = function () {\n var e;\n if (e = t.timerInterval) return null != this.timer ? this.timer : this.timer = setInterval(this.processElements, e);\n }, o.prototype.processElements = function (t) {\n var e, n, r;\n\n for (null == t && (t = document.querySelectorAll(s)), n = 0, r = t.length; n < r; n++) {\n e = t[n], this.processElement(e);\n }\n\n return t.length;\n }, o.prototype.processElement = function (t) {\n var e, i, o, s, l, d;\n if (i = t.getAttribute(\"datetime\"), o = t.getAttribute(\"data-format\"), s = t.getAttribute(\"data-local\"), l = r(i), !isNaN(l)) return t.hasAttribute(\"title\") || (d = a(l, n(\"datetime.formats.default\")), t.setAttribute(\"title\", d)), t.textContent = e = function () {\n switch (s) {\n case \"time\":\n return u(t), a(l, o);\n\n case \"date\":\n return u(t), c(l).toDateString();\n\n case \"time-ago\":\n return c(l).toString();\n\n case \"time-or-date\":\n return c(l).toTimeOrDateString();\n\n case \"weekday\":\n return c(l).toWeekdayString();\n\n case \"weekday-or-date\":\n return c(l).toWeekdayString() || c(l).toDateString();\n }\n }(), t.hasAttribute(\"aria-label\") ? void 0 : t.setAttribute(\"aria-label\", e);\n }, u = function u(t) {\n return t.setAttribute(\"data-localized\", \"\");\n }, c = function c(t) {\n return new e.RelativeTime(t);\n }, o;\n }();\n }.call(this), function () {\n var t, n, r, a;\n a = !1, t = function t() {\n return document.attachEvent ? \"complete\" === document.readyState : \"loading\" !== document.readyState;\n }, n = function n(t) {\n var e;\n return null != (e = \"function\" == typeof requestAnimationFrame ? requestAnimationFrame(t) : void 0) ? e : setTimeout(t, 17);\n }, r = function r() {\n var t;\n return t = e.getController(), t.start();\n }, e.start = function () {\n if (!a) return a = !0, \"undefined\" != typeof MutationObserver && null !== MutationObserver || t() ? r() : n(r);\n }, window.LocalTime === e && e.start();\n }.call(this);\n }).call(this), \"object\" == (typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) && module.exports ? module.exports = e : \"function\" == typeof define && define.amd && define(e);\n}).call(this);","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/**\r\n* @version: 3.1\r\n* @author: Dan Grossman http://www.dangrossman.info/\r\n* @copyright: Copyright (c) 2012-2019 Dan Grossman. All rights reserved.\r\n* @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php\r\n* @website: http://www.daterangepicker.com/\r\n*/\n// Following the UMD template https://github.com/umdjs/umd/blob/master/templates/returnExportsGlobal.js\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Make globaly available as well\n define(['moment', 'jquery'], function (moment, jquery) {\n if (!jquery.fn) jquery.fn = {}; // webpack server rendering\n\n if (typeof moment !== 'function' && moment.hasOwnProperty('default')) moment = moment['default'];\n return factory(moment, jquery);\n });\n } else if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === 'object' && module.exports) {\n // Node / Browserify\n //isomorphic issue\n var jQuery = typeof window != 'undefined' ? window.jQuery : undefined;\n\n if (!jQuery) {\n jQuery = require('jquery');\n if (!jQuery.fn) jQuery.fn = {};\n }\n\n var moment = typeof window != 'undefined' && typeof window.moment != 'undefined' ? window.moment : require('moment');\n module.exports = factory(moment, jQuery);\n } else {\n // Browser globals\n root.daterangepicker = factory(root.moment, root.jQuery);\n }\n})(this, function (moment, $) {\n var DateRangePicker = function DateRangePicker(element, options, cb) {\n //default settings for options\n this.parentEl = 'body';\n this.element = $(element);\n this.startDate = moment().startOf('day');\n this.endDate = moment().endOf('day');\n this.minDate = false;\n this.maxDate = false;\n this.maxSpan = false;\n this.autoApply = false;\n this.singleDatePicker = false;\n this.showDropdowns = false;\n this.minYear = moment().subtract(100, 'year').format('YYYY');\n this.maxYear = moment().add(100, 'year').format('YYYY');\n this.showWeekNumbers = false;\n this.showISOWeekNumbers = false;\n this.showCustomRangeLabel = true;\n this.timePicker = false;\n this.timePicker24Hour = false;\n this.timePickerIncrement = 1;\n this.timePickerSeconds = false;\n this.linkedCalendars = true;\n this.autoUpdateInput = true;\n this.alwaysShowCalendars = false;\n this.ranges = {};\n this.opens = 'right';\n if (this.element.hasClass('pull-right')) this.opens = 'left';\n this.drops = 'down';\n if (this.element.hasClass('dropup')) this.drops = 'up';\n this.buttonClasses = 'btn btn-sm';\n this.applyButtonClasses = 'btn-primary';\n this.cancelButtonClasses = 'btn-default';\n this.locale = {\n direction: 'ltr',\n format: moment.localeData().longDateFormat('L'),\n separator: ' - ',\n applyLabel: 'Apply',\n cancelLabel: 'Cancel',\n weekLabel: 'W',\n customRangeLabel: 'Custom Range',\n daysOfWeek: moment.weekdaysMin(),\n monthNames: moment.monthsShort(),\n firstDay: moment.localeData().firstDayOfWeek()\n };\n\n this.callback = function () {}; //some state information\n\n\n this.isShowing = false;\n this.leftCalendar = {};\n this.rightCalendar = {}; //custom options from user\n\n if (_typeof(options) !== 'object' || options === null) options = {}; //allow setting options with data attributes\n //data-api options will be overwritten with custom javascript options\n\n options = $.extend(this.element.data(), options); //html template for the picker UI\n\n if (typeof options.template !== 'string' && !(options.template instanceof $)) options.template = '' + '
' + '
' + '
' + '
' + '' + '' + ' ' + '
' + '
';\n this.parentEl = options.parentEl && $(options.parentEl).length ? $(options.parentEl) : $(this.parentEl);\n this.container = $(options.template).appendTo(this.parentEl); //\n // handle all the possible options overriding defaults\n //\n\n if (_typeof(options.locale) === 'object') {\n if (typeof options.locale.direction === 'string') this.locale.direction = options.locale.direction;\n if (typeof options.locale.format === 'string') this.locale.format = options.locale.format;\n if (typeof options.locale.separator === 'string') this.locale.separator = options.locale.separator;\n if (_typeof(options.locale.daysOfWeek) === 'object') this.locale.daysOfWeek = options.locale.daysOfWeek.slice();\n if (_typeof(options.locale.monthNames) === 'object') this.locale.monthNames = options.locale.monthNames.slice();\n if (typeof options.locale.firstDay === 'number') this.locale.firstDay = options.locale.firstDay;\n if (typeof options.locale.applyLabel === 'string') this.locale.applyLabel = options.locale.applyLabel;\n if (typeof options.locale.cancelLabel === 'string') this.locale.cancelLabel = options.locale.cancelLabel;\n if (typeof options.locale.weekLabel === 'string') this.locale.weekLabel = options.locale.weekLabel;\n\n if (typeof options.locale.customRangeLabel === 'string') {\n //Support unicode chars in the custom range name.\n var elem = document.createElement('textarea');\n elem.innerHTML = options.locale.customRangeLabel;\n var rangeHtml = elem.value;\n this.locale.customRangeLabel = rangeHtml;\n }\n }\n\n this.container.addClass(this.locale.direction);\n if (typeof options.startDate === 'string') this.startDate = moment(options.startDate, this.locale.format);\n if (typeof options.endDate === 'string') this.endDate = moment(options.endDate, this.locale.format);\n if (typeof options.minDate === 'string') this.minDate = moment(options.minDate, this.locale.format);\n if (typeof options.maxDate === 'string') this.maxDate = moment(options.maxDate, this.locale.format);\n if (_typeof(options.startDate) === 'object') this.startDate = moment(options.startDate);\n if (_typeof(options.endDate) === 'object') this.endDate = moment(options.endDate);\n if (_typeof(options.minDate) === 'object') this.minDate = moment(options.minDate);\n if (_typeof(options.maxDate) === 'object') this.maxDate = moment(options.maxDate); // sanity check for bad options\n\n if (this.minDate && this.startDate.isBefore(this.minDate)) this.startDate = this.minDate.clone(); // sanity check for bad options\n\n if (this.maxDate && this.endDate.isAfter(this.maxDate)) this.endDate = this.maxDate.clone();\n if (typeof options.applyButtonClasses === 'string') this.applyButtonClasses = options.applyButtonClasses;\n if (typeof options.applyClass === 'string') //backwards compat\n this.applyButtonClasses = options.applyClass;\n if (typeof options.cancelButtonClasses === 'string') this.cancelButtonClasses = options.cancelButtonClasses;\n if (typeof options.cancelClass === 'string') //backwards compat\n this.cancelButtonClasses = options.cancelClass;\n if (_typeof(options.maxSpan) === 'object') this.maxSpan = options.maxSpan;\n if (_typeof(options.dateLimit) === 'object') //backwards compat\n this.maxSpan = options.dateLimit;\n if (typeof options.opens === 'string') this.opens = options.opens;\n if (typeof options.drops === 'string') this.drops = options.drops;\n if (typeof options.showWeekNumbers === 'boolean') this.showWeekNumbers = options.showWeekNumbers;\n if (typeof options.showISOWeekNumbers === 'boolean') this.showISOWeekNumbers = options.showISOWeekNumbers;\n if (typeof options.buttonClasses === 'string') this.buttonClasses = options.buttonClasses;\n if (_typeof(options.buttonClasses) === 'object') this.buttonClasses = options.buttonClasses.join(' ');\n if (typeof options.showDropdowns === 'boolean') this.showDropdowns = options.showDropdowns;\n if (typeof options.minYear === 'number') this.minYear = options.minYear;\n if (typeof options.maxYear === 'number') this.maxYear = options.maxYear;\n if (typeof options.showCustomRangeLabel === 'boolean') this.showCustomRangeLabel = options.showCustomRangeLabel;\n\n if (typeof options.singleDatePicker === 'boolean') {\n this.singleDatePicker = options.singleDatePicker;\n if (this.singleDatePicker) this.endDate = this.startDate.clone();\n }\n\n if (typeof options.timePicker === 'boolean') this.timePicker = options.timePicker;\n if (typeof options.timePickerSeconds === 'boolean') this.timePickerSeconds = options.timePickerSeconds;\n if (typeof options.timePickerIncrement === 'number') this.timePickerIncrement = options.timePickerIncrement;\n if (typeof options.timePicker24Hour === 'boolean') this.timePicker24Hour = options.timePicker24Hour;\n if (typeof options.autoApply === 'boolean') this.autoApply = options.autoApply;\n if (typeof options.autoUpdateInput === 'boolean') this.autoUpdateInput = options.autoUpdateInput;\n if (typeof options.linkedCalendars === 'boolean') this.linkedCalendars = options.linkedCalendars;\n if (typeof options.isInvalidDate === 'function') this.isInvalidDate = options.isInvalidDate;\n if (typeof options.isCustomDate === 'function') this.isCustomDate = options.isCustomDate;\n if (typeof options.alwaysShowCalendars === 'boolean') this.alwaysShowCalendars = options.alwaysShowCalendars; // update day names order to firstDay\n\n if (this.locale.firstDay != 0) {\n var iterator = this.locale.firstDay;\n\n while (iterator > 0) {\n this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift());\n iterator--;\n }\n }\n\n var start, end, range; //if no start/end dates set, check if an input element contains initial values\n\n if (typeof options.startDate === 'undefined' && typeof options.endDate === 'undefined') {\n if ($(this.element).is(':text')) {\n var val = $(this.element).val(),\n split = val.split(this.locale.separator);\n start = end = null;\n\n if (split.length == 2) {\n start = moment(split[0], this.locale.format);\n end = moment(split[1], this.locale.format);\n } else if (this.singleDatePicker && val !== \"\") {\n start = moment(val, this.locale.format);\n end = moment(val, this.locale.format);\n }\n\n if (start !== null && end !== null) {\n this.setStartDate(start);\n this.setEndDate(end);\n }\n }\n }\n\n if (_typeof(options.ranges) === 'object') {\n for (range in options.ranges) {\n if (typeof options.ranges[range][0] === 'string') start = moment(options.ranges[range][0], this.locale.format);else start = moment(options.ranges[range][0]);\n if (typeof options.ranges[range][1] === 'string') end = moment(options.ranges[range][1], this.locale.format);else end = moment(options.ranges[range][1]); // If the start or end date exceed those allowed by the minDate or maxSpan\n // options, shorten the range to the allowable period.\n\n if (this.minDate && start.isBefore(this.minDate)) start = this.minDate.clone();\n var maxDate = this.maxDate;\n if (this.maxSpan && maxDate && start.clone().add(this.maxSpan).isAfter(maxDate)) maxDate = start.clone().add(this.maxSpan);\n if (maxDate && end.isAfter(maxDate)) end = maxDate.clone(); // If the end of the range is before the minimum or the start of the range is\n // after the maximum, don't display this range option at all.\n\n if (this.minDate && end.isBefore(this.minDate, this.timepicker ? 'minute' : 'day') || maxDate && start.isAfter(maxDate, this.timepicker ? 'minute' : 'day')) continue; //Support unicode chars in the range names.\n\n var elem = document.createElement('textarea');\n elem.innerHTML = range;\n var rangeHtml = elem.value;\n this.ranges[rangeHtml] = [start, end];\n }\n\n var list = '';\n\n for (range in this.ranges) {\n list += '- ' + range + '
';\n }\n\n if (this.showCustomRangeLabel) {\n list += '- ' + this.locale.customRangeLabel + '
';\n }\n\n list += '
';\n this.container.find('.ranges').prepend(list);\n }\n\n if (typeof cb === 'function') {\n this.callback = cb;\n }\n\n if (!this.timePicker) {\n this.startDate = this.startDate.startOf('day');\n this.endDate = this.endDate.endOf('day');\n this.container.find('.calendar-time').hide();\n } //can't be used together for now\n\n\n if (this.timePicker && this.autoApply) this.autoApply = false;\n\n if (this.autoApply) {\n this.container.addClass('auto-apply');\n }\n\n if (_typeof(options.ranges) === 'object') this.container.addClass('show-ranges');\n\n if (this.singleDatePicker) {\n this.container.addClass('single');\n this.container.find('.drp-calendar.left').addClass('single');\n this.container.find('.drp-calendar.left').show();\n this.container.find('.drp-calendar.right').hide();\n\n if (!this.timePicker && this.autoApply) {\n this.container.addClass('auto-apply');\n }\n }\n\n if (typeof options.ranges === 'undefined' && !this.singleDatePicker || this.alwaysShowCalendars) {\n this.container.addClass('show-calendar');\n }\n\n this.container.addClass('opens' + this.opens); //apply CSS classes and labels to buttons\n\n this.container.find('.applyBtn, .cancelBtn').addClass(this.buttonClasses);\n if (this.applyButtonClasses.length) this.container.find('.applyBtn').addClass(this.applyButtonClasses);\n if (this.cancelButtonClasses.length) this.container.find('.cancelBtn').addClass(this.cancelButtonClasses);\n this.container.find('.applyBtn').html(this.locale.applyLabel);\n this.container.find('.cancelBtn').html(this.locale.cancelLabel); //\n // event listeners\n //\n\n this.container.find('.drp-calendar').on('click.daterangepicker', '.prev', $.proxy(this.clickPrev, this)).on('click.daterangepicker', '.next', $.proxy(this.clickNext, this)).on('mousedown.daterangepicker', 'td.available', $.proxy(this.clickDate, this)).on('mouseenter.daterangepicker', 'td.available', $.proxy(this.hoverDate, this)).on('change.daterangepicker', 'select.yearselect', $.proxy(this.monthOrYearChanged, this)).on('change.daterangepicker', 'select.monthselect', $.proxy(this.monthOrYearChanged, this)).on('change.daterangepicker', 'select.hourselect,select.minuteselect,select.secondselect,select.ampmselect', $.proxy(this.timeChanged, this));\n this.container.find('.ranges').on('click.daterangepicker', 'li', $.proxy(this.clickRange, this));\n this.container.find('.drp-buttons').on('click.daterangepicker', 'button.applyBtn', $.proxy(this.clickApply, this)).on('click.daterangepicker', 'button.cancelBtn', $.proxy(this.clickCancel, this));\n\n if (this.element.is('input') || this.element.is('button')) {\n this.element.on({\n 'click.daterangepicker': $.proxy(this.show, this),\n 'focus.daterangepicker': $.proxy(this.show, this),\n 'keyup.daterangepicker': $.proxy(this.elementChanged, this),\n 'keydown.daterangepicker': $.proxy(this.keydown, this) //IE 11 compatibility\n\n });\n } else {\n this.element.on('click.daterangepicker', $.proxy(this.toggle, this));\n this.element.on('keydown.daterangepicker', $.proxy(this.toggle, this));\n } //\n // if attached to a text input, set the initial value\n //\n\n\n this.updateElement();\n };\n\n DateRangePicker.prototype = {\n constructor: DateRangePicker,\n setStartDate: function setStartDate(startDate) {\n if (typeof startDate === 'string') this.startDate = moment(startDate, this.locale.format);\n if (_typeof(startDate) === 'object') this.startDate = moment(startDate);\n if (!this.timePicker) this.startDate = this.startDate.startOf('day');\n if (this.timePicker && this.timePickerIncrement) this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);\n\n if (this.minDate && this.startDate.isBefore(this.minDate)) {\n this.startDate = this.minDate.clone();\n if (this.timePicker && this.timePickerIncrement) this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);\n }\n\n if (this.maxDate && this.startDate.isAfter(this.maxDate)) {\n this.startDate = this.maxDate.clone();\n if (this.timePicker && this.timePickerIncrement) this.startDate.minute(Math.floor(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);\n }\n\n if (!this.isShowing) this.updateElement();\n this.updateMonthsInView();\n },\n setEndDate: function setEndDate(endDate) {\n if (typeof endDate === 'string') this.endDate = moment(endDate, this.locale.format);\n if (_typeof(endDate) === 'object') this.endDate = moment(endDate);\n if (!this.timePicker) this.endDate = this.endDate.endOf('day');\n if (this.timePicker && this.timePickerIncrement) this.endDate.minute(Math.round(this.endDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);\n if (this.endDate.isBefore(this.startDate)) this.endDate = this.startDate.clone();\n if (this.maxDate && this.endDate.isAfter(this.maxDate)) this.endDate = this.maxDate.clone();\n if (this.maxSpan && this.startDate.clone().add(this.maxSpan).isBefore(this.endDate)) this.endDate = this.startDate.clone().add(this.maxSpan);\n this.previousRightTime = this.endDate.clone();\n this.container.find('.drp-selected').html(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));\n if (!this.isShowing) this.updateElement();\n this.updateMonthsInView();\n },\n isInvalidDate: function isInvalidDate() {\n return false;\n },\n isCustomDate: function isCustomDate() {\n return false;\n },\n updateView: function updateView() {\n if (this.timePicker) {\n this.renderTimePicker('left');\n this.renderTimePicker('right');\n\n if (!this.endDate) {\n this.container.find('.right .calendar-time select').prop('disabled', true).addClass('disabled');\n } else {\n this.container.find('.right .calendar-time select').prop('disabled', false).removeClass('disabled');\n }\n }\n\n if (this.endDate) this.container.find('.drp-selected').html(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));\n this.updateMonthsInView();\n this.updateCalendars();\n this.updateFormInputs();\n },\n updateMonthsInView: function updateMonthsInView() {\n if (this.endDate) {\n //if both dates are visible already, do nothing\n if (!this.singleDatePicker && this.leftCalendar.month && this.rightCalendar.month && (this.startDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.startDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM')) && (this.endDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.endDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM'))) {\n return;\n }\n\n this.leftCalendar.month = this.startDate.clone().date(2);\n\n if (!this.linkedCalendars && (this.endDate.month() != this.startDate.month() || this.endDate.year() != this.startDate.year())) {\n this.rightCalendar.month = this.endDate.clone().date(2);\n } else {\n this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month');\n }\n } else {\n if (this.leftCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM') && this.rightCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM')) {\n this.leftCalendar.month = this.startDate.clone().date(2);\n this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month');\n }\n }\n\n if (this.maxDate && this.linkedCalendars && !this.singleDatePicker && this.rightCalendar.month > this.maxDate) {\n this.rightCalendar.month = this.maxDate.clone().date(2);\n this.leftCalendar.month = this.maxDate.clone().date(2).subtract(1, 'month');\n }\n },\n updateCalendars: function updateCalendars() {\n if (this.timePicker) {\n var hour, minute, second;\n\n if (this.endDate) {\n hour = parseInt(this.container.find('.left .hourselect').val(), 10);\n minute = parseInt(this.container.find('.left .minuteselect').val(), 10);\n\n if (isNaN(minute)) {\n minute = parseInt(this.container.find('.left .minuteselect option:last').val(), 10);\n }\n\n second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0;\n\n if (!this.timePicker24Hour) {\n var ampm = this.container.find('.left .ampmselect').val();\n if (ampm === 'PM' && hour < 12) hour += 12;\n if (ampm === 'AM' && hour === 12) hour = 0;\n }\n } else {\n hour = parseInt(this.container.find('.right .hourselect').val(), 10);\n minute = parseInt(this.container.find('.right .minuteselect').val(), 10);\n\n if (isNaN(minute)) {\n minute = parseInt(this.container.find('.right .minuteselect option:last').val(), 10);\n }\n\n second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0;\n\n if (!this.timePicker24Hour) {\n var ampm = this.container.find('.right .ampmselect').val();\n if (ampm === 'PM' && hour < 12) hour += 12;\n if (ampm === 'AM' && hour === 12) hour = 0;\n }\n }\n\n this.leftCalendar.month.hour(hour).minute(minute).second(second);\n this.rightCalendar.month.hour(hour).minute(minute).second(second);\n }\n\n this.renderCalendar('left');\n this.renderCalendar('right'); //highlight any predefined range matching the current start and end dates\n\n this.container.find('.ranges li').removeClass('active');\n if (this.endDate == null) return;\n this.calculateChosenLabel();\n },\n renderCalendar: function renderCalendar(side) {\n //\n // Build the matrix of dates that will populate the calendar\n //\n var calendar = side == 'left' ? this.leftCalendar : this.rightCalendar;\n var month = calendar.month.month();\n var year = calendar.month.year();\n var hour = calendar.month.hour();\n var minute = calendar.month.minute();\n var second = calendar.month.second();\n var daysInMonth = moment([year, month]).daysInMonth();\n var firstDay = moment([year, month, 1]);\n var lastDay = moment([year, month, daysInMonth]);\n var lastMonth = moment(firstDay).subtract(1, 'month').month();\n var lastYear = moment(firstDay).subtract(1, 'month').year();\n var daysInLastMonth = moment([lastYear, lastMonth]).daysInMonth();\n var dayOfWeek = firstDay.day(); //initialize a 6 rows x 7 columns array for the calendar\n\n var calendar = [];\n calendar.firstDay = firstDay;\n calendar.lastDay = lastDay;\n\n for (var i = 0; i < 6; i++) {\n calendar[i] = [];\n } //populate the calendar with date objects\n\n\n var startDay = daysInLastMonth - dayOfWeek + this.locale.firstDay + 1;\n if (startDay > daysInLastMonth) startDay -= 7;\n if (dayOfWeek == this.locale.firstDay) startDay = daysInLastMonth - 6;\n var curDate = moment([lastYear, lastMonth, startDay, 12, minute, second]);\n var col, row;\n\n for (var i = 0, col = 0, row = 0; i < 42; i++, col++, curDate = moment(curDate).add(24, 'hour')) {\n if (i > 0 && col % 7 === 0) {\n col = 0;\n row++;\n }\n\n calendar[row][col] = curDate.clone().hour(hour).minute(minute).second(second);\n curDate.hour(12);\n\n if (this.minDate && calendar[row][col].format('YYYY-MM-DD') == this.minDate.format('YYYY-MM-DD') && calendar[row][col].isBefore(this.minDate) && side == 'left') {\n calendar[row][col] = this.minDate.clone();\n }\n\n if (this.maxDate && calendar[row][col].format('YYYY-MM-DD') == this.maxDate.format('YYYY-MM-DD') && calendar[row][col].isAfter(this.maxDate) && side == 'right') {\n calendar[row][col] = this.maxDate.clone();\n }\n } //make the calendar object available to hoverDate/clickDate\n\n\n if (side == 'left') {\n this.leftCalendar.calendar = calendar;\n } else {\n this.rightCalendar.calendar = calendar;\n } //\n // Display the calendar\n //\n\n\n var minDate = side == 'left' ? this.minDate : this.startDate;\n var maxDate = this.maxDate;\n var selected = side == 'left' ? this.startDate : this.endDate;\n var arrow = this.locale.direction == 'ltr' ? {\n left: 'chevron-left',\n right: 'chevron-right'\n } : {\n left: 'chevron-right',\n right: 'chevron-left'\n };\n var html = '';\n html += '';\n html += ''; // add empty cell for week number\n\n if (this.showWeekNumbers || this.showISOWeekNumbers) html += ' | ';\n\n if ((!minDate || minDate.isBefore(calendar.firstDay)) && (!this.linkedCalendars || side == 'left')) {\n html += ' | ';\n } else {\n html += ' | ';\n }\n\n var dateHtml = this.locale.monthNames[calendar[1][1].month()] + calendar[1][1].format(\" YYYY\");\n\n if (this.showDropdowns) {\n var currentMonth = calendar[1][1].month();\n var currentYear = calendar[1][1].year();\n var maxYear = maxDate && maxDate.year() || this.maxYear;\n var minYear = minDate && minDate.year() || this.minYear;\n var inMinYear = currentYear == minYear;\n var inMaxYear = currentYear == maxYear;\n var monthHtml = '\";\n var yearHtml = '';\n dateHtml = monthHtml + yearHtml;\n }\n\n html += '' + dateHtml + ' | ';\n\n if ((!maxDate || maxDate.isAfter(calendar.lastDay)) && (!this.linkedCalendars || side == 'right' || this.singleDatePicker)) {\n html += ' | ';\n } else {\n html += ' | ';\n }\n\n html += '
';\n html += ''; // add week number label\n\n if (this.showWeekNumbers || this.showISOWeekNumbers) html += '' + this.locale.weekLabel + ' | ';\n $.each(this.locale.daysOfWeek, function (index, dayOfWeek) {\n html += '' + dayOfWeek + ' | ';\n });\n html += '
';\n html += '';\n html += ''; //adjust maxDate to reflect the maxSpan setting in order to\n //grey out end dates beyond the maxSpan\n\n if (this.endDate == null && this.maxSpan) {\n var maxLimit = this.startDate.clone().add(this.maxSpan).endOf('day');\n\n if (!maxDate || maxLimit.isBefore(maxDate)) {\n maxDate = maxLimit;\n }\n }\n\n for (var row = 0; row < 6; row++) {\n html += ''; // add week number\n\n if (this.showWeekNumbers) html += '' + calendar[row][0].week() + ' | ';else if (this.showISOWeekNumbers) html += '' + calendar[row][0].isoWeek() + ' | ';\n\n for (var col = 0; col < 7; col++) {\n var classes = []; //highlight today's date\n\n if (calendar[row][col].isSame(new Date(), \"day\")) classes.push('today'); //highlight weekends\n\n if (calendar[row][col].isoWeekday() > 5) classes.push('weekend'); //grey out the dates in other months displayed at beginning and end of this calendar\n\n if (calendar[row][col].month() != calendar[1][1].month()) classes.push('off', 'ends'); //don't allow selection of dates before the minimum date\n\n if (this.minDate && calendar[row][col].isBefore(this.minDate, 'day')) classes.push('off', 'disabled'); //don't allow selection of dates after the maximum date\n\n if (maxDate && calendar[row][col].isAfter(maxDate, 'day')) classes.push('off', 'disabled'); //don't allow selection of date if a custom function decides it's invalid\n\n if (this.isInvalidDate(calendar[row][col])) classes.push('off', 'disabled'); //highlight the currently selected start date\n\n if (calendar[row][col].format('YYYY-MM-DD') == this.startDate.format('YYYY-MM-DD')) classes.push('active', 'start-date'); //highlight the currently selected end date\n\n if (this.endDate != null && calendar[row][col].format('YYYY-MM-DD') == this.endDate.format('YYYY-MM-DD')) classes.push('active', 'end-date'); //highlight dates in-between the selected dates\n\n if (this.endDate != null && calendar[row][col] > this.startDate && calendar[row][col] < this.endDate) classes.push('in-range'); //apply custom classes for this date\n\n var isCustom = this.isCustomDate(calendar[row][col]);\n\n if (isCustom !== false) {\n if (typeof isCustom === 'string') classes.push(isCustom);else Array.prototype.push.apply(classes, isCustom);\n }\n\n var cname = '',\n disabled = false;\n\n for (var i = 0; i < classes.length; i++) {\n cname += classes[i] + ' ';\n if (classes[i] == 'disabled') disabled = true;\n }\n\n if (!disabled) cname += 'available';\n html += '' + calendar[row][col].date() + ' | ';\n }\n\n html += '
';\n }\n\n html += '';\n html += '
';\n this.container.find('.drp-calendar.' + side + ' .calendar-table').html(html);\n },\n renderTimePicker: function renderTimePicker(side) {\n // Don't bother updating the time picker if it's currently disabled\n // because an end date hasn't been clicked yet\n if (side == 'right' && !this.endDate) return;\n var html,\n selected,\n minDate,\n maxDate = this.maxDate;\n if (this.maxSpan && (!this.maxDate || this.startDate.clone().add(this.maxSpan).isBefore(this.maxDate))) maxDate = this.startDate.clone().add(this.maxSpan);\n\n if (side == 'left') {\n selected = this.startDate.clone();\n minDate = this.minDate;\n } else if (side == 'right') {\n selected = this.endDate.clone();\n minDate = this.startDate; //Preserve the time already selected\n\n var timeSelector = this.container.find('.drp-calendar.right .calendar-time');\n\n if (timeSelector.html() != '') {\n selected.hour(!isNaN(selected.hour()) ? selected.hour() : timeSelector.find('.hourselect option:selected').val());\n selected.minute(!isNaN(selected.minute()) ? selected.minute() : timeSelector.find('.minuteselect option:selected').val());\n selected.second(!isNaN(selected.second()) ? selected.second() : timeSelector.find('.secondselect option:selected').val());\n\n if (!this.timePicker24Hour) {\n var ampm = timeSelector.find('.ampmselect option:selected').val();\n if (ampm === 'PM' && selected.hour() < 12) selected.hour(selected.hour() + 12);\n if (ampm === 'AM' && selected.hour() === 12) selected.hour(0);\n }\n }\n\n if (selected.isBefore(this.startDate)) selected = this.startDate.clone();\n if (maxDate && selected.isAfter(maxDate)) selected = maxDate.clone();\n } //\n // hours\n //\n\n\n html = ' '; //\n // minutes\n //\n\n html += ': '; //\n // seconds\n //\n\n if (this.timePickerSeconds) {\n html += ': ';\n } //\n // AM/PM\n //\n\n\n if (!this.timePicker24Hour) {\n html += '';\n }\n\n this.container.find('.drp-calendar.' + side + ' .calendar-time').html(html);\n },\n updateFormInputs: function updateFormInputs() {\n if (this.singleDatePicker || this.endDate && (this.startDate.isBefore(this.endDate) || this.startDate.isSame(this.endDate))) {\n this.container.find('button.applyBtn').prop('disabled', false);\n } else {\n this.container.find('button.applyBtn').prop('disabled', true);\n }\n },\n move: function move() {\n var parentOffset = {\n top: 0,\n left: 0\n },\n containerTop,\n drops = this.drops;\n var parentRightEdge = $(window).width();\n\n if (!this.parentEl.is('body')) {\n parentOffset = {\n top: this.parentEl.offset().top - this.parentEl.scrollTop(),\n left: this.parentEl.offset().left - this.parentEl.scrollLeft()\n };\n parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left;\n }\n\n switch (drops) {\n case 'auto':\n containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top;\n\n if (containerTop + this.container.outerHeight() >= this.parentEl[0].scrollHeight) {\n containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top;\n drops = 'up';\n }\n\n break;\n\n case 'up':\n containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top;\n break;\n\n default:\n containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top;\n break;\n } // Force the container to it's actual width\n\n\n this.container.css({\n top: 0,\n left: 0,\n right: 'auto'\n });\n var containerWidth = this.container.outerWidth();\n this.container.toggleClass('drop-up', drops == 'up');\n\n if (this.opens == 'left') {\n var containerRight = parentRightEdge - this.element.offset().left - this.element.outerWidth();\n\n if (containerWidth + containerRight > $(window).width()) {\n this.container.css({\n top: containerTop,\n right: 'auto',\n left: 9\n });\n } else {\n this.container.css({\n top: containerTop,\n right: containerRight,\n left: 'auto'\n });\n }\n } else if (this.opens == 'center') {\n var containerLeft = this.element.offset().left - parentOffset.left + this.element.outerWidth() / 2 - containerWidth / 2;\n\n if (containerLeft < 0) {\n this.container.css({\n top: containerTop,\n right: 'auto',\n left: 9\n });\n } else if (containerLeft + containerWidth > $(window).width()) {\n this.container.css({\n top: containerTop,\n left: 'auto',\n right: 0\n });\n } else {\n this.container.css({\n top: containerTop,\n left: containerLeft,\n right: 'auto'\n });\n }\n } else {\n var containerLeft = this.element.offset().left - parentOffset.left;\n\n if (containerLeft + containerWidth > $(window).width()) {\n this.container.css({\n top: containerTop,\n left: 'auto',\n right: 0\n });\n } else {\n this.container.css({\n top: containerTop,\n left: containerLeft,\n right: 'auto'\n });\n }\n }\n },\n show: function show(e) {\n if (this.isShowing) return; // Create a click proxy that is private to this instance of datepicker, for unbinding\n\n this._outsideClickProxy = $.proxy(function (e) {\n this.outsideClick(e);\n }, this); // Bind global datepicker mousedown for hiding and\n\n $(document).on('mousedown.daterangepicker', this._outsideClickProxy) // also support mobile devices\n .on('touchend.daterangepicker', this._outsideClickProxy) // also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them\n .on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy) // and also close when focus changes to outside the picker (eg. tabbing between controls)\n .on('focusin.daterangepicker', this._outsideClickProxy); // Reposition the picker if the window is resized while it's open\n\n $(window).on('resize.daterangepicker', $.proxy(function (e) {\n this.move(e);\n }, this));\n this.oldStartDate = this.startDate.clone();\n this.oldEndDate = this.endDate.clone();\n this.previousRightTime = this.endDate.clone();\n this.updateView();\n this.container.show();\n this.move();\n this.element.trigger('show.daterangepicker', this);\n this.isShowing = true;\n },\n hide: function hide(e) {\n if (!this.isShowing) return; //incomplete date selection, revert to last values\n\n if (!this.endDate) {\n this.startDate = this.oldStartDate.clone();\n this.endDate = this.oldEndDate.clone();\n } //if a new date range was selected, invoke the user callback function\n\n\n if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate)) this.callback(this.startDate.clone(), this.endDate.clone(), this.chosenLabel); //if picker is attached to a text input, update it\n\n this.updateElement();\n $(document).off('.daterangepicker');\n $(window).off('.daterangepicker');\n this.container.hide();\n this.element.trigger('hide.daterangepicker', this);\n this.isShowing = false;\n },\n toggle: function toggle(e) {\n if (this.isShowing) {\n this.hide();\n } else {\n this.show();\n }\n },\n outsideClick: function outsideClick(e) {\n var target = $(e.target); // if the page is clicked anywhere except within the daterangerpicker/button\n // itself then call this.hide()\n\n if ( // ie modal dialog fix\n e.type == \"focusin\" || target.closest(this.element).length || target.closest(this.container).length || target.closest('.calendar-table').length) return;\n this.hide();\n this.element.trigger('outsideClick.daterangepicker', this);\n },\n showCalendars: function showCalendars() {\n this.container.addClass('show-calendar');\n this.move();\n this.element.trigger('showCalendar.daterangepicker', this);\n },\n hideCalendars: function hideCalendars() {\n this.container.removeClass('show-calendar');\n this.element.trigger('hideCalendar.daterangepicker', this);\n },\n clickRange: function clickRange(e) {\n var label = e.target.getAttribute('data-range-key');\n this.chosenLabel = label;\n\n if (label == this.locale.customRangeLabel) {\n this.showCalendars();\n } else {\n var dates = this.ranges[label];\n this.startDate = dates[0];\n this.endDate = dates[1];\n\n if (!this.timePicker) {\n this.startDate.startOf('day');\n this.endDate.endOf('day');\n }\n\n if (!this.alwaysShowCalendars) this.hideCalendars();\n this.clickApply();\n }\n },\n clickPrev: function clickPrev(e) {\n var cal = $(e.target).parents('.drp-calendar');\n\n if (cal.hasClass('left')) {\n this.leftCalendar.month.subtract(1, 'month');\n if (this.linkedCalendars) this.rightCalendar.month.subtract(1, 'month');\n } else {\n this.rightCalendar.month.subtract(1, 'month');\n }\n\n this.updateCalendars();\n },\n clickNext: function clickNext(e) {\n var cal = $(e.target).parents('.drp-calendar');\n\n if (cal.hasClass('left')) {\n this.leftCalendar.month.add(1, 'month');\n } else {\n this.rightCalendar.month.add(1, 'month');\n if (this.linkedCalendars) this.leftCalendar.month.add(1, 'month');\n }\n\n this.updateCalendars();\n },\n hoverDate: function hoverDate(e) {\n //ignore dates that can't be selected\n if (!$(e.target).hasClass('available')) return;\n var title = $(e.target).attr('data-title');\n var row = title.substr(1, 1);\n var col = title.substr(3, 1);\n var cal = $(e.target).parents('.drp-calendar');\n var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col]; //highlight the dates between the start date and the date being hovered as a potential end date\n\n var leftCalendar = this.leftCalendar;\n var rightCalendar = this.rightCalendar;\n var startDate = this.startDate;\n\n if (!this.endDate) {\n this.container.find('.drp-calendar tbody td').each(function (index, el) {\n //skip week numbers, only look at dates\n if ($(el).hasClass('week')) return;\n var title = $(el).attr('data-title');\n var row = title.substr(1, 1);\n var col = title.substr(3, 1);\n var cal = $(el).parents('.drp-calendar');\n var dt = cal.hasClass('left') ? leftCalendar.calendar[row][col] : rightCalendar.calendar[row][col];\n\n if (dt.isAfter(startDate) && dt.isBefore(date) || dt.isSame(date, 'day')) {\n $(el).addClass('in-range');\n } else {\n $(el).removeClass('in-range');\n }\n });\n }\n },\n clickDate: function clickDate(e) {\n if (!$(e.target).hasClass('available')) return;\n var title = $(e.target).attr('data-title');\n var row = title.substr(1, 1);\n var col = title.substr(3, 1);\n var cal = $(e.target).parents('.drp-calendar');\n var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col]; //\n // this function needs to do a few things:\n // * alternate between selecting a start and end date for the range,\n // * if the time picker is enabled, apply the hour/minute/second from the select boxes to the clicked date\n // * if autoapply is enabled, and an end date was chosen, apply the selection\n // * if single date picker mode, and time picker isn't enabled, apply the selection immediately\n // * if one of the inputs above the calendars was focused, cancel that manual input\n //\n\n if (this.endDate || date.isBefore(this.startDate, 'day')) {\n //picking start\n if (this.timePicker) {\n var hour = parseInt(this.container.find('.left .hourselect').val(), 10);\n\n if (!this.timePicker24Hour) {\n var ampm = this.container.find('.left .ampmselect').val();\n if (ampm === 'PM' && hour < 12) hour += 12;\n if (ampm === 'AM' && hour === 12) hour = 0;\n }\n\n var minute = parseInt(this.container.find('.left .minuteselect').val(), 10);\n\n if (isNaN(minute)) {\n minute = parseInt(this.container.find('.left .minuteselect option:last').val(), 10);\n }\n\n var second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0;\n date = date.clone().hour(hour).minute(minute).second(second);\n }\n\n this.endDate = null;\n this.setStartDate(date.clone());\n } else if (!this.endDate && date.isBefore(this.startDate)) {\n //special case: clicking the same date for start/end,\n //but the time of the end date is before the start date\n this.setEndDate(this.startDate.clone());\n } else {\n // picking end\n if (this.timePicker) {\n var hour = parseInt(this.container.find('.right .hourselect').val(), 10);\n\n if (!this.timePicker24Hour) {\n var ampm = this.container.find('.right .ampmselect').val();\n if (ampm === 'PM' && hour < 12) hour += 12;\n if (ampm === 'AM' && hour === 12) hour = 0;\n }\n\n var minute = parseInt(this.container.find('.right .minuteselect').val(), 10);\n\n if (isNaN(minute)) {\n minute = parseInt(this.container.find('.right .minuteselect option:last').val(), 10);\n }\n\n var second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0;\n date = date.clone().hour(hour).minute(minute).second(second);\n }\n\n this.setEndDate(date.clone());\n\n if (this.autoApply) {\n this.calculateChosenLabel();\n this.clickApply();\n }\n }\n\n if (this.singleDatePicker) {\n this.setEndDate(this.startDate);\n if (!this.timePicker && this.autoApply) this.clickApply();\n }\n\n this.updateView(); //This is to cancel the blur event handler if the mouse was in one of the inputs\n\n e.stopPropagation();\n },\n calculateChosenLabel: function calculateChosenLabel() {\n var customRange = true;\n var i = 0;\n\n for (var range in this.ranges) {\n if (this.timePicker) {\n var format = this.timePickerSeconds ? \"YYYY-MM-DD HH:mm:ss\" : \"YYYY-MM-DD HH:mm\"; //ignore times when comparing dates if time picker seconds is not enabled\n\n if (this.startDate.format(format) == this.ranges[range][0].format(format) && this.endDate.format(format) == this.ranges[range][1].format(format)) {\n customRange = false;\n this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').attr('data-range-key');\n break;\n }\n } else {\n //ignore times when comparing dates if time picker is not enabled\n if (this.startDate.format('YYYY-MM-DD') == this.ranges[range][0].format('YYYY-MM-DD') && this.endDate.format('YYYY-MM-DD') == this.ranges[range][1].format('YYYY-MM-DD')) {\n customRange = false;\n this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').attr('data-range-key');\n break;\n }\n }\n\n i++;\n }\n\n if (customRange) {\n if (this.showCustomRangeLabel) {\n this.chosenLabel = this.container.find('.ranges li:last').addClass('active').attr('data-range-key');\n } else {\n this.chosenLabel = null;\n }\n\n this.showCalendars();\n }\n },\n clickApply: function clickApply(e) {\n this.hide();\n this.element.trigger('apply.daterangepicker', this);\n },\n clickCancel: function clickCancel(e) {\n this.startDate = this.oldStartDate;\n this.endDate = this.oldEndDate;\n this.hide();\n this.element.trigger('cancel.daterangepicker', this);\n },\n monthOrYearChanged: function monthOrYearChanged(e) {\n var isLeft = $(e.target).closest('.drp-calendar').hasClass('left'),\n leftOrRight = isLeft ? 'left' : 'right',\n cal = this.container.find('.drp-calendar.' + leftOrRight); // Month must be Number for new moment versions\n\n var month = parseInt(cal.find('.monthselect').val(), 10);\n var year = cal.find('.yearselect').val();\n\n if (!isLeft) {\n if (year < this.startDate.year() || year == this.startDate.year() && month < this.startDate.month()) {\n month = this.startDate.month();\n year = this.startDate.year();\n }\n }\n\n if (this.minDate) {\n if (year < this.minDate.year() || year == this.minDate.year() && month < this.minDate.month()) {\n month = this.minDate.month();\n year = this.minDate.year();\n }\n }\n\n if (this.maxDate) {\n if (year > this.maxDate.year() || year == this.maxDate.year() && month > this.maxDate.month()) {\n month = this.maxDate.month();\n year = this.maxDate.year();\n }\n }\n\n if (isLeft) {\n this.leftCalendar.month.month(month).year(year);\n if (this.linkedCalendars) this.rightCalendar.month = this.leftCalendar.month.clone().add(1, 'month');\n } else {\n this.rightCalendar.month.month(month).year(year);\n if (this.linkedCalendars) this.leftCalendar.month = this.rightCalendar.month.clone().subtract(1, 'month');\n }\n\n this.updateCalendars();\n },\n timeChanged: function timeChanged(e) {\n var cal = $(e.target).closest('.drp-calendar'),\n isLeft = cal.hasClass('left');\n var hour = parseInt(cal.find('.hourselect').val(), 10);\n var minute = parseInt(cal.find('.minuteselect').val(), 10);\n\n if (isNaN(minute)) {\n minute = parseInt(cal.find('.minuteselect option:last').val(), 10);\n }\n\n var second = this.timePickerSeconds ? parseInt(cal.find('.secondselect').val(), 10) : 0;\n\n if (!this.timePicker24Hour) {\n var ampm = cal.find('.ampmselect').val();\n if (ampm === 'PM' && hour < 12) hour += 12;\n if (ampm === 'AM' && hour === 12) hour = 0;\n }\n\n if (isLeft) {\n var start = this.startDate.clone();\n start.hour(hour);\n start.minute(minute);\n start.second(second);\n this.setStartDate(start);\n\n if (this.singleDatePicker) {\n this.endDate = this.startDate.clone();\n } else if (this.endDate && this.endDate.format('YYYY-MM-DD') == start.format('YYYY-MM-DD') && this.endDate.isBefore(start)) {\n this.setEndDate(start.clone());\n }\n } else if (this.endDate) {\n var end = this.endDate.clone();\n end.hour(hour);\n end.minute(minute);\n end.second(second);\n this.setEndDate(end);\n } //update the calendars so all clickable dates reflect the new time component\n\n\n this.updateCalendars(); //update the form inputs above the calendars with the new time\n\n this.updateFormInputs(); //re-render the time pickers because changing one selection can affect what's enabled in another\n\n this.renderTimePicker('left');\n this.renderTimePicker('right');\n },\n elementChanged: function elementChanged() {\n if (!this.element.is('input')) return;\n if (!this.element.val().length) return;\n var dateString = this.element.val().split(this.locale.separator),\n start = null,\n end = null;\n\n if (dateString.length === 2) {\n start = moment(dateString[0], this.locale.format);\n end = moment(dateString[1], this.locale.format);\n }\n\n if (this.singleDatePicker || start === null || end === null) {\n start = moment(this.element.val(), this.locale.format);\n end = start;\n }\n\n if (!start.isValid() || !end.isValid()) return;\n this.setStartDate(start);\n this.setEndDate(end);\n this.updateView();\n },\n keydown: function keydown(e) {\n //hide on tab or enter\n if (e.keyCode === 9 || e.keyCode === 13) {\n this.hide();\n } //hide on esc and prevent propagation\n\n\n if (e.keyCode === 27) {\n e.preventDefault();\n e.stopPropagation();\n this.hide();\n }\n },\n updateElement: function updateElement() {\n if (this.element.is('input') && this.autoUpdateInput) {\n var newValue = this.startDate.format(this.locale.format);\n\n if (!this.singleDatePicker) {\n newValue += this.locale.separator + this.endDate.format(this.locale.format);\n }\n\n if (newValue !== this.element.val()) {\n this.element.val(newValue).trigger('change');\n }\n }\n },\n remove: function remove() {\n this.container.remove();\n this.element.off('.daterangepicker');\n this.element.removeData();\n }\n };\n\n $.fn.daterangepicker = function (options, callback) {\n var implementOptions = $.extend(true, {}, $.fn.daterangepicker.defaultOptions, options);\n this.each(function () {\n var el = $(this);\n if (el.data('daterangepicker')) el.data('daterangepicker').remove();\n el.data('daterangepicker', new DateRangePicker(el, implementOptions, callback));\n });\n return this;\n };\n\n return DateRangePicker;\n});","/* eslint-disable */\n\n/*\n * @pqina/flip v1.8.0 - A Beautifully Animated Flip Clock\n * Copyright (c) 2020 PQINA - https://pqina.nl/flip/\n */\n!function(){\"use strict\";function c(t){return\"function\"==typeof t||\"[object Function]\"===e.call(t)}function f(t){var e,n=(e=Number(t),isNaN(e)?0:0!==e&&isFinite(e)?(0>>0,r=arguments[1]>>0,i=r<0?Math.max(n+r,0):Math.min(r,n),o=arguments[2],a=void 0===o?n:o>>0,u=a<0?Math.max(n+a,0):Math.min(a,n);i>>0,r=arguments[1],i=0;i!==n;i++)if(t.call(r,this[i],i,e))return this[i]}}),Array.from||(Array.from=(e=Object.prototype.toString,r=Math.pow(2,53)-1,function(t,e,n){var r=Object(t);if(null==t)throw new TypeError(\"Array.from requires an array-like object - not null or undefined\");var i,o=1t.length)for(;r.definitions.length>t.length;){r.definitions.pop().presenter.destroy()}t.forEach(function(t,e){var n=r.definitions[e];n||(n=r.definitions[e]=ie(r.definition),r.update=i(n),n.presenter.appendTo(r.root,\"right\"===r.align?\"first\":\"last\"))}),t.forEach(function(t,e){return r.update(r.definitions[e],t)}),r.views=t,at(r)}function W(t,e){var n=document.createElement(t);return e&&(n.className=e),n}function Y(n,r,i){var t=new MutationObserver(function(e){r.forEach(function(t){e.filter(function(t){return r.includes(t.attributeName)}).length&&i(n.getAttribute(t))})});return t.observe(n,{attributes:!0}),t}function V(t){return t instanceof HTMLElement}function B(t,e,n,r){var i=3window.scrollY+window.innerHeight)}function $(t){return t.trim()}function X(t,e){var n=e.toString();return st[n]||(st[n]={}),st[n][t]||(st[n][t]=e(t)),st[n][t]}function Z(t){return t?parseFloat(t)*(/ms$/.test(t)?1:1e3):0}function J(t){return t.match(/[a-z]+(?:\\(.*?\\))?\\s?(?:origin\\(.*?\\))?\\s?(?:[a-z]+\\(.*?\\))?[ .a-z-0-9]*/g).map(wt)}function K(t){var e=t.match(/follow-gradient|horizontal-gradient|vertical-gradient/)[0];return{type:e,colors:t.substr(e.length).match(/(?:transparent|rgb\\(.*?\\)|hsl\\(.*?\\)|hsla\\(.*?\\)|rgba\\(.*?\\)|[a-z]+|#[abcdefABCDEF\\d]+)\\s?(?:[\\d]{1,3}%?)?/g).map(_t)}}function Q(t){return\"string\"!=typeof t?t:t.match(/([-.\\d]+(?:%|ms|s|deg|cm|em|ch|ex|q|in|mm|pc|pt|px|vh|vw|vmin|vmax)?)|[%#A-Za-z0-9,.()]+/g)}function tt(t){return t.trim().split(\"-\").map(function(t,e){return 0=t.destination||t.origin>=t.destination&&t.position<=t.destination)&&(e(),t.velocity=0,t.position=t.destination)})}},Lt=function(e,t){var n=1=t.destination||t.origin>=t.destination&&t.position<=t.destination)&&(e(),t.velocity=0,t.position=t.destination)})}},Ut=function(e,t,n,r){var i=1\"===i[o+1]?(c=!0,u.trim().length&&(l.push([u.trim()]),u=\"\"),e+=2):\",\"===f?(c&&u.trim().length&&(l.push([u.trim()]),u=\"\",c=!1),l=Xt(l,r),u=$t(r,u)):u+=f,e++}}return(c&&u.trim().length||!c&&u.trim().length&&!l.length)&&(l.push([u.trim()]),u=\"\"),Xt(l,r),$t(r,u),e}(0,t,e),e}function Jt(a){function u(e,t){e.transform(t,function(t){e.presenter.update(t)},a),n||(n=!0,r())}var n=!1,r=function t(){a.baseDefinition.presenter.draw(),requestAnimationFrame(t)};return function t(e){var n,r,i,o;return e.presenter=(r=t,o=void 0,(n=e).repeat?o=Yt(n.root,n.repeat,r):\"string\"==typeof n.view?o=Vt(n.view,n.root,n.style):(i=n).children&&i.children.length&&(o=Wt(n.root,n.children,r)),o),e.transform=ue(e.transform,a),u}(a.baseDefinition)}function Kt(i){for(var t=arguments.length,o=Array(1=h.Week-o.idle)return o.wait=!0,o;o.dist=a}else{o.time=f(O(r),o.day);var u=Je(o.time,e);if(u.wait)return o;o.time=O(m(r,o.time)&&u.date?u.date:u.from);var l=o.time-r;l<0&&o.time.setDate(o.time.getDate()+7),o.dist=l}return o.date=O(o.time),o}function je(t,e){return/januari|februari|march|april|may|june|july|august|september|october|november|december/.test(e)?function(n,e){var t=e.match(/januari|februari|march|april|may|june|july|august|september|october|november|december|[\\d]+th|\\dst|\\dnd|first|last|at\\s[\\d]+(?::[\\d]+)?(?::[\\d]+)?/g);if(1=h.Day-r.idle?r.wait=!0:(r.dist=i,r.date=O(r.time)),r):/hours|hour|minutes|minute|seconds|second/.test(e)?Je(t,e):null;var n,r,i}function qe(t,e){if(!0===t)return n=function(t){e(t.getTime()-b().getTime())},r=new XMLHttpRequest,i=Date.now(),r.open(\"HEAD\",window.location+\"?noCache=\"+i),r.setRequestHeader(\"Content-Type\",\"text/html\"),r.setRequestHeader(\"Cache-Control\",\"no-cache\"),r.onload=function(){var t=.5*(i-Date.now()),e=new Date(r.getResponseHeader(\"Date\"));n(new Date(e.getTime()+t))},void r.send();var n,r,i;\"string\"!=typeof t?setTimeout(function(){e(0)},0):setTimeout(function(){e(l(t).getTime()-b().getTime())},0)}function Ge(t){return it({complete:!1,offset:null,value:null,timer:null,onload:function(){},onupdate:function(){}},t)}function We(){var n=0=n.till)return n;if(n.interval>n.till-n.from)return n;var r=t-n.from,i=n.interval-r%n.interval;return null!==n.idle&&i>=n.interval-n.idle?n.wait=!0:(n.dist=i,n.date=new Date(t.getTime()+n.dist)),n},Ke={format:[\"d\",\"h\",\"m\",\"s\"],cascade:!0,server:null,interval:1e3},Qe=function(t,e,n,r){e[t]=n[t],r(Ae(e))},tn={ascii:function(){return function(t,e){return e((t+\"\").charCodeAt(0))}},char:function(t){var r=1(\"\"+t).length?\"left\"===r?(\"\"+n+t).slice(-n.length):(\"\"+t+n).substring(0,n.length):t)}},number:function(){var r=03||Math.abs(t.y)>3};n.pointerUp=function(t,e){this.emitEvent(\"pointerUp\",[t,e]);this._dragPointerUp(t,e)};n._dragPointerUp=function(t,e){if(this.isDragging){this._dragEnd(t,e)}else{this._staticClick(t,e)}};n._dragStart=function(t,e){this.isDragging=true;this.isPreventingClicks=true;this.dragStart(t,e)};n.dragStart=function(t,e){this.emitEvent(\"dragStart\",[t,e])};n._dragMove=function(t,e,i){if(!this.isDragging){return}this.dragMove(t,e,i)};n.dragMove=function(t,e,i){t.preventDefault();this.emitEvent(\"dragMove\",[t,e,i])};n._dragEnd=function(t,e){this.isDragging=false;setTimeout(function(){delete this.isPreventingClicks}.bind(this));this.dragEnd(t,e)};n.dragEnd=function(t,e){this.emitEvent(\"dragEnd\",[t,e])};n.onclick=function(t){if(this.isPreventingClicks){t.preventDefault()}};n._staticClick=function(t,e){if(this.isIgnoringMouseUp&&t.type==\"mouseup\"){return}this.staticClick(t,e);if(t.type!=\"mouseup\"){this.isIgnoringMouseUp=true;setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)}};n.staticClick=function(t,e){this.emitEvent(\"staticClick\",[t,e])};i.getPointerPoint=e.getPointerPoint;return i});\n/*!\n * Draggabilly v2.3.0\n * Make that shiz draggable\n * https://draggabilly.desandro.com\n * MIT license\n */\n(function(i,n){if(typeof define==\"function\"&&define.amd){define([\"get-size/get-size\",\"unidragger/unidragger\"],function(t,e){return n(i,t,e)})}else if(typeof module==\"object\"&&module.exports){module.exports=n(i,require(\"get-size\"),require(\"unidragger\"))}else{i.Draggabilly=n(i,i.getSize,i.Unidragger)}})(window,function t(r,u,e){function i(t,e){for(var i in e){t[i]=e[i]}return t}function n(){}var o=r.jQuery;function s(t,e){this.element=typeof t==\"string\"?document.querySelector(t):t;if(o){this.$element=o(this.element)}this.options=i({},this.constructor.defaults);this.option(e);this._create()}var a=s.prototype=Object.create(e.prototype);s.defaults={};a.option=function(t){i(this.options,t)};var h={relative:true,absolute:true,fixed:true};a._create=function(){this.position={};this._getPosition();this.startPoint={x:0,y:0};this.dragPoint={x:0,y:0};this.startPosition=i({},this.position);var t=getComputedStyle(this.element);if(!h[t.position]){this.element.style.position=\"relative\"}this.on(\"pointerMove\",this.onPointerMove);this.on(\"pointerUp\",this.onPointerUp);this.enable();this.setHandles()};a.setHandles=function(){this.handles=this.options.handle?this.element.querySelectorAll(this.options.handle):[this.element];this.bindHandles()};a.dispatchEvent=function(t,e,i){var n=[e].concat(i);this.emitEvent(t,n);this.dispatchJQueryEvent(t,e,i)};a.dispatchJQueryEvent=function(t,e,i){var n=r.jQuery;if(!n||!this.$element){return}var o=n.Event(e);o.type=t;this.$element.trigger(o,i)};a._getPosition=function(){var t=getComputedStyle(this.element);var e=this._getPositionCoord(t.left,\"width\");var i=this._getPositionCoord(t.top,\"height\");this.position.x=isNaN(e)?0:e;this.position.y=isNaN(i)?0:i;this._addTransformPosition(t)};a._getPositionCoord=function(t,e){if(t.indexOf(\"%\")!=-1){var i=u(this.element.parentNode);return!i?0:parseFloat(t)/100*i[e]}return parseInt(t,10)};a._addTransformPosition=function(t){var e=t.transform;if(e.indexOf(\"matrix\")!==0){return}var i=e.split(\",\");var n=e.indexOf(\"matrix3d\")===0?12:4;var o=parseInt(i[n],10);var r=parseInt(i[n+1],10);this.position.x+=o;this.position.y+=r};a.onPointerDown=function(t,e){this.element.classList.add(\"is-pointer-down\");this.dispatchJQueryEvent(\"pointerDown\",t,[e])};a.pointerDown=function(t,e){var i=this.okayPointerDown(t);if(!i||!this.isEnabled){this._pointerReset();return}this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};t.preventDefault();this.pointerDownBlur();this._bindPostStartEvents(t);this.element.classList.add(\"is-pointer-down\");this.dispatchEvent(\"pointerDown\",t,[e])};a.dragStart=function(t,e){if(!this.isEnabled){return}this._getPosition();this.measureContainment();this.startPosition.x=this.position.x;this.startPosition.y=this.position.y;this.setLeftTop();this.dragPoint.x=0;this.dragPoint.y=0;this.element.classList.add(\"is-dragging\");this.dispatchEvent(\"dragStart\",t,[e]);this.animate()};a.measureContainment=function(){var t=this.getContainer();if(!t){return}var e=u(this.element);var i=u(t);var n=this.element.getBoundingClientRect();var o=t.getBoundingClientRect();var r=i.borderLeftWidth+i.borderRightWidth;var s=i.borderTopWidth+i.borderBottomWidth;var a=this.relativeStartPosition={x:n.left-(o.left+i.borderLeftWidth),y:n.top-(o.top+i.borderTopWidth)};this.containSize={width:i.width-r-a.x-e.width,height:i.height-s-a.y-e.height}};a.getContainer=function(){var t=this.options.containment;if(!t){return}var e=t instanceof HTMLElement;if(e){return t}if(typeof t==\"string\"){return document.querySelector(t)}return this.element.parentNode};a.onPointerMove=function(t,e,i){this.dispatchJQueryEvent(\"pointerMove\",t,[e,i])};a.dragMove=function(t,e,i){if(!this.isEnabled){return}var n=i.x;var o=i.y;var r=this.options.grid;var s=r&&r[0];var a=r&&r[1];n=d(n,s);o=d(o,a);n=this.containDrag(\"x\",n,s);o=this.containDrag(\"y\",o,a);n=this.options.axis==\"y\"?0:n;o=this.options.axis==\"x\"?0:o;this.position.x=this.startPosition.x+n;this.position.y=this.startPosition.y+o;this.dragPoint.x=n;this.dragPoint.y=o;this.dispatchEvent(\"dragMove\",t,[e,i])};function d(t,e,i){i=i||\"round\";return e?Math[i](t/e)*e:t}a.containDrag=function(t,e,i){if(!this.options.containment){return e}var n=t==\"x\"?\"width\":\"height\";var o=this.relativeStartPosition[t];var r=d(-o,i,\"ceil\");var s=this.containSize[n];s=d(s,i,\"floor\");return Math.max(r,Math.min(s,e))};a.onPointerUp=function(t,e){this.element.classList.remove(\"is-pointer-down\");this.dispatchJQueryEvent(\"pointerUp\",t,[e])};a.dragEnd=function(t,e){if(!this.isEnabled){return}this.element.style.transform=\"\";this.setLeftTop();this.element.classList.remove(\"is-dragging\");this.dispatchEvent(\"dragEnd\",t,[e])};a.animate=function(){if(!this.isDragging){return}this.positionDrag();var e=this;requestAnimationFrame(function t(){e.animate()})};a.setLeftTop=function(){this.element.style.left=this.position.x+\"px\";this.element.style.top=this.position.y+\"px\"};a.positionDrag=function(){this.element.style.transform=\"translate3d( \"+this.dragPoint.x+\"px, \"+this.dragPoint.y+\"px, 0)\"};a.staticClick=function(t,e){this.dispatchEvent(\"staticClick\",t,[e])};a.setPosition=function(t,e){this.position.x=t;this.position.y=e;this.setLeftTop()};a.enable=function(){this.isEnabled=true};a.disable=function(){this.isEnabled=false;if(this.isDragging){this.dragEnd()}};a.destroy=function(){this.disable();this.element.style.transform=\"\";this.element.style.left=\"\";this.element.style.top=\"\";this.element.style.position=\"\";this.unbindHandles();if(this.$element){this.$element.removeData(\"draggabilly\")}};a._init=n;if(o&&o.bridget){o.bridget(\"draggabilly\",s)}return s});","/*!\n * imagesLoaded PACKAGED v4.1.4\n * JavaScript is all like \"You images are done yet or what?\"\n * MIT License\n */\n\n!function(e,t){\"function\"==typeof define&&define.amd?define(\"ev-emitter/ev-emitter\",t):\"object\"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}(\"undefined\"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return n.indexOf(t)==-1&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return n!=-1&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o0)&&d.items.push({score:c,id:e})}):g.iterator(g.items,function(a,b){d.items.push({score:1,id:b})}),e=g.getSortFunction(d,b),e&&d.items.sort(e),d.total=d.items.length,\"number\"==typeof b.limit&&(d.items=d.items.slice(0,b.limit)),d};var b=function(a,b){return\"number\"==typeof a&&\"number\"==typeof b?a>b?1:ab?1:b>a?-1:0)},c=function(a,b){var c,d,e,f;for(c=1,d=arguments.length;c=0&&a.data.length>0){var f=a.data.match(c),g=document.createElement(\"span\");g.className=\"highlight\";var h=a.splitText(e),i=(h.splitText(f[0].length),h.cloneNode(!0));g.appendChild(i),h.parentNode.replaceChild(g,h),b=1}}else if(1===a.nodeType&&a.childNodes&&!/(script|style)/i.test(a.tagName)&&(\"highlight\"!==a.className||\"SPAN\"!==a.tagName))for(var j=0;j/g,\">\").replace(/\"/g,\""\")},m={};m.before=function(a,b,c){var d=a[b];a[b]=function(){return c.apply(a,arguments),d.apply(a,arguments)}},m.after=function(a,b,c){var d=a[b];a[b]=function(){var b=d.apply(a,arguments);return c.apply(a,arguments),b}};var n=function(a){var b=!1;return function(){b||(b=!0,a.apply(this,arguments))}},o=function(a,b){var c;return function(){var d=this,e=arguments;window.clearTimeout(c),c=window.setTimeout(function(){a.apply(d,e)},b)}},p=function(a,b,c){var d,e=a.trigger,f={};a.trigger=function(){var c=arguments[0];if(-1===b.indexOf(c))return e.apply(a,arguments);f[c]=arguments},c.apply(a,[]),a.trigger=e;for(d in f)f.hasOwnProperty(d)&&e.apply(a,f[d])},q=function(a,b,c,d){a.on(b,c,function(b){for(var c=b.target;c&&c.parentNode!==a[0];)c=c.parentNode;return b.currentTarget=c,d.apply(this,[b])})},r=function(a){var b={};if(\"selectionStart\"in a)b.start=a.selectionStart,b.length=a.selectionEnd-b.start;else if(document.selection){a.focus();var c=document.selection.createRange(),d=document.selection.createRange().text.length;c.moveStart(\"character\",-a.value.length),b.start=c.text.length-d,b.length=d}return b},s=function(a,b,c){var d,e,f={};if(c)for(d=0,e=c.length;d\").css({position:\"absolute\",top:-99999,left:-99999,width:\"auto\",padding:0,whiteSpace:\"pre\"}).appendTo(\"body\")),w.$testInput.text(b),s(c,w.$testInput,[\"letterSpacing\",\"fontSize\",\"fontFamily\",\"fontWeight\",\"textTransform\"]),w.$testInput.width()):0},u=function(a){var b=null,c=function(c,d){var e,f,g,h,i,j,k,l;c=c||window.event||{},d=d||{},c.metaKey||c.altKey||(d.force||!1!==a.data(\"grow\"))&&(e=a.val(),c.type&&\"keydown\"===c.type.toLowerCase()&&(f=c.keyCode,g=f>=48&&f<=57||f>=65&&f<=90||f>=96&&f<=111||f>=186&&f<=222||32===f,46===f||8===f?(l=r(a[0]),l.length?e=e.substring(0,l.start)+e.substring(l.start+l.length):8===f&&l.start?e=e.substring(0,l.start-1)+e.substring(l.start+1):46===f&&void 0!==l.start&&(e=e.substring(0,l.start)+e.substring(l.start+1))):g&&(j=c.shiftKey,k=String.fromCharCode(c.keyCode),k=j?k.toUpperCase():k.toLowerCase(),e+=k)),h=a.attr(\"placeholder\"),!e&&h&&(e=h),(i=t(e,a)+4)!==b&&(b=i,a.width(i),a.triggerHandler(\"resize\")))};a.on(\"keydown keyup update blur\",c),c()},v=function(a){var b=document.createElement(\"div\");return b.appendChild(a.cloneNode(!0)),b.innerHTML},w=function(c,d){var e,f,g,h,i=this;h=c[0],h.selectize=i;var j=window.getComputedStyle&&window.getComputedStyle(h,null);if(g=j?j.getPropertyValue(\"direction\"):h.currentStyle&&h.currentStyle.direction,g=g||c.parents(\"[dir]:first\").attr(\"dir\")||\"\",a.extend(i,{order:0,settings:d,$input:c,tabIndex:c.attr(\"tabindex\")||\"\",tagType:\"select\"===h.tagName.toLowerCase()?1:2,rtl:/rtl/i.test(g),eventNS:\".selectize\"+ ++w.count,highlightedValue:null,isBlurring:!1,isOpen:!1,isDisabled:!1,isRequired:c.is(\"[required]\"),isInvalid:!1,isLocked:!1,isFocused:!1,isInputHidden:!1,isSetup:!1,isShiftDown:!1,isCmdDown:!1,isCtrlDown:!1,ignoreFocus:!1,ignoreBlur:!1,ignoreHover:!1,hasOptions:!1,currentResults:null,lastValue:\"\",caretPos:0,loading:0,loadedSearches:{},$activeOption:null,$activeItems:[],optgroups:{},options:{},userOptions:{},items:[],renderCache:{},onSearchChange:null===d.loadThrottle?i.onSearchChange:o(i.onSearchChange,d.loadThrottle)}),i.sifter=new b(this.options,{diacritics:d.diacritics}),i.settings.options){for(e=0,f=i.settings.options.length;e\").addClass(r.wrapperClass).addClass(m).addClass(l),c=a(\"\").addClass(r.inputClass).addClass(\"items\").appendTo(b),d=a('
').appendTo(c).attr(\"tabindex\",w.is(\":disabled\")?\"-1\":p.tabIndex),k=a(r.dropdownParent||b),e=a(\"
\").addClass(r.dropdownClass).addClass(l).hide().appendTo(k),j=a(\"
\").addClass(r.dropdownContentClass).appendTo(e),(o=w.attr(\"id\"))&&(d.attr(\"id\",o+\"-selectized\"),a(\"label[for='\"+o+\"']\").attr(\"for\",o+\"-selectized\")),p.settings.copyClassesToDropdown&&e.addClass(m),b.css({width:w[0].style.width}),p.plugins.names.length&&(n=\"plugin-\"+p.plugins.names.join(\" plugin-\"),b.addClass(n),e.addClass(n)),(null===r.maxItems||r.maxItems>1)&&1===p.tagType&&w.attr(\"multiple\",\"multiple\"),p.settings.placeholder&&d.attr(\"placeholder\",r.placeholder),!p.settings.splitOn&&p.settings.delimiter){var x=p.settings.delimiter.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\");p.settings.splitOn=new RegExp(\"\\\\s*\"+x+\"+\\\\s*\")}w.attr(\"autocorrect\")&&d.attr(\"autocorrect\",w.attr(\"autocorrect\")),w.attr(\"autocapitalize\")&&d.attr(\"autocapitalize\",w.attr(\"autocapitalize\")),d[0].type=w[0].type,p.$wrapper=b,p.$control=c,p.$control_input=d,p.$dropdown=e,p.$dropdown_content=j,e.on(\"mouseenter mousedown click\",\"[data-disabled]>[data-selectable]\",function(a){a.stopImmediatePropagation()}),e.on(\"mouseenter\",\"[data-selectable]\",function(){return p.onOptionHover.apply(p,arguments)}),e.on(\"mousedown click\",\"[data-selectable]\",function(){return p.onOptionSelect.apply(p,arguments)}),q(c,\"mousedown\",\"*:not(input)\",function(){return p.onItemSelect.apply(p,arguments)}),u(d),c.on({mousedown:function(){return p.onMouseDown.apply(p,arguments)},click:function(){return p.onClick.apply(p,arguments)}}),d.on({mousedown:function(a){a.stopPropagation()},keydown:function(){return p.onKeyDown.apply(p,arguments)},keyup:function(){return p.onKeyUp.apply(p,arguments)},keypress:function(){return p.onKeyPress.apply(p,arguments)},resize:function(){p.positionDropdown.apply(p,[])},blur:function(){return p.onBlur.apply(p,arguments)},focus:function(){return p.ignoreBlur=!1,p.onFocus.apply(p,arguments)},paste:function(){return p.onPaste.apply(p,arguments)}}),v.on(\"keydown\"+s,function(a){p.isCmdDown=a[f?\"metaKey\":\"ctrlKey\"],p.isCtrlDown=a[f?\"altKey\":\"ctrlKey\"],p.isShiftDown=a.shiftKey}),v.on(\"keyup\"+s,function(a){a.keyCode===h&&(p.isCtrlDown=!1),16===a.keyCode&&(p.isShiftDown=!1),a.keyCode===g&&(p.isCmdDown=!1)}),v.on(\"mousedown\"+s,function(a){if(p.isFocused){if(a.target===p.$dropdown[0]||a.target.parentNode===p.$dropdown[0])return!1;p.$control.has(a.target).length||a.target===p.$control[0]||p.blur(a.target)}}),t.on([\"scroll\"+s,\"resize\"+s].join(\" \"),function(){p.isOpen&&p.positionDropdown.apply(p,arguments)}),t.on(\"mousemove\"+s,function(){p.ignoreHover=!1}),this.revertSettings={$children:w.children().detach(),tabindex:w.attr(\"tabindex\")},w.attr(\"tabindex\",-1).hide().after(p.$wrapper),a.isArray(r.items)&&(p.setValue(r.items),delete r.items),i&&w.on(\"invalid\"+s,function(a){a.preventDefault(),p.isInvalid=!0,p.refreshState()}),p.updateOriginalInput(),p.refreshItems(),p.refreshState(),p.updatePlaceholder(),p.isSetup=!0,w.is(\":disabled\")&&p.disable(),p.on(\"change\",this.onChange),w.data(\"selectize\",p),w.addClass(\"selectized\"),p.trigger(\"initialize\"),!0===r.preload&&p.onSearchChange(\"\")},setupTemplates:function(){var b=this,c=b.settings.labelField,d=b.settings.optgroupLabelField,e={optgroup:function(a){return'
'+a.html+\"
\"},optgroup_header:function(a,b){return'\"},option:function(a,b){return'
'+b(a[c])+\"
\"},item:function(a,b){return'
'+b(a[c])+\"
\"},option_create:function(a,b){return'
Add '+b(a.input)+\"…
\"}};b.settings.render=a.extend({},e,b.settings.render)},setupCallbacks:function(){var a,b,c={initialize:\"onInitialize\",change:\"onChange\",item_add:\"onItemAdd\",item_remove:\"onItemRemove\",clear:\"onClear\",option_add:\"onOptionAdd\",option_remove:\"onOptionRemove\",option_clear:\"onOptionClear\",optgroup_add:\"onOptionGroupAdd\",optgroup_remove:\"onOptionGroupRemove\",optgroup_clear:\"onOptionGroupClear\",dropdown_open:\"onDropdownOpen\",dropdown_close:\"onDropdownClose\",type:\"onType\",load:\"onLoad\",focus:\"onFocus\",blur:\"onBlur\"};for(a in c)c.hasOwnProperty(a)&&(b=this.settings[c[a]])&&this.on(a,b)},onClick:function(a){var b=this;b.isFocused&&b.isOpen||(b.focus(),a.preventDefault())},onMouseDown:function(b){var c=this,d=b.isDefaultPrevented();a(b.target);if(c.isFocused){if(b.target!==c.$control_input[0])return\"single\"===c.settings.mode?c.isOpen?c.close():c.open():d||c.setActiveItem(null),!1}else d||window.setTimeout(function(){c.focus()},0)},onChange:function(){this.$input.trigger(\"change\")},onPaste:function(b){var c=this;if(c.isFull()||c.isInputHidden||c.isLocked)return void b.preventDefault();c.settings.splitOn&&setTimeout(function(){var b=c.$control_input.val();if(b.match(c.settings.splitOn))for(var d=a.trim(b).split(c.settings.splitOn),e=0,f=d.length;e
h&&(j=g,g=h,h=j),e=g;e<=h;e++)i=l.$control[0].childNodes[e],-1===l.$activeItems.indexOf(i)&&(a(i).addClass(\"active\"),l.$activeItems.push(i));c.preventDefault()}else\"mousedown\"===d&&l.isCtrlDown||\"keydown\"===d&&this.isShiftDown?b.hasClass(\"active\")?(f=l.$activeItems.indexOf(b[0]),l.$activeItems.splice(f,1),b.removeClass(\"active\")):l.$activeItems.push(b.addClass(\"active\")[0]):(a(l.$activeItems).removeClass(\"active\"),l.$activeItems=[b.addClass(\"active\")[0]]);l.hideInput(),this.isFocused||l.focus()}},setActiveOption:function(b,c,d){var e,f,g,h,i,k=this;k.$activeOption&&k.$activeOption.removeClass(\"active\"),k.$activeOption=null,b=a(b),b.length&&(k.$activeOption=b.addClass(\"active\"),!c&&j(c)||(e=k.$dropdown_content.height(),f=k.$activeOption.outerHeight(!0),c=k.$dropdown_content.scrollTop()||0,g=k.$activeOption.offset().top-k.$dropdown_content.offset().top+c,h=g,i=g-e+f,g+f>e+c?k.$dropdown_content.stop().animate({scrollTop:i},d?k.settings.scrollDuration:0):g=0;c--)-1!==f.items.indexOf(k(d.items[c].id))&&d.items.splice(c,1);return d},refreshOptions:function(b){var c,e,f,g,h,i,j,l,m,n,o,p,q,r,s,t;void 0===b&&(b=!0);var u=this,w=a.trim(u.$control_input.val()),x=u.search(w),y=u.$dropdown_content,z=u.$activeOption&&k(u.$activeOption.attr(\"data-value\"));for(g=x.items.length,\"number\"==typeof u.settings.maxOptions&&(g=Math.min(g,u.settings.maxOptions)),h={},i=[],c=0;c0||q,u.hasOptions?(x.items.length>0?(s=z&&u.getOption(z),s&&s.length?r=s:\"single\"===u.settings.mode&&u.items.length&&(r=u.getOption(u.items[0])),r&&r.length||(r=t&&!u.settings.addPrecedence?u.getAdjacentOption(t,1):y.find(\"[data-selectable]:first\"))):r=t,u.setActiveOption(r),b&&!u.isOpen&&u.open()):(u.setActiveOption(null),b&&u.isOpen&&u.close())},addOption:function(b){var c,d,e,f=this;if(a.isArray(b))for(c=0,d=b.length;c=0&&e0),b.$control_input.data(\"grow\",!c&&!d)},isFull:function(){\nreturn null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems},updateOriginalInput:function(a){var b,c,d,e,f=this;if(a=a||{},1===f.tagType){for(d=[],b=0,c=f.items.length;b'+l(e)+\"\");d.length||this.$input.attr(\"multiple\")||d.push(''),f.$input.html(d.join(\"\"))}else f.$input.val(f.getValue()),f.$input.attr(\"value\",f.$input.val());f.isSetup&&(a.silent||f.trigger(\"change\",f.$input.val()))},updatePlaceholder:function(){if(this.settings.placeholder){var a=this.$control_input;this.items.length?a.removeAttr(\"placeholder\"):a.attr(\"placeholder\",this.settings.placeholder),a.triggerHandler(\"update\",{force:!0})}},open:function(){var a=this;a.isLocked||a.isOpen||\"multi\"===a.settings.mode&&a.isFull()||(a.focus(),a.isOpen=!0,a.refreshState(),a.$dropdown.css({visibility:\"hidden\",display:\"block\"}),a.positionDropdown(),a.$dropdown.css({visibility:\"visible\"}),a.trigger(\"dropdown_open\",a.$dropdown))},close:function(){var a=this,b=a.isOpen;\"single\"===a.settings.mode&&a.items.length&&(a.hideInput(),a.isBlurring||a.$control_input.blur()),a.isOpen=!1,a.$dropdown.hide(),a.setActiveOption(null),a.refreshState(),b&&a.trigger(\"dropdown_close\",a.$dropdown)},positionDropdown:function(){var a=this.$control,b=\"body\"===this.settings.dropdownParent?a.offset():a.position();b.top+=a.outerHeight(!0),this.$dropdown.css({width:a[0].getBoundingClientRect().width,top:b.top,left:b.left})},clear:function(a){var b=this;b.items.length&&(b.$control.children(\":not(input)\").remove(),b.items=[],b.lastQuery=null,b.setCaret(0),b.setActiveItem(null),b.updatePlaceholder(),b.updateOriginalInput({silent:a}),b.refreshState(),b.showInput(),b.trigger(\"clear\"))},insertAtCaret:function(a){var b=Math.min(this.caretPos,this.items.length),c=a[0],d=this.buffer||this.$control[0];0===b?d.insertBefore(c,d.firstChild):d.insertBefore(c,d.childNodes[b]),this.setCaret(b+1)},deleteSelection:function(b){var c,d,e,f,g,h,i,j,k,l=this;if(e=b&&8===b.keyCode?-1:1,f=r(l.$control_input[0]),l.$activeOption&&!l.settings.hideSelected&&(i=l.getAdjacentOption(l.$activeOption,-1).attr(\"data-value\")),g=[],l.$activeItems.length){for(k=l.$control.children(\".active:\"+(e>0?\"last\":\"first\")),h=l.$control.children(\":not(input)\").index(k),e>0&&h++,c=0,d=l.$activeItems.length;c0&&f.start===l.$control_input.val().length&&g.push(l.items[l.caretPos]));if(!g.length||\"function\"==typeof l.settings.onDelete&&!1===l.settings.onDelete.apply(l,[g]))return!1;for(void 0!==h&&l.setCaret(h);g.length;)l.removeItem(g.pop());return l.showInput(),l.positionDropdown(),l.refreshOptions(!0),i&&(j=l.getOption(i),j.length&&l.setActiveOption(j)),!0},advanceSelection:function(a,b){var c,d,e,f,g,h=this;0!==a&&(h.rtl&&(a*=-1),c=a>0?\"last\":\"first\",d=r(h.$control_input[0]),h.isFocused&&!h.isInputHidden?(f=h.$control_input.val().length,(a<0?0===d.start&&0===d.length:d.start===f)&&!f&&h.advanceCaret(a,b)):(g=h.$control.children(\".active:\"+c),g.length&&(e=h.$control.children(\":not(input)\").index(g),h.setActiveItem(null),h.setCaret(a>0?e+1:e))))},advanceCaret:function(a,b){var c,d,e=this;0!==a&&(c=a>0?\"next\":\"prev\",e.isShiftDown?(d=e.$control_input[c](),d.length&&(e.hideInput(),e.setActiveItem(d),b&&b.preventDefault())):e.setCaret(e.caretPos+a))},setCaret:function(b){var c=this;if(b=\"single\"===c.settings.mode?c.items.length:Math.max(0,Math.min(c.items.length,b)),!c.isPending){var d,e,f,g;for(f=c.$control.children(\":not(input)\"),d=0,e=f.length;d'}},b),c.setup=function(){var d=c.setup;return function(){d.apply(c,arguments),c.$dropdown_header=a(b.html(b)),c.$dropdown.prepend(c.$dropdown_header)}}()}),w.define(\"optgroup_columns\",function(b){var c=this;b=a.extend({equalizeWidth:!0,equalizeHeight:!0},b),this.getAdjacentOption=function(b,c){var d=b.closest(\"[data-group]\").find(\"[data-selectable]\"),e=d.index(b)+c;return e>=0&&e
',a=a.firstChild,c.body.appendChild(a),b=d.width=a.offsetWidth-a.clientWidth,c.body.removeChild(a)),b},e=function(){var e,f,g,h,i,j,k;if(k=a(\"[data-group]\",c.$dropdown_content),(f=k.length)&&c.$dropdown_content.width()){if(b.equalizeHeight){for(g=0,e=0;e
1&&(i=j-h*(f-1),k.eq(f-1).css({width:i})))}};(b.equalizeHeight||b.equalizeWidth)&&(m.after(this,\"positionDropdown\",e),m.after(this,\"refreshOptions\",e))}),w.define(\"remove_button\",function(b){b=a.extend({label:\"×\",title:\"Remove\",className:\"remove\",append:!0},b);if(\"single\"===this.settings.mode)return void function(b,c){c.className=\"remove-single\";var d=b,e=''+c.label+\"\",f=function(b,c){return a(\"\").append(b).append(c)};b.setup=function(){var g=d.setup;return function(){if(c.append){var h=a(d.$input.context).attr(\"id\"),i=(a(\"#\"+h),d.settings.render.item);d.settings.render.item=function(a){return f(i.apply(b,arguments),e)}}g.apply(b,arguments),b.$control.on(\"click\",\".\"+c.className,function(a){a.preventDefault(),d.isLocked||d.clear()})}}()}(this,b);!function(b,c){var d=b,e=''+c.label+\"\",f=function(a,b){var c=a.search(/(<\\/[^>]+>\\s*)$/);return a.substring(0,c)+b+a.substring(c)};b.setup=function(){var g=d.setup;return function(){if(c.append){var h=d.settings.render.item;d.settings.render.item=function(a){return f(h.apply(b,arguments),e)}}g.apply(b,arguments),b.$control.on(\"click\",\".\"+c.className,function(b){if(b.preventDefault(),!d.isLocked){var c=a(b.currentTarget).parent();d.setActiveItem(c),d.deleteSelection()&&d.setCaret(d.items.length)}})}}()}(this,b)}),w.define(\"restore_on_backspace\",function(a){var b=this;a.text=a.text||function(a){return a[this.settings.labelField]},this.onKeyDown=function(){var c=b.onKeyDown;return function(b){var d,e;return 8===b.keyCode&&\"\"===this.$control_input.val()&&!this.$activeItems.length&&(d=this.caretPos-1)>=0&&d 0? element.selectedIndex : 0;\n\n\t\t\t// Need to use dummy element to measure :(\n\t\t\tvar option = document.createElement(\"_\");\n\t\t\toption.textContent = element.options[selectedIndex].textContent;\n\t\t\telement.parentNode.insertBefore(option, element.nextSibling);\n\n\t\t\t// The name of the appearance property, as it might be prefixed\n\t\t\tvar appearance;\n\n\t\t\tfor (var property in cs) {\n\t\t\t\tvar value = cs[property];\n\t\t\t\tif (!/^(width|webkitLogicalWidth|length)$/.test(property) && typeof value == \"string\") {\n\t\t\t\t\toption.style[property] = value;\n\n\t\t\t\t\tif (/appearance$/i.test(property)) {\n\t\t\t\t\t\tappearance = property;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\toption.style.width = \"\";\n\n\t\t\tif (option.offsetWidth > 0) {\n\t\t\t\telement.style.width = option.offsetWidth + \"px\";\n\n\t\t\t\tif (!cs[appearance] || cs[appearance] !== \"none\") {\n\t\t\t\t\t// Account for arrow\n\t\t\t\t\telement.style.width = \"calc(\" + element.style.width + \" + 2em)\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\toption.parentNode.removeChild(option);\n\t\t\toption = null;\n\t\t}\n\n\t\tif (empty) {\n\t\t\telement.value = \"\";\n\t\t}\n\t},\n\n\t// Autosize multiple elements\n\tresizeAll: function(elements) {\n\t\t$$(elements || _.selectors.base).forEach(function (element) {\n\t\t\t_.resize(element);\n\t\t});\n\t},\n\n\tactive: true,\n\n\t// Will stretchy do anything for this element?\n\tresizes: function(element) {\n\t\treturn element &&\n\t\t element.parentNode &&\n\t\t element.matches &&\n\t\t element.matches(_.selectors.base) &&\n\t\t element.matches(_.selectors.filter);\n\t},\n\n\tinit: function(){\n\t\t_.selectors.filter = _.script.getAttribute(\"data-filter\") ||\n\t\t ($$(\"[data-stretchy-filter]\").pop() || document.body).getAttribute(\"data-stretchy-filter\") || _.selectors.filter;\n\n\t\t_.resizeAll();\n\n\t\t// Listen for new elements\n\t\tif (self.MutationObserver && !_.observer) {\n\t\t\t_.observer = new MutationObserver(function(mutations) {\n\t\t\t\tif (_.active) {\n\t\t\t\t\tmutations.forEach(function(mutation) {\n\t\t\t\t\t\tif (mutation.type == \"childList\") {\n\t\t\t\t\t\t\t_.resizeAll(mutation.addedNodes);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t\t_.observer.observe(document.documentElement, {\n\t\t\t\tchildList: true,\n\t\t\t\tsubtree: true\n\t\t\t});\n\t\t}\n\t},\n\n\t$$: $$\n};\n\n// Autosize all elements once the DOM is loaded\n\n// DOM already loaded?\nif (document.readyState !== \"loading\") {\n\trequestAnimationFrame(_.init);\n}\nelse {\n\t// Wait for it\n\tdocument.addEventListener(\"DOMContentLoaded\", _.init);\n}\n\nwindow.addEventListener(\"load\", function(){\n\t_.resizeAll();\n});\n\n// Listen for changes\nvar listener = function(evt) {\n\tif (_.active) {\n\t\t_.resize(evt.target);\n\t}\n};\n\ndocument.documentElement.addEventListener(\"input\", listener);\n\n// Firefox fires a change event instead of an input event\ndocument.documentElement.addEventListener(\"change\", listener);\n\n})();\n","// Stretchy.selectors.base = Stretchy.selectors.base + ', input[type=\"anyother\"]';\nStretchy.selectors.filter = \".stretchy, .stretchy *\";","jQuery.fn.swapWith = function(to) {\n return this.each(function() {\n var copy_to = $(to).clone(true);\n var copy_from = $(this).clone(true);\n $(to).replaceWith(copy_from);\n $(this).replaceWith(copy_to);\n });\n};","$(document).on('turbolinks:load', function() {\n\tsetTimeout(function() {\n\t\tlet url = new URL(window.location.href)\n\t\tlet scrollId = 'reacher-' + url.searchParams.get(\"reacher\")\n\t\tlet element = document.getElementById(scrollId)\n\t\tif (element) {\n\t\t\telement.scrollIntoView({ behavior: \"smooth\", block: \"center\" })\n\n\t\t\t$(document).on('mouseup', (event) => {\n\t\t\t\tlet container = $(element)\n\n\t\t\t\tif (!container.is(event.target) && container.has(event.target).length === 0) {\n\t\t\t\t\tif (container.is(`#${scrollId}`)) {\n\t\t\t\t\t\tcontainer.removeAttr('id')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}, 500)\n})\n","$(document).on('turbolinks:load', function() {\n\t// Scroll page sections\n\tvar $root = $('html, body');\n\t$('.scroll-page').click(function() {\n\t $root.animate({\n\t scrollTop: $( $.attr(this, 'href') ).offset().top - 0\n\t }, 500);\n\t return false;\n\t});\n\n\tif($('.about-page').length) {\n\t\t// Move the infographic down in the about page\n\t\toffset_top = $('.about-page #section-3 .wrapper .right-side').offset().top - 100;\n\t\toffset_bottom = $('.about-page #section-3 .wrapper .right-side').offset().top + $('.about-page #section-3 .wrapper .right-side').height() - $('.about-page #section-3 .wrapper .left-side figure').height() - 200;\n\t\t$(document).scroll(function() {\n\t\t\tvar scroll = $(this).scrollTop();\n\t\t\tif ((scroll >= offset_top) && (scroll <= offset_bottom)) {\n\t\t\t\t$('.about-page #section-3 .wrapper .left-side figure').css('margin-top', (scroll - offset_top + 25));\n\t\t\t}\n\t\t});\n\t}\n\n\t// public header menu button\n\t$('header.public-header .top-header .menu-items .menu-button a').click(function() {\n\t\t$('.public-header .top-header .menu-items menu').toggleClass('active');\n\t\t$(this).toggleClass('active');\n\t\treturn false\n\t});\n\t\n\t$('.homepage-ecommerce .landing-section').css('min-height', $(window).height());\n\n\tif($('.homepage-ecommerce .contact-button').length) {\n\t\t$(window).scroll(function() {\n\t\t if ($(this).scrollTop() > ($('body').height() - $('footer').height() - 800)) { //use `this`, not `document`\n\t\t $('.homepage-ecommerce .contact-button').fadeOut();\n\t\t } else {\n\t\t \t$('.homepage-ecommerce .contact-button').fadeIn();\n\t\t }\n\t\t});\n\t}\n});\n\n$(document).on('click', '.homepage-ecommerce .contact-button a.contact-button-click', function() {\n\t$(this).siblings('.display-area').fadeToggle();\n\treturn false;\n});\n\n$(document).on(\"ajax:beforeSend\", \".homepage-ecommerce form[data-remote].action-form\", function(e, data, status, xhr) {\n\tform_element = $(this);\n\tform_element.find('input[type=\"submit\"]').addClass('inactive');\n\tform_element.find('.ajax-loader').addClass('active');\n});\n\n$(document).on(\"ajax:complete\", \".homepage-ecommerce form[data-remote].action-form\", function(e, xhr, status, error) {\n\tform_element = $(this);\n\tform_element.find('input[type=\"submit\"]').removeClass('inactive');\n\tform_element.find('.ajax-loader').removeClass('active');\t\n});\n","// Load all the controllers within this directory and all subdirectories. \n// Controller files must be named *_controller.js.\n\nimport { Application } from \"stimulus\"\nimport { definitionsFromContext } from \"stimulus/webpack-helpers\"\n\nconst application = Application.start()\nconst context = require.context(\"controllers\", true, /_controller\\.js$/)\napplication.load(definitionsFromContext(context))\n","export function definitionsFromContext(context) {\n return context.keys().map(function (key) {\n return definitionForModuleWithContextAndKey(context, key);\n }).filter(function (value) {\n return value;\n });\n}\n\nfunction definitionForModuleWithContextAndKey(context, key) {\n var identifier = identifierForContextKey(key);\n\n if (identifier) {\n return definitionForModuleAndIdentifier(context(key), identifier);\n }\n}\n\nfunction definitionForModuleAndIdentifier(module, identifier) {\n var controllerConstructor = module.default;\n\n if (typeof controllerConstructor == \"function\") {\n return {\n identifier: identifier,\n controllerConstructor: controllerConstructor\n };\n }\n}\n\nexport function identifierForContextKey(key) {\n var logicalName = (key.match(/^(?:\\.\\/)?(.+)(?:[_-]controller\\..+?)$/) || [])[1];\n\n if (logicalName) {\n return logicalName.replace(/_/g, \"-\").replace(/\\//g, \"--\");\n }\n}","// This file is automatically compiled by Webpack, along with any other files\n// present in this directory. You're encouraged to place your actual application logic in\n// a relevant structure within app/javascript and only use these pack files to reference\n// that code so it'll be compiled.\n\nimport Rails from \"@rails/ujs\"\nimport Turbolinks from \"turbolinks\"\nimport * as ActiveStorage from \"@rails/activestorage\"\nimport \"channels\"\n\nRails.start()\nTurbolinks.start()\nActiveStorage.start()\n\nimport \"controllers\"\n\n// ---------- Application Specific JS ---------- //\n\nrequire(\"trix\")\nrequire(\"@rails/actiontext\")\n\nrequire(\"jquery\")\nrequire('jquery-ui/themes/base/core.css')\nrequire('jquery-ui/themes/base/menu.css')\nrequire('jquery-ui/themes/base/draggable.css')\nrequire('jquery-ui/themes/base/resizable.css')\nrequire('jquery-ui/themes/base/sortable.css')\nrequire('jquery-ui/themes/base/theme.css')\nrequire(\"jquery-ui/ui/widgets/draggable\")\nrequire(\"jquery-ui/ui/widgets/resizable\")\nrequire(\"jquery-ui/ui/widgets/sortable\")\n\nrequire(\"local-time\").start()\nrequire(\"daterangepicker\")\nrequire(\"moment\")\nrequire(\"utilities/flip.min\")\nrequire(\"views/application\")\n\n// Stylesheets\nimport '../stylesheets/application'\n","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { DirectUpload } from \"@rails/activestorage\";\nexport var AttachmentUpload = /*#__PURE__*/function () {\n function AttachmentUpload(attachment, element) {\n _classCallCheck(this, AttachmentUpload);\n\n this.attachment = attachment;\n this.element = element;\n this.directUpload = new DirectUpload(attachment.file, this.directUploadUrl, this);\n }\n\n _createClass(AttachmentUpload, [{\n key: \"start\",\n value: function start() {\n this.directUpload.create(this.directUploadDidComplete.bind(this));\n }\n }, {\n key: \"directUploadWillStoreFileWithXHR\",\n value: function directUploadWillStoreFileWithXHR(xhr) {\n var _this = this;\n\n xhr.upload.addEventListener(\"progress\", function (event) {\n var progress = event.loaded / event.total * 100;\n\n _this.attachment.setUploadProgress(progress);\n });\n }\n }, {\n key: \"directUploadDidComplete\",\n value: function directUploadDidComplete(error, attributes) {\n if (error) {\n throw new Error(\"Direct upload failed: \".concat(error));\n }\n\n this.attachment.setAttributes({\n sgid: attributes.attachable_sgid,\n url: this.createBlobUrl(attributes.signed_id, attributes.filename)\n });\n }\n }, {\n key: \"createBlobUrl\",\n value: function createBlobUrl(signedId, filename) {\n return this.blobUrlTemplate.replace(\":signed_id\", signedId).replace(\":filename\", encodeURIComponent(filename));\n }\n }, {\n key: \"directUploadUrl\",\n get: function get() {\n return this.element.dataset.directUploadUrl;\n }\n }, {\n key: \"blobUrlTemplate\",\n get: function get() {\n return this.element.dataset.blobUrlTemplate;\n }\n }]);\n\n return AttachmentUpload;\n}();","import { AttachmentUpload } from \"./attachment_upload\";\naddEventListener(\"trix-attachment-add\", function (event) {\n var attachment = event.attachment,\n target = event.target;\n\n if (attachment.file) {\n var upload = new AttachmentUpload(attachment, target);\n upload.start();\n }\n});"],"sourceRoot":""}