1!function r(e, n, t) { 2 function o(i, f) { 3 if (!n[i]) { 4 if (!e[i]) { 5 var c = "function" == typeof require && require; 6 if (!f && c) return c(i, !0); 7 if (u) return u(i, !0); 8 var a = new Error("Cannot find module '" + i + "'"); 9 throw a.code = "MODULE_NOT_FOUND", a; 10 } 11 var p = n[i] = { 12 exports: {} 13 }; 14 e[i][0].call(p.exports, function(r) { 15 return o(e[i][1][r] || r); 16 }, p, p.exports, r, e, n, t); 17 } 18 return n[i].exports; 19 } 20 for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) o(t[i]); 21 return o; 22}({ 23 1: [ function(require, module, exports) { 24 "use strict"; 25 Object.defineProperty(exports, "__esModule", { 26 value: !0 27 }), exports.default = void 0, require("core-js/modules/es6.regexp.to-string"), require("core-js/modules/es6.date.to-string"), 28 require("core-js/modules/es7.symbol.async-iterator"), require("core-js/modules/es7.object.get-own-property-descriptors"), 29 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 30 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 31 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.function.name"), 32 require("core-js/modules/es6.string.iterator"), require("core-js/modules/es6.array.from"); 33 var _heifer = require("./../utilities/heifer.utilities"); 34 function _toConsumableArray(arr) { 35 return function(arr) { 36 if (Array.isArray(arr)) { 37 for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; 38 return arr2; 39 } 40 }(arr) || function(iter) { 41 if (Symbol.iterator in Object(iter) || "[object Arguments]" === Object.prototype.toString.call(iter)) return Array.from(iter); 42 }(arr) || function() { 43 throw new TypeError("Invalid attempt to spread non-iterable instance"); 44 }(); 45 } 46 function ownKeys(object, enumerableOnly) { 47 var keys = Object.keys(object); 48 if (Object.getOwnPropertySymbols) { 49 var symbols = Object.getOwnPropertySymbols(object); 50 enumerableOnly && (symbols = symbols.filter(function(sym) { 51 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 52 })), keys.push.apply(keys, symbols); 53 } 54 return keys; 55 } 56 function _objectSpread(target) { 57 for (var i = 1; i < arguments.length; i++) { 58 var source = null != arguments[i] ? arguments[i] : {}; 59 i % 2 ? ownKeys(source, !0).forEach(function(key) { 60 _defineProperty(target, key, source[key]); 61 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 62 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 63 }); 64 } 65 return target; 66 } 67 function _defineProperty(obj, key, value) { 68 return key in obj ? Object.defineProperty(obj, key, { 69 value: value, 70 enumerable: !0, 71 configurable: !0, 72 writable: !0 73 }) : obj[key] = value, obj; 74 } 75 function _defineProperties(target, props) { 76 for (var i = 0; i < props.length; i++) { 77 var descriptor = props[i]; 78 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 79 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 80 } 81 } 82 var DEFAULT_MESSAGES = { 83 email: "Please make sure you've entered a valid email.", 84 emailConfirm: "Please check that your email addresses match.", 85 text: "Please complete this required field.", 86 totals: "Please check that your totals don't exceed the limit", 87 tel: "Please make sure you've entered a valid phone number.", 88 search: "Please enter a search term.", 89 number: "Please enter a valid number.", 90 error: "There was an error.", 91 password: "Please check that your password matches the criteria.", 92 passwordConfirm: "Please check that your passwords match.", 93 radio: "Please choose one of the options above.", 94 checkbox: "Please check at least one option.", 95 select: "Please select an option." 96 }, DEFAULT_PATTERNS = { 97 tel: "^((([0-9]{1})*[- .(]*([0-9]{3})[- .)]*[0-9]{3}[- .]*[0-9]{4})+)*$" 98 }, DEFAULT_OPTIONS = { 99 alertClasses: { 100 error: "is-invalid", 101 success: "is-valid" 102 }, 103 labelClasses: { 104 error: "is-invalid", 105 success: "is-valid" 106 }, 107 inputClasses: { 108 error: "is-invalid", 109 success: "is-valid" 110 }, 111 submitClasses: { 112 enabled: "enabled", 113 disabled: "disabled" 114 }, 115 report: !0, 116 reportSuccess: !1, 117 ajaxSubmit: null, 118 scrollToError: !0, 119 addTest: [], 120 disableSubmit: !1 121 }, Gauntlet = function() { 122 function Gauntlet(elem) { 123 var options = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; 124 !function(instance, Constructor) { 125 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 126 }(this, Gauntlet), this.form = elem, this.inputs = this.getInputs(), this.submits = this.get
126Submits(), 127 this.options = _objectSpread({}, DEFAULT_OPTIONS, {}, options), this.patterns = _objectSpread({}, DEFAULT_PATTERNS, {}, options.patterns), 128 this.messages = _objectSpread({}, DEFAULT_MESSAGES, {}, options.messages), this.addTests = this.options.addTests || [], 129 this.prepForm(), this.bindEvents(), this.form.noValidate = !0, this.validateForm(); 130 } 131 return function(Constructor, protoProps, staticProps) { 132 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 133 }(Gauntlet, [ { 134 key: "getInputs", 135 value: function() { 136 return Array.from(this.form.elements).filter(function(elem) { 137 return matches(elem, "input:not([type=submit]), select, textarea"); 138 }); 139 } 140 }, { 141 key: "getSubmits", 142 value: function() { 143 var _this = this; 144 return Array.from(this.form.querySelectorAll("[type=submit]")).filter(function(submit) { 145 return submit.form && submit.form === _this.form; 146 }); 147 } 148 }, { 149 key: "prepForm", 150 value: function() { 151 var _this2 = this; 152 this.getInputs().map(function(input) { 153 _this2.prepInputPattern(input), _this2.prepConfirmInputs(input); 154 }); 155 } 156 }, { 157 key: "prepInputPattern", 158 value: function(input) { 159 return !input.pattern && this.patterns[input.type] && (input.pattern = this.patterns[input.type]), 160 input; 161 } 162 }, { 163 key: "prepConfirmInputs", 164 value: function(input) { 165 if (this.confirms(input)) { 166 var confirms = this.getConfirmedInput(input); 167 confirms && input.id ? confirms.setAttribute("data-gauntlet-confirmedby", input.id) : input.removeAttribute("data-gauntlet-confirms"); 168 } 169 return input; 170 } 171 }, { 172 key: "confirms", 173 value: function(input) { 174 return input.hasAttribute("data-gauntlet-confirms"); 175 } 176 }, { 177 key: "getConfirmedInput", 178 value: function(input) { 179 var confirms = this.getInputs().filter(function(otherInput) { 180 if (otherInput.id) return otherInput.id === input.getAttribute("data-gauntlet-confirms"); 181 }); 182 return !!confirms.length && confirms[0]; 183 } 184 }, { 185 key: "bindEvents", 186 value: function() { 187 var _this3 = this; 188 this.form.addEventListener("change", function(ev) { 189 var input = ev.target; 190 if (!matches(input, "input, select, textarea")) return !0; 191 _this3.testInput(input), _this3.validateForm(); 192 }), this.form.addEventListener("focusout", function(ev) { 193 var input = ev.target; 194 if (!matches(input, "input, select, textarea")) return !0; 195 _this3.testInput(input), _this3.validateForm(); 196 }), this.form.addEventListener("click", function(ev) { 197 var submit = (0, _heifer.uClosest)(ev.target, '[type="submit"]'); 198 submit && submit.form && submit.form === _this3.form && (_this3.clearValidation(), 199 _this3.validateForm(!0).invalid.length && ev.preventDefault()); 200 }), this.form.addEventListener("input", function(ev) { 201 var input = ev.target; 202 if (!matches(input, "input, select, textarea")) return !0; 203 _this3.testInput(input), _this3.validateForm(); 204 }); 205 } 206 }, { 207 key: "testInput", 208 value: function(input) { 209 this.clearInputValidation(input); 210 var isValid = this.testInputValidity(input); 211 isValid && "" !== input.value ? this.setInputAsValid(input) : isValid || this.setInputAsInvali
211d(input); 212 } 213 }, { 214 key: "clearInputValidation", 215 value: function(input) { 216 var _this$options = this.options, inputClasses = _this$options.inputClasses, labelClasses = _this$options.labelClasses, label = this.getLabel(input); 217 input.classList.contains(inputClasses.error) && input.classList.remove(inputClasses.error), 218 input.classList.contains(inputClasses.success) && input.classList.remove(inputClasses.success), 219 label && (label.classList.contains(labelClasses.error) && label.classList.remove(labelClasses.error), 220 label.classList.contains(labelClasses.success) && label.classList.remove(labelClasses.success)), 221 this.options.report && this.removeReportMessage(input); 222 } 223 }, { 224 key: "removeReportMessage", 225 value: function(input) { 226 var wrapper, messageContainer, needsGroupTest = this.needsGroupTest(input); 227 if (wrapper = needsGroupTest && closest(input, "fieldset") ? closest(input, "fieldset") : this.getLabel(input) ? this.getLabel(input) : input.parentElement, 228 input.dataset.gauntletErrorContainer ? (messageContainer = document.querySelector(input.dataset.gauntletErrorContainer)).classList.remove(this.options.inputClasses.error) : messageContainer = wrapper.querySelector("[aria-live]"), 229 messageContainer) messageContainer.innerHTML = ""; else if (needsGroupTest) { 230 var inputMessage = wrapper.querySelector(".elements__input-alert-msg"); 231 inputMessage && inputMessage.parentElement.removeChild(inputMessage); 232 } else input.nextElementSibling && matches(input.nextElementSibling, ".elements__input-alert-msg") && input.parentNode.removeChild(input.nextElementSibling); 233 } 234 }, { 235 key: "needsGroupTest", 236 value: function(input) { 237 return "checkbox" === input.type || "radio" === input.type; 238 } 239 }, { 240 key: "testInputValidity", 241 value: function(input) { 242 var _this4 = this, isValid = input.checkValidity(); 243 if ((0, _heifer.uIs)(input, "select") && !isValid && input.disabled) return !0; 244 if (!this.needsGroupTest(input) && !isValid) return !1; 245 if (!this.needsConfirmation(input) && "" === input.value) return !0; 246 var tests = this.getInputTests(input); 247 return tests.length && (isValid = tests.reduce(function(prev, test, index) { 248 return !("function" == typeof test && !test.call(_this4, input)) && !("string" == typeof test && !_this4[test].call(_this4, input)); 249 }, isValid)), isValid; 250 } 251 }, { 252 key: "needsConfirmation", 253 value: function(input) { 254 if (this.confirms(input)) { 255 var confirms = this.getConfirmedInput(input); 256 if (confirms && (confirms.required || "" !== confirms.value)) return !0; 257 } 258 return !1; 259 } 260 }, { 261 key: "getConfirmedByInput", 262 value: function(input) { 263 var confirmedBy = this.getInputs().filter(function(otherInput) { 264 if (otherInput.id) return otherInput.id === input.getAttribute("data-gauntlet-confirmedby"); 265 }); 266 return !!confirmedBy.length && confirmedBy[0]; 267 } 268 }, { 269 key: "getInputTests", 270 value: function(input) { 271 var _this5 = this, tests = []; 272 if (this.confirms(input) && tests.push("confirmTest"), this.needsGroupTest(input) && tests.push("checkboxTest"), 273 this.addTests.length) { 274 var userTests = this.addTests.reduce(function(prev, test, index) { 275 return test.condition.call(_this5, input) ? [].concat(_toConsumableArray(prev), [ test.test ]) : prev; 276 }, []); 277 tests = [].concat(_toConsumableArray(tests), _toConsumableArray(u
277serTests)); 278 } 279 return tests; 280 } 281 }, { 282 key: "setInputAsValid", 283 value: function(input, argument_1) { 284 var report = 1 < arguments.length && void 0 !== argument_1 ? argument_1 : this.options.reportSuccess, _this$options2 = this.options, inputClasses = _this$options2.inputClasses, labelClasses = _this$options2.labelClasses, label = this.getLabel(input); 285 input.classList.add(inputClasses.success), input.removeAttribute("aria-invalid"), 286 label && label.classList.add(labelClasses.success), report && this.addReportMessage(input, this.createReportMessage("success", "Good job!")); 287 } 288 }, { 289 key: "addReportMessage", 290 value: function(input, message) { 291 var wrapper, messageContainer, needsGroupTest = this.needsGroupTest(input); 292 wrapper = needsGroupTest && closest(input, "fieldset") ? closest(input, "fieldset") : this.getLabel(input) ? this.getLabel(input) : input.parentElement, 293 input.dataset.gauntletErrorContainer ? (messageContainer = document.querySelector(input.dataset.gauntletErrorContainer)).classList.add(this.options.inputClasses.error) : messageContainer = wrapper.querySelector("[aria-live]"), 294 messageContainer ? messageContainer.innerHTML = message.innerHTML : needsGroupTest ? wrapper.appendChild(message) : input.insertAdjacentHTML("afterend", message.outerHTML); 295 } 296 }, { 297 key: "createReportMessage", 298 value: function(type, message) { 299 var _messageElem$classLis, messageElem = document.createElement("strong"), classes = [ "elements__input-alert-msg", "elements__input-alert-msg" ]; 300 return (_messageElem$classLis = messageElem.classList).add.apply(_messageElem$classLis, classes), 301 messageElem.innerHTML = message, messageElem; 302 } 303 }, { 304 key: "setInputAsInvalid", 305 value: function(input, argument_1) { 306 var report = 1 < arguments.length && void 0 !== argument_1 ? argument_1 : this.options.report, _this$options3 = this.options, inputClasses = _this$options3.inputClasses, labelClasses = _this$options3.labelClasses, label = this.getLabel(input); 307 if (input.classList.add(inputClasses.error), input.setAttribute("aria-invalid", !0), 308 label && label.classList.add(labelClasses.error), report) { 309 var message = this.getMessage(input); 310 this.addReportMessage(input, this.createReportMessage("error", message)); 311 } 312 } 313 }, { 314 key: "setSubmitsAsEnabled", 315 value: function() { 316 var _this6 = this, _this$options$submitC = this.options.submitClasses, enabled = _this$options$submitC.enabled, disabled = _this$options$submitC.disabled; 317 this.submits.map(function(button) { 318 button.classList.contains(disabled) && button.classList.remove(disabled), button.classList.contains(enabled) || button.classList.add(enabled), 319 _this6.options.disableSubmit && (button.disabled = !1); 320 }); 321 } 322 }, { 323 key: "setSubmitsAsDisabled", 324 value: function() { 325 var _this7 = this, _this$options$submitC2 = this.options.submitClasses, enabled = _this$options$submitC2.enabled, disabled = _this$options$submitC2.disabled; 326 this.submits.map(function(button) { 327 button.classList.contains(enabled) && button.classList.remove(enabled), button.classList.contains(disabled) || button.classList.add(disabled), 328 _this7.options.disableSubmit && (button.disabled = !0); 329 }); 330 } 331 }, { 332 key: "getMessage", 333 value: function(input) { 334 if (input.hasAttribute("data-gauntlet-error")) return input.getAttribute("data-gauntlet-error"); 335 var inputType = this.getInputType(input);
336 return this.confirms(input) && (inputType = "".concat(inputType, "Confirm")), this.messages[inputType] || this.messages.text; 337 } 338 }, { 339 key: "getInputType", 340 value: function(input) { 341 var inputType = input.type; 342 return inputType && "select-one" !== inputType ? inputType : matches(input, "select") ? "select" : matches(input, "textarea") ? "textarea" : "text"; 343 } 344 }, { 345 key: "clearValidation", 346 value: function() { 347 var _this8 = this; 348 this.getInputs().map(function(input) { 349 _this8.clearInputValidation(input); 350 }); 351 } 352 }, { 353 key: "validateForm", 354 value: function(argument_0) { 355 var _this9 = this, reportFullForm = 0 < arguments.length && void 0 !== argument_0 && argument_0, invalidElems = this.getInputs().filter(function(input) { 356 return !_this9.testInputValidity(input); 357 }), validElems = this.getInputs().filter(function(input) { 358 return _this9.testInputValidity(input) && "" !== input.value; 359 }); 360 return this.submits.length && (invalidElems.length ? this.setSubmitsAsDisabled() : this.setSubmitsAsEnabled()), 361 reportFullForm && invalidElems.length && invalidElems.map(function(invalidElem) { 362 _this9.setInputAsInvalid(invalidElem); 363 }), validElems.length && validElems.map(function(validElem) { 364 _this9.setInputAsValid(validElem); 365 }), { 366 valid: validElems, 367 invalid: invalidElems 368 }; 369 } 370 }, { 371 key: "checkboxTest", 372 value: function(input) { 373 return !input.required || !!this.getInputs().filter(function(otherInput) { 374 return otherInput.type === input.type && otherInput.name === input.name && otherInput.checkValidity(); 375 }).length; 376 } 377 }, { 378 key: "confirmTest", 379 value: function(input) { 380 return input.value === this.getConfirmedInput(input).value; 381 } 382 }, { 383 key: "getLabel", 384 value: function(el) { 385 if (el.labels && el.labels.length) return el.labels[0]; 386 var closestLabel = closest(el, "label"); 387 return closestLabel || !1; 388 } 389 } ]), Gauntlet; 390 }(); 391 function matches(el, selector) { 392 return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector); 393 } 394 function closest(el, selector) { 395 if ("function" == typeof window.Element.prototype.closest) return el.closest(selector); 396 do { 397 if (matches(el, selector)) return el; 398 el = el.parentElement || el.parentNode; 399 } while (null !== el && 1 === el.nodeType); 400 return null; 401 } 402 exports.default = Gauntlet; 403 }, { 404 "./../utilities/heifer.utilities": 19, 405 "core-js/modules/es6.array.from": 240, 406 "core-js/modules/es6.array.iterator": 241, 407 "core-js/modules/es6.date.to-string": 243, 408 "core-js/modules/es6.function.name": 244, 409 "core-js/modules/es6.object.keys": 250, 410 "core-js/modules/es6.object.to-string": 252, 411 "core-js/modules/es6.regexp.to-string": 262, 412 "core-js/modules/es6.string.iterator": 265, 413 "core-js/modules/es6.symbol": 268, 414 "core-js/modules/es7.object.get-own-property-descriptors": 272, 415 "core-js/modules/es7.symbol.async-iterator": 273, 416 "core-js/modules/web.dom.iterable": 274 417 } ],
418 2: [ function(require, module, exports) { 419 "use strict"; 420 Object.defineProperty(exports, "__esModule", { 421 value: !0 422 }), exports.loadDynamicImage = function(img) { 423 var image = img, settings = { 424 multiple: 1 425 }, parent = { 426 elem: image.parentElement 427 }; 428 parent.width = Math.ceil(parent.elem.offsetWidth * settings.multiple), parent.height = Math.ceil(parent.elem.offsetHeight * settings.multiple); 429 var url = image.getAttribute("data-original") + "&w=" + parent.width + "&h=" + parent.height; 430 image.width = parent.width, image.height = parent.height, new Promise(function(resolve) { 431 window.requestAnimationFrame(function() { 432 image.src = url, image.sizes = image.width + "px"; 433 }), resolve(!0); 434 }).then(function() { 435 image.classList.add("lazyloaded"); 436 }); 437 }, require("core-js/modules/es6.promise"), require("core-js/modules/es6.object.to-string"); 438 }, { 439 "core-js/modules/es6.object.to-string": 252, 440 "core-js/modules/es6.promise": 253 441 } ], 442 3: [ function(require, module, exports) { 443 "use strict"; 444 function _typeof(obj) { 445 return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { 446 return typeof obj; 447 } : function(obj) { 448 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 449 })(obj); 450 } 451 require("core-js/modules/es7.symbol.async-iterator"), require("core-js/modules/es6.symbol"), 452 require("core-js/modules/es6.array.sort"), require("core-js/modules/es6.string.repeat"), 453 require("core-js/modules/es6.function.name"), function($, window, document, Motif) { 454 var Herald = function(elem) { 455 return this.$window = $(elem), this.window = this.$window[0], this; 456 }; 457 Herald.counter = 0, Herald.defaults = (Herald.prototype = { 458 defaults: { 459 throttle: 0, 460 events: [] 461 }, 462 init: function(userOptions) { 463 return this.initVars(userOptions), this.bind(!0), this; 464 }, 465 initVars: function(userOptions) { 466 this.config = userOptions, this.identity = this.config.group || "herald-" + Herald.counter, 467 this.config.events = this.nameEvents(this.config.events), this.options = $.extend(!0, {}, this.defaults, this.config), 468 this.oldPosition = this.$window.scrollTop(), this.options.events = this.sortEvents(), 469 this.spliceQueue = [], this.isTesting = !1, this.isSplicing = !1; 470 }, 471 bind: function(forceRefresh) { 472 var self = this; 473 self.$window.on("scroll." + self.identity, function(ev, force) { 474 self.isSplicing || self.isTesting || ("number" == typeof self.options.throttle && (self.isTesting = !0, 475 window.setTimeout($.proxy(function() { 476 this.isTesting = !1; 477 }, self), self.options.throttle)), self.testAllEvents.call(self, force)); 478 }), self.$window.on("orientationchange." + self.identity + " resize." + self.identity, function() { 479 self.isSplicing || self.isTesting || self.refresh.call(self); 480 }), forceRefresh && self.refresh.call(self); 481 }, 482 suspend: function(name) { 483 var identity = name || this.identity; 484 this.$window.off("scroll." + identity), this.$window.off("resize." + identity), 485 this.$window.off("orientationchange." + identity), this.suspendEvents(identity); 486 }, 487 suspendEvents: function(name) { 488 var self = this, identity = name || self.identity, suspendedEvents = []; 489 return $.each(self.options.events, function(i, v) { 490 v.name && v.name === identity && (v.suspended = !0, suspendedEvents = suspendedEvents.concat(self.options.events.slice(i, i + 1))); 491 }), suspendedEvents; 492 }, 493 resume: function() { 494 this.bind(!0), this.resumeEvents(); 495 }, 496 resumeEvents: function(name) { 497 var self = this, identity = name || self.identity, resumedEvents = []; 498 return $.each(self.options.events, function(i, v) { 499 v.name && v.name === identity && (v.suspended = !1, resumedEvents = resumedEvents.concat(self.options.events.slice(i, i + 1))); 500 }), resumedEvents; 501 }, 502 refresh: function() { 503 this.options.events = this.sortEvents(), this.oldPosition = 0, this.$window.trigger("scroll." + this.identity, !0); 504 }, 505 testAllEvents: function(force) { 506 var direction, i, events = this.options.events, eventsLength = events.length; 507 if (this.currentPosition = this.$window.scrollTop(), force && this.currentPosition === this.oldPosition && (this.currentPosition += 1), 508 "down" === (direction = this.getDirection(this.oldPosition, this.currentPosition))) for (i = 0; i < eventsLength; i += 1) this.testEvent(events[i], i, direction); else if ("up" === direction) for (i = eventsLength - 1; 0 <= i; i -= 1) this.testEvent(events[i], i, direction); 509 this.spliceEvents(), this.oldPosition = this.currentPosition; 510 }, 511 testEvent: function(thisEvent, eventNum, direction) { 512 var triggerPosition; 513 if (thisEvent.suspended) return !1; 514 void 0 !== thisEvent.fired && thisEvent.fired && !thisEvent.repeat || (triggerPosition = thisEvent.persistent ? this.triggerType(thisEvent) : thisEvent.cache, 515 this.testTrigger(triggerPosition) && this.triggerEvent(eventNum, direction)); 516 }, 517 triggerType: function(thisEvent) { 518 return "function" == typeof thisEvent.trigger ? thisEvent.cache = thisEvent.trigger.call(this) : thisEvent.cache = thisEvent.trigger; 519 }, 520 testTrigger: function(triggerPosition) { 521 var position; 522 return "boolean" == typeof triggerPosition ? triggerPosition : (position = triggerPosition < 0 ? 0 : triggerPosition) <= this.currentPosition && position >= this.oldPosition || position >= this.currentPosition && position <= this.oldPosition; 523 }, 524 triggerEvent: function(eventNum, direction) { 525 var thisEvent = this.options.events[eventNum]; 526 thisEvent.event.call(this, direction, this), thisEvent.fired = !0, thisEvent.repeat || this.spliceQueue.push(eventNum); 527 }, 528 spliceEvents: function() { 529 this.isSplicing = !0, $.each(this.spliceQueue, $.proxy(function(i, v) { 530 this.options.events[v].suspended = !0; 531 }, this)), this.spliceQueue = [], this.isSplicing = !1; 532 }, 533 getDirection: function(old, current) { 534 var direction, oldPosition = old || this.oldPosition, currentPosition = current || this.currentPosition; 535 return oldPosition <= currentPosition ? direction = "down" : currentPosition < oldPosition && (direction = "up"), 536 direction; 537 }, 538 nameEvents: function(events) { 539 var self = this; 540 return $.each(events, function(i, v) { 541 v.name = self.identity; 542 }), events; 543 }, 544 sortEvents: function() { 545 return this.options.events = this.cacheEvents(), this.options.events.sort(), this.options.events; 546 }, 547 cacheEvents: function() { 548 return $.each(this.options.events, $.proxy(function(i, thisEvent) { 549 this.triggerType(thisEvent); 550 }, this)), this.options.events; 551 }, 552 addToHerald: function(userOptions) { 553 userOptions.events && userOptions.events.length && (this.identity = userOptions.group || "herald-" + Herald.counter, 554 userOptions.events = this.nameEvents(userOptions.events), this.options.events = this.supplementEvents(userOptions.events), 555 this.options.events = this.sortEvents(), this.bind()); 556 }, 557 supplementEvents: function(newEvents, oldEvents) { 558 return (oldEvents || this.options.events).concat(newEvents); 559 } 560 }).defaults, Motif.apps.Herald = Herald, $.fn.herald = function(userOptions) { 561 var args = arguments, elemLength = this.length; 562 if (elemLength) return this.each(function(index) { 563 var instance = $.data(this, "herald"); 564 if (instance) if (void 0 === userOptions || "function" == typeof userOptions) instance.init(userOptions); else if ("object" === _typeof(userOptions)) instance.addToHerald(userOptions); else { 565 if ("string" == typeof userOptions && "function" == typeof instance[userOptions]) return args = Array.prototype.slice.call(args, 1), 566 instance[userOptions].apply(instance, args); 567 console.log("Herald: Method " + userOptions + " does not exist on jQuery."); 568 } else args = Array.prototype.slice.call(args), (instance = $.data(this, "herald", new Herald(this))).init.apply(instance, args); 569 elemLength - 1 === index && (Herald.counter += 1); 570 }); 571 }; 572 }(jQuery, window, document, window.Motif = window.Motif || { 573 utils: {}, 574 apps: {} 575 }); 576 }, {
577 "core-js/modules/es6.array.sort": 242, 578 "core-js/modules/es6.function.name": 244, 579 "core-js/modules/es6.string.repeat": 267, 580 "core-js/modules/es6.symbol": 268, 581 "core-js/modules/es7.symbol.async-iterator": 273 582 } ], 583 4: [ function(require, module, exports) { 584 "use strict"; 585 Object.defineProperty(exports, "__esModule", { 586 value: !0 587 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 588 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 589 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 590 require("core-js/modules/es6.object.keys"); 591 var obj, _rellax = (obj = require("../vendor/rellax.min")) && obj.__esModule ? obj : { 592 default: obj 593 }; 594 function ownKeys(object, enumerableOnly) { 595 var keys = Object.keys(object); 596 if (Object.getOwnPropertySymbols) { 597 var symbols = Object.getOwnPropertySymbols(object); 598 enumerableOnly && (symbols = symbols.filter(function(sym) { 599 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 600 })), keys.push.apply(keys, symbols); 601 } 602 return keys; 603 } 604 function _defineProperty(obj, key, value) { 605 return key in obj ? Object.defineProperty(obj, key, { 606 value: value, 607 enumerable: !0, 608 configurable: !0, 609 writable: !0 610 }) : obj[key] = value, obj; 611 } 612 function _defineProperties(target, props) { 613 for (var i = 0; i < props.length; i++) { 614 var descriptor = props[i]; 615 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 616 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 617 } 618 } 619 var RellaxInit = function() { 620 function RellaxInit(element, options) { 621 !function(instance, Constructor) { 622 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 623 }(this, RellaxInit), this.element = element, this.$element = $(this.element); 624 var defaults = {}; 625 this._defaults = defaults, this.settings = function(target) { 626 for (var i = 1; i < arguments.length; i++) { 627 var source = null != arguments[i] ? arguments[i] : {}; 628 i % 2 ? ownKeys(source, !0).forEach(function(key) { 629 _defineProperty(target, key, source[key]); 630 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 631 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 632 }); 633 } 634 return target; 635 }({}, defaults, {}, options), this.isLarge = this.isViewportLarge(), this.wasLarge = !1, 636 this.rellax = null, this.init(); 637 } 638 return function(Constructor, protoProps, staticProps) { 639 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 640 }(RellaxInit, [ { 641 key: "isViewportLarge", 642 value: function() { 643 return 991 < $(window).outerWidth(); 644 } 645 }, { 646 key: "init", 647 value: function() { 648 if (!window.Modernizr.objectfit) return !1; 649 window.matchMedia("(prefers-reduced-motion: reduce)").matches || (this.bindEvents(), 650 this.isLarge && (this.rellax = this.createRellax()), this.wasLarge = this.isLarge); 651 } 652 }, { 653 key: "createRellax", 654 value: function() { 655 return new _rellax.default(".js-rellax"); 656 } 657 }, { 658 key: "bindEvents", 659 value: function() { 660 var _this = this; 661 window.addEventListener("resize", function() { 662 !_this.wasLarge && _this.isLarge ? (_this.rellax || (_this.rellax = _this.createRellax()), 663 _this.rellax.refresh()) : _this.wasLarge && !_this.isLarge && _this.rellax && _this.rellax.destroy(), 664 _this.wasLarge = _this.isLarge; 665 }); 666 } 667 } ]), RellaxInit; 668 }(); 669 exports.default = RellaxInit; 670 }, {
671 "../vendor/rellax.min": 24, 672 "core-js/modules/es6.array.iterator": 241, 673 "core-js/modules/es6.object.keys": 250, 674 "core-js/modules/es6.object.to-string": 252, 675 "core-js/modules/es6.symbol": 268, 676 "core-js/modules/es7.object.get-own-property-descriptors": 272, 677 "core-js/modules/web.dom.iterable": 274 678 } ], 679 5: [ function(require, module, exports) { 680 "use strict"; 681 Object.defineProperty(exports, "__esModule", { 682 value: !0 683 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 684 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 685 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 686 require("core-js/modules/es6.object.keys"); 687 var _heifer = require("../utilities/heifer.utilities"); 688 function ownKeys(object, enumerableOnly) { 689 var keys = Object.keys(object); 690 if (Object.getOwnPropertySymbols) { 691 var symbols = Object.getOwnPropertySymbols(object); 692 enumerableOnly && (symbols = symbols.filter(function(sym) { 693 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 694 })), keys.push.apply(keys, symbols); 695 } 696 return keys; 697 } 698 function _defineProperty(obj, key, value) { 699 return key in obj ? Object.defineProperty(obj, key, { 700 value: value, 701 enumerable: !0, 702 configurable: !0, 703 writable: !0 704 }) : obj[key] = value, obj; 705 } 706 function _defineProperties(target, props) { 707 for (var i = 0; i < props.length; i++) { 708 var descriptor = props[i]; 709 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 710 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 711 } 712 } 713 var SmoothScroll = function() { 714 function SmoothScroll(element, options) { 715 !function(instance, Constructor) { 716 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 717 }(this, SmoothScroll), this.element = element, this.$element = $(element); 718 var defaults = {}; 719 this._defaults = defaults, this.settings = function(target) { 720 for (var i = 1; i < arguments.length; i++) { 721 var source = null != arguments[i] ? arguments[i] : {}; 722 i % 2 ? ownKeys(source, !0).forEach(function(key) { 723 _defineProperty(target, key, source[key]); 724 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 725 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 726 }); 727 } 728 return target; 729 }({}, defaults, {}, options), this.init(); 730 } 731 return function(Constructor, protoProps, staticProps) { 732 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 733 }(SmoothScroll, [ { 734 key: "init", 735 value: function() { 736 var isSmoothScrollSupported = "scrollBehavior" in document.documentElement.style; 737 this.links = Array.prototype.slice.call(document.querySelectorAll('a[href*="#"]')), 738 this.links.forEach(function(el) { 739 var link = el.getAttribute("href"); 740 if (!(link.length < 2 || 0 != link.indexOf("#"))) { 741 var linkTarget = document.querySelector(el.getAttribute("href")); 742 null != linkTarget && null != linkTarget && linkTarget && el.addEventListener("click", function(ev) { 743 if (ev.preventDefault(), isSmoothScrollSupported) (0, _heifer.uScrollTo)(linkTarget); else { 744 var cords = (0, _heifer.uGetCoords)(linkTarget).top; 745 $("html, body").animate({ 746 scrollTop: cords 747 }, "slow"); 748 }
749 linkTarget.focus(); 750 }); 751 } 752 }); 753 } 754 } ]), SmoothScroll; 755 }(); 756 exports.default = SmoothScroll; 757 }, { 758 "../utilities/heifer.utilities": 19, 759 "core-js/modules/es6.array.iterator": 241, 760 "core-js/modules/es6.object.keys": 250, 761 "core-js/modules/es6.object.to-string": 252, 762 "core-js/modules/es6.symbol": 268, 763 "core-js/modules/es7.object.get-own-property-descriptors": 272, 764 "core-js/modules/web.dom.iterable": 274 765 } ], 766 6: [ function(require, module, exports) { 767 "use strict"; 768 Object.defineProperty(exports, "__esModule", { 769 value: !0 770 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 771 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 772 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 773 require("core-js/modules/es6.object.keys"); 774 var obj, _heifer = require("../utilities/heifer.utilities"), _inView = (obj = require("./inView")) && obj.__esModule ? obj : { 775 default: obj 776 }; 777 function ownKeys(object, enumerableOnly) { 778 var keys = Object.keys(object); 779 if (Object.getOwnPropertySymbols) { 780 var symbols = Object.getOwnPropertySymbols(object); 781 enumerableOnly && (symbols = symbols.filter(function(sym) { 782 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 783 })), keys.push.apply(keys, symbols); 784 } 785 return keys; 786 } 787 function _defineProperty(obj, key, value) { 788 return key in obj ? Object.defineProperty(obj, key, { 789 value: value, 790 enumerable: !0, 791 configurable: !0, 792 writable: !0 793 }) : obj[key] = value, obj; 794 } 795 function _defineProperties(target, props) { 796 for (var i = 0; i < props.length; i++) { 797 var descriptor = props[i]; 798 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 799 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 800 } 801 } 802 var Animate = function() { 803 function Animate(element, options) { 804 !function(instance, Constructor) { 805 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 806 }(this, Animate), this.element = element; 807 var defaults = {}; 808 this._defaults = defaults, this.settings = function(target) { 809 for (var i = 1; i < arguments.length; i++) { 810 var source = null != arguments[i] ? arguments[i] : {}; 811 i % 2 ? ownKeys(source, !0).forEach(function(key) { 812 _defineProperty(target, key, source[key]); 813 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 814 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 815 }); 816 } 817 return target; 818 }({}, defaults, {}, options), this.initAnimations(); 819 } 820 return function(Constructor, protoProps, staticProps) { 821 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 822 }(Animate, [ { 823 key: "initAnimations", 824 value: function() { 825 var options = { 826 elements: [] 827 }; 828 [].forEach.call(this.element.querySelectorAll(".js-in-view"), function(el) { 829 options.elements.push({ 830 element: el, 831 action: function(element) { 832 (0, _heifer.uHasClass)(element, "in-view") || (0, _heifer.uAddClass)(element, "in-view"); 833 } 834 }); 835 }), [].forEach.call(this.element.querySelectorAll(".js-in-view-slow"), function(el) { 836 options.elements.push({ 837 element: el, 838 offset: -300, 839 action: function(element) { 840 (0, _heifer.uHasClass)(element, "in-view") || (0, _heifer.uAddClass)(element, "in-view"); 841 } 842 }); 843 }), new _inView.default(options); 844 } 845 } ]), Animate; 846 }(); 847 exports.default = Animate; 848 }, {
849 "../utilities/heifer.utilities": 19, 850 "./inView": 9, 851 "core-js/modules/es6.array.iterator": 241, 852 "core-js/modules/es6.object.keys": 250, 853 "core-js/modules/es6.object.to-string": 252, 854 "core-js/modules/es6.symbol": 268, 855 "core-js/modules/es7.object.get-own-property-descriptors": 272, 856 "core-js/modules/web.dom.iterable": 274 857 } ], 858 7: [ function(require, module, exports) { 859 "use strict"; 860 Object.defineProperty(exports, "__esModule", { 861 value: !0 862 }), exports.default = void 0, require("core-js/modules/es7.symbol.async-iterator"), 863 require("core-js/modules/es6.symbol"), require("core-js/modules/es6.reflect.get"), 864 require("core-js/modules/es6.object.set-prototype-of"), require("core-js/modules/es6.array.sort"), 865 require("core-js/modules/web.dom.iterable"), require("core-js/modules/es6.array.iterator"), 866 require("core-js/modules/es6.object.to-string"), require("core-js/modules/es7.object.entries"), 867 require("core-js/modules/es6.array.find");
868 var obj, _slider = (obj = require("./slider")) && obj.__esModule ? obj : { 869 default: obj 870 }; 871 function _typeof(obj) { 872 return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { 873 return typeof obj; 874 } : function(obj) { 875 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 876 })(obj); 877 } 878 function _defineProperties(target, props) { 879 for (var i = 0; i < props.length; i++) { 880 var descriptor = props[i]; 881 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 882 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 883 } 884 } 885 function _possibleConstructorReturn(self, call) { 886 return !call || "object" !== _typeof(call) && "function" != typeof call ? function(self) { 887 if (void 0 !== self) return self; 888 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 889 }(self) : call; 890 } 891 function _get(target, property, receiver) { 892 return (_get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get : function(target, property, receiver) { 893 var base = function(object, property) { 894 for (;!Object.prototype.hasOwnProperty.call(object, property) && null !== (object = _getPrototypeOf(object)); ) ; 895 return object; 896 }(target, property); 897 if (base) { 898 var desc = Object.getOwnPropertyDescriptor(base, property); 899 return desc.get ? desc.get.call(receiver) : desc.value; 900 } 901 })(target, property, receiver || target); 902 } 903 function _getPrototypeOf(o) { 904 return (_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function(o) { 905 return o.__proto__ || Object.getPrototypeOf(o); 906 })(o); 907 } 908 function _setPrototypeOf(o, p) { 909 return (_setPrototypeOf = Object.setPrototypeOf || function(o, p) { 910 return o.__proto__ = p, o; 911 })(o, p); 912 } 913 var Carousel = function() { 914 function Carousel(elem, options) { 915 var _this; 916 return function(instance, Constructor) { 917 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 918 }(this, Carousel), (_this = _possibleConstructorReturn(this, _getPrototypeOf(Carousel).call(this, elem, options))).updateCarousel(), 919 _this; 920 } 921 return function(subClass, superClass) { 922 if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function"); 923 subClass.prototype = Object.create(superClass && superClass.prototype, { 924 constructor: { 925 value: subClass, 926 writable: !0, 927 configurable: !0 928 } 929 }), superClass && _setPrototypeOf(subClass, superClass); 930 }(Carousel, _slider.default), function(Constructor, protoProps, staticProps) { 931 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 932 }(Carousel, [ { 933 key: "adjustSlidesWidth", 934 value: function() { 935 var _this2 = this, width = this.calculateSlideWidth(); 936 window.requestAnimationFrame(function() { 937 _this2.slides.map(function(slide) { 938 slide.style.width = width; 939 }); 940 }); 941 } 942 }, { 943 key: "calculateSlideWidth", 944 value: function() { 945 return "".concat(100 / this.visibleSlides, "%"); 946 } 947 }, { 948 key: "getVisibleSlides", 949 value: function() { 950 return "number" == typeof this.options.visibleSlides ? this.options.visibleSlides : this.getVisibleSlidesByBreakpoint(); 951 } 952 }, { 953 key: "getVisibleSlidesByBreakpoint", 954 value: function() { 955 return this.convertVisibleSlidesObjectToArray().find(function(arr) { 956 return window.matchMedia("(min-width: ".concat(arr[0], "px)")).matches; 957 })[1]; 958 } 959 }, { 960 key: "convertVisibleSlidesObjectToArray", 961 value: function() { 962 var visibleSlidesArray = Object.entries(this.options.visibleSlides); 963 return (visibleSlidesArray = visibleSlidesArray.map(function(slideArray) { 964 return "string" == typeof slideArray[0] ? [ parseInt(slideArray[0], 10), slideArray[1] ] : slideArray; 965 })).sort(function(a, b) { 966 return a[0] - b[0]; 967 }).reverse(), visibleSlidesArray; 968 } 969 }, { 970 key: "bindEvents", 971 value: function() { 972 _get(_getPrototypeOf(Carousel.prototype), "bindEvents", this).call(this), window.addEventListener("resize", this.updateCarousel.bind(this)); 973 } 974 }, { 975 key: "calculateSlideOffset", 976 value: function(slide) { 977 var offset = slide.offsetLeft; 978 return "".concat(0 < offset ? "-" : "").concat(offset, "px"); 979 } 980 }, { 981 key: "updateCarousel", 982 value: function() { 983 this.setStateByIndex(this.state.current), this.visibleSlides = this.getVisibleSlides(), 984 this.adjustSlidesWidth(), this.renderSequence(); 985 } 986 }, { 987 key: "getNextIndex", 988 value: function(argument_0) { 989 var current = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.state.current, increment = this.getProgressIncrement(), total = this.slides.length; 990 return current + this.visibleSlides === total || current === this.slides.length - increment ? this.options.loop ? 0 : current : total - (current + increment) < this.visibleSlides ? total - this.visibleSlides : current + increment; 991 } 992 }, { 993 key: "getPrevIndex", 994 value: function(argument_0) { 995 var current = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.state.current, increment = this.getProgressIncrement(); 996 this.slides.length; 997 return 0 !== current && current - increment < 0 ? 0 : 0 === current ? this.options.loop ? this.slides.length - Math.max(increment, this.visibleSlides) : current : current - increment; 998 } 999 }, { 1000 key: "getProgressIncrement", 1001 value: function() { 1002 return Math.min(this.options.progressIncrement, this.visibleSlides); 1003 } 1004 }, {
1005 key: "renderSequence", 1006 value: function(argument_0) { 1007 var state = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.state; 1008 _get(_getPrototypeOf(Carousel.prototype), "renderSequence", this).call(this, state), 1009 this.slidesList.style.setProperty("--slidesOffset", this.calculateSlideOffset(this.slides[state.current])), 1010 this.renderButtonState(); 1011 } 1012 }, { 1013 key: "getInitialState", 1014 value: function() { 1015 return this.visibleSlides || (this.visibleSlides = this.getVisibleSlides()), _get(_getPrototypeOf(Carousel.prototype), "getInitialState", this).call(this); 1016 } 1017 }, { 1018 key: "lockSlider", 1019 value: function(e) { 1020 _get(_getPrototypeOf(Carousel.prototype), "lockSlider", this).call(this, e), this.currentOffset = parseInt(window.getComputedStyle(this.slidesList).getPropertyValue("--slidesOffset"), 10); 1021 } 1022 } ]), Carousel; 1023 }(); 1024 exports.default = Carousel; 1025 }, { 1026 "./slider": 13, 1027 "core-js/modules/es6.array.find": 239, 1028 "core-js/modules/es6.array.iterator": 241, 1029 "core-js/modules/es6.array.sort": 242, 1030 "core-js/modules/es6.object.set-prototype-of": 251, 1031 "core-js/modules/es6.object.to-string": 252, 1032 "core-js/modules/es6.reflect.get": 254, 1033 "core-js/modules/es6.symbol": 268, 1034 "core-js/modules/es7.object.entries": 271, 1035 "core-js/modules/es7.symbol.async-iterator": 273, 1036 "core-js/modules/web.dom.iterable": 274 1037 } ], 1038 8: [ function(require, module, exports) { 1039 "use strict"; 1040 Object.defineProperty(exports, "__esModule", { 1041 value: !0 1042 }), exports.default = function() { 1043 var request = new window.XMLHttpRequest(); 1044 request.open("GET", "/resources/dist/icons/icons-sprite.svg", !0), request.onload = function() { 1045 200 <= request.status && request.status < 400 ? (document.body.children[0].insertAdjacentHTML("beforebegin", request.responseText), 1046 document.querySelector("svg").setAttribute("aria-hidden", "true")) : console.error("Icons could not be fetched."); 1047 }, request.onerror = function() { 1048 console.error("Icons could not be fetched."); 1049 }, request.send(); 1050 }; 1051 }, {} ], 1052 9: [ function(require, module, exports) { 1053 "use strict"; 1054 Object.defineProperty(exports, "__esModule", { 1055 value: !0 1056 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 1057 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 1058 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 1059 require("core-js/modules/es6.object.keys"); 1060 var _heifer = require("../../core/utilities/heifer.utilities"); 1061 function ownKeys(object, enumerableOnly) { 1062 var keys = Object.keys(object); 1063 if (Object.getOwnPropertySymbols) { 1064 var symbols = Object.getOwnPropertySymbols(object); 1065 enumerableOnly && (symbols = symbols.filter(function(sym) { 1066 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 1067 })), keys.push.apply(keys, symbols); 1068 } 1069 return keys; 1070 } 1071 function _objectSpread(target) { 1072 for (var i = 1; i < arguments.length; i++) { 1073 var source = null != arguments[i] ? arguments[i] : {}; 1074 i % 2 ? ownKeys(source, !0).forEach(function(key) { 1075 _defineProperty(target, key, source[key]); 1076 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 1077 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 1078 }); 1079 } 1080 return target; 1081 } 1082 function _defineProperty(obj, key, value) { 1083 return key in obj ? Object.defineProperty(obj, key, { 1084 value: value, 1085 enumerable: !0, 1086 configurable: !0, 1087 writable: !0 1088 }) : obj[key] = value, obj; 1089 } 1090 function _defineProperties(target, props) { 1091 for (var i = 0; i < props.length; i++) { 1092 var descriptor = props[i]; 1093 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 1094 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 1095 } 1096 } 1097 var inView = function() { 1098 function inView(options) { 1099 !function(instance, Constructor) { 1100 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 1101 }(this, inView), this._defaults = {
1102 viewportHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0) 1103 }, this.settings = _objectSpread({}, this._defaults, {}, options), this.init(); 1104 } 1105 return function(Constructor, protoProps, staticProps) { 1106 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 1107 }(inView, [ { 1108 key: "init", 1109 value: function() { 1110 this.paused = !1, this.cacheElements(), window.addEventListener("resize", this.cacheElements.bind(this)), 1111 window.requestAnimationFrame(this.renderFrame.bind(this)); 1112 } 1113 }, { 1114 key: "cacheElements", 1115 value: function() { 1116 var _this = this, sampleElementOptions = { 1117 element: null, 1118 offset: -250, 1119 index: 0, 1120 topPosition: 0, 1121 pauseTime: 0, 1122 action: function() {} 1123 }; 1124 this.settings.viewportHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0), 1125 this.settings.elements.forEach(function(elem, index) { 1126 var off = elem.offset ? elem.offset : sampleElementOptions.offset; 1127 elem.topPosition = (0, _heifer.uGetCoords)(elem.element).top - _this.settings.viewportHeight - off, 1128 elem.index = index, elem.element.hasAttribute("data-offset") && (elem.offset = parseInt(elem.element.dataset.offset, 10)), 1129 elem.element.hasAttribute("data-pause") && (elem.pauseTime = parseInt(elem.element.dataset.pause, 10)), 1130 _this.settings.elements[index] = _objectSpread({}, sampleElementOptions, {}, elem); 1131 }); 1132 } 1133 }, { 1134 key: "renderFrame", 1135 value: function() { 1136 var _this2 = this, scrollPosition = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop, activeElements = this.settings.elements.filter(function(elem) { 1137 return elem.topPosition <= scrollPosition; 1138 }); 1139 activeElements.length && (activeElements.forEach(function(target) { 1140 _this2.paused || (target.action(target.element), _this2.settings.elements = _this2.settings.elements.filter(function(element) { 1141 return element.index !== target.index; 1142 })), target.pauseTime && (_this2.paused = !0, setTimeout(function() { 1143 _this2.paused = !1; 1144 }, target.pauseTime)); 1145 }), this.cacheElements()), this.settings.elements.length && window.requestAnimationFrame(this.renderFrame.bind(this)); 1146 } 1147 } ]), inView; 1148 }(); 1149 exports.default = inView; 1150 }, {
1151 "../../core/utilities/heifer.utilities": 19, 1152 "core-js/modules/es6.array.iterator": 241, 1153 "core-js/modules/es6.object.keys": 250, 1154 "core-js/modules/es6.object.to-string": 252, 1155 "core-js/modules/es6.symbol": 268, 1156 "core-js/modules/es7.object.get-own-property-descriptors": 272, 1157 "core-js/modules/web.dom.iterable": 274 1158 } ], 1159 10: [ function(require, module, exports) { 1160 "use strict"; 1161 Object.defineProperty(exports, "__esModule", { 1162 value: !0 1163 }), exports.default = function() { 1164 new _reveal.default(".js-reveal", { 1165 type: "exclusive", 1166 activeClass: "is-revealed", 1167 visitedClass: "was-revealed" 1168 }), new _reveal.default(".js-reveal-manageSubscription", { 1169 type: "exclusive", 1170 activeClass: "is-revealed", 1171 visitedClass: "was-revealed", 1172 onShow: function() { 1173 (0, _heifer.uAddClass)(this.reference.targets[0].parentElement, "is-editing"); 1174 }, 1175 onHide: function() { 1176 (0, _heifer.uRemoveClass)(this.reference.targets[0].parentElement, "is-editing"); 1177 } 1178 }), new _reveal.default(".js-reveal-editSubscription", { 1179 type: "exclusive", 1180 activeClass: "is-revealed", 1181 visitedClass: "was-revealed", 1182 onShow: function() { 1183 (0, _heifer.uAddClass)(this.reference.targets[0].parentElement, "is-editing"); 1184 var target = this.reference.targets[0], form = target.querySelector("form"); 1185 form && setTimeout(function() { 1186 form.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled])")[0].focus(); 1187 }, 300); 1188 }, 1189 onHide: function() { 1190 (0, _heifer.uRemoveClass)(this.reference.targets[0].parentElement, "is-editing"); 1191 } 1192 }), new _reveal.default(".js-reveal-radio", { 1193 type: "radio", 1194 activeClass: "is-revealed", 1195 visitedClass: "was-revealed" 1196 }), new _reveal.default(".js-reveal-lazyload", { 1197 type: "exclusive", 1198 activeClass: "is-revealed", 1199 visitedClass: "was-revealed", 1200 onShow: function() { 1201 [].forEach.call(this.reference.targets[0].querySelectorAll("img"), function(img) { 1202 (0, _dynamicResponsiveImages.loadDynamicImage)(img); 1203 }); 1204 } 1205 }), new _reveal.default(".js-reveal-hover", { 1206 type: "exclusive", 1207 trigger: "hover", 1208 activeClass: "is-revealed", 1209 visitedClass: "was-revealed" 1210 }); 1211 }; 1212 var obj, _reveal = (obj = require("./reveal.es6")) && obj.__esModule ? obj : { 1213 default: obj 1214 }, _dynamicResponsiveImages = require("../../core/images/dynamic-responsive-images"), _heifer = require("../../core/utilities/heifer.utilities"); 1215 }, { 1216 "../../core/images/dynamic-responsive-images": 2, 1217 "../../core/utilities/heifer.utilities": 19, 1218 "./reveal.es6": 12 1219 } ], 1220 11: [ function(require, module, exports) { 1221 "use strict"; 1222 Object.defineProperty(exports, "__esModule", { 1223 value: !0 1224 }), exports.default = void 0, require("core-js/modules/es6.string.iterator"), require("core-js/modules/es6.array.from"), 1225 require("core-js/modules/es6.regexp.split"), require("core-js/modules/es6.promise"), 1226 require("core-js/modules/es6.object.to-string"), require("core-js/modules/es6.object.assign"); 1227 var obj, _heiferAnimationFrame = (obj = require("../utilities/heifer.animationFrame.es6")) && obj.__esModule ? obj : { 1228 default: obj 1229 }, _heifer = require("../utilities/heifer.utilities"), _a11y = require("../utilities/a11y"); 1230 function _defineProperties(target, props) { 1231 for (var i = 0; i < props.length; i++) { 1232 var descriptor = props[i]; 1233 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 1234 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 1235 } 1236 } 1237 var DEFAULTS = { 1238 trigger: "click", 1239 type: "default", 1240 target: "data-reveal", 1241 activeClass: "is-current", 1242 visitedClass: "is-visited", 1243 onInit: null, 1244 beforeReveal: null, 1245 onShow: null, 1246 onHide: null, 1247 returns: !1 1248 }, GROUP_ATTR = "data-reveal-group", counter = 0, animationFrame = (0, _heiferAnimationFrame.default)(), RevealTrigger = function() { 1249 function RevealTrigger(elem, userOptions) { 1250 !function(instance, Constructor) { 1251 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 1252 }(this, RevealTrigger), this.elem = elem, this.identity = this.elem.hasAttribute("id") ? this.elem.id : "reveal-trigger-".concat(counter), 1253 this.group = !!this.elem.hasAttribute(GROUP_ATTR) && this.elem.getAttribute(GROUP_ATTR), 1254 this.reference = !1, this.config = userOptions, this.metadata = this.elem.hasAttribute("data-reveal-options") ? JSON.parse(this.elem.getAttribute("data-reveal-options")) : {}, 1255 this.options = Object.assign({}, DEFAULTS, this.config, this.metadata), this.events = { 1256 beforeShow: (0, _heifer.uCreateCustomEvent)("reveal/".concat(this.identity, "/before/show")), 1257 afterShow: (0, _heifer.uCreateCustomEvent)("reveal/".concat(this.identity, "/after/show")), 1258 show: (0, _heifer.uCreateCustomEvent)("reveal/".concat(this.identity, "/show")), 1259 beforeHide: (0, _heifer.uCreateCustomEvent)("reveal/".concat(this.identity, "/before/hide")), 1260 afterHide: (0, _heifer.uCreateCustomEvent)("reveal/".concat(this.identity, "/after/hide")), 1261 hide: (0, _heifer.uCreateCustomEvent)("reveal/".concat(this.identity, "/hide")), 1262 init: (0, _heifer.uCreateCustomEvent)("reveal/".concat(this.identity, "/init")) 1263 }, this.init(); 1264 } 1265 return function(Constructor, protoProps, staticProps) { 1266 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 1267 }(RevealTrigger, [ { 1268 key: "newReferenceTarget", 1269 value: function(elem) { 1270 return { 1271 elem: elem, 1272 targets: [], 1273 fors: [], 1274 hide: [], 1275 current: !1 1276 }; 1277 } 1278 }, { 1279 key: "newReferenceGroup", 1280 value: function() { 1281 return { 1282 type: this.options.type, 1283 triggers: [] 1284 }; 1285 } 1286 }, { 1287 key: "init", 1288 value: function() { 1289 return this.createReference.call(this), this.bindCallbacks.call(this), this.bindTrigger.call(this), 1290 this.bindTargets.call(this), this.initTrigger.call(this), counter += 1, document.dispatchEvent(this.events.init), 1291 this; 1292 } 1293 }, { 1294 key: "createReference", 1295 value: function() { 1296 window.Reveal || (window.Reveal = { 1297 triggers: {}, 1298 groups: {}, 1299 queue: [] 1300 }); 1301 } 1302 }, { 1303 key: "bindCallbacks", 1304 value: function() { 1305 "function" == typeof this.options.onInit && document.addEventListener("reveal/".concat(this.identity, "/init"), this.options.onInit.bind(this, this.elem, this.getTargetsFromReference.bind(this))), 1306 "function" == typeof this.options.onShow && document.addEventListener("reveal/".concat(this.identity, "/after/show"), this.options.onShow.bind(this, this.elem, this.getTargetsFromReference.bind(this))), 1307 "function" == typeof this.options.onHide && document.addEventListener("reveal/".concat(this.identity, "/after/hide"), this.options.onHide.bind(this, this.elem, this.getTargetsFromReference.bind(this))); 1308 } 1309 }, { 1310 key: "bindTrigger", 1311 value: function() { 1312 var _this = this; 1313 "click" === this.options.trigger ? this.elem.addEventListener("click", function(ev) { 1314 _this.processBeforeTrigger(), _this.options.returns || ev.preventDefault(); 1315 }) : "hover" === this.options.trigger && (this.elem.addEventListener("mouseenter", function() { 1316 _this.processBeforeTrigger(); 1317 }), this.elem.addEventListener("mouseleave", function() { 1318 _this.processBeforeTrigger(); 1319 })); 1320 } 1321 }, { 1322 key: "getAction", 1323 value: function() { 1324 return !0 === this.reference.current ? "radio" !== this.options.type && "hide" : "show"; 1325 } 1326 }, { 1327 key: "processBeforeTrigger", 1328 value: function() { 1329 var _this2 = this, action = this.getAction(); 1330 if (!action) return !0; 1331 "function" == typeof this.options.beforeReveal ? this.promiseBeforeTrigger(this.options.beforeReveal, action).then(function() { 1332 _this2.processTrigger(action); 1333 }).catch(function() { 1334 return !1; 1335 }) : this.processTrigger(action); 1336 } 1337 }, { 1338 key: "processTrigger", 1339 value: function(action) { 1340 "show" === action ? this.publish() : "hide" === action && this.unpublish(); 1341 } 1342 }, { 1343 key: "publish", 1344 value: function() { 1345 var _this3 = this;
1346 this.group && "default" !== this.options.type && this.getCurrent(window.Reveal.groups[this.group].triggers).forEach(function(oldCurrent) { 1347 _this3.unpublish(oldCurrent); 1348 }); 1349 document.dispatchEvent(this.events.show); 1350 } 1351 }, { 1352 key: "unpublish", 1353 value: function(val) { 1354 var hideEvent = val ? (0, _heifer.uCreateCustomEvent)("reveal/".concat(val, "/hide")) : this.events.hide; 1355 document.dispatchEvent(hideEvent); 1356 } 1357 }, { 1358 key: "bindTargets", 1359 value: function() { 1360 document.addEventListener("reveal/".concat(this.identity, "/show"), this.showSequence.bind(this)), 1361 document.addEventListener("reveal/".concat(this.identity, "/hide"), this.hideSequence.bind(this)); 1362 } 1363 }, { 1364 key: "promiseBeforeTrigger", 1365 value: function(fn, action) { 1366 var _this4 = this; 1367 return new Promise(function(resolve, reject) { 1368 fn.call(_this4, _this4.elem, action, { 1369 resolve: resolve, 1370 reject: reject 1371 }); 1372 }); 1373 } 1374 }, { 1375 key: "showSequence", 1376 value: function() { 1377 document.dispatchEvent(this.events.beforeShow), this.makeCurrent(), this.showTrigger(), 1378 this.showTargets(), this.showFors(), document.dispatchEvent(this.events.afterShow); 1379 } 1380 }, { 1381 key: "hideSequence", 1382 value: function() { 1383 document.dispatchEvent(this.events.beforeHide), this.unmakeCurrent(), this.hideTrigger(), 1384 this.hideTargets(), this.hideFors(), document.dispatchEvent(this.events.afterHide); 1385 } 1386 }, { 1387 key: "initCurrent", 1388 value: function() { 1389 this.elem.hasAttribute("data-reveal-current") && "true" === this.elem.getAttribute("data-reveal-current") && this.setCurrent(); 1390 } 1391 }, { 1392 key: "setCurrent", 1393 value: function() { 1394 this.group ? window.Reveal.queue.push(this.events.show) : (this.makeCurrent(), this.publish()); 1395 } 1396 }, { 1397 key: "makeCurrent", 1398 value: function() { 1399 this.updateReference({ 1400 current: !0 1401 }); 1402 } 1403 }, { 1404 key: "unmakeCurrent", 1405 value: function() { 1406 this.updateReference({ 1407 current: !1 1408 }); 1409 } 1410 }, { 1411 key: "getCurrent", 1412 value: function(triggers) { 1413 var reference = window.Reveal.triggers; 1414 return triggers.filter(function(triggerName) { 1415 return reference[triggerName].current; 1416 }); 1417 } 1418 }, { 1419 key: "initTrigger", 1420 value: function() { 1421 this.updateReference({ 1422 targets: this.gatherTargets(), 1423 fors: this.gatherForTriggers(), 1424 hide: this.gatherHideTriggers() 1425 }), this.initCurrent(); 1426 } 1427 }, { 1428 key: "gatherTargets", 1429 value: function() { 1430 var targets; 1431 if (this.options.target.constructor === Array && this.options.target.length) targets = this.options.target; else if ("function" == typeof this.options.target) targets = this.options.target; else { 1432 if (!this.elem.hasAttribute(this.options.target)) return console.error("Reveal couldn't find a target for this trigger"), 1433 !1; 1434 targets = this.elem.getAttribute(this.options.target).split(" ").map(function(targetString) { 1435 var target = document.getElementById(targetString); 1436 return target = target || function() { 1437 var elem = document.getElementById(targetString); 1438 return elem || !1; 1439 }; 1440 }); 1441 } 1442 return targets; 1443 } 1444 }, { 1445 key: "gatherForTriggers", 1446 value: function() { 1447 var _this5 = this, allFors = Array.from(document.querySelectorAll("[".concat("data-reveal-for", '="').concat(this.identity, '"]')));
1448 return allFors.forEach(function(forTrigger) { 1449 _this5.bindFors(forTrigger); 1450 }), allFors; 1451 } 1452 }, { 1453 key: "bindFors", 1454 value: function(forTrigger) { 1455 var _this6 = this; 1456 forTrigger.addEventListener("click", function() { 1457 return _this6.processBeforeTrigger(), _this6.options.returns; 1458 }); 1459 } 1460 }, { 1461 key: "gatherHideTriggers", 1462 value: function() { 1463 var _this7 = this, allHides = Array.from(document.querySelectorAll("[".concat("data-reveal-hide", '="').concat(this.identity, '"]'))); 1464 return allHides.forEach(function(hideTrigger) { 1465 _this7.bindHides(hideTrigger); 1466 }), allHides; 1467 } 1468 }, { 1469 key: "bindHides", 1470 value: function(hideTrigger) { 1471 var _this8 = this; 1472 hideTrigger.addEventListener("click", function() { 1473 return _this8.reference.current && "radio" !== _this8.options.type && document.dispatchEvent(_this8.events.hide), 1474 _this8.options.returns; 1475 }); 1476 } 1477 }, { 1478 key: "gatherGroup", 1479 value: function() { 1480 if (this.group = !1, this.elem.hasAttribute(GROUP_ATTR)) { 1481 var groupName = this.elem.getAttribute(GROUP_ATTR); 1482 this.group = document.querySelectorAll("[".concat(GROUP_ATTR, '="').concat(groupName, '"]')); 1483 } 1484 } 1485 }, { 1486 key: "addClass", 1487 value: function(elem, userClass) { 1488 animationFrame(function() { 1489 elem.classList.add(userClass); 1490 }); 1491 } 1492 }, { 1493 key: "removeClass", 1494 value: function(elem, userClass) { 1495 animationFrame(function() { 1496 elem.classList.remove(userClass); 1497 }); 1498 } 1499 }, { 1500 key: "ariaToggle", 1501 value: function(elem) { 1502 _a11y.a11yAriaAttributes.forEach(function(attr) { 1503 elem.hasAttribute(attr) && elem.setAttribute(attr, !("true" === elem.getAttribute(attr))); 1504 }); 1505 } 1506 }, { 1507 key: "show", 1508 value: function(elem) { 1509 this.addClass(elem, this.options.activeClass); 1510 } 1511 }, { 1512 key: "showTargets", 1513 value: function() { 1514 var _this9 = this; 1515 ("function" == typeof this.reference.targets ? this.reference.targets.call(this) : this.reference.targets).forEach(function(target) { 1516 _this9.show(target), _this9.ariaToggle(target); 1517 }); 1518 } 1519 }, { 1520 key: "showFors", 1521 value: function() { 1522 var _this10 = this; 1523 this.reference.fors.forEach(function(forTrigger) { 1524 _this10.show(forTrigger); 1525 }); 1526 } 1527 }, { 1528 key: "showTrigger", 1529 value: function() { 1530 this.show(this.elem), this.ariaToggle(this.elem); 1531 } 1532 }, { 1533 key: "hide", 1534 value: function(elem) { 1535 this.removeClass(elem, this.options.activeClass), elem.classList.contains(this.options.visitedClass) || this.addClass(elem, this.options.visitedClass); 1536 } 1537 }, { 1538 key: "hideTargets", 1539 value: function() { 1540 var _this11 = this; 1541 ("function" == typeof this.reference.targets ? this.reference.targets.call(this) : this.reference.targets).forEac
1541h(function(target) { 1542 _this11.hide(target), _this11.ariaToggle(target); 1543 }); 1544 } 1545 }, { 1546 key: "hideFors", 1547 value: function() { 1548 var _this12 = this; 1549 this.reference.fors.forEach(function(forTrigger) { 1550 _this12.hide(forTrigger); 1551 }); 1552 } 1553 }, { 1554 key: "hideTrigger", 1555 value: function() { 1556 this.hide(this.elem), this.ariaToggle(this.elem); 1557 } 1558 }, { 1559 key: "updateReference", 1560 value: function(argument_0) { 1561 var updates = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : {}, reference = window.Reveal, referenceGroup = !!this.group && reference.groups[this.group], referenceTrigger = reference.triggers[this.identity]; 1562 return this.group && (referenceGroup || (reference.groups[this.group] = this.newReferenceGroup(), 1563 referenceGroup = reference.groups[this.group]), referenceGroup.triggers.indexOf(this.identity) < 0 && referenceGroup.triggers.push(this.identity)), 1564 referenceTrigger || (reference.triggers[this.identity] = this.newReferenceTarget(this.elem), 1565 referenceTrigger = reference.triggers[this.identity]), reference.triggers[this.identity] = Object.assign({}, referenceTrigger, updates), 1566 this.reference = reference.triggers[this.identity], this.reference; 1567 } 1568 }, { 1569 key: "getTargetsFromReference", 1570 value: function() { 1571 return this.reference.targets; 1572 } 1573 } ]), RevealTrigger; 1574 }(); 1575 exports.default = RevealTrigger; 1576 }, { 1577 "../utilities/a11y": 14, 1578 "../utilities/heifer.animationFrame.es6": 17, 1579 "../utilities/heifer.utilities": 19, 1580 "core-js/modules/es6.array.from": 240, 1581 "core-js/modules/es6.object.assign": 248, 1582 "core-js/modules/es6.object.to-string": 252, 1583 "core-js/modules/es6.promise": 253, 1584 "core-js/modules/es6.regexp.split": 261, 1585 "core-js/modules/es6.string.iterator": 265 1586 } ], 1587 12: [ function(require, module, exports) { 1588 "use strict"; 1589 Object.defineProperty(exports, "__esModule", { 1590 value: !0 1591 }), exports.default = void 0; 1592 var obj, _heifer = require("../utilities/heifer.utilities"), _revealTrigger = (obj = require("./reveal-trigger.es6")) && obj.__esModule ? obj : { 1593 default: obj 1594 }; 1595 function _defineProperties(target, props) { 1596 for (var i = 0; i < props.length; i++) { 1597 var descriptor = props[i]; 1598 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 1599 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 1600 } 1601 } 1602 var queueDoneEvent = (0, _heifer.uCreateCustomEvent)("reveal/queue/done"), Reveal = function() { 1603 function Reveal(elems, userOptions) { 1604 return function(instance, Constructor) { 1605 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 1606 }(this, Reveal), !!elems && (!("string" == typeof elems && !(elems = document.querySelectorAll(elems)).length) && (!!(elems = elems && (elems.length ? [].slice.call(elems) : [ elems ])).length && (this.revealTriggers = elems.map(function(elem) { 1607 return new _revealTrigger.default(elem, userOptions); 1608 }), void this.executeQueue()))); 1609 } 1610 return function(Constructor, protoProps, staticProps) { 1611 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 1612 }(Reveal, [ { 1613 key: "executeQueue", 1614 value: function() { 1615 var queue = window.Reveal.queue; 1616 queue.length && queue.forEach(function(queueEvent) { 1617 document.dispatchEvent(queueEvent); 1618 }), window.Reveal.queue = [], document.dispatchEvent(queueDoneEvent); 1619 } 1620 } ]), Reveal; 1621 }(); 1622 exports.default = Reveal; 1623 }, {
1624 "../utilities/heifer.utilities": 19, 1625 "./reveal-trigger.es6": 11 1626 } ], 1627 13: [ function(require, module, exports) { 1628 "use strict"; 1629 function ownKeys(object, enumerableOnly) { 1630 var keys = Object.keys(object); 1631 if (Object.getOwnPropertySymbols) { 1632 var symbols = Object.getOwnPropertySymbols(object); 1633 enumerableOnly && (symbols = symbols.filter(function(sym) { 1634 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 1635 })), keys.push.apply(keys, symbols); 1636 } 1637 return keys; 1638 } 1639 function _objectSpread(target) { 1640 for (var i = 1; i < arguments.length; i++) { 1641 var source = null != arguments[i] ? arguments[i] : {}; 1642 i % 2 ? ownKeys(source, !0).forEach(function(key) { 1643 _defineProperty(target, key, source[key]); 1644 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 1645 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 1646 }); 1647 } 1648 return target; 1649 } 1650 function _defineProperty(obj, key, value) { 1651 return key in obj ? Object.defineProperty(obj, key, { 1652 value: value, 1653 enumerable: !0, 1654 configurable: !0, 1655 writable: !0 1656 }) : obj[key] = value, obj; 1657 } 1658 function _defineProperties(target, props) { 1659 for (var i = 0; i < props.length; i++) { 1660 var descriptor = props[i]; 1661 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 1662 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 1663 } 1664 } 1665 Object.defineProperty(exports, "__esModule", { 1666 value: !0 1667 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 1668 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 1669 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.keys"), 1670 require("core-js/modules/es6.promise"), require("core-js/modules/es6.object.to-string"), 1671 require("core-js/modules/es6.math.sign"), require("core-js/modules/es6.string.iterator"), 1672 require("core-js/modules/es6.array.from"); 1673 var Slider = function() { 1674 function Slider(elem) { 1675 var options = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; 1676 !function(instance, Constructor) { 1677 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 1678 }(this, Slider); 1679 var defaults = { 1680 swipeThreshold: 80, 1681 start: 0, 1682 onSlide: null, 1683 beforeSlide: null, 1684 autoPlay: !1, 1685 speed: 5e3, 1686 loop: !0, 1687 progressIndicators: !1, 1688 progressIndicatorsNav: !0, 1689 progressIncrement: 1, 1690 visibleSlides: { 1691 0: 1 1692 }, 1693 slideActiveClass: "is-current", 1694 slidePrevClass: "is-prev", 1695 slideNextClass: "is-next", 1696 progressListSelector: ".js-slides__progress-list", 1697 progressListItemSelector: ".js-slides__progress-list-item", 1698 slidesListSelector: ".js-slides", 1699 slideSelector: ".js-slide", 1700 prevButtonSelector: ".js-slider__direction-nav-prev", 1701 nextButtonSelector: ".js-slider__direction-nav-next", 1702 draggingClass: "is-dragging", 1703 playPauseButtonClass: "js-slider__play-pause-button" 1704 }; 1705 this._defaults = defaults, this.options = _objectSpread({}, defaults, {}, options), 1706 this.slider = elem, this.slidesList = this.slider.querySelector(this.options.slidesListSelector),
1707 this.slides = this.getSlides(), this.prevButtons = this.slider.querySelectorAll(this.options.prevButtonSelector), 1708 this.nextButtons = this.slider.querySelectorAll(this.options.nextButtonSelector), 1709 this.progressIndicators = this.getProgressIndicators(), this.prepA11y(), this.options.autoPlay && (this.isPlaying = !0, 1710 this.playPauseButton = this.getPlayPauseButton()), this.bindEvents(), this.timer = null, 1711 this.horizontalCoords = null, this.currentOffset = 0, this.locked = !1, this.start = Math.max(0, this.options.start - 1), 1712 this.state = this.getInitialState(this.start), this.setState(); 1713 } 1714 return function(Constructor, protoProps, staticProps) { 1715 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 1716 }(Slider, [ { 1717 key: "prepA11y", 1718 value: function() { 1719 this.slider.tabIndex = 0, this.slider.setAttribute("role", "region"), this.slider.setAttribute("aria-label", "gallery"); 1720 } 1721 }, { 1722 key: "getPlayPauseButton", 1723 value: function() { 1724 var playPauseButton = this.slider.querySelector(".".concat(this.options.playPauseButtonClass)); 1725 return playPauseButton || this.createPlayPauseButton(); 1726 } 1727 }, { 1728 key: "createPlayPauseButton", 1729 value: function() { 1730 var button = document.createElement("button"); 1731 return button.classList.add(this.options.playPauseButtonClass), button.type = "button", 1732 button.innerHTML = "Pause", this.slider.appendChild(button), button; 1733 } 1734 }, { 1735 key: "onPlayPauseClick", 1736 value: function() { 1737 this.isPlaying ? this.pause() : this.play(); 1738 } 1739 }, { 1740 key: "pause", 1741 value: function() { 1742 this.playPauseButton.innerHTML = "Play", this.timer = this.clearTimer(), this.isPlaying = !1; 1743 } 1744 }, { 1745 key: "play", 1746 value: function() { 1747 this.playPauseButton.innerHTML = "Pause", this.timer = this.createTimer(), this.isPlaying = !0; 1748 } 1749 }, { 1750 key: "getInitialState", 1751 value: function(argument_0) { 1752 var start = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.start; 1753 return this.getNextState(start); 1754 } 1755 }, { 1756 key: "getProgressIndicators", 1757 value: function() { 1758 var _this = this, lists = this.slider.querySelectorAll(this.options.progressListSelector); 1759 if (lists.length) { 1760 var indicators = []; 1761 if ([].forEach.call(lists, function(list) { 1762 var listArray = [].map.call(list.querySelectorAll(_this.options.progressListItemSelector), function(listItem, index) { 1763 return _this.bindProgressIndicator(listItem, index), listItem; 1764 }); 1765 listArray.length && indicators.push(listArray); 1766 }), indicators.length) return indicators; 1767 } 1768 return this.options.progressIndicators ? this.createProgressIndicators() : []; 1769 } 1770 }, { 1771 key: "createProgressIndicators", 1772 value: function() { 1773 var _this2 = this, docFrag = new DocumentFragment(), list = document.createElement("ul"); 1774 list.classList.add("slider__indicators-list"), docFrag.appendChild(list); 1775 var indicators = this.slides.map(function(slide, index) { 1776 var _this2$createProgress = _this2.createProgressIndicator(index), indicator = _this2$createProgress.indicator, button = _this2$createProgress.button; 1777 return list.appendChild(indicator), button; 1778 }); 1779 return this.slider.appendChild(list), [ indicators ]; 1780 } 1781 }, { 1782 key: "createProgressIndicator", 1783 value: function(index) { 1784 var indicator = document.createElement("li"); 1785 indicator.classList.add("slider__indicators-list-item"); 1786 var button = document.createElement("button"); 1787 return button.classList.add("slider__indicators-button"), button.type = "button",
1788 button.innerHTML = "Skip to Slide ".concat(index + 1), button.tabIndex = -1, this.bindProgressIndicator(button, index), 1789 indicator.appendChild(button), { 1790 indicator: indicator, 1791 button: button 1792 }; 1793 } 1794 }, { 1795 key: "bindProgressIndicator", 1796 value: function(indicator, index) { 1797 var _this3 = this; 1798 this.options.progressIndicatorsNav && indicator.addEventListener("click", function() { 1799 _this3.onIndicatorClick(index); 1800 }); 1801 } 1802 }, { 1803 key: "getSlides", 1804 value: function() { 1805 return Array.from(this.slider.querySelectorAll(this.options.slideSelector)); 1806 } 1807 }, { 1808 key: "onIndicatorClick", 1809 value: function(index) { 1810 return this.setStateByIndex(index); 1811 } 1812 }, { 1813 key: "lockSlider", 1814 value: function(e) { 1815 this.locked = !0, this.options.autoPlay && this.pause(), this.horizontalCoords = this.getHorizontalTouchCoord(e), 1816 this.slidesList.classList.add(this.options.draggingClass); 1817 } 1818 }, { 1819 key: "getHorizontalTouchCoord", 1820 value: function(e) { 1821 return this.getTouchChanges(e).clientX; 1822 } 1823 }, { 1824 key: "moveSlider", 1825 value: function(e) { 1826 if (this.locked) { 1827 this.options.autoPlay && this.play(), this.slidesList.classList.remove(this.options.draggingClass); 1828 var horizontalDelta = this.getHorizontalTouchCoord(e) - this.horizontalCoords, direction = Math.sign(horizontalDelta); 1829 horizontalDelta && (horizontalDelta > this.options.swipeThreshold || horizontalDelta < -this.options.swipeThreshold ? 0 < direction ? this.prevSlide() : direction < 0 && this.nextSlide() : this.setStateByIndex(this.state.current)), 1830 this.locked = !1, this.horizontalCoords = null; 1831 } 1832 } 1833 }, { 1834 key: "getTouchChanges", 1835 value: function(e) { 1836 return e.changedTouches ? e.changedTouches[0] : e; 1837 } 1838 }, { 1839 key: "bindEvents", 1840 value: function() { 1841 var _this4 = this; 1842 [].forEach.call(this.prevButtons, function(button) { 1843 button.addEventListener("click", _this4.prevSlide.bind(_this4)); 1844 }), [].forEach.call(this.nextButtons, function(button) { 1845 button.addEventListener("click", _this4.nextSlide.bind(_this4)); 1846 }), this.slider.addEventListener("mousedown", this.lockSlider.bind(this)), this.slider.addEventListener("touchstart", this.lockSlider.bind(this)), 1847 this.slider.addEventListener("mousemove", this.dragSlider.bind(this)), this.slider.addEventListener("touchmove", this.dragSlider.bind(this)), 1848 document.addEventListener("mouseout", this.moveSlider.bind(this)), this.slider.addEventListener("mouseup", this.moveSlider.bind(this)), 1849 this.slider.addEventListener("touchend", this.moveSlider.bind(this)), document.addEventListener("keydown", function(ev) { 1850 document.activeElement === _this4.slider && (ev = ev || window.event, _this4.handleKeydown(ev)); 1851 }), this.options.autoPlay && (this.playPauseButton.addEventListener("click", this.onPlayPauseClick.bind(this)), 1852 this.timer = this.createTimer()); 1853 } 1854 }, { 1855 key: "focusOnSlide", 1856 value: function(e) { 1857 var closestSlide = document.activeElement.closest(this.options.slideSelector); 1858 document.activeElement.closest(this.options.slideSelector) && (this.slidesList.scrollTo(0, 0), 1859 this.setStateByIndex(this.slides.indexOf(closestSlide))); 1860 } 1861 }, { 1862 key: "dragSlider", 1863 value: function(e) { 1864 this.locked && this.slidesList.style.setProperty("--slidesOffset", "".concat(Math.round(this.getHorizontalTouchCoord(e) - this.horizontalCoords + this.currentOffset), "px")); 1865 } 1866 }, { 1867 key: "handleKeydown", 1868 value: function(ev) { 1869 var keyCode = ev.keyCode; 1870 "38" == keyCode || "40" == keyCode || ("37" == keyCode ? (this.prevSlide(), ev.preventDefault()) : "39" == keyCode && (this.nextSlide(), 1871 ev.preventDefault())); 1872 } 1873 }, { 1874 key: "createTimer", 1875 value: function() { 1876 var _this5 = this; 1877 return window.setTimeout(function() { 1878 _this5.nextSlide(); 1879 }, this.options.speed); 1880 } 1881 }, { 1882 key: "getSlideIndex", 1883 value: function(index) { 1884 var last = this.slides.length - 1; 1885 return index < 0 ? last : last < index ? 0 : index; 1886 } 1887 }, { 1888 key: "getNextIndex", 1889 value: function(argument_0) { 1890 var current = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.state.current; 1891 return current === this.slides.length - 1 ? this.options.loop ? 0 : current : current + 1; 1892 } 1893 }, { 1894 key: "getPrevIndex", 1895 value: function(argument_0) { 1896 var current = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.state.current; 1897 return 0 === current ? this.options.loop ? this.slides.length - 1 : current : current - 1; 1898 } 1899 }, { 1900 key: "getNextState", 1901 value: function(nextCurrentIndex) { 1902 return { 1903 prev: this.getPrevIndex(nextCurrentIndex), 1904 current: nextCurrentIndex, 1905 next: this.getNextIndex(nextCurrentIndex) 1906 }; 1907 } 1908 }, { 1909 key: "prevSlide", 1910 value: function() { 1911 return this.setStateByIndex(this.getPrevIndex()); 1912 } 1913 }, { 1914 key: "nextSlide", 1915 value: function() { 1916 return this.setStateByIndex(this.getNextIndex()); 1917 } 1918 }, { 1919 key: "clearTimer", 1920 value: function() { 1921 return this.timer && window.clearTimeout(this.timer), null; 1922 } 1923 }, { 1924 key: "setPrevClasses", 1925 value: function(slide) { 1926 slide.classList.remove(this.options.slideActiveClass, this.options.slideNextClass), 1927 slide.classList.add(this.options.slidePrevClass); 1928 } 1929 }, { 1930 key: "setCurrentClasses", 1931 value: function(slide) { 1932 slide.classList.remove(this.options.slidePrevClass, this.options.slideNextClass), 1933 slide.classList.add(this.options.slideActiveClass); 1934 } 1935 }, { 1936 key: "setNextClasses", 1937 value: function(slide) { 1938 slide.classList.remove(this.options.slideActiveClass, this.options.slidePrevClass), 1939 slide.classList.add(this.options.slideNextClass); 1940 } 1941 }, { 1942 key: "clearClasses", 1943 value: function(slide) { 1944 slide.classList.remove(this.options.slideActiveClass, this.options.slidePrevClass, this.options.slideNextClass); 1945 } 1946 }, { 1947 key: "setStateByIndex", 1948 value: function(argument_0) { 1949 var index = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : 0; 1950 this.options.autoPlay && (this.timer = this.clearTimer());
1951 var nextCurrentIndex = this.getSlideIndex(index), renderedState = this.setState(this.getNextState(nextCurrentIndex), _objectSpread({}, this.state)); 1952 return this.options.autoPlay && this.isPlaying && (this.timer = this.createTimer()), 1953 renderedState; 1954 } 1955 }, { 1956 key: "setState", 1957 value: function(state, prevState) { 1958 var _this6 = this; 1959 return new Promise(function(resolve) { 1960 state && (_this6.state = _objectSpread({}, state)), _this6.renderState(_this6.state, prevState, resolve); 1961 }); 1962 } 1963 }, { 1964 key: "renderState", 1965 value: function(argument_0, argument_1, argument_2) { 1966 var _this7 = this, state = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.state, prevState = 1 < arguments.length ? argument_1 : void 0, resolve = 2 < arguments.length ? argument_2 : void 0; 1967 return window.requestAnimationFrame(function() { 1968 new Promise(function(beforeSlideResolve, beforeSlideReject) { 1969 "function" == typeof _this7.options.beforeSlide ? _this7.options.beforeSlide.call(_this7, { 1970 elems: { 1971 prev: _this7.slides[state.prev], 1972 current: _this7.slides[state.current], 1973 next: _this7.slides[state.next] 1974 }, 1975 currentState: state, 1976 prevState: prevState, 1977 direction: prevState ? state.current === prevState.current ? "same" : state.current > prevState.current ? "next" : "prev" : "same" 1978 }, beforeSlideResolve, beforeSlideReject) : beforeSlideResolve(); 1979 }).then(function(data) { 1980 _this7.renderSequence(state), window.requestAnimationFrame(function() { 1981 _this7.onRender(); 1982 }); 1983 }); 1984 return resolve(); 1985 }); 1986 } 1987 }, { 1988 key: "renderSequence", 1989 value: function(argument_0) { 1990 var _this8 = this, state = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.state; 1991 this.slides.map(function(slide, index) { 1992 _this8.setStateClasses(slide, index, state), _this8.progressIndicators.length && _this8.progressIndicators.forEach(function(list) { 1993 _this8.setStateClasses(list[index], index, state); 1994 }); 1995 }), this.options.loop || this.renderButtonState(); 1996 } 1997 }, { 1998 key: "renderButtonState", 1999 value: function() { 2000 this.canGoPrev() ? this.setButtonClassAndProps(this.prevButtons, !1) : this.setButtonClassAndProps(this.prevButtons, !0), 2001 this.canGoNext() ? this.setButtonClassAndProps(this.nextButtons, !1) : this.setButtonClassAndProps(this.nextButtons, !0); 2002 } 2003 }, { 2004 key: "setButtonClassAndProps", 2005 value: function(buttons, argument_1) { 2006 var disabled = 1 < arguments.length && void 0 !== argument_1 && argument_1; 2007 [].forEach.call(buttons, function(button) { 2008 disabled && !button.disabled && (button.disabled = !0, button.classList.add("is-disabled")), 2009 !disabled && button.disabled && (button.disabled = !1, button.classList.remove("is-disabled")); 2010 }); 2011 } 2012 }, { 2013 key: "canGoPrev", 2014 value: function(argument_0) { 2015 var state = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.state; 2016 return state.prev !== state.current; 2017 } 2018 }, { 2019 key: "canGoNext", 2020 value: function(argument_0) { 2021 var state = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.state; 2022 return state.next !== state.current; 2023 } 2024 }, { 2025 key: "setStateClasses", 2026 value: function(item, index, argument_2) { 2027 var state = 2 < arguments.length && void 0 !== argument_2 ? argument_2 : this.state; 2028 return index === this.state.current ? this.setCurrentClasses(item) : index === state.next ? this.setNextClasses(item) : index === state.prev ? this.setPrevClasses(item) : this.clearClasses(item), 2029 item; 2030 } 2031 }, { 2032 key: "onRender", 2033 value: function() { 2034 "function" == typeof this.options.onSlide && this.options.onSlide.call(this, this.slides[this.state.current]); 2035 } 2036 } ]), Slider; 2037 }(); 2038 exports.default = Slider; 2039 }, {
2040 "core-js/modules/es6.array.from": 240, 2041 "core-js/modules/es6.array.iterator": 241, 2042 "core-js/modules/es6.math.sign": 245, 2043 "core-js/modules/es6.object.keys": 250, 2044 "core-js/modules/es6.object.to-string": 252, 2045 "core-js/modules/es6.promise": 253, 2046 "core-js/modules/es6.string.iterator": 265, 2047 "core-js/modules/es6.symbol": 268, 2048 "core-js/modules/es7.object.get-own-property-descriptors": 272, 2049 "core-js/modules/web.dom.iterable": 274 2050 } ], 2051 14: [ function(require, module, exports) { 2052 "use strict"; 2053 Object.defineProperty(exports, "__esModule", { 2054 value: !0 2055 }), exports.a11yTabindexToggle = a11yTabindexToggle, exports.a11yChildTabindexToggle = function(parent) { 2056 [].forEach.call(parent.querySelectorAll(a11yFocusElements), function(el) { 2057 a11yTabindexToggle(el); 2058 }); 2059 }, exports.a11yToggleAria = function(el) { 2060 a11yAriaAttributes.forEach(function(attr) { 2061 el.hasAttribute(attr) && el.setAttribute(attr, !("true" === el.getAttribute(attr))); 2062 }); 2063 }, exports.a11yAriaAttributes = exports.a11yFocusElements = void 0; 2064 var a11yFocusElements = "a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]"; 2065 exports.a11yFocusElements = a11yFocusElements; 2066 var a11yAriaAttributes = [ "aria-hidden", "aria-expanded", "aria-selected", "aria-checked" ]; 2067 function a11yTabindexToggle(el) { 2068 0 === el.tabIndex ? el.tabIndex = -1 : el.tabIndex = 0; 2069 } 2070 exports.a11yAriaAttributes = a11yAriaAttributes; 2071 }, {} ], 2072 15: [ function(require, module, exports) { 2073 "use strict"; 2074 Object.defineProperty(exports, "__esModule", { 2075 value: !0 2076 }), exports.submitOrder = function(formData) { 2077 var payload = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}, subscription = 2 < arguments.length && void 0 !== arguments[2] && arguments[2], data = {}, token = payload.token && void 0 !== payload.token ? payload.token : ""; 2078 data.checkoutType = payload.type, data.nonce = payload.nonce ? payload.nonce : "free", 2079 data.paymentMethodToken = token, data.blackbaudToken = payload.blackbaudToken ? payload.blackbaudToken : "", 2080 data.paymentDetails = payload.details, data.billingAddress = payload.details && void 0 !== payload.details.billingAddress ? function(payload) { 2081 return { 2082 firstName: payload.details.firstName, 2083 lastName: payload.details.lastName, 2084 email: payload.details.email, 2085 phone: payload.details.phone, 2086 phone_opt_in: payload.details.phone_opt_in, 2087 address1: payload.details.billingAddress.line1, 2088 address2: payload.details.billingAddress.line2, 2089 city: payload.details.billingAddress.city, 2090 country: payload.details.billingAddress.countryCode, 2091 state: payload.details.billingAddress.state, 2092 zip: payload.details.billingAddress.postalCode 2093 }; 2094 }(payload) : getBillingAddressFromData(formData), data.storeId = formData.get("storeId") ? formData.get("storeId") : onePageStoreId, 2095 data.storeId = "Blackbaud" != data.checkoutType ? data.storeId : "18" === data.storeId ? blackbaudUpsellStoreId : blackbaudStoreId, 2096 data.userAgent = navigator.userAgent, data.dunce = formData.get("dunce") ? formData.get("dunce") : "", 2097 data.order = { 2098 emailOptIn: formData.get("emailOptIn") ? formData.get("emailOptIn") : 0, 2099 orderHonoree: formData.get("orderHonoree") ? formData.get("orderHonoree") : "", 2100 orderHonoreeOccasion: formData.get("orderHonoreeOccasion") ? formData.get("orderHonoreeOccasion") : "", 2101 orderHonoreeEmail: formData.get("orderHonoreeEmail") ? formData.get("orderHonoreeEmail") : "", 2102 orderHonoreeMessage: formData.get("orderHonoreeMessage") ? formData.get("orderHonoreeMessage") : "" 2103 }, data.premiumVariation = formData.get("premiumVariation") ? formData.get("premiumVariation") : "", 2104 data.coverProcessingFee = formData.get("coverProcessingFee"), data.giftCardCode = formData.get("giftCardCode"), 2105 data.deviceData = formData.get("deviceData"), data.donationCart = formData.get("donationCart") ? formData.get("donationCart") : 0, 2106 data.totalCost = formData.get("totalCost") ? formData.get("totalCost") : 0, data.productUUID = formData.get("productUUID") ? formData.get("productUUID") : "", 2107 subscription && (data.programName = formData.get("programName") ? formData.get("programName") : "", 2108 data.paymentDay = formData.get("paymentDay") ? formData.get("paymentDay") : "", 2109 data.userId = formData.get("userId") ? formData.get("userId") : ""); 2110 document.querySelector('[name="optOutPromotional"]:checked') && (data.optOutPromotional = formData.get("optOutPromotional") ? formData.get("optOutPromotional") : 0); 2111 document.querySelector('[name="buying_on_behalf[]"]') && (data.order.donate_individual = "individual" == formData.get("buying_on_behalf[]") ? "True" : null, 2112 "organization" == formData.get("buying_on_behalf[]") && (data.order = getGroupInformationFromData(formData, data.order))); 2113 data.order.donationShippable = 0, document.querySelector("[name='donationShippable']") && (data.order.donationShippable = JSON.parse(formData.get("donationShippable")) ? 1 : 0); 2114 data.order = _objectSpread({}, data.order, {}, getCartTotals(formData, formDataHasProcessingFee(formData), formDataHasShippingCost(formData), formDataHasTaxCost(formData))), 2115 (formData.getAll("donation-one-time").length || formData.getAll("donation-monthly").length) && (data.products = getProductsFromData(formData)); 2116 return data.meta = { 2117 fohFormEntry: formData.get("fohFormEntry") ? 1 : 0, 2118 customEmail: formData.get("customEmail") ? 1 : 0, 2119 customEmailTextUrl: formData.get("customEmailTextUrl") ? formData.get("customEmailTextUrl") : 0, 2120 customEmailTemplate: formData.get("customEmailTemplate") ? formData.get("customEmailTemplate") : 0 2121 }, subscription ? (0, _braintreeCheckout.default)(data, "/api/subscription/create.html") : (0, 2122 _braintreeCheckout.default)(data); 2123 }, exports.getCartTotals = getCartTotals, exports.getBillingAddressFromData = getBillingAddressFromData, 2124 exports.getShippingAddressFromData = function(formData) { 2125 var shippingAddress = {}; 2126 formData.get("shipping_address1") && (shippingAddress = { 2127 firstName: formData.get("shipping_firstName"), 2128 lastName: formData.get("shipping_lastName"), 2129 address1: formData.get("shipping_address1"), 2130 address2: formData.get("shipping_address2"), 2131 city: formData.get("shipping_city"), 2132 country: formData.get("shipping_country"), 2133 state: formData.get("shipping_state"), 2134 zip: formData.get("shipping_zip") 2135 }); 2136 return shippingAddress; 2137 }, exports.getGroupInformationFromData = getGroupInformationFromData, exports.getRoundedAmount = getRoundedAmount, 2138 exports.getPrettyAmount = getPrettyAmount, exports.updateTotals = function(formElem, totalElem, processingFeeElem, processingFeeInput, calculateProcessingFeeForInputs, includeProcessingFeeInTotal, subtotalElems, discountElems) { 2139 if (formElem) { 2140 var formData = new window.FormData(formElem), _getCartTotals = getCartTotals(formData, calculateProcessingFeeForInputs, includeProcessingFeeInTotal, formDataHasShippingCost(formData), formDataHasTaxCost(formData)), total = _getCartTotals.total, processingFee = _getCartTotals.processingFee, subtotal = _getCartTotals.subtotal, discountApplied = _getCartTotals.discountApplied; 2141 totalElem && (totalElem.innerHTML = getPrettyAmount(total)), processingFeeElem && (processingFeeElem.innerHTML = getPrettyAmount(processingFee)), 2142 processingFeeInput && (processingFeeInput.value = processingFee), subtotalElems && [].forEach.call(subtotalElems, function(subtotalElem) { 2143 subtotalElem.innerHTML = getPrettyAmount(subtotal); 2144 }), discountElems && [].forEach.call(discountElems, function(discountElem) { 2145 discountElem.innerHTML = getPrettyAmount(discountApplied); 2146 }); 2147 } 2148 }, exports.updateProductData = function(input, update) { 2149 var productObject = JSON.parse(input.value), newInputValue = JSON.stringify(_objectSpread({}, productObject, {}, update)); 2150 input.value = newInputValue; 2151 }, exports.getProductData = function(input, data) { 2152 return JSON.parse(input.value)[data]; 2153 }, exports.formDataHasProcessingFee = formDataHasProcessingFee, exports.onCartAdd = function(productData) { 2154 var push = (0, _gtm.createEventData)("add_to_cart", [ productData ].map(_gtm.getDataForGTM)); 2155 dataLayer.push(push); 2156 }, exports.onCartRemove = function(productData) { 2157 var push = (0, _gtm.createEventData)("remove_from_cart", [ productData ].map(_gtm.getDataForGTM)); 2158 dataLayer.push(push); 2159 }, exports.preCheckCCFee = function() { 2160 var subtotalElement = document.querySelector(".js-cart__subtotal"), coverProcessingFeeInput = document.querySelector(".js-cart__cover-processing-fee-input"); 2161 if (!subtotalElement || !coverProcessingFeeInput) return; 2162 parseFloat(subtotalElement.textContent.replace(",", "")) <= 500 ? c
2162overProcessingFeeInput.checked = !0 : coverProcessingFeeInput.checked = !1; 2163 }, exports.CART_REMOVE_PRODUCT_URL = exports.CART_EDIT_PRODUCT_URL = exports.CART_ADD_PRODUCT_URL = void 0, 2164 require("core-js/modules/es6.string.iterator"), require("core-js/modules/es6.array.from"), 2165 require("core-js/modules/es6.regexp.to-string"), require("core-js/modules/es6.date.to-string"), 2166 require("core-js/modules/es7.symbol.async-iterator"), require("core-js/modules/es7.object.get-own-property-descriptors"), 2167 require("core-js/modules/es6.symbol"), require("core-js/modules/es6.regexp.replace"), 2168 require("core-js/modules/web.dom.iterable"), require("core-js/modules/es6.array.iterator"), 2169 require("core-js/modules/es6.object.to-string"), require("core-js/modules/es6.object.keys"); 2170 var _braintreeCheckout = _interopRequireDefault(require("./../../shared/forms/braintreeCheckout/braintreeCheckout")), _heifer = require("./heifer.utilities"), _gtm = (_interopRequireDefault(require("formdata-polyfill")), 2171 require("../utilities/gtm.utilities")); 2172 function _interopRequireDefault(obj) { 2173 return obj && obj.__esModule ? obj : { 2174 default: obj 2175 }; 2176 } 2177 function _toConsumableArray(arr) { 2178 return function(arr) { 2179 if (Array.isArray(arr)) { 2180 for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; 2181 return arr2; 2182 } 2183 }(arr) || function(iter) { 2184 if (Symbol.iterator in Object(iter) || "[object Arguments]" === Object.prototype.toString.call(iter)) return Array.from(iter); 2185 }(arr) || function() { 2186 throw new TypeError("Invalid attempt to spread non-iterable instance"); 2187 }(); 2188 } 2189 function ownKeys(object, enumerableOnly) { 2190 var keys = Object.keys(object); 2191 if (Object.getOwnPropertySymbols) { 2192 var symbols = Object.getOwnPropertySymbols(object); 2193 enumerableOnly && (symbols = symbols.filter(function(sym) { 2194 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 2195 })), keys.push.apply(keys, symbols); 2196 } 2197 return keys; 2198 } 2199 function _objectSpread(target) { 2200 for (var i = 1; i < arguments.length; i++) { 2201 var source = null != arguments[i] ? arguments[i] : {}; 2202 i % 2 ? ownKeys(source, !0).forEach(function(key) { 2203 _defineProperty(target, key, source[key]); 2204 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 2205 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 2206 }); 2207 } 2208 return target; 2209 } 2210 function _defineProperty(obj, key, value) { 2211 return key in obj ? Object.defineProperty(obj, key, { 2212 value: value, 2213 enumerable: !0, 2214 configurable: !0, 2215 writable: !0 2216 }) : obj[key] = value, obj; 2217 } 2218 var processingFeeFlat = 0, onePageStoreId = 12, blackbaudStoreId = 17, blackbaudUpsellStoreId = 18; 2219 exports.CART_ADD_PRODUCT_URL = "/api/cart/add.html"; 2220 exports.CART_EDIT_PRODUCT_URL = "/api/cart/edit.html"; 2221 function getCartTotals(formData) { 2222 var returnProcessingFee = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], includeProcessingFeeInTotal = !(2 < arguments.length && void 0 !== arguments[2]) || arguments[2], includeShippingCost = !(3 < arguments.length && void 0 !== arguments[3]) || arguments[3], includeTaxCost = !(4 < arguments.length && void 0 !== arguments[4]) || arguments[4], totals = { 2223 total: 0, 2224 subtotal: 0, 2225 discountedSubtotal: 0, 2226 discountApplied: 0, 2227 orderShippingCost: 0, 2228 orderSalesTax: 0, 2229 processingFee: 0, 2230 giftCardDiscount: 0 2231 }; 2232 return totals.giftCardDiscount = formData.has("giftCardAmount") ? parseFloat(formData.get("giftCardAmount")) : 0, 2233 totals.subtotal = getSubtotalAmount(formData), totals.discountedSubtotal = getSubtotalAmount(formData, totals.giftCardDiscount), 2234 totals.discountApplied = totals.subtotal - totals.discountedSubtotal, (includeShippingCost || formDataHasShippingCost(formData)) && (totals.orderShippingCost = formData.get("shippingCost") ? parseFloat(formData.get("shippingCost")) : 0), 2235 (includeTaxCost || formDataHasTaxCost(formData)) && (totals.orderSalesTax = formData.get("taxCost") ? parseFloat(formData.get("taxCost")) : 0), 2236 returnProcessingFee && (totals.processingFee = function(total) { 2237 var flat = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : processingFeeFlat; 2238 if (total <= 0) return getRoundedAmount(flat); 2239 return getRoundedAmount((10 <= total && total <= 100 ? 4.9 : 100 < total && total <= 300 ? 3.9 : 300 < total && total <= 450 ? 2.5 : 1.9) / 100 * total); 2240 }(totals.discountedSubtotal + totals.orderSalesTax)), totals.total = getRoundedAmount(totals.discountedSubtotal + totals.orderSalesTax + totals.orderShippingCost), 2241 includeProcessingFeeInTotal && (totals.total = getRoundedAmount(totals.total + totals.processingFee)), 2242 totals; 2243 } 2244 function getBillingAddressFromData(formData) { 2245 return { 2246 firstName: formData.get("firstName"), 2247 lastName: formData.get("lastName"), 2248 email: formData.get("email"), 2249 phone: formData.get("phone"), 2250 phone_opt_in: formData.get("phone_opt_in"), 2251 address1: formData.get("address1"), 2252 address2: formData.get("address2"), 2253 company: formData.get("company"), 2254 city: formData.get("city"), 2255 country: formData.get("country"), 2256 state: formData.get("state"), 2257 zip: formData.get("zip") 2258 }; 2259 } 2260 function getGroupInformationFromData(formData, order) { 2261 return order.donate_group = formData.get("buying_on_behalf_name") ? formData.get("buying_on_behalf_name") : null, 2262 order.donate_group_type = formData.get("buying_on_behalf_type") ? formData.get("buying_on_behalf_type") : null, 2263 order.donate_group_address_1 = formData.get("buying_on_behalf_address_1") ? formData.get("buying_on_behalf_address_1") : null, 2264 order.donate_group_address_2 = formData.get("buying_on_behalf_address_2") ? formData.get("buying_on_behalf_address_2") : null, 2265 order.donate_group_city = formData.get("buying_on_behalf_city") ? formData.get("buying_on_behalf_city") : null, 2266 order.donate_group_state = formData.get("buying_on_behalf_state") ? formData.get("buying_on_behalf_state") : null, 2267 order.donate_group_zip = formData.get("buying_on_behalf_zip") ? formData.get("buying_on_behalf_zip") : null, 2268 order.donate_group_country = formData.get("buying_on_behalf_country") ? formData.get("buying_on_behalf_country") : null, 2269 order;
2270 } 2271 function getProductsFromData(formData) { 2272 var donations = [], products = []; 2273 return formData.getAll("donation-one-time").length && (donations = _toConsumableArray(getDonationsFromData(formData, formData.getAll("donation-one-time")))), 2274 formData.getAll("donation-monthly").length && (donations = _toConsumableArray(getDonationsFromData(formData, formData.getAll("donation-monthly")))), 2275 formData.getAll("donation-subscription").length && (donations = _toConsumableArray(getDonationsFromData(formData, formData.getAll("donation-subscription")))), 2276 formData.getAll("products[]").length && (products = _toConsumableArray(getDonationsFromData(formData, formData.getAll("products[]")))), 2277 formData.getAll("products").length && (products = _toConsumableArray(getDonationsFromData(formData, formData.getAll("products")))), 2278 [].concat(_toConsumableArray(donations), _toConsumableArray(products)); 2279 } 2280 function getSubtotalAmount(formData, argument_1) { 2281 var discount = 1 < arguments.length && void 0 !== argument_1 ? argument_1 : 0; 2282 return getRoundedAmount({ 2283 products: formData.hasOwnProperty("products") ? uTypeOf("String", formData.products) ? JSON.parse(formData.products) : formData.products : getProductsFromData(formData) 2284 }.products.reduce(function(prev, product) { 2285 var productTotal = product.hasOwnProperty("quantity") ? product.amount * product.quantity : product.amount; 2286 return 0 < discount && (product.isGiftCardEligible || product.hasOwnProperty("gift_card_eligible") && product.gift_card_eligible) && !product.isMonthly && (discount <= productTotal ? (productTotal -= discount, 2287 discount = 0) : (discount -= productTotal, productTotal = 0)), prev + productTotal; 2288 }, 0)); 2289 } 2290 function getDonationsFromData(formData, donationData) { 2291 var donations = []; 2292 return donationData.forEach(function(value, key) { 2293 if (value) { 2294 var productObject, defaultProductObject = { 2295 productUUID: null, 2296 isMonthly: 0, 2297 isMatched: 0, 2298 giftCardEligible: !1 2299 }; 2300 if ((0, _heifer.uIsJson)(value)) { 2301 var valueObject = JSON.parse(value); 2302 valueObject.hasOwnProperty("quantity") && (valueObject.quantity = parseInt(valueObject.quantity, 10)), 2303 valueObject.hasOwnProperty("amount") && (valueObject.amount = parseFloat(valueObject.amount, 10)), 2304 valueObject.hasOwnProperty("isGiftCardEligible") && (valueObject.isGiftCardEligible = 1 === valueObject.isGiftCardEligible), 2305 productObject = _objectSpread({}, defaultProductObject, {}, valueObject); 2306 } else { 2307 productObject = _objectSpread({}, defaultProductObject, {}, { 2308 amount: parseFloat(value, 10) 2309 }); 2310 var isMonthly = formData.getAll("isMonthly"); 2311 isMonthly && 1 === isMonthly.length && (productObject.isMonthly = "true" === isMonthly[0] ? 1 : 0); 2312 var isMatched = formData.getAll("isMatched"); 2313 isMatched && 1 === isMatched.length && (productObject.isMatched = "1" === isMatched[0] ? 1 : 0); 2314 var productUUID = formData.getAll("productUUID"); 2315 productUUID && 1 === productUUID.length && (productObject.productUUID = productUUID[0]); 2316 } 2317 donations.push(productObject); 2318 } 2319 }), donations; 2320 } 2321 function getRoundedAmount(num) { 2322 return +(Math.round(100 * num) / 100).toFixed(2); 2323 } 2324 function getPrettyAmount(num) { 2325 if (window.Intl && window.Intl.NumberFormat) return new Intl.NumberFormat("en-US", { 2326 minimumFractionDigits: 2 2327 }).format(num); 2328 var prettyAmount = parseFloat(num.toFixed(2)).toLocaleStr
2328ing(); 2329 return "." !== prettyAmount.substr(-2, 1) && "," !== prettyAmount.substr(-2, 1) || (prettyAmount += "0"), 2330 "." !== prettyAmount.substr(-1, 1) && "," !== prettyAmount.substr(-1, 1) || (prettyAmount += "00"), 2331 prettyAmount; 2332 } 2333 function formDataHasProcessingFee(formData) { 2334 return formData.hasOwnProperty("coverProcessingFee") ? formData.coverProcessingFee && "0" != formData.coverProcessingFee : !!formData.has("coverProcessingFee") && (formData.get("coverProcessingFee") && "0" != formData.get("coverProcessingFee")); 2335 } 2336 function formDataHasShippingCost(formData) { 2337 var shippingCost = "0.00"; 2338 return formData.hasOwnProperty("shippingCost") ? shippingCost = formData.shippingCost : formData.has("shippingCost") && (shippingCost = formData.get("shippingCost")), 2339 "0.00" !== shippingCost; 2340 } 2341 function formDataHasTaxCost(formData) { 2342 var taxCost = "0.00"; 2343 return formData.hasOwnProperty("taxCost") ? taxCost = formData.taxCost : formData.has("taxCost") && (taxCost = formData.get("taxCost")), 2344 "0.00" !== taxCost; 2345 } 2346 exports.CART_REMOVE_PRODUCT_URL = "/api/cart/remove.html"; 2347 }, { 2348 "../utilities/gtm.utilities": 16, 2349 "./../../shared/forms/braintreeCheckout/braintreeCheckout": 72, 2350 "./heifer.utilities": 19, 2351 "core-js/modules/es6.array.from": 240, 2352 "core-js/modules/es6.array.iterator": 241, 2353 "core-js/modules/es6.date.to-string": 243, 2354 "core-js/modules/es6.object.keys": 250, 2355 "core-js/modules/es6.object.to-string": 252, 2356 "core-js/modules/es6.regexp.replace": 259, 2357 "core-js/modules/es6.regexp.to-string": 262, 2358 "core-js/modules/es6.string.iterator": 265, 2359 "core-js/modules/es6.symbol": 268, 2360 "core-js/modules/es7.object.get-own-property-descriptors": 272, 2361 "core-js/modules/es7.symbol.async-iterator": 273, 2362 "core-js/modules/web.dom.iterable": 274, 2363 "formdata-polyfill": 279 2364 } ], 2365 16: [ function(require, module, exports) { 2366 "use strict"; 2367 function getProductsData() { 2368 var products = []; 2369 return [].forEach.call(document.querySelectorAll('input[name="products[]"]'), function(el) { 2370 var gtmData = JSON.parse(el.value); 2371 products.push(gtmData); 2372 }), products; 2373 } 2374 function createEventData(eventName, products) { 2375 return { 2376 event: function(step) { 2377 return { 2378 CartSummary: "view_cart", 2379 CartBilling: "add_shipping_info", 2380 CartPayment: "add_payment_info", 2381 confirmation: "purchase" 2382 }[step] || step; 2383 }(eventName), 2384 ecommerce: { 2385 currency: "USD", 2386 value: products.map(getCostForEachProduct).reduce(function(x, y) { 2387 return x + y; 2388 }, 0), 2389 items: products 2390 } 2391 }; 2392 } 2393 function getDataForGTM(productData, index) { 2394 var id = productData.id, type = productData.type, price_share = productData.price_share, sku_share = productData.sku_share, amount = productData.amount, sku_full = productData.sku_full, isMonthly = productData.isMonthly, sku_monthly = productData.sku_monthly, name = productData.name, quantity = productData.quantity, price = productData.price, sku = id ? String(id) : String(productData.sku); 2395 type && "gift_catalog_share" === type && price_share && sku_share && (sku = Number(amount) === Number(price_share) ? sku_share : sku_full), 2396 isMonthly && "gift_catalog_donation" == type && sku_monthly && (sku = sku_monthly); 2397 var urlParts = getURLData(), itemVariant = isNaN(parseInt(sku.slice(-1))) ? sku.endsWith("s") ? "Share" : sku.endsWith("f") ? "Full" : "Donation" : "Donation"; 2398 return { 2399 item_id: sku, 2400 item_name: name, 2401 quantity: parseInt(quantity), 2402 price: amount || price, 2403 index: index, 2404 item_brand: isMonthly ? "Monthly" : "One Time", 2405 item_category: urlParts[0], 2406 item_category2: urlParts[1], 2407 item_category3: urlParts[2], 2408 item_list_id: name, 2409 item_list_name: productData.miniCartPosition ? "Quick Add" : getListItemName(urlParts[1]), 2410 item_variant: itemVariant 2411 }; 2412 } 2413 function getURLData() { 2414 return new URL(window.location.href).pathname.split("/").slice(1).map(function(element) { 2415 return element.replaceAll("-", " ").replace(".html", "").split(" ").map(function(el) { 2416 return el.replace(/^\w/, function(el) { 2417 return el.toUpperCase(); 2418 }); 2419 }).join(" "); 2420 }); 2421 } 2422 function getCostForEachProduct(productData) { 2423 return parseInt(productData.quantity) * parseFloat(productData.price); 2424 } 2425 function getListItemName(segment) { 2426 return "/gift-catalog/index.html" === new URL(window.location.href).pathname ? "Gift Catalog" : segment; 2427 } 2428 Object.defineProperty(exports, "__esModule", { 2429 value: !0 2430 }), exports.pushProductDetails = function(products) { 2431 if (0 < products.length) { 2432 var push = { 2433 ecommerce: { 2434 event: "details", 2435 detail: { 2436 products: products 2437 } 2438 } 2439 }; 2440 dataLayer.push(push); 2441 } 2442 }, exports.pushConfirmation = function(confirmation) { 2443 if (0 === confirmation.length) return; 2444 var _confirmation$ = confirmation[0], products = _confirmation$.products, id = _
2444confirmation$.id, tax = _confirmation$.tax, shipping = _confirmation$.shipping, push = createEventData("confirmation", products.map(getDataForGTM)); 2445 Object.assign(push.ecommerce, { 2446 id: id, 2447 tax: tax, 2448 shipping: shipping 2449 }), dataLayer.push(push); 2450 }, exports.pushSteps = function(steps) { 2451 if (0 === steps.length || !steps[0].event) return; 2452 var push = createEventData(steps[0].event, steps[0].products.map(getDataForGTM)); 2453 dataLayer.push(push); 2454 }, exports.pushMiniCartLink = function(steps) { 2455 var push = { 2456 event: "ContinueToCart", 2457 ecommerce: { 2458 checkout: { 2459 actionField: { 2460 step: 1, 2461 option: "ContinueToCart" 2462 }, 2463 products: { 2464 id: steps.id, 2465 name: steps.name, 2466 category: steps.category 2467 } 2468 } 2469 } 2470 }; 2471 dataLayer.push(push); 2472 }, exports.pushCookieConsent = function(data) { 2473 var push = { 2474 event: "CookieConsent", 2475 cookieConsent: data 2476 }; 2477 dataLayer.push(push); 2478 }, exports.pushGTMEvent = function(eventName, data) { 2479 var push = { 2480 event: eventName, 2481 data: data 2482 }; 2483 dataLayer.push(push); 2484 }, exports.pushAltPayEvent = function(eventName) { 2485 var push = function(eventName) { 2486 var products = getProductsData(); 2487 products.length || (products = function() { 2488 var products = [], amount = document.querySelector(".js-donationCard__total-number").innerHTML, el = document.querySelector(".js-gtm-push-item-view"), gtmData = JSON.parse(el.value), isMonthly = !0 === document.querySelectorAll('input[name="isMonthly"]:not(:disabled)')[0].value; 2489 return Object.assign(gtmData, { 2490 amount: amount, 2491 isMonthly: isMonthly 2492 }), products.push(gtmData), products; 2493 }()); 2494 var paymentType = eventName.split(" ")[0], push = createEventData(eventName, products.map(getDataForGTM)); 2495 return push.ecommerce.payment_type = paymentType, push; 2496 }(eventName); 2497 dataLayer.push(push); 2498 }, exports.getProductsData = getProductsData, exports.createEventData = createEventData, 2499 exports.getDataForGTM = getDataForGTM, exports.getURLData = getURLData, exports.getCostForEachProduct = getCostForEachProduct, 2500 exports.captureVisibleProduct = function() { 2501 var el; 2502 if (document.querySelector(".giftCatalogProductTabs__tab") && document.querySelector(".giftCatalogProductTabs__tab-link")) { 2503 var val = document.querySelector(".is-default .giftCatalogProductTabs__tab-link").dataset.reveal; 2504 el = document.getElementById(val).querySelector(".js-gtm-push-item-view"); 2505 } else el = document.querySelector(".js-gtm-push-item-view"); 2506 return [ JSON.parse(el.value) ]; 2507 }, exports.pushDataLayerEvent = function(eventName, products) { 2508 if (0 === products.length) return; 2509 var push = createEventData(eventName, products.map(getDataForGTM)); 2510 dataLayer.push(push); 2511 }, exports.getListItemName = getListItemName, require("core-js/modules/es6.regexp.replace"), 2512 require("core-js/modules/es6.string.ends-with"), require("core-js/modules/es6.number.constructor"), 2513 require("core-js/modules/es6.regexp.split"), require("core-js/modules/es6.function.name"), 2514 require("core-js/modules/es6.object.assign"); 2515 }, { 2516 "core-js/modules/es6.function.name": 244, 2517 "core-js/modules/es6.number.constructor": 247, 2518 "core-js/modules/es6.object.assign": 248, 2519 "core-js/modules/es6.regexp.replace": 259, 2520 "core-js/modules/es6.regexp.split": 261, 2521 "core-js/modules/es6.string.ends-with": 263 2522 } ],
2523 17: [ function(require, module, exports) { 2524 "use strict"; 2525 Object.defineProperty(exports, "__esModule", { 2526 value: !0 2527 }), exports.default = function() { 2528 return window.requestAnimationFrame || function(callback, elem) { 2529 window.setTimeout(callback, 1e3 / 60); 2530 }; 2531 }; 2532 }, {} ], 2533 18: [ function(require, module, exports) { 2534 "use strict"; 2535 Object.defineProperty(exports, "__esModule", { 2536 value: !0 2537 }), exports.default = void 0; 2538 var _heifer = require("./heifer.utilities"); 2539 function _defineProperties(target, props) { 2540 for (var i = 0; i < props.length; i++) { 2541 var descriptor = props[i]; 2542 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 2543 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 2544 } 2545 } 2546 var Overlay = function() { 2547 function Overlay() { 2548 !function(instance, Constructor) { 2549 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 2550 }(this, Overlay), this.elem = document.getElementById("display-overlay"), this.visible = !1, 2551 this.identity = null, this.initListeners(); 2552 } 2553 return function(Constructor, protoProps, staticProps) { 2554 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 2555 }(Overlay, [ { 2556 key: "initListeners", 2557 value: function() { 2558 var _this = this; 2559 this.elem.addEventListener("click", function(ev) { 2560 document.dispatchEvent((0, _heifer.uCreateCustomEvent)("overlay/".concat(_this.identity, "/hide"), { 2561 identity: _this.identity 2562 })), _this.hide(); 2563 }), document.addEventListener("overlay/show", function(ev) { 2564 return _this.show(ev.detail); 2565 }), document.addEventListener("overlay/hide", function() { 2566 _this.hide(); 2567 }); 2568 } 2569 }, { 2570 key: "show", 2571 value: function(ev) { 2572 this.visible || (this.identity = ev.identity || null, this.elem.classList.add("is-revealed"), 2573 this.visible = !0); 2574 } 2575 }, { 2576 key: "hide", 2577 value: function() { 2578 this.visible && (this.elem.classList.remove("is-revealed"), this.visible = !1); 2579 } 2580 } ]), Overlay; 2581 }(); 2582 exports.default = Overlay; 2583 }, { 2584 "./heifer.utilities": 19 2585 } ], 2586 19: [ function(require, module, exports) { 2587 "use strict"; 2588 function _typeof(obj) { 2589 return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { 2590 return typeof obj; 2591 } : function(obj) { 2592 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 2593 })(obj); 2594 } 2595 function _toConsumableArray(arr) { 2596 return function(arr) { 2597 if (Array.isArray(arr)) { 2598 for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; 2599 return arr2; 2600 } 2601 }(arr) || function(iter) { 2602 if (Symbol.iterator in Object(iter) || "[object Arguments]" === Object.prototype.toString.call(iter)) return Array.from(iter); 2603 }(arr) || function() { 2604 throw new TypeError("Invalid attempt to spread non-iterable instance"); 2605 }(); 2606 } 2607 function uAddClass(el, classNames) { 2608 var _el$classList; 2609 null != el && (_el$classList = el.classList).add.apply(_el$classList, _toConsumableArray(uMakeClassArray(classNames))); 2610 } 2611 function uRemoveClass(el, classNames) { 2612 var _el$classList2; 2613 null != el && (_el$classList2 = el.classList).remove.apply(_el$classList2, _toConsumableArray(uMakeClassArray(classNames))); 2614 } 2615 function uMakeClassArray(classNames) { 2616 return classNames.split(" "); 2617 } 2618 function uIs(el, selector) { 2619 return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector); 2620 } 2621 function uGetCookie(cname) { 2622 for (var name = cname + "=", ca = decodeURIComponent(document.cookie).split(";"), i = 0; i < ca.length; i++) { 2623 for (var c = ca[i]; " " == c.charAt(0); ) c = c.substring(1); 2624 if (0 == c.indexOf(name)) return c.substring(name.length, c.length); 2625 } 2626 return !1; 2627 } 2628 function uGetCoords(el) { 2629 var box = el.getBoundingClientRect(), body = document.body, docEl = document.documentElement, scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop, scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft, clientTop = docEl.clientTop || body.clientTop || 0, clientLeft = docEl.clientLeft || body.clientLeft || 0, top = box.top + scrollTop - clientTop, left = box.left + scrollLeft - clientLeft, bottom = box.bottom + scrollTop - clientTop; 2630 return { 2631 top: Math.round(top), 2632 left: Math.round(left), 2633 bottom: Math.round(bottom) 2634 }; 2635 } 2636 function verifyParams(argument_0, argument_1) { 2637 var param = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : "", type = 1 < arguments.length && void 0 !== argument_1 ? argument_1 : ""; 2638 return new Promise(function(resolve, reject) { 2639 switch (type) { 2640 case "method": 2641 "GET" === param || "POST" === param ? resolve(!0) : reject(new Error("Mu
2641st provide valid method of either GET or POST")); 2642 break; 2643 2644 case "path": 2645 param.length && "string" == typeof param ? resolve(!0) : reject(new Error("Must provide valid URL as a string")); 2646 break; 2647 2648 case "async": 2649 "boolean" == typeof param ? resolve(!0) : reject(new Error("Must provide async as boolean")); 2650 break; 2651 2652 default: 2653 resolve(!0); 2654 } 2655 }); 2656 } 2657 function uTypeOf(type, obj) { 2658 var clas = Object.prototype.toString.call(obj).slice(8, -1); 2659 return null != obj && clas === type; 2660 } 2661 function uContains(el, child) { 2662 return "string" == typeof child ? uIs(el, child) || null !== el.querySelector(child) : el === child || el.contains(child); 2663 } 2664 function uMatchesMedia(min, max) { 2665 if (window.Modernizr.matchmedia) return window.matchMedia("all " + (min ? "and (min-width: ".concat(min / 16, "em)") : "") + (max ? "and (max-width: ".concat(max / 16, "em)") : "")).matches; 2666 var windowWidth = window.innerWidth; 2667 return min && max ? min <= windowWidth && windowWidth <= max : min ? min <= windowWidth : max ? windowWidth <= max : void 0; 2668 } 2669 Object.defineProperty(exports, "__esModule", { 2670 value: !0 2671 }), exports.uAddClass = uAddClass, exports.uRemoveClass = uRemoveClass, exports.uToggleClass = function(el, classNames) { 2672 null != el && uMakeClassArray(classNames).forEach(function(c) { 2673 el.classList.toggle(c); 2674 }); 2675 }, exports.uHasClass = function(el, classNames) { 2676 var truthy = !1; 2677 return uMakeClassArray(classNames).forEach(function(c) { 2678 el.classList.contains(c) && (truthy = !0); 2679 }), truthy; 2680 }, exports.uIs = uIs, exports.uSiblings = function(el, selector) { 2681 return Array.from(el.parentNode.children).filter(function(child) { 2682 return uIs(child, selector); 2683 }, []); 2684 }, exports.uGetScrollPosition = function() { 2685 return void 0 === window.pageYOffset ? "CSS1Compat" !== (document.compatMode || "") ? document.body.scrollTop : document.documentElement.scrollTop : window.pageYOffset; 2686 }, exports.uStopPageScrollable = function() { 2687 window.utils = window.utils || {}, window.utils.currScrollPosition = void 0 !== window.pageYOffset ? window.pageYOffset : document.body.scrollTop, 2688 uAddClass(document.body, "presentational__no-scroll"), uAddClass(document.documentElement, "presentational__no-scroll"); 2689 }, exports.uStartPageScrollable = function() { 2690 window.utils = window.utils || {}, uRemoveClass(document.body, "presentational__no-scroll"), 2691 uRemoveClass(document.documentElement, "presentational__no-scroll"), window.scrollTo(0, window.utils.currScrollPosition); 2692 }, exports.uRemoveElement = function(el) { 2693 el.parentNode.removeChild(el); 2694 }, exports.uDebounce = function(func, wait, immediate) { 2695 var timeout; 2696 return function() { 2697 var context = this, args = arguments, callNow = immediate && !timeout; 2698 clearTimeout(timeout), timeout = setTimeout(function() { 2699 timeout = null, immediate || func.apply(context, args); 2700 }, wait), callNow && func.apply(context, args); 2701 }; 2702 }, exports.uSetCookie = function(cname) { 2703 var cvalue = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], exdays = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 7, d = new Date(); 2704 d.setTime(d.getTime() + 24 * exdays * 60 * 60 * 1e3); 2705 var expires = "expires=" + d.toUTCString(); 2706 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 2707 }, exports.uGetCookie = uGetCookie, exports.uDeleteCookie = function(cname) { 2708 uGetCookie(cname) && (document.cookie = cname + "=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT"); 2709 }, exports.uScrollTo = function(selector) { 2710 var offset = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0, behavior = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : "smooth", block = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : "start", inline = 4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : "nearest", target = "string" == typeof selector ? document.querySelector(selector) : selector; 2711 document.body.contains(target) ? (0 !== offset ? window.scrollTo({ 2712 top: uGetCoords(target).top + offset, 2713 behavior: behavior 2714 }) : target.scrollIntoView({ 2715 behavior: behavior, 2716 block: block, 2717 inline: inline 2718 }), "string" == typeof selector && -1 < selector.indexOf("#") && window.history.replaceState({}, "", window.location.pathname + selector)) : console.error("uScrollTo Error: Target does not exist."); 2719 }, exports.uGetCoords = uGetCoords, exports.uFlatten = function uFlatten(arr) { 2720 return arr.reduce(function(flat, toFlatten) { 2721 return flat.concat(Array.isArray(toFlatten) ? uFlatten(toFlatten) : toFlatten); 2722 }, []); 2723 }, exports.uAjaxWithResponse = function() { 2724 var method = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "GET", path = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : "", async = !(2 < arguments.length && void 0 !== arguments[2]) || arguments[2], data = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null, contentType = 4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : "charset=UTF-8"; 2725 return new Promise(function(resolve, reject) { 2726 verifyParams(method, "method").catch(function(err) { 2727 reject(err); 2728 }), verifyParams(path, "path").catch(function(err) { 2729 reject(err); 2730 }
2730), verifyParams(async, "async").catch(function(err) { 2731 reject(err); 2732 }); 2733 var req = new window.XMLHttpRequest(); 2734 req.open(method, path, async), req.setRequestHeader("Content-Type", contentType), 2735 req.onload = function() { 2736 200 <= req.status && req.status < 300 ? resolve(req.response) : reject(req.statusText); 2737 }, req.onerror = function() { 2738 reject(req.statusText); 2739 }, req.send(data); 2740 }); 2741 }, exports.uCreateCustomEvent = function(name) { 2742 var data = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : ""; 2743 if ("function" == typeof window.CustomEvent) return new CustomEvent(name, { 2744 detail: data 2745 }); 2746 var event = document.createEvent("CustomEvent"); 2747 return event.initCustomEvent(name, !0, !0, data), event; 2748 }, exports.uCreateEvent = function(name) { 2749 var bubbles = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1]; 2750 if ("function" == typeof Event) return new Event(name, { 2751 bubbles: bubbles 2752 }); 2753 var event = document.createEvent("HTMLEvents"); 2754 return event.initEvent(name, bubbles, !1), event; 2755 }, exports.uJsonToQueryString = function(json) { 2756 return Object.keys(json).map(function(key) { 2757 var v = json[key]; 2758 switch (_typeof(v)) { 2759 case "boolean": 2760 return key + "=" + (v ? 1 : 0); 2761 2762 default: 2763 return key + "=" + encodeURIComponent(json[key]); 2764 } 2765 }).join("&"); 2766 }, exports.uIsJson = function(str) { 2767 try { 2768 var parsed = JSON.parse(str); 2769 return uTypeOf("Object", parsed) || uTypeOf("Array", parsed); 2770 } catch (e) { 2771 return !1; 2772 } 2773 return !0; 2774 }, exports.uTypeOf = uTypeOf, exports.uAddEventListener = function(el, name, callback) { 2775 var _this = this; 2776 el.addEventListener(name, function(e) { 2777 var target = e.target; 2778 uContains(el, target) && callback.call(_this, e); 2779 }); 2780 }, exports.uContains = uContains, exports.uFormatRelativeUrl = function(url) { 2781 var language = window.Heifer && window.Heifer.language ? window.Heifer.language : "", defaultLanguage = window.Heifer && window.Heifer.defaultLanguage ? window.Heifer.defaultLanguage : ""; 2782 return "" != language && language != defaultLanguage ? "/" + language + "/" + url.replace(/^[\/]+/, "") : url; 2783 }, exports.uClosest = function(el, selector) { 2784 if ("function" == typeof window.Element.prototype.closest) return el.closest(selector); 2785 do { 2786 if (uIs(el, selector)) return el; 2787 el = el.parentElement || el.parentNode; 2788 } while (null !== el && 1 === el.nodeType); 2789 return null; 2790 }, exports.uIsExtraSmallScreen = function() { 2791 return uMatchesMedia(0, 575); 2792 }, exports.uIsSmallScreen = function() { 2793 return uMatchesMedia(576, 767); 2794 }, exports.uIsMediumScreen = function() { 2795 return uMatchesMedia(768, 991); 2796 }, exports.uIsLargeScreen = function() { 2797 return uMatchesMedia(992, 1271); 2798 }, exports.uIsExtraLargeScreen = function() { 2799 return uMatchesMedia(1272, 1569); 2800 }, exports.uIsMaxScreen = function() { 2801 return uMatchesMedia(1570); 2802 }, exports.uIsLessThanMediumScreen = function() { 2803 return uMatchesMedia(0, 767); 2804 }, exports.uThousands = function(number, separator) { 2805 var parts = ((number || 0 === number ? number : "") + "").split("."); 2806 parts.length && (parts[0] = parts[0].replace(/(\d)(?=(\d{3})+\b)/g, "$1" + (separator || ","))); 2807 return parts.join("."); 2808 }, exports.uLoadJSPromise = function(src, attrs) { 2809 return new Promise(function(resolve, reject) { 2810 var ref = window.document.getElementsByTagName("script")[0], script = window.document.createElement("script"); 2811 if (script.src = src, script.async = !0, attrs) for (var i in attrs) attrs.hasOwnProperty(i) && script.setAttribute(i, attrs[i]); 2812 return ref.parentNode.insertBefore(script, ref), script.onload = function() { 2813 resolve(); 2814 }, script.onerror = function() { 2815 reject(); 2816 }, script; 2817 }); 2818 }, exports.uGetOrdinalSuffix = function(num) { 2819 var mod10 = num % 10, mod100 = num % 100; 2820 return 1 != mod10 || 11 == mod100 ? 2 != mod10 || 12 == mod100 ? 3 != mod10 || 13 == mod100 ? "th" : "rd" : "nd" : "st"; 2821 }, exports.uGetMonthName = function(month) { 2822 return [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
2822November", "December" ][month]; 2823 }, require("core-js/modules/es7.symbol.async-iterator"), require("core-js/modules/es6.symbol"), 2824 require("core-js/modules/es6.regexp.replace"), require("core-js/modules/es6.regexp.to-string"), 2825 require("core-js/modules/es6.date.to-string"), require("core-js/modules/web.dom.iterable"), 2826 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.keys"), 2827 require("core-js/modules/es6.promise"), require("core-js/modules/es6.object.to-string"), 2828 require("core-js/modules/es6.string.iterator"), require("core-js/modules/es6.array.from"), 2829 require("core-js/modules/es6.regexp.split"); 2830 }, { 2831 "core-js/modules/es6.array.from": 240, 2832 "core-js/modules/es6.array.iterator": 241, 2833 "core-js/modules/es6.date.to-string": 243, 2834 "core-js/modules/es6.object.keys": 250, 2835 "core-js/modules/es6.object.to-string": 252, 2836 "core-js/modules/es6.promise": 253, 2837 "core-js/modules/es6.regexp.replace": 259, 2838 "core-js/modules/es6.regexp.split": 261, 2839 "core-js/modules/es6.regexp.to-string": 262, 2840 "core-js/modules/es6.string.iterator": 265, 2841 "core-js/modules/es6.symbol": 268, 2842 "core-js/modules/es7.symbol.async-iterator": 273, 2843 "core-js/modules/web.dom.iterable": 274 2844 } ], 2845 20: [ function(require, module, exports) { 2846 (function(global) { 2847 "use strict"; 2848 function _typeof(obj) { 2849 return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { 2850 return typeof obj; 2851 } : function(obj) { 2852 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 2853 })(obj); 2854 } 2855 require("core-js/modules/es6.function.name"), require("core-js/modules/es6.regexp.match"), 2856 require("core-js/modules/es6.array.find"), require("core-js/modules/es6.regexp.constructor"), 2857 require("core-js/modules/es6.regexp.split"), require("core-js/modules/es7.symbol.async-iterator"), 2858 require("core-js/modules/es6.symbol"), require("core-js/modules/es6.regexp.replace"), 2859 require("core-js/modules/es6.array.sort"), require("core-js/modules/es6.regexp.to-string"), 2860 require("core-js/modules/es6.date.to-string"), require("core-js/modules/es6.object.to-string"); 2861 (function(module, exports, require, define, browserify_shim__define__module__export__) { 2862 var e, t; 2863 e = "undefined" != typeof window ? window : this, t = function(C, e) { 2864 var t = [], r = Object.getPrototypeOf, s = t.slice, g = t.flat ? function(e) { 2865 return t.flat.call(e); 2866 } : function(e) { 2867 return t.concat.apply([], e); 2868 }, u = t.push, i = t.indexOf, n = {}, o = n.toString, v = n.hasOwnProperty, a = v.toString, l = a.call(Object), y = {}, m = function(e) { 2869 return "function" == typeof e && "number" != typeof e.nodeType; 2870 }, x = function(e) { 2871 return null != e && e === e.window; 2872 }, E = C.document, c = { 2873 type: !0, 2874 src: !0, 2875 nonce: !0, 2876 noModule: !0 2877 }; 2878 function b(e, t, n) { 2879 var r, i, o = (n = n || E).createElement("script"); 2880 if (o.text = e, t) for (r in c) (i = t[r] || t.getAttribute && t.getAttribute(r)) && o.setAttribute(r, i); 2881 n.head.appendChild(o).parentNode.removeChild(o); 2882 } 2883 function w(e) { 2884 return null == e ? e + "" : "object" == _typeof(e) || "function" == typeof e ? n[o.call(e)] || "object" : _typeof(e); 2885 } 2886 var f = "3.5.1", S = function S(e, t) { 2887 return new S.fn.init(e, t); 2888 }; 2889 function p(e) { 2890 var t = !!e && "length" in e && e.length, n = w(e); 2891 return !m(e) && !x(e) && ("array" === n || 0 === t || "number" == typeof t && 0 < t && t - 1 in e); 2892 } 2893 S.fn = S.prototype = { 2894 jquery: f, 2895 constructor: S, 2896 length: 0, 2897 toArray: function() { 2898 return s.call(this); 2899 }, 2900 get: function(e) { 2901 return null == e ? s.call(this) : e < 0 ? this[e + this.length] : this[e]; 2902 }, 2903 pushStack: function(e) { 2904 var t = S.merge(this.constructor(), e);
2905 return t.prevObject = this, t; 2906 }, 2907 each: function(e) { 2908 return S.each(this, e); 2909 }, 2910 map: function(n) { 2911 return this.pushStack(S.map(this, function(e, t) { 2912 return n.call(e, t, e); 2913 })); 2914 }, 2915 slice: function() { 2916 return this.pushStack(s.apply(this, arguments)); 2917 }, 2918 first: function() { 2919 return this.eq(0); 2920 }, 2921 last: function() { 2922 return this.eq(-1); 2923 }, 2924 even: function() { 2925 return this.pushStack(S.grep(this, function(e, t) { 2926 return (t + 1) % 2; 2927 })); 2928 }, 2929 odd: function() { 2930 return this.pushStack(S.grep(this, function(e, t) { 2931 return t % 2; 2932 })); 2933 }, 2934 eq: function(e) { 2935 var t = this.length, n = +e + (e < 0 ? t : 0); 2936 return this.pushStack(0 <= n && n < t ? [ this[n] ] : []); 2937 }, 2938 end: function() { 2939 return this.prevObject || this.constructor(); 2940 }, 2941 push: u, 2942 sort: t.sort, 2943 splice: t.splice 2944 }, S.extend = S.fn.extend = function() { 2945 var e, t, n, r, i, o, a = arguments[0] || {}, s = 1, u = arguments.length, l = !1; 2946 for ("boolean" == typeof a && (l = a, a = arguments[s] || {}, s++), "object" == _typeof(a) || m(a) || (a = {}), 2947 s === u && (a = this, s--); s < u; s++) if (null != (e = arguments[s])) for (t in e) r = e[t], 2948 "__proto__" !== t && a !== r && (l && r && (S.isPlainObject(r) || (i = Array.isArray(r))) ? (n = a[t], 2949 o = i && !Array.isArray(n) ? [] : i || S.isPlainObject(n) ? n : {}, i = !1, a[t] = S.extend(l, o, r)) : void 0 !== r && (a[t] = r)); 2950 return a; 2951 }, S.extend({ 2952 expando: "jQuery" + (f + Math.random()).replace(/\D/g, ""), 2953 isReady: !0, 2954 error: function(e) { 2955 throw new Error(e); 2956 }, 2957 noop: function() {}, 2958 isPlainObject: function(e) { 2959 var t, n; 2960 return !(!e || "[object Object]" !== o.call(e) || (t = r(e)) && ("function" != typeof (n = v.call(t, "constructor") && t.constructor) || a.call(n) !== l)); 2961 }, 2962 isEmptyObject: function(e) { 2963 var t; 2964 for (t in e) return !1; 2965 return !0; 2966 }, 2967 globalEval: function(e, t, n) { 2968 b(e, { 2969 nonce: t && t.nonce 2970 }, n); 2971 }, 2972 each: function(e, t) { 2973 var n, r = 0; 2974 if (p(e)) for (n = e.length; r < n && !1 !== t.call(e[r], r, e[r]); r++) ; else for (r in e) if (!1 === t.call(e[r], r, e[r])) break; 2975 return e; 2976 }, 2977 makeArray: function(e, t) { 2978 var n = t || []; 2979 return null != e && (p(Object(e)) ? S.merge(n, "string" == typeof e ? [ e ] : e) : u.call(n, e)), 2980 n; 2981 }, 2982 inArray: function(e, t, n) { 2983 return null == t ? -1 : i.call(t, e, n); 2984 }, 2985 merge: function(e, t) { 2986 for (var n = +t.length, r = 0, i = e.length; r < n; r++) e[i++] = t[r]; 2987 return e.length = i, e; 2988 }, 2989 grep: function(e, t, n) { 2990 for (var r = [], i = 0, o = e.length, a = !n; i < o; i++) !t(e[i], i) != a && r.push(e[i]); 2991 return r; 2992 }, 2993 map: function(e, t, n) { 2994 var r, i, o = 0, a = []; 2995 if (p(e)) for (r = e.length; o < r; o++) null != (i = t(e[o], o, n)) && a.push(i); else for (o in e) null != (i = t(e[o], o, n)) && a.push(i); 2996 return g(a); 2997 }, 2998 guid: 1, 2999 support: y 3000 }), "function" == typeof Symbol && (S.fn[Symbol.iterator] = t[Symbol.iterator]), 3001 S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function(e, t) { 3002 n["[object " + t + "]"] = t.toLowerCase(); 3003 }); 3004 var d = function(n) { 3005 var e, d, b, o, i, h, f, g, w, u, l, T, C, a, E, v, s, c, y, S = "sizzle" + 1 * new Date(), p = n.document, k = 0, r = 0, m = ue(), x = ue(), A = ue(), N = ue(), D = function(e, t) { 3006 return e === t && (l = !0), 0; 3007 }, j = {}.hasOwnProperty, t = [], q = t.pop, L = t.push, H = t.push, O = t.slice, P = function(e, t) { 3008 for (var n = 0, r = e.length; n < r; n++) if (e[n] === t) return n; 3009 return -1; 3010 }, R = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", M = "[\\x20\\t\\r\\n\\f]", I = "(?:\\\\[\\da-fA-F]{1,6}" + M + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", W = "\\[" + M + "*(" + I + ")(?:" + M + "*([*^$|!~]?=)" + M + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + I + "))|)" + M + "*\\]", F = ":(" + I + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + W + ")*)|.*)\\)|)", B = new RegExp(M + "+", "g"), $ = new RegExp("^" + M + "+|((?:^|[^\\\\])(?:\\\\.)*)" + M + "+$", "g"), _ = new RegExp("^" + M + "*," + M + "*"), z = new RegExp("^" + M + "*([>+~]|" + M + ")" + M + "*"), U = new RegExp(M + "|>"), X = new RegExp(F), V = new RegExp("^" + I + "$"), G = { 3011 ID: new RegExp("^#(" + I + ")"), 3012 CLASS: new RegExp("^\\.(" + I + ")"), 3013 TAG: new RegExp("^(" + I + "|[*])"), 3014 ATTR: new RegExp("^" + W), 3015 PSEUDO: new RegExp("^" + F), 3016 CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + M + "*(even|odd|(([+-]|)(\\d*)n|)" + M + "*(?:([+-]|)" + M + "*(\\d+)|))" + M + "*\\)|)", "i"), 3017 bool: new RegExp("^(?:" + R + ")$", "i"), 3018 needsContext: new RegExp("^" + M + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + M + "*((?:-\\d)?\\d*)" + M + "*\\)|)(?=[^-]|$)", "i") 3019 }, Y = /HTML$/i, Q = /^(?:input|select|textarea|button)$/i, J = /^h\d$/i, K = /^[^{]+\{\s*\[native \w/, Z = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, ee = /[+~]/, te = new RegExp("\\\\[\\da-fA-F]{1,6}" + M + "?|\\\\([^\\r\\n\\f])", "g"), ne = function(e, t) { 3020 var n = "0x" + e.slice(1) - 65536; 3021 return t || (n < 0 ? String.fromCharCode(65536 + n) : String.fromCharCode(n >> 10 | 55296, 1023 & n | 56320)); 3022 }, re = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, ie = function(e, t) { 3023 return t ? "\0" === e ? "�" : e.slice(0, -1) + "\\" + e.charCodeAt(e.length - 1).toString(16) + " " : "\\" + e; 3024 }, oe = function() { 3025 T(); 3026 }, ae = be(function(e) { 3027 return !0 === e.disabled && "fieldset" === e.nodeName.toLowerCase(); 3028 }, { 3029 dir: "parentNode", 3030 next: "legend" 3031 }); 3032 try { 3033 H.apply(t = O.call(p.childNodes), p.childNodes), t[p.childNodes.length].nodeType; 3034 } catch (e) { 3035 H = { 3036 apply: t.length ? function(e, t) { 3037 L.apply(e, O.call(t)); 3038 } : function(e, t) { 3039 for (var n = e.length, r = 0; e[n++] = t[r++]; ) ; 3040 e.length = n - 1; 3041 } 3042 }; 3043 } 3044 function se(t, e, n, r) { 3045 var i, o, a, s, u, l, c, f = e && e.ownerDocument, p = e ? e.nodeType : 9; 3046 if (n = n || [], "string" != typeof t || !t || 1 !== p && 9 !== p && 11 !== p) return n; 3047 if (!r && (T(e), e = e || C, E)) { 3048 if (11 !== p && (u = Z.exec(t))) if (i = u[1]) { 3049 if (9 === p) { 3050 if (!(a = e.getElementById(i))) return n; 3051 if (a.id === i) return n.push(a), n; 3052 } else if (f && (a = f.getElementById(i)) && y(e, a) && a.id === i) return n.push(a), 3053 n; 3054 } else { 3055 if (u[2]) return H.apply(n, e.getElementsByTagName(t)), n;
3056 if ((i = u[3]) && d.getElementsByClassName && e.getElementsByClassName) return H.apply(n, e.getElementsByClassName(i)), 3057 n; 3058 } 3059 if (d.qsa && !N[t + " "] && (!v || !v.test(t)) && (1 !== p || "object" !== e.nodeName.toLowerCase())) { 3060 if (c = t, f = e, 1 === p && (U.test(t) || z.test(t))) { 3061 for ((f = ee.test(t) && ye(e.parentNode) || e) === e && d.scope || ((s = e.getAttribute("id")) ? s = s.replace(re, ie) : e.setAttribute("id", s = S)), 3062 o = (l = h(t)).length; o--; ) l[o] = (s ? "#" + s : ":scope") + " " + xe(l[o]); 3063 c = l.join(","); 3064 } 3065 try { 3066 return H.apply(n, f.querySelectorAll(c)), n; 3067 } catch (e) { 3068 N(t, !0); 3069 } finally { 3070 s === S && e.removeAttribute("id"); 3071 } 3072 } 3073 } 3074 return g(t.replace($, "$1"), e, n, r); 3075 } 3076 function ue() { 3077 var r = []; 3078 return function e(t, n) { 3079 return r.push(t + " ") > b.cacheLength && delete e[r.shift()], e[t + " "] = n; 3080 }; 3081 } 3082 function le(e) { 3083 return e[S] = !0, e; 3084 } 3085 function ce(e) { 3086 var t = C.createElement("fieldset"); 3087 try { 3088 return !!e(t); 3089 } catch (e) { 3090 return !1; 3091 } finally { 3092 t.parentNode && t.parentNode.removeChild(t), t = null; 3093 } 3094 } 3095 function fe(e, t) { 3096 for (var n = e.split("|"), r = n.length; r--; ) b.attrHandle[n[r]] = t; 3097 } 3098 function pe(e, t) { 3099 var n = t && e, r = n && 1 === e.nodeType && 1 === t.nodeType && e.sourceIndex - t.sourceIndex; 3100 if (r) return r; 3101 if (n) for (;n = n.nextSibling; ) if (n === t) return -1; 3102 return e ? 1 : -1; 3103 } 3104 function de(t) { 3105 return function(e) { 3106 return "input" === e.nodeName.toLowerCase() && e.type === t; 3107 }; 3108 } 3109 function he(n) { 3110 return function(e) { 3111 var t = e.nodeName.toLowerCase(); 3112 return ("input" === t || "button" === t) && e.type === n; 3113 }; 3114 } 3115 function ge(t) { 3116 return function(e) { 3117 return "form" in e ? e.parentNode && !1 === e.disabled ? "label" in e ? "label" in e.parentNode ? e.parentNode.disabled === t : e.disabled === t : e.isDisabled === t || e.isDisabled !== !t && ae(e) === t : e.disabled === t : "label" in e && e.disabled === t; 3118 }; 3119 } 3120 function ve(a) { 3121 return le(function(o) { 3122 return o = +o, le(function(e, t) { 3123 for (var n, r = a([], e.length, o), i = r.length; i--; ) e[n = r[i]] && (e[n] = !(t[n] = e[n])); 3124 }); 3125 }); 3126 } 3127 function ye(e) { 3128 return e && void 0 !== e.getElementsByTagName && e; 3129 } 3130 for (e in d = se.support = {}, i = se.isXML = function(e) { 3131 var t = e.namespaceURI, n = (e.ownerDocument || e).documentElement; 3132 return !Y.test(t || n && n.nodeName || "HTML"); 3133 }, T = se.setDocument = function(e) { 3134 var t, n, r = e ? e.ownerDocument || e : p; 3135 return r != C && 9 === r.nodeType && r.documentElement && (a = (C = r).documentElement, 3136 E = !i(C), p != C && (n = C.defaultView) && n.top !== n && (n.addEventListener ? n.addEventListener("unload", oe, !1) : n.attachEvent && n.attachEvent("onunload", oe)), 3137 d.scope = ce(function(e) { 3138 return a.appendChild(e).appendChild(C.createElement("div")), void 0 !== e.querySelectorAll && !e.querySelectorAll(":scope fieldset div").length; 3139 }), d.attributes = ce(function(e) { 3140 return e.className = "i", !e.getAttribute("className"); 3141 }), d.getElementsByTagName = ce(function(e) { 3142 return e.appendChild(C.createComment("")), !e.getElementsByTagName("*").length; 3143 }), d.getElementsByClassName = K.test(C.getElementsByClassName), d.getById = ce(function(e) { 3144 return a.appendChild(e).id = S, !C.getElementsByName || !C.getElementsByName(S).length; 3145 }), d.getById ? (b.filter.ID = function(e) { 3146 var t = e.replace(te, ne); 3147 return function(e) { 3148 return e.getAttribute("id") === t; 3149 }; 3150 }, b.find.ID = function(e, t) { 3151 if (void 0 !== t.getElementById && E) { 3152 var n = t.getElementById(e); 3153 return n ? [ n ] : []; 3154 } 3155 }) : (b.filter.ID = function(e) { 3156 var n = e.replace(te, ne); 3157 return function(e) { 3158 var t = void 0 !== e.getAttributeNode && e.getAttributeNode("id"); 3159 return t && t.value === n; 3160 }; 3161 }, b.find.ID = function(e, t) { 3162 if (void 0 !== t.getElementById && E) { 3163 var n, r, i, o = t.getElementById(e); 3164 if (o) { 3165 if ((n = o.getAttributeNode("id")) && n.value === e) return [ o ]; 3166 for (i = t.getElementsByName(e), r = 0; o = i[r++]; ) if ((n = o.getAttributeNode("id")) && n.value === e) return [ o ]; 3167 } 3168 return []; 3169 } 3170 }), b.find.TAG = d.getElementsByTagName ? function(e, t) { 3171 return void 0 !== t.getElementsByTagName ? t.getElementsByTagName(e) : d.qsa ? t.querySelectorAll(e) : void 0; 3172 } : function(e, t) { 3173 var n, r = [], i = 0, o = t.getElementsByTagName(e); 3174 if ("*" !== e) return o; 3175 for (;n = o[i++]; ) 1 === n.nodeType && r.push(n); 3176 return r; 3177 }, b.find.CLASS = d.getElementsByClassName && function(e, t) { 3178 if (void 0 !== t.getElementsByClassName && E) return t.getElementsByClassName(e); 3179 }
3179, s = [], v = [], (d.qsa = K.test(C.querySelectorAll)) && (ce(function(e) { 3180 var t; 3181 a.appendChild(e).innerHTML = "<a id='" + S + "'></a><select id='" + S + "-\r\\' msallowcapture=''><option selected=''></option></select>", 3182 e.querySelectorAll("[msallowcapture^='']").length && v.push("[*^$]=" + M + "*(?:''|\"\")"), 3183 e.querySelectorAll("[selected]").length || v.push("\\[" + M + "*(?:value|" + R + ")"), 3184 e.querySelectorAll("[id~=" + S + "-]").length || v.push("~="), (t = C.createElement("input")).setAttribute("name", ""), 3185 e.appendChild(t), e.querySelectorAll("[name='']").length || v.push("\\[" + M + "*name" + M + "*=" + M + "*(?:''|\"\")"), 3186 e.querySelectorAll(":checked").length || v.push(":checked"), e.querySelectorAll("a#" + S + "+*").length || v.push(".#.+[+~]"), 3187 e.querySelectorAll("\\\f"), v.push("[\\r\\n\\f]"); 3188 }), ce(function(e) { 3189 e.innerHTML = "<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>"; 3190 var t = C.createElement("input"); 3191 t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("name", "D"), e.querySelectorAll("[name=d]").length && v.push("name" + M + "*[*^$|!~]?="), 3192 2 !== e.querySelectorAll(":enabled").length && v.push(":enabled", ":disabled"), 3193 a.appendChild(e).disabled = !0, 2 !== e.querySelectorAll(":disabled").length && v.push(":enabled", ":disabled"), 3194 e.querySelectorAll("*,:x"), v.push(",.*:"); 3195 })), (d.matchesSelector = K.test(c = a.matches || a.webkitMatchesSelector || a.mozMatchesSelector || a.oMatchesSelector || a.msMatchesSelector)) && ce(function(e) { 3196 d.disconnectedMatch = c.call(e, "*"), c.call(e, "[s!='']:x"), s.push("!=", F); 3197 }), v = v.length && new RegExp(v.join("|")), s = s.length && new RegExp(s.join("|")), 3198 t = K.test(a.compareDocumentPosition), y = t || K.test(a.contains) ? function(e, t) { 3199 var n = 9 === e.nodeType ? e.documentElement : e, r = t && t.parentNode; 3200 return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r))); 3201 } : function(e, t) { 3202 if (t) for (;t = t.parentNode; ) if (t === e) return !0; 3203 return !1; 3204 }, D = t ? function(e, t) { 3205 if (e === t) return l = !0, 0; 3206 var n = !e.compareDocumentPosition - !t.compareDocumentPosition; 3207 return n || (1 & (n = (e.ownerDocument || e) == (t.ownerDocument || t) ? e.compareDocumentPosition(t) : 1) || !d.sortDetached && t.compareDocumentPosition(e) === n ? e == C || e.ownerDocument == p && y(p, e) ? -1 : t == C || t.ownerDocument == p && y(p, t) ? 1 : u ? P(u, e) - P(u, t) : 0 : 4 & n ? -1 : 1); 3208 } : function(e, t) { 3209 if (e === t) return l = !0, 0; 3210 var n, r = 0, i = e.parentNode, o = t.parentNode, a = [ e ], s = [ t ]; 3211 if (!i || !o) return e == C ? -1 : t == C ? 1 : i ? -1 : o ? 1 : u ? P(u, e) - P(u, t) : 0; 3212 if (i === o) return pe(e, t); 3213 for (n = e; n = n.parentNode; ) a.unshift(n); 3214 for (n = t; n = n.parentNode; ) s.unshift(n); 3215 for (;a[r] === s[r]; ) r++; 3216 return r ? pe(a[r], s[r]) : a[r] == p ? -1 : s[r] == p ? 1 : 0; 3217 }), C; 3218 }, se.matches = function(e, t) { 3219 return se(e, null, null, t); 3220 }, se.matchesSelector = function(e, t) { 3221 if (T(e), d.matchesSelector && E && !N[t + " "] && (!s || !s.test(t)) && (!v || !v.test(t))) try { 3222 var n = c.call(e, t); 3223 if (n || d.disconnectedMatch || e.document && 11 !== e.document.nodeType) return n; 3224 } catch (e) { 3225 N(t, !0); 3226 } 3227 return 0 < se(t, C, null, [ e ]).length; 3228 }, se.contains = function(e, t) { 3229 return (e.ownerDocument || e) != C && T(e), y(e, t); 3230 }, se.attr = function(e, t) { 3231 (e.ownerDocument || e) != C && T(e); 3232 var n = b.attrHandle[t.toLowerCase()], r = n && j.call(b.attrHandle, t.toLowerCase()) ? n(e, t, !E) : void 0; 3233 return void 0 !== r ? r : d.attributes || !E ? e.getAttribute(t) : (r = e.getAttributeNode(t)) && r.specified ? r.value : null; 3234 }, se.escape = function(e) { 3235 return (e + "").replace(re, ie); 3236 }, se.error = function(e) { 3237 throw new Error("Syntax error, unrecognized expression: " + e); 3238 }, se.uniqueSort = function(e) { 3239 var t, n = [], r = 0, i = 0; 3240 if (l = !d.detectDuplicates, u = !d.sortStable && e.slice(0), e.sort(D), l) { 3241 for (;t = e[i++]; ) t === e[i] && (r = n.push(i)); 3242 for (;r--; ) e.splice(n[r], 1); 3243 } 3244 return u = null, e; 3245 }, o = se.getText = function(e) { 3246 var t, n = "", r = 0, i = e.nodeType; 3247 if (i) { 3248 if (1 === i || 9 === i || 11 === i) { 3249 if ("string" == typeof e.textContent) return e.textContent; 3250 for (e = e.firstChild; e; e = e.nextSibling) n += o(e); 3251 }
vendor: 14,348 bytes, lines 3251-3469
3251 else if (3 === i || 4 === i) return e.nodeValue; 3252 } else for (;t = e[r++]; ) n += o(t); 3253 return n; 3254 }, (b = se.selectors = { 3255 cacheLength: 50, 3256 createPseudo: le, 3257 match: G, 3258 attrHandle: {}, 3259 find: {}, 3260 relative: { 3261 ">": { 3262 dir: "parentNode", 3263 first: !0 3264 }, 3265 " ": { 3266 dir: "parentNode" 3267 }, 3268 "+": { 3269 dir: "previousSibling", 3270 first: !0 3271 }, 3272 "~": { 3273 dir: "previousSibling" 3274 } 3275 }, 3276 preFilter: { 3277 ATTR: function(e) { 3278 return e[1] = e[1].replace(te, ne), e[3] = (e[3] || e[4] || e[5] || "").replace(te, ne), 3279 "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4); 3280 }, 3281 CHILD: function(e) { 3282 return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || se.error(e[0]), 3283 e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && se.error(e[0]), 3284 e; 3285 }, 3286 PSEUDO: function(e) { 3287 var t, n = !e[6] && e[2]; 3288 return G.CHILD.test(e[0]) ? null : (e[3] ? e[2] = e[4] || e[5] || "" : n && X.test(n) && (t = h(n, !0)) && (t = n.indexOf(")", n.length - t) - n.length) && (e[0] = e[0].slice(0, t), 3289 e[2] = n.slice(0, t)), e.slice(0, 3)); 3290 } 3291 }, 3292 filter: { 3293 TAG: function(e) { 3294 var t = e.replace(te, ne).toLowerCase(); 3295 return "*" === e ? function() { 3296 return !0; 3297 } : function(e) { 3298 return e.nodeName && e.nodeName.toLowerCase() === t; 3299 }; 3300 }, 3301 CLASS: function(e) { 3302 var t = m[e + " "]; 3303 return t || (t = new RegExp("(^|" + M + ")" + e + "(" + M + "|$)")) && m(e, function(e) { 3304 return t.test("string" == typeof e.className && e.className || void 0 !== e.getAttribute && e.getAttribute("class") || ""); 3305 }); 3306 }, 3307 ATTR: function(n, r, i) { 3308 return function(e) { 3309 var t = se.attr(e, n); 3310 return null == t ? "!=" === r : !r || (t += "", "=" === r ? t === i : "!=" === r ? t !== i : "^=" === r ? i && 0 === t.indexOf(i) : "*=" === r ? i && -1 < t.indexOf(i) : "$=" === r ? i && t.slice(-i.length) === i : "~=" === r ? -1 < (" " + t.replace(B, " ") + " ").indexOf(i) : "|=" === r && (t === i || t.slice(0, i.length + 1) === i + "-")); 3311 }; 3312 }, 3313 CHILD: function(h, e, t, g, v) { 3314 var y = "nth" !== h.slice(0, 3), m = "last" !== h.slice(-4), x = "of-type" === e; 3315 return 1 === g && 0 === v ? function(e) { 3316 return !!e.parentNode; 3317 } : function(e, t, n) { 3318 var r, i, o, a, s, u, l = y != m ? "nextSibling" : "previousSibling", c = e.parentNode, f = x && e.nodeName.toLowerCase(), p = !n && !x, d = !1; 3319 if (c) { 3320 if (y) { 3321 for (;l; ) { 3322 for (a = e; a = a[l]; ) if (x ? a.nodeName.toLowerCase() === f : 1 === a.nodeType) return !1; 3323 u = l = "only" === h && !u && "nextSibling"; 3324 } 3325 return !0; 3326 } 3327 if (u = [ m ? c.firstChild : c.lastChild ], m && p) { 3328 for (d = (s = (r = (i = (o = (a = c)[S] || (a[S] = {}))[a.uniqueID] || (o[a.uniqueID] = {}))[h] || [])[0] === k && r[1]) && r[2], 3329 a = s && c.childNodes[s]; a = ++s && a && a[l] || (d = s = 0) || u.pop(); ) if (1 === a.nodeType && ++d && a === e) { 3330 i[h] = [ k, s, d ]; 3331 break; 3332 } 3333 } else if (p && (d = s = (r = (i = (o = (a = e)[S] || (a[S] = {}))[a.uniqueID] || (o[a.uniqueID] = {}))[h] || [])[0] === k && r[1]), 3334 !1 === d) for (;(a = ++s && a && a[l] || (d = s = 0) || u.pop()) && ((x ? a.nodeName.toLowerCase() !== f : 1 !== a.nodeType) || !++d || (p && ((i = (o = a[S] || (a[S] = {}))[a.uniqueID] || (o[a.uniqueID] = {}))[h] = [ k, d ]), 3335 a !== e)); ) ; 3336 return (d -= v) === g || d % g == 0 && 0 <= d / g; 3337 } 3338 }; 3339 }, 3340 PSEUDO: function(e, o) { 3341 var t, a = b.pseudos[e] || b.setFilters[e.toLowerCase()] || se.error("unsupported pseudo: " + e); 3342 return a[S] ? a(o) : 1 < a.length ? (t = [ e, e, "", o ], b.setFilters.hasOwnProperty(e.toLowerCase()) ? le(function(e, t) { 3343 for (var n, r = a(e, o), i = r.length; i--; ) e[n = P(e, r[i])] = !(t[n] = r[i]); 3344 }) : function(e) { 3345 return a(e, 0, t); 3346 }) : a; 3347 } 3348 }, 3349 pseudos: { 3350 not: le(function(e) { 3351 var r = [], i = [], s = f(e.replace($, "$1")); 3352 return s[S] ? le(function(e, t, n, r) { 3353 for (var i, o = s(e, null, r, []), a = e.length; a--; ) (i = o[a]) && (e[a] = !(t[a] = i)); 3354 }) : function(e, t, n) { 3355 return r[0] = e, s(r, null, n, i), r[0] = null, !i.pop(); 3356 }; 3357 }), 3358 has: le(function(t) { 3359 return function(e) { 3360 return 0 < se(t, e).length; 3361 }; 3362 }), 3363 contains: le(function(t) { 3364 return t = t.replace(te, ne), function(e) { 3365 return -1 < (e.textContent || o(e)).indexOf(t); 3366 }; 3367 }), 3368 lang: le(function(n) { 3369 return V.test(n || "") || se.error("unsupported lang: " + n), n = n.replace(te, ne).toLowerCase(), 3370 function(e) { 3371 var t; 3372 do { 3373 if (t = E ? e.lang : e.getAttribute("xml:lang") || e.getAttribute("lang")) return (t = t.toLowerCase()) === n || 0 === t.indexOf(n + "-"); 3374 } while ((e = e.parentNode) && 1 === e.nodeType); 3375 return !1; 3376 }; 3377 }), 3378 target: function(e) { 3379 var t = n.location && n.location.hash; 3380 return t && t.slice(1) === e.id; 3381 }, 3382 root: function(e) { 3383 return e === a; 3384 }, 3385 focus: function(e) { 3386 return e === C.activeElement && (!C.hasFocus || C.hasFocus()) && !!(e.type || e.href || ~e.tabIndex); 3387 }, 3388 enabled: ge(!1), 3389 disabled: ge(!0), 3390 checked: function(e) { 3391 var t = e.nodeName.toLowerCase(); 3392 return "input" === t && !!e.checked || "option" === t && !!e.selected; 3393 }, 3394 selected: function(e) { 3395 return e.parentNode && e.parentNode.selectedIndex, !0 === e.selected; 3396 }, 3397 empty: function(e) { 3398 for (e = e.firstChild; e; e = e.nextSibling) if (e.nodeType < 6) return !1; 3399 return !0; 3400 }, 3401 parent: function(e) { 3402 return !b.pseudos.empty(e); 3403 }, 3404 header: function(e) { 3405 return J.test(e.nodeName); 3406 }, 3407 input: function(e) { 3408 return Q.test(e.nodeName); 3409 }, 3410 button: function(e) { 3411 var t = e.nodeName.toLowerCase(); 3412 return "input" === t && "button" === e.type || "button" === t; 3413 }, 3414 text: function(e) { 3415 var t; 3416 return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || "text" === t.toLowerCase()); 3417 }, 3418 first: ve(function() { 3419 return [ 0 ]; 3420 }), 3421 last: ve(function(e, t) { 3422 return [ t - 1 ]; 3423 }), 3424 eq: ve(function(e, t, n) { 3425 return [ n < 0 ? n + t : n ]; 3426 }), 3427 even: ve(function(e, t) { 3428 for (var n = 0; n < t; n += 2) e.push(n); 3429 return e; 3430 }), 3431 odd: ve(function(e, t) { 3432 for (var n = 1; n < t; n += 2) e.push(n); 3433 return e; 3434 }), 3435 lt: ve(function(e, t, n) { 3436 for (var r = n < 0 ? n + t : t < n ? t : n; 0 <= --r; ) e.push(r); 3437 return e; 3438 }), 3439 gt: ve(function(e, t, n) { 3440 for (var r = n < 0 ? n + t : n; ++r < t; ) e.push(r); 3441 return e; 3442 }) 3443 } 3444 }).pseudos.nth = b.pseudos.eq, { 3445 radio: !0, 3446 checkbox: !0, 3447 file: !0, 3448 password: !0, 3449 image: !0 3450 }) b.pseudos[e] = de(e); 3451 for (e in { 3452 submit: !0, 3453 reset: !0 3454 }) b.pseudos[e] = he(e); 3455 function me() {} 3456 function xe(e) { 3457 for (var t = 0, n = e.length, r = ""; t < n; t++) r += e[t].value; 3458 return r; 3459 } 3460 function be(s, e, t) { 3461 var u = e.dir, l = e.next, c = l || u, f = t && "parentNode" === c, p = r++; 3462 return e.first ? function(e, t, n) { 3463 for (;e = e[u]; ) if (1 === e.nodeType || f) return s(e, t, n); 3464 return !1; 3465 } : function(e, t, n) { 3466 var r, i, o, a = [ k, p ]; 3467 if (n) { 3468 for (;e = e[u]; ) if ((1 === e.nodeType || f) && s(e, t, n)) return !0; 3469 } else for (;e = e[u]; ) if (1 === e.nodeType || f) if (i = (o = e[S] || (e[S] = {}))[e.uniqueID] || (o[e.uniqueID] = {}),
3470 l && l === e.nodeName.toLowerCase()) e = e[u] || e; else { 3471 if ((r = i[c]) && r[0] === k && r[1] === p) return a[2] = r[2]; 3472 if ((i[c] = a)[2] = s(e, t, n)) return !0; 3473 } 3474 return !1; 3475 }; 3476 } 3477 function we(i) { 3478 return 1 < i.length ? function(e, t, n) { 3479 for (var r = i.length; r--; ) if (!i[r](e, t, n)) return !1; 3480 return !0; 3481 } : i[0]; 3482 } 3483 function Te(e, t, n, r, i) { 3484 for (var o, a = [], s = 0, u = e.length, l = null != t; s < u; s++) (o = e[s]) && (n && !n(o, r, i) || (a.push(o), 3485 l && t.push(s))); 3486 return a; 3487 } 3488 function Ce(d, h, g, v, y, e) { 3489 return v && !v[S] && (v = Ce(v)), y && !y[S] && (y = Ce(y, e)), le(function(e, t, n, r) { 3490 var i, o, a, s = [], u = [], l = t.length, c = e || function(e, t, n) { 3491 for (var r = 0, i = t.length; r < i; r++) se(e, t[r], n); 3492 return n; 3493 }(h || "*", n.nodeType ? [ n ] : n, []), f = !d || !e && h ? c : Te(c, s, d, n, r), p = g ? y || (e ? d : l || v) ? [] : t : f; 3494 if (g && g(f, p, n, r), v) for (i = Te(p, u), v(i, [], n, r), o = i.length; o--; ) (a = i[o]) && (p[u[o]] = !(f[u[o]] = a)); 3495 if (e) { 3496 if (y || d) { 3497 if (y) { 3498 for (i = [], o = p.length; o--; ) (a = p[o]) && i.push(f[o] = a); 3499 y(null, p = [], i, r); 3500 } 3501 for (o = p.length; o--; ) (a = p[o]) && -1 < (i = y ? P(e, a) : s[o]) && (e[i] = !(t[i] = a)); 3502 } 3503 } else p = Te(p === t ? p.splice(l, p.length) : p), y ? y(null, t, p, r) : H.apply(t, p); 3504 }); 3505 } 3506 function Ee(e) { 3507 for (var i, t, n, r = e.length, o = b.relative[e[0].type], a = o || b.relative[" "], s = o ? 1 : 0, u = be(function(e) { 3508 return e === i; 3509 }, a, !0), l = be(function(e) { 3510 return -1 < P(i, e); 3511 }, a, !0), c = [ function(e, t, n) { 3512 var r = !o && (n || t !== w) || ((i = t).nodeType ? u(e, t, n) : l(e, t, n)); 3513 return i = null, r; 3514 } ]; s < r; s++) if (t = b.relative[e[s].type]) c = [ be(we(c), t) ]; else { 3515 if ((t = b.filter[e[s].type].apply(null, e[s].matches))[S]) { 3516 for (n = ++s; n < r && !b.relative[e[n].type]; n++) ; 3517 return Ce(1 < s && we(c), 1 < s && xe(e.slice(0, s - 1).concat({ 3518 value: " " === e[s - 2].type ? "*" : "" 3519 })).replace($, "$1"), t, s < n && Ee(e.slice(s, n)), n < r && Ee(e = e.slice(n)), n < r && xe(e)); 3520 } 3521 c.push(t); 3522 } 3523 return we(c); 3524 } 3525 return me.prototype = b.filters = b.pseudos, b.setFilters = new me(), h = se.tokenize = function(e, t) { 3526 var n, r, i, o, a, s, u, l = x[e + " "]; 3527 if (l) return t ? 0 : l.slice(0); 3528 for (a = e, s = [], u = b.preFilter; a; ) { 3529 for (o in n && !(r = _.exec(a)) || (r && (a = a.slice(r[0].length) || a), s.push(i = [])), 3530 n = !1, (r = z.exec(a)) && (n = r.shift(), i.push({ 3531 value: n, 3532 type: r[0].replace($, " ") 3533 }), a = a.slice(n.length)), b.filter) !(r = G[o].exec(a)) || u[o] && !(r = u[o](r)) || (n = r.shift(), 3534 i.push({ 3535 value: n, 3536 type: o, 3537 matches: r 3538 }), a = a.slice(n.length)); 3539 if (!n) break; 3540 } 3541 return t ? a.length : a ? se.error(e) : x(e, s).slice(0); 3542 }, f = se.compile = function(e, t) { 3543 var n, v, y, m, x, r, i = [], o = [], a = A[e + " "]; 3544 if (!a) { 3545 for (n = (t = t || h(e)).length; n--; ) (a = Ee(t[n]))[S] ? i.push(a) : o.push(a); 3546 (a = A(e, (v = o, m = 0 < (y = i).length, x = 0 < v.length, r = function(e, t, n, _r, i) { 3547 var o, a, s, u = 0, l = "0", c = e && [], f = [], p
3547= w, d = e || x && b.find.TAG("*", i), h = k += null == p ? 1 : Math.random() || .1, g = d.length; 3548 for (i && (w = t == C || t || i); l !== g && null != (o = d[l]); l++) { 3549 if (x && o) { 3550 for (a = 0, t || o.ownerDocument == C || (T(o), n = !E); s = v[a++]; ) if (s(o, t || C, n)) { 3551 _r.push(o); 3552 break; 3553 } 3554 i && (k = h); 3555 } 3556 m && ((o = !s && o) && u--, e && c.push(o)); 3557 } 3558 if (u += l, m && l !== u) { 3559 for (a = 0; s = y[a++]; ) s(c, f, t, n); 3560 if (e) { 3561 if (0 < u) for (;l--; ) c[l] || f[l] || (f[l] = q.call(_r)); 3562 f = Te(f); 3563 } 3564 H.apply(_r, f), i && !e && 0 < f.length && 1 < u + y.length && se.uniqueSort(_r); 3565 } 3566 return i && (k = h, w = p), c; 3567 }, m ? le(r) : r))).selector = e; 3568 } 3569 return a; 3570 }, g = se.select = function(e, t, n, r) { 3571 var i, o, a, s, u, l = "function" == typeof e && e, c = !r && h(e = l.selector || e); 3572 if (n = n || [], 1 === c.length) { 3573 if (2 < (o = c[0] = c[0].slice(0)).length && "ID" === (a = o[0]).type && 9 === t.nodeType && E && b.relative[o[1].type]) { 3574 if (!(t = (b.find.ID(a.matches[0].replace(te, ne), t) || [])[0])) return n; 3575 l && (t = t.parentNode), e = e.slice(o.shift().value.length); 3576 } 3577 for (i = G.needsContext.test(e) ? 0 : o.length; i-- && (a = o[i], !b.relative[s = a.type]); ) if ((u = b.find[s]) && (r = u(a.matches[0].replace(te, ne), ee.test(o[0].type) && ye(t.parentNode) || t))) { 3578 if (o.splice(i, 1), !(e = r.length && xe(o))) return H.apply(n, r), n; 3579 break; 3580 } 3581 } 3582 return (l || f(e, c))(r, t, !E, n, !t || ee.test(e) && ye(t.parentNode) || t), n; 3583 }, d.sortStable = S.split("").sort(D).join("") === S, d.detectDuplicates = !!l, 3584 T(), d.sortDetached = ce(function(e) { 3585 return 1 & e.compareDocumentPosition(C.createElement("fieldset")); 3586 }), ce(function(e) { 3587 return e.innerHTML = "<a href='#'></a>", "#" === e.firstChild.getAttribute("href"); 3588 }) || fe("type|href|height|width", function(e, t, n) { 3589 if (!n) return e.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2); 3590 }), d.attributes && ce(function(e) { 3591 return e.innerHTML = "<input/>", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value"); 3592 }) || fe("value", function(e, t, n) { 3593 if (!n && "input" === e.nodeName.toLowerCase()) return e.defaultValue; 3594 }), ce(function(e) { 3595 return null == e.getAttribute("disabled"); 3596 }) || fe(R, function(e, t, n) { 3597 var r; 3598 if (!n) return !0 === e[t] ? t.toLowerCase() : (r = e.getAttributeNode(t)) && r.specified ? r.value : null; 3599 }), se; 3600 }(C); 3601 S.find = d, S.expr = d.selectors, S.expr[":"] = S.expr.pseudos, S.uniqueSort = S.unique = d.uniqueSort, 3602 S.text = d.getText, S.isXMLDoc = d.isXML, S.contains = d.contains, S.escapeSelector = d.escape; 3603 var h = function(e, t, n) { 3604 for (var r = [], i = void 0 !== n; (e = e[t]) && 9 !== e.nodeType; ) if (1 === e.nodeType) { 3605 if (i && S(e).is(n)) break; 3606 r.push(e); 3607 } 3608 return r; 3609 }, T = function(e, t) { 3610 for (var n = []; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e); 3611 return n; 3612 }, k = S.expr.match.needsContext; 3613 function A(e, t) {
3614 return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase(); 3615 } 3616 var N = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i; 3617 function D(e, n, r) { 3618 return m(n) ? S.grep(e, function(e, t) { 3619 return !!n.call(e, t, e) !== r; 3620 }) : n.nodeType ? S.grep(e, function(e) { 3621 return e === n !== r; 3622 }) : "string" != typeof n ? S.grep(e, function(e) { 3623 return -1 < i.call(n, e) !== r; 3624 }) : S.filter(n, e, r); 3625 } 3626 S.filter = function(e, t, n) { 3627 var r = t[0]; 3628 return n && (e = ":not(" + e + ")"), 1 === t.length && 1 === r.nodeType ? S.find.matchesSelector(r, e) ? [ r ] : [] : S.find.matches(e, S.grep(t, function(e) { 3629 return 1 === e.nodeType; 3630 })); 3631 }, S.fn.extend({ 3632 find: function(e) { 3633 var t, n, r = this.length, i = this; 3634 if ("string" != typeof e) return this.pushStack(S(e).filter(function() { 3635 for (t = 0; t < r; t++) if (S.contains(i[t], this)) return !0; 3636 })); 3637 for (n = this.pushStack([]), t = 0; t < r; t++) S.find(e, i[t], n); 3638 return 1 < r ? S.uniqueSort(n) : n; 3639 }, 3640 filter: function(e) { 3641 return this.pushStack(D(this, e || [], !1)); 3642 }, 3643 not: function(e) { 3644 return this.pushStack(D(this, e || [], !0)); 3645 }, 3646 is: function(e) { 3647 return !!D(this, "string" == typeof e && k.test(e) ? S(e) : e || [], !1).length; 3648 } 3649 }); 3650 var j, q = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/; 3651 (S.fn.init = function(e, t, n) { 3652 var r, i; 3653 if (!e) return this; 3654 if (n = n || j, "string" != typeof e) return e.nodeType ? (this[0] = e, this.length = 1, 3655 this) : m(e) ? void 0 !== n.ready ? n.ready(e) : e(S) : S.makeArray(e, this); 3656 if (!(r = "<" === e[0] && ">" === e[e.length - 1] && 3 <= e.length ? [ null, e, null ] : q.exec(e)) || !r[1] && t) return !t || t.jquery ? (t || n).find(e) : this.constructor(t).find(e); 3657 if (r[1]) { 3658 if (t = t instanceof S ? t[0] : t, S.merge(this, S.parseHTML(r[1], t && t.nodeType ? t.ownerDocument || t : E, !0)), 3659 N.test(r[1]) && S.isPlainObject(t)) for (r in t) m(this[r]) ? this[r](t[r]) : this.attr(r, t[r]); 3660 return this; 3661 } 3662 return (i = E.getElementById(r[2])) && (this[0] = i, this.length = 1), this; 3663 }).prototype = S.fn, j = S(E); 3664 var L = /^(?:parents|prev(?:Until|All))/, H = { 3665 children: !0, 3666 contents: !0, 3667 next: !0, 3668 prev: !0 3669 }; 3670 function O(e, t) { 3671 for (;(e = e[t]) && 1 !== e.nodeType; ) ; 3672 return e; 3673 } 3674 S.fn.extend({ 3675 has: function(e) { 3676 var t = S(e, this), n = t.length; 3677 return this.filter(function() { 3678 for (var e = 0; e < n; e++) if (S.contains(this, t[e])) return !0; 3679 }); 3680 }, 3681 closest: function(e, t) { 3682 var n, r = 0, i = this.length, o = [], a = "string" != typeof e && S(e); 3683 if (!k.test(e)) for (;r < i; r++) for (n = this[r]; n && n !== t; n = n.parentNode) if (n.nodeType < 11 && (a ? -1 < a.index(n) : 1 === n.nodeType && S.find.matchesSelector(n, e))) { 3684 o.push(n); 3685 break; 3686 } 3687 return this.pushStack(1 < o.length ? S.uniqueSort(o) : o); 3688 }, 3689 index: function(e) { 3690 return e ? "string" == typeof e ? i.call(S(e), this[0]) : i.call(this, e.jquery ? e[0] : e) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1; 3691 }, 3692 add: function(e, t) { 3693 return this.pushStack(S.uniqueSort(S.merge(this.get(), S(e, t)))); 3694 }, 3695 addBack: function(e) { 3696 return this.add(null == e ? this.prevObject : this.prevObject.filter(e)); 3697 } 3698 }), S.each({ 3699 parent: function(e) { 3700 var t = e.parentNode; 3701 return t && 11 !== t.nodeType ? t : null; 3702 }, 3703 parents: function(e) { 3704 return h(e, "parentNode"); 3705 }, 3706 parentsUntil: function(e, t, n) { 3707 return h(e, "parentNode", n); 3708 }, 3709 next: function(e) { 3710 return O(e, "nextSibling"); 3711 }, 3712 prev: function(e) { 3713 return O(e, "previousSibling"); 3714 }, 3715 nextAll: function(e) { 3716 return h(e, "nextSibling"); 3717 }, 3718 prevAll: function(e) { 3719 return h(e, "previousSibling"); 3720 }, 3721 nextUntil: function(e, t, n) { 3722 return h(e, "nextSibling", n); 3723 }, 3724 prevUntil: function(e, t, n) { 3725 return h(e, "previousSibling", n); 3726 }, 3727 siblings: function(e) { 3728 return T((e.parentNode || {}).firstChild, e); 3729 }, 3730 children: function(e) { 3731 return T(e.firstChild); 3732 }, 3733 contents: function(e) { 3734 return null != e.contentDocument && r(e.contentDocument) ? e.contentDocument : (A(e, "template") && (e = e.content || e), 3735 S.merge([], e.childNodes)); 3736 } 3737 }, function(r, i) { 3738 S.fn[r] = function(e, t) { 3739 var n = S.map(this, i, e); 3740 return "Until" !== r.slice(-5) && (t = e), t && "string" == typeof t && (n = S.filter(t, n)), 3741 1 < this.length && (H[r] || S.uniqueSort(n), L.test(r) && n.reverse()), this.pushStack(n); 3742 }; 3743 }); 3744 var P = /[^\x20\t\r\n\f]+/g; 3745 function R(e) { 3746 return e; 3747 } 3748 function M(e) { 3749 throw e; 3750 } 3751 function I(e, t, n, r) { 3752 var i; 3753 try { 3754 e && m(i = e.promise) ? i.call(e).done(t).fail(n) : e && m(i = e.then) ? i.call(e, t, n) : t.apply(void 0, [ e ].slice(r)); 3755 } catch (e) { 3756 n.apply(void 0, [ e ]); 3757 } 3758 } 3759 S.Callbacks = function(r) { 3760 var e, n; 3761 r = "string" == typeof r ? (e = r, n = {}, S.each(e.match(P) || [], function(e, t) { 3762 n[t] = !0; 3763 }), n) : S.extend({}, r); 3764 var i, t, o, a, s = [], u = [], l = -1, c = function() { 3765 for (a = a || r.once, o = i = !0; u.length; l = -1) for (t = u.shift(); ++l < s.length; ) !1 === s[l].apply(t[0], t[1]) && r.stopOnFalse && (l = s.length, 3766 t = !1); 3767 r.memory || (t = !1), i = !1, a && (s = t ? [] : ""); 3768 }, f = { 3769 add: function() { 3770 return s && (t && !i && (l = s.length - 1, u.push(t)), function n(e) { 3771 S.each(e, function(e, t) { 3772 m(t) ? r.unique && f.has(t) || s.push(t) : t && t.length && "string" !== w(t) && n(t); 3773 }); 3774 }(arguments), t && !i && c()), this; 3775 }, 3776 remove: function() { 3777 return S.each(arguments, function(e, t) { 3778 for (var n; -1 < (n = S.inArray(t, s, n)); ) s.splice(n, 1), n <= l && l--; 3779 }), this; 3780 }, 3781 has: function(e) { 3782 return e ? -1 < S.inArray(e, s) : 0 < s.length; 3783 }, 3784 empty: function() { 3785 return s = s && [], this; 3786 }, 3787 disable: function() { 3788 return a = u = [], s = t = "", this; 3789 }, 3790 disabled: function() { 3791 return !s; 3792 }, 3793 lock: function() { 3794 return a = u = [], t || i || (s = t = ""), this; 3795 }, 3796 locked: function() { 3797 return !!a; 3798 }, 3799 fireWith: function(e, t) { 3800 return a || (t = [ e, (t = t || []).slice ? t.slice() : t ], u.push(t), i || c()), 3801 this; 3802 }, 3803 fire: function() { 3804 return f.fireWith(this, arguments), this; 3805 }, 3806 fired: function() { 3807 return !!o; 3808 } 3809 }; 3810 return f; 3811 }, S.extend({ 3812 Deferred: function(e) { 3813 var o = [ [ "notify", "progress", S.Callbacks("memory"), S.Callbacks("memory"), 2 ], [ "resolve", "done", S.Callbacks("once memory"), S.Callbacks("once memory"), 0, "resolved" ], [ "reject", "fail", S.Callbacks("once memory"), S.Callbacks("once memory"), 1, "rejected" ] ], i = "pending", a = { 3814 state: function() { 3815 return i; 3816 }, 3817 always: function() { 3818 return s.done(arguments).fail(arguments), this; 3819 }, 3820 catch: function(e) { 3821 return a.then(null, e); 3822 }, 3823 pipe: function() { 3824 var i = arguments; 3825 return S.Deferred(function(r) { 3826 S.each(o, function(e, t) { 3827 var n = m(i[t[4]]) && i[t[4]]; 3828 s[t[1]](function() { 3829 var e = n && n.apply(this, arguments); 3830 e && m(e.promise) ? e.promise().progress(r.notify).done(r.resolve).fail(r.reject) : r[t[0] + "With"](this, n ? [ e ] : arguments); 3831 }); 3832 }), i = null; 3833 }).promise(); 3834 }, 3835 then: function(t, n, r) { 3836 var u = 0; 3837 function l(i, o, a, s) { 3838 return function() { 3839 var n = this, r = arguments, e = function() { 3840 var e, t; 3841 if (!(i < u)) { 3842 if ((e = a.apply(n, r)) === o.promise()) throw new TypeError("Thenable self
3842-resolution"); 3843 t = e && ("object" == _typeof(e) || "function" == typeof e) && e.then, m(t) ? s ? t.call(e, l(u, o, R, s), l(u, o, M, s)) : (u++, 3844 t.call(e, l(u, o, R, s), l(u, o, M, s), l(u, o, R, o.notifyWith))) : (a !== R && (n = void 0, 3845 r = [ e ]), (s || o.resolveWith)(n, r)); 3846 } 3847 }, t = s ? e : function() { 3848 try { 3849 e(); 3850 } catch (e) { 3851 S.Deferred.exceptionHook && S.Deferred.exceptionHook(e, t.stackTrace), u <= i + 1 && (a !== M && (n = void 0, 3852 r = [ e ]), o.rejectWith(n, r)); 3853 } 3854 }; 3855 i ? t() : (S.Deferred.getStackHook && (t.stackTrace = S.Deferred.getStackHook()), 3856 C.setTimeout(t)); 3857 }; 3858 } 3859 return S.Deferred(function(e) { 3860 o[0][3].add(l(0, e, m(r) ? r : R, e.notifyWith)), o[1][3].add(l(0, e, m(t) ? t : R)), 3861 o[2][3].add(l(0, e, m(n) ? n : M)); 3862 }).promise(); 3863 }, 3864 promise: function(e) { 3865 return null != e ? S.extend(e, a) : a; 3866 } 3867 }, s = {}; 3868 return S.each(o, function(e, t) { 3869 var n = t[2], r = t[5]; 3870 a[t[1]] = n.add, r && n.add(function() { 3871 i = r; 3872 }, o[3 - e][2].disable, o[3 - e][3].disable, o[0][2].lock, o[0][3].lock), n.add(t[3].fire), 3873 s[t[0]] = function() { 3874 return s[t[0] + "With"](this === s ? void 0 : this, arguments), this; 3875 }, s[t[0] + "With"] = n.fireWith; 3876 }), a.promise(s), e && e.call(s, s), s; 3877 }, 3878 when: function(e) { 3879 var n = arguments.length, t = n, r = Array(t), i = s.call(arguments), o = S.Deferred(), a = function(t) { 3880 return function(e) { 3881 r[t] = this, i[t] = 1 < arguments.length ? s.call(arguments) : e, --n || o.resolveWith(r, i); 3882 }; 3883 }; 3884 if (n <= 1 && (I(e, o.done(a(t)).resolve, o.reject, !n), "pending" === o.state() || m(i[t] && i[t].then))) return o.then(); 3885 for (;t--; ) I(i[t], a(t), o.reject); 3886 return o.promise(); 3887 } 3888 }); 3889 var W = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 3890 S.Deferred.exceptionHook = function(e, t) { 3891 C.console && C.console.warn && e && W.test(e.name) && C.console.warn("jQuery.Deferred exception: " + e.message, e.stack, t); 3892 }, S.readyException = function(e) { 3893 C.setTimeout(function() { 3894 throw e; 3895 }); 3896 }; 3897 var F = S.Deferred(); 3898 function B() { 3899 E.removeEventListener("DOMContentLoaded", B), C.removeEventListener("load", B), 3900 S.ready(); 3901 } 3902 S.fn.ready = function(e) { 3903 return F.then(e).catch(function(e) { 3904 S.readyException(e); 3905 }), this; 3906 }, S.extend({ 3907 isReady: !1, 3908 readyWait: 1, 3909 ready: function(e) {
3910 (!0 === e ? --S.readyWait : S.isReady) || (S.isReady = !0) !== e && 0 < --S.readyWait || F.resolveWith(E, [ S ]); 3911 } 3912 }), S.ready.then = F.then, "complete" === E.readyState || "loading" !== E.readyState && !E.documentElement.doScroll ? C.setTimeout(S.ready) : (E.addEventListener("DOMContentLoaded", B), 3913 C.addEventListener("load", B)); 3914 function $(e, t, n, r, i, o, a) { 3915 var s = 0, u = e.length, l = null == n; 3916 if ("object" === w(n)) for (s in i = !0, n) $(e, t, s, n[s], !0, o, a); else if (void 0 !== r && (i = !0, 3917 m(r) || (a = !0), l && (t = a ? (t.call(e, r), null) : (l = t, function(e, _t2, n) { 3918 return l.call(S(e), n); 3919 })), t)) for (;s < u; s++) t(e[s], n, a ? r : r.call(e[s], s, t(e[s], n))); 3920 return i ? e : l ? t.call(e) : u ? t(e[0], n) : o; 3921 } 3922 var _ = /^-ms-/, z = /-([a-z])/g; 3923 function U(e, t) { 3924 return t.toUpperCase(); 3925 } 3926 function X(e) { 3927 return e.replace(_, "ms-").replace(z, U); 3928 } 3929 var V = function(e) { 3930 return 1 === e.nodeType || 9 === e.nodeType || !+e.n
3930odeType; 3931 }; 3932 function G() { 3933 this.expando = S.expando + G.uid++; 3934 } 3935 G.uid = 1, G.prototype = { 3936 cache: function(e) { 3937 var t = e[this.expando]; 3938 return t || (t = {}, V(e) && (e.nodeType ? e[this.expando] = t : Object.defineProperty(e, this.expando, { 3939 value: t, 3940 configurable: !0 3941 }))), t; 3942 }, 3943 set: function(e, t, n) { 3944 var r, i = this.cache(e); 3945 if ("string" == typeof t) i[X(t)] = n; else for (r in t) i[X(r)] = t[r]; 3946 return i; 3947 }, 3948 get: function(e, t) { 3949 return void 0 === t ? this.cache(e) : e[this.expando] && e[this.expando][X(t)]; 3950 }, 3951 access: function(e, t, n) { 3952 return void 0 === t || t && "string" == typeof t && void 0 === n ? this.get(e, t) : (this.set(e, t, n), 3953 void 0 !== n ? n : t); 3954 }, 3955 remove: function(e, t) { 3956 var n, r = e[this.expando]; 3957 if (void 0 !== r) { 3958 if (void 0 !== t) { 3959 n = (t = Array.isArray(t) ? t.map(X) : (t = X(t)) in r ? [ t ] : t.match(P) || []).length; 3960 for (;n--; ) delete r[t[n]]; 3961 } 3962 void 0 !== t && !S.isEmptyObject(r) || (e.nodeType ? e[this.expando] = void 0 : delete e[this.expando]); 3963 } 3964 }, 3965 hasData: function(e) { 3966 var t = e[this.expando]; 3967 return void 0 !== t && !S.isEmptyObject(t); 3968 } 3969 }; 3970 var Y = new G(), Q = new G(), J = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, K = /[A-Z]/g; 3971 function Z(e, t, n) { 3972 var r, i; 3973 if (void 0 === n && 1 === e.nodeType) if (r = "data-" + t.replace(K, "-$&").toLowerCase(), 3974 "string" == typeof (n = e.getAttribute(r))) { 3975 try { 3976 n = "true" === (i = n) || "false" !== i && ("null" === i ? null : i === +i + "" ? +i : J.test(i) ? JSON.parse(i) : i); 3977 } catch (e) {} 3978 Q.set(e, t, n); 3979 } else n = void 0; 3980 return n; 3981 } 3982 S.extend({ 3983 hasData: function(e) { 3984 return Q.hasData(e) || Y.hasData(e); 3985 }, 3986 data: function(e, t, n) { 3987 return Q.access(e, t, n); 3988 }, 3989 removeData: function(e, t) { 3990 Q.remove(e, t); 3991 }, 3992 _data: function(e, t, n) { 3993 return Y.access(e, t, n); 3994 }, 3995 _removeData: function(e, t) { 3996 Y.remove(e, t); 3997 } 3998 }), S.fn.extend({ 3999 data: function(n, e) { 4000 var t, r, i, o = this[0], a = o && o.attributes; 4001 if (void 0 !== n) return "object" == _typeof(n) ? this.each(function() { 4002 Q.set(this, n); 4003 }) : $(this, function(e) { 4004 var t; 4005 if (o && void 0 === e) return void 0 !== (t = Q.get(o, n)) ? t : void 0 !== (t = Z(o, n)) ? t : void 0; 4006 this.each(function() { 4007 Q.set(this, n, e); 4008 }); 4009 }, null, e, 1 < arguments.length, null, !0); 4010 if (this.length && (i = Q.get(o), 1 === o.nodeType && !Y.get(o, "hasDataAttrs"))) { 4011 for (t = a.length; t--; ) a[t] && 0 === (r = a[t].name).indexOf("data-") && (r = X(r.slice(5)), 4012 Z(o, r, i[r])); 4013 Y.set(o, "hasDataAttrs", !0); 4014 } 4015 return i; 4016 }, 4017 removeData: function(e) { 4018 return this.each(function() { 4019 Q.remove(this, e); 4020 }); 4021 } 4022 }), S.extend({ 4023 queue: function(e, t, n) { 4024 var r; 4025 if (e) return t = (t || "fx") + "queue", r = Y.get(e, t), n && (!r || Array.isArray(n) ? r = Y.access(e, t, S.makeArray(n)) : r.push(n)), 4026 r || []; 4027 }, 4028 dequeue: function(e, t) { 4029 t = t || "fx"; 4030 var n = S.queue(e, t), r = n.length, i = n.shift(), o = S._queueHooks(e, t); 4031 "inprogress" === i && (i = n.shift(), r--), i && ("fx" === t && n.unshift("inprogress"), 4032 delete o.stop, i.call(e, function() { 4033 S.dequeue(e, t); 4034 }, o)), !r && o && o.empty.fire(); 4035 }, 4036 _queueHooks: function(e, t) { 4037 var n = t + "queueHooks"; 4038 return Y.get(e, n) || Y.access(e, n, { 4039 empty: S.Callbacks("once memory").add(function() { 4040 Y.remove(e, [ t + "queue", n ]); 4041 }) 4042 }); 4043 } 4044 }), S.fn.extend({ 4045 queue: function(t, n) { 4046 var e = 2; 4047 return "string" != typeof t && (n = t, t = "fx", e--), arguments.length < e ? S.queue(this[0], t) : void 0 === n ? this
4047: this.each(function() { 4048 var e = S.queue(this, t, n); 4049 S._queueHooks(this, t), "fx" === t && "inprogress" !== e[0] && S.dequeue(this, t); 4050 }); 4051 }, 4052 dequeue: function(e) { 4053 return this.each(function() { 4054 S.dequeue(this, e); 4055 }); 4056 }, 4057 clearQueue: function(e) { 4058 return this.queue(e || "fx", []); 4059 }, 4060 promise: function(e, t) { 4061 var n, r = 1, i = S.Deferred(), o = this, a = this.length, s = function() { 4062 --r || i.resolveWith(o, [ o ]); 4063 }; 4064 for ("string" != typeof e && (t = e, e = void 0), e = e || "fx"; a--; ) (n = Y.get(o[a], e + "queueHooks")) && n.empty && (r++, 4065 n.empty.add(s)); 4066 return s(), i.promise(t); 4067 } 4068 }); 4069 var ee = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, te = new RegExp("^(?:([+-])=|)(" + ee + ")([a-z%]*)$", "i"), ne = [ "Top", "Right", "Bottom", "Left" ], re = E.documentElement, ie = function(e) { 4070 return S.contains(e.ownerDocument, e); 4071 }, oe = { 4072 composed: !0 4073 }; 4074 re.getRootNode && (ie = function(e) { 4075 return S.contains(e.ownerDocument, e) || e.getRootNode(oe) === e.ownerDocument; 4076 }); 4077 var ae = function(e, t) { 4078 return "none" === (e = t || e).style.display || "" === e.style.display && ie(e) && "none" === S.css(e, "display"); 4079 }; 4080 function se(e, t, n, r) { 4081 var i, o, a = 20, s = r ? function() { 4082 return r.cur(); 4083 } : function() { 4084 return S.css(e, t, ""); 4085 }, u = s(), l = n && n[3] || (S.cssNumber[t] ? "" : "px"), c = e.nodeType && (S.cssNumber[t] || "px" !== l && +u) && te.exec(S.css(e, t)); 4086 if (c && c[3] !== l) { 4087 for (u /= 2, l = l || c[3], c = +u || 1; a--; ) S.style(e, t, c + l), (1 - o) * (1 - (o = s() / u || .5)) <= 0 && (a = 0), 4088 c /= o; 4089 c *= 2, S.style(e, t, c + l), n = n || []; 4090 } 4091 return n && (c = +c || +u || 0, i = n[1] ? c + (n[1] + 1) * n[2] : +n[2], r && (r.unit = l, 4092 r.start = c, r.end = i)), i; 4093 } 4094 var ue = {}; 4095 function le(e, t) { 4096 for (var n, r, i, o, a, s, u, l = [], c = 0, f = e.length; c < f; c++) (r = e[c]).style && (n = r.style.display, 4097 t ? ("none" === n && (l[c] = Y.get(r, "dis
vendor: 15,418 bytes, lines 4097-4311
4097play") || null, l[c] || (r.style.display = "")), 4098 "" === r.style.display && ae(r) && (l[c] = (u = a = o = void 0, a = (i = r).ownerDocument, 4099 s = i.nodeName, (u = ue[s]) || (o = a.body.appendChild(a.createElement(s)), u = S.css(o, "display"), 4100 o.parentNode.removeChild(o), "none" === u && (u = "block"), ue[s] = u)))) : "none" !== n && (l[c] = "none", 4101 Y.set(r, "display", n))); 4102 for (c = 0; c < f; c++) null != l[c] && (e[c].style.display = l[c]); 4103 return e; 4104 } 4105 S.fn.extend({ 4106 show: function() { 4107 return le(this, !0); 4108 }, 4109 hide: function() { 4110 return le(this); 4111 }, 4112 toggle: function(e) { 4113 return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function() { 4114 ae(this) ? S(this).show() : S(this).hide(); 4115 }); 4116 } 4117 }); 4118 var ce, fe, pe = /^(?:checkbox|radio)$/i, de = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i, he = /^$|^module$|\/(?:java|ecma)script/i; 4119 ce = E.createDocumentFragment().appendChild(E.createElement("div")), (fe = E.createElement("input")).setAttribute("type", "radio"), 4120 fe.setAttribute("checked", "checked"), fe.setAttribute("name", "t"), ce.appendChild(fe), 4121 y.checkClone = ce.cloneNode(!0).cloneNode(!0).lastChild.checked, ce.innerHTML = "<textarea>x</textarea>", 4122 y.noCloneChecked = !!ce.cloneNode(!0).lastChild.defaultValue, ce.innerHTML = "<option></option>", 4123 y.option = !!ce.lastChild; 4124 var ge = { 4125 thead: [ 1, "<table>", "</table>" ], 4126 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 4127 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 4128 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 4129 _default: [ 0, "", "" ] 4130 }; 4131 function ve(e, t) { 4132 var n; 4133 return n = void 0 !== e.getElementsByTagName ? e.getElementsByTagName(t || "*") : void 0 !== e.querySelectorAll ? e.querySelectorAll(t || "*") : [], 4134 void 0 === t || t && A(e, t) ? S.merge([ e ], n) : n; 4135 } 4136 function ye(e, t) { 4137 for (var n = 0, r = e.length; n < r; n++) Y.set(e[n], "globalEval", !t || Y.get(t[n], "globalEval")); 4138 } 4139 ge.tbody = ge.tfoot = ge.colgroup = ge.caption = ge.thead, ge.th = ge.td, y.option || (ge.optgroup = ge.option = [ 1, "<select multiple='multiple'>", "</select>" ]); 4140 var me = /<|&#?\w+;/; 4141 function xe(e, t, n, r, i) { 4142 for (var o, a, s, u, l, c, f = t.createDocumentFragment(), p = [], d = 0, h = e.length; d < h; d++) if ((o = e[d]) || 0 === o) if ("object" === w(o)) S.merge(p, o.nodeType ? [ o ] : o); else if (me.test(o)) { 4143 for (a = a || f.appendChild(t.createElement("div")), s = (de.exec(o) || [ "", "" ])[1].toLowerCase(), 4144 u = ge[s] || ge._default, a.innerHTML = u[1] + S.htmlPrefilter(o) + u[2], c = u[0]; c--; ) a = a.lastChild; 4145 S.merge(p, a.childNodes), (a = f.firstChild).textContent = ""; 4146 } else p.push(t.createTextNode(o)); 4147 for (f.textContent = "", d = 0; o = p[d++]; ) if (r && -1 < S.inArray(o, r)) i && i.push(o); else if (l = ie(o), 4148 a = ve(f.appendChild(o), "script"), l && ye(a), n) for (c = 0; o = a[c++]; ) he.test(o.type || "") && n.push(o); 4149 return f; 4150 } 4151 var be = /^key/, we = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, Te = /^([^.]*)(?:\.(.+)|)/; 4152 function Ce() { 4153 return !0; 4154 } 4155 function Ee() { 4156 return !1; 4157 } 4158 function Se(e, t) { 4159 return e === function() { 4160 try { 4161 return E.activeElement; 4162 } catch (e) {} 4163 }() == ("focus" === t); 4164 } 4165 function ke(e, t, n, r, i, o) { 4166 var a, s; 4167 if ("object" == _typeof(t)) { 4168 for (s in "string" != typeof n && (r = r || n, n = void 0), t) ke(e, s, n, r, t[s], o); 4169 return e; 4170 } 4171 if (null == r && null == i ? (i = n, r = n = void 0) : null == i && ("string" == typeof n ? (i = r, 4172 r = void 0) : (i = r, r = n, n = void 0)), !1 === i) i = Ee; else if (!i) return e; 4173 return 1 === o && (a = i, (i = function(e) { 4174 return S().off(e), a.apply(this, arguments); 4175 }).guid = a.guid || (a.guid = S.guid++)), e.each(function() { 4176 S.event.add(this, t, i, r, n); 4177 }); 4178 } 4179 function Ae(e, i, o) { 4180 o ? (Y.set(e, i, !1), S.event.add(e, i, { 4181 namespace: !1, 4182 handler: function(e) { 4183 var t, n, r = Y.get(this, i); 4184 if (1 & e.isTrigger && this[i]) { 4185 if (r.length) (S.event.special[i] || {}).delegateType && e.stopPropagation(); else if (r = s.call(arguments), 4186 Y.set(this, i, r), t = o(this, i), this[i](), r !== (n = Y.get(this, i)) || t ? Y.set(this, i, !1) : n = {}, 4187 r !== n) return e.stopImmediatePropagation(), e.preventDefault(), n.value; 4188 } else r.length && (Y.set(this, i, { 4189 value: S.event.trigger(S.extend(r[0], S.Event.prototype), r.slice(1), this) 4190 }), e.stopImmediatePropagation()); 4191 } 4192 })) : void 0 === Y.get(e, i) && S.event.add(e, i, Ce); 4193 } 4194 S.event = { 4195 global: {}, 4196 add: function(t, e, n, r, i) { 4197 var o, a, s, u, l, c, f, p, d, h, g, v = Y.get(t); 4198 if (V(t)) for (n.handler && (n = (o = n).handler, i = o.selector), i && S.find.matchesSelector(re, i), 4199 n.guid || (n.guid = S.guid++), (u = v.events) || (u = v.events = Object.create(null)), 4200 (a = v.handle) || (a = v.handle = function(e) { 4201 return void 0 !== S && S.event.triggered !== e.type ? S.event.dispatch.apply(t, arguments) : void 0; 4202 }), l = (e = (e || "").match(P) || [ "" ]).length; l--; ) d = g = (s = Te.exec(e[l]) || [])[1], 4203 h = (s[2] || "").split(".").sort(), d && (f = S.event.special[d] || {}, d = (i ? f.delegateType : f.bindType) || d, 4204 f = S.event.special[d] || {}, c = S.extend({ 4205 type: d, 4206 origType: g, 4207 data: r, 4208 handler: n, 4209 guid: n.guid, 4210 selector: i, 4211 needsContext: i && S.expr.match.needsContext.test(i), 4212 namespace: h.join(".") 4213 }, o), (p = u[d]) || ((p = u[d] = []).delegateCount = 0, f.setup && !1 !== f.setup.call(t, r, h, a) || t.addEventListener && t.addEventListener(d, a)), 4214 f.add && (f.add.call(t, c), c.handler.guid || (c.handler.guid = n.guid)), i ? p.splice(p.delegateCount++, 0, c) : p.push(c), 4215 S.event.global[d] = !0); 4216 }, 4217 remove: function(e, t, n, r, i) { 4218 var o, a, s, u, l, c, f, p, d, h, g, v = Y.hasData(e) && Y.get(e); 4219 if (v && (u = v.events)) { 4220 for (l = (t = (t || "").match(P) || [ "" ]).length; l--; ) if (d = g = (s = Te.exec(t[l]) || [])[1], 4221 h = (s[2] || "").split(".").sort(), d) { 4222 for (f = S.event.special[d] || {}, p = u[d = (r ? f.delegateType : f.bindType) || d] || [], 4223 s = s[2] && new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)"), a = o = p.length; o--; ) c = p[o], 4224 !i && g !== c.origType || n && n.guid !== c.guid || s && !s.test(c.namespace) || r && r !== c.selector && ("**" !== r || !c.selector) || (p.splice(o, 1), 4225 c.selector && p.delegateCount--, f.remove && f.remove.call(e, c)); 4226 a && !p.length && (f.teardown && !1 !== f.teardown.call(e, h, v.handle) || S.removeEvent(e, d, v.handle), 4227 delete u[d]); 4228 } else for (d in u) S.event.remove(e, d + t[l], n, r, !0); 4229 S.isEmptyObject(u) && Y.remove(e, "handle events"); 4230 } 4231 }, 4232 dispatch: function(e) { 4233 var t, n, r, i, o, a, s = new Array(arguments.length), u = S.event.fix(e), l = (Y.get(this, "events") || Object.create(null))[u.type] || [], c = S.event.special[u.type] || {}; 4234 for (s[0] = u, t = 1; t < arguments.length; t++) s[t] = arguments[t]; 4235 if (u.delegateTarget = this, !c.preDispatch || !1 !== c.preDispatch.call(this, u)) { 4236 for (a = S.event.handlers.call(this, u, l), t = 0; (i = a[t++]) && !u.isPropagationStopped(); ) for (u.currentTarget = i.elem, 4237 n = 0; (o = i.handlers[n++]) && !u.isImmediatePropagationStopped(); ) u.rnamespace && !1 !== o.namespace && !u.rnamespace.test(o.namespace) || (u.handleObj = o, 4238 u.data = o.data, void 0 !== (r = ((S.event.special[o.origType] || {}).handle || o.handler).apply(i.elem, s)) && !1 === (u.result = r) && (u.preventDefault(), 4239 u.stopPropagation())); 4240 return c.postDispatch && c.postDispatch.call(this, u), u.result; 4241 } 4242 }, 4243 handlers: function(e, t) { 4244 var n, r, i, o, a, s = [], u = t.delegateCount, l = e.target; 4245 if (u && l.nodeType && !("click" === e.type && 1 <= e.button)) for (;l !== this; l = l.parentNode || this) if (1 === l.nodeType && ("click" !== e.type || !0 !== l.disabled)) { 4246 for (o = [], a = {}, n = 0; n < u; n++) void 0 === a[i = (r = t[n]).selector + " "] && (a[i] = r.needsContext ? -1 < S(i, this).index(l) : S.find(i, this, null, [ l ]).length), 4247 a[i] && o.push(r); 4248 o.length && s.push({ 4249 elem: l, 4250 handlers: o 4251 }); 4252 } 4253 return l = this, u < t.length && s.push({ 4254 elem: l, 4255 handlers: t.slice(u) 4256 }), s; 4257 }, 4258 addProp: function(t, e) { 4259 Object.defineProperty(S.Event.prototype, t, { 4260 enumerable: !0, 4261 configurable: !0, 4262 get: m(e) ? function() { 4263 if (this.originalEvent) return e(this.originalEvent); 4264 } : function() { 4265 if (this.originalEvent) return this.originalEvent[t]; 4266 }, 4267 set: function(e) { 4268 Object.defineProperty(this, t, { 4269 enumerable: !0, 4270 configurable: !0, 4271 writable: !0, 4272 value: e 4273 }); 4274 } 4275 }); 4276 }, 4277 fix: function(e) { 4278 return e[S.expando] ? e : new S.Event(e); 4279 }, 4280 special: { 4281 load: { 4282 noBubble: !0 4283 }, 4284 click: { 4285 setup: function(e) { 4286 var t = this || e; 4287 return pe.test(t.type) && t.click && A(t, "input") && Ae(t, "click", Ce), !1; 4288 }, 4289 trigger: function(e) { 4290 var t = this || e; 4291 return pe.test(t.type) && t.click && A(t, "input") && Ae(t, "click"), !0; 4292 }, 4293 _default: function(e) { 4294 var t = e.target; 4295 return pe.test(t.type) && t.click && A(t, "input") && Y.get(t, "click") || A(t, "a"); 4296 } 4297 }, 4298 beforeunload: { 4299 postDispatch: function(e) { 4300 void 0 !== e.result && e.originalEvent && (e.originalEvent.returnValue = e.result); 4301 } 4302 } 4303 } 4304 }, S.removeEvent = function(e, t, n) { 4305 e.removeEventListener && e.removeEventListener(t, n); 4306 }, S.Event = function(e, t) { 4307 if (!(this instanceof S.Event)) return new S.Event(e, t); 4308 e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || void 0 === e.defaultPrevented && !1 === e.returnValue ? Ce : Ee, 4309 this.target = e.target && 3 === e.target.nodeType ? e.target.parentNode : e.target, 4310 this.currentTarget = e.currentTarget, this.relatedTarget = e.relatedTarget) : this.type = e, 4311 t && S.extend(this, t), this.timeStamp = e && e.t
vendor: 8,360 bytes, lines 4311-4461
4311imeStamp || Date.now(), this[S.expando] = !0; 4312 }, S.Event.prototype = { 4313 constructor: S.Event, 4314 isDefaultPrevented: Ee, 4315 isPropagationStopped: Ee, 4316 isImmediatePropagationStopped: Ee, 4317 isSimulated: !1, 4318 preventDefault: function() { 4319 var e = this.originalEvent; 4320 this.isDefaultPrevented = Ce, e && !this.isSimulated && e.preventDefault(); 4321 }, 4322 stopPropagation: function() { 4323 var e = this.originalEvent; 4324 this.isPropagationStopped = Ce, e && !this.isSimulated && e.stopPropagation(); 4325 }, 4326 stopImmediatePropagation: function() { 4327 var e = this.originalEvent; 4328 this.isImmediatePropagationStopped = Ce, e && !this.isSimulated && e.stopImmediatePropagation(), 4329 this.stopPropagation(); 4330 } 4331 }, S.each({ 4332 altKey: !0, 4333 bubbles: !0, 4334 cancelable: !0, 4335 changedTouches: !0, 4336 ctrlKey: !0, 4337 detail: !0, 4338 eventPhase: !0, 4339 metaKey: !0, 4340 pageX: !0, 4341 pageY: !0, 4342 shiftKey: !0, 4343 view: !0, 4344 char: !0, 4345 code: !0, 4346 charCode: !0, 4347 key: !0, 4348 keyCode: !0, 4349 button: !0, 4350 buttons: !0, 4351 clientX: !0, 4352 clientY: !0, 4353 offsetX: !0, 4354 offsetY: !0, 4355 pointerId: !0, 4356 pointerType: !0, 4357 screenX: !0, 4358 screenY: !0, 4359 targetTouches: !0, 4360 toElement: !0, 4361 touches: !0, 4362 which: function(e) { 4363 var t = e.button; 4364 return null == e.which && be.test(e.type) ? null != e.charCode ? e.charCode : e.keyCode : !e.which && void 0 !== t && we.test(e.type) ? 1 & t ? 1 : 2 & t ? 3 : 4 & t ? 2 : 0 : e.which; 4365 } 4366 }, S.event.addProp), S.each({ 4367 focus: "focusin", 4368 blur: "focusout" 4369 }, function(e, t) { 4370 S.event.special[e] = { 4371 setup: function() { 4372 return Ae(this, e, Se), !1; 4373 }, 4374 trigger: function() { 4375 return Ae(this, e), !0; 4376 }, 4377 delegateType: t 4378 }; 4379 }), S.each({ 4380 mouseenter: "mouseover", 4381 mouseleave: "mouseout", 4382 pointerenter: "pointerover", 4383 pointerleave: "pointerout" 4384 }, function(e, i) { 4385 S.event.special[e] = { 4386 delegateType: i, 4387 bindType: i, 4388 handle: function(e) { 4389 var t, n = e.relatedTarget, r = e.handleObj; 4390 return n && (n === this || S.contains(this, n)) || (e.type = r.origType, t = r.handler.apply(this, arguments), 4391 e.type = i), t; 4392 } 4393 }; 4394 }), S.fn.extend({ 4395 on: function(e, t, n, r) { 4396 return ke(this, e, t, n, r); 4397 }, 4398 one: function(e, t, n, r) { 4399 return ke(this, e, t, n, r, 1); 4400 }, 4401 off: function(e, t, n) { 4402 var r, i; 4403 if (e && e.preventDefault && e.handleObj) return r = e.handleObj, S(e.delegateTarget).off(r.namespace ? r.origType + "." + r.namespace : r.origType, r.selector, r.handler), 4404 this; 4405 if ("object" != _typeof(e)) return !1 !== t && "function" != typeof t || (n = t, 4406 t = void 0), !1 === n && (n = Ee), this.each(function() { 4407 S.event.remove(this, e, n, t); 4408 }); 4409 for (i in e) this.off(i, t, e[i]); 4410 return this; 4411 } 4412 }); 4413 var Ne = /<script|<style|<link/i, De = /checked\s*(?:[^=]|=\s*.checked.)/i, je = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; 4414 function qe(e, t) { 4415 return A(e, "table") && A(11 !== t.nodeType ? t : t.firstChild, "tr") && S(e).children("tbody")[0] || e; 4416 } 4417 function Le(e) { 4418 return e.type = (null !== e.getAttribute("type")) + "/" + e.type, e; 4419 } 4420 function He(e) { 4421 return "true/" === (e.type || "").slice(0, 5) ? e.type = e.type.slice(5) : e.removeAttribute("type"), 4422 e; 4423 } 4424 function Oe(e, t) { 4425 var n, r, i, o, a, s; 4426 if (1 === t.nodeType) { 4427 if (Y.hasData(e) && (s = Y.get(e).events)) for (i in Y.remove(t, "handle events"), 4428 s) for (n = 0, r = s[i].length; n < r; n++) S.event.add(t, i, s[i][n]); 4429 Q.hasData(e) && (o = Q.access(e), a = S.extend({}, o), Q.set(t, a)); 4430 } 4431 } 4432 function Pe(n, r, i, o) { 4433 r = g(r); 4434 var e, t, a, s, u, l, c = 0, f = n.length, p = f - 1, d = r[0], h = m(d); 4435 if (h || 1 < f && "string" == typeof d && !y.checkClone && De.test(d)) return n.each(function(e) { 4436 var t = n.eq(e); 4437 h && (r[0] = d.call(this, e, t.html())), Pe(t, r, i, o); 4438 }); 4439 if (f && (t = (e = xe(r, n[0].ownerDocument, !1, n, o)).firstChild, 1 === e.childNodes.length && (e = t), 4440 t || o)) { 4441 for (s = (a = S.map(ve(e, "script"), Le)).length; c < f; c++) u = e, c !== p && (u = S.clone(u, !0, !0), 4442 s && S.merge(a, ve(u, "script"))), i.call(n[c], u, c); 4443 if (s) for (l = a[a.length - 1].ownerDocument, S.map(a, He), c = 0; c < s; c++) u = a[c], 4444 he.test(u.type || "") && !Y.access(u, "globalEval") && S.contains(l, u) && (u.src && "module" !== (u.type || "").toLowerCase() ? S._evalUrl && !u.noModule && S._evalUrl(u.src, { 4445 nonce: u.nonce || u.getAttribute("nonce") 4446 }, l) : b(u.textContent.replace(je, ""), u, l)); 4447 } 4448 return n; 4449 } 4450 function Re(e, t, n) { 4451 for (var r, i = t ? S.filter(t, e) : e, o = 0; null != (r = i[o]); o++) n || 1 !== r.nodeType || S.cleanData(ve(r)), 4452 r.parentNode && (n && ie(r) && ye(ve(r, "script")), r.parentNode.removeChild(r)); 4453 return e; 4454 } 4455 S.extend({ 4456 htmlPrefilter: function(e) { 4457 return e; 4458 }, 4459 clone: function(e, t, n) { 4460 var r, i, o, a, s, u, l, c = e.cloneNode(!0), f = ie(e); 4461 if (!(y.noCloneChecked || 1 !== e.nodeType && 11 !== e.
4461nodeType || S.isXMLDoc(e))) for (a = ve(c), 4462 r = 0, i = (o = ve(e)).length; r < i; r++) s = o[r], "input" === (l = (u = a[r]).nodeName.toLowerCase()) && pe.test(s.type) ? u.checked = s.checked : "input" !== l && "textarea" !== l || (u.defaultValue = s.defaultValue); 4463 if (t) if (n) for (o = o || ve(e), a = a || ve(c), r = 0, i = o.length; r < i; r++) Oe(o[r], a[r]); else Oe(e, c); 4464 return 0 < (a = ve(c, "script")).length && ye(a, !f && ve(e, "script")), c; 4465 }, 4466 cleanData: function(e) { 4467 for (var t, n, r, i = S.event.special, o = 0; void 0 !== (n = e[o]); o++) if (V(n)) { 4468 if (t = n[Y.expando]) { 4469 if (t.events) for (r in t.events) i[r] ? S.event.remove(n, r) : S.removeEvent(n, r, t.handle); 4470 n[Y.expando] = void 0; 4471 } 4472 n[Q.expando] && (n[Q.expando] = void 0); 4473 } 4474 } 4475 }), S.fn.extend({ 4476 detach: function(e) { 4477 return Re(this, e, !0); 4478 }, 4479 remove: function(e) { 4480 return Re(this, e); 4481 }, 4482 text: function(e) { 4483 return $(this, function(e) { 4484 return void 0 === e ? S.text(this) : this.empty().each(function() { 4485 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || (this.textContent = e); 4486 }); 4487 }, null, e, arguments.length); 4488 }, 4489 append: function() { 4490 return Pe(this, arguments, function(e) { 4491 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || qe(this, e).appendChild(e); 4492 }); 4493 }, 4494 prepend: function() { 4495 return Pe(this, arguments, function(e) { 4496 if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { 4497 var t = qe(this, e); 4498 t.insertBefore(e, t.firstChild); 4499 } 4500 }); 4501 }, 4502 before: function() { 4503 return Pe(this, arguments, function(e) { 4504 this.parentNode && this.parentNode.insertBefore(e, this); 4505 }); 4506 }, 4507 after: function() { 4508 return Pe(this, arguments, function(e) { 4509 this.parentNode && this.parentNode.insertBefore(e, this.nextSibling); 4510 }); 4511 }, 4512 empty: function() { 4513 for (var e, t = 0; null != (e = this[t]); t++) 1 === e.nodeType && (S.cleanData(ve(e, !1)), 4514 e.textContent = ""); 4515 return this; 4516 }, 4517 clone: function(e, t) { 4518 return e = null != e && e, t = null == t ? e : t, this.map(function() { 4519 return S.clone(this, e, t); 4520 }); 4521 }, 4522 html: function(e) { 4523 return $(this, function(e) { 4524 var t = this[0] || {}, n = 0, r = this.length; 4525 if (void 0 === e && 1 === t.nodeType) return t.innerHTML; 4526 if ("string" == typeof e && !Ne.test(e) && !ge[(de.exec(e) || [ "", "" ])[1].toLowerCase()]) { 4527 e = S.htmlPrefilter(e); 4528 try { 4529 for (;n < r; n++) 1 === (t = this[n] || {}).nodeType && (S.cleanData(ve(t, !1)), 4530 t.innerHTML = e); 4531 t = 0; 4532 } catch (e) {} 4533 } 4534 t && this.empty().append(e); 4535 }, null, e, arguments.length); 4536 }, 4537 replaceWith: function() { 4538 var n = []; 4539 return Pe(this, arguments, function(e) { 4540 var t = this.parentNode; 4541 S.inArray(this, n) < 0 && (S.cleanData(ve(this)), t && t.replaceChild(e, this)); 4542 }, n); 4543 } 4544 }), S.each({ 4545 appendTo: "append",
4546 prependTo: "prepend", 4547 insertBefore: "before", 4548 insertAfter: "after", 4549 replaceAll: "replaceWith" 4550 }, function(e, a) { 4551 S.fn[e] = function(e) { 4552 for (var t, n = [], r = S(e), i = r.length - 1, o = 0; o <= i; o++) t = o === i ? this : this.clone(!0), 4553 S(r[o])[a](t), u.apply(n, t.get()); 4554 return this.pushStack(n); 4555 }; 4556 }); 4557 var Me = new RegExp("^(" + ee + ")(?!px)[a-z%]+$", "i"), Ie = function(e) { 4558 var t = e.ownerDocument.defaultView; 4559 return t && t.opener || (t = C), t.getComputedStyle(e); 4560 }, We = function(e, t, n) { 4561 var r, i, o = {}; 4562 for (i in t) o[i] = e.style[i], e.style[i] = t[i]; 4563 for (i in r = n.call(e), t) e.style[i] = o[i]; 4564 return r; 4565 }, Fe = new RegExp(ne.join("|"), "i"); 4566 function Be(e, t, n) { 4567 var r, i, o, a, s = e.style; 4568 return (n = n || Ie(e)) && ("" !== (a = n.getPropertyValue(t) || n[t]) || ie(e) || (a = S.style(e, t)), 4569 !y.pixelBoxStyles() && Me.test(a) && Fe.test(t) && (r = s.width, i = s.minWidth, 4570 o = s.maxWidth, s.minWidth = s.maxWidth = s.width = a, a = n.width, s.width = r, 4571 s.minWidth = i, s.maxWidth = o)), void 0 !== a ? a + "" : a; 4572 } 4573 function $e(e, t) { 4574 return { 4575 get: function() { 4576 if (!e()) return (this.get = t).apply(this, arguments); 4577 delete this.get; 4578 } 4579 }; 4580 } 4581 !function() { 4582 function e() { 4583 if (l) { 4584 u.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0", 4585 l.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%", 4586 re.appendChild(u).appendChild(l); 4587 var e = C.getComputedStyle(l); 4588 n = "1%" !== e.top, s = 12 === t(e.marginLeft), l.style.right = "60%", o = 36 === t(e.right), 4589 r = 36 === t(e.width), l.style.position = "absolute", i = 12 === t(l.offsetWidth / 3), 4590 re.removeChild(u), l = null; 4591 } 4592 } 4593 function t(e) { 4594 return Math.round(parseFloat(e)); 4595 } 4596 var n, r, i, o, a, s, u = E.createElement("div"), l = E.createElement("div"); 4597 l.style && (l.style.backgroundClip = "content-box", l.cloneNode(!0).style.backgroundClip = "", 4598 y.clearCloneStyle = "content-box" === l.style.backgroundClip, S.extend(y, { 4599 boxSizingReliable: function() { 4600 return e(), r; 4601 }, 4602 pixelBoxStyles: function() { 4603 return e(), o; 4604 }, 4605 pixelPosition: function() { 4606 return e(), n; 4607 }, 4608 reliableMarginLeft: function() { 4609 return e(), s; 4610 }, 4611 scrollboxSize: function() { 4612 return e(), i; 4613 }, 4614 reliableTrDimensions: function() { 4615 var e, t, n, r; 4616 return null == a && (e = E.createElement("table"), t = E.createElement("tr"), n = E.createElement("div"), 4617 e.style.cssText = "position:absolute;
vendor: 5,813 bytes, lines 4617-4709
4617left:-11111px", t.style.height = "1px", n.style.height = "9px", 4618 re.appendChild(e).appendChild(t).appendChild(n), r = C.getComputedStyle(t), a = 3 < parseInt(r.height), 4619 re.removeChild(e)), a; 4620 } 4621 })); 4622 }(); 4623 var _e = [ "Webkit", "Moz", "ms" ], ze = E.createElement("div").style, Ue = {}; 4624 function Xe(e) { 4625 return S.cssProps[e] || Ue[e] || (e in ze ? e : Ue[e] = function(e) { 4626 for (var t = e[0].toUpperCase() + e.slice(1), n = _e.length; n--; ) if ((e = _e[n] + t) in ze) return e; 4627 }(e) || e); 4628 } 4629 var Ve = /^(none|table(?!-c[ea]).+)/, Ge = /^--/, Ye = { 4630 position: "absolute", 4631 visibility: "hidden", 4632 display: "block" 4633 }, Qe = { 4634 letterSpacing: "0", 4635 fontWeight: "400" 4636 }; 4637 function Je(e, t, n) { 4638 var r = te.exec(t); 4639 return r ? Math.max(0, r[2] - (n || 0)) + (r[3] || "px") : t; 4640 } 4641 function Ke(e, t, n, r, i, o) { 4642 var a = "width" === t ? 1 : 0, s = 0, u = 0; 4643 if (n === (r ? "border" : "content")) return 0; 4644 for (;a < 4; a += 2) "margin" === n && (u += S.css(e, n + ne[a], !0, i)), r ? ("content" === n && (u -= S.css(e, "padding" + ne[a], !0, i)), 4645 "margin" !== n && (u -= S.css(e, "border" + ne[a] + "Width", !0, i))) : (u += S.css(e, "padding" + ne[a], !0, i), 4646 "padding" !== n ? u += S.css(e, "border" + ne[a] + "Width", !0, i) : s += S.css(e, "border" + ne[a] + "Width", !0, i)); 4647 return !r && 0 <= o && (u += Math.max(0, Math.ceil(e["offset" + t[0].toUpperCase() + t.slice(1)] - o - u - s - .5)) || 0), 4648 u; 4649 } 4650 function Ze(e, t, n) { 4651 var r = Ie(e), i = (!y.boxSizingReliable() || n) && "border-box" === S.css(e, "boxSizing", !1, r), o = i, a = Be(e, t, r), s = "offset" + t[0].toUpperCase() + t.slice(1); 4652 if (Me.test(a)) { 4653 if (!n) return a; 4654 a = "auto"; 4655 } 4656 return (!y.boxSizingReliable() && i || !y.reliableTrDimensions() && A(e, "tr") || "auto" === a || !parseFloat(a) && "inline" === S.css(e, "display", !1, r)) && e.getClientRects().length && (i = "border-box" === S.css(e, "boxSizing", !1, r), 4657 (o = s in e) && (a = e[s])), (a = parseFloat(a) || 0) + Ke(e, t, n || (i ? "border" : "content"), o, r, a) + "px"; 4658 } 4659 function et(e, t, n, r, i) { 4660 return new et.prototype.init(e, t, n, r, i); 4661 } 4662 S.extend({ 4663 cssHooks: { 4664 opacity: { 4665 get: function(e, t) { 4666 if (t) { 4667 var n = Be(e, "opacity"); 4668 return "" === n ? "1" : n; 4669 } 4670 } 4671 } 4672 }, 4673 cssNumber: { 4674 animationIterationCount: !0, 4675 columnCount: !0, 4676 fillOpacity: !0, 4677 flexGrow: !0, 4678 flexShrink: !0, 4679 fontWeight: !0, 4680 gridArea: !0, 4681 gridColumn: !0, 4682 gridColumnEnd: !0, 4683 gridColumnStart: !0, 4684 gridRow: !0, 4685 gridRowEnd: !0, 4686 gridRowStart: !0, 4687 lineHeight: !0, 4688 opacity: !0, 4689 order: !0, 4690 orphans: !0, 4691 widows: !0, 4692 zIndex: !0, 4693 zoom: !0 4694 }, 4695 cssProps: {}, 4696 style: function(e, t, n, r) { 4697 if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) { 4698 var i, o, a, s = X(t), u = Ge.test(t), l = e.style; 4699 if (u || (t = Xe(s)), a = S.cssHooks[t] || S.cssHooks[s], void 0 === n) return a && "get" in a && void 0 !== (i = a.get(e, !1, r)) ? i : l[t]; 4700 "string" === (o = _typeof(n)) && (i = te.exec(n)) && i[1] && (n = se(e, t, i), o = "number"), 4701 null != n && n == n && ("number" !== o || u || (n += i && i[3] || (S.cssNumber[s] ? "" : "px")), 4702 y.clearCloneStyle || "" !== n || 0 !== t.indexOf("background") || (l[t] = "inherit"), 4703 a && "set" in a && void 0 === (n = a.set(e, n, r)) || (u ? l.setProperty(t, n) : l[t] = n)); 4704 } 4705 }, 4706 css: function(e, t, n, r) { 4707 var i, o, a, s = X(t); 4708 return Ge.test(t) || (t = Xe(s)), (a = S.cssHooks[t] || S.cssHooks[s]) && "get" in a && (i = a.get(e, !0, n)), 4709 void 0 === i && (i = Be(e, t, r)), "n
4709ormal" === i && t in Qe && (i = Qe[t]), "" === n || n ? (o = parseFloat(i), 4710 !0 === n || isFinite(o) ? o || 0 : i) : i; 4711 } 4712 }), S.each([ "height", "width" ], function(e, u) { 4713 S.cssHooks[u] = { 4714 get: function(e, t, n) { 4715 if (t) return !Ve.test(S.css(e, "display")) || e.getClientRects().length && e.getBoundingClientRect().width ? Ze(e, u, n) : We(e, Ye, function() { 4716 return Ze(e, u, n); 4717 }); 4718 }, 4719 set: function(e, t, n) { 4720 var r, i = Ie(e), o = !y.scrollboxSize() && "absolute" === i.position, a = (o || n) && "border-box" === S.css(e, "boxSizing", !1, i), s = n ? Ke(e, u, n, a, i) : 0; 4721 return a && o && (s -= Math.ceil(e["offset" + u[0].toUpperCase() + u.slice(1)] - parseFloat(i[u]) - Ke(e, u, "border", !1, i) - .5)), 4722 s && (r = te.exec(t)) && "px" !== (r[3] || "px") && (e.style[u] = t, t = S.css(e, u)), 4723 Je(0, t, s); 4724 } 4725 }; 4726 }), S.cssHooks.marginLeft = $e(y.reliableMarginLeft, function(e, t) { 4727 if (t) return (parseFloat(Be(e, "marginLeft")) || e.getBoundingClientRect().left - We(e, { 4728 marginLeft: 0 4729 }, function() { 4730 return e.getBoundingClientRect().left; 4731 })) + "px"; 4732 }), S.each({ 4733 margin: "", 4734 padding: "", 4735 border: "Width" 4736 }, function(i, o) { 4737 S.cssHooks[i + o] = { 4738 expand: function(e) { 4739 for (var t = 0, n = {}, r = "string" == typeof e ? e.split(" ") : [ e ]; t < 4; t++) n[i + ne[t] + o] = r[t] || r[t - 2] || r[0]; 4740 return n; 4741 } 4742 }, "margin" !== i && (S.cssHooks[i + o].set = Je); 4743 }), S.fn.extend({ 4744 css: function(e, t) { 4745 return $(this, function(e, t, n) { 4746 var r, i, o = {}, a = 0; 4747 if (Array.isArray(t)) { 4748 for (r = Ie(e), i = t.length; a < i; a++) o[t[a]] = S.css(e, t[a], !1, r); 4749 return o; 4750 } 4751 return void 0 !== n ? S.style(e, t, n) : S.css(e, t); 4752 }, e, t, 1 < arguments.length); 4753 } 4754 }), ((S.Tween = et).prototype = { 4755 constructor: et, 4756 init: function(e, t, n, r, i, o) { 4757 this.elem = e, this.prop = n, this.easing = i || S.easing._default, this.options = t, 4758 this.start = this.now = this.cur(), this.end = r, this.unit = o || (S.cssNumber[n] ? "" : "px"); 4759 }, 4760 cur: function() { 4761 var e = et.propHooks[this.prop]; 4762 return e && e.get ? e.get(this) : et.propHooks._default.get(this); 4763 }, 4764 run: function(e) { 4765 var t, n = et.propHooks[this.prop]; 4766 return this.options.duration ? this.pos = t = S.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : this.pos = t = e, 4767 this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), 4768 n && n.set ? n.set(this) : et.propHooks._default.set(this), this; 4769 } 4770 }).init.prototype = et.prototype, (et.propHooks = { 4771 _default: { 4772 get: function(e) { 4773 var t; 4774 return 1 !== e.elem.nodeType || null != e.elem[e.prop] && null == e.elem.style[e.prop] ? e.elem[e.prop] : (t = S.css(e.elem, e.prop, "")) && "auto" !== t ? t : 0; 4775 }, 4776 set: function(e) { 4777 S.fx.step[e.prop] ? S.fx.step[e.prop](e) : 1 !== e.elem.nodeType || !S.cssHooks[e.prop] && null == e.elem.style[Xe(e.prop)] ? e.elem[e.prop] = e.now : S.style(e.elem, e.prop, e.now + e.unit); 4778 } 4779 } 4780 }).scrollTop = et.propHooks.scrollLeft = { 4781 set: function(e) { 4782 e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now); 4783 } 4784 }, S.easing = { 4785 linear: function(e) { 4786 return e; 4787 }, 4788 swing: function(e) { 4789 return .5 - Math.cos(e * Math.PI) / 2; 4790 }, 4791 _default: "swing" 4792 }, S.fx = et.prototype.init, S.fx.step = {}; 4793 var tt, nt, rt, it, ot = /^(?:toggle|show|hide)$/, at = /queueHooks$/; 4794 function st() { 4795 nt && (!1 === E.hidden && C.requestAnimationFrame ? C.requestAnimationFrame(st) : C.setTimeout(st, S.fx.interval), 4796 S.fx.tick()); 4797 } 4798 function ut() { 4799 return C.setTimeout(function() { 4800 tt = void 0; 4801 }), tt = Date.now(); 4802 } 4803 function lt(e, t) { 4804 var n, r = 0, i = { 4805 height: e 4806 }; 4807 for (t = t ? 1 : 0; r < 4; r += 2 - t) i["margin" + (n = ne[r])] = i["padding" + n] = e;
4808 return t && (i.opacity = i.width = e), i; 4809 } 4810 function ct(e, t, n) { 4811 for (var r, i = (ft.tweeners[t] || []).concat(ft.tweeners["*"]), o = 0, a = i.length; o < a; o++) if (r = i[o].call(n, t, e)) return r; 4812 } 4813 function ft(o, e, t) { 4814 var n, a, r = 0, i = ft.prefilters.length, s = S.Deferred().always(function() { 4815 delete u.elem; 4816 }), u = function() { 4817 if (a) return !1; 4818 for (var e = tt || ut(), t = Math.max(0, l.startTime + l.duration - e), n = 1 - (t / l.duration || 0), r = 0, i = l.tweens.length; r < i; r++) l.tweens[r].run(n); 4819 return s.notifyWith(o, [ l, n, t ]), n < 1 && i ? t : (i || s.notifyWith(o, [ l, 1, 0 ]), 4820 s.resolveWith(o, [ l ]), !1); 4821 }, l = s.promise({ 4822 elem: o, 4823 props: S.extend({}, e), 4824 opts: S.extend(!0, { 4825 specialEasing: {}, 4826 easing: S.easing._default 4827 }, t), 4828 originalProperties: e, 4829 originalOptions: t, 4830 startTime: tt || ut(), 4831 duration: t.duration, 4832 tweens: [], 4833 createTween: function(e, t) { 4834 var n = S.Tween(o, l.opts, e, t, l.opts.specialEasing[e] || l.opts.easing); 4835 return l.tweens.push(n), n; 4836 }, 4837 stop: function(e) { 4838 var t = 0, n = e ? l.tweens.length : 0; 4839 if (a) return this; 4840 for (a = !0; t < n; t++) l.tweens[t].run(1); 4841 return e ? (s.notifyWith(o, [ l, 1, 0 ]), s.resolveWith(o, [ l, e ])) : s.rejectWith(o, [ l, e ]), 4842 this; 4843 } 4844 }), c = l.props; 4845 for (function(e, t) { 4846 var n, r, i, o, a; 4847 for (n in e) if (i = t[r = X(n)], o = e[n], Array.isArray(o) && (i = o[1], o = e[n] = o[0]), 4848 n !== r && (e[r] = o, delete e[n]), (a = S.cssHooks[r]) && "expand" in a) for (n in o = a.expand(o), 4849 delete e[r], o) n in e || (e[n] = o[n], t[n] = i); else t[r] = i; 4850 }(c, l.opts.specialEasing); r < i; r++) if (n = ft.prefilters[r].call(l, o, c, l.opts)) return m(n.stop) && (S._queueHooks(l.elem, l.opts.queue).stop = n.stop.bind(n)), 4851 n; 4852 return S.map(c, ct, l), m(l.opts.start) && l.opts.start.call(o, l), l.progress(l.opts.progress).done(l.opts.done, l.opts.complete).fail(l.opts.fail).always(l.opts.always), 4853 S.fx.timer(S.extend(u, { 4854 elem: o, 4855 anim: l, 4856 queue: l.opts.queue 4857 })), l; 4858 } 4859 S.Animation = S.extend(ft, { 4860 tweeners: { 4861 "*": [ function(e, t) { 4862 var n = this.createTween(e, t); 4863 return se(n.elem, e, te.exec(t), n), n; 4864 } ] 4865 }, 4866 tweener: function(e, t) { 4867 for (var n, r = 0, i = (e = m(e) ? (t = e, [ "*" ]) : e.match(P)).length; r < i; r++) n = e[r], 4868 ft.tweeners[n] = ft.tweeners[n] || [], ft.tweeners[n].unshift(t); 4869 }, 4870 prefilters: [ function(e, t, n) {
vendor: 7,742 bytes, lines 4871-4986
4871 var r, i, o, a, s, u, l, c, f = "width" in t || "height" in t, p = this, d = {}, h = e.style, g = e.nodeType && ae(e), v = Y.get(e, "fxshow"); 4872 for (r in n.queue || (null == (a = S._queueHooks(e, "fx")).unqueued && (a.unqueued = 0, 4873 s = a.empty.fire, a.empty.fire = function() { 4874 a.unqueued || s(); 4875 }), a.unqueued++, p.always(function() { 4876 p.always(function() { 4877 a.unqueued--, S.queue(e, "fx").length || a.empty.fire(); 4878 }); 4879 })), t) if (i = t[r], ot.test(i)) { 4880 if (delete t[r], o = o || "toggle" === i, i === (g ? "hide" : "show")) { 4881 if ("show" !== i || !v || void 0 === v[r]) continue; 4882 g = !0; 4883 } 4884 d[r] = v && v[r] || S.style(e, r); 4885 } 4886 if ((u = !S.isEmptyObject(t)) || !S.isEmptyObject(d)) for (r in f && 1 === e.nodeType && (n.overflow = [ h.overflow, h.overflowX, h.overflowY ], 4887 null == (l = v && v.display) && (l = Y.get(e, "display")), "none" === (c = S.css(e, "display")) && (l ? c = l : (le([ e ], !0), 4888 l = e.style.display || l, c = S.css(e, "display"), le([ e ]))), ("inline" === c || "inline-block" === c && null != l) && "none" === S.css(e, "float") && (u || (p.done(function() { 4889 h.display = l; 4890 }), null == l && (c = h.display, l = "none" === c ? "" : c)), h.display = "inline-block")), 4891 n.overflow && (h.overflow = "hidden", p.always(function() { 4892 h.overflow = n.overflow[0], h.overflowX = n.overflow[1], h.overflowY = n.overflow[2]; 4893 })), u = !1, d) u || (v ? "hidden" in v && (g = v.hidden) : v = Y.access(e, "fxshow", { 4894 display: l 4895 }), o && (v.hidden = !g), g && le([ e ], !0), p.done(function() { 4896 for (r in g || le([ e ]), Y.remove(e, "fxshow"), d) S.style(e, r, d[r]); 4897 })), u = ct(g ? v[r] : 0, r, p), r in v || (v[r] = u.start, g && (u.end = u.start, 4898 u.start = 0)); 4899 } ], 4900 prefilter: function(e, t) { 4901 t ? ft.prefilters.unshift(e) : ft.prefilters.push(e); 4902 } 4903 }), S.speed = function(e, t, n) { 4904 var r = e && "object" == _typeof(e) ? S.extend({}, e) : { 4905 complete: n || !n && t || m(e) && e, 4906 duration: e, 4907 easing: n && t || t && !m(t) && t 4908 }; 4909 return S.fx.off ? r.duration = 0 : "number" != typeof r.duration && (r.duration in S.fx.speeds ? r.duration = S.fx.speeds[r.duration] : r.duration = S.fx.speeds._default), 4910 null != r.queue && !0 !== r.queue || (r.queue = "fx"), r.old = r.complete, r.complete = function() { 4911 m(r.old) && r.old.call(this), r.queue && S.dequeue(this, r.queue); 4912 }, r; 4913 }, S.fn.extend({ 4914 fadeTo: function(e, t, n, r) { 4915 return this.filter(ae).css("opacity", 0).show().end().animate({ 4916 opacity: t 4917 }, e, n, r); 4918 }, 4919 animate: function(t, e, n, r) { 4920 var i = S.isEmptyObject(t), o = S.speed(e, n, r), a = function() { 4921 var e = ft(this, S.extend({}, t), o); 4922 (i || Y.get(this, "finish")) && e.stop(!0); 4923 }; 4924 return a.finish = a, i || !1 === o.queue ? this.each(a) : this.queue(o.queue, a); 4925 }, 4926 stop: function(i, e, o) { 4927 var a = function(e) { 4928 var t = e.stop; 4929 delete e.stop, t(o); 4930 }; 4931 return "string" != typeof i && (o = e, e = i, i = void 0), e && this.queue(i || "fx", []), 4932 this.each(function() { 4933 var e = !0, t = null != i && i + "queueHooks", n = S.timers, r = Y.get(this); 4934 if (t) r[t] && r[t].stop && a(r[t]); else for (t in r) r[t] && r[t].stop && at.test(t) && a(r[t]); 4935 for (t = n.length; t--; ) n[t].elem !== this || null != i && n[t].queue !== i || (n[t].anim.stop(o), 4936 e = !1, n.splice(t, 1)); 4937 !e && o || S.dequeue(this, i); 4938 }); 4939 }, 4940 finish: function(a) { 4941 return !1 !== a && (a = a || "fx"), this.each(function() { 4942 var e, t = Y.get(this), n = t[a + "queue"], r = t[a + "queueHooks"], i = S.timers, o = n ? n.length : 0; 4943 for (t.finish = !0, S.queue(this, a, []), r && r.stop && r.stop.call(this, !0), 4944 e = i.length; e--; ) i[e].elem === this && i[e].queue === a && (i[e].anim.stop(!0), 4945 i.splice(e, 1)); 4946 for (e = 0; e < o; e++) n[e] && n[e].finish && n[e].finish.call(this); 4947 delete t.finish; 4948 }); 4949 } 4950 }), S.each([ "toggle", "show", "hide" ], function(e, r) { 4951 var i = S.fn[r]; 4952 S.fn[r] = function(e, t, n) { 4953 return null == e || "boolean" == typeof e ? i.apply(this, arguments) : this.animate(lt(r, !0), e, t, n); 4954 }; 4955 }), S.each({ 4956 slideDown: lt("show"), 4957 slideUp: lt("hide"), 4958 slideToggle: lt("toggle"), 4959 fadeIn: { 4960 opacity: "show" 4961 }, 4962 fadeOut: { 4963 opacity: "hide" 4964 }, 4965 fadeToggle: { 4966 opacity: "toggle" 4967 } 4968 }, function(e, r) { 4969 S.fn[e] = function(e, t, n) { 4970 return this.animate(r, e, t, n); 4971 }; 4972 }), S.timers = [], S.fx.tick = function() { 4973 var e, t = 0, n = S.timers; 4974 for (tt = Date.now(); t < n.length; t++) (e = n[t])() || n[t] !== e || n.splice(t--, 1); 4975 n.length || S.fx.stop(), tt = void 0; 4976 }, S.fx.timer = function(e) { 4977 S.timers.push(e), S.fx.start(); 4978 }, S.fx.interval = 13, S.fx.start = function() { 4979 nt || (nt = !0, st()); 4980 }, S.fx.stop = function() { 4981 nt = null; 4982 }, S.fx.speeds = { 4983 slow: 600, 4984 fast: 200, 4985 _default: 400 4986 }
4986, S.fn.delay = function(r, e) { 4987 return r = S.fx && S.fx.speeds[r] || r, e = e || "fx", this.queue(e, function(e, t) { 4988 var n = C.setTimeout(e, r); 4989 t.stop = function() { 4990 C.clearTimeout(n); 4991 }; 4992 }); 4993 }, rt = E.createElement("input"), it = E.createElement("select").appendChild(E.createElement("option")), 4994 rt.type = "checkbox", y.checkOn = "" !== rt.value, y.optSelected = it.selected, 4995 (rt = E.createElement("input")).value = "t", rt.type = "radio", y.radioValue = "t" === rt.value; 4996 var pt, dt = S.expr.attrHandle; 4997 S.fn.extend({ 4998 attr: function(e, t) { 4999 return $(this, S.attr, e, t, 1 < arguments.length); 5000 }, 5001 removeAttr: function(e) { 5002 return this.each(function() { 5003 S.removeAttr(this, e); 5004 }); 5005 } 5006 }), S.extend({ 5007 attr: function(e, t, n) { 5008 var r, i, o = e.nodeType; 5009 if (3 !== o && 8 !== o && 2 !== o) return void 0 === e.getAttribute ? S.prop(e, t, n) : (1 === o && S.isXMLDoc(e) || (i = S.attrHooks[t.toLowerCase()] || (S.expr.match.bool.test(t) ? pt : void 0)), 5010 void 0 !== n ? null === n ? void S.removeAttr(e, t) : i && "set" in i && void 0 !== (r = i.set(e, n, t)) ? r : (e.setAttribute(t, n + ""), 5011 n) : i && "get" in i && null !== (r = i.get(e, t)) ? r : null == (r = S.find.attr(e, t)) ? void 0 : r); 5012 }, 5013 attrHooks: { 5014 type: { 5015 set: function(e, t) { 5016 if (!y.radioValue && "radio" === t && A(e, "input")) { 5017 var n = e.value; 5018 return e.setAttribute("type", t), n && (e.value = n), t; 5019 } 5020 } 5021 } 5022 }, 5023 removeAttr: function(e, t) { 5024 var n, r = 0, i = t && t.match(P); 5025 if (i && 1 === e.nodeType) for (;n = i[r++]; ) e.removeAttribute(n); 5026 } 5027 }), pt = { 5028 set: function(e, t, n) { 5029 return !1 === t ? S.removeAttr(e, n) : e.setAttribute(n, n), n; 5030 } 5031 }, S.each(S.expr.match.bool.source.match(/\w+/g), function(e, t) { 5032 var a = dt[t] || S.find.attr; 5033 dt[t] = function(e, t, n) { 5034 var r, i, o = t.toLowerCase(); 5035 return n || (i = dt[o], dt[o] = r, r = null != a(e, t, n) ? o : null, dt[o] = i), 5036 r; 5037 }; 5038 }); 5039 var ht = /^(?:input|select|textarea|button)$/i, gt = /^(?:a|area)$/i; 5040 function vt(e) { 5041 return (e.match(P) || []).join(" "); 5042 } 5043 function yt(e) { 5044 return e.getAttribute && e.getAttribute("class") || ""; 5045 } 5046 function mt(e) { 5047 return Array.isArray(e) ? e : "string" == typeof e && e.match(P) || []; 5048 } 5049 S.fn.extend({ 5050 prop: function(e, t) { 5051 return $(this, S.prop, e, t, 1 < arguments.length); 5052 }, 5053 removeProp: function(e) { 5054 return this.each(function() { 5055 delete this[S.propFix[e] || e]; 5056 }); 5057 } 5058 }), S.extend({ 5059 prop: function(e, t, n) {
5060 var r, i, o = e.nodeType; 5061 if (3 !== o && 8 !== o && 2 !== o) return 1 === o && S.isXMLDoc(e) || (t = S.propFix[t] || t, 5062 i = S.propHooks[t]), void 0 !== n ? i && "set" in i && void 0 !== (r = i.set(e, n, t)) ? r : e[t] = n : i && "get" in i && null !== (r = i.get(e, t)) ? r : e[t]; 5063 }, 5064 propHooks: { 5065 tabIndex: { 5066 get: function(e) { 5067 var t = S.find.attr(e, "tabindex"); 5068 return t ? parseInt(t, 10) : ht.test(e.nodeName) || gt.test(e.nodeName) && e.href ? 0 : -1; 5069 } 5070 } 5071 }, 5072 propFix: { 5073 for: "htmlFor", 5074 class: "className" 5075 } 5076 }), y.optSelected || (S.propHooks.selected = { 5077 get: function(e) { 5078 var t = e.parentNode; 5079 return t && t.parentNode && t.parentNode.selectedIndex, null; 5080 }, 5081 set: function(e) { 5082 var t = e.parentNode; 5083 t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex); 5084 } 5085 }), S.each([ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { 5086 S.propFix[this.toLowerCase()] = this; 5087 }), S.fn.extend({ 5088 addClass: function(t) { 5089 var e, n, r, i, o, a, s, u = 0; 5090 if (m(t)) return this.each(function(e) { 5091 S(this).addClass(t.call(this, e, yt(this))); 5092 }); 5093 if ((e = mt(t)).length) for (;n = this[u++]; ) if (i = yt(n), r = 1 === n.nodeType && " " + vt(i) + " ") { 5094 for (a = 0; o = e[a++]; ) r.indexOf(" " + o + " ") < 0 && (r += o + " "); 5095 i !== (s = vt(r)) && n.setAttribute("class", s); 5096 } 5097 return this; 5098 }, 5099 removeClass: function(t) { 5100 var e, n, r, i, o, a, s, u = 0; 5101 if (m(t)) return this.each(function(e) { 5102 S(this).removeClass(t.call(this, e, yt(this))); 5103 }); 5104 if (!arguments.length) return this.attr("class", ""); 5105 if ((e = mt(t)).length) for (;n = this[u++]; ) if (i = yt(n), r = 1 === n.nodeType && " " + vt(i) + " ") { 5106 for (a = 0; o = e[a++]; ) for (;-1 < r.indexOf(" " + o + " "); ) r = r.replace(" " + o + " ", " "); 5107 i !== (s = vt(r)) && n.setAttribute("class", s); 5108 } 5109 return this; 5110 }, 5111 toggleClass: function(i, t) { 5112 var o = _typeof(i), a = "string" === o || Array.isArray(i); 5113 return "boolean" == typeof t && a ? t ? this.addClass(i) : this.removeClass(i) : m(i) ? this.each(function(e) { 5114 S(this).toggleClass(i.call(this, e, yt(this), t), t); 5115 }) : this.each(function() { 5116 var e, t, n, r; 5117 if (a) for (t = 0, n = S(this), r = mt(i); e = r[t++]; ) n.hasClass(e) ? n.removeClass(e) : n.addClass(e); else void 0 !== i && "boolean" !== o || ((e = yt(this)) && Y.set(this, "__className__", e), 5118 this.setAttribute && this.setAttribute("class", e || !1 === i ? "" : Y.get(this, "__className__") || "")); 5119 }); 5120 }, 5121 hasClass: function(e) { 5122 var t, n, r = 0; 5123 for (t = " " + e + " "; n = this[r++]; ) if (1 === n.nodeType && -1 < (" " + vt(yt(n)) + " ").indexOf(t)) return !0; 5124 return !1; 5125 } 5126 }); 5127 var xt = /\r/g; 5128 S.fn.extend({ 5129 val: function(n) { 5130 var r, e, i, t = this[0]; 5131 return arguments.length ? (i = m(n), this.each(function(e) { 5132 var t; 5133 1 === this.nodeType && (null == (t = i ? n.call(this, e, S(this).val()) : n) ? t = "" : "number" == typeof t ? t += "" : Array.isArray(t) && (t = S.map(t, function(e) { 5134 return null == e ? "" : e + ""; 5135 })), (r = S.valHooks[this.type] || S.valHooks[this.nodeName.toLowerCase()]) && "set" in r && void 0 !== r.set(this, t, "value") || (this.value = t)); 5136 })) : t ? (r = S.valHooks[t.type] || S.valHooks[t.nodeName.toLowerCase()]) && "get" in r && void 0 !== (e = r.get(t, "value")) ? e : "string" == typeof (e = t.value) ? e.replace(xt, "") : null == e ? "" : e : void 0; 5137 } 5138 }), S.extend({ 5139 valHooks: { 5140 option: { 5141 get: function(e) { 5142 var t = S.find.attr(e, "value"); 5143 return null != t ? t : vt(S.text(e)); 5144 } 5145 }, 5146 select: { 5147 get: function(e) { 5148 var t, n, r, i = e.options, o = e.selectedIndex, a = "select-one" === e.type, s = a ? null : [], u = a ? o + 1 : i.length; 5149 for (r = o < 0 ? u : a ? o : 0; r < u; r++) if (((n = i[r]).selected || r === o) && !n.disabled && (!n.parentNode.disabled || !A(n.parentNode, "optgroup"))) { 5150 if (t = S(n).val(), a) return t; 5151 s.push(t); 5152 } 5153 return s; 5154 }, 5155 set: function(e, t) { 5156 for (var n, r, i = e.options, o = S.makeArray(t), a = i.length; a--; ) ((r = i[a]).selected = -1 < S.inArray(S.valHooks.option.get(r), o)) && (n = !0); 5157 return n || (e.selectedIndex = -1), o; 5158 } 5159 } 5160 } 5161 }), S.each([ "radio", "checkbox" ], function() { 5162 S.valHooks[this] = { 5163 set: function(e, t) { 5164 if (Array.isArray(t)) return e.checked = -1 < S.inArray(S(e).val(), t); 5165 } 5166 }, y.checkOn || (S.valHooks[this].get = function(e) { 5167 return null === e.getAttribute("value") ? "on" : e.value; 5168 }); 5169 }), y.focusin = "onfocusin" in C; 5170 var bt = /^(?:focusinfocus|focusoutblur)$/, wt = function(e) { 5171 e.stopPropagation(); 5172 }; 5173 S.extend(S.event, { 5174 trigger: function(e, t, n, r) { 5175 var i, o, a, s, u, l, c, f, p = [ n || E ], d = v.call(e, "type") ? e.type : e, h = v.call(e, "namespace") ? e.namespace.split(".") : []; 5176 if (o = f = a = n = n || E, 3 !== n.nodeType && 8 !== n.nodeType && !bt.test(d + S.event.triggered) && (-1 < d.indexOf(".") && (d = (h = d.split(".")).shift(), 5177 h.sort()), u = d.indexOf(":") < 0 && "on"
vendor: 14,032 bytes, lines 5177-5402
5177+ d, (e = e[S.expando] ? e : new S.Event(d, "object" == _typeof(e) && e)).isTrigger = r ? 2 : 3, 5178 e.namespace = h.join("."), e.rnamespace = e.namespace ? new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, 5179 e.result = void 0, e.target || (e.target = n), t = null == t ? [ e ] : S.makeArray(t, [ e ]), 5180 c = S.event.special[d] || {}, r || !c.trigger || !1 !== c.trigger.apply(n, t))) { 5181 if (!r && !c.noBubble && !x(n)) { 5182 for (s = c.delegateType || d, bt.test(s + d) || (o = o.parentNode); o; o = o.parentNode) p.push(o), 5183 a = o; 5184 a === (n.ownerDocument || E) && p.push(a.defaultView || a.parentWindow || C); 5185 } 5186 for (i = 0; (o = p[i++]) && !e.isPropagationStopped(); ) f = o, e.type = 1 < i ? s : c.bindType || d, 5187 (l = (Y.get(o, "events") || Object.create(null))[e.type] && Y.get(o, "handle")) && l.apply(o, t), 5188 (l = u && o[u]) && l.apply && V(o) && (e.result = l.apply(o, t), !1 === e.result && e.preventDefault()); 5189 return e.type = d, r || e.isDefaultPrevented() || c._default && !1 !== c._default.apply(p.pop(), t) || !V(n) || u && m(n[d]) && !x(n) && ((a = n[u]) && (n[u] = null), 5190 S.event.triggered = d, e.isPropagationStopped() && f.addEventListener(d, wt), n[d](), 5191 e.isPropagationStopped() && f.removeEventListener(d, wt), S.event.triggered = void 0, 5192 a && (n[u] = a)), e.result; 5193 } 5194 }, 5195 simulate: function(e, t, n) { 5196 var r = S.extend(new S.Event(), n, { 5197 type: e, 5198 isSimulated: !0 5199 }); 5200 S.event.trigger(r, null, t); 5201 } 5202 }), S.fn.extend({ 5203 trigger: function(e, t) { 5204 return this.each(function() { 5205 S.event.trigger(e, t, this); 5206 }); 5207 }, 5208 triggerHandler: function(e, t) { 5209 var n = this[0]; 5210 if (n) return S.event.trigger(e, t, n, !0); 5211 } 5212 }), y.focusin || S.each({ 5213 focus: "focusin", 5214 blur: "focusout" 5215 }, function(n, r) { 5216 var i = function(e) { 5217 S.event.simulate(r, e.target, S.event.fix(e)); 5218 }; 5219 S.event.special[r] = { 5220 setup: function() { 5221 var e = this.ownerDocument || this.document || this, t = Y.access(e, r); 5222 t || e.addEventListener(n, i, !0), Y.access(e, r, (t || 0) + 1); 5223 }, 5224 teardown: function() { 5225 var e = this.ownerDocument || this.document || this, t = Y.access(e, r) - 1; 5226 t ? Y.access(e, r, t) : (e.removeEventListener(n, i, !0), Y.remove(e, r)); 5227 } 5228 }; 5229 }); 5230 var Tt = C.location, Ct = { 5231 guid: Date.now() 5232 }, Et = /\?/; 5233 S.parseXML = function(e) { 5234 var t; 5235 if (!e || "string" != typeof e) return null; 5236 try { 5237 t = new C.DOMParser().parseFromString(e, "text/xml"); 5238 } catch (e) { 5239 t = void 0; 5240 } 5241 return t && !t.getElementsByTagName("parsererror").length || S.error("Invalid XML: " + e), 5242 t; 5243 }; 5244 var St = /\[\]$/, kt = /\r?\n/g, At = /^(?:submit|button|image|reset|file)$/i, Nt = /^(?:input|select|textarea|keygen)/i; 5245 function Dt(n, e, r, i) { 5246 var t; 5247 if (Array.isArray(e)) S.each(e, function(e, t) { 5248 r || St.test(n) ? i(n, t) : Dt(n + "[" + ("object" == _typeof(t) && null != t ? e : "") + "]", t, r, i); 5249 }); else if (r || "object" !== w(e)) i(n, e); else for (t in e) Dt(n + "[" + t + "]", e[t], r, i); 5250 } 5251 S.param = function(e, t) { 5252 var n, r = [], i = function(e, t) { 5253 var n = m(t) ? t() : t; 5254 r[r.length] = encodeURIComponent(e) + "=" + encodeURIComponent(null == n ? "" : n); 5255 }; 5256 if (null == e) return ""; 5257 if (Array.isArray(e) || e.jquery && !S.isPlainObject(e)) S.each(e, function() { 5258 i(this.name, this.value); 5259 }); else for (n in e) Dt(n, e[n], t, i); 5260 return r.join("&"); 5261 }, S.fn.extend({ 5262 serialize: function() { 5263 return S.param(this.serializeArray()); 5264 }, 5265 serializeArray: function() { 5266 return this.map(function() { 5267 var e = S.prop(this, "elements"); 5268 return e ? S.makeArray(e) : this; 5269 }).filter(function() { 5270 var e = this.type; 5271 return this.name && !S(this).is(":disabled") && Nt.test(this.nodeName) && !At.test(e) && (this.checked || !pe.test(e)); 5272 }).map(function(e, t) { 5273 var n = S(this).val(); 5274 return null == n ? null : Array.isArray(n) ? S.map(n, function(e) { 5275 return { 5276 name: t.name, 5277 value: e.replace(kt, "\r\n") 5278 }; 5279 }) : { 5280 name: t.name, 5281 value: n.replace(kt, "\r\n") 5282 }; 5283 }).get(); 5284 } 5285 }); 5286 var jt = /%20/g, qt = /#.*$/, Lt = /([?&])_=[^&]*/, Ht = /^(.*?):[ \t]*([^\r\n]*)$/gm, Ot = /^(?:GET|HEAD)$/, Pt = /^\/\//, Rt = {}, Mt = {}, It = "*/".concat("*"), Wt = E.createElement("a"); 5287 function Ft(o) { 5288 return function(e, t) { 5289 "string" != typeof e && (t = e, e = "*"); 5290 var n, r = 0, i = e.toLowerCase().match(P) || []; 5291 if (m(t)) for (;n = i[r++]; ) "+" === n[0] ? (n = n.slice(1) || "*", (o[n] = o[n] || []).unshift(t)) : (o[n] = o[n] || []).push(t); 5292 }; 5293 } 5294 function Bt(t, i, o, a) { 5295 var s = {}, u = t === Mt; 5296 function l(e) { 5297 var r; 5298 return s[e] = !0, S.each(t[e] || [], function(e, t) { 5299 var n = t(i, o, a); 5300 return "string" != typeof n || u || s[n] ? u ? !(r = n) : void 0 : (i.dataTypes.unshift(n), 5301 l(n), !1); 5302 }), r; 5303 } 5304 return l(i.dataTypes[0]) || !s["*"] && l("*"); 5305 } 5306 function $t(e, t) { 5307 var n, r, i = S.ajaxSettings.flatOptions || {}; 5308 for (n in t) void 0 !== t[n] && ((i[n] ? e : r = r || {})[n] = t[n]); 5309 return r && S.extend(!0, e, r), e; 5310 } 5311 Wt.href = Tt.href, S.extend({ 5312 active: 0, 5313 lastModified: {}, 5314 etag: {}, 5315 ajaxSettings: { 5316 url: Tt.href, 5317 type: "GET", 5318 isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol), 5319 global: !0, 5320 processData: !0, 5321 async: !0, 5322 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 5323 accepts: { 5324 "*": It, 5325 text: "text/plain", 5326 html: "text/html", 5327 xml: "application/xml, text/xml", 5328 json: "application/json, text/javascript" 5329 }, 5330 contents: { 5331 xml: /\bxml\b/, 5332 html: /\bhtml/, 5333 json: /\bjson\b/ 5334 }, 5335 responseFields: { 5336 xml: "responseXML", 5337 text: "responseText", 5338 json: "responseJSON" 5339 }, 5340 converters: { 5341 "* text": String, 5342 "text html": !0, 5343 "text json": JSON.parse, 5344 "text xml": S.parseXML 5345 }, 5346 flatOptions: { 5347 url: !0, 5348 context: !0 5349 } 5350 }, 5351 ajaxSetup: function(e, t) { 5352 return t ? $t($t(e, S.ajaxSettings), t) : $t(S.ajaxSettings, e); 5353 }, 5354 ajaxPrefilter: Ft(Rt), 5355 ajaxTransport: Ft(Mt), 5356 ajax: function(e, t) { 5357 "object" == _typeof(e) && (t = e, e = void 0), t = t || {}; 5358 var c, f, p, n, d, r, h, g, i, o, v = S.ajaxSetup({}, t), y = v.context || v, m = v.context && (y.nodeType || y.jquery) ? S(y) : S.event, x = S.Deferred(), b = S.Callbacks("once memory"), w = v.statusCode || {}, a = {}, s = {}, u = "canceled", T = { 5359 readyState: 0, 5360 getResponseHeader: function(e) { 5361 var t; 5362 if (h) { 5363 if (!n) for (n = {}; t = Ht.exec(p); ) n[t[1].toLowerCase() + " "] = (n[t[1].toLowerCase() + " "] || []).concat(t[2]); 5364 t = n[e.toLowerCase() + " "]; 5365 } 5366 return null == t ? null : t.join(", "); 5367 }, 5368 getAllResponseHeaders: function() { 5369 return h ? p : null; 5370 }, 5371 setRequestHeader: function(e, t) { 5372 return null == h && (e = s[e.toLowerCase()] = s[e.toLowerCase()] || e, a[e] = t), 5373 this; 5374 }, 5375 overrideMimeType: function(e) { 5376 return null == h && (v.mimeType = e), this; 5377 }, 5378 statusCode: function(e) { 5379 var t; 5380 if (e) if (h) T.always(e[T.status]); else for (t in e) w[t] = [ w[t], e[t] ]; 5381 return this; 5382 }, 5383 abort: function(e) { 5384 var t = e || u; 5385 return c && c.abort(t), l(0, t), this; 5386 } 5387 }; 5388 if (x.promise(T), v.url = ((e || v.url || Tt.href) + "").replace(Pt, Tt.protocol + "//"), 5389 v.type = t.method || t.type || v.method || v.type, v.dataTypes = (v.dataType || "*").toLowerCase().match(P) || [ "" ], 5390 null == v.crossDomain) { 5391 r = E.createElement("a"); 5392 try { 5393 r.href = v.url, r.href = r.href, v.crossDomain = Wt.protocol + "//" + Wt.host != r.protocol + "//" + r.host; 5394 } catch (e) { 5395 v.crossDomain = !0; 5396 } 5397 } 5398 if (v.data && v.processData && "string" != typeof v.data && (v.data = S.param(v.data, v.traditional)), 5399 Bt(Rt, v, t, T), h) return T; 5400 for (i in (g = S.event && v.global) && 0 == S.active++ && S.event.trigger("ajaxStart"), 5401 v.type = v.type.toUpperCase(), v.hasContent = !Ot.test(v.type), f = v.url.replace(qt, ""), 5402 v.hasContent ? v.data && v.processData && 0 === (v.contentType || "").indexOf("application/x-www-form-urlencoded") && (v.data = v.data.replace(jt, "+")) : (o = v.url.
vendor: 14,281 bytes, lines 5402-5621
5402slice(f.length), 5403 v.data && (v.processData || "string" == typeof v.data) && (f += (Et.test(f) ? "&" : "?") + v.data, 5404 delete v.data), !1 === v.cache && (f = f.replace(Lt, "$1"), o = (Et.test(f) ? "&" : "?") + "_=" + Ct.guid++ + o), 5405 v.url = f + o), v.ifModified && (S.lastModified[f] && T.setRequestHeader("If-Modified-Since", S.lastModified[f]), 5406 S.etag[f] && T.setRequestHeader("If-None-Match", S.etag[f])), (v.data && v.hasContent && !1 !== v.contentType || t.contentType) && T.setRequestHeader("Content-Type", v.contentType), 5407 T.setRequestHeader("Accept", v.dataTypes[0] && v.accepts[v.dataTypes[0]] ? v.accepts[v.dataTypes[0]] + ("*" !== v.dataTypes[0] ? ", " + It + "; q=0.01" : "") : v.accepts["*"]), 5408 v.headers) T.setRequestHeader(i, v.headers[i]); 5409 if (v.beforeSend && (!1 === v.beforeSend.call(y, T, v) || h)) return T.abort(); 5410 if (u = "abort", b.add(v.complete), T.done(v.success), T.fail(v.error), c = Bt(Mt, v, t, T)) { 5411 if (T.readyState = 1, g && m.trigger("ajaxSend", [ T, v ]), h) return T; 5412 v.async && 0 < v.timeout && (d = C.setTimeout(function() { 5413 T.abort("timeout"); 5414 }, v.timeout)); 5415 try { 5416 h = !1, c.send(a, l); 5417 } catch (e) { 5418 if (h) throw e; 5419 l(-1, e); 5420 } 5421 } else l(-1, "No Transport"); 5422 function l(e, t, n, r) { 5423 var i, o, a, s, u, l = t; 5424 h || (h = !0, d && C.clearTimeout(d), c = void 0, p = r || "", T.readyState = 0 < e ? 4 : 0, 5425 i = 200 <= e && e < 300 || 304 === e, n && (s = function(e, t, n) { 5426 for (var r, i, o, a, s = e.contents, u = e.dataTypes; "*" === u[0]; ) u.shift(), 5427 void 0 === r && (r = e.mimeType || t.getResponseHeader("Content-Type")); 5428 if (r) for (i in s) if (s[i] && s[i].test(r)) { 5429 u.unshift(i); 5430 break; 5431 } 5432 if (u[0] in n) o = u[0]; else { 5433 for (i in n) { 5434 if (!u[0] || e.converters[i + " " + u[0]]) { 5435 o = i; 5436 break; 5437 } 5438 a = a || i; 5439 } 5440 o = o || a; 5441 } 5442 if (o) return o !== u[0] && u.unshift(o), n[o]; 5443 }(v, T, n)), !i && -1 < S.inArray("script", v.dataTypes) && (v.converters["text script"] = function() {}), 5444 s = function(e, t, n, r) { 5445 var i, o, a, s, u, l = {}, c = e.dataTypes.slice(); 5446 if (c[1]) for (a in e.converters) l[a.toLowerCase()] = e.converters[a]; 5447 for (o = c.shift(); o; ) if (e.responseFields[o] && (n[e.responseFields[o]] = t), 5448 !u && r && e.dataFilter && (t = e.dataFilter(t, e.dataType)), u = o, o = c.shift()) if ("*" === o) o = u; else if ("*" !== u && u !== o) { 5449 if (!(a = l[u + " " + o] || l["* " + o])) for (i in l) if ((s = i.split(" "))[1] === o && (a = l[u + " " + s[0]] || l["* " + s[0]])) { 5450 !0 === a ? a = l[i] : !0 !== l[i] && (o = s[0], c.unshift(s[1])); 5451 break; 5452 } 5453 if (!0 !== a) if (a && e.throws) t = a(t); else try { 5454 t = a(t); 5455 } catch (e) { 5456 return { 5457 state: "parsererror", 5458 error: a ? e : "No conversion from " + u + " to " + o 5459 }; 5460 } 5461 } 5462 return { 5463 state: "success", 5464 data: t 5465 }; 5466 }(v, s, T, i), i ? (v.ifModified && ((u = T.getResponseHeader("Last-Modified")) && (S.lastModified[f] = u), 5467 (u = T.getResponseHeader("etag")) && (S.etag[f] = u)), 204 === e || "HEAD" === v.type ? l = "nocontent" : 304 === e ? l = "notmodified" : (l = s.state, 5468 o = s.data, i = !(a = s.error))) : (a = l, !e && l || (l = "error", e < 0 && (e = 0))), 5469 T.status = e, T.statusText = (t || l) + "", i ? x.resolveWith(y, [ o, l, T ]) : x.rejectWith(y, [ T, l, a ]), 5470 T.statusCode(w), w = void 0, g && m.trigger(i ? "ajaxSuccess" : "ajaxError", [ T, v, i ? o : a ]), 5471 b.fireWith(y, [ T, l ]), g && (m.trigger("ajaxComplete", [ T, v ]), --S.active || S.event.trigger("ajaxStop"))); 5472 } 5473 return T; 5474 }, 5475 getJSON: function(e, t, n) { 5476 return S.get(e, t, n, "json"); 5477 }, 5478 getScript: function(e, t) { 5479 return S.get(e, void 0, t, "script"); 5480 } 5481 }), S.each([ "get", "post" ], function(e, i) { 5482 S[i] = function(e, t, n, r) { 5483 return m(t) && (r = r || n, n = t, t = void 0), S.ajax(S.extend({ 5484 url: e, 5485 type: i, 5486 dataType: r, 5487 data: t, 5488 success: n 5489 }, S.isPlainObject(e) && e)); 5490 }; 5491 }), S.ajaxPrefilter(function(e) { 5492 var t; 5493 for (t in e.headers) "content-type" === t.toLowerCase() && (e.contentType = e.headers[t] || ""); 5494 }), S._evalUrl = function(e, t, n) { 5495 return S.ajax({ 5496 url: e, 5497 type: "GET", 5498 dataType: "script", 5499 cache: !0, 5500 async: !1, 5501 global: !1, 5502 converters: { 5503 "text script": function() {} 5504 }, 5505 dataFilter: function(e) { 5506 S.globalEval(e, t, n); 5507 } 5508 }); 5509 }, S.fn.extend({ 5510 wrapAll: function(e) { 5511 var t; 5512 return this[0] && (m(e) && (e = e.call(this[0])), t = S(e, this[0].ownerDocument).eq(0).clone(!0), 5513 this[0].parentNode && t.insertBefore(this[0]), t.map(function() { 5514 for (var e = this; e.firstElementChild; ) e = e.firstElementChild; 5515 return e; 5516 }).append(this)), this; 5517 }, 5518 wrapInner: function(n) { 5519 return m(n) ? this.each(function(e) { 5520 S(this).wrapInner(n.call(this, e)); 5521 }) : this.each(function() { 5522 var e = S(this), t = e.contents(); 5523 t.length ? t.wrapAll(n) : e.append(n); 5524 }); 5525 }, 5526 wrap: function(t) { 5527 var n = m(t); 5528 return this.each(function(e) { 5529 S(this).wrapAll(n ? t.call(this, e) : t); 5530 }); 5531 }, 5532 unwrap: function(e) { 5533 return this.parent(e).not("body").each(function() { 5534 S(this).replaceWith(this.childNodes); 5535 }), this; 5536 } 5537 }), S.expr.pseudos.hidden = function(e) { 5538 return !S.expr.pseudos.visible(e); 5539 }, S.expr.pseudos.visible = function(e) { 5540 return !!(e.offsetWidth || e.offsetHeight || e.getClientRects().length); 5541 }, S.ajaxSettings.xhr = function() { 5542 try { 5543 return new C.XMLHttpRequest(); 5544 } catch (e) {} 5545 }; 5546 var _t = { 5547 0: 200, 5548 1223: 204 5549 }, zt = S.ajaxSettings.xhr(); 5550 y.cors = !!zt && "withCredentials" in zt, y.ajax = zt = !!zt, S.ajaxTransport(function(i) { 5551 var _o, a; 5552 if (y.cors || zt && !i.crossDomain) return { 5553 send: function(e, t) { 5554 var n, r = i.xhr(); 5555 if (r.open(i.type, i.url, i.async, i.username, i.password), i.xhrFields) for (n in i.xhrFields) r[n] = i.xhrFields[n]; 5556 for (n in i.mimeType && r.overrideMimeType && r.overrideMimeType(i.mimeType), i.crossDomain || e["X-Requested-With"] || (e["X-Requested-With"] = "XMLHttpRequest"), 5557 e) r.setRequestHeader(n, e[n]); 5558 _o = function(e) { 5559 return function() { 5560 _o && (_o = a = r.onload = r.onerror = r.onabort = r.ontimeout = r.onreadystatechange = null, 5561 "abort" === e ? r.abort() : "error" === e ? "number" != typeof r.status ? t(0, "error") : t(r.status, r.statusText) : t(_t[r.status] || r.status, r.statusText, "text" !== (r.responseType || "text") || "string" != typeof r.responseText ? { 5562 binary: r.response 5563 } : { 5564 text: r.responseText 5565 }, r.getAllResponseHeaders())); 5566 }; 5567 }, r.onload = _o(), a = r.onerror = r.ontimeout = _o("error"), void 0 !== r.onabort ? r.onabort = a : r.onreadystatechange = function() { 5568 4 === r.readyState && C.setTimeout(function() { 5569 _o && a(); 5570 }); 5571 }, _o = _o("abort"); 5572 try { 5573 r.send(i.hasContent && i.data || null); 5574 } catch (e) { 5575 if (_o) throw e; 5576 } 5577 }, 5578 abort: function() { 5579 _o && _o(); 5580 } 5581 }; 5582 }), S.ajaxPrefilter(function(e) { 5583 e.crossDomain && (e.contents.script = !1); 5584 }), S.ajaxSetup({ 5585 accepts: { 5586 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" 5587 }, 5588 contents: { 5589 script: /\b(?:java|ecma)script\b/ 5590 }, 5591 converters: { 5592 "text script": function(e) { 5593 return S.globalEval(e), e; 5594 } 5595 } 5596 }), S.ajaxPrefilter("script", function(e) { 5597 void 0 === e.cache && (e.cache = !1), e.crossDomain && (e.type = "GET"); 5598 }), S.ajaxTransport("script", function(n) { 5599 var r, _i; 5600 if (n.crossDomain || n.scriptAttrs) return { 5601 send: function(e, t) { 5602 r = S("<script>").attr(n.scriptAttrs || {}).prop({ 5603 charset: n.scriptCharset, 5604 src: n.url 5605 }).on("load error", _i = function(e) { 5606 r.remove(), _i = null, e && t("error" === e.type ? 404 : 200, e.type); 5607 }), E.head.appendChild(r[0]); 5608 }, 5609 abort: function() { 5610 _i && _i(); 5611 } 5612 }; 5613 }); 5614 var Ut, Xt = [], Vt = /(=)\?(?=&|$)|\?\?/; 5615 S.ajaxSetup({ 5616 jsonp: "callback", 5617 jsonpCallback: function() { 5618 var e = Xt.pop() || S.expando + "_" + Ct.guid++; 5619 return this[e] = !0, e; 5620 } 5621 }), S.ajaxPrefilter("json jsonp", function(e, t, n) {
vendor: 5,599 bytes, lines 5622-5695
5622 var r, i, o, a = !1 !== e.jsonp && (Vt.test(e.url) ? "url" : "string" == typeof e.data && 0 === (e.contentType || "").indexOf("application/x-www-form-urlencoded") && Vt.test(e.data) && "data"); 5623 if (a || "jsonp" === e.dataTypes[0]) return r = e.jsonpCallback = m(e.jsonpCallback) ? e.jsonpCallback() : e.jsonpCallback, 5624 a ? e[a] = e[a].replace(Vt, "$1" + r) : !1 !== e.jsonp && (e.url += (Et.test(e.url) ? "&" : "?") + e.jsonp + "=" + r), 5625 e.converters["script json"] = function() { 5626 return o || S.error(r + " was not called"), o[0]; 5627 }, e.dataTypes[0] = "json", i = C[r], C[r] = function() { 5628 o = arguments; 5629 }, n.always(function() { 5630 void 0 === i ? S(C).removeProp(r) : C[r] = i, e[r] && (e.jsonpCallback = t.jsonpCallback, 5631 Xt.push(r)), o && m(i) && i(o[0]), o = i = void 0; 5632 }), "script"; 5633 }), y.createHTMLDocument = ((Ut = E.implementation.createHTMLDocument("").body).innerHTML = "<form></form><form></form>", 5634 2 === Ut.childNodes.length), S.parseHTML = function(e, t, n) { 5635 return "string" != typeof e ? [] : ("boolean" == typeof t && (n = t, t = !1), t || (y.createHTMLDocument ? ((r = (t = E.implementation.createHTMLDocument("")).createElement("base")).href = E.location.href, 5636 t.head.appendChild(r)) : t = E), o = !n && [], (i = N.exec(e)) ? [ t.createElement(i[1]) ] : (i = xe([ e ], t, o), 5637 o && o.length && S(o).remove(), S.merge([], i.childNodes))); 5638 var r, i, o; 5639 }, S.fn.load = function(e, t, n) { 5640 var r, i, o, a = this, s = e.indexOf(" "); 5641 return -1 < s && (r = vt(e.slice(s)), e = e.slice(0, s)), m(t) ? (n = t, t = void 0) : t && "object" == _typeof(t) && (i = "POST"), 5642 0 < a.length && S.ajax({ 5643 url: e, 5644 type: i || "GET", 5645 dataType: "html", 5646 data: t 5647 }).done(function(e) { 5648 o = arguments, a.html(r ? S("<div>").append(S.parseHTML(e)).find(r) : e); 5649 }).always(n && function(e, t) { 5650 a.each(function() { 5651 n.apply(this, o || [ e.responseText, t, e ]); 5652 }); 5653 }), this; 5654 }, S.expr.pseudos.animated = function(t) { 5655 return S.grep(S.timers, function(e) { 5656 return t === e.elem; 5657 }).length; 5658 }, S.offset = { 5659 setOffset: function(e, t, n) { 5660 var r, i, o, a, s, u, l = S.css(e, "position"), c = S(e), f = {}; 5661 "static" === l && (e.style.position = "relative"), s = c.offset(), o = S.css(e, "top"), 5662 u = S.css(e, "left"), i = ("absolute" === l || "fixed" === l) && -1 < (o + u).indexOf("auto") ? (a = (r = c.position()).top, 5663 r.left) : (a = parseFloat(o) || 0, parseFloat(u) || 0), m(t) && (t = t.call(e, n, S.extend({}, s))), 5664 null != t.top && (f.top = t.top - s.top + a), null != t.left && (f.left = t.left - s.left + i), 5665 "using" in t ? t.using.call(e, f) : ("number" == typeof f.top && (f.top += "px"), 5666 "number" == typeof f.left && (f.left += "px"), c.css(f)); 5667 } 5668 }, S.fn.extend({ 5669 offset: function(t) { 5670 if (arguments.length) return void 0 === t ? this : this.each(function(e) { 5671 S.offset.setOffset(this, t, e); 5672 }); 5673 var e, n, r = this[0]; 5674 return r ? r.getClientRects().length ? (e = r.getBoundingClientRect(), n = r.ownerDocument.defaultView, 5675 { 5676 top: e.top + n.pageYOffset, 5677 left: e.left + n.pageXOffset 5678 }) : { 5679 top: 0, 5680 left: 0 5681 } : void 0; 5682 }, 5683 position: function() { 5684 if (this[0]) { 5685 var e, t, n, r = this[0], i = { 5686 top: 0, 5687 left: 0 5688 }; 5689 if ("fixed" === S.css(r, "position")) t = r.getBoundingClientRect(); else { 5690 for (t = this.offset(), n = r.ownerDocument, e = r.offsetParent || n.documentElement; e && (e === n.body || e === n.documentElement) && "static" === S.css(e, "position"); ) e = e.parentNode; 5691 e && e !== r && 1 === e.nodeType && ((i = S(e).offset()).top += S.css(e, "borderTopWidth", !0), 5692 i.left += S.css(e, "borderLeftWidth", !0)); 5693 } 5694 return { 5695 top: t.top - i.top - S.css(r, "marginTop", !0),
5696 left: t.left - i.left - S.css(r, "marginLeft", !0) 5697 }; 5698 } 5699 }, 5700 offsetParent: function() { 5701 return this.map(function() { 5702 for (var e = this.offsetParent; e && "static" === S.css(e, "position"); ) e = e.offsetParent; 5703 return e || re; 5704 }); 5705 } 5706 }), S.each({ 5707 scrollLeft: "pageXOffset", 5708 scrollTop: "pageYOffset" 5709 }, function(t, i) { 5710 var o = "pageYOffset" === i; 5711 S.fn[t] = function(e) { 5712 return $(this, function(e, t, n) { 5713 var r; 5714 if (x(e) ? r = e : 9 === e.nodeType && (r = e.defaultView), void 0 === n) return r ? r[i] : e[t]; 5715 r ? r.scrollTo(o ? r.pageXOffset : n, o ? n : r.pageYOffset) : e[t] = n; 5716 }, t, e, arguments.length); 5717 }; 5718 }), S.each([ "top", "left" ], function(e, n) { 5719 S.cssHooks[n] = $e(y.pixelPosition, function(e, t) { 5720 if (t) return t = Be(e, n), Me.test(t) ? S(e).position()[n] + "px" : t; 5721 }); 5722 }), S.each({ 5723 Height: "height", 5724 Width: "width" 5725 }, function(a, s) { 5726 S.each({ 5727 padding: "inner" + a, 5728 content: s, 5729 "": "outer" + a 5730 }, function(r, o) { 5731 S.fn[o] = function(e, t) { 5732 var n = arguments.length && (r || "boolean" != typeof e), i = r || (!0 === e || !0 === t ? "margin" : "border"); 5733 return $(this, function(e, t, n) { 5734 var r; 5735 return x(e) ? 0 === o.indexOf("outer") ? e["inner" + a] : e.document.documentElement["client" + a] : 9 === e.nodeType ? (r = e.documentElement, 5736 Math.max(e.body["scroll" + a], r["scroll" + a], e.body["offset" + a], r["offset" + a], r["client" + a])) : void 0 === n ? S.css(e, t, i) : S.style(e, t, n, i); 5737 }, s, n ? e : void 0, n); 5738 }; 5739 }); 5740 }), S.each([ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function(e, t) { 5741 S.fn[t] = function(e) { 5742 return this.on(t, e); 5743 }; 5744 }), S.fn.extend({ 5745 bind: function(e, t, n) { 5746 return this.on(e, null, t, n); 5747 }, 5748 unbind: function(e, t) { 5749 return this.off(e, null, t); 5750 }, 5751 delegate: function(e, t, n, r) { 5752 return this.on(t, e, n, r); 5753 }, 5754 undelegate: function(e, t, n) { 5755 return 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", n); 5756 }, 5757 hover: function(e, t) { 5758 return this.mouseenter(e).mouseleave(t || e); 5759 } 5760 }), S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "), function(e, n) { 5761 S.fn[n] = function(e, t) { 5762 return 0 < arguments.length ? this.on(n, null, e, t) : this.trigger(n); 5763 }; 5764 }); 5765 var Gt = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; 5766 S.proxy = function(e, t) { 5767 var n, r, i; 5768 if ("string" == typeof t && (n = e[t], t = e, e = n), m(e)) return r = s.call(arguments, 2), 5769 (i = function() { 5770 return e.apply(t || this, r.concat(s.call(arguments))); 5771 }).guid = e.guid = e.guid || S.guid++, i; 5772 }, S.holdReady = function(e) { 5773 e ? S.readyWait++ : S.ready(!0); 5774 }, S.isArray = Array.isArray, S.parseJSON = JSON.parse, S.nodeName = A, S.isFunction = m,
5775 S.isWindow = x, S.camelCase = X, S.type = w, S.now = Date.now, S.isNumeric = function(e) { 5776 var t = S.type(e); 5777 return ("number" === t || "string" === t) && !isNaN(e - parseFloat(e)); 5778 }, S.trim = function(e) { 5779 return null == e ? "" : (e + "").replace(Gt, ""); 5780 }, "function" == typeof define && define.amd && define("jquery", [], function() { 5781 return S; 5782 }); 5783 var Yt = C.jQuery, Qt = C.$; 5784 return S.noConflict = function(e) { 5785 return C.$ === S && (C.$ = Qt), e && C.jQuery === S && (C.jQuery = Yt), S; 5786 }, void 0 === e && (C.jQuery = C.$ = S), S; 5787 }, "object" == _typeof(module) && "object" == _typeof(module.exports) ? module.exports = e.document ? t(e, !0) : function(e) { 5788 if (!e.document) throw new Error("jQuery requires a window with a document"); 5789 return t(e); 5790 } : t(e), browserify_shim__define__module__export__("undefined" != typeof $ ? $ : window.$); 5791 }).call(global, void 0, void 0, void 0, void 0, function(ex) { 5792 module.exports = ex; 5793 }); 5794 }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}); 5795 }, { 5796 "core-js/modules/es6.array.find": 239, 5797 "core-js/modules/es6.array.sort": 242, 5798 "core-js/modules/es6.date.to-string": 243, 5799 "core-js/modules/es6.function.name": 244, 5800 "core-js/modules/es6.object.to-string": 252, 5801 "core-js/modules/es6.regexp.constructor": 255, 5802 "core-js/modules/es6.regexp.match": 258, 5803 "core-js/modules/es6.regexp.replace": 259, 5804 "core-js/modules/es6.regexp.split": 261, 5805 "core-js/modules/es6.regexp.to-string": 262, 5806 "core-js/modules/es6.symbol": 268, 5807 "core-js/modules/es7.symbol.async-iterator": 273 5808 } ], 5809 21: [ function(require, module, exports) { 5810 "use strict"; 5811 function _typeof(obj) { 5812 return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { 5813 return typeof obj; 5814 } : function(obj) { 5815 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 5816 })(obj); 5817 } 5818 var factory; 5819 require("core-js/modules/es7.symbol.async-iterator"), require("core-js/modules/es6.symbol"), 5820 require("core-js/modules/es6.array.fill"), require("core-js/modules/es6.number.constructor"), 5821 require("core-js/modules/es6.typed.uint8-array"), require("core-js/modules/es6.array.sort"), 5822 require("core-js/modules/es6.function.name"), require("core-js/modules/es6.regexp.constructor"), 5823 require("core-js/modules/es6.math.trunc"), require("core-js/modules/es7.array.includes"), 5824 require("core-js/modules/es6.string.includes"), require("core-js/modules/es6.regexp.to-string"), 5825 require("core-js/modules/es6.date.to-string"), require("core-js/modules/es6.object.to-string"), 5826 require("core-js/modules/es6.regexp.split"), require("core-js/modules/es6.regexp.replace"), 5827 require("core-js/modules/es6.object.freeze"), factory = function(exports) { 5828 var freeze = Object.freeze; 5829 function extend(dest) { 5830 var i, j, len, src; 5831 for (j = 1, len = arguments.length; j < len; j++) for (i in src = arguments[j]) dest[i] = src[i]; 5832 return dest; 5833 } 5834 Object.freeze = function(obj) { 5835 return obj; 5836 }; 5837 var create = Object.create || function(proto) { 5838 return F.prototype = proto, new F(); 5839 }; 5840 function F() {} 5841 function bind(fn, obj) { 5842 var slice = Array.prototype.slice; 5843 if (fn.bind) return fn.bind.apply(fn, slice.call(arguments, 1)); 5844 var args = slice.call(arguments, 2); 5845 return function() { 5846 return fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments); 5847 }; 5848 } 5849 var lastId = 0; 5850 function stamp(obj) { 5851 return obj._leaflet_id = obj._leaflet_id || ++lastId, obj._leaflet_id; 5852 } 5853 function throttle(fn, time, context) { 5854 var lock, args, wrapperFn, later; 5855 return later = function() { 5856 lock = !1, args && (wrapperFn.apply(context, args
5856), args = !1); 5857 }, wrapperFn = function() { 5858 lock ? args = arguments : (fn.apply(context, arguments), setTimeout(later, time), 5859 lock = !0); 5860 }; 5861 } 5862 function wrapNum(x, range, includeMax) { 5863 var max = range[1], min = range[0], d = max - min; 5864 return x === max && includeMax ? x : ((x - min) % d + d) % d + min; 5865 } 5866 function falseFn() { 5867 return !1; 5868 } 5869 function formatNum(num, digits) { 5870 return digits = void 0 === digits ? 6 : digits, +(Math.round(num + "e+" + digits) + "e-" + digits); 5871 } 5872 function trim(str) { 5873 return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ""); 5874 } 5875 function splitWords(str) { 5876 return trim(str).split(/\s+/); 5877 } 5878 function setOptions(obj, options) { 5879 for (var i in obj.hasOwnProperty("options") || (obj.options = obj.options ? create(obj.options) : {}), 5880 options) obj.options[i] = options[i]; 5881 return obj.options; 5882 } 5883 function getParamString(obj, existingUrl, uppercase) { 5884 var params = []; 5885 for (var i in obj) params.push(encodeURIComponent(uppercase ? i.toUpperCase() : i) + "=" + encodeURIComponent(obj[i])); 5886 return (existingUrl && -1 !== existingUrl.indexOf("?") ? "&" : "?") + params.join("&"); 5887 } 5888 var templateRe = /\{ *([\w_-]+) *\}/g; 5889 function template(str, data) { 5890 return str.replace(templateRe, function(str, key) { 5891 var value = data[key]; 5892 if (void 0 === value) throw new Error("No value provided for variable " + str); 5893 return "function" == typeof value && (value = value(data)), value; 5894 }); 5895 } 5896 var isArray = Array.isArray || function(obj) { 5897 return "[object Array]" === Object.prototype.toString.call(obj); 5898 }; 5899 function indexOf(array, el) { 5900 for (var i = 0; i < array.length; i++) if (array[i] === el) return i; 5901 return -1; 5902 } 5903 var emptyImageUrl = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="; 5904 function getPrefixed(name) { 5905 return window["webkit" + name] || window["moz" + name] || window["ms" + name]; 5906 } 5907 var lastTime = 0; 5908 function timeoutDefer(fn) { 5909 var time = +new Date(), timeToCall = Math.max(0, 16 - (time - lastTime)); 5910 return lastTime = time + timeToCall, window.setTimeout(fn, timeToCall); 5911 } 5912 var requestFn = window.requestAnimationFrame || getPrefixed("RequestAnimationFrame") || timeoutDefer, cancelFn = window.cancelAnimationFrame || getPrefixed("CancelAnimationFrame") || getPrefixed("CancelRequestAnimationFrame") || function(id) { 5913 window.clearTimeout(id); 5914 }; 5915 function requestAnimFrame(fn, context, immediate) { 5916 if (!immediate || requestFn !== timeoutDefer) return requestFn.call(window, bind(fn, context)); 5917 fn.call(context); 5918 } 5919 function cancelAnimFrame(id) { 5920 id && cancelFn.call(window, id); 5921 } 5922 var Util = (Object.freeze || Object)({ 5923 freeze: freeze, 5924 extend: extend, 5925 create: create, 5926 bind: bind, 5927 lastId: lastId, 5928 stamp: stamp, 5929 throttle: throttle, 5930 wrapNum: wrapNum, 5931 falseFn: falseFn, 5932 formatNum: formatNum, 5933 trim: trim, 5934 splitWords: splitWords, 5935 setOptions: setOptions, 5936 getParamString: getParamString, 5937 template: template, 5938 isArray: isArray, 5939 indexOf: indexOf, 5940 emptyImageUrl: emptyImageUrl, 5941 requestFn: requestFn, 5942 cancelFn: cancelFn, 5943 requestAnimFrame: requestAnimFrame, 5944 cancelAnimFrame: cancelAnimFrame 5945 }); 5946 function Class() {} 5947 Class.extend = function(props) { 5948 var NewClass = function() { 5949 this.initialize && this.initialize.apply(this, arguments), this.callInitHooks(); 5950 }, parentProto = NewClass.__super__ = this.prototype, proto = create(parentProto); 5951 for (var i in (proto.constructor = NewClass).prototype = proto, this) this.hasOwnProperty(i) && "prototype" !== i && "__super__" !== i && (NewClass[i] = this[i]); 5952 return props.statics && (extend(NewClass, props.statics), delete props.statics), 5953 props.includes && (function(includes) { 5954 if ("undefined" == typeof L || !L || !L.Mixin) return; 5955 includes = isArray(includes) ? includes : [ includes ]; 5956 for (var i = 0; i < includes.length; i++) includes[i] === L.Mixin.Events && console.warn("Deprecated
5956include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.", new Error().stack); 5957 }(props.includes), extend.apply(null, [ proto ].concat(props.includes)), delete props.includes), 5958 proto.options && (props.options = extend(create(proto.options), props.options)), 5959 extend(proto, props), proto._initHooks = [], proto.callInitHooks = function() { 5960 if (!this._initHooksCalled) { 5961 parentProto.callInitHooks && parentProto.callInitHooks.call(this), this._initHooksCalled = !0; 5962 for (var i = 0, len = proto._initHooks.length; i < len; i++) proto._initHooks[i].call(this); 5963 } 5964 }, NewClass; 5965 }, Class.include = function(props) { 5966 return extend(this.prototype, props), this; 5967 }, Class.mergeOptions = function(options) { 5968 return extend(this.prototype.options, options), this; 5969 }, Class.addInitHook = function(fn) { 5970 var args = Array.prototype.slice.call(arguments, 1), init = "function" == typeof fn ? fn : function() { 5971 this[fn].apply(this, args); 5972 }; 5973 return this.prototype._initHooks = this.prototype._initHooks || [], this.prototype._initHooks.push(init), 5974 this; 5975 }; 5976 var Events = { 5977 on: function(types, fn, context) { 5978 if ("object" === _typeof(types)) for (var type in types) this._on(type, types[type], fn); else for (var i = 0, len = (types = splitWords(types)).length; i < len; i++) this._on(types[i], fn, context); 5979 return this; 5980 }, 5981 off: function(types, fn, context) { 5982 if (types) if ("object" === _typeof(types)) for (var type in types) this._off(type, types[type], fn); else for (var i = 0, len = (types = splitWords(types)).length; i < len; i++) this._off(types[i], fn, context); else delete this._events; 5983 return this; 5984 }, 5985 _on: function(type, fn, context) { 5986 this._events = this._events || {}; 5987 var typeListeners = this._events[type]; 5988 typeListeners || (typeListeners = [], this._events[type] = typeListeners), context === this && (context = void 0); 5989 for (var newListener = { 5990 fn: fn, 5991 ctx: context 5992 }, listeners = typeListeners, i = 0, len = listeners.length; i < len; i++) if (listeners[i].fn === fn && listeners[i].ctx === context) return; 5993 listeners.push(newListener); 5994 }, 5995 _off: function(type, fn, context) { 5996 var listeners, i, len; 5997 if (this._events && (listeners = this._events[type])) if (fn) { 5998 if (context === this && (context = void 0), listeners) for (i = 0, len = listeners.length; i < len; i++) { 5999 var l = listeners[i]; 6000 if (l.ctx === context && l.fn === fn) return l.fn = falseFn, this._firingCount && (this._events[type] = listeners = listeners.slice()), 6001 void listeners.splice(i, 1); 6002 } 6003 } else { 6004 for (i = 0, len = listeners.length; i < len; i++) listeners[i].fn = falseFn; 6005 delete this._events[type]; 6006 } 6007 }, 6008 fire: function(type, data, propagate) { 6009 if (!this.listens(type, propagate)) return this; 6010 var event = extend({}, data, { 6011 type: type, 6012 target: this, 6013 sourceTarget: data && data.sourceTarget || this 6014 }); 6015 if (this._events) { 6016 var listeners = this._events[type]; 6017 if (listeners) { 6018 this._firingCount = this._firingCount + 1 || 1; 6019 for (var i = 0, len = listeners.length; i < len; i++) { 6020 var l = listeners[i]; 6021 l.fn.call(l.ctx || this, event); 6022 } 6023 this._firingCount--; 6024 } 6025 } 6026 return propagate && this._propagateEvent(event), this; 6027 },
6028 listens: function(type, propagate) { 6029 var listeners = this._events && this._events[type]; 6030 if (listeners && listeners.length) return !0; 6031 if (propagate) for (var id in this._eventParents) if (this._eventParents[id].listens(type, propagate)) return !0; 6032 return !1; 6033 }, 6034 once: function(types, fn, context) { 6035 if ("object" === _typeof(types)) { 6036 for (var type in types) this.once(type, types[type], fn); 6037 return this; 6038 } 6039 var handler = bind(function() { 6040 this.off(types, fn, context).off(types, handler, context); 6041 }, this); 6042 return this.on(types, fn, context).on(types, handler, context); 6043 }, 6044 addEventParent: function(obj) { 6045 return this._eventParents = this._eventParents || {}, this._eventParents[stamp(obj)] = obj, 6046 this; 6047 }, 6048 removeEventParent: function(obj) { 6049 return this._eventParents && delete this._eventParents[stamp(obj)], this; 6050 }, 6051 _propagateEvent: function(e) { 6052 for (var id in this._eventParents) this._eventParents[id].fire(e.type, extend({ 6053 layer: e.target, 6054 propagatedFrom: e.target 6055 }, e), !0); 6056 } 6057 }; 6058 Events.addEventListener = Events.on, Events.removeEventListener = Events.clearAllEventListeners = Events.off, 6059 Events.addOneTimeEventListener = Events.once, Events.fireEvent = Events.fire, Events.hasEventListeners = Events.listens; 6060 var Evented = Class.extend(Events); 6061 function Point(x, y, round) { 6062 this.x = round ? Math.round(x) : x, this.y = round ? Math.round(y) : y; 6063 } 6064 var trunc = Math.trunc || function(v) { 6065 return 0 < v ? Math.floor(v) : Math.ceil(v); 6066 }; 6067 function toPoint(x, y, round) { 6068 return x instanceof Point ? x : isArray(x) ? new Point(x[0], x[1]) : null == x ? x : "object" === _typeof(x) && "x" in x && "y" in x ? new Point(x.x, x.y) : new Point(x, y, round); 6069 } 6070 function Bounds(a, b) { 6071 if (a) for (var points = b ? [ a, b ] : a, i = 0, len = points.length; i < len; i++) this.extend(points[i]); 6072 } 6073 function toBounds(a, b) { 6074 return !a || a instanceof Bounds ? a : new Bounds(a, b); 6075 } 6076 function LatLngBounds(corner1, corner2) { 6077 if (corner1) for (var latlngs = corner2 ? [ corner1, corner2 ] : corner1, i = 0, len = latlngs.length; i < len; i++) this.extend(latlngs[i]); 6078 } 6079 function toLatLngBounds(a, b) { 6080 return a instanceof LatLngBounds ? a : new LatLngBounds(a, b); 6081 } 6082 function LatLng(lat, lng, alt) { 6083 if (isNaN(lat) || isNaN(lng)) throw new Error("Invalid LatLng object: (" + lat + ", " + lng + ")"); 6084 this.lat = +lat, this.lng = +lng, void 0 !== alt && (this.alt = +alt); 6085 } 6086 function toLatLng(a, b, c) { 6087 return a instanceof LatLng ? a : isArray(a) && "object" !== _typeof(a[0]) ? 3 === a.length ? new LatLng(a[0], a[1], a[2]) : 2 === a.length ? new LatLng(a[0], a[1]) : null : null == a ? a : "object" === _typeof(a) && "lat" in a ? new LatLng(a.lat, "lng" in a ? a.lng : a.lon, a.alt) : void 0 === b ? null : new LatLng(a, b, c); 6088 } 6089 Point.prototype = { 6090 clone: function() { 6091 return new Point(this.x, this.y); 6092 }, 6093 add: function(point) { 6094 return this.clone()._add(toPoint(point)); 6095 }, 6096 _add: function(point) { 6097 return this.x += point.x, this.y += point.y, this; 6098 }, 6099 subtract: function(point) { 6100 return this.clone()._subtract(toPoint(point)); 6101 }, 6102 _subtract: function(point) { 6103 return this.x -= point.x, this.y -= point.y, this; 6104 }, 6105 divideBy: function(num) { 6106 return this.clone()._divideBy(num); 6107 }, 6108 _divideBy: function(num) { 6109 return this.x /= num, this.y /= num, this; 6110 }, 6111 multiplyBy: function(num) { 6112 return this.clone()._multiplyBy(num); 6113 }, 6114 _multiplyBy: function(num) { 6115 return this.x *= num, this.y *= num, this; 6116 }, 6117 scaleBy: function(point) { 6118 return new Point(this.x * point.x, this.y * point.y); 6119 }, 6120 unscaleBy: function(point) { 6121 return new Point(this.x / point.x, this.y / point.y); 6122 }, 6123 round: function() { 6124 return this.clone()._round(); 6125 }, 6126 _round: function() { 6127 return this.x = Math.round(this.x), this.y = Math.round(this.y), this; 6128 }, 6129 floor: function() { 6130 return this.clone()._floor(); 6131 }, 6132 _floor: function() { 6133 return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this; 6134 }, 6135 ceil: function() { 6136 return this.clone()._ceil(); 6137 }, 6138 _ceil: function() { 6139 return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this; 6140 }, 6141 trunc: function() { 6142 return this.clone()._trunc(); 6143 }, 6144 _trunc: function() { 6145 return this.x = trunc(this.x), this.y = trunc(this.y), this; 6146 }, 6147 distanceTo: function(point) { 6148 var x = (point = toPoint(point)).x - this.x, y = point.y - this.y; 6149 return Math.sqrt(x * x + y * y); 6150 }, 6151 equals: function(point) { 6152 return (point = toPoint(point)).x === this.x && point.y === this.y; 6153 }, 6154 contains: function(point) { 6155 return point = toPoint(point), Math.abs(point.x) <= Math.abs(this.x) && Math.abs(point.y) <= Math.abs(this.y); 6156 }, 6157 toString: function() {
6158 return "Point(" + formatNum(this.x) + ", " + formatNum(this.y) + ")"; 6159 } 6160 }, Bounds.prototype = { 6161 extend: function(point) { 6162 return point = toPoint(point), this.min || this.max ? (this.min.x = Math.min(point.x, this.min.x), 6163 this.max.x = Math.max(point.x, this.max.x), this.min.y = Math.min(point.y, this.min.y), 6164 this.max.y = Math.max(point.y, this.max.y)) : (this.min = point.clone(), this.max = point.clone()), 6165 this; 6166 }, 6167 getCenter: function(round) { 6168 return new Point((this.min.x + this.max.x) / 2, (this.min.y + this.max.y) / 2, round); 6169 }, 6170 getBottomLeft: function() { 6171 return new Point(this.min.x, this.max.y); 6172 }, 6173 getTopRight: function() { 6174 return new Point(this.max.x, this.min.y); 6175 }, 6176 getTopLeft: function() { 6177 return this.min; 6178 }, 6179 getBottomRight: function() { 6180 return this.max; 6181 }, 6182 getSize: function() { 6183 return this.max.subtract(this.min); 6184 }, 6185 contains: function(obj) { 6186 var min, max; 6187 return (obj = "number" == typeof obj[0] || obj instanceof Point ? toPoint(obj) : toBounds(obj)) instanceof Bounds ? (min = obj.min, 6188 max = obj.max) : min = max = obj, min.x >= this.min.x && max.x <= this.max.x && min.y >= this.min.y && max.y <= this.max.y; 6189 }, 6190 intersects: function(bounds) { 6191 bounds = toBounds(bounds); 6192 var min = this.min, max = this.max, min2 = bounds.min, max2 = bounds.max, xIntersects = max2.x >= min.x && min2.x <= max.x, yIntersects = max2.y >= min.y && min2.y <= max.y; 6193 return xIntersects && yIntersects; 6194 }, 6195 overlaps: function(bounds) { 6196 bounds = toBounds(bounds); 6197 var min = this.min, max = this.max, min2 = bounds.min, max2 = bounds.max, xOverlaps = max2.x > min.x && min2.x < max.x, yOverlaps = max2.y > min.y && min2.y < max.y; 6198 return xOverlaps && yOverlaps; 6199 }, 6200 isValid: function() { 6201 return !(!this.min || !this.max); 6202 } 6203 }, LatLngBounds.prototype = { 6204 extend: function(obj) { 6205 var sw2, ne2, sw = this._southWest, ne = this._northEast; 6206 if (obj instanceof LatLng) ne2 = sw2 = obj; else { 6207 if (!(obj instanceof LatLngBounds)) return obj ? this.extend(toLatLng(obj) || toLatLngBounds(obj)) : this; 6208 if (sw2 = obj._southWest, ne2 = obj._northEast, !sw2 || !ne2) return this; 6209 } 6210 return sw || ne ? (sw.lat = Math.min(sw2.lat, sw.lat), sw.lng = Math.min(sw2.lng, sw.lng), 6211 ne.lat = Math.max(ne2.lat, ne.lat), ne.lng = Math.max(ne2.lng, ne.lng)) : (this._southWest = new LatLng(sw2.lat, sw2.lng), 6212 this._northEast = new LatLng(ne2.lat, ne2.lng)), this; 6213 }, 6214 pad: function(bufferRatio) { 6215 var sw = this._southWest, ne = this._northEast, heightBuffer = Math.abs(sw.lat - ne.lat) * bufferRatio, widthBuffer = Math.abs(sw.lng - ne.lng) * bufferRatio; 6216 return new LatLngBounds(new LatLng(sw.lat - heightBuffer, sw.lng - widthBuffer), new LatLng(ne.lat + heightBuffer, ne.lng + widthBuffer)); 6217 }, 6218 getCenter: function() { 6219 return new LatLng((this._southWest.lat + this._northEast.lat) / 2, (this._southWest.lng + this._northEast.lng) / 2); 6220 }, 6221 getSouthWest: function() { 6222 return this._southWest; 6223 }, 6224 getNorthEast: function() { 6225 return this._northEast; 6226 }, 6227 getNorthWest: function() {
6228 return new LatLng(this.getNorth(), this.getWest()); 6229 }, 6230 getSouthEast: function() { 6231 return new LatLng(this.getSouth(), this.getEast()); 6232 }, 6233 getWest: function() { 6234 return this._southWest.lng; 6235 }, 6236 getSouth: function() { 6237 return this._southWest.lat; 6238 }, 6239 getEast: function() { 6240 return this._northEast.lng; 6241 }, 6242 getNorth: function() { 6243 return this._northEast.lat; 6244 }, 6245 contains: function(obj) { 6246 obj = "number" == typeof obj[0] || obj instanceof LatLng || "lat" in obj ? toLatLng(obj) : toLatLngBounds(obj); 6247 var sw2, ne2, sw = this._southWest, ne = this._northEast; 6248 return obj instanceof LatLngBounds ? (sw2 = obj.getSouthWest(), ne2 = obj.getNorthEast()) : sw2 = ne2 = obj, 6249 sw2.lat >= sw.lat && ne2.lat <= ne.lat && sw2.lng >= sw.lng && ne2.lng <= ne.lng; 6250 }, 6251 intersects: function(bounds) { 6252 bounds = toLatLngBounds(bounds); 6253 var sw = this._southWest, ne = this._northEast, sw2 = bounds.getSouthWest
6253(), ne2 = bounds.getNorthEast(), latIntersects = ne2.lat >= sw.lat && sw2.lat <= ne.lat, lngIntersects = ne2.lng >= sw.lng && sw2.lng <= ne.lng; 6254 return latIntersects && lngIntersects; 6255 }, 6256 overlaps: function(bounds) { 6257 bounds = toLatLngBounds(bounds); 6258 var sw = this._southWest, ne = this._northEast, sw2 = bounds.getSouthWest(), ne2 = bounds.getNorthEast(), latOverlaps = ne2.lat > sw.lat && sw2.lat < ne.lat, lngOverlaps = ne2.lng > sw.lng && sw2.lng < ne.lng; 6259 return latOverlaps && lngOverlaps; 6260 }, 6261 toBBoxString: function() { 6262 return [ this.getWest(), this.getSouth(), this.getEast(), this.getNorth() ].join(","); 6263 }, 6264 equals: function(bounds, maxMargin) { 6265 return !!bounds && (bounds = toLatLngBounds(bounds), this._southWest.equals(bounds.getSouthWest(), maxMargin) && this._northEast.equals(bounds.getNorthEast(), maxMargin)); 6266 }, 6267 isValid: function() { 6268 return !(!this._southWest || !this._northEast); 6269 } 6270 }; 6271 var d, CRS = { 6272 latLngToPoint: function(latlng, zoom) { 6273 var projectedPoint = this.projection.project(latlng), scale = this.scale(zoom); 6274 return this.transformation._transform(projectedPoint, scale); 6275 }, 6276 pointToLatLng: function(point, zoom) { 6277 var scale = this.scale(zoom), untransformedPoint = this.transformation.untransform(point, scale); 6278 return this.projection.unproject(untransformedPoint); 6279 }, 6280 project: function(latlng) { 6281 return this.projection.project(latlng); 6282 }, 6283 unproject: function(point) { 6284 return this.projection.unproject(point); 6285 }, 6286 scale: function(zoom) { 6287 return 256 * Math.pow(2, zoom); 6288 }, 6289 zoom: function(scale) { 6290 return Math.log(scale / 256) / Math.LN2; 6291 }, 6292 getProjectedBounds: function(zoom) { 6293 if (this.infinite) return null; 6294 var b = this.projection.bounds, s = this.scale(zoom); 6295 return new Bounds(this.transformation.transform(b.min, s), this.transformation.transform(b.max, s)); 6296 }, 6297 infinite: !(LatLng.prototype = { 6298 equals: function(obj, maxMargin) { 6299 return !!obj && (obj = toLatLng(obj), Math.max(Math.abs(this.lat - obj.lat), Math.abs(this.lng - obj.lng)) <= (void 0 === maxMargin ? 1e-9 : maxMargin)); 6300 }, 6301 toString: function(precision) { 6302 return "LatLng(" + formatNum(this.lat, precision) + ", " + formatNum(this.lng, precision) + ")"; 6303 }, 6304 distanceTo: function(other) { 6305 return Earth.distance(this, toLatLng(other)); 6306 }, 6307 wrap: function() { 6308 return Earth.wrapLatLng(this); 6309 }, 6310 toBounds: function(sizeInMeters) { 6311 var latAccuracy = 180 * sizeInMeters / 40075017, lngAccuracy = latAccuracy / Math.cos(Math.PI / 180 * this.lat); 6312 return toLatLngBounds([ this.lat - latAccuracy, this.lng - lngAccuracy ], [ this.lat + latAccuracy, this.lng + lngAccuracy ]); 6313 }, 6314 clone: function() { 6315 return new LatLng(this.lat, this.lng, this.alt); 6316 } 6317 }), 6318 wrapLatLng: function(latlng) { 6319 var lng = this.wrapLng ? wrapNum(latlng.lng, this.wrapLng, !0) : latlng.lng; 6320 return new LatLng(this.wrapLat ? wrapNum(latlng.lat, this.wrapLat, !0) : latlng.lat, lng, latlng.alt); 6321 },
6322 wrapLatLngBounds: function(bounds) { 6323 var center = bounds.getCenter(), newCenter = this.wrapLatLng(center), latShift = center.lat - newCenter.lat, lngShift = center.lng - newCenter.lng; 6324 if (0 == latShift && 0 == lngShift) return bounds; 6325 var sw = bounds.getSouthWest(), ne = bounds.getNorthEast(); 6326 return new LatLngBounds(new LatLng(sw.lat - latShift, sw.lng - lngShift), new LatLng(ne.lat - latShift, ne.lng - lngShift)); 6327 } 6328 }, Earth = extend({}, CRS, { 6329 wrapLng: [ -180, 180 ], 6330 R: 6371e3, 6331 distance: function(latlng1, latlng2) { 6332 var rad = Math.PI / 180, lat1 = latlng1.lat * rad, lat2 = latlng2.lat * rad, sinDLat = Math.sin((latlng2.lat - latlng1.lat) * rad / 2), sinDLon = Math.sin((latlng2.lng - latlng1.lng) * rad / 2), a = sinDLat * sinDLat + Math.cos(lat1) * Math.cos(lat2) * sinDLon * sinDLon, c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); 6333 return this.R * c; 6334 } 6335 }), SphericalMercator = { 6336 R: 6378137, 6337 MAX_LATITUDE: 85.0511287798, 6338 project: function(latlng) { 6339 var d = Math.PI / 180, max = this.MAX_LATITUDE, lat = Math.max(Math.min(max, latlng.lat), -max), sin = Math.sin(lat * d); 6340 return new Point(this.R * latlng.lng * d, this.R * Math.log((1 + sin) / (1 - sin)) / 2); 6341 }, 6342 unproject: function(point) { 6343 var d = 180 / Math.PI; 6344 return new LatLng((2 * Math.atan(Math.exp(point.y / this.R)) - Math.PI / 2) * d, point.x * d / this.R); 6345 }, 6346 bounds: (d = 6378137 * Math.PI, new Bounds([ -d, -d ], [ d, d ])) 6347 }; 6348 function Transformation(a, b, c, d) { 6349 if (isArray(a)) return this._a = a[0], this._b = a[1], this._c = a[2], void (this._d = a[3]); 6350 this._a = a, this._b = b, this._c = c, this._d = d; 6351 } 6352 function toTransformation(a, b, c, d) { 6353 return new Transformation(a, b, c, d); 6354 } 6355 Transformation.prototype = { 6356 transform: function(point, scale) { 6357 return this._transform(point.clone(), scale); 6358 }, 6359 _transform: function(point, scale) { 6360 return scale = scale || 1, point.x = scale * (this._a * point.x + this._b), point.y = scale * (this._c * point.y + this._d), 6361 point; 6362 }, 6363 untransform: function(point, scale) { 6364 return scale = scale || 1, new Point((point.x / scale - this._b) / this._a, (point.y / scale - this._d) / this._c); 6365 } 6366 }; 6367 var EPSG3857 = extend({}, Earth, { 6368 code: "EPSG:3857", 6369 projection: SphericalMercator, 6370 transformation: function() { 6371 var scale = .5 / (Math.PI * SphericalMercator.R); 6372 return toTransformation(scale, .5, -scale, .5); 6373 }() 6374 }), EPSG900913 = extend({}, EPSG3857, { 6375 code: "EPSG:900913" 6376 }); 6377 function svgCreate(name) { 6378 return document.createElementNS("http://www.w3.org/2000/svg", name); 6379 } 6380 function pointsToPath(rings, closed) { 6381 var i, j, len, len2, points, p, str = ""; 6382 for (i = 0, len = rings.length; i < len; i++) { 6383 for (j = 0, len2 = (points = rings[i]).length; j < len2; j++) str += (j ? "L" : "M") + (p = points[j]).x + " " + p.y; 6384 str += closed ? svg ? "z" : "x" : ""; 6385 } 6386 return str || "M0 0"; 6387 } 6388 var style$1 = document.documentElement.style, ie = "ActiveXObject" in window, ielt9 = ie && !document.addEventListener, edge = "msLaunchUri" in navigator && !("documentMode" in document), webkit = userAgentContains("webkit"), android = userAgentContains("android"), android23 = userAgentContains("android 2") || userAgentContains("android 3"), webkitVer = parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10), androidStock = android && userAgentContains("Google") && webkitVer < 537 && !("AudioNode" in window), opera = !!window.opera, chrome = userAgentContains("chrome"), gecko = userAgentContains("gecko") && !webkit && !opera && !ie, safari = !chrome && userAgentContains("safari"), phantom = userAgentContains("phantom"), opera12 = "OTransition" in style$1, win = 0 === navigator.platform.indexOf("Win"), ie3d = ie && "transition" in style$1, webkit3d = "WebKitCSSMatrix" in window && "m11" in new window.WebKitCSSMatrix() && !android23, gecko3d = "MozPerspective" in style$1, any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom, mobile = "undefined" != typeof orientation || userAgentContains("mobile"), mobileWebkit = mobile && webkit, mobileWebkit3d = mobile && webkit3d, msPointer = !window.PointerEvent && window.MSPointerEvent, pointer = !(!window.PointerEvent && !msPointer), touch = !window.L_NO_TOUCH && (pointer || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch), mobileOpera = mobile && opera, mobileGecko = mobile && gecko, retina = 1 < (window.devicePixelRatio || window.screen.deviceXDPI / window.screen.logicalXDPI), canvas = !!document.createElement("canvas").getContext, svg = !(!document.createElementNS || !svgCreate("svg").createSVGRect), vml = !svg && function() { 6389 try { 6390 var div = document.createElement("div");
6391 div.innerHTML = '<v:shape adj="1"/>'; 6392 var shape = div.firstChild; 6393 return shape.style.behavior = "url(#default#VML)", shape && "object" === _typeof(shape.adj); 6394 } catch (e) { 6395 return !1; 6396 } 6397 }(); 6398 function userAgentContains(str) { 6399 return 0 <= navigator.userAgent.toLowerCase().indexOf(str); 6400 } 6401 var Browser = (Object.freeze || Object)({ 6402 ie: ie, 6403 ielt9: ielt9, 6404 edge: edge, 6405 webkit: webkit, 6406 android: android, 6407 android23: android23, 6408 androidStock: androidStock, 6409 opera: opera, 6410 chrome: chrome, 6411 gecko: gecko, 6412 safari: safari, 6413 phantom: phantom, 6414 opera12: opera12, 6415 win: win, 6416 ie3d: ie3d, 6417 webkit3d: webkit3d, 6418 gecko3d: gecko3d, 6419 any3d: any3d, 6420 mobile: mobile, 6421 mobileWebkit: mobileWebkit, 6422 mobileWebkit3d: mobileWebkit3d, 6423 msPointer: msPointer, 6424 pointer: pointer, 6425 touch: touch, 6426 mobileOpera: mobileOpera, 6427 mobileGecko: mobileGecko, 6428 retina: retina, 6429 canvas: canvas, 6430 svg: svg, 6431 vml: vml 6432 }), POINTER_DOWN = msPointer ? "MSPointerDown" : "pointerdown", POINTER_MOVE = msPointer ? "MSPointerMove" : "pointermove", POINTER_UP = msPointer ? "MSPointerUp" : "pointerup", POINTER_CANCEL = msPointer ? "MSPointerCancel" : "pointercancel", TAG_WHITE_LIST = [ "INPUT", "SELECT", "OPTION" ], _pointers = {}, _pointerDocListener = !1, _pointersCount = 0; 6433 function addPointerListener(obj, type, handler, id) { 6434 return "touchstart" === type ? function(obj, handler, id) { 6435 var onDown = bind(function(e) { 6436 if ("mouse" !== e.pointerType && e.MSPOINTER_TYPE_MOUSE && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) { 6437 if (!(TAG_WHITE_LIST.indexOf(e.target.tagName) < 0)) return; 6438 preventDefault(e); 6439 } 6440 _handlePointer(e, handler); 6441 }); 6442 obj["_leaflet_touchstart" + id] = onDown, obj.addEventListener(POINTER_DOWN, onDown, !1), 6443 _pointerDocListener || (document.documentElement.addEventListener(POINTER_DOWN, _globalPointerDown, !0), 6444 document.documentElement.addEventListener(POINTER_MOVE, _globalPointerMove, !0), 6445 document.documentElement.addEventListener(POINTER_UP, _globalPointerUp, !0), document.documentElement.addEventListener(POINTER_CANCEL, _globalPointerUp, !0), 6446 _pointerDocListener = !0); 6447 }(obj, handler, id) : "touchmove" === type ? function(obj, handler, id) { 6448 var onMove = function(e) { 6449 (e.pointerType !== e.MSPOINTER_TYPE_MOUSE && "mouse" !== e.pointerType || 0 !== e.buttons) && _handlePointer(e, handler); 6450 }; 6451 obj["_leaflet_touchmove" + id] = onMove, obj.addEventListener(POINTER_MOVE, onMove, !1); 6452 }(obj, handler, id) : "touchend" === type && function(obj, handler, id) { 6453 var onUp = function(e) { 6454 _handlePointer(e, handler); 6455 }; 6456 obj["_leaflet_touchend" + id] = onUp, obj.addEventListener(POINTER_UP, onUp, !1), 6457 obj.addEventListener(POINTER_CANCEL, onUp, !1); 6458 }(obj, handler, id), this; 6459 } 6460 function _globalPointerDown(e) { 6461 _pointers[e.pointerId] = e, _pointersCount++; 6462 } 6463 function _globalPointerMove(e) { 6464 _pointers[e.pointerId] && (_pointers[e.pointerId] = e); 6465 } 6466 function _globalPointerUp(e) { 6467 delete _pointers[e.pointerId], _pointersCount--; 6468 } 6469 function _handlePointer(e, handler) { 6470 for (var i in e.touches = [], _pointers) e.touches.push(_pointers[i]); 6471 e.changedTouches = [ e ], handler(e); 6472 } 6473 var _touchstart = msPointer ? "MSPointerDown" : pointer ? "pointerdown" : "touchstart", _touchend = msPointer ? "MSPointerUp" : pointer ? "pointerup" : "touchend", _pre = "_leaflet_"; 6474 function addDoubleTapListener(obj, handler, id) { 6475 var last, touch$$1, doubleTap = !1; 6476 function onTouchStart(e) { 6477 var count; 6478 if (pointer) { 6479 if (!edge || "mouse" === e.pointerType) return; 6480 count = _pointersCount; 6481 } else count = e.touches.length; 6482 if (!(1 < count)) { 6483 var now = Date.now(), delta = now - (last || now); 6484 touch$$1 = e.touches ? e.touches[0] : e, doubleTap = 0 < delta && delta <= 250, 6485 last = now; 6486 } 6487 } 6488 function onTouchEnd(e) { 6489 if (doubleTap && !touch$$1.cancelBubble) { 6490 if (pointer) { 6491 if (!edge || "mouse" === e.pointerType) return; 6492 var prop, i, newTouch = {}; 6493 for (i in touch$$1) prop = touch$$1[i], newTouch[i] = prop && prop.bind ? prop.bind(touch$$1) : prop; 6494 touch$$1 = newTouch; 6495 } 6496 touch$$1.type = "dblclick", touch$$1.button = 0, handler(touch$$1), last = null; 6497 } 6498 } 6499 return obj[_pre + _touchstart + id] = onTouchStart, obj[_pre + _touchend + id] = onTouchEnd, 6500 obj[_pre + "dblclick" + id] = handler, obj.addEventListener(_touchstart, onTouchStart, !1), 6501 obj.addEventListener(_touchend, onTouchEnd, !1), obj.addEventListener("dblclick", handler, !1), 6502 this; 6503 } 6504 function removeDoubleTapListener(obj, id) { 6505 var touchstart = obj[_pre + _touchstart + id], touchend = obj[_pre + _touchend + id], dblclick = obj[_pre + "dblclick" + id]; 6506 return obj.removeEventListener(_touchstart, touchstart, !1), obj.removeEventListener(_touchend, touchend, !1), 6507 edge || obj.removeEventListener("dblclick", dblclick, !1), this; 6508 } 6509 var disableTextSelection, enableTextSelection, _userSelect, _outlineElement, _outlineStyle, TRANSFORM = testProp([ "transform", "webkitTransform", "OTransform", "MozTransform", "msTransform" ]), TRANSITION = testProp([ "webkitTransition", "transition", "OTransition", "MozTransition", "msTransition" ]), TRANSITION_END = "webkitTransition" === TRANSITION || "OTransition" === TRANSITION ? TRANSITION + "End" : "transitionend"; 6510 function get(id) { 6511 return "string" == typeof id ? document.getElementById(id) : id; 6512 } 6513 function getStyle(el, style) { 6514 var value = el.style[style] || el.currentStyle && el.currentStyle[style]; 6515 if ((!value || "auto" === value) && document.defaultView) { 6516 var css = document.defaultView.getComputedStyle(el, null); 6517 value = css ? css[style] : null; 6518 } 6519 return "auto" === value ? null : value; 6520 } 6521 function create$1(tagName, className, container) { 6522 var el = document.createElement(tagName); 6523 return el.className = className || "", container && container.appendChild(el), el; 6524 } 6525 function _remove(el) { 6526 var parent = el.parentNode; 6527 parent && parent.removeChild(el); 6528 } 6529 function empty(el) { 6530 for (;el.firstChild; ) el.removeChild(el.firstChild); 6531 } 6532 function toFront(el) { 6533 var parent = el.parentNode; 6534 parent && parent.lastChild !== el && parent.appendChild(el); 6535 } 6536 function toBack(el) { 6537 var parent = el.parentNode; 6538 parent && parent.firstChild !== el && parent.insertBefore(el, parent.firstChild); 6539 } 6540 function hasClass(el, name) { 6541 if (void 0 !== el.classList) return el.classList.contains(name); 6542 var className = getClass(el); 6543 return 0 < className.length && new RegExp("(^|\\s)" + name + "(\\s|$)").test(className); 6544 } 6545 function addClass(el, name) { 6546 if (void 0 !== el.classList) for (var classes = splitWords(name), i = 0, len = classes.length; i < len; i++) el.classList.add(classes[i]); else if (!hasClass(el, name)) { 6547 var className = getClass(el); 6548 setClass(el, (className ? className + " " : "") + name); 6549 } 6550 } 6551 function removeClass(el, name) { 6552 void 0 !== el.classList ? el.classList.remove(name) : setClass(el, trim((" " + getClass(el) + " ").replace(" " + name + " ", " "))); 6553 } 6554 function setClass(el, name) { 6555 void 0 === el.className.baseVal ? el.className = name : el.className.baseVal = name; 6556 } 6557 function getClass(el) { 6558 return el.correspondingElement && (el = el.correspondingElement), void 0 === el.className.baseVal ? el.className : el.className.baseVal; 6559 } 6560 function _setOpacity(el, value) { 6561 "opacity" in el.style ? el.style.opacity = value : "filter" in el.style && function(el, value) { 6562 var filter = !1, filterName = "DXImageTransform.Microsoft.Alpha"; 6563 try { 6564 filter = el.filters.item(filterName); 6565 } catch (e) { 6566 if (1 === value) return; 6567 } 6568 value = Math.round(100 * value), filter ? (filter.Enabled = 100 !== value, filter.Opacity = value) : el.style.filter += " progid:" + filterName + "(opacity=" + value + ")"; 6569 }(el, value); 6570 } 6571 function testProp(props) { 6572 for (var style = document.documentElement.style, i = 0; i < props.length; i++) if (props[i] in style) return props[i]; 6573 return !1; 6574 } 6575 function setTransform(el, offset, scale) { 6576 var pos = offset || new Point(0, 0); 6577 el.style[TRANSFORM] = (ie3d ? "translate(" + pos.x + "px," + pos.y + "px)" : "translate3d(" + pos.x + "px," + pos.y + "px,0)") + (scale ? " scale(" + scale + ")" : ""); 6578 } 6579 function setPosition(el, point) { 6580 el._leaflet_pos = point, any3d ? setTransform(el, point) : (el.style.left = point.x + "px", 6581 el.style.top = point.y + "px"); 6582 } 6583 function getPosition(el) { 6584 return el._leaflet_pos || new Point(0, 0); 6585 } 6586 if ("onselectstart" in document) disableTextSelection = function() { 6587 on(window, "selectstart", preventDefault); 6588 }, enableTextSelection = function() { 6589 off(window, "selectstart", preventDefault); 6590 }; else { 6591 var userSelectProperty = testProp([ "userSelect", "WebkitUserSelect", "OUserSelect", "MozUserSelect", "msUserSelect" ]); 6592 disableTextSelection = function() { 6593 if (userSelectProperty) { 6594 var style = document.documentElement.style; 6595 _userSelect = style[userSelectProperty], style[userSelectProperty] = "none"; 6596 } 6597 }, enableTextSelection = function() { 6598 userSelectProperty && (document.documentElement.style[userSelectProperty] = _userSelect, 6599 _userSelect = void 0); 6600 }; 6601 } 6602 function disableImageDrag() { 6603 on(window, "dragstart", preventDefault); 6604 } 6605 function enableImageDrag() { 6606 off(window, "dragstart", preventDefault); 6607 } 6608 function preventOutline(element) { 6609 for (;-1 === element.tabIndex; ) element = element.parentNode; 6610 element.style && (restoreOutline(), _outlineStyle = (_outlineElement = element).style.outline, 6611 element.style.outline = "none", on(window, "keydown", restoreOutline)); 6612 } 6613 function restoreOutline() { 6614 _outlineElement && (_outlineElement.style.outline = _outlineStyle, _outlineStyle = _outlineElement = void 0, 6615 off(window, "keydown", restoreOutline)); 6616 } 6617 function getSizedParentNode(element) { 6618 for (;!((element = element.parentNode).offsetWidth && element.offsetHeight || element === document.body); ) ; 6619 return element; 6620 } 6621 function getScale(element) { 6622 var rect = element.getBoundingClientRect(); 6623 return { 6624 x: rect.width / element.offsetWidth || 1, 6625 y: rect.height / element.offsetHeight || 1, 6626 boundingClientRect: rect 6627 }; 6628 } 6629 var DomUtil = (Object.freeze || Object)({ 6630 TRANSFORM: TRANSFORM, 6631 TRANSITION: TRANSITION, 6632 TRANSITION_END: TRANSITION_END, 6633 get: get, 6634 getStyle: getStyle, 6635 create: create$1, 6636 remove: _remove, 6637 empty: empty, 6638 toFront: toFront, 6639 toBack: toBack, 6640 hasClass: hasClass, 6641 addClass: addClass, 6642 removeClass: removeClass, 6643 setClass: setClass, 6644 getClass: getClass, 6645 setOpacity: _setOpacity, 6646 testProp: testProp, 6647 setTransform: setTransform, 6648 setPosition: setPosition, 6649 getPosition: getPosition, 6650 disableTextSelection: disableTextSelection, 6651 enableTextSelection: enableTextSelection, 6652 disableImageDrag: disableImageDrag, 6653 enableImageDrag: enableImageDrag, 6654 preventOutline: preventOutline, 6655 restoreOutline: restoreOutline, 6656 getSizedParentNode: getSizedParentNode, 6657 getScale: getScale 6658 }); 6659 function on(obj, types, fn, context) { 6660 if ("object" === _typeof(types)) for (var type in types) addOne(obj, type, types[type], fn); else for (var i = 0, len = (types = splitWords(types)).length; i < len; i++) addOne(obj, types[i], fn, context); 6661 return this; 6662 } 6663 var eventsKey = "_leaflet_events"; 6664 function off(obj, types, fn, context) { 6665 if ("object" === _typeof(types)) for (var type in types) removeOne(obj, type, types[type], fn); else if (types) for (var i = 0, len = (types = splitWords(types)).length; i < len; i++) removeOne(obj, types[i], fn, context); else { 6666 for (var j in obj[eventsKey]) removeOne(obj, j, obj[eventsKey][j]); 6667 delete obj[eventsKey]; 6668 } 6669 return this; 6670 } 6671 function addOne(obj, type, fn, context) { 6672 var id = type + stamp(fn) + (context ? "_" + stamp(context) : ""); 6673 if (obj[eventsKey] && obj[eventsKey][id]) return this; 6674 var handler = function(e) {
6675 return fn.call(context || obj, e || window.event); 6676 }, originalHandler = handler; 6677 pointer && 0 === type.indexOf("touch") ? addPointerListener(obj, type, handler, id) : !touch || "dblclick" !== type || pointer && chrome ? "addEventListener" in obj ? "mousewheel" === type ? obj.addEventListener("onwheel" in obj ? "wheel" : "mousewheel", handler, !1) : "mouseenter" === type || "mouseleave" === type ? (handler = function(e) { 6678 e = e || window.event, isExternalTarget(obj, e) && originalHandler(e); 6679 }, obj.addEventListener("mouseenter" === type ? "mouseover" : "mouseout", handler, !1)) : ("click" === type && android && (handler = function(e) { 6680 !function(e, handler) { 6681 var timeStamp = e.timeStamp || e.originalEvent && e.originalEvent.timeStamp, elapsed = lastClick && timeStamp - lastClick; 6682 if (elapsed && 100 < elapsed && elapsed < 500 || e.target._simulatedClick && !e._simulated) return stop(e); 6683 lastClick = timeStamp, handler(e); 6684 }(e, originalHandler); 6685 }), obj.addEventListener(type, handler, !1)) : "attachEvent" in obj && obj.attachEvent("on" + type, handler) : addDoubleTapListener(obj, handler, id), 6686 obj[eventsKey] = obj[eventsKey] || {}, obj[eventsKey][id] = handler; 6687 } 6688 function removeOne(obj, type, fn, context) { 6689 var id = type + stamp(fn) + (context ? "_" + stamp(context) : ""), handler = obj[eventsKey] && obj[eventsKey][id]; 6690 if (!handler) return this; 6691 pointer && 0 === type.indexOf("touch") ? function(obj, type, id) { 6692 var handler = obj["_leaflet_" + type + id]; 6693 "touchstart" === type ? obj.removeEventListener(POINTER_DOWN, handler, !1) : "touchmove" === type ? obj.removeEventListener(POINTER_MOVE, handler, !1) : "touchend" === type && (obj.removeEventListener(POINTER_UP, handler, !1), 6694 obj.removeEventListener(POINTER_CANCEL, handler, !1)); 6695 }(obj, type, id) : !touch || "dblclick" !== type || pointer && chrome ? "removeEventListener" in obj ? "mousewheel" === type ? obj.removeEventListener("onwheel" in obj ? "wheel" : "mousewheel", handler, !1) : obj.removeEventListener("mouseenter" === type ? "mouseover" : "mouseleave" === type ? "mouseout" : type, handler, !1) : "detachEvent" in obj && obj.detachEvent("on" + type, handler) : removeDoubleTapListener(obj, id), 6696 obj[eventsKey][id] = null; 6697 } 6698 function stopPropagation(e) { 6699 return e.stopPropagation ? e.stopPropagation() : e.originalEvent ? e.originalEvent._stopped = !0 : e.cancelBubble = !0, 6700 skipped(e), this; 6701 } 6702 function disableScrollPropagation(el) { 6703 return addOne(el, "mousewheel", stopPropagation), this; 6704 } 6705 function disableClickPropagation(el) { 6706 return on(el, "mousedown touchstart dblclick", stopPropagation), addOne(el, "click", fakeStop), 6707 this; 6708 } 6709 function preventDefault(e) { 6710 return e.preventDefault ? e.preventDefault() : e.returnValue = !1, this; 6711 } 6712 function stop(e) { 6713 return preventDefault(e), stopPropagation(e), this; 6714 } 6715 function getMousePosition(e, container) { 6716 if (!container) return new Point(e.clientX, e.clientY); 6717 var scale = getScale(container), offset = scale.boundingClientRect; 6718 return new Point((e.clientX - offset.left) / scale.x - container.clientLeft, (e.clientY - offset.top) / scale.y - container.clientTop); 6719 } 6720 var wheelPxFactor = win && chrome ? 2 * window.devicePixelRatio : gecko ? window.devicePixelRatio : 1; 6721 function getWheelDelta(e) { 6722 return edge ? e.wheelDeltaY / 2 : e.deltaY && 0 === e.deltaMode ? -e.deltaY / wheelPxFactor : e.deltaY && 1 === e.deltaMode ? 20 * -e.deltaY : e.deltaY && 2 === e.deltaMode ? 60 * -e.deltaY : e.deltaX || e.deltaZ ? 0 : e.wheelDelta ? (e.wheelDeltaY || e.wheelDelta) / 2 : e.detail && Math.abs(e.detail) < 32765 ? 20 * -e.detail : e.detail ? e.detail / -32765 * 60 : 0; 6723 } 6724 var lastClick, skipEvents = {}; 6725 function fakeStop(e) { 6726 skipEvents[e.type] = !0; 6727 } 6728 function skipped(e) { 6729 var events = skipEvents[e.type]; 6730 return skipEvents[e.type] = !1, events; 6731 } 6732 function isExternalTarget(el, e) { 6733 var related = e.relatedTarget; 6734 if (!related) return !0; 6735 try { 6736 for (;related && related !== el; ) related = related.parentNode; 6737 } catch (err) { 6738 return !1; 6739 } 6740 return related !== el; 6741 } 6742 var DomEvent = (Object.freeze || Object)({ 6743 on: on, 6744 off: off, 6745 stopPropagation: stopPropagation, 6746 disableScrollPropagation: disableScrollPropagation, 6747 disableClickPropagation: disableClickPropagation, 6748 preventDefault: preventDefault, 6749 stop: stop, 6750 getMousePosition: getMousePosition, 6751 getWheelDelta: getWheelDelta, 6752 fakeStop: fakeStop, 6753 skipped: skipped, 6754 isExternalTarget: isExternalTarget, 6755 addListener: on, 6756 removeListener: off 6757 }), PosAnimation = Evented.extend({ 6758 run: function(el, newPos, duration, easeLinearity) { 6759 this.stop(), this._el = el, this._inProgress = !0, this._duration = duration || .25, 6760 this._easeOutPower = 1 / Math.max(easeLinearity || .5, .2), this._startPos = getPosition(el), 6761 this._offset = newPos.subtract(this._startPos), this._startTime = +new Date(), this.fire("start"), 6762 this._animate(); 6763 }, 6764 stop: function() { 6765 this._inProgress && (this._step(!0), this._complete()); 6766 }, 6767 _animate: function() {
6768 this._animId = requestAnimFrame(this._animate, this), this._step(); 6769 }, 6770 _step: function(round) { 6771 var elapsed = +new Date() - this._startTime, duration = 1e3 * this._duration; 6772 elapsed < duration ? this._runFrame(this._easeOut(elapsed / duration), round) : (this._runFrame(1), 6773 this._complete()); 6774 }, 6775 _runFrame: function(progress, round) { 6776 var pos = this._startPos.add(this._offset.multiplyBy(progress)); 6777 round && pos._round(), setPosition(this._el, pos), this.fire("step"); 6778 }, 6779 _complete: function() { 6780 cancelAnimFrame(this._animId), this._inProgress = !1, this.fire("end"); 6781 }, 6782 _easeOut: function(t) { 6783 return 1 - Math.pow(1 - t, this._easeOutPower); 6784 } 6785 }), Map = Evented.extend({ 6786 options: { 6787 crs: EPSG3857, 6788 center: void 0, 6789 zoom: void 0, 6790 minZoom: void 0, 6791 maxZoom: void 0, 6792 layers: [], 6793 maxBounds: void 0, 6794 renderer: void 0, 6795 zoomAnimation: !0, 6796 zoomAnimationThreshold: 4, 6797 fadeAnimation: !0, 6798 markerZoomAnimation: !0, 6799 transform3DLimit: 8388608, 6800 zoomSnap: 1, 6801 zoomDelta: 1, 6802 trackResize: !0 6803 }, 6804 initialize: function(id, options) { 6805 options = setOptions(this, options), this._handlers = [], this._layers = {}, this._zoomBoundLayers = {}, 6806 this._sizeChanged = !0, this._initContainer(id), this._initLayout(), this._onResize = bind(this._onResize, this), 6807 this._initEvents(), options.maxBounds && this.setMaxBounds(options.maxBounds), void 0 !== options.zoom && (this._zoom = this._limitZoom(options.zoom)), 6808 options.center && void 0 !== options.zoom && this.setView(toLatLng(options.center), options.zoom, { 6809 reset: !0 6810 }), this.callInitHooks(), this._zoomAnimated = TRANSITION && any3d && !mobileOpera && this.options.zoomAnimation, 6811 this._zoomAnimated && (this._createAnimProxy(), on(this._proxy, TRANSITION_END, this._catchTransitionEnd, this)), 6812 this._addLayers(this.options.layers); 6813 }, 6814 setView: function(center, zoom, options) { 6815 if ((zoom = void 0 === zoom ? this._zoom : this._limitZoom(zoom), center = this._limitCenter(toLatLng(center), zoom, this.options.maxBounds), 6816 options = options || {}, this._stop(), this._loaded && !options.reset && !0 !== options) && (void 0 !== options.animate && (options.zoom = extend({ 6817 animate: options.animate 6818 }, options.zoom), options.pan = extend({ 6819 animate: options.animate, 6820 duration: options.duration 6821 }, options.pan)), this._zoom !== zoom ? this._tryAnimatedZoom && this._tryAnimatedZoom(center, zoom, options.zoom) : this._tryAnimatedPan(center, options.pan))) return clearTimeout(this._sizeTimer), 6822 this; 6823 return this._resetView(center, zoom), this; 6824 }, 6825 setZoom: function(zoom, options) { 6826 return this._loaded ? this.setView(this.getCenter(), zoom, { 6827 zoom: options 6828 }) : (this._zoom = zoom, this); 6829 }, 6830 zoomIn: function(delta, options) { 6831 return delta = delta || (any3d ? this.options.zoomDelta : 1), this.setZoom(this._zoom + delta, options); 6832 }, 6833 zoomOut: function(delta, options) { 6834 return delta = delta || (any3d ? this.options.zoomDelta : 1), this.setZoom(this._zoom - delta, options); 6835 }, 6836 setZoomAround: function(latlng, zoom, options) { 6837 var scale = this.getZoomScale(zoom), viewHalf = this.get
6837Size().divideBy(2), centerOffset = (latlng instanceof Point ? latlng : this.latLngToContainerPoint(latlng)).subtract(viewHalf).multiplyBy(1 - 1 / scale), newCenter = this.containerPointToLatLng(viewHalf.add(centerOffset)); 6838 return this.setView(newCenter, zoom, { 6839 zoom: options 6840 }); 6841 }, 6842 _getBoundsCenterZoom: function(bounds, options) { 6843 options = options || {}, bounds = bounds.getBounds ? bounds.getBounds() : toLatLngBounds(bounds); 6844 var paddingTL = toPoint(options.paddingTopLeft || options.padding || [ 0, 0 ]), paddingBR = toPoint(options.paddingBottomRight || options.padding || [ 0, 0 ]), zoom = this.getBoundsZoom(bounds, !1, paddingTL.add(paddingBR)); 6845 if ((zoom = "number" == typeof options.maxZoom ? Math.min(options.maxZoom, zoom) : zoom) === 1 / 0) return { 6846 center: bounds.getCenter(), 6847 zoom: zoom 6848 }; 6849 var paddingOffset = paddingBR.subtract(paddingTL).divideBy(2), swPoint = this.project(bounds.getSouthWest
6849(), zoom), nePoint = this.project(bounds.getNorthEast(), zoom); 6850 return { 6851 center: this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom), 6852 zoom: zoom 6853 }; 6854 }, 6855 fitBounds: function(bounds, options) { 6856 if (!(bounds = toLatLngBounds(bounds)).isValid()) throw new Error("Bounds are not valid."); 6857 var target = this._getBoundsCenterZoom(bounds, options); 6858 return this.setView(target.center, target.zoom, options); 6859 }, 6860 fitWorld: function(options) { 6861 return this.fitBounds([ [ -90, -180 ], [ 90, 180 ] ], options); 6862 }, 6863 panTo: function(center, options) { 6864 return this.setView(center, this._zoom, { 6865 pan: options 6866 }); 6867 }, 6868 panBy: function(offset, options) { 6869 if (options = options || {}, !(offset = toPoint(offset).round()).x && !offset.y) return this.fire("moveend"); 6870 if (!0 !== options.animate && !this.getSize().contains(offset)) return this._resetView(this.unproject(this.project(this.getCenter()).add(offset)), this.getZoom()), 6871 this; 6872 if (this._panAnim || (this._panAnim = new PosAnimation(), this._panAnim.on({ 6873 step: this._onPanTransitionStep, 6874 end: this._onPanTransitionEnd 6875 }, this)), options.noMoveStart || this.fire("movestart"), !1 !== options.animate) { 6876 addClass(this._mapPane, "leaflet-pan-anim"); 6877 var newPos = this._getMapPanePos().subtract(offset).round(); 6878 this._panAnim.run(this._mapPane, newPos, options.duration || .25, options.easeLinearity); 6879 } else this._rawPanBy(offset), this.fire("move").fire("moveend"); 6880 return this; 6881 }, 6882 flyTo: function(targetCenter, targetZoom, options) { 6883 if (!1 === (options = options || {}).animate || !any3d) return this.setView(targetCenter, targetZoom, options); 6884 this._stop(); 6885 var from = this.project(this.getCenter()), to = this.project(targetCenter), size = this.getSize(), startZoom = this._zoom; 6886 targetCenter = toLatLng(targetCenter), targetZoom = void 0 === targetZoom ? startZoom : targetZoom; 6887 var w0 = Math.max(size.x, size.y), w1 = w0 * this.getZoomScale(startZoom, targetZoom), u1 = to.distanceTo(from) || 1, rho = 1.42, rho2 = rho * rho; 6888 function r(i) { 6889 var b = (w1 * w1 - w0 * w0 + (i ? -1 : 1) * rho2 * rho2 * u1 * u1) / (2 * (i ? w1 : w0) * rho2 * u1), sq = Math.sqrt(b * b + 1) - b; 6890 return sq < 1e-9 ? -18 : Math.log(sq); 6891 } 6892 function sinh(n) { 6893 return (Math.exp(n) - Math.exp(-n)) / 2; 6894 } 6895 function cosh(n) { 6896 return (Math.exp(n) + Math.exp(-n)) / 2; 6897 } 6898 var r0 = r(0); 6899 function u(s) { 6900 return w0 * (cosh(r0) * function(n) { 6901 return sinh(n) / cosh(n); 6902 }(r0 + rho * s) - sinh(r0)) / rho2; 6903 } 6904 var start = Date.now(), S = (r(1) - r0) / rho, duration = options.duration ? 1e3 * options.duration : 1e3 * S * .8; 6905 return this._moveStart(!0, options.noMoveStart), function frame() { 6906 var t = (Date.now() - start) / duration, s = function(t) { 6907 return 1 - Math.pow(1 - t, 1.5); 6908 }(t) * S; 6909 t <= 1 ? (this._flyToFrame = requestAnimFrame(frame, this), this._move(this.unproject(from.add(to.subtract(from).multiplyBy(u(s) / u1)), startZoom), this.get
6909ScaleZoom(w0 / function(s) { 6910 return w0 * (cosh(r0) / cosh(r0 + rho * s)); 6911 }(s), startZoom), { 6912 flyTo: !0 6913 })) : this._move(targetCenter, targetZoom)._moveEnd(!0); 6914 }.call(this), this; 6915 }, 6916 flyToBounds: function(bounds, options) { 6917 var target = this._getBoundsCenterZoom(bounds, options); 6918 return this.flyTo(target.center, target.zoom, options); 6919 }, 6920 setMaxBounds: function(bounds) { 6921 return (bounds = toLatLngBounds(bounds)).isValid() ? (this.options.maxBounds && this.off("moveend", this._panInsideMaxBounds), 6922 this.options.maxBounds = bounds, this._loaded && this._panInsideMaxBounds(), this.on("moveend", this._panInsideMaxBounds)) : (this.options.maxBounds = null, 6923 this.off("moveend", this._panInsideMaxBounds)); 6924 }, 6925 setMinZoom: function(zoom) { 6926 var oldZoom = this.options.minZoom; 6927 return this.options.minZoom = zoom, this._loaded && oldZoom !== zoom && (this.fire("zoomlevelschange"), 6928 this.getZoom() < this.options.minZoom) ? this.setZoom(zoom) : this; 6929 }, 6930 setMaxZoom: function(zoom) { 6931 var oldZoom = this.options.maxZoom; 6932 return this.options.maxZoom = zoom, this._loaded && oldZoom !== zoom && (this.fire("zoomlevelschange"), 6933 this.getZoom() > this.options.maxZoom) ? this.setZoom(zoom) : this; 6934 }, 6935 panInsideBounds: function(bounds, options) { 6936 this._enforcingBounds = !0; 6937 var center = this.getCenter(), newCenter = this._limitCenter(center, this._zoom, toLatLngBounds(bounds)); 6938 return center.equals(newCenter) || this.panTo(newCenter, options), this._enforcingBounds = !1, 6939 this; 6940 }, 6941 panInside: function(latlng, options) { 6942 var paddingTL = toPoint((options = options || {}).paddingTopLeft || options.padding || [ 0, 0 ]), paddingBR = toPoint(options.paddingBottomRight || options.padding || [ 0, 0 ]), center = this.getCenter(), pixelCenter = this.project(center), pixelPoint = this.project(latlng), pixelBounds = this.getPixelBounds(), halfPixelBounds = pixelBounds.getSize().divideBy(2), paddedBounds = toBounds([ pixelBounds.min.add(paddingTL), pixelBounds.max.subtract(paddingBR) ]); 6943 if (!paddedBounds.contains(pixelPoint)) { 6944 this._enforcingBounds = !0; 6945 var diff = pixelCenter.subtract(pixelPoint), newCenter = toPoint(pixelPoint.x + diff.x, pixelPoint.y + diff.y); 6946 (pixelPoint.x < paddedBounds.min.x || pixelPoint.x > paddedBounds.max.x) && (newCenter.x = pixelCenter.x - diff.x, 6947 0 < diff.x ? newCenter.x += halfPixelBounds.x - paddingTL.x : newCenter.x -= halfPixelBounds.x - paddingBR.x), 6948 (pixelPoint.y < paddedBounds.min.y || pixelPoint.y > paddedBounds.max.y) && (newCenter.y = pixelCenter.y - diff.y, 6949 0 < diff.y ? newCenter.y += halfPixelBounds.y - paddingTL.y : newCenter.y -= halfPixelBounds.y - paddingBR.y), 6950 this.panTo(this.unproject(newCenter), options), this._enforcingBounds = !1; 6951 } 6952 return this; 6953 }, 6954 invalidateSize: function(options) { 6955 if (!this._loaded) return this; 6956 options = extend({ 6957 animate: !1, 6958 pan: !0 6959 }, !0 === options ? { 6960 animate: !0 6961 } : options); 6962 var oldSize = this.getSize(); 6963 this._sizeChanged = !0, this._lastCenter = null; 6964 var newSize = this.getSize(), oldCenter = oldSize.divideBy(2).round(), newCenter = newSize.divideBy(2).round(), offset = oldCenter.subtract(newCenter); 6965 return offset.x || offset.y ? (options.animate && options.pan ? this.panBy(offset) : (options.pan && this._rawPanBy(offset), 6966 this.fire("move"), options.debounceMoveend ? (clearTimeout(this._sizeTimer), this._sizeTimer = setTimeout(bind(this.fire, this, "moveend"), 200)) : this.fire("moveend")), 6967 this.fire("resize", { 6968 oldSize: oldSize, 6969 newSize: newSize 6970 })) : this; 6971 }, 6972 stop: function() { 6973 return this.setZoom(this._limitZoom(this._zoom)), this.options.zoomSnap || this.fire("viewreset"), 6974 this._stop(); 6975 }, 6976 locate: function(options) { 6977 if (options = this._locateOptions = extend({ 6978 timeout: 1e4, 6979 watch: !1 6980 }, options), !("geolocation" in navigator)) return this._handleGeolocationError({ 6981 code: 0, 6982 message: "Geolocation not supported." 6983 }), this; 6984 var onResponse = bind(this._handleGeolocationResponse, this), onError = bind(this._handleGeolocationError, this); 6985 return options.watch ? this._locationWatchId = navigator.geolocation.watchPosition(onResponse, onError, options) : navigator.geolocation.getCurrentPosition(onResponse, onError, options), 6986 this; 6987 }, 6988 stopLocate: function() { 6989 return navigator.geolocation && navigator.geolocation.clearWatch && navigator.geolocation.clearWatch(this._locationWatchId), 6990 this._locateOptions && (this._locateOptions.setView = !1), this; 6991 }, 6992 _handleGeolocationError: function(error) { 6993 var c = error.code, message = error.message || (1 === c ? "permission denied" : 2 === c ? "position unavailable" : "timeout"); 6994 this._locateOptions.setView && !this._loaded && this.fitWorld(), this.fire("locationerror", { 6995 code: c, 6996 message: "Geolocation error: " + message + "." 6997 }); 6998 }, 6999 _handleGeolocationResponse: function(pos) { 7000 var latlng = new LatLng(pos.coords.latitude, pos.coords.longitude), bounds = latlng.toBounds(2 * pos.coords.accuracy), options = this._locateOptions; 7001 if (options.setView) { 7002 var zoom = this.getBoundsZoom(bounds); 7003 this.setView(latlng, options.maxZoom ? Math.min(zoom, options.maxZoom) : zoom); 7004 } 7005 var data = { 7006 latlng: latlng,
7007 bounds: bounds, 7008 timestamp: pos.timestamp 7009 }; 7010 for (var i in pos.coords) "number" == typeof pos.coords[i] && (data[i] = pos.coords[i]); 7011 this.fire("locationfound", data); 7012 }, 7013 addHandler: function(name, HandlerClass) { 7014 if (!HandlerClass) return this; 7015 var handler = this[name] = new HandlerClass(this); 7016 return this._handlers.push(handler), this.options[name] && handler.enable(), this; 7017 }, 7018 remove: function() { 7019 if (this._initEvents(!0), this._containerId !== this._container._leaflet_id) throw new Error("Map container is being reused by another instance"); 7020 try { 7021 delete this._container._leaflet_id, delete this._containerId; 7022 } catch (e) { 7023 this._container._leaflet_id = void 0, this._containerId = void 0; 7024 } 7025 var i; 7026 for (i in void 0 !== this._locationWatchId && this.stopLocate(), this._stop(), _remove(this._mapPane), 7027 this._clearControlPos && this._clearControlPos(), this._resizeRequest && (cancelAnimFrame(this._resizeRequest), 7028 this._resizeRequest = null), this._clearHandlers(), this._loaded && this.fire("unload"), 7029 this._layers) this._layers[i].remove(); 7030 for (i in this._panes) _remove(this._panes[i]); 7031 return this._layers = [], this._panes = [], delete this._mapPane, delete this._renderer, 7032 this; 7033 }, 7034 createPane: function(name, container) { 7035 var pane = create$1("div", "leaflet-pane" + (name ? " leaflet-" + name.replace("Pane", "") + "-pane" : ""), container || this._mapPane); 7036 return name && (this._panes[name] = pane), pane; 7037 }, 7038 getCenter: function() { 7039 return this._checkIfLoaded(), this._lastCenter && !this._moved() ? this._lastCenter : this.layerPointToLatLng(this._getCenterLayerPoint()); 7040 }, 7041 getZoom: function() { 7042 return this._zoom; 7043 }, 7044 getBounds: function() { 7045 var bounds = this.getPixelBounds(); 7046 return new LatLngBounds(this.unproject(bounds.getBottomLeft()), this.unproject(bounds.getTopRight())); 7047 }, 7048 getMinZoom: function() { 7049 return void 0 === this.options.minZoom ? this._layersMinZoom || 0 : this.options.minZoom; 7050 }, 7051 getMaxZoom: function() { 7052 return void 0 === this.options.maxZoom ? void 0 === this._layersMaxZoom ? 1 / 0 : this._layersMaxZoom : this.options.maxZoom; 7053 }, 7054 getBoundsZoom: function(bounds, inside, padding) { 7055 bounds = toLatLngBounds(bounds), padding = toPoint(padding || [ 0, 0 ]); 7056 var zoom = this.getZoom() || 0, min = this.getMinZoom(), max = this.getMaxZoom(), nw = bounds.getNorthWest(), se = bounds.getSouthEast(), size = this.getSize().subtract(padding), boundsSize = toBounds(this.project(se, zoom), this.project(nw, zoom)).getSize(), snap = any3d ? this.options.zoomSnap : 1, scalex = size.x / boundsSize.x, scaley = size.y / boundsSize.y, scale = inside ? Math.max(scalex, scaley) : Math.min(scalex, scaley); 7057 return zoom = this.getScaleZoom(scale, zoom), snap && (zoom = Math.round(zoom / (snap / 100)) * (snap / 100), 7058 zoom = inside ? Math.ceil(zoom / snap) * snap : Math.floor(zoom / snap) * snap), 7059 Math.max(min, Math.min(max, zoom)); 7060 }, 7061 getSize: function() { 7062 return this._size && !this._sizeChanged || (this._size = new Point(this._container.clientWidth || 0, this._container.clientHeight || 0), 7063 this._sizeChanged = !1), this._size.clone(); 7064 }, 7065 getPixelBounds: function(center, zoom) { 7066 var topLeftPoint = this._getTopLeftPoint(center, zoom); 7067 return new Bounds(topLeftPoint, topLeftPoint.add(this.getSize())); 7068 }, 7069 getPixelOrigin: function() { 7070 return this._checkIfLoaded(), this._pixelOrigin; 7071 }, 7072 getPixelWorldBounds: function(zoom) { 7073 return this.options.crs.getProjectedBounds(void 0 === zoom ? this.getZoom() : zoom); 7074 }, 7075 getPane: function(pane) { 7076 return "string" == typeof pane ? this._panes[pane] : pane; 7077 }, 7078 getPanes: function() { 7079 return this._panes; 7080 }, 7081 getContainer: function() { 7082 return this._container; 7083 }, 7084 getZoomScale: function(toZoom, fromZoom) { 7085 var crs = this.options.crs; 7086 return fromZoom = void 0 === fromZoom ? this._zoom : fromZoom, crs.scale(toZoom) / crs.scale(fromZoom); 7087 }, 7088 getScaleZoom: function(scale, fromZoom) { 7089 var crs = this.options.crs; 7090 fromZoom = void 0 === fromZoom ? this._zoom : fromZoom; 7091 var zoom = crs.zoom(scale * crs.scale(fromZoom)); 7092 return isNaN(zoom) ? 1 / 0 : zoom; 7093 }, 7094 project: function(latlng, zoom) { 7095 return zoom = void 0 === zoom ? this._zoom : zoom, this.options.crs.latLngToPoint(toLatLng(latlng), zoom); 7096 }, 7097 unproject: function(point, zoom) { 7098 return zoom = void 0 === zoom ? this._zoom : zoom, this.options.crs.pointToLatLng(toPoint(point), zoom); 7099 }, 7100 layerPointToLatLng: function(point) { 7101 var projectedPoint = toPoint(point).add(this.getPixelOrigin()); 7102 return this.unproject(projectedPoint); 7103 }, 7104 latLngToLayerPoint: function(latlng) { 7105 return this.project(toLatLng(latlng))._round()._subtract(this.getPixelOrigin()); 7106 }, 7107 wrapLatLng: function(latlng) { 7108 return this.options.crs.wrapLatLng(toLatLng(latlng)); 7109 }, 7110 wrapLatLngBounds: function(latlng) { 7111 return this.options.crs.wrapLatLngBounds(toLatLngBounds(latlng)); 7112 }, 7113 distance: function(latlng1, latlng2) { 7114 return this.options.crs.distance(toLatLng(latlng1), toLatLng(latlng2)); 7115 }, 7116 containerPointToLayerPoint: function(point) { 7117 return toPoint(point).subtract(this._getMapPanePos()); 7118 }, 7119 layerPointToContainerPoint: function(point) { 7120 return toPoint(point).add(this._getMapPanePos()); 7121 }, 7122 containerPointToLatLng: function(point) { 7123 var layerPoint = this.containerPointToLayerPoint(toPoint(point)); 7124 return this.layerPointToLatLng(layerPoint); 7125 }, 7126 latLngToContainerPoint: function(latlng) { 7127 return this.layerPointToContainerPoint(this.latLngToLayerPoint(toLatLng(latlng))); 7128 }, 7129 mouseEventToContainerPoint: function(e) { 7130 return getMousePosition(e, this._container); 7131 }, 7132 mouseEventToLayerPoint: function(e) { 7133 return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e)); 7134 }, 7135 mouseEventToLatLng: function(e) { 7136 return this.layerPointToLatLng(this.mouseEventToLayerPoint(e)); 7137 }, 7138 _initContainer: function(id) { 7139 var container = this._container = get(id); 7140 if (!container) throw new Error("Map container not found."); 7141 if (container._leaflet_id) throw new Error("Map container is already initialized."); 7142 on(container, "scroll", this._onScroll, this), this._containerId = stamp(container); 7143 }, 7144 _initLayout: function() { 7145 var container = this._container; 7146 this._fadeAnimated = this.options.fadeAnimation && any3d, addClass(container, "leaflet-container" + (touch ? " leaflet-touch" : "") + (retina ? " leaflet-retina" : "") + (ielt9 ? " leaflet-oldie" : "") + (safari ? " leaflet-safari" : "") + (this._fadeAnimated ? " leaflet-fade-anim" : "")); 7147 var position = getStyle(container, "position"); 7148 "absolute" !== position && "relative" !== position && "fixed" !== position && (container.style.position = "relative"), 7149 this._initPanes(), this._initControlPos && this._initControlPos(); 7150 }, 7151 _initPanes: function() { 7152 var panes = this._panes = {}; 7153 this._paneRenderers = {}, this._mapPane = this.createPane("mapPane", this._container), 7154 setPosition(this._mapPane, new Point(0, 0)), this.createPane("tilePane"), this.createPane("shadowPane"), 7155 this.createPane("overlayPane"), this.createPane("markerPane"), this.createPane("tooltipPane"), 7156 this.createPane("popupPane"), this.options.markerZoomAnimation || (addClass(panes.markerPane, "leaflet-zoom-hide"), 7157 addClass(panes.shadowPane, "leaflet-zoom-hide")); 7158 }, 7159 _resetView: function(center, zoom) { 7160 setPosition(this._mapPane, new Point(0, 0)); 7161 var loading = !this._loaded; 7162 this._loaded = !0, zoom = this._limitZoom(zoom), this.fire("viewprereset"); 7163 var zoomChanged = this._zoom !== zoom;
7164 this._moveStart(zoomChanged, !1)._move(center, zoom)._moveEnd(zoomChanged), this.fire("viewreset"), 7165 loading && this.fire("load"); 7166 }, 7167 _moveStart: function(zoomChanged, noMoveStart) { 7168 return zoomChanged && this.fire("zoomstart"), noMoveStart || this.fire("movestart"), 7169 this; 7170 }, 7171 _move: function(center, zoom, data) { 7172 void 0 === zoom && (zoom = this._zoom); 7173 var zoomChanged = this._zoom !== zoom; 7174 return this._zoom = zoom, this._lastCenter = center, this._pixelOrigin = this._getNewPixelOrigin(center), 7175 (zoomChanged || data && data.pinch) && this.fire("zoom", data), this.fire("move", data); 7176 }, 7177 _moveEnd: function(zoomChanged) { 7178 return zoomChanged && this.fire("zoomend"), this.fire("moveend"); 7179 }, 7180 _stop: function() { 7181 return cancelAnimFrame(this._flyToFrame), this._panAnim && this._panAnim.stop(), 7182 this; 7183 }, 7184 _rawPanBy: function(offset) { 7185 setPosition(this._mapPane, this._getMapPanePos().subtract(offset)); 7186 }, 7187 _getZoomSpan: function() { 7188 return this.getMaxZoom() - this.getMinZoom(); 7189 }, 7190 _panInsideMaxBounds: function() { 7191 this._enforcingBounds || this.panInsideBounds(this.options.maxBounds); 7192 }, 7193 _checkIfLoaded: function() { 7194 if (!this._loaded) throw new Error("Set map center and zoom first."); 7195 }, 7196 _initEvents: function(remove$$1) { 7197 this._targets = {}; 7198 var onOff = remove$$1 ? off : on; 7199 onOff((this._targets[stamp(this._container)] = this)._container, "click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup", this._handleDOMEvent, this), 7200 this.options.trackResize && onOff(window, "resize", this._onResize, this), any3d && this.options.transform3DLimit && (remove$$1 ? this.off : this.on).call(this, "moveend", this._onMoveEnd); 7201 }, 7202 _onResize: function() { 7203 cancelAnimFrame(this._resizeRequest), this._resizeRequest = requestAnimFrame(function() { 7204 this.invalidateSize({ 7205 debounceMoveend: !0 7206 }); 7207 }, this); 7208 }, 7209 _onScroll: function() { 7210 this._container.scrollTop = 0, this._container.scrollLeft = 0; 7211 }, 7212 _onMoveEnd: function() { 7213 var pos = this._getMapPanePos(); 7214 Math.max(Math.abs(pos.x), Math.abs(pos.y)) >= this.options.transform3DLimit && this._resetView(this.getCenter(), this.getZoom()); 7215 }, 7216 _findEventTargets: function(e, type) { 7217 for (var target, targets = [], isHover = "mouseout" === type || "mouseover" === type, src = e.target || e.srcElement, dragging = !1; src; ) { 7218 if ((target = this._targets[stamp(src)]) && ("click" === type || "preclick" === type) && !e._simulated && this._draggableMoved(target)) { 7219 dragging = !0; 7220 break; 7221 } 7222 if (target && target.listens(type, !0)) { 7223 if (isHover && !isExternalTarget(src, e)) break; 7224 if (targets.push(target), isHover) break; 7225 } 7226 if (src === this._container) break; 7227 src = src.parentNode; 7228 } 7229 return targets.length || dragging || isHover || !isExternalTarget(src, e) || (targets = [ this ]), 7230 targets; 7231 }, 7232 _handleDOMEvent: function(e) { 7233 if (this._loaded && !skipped(e)) { 7234 var type = e.type; 7235 "mousedown" !== type && "keypress" !== type && "keyup" !== type && "keydown" !== type || preventOutline(e.target || e.srcElement),
7236 this._fireDOMEvent(e, type); 7237 } 7238 }, 7239 _mouseEvents: [ "click", "dblclick", "mouseover", "mouseout", "contextmenu" ], 7240 _fireDOMEvent: function(e, type, targets) { 7241 if ("click" === e.type) { 7242 var synth = extend({}, e); 7243 synth.type = "preclick", this._fireDOMEvent(synth, synth.type, targets); 7244 } 7245 if (!e._stopped && (targets = (targets || []).concat(this._findEventTargets(e, type))).length) { 7246 var target = targets[0]; 7247 "contextmenu" === type && target.listens(type, !0) && preventDefault(e); 7248 var data = { 7249 originalEvent: e 7250 }; 7251 if ("keypress" !== e.type && "keydown" !== e.type && "keyup" !== e.type) { 7252 var isMarker = target.getLatLng && (!target._radius || target._radius <= 10); 7253 data.containerPoint = isMarker ? this.latLngToContainerPoint(target.getLatLng()) : this.mouseEventToContainerPoint(e), 7254 data.layerPoint = this.containerPointToLayerPoint(data.containerPoint), data.latlng = isMarker ? target.getLatLng() : this.layerPointToLatLng(data.layerPoint); 7255 } 7256 for (var i = 0; i < targets.length; i++) if (targets[i].fire(type, data, !0), data.originalEvent._stopped || !1 === targets[i].options.bubblingMouseEvents && -1 !== indexOf(this._mouseEvents, type)) return; 7257 } 7258 }, 7259 _draggableMoved: function(obj) { 7260 return (obj = obj.dragging && obj.dragging.enabled() ? obj : this).dragging && obj.dragging.moved() || this.boxZoom && this.boxZoom.moved(); 7261 }, 7262 _clearHandlers: function() { 7263 for (var i = 0, len = this._handlers.length; i < len; i++) this._handlers[i].disable(); 7264 }, 7265 whenReady: function(callback, context) { 7266 return this._loaded ? callback.call(context || this, { 7267 target: this 7268 }) : this.on("load", callback, context), this; 7269 }, 7270 _getMapPanePos: function() { 7271 return getPosition(this._mapPane) || new Point(0, 0); 7272 }, 7273 _moved: function() { 7274 var pos = this._getMapPanePos(); 7275 return pos && !pos.equals([ 0, 0 ]); 7276 }, 7277 _getTopLeftPoint: function(center, zoom) { 7278 return (center && void 0 !== zoom ? this._getNewPixelOrigin(center, zoom) : this.getPixelOrigin()).subtract(this._getMapPanePos()); 7279 }, 7280 _getNewPixelOrigin: function(center, zoom) { 7281 var viewHalf = this.getSize()._divideBy(2); 7282 return this.project(center, zoom)._subtract(viewHalf)._add(this._getMapPanePos())._round(); 7283 }, 7284 _latLngToNewLayerPoint: function(latlng, zoom, center) { 7285 var topLeft = this._getNewPixelOrigin(center, zoom); 7286 return this.project(latlng, zoom)._subtract(topLeft); 7287 }, 7288 _latLngBoundsToNewLayerBounds: function(latLngBounds, zoom, center) { 7289 var topLeft = this._getNewPixelOrigin(center, zoom); 7290 return toBounds([ this.project(latLngBounds.getSouthWest
7290(), zoom)._subtract(topLeft), this.project(latLngBounds.getNorthWest(), zoom)._subtract(topLeft), this.project(latLngBounds.getSouthEast(), zoom)._subtract(topLeft), this.project(latLngBounds.getNorthEast(), zoom)._subtract(topLeft) ]); 7291 }, 7292 _getCenterLayerPoint: function() { 7293 return this.containerPointToLayerPoint(this.getSize()._divideBy(2)); 7294 }, 7295 _getCenterOffset: function(latlng) { 7296 return this.latLngToLayerPoint(latlng).subtract(this._getCenterLayerPoint()); 7297 }, 7298 _limitCenter: function(center, zoom, bounds) { 7299 if (!bounds) return center; 7300 var centerPoint = this.project(center, zoom), viewHalf = this.getSize().divideBy(2), viewBounds = new Bounds(centerPoint.subtract(viewHalf), centerPoint.add(viewHalf)), offset = this._getBoundsOffset(viewBounds, bounds, zoom); 7301 return offset.round().equals([ 0, 0 ]) ? center : this.unproject(centerPoint.add(offset), zoom); 7302 }, 7303 _limitOffset: function(offset, bounds) { 7304 if (!bounds) return offset; 7305 var viewBounds = this.getPixelBounds(), newBounds = new Bounds(viewBounds.min.add(offset), viewBounds.max.add(offset)); 7306 return offset.add(this._getBoundsOffset(newBounds, bounds)); 7307 }, 7308 _getBoundsOffset: function(pxBounds, maxBounds, zoom) { 7309 var projectedMaxBounds = toBounds(this.project(maxBounds.getNorthEast(), zoom), this.project(maxBounds.getSouthWest
7309(), zoom)), minOffset = projectedMaxBounds.min.subtract(pxBounds.min), maxOffset = projectedMaxBounds.max.subtract(pxBounds.max); 7310 return new Point(this._rebound(minOffset.x, -maxOffset.x), this._rebound(minOffset.y, -maxOffset.y)); 7311 }, 7312 _rebound: function(left, right) { 7313 return 0 < left + right ? Math.round(left - right) / 2 : Math.max(0, Math.ceil(left)) - Math.max(0, Math.floor(right)); 7314 }, 7315 _limitZoom: function(zoom) { 7316 var min = this.getMinZoom(), max = this.getMaxZoom(), snap = any3d ? this.options.zoomSnap : 1; 7317 return snap && (zoom = Math.round(zoom / snap) * snap), Math.max(min, Math.min(max, zoom)); 7318 }, 7319 _onPanTransitionStep: function() { 7320 this.fire("move"); 7321 }, 7322 _onPanTransitionEnd: function() { 7323 removeClass(this._mapPane, "leaflet-pan-anim"), this.fire("moveend"); 7324 }, 7325 _tryAnimatedPan: function(center, options) { 7326 var offset = this._getCenterOffset(center)._trunc(); 7327 return !(!0 !== (options && options.animate) && !this.getSize().contains(offset)) && (this.panBy(offset, options), 7328 !0); 7329 }, 7330 _createAnimProxy: function() { 7331 var proxy = this._proxy = create$1("div", "leaflet-proxy leaflet-zoom-animated"); 7332 this._panes.mapPane.appendChild(proxy), this.on("zoomanim", function(e) { 7333 var prop = TRANSFORM, transform = this._proxy.style[prop]; 7334 setTransform(this._proxy, this.project(e.center, e.zoom), this.getZoomScale(e.zoom, 1)), 7335 transform === this._proxy.style[prop] && this._animatingZoom && this._onZoomTransitionEnd(); 7336 }, this), this.on("load moveend", function() { 7337 var c = this.getCenter(), z = this.getZoom(); 7338 setTransform(this._proxy, this.project(c, z), this.getZoomScale(z, 1)); 7339 }, this), this._on("unload", this._destroyAnimProxy, this); 7340 }, 7341 _destroyAnimProxy: function() { 7342 _remove(this._proxy), delete this._proxy; 7343 }, 7344 _catchTransitionEnd: function(e) { 7345 this._animatingZoom && 0 <= e.propertyName.indexOf("transform") && this._onZoomTransitionEnd(); 7346 }, 7347 _nothingToAnimate: function() { 7348 return !this._container.getElementsByClassName("leaflet-zoom-animated").length; 7349 }, 7350 _tryAnimatedZoom: function(center, zoom, options) { 7351 if (this._animatingZoom) return !0; 7352 if (options = options || {}, !this._zoomAnimated || !1 === options.animate || this._nothingToAnimate() || Math.abs(zoom - this._zoom) > this.options.zoomAnimationThreshold) return !1; 7353 var scale = this.getZoomScale(zoom), offset = this._getCenterOffset(center)._divideBy(1 - 1 / scale); 7354 return !(!0 !== options.animate && !this.getSize().contains(offset)) && (requestAnimFrame(function() { 7355 this._moveStart(!0, !1)._animateZoom(center, zoom, !0); 7356 }, this), !0); 7357 }, 7358 _animateZoom: function(center, zoom, startAnim, noUpdate) { 7359 this._mapPane && (startAnim && (this._animatingZoom = !0, this._animateToCenter = center, 7360 this._animateToZoom = zoom, addClass(this._mapPane, "leaflet-zoom-anim")), this.fire("zoomanim", { 7361 center: center, 7362 zoom: zoom, 7363 noUpdate: noUpdate 7364 }), setTimeout(bind(this._onZoomTransitionEnd, this), 250)); 7365 }, 7366 _onZoomTransitionEnd: function() { 7367 this._animatingZoom && (this._mapPane && removeClass(this._mapPane, "leaflet-zoom-anim"), 7368 this._animatingZoom = !1, this._move(this._animateToCenter, this._animateToZoom),
7369 requestAnimFrame(function() { 7370 this._moveEnd(!0); 7371 }, this)); 7372 } 7373 }); 7374 var Control = Class.extend({ 7375 options: { 7376 position: "topright" 7377 }, 7378 initialize: function(options) { 7379 setOptions(this, options); 7380 }, 7381 getPosition: function() { 7382 return this.options.position; 7383 }, 7384 setPosition: function(position) { 7385 var map = this._map; 7386 return map && map.removeControl(this), this.options.position = position, map && map.addControl(this), 7387 this; 7388 }, 7389 getContainer: function() { 7390 return this._container; 7391 }, 7392 addTo: function(map) { 7393 this.remove(), this._map = map; 7394 var container = this._container = this.onAdd(map), pos = this.getPosition(), corner = map._controlCorners[pos]; 7395 return addClass(container, "leaflet-control"), -1 !== pos.indexOf("bottom") ? corner.insertBefore(container, corner.firstChild) : corner.appendChild(container), 7396 this._map.on("unload", this.remove, this), this; 7397 }, 7398 remove: function() { 7399 return this._map && (_remove(this._container), this.onRemove && this.onRemove(this._map), 7400 this._map.off("unload", this.remove, this), this._map = null), this; 7401 }, 7402 _refocusOnMap: function(e) { 7403 this._map && e && 0 < e.screenX && 0 < e.screenY && this._map.getContainer().focus(); 7404 } 7405 }), control = function(options) { 7406 return new Control(options); 7407 }; 7408 Map.include({ 7409 addControl: function(control) { 7410 return control.addTo(this), this; 7411 }, 7412 removeControl: function(control) { 7413 return control.remove(), this; 7414 }, 7415 _initControlPos: function() { 7416 var corners = this._controlCorners = {}, l = "leaflet-", container = this._controlContainer = create$1("div", l + "control-container", this._container); 7417 function createCorner(vSide, hSide) { 7418 var className = l + vSide + " " + l + hSide; 7419 corners[vSide + hSide] = create$1("div", className, container); 7420 } 7421 createCorner("top", "left"), createCorner("top", "right"), createCorner("bottom", "left"), 7422 createCorner("bottom", "right"); 7423 }, 7424 _clearControlPos: function() { 7425 for (var i in this._controlCorners) _remove(this._controlCorners[i]); 7426 _remove(this._controlContainer), delete this._controlCorners, delete this._controlContainer; 7427 } 7428 }); 7429 var Layers = Control.extend({ 7430 options: { 7431 collapsed: !0, 7432 position: "topright", 7433 autoZIndex: !0, 7434 hideSingleBase: !1, 7435 sortLayers: !1, 7436 sortFunction: function(layerA, layerB, nameA, nameB) { 7437 return nameA < nameB ? -1 : nameB < nameA ? 1 : 0; 7438 } 7439 }, 7440 initialize: function(baseLayers, overlays, options) { 7441 for (var i in setOptions(this, options), this._layerControlInputs = [], this._layers = [], 7442 this._lastZIndex = 0, this._handlingClick = !1, baseLayers) this._addLayer(baseLayers[i], i); 7443 for (i in overlays) this._addLayer(overlays[i], i, !0); 7444 }, 7445 onAdd: function(map) { 7446 this._initLayout(), this._update(), (this._map = map).on("zoomend", this._checkDisabledLayers, this); 7447 for (var i = 0; i < this._layers.length; i++) this._layers[i].layer.on("add remove", this._onLayerChange, this); 7448 return this._container; 7449 }, 7450 addTo: function(map) { 7451 return Control.prototype.addTo.call(this, map), this._expandIfNotCollapsed(); 7452 }, 7453 onRemove: function() { 7454 this._map.off("zoomend", this._checkDisabledLayers, this); 7455 for (var i = 0; i < this._layers.length; i++) this._layers[i].layer.off("add remove", this._onLayerChange, this); 7456 }, 7457 addBaseLayer: function(layer, name) { 7458 return this._addLayer(layer, name), this._map ? this._update() : this; 7459 }, 7460 addOverlay: function(layer, name) { 7461 return this._addLayer(layer, name, !0), this._map ? this._update() : this; 7462 }, 7463 removeLayer: function(layer) { 7464 layer.off("add remove", this._onLayerChange, this); 7465 var obj = this._getLayer(stamp(layer)); 7466 return obj && this._layers.splice(this._layers.indexOf(obj), 1), this._map ? this._update() : this; 7467 }, 7468 expand: function() { 7469 addClass(this._container, "leaflet-control-layers-expanded"), this._section.style.height = null; 7470 var acceptableHeight = this._map.getSize().y - (this._container.offsetTop + 50); 7471 return acceptableHeight < this._section.clientHeight ? (addClass(this._section, "leaflet-control-layers-scrollbar"), 7472 this._section.style.height = acceptableHeight + "px") : removeClass(this._section, "leaflet-control-layers-scrollbar"), 7473 this._checkDisabledLayers(), this; 7474 }, 7475 collapse: function() { 7476 return removeClass(this._container, "leaflet-control-layers-expanded"), this; 7477 }, 7478 _initLayout: function() { 7479 var className = "leaflet-control-layers", container = this._container = create$1("div", className), collapsed = this.options.collapsed; 7480 container.setAttribute("aria-haspopup", !0), disableClickPropagation(container), 7481 disableScrollPropagation(container); 7482 var section = this._section = create$1("section", className + "-list"); 7483 collapsed && (this._map.on("click", this.collapse, this), android || on(container, { 7484 mouseenter: this.expand, 7485 mouseleave: this.collapse 7486 }, this)); 7487 var link = this._layersLink = create$1("a", className + "-toggle", container); 7488 link.href = "#", link.title = "Layers", touch ? (on(link, "click", stop
7488), on(link, "click", this.expand, this)) : on(link, "focus", this.expand, this), 7489 collapsed || this.expand(), this._baseLayersList = create$1("div", className + "-base", section), 7490 this._separator = create$1("div", className + "-separator", section), this._overlaysList = create$1("div", className + "-overlays", section), 7491 container.appendChild(section); 7492 }, 7493 _getLayer: function(id) { 7494 for (var i = 0; i < this._layers.length; i++) if (this._layers[i] && stamp(this._layers[i].layer) === id) return this._layers[i]; 7495 }, 7496 _addLayer: function(layer, name, overlay) { 7497 this._map && layer.on("add remove", this._onLayerChange, this), this._layers.push({ 7498 layer: layer, 7499 name: name, 7500 overlay: overlay 7501 }), this.options.sortLayers && this._layers.sort(bind(function(a, b) { 7502 return this.options.sortFunction(a.layer, b.layer, a.name, b.name); 7503 }, this)), this.options.autoZIndex && layer.setZIndex && (this._lastZIndex++, layer.setZIndex(this._lastZIndex)), 7504 this._expandIfNotCollapsed(); 7505 }, 7506 _update: function() { 7507 if (!this._container) return this; 7508 empty(this._baseLayersList), empty(this._overlaysList), this._layerControlInputs = []; 7509 var baseLayersPresent, overlaysPresent, i, obj, baseLayersCount = 0; 7510 for (i = 0; i < this._layers.length; i++) obj = this._layers[i], this._addItem(obj), 7511 overlaysPresent = overlaysPresent || obj.overlay, baseLayersPresent = baseLayersPresent || !obj.overlay, 7512 baseLayersCount += obj.overlay ? 0 : 1; 7513 return this.options.hideSingleBase && (baseLayersPresent = baseLayersPresent && 1 < baseLayersCount, 7514 this._baseLayersList.style.display = baseLayersPresent ? "" : "none"), this._separator.style.display = overlaysPresent && baseLayersPresent ? "" : "none", 7515 this; 7516 }, 7517 _onLayerChange: function(e) { 7518 this._handlingClick || this._update(); 7519 var obj = this._getLayer(stamp(e.target)), type = obj.overlay ? "add" === e.type ? "overlayadd" : "overlayremove" : "add" === e.type ? "baselayerchange" : null; 7520 type && this._map.fire(type, obj); 7521 }, 7522 _createRadioElement: function(name, checked) { 7523 var radioHtml = '<input type="radio" class="leaflet-control-layers-selector" name="' + name + '"' + (checked ? ' checked="checked"' : "") + "/>", radioFragment = document.createElement("div"); 7524 return radioFragment.innerHTML = radioHtml, radioFragment.firstChild; 7525 }, 7526 _addItem: function(obj) { 7527 var input, label = document.createElement("label"), checked = this._map.hasLayer(obj.layer); 7528 obj.overlay ? ((input = document.createElement("input")).type = "checkbox", input.className = "leaflet-control-layers-selector", 7529 input.defaultChecked = checked) : input = this._createRadioElement("leaflet-base-layers_" + stamp(this), checked), 7530 this._layerControlInputs.push(input), input.layerId = stamp(obj.layer), on(input, "click", this._onInputClick, this); 7531 var name = document.createElement("span"); 7532 name.innerHTML = " " + obj.name; 7533 var holder = document.createElement("div"); 7534 return label.appendChild(holder), holder.appendChild(input), holder.appendChild(name), 7535 (obj.overlay ? this._overlaysList : this._baseLayersList).appendChild(label), this._checkDisabledLayers(), 7536 label; 7537 }, 7538 _onInputClick: function() { 7539 var input, layer, inputs = this._layerControlInputs, addedLayers = [], removedLayers = []; 7540 this._handlingClick = !0;
7541 for (var i = inputs.length - 1; 0 <= i; i--) input = inputs[i], layer = this._getLayer(input.layerId).layer, 7542 input.checked ? addedLayers.push(layer) : input.checked || removedLayers.push(layer); 7543 for (i = 0; i < removedLayers.length; i++) this._map.hasLayer(removedLayers[i]) && this._map.removeLayer(removedLayers[i]); 7544 for (i = 0; i < addedLayers.length; i++) this._map.hasLayer(addedLayers[i]) || this._map.addLayer(addedLayers[i]); 7545 this._handlingClick = !1, this._refocusOnMap(); 7546 }, 7547 _checkDisabledLayers: function() { 7548 for (var input, layer, inputs = this._layerControlInputs, zoom = this._map.getZoom(), i = inputs.length - 1; 0 <= i; i--) input = inputs[i], 7549 layer = this._getLayer(input.layerId).layer, input.disabled = void 0 !== layer.options.minZoom && zoom < layer.options.minZoom || void 0 !== layer.options.maxZoom && zoom > layer.options.maxZoom; 7550 }, 7551 _expandIfNotCollapsed: function() { 7552 return this._map && !this.options.collapsed && this.expand(), this; 7553 }, 7554 _expand: function() { 7555 return this.expand(); 7556 }, 7557 _collapse: function() { 7558 return this.collapse(); 7559 } 7560 }), Zoom = Control.extend({ 7561 options: { 7562 position: "topleft", 7563 zoomInText: "+", 7564 zoomInTitle: "Zoom in", 7565 zoomOutText: "−", 7566 zoomOutTitle: "Zoom out" 7567 }, 7568 onAdd: function(map) { 7569 var zoomName = "leaflet-control-zoom", container = create$1("div", zoomName + " leaflet-bar"), options = this.options; 7570 return this._zoomInButton = this._createButton(options.zoomInText, options.zoomInTitle, zoomName + "-in", container, this._zoomIn), 7571 this._zoomOutButton = this._createButton(options.zoomOutText, options.zoomOutTitle, zoomName + "-out", container, this._zoomOut), 7572 this._updateDisabled(), map.on("zoomend zoomlevelschange", this._updateDisabled, this), 7573 container; 7574 }, 7575 onRemove: function(map) { 7576 map.off("zoomend zoomlevelschange", this._updateDisabled, this); 7577 }, 7578 disable: function() { 7579 return this._disabled = !0, this._updateDisabled(), this; 7580 }, 7581 enable: function() { 7582 return this._disabled = !1, this._updateDisabled(), this; 7583 }, 7584 _zoomIn: function(e) { 7585 !this._disabled && this._map._zoom < this._map.getMaxZoom() && this._map.zoomIn(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1)); 7586 }, 7587 _zoomOut: function(e) { 7588 !this._disabled && this._map._zoom > this._map.getMinZoom() && this._map.zoomOut(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1)); 7589 }, 7590 _createButton: function(html, title, className, container, fn) { 7591 var link = create$1("a", className, container); 7592 return link.innerHTML = html, link.href = "#", link.title = title, link.setAttribute("role", "button"), 7593 link.setAttribute("aria-label", title), disableClickPropagation(link), on(link, "click", stop), 7594 on(link, "click", fn, this), on(link, "click", this._refocusOnMap, this), link; 7595 }, 7596 _updateDisabled: function() { 7597 var map = this._map, className = "leaflet-disabled"; 7598 removeClass(this._zoomInButton, className), removeClass(this._zoomOutButton, className), 7599 !this._disabled && map._zoom !== map.getMinZoom() || addClass(this._zoomOutButton, className), 7600 !this._disabled && map._zoom !== map.getMaxZoom() || addClass(this._zoomInButton, className); 7601 } 7602 }); 7603 Map.mergeOptions({ 7604 zoomControl: !0 7605 }), Map.addInitHook(function() { 7606 this.options.zoomControl && (this.zoomControl = new Zoom(), this.addControl(this.zoomControl)); 7607 }); 7608 var Scale = Control.extend({ 7609 options: { 7610 position: "bottomleft", 7611 maxWidth: 100, 7612 metric: !0, 7613 imperial: !0 7614 }, 7615 onAdd: function(map) { 7616 var container = create$1("div", "leaflet-control-scale"), options = this.options; 7617 return this._addScales(options, "leaflet-control-scale-line", container), map.on(options.updateWhenIdle ? "moveend" : "move", this._update, this), 7618 map.whenReady(this._update, this), container; 7619 }, 7620 onRemove: function(map) { 7621 map.off(this.options.updateWhenIdle ? "moveend" : "move", this._update, this); 7622 }, 7623 _addScales: function(options, className, container) { 7624 options.metric && (this._mScale = create$1("div", className, container)), options.imperial && (this._iScale = create$1("div", className, container)); 7625 }, 7626 _update: function() { 7627 var map = this._map, y = map.getSize().y / 2, maxMeters = map.distance(map.containerPointToLatLng([ 0, y ]), map.containerPointToLatLng([ this.options.maxWidth, y ])); 7628 this._updateScales(maxMeters); 7629 }, 7630 _updateScales: function(maxMeters) { 7631 this.options.metric && maxMeters && this._updateMetric(maxMeters), this.options.imperial && maxMeters && this._updateImperial(maxMeters); 7632 }, 7633 _updateMetric: function(maxMeters) { 7634 var meters = this._getRoundNum(maxMeters), label = meters < 1e3 ? meters + " m" : meters / 1e3 + " km"; 7635 this._updateScale(this._mScale, label, meters / maxMeters); 7636 }, 7637 _updateImperial: function(maxMeters) { 7638 var maxMiles, miles, feet, maxFeet = 3.2808399 * maxMeters; 7639 5280 < maxFeet ? (maxMiles = maxFeet / 5280, miles = this._getRoundNum(maxMiles), 7640 this._updateScale(this._iScale, miles + " mi", miles / max
7640Miles)) : (feet = this._getRoundNum(maxFeet), 7641 this._updateScale(this._iScale, feet + " ft", feet / maxFeet)); 7642 }, 7643 _updateScale: function(scale, text, ratio) { 7644 scale.style.width = Math.round(this.options.maxWidth * ratio) + "px", scale.innerHTML = text; 7645 }, 7646 _getRoundNum: function(num) { 7647 var pow10 = Math.pow(10, (Math.floor(num) + "").length - 1), d = num / pow10; 7648 return pow10 * (d = 10 <= d ? 10 : 5 <= d ? 5 : 3 <= d ? 3 : 2 <= d ? 2 : 1); 7649 } 7650 }), Attribution = Control.extend({ 7651 options: { 7652 position: "bottomright", 7653 prefix: '<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>' 7654 }, 7655 initialize: function(options) { 7656 setOptions(this, options), this._attributions = {}; 7657 }, 7658 onAdd: function(map) { 7659 for (var i in (map.attributionControl = this)._container = create$1("div", "leaflet-control-attribution"), 7660 disableClickPropagation(this._container), map._layers) map._layers[i].getAttribution && this.addAttribution(map._layers[i].getAttribution()); 7661 return this._update(), this._container; 7662 }, 7663 setPrefix: function(prefix) { 7664 return this.options.prefix = prefix, this._update(), this; 7665 }, 7666 addAttribution: function(text) { 7667 return text && (this._attributions[text] || (this._attributions[text] = 0), this._attributions[text]++, 7668 this._update()), this; 7669 }, 7670 removeAttribution: function(text) { 7671 return text && this._attributions[text] && (this._attributions[text]--, this._update()), 7672 this; 7673 }, 7674 _update: function() { 7675 if (this._map) { 7676 var attribs = []; 7677 for (var i in this._attributions) this._attributions[i] && attribs.push(i); 7678 var prefixAndAttribs = []; 7679 this.options.prefix && prefixAndAttribs.push(this.options.prefix), attribs.length && prefixAndAttribs.push(attribs.join(", ")), 7680 this._container.innerHTML = prefixAndAttribs.join(" | "); 7681 } 7682 } 7683 }); 7684 Map.mergeOptions({ 7685 attributionControl: !0 7686 }), Map.addInitHook(function() { 7687 this.options.attributionControl && new Attribution().addTo(this); 7688 }); 7689 Control.Layers = Layers, Control.Zoom = Zoom, Control.Scale = Scale, Control.Attribution = Attribution, 7690 control.layers = function(baseLayers, overlays, options) { 7691 return new Layers(baseLayers, overlays, options); 7692 }, control.zoom = function(options) { 7693 return new Zoom(options); 7694 }, control.scale = function(options) { 7695 return new Scale(options); 7696 }, control.attribution = function(options) { 7697 return new Attribution(options); 7698 }; 7699 var Handler = Class.extend({ 7700 initialize: function(map) { 7701 this._map = map; 7702 }, 7703 enable: function() { 7704 return this._enabled || (this._enabled = !0, this.addHooks()), this; 7705 }, 7706 disable: function() { 7707 return this._enabled && (this._enabled = !1, this.removeHooks()), this; 7708 }, 7709 enabled: function() { 7710 return !!this._enabled; 7711 } 7712 }); 7713 Handler.addTo = function(map, name) { 7714 return map.addHandler(name, this), this; 7715 }; 7716 var _lastCode, Mixin = { 7717 Events: Events 7718 }, START = touch ? "touchstart mousedown" : "mousedown", END = { 7719 mousedown: "mouseup", 7720 touchstart: "touchend", 7721 pointerdown: "touchend", 7722 MSPointerDown: "touchend" 7723 }, MOVE = { 7724 mousedown: "mousemove", 7725 touchstart: "touchmove", 7726 pointerdown: "touchmove", 7727 MSPointerDown: "touchmove" 7728 }, Draggable = Evented.extend({ 7729 options: { 7730 clickTolerance: 3 7731 }, 7732 initialize: function(element, dragStartTarget, preventOutline$$1, options) { 7733 setOptions(this, options), this._element = element, this._dragStartTarget = dragStartTarget || element, 7734 this._preventOutline = preventOutline$$1; 7735 }, 7736 enable: function() { 7737 this._enabled || (on(this._dragStartTarget, START, this._onDown, this), this._enabled = !0); 7738 }, 7739 disable: function() { 7740 this._enabled && (Draggable._dragging === this && this.finishDrag(), off(this._dragStartTarget, START, this._onDown, this), 7741 this._enabled = !1, this._moved = !1); 7742 }, 7743 _onDown: function(e) { 7744 if (!e._simulated && this._enabled && (this._moved = !1, !hasClass(this._element, "leaflet-zoom-anim") && !(Draggable._dragging || e.shiftKey || 1 !== e.which && 1 !== e.button && !e.touches || ((Draggable._dragging = this)._preventOutline && preventOutline(this._element), 7745 disableImageDrag(), disableTextSelection(), this._moving)))) { 7746 this.fire("down"); 7747 var first = e.touches ? e.touches[0] : e, sizedParent = getSizedParentNode(this._element); 7748 this._startPoint = new Point(first.clientX, first.clientY), this._parentScale = getScale(sizedParent), 7749 on(document, MOVE[e.type], this._onMove, this), on(document, END[e.type], this._onUp, this); 7750 } 7751 }, 7752 _onMove: function(e) { 7753 if (!e._simulated && this._enabled) if (e.touches && 1 < e.touches.length) this._moved = !0; else { 7754 var first = e.touches && 1 === e.touches.length ? e.touches[0] : e, offset = new Point(first.clientX, first.clientY)._subtract(this._startPoint); 7755 (offset.x || offset.y) && (Math.abs(offset.x) + Math.abs(offset.y) < this.options.clickTolerance || (offset.x /= this._parentScale.x, 7756 offset.y /= this._parentScale.y, preventDefault(e), this._moved || (this.fire("dragstart"), 7757 this._moved = !0, this._startPos = getPosition(this._element).subtract(offset), 7758 addClass(document.body, "leaflet-dragging"), this._lastTarget = e.target || e.srcElement, 7759 window.SVGElementInstance && this._lastTarget instanceof SVGElementInstance && (this._lastTarget = this._lastTarget.correspondingUseElement), 7760 addClass(this._lastTarget, "leaflet-drag-target")), this._newPos = this._startPos.add(offset),
7761 this._moving = !0, cancelAnimFrame(this._animRequest), this._lastEvent = e, this._animRequest = requestAnimFrame(this._updatePosition, this, !0))); 7762 } 7763 }, 7764 _updatePosition: function() { 7765 var e = { 7766 originalEvent: this._lastEvent 7767 }; 7768 this.fire("predrag", e), setPosition(this._element, this._newPos), this.fire("drag", e); 7769 }, 7770 _onUp: function(e) { 7771 !e._simulated && this._enabled && this.finishDrag(); 7772 }, 7773 finishDrag: function() { 7774 for (var i in removeClass(document.body, "leaflet-dragging"), this._lastTarget && (removeClass(this._lastTarget, "leaflet-drag-target"), 7775 this._lastTarget = null), MOVE) off(document, MOVE[i], this._onMove, this), off(document, END[i], this._onUp, this); 7776 enableImageDrag(), enableTextSelection(), this._moved && this._moving && (cancelAnimFrame(this._animRequest), 7777 this.fire("dragend", { 7778 distance: this._newPos.distanceTo(this._startPos) 7779 })), this._moving = !1, Draggable._dragging = !1; 7780 } 7781 }); 7782 function simplify(points, tolerance) { 7783 if (!tolerance || !points.length) return points.slice(); 7784 var sqTolerance = tolerance * tolerance; 7785 return points = function(points, sqTolerance) { 7786 var len = points.length, markers = new (("undefined" == typeof Uint8Array ? "undefined" : _typeof(Uint8Array)) !== void 0 + "" ? Uint8Array : Array)(len); 7787 markers[0] = markers[len - 1] = 1, function _simplifyDPStep(points, markers, sqTolerance, first, last) { 7788 var index, i, sqDist, maxSqDist = 0; 7789 for (i = first + 1; i <= last - 1; i++) sqDist = _sqClosestPointOnSegment(points[i], points[first], points[last], !0), 7790 maxSqDist < sqDist && (index = i, maxSqDist = sqDist); 7791 sqTolerance < maxSqDist && (markers[index] = 1, _simplifyDPStep(points, markers, sqTolerance, first, index), 7792 _simplifyDPStep(points, markers, sqTolerance, index, last)); 7793 }(points, markers, sqTolerance, 0, len - 1); 7794 var i, newPoints = []; 7795 for (i = 0; i < len; i++) markers[i] && newPoints.push(points[i]); 7796 return newPoints; 7797 }(points = function(points, sqTolerance) { 7798 for (var reducedPoints = [ points[0] ], i = 1, prev = 0, len = points.length; i < len; i++) p1 = points[i], 7799 p2 = points[prev], void 0, dx = p2.x - p1.x, dy = p2.y - p1.y, sqTolerance < dx * dx + dy * dy && (reducedPoints.push(points[i]), 7800 prev = i); 7801 var p1, p2, dx, dy; 7802 prev < len - 1 && reducedPoints.push(points[len - 1]); 7803 return reducedPoints; 7804 }(points, sqTolerance), sqTolerance); 7805 } 7806 function pointToSegmentDistance(p, p1, p2) { 7807 return Math.sqrt(_sqClosestPointOnSegment(p, p1, p2, !0)); 7808 } 7809 function clipSegment(a, b, bounds, useLastCode, round) { 7810 var codeOut, p, newCode, codeA = useLastCode ? _lastCode : _getBitCode(a, bounds), codeB = _getBitCode(b, bounds); 7811 for (_lastCode = codeB; ;) { 7812 if (!(codeA | codeB)) return [ a, b ]; 7813 if (codeA & codeB) return !1; 7814 newCode = _getBitCode(p = _getEdgeIntersection(a, b, codeOut = codeA || codeB, bounds, round), bounds), 7815 codeOut === codeA ? (a = p, codeA = newCode) : (b = p, codeB = newCode); 7816 } 7817 } 7818 function _getEdgeIntersection(a, b, code, bounds, round) { 7819 var x, y, dx = b.x - a.x, dy = b.y - a.y, min = bounds.min, max = bounds.max; 7820 return 8 & code ? (x = a.x + dx * (max.y - a.y) / dy, y = max.y) : 4 & code ? (x = a.x + dx * (min.y - a.y) / dy, 7821 y = min.y) : 2 & code ? (x = max.x, y = a.y + dy * (max.x - a.x) / dx) : 1 & code && (x = min.x, 7822 y = a.y + dy * (min.x - a.x) / dx), new Point(x, y, round); 7823 } 7824 function _getBitCode(p, bounds) { 7825 var code = 0; 7826 return p.x < bounds.min.x ? code |= 1 : p.x > bounds.max.x && (code |= 2), p.y < bounds.min.y ? code |= 4 : p.y > bounds.max.y && (code |= 8), 7827 code; 7828 } 7829 function _sqClosestPointOnSegment(p, p1, p2, sqDist) { 7830 var t, x = p1.x, y = p1.y, dx = p2.x - x, dy = p2.y - y, dot = dx * dx + dy * dy; 7831 return 0 < dot && (1 < (t = ((p.x - x) * dx + (p.y - y) * dy) / dot) ? (x = p2.x, 7832 y = p2.y) : 0 < t && (x += dx * t, y += dy * t)), dx = p.x - x, dy = p.y - y, sqDist ? dx * dx + dy * dy : new Point(x, y); 7833 } 7834 function isFlat(latlngs) { 7835 return !isArray(latlngs[0]) || "object" !== _typeof(latlngs[0][0]) && void 0 !== latlngs[0][0]; 7836 } 7837 function _flat(latlngs) { 7838 return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."), 7839 isFlat(latlngs); 7840 } 7841 var LineUtil = (Object.freeze || Object)({ 7842 simplify: simplify, 7843 pointToSegmentDistance: pointToSegmentDistance, 7844 closestPointOnSegment: function(p, p1, p2) { 7845 return _sqClosestPointOnSegment(p, p1, p2); 7846 }, 7847 clipSegment: clipSegment, 7848 _getEdgeIntersection: _getEdgeIntersection, 7849 _getBitCode: _getBitCode, 7850 _sqClosestPointOnSegment: _sqClosestPointOnSegment, 7851 isFlat: isFlat, 7852 _flat: _flat 7853 }); 7854 function clipPolygon(points, bounds, round) { 7855 var clippedPoints, i, j, k, a, b, len, edge, p, edges = [ 1, 4, 2, 8 ]; 7856 for (i = 0, len = points.length; i < len; i++) points[i]._code = _getBitCode(points[i], bounds); 7857 for (k = 0; k < 4; k++) { 7858 for (edge = edges[k], clippedPoints = [], i = 0, j = (len = points.length) - 1; i < len; j = i++) a = points[i], 7859 b = points[j], a._code & edge ? b._code & edge || ((p = _getEdgeIntersection(b, a, edge, bounds, round))._code = _getBitCode(p, bounds), 7860 clippedPoints.push(p)) : (b._code & edge && ((p = _getEdgeIntersection(b, a, edge, bounds, round))._code = _getBitCode(p, bounds), 7861 clippedPoints.push(p)), clippedPoints.push(a)); 7862 points = clippedPoints; 7863 } 7864 return points; 7865 } 7866 var PolyUtil = (Object.freeze || Object)({ 7867 clipPolygon: clipPolygon 7868 }), LonLat = { 7869 project: function(latlng) { 7870 return new Point(latlng.lng, latlng.lat); 7871 }, 7872 unproject: function(point) {
7873 return new LatLng(point.y, point.x); 7874 }, 7875 bounds: new Bounds([ -180, -90 ], [ 180, 90 ]) 7876 }, Mercator = { 7877 R: 6378137, 7878 R_MINOR: 6356752.314245179, 7879 bounds: new Bounds([ -20037508.34279, -15496570.73972 ], [ 20037508.34279, 18764656.23138 ]), 7880 project: function(latlng) { 7881 var d = Math.PI / 180, r = this.R, y = latlng.lat * d, tmp = this.R_MINOR / r, e = Math.sqrt(1 - tmp * tmp), con = e * Math.sin(y), ts = Math.tan(Math.PI / 4 - y / 2) / Math.pow((1 - con) / (1 + con), e / 2); 7882 return y = -r * Math.log(Math.max(ts, 1e-10)), new Point(latlng.lng * d * r, y); 7883 }, 7884 unproject: function(point) { 7885 for (var con, d = 180 / Math.PI, r = this.R, tmp = this.R_MINOR / r, e = Math.sqrt(1 - tmp * tmp), ts = Math.exp(-point.y / r), phi = Math.PI / 2 - 2 * Math.atan(ts), i = 0, dphi = .1; i < 15 && 1e-7 < Math.abs(dphi); i++) con = e * Math.sin(phi), 7886 con = Math.pow((1 - con) / (1 + con), e / 2), phi += dphi = Math.PI / 2 - 2 * Math.atan(ts * con) - phi; 7887 return new LatLng(phi * d, point.x * d / r); 7888 } 7889 }, index = (Object.freeze || Object)({ 7890 LonLat: LonLat, 7891 Mercator: Mercator, 7892 SphericalMercator: SphericalMercator 7893 }), EPSG3395 = extend({}, Earth, { 7894 code: "EPSG:3395", 7895 projection: Mercator, 7896 transformation: function() { 7897 var scale = .5 / (Math.PI * Mercator.R); 7898 return toTransformation(scale, .5, -scale, .5); 7899 }() 7900 }), EPSG4326 = extend({}, Earth, { 7901 code: "EPSG:4326", 7902 projection: LonLat, 7903 transformation: toTransformation(1 / 180, 1, -1 / 180, .5) 7904 }), Simple = extend({}, CRS, { 7905 projection: LonLat, 7906 transformation: toTransformation(1, 0, -1, 0), 7907 scale: function(zoom) { 7908 return Math.pow(2, zoom); 7909 }, 7910 zoom: function(scale) { 7911 return Math.log(scale) / Math.LN2; 7912 }, 7913 distance: function(latlng1, latlng2) { 7914 var dx = latlng2.lng - latlng1.lng, dy = latlng2.lat - latlng1.lat; 7915 return Math.sqrt(dx * dx + dy * dy); 7916 }, 7917 infinite: !0 7918 }); 7919 CRS.Earth = Earth, CRS.EPSG3395 = EPSG3395, CRS.EPSG3857 = EPSG3857, CRS.EPSG900913 = EPSG900913, 7920 CRS.EPSG4326 = EPSG4326, CRS.Simple = Simple; 7921 var Layer = Evented.extend({ 7922 options: { 7923 pane: "overlayPane", 7924 attribution: null, 7925 bubblingMouseEvents: !0 7926 }, 7927 addTo: function(map) { 7928 return map.addLayer(this), this; 7929 }, 7930 remove: function() { 7931 return this.removeFrom(this._map || this._mapToAdd); 7932 }, 7933 removeFrom: function(obj) { 7934 return obj && obj.removeLayer(this), this; 7935 }, 7936 getPane: function(name) { 7937 return this._map.getPane(name ? this.options[name] || name : this.options.pane); 7938 }, 7939 addInteractiveTarget: function(targetEl) { 7940 return this._map._targets[stamp(targetEl)] = this; 7941 }, 7942 removeInteractiveTarget: function(targetEl) { 7943 return delete this._map._targets[stamp(targetEl)], this; 7944 }, 7945 getAttribution: function() { 7946 return this.options.attribution; 7947 }, 7948 _layerAdd: function(e) { 7949 var map = e.target; 7950 if (map.hasLayer(this)) { 7951 if (this._map = map, this._zoomAnimated = map._zoomAnimated, this.getEvents) { 7952 var events = this.getEvents(); 7953 map.on(events, this), this.once("remove", function() { 7954 map.off(events, this); 7955 }, this); 7956 }
7957 this.onAdd(map), this.getAttribution && map.attributionControl && map.attributionControl.addAttribution(this.getAttribution()), 7958 this.fire("add"), map.fire("layeradd", { 7959 layer: this 7960 }); 7961 } 7962 } 7963 }); 7964 Map.include({ 7965 addLayer: function(layer) { 7966 if (!layer._layerAdd) throw new Error("The provided object is not a Layer."); 7967 var id = stamp(layer); 7968 return this._layers[id] || ((this._layers[id] = layer)._mapToAdd = this, layer.beforeAdd && layer.beforeAdd(this), 7969 this.whenReady(layer._layerAdd, layer)), this; 7970 }, 7971 removeLayer: function(layer) { 7972 var id = stamp(layer); 7973 return this._layers[id] && (this._loaded && layer.onRemove(this), layer.getAttribution && this.attributionControl && this.attributionControl.removeAttribution(layer.getAttribution()), 7974 delete this._layers[id], this._loaded && (this.fire("layerremove", { 7975 layer: layer 7976 }), layer.fire("remove")), layer._map = layer._mapToAdd = null), this; 7977 }, 7978 hasLayer: function(layer) { 7979 return !!layer && stamp(layer) in this._layers; 7980 }, 7981 eachLayer: function(method, context) { 7982 for (var i in this._layers) method.call(context, this._layers[i]); 7983 return this; 7984 }, 7985 _addLayers: function(layers) { 7986 for (var i = 0, len = (layers = layers ? isArray(layers) ? layers : [ layers ] : []).length; i < len; i++) this.addLayer(layers[i]); 7987 }, 7988 _addZoomLimit: function(layer) { 7989 !isNaN(layer.options.maxZoom) && isNaN(layer.options.minZoom) || (this._zoomBoundLayers[stamp(layer)] = layer, 7990 this._updateZoomLevels()); 7991 }, 7992 _removeZoomLimit: function(layer) { 7993 var id = stamp(layer); 7994 this._zoomBoundLayers[id] && (delete this._zoomBoundLayers[id], this._updateZoomLevels()); 7995 }, 7996 _updateZoomLevels: function() { 7997 var minZoom = 1 / 0, maxZoom = -1 / 0, oldZoomSpan = this._getZoomSpan(); 7998 for (var i in this._zoomBoundLayers) { 7999 var options = this._zoomBoundLayers[i].options; 8000 minZoom = void 0 === options.minZoom ? minZoom : Math.min(minZoom, options.minZoom), 8001 maxZoom = void 0 === options.maxZoom ? maxZoom : Math.max(maxZoom, options.maxZoom); 8002 } 8003 this._layersMaxZoom = maxZoom === -1 / 0 ? void 0 : maxZoom, this._layersMinZoom = minZoom === 1 / 0 ? void 0 : minZoom, 8004 oldZoomSpan !== this._getZoomSpan() && this.fire("zoomlevelschange"), void 0 === this.options.maxZoom && this._layersMaxZoom && this.getZoom() > this._layersMaxZoom && this.setZoom(this._layersMaxZoom), 8005 void 0 === this.options.minZoom && this._layersMinZoom && this.getZoom() < this._layersMinZoom && this.setZoom(this._layersMinZoom); 8006 } 8007 }); 8008 var LayerGroup = Layer.extend({ 8009 initialize: function(layers, options) { 8010 var i, len; 8011 if (setOptions(this, options), this._layers = {}, layers) for (i = 0, len = layers.length; i < len; i++) this.addLayer(layers[i]); 8012 }, 8013 addLayer: function(layer) { 8014 var id = this.getLayerId(layer); 8015 return this._layers[id] = layer, this._map && this._map.addLayer(layer), this; 8016 }, 8017 removeLayer: function(layer) { 8018 var id = layer in this._layers ? layer : this.getLayerId(layer); 8019 return this._map && this._layers[id] && this._map.removeLayer(this._layers[id]), 8020 delete this._layers[id], this; 8021 }, 8022 hasLayer: function(layer) { 8023 return !!layer && (layer in this._layers || this.getLayerId(layer) in this._layers); 8024 }, 8025 clearLayers: function() { 8026 return this.eachLayer(this.removeLayer, this); 8027 }, 8028 invoke: function(methodName) { 8029 var i, layer, args = Array.prototype.slice.call(arguments, 1); 8030 for (i in this._layers) (layer = this._layers[i])[methodName] && layer[methodName].apply(layer, args); 8031 return this; 8032 }, 8033 onAdd: function(map) { 8034 this.eachLayer(map.addLayer, map); 8035 }, 8036 onRemove: function(map) { 8037 this.eachLayer(map.removeLayer, map); 8038 }, 8039 eachLayer: function(method, context) { 8040 for (var i in this._layers) method.call(context, this._layers[i]); 8041 return this; 8042 }, 8043 getLayer: function(id) { 8044 return this._layers[id]; 8045 }, 8046 getLayers: function() { 8047 var layers = []; 8048 return this.eachLayer(layers.push, layers), layers; 8049 }, 8050 setZIndex: function(zIndex) { 8051 return this.invoke("setZIndex", zIndex); 8052 }, 8053 getLayerId: function(layer) { 8054 return stamp(layer); 8055 } 8056 }), FeatureGroup = LayerGroup.extend({ 8057 addLayer: function(layer) {
8058 return this.hasLayer(layer) ? this : (layer.addEventParent(this), LayerGroup.prototype.addLayer.call(this, layer), 8059 this.fire("layeradd", { 8060 layer: layer 8061 })); 8062 }, 8063 removeLayer: function(layer) { 8064 return this.hasLayer(layer) ? (layer in this._layers && (layer = this._layers[layer]), 8065 layer.removeEventParent(this), LayerGroup.prototype.removeLayer.call(this, layer), 8066 this.fire("layerremove", { 8067 layer: layer 8068 })) : this; 8069 }, 8070 setStyle: function(style) { 8071 return this.invoke("setStyle", style); 8072 }, 8073 bringToFront: function() { 8074 return this.invoke("bringToFront"); 8075 }, 8076 bringToBack: function() { 8077 return this.invoke("bringToBack"); 8078 }, 8079 getBounds: function() { 8080 var bounds = new LatLngBounds(); 8081 for (var id in this._layers) { 8082 var layer = this._layers[id]; 8083 bounds.extend(layer.getBounds ? layer.getBounds() : layer.getLatLng()); 8084 } 8085 return bounds; 8086 } 8087 }), Icon = Class.extend({ 8088 options: { 8089 popupAnchor: [ 0, 0 ], 8090 tooltipAnchor: [ 0, 0 ] 8091 }, 8092 initialize: function(options) { 8093 setOptions(this, options); 8094 }, 8095 createIcon: function(oldIcon) { 8096 return this._createIcon("icon", oldIcon); 8097 }, 8098 createShadow: function(oldIcon) { 8099 return this._createIcon("shadow", oldIcon); 8100 }, 8101 _createIcon: function(name, oldIcon) { 8102 var src = this._getIconUrl(name); 8103 if (!src) { 8104 if ("icon" === name) throw new Error("iconUrl not set in Icon options (see the docs)."); 8105 return null; 8106 } 8107 var img = this._createImg(src, oldIcon && "IMG" === oldIcon.tagName ? oldIcon : null); 8108 return this._setIconStyles(img, name), img; 8109 }, 8110 _setIconStyles: function(img, name) { 8111 var options = this.options, sizeOption = options[name + "Size"]; 8112 "number" == typeof sizeOption && (sizeOption = [ sizeOption, sizeOption ]); 8113 var size = toPoint(sizeOption), anchor = toPoint("shadow" === name && options.shadowAnchor || options.iconAnchor || size && size.divideBy(2, !0)); 8114 img.className = "leaflet-marker-" + name + " " + (options.className || ""), anchor && (img.style.marginLeft = -anchor.x + "px", 8115 img.style.marginTop = -anchor.y + "px"), size && (img.style.width = size.x + "px", 8116 img.style.height = size.y + "px"); 8117 }, 8118 _createImg: function(src, el) { 8119 return (el = el || document.createElement("img")).src = src, el; 8120 }, 8121 _getIconUrl: function(name) { 8122 return retina && this.options[name + "RetinaUrl"] || this.options[name + "Url"]; 8123 } 8124 }); 8125 var IconDefault = Icon.extend({ 8126 options: { 8127 iconUrl: "marker-icon.png", 8128 iconRetinaUrl: "marker-icon-2x.png", 8129 shadowUrl: "marker-shadow.png", 8130 iconSize: [ 25, 41 ], 8131 iconAnchor: [ 12, 41 ], 8132 popupAnchor: [ 1, -34 ], 8133 tooltipAnchor: [ 16, -28 ], 8134 shadowSize: [ 41, 41 ] 8135 }, 8136 _getIconUrl: function(name) { 8137 return IconDefault.imagePath || (IconDefault.imagePath = this._detectIconPath()), 8138 (this.options.imagePath || IconDefault.imagePath) + Icon.prototype._getIconUrl.call(this, name); 8139 }, 8140 _detectIconPath: function() { 8141 var el = create$1("div", "leaflet-default-icon-path", document.body), path = getStyle(el, "background-image") || getStyle(el, "backgroundImage"); 8142 return document.body.removeChild(el), path = null === path || 0 !== path.indexOf("url") ? "" : path.replace(/^url\(["']?/, "").replace(/marker-icon\.png["']?\)$/, ""); 8143 } 8144 }), MarkerDrag = Handler.extend({ 8145 initialize: function(marker) { 8146 this._marker = marker; 8147 }, 8148 addHooks: function() { 8149 var icon = this._marker._icon; 8150 this._draggable || (this._draggable = new Draggable(icon, icon, !0)), this._draggable.on({ 8151 dragstart: this._onDragStart, 8152 predrag: this._onPreDrag, 8153 drag: this._onDrag, 8154 dragend: this._onDragEnd 8155 }, this).enable(), addClass(icon, "leaflet-marker-draggable"); 8156 }, 8157 removeHooks: function() { 8158 this._draggable.off({ 8159 dragstart: this._onDragStart, 8160 predrag: this._onPreDrag, 8161 drag: this._onDrag, 8162 dragend: this._onDragEnd 8163 }, this).disable(), this._marker._icon && removeClass(this._marker._icon, "leaflet-marker-draggable"); 8164 }, 8165 moved: function() { 8166 return this._draggable && this._draggable._moved; 8167 }, 8168 _adjustPan: function(e) { 8169 var marker = this._marker, map = marker._map, speed = this._marker.options.autoPanSpeed, padding = this._marker.options.autoPanPadding, iconPos = getPosition(marker._icon), bounds = map.getPixelBounds(), origin = map.getPixelOrigin(), panBounds = toBounds(bounds.min._subtract(origin).add(padding), bounds.max._subtract(origin).subtract(padding)); 8170 if (!panBounds.contains(iconPos)) { 8171 var movement = toPoint((Math.max(panBounds.max.x, iconPos.x) - panBounds.max.x) / (bounds.max.x - panBounds.max.x) - (Math.min(panBounds.min.x, iconPos.x) - panBounds.min.x) / (bounds.min.x - panBounds.min.x), (Math.max(panBounds.max.y, iconPos.y) - panBounds.max.y) / (bounds.max.y - panBounds.max.y) - (Math.min(panBounds.min.y, iconPos.y) - panBounds.min.y) / (bounds.min.y - panBounds.min.y)).multiplyBy(speed); 8172 map.panBy(movement, { 8173 animate: !1 8174 }), this._draggable._newPos._add(movement), this._draggable._startPos._add(movement), 8175 setPosition(marker._icon, this._draggable._newPos), this._onDrag(e), this._panRequest = requestAnimFrame
8175(this._adjustPan.bind(this, e)); 8176 } 8177 }, 8178 _onDragStart: function() { 8179 this._oldLatLng = this._marker.getLatLng(), this._marker.closePopup().fire("movestart").fire("dragstart"); 8180 }, 8181 _onPreDrag: function(e) { 8182 this._marker.options.autoPan && (cancelAnimFrame(this._panRequest), this._panRequest = requestAnimFrame(this._adjustPan.bind(this, e))); 8183 }, 8184 _onDrag: function(e) { 8185 var marker = this._marker, shadow = marker._shadow, iconPos = getPosition(marker._icon), latlng = marker._map.layerPointToLatLng(iconPos); 8186 shadow && setPosition(shadow, iconPos), marker._latlng = latlng, e.latlng = latlng, 8187 e.oldLatLng = this._oldLatLng, marker.fire("move", e).fire("drag", e); 8188 }, 8189 _onDragEnd: function(e) { 8190 cancelAnimFrame(this._panRequest), delete this._oldLatLng, this._marker.fire("moveend").fire("dragend", e); 8191 } 8192 }), Marker = Layer.extend({ 8193 options: { 8194 icon: new IconDefault(), 8195 interactive: !0, 8196 keyboard: !0, 8197 title: "", 8198 alt: "", 8199 zIndexOffset: 0, 8200 opacity: 1, 8201 riseOnHover: !1, 8202 riseOffset: 250, 8203 pane: "markerPane", 8204 shadowPane: "shadowPane", 8205 bubblingMouseEvents: !1, 8206 draggable: !1, 8207 autoPan: !1, 8208 autoPanPadding: [ 50, 50 ], 8209 autoPanSpeed: 10 8210 }, 8211 initialize: function(latlng, options) { 8212 setOptions(this, options), this._latlng = toLatLng(latlng); 8213 }, 8214 onAdd: function(map) { 8215 this._zoomAnimated = this._zoomAnimated && map.options.markerZoomAnimation, this._zoomAnimated && map.on("zoomanim", this._animateZoom, this), 8216 this._initIcon(), this.update(); 8217 }, 8218 onRemove: function(map) { 8219 this.dragging && this.dragging.enabled() && (this.options.draggable = !0, this.dragging.removeHooks()), 8220 delete this.dragging, this._zoomAnimated && map.off("zoomanim", this._animateZoom, this), 8221 this._removeIcon(), this._removeShadow(); 8222 }, 8223 getEvents: function() { 8224 return { 8225 zoom: this.update, 8226 viewreset: this.update 8227 }; 8228 }, 8229 getLatLng: function() { 8230 return this._latlng; 8231 }, 8232 setLatLng: function(latlng) { 8233 var oldLatLng = this._latlng; 8234 return this._latlng = toLatLng(latlng), this.update(), this.fire("move", { 8235 oldLatLng: oldLatLng, 8236 latlng: this._latlng 8237 }); 8238 }, 8239 setZIndexOffset: function(offset) { 8240 return this.options.zIndexOffset = offset, this.update(); 8241 }, 8242 getIcon: function() { 8243 return this.options.icon; 8244 }, 8245 setIcon: function(icon) { 8246 return this.options.icon = icon, this._map && (this._initIcon(), this.update()), 8247 this._popup && this.bindPopup(this._popup, this._popup.options), this; 8248 }, 8249 getElement: function() { 8250 return this._icon; 8251 }, 8252 update: function() { 8253 if (this._icon && this._map) { 8254 var pos = this._map.latLngToLayerPoint(this._latlng).round(); 8255 this._setPos(pos); 8256 } 8257 return this; 8258 }, 8259 _initIcon: function() { 8260 var options = this.options, classToAdd = "leaflet-zoom-" + (this._zoomAnimated ? "animated" : "hide"), icon = options.icon.createIcon(this._icon), addIcon = !1; 8261 icon !== this._icon && (this._icon && this._removeIcon(), addIcon = !0, options.title && (icon.title = options.title), 8262 "IMG" === icon.tagName && (icon.alt = options.alt || "")), addClass(icon, classToAdd), 8263 options.keyboard && (icon.tabIndex = "0"), this._icon = icon, options.riseOnHover && this.on({ 8264 mouseover: this._bringToFront, 8265 mouseout: this._resetZIndex 8266 }); 8267 var newShadow = options.icon.createShadow(this._shadow), addShadow = !1; 8268 newShadow !== this._shadow && (this._removeShadow(), addShadow = !0), newShadow && (addClass(newShadow, classToAdd), 8269 newShadow.alt = ""), this._shadow = newShadow, options.opacity < 1 && this._updateOpacity(), 8270 addIcon && this.getPane().appendChild(this._icon), this._initInteraction(), newShadow && addShadow && this.getPane(options.shadowPane).appendChild(this._shadow); 8271 }, 8272 _removeIcon: function() { 8273 this.options.riseOnHover && this.off({ 8274 mouseover: this._bringToFront, 8275 mouseout: this._resetZIndex 8276 }), _remove(this._icon), this.removeInteractiveTarget(this._icon), this._icon = null; 8277 }, 8278 _removeShadow: function() { 8279 this._shadow && _remove(this._shadow), this._shadow = null; 8280 }, 8281 _setPos: function(pos) { 8282 setPosition(this._icon, pos), this._shadow && setPosition(this._shadow, pos), this._zIndex = pos.y + this.options.zIndexOffset, 8283 this._resetZIndex(); 8284 }, 8285 _updateZIndex: function(offset) { 8286 this._icon.style.zIndex = this._zIndex + offset; 8287 }, 8288 _animateZoom: function(opt) { 8289 var pos = this._map._latLngToNewLayerPoint(this._latlng, opt.zoom, opt.center).round(); 8290 this._setPos(pos); 8291 }, 8292 _initInteraction: function() { 8293 if (this.options.interactive && (addClass(this._icon, "leaflet-interactive"), this.addInteractiveTarget(this._icon), 8294 MarkerDrag)) { 8295 var draggable = this.options.draggable; 8296 this.dragging && (draggable = this.dragging.enabled(), this.dragging.disable()), 8297 this.dragging = new MarkerDrag(this), draggable && this.dragging.enable(); 8298 } 8299 }, 8300 setOpacity: function(opacity) { 8301 return this.options.opacity = opacity, this._map && this._updateOpacity(), this; 8302 }, 8303 _updateOpacity: function() { 8304 var opacity = this.options.opacity; 8305 this._icon && _setOpacity(this._icon, opacity), this._shadow && _setOpacity(this._shadow, opacity); 8306 }, 8307 _bringToFront: function() { 8308 this._updateZIndex(this.options.riseOffset); 8309 }, 8310 _resetZIndex: function() { 8311 this._updateZIndex(0); 8312 }, 8313 _getPopupAnchor: function() { 8314 return this.options.icon.options.popupAnchor; 8315 }, 8316 _getTooltipAnchor: function() { 8317 return this.options.icon.options.tooltipAnchor; 8318 } 8319 });
8320 var Path = Layer.extend({ 8321 options: { 8322 stroke: !0, 8323 color: "#3388ff", 8324 weight: 3, 8325 opacity: 1, 8326 lineCap: "round", 8327 lineJoin: "round", 8328 dashArray: null, 8329 dashOffset: null, 8330 fill: !1, 8331 fillColor: null, 8332 fillOpacity: .2, 8333 fillRule: "evenodd", 8334 interactive: !0, 8335 bubblingMouseEvents: !0 8336 }, 8337 beforeAdd: function(map) { 8338 this._renderer = map.getRenderer(this); 8339 }, 8340 onAdd: function() { 8341 this._renderer._initPath(this), this._reset(), this._renderer._addPath(this); 8342 }, 8343 onRemove: function() { 8344 this._renderer._removePath(this); 8345 }, 8346 redraw: function() { 8347 return this._map && this._renderer._updatePath(this), this; 8348 }, 8349 setStyle: function(style) { 8350 return setOptions(this, style), this._renderer && (this._renderer._updateStyle(this), 8351 this.options.stroke && style.hasOwnProperty("weight") && this._updateBounds()), 8352 this; 8353 }, 8354 bringToFront: function() { 8355 return this._renderer && this._renderer._bringToFront(this), this; 8356 }, 8357 bringToBack: function() { 8358 return this._renderer && this._renderer._bringToBack(this), this; 8359 }, 8360 getElement: function() { 8361 return this._path; 8362 }, 8363 _reset: function() { 8364 this._project(), this._update(); 8365 }, 8366 _clickTolerance: function() { 8367 return (this.options.stroke ? this.options.weight / 2 : 0) + this._renderer.options.tolerance; 8368 } 8369 }), CircleMarker = Path.extend({ 8370 options: { 8371 fill: !0, 8372 radius: 10 8373 }, 8374 initialize: function(latlng, options) { 8375 setOptions(this, options), this._latlng = toLatLng(latlng), this._radius = this.options.radius; 8376 }, 8377 setLatLng: function(latlng) { 8378 return this._latlng = toLatLng(latlng), this.redraw(), this.fire("move", { 8379 latlng: this._latlng 8380 }); 8381 }, 8382 getLatLng: function() { 8383 return this._latlng; 8384 }, 8385 setRadius: function(radius) { 8386 return this.options.radius = this._radius = radius, this.redraw(); 8387 }, 8388 getRadius: function() { 8389 return this._radius; 8390 }, 8391 setStyle: function(options) { 8392 var radius = options && options.radius || this._radius; 8393 return Path.prototype.setStyle.call(this, options), this.setRadius(radius), this; 8394 }, 8395 _project: function() { 8396 this._point = this._map.latLngToLayerPoint(this._latlng), this._updateBounds(); 8397 }, 8398 _updateBounds: function() { 8399 var r = this._radius, r2 = this._radiusY || r, w = this._clickTolerance(), p = [ r + w, r2 + w ]; 8400 this._pxBounds = new Bounds(this._point.subtract(p), this._point.add(p)); 8401 }, 8402 _update: function() { 8403 this._map && this._updatePath(); 8404 }, 8405 _updatePath: function() { 8406 this._renderer._updateCircle(this); 8407 }, 8408 _empty: function() { 8409 return this._radius && !this._renderer._bounds.intersects(this._pxBounds); 8410 }, 8411 _containsPoint: function(p) { 8412 return p.distanceTo(this._point) <= this._radius + this._clickTolerance(); 8413 } 8414 }); 8415 var Circle = CircleMarker.extend({ 8416 initialize: function(latlng, options, legacyOptions) { 8417 if ("number" == typeof options && (options = extend({}, legacyOptions, { 8418 radius: options 8419 })), setOptions(this, options), this._latlng = toLatLng(latlng), isNaN(this.options.radius)) throw new Error("Circle radius cannot be NaN"); 8420 this._mRadius = this.options.radius; 8421 }, 8422 setRadius: function(radius) {
8423 return this._mRadius = radius, this.redraw(); 8424 }, 8425 getRadius: function() { 8426 return this._mRadius; 8427 }, 8428 getBounds: function() { 8429 var half = [ this._radius, this._radiusY || this._radius ]; 8430 return new LatLngBounds(this._map.layerPointToLatLng(this._point.subtract(half)), this._map.layerPointToLatLng(this._point.add(half))); 8431 }, 8432 setStyle: Path.prototype.setStyle, 8433 _project: function() { 8434 var lng = this._latlng.lng, lat = this._latlng.lat, map = this._map, crs = map.options.crs; 8435 if (crs.distance === Earth.distance) { 8436 var d = Math.PI / 180, latR = this._mRadius / Earth.R / d, top = map.project([ lat + latR, lng ]), bottom = map.project([ lat - latR, lng ]), p = top.add(bottom).divideBy(2), lat2 = map.unproject(p).lat, lngR = Math.acos((Math.cos(latR * d) - Math.sin(lat * d) * Math.sin(lat2 * d)) / (Math.cos(lat * d) * Math.cos(lat2 * d))) / d; 8437 !isNaN(lngR) && 0 !== lngR || (lngR = latR / Math.cos(Math.PI / 180 * lat)), this._point = p.subtract(map.getPixelOrigin()), 8438 this._radius = isNaN(lngR) ? 0 : p.x - map.project([ lat2, lng - lngR ]).x, this._radiusY = p.y - top.y; 8439 } else { 8440 var latlng2 = crs.unproject(crs.project(this._latlng).subtract([ this._mRadius, 0 ])); 8441 this._point = map.latLngToLayerPoint(this._latlng), this._radius = this._point.x - map.latLngToLayerPoint(latlng2).x; 8442 } 8443 this._updateBounds(); 8444 } 8445 }); 8446 var Polyline = Path.extend({ 8447 options: { 8448 smoothFactor: 1, 8449 noClip: !1 8450 }, 8451 initialize: function(latlngs, options) { 8452 setOptions(this, options), this._setLatLngs(latlngs); 8453 }, 8454 getLatLngs: function() { 8455 return this._latlngs; 8456 }, 8457 setLatLngs: function(latlngs) { 8458 return this._setLatLngs(latlngs), this.redraw(); 8459 }, 8460 isEmpty: function() { 8461 return !this._latlngs.length; 8462 }, 8463 closestLayerPoint: function(p) { 8464 for (var p1, p2, minDistance = 1 / 0, minPoint = null, closest = _sqClosestPointOnSegment, j = 0, jLen = this._parts.length; j < jLen; j++) for (var points = this._parts[j], i = 1, len = points.length; i < len; i++) { 8465 var sqDist = closest(p, p1 = points[i - 1], p2 = points[i], !0); 8466 sqDist < minDistance && (minDistance = sqDist, minPoint = closest(p, p1, p2)); 8467 } 8468 return minPoint && (minPoint.distance = Math.sqrt(minDistance)), minPoint; 8469 }, 8470 getCenter: function() {
8471 if (!this._map) throw new Error("Must add layer to map before using getCenter()"); 8472 var i, halfDist, segDist, dist, p1, p2, ratio, points = this._rings[0], len = points.length; 8473 if (!len) return null; 8474 for (halfDist = i = 0; i < len - 1; i++) halfDist += points[i].distanceTo(points[i + 1]) / 2; 8475 if (0 === halfDist) return this._map.layerPointToLatLng(points[0]); 8476 for (dist = i = 0; i < len - 1; i++) if (p1 = points[i], p2 = points[i + 1], halfDist < (dist += segDist = p1.distanceTo(p2))) return ratio = (dist - halfDist) / segDist, 8477 this._map.layerPointToLatLng([ p2.x - ratio * (p2.x - p1.x), p2.y - ratio * (p2.y - p1.y) ]); 8478 }, 8479 getBounds: function() { 8480 return this._bounds; 8481 }, 8482 addLatLng: function(latlng, latlngs) { 8483 return latlngs = latlngs || this._defaultShape(), latlng = toLatLng(latlng), latlngs.push(latlng), 8484 this._bounds.extend(latlng), this.redraw(); 8485 }, 8486 _setLatLngs: function(latlngs) { 8487 this._bounds = new LatLngBounds(), this._latlngs = this._convertLatLngs(latlngs); 8488 }, 8489 _defaultShape: function() { 8490 return isFlat(this._latlngs) ? this._latlngs : this._latlngs[0]; 8491 }, 8492 _convertLatLngs: function(latlngs) { 8493 for (var result = [], flat = isFlat(latlngs), i = 0, len = latlngs.length; i < len; i++) flat ? (result[i] = toLatLng(latlngs[i]), 8494 this._bounds.extend(result[i])) : result[i] = this._convertLatLngs(latlngs[i]); 8495 return result; 8496 }, 8497 _project: function() { 8498 var pxBounds = new Bounds(); 8499 this._rings = [], this._projectLatlngs(this._latlngs, this._rings, pxBounds), this._bounds.isValid() && pxBounds.isValid() && (this._rawPxBounds = pxBounds, 8500 this._updateBounds()); 8501 }, 8502 _updateBounds: function() { 8503 var w = this._clickTolerance(), p = new Point(w, w); 8504 this._pxBounds = new Bounds([ this._rawPxBounds.min.subtract(p), this._rawPxBounds.max.add(p) ]); 8505 }, 8506 _projectLatlngs: function(latlngs, result, projectedBounds) { 8507 var i, ring, flat = latlngs[0] instanceof LatLng, len = latlngs.length; 8508 if (flat) { 8509 for (ring = [], i = 0; i < len; i++) ring[i] = this._map.latLngToLayerPoint(latlngs[i]), 8510 projectedBounds.extend(ring[i]); 8511 result.push(ring); 8512 } else for (i = 0; i < len; i++) this._projectLatlngs(latlngs[i], result, projectedBounds); 8513 }, 8514 _clipPoints: function() { 8515 var bounds = this._renderer._bounds; 8516 if (this._parts = [], this._pxBounds && this._pxBounds.intersects(bounds)) if (this.options.noClip) this._parts = this._rings; else { 8517 var i, j, k, len, len2, segment, points, parts = this._parts; 8518 for (k = i = 0, len = this._rings.length; i < len; i++) for (j = 0, len2 = (points = this._rings[i]).length; j < len2 - 1; j++) (segment = clipSegment(points[j], points[j + 1], bounds, j, !0)) && (parts[k] = parts[k] || [], 8519 parts[k].push(segment[0]), segment[1] === points[j + 1] && j !== len2 - 2 || (parts[k].push(segment[1]), 8520 k++)); 8521 } 8522 }, 8523 _simplifyPoints: function() { 8524 for (var parts = this._parts, tolerance = this.options.smoothFactor, i = 0, len = parts.length; i < len; i++) parts[i] = simplify(parts[i], tolerance); 8525 }, 8526 _update: function() { 8527 this._map && (this._clipPoints(), this._simplifyPoints(), this._updatePath()); 8528 }, 8529 _updatePath: function() { 8530 this._renderer._updatePoly(this); 8531 }, 8532 _containsPoint: function(p, closed) { 8533 var i, j, k, len, len2, part, w = this._clickTolerance(); 8534 if (!this._pxBounds || !this._pxBounds.contains(p)) return !1; 8535 for (i = 0, len = this._parts.length; i < len; i++) for (j = 0, k = (len2 = (part = this._parts[i]).length) - 1; j < len2; k = j++) if ((closed || 0 !== j) && pointToSegmentDistance(p, part[k], part[j]) <= w) return !0; 8536 return !1; 8537 } 8538 }); 8539 Polyline._flat = _flat; 8540 var Polygon = Polyline.extend({ 8541 options: { 8542 fill: !0 8543 }, 8544 isEmpty: function() { 8545 return !this._latlngs.length || !this._latlngs[0].length; 8546 }, 8547 getCenter: function() {
8548 if (!this._map) throw new Error("Must add layer to map before using getCenter()"); 8549 var i, j, p1, p2, f, area, x, y, center, points = this._rings[0], len = points.length; 8550 if (!len) return null; 8551 for (area = x = y = 0, i = 0, j = len - 1; i < len; j = i++) p1 = points[i], p2 = points[j], 8552 f = p1.y * p2.x - p2.y * p1.x, x += (p1.x + p2.x) * f, y += (p1.y + p2.y) * f, area += 3 * f; 8553 return center = 0 === area ? points[0] : [ x / area, y / area ], this._map.layerPointToLatLng(center); 8554 }, 8555 _convertLatLngs: function(latlngs) { 8556 var result = Polyline.prototype._convertLatLngs.call(this, latlngs), len = result.length; 8557 return 2 <= len && result[0] instanceof LatLng && result[0].equals(result[len - 1]) && result.pop(), 8558 result; 8559 }, 8560 _setLatLngs: function(latlngs) { 8561 Polyline.prototype._setLatLngs.call(this, latlngs), isFlat(this._latlngs) && (this._latlngs = [ this._latlngs ]); 8562 }, 8563 _defaultShape: function() { 8564 return isFlat(this._latlngs[0]) ? this._latlngs[0] : this._latlngs[0][0]; 8565 }, 8566 _clipPoints: function() { 8567 var bounds = this._renderer._bounds, w = this.options.weight, p = new Point(w, w); 8568 if (bounds = new Bounds(bounds.min.subtract(p), bounds.max.add(p)), this._parts = [], 8569 this._pxBounds && this._pxBounds.intersects(bounds)) if (this.options.noClip) this._parts = this._rings; else for (var clipped, i = 0, len = this._rings.length; i < len; i++) (clipped = clipPolygon(this._rings[i], bounds, !0)).length && this._parts.push(clipped); 8570 }, 8571 _updatePath: function() { 8572 this._renderer._updatePoly(this, !0); 8573 }, 8574 _containsPoint: function(p) { 8575 var part, p1, p2, i, j, k, len, len2, inside = !1; 8576 if (!this._pxBounds || !this._pxBounds.contains(p)) return !1; 8577 for (i = 0, len = this._parts.length; i < len; i++) for (j = 0, k = (len2 = (part = this._parts[i]).length) - 1; j < len2; k = j++) p1 = part[j], 8578 p2 = part[k], p1.y > p.y != p2.y > p.y && p.x < (p2.x - p1.x) * (p.y - p1.y) / (p2.y - p1.y) + p1.x && (inside = !inside); 8579 return inside || Polyline.prototype._containsPoint.call(this, p, !0); 8580 } 8581 }); 8582 var GeoJSON = FeatureGroup.extend({ 8583 initialize: function(geojson, options) { 8584 setOptions(this, options), this._layers = {}, geojson && this.addData(geojson); 8585 }, 8586 addData: function(geojson) { 8587 var i, len, feature, features = isArray(geojson) ? geojson : geojson.features; 8588 if (features) { 8589 for (i = 0, len = features.length; i < len; i++) ((feature = features[i]).geometries || feature.geometry || feature.features || feature.coordinates) && this.addData(feature); 8590 return this; 8591 } 8592 var options = this.options; 8593 if (options.filter && !options.filter(geojson)) return this; 8594 var layer = geometryToLayer(geojson, options); 8595 return layer ? (layer.feature = asFeature(geojson), layer.defaultOptions = layer.options, 8596 this.resetStyle(layer), options.onEachFeature && options.onEachFeature(geojson, layer), 8597 this.addLayer(layer)) : this; 8598 }, 8599 resetStyle: function(layer) { 8600 return layer.options = extend({}, layer.defaultOptions), this._setLayerStyle(layer, this.options.style), 8601 this; 8602 }, 8603 setStyle: function(style) { 8604 return this.eachLayer(function(layer) { 8605 this._setLayerStyle(layer, style); 8606 }, this); 8607 }, 8608 _setLayerStyle: function(layer, style) { 8609 layer.setStyle && ("function" == typeof style && (style = style(layer.feature)), 8610 layer.setStyle(style)); 8611 } 8612 }); 8613 function geometryToLayer(geojson, options) { 8614 var latlng, latlngs, i, len, geometry = "Feature" === geojson.type ? geojson.geometry : geojson, coords = geometry ? geometry.coordinates : null, layers = [], pointToLayer = options && options.pointToLayer, _coordsToLatLng = options && options.coordsToLatLng || coordsToLatLng; 8615 if (!coords && !geometry) return null; 8616 switch (geometry.type) { 8617 case "Point": 8618 return latlng = _coordsToLatLng(coords), pointToLayer ? pointToLayer(geojson, latlng) : new Marker(latlng); 8619 8620 case "MultiPoint":
8621 for (i = 0, len = coords.length; i < len; i++) latlng = _coordsToLatLng(coords[i]), 8622 layers.push(pointToLayer ? pointToLayer(geojson, latlng) : new Marker(latlng)); 8623 return new FeatureGroup(layers); 8624 8625 case "LineString": 8626 case "MultiLineString": 8627 return latlngs = coordsToLatLngs(coords, "LineString" === geometry.type ? 0 : 1, _coordsToLatLng), 8628 new Polyline(latlngs, options); 8629 8630 case "Polygon": 8631 case "MultiPolygon": 8632 return latlngs = coordsToLatLngs(coords, "Polygon" === geometry.type ? 1 : 2, _coordsToLatLng), 8633 new Polygon(latlngs, options); 8634 8635 case "GeometryCollection": 8636 for (i = 0, len = geometry.geometries.length; i < len; i++) { 8637 var layer = geometryToLayer({ 8638 geometry: geometry.geometries[i], 8639 type: "Feature", 8640 properties: geojson.properties 8641 }, options); 8642 layer && layers.push(layer); 8643 } 8644 return new FeatureGroup(layers); 8645 8646 default: 8647 throw new Error("Invalid GeoJSON object."); 8648 } 8649 } 8650 function coordsToLatLng(coords) { 8651 return new LatLng(coords[1], coords[0], coords[2]); 8652 } 8653 function coordsToLatLngs(coords, levelsDeep, _coordsToLatLng) { 8654 for (var latlng, latlngs = [], i = 0, len = coords.length; i < len; i++) latlng = levelsDeep ? coordsToLatLngs(coords[i], levelsDeep - 1, _coordsToLatLng) : (_coordsToLatLng || coordsToLatLng)(coords[i]), 8655 latlngs.push(latlng); 8656 return latlngs; 8657 } 8658 function latLngToCoords(latlng, precision) { 8659 return precision = "number" == typeof precision ? precision : 6, void 0 !== latlng.alt ? [ formatNum
8659(latlng.lng, precision), formatNum(latlng.lat, precision), formatNum(latlng.alt, precision) ] : [ formatNum(latlng.lng, precision), formatNum(latlng.lat, precision) ]; 8660 } 8661 function latLngsToCoords(latlngs, levelsDeep, closed, precision) { 8662 for (var coords = [], i = 0, len = latlngs.length; i < len; i++) coords.push(levelsDeep ? latLngsToCoords(latlngs[i], levelsDeep - 1, closed, precision) : latLngToCoords(latlngs[i], precision)); 8663 return !levelsDeep && closed && coords.push(coords[0]), coords; 8664 } 8665 function getFeature(layer, newGeometry) { 8666 return layer.feature ? extend({}, layer.feature, { 8667 geometry: newGeometry 8668 }) : asFeature(newGeometry); 8669 } 8670 function asFeature(geojson) { 8671 return "Feature" === geojson.type || "FeatureCollection" === geojson.type ? geojson : { 8672 type: "Feature", 8673 properties: {}, 8674 geometry: geojson 8675 }; 8676 } 8677 var PointToGeoJSON = { 8678 toGeoJSON: function(precision) { 8679 return getFeature(this, { 8680 type: "Point", 8681 coordinates: latLngToCoords(this.getLatLng(), precision) 8682 }); 8683 } 8684 }; 8685 function geoJSON(geojson, options) { 8686 return new GeoJSON(geojson, options); 8687 } 8688 Marker.include(PointToGeoJSON), Circle.include(PointToGeoJSON), CircleMarker.include(PointToGeoJSON), 8689 Polyline.include({ 8690 toGeoJSON: function(precision) { 8691 var multi = !isFlat(this._latlngs); 8692 return getFeature(this, { 8693 type: (multi ? "Multi" : "") + "LineString", 8694 coordinates: latLngsToCoords(this._latlngs, multi ? 1 : 0, !1, precision) 8695 }); 8696 } 8697 }), Polygon.include({ 8698 toGeoJSON: function(precision) { 8699 var holes = !isFlat(this._latlngs), multi = holes && !isFlat(this._latlngs[0]), coords = latLngsToCoords(this._latlngs, multi ? 2 : holes ? 1 : 0, !0, precision); 8700 return holes || (coords = [ coords ]), getFeature(this, { 8701 type: (multi ? "Multi" : "") + "Polygon", 8702 coordinates: coords 8703 }); 8704 } 8705 }), LayerGroup.include({ 8706 toMultiPoint: function(precision) { 8707 var coords = []; 8708 return this.eachLayer(function(layer) { 8709 coords.push(layer.toGeoJSON(precision).geometry.coordinates); 8710 }), getFeature(this, { 8711 type: "MultiPoint", 8712 coordinates: coords 8713 }); 8714 }, 8715 toGeoJSON: function(precision) { 8716 var type = this.feature && this.feature.geometry && this.feature.geometry.type; 8717 if ("MultiPoint" === type) return this.toMultiPoint(precision); 8718 var isGeometryCollection = "GeometryCollection" === type, jsons = []; 8719 return this.eachLayer(function(layer) { 8720 if (layer.toGeoJSON) { 8721 var json = layer.toGeoJSON(precision); 8722 if (isGeometryCollection) jsons.push(json.geometry); else { 8723 var feature = asFeature(json); 8724 "FeatureCollection" === feature.type ? jsons.push.apply(jsons, feature.features) : jsons.push(feature); 8725 } 8726 } 8727 }), isGeometryCollection ? getFeature(this, { 8728 geometries: jsons, 8729 type: "GeometryCollection" 8730 }) : { 8731 type: "FeatureCollection", 8732 features: jsons 8733 }; 8734 } 8735 }); 8736 var geoJson = geoJSON, ImageOverlay = Layer.extend({ 8737 options: { 8738 opacity: 1, 8739 alt: "", 8740 interactive: !1, 8741 crossOrigin: !1, 8742 errorOverlayUrl: "", 8743 zIndex: 1, 8744 className: "" 8745 }, 8746 initialize: function(url, bounds, options) { 8747 this._url = url, this._bounds = toLatLngBounds(bounds), setOptions(this, options); 8748 }, 8749 onAdd: function() { 8750 this._image || (this._initImage(), this.options.opacity < 1 && this._updateOpacity()), 8751 this.options.interactive && (addClass(this._image, "leaflet-interactive"), this.addInteractiveTarget(this._image)), 8752 this.getPane().appendChild(this._image), this._reset(); 8753 }, 8754 onRemove: function() { 8755 _remove(this._image), this.options.interactive && this.removeInteractiveTarget(this._image); 8756 }, 8757 setOpacity: function(opacity) { 8758 return this.options.opacity = opacity, this._image && this._updateOpacity(), this; 8759 }, 8760 setStyle: function(styleOpts) { 8761 return styleOpts.opacity && this.setOpacity(styleOpts.opacity), this; 8762 }, 8763 bringToFront: function() { 8764 return this._map && toFront(this._image), this; 8765 }, 8766 bringToBack: function() { 8767 return this._map && toBack(this._image), this; 8768 }, 8769 setUrl: function(url) { 8770 return this._url = url, this._image && (this._image.src = url), this; 8771 },
8772 setBounds: function(bounds) { 8773 return this._bounds = toLatLngBounds(bounds), this._map && this._reset(), this; 8774 }, 8775 getEvents: function() { 8776 var events = { 8777 zoom: this._reset, 8778 viewreset: this._reset 8779 }; 8780 return this._zoomAnimated && (events.zoomanim = this._animateZoom), events; 8781 }, 8782 setZIndex: function(value) { 8783 return this.options.zIndex = value, this._updateZIndex(), this; 8784 }, 8785 getBounds: function() { 8786 return this._bounds; 8787 }, 8788 getElement: function() { 8789 return this._image; 8790 }, 8791 _initImage: function() { 8792 var wasElementSupplied = "IMG" === this._url.tagName, img = this._image = wasElementSupplied ? this._url : create$1("img"); 8793 addClass(img, "leaflet-image-layer"), this._zoomAnimated && addClass(img, "leaflet-zoom-animated"), 8794 this.options.className && addClass(img, this.options.className), img.onselectstart = falseFn, 8795 img.onmousemove = falseFn, img.onload = bind(this.fire, this, "load"), img.onerror = bind(this._overlayOnError, this, "error"), 8796 !this.options.crossOrigin && "" !== this.options.crossOrigin || (img.crossOrigin = !0 === this.options.crossOrigin ? "" : this.options.crossOrigin), 8797 this.options.zIndex && this._updateZIndex(), wasElementSupplied ? this._url = img.src : (img.src = this._url, 8798 img.alt = this.options.alt); 8799 }, 8800 _animateZoom: function(e) { 8801 var scale = this._map.getZoomScale(e.zoom), offset = this._map._latLngBoundsToNewLayerBounds(this._bounds, e.zoom, e.center).min; 8802 setTransform(this._image, offset, scale); 8803 }, 8804 _reset: function() { 8805 var image = this._image, bounds = new Bounds(this._map.latLngToLayerPoint(this._bounds.getNorthWest()), this._map.latLngToLayerPoint(this._bounds.getSouthEast())), size = bounds.getSize(); 8806 setPosition(image, bounds.min), image.style.width = size.x + "px", image.style.height = size.y + "px"; 8807 }, 8808 _updateOpacity: function() { 8809 _setOpacity(this._image, this.options.opacity); 8810 }, 8811 _updateZIndex: function() { 8812 this._image && void 0 !== this.options.zIndex && null !== this.options.zIndex && (this._image.style.zIndex = this.options.zIndex); 8813 }, 8814 _overlayOnError: function() { 8815 this.fire("error"); 8816 var errorUrl = this.options.errorOverlayUrl; 8817 errorUrl && this._url !== errorUrl && (this._url = errorUrl, this._image.src = errorUrl); 8818 } 8819 }), VideoOverlay = ImageOverlay.extend({ 8820 options: { 8821 autoplay: !0, 8822 loop: !0, 8823 keepAspectRatio: !0 8824 }, 8825 _initImage: function() { 8826 var wasElementSupplied = "VIDEO" === this._url.tagName, vid = this._image = wasElementSupplied ? this._url : create$1("video"); 8827 if (addClass(vid, "leaflet-image-layer"), this._zoomAnimated && addClass(vid, "leaflet-zoom-animated"), 8828 vid.onselectstart = falseFn, vid.onmousemove = falseFn, vid.onloadeddata = bind(this.fire, this, "load"), 8829 wasElementSupplied) { 8830 for (var sourceElements = vid.getElementsByTagName("source"), sources = [], j = 0; j < sourceElements.length; j++) sources.push(sourceElements[j].src); 8831 this._url = 0 < sourceElements.length ? sources : [ vid.src ]; 8832 } else { 8833 isArray(this._url) || (this._url = [ this._url ]), !this.options.keepAspectRatio && vid.style.hasOwnProperty("objectFit") && (vid.style.objectFit = "fill"), 8834 vid.autoplay = !!this.options.autoplay, vid.loop = !!this.options.loop; 8835 for (var i = 0; i < this._url.length; i++) { 8836 var source = create$1("source"); 8837 source.src = this._url[i], vid.appendChild(source); 8838 } 8839 } 8840 } 8841 }); 8842 var SVGOverlay = ImageOverlay.extend({ 8843 _initImage: function() { 8844 var el = this._image = this._url; 8845 addClass(el, "leaflet-image-layer"), this._zoomAnimated && addClass(el, "leaflet-zoom-animated"), 8846 el.onselectstart = falseFn, el.onmousemove = falseFn; 8847 } 8848 }); 8849 var DivOverlay = Layer.extend({ 8850 options: { 8851 offset: [ 0, 7 ], 8852 className: "", 8853 pane: "popupPane" 8854 }, 8855 initialize: function(options, source) { 8856 setOptions(this, options), this._source = source; 8857 }, 8858 onAdd: function(map) { 8859 this._zoomAnimated = map._zoomAnimated, this._container || this._initLayout(), map._fadeAnimated && _setOpacity(this._container, 0), 8860 clearTimeout(this._removeTimeout), this.getPane().appendChild(this._container), 8861 this.update(), map._fadeAnimated && _setOpacity(this._container, 1), this.bringToFront(); 8862 }, 8863 onRemove: function(map) { 8864 map._fadeAnimated ? (_setOpacity(this._container, 0), this._removeTimeout = setTimeout(bind(_remove, void 0, this._container), 200)) : _remove(this._container); 8865 }, 8866 getLatLng: function() { 8867 return this._latlng; 8868 }, 8869 setLatLng: function(latlng) { 8870 return this._latlng = toLatLng(latlng), this._map && (this._updatePosition(), this._adjustPan()), 8871 this; 8872 }, 8873 getContent: function() { 8874 return this._content; 8875 }, 8876 setContent: function(content) { 8877 return this._content = content, this.update(), this; 8878 }, 8879 getElement: function() { 8880 return this._container; 8881 }, 8882 update: function() { 8883 this._map && (this._container.style.visibility = "hidden", this._updateContent(), 8884 this._updateLayout(), this._updatePosition(), this._container.style.visibility = "", 8885 this._adjustPan()); 8886 }, 8887 getEvents: function() { 8888 var events = { 8889 zoom: this._updatePosition, 8890 viewreset: this._updatePosition 8891 }; 8892 return this._zoomAnimated && (events.zoomanim = this._animateZoom), events; 8893 }, 8894 isOpen: function() { 8895 return !!this._map && this._map.hasLayer(this); 8896 }, 8897 bringToFront: function() { 8898 return this._map && toFront(this._container), this; 8899 }, 8900 bringToBack: function() { 8901 return this._map && toBack(this._container), this; 8902 }, 8903 _prepareOpen: function(parent, layer, latlng) { 8904 if (layer instanceof Layer || (latlng = layer, layer = parent), layer instanceof FeatureGroup) for (var id in parent._layers) { 8905 layer = parent._layers[id]; 8906 break; 8907 } 8908 if (!latlng) if (layer.getCenter) latlng = layer.getCenter(); else { 8909 if (!layer.getLatLng) throw new Error("Unable to get source layer LatLng."); 8910 latlng = layer.getLatLng(); 8911 } 8912 return this._source = layer, this.update(), latlng; 8913 }, 8914 _updateContent: function() { 8915 if (this._content) { 8916 var node = this._contentNode, content = "function" == typeof this._content ? this._content(this._source || this) : this._content; 8917 if ("string" == typeof content) node.innerHTML = content; else { 8918 for (;node.hasChildNodes(); ) node.removeChild(node.firstChild); 8919 node.appendChild(content); 8920 } 8921 this.fire("contentupdate"); 8922 } 8923 }, 8924 _updatePosition: function() { 8925 if (this._map) { 8926 var pos = this._map.latLngToLayerPoint(this._latlng), offset = toPoint(this.options.offset), anchor = this._getAnchor(); 8927 this._zoomAnimated ? setPosition(this._container, pos.add(anchor)) : offset = offset.add(pos).add(anchor); 8928 var bottom = this._containerBottom = -offset.y, left = this._containerLeft = -Math.round(this._containerWidth / 2) + offset.x; 8929 this._container.style.bottom = bottom + "px", this._container.style.left = left + "px"; 8930 } 8931 }, 8932 _getAnchor: function() { 8933 return [ 0, 0 ]; 8934 } 8935 }), Popup = DivOverlay.extend({ 8936 options: { 8937 maxWidth: 300, 8938 minWidth: 50, 8939 maxHeight: null, 8940 autoPan: !0, 8941 autoPanPaddingTopLeft: null, 8942 autoPanPaddingBottomRight: null, 8943 autoPanPadding: [ 5, 5 ], 8944 keepInView: !1, 8945 closeButton: !0, 8946 autoClose: !0, 8947 closeOnEscapeKey: !0, 8948 className: "" 8949 }, 8950 openOn: function(map) { 8951 return map.openPopup(this), this; 8952 }, 8953 onAdd: function(map) { 8954 DivOverlay.prototype.onAdd.call(this, map), map.fire("popupopen", { 8955 popup: this 8956 }), this._source && (this._source.fire("popupopen", { 8957 popup: this 8958 }, !0), this._source instanceof Path || this._source.on("preclick", stopPropagation)); 8959 }, 8960 onRemove: function(map) { 8961 DivOverlay.prototype.onRemove.call(this, map), map.fire("popupclose", { 8962 popup: this 8963 }), this._source && (this._source.fire("popupclose", { 8964 popup: this 8965 }, !0), this._source instanceof Path || this._source.off("preclick", stopPropagation)); 8966 }, 8967 getEvents: function() { 8968 var events = DivOverlay.prototype.getEvents.call(this); 8969 return (void 0 !== this.options.closeOnClick ? this.options.closeOnClick : this._map.options.closePopupOnClick) && (events.preclick = this._close), 8970 this.options.keepInView && (events.moveend = this._adjustPan), events; 8971 }, 8972 _close: function() { 8973 this._map && this._map.closePopup(this); 8974 }, 8975 _initLayout: function() { 8976 var prefix = "leaflet-popup", container = this._container = create$1("div", prefix + " " + (this.options.className || "") + " leaflet-zoom-animated"), wrapper = this._wrapper = create$1("div", prefix + "-content-wrapper", container); 8977 if (this._contentNode = create$1("div", prefix + "-content", wrapper), disableClickPropagation(wrapper), 8978 disableScrollPropagation(this._contentNode), on(wrapper, "contextmenu", stopPropagation), 8979 this._tipContainer = create$1("div", prefix + "-tip-container", container), this._tip = create$1("div", prefix + "-tip", this._tipContainer), 8980 this.options.closeButton) { 8981 var closeButton = this._closeButton = create$1("a", prefix + "-close-button", container); 8982 closeButton.href = "#close", closeButton.innerHTML = "×", on(closeButton, "click", this._onCloseButtonClick, this); 8983 } 8984 }, 8985 _updateLayout: function() { 8986 var container = this._contentNode, style = container.style; 8987 style.width = "", style.whiteSpace = "nowrap"; 8988 var width = container.offsetWidth; 8989 width = Math.min(width, this.options.maxWidth), width = Math.max(width, this.options.minWidth), 8990 style.width = width + 1 + "px", style.whiteSpace = "", style.height = ""; 8991 var height = container.offsetHeight, maxHeight = this.options.maxHeight; 8992 maxHeight && maxHeight < height ? (style.height = maxHeight + "px", addClass(container, "leaflet-popup-scrolled")) : removeClass(container, "leaflet-popup-scrolled"), 8993 this._containerWidth = this._container.offsetWidth; 8994 }, 8995 _animateZoom: function(e) { 8996 var pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center), anchor = this._getAnchor(); 8997 setPosition(this._container, pos.add(anchor)); 8998 }, 8999 _adjustPan: function() { 9000 if (this.options.autoPan) { 9001 this._map._panAnim && this._map._panAnim.stop(); 9002 var map = this._map, marginBottom = parseInt(getStyle(this._container, "marginBottom"), 10) || 0, containerHeight = this._container.offsetHeight + marginBottom, containerWidth = this._containerWidth, layerPos = new Point(this._containerLeft, -containerHeight - this._containerBottom); 9003 layerPos._add(getPosition(this._container)); 9004 var containerPos = map.layerPointToContainerPoint(layerPos), padding = toPoint(this.options.autoPanPadding), paddingTL = toPoint(this.options.autoPanPaddingTopLeft || padding), paddingBR = toPoint(this.options.autoPanPaddingBottomRight || padding), size = map.getSize(), dx = 0, dy = 0; 9005 containerPos.x + containerWidth + paddingBR.x > size.x && (dx = containerPos.x + containerWidth - size.x + paddingBR.x), 9006 containerPos.x - dx - paddingTL.x < 0 && (dx = containerPos.x - paddingTL.x), containerPos.y + containerHeight + paddingBR.y > size.y && (dy = containerPos.y + containerHeight - size.y + paddingBR.y), 9007 containerPos.y - dy - paddingTL.y < 0 && (dy = containerPos.y - paddingTL.y), (dx || dy) && map.fire("autopanstart").panBy([ dx, dy ]); 9008 } 9009 }, 9010 _onCloseButtonClick: function(e) { 9011 this._close(), stop(e); 9012 }, 9013 _getAnchor: function() { 9014 return toPoint(this._source && this._source._getPopupAnchor ? this._source._getPopupAnchor() : [ 0, 0 ]); 9015 } 9016 }); 9017 Map.mergeOptions({ 9018 closePopupOnClick: !0 9019 }), Map.include({ 9020 openPopup: function(popup, latlng, options) { 9021 return popup instanceof Popup || (popup = new Popup(options).setContent(popup)), 9022 latlng && popup.setLatLng(latlng), this.hasLayer(popup) ? this
9022: (this._popup && this._popup.options.autoClose && this.closePopup(), 9023 this._popup = popup, this.addLayer(popup)); 9024 }, 9025 closePopup: function(popup) { 9026 return popup && popup !== this._popup || (popup = this._popup, this._popup = null), 9027 popup && this.removeLayer(popup), this; 9028 } 9029 }), Layer.include({ 9030 bindPopup: function(content, options) { 9031 return content instanceof Popup ? (setOptions(content, options), (this._popup = content)._source = this) : (this._popup && !options || (this._popup = new Popup(options, this)), 9032 this._popup.setContent(content)), this._popupHandlersAdded || (this.on({ 9033 click: this._openPopup, 9034 keypress: this._onKeyPress, 9035 remove: this.closePopup, 9036 move: this._movePopup 9037 }), this._popupHandlersAdded = !0), this; 9038 }, 9039 unbindPopup: function() { 9040 return this._popup && (this.off({ 9041 click: this._openPopup, 9042 keypress: this._onKeyPress, 9043 remove: this.closePopup,
9044 move: this._movePopup 9045 }), this._popupHandlersAdded = !1, this._popup = null), this; 9046 }, 9047 openPopup: function(layer, latlng) { 9048 return this._popup && this._map && (latlng = this._popup._prepareOpen(this, layer, latlng), 9049 this._map.openPopup(this._popup, latlng)), this; 9050 }, 9051 closePopup: function() { 9052 return this._popup && this._popup._close(), this; 9053 }, 9054 togglePopup: function(target) { 9055 return this._popup && (this._popup._map ? this.closePopup() : this.openPopup(target)), 9056 this; 9057 }, 9058 isPopupOpen: function() { 9059 return !!this._popup && this._popup.isOpen(); 9060 }, 9061 setPopupContent: function(content) { 9062 return this._popup && this._popup.setContent(content), this; 9063 }, 9064 getPopup: function() { 9065 return this._popup; 9066 }, 9067 _openPopup: function(e) { 9068 var layer = e.layer || e.target; 9069 this._popup && this._map && (stop(e), layer instanceof Path ? this.openPopup(e.layer || e.target, e.latlng) : this._map.hasLayer(this._popup) && this._popup._source === layer ? this.closePopup() : this.openPopup(layer, e.latlng)); 9070 }, 9071 _movePopup: function(e) { 9072 this._popup.setLatLng(e.latlng); 9073 }, 9074 _onKeyPress: function(e) { 9075 13 === e.originalEvent.keyCode && this._openPopup(e); 9076 } 9077 }); 9078 var Tooltip = DivOverlay.extend({ 9079 options: { 9080 pane: "tooltipPane", 9081 offset: [ 0, 0 ], 9082 direction: "auto", 9083 permanent: !1, 9084 sticky: !1, 9085 interactive: !1, 9086 opacity: .9 9087 }, 9088 onAdd: function(map) { 9089 DivOverlay.prototype.onAdd.call(this, map), this.setOpacity(this.options.opacity), 9090 map.fire("tooltipopen", { 9091 tooltip: this 9092 }), this._source && this._source.fire("tooltipopen", { 9093 tooltip: this 9094 }, !0); 9095 }, 9096 onRemove: function(map) { 9097 DivOverlay.prototype.onRemove.call(this, map), map.fire("tooltipclose", { 9098 tooltip: this 9099 }), this._source && this._source.fire("tooltipclose", { 9100 tooltip: this 9101 }, !0); 9102 }, 9103 getEvents: function() { 9104 var events = DivOverlay.prototype.getEvents.call(this); 9105 return touch && !this.options.permanent && (events.preclick = this._close), events; 9106 }, 9107 _close: function() { 9108 this._map && this._map.closeTooltip(this); 9109 }, 9110 _initLayout: function() { 9111 var className = "leaflet-tooltip " + (this.options.className || "") + " leaflet-zoom-" + (this._zoomAnimated ? "animated" : "hide"); 9112 this._contentNode = this._container = create$1("div", className); 9113 }, 9114 _updateLayout: function() {}, 9115 _adjustPan: function() {}, 9116 _setPosition: function(pos) { 9117 var map = this._map, container = this._container, centerPoint = map.latLngToContainerPoint(map.getCenter()), tooltipPoint = map.layerPointToContainerPoint(pos), direction = this.options.direction, tooltipWidth = container.offsetWidth, tooltipHeight = container.offsetHeight, offset = toPoint(this.options.offset), anchor = this._getAnchor(); 9118 pos = "top" === direction ? pos.add(toPoint(-tooltipWidth / 2 + offset.x, -tooltipHeight + offset.y + anchor.y, !0)) : "bottom" === direction ? pos.subtract(toPoint(tooltipWidth / 2 - offset.x, -offset.y, !0)) : "center" === direction ? pos.subtract(toPoint(tooltipWidth / 2 + offset.x, tooltipHeight / 2 - anchor.y + offset.y, !0)) : "right" === direction || "auto" === direction && tooltipPoint.x < centerPoint.x ? (direction = "right", 9119 pos.add(toPoint(offset.x + anchor.x, anchor.y - tooltipHeight / 2 + offset.y, !0))) : (direction = "left", 9120 pos.subtract(toPoint(tooltipWidth + anchor.x - offset.x, tooltipHeight / 2 - anchor.y - offset.y, !0))), 9121 removeClass(container, "leaflet-tooltip-right"), removeClass(container, "leaflet-tooltip-left"), 9122 removeClass(container, "leaflet-tooltip-top"), removeClass(container, "leaflet-tooltip-bottom"), 9123 addClass(container, "leaflet-tooltip-" + direction), setPosition(container, pos); 9124 }, 9125 _updatePosition: function() { 9126 var pos = this._map.latLngToLayerPoint(this._latlng); 9127 this._setPosition(pos); 9128 }, 9129 setOpacity: function(opacity) { 9130 this.options.opacity = opacity, this._container && _setOpacity(this._container, opacity); 9131 }, 9132 _animateZoom: function(e) { 9133 var pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center); 9134 this._setPosition(pos); 9135 }, 9136 _getAnchor: function() { 9137 return toPoint(this._source && this._source._getTooltipAnchor && !this.options.sticky ? this._source._getTooltipAnchor() : [ 0, 0 ]); 9138 } 9139 }); 9140 Map.include({ 9141 openTooltip: function(tooltip, latlng, options) { 9142 return tooltip instanceof Tooltip || (tooltip = new Tooltip(options).setContent(tooltip)), 9143 latlng && tooltip.setLatLng(latlng), this.hasLayer(tooltip) ? this
9143: this.addLayer(tooltip); 9144 }, 9145 closeTooltip: function(tooltip) { 9146 return tooltip && this.removeLayer(tooltip), this; 9147 } 9148 }), Layer.include({ 9149 bindTooltip: function(content, options) { 9150 return content instanceof Tooltip ? (setOptions(content, options), (this._tooltip = content)._source = this) : (this._tooltip && !options || (this._tooltip = new Tooltip(options, this)), 9151 this._tooltip.setContent(content)), this._initTooltipInteractions(), this._tooltip.options.permanent && this._map && this._map.hasLayer(this) && this.openTooltip(), 9152 this; 9153 }, 9154 unbindTooltip: function() { 9155 return this._tooltip && (this._initTooltipInteractions(!0), this.closeTooltip(), 9156 this._tooltip = null), this; 9157 }, 9158 _initTooltipInteractions: function(remove$$1) { 9159 if (remove$$1 || !this._tooltipHandlersAdded) { 9160 var onOff = remove$$1 ? "off" : "on", events = { 9161 remove: this.closeTooltip, 9162 move: this._moveTooltip 9163 }; 9164 this._tooltip.options.permanent ? events.add = this._openTooltip : (events.mouseover = this._openTooltip, 9165 events.mouseout = this.closeTooltip, this._tooltip.options.sticky && (events.mousemove = this._moveTooltip), 9166 touch && (events.click = this._openTooltip)), this[onOff](events), this._tooltipHandlersAdded = !remove$$1; 9167 } 9168 }, 9169 openTooltip: function(layer, latlng) { 9170 return this._tooltip && this._map && (latlng = this._tooltip._prepareOpen(this, layer, latlng), 9171 this._map.openTooltip(this._tooltip, latlng), this._tooltip.options.interactive && this._tooltip._container && (addClass(this._tooltip._container, "leaflet-clickable"), 9172 this.addInteractiveTarget(this._tooltip._container))), this; 9173 }, 9174 closeTooltip: function() { 9175 return this._tooltip && (this._tooltip._close(), this._tooltip.options.interactive && this._tooltip._container && (removeClass(this._tooltip._container, "leaflet-clickable"), 9176 this.removeInteractiveTarget(this._tooltip._container))), this; 9177 }, 9178 toggleTooltip: function(target) { 9179 return this._tooltip && (this._tooltip._map ? this.closeTooltip() : this.openTooltip(target)), 9180 this; 9181 }, 9182 isTooltipOpen: function() { 9183 return this._tooltip.isOpen(); 9184 }, 9185 setTooltipContent: function(content) { 9186 return this._tooltip && this._tooltip.setContent(content), this; 9187 }, 9188 getTooltip: function() { 9189 return this._tooltip; 9190 }, 9191 _openTooltip: function(e) { 9192 var layer = e.layer || e.target; 9193 this._tooltip && this._map && this.openTooltip(layer, this._tooltip.options.sticky ? e.latlng : void 0); 9194 }, 9195 _moveTooltip: function(e) { 9196 var containerPoint, layerPoint, latlng = e.latlng; 9197 this._tooltip.options.sticky && e.originalEvent && (containerPoint = this._map.mouseEventToContainerPoint(e.originalEvent), 9198 layerPoint = this._map.containerPointToLayerPoint(containerPoint), latlng = this._map.layerPointToLatLng(layerPoint)), 9199 this._tooltip.setLatLng(latlng); 9200 } 9201 }); 9202 var DivIcon = Icon.extend({ 9203 options: { 9204 iconSize: [ 12, 12 ], 9205 html: !1, 9206 bgPos: null, 9207 className: "leaflet-div-icon" 9208 }, 9209 createIcon: function(oldIcon) { 9210 var div = oldIcon && "DIV" === oldIcon.tagName ? oldIcon : document.createElement("div"), options = this.options; 9211 if (options.html instanceof Element ? (empty(div), div.appendChild(options.html)) : div.innerHTML = !1 !== options.html ? options.html : "", 9212 options.bgPos) { 9213 var bgPos = toPoint(options.bgPos); 9214 div.style.backgroundPosition = -bgPos.x + "px " + -bgPos.y + "px"; 9215 } 9216 return this._setIconStyles(div, "icon"), div; 9217 }, 9218 createShadow: function() { 9219 return null; 9220 } 9221 }); 9222 Icon.Default = IconDefault; 9223 var GridLayer = Layer.extend({ 9224 options: { 9225 tileSize: 256, 9226 opacity: 1, 9227 updateWhenIdle: mobile, 9228 updateWhenZooming: !0, 9229 updateInterval: 200, 9230 zIndex: 1, 9231 bounds: null, 9232 minZoom: 0, 9233 maxZoom: void 0, 9234 maxNativeZoom: void 0, 9235 minNativeZoom: void 0, 9236 noWrap: !1, 9237 pane: "tilePane", 9238 className: "", 9239 keepBuffer: 2 9240 }, 9241 initialize: function(options) { 9242 setOptions(this, options); 9243 }, 9244 onAdd: function() { 9245 this._initContainer(), this._levels = {}, this._tiles = {}, this._resetView(), this._update(); 9246 }, 9247 beforeAdd: function(map) {
9248 map._addZoomLimit(this); 9249 }, 9250 onRemove: function(map) { 9251 this._removeAllTiles(), _remove(this._container), map._removeZoomLimit(this), this._container = null, 9252 this._tileZoom = void 0; 9253 }, 9254 bringToFront: function() { 9255 return this._map && (toFront(this._container), this._setAutoZIndex(Math.max)), this; 9256 }, 9257 bringToBack: function() { 9258 return this._map && (toBack(this._container), this._setAutoZIndex(Math.min)), this; 9259 }, 9260 getContainer: function() { 9261 return this._container; 9262 }, 9263 setOpacity: function(opacity) { 9264 return this.options.opacity = opacity, this._updateOpacity(), this; 9265 }, 9266 setZIndex: function(zIndex) { 9267 return this.options.zIndex = zIndex, this._updateZIndex(), this; 9268 }, 9269 isLoading: function() { 9270 return this._loading; 9271 }, 9272 redraw: function() { 9273 return this._map && (this._removeAllTiles(), this._update()), this; 9274 }, 9275 getEvents: function() { 9276 var events = { 9277 viewprereset: this._invalidateAll, 9278 viewreset: this._resetView, 9279 zoom: this._resetView, 9280 moveend: this._onMoveEnd 9281 }; 9282 return this.options.updateWhenIdle || (this._onMove || (this._onMove = throttle(this._onMoveEnd, this.options.updateInterval, this)), 9283 events.move = this._onMove), this._zoomAnimated && (events.zoomanim = this._animateZoom), 9284 events; 9285 }, 9286 createTile: function() { 9287 return document.createElement("div"); 9288 }, 9289 getTileSize: function() { 9290 var s = this.options.tileSize; 9291 return s instanceof Point ? s : new Point(s, s); 9292 }, 9293 _updateZIndex: function() { 9294 this._container && void 0 !== this.options.zIndex && null !== this.options.zIndex && (this._container.style.zIndex = this.options.zIndex); 9295 }, 9296 _setAutoZIndex: function(compare) { 9297 for (var zIndex, layers = this.getPane().children, edgeZIndex = -compare(-1 / 0, 1 / 0), i = 0, len = layers.length; i < len; i++) zIndex = layers[i].style.zIndex, 9298 layers[i] !== this._container && zIndex && (edgeZIndex = compare(edgeZIndex, +zIndex)); 9299 isFinite(edgeZIndex) && (this.options.zIndex = edgeZIndex + compare(-1, 1), this._updateZIndex()); 9300 }, 9301 _updateOpacity: function() { 9302 if (this._map && !ielt9) { 9303 _setOpacity(this._container, this.options.opacity); 9304 var now = +new Date(), nextFrame = !1, willPrune = !1; 9305 for (var key in this._tiles) { 9306 var tile = this._tiles[key]; 9307 if (tile.current && tile.loaded) { 9308 var fade = Math.min(1, (now - tile.loaded) / 200); 9309 _setOpacity(tile.el, fade), fade < 1 ? nextFrame = !0 : (tile.active ? willPrune = !0 : this._onOpaqueTile(tile), 9310 tile.active = !0); 9311 } 9312 } 9313 willPrune && !this._noPrune && this._pruneTiles(), nextFrame && (cancelAnimFrame(this._fadeFrame), 9314 this._fadeFrame = requestAnimFrame(this._updateOpacity, this)); 9315 } 9316 }, 9317 _onOpaqueTile: falseFn, 9318 _initContainer: function() { 9319 this._container || (this._container = create$1("div", "leaflet-layer " + (this.options.className || "")), 9320 this._updateZIndex(), this.options.opacity < 1 && this._updateOpacity(), this.getPane().appendChild(this._container)); 9321 }, 9322 _updateLevels: function() { 9323 var zoom = this._tileZoom, maxZoom = this.options.maxZoom; 9324 if (void 0 !== zoom) { 9325 for (var z in this._levels) this._levels[z].el.children.length || z === zoom ? (this._levels[z].el.style.zIndex = maxZoom - Math.abs(zoom - z), 9326 this._onUpdateLevel(z)) : (_remove(this._levels[z].el), this._removeTilesAtZoom(z), 9327 this._onRemoveLevel(z), delete this._levels[z]); 9328 var level = this._levels[zoom], map = this._map; 9329 return level || ((level = this._levels[zoom] = {}).el = create$1("div", "leaflet-tile-container leaflet-zoom-animated", this._container), 9330 level.el.style.zIndex = maxZoom, level.origin = map.project(map.unproject(map.getPixelOrigin()), zoom).round(), 9331 level.zoom = zoom, this._setZoomTransform(level, map.getCenter(), map.getZoom()), 9332 level.el.offsetWidth, this._onCreateLevel(level)), this._level = level; 9333 } 9334 }, 9335 _onUpdateLevel: falseFn, 9336 _onRemoveLevel: falseFn, 9337 _onCreateLevel: falseFn, 9338 _pruneTiles: function() { 9339 if (this._map) { 9340 var key, tile, zoom = this._map.getZoom(); 9341 if (zoom > this.options.maxZoom || zoom < this.options.minZoom) this._removeAllTiles(); else { 9342 for (key in this._tiles) (tile = this._tiles[key]).retain = tile.current; 9343 for (key in this._tiles) if ((tile = this._tiles[key]).current && !tile.active) { 9344 var coords = tile.coords; 9345 this._retainParent(coords.x, coords.y, coords.z, coords.z - 5) || this._retainChildren(coords.x, coords.y, coords.z, coords.z + 2); 9346 } 9347 for (key in this._tiles) this._tiles[key].retain || this._removeTile(key); 9348 } 9349 } 9350 }, 9351 _removeTilesAtZoom: function(zoom) { 9352 for (var key in this._tiles) this._tiles[key].coords.z === zoom && this._removeTile(key); 9353 }, 9354 _removeAllTiles: function() { 9355 for (var key in this._tiles) this._removeTile(key); 9356 }, 9357 _invalidateAll: function() { 9358 for (var z in this._levels) _remove(this._levels[z].el), this._onRemoveLevel(z), 9359 delete this._levels[z]; 9360 this._removeAllTiles(), this._tileZoom = void 0; 9361 }, 9362 _retainParent: function(x, y, z, minZoom) { 9363 var x2 = Math.floor(x / 2), y2 = Math.floor(y / 2), z2 = z - 1, coords2 = new Point(+x2, +y2); 9364 coords2.z = +z2; 9365 var key = this._tileCoordsToKey(coords2), tile = this._tiles[key]; 9366 return tile && tile.active ? tile.retain = !0 : (tile && tile.loaded && (tile.retain = !0), 9367 minZoom < z2 && this._retainParent(x2, y2, z2, minZoom)); 9368 }, 9369 _retainChildren: function(x, y, z, maxZoom) { 9370 for (var i = 2 * x; i < 2 * x + 2; i++) for (var j = 2 * y; j < 2 * y + 2; j++) { 9371 var coords = new Point(i, j); 9372 coords.z = z + 1; 9373 var key = this._tileCoordsToKey(coords), tile = this._tiles[key]; 9374 tile && tile.active ? tile.retain = !0 : (tile && tile.loaded && (tile.retain = !0), 9375 z + 1 < maxZoom && this._retainChildren(i, j, z + 1, maxZoom)); 9376 } 9377 }, 9378 _resetView: function(e) { 9379 var animating = e && (e.pinch || e.flyTo);
9380 this._setView(this._map.getCenter(), this._map.getZoom(), animating, animating); 9381 }, 9382 _animateZoom: function(e) { 9383 this._setView(e.center, e.zoom, !0, e.noUpdate); 9384 }, 9385 _clampZoom: function(zoom) { 9386 var options = this.options; 9387 return void 0 !== options.minNativeZoom && zoom < options.minNativeZoom ? options.minNativeZoom : void 0 !== options.maxNativeZoom && options.maxNativeZoom < zoom ? options.maxNativeZoom : zoom; 9388 }, 9389 _setView: function(center, zoom, noPrune, noUpdate) { 9390 var tileZoom = this._clampZoom(Math.round(zoom)); 9391 (void 0 !== this.options.maxZoom && tileZoom > this.options.maxZoom || void 0 !== this.options.minZoom && tileZoom < this.options.minZoom) && (tileZoom = void 0); 9392 var tileZoomChanged = this.options.updateWhenZooming && tileZoom !== this._tileZoom; 9393 noUpdate && !tileZoomChanged || (this._tileZoom = tileZoom, this._abortLoading && this._abortLoading(), 9394 this._updateLevels(), this._resetGrid(), void 0 !== tileZoom && this._update(center), 9395 noPrune || this._pruneTiles(), this._noPrune = !!noPrune), this._setZoomTransforms(center, zoom); 9396 }, 9397 _setZoomTransforms: function(center, zoom) { 9398 for (var i in this._levels) this._setZoomTransform(this._levels[i], center, zoom); 9399 }, 9400 _setZoomTransform: function(level, center, zoom) { 9401 var scale = this._map.getZoomScale(zoom, level.zoom), translate = level.origin.multiplyBy(scale).subtract(this._map._getNewPixelOrigin(center, zoom)).round(); 9402 any3d ? setTransform(level.el, translate, scale) : setPosition(level.el, translate); 9403 }, 9404 _resetGrid: function() { 9405 var map = this._map, crs = map.options.crs, tileSize = this._tileSize = this.getTileSize(), tileZoom = this._tileZoom, bounds = this._map.getPixelWorldBounds(this._tileZoom); 9406 bounds && (this._globalTileRange = this._pxBoundsToTileRange(bounds)), this._wrapX = crs.wrapLng && !this.options.noWrap && [ Math.floor(map.project([ 0, crs.wrapLng[0] ], tileZoom).x / tileSize.x), Math.ceil(map.project([ 0, crs.wrapLng[1] ], tileZoom).x / tileSize.y) ], 9407 this._wrapY = crs.wrapLat && !this.options.noWrap && [ Math.floor(map.project([ crs.wrapLat[0], 0 ], tileZoom).y / tileSize.x), Math.ceil(map.project([ crs.wrapLat[1], 0 ], tileZoom).y / tileSize.y) ]; 9408 }, 9409 _onMoveEnd: function() { 9410 this._map && !this._map._animatingZoom && this._update(); 9411 }, 9412 _getTiledPixelBounds: function(center) { 9413 var map = this._map, mapZoom = map._animatingZoom ? Math.max(map._animateToZoom, map.getZoom()) : map.getZoom(), scale = map.getZoomScale(mapZoom, this._tileZoom), pixelCenter = map.project(center, this._tileZoom).floor(), halfSize = map.getSize().divideBy(2 * scale); 9414 return new Bounds(pixelCenter.subtract(halfSize), pixelCenter.add(halfSize)); 9415 }, 9416 _update: function(center) { 9417 var map = this._map; 9418 if (map) { 9419 var zoom = this._clampZoom(map.getZoom()); 9420 if (void 0 === center && (center = map.getCenter()), void 0 !== this._tileZoom) { 9421 var pixelBounds = this._getTiledPixelBounds(center), tileRange = this._pxBoundsToTileRange(pixelBounds), tileCenter = tileRange.getCenter(), queue = [], margin = this.options.keepBuffer, noPruneRange = new Bounds(tileRange.getBottomLeft().subtract([ margin, -margin ]), tileRange.getTopRight().add([ margin, -margin ])); 9422 if (!(isFinite(tileRange.min.x) && isFinite(tileRange.min.y) && isFinite(tileRange.max.x) && isFinite(tileRange.max.y))) throw new Error("Attempted to load an infinite number of tiles"); 9423 for (var key in this._tiles) { 9424 var c = this._tiles[key].coords; 9425 c.z === this._tileZoom && noPruneRange.contains(new Point(c.x, c.y)) || (this._tiles[key].current = !1); 9426 } 9427 if (1 < Math.abs(zoom - this._tileZoom)) this._setVie
9427w(center, zoom); else { 9428 for (var j = tileRange.min.y; j <= tileRange.max.y; j++) for (var i = tileRange.min.x; i <= tileRange.max.x; i++) { 9429 var coords = new Point(i, j); 9430 if (coords.z = this._tileZoom, this._isValidTile(coords)) { 9431 var tile = this._tiles[this._tileCoordsToKey(coords)]; 9432 tile ? tile.current = !0 : queue.push(coords); 9433 } 9434 } 9435 if (queue.sort(function(a, b) { 9436 return a.distanceTo(tileCenter) - b.distanceTo(tileCenter); 9437 }), 0 !== queue.length) { 9438 this._loading || (this._loading = !0, this.fire("loading")); 9439 var fragment = document.createDocumentFragment(); 9440 for (i = 0; i < queue.length; i++) this._addTile(queue[i], fragment); 9441 this._level.el.appendChild(fragment); 9442 } 9443 } 9444 } 9445 } 9446 }, 9447 _isValidTile: function(coords) { 9448 var crs = this._map.options.crs; 9449 if (!crs.infinite) { 9450 var bounds = this._globalTileRange; 9451 if (!crs.wrapLng && (coords.x < bounds.min.x || coords.x > bounds.max.x) || !crs.wrapLat && (coords.y < bounds.min.y || coords.y > bounds.max.y)) return !1; 9452 } 9453 if (!this.options.bounds) return !0; 9454 var tileBounds = this._tileCoordsToBounds(coords); 9455 return toLatLngBounds(this.options.bounds).overlaps(tileBounds); 9456 }, 9457 _keyToBounds: function(key) { 9458 return this._tileCoordsToBounds(this._keyToTileCoords(key)); 9459 }, 9460 _tileCoordsToNwSe: function(coords) { 9461 var map = this._map, tileSize = this.getTileSize(), nwPoint = coords.scaleBy(tileSize), sePoint = nwPoint.add(tileSize); 9462 return [ map.unproject(nwPoint, coords.z), map.unproject(sePoint, coords.z) ]; 9463 }, 9464 _tileCoordsToBounds: function(coords) { 9465 var bp = this._tileCoordsToNwSe(coords), bounds = new LatLngBounds(bp[0], bp[1]); 9466 return this.options.noWrap || (bounds = this._map.wrapLatLngBounds(bounds)), bounds; 9467 }, 9468 _tileCoordsToKey: function(coords) { 9469 return coords.x + ":" + coords.y + ":" + coords.z; 9470 }, 9471 _keyToTileCoords: function(key) { 9472 var k = key.split(":"), coords = new Point(+k[0], +k[1]); 9473 return coords.z = +k[2], coords; 9474 }, 9475 _removeTile: function(key) { 9476 var tile = this._tiles[key]; 9477 tile && (_remove(tile.el), delete this._tiles[key], this.fire("tileunload", { 9478 tile: tile.el, 9479 coords: this._keyToTileCoords(key) 9480 })); 9481 }, 9482 _initTile: function(tile) { 9483 addClass(tile, "leaflet-tile"); 9484 var tileSize = this.getTileSize(); 9485 tile.style.width = tileSize.x + "px", tile.style.height = tileSize.y + "px", tile.onselectstart = falseFn, 9486 tile.onmousemove = falseFn, ielt9 && this.options.opacity < 1 && _setOpacity(tile, this.options.opacity), 9487 android && !android23 && (tile.style.WebkitBackfaceVisibility = "hidden"); 9488 }, 9489 _addTile: function(coords, container) { 9490 var tilePos = this._getTilePos(coords), key = this._tileCoordsToKey(coords), tile = this.createTile(this._wrapCoords(coords), bind(this._tileReady, this, coords)); 9491 this._initTile(tile), this.createTile.length < 2 && requestAnimFrame
9491(bind(this._tileReady, this, coords, null, tile)), 9492 setPosition(tile, tilePos), this._tiles[key] = { 9493 el: tile, 9494 coords: coords, 9495 current: !0 9496 }, container.appendChild(tile), this.fire("tileloadstart", { 9497 tile: tile, 9498 coords: coords 9499 }); 9500 }, 9501 _tileReady: function(coords, err, tile) { 9502 err && this.fire("tileerror", { 9503 error: err, 9504 tile: tile, 9505 coords: coords 9506 }); 9507 var key = this._tileCoordsToKey(coords); 9508 (tile = this._tiles[key]) && (tile.loaded = +new Date(), this._map._fadeAnimated ? (_setOpacity(tile.el, 0), 9509 cancelAnimFrame(this._fadeFrame), this._fadeFrame = requestAnimFrame(this._updateOpacity, this)) : (tile.active = !0, 9510 this._pruneTiles()), err || (addClass(tile.el, "leaflet-tile-loaded"), this.fire("tileload", { 9511 tile: tile.el, 9512 coords: coords 9513 })), this._noTilesToLoad() && (this._loading = !1, this.fire("load"), ielt9 || !this._map._fadeAnimated ? requestAnimFrame(this._pruneTiles, this) : setTimeout(bind(this._pruneTiles, this), 250))); 9514 }, 9515 _getTilePos: function(coords) { 9516 return coords.scaleBy(this.getTileSize()).subtract(this._level.origin); 9517 }, 9518 _wrapCoords: function(coords) { 9519 var newCoords = new Point(this._wrapX ? wrapNum(coords.x, this._wrapX) : coords.x, this._wrapY ? wrapNum(coords.y, this._wrapY) : coords.y); 9520 return newCoords.z = coords.z, newCoords; 9521 }, 9522 _pxBoundsToTileRange: function(bounds) { 9523 var tileSize = this.getTileSize(); 9524 return new Bounds(bounds.min.unscaleBy(tileSize).floor(), bounds.max.unscaleBy(tileSize).ceil().subtract([ 1, 1 ])); 9525 }, 9526 _noTilesToLoad: function() { 9527 for (var key in this._tiles) if (!this._tiles[key].loaded) return !1; 9528 return !0; 9529 } 9530 }); 9531 var TileLayer = GridLayer.extend({ 9532 options: { 9533 minZoom: 0, 9534 maxZoom: 18, 9535 subdomains: "abc", 9536 errorTileUrl: "", 9537 zoomOffset: 0, 9538 tms: !1, 9539 zoomReverse: !1, 9540 detectRetina: !1, 9541 crossOrigin: !1 9542 }, 9543 initialize: function(url, options) { 9544 this._url = url, (options = setOptions(this, options)).detectRetina && retina && 0 < options.maxZoom && (options.tileSize = Math.floor(options.tileSize / 2), 9545 options.zoomReverse ? (options.zoomOffset--, options.minZoom++) : (options.zoomOffset++, 9546 options.maxZoom--), options.minZoom = Math.max(0, options.minZoom)), "string" == typeof options.subdomains && (options.subdomains = options.subdomains.split("")), 9547 android || this.on("tileunload", this._onTileRemove); 9548 }, 9549 setUrl: function(url, noRedraw) { 9550 return this._url === url && void 0 === noRedraw && (noRedraw = !0), this._url = url, 9551 noRedraw || this.redraw(), this; 9552 }, 9553 createTile: function(coords, done) { 9554 var tile = document.createElement("img"); 9555 return on(tile, "load", bind(this._tileOnLoad, this, done, tile)), on(tile, "error", bind(this._tileOnError, this, done, tile)), 9556 !this.options.crossOrigin && "" !== this.options.crossOrigin || (tile.crossOrigin = !0 === this.options.crossOrigin ? "" : this.options.crossOrigin), 9557 tile.alt = "", tile.setAttribute("role", "presentation"), tile.src = this.getTileUrl(coords), 9558 tile; 9559 }, 9560 getTileUrl: function(coords) { 9561 var data = { 9562 r: retina ? "@2x" : "", 9563 s: this._getSubdomain(coords), 9564 x: coords.x, 9565 y: coords.y, 9566 z: this._getZoomForUrl() 9567 }; 9568 if (this._map && !this._map.options.crs.infinite) { 9569 var invertedY = this._globalTileRange.max.y - coords.y; 9570 this.options.tms && (data.y = invertedY), data["-y"] = invertedY; 9571 } 9572 return template(this._url, extend(data, this.options)); 9573 }, 9574 _tileOnLoad: function(done, tile) { 9575 ielt9 ? setTimeout(bind(done, this, null, tile), 0) : done(null, tile); 9576 }, 9577 _tileOnError: function(done, tile, e) { 9578 var errorUrl = this.options.errorTileUrl; 9579 errorUrl && tile.getAttribute("src") !== errorUrl && (tile.src = errorUrl), done(e, tile); 9580 }, 9581 _onTileRemove: function(e) { 9582 e.tile.onload = null; 9583 }, 9584 _getZoomForUrl: function() { 9585 var zoom = this._tileZoom, maxZoom = this.options.maxZoom; 9586 return this.options.zoomReverse && (zoom = maxZoom - zoom), zoom + this.options.zoomOffset; 9587 }, 9588 _getSubdomain: function(tilePoint) { 9589 var index = Math.abs(tilePoint.x + tilePoint.y) % this.options.subdomains.length; 9590 return this.options.subdomains[index]; 9591 }, 9592 _abortLoading: function() { 9593 var i, tile; 9594 for (i in this._tiles) this._tiles[i].coords.z !== this._tileZoom && ((tile = this._tiles[i].el).onload = falseFn, 9595 tile.onerror = falseFn, tile.complete || (tile.src = emptyImageUrl, _remove(tile), 9596 delete this._tiles[i])); 9597 }, 9598 _removeTile: function(key) { 9599 var tile = this._tiles[key]; 9600 if (tile) return androidStock || tile.el.setAttribute("src", emptyImageUrl), GridLayer.prototype._removeTile.call(this, key); 9601 }, 9602 _tileReady: function(coords, err, tile) { 9603 if (this._map && (!tile || tile.getAttribute("src") !== emptyImageUrl)) return GridLayer.prototype._tileReady.call(this, coords, err, tile); 9604 } 9605 }); 9606 function tileLayer(url, options) { 9607 return new TileLayer(url, options); 9608 } 9609 var TileLayerWMS = TileLayer.extend({ 9610 defaultWmsParams: { 9611 service: "WMS", 9612 request: "GetMap", 9613 layers: "", 9614 styles: "", 9615 format: "image/jpeg", 9616 transparent: !1, 9617 version: "1.1.1" 9618 }, 9619 options: { 9620 crs: null, 9621 uppercase: !1 9622 }, 9623 initialize: function(url, options) { 9624 this._url = url; 9625 var wmsParams = extend({}, this.defaultWmsParams); 9626 for (var i in options) i in this.options || (wmsParams[i] = options[i]); 9627 var realRetina = (options = setOptions(this, options)).detectRetina && retina ? 2 : 1, tileSize = this.getTileSize(); 9628 wmsParams.width = tileSize.x * realRetina, wmsParams.height = tileSize.y * realRetina, 9629 this.wmsParams = wmsParams; 9630 }, 9631 onAdd: function(map) { 9632 this._crs = this.options.crs || map.options.crs, this._wmsVersion = parseFloat(this.wmsParams.version); 9633 var projectionKey = 1.3 <= this._wmsVersion ? "crs" : "srs"; 9634 this.wmsParams[projectionKey] = this._crs.code, TileLayer.prototype.onAdd.call(this, map); 9635 }, 9636 getTileUrl: function(coords) { 9637 var tileBounds = this._tileCoordsToNwSe(coords), crs = this._crs, bounds = toBounds(crs.project(tileBounds[0]), crs.project(tileBounds[1])), min = bounds.min, max = bounds.max, bbox = (1.3 <= this._wmsVersion && this._crs === EPSG4326 ? [ min.y, min.x, max.y, max.x ] : [ min.x, min.y, max.x, max.y ]).join(","), url = TileLayer.prototype.getTileUrl.call(this, coords); 9638 return url + getParamString(this.wmsParams, url, this.options.uppercase) + (this.options.uppercase ? "&BBOX=" : "&bbox=") + bbox; 9639 }, 9640 setParams: function(params, noRedraw) { 9641 return extend(this.wmsParams, params), noRedraw || this.redraw(), this; 9642 } 9643 }); 9644 TileLayer.WMS = TileLayerWMS, tileLayer.wms = function(url, options) { 9645 return new TileLayerWMS(url, options); 9646 }; 9647 var Renderer = Layer.extend({ 9648 options: { 9649 padding: .1, 9650 tolerance: 0 9651 }, 9652 initialize: function(options) { 9653 setOptions(this, options), stamp(this), this._layers = this._layers || {}; 9654 }, 9655 onAdd: function() { 9656 this._container || (this._initContainer(), this._zoomAnimated && addClass(this._container, "leaflet-zoom-animated")), 9657 this.getPane().appendChild(this._container), this._update(), this.on("update", this._updatePaths, this); 9658 }, 9659 onRemove: function() { 9660 this.off("update", this._updatePaths, this), this._destroyContainer(); 9661 }, 9662 getEvents: function() { 9663 var events = { 9664 viewreset: this._reset, 9665 zoom: this._onZoom, 9666 moveend: this._update, 9667 zoomend: this._onZoomEnd 9668 }; 9669 return this._zoomAnimated && (events.zoomanim = this._onAnimZoom), events; 9670 }, 9671 _onAnimZoom: function(ev) { 9672 this._updateTransform(ev.center, ev.zoom); 9673 }, 9674 _onZoom: function() { 9675 this._updateTransform(this._map.getCenter(), this._map.getZoom()); 9676 }, 9677 _updateTransform: function(center, zoom) { 9678 var scale = this._map.getZoomScale(zoom, this._zoom), position = getPosition(this._container), viewHalf = this._map.getSize().multiplyBy(.5 + this.options.padding), currentCenterPoint = this._map.project(this._center, zoom), centerOffset = this._map.project(center, zoom).subtract(currentCenterPoint), topLeftOffset = viewHalf.multiplyBy(-scale).add(position).add(viewHalf).subtract(centerOffset); 9679 any3d ? setTransform(this._container, topLeftOffset, scale) : setPosition(this._container, topLeftOffset); 9680 }, 9681 _reset: function() { 9682 for (var id in this._update(), this._updateTransform(this._center, this._zoom), 9683 this._layers) this._layers[id]._reset(); 9684 }, 9685 _onZoomEnd: function() { 9686 for (var id in this._layers) this._layers[id]._project(); 9687 }, 9688 _updatePaths: function() { 9689 for (var id in this._layers) this._layers[id]._update(); 9690 }, 9691 _update: function() { 9692 var p = this.options.padding, size = this._map.getSize(), min = this._map.containerPointToLayerPoint(size.multiplyBy(-p)).round(); 9693 this._bounds = new Bounds(min, min.add(size.multiplyBy(1 + 2 * p)).round()), this._center = this._map.getCenter(), 9694 this._zoom = this._map.getZoom(); 9695 } 9696 }), Canvas = Renderer.extend({ 9697 getEvents: function() { 9698 var events = Renderer.prototype.getEvents.call(this); 9699 return events.viewprereset = this._onViewPreReset, events; 9700 }, 9701 _onViewPreReset: function() { 9702 this._postponeUpdatePaths = !0; 9703 }, 9704 onAdd: function() { 9705 Renderer.prototype.onAdd.call(this), this._draw(); 9706 }, 9707 _initContainer: function() { 9708 var container = this._container = document.createElement("canvas"); 9709 on(container, "mousemove", throttle(this._onMouseMove, 32, this), this), on(container, "click dblclick mousedown mouseup contextmenu", this._onClick, this), 9710 on(container, "mouseout", this._handleMouseOut, this), this._ctx = container.getContext("2d"); 9711 }, 9712 _destroyContainer: function() {
9713 cancelAnimFrame(this._redrawRequest), delete this._ctx, _remove(this._container), 9714 off(this._container), delete this._container; 9715 }, 9716 _updatePaths: function() { 9717 if (!this._postponeUpdatePaths) { 9718 for (var id in this._redrawBounds = null, this._layers) this._layers[id]._update(); 9719 this._redraw(); 9720 } 9721 }, 9722 _update: function() { 9723 if (!this._map._animatingZoom || !this._bounds) { 9724 Renderer.prototype._update.call(this); 9725 var b = this._bounds, container = this._container, size = b.getSize(), m = retina ? 2 : 1; 9726 setPosition(container, b.min), container.width = m * size.x, container.height = m * size.y, 9727 container.style.width = size.x + "px", container.style.height = size.y + "px", retina && this._ctx.scale(2, 2), 9728 this._ctx.translate(-b.min.x, -b.min.y), this.fire("update"); 9729 } 9730 }, 9731 _reset: function() { 9732 Renderer.prototype._reset.call(this), this._postponeUpdatePaths && (this._postponeUpdatePaths = !1, 9733 this._updatePaths()); 9734 }, 9735 _initPath: function(layer) { 9736 this._updateDashArray(layer); 9737 var order = (this._layers[stamp(layer)] = layer)._order = { 9738 layer: layer, 9739 prev: this._drawLast, 9740 next: null 9741 }; 9742 this._drawLast && (this._drawLast.next = order), this._drawLast = order, this._drawFirst = this._drawFirst || this._drawLast; 9743 }, 9744 _addPath: function(layer) { 9745 this._requestRedraw(layer); 9746 }, 9747 _removePath: function(layer) { 9748 var order = layer._order, next = order.next, prev = order.prev; 9749 next ? next.prev = prev : this._drawLast = prev, prev ? prev.next = next : this._drawFirst = next, 9750 delete layer._order, delete this._layers[stamp(layer)], this._requestRedraw(layer); 9751 }, 9752 _updatePath: function(layer) { 9753 this._extendRedrawBounds(layer), layer._project(), layer._update(), this._requestRedraw(layer); 9754 }, 9755 _updateStyle: function(layer) { 9756 this._updateDashArray(layer), this._requestRedraw(layer); 9757 }, 9758 _updateDashArray: function(layer) { 9759 if ("string" == typeof layer.options.dashArray) { 9760 var dashValue, i, parts = layer.options.dashArray.split(/[, ]+/), dashArray = []; 9761 for (i = 0; i < parts.length; i++) { 9762 if (dashValue = Number(parts[i]), isNaN(dashValue)) return; 9763 dashArray.push(dashValue); 9764 } 9765 layer.options._dashArray = dashArray; 9766 } else layer.options._dashArray = layer.options.dashArray; 9767 }, 9768 _requestRedraw: function(layer) { 9769 this._map && (this._extendRedrawBounds(layer), this._redrawRequest = this._redrawRequest || requestAnimFrame(this._redraw, this)); 9770 }, 9771 _extendRedrawBounds: function(layer) { 9772 if (layer._pxBounds) { 9773 var padding = (layer.options.weight || 0) + 1; 9774 this._redrawBounds = this._redrawBounds || new Bounds(), this._redrawBounds.extend(layer._pxBounds.min.subtract([ padding, padding ])), 9775 this._redrawBounds.extend(layer._pxBounds.max.add([ padding, padding ])); 9776 } 9777 }, 9778 _redraw: function() { 9779 this._redrawRequest = null, this._redrawBounds && (this._redrawBounds.min._floor(), 9780 this._redrawBounds.max._ceil()), this._clear(), this._draw(), this._redrawBounds = null; 9781 }, 9782 _clear: function() { 9783 var bounds = this._redrawBounds; 9784 if (bounds) { 9785 var size = bounds.getSize(); 9786 this._ctx.clearRect(bounds.min.x, bounds.min.y, size.x, size.y); 9787 } else this._ctx.clearRect(0, 0, this._container.width, this._container.height); 9788 }, 9789 _draw: function() { 9790 var layer, bounds = this._redrawBounds; 9791 if (this._ctx.save(), bounds) { 9792 var size = bounds.getSize(); 9793 this._ctx.beginPath(), this._ctx.rect(bounds.min.x, bounds.min.y, size.x, size.y), 9794 this._ctx.clip(); 9795 } 9796 this._drawing = !0; 9797 for (var order = this._drawFirst; order; order = order.next) layer = order.layer, 9798 (!bounds || layer._pxBounds && layer._pxBounds.intersects(bounds)) && layer._updatePath();
9799 this._drawing = !1, this._ctx.restore(); 9800 }, 9801 _updatePoly: function(layer, closed) { 9802 if (this._drawing) { 9803 var i, j, len2, p, parts = layer._parts, len = parts.length, ctx = this._ctx; 9804 if (len) { 9805 for (ctx.beginPath(), i = 0; i < len; i++) { 9806 for (j = 0, len2 = parts[i].length; j < len2; j++) p = parts[i][j], ctx[j ? "lineTo" : "moveTo"](p.x, p.y); 9807 closed && ctx.closePath(); 9808 } 9809 this._fillStroke(ctx, layer); 9810 } 9811 } 9812 }, 9813 _updateCircle: function(layer) { 9814 if (this._drawing && !layer._empty()) { 9815 var p = layer._point, ctx = this._ctx, r = Math.max(Math.round(layer._radius), 1), s = (Math.max(Math.round(layer._radiusY), 1) || r) / r; 9816 1 != s && (ctx.save(), ctx.scale(1, s)), ctx.beginPath(), ctx.arc(p.x, p.y / s, r, 0, 2 * Math.PI, !1), 9817 1 != s && ctx.restore(), this._fillStroke(ctx, layer); 9818 } 9819 }, 9820 _fillStroke: function(ctx, layer) { 9821 var options = layer.options; 9822 options.fill && (ctx.globalAlpha = options.fillOpacity, ctx.fillStyle = options.fillColor || options.color, 9823 ctx.fill(options.fillRule || "evenodd")), options.stroke && 0 !== options.weight && (ctx.setLineDash && ctx.setLineDash(layer.options && layer.options._dashArray || []), 9824 ctx.globalAlpha = options.opacity, ctx.lineWidth = options.weight, ctx.strokeStyle = options.color, 9825 ctx.lineCap = options.lineCap, ctx.lineJoin = options.lineJoin, ctx.stroke()); 9826 }, 9827 _onClick: function(e) { 9828 for (var layer, clickedLayer, point = this._map.mouseEventToLayerPoint(e), order = this._drawFirst; order; order = order.next) (layer = order.layer).options.interactive && layer._containsPoint(point) && !this._map._draggableMoved(layer) && (clickedLayer = layer); 9829 clickedLayer && (fakeStop(e), this._fireEvent([ clickedLayer ], e)); 9830 }, 9831 _onMouseMove: function(e) { 9832 if (this._map && !this._map.dragging.moving() && !this._map._animatingZoom) { 9833 var point = this._map.mouseEventToLayerPoint(e); 9834 this._handleMouseHover(e, point); 9835 } 9836 }, 9837 _handleMouseOut: function(e) { 9838 var layer = this._hoveredLayer; 9839 layer && (removeClass(this._container, "leaflet-interactive"), this._fireEvent([ layer ], e, "mouseout"), 9840 this._hoveredLayer = null); 9841 }, 9842 _handleMouseHover: function(e, point) { 9843 for (var layer, candidateHoveredLayer, order = this._drawFirst; order; order = order.next) (layer = order.layer).options.interactive && layer._containsPoint(point) && (candidateHoveredLayer = layer); 9844 candidateHoveredLayer !== this._hoveredLayer && (this._handleMouseOut(e), candidateHoveredLayer && (addClass(this._container, "leaflet-interactive"), 9845 this._fireEvent([ candidateHoveredLayer ], e, "mouseover"), this._hoveredLayer = candidateHoveredLayer)), 9846 this._hoveredLayer && this._fireEvent([ this._hoveredLayer ], e); 9847 }, 9848 _fireEvent: function(layers, e, type) { 9849 this._map._fireDOMEvent(e, type || e.type, layers); 9850 }, 9851 _bringToFront: function(layer) { 9852 var order = layer._order; 9853 if (order) { 9854 var next = order.next, prev = order.prev; 9855 next && ((next.prev = prev) ? prev.next = next : next && (this._drawFirst = next), 9856 order.prev = this._drawLast, (this._drawLast.next = order).next = null, this._drawLast = order, 9857 this._requestRedraw(layer)); 9858 } 9859 }, 9860 _bringToBack: function(layer) { 9861 var order = layer._order; 9862 if (order) { 9863 var next = order.next, prev = order.prev; 9864 prev && ((prev.next = next) ? next.prev = prev : prev && (this._drawLast = prev), 9865 order.prev = null, order.next = this._drawFirst, this._drawFirst.prev = order, this._drawFirst = order, 9866 this._requestRedraw(layer)); 9867 } 9868 } 9869 }); 9870 function canvas$1(options) { 9871 return canvas ? new Canvas(options) : null; 9872 } 9873 var vmlCreate = function() { 9874 try { 9875 return document.namespaces.add("lvml", "urn:schemas-microsoft-com:vml"), function(name) { 9876 return document.createElement("<lvml:" + name + ' class="lvml">'); 9877 }; 9878 } catch (e) { 9879 return function(name) { 9880 return document.createElement("<" + name + ' xmlns="urn:schemas-microsoft.com:vml" class="lvml">'); 9881 }; 9882 } 9883 }(), vmlMixin = { 9884 _initContainer: function() { 9885 this._container = create$1("div", "leaflet-vml-container"); 9886 }, 9887 _update: function() { 9888 this._map._animatingZoom || (Renderer.prototype._update.call(this), this.fire("update")); 9889 }, 9890 _initPath: function(layer) { 9891 var container = layer._container = vmlCreate("shape"); 9892 addClass(container, "leaflet-vml-shape " + (this.options.className || "")), container.coordsize = "1 1", 9893 layer._path = vmlCreate("path"), container.appendChild(layer._path), this._updateStyle(layer), 9894 this._layers[stamp(layer)] = layer; 9895 }, 9896 _addPath: function(layer) { 9897 var container = layer._container; 9898 this._container.appendChild(container), layer.options.interactive && layer.addInteractiveTarget(container); 9899 }, 9900 _removePath: function(layer) { 9901 var container = layer._container; 9902 _remove(container), layer.removeInteractiveTarget(container), delete this._layers[stamp(layer)]; 9903 }, 9904 _updateStyle: function(layer) { 9905 var stroke = layer._stroke, fill = layer._fill, options = layer.options, container = layer._container;
9906 container.stroked = !!options.stroke, container.filled = !!options.fill, options.stroke ? (stroke = stroke || (layer._stroke = vmlCreate("stroke")), 9907 container.appendChild(stroke), stroke.weight = options.weight + "px", stroke.color = options.color, 9908 stroke.opacity = options.opacity, options.dashArray ? stroke.dashStyle = isArray(options.dashArray) ? options.dashArray.join(" ") : options.dashArray.replace(/( *, *)/g, " ") : stroke.dashStyle = "", 9909 stroke.endcap = options.lineCap.replace("butt", "flat"), stroke.joinstyle = options.lineJoin) : stroke && (container.removeChild(stroke), 9910 layer._stroke = null), options.fill ? (fill = fill || (layer._fill = vmlCreate("fill")), 9911 container.appendChild(fill), fill.color = options.fillColor || options.color, fill.opacity = options.fillOpacity) : fill && (container.removeChild(fill), 9912 layer._fill = null); 9913 }, 9914 _updateCircle: function(layer) { 9915 var p = layer._point.round(), r = Math.round(layer._radius), r2 = Math.round(layer._radiusY || r); 9916 this._setPath(layer, layer._empty() ? "M0 0" : "AL " + p.x + "," + p.y + " " + r + "," + r2 + " 0,23592600"); 9917 }, 9918 _setPath: function(layer, path) { 9919 layer._path.v = path; 9920 }, 9921 _bringToFront: function(layer) { 9922 toFront(layer._container); 9923 }, 9924 _bringToBack: function(layer) { 9925 toBack(layer._container); 9926 } 9927 }, create$2 = vml ? vmlCreate : svgCreate, SVG = Renderer.extend({ 9928 getEvents: function() { 9929 var events = Renderer.prototype.getEvents.call(this); 9930 return events.zoomstart = this._onZoomStart, events; 9931 }, 9932 _initContainer: function() { 9933 this._container = create$2("svg"), this._container.setAttribute("pointer-events", "none"), 9934 this._rootGroup = create$2("g"), this._container.appendChild(this._rootGroup); 9935 }, 9936 _destroyContainer: function() { 9937 _remove(this._container), off(this._container), delete this._container, delete this._rootGroup, 9938 delete this._svgSize; 9939 }, 9940 _onZoomStart: function() { 9941 this._update(); 9942 }, 9943 _update: function() { 9944 if (!this._map._animatingZoom || !this._bounds) { 9945 Renderer.prototype._update.call(this); 9946 var b = this._bounds, size = b.getSize(), container = this._container; 9947 this._svgSize && this._svgSize.equals(size) || (this._svgSize = size, container.setAttribute("width", size.x), 9948 container.setAttribute("height", size.y)), setPosition(container, b.min), container.setAttribute("viewBox", [ b.min.x, b.min.y, size.x, size.y ].join(" ")), 9949 this.fire("update"); 9950 } 9951 }, 9952 _initPath: function(layer) { 9953 var path = layer._path = create$2("path"); 9954 layer.options.className && addClass(path, layer.options.className), layer.options.interactive && addClass(path, "leaflet-interactive"), 9955 this._updateStyle(layer), this._layers[stamp(layer)] = layer; 9956 }, 9957 _addPath: function(layer) { 9958 this._rootGroup || this._initContainer(), this._rootGroup.appendChild(layer._path), 9959 layer.addInteractiveTarget(layer._path); 9960 }, 9961 _removePath: function(layer) { 9962 _remove(layer._path), layer.removeInteractiveTarget(layer._path), delete this._layers[stamp(layer)]; 9963 }, 9964 _updatePath: function(layer) { 9965 layer._project(), layer._update(); 9966 }, 9967 _updateStyle: function(layer) { 9968 var path = layer._path, options = layer.options; 9969 path && (options.stroke ? (path.setAttribute("stroke", options.color), path.setAttribute("stroke-opacity", options.opacity), 9970 path.setAttribute("stroke-width", options.weight), path.setAttribute("stroke-linecap", options.lineCap), 9971 path.setAttribute("stroke-linejoin", options.lineJoin), options.dashArray ? path.setAttribute("stroke-dasharray", options.dashArray) : path.removeAttribute("stroke-dasharray"), 9972 options.dashOffset ? path.setAttribute("stroke-dashoffset", options.dashOffset)
9972: path.removeAttribute("stroke-dashoffset")) : path.setAttribute("stroke", "none"), 9973 options.fill ? (path.setAttribute("fill", options.fillColor || options.color), path.setAttribute("fill-opacity", options.fillOpacity), 9974 path.setAttribute("fill-rule", options.fillRule || "evenodd")) : path.setAttribute("fill", "none")); 9975 }, 9976 _updatePoly: function(layer, closed) { 9977 this._setPath(layer, pointsToPath(layer._parts, closed)); 9978 }, 9979 _updateCircle: function(layer) { 9980 var p = layer._point, r = Math.max(Math.round(layer._radius), 1), arc = "a" + r + "," + (Math.max(Math.round(layer._radiusY), 1) || r) + " 0 1,0 ", d = layer._empty() ? "M0 0" : "M" + (p.x - r) + "," + p.y + arc + 2 * r + ",0 " + arc + 2 * -r + ",0 "; 9981 this._setPath(layer, d); 9982 }, 9983 _setPath: function(layer, path) { 9984 layer._path.setAttribute("d", path); 9985 }, 9986 _bringToFront: function(layer) { 9987 toFront(layer._path); 9988 }, 9989 _bringToBack: function(layer) { 9990 toBack(layer._path); 9991 } 9992 }); 9993 function svg$1(options) { 9994 return svg || vml ? new SVG(options) : null; 9995 } 9996 vml && SVG.include(vmlMixin), Map.include({ 9997 getRenderer: function(layer) { 9998 var renderer = layer.options.renderer || this._getPaneRenderer(layer.options.pane) || this.options.renderer || this._renderer; 9999 return renderer = renderer || (this._renderer = this._createRenderer()), this.hasLayer(renderer) || this.addLayer(renderer), 10000 renderer; 10001 }, 10002 _getPaneRenderer: function(name) { 10003 if ("overlayPane" === name || void 0 === name) return !1; 10004 var renderer = this._paneRenderers[name]; 10005 return void 0 === renderer && (renderer = this._createRenderer({ 10006 pane: name 10007 }), this._paneRenderers[name] = renderer), renderer; 10008 }, 10009 _createRenderer: function(options) { 10010 return this.options.preferCanvas && canvas$1(options) || svg$1(options); 10011 } 10012 }); 10013 var Rectangle = Polygon.extend({ 10014 initialize: function(latLngBounds, options) { 10015 Polygon.prototype.initialize.call(this, this._boundsToLatLngs(latLngBounds), options); 10016 }, 10017 setBounds: function(latLngBounds) { 10018 return this.setLatLngs(this._boundsToLatLngs(latLngBounds)); 10019 }, 10020 _boundsToLatLngs: function(latLngBounds) { 10021 return [ (latLngBounds = toLatLngBounds(latLngBounds)).getSouthWest
10021(), latLngBounds.getNorthWest(), latLngBounds.getNorthEast(), latLngBounds.getSouthEast() ]; 10022 } 10023 }); 10024 SVG.create = create$2, SVG.pointsToPath = pointsToPath, GeoJSON.geometryToLayer = geometryToLayer, 10025 GeoJSON.coordsToLatLng = coordsToLatLng, GeoJSON.coordsToLatLngs = coordsToLatLngs, 10026 GeoJSON.latLngToCoords = latLngToCoords, GeoJSON.latLngsToCoords = latLngsToCoords, 10027 GeoJSON.getFeature = getFeature, GeoJSON.asFeature = asFeature, Map.mergeOptions({ 10028 boxZoom: !0 10029 }); 10030 var BoxZoom = Handler.extend({ 10031 initialize: function(map) { 10032 this._map = map, this._container = map._container, this._pane = map._panes.overlayPane, 10033 this._resetStateTimeout = 0, map.on("unload", this._destroy, this); 10034 }, 10035 addHooks: function() { 10036 on(this._container, "mousedown", this._onMouseDown, this); 10037 }, 10038 removeHooks: function() { 10039 off(this._container, "mousedown", this._onMouseDown, this); 10040 }, 10041 moved: function() { 10042 return this._moved; 10043 }, 10044 _destroy: function() { 10045 _remove(this._pane), delete this._pane; 10046 }, 10047 _resetState: function() { 10048 this._resetStateTimeout = 0, this._moved = !1; 10049 }, 10050 _clearDeferredResetState: function() { 10051 0 !== this._resetStateTimeout && (clearTimeout(this._resetStateTimeout), this._resetStateTimeout = 0); 10052 }, 10053 _onMouseDown: function(e) { 10054 if (!e.shiftKey || 1 !== e.which && 1 !== e.button) return !1; 10055 this._clearDeferredResetState(), this._resetState(), disableTextSelection(), disableImageDrag(), 10056 this._startPoint = this._map.mouseEventToContainerPoint(e), on(document, { 10057 contextmenu: stop, 10058 mousemove: this._onMouseMove, 10059 mouseup: this._onMouseUp, 10060 keydown: this._onKeyDown 10061 }, this); 10062 }, 10063 _onMouseMove: function(e) { 10064 this._moved || (this._moved = !0, this._box = create$1("div", "leaflet-zoom-box", this._container), 10065 addClass(this._container, "leaflet-crosshair"), this._map.fire("boxzoomstart")), 10066 this._point = this._map.mouseEventToContainerPoint(e); 10067 var bounds = new Bounds(this._point, this._startPoint), size = bounds.getSize(); 10068 setPosition(this._box, bounds.min), this._box.style.width = size.x + "px", this._box.style.height = size.y + "px"; 10069 }, 10070 _finish: function() { 10071 this._moved && (_remove(this._box), removeClass(this._container, "leaflet-crosshair")), 10072 enableTextSelection(), enableImageDrag(), off(document, { 10073 contextmenu: stop, 10074 mousemove: this._onMouseMove, 10075 mouseup: this._onMouseUp, 10076 keydown: this._onKeyDown 10077 }, this); 10078 }, 10079 _onMouseUp: function(e) { 10080 if ((1 === e.which || 1 === e.button) && (this._finish(), this._moved)) { 10081 this._clearDeferredResetState(), this._resetStateTimeout = setTimeout(bind(this._resetState, this), 0); 10082 var bounds = new LatLngBounds(this._map.containerPointToLatLng(this._startPoint), this._map.containerPointToLatLng(this._point)); 10083 this._map.fitBounds(bounds).fire("boxzoomend", { 10084 boxZoomBounds: bounds 10085 }); 10086 } 10087 }, 10088 _onKeyDown: function(e) { 10089 27 === e.keyCode && this._finish(); 10090 } 10091 }); 10092 Map.addInitHook("addHandler", "boxZoom", BoxZoom), Map.mergeOptions({ 10093 doubleClickZoom: !0 10094 }); 10095 var DoubleClickZoom = Handler.extend({ 10096 addHooks: function() { 10097 this._map.on("dblclick", this._onDoubleClick, this); 10098 }, 10099 removeHooks: function() { 10100 this._map.off("dblclick", this._onDoubleClick, this); 10101 }, 10102 _onDoubleClick: function(e) { 10103 var map = this._map, oldZoom = map.getZoom(), delta = map.options.zoomDelta, zoom = e.originalEvent.shiftKey ? oldZoom - delta : oldZoom + delta; 10104 "center" === map.options.doubleClickZoom ? map.setZoom(zoom) : map.setZoomAround(e.containerPoint, zoom); 10105 } 10106 }); 10107 Map.addInitHook("addHandler", "doubleClickZoom", DoubleClickZoom), Map.mergeOptions({ 10108 dragging: !0, 10109 inertia: !android23, 10110 inertiaDeceleration: 3400, 10111 inertiaMaxSpeed: 1 / 0, 10112 easeLinearity: .2, 10113 worldCopyJump: !1, 10114 maxBoundsViscosity: 0 10115 }); 10116 var Drag = Handler.extend({ 10117 addHooks: function() { 10118 if (!this._draggable) { 10119 var map = this._map; 10120 this._draggable = new Draggable(map._mapPane, map._container), this._draggable.on({ 10121 dragstart: this._onDragStart, 10122 drag: this._onDrag, 10123 dragend: this._onDragEnd 10124 }, this), this._draggable.on("predrag", this._onPreDragLimit, this), map.options.worldCopyJump && (this._draggable.on("predrag", this._onPreDragWrap, this), 10125 map.on("zoomend", this._onZoomEnd, this), map.whenReady(this._onZoomEnd, this)); 10126 } 10127 addClass(this._map._container, "leaflet-grab leaflet-touch-drag"), this._draggable.enable(), 10128 this._positions = [], this._times = []; 10129 }, 10130 removeHooks: function() { 10131 removeClass(this._map._container, "leaflet-grab"), removeClass(this._map._container, "leaflet-touch-drag"), 10132 this._draggable.disable(); 10133 }, 10134 moved: function() { 10135 return this._draggable && this._draggable._moved; 10136 }, 10137 moving: function() { 10138 return this._draggable && this._draggable._mov
10138ing; 10139 }, 10140 _onDragStart: function() { 10141 var map = this._map; 10142 if (map._stop(), this._map.options.maxBounds && this._map.options.maxBoundsViscosity) { 10143 var bounds = toLatLngBounds(this._map.options.maxBounds); 10144 this._offsetLimit = toBounds(this._map.latLngToContainerPoint(bounds.getNorthWest()).multiplyBy(-1), this._map.latLngToContainerPoint(bounds.getSouthEast()).multiplyBy(-1).add(this._map.getSize())), 10145 this._viscosity = Math.min(1, Math.max(0, this._map.options.maxBoundsViscosity)); 10146 } else this._offsetLimit = null; 10147 map.fire("movestart").fire("dragstart"), map.options.inertia && (this._positions = [], 10148 this._times = []); 10149 }, 10150 _onDrag: function(e) { 10151 if (this._map.options.inertia) { 10152 var time = this._lastTime = +new Date(), pos = this._lastPos = this._draggable._absPos || this._draggable._newPos; 10153 this._positions.push(pos), this._times.push(time), this._prunePositions(time); 10154 } 10155 this._map.fire("move", e).fire("drag", e); 10156 }, 10157 _prunePositions: function(time) { 10158 for (;1 < this._positions.length && 50 < time - this._times[0]; ) this._positions.shift(), 10159 this._times.shift(); 10160 }, 10161 _onZoomEnd: function() { 10162 var pxCenter = this._map.getSize().divideBy(2), pxWorldCenter = this._map.latLngToLayerPoint([ 0, 0 ]); 10163 this._initialWorldOffset = pxWorldCenter.subtract(pxCenter).x, this._worldWidth = this._map.getPixelWorldBounds().getSize().x; 10164 }, 10165 _viscousLimit: function(value, threshold) { 10166 return value - (value - threshold) * this._viscosity; 10167 }, 10168 _onPreDragLimit: function() { 10169 if (this._viscosity && this._offsetLimit) { 10170 var offset = this._draggable._newPos.subtract(this._draggable._startPos), limit = this._offsetLimit; 10171 offset.x < limit.min.x && (offset.x = this._viscousLimit(offset.x, limit.min.x)), 10172 offset.y < limit.min.y && (offset.y = this._viscousLimit(offset.y, limit.min.y)), 10173 offset.x > limit.max.x && (offset.x = this._viscousLimit(offset.x, limit.max.x)), 10174 offset.y > limit.max.y && (offset.y = this._viscousLimit(offset.y, limit.max.y)), 10175 this._draggable._newPos = this._draggable._startPos.add(offset); 10176 } 10177 }, 10178 _onPreDragWrap: function() { 10179 var worldWidth = this._worldWidth, halfWidth = Math.round(worldWidth / 2), dx = this._initialWorldOffset, x = this._draggable._newPos.x, newX1 = (x - halfWidth + dx) % worldWidth + halfWidth - dx, newX2 = (x + halfWidth + dx) % worldWidth - halfWidth - dx, newX = Math.abs(newX1 + dx) < Math.abs(newX2 + dx) ? newX1 : newX2; 10180 this._draggable._absPos = this._draggable._newPos.clone(), this._draggable._newPos.x = newX; 10181 }, 10182 _onDragEnd: function(e) { 10183 var map = this._map, options = map.options, noInertia = !options.inertia || this._times.length < 2; 10184 if (map.fire("dragend", e), noInertia) map.fire("moveend"); else { 10185 this._prunePositions(+new Date()); 10186 var direction = this._lastPos.subtract(this._positions[0]), duration = (this._lastTime - this._times[0]) / 1e3, ease = options.easeLinearity, speedVector = direction.multiplyBy(ease / duration), speed = speedVector.distanceTo([ 0, 0 ]), limitedSpeed = Math.min(options.inertiaMaxSpeed, speed), limitedSpeedVector = speedVector.multiplyBy(limitedSpeed / speed), decelerationDuration = limitedSpeed / (options.inertiaDeceleration * ease), offset = limitedSpeedVector.multiplyBy(-decelerationDuration / 2).round(); 10187 offset.x || offset.y ? (offset = map._limitOffset(offset, map.options.maxBounds),
10188 requestAnimFrame(function() { 10189 map.panBy(offset, { 10190 duration: decelerationDuration, 10191 easeLinearity: ease, 10192 noMoveStart: !0, 10193 animate: !0 10194 }); 10195 })) : map.fire("moveend"); 10196 } 10197 } 10198 }); 10199 Map.addInitHook("addHandler", "dragging", Drag), Map.mergeOptions({ 10200 keyboard: !0, 10201 keyboardPanDelta: 80 10202 }); 10203 var Keyboard = Handler.extend({ 10204 keyCodes: { 10205 left: [ 37 ], 10206 right: [ 39 ], 10207 down: [ 40 ], 10208 up: [ 38 ], 10209 zoomIn: [ 187, 107, 61, 171 ], 10210 zoomOut: [ 189, 109, 54, 173 ] 10211 }, 10212 initialize: function(map) { 10213 this._map = map, this._setPanDelta(map.options.keyboardPanDelta), this._setZoomDelta(map.options.zoomDelta); 10214 }, 10215 addHooks: function() { 10216 var container = this._map._container; 10217 container.tabIndex <= 0 && (container.tabIndex = "0"), on(container, { 10218 focus: this._onFocus, 10219 blur: this._onBlur, 10220 mousedown: this._onMouseDown 10221 }, this), this._map.on({ 10222 focus: this._addHooks, 10223 blur: this._removeHooks 10224 }, this); 10225 }, 10226 removeHooks: function() { 10227 this._removeHooks(), off(this._map._container, { 10228 focus: this._onFocus, 10229 blur: this._onBlur, 10230 mousedown: this._onMouseDown 10231 }, this), this._map.off({ 10232 focus: this._addHooks, 10233 blur: this._removeHooks 10234 }, this); 10235 }, 10236 _onMouseDown: function() { 10237 if (!this._focused) { 10238 var body = document.body, docEl = document.documentElement, top = body.scrollTop || docEl.scrollTop, left = body.scrollLeft || docEl.scrollLeft; 10239 this._map._container.focus(), window.scrollTo(left, top); 10240 } 10241 }, 10242 _onFocus: function() { 10243 this._focused = !0, this._map.fire("focus"); 10244 }, 10245 _onBlur: function() { 10246 this._focused = !1, this._map.fire("blur"); 10247 }, 10248 _setPanDelta: function(panDelta) { 10249 var i, len, keys = this._panKeys = {}, codes = this.keyCodes; 10250 for (i = 0, len = codes.left.length; i < len; i++) keys[codes.left[i]] = [ -1 * panDelta, 0 ]; 10251 for (i = 0, len = codes.right.length; i < len; i++) keys[codes.right[i]] = [ panDelta, 0 ]; 10252 for (i = 0, len = codes.down.length; i < len; i++) keys[codes.down[i]] = [ 0, panDelta ]; 10253 for (i = 0, len = codes.up.length; i < len; i++) keys[codes.up[i]] = [ 0, -1 * panDelta ]; 10254 }, 10255 _setZoomDelta: function(zoomDelta) { 10256 var i, len, keys = this._zoomKeys = {}, codes = this.keyCodes; 10257 for (i = 0, len = codes.zoomIn.length; i < len; i++) keys[codes.zoomIn[i]] = zoomDelta; 10258 for (i = 0, len = codes.zoomOut.length; i < len; i++) keys[codes.zoomOut[i]] = -zoomDelta; 10259 }, 10260 _addHooks: function() { 10261 on(document, "keydown", this._onKeyDown, this); 10262 }, 10263 _removeHooks: function() { 10264 off(document, "keydown", this._onKeyDown, this); 10265 }, 10266 _onKeyDown: function(e) { 10267 if (!(e.altKey || e.ctrlKey || e.metaKey)) { 10268 var offset, key = e.keyCode, map = this._map; 10269 if (key in this._panKeys) map._panAnim && map._panAnim._inProgress || (offset = this._panKeys[key], 10270 e.shiftKey && (offset = toPoint(offset).multiplyBy(3)), map.panBy(offset), map.options.maxBounds && map.panInsideBounds(map.options.maxBounds)); else if (key in this._zoomKeys) map.setZoom(map.getZoom() + (e.shiftKey ? 3 : 1) * this._zoomKeys[key]); else { 10271 if (27 !== key || !map._popup || !map._popup.options.closeOnEscapeKey) return; 10272 map.closePopup(); 10273 } 10274 stop(e); 10275 } 10276 } 10277 }); 10278 Map.addInitHook("addHandler", "keyboard", Keyboard), Map.mergeOptions({ 10279 scrollWheelZoom: !0, 10280 wheelDebounceTime: 40, 10281 wheelPxPerZoomLevel: 60 10282 }); 10283 var ScrollWheelZoom = Handler.extend({ 10284 addHooks: function() { 10285 on(this._map._container, "mousewheel", this._onWheelScroll, this), this._delta = 0; 10286 }, 10287 removeHooks: function() { 10288 off(this._map._container, "mousewheel", this._onWheelScroll, this); 10289 }, 10290 _onWheelScroll: function(e) { 10291 var delta = getWheelDelta(e), debounce = this._map.options.wheelDebounceTime; 10292 this._delta += delta, this._lastMousePos = this._map.mouseEventToContainerPoint(e), 10293 this._startTime || (this._startTime = +new Date()); 10294 var left = Math.max(debounce - (+new Date() - this._startTime), 0); 10295 clearTimeout(this._timer), this._timer = setTimeout(bind(this._performZoom, this), left), 10296 stop(e); 10297 }, 10298 _performZoom: function() { 10299 var map = this._map, zoom = map.getZoom(), snap = this._map.options.zoomSnap || 0; 10300 map._stop(); 10301 var d2 = this._delta / (4 * this._map.options.wheelPxPerZoomLevel), d3 = 4 * Math.log(2 / (1 + Math.exp(-Math.abs(d2)))) / Math.LN2, d4 = snap ? Math.ceil(d3 / snap) * snap : d3, delta = map._limitZoom(zoom + (0 < this._delta ? d4 : -d4)) - zoom; 10302 this._delta = 0, this._startTime = null, delta && ("center" === map.options.scrollWheelZoom ? map.setZoom(zoom + delta) : map.setZoomAround(this._lastMousePos, zoom + delta)); 10303 } 10304 }); 10305 Map.addInitHook("addHandler", "scrollWheelZoom", ScrollWheelZoom), Map.mergeOptions({ 10306 tap: !0, 10307 tapTolerance: 15 10308 }); 10309 var Tap = Handler.extend({ 10310 addHooks: function() { 10311 on(this._map._container, "touchstart", this._onDown, this); 10312 }, 10313 removeHooks: function() { 10314 off(this._map._container, "touchstart", this._onDown, this); 10315 }, 10316 _onDown: function(e) { 10317 if (e.touches) { 10318 if (preventDefault(e), this._fireClick = !0, 1 < e.touches.length) return this._fireClick = !1, 10319 void clearTimeout(this._holdTimeout); 10320 var first = e.touches[0], el = first.target; 10321 this._startPos = this._newPos = new Point(first.clientX, first.clientY), el.tagName && "a" === el.tagName.toLowerCase() && addClass(el, "leaflet-active"), 10322 this._holdTimeout = setTimeout(bind(function() { 10323 this._isTapValid() && (this._fireClick = !1, this._onUp(), this._simulateEvent("contextmenu", first)); 10324 }, this), 1e3), this._simulateEvent("mousedown", first), on(document, { 10325 touchmove: this._onMove, 10326 touchend: this._onUp 10327 }, this); 10328 } 10329 }, 10330 _onUp: function(e) { 10331 if (clearTimeout(this._holdTimeout), off(document, { 10332 touchmove: this._onMove, 10333 touchend: this._onUp 10334 }, this), this._fireClick && e && e.changedTouches) { 10335 var first = e.changedTouches[0], el = first.target; 10336 el && el.tagName && "a" === el.tagName.toLowerCase() && removeClass(el, "leaflet-active"), 10337 this._simulateEvent("mouseup", first), this._isTapValid() && this._simulateEvent("click", first); 10338 } 10339 }, 10340 _isTapValid: function() { 10341 return this._newPos.distanceTo(this._startPos) <= this._map.options.tapTolerance; 10342 }, 10343 _onMove: function(e) { 10344 var first = e.touches[0]; 10345 this._newPos = new Point(first.clientX, first.clientY), this._simulateEvent("mousemove", first); 10346 }, 10347 _simulateEvent: function(type, e) { 10348 var simulatedEvent = document.createEvent("MouseEvents"); 10349 simulatedEvent._simulated = !0, e.target._simulatedClick = !0, simulatedEvent.initMouseEvent(type, !0, !0, window, 1, e.screenX, e.screenY, e.clientX, e.clientY, !1, !1, !1, !1, 0, null), 10350 e.target.dispatchEvent(simulatedEvent); 10351 } 10352 }); 10353 touch && !pointer && Map.addInitHook("addHandler", "tap", Tap), Map.mergeOptions({ 10354 touchZoom: touch && !android23, 10355 bounceAtZoomLimits: !0 10356 }); 10357 var TouchZoom = Handler.extend({ 10358 addHooks: function() { 10359 addClass(this._map._container, "leaflet-touch-zoom"), on(this._map._container, "touchstart", this._onTouchStart, this); 10360 }, 10361 removeHooks: function() { 10362 removeClass(this._map._container, "leaflet-touch-zoom"), off(this._map._container, "touchstart", this._onTouchStart, this); 10363 }, 10364 _onTouchStart: function(e) { 10365 var map = this._map; 10366 if (e.touches && 2 === e.touches.length && !map._animatingZoom && !this._zooming) { 10367 var p1 = map.mouseEventToContainerPoint(e.touches[0]), p2 = map.mouseEventToContainerPoint(e.touches[1]); 10368 this._centerPoint = map.getSize()._divideBy(2), this._startLatLng = map.containerPointToLatLng(this._centerPoint), 10369 "center" !== map.options.touchZoom && (this._pinchStartLatLng = map.containerPointToLatLng(p1.add(p2)._divideBy(2))), 10370 this._startDist = p1.distanceTo(p2), this._startZoom = map.getZoom(), this._moved = !1, 10371 this._zooming = !0, map._stop(), on(document, "touchmove", this._onTouchMove, this), 10372 on(document, "touchend", this._onTouchEnd, this), preventDefault(e); 10373 } 10374 }, 10375 _onTouchMove: function(e) { 10376 if (e.touches && 2 === e.touches.length && this._zooming) { 10377 var map = this._map, p1 = map.mouseEventToContainerPoint(e.touches[0]), p2 = map.mouseEventToContainerPoint(e.touches[1]), scale = p1.distanceTo(p2) / this._startDist; 10378 if (this._zoom = map.getScaleZoom(scale, this._startZoom), !map.options.bounceAtZoomLimits && (this._zoom < map.getMinZoom() && scale < 1 || this._zoom > map.getMaxZoom() && 1 < scale) && (this._zoom = map._limitZoom(this._zoom)), 10379 "center" === map.options.touchZoom) { 10380 if (this._center = this._startLatLng, 1 == scale) return; 10381 } else { 10382 var delta = p1._add(p2)._divideBy(2)._subtract(this._centerPoint); 10383 if (1 == scale && 0 === delta.x && 0 === delta.y) return; 10384 this._center = map.unproject(map.project(this._pinchStartLatLng, this._zoom).subtract(delta), this._zoom); 10385 } 10386 this._moved || (map._moveStart(!0, !1), this._moved = !0), cancelAnimFrame
10386(this._animRequest); 10387 var moveFn = bind(map._move, map, this._center, this._zoom, { 10388 pinch: !0, 10389 round: !1 10390 }); 10391 this._animRequest = requestAnimFrame(moveFn, this, !0), preventDefault(e); 10392 } 10393 }, 10394 _onTouchEnd: function() { 10395 this._moved && this._zooming ? (this._zooming = !1, cancelAnimFrame(this._animRequest), 10396 off(document, "touchmove", this._onTouchMove), off(document, "touchend", this._onTouchEnd), 10397 this._map.options.zoomAnimation ? this._map._animateZoom(this._center, this._map._limitZoom(this._zoom), !0, this._map.options.zoomSnap) : this._map._resetView(this._center, this._map._limitZoom(this._zoom))) : this._zooming = !1; 10398 } 10399 }); 10400 Map.addInitHook("addHandler", "touchZoom", TouchZoom), Map.BoxZoom = BoxZoom, Map.DoubleClickZoom = DoubleClickZoom, 10401 Map.Drag = Drag, Map.Keyboard = Keyboard, Map.ScrollWheelZoom = ScrollWheelZoom, 10402 Map.Tap = Tap, Map.TouchZoom = TouchZoom, Object.freeze = freeze, exports.version = "1.5.1+HEAD.2e3e0ff", 10403 exports.Control = Control, exports.control = control, exports.Browser = Browser, 10404 exports.Evented = Evented, exports.Mixin = Mixin, exports.Util = Util, exports.Class = Class, 10405 exports.Handler = Handler, exports.extend = extend, exports.bind = bind, exports.stamp = stamp, 10406 exports.setOptions = setOptions, exports.DomEvent = DomEvent, exports.DomUtil = DomUtil, 10407 exports.PosAnimation = PosAnimation, exports.Draggable = Draggable, exports.LineUtil = LineUtil, 10408 exports.PolyUtil = PolyUtil, exports.Point = Point, exports.point = toPoint, exports.Bounds = Bounds, 10409 exports.bounds = toBounds, exports.Transformation = Transformation, exports.transformation = toTransformation, 10410 exports.Projection = index, exports.LatLng = LatLng, exports.latLng = toLatLng, 10411 exports.LatLngBounds = LatLngBounds, exports.latLngBounds = toLatLngBounds, exports.CRS = CRS, 10412 exports.GeoJSON = GeoJSON, exports.geoJSON = geoJSON, exports.geoJson = geoJson, 10413 exports.Layer = Layer, exports.LayerGroup = LayerGroup, exports.layerGroup = function(layers, options) { 10414 return new LayerGroup(layers, options); 10415 }, exports.FeatureGroup = FeatureGroup, exports.featureGroup = function(layers) { 10416 return new FeatureGroup(layers); 10417 }, exports.ImageOverlay = ImageOverlay, exports.imageOverlay = function(url, bounds, options) { 10418 return new ImageOverlay(url, bounds, options); 10419 }, exports.VideoOverlay = VideoOverlay, exports.videoOverlay = function(video, bounds, options) { 10420 return new VideoOverlay(video, bounds, options); 10421 }, exports.SVGOverlay = SVGOverlay, exports.svgOverlay = function(el, bounds, options) { 10422 return new SVGOverlay(el, bounds, options); 10423 }, exports.DivOverlay = DivOverlay, exports.Popup = Popup, exports.popup = function(options, source) { 10424 return new Popup(options, source); 10425 }, exports.Tooltip = Tooltip, exports.tooltip = function(options, source) { 10426 return new Tooltip(options, source); 10427 }, exports.Icon = Icon, exports.icon = function(options) { 10428 return new Icon(options); 10429 }, exports.DivIcon = DivIcon, exports.divIcon = function(options) { 10430 return new DivIcon(options); 10431 }, exports.Marker = Marker, exports.marker = function(latlng, options) { 10432 return new Marker(latlng, options); 10433 }, exports.TileLayer = TileLayer, exports.tileLayer = tileLayer, exports.GridLayer = GridLayer, 10434 exports.gridLayer = function(options) { 10435 return new GridLayer(options); 10436 }, exports.SVG = SVG, exports.svg = svg$1, exports.Renderer = Renderer, exports.Canvas = Canvas, 10437 exports.canvas = canvas$1, exports.Path = Path, exports.CircleMarker = CircleMarker, 10438 exports.circleMarker = function(latlng, options) { 10439 return new CircleMarker(latlng, options); 10440 }, exports.Circle = Circle, exports.circle = function(latlng, options, legacyOptions) { 10441 return new Circle(latlng, options, legacyOptions); 10442 }, exports.Polyline = Polyline, exports.polyline = function(latlngs, options) { 10443 return new Polyline(latlngs, options); 10444 }, exports.Polygon = Polygon, exports.polygon = function(latlngs, options) { 10445 return new Polygon(latlngs, options); 10446 }, exports.Rectangle = Rectangle, exports.rectangle = function(latLngBounds, options) { 10447 return new Rectangle(latLngBounds, options); 10448 }, exports.Map = Map, exports.map = function(id, options) { 10449 return new Map(id, options); 10450 }; 10451 var oldL = window.L; 10452 exports.noConflict = function() { 10453 return window.L = oldL, this; 10454 }
10454, window.L = exports; 10455 }, "object" === (void 0 === exports ? "undefined" : _typeof(exports)) && void 0 !== module ? factory(exports) : "function" == typeof define && define.amd ? define([ "exports" ], factory) : factory((void 0).L = {}); 10456 }, { 10457 "core-js/modules/es6.array.fill": 238, 10458 "core-js/modules/es6.array.sort": 242, 10459 "core-js/modules/es6.date.to-string": 243, 10460 "core-js/modules/es6.function.name": 244, 10461 "core-js/modules/es6.math.trunc": 246, 10462 "core-js/modules/es6.number.constructor": 247, 10463 "core-js/modules/es6.object.freeze": 249, 10464 "core-js/modules/es6.object.to-string": 252, 10465 "core-js/modules/es6.regexp.constructor": 255, 10466 "core-js/modules/es6.regexp.replace": 259, 10467 "core-js/modules/es6.regexp.split": 261, 10468 "core-js/modules/es6.regexp.to-string": 262, 10469 "core-js/modules/es6.string.includes": 264, 10470 "core-js/modules/es6.symbol": 268, 10471 "core-js/modules/es6.typed.uint8-array": 269, 10472 "core-js/modules/es7.array.includes": 270, 10473 "core-js/modules/es7.symbol.async-iterator": 273 10474 } ], 10475 22: [ function(require, module, exports) { 10476 "use strict"; 10477 function _typeof(obj) { 10478 return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { 10479 return typeof obj; 10480 } : function(obj) { 10481 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 10482 })(obj); 10483 } 10484 var factory; 10485 require("core-js/modules/es7.symbol.async-iterator"), require("core-js/modules/es6.symbol"), 10486 require("core-js/modules/es6.regexp.replace"), factory = function(exports) { 10487 var MarkerClusterGroup = L.MarkerClusterGroup = L.FeatureGroup.extend({ 10488 options: { 10489 maxClusterRadius: 80, 10490 iconCreateFunction: null, 10491 clusterPane: L.Marker.prototype.options.pane, 10492 spiderfyOnMaxZoom: !0, 10493 showCoverageOnHover: !0, 10494 zoomToBoundsOnClick: !0, 10495 singleMarkerMode: !1, 10496 disableClusteringAtZoom: null, 10497 removeOutsideVisibleBounds: !0, 10498 animate: !0, 10499 animateAddingMarkers: !1, 10500 spiderfyDistanceMultiplier: 1, 10501 spiderLegPolylineOptions: { 10502 weight: 1.5, 10503 color: "#222", 10504 opacity: .5 10505 }, 10506 chunkedLoading: !1, 10507 chunkInterval: 200, 10508 chunkDelay: 50, 10509 chunkProgress: null, 10510 polygonOptions: {} 10511 }, 10512 initialize: function(options) { 10513 L.Util.setOptions(this, options), this.options.iconCreateFunction || (this.options.iconCreateFunction = this._defaultIconCreateFunction), 10514 this._featureGroup = L.featureGroup(), this._featureGroup.addEventParent(this), 10515 this._nonPointGroup = L.featureGroup(), this._nonPointGroup.addEventParent(this), 10516 this._inZoomAnimation = 0, this._needsClustering = [], this._needsRemoving = [], 10517 this._currentShownBounds = null, this._queue = [], this._childMarkerEventHandlers = { 10518 dragstart: this._childMarkerDragStart, 10519 move: this._childMarkerMoved, 10520 dragend: this._childMarkerDragEnd 10521 }; 10522 var animate = L.DomUtil.TRANSITION && this.options.animate; 10523 L.extend(this, animate ? this._withAnimation : this._noAnimation), this._markerCluster = animate ? L.MarkerCluster : L.MarkerClusterNonAnimated; 10524 }, 10525 addLayer: function(layer) { 10526 if (layer instanceof L.LayerGroup) return this.addLayers([ layer ]); 10527 if (!layer.getLatLng) return this._nonPointGroup.addLayer(layer), this.fire("layeradd", { 10528 layer: layer 10529 }), this; 10530 if (!this._map) return this._needsClustering.push(layer), this.fire("layeradd", { 10531 layer: layer 10532 }), this; 10533 if (this.hasLayer(layer)) return this; 10534 this._unspiderfy && this._unspiderfy(), this._addLayer(layer, this._maxZoom), this.fire("layeradd", { 10535 layer: layer 10536 }), this._topClusterLevel._recalculateBounds(), this._refreshClustersIcons(); 10537 var visibleLayer = layer, currentZoom = this._zoom; 10538 if (layer.__parent) for (;visibleLayer.__parent._zoom >= currentZoom; ) visibleLayer = visibleLayer.__parent; 10539 return this._currentShownBounds.contains(visibleLayer.getLatLng()) && (this.options.animateAddingMarkers ? this._animationAddLayer(layer, visibleLayer) : this._animationAddLayerNonAnimated(layer, visibleLayer)), 10540 this; 10541 }, 10542 removeLayer: function(layer) { 10543 return layer instanceof L.LayerGroup ? this.removeLayers([ layer ]) : (layer.getLatLng ? this._map ? layer.__parent && (this._unspiderfy && (this._unspiderfy(), 10544 this._unspiderfyLayer(layer)), this._removeLayer(layer, !0), this.fire("layerremove", { 10545 layer: layer 10546 }), this._topClusterLevel._recalculateBounds(), this._refreshClustersIcons(), layer.off(this._childMarkerEventHandlers, this), 10547 this._featureGroup.hasLayer(layer) && (this._featureGroup.removeLayer(layer), layer.clusterShow && layer.clusterShow())) : (!this._arraySplice(this._needsClustering, layer) && this.hasLayer(layer) && this._needsRemoving.push({ 10548 layer: layer, 10549 latlng: layer._latlng 10550 }), this.fire("layerremove", { 10551 layer: layer 10552 })) : (this._nonPointGroup.removeLayer(layer), this.fire("layerremove", { 10553 layer: layer 10554 })), this); 10555 }, 10556 addLayers: function(layersArray, skipLayerAddEvent) { 10557 if (!L.Util.isArray(layersArray)) return this.addLayer(layersArray); 10558 var m, fg = this._featureGroup, npg = this._nonPointGroup, chunked = this.options.chunkedLoading, chunkInterval = this.options.chunkInterval, chunkProgress = this.options.chunkProgress, l = layersArray.length, offset = 0, originalArray = !0; 10559 if (this._map) { 10560 var started = new Date().getTime(), process = L.bind(function() { 10561 for (var start = new Date().getTime(); offset < l; offset++) { 10562 if (chunked && offset % 200 == 0) {
vendor: 13,716 bytes, lines 10563-10745
10563 var elapsed = new Date().getTime() - start; 10564 if (chunkInterval < elapsed) break; 10565 } 10566 if ((m = layersArray[offset]) instanceof L.LayerGroup) originalArray && (layersArray = layersArray.slice(), 10567 originalArray = !1), this._extractNonGroupLayers(m, layersArray), l = layersArray.length; else if (m.getLatLng) { 10568 if (!this.hasLayer(m) && (this._addLayer(m, this._maxZoom), skipLayerAddEvent || this.fire("layeradd", { 10569 layer: m 10570 }), m.__parent && 2 === m.__parent.getChildCount())) { 10571 var markers = m.__parent.getAllChildMarkers(), otherMarker = markers[0] === m ? markers[1] : markers[0]; 10572 fg.removeLayer(otherMarker); 10573 } 10574 } else npg.addLayer(m), skipLayerAddEvent || this.fire("layeradd", { 10575 layer: m 10576 }); 10577 } 10578 chunkProgress && chunkProgress(offset, l, new Date().getTime() - started), offset === l ? (this._topClusterLevel._recalculateBounds(), 10579 this._refreshClustersIcons(), this._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds)) : setTimeout(process, this.options.chunkDelay); 10580 }, this); 10581 process(); 10582 } else for (var needsClustering = this._needsClustering; offset < l; offset++) (m = layersArray[offset]) instanceof L.LayerGroup ? (originalArray && (layersArray = layersArray.slice(), 10583 originalArray = !1), this._extractNonGroupLayers(m, layersArray), l = layersArray.length) : m.getLatLng ? this.hasLayer(m) || needsClustering.push(m) : npg.addLayer(m); 10584 return this; 10585 }, 10586 removeLayers: function(layersArray) { 10587 var i, m, l = layersArray.length, fg = this._featureGroup, npg = this._nonPointGroup, originalArray = !0; 10588 if (!this._map) { 10589 for (i = 0; i < l; i++) (m = layersArray[i]) instanceof L.LayerGroup ? (originalArray && (layersArray = layersArray.slice(), 10590 originalArray = !1), this._extractNonGroupLayers(m, layersArray), l = layersArray.length) : (this._arraySplice(this._needsClustering, m), 10591 npg.removeLayer(m), this.hasLayer(m) && this._needsRemoving.push({ 10592 layer: m, 10593 latlng: m._latlng 10594 }), this.fire("layerremove", { 10595 layer: m 10596 })); 10597 return this; 10598 } 10599 if (this._unspiderfy) { 10600 this._unspiderfy(); 10601 var layersArray2 = layersArray.slice(), l2 = l; 10602 for (i = 0; i < l2; i++) (m = layersArray2[i]) instanceof L.LayerGroup ? (this._extractNonGroupLayers(m, layersArray2), 10603 l2 = layersArray2.length) : this._unspiderfyLayer(m); 10604 } 10605 for (i = 0; i < l; i++) (m = layersArray[i]) instanceof L.LayerGroup ? (originalArray && (layersArray = layersArray.slice(), 10606 originalArray = !1), this._extractNonGroupLayers(m, layersArray), l = layersArray.length) : m.__parent ? (this._removeLayer(m, !0, !0), 10607 this.fire("layerremove", { 10608 layer: m 10609 }), fg.hasLayer(m) && (fg.removeLayer(m), m.clusterShow && m.clusterShow())) : (npg.removeLayer(m), 10610 this.fire("layerremove", { 10611 layer: m 10612 })); 10613 return this._topClusterLevel._recalculateBounds(), this._refreshClustersIcons(), 10614 this._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds), 10615 this; 10616 }, 10617 clearLayers: function() { 10618 return this._map || (this._needsClustering = [], this._needsRemoving = [], delete this._gridClusters, 10619 delete this._gridUnclustered), this._noanimationUnspiderfy && this._noanimationUnspiderfy(), 10620 this._featureGroup.clearLayers(), this._nonPointGroup.clearLayers(), this.eachLayer(function(marker) { 10621 marker.off(this._childMarkerEventHandlers, this), delete marker.__parent; 10622 }, this), this._map && this._generateInitialClusters(), this; 10623 }, 10624 getBounds: function() { 10625 var bounds = new L.LatLngBounds(); 10626 this._topClusterLevel && bounds.extend(this._topClusterLevel._bounds); 10627 for (var i = this._needsClustering.length - 1; 0 <= i; i--) bounds.extend(this._needsClustering[i].getLatLng()); 10628 return bounds.extend(this._nonPointGroup.getBounds()), bounds; 10629 }, 10630 eachLayer: function(method, context) { 10631 var thisNeedsRemoving, i, j, markers = this._needsClustering.slice(), needsRemoving = this._needsRemoving; 10632 for (this._topClusterLevel && this._topClusterLevel.getAllChildMarkers(markers), 10633 i = markers.length - 1; 0 <= i; i--) { 10634 for (thisNeedsRemoving = !0, j = needsRemoving.length - 1; 0 <= j; j--) if (needsRemoving[j].layer === markers[i]) { 10635 thisNeedsRemoving = !1; 10636 break; 10637 } 10638 thisNeedsRemoving && method.call(context, markers[i]); 10639 } 10640 this._nonPointGroup.eachLayer(method, context); 10641 }, 10642 getLayers: function() { 10643 var layers = []; 10644 return this.eachLayer(function(l) { 10645 layers.push(l); 10646 }), layers; 10647 }, 10648 getLayer: function(id) { 10649 var result = null; 10650 return id = parseInt(id, 10), this.eachLayer(function(l) { 10651 L.stamp(l) === id && (result = l); 10652 }), result; 10653 }, 10654 hasLayer: function(layer) { 10655 if (!layer) return !1; 10656 var i, anArray = this._needsClustering; 10657 for (i = anArray.length - 1; 0 <= i; i--) if (anArray[i] === layer) return !0; 10658 for (i = (anArray = this._needsRemoving).length - 1; 0 <= i; i--) if (anArray[i].layer === layer) return !1; 10659 return !(!layer.__parent || layer.__parent._group !== this) || this._nonPointGroup.hasLayer(layer); 10660 }, 10661 zoomToShowLayer: function(layer, callback) { 10662 "function" != typeof callback && (callback = function() {}); 10663 function showMarker() { 10664 !layer._icon && !layer.__parent._icon || this._inZoomAnimation || (this._map.off("moveend", showMarker, this), 10665 this.off("animationend", showMarker, this), layer._icon ? callback() : layer.__parent._icon && (this.once("spiderfied", callback, this), 10666 layer.__parent.spiderfy())); 10667 } 10668 layer._icon && this._map.getBounds().contains(layer.getLatLng()) ? callback() : layer.__parent._zoom < Math.round(this._map._zoom) ? (this._map.on("moveend", showMarker, this), 10669 this._map.panTo(layer.getLatLng())) : (this._map.on("moveend", showMarker, this), 10670 this.on("animationend", showMarker, this), layer.__parent.zoomToBounds()); 10671 }, 10672 onAdd: function(map) { 10673 var i, l, layer; 10674 if (this._map = map, !isFinite(this._map.getMaxZoom())) throw "Map has no maxZoom specified"; 10675 for (this._featureGroup.addTo(map), this._nonPointGroup.addTo(map), this._gridClusters || this._generateInitialClusters(), 10676 this._maxLat = map.options.crs.projection.MAX_LATITUDE, i = 0, l = this._needsRemoving.length; i < l; i++) (layer = this._needsRemoving[i]).newlatlng = layer.layer._latlng, 10677 layer.layer._latlng = layer.latlng; 10678 for (i = 0, l = this._needsRemoving.length; i < l; i++) layer = this._needsRemoving[i], 10679 this._removeLayer(layer.layer, !0), layer.layer._latlng = layer.newlatlng; 10680 this._needsRemoving = [], this._zoom = Math.round(this._map._zoom), this._currentShownBounds = this._getExpandedVisibleBounds(), 10681 this._map.on("zoomend", this._zoomEnd, this), this._map.on("moveend", this._moveEnd, this), 10682 this._spiderfierOnAdd && this._spiderfierOnAdd(), this._bindEvents(), l = this._needsClustering, 10683 this._needsClustering = [], this.addLayers(l, !0); 10684 }, 10685 onRemove: function(map) { 10686 map.off("zoomend", this._zoomEnd, this), map.off("moveend", this._moveEnd, this), 10687 this._unbindEvents(), this._map._mapPane.className = this._map._mapPane.className.replace(" leaflet-cluster-anim", ""), 10688 this._spiderfierOnRemove && this._spiderfierOnRemove(), delete this._maxLat, this._hideCoverage(), 10689 this._featureGroup.remove(), this._nonPointGroup.remove(), this._featureGroup.clearLayers(), 10690 this._map = null; 10691 }, 10692 getVisibleParent: function(marker) { 10693 for (var vMarker = marker; vMarker && !vMarker._icon; ) vMarker = vMarker.__parent; 10694 return vMarker || null; 10695 }, 10696 _arraySplice: function(anArray, obj) { 10697 for (var i = anArray.length - 1; 0 <= i; i--) if (anArray[i] === obj) return anArray.splice(i, 1), 10698 !0; 10699 }, 10700 _removeFromGridUnclustered: function(marker, z) { 10701 for (var map = this._map, gridUnclustered = this._gridUnclustered, minZoom = Math.floor(this._map.getMinZoom()); minZoom <= z && gridUnclustered[z].removeObject(marker, map.project(marker.getLatLng(), z)); z--) ; 10702 }, 10703 _childMarkerDragStart: function(e) { 10704 e.target.__dragStart = e.target._latlng; 10705 }, 10706 _childMarkerMoved: function(e) { 10707 if (!this._ignoreMove && !e.target.__dragStart) { 10708 var isPopupOpen = e.target._popup && e.target._popup.isOpen(); 10709 this._moveChild(e.target, e.oldLatLng, e.latlng), isPopupOpen && e.target.openPopup(); 10710 } 10711 }, 10712 _moveChild: function(layer, from, to) { 10713 layer._latlng = from, this.removeLayer(layer), layer._latlng = to, this.addLayer(layer); 10714 }, 10715 _childMarkerDragEnd: function(e) { 10716 var dragStart = e.target.__dragStart; 10717 delete e.target.__dragStart, dragStart && this._moveChild(e.target, dragStart, e.target._latlng); 10718 }, 10719 _removeLayer: function(marker, removeFromDistanceGrid, dontUpdateMap) { 10720 var gridClusters = this._gridClusters, gridUnclustered = this._gridUnclustered, fg = this._featureGroup, map = this._map, minZoom = Math.floor(this._map.getMinZoom()); 10721 removeFromDistanceGrid && this._removeFromGridUnclustered(marker, this._maxZoom); 10722 var otherMarker, cluster = marker.__parent, markers = cluster._markers; 10723 for (this._arraySplice(markers, marker); cluster && (cluster._childCount--, cluster._boundsNeedUpdate = !0, 10724 !(cluster._zoom < minZoom)); ) removeFromDistanceGrid && cluster._childCount <= 1 ? (otherMarker = cluster._markers[0] === marker ? cluster._markers[1] : cluster._markers[0], 10725 gridClusters[cluster._zoom].removeObject(cluster, map.project(cluster._cLatLng, cluster._zoom)), 10726 gridUnclustered[cluster._zoom].addObject(otherMarker, map.project(otherMarker.getLatLng(), cluster._zoom)), 10727 this._arraySplice(cluster.__parent._childClusters, cluster), cluster.__parent._markers.push(otherMarker), 10728 otherMarker.__parent = cluster.__parent, cluster._icon && (fg.removeLayer(cluster), 10729 dontUpdateMap || fg.addLayer(otherMarker))) : cluster._iconNeedsUpdate = !0, cluster = cluster.__parent; 10730 delete marker.__parent; 10731 }, 10732 _isOrIsParent: function(el, oel) { 10733 for (;oel; ) { 10734 if (el === oel) return !0; 10735 oel = oel.parentNode; 10736 } 10737 return !1; 10738 }, 10739 fire: function(type, data, propagate) { 10740 if (data && data.layer instanceof L.MarkerCluster) { 10741 if (data.originalEvent && this._isOrIsParent(data.layer._icon, data.originalEvent.relatedTarget)) return; 10742 type = "cluster" + type; 10743 } 10744 L.FeatureGroup.prototype.fire.call(this, type, data, propagate); 10745 },
10746 listens: function(type, propagate) { 10747 return L.FeatureGroup.prototype.listens.call(this, type, propagate) || L.FeatureGroup.prototype.listens.call(this, "cluster" + type, propagate); 10748 }, 10749 _defaultIconCreateFunction: function(cluster) { 10750 var childCount = cluster.getChildCount(), c = " marker-cluster-"; 10751 return c += childCount < 10 ? "small" : childCount < 100 ? "medium" : "large", new L.DivIcon({ 10752 html: "<div><span>" + childCount + "</span></div>", 10753 className: "marker-cluster" + c, 10754 iconSize: new L.Point(40, 40) 10755 }); 10756 }, 10757 _bindEvents: function() { 10758 var map = this._map, spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom, showCoverageOnHover = this.options.showCoverageOnHover, zoomToBoundsOnClick = this.options.zoomToBoundsOnClick; 10759 (spiderfyOnMaxZoom || zoomToBoundsOnClick) && this.on("clusterclick", this._zoomOrSpiderfy, this), 10760 showCoverageOnHover && (this.on("clustermouseover", this._showCoverage, this), this.on("clustermouseout", this._hideCoverage, this), 10761 map.on("zoomend", this._hideCoverage, this)); 10762 }, 10763 _zoomOrSpiderfy: function(e) { 10764 for (var cluster = e.layer, bottomCluster = cluster; 1 === bottomCluster._childClusters.length; ) bottomCluster = bottomCluster._childClusters[0]; 10765 bottomCluster._zoom === this._maxZoom && bottomCluster._childCount === cluster._childCount && this.options.spiderfyOnMaxZoom ? cluster.spiderfy() : this.options.zoomToBoundsOnClick && cluster.zoomToBounds(), 10766 e.originalEvent && 13 === e.originalEvent.keyCode && this._map._container.focus(); 10767 }, 10768 _showCoverage: function(e) { 10769 var map = this._map; 10770 this._inZoomAnimation || (this._shownPolygon && map.removeLayer(this._shownPolygon), 10771 2 < e.layer.getChildCount() && e.layer !== this._spiderfied && (this._shownPolygon = new L.Polygon(e.layer.getConvexHull(), this.options.polygonOptions), 10772 map.addLayer(this._shownPolygon))); 10773 }, 10774 _hideCoverage: function() { 10775 this._shownPolygon && (this._map.removeLayer(this._shownPolygon), this._shownPolygon = null); 10776 }, 10777 _unbindEvents: function() { 10778 var spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom, showCoverageOnHover = this.options.showCoverageOnHover, zoomToBoundsOnClick = this.options.zoomToBoundsOnClick, map = this._map; 10779 (spiderfyOnMaxZoom || zoomToBoundsOnClick) && this.off("clusterclick", this._zoomOrSpiderfy, this), 10780 showCoverageOnHover && (this.off("clustermouseover", this._showCoverage, this), 10781 this.off("clustermouseout", this._hideCoverage, this), map.off("zoomend", this._hideCoverage, this)); 10782 }, 10783 _zoomEnd: function() { 10784 this._map && (this._mergeSplitClusters(), this._zoom = Math.round(this._map._zoom), 10785 this._currentShownBounds = this._getExpandedVisibleBounds()); 10786 }, 10787 _moveEnd: function() { 10788 if (!this._inZoomAnimation) { 10789 var newBounds = this._getExpandedVisibleBounds(); 10790 this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), this._zoom, newBounds), 10791 this._topClusterLevel._recursivelyAddChildrenToMap(null, Math.round(this._map._zoom), newBounds), 10792 this._currentShownBounds = newBounds; 10793 } 10794 }, 10795 _generateInitialClusters: function() { 10796 var maxZoom = Math.ceil(this._map.getMaxZoom()), minZoom = Math.floor(this._map.getMinZoom()), radius = this.options.maxClusterRadius, radiusFn = radiu
10796s; 10797 "function" != typeof radius && (radiusFn = function() { 10798 return radius; 10799 }), null !== this.options.disableClusteringAtZoom && (maxZoom = this.options.disableClusteringAtZoom - 1), 10800 this._maxZoom = maxZoom, this._gridClusters = {}, this._gridUnclustered = {}; 10801 for (var zoom = maxZoom; minZoom <= zoom; zoom--) this._gridClusters[zoom] = new L.DistanceGrid(radiusFn(zoom)), 10802 this._gridUnclustered[zoom] = new L.DistanceGrid(radiusFn(zoom)); 10803 this._topClusterLevel = new this._markerCluster(this, minZoom - 1); 10804 }, 10805 _addLayer: function(layer, zoom) { 10806 var markerPoint, z, gridClusters = this._gridClusters, gridUnclustered = this._gridUnclustered, minZoom = Math.floor(this._map.getMinZoom()); 10807 for (this.options.singleMarkerMode && this._overrideMarkerIcon(layer), layer.on(this._childMarkerEventHandlers, this); minZoom <= zoom; zoom--) { 10808 markerPoint = this._map.project(layer.getLatLng(), zoom); 10809 var closest = gridClusters[zoom].getNearObject(markerPoint); 10810 if (closest) return closest._addChild(layer), void (layer.__parent = closest); 10811 if (closest = gridUnclustered[zoom].getNearObject(markerPoint)) { 10812 var parent = closest.__parent; 10813 parent && this._removeLayer(closest, !1); 10814 var newCluster = new this._markerCluster(this, zoom, closest, layer); 10815 gridClusters[zoom].addObject(newCluster, this._map.project(newCluster._cLatLng, zoom)), 10816 closest.__parent = newCluster; 10817 var lastParent = layer.__parent = newCluster; 10818 for (z = zoom - 1; z > parent._zoom; z--) lastParent = new this._markerCluster(this, z, lastParent), 10819 gridClusters[z].addObject(lastParent, this._map.project(closest.getLatLng(), z)); 10820 return parent._addChild(lastParent), void this._removeFromGridUnclustered(closest, zoom); 10821 } 10822 gridUnclustered[zoom].addObject(layer, markerPoint); 10823 } 10824 this._topClusterLevel._addChild(layer), layer.__parent = this._topClusterLevel; 10825 }, 10826 _refreshClustersIcons: function() { 10827 this._featureGroup.eachLayer(function(c) { 10828 c instanceof L.MarkerCluster && c._iconNeedsUpdate && c._updateIcon(); 10829 }); 10830 }, 10831 _enqueue: function(fn) { 10832 this._queue.push(fn), this._queueTimeout || (this._queueTimeout = setTimeout(L.bind(this._processQueue, this), 300)); 10833 }, 10834 _processQueue: function() { 10835 for (var i = 0; i < this._queue.length; i++) this._queue[i].call(this); 10836 this._queue.length = 0, clearTimeout(this._queueTimeout), this._queueTimeout = null; 10837 }, 10838 _mergeSplitClusters: function() { 10839 var mapZoom = Math.round(this._map._zoom); 10840 this._processQueue(), this._zoom < mapZoom && this._currentShownBounds.intersects(this._getExpandedVisibleBounds()) ? (this._animationStart(), 10841 this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), this._zoom, this._getExpandedVisibleBounds()), 10842 this._animationZoomIn(this._zoom, mapZoom)) : this._zoom > mapZoom ? (this._animationStart(), 10843 this._animationZoomOut(this._zoom, mapZoom)) : this._moveEnd(); 10844 }, 10845 _getExpandedVisibleBounds: function() { 10846 return this.options.removeOutsideVisibleBounds ? L.Browser.mobile ? this._checkBoundsMaxLat(this._map.getBounds()) : this._checkBoundsMaxLat(this._map.getBounds().pad(1)) : this._mapBoundsInfinite; 10847 },
10848 _checkBoundsMaxLat: function(bounds) { 10849 var maxLat = this._maxLat; 10850 return void 0 !== maxLat && (bounds.getNorth() >= maxLat && (bounds._northEast.lat = 1 / 0), 10851 bounds.getSouth() <= -maxLat && (bounds._southWest.lat = -1 / 0)), bounds; 10852 }, 10853 _animationAddLayerNonAnimated: function(layer, newCluster) { 10854 if (newCluster === layer) this._featureGroup.addLayer(layer); else if (2 === newCluster._childCount) { 10855 newCluster._addToMap(); 10856 var markers = newCluster.getAllChildMarkers(); 10857 this._featureGroup.removeLayer(markers[0]), this._featureGroup.removeLayer(markers[1]); 10858 } else newCluster._updateIcon(); 10859 }, 10860 _extractNonGroupLayers: function(group, output) { 10861 var layer, layers = group.getLayers(), i = 0; 10862 for (output = output || []; i < layers.length; i++) (layer = layers[i]) instanceof L.LayerGroup ? this._extractNonGroupLayers(layer, output) : output.push(layer); 10863 return output; 10864 }, 10865 _overrideMarkerIcon: function(layer) { 10866 return layer.options.icon = this.options.iconCreateFunction({ 10867 getChildCount: function() { 10868 return 1; 10869 }, 10870 getAllChildMarkers: function() { 10871 return [ layer ]; 10872 } 10873 }); 10874 } 10875 }); 10876 L.MarkerClusterGroup.include({ 10877 _mapBoundsInfinite: new L.LatLngBounds(new L.LatLng(-1 / 0, -1 / 0), new L.LatLng(1 / 0, 1 / 0)) 10878 }), L.MarkerClusterGroup.include({ 10879 _noAnimation: { 10880 _animationStart: function() {}, 10881 _animationZoomIn: function(previousZoomLevel, newZoomLevel) { 10882 this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel), 10883 this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds()), 10884 this.fire("animationend"); 10885 }, 10886 _animationZoomOut: function(previousZoomLevel, newZoomLevel) { 10887 this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel), 10888 this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds()), 10889 this.fire("animationend"); 10890 }, 10891 _animationAddLayer: function(layer, newCluster) { 10892 this._animationAddLayerNonAnimated(layer, newCluster); 10893 } 10894 }, 10895 _withAnimation: { 10896 _animationStart: function() { 10897 this._map._mapPane.className += " leaflet-cluster-anim", this._inZoomAnimation++; 10898 }, 10899 _animationZoomIn: function(previousZoomLevel, newZoomLevel) { 10900 var i, bounds = this._getExpandedVisibleBounds(), fg = this._featureGroup, minZoom = Math.floor(this._map.getMinZoom()); 10901 this._ignoreMove = !0, this._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function(c) { 10902 var m, startPos = c._latlng, markers = c._markers; 10903 for (bounds.contains(startPos) || (startPos = null), c._isSingleParent() && previousZoomLevel + 1 === newZoomLevel ? (fg.removeLayer(c), 10904 c._recursivelyAddChildrenToMap(null, newZoomLevel, bounds)) : (c.clusterHide(), 10905 c._recursivelyAddChildrenToMap(startPos, newZoomLevel, bounds)), i = markers.length - 1; 0 <= i; i--) m = markers[i], 10906 bounds.contains(m._latlng) || fg.removeLayer(m); 10907 }), this._forceLayout(), this._topClusterLevel._recursivelyBecomeVisible(bounds, newZoomLevel), 10908 fg.eachLayer(function(n) { 10909 n instanceof L.MarkerCluster || !n._icon || n.clusterShow(); 10910 }), this._topClusterLevel._recursively(bounds, previousZoomLevel, newZoomLevel, function(c) { 10911 c._recursivelyRestoreChildPositions(newZoomLevel); 10912 }), this._ignoreMove = !1, this._enqueue(function() { 10913 this._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function(c) { 10914 fg.removeLayer(c), c.clusterShow(); 10915 }), this._animationEnd(); 10916 }); 10917 }, 10918 _animationZoomOut: function(previousZoomLevel, newZoomLevel) { 10919 this._animationZoomOutSingle(this._topClusterLevel, previousZoomLevel - 1, newZo
10919omLevel), 10920 this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds()), 10921 this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel, this._getExpandedVisibleBounds()); 10922 }, 10923 _animationAddLayer: function(layer, newCluster) { 10924 var me = this, fg = this._featureGroup; 10925 fg.addLayer(layer), newCluster !== layer && (2 < newCluster._childCount ? (newCluster._updateIcon(), 10926 this._forceLayout(), this._animationStart(), layer._setPos(this._map.latLngToLayerPoint(newCluster.getLatLng())), 10927 layer.clusterHide(), this._enqueue(function() { 10928 fg.removeLayer(layer), layer.clusterShow(), me._animationEnd(); 10929 })) : (this._forceLayout(), me._animationStart(), me._animationZoomOutSingle(newCluster, this._map.getMaxZoom(), this._zoom))); 10930 } 10931 }, 10932 _animationZoomOutSingle: function(cluster, previousZoomLevel, newZoomLevel) { 10933 var bounds = this._getExpandedVisibleBounds(), minZoom = Math.floor(this._map.getMinZoom()); 10934 cluster._recursivelyAnimateChildrenInAndAddSelfToMap(bounds, minZoom, previousZoomLevel + 1, newZoomLevel); 10935 var me = this; 10936 this._forceLayout(), cluster._recursivelyBecomeVisible(bounds, newZoomLevel), this._enqueue(function() { 10937 if (1 === cluster._childCount) { 10938 var m = cluster._markers[0]; 10939 this._ignoreMove = !0, m.setLatLng(m.getLatLng()), this._ignoreMove = !1, m.clusterShow && m.clusterShow(); 10940 } else cluster._recursively(bounds, newZoomLevel, minZoom, function(c) { 10941 c._recursivelyRemoveChildrenFromMap(bounds, minZoom, previousZoomLevel + 1); 10942 }); 10943 me._animationEnd(); 10944 }); 10945 }, 10946 _animationEnd: function() { 10947 this._map && (this._map._mapPane.className = this._map._mapPane.className.replace(" leaflet-cluster-anim", "")), 10948 this._inZoomAnimation--, this.fire("animationend"); 10949 }, 10950 _forceLayout: function() { 10951 L.Util.falseFn(document.body.offsetWidth); 10952 } 10953 }), L.markerClusterGroup = function(options) { 10954 return new L.MarkerClusterGroup(options); 10955 }; 10956 var MarkerCluster = L.MarkerCluster = L.Marker.extend({ 10957 options: L.Icon.prototype.options, 10958 initialize: function(group, zoom, a, b) { 10959 L.Marker.prototype.initialize.call(this, a ? a._cLatLng || a.getLatLng() : new L.LatLng(0, 0), { 10960 icon: this, 10961 pane: group.options.clusterPane 10962 }), this._group = group, this._zoom = zoom, this._markers = [], this._childClusters = [], 10963 this._childCount = 0, this._iconNeedsUpdate = !0, this._boundsNeedUpdate = !0, this._bounds = new L.LatLngBounds(), 10964 a && this._addChild(a), b && this._addChild(b); 10965 }, 10966 getAllChildMarkers: function(storageArray, ignoreDraggedMarker) { 10967 storageArray = storageArray || []; 10968 for (var i = this._childClusters.length - 1; 0 <= i; i--) this._childClusters[i].getAllChildMarkers(storageArray); 10969 for (var j = this._markers.length - 1; 0 <= j; j--) ignoreDraggedMarker && this._markers[j].__dragStart || storageArray.push(this._markers[j]); 10970 return storageArray; 10971 }, 10972 getChildCount: function() { 10973 return this._childCount; 10974 }, 10975 zoomToBounds: function(fitBoundsOptions) { 10976 for (var i, childClusters = this._childClusters.slice(), map = this._group._map, boundsZoom = map.getBoundsZoom(this._bounds), zoom = this._zoom + 1, mapZoom = map.getZoom(); 0 < childClusters.length && zoom < boundsZoom; ) { 10977 zoom++; 10978 var newClusters = []; 10979 for (i = 0; i < childClusters.length; i++) newClusters = newClusters.concat(childClusters[i]._childClusters); 10980 childClusters = newClusters; 10981 }
10982 zoom < boundsZoom ? this._group._map.setView(this._latlng, zoom) : boundsZoom <= mapZoom ? this._group._map.setView(this._latlng, mapZoom + 1) : this._group._map.fitBounds(this._bounds, fitBoundsOptions); 10983 }, 10984 getBounds: function() { 10985 var bounds = new L.LatLngBounds(); 10986 return bounds.extend(this._bounds), bounds; 10987 }, 10988 _updateIcon: function() { 10989 this._iconNeedsUpdate = !0, this._icon && this.setIcon(this); 10990 }, 10991 createIcon: function() { 10992 return this._iconNeedsUpdate && (this._iconObj = this._group.options.iconCreateFunction(this), 10993 this._iconNeedsUpdate = !1), this._iconObj.createIcon(); 10994 }, 10995 createShadow: function() { 10996 return this._iconObj.createShadow(); 10997 }, 10998 _addChild: function(new1, isNotificationFromChild) { 10999 this._iconNeedsUpdate = !0, this._boundsNeedUpdate = !0, this._setClusterCenter(new1), 11000 new1 instanceof L.MarkerCluster ? (isNotificationFromChild || (this._childClusters.push(new1), 11001 new1.__parent = this), this._childCount += new1._childCount) : (isNotificationFromChild || this._markers.push(new1), 11002 this._childCount++), this.__parent && this.__parent._addChild(new1, !0); 11003 }, 11004 _setClusterCenter: function(child) { 11005 this._cLatLng || (this._cLatLng = child._cLatLng || child._latlng); 11006 }, 11007 _resetBounds: function() { 11008 var bounds = this._bounds; 11009 bounds._southWest && (bounds._southWest.lat = 1 / 0, bounds._southWest.lng = 1 / 0), 11010 bounds._northEast && (bounds._northEast.lat = -1 / 0, bounds._northEast.lng = -1 / 0); 11011 }, 11012 _recalculateBounds: function() { 11013 var i, child, childLatLng, childCount, markers = this._markers, childClusters = this._childClusters, latSum = 0, lngSum = 0, totalCount = this._childCount; 11014 if (0 !== totalCount) { 11015 for (this._resetBounds(), i = 0; i < markers.length; i++) childLatLng = markers[i]._latlng, 11016 this._bounds.extend(childLatLng), latSum += childLatLng.lat, lngSum += childLatLng.lng; 11017 for (i = 0; i < childClusters.length; i++) (child = childClusters[i])._boundsNeedUpdate && child._recalculateBounds(), 11018 this._bounds.extend(child._bounds), childLatLng = child._wLatLng, childCount = child._childCount, 11019 latSum += childLatLng.lat * childCount, lngSum += childLatLng.lng * childCount; 11020 this._latlng = this._wLatLng = new L.LatLng(latSum / totalCount, lngSum / totalCount), 11021 this._boundsNeedUpdate = !1; 11022 } 11023 }, 11024 _addToMap: function(startPos) { 11025 startPos && (this._backupLatlng = this._latlng, this.setLatLng(startPos)), this._group._featureGroup.addLayer(this); 11026 }, 11027 _recursivelyAnimateChildrenIn: function(bounds, center, maxZoom) { 11028 this._recursively(bounds, this._group._map.getMinZoom(), maxZoom - 1, function(c) { 11029 var i, m, markers = c._markers; 11030 for (i = markers.length - 1; 0 <= i; i--) (m = markers[i])._icon && (m._setPos(center), 11031 m.clusterHide()); 11032 }, function(c) { 11033 var j, cm, childClusters = c._childClusters; 11034 for (j = childClusters.length - 1; 0 <= j; j--) (cm = childClusters[j])._icon && (cm._setPos(center), 11035 cm.clusterHide()); 11036 }); 11037 }, 11038 _recursivelyAnimateChildrenInAndAddSelfToMap: function(bounds, mapMinZoom, previousZoomLevel, newZoomLevel) { 11039 this._recursively(bounds, newZoomLevel, mapMinZoom, function(c) { 11040 c._recursivelyAnimateChildrenIn(bounds, c._group._map.latLngToLayerPoint(c.getLatLng()).round(), previousZoomLevel), 11041 c._isSingleParent() && previousZoomLevel - 1 === newZoomLevel ? (c.clusterShow(), 11042 c._recursivelyRemoveChildrenFromMap(bounds, mapMinZoom, previousZoomLevel)) : c.clusterHide(), 11043 c._addToMap(); 11044 }); 11045 },
11046 _recursivelyBecomeVisible: function(bounds, zoomLevel) { 11047 this._recursively(bounds, this._group._map.getMinZoom(), zoomLevel, null, function(c) { 11048 c.clusterShow(); 11049 }); 11050 }, 11051 _recursivelyAddChildrenToMap: function(startPos, zoomLevel, bounds) { 11052 this._recursively(bounds, this._group._map.getMinZoom() - 1, zoomLevel, function(c) { 11053 if (zoomLevel !== c._zoom) for (var i = c._markers.length - 1; 0 <= i; i--) { 11054 var nm = c._markers[i]; 11055 bounds.contains(nm._latlng) && (startPos && (nm._backupLatlng = nm.getLatLng(), 11056 nm.setLatLng(startPos), nm.clusterHide && nm.clusterHide()), c._group._featureGroup.addLayer(nm)); 11057 } 11058 }, function(c) { 11059 c._addToMap(startPos); 11060 }); 11061 }, 11062 _recursivelyRestoreChildPositions: function(zoomLevel) { 11063 for (var i = this._markers.length - 1; 0 <= i; i--) { 11064 var nm = this._markers[i]; 11065 nm._backupLatlng && (nm.setLatLng(nm._backupLatlng), delete nm._backupLatlng); 11066 } 11067 if (zoomLevel - 1 === this._zoom) for (var j = this._childClusters.length - 1; 0 <= j; j--) this._childClusters[j]._restorePosition(); else for (var k = this._childClusters.length - 1; 0 <= k; k--) this._childClusters[k]._recursivelyRestoreChildPositions(zoomLevel); 11068 }, 11069 _restorePosition: function() { 11070 this._backupLatlng && (this.setLatLng(this._backupLatlng), delete this._backupLatlng); 11071 }, 11072 _recursivelyRemoveChildrenFromMap: function(previousBounds, mapMinZoom, zoomLevel, exceptBounds) { 11073 var m, i; 11074 this._recursively(previousBounds, mapMinZoom - 1, zoomLevel - 1, function(c) { 11075 for (i = c._markers.length - 1; 0 <= i; i--) m = c._markers[i], exceptBounds && exceptBounds.contains(m._latlng) || (c._group._featureGroup.removeLayer(m), 11076 m.clusterShow && m.clusterShow()); 11077 }, function(c) { 11078 for (i = c._childClusters.length - 1; 0 <= i; i--) m = c._childClusters[i], exceptBounds && exceptBounds.contains(m._latlng) || (c._group._featureGroup.removeLayer(m), 11079 m.clusterShow && m.clusterShow()); 11080 }); 11081 }, 11082 _recursively: function(boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel) { 11083 var i, c, childClusters = this._childClusters, zoom = this._zoom; 11084 if (zoomLevelToStart <= zoom && (runAtEveryLevel && runAtEveryLevel(this), runAtBottomLevel && zoom === zoomLevelToStop && runAtBottomLevel(this)), 11085 zoom < zoomLevelToStart || zoom < zoomLevelToStop) for (i = childClusters.length - 1; 0 <= i; i--) (c = childClusters[i])._boundsNeedUpdate && c._recalculateBounds(), 11086 boundsToApplyTo.intersects(c._bounds) && c._recursively(boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel); 11087 }, 11088 _isSingleParent: function() { 11089 return 0 < this._childClusters.length && this._childClusters[0]._childCount === this._childCount; 11090 } 11091 }); 11092 L.Marker.include({ 11093 clusterHide: function() { 11094 var backup = this.options.opacity; 11095 return this.setOpacity(0), this.options.opacity = backup, this; 11096 }, 11097 clusterShow: function() { 11098 return this.setOpacity(this.options.opacity); 11099 } 11100 }), L.DistanceGrid = function(cellSize) { 11101 this._cellSize = cellSize, this._sqCellSize = cellSize * cellSize, this._grid = {}, 11102 this._objectPoint = {}; 11103 }, L.DistanceGrid.prototype = { 11104 addObject: function(obj, point) { 11105 var x = this._getCoord(point.x), y = this._getCoord(point.y), grid = this._grid, row
vendor: 16,384 bytes, lines 11105-11314
11105= grid[y] = grid[y] || {}, cell = row[x] = row[x] || [], stamp = L.Util.stamp(obj); 11106 this._objectPoint[stamp] = point, cell.push(obj); 11107 }, 11108 updateObject: function(obj, point) { 11109 this.removeObject(obj), this.addObject(obj, point); 11110 }, 11111 removeObject: function(obj, point) { 11112 var i, len, x = this._getCoord(point.x), y = this._getCoord(point.y), grid = this._grid, row = grid[y] = grid[y] || {}, cell = row[x] = row[x] || []; 11113 for (delete this._objectPoint[L.Util.stamp(obj)], i = 0, len = cell.length; i < len; i++) if (cell[i] === obj) return cell.splice(i, 1), 11114 1 === len && delete row[x], !0; 11115 }, 11116 eachObject: function(fn, context) { 11117 var i, j, k, len, row, cell, grid = this._grid; 11118 for (i in grid) for (j in row = grid[i]) for (k = 0, len = (cell = row[j]).length; k < len; k++) fn.call(context, cell[k]) && (k--, 11119 len--); 11120 }, 11121 getNearObject: function(point) { 11122 var i, j, k, row, cell, len, obj, dist, x = this._getCoord(point.x), y = this._getCoord(point.y), objectPoint = this._objectPoint, closestDistSq = this._sqCellSize, closest = null; 11123 for (i = y - 1; i <= y + 1; i++) if (row = this._grid[i]) for (j = x - 1; j <= x + 1; j++) if (cell = row[j]) for (k = 0, 11124 len = cell.length; k < len; k++) obj = cell[k], ((dist = this._sqDist(objectPoint[L.Util.stamp(obj)], point)) < closestDistSq || dist <= closestDistSq && null === closest) && (closestDistSq = dist, 11125 closest = obj); 11126 return closest; 11127 }, 11128 _getCoord: function(x) { 11129 var coord = Math.floor(x / this._cellSize); 11130 return isFinite(coord) ? coord : x; 11131 }, 11132 _sqDist: function(p, p2) { 11133 var dx = p2.x - p.x, dy = p2.y - p.y; 11134 return dx * dx + dy * dy; 11135 } 11136 }, L.QuickHull = { 11137 getDistant: function(cpt, bl) { 11138 var vY = bl[1].lat - bl[0].lat; 11139 return (bl[0].lng - bl[1].lng) * (cpt.lat - bl[0].lat) + vY * (cpt.lng - bl[0].lng); 11140 }, 11141 findMostDistantPointFromBaseLine: function(baseLine, latLngs) { 11142 var i, pt, d, maxD = 0, maxPt = null, newPoints = []; 11143 for (i = latLngs.length - 1; 0 <= i; i--) pt = latLngs[i], 0 < (d = this.getDistant(pt, baseLine)) && (newPoints.push(pt), 11144 maxD < d && (maxD = d, maxPt = pt)); 11145 return { 11146 maxPoint: maxPt, 11147 newPoints: newPoints 11148 }; 11149 }, 11150 buildConvexHull: function(baseLine, latLngs) { 11151 var convexHullBaseLines = [], t = this.findMostDistantPointFromBaseLine(baseLine, latLngs); 11152 return t.maxPoint ? convexHullBaseLines = (convexHullBaseLines = convexHullBaseLines.concat(this.buildConvexHull([ baseLine[0], t.maxPoint ], t.newPoints))).concat(this.buildConvexHull([ t.maxPoint, baseLine[1] ], t.newPoints)) : [ baseLine[0] ]; 11153 }, 11154 getConvexHull: function(latLngs) { 11155 var i, maxLat = !1, minLat = !1, maxLng = !1, minLng = !1, maxLatPt = null, minLatPt = null, maxLngPt = null, minLngPt = null, maxPt = null, minPt = null; 11156 for (i = latLngs.length - 1; 0 <= i; i--) { 11157 var pt = latLngs[i]; 11158 (!1 === maxLat || pt.lat > maxLat) && (maxLat = (maxLatPt = pt).lat), (!1 === minLat || pt.lat < minLat) && (minLat = (minLatPt = pt).lat), 11159 (!1 === maxLng || pt.lng > maxLng) && (maxLng = (maxLngPt = pt).lng), (!1 === minLng || pt.lng < minLng) && (minLng = (minLngPt = pt).lng); 11160 } 11161 return maxPt = minLat !== maxLat ? (minPt = minLatPt, maxLatPt) : (minPt = minLngPt, 11162 maxLngPt), [].concat(this.buildConvexHull([ minPt, maxPt ], latLngs), this.buildConvexHull([ maxPt, minPt ], latLngs)); 11163 } 11164 }, L.MarkerCluster.include({ 11165 getConvexHull: function() { 11166 var p, i, childMarkers = this.getAllChildMarkers(), points = []; 11167 for (i = childMarkers.length - 1; 0 <= i; i--) p = childMarkers[i].getLatLng(), 11168 points.push(p); 11169 return L.QuickHull.getConvexHull(points); 11170 } 11171 }), L.MarkerCluster.include({ 11172 _2PI: 2 * Math.PI, 11173 _circleFootSeparation: 25, 11174 _circleStartAngle: 0, 11175 _spiralFootSeparation: 28, 11176 _spiralLengthStart: 11, 11177 _spiralLengthFactor: 5, 11178 _circleSpiralSwitchover: 9, 11179 spiderfy: function() { 11180 if (this._group._spiderfied !== this && !this._group._inZoomAnimation) { 11181 var positions, childMarkers = this.getAllChildMarkers(null, !0), center = this._group._map.latLngToLayerPoint(this._latlng); 11182 this._group._unspiderfy(), this._group._spiderfied = this, positions = childMarkers.length >= this._circleSpiralSwitchover ? this._generatePointsSpiral(childMarkers.length, center) : (center.y += 10, 11183 this._generatePointsCircle(childMarkers.length, center)), this._animationSpiderfy(childMarkers, positions); 11184 } 11185 }, 11186 unspiderfy: function(zoomDetails) { 11187 this._group._inZoomAnimation || (this._animationUnspiderfy(zoomDetails), this._group._spiderfied = null); 11188 }, 11189 _generatePointsCircle: function(count, centerPt) { 11190 var i, angle, legLength = this._group.options.spiderfyDistanceMultiplier * this._circleFootSeparation * (2 + count) / this._2PI, angleStep = this._2PI / count, res = []; 11191 for (legLength = Math.max(legLength, 35), res.length = count, i = 0; i < count; i++) angle = this._circleStartAngle + i * angleStep, 11192 res[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round(); 11193 return res; 11194 }, 11195 _generatePointsSpiral: function(count, centerPt) { 11196 var i, spiderfyDistanceMultiplier = this._group.options.spiderfyDistanceMultiplier, legLength = spiderfyDistanceMultiplier * this._spiralLengthStart, separation = spiderfyDistanceMultiplier * this._spiralFootSeparation, lengthFactor = spiderfyDistanceMultiplier * this._spiralLengthFactor * this._2PI, angle = 0, res = []; 11197 for (i = res.length = count; 0 <= i; i--) i < count && (res[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round()), 11198 legLength += lengthFactor / (angle += separation / legLength + 5e-4 * i); 11199 return res; 11200 }, 11201 _noanimationUnspiderfy: function() { 11202 var m, i, group = this._group, map = group._map, fg = group._featureGroup, childMarkers = this.getAllChildMarkers(null, !0); 11203 for (group._ignoreMove = !0, this.setOpacity(1), i = childMarkers.length - 1; 0 <= i; i--) m = childMarkers[i], 11204 fg.removeLayer(m), m._preSpiderfyLatlng && (m.setLatLng(m._preSpiderfyLatlng), delete m._preSpiderfyLatlng), 11205 m.setZIndexOffset && m.setZIndexOffset(0), m._spiderLeg && (map.removeLayer(m._spiderLeg), 11206 delete m._spiderLeg); 11207 group.fire("unspiderfied", { 11208 cluster: this, 11209 markers: childMarkers 11210 }), group._ignoreMove = !1, group._spiderfied = null; 11211 } 11212 }), L.MarkerClusterNonAnimated = L.MarkerCluster.extend({ 11213 _animationSpiderfy: function(childMarkers, positions) { 11214 var i, m, leg, newPos, group = this._group, map = group._map, fg = group._featureGroup, legOptions = this._group.options.spiderLegPolylineOptions; 11215 for (group._ignoreMove = !0, i = 0; i < childMarkers.length; i++) newPos = map.layerPointToLatLng(positions[i]), 11216 m = childMarkers[i], leg = new L.Polyline([ this._latlng, newPos ], legOptions), 11217 map.addLayer(leg), m._spiderLeg = leg, m._preSpiderfyLatlng = m._latlng, m.setLatLng(newPos), 11218 m.setZIndexOffset && m.setZIndexOffset(1e6), fg.addLayer(m); 11219 this.setOpacity(.3), group._ignoreMove = !1, group.fire("spiderfied", { 11220 cluster: this, 11221 markers: childMarkers 11222 }); 11223 }, 11224 _animationUnspiderfy: function() { 11225 this._noanimationUnspiderfy(); 11226 } 11227 }), L.MarkerCluster.include({ 11228 _animationSpiderfy: function(childMarkers, positions) { 11229 var i, m, leg, legPath, legLength, newPos, me = this, group = this._group, map = group._map, fg = group._featureGroup, thisLayerLatLng = this._latlng, thisLayerPos = map.latLngToLayerPoint(thisLayerLatLng), svg = L.Path.SVG, legOptions = L.extend({}, this._group.options.spiderLegPolylineOptions), finalLegOpacity = legOptions.opacity; 11230 for (void 0 === finalLegOpacity && (finalLegOpacity = L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity), 11231 svg ? (legOptions.opacity = 0, legOptions.className = (legOptions.className || "") + " leaflet-cluster-spider-leg") : legOptions.opacity = finalLegOpacity, 11232 group._ignoreMove = !0, i = 0; i < childMarkers.length; i++) m = childMarkers[i], 11233 newPos = map.layerPointToLatLng(positions[i]), leg = new L.Polyline([ thisLayerLatLng, newPos ], legOptions), 11234 map.addLayer(leg), m._spiderLeg = leg, svg && (legLength = (legPath = leg._path).getTotalLength() + .1, 11235 legPath.style.strokeDasharray = legLength, legPath.style.strokeDashoffset = legLength), 11236 m.setZIndexOffset && m.setZIndexOffset(1e6), m.clusterHide && m.clusterHide(), fg.addLayer(m), 11237 m._setPos && m._setPos(thisLayerPos); 11238 for (group._forceLayout(), group._animationStart(), i = childMarkers.length - 1; 0 <= i; i--) newPos = map.layerPointToLatLng(positions[i]), 11239 (m = childMarkers[i])._preSpiderfyLatlng = m._latlng, m.setLatLng(newPos), m.clusterShow && m.clusterShow(), 11240 svg && ((legPath = (leg = m._spiderLeg)._path).style.strokeDashoffset = 0, leg.setStyle({ 11241 opacity: finalLegOpacity 11242 })); 11243 this.setOpacity(.3), group._ignoreMove = !1, setTimeout(function() { 11244 group._animationEnd(), group.fire("spiderfied", { 11245 cluster: me, 11246 markers: childMarkers 11247 }); 11248 }, 200); 11249 }, 11250 _animationUnspiderfy: function(zoomDetails) { 11251 var m, i, leg, legPath, legLength, nonAnimatable, me = this, group = this._group, map = group._map, fg = group._featureGroup, thisLayerPos = zoomDetails ? map._latLngToNewLayerPoint(this._latlng, zoomDetails.zoom, zoomDetails.center) : map.latLngToLayerPoint(this._latlng), childMarkers = this.getAllChildMarkers(null, !0), svg = L.Path.SVG; 11252 for (group._ignoreMove = !0, group._animationStart(), this.setOpacity(1), i = childMarkers.length - 1; 0 <= i; i--) (m = childMarkers[i])._preSpiderfyLatlng && (m.closePopup(), 11253 m.setLatLng(m._preSpiderfyLatlng), delete m._preSpiderfyLatlng, nonAnimatable = !0, 11254 m._setPos && (m._setPos(thisLayerPos), nonAnimatable = !1), m.clusterHide && (m.clusterHide(), 11255 nonAnimatable = !1), nonAnimatable && fg.removeLayer(m), svg && (legLength = (legPath = (leg = m._spiderLeg)._path).getTotalLength() + .1, 11256 legPath.style.strokeDashoffset = legLength, leg.setStyle({ 11257 opacity: 0 11258 }))); 11259 group._ignoreMove = !1, setTimeout(function() { 11260 var stillThereChildCount = 0; 11261 for (i = childMarkers.length - 1; 0 <= i; i--) (m = childMarkers[i])._spiderLeg && stillThereChildCount++; 11262 for (i = childMarkers.length - 1; 0 <= i; i--) (m = childMarkers[i])._spiderLeg && (m.clusterShow && m.clusterShow(), 11263 m.setZIndexOffset && m.setZIndexOffset(0), 1 < stillThereChildCount && fg.removeLayer(m), 11264 map.removeLayer(m._spiderLeg), delete m._spiderLeg); 11265 group._animationEnd(), group.fire("unspiderfied", { 11266 cluster: me, 11267 markers: childMarkers 11268 }); 11269 }, 200); 11270 } 11271 }), L.MarkerClusterGroup.include({ 11272 _spiderfied: null, 11273 unspiderfy: function() { 11274 this._unspiderfy.apply(this, arguments); 11275 }, 11276 _spiderfierOnAdd: function() { 11277 this._map.on("click", this._unspiderfyWrapper, this), this._map.options.zoomAnimation && this._map.on("zoomstart", this._unspiderfyZoomStart, this), 11278 this._map.on("zoomend", this._noanimationUnspiderfy, this), L.Browser.touch || this._map.getRenderer(this); 11279 }, 11280 _spiderfierOnRemove: function() { 11281 this._map.off("click", this._unspiderfyWrapper, this), this._map.off("zoomstart", this._unspiderfyZoomStart, this), 11282 this._map.off("zoomanim", this._unspiderfyZoomAnim, this), this._map.off("zoomend", this._noanimationUnspiderfy, this), 11283 this._noanimationUnspiderfy(); 11284 }, 11285 _unspiderfyZoomStart: function() { 11286 this._map && this._map.on("zoomanim", this._unspiderfyZoomAnim, this); 11287 }, 11288 _unspiderfyZoomAnim: function(zoomDetails) { 11289 L.DomUtil.hasClass(this._map._mapPane, "leaflet-touching") || (this._map.off("zoomanim", this._unspiderfyZoomAnim, this), 11290 this._unspiderfy(zoomDetails)); 11291 }, 11292 _unspiderfyWrapper: function() { 11293 this._unspiderfy(); 11294 }, 11295 _unspiderfy: function(zoomDetails) { 11296 this._spiderfied && this._spiderfied.unspiderfy(zoomDetails); 11297 }, 11298 _noanimationUnspiderfy: function() { 11299 this._spiderfied && this._spiderfied._noanimationUnspiderfy(); 11300 }, 11301 _unspiderfyLayer: function(layer) { 11302 layer._spiderLeg && (this._featureGroup.removeLayer(layer), layer.clusterShow && layer.clusterShow(), 11303 layer.setZIndexOffset && layer.setZIndexOffset(0), this._map.removeLayer(layer._spiderLeg), 11304 delete layer._spiderLeg); 11305 } 11306 }), L.MarkerClusterGroup.include({ 11307 refreshClusters: function(layers) { 11308 return layers ? layers instanceof L.MarkerClusterGroup ? layers = layers._topClusterLevel.getAllChildMarkers() : layers instanceof L.LayerGroup ? layers = layers._layers : layers instanceof L.MarkerCluster ? layers = layers.getAllChildMarkers() : layers instanceof L.Marker && (layers = [ layers ]) : layers = this._topClusterLevel.getAllChildMarkers(), 11309 this._flagParentsIconsNeedUpdate(layers), this._refreshClustersIcons(), this.options.singleMarkerMode && this._refreshSingleMarkerModeMarkers(layers), 11310 this; 11311 }, 11312 _flagParentsIconsNeedUpdate: function(layers) { 11313 var id, parent; 11314 for (id in layer
11314s) for (parent = layers[id].__parent; parent; ) parent._iconNeedsUpdate = !0, 11315 parent = parent.__parent; 11316 }, 11317 _refreshSingleMarkerModeMarkers: function(layers) { 11318 var id, layer; 11319 for (id in layers) layer = layers[id], this.hasLayer(layer) && layer.setIcon(this._overrideMarkerIcon(layer)); 11320 } 11321 }), L.Marker.include({ 11322 refreshIconOptions: function(options, directlyRefreshClusters) { 11323 var icon = this.options.icon; 11324 return L.setOptions(icon, options), this.setIcon(icon), directlyRefreshClusters && this.__parent && this.__parent._group.refreshClusters(this), 11325 this; 11326 } 11327 }), exports.MarkerClusterGroup = MarkerClusterGroup, exports.MarkerCluster = MarkerCluster; 11328 }, "object" === (void 0 === exports ? "undefined" : _typeof(exports)) && void 0 !== module ? factory(exports) : "function" == typeof define && define.amd ? define([ "exports" ], factory) : factory(((void 0).Leaflet = (void 0).Leaflet || {}, 11329 (void 0).Leaflet.markercluster = (void 0).Leaflet.markercluster || {})); 11330 }, {
11331 "core-js/modules/es6.regexp.replace": 259, 11332 "core-js/modules/es6.symbol": 268, 11333 "core-js/modules/es7.symbol.async-iterator": 273 11334 } ], 11335 23: [ function(require, module, exports) { 11336 (function(global) { 11337 "use strict"; 11338 function _typeof(obj) { 11339 return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { 11340 return typeof obj; 11341 } : function(obj) { 11342 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 11343 })(obj); 11344 } 11345 require("core-js/modules/es7.symbol.async-iterator"), require("core-js/modules/es6.symbol"), 11346 require("core-js/modules/es6.array.sort"), require("core-js/modules/es6.regexp.replace"), 11347 require("core-js/modules/es6.regexp.constructor"), require("core-js/modules/es6.regexp.match"); 11348 (function(module, exports, require, define, browserify_shim__define__module__export__) { 11349 !function(window) { 11350 var timer, dummySrc, fixRespimg, findPictureImgs, onResize, mq, init, ua = navigator.userAgent; 11351 window.HTMLPictureElement && /ecko/.test(ua) && ua.match(/rv\:(\d+)/) && RegExp.$1 < 45 && addEventListener("resize", (dummySrc = document.createElement("source"), 11352 fixRespimg = function(img) { 11353 var source, sizes, picture = img.parentNode; 11354 "PICTURE" === picture.nodeName.toUpperCase() ? (source = dummySrc.cloneNode(), picture.insertBefore(source, picture.firstElementChild), 11355 setTimeout(function() { 11356 picture.removeChild(source); 11357 })) : (!img._pfLastSize || img.offsetWidth > img._pfLastSize) && (img._pfLastSize = img.offsetWidth, 11358 sizes = img.sizes, img.sizes += ",100vw", setTimeout(function() { 11359 img.sizes = sizes; 11360 })); 11361 }, findPictureImgs = function() { 11362 var i, imgs = document.querySelectorAll("picture > img, img[srcset][sizes]"); 11363 for (i = 0; i < imgs.length; i++) fixRespimg(imgs[i]); 11364 }, onResize = function() { 11365 clearTimeout(timer), timer = setTimeout(findPictureImgs, 99); 11366 }, mq = window.matchMedia && matchMedia("(orientation: landscape)"), init = function() { 11367 onResize(), mq && mq.addListener && mq.addListener(onResize); 11368 }, dummySrc.srcset = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==", 11369 /^[c|i]|d$/.test(document.readyState || "") ? init() : document.addEventListener("DOMContentLoaded", init), 11370 onResize)); 11371 }(window), function(window, document) { 11372 var eminpx, alwaysCheckWDescriptor, evalId; 11373 document.createElement("picture"); 11374 var pf = {}, isSupportTestReady = !1, noop = function() {}, image = document.createElement("img"), getImgAttr = image.getAttribute, setImgAttr = image.setAttribute, removeImgAttr = image.removeAttribute, docElem = document.documentElement, types = {}, cfg = { 11375 algorithm: "" 11376 }, ua = navigator.userAgent, supportAbort = /rident/.test(ua) || /ecko/.test(ua) && ua.match(/rv\:(\d+)/) && 35 < RegExp.$1, curSrcProp = "currentSrc", regWDesc = /\s+\+?\d+(e\d+)?w/, regSize = /(\([^)]+\))?\s*(.+)/, setOptions = window.picturefillCFG, fsCss = "font-size:100%!important;", isVwDirty = !0, cssCache = {}, sizeLengthCache = {}, DPR = window.devicePixelRatio, units = { 11377 px: 1, 11378 in: 96 11379 }, anchor = document.createElement("a"), alreadyRun = !1, regexLeadingSpaces = /^[ \t\n\r\u000c]+/, regexLeadingCommasOrSpaces = /^[, \t\n\r\u000c]+/, regexLeadingNotSpace
11379s = /^[^ \t\n\r\u000c]+/, regexTrailingCommas = /[,]+$/, regexNonNegativeInteger = /^\d+$/, regexFloatingPoint = /^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/, on = function(obj, evt, fn, capture) { 11380 obj.addEventListener ? obj.addEventListener(evt, fn, capture || !1) : obj.attachEvent && obj.attachEvent("on" + evt, fn); 11381 }, memoize = function(fn) { 11382 var cache = {}; 11383 return function(input) { 11384 return input in cache || (cache[input] = fn(input)), cache[input]; 11385 }; 11386 }; 11387 function isSpace(c) { 11388 return " " === c || "\t" === c || "\n" === c || "\f" === c || "\r" === c; 11389 } 11390 var regLength, buildStr, image2, width1, img, test, isDomReady, func, wait, timeout, timestamp, regReady, timerId, lastClientWidth, evalCSS = (regLength = /^([\d\.]+)(em|vw|px)$/, 11391 buildStr = memoize(function(css) { 11392 return "return " + function() { 11393 for (var args = arguments, index = 0, string = args[0]; ++index in args; ) string = string.replace(args[index], args[++index]); 11394 return string; 11395 }((css || "").toLowerCase(), /\band\b/g, "&&", /,/g, "||", /min-([a-z-\s]+):/g, "e.$1>=", /max-([a-z-\s]+):/g, "e.$1<=", /calc([^)]+)/g, "($1)", /(\d+[\.]*[\d]*)([a-z]+)/g, "($1 * e.$2)", /^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/gi, "") + ";"; 11396 }), function(css, length) { 11397 var parsedLength; 11398 if (!(css in cssCache)) if (cssCache[css] = !1, length && (parsedLength = css.match(regLength))) cssCache[css] = parsedLength[1] * units[parsedLength[2]]; else try { 11399 cssCache[css] = new Function("e", buildStr(css))(units); 11400 } catch (e) {} 11401 return cssCache[css]; 11402 }), setResolution = function(candidate, sizesattr) { 11403 return candidate.w ? (candidate.cWidth = pf.calcListLength(sizesattr || "100vw"), 11404 candidate.res = candidate.w / candidate.cWidth) : candidate.res = candidate.d, candidate; 11405 }, picturefill = function(opt) { 11406 if (isSupportTestReady) { 11407 var elements, i, plen, options = opt || {}; 11408 if (options.elements && 1 === options.elements.nodeType && ("IMG" === options.elements.nodeName.toUpperCase() ? options.elements = [ options.elements ] : (options.context = options.elements, 11409 options.elements = null)), plen = (elements = options.elements || pf.qsa(options.context || document, options.reevaluate || options.reselect ? pf.sel : pf.selShort)).length) { 11410 for (pf.setupRun(options), alreadyRun = !0, i = 0; i < plen; i++) pf.fillImg(elements[i], options); 11411 pf.teardownRun(options); 11412 } 11413 } 11414 }; 11415 function ascendingSort(a, b) { 11416 return a.res - b.res; 11417 } 11418 function getCandidateForSrc(src, set) { 11419 var i, candidate, candidates; 11420 if (src && set) for (candidates = pf.parseSet(set), src = pf.makeUrl(src), i = 0; i < candidates.length; i++) if (src === pf.makeUrl(candidates[i].url)) { 11421 candidate = candidates[i]; 11422 break; 11423 } 11424 return candidate; 11425 } 11426 function run() { 11427 var readyState = document.readyState || ""; 11428 timerId = setTimeout(run, "loading" === readyState ? 200 : 999), document.body && (pf.fillImgs(), 11429 (isDomReady = isDomReady || regReady.test(readyState)) && clearTimeout(timerId)); 11430 } 11431 function later() { 11432 var last = new Date() - timestamp; 11433 last < wait ? timeout = setTimeout(later, wait - last) : (timeout = null, func()); 11434 } 11435 window.console && console.warn, curSrcProp in image || (curSrcProp = "src"), types["image/jpeg"] = !0, 11436 types["image/gif"] = !0, types["image/png"] = !0, types["image/svg+xml"] = document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1"), 11437 pf.ns = ("pf" + new Date().getTime()).substr(0, 9), pf.supSrcset = "srcset" in image, 11438 pf.supSizes = "sizes" in image, pf.supPicture = !!window.HTMLPictureElement, pf.supSrcset && pf.supPicture && !pf.supSizes && (image2 = document.createElement("img"), 11439 image.srcset = "data:,a", image2.src = "data:,a", pf.supSrcset = image.complete === image2.complete, 11440 pf.supPicture = pf.supSrcset && pf.supPicture), pf.supSrcset && !pf.supSizes ? (width1 = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==", 11441 img = document.createElement("img"), test = function() { 11442 2 === img.width && (pf.supSizes = !0), alwaysCheckWDescriptor = pf.supSrcset && !pf.supSizes, 11443 isSupportTestReady = !0, setTimeout(picturefill); 11444 }, img.onload = test, img.onerror = test, img.setAttribute("sizes", "9px"), img.srcset = width1 + " 1w,data:image/gif;base64,R0lGODlhAgABAPAAAP///wAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw== 9w", 11445 img.src = width1) : isSupportTestReady = !0, pf.selShort = "picture>img,img[srcset]", 11446 pf.sel = pf.selShort, pf.cfg = cfg, pf.DPR = DPR || 1, pf.u = units, pf.types = types, 11447 pf.setSize = noop, pf.makeUrl = memoize(function(src) { 11448 return anchor.href = src, anchor.href; 11449 }), pf.qsa = function(context, sel) { 11450 return "querySelector" in context ? context.querySelectorAll(sel) : []; 11451 }, pf.matchesMedia = function() { 11452 return window.matchMedia && (matchMedia("(min-width: 0.1em)") || {}).matches ? pf.matchesMedia = function(media) { 11453 return !media || matchMedia(media).matches; 11454 } : pf.matchesMedia = pf.mMQ, pf.matchesMedia.apply(this, arguments); 11455 }, pf.mMQ = function(media) { 11456 return !media || evalCSS(media); 11457 }, pf.calcLength = function(sourceSizeValue) { 11458 var value = evalCSS(sourceSizeValue, !0) || !1; 11459 return value < 0 && (value = !1), value; 11460 }, pf.supportsType = function(type) { 11461 return !type || types[type]; 11462 }, pf.parseSize = memoize(function(sourceSizeStr) { 11463 var match = (sourceSizeStr || "").match(regSize); 11464 return { 11465 media: match && match[1], 11466 length: match && match[2] 11467 }; 11468 }), pf.parseSet = function(set) { 11469 return set.cands || (set.cands = function(input, set) { 11470 function collectCharacters(regEx) { 11471 var chars, match = regEx.exec(input.substring(pos)); 11472 if (match) return chars = match[0], pos += chars.length, chars; 11473 } 11474 var url, descriptors, currentDescriptor, state, c, inputLength = input.length, pos = 0, candidates = []; 11475 function parseDescriptors() { 11476 var w, d, h, i, desc, lastChar, value, intVal, floatVal, pError = !1, candidate = {}; 11477 for (i = 0; i < descriptors.length; i++) lastChar = (desc = descriptors[i])[desc.length - 1], 11478 value = desc.substring(0, desc.length - 1), intVal = parseInt(value, 10), floatVal = parseFloat(value), 11479 regexNonNegativeInteger.test(value) && "w" === lastChar ? ((w || d) && (pError = !0), 11480 0 === intVal ? pError = !0 : w = intVal) : regexFloatingPoint.test(value) && "x" === lastChar ? ((w || d || h) && (pError = !0), 11481 floatVal < 0 ? pError = !0 : d = floatVal) : regexNonNegativeInteger.test(value) && "h" === lastChar ? ((h || d) && (pError = !0), 11482 0 === intVal ? pError = !0 : h = intVal) : pError = !0; 11483 pError || (candidate.url = url, w && (candidate.w = w), d && (candidate.d = d), 11484 h && (candidate.h = h), h || d || w || (candidate.d = 1), 1 === candidate.d && (set.has1x = !0), 11485 candidate.set = set, candidates.push(candidate)); 11486 } 11487 function tokenize() { 11488 for (collectCharacters(regexLeadingSpaces), currentDescriptor = "", state = "in descriptor"; ;) { 11489 if (c = input.charAt(pos), "in descriptor" === state) if (isSpace(c)) currentDescriptor && (descriptors.push(currentDescriptor), 11490 currentDescriptor = "", state = "after descriptor"); else { 11491 if ("," === c) return pos += 1, currentDescriptor && descriptors.push(currentDescriptor), 11492 void parseDescriptors(); 11493 if ("(" === c) currentDescriptor += c, state = "in parens"; else { 11494 if ("" === c) return currentDescriptor && descriptors.push(currentDescriptor), void parseDescriptors(); 11495 currentDescriptor += c; 11496 } 11497 } else if ("in parens" === state) if (")" === c) currentDescriptor += c, state = "in descriptor"; else { 11498 if ("" === c) return descriptors.push(currentDescriptor), void parseDescriptors(); 11499 currentDescriptor += c; 11500 } else if ("after descriptor" === state) if (isSpace(c)) ; else { 11501 if ("" === c) return void parseDescriptors(); 11502 state = "in descriptor", pos -= 1; 11503 } 11504 pos += 1; 11505 } 11506 } 11507 for (;;) { 11508 if (collectCharacters(regexLeadingCommasOrSpaces), inputLength <= pos) return candidates; 11509 url = collectCharacters(regexLeadingNotSpace
11509s), descriptors = [], "," === url.slice(-1) ? (url = url.replace(regexTrailingCommas, ""), 11510 parseDescriptors()) : tokenize(); 11511 } 11512 }(set.srcset, set)), set.cands; 11513 }, pf.getEmValue = function() { 11514 var body; 11515 if (!eminpx && (body = document.body)) { 11516 var div = document.createElement("div"), originalHTMLCSS = docElem.style.cssText, originalBodyCSS = body.style.cssText; 11517 div.style.cssText = "position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)", 11518 docElem.style.cssText = fsCss, body.style.cssText = fsCss, body.appendChild(div), 11519 eminpx = div.offsetWidth, body.removeChild(div), eminpx = parseFloat(eminpx, 10), 11520 docElem.style.cssText = originalHTMLCSS, body.style.cssText = originalBodyCSS; 11521 } 11522 return eminpx || 16; 11523 }, pf.calcListLength = function(sourceSizeListStr) { 11524 if (!(sourceSizeListStr in sizeLengthCache) || cfg.uT) { 11525 var winningLength = pf.calcLength(function(strValue) { 11526 var i, unparsedSizesList, unparsedSizesListLength, unparsedSize, lastComponentValue, size, s, regexCssLengthWithUnits = /^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i, regexCssCalc = /^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i; 11527 for (unparsedSizesListLength = (unparsedSizesList = function(str) { 11528 var chrctr, component = "", componentArray = [], listArray = [], parenDepth = 0, pos = 0, inComment = !1; 11529 function pushComponent() { 11530 component && (componentArray.push(component), component = ""); 11531 } 11532 function pushComponentArray() { 11533 componentArray[0] && (listArray.push(componentArray), componentArray = []); 11534 } 11535 for (;;) { 11536 if ("" === (chrctr = str.charAt(pos))) return pushComponent(), pushComponentArray(), 11537 listArray; 11538 if (inComment) { 11539 if ("*" === chrctr && "/" === str[pos + 1]) { 11540 inComment = !1, pos += 2, pushComponent(); 11541 continue; 11542 } 11543 pos += 1; 11544 } else { 11545 if (isSpace(chrctr)) { 11546 if (str.charAt(pos - 1) && isSpace(str.charAt(pos - 1)) || !component) { 11547 pos += 1; 11548 continue; 11549 } 11550 if (0 === parenDepth) { 11551 pushComponent(), pos += 1; 11552 continue; 11553 } 11554 chrctr = " "; 11555 } else if ("(" === chrctr) parenDepth += 1; else if (")" === chrctr) parenDepth -= 1; else { 11556 if ("," === chrctr) { 11557 pushComponent(), pushComponentArray(), pos += 1; 11558 continue; 11559 } 11560 if ("/" === chrctr && "*" === str.charAt(pos + 1)) { 11561 inComment = !0, pos += 2; 11562 continue; 11563 } 11564 } 11565 component += chrctr, pos += 1; 11566 } 11567 } 11568 }(strValue)).length, i = 0; i < unparsedSizesListLength; i++) if (lastComponentValue = (unparsedSize = unparsedSizesList[i])[unparsedSize.length - 1], 11569 s = lastComponentValue, regexCssLengthWithUnits.test(s) && 0 <= parseFloat(s) || regexCssCalc.test(s) || "0" === s || "-0" === s || "+0" === s) {
11570 if (size = lastComponentValue, unparsedSize.pop(), 0 === unparsedSize.length) return size; 11571 if (unparsedSize = unparsedSize.join(" "), pf.matchesMedia(unparsedSize)) return size; 11572 } 11573 return "100vw"; 11574 }(sourceSizeListStr)); 11575 sizeLengthCache[sourceSizeListStr] = winningLength || units.width; 11576 } 11577 return sizeLengthCache[sourceSizeListStr]; 11578 }, pf.setRes = function(set) { 11579 var candidates; 11580 if (set) for (var i = 0, len = (candidates = pf.parseSet(set)).length; i < len; i++) setResolution(candidates[i], set.sizes); 11581 return candidates; 11582 }, pf.setRes.res = setResolution, pf.applySetCandidate = function(candidates, img) { 11583 if (candidates.length) { 11584 var candidate, i, j, length, bestCandidate, curSrc, curCan, candidateSrc, abortCurSrc, lowerValue, higherValue, dprValue, isCached, bonusFactor, bonus, imageData = img[pf.ns], dpr = pf.DPR; 11585 if (curSrc = imageData.curSrc || img[curSrcProp], (curCan = imageData.curCan || function(img, src, set) { 11586 var candidate; 11587 return !set && src && (set = (set = img[pf.ns].sets) && set[set.length - 1]), (candidate = getCandidateForSrc(src, set)) && (src = pf.makeUrl(src), 11588 img[pf.ns].curSrc = src, (img[pf.ns].curCan = candidate).res || setResolution(candidate, candidate.set.sizes)), 11589 candidate; 11590 }(img, curSrc, candidates[0].set)) && curCan.set === candidates[0].set && ((abortCurSrc = supportAbort && !img.complete && curCan.res - .1 > dpr) || (curCan.cached = !0, 11591 curCan.res >= dpr && (bestCandidate = curCan))), !bestCandidate) for (candidates.sort(ascendingSort), 11592 bestCandidate = candidates[(length = candidates.length) - 1], i = 0; i < length; i++) if ((candidate = candidates[i]).res >= dpr) { 11593 bestCandidate = candidates[j = i - 1] && (abortCurSrc || curSrc !== pf.makeUrl(candidate.url)) && (lowerValue = candidates[j].res, 11594 higherValue = candidate.res, dprValue = dpr, isCached = candidates[j].cached, bonus = bonusFactor = void 0, 11595 dprValue < ("saveData" === cfg.algorithm ? 2.7 < lowerValue ? dprValue + 1 : (bonus = (higherValue - dprValue) * (bonusFactor = Math.pow(lowerValue - .6, 1.5)), 11596 isCached && (bonus += .1 * bonusFactor), lowerValue + bonus) : 1 < dprValue ? Math.sqrt(lowerValue * higherValue) : lowerValue)) ? candidates[j] : candidate; 11597 break; 11598 } 11599 bestCandidate && (candidateSrc = pf.makeUrl(bestCandidate.url), imageData.curSrc = candidateSrc, 11600 imageData.curCan = bestCandidate, candidateSrc !== curSrc && pf.setSrc(img, bestCandidate), 11601 pf.setSize(img)); 11602 } 11603 }, pf.setSrc = function(img, bestCandidate) { 11604 var origWidth; 11605 img.src = bestCandidate.url, "image/svg+xml" === bestCandidate.set.type && (origWidth = img.style.width, 11606 img.style.width = img.offsetWidth + 1 + "px", img.offsetWidth + 1 && (img.style.width = origWidth)); 11607 }, pf.getSet = function(img) { 11608 var i, set, supportsType, match = !1, sets = img[pf.ns].sets; 11609 for (i = 0; i < sets.length && !match; i++) if ((set = sets[i]).srcset && pf.matchesMedia(set.media) && (supportsType = pf.supportsType(set.type))) { 11610 "pending" === supportsType && (set = supportsType), match = set; 11611 break; 11612 } 11613 return match; 11614 }, pf.parseSets = function(element, parent, options) { 11615 var srcsetAttribute, imageSet, isWDescripor, srcsetParsed, hasPicture = parent && "PICTURE" === parent.nodeName.toUpperCase(), imageData = element[pf.ns]; 11616 void 0 !== imageData.src && !options.src || (imageData.src = getImgAttr.call(element, "src"), 11617 imageData.src ? setImgAttr.call(element, "data-pfsrc", imageData.src) : removeImgAttr.call(element, "data-pfsrc")), 11618 void 0 !== imageData.srcset && !options.srcset && pf.supSrcset && !element.srcset || (srcsetAttribute = getImgAttr.call(element, "srcset"), 11619 imageData.srcset = srcsetAttribute, srcsetParsed = !0), imageData.sets = [], hasPicture && (imageData.pic = !0, 11620 function(picture, candidates) { 11621 var i, len, source, srcset, sources = picture.getElementsByTagName("source"); 11622 for (i = 0, len = sources.length; i < len; i++) (source = sources[i])[pf.ns] = !0, 11623 (srcset = source.getAttribute("srcset")) && candidates.push({ 11624 srcset: srcset, 11625 media: source.getAttribute("media"), 11626 type: source.getAttribute("type"), 11627 sizes: source.getAttribute("sizes") 11628 }); 11629 }(parent, imageData.sets)), imageData.srcset ? (imageSet = { 11630 srcset: imageData.srcset, 11631 sizes: getImgAttr.call(element, "sizes") 11632 }, imageData.sets.push(imageSet), (isWDescripor = (alwaysCheckWDescriptor || imageData.src) && regWDesc.test(imageData.srcset || "")) || !imageData.src || getCandidateForSrc(imageData.src, imageSet) || imageSet.has1x || (imageSet.srcset += ", " + imageData.src, 11633 imageSet.cands.push({ 11634 url: imageData.src, 11635 d: 1, 11636 set: imageSet 11637 }))) : imageData.src && imageData.sets.push({ 11638 srcset: imageData.src, 11639 sizes: null 11640 }), imageData.curCan = null, imageData.curSrc = void 0, imageData.supported = !(hasPicture || imageSet && !pf.supSrcset || isWDescripor && !pf.supSizes), 11641 srcsetParsed && pf.supSrcset && !imageData.supported && (srcsetAttribute ? (setImgAttr.call(element, "data-pfsrcset", srcsetAttribute), 11642 element.srcset = "") : removeImgAttr.call(element, "data-pfsrcset")), imageData.supported && !imageData.srcset && (!imageData.src && element.src || element.src !== pf.makeUrl(imageData.src)) && (null === imageData.src ? element.removeAttribute("src") : element.src = imageData.src), 11643 imageData.parsed = !0; 11644 }, pf.fillImg = function(element, options) { 11645 var imageData, extreme = options.reselect || options.reevaluate; 11646 element[pf.ns] || (element[pf.ns] = {}), imageData = element[pf.ns], !extreme && imageData.evaled === evalId || (imageData.parsed && !options.reevaluate || pf.parseSets(element, element.parentNode, options), 11647 imageData.supported ? imageData.evaled = evalId : function(img) { 11648 var srcSetCandidates, matchingSet = pf.getSet(img), evaluated = !1; 11649 "pending" !== matchingSet && (evaluated = evalId, matchingSet && (srcSetCandidates = pf.setRes(matchingSet), 11650 pf.applySetCandidate(srcSetCandidates, img))), img[pf.ns].evaled = evaluated; 11651 }(element)); 11652 }, pf.setupRun = function() { 11653 alreadyRun && !isVwDirty && DPR === window.devicePixelRatio || (isVwDirty = !1, 11654 DPR = window.devicePixelRatio, cssCache = {}, sizeLengthCache = {}, pf.DPR = DPR || 1, 11655 units.width = Math.max(window.innerWidth || 0, docElem.clientWidth), units.height = Math.max(window.innerHeight || 0, docElem.clientHeight), 11656 units.vw = units.width / 100, units.vh = units.height / 100, evalId = [ units.height, units.width, DPR ].join("-"), 11657 units.em = pf.getEmValue(), units.rem = units.em); 11658 }
11658, pf.supPicture ? (picturefill = noop, pf.fillImg = noop) : (regReady = window.attachEvent ? /d$|^c/ : /d$|^c|^i/, 11659 timerId = setTimeout(run, document.body ? 9 : 99), lastClientWidth = docElem.clientHeight, 11660 on(window, "resize", (func = function() { 11661 isVwDirty = Math.max(window.innerWidth || 0, docElem.clientWidth) !== units.width || docElem.clientHeight !== lastClientWidth, 11662 lastClientWidth = docElem.clientHeight, isVwDirty && pf.fillImgs(); 11663 }, wait = 99, function() { 11664 timestamp = new Date(), timeout = timeout || setTimeout(later, wait); 11665 })), on(document, "readystatechange", run)), pf.picturefill = picturefill, pf.fillImgs = picturefill, 11666 pf.teardownRun = noop, picturefill._ = pf, window.picturefillCFG = { 11667 pf: pf, 11668 push: function(args) { 11669 var name = args.shift(); 11670 "function" == typeof pf[name] ? pf[name].apply(pf, args) : (cfg[name] = args[0], 11671 alreadyRun && pf.fillImgs({ 11672 reselect: !0 11673 })); 11674 } 11675 }; 11676 for (;setOptions && setOptions.length; ) window.picturefillCFG.push(setOptions.shift()); 11677 window.picturefill = picturefill, "object" === _typeof(module) && "object" === _typeof(module.exports) ? module.exports = picturefill : "function" == typeof define && define.amd && define("picturefill", function() { 11678 return picturefill; 11679 }), pf.supPicture || (types["image/webp"] = function(type, typeUri) { 11680 var image = new window.Image(); 11681 return image.onerror = function() { 11682 types[type] = !1, picturefill(); 11683 }, image.onload = function() { 11684 types[type] = 1 === image.width, picturefill(); 11685 }, image.src = typeUri, "pending"; 11686 }("image/webp", "data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==")); 11687 }(window, document), browserify_shim__define__module__export__("undefined" != typeof picturefill ? picturefill : window.picturefill); 11688 }).call(global, void 0, void 0, void 0, void 0, function(ex) { 11689 module.exports = ex; 11690 }); 11691 }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}); 11692 }, { 11693 "core-js/modules/es6.array.sort": 242, 11694 "core-js/modules/es6.regexp.constructor": 255, 11695 "core-js/modules/es6.regexp.match": 258, 11696 "core-js/modules/es6.regexp.replace": 259, 11697 "core-js/modules/es6.symbol": 268, 11698 "core-js/modules/es7.symbol.async-iterator": 273 11699 } ], 11700 24: [ function(require, module, exports) { 11701 "use strict"; 11702 function _typeof(obj) { 11703 return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { 11704 return typeof obj; 11705 } : function(obj) { 11706 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 11707 })(obj); 11708 } 11709 var g; 11710 require("core-js/modules/es7.symbol.async-iterator"), require("core-js/modules/es6.symbol"), 11711 require("core-js/modules/es6.regexp.replace"), require("core-js/modules/web.dom.iterable"), 11712 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 11713 require("core-js/modules/es6.object.keys"), g = function() { 11714 return function h(g, n) { 11715 var a = Object.create(h.prototype), k = 0, p = 0, l = 0, q = 0, e = [], r = !0, z = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame || function(a) { 11716 setTimeout(a, 1e3 / 60); 11717 }, A = window.transformProp || function() { 11718 var a = document.createElement("div"); 11719 if (null === a.style.transform) { 11720 var d, b = [ "Webkit", "Moz", "ms" ]; 11721 for (d in b) if (void 0 !== a.style[b[d] + "Transform"]) return b[d] + "Transform"; 11722 } 11723 return "transform"; 11724 }(); 11725 a.options = { 11726 speed: -2, 11727 center: !1, 11728 wrapper: null, 11729 round: !0, 11730 vertical: !0, 11731 horizontal: !1, 11732 callback: function() {} 11733 }
11733, n && Object.keys(n).forEach(function(c) { 11734 a.options[c] = n[c]; 11735 }); 11736 var m = "string" == typeof (g = g || ".rellax") ? document.querySelectorAll(g) : [ g ]; 11737 if (!(0 < m.length)) throw Error("The elements you're trying to select don't exist."); 11738 if (a.elems = m, a.options.wrapper && !a.options.wrapper.nodeType) { 11739 if (!(m = document.querySelector(a.options.wrapper))) throw Error("The wrapper you're trying to use don't exist."); 11740 a.options.wrapper = m; 11741 } 11742 function u() { 11743 for (var c = 0; c < e.length; c++) a.elems[c].style.cssText = e[c].style; 11744 for (e = [], p = window.innerHeight, q = window.innerWidth, v(), c = 0; c < a.elems.length; c++) { 11745 var b = a.elems[c], d = b.getAttribute("data-rellax-percentage"), t = b.getAttribute("data-rellax-speed"), g = b.getAttribute("data-rellax-zindex") || 0, h = a.options.wrapper ? a.options.wrapper.scrollTop : window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop, f = a.options.vertical && (d || a.options.center) ? h : 0, k = a.options.horizontal && (d || a.options.center) ? window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft : 0; 11746 h = f + b.getBoundingClientRect().top; 11747 var l = b.clientHeight || b.offsetHeight || b.scrollHeight, m = k + b.getBoundingClientRect().left, n = b.clientWidth || b.offsetWidth || b.scrollWidth; 11748 f = d || (f - h + p) / (l + p), d = d || (k - m + q) / (n + q), a.options.center && (f = d = .5), 11749 t = t || a.options.speed, d = w(d, f, t), f = "", 0 <= (b = b.style.cssText).indexOf("transform") && (f = b.indexOf("transform"), 11750 f = (k = (f = b.slice(f)).indexOf(";")) ? " " + f.slice(11, k).replace(/\s/g, "") : " " + f.slice(11).replace(/\s/g, "")), 11751 e.push({ 11752 baseX: d.x, 11753 baseY: d.y, 11754 top: h, 11755 left: m, 11756 height: l, 11757 width: n, 11758 speed: t, 11759 style: b, 11760 transform: f, 11761 zindex: g 11762 }); 11763 } 11764 r && (window.addEventListener("resize", u), r = !1), x(); 11765 } 11766 var v = function() { 11767 var c = k, b = l; 11768 return k = a.options.wrapper ? a.options.wrapper.scrollTop : (document.documentElement || document.body.parentNode || document.body).scrollTop || window.pageYOffset, 11769 l = a.options.wrapper ? a.options.wrapper.scrollLeft : (document.documentElement || document.body.parentNode || document.body).scrollLeft || window.pageXOffset, 11770 !!(c != k && a.options.vertical || b != l && a.options.horizontal); 11771 }, w = function(c, b, d) { 11772 var e = {}; 11773 return c = 100 * d * (1 - c), b = 100 * d * (1 - b), e.x = a.options.round ? Math.round(c) : Math.round(100 * c) / 100, 11774 e.y = a.options.round ? Math.round(b) : Math.round(100 * b) / 100, e; 11775 }, x = function() { 11776 for (var c, b = 0; b < a.elems.length; b++) { 11777 var d = (c = w((l - e[b].left + q) / (e[b].width + q), (k - e[b].top + p) / (e[b].height + p), e[b].speed)).y - e[b].baseY, g = c.x - e[b].baseX; 11778 a.elems[b].style[A] = "translate3d(" + (a.options.horizontal ? g : "0") + "px," + (a.options.vertical ? d : "0") + "px," + e[b].zindex + "px) " + e[b].transform; 11779 } 11780 a.options.callback(c); 11781 }; 11782 return a.destroy = function() { 11783 for (var c = 0; c < a.elems.length; c++) a.elems[c].style.cssText = e[c].style; 11784 r || (window.removeEventListener("resize", u), r = !0); 11785 }, u(), function y() { 11786 v() && !1 === r && x(), z(y); 11787 }(), a.refresh = u, a; 11788 }; 11789 }, "function" == typeof define && define.amd ? define([], g) : "object" === (void 0 === module ? "undefined" : _typeof(module)) && module.exports ? module.exports = g() : (void 0).Rellax = g(); 11790 }, {
11791 "core-js/modules/es6.array.iterator": 241, 11792 "core-js/modules/es6.object.keys": 250, 11793 "core-js/modules/es6.object.to-string": 252, 11794 "core-js/modules/es6.regexp.replace": 259, 11795 "core-js/modules/es6.symbol": 268, 11796 "core-js/modules/es7.symbol.async-iterator": 273, 11797 "core-js/modules/web.dom.iterable": 274 11798 } ], 11799 25: [ function(require, module, exports) { 11800 "use strict"; 11801 Object.defineProperty(exports, "__esModule", { 11802 value: !0 11803 }), exports.default = function() { 11804 [].forEach.call(document.querySelectorAll(".js-quickadd-form"), function(el) { 11805 return new GiftCatalogQuickAdd(el); 11806 }); 11807 }, require("core-js/modules/es7.object.get-own-property-descriptors"), require("core-js/modules/es6.symbol"), 11808 require("core-js/modules/web.dom.iterable"), require("core-js/modules/es6.array.iterator"), 11809 require("core-js/modules/es6.object.to-string"), require("core-js/modules/es6.object.keys"), 11810 require("core-js/modules/es6.string.iterator"), require("core-js/modules/es6.array.from"), 11811 require("core-js/modules/es6.function.name"); 11812 var _checkout = require("./core/utilities/checkout.utilities"), _heifer = require("./core/utilities/heifer.utilities"), _minicart = (require("./core/utilities/a11y"), 11813 _interopRequireDefault(require("./shared/minicart/minicart"))), _submitButton = (_interopRequireDefault(require("./pages/giftCatalogProduct/giftCatalogProductGallery/giftCatalogProductGallery")), 11814 _interopRequireDefault(require("./shared/forms/submitButton/submitButton"))), _reveal = _interopRequireDefault(require("./core/ui/reveal.es6")); 11815 function _interopRequireDefault(obj) { 11816 return obj && obj.__esModule ? obj : { 11817 default: obj 11818 }; 11819 } 11820 function ownKeys(object, enumerableOnly) { 11821 var keys = Object.keys(object); 11822 if (Object.getOwnPropertySymbols) { 11823 var symbols = Object.getOwnPropertySymbols(object); 11824 enumerableOnly && (symbols = symbols.filter(function(sym) { 11825 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 11826 })), keys.push.apply(keys, symbols); 11827 } 11828 return keys; 11829 } 11830 function _objectSpread(target) { 11831 for (var i = 1; i < arguments.length; i++) { 11832 var source = null != arguments[i] ? arguments[i] : {}; 11833 i % 2 ? ownKeys(source, !0).forEach(function(key) { 11834 _defineProperty(target, key, source[key]); 11835 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 11836 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 11837 }); 11838 } 11839 return target; 11840 } 11841 function _defineProperty(obj, key, value) { 11842 return key in obj ? Object.defineProperty(obj, key, { 11843 value: value, 11844 enumerable: !0, 11845 configurable: !0, 11846 writable: !0 11847 }) : obj[key] = value, obj; 11848 } 11849 function _defineProperties(target, props) { 11850 for (var i = 0; i < props.length; i++) { 11851 var descriptor = props[i]; 11852 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 11853 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 11854 } 11855 } 11856 var GiftCatalogQuickAdd = function() { 11857 function GiftCatalogQuickAdd(element, options) { 11858 !function(instance, Constructor) { 11859 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 11860 }(this, GiftCatalogQuickAdd), this.element = element; 11861 var defaults = { 11862 tooltip: "", 11863 tooltipValue: "", 11864 tooltipUnit: "" 11865 }; 11866 this._defaults = defaults, this.settings = _objectSpread({}, defaults, {}, options), 11867 this.form = this.element, this.formType = this.form.dataset.formType, this.formExtraFields = this.form.querySelectorAll(".js-product-extraField"), 11868 this.product = this.form.querySelector(".js-product-item"), this.quantityInput = this.form.querySelector(".js-product-quantity"), 11869 this.multipleQuantityInput = this.form.querySelector(".js-multiple-product-quantity"), 11870 this.frequencyInput = this.form.querySelectorAll(".js-frequency"), this.unitShare = this.form.dataset.unitShare, 11871 this.unitFull = this.form.dataset.unitFull, this.quantityAmount = this.form.dataset.quantityAmount, 11872 this.inputWrapper = this.form.querySelector(".js-product-input-wrapper"), this.multiplesShowLink = this.form.querySelector(".js-product-multiples-show"), 11873 this.multiplesWrapper = this.form.querySelector(".js-product-multiples"), this.subtotal = this.form.querySelector(".js-product-subtotal"), 11874 this.miniCartWrapper = document.querySelector(".js-mini-cart-wrapper"), this.stateSwap = this.form.querySelector(".js-state-swap"), 11875 this.stateWrapper = (0, _heifer.uClosest)(this.form, ".js-product-cta-state-wrapper"), 11876 this.getButtons(), this.variationsPrice = window.Heifer.variationsPrice, this.variationsSoldOut = window.Heifer.variationsSoldOut, 11877 this.variationsLowInventory = window.Heifer.variationsLowInventory, this.variationsDropdown = this.form.querySelector(".js-variations"), 11878 this.variationsText = this.form.querySelector(".js-variations-price"), this.variationsMessage = this.form.querySelector(".js-variations-message"), 11879 this.variationsImage = document.querySelectorAll(".js-marketplace-slide"), this.variationsButton = this.form.querySelector(".js-product-add-to-basket"), 11880 this.basketBadge = window.document.querySelector(".js-basket-badge"), this.submitButton = new _submitButton.default(this.variationsButton), 11881 this.productCard = (0, _heifer.uClosest)(this.form, ".js-product-card"), this.gcTabs = this.productCard ? this.productCard.querySelector(".js-gift-catalog-tabs") : null, 11882 this.gcTabButtons = this.gcTabs ? this.gcTabs.querySelectorAll(".js-gift-catalog-tab") : null, 11883 this.defaultTab = this.gcTabs ? this.gcTabs.querySelector(".is-default") : null, 11884 this.originalProductType = (0, _checkout.getProductData)(this.product, "type"), 11885 this.originalFormType = this.formType, this.originalPriceFull = (0, _checkout.getProductData)(this.product, "price_full"), 11886 this.originalPriceShare = (0, _checkout.getProductData)(this.product, "price_share"), 11887 this.originalAmount = (0, _checkout.getProductData)(this.product, "amount"), this.originalShareUnit = this.unitShare, 11888 this.backButton = this.form.querySelector(".js-quickadd-back-button"), this.productCards = document.querySelectorAll(".productCard"), 11889 this.activeCard = null, this.init(); 11890 } 11891 return function(Constructor, protoProps, staticProps) { 11892 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 11893 }(GiftCatalogQuickAdd, [ { 11894 key: "init", 11895 value: function() { 11896 this.setTabListeners(), this.setEventListeners(), this.initReveal(), "slider" === this.formType && this.quantityAmount ? this.updateAmount() : "buttons" === this.formType ? this.updateAmountFromButtons() : (this.updateMultipleAmount(this.isMultiple()), 11897 this.isMultiple() ? this.updateMultipleQuantity() : this.updateQuantity()), this.defaultTab && this.updateProductMonthlyInfo(this.defaultTab), 11898 this.updateSubtotal(), this.updateFrequency(); 11899 } 11900 }, { 11901 key: "getButtons", 11902 value: function() { 11903 "buttons" === this.formType && (this.buttons = this.form.querySelectorAll(".js-gift-catalog-product-button"), 11904 this.buttonOther = this.form.querySelector(".js-button-input-input")); 11905 } 11906 }, { 11907 key: "setTabListeners", 11908 value: function() { 11909 var _this = this; 11910 this.gcTabs && this.gcTabButtons && [].forEach.call(this.gcTabButtons, function(tab) { 11911 tab.addEventListener("click", function(ev) { 11912 _this.updateProductMonthlyInfo(tab); 11913 }); 11914 }); 11915 } 11916 }, { 11917 key: "setEventListeners", 11918 value: function() { 11919 var _this2 = this; 11920 this.form.addEventListener("submit", function(ev) { 11921 _this2.addToBasket(_this2.product), ev.preventDefault(); 11922 }), this.setInputListeners(), this.variationsDropdown && (this.form.addEventListener("change", function(ev) { 11923 _this2.updateVariationAll(); 11924 }
11924), this.updateVariationAll()), this.setSliderListeners(), this.setButtonListeners(), 11925 this.stateSwap && this.stateWrapper && this.stateSwap.addEventListener("click", function(e) { 11926 (0, _heifer.uToggleClass)(_this2.stateWrapper, "is-multiple"), _this2.updateMultipleAmount(_this2.isMultiple()), 11927 (0, _heifer.uHasClass)(_this2.stateWrapper, "is-multiple") || (_this2.multipleQuantityInput.value = 1, 11928 _this2.multipleQuantityInput.dispatchEvent((0, _heifer.uCreateEvent)("input"))), 11929 _this2.isMultiple() ? _this2.updateMultipleQuantity() : _this2.updateQuantity(), 11930 _this2.updateSubtotal(); 11931 }); 11932 var otherAmount = document.getElementById("giftCardOtherAmount"); 11933 null != otherAmount && otherAmount.addEventListener("change", function(e) { 11934 (0, _checkout.updateProductData)(_this2.product, { 11935 amount: e.target.value 11936 }); 11937 }); 11938 var that = this; 11939 $(window).on("update-product-amount", function(e) { 11940 that.updateAmount(); 11941 }); 11942 } 11943 }, { 11944 key: "setInputListeners", 11945 value: function() { 11946 var _this3 = this; 11947 this.form.addEventListener("input", function(ev) { 11948 var target = ev.target; 11949 target === _this3.quantityInput && ("slider" === _this3.formType && _this3.quantityAmount ? _this3.updateAmount() : "buttons" === _this3.formType ? _this3.updateAmountFromButtons() : (_this3.updateMultipleAmount(_this3.isMultiple()), 11950 _this3.isMultiple() ? _this3.updateMultipleQuantity() : _this3.updateQuantity()), 11951 _this3.updateSubtotal()), target === _this3.multipleQuantityInput && (_this3.updateMultipleQuantity(target), 11952 _this3.updateSubtotal()), [].forEach.call(_this3.frequencyInput, function(el) { 11953 target === el && _this3.updateFrequency(); 11954 }), "orderHonoree" == target.name && (target.value = target.checked ? "1" : ""); 11955 }); 11956 } 11957 }, { 11958 key: "setSliderListeners", 11959 value: function() { 11960 var _this4 = this; 11961 "slider" === this.formType && (this.form.dataset.priceDefault === this.form.dataset.priceFull && this.updateTooltipMax(), 11962 this.multiplesShowLink && this.multiplesShowLink.addEventListener("click", function(e) { 11963 (0, _heifer.uRemoveClass)(e.target, "is-active"), (0, _heifer.uAddClass)(_this4.multiplesWrapper, "is-active"), 11964 (0, _heifer.uAddClass)(_this4.multiplesWrapper, "was-active"), (0, _heifer.uAddClass)(_this4.inputWrapper, "showing-input"), 11965 (0, _heifer.uToggleClass)(_this4.stateWrapper, "is-single"); 11966 }), window.addEventListener("input-slider-min", this.updateTooltipMin.bind(this)), 11967 window.addEventListener("input-slider-max", this.updateTooltipMax.bind(this)), window.addEventListener("input-slider-change", function() { 11968 (0, _heifer.uHasClass)(_this4.inputWrapper, "is-active") && _this4.hideContainer(_this4.inputWrapper); 11969 })); 11970 } 11971 }, { 11972 key: "setButtonListeners", 11973 value: function() { 11974 var _this5 = this; 11975 "buttons" === this.formType && ([].forEach.call(this.buttons, function(btn) { 11976 btn.removeEventListener("click", function(ev) { 11977 _this5.updateAmountFromButtons(ev.target); 11978 }), btn.addEventListener("click", function(ev) { 11979 _this5.updateAmountFromButtons(ev.target); 11980 }); 11981 }), this.buttonOther.removeEventListener("change", function(ev) { 11982 _this5.updateAmountFromButtons(ev.target); 11983 }), this.buttonOther.addEventListener("change", function(ev) { 11984 _this5.updateAmountFromButtons(ev.target); 11985 })), this.backButton && this.backButton.addEventListener("click", function(ev) { 11986 _this5.hideActiveCard(); 11987 }); 11988 } 11989 }, { 11990 key: "addToBasket", 11991 value: function(product) { 11992 var productData, _this6 = this; 11993 productData = this.formExtraFields ? _objectSpread({}, JSON.parse(product.value), {}, this.getExtraFields(), {}, { 11994 userAgent: navigator.userAgent 11995 }) : JSON.parse(product.value), (0, _checkout.onCartAdd)(productData); 11996 (0, _heifer.uAjaxWithResponse)("POST", _checkout.CART_ADD_PRODUCT_URL, !0, (0, _heifer.uJsonToQueryString)(productData), "application/x-www-form-urlencoded; charset=UTF-8").then(function(response) { 11997 var responseObject = JSON.parse(response), cartCount = responseObject.response.body.cart.userCart.cartItemCount; 11998 _this6.miniCartWrapper.innerHTML = responseObject.html, new _minicart.default(_this6.miniCartWrapper.querySelector(".js-mini-cart")), 11999 (0, _heifer.uStopPageScrollable)(), _this6.submitButton.reset(), (0, _heifer.uHasClass)(_this6.basketBadge, "has-count") || (0, 12000 _heifer.uAddClass)(_this6.basketBadge, "has-count"), _this6.basketBadge.textContent = cartCount, 12001 _this6.hideActiveCard(); 12002 }).catch(function(error) { 12003 console.error(error), _this6.submitButton.reset(); 12004 }); 12005 } 12006 }, { 12007 key: "updateQuantity", 12008 value: function(argument_0) { 12009 var input = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.quantityInput; 12010 input && ((0, _checkout.updateProductData)(this.product, { 12011 quantity: input.value 12012 }), this.form.dataset.quantity = input.value); 12013 } 12014 }, { 12015 key: "updateMultipleQuantity", 12016 value: function(argument_0) { 12017 var input = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.multipleQuantityInput; 12018 input && ((0, _checkout.updateProductData)(this.product, { 12019 quantity: input.value 12020 }), this.form.dataset.quantity = input.value); 12021 } 12022 }, { 12023 key: "updateMultipleAmount", 12024 value: function(argument_0) { 12025 var isMultiple = !(0 < arguments.length && void 0 !== argument_0) || argument_0; 12026 (0, _checkout.updateProductData)(this.product, { 12027 amount: isMultiple ? this.form.dataset.priceFull : this.form.dataset.priceStart 12028 }); 12029 } 12030 }, { 12031 key: "isMultiple", 12032 value: function() { 12033 return this.stateWrapper && ((0, _heifer.uHasClass)(this.stateWrapper, "is-multiple") || this.quantityInput.value * this.form.dataset.priceStart >= this.form.dataset.priceFull); 12034 } 12035 }, { 12036 key: "updateSubtotal", 12037 value: function() { 12038 var newSubtotal = this.form.dataset.priceStart * this.form.dataset.quantity; 12039 this.form.dataset.subtotal = newSubtotal, this.subtotal && (this.subtotal.innerText = "$" + newSubtotal); 12040 } 12041 }, { 12042 key: "updateTooltipMin", 12043 value: function(ev) { 12044 this.form.querySelector(".inputSlider__tooltip").querySelector(".js-slider-tooltip-unit").innerText = this.unitShare.slice(0, -1); 12045 } 12046 }, { 12047 key: "updateTooltipMax", 12048 value: function(ev) { 12049 var tooltip = this.form.querySelector(".inputSlider__tooltip"), tooltipValue = tooltip.querySelector(".js-slider-tooltip-value"), tooltipUnit = tooltip.querySelector(".js-slider-tooltip-unit"); 12050 this.inputWrapper && this.showContainer(this.inputWrapper), tooltipValue.innerText = 1, 12051 tooltipUnit.innerText = this.unitFull; 12052 } 12053 }, { 12054 key: "updateFrequency", 12055 value: function() { 12056 var _this7 = this; 12057 [].forEach.call(this.frequencyInput, function(el) { 12058 el.checked && ("monthly" === el.value ? (0, _checkout.updateProductData)(_this7.product, { 12059 isMonthly: 1 12060 }) : (0, _checkout.updateProductData)(_this7.product, { 12061 isMonthly: 0 12062 })); 12063 }); 12064 } 12065 }, { 12066 key: "updateProductMonthlyInfo", 12067 value: function(tab) { 12068 "true" == tab.dataset.monthly ? (this.form.dataset.isMonthlyTab = "true", (0, _checkout.updateProductData)(this.product, { 12069 isMonthly: 1, 12070 type: "gift_catalog_donation" 12071 })) : (this.form.dataset.isMonthlyTab = "false", (0, _checkout.updateProductData)(this.product, { 12072 isMonthly: 0, 12073 type: this.originalProductType 12074 })); 12075 } 12076 }, { 12077 key: "getExtraFields", 12078 value: function() { 12079 var extraFields = []; 12080 return [].forEach.call(this.formExtraFields, function(el) { 12081 el.value && !el.disabled && extraFields.push(el); 12082 }), this.objectifyForm(extraFields); 12083 } 12084 }, { 12085 key: "objectifyForm", 12086 value: function(formArray) { 12087 for (var returnArray = {}, i = 0; i < formArray.length; i++) returnArray[formArray[i].name] = formArray[i].value; 12088 return returnArray; 12089 } 12090 }, { 12091 key: "updateAmount", 12092 value: function() { 12093 this.quantityAmount || (this.quantityAmount = this.form.dataset.quantityAmount), 12094 this.quantityInput || (this.quantityInput = this.form.querySelector(".js-product-quantity")), 12095 (0, _checkout.updateProductData)(this.product, { 12096 amount: this.quantityAmount * this.quantityInput.value 12097 }); 12098 } 12099 }, { 12100 key: "updateAmountFromButtons",
12101 value: function(btn) { 12102 (btn = btn || [].filter.call(this.buttons, function(button) { 12103 return button.checked; 12104 })[0]) && (0, _checkout.updateProductData)(this.product, { 12105 amount: btn.value 12106 }); 12107 } 12108 }, { 12109 key: "updateVariationAll", 12110 value: function() { 12111 this.updateVariation(), this.updateVariationUUID(); 12112 } 12113 }, { 12114 key: "updateVariation", 12115 value: function() { 12116 var selected = this.variationsDropdown.options[this.variationsDropdown.selectedIndex].value, variationsPrice = this.variationsPrice[selected], variationsSoldOut = this.variationsSoldOut[selected], variationsLowInventory = this.variationsLowInventory[selected]; 12117 this.form.dataset.subtotal = variationsPrice, "slider" === this.formType && this.quantityAmount ? this.updateAmount() : "buttons" === this.formType ? this.updateAmountFromButtons() : this.updateQuantity(), 12118 this.form.dataset.priceStart = variationsPrice, this.updateSubtotal(), this.variationsMessage.innerHTML = null, 12119 this.variationsButton.disabled = !1, variationsSoldOut && (this.variationsMessage.innerHTML = '<p class="giftCatalogProductHeader__body alert alert__medium">Sorry, this product is sold out.</p>', 12120 this.variationsButton.disabled = !0), variationsLowInventory && (this.variationsMessage.innerHTML = '<p class="giftCatalogProductHeader__body alert alert__low">The availability of this product is low.</p>'), 12121 variationsPrice && (this.variationsText.innerHTML = "$" + variationsPrice, (0, _checkout.updateProductData)(this.product, { 12122 amount: variationsPrice 12123 })); 12124 } 12125 }, { 12126 key: "updateVariationUUID", 12127 value: function() { 12128 var selected = this.variationsDropdown.options[this.variationsDropdown.selectedIndex]; 12129 (0, _checkout.updateProductData)(this.product, { 12130 productVariationUUID: selected.value, 12131 productVariationSku: selected.dataset.sku, 12132 productVariationName: selected.dataset.name 12133 }); 12134 } 12135 }, { 12136 key: "hideContainer", 12137 value: function(el, input) { 12138 el.setAttribute("aria-hidden", "true"), (0, _heifer.uRemoveClass)(el, "is-active"), 12139 this.multipleQuantityInput.value = 1; 12140 } 12141 }, { 12142 key: "showContainer", 12143 value: function(el) { 12144 el.setAttribute("aria-hidden", "false"), (0, _heifer.uAddClass)(el, "is-active"); 12145 } 12146 }, { 12147 key: "initReveal", 12148 value: function() { 12149 var _this8 = this; 12150 this.giftCatalogReveal = new _reveal.default(".js-gift-catalog-reveal", { 12151 type: "radio", 12152 activeClass: "is-active", 12153 visitedClass: "was-active" 12154 }), this.giftCatalogReveal.revealTriggers.forEach(function(reveal) { 12155 document.addEventListener("reveal/".concat(reveal.identity, "/show"), function() { 12156 document.dispatchEvent((0, _heifer.uCreateCustomEvent)("overlay/show", { 12157 identity: reveal.identity 12158 })), null === _this8.activeCard && (_this8.activeCard = reveal.elem.closest(".productCard"), 12159 _this8.activeCard.classList.add("is-overlaying")); 12160 }), document.addEventListener("overlay/".concat(reveal.identity, "/hide"), function() { 12161 reveal.hideSequence(), _this8.hideActiveCard(); 12162 }); 12163 }); 12164 } 12165 }, { 12166 key: "hideActiveCard", 12167 value: function() { 12168 var _this9 = this; 12169 this.giftCatalogReveal && this.giftCatalogReveal.revealTriggers.forEac
12169h(function(reveal) { 12170 reveal.group == _this9.backButton.dataset.revealGroup && (reveal.hideSequence(), 12171 document.dispatchEvent((0, _heifer.uCreateCustomEvent)("overlay/hide")), _this9.activeCard = null, 12172 Array.from(_this9.productCards).forEach(function(card) { 12173 return card.classList.remove("is-overlaying"); 12174 })); 12175 }); 12176 } 12177 } ]), GiftCatalogQuickAdd; 12178 }(); 12179 }, { 12180 "./core/ui/reveal.es6": 12, 12181 "./core/utilities/a11y": 14, 12182 "./core/utilities/checkout.utilities": 15, 12183 "./core/utilities/heifer.utilities": 19, 12184 "./pages/giftCatalogProduct/giftCatalogProductGallery/giftCatalogProductGallery": 46, 12185 "./shared/forms/submitButton/submitButton": 88, 12186 "./shared/minicart/minicart": 127, 12187 "core-js/modules/es6.array.from": 240, 12188 "core-js/modules/es6.array.iterator": 241, 12189 "core-js/modules/es6.function.name": 244, 12190 "core-js/modules/es6.object.keys": 250, 12191 "core-js/modules/es6.object.to-string": 252, 12192 "core-js/modules/es6.string.iterator": 265, 12193 "core-js/modules/es6.symbol": 268, 12194 "core-js/modules/es7.object.get-own-property-descriptors": 272, 12195 "core-js/modules/web.dom.iterable": 274 12196 } ], 12197 26: [ function(require, module, exports) { 12198 "use strict"; 12199 Object.defineProperty(exports, "__esModule", { 12200 value: !0 12201 }), exports.default = void 0, require("core-js/modules/es6.regexp.replace"), require("core-js/modules/es6.string.link"), 12202 require("../node_modules/bootstrap/js/src/util"), require("picturefill"); 12203 var _revealInit = _interopRequireDefault(require("./core/ui/reveal-init")), _hoverintent = _interopRequireDefault(require("hoverintent")), _icons = _interopRequireDefault(require("./core/ui/icons")), _gtmUtilities = require("./core/utilities/gtm.utilities.js"), _heiferUtilities = require("./core/utilities/heifer.utilities.js"), _animate = _interopRequireDefault(require("./core/ui/animate")), _rellax = _interopRequireDefault(require("./core/scroll/rellax")), _smoothScroll = _interopRequireDefault(require("./core/scroll/smoothScroll")), _carousel = _interopRequireDefault(require("./shared/legoBlocks/carou
12203sel/carousel")), _storyCarousel = _interopRequireDefault(require("./shared/legoBlocks/storyCarousel/storyCarousel")), _map = _interopRequireDefault(require("./shared/legoBlocks/map/map")), _largeCard = _interopRequireDefault(require("./shared/legoBlocks/largeCard/largeCard")), _video = _interopRequireDefault(require("./shared/legoBlocks/video/video")), _videoModal = _interopRequireDefault(require("./shared/legoBlocks/videoModal/videoModal")), _contactPreferences = _interopRequireDefault(require("./pages/account/contactPreferences/contactPreferences")), _imageModal = _interopRequireDefault(require("./shared/imageModal/imageModal")), _buttonInput = _interopRequireDefault(require("./shared/forms/buttonInput/buttonInput")), _buttonSelect = _interopRequireDefault(require("./shared/forms/buttonSelect/buttonSelect")), _inputFilled = _interopRequireDefault(require("./shared/forms/inputFilled/inputFilled")), _conditionalField = _interopRequireDefault(require("./shared/forms/conditionalField/conditionalField")), _inputSlider = _interopRequireDefault(require("./shared/forms/inputSlider/inputSlider")), _labelInline = _interopRequireDefault(require("./shared/forms/labelInline/labelInline")), _numberRocker = _interopRequireDefault(require("./shared/forms/numberRocker/numberRocker")), _customSelect = _interopRequireDefault(require("./shared/forms/customSelect/customSelect")), _giftMessage = _interopRequireDefault(require("./shared/forms/giftMessage/giftMessage")), _paymentFields = _interopRequireDefault(require("./shared/forms/paymentFields/paymentFields")), _accountActionForm = _interopRequireDefault(require("./shared/forms/accountActionForm/accountActionForm")), _checkoutLogin = _interopRequireDefault(require("./shared/forms/checkoutLogin/checkoutLogin")), _gauntlet = _interopRequireDefault(require("./core/forms/gauntlet.js")), _mainHeader = _interopRequireDefault(require("./shared/foundation/mainHeader/mainHeader")), _simpleHeader = _interopRequireDefault(require("./shared/foundation/simpleHeader/simpleHeader")), _donationCard = (_interopRequireDefault(require("./shared/foundation/liveChat/liveChat")), 12204 _interopRequireDefault(require("./shared/legoBlocks/donation/partials/donationCard/donationCard"))), _donationSubscription = _interopRequireDefault(require("./shared/legoBlocks/donationSubscription/donationSubscription")), _tabs = _interopRequireDefault(require("./shared/tabs/tabs")), _tabsForm = _interopRequireDefault(require("./shared/tabs/tabs-form")), _tabbedForms = _interopRequireDefault(require("./shared/forms/tabbedForms/tabbedForms")), _barChart = _interopRequireDefault(require("./shared/legoBlocks/barChart/barChart")), _animatedStat = _interopRequireDefault(require("./shared/legoBlocks/animatedStat/animatedStat")), _jumpNav = _interopRequireDefault(require("./shared/legoBlocks/jumpNav/jumpNav")), _suggestionsSlider = _interopRequireDefault(require("./shared/legoBlocks/suggestions/partials/suggestionsSlider/suggestionsSlider")), _searchBar = _interopRequireDefault(require("./shared/foundation/searchBar/searchBar")), _navSearchBar = _interopRequireDefault(require("./shared/foundation/navSearchBar/navSearchBar")), _newsletterSignup = _interopRequireDefault(require("./shared/newsletterSignup/newsletterSignup")), _thankYouNote = _interopRequireDefault(require("./shared/thankYouNote/thankYouNote")), _cardBlockSlider = _interopRequireDefault(require("./shared/legoBlocks/cardBlockSlider/cardBlockSlider")), _cardBlock = _interopRequireDefault(require("./shared/legoBlocks/cardBlock/cardBlock")), _switchStateField = _interopRequireDefault(require("./shared/forms/switchStateField/switchStateField")), _reasonForGiving = _interopRequireDefault(require("./shared/forms/reasonForGiving/reasonForGiving")), _datePicker = _interopRequireDefault(require("./shared/forms/datePicker/datePicker")), _downloadModal = _interopRequireDefault(require("./shared/downloadModal/downloadModal")), _stickyFooter = _interopRequireDefault(require("./shared/foundation/stickyFooter/stickyFooter")), _file = _interopRequireDefault(require("./shared/forms/file/file")), _c
12204aptureForm = _interopRequireDefault(require("./shared/captureForm/captureForm")), _emailSignup = _interopRequireDefault(require("./shared/emailSignup/emailSignup")), _contact = _interopRequireDefault(require("./shared/legoBlocks/contact/contact")), _subscriptionHeader = _interopRequireDefault(require("./shared/legoBlocks/subscription/subscriptionHeader/subscriptionHeader")), _heiferFoundation = _interopRequireDefault(require("./shared/heiferFoundation/heiferFoundation")), _KidsEducationCapture = _interopRequireDefault(require("./shared/KidsEducationCapture/KidsEducationCapture")), _radioReveal = _interopRequireDefault(require("./shared/forms/radioReveal/radioReveal")), _tangiblityText = _interopRequireDefault(require("./shared/legoBlocks/donation/partials/tangibilityText/tangiblityText")), _flipImageGrid = _interopRequireDefault(require("./shared/legoBlocks/flipImageGrid/flipImageGrid")), _doubleTheDonation = _interopRequireDefault(require("./shared/doubleTheDonation/doubleTheDonation")), _mapOurWork = _interopRequireDefault(require("./shared/legoBlocks/mapOurWork/mapOurWork")), _statsGallery = _interopRequireDefault(require("./shared/legoBlocks/statsGallery/statsGallery")), _videoHeader = _interopRequireDefault(require("./shared/legoBlocks/videoHeader/videoHeader")), _pageContent = _interopRequireDefault(require("./shared/foundation/pageContent/pageContent")), _heifer = _interopRequireDefault(require("./core/utilities/heifer.overlay")), _shorthandEmbed = _interopRequireDefault(require("./shared/legoBlocks/shorthandEmbed/shorthandEmbed")), _filterGrid = _interopRequireDefault(require("./shared/legoBlocks/filterGrid/filterGrid")), _upsellModal = _interopRequireDefault(require("./shared/upsellModal/upsellModal")), _alchemer = _interopRequireDefault(require("./shared/alchemer/alchemer")), _pages = _interopRequireDefault(require("./pages")), _giftCatalogQuickAdd = _interopRequireDefault(require("./giftCatalogQuickAdd")), _filterBar = _interopRequireDefault(require("./shared/filterBar/filterBar")), _filterBarMobile = _interopRequireDefault(require("./shared/filterBar/filterBarMobile")); 12205 function _interopRequireDefault(obj) { 12206 return obj && obj.__esModule ? obj : { 12207 default: obj 12208 }; 12209 } 12210 function _defineProperties(target, props) { 12211 for (var i = 0; i < props.length; i++) { 12212 var descriptor = props[i]; 12213 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 12214 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 12215 } 12216 } 12217 var app = new (function() { 12218 function App() { 12219 !function(instance, Constructor) { 12220 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 12221 }(this, App), this.initIcons(), this.initReveals(), this.initGtmListener(), this.initHoverintent(), 12222 this.initAnimate(), this.initRellaxInit(), this.initSmoothScroll(), this.initMainHeader(), 12223 this.initPageContent(), this.initSimpleHeader(), this.initButtonInput(), this.initButtonSelect(), 12224 this.initInputFilled(), this.initConditionalField(), this.initInputSlider(), this.initLabelInline(), 12225 this.initCustomSelect(), this.initNumberRocker(), this.initGiftMessage(), this.initPaymentFields(), 12226 this.initAccountActionForm(), this.initCheckoutLogin(), this.initGauntlet(), this.initCarousel(), 12227 this.initStoryCarousel(), this.initMap(), this.initLargeCards(), this.initVideoModal(), 12228 this.initPreferencesModal(), this.initImageModal(), this.initDonationCard(), this.initDonationSubscription(), 12229 this.initTabs(), this.initTabsForm(), this.initTabbedForms(), this.initFile(), this.initTangibility(), 12230 this.initFlipImageGrid(), this.initMapOurWork(), this.initShorthandEmbed(), this.initBarChart(), 12231 this.initAnimatedStat(), this.initJumpNav(), this.initSuggestionsSlider(), this.initSearchBar(), 12232 this.initNavSearchBar(), this.initFilterBar(), this.initNewsletterSignup(), this.initThankYouNote(),
12233 this.initCardBlockSlider(), this.initCardBlock(), this.initDownloadModal(), this.initCaptureForm(), 12234 this.initEmailSignupForm(), this.initKidsEducationCapture(), this.initSwitchStateField(), 12235 this.initReasonForGiving(), this.initDatePicker(), this.initStickyFooter(), this.initContact(), 12236 this.initHeiferFoundation(), this.initRadioReveal(), this.initUpsellModal(), this.initSubscriptionHeader(), 12237 this.initDoubleTheDonation(), this.initStatsGallery(), this.initVideoHeader(), this.initFilterGrid(), 12238 this.initAlchemer(), this.initPages(), this.initGoogleRecaptcha(), this.initQuickAdd(), 12239 this.initOverlay(); 12240 } 12241 return function(Constructor, protoProps, staticProps) { 12242 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 12243 }(App, [ { 12244 key: "initIcons", 12245 value: function() { 12246 (0, _icons.default)(); 12247 } 12248 }, { 12249 key: "initPages", 12250 value: function() { 12251 (0, _pages.default)(); 12252 } 12253 }, { 12254 key: "initQuickAdd", 12255 value: function() { 12256 (0, _giftCatalogQuickAdd.default)(); 12257 } 12258 }, { 12259 key: "initSmoothScroll", 12260 value: function() { 12261 new _smoothScroll.default(); 12262 } 12263 }, { 12264 key: "initReveals", 12265 value: function() { 12266 window.Heifer.core.reveal && (0, _revealInit.default)(); 12267 } 12268 }, { 12269 key: "initHoverintent", 12270 value: function() { 12271 window.Heifer.core.hoverintent && [].forEach.call(document.querySelectorAll(".js-hoverintent"), function(el) { 12272 (0, _hoverintent.default)(el, function() { 12273 el.classList.add("is-hovering"); 12274 }, function() { 12275 el.classList.remove("is-hovering"); 12276 }); 12277 }); 12278 } 12279 }, { 12280 key: "initAnimate", 12281 value: function() { 12282 window.Heifer.core.animate && [].forEach.call(document.querySelectorAll(".js-animate"), function(el) { 12283 new _animate.default(el); 12284 }); 12285 } 12286 }, { 12287 key: "initRellaxInit", 12288 value: function() { 12289 window.Heifer.core.rellax && new _rellax.default(); 12290 } 12291 }, { 12292 key: "initStatsGallery", 12293 value: function() { 12294 window.Heifer.shared.legoBlocks.statsGallery && [].forEach.call(document.querySelectorAll(".js-animated-statsGallery"), function(elem) { 12295 new _statsGallery.default(elem); 12296 }); 12297 } 12298 }, { 12299 key: "initVideoHeader", 12300 value: function() { 12301 window.Heifer.shared.legoBlocks.videoHeader && [].forEach.call(document.querySelectorAll(".js-video-header"), function(elem) { 12302 new _videoHeader.default(elem); 12303 }); 12304 } 12305 }, { 12306 key: "initCarousel", 12307 value: function() { 12308 window.Heifer.shared.legoBlocks.carousel && [].forEach.call(document.querySelectorAll(".js-carousel"), function(el) { 12309 return new _carousel.default(el, {}); 12310 }); 12311 } 12312 }, { 12313 key: "initStoryCarousel", 12314 value: function() { 12315 window.Heifer.shared.legoBlocks.storyCarousel && [].forEach.call(document.querySelectorAll(".js-story-carousel"), function(el) { 12316 return new _storyCarousel.default(el, {}); 12317 }); 12318 } 12319 }, { 12320 key: "initMap", 12321 value: function() { 12322 window.Heifer.shared.legoBlocks.mapBlock && [].forEach.call(document.querySelectorAll(".js-map"), function(el) { 12323 return new _map.default(el, {}); 12324 }); 12325 } 12326 }, { 12327 key: "initLargeCards", 12328 value: function() { 12329 window.Heifer.shared.legoBlocks.largeCards && [].forEach.call(document.querySelectorAll(".js-large-card"), function(el) { 12330 return new _largeCard.default(el, {}); 12331 }); 12332 } 12333 }, { 12334 key: "initVideo", 12335 value: function() { 12336 window.Heifer.shared.legoBlocks.video && [].forEach.call(document.querySelectorAll(".js-video"), function(el) { 12337 return new _video.default(el, {}); 12338 }); 12339 } 12340 }, { 12341 key: "initVideoModal", 12342 value: function() { 12343 window.Heifer.shared.legoBlocks.videoModal && [].forEach.call(document.querySelectorAll(".js-video__modal"), function(el) { 12344 return new _videoModal.default(el, {}); 12345 }); 12346 } 12347 }, { 12348 key: "initPreferencesModal", 12349 value: function() { 12350 window.Heifer.shared.mailModal && [].forEach.call(document.querySelectorAll(".js-contact-preferences-modal"), function(el) { 12351 return new _contactPreferences.default(el, {}); 12352 }); 12353 } 12354 }, { 12355 key: "initImageModal", 12356 value: function() { 12357 window.Heifer.shared.imageModal && [].forEach.call(document.querySelectorAll(".js-image-modal"), function(el) { 12358 return new _imageModal.default(el, {}); 12359 }); 12360 } 12361 }, { 12362 key: "initButtonInput", 12363 value: function() { 12364 window.Heifer.shared.legoBlocks.forms.buttonInput && [].forEach.call(document.querySelectorAll(".js-button-input"), function(button) { 12365 new _buttonInput.default(button); 12366 }); 12367 } 12368 }, { 12369 key: "initButtonSelect", 12370 value: function() { 12371 window.Heifer.shared.legoBlocks.forms.buttonSelect && [].forEach.call(document.querySelectorAll(".js-button-select"), function(button) { 12372 new _buttonSelect.default(button); 12373 }); 12374 } 12375 }, { 12376 key: "initInputFilled", 12377 value: function() { 12378 window.Heifer.shared.legoBlocks.forms.label && [].forEach.call(document.querySelectorAll(".js-input-filled"), function(field) { 12379 new _inputFilled.default(field); 12380 }); 12381 } 12382 }, { 12383 key: "initConditionalField", 12384 value: function() { 12385 window.Heifer.shared.legoBlocks.forms.conditional && [].forEach.call(document.querySelectorAll(".js-conditional-field"), function(field) { 12386 new _conditionalField.default(field); 12387 }); 12388 } 12389 }, { 12390 key: "initInputSlider", 12391 value: function() { 12392 window.Heifer.shared.legoBlocks.forms.inputSlider && [].forEach.call(document.querySelectorAll(".js-input-slider"), function(slider) { 12393 new _inputSlider.default(slider); 12394 }); 12395 } 12396 }, { 12397 key: "initLabelInline", 12398 value: function() { 12399 window.Heifer.shared.legoBlocks.forms.label && [].forEach.call(document.querySelectorAll(".js-label-inline"), function(labelInline) { 12400 new _labelInline.default(labelInline); 12401 }); 12402 } 12403 }, { 12404 key: "initCustomSelect", 12405 value: function() { 12406 window.Heifer.shared.legoBlocks.forms.customSelect && [].forEach.call(document.querySelectorAll(".js-custom-select"), function(field) { 12407 new _customSelect.default(field); 12408 }); 12409 } 12410 }, { 12411 key: "initNumberRocker", 12412 value: function() { 12413 window.Heifer.shared.legoBlocks.forms.numberRocker && [].forEach.call(document.querySelectorAll(".js-number-rocker"), function(label) { 12414 new _numberRocker.default(label); 12415 }); 12416 } 12417 }, { 12418 key: "initPaymentFields", 12419 value: function() { 12420 window.Heifer.shared.forms.paymentFields && [].forEach.call(document.querySelectorAll(".js-payment-fields"), function(form) { 12421 new _paymentFields.default(form, !1, !1); 12422 }); 12423 } 12424 }, { 12425 key: "initAccountActionForm", 12426 value: function() { 12427 window.Heifer.shared.forms.accountActionForm && [].forEach.call(document.querySelectorAll(".js-account-action-form"), function(form) { 12428 new _accountActionForm.default(form, { 12429 actionType: window.Heifer.shared.forms.accountActionForm 12430 }); 12431 }); 12432 } 12433 }, { 12434 key: "initCheckoutLogin", 12435 value: function() { 12436 window.Heifer.shared.forms.checkoutLogin && [].forEach.call(document.querySelectorAll(".js-checkout-login"), function(login) { 12437 new _checkoutLogin.default(login); 12438 }); 12439 } 12440 }, { 12441 key: "initGiftMessage", 12442 value: function() { 12443 window.Heifer.shared.legoBlocks.forms.giftMessage && [].forEach.call(document.querySelectorAll(".js-gift-message"), function(field) { 12444 new _giftMessage.default(field); 12445 }); 12446 } 12447 }, { 12448 key: "initGauntlet", 12449 value: function() { 12450 window.Heifer.shared.legoBlocks.forms.gauntlet && [].forEach.call(document.querySelectorAll(".js-gauntlet"), function(form) { 12451 new _gauntlet.default(form); 12452 }); 12453 } 12454 }, { 12455 key: "initMainHeader", 12456 value: function() { 12457 window.Heifer.shared.foundation.mainHeader && [].forEach.call(document.querySelectorAll(".js-mainHeader"), function(elem) { 12458 new _mainHeader.default(elem); 12459 }); 12460 } 12461 }, { 12462 key: "initPageContent", 12463 value: function() { 12464 window.Heifer.shared.foundation.pageContent && [].forEach.call(document.querySelectorAll(".js-pageContent"), function(elem) { 12465 new _pageContent.default(elem); 12466 }); 12467 } 12468 }, { 12469 key: "initOverlay", 12470 value: function() { 12471 window.Heifer.shared.overlay && new _heifer.default(); 12472 } 12473 }, { 12474 key: "initSimpleHeader", 12475 value: function() { 12476 window.Heifer.shared.foundation.simpleHeader && [].forEach.call(document.querySelectorAll(".js-simpleHeader"), function(elem) { 12477 new _simpleHeader.default(elem); 12478 }); 12479 } 12480 }, { 12481 key: "initDonationCard", 12482 value: function() { 12483 window.Heifer.shared.legoBlocks.donationCard && [].forEach.call(document.querySelectorAll(".js-donationCard"), function(elem) { 12484 new _donationCard.default(elem); 12485 }); 12486 } 12487 }, { 12488 key: "initDonationSubscription", 12489 value: function() { 12490 window.Heifer.shared.legoBlocks.donationSubscription && [].forEach.call(document.querySelectorAll(".js-donationSubscription"), function(elem) { 12491 new _donationSubscription.default(elem); 12492 }); 12493 } 12494 }, { 12495 key: "initTabs", 12496 value: function() { 12497 window.Heifer.shared.tabs && [].forEach.call(document.querySelectorAll(".js-tabs"), function(tabs) { 12498 new _tabs.default(tabs); 12499 }); 12500 } 12501 }, { 12502 key: "initTabsForm", 12503 value: function() { 12504 window.Heifer.shared.tabsForm && [].forEach.call(document.querySelectorAll(".js-tabs-form"), function(tabs) { 12505 new _tabsForm.default(tabs); 12506 }); 12507 } 12508 }, { 12509 key: "initTabbedForms", 12510 value: function() { 12511 window.Heifer.shared.tabbedForms && [].forEach.call(document.querySelectorAll(".js-tabbed-forms"), function(tabbedForm) { 12512 new _tabbedForms.default(tabbedForm); 12513 }); 12514 } 12515 }, { 12516 key: "initBarChart", 12517 value: function() { 12518 window.Heifer.shared.legoBlocks.barChart && [].forEach.call(document.querySelectorAll(".js-bar-chart"), function(elem) { 12519 new _barChart.default(elem); 12520 }); 12521 } 12522 }, { 12523 key: "initAnimatedStat", 12524 value: function() { 12525 window.Heifer.shared.legoBlocks.animatedStat && [].forEach.call(document.querySelectorAll(".js-animated-stat"), function(elem) { 12526 new _animatedStat.default(elem); 12527 }); 12528 } 12529 }, { 12530 key: "initJumpNav", 12531 value: function() { 12532 window.Heifer.shared.legoBlocks.jumpNav && (0, _jumpNav.default)(document.querySelector(".js-jump-nav-init")); 12533 } 12534 }, { 12535 key: "initSuggestionsSlider", 12536 value: function() { 12537 window.Heifer.shared.legoBlocks.suggestionsSlider && [].forEach.call(document.querySelectorAll(".js-suggestions-slider"), function(elem) { 12538 new _suggestionsSlider.default(elem); 12539 }); 12540 } 12541 }, { 12542 key: "initSearchBar", 12543 value: function() { 12544 window.Heifer.shared.foundation.searchBar && new _searchBar.default(); 12545 } 12546 }, { 12547 key: "initNavSearchBar", 12548 value: function() { 12549 window.Heifer.shared.foundation.navSearchBar && new _navSearchBar.default("global-nav"), 12550 window.Heifer.shared.foundation.gcSearchBar && new _navSearchBar.default("gc-search"); 12551 } 12552 }, { 12553 key: "initFilterBar", 12554 value: function() { 12555 window.Heifer.shared.filterBar && new _filterBar.default(document.querySelector(".js-filter-bar")), 12556 window.Heifer.shared.filterBarMobile && (0, _filterBarMobile.default)(document.querySelector(".js-filter-bar-mobile")); 12557 } 12558 }, { 12559 key: "initNewsletterSignup", 12560 value: function() { 12561 window.Heifer.shared.newsletterSignup && [].forEach.call(document.querySelectorAll(".js-newsletter"), function(elem) { 12562 new _newsletterSignup.default(elem); 12563 }); 12564 } 12565 }, { 12566 key: "initCaptureForm", 12567 value: function() { 12568 window.Heifer.shared.captureForm && [].forEach.call(document.querySelectorAll(".js-capture-form"), function(elem)
12568 { 12569 new _captureForm.default(elem); 12570 }); 12571 } 12572 }, { 12573 key: "initEmailSignupForm", 12574 value: function() { 12575 window.Heifer.shared.emailSignupForm && [].forEach.call(document.querySelectorAll(".js-emailsignup-form"), function(elem) { 12576 new _emailSignup.default(elem); 12577 }); 12578 } 12579 }, { 12580 key: "initKidsEducationCapture", 12581 value: function() { 12582 window.Heifer.shared.KidsEducationCapture && [].forEach.call(document.querySelectorAll(".js-kidsnewsletter"), function(elem) { 12583 new _KidsEducationCapture.default(elem); 12584 }); 12585 } 12586 }, { 12587 key: "initThankYouNote", 12588 value: function() { 12589 window.Heifer.shared.thankYouNote && [].forEach.call(document.querySelectorAll(".js-thankyou"), function(elem) { 12590 new _thankYouNote.default(elem); 12591 }); 12592 } 12593 }, { 12594 key: "initDownloadModal", 12595 value: function() { 12596 window.Heifer.shared.downloadModal && [].forEach.call(document.querySelectorAll(".js-download-modal-file"), function(elem) { 12597 new _downloadModal.default(elem); 12598 }); 12599 } 12600 }, { 12601 key: "initCardBlockSlider", 12602 value: function() { 12603 if (window.Heifer.shared.legoBlocks.cardBlockSlider) new _cardBlockSlider.default(document.querySelector(".js-card-slider"), {}); 12604 } 12605 }, { 12606 key: "initCardBlock", 12607 value: function() { 12608 window.Heifer.shared.legoBlocks.cardBlock && [].forEach.call(document.querySelectorAll(".js-card-block"), function(el) { 12609 new _cardBlock.default(el); 12610 }); 12611 } 12612 }, { 12613 key: "initSwitchStateField", 12614 value: function() { 12615 window.Heifer.shared.forms.switchStateFields && [].forEach.call(document.querySelectorAll(".js-switch-state-fields"), function(el) { 12616 new _switchStateField.default(el); 12617 }); 12618 } 12619 }, { 12620 key: "initGtmListener", 12621 value: function() { 12622 var impressions = []; 12623 [].forEach.call(document.querySelectorAll(".js-gtm-push-impression"), function(el) { 12624 var gtmData = JSON.parse(el.value); 12625 impressions.push(gtmData); 12626 }), (0, _gtmUtilities.pushDataLayerEvent)("view_item_list", impressions), document.querySelector(".js-gtm-push-item-view") && setTimeout(function() { 12627 var item = (0, _gtmUtilities.captureVisibleProduct)(); 12628 (0, _gtmUtilities.pushDataLayerEvent)("view_item", item); 12629 }, 1e3); 12630 var details = []; 12631 [].forEach.call(document.querySelectorAll(".js-gtm-push-product-details"), function(el) { 12632 var gtmData = JSON.parse(el.value); 12633 details.push(gtmData); 12634 }), (0, _gtmUtilities.pushProductDetails)(details); 12635 var confirmation = []; 12636 [].forEach.call(document.querySelectorAll(".js-gtm-push-confirmation"), function(el) { 12637 var gtmData = JSON.parse(el.value); 12638 confirmation.push(gtmData), (0, _gtmUtilities.pushConfirmation)(confirmation); 12639 }), [].forEach.call(document.querySelectorAll(".js-gtm-push-product-link"), function(el) { 12640 el.addEventListener("click", function() { 12641 var gtmData = JSON.parse(el.dataset.link); 12642 (0, _gtmUtilities.pushDataLayerEvent)("select_item", [ gtmData ]); 12643 }); 12644 }); 12645 var steps = []; 12646 [].forEach.call(document.querySelectorAll(".js-gtm-push-step-link"), function(el) { 12647 var gtmData = JSON.parse(el.value); 12648 steps.push(gtmData); 12649 }), (0, _gtmUtilities.pushSteps)(steps); 12650 } 12651 }, { 12652 key: "initReasonForGiving", 12653 value: function() { 12654 window.Heifer.shared.forms.reasonForGiving && [].forEach.call(document.querySelectorAll(".reasonForGiving"), function(el) { 12655 new _reasonForGiving.default(el); 12656 }); 12657 } 12658 }, { 12659 key: "initDatePicker", 12660 value: function() { 12661 window.Heifer.shared.forms.datePicker && [].forEach.call(document.querySelectorAll(".datePicker"), function(el) { 12662 new _datePicker.default(el); 12663 }); 12664 } 12665 }, { 12666 key: "initGoogleRecaptcha", 12667 value: function() {
12668 (0, _heiferUtilities.uLoadJSPromise)("https://google.com/recaptcha/api.js?render=" + window.Heifer.grecaptchaSiteKey, { 12669 "data-ot-ignore": "" 12670 }).then(function() { 12671 grecaptcha.ready(function() { 12672 var action = window.location.pathname.replace(/[^A-Za-z]/g, "").replace("html", ""); 12673 grecaptcha.execute(window.Heifer.grecaptchaSiteKey, { 12674 action: action 12675 }).then(function(token) { 12676 (0, _heiferUtilities.uAjaxWithResponse)("GET", "/api/recaptcha.html?token=" + token, !0); 12677 }); 12678 }); 12679 }); 12680 } 12681 }, { 12682 key: "initStickyFooter", 12683 value: function() { 12684 window.Heifer.shared.stickyFooter && new _stickyFooter.default(document.querySelector(".js-sticky-footer")); 12685 } 12686 }, { 12687 key: "initFile", 12688 value: function() { 12689 window.Heifer.shared.forms.file && [].forEach.call(document.querySelectorAll(".file__input"), function(el) { 12690 new _file.default(el); 12691 }); 12692 } 12693 }, { 12694 key: "initContact", 12695 value: function() { 12696 window.Heifer.shared.contact && [].forEach.call(document.querySelectorAll(".contact__section"), function(el) { 12697 new _contact.default(el); 12698 }); 12699 } 12700 }, { 12701 key: "initShorthandEmbed", 12702 value: function() { 12703 window.Heifer.shared.legoBlocks.shorthandEmbed && (0, _shorthandEmbed.default)(); 12704 } 12705 }, { 12706 key: "initSubscriptionHeader", 12707 value: function() { 12708 window.Heifer.shared.subscriptionHeader && [].forEach.call(document.querySelectorAll(".js-subscription-header"), function(el) { 12709 new _subscriptionHeader.default(el); 12710 }); 12711 } 12712 }, { 12713 key: "initHeiferFoundation", 12714 value: function() { 12715 window.Heifer.shared.heiferFoundation && new _heiferFoundation.default(""); 12716 } 12717 }, { 12718 key: "initRadioReveal", 12719 value: function() { 12720 window.Heifer.shared.forms.radioReveal && [].forEach.call(document.querySelectorAll(".js-radio-reveal"), function(el) { 12721 new _radioReveal.default(el); 12722 }); 12723 } 12724 }, { 12725 key: "initTangibility", 12726 value: function() { 12727 if (window.Heifer.shared.legoBlocks.donationCard) { 12728 var el = document.querySelector(".donationCard"); 12729 el && new _tangiblityText.default(el); 12730 } 12731 } 12732 }, { 12733 key: "initFlipImageGrid", 12734 value: function() { 12735 window.Heifer.shared.legoBlocks.flipImageGrid && [].forEach.call(document.querySelectorAll(".js-flip-image-grid"), function(el) { 12736 new _flipImageGrid.default(el); 12737 }); 12738 } 12739 }, { 12740 key: "initDoubleTheDonation", 12741 value: function() { 12742 if (!!document.querySelector(".js-double-the-donation")) { 12743 var el = document.querySelector(".js-double-the-donation"); 12744 new _doubleTheDonation.default(el); 12745 } 12746 } 12747 }, { 12748 key: "initUpsellModal", 12749 value: function() { 12750 window.Heifer.shared.upsellModal && [].forEach.call(document.querySelectorAll(".js-upsellModal"), function(elem) { 12751 new _upsellModal.default(elem); 12752 }); 12753 } 12754 }, { 12755 key: "initMapOurWork", 12756 value: function() { 12757 window.Heifer.shared.legoBlocks.mapOurWork && [].forEach.call(document.querySelectorAll(".js-map-our-work"), function(el) { 12758 new _mapOurWork.default(el); 12759 }); 12760 } 12761 }, { 12762 key: "initFilterGrid", 12763 value: function() { 12764 window.Heifer.shared.legoBlocks.filterGrid && [].forEach.call(document.querySelectorAll(".js-filter-grid"), function(el) { 12765 new _filterGrid.default(el); 12766 }); 12767 } 12768 }, { 12769 key: "initAlchemer", 12770 value: function() { 12771 new _alchemer.default(); 12772 } 12773 } ]), App; 12774 }())(); 12775 window.Heifer = window.Heifer || {}; 12776 var _default = window.Heifer.app = app; 12777 exports.default = _default; 12778 }, {
12779 "../node_modules/bootstrap/js/src/util": 133, 12780 "./core/forms/gauntlet.js": 1, 12781 "./core/scroll/rellax": 4, 12782 "./core/scroll/smoothScroll": 5, 12783 "./core/ui/animate": 6, 12784 "./core/ui/icons": 8, 12785 "./core/ui/reveal-init": 10, 12786 "./core/utilities/gtm.utilities.js": 16, 12787 "./core/utilities/heifer.overlay": 18, 12788 "./core/utilities/heifer.utilities.js": 19, 12789 "./giftCatalogQuickAdd": 25, 12790 "./pages": 52, 12791 "./pages/account/contactPreferences/contactPreferences": 32, 12792 "./shared/KidsEducationCapture/KidsEducationCapture": 62, 12793 "./shared/alchemer/alchemer": 63, 12794 "./shared/captureForm/captureForm": 65, 12795 "./shared/doubleTheDonation/doubleTheDonation": 66, 12796 "./shared/downloadModal/downloadModal": 67, 12797 "./shared/emailSignup/emailSignup": 68, 12798 "./shared/filterBar/filterBar": 69, 12799 "./shared/filterBar/filterBarMobile": 70, 12800 "./shared/forms/accountActionForm/accountActionForm": 71, 12801 "./shared/forms/buttonInput/buttonInput": 73, 12802 "./shared/forms/buttonSelect/buttonSelect": 74, 12803 "./shared/forms/checkoutLogin/checkoutLogin": 75, 12804 "./shared/forms/conditionalField/conditionalField": 76, 12805 "./shared/forms/customSelect/customSelect": 77, 12806 "./shared/forms/datePicker/datePicker": 78, 12807 "./shared/forms/file/file": 79, 12808 "./shared/forms/giftMessage/giftMessage": 80, 12809 "./shared/forms/inputFilled/inputFilled": 81, 12810 "./shared/forms/inputSlider/inputSlider": 82, 12811 "./shared/forms/labelInline/labelInline": 83, 12812 "./shared/forms/numberRocker/numberRocker": 84, 12813 "./shared/forms/paymentFields/paymentFields": 85, 12814 "./shared/forms/radioReveal/radioReveal": 86, 12815 "./shared/forms/reasonForGiving/reasonForGiving": 87, 12816 "./shared/forms/switchStateField/switchStateField": 89, 12817 "./shared/forms/tabbedForms/tabbedForms": 90, 12818 "./shared/foundation/liveChat/liveChat": 91, 12819 "./shared/foundation/mainHeader/mainHeader": 93, 12820 "./shared/foundation/navSearchBar/navSearchBar": 96, 12821 "./shared/foundation/pageContent/pageContent": 97, 12822 "./shared/foundation/searchBar/searchBar": 98, 12823 "./shared/foundation/simpleHeader/simpleHeader": 99, 12824 "./shared/foundation/stickyFooter/stickyFooter": 100, 12825 "./shared/heiferFoundation/heiferFoundation": 101, 12826 "./shared/imageModal/imageModal": 102, 12827 "./shared/legoBlocks/animatedStat/animatedStat": 103, 12828 "./shared/legoBlocks/barChart/barChart": 104, 12829 "./shared/legoBlocks/cardBlock/cardBlock": 105, 12830 "./shared/legoBlocks/cardBlockSlider/cardBlockSlider": 106,
12831 "./shared/legoBlocks/carousel/carousel": 107, 12832 "./shared/legoBlocks/contact/contact": 108, 12833 "./shared/legoBlocks/donation/partials/donationCard/donationCard": 109, 12834 "./shared/legoBlocks/donation/partials/tangibilityText/tangiblityText": 110, 12835 "./shared/legoBlocks/donationSubscription/donationSubscription": 111, 12836 "./shared/legoBlocks/filterGrid/filterGrid": 112, 12837 "./shared/legoBlocks/flipImageGrid/flipImageGrid": 113, 12838 "./shared/legoBlocks/jumpNav/jumpNav": 114, 12839 "./shared/legoBlocks/largeCard/largeCard": 115, 12840 "./shared/legoBlocks/map/map": 116, 12841 "./shared/legoBlocks/mapOurWork/mapOurWork": 117, 12842 "./shared/legoBlocks/shorthandEmbed/shorthandEmbed": 118, 12843 "./shared/legoBlocks/statsGallery/statsGallery": 119, 12844 "./shared/legoBlocks/storyCarousel/storyCarousel": 120, 12845 "./shared/legoBlocks/subscription/subscriptionHeader/subscriptionHeader": 121, 12846 "./shared/legoBlocks/suggestions/partials/suggestionsSlider/suggestionsSlider": 122, 12847 "./shared/legoBlocks/video/video": 123, 12848 "./shared/legoBlocks/videoHeader/videoHeader": 124, 12849 "./shared/legoBlocks/videoModal/videoModal": 125, 12850 "./shared/newsletterSignup/newsletterSignup": 128, 12851 "./shared/tabs/tabs": 130, 12852 "./shared/tabs/tabs-form": 129, 12853 "./shared/thankYouNote/thankYouNote": 131, 12854 "./shared/upsellModal/upsellModal": 132, 12855 "core-js/modules/es6.regexp.replace": 259, 12856 "core-js/modules/es6.string.link": 266, 12857 hoverintent: 281, 12858 picturefill: 23 12859 } ], 12860 27: [ function(require, module, exports) { 12861 "use strict"; 12862 Object.defineProperty(exports, "__esModule", { 12863 value: !0 12864 }), exports.default = function() { 12865 window.Heifer.pages.accountMonthly && ([].forEach.call(document.querySelectorAll(".js-account-monthly"), function(el) { 12866 new _accountMonthly.default(el, {}); 12867 }), [].forEach.call(document.querySelectorAll(".js-account-monthly-modal"), function(el) { 12868 new _accountMonthlyModal.default(el, {}); 12869 }), [].forEach.call(document.querySelectorAll(".js-account-monthly-past"), function(el) { 12870 new _accountMonthlyPast.default(el, {}); 12871 })); 12872 }; 12873 var _accountMonthly = _interopRequireDefault(require("./accountMonthly/accountMonthly")), _accountMonthlyModal = _interopRequireDefault(require("./accountMonthlyModal/accountMonthlyModal")), _accountMonthlyPast = _interopRequireDefault(require("./accountMonthlyPast/accountMonthlyPast")); 12874 function _interopRequireDefault(obj) { 12875 return obj && obj.__esModule ? obj : { 12876 default: obj 12877 }; 12878 } 12879 }, { 12880 "./accountMonthly/accountMonthly": 28, 12881 "./accountMonthlyModal/accountMonthlyModal": 30, 12882 "./accountMonthlyPast/accountMonthlyPast": 31 12883 } ], 12884 28: [ function(require, module, exports) { 12885 "use strict"; 12886 Object.defineProperty(exports, "__esModule", { 12887 value: !0 12888 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 12889 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 12890 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.keys"), 12891 require("core-js/modules/es6.promise"), require("core-js/modules/es6.object.to-string"), 12892 require("core-js/modules/es6.regexp.replace"); 12893 var _heifer = require("../../../core/utilities/heifer.utilities"), _checkout = require("../../../core/utilities/checkout.utilities"), _paymentFields = (_interopRequireDefault(require("formdata-polyfill")), 12894 _interopRequireDefault(require("../../../shared/forms/paymentFields/paymentFields"))), _submitButton = _interopRequireDefault(require("../../../shared/forms/submitButton/submitButton")), _accountMonthlyInputSliders = _interopRequireDefault(require("./accountMonthlyInputSliders")); 12895 function _interopRequireDefault(obj) { 12896 return obj && obj.__esModule ? obj : { 12897 default: obj 12898 }; 12899 } 12900 function ownKeys(object, enumerableOnly) { 12901 var keys = Object.keys(object); 12902 if (Object.getOwnPropertySymbols) { 12903 var symbols = Object.getOwnPropertySymbols(object); 12904 enumerableOnly && (symbols = symbols.filter(function(sym) { 12905 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 12906 })), keys.push.apply(keys, symbols); 12907 } 12908 return keys; 12909 } 12910 function _defineProperty(obj, key, value) { 12911 return key in obj ? Object.defineProperty(obj, key, { 12912 value: value, 12913 enumerable: !0, 12914 configurable: !0, 12915 writable: !0 12916 }) : obj[key] = value, obj; 12917 } 12918 function _defineProperties(target, props) { 12919 for (var i = 0; i < props.length; i++) { 12920 var descriptor = props[i]; 12921 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 12922 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 12923 } 12924 } 12925 var AccountMonthly = function() { 12926 function AccountMonthly(element, options) { 12927 !function(instance, Constructor) { 12928 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 12929 }(this, AccountMonthly), this.element = element, this.$element = $(this.element), 12930 this.defaults = { 12931 api: { 12932 cancel: "/api/subscription/cancel.html", 12933 amount: "/api/subscription/changeAmount.html", 12934 paymentMethod: "/api/subscription/changePaymentMethod.html", 12935 paymentDate: "/api/subscription/changePaymentDate.html", 12936 pause: "/api/subscription/pause.html" 12937 }, 12938 data: { 12939 userId: document.querySelector('input[name="LRUID"]') ? document.querySelector('input[name="LRUID"]').value : null,
12940 subscriptionPlanId: this.element.id 12941 }, 12942 messageCookieBase: "account_message_" 12943 }, this.settings = function(target) { 12944 for (var i = 1; i < arguments.length; i++) { 12945 var source = null != arguments[i] ? arguments[i] : {}; 12946 i % 2 ? ownKeys(source, !0).forEach(function(key) { 12947 _defineProperty(target, key, source[key]); 12948 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 12949 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 12950 }); 12951 } 12952 return target; 12953 }({}, this.defaults, {}, options), this.settings.messageCookie = this.settings.messageCookieBase + this.settings.data.subscriptionPlanId, 12954 this.init(); 12955 } 12956 return function(Constructor, protoProps, staticProps) { 12957 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 12958 }(AccountMonthly, [ { 12959 key: "init", 12960 value: function() { 12961 var _this = this; 12962 this.today = new Date(), this.inputSliders = this.element.querySelectorAll(".js-account-monthly-input-sliders"), 12963 this.editForms = this.element.querySelectorAll(".js-account-monthly-edit"), this.pauseSlider = this.element.querySelector(".js-account-monthly-input-sliders"), 12964 this.paymentFields = new _paymentFields.default(this.element.querySelector('.js-account-monthly-edit[data-type="paymentMethod"]'), !1, this.onAltPayError.bind(this), this.element.querySelector(".js-alt-pay-loading"), !0, !1, !0, !1, !1), 12965 this.stopButton = document.querySelector('.js-account-monthly-stop[data-sub-id="' + this.element.id + '"]'), 12966 this.messages = { 12967 amount: this.element.querySelector(".js-account-monthly-message-amount"), 12968 paymentMethod: this.element.querySelector(".js-account-monthly-message-method"), 12969 paymentDate: this.element.querySelector(".js-account-monthly-message-date"), 12970 pause: this.element.querySelector(".js-account-monthly-message-pause") 12971 }, this.newDateSelect = this.element.querySelector(".js-new-date-select"), this.newDateMessages = this.element.querySelector(".js-new-date-messages"), 12972 this.newDateMessageSpan = this.element.querySelector(".js-new-date-messageSpan"), 12973 this.newDateSelect.addEventListener("change", function(ev) { 12974 var val = ev.target.value; 12975 _this.settings.data.nextBill = ev.target.options[ev.target.selectedIndex].dataset.nextBill, 12976 "" != val && ((0, _heifer.uHasClass)(_this.newDateMessages, "is-revealed") || (0, 12977 _heifer.uAddClass)(_this.newDateMessages, "is-revealed"), _this.newDateMessageSpan.textContent = _this.settings.data.nextBill + " " + val + (0, 12978 _heifer.uGetOrdinalSuffix)(val)); 12979 }), this.loadingButtons = { 12980 cancel: new _submitButton.default(this.stopButton, { 12981 trigger: "click" 12982 }) 12983 }, this.initInputSliders(), this.initFormListeners(), this.initCancelListener(), 12984 this.initAltPaymentResponseListeners(), this.displayMessage(); 12985 } 12986 }, { 12987 key: "initInputSliders", 12988 value: function() { 12989 [].forEach.call(this.inputSliders, function(input) { 12990 new _accountMonthlyInputSliders.default(input, {}); 12991 }); 12992 } 12993 }, { 12994 key: "initAltPaymentResponseListeners", 12995 value: function() { 12996 var _this2 = this; 12997 window.addEventListener("paymentFields/googlePayResponse-" + this.settings.data.subscriptionPlanId, function(ev) { 12998 var response = ev.detail, data = _this2.settings.data; 12999 data.nonce = response.result.nonce, data.billingAddress = { 13000 email: response.paymentData.email 13001 }, data.paymentDetails = { 13002 cardType: response.result.details.cardType, 13003 lastFour: response.result.details.lastFour 13004 }, _this2.handleAjax(_this2.settings.api.paymentMethod, data, []).then(function(response) { 13005 _this2.setMessageCookie("paymentMethod", "success", "Success! Your payment method has changed to your " + response.body.subscription.paymentMethod.type + " ending in " + response.body.subscription.paymentMethod.last4 + " via Google Pay."); 13006 }).catch(function(err) { 13007 _this2.setMessageCookie("paymentMethod"); 13008 }); 13009 }), window.addEventListener("paymentFields/applePayResponse-" + this.settings.data.subscriptionPlanId, function(ev) { 13010 var response = ev.detail, data = _this2.settings.data; 13011 data.nonce = response.nonce, data.billingAddress = { 13012 email: response.paymentData.shippingContact.emailAddress 13013 }, data.paymentDetails = { 13014 cardType: response.paymentData.token.paymentMethod.network, 13015 lastFour: response.paymentData.token.paymentMethod.displayName 13016 }, _this2.handleAjax(_this2.settings.api.paymentMethod, data, []).then(function(response) { 13017 _this2.setMessageCookie("paymentMethod", "success", "Success! Your payment method has changed to your " + response.body.subscription.paymentMethod.type.replace("Apple Pay - ", "") + " ending in " + response.body.subscription.paymentMethod.last4 + " via Apple Pay."); 13018 }).catch(function(err) { 13019 _this2.setMessageCookie("paymentMethod"); 13020 }); 13021 }); 13022 } 13023 }, { 13024 key: "initFormListeners", 13025 value: function() { 13026 var _this3 = this; 13027 [].forEach.call(this.editForms, function(form) { 13028 var type = form.dataset.type, path = _this3.settings.api[type], data = _this3.settings.data, submits = [ form.querySelector(".js-edit-button-submit"), document.querySelector('button[form="' + form.id + '"]') ], loadingButtons = []; 13029 submits.map(function(button) { 13030 button && loadingButtons.push(new _submitButton.default(button)); 13031 }), form.addEventListener("submit", function(ev) { 13032 var formData = new window.FormData(form); 13033 switch (type) { 13034 case "amount": 13035 data.amount = formData.get("account-monthly-donation-amount"), _this3.handleAjax(path, data, loadingButtons).then(function(response) { 13036 _this3.setMessageCookie("amount", "success", "Success! Your monthly donation amount has changed to $" + data.amount + "."); 13037 }).catch(function(err) { 13038 _this3.setMessageCookie("amount"); 13039 }); 13040 break; 13041 13042 case "paymentMethod": 13043 _this3.paymentFields.tokenize().then(function(payload) { 13044 data.billingAddress = payload.details && void 0 !== payload.details.billingAddress ? (0, 13045 _checkout.getBillingAddressFromPayload)(payload) : (0, _checkout.getBillingAddressFromData)(formData), 13046 data.nonce = payload.nonce, data.paymentMethodToken = payload.token, data.paymentDetails = payload.details; 13047 }).then(function() { 13048 _this3.handleAjax(path, data, loadingButtons).then(function(response) { 13049 _this3.setMessageCookie("paymentMethod", "success", "Success! Your payment method has changed to your " + response.body.subscription.paymentMethod.type + " ending in " + response.body.subscription.paymentMethod.last4 + "."); 13050 }).catch(function(err) { 13051 _this3.setMessageCookie("paymentMethod"); 13052 }); 13053 }); 13054 break; 13055 13056 case "paymentDate": 13057 data.paymentDate = formData.get("account-monthly-donation-date"), data.nextBill = (0, 13058 _heifer.uGetMonthName)(_this3.today.getMonth()), data.paymentDate < _this3.today.getDate() && (data.nextBill = (0, 13059 _heifer.uGetMonthName)(_this3.today.getMonth() + 1)), _this3.handleAjax(path, data, loadingButtons).then(function(response) { 13060 _this3.setMessageCookie("paymentDate", "success", "Success! Your next payment date has been changed to " + data.nextBill + " " + data.paymentDate + " and will be charged on the " + data.paymentDate + (0, 13061 _heifer.uGetOrdinalSuffix)(data.paymentDate) + " of every month.", response.body.subscription.newSubscriptionPlanId); 13062 }).catch(function(err) { 13063 _this3.setMessageCookie("paymentDate"); 13064 }); 13065 break; 13066 13067 case "pause": 13068 var value = _this3.pauseSlider.dataset.current; 13069 data.paymentDate = _this3.element.dataset.paymentDate, data.months = value, data.nextBill = form.dataset.nextBill, 13070 _this3.handleAjax(path, data, loadingButtons).then(function(response) { 13071 _this3.setMessageCookie("pause", "success", "Success! Your subscription has been paused for " + data.months + (1 == data.months ? " month." : " months."), response.body.subscription.newSubscriptionPlanId); 13072 }).catch(function(err) { 13073 _this3.setMessageCookie("pause"); 13074 }); 13075 } 13076 ev.preventDefault(); 13077 }); 13078 }); 13079 } 13080 }, { 13081 key: "initCancelListener", 13082 value: function() { 13083 var _this4 = this; 13084 this.stopButton.addEventListener("click", function(ev) { 13085 _this4.handleAjax(_this4.settings.api.cancel, _this4.settings.data, _this4.loadingButtons.cancel).then(function(response) { 13086 response.body && response.body.subscription && response.body.subscription.success ? document.dispatchEvent((0, 13087 _heifer.uCreateCustomEvent)("accountMonthly/cancel/success", { 13088 response: response, 13089 json: {}, 13090 card: _this4.element 13091 })) : document.dispatchEvent((0, _heifer.uCreateCustomEvent)("accountMonthly/cancel/error", { 13092 response: response 13093 })); 13094 }).catch(function(err) { 13095 document.dispatchEvent((0, _heifer.uCreateCustomEvent)("accountMonthly/cancel/error", { 13096 response: err 13097 })); 13098 }); 13099 }); 13100 } 13101 }, { 13102 key: "handleAjax",
13103 value: function(endpoint, data, loadingButtons) { 13104 return new Promise(function(resolve, reject) { 13105 $.ajax({ 13106 url: endpoint, 13107 type: "POST", 13108 data: { 13109 data: data 13110 }, 13111 success: function(response) { 13112 resolve(response); 13113 }, 13114 error: function(err) { 13115 [].forEach.call(loadingButtons, function(button) { 13116 button.reset(); 13117 }), reject(err); 13118 } 13119 }); 13120 }); 13121 } 13122 }, { 13123 key: "displayMessage", 13124 value: function() { 13125 var _this5 = this; 13126 if ((0, _heifer.uGetCookie)(this.settings.messageCookie) && "false" != (0, _heifer.uGetCookie)(this.settings.messageCookie)) { 13127 var messageJSON = JSON.parse((0, _heifer.uGetCookie)(this.settings.messageCookie)), messageElem = this.messages[messageJSON.type], displayMessage = new Promise(function(resolve) { 13128 messageElem.innerHTML = messageJSON.message, (0, _heifer.uAddClass)(messageElem, "is-revealed is-" + messageJSON.state), 13129 resolve(!0); 13130 }); 13131 displayMessage.then(function() { 13132 (0, _heifer.uScrollTo)(_this5.element), (0, _heifer.uAddClass)(messageElem, "is-animating"); 13133 }).then(function() { 13134 (0, _heifer.uDeleteCookie)(_this5.settings.messageCookie); 13135 }); 13136 } 13137 } 13138 }, { 13139 key: "setMessageCookie", 13140 value: function(argument_0, argument_1, argument_2, argument_3) { 13141 var _this6 = this, message = 2 < arguments.length && void 0 !== argument_2 ? argument_2 : null, newSub = 3 < arguments.length && void 0 !== argument_3 && argument_3, obj = { 13142 type: 0 < arguments.length && void 0 !== argument_0 ? argument_0 : null, 13143 state: 1 < arguments.length && void 0 !== argument_1 ? argument_1 : "error", 13144 message: message || "There was a problem updating your monthly program. Please try again or contact Donor Services at 855.9HUNGER (855.948.6437)." 13145 }; 13146 new Promise(function(resolve) { 13147 var cookie = _this6.settings.messageCookie; 13148 newSub && (cookie = _this6.settings.messageCookieBase + newSub), (0, _heifer.uSetCookie)(cookie, JSON.stringify(obj), 1), 13149 resolve(!0); 13150 }).then(function() { 13151 window.location.href = window.location.href; 13152 }); 13153 } 13154 }, { 13155 key: "onAltPayError", 13156 value: function(error) { 13157 console.log("PAY ERROR", error); 13158 } 13159 } ]), AccountMonthly; 13160 }(); 13161 exports.default = AccountMonthly; 13162 }, {
13163 "../../../core/utilities/checkout.utilities": 15, 13164 "../../../core/utilities/heifer.utilities": 19, 13165 "../../../shared/forms/paymentFields/paymentFields": 85, 13166 "../../../shared/forms/submitButton/submitButton": 88, 13167 "./accountMonthlyInputSliders": 29, 13168 "core-js/modules/es6.array.iterator": 241, 13169 "core-js/modules/es6.object.keys": 250, 13170 "core-js/modules/es6.object.to-string": 252, 13171 "core-js/modules/es6.promise": 253, 13172 "core-js/modules/es6.regexp.replace": 259, 13173 "core-js/modules/es6.symbol": 268, 13174 "core-js/modules/es7.object.get-own-property-descriptors": 272, 13175 "core-js/modules/web.dom.iterable": 274, 13176 "formdata-polyfill": 279 13177 } ], 13178 29: [ function(require, module, exports) { 13179 "use strict"; 13180 Object.defineProperty(exports, "__esModule", { 13181 value: !0 13182 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 13183 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 13184 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 13185 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.string.iterator"), 13186 require("core-js/modules/es6.array.from"), require("core-js/modules/es6.regexp.replace"), 13187 require("core-js/modules/es6.math.trunc"); 13188 var obj, _nouislider = (obj = require("nouislider")) && obj.__esModule ? obj : { 13189 default: obj 13190 }, _heifer = require("../../../core/utilities/heifer.utilities"); 13191 function ownKeys(object, enumerableOnly) { 13192 var keys = Object.keys(object); 13193 if (Object.getOwnPropertySymbols) { 13194 var symbols = Object.getOwnPropertySymbols(object); 13195 enumerableOnly && (symbols = symbols.filter(function(sym) { 13196 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 13197 })), keys.push.apply(keys, symbols); 13198 } 13199 return keys; 13200 } 13201 function _defineProperty(obj, key, value) { 13202 return key in obj ? Object.defineProperty(obj, key, { 13203 value: value, 13204 enumerable: !0, 13205 configurable: !0, 13206 writable: !0 13207 }) : obj[key] = value, obj; 13208 } 13209 function _defineProperties(target, props) { 13210 for (var i = 0; i < props.length; i++) { 13211 var descriptor = props[i]; 13212 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 13213 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 13214 } 13215 } 13216 var AccountMonthlyInputSlider = function() { 13217 function AccountMonthlyInputSlider(element, options) { 13218 !function(instance, Constructor) { 13219 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 13220 }(this, AccountMonthlyInputSlider), this.element = element, this.$element = $(element); 13221 var defaults = {}; 13222 this._defaults = defaults, this.settings = function(target) { 13223 for (var i = 1; i < arguments.length; i++) { 13224 var source = null != arguments[i] ? arguments[i] : {}; 13225 i % 2 ? ownKeys(source, !0).forEach(function(key) { 13226 _defineProperty(target, key, source[key]); 13227 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 13228 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 13229 }); 13230 } 13231 return target; 13232 }({}, defaults, {}, options), this.init(); 13233 } 13234 return function(Constructor, protoProps, staticProps) { 13235 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 13236 }(AccountMonthlyInputSlider, [ { 13237 key: "init", 13238 value: function() { 13239 this.slider = this.element.querySelector(".js-no-ui-slider"), this.sliderMin = parseInt(this.element.dataset.minVal, 10), 13240 this.sliderMax = parseInt(this.element.dataset.maxVal, 10), this.sliderStart = parseInt(this.element.dataset.startVal, 10), 13241 this.sliderStep = parseInt(this.element.dataset.increment, 10), this.sliderPips = parseInt(this.element.dataset.pips, 10), 13242 this.sliderMessage = document.querySelector(".js-pause-message-date"), this.initSlider(), 13243 this.setEventListeners(); 13244 } 13245 }, { 13246 key: "initSlider", 13247 value: function() { 13248 _nouislider.default.create(this.slider, { 13249 start: [ this.sliderStart ], 13250 step: this.sliderMin, 13251 connect: "lower", 13252 cssPrefix: "inputSlider__", 13253 range: { 13254 min: [ this.sliderMin ], 13255 max: [ this.sliderMax ] 13256 }, 13257 tooltips: [ { 13258 to: function(value) { 13259 var months = "Months"; 13260 return 1 == value && (months = "Month"), "Pause for<br />" + Math.trunc(Math.round(value)) + " " + months; 13261 }, 13262 from: function(value) { 13263 return value.replace("$", ""); 13264 } 13265 } ], 13266 pips: { 13267 mode: "count", 13268 values: Math.min(this.sliderPips, 20), 13269 density: 100, 13270 stepped: !0 13271 } 13272 }); 13273 } 13274 }, { 13275 key: "removePips", 13276 value: function() { 13277 var pips = Array.from(this.slider.querySelectorAll(".inputSlider__value-large, .inputSlider__marker")); 13278 [].forEach.call(pips, function(pip) { 13279 pip.parentNode.removeChild(pip); 13280 }); 13281 } 13282 }, { 13283 key: "sliderHasHitMax", 13284 value: function() { 13285 (0, _heifer.uAddClass)(this.slider, "inputSlider--max"), (0, _heifer.uRemoveClass)(this.slider, "inputSlider--min"), 13286 window.dispatchEvent((0, _heifer.uCreateEvent)("input-slider-max")); 13287 } 13288 }, { 13289 key: "sliderHasHitMin", 13290 value: function() { 13291 (0, _heifer.uAddClass)(this.slider, "inputSlider--min"), (0, _heifer.uRemoveClass)(this.slider, "inputSlider--max"), 13292 window.dispatchEvent((0, _heifer.uCreateEvent)("input-slider-min")); 13293 } 13294 }, { 13295 key: "sliderHasChanged", 13296 value: function() { 13297 (0, _heifer.uRemoveClass)(this.slider, "inputSlider--min"), (0, _heifer.uRemoveClass)(this.slider, "inputSlider--max"), 13298 console.log; 13299 } 13300 }, { 13301 key: "setEventListeners", 13302 value: function() { 13303 var _this = this; 13304 this.slider.noUiSlider.on("change", function() { 13305 _this.slider.noUiSlider.get(); 13306 }), this.slider.noUiSlider.on("update", function() { 13307 var newValue = _this.slider.noUiSlider.get(); 13308 _this.element.dataset.current = parseInt(newValue), _this.element.closest("form").dataset.current = parseInt(newValue), 13309 document.dispatchEvent((0, _heifer.uCreateCustomEvent)("accountMonthly/pause-slider-update-" + _this.element.dataset.subId, { 13310 month: parseInt(newValue) 13311 })); 13312 }); 13313 } 13314 } ]), AccountMonthlyInputSlider; 13315 }(); 13316 exports.default = AccountMonthlyInputSlider; 13317 }, {
13318 "../../../core/utilities/heifer.utilities": 19, 13319 "core-js/modules/es6.array.from": 240, 13320 "core-js/modules/es6.array.iterator": 241, 13321 "core-js/modules/es6.math.trunc": 246, 13322 "core-js/modules/es6.object.keys": 250, 13323 "core-js/modules/es6.object.to-string": 252, 13324 "core-js/modules/es6.regexp.replace": 259, 13325 "core-js/modules/es6.string.iterator": 265, 13326 "core-js/modules/es6.symbol": 268, 13327 "core-js/modules/es7.object.get-own-property-descriptors": 272, 13328 "core-js/modules/web.dom.iterable": 274, 13329 nouislider: 284 13330 } ], 13331 30: [ function(require, module, exports) { 13332 "use strict"; 13333 Object.defineProperty(exports, "__esModule", { 13334 value: !0 13335 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 13336 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 13337 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.keys"), 13338 require("core-js/modules/es6.promise"), require("core-js/modules/es6.object.to-string"); 13339 var obj, _heifer = require("../../../core/utilities/heifer.utilities"), _submitButton = (obj = require("../../../shared/forms/submitButton/submitButton")) && obj.__esModule ? obj : { 13340 default: obj 13341 }; 13342 function ownKeys(object, enumerableOnly) { 13343 var keys = Object.keys(object); 13344 if (Object.getOwnPropertySymbols) { 13345 var symbols = Object.getOwnPropertySymbols(object); 13346 enumerableOnly && (symbols = symbols.filter(function(sym) { 13347 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 13348 })), keys.push.apply(keys, symbols); 13349 } 13350 return keys; 13351 } 13352 function _defineProperty(obj, key, value) { 13353 return key in obj ? Object.defineProperty(obj, key, { 13354 value: value, 13355 enumerable: !0, 13356 configurable: !0, 13357 writable: !0 13358 }) : obj[key] = value, obj; 13359 } 13360 function _defineProperties(target, props) { 13361 for (var i = 0; i < props.length; i++) { 13362 var descriptor = props[i]; 13363 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 13364 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 13365 } 13366 } 13367 var AccountMonthlyModal = function() { 13368 function AccountMonthlyModal(element, options) { 13369 !function(instance, Constructor) { 13370 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 13371 }(this, AccountMonthlyModal), this.element = element; 13372 var defaults = {}; 13373 this._defaults = defaults, this.settings = function(target) { 13374 for (var i = 1; i < arguments.length; i++) { 13375 var source = null != arguments[i] ? arguments[i] : {}; 13376 i % 2 ? ownKeys(source, !0).forEach(function(key) { 13377 _defineProperty(target, key, source[key]); 13378 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 13379 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 13380 }); 13381 } 13382 return target; 13383 }({}, defaults, {}, options), this.init(); 13384 } 13385 return function(Constructor, protoProps, staticProps) { 13386 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 13387 }(AccountMonthlyModal, [ { 13388 key: "init", 13389 value: function() { 13390 this.revealTrigger = document.querySelector("#" + this.element.dataset.revealTrigger) || document.querySelectorAll("." + this.element.dataset.revealTrigger), 13391 this.revealClose = this.element.querySelectorAll(".js-account-monthly-modal-close"), 13392 this.modalContent = this.element.querySelector(".js-account-monthly-modal-content"), 13393 this.modalMessage = this.element.querySelector(".js-account-monthly-modal-message"), 13394 this.modalMessageText = this.modalMessage.querySelector(".js-account-monthly-modal-message-text"), 13395 this.modalPauseDate = this.element.querySelector(".js-pause-modal-date"), this.subCard = document.querySelector('.js-account-monthly[id="' + this.element.dataset.subId + '"]'), 13396 this.refreshButton = this.element.querySelector(".js-account-monthly-modal-refresh"), 13397 this.loadingButton = new _submitButton.default(this.refreshButton, { 13398 trigger: "click" 13399 }), this.setEventListeners(); 13400 } 13401 }, { 13402 key: "setEventListeners", 13403 value: function() { 13404 var _this = this; 13405 this.revealTrigger.length ? [].forEach.call(this.revealTrigger, function(btn
13405) { 13406 btn.addEventListener("click", function(ev) { 13407 _this.triggerClick(); 13408 }); 13409 }) : this.revealTrigger && this.revealTrigger.addEventListener("click", function(ev) { 13410 _this.triggerClick(); 13411 }), [].forEach.call(this.revealClose, function(close) { 13412 close.addEventListener("click", function(ev) { 13413 _this.resetModal().then(function() { 13414 (0, _heifer.uRemoveClass)(_this.element, "is-revealed"); 13415 }); 13416 }); 13417 }), document.addEventListener("accountMonthly/cancel/success", function(ev) { 13418 _this.handleCancelSuccess(ev); 13419 }), document.addEventListener("accountMonthly/cancel/error", function(ev) { 13420 _this.handleCancelError(ev); 13421 }), document.addEventListener("accountMonthly/pause-slider-update-" + this.element.dataset.subId, function(ev) { 13422 _this.updatePauseModal(ev.detail.month); 13423 }), this.refreshButton && this.refreshButton.addEventListener("click", function(ev) { 13424 window.location.href = window.location.href; 13425 }); 13426 } 13427 }, { 13428 key: "handleCancelSuccess", 13429 value: function(ev) { 13430 this.showMessage("Your donation has been successfully cancelled."), ev.detail.card && ev.detail.card.remove(); 13431 } 13432 }, { 13433 key: "handleCancelError", 13434 value: function(ev) { 13435 this.showMessage("There was a problem processing your cancel request. Please try again or contact Donor Services at 855.9HUNGER (855.948.6437)."); 13436 } 13437 }, { 13438 key: "showMessage", 13439 value: function(message) { 13440 message && (this.modalContent.setAttribute("hidden", ""), this.modalMessage.removeAttribute("hidden"), 13441 this.modalMessageText.textContent = message); 13442 } 13443 }, { 13444 key: "resetModal", 13445 value: function() { 13446 var _this2 = this; 13447 return new Promise(function(resolve) { 13448 _this2.modalContent.hasAttribute("hidden") && (_this2.modalContent.removeAttribute("hidden"), 13449 _this2.modalMessage.setAttribute("hidden", "")), resolve(!0); 13450 }); 13451 } 13452 }, { 13453 key: "triggerClick", 13454 value: function() { 13455 var _this3 = this; 13456 this.resetModal().then(function() { 13457 (0, _heifer.uAddClass)(_this3.element, "is-revealed"); 13458 }); 13459 } 13460 }, { 13461 key: "updatePauseModal", 13462 value: function(increase) { 13463 if (this.modalPauseDate) { 13464 var key = parseInt(increase) - 1; 13465 this.modalPauseDate.textContent = JSON.parse(this.subCard.dataset.pauseDates)[key]; 13466 } 13467 } 13468 } ]), AccountMonthlyModal; 13469 }(); 13470 exports.default = AccountMonthlyModal; 13471 }, { 13472 "../../../core/utilities/heifer.utilities": 19, 13473 "../../../shared/forms/submitButton/submitButton": 88, 13474 "core-js/modules/es6.array.iterator": 241, 13475 "core-js/modules/es6.object.keys": 250, 13476 "core-js/modules/es6.object.to-string": 252, 13477 "core-js/modules/es6.promise": 253, 13478 "core-js/modules/es6.symbol": 268, 13479 "core-js/modules/es7.object.get-own-property-descriptors": 272, 13480 "core-js/modules/web.dom.iterable": 274 13481 } ], 13482 31: [ function(require, module, exports) { 13483 "use strict"; 13484 function ownKeys(object, enumerableOnly) { 13485 var keys = Object.keys(object); 13486 if (Object.getOwnPropertySymbols) { 13487 var symbols = Object.getOwnPropertySymbols(object); 13488 enumerableOnly && (symbols = symbols.filter(function(sym) { 13489 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 13490 })), keys.push.apply(keys, symbols); 13491 } 13492 return keys; 13493 } 13494 function _defineProperty(obj, key, value) { 13495 return key in obj ? Object.defineProperty(obj, key, { 13496 value: value, 13497 enumerable: !0, 13498 configurable: !0, 13499 writable: !0 13500 }) : obj[key] = value, obj; 13501 } 13502 function _defineProperties(target, props) { 13503 for (var i = 0; i < props.length; i++) { 13504 var descriptor = props[i]; 13505 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 13506 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 13507 } 13508 } 13509 Object.defineProperty(exports, "__esModule", { 13510 value: !0 13511 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 13512 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 13513 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.keys"), 13514 require("core-js/modules/es6.function.name"), require("core-js/modules/es6.regexp.replace"), 13515 require("core-js/modules/es6.promise"), require("core-js/modules/es6.object.to-string"); 13516 var AccountMonthlyPastDonations = function() { 13517 function AccountMonthlyPastDonations(element, options) { 13518 !function(instance, Constructor) { 13519 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 13520 }(this, AccountMonthlyPastDonations), this.element = element, this.$element = $(this.element), 13521 this.defaults = {}, this.settings = function(target) { 13522 for (var i = 1; i < arguments.length; i++) { 13523 var source = null != arguments[i] ? arguments[i] : {};
13524 i % 2 ? ownKeys(source, !0).forEach(function(key) { 13525 _defineProperty(target, key, source[key]); 13526 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 13527 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 13528 }); 13529 } 13530 return target; 13531 }({}, this.defaults, {}, options), this.init(); 13532 } 13533 return function(Constructor, protoProps, staticProps) { 13534 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 13535 }(AccountMonthlyPastDonations, [ { 13536 key: "init", 13537 value: function() { 13538 var _this = this; 13539 this.tableHeaders = this.element.querySelector(".js-account-monthly-table-headings"), 13540 this.rowTemplate = this.element.querySelector("#account-monthly-past-row-template"), 13541 document.addEventListener("accountMonthly/cancel/success", function(ev) { 13542 _this.updateTable(ev.detail.json).then(function(row) { 13543 _this.tableHeaders.insertAdjacentHTML("afterend", row); 13544 }); 13545 }); 13546 } 13547 }, { 13548 key: "updateTable", 13549 value: function(subData) { 13550 var _this2 = this; 13551 return new Promise(function(resolve) { 13552 resolve(_this2.rowTemplate.innerHTML.replace(/{{ subId }}/g, subData.subId).replace(/{{ name }}/g, subData.name).replace(/{{ price }}/g, subData.price).replace(/{{ nextBill }}/g, subData.nextBill).replace(/{{ status }}/g, subData.status)); 13553 }); 13554 } 13555 } ]), AccountMonthlyPastDonations; 13556 }(); 13557 exports.default = AccountMonthlyPastDonations; 13558 }, { 13559 "core-js/modules/es6.array.iterator": 241, 13560 "core-js/modules/es6.function.name": 244, 13561 "core-js/modules/es6.object.keys": 250, 13562 "core-js/modules/es6.object.to-string": 252, 13563 "core-js/modules/es6.promise": 253, 13564 "core-js/modules/es6.regexp.replace": 259, 13565 "core-js/modules/es6.symbol": 268, 13566 "core-js/modules/es7.object.get-own-property-descriptors": 272, 13567 "core-js/modules/web.dom.iterable": 274 13568 } ], 13569 32: [ function(require, module, exports) { 13570 "use strict"; 13571 Object.defineProperty(exports, "__esModule", { 13572 value: !0 13573 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 13574 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 13575 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 13576 require("core-js/modules/es6.object.keys"); 13577 var obj, _reveal = (obj = require("../../../core/ui/reveal.es6")) && obj.__esModule ? obj : { 13578 default: obj 13579 }; 13580 require("../../../core/utilities/heifer.utilities"); 13581 function ownKeys(object, enumerableOnly) { 13582 var keys = Object.keys(object); 13583 if (Object.getOwnPropertySymbols) { 13584 var symbols = Object.getOwnPropertySymbols(object); 13585 enumerableOnly && (symbols = symbols.filter(function(sym) { 13586 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 13587 })), keys.push.apply(keys, symbols); 13588 } 13589 return keys; 13590 } 13591 function _defineProperty(obj, key, value) { 13592 return key in obj ? Object.defineProperty(obj, key, { 13593 value: value, 13594 enumerable: !0, 13595 configurable: !0, 13596 writable: !0 13597 }) : obj[key] = value, obj; 13598 } 13599 function _defineProperties(target, props) { 13600 for (var i = 0; i < props.length; i++) { 13601 var descriptor = props[i]; 13602 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 13603 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 13604 } 13605 } 13606 var ContactPreferencesModal = function() { 13607 function ContactPreferencesModal(element, options) { 13608 !function(instance, Constructor) { 13609 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 13610 }(this, ContactPreferencesModal), this.element = element, this.$element = $(element); 13611 var defaults = {}; 13612 this._defaults = defaults, this.settings = function(target) { 13613 for (var i = 1; i < arguments.length; i++) { 13614 var source = null != arguments[i] ? arguments[i] : {};
13615 i % 2 ? ownKeys(source, !0).forEach(function(key) { 13616 _defineProperty(target, key, source[key]); 13617 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 13618 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 13619 }); 13620 } 13621 return target; 13622 }({}, defaults, {}, options), this.init(); 13623 } 13624 return function(Constructor, protoProps, staticProps) { 13625 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 13626 }(ContactPreferencesModal, [ { 13627 key: "init", 13628 value: function() { 13629 var _this = this, scope = this; 13630 scope.modals = document.querySelectorAll(".js-contact-preferences-modal-target"); 13631 var triggers = this.element.querySelectorAll(".js-contact-preferences-modal-trigger"); 13632 new _reveal.default(triggers, { 13633 type: "exclusive", 13634 activeClass: "is-revealed", 13635 visitedClass: "was-revealed" 13636 }), window.addEventListener("keydown", function(event) { 13637 27 == event.which && scope.modals.forEach(function(el) { 13638 el.classList.contains("is-revealed") && el.querySelector(".js-contact-preferences-modal-close").click(); 13639 }), 9 == event.which && scope.modals.forEach(function(el) { 13640 el.classList.contains("is-revealed") && (document.activeElement.classList.contains("js-contact-preferences-modal-trigger") || document.activeElement.classList.contains("js-contact-preferences-modal-close") || _this.element.querySelector(".js-contact-preferences-modal-trigger").focus()); 13641 }); 13642 }); 13643 } 13644 } ]), ContactPreferencesModal; 13645 }(); 13646 exports.default = ContactPreferencesModal; 13647 }, { 13648 "../../../core/ui/reveal.es6": 12, 13649 "../../../core/utilities/heifer.utilities": 19, 13650 "core-js/modules/es6.array.iterator": 241, 13651 "core-js/modules/es6.object.keys": 250, 13652 "core-js/modules/es6.object.to-string": 252, 13653 "core-js/modules/es6.symbol": 268, 13654 "core-js/modules/es7.object.get-own-property-descriptors": 272, 13655 "core-js/modules/web.dom.iterable": 274 13656 } ], 13657 33: [ function(require, module, exports) { 13658 "use strict"; 13659 Object.defineProperty(exports, "__esModule", { 13660 value: !0 13661 }), exports.default = function() { 13662 var form = document.querySelector("#accountInformationForm"), submitButton = document.querySelector('#accountInformationForm [type="submit"]'), paymentFields = new _paymentFields.default(form, !1, !1); 13663 new _submitButton.default(submitButton); 13664 form.addEventListener("submit", function(ev) { 13665 paymentFields.tokenize().then(function(payload) { 13666 _jquery.default.post("/api/account/addPaymentMethod.html", { 13667 nonce: payload.nonce 13668 }, function(data) { 13669 window.location.reload(); 13670 }); 13671 }), ev.preventDefault(); 13672 }); 13673 }; 13674 var _jquery = _interopRequireDefault(require("jquery")), _paymentFields = (require("../../core/utilities/heifer.utilities"), 13675 _interopRequireDefault(require("../../shared/forms/paymentFields/paymentFields"))), _submitButton = _interopRequireDefault(require("../../shared/forms/submitButton/submitButton")); 13676 function _interopRequireDefault(obj) { 13677 return obj && obj.__esModule ? obj : { 13678 default: obj 13679 }; 13680 } 13681 }, { 13682 "../../core/utilities/heifer.utilities": 19, 13683 "../../shared/forms/paymentFields/paymentFields": 85, 13684 "../../shared/forms/submitButton/submitButton": 88, 13685 jquery: 20 13686 } ],
13687 34: [ function(require, module, exports) { 13688 "use strict"; 13689 Object.defineProperty(exports, "__esModule", { 13690 value: !0 13691 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 13692 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 13693 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 13694 require("core-js/modules/es6.object.keys"); 13695 var _jquery = _interopRequireDefault(require("jquery")), _heifer = _interopRequireDefault(require("../../core/ui/heifer.carousel")); 13696 function _interopRequireDefault(obj) { 13697 return obj && obj.__esModule ? obj : { 13698 default: obj 13699 }; 13700 } 13701 function ownKeys(object, enumerableOnly) { 13702 var keys = Object.keys(object); 13703 if (Object.getOwnPropertySymbols) { 13704 var symbols = Object.getOwnPropertySymbols(object); 13705 enumerableOnly && (symbols = symbols.filter(function(sym) { 13706 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 13707 })), keys.push.apply(keys, symbols); 13708 } 13709 return keys; 13710 } 13711 function _defineProperty(obj, key, value) { 13712 return key in obj ? Object.defineProperty(obj, key, { 13713 value: value, 13714 enumerable: !0, 13715 configurable: !0, 13716 writable: !0 13717 }) : obj[key] = value, obj; 13718 } 13719 function _defineProperties(target, props) { 13720 for (var i = 0; i < props.length; i++) { 13721 var descriptor = props[i]; 13722 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 13723 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 13724 } 13725 } 13726 var Blog = function() { 13727 function Blog(element, options) { 13728 !function(instance, Constructor) { 13729 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 13730 }(this, Blog), this.element = element, this.$element = (0, _jquery.default)(this.element), 13731 this._defaults = {}, this.settings = function(target) { 13732 for (var i = 1; i < arguments.length; i++) { 13733 var source = null != arguments[i] ? arguments[i] : {}; 13734 i % 2 ? ownKeys(source, !0).forEach(function(key) { 13735 _defineProperty(target, key, source[key]); 13736 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 13737 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 13738 }); 13739 } 13740 return target; 13741 }({}, this._defaults, {}, options), this.init(); 13742 } 13743 return function(Constructor, protoProps, staticProps) { 13744 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 13745 }(Blog, [ { 13746 key: "init", 13747 value: function() { 13748 this.carousel = new _heifer.default(this.element, { 13749 visibleSlides: { 13750 0: 1, 13751 480: 1, 13752 768: 2 13753 } 13754 }); 13755 } 13756 } ]), Blog; 13757 }(); 13758 exports.default = Blog; 13759 }, { 13760 "../../core/ui/heifer.carousel": 7, 13761 "core-js/modules/es6.array.iterator": 241, 13762 "core-js/modules/es6.object.keys": 250, 13763 "core-js/modules/es6.object.to-string": 252, 13764 "core-js/modules/es6.symbol": 268, 13765 "core-js/modules/es7.object.get-own-property-descriptors": 272, 13766 "core-js/modules/web.dom.iterable": 274, 13767 jquery: 20 13768 } ],
13769 35: [ function(require, module, exports) { 13770 "use strict"; 13771 Object.defineProperty(exports, "__esModule", { 13772 value: !0 13773 }), exports.default = function() { 13774 new Cart(document.querySelector(".js-cart")); 13775 }, require("core-js/modules/es7.object.get-own-property-descriptors"), require("core-js/modules/es6.symbol"), 13776 require("core-js/modules/web.dom.iterable"), require("core-js/modules/es6.array.iterator"), 13777 require("core-js/modules/es6.object.to-string"), require("core-js/modules/es6.object.keys"), 13778 require("core-js/modules/es6.regexp.replace"); 13779 var _cartSummary = _interopRequireDefault(require("./cartSummary/cartSummary")), _cartReview = _interopRequireDefault(require("./cartReview/cartReview")), _cartCompany = _interopRequireDefault(require("./cartCompany/cartCompany")), _paymentFields = _interopRequireDefault(require("./../../shared/forms/paymentFields/paymentFields")), _checkout = require("./../../core/utilities/checkout.utilities"), _heifer = require("./../../core/utilities/heifer.utilities"), _gtm = require("./../../core/utilities/gtm.utilities"), _submitButton = _interopRequireDefault(require("./../../shared/forms/submitButton/submitButton")), _cartShippingMethods = _interopRequireDefault(require("./cartShippingMethods/cartShippingMethods")); 13780 function _interopRequireDefault(obj) { 13781 return obj && obj.__esModule ? obj : { 13782 default: obj 13783 }; 13784 } 13785 function ownKeys(object, enumerableOnly) { 13786 var keys = Object.keys(object); 13787 if (Object.getOwnPropertySymbols) { 13788 var symbols = Object.getOwnPropertySymbols(object); 13789 enumerableOnly && (symbols = symbols.filter(function(sym) { 13790 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 13791 })), keys.push.apply(keys, symbols); 13792 } 13793 return keys; 13794 } 13795 function _defineProperty(obj, key, value) { 13796 return key in obj ? Object.defineProperty(obj, key, { 13797 value: value, 13798 enumerable: !0, 13799 configurable: !0, 13800 writable: !0 13801 }) : obj[key] = value, obj; 13802 } 13803 function _defineProperties(target, props) { 13804 for (var i = 0; i < props.length; i++) { 13805 var descriptor = props[i]; 13806 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 13807 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 13808 } 13809 } 13810 var Cart = function() { 13811 function Cart(element, options) { 13812 !function(instance, Constructor) { 13813 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 13814 }(this, Cart), this.element = element; 13815 var defaults = { 13816 step: window.Heifer.pages.cart.step, 13817 clientToken: window.Heifer.pages.cart.clientToken, 13818 cartReviewSelector: ".js-cart__review", 13819 errorFieldSelector: ".js-cart-error" 13820 }; 13821 this._defaults = defaults, this.settings = function(target) { 13822 for (var i = 1; i < arguments.length; i++) { 13823 var source = null != arguments[i] ? arguments[i] : {}; 13824 i % 2 ? ownKeys(source, !0).forEach(function(key) { 13825 _defineProperty(target, key, source[key]); 13826 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 13827 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 13828 }); 13829 } 13830 return target; 13831 }({}, defaults, {}, options), this.subtotal = this.element.querySelectorAll(".js-cart__subtotal"), 13832 this.discount = this.element.querySelectorAll(".js-cart__discount"), this.total = this.element.querySelector(".js-cart__total"), 13833 this.initialTotal = this.total.textContent, this.coverProcessingFeeInput = this.element.querySelector(".js-cart__cover-processing-fee-input"), 13834 this.processingFee = this.element.querySelector(".js-cart__processing-fee-number"), 13835 this.errorField = this.element.querySelector(this.settings.errorFieldSelector), 13836 this.processingFeeInput = this.element.querySelector(".js-cart__processing-fee-input"), 13837 this.cartUUID = this.element.querySelector(".js-cart__id") ? this.element.querySelector(".js-cart__id").value : "", 13838 this.step = this.initStep(), this.company = this.initCartCompany(), this.review = this.initCartReview(), 13839 this.submitBtns = [], this.shippingSelect = this.element.querySelector(".js-shipping-select"), 13840 this.bindEvents(), this.init(); 13841 } 13842 return function(Constructor, protoProps, staticProps) { 13843 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 13844 }(Cart, [ { 13845 key: "init", 13846 value: function() { 13847 var _this = this; 13848 [].forEach.call(document.querySelectorAll(".js-cart-submit"), function(submitBtn) { 13849 var btn = new _submitButton.default(submitBtn); 13850 _this.submitBtns.push(btn); 13851 }); 13852 } 13853 }, { 13854 key: "bindEvents", 13855 value: function() { 13856 var _this2 = this; 13857 "index" === this.settings.step && (this.element.addEventListener("input", function(ev) { 13858 var input = ev.target; 13859 if ((0, _heifer.uIs)(input, 'input[type="radio"]') || (0, _heifer.uIs)(input, 'input[type="checkbox"]')) return !0; 13860 _this2.updateSummaryTotals.bind(_this2), _this2.updateSummaryTotals(); 13861 }), this.element.addEventListener("change", function(ev) { 13862 var input = ev.target; 13863 ((0, _heifer.uIs)(input, 'input[type="radio"]') || (0, _heifer.uIs)(input, 'input[type="checkbox"]')) && (_this2.updateSummaryTotals.bind(_this2), 13864 _this2.updateSummaryTotals()); 13865 }), this.element.addEventListener("submit", function(ev) { 13866 var products = (0, _gtm.getProductsData)(); 13867 (0, _gtm.pushDataLayerEvent)("begin_checkout", products); 13868 })), "payment" !== this.settings.step && "summary-payment" !== this.settings.step || this.element.addEventListener("submit", function(ev) { 13869 (0, _heifer.uAddClass)(_this2.errorField, "is-hidden"), _this2.step.submitCart().then(_this2.onCheckoutRe
13869sponse.bind(_this2)).catch(_this2.onCheckoutError.bind(_this2)), 13870 ev.preventDefault(); 13871 }); 13872 } 13873 }, { 13874 key: "onCheckoutResponse", 13875 value: function(checkoutResponse) { 13876 this.element.submit(); 13877 } 13878 }, { 13879 key: "onCheckoutError", 13880 value: function(error) { 13881 var message = error || "A problem has occurrred"; 13882 [].forEach.call(this.submitBtns, function(submitBtn) { 13883 submitBtn.reset(); 13884 }), this.errorField.appendChild(message), (0, _heifer.uRemoveClass)(this.errorField, "is-hidden"), 13885 (0, _heifer.uScrollTo)(this.settings.errorFieldSelector); 13886 } 13887 }, { 13888 key: "onPaypalResponse", 13889 value: function(paypalResponse) { 13890 this.element.submit(); 13891 } 13892 }, { 13893 key: "onPaypalError", 13894 value: function(error) { 13895 var message = error || "A problem has occurrred"; 13896 [].forEach.call(this.submitBtns, function(submitBtn) { 13897 submitBtn.reset(); 13898 }), this.errorField.appendChild(message), (0, _heifer.uRemoveClass)(this.errorField, "is-hidden"), 13899 (0, _heifer.uScrollTo)(this.settings.errorFieldSelector); 13900 } 13901 }, { 13902 key: "updateSummaryTotals", 13903 value: function() { 13904 var coverProcessingFee = !!this.coverProcessingFeeInput && this.coverProcessingFeeInput.checked; 13905 (0, _checkout.updateTotals)(this.element, this.total, this.processingFee, this.processingFeeInput, !0, coverProcessingFee, this.subtotal, this.discount), 13906 document.getElementsByName("totalCost")[0] && this.doUpdateTotal(); 13907 } 13908 }, { 13909 key: "onSummaryItemRemove", 13910 value: function(summaryItem) { 13911 var productData = JSON.parse(summaryItem.productData.value); 13912 productData.cartUUID = this.cartUUID; 13913 var listItem = (0, _heifer.uClosest)(summaryItem.element, ".js-cart-summary__list-item"); 13914 (0, _checkout.onCartRemove)(productData), listItem.parentElement.removeChild(listItem), 13915 this.updateSummaryTotals(); 13916 (0, _heifer.uAjaxWithResponse)("POST", _checkout.CART_REMOVE_PRODUCT_URL, !0, (0, 13917 _heifer.uJsonToQueryString)(productData), "application/x-www-form-urlencoded; charset=UTF-8").then(function() { 13918 location.reload(); 13919 }).catch(function(err) { 13920 console.error(err); 13921 }); 13922 } 13923 }, { 13924 key: "onSummaryItemEdit", 13925 value: function(summaryItem) { 13926 var _this3 = this, productData = JSON.parse(summaryItem.productData.value); 13927 productData.cartUUID = this.cartUUID, this.updateSummaryTotals(); 13928 (0, _heifer.uAjaxWithResponse)("POST", _checkout.CART_EDIT_PRODUCT_URL, !0, (0, 13929 _heifer.uJsonToQueryString)(productData), "application/x-www-form-urlencoded; charset=UTF-8").then(function() { 13930 0 !== parseInt(_this3.initialTotal) && 0 !== parseInt(_this3.total.textContent) || _this3.total.textContent == _this3.initialTotal || location.reload(); 13931 }).catch(function(err) { 13932 console.error(err); 13933 }); 13934 } 13935 }, { 13936 key: "initStep", 13937 value: function() { 13938 switch (this.settings.step) { 13939 case "index": 13940 return this.initPaymentOptions(), this.detectApplePayCompatablilty(), this.handleHonorees(), 13941 this.giveInHonorChecked(), this.initCartSummary(); 13942 13943 case "billing": 13944 return this.initCartBilling(), this.initUSShippingOnly(); 13945 13946 case "shipping": 13947 case "applepayshippingmethods": 13948 return this.initShipping(); 13949 13950 case "payment": 13951 return this.initCartBlackbaud(), this.initCartPayment(); 13952 13953 case "summary-payment": 13954 return this.initCartSummary(), this.initCartPayment(); 13955 13956 case "paypal": 13957 return this.initPaypal(); 13958 13959 case "applepaypayment": 13960 return this.initPaymentOptions(); 13961 } 13962 } 13963 }, { 13964 key: "initCartSummary", 13965 value: function() { 13966 return (0, _checkout.preCheckCCFee)(), new _cartSummary.default(this.element, { 13967 onSummaryItemRemove: this.onSummaryItemRemove.bind(this), 13968 onSummaryItemEdit: this.onSummaryItemEdit.bind(this), 13969 onInit: this.updateSummaryTotals.bind(this) 13970 }); 13971 } 13972 }, { 13973 key: "initCartReview", 13974 value: function() { 13975 return !!window.Heifer.pages.cart.review && new _cartReview.default(this.element.querySelector(this.settings.cartReviewSelector)); 13976 } 13977 }, { 13978 key: "initCartBilling", 13979 value: function() {} 13980 }, { 13981 key: "initShipping", 13982 value: function() { 13983 return new _cartShippingMethods.default(this.element.querySelector(".js-cart-shipping-method")); 13984 } 13985 }, { 13986 key: "initCartPayment", 13987 value: function() { 13988 var includeBlackbaud = new window.FormData(this.element).get("has_monthly_product") ? 1 : 0; 13989 return new _paymentFields.default(this.element, this.onPaypalResponse.bind(this), this.onPaypalError.bind(this), this.element.querySelector(".js-paypal-button-loading"), !1, !1, !1, includeBlackbaud); 13990 } 13991 }, { 13992 key: "initPaypal", 13993 value: function() { 13994 return new _paymentFields.default(this.element, this.onPaypalResponse.bind(this), this.onPaypalError.bind(this), this.element.querySelector(".js-paypal-button-loading")); 13995 } 13996 }, { 13997 key: "initPaymentOptions", 13998 value: function() { 13999 return new _paymentFields.default(this.element, !1, this.onPaypalError.bind(this), this.element.querySelector(".js-alt-pay-loading"), this.element.contains(this.element.querySelector(".donationBilling__option--apple")), this.element.contains(this.element.querySelector(".donationBilling__option--venmo")), this.element.contains(this.element.querySelector(".donationBilling__option--google"))); 14000 } 14001 }, { 14002 key: "initCartCompany", 14003 value: function() { 14004 if (window.Heifer.pages.cart.company) return new _cartCompany.default(); 14005 } 14006 }, { 14007 key: "detectApplePayCompatablilty", 14008 value: function() { 14009 if (null != document.getElementById("js-apple-pay-shippable")) { 14010 var userAgentString = navigator.userAgent, safariAgent = -1 < userAgentString.indexOf("Safari"); 14011 -1 < userAgentString.indexOf("Chrome") && safariAgent ? document.getElementById("js-apple-pay-shippable").style.display = "none" : $.getScript("https://js.braintreegateway.com/web/3.46.0/js/apple-pay.min.js").done(function() { 14012 window.ApplePaySession && ApplePaySession.canMakePayments() || (document.getElementById("js-apple-pay-shippable").style.display = "none"); 14013 }); 14014 } 14015 } 14016 }, { 14017 key: "doUpdateTotal", 14018 value: function() { 14019 var currentTotal = document.getElementsByClassName("js-cart__total")[0].innerText, cleanNumber = parseFloat(currentTotal.replace(/,/g, "")); 14020 document.getElementsByName("totalCost")[0].value = cleanNumber; 14021 } 14022 }, { 14023 key: "handleHonorees", 14024 value: function() { 14025 var _this4 = this; 14026 [].forEach.call(document.querySelectorAll(".js-honoree-add"), function(button) { 14027 (0, _heifer.uAddClass)(button, "is-active"), button.addEventListener("click", function() { 14028 _this4.addHonoree(button); 14029 }); 14030 }), [].forEach.call(document.querySelectorAll(".js-honoree-remove"), function(button) { 14031 button.addEventListener("click", function() { 14032 _this4.removeHonoree(button); 14033 }); 14034 }); 14035 } 14036 }, { 14037 key: "addHonoree", 14038 value: function(button) { 14039 var inputsContainer = button.parentNode.querySelector(".js-
14039honoree-inputs"), inputs = button.parentNode.querySelectorAll("input"), nearestRemoveButton = button.parentNode.querySelector(".js-honoree-remove"); 14040 if (inputs.length <= 6) { 14041 var parentNode = button.parentNode.parentNode, orderHonoreeInput = parentNode.querySelector(".donationGiveInHonor__order-honoree"), orderHonoreeInputData = parentNode.querySelector(".donationGiveInHonor__order-honoree-data"), orderHonoreeInputNode = orderHonoreeInput.cloneNode(!0), orderHonoreeInputDataNode = orderHonoreeInputData.cloneNode(!0); 14042 orderHonoreeInputNode.style.display = "inline-block", orderHonoreeInputNode.querySelector("input").value = "", 14043 orderHonoreeInputDataNode.value = "", inputsContainer.append(orderHonoreeInputNode), 14044 inputsContainer.append(orderHonoreeInputDataNode), (0, _heifer.uAddClass)(nearestRemoveButton, "is-active"); 14045 } 14046 6 === inputs.length && (button.disabled = !0); 14047 } 14048 }, { 14049 key: "removeHonoree", 14050 value: function(button) { 14051 var inputs = button.parentNode.querySelectorAll("input"), parentNode = button.parentNode, nearestAddButton = parentNode.querySelector(".js-honoree-add"); 14052 if (1 <= inputs.length) { 14053 var orderHonoreeInput = parentNode.querySelectorAll(".donationGiveInHonor__order-honoree"), orderHonoreeInputData = parentNode.querySelectorAll(".donationGiveInHonor__order-honoree-data"), lastOrderHonoreeInput = orderHonoreeInput[orderHonoreeInput.length - 1], lastOrderHonoreeData = orderHonoreeInputData[orderHonoreeInputData.length - 1]; 14054 lastOrderHonoreeInput.remove(), lastOrderHonoreeData.remove(), document.querySelector(".donationGiveInHonor__order-honoree").dispatchEvent((0, 14055 _heifer.uCreateEvent)("change")); 14056 } 14057 inputs.length <= 10 && (nearestAddButton.disabled = !1), 2 == inputs.length && (0, 14058 _heifer.uRemoveClass)(button, "is-active"); 14059 } 14060 }, { 14061 key: "giveInHonorChecked", 14062 value: function() { 14063 var checkboxes = document.getElementsByName("orderHonoreeCheckbox"), applePay = document.querySelector("#apple-pay"), venmo = document.querySelector("#venmo-button"), googlePay = document.querySelector("#google-pay-button"); 14064 checkboxes.length < 1 || (null != venmo && (venmo.style.display = "none"), null != applePay && (applePay.style.display = "none"), 14065 null != googlePay && (googlePay.style.display = "none")); 14066 } 14067 }, { 14068 key: "initUSShippingOnly", 14069 value: function() { 14070 null != document.querySelector("input[name=shippingSameAsBilling]") && document.querySelector("select[name=country]").addEventListener("change", function() { 14071 var shippingSameAsBilling = document.querySelector("input[name=shippingSameAsBilling]"), countryValue = document.querySelector("select[name=country]").value, label = document.querySelector(".cartShipping__checkbox"); 14072 "US" != countryValue && (shippingSameAsBilling.checked && document.querySelector("input[name=shippingSameAsBilling]").click(), 14073 shippingSameAsBilling.setAttribute("disabled", ""), (0, _heifer.uAddClass)(label, "is-disabled")), 14074 "US" == countryValue && (shippingSameAsBilling.removeAttribute("disabled", ""), 14075 (0, _heifer.uRemoveClass)(label, "is-disabled")); 14076 }); 14077 } 14078 }, { 14079 key: "initCartBlackbaud", 14080 value: function() { 14081 1 == new window.FormData(this.element).get("has_monthly_product") && document.addEventListener("checkoutReady", function(event) { 14082 window.dispatchEvent(new Event("blackbaudFlow")); 14083 }); 14084 } 14085 } ]), Cart; 14086 }(); 14087 }, {
14088 "./../../core/utilities/checkout.utilities": 15, 14089 "./../../core/utilities/gtm.utilities": 16, 14090 "./../../core/utilities/heifer.utilities": 19, 14091 "./../../shared/forms/paymentFields/paymentFields": 85, 14092 "./../../shared/forms/submitButton/submitButton": 88, 14093 "./cartCompany/cartCompany": 36, 14094 "./cartReview/cartReview": 38, 14095 "./cartShippingMethods/cartShippingMethods": 39, 14096 "./cartSummary/cartSummary": 40, 14097 "core-js/modules/es6.array.iterator": 241, 14098 "core-js/modules/es6.object.keys": 250, 14099 "core-js/modules/es6.object.to-string": 252, 14100 "core-js/modules/es6.regexp.replace": 259, 14101 "core-js/modules/es6.symbol": 268, 14102 "core-js/modules/es7.object.get-own-property-descriptors": 272, 14103 "core-js/modules/web.dom.iterable": 274 14104 } ], 14105 36: [ function(require, module, exports) { 14106 "use strict"; 14107 Object.defineProperty(exports, "__esModule", { 14108 value: !0 14109 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 14110 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 14111 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 14112 require("core-js/modules/es6.object.keys"); 14113 var _heifer = require("./../../../core/utilities/heifer.utilities"); 14114 function ownKeys(object, enumerableOnly) { 14115 var keys = Object.keys(object); 14116 if (Object.getOwnPropertySymbols) { 14117 var symbols = Object.getOwnPropertySymbols(object); 14118 enumerableOnly && (symbols = symbols.filter(function(sym) { 14119 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 14120 })), keys.push.apply(keys, symbols); 14121 } 14122 return keys; 14123 } 14124 function _defineProperty(obj, key, value) { 14125 return key in obj ? Object.defineProperty(obj, key, { 14126 value: value, 14127 enumerable: !0, 14128 configurable: !0, 14129 writable: !0 14130 }) : obj[key] = value, obj; 14131 } 14132 function _defineProperties(target, props) { 14133 for (var i = 0; i < props.length; i++) { 14134 var descriptor = props[i]; 14135 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 14136 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 14137 } 14138 } 14139 var cartCompany = function() { 14140 function cartCompany(element, options) { 14141 !function(instance, Constructor) { 14142 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 14143 }(this, cartCompany), this.element = element, this.$element = $(this.element), this._defaults = {}, 14144 this.settings = function(target) { 14145 for (var i = 1; i < arguments.length; i++) { 14146 var source = null != arguments[i] ? arguments[i] : {}; 14147 i % 2 ? ownKeys(source, !0).forEach(function(key) { 14148 _defineProperty(target, key, source[key]); 14149 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 14150 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 14151 }); 14152 } 14153 return target; 14154 }({}, this._defaults, {}, options), this.init(); 14155 } 14156 return function(Constructor, protoProps, staticProps) { 14157 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 14158 }(cartCompany, [ { 14159 key: "init", 14160 value: function() { 14161 this.companyChange(); 14162 } 14163 }, { 14164 key: "companyChange", 14165 value: function() { 14166 var _this = this; 14167 document.getElementById("hep-suggestive-input").addEventListener("change", function(ev) { 14168 var company, companyData = { 14169 companyId: document.getElementById("hep-id").value, 14170 company: company = document.getElementById("hep-suggestive-input").value 14171 }; 14172 0 < company.length && _this.companyUpdateCart(companyData); 14173 }); 14174 } 14175 }, { 14176 key: "companyUpdateCart", 14177 value: function(companyData) { 14178 (0, _heifer.uAjaxWithResponse)("POST", "/cart/company.html", !1, (0, _heifer.uJsonToQueryString)(companyData), "application/x-www-form-urlencoded; charset=UTF-8").then(function(response) { 14179 JSON.parse(response).errors.length; 14180 }).catch(function(err) {}); 14181 } 14182 } ]), cartCompany; 14183 }(); 14184 exports.default = cartCompany; 14185 }, {
14186 "./../../../core/utilities/heifer.utilities": 19, 14187 "core-js/modules/es6.array.iterator": 241, 14188 "core-js/modules/es6.object.keys": 250, 14189 "core-js/modules/es6.object.to-string": 252, 14190 "core-js/modules/es6.symbol": 268, 14191 "core-js/modules/es7.object.get-own-property-descriptors": 272, 14192 "core-js/modules/web.dom.iterable": 274 14193 } ], 14194 37: [ function(require, module, exports) { 14195 "use strict"; 14196 Object.defineProperty(exports, "__esModule", { 14197 value: !0 14198 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 14199 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 14200 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 14201 require("core-js/modules/es6.object.keys"); 14202 var _jquery = _interopRequireDefault(require("jquery")), _masonryLayout = _interopRequireDefault(require("masonry-layout")); 14203 function _interopRequireDefault(obj) { 14204 return obj && obj.__esModule ? obj : { 14205 default: obj 14206 }; 14207 } 14208 function ownKeys(object, enumerableOnly) { 14209 var keys = Object.keys(object); 14210 if (Object.getOwnPropertySymbols) { 14211 var symbols = Object.getOwnPropertySymbols(object); 14212 enumerableOnly && (symbols = symbols.filter(function(sym) { 14213 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 14214 })), keys.push.apply(keys, symbols); 14215 } 14216 return keys; 14217 } 14218 function _defineProperty(obj, key, value) { 14219 return key in obj ? Object.defineProperty(obj, key, { 14220 value: value, 14221 enumerable: !0, 14222 configurable: !0, 14223 writable: !0 14224 }) : obj[key] = value, obj; 14225 } 14226 function _defineProperties(target, props) { 14227 for (var i = 0; i < props.length; i++) { 14228 var descriptor = props[i]; 14229 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 14230 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 14231 } 14232 } 14233 var Confirmation = function() { 14234 function Confirmation(element, options) { 14235 !function(instance, Constructor) { 14236 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 14237 }(this, Confirmation), this.element = element, this.$element = (0, _jquery.default)(element); 14238 var defaults = {}; 14239 this._defaults = defaults, this.settings = function(target) { 14240 for (var i = 1; i < arguments.length; i++) { 14241 var source = null != arguments[i] ? arguments[i] : {}; 14242 i % 2 ? ownKeys(source, !0).forEach(function(key) { 14243 _defineProperty(target, key, source[key]); 14244 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 14245 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 14246 }); 14247 } 14248 return target; 14249 }({}, defaults, {}, options), this.bindEvents(), this.init(); 14250 } 14251 return function(Constructor, protoProps, staticProps) { 14252 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 14253 }(Confirmation, [ { 14254 key: "bindEvents", 14255 value: function() {} 14256 }, { 14257 key: "init", 14258 value: function() { 14259 this.masonryInit(); 14260 } 14261 }, { 14262 key: "masonryInit", 14263 value: function() { 14264 var elem = this.element; 14265 new _masonryLayout.default(elem, { 14266 itemSelector: ".js-masonry-card", 14267 columnWidth: 600 14268 }); 14269 } 14270 } ]), Confirmation; 14271 }(); 14272 exports.default = Confirmation; 14273 }, {
14274 "core-js/modules/es6.array.iterator": 241, 14275 "core-js/modules/es6.object.keys": 250, 14276 "core-js/modules/es6.object.to-string": 252, 14277 "core-js/modules/es6.symbol": 268, 14278 "core-js/modules/es7.object.get-own-property-descriptors": 272, 14279 "core-js/modules/web.dom.iterable": 274, 14280 jquery: 20, 14281 "masonry-layout": 283 14282 } ], 14283 38: [ function(require, module, exports) { 14284 "use strict"; 14285 Object.defineProperty(exports, "__esModule", { 14286 value: !0 14287 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 14288 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 14289 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 14290 require("core-js/modules/es6.object.keys"); 14291 var _jquery = _interopRequireDefault(require("jquery")), _heifer = (_interopRequireDefault(require("./../../../core/scroll/motif.herald")), 14292 require("./../../../core/utilities/heifer.utilities")); 14293 function _interopRequireDefault(obj) { 14294 return obj && obj.__esModule ? obj : { 14295 default: obj 14296 }; 14297 } 14298 function ownKeys(object, enumerableOnly) { 14299 var keys = Object.keys(object); 14300 if (Object.getOwnPropertySymbols) { 14301 var symbols = Object.getOwnPropertySymbols(object); 14302 enumerableOnly && (symbols = symbols.filter(function(sym) { 14303 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 14304 })), keys.push.apply(keys, symbols); 14305 } 14306 return keys; 14307 } 14308 function _defineProperty(obj, key, value) { 14309 return key in obj ? Object.defineProperty(obj, key, { 14310 value: value, 14311 enumerable: !0, 14312 configurable: !0, 14313 writable: !0 14314 }) : obj[key] = value, obj; 14315 } 14316 function _defineProperties(target, props) { 14317 for (var i = 0; i < props.length; i++) { 14318 var descriptor = props[i]; 14319 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 14320 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 14321 } 14322 } 14323 var CartReview = function() { 14324 function CartReview(element, options) { 14325 !function(instance, Constructor) { 14326 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 14327 }(this, CartReview), this.element = element, this.$element = (0, _jquery.default)(this.element), 14328 this.$window = (0, _jquery.default)(window); 14329 var defaults = {}; 14330 this._defaults = defaults, this.settings = function(target) { 14331 for (var i = 1; i < arguments.length; i++) { 14332 var source = null != arguments[i] ? arguments[i] : {}; 14333 i % 2 ? ownKeys(source, !0).forEach(function(key) { 14334 _defineProperty(target, key, source[key]); 14335 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 14336 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 14337 }); 14338 } 14339 return target; 14340 }({}, defaults, {}, options), this.init(); 14341 } 14342 return function(Constructor, protoProps, staticProps) { 14343 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 14344 }(CartReview, [ { 14345 key: "init", 14346 value: function() { 14347 this.initHerald(); 14348 } 14349 }, { 14350 key: "initHerald", 14351 value: function() { 14352 var _this = this; 14353 this.$window.herald({ 14354 events: [ { 14355 trigger: function() { 14356 return _this.$element.offset().top + _this.$element.outerHeight(); 14357 }, 14358 event: function(dir) { 14359 (0, _heifer.uIsLessThanMediumScreen)() && "down" === dir ? _this.stickButton() : _this.unstickButton(); 14360 }, 14361 repeat: !0 14362 }, { 14363 trigger: function() { 14364 var $parent = _this.$element.parent(); 14365 return $parent.offset().top + $parent.outerHeight() - _this.$window.outerHeight(); 14366 }, 14367 event: function(dir) { 14368 (0, _heifer.uIsLessThanMediumScreen)() ? "down" === dir ? _this.unstickButton() : _this.stickButton() : _this.unstickButton(); 14369 }, 14370 repeat: !0 14371 } ] 14372 }); 14373 } 14374 }, { 14375 key: "stickButton", 14376 value: function() { 14377 var _this2 = this; 14378 this.element.style.height = "".concat(this.element.offsetHeight, "px"), window.requestAnimationFrame(function() { 14379 (0, _heifer.uAddClass)(_this2.element, "is-sticky"); 14380 }); 14381 } 14382 }, { 14383 key: "unstickButton", 14384 value: function() { 14385 var _this3 = this; 14386 (0, _heifer.uRemoveClass)(this.element, "is-sticky"), window.requestAnimationFrame(function() { 14387 _this3.element.style.height = ""; 14388 }); 14389 } 14390 } ]), CartReview; 14391 }(); 14392 exports.default = CartReview; 14393 }, {
14394 "./../../../core/scroll/motif.herald": 3, 14395 "./../../../core/utilities/heifer.utilities": 19, 14396 "core-js/modules/es6.array.iterator": 241, 14397 "core-js/modules/es6.object.keys": 250, 14398 "core-js/modules/es6.object.to-string": 252, 14399 "core-js/modules/es6.symbol": 268, 14400 "core-js/modules/es7.object.get-own-property-descriptors": 272, 14401 "core-js/modules/web.dom.iterable": 274, 14402 jquery: 20 14403 } ], 14404 39: [ function(require, module, exports) { 14405 "use strict"; 14406 Object.defineProperty(exports, "__esModule", { 14407 value: !0 14408 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 14409 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 14410 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 14411 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.regexp.replace"); 14412 var obj, _jquery = (obj = require("jquery")) && obj.__esModule ? obj : { 14413 default: obj 14414 }; 14415 function ownKeys(object, enumerableOnly) { 14416 var keys = Object.keys(object); 14417 if (Object.getOwnPropertySymbols) { 14418 var symbols = Object.getOwnPropertySymbols(object); 14419 enumerableOnly && (symbols = symbols.filter(function(sym) { 14420 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 14421 })), keys.push.apply(keys, symbols); 14422 } 14423 return keys; 14424 } 14425 function _defineProperty(obj, key, value) { 14426 return key in obj ? Object.defineProperty(obj, key, { 14427 value: value, 14428 enumerable: !0, 14429 configurable: !0, 14430 writable: !0 14431 }) : obj[key] = value, obj; 14432 } 14433 function _defineProperties(target, props) { 14434 for (var i = 0; i < props.length; i++) { 14435 var descriptor = props[i]; 14436 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 14437 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 14438 } 14439 } 14440 var CartShippingMethods = function() { 14441 function CartShippingMethods(element, options) { 14442 !function(instance, Constructor) { 14443 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 14444 }(this, CartShippingMethods), this.element = element, this.$element = (0, _jquery.default)(element); 14445 var defaults = { 14446 inputSelector: ".js-cart-shipping-method-input", 14447 shippingCostSelector: ".js-cart-review-shipping", 14448 cartTotalSelector: ".js-cart__total" 14449 }; 14450 this._defaults = defaults, this.settings = function(target) { 14451 for (var i = 1; i < arguments.length; i++) { 14452 var source = null != arguments[i] ? arguments[i] : {}; 14453 i % 2 ? ownKeys(source, !0).forEach(function(key) { 14454 _defineProperty(target, key, source[key]); 14455 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 14456 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 14457 }); 14458 } 14459 return target; 14460 }({}, defaults, {}, options), this.init(); 14461 } 14462 return function(Constructor, protoProps, staticProps) { 14463 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 14464 }(CartShippingMethods, [ { 14465 key: "init", 14466 value: function() { 14467 this.inputs = this.element.querySelectorAll(this.settings.inputSelector), this.shippingCost = document.querySelector(this.settings.shippingCostSelector), 14468 this.cartTotal = document.querySelector(this.settings.cartTotalSelector), this.initialTotal = this.cartTotal.textContent, 14469 this.bindEvents(); 14470 } 14471 }, { 14472 key: "bindEvents", 14473 value: function() { 14474 var _this = this; 14475 [].forEach.call(this.inputs, function(input) { 14476 input.addEventListener("change", function(ev) { 14477 var selectedShippingCost = parseFloat(ev.target.dataset.shippingCost); 14478 if (("--" == _this.shippingCost.textContent.trim() || "FREE" == _this.shippingCost.textContent.trim() ? 0 : parseFloat(_this.shippingCost.textContent.replace(/\$|,/g, ""))) < selectedShippingCost && 0 < selectedShippingCost) { 14479 var newTotal = parseFloat(_this.initialTotal) + selectedShippingCost; 14480 _this.shippingCost.textContent = "$" + selectedShippingCost, _this.cartTotal.textContent = (Math.round(100 * newTotal) / 100).toFixed(2); 14481 } else { 14482 var _newTotal = parseFloat(_this.initialTotal) + selectedShippingCost; 14483 0 < selectedShippingCost ? (_this.shippingCost.textContent = "$" + selectedShippingCost, 14484 _this.cartTotal.textContent = (Math.round(100 * _newTotal) / 100).toFixed(2)) : (_this.shippingCost.textContent = "FREE", 14485 _this.cartTotal.textContent = _this.initialTotal); 14486 } 14487 }); 14488 }); 14489 } 14490 } ]), CartShippingMethods; 14491 }(); 14492 exports.default = CartShippingMethods; 14493 }, {
14494 "core-js/modules/es6.array.iterator": 241, 14495 "core-js/modules/es6.object.keys": 250, 14496 "core-js/modules/es6.object.to-string": 252, 14497 "core-js/modules/es6.regexp.replace": 259, 14498 "core-js/modules/es6.symbol": 268, 14499 "core-js/modules/es7.object.get-own-property-descriptors": 272, 14500 "core-js/modules/web.dom.iterable": 274, 14501 jquery: 20 14502 } ], 14503 40: [ function(require, module, exports) { 14504 "use strict"; 14505 Object.defineProperty(exports, "__esModule", { 14506 value: !0 14507 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 14508 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 14509 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 14510 require("core-js/modules/es6.object.keys"); 14511 var _jquery = _interopRequireDefault(require("jquery")), _cartSummaryItem = _interopRequireDefault(require("./cartSummaryItem/cartSummaryItem")), _heifer = require("./../../../core/utilities/heifer.utilities"), _dynamicResponsiveImages = require("./../../../core/images/dynamic-responsive-images"); 14512 function _interopRequireDefault(obj) { 14513 return obj && obj.__esModule ? obj : { 14514 default: obj 14515 }; 14516 } 14517 function ownKeys(object, enumerableOnly) { 14518 var keys = Object.keys(object); 14519 if (Object.getOwnPropertySymbols) { 14520 var symbols = Object.getOwnPropertySymbols(object); 14521 enumerableOnly && (symbols = symbols.filter(function(sym) { 14522 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 14523 })), keys.push.apply(keys, symbols); 14524 } 14525 return keys; 14526 } 14527 function _defineProperty(obj, key, value) { 14528 return key in obj ? Object.defineProperty(obj, key, { 14529 value: value, 14530 enumerable: !0, 14531 configurable: !0, 14532 writable: !0 14533 }) : obj[key] = value, obj; 14534 } 14535 function _defineProperties(target, props) { 14536 for (var i = 0; i < props.length; i++) { 14537 var descriptor = props[i]; 14538 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 14539 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 14540 } 14541 } 14542 var CartSummary = function() { 14543 function CartSummary(element, options) { 14544 !function(instance, Constructor) { 14545 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 14546 }(this, CartSummary), this.element = element, this.$element = (0, _jquery.default)(element); 14547 var defaults = {}; 14548 this._defaults = defaults, this.settings = function(target) { 14549 for (var i = 1; i < arguments.length; i++) { 14550 var source = null != arguments[i] ? arguments[i] : {}; 14551 i % 2 ? ownKeys(source, !0).forEach(function(key) { 14552 _defineProperty(target, key, source[key]); 14553 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 14554 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 14555 }); 14556 } 14557 return target; 14558 }({}, defaults, {}, options), this.summaryItems = this.getSummaryItems(), this.bindEvents(), 14559 this.init(); 14560 } 14561 return function(Constructor, protoProps, staticProps) { 14562 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 14563 }(CartSummary, [ { 14564 key: "bindEvents", 14565 value: function() {} 14566 }, { 14567 key: "init", 14568 value: function() { 14569 (0, _heifer.uTypeOf)("Function", this.settings.onInit) && this.settings.onInit(); 14570 } 14571 }, { 14572 key: "getSummaryItems", 14573 value: function() { 14574 var _this = this; 14575 return [].map.call(this.element.querySelectorAll(".js-cart-summary-item"), function(summaryItem) { 14576 new _cartSummaryItem.default(summaryItem, { 14577 onRemove: _this.settings.onSummaryItemRemove, 14578 onEdit: _this.settings.onSummaryItemEdit 14579 }), _this.showSummaryImages(summaryItem); 14580 }); 14581 } 14582 }, { 14583 key: "showSummaryImages", 14584 value: function(summaryItem) { 14585 var img = summaryItem.querySelector(".js-cart-summary-image"); 14586 (0, _dynamicResponsiveImages.loadDynamicImage)(img); 14587 } 14588 } ]), CartSummary; 14589 }(); 14590 exports.default = CartSummary; 14591 }, {
14592 "./../../../core/images/dynamic-responsive-images": 2, 14593 "./../../../core/utilities/heifer.utilities": 19, 14594 "./cartSummaryItem/cartSummaryItem": 41, 14595 "core-js/modules/es6.array.iterator": 241, 14596 "core-js/modules/es6.object.keys": 250, 14597 "core-js/modules/es6.object.to-string": 252, 14598 "core-js/modules/es6.symbol": 268, 14599 "core-js/modules/es7.object.get-own-property-descriptors": 272, 14600 "core-js/modules/web.dom.iterable": 274, 14601 jquery: 20 14602 } ], 14603 41: [ function(require, module, exports) { 14604 "use strict"; 14605 Object.defineProperty(exports, "__esModule", { 14606 value: !0 14607 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 14608 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 14609 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 14610 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.function.name"); 14611 var obj, _jquery = (obj = require("jquery")) && obj.__esModule ? obj : { 14612 default: obj 14613 }, _checkout = require("./../../../../core/utilities/checkout.utilities"), _heifer = require("./../../../../core/utilities/heifer.utilities"); 14614 function ownKeys(object, enumerableOnly) { 14615 var keys = Object.keys(object); 14616 if (Object.getOwnPropertySymbols) { 14617 var symbols = Object.getOwnPropertySymbols(object); 14618 enumerableOnly && (symbols = symbols.filter(function(sym) { 14619 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 14620 })), keys.push.apply(keys, symbols); 14621 } 14622 return keys; 14623 } 14624 function _defineProperty(obj, key, value) { 14625 return key in obj ? Object.defineProperty(obj, key, { 14626 value: value, 14627 enumerable: !0, 14628 configurable: !0, 14629 writable: !0 14630 }) : obj[key] = value, obj; 14631 } 14632 function _defineProperties(target, props) { 14633 for (var i = 0; i < props.length; i++) { 14634 var descriptor = props[i]; 14635 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 14636 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 14637 } 14638 } 14639 var CartSummaryItem = function() { 14640 function CartSummaryItem(element, options) { 14641 !function(instance, Constructor) { 14642 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 14643 }(this, CartSummaryItem), this.element = element, this.$element = (0, _jquery.default)(element); 14644 var defaults = { 14645 quantitySelector: ".js-cart-summary-item__quantity", 14646 amountSelector: ".js-cart-summary-item__amount", 14647 amountOutputSelector: ".js-cart-summary-item__amount-output", 14648 amountNumberSelector: ".js-cart-summary-item__amount-number", 14649 totalSelector: ".js-cart-summary-item__total", 14650 removeButtonSelector: ".js-cart-summary-item__remove-button", 14651 productDataSelector: ".js-cart-summary-item__product-data", 14652 editAmountSelector: ".js-cart-summary-item__edit-amount", 14653 editAmountButtonSelector: ".js-cart-summary-item__edit-amount-button", 14654 saveAmountButtonSelector: ".js-cart-summary-item__save-amount-button" 14655 }; 14656 this._defaults = defaults, this.settings = function(target) { 14657 for (var i = 1; i < arguments.length; i++) { 14658 var source = null != arguments[i] ? arguments[i] : {}; 14659 i % 2 ? ownKeys(source, !0).forEach(function(key) { 14660 _defineProperty(target, key, source[key]); 14661 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 14662 Object.defineProperty(target, key, Ob
14662ject.getOwnPropertyDescriptor(source, key)); 14663 }); 14664 } 14665 return target; 14666 }({}, defaults, {}, options), this.quantity = this.element.querySelector(this.settings.quantitySelector), 14667 this.amount = this.element.querySelector(this.settings.amountSelector), this.total = this.element.querySelector(this.settings.totalSelector), 14668 this.removeButton = this.element.querySelector(this.settings.removeButtonSelector), 14669 this.amountOutput = this.element.querySelector(this.settings.amountOutputSelector), 14670 this.editAmount = this.element.querySelector(this.settings.editAmountSelector), 14671 this.editAmountButton = this.element.querySelector(this.settings.editAmountButtonSelector), 14672 this.saveAmountButton = this.element.querySelector(this.settings.saveAmountButtonSelector), 14673 this.productData = this.element.querySelector(this.settings.productDataSelector), 14674 this.originalProductType = (0, _checkout.getProductData)(this.productData, "type"), 14675 null != this.element.querySelector(this.settings.editAmountSelector) ? this.donationMinimum = this.element.querySelector(this.settings.editAmountSelector).min : this.donationMinimum = 10, 14676 this.amount && (this.amount = parseFloat(this.amount.getAttribute("data-amount"), 10)), 14677 this.hasEditCallback = (0, _heifer.uTypeOf)("Function", this.settings.onEdit), this.bindEvents(), 14678 this.init(); 14679 } 14680 return function(Constructor, protoProps, staticProps) { 14681 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 14682 }(CartSummaryItem, [ { 14683 key: "bindEvents", 14684 value: function() { 14685 var _this = this; 14686 this.element.addEventListener("input", function(ev) { 14687 var target = ev.target, _this$settings = _this.settings, quantitySelector = _this$settings.quantitySelector, editAmountSelector = _this$settings.editAmountSelector; 14688 (0, _heifer.uIs)(target, quantitySelector) ? _this.handleQuantityChange() : !_this.saveAmountButton && (0, 14689 _heifer.uIs)(target, editAmountSelector) ? _this.handleAmountChange() : "checkbox" === target.type || "radio" === target.type ? _this.handleCheckboxChange(target) : (0, 14690 _heifer.uIs)(target, editAmountSelector) && _this.handleSaveAmountButtonState(ev); 14691 }), this.element.addEventListener("click", function(ev) { 14692 var target = ev.target, _this$settings2 = _this.settings, saveAmountButtonSelector = _this$settings2.saveAmountButtonSelector, editAmountButtonSelector = _this$settings2.editAmountButtonSelector, removeButtonSelector = _this$settings2.removeButtonSelector; 14693 _this.editAmount && (0, _heifer.uIs)(target, saveAmountButtonSelector) && _this.handleSaveAmountButtonClick(), 14694 _this.editAmount && _this.amountOutput && (0, _heifer.uIs)(target, editAmountButtonSelector) && _this.showEditAmount(), 14695 (0, _heifer.uIs)(target, removeButtonSelector) && (0, _heifer.uTypeOf)("Function", _this.settings.onRemove) && _this.settings.onRemove(_this); 14696 }); 14697 } 14698 }, { 14699 key: "updateProductWithQuantity", 14700 value: function() { 14701 var quantity = this.quantity.value, totalValue = parseInt(quantity, 10) * this.amount; 14702 this.total.innerText = (0, _checkout.getPrettyAmount)(totalValue), this.updateItemProductData({ 14703 quantity: quantity 14704 }); 14705 } 14706 }, { 14707 key: "updateProductWithAmount", 14708 value: function() { 14709 var amount = this.editAmount.value; 14710 this.total.innerText = (0, _checkout.getPrettyAmount)(parseFloat(amount, 10)), this.element.querySelector(this.settings.amountSelector).innerText = (0, 14711 _checkout.getPrettyAmount)(parseFloat(amount, 10)), this.updateItemProductData({ 14712 amount: amount 14713 }); 14714 } 14715 }, { 14716 key: "init", 14717 value: function() { 14718 this.updateMonthly(); 14719 } 14720 }, { 14721 key: "updateMonthly", 14722 value: function() { 14723 this.element.dataset.isMonthly ? this.updateItemProductData({ 14724 isMonthly: 1, 14725 type: "gift_catalog_donation" 14726 }) : this.updateItemProductData({ 14727 isMonthly: 0, 14728 type: this.originalProductType 14729 }); 14730 } 14731 }, { 14732 key: "handleQuantityChange", 14733 value: function() { 14734 var quantity = this.quantity.value; 14735 0 == quantity || isNaN(quantity) || (this.updateProductWithQuantity(), this.hasEditCallback && this.settings.onEdit(this)); 14736 } 14737 }, { 14738 key: "handleAmountChange", 14739 value: function() { 14740 this.updateProductWithAmount(), this.hasEditCallback && this.settings.onEdit(this); 14741 } 14742 }, { 14743 key: "handleCheckboxChange", 14744 value: function(target) { 14745 var update = {}; 14746 update[target.name] = target.checked ? 1 : 0, this.updateItemProductData(update), 14747 this.hasEditCallback && this.settings.onEdit(this); 14748 } 14749 }, { 14750 key: "handleSaveAmountButtonState", 14751 value: function(ev) { 14752 var value = parseFloat(ev.target.value); 14753 value < this.donationMinimum || isNaN(value) ? this.saveAmountButton.disabled = !0 : this.saveAmountButton.disabled = !1; 14754 } 14755 }, { 14756 key: "handleSaveAmountButtonClick", 14757 value: function() { 14758 this.updateProductWithAmount(), this.saveEditAmount(), this.hasEditCallback && this.settings.onEdit(this); 14759 } 14760 }, {
14761 key: "showEditAmount", 14762 value: function() { 14763 this.editAmount.disabled = !1, this.editAmount.classList.add("is-editing"), this.editAmountButton.disabled = !0, 14764 this.editAmountButton.classList.add("is-editing"), this.saveAmountButton.disabled = !1, 14765 this.saveAmountButton.classList.add("is-editing"), this.amountOutput.classList.add("is-editing"); 14766 } 14767 }, { 14768 key: "saveEditAmount", 14769 value: function() { 14770 this.editAmount.disabled = !0, this.editAmount.classList.remove("is-editing"), this.editAmountButton.disabled = !1, 14771 this.editAmountButton.classList.remove("is-editing"), this.saveAmountButton.disabled = !0, 14772 this.saveAmountButton.classList.remove("is-editing"), this.amountOutput.classList.remove("is-editing"); 14773 } 14774 }, { 14775 key: "updateItemProductData", 14776 value: function(update) { 14777 (0, _checkout.updateProductData)(this.productData, update); 14778 } 14779 } ]), CartSummaryItem; 14780 }(); 14781 exports.default = CartSummaryItem; 14782 }, { 14783 "./../../../../core/utilities/checkout.utilities": 15, 14784 "./../../../../core/utilities/heifer.utilities": 19, 14785 "core-js/modules/es6.array.iterator": 241, 14786 "core-js/modules/es6.function.name": 244, 14787 "core-js/modules/es6.object.keys": 250, 14788 "core-js/modules/es6.object.to-string": 252, 14789 "core-js/modules/es6.symbol": 268, 14790 "core-js/modules/es7.object.get-own-property-descriptors": 272, 14791 "core-js/modules/web.dom.iterable": 274, 14792 jquery: 20 14793 } ], 14794 42: [ function(require, module, exports) { 14795 "use strict"; 14796 Object.defineProperty(exports, "__esModule", { 14797 value: !0 14798 }), exports.default = function() { 14799 wrapper = document.querySelector(".js-giftCard-datepicker"), filterGiftMessage(), 14800 today = new Date(), datepickerWrapper = wrapper.querySelector(".js-giftCard-datepicker-wrapper"), 14801 datepickerInput = wrapper.querySelector(".js-giftCard-datepicker-input"), datepickerText = wrapper.querySelector(".js-giftCard-datepicker-text"), 14802 datepicker = new _flatpickr.default(datepickerInput, { 14803 defaultDate: today, 14804 minDate: today, 14805 dateFormat: "Y-m-d", 14806 altFormat: "F j, Y", 14807 appendTo: datepickerWrapper, 14808 position: "below", 14809 onPreCalendarPosition: function() { 14810 setTimeout(function() { 14811 datepicker.calendarContainer.style = ""; 14812 }, 0); 14813 }, 14814 onOpen: function() { 14815 (0, _heifer.uAddClass)(datepickerText, "is-active"); 14816 }, 14817 onClose: function(selectedDates, dateStr, instance) { 14818 (function(date, format) { 14819 datepickerText.textContent = datepicker.formatDate(date, format); 14820 })(instance.selectedDates[0], instance.config.altFormat), (0, _heifer.uRemoveClass)(datepickerText, "is-active"); 14821 } 14822 }), filterGiftMessage(); 14823 }, require("core-js/modules/es6.regexp.match"); 14824 var wrapper, today, datepicker, datepickerWrapper, datepickerInput, datepickerText, message, regex, giftCardRecipient, giftCardRecipientEmail, giftCardSender, printGiftCardRecipient, printGiftCardSender, _flatpickr = _interopRequireDefault(require("flatpickr")), _heifer = (_interopRequireDefault(require("../../shared/forms/inputFilled/inputFilled")), 14825 require("./../../core/utilities/heifer.utilities")); 14826 function _interopRequireDefault(obj) { 14827 return obj && obj.__esModule ? obj : { 14828 default: obj 14829 }; 14830 } 14831 function filterGiftMessage() { 14832 message = document.querySelector(".giftCardMessage"), giftCardRecipient = document.querySelector(".giftCardRecipient"), 14833 printGiftCardRecipient = document.querySelector(".printGiftCardRecipient"), giftCardRecipientEmail = document.querySelector(".giftCardRecipientEmail"), 14834 giftCardSender = document.querySelector(".giftCardSender"), printGiftCardSender = document.querySelector(".printGiftCardSender"), 14835 regex = /^[a-zA-Z0-9 !@#$%^&*()\n.,<>{}[\]<>?_=+\-|;:\'\"\/]*$/, [ giftCardRecipient, giftCardRecipientEmail, giftCardSender, printGiftCardSender, printGiftCardRecipient, message ].forEach(function(element) { 14836 element.addEventListener("focusout", function() { 14837 element.value.match(regex) && "" == !element.value ? element.setCustomValidity("") : "" == element.value && element.value.match(regex) ? (element.setCustomValidity("Invalid field."), 14838 element.setAttribute("data-gauntlet-error", "Please complete this required field.")) : element.value.match(regex) || (element.setCustomValidity("Invalid field."), 14839 element.setAttribute("data-gauntlet-error", "Please refrain from the use of emojis or other special characters.")); 14840 }); 14841 }), message.addEventListener("focusout", function() { 14842 message.value.match(regex) || "" == message.value ? message.setCustomValidity("") : (message.setCustomValidity("Invalid field."), 14843 message.setAttribute("error", "Please refrain from the use of emojis or other special characters.")); 14844 }); 14845 } 14846 }, {
14847 "../../shared/forms/inputFilled/inputFilled": 81, 14848 "./../../core/utilities/heifer.utilities": 19, 14849 "core-js/modules/es6.regexp.match": 258, 14850 flatpickr: 278 14851 } ], 14852 43: [ function(require, module, exports) { 14853 "use strict"; 14854 Object.defineProperty(exports, "__esModule", { 14855 value: !0 14856 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 14857 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 14858 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 14859 require("core-js/modules/es6.object.keys"); 14860 var obj, _gauntlet = (obj = require("./../../core/forms/gauntlet.js")) && obj.__esModule ? obj : { 14861 default: obj 14862 }, _heifer = require("./../../core/utilities/heifer.utilities"); 14863 function ownKeys(object, enumerableOnly) { 14864 var keys = Object.keys(object); 14865 if (Object.getOwnPropertySymbols) { 14866 var symbols = Object.getOwnPropertySymbols(object); 14867 enumerableOnly && (symbols = symbols.filter(function(sym) { 14868 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 14869 })), keys.push.apply(keys, symbols); 14870 } 14871 return keys; 14872 } 14873 function _defineProperty(obj, key, value) { 14874 return key in obj ? Object.defineProperty(obj, key, { 14875 value: value, 14876 enumerable: !0, 14877 configurable: !0, 14878 writable: !0 14879 }) : obj[key] = value, obj; 14880 } 14881 function _defineProperties(target, props) { 14882 for (var i = 0; i < props.length; i++) { 14883 var descriptor = props[i]; 14884 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 14885 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 14886 } 14887 } 14888 var giftCardActivation = function() { 14889 function giftCardActivation(element, options) { 14890 !function(instance, Constructor) { 14891 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 14892 }(this, giftCardActivation), this.element = element; 14893 var defaults = {}; 14894 this._defaults = defaults, this.settings = function(target) { 14895 for (var i = 1; i < arguments.length; i++) { 14896 var source = null != arguments[i] ? arguments[i] : {}; 14897 i % 2 ? ownKeys(source, !0).forEach(function(key) { 14898 _defineProperty(target, key, source[key]); 14899 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 14900 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 14901 }); 14902 } 14903 return target; 14904 }({}, defaults, {}, options), this.form = this.element, this.init(); 14905 } 14906 return function(Constructor, protoProps, staticProps) { 14907 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 14908 }(giftCardActivation, [ { 14909 key: "init", 14910 value: function() { 14911 this.setFormListener(), this.gauntlet = new _gauntlet.default(this.element); 14912 } 14913 }, { 14914 key: "setFormListener", 14915 value: function() { 14916 var _this = this; 14917 this.form.addEventListener("submit", function(ev) { 14918 _this.processForm(), ev.preventDefault(); 14919 }); 14920 } 14921 }, { 14922 key: "processForm", 14923 value: function() { 14924 var firstName, lastName, email, giftCardCode, messageBox, giftCardActivationBtn, _this2 = this; 14925 firstName = this.form.querySelector('[name="gca__firstName"]') ? this.form.querySelector('[name="gca__firstName"]').value : "", 14926 lastName = this.form.querySelector('[name="gca__lastName"]') ? this.form.querySelector('[name="gca__lastName"]').value : "", 14927 email = this.form.querySelector('[name="gca__email"]') ? this.form.querySelector('[name="gca__email"]').value : "", 14928 giftCardCode = this.form.querySelector('[name="gca__cardCode"]').value, (messageBox = this.form.querySelector(".giftCardErrorMessage")).setAttribute("hidden", ""), 14929 giftCardActivationBtn = this.form.querySelector(".giftCardActivation__button"); 14930 var formData = { 14931 firstName: firstName, 14932 lastName: lastName, 14933 email: email, 14934 giftCardCode: giftCardCode 14935 }; 14936 (0, _heifer.uAjaxWithResponse)("POST", "/api/giftcard/validate.html", !0, (0, _heifer.uJsonToQueryString)(formData), "application/x-www-form-urlencoded; charset=UTF-8").then(function(response) { 14937 var responseObject = JSON.parse(response); 14938 1 === responseObject.valid ? giftCardActivationBtn.classList.contains("js-thotm-giftCard-activation") ? window.location.href = "/gift-catalog/Take-Hunger-off-the-Menu/take-hunger-off-the-menu-category.html?giftCardActive=1" : giftCardActivationBtn.classList.contains("js-earth-giftCard-activation") ? window.location.href = "/gift-catalog/caring-for-the-earth/index.html?giftCardActive=1" : giftCardActivationBtn.classList.contains("js-women-giftCard-activation") ? window.location.href = "/gift-catalog/womens-empowerment/index.html?giftCardActive=1" : giftCardActivationBtn.classList.contains("js-animals-giftCard-activation") ? window.location.href = "/gift-catalog/animals/index.html?giftCardActive=1" : window.location.href = "/gift-catalog/index.html?giftCardActive=1" : 2 === responseObject.valid ? (messageBox.textContent = "Invalid Email. Must provide email used to open Gift Card.", 14939 messageBox.removeAttribute("hidden")) : _this2.gauntlet.setInputAsInvali
14939d(_this2.form.querySelector('[name="gca__cardCode"]')); 14940 }); 14941 } 14942 } ]), giftCardActivation; 14943 }(); 14944 exports.default = giftCardActivation; 14945 }, { 14946 "./../../core/forms/gauntlet.js": 1, 14947 "./../../core/utilities/heifer.utilities": 19, 14948 "core-js/modules/es6.array.iterator": 241, 14949 "core-js/modules/es6.object.keys": 250, 14950 "core-js/modules/es6.object.to-string": 252, 14951 "core-js/modules/es6.symbol": 268, 14952 "core-js/modules/es7.object.get-own-property-descriptors": 272, 14953 "core-js/modules/web.dom.iterable": 274 14954 } ], 14955 44: [ function(require, module, exports) { 14956 "use strict"; 14957 Object.defineProperty(exports, "__esModule", { 14958 value: !0 14959 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 14960 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 14961 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 14962 require("core-js/modules/es6.object.keys"); 14963 var _jquery = _interopRequireDefault(require("jquery")), _heifer = _interopRequireDefault(require("../../core/ui/heifer.carousel")); 14964 function _interopRequireDefault(obj) { 14965 return obj && obj.__esModule ? obj : { 14966 default: obj 14967 }; 14968 } 14969 function ownKeys(object, enumerableOnly) { 14970 var keys = Object.keys(object); 14971 if (Object.getOwnPropertySymbols) { 14972 var symbols = Object.getOwnPropertySymbols(object); 14973 enumerableOnly && (symbols = symbols.filter(function(sym) { 14974 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 14975 })), keys.push.apply(keys, symbols); 14976 } 14977 return keys; 14978 } 14979 function _defineProperty(obj, key, value) { 14980 return key in obj ? Object.defineProperty(obj, key, { 14981 value: value, 14982 enumerable: !0, 14983 configurable: !0, 14984 writable: !0 14985 }) : obj[key] = value, obj; 14986 } 14987 function _defineProperties(target, props) { 14988 for (var i = 0; i < props.length; i++) { 14989 var descriptor = props[i]; 14990 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 14991 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 14992 } 14993 } 14994 var GiftCatalog = function() { 14995 function GiftCatalog(element, options) { 14996 !function(instance, Constructor) { 14997 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 14998 }(this, GiftCatalog), this.element = element, this.$element = (0, _jquery.default)(this.element), 14999 this._defaults = {}, this.settings = function(target) { 15000 for (var i = 1; i < arguments.length; i++) { 15001 var source = null != arguments[i] ? arguments[i] : {}; 15002 i % 2 ? ownKeys(source, !0).forEach(function(key) { 15003 _defineProperty(target, key, source[key]); 15004 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 15005 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 15006 }); 15007 } 15008 return target; 15009 }({}, this._defaults, {}, options), this.init(); 15010 } 15011 return function(Constructor, protoProps, staticProps) { 15012 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 15013 }(GiftCatalog, [ { 15014 key: "init", 15015 value: function() { 15016 this.carousel = new _heifer.default(this.element, { 15017 visibleSlides: { 15018 0: 1, 15019 480: 1, 15020 768: 3 15021 } 15022 }); 15023 } 15024 } ]), GiftCatalog; 15025 }(); 15026 exports.default = GiftCatalog; 15027 }, {
15028 "../../core/ui/heifer.carousel": 7, 15029 "core-js/modules/es6.array.iterator": 241, 15030 "core-js/modules/es6.object.keys": 250, 15031 "core-js/modules/es6.object.to-string": 252, 15032 "core-js/modules/es6.symbol": 268, 15033 "core-js/modules/es7.object.get-own-property-descriptors": 272, 15034 "core-js/modules/web.dom.iterable": 274, 15035 jquery: 20 15036 } ], 15037 45: [ function(require, module, exports) { 15038 "use strict"; 15039 Object.defineProperty(exports, "__esModule", { 15040 value: !0 15041 }), exports.default = function() { 15042 !function() { 15043 var galleries = [].map.call(document.querySelectorAll(".js-gift-catalog-product-gallery"), function(el) { 15044 return (0, _giftCatalogProductGallery.default)(el); 15045 }); 15046 [].forEach.call(document.querySelectorAll(".js-product-cta"), function(el) { 15047 return new GiftCatalogProductCTA(el, { 15048 galleries: galleries 15049 }); 15050 }); 15051 }(); 15052 }, require("core-js/modules/es7.object.get-own-property-descriptors"), require("core-js/modules/es6.symbol"), 15053 require("core-js/modules/web.dom.iterable"), require("core-js/modules/es6.array.iterator"), 15054 require("core-js/modules/es6.object.to-string"), require("core-js/modules/es6.object.keys"), 15055 require("core-js/modules/es6.function.name"); 15056 var _checkout = require("./../../core/utilities/checkout.utilities"), _heifer = require("./../../core/utilities/heifer.utilities"), _minicart = (require("./../../core/utilities/a11y"), 15057 _interopRequireDefault(require("./../../shared/minicart/minicart"))), _giftCatalogProductGallery = _interopRequireDefault(require("./giftCatalogProductGallery/giftCatalogProductGallery")), _submitButton = _interopRequireDefault(require("./../../shared/forms/submitButton/submitButton")); 15058 function _interopRequireDefault(obj) { 15059 return obj && obj.__esModule ? obj : { 15060 default: obj 15061 }; 15062 } 15063 function ownKeys(object, enumerableOnly) { 15064 var keys = Object.keys(object); 15065 if (Object.getOwnPropertySymbols) { 15066 var symbols = Object.getOwnPropertySymbols(object); 15067 enumerableOnly && (symbols = symbols.filter(function(sym) { 15068 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 15069 })), keys.push.apply(keys, symbols); 15070 } 15071 return keys; 15072 } 15073 function _objectSpread(target) { 15074 for (var i = 1; i < arguments.length; i++) { 15075 var source = null != arguments[i] ? arguments[i] : {}; 15076 i % 2 ? ownKeys(source, !0).forEach(function(key) { 15077 _defineProperty(target, key, source[key]); 15078 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 15079 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 15080 }); 15081 } 15082 return target; 15083 } 15084 function _defineProperty(obj, key, value) { 15085 return key in obj ? Object.defineProperty(obj, key, { 15086 value: value, 15087 enumerable: !0, 15088 configurable: !0, 15089 writable: !0 15090 }) : obj[key] = value, obj; 15091 } 15092 function _defineProperties(target, props) { 15093 for (var i = 0; i < props.length; i++) { 15094 var descriptor = props[i]; 15095 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 15096 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 15097 } 15098 } 15099 var GiftCatalogProductCTA = function() { 15100 function GiftCatalogProductCTA(element, options) { 15101 !function(instance, Constructor) { 15102 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 15103 }(this, GiftCatalogProductCTA), this.element = element; 15104 var defaults = { 15105 tooltip: "", 15106 tooltipValue: "", 15107 tooltipUnit: "" 15108 }; 15109 this._defaults = defaults, this.settings = _objectSpread({}, defaults, {}, options), 15110 this.form = this.element, this.formType = this.form.dataset.formType, this.formExtraFields = this.form.querySelectorAll(".js-product-extraField"), 15111 this.product = this.form.querySelector(".js-product-item"), this.quantityInput = this.form.querySelector(".js-product-quantity"), 15112 this.multipleQuantityInput = this.form.querySelector(".js-multiple-product-quantity"), 15113 this.frequencyInput = this.form.querySelectorAll(".js-frequency"), this.unitShare = this.form.dataset.unitShare, 15114 this.unitFull = this.form.dataset.unitFull, this.quantityAmount = this.form.dataset.quantityAmount, 15115 this.inputWrapper = this.form.querySelector(".js-product-input-wrapper"), this.multiplesShowLink = this.form.querySelector(".js-product-multiples-show"), 15116 this.multiplesWrapper = this.form.querySelector(".js-product-multiples"), this.subtotal = this.form.querySelector(".js-product-subtotal"), 15117 this.miniCartWrapper = document.querySelector(".js-mini-cart-wrapper"), this.stateSwap = this.element.querySelector(".js-state-swap"), 15118 this.stateWrapper = (0, _heifer.uClosest)(this.element, ".js-product-cta-state-wrapper"), 15119 this.getButtons(), this.variationsPrice = window.Heifer.variationsPrice, this.variationsSoldOut = window.Heifer.variationsSoldOut, 15120 this.variationsLowInventory = window.Heifer.variationsLowInventory, this.variationsDropdown = this.form.querySelector(".js-variations"), 15121 this.variationsText = this.form.querySelector(".js-variations-price"), this.variationsMessage = this.form.querySelector(".js-variations-message"), 15122 this.variationsImage = document.querySelectorAll(".js-marketplace-slide"), this.variationsButton = this.form.querySelector(".js-product-add-to-basket"), 15123 this.basketBadge = window.document.querySelector(".js-basket-badge"), this.submitButton = new _submitButton.default(this.variationsButton), 15124 this.catalogWrapper = document.querySelector(".js-gift-catalog"), this.gcTabs = this.catalogWrapper ? this.catalogWrapper.querySelector(".js-gift-catalog-tabs") : null, 15125 this.gcTabButtons = this.gcTabs ? this.gcTabs.querySelectorAll(".js-gift-catalog-tab") : null, 15126 this.defaultTab = this.gcTabs ? this.gcTabs.querySelector(".is-default") : null, 15127 this.originalProductType = (0, _checkout.getProductData)(this.product, "type"), 15128 this.originalFormType = this.formType, this.originalPriceFull = (0, _checkout.getProductData)(this.product, "price_full"), 15129 this.originalPriceShare = (0, _checkout.getProductData)(this.product, "price_share"), 15130 this.originalAmount = (0, _checkout.getProductData)(this.product, "amount"), this.originalShareUnit = this.unitShare, 15131 this.init(); 15132 } 15133 return function(Constructor, protoProps, staticProps) { 15134 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 15135 }(GiftCatalogProductCTA, [ { 15136 key: "init", 15137 value: function() { 15138 console.log("***GIFT CATALOG PRODUCT***"), this.setTabListeners(), this.setEventListeners(), 15139 "slider" === this.formType && this.quantityAmount ? this.updateAmount() : "buttons" === this.formType ? this.updateAmountFromButtons() : (this.updateMultipleAmount(this.isMultiple()), 15140 this.isMultiple() ? this.updateMultipleQuantity() : this.updateQuantity()), this.defaultTab && this.updateProductMonthlyInfo(this.defaultTab), 15141 this.updateSubtotal(), this.updateFrequency(); 15142 } 15143 }, { 15144 key: "getButtons", 15145 value: function() { 15146 "buttons" === this.formType && (this.buttons = this.form.querySelectorAll(".js-gift-catalog-product-button"), 15147 this.buttonOther = this.form.querySelector(".js-button-input-input")); 15148 } 15149 }, { 15150 key: "setEventListeners", 15151 value: function() { 15152 var _this = this; 15153 this.form.addEventListener("submit", function(ev) { 15154 _this.addToBasket(_this.product), ev.preventDefault(); 15155 }), this.setInputListeners(), this.variationsDropdown && (this.form.addEventListener("change", function(ev) {
15156 _this.updateVariationAll(); 15157 }), this.updateVariationAll()), this.setSliderListeners(), this.setButtonListeners(), 15158 this.stateSwap && this.stateWrapper && this.stateSwap.addEventListener("click", function(e) { 15159 (0, _heifer.uToggleClass)(_this.stateWrapper, "is-multiple"), _this.updateMultipleAmount(_this.isMultiple()), 15160 (0, _heifer.uHasClass)(_this.stateWrapper, "is-multiple") || (_this.multipleQuantityInput.value = 1, 15161 _this.multipleQuantityInput.dispatchEvent((0, _heifer.uCreateEvent)("input"))), 15162 _this.isMultiple() ? _this.updateMultipleQuantity() : _this.updateQuantity(), _this.updateSubtotal(); 15163 }); 15164 var otherAmount = document.getElementById("giftCardOtherAmount"); 15165 null != otherAmount && otherAmount.addEventListener("change", function(e) { 15166 (0, _checkout.updateProductData)(_this.product, { 15167 amount: e.target.value 15168 }); 15169 }); 15170 var that = this; 15171 $(window).on("update-product-amount", function(e) { 15172 that.updateAmount(); 15173 }); 15174 } 15175 }, { 15176 key: "setTabListeners", 15177 value: function() { 15178 var _this2 = this; 15179 this.gcTabs && this.gcTabButtons && [].forEach.call(this.gcTabButtons, function(tab) { 15180 tab.addEventListener("click", function(ev) { 15181 _this2.updateProductMonthlyInfo(tab); 15182 }); 15183 }); 15184 } 15185 }, { 15186 key: "setInputListeners", 15187 value: function() { 15188 var _this3 = this; 15189 this.form.addEventListener("input", function(ev) { 15190 var target = ev.target; 15191 target === _this3.quantityInput && ("slider" === _this3.formType && _this3.quantityAmount ? _this3.updateAmount() : "buttons" === _this3.formType ? _this3.updateAmountFromButtons() : (_this3.updateMultipleAmount(_this3.isMultiple()), 15192 _this3.isMultiple() ? _this3.updateMultipleQuantity() : _this3.updateQuantity()), 15193 _this3.updateSubtotal()), target === _this3.multipleQuantityInput && (_this3.updateMultipleQuantity(target), 15194 _this3.updateSubtotal()), [].forEach.call(_this3.frequencyInput, function(el) { 15195 target === el && _this3.updateFrequency(); 15196 }), "orderHonoree" == target.name && (target.value = target.checked ? "1" : ""); 15197 }); 15198 } 15199 }, { 15200 key: "setButtonListeners", 15201 value: function() { 15202 var _this4 = this; 15203 "buttons" === this.formType && ([].forEach.call(this.buttons, function(btn) { 15204 btn.removeEventListener("click", function(ev) { 15205 _this4.updateAmountFromButtons(ev.target); 15206 }), btn.addEventListener("click", function(ev) { 15207 _this4.updateAmountFromButtons(ev.target); 15208 }); 15209 }), this.buttonOther.removeEventListener("change", function(ev) { 15210 _this4.updateAmountFromButtons(ev.target); 15211 }), this.buttonOther.addEventListener("change", function(ev) { 15212 _this4.updateAmountFromButtons(ev.target); 15213 })); 15214 } 15215 }, { 15216 key: "setSliderListeners", 15217 value: function() { 15218 var _this5 = this; 15219 "slider" === this.formType && (this.form.dataset.priceDefault === this.form.dataset.priceFull && this.updateTooltipMax(), 15220 this.multiplesShowLink && this.multiplesShowLink.addEventListener("click", function(e) { 15221 (0, _heifer.uRemoveClass)(e.target, "is-active"), (0, _heifer.uAddClass)(_this5.multiplesWrapper, "is-active"), 15222 (0, _heifer.uAddClass)(_this5.multiplesWrapper, "was-active"), (0, _heifer.uAddClass)(_this5.inputWrapper, "showing-input"), 15223 (0, _heifer.uToggleClass)(_this5.stateWrapper, "is-single"); 15224 }), window.addEventListener("input-slider-min", this.updateTooltipMin.bind(this)), 15225 window.addEventListener("input-slider-max", this.updateTooltipMax.bind(this)), window.addEventListener("input-slider-change", function() { 15226 (0, _heifer.uHasClass)(_this5.inputWrapper, "is-active") && _this5.hideContainer(_this5.inputWrapper); 15227 })); 15228 } 15229 }, { 15230 key: "addToBasket", 15231 value: function(product) { 15232 var productData, _this6 = this; 15233 productData = this.formExtraFields ? _objectSpread({}, JSON.parse(product.value), {}, this.getExtraFields(), {}, { 15234 userAgent: navigator.userAgent 15235 }) : JSON.parse(product.value), (0, _checkout.onCartAdd)(productData); 15236 (0, _heifer.uAjaxWithResponse)("POST", _checkout.CART_ADD_PRODUCT_URL, !0, (0, _heifer.uJsonToQueryString)(productData), "application/x-www-form-urlencoded; charset=UTF-8").then(function(response) { 15237 var responseObject = JSON.parse(response), cartCount = responseObject.response.body.cart.userCart.cartItemCount; 15238 _this6.miniCartWrapper.innerHTML = responseObject.html, new _minicart.default(_this6.miniCartWrapper.querySelector(".js-mini-cart")), 15239 (0, _heifer.uStopPageScrollable)(), _this6.submitButton.reset(), (0, _heifer.uHasClass)(_this6.basketBadge, "has-count") || (0, 15240 _heifer.uAddClass)(_this6.basketBadge, "has-count"), _this6.basketBadge.textContent = cartCount; 15241 }).catch(function(error) { 15242 console.error(error), _this6.submitButton.reset(); 15243 }); 15244 } 15245 }, { 15246 key: "updateQuantity", 15247 value: function(argument_0) { 15248 var input = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.quantityInput; 15249 input && ((0, _checkout.updateProductData)(this.product, { 15250 quantity: input.value 15251 }), this.form.dataset.quantity = input.value); 15252 } 15253 }, { 15254 key: "updateMultipleQuantity", 15255 value: function(argument_0) { 15256 var input = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.multipleQuantityInput; 15257 input && ((0, _checkout.updateProductData)(this.product, { 15258 quantity: input.value 15259 }), this.form.dataset.quantity = input.value); 15260 } 15261 }, { 15262 key: "updateMultipleAmount", 15263 value: function(argument_0) { 15264 var isMultiple = !(0 < arguments.length && void 0 !== argument_0) || argument_0; 15265 (0, _checkout.updateProductData)(this.product, { 15266 amount: isMultiple ? this.form.dataset.priceFull : this.form.dataset.priceStart 15267 }); 15268 } 15269 }, { 15270 key: "isMultiple", 15271 value: function() { 15272 return this.stateWrapper && ((0, _heifer.uHasClass)(this.stateWrapper, "is-multiple") || this.quantityInput.value * this.form.dataset.priceStart >= this.form.dataset.priceFull); 15273 } 15274 }, { 15275 key: "updateSubtotal", 15276 value: function() { 15277 var newSubtotal = this.form.dataset.priceStart * this.form.dataset.quantity; 15278 this.form.dataset.subtotal = newSubtotal, this.subtotal && (this.subtotal.innerText = "$" + newSubtotal); 15279 } 15280 }, { 15281 key: "updateTooltipMin", 15282 value: function(ev) { 15283 this.form.querySelector(".inputSlider__tooltip").querySelector(".js-slider-tooltip-unit").innerText = this.unitShare.slice(0, -1); 15284 } 15285 }, { 15286 key: "updateTooltipMax", 15287 value: function(ev) { 15288 var tooltip = this.form.querySelector(".inputSlider__tooltip"), tooltipValue = tooltip.querySelector(".js-slider-tooltip-value"), tooltipUnit = tooltip.querySelector(".js-slider-tooltip-unit"); 15289 this.inputWrapper && this.showContainer(this.inputWrapper), tooltipValue.innerText = 1, 15290 tooltipUnit.innerText = this.unitFull; 15291 } 15292 }, { 15293 key: "updateFrequency", 15294 value: function() { 15295 var _this7 = this; 15296 [].forEach.call(this.frequencyInput, function(el) { 15297 el.checked && ("monthly" === el.value ? (0, _checkout.updateProductData)(_this7.product, { 15298 isMonthly: 1 15299 }) : (0, _checkout.updateProductData)(_this7.product, { 15300 isMonthly: 0 15301 })); 15302 }); 15303 } 15304 }, { 15305 key: "updateProductMonthlyInfo", 15306 value: function(tab) { 15307 "true" == tab.dataset.monthly ? (this.form.dataset.isMonthlyTab = "true", (0, _checkout.updateProductData)(this.product, { 15308 isMonthly: 1, 15309 type: "gift_catalog_donation" 15310 })) : (this.form.dataset.isMonthlyTab = "false", (0, _checkout.updateProductData)(this.product, { 15311 isMonthly: 0, 15312 type: this.originalProductType 15313 })); 15314 } 15315 }, { 15316 key: "getExtraFields", 15317 value: function() { 15318 var extraFields = []; 15319 return [].forEach.call(this.formExtraFields, function(el) { 15320 el.value && !el.disabled && extraFields.push(el); 15321 }), this.objectifyForm(extraFields); 15322 } 15323 }, { 15324 key: "objectifyForm", 15325 value: function(formArray) { 15326 for (var returnArray = {}, i = 0; i < formArray.length; i++) returnArray[formArray[i].name] = formArray[i].value; 15327 return returnArray; 15328 } 15329 }, { 15330 key: "updateAmount", 15331 value: function() { 15332 this.quantityAmount || (this.quantityAmount = this.form.dataset.quantityAmount), 15333 this.quantityInput || (this.quantityInput = this.form.querySelector(".js-product-quantity")), 15334 (0, _checkout.updateProductData)(this.product, { 15335 amount: this.quantityAmount * this.quantityInput.value 15336 }); 15337 } 15338 }, { 15339 key: "updateAmountFromButtons",
15340 value: function(btn) { 15341 (btn = btn || [].filter.call(this.buttons, function(button) { 15342 return button.checked; 15343 })[0]) && (0, _checkout.updateProductData)(this.product, { 15344 amount: btn.value 15345 }); 15346 } 15347 }, { 15348 key: "updateVariationAll", 15349 value: function() { 15350 this.updateVariation(), this.updateVariationGallery(), this.updateVariationUUID(); 15351 } 15352 }, { 15353 key: "updateVariation", 15354 value: function() { 15355 var selected = this.variationsDropdown.options[this.variationsDropdown.selectedIndex].value, variationsPrice = this.variationsPrice[selected], variationsSoldOut = this.variationsSoldOut[selected], variationsLowInventory = this.variationsLowInventory[selected]; 15356 this.form.dataset.subtotal = variationsPrice, "slider" === this.formType && this.quantityAmount ? this.updateAmount() : "buttons" === this.formType ? this.updateAmountFromButtons() : this.updateQuantity(), 15357 this.form.dataset.priceStart = variationsPrice, this.updateSubtotal(), this.variationsMessage.innerHTML = null, 15358 this.variationsButton.disabled = !1, variationsSoldOut && (this.variationsMessage.innerHTML = '<p class="giftCatalogProductHeader__body alert alert__medium">Sorry, this product is sold out.</p>', 15359 this.variationsButton.disabled = !0), variationsLowInventory && (this.variationsMessage.innerHTML = '<p class="giftCatalogProductHeader__body alert alert__low">The availability of this product is low.</p>'), 15360 variationsPrice && (this.variationsText.innerHTML = "$" + variationsPrice, (0, _checkout.updateProductData)(this.product, { 15361 amount: variationsPrice 15362 })); 15363 } 15364 }, { 15365 key: "updateVariationGallery", 15366 value: function() { 15367 var selected = this.variationsDropdown.options[this.variationsDropdown.selectedIndex].value; 15368 this.settings.galleries && this.settings.galleries.forEach(function(gallery) { 15369 var imageIndex = !1; 15370 gallery.carousel.slides.forEach(function(slide, index) { 15371 slide.id === selected && (imageIndex = index); 15372 }), !1 !== imageIndex && gallery.carousel.setStateByIndex(imageIndex); 15373 }); 15374 } 15375 }, { 15376 key: "updateVariationUUID", 15377 value: function() { 15378 var selected = this.variationsDropdown.options[this.variationsDropdown.selectedIndex]; 15379 (0, _checkout.updateProductData)(this.product, { 15380 productVariationUUID: selected.value, 15381 productVariationSku: selected.dataset.sku, 15382 productVariationName: selected.dataset.name 15383 }); 15384 } 15385 }, { 15386 key: "hideContainer", 15387 value: function(el, input) { 15388 el.setAttribute("aria-hidden", "true"), (0, _heifer.uRemoveClass)(el, "is-active"), 15389 this.multipleQuantityInput.value = 1; 15390 } 15391 }, { 15392 key: "showContainer", 15393 value: function(el) { 15394 el.setAttribute("aria-hidden", "false"), (0, _heifer.uAddClass)(el, "is-active"); 15395 } 15396 } ]), GiftCatalogProductCTA; 15397 }(); 15398 }, { 15399 "./../../core/utilities/a11y": 14, 15400 "./../../core/utilities/checkout.utilities": 15, 15401 "./../../core/utilities/heifer.utilities": 19, 15402 "./../../shared/forms/submitButton/submitButton": 88, 15403 "./../../shared/minicart/minicart": 127, 15404 "./giftCatalogProductGallery/giftCatalogProductGallery": 46, 15405 "core-js/modules/es6.array.iterator": 241, 15406 "core-js/modules/es6.function.name": 244, 15407 "core-js/modules/es6.object.keys": 250, 15408 "core-js/modules/es6.object.to-string": 252, 15409 "core-js/modules/es6.symbol": 268, 15410 "core-js/modules/es7.object.get-own-property-descriptors": 272, 15411 "core-js/modules/web.dom.iterable": 274 15412 } ],
15413 46: [ function(require, module, exports) { 15414 "use strict"; 15415 Object.defineProperty(exports, "__esModule", { 15416 value: !0 15417 }), exports.default = function(el) { 15418 return function(el) { 15419 if (el) return new GiftCatalogProductGallery(el); 15420 return !1; 15421 }(el); 15422 }, require("core-js/modules/es7.object.get-own-property-descriptors"), require("core-js/modules/es6.symbol"), 15423 require("core-js/modules/web.dom.iterable"), require("core-js/modules/es6.array.iterator"), 15424 require("core-js/modules/es6.object.to-string"), require("core-js/modules/es6.object.keys"); 15425 var obj, _heifer = (obj = require("./../../../core/ui/heifer.carousel")) && obj.__esModule ? obj : { 15426 default: obj 15427 }; 15428 function ownKeys(object, enumerableOnly) { 15429 var keys = Object.keys(object); 15430 if (Object.getOwnPropertySymbols) { 15431 var symbols = Object.getOwnPropertySymbols(object); 15432 enumerableOnly && (symbols = symbols.filter(function(sym) { 15433 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 15434 })), keys.push.apply(keys, symbols); 15435 } 15436 return keys; 15437 } 15438 function _defineProperty(obj, key, value) { 15439 return key in obj ? Object.defineProperty(obj, key, { 15440 value: value, 15441 enumerable: !0, 15442 configurable: !0, 15443 writable: !0 15444 }) : obj[key] = value, obj; 15445 } 15446 function _defineProperties(target, props) { 15447 for (var i = 0; i < props.length; i++) { 15448 var descriptor = props[i]; 15449 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 15450 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 15451 } 15452 } 15453 var GiftCatalogProductGallery = function() { 15454 function GiftCatalogProductGallery(element, options) { 15455 !function(instance, Constructor) { 15456 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 15457 }(this, GiftCatalogProductGallery), this.element = element, this.$element = $(this.element), 15458 this._defaults = {}, this.settings = function(target) { 15459 for (var i = 1; i < arguments.length; i++) { 15460 var source = null != arguments[i] ? arguments[i] : {}; 15461 i % 2 ? ownKeys(source, !0).forEach(function(key) { 15462 _defineProperty(target, key, source[key]); 15463 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 15464 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 15465 }); 15466 } 15467 return target; 15468 }({}, this._defaults, {}, options), this.init(); 15469 } 15470 return function(Constructor, protoProps, staticProps) { 15471 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 15472 }(GiftCatalogProductGallery, [ { 15473 key: "init", 15474 value: function() { 15475 this.carousel = new _heifer.default(this.element, { 15476 visibleSlides: { 15477 0: 1 15478 }, 15479 loop: !1 15480 }); 15481 } 15482 } ]), GiftCatalogProductGallery; 15483 }(); 15484 }, { 15485 "./../../../core/ui/heifer.carousel": 7, 15486 "core-js/modules/es6.array.iterator": 241, 15487 "core-js/modules/es6.object.keys": 250, 15488 "core-js/modules/es6.object.to-string": 252, 15489 "core-js/modules/es6.symbol": 268, 15490 "core-js/modules/es7.object.get-own-property-descriptors": 272, 15491 "core-js/modules/web.dom.iterable": 274 15492 } ],
15493 47: [ function(require, module, exports) { 15494 "use strict"; 15495 Object.defineProperty(exports, "__esModule", { 15496 value: !0 15497 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 15498 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 15499 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 15500 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.regexp.search"); 15501 var _heifer = require("../../../core/utilities/heifer.utilities"); 15502 function ownKeys(object, enumerableOnly) { 15503 var keys = Object.keys(object); 15504 if (Object.getOwnPropertySymbols) { 15505 var symbols = Object.getOwnPropertySymbols(object); 15506 enumerableOnly && (symbols = symbols.filter(function(sym) { 15507 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 15508 })), keys.push.apply(keys, symbols); 15509 } 15510 return keys; 15511 } 15512 function _defineProperty(obj, key, value) { 15513 return key in obj ? Object.defineProperty(obj, key, { 15514 value: value, 15515 enumerable: !0, 15516 configurable: !0, 15517 writable: !0 15518 }) : obj[key] = value, obj; 15519 } 15520 function _defineProperties(target, props) { 15521 for (var i = 0; i < props.length; i++) { 15522 var descriptor = props[i]; 15523 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 15524 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 15525 } 15526 } 15527 var ChooseHonoree = function() { 15528 function ChooseHonoree(element, options) { 15529 !function(instance, Constructor) { 15530 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 15531 }(this, ChooseHonoree), this.element = element, this.$element = $(element); 15532 var defaults = {}; 15533 this._defaults = defaults, this.settings = function(target) { 15534 for (var i = 1; i < arguments.length; i++) { 15535 var source = null != arguments[i] ? arguments[i] : {}; 15536 i % 2 ? ownKeys(source, !0).forEach(function(key) { 15537 _defineProperty(target, key, source[key]); 15538 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 15539 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 15540 }); 15541 } 15542 return target; 15543 }({}, defaults, {}, options), this.init(); 15544 } 15545 return function(Constructor, protoProps, staticProps) { 15546 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 15547 }(ChooseHonoree, [ { 15548 key: "init", 15549 value: function() { 15550 var queryString = window.location.search; 15551 new URLSearchParams(queryString).get("honoree") || (0, _heifer.uSetCookie)("honoree", "", -1), 15552 this.setEventListeners(); 15553 } 15554 }, { 15555 key: "setEventListeners", 15556 value: function() { 15557 (0, _heifer.uHasClass)(this.element, "chooseHonoree__radio") && this.setCheckboxListener(), 15558 (0, _heifer.uHasClass)(this.element, "chooseHonoree__write-in") && this.setWriteInListener(); 15559 } 15560 }, { 15561 key: "setCheckboxListener", 15562 value: function() { 15563 var _this = this; 15564 this.element.addEventListener("click", function(ev) { 15565 if (null != _this.element.querySelector(".chooseHonoree__input").checked && _this.element.querySelector(".chooseHonoree__input").checked) { 15566 var honoree = _this.element.querySelector(".chooseHonoree__input").value; 15567 (0, _heifer.uSetCookie)("honoree", honoree); 15568 } else (0, _heifer.uSetCookie)("honoree", "", -1); 15569 }); 15570 } 15571 }, { 15572 key: "setWriteInListener", 15573 value: function() { 15574 var _this2 = this; 15575 this.element.querySelector(".chooseHonoree__input").addEventListener("input", function(ev) { 15576 if (_this2.element.querySelector(".chooseHonoree__input").value) { 15577 var honoree = _this2.element.querySelector(".chooseHonoree__input").value; 15578 (0, _heifer.uSetCookie)("honoree", honoree); 15579 } 15580 }); 15581 } 15582 } ]), ChooseHonoree; 15583 }(); 15584 exports.default = ChooseHonoree; 15585 }, {
15586 "../../../core/utilities/heifer.utilities": 19, 15587 "core-js/modules/es6.array.iterator": 241, 15588 "core-js/modules/es6.object.keys": 250, 15589 "core-js/modules/es6.object.to-string": 252, 15590 "core-js/modules/es6.regexp.search": 260, 15591 "core-js/modules/es6.symbol": 268, 15592 "core-js/modules/es7.object.get-own-property-descriptors": 272, 15593 "core-js/modules/web.dom.iterable": 274 15594 } ], 15595 48: [ function(require, module, exports) { 15596 "use strict"; 15597 Object.defineProperty(exports, "__esModule", { 15598 value: !0 15599 }), exports.default = function() { 15600 !function() { 15601 window.Heifer.pages.honorCardPersonalize && ((0, _honorCardPersonalize.default)(), 15602 honorCardSalutation = document.querySelector("#message-1-salutation"), honorCardMemorialName = document.querySelector("#memorial-name"), 15603 honorCardMessage = document.querySelector("#message-2-personal"), honorCardClosing = document.querySelector("#message-3-closing"), 15604 honorCardSignature = document.querySelector("#message-4-signature"), regex = /^[a-zA-Z0-9 !@#$%^&*()\n.,<>{}[\]<>?_=+\-|;:\'\"\/]*$/, 15605 [ honorCardSalutation, honorCardMessage, honorCardSignature ].forEach(function(element) { 15606 element.addEventListener("focusout", function() { 15607 element.value.match(regex) && "" == !element.value ? element.setCustomValidity("") : "" == element.value && element.value.match(regex) ? (element.setCustomValidity("Invalid field."), 15608 element.setAttribute("data-gauntlet-error", "Please complete this required field.")) : element.value.match(regex) || (element.setCustomValidity("Invalid field."), 15609 element.setAttribute("data-gauntlet-error", "Please refrain from the use of emojis or other special characters.")); 15610 }), honorCardMemorialName.addEventListener("focusout", function() { 15611 honorCardMemorialName.value.match(regex) && "" == !honorCardMemorialName.value ? honorCardMemorialName.setCustomValidity("") : "" == honorCardMemorialName.value && honorCardMemorialName.value.match(regex) ? (honorCardMemorialName.setCustomValidity("Invalid field."), 15612 honorCardMemorialName.setAttribute("data-gauntlet-error", "Please complete this required field.")) : honorCardMemorialName.value.match(regex) || (honorCardMemorialName.setCustomValidity("Invalid field."), 15613 honorCardMemorialName.setAttribute("data-gauntlet-error", "Please refrain from the use of emojis or other special characters.")); 15614 }); 15615 })); 15616 window.Heifer.pages.honorCardEmail && ((0, _honorCardEmail.default)(), honorCardClosing.addEventListener("focusout", function() { 15617 honorCardClosing.value.match(regex) && "" == !honorCardClosing.value ? honorCardClosing.setCustomValidity("") : "" == honorCardClosing.value && honorCardClosing.value.match(regex) ? (honorCardClosing.setCustomValidity("Invalid field."), 15618 honorCardClosing.setAttribute("data-gauntlet-error", "Please complete this required field.")) : honorCardClosing.value.match(regex) || (honorCardClosing.setCustomValidity("Invalid field."), 15619 honorCardClosing.setAttribute("data-gauntlet-error", "Please refrain from the use of emojis or other special characters.")); 15620 })); 15621 window.Heifer.pages.honorCardStyles && [].forEach.call(document.querySelectorAll(".js-honor-card-style"), function(el) { 15622 return new _honorCardStyle.default(el); 15623 }); 15624 document.contains(document.querySelector(".js-reveal-honor-style")) && [].forEach.call(document.querySelectorAll(".js-reveal-honor-style"), function(el) { 15625 new _reveal.default(el, { 15626 type: "exclusive", 15627 activeClass: "is-revealed", 15628 visitedClass: "was-revealed", 15629 returns: !0, 15630 onShow: function() { 15631 [].forEach.call(this.reference.targets[0].querySelectorAll("img"), function(img) { 15632 var parent = img.closest(".honorCardPreview"); 15633 [].forEach.call(document.querySelectorAll("div.honorCardPreview"), function(el) { 15634 el.style.display = "none"; 15635 }), parent.style.display = "block", (0, _dynamicResponsiveImages.loadDynamicImage)(img); 15636 }); 15637 } 15638 }); 15639 }); 15640 document.contains(document.querySelector(".js-reveal-honor-card-message")) && [].forEach.call(document.querySelectorAll(".js-reveal-honor-card-message"), function(el) { 15641 new _reveal.default(el, { 15642 type: "exclusive", 15643 activeClass: "is-expanded", 15644 visitedClass: "was-expanded", 15645 onHide: function() { 15646 this.elem.setAttribute("aria-expanded", "false"); 15647 }, 15648 onShow: function() { 15649 this.elem.setAttribute("aria-expanded", "true"); 15650 } 15651 }); 15652 }); 15653 window.Heifer.pages.chooseHonoree && ([].forEach.call(document.querySelectorAll(".chooseHonoree__radio"), function(el) { 15654 return new _chooseHonoree.default(el); 15655 }), [].forEach.call(document.querySelectorAll(".chooseHonoree__write-in"), function(el) { 15656 return new _chooseHonoree.default(el); 15657 })); 15658 }(); 15659 }, require("core-js/modules/es6.regexp.match"); 15660 var honorCardSalutation, honorCardMemorialName, honorCardMessage, honorCardClosing, honorCardSignature, regex, _reveal = _interopRequireDefault(require("./../../core/ui/reveal.es6")), _honorCardPersonalize = _interopRequireDefault(require("./honorCardPersonalize/honorCardPersonalize")), _honorCardEmail = _interopRequireDefault(require("./honorCardEmail/honorCardEmail")), _honorCardStyle = _interopRequireDefault(require("./honorCardStyle/honorCardStyle")), _chooseHonoree = _interopRequireDefault(require("./chooseHonoree/chooseHonoree")), _dynamicResponsiveImages = require("../../core/images/dynamic-responsive-images"); 15661 function _interopRequireDefault(obj) { 15662 return obj && obj.__esModule ? obj : { 15663 default: obj 15664 }; 15665 } 15666 }, {
15667 "../../core/images/dynamic-responsive-images": 2, 15668 "./../../core/ui/reveal.es6": 12, 15669 "./chooseHonoree/chooseHonoree": 47, 15670 "./honorCardEmail/honorCardEmail": 49, 15671 "./honorCardPersonalize/honorCardPersonalize": 50, 15672 "./honorCardStyle/honorCardStyle": 51, 15673 "core-js/modules/es6.regexp.match": 258 15674 } ], 15675 49: [ function(require, module, exports) { 15676 "use strict"; 15677 Object.defineProperty(exports, "__esModule", { 15678 value: !0 15679 }), exports.default = function() { 15680 wrapper = document.querySelector(".js-honor-card-email"), fields = wrapper.querySelector(".js-honor-card-email-fields"), 15681 inputs = fields.querySelectorAll(".js-honor-card-email-label"), addButton = wrapper.querySelector(".js-honor-card-email-add"), 15682 removeButton = wrapper.querySelector(".js-honor-card-email-remove"), today = new Date(), 15683 datepickerWrapper = wrapper.querySelector(".js-honor-card-datepicker-wrapper"), 15684 datepickerInput = wrapper.querySelector(".js-honor-card-datepicker"), datepickerText = wrapper.querySelector(".js-honor-card-datepicker-text"), 15685 datepicker = new _flatpickr.default(datepickerInput, { 15686 defaultDate: today, 15687 minDate: today, 15688 dateFormat: "Y-m-d", 15689 altFormat: "F j, Y", 15690 appendTo: datepickerWrapper, 15691 position: "below", 15692 formatDate: function(date, format) { 15693 for (var key in customFormats) if (0 === _flatpickr.default.compareDates(date, customFormats[key], !0)) return key; 15694 return _flatpickr.default.formatDate(date, format); 15695 }, 15696 onPreCalendarPosition: function() { 15697 setTimeout(function() { 15698 datepicker.calendarContainer.style = ""; 15699 }, 0); 15700 }, 15701 onOpen: function() { 15702 (0, _heifer.uAddClass)(datepickerText, "is-active"), firstOpen = !0; 15703 }, 15704 onClose: function(selectedDates, dateStr, instance) { 15705 (function(date, format) { 15706 datepickerText.textContent = datepicker.formatDate(date, format); 15707 })(instance.selectedDates[0], instance.config.altFormat), (0, _heifer.uRemoveClass)(datepickerText, "is-active"); 15708 } 15709 }), addButton.addEventListener("click", function() { 15710 inputs.length <= 19 && (function() { 15711 var clone = inputs[0].cloneNode(!0), input = clone.querySelector("input"); 15712 input.value = "", (0, _heifer.uRemoveClass)(input, "isnt-empty"), input.name = "email-recipient[]", 15713 new _inputFilled.default(input), fields.append(clone); 15714 }(inputs.length), (0, _heifer.uAddClass)(removeButton, "is-active")), 19 === inputs.length && (addButton.disabled = !0), 15715 inputs = fields.querySelectorAll(".js-honor-card-email-label"); 15716 }), removeButton.addEventListener("click", function() { 15717 2 <= inputs.length && function() { 15718 var inputsArray = Array.from(inputs); 15719 fields.removeChild(inputsArray[inputsArray.length - 1]); 15720 }(), 1 === (inputs = fields.querySelectorAll(".js-honor-card-email-label")).length && (0, 15721 _heifer.uRemoveClass)(removeButton, "is-active"); 15722 }), datepickerInput.addEventListener("click", function() { 15723 if (firstOpen) return !(firstOpen = !1); 15724 (0, _heifer.uHasClass)(datepickerInput, "active") && datepicker.close(); 15725 }); 15726 }, require("core-js/modules/es6.string.iterator"), require("core-js/modules/es6.array.from"), 15727 require("core-js/modules/es6.function.name"); 15728 var _flatpickr = _interopRequireDefault(require("flatpickr")), _inputFilled = _interopRequireDefault(require("../../../shared/forms/inputFilled/inputFilled")), _heifer = require("./../../../core/utilities/heifer.utilities"); 15729 function _interopRequireDefault(obj) { 15730 return obj && obj.__esModule ? obj : { 15731 default: obj 15732 }; 15733 } 15734 var wrapper, fields, inputs, addButton, removeButton, today, datepicker, datepickerWrapper, datepickerInput, datepickerText, firstOpen = !1, customFormats = { 15735 Immediately: new Date() 15736 }; 15737 }, {
15738 "../../../shared/forms/inputFilled/inputFilled": 81, 15739 "./../../../core/utilities/heifer.utilities": 19, 15740 "core-js/modules/es6.array.from": 240, 15741 "core-js/modules/es6.function.name": 244, 15742 "core-js/modules/es6.string.iterator": 265, 15743 flatpickr: 278 15744 } ], 15745 50: [ function(require, module, exports) { 15746 "use strict"; 15747 Object.defineProperty(exports, "__esModule", { 15748 value: !0 15749 }), exports.default = function() { 15750 window.Heifer.pages.honorCardEmail && (productPicker = document.querySelector(".js-honor-card-product-picker"), 15751 productImage = document.querySelector(".js-honor-card-product-image"), productImageParams = productImage.dataset.original.split("?")[1], 15752 productSkuInput = document.querySelector(".js-honor-card-product-sku"), messageTextArea = document.querySelector(".js-honor-card-default-message"), 15753 productPicker.addEventListener("change", function(ev) { 15754 [].forEach.call(ev.target, function(option) { 15755 !0 === option.selected && (function(url, alt) { 15756 (0, _heifer.uRemoveClass)(productImage, "lazyloaded"), (0, _heifer.uAddClass)(productImage, "lazyload"), 15757 productImage.dataset.original = url + "?" + productImageParams, productImage.alt = alt, 15758 (0, _dynamicResponsiveImages.loadDynamicImage)(productImage); 15759 }(option.dataset.image, option.dataset.imageAlt), function(text) { 15760 (0, _heifer.uRemoveClass)(messageTextArea, "is-empty"), (0, _heifer.uAddClass)(messageTextArea, "isnt-empty"), 15761 messageTextArea.value = text; 15762 }(option.dataset.message), function(sku) { 15763 productSkuInput.value = sku; 15764 }(option.dataset.productSku)); 15765 }); 15766 })); 15767 }, require("core-js/modules/es6.regexp.split"); 15768 var productPicker, productImage, productImageParams, productSkuInput, messageTextArea, _dynamicResponsiveImages = require("./../../../core/images/dynamic-responsive-images"), _heifer = require("../../../core/utilities/heifer.utilities"); 15769 }, { 15770 "../../../core/utilities/heifer.utilities": 19, 15771 "./../../../core/images/dynamic-responsive-images": 2, 15772 "core-js/modules/es6.regexp.split": 261 15773 } ], 15774 51: [ function(require, module, exports) { 15775 "use strict"; 15776 Object.defineProperty(exports, "__esModule", { 15777 value: !0 15778 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 15779 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 15780 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.keys"), 15781 require("core-js/modules/es6.regexp.to-string"), require("core-js/modules/es6.date.to-string"), 15782 require("core-js/modules/es6.object.to-string"), require("core-js/modules/es6.regexp.split"); 15783 var _heifer = require("../../../core/utilities/heifer.utilities"); 15784 function ownKeys(object, enumerableOnly) { 15785 var keys = Object.keys(object); 15786 if (Object.getOwnPropertySymbols) { 15787 var symbols = Object.getOwnPropertySymbols(object); 15788 enumerableOnly && (symbols = symbols.filter(function(sym) { 15789 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 15790 })), keys.push.apply(keys, symbols); 15791 } 15792 return keys; 15793 } 15794 function _defineProperty(obj, key, value) { 15795 return key in obj ? Object.defineProperty(obj, key, { 15796 value: value, 15797 enumerable: !0, 15798 configurable: !0, 15799 writable: !0 15800 }) : obj[key] = value, obj; 15801 } 15802 function _defineProperties(target, props) { 15803 for (var i = 0; i < props.length; i++) { 15804 var descriptor = props[i]; 15805 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 15806 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 15807 } 15808 } 15809 var HonorCardStyle = function() { 15810 function HonorCardStyle(element, options) { 15811 !function(instance, Constructor) { 15812 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 15813 }(this, HonorCardStyle), this.element = element, this.$element = $(element); 15814 var defaults = {}; 15815 this._defaults = defaults, this.settings = function(target) { 15816 for (var i = 1; i < arguments.length; i++) { 15817 var source = null != arguments[i] ? arguments[i] : {};
15818 i % 2 ? ownKeys(source, !0).forEach(function(key) { 15819 _defineProperty(target, key, source[key]); 15820 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 15821 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 15822 }); 15823 } 15824 return target; 15825 }({}, defaults, {}, options), this.init(); 15826 } 15827 return function(Constructor, protoProps, staticProps) { 15828 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 15829 }(HonorCardStyle, [ { 15830 key: "init", 15831 value: function() { 15832 this.form = document.querySelector(".js-honor-card"), this.image = this.element.querySelector(".js-honor-card-style-image"), 15833 this.imageInput = document.querySelector(".js-honor-card-image-input"), this.personalize = "blank" != this.form.dataset.honorCardType, 15834 this.personalize && (this.messageTitleDefault = this.form.querySelector(".js-honor-card-personalize-title-default"), 15835 this.messageTitleAlt = this.form.querySelector(".js-honor-card-personalize-title-alt"), 15836 this.messageTitleField = this.messageTitleAlt.querySelector(".js-honor-card-personalize-title-field")), 15837 this.setEventListeners(); 15838 } 15839 }, { 15840 key: "setEventListeners", 15841 value: function() { 15842 var _this = this; 15843 this.element.addEventListener("click", function(ev) { 15844 if (_this.updateImageInput(), ev.target.value) { 15845 var id = ev.target.value; 15846 "All Occasion/Impact" == id && (id = "General"), "ecard" != _this.form.dataset.honorCardType && "mail" != _this.form.dataset.honorCardType || _this.form.dataset.isVday || ("Memorial" == id ? _this.showMemorialField() : _this.hideMemorialField()); 15847 var joinedID = id.toString().split(" "); 15848 joinedID = joinedID.join(""); 15849 var copy = $("#" + joinedID); 15850 $(".honorCardPersonalize__form-message-default").addClass("presentational__display-none"), 15851 copy.removeClass("presentational__display-none"); 15852 } 15853 }); 15854 } 15855 }, { 15856 key: "updateImageInput", 15857 value: function() { 15858 this.imageInput.value = this.image.src.substring(0, this.image.src.indexOf("?")); 15859 } 15860 }, { 15861 key: "showMemorialField", 15862 value: function() { 15863 this.personalize && (this.messageTitleDefault.setAttribute("hidden", !0), (0, _heifer.uRemoveClass)(this.messageTitleDefault, "is-revealed"), 15864 this.messageTitleAlt.removeAttribute("hidden"), (0, _heifer.uAddClass)(this.messageTitleAlt, "is-revealed"), 15865 this.messageTitleField.disabled = !1); 15866 } 15867 }, { 15868 key: "hideMemorialField", 15869 value: function() { 15870 this.personalize && (this.messageTitleAlt.setAttribute("hidden", !0), (0, _heifer.uRemoveClass)(this.messageTitleAlt, "is-revealed"), 15871 this.messageTitleField.disabled = !0, this.messageTitleDefault.removeAttribute("hidden"), 15872 (0, _heifer.uAddClass)(this.messageTitleDefault, "is-revealed")); 15873 } 15874 } ]), HonorCardStyle; 15875 }(); 15876 exports.default = HonorCardStyle; 15877 }, { 15878 "../../../core/utilities/heifer.utilities": 19, 15879 "core-js/modules/es6.array.iterator": 241, 15880 "core-js/modules/es6.date.to-string": 243, 15881 "core-js/modules/es6.object.keys": 250, 15882 "core-js/modules/es6.object.to-string": 252, 15883 "core-js/modules/es6.regexp.split": 261, 15884 "core-js/modules/es6.regexp.to-string": 262, 15885 "core-js/modules/es6.symbol": 268, 15886 "core-js/modules/es7.object.get-own-property-descriptors": 272, 15887 "core-js/modules/web.dom.iterable": 274 15888 } ],
15889 52: [ function(require, module, exports) { 15890 "use strict"; 15891 Object.defineProperty(exports, "__esModule", { 15892 value: !0 15893 }), exports.default = function() { 15894 window.Heifer.pages.cart && (0, _cart.default)(), window.Heifer.pages.giftCard && (0, 15895 _giftCard.default)(), window.Heifer.pages.giftCatalogProduct && (0, _giftCatalogProduct.default)(), 15896 window.Heifer.pages.giftCardActivation && [].forEach.call(document.querySelectorAll(".js-giftCard-activation"), function(giftCardActivation) { 15897 new _giftCardActivation.default(giftCardActivation); 15898 }), window.Heifer.pages.honorCard && (0, _honorCard.default)(), function() { 15899 if (window.Heifer.pages.blog) new _blog.default(document.querySelector(".js-blog-carousel"), {}); 15900 if (window.Heifer.pages.blogPerma) { 15901 var blogBlocks = document.querySelectorAll('[data-block-type="wysiwyg"]'); 15902 [].forEach.call(blogBlocks, function(wysiwygBlock, i) { 15903 0 == i && wysiwygBlock.classList.add("is-first"); 15904 }); 15905 } 15906 }(), function() { 15907 if (window.Heifer.pages.giftCatalog) new _giftCatalog.default(document.querySelector(".js-gift-catalog"), {}); 15908 }(), window.Heifer.pages.accountInformation && (0, _accountInformation.default)(), 15909 function() { 15910 if (window.Heifer.pages.confirmation) new _cartConfirmation.default(document.querySelector(".js-masonry"), {}); 15911 }(), window.Heifer.pages.account && (0, _account.default)(), window.Heifer.pages.perfectMatch && (0, 15912 _perfectMatch.default)(), function() { 15913 if (window.Heifer.pages.emailPreferences) new _emailPreferences.default(document.querySelector(".js-email-preferences")); 15914 }(), function() { 15915 if (window.Heifer.pages.directMailPreferences) new _directMailPreferences.default(document.querySelector(".js-direct-mail-preferences")); 15916 }(), window.Heifer.pages.signatureProject && (0, _signatureProject.default)(); 15917 }; 15918 var _cart = _interopRequireDefault(require("./cart/cart")), _giftCard = _interopRequireDefault(require("./giftCard/giftCard")), _giftCatalogProduct = _interopRequireDefault(require("./giftCatalogProduct/giftCatalogProduct")), _giftCardActivation = _interopRequireDefault(require("./giftCardActivation/giftCardActivation")), _honorCard = _interopRequireDefault(require("./honorCard/honorCard")), _blog = _interopRequireDefault(require("./blog/blog")), _giftCatalog = _interopRequireDefault(require("./giftCatalog/giftCatalog")), _accountInformation = _interopRequireDefault(require("./accountInformation/accountInformation")), _account = _interopRequireDefault(require("./account/account")), _emailPreferences = _interopRequireDefault(require("./support/emailPreferences")), _directMailPreferences = _interopRequireDefault(require("./support/directMailPreferences")), _cartConfirmation = _interopRequireDefault(require("./cart/cartConfirmation/cartConfirmation")), _perfectMatch = _interopRequireDefault(require("./perfectMatch/perfectMatch.js")), _signatureProject = _interopRequireDefault(require("./signatureProject/signatureProject")); 15919 function _interopRequireDefault(obj) { 15920 return obj && obj.__esModule ? obj : { 15921 default: obj 15922 }; 15923 } 15924 }, { 15925 "./account/account": 27, 15926 "./accountInformation/accountInformation": 33, 15927 "./blog/blog": 34, 15928 "./cart/cart": 35, 15929 "./cart/cartConfirmation/cartConfirmation": 37, 15930 "./giftCard/giftCard": 42, 15931 "./giftCardActivation/giftCardActivation": 43, 15932 "./giftCatalog/giftCatalog": 44, 15933 "./giftCatalogProduct/giftCatalogProduct": 45, 15934 "./honorCard/honorCard": 48, 15935 "./perfectMatch/perfectMatch.js": 55, 15936 "./signatureProject/signatureProject": 59, 15937 "./support/directMailPreferences": 60, 15938 "./support/emailPreferences": 61 15939 } ],
15940 53: [ function(require, module, exports) { 15941 "use strict"; 15942 Object.defineProperty(exports, "__esModule", { 15943 value: !0 15944 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 15945 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 15946 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 15947 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.regexp.match"); 15948 var obj, _swipe = (obj = require("./swipe")) && obj.__esModule ? obj : { 15949 default: obj 15950 }; 15951 function ownKeys(object, enumerableOnly) { 15952 var keys = Object.keys(object); 15953 if (Object.getOwnPropertySymbols) { 15954 var symbols = Object.getOwnPropertySymbols(object); 15955 enumerableOnly && (symbols = symbols.filter(function(sym) { 15956 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 15957 })), keys.push.apply(keys, symbols); 15958 } 15959 return keys; 15960 } 15961 function _defineProperty(obj, key, value) { 15962 return key in obj ? Object.defineProperty(obj, key, { 15963 value: value, 15964 enumerable: !0, 15965 configurable: !0, 15966 writable: !0 15967 }) : obj[key] = value, obj; 15968 } 15969 function _defineProperties(target, props) { 15970 for (var i = 0; i < props.length; i++) { 15971 var descriptor = props[i]; 15972 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 15973 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 15974 } 15975 } 15976 var MatchCard = function() { 15977 function MatchCard(element, options) { 15978 !function(instance, Constructor) { 15979 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 15980 }(this, MatchCard), this.element = element, this.$element = $(this.element), this.defaults = {}, 15981 this.settings = function(target) { 15982 for (var i = 1; i < arguments.length; i++) { 15983 var source = null != arguments[i] ? arguments[i] : {}; 15984 i % 2 ? ownKeys(source, !0).forEach(function(key) { 15985 _defineProperty(target, key, source[key]); 15986 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 15987 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 15988 }); 15989 } 15990 return target; 15991 }({}, this.defaults, {}, options), this.card = this.element.querySelector(".js-matchcard"), 15992 this.isSwiped = !1, this.init(); 15993 } 15994 return function(Constructor, protoProps, staticProps) { 15995 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 15996 }(MatchCard, [ { 15997 key: "init", 15998 value: function() { 15999 var _this = this; 16000 this.swipeEvent = new _swipe.default(this.element), this.element.addEventListener("swiped-right", function(e) { 16001 _this.settings.onSwipe && _this.settings.onSwipe(_this, e.detail.dir); 16002 }), this.element.addEventListener("swiped-left", function(e) { 16003 _this.settings.onSwipe && _this.settings.onSwipe(_this, e.detail.dir); 16004 }); 16005 } 16006 }, { 16007 key: "swipe", 16008 value: function(collection, dir, callback) { 16009 var _this2 = this; 16010 this.isSwiped = !0, this.card.classList.remove("swipe-right"), this.card.classList.remove("swipe-left"), 16011 this.card.classList.add("is-swiped"), this.card.classList.add("swipe-" + dir), window.setTimeout(function() { 16012 var clone = _this2.element.cloneNode(!0); 16013 _this2.element.remove(), collection.prepend(clone), _this2.element = clone, _this2.setPosition(collection.children.length - 1), 16014 _this2.card = _this2.element.querySelector(".js-matchcard"), _this2.card.classList.remove("is-swiped"),
16015 _this2.isSwiped = !1, _this2.init(), callback(); 16016 }, 500); 16017 } 16018 }, { 16019 key: "getClassPos", 16020 value: function() { 16021 var pos = -1; 16022 return this.element.classList.forEach(function(name) { 16023 if (-1 != name.indexOf("pos-")) { 16024 var m = name.match(/pos-([-0-9]+)/); 16025 m && (pos = parseInt(m[1])); 16026 } 16027 }), pos; 16028 } 16029 }, { 16030 key: "setPosition", 16031 value: function(pos) { 16032 var classPos = this.getClassPos(); 16033 -1 < classPos && (this.element.classList.remove("pos-" + classPos), this.element.classList.add("pos-" + pos)); 16034 } 16035 }, { 16036 key: "decrementPosition", 16037 value: function() { 16038 var classPos = this.getClassPos(); 16039 -1 < classPos && (this.element.classList.remove("pos-"
16039+ classPos), this.element.classList.add("pos-" + (classPos - 1))); 16040 } 16041 } ]), MatchCard; 16042 }(); 16043 exports.default = MatchCard; 16044 }, { 16045 "./swipe": 57, 16046 "core-js/modules/es6.array.iterator": 241, 16047 "core-js/modules/es6.object.keys": 250, 16048 "core-js/modules/es6.object.to-string": 252, 16049 "core-js/modules/es6.regexp.match": 258, 16050 "core-js/modules/es6.symbol": 268, 16051 "core-js/modules/es7.object.get-own-property-descriptors": 272, 16052 "core-js/modules/web.dom.iterable": 274 16053 } ], 16054 54: [ function(require, module, exports) { 16055 "use strict"; 16056 Object.defineProperty(exports, "__esModule", { 16057 value: !0 16058 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 16059 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 16060 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.keys"), 16061 require("core-js/modules/es6.promise"), require("core-js/modules/es6.object.to-string"); 16062 var _heifer = require("../../core/utilities/heifer.utilities"); 16063 function ownKeys(object, enumerableOnly) { 16064 var keys = Object.keys(object); 16065 if (Object.getOwnPropertySymbols) { 16066 var symbols = Object.getOwnPropertySymbols(object); 16067 enumerableOnly && (symbols = symbols.filter(function(sym) { 16068 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 16069 })), keys.push.apply(keys, symbols); 16070 } 16071 return keys; 16072 } 16073 function _defineProperty(obj, key, value) { 16074 return key in obj ? Object.defineProperty(obj, key, { 16075 value: value, 16076 enumerable: !0, 16077 configurable: !0, 16078 writable: !0 16079 }) : obj[key] = value, obj; 16080 } 16081 function _defineProperties(target, props) { 16082 for (var i = 0; i < props.length; i++) { 16083 var descriptor = props[i]; 16084 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 16085 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 16086 } 16087 } 16088 var AccountMonthlyModal = function() { 16089 function AccountMonthlyModal(element, options) { 16090 !function(instance, Constructor) { 16091 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 16092 }(this, AccountMonthlyModal), this.element = element; 16093 var defaults = {}; 16094 this._defaults = defaults, this.settings = function(target) { 16095 for (var i = 1; i < arguments.length; i++) { 16096 var source = null != arguments[i] ? arguments[i] : {}; 16097 i % 2 ? ownKeys(source, !0).forEach(function(key) { 16098 _defineProperty(target, key, source[key]); 16099 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 16100 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 16101 }); 16102 } 16103 return target; 16104 }({}, defaults, {}, options), this.init(); 16105 } 16106 return function(Constructor, protoProps, staticProps) { 16107 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 16108 }(AccountMonthlyModal, [ { 16109 key: "init", 16110 value: function() { 16111 this.revealTrigger = document.querySelector("#" + this.element.dataset.revealTrigger), 16112 this.revealClose = this.element.querySelectorAll(".js-perfectmatch-modal-close"), 16113 this.modalContent = this.element.querySelector(".js-perfectmatch-modal-content"), 16114 this.modalMessage = this.element.querySelector(".js-perfectmatch-modal-message"), 16115 this.modalMessageText = this.modalMessage.querySelector(".js-perfectmatch-modal-message-text"), 16116 this.setEventListeners(); 16117 window.localStorage.getItem("pmshow"); 16118 (0, _heifer.uAddClass)(this.element, "is-revealed"), window.localStorage.setItem("pmshow", 1); 16119 } 16120 }, { 16121 key: "setEventListeners", 16122 value: function() { 16123 var _this = this; 16124 [].forEach.call(this.revealClose, function(close) { 16125 close.addEventListener("click", function(ev) { 16126 _this.resetModal().then(function() { 16127 (0, _heifer.uRemoveClass)(_this.element, "is-revealed"); 16128 }); 16129 }); 16130 }), document.addEventListener("perfectMatch/cancel/success", function(ev) { 16131 _this.handleCancelSuccess(ev); 16132 }), document.addEventListener("perfectMatch/cancel/error", function(ev) { 16133 _this.handleCancelError(ev); 16134 }); 16135 } 16136 }, { 16137 key: "handleCancelSuccess", 16138 value: function(ev) { 16139 this.showMessage("Your donation has been successfully cancelled."), ev.detail.card && ev.detail.card.remove(); 16140 } 16141 }, { 16142 key: "handleCancelError", 16143 value: function(ev) { 16144 this.showMessage("There was a problem processing your cancel request. Please try again or c
16144ontact Donor Services at 855.9HUNGER (855.948.6437)."); 16145 } 16146 }, { 16147 key: "showMessage", 16148 value: function(message) { 16149 message && (this.modalContent.setAttribute("hidden", ""), this.modalMessage.removeAttribute("hidden"), 16150 this.modalMessageText.textContent = message); 16151 } 16152 }, { 16153 key: "resetModal", 16154 value: function() { 16155 var _this2 = this; 16156 return new Promise(function(resolve) { 16157 _this2.modalContent.hasAttribute("hidden") && (_this2.modalContent.removeAttribute("hidden"), 16158 _this2.modalMessage.setAttribute("hidden", "")), resolve(!0); 16159 }); 16160 } 16161 } ]), AccountMonthlyModal; 16162 }(); 16163 exports.default = AccountMonthlyModal; 16164 }, { 16165 "../../core/utilities/heifer.utilities": 19, 16166 "core-js/modules/es6.array.iterator": 241, 16167 "core-js/modules/es6.object.keys": 250, 16168 "core-js/modules/es6.object.to-string": 252, 16169 "core-js/modules/es6.promise": 253, 16170 "core-js/modules/es6.symbol": 268, 16171 "core-js/modules/es7.object.get-own-property-descriptors": 272, 16172 "core-js/modules/web.dom.iterable": 274 16173 } ], 16174 55: [ function(require, module, exports) { 16175 "use strict"; 16176 Object.defineProperty(exports, "__esModule", { 16177 value: !0 16178 }), exports.default = function() { 16179 [].forEach.call(document.querySelectorAll(".js-quizstep"), function(el) { 16180 new _quizstep.default(el, {}); 16181 }), [].forEach.call(document.querySelectorAll(".js-perfectmatch-modal"), function(el) { 16182 new _modal.default(el, {}); 16183 }), [].forEach.call(document.querySelectorAll(".js-perfectmatch-swipe"), function(el) { 16184 new _swipebutton.default(el, {}); 16185 }); 16186 }; 16187 var _quizstep = _interopRequireDefault(require("./quizstep")), _swipebutton = (_interopRequireDefault(require("./matchcard")), 16188 _interopRequireDefault(require("./swipebutton"))), _modal = _interopRequireDefault(require("./modal")); 16189 function _interopRequireDefault(obj) { 16190 return obj && obj.__esModule ? obj : { 16191 default: obj 16192 }; 16193 } 16194 }, { 16195 "./matchcard": 53, 16196 "./modal": 54, 16197 "./quizstep": 56, 16198 "./swipebutton": 58 16199 } ], 16200 56: [ function(require, module, exports) { 16201 "use strict"; 16202 function ownKeys(object, enumerableOnly) { 16203 var keys = Object.keys(object); 16204 if (Object.getOwnPropertySymbols) { 16205 var symbols = Object.getOwnPropertySymbols(object); 16206 enumerableOnly && (symbols = symbols.filter(function(sym) { 16207 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 16208 })), keys.push.apply(keys, symbols); 16209 } 16210 return keys; 16211 } 16212 function _defineProperty(obj, key, value) { 16213 return key in obj ? Object.defineProperty(obj, key, { 16214 value: value, 16215 enumerable: !0, 16216 configurable: !0, 16217 writable: !0 16218 }) : obj[key] = value, obj; 16219 } 16220 function _defineProperties(target, props) { 16221 for (var i = 0; i < props.length; i++) { 16222 var descriptor = props[i]; 16223 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 16224 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 16225 } 16226 } 16227 Object.defineProperty(exports, "__esModule", { 16228 value: !0 16229 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 16230 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 16231 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 16232 require("core-js/modules/es6.object.keys");
16233 var QuizStep = function() { 16234 function QuizStep(element, options) { 16235 !function(instance, Constructor) { 16236 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 16237 }(this, QuizStep), this.element = element, this.$element = $(this.element), this.defaults = {}, 16238 this.settings = function(target) { 16239 for (var i = 1; i < arguments.length; i++) { 16240 var source = null != arguments[i] ? arguments[i] : {}; 16241 i % 2 ? ownKeys(source, !0).forEach(function(key) { 16242 _defineProperty(target, key, source[key]); 16243 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 16244 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 16245 }); 16246 } 16247 return target; 16248 }({}, this.defaults, {}, options), this.init(); 16249 } 16250 return function(Constructor, protoProps, staticProps) { 16251 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 16252 }(QuizStep, [ { 16253 key: "init", 16254 value: function() { 16255 var _this = this, hasNext = !!this.element.dataset.hasNext, hasBack = !!this.element.dataset.hasBack; 16256 this.index = parseInt(this.element.dataset.index), this.form = document.querySelector(".js-quizform"), 16257 this.labels = this.element.querySelectorAll(".js-choice-label"), this.inputs = this.element.querySelectorAll('input[type="radio"]'), 16258 this.backButton = this.element.querySelector(".js-quizback"), hasNext && [].forEach.call(this.inputs, function(el) { 16259 el.addEventListener("change", function(ev) { 16260 _this.element.classList.remove("is-revealed"), document.getElementById("js-quizstep-" + (_this.index + 1)).classList.add("is-revealed"); 16261 }); 16262 }), hasNext || [].forEach.call(this.inputs, function(el) { 16263 el.addEventListener("change", function(ev) { 16264 _this.form.submit(); 16265 }); 16266 }), hasBack && this.backButton.addEventListener("click", function(ev) { 16267 _this.resetForm(), _this.element.classList.remove("is-revealed"), document.getElementById("js-quizstep-" + (_this.index - 1)).classList.add("is-revealed"); 16268 }); 16269 } 16270 }, { 16271 key: "resetForm", 16272 value: function() { 16273 [].forEach.call(this.form.querySelectorAll('input[type="radio"]'), function(el) { 16274 el.checked = !1, console.log(el, el.checked); 16275 }); 16276 } 16277 } ]), QuizStep; 16278 }(); 16279 exports.default = QuizStep; 16280 }, { 16281 "core-js/modules/es6.array.iterator": 241, 16282 "core-js/modules/es6.object.keys": 250, 16283 "core-js/modules/es6.object.to-string": 252, 16284 "core-js/modules/es6.symbol": 268, 16285 "core-js/modules/es7.object.get-own-property-descriptors": 272, 16286 "core-js/modules/web.dom.iterable": 274 16287 } ], 16288 57: [ function(require, module, exports) { 16289 "use strict"; 16290 function _defineProperties(target, props) { 16291 for (var i = 0; i < props.length; i++) { 16292 var descriptor = props[i]; 16293 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 16294 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 16295 } 16296 } 16297 Object.defineProperty(exports, "__esModule", { 16298 value: !0 16299 }), exports.default = void 0, require("core-js/modules/es6.regexp.replace"); 16300 var Swipe = function() { 16301 function Swipe(element, options) { 16302 !function(instance, Constructor) { 16303 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 16304 }(this, Swipe), this.xDown = null, this.yDown = null, this.xDiff = null, this.yDiff = null, 16305 this.timeDown = null, this.startEl = null, this.element = element, this.init(); 16306 } 16307 return function(Constructor, protoProps, staticProps) { 16308 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 16309 }(Swipe, [ { 16310 key: "init", 16311 value: function() { 16312 var _this = this; 16313 "function" != typeof window.CustomEvent && (window.CustomEvent = function(event, params) { 16314 params = params || { 16315 bubbles: !1, 16316 cancelable: !1, 16317 detail: void 0 16318 }; 16319 var evt = document.createEvent("CustomEvent"); 16320 return evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail), 16321 evt; 16322 }, window.CustomEvent.prototype = window.Event.prototype), this.element.addEventListener("touchstart", function(e) { 16323 _this.handleTouchStart(e); 16324 }, !1), this.element.addEventListener("touchmove", function(e) { 16325 _this.handleTouchMove(e); 16326 }, !1), this.element.addEventListener("touchend", function(e) { 16327 _this.handleTouchEnd(e); 16328 }, !1); 16329 } 16330 }, { 16331 key: "handleTouchEnd", 16332 value: function(e) { 16333 function getNearestAttribute(el, attributeName, defaultValue) { 16334 for (;el && el !== document.documentElement; ) { 16335 var attributeValue = el.getAttribute(attributeName); 16336 if (attributeValue) return attributeValue; 16337 el = el.parentNode; 16338 } 16339 return defaultValue; 16340 } 16341 if (this.startEl === e.target) { 16342 var swipeThreshold = parseInt(getNearestAttribute(this.startEl, "data-swipe-threshold", "20"), 10), swipeTimeout = parseInt(getNearestAttribute(this.startEl, "data-swipe-timeout", "500"), 10), timeDiff = Date.now() - this.timeDown, eventType = "", changedTouches = e.changedTouches || e.touches || []; 16343 if (Math.abs(this.xDiff) > Math.abs(this.yDiff) ? Math.abs(this.xDiff) > swipeThreshold && timeDiff < swipeTimeout && (eventType = 0 < this.xDiff ? "swiped-left" : "swiped-right") : Math.abs(this.yDiff) > swipeThreshold && timeDiff < swipeTimeout && (eventType = 0 < this.yDiff ? "swiped-up" : "swiped-down"), 16344 "" !== eventType) { 16345 var eventData = { 16346 dir: eventType.replace(/swiped-/, ""), 16347 xStart: parseInt(this.xDown, 10), 16348 xEnd: parseInt((changedTouches[0] || {}).clientX || -1, 10), 16349 yStart: parseInt(this.yDown, 10), 16350 yEnd: parseInt((changedTouches[0] || {}).clientY || -1, 10) 16351 }; 16352 this.element.dispatchEvent(new CustomEvent("swiped", { 16353 bubbles: !0, 16354 cancelable: !0, 16355 detail: eventData 16356 })), this.element.dispatchEvent(new CustomEvent(eventType, { 16357 bubbles: !0, 16358 cancelable: !0, 16359 detail: eventData 16360 })); 16361 } 16362 this.xDown = null, this.yDown = null, this.timeDown = null; 16363 } 16364 } 16365 }, { 16366 key: "handleTouchStart", 16367 value: function(e) { 16368 "true" !== e.target.getAttribute("data-swipe-ignore") && (this.startEl = e.target, 16369 this.timeDown = Date.now(), this.xDown = e.touches[0].clientX, this.yDown = e.touches[0].clientY, 16370 this.xDiff = 0, this.yDiff = 0); 16371 } 16372 }, { 16373 key: "handleTouchMove", 16374 value: function(e) { 16375 if (this.xDown && this.yDown) { 16376 var xUp = e.touches[0].clientX, yUp = e.touches[0].clientY; 16377 this.xDiff = this.xDown - xUp, this.yDiff = this.yDown - yUp; 16378 } 16379 } 16380 } ]), Swipe; 16381 }(); 16382 exports.default = Swipe; 16383 }, {
16384 "core-js/modules/es6.regexp.replace": 259 16385 } ], 16386 58: [ function(require, module, exports) { 16387 "use strict"; 16388 Object.defineProperty(exports, "__esModule", { 16389 value: !0 16390 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 16391 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 16392 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 16393 require("core-js/modules/es6.object.keys"); 16394 var obj, _matchcard = (obj = require("./matchcard")) && obj.__esModule ? obj : { 16395 default: obj 16396 }; 16397 function ownKeys(object, enumerableOnly) { 16398 var keys = Object.keys(object); 16399 if (Object.getOwnPropertySymbols) { 16400 var symbols = Object.getOwnPropertySymbols(object); 16401 enumerableOnly && (symbols = symbols.filter(function(sym) { 16402 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 16403 })), keys.push.apply(keys, symbols); 16404 } 16405 return keys; 16406 } 16407 function _defineProperty(obj, key, value) { 16408 return key in obj ? Object.defineProperty(obj, key, { 16409 value: value, 16410 enumerable: !0, 16411 configurable: !0, 16412 writable: !0 16413 }) : obj[key] = value, obj; 16414 } 16415 function _defineProperties(target, props) { 16416 for (var i = 0; i < props.length; i++) { 16417 var descriptor = props[i]; 16418 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 16419 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 16420 } 16421 } 16422 var SwipeButton = function() { 16423 function SwipeButton(element, options) { 16424 !function(instance, Constructor) { 16425 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 16426 }(this, SwipeButton), this.element = element, this.$element = $(this.element), this.defaults = {}, 16427 this.settings = function(target) { 16428 for (var i = 1; i < arguments.length; i++) { 16429 var source = null != arguments[i] ? arguments[i] : {}; 16430 i % 2 ? ownKeys(source, !0).forEach(function(key) { 16431 _defineProperty(target, key, source[key]); 16432 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 16433 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 16434 }); 16435 } 16436 return target; 16437 }({}, this.defaults, {}, options), this.parentElem = document.querySelector(".js-matchcards"), 16438 this.collect(), this.init(); 16439 } 16440 return function(Constructor, protoProps, staticProps) { 16441 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 16442 }(SwipeButton, [ { 16443 key: "collect", 16444 value: function() { 16445 var _this = this, cardElems = document.querySelectorAll(".js-matchcardwrapper"); 16446 this.matchCards = [], [].forEach.call(cardElems, function(el) { 16447 _this.matchCards.push(new _matchcard.default(el, { 16448 onSwipe: function(mc, dir) { 16449 _this.runSwipe(dir); 16450 } 16451 })); 16452 }); 16453 } 16454 }, { 16455 key: "reinsertMatchCard", 16456 value: function(mc) { 16457 for (var newlist = [ mc ], i = 0; i < this.matchCards.length - 1; i++) newlist.push(this.matchCards[i]); 16458 this.matchCards = newlist; 16459 } 16460 }, { 16461 key: "init", 16462 value: function() { 16463 var _this2 = this; 16464 this.element.addEventListener("click", function(ev) { 16465 _this2.runSwipe("right"); 16466 }); 16467 } 16468 }, { 16469 key: "runSwipe", 16470 value: function(dir) { 16471 for (var _this3 = this, _loop = function(i) { 16472 var matchCard = _this3.matchCards[i]; 16473 if (!matchCard.isSwiped) return matchCard.swipe(_this3.parentElem, dir, function() { 16474 _this3.reinsertMatchCard(matchCard); 16475 }), "break"; 16476 }, i = this.matchCards.length - 1; 0 <= i; i--) { 16477 if ("break" === _loop(i)) break; 16478 } 16479 this.decrementRemaining(); 16480 } 16481 }, { 16482 key: "decrementRemaining", 16483 value: function() { 16484 for (var newPos = 0, i = this.matchCards.length - 1; 0 <= i; i--) { 16485 var matchCard = this.matchCards[i]; 16486 matchCard.isSwiped || (matchCard.setPosition(newPos), newPos++); 16487 } 16488 } 16489 } ]), SwipeButton; 16490 }(); 16491 exports.default = SwipeButton; 16492 }, {
16493 "./matchcard": 53, 16494 "core-js/modules/es6.array.iterator": 241, 16495 "core-js/modules/es6.object.keys": 250, 16496 "core-js/modules/es6.object.to-string": 252, 16497 "core-js/modules/es6.symbol": 268, 16498 "core-js/modules/es7.object.get-own-property-descriptors": 272, 16499 "core-js/modules/web.dom.iterable": 274 16500 } ], 16501 59: [ function(require, module, exports) { 16502 "use strict"; 16503 Object.defineProperty(exports, "__esModule", { 16504 value: !0 16505 }), exports.default = function() { 16506 [].forEach.call(document.querySelectorAll(".js-signature-slider"), function(el) { 16507 new SignatureProjectSlider(el, {}); 16508 }), [].forEach.call(document.querySelectorAll(".js-signature-share"), function(el) { 16509 new SignatureShare(el, {}); 16510 }), document.getElementById("js-jumpnav-donate").addEventListener("click", function() { 16511 document.getElementById("js-signaturedonate-button").scrollIntoView({ 16512 behavior: "smooth" 16513 }); 16514 }); 16515 }, require("core-js/modules/es7.object.get-own-property-descriptors"), require("core-js/modules/es6.symbol"), 16516 require("core-js/modules/web.dom.iterable"), require("core-js/modules/es6.array.iterator"), 16517 require("core-js/modules/es6.object.to-string"), require("core-js/modules/es6.object.keys"); 16518 var _jquery = _interopRequireDefault(require("jquery")), _heifer = _interopRequireDefault(require("../../core/ui/heifer.carousel")), _heifer2 = require("../../core/utilities/heifer.utilities"); 16519 function _interopRequireDefault(obj) { 16520 return obj && obj.__esModule ? obj : { 16521 default: obj 16522 }; 16523 } 16524 function ownKeys(object, enumerableOnly) { 16525 var keys = Object.keys(object); 16526 if (Object.getOwnPropertySymbols) { 16527 var symbols = Object.getOwnPropertySymbols(object); 16528 enumerableOnly && (symbols = symbols.filter(function(sym) { 16529 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 16530 })), keys.push.apply(keys, symbols); 16531 } 16532 return keys; 16533 } 16534 function _objectSpread(target) { 16535 for (var i = 1; i < arguments.length; i++) { 16536 var source = null != arguments[i] ? arguments[i] : {}; 16537 i % 2 ? ownKeys(source, !0).forEach(function(key) { 16538 _defineProperty(target, key, source[key]); 16539 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 16540 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 16541 }); 16542 } 16543 return target; 16544 } 16545 function _defineProperty(obj, key, value) { 16546 return key in obj ? Object.defineProperty(obj, key, { 16547 value: value, 16548 enumerable: !0, 16549 configurable: !0, 16550 writable: !0 16551 }) : obj[key] = value, obj; 16552 } 16553 function _classCallCheck(instance, Constructor) { 16554 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 16555 } 16556 function _defineProperties(target, props) { 16557 for (var i = 0; i < props.length; i++) { 16558 var descriptor = props[i]; 16559 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 16560 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 16561 } 16562 } 16563 function _createClass(Constructor, protoProps, staticProps) { 16564 return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), 16565 Constructor; 16566 } 16567 var SignatureProjectSlider = function() { 16568 function SignatureProjectSlider(element, options) { 16569 _classCallCheck(this, SignatureProjectSlider), this.element = element, this.$element = (0, 16570 _jquery.default)(this.element), this._defaults = {}, this.settings = _objectSpread({}, this._defaults, {}, options), 16571 this.slidesWrapper = this.element.querySelector(".js-slides"), this.slides = this.element.querySelectorAll(".js-slide"), 16572 this.init(); 16573 } 16574 return _createClass(SignatureProjectSlider, [ { 16575 key: "init", 16576 value: function() { 16577 var _this = this; 16578 this.currentSlide = this.slides[0], this.carousel = new _heifer.default(this.element, { 16579 visibleSlides: { 16580 0: 1, 16581 480: 1, 16582 768: this.element.dataset.format && "signature-gallery" == this.element.dataset.format ? 4 : 1 16583 }, 16584 onSlide: function() { 16585 0 === _this.carousel.state.current ? [].forEach.call(_this.carousel.prevButtons, function(button) { 16586 _this.hideButton(button); 16587 }) : 0 === _this.carousel.state.next ? [].forEach.call(_this.carousel.nextButtons, function(button) { 16588 _this.hideButton(button); 16589 }) : ([].forEach.call(_this.carousel.nextButtons, function(button) { 16590 _this.showButton(button); 16591 }), [].forEach.call(_this.carousel.prevButtons, function(button) { 16592 _this.showButton(button); 16593 })); 16594 } 16595 }); 16596 } 16597 }, { 16598 key: "hideButton", 16599 value: function(button) { 16600 (0, _heifer2.uAddClass)(button, "is-hidden"); 16601 } 16602 }, { 16603 key: "showButton", 16604 value: function(button) { 16605 (0, _heifer2.uRemoveClass)(button, "is-hidden"); 16606 } 16607 } ]), SignatureProjectSlider; 16608 }(), SignatureShare = function() { 16609 function SignatureShare(element, options) { 16610 _classCallCheck(this, SignatureShare), this.element = element, this.$element = (0, 16611 _jquery.default)(this.element), this._defaults = {}, this.settings = _objectSpread({}, this._defaults, {}, options), 16612 this.copyInput = this.element.querySelector(".js-signature-share--input"), this.copyBtn = this.element.querySelector(".js-signature-share--btn"), 16613 this.init(); 16614 } 16615 return _createClass(SignatureShare, [ { 16616 key: "init", 16617 value: function() { 16618 this.copyLink(); 16619 } 16620 }, { 16621 key: "copyLink", 16622 value: function() { 16623 var _this2 = this; 16624 this.copyBtn && this.copyInput && (this.copyBtn.addEventListener("click", function(ev) { 16625 ev.preventDefault(); 16626 _this2.copyInput.select(); 16627 document.execCommand("copy"), _this2.copyBtn.innerHTML = "Link Copied", _this2.copyBtn.dataset.copy = "is-copied"; 16628 }), this.copyInput.addEventListener("click", function() { 16629 _this2.copyInput.select(); 16630 })); 16631 } 16632 } ]), SignatureShare; 16633 }(); 16634 }, {
16635 "../../core/ui/heifer.carousel": 7, 16636 "../../core/utilities/heifer.utilities": 19, 16637 "core-js/modules/es6.array.iterator": 241, 16638 "core-js/modules/es6.object.keys": 250, 16639 "core-js/modules/es6.object.to-string": 252, 16640 "core-js/modules/es6.symbol": 268, 16641 "core-js/modules/es7.object.get-own-property-descriptors": 272, 16642 "core-js/modules/web.dom.iterable": 274, 16643 jquery: 20 16644 } ], 16645 60: [ function(require, module, exports) { 16646 "use strict"; 16647 Object.defineProperty(exports, "__esModule", { 16648 value: !0 16649 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 16650 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 16651 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 16652 require("core-js/modules/es6.object.keys"); 16653 var obj, _heifer = require("../../core/utilities/heifer.utilities"), _submitButton = (obj = require("../../shared/forms/submitButton/submitButton")) && obj.__esModule ? obj : { 16654 default: obj 16655 }; 16656 function ownKeys(object, enumerableOnly) { 16657 var keys = Object.keys(object); 16658 if (Object.getOwnPropertySymbols) { 16659 var symbols = Object.getOwnPropertySymbols(object); 16660 enumerableOnly && (symbols = symbols.filter(function(sym) { 16661 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 16662 })), keys.push.apply(keys, symbols); 16663 } 16664 return keys; 16665 } 16666 function _defineProperty(obj, key, value) { 16667 return key in obj ? Object.defineProperty(obj, key, { 16668 value: value, 16669 enumerable: !0, 16670 configurable: !0, 16671 writable: !0 16672 }) : obj[key] = value, obj; 16673 } 16674 function _defineProperties(target, props) { 16675 for (var i = 0; i < props.length; i++) { 16676 var descriptor = props[i]; 16677 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 16678 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 16679 } 16680 } 16681 var EmailPreferences = function() { 16682 function EmailPreferences(element, options) { 16683 !function(instance, Constructor) { 16684 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 16685 }(this, EmailPreferences), this.element = element; 16686 var defaults = { 16687 showMessageClass: "is-revealed" 16688 }; 16689 this._defaults = defaults, this.settings = function(target) { 16690 for (var i = 1; i < arguments.length; i++) { 16691 var source = null != arguments[i] ? arguments[i] : {}; 16692 i % 2 ? ownKeys(source, !0).forEach(function(key) { 16693 _defineProperty(target, key, source[key]); 16694 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 16695 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 16696 }); 16697 } 16698 return target; 16699 }({}, defaults, {}, options), this.init(); 16700 } 16701 return function(Constructor, protoProps, staticProps) { 16702 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 16703 }(EmailPreferences, [ { 16704 key: "init", 16705 value: function() { 16706 this.formElement = this.element.querySelector(".js-mail-preferences-form"), this.submitUI = new _submitButton.default(this.formElement.querySelector(".js-mail-preferences-submit")), 16707 this.formElement.addEventListener("submit", this.handleSubmit.bind(this)), this.successMessage = this.formElement.querySelector(".js-success-message"), 16708 this.errorMessage = this.formElement.querySelector(".js-error-message"); 16709 } 16710 }, { 16711 key: "showMessage", 16712 value: function(message) { 16713 message && !(0, _heifer.uHasClass)(message, this.settings.showMessageClass) && (0, 16714 _heifer.uAddClass)(message, this.settings.showMessageClass); 16715 } 16716 }, { 16717 key: "hideMessage", 16718 value: function(message) { 16719 message && (0, _heifer.uHasClass)(message, this.settings.showMessageClass) && (0, 16720 _heifer.uRemoveClass)(message, this.settings.showMessageClass); 16721 } 16722 }, { 16723 key: "handleSubmit", 16724 value: function(event) { 16725 var _this = this; 16726 event.preventDefault(), this.hideMessage(this.successMessage), this.hideMessage(this.errorMessage); 16727 var formData = { 16728 lastName: this.formElement.querySelector('input[name="lastName"]').value, 16729 finderNumber: this.formElement.querySelector('input[name="finderNumber"]').value 16730 }; 16731 (0, _heifer.uAjaxWithResponse)("POST", "/api/directMailPreferences.html", !1, (0, 16732 _heifer.uJsonToQueryString)(formData), "application/x-www-form-urlencoded; charset=UTF-8").then(function(response) { 16733 _this.submitUI.reset(), JSON.parse(response).success ? (_this.showMessage(_this.successMessage), 16734 _this.submitUI.element && _this.submitUI.element.setAttribute("disabled", "")) : _this.showMessage(_this.errorMessage); 16735 }); 16736 } 16737 } ]), EmailPreferences; 16738 }(); 16739 exports.default = EmailPreferences; 16740 }, {
16741 "../../core/utilities/heifer.utilities": 19, 16742 "../../shared/forms/submitButton/submitButton": 88, 16743 "core-js/modules/es6.array.iterator": 241, 16744 "core-js/modules/es6.object.keys": 250, 16745 "core-js/modules/es6.object.to-string": 252, 16746 "core-js/modules/es6.symbol": 268, 16747 "core-js/modules/es7.object.get-own-property-descriptors": 272, 16748 "core-js/modules/web.dom.iterable": 274 16749 } ], 16750 61: [ function(require, module, exports) { 16751 "use strict"; 16752 Object.defineProperty(exports, "__esModule", { 16753 value: !0 16754 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 16755 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 16756 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 16757 require("core-js/modules/es6.object.keys"); 16758 var obj, _heifer = require("../../core/utilities/heifer.utilities"), _submitButton = (obj = require("../../shared/forms/submitButton/submitButton")) && obj.__esModule ? obj : { 16759 default: obj 16760 }; 16761 function ownKeys(object, enumerableOnly) { 16762 var keys = Object.keys(object); 16763 if (Object.getOwnPropertySymbols) { 16764 var symbols = Object.getOwnPropertySymbols(object); 16765 enumerableOnly && (symbols = symbols.filter(function(sym) { 16766 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 16767 })), keys.push.apply(keys, symbols); 16768 } 16769 return keys; 16770 } 16771 function _defineProperty(obj, key, value) { 16772 return key in obj ? Object.defineProperty(obj, key, { 16773 value: value, 16774 enumerable: !0, 16775 configurable: !0, 16776 writable: !0 16777 }) : obj[key] = value, obj; 16778 } 16779 function _defineProperties(target, props) { 16780 for (var i = 0; i < props.length; i++) { 16781 var descriptor = props[i]; 16782 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 16783 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 16784 } 16785 } 16786 var EmailPreferences = function() { 16787 function EmailPreferences(element, options) { 16788 !function(instance, Constructor) { 16789 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 16790 }(this, EmailPreferences), this.element = element; 16791 var defaults = { 16792 showMessageClass: "is-revealed" 16793 }; 16794 this._defaults = defaults, this.settings = function(target) { 16795 for (var i = 1; i < arguments.length; i++) { 16796 var source = null != arguments[i] ? arguments[i] : {}; 16797 i % 2 ? ownKeys(source, !0).forEach(function(key) { 16798 _defineProperty(target, key, source[key]); 16799 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 16800 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 16801 }); 16802 } 16803 return target; 16804 }({}, defaults, {}, options), this.init(); 16805 } 16806 return function(Constructor, protoProps, staticProps) { 16807 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 16808 }(EmailPreferences, [ { 16809 key: "init", 16810 value: function() { 16811 this.formElement = this.element.querySelector(".js-email-preferences-form"), this.submitUI = new _submitButton.default(this.formElement.querySelector(".js-email-preferences-submit")), 16812 this.formElement.addEventListener("submit", this.handleSubmit.bind(this)), this.successMessage = this.formElement.querySelector(".js-success-message"), 16813 this.errorMessage = this.formElement.querySelector(".js-error-message"); 16814 } 16815 }, { 16816 key: "showMessage", 16817 value: function(message) { 16818 message && !(0, _heifer.uHasClass)(message, this.settings.showMessageClass) && (0, 16819 _heifer.uAddClass)(message, this.settings.showMessageClass); 16820 } 16821 }, { 16822 key: "hideMessage", 16823 value: function(message) { 16824 message && (0, _heifer.uHasClass)(message, this.settings.showMessageClass) && (0, 16825 _heifer.uRemoveClass)(message, this.settings.showMessageClass); 16826 } 16827 }, { 16828 key: "handleSubmit", 16829 value: function(event) { 16830 var _this = this; 16831 event.preventDefault(), this.hideMessage(this.successMessage), this.hideMessage(this.errorMessage); 16832 var formData = { 16833 subscriberKey: this.formElement.querySelector('input[name="subscriberKey"]').value, 16834 emailPreferences: this.formElement.querySelector('input[name="emailPreferences"]:checked').value 16835 }; 16836 (0, _heifer.uAjaxWithResponse)("POST", "/api/emailPreferences.html", !1, (0, _heifer.uJsonToQueryString)(formData), "application/x-www-form-urlencoded; charset=UTF-8").then(function(response) { 16837 _this.submitUI.reset(), JSON.parse(response).success ? _this.showMessage(_this.successMessage) : _this.showMessage(_this.errorMessage), 16838 _this.submitUI.element && _this.submitUI.element.setAttribute("disabled", ""); 16839 }); 16840 } 16841 } ]), EmailPreferences; 16842 }(); 16843 exports.default = EmailPreferences; 16844 }, {
16845 "../../core/utilities/heifer.utilities": 19, 16846 "../../shared/forms/submitButton/submitButton": 88, 16847 "core-js/modules/es6.array.iterator": 241, 16848 "core-js/modules/es6.object.keys": 250, 16849 "core-js/modules/es6.object.to-string": 252, 16850 "core-js/modules/es6.symbol": 268, 16851 "core-js/modules/es7.object.get-own-property-descriptors": 272, 16852 "core-js/modules/web.dom.iterable": 274 16853 } ], 16854 62: [ function(require, module, exports) { 16855 "use strict"; 16856 Object.defineProperty(exports, "__esModule", { 16857 value: !0 16858 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 16859 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 16860 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 16861 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.regexp.split"), 16862 require("core-js/modules/es6.array.find"); 16863 var obj, _heifer = require("../../core/utilities/heifer.utilities"), _submitButton = (obj = require("./../../shared/forms/submitButton/submitButton")) && obj.__esModule ? obj : { 16864 default: obj 16865 }; 16866 function ownKeys(object, enumerableOnly) { 16867 var keys = Object.keys(object); 16868 if (Object.getOwnPropertySymbols) { 16869 var symbols = Object.getOwnPropertySymbols(object); 16870 enumerableOnly && (symbols = symbols.filter(function(sym) { 16871 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 16872 })), keys.push.apply(keys, symbols); 16873 } 16874 return keys; 16875 } 16876 function _defineProperty(obj, key, value) { 16877 return key in obj ? Object.defineProperty(obj, key, { 16878 value: value, 16879 enumerable: !0, 16880 configurable: !0, 16881 writable: !0 16882 }) : obj[key] = value, obj; 16883 } 16884 function _defineProperties(target, props) { 16885 for (var i = 0; i < props.length; i++) { 16886 var descriptor = props[i]; 16887 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 16888 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 16889 } 16890 } 16891 var KidsEducationCapture = function() { 16892 function KidsEducationCapture(element, options) { 16893 !function(instance, Constructor) { 16894 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 16895 }(this, KidsEducationCapture), this.element = element, this.$element = $(element); 16896 var defaults = {}; 16897 this._defaults = defaults, this.settings = function(target) { 16898 for (var i = 1; i < arguments.length; i++) { 16899 var source = null != arguments[i] ? arguments[i] : {}; 16900 i % 2 ? ownKeys(source, !0).forEach(function(key) { 16901 _defineProperty(target, key, source[key]); 16902 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 16903 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 16904 }); 16905 } 16906 return target; 16907 }({}, defaults, {}, options), this.init(element), this.submitButton = new _submitButton.default(this.element.querySelector(".js-kidsnewsletter-submit")); 16908 } 16909 return function(Constructor, protoProps, staticProps) { 16910 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 16911 }(KidsEducationCapture, [ { 16912 key: "init", 16913 value: function(element) { 16914 var _this = this; 16915 (0, _heifer.uAddEventListener)(this.element, "submit", function(ev) { 16916 ev.preventDefault(); 16917 var fullName = _this.$element.find('input[name="fullName"]').val() ? _this.$element.find('input[name="fullName"]').val() : "", firstName = fullName ? fullName.split(" ")[0] : "", lastName = fullName ? fullName.split(" ").slice(1).join(" ") : "", formData = { 16918 firstName: firstName = firstName || (void 0 !== _this.$element.find('input[name="firstName"]').val() ? _this.$element.find('input[name="firstName"]').val() : ""), 16919 lastName: lastName = lastName || (void 0 !== _this.$element.find('input[name="lastName"]').val() ? _this.$element.find('input[name="lastName"]').val() : ""), 16920 email: _this.$element.find('input[name="email"]').val(), 16921 formSource: _this.$element.find('input[name="formSource"]').val() 16922 }; 16923 (0, _heifer.uAjaxWithResponse)("POST", "/kidsnewsletter-signup.html", !0, (0, _heifer.uJsonToQueryString)(formData), "application/x-www-form-urlencoded; charset=UTF-8").then(function(response) { 16924 JSON.parse(response).body.email.newsletter.success ? _this.$element.parent().find(".newsletter-message").addClass("has-success").text("Success! You are signed up for the newsletter.") : _this.$element.parent().find(".newsletter-message").addClass("has-error").text("Sorry, There was a problem with our request. Please try again later."), 16925 _this.submitButton.element && _this.submitButton.reset(); 16926 }); 16927 }); 16928 } 16929 } ]), KidsEducationCapture; 16930 }(); 16931 exports.default = KidsEducationCapture; 16932 }, {
16933 "../../core/utilities/heifer.utilities": 19, 16934 "./../../shared/forms/submitButton/submitButton": 88, 16935 "core-js/modules/es6.array.find": 239, 16936 "core-js/modules/es6.array.iterator": 241, 16937 "core-js/modules/es6.object.keys": 250, 16938 "core-js/modules/es6.object.to-string": 252, 16939 "core-js/modules/es6.regexp.split": 261, 16940 "core-js/modules/es6.symbol": 268, 16941 "core-js/modules/es7.object.get-own-property-descriptors": 272, 16942 "core-js/modules/web.dom.iterable": 274 16943 } ], 16944 63: [ function(require, module, exports) { 16945 "use strict"; 16946 function _defineProperties(target, props) { 16947 for (var i = 0; i < props.length; i++) { 16948 var descriptor = props[i]; 16949 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 16950 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 16951 } 16952 } 16953 Object.defineProperty(exports, "__esModule", { 16954 value: !0 16955 }), exports.default = void 0, require("core-js/modules/es7.array.includes"), require("core-js/modules/es6.string.includes"); 16956 var Alchemer = function() { 16957 function Alchemer() { 16958 !function(instance, Constructor) { 16959 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 16960 }(this, Alchemer), this.path = location.pathname, this.excluded = [ "/account/login", "/account/forgot", "/account/registration" ], 16961 this.included = this.path.includes("/account/"), this.init(); 16962 } 16963 return function(Constructor, protoProps, staticProps) { 16964 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 16965 }(Alchemer, [ { 16966 key: "init", 16967 value: function() { 16968 var _this = this; 16969 window.onload = function(event) { 16970 if ("undefined" != typeof ApptentiveSDK) try { 16971 var exclude = _this.excluded.some(function(path) { 16972 return _this.path.includes(path); 16973 }); 16974 _this.included && !exclude && (ApptentiveSDK.createConversation(), setTimeout(_this.showSurvey, 6e3)); 16975 } catch (error) {} 16976 }; 16977 } 16978 }, { 16979 key: "showSurvey", 16980 value: function() { 16981 ApptentiveSDK.engage("my_account_login"); 16982 } 16983 } ]), Alchemer; 16984 }(); 16985 exports.default = Alchemer; 16986 }, { 16987 "core-js/modules/es6.string.includes": 264, 16988 "core-js/modules/es7.array.includes": 270 16989 } ], 16990 64: [ function(require, module, exports) { 16991 "use strict"; 16992 Object.defineProperty(exports, "__esModule", { 16993 value: !0 16994 }), exports.default = void 0, require("core-js/modules/es6.regexp.replace"), require("core-js/modules/es6.object.assign"); 16995 var obj, _jquery = (obj = require("jquery")) && obj.__esModule ? obj : { 16996 default: obj 16997 }; 16998 function _defineProperties(target, props) { 16999 for (var i = 0; i < props.length; i++) { 17000 var descriptor = props[i]; 17001 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 17002 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 17003 } 17004 } 17005 var defaults = { 17006 startAmount: 0, 17007 endAmount: 0, 17008 duration: 3e3 17009 }, AnimateNumber = function() { 17010 function AnimateNumber(element, options) { 17011 !function(instance, Constructor) { 17012 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 17013 }(this, AnimateNumber), this.element = element, this.settings = Object.assign({}, defaults, options), 17014 this._defaults = defaults, this.init(); 17015 } 17016 return function(Constructor, protoProps, staticProps) { 17017 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 17018 }(AnimateNumber, [ { 17019 key: "init", 17020 value: function() { 17021 this.run = !1, this.testAnimation(this.element); 17022 } 17023 }, { 17024 key: "testAnimation", 17025 value: function(elem) { 17026 var $elem = (0, _jquery.default)(elem), endAmount = parseInt(this.settings.endAmount), startAmount = parseInt(this.settings.startAmount), $this = this; 17027 this.run || (this.run = !0, $elem.addClass("is-animating"), (0, _jquery.default)({ 17028 stepValue: startAmount 17029 }).animate({ 17030 stepValue: endAmount 17031 }, { 17032 duration: parseInt(this.settings.duration), 17033 easing: "swing", 17034 step: function() { 17035 var completionRatio = this.stepValue / endAmount; 17036 $elem.text($this.formatNumber(this.stepValue)), 99 < completionRatio && ($elem.removeClass("is-animating"), 17037 $elem.addClass("has-animated")); 17038 }, 17039 complete: function() { 17040 $elem.removeClass("is-animating"), $elem.addClass("has-animated"), $elem.text($this.formatNumber(endAmount)); 17041 } 17042 })); 17043 } 17044 }, { 17045 key: "formatNumber", 17046 value: function(number) { 17047 return number.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, "$&,").replace(/[.].*/g, ""); 17048 } 17049 } ]), AnimateNumber; 17050 }(); 17051 exports.default = AnimateNumber; 17052 }, {
17053 "core-js/modules/es6.object.assign": 248, 17054 "core-js/modules/es6.regexp.replace": 259, 17055 jquery: 20 17056 } ], 17057 65: [ function(require, module, exports) { 17058 "use strict"; 17059 Object.defineProperty(exports, "__esModule", { 17060 value: !0 17061 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 17062 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 17063 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 17064 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.array.find"); 17065 var obj, _heifer = require("../../core/utilities/heifer.utilities"), _submitButton = (obj = require("./../../shared/forms/submitButton/submitButton")) && obj.__esModule ? obj : { 17066 default: obj 17067 }; 17068 function ownKeys(object, enumerableOnly) { 17069 var keys = Object.keys(object); 17070 if (Object.getOwnPropertySymbols) { 17071 var symbols = Object.getOwnPropertySymbols(object); 17072 enumerableOnly && (symbols = symbols.filter(function(sym) { 17073 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 17074 })), keys.push.apply(keys, symbols); 17075 } 17076 return keys; 17077 } 17078 function _defineProperty(obj, key, value) { 17079 return key in obj ? Object.defineProperty(obj, key, { 17080 value: value, 17081 enumerable: !0, 17082 configurable: !0, 17083 writable: !0 17084 }) : obj[key] = value, obj; 17085 } 17086 function _defineProperties(target, props) { 17087 for (var i = 0; i < props.length; i++) { 17088 var descriptor = props[i]; 17089 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 17090 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 17091 } 17092 } 17093 var NewsletterSignup = function() { 17094 function NewsletterSignup(element, options) { 17095 !function(instance, Constructor) { 17096 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 17097 }(this, NewsletterSignup), this.element = element, this.$element = $(element); 17098 var defaults = {}; 17099 this._defaults = defaults, this.settings = function(target) { 17100 for (var i = 1; i < arguments.length; i++) { 17101 var source = null != arguments[i] ? arguments[i] : {}; 17102 i % 2 ? ownKeys(source, !0).forEach(function(key) { 17103 _defineProperty(target, key, source[key]); 17104 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 17105 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 17106 }); 17107 } 17108 return target; 17109 }({}, defaults, {}, options), this.init(element), this.submitButton = new _submitButton.default(this.element.querySelector(".js-captureform-submit")); 17110 } 17111 return function(Constructor, protoProps, staticProps) { 17112 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 17113 }(NewsletterSignup, [ { 17114 key: "init", 17115 value: function(element) { 17116 var _this = this; 17117 (0, _heifer.uAddEventListener)(this.element, "submit", function(ev) { 17118 ev.preventDefault(); 17119 var formData = { 17120 firstName: _this.$element.find('input[name="firstName"]').val() || "", 17121 lastName: _this.$element.find('input[name="lastName"]').val() || "", 17122 email: _this.$element.find('input[name="email"]').val() || "", 17123 zipcode: _this.$element.find('input[name="zip"]').val() || "" 17124 }; 17125 (0, _heifer.uAjaxWithResponse)("POST", "/forms/capture.html", !0, (0, _heifer.uJsonToQueryString)(formData), "application/x-www-form-urlencoded; charset=UTF-8").then(function(response) { 17126 _this.$element.parent().parent().find(".captureForm__success").addClass("has-success"), 17127 _this.$element.parent().parent().find(".captureForm__form").addClass("has-success"); 17128 }); 17129 }); 17130 } 17131 } ]), NewsletterSignup; 17132 }(); 17133 exports.default = NewsletterSignup; 17134 }, {
17135 "../../core/utilities/heifer.utilities": 19, 17136 "./../../shared/forms/submitButton/submitButton": 88, 17137 "core-js/modules/es6.array.find": 239, 17138 "core-js/modules/es6.array.iterator": 241, 17139 "core-js/modules/es6.object.keys": 250, 17140 "core-js/modules/es6.object.to-string": 252, 17141 "core-js/modules/es6.symbol": 268, 17142 "core-js/modules/es7.object.get-own-property-descriptors": 272, 17143 "core-js/modules/web.dom.iterable": 274 17144 } ], 17145 66: [ function(require, module, exports) { 17146 "use strict"; 17147 Object.defineProperty(exports, "__esModule", { 17148 value: !0 17149 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 17150 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 17151 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 17152 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.regexp.replace"); 17153 var _heifer = require("../../core/utilities/heifer.utilities"); 17154 function ownKeys(object, enumerableOnly) { 17155 var keys = Object.keys(object); 17156 if (Object.getOwnPropertySymbols) { 17157 var symbols = Object.getOwnPropertySymbols(object); 17158 enumerableOnly && (symbols = symbols.filter(function(sym) { 17159 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 17160 })), keys.push.apply(keys, symbols); 17161 } 17162 return keys; 17163 } 17164 function _defineProperty(obj, key, value) { 17165 return key in obj ? Object.defineProperty(obj, key, { 17166 value: value, 17167 enumerable: !0, 17168 configurable: !0, 17169 writable: !0 17170 }) : obj[key] = value, obj; 17171 } 17172 function _defineProperties(target, props) { 17173 for (var i = 0; i < props.length; i++) { 17174 var descriptor = props[i]; 17175 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 17176 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 17177 } 17178 } 17179 var DoubleTheDonation = function() { 17180 function DoubleTheDonation(element, options) { 17181 !function(instance, Constructor) { 17182 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 17183 }(this, DoubleTheDonation), this.element = element, this.$element = $(element); 17184 var defaults = {}; 17185 this._defaults = defaults, this.settings = function(target) { 17186 for (var i = 1; i < arguments.length; i++) { 17187 var source = null != arguments[i] ? arguments[i] : {}; 17188 i % 2 ? ownKeys(source, !0).forEach(function(key) { 17189 _defineProperty(target, key, source[key]); 17190 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 17191 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 17192 }); 17193 } 17194 return target; 17195 }({}, defaults, {}, options), this.settings.dtdApiKey = "Ae82OopruRBGE6pB", this.donation = { 17196 donationNumber: document.querySelector(".js-cart-confirmation-number") ? document.querySelector(".js-cart-confirmation-number").innerText : "", 17197 firstName: document.querySelector(".js-first-name") ? document.querySelector(".js-first-name").innerText.replace(" ", "") : "", 17198 lastName: document.querySelector(".js-last-name") ? document.querySelector(".js-last-name").innerText : "", 17199 donationAmount: document.querySelector(".js-donation-amount") ? parseFloat(document.querySelector(".js-donation-amount").innerText.replace("$", "").replace(",", "")) : "", 17200 donorEmail: document.querySelector(".js-donor-email") ? document.querySelector(".js-donor-email").innerText : "", 17201 shipping: !!document.querySelector(".js-shipping") 17202 }, this.init(); 17203 } 17204 return function(Constructor, protoProps, staticProps) { 17205 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 17206 }(DoubleTheDonation, [ { 17207 key: "init", 17208 value: function() { 17209 var _this = this; 17210 (0, _heifer.uLoadJSPromise)("https://doublethedonation.com/api/js/ddplugin.js").then(function() { 17211 window.doublethedonation && -1 < window.location.pathname.indexOf("/cart/confirmation.html") ? (_this.gatherDonationData(), 17212 _this.searchPluginInit(), _this.stripDomainFromEmail(), _this.setIdentifierInPlugin()) : window.doublethedonation && _this.searchPluginInit(); 17213 }); 17214 } 17215 }, { 17216 key: "searchPluginInit", 17217 value: function() { 17218 var key = document.createElement("script"); 17219 key.innerHTML = 'var DDCONF = { API_KEY: "'.concat(this.settings.dtdApiKey, '"};'), 17220 this.element.appendChild(key); 17221 } 17222 }, { 17223 key: "gatherDonationData", 17224 value: function() { 17225 var data = { 17226 "360matchpro_public_key": this.settings.dtdApiKey, 17227 campaign: "Heifer.org", 17228 donation_identifier: this.donation.donationNumber, 17229 donation_amount: this.donation.donationAmount, 17230 donor_first_name: this.donation.firstName, 17231 donor_last_name: this.donation.lastName, 17232 donor_email: this.donation.donorEmail 17233 }; 17234 0 < this.donation.donationAmount && "production" === window.Heifer.environment && !this.donation.shipping ? this.registerDonation(data) : this.searchPluginInit(); 17235 } 17236 }, { 17237 key: "registerDonation", 17238 value: function(data) { 17239 doublethedonation.integrations.core.register_donation(data); 17240 } 17241 }, { 17242 key: "stripDomainFromEmail", 17243 value: function() { 17244 var domain = window.doublethedonation.integrations.core.strip_domain(this.donation.donorEmail); 17245 window.doublethedonation.plugin.email_domain(domain); 17246 } 17247 }, { 17248 key: "setIdentifierInPlugin", 17249 value: function() { 17250 window.doublethedonation.plugin.set_donation_identifier(this.donation.donationNumber); 17251 } 17252 } ]), DoubleTheDonation; 17253 }(); 17254 exports.default = DoubleTheDonation; 17255 }, {
17256 "../../core/utilities/heifer.utilities": 19, 17257 "core-js/modules/es6.array.iterator": 241, 17258 "core-js/modules/es6.object.keys": 250, 17259 "core-js/modules/es6.object.to-string": 252, 17260 "core-js/modules/es6.regexp.replace": 259, 17261 "core-js/modules/es6.symbol": 268, 17262 "core-js/modules/es7.object.get-own-property-descriptors": 272, 17263 "core-js/modules/web.dom.iterable": 274 17264 } ], 17265 67: [ function(require, module, exports) { 17266 "use strict"; 17267 Object.defineProperty(exports, "__esModule", { 17268 value: !0 17269 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 17270 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 17271 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 17272 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.function.name"); 17273 var _heifer = require("../../core/utilities/heifer.utilities"); 17274 function ownKeys(object, enumerableOnly) { 17275 var keys = Object.keys(object); 17276 if (Object.getOwnPropertySymbols) { 17277 var symbols = Object.getOwnPropertySymbols(object); 17278 enumerableOnly && (symbols = symbols.filter(function(sym) { 17279 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 17280 })), keys.push.apply(keys, symbols); 17281 } 17282 return keys; 17283 } 17284 function _defineProperty(obj, key, value) { 17285 return key in obj ? Object.defineProperty(obj, key, { 17286 value: value, 17287 enumerable: !0, 17288 configurable: !0, 17289 writable: !0 17290 }) : obj[key] = value, obj; 17291 } 17292 function _defineProperties(target, props) { 17293 for (var i = 0; i < props.length; i++) { 17294 var descriptor = props[i]; 17295 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 17296 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 17297 } 17298 } 17299 var DownloadModal = function() { 17300 function DownloadModal(element, options) { 17301 !function(instance, Constructor) { 17302 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 17303 }(this, DownloadModal), this.element = element; 17304 var defaults = {}; 17305 this._defaults = defaults, this.settings = function(target) { 17306 for (var i = 1; i < arguments.length; i++) { 17307 var source = null != arguments[i] ? arguments[i] : {}; 17308 i % 2 ? ownKeys(source, !0).forEach(function(key) { 17309 _defineProperty(target, key, source[key]); 17310 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 17311 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 17312 }); 17313 } 17314 return target; 17315 }({}, defaults, {}, options), this.init(); 17316 } 17317 return function(Constructor, protoProps, staticProps) { 17318 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 17319 }(DownloadModal, [ { 17320 key: "init", 17321 value: function() { 17322 var _this = this; 17323 this.formElement = this.element.querySelector("form"), this.revealTrigger = document.querySelector("#" + this.element.dataset.revealTrigger), 17324 this.revealClose = this.element.querySelector(".downloadModal__close"), this.submitButton = this.element.querySelector('[type="submit"]'); 17325 var p = document.createElement("p"); 17326 p.innerHTML = "<em>This resource has been sent to your email!</em>", this.confirmationMessage = p, 17327 this.revealTrigger.addEventListener("click", function(ev) { 17328 _this.element.hasAttribute("data-has-session") ? _this.formElement.dispatchEvent((0, 17329 _heifer.uCreateEvent)("submit")) : (0, _heifer.uAddClass)(_this.element, "is-revealed"); 17330 }), this.revealClose.addEventListener("click", function(ev) { 17331 (0, _heifer.uRemoveClass)(_this.element, "is-revealed"); 17332 }), this.formElement.addEventListener("submit", this.handleSubmit.bind(this)); 17333 } 17334 }, { 17335 key: "handleSubmit", 17336 value: function(event) { 17337 var _this2 = this; 17338 event.preventDefault(); 17339 var formData = { 17340 firstName: this.formElement.querySelector('input[name="firstName"]').value, 17341 lastName: this.formElement.querySelector('input[name="lastName"]').value, 17342 email: this.formElement.querySelector('input[name="email"]').value, 17343 product: this.formElement.querySelector('input[name="product"]').value, 17344 msource: this.formElement.querySelector('input[name="msource"]').value, 17345 zip: this.formElement.querySelector('input[name="zip"]').value, 17346 userAgent: navigator.userAgent 17347 }; 17348 (0, _heifer.uRemoveClass)(this.formElement, "has-generic-error"); 17349 (0, _heifer.uAjaxWithResponse)("POST", "/api/downloadFile.html", !1, (0, _heifer.uJsonToQueryString)(formData), "application/x-www-form-urlencoded; charset=UTF-8").then(function(response) { 17350 var responseObject = JSON.parse(response); 17351 0 == responseObject.errors.length ? ((0, _heifer.uRemoveClass)(_this2.element, "is-revealed"), 17352 _this2.revealTrigger.parentNode.parentNode.parentNode.appendChild(_this2.confirmationMessage), 17353 [].forEach.call(document.querySelectorAll(".downloadModal"), function(elem) { 17354 elem.setAttribute("data-has-session", "true"); 17355 }), [].forEach.call(document.getElementsByTagName("input"), function(elem) { 17356 formData.hasOwnProperty(elem.name) && "product" != elem.name && elem.setAttribute("value", formData[elem.name]); 17357 }), window.open(responseObject.body.cart.resource)) : (0, _heifer.uAddClass)(_this2.formElement, "has-generic-error"); 17358 }); 17359 } 17360 } ]), DownloadModal; 17361 }(); 17362 exports.default = DownloadModal; 17363 }, {
17364 "../../core/utilities/heifer.utilities": 19, 17365 "core-js/modules/es6.array.iterator": 241, 17366 "core-js/modules/es6.function.name": 244, 17367 "core-js/modules/es6.object.keys": 250, 17368 "core-js/modules/es6.object.to-string": 252, 17369 "core-js/modules/es6.symbol": 268, 17370 "core-js/modules/es7.object.get-own-property-descriptors": 272, 17371 "core-js/modules/web.dom.iterable": 274 17372 } ], 17373 68: [ function(require, module, exports) { 17374 "use strict"; 17375 Object.defineProperty(exports, "__esModule", { 17376 value: !0 17377 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 17378 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 17379 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 17380 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.array.find"); 17381 var obj, _heifer = require("../../core/utilities/heifer.utilities"), _submitButton = (obj = require("./../../shared/forms/submitButton/submitButton")) && obj.__esModule ? obj : { 17382 default: obj 17383 }; 17384 function ownKeys(object, enumerableOnly) { 17385 var keys = Object.keys(object); 17386 if (Object.getOwnPropertySymbols) { 17387 var symbols = Object.getOwnPropertySymbols(object); 17388 enumerableOnly && (symbols = symbols.filter(function(sym) { 17389 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 17390 })), keys.push.apply(keys, symbols); 17391 } 17392 return keys; 17393 } 17394 function _defineProperty(obj, key, value) { 17395 return key in obj ? Object.defineProperty(obj, key, { 17396 value: value, 17397 enumerable: !0, 17398 configurable: !0, 17399 writable: !0 17400 }) : obj[key] = value, obj; 17401 } 17402 function _defineProperties(target, props) { 17403 for (var i = 0; i < props.length; i++) { 17404 var descriptor = props[i]; 17405 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 17406 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 17407 } 17408 } 17409 var EmailSignup = function() { 17410 function EmailSignup(element, options) { 17411 !function(instance, Constructor) { 17412 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 17413 }(this, EmailSignup), this.element = element, this.$element = $(element); 17414 var defaults = { 17415 resource: element.querySelector(".emailSignup__resource") ? element.querySelector(".emailSignup__resource").innerHTML : null 17416 }; 17417 this._defaults = defaults, this.settings = function(target) { 17418 for (var i = 1; i < arguments.length; i++) { 17419 var source = null != arguments[i] ? arguments[i] : {}; 17420 i % 2 ? ownKeys(source, !0).forEach(function(key) { 17421 _defineProperty(target, key, source[key]); 17422 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 17423 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 17424 }); 17425 } 17426 return target; 17427 }({}, defaults, {}, options), this.init(element), this.submitButton = new _submitButton.default(this.element.querySelector(".js-emailsignup-submit")); 17428 } 17429 return function(Constructor, protoProps, staticProps) { 17430 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 17431 }(EmailSignup, [ { 17432 key: "init", 17433 value: function(element) { 17434 var _this = this; 17435 (0, _heifer.uAddEventListener)(this.element, "submit", function(ev) { 17436 ev.preventDefault(); 17437 var source = _this.element.dataset.source, id = _this.element.dataset.page, model = _this.element.dataset.model, formData = { 17438 firstName: _this.$element.find('input[name="firstName"]').val() || "", 17439 lastName: _this.$element.find('input[name="lastName"]').val() || "", 17440 email: _this.$element.find('input[name="email"]').val() || "", 17441 zipcode: _this.$element.find('input[name="zip"]').val() || "", 17442 date: _this.$element.find('input[name="date"]').val() || "", 17443 source: source || "", 17444 contentId: id, 17445 model: model 17446 }; 17447 (0, _heifer.uAjaxWithResponse)("POST", "/forms/capture.html", !0, (0, _heifer.uJsonToQueryString)(formData), "application/x-www-form-urlencoded; charset=UTF-8").then(function(response) { 17448 _this.$element.parent().parent().find(".emailSignup__success").addClass("has-success"), 17449 _this.$element.parent().parent().find(".emailSignup__form").addClass("has-success"), 17450 _this.settings.resource && window.open(_this.settings.resource); 17451 }); 17452 }); 17453 } 17454 } ]), EmailSignup; 17455 }(); 17456 exports.default = EmailSignup; 17457 }, {
17458 "../../core/utilities/heifer.utilities": 19, 17459 "./../../shared/forms/submitButton/submitButton": 88, 17460 "core-js/modules/es6.array.find": 239, 17461 "core-js/modules/es6.array.iterator": 241, 17462 "core-js/modules/es6.object.keys": 250, 17463 "core-js/modules/es6.object.to-string": 252, 17464 "core-js/modules/es6.symbol": 268, 17465 "core-js/modules/es7.object.get-own-property-descriptors": 272, 17466 "core-js/modules/web.dom.iterable": 274 17467 } ], 17468 69: [ function(require, module, exports) { 17469 "use strict"; 17470 Object.defineProperty(exports, "__esModule", { 17471 value: !0 17472 }), exports.default = void 0; 17473 var _heifer = require("../../core/utilities/heifer.utilities"); 17474 function _defineProperties(target, props) { 17475 for (var i = 0; i < props.length; i++) { 17476 var descriptor = props[i]; 17477 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 17478 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 17479 } 17480 } 17481 var FilterBar = function() { 17482 function FilterBar(elem) { 17483 !function(instance, Constructor) { 17484 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 17485 }(this, FilterBar), this.filter = elem, this.sentinal = document.querySelector(".js-sticky-trigger"), 17486 this.sentinal && (this.setHeight(), this.observer = new window.IntersectionObserver(this.handler.bind(this)), 17487 this.observer.observe(this.sentinal), window.addEventListener("resize", (0, _heifer.uDebounce)(this.setHeight.bind(this)))); 17488 } 17489 return function(Constructor, protoProps, staticProps) { 17490 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 17491 }(FilterBar, [ { 17492 key: "handler", 17493 value: function(entries) { 17494 entries[0].isIntersecting ? this.filter.classList.remove("is-sticky") : this.filter.classList.add("is-sticky"); 17495 } 17496 }, { 17497 key: "setHeight", 17498 value: function() { 17499 this.filter.style.height = "".concat(this.filter.offsetHeight, "px"); 17500 } 17501 } ]), FilterBar; 17502 }(); 17503 exports.default = FilterBar; 17504 }, { 17505 "../../core/utilities/heifer.utilities": 19 17506 } ], 17507 70: [ function(require, module, exports) { 17508 "use strict"; 17509 Object.defineProperty(exports, "__esModule", { 17510 value: !0 17511 }), exports.default = function(elem) { 17512 if (!elem) return; 17513 var filters = document.querySelectorAll('input[type="radio"].js-filter-bar-value'), tabs = new _tabs.default(elem.querySelector(".js-filter-bar-mobile-tabs")), tabClose = elem.querySelectorAll(".js-filter-bar-mobile-tab-close"), reveal = tabs.init(); 17514 Array.from(filters).forEach(function(input) { 17515 input.addEventListener("change", function(ev) { 17516 location.href = ev.target.value; 17517 }); 17518 }), Array.from(tabClose).forEach(function(btn) { 17519 btn.addEventListener("click", function(ev) { 17520 reveal.revealTriggers.forEach(function(reveal) { 17521 reveal.identity == btn.dataset.tabClose && reveal.hideSequence(); 17522 }); 17523 }); 17524 }); 17525 }, require("core-js/modules/es6.string.iterator"), require("core-js/modules/es6.array.from"); 17526 var obj, _tabs = (obj = require("../../shared/tabs/tabs")) && obj.__esModule ? obj : { 17527 default: obj 17528 }; 17529 }, { 17530 "../../shared/tabs/tabs": 130, 17531 "core-js/modules/es6.array.from": 240, 17532 "core-js/modules/es6.string.iterator": 265 17533 } ], 17534 71: [ function(require, module, exports) { 17535 "use strict"; 17536 Object.defineProperty(exports, "__esModule", { 17537 value: !0 17538 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 17539 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 17540 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 17541 require("core-js/modules/es6.object.keys"); 17542 var _jquery = _interopRequireDefault(require("jquery")), _heifer = require("./../../../core/utilities/heifer.utilities"), _submitButton = _interopRequireDefault(require("../submitButton/submitButton")); 17543 function _interopRequireDefault(obj) { 17544 return obj && obj.__esModule ? obj : { 17545 default: obj 17546 }; 17547 } 17548 function ownKeys(object, enumerableOnly) { 17549 var keys = Object.keys(object); 17550 if (Object.getOwnPropertySymbols) { 17551 var symbols = Object.getOwnPropertySymbols(object); 17552 enumerableOnly && (symbols = symbols.filter(function(sym) { 17553 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 17554 })), keys.push.apply(keys, symbols); 17555 } 17556 return keys; 17557 } 17558 function _defineProperty(obj, key, value) { 17559 return key in obj ? Object.defineProperty(obj, key, { 17560 value: value, 17561 enumerable: !0, 17562 configurable: !0, 17563 writable: !0 17564 }) : obj[key] = value, obj; 17565 } 17566 function _defineProperties(target, props) { 17567 for (var i = 0; i < props.length; i++) { 17568 var descriptor = props[i]; 17569 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 17570 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 17571 } 17572 } 17573 var AccountActionForm = function() { 17574 function AccountActionForm(element, options) { 17575 !function(instance, Constructor) { 17576 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 17577 }(this, AccountActionForm), this.element = element, this.$element = (0, _jquery.default)(this.element); 17578 var defaults = { 17579 actionType: "login", 17580 containerSelector: ".js-account-action-form__container", 17581 errorsSelector: ".js-account-action-form__errors", 17582 instructionsSelector: ".js-account-action-form__instructions", 17583 customInterfaceContainerSelector: ".js-account-action-form__custom-interface-container", 17584 customInterfaceTemplateSelector: ".js-account-action-form__custom-interface-template", 17585 socialContainerSelector: ".js-account-action-form__social-container", 17586 socialTemplateSelector: ".js-account-action-form__social-template", 17587 loginRadiusOptions: { 17588 apiKey: window.Heifer.loginRadiusApiKey, 17589 hashTemplate: !0, 17590 sott: window.Heifer.sott, 17591 verificationUrl: window.location, 17592 resetPasswordUrl: "http://" + window.location.hostname + "/account/reset.html", 17593 formValidationMessage: !0, 17594 v2Recaptcha: !1, 17595 invisibleRecaptcha: !1, 17596 appName: window.Heifer.loginRadiusAppName 17597 } 17598 }; 17599 this._defaults = defaults, this.settings = function(target) { 17600 for (var i = 1; i < arguments.length; i++) { 17601 var source = null != arguments[i] ? arguments[i] : {};
17602 i % 2 ? ownKeys(source, !0).forEach(function(key) { 17603 _defineProperty(target, key, source[key]); 17604 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 17605 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 17606 }); 17607 } 17608 return target; 17609 }({}, defaults, {}, options), this.LRObject = !1, this.containerElem = this.element.querySelector(this.settings.containerSelector), 17610 this.errorsElem = this.element.querySelector(this.settings.errorsSelector), this.instructionsElem = this.element.querySelector(this.settings.instructionsSelector), 17611 this.customInterfaceContainerElem = this.element.querySelector(this.settings.customInterfaceContainerSelector), 17612 this.customInterfaceTemplateElem = this.element.querySelector(this.settings.customInterfaceTemplateSelector), 17613 this.socialContainerElem = this.element.querySelector(this.settings.socialContainerSelector), 17614 this.socialTemplateElem = this.element.querySelector(this.settings.socialTemplateSelector), 17615 this.submitButton = "", this.forgotContainer = document.querySelector(".login__forgot-portal"), 17616 this.resetContainer = document.querySelector(".login__portal-reset"), this.init(); 17617 } 17618 return function(Constructor, protoProps, staticProps) { 17619 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 17620 }(AccountActionForm, [ { 17621 key: "init", 17622 value: function() { 17623 _jquery.default.ajaxSetup({ 17624 cache: !0 17625 }), _jquery.default.getScript("https://auth.lrcontent.com/v2/js/LoginRadiusV2.js").done(this.takeAction.bind(this)), 17626 _jquery.default.ajaxSetup({ 17627 cache: !1 17628 }); 17629 } 17630 }, { 17631 key: "takeAction", 17632 value: function() { 17633 this.LRObject = new window.LoginRadiusV2(this.settings.loginRadiusOptions), window.LRObject = this.LRObject, 17634 this.initAction(); 17635 } 17636 }, { 17637 key: "initAction", 17638 value: function() { 17639 var _this = this, actionType = this.settings.actionType, actionOptions = { 17640 container: this.containerElem.id, 17641 onSuccess: this.onActionSuccess.bind(this), 17642 onError: this.onActionError.bind(this) 17643 }; 17644 this.LRObject.util.ready(function() { 17645 window.Heifer.loginRadiusUid = _this.LRObject.sessionData.getUid(), _this.customizeForm(), 17646 _this.LRObject.init(actionType, actionOptions), "login" !== actionType && "registration" !== actionType || (_this.customInterfaceContainerElem && _this.customInterfaceTemplateElem && _this.initCustomInterface(), 17647 _this.socialContainerElem && _this.socialTemplateElem && _this.initSocial()); 17648 }); 17649 } 17650 }, { 17651 key: "onActionSuccess", 17652 value: function(actionResponse) { 17653 void 0 !== actionResponse.Profile && this.saveSession(actionResponse.access_token), 17654 void 0 !== actionResponse.IsPosted && (this.forgotContainer && (0, _heifer.uAddClass)(this.forgotContainer, "is-successful"), 17655 this.resetContainer && (0, _heifer.uAddClass)(this.resetContainer, "is-successful")); 17656 } 17657 }, { 17658 key: "saveSession", 17659 value: function(accessToken) { 17660 var url = (0, _heifer.uFormatRelativeUrl)("/account/savesession.html?accessToken=".concat(accessToken)); 17661 (0, _heifer.uAjaxWithResponse)("GET", url, !0).then(this.onSaveSessionSuccess.bind(this)).catch(this.onSaveSessionError.bind(this)); 17662 } 17663 }, { 17664 key: "onSaveSessionSuccess", 17665 value: function(saveSessionResponse) { 17666 window.location.reload(!1); 17667 } 17668 }, { 17669 key: "onSaveSessionError", 17670 value: function(saveSessionError) { 17671 console.warn(saveSessionError), this.submitButton.reset(); 17672 } 17673 }, { 17674 key: "onActionError", 17675 value: function(actionError) { 17676 this.errorsElem.innerHTML = actionError[0].Description, this.submitButton.reset(); 17677 } 17678 }, { 17679 key: "customizeForm", 17680 value: function() { 17681 var scope = this; 17682 this.LRObject.$hooks.call("customizeFormLabel", { 17683 emailid: "Email*", 17684 password: "Password*" 17685 }), this.LRObject.$hooks.call("customizeFormPlaceholder", { 17686 emailid: "Ex: [email protected]" 17687 }), this.LRObject.$hooks.call("formAttributes", { 17688 emailid: "type=email&autocomplete=email&autocapitalize=off&autocorrect=off&required=true", 17689 password: "required=true" 17690 }), this.LRObject.$hooks.call("mapErrorMessages", { 17691 code: 938, 17692 message: "An email has been sent to the address provided with instructions to reset your password. If there is an account associated with this email address, you should receive instructions. If you do not receive it in the next few minutes, please verify the address above is correct.", 17693 description: "An email has been sent to the address provided with instructions to reset your password. If there is an account associated with this email address, you should receive instructions. If you do not receive it in the next few minutes, please verify the address above is correct.." 17694 }), this.LRObject.$hooks.call("mapErrorMessages", { 17695 code: 936, 17696 message: 'There was an error creating an account with that information. If you think you may already have an account, try <a href="/account/login.html" class="link__inline">logging in</a> or <a href="/account/forgot.html" class="link__inline">resetting your password</a>.', 17697 description: 'There was an error creating an account with that information. If you think you may already have an account, try <a href="/account/login.html" class="link__inline">logging in</a> or <a href="/account/forgot.html" class="link__inline">resetting your password</a>.' 17698 }), (0, _heifer.uTypeOf)("Function", this.settings.onInit) && this.LRObject.$hooks.register("afterFormRender", this.settings.onInit.bind(this)), 17699 this.LRObject.$hooks.register("afterFormRender", function() { 17700 scope.submitButton = new _submitButton.default(document.querySelector(".loginradius-submit"), { 17701 input: !0 17702 }); 17703 }), this.LRObject.$hooks.register("afterValidation", function(name) { 17704 scope.submitButton.reset(); 17705 }); 17706 } 17707 }, { 17708 key: "initCustomInterface", 17709 value: function() { 17710 this.LRObject.customInterface("".concat(this.customInterfaceContainerElem.id), { 17711 templateName: this.customInterfaceTemplateElem.
17711id 17712 }); 17713 } 17714 }, { 17715 key: "initSocial", 17716 value: function() { 17717 var socialOptions = { 17718 container: this.socialContainerElem.id, 17719 templateName: this.socialTemplateElem.id, 17720 onSuccess: this.onSocialSuccess.bind(this), 17721 onError: this.onSocialError.bind(this) 17722 }; 17723 this.LRObject.init("socialLogin", socialOptions); 17724 } 17725 }, { 17726 key: "onSocialSuccess", 17727 value: function(socialResponse) { 17728 window.Heifer.UID = socialResponse.Profile.Uid, this.saveSession(socialResponse.access_token); 17729 } 17730 }, { 17731 key: "onSocialError", 17732 value: function(socialError) { 17733 console.error("this.LRObject initSocial:", socialError); 17734 } 17735 } ]), AccountActionForm; 17736 }(); 17737 exports.default = AccountActionForm; 17738 }, { 17739 "../submitButton/submitButton": 88, 17740 "./../../../core/utilities/heifer.utilities": 19, 17741 "core-js/modules/es6.array.iterator": 241, 17742 "core-js/modules/es6.object.keys": 250, 17743 "core-js/modules/es6.object.to-string": 252, 17744 "core-js/modules/es6.symbol": 268, 17745 "core-js/modules/es7.object.get-own-property-descriptors": 272, 17746 "core-js/modules/web.dom.iterable": 274, 17747 jquery: 20 17748 } ], 17749 72: [ function(require, module, exports) { 17750 "use strict"; 17751 Object.defineProperty(exports, "__esModule", { 17752 value: !0 17753 }), exports.default = function(data) { 17754 var endpoint = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : "/api/cart/checkout.html"; 17755 return function(data, endpoint) { 17756 var errorMessage = "We were not able to process your request. Please try again or contact Donor Services at 855.9HUNGER (855.948.6437)."; 17757 return new Promise(function(resolve, reject) { 17758 $.ajax({ 17759 url: endpoint, 17760 type: "POST", 17761 data: { 17762 data: data 17763 }, 17764 success: function(response) { 17765 try { 17766 response.body.cart && response.body.cart.paymentResponse.errors && 0 < response.body.cart.paymentResponse.errors.length ? reject(response.body.cart.paymentResponse) : response.body.subscription && response.body.subscription.errors && 0 < response.body.subscription.errors.length && reject(response.body.subscription.errors), 17767 resolve(response); 17768 } catch (e) { 17769 reject(e); 17770 } 17771 }, 17772 error: function(response, two) { 17773 response && response.status && 500 == response.status && reject(errorMessage), reject(errorMessage); 17774 } 17775 }); 17776 }); 17777 }(data, endpoint); 17778 }, require("core-js/modules/es6.promise"), require("core-js/modules/es6.object.to-string"); 17779 }, { 17780 "core-js/modules/es6.object.to-string": 252, 17781 "core-js/modules/es6.promise": 253 17782 } ], 17783 73: [ function(require, module, exports) { 17784 "use strict"; 17785 Object.defineProperty(exports, "__esModule", { 17786 value: !0 17787 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 17788 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 17789 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 17790 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.function.name"); 17791 var _heifer = require("../../../core/utilities/heifer.utilities"); 17792 function ownKeys(object, enumerableOnly) { 17793 var keys = Object.keys(object); 17794 if (Object.getOwnPropertySymbols) { 17795 var symbols = Object.getOwnPropertySymbols(object); 17796 enumerableOnly && (symbols = symbols.filter(function(sym) { 17797 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 17798 })), keys.push.apply(keys, symbols); 17799 } 17800 return keys; 17801 } 17802 function _defineProperty(obj, key, value) { 17803 return key in obj ? Object.defineProperty(obj, key, { 17804 value: value, 17805 enumerable: !0, 17806 configurable: !0, 17807 writable: !0 17808 }) : obj[key] = value, obj; 17809 } 17810 function _defineProperties(target, props) { 17811 for (var i = 0; i < props.length; i++) { 17812 var descriptor = props[i]; 17813 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 17814 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 17815 } 17816 } 17817 var ButtonInput = function() { 17818 function ButtonInput(element, options) { 17819 !function(instance, Constructor) { 17820 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 17821 }(this, ButtonInput), this.element = element, this.$element = $(element); 17822 var defaults = { 17823 namespace: ".js-button-input", 17824 activeClass: "is-active" 17825 }; 17826 this._defaults = defaults, this.settings = function(target) { 17827 for (var i = 1; i < arguments.length; i++) { 17828 var source = null != arguments[i] ? arguments[i] : {};
17829 i % 2 ? ownKeys(source, !0).forEach(function(key) { 17830 _defineProperty(target, key, source[key]); 17831 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 17832 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 17833 }); 17834 } 17835 return target; 17836 }({}, defaults, {}, options), this.init(); 17837 } 17838 return function(Constructor, protoProps, staticProps) { 17839 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 17840 }(ButtonInput, [ { 17841 key: "init", 17842 value: function() { 17843 this.radio = this.element.querySelector(this.settings.namespace + "-radio"), this.label = this.element.querySelector(this.settings.namespace + "-label"), 17844 this.inputWrapper = this.element.querySelector(this.settings.namespace + "-wrapper"), 17845 this.input = this.inputWrapper.querySelector(this.settings.namespace + "-input"), 17846 this.check = this.element.querySelector(".js-button-input-check"), this.setEventListeners(); 17847 } 17848 }, { 17849 key: "setEventListeners", 17850 value: function() { 17851 var _this = this; 17852 [].forEach.call(document.querySelectorAll('input[name="' + this.radio.name + '"]'), function(radio) { 17853 radio.addEventListener("change", function(ev) { 17854 _this.radio.checked ? _this.showInput() : _this.hideInput(ev.target); 17855 }, !0); 17856 }); 17857 } 17858 }, { 17859 key: "showInput", 17860 value: function() { 17861 (0, _heifer.uAddClass)(this.element, this.settings.activeClass), this.radio.disabled = !0, 17862 this.input.disabled = !1, this.inputWrapper.removeAttribute("hidden"), this.input.focus(), 17863 this.input.required = !0; 17864 } 17865 }, { 17866 key: "hideInput", 17867 value: function(input) { 17868 (0, _heifer.uRemoveClass)(this.element, this.settings.activeClass), this.resetValidity(), 17869 this.radio.disabled = !1, this.input.disabled = !0, this.inputWrapper.setAttribute("hidden", ""), 17870 this.input.required = !1; 17871 } 17872 }, { 17873 key: "resetValidity", 17874 value: function() { 17875 (0, _heifer.uRemoveClass)(this.input, "is-invalid is-empty"), this.input.removeAttribute("aria-invalid"); 17876 } 17877 } ]), ButtonInput; 17878 }(); 17879 exports.default = ButtonInput; 17880 }, { 17881 "../../../core/utilities/heifer.utilities": 19, 17882 "core-js/modules/es6.array.iterator": 241, 17883 "core-js/modules/es6.function.name": 244, 17884 "core-js/modules/es6.object.keys": 250, 17885 "core-js/modules/es6.object.to-string": 252, 17886 "core-js/modules/es6.symbol": 268, 17887 "core-js/modules/es7.object.get-own-property-descriptors": 272, 17888 "core-js/modules/web.dom.iterable": 274 17889 } ], 17890 74: [ function(require, module, exports) { 17891 "use strict"; 17892 Object.defineProperty(exports, "__esModule", { 17893 value: !0 17894 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 17895 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 17896 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 17897 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.function.name"); 17898 var _heifer = require("../../../core/utilities/heifer.utilities"); 17899 function ownKeys(object, enumerableOnly) { 17900 var keys = Object.keys(object); 17901 if (Object.getOwnPropertySymbols) { 17902 var symbols = Object.getOwnPropertySymbols(object); 17903 enumerableOnly && (symbols = symbols.filter(function(sym) { 17904 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 17905 })), keys.push.apply(keys, symbols); 17906 } 17907 return keys; 17908 } 17909 function _defineProperty(obj, key, value) { 17910 return key in obj ? Object.defineProperty(obj, key, { 17911 value: value, 17912 enumerable: !0, 17913 configurable: !0, 17914 writable: !0 17915 }) : obj[key] = value, obj; 17916 } 17917 function _defineProperties(target, props) { 17918 for (var i = 0; i < props.length; i++) { 17919 var descriptor = props[i]; 17920 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 17921 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 17922 } 17923 } 17924 var ButtonSelect = function() { 17925 function ButtonSelect(element, options) { 17926 !function(instance, Constructor) { 17927 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 17928 }(this, ButtonSelect), this.element = element, this.$element = $(element); 17929 var defaults = { 17930 namespace: ".js-button-select", 17931 activeClass: "is-active" 17932 }; 17933 this._defaults = defaults, this.settings = function(target) { 17934 for (var i = 1; i < arguments.length; i++) { 17935 var source = null != arguments[i] ? arguments[i] : {};
17936 i % 2 ? ownKeys(source, !0).forEach(function(key) { 17937 _defineProperty(target, key, source[key]); 17938 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 17939 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 17940 }); 17941 } 17942 return target; 17943 }({}, defaults, {}, options), this.init(); 17944 } 17945 return function(Constructor, protoProps, staticProps) { 17946 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 17947 }(ButtonSelect, [ { 17948 key: "init", 17949 value: function() { 17950 this.radio = this.element.querySelector(this.settings.namespace + "-radio"), this.label = this.element.querySelector(this.settings.namespace + "-label"), 17951 this.input = this.element.querySelector(this.settings.namespace + "-input"), this.selectWrapper = this.element.querySelector(this.settings.namespace + "-wrapper"), 17952 this.select = this.selectWrapper.querySelector(this.settings.namespace + "-select"), 17953 this.check = this.element.querySelector(".js-button-select-check"), this.setEventListeners(); 17954 } 17955 }, { 17956 key: "setEventListeners", 17957 value: function() { 17958 var _this = this; 17959 [].forEach.call(document.querySelectorAll('input[name="' + this.radio.name + '"]'), function(radio) { 17960 radio.addEventListener("change", function(ev) { 17961 _this.radio.checked ? _this.showSelect() : _this.hideSelect(); 17962 }, !0); 17963 }); 17964 } 17965 }, { 17966 key: "showSelect", 17967 value: function() { 17968 (0, _heifer.uAddClass)(this.element, this.settings.activeClass), this.radio.disabled = !0, 17969 this.select.disabled = !1, this.select.required = !0, this.selectWrapper.removeAttribute("hidden"); 17970 } 17971 }, { 17972 key: "hideSelect", 17973 value: function() { 17974 (0, _heifer.uRemoveClass)(this.element, this.settings.activeClass), this.resetValidity(), 17975 this.radio.disabled = !1, this.select.disabled = !0, this.select.required = !1, 17976 this.selectWrapper.setAttribute("hidden", ""); 17977 } 17978 }, { 17979 key: "resetValidity", 17980 value: function() { 17981 (0, _heifer.uRemoveClass)(this.select, "is-invalid is-empty"), this.select.removeAttribute("aria-invalid"); 17982 } 17983 } ]), ButtonSelect; 17984 }(); 17985 exports.default = ButtonSelect; 17986 }, { 17987 "../../../core/utilities/heifer.utilities": 19, 17988 "core-js/modules/es6.array.iterator": 241, 17989 "core-js/modules/es6.function.name": 244, 17990 "core-js/modules/es6.object.keys": 250, 17991 "core-js/modules/es6.object.to-string": 252, 17992 "core-js/modules/es6.symbol": 268, 17993 "core-js/modules/es7.object.get-own-property-descriptors": 272, 17994 "core-js/modules/web.dom.iterable": 274 17995 } ], 17996 75: [ function(require, module, exports) { 17997 "use strict"; 17998 Object.defineProperty(exports, "__esModule", { 17999 value: !0 18000 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 18001 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 18002 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 18003 require("core-js/modules/es6.object.keys"); 18004 var obj, _heifer = require("./../../../core/utilities/heifer.utilities"), _accountActionForm = (obj = require("./../accountActionForm/accountActionForm")) && obj.__esModule ? obj : { 18005 default: obj 18006 }; 18007 function ownKeys(object, enumerableOnly) { 18008 var keys = Object.keys(object); 18009 if (Object.getOwnPropertySymbols) { 18010 var symbols = Object.getOwnPropertySymbols(object); 18011 enumerableOnly && (symbols = symbols.filter(function(sym) { 18012 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 18013 })), keys.push.apply(keys, symbols); 18014 } 18015 return keys; 18016 } 18017 function _defineProperty(obj, key, value) { 18018 return key in obj ? Object.defineProperty(obj, key, { 18019 value: value, 18020 enumerable: !0, 18021 configurable: !0, 18022 writable: !0 18023 }) : obj[key] = value, obj; 18024 } 18025 function _defineProperties(target, props) { 18026 for (var i = 0; i < props.length; i++) { 18027 var descriptor = props[i]; 18028 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 18029 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 18030 } 18031 } 18032 var CheckoutLogin = function() { 18033 function CheckoutLogin(element, options) { 18034 !function(instance, Constructor) { 18035 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 18036 }(this, CheckoutLogin), this.element = element; 18037 var defaults = { 18038 fieldsSelector: "input, textarea, select, button", 18039 triggerSelector: ".js-checkout-login__trigger", 18040 fieldsetSelector: ".js-checkout-login__fieldset", 18041 revealClass: "is-revealed" 18042 }; 18043 this._defaults = defaults, this.settings = function(target) { 18044 for (var i = 1; i < arguments.length; i++) { 18045 var source = null != arguments[i] ? arguments[i] : {};
18046 i % 2 ? ownKeys(source, !0).forEach(function(key) { 18047 _defineProperty(target, key, source[key]); 18048 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 18049 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 18050 }); 18051 } 18052 return target; 18053 }({}, defaults, {}, options), this.isExpanded = !1, this.trigger = this.element.querySelector(this.settings.triggerSelector), 18054 this.fieldset = this.element.querySelector(this.settings.fieldsetSelector), this.accountActionForm = this.initAccountActionForm(), 18055 this.bindEvents(); 18056 } 18057 return function(Constructor, protoProps, staticProps) { 18058 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 18059 }(CheckoutLogin, [ { 18060 key: "initAccountActionForm", 18061 value: function() { 18062 return new _accountActionForm.default(this.element, { 18063 actionType: "login", 18064 onInit: this.onAccountActionFormInit.bind(this) 18065 }); 18066 } 18067 }, { 18068 key: "onAccountActionFormInit", 18069 value: function() { 18070 this.setUIState(), this.setFieldsState(); 18071 } 18072 }, { 18073 key: "setUIState", 18074 value: function() { 18075 this.isExpanded ? ((0, _heifer.uAddClass)(this.trigger, this.settings.revealClass), 18076 (0, _heifer.uAddClass)(this.fieldset, this.settings.revealClass)) : ((0, _heifer.uRemoveClass)(this.trigger, this.settings.revealClass), 18077 (0, _heifer.uRemoveClass)(this.fieldset, this.settings.revealClass)); 18078 } 18079 }, { 18080 key: "setFieldsState", 18081 value: function() { 18082 this.isExpanded ? this.enableFields() : this.disableFields(); 18083 } 18084 }, { 18085 key: "bindEvents", 18086 value: function() { 18087 var _this = this; 18088 this.trigger.addEventListener("click", function() { 18089 _this.isExpanded = !_this.isExpanded, _this.setUIState(), _this.setFieldsState(); 18090 }); 18091 } 18092 }, { 18093 key: "enableFields", 18094 value: function() { 18095 [].forEach.call(this.fieldset.querySelectorAll(this.settings.fieldsSelector), function(field) { 18096 field.disabled = !1; 18097 }); 18098 } 18099 }, { 18100 key: "disableFields", 18101 value: function() { 18102 [].forEach.call(this.fieldset.querySelectorAll(this.settings.fieldsSelector), function(field) { 18103 field.disabled = !0; 18104 }); 18105 } 18106 } ]), CheckoutLogin; 18107 }(); 18108 exports.default = CheckoutLogin; 18109 }, { 18110 "./../../../core/utilities/heifer.utilities": 19, 18111 "./../accountActionForm/accountActionForm": 71, 18112 "core-js/modules/es6.array.iterator": 241, 18113 "core-js/modules/es6.object.keys": 250, 18114 "core-js/modules/es6.object.to-string": 252, 18115 "core-js/modules/es6.symbol": 268, 18116 "core-js/modules/es7.object.get-own-property-descriptors": 272, 18117 "core-js/modules/web.dom.iterable": 274 18118 } ], 18119 76: [ function(require, module, exports) { 18120 "use strict"; 18121 Object.defineProperty(exports, "__esModule", { 18122 value: !0 18123 }), exports.default = void 0, require("core-js/modules/es6.string.iterator"), require("core-js/modules/es6.array.from"), 18124 require("core-js/modules/es6.regexp.to-string"), require("core-js/modules/es6.date.to-string"), 18125 require("core-js/modules/es7.symbol.async-iterator"), require("core-js/modules/es7.object.get-own-property-descriptors"), 18126 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 18127 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 18128 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.function.name"), 18129 require("core-js/modules/es6.regexp.split"); 18130 var _jquery = _interopRequireDefault(require("jquery")), _heifer = (_interopRequireDefault(require("./../../../core/forms/gauntlet")), 18131 require("./../../../core/utilities/heifer.utilities")); 18132 function _interopRequireDefault(obj) { 18133 return obj && obj.__esModule ? obj : { 18134 default: obj 18135 }; 18136 } 18137 function _toConsumableArray(arr) { 18138 return function(arr) { 18139 if (Array.isArray(arr)) { 18140 for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; 18141 return arr2; 18142 } 18143 }(arr) || function(iter) { 18144 if (Symbol.iterator in Object(iter) || "[object Arguments]" === Object.prototype.toString.call(iter)) return Array.from(iter); 18145 }(arr) || function() { 18146 throw new TypeError("Invalid attempt to spread non-iterable instance"); 18147 }(); 18148 } 18149 function ownKeys(object, enumerableOnly) { 18150 var keys = Object.keys(object); 18151 if (Object.getOwnPropertySymbols) { 18152 var symbols = Object.getOwnPropertySymbols(object); 18153 enumerableOnly && (symbols = symbols.filter(function(sym) { 18154 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 18155 })), keys.push.apply(keys, symbols); 18156 } 18157 return keys; 18158 } 18159 function _defineProperty(obj, key, value) { 18160 return key in obj ? Object.defineProperty(obj, key, { 18161 value: value, 18162 enumerable: !0, 18163 configurable: !0, 18164 writable: !0 18165 }) : obj[key] = value, obj; 18166 } 18167 function _defineProperties(target, props) { 18168 for (var i = 0; i < props.length; i++) { 18169 var descriptor = props[i]; 18170 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 18171 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 18172 } 18173 } 18174 var ConditionalField = function() { 18175 function ConditionalField(element, options) { 18176 !function(instance, Constructor) { 18177 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 18178 }(this, ConditionalField), this.element = element, this.$element = (0, _jquery.default)(element); 18179 var defaults = { 18180 targetFields: "input, select, textarea", 18181 enableAttr: "data-conditional-field-enable", 18182 disableAttr: "data-conditional-field-disable", 18183 stateClasses: {
18184 enable: "is-conditionally-enabled", 18185 disable: "is-conditionally-disabled" 18186 }, 18187 ignoreAttr: "data-conditional-field-ignore" 18188 }; 18189 this._defaults = defaults, this.settings = function(target) { 18190 for (var i = 1; i < arguments.length; i++) { 18191 var source = null != arguments[i] ? arguments[i] : {}; 18192 i % 2 ? ownKeys(source, !0).forEach(function(key) { 18193 _defineProperty(target, key, source[key]); 18194 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 18195 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 18196 }); 18197 } 18198 return target; 18199 }({}, defaults, {}, options), this.type = !!(0, _heifer.uIs)(this.element, "input") && this.element.type, 18200 this.targets = this.getConditionalTargets(), this.init(this.element); 18201 } 18202 return function(Constructor, protoProps, staticProps) { 18203 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 18204 }(ConditionalField, [ { 18205 key: "getConditionalTargets", 18206 value: function() { 18207 var enableTargets = [], disableTargets = []; 18208 return this.element.hasAttribute(this.settings.enableAttr) && (enableTargets = _toConsumableArray(this.getTargetElems(this.element.getAttribute(this.settings.enableAttr)))), 18209 this.element.hasAttribute(this.settings.disableAttr) && (disableTargets = _toConsumableArray(this.getTargetElems(this.element.getAttribute(this.settings.disableAttr)))), 18210 { 18211 enable: enableTargets, 18212 disable: disableTargets 18213 }; 18214 } 18215 }, { 18216 key: "getTargetElems", 18217 value: function(attr) { 18218 var elems = attr.split(" ").map(function(id) { 18219 return document.getElementById(id) || !1; 18220 }); 18221 return elems.length ? elems.filter(function(elem) { 18222 return !1 !== elem; 18223 }) : elems; 18224 } 18225 }, { 18226 key: "init", 18227 value: function(argument_0) { 18228 var elem = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.element; 18229 this.bindEvents(elem), this.applyState(elem); 18230 } 18231 }, { 18232 key: "bindEvents", 18233 value: function() { 18234 var _this = this; 18235 "radio" === this.type ? [].forEach.call(this.element.form.querySelectorAll("input[type='radio'][name='".concat(this.element.name, "']")), function(input) { 18236 input.addEventListener("change", function(ev) { 18237 return _this.applyState(_this.element); 18238 }); 18239 }) : "checkbox" === this.type ? this.element.addEventListener("change", function(ev) { 18240 return _this.applyState(ev.target); 18241 }) : this.element.addEventListener("input", function(ev) { 18242 return _this.applyState(ev.target); 18243 }); 18244 } 18245 }, { 18246 key: "applyState", 18247 value: function(argument_0) { 18248 var elem = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.element; 18249 this.isValid(elem) ? this.applyValidState(elem) : this.applyInvalidState(elem); 18250 } 18251 }, { 18252 key: "applyValidState", 18253 value: function(argument_0) { 18254 0 < arguments.length && void 0 !== argument_0 || this.element; 18255 this.targets.enable.length && this.enableTargets(this.targets.enable), this.targets.disable.length && this.disableTargets(this.targets.disable); 18256 } 18257 }, { 18258 key: "applyInvalidState", 18259 value: function(argument_0) { 18260 0 < arguments.length && void 0 !== argument_0 || this.element; 18261 this.targets.enable.length && this.disableTargets(this.targets.enable), this.targets.disable.length && this.enableTargets(this.targets.disable); 18262 } 18263 }, { 18264 key: "disableTargets", 18265 value: function(targets) { 18266 var _this2 = this, _this$settings$stateC = this.settings.stateClasses, enable = _this$settings$stateC.enable, disable = _this$settings$stateC.disable;
18267 targets.forEach(function(target) { 18268 (0, _heifer.uHasClass)(target, enable) && (0, _heifer.uRemoveClass)(target, enable), 18269 (0, _heifer.uHasClass)(target, disable) || (0, _heifer.uAddClass)(target, disable), 18270 [].forEach.call(target.querySelectorAll(_this2.settings.targetFields), function(field) { 18271 field.hasAttribute(_this2.settings.ignoreAttr) || (field.disabled = !0); 18272 }); 18273 }); 18274 } 18275 }, { 18276 key: "enableTargets", 18277 value: function(targets) { 18278 var _this3 = this, _this$settings$stateC2 = this.settings.stateClasses, enable = _this$settings$stateC2.enable, disable = _this$settings$stateC2.disable; 18279 targets.forEach(function(target) { 18280 (0, _heifer.uHasClass)(target, disable) && (0, _heifer.uRemoveClass)(target, disable), 18281 (0, _heifer.uHasClass)(target, enable) || (0, _heifer.uAddClass)(target, enable), 18282 [].forEach.call(target.querySelectorAll(_this3.settings.targetFields), function(field) { 18283 field.hasAttribute(_this3.settings.ignoreAttr) || (field.disabled = !1); 18284 }); 18285 }); 18286 } 18287 }, { 18288 key: "isValid", 18289 value: function(argument_0) { 18290 var elem = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.element; 18291 return this.settings.gauntlet ? this.settings.gauntlet.testInputValidity(elem) : !!elem.checkValidity() && ("checkbox" === elem.type || "radio" === elem.type ? elem.checked : "" === elem.value.trim()); 18292 } 18293 } ]), ConditionalField; 18294 }(); 18295 exports.default = ConditionalField; 18296 }, { 18297 "./../../../core/forms/gauntlet": 1, 18298 "./../../../core/utilities/heifer.utilities": 19, 18299 "core-js/modules/es6.array.from": 240, 18300 "core-js/modules/es6.array.iterator": 241, 18301 "core-js/modules/es6.date.to-string": 243, 18302 "core-js/modules/es6.function.name": 244, 18303 "core-js/modules/es6.object.keys": 250, 18304 "core-js/modules/es6.object.to-string": 252, 18305 "core-js/modules/es6.regexp.split": 261, 18306 "core-js/modules/es6.regexp.to-string": 262, 18307 "core-js/modules/es6.string.iterator": 265, 18308 "core-js/modules/es6.symbol": 268, 18309 "core-js/modules/es7.object.get-own-property-descriptors": 272, 18310 "core-js/modules/es7.symbol.async-iterator": 273, 18311 "core-js/modules/web.dom.iterable": 274, 18312 jquery: 20 18313 } ], 18314 77: [ function(require, module, exports) { 18315 "use strict"; 18316 function ownKeys(object, enumerableOnly) { 18317 var keys = Object.keys(object); 18318 if (Object.getOwnPropertySymbols) { 18319 var symbols = Object.getOwnPropertySymbols(object); 18320 enumerableOnly && (symbols = symbols.filter(function(sym) { 18321 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 18322 })), keys.push.apply(keys, symbols); 18323 } 18324 return keys; 18325 } 18326 function _defineProperty(obj, key, value) { 18327 return key in obj ? Object.defineProperty(obj, key, { 18328 value: value, 18329 enumerable: !0, 18330 configurable: !0, 18331 writable: !0 18332 }) : obj[key] = value, obj; 18333 } 18334 function _defineProperties(target, props) { 18335 for (var i = 0; i < props.length; i++) { 18336 var descriptor = props[i]; 18337 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 18338 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 18339 } 18340 } 18341 Object.defineProperty(exports, "__esModule", { 18342 value: !0 18343 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 18344 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 18345 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 18346 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.string.iterator"), 18347 require("core-js/modules/es6.array.from"); 18348 var CustomSelect = function() { 18349 function CustomSelect(element, options) { 18350 if (function(instance, Constructor) { 18351 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 18352 }(this, CustomSelect), !element) return !1; 18353 this.element = element, this.metadata = this.element.hasAttribute("data-customSelect-options") ? this.element.getAttribute("customSelect-options") : {}; 18354 var defaults = { 18355 wrapperClass: "customSelect", 18356 labelTextClass: "customSelect__label-text", 18357 buttonClass: "customSelect__button", 18358 iconClass: "customSelect__select-icon", 18359 selectClass: "customSelect__select", 18360 buttonFocusClass: "focus", 18361 buttonHoverClass: "hover", 18362 buttonPlaceholderClass: "placeholder", 18363 addClassesTo: "wrapper" 18364 }; 18365 this._defaults = defaults, this.settings = function(target) { 18366 for (var i = 1; i < arguments.length; i++) { 18367 var source = null != arguments[i] ? arguments[i] : {};
18368 i % 2 ? ownKeys(source, !0).forEach(function(key) { 18369 _defineProperty(target, key, source[key]); 18370 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 18371 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 18372 }); 18373 } 18374 return target; 18375 }({}, defaults, {}, options, {}, this.metadata), this.wrapper = this.element.parentElement, 18376 this.wrapperLabel = this.wrapper.parentElement, this.labelText = this.getLabelText(), 18377 this.button = this.createButton(), this.init(); 18378 } 18379 return function(Constructor, protoProps, staticProps) { 18380 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 18381 }(CustomSelect, [ { 18382 key: "getLabelText", 18383 value: function() { 18384 return this.element.previousElementSibling || this.wrapLabelText(), this.element.previousElementSibling; 18385 } 18386 }, { 18387 key: "wrapLabelText", 18388 value: function() { 18389 for (var textNodes = [], childNodes = Array.from(this.wrapper.childNodes), i = 0; i < childNodes.length && childNodes[i] !== this.element; i += 1) textNodes.push(this.wrapper.removeChild(childNodes[i])); 18390 if (textNodes.length) { 18391 var textNodesString = textNodes.reduce(function(prev, current, index) { 18392 return 1 === current.nodeType ? prev + current.outerHTML : 3 === current.nodeType && "" !== current.nodeValue.trim() ? prev + current.nodeValue : prev; 18393 }, ""); 18394 "" !== textNodesString.trim() && this.element.insertAdjacentHTML("beforebegin", "<span>".concat(textNodesString.trim(), "</span>\n")); 18395 } 18396 } 18397 }, { 18398 key: "getIcon", 18399 value: function() { 18400 return this.element.previousElementSibling; 18401 } 18402 }, { 18403 key: "createButton", 18404 value: function() { 18405 return this.element.insertAdjacentHTML("beforebegin", '<span aria-hidden="true" class="'.concat(this.settings.buttonClass, '"></span>')), 18406 this.element.previousElementSibling; 18407 } 18408 }, { 18409 key: "init", 18410 value: function() { 18411 return this.prepElems(), this.updateSelectButton(), this.bindEvents(), this; 18412 } 18413 }, { 18414 key: "prepElems", 18415 value: function() { 18416 var _this = this; 18417 window.requestAnimationFrame(function() { 18418 _this.wrapper.classList.add(_this.settings.wrapperClass), _this.element.classList.add(_this.settings.selectClass), 18419 _this.labelText && _this.labelText.classList.add(_this.settings.labelTextClass); 18420 }); 18421 } 18422 }, { 18423 key: "bindEvents", 18424 value: function() { 18425 this.element.addEventListener("change", this.updateSelectButton.bind(this)), this.element.addEventListener("customSelect/Change", this.updateSelectButton.bind(this)), 18426 this.element.addEventListener("mouseenter", this.addSelectHover.bind(this)), this.element.addEventListener("mouseleave", this.removeSelectHover.bind(this)), 18427 this.element.addEventListener("focus", this.addSelectFocus.bind(this)), this.element.addEventListener("blur", this.removeSelectFocus.bind(this)); 18428 } 18429 }, { 18430 key: "updateSelectButton", 18431 value: function() {
18432 var _this2 = this, updatedValues = this.getSelectValue(); 18433 this.button.innerHTML !== updatedValues.text && window.requestAnimationFrame(function() { 18434 _this2.button.innerHTML = updatedValues.text, "" === updatedValues.value ? _this2.addSelectPlaceholder() : _this2.removeSelectPlaceholder(); 18435 }); 18436 } 18437 }, { 18438 key: "getSelectValue", 18439 value: function() { 18440 return { 18441 text: this.element.options[this.element.selectedIndex].text, 18442 value: this.element.options[this.element.selectedIndex].value 18443 }; 18444 } 18445 }, { 18446 key: "addSelectPlaceholder", 18447 value: function() { 18448 var _this3 = this, buttonPlaceholderClass = this.settings.buttonPlaceholderClass; 18449 this[this.settings.addClassesTo].classList.contains(buttonPlaceholderClass) || window.requestAnimationFrame(function() { 18450 _this3[_this3.settings.addClassesTo].classList.add(buttonPlaceholderClass); 18451 }); 18452 } 18453 }, { 18454 key: "removeSelectPlaceholder", 18455 value: function() { 18456 var _this4 = this, buttonPlaceholderClass = this.settings.buttonPlaceholderClass; 18457 this[this.settings.addClassesTo].classList.contains(buttonPlaceholderClass) && window.requestAnimationFrame(function() { 18458 _this4[_this4.settings.addClassesTo].classList.remove(buttonPlaceholderClass); 18459 }); 18460 } 18461 }, { 18462 key: "addSelectFocus", 18463 value: function() { 18464 var _this5 = this, buttonFocusClass = this.settings.buttonFocusClass; 18465 this[this.settings.addClassesTo].classList.contains(buttonFocusClass) || window.requestAnimationFrame(function() { 18466 _this5[_this5.settings.addClassesTo].classList.add(buttonFocusClass), _this5.wrapperLabel.classList.add("is-focus"); 18467 }); 18468 } 18469 }, { 18470 key: "removeSelectFocus", 18471 value: function() { 18472 var _this6 = this, buttonFocusClass = this.settings.buttonFocusClass; 18473 this[this.settings.addClassesTo].classList.contains(buttonFocusClass) && window.requestAnimationFrame(function() { 18474 _this6[_this6.settings.addClassesTo].classList.remove(buttonFocusClass), _this6.wrapperLabel.classList.remove("is-focus"); 18475 }); 18476 } 18477 }, { 18478 key: "addSelectHover", 18479 value: function() { 18480 var _this7 = this, buttonHoverClass = this.settings.buttonHoverClass; 18481 this[this.settings.addClassesTo].classList.contains(buttonHoverClass) || window.requestAnimationFrame(function() { 18482 _this7[_this7.settings.addClassesTo].classList.add(buttonHoverClass); 18483 }); 18484 } 18485 }, { 18486 key: "removeSelectHover", 18487 value: function() { 18488 var _this8 = this, buttonHoverClass = this.settings.buttonHoverClass; 18489 this[this.settings.addClassesTo].classList.contains(buttonHoverClass) && window.requestAnimationFrame(function() { 18490 _this8[_this8.settings.addClassesTo].classList.remove(buttonHoverClass); 18491 }); 18492 } 18493 } ]), CustomSelect; 18494 }(); 18495 exports.default = CustomSelect; 18496 }, { 18497 "core-js/modules/es6.array.from": 240, 18498 "core-js/modules/es6.array.iterator": 241, 18499 "core-js/modules/es6.object.keys": 250, 18500 "core-js/modules/es6.object.to-string": 252, 18501 "core-js/modules/es6.string.iterator": 265, 18502 "core-js/modules/es6.symbol": 268, 18503 "core-js/modules/es7.object.get-own-property-descriptors": 272, 18504 "core-js/modules/web.dom.iterable": 274 18505 } ],
18506 78: [ function(require, module, exports) { 18507 "use strict"; 18508 Object.defineProperty(exports, "__esModule", { 18509 value: !0 18510 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 18511 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 18512 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 18513 require("core-js/modules/es6.object.keys"); 18514 var obj, _flatpickr = (obj = require("flatpickr")) && obj.__esModule ? obj : { 18515 default: obj 18516 }; 18517 function ownKeys(object, enumerableOnly) { 18518 var keys = Object.keys(object); 18519 if (Object.getOwnPropertySymbols) { 18520 var symbols = Object.getOwnPropertySymbols(object); 18521 enumerableOnly && (symbols = symbols.filter(function(sym) { 18522 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 18523 })), keys.push.apply(keys, symbols); 18524 } 18525 return keys; 18526 } 18527 function _defineProperty(obj, key, value) { 18528 return key in obj ? Object.defineProperty(obj, key, { 18529 value: value, 18530 enumerable: !0, 18531 configurable: !0, 18532 writable: !0 18533 }) : obj[key] = value, obj; 18534 } 18535 function _defineProperties(target, props) { 18536 for (var i = 0; i < props.length; i++) { 18537 var descriptor = props[i]; 18538 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 18539 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 18540 } 18541 } 18542 var DatePicker = function() { 18543 function DatePicker(element, options) { 18544 !function(instance, Constructor) { 18545 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 18546 }(this, DatePicker), this.element = element, this.$element = $(element); 18547 var defaults = {}; 18548 this._defaults = defaults, this.settings = function(target) { 18549 for (var i = 1; i < arguments.length; i++) { 18550 var source = null != arguments[i] ? arguments[i] : {}; 18551 i % 2 ? ownKeys(source, !0).forEach(function(key) { 18552 _defineProperty(target, key, source[key]); 18553 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 18554 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 18555 }); 18556 } 18557 return target; 18558 }({}, defaults, {}, options), this.init(); 18559 } 18560 return function(Constructor, protoProps, staticProps) { 18561 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 18562 }(DatePicker, [ { 18563 key: "init", 18564 value: function() { 18565 var today = new Date(), datePickerInput = document.querySelector(".datePicker__input"); 18566 new _flatpickr.default(datePickerInput, { 18567 dateFormat: "Y-m-d", 18568 altFormat: "F j, Y", 18569 minDate: today, 18570 defaultDate: today 18571 }); 18572 } 18573 } ]), DatePicker; 18574 }(); 18575 exports.default = DatePicker; 18576 }, { 18577 "core-js/modules/es6.array.iterator": 241, 18578 "core-js/modules/es6.object.keys": 250, 18579 "core-js/modules/es6.object.to-string": 252, 18580 "core-js/modules/es6.symbol": 268, 18581 "core-js/modules/es7.object.get-own-property-descriptors": 272, 18582 "core-js/modules/web.dom.iterable": 274, 18583 flatpickr: 278 18584 } ],
18585 79: [ function(require, module, exports) { 18586 "use strict"; 18587 Object.defineProperty(exports, "__esModule", { 18588 value: !0 18589 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 18590 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 18591 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 18592 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.regexp.split"); 18593 var _heifer = require("../../../core/utilities/heifer.utilities"); 18594 function ownKeys(object, enumerableOnly) { 18595 var keys = Object.keys(object); 18596 if (Object.getOwnPropertySymbols) { 18597 var symbols = Object.getOwnPropertySymbols(object); 18598 enumerableOnly && (symbols = symbols.filter(function(sym) { 18599 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 18600 })), keys.push.apply(keys, symbols); 18601 } 18602 return keys; 18603 } 18604 function _defineProperty(obj, key, value) { 18605 return key in obj ? Object.defineProperty(obj, key, { 18606 value: value, 18607 enumerable: !0, 18608 configurable: !0, 18609 writable: !0 18610 }) : obj[key] = value, obj; 18611 } 18612 function _defineProperties(target, props) { 18613 for (var i = 0; i < props.length; i++) { 18614 var descriptor = props[i]; 18615 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 18616 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 18617 } 18618 } 18619 var File = function() { 18620 function File(element, options) { 18621 !function(instance, Constructor) { 18622 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 18623 }(this, File), this.element = element, this.$element = $(element); 18624 var defaults = {}; 18625 this._defaults = defaults, this.settings = function(target) { 18626 for (var i = 1; i < arguments.length; i++) { 18627 var source = null != arguments[i] ? arguments[i] : {}; 18628 i % 2 ? ownKeys(source, !0).forEach(function(key) { 18629 _defineProperty(target, key, source[key]); 18630 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 18631 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 18632 }); 18633 } 18634 return target; 18635 }({}, defaults, {}, options), this.init(); 18636 } 18637 return function(Constructor, protoProps, staticProps) { 18638 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 18639 }(File, [ { 18640 key: "init", 18641 value: function() { 18642 var fileInput = this.element, file = "", fileName = "", fileMessage = fileInput.parentElement.parentElement.querySelector(".file__message"); 18643 fileMessage.innerText = "No file selected.", (0, _heifer.uAddEventListener)(fileInput, "change", function(ev) { 18644 0 < (file = fileInput.value).length ? (fileName = file.split("\\").pop(), fileMessage.innerText = fileName) : fileMessage.innerText = "No file selected."; 18645 }); 18646 } 18647 } ]), File; 18648 }(); 18649 exports.default = File; 18650 }, { 18651 "../../../core/utilities/heifer.utilities": 19, 18652 "core-js/modules/es6.array.iterator": 241, 18653 "core-js/modules/es6.object.keys": 250, 18654 "core-js/modules/es6.object.to-string": 252, 18655 "core-js/modules/es6.regexp.split": 261, 18656 "core-js/modules/es6.symbol": 268, 18657 "core-js/modules/es7.object.get-own-property-descriptors": 272, 18658 "core-js/modules/web.dom.iterable": 274 18659 } ],
18660 80: [ function(require, module, exports) { 18661 "use strict"; 18662 Object.defineProperty(exports, "__esModule", { 18663 value: !0 18664 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 18665 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 18666 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 18667 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.regexp.match"), 18668 require("core-js/modules/es6.regexp.split"); 18669 var obj, _jquery = (obj = require("jquery")) && obj.__esModule ? obj : { 18670 default: obj 18671 }; 18672 function ownKeys(object, enumerableOnly) { 18673 var keys = Object.keys(object); 18674 if (Object.getOwnPropertySymbols) { 18675 var symbols = Object.getOwnPropertySymbols(object); 18676 enumerableOnly && (symbols = symbols.filter(function(sym) { 18677 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 18678 })), keys.push.apply(keys, symbols); 18679 } 18680 return keys; 18681 } 18682 function _defineProperty(obj, key, value) { 18683 return key in obj ? Object.defineProperty(obj, key, { 18684 value: value, 18685 enumerable: !0, 18686 configurable: !0, 18687 writable: !0 18688 }) : obj[key] = value, obj; 18689 } 18690 function _defineProperties(target, props) { 18691 for (var i = 0; i < props.length; i++) { 18692 var descriptor = props[i]; 18693 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 18694 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 18695 } 18696 } 18697 var GiftMessage = function() { 18698 function GiftMessage(element, options) { 18699 !function(instance, Constructor) { 18700 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 18701 }(this, GiftMessage), this.element = element, this.$element = (0, _jquery.default)(this.element); 18702 var defaults = { 18703 fieldSelector: ".js-gift-message__field", 18704 feedbackSelector: ".js-gift-message__feedback", 18705 feedbackValidClass: "is-valid", 18706 feedbackInalidClass: "is-invalid", 18707 lineCharacterLimit: 35, 18708 stringLineBreak: "\n", 18709 regexLineBreaks: /\r\n|\n|\r/, 18710 regexBeginningUntilFirstWhitespace: /^\S*/, 18711 regexLastCharsWithOptionalTrailingWhitespace: /\S*(\s)?$/ 18712 }; 18713 this._defaults = defaults, this.settings = function(target) { 18714 for (var i = 1; i < arguments.length; i++) { 18715 var source = null != arguments[i] ? arguments[i] : {}; 18716 i % 2 ? ownKeys(source, !0).forEach(function(key) { 18717 _defineProperty(target, key, source[key]); 18718 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 18719 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 18720 }); 18721 } 18722 return target; 18723 }({}, defaults, {}, options), this.field = this.element.querySelector(this.settings.fieldSelector), 18724 this.feedback = this.element.querySelector(this.settings.feedbackSelector), this.bindEvents(); 18725 } 18726 return function(Constructor, protoProps, staticProps) { 18727 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 18728 }(GiftMessage, [ { 18729 key: "bindEvents", 18730 value: function() { 18731 var _this = this; 18732 this.field.addEventListener("input", function() { 18733 _this.giftMessageValidity(_this.field); 18734 }), this.field.addEventListener("blur", function() { 18735 _this.giftMessageValidity(_this.field); 18736 }), this.giftMessageValidity(this.field); 18737 } 18738 }, { 18739 key: "giftMessageFormatting", 18740 value: function(argument_0, argument_1, argument_2, argument_3) { 18741 var i, j, line, str = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : "", intWidth = 1 < arguments.length && void 0 !== argument_1 ? argument_1 : 35, strBreak = 2 < arguments.length && void 0 !== argument_2 ? argument_2 : "\n", cut = 3 < arguments.length && void 0 !== argument_3 && argument_3; 18742 if (intWidth < 1) return str; 18743 var match, reBeginningUntilFirstWhitespace = /^\S*/, reLastCharsWithOptionalTrailingWhitespace = /\S*(\s)?$/, lines = str.split(/\r\n|\n|\r/), l = lines.length; 18744 for (i = 0; i < l; lines[i++] += line) for (line = lines[i], lines[i] = ""; line.length > intWidth; ) { 18745 var slice = line.slice(0, intWidth + 1), ltrim = 0, rtrim = 0; 18746 if ((match = slice.match(reLastCharsWithOptionalTrailingWhitespace))[1]) j = intWidth, 18747 ltrim = 1; else if ((j = slice.length - match[0].length) && (rtrim = 1), !j && cut && intWidth && (j = intWidth), 18748 !j) { 18749 var charsUntilNextWhitespace = (line.slice(intWidth).match(reBeginningUntilFirstWhitespace) || [ "" ])[0]; 18750 j = slice.length + charsUntilNextWhitespace.length; 18751 } 18752 lines[i] += line.slice(0, j - rtrim), line = line.slice(j + ltrim), lines[i] += line.length ? strBreak : ""; 18753 } 18754 return lines.join("\n"); 18755 } 18756 }, { 18757 key: "giftMessageValidity", 18758 value: function(argument_0, argument_1) { 18759 var field = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.field, lines = (1 < arguments.length && void 0 !== argument_1 || this.feedback, 18760 this.giftMessageFormatting(field.value, 35).split("\n")), maxCharacters = 175; 18761 5 < lines.length && (maxCharacters = lines.reduce(function(num, current, index) { 18762 return index < 5 ? num + current.length : num; 18763 }, 0)), this.field.maxLength = maxCharacters, this.updateFeedback(lines.length); 18764 } 18765 }, { 18766 key: "updateFeedback", 18767 value: function(lines) { 18768 this.feedback.setAttribute("data-lines", Math.min(lines, 6)), lines <= 5 ? (this.feedback.classList.remove(this.settings.feedbackInalidClass), 18769 this.feedback.classList.add(this.settings.feedbackValidClass), this.feedback.innerHTML = "You have ".concat(5 - (lines - 1), " line").concat(1 < 5 - (lines - 1) ? "s" : "", " left.")) : (this.feedback.classList.remove(this.settings.feedbackValidClass), 18770 this.feedback.classList.add(this.settings.feedbackInvalidClass), this.feedback.innerHTML = "Sorry, your message is too long."); 18771 } 18772 } ]), GiftMessage; 18773 }(); 18774 exports.default = GiftMessage; 18775 }, {
18776 "core-js/modules/es6.array.iterator": 241, 18777 "core-js/modules/es6.object.keys": 250, 18778 "core-js/modules/es6.object.to-string": 252, 18779 "core-js/modules/es6.regexp.match": 258, 18780 "core-js/modules/es6.regexp.split": 261, 18781 "core-js/modules/es6.symbol": 268, 18782 "core-js/modules/es7.object.get-own-property-descriptors": 272, 18783 "core-js/modules/web.dom.iterable": 274, 18784 jquery: 20 18785 } ], 18786 81: [ function(require, module, exports) { 18787 "use strict"; 18788 Object.defineProperty(exports, "__esModule", { 18789 value: !0 18790 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 18791 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 18792 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 18793 require("core-js/modules/es6.object.keys"); 18794 var obj, _jquery = (obj = require("jquery")) && obj.__esModule ? obj : { 18795 default: obj 18796 }; 18797 function ownKeys(object, enumerableOnly) { 18798 var keys = Object.keys(object); 18799 if (Object.getOwnPropertySymbols) { 18800 var symbols = Object.getOwnPropertySymbols(object); 18801 enumerableOnly && (symbols = symbols.filter(function(sym) { 18802 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 18803 })), keys.push.apply(keys, symbols); 18804 } 18805 return keys; 18806 } 18807 function _defineProperty(obj, key, value) { 18808 return key in obj ? Object.defineProperty(obj, key, { 18809 value: value, 18810 enumerable: !0, 18811 configurable: !0, 18812 writable: !0 18813 }) : obj[key] = value, obj; 18814 } 18815 function _defineProperties(target, props) { 18816 for (var i = 0; i < props.length; i++) { 18817 var descriptor = props[i]; 18818 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 18819 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 18820 } 18821 } 18822 var InputFilled = function() { 18823 function InputFilled(element, options) { 18824 !function(instance, Constructor) { 18825 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 18826 }(this, InputFilled), this.element = element, this.$element = (0, _jquery.default)(element); 18827 var defaults = { 18828 stateClasses: { 18829 filled: "isnt-empty", 18830 empty: "is-empty" 18831 } 18832 }; 18833 this._defaults = defaults, this.settings = function(target) { 18834 for (var i = 1; i < arguments.length; i++) { 18835 var source = null != arguments[i] ? arguments[i] : {}; 18836 i % 2 ? ownKeys(source, !0).forEach(function(key) { 18837 _defineProperty(target, key, source[key]); 18838 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 18839 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 18840 }); 18841 } 18842 return target; 18843 }({}, defaults, {}, options), this.init(); 18844 } 18845 return function(Constructor, protoProps, staticProps) { 18846 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 18847 }(InputFilled, [ { 18848 key: "init", 18849 value: function() { 18850 this.fieldEmptiness(); 18851 } 18852 }, { 18853 key: "fieldEmptiness", 18854 value: function(argument_0) { 18855 var elem = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.element; 18856 this.bindEvents(elem), this.applyState(elem); 18857 } 18858 }, { 18859 key: "bindEvents", 18860 value: function() { 18861 var _this = this; 18862 this.element.addEventListener("change", function(ev) { 18863 return _this.applyState(ev.target); 18864 }); 18865 } 18866 }, { 18867 key: "applyState", 18868 value: function(argument_0) { 18869 var elem = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.element; 18870 this.isEmpty(elem) ? this.applyEmptyState(elem) : this.applyFilledState(elem); 18871 } 18872 }, { 18873 key: "applyFilledState", 18874 value: function(argument_0) { 18875 var _this2 = this, elem = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.element; 18876 window.requestAnimationFrame(function() { 18877 elem.classList.contains(_this2.settings.stateClasses.empty) && elem.classList.remove(_this2.settings.stateClasses.empty), 18878 elem.classList.contains(_this2.settings.stateClasses.filled) || elem.classList.add(_this2.settings.stateClasses.filled); 18879 }); 18880 } 18881 }, { 18882 key: "applyEmptyState", 18883 value: function(argument_0) { 18884 var _this3 = this, elem = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.element; 18885 window.requestAnimationFrame(function() { 18886 elem.classList.contains(_this3.settings.stateClasses.filled) && elem.classList.remove(_this3.settings.stateClasses.filled), 18887 elem.classList.contains(_this3.settings.stateClasses.empty) || elem.classList.add(_this3.settings.stateClasses.empty); 18888 }); 18889 } 18890 }, { 18891 key: "isEmpty", 18892 value: function(argument_0) { 18893 return "" === (0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.element).value.trim(); 18894 } 18895 } ]), InputFilled; 18896 }();
18897 exports.default = InputFilled; 18898 }, { 18899 "core-js/modules/es6.array.iterator": 241, 18900 "core-js/modules/es6.object.keys": 250, 18901 "core-js/modules/es6.object.to-string": 252, 18902 "core-js/modules/es6.symbol": 268, 18903 "core-js/modules/es7.object.get-own-property-descriptors": 272, 18904 "core-js/modules/web.dom.iterable": 274, 18905 jquery: 20 18906 } ], 18907 82: [ function(require, module, exports) { 18908 "use strict"; 18909 Object.defineProperty(exports, "__esModule", { 18910 value: !0 18911 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 18912 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 18913 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 18914 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.string.iterator"), 18915 require("core-js/modules/es6.array.from"), require("core-js/modules/es6.regexp.replace"), 18916 require("core-js/modules/es6.math.trunc"); 18917 var obj, _nouislider = (obj = require("nouislider")) && obj.__esModule ? obj : { 18918 default: obj 18919 }, _heifer = require("./../../../core/utilities/heifer.utilities"); 18920 function ownKeys(object, enumerableOnly) { 18921 var keys = Object.keys(object); 18922 if (Object.getOwnPropertySymbols) { 18923 var symbols = Object.getOwnPropertySymbols(object); 18924 enumerableOnly && (symbols = symbols.filter(function(sym) { 18925 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 18926 })), keys.push.apply(keys, symbols); 18927 } 18928 return keys; 18929 } 18930 function _defineProperty(obj, key, value) { 18931 return key in obj ? Object.defineProperty(obj, key, { 18932 value: value, 18933 enumerable: !0, 18934 configurable: !0, 18935 writable: !0 18936 }) : obj[key] = value, obj; 18937 } 18938 function _defineProperties(target, props) { 18939 for (var i = 0; i < props.length; i++) { 18940 var descriptor = props[i]; 18941 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 18942 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 18943 } 18944 } 18945 var InputSlider = function() { 18946 function InputSlider(element, options) { 18947 !function(instance, Constructor) { 18948 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 18949 }(this, InputSlider), this.element = element, this.$element = $(element); 18950 var defaults = {}; 18951 this._defaults = defaults, this.settings = function(target) { 18952 for (var i = 1; i < arguments.length; i++) { 18953 var source = null != arguments[i] ? arguments[i] : {}; 18954 i % 2 ? ownKeys(source, !0).forEach(function(key) { 18955 _defineProperty(target, key, source[key]); 18956 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 18957 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 18958 }); 18959 } 18960 return target; 18961 }({}, defaults, {}, options), this.init(); 18962 } 18963 return function(Constructor, protoProps, staticProps) { 18964 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 18965 }(InputSlider, [ { 18966 key: "init", 18967 value: function() { 18968 this.slider = this.element.querySelector(".js-no-ui-slider"), this.identity = this.element.id, 18969 this.sliderMin = parseInt(this.element.dataset.minVal, 10), this.sliderMax = parseInt(this.element.dataset.maxVal, 10), 18970 this.sliderStart = parseInt(this.element.dataset.startVal, 10), this.sliderStep = parseInt(this.element.dataset.increment, 10), 18971 this.sliderUnit = this.element.dataset.unit, this.sliderInput = this.element.querySelector(".js-input-slider-amount-label > input"), 18972 this.sliderQuantityInput = this.element.querySelector(".js-input-slider-quantity-label > input"), 18973 this.stepsAsTooltip = this.element.dataset.stepsAsTooltip, this.tooltipMobilePrice = document.querySelector('.js-tooltip-price-mobile[data-sli
18973der="'.concat(this.identity, '"]')), 18974 this.tooltipMobileShare = document.querySelector('.js-tooltip-shares-mobile[data-slider="'.concat(this.identity, '"]')), 18975 this.sliderIcon = this.element.nextElementSibling.querySelector(".js-slider-icon"), 18976 this.sliderIcon && (this.sliderIcon.style.height = "100%"), this.svg = document.querySelector('.js-svg[data-slider="'.concat(this.identity, '"]')), 18977 this.isProductSlider = !1, "product" === this.element.dataset.type && (this.isProductSlider = !0), 18978 this.initSlider(), this.setEventListeners(); 18979 } 18980 }, { 18981 key: "initSlider", 18982 value: function() { 18983 _nouislider.default.create(this.slider, { 18984 start: [ this.sliderStart ], 18985 step: this.sliderMin, 18986 connect: "lower", 18987 cssPrefix: "inputSlider__", 18988 range: { 18989 min: [ this.sliderMin ], 18990 max: [ this.sliderMax ] 18991 }, 18992 tooltips: [ { 18993 to: function(value) { 18994 return "$" + Math.trunc(Math.round(value)); 18995 }, 18996 from: function(value) { 18997 return value.replace("$", ""); 18998 } 18999 } ], 19000 format: { 19001 to: function(value) { 19002 return Math.trunc(Math.round(value)); 19003 }, 19004 from: function(value) { 19005 return value; 19006 } 19007 }, 19008 pips: { 19009 mode: "count", 19010 values: Math.min(this.sliderStep, 20), 19011 density: 100, 19012 stepped: !0, 19013 format: { 19014 to: function(value) { 19015 return "$" + (0, _heifer.uThousands)(Math.trunc(Math.round(value))); 19016 }, 19017 from: function(value) { 19018 return value.replace("$", ""); 19019 } 19020 } 19021 } 19022 }), this.slider.noUiSlider && (this.stepsAsTooltip && this.updateSlider(this.sliderMin, this.sliderUnit), 19023 this.removePips(), window.dispatchEvent((0, _heifer.uCreateCustomEvent)("input-slider-init"))); 19024 } 19025 }, { 19026 key: "setEventListeners", 19027 value: function() { 19028 var _this = this; 19029 this.slider.noUiSlider.on("change", function() { 19030 var newValue = _this.slider.noUiSlider.get(); 19031 (_this.sliderInput.value = newValue) === _this.sliderMax ? (_this.sliderHasHitMax(), 19032 _this.sliderQuantityInput.value = _this.sliderStep) : (newValue === _this.sliderMin ? _this.sliderHasHitMin() : _this.sliderHasChanged(), 19033 window.dispatchEvent((0, _heifer.uCreateEvent)("input-slider-change"))), _this.stepsAsTooltip && (_this.sliderQuantityInput.value = _this.slider.noUiSlider.get() / _this.sliderMin, 19034 _this.sliderQuantityInput.dispatchEvent((0, _heifer.uCreateEvent)("input"))); 19035 }), this.slider.noUiSlider.on("update", function() { 19036 var newValue = _this.slider.noUiSlider.get(); 19037 if ((_this.sliderInput.value = newValue) === _this.sliderMax ? _this.sliderHasHitMax() : newValue === _this.sliderMin ? _this.sliderHasHitMin() : _this.sliderHasChanged(), 19038 _this.isProductSlider) { 19039 var newHeight = _this.slider.noUiSlider.get() / _this.sliderMin * (100 / (_this.sliderMax / _this.sliderMin)); 19040 _this.sliderIcon && (_this.sliderIcon.style.height = Math.round(newHeight) + "%"); 19041 } 19042 _this.tooltipMobilePrice && (_this.tooltipMobilePrice.textContent = "$" + (0, _heifer.uThousands)(_this.slider.noUiSlider.get())), 19043 _this.tooltipMobileShare && (_this.tooltipMobileShare.textContent = _this.slider.noUiSlider.get() / _this.sliderMin + " " + _this.sliderUnit); 19044 }); 19045 } 19046 }, { 19047 key: "updateSlider", 19048 value: function(step, unit) { 19049 this.slider.noUiSlider.updateOptions({ 19050 tooltips: [ { 19051 to: function(value) { 19052 return '<div class="inputSlider__tooltip-price">$' + (0, _heifer.uThousands)(Math.trunc(Math.round(value))) + '</div><div class="inputSlider__tooltip-shares"><span class="inputSlider__tooltip-value js-slider-tooltip-value">' + Math.round(value / step) + '</span><div class="inputSlider__tooltip-unit js-slider-tooltip-unit">' + unit + "</div></div>"; 19053 }, 19054 from: function(value) { 19055 return value; 19056 } 19057 } ] 19058 }); 19059 } 19060 }, { 19061 key: "removePips", 19062 value: function() { 19063 var pips = Array.from(this.slider.querySelectorAll(".inputSlider__value-large")); 19064 (0, _heifer.uAddClass)(pips[0], "is-first"), (0, _heifer.uAddClass)(pips[pips.length - 1], "is-last"), 19065 pips.shift(), pips.pop(), [].forEach.call(pips, function(pip) { 19066 pip.parentNode.removeChild(pip); 19067 }); 19068 } 19069 }, { 19070 key: "sliderHasHitMax", 19071 value: function() { 19072 (0, _heifer.uAddClass)(this.slider, "inputSlider--max"), (0, _heifer.uRemoveClass)(this.slider, "inputSlider--min"), 19073 window.dispatchEvent((0, _heifer.uCreateEvent)("input-slider-max")); 19074 } 19075 }, { 19076 key: "sliderHasHitMin", 19077 value: function() { 19078 (0, _heifer.uAddClass)(this.slider, "inputSlider--min"), (0, _heifer.uRemoveClass)(this.slider, "inputSlider--max"), 19079 window.dispatchEvent((0, _heifer.uCreateEvent)("input-slider-min")); 19080 } 19081 }, { 19082 key: "sliderHasChanged", 19083 value: function() { 19084 (0, _heifer.uRemoveClass)(this.slider, "inputSlider--min"), (0, _heifer.uRemoveClass)(this.slider, "inputSlider--max"); 19085 } 19086 } ]), InputSlider; 19087 }();
19088 exports.default = InputSlider; 19089 }, { 19090 "./../../../core/utilities/heifer.utilities": 19, 19091 "core-js/modules/es6.array.from": 240, 19092 "core-js/modules/es6.array.iterator": 241, 19093 "core-js/modules/es6.math.trunc": 246, 19094 "core-js/modules/es6.object.keys": 250, 19095 "core-js/modules/es6.object.to-string": 252, 19096 "core-js/modules/es6.regexp.replace": 259, 19097 "core-js/modules/es6.string.iterator": 265, 19098 "core-js/modules/es6.symbol": 268, 19099 "core-js/modules/es7.object.get-own-property-descriptors": 272, 19100 "core-js/modules/web.dom.iterable": 274, 19101 nouislider: 284 19102 } ], 19103 83: [ function(require, module, exports) { 19104 "use strict"; 19105 Object.defineProperty(exports, "__esModule", { 19106 value: !0 19107 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 19108 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 19109 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 19110 require("core-js/modules/es6.object.keys"); 19111 var _heifer = require("./../../../core/utilities/heifer.utilities"); 19112 function ownKeys(object, enumerableOnly) { 19113 var keys = Object.keys(object); 19114 if (Object.getOwnPropertySymbols) { 19115 var symbols = Object.getOwnPropertySymbols(object); 19116 enumerableOnly && (symbols = symbols.filter(function(sym) { 19117 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 19118 })), keys.push.apply(keys, symbols); 19119 } 19120 return keys; 19121 } 19122 function _defineProperty(obj, key, value) { 19123 return key in obj ? Object.defineProperty(obj, key, { 19124 value: value, 19125 enumerable: !0, 19126 configurable: !0, 19127 writable: !0 19128 }) : obj[key] = value, obj; 19129 } 19130 function _defineProperties(target, props) { 19131 for (var i = 0; i < props.length; i++) { 19132 var descriptor = props[i]; 19133 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 19134 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 19135 } 19136 } 19137 var LabelInline = function() { 19138 function LabelInline(element, options) { 19139 !function(instance, Constructor) { 19140 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 19141 }(this, LabelInline), this.element = element, this.$element = $(element); 19142 var defaults = {}; 19143 this._defaults = defaults, this.settings = function(target) { 19144 for (var i = 1; i < arguments.length; i++) { 19145 var source = null != arguments[i] ? arguments[i] : {}; 19146 i % 2 ? ownKeys(source, !0).forEach(function(key) { 19147 _defineProperty(target, key, source[key]); 19148 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 19149 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 19150 }); 19151 } 19152 return target; 19153 }({}, defaults, {}, options), this.init(); 19154 } 19155 return function(Constructor, protoProps, staticProps) { 19156 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 19157 }(LabelInline, [ { 19158 key: "init", 19159 value: function() { 19160 this.tooltip = this.element.querySelector(".js-label-inline-tooltip-container"), 19161 this.tooltip && this.initTooltip(); 19162 } 19163 }, { 19164 key: "initTooltip", 19165 value: function() { 19166 var _this = this; 19167 this.tooltipContainer = this.element.querySelector(".js-label-inline-tooltip-icon-container"), 19168 this.tooltipIcon = this.element.querySelector(".js-label-inline-tooltip-icon"), 19169 this.tooltipText = this.element.querySelector(".js-label-inline-tooltip-text"), 19170 this.tooltipClose = this.element.querySelector(".js-label-inline-tooltip-close"), 19171 this.tooltipContainer && this.tooltipIcon && this.tooltipText && this.tooltipClose && (this.tooltipClose.addEventListener("click", function(ev) { 19172 (0, _heifer.uAddClass)(_this.tooltipContainer, "is-hidden"); 19173 }), this.tooltipIcon.addEventListener("click", function(ev) { 19174 (0, _heifer.uRemoveClass)(_this.tooltipContainer, "is-hidden"); 19175 })); 19176 } 19177 } ]), LabelInline; 19178 }(); 19179 exports.default = LabelInline; 19180 }, {
19181 "./../../../core/utilities/heifer.utilities": 19, 19182 "core-js/modules/es6.array.iterator": 241, 19183 "core-js/modules/es6.object.keys": 250, 19184 "core-js/modules/es6.object.to-string": 252, 19185 "core-js/modules/es6.symbol": 268, 19186 "core-js/modules/es7.object.get-own-property-descriptors": 272, 19187 "core-js/modules/web.dom.iterable": 274 19188 } ], 19189 84: [ function(require, module, exports) { 19190 "use strict"; 19191 Object.defineProperty(exports, "__esModule", { 19192 value: !0 19193 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 19194 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 19195 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 19196 require("core-js/modules/es6.object.keys"); 19197 var obj, _jquery = (obj = require("jquery")) && obj.__esModule ? obj : { 19198 default: obj 19199 }, _heifer = require("./../../../core/utilities/heifer.utilities"); 19200 function ownKeys(object, enumerableOnly) { 19201 var keys = Object.keys(object); 19202 if (Object.getOwnPropertySymbols) { 19203 var symbols = Object.getOwnPropertySymbols(object); 19204 enumerableOnly && (symbols = symbols.filter(function(sym) { 19205 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 19206 })), keys.push.apply(keys, symbols); 19207 } 19208 return keys; 19209 } 19210 function _defineProperty(obj, key, value) { 19211 return key in obj ? Object.defineProperty(obj, key, { 19212 value: value, 19213 enumerable: !0, 19214 configurable: !0, 19215 writable: !0 19216 }) : obj[key] = value, obj; 19217 } 19218 function _defineProperties(target, props) { 19219 for (var i = 0; i < props.length; i++) { 19220 var descriptor = props[i]; 19221 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 19222 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 19223 } 19224 } 19225 var NumberRocker = function() { 19226 function NumberRocker(element, options) { 19227 !function(instance, Constructor) { 19228 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 19229 }(this, NumberRocker), this.element = element, this.$element = (0, _jquery.default)(element); 19230 var defaults = { 19231 step: 1, 19232 min: 1, 19233 inputSelector: ".js-number-rocker__field", 19234 decrementButtonSelector: ".js-number-rocker__button--decrement", 19235 incrementButtonSelector: ".js-number-rocker__button--increment" 19236 }; 19237 this._defaults = defaults, this.settings = function(target) { 19238 for (var i = 1; i < arguments.length; i++) { 19239 var source = null != arguments[i] ? arguments[i] : {}; 19240 i % 2 ? ownKeys(source, !0).forEach(function(key) { 19241 _defineProperty(target, key, source[key]); 19242 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 19243 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 19244 }); 19245 } 19246 return target; 19247 }({}, defaults, {}, options), this.input = this.element.querySelector(this.settings.inputSelector), 19248 this.val = this.getCurrentVal(), this.decrementButton = this.element.querySelector(this.settings.decrementButtonSelector), 19249 this.incrementButton = this.element.querySelector(this.settings.incrementButtonSelector), 19250 this.cartRocker = "shares" === this.input.dataset.unitQuantity, this.cartRocker && (this.cartSummaryItem__qty = this.element.closest(".cartSummaryItem__qty"), 19251 this.cartSummaryItem__unit = this.cartSummaryItem__qty.querySelector(".cartSummaryItem__qty-unit--span")), 19252 this.minValue = "" !== this.input.min ? parseInt(this.input.min, 10) : this.settings.min, 19253 this.maxValue = "" !== this.input.max && parseInt(this.input.max, 10), this.stepValue = "" !== this.input.step ? parseInt(this.input.step, 10) : this.settings.step, 19254 this.bindEvents(), this.init(); 19255 } 19256 return function(Constructor, protoProps, staticProps) { 19257 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 19258 }(NumberRocker, [ { 19259 key: "bindEvents", 19260 value: function() { 19261 var _this = this; 19262 (0, _heifer.uAddEventListener)(this.decrementButton, "click", function(ev) {
19263 _this.decrement(), _this.dispatchChange(); 19264 }), (0, _heifer.uAddEventListener)(this.incrementButton, "click", function(ev) { 19265 _this.increment(), _this.dispatchChange(); 19266 }), (0, _heifer.uAddEventListener)(this.input, "input", function(ev) { 19267 _this.val = _this.getCurrentVal(), _this.setButtonStates(); 19268 }); 19269 } 19270 }, { 19271 key: "init", 19272 value: function() { 19273 this.setButtonStates(); 19274 } 19275 }, { 19276 key: "dispatchChange", 19277 value: function() { 19278 this.input.dispatchEvent((0, _heifer.uCreateEvent)("input")), this.input.dispatchEvent((0, 19279 _heifer.uCreateEvent)("change")); 19280 } 19281 }, { 19282 key: "increment", 19283 value: function() { 19284 if (this.canIncrement()) { 19285 var val = this.val + this.stepValue; 19286 if (val -= val % this.stepValue, this.input.value = this.maxValue ? Math.min(this.maxValue, val) : val, 19287 this.cartRocker) { 19288 2 <= this.input.value ? this.cartSummaryItem__unit.innerHTML = "shares" : this.cartSummaryItem__unit.innerHTML = "share"; 19289 } 19290 } 19291 } 19292 }, { 19293 key: "decrement", 19294 value: function() { 19295 if (this.canDecrement()) { 19296 var val = this.val - this.stepValue; 19297 if (val -= val % this.stepValue, this.input.value = this.minValue ? Math.max(this.minValue, val) : val, 19298 this.cartRocker) { 19299 2 <= this.input.value ? this.cartSummaryItem__unit.innerHTML = "shares" : this.cartSummaryItem__unit.innerHTML = "share"; 19300 } 19301 } 19302 } 19303 }, { 19304 key: "canIncrement", 19305 value: function() { 19306 return !this.maxValue || this.val < this.maxValue; 19307 } 19308 }, { 19309 key: "canDecrement", 19310 value: function() { 19311 return !this.minValue || this.val > this.minValue; 19312 } 19313 }, { 19314 key: "getCurrentVal", 19315 value: function() { 19316 return parseInt(this.input.value, 10); 19317 } 19318 }, { 19319 key: "setButtonStates", 19320 value: function() { 19321 this.canDecrement() ? this.enableButton(this.decrementButton) : this.disableButton(this.decrementButton), 19322 this.canIncrement() ? this.enableButton(this.incrementButton) : this.disableButton(this.incrementButton); 19323 } 19324 }, { 19325 key: "enableButton", 19326 value: function(button) { 19327 button.disabled = !1; 19328 } 19329 }, { 19330 key: "disableButton", 19331 value: function(button) { 19332 button.disabled = !0; 19333 } 19334 } ]), NumberRocker; 19335 }(); 19336 exports.default = NumberRocker; 19337 }, { 19338 "./../../../core/utilities/heifer.utilities": 19, 19339 "core-js/modules/es6.array.iterator": 241, 19340 "core-js/modules/es6.object.keys": 250, 19341 "core-js/modules/es6.object.to-string": 252, 19342 "core-js/modules/es6.symbol": 268, 19343 "core-js/modules/es7.object.get-own-property-descriptors": 272, 19344 "core-js/modules/web.dom.iterable": 274, 19345 jquery: 20 19346 } ], 19347 85: [ function(require, module, exports) { 19348 "use strict"; 19349 Object.defineProperty(exports, "__esModule", { 19350 value: !0 19351 }), exports.default = void 0, require("core-js/modules/es6.object.keys"), require("core-js/modules/es7.array.includes"), 19352 require("core-js/modules/es6.string.includes"), require("core-js/modules/es6.function.name"), 19353 require("core-js/modules/es6.typed.uint8-array"), require("core-js/modules/es6.regexp.to-string"), 19354 require("core-js/modules/es6.date.to-string"), require("core-js/modules/es6.regexp.replace"), 19355 require("core-js/modules/es6.promise"), require("core-js/modules/web.dom.iterable"), 19356 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 19357 require("core-js/modules/es6.string.iterator"); 19358 var obj, _heifer = require("./../../../core/utilities/heifer.utilities"), _checkout = require("./../../../core/utilities/checkout.utilities"), _submitButton = (obj = require("../submitButton/submitButton")) && obj.__esModule ? obj : { 19359 default: obj 19360 }, _gtm = require("../../../core/utilities/gtm.utilities"); 19361 function _defineProperties(target, props) { 19362 for (var i = 0; i < props.length; i++) { 19363 var descriptor = props[i]; 19364 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 19365 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 19366 } 19367 } 19368 var PaymentFields = function() { 19369 function PaymentFields(form) { 19370 var includePaypal = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], includeAltPayError = 2 < arguments.length && void 0 !== arguments[2] && arguments[2], altPayLoadingElem = 3 < arguments.length && void 0 !== arguments[3] && arguments[3], includeApplePay = 4 < arguments.length && void 0 !== arguments[4] && arguments[4], includeVenmo = 5 < arguments.length && void 0 !== arguments[5] && arguments[5], includeGooglePayments = 6 < arguments.length && void 0 !== arguments[6] && arguments[6], includeBlackbaud = 7 < arguments.length && void 0 !== arguments[7] && arguments[7], donationShippable = 8 < arguments.length && void 0 !== arguments[8] && arguments[8], submitAltPayments = !(9 < arguments.length && void 0 !== arguments[9]) || arguments[9]; 19371 !function(instance, Constructor) { 19372 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 19373 }(this, PaymentFields), this.form = form, this.clientToken = form.dataset.clientToken, 19374 this.braintree = window.braintree || !1, this.includePaypal = includePaypal, this.includeAltPayError = includeAltPayError, 19375 this.altPayLoadingElem = altPayLoadingElem, this.altPayButtons = this.form.querySelector(".js-alt-pay-buttons"), 19376 this.includeApplePay = includeApplePay, this.includeVenmo = includeVenmo, this.includeGooglePayments = includeGooglePayments, 19377 this.includeBlackbaud = includeBlackbaud, this.donationShippable = donationShippable, 19378 this.deviceData = window.deviceData || "", this.errorMessage = this.makeErrorMessage(), 19379 this.isSubscription = this.form.dataset.isSubscription || !1, this.submitAltPayments = submitAltPayments, 19380 this.hostedFieldsStyles = { 19381 input: "paymentField__field" 19382 }, this.form.classList.contains("formsAlt") && (this.hostedFieldsStyles = { 19383 input: "paymentField__field--alt" 19384 }), this.clearPaypalButton(), this.includePaypal && (this.paypal = window.paypal || !1), 19385 this.showAnyPaymentOptions = this.includePaypal || this.includeApplePay || this.includeVenmo || this.includeGooglePayments, 19386 this.showAnyPaymentOptions || null == this.form.querySelector(".donationBilling__credit-card") || "donation-alt-card-form" != this.form.id && (this.form.querySelector(".donationBilling__credit-card").click(), 19387 this.form.querySelector(".donationBilling__options").classList.remove("is-active"), 19388 this.form.querySelector(".donationBilling__no-options").classList.add("is-active")), 19389 this.hostedFieldsInstance = !1, this.loadScripts().then(this.initBraintree.bind(this)).then(this.initBlackbaud.bind(this)), 19390 this.submitButtons = this.form.querySelectorAll(".js-cart-submit"), (this.includePaypal || this.altPayLoadingElem) && (this.altPayLoadingAnimation = new _submitButton.default(this.altPayLoadingElem, { 19391 trigger: "event", 19392 event: "initAltPayLoading" 19393 }), this.form.querySelector(".js-alt-pay-init") && (this.altPayInitAnimation = new _submitButton.default(this.form.querySelector(".js-alt-pay-init"), { 19394 trigger: "none" 19395 }))), window.addEventListener("paypalButtonClicked", function() { 19396 (0, _gtm.pushAltPayEvent)("Paypal Button Clicked"); 19397 }), window.addEventListener("paypalOrderComplete", function() { 19398 (0, _gtm.pushAltPayEvent)("Paypal Order Complete"); 19399 }), window.addEventListener("googlePayButtonShown", function() { 19400 (0, _gtm.pushAltPayEvent)("GooglePay Button Shown"); 19401 }), window.addEventListener("googlePayButtonClicked", function() { 19402 (0, _gtm.pushAltPayEvent)("GooglePay Button Clicked"); 19403 }), window.addEventListener("googlePayOrderComplete", function() { 19404 (0, _gtm.pushAltPayEvent)("GooglePay Order Complete"); 19405 }), window.addEventListener("applePayButtonShown", function() { 19406 (0, _gtm.pushAltPayEvent)("ApplePay Button Shown"); 19407 }), window.addEventListener("applePayButtonClicked", function() { 19408 (0, _gtm.pushAltPayEvent)("ApplePay Button Clicked"); 19409 }), window.addEventListener("applePayOrderComplete", function() { 19410 (0, _gtm.pushAltPayEvent)("ApplePay Order Complete"); 19411 }), window.addEventListener("venmoButtonShown", function() { 19412 (0, _gtm.pushAltPayEvent)("Venmo Button Shown"); 19413 }), window.addEventListener("venmoButtonClicked", function() { 19414 (0, _gtm.pushAltPayEvent)("Venmo Button Clicked"); 19415 }), window.addEventListener("venmoOrderComplete", function() { 19416 (0, _gtm.pushAltPayEvent)("Venmo Order Complete"); 19417 }); 19418 } 19419 return function(Constructor, protoProps, staticProps) { 19420 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 19421 }(PaymentFields, [ { 19422 key: "makeErrorMessage", 19423 value: function() { 19424 var errorMessageNode = document.createElement("p"); 19425 return errorMessageNode.innerHTML = 'We are unable to process your request. Please try again, or view common solutions on <a href="/support/troubleshooting.html" class="link__inline--dark" target="_blank">our help page.</a> You can also contact our Donor Services team at 855.9HUNGER (855.948.6437).', 19426 errorMessageNode; 19427 } 19428 }, { 19429 key: "loadScripts", 19430 value: function() { 19431 var scripts = []; 19432 return !this.clientToken && window.Heifer.shared.pageContentPromise && scripts.push(window.Heifer.shared.pageContentPromise), 19433 this.includePaypal && !this.paypal && scripts.push((0, _heifer.uLoadJSPromise)("https://paypalobjects.com/api/checkout.js", { 19434 "data-version-4": "", 19435 "log-level": "warn", 19436 "data-ot-ignore": "" 19437 })), this.braintree || (scripts.push((0, _heifer.uLoadJSPromise)("https://js.braintreegateway.com/web/3.46.0/js/client.min.js", { 19438 "data-ot-ignore": "" 19439 })), scripts.push((0, _heifer.uLoadJSPromise)("https://js.braintreegateway.com/web/3.46.0/js/data-collector.min.js", { 19440 "data-ot-ignore": "" 19441 })), scripts.push((0, _heifer.uLoadJSPromise)("https://js.braintreegateway.com/web/3.46.0/js/hosted-fields.min.js", { 19442 "data-ot-ignore": "" 19443 })), this.includePaypal && scripts.push((0, _heifer.uLoadJSPromise)("https://js.braintreegateway.com/web/3.46.0/js/paypal-checkout.min.js", { 19444 "data-ot-ignore": "" 19445 })), this.includeApplePay && scripts.push((0, _heifer.uLoadJSPromise)("https://js.braintreegateway.com/web/3.46.0/js/apple-pay.min.js", { 19446 "data-ot-ignore": "" 19447 })), this.includeVenmo && scripts.push((0, _heifer.uLoadJSPromise)("https://js.braintreegateway.com/web/3.46.0/js/venmo.min.js", { 19448 "data-ot-ignore": "" 19449 })), this.includeGooglePayments && scripts.push((0, _heifer.uLoadJSPromise)("https://pay.google.com/gp/p/js/pay.js", { 19450 "data-ot-ignore": "" 19451 }), (0, _heifer.uLoadJSPromise)("https://js.braintreegateway.com/web/3.46.0/js/google-payment.min.js", { 19452 "data-ot-ignore": "" 19453 })), this.includeBlackbaud && scripts.push((0, _heifer.uLoadJSPromise)("https://payments.blackbaud.com/Checkout/bbCheckout.2.0.js", { 19454 "data-ot-ignore": "" 19455 }))), Promise.all(scripts); 19456 } 19457 }, { 19458 key: "initBraintree", 19459 value: function() { 19460 this.clientToken || (this.clientToken = this.form.dataset.clientToken), this.braintree = window.braintree, 19461 this.braintree.client.create({ 19462 authorization: this.clientToken 19463 }, this.handleBraintreeInit.bind(this)); 19464 } 19465 }, { 19466 key: "handleBraintreeInit", 19467 value: function(err, instance) { 19468 var _this = this; 19469 if (err) return !1; 19470 new Promise(function(resolve) { 19471 _this.includePaypal && _this.initPaypal(instance), _this.includeGooglePayments && _this.initGooglePayments(instance), 19472 _this.includeVenmo && !_this.donationShippable && _this.initVenmo(instance), _this.includeApplePay && _this.initApplePay(instance), 19473 resolve(!0); 19474 }).then(function() { 19475 _this.altPayInitAnimation && _this.altPayButtons && (_this.altPayInitAnimation.reset(), 19476 _this.altPayButtons.classList.add("is-revealed")); 19477 }), this.initDataCollector(instance), this.initHostedFields(instance); 19478 } 19479 }, { 19480 key: "initPaypal", 19481 value: function(instance) { 19482 this.paypal = window.paypal, this.paypal && this.braintree.paypalCheckout.create({ 19483 client: instance 19484 }, this.handlePaypalInit.bind(this)); 19485 } 19486 }, { 19487 key: "handlePaypalInit", 19488 value: function(err, instance) { 19489 err || this.renderPaypalButton(instance); 19490 } 19491 }, { 19492 key: "initGooglePayments", 19493 value: function(instance) { 19494 this.google = window.google, this.google && (this.paymentsClient = new this.google.payments.api.PaymentsClient({ 19495 environment: window.Heifer.googlePayEnvironment 19496 }), this.braintree.googlePayment.create({ 19497 client: instance, 19498 googlePayVersion: 2, 19499 googleMerchantId: "BCR2DN6TZPRKRCTN" 19500 }, this.handleGooglePaymentsInit.bind(this))); 19501 } 19502 }, { 19503 key: "initBlackbaud", 19504 value: function() { 19505 var _this2 = this; 19506 if (this.includeBlackbaud) { 19507 var environment = window.Heifer.environment, configurationData = { 19508 key: window.Heifer.blackbaudPublicKey, 19509
19509 payment_configuration_id: "production" === environment ? window.Heifer.blackbaudPaymentConfigurationId : "0868d976-b51e-4d46-8fbf-141687131636", 19510 transaction_type: "card_not_present", 19511 card_token: null != crypto.randomUUID ? crypto.randomUUID() : ([ 1e7 ] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function(c) { 19512 return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16); 19513 }), 19514 use_visa_checkout: !1, 19515 note: "heifer.org", 19516 primary_color: "#2B4053", 19517 font_family: "montserrat" 19518 }; 19519 Blackbaud_Init(configurationData), window.addEventListener("blackbaudFlow", function() { 19520 _this2.passBlackbaudData(configurationData); 19521 }), document.addEventListener("checkoutComplete", function(event) { 19522 _this2.doBlackbaudSucessOverlay(), _this2.doBlackbaudCheckout(event); 19523 }); 19524 } 19525 } 19526 }, { 19527 key: "passBlackbaudData", 19528 value: function(configurationData) { 19529 var formData = new window.FormData(this.form), cartTotal = (0, _checkout.getCartTotals)(formData, (0, 19530 _checkout.formDataHasProcessingFee)(formData)).total; 19531 cartTotal = String(cartTotal); 19532 var formFields = (0, _checkout.getBillingAddressFromData)(formData), billingAddress = formFields.address1 + " " + formFields.address2, cardHolder = formFields.firstName + " " + formFields.lastName; 19533 Blackbaud_Open({ 19534 amount: cartTotal, 19535 billing_address_email: formFields.email, 19536 billing_address_line: billingAddress, 19537 billing_address_country: formFields.country, 19538 billing_address_city: formFields.city, 19539 billing_address_post_code: formFields.zip, 19540 billing_address_state: formFields.state, 19541 cardholder: cardHolder, 19542 card_token: configurationData.card_token 19543 }); 19544 } 19545 }, { 19546 key: "doBlackbaudSucessOverlay", 19547 value: function() { 19548 document.querySelector(".mainHeader") && (document.querySelector(".mainHeader").style.position = "unset"), 19549 (0, _heifer.uAddClass)(document.querySelector(".js-overlay"), "donationAltBlackbaudMessage__overlay"), 19550 document.querySelector("body").style.cssText = "overflow:hidden; position:fixed"; 19551 } 19552 }, { 19553 key: "removeBlackbaudSuccessOverlay", 19554 value: function() { 19555 document.querySelector(".mainHeader") && (document.querySelector(".mainHeader").style.position = "block"), 19556 (0, _heifer.uRemoveClass)(document.querySelector(".js-overlay"), "donationAltBlackbaudMessage__overlay"), 19557 document.querySelector("body").style.cssText = "overflow:auto; position:relative"; 19558 } 19559 }, { 19560 key: "doBlackbaudCheckout", 19561 value: function(event) { 19562 var _this3 = this, formData = new window.FormData(this.form), formFields = (0, _checkout.getBillingAddressFromData)(formData); 19563 (0, _checkout.submitOrder)(formData, { 19564 type: "Blackbaud", 19565 nonce: "blackbaud", 19566 blackbaudToken: event.detail.transactionToken, 19567 details: { 19568 email: formFields.email, 19569 firstName: formFields.firstName, 19570 lastName: formFields.lastName, 19571 phone: formFields.phone, 19572 phone_opt_in: formFields.phone_opt_in, 19573 last: "", 19574 billingAddress: { 19575 line1: formFields.address1, 19576 line2: formFields.address2, 19577 city: formFields.city, 19578 state: formFields.state, 19579 postalCode: formFields.zip, 19580 countryCode: formFields.country 19581 } 19582 } 19583 }).then(function(response) { 19584 0 == response.errors.length && (window.location.href = "/cart/confirmation.html"); 19585 }).catch(function(error) { 19586 _this3.includeAltPayError && _this3.includeAltPayError(_this3.errorMessage), _this3.removeBlackbaudSuccessOverlay(); 19587 }); 19588 } 19589 }, { 19590 key: "initApplePay", 19591 value: function(instance) { 19592 window.ApplePaySession && ApplePaySession.supportsVersion(3) && ApplePaySession.canMakePayments() && this.braintree.applePay.create({ 19593 client: instance 19594 }, this.handleApplePayInit.bind(this)); 19595 } 19596 }, { 19597 key: "handleGooglePaymentsInit", 19598 value: function(err, googlePaymentsInstance) { 19599 var _this4 = this; 19600 err || this.paymentsClient.isReadyToPay({ 19601 apiVersion: 2, 19602 apiVersionMinor: 0, 19603 allowedPaymentMethods: googlePaymentsInstance.createPaymentDataRequest().allowedPaymentMethods, 19604 existingPaymentMethodRequired: !0 19605 }).then(function(isReadyToPay) { 19606 isReadyToPay.result && _this4.renderGooglePaymentsButton(googlePaymentsInstance); 19607 }); 19608 } 19609 }, { 19610 key: "handleApplePayInit", 19611 value: function(err, applePayInstance) { 19612 var _this5 = this; 19613 if (!err) { 19614 this.form.querySelector(".donationBilling__option--apple").classList.add("is-active"); 19615 var applePayButton = document.getElementById("apple-pay"); 19616 this.form.dataset.subId && (applePayButton = document.getElementById("apple-pay-" + this.form.dataset.subId)), 19617 this.handleAltPaymentButtonShowEvent("applePayButtonShown"), applePayButton.addEventListener("click", function(event) { 19618 window.dispatchEvent((0, _heifer.uCreateCustomEvent)("applePayButtonClicked")), 19619 _this5.initAltPayLoading(); 19620 var formData = new window.FormData(_this5.form), cartTotal = (0, _checkout.getCartTotals)(formData, (0, 19621 _checkout.formDataHasProcessingFee)(formData)).total; 19622 _this5.form.dataset.subId && (cartTotal = _this5.form.dataset.amount); 19623 var request = applePayInstance.createPaymentRequest({ 19624 total: { 19625 label: "Heifer Project International", 19626 amount: "".concat(cartTotal) 19627 }, 19628 requiredShippingContactFields: [ "phone", "email" ], 19629 requiredBillingContactFields: [ "name", "postalAddress" ] 19630 }), session = new ApplePaySession(3, request); 19631 session.onvalidatemerchant = function(event) { 19632 applePayInstance.performValidation({ 19633 validationURL: event.validationURL, 19634 displayName: "Heifer Project International" 19635 }, function(err, merchantSession) { 19636 err || session.completeMerchantValidation(merchantSession); 19637 }); 19638 }, session.onpaymentauthorized = function(event) { 19639 applePayInstance.tokenize({ 19640 token: event.payment.token 19641 }, function(tokenizeErr, payload) { 19642 var _this6 = this; 19643 if (tokenizeErr) session.completePayment(ApplePaySession.STATUS_FAILURE); else { 19644 if (this.submitAltPayments) (0, _checkout.submitOrder)(formData, { 19645 type: payload.type, 19646 nonce: payload.nonce, 19647 details: { 19648 email: event.payment.shippingContact.emailAddress, 19649 firstName: event.payment.billingContact.givenName, 19650 lastName: event.payment.billingContact.familyName, 19651 phone: event.payment.shippingContact.phoneNumber, 19652 last: payload.details.dpanLastTwo, 19653 billingAddress: { 19654 line1: event.payment.billingContact.addressLines[0] || null, 19655 line2: event.payment.billingContact.addressLines[1] || null, 19656 city: event.payment.billingContact.locality, 19657 state: event.payment.billingContact.administrativeArea, 19658 postalCode: event.payment.billingContact.postalCode, 19659 countryCode: event.payment.billingContact.countryCode 19660 } 19661 } 19662 }, this.isSubscription).then(function(response) { 19663 0 == response.errors.length && (window.dispatchEvent((0, _heifer.uCreateCustomEvent)("applePayOrderComplete")), 19664 window.location.href = "/cart/confirmation.html"); 19665 }).catch(function(error) { 19666 _this6.resetAltPayLoading(), _this6.includeAltPayError(_this6.errorMessage); 19667 }); else { 19668 var customEventPayload = { 19669 nonce: payload.nonce, 19670 paymentData: event.payment 19671 }, customEvent = "paymentFields/applePayResponse"; 19672 this.form.dataset.subId && (customEventPayload.subId = this.form.dataset.subId, 19673 customEvent += "-" + customEventPayload.subId), window.dispatchEvent((0, _heifer.uCreateCustomEvent)(customEvent, customEventPayload)); 19674 } 19675 session.completePayment(ApplePaySession.STATUS_SUCCESS); 19676 } 19677 }.bind(this)); 19678 }.bind(_this5), session.oncancel = function() { 19679 this.resetAltPayLoading(); 19680 }.bind(_this5), session.begin(); 19681 }).bind(this); 19682 } 19683 } 19684 }, { 19685 key: "renderGooglePaymentsButton", 19686 value: function(googlePaymentInstance) { 19687 this.form.querySelector(".donationBilling__option--google").classList.add("is-active"), 19688 this.form.querySelector(".donationBilling__google-pay").addEventListener("click", this.handleGooglePaymentButtonClick.bind(this, googlePaymentInstance)), 19689 this.handleAltPaymentButtonShowEvent("googlePayButtonShown"); 19690 } 19691 }, { 19692 key: "handleGooglePaymentButtonClick", 19693 value: function(googlePaymentInstance) { 19694 var _this8 = this; 19695 window.dispatchEvent((0, _heifer.uCreateCustomEvent)("googlePayButtonClicked")), 19696 this.initAltPayLoading(); 19697 var formData = new window.FormData(this.form), cartTotal = (0, _checkout.getCartTotals)(formData, (0, 19698 _checkout.formDataHasProcessingFee)(formData)).total, paymentDataRequest = googlePaymentInstance.createPaymentDataRequest({ 19699 transactionInfo: { 19700 currencyCode: "USD", 19701 totalPriceStatus: "FINAL", 19702 totalPrice: "".concat(cartTotal) 19703 }, 19704 emailRequired: !0 19705 }), cardPaymentMethod = paymentDataRequest.allowedPaymentMethods[0]; 19706 cardPaymentMethod.parameters.billingAddressRequired = !0, cardPaymentMethod.parameters.billingAddressParameters = { 19707 format: "FULL", 19708 phoneNumberRequired: !1 19709 }, this.paymentsClient.loadPaymentData(paymentDataRequest).then(function(paymentData) { 19710 googlePaymentInstance.parseResponse(paymentData, function(err, result) { 19711 var _this7 = this; 19712 if (err) return this.resetAltPayLoading(), void this.includeAltPayError(this.errorMessage); 19713 if (this.submitAltPayments) { 19714 var name = paymentData.paymentMethodData.info.billingAddress.name, splitName = this.formatGooglePayName(name); 19715 (0, _checkout.submitOrder)(formData, { 19716 type: result.type, 19717 nonce: result.nonce, 19718 details: { 19719 firstName: splitName.firstName ? splitName.firstName : name, 19720 lastName: splitName.lastName ? splitName.lastName : null, 19721 email: paymentData.email, 19722 phone: null, 19723 last: result.details.lastFour, 19724 billingAddress: { 19725 line1: paymentData.paymentMethodData.info.billingAddress.address1, 19726 line2: paymentData.paymentMethodData.info.billingAddress.address2, 19727 city: paymentData.paymentMethodData.info.billingAddress.locality, 19728 state: paymentData.paymentMethodData.info.billingAddress.administrativeArea, 19729 postalCode: paymentData.paymentMethodData.info.billingAddress.postalCode, 19730 countryCode: paymentData.paymentMethodData.info.billingAddress.countryCode 19731 } 19732 } 19733 }, this.isSubscription).then(function(response) { 19734 0 == response.errors.length && (window.dispatchEvent((0, _heifer.uCreateCustomEvent)("googlePayOrderComplete")), 19735 window.location.href = "/cart/confirmation.html"); 19736 }).catch(function(error) { 19737 _this7.resetAltPayLoading(), _this7.includeAltPayError(_this7.errorMessage); 19738 }); 19739 } else { 19740 var customEventPayload = { 19741 result: result, 19742
19742 paymentData: paymentData 19743 }, customEvent = "paymentFields/googlePayResponse"; 19744 this.form.dataset.subId && (customEventPayload.subId = this.form.dataset.subId, 19745 customEvent += "-" + customEventPayload.subId), window.dispatchEvent((0, _heifer.uCreateCustomEvent)(customEvent, customEventPayload)); 19746 } 19747 }.bind(this)); 19748 }.bind(this)).catch(function(error) { 19749 _this8.resetAltPayLoading(), _this8.includeAltPayError(_this8.errorMessage); 19750 }); 19751 } 19752 }, { 19753 key: "formatGooglePayName", 19754 value: function(name) { 19755 var firstName, lastName = ""; 19756 if (-1 < name.indexOf(" ")) { 19757 var index = name.lastIndexOf(" "); 19758 firstName = name.slice(0, index).trim(), lastName = name.slice(index).trim(); 19759 } 19760 return { 19761 firstName: firstName, 19762 lastName: lastName 19763 }; 19764 } 19765 }, { 19766 key: "handleAltPaymentButtonShowEvent", 19767 value: function(buttonShown) { 19768 if (document.querySelector(".donationAltCardAmount__tablist")) document.querySelectorAll(".donationAltCard__tab-link").forEach(function(tab) { 19769 tab.href.includes("donation-one-time") && (tab.addEventListener("click", function() { 19770 window.dispatchEvent((0, _heifer.uCreateCustomEvent)(buttonShown)); 19771 }), (0, _heifer.uHasClass)(tab, "is-active") && window.dispatchEvent((0, _heifer.uCreateCustomEvent)(buttonShown))); 19772 }); else if (document.querySelector(".donationCard__tablist")) { 19773 document.querySelectorAll(".donationCard__tab-link").forEach(function(tab) { 19774 tab.href.includes("donation-one-time") && (tab.addEventListener("click", function() { 19775 window.dispatchEvent((0, _heifer.uCreateCustomEvent)(buttonShown)); 19776 }), (0, _heifer.uHasClass)(tab, "is-active") && window.dispatchEvent((0, _heifer.uCreateCustomEvent)(buttonShown))); 19777 }); 19778 } else window.dispatchEvent((0, _heifer.uCreateCustomEvent)(buttonShown)); 19779 } 19780 }, { 19781 key: "renderPaypalButton", 19782 value: function(instance) { 19783 window.Heifer.shared.heiferFoundation ? this.form.querySelector(".js-paypal-button__wrapper").classList.add("is-active") : this.form.querySelector(".donationBilling__option--paypal").classList.add("is-active"); 19784 this.paypal.Button.render(this.getPaypalButtonConfig(instance), "#".concat(this.form.querySelector(".js-paypal-button").getAttribute("id"))); 19785 } 19786 }, { 19787 key: "clearPaypalButton", 19788 value: function() { 19789 var wrapper = this.form.querySelector(".js-paypal-button__wrapper"); 19790 wrapper && wrapper.classList.remove("is-active"); 19791 var button = this.form.querySelector(".js-paypal-button"); 19792 button && "" !== button.innerHTML && (button.innerHTML = ""); 19793 } 19794 }, { 19795 key: "getPaypalButtonConfig", 19796 value: function(instance) { 19797 var _this9 = this; 19798 return { 19799 env: window.Heifer.paypalEnvironment, 19800 style: { 19801 color: "gold", 19802 label: "paypal", 19803 tagline: !1, 19804 size: "responsive", 19805 height: 45, 19806 shape: "rect" 19807 }, 19808 commit: !0, 19809 payment: function() { 19810 _this9.altPayLoadingElem && (_this9.initAltPayLoading(), window.dispatchEvent((0, 19811 _heifer.uCreateCustomEvent)("initPaypalLoading"))); 19812 var formData = new window.FormData(_this9.form), cartTotal = (0, _checkout.getCartTotals)(formData, (0, 19813 _checkout.formDataHasProcessingFee)(formData)).total; 19814 return instance.createPayment({ 19815 flow: "checkout", 19816 amount: cartTotal, 19817 currency: "USD", 19818 enableShippingAddress: !1, 19819 shippingAddressEditable: !1 19820 }); 19821 }, 19822 onClick: function() { 19823 window.dispatchEvent((0, _heifer.uCreateCustomEvent)("paypalButtonClicked")); 19824 }, 19825 onAuthorize: function(data, actions) { 19826 return instance.tokenizePayment(data, function(err, payload) { 19827 var paypalResponse = (0, _checkout.submitOrder)(new window.FormData(_this9.form), payload); 19828 (0, _heifer.uTypeOf)("Function", _this9.includePaypal) && paypalResponse.then(function(response) { 19829 _this9.includePaypal(response); 19830 }).catch(function(error) { 19831 if (error.errors && Array.isArray(error.errors)) { 19832 error.errors.join(". "); 19833 _this9.includeAltPayError(_this9.errorMessage), _this9.resetAltPayLoading(); 19834 } else _this9.includeAltPayError("Payment method declined"), _this9.resetAltPayLoading(); 19835 }), window.dispatchEvent((0, _heifer.uCreateCustomEvent)("paypalOrderComplete")); 19836 }); 19837 }, 19838 onCancel: function(data) { 19839 this.resetAltPayLoading(); 19840 }.bind(this), 19841 onError: function(err) { 19842 this.resetAltPayLoading(); 19843 }.bind(this) 19844 }; 19845 } 19846 }, { 19847 key: "initAltPayLoading", 19848 value: function() { 19849 (0, _heifer.uAddClass)(this.altPayLoadingElem, "is-revealed"), (0, _heifer.uAddClass)(this.altPayLoadingElem, "is-loading"); 19850 } 19851 }, { 19852 key: "resetAltPayLoading", 19853 value: function() { 19854 this.altPayLoadingElem && ((0, _heifer.uRemoveClass)(this.altPayLoadingElem, "is-revealed"), 19855 this.altPayLoadingAnimation.reset()); 19856 } 19857 }, { 19858 key: "initDataCollector", 19859 value: function(instance) { 19860 this.braintree.dataCollector.create({ 19861 client: instance, 19862 kount: !0, 19863 paypal: !0 19864 }, this.handledataCollectorInit.bind(this)); 19865 } 19866 }, { 19867 key: "handledataCollectorInit", 19868 value: function(err, instance) { 19869 if (err) return !1; 19870 var deviceDataInput = document.createElement("input"); 19871 deviceDataInput.name = "deviceData", deviceDataInput.type = "hidden", this.form.appendChild(deviceDataInput), 19872 deviceDataInput.value = instance.deviceData; 19873 } 19874 }, { 19875 key: "initHostedFields", 19876 value: function(instance) { 19877 var number = this.form.querySelector(".js-braintree-fields__card-number"), cvv = this.form.querySelector(".js-braintree-fields__cvv"), expirationDate = this.form.querySelector(".js-braintree-fields__expiration-date"); 19878 if (!number || !expirationDate || !cvv) return !1; 19879 "" !== number.innerHTML && (number.innerHTML = ""), "" !== cvv.innerHTML && (cvv.innerHTML = ""), 19880 "" !== expirationDate.innerHTML && (expirationDate.innerHTML = ""), this.braintree.hostedFields.create({ 19881 client: instance, 19882 styles: this.hostedFieldsStyles, 19883 fields: { 19884 number: { 19885 selector: "#".concat(number.getAttribute("id")), 19886 placeholder: "Ex: 4111 1111 1111 1111" 19887 }, 19888 cvv: { 19889 selector: "#".concat(cvv.getAttribute("id")), 19890 placeholder: "Ex: 123" 19891 }, 19892 expirationDate: { 19893 selector: "#".concat(expirationDate.getAttribute("id")), 19894 placeholder: "Ex: 01/2021" 19895 } 19896 } 19897 }, this.handleHostedFieldsInit.bind(this)); 19898 } 19899 }, { 19900 key: "handleHostedFieldsInit", 19901 value: function(err, instance) { 19902 if (err) return !1; 19903 this.hostedFieldsInstance = instance, this.bindHostedFieldsEvents(); 19904 } 19905 }, { 19906 key: "bindHostedFieldsEvents", 19907 value: function(argument_0) { 19908 var _this10 = this, instance = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.hostedFieldsInstance;
19909 instance.on("validityChange", function(event) { 19910 var fields = instance.getState().fields, field = (_this10.validateHostedFields(fields), 19911 fields.hasOwnProperty(event.emittedBy) ? fields[event.emittedBy] : null), label = field ? field.container : null, hiddenInput = label ? (0, 19912 _heifer.uClosest)(label, ".js-payment-field").querySelector(".js-payment-field__hidden-input") : null, hiddenInputChanged = !1; 19913 label && (field.isValid ? (label.classList.remove("is-invalid"), label.classList.add("is-valid"), 19914 _this10.switchHiddenInput("valid", label, hiddenInput), hiddenInput && !hiddenInput.checked && (hiddenInputChanged = !0, 19915 hiddenInput.checked = !0)) : (label.classList.remove("is-valid"), label.classList.add("is-invalid"), 19916 _this10.switchHiddenInput("invalid", label, hiddenInput), hiddenInput && hiddenInput.checked && (hiddenInputChanged = !0, 19917 hiddenInput.checked = !1)), hiddenInputChanged && hiddenInput.dispatchEvent((0, 19918 _heifer.uCreateEvent)("change")), field.isEmpty ? (label.classList.remove("isnt-empty"), 19919 label.classList.add("is-empty")) : (label.classList.remove("is-empty"), label.classList.add("isnt-empty"))); 19920 }); 19921 } 19922 }, { 19923 key: "tokenize", 19924 value: function(argument_0) { 19925 var _this11 = this, instance = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.hostedFieldsInstance, formData = new window.FormData(this.form), tokenizeOptions = ((0, 19926 _checkout.getBillingAddressFromData)(formData), {}); 19927 return new Promise(function(resolve, reject) { 19928 if (_this11.form.elements.savedPaymentMethod && "0" != _this11.form.elements.savedPaymentMethod.value && "" != _this11.form.elements.paymentMethodToken.value) { 19929 var payload = { 19930 type: "PaymentMethodToken", 19931 nonce: "" 19932 }; 19933 payload.token = _this11.form.elements.paymentMethodToken.value, payload.paymentDetails = [], 19934 resolve(payload); 19935 } else instance ? instance.tokenize(tokenizeOptions, function(err, payload) { 19936 if (err) return reject(err), !1; 19937 resolve(payload); 19938 }) : resolve(); 19939 }); 19940 } 19941 }, { 19942 key: "validateHostedFields", 19943 value: function(fields) { 19944 return Object.keys(fields).every(function(key) { 19945 return fields[key].isValid; 19946 }); 19947 } 19948 }, { 19949 key: "submitCart", 19950 value: function() { 19951 var _this12 = this; 19952 return new Promise(function(resolve, reject) { 19953 _this12.tokenize().then(function(payload) { 19954 return _this12.form.elements.savePaymentMethod && _this12.form.elements.savePaymentMethod.checked ? (0, 19955 _heifer.uAjaxWithResponse)("POST", "/api/account/addPaymentMethod.html", !0, (0, 19956 _heifer.uJsonToQueryString)({ 19957 nonce: payload.nonce ? payload.nonce : "" 19958 })).then(function() { 19959 return _this12.submitFormDataAndPayload(_this12.form, payload); 19960 }).catch(function(error) { 19961 reject(error); 19962 }) : _this12.submitFormDataAndPayload(_this12.form, payload).then(function(response) { 19963 resolve(response); 19964 }).catch(function(error) { 19965 if (error.errors && Array.isArray(error.errors)) { 19966 error.errors.join(". "); 19967 reject(_this12.errorMessage); 19968 } else reject(_this12.errorMessage); 19969 }); 19970 }).catch(function(error) { 19971 if (error.errors && Array.isArray(error.errors)) { 19972 var message = error.errors.join(". "); 19973 reject(message); 19974 } else reject(_this12.errorMessage); 19975 }); 19976 }); 19977 } 19978 }, { 19979 key: "submitFormDataAndPayload", 19980 value: function(argument_0, argument_1) { 19981 var form = 0 < arguments.length && void 0 !== argument_0 ? argument_0 : this.form, payload = 1 < arguments.length ? argument_1 : void 0, formData = new window.FormData(form); 19982 return (0, _checkout.submitOrder)(formData, payload, this.isSubscription); 19983 } 19984 }, { 19985 key: "switchHiddenInput", 19986 value: function(state, label, input) { 19987 "valid" == state ? this.updateAlertMessage("off", label, input) : "invali
19987d" == state && this.updateAlertMessage("on", label, input); 19988 } 19989 }, { 19990 key: "updateAlertMessage", 19991 value: function(state, label, input) { 19992 var message = input.dataset.gauntletError, alertContainer = document.querySelector("#" + label.dataset.alertContainer), alertContainerSpan = alertContainer.querySelector(".paymentField__alert--inner"); 19993 "off" == state ? (0, _heifer.uRemoveClass)(alertContainer, "is-revealed") : "on" == state && ((0, 19994 _heifer.uAddClass)(alertContainer, "is-revealed"), alertContainerSpan.textContent = message); 19995 } 19996 }, { 19997 key: "initVenmo", 19998 value: function(instance) { 19999 this.braintree.venmo.create({ 20000 client: instance 20001 }, this.handleVenmoInit.bind(this)); 20002 } 20003 }, { 20004 key: "handleVenmoInit", 20005 value: function(err, instance) { 20006 var _this13 = this; 20007 if (this.braintree.venmo.isBrowserSupported()) { 20008 var venmoButton = document.getElementById("venmo-button"); 20009 this.form.querySelector(".donationBilling__option--venmo").classList.add("is-active"), 20010 this.handleAltPaymentButtonShowEvent("venmoButtonShown"), venmoButton.addEventListener("click", function() { 20011 window.dispatchEvent((0, _heifer.uCreateCustomEvent)("venmoButtonClicked")), venmoButton.disabled = !0, 20012 _this13.initAltPayLoading(), instance.tokenize(function(tokenizeErr, payload) { 20013 venmoButton.removeAttribute("disabled"), tokenizeErr ? _this13.resetAltPayLoading() : (0, 20014 _checkout.submitOrder)(new window.FormData(_this13.form), { 20015 type: payload.type, 20016 nonce: payload.nonce, 20017 details: { 20018 email: null, 20019 firstName: payload.details.username, 20020 lastName: null, 20021 phone: null, 20022 billingAddress: { 20023 line1: null, 20024 line2: null, 20025 city: null, 20026 state: null, 20027 postalCode: null, 20028 countryCode: null 20029 } 20030 } 20031 }).then(function(response) { 20032 0 == response.errors.length && (window.dispatchEvent((0, _heifer.uCreateCustomEvent)("venmoOrderComplete")), 20033 window.location.href = "/cart/confirmation.html"); 20034 }).catch(function(error) { 20035 _this13.resetAltPayLoading(), _this13.includeAltPayError(_this13.errorMessage); 20036 }); 20037 }); 20038 }); 20039 } 20040 } 20041 } ]), PaymentFields; 20042 }(); 20043 exports.default = PaymentFields; 20044 }, { 20045 "../../../core/utilities/gtm.utilities": 16, 20046 "../submitButton/submitButton": 88, 20047 "./../../../core/utilities/checkout.utilities": 15, 20048 "./../../../core/utilities/heifer.utilities": 19, 20049 "core-js/modules/es6.array.iterator": 241, 20050 "core-js/modules/es6.date.to-string": 243, 20051 "core-js/modules/es6.function.name": 244, 20052 "core-js/modules/es6.object.keys": 250, 20053 "core-js/modules/es6.object.to-string": 252, 20054 "core-js/modules/es6.promise": 253, 20055 "core-js/modules/es6.regexp.replace": 259, 20056 "core-js/modules/es6.regexp.to-string": 262, 20057 "core-js/modules/es6.string.includes": 264, 20058 "core-js/modules/es6.string.iterator": 265, 20059 "core-js/modules/es6.typed.uint8-array": 269, 20060 "core-js/modules/es7.array.includes": 270, 20061 "core-js/modules/web.dom.iterable": 274 20062 } ],
20063 86: [ function(require, module, exports) { 20064 "use strict"; 20065 Object.defineProperty(exports, "__esModule", { 20066 value: !0 20067 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 20068 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 20069 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 20070 require("core-js/modules/es6.object.keys"); 20071 var _a11y = require("./../../../core/utilities/a11y"), _heifer = require("./../../../core/utilities/heifer.utilities"); 20072 function ownKeys(object, enumerableOnly) { 20073 var keys = Object.keys(object); 20074 if (Object.getOwnPropertySymbols) { 20075 var symbols = Object.getOwnPropertySymbols(object); 20076 enumerableOnly && (symbols = symbols.filter(function(sym) { 20077 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 20078 })), keys.push.apply(keys, symbols); 20079 } 20080 return keys; 20081 } 20082 function _defineProperty(obj, key, value) { 20083 return key in obj ? Object.defineProperty(obj, key, { 20084 value: value, 20085 enumerable: !0, 20086 configurable: !0, 20087 writable: !0 20088 }) : obj[key] = value, obj; 20089 } 20090 function _defineProperties(target, props) { 20091 for (var i = 0; i < props.length; i++) { 20092 var descriptor = props[i]; 20093 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 20094 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 20095 } 20096 } 20097 var RadioReveal = function() { 20098 function RadioReveal(element, options) { 20099 !function(instance, Constructor) { 20100 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 20101 }(this, RadioReveal), this.element = element, this.$element = $(element); 20102 var defaults = {}; 20103 this._defaults = defaults, this.settings = function(target) { 20104 for (var i = 1; i < arguments.length; i++) { 20105 var source = null != arguments[i] ? arguments[i] : {}; 20106 i % 2 ? ownKeys(source, !0).forEach(function(key) { 20107 _defineProperty(target, key, source[key]); 20108 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 20109 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 20110 }); 20111 } 20112 return target; 20113 }({}, defaults, {}, options), this.init(); 20114 } 20115 return function(Constructor, protoProps, staticProps) { 20116 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 20117 }(RadioReveal, [ { 20118 key: "init", 20119 value: function() { 20120 this.radios = this.element.querySelectorAll('input[type="radio"]'), this.targets = this.element.querySelectorAll(".js-radio-reveal-target"), 20121 this.radioListener(); 20122 } 20123 }, { 20124 key: "radioListener", 20125 value: function() { 20126 var _this = this; 20127 [].forEach.call(this.radios, function(radio) { 20128 radio.addEventListener("change", function(ev) { 20129 [].forEach.call(_this.targets, function(target) { 20130 target.dataset.target == radio.dataset.revealTarget ? ((0, _heifer.uAddClass)(target, "is-revealed"), 20131 _this.toggleTargetTabindex(target, "0"), target.querySelectorAll(_a11y.a11yFocusElements)[0].focus()) : ((0, 20132 _heifer.uRemoveClass)(target, "is-revealed"), _this.toggleTargetTabindex(target, "-1"), 20133 _this.resetFields(target)); 20134 }); 20135 }); 20136 }); 20137 } 20138 }, { 20139 key: "toggleTargetTabindex", 20140 value: function(parent, tabindex) { 20141 [].forEach.call(parent.querySelectorAll(_a11y.a11yFocusElements), function(el) { 20142 el.tabindex = tabindex; 20143 }); 20144 } 20145 }, { 20146 key: "resetFields", 20147 value: function(parent) { 20148 [].forEach.call(parent.querySelectorAll(_a11y.a11yFocusElements), function(el) { 20149 el.value = ""; 20150 }); 20151 } 20152 } ]), RadioReveal; 20153 }(); 20154 exports.default = RadioReveal; 20155 }, {
20156 "./../../../core/utilities/a11y": 14, 20157 "./../../../core/utilities/heifer.utilities": 19, 20158 "core-js/modules/es6.array.iterator": 241, 20159 "core-js/modules/es6.object.keys": 250, 20160 "core-js/modules/es6.object.to-string": 252, 20161 "core-js/modules/es6.symbol": 268, 20162 "core-js/modules/es7.object.get-own-property-descriptors": 272, 20163 "core-js/modules/web.dom.iterable": 274 20164 } ], 20165 87: [ function(require, module, exports) { 20166 "use strict"; 20167 Object.defineProperty(exports, "__esModule", { 20168 value: !0 20169 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 20170 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 20171 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 20172 require("core-js/modules/es6.object.keys"); 20173 var obj, _jquery = (obj = require("jquery")) && obj.__esModule ? obj : { 20174 default: obj 20175 }, _heifer = require("../../../core/utilities/heifer.utilities"); 20176 function ownKeys(object, enumerableOnly) { 20177 var keys = Object.keys(object); 20178 if (Object.getOwnPropertySymbols) { 20179 var symbols = Object.getOwnPropertySymbols(object); 20180 enumerableOnly && (symbols = symbols.filter(function(sym) { 20181 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 20182 })), keys.push.apply(keys, symbols); 20183 } 20184 return keys; 20185 } 20186 function _defineProperty(obj, key, value) { 20187 return key in obj ? Object.defineProperty(obj, key, { 20188 value: value, 20189 enumerable: !0, 20190 configurable: !0, 20191 writable: !0 20192 }) : obj[key] = value, obj; 20193 } 20194 function _defineProperties(target, props) { 20195 for (var i = 0; i < props.length; i++) { 20196 var descriptor = props[i]; 20197 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 20198 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 20199 } 20200 } 20201 var ReasonForGiving = function() { 20202 function ReasonForGiving(element, options) { 20203 !function(instance, Constructor) { 20204 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 20205 }(this, ReasonForGiving), this.element = element, this.$element = (0, _jquery.default)(element); 20206 var defaults = {}; 20207 this._defaults = defaults, this.settings = function(target) { 20208 for (var i = 1; i < arguments.length; i++) { 20209 var source = null != arguments[i] ? arguments[i] : {}; 20210 i % 2 ? ownKeys(source, !0).forEach(function(key) { 20211 _defineProperty(target, key, source[key]); 20212 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 20213 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 20214 }); 20215 } 20216 return target; 20217 }({}, defaults, {}, options), this.wrapper = document.querySelector(".reasonForGiving__catalogInputWrapper"), 20218 this.catalogRadio = document.getElementById("heifer_catalog"), this.init(); 20219 } 20220 return function(Constructor, protoProps, staticProps) { 20221 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 20222 }(ReasonForGiving, [ { 20223 key: "init", 20224 value: function() { 20225 var _this = this; 20226 (0, _heifer.uAddEventListener)(document.getElementById("heifer_mail"), "change", function(ev) { 20227 _this.hideCatalogField(); 20228 }), (0, _heifer.uAddEventListener)(document.getElementById("other"), "change", function(ev) { 20229 _this.hideCatalogField(); 20230 }), (0, _heifer.uAddEventListener)(this.catalogRadio, "change", function(ev) { 20231 _this.catalogRadio.checked ? _this.showCatalogField() : _this.hideCatalogField(); 20232 }); 20233 } 20234 }, { 20235 key: "showCatalogField", 20236 value: function() { 20237 this.catalogRadio.checked && (this.wrapper.style.display = "block"); 20238 } 20239 }, { 20240 key: "hideCatalogField", 20241 value: function() { 20242 this.wrapper.style.display = "none"; 20243 } 20244 } ]), ReasonForGiving; 20245 }(); 20246 exports.default = ReasonForGiving; 20247 }, {
20248 "../../../core/utilities/heifer.utilities": 19, 20249 "core-js/modules/es6.array.iterator": 241, 20250 "core-js/modules/es6.object.keys": 250, 20251 "core-js/modules/es6.object.to-string": 252, 20252 "core-js/modules/es6.symbol": 268, 20253 "core-js/modules/es7.object.get-own-property-descriptors": 272, 20254 "core-js/modules/web.dom.iterable": 274, 20255 jquery: 20 20256 } ], 20257 88: [ function(require, module, exports) { 20258 "use strict"; 20259 Object.defineProperty(exports, "__esModule", { 20260 value: !0 20261 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 20262 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 20263 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 20264 require("core-js/modules/es6.object.keys"); 20265 var _heifer = require("../../../core/utilities/heifer.utilities"); 20266 function ownKeys(object, enumerableOnly) { 20267 var keys = Object.keys(object); 20268 if (Object.getOwnPropertySymbols) { 20269 var symbols = Object.getOwnPropertySymbols(object); 20270 enumerableOnly && (symbols = symbols.filter(function(sym) { 20271 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 20272 })), keys.push.apply(keys, symbols); 20273 } 20274 return keys; 20275 } 20276 function _defineProperty(obj, key, value) { 20277 return key in obj ? Object.defineProperty(obj, key, { 20278 value: value, 20279 enumerable: !0, 20280 configurable: !0, 20281 writable: !0 20282 }) : obj[key] = value, obj; 20283 } 20284 function _defineProperties(target, props) { 20285 for (var i = 0; i < props.length; i++) { 20286 var descriptor = props[i]; 20287 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 20288 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 20289 } 20290 } 20291 var SubmitButton = function() { 20292 function SubmitButton(element, options) { 20293 !function(instance, Constructor) { 20294 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 20295 }(this, SubmitButton), this.element = element, this.$element = $(element); 20296 var defaults = { 20297 loadingClass: "is-loading", 20298 trigger: "submit", 20299 event: "" 20300 }; 20301 this._defaults = defaults, this.settings = function(target) { 20302 for (var i = 1; i < arguments.length; i++) { 20303 var source = null != arguments[i] ? arguments[i] : {}; 20304 i % 2 ? ownKeys(source, !0).forEach(function(key) { 20305 _defineProperty(target, key, source[key]); 20306 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 20307 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 20308 }); 20309 } 20310 return target; 20311 }({}, defaults, {}, options), this.element && this.init(); 20312 } 20313 return function(Constructor, protoProps, staticProps) { 20314 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 20315 }(SubmitButton, [ { 20316 key: "init", 20317 value: function() { 20318 this.settings.input ? this.bindEvents() : this.element.querySelector(".loadingButton__text") || (this.prepButton(), 20319 this.bindEvents()); 20320 } 20321 }, { 20322 key: "prepButton", 20323 value: function() {
20324 this.element.innerHTML = '\n <span class="loadingButton__text">'.concat(this.element.innerHTML, '</span>\n <span class="loadingButton__loader"></span>\n '); 20325 } 20326 }, { 20327 key: "bindEvents", 20328 value: function() { 20329 var _this = this; 20330 "click" == this.settings.trigger ? this.element.addEventListener("click", function(ev) { 20331 _this.initLoading(); 20332 }) : "event" == this.settings.trigger ? window.addEventListener(this.settings.event, function(ev) { 20333 _this.initLoading(); 20334 }) : "none" == this.settings.trigger ? this.initLoading() : this.element.form.addEventListener("submit", function(ev) { 20335 _this.initLoading(); 20336 }); 20337 } 20338 }, { 20339 key: "initLoading", 20340 value: function() { 20341 this.disableButton(), this.addLoadingStyles(); 20342 } 20343 }, { 20344 key: "disableButton", 20345 value: function() { 20346 this.element.disabled = !0; 20347 } 20348 }, { 20349 key: "enableButton", 20350 value: function() { 20351 this.element.disabled = !1; 20352 } 20353 }, { 20354 key: "addLoadingStyles", 20355 value: function() { 20356 (0, _heifer.uHasClass)(this.element, this.settings.loadingClass) || (0, _heifer.uAddClass)(this.element, this.settings.loadingClass); 20357 } 20358 }, { 20359 key: "removeLoadingStyles", 20360 value: function() { 20361 (0, _heifer.uHasClass)(this.element, this.settings.loadingClass) && (0, _heifer.uRemoveClass)(this.element, this.settings.loadingClass); 20362 } 20363 }, { 20364 key: "reset", 20365 value: function() { 20366 this.enableButton(), this.removeLoadingStyles(); 20367 } 20368 } ]), SubmitButton; 20369 }(); 20370 exports.default = SubmitButton; 20371 }, { 20372 "../../../core/utilities/heifer.utilities": 19, 20373 "core-js/modules/es6.array.iterator": 241, 20374 "core-js/modules/es6.object.keys": 250, 20375 "core-js/modules/es6.object.to-string": 252, 20376 "core-js/modules/es6.symbol": 268, 20377 "core-js/modules/es7.object.get-own-property-descriptors": 272, 20378 "core-js/modules/web.dom.iterable": 274 20379 } ], 20380 89: [ function(require, module, exports) { 20381 "use strict"; 20382 Object.defineProperty(exports, "__esModule", { 20383 value: !0 20384 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 20385 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 20386 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 20387 require("core-js/modules/es6.object.keys"), require("core-js/modules/es7.array.includes"), 20388 require("core-js/modules/es6.string.includes"), require("core-js/modules/es6.string.iterator"), 20389 require("core-js/modules/es6.array.from"); 20390 var obj, _jquery = (obj = require("jquery")) && obj.__esModule ? obj : { 20391 default: obj 20392 }, _heifer = require("../../../core/utilities/heifer.utilities"); 20393 function ownKeys(object, enumerableOnly) { 20394 var keys = Object.keys(object); 20395 if (Object.getOwnPropertySymbols) { 20396 var symbols = Object.getOwnPropertySymbols(object); 20397 enumerableOnly && (symbols = symbols.filter(function(sym) { 20398 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 20399 })), keys.push.apply(keys, symbols); 20400 } 20401 return keys; 20402 } 20403 function _defineProperty(obj, key, value) { 20404 return key in obj ? Object.defineProperty(obj, key, { 20405 value: value, 20406 enumerable: !0, 20407 configurable: !0, 20408 writable: !0 20409 }) : obj[key] = value, obj; 20410 } 20411 function _defineProperties(target, props) { 20412 for (var i = 0; i < props.length; i++) { 20413 var descriptor = props[i]; 20414 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 20415 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 20416 } 20417 } 20418 var StateFieldSwitch = function() { 20419 function StateFieldSwitch(element, options) { 20420 !function(instance, Constructor) { 20421 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 20422 }(this, StateFieldSwitch), this.element = element, this.$element = (0, _jquery.default)(this.element), 20423 this.$window = (0, _jquery.default)(window); 20424 var defaults = { 20425 ignoreAttr: "data-conditional-field-ignore" 20426 }; 20427 this._defaults = defaults, this.settings = function(target) { 20428 for (var i = 1; i < arguments.length; i++) { 20429 var source = null != arguments[i] ? arguments[i] : {};
20430 i % 2 ? ownKeys(source, !0).forEach(function(key) { 20431 _defineProperty(target, key, source[key]); 20432 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 20433 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 20434 }); 20435 } 20436 return target; 20437 }({}, defaults, {}, options), this.init(); 20438 } 20439 return function(Constructor, protoProps, staticProps) { 20440 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 20441 }(StateFieldSwitch, [ { 20442 key: "init", 20443 value: function() { 20444 this.countrySelects = this.element.querySelectorAll(".js-country-select"), this.countryList = Array.from(this.element.querySelectorAll("[data-country]"), function(el) { 20445 return el.dataset.country; 20446 }), this.bindEvents(); 20447 } 20448 }, { 20449 key: "bindEvents", 20450 value: function() { 20451 var _this = this, self = this; 20452 [].forEach.call(self.countrySelects, function(select) { 20453 select.addEventListener("change", function(event) { 20454 var enableSelect = self.element.querySelector('.js-state-select[data-address="' + select.dataset.address + '"][data-country="' + event.target.value + '"]'), stateSelects = self.element.querySelectorAll('.js-state-select[data-address="' + select.dataset.address + '"][data-country]'), stateInput = self.element.querySelector('.js-state-input[data-address="' + select.dataset.address + '"]'); 20455 event.target.value && self.countryList.includes(event.target.value) ? _this.showStateSelect(enableSelect, stateSelects, stateInput) : _this.showStateInput(stateInput, stateSelects); 20456 }); 20457 }); 20458 } 20459 }, { 20460 key: "showStateSelect", 20461 value: function(enableSelect, disableSelects, disableInput) { 20462 var self = this; 20463 disableSelects.forEach(function(select) { 20464 (0, _heifer.uHasClass)(select, "is-revealed") && ((0, _heifer.uRemoveClass)(select, "is-revealed"), 20465 select.querySelector("select").disabled = !0, select.querySelector("select").setAttribute(self.settings.ignoreAttr, !0)); 20466 }), (0, _heifer.uHasClass)(disableInput, "is-revealed") && ((0, _heifer.uRemoveClass)(disableInput, "is-revealed"), 20467 disableInput.querySelector("input").disabled = !0, disableInput.querySelector("input").setAttribute(self.settings.ignoreAttr, !0)), 20468 (0, _heifer.uHasClass)(enableSelect, "is-revealed") || ((0, _heifer.uAddClass)(enableSelect, "is-revealed"), 20469 enableSelect.querySelector("select").disabled = !1, enableSelect.querySelector("select").removeAttribute(self.settings.ignoreAttr)); 20470 } 20471 }, { 20472 key: "showStateInput", 20473 value: function(input, disableSelects) { 20474 var self = this; 20475 disableSelects.forEach(function(select) { 20476 (0, _heifer.uHasClass)(select, "is-revealed") && ((0, _heifer.uRemoveClass)(select, "is-revealed"), 20477 select.querySelector("select").disabled = !0, select.querySelector("select").setAttribute(self.settings.ignoreAttr, !0)); 20478 }), (0, _heifer.uHasClass)(input, "is-revealed") || ((0, _heifer.uAddClass)(in
20478put, "is-revealed"), 20479 input.querySelector("input").disabled = !1, input.querySelector("input").removeAttribute(self.settings.ignoreAttr)); 20480 } 20481 } ]), StateFieldSwitch; 20482 }(); 20483 exports.default = StateFieldSwitch; 20484 }, { 20485 "../../../core/utilities/heifer.utilities": 19, 20486 "core-js/modules/es6.array.from": 240, 20487 "core-js/modules/es6.array.iterator": 241, 20488 "core-js/modules/es6.object.keys": 250, 20489 "core-js/modules/es6.object.to-string": 252, 20490 "core-js/modules/es6.string.includes": 264, 20491 "core-js/modules/es6.string.iterator": 265, 20492 "core-js/modules/es6.symbol": 268, 20493 "core-js/modules/es7.array.includes": 270, 20494 "core-js/modules/es7.object.get-own-property-descriptors": 272, 20495 "core-js/modules/web.dom.iterable": 274, 20496 jquery: 20 20497 } ], 20498 90: [ function(require, module, exports) { 20499 "use strict"; 20500 Object.defineProperty(exports, "__esModule", { 20501 value: !0 20502 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 20503 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 20504 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 20505 require("core-js/modules/es6.object.keys"); 20506 _interopRequireDefault(require("jquery")); 20507 var _tabs = _interopRequireDefault(require("./../../tabs/tabs")); 20508 require("./../../../core/utilities/heifer.utilities"); 20509 function _interopRequireDefault(obj) { 20510 return obj && obj.__esModule ? obj : { 20511 default: obj 20512 }; 20513 } 20514 function ownKeys(object, enumerableOnly) { 20515 var keys = Object.keys(object); 20516 if (Object.getOwnPropertySymbols) { 20517 var symbols = Object.getOwnPropertySymbols(object); 20518 enumerableOnly && (symbols = symbols.filter(function(sym) { 20519 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 20520 })), keys.push.apply(keys, symbols); 20521 } 20522 return keys; 20523 } 20524 function _defineProperty(obj, key, value) { 20525 return key in obj ? Object.defineProperty(obj, key, { 20526 value: value, 20527 enumerable: !0, 20528 configurable: !0, 20529 writable: !0 20530 }) : obj[key] = value, obj; 20531 } 20532 function _defineProperties(target, props) { 20533 for (var i = 0; i < props.length; i++) { 20534 var descriptor = props[i]; 20535 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 20536 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 20537 } 20538 } 20539 var TabbedForms = function() { 20540 function TabbedForms(element, options) { 20541 !function(instance, Constructor) { 20542 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 20543 }(this, TabbedForms), this.element = element; 20544 var defaults = { 20545 fieldsSelector: "select,textarea,input" 20546 }; 20547 this._defaults = defaults, this.settings = function(target) { 20548 for (var i = 1; i < arguments.length; i++) { 20549 var source = null != arguments[i] ? arguments[i] : {}; 20550 i % 2 ? ownKeys(source, !0).forEach(function(key) { 20551 _defineProperty(target, key, source[key]); 20552 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 20553 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 20554 }); 20555 } 20556 return target; 20557 }({}, defaults, {}, options), this.tabs = this.init(); 20558 } 20559 return function(Constructor, protoProps, staticProps) { 20560 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 20561 }(TabbedForms, [ { 20562 key: "init", 20563 value: function() { 20564 return this.initTabs(); 20565 } 20566 }, { 20567 key: "initTabs", 20568 value: function() { 20569 return new _tabs.default(this.element, { 20570 onShow: this.enableTabFields.bind(this), 20571 onHide: this.disableTabFields.bind(this) 20572 }); 20573 } 20574 }, { 20575 key: "enableTabFields", 20576 value: function(trigger, targets) { 20577 var _this = this;
20578 targets.forEach(function(target) { 20579 [].forEach.call(target.querySelectorAll(_this.settings.fieldsSelector), function(field) { 20580 field.disabled = !1; 20581 }); 20582 }); 20583 } 20584 }, { 20585 key: "disableTabFields", 20586 value: function(trigger, targets) { 20587 var _this2 = this; 20588 targets.forEach(function(target) { 20589 [].forEach.call(target.querySelectorAll(_this2.settings.fieldsSelector), function(field) { 20590 field.disabled = !0; 20591 }); 20592 }); 20593 } 20594 } ]), TabbedForms; 20595 }(); 20596 exports.default = TabbedForms; 20597 }, { 20598 "./../../../core/utilities/heifer.utilities": 19, 20599 "./../../tabs/tabs": 130, 20600 "core-js/modules/es6.array.iterator": 241, 20601 "core-js/modules/es6.object.keys": 250, 20602 "core-js/modules/es6.object.to-string": 252, 20603 "core-js/modules/es6.symbol": 268, 20604 "core-js/modules/es7.object.get-own-property-descriptors": 272, 20605 "core-js/modules/web.dom.iterable": 274, 20606 jquery: 20 20607 } ], 20608 91: [ function(require, module, exports) { 20609 "use strict"; 20610 var g, e, ys; 20611 if (g = window, e = "Genesys", g._genesysJs = e, g[e] = g[e] || function() { 20612 (g[e].q = g[e].q || []).push(arguments); 20613 }, g[e].t = 1 * new Date(), g[e].c = { 20614 environment: "prod-usw2", 20615 deploymentId: "42294833-85b9-4681-b946-2e4ea9b36548" 20616 }, (ys = document.createElement("script")).async = 1, ys.src = "https://apps.usw2.pure.cloud/genesys-bootstrap/genesys.min.js", 20617 ys.charset = "utf-8", document.head.appendChild(ys), null != document.querySelectorAll(".js-live-chat")) for (var liveChatBtn = document.querySelectorAll(".js-live-chat"), i = 0; i < liveChatBtn.length; i++) { 20618 liveChatBtn[i].addEventListener("click", function() { 20619 Genesys("subscribe", "Messenger.ready", function() { 20620 Genesys("command", "Messenger.open", {}, function() { 20621 console.log("Messenger opened"); 20622 }, function(error) { 20623 console.log("Couldn't open messenger.", error); 20624 }); 20625 }); 20626 }); 20627 } 20628 }, {} ], 20629 92: [ function(require, module, exports) { 20630 "use strict"; 20631 Object.defineProperty(exports, "__esModule", { 20632 value: !0 20633 }), exports.default = function(elem) { 20634 $(".alert__close").click(function() { 20635 $(".alert").remove(), (0, _heifer.uSetCookie)("alert-closed"); 20636 }); 20637 }; 20638 var _heifer = require("./../../../../core/utilities/heifer.utilities"); 20639 }, { 20640 "./../../../../core/utilities/heifer.utilities": 19 20641 } ], 20642 93: [ function(require, module, exports) { 20643 "use strict"; 20644 Object.defineProperty(exports, "__esModule", { 20645 value: !0 20646 }), exports.default = void 0, require("core-js/modules/es7.symbol.async-iterator"), 20647 require("core-js/modules/es7.object.get-own-property-descriptors"), require("core-js/modules/es6.symbol"), 20648 require("core-js/modules/web.dom.iterable"), require("core-js/modules/es6.array.iterator"), 20649 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.promise"), 20650 require("core-js/modules/es6.object.to-string"), require("core-js/modules/es6.array.find"); 20651 var _jquery = _interopRequireDefault(require("jquery")), _reveal = _interopRequireDefault(require("./../../../core/ui/reveal.es6")), _primaryNavigation = _interopRequireDefault(require("./primaryNavigation/primaryNavigation")), _secondaryNavigation = _interopRequireDefault(require("./secondaryNavigation/secondaryNavigation")), _alert = _interopRequireDefault(require("./alert/alert")), _a11y = require("./../../../core/utilities/a11y"), _heifer = require("./../../../core/utilities/heifer.utilities"); 20652 function _interopRequireDefault(obj) { 20653 return obj && obj.__esModule ? obj : { 20654 default: obj 20655 }; 20656 } 20657 function _typeof(obj) { 20658 return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { 20659 return typeof obj; 20660 } : function(obj) { 20661 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 20662 })(obj); 20663 } 20664 function ownKeys(object, enumerableOnly) { 20665 var keys = Object.keys(object); 20666 if (Object.getOwnPropertySymbols) { 20667 var symbols = Object.getOwnPropertySymbols(object); 20668 enumerableOnly && (symbols = symbols.filter(function(sym) { 20669 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 20670 })), keys.push.apply(keys, symbols); 20671 } 20672 return keys; 20673 } 20674 function _defineProperty(obj, key, value) { 20675 return key in obj ? Object.defineProperty(obj, key, { 20676 value: value, 20677 enumerable: !0, 20678 configurable: !0, 20679 writable: !0 20680 }) : obj[key] = value, obj; 20681 } 20682 function _defineProperties(target, props) { 20683 for (var i = 0; i < props.length; i++) { 20684 var descriptor = props[i]; 20685 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 20686 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 20687 } 20688 } 20689 var MainHeader = function() { 20690 function MainHeader(element) { 20691 var options = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; 20692 !function(instance, Constructor) { 20693 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 20694 }(this, MainHeader), this.element = element, this.$element = (0, _jquery.default)(element); 20695 var defaults = {}; 20696 this._defaults = defaults, this.settings = function(target) { 20697 for (var i = 1; i < arguments.length; i++) { 20698 var source = null != arguments[i] ? arguments[i] : {};
20699 i % 2 ? ownKeys(source, !0).forEach(function(key) { 20700 _defineProperty(target, key, source[key]); 20701 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 20702 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 20703 }); 20704 } 20705 return target; 20706 }({}, defaults, {}, options), this.largeBreakpoint = window.matchMedia("(min-width: 992px)"), 20707 this.breadcrumbs = window.Heifer.shared.breadcrumbs ? window.Heifer.shared.breadcrumbs : null, 20708 this.timesLoaded = 0, this.initialPageTitle = "", this.bindEvents(), this.init(); 20709 } 20710 return function(Constructor, protoProps, staticProps) { 20711 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 20712 }(MainHeader, [ { 20713 key: "init", 20714 value: function() { 20715 this.primaryNav = this.element.querySelector(".js-primary-nav"), this.secondaryNav = this.element.querySelector(".js-secondary-nav"), 20716 this.smallNav = this.element.querySelector(".js-small-nav"), this.smallNavTrigger = this.element.querySelector(".js-small-nav-trigger"), 20717 this.smallNavTriggerContent = this.smallNavTrigger.querySelectorAll(".js-small-nav-trigger-content"), 20718 this.smallNavOverlay = this.element.querySelector(".js-small-nav-overlay"), this.alert = this.element.querySelector(".alert"), 20719 (0, _primaryNavigation.default)(this.primaryNav), window.Heifer.shared.foundation.secondaryNav && (0, 20720 _secondaryNavigation.default)(this.secondaryNav), window.Heifer.shared.foundation.alert && (0, 20721 _alert.default)(this.alert), this.initSmallNavReveal(), this.loadInitialNavigation(); 20722 } 20723 }, { 20724 key: "loadInitialNavigation", 20725 value: function() { 20726 this.loadNavigationView(this.smallNavTrigger); 20727 } 20728 }, { 20729 key: "initSmallNavReveal", 20730 value: function() { 20731 var _this = this; 20732 return new _reveal.default(this.smallNavTrigger, { 20733 type: "exclusive", 20734 onShow: function() { 20735 _this.toggleSmallNav(), (0, _heifer.uStopPageScrollable)(), (0, _heifer.uAddClass)(_this.alert, "mainHeader__hide-alert"); 20736 }, 20737 onHide: function() { 20738 _this.toggleSmallNav(), (0, _heifer.uStartPageScrollable)(), (0, _heifer.uRemoveClass)(_this.alert, "mainHeader__hide-alert"); 20739 } 20740 }); 20741 } 20742 }, { 20743 key: "bindEvents", 20744 value: function() { 20745 var _this2 = this; 20746 this.$element.on("click", ".js-mainHeader__sub-nav-trigger", function(ev) { 20747 _this2.loadNavigationView(ev.currentTarget); 20748 }), this.$element.on("click", ".js-mainHeader__sub-nav-trigger--prev", function(ev) { 20749 _this2.loadPreviousNavigationView(ev.currentTarget); 20750 }), this.$element.on("click", ".js-small-nav-hamburger", function(ev) { 20751 (void 0 !== document.getElementsByClassName("js-small-nav-container-current")[0].getElementsByClassName("smallNavigationScreen__page-title")[0] ? document.getElementsByClassName("js-small-nav-container-current")[0].getElementsByClassName("smallNavigationScreen__page-title")[0].innerText : "") != _this2.initialPageTitle && _this2.loadInitialNavigation(); 20752 }); 20753 } 20754 }, { 20755 key: "loadNavigationView", 20756 value: function(trigger) { 20757 var _this3 = this, path = trigger.getAttribute("data-url"), prev = trigger.getAttribute("data-prev-url"), $container = this.$element.find(".js-small-nav"), $prev = this.$element.find(".js-small-nav-container-prev"), $current = this.$element.find(".js-small-nav-container-current"), $next = this.$element.find(".js-small-nav-container-next"); 20758 this.getNavigationData(path, prev).then(function(data) { 20759 0 < data.length && (data = JSON.parse(data), $container.addClass("is-transitioning--next"), 20760 $next.html(data.html), _this3.highLightPath(), _this3.timesLoaded += 1, 1 == _this3.timesLoaded && void 0 !== document.getElementsByClassName("smallNavigationScreen__page-title")[0] && (_this3.initialPageTitle = document.getElementsByClassName("smallNavigationScreen__page-title")[0].innerText), 20761 window.setTimeout(function() { 20762 $prev.html($current.html()), $current.html($next.html()), $next.html(""), $container.removeClass("is-transitioning--next"); 20763 }, 250)); 20764 }); 20765 } 20766 }, { 20767 key: "loadPreviousNavigationView", 20768 value: function(trigger) { 20769 var _this4 = this, path = trigger.getAttribute("data-url"), $container = this.$element.find(".js-small-nav"), $prev = this.$element.find(".js-small-nav-container-prev"), $current = this.$element.find(".js-small-nav-container-current"), $next = this.$element.find(".js-small-nav-container-next"); 20770 this.getNavigationData(path, "/index").then(function(data) { 20771 0 < data.length && (data = JSON.parse(data), $container.addClass("is-transitioning--prev"), 20772 $prev.html(data.html), _this4.highLightPath(), window.setTimeout(function() { 20773 $next.html($current.html()), $current.html($prev.html()), $prev.html(""), $container.removeClass("is-transitioning--prev"); 20774 }, 250)); 20775 }); 20776 } 20777 }, { 20778 key: "getNavigationData", 20779 value: function(path, prev) { 20780 return (0, _heifer.uAjaxWithResponse)("GET", "/api/navigation.html?url=".concat(path, "&prev=").concat(prev), !0); 20781 } 20782 }, { 20783 key: "timeoutPromise", 20784 value: function(delay) { 20785 return new Promise(function(resolve) { 20786 window.setTimeout(resolve, delay); 20787 }); 20788 } 20789 }, { 20790 key: "isLarge", 20791 value: function() { 20792 return this.largeBreakpoint.matches; 20793 } 20794 }, { 20795 key: "isSmall", 20796 value: function() { 20797 return !this.largeBreakpoint.matches; 20798 } 20799 }, { 20800 key: "toggleSmallNav", 20801 value: function() { 20802 var _this5 = this; 20803 [].forEach.call(this.smallNavTriggerContent, function(el) { 20804 _this5.toggleHidden(el); 20805 }), this.toggleHidden(this.smallNavOverlay), (0, _a11y.a11yChildTabindexToggle)(this.smallNav); 20806 } 20807 }, { 20808 key: "toggleHidden", 20809 value: function(el) { 20810 !0 === el.hidden ? el.hidden = !1 : el.hidden = !0; 20811 } 20812 }, { 20813 key: "highLightPath", 20814 value: function() { 20815 var _this6 = this, links = document.getElementsByClassName("smallNavigationScreen__link"); 20816 [].forEach.call(links, function(el) { 20817 for (var i = 0; i < _this6.breadcrumbs.length; i++) void 0 !== _typeof(_this6.breadcrumbs[i].fullURL) && _this6.breadcrumbs[i].fullURL == el.pathname && ((0, 20818 _heifer.uAddClass)(el, "in-path"), null !== el.nextElementSibling && (el.nextElementSibling.innerHTML = '<svg class="icons__icon" aria-hidden="true"><use xlink:href="#arrow-right-bolder"></use></svg>')); 20819 }); 20820 } 20821 } ]), MainHeader; 20822 }(); 20823 exports.default = MainHeader; 20824 }, {
20825 "./../../../core/ui/reveal.es6": 12, 20826 "./../../../core/utilities/a11y": 14, 20827 "./../../../core/utilities/heifer.utilities": 19, 20828 "./alert/alert": 92, 20829 "./primaryNavigation/primaryNavigation": 94, 20830 "./secondaryNavigation/secondaryNavigation": 95, 20831 "core-js/modules/es6.array.find": 239, 20832 "core-js/modules/es6.array.iterator": 241, 20833 "core-js/modules/es6.object.keys": 250, 20834 "core-js/modules/es6.object.to-string": 252, 20835 "core-js/modules/es6.promise": 253, 20836 "core-js/modules/es6.symbol": 268, 20837 "core-js/modules/es7.object.get-own-property-descriptors": 272, 20838 "core-js/modules/es7.symbol.async-iterator": 273, 20839 "core-js/modules/web.dom.iterable": 274, 20840 jquery: 20 20841 } ], 20842 94: [ function(require, module, exports) { 20843 "use strict"; 20844 Object.defineProperty(exports, "__esModule", { 20845 value: !0 20846 }), exports.default = function(elem) { 20847 !function(elem) { 20848 links = elem.querySelectorAll(".js-primary-nav-node"), [].forEach.call(links, function(link) { 20849 (0, _hoverintent.default)(link, function() { 20850 (0, _heifer.uAddClass)(link, "is-active"), [].forEach.call(link.querySelectorAll(".js-dropdown-featured-img"), function(img) { 20851 (0, _dynamicResponsiveImages.loadDynamicImage)(img); 20852 }); 20853 }, function() { 20854 (0, _heifer.uRemoveClass)(link, "is-active"); 20855 }); 20856 }); 20857 }(elem); 20858 }; 20859 var obj, _hoverintent = (obj = require("hoverintent")) && obj.__esModule ? obj : { 20860 default: obj 20861 }, _dynamicResponsiveImages = require("../../../../core/images/dynamic-responsive-images"), _heifer = require("../../../../core/utilities/heifer.utilities"); 20862 var links = []; 20863 }, { 20864 "../../../../core/images/dynamic-responsive-images": 2, 20865 "../../../../core/utilities/heifer.utilities": 19, 20866 hoverintent: 281 20867 } ], 20868 95: [ function(require, module, exports) { 20869 "use strict"; 20870 Object.defineProperty(exports, "__esModule", { 20871 value: !0 20872 }), exports.default = function(elem) { 20873 !function(elem) { 20874 navLinks = (nav = elem).querySelectorAll(".js-secondary-nav-link"), window.addEventListener("resize", (0, 20875 _heifer.uDebounce)(function() { 20876 initOverflow(); 20877 })), initOverflow(); 20878 }(elem); 20879 }; 20880 var nav, navLinks, _heifer = require("../../../../core/utilities/heifer.utilities"); 20881 function initOverflow() { 20882 nav.getBoundingClientRect().width < function() { 20883 var width = 0; 20884 return [].forEach.call(navLinks, function(link) { 20885 width += link.getBoundingClientRect().width; 20886 }), width; 20887 }() ? (0, _heifer.uAddClass)(nav, "is-overflowing") : (0, _heifer.uRemoveClass)(nav, "is-overflowing"); 20888 } 20889 }, { 20890 "../../../../core/utilities/heifer.utilities": 19 20891 } ], 20892 96: [ function(require, module, exports) { 20893 "use strict"; 20894 Object.defineProperty(exports, "__esModule", { 20895 value: !0 20896 }), exports.default = void 0; 20897 var _heifer = require("../../../core/utilities/heifer.utilities"), _a11y = require("../../../core/utilities/a11y"); 20898 function _defineProperties(target, props) { 20899 for (var i = 0; i < props.length; i++) { 20900 var descriptor = props[i]; 20901 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 20902 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 20903 } 20904 } 20905 var NavSearchBar = function() { 20906 function NavSearchBar(identifier) { 20907 !function(instance, Constructor) { 20908 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 20909 }(this, NavSearchBar), this.id = identifier, this.init(); 20910 } 20911 return function(Constructor, protoProps, staticProps) { 20912 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 20913 }(NavSearchBar, [ { 20914 key: "init", 20915 value: function() { 20916 this.searchForm = document.querySelector(".js-nav-search-bar#".concat(this.id
20916)), 20917 this.searchOpen = this.searchForm.parentNode.querySelector(".js-nav-search-bar-open"), 20918 this.searchInput = this.searchForm.querySelector(".js-nav-search-bar-input"), this.setEventListeners(); 20919 } 20920 }, { 20921 key: "setEventListeners", 20922 value: function() { 20923 var _this = this; 20924 this.searchOpen && this.searchOpen.addEventListener("click", function() { 20925 _this.openSearch(); 20926 }); 20927 } 20928 }, { 20929 key: "openSearch", 20930 value: function() { 20931 this.searchForm && ((0, _heifer.uAddClass)(this.searchForm, "is-revealed"), (0, 20932 _a11y.a11yTabindexToggle)(this.searchInput), this.searchInput.focus(), this.searchOpen.classList.add("is-revealed")); 20933 } 20934 } ]), NavSearchBar; 20935 }(); 20936 exports.default = NavSearchBar; 20937 }, { 20938 "../../../core/utilities/a11y": 14, 20939 "../../../core/utilities/heifer.utilities": 19 20940 } ], 20941 97: [ function(require, module, exports) { 20942 "use strict"; 20943 Object.defineProperty(exports, "__esModule", { 20944 value: !0 20945 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 20946 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 20947 require("core-js/modules/es6.object.keys"), require("core-js/modules/es7.symbol.async-iterator"), 20948 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 20949 require("core-js/modules/es6.regexp.replace"), require("core-js/modules/es6.regexp.search"); 20950 var obj, _jquery = (obj = require("jquery")) && obj.__esModule ? obj : { 20951 default: obj 20952 }, _heifer = require("./../../../core/utilities/heifer.utilities"); 20953 function ownKeys(object, enumerableOnly) { 20954 var keys = Object.keys(object); 20955 if (Object.getOwnPropertySymbols) { 20956 var symbols = Object.getOwnPropertySymbols(object); 20957 enumerableOnly && (symbols = symbols.filter(function(sym) { 20958 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 20959 })), keys.push.apply(keys, symbols); 20960 } 20961 return keys; 20962 } 20963 function _defineProperty(obj, key, value) { 20964 return key in obj ? Object.defineProperty(obj, key, { 20965 value: value, 20966 enumerable: !0, 20967 configurable: !0, 20968 writable: !0 20969 }) : obj[key] = value, obj; 20970 } 20971 function _defineProperties(target, props) { 20972 for (var i = 0; i < props.length; i++) { 20973 var descriptor = props[i]; 20974 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 20975 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 20976 } 20977 } 20978 var PageContent = function() { 20979 function PageContent(element) { 20980 var options = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; 20981 !function(instance, Constructor) { 20982 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 20983 }(this, PageContent), this.element = element, this.$element = (0, _jquery.default)(element); 20984 var defaults = {}; 20985 this._defaults = defaults, this.settings = function(target) { 20986 for (var i = 1; i < arguments.length; i++) { 20987 var source = null != arguments[i] ? arguments[i] : {}; 20988 i % 2 ? ownKeys(source, !0).forEach(function(key) { 20989 _defineProperty(target, key, source[key]); 20990 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 20991 Object.defineProperty(target, key, Ob
20991ject.getOwnPropertyDescriptor(source, key)); 20992 }); 20993 } 20994 return target; 20995 }({}, defaults, {}, options), this.init(); 20996 } 20997 return function(Constructor, protoProps, staticProps) { 20998 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 20999 }(PageContent, [ { 21000 key: "init", 21001 value: function() { 21002 this.loadPageContent(this.element); 21003 } 21004 }, { 21005 key: "loadPageContent", 21006 value: function(content) { 21007 var queryString = window.location.search, urlParams = new URLSearchParams(queryString), passthruParams = ""; 21008 urlParams.get("msource") && (passthruParams += "&msource=" + urlParams.get("msource")), 21009 urlParams.get("isource") && (passthruParams += "&isource=" + urlParams.get("isource")), 21010 urlParams.get("utm_campaign") && (passthruParams += "&utm_campaign=" + urlParams.get("utm_campaign")), 21011 urlParams.get("utm_source") && (passthruParams += "&utm_source=" + urlParams.get("utm_source")), 21012 urlParams.get("utm_medium") && (passthruParams += "&utm_medium=" + urlParams.get("utm_medium")), 21013 urlParams.get("utm_term") && (passthruParams += "&utm_term=" + urlParams.get("utm_term")), 21014 urlParams.get("utm_content") && (passthruParams += "&utm_content=" + urlParams.get("utm_content")), 21015 passthruParams = passthruParams.replace(/^&/, "?"), window.Heifer.shared.pageContentPromise = (0, 21016 _heifer.uAjaxWithResponse)("POST", "/api/pagecontent.html" + passthruParams, !0, (0, 21017 _heifer.uJsonToQueryString)({ 21018 req: JSON.stringify(window.Heifer.shared.pageContent) 21019 }), "application/x-www-form-urlencoded; charset=UTF-8").then(function(response) { 21020 var responseObject = JSON.parse(response), targets = document.querySelectorAll(".js-page-content"), val = "", member = "", _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0; 21021 try { 21022 for (var _step, _iterator = targets[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) { 21023 var target = _step.value; 21024 if (target.dataset.pagecontentaction && target.dataset.pagecontent && responseObject[target.dataset.pagecontent]) switch (target.dataset.pagecontentaction) { 21025 case "display": 21026 responseObject[target.dataset.pagecontent] ? target.classList.remove("pageContent__hide-until-loaded") : target.remove(); 21027 break; 21028 21029 case "replace": 21030 target.innerHTML = responseObject[target.dataset.pagecontent]; 21031 break; 21032 21033 case "replace-first-instance": 21034 window.Heifer.shared.pageContent[target.dataset.pagecontent].hasBeenResolved && 1 == Object.keys(target.dataset).length ? target.remove() : (val = responseObject[target.dataset.pagecontent][target.dataset.pagecontentindex]) ? (target.innerHTML = val, 21035 window.Heifer.shared.pageContent[target.dataset.pagecontent].hasBeenResolved = !0) : target.remove(); 21036 break; 21037 21038 case "replace-value": 21039 (val = responseObject[target.dataset.pagecontent]) && (target.value = val, target.classList.contains("is-empty") && (target.classList.remove("is-empty"), 21040 target.classList.add("isnt-empty"))); 21041 break; 21042 21043 case "replace-json-value": 21044 if (val = responseObject[target.dataset.pagecontent][target.dataset.pagecontentindex], 21045 member = target.dataset.pagecontentjsonmember, val && member) { 21046 var inputValue = JSON.parse(target.value); 21047 inputValue[member] = val, target.value = JSON.stringify(inputValue); 21048 } 21049 break; 21050 21051 case "set-attribute": 21052 (val = responseObject[target.dataset.pagecontent]) && target.setAttribute(target.dataset.pagecontentattribute, val); 21053 break; 21054 21055 case "add-class": 21056 target.dataset.pagecontentclass && target.classList.add(target.dataset.pagecontentclass); 21057 } 21058 } 21059 } catch (err) {
21060 _didIteratorError = !0, _iteratorError = err; 21061 } finally { 21062 try { 21063 _iteratorNormalCompletion || null == _iterator.return || _iterator.return(); 21064 } finally { 21065 if (_didIteratorError) throw _iteratorError; 21066 } 21067 } 21068 }).catch(function(err) { 21069 console.error(err); 21070 }); 21071 } 21072 }, { 21073 key: "getPageContent", 21074 value: function(path) { 21075 return (0, _heifer.uAjaxWithResponse)("GET", "/api/pagecontent.html?url=".concat(path), !0); 21076 } 21077 } ]), PageContent; 21078 }(); 21079 exports.default = PageContent; 21080 }, { 21081 "./../../../core/utilities/heifer.utilities": 19, 21082 "core-js/modules/es6.array.iterator": 241, 21083 "core-js/modules/es6.object.keys": 250, 21084 "core-js/modules/es6.object.to-string": 252, 21085 "core-js/modules/es6.regexp.replace": 259, 21086 "core-js/modules/es6.regexp.search": 260, 21087 "core-js/modules/es6.symbol": 268, 21088 "core-js/modules/es7.object.get-own-property-descriptors": 272, 21089 "core-js/modules/es7.symbol.async-iterator": 273, 21090 "core-js/modules/web.dom.iterable": 274, 21091 jquery: 20 21092 } ], 21093 98: [ function(require, module, exports) { 21094 "use strict"; 21095 Object.defineProperty(exports, "__esModule", { 21096 value: !0 21097 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 21098 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 21099 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 21100 require("core-js/modules/es6.object.keys"); 21101 var _heifer = require("../../../core/utilities/heifer.utilities"), _a11y = require("../../../core/utilities/a11y"); 21102 function ownKeys(object, enumerableOnly) { 21103 var keys = Object.keys(object); 21104 if (Object.getOwnPropertySymbols) { 21105 var symbols = Object.getOwnPropertySymbols(object); 21106 enumerableOnly && (symbols = symbols.filter(function(sym) { 21107 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 21108 })), keys.push.apply(keys, symbols); 21109 } 21110 return keys; 21111 } 21112 function _defineProperty(obj, key, value) { 21113 return key in obj ? Object.defineProperty(obj, key, { 21114 value: value, 21115 enumerable: !0, 21116 configurable: !0, 21117 writable: !0 21118 }) : obj[key] = value, obj; 21119 } 21120 function _defineProperties(target, props) { 21121 for (var i = 0; i < props.length; i++) { 21122 var descriptor = props[i]; 21123 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 21124 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 21125 } 21126 } 21127 var SearchBar = function() { 21128 function SearchBar(element, options) { 21129 !function(instance, Constructor) { 21130 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 21131 }(this, SearchBar), this.element = element, this.$element = $(this.element), this._defaults = {}, 21132 this.settings = function(target) { 21133 for (var i = 1; i < arguments.length; i++) { 21134 var source = null != arguments[i] ? arguments[i] : {}; 21135 i % 2 ? ownKeys(source, !0).forEach(function(key) { 21136 _defineProperty(target, key, source[key]); 21137 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 21138 Object.defineProperty(target, key, Ob
21138ject.getOwnPropertyDescriptor(source, key)); 21139 }); 21140 } 21141 return target; 21142 }({}, this._defaults, {}, options), this.init(); 21143 } 21144 return function(Constructor, protoProps, staticProps) { 21145 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 21146 }(SearchBar, [ { 21147 key: "init", 21148 value: function() { 21149 this.searchForm = document.querySelector(".js-search-bar"), this.searchOpen = document.querySelector(".js-search-bar-open"), 21150 this.searchInput = this.searchForm.querySelector(".js-search-bar-input"), this.setEventListeners(); 21151 } 21152 }, { 21153 key: "setEventListeners", 21154 value: function() { 21155 var _this = this; 21156 this.searchOpen && this.searchOpen.addEventListener("click", function() { 21157 _this.openSearch(); 21158 }); 21159 } 21160 }, { 21161 key: "openSearch", 21162 value: function() { 21163 this.searchForm && ((0, _heifer.uAddClass)(this.searchForm, "is-revealed"), (0, 21164 _a11y.a11yTabindexToggle)(this.searchInput), this.searchInput.focus()); 21165 } 21166 } ]), SearchBar; 21167 }(); 21168 exports.default = SearchBar; 21169 }, { 21170 "../../../core/utilities/a11y": 14, 21171 "../../../core/utilities/heifer.utilities": 19, 21172 "core-js/modules/es6.array.iterator": 241, 21173 "core-js/modules/es6.object.keys": 250, 21174 "core-js/modules/es6.object.to-string": 252, 21175 "core-js/modules/es6.symbol": 268, 21176 "core-js/modules/es7.object.get-own-property-descriptors": 272, 21177 "core-js/modules/web.dom.iterable": 274 21178 } ], 21179 99: [ function(require, module, exports) { 21180 "use strict"; 21181 Object.defineProperty(exports, "__esModule", { 21182 value: !0 21183 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 21184 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 21185 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 21186 require("core-js/modules/es6.object.keys"); 21187 var _jquery = _interopRequireDefault(require("jquery")), _alert = _interopRequireDefault(require("./../mainHeader/alert/alert")); 21188 function _interopRequireDefault(obj) { 21189 return obj && obj.__esModule ? obj : { 21190 default: obj 21191 }; 21192 } 21193 function ownKeys(object, enumerableOnly) { 21194 var keys = Object.keys(object); 21195 if (Object.getOwnPropertySymbols) { 21196 var symbols = Object.getOwnPropertySymbols(object); 21197 enumerableOnly && (symbols = symbols.filter(function(sym) { 21198 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 21199 })), keys.push.apply(keys, symbols); 21200 } 21201 return keys; 21202 } 21203 function _defineProperty(obj, key, value) { 21204 return key in obj ? Object.defineProperty(obj, key, { 21205 value: value, 21206 enumerable: !0, 21207 configurable: !0, 21208 writable: !0 21209 }) : obj[key] = value, obj; 21210 } 21211 function _defineProperties(target, props) { 21212 for (var i = 0; i < props.length; i++) { 21213 var descriptor = props[i]; 21214 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 21215 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 21216 } 21217 } 21218 var SimpleHeader = function() { 21219 function SimpleHeader(element) { 21220 var options = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; 21221 !function(instance, Constructor) { 21222 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 21223 }(this, SimpleHeader), this.element = element, this.$element = (0, _jquery.default)(element); 21224 var defaults = {}; 21225 this._defaults = defaults, this.settings = function(target) { 21226 for (var i = 1; i < arguments.length; i++) { 21227 var source = null != arguments[i] ? arguments[i] : {};
21228 i % 2 ? ownKeys(source, !0).forEach(function(key) { 21229 _defineProperty(target, key, source[key]); 21230 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 21231 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 21232 }); 21233 } 21234 return target; 21235 }({}, defaults, {}, options), this.init(); 21236 } 21237 return function(Constructor, protoProps, staticProps) { 21238 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 21239 }(SimpleHeader, [ { 21240 key: "init", 21241 value: function() { 21242 this.alert = this.element.querySelector(".alert"), window.Heifer.shared.foundation.alert && (0, 21243 _alert.default)(this.alert); 21244 } 21245 } ]), SimpleHeader; 21246 }(); 21247 exports.default = SimpleHeader; 21248 }, { 21249 "./../mainHeader/alert/alert": 92, 21250 "core-js/modules/es6.array.iterator": 241, 21251 "core-js/modules/es6.object.keys": 250, 21252 "core-js/modules/es6.object.to-string": 252, 21253 "core-js/modules/es6.symbol": 268, 21254 "core-js/modules/es7.object.get-own-property-descriptors": 272, 21255 "core-js/modules/web.dom.iterable": 274, 21256 jquery: 20 21257 } ], 21258 100: [ function(require, module, exports) { 21259 "use strict"; 21260 Object.defineProperty(exports, "__esModule", { 21261 value: !0 21262 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 21263 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 21264 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.keys"), 21265 require("core-js/modules/es6.promise"), require("core-js/modules/es6.object.to-string"); 21266 var _heifer = require("../../../core/utilities/heifer.utilities"); 21267 function ownKeys(object, enumerableOnly) { 21268 var keys = Object.keys(object); 21269 if (Object.getOwnPropertySymbols) { 21270 var symbols = Object.getOwnPropertySymbols(object); 21271 enumerableOnly && (symbols = symbols.filter(function(sym) { 21272 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 21273 })), keys.push.apply(keys, symbols); 21274 } 21275 return keys; 21276 } 21277 function _defineProperty(obj, key, value) { 21278 return key in obj ? Object.defineProperty(obj, key, { 21279 value: value, 21280 enumerable: !0, 21281 configurable: !0, 21282 writable: !0 21283 }) : obj[key] = value, obj; 21284 } 21285 function _defineProperties(target, props) { 21286 for (var i = 0; i < props.length; i++) { 21287 var descriptor = props[i]; 21288 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 21289 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 21290 } 21291 } 21292 var StickyFooter = function() { 21293 function StickyFooter(element, options) { 21294 !function(instance, Constructor) { 21295 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 21296 }(this, StickyFooter), this.element = element, this.$element = $(element); 21297 this.settings = function(target) { 21298 for (var i = 1; i < arguments.length; i++) { 21299 var source = null != arguments[i] ? arguments[i] : {}; 21300 i % 2 ? ownKeys(source, !0).forEach(function(key) { 21301 _defineProperty(target, key, source[key]); 21302 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 21303 Object.defineProperty(target, key, Ob
21303ject.getOwnPropertyDescriptor(source, key)); 21304 }); 21305 } 21306 return target; 21307 }({}, {}, {}, options), this.stickyClose = this.element.querySelector(".js-sticky-footer-close"), 21308 this.stickyContainer = this.element.querySelector(".js-sticky-footer-container"), 21309 this.mainFooter = document.querySelector(".js-main-footer"), this.scrollPosition = _heifer.uGetScrollPosition, 21310 this.scrollTrigger = requestAnimationFrame(this.handleScroll.bind(this)), this.removeStickyPos = this.getRemoveStickyPos(), 21311 this.init(); 21312 } 21313 return function(Constructor, protoProps, staticProps) { 21314 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 21315 }(StickyFooter, [ { 21316 key: "init", 21317 value: function() { 21318 var _this = this; 21319 requestAnimationFrame(this.handleScroll.bind(this)); 21320 this.setHeight().then(function() { 21321 (0, _heifer.uAddClass)(_this.element, "is-off-canvas"), (0, _heifer.uAddClass)(_this.element, "is-sticky"), 21322 (0, _heifer.uAddClass)(_this.element, "is-visible"); 21323 }), (0, _heifer.uAddEventListener)(this.stickyClose, "click", function(ev) { 21324 (0, _heifer.uSetCookie)("close_sticky_footer"), _this.element.parentNode.removeChild(_this.element); 21325 }), window.addEventListener("resize", function() { 21326 requestAnimationFrame(function() { 21327 _this.reset().then(function() { 21328 _this.removeStickyPos = _this.getRemoveStickyPos(); 21329 }).then(function() { 21330 _this.setHeight().then(function() { 21331 (0, _heifer.uAddClass)(_this.element, "is-off-canvas"), (0, _heifer.uAddClass)(_this.element, "is-sticky"), 21332 (0, _heifer.uAddClass)(_this.element, "is-visible"); 21333 }); 21334 }); 21335 }); 21336 }); 21337 } 21338 }, { 21339 key: "handleScroll", 21340 value: function() { 21341 var _this2 = this, newScrollPos = (0, _heifer.uGetScrollPosition)(); 21342 10 <= newScrollPos && newScrollPos < this.removeStickyPos && ((0, _heifer.uHasClass)(this.element, "is-off-canvas") && requestAnimationFrame(function() { 21343 (0, _heifer.uRemoveClass)(_this2.element, "is-off-canvas"); 21344 }), (0, _heifer.uHasClass)(this.element, "is-sticky") || requestAnimationFrame(function() { 21345 (0, _heifer.uAddClass)(_this2.element, "is-sticky"); 21346 })), newScrollPos >= this.removeStickyPos && (0, _heifer.uHasClass)(this.element, "is-sticky") && requestAnimationFrame(function() { 21347 (0, _heifer.uRemoveClass)(_this2.element, "is-sticky"); 21348 }), this.scrollPosition = newScrollPos; 21349 requestAnimationFrame(this.handleScroll.bind(this)); 21350 } 21351 }, { 21352 key: "setHeight", 21353 value: function() { 21354 var _this3 = this; 21355 return new Promise(function(resolve) { 21356 document.body.style.setProperty("--sticky-footer-height", _this3.element.offsetHeight + "px"), 21357 resolve(!0); 21358 }); 21359 } 21360 }, { 21361 key: "reset", 21362 value: function() { 21363 var _this4 = this; 21364 return new Promise(function(resolve) { 21365 (0, _heifer.uRemoveClass)(_this4.element, "is-visible"), (0, _heifer.uRemoveClass)(_this4.element, "is-sticky"), 21366 (0, _heifer.uRemoveClass)(_this4.element, "is-off-canvas"), resolve(!0); 21367 }); 21368 } 21369 }, { 21370 key: "getRemoveStickyPos", 21371 value: function() { 21372 return (0, _heifer.uGetCoords)(this.element).bottom - window.innerHeight; 21373 } 21374 } ]), StickyFooter; 21375 }(); 21376 exports.default = StickyFooter; 21377 }, {
21378 "../../../core/utilities/heifer.utilities": 19, 21379 "core-js/modules/es6.array.iterator": 241, 21380 "core-js/modules/es6.object.keys": 250, 21381 "core-js/modules/es6.object.to-string": 252, 21382 "core-js/modules/es6.promise": 253, 21383 "core-js/modules/es6.symbol": 268, 21384 "core-js/modules/es7.object.get-own-property-descriptors": 272, 21385 "core-js/modules/web.dom.iterable": 274 21386 } ], 21387 101: [ function(require, module, exports) { 21388 "use strict"; 21389 Object.defineProperty(exports, "__esModule", { 21390 value: !0 21391 }), exports.default = void 0, require("core-js/modules/es6.regexp.replace"); 21392 var _heifer = require("../../core/utilities/heifer.utilities"); 21393 function _defineProperties(target, props) { 21394 for (var i = 0; i < props.length; i++) { 21395 var descriptor = props[i]; 21396 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 21397 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 21398 } 21399 } 21400 var HeiferFoundation = function() { 21401 function HeiferFoundation() { 21402 !function(instance, Constructor) { 21403 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 21404 }(this, HeiferFoundation), this.init(); 21405 } 21406 return function(Constructor, protoProps, staticProps) { 21407 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 21408 }(HeiferFoundation, [ { 21409 key: "init", 21410 value: function() { 21411 var _this = this; 21412 document.addEventListener("foundationReceipt", function(ev) { 21413 _this.sendReceipt(ev.detail.email, ev.detail.amount, ev.detail.full_name, ev.detail.address1, ev.detail.address2, ev.detail.city, ev.detail.state, ev.detail.zip, ev.detail.country); 21414 }); 21415 } 21416 }, { 21417 key: "sendReceipt", 21418 value: function(email, amount, full_name, address1, address2, city, state, zip, country) { 21419 var formData = { 21420 email: email, 21421 amount: amount, 21422 full_name: full_name, 21423 address1: address1, 21424 address2: address2, 21425 city: city, 21426 state: state, 21427 zip: zip, 21428 country: country 21429 }; 21430 (0, _heifer.uAjaxWithResponse)("POST", "/api/foundation/receipt.html", !0, (0, _heifer.uJsonToQueryString)(formData), "application/x-www-form-urlencoded; charset=UTF-8").then(function(response) { 21431 window.location.replace(location.href + "?confirm=true"); 21432 }); 21433 } 21434 } ]), HeiferFoundation; 21435 }(); 21436 exports.default = HeiferFoundation; 21437 }, { 21438 "../../core/utilities/heifer.utilities": 19, 21439 "core-js/modules/es6.regexp.replace": 259 21440 } ], 21441 102: [ function(require, module, exports) { 21442 "use strict"; 21443 Object.defineProperty(exports, "__esModule", { 21444 value: !0 21445 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 21446 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 21447 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 21448 require("core-js/modules/es6.object.keys"); 21449 var obj, _reveal = (obj = require("../../core/ui/reveal.es6")) && obj.__esModule ? obj : { 21450 default: obj 21451 }; 21452 require("../../core/utilities/heifer.utilities"); 21453 function ownKeys(object, enumerableOnly) { 21454 var keys = Object.keys(object); 21455 if (Object.getOwnPropertySymbols) { 21456 var symbols = Object.getOwnPropertySymbols(object); 21457 enumerableOnly && (symbols = symbols.filter(function(sym) { 21458 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 21459 })), keys.push.apply(keys, symbols); 21460 } 21461 return keys; 21462 } 21463 function _defineProperty(obj, key, value) { 21464 return key in obj ? Object.defineProperty(obj, key, { 21465 value: value, 21466 enumerable: !0, 21467 configurable: !0, 21468 writable: !0 21469 }) : obj[key] = value, obj; 21470 } 21471 function _defineProperties(target, props) { 21472 for (var i = 0; i < props.length; i++) { 21473 var descriptor = props[i]; 21474 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 21475 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 21476 } 21477 } 21478 var VideoModal = function() { 21479 function VideoModal(element, options) { 21480 !function(instance, Constructor) { 21481 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 21482 }(this, VideoModal), this.element = element, this.$element = $(element); 21483 var defaults = {}; 21484 this._defaults = defaults, this.settings = function(target) { 21485 for (var i = 1; i < arguments.length; i++) { 21486 var source = null != arguments[i] ? arguments[i] : {};
21487 i % 2 ? ownKeys(source, !0).forEach(function(key) { 21488 _defineProperty(target, key, source[key]); 21489 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 21490 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 21491 }); 21492 } 21493 return target; 21494 }({}, defaults, {}, options), this.init(); 21495 } 21496 return function(Constructor, protoProps, staticProps) { 21497 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 21498 }(VideoModal, [ { 21499 key: "init", 21500 value: function() { 21501 var _this = this, scope = this; 21502 scope.modals = document.querySelectorAll(".js-image-modal-target"); 21503 var triggers = this.element.querySelectorAll(".js-image-modal-trigger"); 21504 new _reveal.default(triggers, { 21505 type: "exclusive", 21506 activeClass: "is-revealed", 21507 visitedClass: "was-revealed" 21508 }), window.addEventListener("keydown", function(event) { 21509 27 == event.which && scope.modals.forEach(function(el) { 21510 el.classList.contains("is-revealed") && el.querySelector(".js-image-modal-close").click(); 21511 }), 9 == event.which && scope.modals.forEach(function(el) { 21512 el.classList.contains("is-revealed") && (document.activeElement.classList.contains("js-image-modal-trigger") || document.activeElement.classList.contains("js-image-modal-close") || _this.element.querySelector(".js-image-modal-trigger").focus()); 21513 }); 21514 }); 21515 } 21516 } ]), VideoModal; 21517 }(); 21518 exports.default = VideoModal; 21519 }, { 21520 "../../core/ui/reveal.es6": 12, 21521 "../../core/utilities/heifer.utilities": 19, 21522 "core-js/modules/es6.array.iterator": 241, 21523 "core-js/modules/es6.object.keys": 250, 21524 "core-js/modules/es6.object.to-string": 252, 21525 "core-js/modules/es6.symbol": 268, 21526 "core-js/modules/es7.object.get-own-property-descriptors": 272, 21527 "core-js/modules/web.dom.iterable": 274 21528 } ], 21529 103: [ function(require, module, exports) { 21530 "use strict"; 21531 Object.defineProperty(exports, "__esModule", { 21532 value: !0 21533 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 21534 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 21535 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 21536 require("core-js/modules/es6.object.keys"); 21537 var obj, _heifer = require("../../../core/utilities/heifer.utilities"), _animateNumber = (obj = require("../../animateNumber/animateNumber")) && obj.__esModule ? obj : { 21538 default: obj 21539 }; 21540 function ownKeys(object, enumerableOnly) { 21541 var keys = Object.keys(object); 21542 if (Object.getOwnPropertySymbols) { 21543 var symbols = Object.getOwnPropertySymbols(object); 21544 enumerableOnly && (symbols = symbols.filter(function(sym) { 21545 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 21546 })), keys.push.apply(keys, symbols); 21547 } 21548 return keys; 21549 } 21550 function _defineProperty(obj, key, value) { 21551 return key in obj ? Object.defineProperty(obj, key, { 21552 value: value, 21553 enumerable: !0, 21554 configurable: !0, 21555 writable: !0 21556 }) : obj[key] = value, obj; 21557 } 21558 function _defineProperties(target, props) { 21559 for (var i = 0; i < props.length; i++) { 21560 var descriptor = props[i]; 21561 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 21562 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 21563 } 21564 } 21565 var AnimatedStat = function() { 21566 function AnimatedStat(element, options) { 21567 !function(instance, Constructor) { 21568 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 21569 }(this, AnimatedStat), this.element = element, this.$element = $(element); 21570 var defaults = {}; 21571 this._defaults = defaults, this.settings = function(target) { 21572 for (var i = 1; i < arguments.length; i++) { 21573 var source = null != arguments[i] ? arguments[i] : {};
21574 i % 2 ? ownKeys(source, !0).forEach(function(key) { 21575 _defineProperty(target, key, source[key]); 21576 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 21577 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 21578 }); 21579 } 21580 return target; 21581 }({}, defaults, {}, options), this.init(); 21582 } 21583 return function(Constructor, protoProps, staticProps) { 21584 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 21585 }(AnimatedStat, [ { 21586 key: "init", 21587 value: function() { 21588 this.scrollPosition = (0, _heifer.uGetScrollPosition)(), this.number = this.element.querySelector(".js-animated-stat-number"), 21589 this.numberStart = this.number.dataset.numStart, this.numberEnd = this.number.dataset.numEnd, 21590 this.hasAnimated = !1, this.hasReset = !1; 21591 requestAnimationFrame(this.handleScroll.bind(this)); 21592 this.resetNum(); 21593 } 21594 }, { 21595 key: "resetNum", 21596 value: function() { 21597 this.number.textContent = this.numberStart; 21598 } 21599 }, { 21600 key: "handleScroll", 21601 value: function() { 21602 var _this = this, newScrollPos = (0, _heifer.uGetScrollPosition)(); 21603 newScrollPos >= (0, _heifer.uGetCoords)(this.element).top - .75 * window.innerHeight && requestAnimationFrame(function() { 21604 _this.hasAnimated || _this.initAnimateNumber(), _this.hasAnimated = !0; 21605 }), this.scrollPosition = newScrollPos; 21606 requestAnimationFrame(this.handleScroll.bind(this)); 21607 } 21608 }, { 21609 key: "initAnimateNumber", 21610 value: function() { 21611 return new _animateNumber.default(this.number, { 21612 startAmount: this.numberStart, 21613 endAmount: this.numberEnd, 21614 duration: 500 21615 }); 21616 } 21617 } ]), AnimatedStat; 21618 }(); 21619 exports.default = AnimatedStat; 21620 }, { 21621 "../../../core/utilities/heifer.utilities": 19, 21622 "../../animateNumber/animateNumber": 64, 21623 "core-js/modules/es6.array.iterator": 241, 21624 "core-js/modules/es6.object.keys": 250, 21625 "core-js/modules/es6.object.to-string": 252, 21626 "core-js/modules/es6.symbol": 268, 21627 "core-js/modules/es7.object.get-own-property-descriptors": 272, 21628 "core-js/modules/web.dom.iterable": 274 21629 } ], 21630 104: [ function(require, module, exports) { 21631 "use strict"; 21632 function _toConsumableArray(arr) { 21633 return function(arr) { 21634 if (Array.isArray(arr)) { 21635 for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; 21636 return arr2; 21637 } 21638 }(arr) || function(iter) { 21639 if (Symbol.iterator in Object(iter) || "[object Arguments]" === Object.prototype.toString.call(iter)) return Array.from(iter); 21640 }(arr) || function() { 21641 throw new TypeError("Invalid attempt to spread non-iterable instance"); 21642 }(); 21643 } 21644 function ownKeys(object, enumerableOnly) { 21645 var keys = Object.keys(object); 21646 if (Object.getOwnPropertySymbols) { 21647 var symbols = Object.getOwnPropertySymbols(object); 21648 enumerableOnly && (symbols = symbols.filter(function(sym) { 21649 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 21650 })), keys.push.apply(keys, symbols); 21651 } 21652 return keys; 21653 } 21654 function _defineProperty(obj, key, value) { 21655 return key in obj ? Object.defineProperty(obj, key, { 21656 value: value, 21657 enumerable: !0, 21658 configurable: !0, 21659 writable: !0 21660 }) : obj[key] = value, obj; 21661 } 21662 function _defineProperties(target, props) { 21663 for (var i = 0; i < props.length; i++) { 21664 var descriptor = props[i]; 21665 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 21666 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 21667 } 21668 } 21669 Object.defineProperty(exports, "__esModule", { 21670 value: !0 21671 }), exports.default = void 0, require("core-js/modules/es6.string.iterator"), require("core-js/modules/es6.array.from"), 21672 require("core-js/modules/es6.regexp.to-string"), require("core-js/modules/es6.date.to-string"), 21673 require("core-js/modules/es7.symbol.async-iterator"), require("core-js/modules/es7.object.get-own-property-descriptors"), 21674 require("core-js/modules/es6.symbol"), require("core-js/modules/es6.object.keys"), 21675 require("core-js/modules/web.dom.iterable"), require("core-js/modules/es6.array.iterator"), 21676 require("core-js/modules/es6.object.to-string"); 21677 var BarChart = function() { 21678 function BarChart(element, options) { 21679 !function(instance, Constructor) { 21680 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 21681 }(this, BarChart), this.element = element, this.$element = $(element); 21682 var defaults = {}; 21683 this._defaults = defaults, this.settings = function(target) { 21684 for (var i = 1; i < arguments.length; i++) { 21685 var source = null != arguments[i] ? arguments[i] : {};
21686 i % 2 ? ownKeys(source, !0).forEach(function(key) { 21687 _defineProperty(target, key, source[key]); 21688 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 21689 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 21690 }); 21691 } 21692 return target; 21693 }({}, defaults, {}, options), this.init(); 21694 } 21695 return function(Constructor, protoProps, staticProps) { 21696 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 21697 }(BarChart, [ { 21698 key: "init", 21699 value: function() { 21700 var _this = this; 21701 this.numbers = [], this.values = this.element.querySelectorAll(".js-bar-chart-value"), 21702 this.bars = this.element.querySelectorAll(".js-bar-chart-bar"), [].forEach.call(this.values, function(value) { 21703 var number = parseFloat(value.dataset.value); 21704 _this.numbers.push(number); 21705 }); 21706 var maxNum = Math.max.apply(Math, _toConsumableArray(this.numbers)); 21707 [].forEach.call(this.bars, function(bar, index) { 21708 if (_this.numbers[index] == maxNum) bar.style.width = "100%"; else { 21709 var percent = _this.numbers[index] / maxNum * 100; 21710 percent = Math.round(percent), bar.style.width = percent + "%"; 21711 } 21712 }); 21713 } 21714 } ]), BarChart; 21715 }(); 21716 exports.default = BarChart; 21717 }, { 21718 "core-js/modules/es6.array.from": 240, 21719 "core-js/modules/es6.array.iterator": 241, 21720 "core-js/modules/es6.date.to-string": 243, 21721 "core-js/modules/es6.object.keys": 250, 21722 "core-js/modules/es6.object.to-string": 252, 21723 "core-js/modules/es6.regexp.to-string": 262, 21724 "core-js/modules/es6.string.iterator": 265, 21725 "core-js/modules/es6.symbol": 268, 21726 "core-js/modules/es7.object.get-own-property-descriptors": 272, 21727 "core-js/modules/es7.symbol.async-iterator": 273, 21728 "core-js/modules/web.dom.iterable": 274 21729 } ], 21730 105: [ function(require, module, exports) { 21731 "use strict"; 21732 Object.defineProperty(exports, "__esModule", { 21733 value: !0 21734 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 21735 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 21736 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 21737 require("core-js/modules/es6.object.keys"); 21738 var obj, _reveal = (obj = require("../../../core/ui/reveal.es6")) && obj.__esModule ? obj : { 21739 default: obj 21740 }; 21741 function ownKeys(object, enumerableOnly) { 21742 var keys = Object.keys(object); 21743 if (Object.getOwnPropertySymbols) { 21744 var symbols = Object.getOwnPropertySymbols(object); 21745 enumerableOnly && (symbols = symbols.filter(function(sym) { 21746 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 21747 })), keys.push.apply(keys, symbols); 21748 } 21749 return keys; 21750 } 21751 function _defineProperty(obj, key, value) { 21752 return key in obj ? Object.defineProperty(obj, key, { 21753 value: value, 21754 enumerable: !0, 21755 configurable: !0, 21756 writable: !0 21757 }) : obj[key] = value, obj; 21758 } 21759 function _defineProperties(target, props) { 21760 for (var i = 0; i < props.length; i++) { 21761 var descriptor = props[i]; 21762 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 21763 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 21764 } 21765 } 21766 var CardBlock = function() { 21767 function CardBlock(element, options) { 21768 !function(instance, Constructor) { 21769 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 21770 }(this, CardBlock), this.element = element, this.$element = $(this.element), this._defaults = {}, 21771 this.settings = function(target) { 21772 for (var i = 1; i < arguments.length; i++) { 21773 var source = null != arguments[i] ? arguments[i] : {};
21774 i % 2 ? ownKeys(source, !0).forEach(function(key) { 21775 _defineProperty(target, key, source[key]); 21776 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 21777 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 21778 }); 21779 } 21780 return target; 21781 }({}, this._defaults, {}, options), this.init(); 21782 } 21783 return function(Constructor, protoProps, staticProps) { 21784 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 21785 }(CardBlock, [ { 21786 key: "init", 21787 value: function() { 21788 var _this = this; 21789 this.cardReveal = this.element.querySelector(".js-card-block-reveal"), this.isImageCard = "image" == this.element.dataset.cardType, 21790 this.BigScreen = window.matchMedia("(min-width: 766px)"), new _reveal.default(this.cardReveal, { 21791 type: "exclusive", 21792 trigger: "hover", 21793 activeClass: "is-hovering", 21794 visitedClass: "was-hovering", 21795 returns: !0, 21796 onShow: function() { 21797 _this.BigScreen.matches && _this.isImageCard && "snack" == _this.element.dataset.cardSize && _this.showDescription(); 21798 }, 21799 onHide: function() { 21800 _this.BigScreen.matches && _this.isImageCard && "snack" == _this.element.dataset.cardSize && _this.hideDescription(); 21801 } 21802 }), this.isImageCard && "snack" == this.element.dataset.cardSize && (this.BigScreen.matches && this.initImageCard(this.element), 21803 window.addEventListener("resize", function() { 21804 requestAnimationFrame(function() { 21805 _this.BigScreen.matches ? (_this.unsetImageCard(), _this.initImageCard(_this.element)) : _this.unsetImageCard(); 21806 }); 21807 })); 21808 } 21809 }, { 21810 key: "initImageCard", 21811 value: function(card) { 21812 var cardBox = card.getBoundingClientRect(), headerHeight = card.querySelector(".js-card-image-block-header").getBoundingClientRect().height, copyWrapper = card.querySelector(".js-card-image-block-copy"), copyWrapperHeight = copyWrapper.getBoundingClientRect().height; 21813 card.style.height = cardBox.height + "px", card.dataset.copyHeight = copyWrapperHeight, 21814 card.dataset.headerHeight = headerHeight, copyWrapper.style.height = headerHeight + "px"; 21815 } 21816 }, { 21817 key: "showDescription", 21818 value: function() { 21819 this.element.querySelector(".js-card-image-block-copy").style.height = this.element.dataset.copyHeight + "px"; 21820 } 21821 }, { 21822 key: "hideDescription", 21823 value: function() { 21824 this.element.querySelector(".js-card-image-block-copy").style.height = this.element.dataset.headerHeight + "px"; 21825 } 21826 }, { 21827 key: "unsetImageCard", 21828 value: function() { 21829 this.element.querySelector(".js-card-image-block-copy").removeAttribute("style"), 21830 this.element.removeAttribute("style"); 21831 } 21832 } ]), CardBlock; 21833 }(); 21834 exports.default = CardBlock; 21835 }, { 21836 "../../../core/ui/reveal.es6": 12, 21837 "core-js/modules/es6.array.iterator": 241, 21838 "core-js/modules/es6.object.keys": 250, 21839 "core-js/modules/es6.object.to-string": 252, 21840 "core-js/modules/es6.symbol": 268, 21841 "core-js/modules/es7.object.get-own-property-descriptors": 272, 21842 "core-js/modules/web.dom.iterable": 274 21843 } ],
21844 106: [ function(require, module, exports) { 21845 "use strict"; 21846 Object.defineProperty(exports, "__esModule", { 21847 value: !0 21848 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 21849 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 21850 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 21851 require("core-js/modules/es6.object.keys"); 21852 var _jquery = _interopRequireDefault(require("jquery")), _heifer = _interopRequireDefault(require("../../../core/ui/heifer.carousel")); 21853 function _interopRequireDefault(obj) { 21854 return obj && obj.__esModule ? obj : { 21855 default: obj 21856 }; 21857 } 21858 function ownKeys(object, enumerableOnly) { 21859 var keys = Object.keys(object); 21860 if (Object.getOwnPropertySymbols) { 21861 var symbols = Object.getOwnPropertySymbols(object); 21862 enumerableOnly && (symbols = symbols.filter(function(sym) { 21863 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 21864 })), keys.push.apply(keys, symbols); 21865 } 21866 return keys; 21867 } 21868 function _defineProperty(obj, key, value) { 21869 return key in obj ? Object.defineProperty(obj, key, { 21870 value: value, 21871 enumerable: !0, 21872 configurable: !0, 21873 writable: !0 21874 }) : obj[key] = value, obj; 21875 } 21876 function _defineProperties(target, props) { 21877 for (var i = 0; i < props.length; i++) { 21878 var descriptor = props[i]; 21879 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 21880 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 21881 } 21882 } 21883 var CardBlockSlider = function() { 21884 function CardBlockSlider(element, options) { 21885 !function(instance, Constructor) { 21886 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 21887 }(this, CardBlockSlider), this.element = element, this.$element = (0, _jquery.default)(this.element), 21888 this._defaults = {}, this.settings = function(target) { 21889 for (var i = 1; i < arguments.length; i++) { 21890 var source = null != arguments[i] ? arguments[i] : {}; 21891 i % 2 ? ownKeys(source, !0).forEach(function(key) { 21892 _defineProperty(target, key, source[key]); 21893 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 21894 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 21895 }); 21896 } 21897 return target; 21898 }({}, this._defaults, {}, options), this.init(); 21899 } 21900 return function(Constructor, protoProps, staticProps) { 21901 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 21902 }(CardBlockSlider, [ { 21903 key: "init", 21904 value: function() { 21905 this.carousel = new _heifer.default(this.element, { 21906 visibleSlides: { 21907 0: 1, 21908 480: 1, 21909 768: 3 21910 }, 21911 loop: !1 21912 }); 21913 } 21914 } ]), CardBlockSlider; 21915 }(); 21916 exports.default = CardBlockSlider; 21917 }, { 21918 "../../../core/ui/heifer.carousel": 7, 21919 "core-js/modules/es6.array.iterator": 241, 21920 "core-js/modules/es6.object.keys": 250, 21921 "core-js/modules/es6.object.to-string": 252, 21922 "core-js/modules/es6.symbol": 268, 21923 "core-js/modules/es7.object.get-own-property-descriptors": 272, 21924 "core-js/modules/web.dom.iterable": 274, 21925 jquery: 20 21926 } ],
21927 107: [ function(require, module, exports) { 21928 "use strict"; 21929 Object.defineProperty(exports, "__esModule", { 21930 value: !0 21931 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 21932 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 21933 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 21934 require("core-js/modules/es6.object.keys"); 21935 var _jquery = _interopRequireDefault(require("jquery")), _heifer = _interopRequireDefault(require("./../../../core/ui/heifer.carousel")); 21936 function _interopRequireDefault(obj) { 21937 return obj && obj.__esModule ? obj : { 21938 default: obj 21939 }; 21940 } 21941 function ownKeys(object, enumerableOnly) { 21942 var keys = Object.keys(object); 21943 if (Object.getOwnPropertySymbols) { 21944 var symbols = Object.getOwnPropertySymbols(object); 21945 enumerableOnly && (symbols = symbols.filter(function(sym) { 21946 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 21947 })), keys.push.apply(keys, symbols); 21948 } 21949 return keys; 21950 } 21951 function _defineProperty(obj, key, value) { 21952 return key in obj ? Object.defineProperty(obj, key, { 21953 value: value, 21954 enumerable: !0, 21955 configurable: !0, 21956 writable: !0 21957 }) : obj[key] = value, obj; 21958 } 21959 function _defineProperties(target, props) { 21960 for (var i = 0; i < props.length; i++) { 21961 var descriptor = props[i]; 21962 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 21963 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 21964 } 21965 } 21966 var Carousel = function() { 21967 function Carousel(element, options) { 21968 !function(instance, Constructor) { 21969 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 21970 }(this, Carousel), this.element = element, this.$element = (0, _jquery.default)(this.element), 21971 this._defaults = {}, this.settings = function(target) { 21972 for (var i = 1; i < arguments.length; i++) { 21973 var source = null != arguments[i] ? arguments[i] : {}; 21974 i % 2 ? ownKeys(source, !0).forEach(function(key) { 21975 _defineProperty(target, key, source[key]); 21976 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 21977 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 21978 }); 21979 } 21980 return target; 21981 }({}, this._defaults, {}, options), this.init(); 21982 } 21983 return function(Constructor, protoProps, staticProps) { 21984 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 21985 }(Carousel, [ { 21986 key: "init", 21987 value: function() { 21988 this.carousel = new _heifer.default(this.element, { 21989 visibleSlides: { 21990 0: 1 21991 } 21992 }); 21993 } 21994 } ]), Carousel; 21995 }(); 21996 exports.default = Carousel; 21997 }, { 21998 "./../../../core/ui/heifer.carousel": 7, 21999 "core-js/modules/es6.array.iterator": 241, 22000 "core-js/modules/es6.object.keys": 250, 22001 "core-js/modules/es6.object.to-string": 252, 22002 "core-js/modules/es6.symbol": 268, 22003 "core-js/modules/es7.object.get-own-property-descriptors": 272, 22004 "core-js/modules/web.dom.iterable": 274, 22005 jquery: 20 22006 } ],
22007 108: [ function(require, module, exports) { 22008 "use strict"; 22009 Object.defineProperty(exports, "__esModule", { 22010 value: !0 22011 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 22012 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 22013 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 22014 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.regexp.replace"); 22015 var obj, _heifer = require("../../../core/utilities/heifer.utilities"), _submitButton = (obj = require("../../../shared/forms/submitButton/submitButton")) && obj.__esModule ? obj : { 22016 default: obj 22017 }; 22018 function ownKeys(object, enumerableOnly) { 22019 var keys = Object.keys(object); 22020 if (Object.getOwnPropertySymbols) { 22021 var symbols = Object.getOwnPropertySymbols(object); 22022 enumerableOnly && (symbols = symbols.filter(function(sym) { 22023 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 22024 })), keys.push.apply(keys, symbols); 22025 } 22026 return keys; 22027 } 22028 function _defineProperty(obj, key, value) { 22029 return key in obj ? Object.defineProperty(obj, key, { 22030 value: value, 22031 enumerable: !0, 22032 configurable: !0, 22033 writable: !0 22034 }) : obj[key] = value, obj; 22035 } 22036 function _defineProperties(target, props) { 22037 for (var i = 0; i < props.length; i++) { 22038 var descriptor = props[i]; 22039 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 22040 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 22041 } 22042 } 22043 var Contact = function() { 22044 function Contact(element, options) { 22045 !function(instance, Constructor) { 22046 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 22047 }(this, Contact), this.element = element; 22048 var defaults = {}; 22049 this._defaults = defaults, this.settings = function(target) { 22050 for (var i = 1; i < arguments.length; i++) { 22051 var source = null != arguments[i] ? arguments[i] : {}; 22052 i % 2 ? ownKeys(source, !0).forEach(function(key) { 22053 _defineProperty(target, key, source[key]); 22054 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 22055 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 22056 }); 22057 } 22058 return target; 22059 }({}, defaults, {}, options), this.init(); 22060 } 22061 return function(Constructor, protoProps, staticProps) { 22062 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 22063 }(Contact, [ { 22064 key: "init", 22065 value: function() { 22066 this.formElement = this.element.querySelector("form"), this.submitUI = new _submitButton.default(this.formElement.querySelector("button")), 22067 this.formElement.addEventListener("submit", this.handleSubmit.bind(this)); 22068 var successDiv = document.createElement("div"); 22069 successDiv.innerHTML = "<p class='contact__has-success'>Success! Your email has been sent.</p>", 22070 this.successMessage = successDiv; 22071 var errorDiv = document.createElement("div"); 22072 errorDiv.innerHTML = "<p class='contact__has-error'>Error! There was an error sending your message. Please try again later.</p>", 22073 this.errorMessage = errorDiv; 22074 } 22075 }, { 22076 key: "handleSubmit", 22077 value: function(event) { 22078 var _this = this; 22079 event.preventDefault(); 22080 var fullName = this.formElement.querySelector('input[name="fullName"]').value, phone = this.formElement.querySelector('input[name="phone"]') ? this.formElement.querySelector('input[name="phone"]').value : "Excluded", email = this.formElement.querySelector('input[name="email"]').value, partnerFormAffiliationField = this.formElement.querySelector('input[name="affiliation"]') ? this.formElement.querySelector('input[name="affiliation"]').value : "Excluded", formData = { 22081 fullName: fullName, 22082 phone: phone, 22083 companyName: this.formElement.querySelector('input[name="companyName"]') ? this.formElement.querySelector('input[name="companyName"]').value : "Excluded", 22084 companyWebsite: this.formElement.querySelector('input[name="companyWebsite"]') ? this.formElement.querySelector('input[name="companyWebsite"]').value : "Excluded", 22085 partnersLandingOptions: this.formElement.querySelector('select[name="interestTypePartnershipLanding"]') ? this.formElement.querySelector('select[name="interestTypePartnershipLanding"]').value : "Excluded", 22086 companiesOptions: this.formElement.querySelector('select[name="interestTypeCompanies"]') ? this.formElement.querySelector('select[name="interestTypeCompanies"]').value : "Excluded", 22087 partnerFormAffiliationField: partnerFormAffiliationField, 22088 email: email, 22089 emailTo: this.formElement.querySelector('input[name="emailTo"]').value, 22090 emailToNonce: this.formElement.querySelector('input[name="emailToNonce"]').value, 22091 formSource: this.formElement.querySelector('input[name="formSource"]').value, 22092 formSourceNonce: this.formElement.querySelector('input[name="formSourceNonce"]').value, 22093 message: this.formElement.querySelector('textarea[name="message"]').value.replace(/['|"|&]+/g, "") 22094 }; 22095 (0, _heifer.uAjaxWithResponse)("POST", "/api/contact.html", !1, (0, _heifer.uJsonToQueryString)(formData), "application/x-www-form-urlencoded; charset=UTF-8").then(function(response) { 22096 if (_this.submitUI.reset(), 0 == JSON.parse(response).errors.length) { 22097 _this.formElement.appendChild(_this.successMessage); 22098 var partnerContectFormWrapper = document.getElementById("partnerContect__form-wrapper"); 22099 partnerContectFormWrapper && (partnerContectFormWrapper.innerHTML = '<div style="display: flex; flex-flow: column; align-items: center; justify-content: center; background-color: #FFF; padding-top: 50px; padding-bottom: 100px;" class="heroBlock__wysiwyg "><svg style="height: 50px;" class="label__validation-icon--success partnerForm-success" aria-hidden="true""><use xlink:href="#check"></use></svg><p style="color: #000" class="styles__h2">Thank You!</p><p style="color: #000">A member of our partnerships team will be in touch with you soon.</p></div></div></div>', 22100 successMessage = partnerContectFormWrapper), _this.submitUI.element && _this.submitUI.element.setAttribute("disabled", ""); 22101 } else _this.formElement.appendChild(_this.errorMessage), _this.submitUI.element && _this.submitUI.element.setAttribute("disabled", ""); 22102 }); 22103 } 22104 } ]), Contact; 22105 }(); 22106 exports.default = Contact; 22107 }, {
22108 "../../../core/utilities/heifer.utilities": 19, 22109 "../../../shared/forms/submitButton/submitButton": 88, 22110 "core-js/modules/es6.array.iterator": 241, 22111 "core-js/modules/es6.object.keys": 250, 22112 "core-js/modules/es6.object.to-string": 252, 22113 "core-js/modules/es6.regexp.replace": 259, 22114 "core-js/modules/es6.symbol": 268, 22115 "core-js/modules/es7.object.get-own-property-descriptors": 272, 22116 "core-js/modules/web.dom.iterable": 274 22117 } ], 22118 109: [ function(require, module, exports) { 22119 "use strict"; 22120 Object.defineProperty(exports, "__esModule", { 22121 value: !0 22122 }), exports.default = void 0, require("core-js/modules/es7.symbol.async-iterator"), 22123 require("core-js/modules/es7.object.get-own-property-descriptors"), require("core-js/modules/es6.symbol"), 22124 require("core-js/modules/web.dom.iterable"), require("core-js/modules/es6.array.iterator"), 22125 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.string.iterator"), 22126 require("core-js/modules/es6.array.from"), require("core-js/modules/es6.function.name"), 22127 require("core-js/modules/es6.regexp.replace"), require("core-js/modules/es6.promise"), 22128 require("core-js/modules/es6.object.to-string"); 22129 var _jquery = _interopRequireDefault(require("jquery")), _tabs = _interopRequireDefault(require("./../../../../../shared/tabs/tabs")), _paymentFields = _interopRequireDefault(require("./../../../../forms/paymentFields/paymentFields")), _heifer = require("./../../../../../core/utilities/heifer.utilities"), _checkout = require("./../../../../../core/utilities/checkout.utilities"), _submitButton = _interopRequireDefault(require("./../../../../forms/submitButton/submitButton")); 22130 _interopRequireDefault(require("formdata-polyfill")); 22131 function _interopRequireDefault(obj) { 22132 return obj && obj.__esModule ? obj : { 22133 default: obj 22134 }; 22135 } 22136 function _typeof(obj) { 22137 return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { 22138 return typeof obj; 22139 } : function(obj) { 22140 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 22141 })(obj); 22142 } 22143 function ownKeys(object, enumerableOnly) { 22144 var keys = Object.keys(object); 22145 if (Object.getOwnPropertySymbols) { 22146 var symbols = Object.getOwnPropertySymbols(object); 22147 enumerableOnly && (symbols = symbols.filter(function(sym) { 22148 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 22149 })), keys.push.apply(keys, symbols); 22150 } 22151 return keys; 22152 } 22153 function _objectSpread(target) { 22154 for (var i = 1; i < arguments.length; i++) { 22155 var source = null != arguments[i] ? arguments[i] : {}; 22156 i % 2 ? ownKeys(source, !0).forEach(function(key) { 22157 _defineProperty(target, key, source[key]); 22158 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 22159 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 22160 }); 22161 } 22162 return target; 22163 } 22164 function _defineProperty(obj, key, value) { 22165 return key in obj ? Object.defineProperty(obj, key, { 22166 value: value, 22167 enumerable: !0, 22168 configurable: !0, 22169 writable: !0 22170 }) : obj[key] = value, obj; 22171 } 22172 function _classCallCheck(instance, Constructor) { 22173 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 22174 } 22175 function _defineProperties(target, props) { 22176 for (var i = 0; i < props.length; i++) { 22177 var descriptor = props[i]; 22178 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 22179 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 22180 } 22181 } 22182 function _createClass(Constructor, protoProps, staticProps) { 22183 return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), 22184 Constructor; 22185 } 22186 var DonationCard = function() { 22187 function DonationCard(element, options) { 22188 _classCallCheck(this, DonationCard), this.element = element, this.$element = (0, 22189 _jquery.default)(element); 22190 var defaults = { 22191 tabsSelector: ".js-donationCard__tabs", 22192 amountsSelector: ".js-donationCard__amounts", 22193 donationAmountFields: "input, select, textarea", 22194 donationAmountSelector: ".js-donationCard__amount-input", 22195 stepSelector: ".js-donationCard__step", 22196 activeClass: "is-active", 22197 pastClass: "is-past", 22198 startingStep: "amount", 22199 progressListSelector: ".js-donationAltCard__nav", 22200 totalDonationNumberSelector: ".js-donationCard__total-number", 22201 totalDonationNumberSelectorBlackbaud: ".js-donationCard__total-number-blackbaud", 22202 processingFeeNumberSelector: ".js-donationCard__processing-fee-number", 22203 processingFeeInputSelector: ".js-donationCard__processing-fee-input", 22204 coverProcessingFeeInputSelector: ".js-donationCard__cover-processing-fee-input", 22205 donationMonthlyInput: ".js-donationCard__product-monthly", 22206 submitButtonSelector: ".js-button-submit", 22207 errorFieldSelector: ".js-donation-errors", 22208 donationAmountMessage: ".js-donationCard__amount-message", 22209 donationButtonOther: ".js-buttonPricingAlt__other" 22210 }; 22211 this._defaults = defaults, this.settings = _objectSpread({}, defaults, {}, options), 22212 this.total = this.element.querySelector(this.settings.totalDonationNumberSelector), 22213 this.totalBlackbaud = this.element.querySelector(this.settings.totalDonationNumberSelectorBlackbaud), 22214 this.processingFee = this.element.querySelector(this.settings.processingFeeNumberSelector), 22215 this.processingFeeInput = this.element.querySelector(this.settings.processingFeeInputSelector), 22216 this.coverProcessingFeeInput = this.element.querySelector(this.settings.coverProcessingFeeInputSelector), 22217 this.submitButton = new _submitButton.default(this.element.querySelector(this.settings.submitButtonSelector)), 22218 this.progressBar = this.element.querySelector(this.settings.progressListSelector),
22219 this.nav = this.getNav(), this.steps = this.getSteps(), this.stepsContainer = this.element.querySelector(".js-donationCard-step-container"), 22220 this.currentStep = this.settings.startingStep, this.isTabbed = this.getTabs(), this.isStepped = this.element.dataset.isStepped, 22221 this.isSubscription = this.element.dataset.isSubscription || !1, this.errorField = this.element.querySelector(this.settings.errorFieldSelector), 22222 this.summary = this.element.querySelector(".js-donationAlt-summary"), this.summaryTemplate = this.element.querySelector("#js-donationAlt-summary-template"), 22223 this.giveInHonor = !1, this.recaptchaMessage = this.element.querySelector(".js-recaptcha-message"), 22224 this.isTabbed && (this.tabs = this.initTabs(), this.updateWysiwyg()), this.events = { 22225 step: (0, _heifer.uCreateCustomEvent)("heifer/donation/step") 22226 }, this.donationAmount = this.getSelectedAmount(), this.isMonthly = !1, this.paymentFields = !1, 22227 "false" != this.isStepped && !this.summary || this.checkPaymentFields(), this.summary || this.doBlackbaudButtonRevealLogic(), 22228 this.preCheckFee(), this.updateSummaryTotals(), this.bindEvents(), this.updateDonationOtherMessage(), 22229 this.updateButtonStates(), this.updateContinueButtons(); 22230 } 22231 return _createClass(DonationCard, [ { 22232 key: "getSteps", 22233 value: function() { 22234 var _this = this; 22235 return [].reduce.call(this.element.querySelectorAll(this.settings.stepSelector), function(prev, step) { 22236 return prev[step.getAttribute("data-donation-step")] = new DonationCardStep(step, _this.goToStep.bind(_this), _this.showSummary.bind(_this)), 22237 prev; 22238 }, {}); 22239 } 22240 }, { 22241 key: "getNav", 22242 value: function() { 22243 var _this2 = this; 22244 return this.progressBar ? [].reduce.call(this.progressBar.querySelectorAll(".js-donationCard__nav-button"), function(prev, step) { 22245 return prev[step.getAttribute("data-donation-step")] = new DonationCardNav(step, _this2.progressBar, _this2.goToStep.bind(_this2), _this2.bindEditButtons.bind(_this2)), 22246 prev; 22247 }, {}) : void 0; 22248 } 22249 }, { 22250 key: "checkPaymentFields", 22251 value: function() { 22252 this.paymentFields = this.initPaymentFields(); 22253 } 22254 }, { 22255 key: "amountIsSelected", 22256 value: function() { 22257 return !!this.getSelectedAmount(); 22258 } 22259 }, { 22260 key: "getSelectedAmount", 22261 value: function() { 22262 var valid = [].filter.call(this.element.querySelectorAll(this.settings.donationAmountSelector), function(field) { 22263 return field.checkValidity() && !field.disabled && ("checkbox" === field.type || "radio" === field.type ? field.checked : "" !== field.value); 22264 }); 22265 return valid.length ? valid[0].value : 0; 22266 } 22267 }, { 22268 key: "updateSummaryTotals", 22269 value: function() { 22270 (0, _checkout.updateTotals)(this.element, this.total, this.processingFee, this.processingFeeInput, !0, this.coverProcessingFee()); 22271 var total = this.total.innerHTML.trim(); 22272 this.totalBlackbaud.innerHTML = total, this.summary && this.updateStepSummaries("amount", { 22273 copy: this.shapeAmountSummaryCopy(total) 22274 }); 22275 } 22276 }, { 22277 key: "preCheckFee", 22278 value: function() { 22279 this.selected = this.getSelectedAmount(), this.selected <= 500 && 0 == this.getIsMonthly() ? this.coverProcessingFeeInput.checked = !0 : this.coverProcessingFeeInput.checked = !1; 22280 } 22281 }, { 22282 key: "coverProcessingFee", 22283 value: function() { 22284 var coverProcessingFee = !1; 22285 return coverProcessingFee = "checkbox" == this.coverProcessingFeeInput.getAttribute("type") ? this.coverProcessingFeeInput.checked : !(!this.coverProcessingFeeInput.value || "0" == this.coverProcessingFeeInput.value), 22286 coverProcessingFee; 22287 } 22288 }, { 22289 key: "shapeAmountSummaryCopy", 22290 value: function(total) { 22291 var summaryCopy = "$" + total + (this.getIsMonthly() ? "/Month" : ""); 22292 this.coverProcessingFee() && (summaryCopy = "$" + total + '<span class="hierarchy__minion-text tw-block">includes $' + parseFloat(this.processingFee.textContent).toFixed(2) + " to cover payment processing costs.</span>"); 22293 return summaryCopy; 22294 } 22295 }, { 22296 key: "updateAmountSummaryCopy", 22297 value: function() { 22298 if (this.summary.querySelector('[data-step="amount"]')) { 22299 var copy = this.summary.querySelector('[data-step="amount"]').querySelector(".donationAltSummary__info-copy"), markup = this.shapeAmountSummaryCopy(this.total.innerHTML.trim()); 22300 copy.innerHTML = markup, this.steps.amount.summaryContent.copy = markup; 22301 } 22302 } 22303 }, { 22304 key: "goToStep", 22305 value: function(step, argument_1) { 22306 var isEdit = 1 < arguments.length && void 0 !== argument_1 && argument_1; 22307 if (this.steps[step].element.dataset.validate ? this.steps[step].checkFieldValidity() ? this.steps[this.currentStep].enableContinue() : this.steps[this.currentStep].disableContinue() : this.steps[step].enableContinue(), 22308 "payment" == step && this.summary) { 22309 var todaysPayment = this.element.querySelector(".js-donationAlt-todays-payment"); 22310 todaysPayment && (this.getIsMonthly() ? todaysPayment.dataset.monthly = "true" : todaysPayment.dataset.monthly = "false"); 22311 } 22312 if ("billing" == step && this.summary) { 22313 var billingRadios = this.element.querySelector(".js-donation-alt-billing-radios"); 22314 billingRadios && (this.getIsMonthly() ? (0, _heifer.uAddClass)(billingRadios, "is-hidden") : (0, 22315 _heifer.uRemoveClass)(billingRadios, "is-hidden")); 22316 } 22317 this.summary ? this.currentStep && (this.hideStep(this.currentStep), this.nav && this.hideNav(this.currentStep)) : "billing-and-payment" == step && this.checkPaymentFields(), 22318 this.showStep(step), this.summary && this.nav && (isEdit && (this.resetNav(this.currentStep), 22319 "payment" == this.currentStep && "amount" == step && this.resetNav("billing")), 22320 this.showNav(step)), this.currentStep = step, (0, _heifer.uScrollTo)(this.element, -20); 22321 } 22322 }, { 22323 key: "hideStep", 22324 value: function(step) { 22325 this.steps.hasOwnProperty(step) && ((0, _heifer.uAddClass)(this.steps[step].element, this.settings.pastClass), 22326 (0, _heifer.uRemoveClass)(this.steps[step].element, this.settings.activeClass)); 22327 } 22328 }, { 22329 key: "showStep", 22330 value: function(step) { 22331 this.steps.hasOwnProperty(step) && ((0, _heifer.uAddClass)(this.steps[step].element, this.settings.activeClass), 22332 (0, _heifer.uRemoveClass)(this.steps[step].element, this.settings.pastClass)), this.recaptchaMessage && ("amount" != step ? this.recaptchaMessage.classList.remove("tw-hidden") : this.recaptchaMessage.classList.add("tw-hidden")); 22333 } 22334 }, { 22335 key: "updateStepSummaries", 22336 value: function(stepName, summary) { 22337 var _this3 = this; 22338 return new Promise(function(resolve) { 22339 _this3.steps && null != _this3.steps[stepName] && (_this3.steps[stepName].summaryContent = _objectSpread({}, _this3.steps[stepName].summaryContent, {}, summary)), 22340 resolve(_this3.steps[stepName].summaryContent); 22341 }); 22342 } 22343 }, { 22344 key: "buildStepSummaries", 22345 value: function(step, summary) { 22346 var _this4 = this; 22347 return new Promise(function(resolve) { 22348 if ("object" != _typeof(summary) && (summary = JSON.parse(summary)), "payment-options" != _this4.currentStep) { 22349 var summaryMarkup = _this4.summaryTemplate.innerHTML.replace(/{{ heading }}/g, summary.heading).replace(/{{ copy }}/g, summary.copy).replace(/{{ step }}/g, step); 22350 _this4.summary.insertAdjacentHTML("beforeend", summaryMarkup); 22351 } 22352 _this4.buildSummaryEdit(step, summary), resolve(!0); 22353 }); 22354 } 22355 }, { 22356 key: "buildSummaryEdit", 22357 value: function(step, summary) { 22358 var id = "#donation-alt-summary-" + step, selectedSummary = this.summary.querySelector(id); 22359 if (selectedSummary) { 22360 var editButton = selectedSummary.querySelector(".js-donationAlt-summary-edit"); 22361 editButton && (summary.edit ? ((0, _heifer.uAddClass)(editButton, this.settings.activeClass), 22362 (0, _heifer.uRemoveClass)(editButton, this.settings.pastClass)) : ((0, _heifer.uAddClass)(editButton, this.settings.pastClass), 22363 (0, _heifer.uRemoveClass)(editButton, this.settings.activeClass))); 22364 } 22365 } 22366 }, { 22367 key: "showSummary", 22368 value: function(step, selector) { 22369 var _this5 = this; 22370 this.summary && ("billing" == step ? this.updateStepSummaries("billing", { 22371 copy: this.formatBillingInfo() 22372 }).then(function(summary) { 22373 _this5.buildStepSummaries(step, summary).then(function() { 22374 _this5.setSummaryListeners(step, selector); 22375 }); 22376 }) : (this.buildStepSummaries(step, this.steps[step].summaryContent).then(function() { 22377 _this5.setSummaryListeners(step, selector); 22378 }), this.giveInHonor && this.buildStepSummaries("give-in-honor", this.steps["give-in-honor"].summaryContent).then(function() {}))); 22379 } 22380 }, { 22381 key: "setSummaryListeners", 22382 value: function(step, selector) { 22383 var editButtons, _this6 = this; 22384 editButtons = this.summary.querySelectorAll(selector), [].forEach.call(editButtons, function(button) { 22385 button.removeEventListener("click", function(ev) { 22386 _this6.bindEditButtons(button, step); 22387 }), button.addEventListener("click", function(ev) { 22388 _this6.bindEditButtons(button, step); 22389 }); 22390 }); 22391 } 22392 }, { 22393 key: "bindEditButtons", 22394 value: function(editButton, step) { 22395 this.resetSummary(editButton, step), this.goToStep(editButton.dataset.step, !0); 22396 } 22397 }, { 22398 key: "resetSummary", 22399 value: function(editButton, step) { 22400 if (this.summary) if (this.updateSummaryTotals(), "amount" == step) { 22401 var summaries = this.summary.querySelectorAll(".js-donationAlt-summary-container"); 22402 summaries && [].forEach.call(summaries, function(selectedSummary) { 22403 selectedSummary.remove(); 22404 }); 22405 } else { 22406 var id = "donation-alt-summary-" + step, selectedSummary = document.getElementById(id); 22407 selectedSummary && selectedSummary.parentElement.removeChild(selectedSummary); 22408 } 22409 } 22410 }, { 22411 key: "formatBillingInfo", 22412 value: function() { 22413 var formData = new window.FormData(this.element), billingInfo_firstName = formData.get("firstName"), billingInfo_lastName = formData.get("lastName"), billingInfo_email = formData.get("email"), billingInfo_address1 = (formData.get("phone"), 22414 formData.get("address1")), billingInfo_address2 = formData.get("address2"), billingInfo_city = formData.get("city"), billingInfo_state = formData.get("state"), billingInfo_zip = formData.get("zip"), formattedBilling = (formData.get("country"), 22415 billingInfo_firstName + " " + billingInfo_lastName + "<br>"); 22416 return formattedBilling += billingInfo_email + "<br>", formattedBilling += billingInfo_address1 + ", ", 22417 "" != billingInfo_address2 && billingInfo_address2 && (formattedBilling += billingInfo_address2 + ", "), 22418 formattedBilling += billingInfo_city + ", " + billingInfo_state + " " + billingInfo_zip; 22419 } 22420 }, { 22421 key: "showNav", 22422 value: function(step) { 22423 this.nav.hasOwnProperty(step) && ((0, _heifer.uAddClass)(this.nav[step].element, this.settings.activeClass), 22424 (0, _heifer.uRemoveClass)(this.nav[step].element, this.settings.pastClass), this.updateNavTitle(this.nav[step].element.dataset.stepTitle)); 22425 } 22426 }, { 22427 key: "updateNavTitle", 22428 value: function(string) { 22429 document.querySelector(".js-donationAltCard__nav-title").innerHTML = string; 22430 } 22431 }, { 22432 key: "hideNav", 22433 value: function(step) { 22434 this.nav.hasOwnProperty(step) && ((0, _heifer.uAddClass)(this.nav[step].element, this.settings.pastClass), 22435 (0, _heifer.uRemoveClass)(this.nav[step].element, this.settings.activeClass)); 22436 } 22437 }, { 22438 key: "resetNav", 22439 value: function(step) { 22440 this.nav.hasOwnProperty(step) && ((0, _heifer.uRemoveClass)(this.nav[step].element, this.settings.pastClass), 22441 (0, _heifer.uRemoveClass)(this.nav[step].element, this.settings.activeClass)); 22442 } 22443 }, { 22444 key: "bindEvents", 22445 value: function() { 22446 var _this7 = this; 22447 this.element.addEventListener("input", function(ev) { 22448 var input = ev.target; 22449 if (!(0, _heifer.uIs)(input, "input, select, textarea") || (0, _heifer.uIs)(input, 'input[type="radio"]') || (0, 22450 _heifer.uIs)(input, 'input[type="checkbox"]')) return (0, _heifer.uIs)(input, 'input[name="orderHonoree"]') && (_this7.giveInHonor = !_this7.giveInHonor, 22451 input.value = input.checked ? "1" : ""), !0; 22452 (0, _heifer.uIs)(input, "input[name=donation-one-time][type=number]") && _this7.preCheckFee(), 22453 _this7.updateButtonStates(), window.Heifer.shared.legoBlocks.donationMonthly && (0,
22454 _heifer.uHasClass)(input, "js-donationMonthly__product") && _this7.updateMonthlyUUID(input); 22455 }), this.element.addEventListener("change", function(ev) { 22456 var input = ev.target; 22457 if (_this7.getIsMonthly() && !_this7.summary && _this7.doBlackbaudFieldValidation(), 22458 (0, _heifer.uIs)(input, 'input[type="radio"]') || (0, _heifer.uIs)(input, 'input[type="checkbox"]')) { 22459 if ("coverProcessingFee" != input.name && (0, _heifer.uIs)(input, "[type=radio][name=donation-one-time]") && _this7.preCheckFee(), 22460 _this7.updateButtonStates(), _this7.summary || _this7.doBlackbaudButtonRevealLogic(), 22461 window.Heifer.shared.legoBlocks.donationMonthly && (0, _heifer.uHasClass)(input, "js-donationMonthly__product") && _this7.updateMonthlyUUID(input), 22462 input.dataset.message && input.checked) _this7.element.querySelectorAll(_this7.settings.donationAmountMessage).forEach(function(el) { 22463 el.replaceChildren(), el.insertAdjacentHTML("beforeend", input.dataset.message); 22464 }); 22465 window.Heifer.shared.legoBlocks.donationSubscription && input.dataset.json && (window.dispatchEvent((0, 22466 _heifer.uCreateCustomEvent)("donation-amount-change", { 22467 json: input.dataset.json 22468 })), (0, _heifer.uSetCookie)("donation_default", 0 == JSON.parse(input.dataset.json).index ? JSON.parse(input.dataset.json).index : JSON.parse(input.dataset.json).index - 1)), 22469 "coverProcessingFee" == input.name && _this7.updateAmountSummaryCopy(); 22470 } 22471 _this7.steps[_this7.currentStep].element.dataset.validate && (_this7.steps[_this7.currentStep].checkFieldValidity() ? _this7.steps[_this7.currentStep].enableContinue() : (_this7.steps[_this7.currentStep].disableContinue(), 22472 document.getElementById("donationAlt-amount-credit-card").removeAttribute("disabled"))); 22473 }), this.addBlackbaudEventListener(), !this.summary && this.element.querySelector('[data-reveal="billing-information payment-information"]') && this.element.querySelector('[data-reveal="billing-information payment-information"]').addEventListener("click", function(ev) { 22474 _this7.doBlackbaudButtonRevealLogic(); 22475 }), this.element.addEventListener("submit", function(ev) { 22476 (0, _heifer.uAddClass)(_this7.errorField, "is-hidden"), _this7.paymentFields.submitCart().then(_this7.onCheckoutResponse.bind(_this7)).catch(_this7.onCheckoutError.bind(_this7)), 22477 ev.preventDefault(); 22478 }), this.addProcessingFeeContainerListener(); 22479 } 22480 }, { 22481 key: "updateButtonStates", 22482 value: function() { 22483 this.donationAmount = this.getSelectedAmount(), this.updateSummaryTotals(), this.element.querySelector(this.settings.donationMonthlyInput) ? "" != this.donationAmount ? this.steps.amount.enableContinue() : this.steps.amount.disableContinue() : 0 < this.donationAmount ? this.steps.amount.enableContinue() : this.steps.amount.disableContinue(); 22484 } 22485 }, { 22486 key: "updateContinueButtons", 22487 value: function() { 22488 var monthly = this.getIsMonthly(); 22489 if ("amount" == this.currentStep) { 22490 var paymentOptions = this.element.querySelector(".js-donationAlt-payment-options"), continueButton = this.steps[this.currentStep].element.querySelector("#donationAlt-amount-continue"), oneTimeToggles = this.steps[this.currentStep].element.querySelectorAll(".js-donationAlt-one-time-toggle"), paymentOptionsNav = document.querySelectorAll('[data-step="payment-options"]'); 22491 monthly ? (paymentOptions && ((0, _heifer.uAddClass)(paymentOptions, "is-hidden"), 22492 (0, _heifer.uAddClass)(paymentOptionsNav[0], "presentational__is-hidden"), this.updateNextStep("billing")), 22493 continueButton && (0, _heifer.uRemoveClass)(continueButton, "is-hidden"), oneTimeToggles.length && Array.from(oneTimeToggles).forEac
22493h(function(elem) { 22494 (0, _heifer.uAddClass)(elem, "is-hidden"); 22495 })) : (paymentOptions && ((0, _heifer.uRemoveClass)(paymentOptions, "is-hidden"), 22496 (0, _heifer.uRemoveClass)(continueButton, "is-hidden"), (0, _heifer.uRemoveClass)(paymentOptionsNav[0], "presentational__is-hidden"), 22497 document.getElementById("donationAlt-amount-credit-card").removeAttribute("disabled"), 22498 this.updateNextStep("payment-options")), oneTimeToggles.length && Array.from(oneTimeToggles).forEach(function(elem) { 22499 (0, _heifer.uRemoveClass)(elem, "is-hidden"); 22500 })); 22501 } 22502 } 22503 }, { 22504 key: "updateMonthlyUUID", 22505 value: function(product) { 22506 this.element.querySelector('input[name="productUUID"]').value = product.value; 22507 } 22508 }, { 22509 key: "updateNextStep", 22510 value: function(step) { 22511 this.steps.hasOwnProperty(step) && (this.steps[this.currentStep].nextStep = step); 22512 } 22513 }, { 22514 key: "updateWysiwyg", 22515 value: function() { 22516 var _this8 = this; 22517 if (this.heroWysiwygWrapper = document.querySelector(".js-donationAlt-wysiwyg-wrapper"), 22518 this.heroWysiwygWrapper && "both" == this.heroWysiwygWrapper.dataset.frequency) { 22519 var oneTimeWysiwyg = this.heroWysiwygWrapper.querySelector(".js-donationAlt-wysiwyg--one-time"), monthlyWysiwyg = this.heroWysiwygWrapper.querySelector(".js-donationAlt-wysiwyg--monthly"); 22520 this.tabs && [].forEach.call(this.tabs.element.querySelectorAll(".js-reveal-tab"), function(tab) { 22521 tab.addEventListener("click", function(ev) { 22522 "true" == tab.dataset.monthly ? (monthlyWysiwyg.dataset.isActive = !0, oneTimeWysiwyg.dataset.isActive = !1) : (monthlyWysiwyg.dataset.isActive = !1, 22523 oneTimeWysiwyg.dataset.isActive = !0), tab.dataset.title && _this8.updateNavTitle(tab.dataset.title); 22524 }); 22525 }); 22526 } 22527 } 22528 }, { 22529 key: "addBlackbaudEventListener", 22530 value: function() { 22531 var _this9 = this, paymentButton = this.summary ? this.element.querySelector('button[data-continue="payment"]') : this.element.querySelector('button[data-continue="blackbaud"]'); 22532 paymentButton && paymentButton.addEventListener("click", function(ev) { 22533 _this9.getIsMonthly() && (window.dispatchEvent(new Event("blackbaudFlow")), _this9.goToStep("blackbaud")); 22534 }); 22535 } 22536 }, { 22537 key: "doBlackbaudButtonRevealLogic", 22538 value: function() { 22539 this.getIsMonthly() && this.element.querySelector('[data-continue="blackbaud"]') ? (this.element.querySelector('[data-continue="blackbaud"]').style.display = "block", 22540 this.element.querySelector("#payment-information").style.display = "none") : this.element.querySelector('[data-continue="blackbaud"]') && (this.element.querySelector('[data-continue="blackbaud"]').style.display = "none", 22541 this.element.querySelector("#payment-information").style.display = "block", (0, 22542 _heifer.uRemoveClass)(this.element.querySelector('[data-donation-step="blackbaud"]'), this.settings.activeClass)); 22543 } 22544 }, { 22545 key: "doBlackbaudFieldValidation", 22546 value: function() { 22547 var formInputs = this.element.querySelectorAll("input[required]"), validated = [], notValidated = []; 22548 formInputs.forEach(function(el) { 22549 (0, _heifer.uHasClass)(el, "is-valid") || el.hasAttribute("disabled") ? validated.push(el) : notValidated.push(el); 22550 }); 22551 notValidated.every(function(el) { 22552 if ((0, _heifer.uHasClass)(el, "js-payment-field__hidden-input") || (0, _heifer.uHasClass)(el, "is-valid")) return !0; 22553 }) && this.element.querySelector('[data-continue="blackbaud"]').removeAttribute("disabled"); 22554 } 22555 }, { 22556 key: "updateDonationOtherMessage", 22557 value: function() { 22558 var _this10 = this; 22559 this.element.querySelectorAll(this.settings.donationButtonOther).forEach(function(btn
22559) { 22560 btn.addEventListener("click", function(e) { 22561 e.currentTarget.dataset.message && _this10.element.querySelectorAll(_this10.settings.donationAmountMessage).forEach(function(el) { 22562 el.replaceChildren(), el.insertAdjacentHTML("beforeend", e.currentTarget.dataset.message); 22563 }); 22564 }); 22565 }); 22566 } 22567 }, { 22568 key: "addProcessingFeeContainerListener", 22569 value: function() { 22570 var _this11 = this, elem = document.querySelector(".js-toggle-processing-fee"); 22571 elem && elem.addEventListener("click", function(ev) { 22572 ev.target && void 0 === ev.target.name && (_this11.coverProcessingFeeInput.click(), 22573 ev.preventDefault()); 22574 }); 22575 } 22576 }, { 22577 key: "getTabs", 22578 value: function() { 22579 return console.log(this.element.querySelector(this.settings.tabsSelector)), this.element.querySelector(this.settings.tabsSelector); 22580 } 22581 }, { 22582 key: "initTabs", 22583 value: function() { 22584 var _this12 = this; 22585 return new _tabs.default(this.isTabbed, { 22586 onShow: function(trigger, targets) { 22587 _this12.enableTabFields(trigger, targets), _this12.preCheckFee(), _this12.updateButtonStates(), 22588 _this12.updateContinueButtons(); 22589 }, 22590 onHide: this.disableTabFields.bind(this) 22591 }); 22592 } 22593 }, { 22594 key: "getTabFields", 22595 value: function(targets, callback) { 22596 var _this13 = this; 22597 [].forEach.call(targets, function(target) { 22598 [].forEach.call(target.querySelectorAll(_this13.settings.donationAmountFields), function(field) { 22599 callback(field); 22600 }); 22601 }); 22602 } 22603 }, { 22604 key: "enableTabFields", 22605 value: function(trigger, targets) { 22606 this.getTabFields(targets, function(field) { 22607 field.disabled = !1, field.dispatchEvent((0, _heifer.uCreateEvent)("change")); 22608 }); 22609 } 22610 }, { 22611 key: "disableTabFields", 22612 value: function(trigger, targets) { 22613 this.getTabFields(targets, function(field) { 22614 field.disabled = !0; 22615 }); 22616 } 22617 }, { 22618 key: "onCheckoutResponse", 22619 value: function(checkoutResponse) { 22620 window.location.href = "/cart/confirmation.html"; 22621 } 22622 }, { 22623 key: "onCheckoutError", 22624 value: function(error) { 22625 var message = error || "A problem has occurrred"; 22626 this.submitButton.reset(), this.errorField.appendChild(message), (0, _heifer.uRemoveClass)(this.errorField, "is-hidden"), 22627 (0, _heifer.uScrollTo)(this.settings.errorFieldSelector); 22628 } 22629 }, { 22630 key: "onPaypalResponse", 22631 value: function(paypalResponse) { 22632 window.location.href = "/cart/confirmation.html"; 22633 } 22634 }, { 22635 key: "onAltPayError", 22636 value: function(error) { 22637 var message = error || "A problem has occurrred"; 22638 this.submitButton.reset(), this.errorField.appendChild(message), (0, _heifer.uRemoveClass)(this.errorField, "is-hidden"), 22639 (0, _heifer.uScrollTo)(this.settings.errorFieldSelector); 22640 } 22641 }, { 22642 key: "initValidation", 22643 value: function() {} 22644 }, { 22645 key: "initPaymentFields", 22646 value: function() { 22647 return this.paymentFields && this.getIsMonthly() === this.isMonthly ? this.paymentFields : (this.isMonthly = this.getIsMonthly(), 22648 donationShippable = "true" === (donationShippable = (inclucludeBlackbaud = (includeGooglePayments = this.summary ? (includePaypal = this.onPaypalResponse.bind(this), 22649 includeAltPayError = this.onAltPayError.bind(this), altPayLoadingElem = this.element.querySelector(".js-alt-pay-loading"), 22650 includeVenmo = includeApplePay = !0) : (includePaypal = !this.isMonthly && this.onPaypalResponse.bind(this), 22651 includeAltPayError = !this.isMonthly && this.onAltPayError.bind(this), altPayLoadingElem = this.element.querySelector(".js-alt-pay-loading"), 22652 includeApplePay = !this.isMonthly, includeVenmo = !this.isMonthly, !this.isMonthly), 22653 this.hasIsMonthly()), !!this.element.querySelector("[name='donationShippable']") && this.element.querySelector("[name='donationShippable']").value)).toLowerCase(), 22654 this.isSubscription && (inclucludeBlackbaud = !(includeGooglePayments = !(includeVenmo = !(includeApplePay = !(includePaypal = !1))
22654))), 22655 new _paymentFields.default(this.element, includePaypal, includeAltPayError, altPayLoadingElem, includeApplePay, includeVenmo, includeGooglePayments, inclucludeBlackbaud, donationShippable)); 22656 var includePaypal, includeAltPayError, altPayLoadingElem, includeApplePay, includeVenmo, includeGooglePayments, inclucludeBlackbaud, donationShippable; 22657 } 22658 }, { 22659 key: "getIsMonthly", 22660 value: function() { 22661 var formData = new window.FormData(this.element); 22662 if (formData.has("isMonthly")) { 22663 var isMonthly = formData.getAll("isMonthly"); 22664 if (1 === isMonthly.length) return "true" === isMonthly[0]; 22665 } 22666 return !1; 22667 } 22668 }, { 22669 key: "hasIsMonthly", 22670 value: function() { 22671 if (new window.FormData(this.element).has("isMonthly")) return !0; 22672 } 22673 } ]), DonationCard; 22674 }(); 22675 exports.default = DonationCard; 22676 var DonationCardStep = function() { 22677 function DonationCardStep(element, goToStep, showSummary) { 22678 var _this14 = this; 22679 _classCallCheck(this, DonationCardStep), this.element = element, this.step = this.element.getAttribute("data-donation-step"), 22680 this.continueButtons = this.getContinueButtons(), this.fieldsets = this.element.querySelectorAll("fieldset"), 22681 this.fields = [], this.summaryContent = {}, this.element.dataset.summary && (this.summaryContent = JSON.parse(this.element.dataset.summary)), 22682 this.continueButtons.length && (this.nextStep = this.continueButtons[0].getAttribute("data-continue"), 22683 this.bindEvents(goToStep, showSummary), this.disableContinue()), this.fieldsets.length && [].forEach.call(this.fieldsets, function(fieldset) { 22684 Array.from(fieldset.elements).filter(function(elem) { 22685 return _this14.matches(elem, "input:not([type=submit]), select, textarea"); 22686 }
22686).forEach(function(field) { 22687 return _this14.fields.push(field); 22688 }); 22689 }); 22690 } 22691 return _createClass(DonationCardStep, [ { 22692 key: "matches", 22693 value: function(el, selector) { 22694 return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector); 22695 } 22696 }, { 22697 key: "getContinueButtons", 22698 value: function() { 22699 return this.element.querySelectorAll(".js-donationCard__continue"); 22700 } 22701 }, { 22702 key: "disableContinue", 22703 value: function() { 22704 [].forEach.call(this.continueButtons, function(button) { 22705 button.disabled = !0; 22706 }); 22707 } 22708 }, { 22709 key: "enableContinue", 22710 value: function() { 22711 [].forEach.call(this.continueButtons, function(button) { 22712 button.disabled = !1; 22713 }); 22714 } 22715 }, { 22716 key: "bindEvents", 22717 value: function(goToStep, showSummary) { 22718 var _this15 = this; 22719 [].forEach.call(this.continueButtons, function(button) { 22720 button.addEventListener("click", function(ev) { 22721 showSummary(_this15.step, ".js-donationAlt-summary-edit"), goToStep(_this15.nextStep); 22722 }); 22723 }); 22724 } 22725 }, { 22726 key: "checkFieldValidity", 22727 value: function() { 22728 if (Array.isArray(this.fields) && this.fields.length) return !this.fields.filter(function(input) { 22729 return !input.checkValidity(); 22730 }).length; 22731 } 22732 } ]), DonationCardStep; 22733 }(), DonationCardNav = function DonationCardNav(element, progress, goToStep, bindEditButtons) { 22734 _classCallCheck(this, DonationCardNav), this.element = element, this.step = this.element.getAttribute("data-donation-step"), 22735 this.progress = progress; 22736 }; 22737 }, { 22738 "./../../../../../core/utilities/checkout.utilities": 15, 22739 "./../../../../../core/utilities/heifer.utilities": 19, 22740 "./../../../../../shared/tabs/tabs": 130, 22741 "./../../../../forms/paymentFields/paymentFields": 85, 22742 "./../../../../forms/submitButton/submitButton": 88, 22743 "core-js/modules/es6.array.from": 240, 22744 "core-js/modules/es6.array.iterator": 241, 22745 "core-js/modules/es6.function.name": 244, 22746 "core-js/modules/es6.object.keys": 250, 22747 "core-js/modules/es6.object.to-string": 252, 22748 "core-js/modules/es6.promise": 253, 22749 "core-js/modules/es6.regexp.replace": 259, 22750 "core-js/modules/es6.string.iterator": 265, 22751 "core-js/modules/es6.symbol": 268, 22752 "core-js/modules/es7.object.get-own-property-descriptors": 272, 22753 "core-js/modules/es7.symbol.async-iterator": 273, 22754 "core-js/modules/web.dom.iterable": 274, 22755 "formdata-polyfill": 279, 22756 jquery: 20 22757 } ], 22758 110: [ function(require, module, exports) { 22759 "use strict"; 22760 Object.defineProperty(exports, "__esModule", { 22761 value: !0 22762 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 22763 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 22764 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 22765 require("core-js/modules/es6.object.keys"); 22766 var obj, _jquery = (obj = require("jquery")) && obj.__esModule ? obj : { 22767 default: obj 22768 }, _heifer = require("./../../../../../core/utilities/heifer.utilities"); 22769 function ownKeys(object, enumerableOnly) { 22770 var keys = Object.keys(object); 22771 if (Object.getOwnPropertySymbols) { 22772 var symbols = Object.getOwnPropertySymbols(object); 22773 enumerableOnly && (symbols = symbols.filter(function(sym) { 22774 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 22775 })), keys.push.apply(keys, symbols); 22776 } 22777 return keys; 22778 } 22779 function _defineProperty(obj, key, value) { 22780 return key in obj ? Object.defineProperty(obj, key, { 22781 value: value, 22782 enumerable: !0, 22783 configurable: !0, 22784 writable: !0 22785 }) : obj[key] = value, obj; 22786 } 22787 function _defineProperties(target, props) { 22788 for (var i = 0; i < props.length; i++) { 22789 var descriptor = props[i]; 22790 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 22791 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 22792 } 22793 } 22794 var TangibilityText = function() { 22795 function TangibilityText(element, options) { 22796 !function(instance, Constructor) { 22797 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 22798 }(this, TangibilityText), this.element = element, this.$element = (0, _jquery.default)(element); 22799 var defaults = {}; 22800 this._defaults = defaults, this.settings = function(target) { 22801 for (var i = 1; i < arguments.length; i++) { 22802 var source = null != arguments[i] ? arguments[i] : {};
22803 i % 2 ? ownKeys(source, !0).forEach(function(key) { 22804 _defineProperty(target, key, source[key]); 22805 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 22806 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 22807 }); 22808 } 22809 return target; 22810 }({}, defaults, {}, options), this.settings.pages = { 22811 onetime: "/give/one-time.html" == window.location.pathname, 22812 everdream: "/campaign/everdream.html" == window.location.pathname 22813 }, this.animals = this.getAnimals(), this.everdreamanimals = this.getEverDreamAnimals(), 22814 this.init(); 22815 } 22816 return function(Constructor, protoProps, staticProps) { 22817 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 22818 }(TangibilityText, [ { 22819 key: "init", 22820 value: function() { 22821 var displayTangibilityText = !1; 22822 for (var page in this.settings.pages) if (this.settings.pages[page]) { 22823 displayTangibilityText = !0; 22824 break; 22825 } 22826 displayTangibilityText && (this.showCorrespondingText(), this.bindEvents(), this.settings.pages.onetime && this.hideTopPrices()); 22827 } 22828 }, { 22829 key: "bindEvents", 22830 value: function() { 22831 var _this = this; 22832 [].forEach.call(this.element.querySelectorAll(".donationCard__tabpanel[id^=donation-one-time] .js-donationCard__amount-input"), function(el) { 22833 el.addEventListener("change", function() { 22834 _this.showCorrespondingText(); 22835 }); 22836 }), this.element.querySelector(".donationCard__tabpanel[id^=donation-one-time] .buttonInput__label").addEventListener("click", function() { 22837 _this.showCorrespondingText(); 22838 }); 22839 } 22840 }, { 22841 key: "addMarkup", 22842 value: function(argument_0, argument_1) { 22843 var description = 0 < arguments.length && void 0 !== argument_0 && argument_0, image = 1 < arguments.length && void 0 !== argument_1 && argument_1; 22844 if (null != this.element.querySelector("#js-tangiblity-text")) { 22845 var node = this.element.querySelector("#js-tangiblity-text"); 22846 node.parentNode.removeChild(node); 22847 } 22848 var pannel = this.element.querySelector(".donationCard__tabpanel:first-of-type"), messageNode = document.createElement("div"), message = document.createElement("div"); 22849 message.innerHTML = description, messageNode.appendChild(message); 22850 var imageNode = document.createElement("div"); 22851 imageNode.innerHTML = image; 22852 var text = messageNode.querySelector("div"); 22853 (0, _heifer.uAddClass)(messageNode, "grid__row"), (0, _heifer.uAddClass)(text, "hierarchy__petite-text grid__col-lg-8of12 grid__col-md-8of12 grid__col-sm-12of12"), 22854 (0, _heifer.uAddClass)(imageNode, "grid__col-lg-4of12 grid__col-md-4of12 grid__col-sm-12of12"), 22855 messageNode.setAttribute("id", "js-tangiblity-text"), pannel.appendChild(messageNode), 22856 messageNode.prepend(imageNode); 22857 } 22858 }, { 22859 key: "getAnimals", 22860 value: function() { 22861 return [ { 22862 id: "1000", 22863 img: '<figure><img src="https://media.heifer.org/Our_Work/KH201811-290.jpg?or=0&q=60&crop=focalpoint&auto=format&fm=jpeg&shad=50&vib=20&duotone-alpha=40&duotone=000000%2C2CFFD4C6&fit=crop&fp-x=0.31&fp-y=0.51&flip=h&w=360&h=240"></figure>', 22864 description: "<p>Your donation could provide a <strong>Heifer and additional training and support</strong> to a family, providing milk and nourishment, and boosting income through sales of extra milk.</p>" 22865 }, { 22866 id: "500", 22867 img: '<figure><img src="https://media.heifer.org/Shared_Content/pp-heifer.jpg?or=0&q=60&crop=focalpoint&auto=format&fm=jpeg&shad=50&vib=20&duotone-alpha=40&duotone=000000%2C2CFFD4C6&fit=crop&fp-x=0.36&fp-y=0.32&w=370&h=247"></figure>', 22868 description: "<p>Your donation could provide a <strong>Heifer</strong> to a family, providing milk and nourishment to hungry families, and boosting income through sales of extra milk. It also enables entire communities to benefit through passing on the gift.</p>" 22869 }, { 22870 id: "250", 22871 img: '<figure><img src="https://media.heifer.org/Shared_Content/pp-waterbuffalo-bg.jpg?or=0&q=60&crop=faces%2Centropy%2Ccenter&auto=format&fm=jpeg&shad=50&vib=20&duotone-alpha=40&duotone=000000%2C2CFFD4C6&fit=crop&w=370&h=247"></figure>', 22872 description: "<p>Your donation could provide a <strong>Water Buffalo</strong> to a family, providing rich milk that is high in protein and nutrients, boosting income through sales of extra milk. Water buffalo also make farming easier by tilling fields and providing fertilizer.</p>" 22873 }, { 22874 id: "150", 22875 img: '<figure><img src="https://media.heifer.org/Shared_Content/pp-alpaca-bg.jpg?or=0&q=60&crop=faces%2Centropy%2Ccenter&auto=format&fm=jpeg&shad=50&vib=20&duotone-alpha=40&duotone=000000%2C2CFFD4C6&fit=crop&w=332&h=221"></figure>', 22876 description: "<p>Your donation could provide an <strong>Alpaca</strong> to a family, providing income earned from selling wool and fertilizer to help increase crop yield.</p>" 22877 }, { 22878 id: "50", 22879 img: '<figure><img src="https://media.heifer.org/Animals/Hope_Basket/US201801-017.jpg?or=0&q=60&crop=faces%2Centropy%2Ccenter&auto=format&fm=jpeg&shad=50&vib=20&duotone-alpha=40&duotone=000000%2C2CFFD4C6&fit=crop&w=332&h=221"></figure>', 22880 description: "<p>Your donation provides <strong>Rabbits and a Starter Flock of Chickens</strong>, providing eggs and protein to a family.</p>" 22881 }, { 22882 id: "other", 22883 img: '<figure><img src="https://media.heifer.org/Gift_Catalog/Gift_of_Women\'s_Empowerment/Heifer-Kenya-Food-Basket.jpg?or=0&q=60&crop=focalpoint&auto=format&fm=jpeg&shad=50&vib=20&duotone-alpha=40&duotone=000000%2C2CFFD4C6&fit=crop&fp-x=0.54&fp-y=0.39&w=332&h=221"></figure>', 22884 description: "<p>Your donation is going a long way to increase the income of families through gifts of animals and training where needed most.</p>" 22885 } ]; 22886 } 22887 }, { 22888 key: "getEverDreamAnimals", 22889 value: function() { 22890 return [ { 22891 id: "5000", 22892 img: '<figure><img src="https://media.heifer.org/Campaigns/Everdream/gift-ark-tile.jpg"></figure>', 22893 description: "<p>Change the world two by two. This gift includes two water buffalo, two cows, two sheep and two goats, along with bees, chicks and more.</p>" 22894 }, { 22895 id: "1500", 22896 img: '<figure><img src="https://media.heifer.org/Campaigns/Everdream/joy-to-the-world-tile.jpg"></figure>', 22897 description: "<p>
22897Provide life-changing livestock to a family in need. This gift includes two sheep, four goats, one heifer and two alpacas, along with training and education on their care.</p>" 22898 }, { 22899 id: "750", 22900 img: '<figure><img src="https://media.heifer.org/Campaigns/Everdream/water-for-life.jpg"></figure>', 22901 description: "<p>Help Heifer build solar-powered wells to bring life-sustaining water to communities. This clean water is essential for healthy families, crops and livestock.</p>" 22902 }, { 22903 id: "275", 22904 img: '<figure><img src="https://media.heifer.org/Campaigns/Everdream/send-a-girl-to-school.jpg"></figure>', 22905 description: "<p>Help families afford school fees and supplies for their children. An education provides the skills needed to be successful â breaking the cycle of poverty forever.</p>" 22906 }, { 22907 id: "60", 22908 img: '<figure><img src="https://media.heifer.org/Campaigns/Everdream/honeybees-tile.jpg"></figure>', 22909 description: "<p>A sweet gift for a sweet couple. Provide two hives of bees, which will pollinate crops and allow families to start a small business by selling honey.</p>" 22910 }, { 22911 id: "other", 22912 img: '<figure><img src="https://media.heifer.org/Campaigns/Everdream/alpaca-tile.png"></figure>', 22913 description: "<p>Give families the opportunity to thrive by helping them earn sustainable incomes through gifts of livestock and education.</p>" 22914 } ]; 22915 } 22916 }, { 22917 key: "showCorrespondingText", 22918 value: function() { 22919 var selectedAmount; 22920 selectedAmount = null == document.querySelector(".donationCard__tabpanel[id^=donation-one-time] .js-donationCard__amount-input:checked") ? "other" : document.querySelector(".donationCard__tabpanel[id^=donation-one-time] .js-donationCard__amount-input:checked").value, 22921 this.matchAnimal(selectedAmount); 22922 } 22923 }, { 22924 key: "matchAnimal", 22925 value: function(selectedAmount) { 22926 var _this2 = this; 22927 this.settings.pages.onetime ? this.animals.forEach(function(element) { 22928 element.id == selectedAmount && _this2.addMarkup(element.description, element.img); 22929 }) : this.settings.pages.everdream && this.everdreamanimals.forEach(function(element) { 22930 element.id == selectedAmount && _this2.addMarkup(element.description, element.img); 22931 }); 22932 } 22933 }, { 22934 key: "hideTopPrices", 22935 value: function() { 22936 var buttons = document.querySelectorAll(".donationCard__tabpanel[id^=donation-one-time] .buttonPricing__label"); 22937 (0, _heifer.uAddClass)(buttons[0], "donation__tangibilty-text"), (0, _heifer.uAddClass)(buttons[1], "donation__tangibilty-text"), 22938 screen.width <= 768 && buttons[3].click(); 22939 } 22940 } ]), TangibilityText; 22941 }(); 22942 exports.default = TangibilityText; 22943 }, { 22944 "./../../../../../core/utilities/heifer.utilities": 19, 22945 "core-js/modules/es6.array.iterator": 241, 22946 "core-js/modules/es6.object.keys": 250, 22947 "core-js/modules/es6.object.to-string": 252, 22948 "core-js/modules/es6.symbol": 268, 22949 "core-js/modules/es7.object.get-own-property-descriptors": 272, 22950 "core-js/modules/web.dom.iterable": 274, 22951 jquery: 20 22952 } ], 22953 111: [ function(require, module, exports) { 22954 "use strict"; 22955 Object.defineProperty(exports, "__esModule", { 22956 value: !0 22957 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 22958 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 22959 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.keys"), 22960 require("core-js/modules/es6.promise"), require("core-js/modules/es6.object.to-string"), 22961 require("core-js/modules/es6.regexp.replace"); 22962 var _heifer = require("../../../core/utilities/heifer.utilities"); 22963 function ownKeys(object, enumerableOnly) { 22964 var keys = Object.keys(object); 22965 if (Object.getOwnPropertySymbols) { 22966 var symbols = Object.getOwnPropertySymbols(object); 22967 enumerableOnly && (symbols = symbols.filter(function(sym) { 22968 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 22969 })), keys.push.apply(keys, symbols); 22970 } 22971 return keys; 22972 } 22973 function _defineProperty(obj, key, value) { 22974 return key in obj ? Object.defineProperty(obj, key, { 22975 value: value, 22976 enumerable: !0, 22977 configurable: !0, 22978 writable: !0 22979 }) : obj[key] = value, obj; 22980 } 22981 function _defineProperties(target, props) { 22982 for (var i = 0; i < props.length; i++) { 22983 var descriptor = props[i]; 22984 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 22985 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 22986 } 22987 } 22988 var DonationSubscription = function() { 22989 function DonationSubscription(element, options) { 22990 !function(instance, Constructor) { 22991 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 22992 }(this, DonationSubscription), this.element = element, this.$element = $(element); 22993 this.settings = function(target) { 22994 for (var i = 1; i < arguments.length; i++) { 22995 var source = null != arguments[i] ? arguments[i] : {};
22996 i % 2 ? ownKeys(source, !0).forEach(function(key) { 22997 _defineProperty(target, key, source[key]); 22998 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 22999 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 23000 }); 23001 } 23002 return target; 23003 }({}, {}, {}, options), this.impactContent = { 23004 badge: this.element.querySelectorAll(".js-donationSubscription-badge"), 23005 copy: this.element.querySelectorAll(".js-donationSubscription-copy"), 23006 icons: this.element.querySelectorAll(".js-donationSubscription-icons"), 23007 iconTemplate: this.element.querySelector("#js-donationSubscription-icon-template") 23008 }, this.billDateSelect = this.element.querySelector(".js-donationSubscription-bill-date-select"), 23009 this.billDateInput = this.element.querySelector('input[name="paymentDay"]'), this.billDateDisplay = this.element.querySelector(".js-donationSubscription-bill-date-display"), 23010 this.billMonthDateDisplay = this.element.querySelector(".js-donationSubscription-bill-month-date-display"), 23011 this.setEventListeners(); 23012 } 23013 return function(Constructor, protoProps, staticProps) { 23014 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 23015 }(DonationSubscription, [ { 23016 key: "setEventListeners", 23017 value: function() { 23018 var _this = this; 23019 window.addEventListener("donation-amount-change", function(ev) { 23020 var data = JSON.parse(ev.detail.json); 23021 _this.updateContent(data); 23022 }), this.billDateSelect.addEventListener("change", function(ev) { 23023 var val = ev.target.value, nextBill = ev.target.options[ev.target.selectedIndex].dataset.nextBill; 23024 "" != val && (_this.billDateInput.value = val, _this.billDateDisplay.textContent = val + (0, 23025 _heifer.uGetOrdinalSuffix)(val), _this.billMonthDateDisplay.textContent = nextBill + " " + val + (0, 23026 _heifer.uGetOrdinalSuffix)(val)); 23027 }); 23028 } 23029 }, { 23030 key: "updateContent", 23031 value: function(data) { 23032 var _this2 = this; 23033 if (data && (data.copy && [].forEach.call(this.impactContent.copy, function(copy) { 23034 copy.textContent = data.copy; 23035 }), data.icons)) { 23036 var icons = ""; 23037 [].forEach.call(data.icons, function(icon) { 23038 "thank-you" == icon ? _this2.impactContent.iconTemplate.setAttribute("display", "none") : icons += _this2.impactContent.iconTemplate.innerHTML.replace(/{{ icon }}/g, icon); 23039 }), new Promise(function(resolve) { 23040 [].forEach.call(_this2.impactContent.icons, function(iconList) { 23041 for (;iconList.firstChild; ) iconList.removeChild(iconList.lastChild); 23042 }), resolve(!0); 23043 }).then(function() { 23044 [].forEach.call(_this2.impactContent.icons, function(iconList) { 23045 iconList.insertAdjacentHTML("afterbegin", icons); 23046 }); 23047 }); 23048 } 23049 } 23050 } ]), DonationSubscription; 23051 }(); 23052 exports.default = DonationSubscription; 23053 }, { 23054 "../../../core/utilities/heifer.utilities": 19, 23055 "core-js/modules/es6.array.iterator": 241, 23056 "core-js/modules/es6.object.keys": 250, 23057 "core-js/modules/es6.object.to-string": 252, 23058 "core-js/modules/es6.promise": 253, 23059 "core-js/modules/es6.regexp.replace": 259, 23060 "core-js/modules/es6.symbol": 268, 23061 "core-js/modules/es7.object.get-own-property-descriptors": 272, 23062 "core-js/modules/web.dom.iterable": 274 23063 } ],
23064 112: [ function(require, module, exports) { 23065 "use strict"; 23066 function ownKeys(object, enumerableOnly) { 23067 var keys = Object.keys(object); 23068 if (Object.getOwnPropertySymbols) { 23069 var symbols = Object.getOwnPropertySymbols(object); 23070 enumerableOnly && (symbols = symbols.filter(function(sym) { 23071 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 23072 })), keys.push.apply(keys, symbols); 23073 } 23074 return keys; 23075 } 23076 function _defineProperty(obj, key, value) { 23077 return key in obj ? Object.defineProperty(obj, key, { 23078 value: value, 23079 enumerable: !0, 23080 configurable: !0, 23081 writable: !0 23082 }) : obj[key] = value, obj; 23083 } 23084 function _defineProperties(target, props) { 23085 for (var i = 0; i < props.length; i++) { 23086 var descriptor = props[i]; 23087 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 23088 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 23089 } 23090 } 23091 Object.defineProperty(exports, "__esModule", { 23092 value: !0 23093 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 23094 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 23095 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 23096 require("core-js/modules/es6.object.keys"), require("core-js/modules/es7.array.includes"), 23097 require("core-js/modules/es6.string.includes"), require("core-js/modules/es6.string.link"); 23098 var FilterGrid = function() { 23099 function FilterGrid(element, options) { 23100 !function(instance, Constructor) { 23101 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 23102 }(this, FilterGrid), this.element = element, this._defaults = {}, this.settings = function(target) { 23103 for (var i = 1; i < arguments.length; i++) { 23104 var source = null != arguments[i] ? arguments[i] : {}; 23105 i % 2 ? ownKeys(source, !0).forEach(function(key) { 23106 _defineProperty(target, key, source[key]); 23107 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 23108 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 23109 }); 23110 } 23111 return target; 23112 }({}, this._defaults, {}, options), this.selected = { 23113 type: "", 23114 action: "" 23115 }, this.allGridItems = window.Heifer.shared.legoBlocks.filterGrid.items, this.filters = document.querySelectorAll(".js-filter"), 23116 this.grid = document.querySelector(".js-grid"), this.loader = this.grid.querySelector(".js-grid-loader"), 23117 this.dropdowns = document.querySelectorAll(".js-filter-dropdown"), this.buttons = document.querySelectorAll(".js-filter-button"), 23118 this.clear = document.querySelector(".js-filter-clear"), this.mainSections = document.querySelector(".js-grid-main"), 23119 this.personalizedSection = document.querySelector(".js-grid-personalized"), this.personalizedHeader = this.personalizedSection.querySelector(".js-grid-header"), 23120 this.personalizedContent = this.personalizedSection.querySelector(".js-grid-content"), 23121 this.otherSection = document.querySelector(".js-grid-other"), this.otherHeader = this.otherSection.querySelector(".js-grid-header"), 23122 this.otherContent = this.otherSection.querySelector(".js-grid-content"), this.personalizedHTML = "", 23123 this.otherHTML = "", this.notFoundHTML = "<div>
23123No Options Found.</div>", this.init(); 23124 } 23125 return function(Constructor, protoProps, staticProps) { 23126 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 23127 }(FilterGrid, [ { 23128 key: "init", 23129 value: function() { 23130 var _this = this; 23131 this.buttons.forEach(function(button) { 23132 button.addEventListener("click", function(e) { 23133 e.preventDefault(), _this.triggerDropdowns("toggle", button); 23134 }); 23135 }), this.filters.forEach(function(filter) { 23136 filter.addEventListener("click", function(e) { 23137 e.preventDefault(); 23138 var dropdown = filter.closest(".js-filter-dropdown"), menu = dropdown.querySelector(".js-filter-menu"), buttonText = dropdown.querySelector(".js-filter-button").querySelector(".js-filter-button-text"); 23139 menu.classList.remove("active"), buttonText.textContent = filter.dataset.label, 23140 menu.querySelector(".active").classList.remove("active"), e.target.classList.add("active"), 23141 filter.hasAttribute("data-type") && _this.checkState(filter.dataset.type, null), 23142 filter.hasAttribute("data-action") && _this.checkState(null, filter.dataset.action); 23143 }); 23144 }), this.clear.addEventListener("click", function(e) { 23145 e.preventDefault(), _this.checkState("", ""), _this.triggerDropdowns("clear", null); 23146 }); 23147 } 23148 }, { 23149 key: "loaderFadeIn", 23150 value: function() { 23151 this.loader.classList.remove("off"); 23152 } 23153 }, { 23154 key: "loaderFadeOut", 23155 value: function() { 23156 var _this2 = this; 23157 setTimeout(function() { 23158 _this2.loader.classList.add("off"); 23159 }, 1e3); 23160 } 23161 }, { 23162 key: "buildCard", 23163 value: function(card) { 23164 return '\n <div class="js-grid-item grid-item" data-types="'.concat(card.types, '" data-actions="').concat(card.actions, '">\n <a href="').concat(card.link, '" class="cardBlock__link">\n <span class="presentational__is-hidden">\n Learn more about ').concat(card.title, '.\n </span>\n </a>\n <div class="cardBlockTypical__card page-theme--clarity-white">\n <figure class="cardBlockTypical__figure tw-bg-grand-blue">\n <img class="cardBlockTypical__image js-lazyload-image lazyloaded" src="').concat(0 !== card.image.length ? card.image.url : "", '" loading="lazy" sizes="270px" alt="">\n </figure>\n <div class="cardBlockTypical__body max-sm:tw-px-4 max-sm:tw-py-3">\n <div class="cardBlockTypical__heading-section">\n <div class="cardBlockTypical__heading-section--bite">\n <h2 class="cardBlockTypical__title styles__h4 max-sm:tw-text-lg">').concat(card.title, '</h2>\n <a class="cardBlockTypical__link-icon" href="').concat(card.link, '" title="').concat(card.title, '">\n <svg class="icons__icon cardBlockTypical__arrow" aria-hidden="true">\n <use xlink:href="#arrow-right"></use>\n </svg>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n '); 23165 } 23166 }, { 23167 key: "doFiltering", 23168 value: function() { 23169 var _this3 = this; 23170 this.loaderFadeIn(), setTimeout(function() { 23171 _this3.personalizedHTML = "", _this3.personalizedContent.innerHTML = "", _this3.personalizedCount = 0, 23172 _this3.otherHTML = "", _this3.otherContent.innerHTML = "", _this3.otherCount = 0,
23173 _this3.allGridItems.forEach(function(item) { 23174 "" == _this3.selected.type && "" == _this3.selected.action ? (_this3.mainSections.classList.remove("hidden"), 23175 _this3.personalizedSection.classList.add("hidden"), _this3.otherSection.classList.add("hidden")) : "" != _this3.selected.type && "" != _this3.selected.action ? (_this3.mainSections.classList.add("hidden"), 23176 _this3.personalizedSection.classList.remove("hidden"), _this3.otherSection.classList.remove("hidden"), 23177 item.types.includes(_this3.selected.type) && item.actions.includes(_this3.selected.action) ? (_this3.personalizedCount++, 23178 _this3.personalizedHTML += _this3.buildCard(item)) : item.types.includes(_this3.selected.type) && !item.actions.includes(_this3.selected.action) && (_this3.otherCount++, 23179 _this3.otherHTML += _this3.buildCard(item))) : (_this3.mainSections.classList.add("hidden"), 23180 _this3.personalizedSection.classList.remove("hidden"), _this3.otherSection.classList.add("hidden"), 23181 "" != _this3.selected.type && item.types.includes(_this3.selected.type) && (_this3.personalizedCount++, 23182 _this3.personalizedHTML += _this3.buildCard(item)), "" != _this3.selected.action && item.actions.includes(_this3.selected.action) && (_this3.personalizedCount++, 23183 _this3.personalizedHTML += _this3.buildCard(item))); 23184 }), _this3.personalizedContent.innerHTML += 0 < _this3.personalizedCount ? _this3.personalizedHTML : _this3.notFoundHTML, 23185 _this3.otherContent.innerHTML += 0 < _this3.otherCount ? _this3.otherHTML : _this3.notFoundHTML; 23186 }, 500), this.loaderFadeOut(); 23187 } 23188 }, { 23189 key: "checkState", 23190 value: function(type, action) { 23191 null != type && type != this.selected.type && (this.selected.type = type, this.doFiltering()), 23192 null != action && action != this.selected.action && (this.selected.action = action, 23193 this.doFiltering()); 23194 } 23195 }, { 23196 key: "triggerDropdowns", 23197 value: function(trigger, target) { 23198 this.dropdowns.forEach(function(dropdown) { 23199 var button = dropdown.querySelector(".js-filter-button"), buttonText = button.querySelector(".js-filter-button-text"), menu = dropdown.querySelector(".js-filter-menu"), filters = dropdown.querySelectorAll(".js-filter"); 23200 "toggle" == trigger && target == button && menu.classList.toggle("active"), "toggle" == trigger && target != button && menu.classList.remove("active"), 23201 "clear" == trigger && null == target && (menu.classList.remove("active"), buttonText.textContent = filters[0].dataset.label, 23202 menu.querySelector(".active").classList.remove("active"), filters[0].classList.add("active")); 23203 }); 23204 } 23205 } ]), FilterGrid; 23206 }(); 23207 exports.default = FilterGrid; 23208 }, {
23209 "core-js/modules/es6.array.iterator": 241, 23210 "core-js/modules/es6.object.keys": 250, 23211 "core-js/modules/es6.object.to-string": 252, 23212 "core-js/modules/es6.string.includes": 264, 23213 "core-js/modules/es6.string.link": 266, 23214 "core-js/modules/es6.symbol": 268, 23215 "core-js/modules/es7.array.includes": 270, 23216 "core-js/modules/es7.object.get-own-property-descriptors": 272, 23217 "core-js/modules/web.dom.iterable": 274 23218 } ], 23219 113: [ function(require, module, exports) { 23220 "use strict"; 23221 Object.defineProperty(exports, "__esModule", { 23222 value: !0 23223 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 23224 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 23225 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 23226 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.regexp.match"); 23227 var _heifer = require("../../../core/utilities/heifer.utilities"); 23228 function ownKeys(object, enumerableOnly) { 23229 var keys = Object.keys(object); 23230 if (Object.getOwnPropertySymbols) { 23231 var symbols = Object.getOwnPropertySymbols(object); 23232 enumerableOnly && (symbols = symbols.filter(function(sym) { 23233 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 23234 })), keys.push.apply(keys, symbols); 23235 } 23236 return keys; 23237 } 23238 function _defineProperty(obj, key, value) { 23239 return key in obj ? Object.defineProperty(obj, key, { 23240 value: value, 23241 enumerable: !0, 23242 configurable: !0, 23243 writable: !0 23244 }) : obj[key] = value, obj; 23245 } 23246 function _defineProperties(target, props) { 23247 for (var i = 0; i < props.length; i++) { 23248 var descriptor = props[i]; 23249 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 23250 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 23251 } 23252 } 23253 var FlipImageGrid = function() { 23254 function FlipImageGrid(element, options) { 23255 !function(instance, Constructor) { 23256 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 23257 }(this, FlipImageGrid), this.element = element, this.$element = $(this.element), 23258 this._defaults = {}, this.settings = function(target) { 23259 for (var i = 1; i < arguments.length; i++) { 23260 var source = null != arguments[i] ? arguments[i] : {}; 23261 i % 2 ? ownKeys(source, !0).forEach(function(key) { 23262 _defineProperty(target, key, source[key]); 23263 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 23264 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 23265 }); 23266 } 23267 return target; 23268 }({}, this._defaults, {}, options), this.init(); 23269 } 23270 return function(Constructor, protoProps, staticProps) { 23271 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 23272 }(FlipImageGrid, [ { 23273 key: "init", 23274 value: function() { 23275 var _this = this; 23276 navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) ? (0, 23277 _heifer.uAddEventListener)(this.element, "touchstart", function() { 23278 _this.toggleImg(); 23279 }) : ((0, _heifer.uAddEventListener)(this.element, "mouseover", function() { 23280 _this.hideImg(); 23281 }), (0, _heifer.uAddEventListener)(this.element, "click", function() { 23282 _this.showImg(); 23283 })); 23284 } 23285 }, { 23286 key: "hideImg", 23287 value: function() { 23288 (0, _heifer.uAddClass)(this.element, "flipImageGrid__figure-img__hide"); 23289 } 23290 }, { 23291 key: "showImg", 23292 value: function() { 23293 (0, _heifer.uRemoveClass)(this.element, "flipImageGrid__figure-img__hide"); 23294 } 23295 }, { 23296 key: "toggleImg", 23297 value: function() { 23298 this.element.classList.toggle("flipImageGrid__figure-img__hide"); 23299 } 23300 } ]), FlipImageGrid; 23301 }(); 23302 exports.default = FlipImageGrid; 23303 }, {
23304 "../../../core/utilities/heifer.utilities": 19, 23305 "core-js/modules/es6.array.iterator": 241, 23306 "core-js/modules/es6.object.keys": 250, 23307 "core-js/modules/es6.object.to-string": 252, 23308 "core-js/modules/es6.regexp.match": 258, 23309 "core-js/modules/es6.symbol": 268, 23310 "core-js/modules/es7.object.get-own-property-descriptors": 272, 23311 "core-js/modules/web.dom.iterable": 274 23312 } ], 23313 114: [ function(require, module, exports) { 23314 "use strict"; 23315 Object.defineProperty(exports, "__esModule", { 23316 value: !0 23317 }), exports.default = function(elem) { 23318 !function(elem) { 23319 jumpNav = (wrapper = elem).querySelector(".js-jump-nav"), jumpNavLinks = jumpNav.querySelectorAll(".js-jump-nav-links"), 23320 noPositionSticky = (0, _heifer.uHasClass)(settings.docElem, "no-csspositionsticky"), 23321 positionSticky = (0, _heifer.uHasClass)(wrapper, "js-sticky-subnav"), (0, _heifer.uGetScrollPosition)(), 23322 positionSticky && function(wrapper) { 23323 var stickyNav = wrapper.offsetTop; 23324 window.onscroll = function() { 23325 return toggleStickyClass(stickyNav); 23326 }; 23327 }(wrapper); 23328 window.addEventListener("resize", (0, _heifer.uDebounce)(function() { 23329 noPositionSticky && setHeight(), initOverflow(); 23330 })), function() { 23331 noPositionSticky && (requestAnimationFrame(function handleScroll() { 23332 var newScrollPos = (0, _heifer.uGetScrollPosition)(); 23333 newScrollPos >= (0, _heifer.uGetCoords)(wrapper).top && !isSticky ? requestAnimationFrame(function() { 23334 stickJumpNav(); 23335 }) : newScrollPos < (0, _heifer.uGetCoords)(wrapper).top && isSticky && requestAnimationFrame(function() { 23336 unstickJumpNav(); 23337 }); 23338 newScrollPos; 23339 requestAnimationFrame(handleScroll.bind(this)); 23340 }.bind(this)), setHeight()); 23341 initOverflow(); 23342 }(), new _reveal.default(".js-jump-nav-reveal", { 23343 type: "exclusive", 23344 activeClass: "is-revealed", 23345 visitedClass: "was-revealed" 23346 }); 23347 }(elem); 23348 }; 23349 var obj, _reveal = (obj = require("./../../../core/ui/reveal.es6")) && obj.__esModule ? obj : { 23350 default: obj 23351 }, _heifer = require("../../../core/utilities/heifer.utilities"); 23352 var wrapper, jumpNav, jumpNavLinks, noPositionSticky, positionSticky, settings = { 23353 docElem: document.documentElement, 23354 stickyClass: "is-sticky" 23355 }, isSticky = !1; 23356 function setHeight() { 23357 wrapper.style.height = jumpNav.getBoundingClientRect().height + "px"; 23358 } 23359 function initOverflow() { 23360 wrapper.getBoundingClientRect().width < function() { 23361 var width = 0; 23362 return [].forEach.call(jumpNavLinks, function(link) { 23363 width += link.getBoundingClientRect().width; 23364 }), width; 23365 }() ? (0, _heifer.uAddClass)(wrapper, "is-overflowing") : (0, _heifer.uRemoveClass)(wrapper, "is-overflowing"); 23366 } 23367 function stickJumpNav() { 23368 (0, _heifer.uAddClass)(wrapper, settings.stickyClass), isSticky = !0; 23369 } 23370 function unstickJumpNav() { 23371 (0, _heifer.uRemoveClass)(wrapper, settings.stickyClass), isSticky = !1; 23372 } 23373 function toggleStickyClass(sticky) { 23374 var footerPosition = document.querySelector(".js-footer-nav").offsetTop; 23375 window.pageYOffset >= sticky && window.pageYOffset < footerPosition ? wrapper.classList.add("is-sticky") : wrapper.classList.remove("is-sticky"); 23376 } 23377 }, { 23378 "../../../core/utilities/heifer.utilities": 19, 23379 "./../../../core/ui/reveal.es6": 12 23380 } ],
23381 115: [ function(require, module, exports) { 23382 "use strict"; 23383 Object.defineProperty(exports, "__esModule", { 23384 value: !0 23385 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 23386 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 23387 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 23388 require("core-js/modules/es6.object.keys"); 23389 var obj, _hoverintent = (obj = require("hoverintent")) && obj.__esModule ? obj : { 23390 default: obj 23391 }, _heifer = require("../../../core/utilities/heifer.utilities"); 23392 function ownKeys(object, enumerableOnly) { 23393 var keys = Object.keys(object); 23394 if (Object.getOwnPropertySymbols) { 23395 var symbols = Object.getOwnPropertySymbols(object); 23396 enumerableOnly && (symbols = symbols.filter(function(sym) { 23397 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 23398 })), keys.push.apply(keys, symbols); 23399 } 23400 return keys; 23401 } 23402 function _defineProperty(obj, key, value) { 23403 return key in obj ? Object.defineProperty(obj, key, { 23404 value: value, 23405 enumerable: !0, 23406 configurable: !0, 23407 writable: !0 23408 }) : obj[key] = value, obj; 23409 } 23410 function _defineProperties(target, props) { 23411 for (var i = 0; i < props.length; i++) { 23412 var descriptor = props[i]; 23413 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 23414 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 23415 } 23416 } 23417 var LargeCard = function() { 23418 function LargeCard(element, options) { 23419 !function(instance, Constructor) { 23420 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 23421 }(this, LargeCard), this.element = element, this.$element = $(element), this._defaults = {}, 23422 this.settings = function(target) { 23423 for (var i = 1; i < arguments.length; i++) { 23424 var source = null != arguments[i] ? arguments[i] : {}; 23425 i % 2 ? ownKeys(source, !0).forEach(function(key) { 23426 _defineProperty(target, key, source[key]); 23427 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 23428 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 23429 }); 23430 } 23431 return target; 23432 }({}, this._defaults, {}, options), this.init(); 23433 } 23434 return function(Constructor, protoProps, staticProps) { 23435 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 23436 }(LargeCard, [ { 23437 key: "init", 23438 value: function() { 23439 this.cardLink = this.element.querySelector(".js-large-card-link"), this.initHoverState(); 23440 } 23441 }, { 23442 key: "initHoverState", 23443 value: function() { 23444 var self = this; 23445 (0, _hoverintent.default)(this.cardLink, function() { 23446 (0, _heifer.uAddClass)(self.element, "is-hovering"); 23447 }, function() { 23448 (0, _heifer.uRemoveClass)(self.element, "is-hovering"); 23449 }); 23450 } 23451 } ]), LargeCard; 23452 }(); 23453 exports.default = LargeCard; 23454 }, { 23455 "../../../core/utilities/heifer.utilities": 19, 23456 "core-js/modules/es6.array.iterator": 241, 23457 "core-js/modules/es6.object.keys": 250, 23458 "core-js/modules/es6.object.to-string": 252, 23459 "core-js/modules/es6.symbol": 268, 23460 "core-js/modules/es7.object.get-own-property-descriptors": 272, 23461 "core-js/modules/web.dom.iterable": 274, 23462 hoverintent: 281 23463 } ],
23464 116: [ function(require, module, exports) { 23465 "use strict"; 23466 Object.defineProperty(exports, "__esModule", { 23467 value: !0 23468 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 23469 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 23470 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 23471 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.number.constructor"), 23472 require("core-js/modules/es6.function.name"), require("core-js/modules/es6.regexp.split"); 23473 var obj, _leaflet = (obj = require("../../../core/vendor/leaflet")) && obj.__esModule ? obj : { 23474 default: obj 23475 }, _heifer = require("../../../core/utilities/heifer.utilities"); 23476 function ownKeys(object, enumerableOnly) { 23477 var keys = Object.keys(object); 23478 if (Object.getOwnPropertySymbols) { 23479 var symbols = Object.getOwnPropertySymbols(object); 23480 enumerableOnly && (symbols = symbols.filter(function(sym) { 23481 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 23482 })), keys.push.apply(keys, symbols); 23483 } 23484 return keys; 23485 } 23486 function _defineProperty(obj, key, value) { 23487 return key in obj ? Object.defineProperty(obj, key, { 23488 value: value, 23489 enumerable: !0, 23490 configurable: !0, 23491 writable: !0 23492 }) : obj[key] = value, obj; 23493 } 23494 function _defineProperties(target, props) { 23495 for (var i = 0; i < props.length; i++) { 23496 var descriptor = props[i]; 23497 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 23498 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 23499 } 23500 } 23501 require("../../../core/vendor/leaflet.markercluster"); 23502 var icons = { 23503 default: _leaflet.default.icon({ 23504 iconUrl: "/resources/icons/map-marker.svg", 23505 iconSize: [ 24, 24 ] 23506 }) 23507 }, Map = function() { 23508 function Map(element, options) { 23509 !function(instance, Constructor) { 23510 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 23511 }(this, Map), this.element = element, this.$element = $(element), this._defaults = { 23512 lat: 34.745341, 23513 lng: -92.256287, 23514 key: "hvTidrA2liF6B715LEK3", 23515 zoom: 3, 23516 scrollWheelZoom: !1, 23517 classes: { 23518 active: "is-active" 23519 } 23520 }, this.settings = function(target) { 23521 for (var i = 1; i < arguments.length; i++) { 23522 var source = null != arguments[i] ? arguments[i] : {}; 23523 i % 2 ? ownKeys(source, !0).forEach(function(key) { 23524 _defineProperty(target, key, source[key]); 23525 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 23526 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 23527 }); 23528 } 23529 return target; 23530 }({}, this._defaults, {}, options), this.init(); 23531 } 23532 return function(Constructor, protoProps, staticProps) { 23533 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 23534 }(Map, [ { 23535 key: "init", 23536 value: function() { 23537 var _this = this; 23538 this.getMapOptions(), this.mapElement = this.element.querySelector(".js-map-map"), 23539 this.Map = _leaflet.default.map(this.mapElement, { 23540 center: [ this.settings.lat, this.settings.lng ], 23541 zoom: this.settings.zoom, 23542 scrollWheelZoom: this.settings.scrollWheelZoom 23543 }), _leaflet.default.tileLayer("https://api.maptiler.com/maps/3f84dac7-952b-4355-aebb-cf0a11f062d8/{z}/{x}/{y}.png?key=" + this.settings.key, { 23544 tileSize: 512, 23545 zoomOffset: -1, 23546 minZoom: 3, 23547 maxZoom: 15, 23548 attribution: '<a href="https://www.maptiler.com/copyright/" target="_blank">© MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap contributors</a>', 23549 crossOrigin: !0 23550 }).addTo(this.Map); 23551 (0, _heifer.uAjaxWithResponse)("GET", "/resources/js/shared/legoBlocks/map/mapCountries/mapCountries.json").then(function(response) { 23552 return JSON.parse(response); 23553 }).then(function(data) { 23554 var pastData = _this.element.getAttribute("data-past").split(","), past = data.features.filter(function(country) { 23555 return -1 < pastData.indexOf(country.properties.name); 23556 }), currentData = _this.element.getAttribute("data-current").split(","), current = data.features.filter(function(country) { 23557 return -1 < currentData.indexOf(country.properties.name); 23558 }), futureData = _this.element.getAttribute("data-future").split(","), future = data.features.filter(function(country) { 23559 return -1 < futureData.indexOf(country.properties.name); 23560 }); 23561 _leaflet.default.geoJson({ 23562 type: "FeatureCollection", 23563 features: past 23564 }, { 23565 style: { 23566 fillColor: "#397485", 23567 weight: 1, 23568 opacity: 1, 23569 color: "#2b4053", 23570 fillOpacity: 1 23571 } 23572 }).addTo(_this.Map), _leaflet.default.geoJson({ 23573 type: "FeatureCollection", 23574 features: current 23575 }, { 23576 style: { 23577 fillColor: "#7dbec2", 23578 weight: 1, 23579 opacity: 1, 23580 color: "#2b4053", 23581 fillOpacity: 1 23582 } 23583 }).addTo(_this.Map), _leaflet.default.geoJson({ 23584 type: "FeatureCollection", 23585 features: future 23586 }, { 23587 style: { 23588 fillColor: "#254B37", 23589 weight: 1, 23590 opacity: 1, 23591 color: "#2b4053", 23592 fillOpacity: 1 23593 } 23594 }).addTo(_this.Map); 23595 }); 23596 this.buildMapMarkers(); 23597 } 23598 }, { 23599 key: "getMapOptions", 23600 value: function() { 23601 this.element.hasAttribute("data-start-lat") && (this.settings.lat = this.element.dataset.startLat), 23602 this.element.hasAttribute("data-start-lng") && (this.settings.lng = this.element.dataset.startLng), 23603 this.element.hasAttribute("data-zoom") && (this.settings.zoom = this.element.dataset.zoom); 23604 } 23605 }, { 23606 key: "buildMapMarkers", 23607 value: function() { 23608 var _this2 = this; 23609 this.markers = [], this.markerGroup = _leaflet.default.markerClusterGroup({ 23610 maxClusterRadius: 30 23611 }), [].forEach.call(this.element.querySelectorAll(".js-map-location"), function(el) { 23612 var marker = { 23613 detailElement: el, 23614 coords: { 23615 lat: Number(el.getAttribute("data-lat")), 23616 lng: Number(el.getAttribute("data-lng")) 23617 } 23618 }; 23619 marker.marker = _leaflet.default.marker([ marker.coords.lat, marker.coords.lng ], { 23620 icon: icons.default 23621 }), marker.marker.on("click", _this2.handleMarkerClick.bind(_this2, marker)), marker.detailElement.querySelector(".js-map-location-close").addEventListener("click", _this2.closeAllDetails.bind(_this2)), 23622 _this2.markerGroup.addLayer(marker.marker), _this2.markers.push(marker); 23623 }), this.Map.addLayer(this.markerGroup); 23624 } 23625 }, { 23626 key: "handleMarkerClick", 23627 value: function(marker, event) { 23628 this.closeAllDetails(), (0, _heifer.uAddClass)(marker.detailElement, this.settings.classes.active); 23629 } 23630 }, { 23631 key: "closeAllDetails", 23632 value: function() { 23633 var _this3 = this; 23634 [].forEach.call(this.markers, function(m) { 23635 (0, _heifer.uRemoveClass)(m.detailElement, _this3.settings.classes.active); 23636 }); 23637 } 23638 } ]), Map; 23639 }(); 23640 exports.default = Map; 23641 }, {
23642 "../../../core/utilities/heifer.utilities": 19, 23643 "../../../core/vendor/leaflet": 21, 23644 "../../../core/vendor/leaflet.markercluster": 22, 23645 "core-js/modules/es6.array.iterator": 241, 23646 "core-js/modules/es6.function.name": 244, 23647 "core-js/modules/es6.number.constructor": 247, 23648 "core-js/modules/es6.object.keys": 250, 23649 "core-js/modules/es6.object.to-string": 252, 23650 "core-js/modules/es6.regexp.split": 261, 23651 "core-js/modules/es6.symbol": 268, 23652 "core-js/modules/es7.object.get-own-property-descriptors": 272, 23653 "core-js/modules/web.dom.iterable": 274 23654 } ], 23655 117: [ function(require, module, exports) { 23656 "use strict"; 23657 Object.defineProperty(exports, "__esModule", { 23658 value: !0 23659 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 23660 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 23661 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 23662 require("core-js/modules/es6.object.keys"); 23663 var _dynamicResponsiveImages = require("../../../core/images/dynamic-responsive-images"); 23664 function ownKeys(object, enumerableOnly) { 23665 var keys = Object.keys(object); 23666 if (Object.getOwnPropertySymbols) { 23667 var symbols = Object.getOwnPropertySymbols(object); 23668 enumerableOnly && (symbols = symbols.filter(function(sym) { 23669 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 23670 })), keys.push.apply(keys, symbols); 23671 } 23672 return keys; 23673 } 23674 function _defineProperty(obj, key, value) { 23675 return key in obj ? Object.defineProperty(obj, key, { 23676 value: value, 23677 enumerable: !0, 23678 configurable: !0, 23679 writable: !0 23680 }) : obj[key] = value, obj; 23681 } 23682 function _defineProperties(target, props) { 23683 for (var i = 0; i < props.length; i++) { 23684 var descriptor = props[i]; 23685 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 23686 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 23687 } 23688 } 23689 var MapOurWork = function() { 23690 function MapOurWork(elem, options) { 23691 !function(instance, Constructor) { 23692 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 23693 }(this, MapOurWork), this.elem = elem, this.defaults = {}, this.settings = function(target) { 23694 for (var i = 1; i < arguments.length; i++) { 23695 var source = null != arguments[i] ? arguments[i] : {}; 23696 i % 2 ? ownKeys(source, !0).forEach(function(key) { 23697 _defineProperty(target, key, source[key]); 23698 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 23699 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 23700 }); 23701 } 23702 return target; 23703 }({}, this.default, { 23704 options: options 23705 }), this.init(); 23706 } 23707 return function(Constructor, protoProps, staticProps) { 23708 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 23709 }(MapOurWork, [ { 23710 key: "init", 23711 value: function() { 23712 this.countrySelect = this.elem.querySelector("select"), this.countrySelect.addEventListener("change", function(e) { 23713 var current = e.target.value, currentCountry = document.getElementById(current), country = document.querySelector(".mapOurWork__country.is-active"); 23714 if (null != country && (country.classList.remove("is-visible"), setTimeout(function() { 23715 country.classList.remove("is-active"); 23716 }, 100)), null != currentCountry) { 23717 currentCountry.classList.add("is-active"), setTimeout(function() { 23718 currentCountry.classList.add("is-visible"); 23719 }, 100); 23720 var img = currentCountry.querySelector("img.js-lazyload-image"); 23721 img && (0, _dynamicResponsiveImages.loadDynamicImage)(img); 23722 } 23723 }); 23724 } 23725 } ]), MapOurWork; 23726 }(); 23727 exports.default = MapOurWork; 23728 }, {
23729 "../../../core/images/dynamic-responsive-images": 2, 23730 "core-js/modules/es6.array.iterator": 241, 23731 "core-js/modules/es6.object.keys": 250, 23732 "core-js/modules/es6.object.to-string": 252, 23733 "core-js/modules/es6.symbol": 268, 23734 "core-js/modules/es7.object.get-own-property-descriptors": 272, 23735 "core-js/modules/web.dom.iterable": 274 23736 } ], 23737 118: [ function(require, module, exports) { 23738 "use strict"; 23739 Object.defineProperty(exports, "__esModule", { 23740 value: !0 23741 }), exports.default = function() { 23742 [].slice.call(document.querySelectorAll("[data-shorthand]")).forEach(function(embed) { 23743 var url = embed.getAttribute("data-shorthand"); 23744 -1 === url.indexOf("http") && (function(name) { 23745 throw new Error('"' + name + '" is read-only'); 23746 }("url"), url = "https://" + url); 23747 var script = document.createElement("script"); 23748 script.src = url.replace(/\/?$/, "/embed.js"), embed.parentElement.insertBefore(script, embed), 23749 script.addEventListener("load", function() { 23750 return window.setTimeout(function() { 23751 document.getElementById("load-screen").style.display = "none"; 23752 }, 2500); 23753 }); 23754 }); 23755 }, require("core-js/modules/es6.regexp.replace"); 23756 }, { 23757 "core-js/modules/es6.regexp.replace": 259 23758 } ], 23759 119: [ function(require, module, exports) { 23760 "use strict"; 23761 Object.defineProperty(exports, "__esModule", { 23762 value: !0 23763 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 23764 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 23765 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 23766 require("core-js/modules/es6.object.keys"); 23767 var obj, _heifer = require("../../../core/utilities/heifer.utilities"), _animateNumber = (obj = require("../../animateNumber/animateNumber")) && obj.__esModule ? obj : { 23768 default: obj 23769 }; 23770 function ownKeys(object, enumerableOnly) { 23771 var keys = Object.keys(object); 23772 if (Object.getOwnPropertySymbols) { 23773 var symbols = Object.getOwnPropertySymbols(object); 23774 enumerableOnly && (symbols = symbols.filter(function(sym) { 23775 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 23776 })), keys.push.apply(keys, symbols); 23777 } 23778 return keys; 23779 } 23780 function _defineProperty(obj, key, value) { 23781 return key in obj ? Object.defineProperty(obj, key, { 23782 value: value, 23783 enumerable: !0, 23784 configurable: !0, 23785 writable: !0 23786 }) : obj[key] = value, obj; 23787 } 23788 function _defineProperties(target, props) { 23789 for (var i = 0; i < props.length; i++) { 23790 var descriptor = props[i]; 23791 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 23792 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 23793 } 23794 } 23795 var StatsGallery = function() { 23796 function StatsGallery(element, options) { 23797 !function(instance, Constructor) { 23798 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 23799 }(this, StatsGallery), this.element = element, this.$element = $(element); 23800 var defaults = {}; 23801 this._defaults = defaults, this.settings = function(target) { 23802 for (var i = 1; i < arguments.length; i++) { 23803 var source = null != arguments[i] ? arguments[i] : {}; 23804 i % 2 ? ownKeys(source, !0).forEach(function(key) { 23805 _defineProperty(target, key, source[key]); 23806 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 23807 Object.defineProperty(target, key, Ob
23807ject.getOwnPropertyDescriptor(source, key)); 23808 }); 23809 } 23810 return target; 23811 }({}, defaults, {}, options), this.init(); 23812 } 23813 return function(Constructor, protoProps, staticProps) { 23814 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 23815 }(StatsGallery, [ { 23816 key: "init", 23817 value: function() { 23818 this.scrollPosition = (0, _heifer.uGetScrollPosition)(), this.number = this.element.querySelectorAll(".js-animated-statsGallery-number"), 23819 this.hasAnimated = !1, this.hasReset = !1; 23820 requestAnimationFrame(this.handleScroll.bind(this)); 23821 this.resetNum(); 23822 } 23823 }, { 23824 key: "resetNum", 23825 value: function() { 23826 this.number.forEach(function(number) { 23827 number.style.width = number.dataset.width + "px", number.textContent = number.dataset.numStart; 23828 }); 23829 } 23830 }, { 23831 key: "handleScroll", 23832 value: function() { 23833 var _this = this, newScrollPos = (0, _heifer.uGetScrollPosition)(); 23834 newScrollPos >= (0, _heifer.uGetCoords)(this.element).top - .75 * window.innerHeight && requestAnimationFrame(function() { 23835 _this.hasAnimated || _this.initAnimateNumber(), _this.hasAnimated = !0; 23836 }), this.scrollPosition = newScrollPos; 23837 requestAnimationFrame(this.handleScroll.bind(this)); 23838 } 23839 }, { 23840 key: "initAnimateNumber", 23841 value: function() { 23842 this.number.forEach(function(number) { 23843 var numberStart = number.dataset.numStart, numberEnd = number.dataset.numEnd; 23844 return number.dataset.width = number.getBoundingClientRect().width, new _animateNumber.default(number, { 23845 startAmount: numberStart, 23846 endAmount: numberEnd, 23847 duration: 500 23848 }); 23849 }); 23850 } 23851 } ]), StatsGallery; 23852 }(); 23853 exports.default = StatsGallery; 23854 }, {
23855 "../../../core/utilities/heifer.utilities": 19, 23856 "../../animateNumber/animateNumber": 64, 23857 "core-js/modules/es6.array.iterator": 241, 23858 "core-js/modules/es6.object.keys": 250, 23859 "core-js/modules/es6.object.to-string": 252, 23860 "core-js/modules/es6.symbol": 268, 23861 "core-js/modules/es7.object.get-own-property-descriptors": 272, 23862 "core-js/modules/web.dom.iterable": 274 23863 } ], 23864 120: [ function(require, module, exports) { 23865 "use strict"; 23866 Object.defineProperty(exports, "__esModule", { 23867 value: !0 23868 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 23869 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 23870 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 23871 require("core-js/modules/es6.object.keys"); 23872 var _jquery = _interopRequireDefault(require("jquery")), _heifer = _interopRequireDefault(require("../../../core/ui/heifer.carousel")), _heifer2 = require("../../../core/utilities/heifer.utilities"); 23873 function _interopRequireDefault(obj) { 23874 return obj && obj.__esModule ? obj : { 23875 default: obj 23876 }; 23877 } 23878 function ownKeys(object, enumerableOnly) { 23879 var keys = Object.keys(object); 23880 if (Object.getOwnPropertySymbols) { 23881 var symbols = Object.getOwnPropertySymbols(object); 23882 enumerableOnly && (symbols = symbols.filter(function(sym) { 23883 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 23884 })), keys.push.apply(keys, symbols); 23885 } 23886 return keys; 23887 } 23888 function _defineProperty(obj, key, value) { 23889 return key in obj ? Object.defineProperty(obj, key, { 23890 value: value, 23891 enumerable: !0, 23892 configurable: !0, 23893 writable: !0 23894 }) : obj[key] = value, obj; 23895 } 23896 function _defineProperties(target, props) { 23897 for (var i = 0; i < props.length; i++) { 23898 var descriptor = props[i]; 23899 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 23900 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 23901 } 23902 } 23903 var StoryCarousel = function() { 23904 function StoryCarousel(element, options) { 23905 !function(instance, Constructor) { 23906 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 23907 }(this, StoryCarousel), this.element = element, this.$element = (0, _jquery.default)(this.element), 23908 this._defaults = {}, this.settings = function(target) { 23909 for (var i = 1; i < arguments.length; i++) { 23910 var source = null != arguments[i] ? arguments[i] : {}; 23911 i % 2 ? ownKeys(source, !0).forEach(function(key) { 23912 _defineProperty(target, key, source[key]); 23913 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 23914 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 23915 }); 23916 } 23917 return target; 23918 }({}, this._defaults, {}, options), this.init(); 23919 } 23920 return function(Constructor, protoProps, staticProps) { 23921 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 23922 }(StoryCarousel, [ { 23923 key: "init", 23924 value: function() { 23925 var _this = this; 23926 this.currentSlide = this.element.querySelector(".js-story-carousel-current"), this.carousel = new _heifer.default(this.element, { 23927 start: this.element.dataset.startingSlide, 23928 visibleSlides: { 23929 0: 1, 23930 480: 1, 23931 768: 1 23932 }, 23933 onSlide: function() { 23934 0 === _this.carousel.state.current ? [].forEach.call(_this.carousel.prevButtons, function(button) { 23935 _this.hideButton(button); 23936 }) : 0 === _this.carousel.state.next ? [].forEach.call(_this.carousel.nextButtons, function(button) { 23937 _this.hideButton(button); 23938 }) : ([].forEach.call(_this.carousel.nextButtons, function(button) { 23939 _this.showButton(button); 23940 }), [].forEach.call(_this.carousel.prevButtons, function(button) { 23941 _this.showButton(button); 23942 })); 23943 } 23944 }); 23945 } 23946 }, { 23947 key: "updateSlideCounter", 23948 value: function(current) { 23949 this.currentSlide.textContent = current; 23950 } 23951 }, { 23952 key: "hideButton", 23953 value: function(button) { 23954 (0, _heifer2.uAddClass)(button, "is-hidden"); 23955 } 23956 }, { 23957 key: "showButton", 23958 value: function(button) { 23959 (0, _heifer2.uRemoveClass)(button, "is-hidden"); 23960 } 23961 } ]), StoryCarousel; 23962 }(); 23963 exports.default = StoryCarousel; 23964 }, {
23965 "../../../core/ui/heifer.carousel": 7, 23966 "../../../core/utilities/heifer.utilities": 19, 23967 "core-js/modules/es6.array.iterator": 241, 23968 "core-js/modules/es6.object.keys": 250, 23969 "core-js/modules/es6.object.to-string": 252, 23970 "core-js/modules/es6.symbol": 268, 23971 "core-js/modules/es7.object.get-own-property-descriptors": 272, 23972 "core-js/modules/web.dom.iterable": 274, 23973 jquery: 20 23974 } ], 23975 121: [ function(require, module, exports) { 23976 "use strict"; 23977 Object.defineProperty(exports, "__esModule", { 23978 value: !0 23979 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 23980 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 23981 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 23982 require("core-js/modules/es6.object.keys"); 23983 var _heifer = require("../../../../core/utilities/heifer.utilities"); 23984 function ownKeys(object, enumerableOnly) { 23985 var keys = Object.keys(object); 23986 if (Object.getOwnPropertySymbols) { 23987 var symbols = Object.getOwnPropertySymbols(object); 23988 enumerableOnly && (symbols = symbols.filter(function(sym) { 23989 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 23990 })), keys.push.apply(keys, symbols); 23991 } 23992 return keys; 23993 } 23994 function _defineProperty(obj, key, value) { 23995 return key in obj ? Object.defineProperty(obj, key, { 23996 value: value, 23997 enumerable: !0, 23998 configurable: !0, 23999 writable: !0 24000 }) : obj[key] = value, obj; 24001 } 24002 function _defineProperties(target, props) { 24003 for (var i = 0; i < props.length; i++) { 24004 var descriptor = props[i]; 24005 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 24006 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 24007 } 24008 } 24009 var SubscriptionHeader = function() { 24010 function SubscriptionHeader(element, options) { 24011 !function(instance, Constructor) { 24012 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 24013 }(this, SubscriptionHeader), this.element = element, this.$element = $(element); 24014 var defaults = {}; 24015 this._defaults = defaults, this.settings = function(target) { 24016 for (var i = 1; i < arguments.length; i++) { 24017 var source = null != arguments[i] ? arguments[i] : {}; 24018 i % 2 ? ownKeys(source, !0).forEach(function(key) { 24019 _defineProperty(target, key, source[key]); 24020 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 24021 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 24022 }); 24023 } 24024 return target; 24025 }({}, defaults, {}, options), this.init(); 24026 } 24027 return function(Constructor, protoProps, staticProps) { 24028 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 24029 }(SubscriptionHeader, [ { 24030 key: "init", 24031 value: function() { 24032 this.sticky = this.element.querySelector(".js-subscription-header-sticky"), this.jumpBtn = this.element.querySelector(".js-subscription-header-sticky-cta"), 24033 this.jumpBtn && (this.jumpTarget = document.querySelector(this.jumpBtn.getAttribute("href"))), 24034 this.scrollPosition = _heifer.uGetScrollPosition, this.scrollTrigger = requestAnimationFrame(this.handleScroll.bind(this)), 24035 this.jumpTarget && (this.getJumpTargetPos = (0, _heifer.uGetCoords)(this.jumpTarget).top - this.sticky.offsetHeight); 24036 } 24037 }, { 24038 key: "handleScroll", 24039 value: function() { 24040 var _this = this, newScrollPos = (0, _heifer.uGetScrollPosition)(); 24041 newScrollPos > this.getHeaderPos() && newScrollPos < this.getJumpTargetPos && ((0, 24042 _heifer.uHasClass)(this.element, "sticky-on") || requestAnimationFrame(function() { 24043 (0, _heifer.uAddClass)(_this.element, "sticky-on"), (0, _heifer.uRemoveClass)(_this.element, "sticky-off"); 24044 })), (newScrollPos < this.getHeaderPos() || newScrollPos >= this.getJumpTargetPos) && (0, 24045 _heifer.uHasClass)(this.element, "sticky-on") && requestAnimationFrame(function() { 24046 (0, _heifer.uRemoveClass)(_this.element, "sticky-on"), (0, _heifer.uAddClass)(_this.element, "sticky-off"); 24047 }), this.scrollPosition = newScrollPos; 24048 requestAnimationFrame(this.handleScroll.bind(this)); 24049 } 24050 }, { 24051 key: "getHeaderPos", 24052 value: function() { 24053 return (0, _heifer.uGetCoords)(this.element).bottom; 24054 } 24055 } ]), SubscriptionHeader; 24056 }(); 24057 exports.default = SubscriptionHeader; 24058 }, {
24059 "../../../../core/utilities/heifer.utilities": 19, 24060 "core-js/modules/es6.array.iterator": 241, 24061 "core-js/modules/es6.object.keys": 250, 24062 "core-js/modules/es6.object.to-string": 252, 24063 "core-js/modules/es6.symbol": 268, 24064 "core-js/modules/es7.object.get-own-property-descriptors": 272, 24065 "core-js/modules/web.dom.iterable": 274 24066 } ], 24067 122: [ function(require, module, exports) { 24068 "use strict"; 24069 Object.defineProperty(exports, "__esModule", { 24070 value: !0 24071 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 24072 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 24073 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 24074 require("core-js/modules/es6.object.keys"); 24075 var _jquery = _interopRequireDefault(require("jquery")), _heifer = _interopRequireDefault(require("./../../../../../core/ui/heifer.carousel")); 24076 function _interopRequireDefault(obj) { 24077 return obj && obj.__esModule ? obj : { 24078 default: obj 24079 }; 24080 } 24081 function ownKeys(object, enumerableOnly) { 24082 var keys = Object.keys(object); 24083 if (Object.getOwnPropertySymbols) { 24084 var symbols = Object.getOwnPropertySymbols(object); 24085 enumerableOnly && (symbols = symbols.filter(function(sym) { 24086 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 24087 })), keys.push.apply(keys, symbols); 24088 } 24089 return keys; 24090 } 24091 function _defineProperty(obj, key, value) { 24092 return key in obj ? Object.defineProperty(obj, key, { 24093 value: value, 24094 enumerable: !0, 24095 configurable: !0, 24096 writable: !0 24097 }) : obj[key] = value, obj; 24098 } 24099 function _defineProperties(target, props) { 24100 for (var i = 0; i < props.length; i++) { 24101 var descriptor = props[i]; 24102 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 24103 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 24104 } 24105 } 24106 var SuggestionsSlider = function() { 24107 function SuggestionsSlider(element, options) { 24108 !function(instance, Constructor) { 24109 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 24110 }(this, SuggestionsSlider), this.element = element, this.$element = (0, _jquery.default)(this.element), 24111 this._defaults = {}, this.settings = function(target) { 24112 for (var i = 1; i < arguments.length; i++) { 24113 var source = null != arguments[i] ? arguments[i] : {}; 24114 i % 2 ? ownKeys(source, !0).forEach(function(key) { 24115 _defineProperty(target, key, source[key]); 24116 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 24117 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 24118 }); 24119 } 24120 return target; 24121 }({}, this._defaults, {}, options), this.init(); 24122 } 24123 return function(Constructor, protoProps, staticProps) { 24124 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 24125 }(SuggestionsSlider, [ { 24126 key: "init", 24127 value: function() { 24128 this.carousel = new _heifer.default(this.element, { 24129 visibleSlides: { 24130 0: 1, 24131 480: 2, 24132 768: 3 24133 } 24134 }); 24135 } 24136 } ]), SuggestionsSlider; 24137 }(); 24138 exports.default = SuggestionsSlider; 24139 }, {
24140 "./../../../../../core/ui/heifer.carousel": 7, 24141 "core-js/modules/es6.array.iterator": 241, 24142 "core-js/modules/es6.object.keys": 250, 24143 "core-js/modules/es6.object.to-string": 252, 24144 "core-js/modules/es6.symbol": 268, 24145 "core-js/modules/es7.object.get-own-property-descriptors": 272, 24146 "core-js/modules/web.dom.iterable": 274, 24147 jquery: 20 24148 } ], 24149 123: [ function(require, module, exports) { 24150 "use strict"; 24151 Object.defineProperty(exports, "__esModule", { 24152 value: !0 24153 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 24154 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 24155 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 24156 require("core-js/modules/es6.object.keys"); 24157 require("../../../core/utilities/heifer.utilities"); 24158 function ownKeys(object, enumerableOnly) { 24159 var keys = Object.keys(object); 24160 if (Object.getOwnPropertySymbols) { 24161 var symbols = Object.getOwnPropertySymbols(object); 24162 enumerableOnly && (symbols = symbols.filter(function(sym) { 24163 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 24164 })), keys.push.apply(keys, symbols); 24165 } 24166 return keys; 24167 } 24168 function _defineProperty(obj, key, value) { 24169 return key in obj ? Object.defineProperty(obj, key, { 24170 value: value, 24171 enumerable: !0, 24172 configurable: !0, 24173 writable: !0 24174 }) : obj[key] = value, obj; 24175 } 24176 function _defineProperties(target, props) { 24177 for (var i = 0; i < props.length; i++) { 24178 var descriptor = props[i]; 24179 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 24180 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 24181 } 24182 } 24183 var Video = function() { 24184 function Video(element, options) { 24185 !function(instance, Constructor) { 24186 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 24187 }(this, Video), this.element = element, this.$element = $(element); 24188 var defaults = {}; 24189 this._defaults = defaults, this.settings = function(target) { 24190 for (var i = 1; i < arguments.length; i++) { 24191 var source = null != arguments[i] ? arguments[i] : {}; 24192 i % 2 ? ownKeys(source, !0).forEach(function(key) { 24193 _defineProperty(target, key, source[key]); 24194 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 24195 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 24196 }); 24197 } 24198 return target; 24199 }({}, defaults, {}, options), this.init(); 24200 } 24201 return function(Constructor, protoProps, staticProps) { 24202 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 24203 }(Video, [ { 24204 key: "init", 24205 value: function() {} 24206 }, { 24207 key: "handleClick", 24208 value: function() {} 24209 } ]), Video; 24210 }(); 24211 exports.default = Video; 24212 }, { 24213 "../../../core/utilities/heifer.utilities": 19, 24214 "core-js/modules/es6.array.iterator": 241, 24215 "core-js/modules/es6.object.keys": 250, 24216 "core-js/modules/es6.object.to-string": 252, 24217 "core-js/modules/es6.symbol": 268, 24218 "core-js/modules/es7.object.get-own-property-descriptors": 272, 24219 "core-js/modules/web.dom.iterable": 274 24220 } ],
24221 124: [ function(require, module, exports) { 24222 "use strict"; 24223 function _defineProperties(target, props) { 24224 for (var i = 0; i < props.length; i++) { 24225 var descriptor = props[i]; 24226 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 24227 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 24228 } 24229 } 24230 Object.defineProperty(exports, "__esModule", { 24231 value: !0 24232 }), exports.default = void 0; 24233 var VideoHeader = function() { 24234 function VideoHeader(element) { 24235 !function(instance, Constructor) { 24236 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 24237 }(this, VideoHeader), this.element = element, this.$element = $(element), this.video = this.element.querySelector("video"), 24238 this.control = this.element.querySelector("button"), this.setEventListener(); 24239 } 24240 return function(Constructor, protoProps, staticProps) { 24241 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 24242 }(VideoHeader, [ { 24243 key: "setEventListener", 24244 value: function() { 24245 var _this = this; 24246 this.control.addEventListener("click", function(ev) { 24247 switch (_this.control.ariaLabel) { 24248 case "play": 24249 _this.video.play(), _this.control.ariaLabel = "pause"; 24250 break; 24251 24252 case "pause": 24253 _this.video.pause(), _this.control.ariaLabel = "play"; 24254 } 24255 }); 24256 } 24257 } ]), VideoHeader; 24258 }(); 24259 exports.default = VideoHeader; 24260 }, {} ], 24261 125: [ function(require, module, exports) { 24262 "use strict"; 24263 Object.defineProperty(exports, "__esModule", { 24264 value: !0 24265 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 24266 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 24267 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 24268 require("core-js/modules/es6.object.keys"); 24269 var obj, _reveal = (obj = require("../../../core/ui/reveal.es6")) && obj.__esModule ? obj : { 24270 default: obj 24271 }; 24272 require("../../../core/utilities/heifer.utilities"); 24273 function ownKeys(object, enumerableOnly) { 24274 var keys = Object.keys(object); 24275 if (Object.getOwnPropertySymbols) { 24276 var symbols = Object.getOwnPropertySymbols(object); 24277 enumerableOnly && (symbols = symbols.filter(function(sym) { 24278 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 24279 })), keys.push.apply(keys, symbols); 24280 } 24281 return keys; 24282 } 24283 function _defineProperty(obj, key, value) { 24284 return key in obj ? Object.defineProperty(obj, key, { 24285 value: value, 24286 enumerable: !0, 24287 configurable: !0, 24288 writable: !0 24289 }) : obj[key] = value, obj; 24290 } 24291 function _defineProperties(target, props) { 24292 for (var i = 0; i < props.length; i++) { 24293 var descriptor = props[i]; 24294 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 24295 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 24296 } 24297 } 24298 var VideoModal = function() { 24299 function VideoModal(element, options) { 24300 !function(instance, Constructor) { 24301 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 24302 }(this, VideoModal), this.element = element, this.$element = $(element); 24303 var defaults = {}; 24304 this._defaults = defaults, this.settings = function(target) { 24305 for (var i = 1; i < arguments.length; i++) { 24306 var source = null != arguments[i] ? arguments[i] : {};
24307 i % 2 ? ownKeys(source, !0).forEach(function(key) { 24308 _defineProperty(target, key, source[key]); 24309 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 24310 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 24311 }); 24312 } 24313 return target; 24314 }({}, defaults, {}, options), this.init(); 24315 } 24316 return function(Constructor, protoProps, staticProps) { 24317 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 24318 }(VideoModal, [ { 24319 key: "init", 24320 value: function() { 24321 var _this = this, scope = this; 24322 scope.modals = document.querySelectorAll(".js-video__modal-target"); 24323 var triggers = this.element.querySelectorAll(".js-video__trigger"); 24324 new _reveal.default(triggers, { 24325 type: "exclusive", 24326 activeClass: "is-revealed", 24327 visitedClass: "was-revealed", 24328 onShow: function() { 24329 [].forEach.call(this.reference.targets[0].querySelectorAll(".js-video__iframe"), function(iframe) { 24330 var iframeSrc = iframe.dataset.videosrc; 24331 iframe.src || iframe.setAttribute("src", iframeSrc); 24332 }); 24333 }, 24334 onHide: function() { 24335 [].forEach.call(this.reference.targets[0].querySelectorAll(".js-video__iframe"), function(iframe) { 24336 iframe.removeAttribute("src"); 24337 }); 24338 } 24339 }), window.addEventListener("keydown", function(event) { 24340 27 == event.which && scope.modals.forEach(function(el) { 24341 el.classList.contains("is-revealed") && el.querySelector(".videoModal__target--close").click(); 24342 }), 9 == event.which && scope.modals.forEach(function(el) { 24343 el.classList.contains("is-revealed") && (document.activeElement.classList.contains("js-video__trigger") || document.activeElement.classList.contains("videoModal__target--close") || document.activeElement.classList.contains("js-video__iframe") || _this.element.querySelector(".js-video__trigger").focus()); 24344 }); 24345 }); 24346 } 24347 } ]), VideoModal; 24348 }(); 24349 exports.default = VideoModal; 24350 }, { 24351 "../../../core/ui/reveal.es6": 12, 24352 "../../../core/utilities/heifer.utilities": 19, 24353 "core-js/modules/es6.array.iterator": 241, 24354 "core-js/modules/es6.object.keys": 250, 24355 "core-js/modules/es6.object.to-string": 252, 24356 "core-js/modules/es6.symbol": 268, 24357 "core-js/modules/es7.object.get-own-property-descriptors": 272, 24358 "core-js/modules/web.dom.iterable": 274 24359 } ], 24360 126: [ function(require, module, exports) { 24361 "use strict"; 24362 Object.defineProperty(exports, "__esModule", { 24363 value: !0 24364 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 24365 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 24366 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 24367 require("core-js/modules/es6.object.keys"); 24368 var obj, _checkout = require("./../../../core/utilities/checkout.utilities"), _heifer = require("../../../core/utilities/heifer.utilities"), _submitButton = (obj = require("./../../../shared/forms/submitButton/submitButton")) && obj.__esModule ? obj : { 24369 default: obj 24370 }; 24371 function ownKeys(object, enumerableOnly) { 24372 var keys = Object.keys(object); 24373 if (Object.getOwnPropertySymbols) { 24374 var symbols = Object.getOwnPropertySymbols(object); 24375 enumerableOnly && (symbols = symbols.filter(function(sym) { 24376 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 24377 })), keys.push.apply(keys, symbols); 24378 } 24379 return keys; 24380 } 24381 function _defineProperty(obj, key, value) { 24382 return key in obj ? Object.defineProperty(obj, key, { 24383 value: value, 24384 enumerable: !0, 24385 configurable: !0, 24386 writable: !0 24387 }) : obj[key] = value, obj; 24388 } 24389 function _defineProperties(target, props) { 24390 for (var i = 0; i < props.length; i++) { 24391 var descriptor = props[i]; 24392 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 24393 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 24394 } 24395 } 24396 var MiniCartSuggested = function() { 24397 function MiniCartSuggested(element, options) { 24398 !function(instance, Constructor) { 24399 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 24400 }(this, MiniCartSuggested), this.element = element, this.$element = $(element); 24401 var defaults = {}; 24402 this._defaults = defaults, this.settings = function(target) { 24403 for (var i = 1; i < arguments.length; i++) { 24404 var source = null != arguments[i] ? arguments[i] : {};
24405 i % 2 ? ownKeys(source, !0).forEach(function(key) { 24406 _defineProperty(target, key, source[key]); 24407 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 24408 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 24409 }); 24410 } 24411 return target; 24412 }({}, defaults, {}, options), this.init(); 24413 } 24414 return function(Constructor, protoProps, staticProps) { 24415 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 24416 }(MiniCartSuggested, [ { 24417 key: "init", 24418 value: function() { 24419 var _this = this; 24420 this.quickAddButton = this.element.querySelector(".js-mini-cart-quick-add"), this.product = this.element.querySelector(".js-mini-cart-product-item"), 24421 this.submitButton = new _submitButton.default(this.quickAddButton, { 24422 trigger: "click" 24423 }), this.quickAddButton.addEventListener("click", function() { 24424 _this.addToBasket(_this.product); 24425 }); 24426 } 24427 }, { 24428 key: "addToBasket", 24429 value: function(product) { 24430 var _this2 = this, productData = JSON.parse(product.value); 24431 (0, _checkout.onCartAdd)(productData); 24432 (0, _heifer.uAjaxWithResponse)("POST", _checkout.CART_ADD_PRODUCT_URL, !0, (0, _heifer.uJsonToQueryString)(productData), "application/x-www-form-urlencoded; charset=UTF-8").then(function(response) { 24433 _this2.disableButton(); 24434 var itemCount = (response = JSON.parse(response)).response.body.cart.userCart.cartItemCount; 24435 _this2.basketBadge = window.document.querySelector(".js-basket-badge"), _this2.basketBadge.textContent = itemCount; 24436 }).catch(function(error) { 24437 alert(error), _this2.submitButton.reset(); 24438 }); 24439 } 24440 }, { 24441 key: "disableButton", 24442 value: function() { 24443 this.quickAddButton.querySelector(".js-mini-cart-quick-add-text").textContent = "Added to Cart", 24444 this.quickAddButton.disabled = !0, this.submitButton.removeLoadingStyles(); 24445 } 24446 } ]), MiniCartSuggested; 24447 }(); 24448 exports.default = MiniCartSuggested; 24449 }, { 24450 "../../../core/utilities/heifer.utilities": 19, 24451 "./../../../core/utilities/checkout.utilities": 15, 24452 "./../../../shared/forms/submitButton/submitButton": 88, 24453 "core-js/modules/es6.array.iterator": 241, 24454 "core-js/modules/es6.object.keys": 250, 24455 "core-js/modules/es6.object.to-string": 252, 24456 "core-js/modules/es6.symbol": 268, 24457 "core-js/modules/es7.object.get-own-property-descriptors": 272, 24458 "core-js/modules/web.dom.iterable": 274 24459 } ], 24460 127: [ function(require, module, exports) { 24461 "use strict"; 24462 Object.defineProperty(exports, "__esModule", { 24463 value: !0 24464 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 24465 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 24466 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 24467 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.string.link"); 24468 var obj, _miniCartSuggested = (obj = require("./miniCartSuggested/miniCartSuggested")) && obj.__esModule ? obj : { 24469 default: obj 24470 }, _heifer = require("./../../core/utilities/heifer.utilities"), _gtm = require("../../core/utilities/gtm.utilities"), _dynamicResponsiveImages = require("../../core/images/dynamic-responsive-images"); 24471 function ownKeys(object, enumerableOnly) { 24472 var keys = Object.keys(object); 24473 if (Object.getOwnPropertySymbols) { 24474 var symbols = Object.getOwnPropertySymbols(object); 24475 enumerableOnly && (symbols = symbols.filter(function(sym) { 24476 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 24477 })), keys.push.apply(keys, symbols); 24478 } 24479 return keys; 24480 } 24481 function _defineProperty(obj, key, value) { 24482 return key in obj ? Object.defineProperty(obj, key, { 24483 value: value, 24484 enumerable: !0, 24485 configurable: !0, 24486 writable: !0 24487 }) : obj[key] = value, obj; 24488 } 24489 function _defineProperties(target, props) { 24490 for (var i = 0; i < props.length; i++) { 24491 var descriptor = props[i]; 24492 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 24493 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 24494 } 24495 } 24496 var MiniCart = function() { 24497 function MiniCart(element, options) { 24498 !function(instance, Constructor) { 24499 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 24500 }(this, MiniCart), this.element = element, this.$element = $(element); 24501 var defaults = {}; 24502 this._defaults = defaults, this.settings = function(target) { 24503 for (var i = 1; i < arguments.length; i++) { 24504 var source = null != arguments[i] ? arguments[i] : {};
24505 i % 2 ? ownKeys(source, !0).forEach(function(key) { 24506 _defineProperty(target, key, source[key]); 24507 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 24508 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 24509 }); 24510 } 24511 return target; 24512 }({}, defaults, {}, options), this.init(); 24513 } 24514 return function(Constructor, protoProps, staticProps) { 24515 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 24516 }(MiniCart, [ { 24517 key: "init", 24518 value: function() { 24519 var _this = this; 24520 this.closes = document.querySelectorAll(".js-mini-cart-close"), this.suggestedProducts = this.element.querySelectorAll(".js-mini-cart-suggested"), 24521 document.body.classList.add("minicart-open"), [].forEach.call(this.closes, function(el) { 24522 el.addEventListener("click", function() { 24523 _this.closeMiniCart(); 24524 }); 24525 }), [].forEach.call(this.element.querySelectorAll(".js-minicart__image"), function(img) { 24526 (0, _dynamicResponsiveImages.loadDynamicImage)(img); 24527 }), this.suggestedProducts && [].forEach.call(this.suggestedProducts, function(el) { 24528 new _miniCartSuggested.default(el); 24529 }), [].forEach.call(document.querySelectorAll(".js-gtm-push-mini-cart-link"), function(el) { 24530 el.addEventListener("click", function() { 24531 var gtmData = JSON.parse(el.dataset.link); 24532 (0, _gtm.pushMiniCartLink)(gtmData); 24533 }); 24534 }); 24535 } 24536 }, { 24537 key: "closeMiniCart", 24538 value: function() { 24539 (0, _heifer.uRemoveClass)(this.element, "is-active"), (0, _heifer.uStartPageScrollable)(), 24540 document.body.classList.remove("minicart-open"); 24541 } 24542 } ]), MiniCart; 24543 }(); 24544 exports.default = MiniCart; 24545 }, { 24546 "../../core/images/dynamic-responsive-images": 2, 24547 "../../core/utilities/gtm.utilities": 16, 24548 "./../../core/utilities/heifer.utilities": 19, 24549 "./miniCartSuggested/miniCartSuggested": 126, 24550 "core-js/modules/es6.array.iterator": 241, 24551 "core-js/modules/es6.object.keys": 250, 24552 "core-js/modules/es6.object.to-string": 252, 24553 "core-js/modules/es6.string.link": 266, 24554 "core-js/modules/es6.symbol": 268, 24555 "core-js/modules/es7.object.get-own-property-descriptors": 272, 24556 "core-js/modules/web.dom.iterable": 274 24557 } ], 24558 128: [ function(require, module, exports) { 24559 "use strict"; 24560 Object.defineProperty(exports, "__esModule", { 24561 value: !0 24562 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 24563 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 24564 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 24565 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.regexp.split"), 24566 require("core-js/modules/es6.array.find"); 24567 var obj, _heifer = require("../../core/utilities/heifer.utilities"), _submitButton = (obj = require("./../../shared/forms/submitButton/submitButton")) && obj.__esModule ? obj : { 24568 default: obj 24569 }; 24570 function ownKeys(object, enumerableOnly) { 24571 var keys = Object.keys(object); 24572 if (Object.getOwnPropertySymbols) { 24573 var symbols = Object.getOwnPropertySymbols(object); 24574 enumerableOnly && (symbols = symbols.filter(function(sym) { 24575 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 24576 })), keys.push.apply(keys, symbols); 24577 } 24578 return keys; 24579 } 24580 function _defineProperty(obj, key, value) { 24581 return key in obj ? Object.defineProperty(obj, key, { 24582 value: value, 24583 enumerable: !0, 24584 configurable: !0, 24585 writable: !0 24586 }) : obj[key] = value, obj; 24587 } 24588 function _defineProperties(target, props) { 24589 for (var i = 0; i < props.length; i++) { 24590 var descriptor = props[i]; 24591 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 24592 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 24593 } 24594 } 24595 var NewsletterSignup = function() { 24596 function NewsletterSignup(element, options) { 24597 !function(instance, Constructor) { 24598 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 24599 }(this, NewsletterSignup), this.element = element, this.$element = $(element); 24600 var defaults = {}; 24601 this._defaults = defaults, this.settings = function(target) { 24602 for (var i = 1; i < arguments.length; i++) { 24603 var source = null != arguments[i] ? arguments[i] : {};
24604 i % 2 ? ownKeys(source, !0).forEach(function(key) { 24605 _defineProperty(target, key, source[key]); 24606 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 24607 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 24608 }); 24609 } 24610 return target; 24611 }({}, defaults, {}, options), this.init(element), this.submitButton = new _submitButton.default(this.element.querySelector(".js-newsletter-submit")); 24612 } 24613 return function(Constructor, protoProps, staticProps) { 24614 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 24615 }(NewsletterSignup, [ { 24616 key: "init", 24617 value: function(element) { 24618 var _this = this; 24619 (0, _heifer.uAddEventListener)(this.element, "submit", function(ev) { 24620 ev.preventDefault(); 24621 var fullName = _this.$element.find('input[name="fullName"]').val() ? _this.$element.find('input[name="fullName"]').val() : "", firstName = fullName ? fullName.split(" ")[0] : "", lastName = fullName ? fullName.split(" ").slice(1).join(" ") : ""; 24622 firstName = firstName || (void 0 !== _this.$element.find('input[name="firstName"]').val() ? _this.$element.find('input[name="firstName"]').val() : ""), 24623 lastName = lastName || (void 0 !== _this.$element.find('input[name="lastName"]').val() ? _this.$element.find('input[name="lastName"]').val() : ""); 24624 var bsdEnabledEle = _this.$element.find('input[name="bsdEnabled"]'), bsdEnabled = "checkbox" == bsdEnabledEle.attr("type") ? bsdEnabledEle[0].checked ? bsdEnabledEle.val() : "false" : bsdEnabledEle.val(), mailchimpEnabledEle = _this.$element.find('input[name="mailchimpEnabled"]'), mailchimpEnabled = "checkbox" == mailchimpEnabledEle.attr("type") ? mailchimpEnabledEle[0].checked ? mailchimpEnabledEle.val() : "false" : mailchimpEnabledEle.val(), klaviyoEnabledEle = _this.$element.find('input[name="klaviyoEnabled"]'), klaviyoEnabled = "checkbox" == klaviyoEnabledEle.attr("type") ? klaviyoEnabledEle[0].checked ? klaviyoEnabledEle.val() : "false" : klaviyoEnabledEle.val(), formData = { 24625 firstName: firstName, 24626 lastName: lastName, 24627 email: _this.$element.find('input[name="email"]').val(), 24628 zip: _this.$element.find('input[name="zip"]').val(), 24629 formSource: _this.$element.find('input[name="formSource"]').val(), 24630 bsdEnabled: bsdEnabled, 24631 bsdGroupId: _this.$element.find('input[name="bsdGroupId"]').val(), 24632 mailchimpEnabled: mailchimpEnabled, 24633 mailchimpListId: _this.$element.find('input[name="mailchimpListId"]').val(), 24634 klaviyoEnabled: klaviyoEnabled, 24635 klaviyoListId: _this.$element.find('input[name="klaviyoListId"]').val() 24636 }; 24637 (0, _heifer.uAjaxWithResponse)("POST", "/newsletter-signup.html", !0, (0, _heifer.uJsonToQueryString)(formData), "application/x-www-form-urlencoded; charset=UTF-8").then(function(response) { 24638 var responseObject = JSON.parse(response); 24639 responseObject.body.email.sfmccreateSub.success || responseObject.body.email.mailchimpEmailSignup.success || responseObject.body.email.klaviyoEmailSignup.success ? _this.$element.parent().find(".newsletter-message").addClass("has-success").text("Success! You are signed up for the newsletter.") : _this.$element.parent().find(".newsletter-message").addClass("has-error").text("Sorry, There was a problem with our request. Please try again later."), 24640 _this.submitButton.element && _this.submitButton.reset(); 24641 }); 24642 }); 24643 } 24644 } ]), NewsletterSignup; 24645 }(); 24646 exports.default = NewsletterSignup; 24647 }, {
24648 "../../core/utilities/heifer.utilities": 19, 24649 "./../../shared/forms/submitButton/submitButton": 88, 24650 "core-js/modules/es6.array.find": 239, 24651 "core-js/modules/es6.array.iterator": 241, 24652 "core-js/modules/es6.object.keys": 250, 24653 "core-js/modules/es6.object.to-string": 252, 24654 "core-js/modules/es6.regexp.split": 261, 24655 "core-js/modules/es6.symbol": 268, 24656 "core-js/modules/es7.object.get-own-property-descriptors": 272, 24657 "core-js/modules/web.dom.iterable": 274 24658 } ], 24659 129: [ function(require, module, exports) { 24660 "use strict"; 24661 Object.defineProperty(exports, "__esModule", { 24662 value: !0 24663 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 24664 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 24665 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 24666 require("core-js/modules/es6.object.keys"); 24667 var _jquery = _interopRequireDefault(require("jquery")), _reveal = _interopRequireDefault(require("./../../core/ui/reveal.es6")), _dynamicResponsiveImages = require("../../core/images/dynamic-responsive-images"), _heifer = require("../../core/utilities/heifer.utilities"); 24668 function _interopRequireDefault(obj) { 24669 return obj && obj.__esModule ? obj : { 24670 default: obj 24671 }; 24672 } 24673 function ownKeys(object, enumerableOnly) { 24674 var keys = Object.keys(object); 24675 if (Object.getOwnPropertySymbols) { 24676 var symbols = Object.getOwnPropertySymbols(object); 24677 enumerableOnly && (symbols = symbols.filter(function(sym) { 24678 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 24679 })), keys.push.apply(keys, symbols); 24680 } 24681 return keys; 24682 } 24683 function _defineProperty(obj, key, value) { 24684 return key in obj ? Object.defineProperty(obj, key, { 24685 value: value, 24686 enumerable: !0, 24687 configurable: !0, 24688 writable: !0 24689 }) : obj[key] = value, obj; 24690 } 24691 function _defineProperties(target, props) { 24692 for (var i = 0; i < props.length; i++) { 24693 var descriptor = props[i]; 24694 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 24695 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 24696 } 24697 } 24698 var TabsForm = function() { 24699 function TabsForm(element, options) { 24700 !function(instance, Constructor) { 24701 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 24702 }(this, TabsForm), this.element = element, this.$element = (0, _jquery.default)(element); 24703 var defaults = {}; 24704 this._defaults = defaults, this.settings = function(target) { 24705 for (var i = 1; i < arguments.length; i++) { 24706 var source = null != arguments[i] ? arguments[i] : {}; 24707 i % 2 ? ownKeys(source, !0).forEach(function(key) { 24708 _defineProperty(target, key, source[key]); 24709 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 24710 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 24711 }); 24712 } 24713 return target; 24714 }({}, defaults, {}, options), this.reveal = this.init(); 24715 } 24716 return function(Constructor, protoProps, staticProps) { 24717 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 24718 }(TabsForm, [ { 24719 key: "init", 24720 value: function() { 24721 return this.initReveal(); 24722 } 24723 }, { 24724 key: "initReveal", 24725 value: function() { 24726 var self = this; 24727 return new _reveal.default(".js-reveal-tab-form", { 24728 type: "radio", 24729 activeClass: "is-active", 24730 visitedClass: "was-active", 24731 onInit: function(trigger, getTargets) { 24732 var targets = getTargets(); 24733 "function" == typeof self.settings.onInit && self.settings.onInit.call(this, trigger, targets); 24734 }, 24735 onShow: function(trigger, getTargets) { 24736 var targets = getTargets(); 24737 trigger.setAttribute("aria-selected", "true"), [].forEach.call(targets, function(target) { 24738 target.setAttribute("aria-expanded", "true"), target.removeAttribute("aria-hidden"); 24739 var child = target.querySelector('input[name="giftCardOtherAmount"]'); 24740 child ? child.removeAttribute("disabled") : (0, _jquery.default)(window).trigger("update-product-amount"); 24741 var images = target.querySelectorAll("img"); 24742 images.length && [].forEach.call(images, function(img) { 24743 (0, _heifer.uHasClass)(img, "js-lazyload-image") && !(0, _heifer.uHasClass)(img, "lazyloaded") && (0, 24744 _dynamicResponsiveImages.loadDynamicImage)(img); 24745 }); 24746 }), "function" == typeof self.settings.onShow && self.settings.onShow.call(this, trigger, targets); 24747 }, 24748 onHide: function(trigger, getTargets) { 24749 var targets = getTargets(); 24750 trigger.removeAttribute("aria-selected", "true"), [].forEach.call(targets, function(target) { 24751 target.removeAttribute("aria-expanded"), target.setAttribute("aria-hidden", "true"); 24752 var child = target.querySelector('input[name="giftCardOtherAmount"]'); 24753 child && (child.setAttribute("disabled", ""), child.value = "", (0, _jquery.default)(window).trigger("update-product-amount")); 24754 }), "function" == typeof self.settings.onHide && self.settings.onHide.call(this, trigger, targets); 24755 } 24756 }); 24757 } 24758 } ]), TabsForm; 24759 }(); 24760 exports.default = TabsForm; 24761 }, {
24762 "../../core/images/dynamic-responsive-images": 2, 24763 "../../core/utilities/heifer.utilities": 19, 24764 "./../../core/ui/reveal.es6": 12, 24765 "core-js/modules/es6.array.iterator": 241, 24766 "core-js/modules/es6.object.keys": 250, 24767 "core-js/modules/es6.object.to-string": 252, 24768 "core-js/modules/es6.symbol": 268, 24769 "core-js/modules/es7.object.get-own-property-descriptors": 272, 24770 "core-js/modules/web.dom.iterable": 274, 24771 jquery: 20 24772 } ], 24773 130: [ function(require, module, exports) { 24774 "use strict"; 24775 Object.defineProperty(exports, "__esModule", { 24776 value: !0 24777 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 24778 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 24779 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 24780 require("core-js/modules/es6.object.keys"); 24781 var _jquery = _interopRequireDefault(require("jquery")), _reveal = _interopRequireDefault(require("./../../core/ui/reveal.es6")), _dynamicResponsiveImages = require("../../core/images/dynamic-responsive-images"), _heifer = require("../../core/utilities/heifer.utilities"); 24782 function _interopRequireDefault(obj) { 24783 return obj && obj.__esModule ? obj : { 24784 default: obj 24785 }; 24786 } 24787 function ownKeys(object, enumerableOnly) { 24788 var keys = Object.keys(object); 24789 if (Object.getOwnPropertySymbols) { 24790 var symbols = Object.getOwnPropertySymbols(object); 24791 enumerableOnly && (symbols = symbols.filter(function(sym) { 24792 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 24793 })), keys.push.apply(keys, symbols); 24794 } 24795 return keys; 24796 } 24797 function _defineProperty(obj, key, value) { 24798 return key in obj ? Object.defineProperty(obj, key, { 24799 value: value, 24800 enumerable: !0, 24801 configurable: !0, 24802 writable: !0 24803 }) : obj[key] = value, obj; 24804 } 24805 function _defineProperties(target, props) { 24806 for (var i = 0; i < props.length; i++) { 24807 var descriptor = props[i]; 24808 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 24809 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 24810 } 24811 } 24812 var Tabs = function() { 24813 function Tabs(element, options) { 24814 !function(instance, Constructor) { 24815 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 24816 }(this, Tabs), this.element = element, this.$element = (0, _jquery.default)(element); 24817 var defaults = {}; 24818 this._defaults = defaults, this.settings = function(target) { 24819 for (var i = 1; i < arguments.length; i++) { 24820 var source = null != arguments[i] ? arguments[i] : {}; 24821 i % 2 ? ownKeys(source, !0).forEach(function(key) { 24822 _defineProperty(target, key, source[key]); 24823 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 24824 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 24825 }); 24826 } 24827 return target; 24828 }({}, defaults, {}, options), this.reveal = this.init(); 24829 } 24830 return function(Constructor, protoProps, staticProps) { 24831 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 24832 }(Tabs, [ { 24833 key: "init", 24834 value: function() { 24835 return this.initReveal(); 24836 } 24837 }, { 24838 key: "initReveal", 24839 value: function() { 24840 var self = this; 24841 return new _reveal.default(".js-reveal-tab", { 24842 type: "radio", 24843 activeClass: "is-active", 24844 visitedClass: "was-active", 24845 onInit: function(trigger, getTargets) { 24846 var targets = getTargets(); 24847 "function" == typeof self.settings.onInit && self.settings.onInit.call(this, trigger, targets); 24848 }, 24849 onShow: function(trigger, getTargets) { 24850 var targets = getTargets(); 24851 trigger.setAttribute("aria-selected", "true"), [].forEach.call(targets, function(target) { 24852 target.setAttribute("aria-expanded", "true"), target.removeAttribute("aria-hidden"); 24853 var images = target.querySelectorAll("img"); 24854 images.length && [].forEach.call(images, function(img) { 24855 (0, _heifer.uHasClass)(img, "js-lazyload-image") && !(0, _heifer.uHasClass)(img, "lazyloaded") && (0, 24856 _dynamicResponsiveImages.loadDynamicImage)(img); 24857 }); 24858 }), "function" == typeof self.settings.onShow && self.settings.onShow.call(this, trigger, targets); 24859 }, 24860 onHide: function(trigger, getTargets) { 24861 var targets = getTargets(); 24862 trigger.removeAttribute("aria-selected", "true"), [].forEach.call(targets, function(target) { 24863 target.removeAttribute("aria-expanded"), target.setAttribute("aria-hidden", "true"); 24864 }), "function" == typeof self.settings.onHide && self.settings.onHide.call(this, trigger, targets); 24865 } 24866 }); 24867 } 24868 } ]), Tabs; 24869 }(); 24870 exports.default = Tabs; 24871 }, {
24872 "../../core/images/dynamic-responsive-images": 2, 24873 "../../core/utilities/heifer.utilities": 19, 24874 "./../../core/ui/reveal.es6": 12, 24875 "core-js/modules/es6.array.iterator": 241, 24876 "core-js/modules/es6.object.keys": 250, 24877 "core-js/modules/es6.object.to-string": 252, 24878 "core-js/modules/es6.symbol": 268, 24879 "core-js/modules/es7.object.get-own-property-descriptors": 272, 24880 "core-js/modules/web.dom.iterable": 274, 24881 jquery: 20 24882 } ], 24883 131: [ function(require, module, exports) { 24884 "use strict"; 24885 Object.defineProperty(exports, "__esModule", { 24886 value: !0 24887 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 24888 require("core-js/modules/es6.symbol"), require("core-js/modules/web.dom.iterable"), 24889 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 24890 require("core-js/modules/es6.object.keys"), require("core-js/modules/es6.array.find"); 24891 var _heifer = require("../../core/utilities/heifer.utilities"); 24892 function ownKeys(object, enumerableOnly) { 24893 var keys = Object.keys(object); 24894 if (Object.getOwnPropertySymbols) { 24895 var symbols = Object.getOwnPropertySymbols(object); 24896 enumerableOnly && (symbols = symbols.filter(function(sym) { 24897 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 24898 })), keys.push.apply(keys, symbols); 24899 } 24900 return keys; 24901 } 24902 function _defineProperty(obj, key, value) { 24903 return key in obj ? Object.defineProperty(obj, key, { 24904 value: value, 24905 enumerable: !0, 24906 configurable: !0, 24907 writable: !0 24908 }) : obj[key] = value, obj; 24909 } 24910 function _defineProperties(target, props) { 24911 for (var i = 0; i < props.length; i++) { 24912 var descriptor = props[i]; 24913 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 24914 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 24915 } 24916 } 24917 var ThankYouNote = function() { 24918 function ThankYouNote(element, options) { 24919 !function(instance, Constructor) { 24920 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 24921 }(this, ThankYouNote), this.element = element, this.$element = $(element); 24922 var defaults = {}; 24923 this._defaults = defaults, this.settings = function(target) { 24924 for (var i = 1; i < arguments.length; i++) { 24925 var source = null != arguments[i] ? arguments[i] : {}; 24926 i % 2 ? ownKeys(source, !0).forEach(function(key) { 24927 _defineProperty(target, key, source[key]); 24928 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 24929 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 24930 }); 24931 } 24932 return target; 24933 }({}, defaults, {}, options), this.init(element); 24934 } 24935 return function(Constructor, protoProps, staticProps) { 24936 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 24937 }(ThankYouNote, [ { 24938 key: "init", 24939 value: function(element) { 24940 var _this = this; 24941 (0, _heifer.uAddEventListener)(this.$element.find("button")[0], "click", function(ev) { 24942 ev.preventDefault(); 24943 var name = _this.$element.find('input[name="name"]').val(), message = _this.$element.find('textarea[name="message"]').val(), orderId = _this.$element.find('input[name="orderId"]').val(), guid = _this.$element.find('input[name="guid"]').val(), formData = {}, url = ""; 24944 url = guid ? (formData = { 24945 name: name, 24946 message: message, 24947 guid: guid 24948 }
24948, "/gift-catalog/honor-cards/thankYou.html") : (formData = { 24949 name: name, 24950 message: message, 24951 orderId: orderId 24952 }, "/cart/thank-you.html"); 24953 (0, _heifer.uAjaxWithResponse)("POST", url, !0, (0, _heifer.uJsonToQueryString)(formData), "application/x-www-form-urlencoded; charset=UTF-8").then(function(response) { 24954 JSON.parse(response).success ? _this.$element.find(".thankYou-message").text("Your note was sent") : _this.$element.find(".thankYou-message").text("Sorry, There was a problem with our request. Please try again later."); 24955 }); 24956 }); 24957 } 24958 } ]), ThankYouNote; 24959 }(); 24960 exports.default = ThankYouNote; 24961 }, { 24962 "../../core/utilities/heifer.utilities": 19, 24963 "core-js/modules/es6.array.find": 239, 24964 "core-js/modules/es6.array.iterator": 241, 24965 "core-js/modules/es6.object.keys": 250, 24966 "core-js/modules/es6.object.to-string": 252, 24967 "core-js/modules/es6.symbol": 268, 24968 "core-js/modules/es7.object.get-own-property-descriptors": 272, 24969 "core-js/modules/web.dom.iterable": 274 24970 } ], 24971 132: [ function(require, module, exports) { 24972 "use strict"; 24973 Object.defineProperty(exports, "__esModule", { 24974 value: !0 24975 }), exports.default = void 0, require("core-js/modules/es7.object.get-own-property-descriptors"), 24976 require("core-js/modules/es6.symbol"), require("core-js/modules/es6.object.keys"), 24977 require("core-js/modules/es6.typed.uint8-array"), require("core-js/modules/es6.regexp.to-string"), 24978 require("core-js/modules/es6.date.to-string"), require("core-js/modules/es6.regexp.replace"), 24979 require("core-js/modules/es6.promise"), require("core-js/modules/web.dom.iterable"), 24980 require("core-js/modules/es6.array.iterator"), require("core-js/modules/es6.object.to-string"), 24981 require("core-js/modules/es6.string.iterator"); 24982 var _heifer = require("../../core/utilities/heifer.utilities"), _gtm = require("../../core/utilities/gtm.utilities"), _checkout = require("../../core/utilities/checkout.utilities"); 24983 function ownKeys(object, enumerableOnly) { 24984 var keys = Object.keys(object); 24985 if (Object.getOwnPropertySymbols) { 24986 var symbols = Object.getOwnPropertySymbols(object); 24987 enumerableOnly && (symbols = symbols.filter(function(sym) { 24988 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 24989 })), keys.push.apply(keys, symbols); 24990 } 24991 return keys; 24992 } 24993 function _defineProperty(obj, key, value) { 24994 return key in obj ? Object.defineProperty(obj, key, { 24995 value: value, 24996 enumerable: !0, 24997 configurable: !0, 24998 writable: !0 24999 }) : obj[key] = value, obj; 25000 } 25001 function _defineProperties(target, props) { 25002 for (var i = 0; i < props.length; i++) { 25003 var descriptor = props[i]; 25004 descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, 25005 "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); 25006 } 25007 } 25008 var UpsellModal = function() { 25009 function UpsellModal(element, options) { 25010 !function(instance, Constructor) { 25011 if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); 25012 }(this, UpsellModal), this.element = element; 25013 var defaults = { 25014 modalForm: "#modalForm", 25015 modalErrors: "#modalErrors", 25016 modalProcessing: "#modalProcessing", 25017 modalConfirmation: "#modalConfirmation", 25018 closeButton: ".upsellModal__close", 25019 noThanksButton: ".upsellModal__no-thanks", 25020 form: "form", 25021 formStates: ".upsellModal__state", 25022 confirmationNumber: ".js-cart-confirmation-number", 25023 email: ".js-donor-email", 25024 subtotal: ".js-subtotal", 25025 total: ".js-total", 25026 firstName: ".js-first-name", 25027 lastName: ".js-last-name", 25028 address: ".js-address", 25029 addressCountry: ".js-address-country", 25030 creditCardType: ".js-credit-card-type", 25031 creditCardLastFour: ".js-credit-card-last-four" 25032 }; 25033 this._defaults = defaults, this.settings = function(target) { 25034 for (var i = 1; i < arguments.length; i++) { 25035 var source = null != arguments[i] ? arguments[i] : {};
25036 i % 2 ? ownKeys(source, !0).forEach(function(key) { 25037 _defineProperty(target, key, source[key]); 25038 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) { 25039 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 25040 }); 25041 } 25042 return target; 25043 }({}, defaults, {}, options), this.processing = !1, this.formConfirmation = this.element.querySelector(this.settings.modalConfirmation), 25044 this.formErrors = this.element.querySelector(this.settings.modalErrors), this.formProcessing = this.element.querySelector(this.settings.modalProcessing), 25045 this.modal = this.element, this.modalCloseButton = this.element.querySelector(this.settings.closeButton), 25046 this.modalNoThanksButton = this.element.querySelector(this.settings.noThanksButton), 25047 this.form = this.element.querySelector(this.settings.form), this.formStates = this.element.querySelectorAll(this.settings.formStates), 25048 this.confirmationNumber = this.formConfirmation.querySelector(this.settings.confirmationNumber), 25049 this.email = this.formConfirmation.querySelector(this.settings.email), this.subtotal = this.formConfirmation.querySelector(this.settings.subtotal), 25050 this.total = this.formConfirmation.querySelector(this.settings.total), this.firstName = this.formConfirmation.querySelector(this.settings.firstName), 25051 this.lastName = this.formConfirmation.querySelector(this.settings.lastName), this.address = this.formConfirmation.querySelector(this.settings.address), 25052 this.addressCountry = this.formConfirmation.querySelector(this.settings.addressCountry), 25053 this.creditCardType = this.formConfirmation.querySelector(this.settings.creditCardType), 25054 this.creditCardLastFour = this.formConfirmation.querySelector(this.settings.creditCardLastFour), 25055 this.bindEvents(); 25056 } 25057 return function(Constructor, protoProps, staticProps) { 25058 protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps); 25059 }(UpsellModal, [ { 25060 key: "loadBlackBaudScripts", 25061 value: function() { 25062 var scripts = []; 25063 return scripts.push((0, _heifer.uLoadJSPromise)("https://payments.blackbaud.com/Checkout/bbCheckout.2.0.js", { 25064 "data-ot-ignore": "" 25065 })), Promise.all(scripts); 25066 } 25067 }, { 25068 key: "passBlackbaudData", 25069 value: function(configurationData, form) { 25070 var formData = new window.FormData(form), cartTotal = (0, _checkout.getCartTotals)(formData, !1, !1).total; 25071 cartTotal = String(cartTotal); 25072 var formFields = (0, _checkout.getBillingAddressFromData)(formData), cardHolder = (formFields.address1, 25073 formFields.firstName + " " + formFields.lastName); 25074 Blackbaud_OpenStoreCardForm({ 25075 cardholder: cardHolder, 25076 key: configurationData.key, 25077 card_token: configurationData.card_token 25078 }); 25079 } 25080 }, { 25081 key: "updateTextContent", 25082 value: function(element, text) { 25083 element.textContent = text; 25084 } 25085 }, { 25086 key: "updateReceipt", 25087 value: function(order) { 25088 var address = "".concat(order.address_street.replace(/\\n
25088/g, " ").trim(), ", ").concat(order.address_city, ", ").concat(order.address_region, ", ").concat(order.address_postcode); 25089 this.updateTextContent(this.confirmationNumber, order.id), this.updateTextContent(this.email, order.address_email), 25090 this.updateTextContent(this.subtotal, order.order_base_sub_total), this.updateTextContent(this.total, order.order_base_grand_total), 25091 this.updateTextContent(this.firstName, order.address_firstname), this.updateTextContent(this.lastName, order.address_lastname), 25092 this.updateTextContent(this.address, address), this.updateTextContent(this.addressCountry, order.address_country_id), 25093 this.updateTextContent(this.creditCardType, order.credit_card_type), this.updateTextContent(this.creditCardLastFour, order.credit_card_last4); 25094 } 25095 }, { 25096 key: "showStep", 25097 value: function(stepElement) { 25098 this.formStates.forEach(function(step) { 25099 (0, _heifer.uRemoveClass)(step, "active"); 25100 }), (0, _heifer.uAddClass)(stepElement, "active"); 25101 } 25102 }, { 25103 key: "showCloseButton", 25104 value: function(btn, show) { 25105 show ? (0, _heifer.uAddClass)(btn, "active") : (0, _heifer.uRemoveClass)(btn, "active"); 25106 } 25107 }, { 25108 key: "doBlackbaudCheckout", 25109 value: function(event, configurationData) { 25110 var _this = this, formData = new window.FormData(this.form), formFields = (0, _checkout.getBillingAddressFromData)(formData); 25111 this.processing = !0, this.showStep(this.formProcessing), this.showCloseButton(this.modalCloseButton, !1), 25112 this.showCloseButton(this.modalNoThanksButton, !1), this.modal.showModal(), (0, 25113 _checkout.submitOrder)(formData, { 25114 type: "Blackbaud", 25115 nonce: "blackbaud", 25116 blackbaudToken: event.detail.transactionToken, 25117 details: { 25118 email: formFields.email, 25119 firstName: formFields.firstName, 25120 lastName: formFields.lastName, 25121 phone: formFields.phone, 25122 phone_opt_in: formFields.phone_opt_in, 25123 last: "", 25124 card_token: configurationData.card_token, 25125 billingAddress: { 25126 line1: formFields.address1, 25127 line2: "", 25128 city: formFields.city, 25129 state: formFields.state, 25130 postalCode: formFields.zip, 25131 countryCode: formFields.country 25132 } 25133 } 25134 }).then(function(response) { 25135 var order = response.body.cart.order; 25136 _this.updateReceipt(order), _this.processing = !1, _this.showCloseButton(_this.modalCloseButton, !0), 25137 _this.showStep(_this.formConfirmation), _this.modal.showModal(); 25138 }).catch(function(error) { 25139 _this.processing = !1, _this.showStep(_this.formErrors), _this.modal.showModal(); 25140 }); 25141 } 25142 }, { 25143 key: "initBlackbaud", 25144 value: function() { 25145 var _this2 = this, environment = window.Heifer.environment, configurationData = { 25146 key: window.Heifer.blackbaudPublicKey, 25147 payment_configuration_id: "production" === environment ? window.Heifer.blackbaudPaymentConfigurationId : "0868d976-b51e-4d46-8fbf-141687131636", 25148 transaction_type: "card_not_present", 25149 card_token: null != crypto.randomUUID ? crypto.randomUUID() : ([ 1e7 ] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function(c) { 25150 return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16); 25151 }), 25152 use_visa_checkout: !1, 25153 note: "heifer.org", 25154 primary_color: "#2B4053", 25155 font_family: "montserrat" 25156 }; 25157 Blackbaud_Init(configurationData), document.addEventListener("checkoutReady", function(event) {}), 25158 window.addEventListener("blackbaudFlow", function() { 25159 _this2.passBlackbaudData(configurationData, _this2.form); 25160 }), document.addEventListener("checkoutComplete", function(event) {
25161 _this2.doBlackbaudCheckout(event, configurationData); 25162 }), document.addEventListener("checkoutError", function(event) {}), document.addEventListener("checkoutCancel", function(event) {}); 25163 } 25164 }, { 25165 key: "bindEvents", 25166 value: function() { 25167 var _this3 = this; 25168 this.form.addEventListener("submit", function(e) { 25169 e.preventDefault(), _this3.modal.close(), window.dispatchEvent(new Event("blackbaudFlow")); 25170 }), this.modalCloseButton.addEventListener("click", function() { 25171 _this3.modal.close(); 25172 }), this.modalNoThanksButton.addEventListener("click", function() { 25173 _this3.modal.close(); 25174 }), document.addEventListener("keydown", function(e) { 25175 "Escape" === e.key && _this3.modal.close(); 25176 }), window.addEventListener("load", function() { 25177 setTimeout(function() { 25178 (0, _gtm.pushGTMEvent)("ShowUpsellModal", "1"), _this3.modal.showModal(), _this3.loadBlackBaudScripts().then(_this3.initBlackbaud.bind(_this3)); 25179 }, 1e3); 25180 }); 25181 } 25182 } ]), UpsellModal; 25183 }(); 25184 exports.default = UpsellModal; 25185 }, { 25186 "../../core/utilities/checkout.utilities": 15, 25187 "../../core/utilities/gtm.utilities": 16, 25188 "../../core/utilities/heifer.utilities": 19, 25189 "core-js/modules/es6.array.iterator": 241, 25190 "core-js/modules/es6.date.to-string": 243, 25191 "core-js/modules/es6.object.keys": 250, 25192 "core-js/modules/es6.object.to-string": 252, 25193 "core-js/modules/es6.promise": 253, 25194 "core-js/modules/es6.regexp.replace": 259, 25195 "core-js/modules/es6.regexp.to-string": 262, 25196 "core-js/modules/es6.string.iterator": 265, 25197 "core-js/modules/es6.symbol": 268, 25198 "core-js/modules/es6.typed.uint8-array": 269, 25199 "core-js/modules/es7.object.get-own-property-descriptors": 272, 25200 "core-js/modules/web.dom.iterable": 274 25201 } ], 25202 133: [ function(require, module, exports) { 25203 "use strict"; 25204 Object.defineProperty(exports, "__esModule", { 25205 value: !0 25206 }), exports.default = void 0, require("core-js/modules/es6.regexp.constructor"), 25207 require("core-js/modules/es6.regexp.split"), require("core-js/modules/es6.regexp.to-string"), 25208 require("core-js/modules/es6.date.to-string"), require("core-js/modules/es6.object.to-string"), 25209 require("core-js/modules/es6.regexp.match"); 25210 var obj, _jquery = (obj = require("jquery")) && obj.__esModule ? obj : { 25211 default: obj 25212 }; 25213 var TRANSITION_END = "transitionend"; 25214 function transitionEndEmulator(duration) { 25215 var _this = this, called = !1; 25216 return (0, _jquery.default)(this).one(Util.TRANSITION_END, function() { 25217 called = !0; 25218 }), setTimeout(function() { 25219 called || Util.triggerTransitionEnd(_this); 25220 }, duration), this; 25221 } 25222 var Util = { 25223 TRANSITION_END: "bsTransitionEnd", 25224 getUID: function(prefix) { 25225 for (;prefix += ~~(1e6 * Math.random()), document.getElementById(prefix); ) ; 25226 return prefix; 25227 }, 25228 getSelectorFromElement: function(element) { 25229 var selector = element.getAttribute("data-target"); 25230 if (!selector || "#" === selector) { 25231 var hrefAttr = element.getAttribute("href"); 25232 selector = hrefAttr && "#" !== hrefAttr ? hrefAttr.trim() : ""; 25233 } 25234 try { 25235 return document.querySelector(selector) ? selector : null; 25236 } catch (err) { 25237 return null; 25238 } 25239 }, 25240 getTransitionDurationFromElement: function(element) { 25241 if (!element) return 0; 25242 var transitionDuration = (0, _jquery.default)(element).css("transition-duration"), transitionDelay = (0, 25243 _jquery.default)(element).css("transition-delay"), floatTransitionDuration = parseFloat(transitionDuration), floatTransitionDelay = parseFloat(transitionDelay); 25244 return floatTransitionDuration || floatTransitionDelay ? (transitionDuration = transitionDuration.split(",")[0], 25245 transitionDelay = transitionDelay.split(",")[0], 1e3 * (parseFloat(transitionDuration) + parseFloat(transitionDelay))) : 0; 25246 }, 25247 reflow: function(element) { 25248 return element.offsetHeight; 25249 }, 25250 triggerTransitionEnd: function(element) { 25251 (0, _jquery.default)(element).trigger(TRANSITION_END); 25252 }, 25253 supportsTransitionEnd: function() { 25254 return Boolean(TRANSITION_END); 25255 }, 25256 isElement: function(obj) { 25257 return (obj[0] || obj).nodeType; 25258 }, 25259 typeCheckConfig: function(componentName, config, configTypes) { 25260 for (var property in configTypes) if (Object.prototype.hasOwnProperty.call(configTypes, property)) { 25261 var expectedTypes = configTypes[property], value = config[property], valueType = value && Util.isElement(value) ? "element" : (obj = value, 25262 {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase()); 25263 if (!new RegExp(expectedTypes).test(valueType)) throw new Error("".concat(componentName.toUpperCase(), ": ") + 'Option "'.concat(property, '" provided type "').concat(valueType, '" ') + 'but expected type "'.concat(expectedTypes, '".')); 25264 } 25265 var obj; 25266 }, 25267 findShadowRoot: function(element) { 25268 if (!document.documentElement.attachShadow) return null; 25269 if ("function" != typeof element.getRootNode) return element instanceof ShadowRoot ? element : element.parentNode ? Util.findShadowRoot(element.parentNode) : null; 25270 var root = element.getRootNode(); 25271 return root instanceof ShadowRoot ? root : null; 25272 } 25273 }; 25274 _jquery.default.fn.emulateTransitionEnd = transitionEndEmulator, _jquery.default.event.special[Util.TRANSITION_END] = { 25275 bindType: TRANSITION_END, 25276 delegateType: TRANSITION_END, 25277 handle: function(event) { 25278 if ((0, _jquery.default)(event.target).is(this)) return event.handleObj.handler.apply(this, arguments); 25279 } 25280 }; 25281 var _default = Util; 25282 exports.default = _default; 25283 }, {
25284 "core-js/modules/es6.date.to-string": 243, 25285 "core-js/modules/es6.object.to-string": 252, 25286 "core-js/modules/es6.regexp.constructor": 255, 25287 "core-js/modules/es6.regexp.match": 258, 25288 "core-js/modules/es6.regexp.split": 261, 25289 "core-js/modules/es6.regexp.to-string": 262, 25290 jquery: 282 25291 } ], 25292 134: [ function(require, module, exports) { 25293 module.exports = function(it) { 25294 if ("function" != typeof it) throw TypeError(it + " is not a function!"); 25295 return it; 25296 }; 25297 }, {} ], 25298 135: [ function(require, module, exports) { 25299 var UNSCOPABLES = require("./_wks")("unscopables"), ArrayProto = Array.prototype; 25300 null == ArrayProto[UNSCOPABLES] && require("./_hide")(ArrayProto, UNSCOPABLES, {}), 25301 module.exports = function(key) { 25302 ArrayProto[UNSCOPABLES][key] = !0; 25303 }; 25304 }, { 25305 "./_hide": 164, 25306 "./_wks": 236 25307 } ], 25308 136: [ function(require, module, exports) { 25309 "use strict"; 25310 var at = require("./_string-at")(!0); 25311 module.exports = function(S, index, unicode) { 25312 return index + (unicode ? at(S, index).length : 1); 25313 }; 25314 }, { 25315 "./_string-at": 215 25316 } ], 25317 137: [ function(require, module, exports) { 25318 module.exports = function(it, Constructor, name, forbiddenField) { 25319 if (!(it instanceof Constructor) || void 0 !== forbiddenField && forbiddenField in it) throw TypeError(name + ": incorrect invocation!"); 25320 return it; 25321 }; 25322 }, {} ], 25323 138: [ function(require, module, exports) { 25324 var isObject = require("./_is-object"); 25325 module.exports = function(it) { 25326 if (!isObject(it)) throw TypeError(it + " is not an object!"); 25327 return it; 25328 }; 25329 }, { 25330 "./_is-object": 172 25331 } ], 25332 139: [ function(require, module, exports) { 25333 "use strict"; 25334 var toObject = require("./_to-object"), toAbsoluteIndex = require("./_to-absolute-index"), toLength = require("./_to-length"); 25335 module.exports = [].copyWithin || function(target, start, argument_2) { 25336 var O = toObject(this), len = toLength(O.length), to = toAbsoluteIndex(target, len), from = toAbsoluteIndex(start, len), end = 2 < arguments.length ? argument_2 : void 0, count = Math.min((void 0 === end ? len : toAbsoluteIndex(end, len)) - from, len - to), inc = 1; 25337 for (from < to && to < from + count && (inc = -1, from += count - 1, to += count - 1); 0 < count--; ) from in O ? O[to] = O[from] : delete O[to], 25338 to += inc, from += inc; 25339 return O; 25340 }; 25341 }, { 25342 "./_to-absolute-index": 222, 25343 "./_to-length": 226, 25344 "./_to-object": 227 25345 } ], 25346 140: [ function(require, module, exports) { 25347 "use strict"; 25348 var toObject = require("./_to-object"), toAbsoluteIndex = require("./_to-absolute-index"), toLength = require("./_to-length"); 25349 module.exports = function(value, argument_1, argument_2) { 25350 for (var O = toObject(this), length = toLength(O.length), aLen = arguments.length, index = toAbsoluteIndex(1 < aLen ? argument_1 : void 0, length), end = 2 < aLen ? argument_2 : void 0, endPos = void 0 === end ? length : toAbsoluteIndex(end, length); index < endPos; ) O[index++] = value; 25351 return O; 25352 }; 25353 }, { 25354 "./_to-absolute-index": 222, 25355 "./_to-length": 226, 25356 "./_to-object": 227 25357 } ], 25358 141: [ function(require, module, exports) { 25359 var toIObject = require("./_to-iobject"), toLength = require("./_to-length"), toAbsoluteIndex = require("./_to-absolute-index"); 25360 module.exports = function(IS_INCLUDES) { 25361 return function($this, el, fromIndex) { 25362 var value, O = toIObject($this), length = toLength(O.length), index = toAbsoluteIndex(fromIndex, length); 25363 if (IS_INCLUDES && el != el) { 25364 for (;index < length; ) if ((value = O[index++]) != value) return !0; 25365 } else for (;index < length;
25365 index++) if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; 25366 return !IS_INCLUDES && -1; 25367 }; 25368 }; 25369 }, { 25370 "./_to-absolute-index": 222, 25371 "./_to-iobject": 225, 25372 "./_to-length": 226 25373 } ], 25374 142: [ function(require, module, exports) { 25375 var ctx = require("./_ctx"), IObject = require("./_iobject"), toObject = require("./_to-object"), toLength = require("./_to-length"), asc = require("./_array-species-create"); 25376 module.exports = function(TYPE, $create) { 25377 var IS_MAP = 1 == TYPE, IS_FILTER = 2 == TYPE, IS_SOME = 3 == TYPE, IS_EVERY = 4 == TYPE, IS_FIND_INDEX = 6 == TYPE, NO_HOLES = 5 == TYPE || IS_FIND_INDEX, create = $create || asc; 25378 return function($this, callbackfn, that) { 25379 for (var val, res, O = toObject($this), self = IObject(O), f = ctx(callbackfn, that, 3), length = toLength(self.length), index = 0, result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : void 0; index < length; index++) if ((NO_HOLES || index in self) && (res = f(val = self[index], index, O), 25380 TYPE)) if (IS_MAP) result[index] = res; else if (res) switch (TYPE) { 25381 case 3: 25382 return !0; 25383 25384 case 5: 25385 return val; 25386 25387 case 6: 25388 return index; 25389 25390 case 2: 25391 result.push(val); 25392 } else if (IS_EVERY) return !1; 25393 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; 25394 }; 25395 }; 25396 }, { 25397 "./_array-species-create": 144, 25398 "./_ctx": 149, 25399 "./_iobject": 169, 25400 "./_to-length": 226, 25401 "./_to-object": 227 25402 } ], 25403 143: [ function(require, module, exports) { 25404 var isObject = require("./_is-object"), isArray = require("./_is-array"), SPECIES = require("./_wks")("species"); 25405 module.exports = function(original) { 25406 var C; 25407 return isArray(original) && ("function" != typeof (C = original.constructor) || C !== Array && !isArray(C.prototype) || (C = void 0), 25408 isObject(C) && null === (C = C[SPECIES]) && (C = void 0)), void 0 === C ? Array : C; 25409 }; 25410 }, { 25411 "./_is-array": 171, 25412 "./_is-object": 172, 25413 "./_wks": 236 25414 } ], 25415 144: [ function(require, module, exports) { 25416 var speciesConstructor = require("./_array-species-constructor"); 25417 module.exports = function(original, length) { 25418 return new (speciesConstructor(original))(length); 25419 }; 25420 }, { 25421 "./_array-species-constructor": 143 25422 } ], 25423 145: [ function(require, module, exports) { 25424 var cof = require("./_cof"), TAG = require("./_wks")("toStringTag"), ARG = "Arguments" == cof(function() { 25425 return arguments; 25426 }()); 25427 module.exports = function(it) { 25428 var O, T, B; 25429 return void 0 === it ? "Undefined" : null === it ? "Null" : "string" == typeof (T = function(it, key) { 25430 try { 25431 return it[key]; 25432 } catch (e) {} 25433 }(O = Object(it), TAG)) ? T : ARG ? cof(O) : "Object" == (B = cof(O)) && "function" == typeof O.callee ? "Arguments" : B; 25434 }; 25435 }, { 25436 "./_cof": 146, 25437 "./_wks": 236 25438 } ], 25439 146: [ function(require, module, exports) { 25440 var toString = {}.toString; 25441 module.exports = function(it) { 25442 return toString.call(it).slice(8, -1); 25443 }; 25444 }, {} ], 25445 147: [ function(require, module, exports) { 25446 var core = module.exports = { 25447 version: "2.6.12" 25448 }; 25449 "number" == typeof __e && (__e = core); 25450 }, {} ], 25451 148: [ function(require, module, exports) { 25452 "use strict"; 25453 var $defineProperty = require("./_object-dp"), createDesc = require("./_property-desc"); 25454 module.exports = function(object, index, value) { 25455 index in object ? $defineProperty.f(object, index, createDesc(0, value)) : object[index] = value; 25456 }; 25457 }, {
25458 "./_object-dp": 187, 25459 "./_property-desc": 202 25460 } ], 25461 149: [ function(require, module, exports) { 25462 var aFunction = require("./_a-function"); 25463 module.exports = function(fn, that, length) { 25464 if (aFunction(fn), void 0 === that) return fn; 25465 switch (length) { 25466 case 1: 25467 return function(a) { 25468 return fn.call(that, a); 25469 }; 25470 25471 case 2: 25472 return function(a, b) { 25473 return fn.call(that, a, b); 25474 }; 25475 25476 case 3: 25477 return function(a, b, c) { 25478 return fn.call(that, a, b, c); 25479 }; 25480 } 25481 return function() { 25482 return fn.apply(that, arguments); 25483 }; 25484 }; 25485 }, { 25486 "./_a-function": 134 25487 } ], 25488 150: [ function(require, module, exports) { 25489 module.exports = function(it) { 25490 if (null == it) throw TypeError("Can't call method on " + it); 25491 return it; 25492 }; 25493 }, {} ], 25494 151: [ function(require, module, exports) { 25495 module.exports = !require("./_fails")(function() { 25496 return 7 != Object.defineProperty({}, "a", { 25497 get: function() { 25498 return 7; 25499 } 25500 }).a; 25501 }); 25502 }, { 25503 "./_fails": 157 25504 } ], 25505 152: [ function(require, module, exports) { 25506 var isObject = require("./_is-object"), document = require("./_global").document, is = isObject(document) && isObject(document.createElement); 25507 module.exports = function(it) { 25508 return is ? document.createElement(it) : {}; 25509 }; 25510 }, { 25511 "./_global": 162, 25512 "./_is-object": 172 25513 } ], 25514 153: [ function(require, module, exports) { 25515 module.exports = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","); 25516 }, {} ], 25517 154: [ function(require, module, exports) { 25518 var getKeys = require("./_object-keys"), gOPS = require("./_object-gops"), pIE = require("./_object-pie"); 25519 module.exports = function(it) { 25520 var result = getKeys(it), getSymbols = gOPS.f; 25521 if (getSymbols) for (var key, symbols = getSymbols(it), isEnum = pIE.f, i = 0; symbols.length > i; ) isEnum.call(it, key = symbols[i++]) && result.push(key); 25522 return result; 25523 }; 25524 }, { 25525 "./_object-gops": 192, 25526 "./_object-keys": 195, 25527 "./_object-pie": 196 25528 } ], 25529 155: [ function(require, module, exports) { 25530 var global = require("./_global"), core = require("./_core"), hide = require("./_hide"), redefine = require("./_redefine"), ctx = require("./_ctx"), $export = function(type, name, source) { 25531 var key, own, out, exp, IS_FORCED = type & $export.F, IS_GLOBAL = type & $export.G, IS_STATIC = type & $export.S, IS_PROTO = type & $export.P, IS_BIND = type & $export.B, target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {}).prototype, exports = IS_GLOBAL ? core : core[name] || (core[name] = {}), expProto = exports.prototype || (exports.prototype = {}); 25532 for (key in IS_GLOBAL && (source = name), source) out = ((own = !IS_FORCED && target && void 0 !== target[key]) ? target : source)[key], 25533 exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && "function" == typeof out ? ctx(Function.call, out) : out, 25534 target && redefine(target, key, out, type & $export.U), exports[key] != out && hide(exports, key, exp), 25535 IS_PROTO && expProto[key] != out && (expProto[key] = out); 25536 }; 25537 global.core = core, $export.F = 1, $export.G = 2, $export.S = 4, $export.P = 8, 25538 $export.B = 16, $export.W = 32, $export.U = 64, $export.R = 128, module.exports = $export; 25539 }, { 25540 "./_core": 147, 25541 "./_ctx": 149, 25542 "./_global": 162, 25543 "./_hide": 164, 25544 "./_redefine": 204 25545 } ], 25546 156: [ function(require, module, exports) { 25547 var MATCH = require("./_wks")("match"); 25548 module.exports = function(KEY) { 25549 var re = /./; 25550 try { 25551 "/./"[KEY](re); 25552 } catch (e) { 25553 try { 25554 return re[MATCH] = !1, !"/./"[KEY](re); 25555 } catch (f) {} 25556 } 25557 return !0; 25558 }; 25559 }, {
25560 "./_wks": 236 25561 } ], 25562 157: [ function(require, module, exports) { 25563 module.exports = function(exec) { 25564 try { 25565 return !!exec(); 25566 } catch (e) { 25567 return !0; 25568 } 25569 }; 25570 }, {} ], 25571 158: [ function(require, module, exports) { 25572 "use strict"; 25573 require("./es6.regexp.exec"); 25574 var redefine = require("./_redefine"), hide = require("./_hide"), fails = require("./_fails"), defined = require("./_defined"), wks = require("./_wks"), regexpExec = require("./_regexp-exec"), SPECIES = wks("species"), REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function() { 25575 var re = /./; 25576 return re.exec = function() { 25577 var result = []; 25578 return result.groups = { 25579 a: "7" 25580 }, result; 25581 }, "7" !== "".replace(re, "$<a>"); 25582 }), SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = function() { 25583 var re = /(?:)/, originalExec = re.exec; 25584 re.exec = function() { 25585 return originalExec.apply(this, arguments); 25586 }; 25587 var result = "ab".split(re); 25588 return 2 === result.length && "a" === result[0] && "b" === result[1]; 25589 }(); 25590 module.exports = function(KEY, length, exec) { 25591 var SYMBOL = wks(KEY), DELEGATES_TO_SYMBOL = !fails(function() { 25592 var O = {}; 25593 return O[SYMBOL] = function() { 25594 return 7; 25595 }, 7 != ""[KEY](O); 25596 }), DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function() { 25597 var execCalled = !1, re = /a/; 25598 return re.exec = function() { 25599 return execCalled = !0, null; 25600 }, "split" === KEY && (re.constructor = {}, re.constructor[SPECIES] = function() { 25601 return re; 25602 }), re[SYMBOL](""), !execCalled; 25603 }) : void 0; 25604 if (!DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || "replace" === KEY && !REPLACE_SUPPORTS_NAMED_GROUPS || "split" === KEY && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) { 25605 var nativeRegExpMethod = /./[SYMBOL], fns = exec(defined, SYMBOL, ""[KEY], function(nativeMethod, regexp, str, arg2, forceStringMethod) { 25606 return regexp.exec === regexpExec ? DELEGATES_TO_SYMBOL && !forceStringMethod ? { 25607 done: !0, 25608 value: nativeRegExpMethod.call(regexp, str, arg2) 25609 } : { 25610 done: !0, 25611 value: nativeMethod.call(str, regexp, arg2) 25612 } : { 25613 done: !1 25614 }; 25615 }), strfn = fns[0], rxfn = fns[1]; 25616 redefine(String.prototype, KEY, strfn), hide(RegExp.prototype, SYMBOL, 2 == length ? function(string, arg) { 25617 return rxfn.call(string, this, arg); 25618 } : function(string) { 25619 return rxfn.call(string, this); 25620 }); 25621 } 25622 }; 25623 }, { 25624 "./_defined": 150, 25625 "./_fails": 157, 25626 "./_hide": 164, 25627 "./_redefine": 204, 25628 "./_regexp-exec": 206, 25629 "./_wks": 236, 25630 "./es6.regexp.exec": 256 25631 } ], 25632 159: [ function(require, module, exports) { 25633 "use strict"; 25634 var anObject = require("./_an-object"); 25635 module.exports = function() { 25636 var that = anObject(this), result = ""; 25637 return that.global && (result += "g"), that.ignoreCase && (result += "i"), that.multiline && (result += "m"), 25638 that.unicode && (result += "u"), that.sticky && (result += "y"), result; 25639 }; 25640 }, { 25641 "./_an-object": 138 25642 } ], 25643 160: [ function(require, module, exports) { 25644 var ctx = require("./_ctx"), call = require("./_iter-call"), isArrayIter = require("./_is-array-iter"), anObject = require("./_an-object"), toLength = require("./_to-length"), getIterFn = require("./core.get-iterator-method"), BREAK = {}, RETURN = {}; 25645 (exports = module.exports = function(iterable, entries, fn, that, ITERATOR) { 25646 var length, step, iterator, result, iterFn = ITERATOR ? function() { 25647 return iterable; 25648 } : getIterFn(iterable), f = ctx(fn, that, entries ? 2 : 1), index = 0; 25649 if ("function" != typeof iterFn) throw TypeError(iterable + " is not iterable!"); 25650 if (isArrayIter(iterFn)) { 25651 for (length = toLength(iterable.length); index < length; index++) if ((result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index])) === BREAK || result === RETURN) return result; 25652 } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done; ) if ((result = call(iterator, f, step.value, entries)) === BREAK || result === RETURN) return result; 25653 }).BREAK = BREAK, exports.RETURN = RETURN; 25654 }, {
25655 "./_an-object": 138, 25656 "./_ctx": 149, 25657 "./_is-array-iter": 170, 25658 "./_iter-call": 174, 25659 "./_to-length": 226, 25660 "./core.get-iterator-method": 237 25661 } ], 25662 161: [ function(require, module, exports) { 25663 module.exports = require("./_shared")("native-function-to-string", Function.toString); 25664 }, { 25665 "./_shared": 212 25666 } ], 25667 162: [ function(require, module, exports) { 25668 var global = module.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(); 25669 "number" == typeof __g && (__g = global); 25670 }, {} ], 25671 163: [ function(require, module, exports) { 25672 var hasOwnProperty = {}.hasOwnProperty; 25673 module.exports = function(it, key) { 25674 return hasOwnProperty.call(it, key); 25675 }; 25676 }, {} ], 25677 164: [ function(require, module, exports) { 25678 var dP = require("./_object-dp"), createDesc = require("./_property-desc"); 25679 module.exports = require("./_descriptors") ? function(object, key, value) { 25680 return dP.f(object, key, createDesc(1, value)); 25681 } : function(object, key, value) { 25682 return object[key] = value, object; 25683 }; 25684 }, { 25685 "./_descriptors": 151, 25686 "./_object-dp": 187, 25687 "./_property-desc": 202 25688 } ], 25689 165: [ function(require, module, exports) { 25690 var document = require("./_global").document; 25691 module.exports = document && document.documentElement; 25692 }, { 25693 "./_global": 162 25694 } ], 25695 166: [ function(require, module, exports) { 25696 module.exports = !require("./_descriptors") && !require("./_fails")(function() { 25697 return 7 != Object.defineProperty(require("./_dom-create")("div"), "a", { 25698 get: function() { 25699 return 7; 25700 } 25701 }).a; 25702 }); 25703 }, { 25704 "./_descriptors": 151, 25705 "./_dom-create": 152, 25706 "./_fails": 157 25707 } ], 25708 167: [ function(require, module, exports) { 25709 var isObject = require("./_is-object"), setPrototypeOf = require("./_set-proto").set; 25710 module.exports = function(that, target, C) { 25711 var P, S = target.constructor; 25712 return S !== C && "function" == typeof S && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf && setPrototypeOf(that, P), 25713 that; 25714 }; 25715 }, { 25716 "./_is-object": 172, 25717 "./_set-proto": 208 25718 } ], 25719 168: [ function(require, module, exports) { 25720 module.exports = function(fn, args, that) { 25721 var un = void 0 === that; 25722 switch (args.length) { 25723 case 0: 25724 return un ? fn() : fn.call(that); 25725 25726 case 1: 25727 return un ? fn(args[0]) : fn.call(that, args[0]); 25728 25729 case 2: 25730 return un ? fn(args[0], args[1]) : fn.call(that, args[0], args[1]); 25731 25732 case 3: 25733 return un ? fn(args[0], args[1], args[2]) : fn.call(that, args[0], args[1], args[2]); 25734 25735 case 4: 25736 return un ? fn(args[0], args[1], args[2], args[3]) : fn.call(that, args[0], args[1], args[2], args[3]); 25737 } 25738 return fn.apply(that, args); 25739 }; 25740 }, {} ], 25741 169: [ function(require, module, exports) { 25742 var cof = require("./_cof"); 25743 module.exports = Object("z").propertyIsEnumerable(0) ? Object : function(it) { 25744 return "String" == cof(it) ? it.split("") : Object(it); 25745 }; 25746 }, { 25747 "./_cof": 146 25748 } ], 25749 170: [ function(require, module, exports) { 25750 var Iterators = require("./_iterators"), ITERATOR = require("./_wks")("iterator"), ArrayProto = Array.prototype; 25751 module.exports = function(it) { 25752 return void 0 !== it && (Iterators.Array === it || ArrayProto[ITERATOR] === it); 25753 }; 25754 }, { 25755 "./_iterators": 179, 25756 "./_wks": 236 25757 } ], 25758 171: [ function(require, module, exports) { 25759 var cof = require("./_cof"); 25760 module.exports = Array.isArray || function(arg) { 25761 return "Array" == cof(arg); 25762 }; 25763 }, {
25764 "./_cof": 146 25765 } ], 25766 172: [ function(require, module, exports) { 25767 module.exports = function(it) { 25768 return "object" == typeof it ? null !== it : "function" == typeof it; 25769 }; 25770 }, {} ], 25771 173: [ function(require, module, exports) { 25772 var isObject = require("./_is-object"), cof = require("./_cof"), MATCH = require("./_wks")("match"); 25773 module.exports = function(it) { 25774 var isRegExp; 25775 return isObject(it) && (void 0 !== (isRegExp = it[MATCH]) ? !!isRegExp : "RegExp" == cof(it)); 25776 }; 25777 }, { 25778 "./_cof": 146, 25779 "./_is-object": 172, 25780 "./_wks": 236 25781 } ], 25782 174: [ function(require, module, exports) { 25783 var anObject = require("./_an-object"); 25784 module.exports = function(iterator, fn, value, entries) { 25785 try { 25786 return entries ? fn(anObject(value)[0], value[1]) : fn(value); 25787 } catch (e) { 25788 var ret = iterator.return; 25789 throw void 0 !== ret && anObject(ret.call(iterator)), e; 25790 } 25791 }; 25792 }, { 25793 "./_an-object": 138 25794 } ], 25795 175: [ function(require, module, exports) { 25796 "use strict"; 25797 var create = require("./_object-create"), descriptor = require("./_property-desc"), setToStringTag = require("./_set-to-string-tag"), IteratorPrototype = {}; 25798 require("./_hide")(IteratorPrototype, require("./_wks")("iterator"), function() { 25799 return this; 25800 }), module.exports = function(Constructor, NAME, next) { 25801 Constructor.prototype = create(IteratorPrototype, { 25802 next: descriptor(1, next) 25803 }), setToStringTag(Constructor, NAME + " Iterator"); 25804 }; 25805 }, { 25806 "./_hide": 164, 25807 "./_object-create": 186, 25808 "./_property-desc": 202, 25809 "./_set-to-string-tag": 210, 25810 "./_wks": 236 25811 } ], 25812 176: [ function(require, module, exports) { 25813 "use strict"; 25814 function returnThis() { 25815 return this; 25816 } 25817 var LIBRARY = require("./_library"), $export = require("./_export"), redefine = require("./_redefine"), hide = require("./_hide"), Iterators = require("./_iterators"), $iterCreate = require("./_iter-create"), setToStringTag = require("./_set-to-string-tag"), getPrototypeOf = require("./_object-gpo"), ITERATOR = require("./_wks")("iterator"), BUGGY = !([].keys && "next" in [].keys()); 25818 module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { 25819 $iterCreate(Constructor, NAME, next); 25820 function getMethod(kind) { 25821 if (!BUGGY && kind in proto) return proto[kind]; 25822 switch (kind) { 25823 case "keys": 25824 case "values": 25825 return function() { 25826 return new Constructor(this, kind); 25827 }; 25828 } 25829 return function() { 25830 return new Constructor(this, kind); 25831 }; 25832 } 25833 var methods, key, IteratorPrototype, TAG = NAME + " Iterator", DEF_VALUES = "values" == DEFAULT, VALUES_BUG = !1, proto = Base.prototype, $native = proto[ITERATOR] || proto["@@iterator"] || DEFAULT && proto[DEFAULT], $default = $native || getMethod(DEFAULT), $entries = DEFAULT ? DEF_VALUES ? getMethod("entries") : $default : void 0, $anyNative = "Array" == NAME && proto.entries || $native; 25834 if ($anyNative && (IteratorPrototype = getPrototypeOf($anyNative.call(new Base()))) !== Object.prototype && IteratorPrototype.next && (setToStringTag(IteratorPrototype, TAG, !0), 25835 LIBRARY || "function" == typeof IteratorPrototype[ITERATOR] || hide(IteratorPrototype, ITERATOR, returnThis)), 25836 DEF_VALUES && $native && "values" !== $native.name && (VALUES_BUG = !0, $default = function() { 25837 return $native.call(this); 25838 }), LIBRARY && !FORCED || !BUGGY && !VALUES_BUG && proto[ITERATOR] || hide(proto, ITERATOR, $default), 25839 Iterators[NAME] = $default, Iterators[TAG] = returnThis, DEFAULT) if (methods = { 25840 values: DEF_VALUES ? $default : getMethod("values"), 25841 keys: IS_SET ? $default : getMethod("keys"),
25842 entries: $entries 25843 }, FORCED) for (key in methods) key in proto || redefine(proto, key, methods[key]); else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); 25844 return methods; 25845 }; 25846 }, { 25847 "./_export": 155, 25848 "./_hide": 164, 25849 "./_iter-create": 175, 25850 "./_iterators": 179, 25851 "./_library": 180, 25852 "./_object-gpo": 193, 25853 "./_redefine": 204, 25854 "./_set-to-string-tag": 210, 25855 "./_wks": 236 25856 } ], 25857 177: [ function(require, module, exports) { 25858 var ITERATOR = require("./_wks")("iterator"), SAFE_CLOSING = !1; 25859 try { 25860 var riter = [ 7 ][ITERATOR](); 25861 riter.return = function() { 25862 SAFE_CLOSING = !0; 25863 }, Array.from(riter, function() { 25864 throw 2; 25865 }); 25866 } catch (e) {} 25867 module.exports = function(exec, skipClosing) { 25868 if (!skipClosing && !SAFE_CLOSING) return !1; 25869 var safe = !1; 25870 try { 25871 var arr = [ 7 ], iter = arr[ITERATOR](); 25872 iter.next = function() { 25873 return { 25874 done: safe = !0 25875 }; 25876 }, arr[ITERATOR] = function() { 25877 return iter; 25878 }, exec(arr); 25879 } catch (e) {} 25880 return safe; 25881 }; 25882 }, { 25883 "./_wks": 236 25884 } ], 25885 178: [ function(require, module, exports) { 25886 module.exports = function(done, value) { 25887 return { 25888 value: value, 25889 done: !!done 25890 }; 25891 }; 25892 }, {} ], 25893 179: [ function(require, module, exports) { 25894 module.exports = {}; 25895 }, {} ], 25896 180: [ function(require, module, exports) { 25897 module.exports = !1; 25898 }, {} ], 25899 181: [ function(require, module, exports) { 25900 module.exports = Math.sign || function(x) { 25901 return 0 == (x = +x) || x != x ? x : x < 0 ? -1 : 1; 25902 }; 25903 }, {} ], 25904 182: [ function(require, module, exports) { 25905 function setMeta(it) { 25906 setDesc(it, META, { 25907 value: { 25908 i: "O" + ++id, 25909 w: {} 25910 } 25911 }); 25912 } 25913 var META = require("./_uid")("meta"), isObject = require("./_is-object"), has = require("./_has"), setDesc = require("./_object-dp").f, id = 0, isExtensible = Object.isExtensible || function() { 25914 return !0; 25915 }, FREEZE = !require("./_fails")(function() { 25916 return isExtensible(Object.preventExtensions({})); 25917 }), meta = module.exports = { 25918 KEY: META, 25919 NEED: !1, 25920 fastKey: function(it, create) { 25921 if (!isObject(it)) return "symbol" == typeof it ? it : ("string" == typeof it ? "S" : "P") + it; 25922 if (!has(it, META)) { 25923 if (!isExtensible(it)) return "F"; 25924 if (!create) return "E"; 25925 setMeta(it); 25926 } 25927 return it[META].i; 25928 }, 25929 getWeak: function(it, create) { 25930 if (!has(it, META)) { 25931 if (!isExtensible(it)) return !0; 25932 if (!create) return !1; 25933 setMeta(it); 25934 } 25935 return it[META].w; 25936 }, 25937 onFreeze: function(it) { 25938 return FREEZE && meta.NEED && isExtensible(it) && !has(it, META) && setMeta(it), 25939 it; 25940 } 25941 }; 25942 }, { 25943 "./_fails": 157, 25944 "./_has": 163, 25945 "./_is-object": 172, 25946 "./_object-dp": 187, 25947 "./_uid": 232 25948 } ], 25949 183: [ function(require, module, exports) { 25950 var global = require("./_global"), macrotask = require("./_task").set, Observer = global.MutationObserver || global.WebKitMutationObserver, process = global.process, Promise = global.Promise, isNode = "process" == require("./_cof")(process); 25951 module.exports = function() { 25952 function flush() { 25953 var parent, fn; 25954 for (isNode && (parent = process.domain) && parent.exit(); head; ) { 25955 fn = head.fn, head = head.next; 25956 try { 25957 fn(); 25958 } catch (e) { 25959 throw head ? notify() : last = void 0, e; 25960 } 25961 } 25962 last = void 0, parent && parent.enter(); 25963 } 25964 var head, last, notify; 25965 if (isNode) notify = function() { 25966 process.nextTick(flush); 25967 }; else if (!Observer || global.navigator && global.navigator.standalone) if (Promise && Promise.resolve) { 25968 var promise = Promise.resolve(void 0); 25969 notify = function() { 25970 promise.then(flush); 25971 }; 25972 } else notify = function() { 25973 macrotask.call(global, flush); 25974 }; else { 25975 var toggle = !0, node = document.createTextNode(""); 25976 new Observer(flush).observe(node, { 25977 characterData: !0 25978 }), notify = function() { 25979 node.data = toggle = !toggle; 25980 }; 25981 } 25982 return function(fn) { 25983 var task = { 25984 fn: fn, 25985 next: void 0 25986 }; 25987 last && (last.next = task), head || (head = task, notify()), last = task; 25988 }; 25989 }; 25990 }, {
25991 "./_cof": 146, 25992 "./_global": 162, 25993 "./_task": 221 25994 } ], 25995 184: [ function(require, module, exports) { 25996 "use strict"; 25997 var aFunction = require("./_a-function"); 25998 function PromiseCapability(C) { 25999 var resolve, reject; 26000 this.promise = new C(function($$resolve, $$reject) { 26001 if (void 0 !== resolve || void 0 !== reject) throw TypeError("Bad Promise constructor"); 26002 resolve = $$resolve, reject = $$reject; 26003 }), this.resolve = aFunction(resolve), this.reject = aFunction(reject); 26004 } 26005 module.exports.f = function(C) { 26006 return new PromiseCapability(C); 26007 }; 26008 }, { 26009 "./_a-function": 134 26010 } ], 26011 185: [ function(require, module, exports) { 26012 "use strict"; 26013 var DESCRIPTORS = require("./_descriptors"), getKeys = require("./_object-keys"), gOPS = require("./_object-gops"), pIE = require("./_object-pie"), toObject = require("./_to-object"), IObject = require("./_iobject"), $assign = Object.assign; 26014 module.exports = !$assign || require("./_fails")(function() { 26015 var A = {}, B = {}, S = Symbol(), K = "abcdefghijklmnopqrst"; 26016 return A[S] = 7, K.split("").forEach(function(k) { 26017 B[k] = k; 26018 }), 7 != $assign({}, A)[S] || Object.keys($assign({}, B)).join("") != K; 26019 }) ? function(target, source) { 26020 for (var T = toObject(target), aLen = arguments.length, index = 1, getSymbols = gOPS.f, isEnum = pIE.f; index < aLen; ) for (var key, S = IObject(arguments[index++]), keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S), length = keys.length, j = 0; j < length; ) key = keys[j++], 26021 DESCRIPTORS && !isEnum.call(S, key) || (T[key] = S[key]); 26022 return T; 26023 } : $assign; 26024 }, { 26025 "./_descriptors": 151, 26026 "./_fails": 157, 26027 "./_iobject": 169, 26028 "./_object-gops": 192, 26029 "./_object-keys": 195, 26030 "./_object-pie": 196, 26031 "./_to-object": 227 26032 } ], 26033 186: [ function(require, module, exports) { 26034 function Empty() {} 26035 var anObject = require("./_an-object"), dPs = require("./_object-dps"), enumBugKeys = require("./_enum-bug-keys"), IE_PROTO = require("./_shared-key")("IE_PROTO"), createDict = function() { 26036 var iframeDocument, iframe = require("./_dom-create")("iframe"), i = enumBugKeys.length; 26037 for (iframe.style.display = "none", require("./_html").appendChild(iframe), iframe.src = "javascript:", 26038 (iframeDocument = iframe.contentWindow.document).open(), iframeDocument.write("<script>document.F=Object<\/script>"), 26039 iframeDocument.close(), createDict = iframeDocument.F; i--; ) delete createDict.prototype[enumBugKeys[i]]; 26040 return createDict(); 26041 }; 26042 module.exports = Object.create || function(O, Properties) { 26043 var result; 26044 return null !== O ? (Empty.prototype = anObject(O), result = new Empty(), Empty.prototype = null, 26045 result[IE_PROTO] = O) : result = createDict(), void 0 === Properties ? result : dPs(result, Properties); 26046 }; 26047 }, { 26048 "./_an-object": 138, 26049 "./_dom-create": 152, 26050 "./_enum-bug-keys": 153, 26051 "./_html": 165, 26052 "./_object-dps": 188, 26053 "./_shared-key": 211 26054 } ], 26055 187: [ function(require, module, exports) { 26056 var anObject = require("./_an-object"), IE8_DOM_DEFINE = require("./_ie8-dom-define"), toPrimitive = require("./_to-primitive"), dP = Object.defineProperty; 26057 exports.f = require("./_descriptors") ? Object.defineProperty : function(O, P, Attributes) { 26058 if (anObject(O), P = toPrimitive(P, !0), anObject(Attributes), IE8_DOM_DEFINE) try { 26059 return dP(O, P, Attributes); 26060 } catch (e) {} 26061 if ("get" in Attributes || "set" in Attributes) throw TypeError("Accessors not supported!"); 26062 return "value" in Attributes && (O[P] = Attributes.value), O; 26063 }; 26064 }, { 26065 "./_an-object": 138, 26066 "./_descriptors": 151, 26067 "./_ie8-dom-define": 166, 26068 "./_to-primitive": 228 26069 } ],
26070 188: [ function(require, module, exports) { 26071 var dP = require("./_object-dp"), anObject = require("./_an-object"), getKeys = require("./_object-keys"); 26072 module.exports = require("./_descriptors") ? Object.defineProperties : function(O, Properties) { 26073 anObject(O); 26074 for (var P, keys = getKeys(Properties), length = keys.length, i = 0; i < length; ) dP.f(O, P = keys[i++], Properties[P]); 26075 return O; 26076 }; 26077 }, { 26078 "./_an-object": 138, 26079 "./_descriptors": 151, 26080 "./_object-dp": 187, 26081 "./_object-keys": 195 26082 } ], 26083 189: [ function(require, module, exports) { 26084 var pIE = require("./_object-pie"), createDesc = require("./_property-desc"), toIObject = require("./_to-iobject"), toPrimitive = require("./_to-primitive"), has = require("./_has"), IE8_DOM_DEFINE = require("./_ie8-dom-define"), gOPD = Object.getOwnPropertyDescriptor; 26085 exports.f = require("./_descriptors") ? gOPD : function(O, P) { 26086 if (O = toIObject(O), P = toPrimitive(P, !0), IE8_DOM_DEFINE) try { 26087 return gOPD(O, P); 26088 } catch (e) {} 26089 if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); 26090 }; 26091 }, { 26092 "./_descriptors": 151, 26093 "./_has": 163, 26094 "./_ie8-dom-define": 166, 26095 "./_object-pie": 196, 26096 "./_property-desc": 202, 26097 "./_to-iobject": 225, 26098 "./_to-primitive": 228 26099 } ], 26100 190: [ function(require, module, exports) { 26101 var toIObject = require("./_to-iobject"), gOPN = require("./_object-gopn").f, toString = {}.toString, windowNames = "object" == typeof window && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; 26102 module.exports.f = function(it) { 26103 return windowNames && "[object Window]" == toString.call(it) ? function(it) { 26104 try { 26105 return gOPN(it); 26106 } catch (e) { 26107 return windowNames.slice(); 26108 } 26109 }(it) : gOPN(toIObject(it)); 26110 }; 26111 }, { 26112 "./_object-gopn": 191, 26113 "./_to-iobject": 225 26114 } ], 26115 191: [ function(require, module, exports) { 26116 var $keys = require("./_object-keys-internal"), hiddenKeys = require("./_enum-bug-keys").concat("length", "prototype"); 26117 exports.f = Object.getOwnPropertyNames || function(O) { 26118 return $keys(O, hiddenKeys); 26119 }; 26120 }, { 26121 "./_enum-bug-keys": 153, 26122 "./_object-keys-internal": 194 26123 } ], 26124 192: [ function(require, module, exports) { 26125 exports.f = Object.getOwnPropertySymbols; 26126 }, {} ], 26127 193: [ function(require, module, exports) { 26128 var has = require("./_has"), toObject = require("./_to-object"), IE_PROTO = require("./_shared-key")("IE_PROTO"), ObjectProto = Object.prototype; 26129 module.exports = Object.getPrototypeOf || function(O) { 26130 return O = toObject(O), has(O, IE_PROTO) ? O[IE_PROTO] : "function" == typeof O.constructor && O instanceof O.constructor ? O.constructor.prototype : O instanceof Object ? ObjectProto : null; 26131 }; 26132 }, { 26133 "./_has": 163, 26134 "./_shared-key": 211, 26135 "./_to-object": 227 26136 } ], 26137 194: [ function(require, module, exports) { 26138 var has = require("./_has"), toIObject = require("./_to-iobject"), arrayIndexOf = require("./_array-includes")(!1), IE_PROTO = require("./_shared-key")("IE_PROTO"); 26139 module.exports = function(object, names) { 26140 var key, O = toIObject(object), i = 0, result = []; 26141 for (key in O) key != IE_PROTO && has(O, key) && result.push(key); 26142 for (;names.length > i; ) has(O, key = names[i++]) && (~arrayIndexOf(result, key) || result.push(key)); 26143 return result; 26144 }; 26145 }, { 26146 "./_array-includes": 141, 26147 "./_has": 163, 26148 "./_shared-key": 211, 26149 "./_to-iobject": 225 26150 } ], 26151 195: [ function(require, module, exports) { 26152 var $keys = require("./_object-keys-internal"), enumBugKeys = require("./_enum-bug-keys"); 26153 module.exports = Object.keys || function(O) { 26154 return $keys(O, enumBugKeys); 26155 }; 26156 }, {
26157 "./_enum-bug-keys": 153, 26158 "./_object-keys-internal": 194 26159 } ], 26160 196: [ function(require, module, exports) { 26161 exports.f = {}.propertyIsEnumerable; 26162 }, {} ], 26163 197: [ function(require, module, exports) { 26164 var $export = require("./_export"), core = require("./_core"), fails = require("./_fails"); 26165 module.exports = function(KEY, exec) { 26166 var fn = (core.Object || {})[KEY] || Object[KEY], exp = {}; 26167 exp[KEY] = exec(fn), $export($export.S + $export.F * fails(function() { 26168 fn(1); 26169 }), "Object", exp); 26170 }; 26171 }, { 26172 "./_core": 147, 26173 "./_export": 155, 26174 "./_fails": 157 26175 } ], 26176 198: [ function(require, module, exports) { 26177 var DESCRIPTORS = require("./_descriptors"), getKeys = require("./_object-keys"), toIObject = require("./_to-iobject"), isEnum = require("./_object-pie").f; 26178 module.exports = function(isEntries) { 26179 return function(it) { 26180 for (var key, O = toIObject(it), keys = getKeys(O), length = keys.length, i = 0, result = []; i < length; ) key = keys[i++], 26181 DESCRIPTORS && !isEnum.call(O, key) || result.push(isEntries ? [ key, O[key] ] : O[key]); 26182 return result; 26183 }; 26184 }; 26185 }, { 26186 "./_descriptors": 151, 26187 "./_object-keys": 195, 26188 "./_object-pie": 196, 26189 "./_to-iobject": 225 26190 } ], 26191 199: [ function(require, module, exports) { 26192 var gOPN = require("./_object-gopn"), gOPS = require("./_object-gops"), anObject = require("./_an-object"), Reflect = require("./_global").Reflect; 26193 module.exports = Reflect && Reflect.ownKeys || function(it) { 26194 var keys = gOPN.f(anObject(it)), getSymbols = gOPS.f; 26195 return getSymbols ? keys.concat(getSymbols(it)) : keys; 26196 }; 26197 }, { 26198 "./_an-object": 138, 26199 "./_global": 162, 26200 "./_object-gopn": 191, 26201 "./_object-gops": 192 26202 } ], 26203 200: [ function(require, module, exports) { 26204 module.exports = function(exec) { 26205 try { 26206 return { 26207 e: !1, 26208 v: exec() 26209 }; 26210 } catch (e) { 26211 return { 26212 e: !0, 26213 v: e 26214 }; 26215 } 26216 }; 26217 }, {} ], 26218 201: [ function(require, module, exports) { 26219 var anObject = require("./_an-object"), isObject = require("./_is-object"), newPromiseCapability = require("./_new-promise-capability"); 26220 module.exports = function(C, x) { 26221 if (anObject(C), isObject(x) && x.constructor === C) return x; 26222 var promiseCapability = newPromiseCapability.f(C); 26223 return (0, promiseCapability.resolve)(x), promiseCapability.promise; 26224 }; 26225 }, { 26226 "./_an-object": 138, 26227 "./_is-object": 172, 26228 "./_new-promise-capability": 184 26229 } ], 26230 202: [ function(require, module, exports) { 26231 module.exports = function(bitmap, value) { 26232 return { 26233 enumerable: !(1 & bitmap), 26234 configurable: !(2 & bitmap), 26235 writable: !(4 & bitmap), 26236 value: value 26237 }; 26238 }; 26239 }, {} ], 26240 203: [ function(require, module, exports) { 26241 var redefine = require("./_redefine"); 26242 module.exports = function(target, src, safe) { 26243 for (var key in src) redefine(target, key, src[key], safe); 26244 return target; 26245 }; 26246 }, { 26247 "./_redefine": 204 26248 } ], 26249 204: [ function(require, module, exports) { 26250 var global = require("./_global"), hide = require("./_hide"), has = require("./_has"), SRC = require("./_uid")("src"), $toString = require("./_function-to-string"), TPL = ("" + $toString).split("toString"); 26251 require("./_core").inspectSource = function(it) { 26252 return $toString.call(it); 26253 }, (module.exports = function(O, key, val, safe) { 26254 var isFunction = "function" == typeof val; 26255 isFunction && (has(val, "name") || hide(val, "name", key)), O[key] !== val && (isFunction && (has(val, SRC) || hide(val, SRC, O[key] ? "" + O[key] : TPL.join(String(key)))), 26256 O === global ? O[key] = val : safe ? O[key] ? O[key] = val : hide(O, key, val) : (delete O[key], 26257 hide(O, key, val))); 26258 })(Function.prototype, "toString", function() { 26259 return "function" == typeof this && this[SRC] || $toString.call(this); 26260 }); 26261 }, {
26262 "./_core": 147, 26263 "./_function-to-string": 161, 26264 "./_global": 162, 26265 "./_has": 163, 26266 "./_hide": 164, 26267 "./_uid": 232 26268 } ], 26269 205: [ function(require, module, exports) { 26270 "use strict"; 26271 var classof = require("./_classof"), builtinExec = RegExp.prototype.exec; 26272 module.exports = function(R, S) { 26273 var exec = R.exec; 26274 if ("function" == typeof exec) { 26275 var result = exec.call(R, S); 26276 if ("object" != typeof result) throw new TypeError("RegExp exec method returned something other than an Object or null"); 26277 return result; 26278 } 26279 if ("RegExp" !== classof(R)) throw new TypeError("RegExp#exec called on incompatible receiver"); 26280 return builtinExec.call(R, S); 26281 }; 26282 }, { 26283 "./_classof": 145 26284 } ], 26285 206: [ function(require, module, exports) { 26286 "use strict"; 26287 var re1, re2, regexpFlags = require("./_flags"), nativeExec = RegExp.prototype.exec, nativeReplace = String.prototype.replace, patchedExec = nativeExec, UPDATES_LAST_INDEX_WRONG = (re1 = /a/, 26288 re2 = /b*/g, nativeExec.call(re1, "a"), nativeExec.call(re2, "a"), 0 !== re1.lastIndex || 0 !== re2.lastIndex), NPCG_INCLUDED = void 0 !== /()??/.exec("")[1]; 26289 (UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED) && (patchedExec = function(str) { 26290 var lastIndex, reCopy, match, i, re = this; 26291 return NPCG_INCLUDED && (reCopy = new RegExp("^" + re.source + "$(?!\\s)", regexpFlags.call(re))), 26292 UPDATES_LAST_INDEX_WRONG && (lastIndex = re.lastIndex), match = nativeExec.call(re, str), 26293 UPDATES_LAST_INDEX_WRONG && match && (re.lastIndex = re.global ? match.index + match[0].length : lastIndex), 26294 NPCG_INCLUDED && match && 1 < match.length && nativeReplace.call(match[0], reCopy, function() { 26295 for (i = 1; i < arguments.length - 2; i++) void 0 === arguments[i] && (match[i] = void 0); 26296 }), match; 26297 }), module.exports = patchedExec; 26298 }, { 26299 "./_flags": 159 26300 } ], 26301 207: [ function(require, module, exports) { 26302 module.exports = Object.is || function(x, y) { 26303 return x === y ? 0 !== x || 1 / x == 1 / y : x != x && y != y; 26304 }; 26305 }, {} ], 26306 208: [ function(require, module, exports) { 26307 function check(O, proto) { 26308 if (anObject(O), !isObject(proto) && null !== proto) throw TypeError(proto + ": can't set as prototype!"); 26309 } 26310 var isObject = require("./_is-object"), anObject = require("./_an-object"); 26311 module.exports = { 26312 set: Object.setPrototypeOf || ("__proto__" in {} ? function(test, buggy, set) { 26313 try { 26314 (set = require("./_ctx")(Function.call, require("./_object-gopd").f(Object.prototype, "__proto__").set, 2))(test, []), 26315 buggy = !(test instanceof Array); 26316 } catch (e) { 26317 buggy = !0; 26318 } 26319 return function(O, proto) { 26320 return check(O, proto), buggy ? O.__proto__ = proto : set(O, proto), O; 26321 }; 26322 }({}, !1) : void 0), 26323 check: check 26324 }; 26325 }, { 26326 "./_an-object": 138, 26327 "./_ctx": 149, 26328 "./_is-object": 172, 26329 "./_object-gopd": 189 26330 } ], 26331 209: [ function(require, module, exports) { 26332 "use strict"; 26333 var global = require("./_global"), dP = require("./_object-dp"), DESCRIPTORS = require("./_descriptors"), SPECIES = require("./_wks")("species"); 26334 module.exports = function(KEY) { 26335 var C = global[KEY]; 26336 DESCRIPTORS && C && !C[SPECIES] && dP.f(C, SPECIES, { 26337 configurable: !0, 26338 get: function() { 26339 return this; 26340 } 26341 }); 26342 }; 26343 }, { 26344 "./_descriptors": 151, 26345 "./_global": 162, 26346 "./_object-dp": 187, 26347 "./_wks": 236 26348 } ], 26349 210: [ function(require, module, exports) { 26350 var def = require("./_object-dp").f, has = require("./_has"), TAG = require("./_wks")("toStringTag"); 26351 module.exports = function(it, tag, stat) { 26352 it && !has(it = stat ? it : it.prototype, TAG) && def(it, TAG, { 26353 configurable: !0, 26354 value: tag 26355 }); 26356 }; 26357 }, {
26358 "./_has": 163, 26359 "./_object-dp": 187, 26360 "./_wks": 236 26361 } ], 26362 211: [ function(require, module, exports) { 26363 var shared = require("./_shared")("keys"), uid = require("./_uid"); 26364 module.exports = function(key) { 26365 return shared[key] || (shared[key] = uid(key)); 26366 }; 26367 }, { 26368 "./_shared": 212, 26369 "./_uid": 232 26370 } ], 26371 212: [ function(require, module, exports) { 26372 var core = require("./_core"), global = require("./_global"), store = global["__core-js_shared__"] || (global["__core-js_shared__"] = {}); 26373 (module.exports = function(key, value) { 26374 return store[key] || (store[key] = void 0 !== value ? value : {}); 26375 })("versions", []).push({ 26376 version: core.version, 26377 mode: require("./_library") ? "pure" : "global", 26378 copyright: "© 2020 Denis Pushkarev (zloirock.ru)" 26379 }); 26380 }, { 26381 "./_core": 147, 26382 "./_global": 162, 26383 "./_library": 180 26384 } ], 26385 213: [ function(require, module, exports) { 26386 var anObject = require("./_an-object"), aFunction = require("./_a-function"), SPECIES = require("./_wks")("species"); 26387 module.exports = function(O, D) { 26388 var S, C = anObject(O).constructor; 26389 return void 0 === C || null == (S = anObject(C)[SPECIES]) ? D : aFunction(S); 26390 }; 26391 }, { 26392 "./_a-function": 134, 26393 "./_an-object": 138, 26394 "./_wks": 236 26395 } ], 26396 214: [ function(require, module, exports) { 26397 "use strict"; 26398 var fails = require("./_fails"); 26399 module.exports = function(method, arg) { 26400 return !!method && fails(function() { 26401 arg ? method.call(null, function() {}, 1) : method.call(null); 26402 }); 26403 }; 26404 }, { 26405 "./_fails": 157 26406 } ], 26407 215: [ function(require, module, exports) { 26408 var toInteger = require("./_to-integer"), defined = require("./_defined"); 26409 module.exports = function(TO_STRING) { 26410 return function(that, pos) { 26411 var a, b, s = String(defined(that)), i = toInteger(pos), l = s.length; 26412 return i < 0 || l <= i ? TO_STRING ? "" : void 0 : (a = s.charCodeAt(i)) < 55296 || 56319 < a || i + 1 === l || (b = s.charCodeAt(i + 1)) < 56320 || 57343 < b ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : b - 56320 + (a - 55296 << 10) + 65536; 26413 }; 26414 }; 26415 }, { 26416 "./_defined": 150, 26417 "./_to-integer": 224 26418 } ], 26419 216: [ function(require, module, exports) { 26420 var isRegExp = require("./_is-regexp"), defined = require("./_defined"); 26421 module.exports = function(that, searchString, NAME) { 26422 if (isRegExp(searchString)) throw TypeError("String#" + NAME + " doesn't accept regex!"); 26423 return String(defined(that)); 26424 }; 26425 }, { 26426 "./_defined": 150, 26427 "./_is-regexp": 173 26428 } ], 26429 217: [ function(require, module, exports) { 26430 function createHTML(string, tag, attribute, value) { 26431 var S = String(defined(string)), p1 = "<" + tag; 26432 return "" !== attribute && (p1 += " " + attribute + '="' + String(value).replace(quot, """) + '"'), 26433 p1 + ">" + S + "</" + tag + ">"; 26434 } 26435 var $export = require("./_export"), fails = require("./_fails"), defined = require("./_defined"), quot = /"/g; 26436 module.exports = function(NAME, exec) { 26437 var O = {}; 26438 O[NAME] = exec(createHTML), $export($export.P + $export.F * fails(function() { 26439 var test = ""[NAME]('"'); 26440 return test !== test.toLowerCase() || 3 < test.split('"').length; 26441 }), "String", O); 26442 }; 26443 }, { 26444 "./_defined": 150, 26445 "./_export": 155, 26446 "./_fails": 157 26447 } ], 26448 218: [ function(require, module, exports) { 26449 "use strict"; 26450 var toInteger = require("./_to-integer"), defined = require("./_defined"); 26451 module.exports = function(count) { 26452 var str = String(defined(this)), res = "", n = toInteger(count); 26453 if (n < 0 || n == 1 / 0) throw RangeError("Count can't be negative"); 26454 for (;0 < n; (n >>>= 1) && (str += str)) 1 & n && (res += str); 26455 return res; 26456 }; 26457 }, {
26458 "./_defined": 150, 26459 "./_to-integer": 224 26460 } ], 26461 219: [ function(require, module, exports) { 26462 function exporter(KEY, exec, ALIAS) { 26463 var exp = {}, FORCE = fails(function() { 26464 return !!spaces[KEY]() || "â " != "â "[KEY](); 26465 }), fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; 26466 ALIAS && (exp[ALIAS] = fn), $export($export.P + $export.F * FORCE, "String", exp); 26467 } 26468 var $export = require("./_export"), defined = require("./_defined"), fails = require("./_fails"), spaces = require("./_string-ws"), space = "[" + spaces + "]", ltrim = RegExp("^" + space + space + "*"), rtrim = RegExp(space + space + "*$"), trim = exporter.trim = function(string, TYPE) { 26469 return string = String(defined(string)), 1 & TYPE && (string = string.replace(ltrim, "")), 26470 2 & TYPE && (string = string.replace(rtrim, "")), string; 26471 }; 26472 module.exports = exporter; 26473 }, { 26474 "./_defined": 150, 26475 "./_export": 155, 26476 "./_fails": 157, 26477 "./_string-ws": 220 26478 } ], 26479 220: [ function(require, module, exports) { 26480 module.exports = "\t\n\v\f\r  áá ââââââ ââââââ¯âã\u2028\u2029\ufeff"; 26481 }, {} ], 26482 221: [ function(require, module, exports) { 26483 function run() { 26484 var id = +this; 26485 if (queue.hasOwnProperty(id)) { 26486 var fn = queue[id]; 26487 delete queue[id], fn(); 26488 } 26489 } 26490 function listener(event) { 26491 run.call(event.data); 26492 } 26493 var defer, channel, port, ctx = require("./_ctx"), invoke = require("./_invoke"), html = require("./_html"), cel = require("./_dom-create"), global = require("./_global"), process = global.process, setTask = global.setImmediate, clearTask = global.clearImmediate, MessageChannel = global.MessageChannel, Dispatch = global.Dispatch, counter = 0, queue = {}; 26494 setTask && clearTask || (setTask = function(fn) { 26495 for (var args = [], i = 1; i < arguments.length; ) args.push(arguments[i++]); 26496 return queue[++counter] = function() { 26497 invoke("function" == typeof fn ? fn : Function(fn), args); 26498 }, defer(counter), counter; 26499 }, clearTask = function(id) { 26500 delete queue[id]; 26501 }, "process" == require("./_cof")(process) ? defer = function(id) { 26502 process.nextTick(ctx(run, id, 1)); 26503 } : Dispatch && Dispatch.now ? defer = function(id) { 26504 Dispatch.now(ctx(run, id, 1)); 26505 } : MessageChannel ? (port = (channel = new MessageChannel()).port2, channel.port1.onmessage = listener, 26506 defer = ctx(port.postMessage, port, 1)) : global.addEventListener && "function" == typeof postMessage && !global.importScripts ? (defer = function(id) { 26507 global.postMessage(id + "", "*"); 26508 }, global.addEventListener("message", listener, !1)) : defer = "onreadystatechange" in cel("script") ? function(id) { 26509 html.appendChild(cel("script")).onreadystatechange = function() { 26510 html.removeChild(this), run.call(id); 26511 }; 26512 } : function(id) { 26513 setTimeout(ctx(run, id, 1), 0); 26514 }), module.exports = { 26515 set: setTask, 26516 clear: clearTask 26517 }; 26518 }, { 26519 "./_cof": 146, 26520 "./_ctx": 149, 26521 "./_dom-create": 152, 26522 "./_global": 162, 26523 "./_html": 165, 26524 "./_invoke": 168 26525 } ], 26526 222: [ function(require, module, exports) { 26527 var toInteger = require("./_to-integer"), max = Math.max, min = Math.min; 26528 module.exports = function(index, length) { 26529 return (index = toInteger(index)) < 0 ? max(index + length, 0) : min(index, length); 26530 }; 26531 }, { 26532 "./_to-integer": 224 26533 } ], 26534 223: [ function(require, module, exports) { 26535 var toInteger = require("./_to-integer"), toLength = require("./_to-length"); 26536 module.exports = function(it) { 26537 if (void 0 === it) return 0; 26538 var number = toInteger(it), length = toLength(number); 26539 if (number !== length) throw RangeError("Wrong length!"); 26540 return length; 26541 }; 26542 }, {
26543 "./_to-integer": 224, 26544 "./_to-length": 226 26545 } ], 26546 224: [ function(require, module, exports) { 26547 var ceil = Math.ceil, floor = Math.floor; 26548 module.exports = function(it) { 26549 return isNaN(it = +it) ? 0 : (0 < it ? floor : ceil)(it); 26550 }; 26551 }, {} ], 26552 225: [ function(require, module, exports) { 26553 var IObject = require("./_iobject"), defined = require("./_defined"); 26554 module.exports = function(it) { 26555 return IObject(defined(it)); 26556 }; 26557 }, { 26558 "./_defined": 150, 26559 "./_iobject": 169 26560 } ], 26561 226: [ function(require, module, exports) { 26562 var toInteger = require("./_to-integer"), min = Math.min; 26563 module.exports = function(it) { 26564 return 0 < it ? min(toInteger(it), 9007199254740991) : 0; 26565 }; 26566 }, { 26567 "./_to-integer": 224 26568 } ], 26569 227: [ function(require, module, exports) { 26570 var defined = require("./_defined"); 26571 module.exports = function(it) { 26572 return Object(defined(it)); 26573 }; 26574 }, { 26575 "./_defined": 150 26576 } ], 26577 228: [ function(require, module, exports) { 26578 var isObject = require("./_is-object"); 26579 module.exports = function(it, S) { 26580 if (!isObject(it)) return it; 26581 var fn, val; 26582 if (S && "function" == typeof (fn = it.toString) && !isObject(val = fn.call(it))) return val; 26583 if ("function" == typeof (fn = it.valueOf) && !isObject(val = fn.call(it))) return val; 26584 if (!S && "function" == typeof (fn = it.toString) && !isObject(val = fn.call(it))) return val; 26585 throw TypeError("Can't convert object to primitive value"); 26586 }; 26587 }, { 26588 "./_is-object": 172 26589 } ], 26590 229: [ function(require, module, exports) { 26591 "use strict"; 26592 if (require("./_descriptors")) { 26593 var LIBRARY = require("./_library"), global = require("./_global"), fails = require("./_fails"), $export = require("./_export"), $typed = require("./_typed"), $buffer = require("./_typed-buffer"), ctx = require("./_ctx"), anInstance = require("./_an-instance"), propertyDesc = require("./_property-desc"), hide = require("./_hide"), redefineAll = require("./_redefine-all"), toInteger = require("./_to-integer"), toLength = require("./_to-length"), toIndex = require("./_to-index"), toAbsoluteIndex = require("./_to-absolute-index"), toPrimitive = require("./_to-primitive"), has = require("./_has"), classof = require("./_classof"), isObject = require("./_is-object"), toObject = require("./_to-object"), isArrayIter = require("./_is-array-iter"), create = require("./_object-create"), getPrototypeOf = require("./_object-gpo"), gOPN = require("./_object-gopn").f, getIterFn = require("./core.get-iterator-method"), uid = require("./_uid"), wks = require("./_wks"), createArrayMethod = require("./_array-methods"), createArrayIncludes = require("./_array-includes"), speciesConstructor = require("./_species-constructor"), ArrayIterators = require("./es6.array.iterator"), Iterators = require("./_iterators"), $iterDetect = require("./_iter-detect"), setSpecies = require("./_set-species"), arrayFill = require("./_array-fill"), arrayCopyWithin = require("./_array-copy-within"), $DP = require("./_object-dp"), $GOPD = require("./_object-gopd"), dP = $DP.f, gOPD = $GOPD.f, RangeError = global.RangeError, TypeError = global.TypeError, Uint8Array = global.Uint8Array, ArrayProto = Array.prototype, $ArrayBuffer = $buffer.ArrayBuffer, $DataView = $buffer.DataView, arrayForEach = createArrayMethod(0), arrayFilter = createArrayMethod(2), arraySome = createArrayMethod(3), arrayEvery = createArrayMethod(4), arrayFind = createArrayMethod(5), arrayFindIndex = createArrayMethod(6), arrayIncludes = createArrayIncludes(!0), arrayIndexOf = createArrayIncludes(!1), arrayValues = ArrayIterators.values, arrayKeys = ArrayIterators.keys, arrayEntries = ArrayIterators.entries, arrayLastIndexOf = ArrayProto.lastIndexOf, arrayReduce = ArrayProto.reduce, arrayReduceRight = ArrayProto.reduceRight, arrayJoin = ArrayProto.join, arraySort = ArrayProto.sort, arraySlice = ArrayProto.slice, arrayToString = ArrayProto.toString, arrayToLocaleStr
26593ing = ArrayProto.toLocaleString, ITERATOR = wks("iterator"), TAG = wks("toStringTag"), TYPED_CONSTRUCTOR = uid("typed_constructor"), DEF_CONSTRUCTOR = uid("def_constructor"), ALL_CONSTRUCTORS = $typed.CONSTR, TYPED_ARRAY = $typed.TYPED, VIEW = $typed.VIEW, $map = createArrayMethod(1, function(O, length) { 26594 return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); 26595 }), LITTLE_ENDIAN = fails(function() { 26596 return 1 === new Uint8Array(new Uint16Array([ 1 ]).buffer)[0]; 26597 }), FORCED_SET = !!Uint8Array && !!Uint8Array.prototype.set && fails(function() { 26598 new Uint8Array(1).set({}); 26599 }), toOffset = function(it, BYTES) { 26600 var offset = toInteger(it); 26601 if (offset < 0 || offset % BYTES) throw RangeError("Wrong offset!"); 26602 return offset; 26603 }, validate = function(it) { 26604 if (isObject(it) && TYPED_ARRAY in it) return it; 26605 throw TypeError(it + " is not a typed array!"); 26606 }, allocate = function(C, length) { 26607 if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) throw TypeError("It is not a typed array constructor!"); 26608 return new C(length); 26609 }, speciesFromList = function(O, list) { 26610 return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); 26611 }, fromList = function(C, list) { 26612 for (var index = 0, length = list.length, result = allocate(C, length); index < length; ) result[index] = list[index++]; 26613 return result; 26614 }, addGetter = function(it, key, internal) { 26615 dP(it, key, { 26616 get: function() { 26617 return this._d[internal]; 26618 } 26619 }); 26620 }, $from = function(source, argument_1, argument_2) { 26621 var i, length, values, result, step, iterator, O = toObject(source), aLen = arguments.length, mapfn = 1 < aLen ? argument_1 : void 0, mapping = void 0 !== mapfn, iterFn = getIterFn(O); 26622 if (null != iterFn && !isArrayIter(iterFn)) { 26623 for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) values.push(step.value); 26624 O = values; 26625 } 26626 for (mapping && 2 < aLen && (mapfn = ctx(mapfn, argument_2, 2)), i = 0, length = toLength(O.length), 26627 result = allocate(this, length); i < length; i++) result[i] = mapping ? mapfn(O[i], i) : O[i]; 26628 return result; 26629 }, $of = function() { 26630 for (var index = 0, length = arguments.length, result = allocate(this, length); index < length; ) result[index] = arguments[index++]; 26631 return result; 26632 }, TO_LOCALE_BUG = !!Uint8Array && fails(function() { 26633 arrayToLocaleString.call(new Uint8Array(1)); 26634 }), $toLocaleString = function() { 26635 return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); 26636 }, proto = { 26637 copyWithin: function(target, start, argument_2) { 26638 return arrayCopyWithin.call(validate(this), target, start, 2 < arguments.length ? argument_2 : void 0); 26639 }, 26640 every: function(callbackfn, argument_1) { 26641 return arrayEvery(validate(this), callbackfn, 1 < arguments.length ? argument_1 : void 0); 26642 }, 26643 fill: function(value) { 26644 return arrayFill.apply(validate(this), arguments); 26645 }, 26646 filter: function(callbackfn, argument_1) { 26647 return speciesFromList(this, arrayFilter(validate(this), callbackfn, 1 < arguments.length ? argument_1 : void 0)); 26648 }, 26649 find: function(predicate, argument_1) { 26650 return arrayFind(validate(this), predicate, 1 < arguments.length ? argument_1 : void 0); 26651 }, 26652 findIndex: function(predicate, argument_1) { 26653 return arrayFindIndex(validate(this), predicate, 1 < arguments.length ? argument_1 : void 0); 26654 },
26655 forEach: function(callbackfn, argument_1) { 26656 arrayForEach(validate(this), callbackfn, 1 < arguments.length ? argument_1 : void 0); 26657 }, 26658 indexOf: function(searchElement, argument_1) { 26659 return arrayIndexOf(validate(this), searchElement, 1 < arguments.length ? argument_1 : void 0); 26660 }, 26661 includes: function(searchElement, argument_1) { 26662 return arrayIncludes(validate(this), searchElement, 1 < arguments.length ? argument_1 : void 0); 26663 }, 26664 join: function(separator) { 26665 return arrayJoin.apply(validate(this), arguments); 26666 }, 26667 lastIndexOf: function(searchElement) { 26668 return arrayLastIndexOf.apply(validate(this), arguments); 26669 }, 26670 map: function(mapfn, argument_1) { 26671 return $map(validate(this), mapfn, 1 < arguments.length ? argument_1 : void 0); 26672 }, 26673 reduce: function(callbackfn) { 26674 return arrayReduce.apply(validate(this), arguments); 26675 }, 26676 reduceRight: function(callbackfn) { 26677 return arrayReduceRight.apply(validate(this), arguments); 26678 }, 26679 reverse: function() { 26680 for (var value, length = validate(this).length, middle = Math.floor(length / 2), index = 0; index < middle; ) value = this[index], 26681 this[index++] = this[--length], this[length] = value; 26682 return this; 26683 }, 26684 some: function(callbackfn, argument_1) { 26685 return arraySome(validate(this), callbackfn, 1 < arguments.length ? argument_1 : void 0); 26686 }, 26687 sort: function(comparefn) { 26688 return arraySort.call(validate(this), comparefn); 26689 }, 26690 subarray: function(begin, end) { 26691 var O = validate(this), length = O.length, $begin = toAbsoluteIndex(begin, length); 26692 return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(O.buffer, O.byteOffset + $begin * O.BYTES_PER_ELEMENT, toLength((void 0 === end ? length : toAbsoluteIndex(end, length)) - $begin)); 26693 } 26694 }, $slice = function(start, end) { 26695 return speciesFromList(this, arraySlice.call(validate(this), start, end)); 26696 }, $set = function(arrayLike, argument_1) { 26697 validate(this); 26698 var offset = toOffset(argument_1, 1), length = this.length, src = toObject(arrayLike), len = toLength(src.length), index = 0; 26699 if (length < len + offset) throw RangeError("Wrong length!"); 26700 for (;index < len; ) this[offset + index] = src[index++]; 26701 }, $iterators = { 26702 entries: function() { 26703 return arrayEntries.call(validate(this)); 26704 }, 26705 keys: function() { 26706 return arrayKeys.call(validate(this)); 26707 }, 26708 values: function() { 26709 return arrayValues.call(validate(this)); 26710 } 26711 }, isTAIndex = function(target, key) { 26712 return isObject(target) && target[TYPED_ARRAY] && "symbol" != typeof key && key in target && String(+key) == String(key); 26713 }, $getDesc = function(target, key) { 26714 return isTAIndex(target, key = toPrimitive(key, !0)) ? propertyDesc(2, target[key]) : gOPD(target, key); 26715 }, $setDesc = function(target, key, desc) { 26716 return !(isTAIndex(target, key = toPrimitive(key, !0)) && isObject(desc) && has(desc, "value")) || has(desc, "get") || has(desc, "set") || desc.configurable || has(desc, "writable") && !desc.writable || has(desc, "enumerable") && !desc.enumerable ? dP(target, key, desc) : (target[key] = desc.value, 26717 target); 26718 }; 26719 ALL_CONSTRUCTORS || ($GOPD.f = $getDesc, $DP.f = $setDesc), $export($export.S + $export.F * !ALL_CONSTRUCTORS, "Object", { 26720 getOwnPropertyDescriptor: $getDesc, 26721 defineProperty: $setDesc 26722 }), fails(function() { 26723 arrayToString.call({}); 26724 }
26724) && (arrayToString = arrayToLocaleString = function() { 26725 return arrayJoin.call(this); 26726 }); 26727 var $TypedArrayPrototype$ = redefineAll({}, proto); 26728 redefineAll($TypedArrayPrototype$, $iterators), hide($TypedArrayPrototype$, ITERATOR, $iterators.values), 26729 redefineAll($TypedArrayPrototype$, { 26730 slice: $slice, 26731 set: $set, 26732 constructor: function() {}, 26733 toString: arrayToString, 26734 toLocaleString: $toLocaleString 26735 }), addGetter($TypedArrayPrototype$, "buffer", "b"), addGetter($TypedArrayPrototype$, "byteOffset", "o"), 26736 addGetter($TypedArrayPrototype$, "byteLength", "l"), addGetter($TypedArrayPrototype$, "length", "e"), 26737 dP($TypedArrayPrototype$, TAG, { 26738 get: function() { 26739 return this[TYPED_ARRAY]; 26740 } 26741 }), module.exports = function(KEY, BYTES, wrapper, CLAMPED) { 26742 function addElement(that, index) { 26743 dP(that, index, { 26744 get: function() { 26745 return function(that, index) { 26746 var data = that._d; 26747 return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); 26748 }(this, index); 26749 }, 26750 set: function(value) { 26751 return function(that, index, value) { 26752 var data = that._d; 26753 CLAMPED && (value = (value = Math.round(value)) < 0 ? 0 : 255 < value ? 255 : 255 & value), 26754 data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); 26755 }(this, index, value); 26756 }, 26757 enumerable: !0 26758 }); 26759 } 26760 var NAME = KEY + ((CLAMPED = !!CLAMPED) ? "Clamped" : "") + "Array", GETTER = "get" + KEY, SETTER = "set" + KEY, TypedArray = global[NAME], Base = TypedArray || {}, TAC = TypedArray && getPrototypeOf(TypedArray), FORCED = !TypedArray || !$typed.ABV, O = {}, TypedArrayPrototype = TypedArray && TypedArray.prototype; 26761 FORCED ? (TypedArray = wrapper(function(that, data, $offset, $length) { 26762 anInstance(that, TypedArray, NAME, "_d"); 26763 var buffer, byteLength, length, klass, index = 0, offset = 0; 26764 if (isObject(data)) { 26765 if (!(data instanceof $ArrayBuffer || "ArrayBuffer" == (klass = classof(data)) || "SharedArrayBuffer" == klass)) return TYPED_ARRAY in data ? fromList(TypedArray, data) : $from.call(TypedArray, data); 26766 buffer = data, offset = toOffset($offset, BYTES); 26767 var $len = data.byteLength; 26768 if (void 0 === $length) { 26769 if ($len % BYTES) throw RangeError("Wrong length!"); 26770 if ((byteLength = $len - offset) < 0) throw RangeError("Wrong length!"); 26771 } else if ($len < (byteLength = toLength($length) * BYTES) + offset) throw RangeError("Wrong length!"); 26772 length = byteLength / BYTES; 26773 } else length = toIndex(data), buffer = new $ArrayBuffer(byteLength = length * BYTES); 26774 for (hide(that, "_d", { 26775 b: buffer, 26776 o: offset, 26777 l: byteLength, 26778 e: length, 26779 v: new $DataView(buffer) 26780 }); index < length; ) addElement(that, index++); 26781 }), TypedArrayPrototype = TypedArray.prototype = create($TypedArrayPrototype$), 26782 hide(TypedArrayPrototype, "constructor", TypedArray)) : fails(function() { 26783 TypedArray(1); 26784 }) && fails(function() { 26785 new TypedArray(-1); 26786 }) && $iterDetect(function(iter) { 26787 new TypedArray(), new TypedArray(null), new TypedArray(1.5), new TypedArray(iter); 26788 }, !0) || (TypedArray = wrapper(function(that, data, $offset, $length) { 26789 var klass; 26790 return anInstance(that, TypedArray, NAME), isObject(data) ? data instanceof $ArrayBuffer || "ArrayBuffer" == (klass = classof(data)) || "SharedArrayBuffer" == klass ? void 0 !== $length ? new Base(data, toOffset($offset, BYTES), $length) : void 0 !== $offset ? new Base(data, toOffset($offset, BYTES)) : new Base(data) : TYPED_ARRAY in data ? fromList(TypedArray, data) : $from.call(TypedArray, data) : new Base(toIndex(data)); 26791 }
26791), arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function(key) { 26792 key in TypedArray || hide(TypedArray, key, Base[key]); 26793 }), TypedArray.prototype = TypedArrayPrototype, LIBRARY || (TypedArrayPrototype.constructor = TypedArray)); 26794 var $nativeIterator = TypedArrayPrototype[ITERATOR], CORRECT_ITER_NAME = !!$nativeIterator && ("values" == $nativeIterator.name || null == $nativeIterator.name), $iterator = $iterators.values; 26795 hide(TypedArray, TYPED_CONSTRUCTOR, !0), hide(TypedArrayPrototype, TYPED_ARRAY, NAME), 26796 hide(TypedArrayPrototype, VIEW, !0), hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray), 26797 (CLAMPED ? new TypedArray(1)[TAG] == NAME : TAG in TypedArrayPrototype) || dP(TypedArrayPrototype, TAG, { 26798 get: function() { 26799 return NAME; 26800 } 26801 }), O[NAME] = TypedArray, $export($export.G + $export.W + $export.F * (TypedArray != Base), O), 26802 $export($export.S, NAME, { 26803 BYTES_PER_ELEMENT: BYTES 26804 }), $export($export.S + $export.F * fails(function() { 26805 Base.of.call(TypedArray, 1); 26806 }), NAME, { 26807 from: $from, 26808 of: $of 26809 }), "BYTES_PER_ELEMENT" in TypedArrayPrototype || hide(TypedArrayPrototype, "BYTES_PER_ELEMENT", BYTES), 26810 $export($export.P, NAME, proto), setSpecies(NAME), $export($export.P + $export.F * FORCED_SET, NAME, { 26811 set: $set 26812 }), $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators), LIBRARY || TypedArrayPrototype.toString == arrayToString || (TypedArrayPrototype.toString = arrayToString), 26813 $export($export.P + $export.F * fails(function() { 26814 new TypedArray(1).slice(); 26815 }), NAME, { 26816 slice: $slice 26817 }), $export($export.P + $export.F * (fails(function() { 26818 return [ 1, 2 ].toLocaleString() != new TypedArray([ 1, 2 ]).toLocaleString(); 26819 }) || !fails(function() { 26820 TypedArrayPrototype.toLocaleString.call([ 1, 2 ]); 26821 })), NAME, { 26822 toLocaleString: $toLocaleString 26823 }), Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator, LIBRARY || CORRECT_ITER_NAME || hide(TypedArrayPrototype, ITERATOR, $iterator); 26824 }; 26825 } else module.exports = function() {}; 26826 }, { 26827 "./_an-instance": 137, 26828 "./_array-copy-within": 139, 26829 "./_array-fill": 140, 26830 "./_array-includes": 141, 26831 "./_array-methods": 142, 26832 "./_classof": 145, 26833 "./_ctx": 149, 26834 "./_descriptors": 151, 26835 "./_export": 155, 26836 "./_fails": 157, 26837 "./_global": 162, 26838 "./_has": 163, 26839 "./_hide": 164, 26840 "./_is-array-iter": 170, 26841 "./_is-object": 172, 26842 "./_iter-detect": 177, 26843 "./_iterators": 179, 26844 "./_library": 180, 26845 "./_object-create": 186, 26846 "./_object-dp": 187, 26847 "./_object-gopd": 189, 26848 "./_object-gopn": 191, 26849 "./_object-gpo": 193, 26850 "./_property-desc": 202, 26851 "./_redefine-all": 203, 26852 "./_set-species": 209, 26853 "./_species-constructor": 213, 26854 "./_to-absolute-index": 222, 26855 "./_to-index": 223, 26856 "./_to-integer": 224, 26857 "./_to-length": 226, 26858 "./_to-object": 227, 26859 "./_to-primitive": 228, 26860 "./_typed": 231, 26861 "./_typed-buffer": 230, 26862 "./_uid": 232, 26863 "./_wks": 236, 26864 "./core.get-iterator-method": 237, 26865 "./es6.array.iterator": 241 26866 } ], 26867 230: [ function(require, module, exports) { 26868 "use strict"; 26869 var global = require("./_global"), DESCRIPTORS = require("./_descriptors"), LIBRARY = require("./_library"), $typed = require("./_typed"), hide = require("./_hide"), redefineAll = require("./_redefine-all"), fails = require("./_fails"), anInstance = require("./_an-instance"), toInteger = require("./_to-integer"), toLe
26869ngth = require("./_to-length"), toIndex = require("./_to-index"), gOPN = require("./_object-gopn").f, dP = require("./_object-dp").f, arrayFill = require("./_array-fill"), setToStringTag = require("./_set-to-string-tag"), $ArrayBuffer = global.ArrayBuffer, $DataView = global.DataView, Math = global.Math, RangeError = global.RangeError, Infinity = global.Infinity, BaseBuffer = $ArrayBuffer, abs = Math.abs, pow = Math.pow, floor = Math.floor, log = Math.log, LN2 = Math.LN2, $BUFFER = DESCRIPTORS ? "_b" : "buffer", $LENGTH = DESCRIPTORS ? "_l" : "byteLength", $OFFSET = DESCRIPTORS ? "_o" : "byteOffset"; 26870 function packIEEE754(value, mLen, nBytes) { 26871 var e, m, c, buffer = new Array(nBytes), eLen = 8 * nBytes - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, rt = 23 === mLen ? pow(2, -24) - pow(2, -77) : 0, i = 0, s = value < 0 || 0 === value && 1 / value < 0 ? 1 : 0; 26872 for ((value = abs(value)) != value || value === Infinity ? (m = value != value ? 1 : 0, 26873 e = eMax) : (e = floor(log(value) / LN2), value * (c = pow(2, -e)) < 1 && (e--, 26874 c *= 2), 2 <= (value += 1 <= e + eBias ? rt / c : rt * pow(2, 1 - eBias)) * c && (e++, 26875 c /= 2), eMax <= e + eBias ? (m = 0, e = eMax) : 1 <= e + eBias ? (m = (value * c - 1) * pow(2, mLen), 26876 e += eBias) : (m = value * pow(2, eBias - 1) * pow(2, mLen), e = 0)); 8 <= mLen; buffer[i++] = 255 & m, 26877 m /= 256, mLen -= 8) ; 26878 for (e = e << mLen | m, eLen += mLen; 0 < eLen; buffer[i++] = 255 & e, e /= 256, 26879 eLen -= 8) ; 26880 return buffer[--i] |= 128 * s, buffer; 26881 } 26882 function unpackIEEE754(buffer, mLen, nBytes) { 26883 var m, eLen = 8 * nBytes - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, nBits = eLen - 7, i = nBytes - 1, s = buffer[i--], e = 127 & s; 26884 for (s >>= 7; 0 < nBits; e = 256 * e + buffer[i], i--, nBits -= 8) ; 26885 for (m = e & (1 << -nBits) - 1, e >>= -nBits, nBits += mLen; 0 < nBits; m = 256 * m + buffer[i], 26886 i--, nBits -= 8) ; 26887 if (0 === e) e = 1 - eBias; else { 26888 if (e === eMax) return m ? NaN : s ? -Infinity : Infinity; 26889 m += pow(2, mLen), e -= eBias; 26890 } 26891 return (s ? -1 : 1) * m * pow(2, e - mLen); 26892 } 26893 function unpackI32(bytes) { 26894 return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; 26895 } 26896 function packI8(it) { 26897 return [ 255 & it ]; 26898 } 26899 function packI16(it) { 26900 return [ 255 & it, it >> 8 & 255 ]; 26901 } 26902 function packI32(it) { 26903 return [ 255 & it, it >> 8 & 255, it >> 16 & 255, it >> 24 & 255 ]; 26904 } 26905 function packF64(it) { 26906 return packIEEE754(it, 52, 8); 26907 } 26908 function packF32(it) { 26909 return packIEEE754(it, 23, 4); 26910 } 26911 function addGetter(C, key, internal) { 26912 dP(C.prototype, key, { 26913 get: function() { 26914 return this[internal]; 26915 } 26916 }); 26917 } 26918 function get(view, bytes, index, isLittleEndian) { 26919 var intIndex = toIndex(+index); 26920 if (intIndex + bytes > view[$LENGTH]) throw RangeError("Wrong index!"); 26921 var store = view[$BUFFER]._b, start = intIndex + view[$OFFSET], pack = store.slice(start, start + bytes); 26922 return isLittleEndian ? pack : pack.reverse(); 26923 } 26924 function set(view, bytes, index, conversion, value, isLittleEndian) { 26925 var intIndex = toIndex(+index); 26926 if (intIndex + bytes > view[$LENGTH]) throw RangeError("Wrong index!"); 26927 for (var store = view[$BUFFER]._b, start = intIndex + view[$OFFSET], pack = conversion(+value), i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; 26928 } 26929 if ($typed.ABV) { 26930 if (!fails(function() { 26931 $ArrayBuffer(1); 26932 }) || !fails(function() { 26933 new $ArrayBuffer(-1); 26934 }) || fails(function() { 26935 return new $ArrayBuffer(), new $ArrayBuffer(1.5), new $ArrayBuffer(NaN), "ArrayBuffer" != $ArrayBuffer.name; 26936 })) { 26937 for (var key, ArrayBufferProto = ($ArrayBuffer = function(length) { 26938 return anInstance(this, $ArrayBuffer), new BaseBuffer(toIndex(length)); 26939 }).prototype = BaseBuffer.prototype, keys = gOPN(BaseBuffer), j = 0; keys.length > j; ) (key = keys[j++]) in $ArrayBuffer || hide($ArrayBuffer, key, BaseBuffer[key]); 26940 LIBRARY || (ArrayBufferProto.constructor = $ArrayBuffer); 26941 } 26942 var view = new $DataView(new $ArrayBuffer(2)), $setInt8 = $DataView.prototype.setInt8; 26943 view.setInt8(0, 2147483648), view.setInt8(1, 2147483649), !view.getInt8(0) && view.getInt8(1) || redefineAll($DataView.prototype, { 26944 setInt8: function(byteOffset, value) { 26945 $setInt8.call(this, byteOffset, value << 24 >> 24); 26946 }, 26947 setUint8: function(byteOffset, value) { 26948 $setInt8.call(this, byteOffset, value << 24 >> 24); 26949 } 26950 }, !0); 26951 } else $ArrayBuffer = function(length) { 26952 anInstance(this, $ArrayBuffer, "ArrayBuffer"); 26953 var byteLength = toIndex(length); 26954 this._b = arrayFill.call(new Array(byteLength), 0), this[$LENGTH] = byteLength; 26955 }, $DataView = function(buffer, byteOffset, byteLength) { 26956 anInstance(this, $DataView, "DataView"), anInstance(buffer, $ArrayBuffer, "DataView"); 26957 var bufferLength = buffer[$LENGTH], offset = toInteger(byteOffset); 26958 if (offset < 0 || bufferLength < offset) throw RangeError("Wrong offset!"); 26959 if (bufferLength < offset + (byteLength = void 0 === byteLength ? bufferLength - offset : toLength(byteLength))) throw RangeError("Wrong length!"); 26960 this[$BUFFER] = buffer, this[$OFFSET] = offset, this[$LENGTH] = byteLength; 26961 }, DESCRIPTORS && (addGetter($ArrayBuffer, "byteLength", "_l"), addGetter($DataView, "buffer", "_b"), 26962 addGetter($DataView, "byteLength", "_l"), addGetter($DataView, "byteOffset", "_o")), 26963 redefineAll($DataView.prototype, { 26964 getInt8: function(byteOffset) { 26965 return get(this, 1, byteOffset)[0] << 24 >> 24; 26966 }, 26967 getUint8: function(byteOffset) { 26968 return get(this, 1, byteOffset)[0]; 26969 }, 26970 getInt16: function(byteOffset, argument_1) { 26971 var bytes = get(this, 2, byteOffset, argument_1);
26972 return (bytes[1] << 8 | bytes[0]) << 16 >> 16; 26973 }, 26974 getUint16: function(byteOffset, argument_1) { 26975 var bytes = get(this, 2, byteOffset, argument_1); 26976 return bytes[1] << 8 | bytes[0]; 26977 }, 26978 getInt32: function(byteOffset, argument_1) { 26979 return unpackI32(get(this, 4, byteOffset, argument_1)); 26980 }, 26981 getUint32: function(byteOffset, argument_1) { 26982 return unpackI32(get(this, 4, byteOffset, argument_1)) >>> 0; 26983 }, 26984 getFloat32: function(byteOffset, argument_1) { 26985 return unpackIEEE754(get(this, 4, byteOffset, argument_1), 23, 4); 26986 }, 26987 getFloat64: function(byteOffset, argument_1) { 26988 return unpackIEEE754(get(this, 8, byteOffset, argument_1), 52, 8); 26989 }, 26990 setInt8: function(byteOffset, value) { 26991 set(this, 1, byteOffset, packI8, value); 26992 }, 26993 setUint8: function(byteOffset, value) { 26994 set(this, 1, byteOffset, packI8, value); 26995 }, 26996 setInt16: function(byteOffset, value, argument_2) { 26997 set(this, 2, byteOffset, packI16, value, argument_2); 26998 }, 26999 setUint16: function(byteOffset, value, argument_2) { 27000 set(this, 2, byteOffset, packI16, value, argument_2); 27001 }, 27002 setInt32: function(byteOffset, value, argument_2) { 27003 set(this, 4, byteOffset, packI32, value, argument_2); 27004 }, 27005 setUint32: function(byteOffset, value, argument_2) { 27006 set(this, 4, byteOffset, packI32, value, argument_2); 27007 }, 27008 setFloat32: function(byteOffset, value, argument_2) { 27009 set(this, 4, byteOffset, packF32, value, argument_2); 27010 }, 27011 setFloat64: function(byteOffset, value, argument_2) { 27012 set(this, 8, byteOffset, packF64, value, argument_2); 27013 } 27014 }); 27015 setToStringTag($ArrayBuffer, "ArrayBuffer"), setToStringTag($DataView, "DataView"), 27016 hide($DataView.prototype, $typed.VIEW, !0), exports.ArrayBuffer = $ArrayBuffer, 27017 exports.DataView = $DataView; 27018 }, {
27019 "./_an-instance": 137, 27020 "./_array-fill": 140, 27021 "./_descriptors": 151, 27022 "./_fails": 157, 27023 "./_global": 162, 27024 "./_hide": 164, 27025 "./_library": 180, 27026 "./_object-dp": 187, 27027 "./_object-gopn": 191, 27028 "./_redefine-all": 203, 27029 "./_set-to-string-tag": 210, 27030 "./_to-index": 223, 27031 "./_to-integer": 224, 27032 "./_to-length": 226, 27033 "./_typed": 231 27034 } ], 27035 231: [ function(require, module, exports) { 27036 for (var Typed, global = require("./_global"), hide = require("./_hide"), uid = require("./_uid"), TYPED = uid("typed_array"), VIEW = uid("view"), ABV = !(!global.ArrayBuffer || !global.DataView), CONSTR = ABV, i = 0, TypedArrayConstructors = "Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(","); i < 9; ) (Typed = global[TypedArrayConstructors[i++]]) ? (hide(Typed.prototype, TYPED, !0), 27037 hide(Typed.prototype, VIEW, !0)) : CONSTR = !1; 27038 module.exports = { 27039 ABV: ABV, 27040 CONSTR: CONSTR, 27041 TYPED: TYPED, 27042 VIEW: VIEW 27043 }; 27044 }, { 27045 "./_global": 162, 27046 "./_hide": 164, 27047 "./_uid": 232 27048 } ], 27049 232: [ function(require, module, exports) { 27050 var id = 0, px = Math.random(); 27051 module.exports = function(key) { 27052 return "Symbol(".concat(void 0 === key ? "" : key, ")_", (++id + px).toString(36)); 27053 }; 27054 }, {} ], 27055 233: [ function(require, module, exports) { 27056 var navigator = require("./_global").navigator; 27057 module.exports = navigator && navigator.userAgent || ""; 27058 }, { 27059 "./_global": 162 27060 } ], 27061 234: [ function(require, module, exports) { 27062 var global = require("./_global"), core = require("./_core"), LIBRARY = require("./_library"), wksExt = require("./_wks-ext"), defineProperty = require("./_object-dp").f; 27063 module.exports = function(name) { 27064 var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); 27065 "_" == name.charAt(0) || name in $Symbol || defineProperty($Symbol, name, { 27066 value: wksExt.f(name) 27067 }); 27068 }; 27069 }, { 27070 "./_core": 147, 27071 "./_global": 162, 27072 "./_library": 180, 27073 "./_object-dp": 187, 27074 "./_wks-ext": 235 27075 } ], 27076 235: [ function(require, module, exports) { 27077 exports.f = require("./_wks"); 27078 }, { 27079 "./_wks": 236 27080 } ], 27081 236: [ function(require, module, exports) { 27082 var store = require("./_shared")("wks"), uid = require("./_uid"), Symbol = require("./_global").Symbol, USE_SYMBOL = "function" == typeof Symbol; 27083 (module.exports = function(name) { 27084 return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)("Symbol." + name)); 27085 }).store = store; 27086 }, { 27087 "./_global": 162, 27088 "./_shared": 212, 27089 "./_uid": 232 27090 } ], 27091 237: [ function(require, module, exports) { 27092 var classof = require("./_classof"), ITERATOR = require("./_wks")("iterator"), Iterators = require("./_iterators"); 27093 module.exports = require("./_core").getIteratorMethod = function(it) { 27094 if (null != it) return it[ITERATOR] || it["@@iterator"] || Iterators[classof(it)]; 27095 }; 27096 }, { 27097 "./_classof": 145, 27098 "./_core": 147, 27099 "./_iterators": 179, 27100 "./_wks": 236 27101 } ], 27102 238: [ function(require, module, exports) { 27103 var $export = require("./_export"); 27104 $export($export.P, "Array", { 27105 fill: require("./_array-fill") 27106 }), require("./_add-to-unscopables")("fill"); 27107 }, { 27108 "./_add-to-unscopables": 135, 27109 "./_array-fill": 140, 27110 "./_export": 155 27111 } ], 27112 239: [ function(require, module, exports) { 27113 "use strict"; 27114 var $export = require("./_export"), $find = require("./_array-methods")(5), forced = !0; 27115 "find" in [] && Array(1).find(function() { 27116 forced = !1; 27117 }), $export($export.P + $export.F * forced, "Array", { 27118 find: function(callbackfn, argument_1) { 27119 return $find(this, callbackfn, 1 < arguments.length ? argument_1 : void 0); 27120 } 27121 }), require("./_add-to-unscopables")("find"); 27122 }, {
27123 "./_add-to-unscopables": 135, 27124 "./_array-methods": 142, 27125 "./_export": 155 27126 } ], 27127 240: [ function(require, module, exports) { 27128 "use strict"; 27129 var ctx = require("./_ctx"), $export = require("./_export"), toObject = require("./_to-object"), call = require("./_iter-call"), isArrayIter = require("./_is-array-iter"), toLength = require("./_to-length"), createProperty = require("./_create-property"), getIterFn = require("./core.get-iterator-method"); 27130 $export($export.S + $export.F * !require("./_iter-detect")(function(iter) { 27131 Array.from(iter); 27132 }), "Array", { 27133 from: function(arrayLike, argument_1, argument_2) { 27134 var length, result, step, iterator, O = toObject(arrayLike), C = "function" == typeof this ? this : Array, aLen = arguments.length, mapfn = 1 < aLen ? argument_1 : void 0, mapping = void 0 !== mapfn, index = 0, iterFn = getIterFn(O); 27135 if (mapping && (mapfn = ctx(mapfn, 2 < aLen ? argument_2 : void 0, 2)), null == iterFn || C == Array && isArrayIter(iterFn)) for (result = new C(length = toLength(O.length)); index < length; index++) createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); else for (iterator = iterFn.call(O), 27136 result = new C(); !(step = iterator.next()).done; index++) createProperty(result, index, mapping ? call(iterator, mapfn, [ step.value, index ], !0) : step.value); 27137 return result.length = index, result; 27138 } 27139 }); 27140 }, { 27141 "./_create-property": 148, 27142 "./_ctx": 149, 27143 "./_export": 155, 27144 "./_is-array-iter": 170, 27145 "./_iter-call": 174, 27146 "./_iter-detect": 177, 27147 "./_to-length": 226, 27148 "./_to-object": 227, 27149 "./core.get-iterator-method": 237 27150 } ], 27151 241: [ function(require, module, exports) { 27152 "use strict"; 27153 var addToUnscopables = require("./_add-to-unscopables"), step = require("./_iter-step"), Iterators = require("./_iterators"), toIObject = require("./_to-iobject"); 27154 module.exports = require("./_iter-define")(Array, "Array", function(iterated, kind) { 27155 this._t = toIObject(iterated), this._i = 0, this._k = kind; 27156 }, function() { 27157 var O = this._t, kind = this._k, index = this._i++; 27158 return !O || index >= O.length ? (this._t = void 0, step(1)) : step(0, "keys" == kind ? index : "values" == kind ? O[index] : [ index, O[index] ]); 27159 }, "values"), Iterators.Arguments = Iterators.Array, addToUnscopables("keys"), addToUnscopables("values"), 27160 addToUnscopables("entries"); 27161 }, { 27162 "./_add-to-unscopables": 135, 27163 "./_iter-define": 176, 27164 "./_iter-step": 178, 27165 "./_iterators": 179, 27166 "./_to-iobject": 225 27167 } ], 27168 242: [ function(require, module, exports) { 27169 "use strict"; 27170 var $export = require("./_export"), aFunction = require("./_a-function"), toObject = require("./_to-object"), fails = require("./_fails"), $sort = [].sort, test = [ 1, 2, 3 ]; 27171 $export($export.P + $export.F * (fails(function() { 27172 test.sort(void 0); 27173 }) || !fails(function() { 27174 test.sort(null); 27175 }) || !require("./_strict-method")($sort)), "Array", { 27176 sort: function(comparefn) { 27177 return void 0 === comparefn ? $sort.call(toObject(this)) : $sort.call(toObject(this), aFunction(comparefn)); 27178 } 27179 }); 27180 }, { 27181 "./_a-function": 134, 27182 "./_export": 155, 27183 "./_fails": 157, 27184 "./_strict-method": 214, 27185 "./_to-object": 227 27186 } ], 27187 243: [ function(require, module, exports) { 27188 var DateProto = Date.prototype, $toString = DateProto.toString, getTime = DateProto.getTime; 27189 new Date(NaN) + "" != "Invalid Date" && require("./_redefine")(DateProto, "toString", function() { 27190 var value = getTime.call(this); 27191 return value == value ? $toString.call(this) : "Invalid Date"; 27192 }); 27193 }, { 27194 "./_redefine": 204 27195 } ],
27196 244: [ function(require, module, exports) { 27197 var dP = require("./_object-dp").f, FProto = Function.prototype, nameRE = /^\s*function ([^ (]*)/; 27198 "name" in FProto || require("./_descriptors") && dP(FProto, "name", { 27199 configurable: !0, 27200 get: function() { 27201 try { 27202 return ("" + this).match(nameRE)[1]; 27203 } catch (e) { 27204 return ""; 27205 } 27206 } 27207 }); 27208 }, { 27209 "./_descriptors": 151, 27210 "./_object-dp": 187 27211 } ], 27212 245: [ function(require, module, exports) { 27213 var $export = require("./_export"); 27214 $export($export.S, "Math", { 27215 sign: require("./_math-sign") 27216 }); 27217 }, { 27218 "./_export": 155, 27219 "./_math-sign": 181 27220 } ], 27221 246: [ function(require, module, exports) { 27222 var $export = require("./_export"); 27223 $export($export.S, "Math", { 27224 trunc: function(it) { 27225 return (0 < it ? Math.floor : Math.ceil)(it); 27226 } 27227 }); 27228 }, { 27229 "./_export": 155 27230 } ], 27231 247: [ function(require, module, exports) { 27232 "use strict"; 27233 function toNumber(argument) { 27234 var it = toPrimitive(argument, !1); 27235 if ("string" == typeof it && 2 < it.length) { 27236 var third, radix, maxCode, first = (it = TRIM ? it.trim() : $trim(it, 3)).charCodeAt(0); 27237 if (43 === first || 45 === first) { 27238 if (88 === (third = it.charCodeAt(2)) || 120 === third) return NaN; 27239 } else if (48 === first) { 27240 switch (it.charCodeAt(1)) { 27241 case 66: 27242 case 98: 27243 radix = 2, maxCode = 49; 27244 break; 27245 27246 case 79: 27247 case 111: 27248 radix = 8, maxCode = 55; 27249 break; 27250 27251 default: 27252 return +it; 27253 } 27254 for (var code, digits = it.slice(2), i = 0, l = digits.length; i < l; i++) if ((code = digits.charCodeAt(i)) < 48 || maxCode < code) return NaN; 27255 return parseInt(digits, radix); 27256 } 27257 } 27258 return +it; 27259 } 27260 var global = require("./_global"), has = require("./_has"), cof = require("./_cof"), inheritIfRequired = require("./_inherit-if-required"), toPrimitive = require("./_to-primitive"), fails = require("./_fails"), gOPN = require("./_object-gopn").f, gOPD = require("./_object-gopd").f, dP = require("./_object-dp").f, $trim = require("./_string-trim").trim, $Number = global.Number, Base = $Number, proto = $Number.prototype, BROKEN_COF = "Number" == cof(require("./_object-create")(proto)), TRIM = "trim" in String.prototype; 27261 if (!$Number(" 0o1") || !$Number("0b1") || $Number("+0x1")) { 27262 $Number = function(value) { 27263 var it = arguments.length < 1 ? 0 : value, that = this; 27264 return that instanceof $Number && (BROKEN_COF ? fails(function() { 27265 proto.valueOf.call(that); 27266 }) : "Number" != cof(that)) ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); 27267 }; 27268 for (var key, keys = require("./_descriptors") ? gOPN(Base) : "MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","), j = 0; keys.length > j; j++) has(Base, key = keys[j]) && !has($Number, key) && dP($Number, key, gOPD(Base, key)); 27269 ($Number.prototype = proto).constructor = $Number, require("./_redefine")(global, "Number", $Number); 27270 } 27271 }, { 27272 "./_cof": 146, 27273 "./_descriptors": 151, 27274 "./_fails": 157, 27275 "./_global": 162, 27276 "./_has": 163, 27277 "./_inherit-if-required": 167, 27278 "./_object-create": 186, 27279 "./_object-dp": 187, 27280 "./_object-gopd": 189, 27281 "./_object-gopn": 191, 27282 "./_redefine": 204, 27283 "./_string-trim": 219, 27284 "./_to-primitive": 228 27285 } ],
27286 248: [ function(require, module, exports) { 27287 var $export = require("./_export"); 27288 $export($export.S + $export.F, "Object", { 27289 assign: require("./_object-assign") 27290 }); 27291 }, { 27292 "./_export": 155, 27293 "./_object-assign": 185 27294 } ], 27295 249: [ function(require, module, exports) { 27296 var isObject = require("./_is-object"), meta = require("./_meta").onFreeze; 27297 require("./_object-sap")("freeze", function($freeze) { 27298 return function(it) { 27299 return $freeze && isObject(it) ? $freeze(meta(it)) : it; 27300 }; 27301 }); 27302 }, { 27303 "./_is-object": 172, 27304 "./_meta": 182, 27305 "./_object-sap": 197 27306 } ], 27307 250: [ function(require, module, exports) { 27308 var toObject = require("./_to-object"), $keys = require("./_object-keys"); 27309 require("./_object-sap")("keys", function() { 27310 return function(it) { 27311 return $keys(toObject(it)); 27312 }; 27313 }); 27314 }, { 27315 "./_object-keys": 195, 27316 "./_object-sap": 197, 27317 "./_to-object": 227 27318 } ], 27319 251: [ function(require, module, exports) { 27320 var $export = require("./_export"); 27321 $export($export.S, "Object", { 27322 setPrototypeOf: require("./_set-proto").set 27323 }); 27324 }, { 27325 "./_export": 155, 27326 "./_set-proto": 208 27327 } ], 27328 252: [ function(require, module, exports) { 27329 "use strict"; 27330 var classof = require("./_classof"), test = {}; 27331 test[require("./_wks")("toStringTag")] = "z", test + "" != "[object z]" && require("./_redefine")(Object.prototype, "toString", function() { 27332 return "[object " + classof(this) + "]"; 27333 }, !0); 27334 }, { 27335 "./_classof": 145, 27336 "./_redefine": 204, 27337 "./_wks": 236 27338 } ], 27339 253: [ function(require, module, exports) { 27340 "use strict"; 27341 function empty() {} 27342 function isThenable(it) { 27343 var then; 27344 return !(!isObject(it) || "function" != typeof (then = it.then)) && then; 27345 } 27346 function notify(promise, isReject) { 27347 if (!promise._n) { 27348 promise._n = !0; 27349 var chain = promise._c; 27350 microtask(function() { 27351 for (var value = promise._v, ok = 1 == promise._s, i = 0, run = function(reaction) { 27352 var result, then, exited, handler = ok ? reaction.ok : reaction.fail, resolve = reaction.resolve, reject = reaction.reject, domain = reaction.domain; 27353 try { 27354 handler ? (ok || (2 == promise._h && onHandleUnhandled(promise), promise._h = 1), 27355 !0 === handler ? result = value : (domain && domain.enter(), result = handler(value), 27356 domain && (domain.exit(), exited = !0)), result === reaction.promise ? reject(TypeError("Promise-chain cycle")) : (then = isThenable(result)) ? then.call(result, resolve, reject) : resolve(result)) : reject(value); 27357 } catch (e) { 27358 domain && !exited && domain.exit(), reject(e); 27359 } 27360 }; chain.length > i; ) run(chain[i++]); 27361 promise._c = [], promise._n = !1, isReject && !promise._h && onUnhandled(promise); 27362 }); 27363 } 27364 } 27365 function $reject(value) { 27366 var promise = this; 27367 promise._d || (promise._d = !0, (promise = promise._w || promise)._v = value, promise._s = 2, 27368 promise._a || (promise._a = promise._c.slice()), notify(promise, !0)); 27369 } 27370 var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper, LIBRARY = require("./_library"), global = require("./_global"), ctx = require("./_ctx"), classof = require("./_classof"), $export = require("./_export"), isObject = require("./_is-object"), aFunction = require("./_a-function"), anInstance = require("./_an-instance"), forOf = require("./_for-of"), speciesConstructor = require("./_species-constructor"), task = require("./_task").set, microtask = require("./_microtask")(), newPromiseCapabilityModule = require("./_new-promise-capability"), perform = require("./_perform"), userAgent = require("./_user-agent"), promiseResolve = require("./_promise-resolve"), TypeError = global.TypeError, process = global.process, versions = process && process.versions, v8 = versions && versions.v8 || "", $Promise = global.Promise, isNode = "process" == classof(process), newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f, USE_NATIVE = !!function() { 27371 try { 27372 var promise = $Promise.resolve(1), FakePromise = (promise.constructor = {})[require("./_wks")("species")] = function(exec) { 27373 exec(empty, empty); 27374 }; 27375 return (isNode || "function" == typeof PromiseRejectionEvent) && promise.then(empty) instanceof FakePromise && 0 !== v8.indexOf("6.6") && -1 === userAgent.indexOf("Chrome/66"); 27376 } catch (e) {} 27377 }(), onUnhandled = function(promise) { 27378 task.call(global, function() { 27379 var result, handler, console, value = promise._v, unhandled = isUnhandled(promise); 27380 if (unhandled && (result = perform(function() { 27381 isNode ? process.emit("unhandledRejection", value, promise) : (handler = global.onunhandledrejection) ? handler({ 27382 promise: promise, 27383 reason: value 27384 }) : (console = global.console) && console.error && console.error("Unhandled promise rejection", value); 27385 }), promise._h = isNode || isUnhandled(promise) ? 2 : 1), promise._a = void 0, unhandled && result.e) throw result.v; 27386 }); 27387 }, isUnhandled = function(promise) { 27388 return 1 !== promise._h && 0 === (promise._a || promise._c).length; 27389 }, onHandleUnhandled = function(promise) { 27390 task.call(global, function() { 27391 var handler; 27392 isNode ? process.emit("rejectionHandled", promise) : (handler = global.onrejectionhandled) && handler({ 27393 promise: promise, 27394 reason: promise._v 27395 }); 27396 }); 27397 }, $resolve = function(value) { 27398 var then, promise = this; 27399 if (!promise._d) { 27400 promise._d = !0, promise = promise._w || promise; 27401 try { 27402 if (promise === value) throw TypeError("Promise can't be resolved
27402itself"); 27403 (then = isThenable(value)) ? microtask(function() { 27404 var wrapper = { 27405 _w: promise, 27406 _d: !1 27407 }; 27408 try { 27409 then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); 27410 } catch (e) { 27411 $reject.call(wrapper, e); 27412 } 27413 }) : (promise._v = value, promise._s = 1, notify(promise, !1)); 27414 } catch (e) { 27415 $reject.call({ 27416 _w: promise, 27417 _d: !1 27418 }, e); 27419 } 27420 } 27421 }; 27422 USE_NATIVE || ($Promise = function(executor) { 27423 anInstance(this, $Promise, "Promise", "_h"), aFunction(executor), Internal.call(this); 27424 try { 27425 executor(ctx($resolve, this, 1), ctx($reject, this, 1)); 27426 } catch (err) { 27427 $reject.call(this, err); 27428 } 27429 }, (Internal = function(executor) { 27430 this._c = [], this._a = void 0, this._s = 0, this._d = !1, this._v = void 0, this._h = 0, 27431 this._n = !1; 27432 }).prototype = require("./_redefine-all")($Promise.prototype, { 27433 then: function(onFulfilled, onRejected) { 27434 var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); 27435 return reaction.ok = "function" != typeof onFulfilled || onFulfilled, reaction.fail = "function" == typeof onRejected && onRejected, 27436 reaction.domain = isNode ? process.domain : void 0, this._c.push(reaction), this._a && this._a.push(reaction), 27437 this._s && notify(this, !1), reaction.promise; 27438 }, 27439 catch: function(onRejected) { 27440 return this.then(void 0, onRejected); 27441 } 27442 }), OwnPromiseCapability = function() { 27443 var promise = new Internal(); 27444 this.promise = promise, this.resolve = ctx($resolve, promise, 1), this.reject = ctx($reject, promise, 1); 27445 }, newPromiseCapabilityModule.f = newPromiseCapability = function(C) { 27446 return C === $Promise || C === Wrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); 27447 }), $export($export.G + $export.W + $export.F * !USE_NATIVE, { 27448 Promise: $Promise 27449 }), require("./_set-to-string-tag")($Promise, "Promise"), require("./_set-species")("Promise"), 27450 Wrapper = require("./_core").Promise, $export($export.S + $export.F * !USE_NATIVE, "Promise", { 27451 reject: function(r) { 27452 var capability = newPromiseCapability(this); 27453 return (0, capability.reject)(r), capability.promise; 27454 } 27455 }), $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), "Promise", { 27456 resolve: function(x) { 27457 return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); 27458 } 27459 }), $export($export.S + $export.F * !(USE_NATIVE && require("./_iter-detect")(function(iter) { 27460 $Promise.all(iter).catch(empty); 27461 })), "Promise", { 27462 all: function(iterable) { 27463 var C = this, capability = newPromiseCapability(C), resolve = capability.resolve, reject = capability.reject, result = perform(function() { 27464 var values = [], index = 0, remaining = 1; 27465 forOf(iterable, !1, function(promise) { 27466 var $index = index++, alreadyCalled = !1; 27467 values.push(void 0), remaining++, C.resolve(promise).then(function(value) { 27468 alreadyCalled || (alreadyCalled = !0, values[$index] = value, --remaining || resolve(values)); 27469 }, reject); 27470 }), --remaining || resolve(values); 27471 }); 27472 return result.e && reject(result.v), capability.promise; 27473 }, 27474 race: function(iterable) { 27475 var C = this, capability = newPromiseCapability(C), reject = capability.reject, result = perform(function() { 27476 forOf(iterable, !1, function(promise) { 27477 C.resolve(promise).then(capability.resolve, reject); 27478 }); 27479 }); 27480 return result.e && reject(result.v), capability.promise; 27481 } 27482 }); 27483 }, {
27484 "./_a-function": 134, 27485 "./_an-instance": 137, 27486 "./_classof": 145, 27487 "./_core": 147, 27488 "./_ctx": 149, 27489 "./_export": 155, 27490 "./_for-of": 160, 27491 "./_global": 162, 27492 "./_is-object": 172, 27493 "./_iter-detect": 177, 27494 "./_library": 180, 27495 "./_microtask": 183, 27496 "./_new-promise-capability": 184, 27497 "./_perform": 200, 27498 "./_promise-resolve": 201, 27499 "./_redefine-all": 203, 27500 "./_set-species": 209, 27501 "./_set-to-string-tag": 210, 27502 "./_species-constructor": 213, 27503 "./_task": 221, 27504 "./_user-agent": 233, 27505 "./_wks": 236 27506 } ], 27507 254: [ function(require, module, exports) { 27508 var gOPD = require("./_object-gopd"), getPrototypeOf = require("./_object-gpo"), has = require("./_has"), $export = require("./_export"), isObject = require("./_is-object"), anObject = require("./_an-object"); 27509 $export($export.S, "Reflect", { 27510 get: function get(target, propertyKey) { 27511 var desc, proto, receiver = arguments.length < 3 ? target : arguments[2]; 27512 return anObject(target) === receiver ? target[propertyKey] : (desc = gOPD.f(target, propertyKey)) ? has(desc, "value") ? desc.value : void 0 !== desc.get ? desc.get.call(receiver) : void 0 : isObject(proto = getPrototypeOf(target)) ? get(proto, propertyKey, receiver) : void 0; 27513 } 27514 }); 27515 }, { 27516 "./_an-object": 138, 27517 "./_export": 155, 27518 "./_has": 163, 27519 "./_is-object": 172, 27520 "./_object-gopd": 189, 27521 "./_object-gpo": 193 27522 } ], 27523 255: [ function(require, module, exports) { 27524 var global = require("./_global"), inheritIfRequired = require("./_inherit-if-required"), dP = require("./_object-dp").f, gOPN = require("./_object-gopn").f, isRegExp = require("./_is-regexp"), $flags = require("./_flags"), $RegExp = global.RegExp, Base = $RegExp, proto = $RegExp.prototype, re1 = /a/g, re2 = /a/g, CORRECT_NEW = new $RegExp(re1) !== re1; 27525 if (require("./_descriptors") && (!CORRECT_NEW || require("./_fails")(function() { 27526 return re2[require("./_wks")("match")] = !1, $RegExp(re1) != re1 || $RegExp(re2) == re2 || "/a/i" != $RegExp(re1, "i"); 27527 }))) { 27528 $RegExp = function(p, f) { 27529 var tiRE = this instanceof $RegExp, piRE = isRegExp(p), fiU = void 0 === f; 27530 return !tiRE && piRE && p.constructor === $RegExp && fiU ? p : inheritIfRequired(CORRECT_NEW ? new Base(piRE && !fiU ? p.source : p, f) : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f), tiRE ? this : proto, $RegExp); 27531 }; 27532 function proxy(key) { 27533 key in $RegExp || dP($RegExp, key, { 27534 configurable: !0, 27535 get: function() { 27536 return Base[key]; 27537 }, 27538 set: function(it) { 27539 Base[key] = it; 27540 } 27541 }); 27542 } 27543 for (var keys = gOPN(Base), i = 0; keys.length > i; ) proxy(keys[i++]); 27544 (proto.constructor = $RegExp).prototype = proto, require("./_redefine")(global, "RegExp", $RegExp); 27545 } 27546 require("./_set-species")("RegExp"); 27547 }, { 27548 "./_descriptors": 151, 27549 "./_fails": 157, 27550 "./_flags": 159, 27551 "./_global": 162, 27552 "./_inherit-if-required": 167, 27553 "./_is-regexp": 173, 27554 "./_object-dp": 187, 27555 "./_object-gopn": 191, 27556 "./_redefine": 204, 27557 "./_set-species": 209, 27558 "./_wks": 236 27559 } ], 27560 256: [ function(require, module, exports) { 27561 "use strict"; 27562 var regexpExec = require("./_regexp-exec"); 27563 require("./_export")({ 27564 target: "RegExp", 27565 proto: !0, 27566 forced: regexpExec !== /./.exec 27567 }, { 27568 exec: regexpExec 27569 }); 27570 }, { 27571 "./_export": 155, 27572 "./_regexp-exec": 206 27573 } ], 27574 257: [ function(require, module, exports) { 27575 require("./_descriptors") && "g" != /./g.flags && require("./_object-dp").f(RegExp.prototype, "flags", { 27576 configurable: !0, 27577 get: require("./_flags") 27578 }); 27579 }, {
27580 "./_descriptors": 151, 27581 "./_flags": 159, 27582 "./_object-dp": 187 27583 } ], 27584 258: [ function(require, module, exports) { 27585 "use strict"; 27586 var anObject = require("./_an-object"), toLength = require("./_to-length"), advanceStringIndex = require("./_advance-string-index"), regExpExec = require("./_regexp-exec-abstract"); 27587 require("./_fix-re-wks")("match", 1, function(defined, MATCH, $match, maybeCallNative) { 27588 return [ function(regexp) { 27589 var O = defined(this), fn = null == regexp ? void 0 : regexp[MATCH]; 27590 return void 0 !== fn ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); 27591 }, function(regexp) { 27592 var res = maybeCallNative($match, regexp, this); 27593 if (res.done) return res.value; 27594 var rx = anObject(regexp), S = String(this); 27595 if (!rx.global) return regExpExec(rx, S); 27596 for (var result, fullUnicode = rx.unicode, A = [], n = rx.lastIndex = 0; null !== (result = regExpExec(rx, S)); ) { 27597 var matchStr = String(result[0]); 27598 "" === (A[n] = matchStr) && (rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode)), 27599 n++; 27600 } 27601 return 0 === n ? null : A; 27602 } ]; 27603 }); 27604 }, { 27605 "./_advance-string-index": 136, 27606 "./_an-object": 138, 27607 "./_fix-re-wks": 158, 27608 "./_regexp-exec-abstract": 205, 27609 "./_to-length": 226 27610 } ], 27611 259: [ function(require, module, exports) { 27612 "use strict"; 27613 var anObject = require("./_an-object"), toObject = require("./_to-object"), toLength = require("./_to-length"), toInteger = require("./_to-integer"), advanceStringIndex = require("./_advance-string-index"), regExpExec = require("./_regexp-exec-abstract"), max = Math.max, min = Math.min, floor = Math.floor, SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g, SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g; 27614 require("./_fix-re-wks")("replace", 2, function(defined, REPLACE, $replace, maybeCallNative) { 27615 return [ function(searchValue, replaceValue) { 27616 var O = defined(this), fn = null == searchValue ? void 0 : searchValue[REPLACE]; 27617 return void 0 !== fn ? fn.call(searchValue, O, replaceValue) : $replace.call(String(O), searchValue, replaceValue); 27618 }, function(regexp, replaceValue) { 27619 var res = maybeCallNative($replace, regexp, this, replaceValue); 27620 if (res.done) return res.value; 27621 var rx = anObject(regexp), S = String(this), functionalReplace = "function" == typeof replaceValue; 27622 functionalReplace || (replaceValue = String(replaceValue)); 27623 var global = rx.global; 27624 if (global) { 27625 var fullUnicode = rx.unicode; 27626 rx.lastIndex = 0; 27627 } 27628 for (var results = []; ;) { 27629 var result = regExpExec(rx, S); 27630 if (null === result) break; 27631 if (results.push(result), !global) break; 27632 "" === String(result[0]) && (rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode)); 27633 } 27634 for (var it, accumulatedResult = "", nextSourcePosition = 0, i = 0; i < results.length; i++) { 27635 result = results[i]; 27636 for (var matched = String(result[0]), position = max(min(toInteger(result.index), S.length), 0), captures = [], j = 1; j < result.length; j++) captures.push(void 0 === (it = result[j]) ? it : String(it)); 27637 var namedCaptures = result.groups; 27638 if (functionalReplace) { 27639 var replacerArgs = [ matched ].concat(captures, position, S); 27640 void 0 !== namedCaptures && replacerArgs.push(namedCaptures); 27641 var replacement = String(replaceValue.apply(void 0, replacerArgs)); 27642 } else replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); 27643 nextSourcePosition <= position && (accumulatedResult += S.slice(nextSourcePosition, position) + replacement, 27644 nextSourcePosition = position + matched.length); 27645 } 27646 return accumulatedResult + S.slice(nextSourcePosition); 27647 } ]; 27648 function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { 27649 var tailPos = position + matched.length, m = captures.length, symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; 27650 return void 0 !== namedCaptures && (namedCaptures = toObject(namedCaptures), symbols = SUBSTITUTION_SYMBOLS), 27651 $replace.call(replacement, symbols, function(match, ch) { 27652 var capture; 27653 switch (ch.charAt(0)) { 27654 case "$": 27655 return "$"; 27656 27657 case "&": 27658 return matched; 27659 27660 case "`": 27661 return str.slice(0, position); 27662
27663 case "'": 27664 return str.slice(tailPos); 27665 27666 case "<": 27667 capture = namedCaptures[ch.slice(1, -1)]; 27668 break; 27669 27670 default: 27671 var n = +ch; 27672 if (0 == n) return match; 27673 if (m < n) { 27674 var f = floor(n / 10); 27675 return 0 === f ? match : f <= m ? void 0 === captures[f - 1] ? ch.charAt(1) : captures[f - 1] + ch.charAt(1) : match; 27676 } 27677 capture = captures[n - 1]; 27678 } 27679 return void 0 === capture ? "" : capture; 27680 }); 27681 } 27682 }); 27683 }, { 27684 "./_advance-string-index": 136, 27685 "./_an-object": 138, 27686 "./_fix-re-wks": 158, 27687 "./_regexp-exec-abstract": 205, 27688 "./_to-integer": 224, 27689 "./_to-length": 226, 27690 "./_to-object": 227 27691 } ], 27692 260: [ function(require, module, exports) { 27693 "use strict"; 27694 var anObject = require("./_an-object"), sameValue = require("./_same-value"), regExpExec = require("./_regexp-exec-abstract"); 27695 require("./_fix-re-wks")("search", 1, function(defined, SEARCH, $search, maybeCallNative) { 27696 return [ function(regexp) { 27697 var O = defined(this), fn = null == regexp ? void 0 : regexp[SEARCH]; 27698 return void 0 !== fn ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); 27699 }, function(regexp) { 27700 var res = maybeCallNative($search, regexp, this); 27701 if (res.done) return res.value; 27702 var rx = anObject(regexp), S = String(this), previousLastIndex = rx.lastIndex; 27703 sameValue(previousLastIndex, 0) || (rx.lastIndex = 0); 27704 var result = regExpExec(rx, S); 27705 return sameValue(rx.lastIndex, previousLastIndex) || (rx.lastIndex = previousLastIndex), 27706 null === result ? -1 : result.index; 27707 } ]; 27708 }); 27709 }, { 27710 "./_an-object": 138, 27711 "./_fix-re-wks": 158, 27712 "./_regexp-exec-abstract": 205, 27713 "./_same-value": 207 27714 } ], 27715 261: [ function(require, module, exports) { 27716 "use strict"; 27717 var isRegExp = require("./_is-regexp"), anObject = require("./_an-object"), speciesConstructor = require("./_species-constructor"), advanceStringIndex = require("./_advance-string-index"), toLength = require("./_to-length"), callRegExpExec = require("./_regexp-exec-abstract"), regexpExec = require("./_regexp-exec"), fails = require("./_fails"), $min = Math.min, $push = [].push, SUPPORTS_Y = !fails(function() { 27718 RegExp(4294967295, "y"); 27719 }); 27720 require("./_fix-re-wks")("split", 2, function(defined, SPLIT, $split, maybeCallNative) { 27721 var internalSplit; 27722 return internalSplit = "c" == "abbc".split(/(b)*/)[1] || 4 != "test".split(/(?:)/, -1).length || 2 != "ab".split(/(?:ab)*/).length || 4 != ".".split(/(.?)(.?)/).length || 1 < ".".split(/()()/).length || "".split(/.?/).length ? function(separator, limit) { 27723 var string = String(this); 27724 if (void 0 === separator && 0 === limit) return []; 27725 if (!isRegExp(separator)) return $split.call(string, separator, limit); 27726 for (var match, lastIndex, lastLength, output = [], flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.unicode ? "u" : "") + (separator.sticky ? "y" : ""), lastLastIndex = 0, splitLimit = void 0 === limit ? 4294967295 : limit >>> 0, separatorCopy = new RegExp(separator.source, flags + "g"); (match = regexpExec.call(separatorCopy, string)) && !(lastLastIndex < (lastIndex = separatorCopy.lastIndex) && (output.push(string.slice(lastLastIndex, match.index)), 27727 1 < match.length && match.index < string.length && $push.apply(output, match.slice(1)), 27728 lastLength = match[0].length, lastLastIndex = lastIndex, output.length >= splitLimit)); ) separatorCopy.lastIndex === match.index && separatorCopy.lastIndex++; 27729 return lastLastIndex === string.length ? !lastLength && separatorCopy.test("") || output.push("") : output.push(string.slice(lastLastIndex)), 27730 output.length > splitLimit ? output.slice(0, splitLimit) : output; 27731 } : "0".split(void 0, 0).length ? function(separator, limit) { 27732 return void 0 === separator && 0 === limit ? [] : $split.call(this, separator, limit); 27733 } : $split, [ function(separator, limit) { 27734 var O = defined(this), splitter = null == separator ? void 0 : separator[SPLIT]; 27735 return void 0 !== splitter ? splitter.call(separator, O, limit) : internalSplit.call(String(O), separator, limit); 27736 }, function(regexp, limit) { 27737 var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split); 27738 if (res.done) return res.value; 27739 var rx = anObject(regexp), S = String(this), C = speciesConstructor(rx, RegExp), unicodeMatching = rx.unicode, flags = (rx.ignoreCase ? "i" : "") + (rx.multiline ? "m" : "") + (rx.unicode ? "u" : "") + (SUPPORTS_Y ? "
27739y" : "g"), splitter = new C(SUPPORTS_Y ? rx : "^(?:" + rx.source + ")", flags), lim = void 0 === limit ? 4294967295 : limit >>> 0; 27740 if (0 == lim) return []; 27741 if (0 === S.length) return null === callRegExpExec(splitter, S) ? [ S ] : []; 27742 for (var p = 0, q = 0, A = []; q < S.length; ) { 27743 splitter.lastIndex = SUPPORTS_Y ? q : 0; 27744 var e, z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q)); 27745 if (null === z || (e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p) q = advanceStringIndex(S, q, unicodeMatching); else { 27746 if (A.push(S.slice(p, q)), A.length === lim) return A; 27747 for (var i = 1; i <= z.length - 1; i++) if (A.push(z[i]), A.length === lim) return A; 27748 q = p = e; 27749 } 27750 } 27751 return A.push(S.slice(p)), A; 27752 } ]; 27753 }); 27754 }, { 27755 "./_advance-string-index": 136, 27756 "./_an-object": 138, 27757 "./_fails": 157, 27758 "./_fix-re-wks": 158, 27759 "./_is-regexp": 173, 27760 "./_regexp-exec": 206, 27761 "./_regexp-exec-abstract": 205, 27762 "./_species-constructor": 213, 27763 "./_to-length": 226 27764 } ], 27765 262: [ function(require, module, exports) { 27766 "use strict"; 27767 require("./es6.regexp.flags"); 27768 function define(fn) { 27769 require("./_redefine")(RegExp.prototype, "toString", fn, !0); 27770 } 27771 var anObject = require("./_an-object"), $flags = require("./_flags"), DESCRIPTORS = require("./_descriptors"), $toString = /./.toString; 27772 require("./_fails")(function() { 27773 return "/a/b" != $toString.call({ 27774 source: "a", 27775 flags: "b" 27776 }); 27777 }) ? define(function() { 27778 var R = anObject(this); 27779 return "/".concat(R.source, "/", "flags" in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : void 0); 27780 }) : "toString" != $toString.name && define(function() { 27781 return $toString.call(this); 27782 }); 27783 }, { 27784 "./_an-object": 138, 27785 "./_descriptors": 151, 27786 "./_fails": 157, 27787 "./_flags": 159, 27788 "./_redefine": 204, 27789 "./es6.regexp.flags": 257 27790 } ], 27791 263: [ function(require, module, exports) { 27792 "use strict"; 27793 var $export = require("./_export"), toLength = require("./_to-length"), context = require("./_string-context"), $endsWith = "".endsWith; 27794 $export($export.P + $export.F * require("./_fails-is-regexp")("endsWith"), "String", { 27795 endsWith: function(searchString, argument_1) { 27796 var that = context(this, searchString, "endsWith"), endPosition = 1 < arguments.length ? argument_1 : void 0, len = toLength(that.length), end = void 0 === endPosition ? len : Math.min(toLength(endPosition), len), search = String(searchString); 27797 return $endsWith ? $endsWith.call(that, search, end) : that.slice(end - search.length, end) === search; 27798 } 27799 }); 27800 }, { 27801 "./_export": 155, 27802 "./_fails-is-regexp": 156, 27803 "./_string-context": 216, 27804 "./_to-length": 226 27805 } ], 27806 264: [ function(require, module, exports) { 27807 "use strict"; 27808 var $export = require("./_export"), context = require("./_string-context"); 27809 $export($export.P + $export.F * require("./_fails-is-regexp")("includes"), "String", { 27810 includes: function(searchString, argument_1) { 27811 return !!~context(this, searchString, "includes").indexOf(searchString, 1 < arguments.length ? argument_1 : void 0); 27812 } 27813 }); 27814 }, { 27815 "./_export": 155, 27816 "./_fails-is-regexp": 156, 27817 "./_string-context": 216 27818 } ], 27819 265: [ function(require, module, exports) { 27820 "use strict"; 27821 var $at = require("./_string-at")(!0); 27822 require("./_iter-define")(String, "String", function(iterated) { 27823 this._t = String(iterated), this._i = 0; 27824 }, function() { 27825 var point, O = this._t, index = this._i; 27826 return index >= O.length ? { 27827 value: void 0, 27828 done: !0 27829 } : (point = $at(O, index), this._i += point.length, { 27830 value: point, 27831 done: !1 27832 }); 27833 }); 27834 }, {
27835 "./_iter-define": 176, 27836 "./_string-at": 215 27837 } ], 27838 266: [ function(require, module, exports) { 27839 "use strict"; 27840 require("./_string-html")("link", function(createHTML) { 27841 return function(url) { 27842 return createHTML(this, "a", "href", url); 27843 }; 27844 }); 27845 }, { 27846 "./_string-html": 217 27847 } ], 27848 267: [ function(require, module, exports) { 27849 var $export = require("./_export"); 27850 $export($export.P, "String", { 27851 repeat: require("./_string-repeat") 27852 }); 27853 }, { 27854 "./_export": 155, 27855 "./_string-repeat": 218 27856 } ], 27857 268: [ function(require, module, exports) { 27858 "use strict"; 27859 function wrap(tag) { 27860 var sym = AllSymbols[tag] = _create($Symbol.prototype); 27861 return sym._k = tag, sym; 27862 } 27863 function $defineProperties(it, P) { 27864 anObject(it); 27865 for (var key, keys = enumKeys(P = toIObject(P)), i = 0, l = keys.length; i < l; ) $defineProperty(it, key = keys[i++], P[key]); 27866 return it; 27867 } 27868 function $propertyIsEnumerable(key) { 27869 var E = isEnum.call(this, key = toPrimitive(key, !0)); 27870 return !(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) && (!(E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key]) || E); 27871 } 27872 function $getOwnPropertyDescriptor(it, key) { 27873 if (it = toIObject(it), key = toPrimitive(key, !0), it !== ObjectProto || !has(AllSymbols, key) || has(OPSymbols, key)) { 27874 var D = gOPD(it, key); 27875 return !D || !has(AllSymbols, key) || has(it, HIDDEN) && it[HIDDEN][key] || (D.enumerable = !0), 27876 D; 27877 } 27878 } 27879 function $getOwnPropertyNames(it) { 27880 for (var key, names = gOPN(toIObject(it)), result = [], i = 0; names.length > i; ) has(AllSymbols, key = names[i++]) || key == HIDDEN || key == META || result.push(key); 27881 return result; 27882 } 27883 function $getOwnPropertySymbols(it) { 27884 for (var key, IS_OP = it === ObjectProto, names = gOPN(IS_OP ? OPSymbols : toIObject(it)), result = [], i = 0; names.length > i; ) !has(AllSymbols, key = names[i++]) || IS_OP && !has(ObjectProto, key) || result.push(AllSymbols[key]); 27885 return result; 27886 } 27887 var global = require("./_global"), has = require("./_has"), DESCRIPTORS = require("./_descriptors"), $export = require("./_export"), redefine = require("./_redefine"), META = require("./_meta").KEY, $fails = require("./_fails"), shared = require("./_shared"), setToStringTag = require("./_set-to-string-tag"), uid = require("./_uid"), wks = require("./_wks"), wksExt = require("./_wks-ext"), wksDefine = require("./_wks-define"), enumKeys = require("./_enum-keys"), isArray = require("./_is-array"), anObject = require("./_an-object"), isObject = require("./_is-object"), toObject = require("./_to-object"), toIObject = require("./_to-iobject"), toPrimitive = require("./_to-primitive"), createDesc = require("./_property-desc"), _create = require("./_object-create"), gOPNExt = require("./_object-gopn-ext"), $GOPD = require("./_object-gopd"), $GOPS = require("./_object-gops"), $DP = require("./_object-dp"), $keys = require("./_object-keys"), gOPD = $GOPD.f, dP = $DP.f, gOPN = gOPNExt.f, $Symbol = global.Symbol, $JSON = global.JSON, _stringify = $JSON && $JSON.stringify, HIDDEN = wks("_hidden"), TO_PRIMITIVE = wks("toPrimitive"), isEnum = {}.propertyIsEnumerable, SymbolRegistry = shared("symbol-registry"), AllSymbols = shared("symbols"), OPSymbols = shared("op-symbols"), ObjectProto = Object.prototype, USE_NATIVE = "function" == typeof $Symbol && !!$GOPS.f, QObject = global.QObject, setter = !QObject || !QObject.prototype || !QObject.prototype.findChild, setSymbolDesc = DESCRIPTORS && $fails(function() { 27888 return 7 != _create(dP({}, "a", { 27889 get: function() { 27890 return dP(this, "a", { 27891 value: 7 27892 }).a; 27893 } 27894 })).a; 27895 }) ? function(it, key, D) { 27896 var protoDesc = gOPD(ObjectProto, key); 27897 protoDesc && delete ObjectProto[key], dP(it, key, D), protoDesc && it !== ObjectProto && dP(ObjectProto, key, protoDesc); 27898 } : dP, isSymbol = USE_NATIVE && "symbol" == typeof $Symbol.iterator ? function(it) { 27899 return "symbol" == typeof it; 27900 } : function(it) { 27901 return it instanceof $Symbol; 27902 }, $defineProperty = function(it, key, D) { 27903 return it === ObjectProto && $defineProperty(OPSymbols, key, D), anObject(it), key = toPrimitive(key, !0), 27904 anObject(D), has(AllSymbols, key) ? (D.enumerable ? (has(it, HIDDEN) && it[HIDDEN][key] && (it[HIDDEN][key] = !1), 27905 D = _create(D, { 27906 enumerable: createDesc(0, !1) 27907 })) : (has(it, HIDDEN) || dP(it, HIDDEN, createDesc(1, {})), it[HIDDEN][key] = !0), 27908 setSymbolDesc(it, key, D)) : dP(it, key, D); 27909 }; 27910 USE_NATIVE || (redefine(($Symbol = function(argument_0) { 27911 if (this instanceof $Symbol) throw TypeError("Symbol is not a constructor!"); 27912 var tag = uid(0 < arguments.length ? argument_0 : void 0), $set = function(value) { 27913 this === ObjectProto && $set.call(OPSymbols, value), has(this, HIDDEN) && has(this[HIDDEN], tag) && (this[HIDDEN][tag] = !1), 27914 setSymbolDesc(this, tag, createDesc(1, value)); 27915 }; 27916 return DESCRIPTORS && setter && setSymbolDesc(ObjectProto, tag, { 27917 configurable: !0, 27918 set: $set 27919 }), wrap(tag); 27920 }).prototype, "toString", function() { 27921 return this._k; 27922 }), $GOPD.f = $getOwnPropertyDescriptor, $DP.f = $defineProperty, require("./_object-gopn").f = gOPNExt.f = $getOwnPropertyNames, 27923 require("./_object-pie").f = $propertyIsEnumerable, $GOPS.f = $getOwnPropertySymbols, 27924 DESCRIPTORS && !require("./_library") && redefine(ObjectProto, "propertyIsEnumerable", $propertyIsEnumerable, !0), 27925 wksExt.f = function(name) { 27926 return wrap(wks(name)); 27927 }), $export($export.G + $export.W + $export.F * !USE_NATIVE, {
27928 Symbol: $Symbol 27929 }); 27930 for (var es6Symbols = "hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","), j = 0; es6Symbols.length > j; ) wks(es6Symbols[j++]); 27931 for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k; ) wksDefine(wellKnownSymbols[k++]); 27932 $export($export.S + $export.F * !USE_NATIVE, "Symbol", { 27933 for: function(key) { 27934 return has(SymbolRegistry, key += "") ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key); 27935 }, 27936 keyFor: function(sym) { 27937 if (!isSymbol(sym)) throw TypeError(sym + " is not a symbol!"); 27938 for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; 27939 }, 27940 useSetter: function() { 27941 setter = !0; 27942 }, 27943 useSimple: function() { 27944 setter = !1; 27945 } 27946 }), $export($export.S + $export.F * !USE_NATIVE, "Object", { 27947 create: function(it, P) { 27948 return void 0 === P ? _create(it) : $defineProperties(_create(it), P); 27949 }, 27950 defineProperty: $defineProperty, 27951 defineProperties: $defineProperties, 27952 getOwnPropertyDescriptor: $getOwnPropertyDescriptor, 27953 getOwnPropertyNames: $getOwnPropertyNames, 27954 getOwnPropertySymbols: $getOwnPropertySymbols 27955 });
27956 var FAILS_ON_PRIMITIVES = $fails(function() { 27957 $GOPS.f(1); 27958 }); 27959 $export($export.S + $export.F * FAILS_ON_PRIMITIVES, "Object", { 27960 getOwnPropertySymbols: function(it) { 27961 return $GOPS.f(toObject(it)); 27962 } 27963 }), $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function() { 27964 var S = $Symbol(); 27965 return "[null]" != _stringify([ S ]) || "{}" != _stringify({ 27966 a: S 27967 }) || "{}" != _stringify(Object(S)); 27968 })), "JSON", { 27969 stringify: function(it) { 27970 for (var replacer, $replacer, args = [ it ], i = 1; i < arguments.length; ) args.push(arguments[i++]); 27971 if ($replacer = replacer = args[1], (isObject(replacer) || void 0 !== it) && !isSymbol(it)) return isArray(replacer) || (replacer = function(key, value) { 27972 if ("function" == typeof $replacer && (value = $replacer.call(this, key, value)), 27973 !isSymbol(value)) return value; 27974 }), args[1] = replacer, _stringify.apply($JSON, args); 27975 } 27976 }), $Symbol.prototype[TO_PRIMITIVE] || require("./_hide")($Symbol.prototype, TO_PRIMITIVE, $Symbol.prototype.valueOf), 27977 setToStringTag($Symbol, "Symbol"), setToStringTag(Math, "Math", !0), setToStringTag(global.JSON, "JSON", !0); 27978 }, { 27979 "./_an-object": 138, 27980 "./_descriptors": 151, 27981 "./_enum-keys": 154, 27982 "./_export": 155, 27983 "./_fails": 157, 27984 "./_global": 162, 27985 "./_has": 163, 27986 "./_hide": 164, 27987 "./_is-array": 171, 27988 "./_is-object": 172, 27989 "./_library": 180, 27990 "./_meta": 182, 27991 "./_object-create": 186, 27992 "./_object-dp": 187, 27993 "./_object-gopd": 189, 27994 "./_object-gopn": 191, 27995 "./_object-gopn-ext": 190, 27996 "./_object-gops": 192, 27997 "./_object-keys": 195, 27998 "./_object-pie": 196, 27999 "./_property-desc": 202, 28000 "./_redefine": 204, 28001 "./_set-to-string-tag": 210, 28002 "./_shared": 212, 28003 "./_to-iobject": 225, 28004 "./_to-object": 227, 28005 "./_to-primitive": 228, 28006 "./_uid": 232, 28007 "./_wks": 236, 28008 "./_wks-define": 234, 28009 "./_wks-ext": 235 28010 } ], 28011 269: [ function(require, module, exports) { 28012 require("./_typed-array")("Uint8", 1, function(init) { 28013 return function(data, byteOffset, length) { 28014 return init(this, data, byteOffset, length); 28015 }; 28016 }); 28017 }, { 28018 "./_typed-array": 229 28019 } ], 28020 270: [ function(require, module, exports) { 28021 "use strict"; 28022 var $export = require("./_export"), $includes = require("./_array-includes")(!0); 28023 $export($export.P, "Array", { 28024 includes: function(el, argument_1) { 28025 return $includes(this, el, 1 < arguments.length ? argument_1 : void 0); 28026 } 28027 }), require("./_add-to-unscopables")("includes"); 28028 }, { 28029 "./_add-to-unscopables": 135, 28030 "./_array-includes": 141, 28031 "./_export": 155 28032 } ], 28033 271: [ function(require, module, exports) { 28034 var $export = require("./_export"), $entries = require("./_object-to-array")(!0); 28035 $export($export.S, "Object", { 28036 entries: function(it) { 28037 return $entries(it); 28038 } 28039 }); 28040 }, { 28041 "./_export": 155, 28042 "./_object-to-array": 198 28043 } ], 28044 272: [ function(require, module, exports) { 28045 var $export = require("./_export"), ownKeys = require("./_own-keys"), toIObject = require("./_to-iobject"), gOPD = require("./_object-gopd"), createProperty = require("./_create-property"); 28046 $export($export.S, "Object", { 28047 getOwnPropertyDescriptors: function(object) { 28048 for (var key, desc, O = toIObject(object), getDesc = gOPD.f, keys = ownKeys(O), result = {}, i = 0; keys.length > i; ) void 0 !== (desc = getDesc(O, key = keys[i++])) && createProperty(result, key, desc); 28049 return result; 28050 } 28051 }); 28052 }, { 28053 "./_create-property": 148, 28054 "./_export": 155, 28055 "./_object-gopd": 189, 28056 "./_own-keys": 199, 28057 "./_to-iobject": 225 28058 } ],
28059 273: [ function(require, module, exports) { 28060 require("./_wks-define")("asyncIterator"); 28061 }, { 28062 "./_wks-define": 234 28063 } ], 28064 274: [ function(require, module, exports) { 28065 for (var $iterators = require("./es6.array.iterator"), getKeys = require("./_object-keys"), redefine = require("./_redefine"), global = require("./_global"), hide = require("./_hide"), Iterators = require("./_iterators"), wks = require("./_wks"), ITERATOR = wks("iterator"), TO_STRING_TAG = wks("toStringTag"), ArrayValues = Iterators.Array, DOMIterables = { 28066 CSSRuleList: !0, 28067 CSSStyleDeclaration: !1, 28068 CSSValueList: !1, 28069 ClientRectList: !1, 28070 DOMRectList: !1, 28071 DOMStringList: !1, 28072 DOMTokenList: !0, 28073 DataTransferItemList: !1, 28074 FileList: !1, 28075 HTMLAllCollection: !1, 28076 HTMLCollection: !1, 28077 HTMLFormElement: !1, 28078 HTMLSelectElement: !1, 28079 MediaList: !0, 28080 MimeTypeArray: !1, 28081 NamedNodeMap: !1, 28082 NodeList: !0, 28083 PaintRequestList: !1, 28084 Plugin: !1, 28085 PluginArray: !1, 28086 SVGLengthList: !1, 28087 SVGNumberList: !1, 28088 SVGPathSegList: !1, 28089 SVGPointList: !1, 28090 SVGStringList: !1, 28091 SVGTransformList: !1, 28092 SourceBufferList: !1, 28093 StyleSheetList: !0, 28094 TextTrackCueList: !1, 28095 TextTrackList: !1, 28096 TouchList: !1 28097 }, collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { 28098 var key, NAME = collections[i], explicit = DOMIterables[NAME], Collection = global[NAME], proto = Collection && Collection.prototype; 28099 if (proto && (proto[ITERATOR] || hide(proto, ITERATOR, ArrayValues), proto[TO_STRING_TAG] || hide(proto, TO_STRING_TAG, NAME), 28100 Iterators[NAME] = ArrayValues, explicit)) for (key in $iterators) proto[key] || redefine(proto, key, $iterators[key], !0); 28101 } 28102 }, { 28103 "./_global": 162, 28104 "./_hide": 164, 28105 "./_iterators": 179, 28106 "./_object-keys": 195, 28107 "./_redefine": 204, 28108 "./_wks": 236, 28109 "./es6.array.iterator": 241 28110 } ], 28111 275: [ function(require, module, exports) { 28112 !function(window, factory) { 28113 "use strict"; 28114 "function" == typeof define && define.amd ? define(factory) : "object" == typeof module && module.exports ? module.exports = factory() : window.matchesSelector = factory(); 28115 }(window, function() { 28116 "use strict"; 28117 var matchesMethod = function() { 28118 var ElemProto = window.Element.prototype; 28119 if (ElemProto.matches) return "matches"; 28120 if (ElemProto.matchesSelector) return "matchesSelector"; 28121 for (var prefixes = [ "webkit", "moz", "ms", "o" ], i = 0; i < prefixes.length; i++) { 28122 var method = prefixes[i] + "MatchesSelector"; 28123 if (ElemProto[method]) return method; 28124 } 28125 }(); 28126 return function(elem, selector) { 28127 return elem[matchesMethod](selector); 28128 }; 28129 }); 28130 }, {} ], 28131 276: [ function(require, module, exports) { 28132 var global, factory; 28133 global = "undefined" != typeof window ? window : this, factory = function() { 28134 "use strict"; 28135 function EvEmitter() {} 28136 var proto = EvEmitter.prototype; 28137 return proto.on = function(eventName, listener) { 28138 if (eventName && listener) { 28139 var events = this._events = this._events || {}, listeners = events[eventName] = events[eventName] || []; 28140 return -1 == listeners.indexOf(listener) && listeners.push(listener), this; 28141 } 28142 }, proto.once = function(eventName, listener) { 28143 if (eventName && listener) { 28144 this.on(eventName, listener); 28145 var onceEvents = this._onceEvents = this._onceEvents || {}; 28146 return (onceEvents[eventName] = onceEvents[eventName] || {})[listener] = !0, this; 28147 } 28148 }, proto.off = function(eventName, listener) { 28149 var listeners = this._events && this._events[eventName]; 28150 if (listeners && listeners.length) { 28151 var index = listeners.indexOf(listener); 28152 return -1 != index && listeners.splice(index, 1), this; 28153 } 28154 }, proto.emitEvent = function(eventName, args) { 28155 var listeners = this._events && this._events[eventName]; 28156 if (listeners && listeners.length) { 28157 listeners = listeners.slice(0), args = args || []; 28158 for (var onceListeners = this._onceEvents && this._onceEvents[eventName], i = 0; i < listeners.length; i++) { 28159 var listener = listeners[i]; 28160 onceListeners && onceListeners[listener] && (this.off(eventName, listener), delete onceListeners[listener]), 28161 listener.apply(this, args); 28162 } 28163 return this; 28164 } 28165 }, proto.allOff = function() { 28166 delete this._events, delete this._onceEvents; 28167 }, EvEmitter; 28168 }, "function" == typeof define && define.amd ? define(factory) : "object" == typeof module && module.exports ? module.exports = factory() : global.EvEmitter = factory(); 28169 }, {} ],
28170 277: [ function(require, module, exports) { 28171 !function(window, factory) { 28172 "function" == typeof define && define.amd ? define([ "desandro-matches-selector/matches-selector" ], function(matchesSelector) { 28173 return factory(window, matchesSelector); 28174 }) : "object" == typeof module && module.exports ? module.exports = factory(window, require("desandro-matches-selector")) : window.fizzyUIUtils = factory(window, window.matchesSelector); 28175 }(window, function(window, matchesSelector) { 28176 "use strict"; 28177 var utils = { 28178 extend: function(a, b) { 28179 for (var prop in b) a[prop] = b[prop]; 28180 return a; 28181 }, 28182 modulo: function(num, div) { 28183 return (num % div + div) % div; 28184 } 28185 }, arraySlice = Array.prototype.slice; 28186 utils.makeArray = function(obj) { 28187 return Array.isArray(obj) ? obj : null == obj ? [] : "object" == typeof obj && "number" == typeof obj.length ? arraySlice.call(obj) : [ obj ]; 28188 }, utils.removeFrom = function(ary, obj) { 28189 var index = ary.indexOf(obj); 28190 -1 != index && ary.splice(index, 1); 28191 }, utils.getParent = function(elem, selector) { 28192 for (;elem.parentNode && elem != document.body; ) if (elem = elem.parentNode, matchesSelector(elem, selector)) return elem; 28193 }, utils.getQueryElement = function(elem) { 28194 return "string" == typeof elem ? document.querySelector(elem) : elem; 28195 }, utils.handleEvent = function(event) { 28196 var method = "on" + event.type; 28197 this[method] && this[method](event); 28198 }, utils.filterFindElements = function(elems, selector) { 28199 elems = utils.makeArray(elems); 28200 var ffElems = []; 28201 return elems.forEach(function(elem) { 28202 if (elem instanceof HTMLElement) if (selector) { 28203 matchesSelector(elem, selector) && ffElems.push(elem); 28204 for (var childElems = elem.querySelectorAll(selector), i = 0; i < childElems.length; i++) ffElems.push(childElems[i]); 28205 } else ffElems.push(elem); 28206 }), ffElems; 28207 }, utils.debounceMethod = function(_class, methodName, threshold) { 28208 threshold = threshold || 100; 28209 var method = _class.prototype[methodName], timeoutName = methodName + "Timeout"; 28210 _class.prototype[methodName] = function() { 28211 var timeout = this[timeoutName]; 28212 clearTimeout(timeout); 28213 var args = arguments, _this = this; 28214 this[timeoutName] = setTimeout(function() { 28215 method.apply(_this, args), delete _this[timeoutName]; 28216 }, threshold); 28217 }; 28218 }, utils.docReady = function(callback) { 28219 var readyState = document.readyState; 28220 "complete" == readyState || "interactive" == readyState ? setTimeout(callback) : document.addEventListener("DOMContentLoaded", callback); 28221 }, utils.toDashed = function(str) { 28222 return str.replace(/(.)([A-Z])/g, function(match, $1, $2) { 28223 return $1 + "-" + $2; 28224 }).toLowerCase(); 28225 }; 28226 var console = window.console; 28227 return utils.htmlInit = function(WidgetClass, namespace) { 28228 utils.docReady(function() { 28229 var dashedNamespace = utils.toDashed(namespace), dataAttr = "data-" + dashedNamespace, dataAttrElems = document.querySelectorAll("[" + dataAttr + "]"), jsDashElems = document.querySelectorAll(".js-" + dashedNamespace), elems = utils.makeArray(dataAttrElems).concat(utils.makeArray(jsDashElems)), dataOptionsAttr = dataAttr + "-options", jQuery = window.jQuery; 28230 elems.forEach(function(elem) { 28231 var options, attr = elem.getAttribute(dataAttr) || elem.getAttribute(dataOptionsAttr); 28232 try { 28233 options = attr && JSON.parse(attr); 28234 } catch (error) { 28235 return void (console && console.error("Error parsing " + dataAttr + " on " + elem.className + ": " + error)); 28236 } 28237 var instance = new WidgetClass(elem, options); 28238 jQuery && jQuery.data(elem, namespace, instance); 28239 }); 28240 }); 28241 }, utils; 28242 }); 28243 }, {
28244 "desandro-matches-selector": 275 28245 } ], 28246 278: [ function(require, module, exports) { 28247 var global, factory; 28248 global = this, factory = function() { 28249 "use strict"; 28250 var __assign = function() { 28251 return (__assign = Object.assign || function(t) { 28252 for (var s, i = 1, n = arguments.length; i < n; i++) for (var p in s = arguments[i]) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]); 28253 return t; 28254 }).apply(this, arguments); 28255 }; 28256 function __spreadArrays() { 28257 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 28258 var r = Array(s), k = 0; 28259 for (i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, 28260 k++) r[k] = a[j]; 28261 return r; 28262 } 28263 var HOOKS = [ "onChange", "onClose", "onDayCreate", "onDestroy", "onKeyDown", "onMonthChange", "onOpen", "onParseConfig", "onReady", "onValueUpdate", "onYearChange", "onPreCalendarPosition" ], defaults = { 28264 _disable: [], 28265 allowInput: !1, 28266 allowInvalidPreload: !1, 28267 altFormat: "F j, Y", 28268 altInput: !1, 28269 altInputClass: "form-control input", 28270 animate: "object" == typeof window && -1 === window.navigator.userAgent.indexOf("MSIE"), 28271 ariaDateFormat: "F j, Y", 28272 autoFillDefaultTime: !0, 28273 clickOpens: !0, 28274 closeOnSelect: !0, 28275 conjunction: ", ", 28276 dateFormat: "Y-m-d", 28277 defaultHour: 12, 28278 defaultMinute: 0, 28279 defaultSeconds: 0, 28280 disable: [], 28281 disableMobile: !1, 28282 enableSeconds: !1, 28283 enableTime: !1, 28284 errorHandler: function(err) { 28285 return "undefined" != typeof console && console.warn(err); 28286 }, 28287 getWeek: function(givenDate) { 28288 var date = new Date(givenDate.getTime()); 28289 date.setHours(0, 0, 0, 0), date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7); 28290 var week1 = new Date(date.getFullYear(), 0, 4); 28291 return 1 + Math.round(((date.getTime() - week1.getTime()) / 864e5 - 3 + (week1.getDay() + 6) % 7) / 7); 28292 }, 28293 hourIncrement: 1, 28294 ignoredFocusElements: [], 28295 inline: !1, 28296 locale: "default", 28297 minuteIncrement: 5, 28298 mode: "single", 28299 monthSelectorType: "dropdown", 28300 nextArrow: "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>", 28301 noCalendar: !1, 28302 now: new Date(), 28303 onChange: [], 28304 onClose: [], 28305 onDayCreate: [], 28306 onDestroy: [], 28307 onKeyDown: [], 28308 onMonthChange: [], 28309 onOpen: [], 28310 onParseConfig: [], 28311 onReady: [], 28312 onValueUpdate: [], 28313 onYearChange: [], 28314 onPreCalendarPosition: [], 28315 plugins: [], 28316 position: "auto", 28317 positionElement: void 0, 28318 prevArrow: "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>", 28319 shorthandCurrentMonth: !1, 28320 showMonths: 1, 28321 static: !1, 28322 time_24hr: !1, 28323 weekNumbers: !1, 28324 wrap: !1 28325 }, english = { 28326 weekdays: { 28327 shorthand: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], 28328 longhand: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ] 28329 }, 28330 months: { 28331 shorthand: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], 28332 longhand: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
28332November", "December" ] 28333 }, 28334 daysInMonth: [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ], 28335 firstDayOfWeek: 0, 28336 ordinal: function(nth) { 28337 var s = nth % 100; 28338 if (3 < s && s < 21) return "th"; 28339 switch (s % 10) { 28340 case 1: 28341 return "st"; 28342 28343 case 2: 28344 return "nd"; 28345 28346 case 3: 28347 return "rd"; 28348 28349 default: 28350 return "th"; 28351 } 28352 }, 28353 rangeSeparator: " to ", 28354 weekAbbreviation: "Wk", 28355 scrollTitle: "Scroll to increment", 28356 toggleTitle: "Click to toggle", 28357 amPM: [ "AM", "PM" ], 28358 yearAriaLabel: "Year", 28359 monthAriaLabel: "Month", 28360 hourAriaLabel: "Hour", 28361 minuteAriaLabel: "Minute", 28362 time_24hr: !1 28363 }, pad = function(number, length) { 28364 return void 0 === length && (length = 2), ("000" + number).slice(-1 * length); 28365 }, int = function(bool) { 28366 return !0 === bool ? 1 : 0; 28367 }; 28368 function debounce(fn, wait) { 28369 var t; 28370 return function() { 28371 var _this = this, args = arguments; 28372 clearTimeout(t), t = setTimeout(function() { 28373 return fn.apply(_this, args); 28374 }, wait); 28375 }; 28376 } 28377 var arrayify = function(obj) { 28378 return obj instanceof Array ? obj : [ obj ]; 28379 }; 28380 function toggleClass(elem, className, bool) { 28381 if (!0 === bool) return elem.classList.add(className); 28382 elem.classList.remove(className); 28383 } 28384 function createElement(tag, className, content) { 28385 var e = window.document.createElement(tag); 28386 return className = className || "", content = content || "", e.className = className, 28387 void 0 !== content && (e.textContent = content), e; 28388 } 28389 function clearNode(node) { 28390 for (;node.firstChild; ) node.removeChild(node.firstChild); 28391 } 28392 function createNumberInput(inputClassName, opts) { 28393 var wrapper = createElement("div", "numInputWrapper"), numInput = createElement("input", "numInput " + inputClassName), arrowUp = createElement("span", "arrowUp"), arrowDown = createElement("span", "arrowDown"); 28394 if (-1 === navigator.userAgent.indexOf("MSIE 9.0") ? numInput.type = "number" : (numInput.type = "text", 28395 numInput.pattern = "\\d*"), void 0 !== opts) for (var key in opts) numInput.setAttribute(key, opts[key]); 28396 return wrapper.appendChild(numInput), wrapper.appendChild(arrowUp), wrapper.appendChild(arrowDown), 28397 wrapper; 28398 } 28399 function getEventTarget(event) { 28400 try { 28401 return "function" != typeof event.composedPath ? event.target : event.composedPath()[0]; 28402 } catch (error) { 28403 return event.target; 28404 } 28405 } 28406 function doNothing() {} 28407 var monthToStr = function(monthNumber, shorthand, locale) { 28408 return locale.months[shorthand ? "shorthand" : "longhand"][monthNumber]; 28409 }, revFormat = { 28410 D: doNothing, 28411 F: function(dateObj, monthName, locale) { 28412 dateObj.setMonth(locale.months.longhand.indexOf(monthName)); 28413 }, 28414 G: function(dateObj, hour) { 28415 dateObj.setHours((12 <= dateObj.getHours() ? 12 : 0) + parseFloat(hour)); 28416 }, 28417 H: function(dateObj, hour) { 28418 dateObj.setHours(parseFloat(hour)); 28419 }, 28420 J: function(dateObj, day) { 28421 dateObj.setDate(parseFloat(day)); 28422 }, 28423 K: function(dateObj, amPM, locale) { 28424 dateObj.setHours(dateObj.getHours() % 12 + 12 * int(new RegExp(locale.amPM[1], "i").test(amPM))); 28425 }, 28426 M: function(dateObj, shortMonth, locale) { 28427 dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth)); 28428 }, 28429 S: function(dateObj, seconds) { 28430 dateObj.setSeconds(parseFloat(seconds)); 28431 }, 28432 U: function(_, unixSeconds) { 28433 return new Date(1e3 * parseFloat(unixSeconds)); 28434 }, 28435 W: function(dateObj, weekNum, locale) { 28436 var weekNumber = parseInt(weekNum), date = new Date(dateObj.getFullYear(), 0, 2 + 7 * (weekNumber - 1), 0, 0, 0, 0); 28437 return date.setDate(date.getDate() - date.getDay() + locale.firstDayOfWeek), date; 28438 }, 28439 Y: function(dateObj, year) { 28440 dateObj.setFullYear(parseFloat(year)); 28441 }, 28442 Z: function(_, ISODate) { 28443 return new Date(ISODate); 28444 }, 28445 d: function(dateObj, day) { 28446 dateObj.setDate(parseFloat(day)); 28447 }, 28448 h: function(dateObj, hour) { 28449 dateObj.setHours((12 <= dateObj.getHours() ? 12 : 0) + parseFloat(hour)); 28450 }, 28451 i: function(dateObj, minutes) { 28452 dateObj.setMinutes(parseFloat(minutes)); 28453 }, 28454 j: function(dateObj, day) { 28455 dateObj.setDate(parseFloat(day)); 28456 }, 28457 l: doNothing, 28458 m: function(dateObj, month) { 28459 dateObj.setMonth(parseFloat(month) - 1); 28460 }, 28461 n: function(dateObj, month) { 28462 dateObj.setMonth(parseFloat(month) - 1); 28463 }, 28464 s: function(dateObj, seconds) { 28465 dateObj.setSeconds(parseFloat(seconds)); 28466 }, 28467 u: function(_, unixMillSeconds) { 28468 return new Date(parseFloat(unixMillSeconds)); 28469 }, 28470 w: doNothing, 28471 y: function(dateObj, year) { 28472 dateObj.setFullYear(2e3 + parseFloat(year)); 28473 } 28474 }, tokenRegex = { 28475 D: "", 28476 F: "", 28477 G: "(\\d\\d|\\d)", 28478 H: "(\\d\\d|\\d)", 28479 J: "(\\d\\d|\\d)\\w+", 28480 K: "", 28481 M: "", 28482 S: "(\\d\\d|\\d)", 28483 U: "(.+)", 28484 W: "(\\d\\d|\\d)", 28485 Y: "(\\d{4})", 28486 Z: "(.+)", 28487 d: "(\\d\\d|\\d)", 28488 h: "(\\d\\d|\\d)", 28489 i: "(\\d\\d|\\d)", 28490 j: "(\\d\\d|\\d)", 28491 l: "", 28492 m: "(\\d\\d|\\d)", 28493 n: "(\\d\\d|\\d)", 28494 s: "(\\d\\d|\\d)", 28495 u: "(.+)", 28496 w: "(\\d\\d|\\d)", 28497 y: "(\\d{2})" 28498 }, formats = { 28499 Z: function(date) { 28500 return date.toISOString(); 28501 }, 28502 D: function(date, locale, options) { 28503 return locale.weekdays.shorthand[formats.w(date, locale, options)]; 28504 }, 28505 F: function(date, locale, options) { 28506 return monthToStr(formats.n(date, locale, options) - 1, !1, locale); 28507 }, 28508 G: function(date, locale, options) { 28509 return pad(formats.h(date, locale, options)); 28510 }, 28511 H: function(date) { 28512 return pad(date.getHours()); 28513 }, 28514 J: function(date, locale) { 28515 return void 0 !== locale.ordinal ? date.getDate() + locale.ordinal(date.getDate()) : date.getDate(); 28516 }, 28517 K: function(date, locale) { 28518 return locale.amPM[int(11 < date.getHours())]; 28519 }, 28520 M: function(date, locale) { 28521 return monthToStr(date.getMonth(), !0, locale); 28522 }, 28523 S: function(date) { 28524 return pad(date.getSeconds()); 28525 }, 28526 U: function(date) { 28527 return date.getTime() / 1e3; 28528 }, 28529 W: function(date, _, options) { 28530 return options.getWeek(date); 28531 }, 28532 Y: function(date) { 28533 return pad(date.getFullYear(), 4); 28534 }, 28535 d: function(date) { 28536 return pad(date.getDate()); 28537 }, 28538 h: function(date) { 28539 return date.getHours() % 12 ? date.getHours() % 12 : 12; 28540 }, 28541 i: function(date) { 28542 return pad(date.getMinutes()); 28543 }, 28544 j: function(date) { 28545 return date.getDate(); 28546 }, 28547 l: function(date, locale) { 28548 return locale.weekdays.longhand[date.getDay()]; 28549 }, 28550 m: function(date) { 28551 return pad(date.getMonth() + 1); 28552 }, 28553 n: function(date) { 28554 return date.getMonth() + 1; 28555 }, 28556 s: function(date) { 28557 return date.getSeconds(); 28558 }, 28559 u: function(date) { 28560 return date.getTime(); 28561 }, 28562 w: function(date) { 28563 return date.getDay(); 28564 }, 28565 y: function(date) { 28566 return String(date.getFullYear()).substring(2); 28567 } 28568 }, createDateFormatter = function(_a) { 28569 var _b = _a.config, config = void 0 === _b ? defaults : _b, _c = _a.l10n, l10n = void 0 === _c ? english : _
28569c, _d = _a.isMobile, isMobile = void 0 !== _d && _d; 28570 return function(dateObj, frmt, overrideLocale) { 28571 var locale = overrideLocale || l10n; 28572 return void 0 === config.formatDate || isMobile ? frmt.split("").map(function(c, i, arr) { 28573 return formats[c] && "\\" !== arr[i - 1] ? formats[c](dateObj, locale, config) : "\\" !== c ? c : ""; 28574 }).join("") : config.formatDate(dateObj, frmt, locale); 28575 }; 28576 }, createDateParser = function(_a) { 28577 var _b = _a.config, config = void 0 === _b ? defaults : _b, _c = _a.l10n, l10n = void 0 === _c ? english : _c; 28578 return function(date, givenFormat, timeless, customLocale) { 28579 if (0 === date || date) { 28580 var parsedDate, locale = customLocale || l10n, dateOrig = date; 28581 if (date instanceof Date) parsedDate = new Date(date.getTime()); else if ("string" != typeof date && void 0 !== date.toFixed) parsedDate = new Date(date); else if ("string" == typeof date) { 28582 var format = givenFormat || (config || defaults).dateFormat, datestr = String(date).trim(); 28583 if ("today" === datestr) parsedDate = new Date(), timeless = !0; else if (config && config.parseDate) parsedDate = config.parseDate(date, format); else if (/Z$/.test(datestr) || /GMT$/.test(datestr)) parsedDate = new Date(date); else { 28584 for (var matched = void 0, ops = [], i = 0, matchIndex = 0, regexStr = ""; i < format.length; i++) { 28585 var token_1 = format[i], isBackSlash = "\\" === token_1, escaped = "\\" === format[i - 1] || isBackSlash; 28586 if (tokenRegex[token_1] && !escaped) { 28587 regexStr += tokenRegex[token_1]; 28588 var match = new RegExp(regexStr).exec(date); 28589 match && (matched = !0) && ops["Y" !== token_1 ? "push" : "unshift"]({ 28590 fn: revFormat[token_1], 28591 val: match[++matchIndex] 28592 }); 28593 } else isBackSlash || (regexStr += "."); 28594 } 28595 parsedDate = config && config.noCalendar ? new Date(new Date().setHours(0, 0, 0, 0)) : new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0), 28596 ops.forEach(function(_a) { 28597 var fn = _a.fn, val = _a.val; 28598 return parsedDate = fn(parsedDate, val, locale) || parsedDate; 28599 }), parsedDate = matched ? parsedDate : void 0; 28600 } 28601 } 28602 if (parsedDate instanceof Date && !isNaN(parsedDate.getTime())) return !0 === timeless && parsedDate.setHours(0, 0, 0, 0), 28603 parsedDate; 28604 config.errorHandler(new Error("Invalid date provided: " + dateOrig)); 28605 } 28606 }; 28607 }; 28608 function compareDates(date1, date2, timeless) { 28609 return void 0 === timeless && (timeless = !0), !1 !== timeless ? new Date(date1.getTime()).setHours(0, 0, 0, 0) - new Date(date2.getTime()).setHours(0, 0, 0, 0) : date1.getTime() - date2.getTime(); 28610 } 28611 var isBetween = function(ts, ts1, ts2) { 28612 return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2); 28613 }, calculateSecondsSinceMidnight = function(hours, minutes, seconds) { 28614 return 3600 * hours + 60 * minutes + seconds; 28615 }, parseSeconds = function(secondsSinceMidnight) { 28616 var hours = Math.floor(secondsSinceMidnight / 3600), minutes = (secondsSinceMidnight - 3600 * hours) / 60; 28617 return [ hours, minutes, secondsSinceMidnight - 3600 * hours
28617- 60 * minutes ]; 28618 }, duration = { 28619 DAY: 864e5 28620 }; 28621 function getDefaultHours(config) { 28622 var hours = config.defaultHour, minutes = config.defaultMinute, seconds = config.defaultSeconds; 28623 if (void 0 !== config.minDate) { 28624 var minHour = config.minDate.getHours(), minMinutes = config.minDate.getMinutes(), minSeconds = config.minDate.getSeconds(); 28625 hours < minHour && (hours = minHour), hours === minHour && minutes < minMinutes && (minutes = minMinutes), 28626 hours === minHour && minutes === minMinutes && seconds < minSeconds && (seconds = config.minDate.getSeconds()); 28627 } 28628 if (void 0 !== config.maxDate) { 28629 var maxHr = config.maxDate.getHours(), maxMinutes = config.maxDate.getMinutes(); 28630 (hours = Math.min(hours, maxHr)) === maxHr && (minutes = Math.min(maxMinutes, minutes)), 28631 hours === maxHr && minutes === maxMinutes && (seconds = config.maxDate.getSeconds()); 28632 } 28633 return { 28634 hours: hours, 28635 minutes: minutes, 28636 seconds: seconds 28637 }; 28638 } 28639 "function" != typeof Object.assign && (Object.assign = function(target) { 28640 for (var args = [], _i = 1; _i < arguments.length; _i++) args[_i - 1] = arguments[_i]; 28641 if (!target) throw TypeError("Cannot convert undefined or null to object"); 28642 for (var _loop_1 = function(source) { 28643 source && Object.keys(source).forEach(function(key) { 28644 return target[key] = source[key]; 28645 }); 28646 }, _a = 0, args_1 = args; _a < args_1.length; _a++) { 28647 _loop_1(args_1[_a]); 28648 } 28649 return target; 28650 }); 28651 var DEBOUNCED_CHANGE_MS = 300; 28652 function FlatpickrInstance(element, instanceConfig) { 28653 var self = { 28654 config: __assign(__assign({}, defaults), flatpickr.defaultConfig), 28655 l10n: english 28656 }; 28657 function getClosestActiveElement() { 28658 var _a; 28659 return (null === (_a = self.calendarContainer) || void 0 === _a ? void 0 : _a.getRootNode()).activeElement || document.activeElement; 28660 } 28661 function bindToInstance(fn) { 28662 return fn.bind(self); 28663 } 28664 function setCalendarWidth() { 28665 var config = self.config; 28666 !1 === config.weekNumbers && 1 === config.showMonths || !0 !== config.noCalendar && window.requestAnimationFrame(function() { 28667 if (void 0 !== self.calendarContainer && (self.calendarContainer.style.visibility = "hidden", 28668 self.calendarContainer.style.display = "block"), void 0 !== self.daysContainer) { 28669 var daysWidth = (self.days.offsetWidth + 1) * config.showMonths; 28670 self.daysContainer.style.width = daysWidth + "px", self.calendarContainer.style.width = daysWidth + (void 0 !== self.weekWrapper ? self.weekWrapper.offsetWidth : 0) + "px", 28671 self.calendarContainer.style.removeProperty("visibility"), self.calendarContainer.style.removeProperty("display"); 28672 } 28673 }); 28674 } 28675 function updateTime(e) { 28676 if (0 === self.selectedDates.length) { 28677 var defaultDate = void 0 === self.config.minDate || 0 <= compareDates(new Date(), self.config.minDate) ? new Date() : new Date(self.config.minDate.getTime()), defaults = getDefaultHours(self.config); 28678 defaultDate.setHours(defaults.hours, defaults.minutes, defaults.seconds, defaultDate.getMilliseconds()), 28679 self.selectedDates = [ defaultDate ], self.latestSelectedDateObj = defaultDate; 28680 } 28681 void 0 !== e && "blur" !== e.type && function(e) { 28682 e.preventDefault(); 28683 var isKeyDown = "keydown" === e.type, eventTarget = getEventTarget(e), input = eventTarget; 28684 void 0 !== self.amPM && eventTarget === self.amPM && (self.amPM.textContent = self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])]); 28685 var min = parseFloat(input.getAttribute("min")), max = parseFloat(input.getAttribute("max")), step = parseFloat(input.getAttribute("step")), curValue = parseInt(input.value, 10), delta = e.delta || (isKeyDown ? 38 === e.which ? 1 : -1 : 0), newValue = curValue + step * delta; 28686 if (void 0 !== input.value && 2 === input.value.length) { 28687 var isHourElem = input === self.hourElement, isMinuteElem = input === self.minuteElement; 28688 newValue < min ? (newValue = max + newValue + int(!isHourElem) + (int(isHourElem) && int(!self.amPM)), 28689 isMinuteElem && incrementNumInput(void 0, -1, self.hourElement)) : max < newValue && (newValue = input === self.hourElement ? newValue - max - int(!self.amPM) : min, 28690 isMinuteElem && incrementNumInput(void 0, 1, self.hourElement)), self.amPM && isHourElem && (1 === step ? newValue + curValue === 23 : Math.abs(newValue - curValue) > step) && (self.amPM.textContent = self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])]), 28691 input.value = pad(newValue); 28692 } 28693 }(e); 28694 var prevValue = self._input.value;
28695 setHoursFromInputs(), updateValue(), self._input.value !== prevValue && self._debouncedChange(); 28696 } 28697 function setHoursFromInputs() { 28698 if (void 0 !== self.hourElement && void 0 !== self.minuteElement) { 28699 var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = void 0 !== self.secondElement ? (parseInt(self.secondElement.value, 10) || 0) % 60 : 0; 28700 void 0 !== self.amPM && (hours = function(hour, amPM) { 28701 return hour % 12 + 12 * int(amPM === self.l10n.amPM[1]); 28702 }(hours, self.amPM.textContent)); 28703 var limitMinHours = void 0 !== self.config.minTime || self.config.minDate && self.minDateHasTime && self.latestSelectedDateObj && 0 === compareDates(self.latestSelectedDateObj, self.config.minDate, !0), limitMaxHours = void 0 !== self.config.maxTime || self.config.maxDate && self.maxDateHasTime && self.latestSelectedDateObj && 0 === compareDates(self.latestSelectedDateObj, self.config.maxDate, !0); 28704 if (void 0 !== self.config.maxTime && void 0 !== self.config.minTime && self.config.minTime > self.config.maxTime) { 28705 var minBound = calculateSecondsSinceMidnight(self.config.minTime.getHours(), self.config.minTime.getMinutes(), self.config.minTime.getSeconds()), maxBound = calculateSecondsSinceMidnight(self.config.maxTime.getHours(), self.config.maxTime.getMinutes(), self.config.maxTime.getSeconds()), currentTime = calculateSecondsSinceMidnight(hours, minutes, seconds); 28706 if (maxBound < currentTime && currentTime < minBound) { 28707 var result = parseSeconds(minBound); 28708 hours = result[0], minutes = result[1], seconds = result[2]; 28709 } 28710 } else { 28711 if (limitMaxHours) { 28712 var maxTime = void 0 !== self.config.maxTime ? self.config.maxTime : self.config.maxDate; 28713 (hours = Math.min(hours, maxTime.getHours())) === maxTime.getHours() && (minutes = Math.min(minutes, maxTime.getMinutes())), 28714 minutes === maxTime.getMinutes() && (seconds = Math.min(seconds, maxTime.getSeconds())); 28715 } 28716 if (limitMinHours) { 28717 var minTime = void 0 !== self.config.minTime ? self.config.minTime : self.config.minDate; 28718 (hours = Math.max(hours, minTime.getHours())) === minTime.getHours() && minutes < minTime.getMinutes() && (minutes = minTime.getMinutes()), 28719 minutes === minTime.getMinutes() && (seconds = Math.max(seconds, minTime.getSeconds())); 28720 } 28721 } 28722 setHours(hours, minutes, seconds); 28723 } 28724 } 28725 function setHoursFromDate(dateObj) { 28726 var date = dateObj || self.latestSelectedDateObj; 28727 date && date instanceof Date && setHours(date.getHours(), date.getMinutes(), date.getSeconds()); 28728 } 28729 function setHours(hours, minutes, seconds) { 28730 void 0 !== self.latestSelectedDateObj && self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0), 28731 self.hourElement && self.minuteElement && !self.isMobile && (self.hourElement.value = pad(self.config.time_24hr ? hours : (12 + hours) % 12 + 12 * int(hours % 12 == 0)), 28732 self.minuteElement.value = pad(minutes), void 0 !== self.amPM && (self.amPM.textContent = self.l10n.amPM[int(12 <= hours)]), 28733 void 0 !== self.secondElement && (self.secondElement.value = pad(seconds))); 28734 } 28735 function onYearInput(event) { 28736 var eventTarget = getEventTarget(event), year = parseInt(eventTarget.value) + (event.delta || 0); 28737 (1 < year / 1e3 || "Enter" === event.key && !/[^\d]/.test(year.toString())) && changeYear(year); 28738 } 28739 function bind(element, event, handler, options) { 28740 return event instanceof Array ? event.forEach(function(ev) { 28741 return bind(element, ev, handler, options); 28742 }) : element instanceof Array ? element.forEach(function(el) { 28743 return bind(el, event, handler, options); 28744 }) : (element.addEventListener(event, handler, options), void self._handlers.push({ 28745 remove: function() { 28746 return element.removeEventListener(event, handler, options); 28747 } 28748 })); 28749 } 28750 function triggerChange() { 28751 triggerEvent("onChange"); 28752 } 28753 function jumpToDate(jumpDate, triggerChange) { 28754 var jumpTo = void 0 !== jumpDate ? self.parseDate(jumpDate) : self.latestSelectedDateObj || (self.config.minDate && self.config.minDate > self.now ? self.config.minDate : self.config.maxDate && self.config.maxDate < self.now ? self.config.maxDate : self.now), oldYear = self.currentYear, oldMonth = self.currentMonth; 28755 try { 28756 void 0 !== jumpTo && (self.currentYear = jumpTo.getFullYear(), self.currentMonth = jumpTo.getMonth()); 28757 } catch (e) { 28758 e.message = "Invalid date supplied: " + jumpTo, self.config.errorHandler(e); 28759 } 28760 triggerChange && self.currentYear !== oldYear && (triggerEvent("onYearChange"), 28761 buildMonthSwitch()), !triggerChange || self.currentYear === oldYear && self.currentMonth === oldMonth || triggerEvent("onMonthChange"), 28762 self.redraw(); 28763 } 28764 function timeIncrement(e) { 28765 var eventTarget = getEventTarget(e); 28766 ~eventTarget.className.indexOf("arrow") && incrementNumInput(e, eventTarget.classList.contains("arrowUp") ? 1 : -1); 28767 } 28768 function incrementNumInput(e, delta, inputElem) { 28769 var target = e && getEventTarget(e), input = inputElem || target && target.parentNode && target.parentNode.firstChild, event = createEvent("increment"); 28770 event.delta = delta, input && input.dispatchEvent(event); 28771 } 28772 function createDay(className, date, _dayNumber, i) { 28773 var dateIsEnabled = isEnabled(date, !0), dayElement = createElement("span", className, date.getDate().toString()); 28774 return dayElement.dateObj = date, dayElement.$i = i, dayElement.setAttribute("aria-label", self.formatDate(date, self.config.ariaDateFormat)), 28775 -1 === className.indexOf("hidden") && 0 === compareDates(date, self.now) && ((self.todayDateElem = dayElement).classList.add("today"), 28776 dayElement.setAttribute("aria-current", "date")), dateIsEnabled ? (dayElement.tabIndex = -1, 28777 isDateSelected(date) && (dayElement.classList.add("selected"), self.selectedDateElem = dayElement, 28778 "range" === self.config.mode && (toggleClass(dayElement, "startRange", self.selectedDates[0] && 0 === compareDates(date, self.selectedDates[0], !0)), 28779 toggleClass(dayElement, "endRange", self.selectedDates[1] && 0 === compareDates(date, self.selectedDates[1], !0)), 28780 "nextMonthDay" === className && dayElement.classList.add("inRange")))) : dayElement.classList.add("flatpickr-disabled"), 28781 "range" === self.config.mode && (!function(date) { 28782 return !("range" !== self.config.mode || self.selectedDates.length < 2) && (0 <= compareDates(date, self.selectedDates[0]) && compareDates(date, self.selectedDates[1]) <= 0); 28783 }(date) || isDateSelected(date) || dayElement.classList.add("inRange")), self.weekNumbers && 1 === self.config.showMonths && "prevMonthDay" !== className && i % 7 == 6 && self.weekNumbers.insertAdjacentHTML("beforeend", "<span class='flatpickr-day'>" + self.config.getWeek(date) + "</span>"), 28784 triggerEvent("onDayCreate", dayElement), dayElement; 28785 } 28786 function focusOnDayElem(targetNode) { 28787 targetNode.focus(), "range" === self.config.mode && onMouseOver(targetNode); 28788 } 28789 function getFirstAvailableDay(delta) { 28790 for (var startMonth = 0 < delta ? 0 : self.config.showMonths - 1, endMonth = 0 < delta ? self.config.showMonths : -1, m = startMonth; m != endMonth;
28790 m += delta) for (var month = self.daysContainer.children[m], startIndex = 0 < delta ? 0 : month.children.length - 1, endIndex = 0 < delta ? month.children.length : -1, i = startIndex; i != endIndex; i += delta) { 28791 var c = month.children[i]; 28792 if (-1 === c.className.indexOf("hidden") && isEnabled(c.dateObj)) return c; 28793 } 28794 } 28795 function focusOnDay(current, offset) { 28796 var activeElement = getClosestActiveElement(), dayFocused = isInView(activeElement || document.body), startElem = void 0 !== current ? current : dayFocused ? activeElement : void 0 !== self.selectedDateElem && isInView(self.selectedDateElem) ? self.selectedDateElem : void 0 !== self.todayDateElem && isInView(self.todayDateElem) ? self.todayDateElem : getFirstAvailableDay(0 < offset ? 1 : -1); 28797 void 0 === startElem ? self._input.focus() : dayFocused ? function(current, delta) { 28798 for (var givenMonth = -1 === current.className.indexOf("Month") ? current.dateObj.getMonth() : self.currentMonth, endMonth = 0 < delta ? self.config.showMonths : -1, loopDelta = 0 < delta ? 1 : -1, m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) for (var month = self.daysContainer.children[m], startIndex = givenMonth - self.currentMonth === m ? current.$i + delta : delta < 0 ? month.children.length - 1 : 0, numMonthDays = month.children.length, i = startIndex; 0 <= i && i < numMonthDays && i != (0 < delta ? numMonthDays : -1); i += loopDelta) { 28799 var c = month.children[i]; 28800 if (-1 === c.className.indexOf("hidden") && isEnabled(c.dateObj) && Math.abs(current.$i - i) >= Math.abs(delta)) return focusOnDayElem(c); 28801 } 28802 self.changeMonth(loopDelta), focusOnDay(getFirstAvailableDay(loopDelta), 0); 28803 }(startElem, offset) : focusOnDayElem(startElem); 28804 } 28805 function buildMonthDays(year, month) { 28806 for (var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7, prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12, year), daysInMonth = self.utils.getDaysInMonth(month, year), days = window.document.createDocumentFragment(), isMultiMonth = 1 < self.config.showMonths, prevMonthDayClass = isMultiMonth ? "prevMonthDay hidden" : "prevMonthDay", nextMonthDayClass = isMultiMonth ? "nextMonthDay hidden" : "nextMonthDay", dayNumber = prevMonthDays + 1 - firstOfMonth, dayIndex = 0; dayNumber <= prevMonthDays; dayNumber++, 28807 dayIndex++) days.appendChild(createDay("flatpickr-day " + prevMonthDayClass, new Date(year, month - 1, dayNumber), 0, dayIndex)); 28808 for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) days.appendChild(createDay("flatpickr-day", new Date(year, month, dayNumber), 0, dayIndex)); 28809 for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth && (1 === self.config.showMonths || dayIndex % 7 != 0); dayNum++, 28810 dayIndex++) days.appendChild(createDay("flatpickr-day " + nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), 0, dayIndex)); 28811 var dayContainer = createElement("div", "dayContainer"); 28812 return dayContainer.appendChild(days), dayContainer; 28813 } 28814 function buildDays() { 28815 if (void 0 !== self.daysContainer) { 28816 clearNode(self.daysContainer), self.weekNumbers && clearNode(self.weekNumbers); 28817 for (var frag = document.createDocumentFragment(), i = 0; i < self.config.showMonths; i++) { 28818 var d = new Date(self.currentYear, self.currentMonth, 1); 28819 d.setMonth(self.currentMonth + i), frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth())); 28820 } 28821 self.daysContainer.appendChild(frag), self.days = self.daysContainer.firstChild, 28822 "range" === self.config.mode && 1 === self.selectedDates.length && onMouseOver(); 28823 } 28824 } 28825 function buildMonthSwitch() { 28826 if (!(1 < self.config.showMonths || "dropdown" !== self.config.monthSelectorType)) { 28827 var shouldBuildMonth = function(month) { 28828 return !(void 0 !== self.config.minDate && self.currentYear === self.config.minDate.getFullYear() && month < self.config.minDate.getMonth()) && !(void 0 !== self.config.maxDate && self.currentYear === self.config.maxDate.getFullYear() && month > self.config.maxDate.getMonth()); 28829 }; 28830 self.monthsDropdownContainer.tabIndex = -1, self.monthsDropdownContainer.innerHTML = ""; 28831 for (var i = 0; i < 12; i++) if (shouldBuildMonth(i)) {
28832 var month = createElement("option", "flatpickr-monthDropdown-month"); 28833 month.value = new Date(self.currentYear, i).getMonth().toString(), month.textContent = monthToStr(i, self.config.shorthandCurrentMonth, self.l10n), 28834 month.tabIndex = -1, self.currentMonth === i && (month.selected = !0), self.monthsDropdownContainer.appendChild(month); 28835 } 28836 } 28837 } 28838 function buildMonth() { 28839 var monthElement, container = createElement("div", "flatpickr-month"), monthNavFragment = window.document.createDocumentFragment(); 28840 monthElement = 1 < self.config.showMonths || "static" === self.config.monthSelectorType ? createElement("span", "cur-month") : (self.monthsDropdownContainer = createElement("select", "flatpickr-monthDropdown-months"), 28841 self.monthsDropdownContainer.setAttribute("aria-label", self.l10n.monthAriaLabel), 28842 bind(self.monthsDropdownContainer, "change", function(e) { 28843 var target = getEventTarget(e), selectedMonth = parseInt(target.value, 10); 28844 self.changeMonth(selectedMonth - self.currentMonth), triggerEvent("onMonthChange"); 28845 }), buildMonthSwitch(), self.monthsDropdownContainer); 28846 var yearInput = createNumberInput("cur-year", { 28847 tabindex: "-1" 28848 }), yearElement = yearInput.getElementsByTagName("input")[0]; 28849 yearElement.setAttribute("aria-label", self.l10n.yearAriaLabel), self.config.minDate && yearElement.setAttribute("min", self.config.minDate.getFullYear().toString()), 28850 self.config.maxDate && (yearElement.setAttribute("max", self.config.maxDate.getFullYear().toString()), 28851 yearElement.disabled = !!self.config.minDate && self.config.minDate.getFullYear() === self.config.maxDate.getFullYear()); 28852 var currentMonth = createElement("div", "flatpickr-current-month"); 28853 return currentMonth.appendChild(monthElement), currentMonth.appendChild(yearInput), 28854 monthNavFragment.appendChild(currentMonth), container.appendChild(monthNavFragment), 28855 { 28856 container: container, 28857 yearElement: yearElement, 28858 monthElement: monthElement 28859 }; 28860 } 28861 function buildMonths() { 28862 clearNode(self.monthNav), self.monthNav.appendChild(self.prevMonthNav), self.config.showMonths && (self.yearElements = [], 28863 self.monthElements = []); 28864 for (var m = self.config.showMonths; m--; ) { 28865 var month = buildMonth(); 28866 self.yearElements.push(month.yearElement), self.monthElements.push(month.monthElement), 28867 self.monthNav.appendChild(month.container); 28868 } 28869 self.monthNav.appendChild(self.nextMonthNav); 28870 } 28871 function buildWeekdays() { 28872 self.weekdayContainer ? clearNode(self.weekdayContainer) : self.weekdayContainer = createElement("div", "flatpickr-weekdays"); 28873 for (var i = self.config.showMonths; i--; ) { 28874 var container = createElement("div", "flatpickr-weekdaycontainer"); 28875 self.weekdayContainer.appendChild(container); 28876 } 28877 return updateWeekdays(), self.weekdayContainer; 28878 } 28879 function updateWeekdays() { 28880 if (self.weekdayContainer) { 28881 var firstDayOfWeek = self.l10n.firstDayOfWeek, weekdays = __spreadArrays(self.l10n.weekdays.shorthand); 28882 0 < firstDayOfWeek && firstDayOfWeek < weekdays.length && (weekdays = __spreadArrays(weekdays.splice(firstDayOfWeek, weekdays.length), weekdays.splice(0, firstDayOfWeek))); 28883 for (var i = self.config.showMonths; i--;
28883 ) self.weekdayContainer.children[i].innerHTML = "\n <span class='flatpickr-weekday'>\n " + weekdays.join("</span><span class='flatpickr-weekday'>") + "\n </span>\n "; 28884 } 28885 } 28886 function changeMonth(value, isOffset) { 28887 void 0 === isOffset && (isOffset = !0); 28888 var delta = isOffset ? value : value - self.currentMonth; 28889 delta < 0 && !0 === self._hidePrevMonthArrow || 0 < delta && !0 === self._hideNextMonthArrow || (self.currentMonth += delta, 28890 (self.currentMonth < 0 || 11 < self.currentMonth) && (self.currentYear += 11 < self.currentMonth ? 1 : -1, 28891 self.currentMonth = (self.currentMonth + 12) % 12, triggerEvent("onYearChange"), 28892 buildMonthSwitch()), buildDays(), triggerEvent("onMonthChange"), updateNavigationCurrentMonth()); 28893 } 28894 function isCalendarElem(elem) { 28895 return self.calendarContainer.contains(elem); 28896 } 28897 function documentClick(e) { 28898 if (self.isOpen && !self.config.inline) { 28899 var eventTarget_1 = getEventTarget(e), isCalendarElement = isCalendarElem(eventTarget_1), lostFocus = !(eventTarget_1 === self.input || eventTarget_1 === self.altInput || self.element.contains(eventTarget_1) || e.path && e.path.indexOf && (~e.path.indexOf(self.input) || ~e.path.indexOf(self.altInput))) && !isCalendarElement && !isCalendarElem(e.relatedTarget), isIgnored = !self.config.ignoredFocusElements.some(function(elem) { 28900 return elem.contains(eventTarget_1); 28901 }); 28902 lostFocus && isIgnored && (self.config.allowInput && self.setDate(self._input.value, !1, self.config.altInput ? self.config.altFormat : self.config.dateFormat), 28903 void 0 !== self.timeContainer && void 0 !== self.minuteElement && void 0 !== self.hourElement && "" !== self.input.value && void 0 !== self.input.value && updateTime(), 28904 self.close(), self.config && "range" === self.config.mode && 1 === self.selectedDates.length && self.clear(!1)); 28905 } 28906 } 28907 function changeYear(newYear) { 28908 if (!(!newYear || self.config.minDate && newYear < self.config.minDate.getFullYear() || self.config.maxDate && newYear > self.config.maxDate.getFullYear())) { 28909 var newYearNum = newYear, isNewYear = self.currentYear !== newYearNum; 28910 self.currentYear = newYearNum || self.currentYear, self.config.maxDate && self.currentYear === self.config.maxDate.getFullYear() ? self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth) : self.config.minDate && self.currentYear === self.config.minDate.getFullYear() && (self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth)), 28911 isNewYear && (self.redraw(), triggerEvent("onYearChange"), buildMonthSwitch()); 28912 } 28913 } 28914 function isEnabled(date, timeless) { 28915 var _a; 28916 void 0 === timeless && (timeless = !0); 28917 var dateToCheck = self.parseDate(date, void 0, timeless); 28918 if (self.config.minDate && dateToCheck && compareDates(dateToCheck, self.config.minDate, void 0 !== timeless ? timeless : !self.minDateHasTime) < 0 || self.config.maxDate && dateToCheck && 0 < compareDates(dateToCheck, self.config.maxDate, void 0 !== timeless ? timeless : !self.maxDateHasTime)) return !1; 28919 if (!self.config.enable && 0 === self.config.disable.length) return !0; 28920 if (void 0 === dateToCheck) return !1; 28921 for (var bool = !!self.config.enable, array = null !== (_a = self.config.enable) && void 0 !== _a ? _a : self.config.disable, i = 0, d = void 0; i < array.length; i++) { 28922 if ("function" == typeof (d = array[i]) && d(dateToCheck)) return bool; 28923 if (d instanceof Date && void 0 !== dateToCheck && d.getTime() === dateToCheck.getTime()) return bool; 28924 if ("string" == typeof d) { 28925 var parsed = self.parseDate(d, void 0, !0); 28926 return parsed && parsed.getTime() === dateToCheck.getTime() ? bool : !bool; 28927 } 28928 if ("object" == typeof d && void 0 !== dateToCheck && d.from && d.to && dateToCheck.getTime() >= d.from.getTime() && dateToCheck.getTime() <= d.to.getTime()) return bool; 28929 } 28930 return !bool; 28931 } 28932 function isInView(elem) { 28933 return void 0 !== self.daysContainer && (-1 === elem.className.indexOf("hidden") && -1 === elem.className.indexOf("flatpickr-disabled") && self.daysContainer.contains(elem)); 28934 } 28935 function onBlur(e) { 28936 var isInput = e.target === self._input, valueChanged = self._input.value.trimEnd() !== getDateStr();
vendor: 4,432 bytes, lines 28937-28998
28937 !isInput || !valueChanged || e.relatedTarget && isCalendarElem(e.relatedTarget) || self.setDate(self._input.value, !0, e.target === self.altInput ? self.config.altFormat : self.config.dateFormat); 28938 } 28939 function onKeyDown(e) { 28940 var eventTarget = getEventTarget(e), isInput = self.config.wrap ? element.contains(eventTarget) : eventTarget === self._input, allowInput = self.config.allowInput, allowKeydown = self.isOpen && (!allowInput || !isInput), allowInlineKeydown = self.config.inline && isInput && !allowInput; 28941 if (13 === e.keyCode && isInput) { 28942 if (allowInput) return self.setDate(self._input.value, !0, eventTarget === self.altInput ? self.config.altFormat : self.config.dateFormat), 28943 self.close(), eventTarget.blur(); 28944 self.open(); 28945 } else if (isCalendarElem(eventTarget) || allowKeydown || allowInlineKeydown) { 28946 var isTimeObj = !!self.timeContainer && self.timeContainer.contains(eventTarget); 28947 switch (e.keyCode) { 28948 case 13: 28949 isTimeObj ? (e.preventDefault(), updateTime(), focusAndClose()) : selectDate(e); 28950 break; 28951 28952 case 27: 28953 e.preventDefault(), focusAndClose(); 28954 break; 28955 28956 case 8: 28957 case 46: 28958 isInput && !self.config.allowInput && (e.preventDefault(), self.clear()); 28959 break; 28960 28961 case 37: 28962 case 39: 28963 if (isTimeObj || isInput) self.hourElement && self.hourElement.focus(); else { 28964 e.preventDefault(); 28965 var activeElement = getClosestActiveElement(); 28966 if (void 0 !== self.daysContainer && (!1 === allowInput || activeElement && isInView(activeElement))) { 28967 var delta_1 = 39 === e.keyCode ? 1 : -1; 28968 e.ctrlKey ? (e.stopPropagation(), changeMonth(delta_1), focusOnDay(getFirstAvailableDay(1), 0)) : focusOnDay(void 0, delta_1); 28969 } 28970 } 28971 break; 28972 28973 case 38: 28974 case 40: 28975 e.preventDefault(); 28976 var delta = 40 === e.keyCode ? 1 : -1; 28977 self.daysContainer && void 0 !== eventTarget.$i || eventTarget === self.input || eventTarget === self.altInput ? e.ctrlKey ? (e.stopPropagation(), 28978 changeYear(self.currentYear - delta), focusOnDay(getFirstAvailableDay(1), 0)) : isTimeObj || focusOnDay(void 0, 7 * delta) : eventTarget === self.currentYearElement ? changeYear(self.currentYear - delta) : self.config.enableTime && (!isTimeObj && self.hourElement && self.hourElement.focus(), 28979 updateTime(e), self._debouncedChange()); 28980 break; 28981 28982 case 9: 28983 if (isTimeObj) { 28984 var elems = [ self.hourElement, self.minuteElement, self.secondElement, self.amPM ].concat(self.pluginElements).filter(function(x) { 28985 return x; 28986 }), i = elems.indexOf(eventTarget); 28987 if (-1 !== i) { 28988 var target = elems[i + (e.shiftKey ? -1 : 1)]; 28989 e.preventDefault(), (target || self._input).focus(); 28990 } 28991 } else !self.config.noCalendar && self.daysContainer && self.daysContainer.contains(eventTarget) && e.shiftKey && (e.preventDefault(), 28992 self._input.focus()); 28993 } 28994 } 28995 if (void 0 !== self.amPM && eventTarget === self.amPM) switch (e.key) { 28996 case self.l10n.amPM[0].charAt(0): 28997 case self.l10n.amPM[0].charAt(0).toLowerCase(): 28998 self.amPM.textContent = self.l10n.amPM[0], setHoursFromInputs(), updateV
28998alue(); 28999 break; 29000 29001 case self.l10n.amPM[1].charAt(0): 29002 case self.l10n.amPM[1].charAt(0).toLowerCase(): 29003 self.amPM.textContent = self.l10n.amPM[1], setHoursFromInputs(), updateValue(); 29004 } 29005 (isInput || isCalendarElem(eventTarget)) && triggerEvent("onKeyDown", e); 29006 } 29007 function onMouseOver(elem, cellClass) { 29008 if (void 0 === cellClass && (cellClass = "flatpickr-day"), 1 === self.selectedDates.length && (!elem || elem.classList.contains(cellClass) && !elem.classList.contains("flatpickr-disabled"))) { 29009 for (var hoverDate = elem ? elem.dateObj.getTime() : self.days.firstElementChild.dateObj.getTime(), initialDate = self.parseDate(self.selectedDates[0], void 0, !0).getTime(), rangeStartDate = Math.min(hoverDate, self.selectedDates[0].getTime()), rangeEndDate = Math.max(hoverDate, self.selectedDates[0].getTime()), containsDisabled = !1, minRange = 0, maxRange = 0, t = rangeStartDate; t < rangeEndDate; t += duration.DAY) isEnabled(new Date(t), !0) || (containsDisabled = containsDisabled || rangeStartDate < t && t < rangeEndDate, 29010 t < initialDate && (!minRange || minRange < t) ? minRange = t : initialDate < t && (!maxRange || t < maxRange) && (maxRange = t)); 29011 Array.from(self.rContainer.querySelectorAll("*:nth-child(-n+" + self.config.showMonths + ") > ." + cellClass)).forEach(function(dayElem) { 29012 var timestamp = dayElem.dateObj.getTime(), outOfRange = 0 < minRange && timestamp < minRange || 0 < maxRange && maxRange < timestamp; 29013 if (outOfRange) return dayElem.classList.add("notAllowed"), void [ "inRange", "startRange", "endRange" ].forEach(function(c) { 29014 dayElem.classList.remove(c); 29015 }); 29016 containsDisabled && !outOfRange || ([ "startRange", "inRange", "endRange", "notAllowed" ].forEach(function(c) { 29017 dayElem.classList.remove(c); 29018 }), void 0 !== elem && (elem.classList.add(hoverDate <= self.selectedDates[0].getTime() ? "startRange" : "endRange"), 29019 initialDate < hoverDate && timestamp === initialDate ? dayElem.classList.add("startRange") : hoverDate < initialDate && timestamp === initialDate && dayElem.classList.add("endRange"), 29020 minRange <= timestamp && (0 === maxRange || timestamp <= maxRange) && isBetween(timestamp, initialDate, hoverDate) && dayElem.classList.add("inRange"))); 29021 }); 29022 } 29023 } 29024 function onResize() { 29025 !self.isOpen || self.config.static || self.config.inline || positionCalendar(); 29026 } 29027 function minMaxDateSetter(type) { 29028 return function(date) { 29029 var dateObj = self.config["_" + type + "Date"] = self.parseDate(date, self.config.dateFormat), inverseDateObj = self.config["_" + ("min" === type ? "max" : "min") + "Date"]; 29030 void 0 !== dateObj && (self["min" === type ? "minDateHasTime" : "maxDateHasTime"] = 0 < dateObj.getHours() || 0 < dateObj.getMinutes() || 0 < dateObj.getSeconds()), 29031 self.selectedDates && (self.selectedDates = self.selectedDates.filter(function(d) { 29032 return isEnabled(d); 29033 }), self.selectedDates.length || "min" !== type || setHoursFromDate(dateObj), updateValue()), 29034 self.daysContainer && (redraw(), void 0 !== dateObj ? self.currentYearElement[type] = dateObj.getFullYear().toString() : self.currentYearElement.removeAttribute(type), 29035 self.currentYearElement.disabled = !!inverseDateObj && void 0 !== dateObj && inverseDateObj.getFullYear() === dateObj.getFullYear()); 29036 }; 29037 } 29038 function getInputElem() { 29039 return self.config.wrap ? element.querySelector("[data-input]") : element; 29040 } 29041 function setupLocale() { 29042 "object" != typeof self.config.locale && void 0 === flatpickr.l10ns[self.config.locale] && self.config.errorHandler(new Error("flatpickr: invalid locale " + self.config.locale)), 29043 self.l10n = __assign(__assign({}, flatpickr.l10ns.default), "object" == typeof self.config.locale ? self.config.locale : "default"
29043!== self.config.locale ? flatpickr.l10ns[self.config.locale] : void 0), 29044 tokenRegex.D = "(" + self.l10n.weekdays.shorthand.join("|") + ")", tokenRegex.l = "(" + self.l10n.weekdays.longhand.join("|") + ")", 29045 tokenRegex.M = "(" + self.l10n.months.shorthand.join("|") + ")", tokenRegex.F = "(" + self.l10n.months.longhand.join("|") + ")", 29046 tokenRegex.K = "(" + self.l10n.amPM[0] + "|" + self.l10n.amPM[1] + "|" + self.l10n.amPM[0].toLowerCase() + "|" + self.l10n.amPM[1].toLowerCase() + ")", 29047 void 0 === __assign(__assign({}, instanceConfig), JSON.parse(JSON.stringify(element.dataset || {}))).time_24hr && void 0 === flatpickr.defaultConfig.time_24hr && (self.config.time_24hr = self.l10n.time_24hr), 29048 self.formatDate = createDateFormatter(self), self.parseDate = createDateParser({ 29049 config: self.config, 29050 l10n: self.l10n 29051 }); 29052 } 29053 function positionCalendar(customPositionElement) { 29054 if ("function" != typeof self.config.position) { 29055 if (void 0 !== self.calendarContainer) { 29056 triggerEvent("onPreCalendarPosition"); 29057 var positionElement = customPositionElement || self._positionElement, calendarHeight = Array.prototype.reduce.call(self.calendarContainer.children, function(acc, child) { 29058 return acc + child.offsetHeight; 29059 }, 0), calendarWidth = self.calendarContainer.offsetWidth, configPos = self.config.position.split(" "), configPosVertical = configPos[0], configPosHorizontal = 1 < configPos.length ? configPos[1] : null, inputBounds = positionElement.getBoundingClientRect(), distanceFromBottom = window.innerHeight - inputBounds.bottom, showOnTop = "above" === configPosVertical || "below" !== configPosVertical && distanceFromBottom < calendarHeight && inputBounds.top > calendarHeight, top = window.pageYOffset + inputBounds.top + (showOnTop ? -calendarHeight - 2 : positionElement.offsetHeight + 2); 29060 if (toggleClass(self.calendarContainer, "arrowTop", !showOnTop), toggleClass(self.calendarContainer, "arrowBottom", showOnTop), 29061 !self.config.inline) { 29062 var left = window.pageXOffset + inputBounds.left, isCenter = !1, isRight = !1; 29063 "center" === configPosHorizontal ? (left -= (calendarWidth - inputBounds.width) / 2, 29064 isCenter = !0) : "right" === configPosHorizontal && (left -= calendarWidth - inputBounds.width, 29065 isRight = !0), toggleClass(self.calendarContainer, "arrowLeft", !isCenter && !isRight), 29066 toggleClass(self.calendarContainer, "arrowCenter", isCenter), toggleClass(self.calendarContainer, "arrowRight", isRight); 29067 var right = window.document.body.offsetWidth - (window.pageXOffset + inputBounds.right), rightMost = left + calendarWidth > window.document.body.offsetWidth, centerMost = right + calendarWidth > window.document.body.offsetWidth; 29068 if (toggleClass(self.calendarContainer, "rightMost", rightMost), !self.config.static) if (self.calendarContainer.style.top = top + "px", 29069 rightMost) if (centerMost) { 29070 var doc = function() { 29071 for (var editableSheet = null, i = 0; i < document.styleSheets.length; i++) { 29072 var sheet = document.styleSheets[i]; 29073 if (sheet.cssRules) { 29074 try { 29075 sheet.cssRules; 29076 } catch (err) { 29077 continue; 29078 } 29079 editableSheet = sheet; 29080 break; 29081 } 29082 } 29083 return null != editableSheet ? editableSheet : function() { 29084 var style = document.createElement("style"); 29085 return document.head.appendChild(style), style.sheet; 29086 }(); 29087 }(); 29088 if (void 0 === doc) return; 29089 var bodyWidth = window.document.body.offsetWidth, centerLeft = Math.max(0, bodyWidth / 2 - calendarWidth / 2), centerIndex = doc.cssRules.length, centerStyle = "{left:" + inputBounds.left + "px;right:auto;}"; 29090 toggleClass(self.calendarContainer, "rightMost", !1), toggleClass(self.calendarContainer, "centerMost", !0), 29091 doc.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after" + centerStyle, centerIndex), 29092 self.calendarContainer.style.left = centerLeft + "px", self.calendarContainer.style.right = "auto"; 29093 } else self.calendarContainer.style.left = "auto", self.calendarContainer.style.right = right + "px"; else self.calendarContainer.style.left = left + "px", 29094 self.calendarContainer.style.right = "auto"; 29095 } 29096 } 29097 } else self.config.position(self, customPositionElement); 29098 } 29099 function redraw() { 29100 self.config.noCalendar || self.isMobile || (buildMonthSwitch(), updateNavigationCurrentMonth(), 29101 buildDays()); 29102 } 29103 function focusAndClose() { 29104 self._input.focus(), -1 !== window.navigator.userAgent.indexOf("MSIE") || void 0 !== navigator.msMaxTouchPoints ? setTimeout(self.close, 0) : self.close(); 29105 } 29106 function selectDate(e) { 29107 e.preventDefault(), e.stopPropagation(); 29108 var t = function findParent(node, condition) { 29109 return condition(node) ? node : node.parentNode ? findParent(node.parentNode, condition) : void 0; 29110 }(getEventTarget(e), function(day) { 29111 return day.classList && day.classList.contains("flatpickr-day") && !day.classList.contains("flatpickr-disabled") && !day.classList.contains("notAllowed"); 29112 }); 29113 if (void 0 !== t) { 29114 var target = t, selectedDate = self.latestSelectedDateObj = new Date(target.dateObj.getTime()), shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth || selectedDate.getMonth() > self.currentMonth + self.config.showMonths - 1) && "range" !== self.config.mode; 29115 if (self.selectedDateElem = target, "single" === self.config.mode) self.selectedDates = [ selectedDate ]; else if ("multiple" === self.config.mode) { 29116 var selectedIndex = isDateSelected(selectedDate); 29117 selectedIndex ? self.selectedDates.splice(parseInt(selectedIndex), 1) : self.selectedDates.push(selectedDate); 29118 } else "range" === self.config.mode && (2 === self.selectedDates.length && self.clear(!1, !1), 29119 self.latestSelectedDateObj = selectedDate, self.selectedDates.push(selectedDate), 29120 0 !== compareDates(selectedDate, self.selectedDates[0], !0) && self.selectedDates.sort(function(a, b) { 29121 return a.getTime() - b.getTime(); 29122 })); 29123 if (setHoursFromInputs(), shouldChangeMonth) { 29124 var isNewYear = self.currentYear !== selectedDate.getFullYear(); 29125 self.currentYear = selectedDate.getFullYear(), self.currentMonth = selectedDate.getMonth(), 29126 isNewYear && (triggerEvent("onYearChange"), buildMonthSwitch()), triggerEvent("onMonthChange"); 29127 } 29128 if (updateNavigationCurrentMonth(), buildDays(), updateV
29128alue(), shouldChangeMonth || "range" === self.config.mode || 1 !== self.config.showMonths ? void 0 !== self.selectedDateElem && void 0 === self.hourElement && self.selectedDateElem && self.selectedDateElem.focus() : focusOnDayElem(target), 29129 void 0 !== self.hourElement && void 0 !== self.hourElement && self.hourElement.focus(), 29130 self.config.closeOnSelect) { 29131 var single = "single" === self.config.mode && !self.config.enableTime, range = "range" === self.config.mode && 2 === self.selectedDates.length && !self.config.enableTime; 29132 (single || range) && focusAndClose(); 29133 } 29134 triggerChange(); 29135 } 29136 } 29137 self.parseDate = createDateParser({ 29138 config: self.config, 29139 l10n: self.l10n 29140 }), self._handlers = [], self.pluginElements = [], self.loadedPlugins = [], self._bind = bind, 29141 self._setHoursFromDate = setHoursFromDate, self._positionCalendar = positionCalendar, 29142 self.changeMonth = changeMonth, self.changeYear = changeYear, self.clear = function(triggerChangeEvent, toInitial) { 29143 void 0 === triggerChangeEvent && (triggerChangeEvent = !0); 29144 void 0 === toInitial && (toInitial = !0); 29145 self.input.value = "", void 0 !== self.altInput && (self.altInput.value = ""); 29146 void 0 !== self.mobileInput && (self.mobileInput.value = ""); 29147 self.selectedDates = [], !(self.latestSelectedDateObj = void 0) === toInitial && (self.currentYear = self._initialDate.getFullYear(), 29148 self.currentMonth = self._initialDate.getMonth()); 29149 if (!0 === self.config.enableTime) { 29150 var _a = getDefaultHours(self.config), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds; 29151 setHours(hours, minutes, seconds); 29152 } 29153 self.redraw(), triggerChangeEvent && triggerEvent("onChange"); 29154 }, self.close = function() { 29155 self.isOpen = !1, self.isMobile || (void 0 !== self.calendarContainer && self.calendarContainer.classList.remove("open"), 29156 void 0 !== self._input && self._input.classList.remove("active")); 29157 triggerEvent("onClose"); 29158 }, self.onMouseOver = onMouseOver, self._createElement = createElement, self.createDay = createDay, 29159 self.destroy = function() { 29160 void 0 !== self.config && triggerEvent("onDestroy"); 29161 for (var i = self._handlers.length; i--; ) self._handlers[i].remove(); 29162 if (self._handlers = [], self.mobileInput) self.mobileInput.parentNode && self.mobileInput.parentNode.removeChild(self.mobileInput), 29163 self.mobileInput = void 0; else if (self.calendarContainer && self.calendarContainer.parentNode) if (self.config.static && self.calendarContainer.parentNode) { 29164 var wrapper = self.calendarContainer.parentNode; 29165 if (wrapper.lastChild && wrapper.removeChild(wrapper.lastChild), wrapper.parentNode) { 29166 for (;wrapper.firstChild; ) wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper); 29167 wrapper.parentNode.removeChild(wrapper); 29168 } 29169 } else self.calendarContainer.parentNode.removeChild(self.calendarContainer); 29170 self.altInput && (self.input.type = "text", self.altInput.parentNode && self.altInput.parentNode.removeChild(self.altInput), 29171 delete self.altInput); 29172 self.input && (self.input.type = self.input._type, self.input.classList.remove("flatpickr-input"), 29173 self.input.removeAttribute("readonly")); 29174 [ "_showTimeInput", "latestSelectedDateObj", "_hideNextMonthArrow", "_hidePrevMonthArrow", "__hideNextMonthArrow", "__hidePrevMonthArrow", "isMobile", "isOpen", "selectedDateElem", "minDateHasTime", "maxDateHasTime", "days", "daysContainer", "_input", "_positionElement", "innerContainer", "rContainer", "monthNav", "todayDateElem", "calendarContainer", "weekdayContainer", "prevMonthNav", "nextMonthNav", "monthsDropdownContainer", "currentMonthElement", "currentYearElement", "navigationCurrentMonth", "selectedDateElem", "config" ].forEach(function(k) { 29175 try { 29176 delete self[k]; 29177 } catch (_) {} 29178 }); 29179 }, self.isEnabled = isEnabled, self.jumpToDate = jumpToDate, self.updateValue = updateValue, 29180 self.open = function(e, positionElement) { 29181 void 0 === positionElement && (positionElement = self._positionElement); 29182 { 29183 if (!0 === self.isMobile) { 29184 if (e) { 29185 e.preventDefault(); 29186 var eventTarget = getEventTarget(e); 29187 eventTarget && eventTarget.blur(); 29188 } 29189 return void 0 !== self.mobileInput && (self.mobileInput.focus(), self.mobileInput.click()), 29190 void triggerEvent("onOpen"); 29191 } 29192 if (self._input.disabled || self.config.inline) return; 29193 } 29194 var wasOpen = self.isOpen; 29195 self.isOpen = !0, wasOpen || (self.calendarContainer.classList.add("open"), self._input.classList.add("active"), 29196 triggerEvent("onOpen"), positionCalendar(positionElement)); 29197 !0 === self.config.enableTime && !0 === self.config.noCalendar && (!1 !== self.config.allowInput || void 0 !== e && self.timeContainer.contains(e.relatedTarget) || setTimeout(function() { 29198 return self.hourElement.select(); 29199 }, 50)); 29200 }, self.redraw = redraw, self.set = function(option, value) { 29201 if (null !== option && "object" == typeof option) for (var key in Object.assign(self.config, option), 29202 option) void 0 !== CALLBACKS[key] && CALLBACKS[key].forEac
29202h(function(x) { 29203 return x(); 29204 }); else self.config[option] = value, void 0 !== CALLBACKS[option] ? CALLBACKS[option].forEach(function(x) { 29205 return x(); 29206 }) : -1 < HOOKS.indexOf(option) && (self.config[option] = arrayify(value)); 29207 self.redraw(), updateValue(!0); 29208 }, self.setDate = function(date, triggerChange, format) { 29209 void 0 === triggerChange && (triggerChange = !1); 29210 void 0 === format && (format = self.config.dateFormat); 29211 if (0 !== date && !date || date instanceof Array && 0 === date.length) return self.clear(triggerChange); 29212 setSelectedDate(date, format), self.latestSelectedDateObj = self.selectedDates[self.selectedDates.length - 1], 29213 self.redraw(), jumpToDate(void 0, triggerChange), setHoursFromDate(), 0 === self.selectedDates.length && self.clear(!1); 29214 updateValue(triggerChange), triggerChange && triggerEvent("onChange"); 29215 }, self.toggle = function(e) { 29216 if (!0 === self.isOpen) return self.close(); 29217 self.open(e); 29218 }; 29219 var CALLBACKS = { 29220 locale: [ setupLocale, updateWeekdays ], 29221 showMonths: [ buildMonths, setCalendarWidth, buildWeekdays ], 29222 minDate: [ jumpToDate ], 29223 maxDate: [ jumpToDate ], 29224 positionElement: [ updatePositionElement ], 29225 clickOpens: [ function() { 29226 !0 === self.config.clickOpens ? (bind(self._input, "focu
29226s", self.open), bind(self._input, "click", self.open)) : (self._input.removeEventListener("focus", self.open), 29227 self._input.removeEventListener("click", self.open)); 29228 } ] 29229 }; 29230 function setSelectedDate(inputDate, format) { 29231 var dates = []; 29232 if (inputDate instanceof Array) dates = inputDate.map(function(d) { 29233 return self.parseDate(d, format); 29234 }); else if (inputDate instanceof Date || "number" == typeof inputDate) dates = [ self.parseDate(inputDate, format) ]; else if ("string" == typeof inputDate) switch (self.config.mode) { 29235 case "single": 29236 case "time": 29237 dates = [ self.parseDate(inputDate, format) ]; 29238 break; 29239 29240 case "multiple": 29241 dates = inputDate.split(self.config.conjunction).map(function(date) { 29242 return self.parseDate(date, format); 29243 }); 29244 break; 29245 29246 case "range": 29247 dates = inputDate.split(self.l10n.rangeSeparator).map(function(date) { 29248 return self.parseDate(date, format); 29249 }); 29250 } else self.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(inputDate))); 29251 self.selectedDates = self.config.allowInvalidPreload ? dates : dates.filter(function(d) { 29252 return d instanceof Date && isEnabled(d, !1); 29253 }), "range" === self.config.mode && self.selectedDates.sort(function(a, b) { 29254 return a.getTime() - b.getTime(); 29255 }); 29256 } 29257 function parseDateRules(arr) { 29258 return arr.slice().map(function(rule) { 29259 return "string" == typeof rule || "number" == typeof rule || rule instanceof Date ? self.parseDate(rule, void 0, !0) : rule && "object" == typeof rule && rule.from && rule.to ? { 29260 from: self.parseDate(rule.from, void 0), 29261 to: self.parseDate(rule.to, void 0) 29262 } : rule; 29263 }).filter(function(x) { 29264 return x; 29265 }); 29266 } 29267 function updatePositionElement() { 29268 self._positionElement = self.config.positionElement || self._input; 29269 } 29270 function triggerEvent(event, data) { 29271 if (void 0 !== self.config) { 29272 var hooks = self.config[event]; 29273 if (void 0 !== hooks && 0 < hooks.length) for (var i = 0; hooks[i] && i < hooks.length; i++) hooks[i](self.selectedDates, self.input.value, self, data); 29274 "onChange" === event && (self.input.dispatchEvent(createEvent("change")), self.input.dispatchEvent(createEvent("input"))); 29275 } 29276 } 29277 function createEvent(name) { 29278 var e = document.createEvent("Event"); 29279 return e.initEvent(name, !0, !0), e; 29280 } 29281 function isDateSelected(date) { 29282 for (var i = 0; i < self.selectedDates.length; i++) { 29283 var selectedDate = self.selectedDates[i]; 29284 if (selectedDate instanceof Date && 0 === compareDates(selectedDate, date)) return "" + i; 29285 } 29286 return !1; 29287 } 29288 function updateNavigationCurrentMonth() { 29289 self.config.noCalendar || self.isMobile || !self.monthNav || (self.yearElements.forEach(function(yearElement, i) { 29290 var d = new Date(self.currentYear, self.currentMonth, 1); 29291 d.setMonth(self.currentMonth + i), 1 < self.config.showMonths || "static" === self.config.monthSelectorType ? self.monthElements[i].textContent = monthToStr(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + " " : self.monthsDropdownContainer.value = d.getMonth().toString(), 29292 yearElement.value = d.getFullYear().toString(); 29293 }), self._hidePrevMonthArrow = void 0 !== self.config.minDate && (self.currentYear === self.config.minDate.getFullYear() ? self.currentMonth <= self.config.minDate.getMonth() : self.currentYear < self.config.minDate.getFullYear()), 29294 self._hideNextMonthArrow = void 0 !== self.config.maxDate && (self.currentYear === self.config.maxDate.getFullYear() ? self.currentMonth + 1 > self.config.maxDate.getMonth() : self.currentYear >
29294 self.config.maxDate.getFullYear())); 29295 } 29296 function getDateStr(specificFormat) { 29297 var format = specificFormat || (self.config.altInput ? self.config.altFormat : self.config.dateFormat); 29298 return self.selectedDates.map(function(dObj) { 29299 return self.formatDate(dObj, format); 29300 }).filter(function(d, i, arr) { 29301 return "range" !== self.config.mode || self.config.enableTime || arr.indexOf(d) === i; 29302 }).join("range" !== self.config.mode ? self.config.conjunction : self.l10n.rangeSeparator); 29303 } 29304 function updateValue(triggerChange) { 29305 void 0 === triggerChange && (triggerChange = !0), void 0 !== self.mobileInput && self.mobileFormatStr && (self.mobileInput.value = void 0 !== self.latestSelectedDateObj ? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr) : ""), 29306 self.input.value = getDateStr(self.config.dateFormat), void 0 !== self.altInput && (self.altInput.value = getDateStr(self.config.altFormat)), 29307 !1 !== triggerChange && triggerEvent("onValueUpdate"); 29308 } 29309 function onMonthNavClick(e) { 29310 var eventTarget = getEventTarget(e), isPrevMonth = self.prevMonthNav.contains(eventTarget), isNextMonth = self.nextMonthNav.contains(eventTarget); 29311 isPrevMonth || isNextMonth ? changeMonth(isPrevMonth ? -1 : 1) : 0 <= self.yearElements.indexOf(eventTarget) ? eventTarget.select() : eventTarget.classList.contains("arrowUp") ? self.changeYear(self.currentYear + 1) : eventTarget.classList.contains("arrowDown") && self.changeYear(self.currentYear - 1); 29312 } 29313 return function() { 29314 self.element = self.input = element, self.isOpen = !1, function() { 29315 var boolOpts = [ "wrap", "weekNumbers", "allowInput", "allowInvalidPreload", "clickOpens", "time_24hr", "enableTime", "noCalendar", "altInput", "shorthandCurrentMonth", "inline", "static", "enableSeconds", "disableMobile" ], userConfig = __assign(__assign({}, JSON.parse(JSON.stringify(element.dataset || {}))), instanceConfig), formats = {}; 29316 self.config.parseDate = userConfig.parseDate, self.config.formatDate = userConfig.formatDate, 29317 Object.defineProperty(self.config, "enable", { 29318 get: function() { 29319 return self.config._enable; 29320 }, 29321 set: function(dates) { 29322 self.config._enable = parseDateRules(dates); 29323 } 29324 }), Object.defineProperty(self.config, "disable", { 29325 get: function() { 29326 return self.config._disable; 29327 }, 29328 set: function(dates) { 29329 self.config._disable = parseDateRules(dates); 29330 } 29331 }); 29332 var timeMode = "time" === userConfig.mode; 29333 if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) { 29334 var defaultDateFormat = flatpickr.defaultConfig.dateFormat || defaults.dateFormat; 29335 formats.dateFormat = userConfig.noCalendar || timeMode ? "H:i" + (userConfig.enableSeconds ? ":S" : "") : defaultDateFormat + " H:i" + (userConfig.enableSeconds ? ":S" : ""); 29336 } 29337 if (userConfig.altInput && (userConfig.enableTime || timeMode) && !userConfig.altFormat) { 29338 var defaultAltFormat = flatpickr.defaultConfig.altFormat || defaults.altFormat; 29339 formats.altFormat = userConfig.noCalendar || timeMode ? "h:i" + (userConfig.enableSeconds ? ":S K" : " K") : defaultAltFormat + " h:i" + (userConfig.enableSeconds ? ":S" : "") + " K"; 29340 } 29341 Object.defineProperty(self.config, "minDate", { 29342 get: function() { 29343 return self.config._minDate; 29344 }, 29345 set: minMaxDateSetter("min") 29346 }), Object.defineProperty(self.config, "maxDate", { 29347 get: function() { 29348 return self.config._maxDate; 29349 }, 29350 set: minMaxDateSetter("max") 29351 }); 29352 function minMaxTimeSetter(type) { 29353 return function(val) { 29354 self.config["min" === type ? "_minTime" : "_maxTime"] = self.parseDate(val, "H:i:S"); 29355 }; 29356 } 29357 Object.defineProperty(self.config, "minTime", { 29358 get: function() { 29359 return self.config._minTime; 29360 }, 29361 set: minMaxTimeSetter("min") 29362 }), Object.defineProperty(self.config, "maxTime", { 29363 get: function() { 29364 return self.config._maxTime; 29365 }, 29366 set: minMaxTimeSetter("max") 29367 }), "time" === userConfig.mode && (self.config.noCalendar = !0, self.config.enableTime = !0); 29368 Object.assign(self.config, formats, userConfig); 29369 for (var i = 0; i < boolOpts.length; i++) self.config[boolOpts[i]] = !0 === self.config[boolOpts[i]] || "true" === self.config[boolOpts[i]]; 29370 HOOKS.filter(function(hook) { 29371 return void 0 !== self.config[hook]; 29372 }
29372).forEach(function(hook) { 29373 self.config[hook] = arrayify(self.config[hook] || []).map(bindToInstance); 29374 }), self.isMobile = !self.config.disableMobile && !self.config.inline && "single" === self.config.mode && !self.config.disable.length && !self.config.enable && !self.config.weekNumbers && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); 29375 for (i = 0; i < self.config.plugins.length; i++) { 29376 var pluginConf = self.config.plugins[i](self) || {}; 29377 for (var key in pluginConf) -1 < HOOKS.indexOf(key) ? self.config[key] = arrayify(pluginConf[key]).map(bindToInstance).concat(self.config[key]) : void 0 === userConfig[key] && (self.config[key] = pluginConf[key]); 29378 } 29379 userConfig.altInputClass || (self.config.altInputClass = getInputElem().className + " " + self.config.altInputClass); 29380 triggerEvent("onParseConfig"); 29381 }(), setupLocale(), function() { 29382 if (self.input = getInputElem(), !self.input) return self.config.errorHandler(new Error("Invalid input element specified")); 29383 self.input._type = self.input.type, self.input.type = "text", self.input.classList.add("flatpickr-input"), 29384 self._input = self.input, self.config.altInput && (self.altInput = createElement(self.input.nodeName, self.config.altInputClass), 29385 self._input = self.altInput, self.altInput.placeholder = self.input.placeholder, 29386 self.altInput.disabled = self.input.disabled, self.altInput.required = self.input.required, 29387 self.altInput.tabIndex = self.input.tabIndex, self.altInput.type = "text", self.input.setAttribute("type", "hidden"), 29388 !self.config.static && self.input.parentNode && self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling)); 29389 self.config.allowInput || self._input.setAttribute("readonly", "readonly"); 29390 updatePositionElement(); 29391 }(), function() { 29392 self.selectedDates = [], self.now = self.parseDate(self.config.now) || new Date(); 29393 var preloadedDate = self.config.defaultDate || ("INPUT" !== self.input.nodeName && "TEXTAREA" !== self.input.nodeName || !self.input.placeholder || self.input.value !== self.input.placeholder ? self.input.value : null); 29394 preloadedDate && setSelectedDate(preloadedDate, self.config.dateFormat); 29395 self._initialDate = 0 < self.selectedDates.length ? self.selectedDates[0] : self.config.minDate && self.config.minDate.getTime() > self.now.getTime() ? self.config.minDate : self.config.maxDate && self.config.maxDate.getTime() < self.now.getTime() ? self.config.maxDate : self.now, 29396 self.currentYear = self._initialDate.getFullYear(), self.currentMonth = self._initialDate.getMonth(), 29397 0 < self.selectedDates.length && (self.latestSelectedDateObj = self.selectedDates[0]); 29398 void 0 !== self.config.minTime && (self.config.minTime = self.parseDate(self.config.minTime, "H:i")); 29399 void 0 !== self.config.maxTime && (self.config.maxTime = self.parseDate(self.config.maxTime, "H:i")); 29400 self.minDateHasTime = !!self.config.minDate && (0 < self.config.minDate.getHours() || 0 < self.config.minDate.getMinutes() || 0 < self.config.minDate.getSeconds()), 29401 self.maxDateHasTime = !!self.config.maxDate && (0 < self.config.maxDate.getHours() || 0 < self.config.maxDate.getMinutes() || 0 < self.config.maxDate.getSeconds()); 29402 }(), self.utils = { 29403 getDaysInMonth: function(month, yr) { 29404 return void 0 === month && (month = self.currentMonth), void 0 === yr && (yr = self.currentYear), 29405 1 === month && (yr % 4 == 0 && yr % 100 != 0 || yr % 400 == 0) ? 29 : self.l10n.daysInMonth[month]; 29406 } 29407 }, self.isMobile || function() { 29408 var fragment = window.document.createDocumentFragment(); 29409 if (self.calendarContainer = createElement("div", "flatpickr-calendar"), self.calendarContainer.tabIndex = -1, 29410 !self.config.noCalendar) { 29411 if (fragment.appendChild((self.monthNav = createElement("div", "flatpickr-months"), 29412 self.yearElements = [], self.monthElements = [], self.prevMonthNav = createElement("span", "flatpickr-prev-month"), 29413 self.prevMonthNav.innerHTML = self.config.prevArrow, self.nextMonthNav = createElement("span", "flatpickr-next-month"), 29414 self.nextMonthNav.innerHTML = self.config.nextArrow, buildMonths(), Object.defineProperty(self, "_hidePrevMonthArrow", { 29415 get: function() { 29416 return self.__hidePrevMonthArrow; 29417 }, 29418 set: function(bool) { 29419 self.__hidePrevMonthArrow !== bool && (toggleClass(self.prevMonthNav, "flatpickr-disabled", bool), 29420 self.__hidePrevMonthArrow = bool); 29421 } 29422 }), Object.defineProperty(self, "_hideNextMonthArrow", { 29423 get: function() { 29424 return self.__hideNextMonthArrow; 29425 }, 29426 set: function(bool) { 29427 self.__hideNextMonthArrow !== bool && (toggleClass(self.nextMonthNav, "flatpickr-disabled", bool), 29428 self.__hideNextMonthArrow = bool); 29429 } 29430 }), self.currentYearElement = self.yearElements[0], updateNavigationCurrentMonth(), 29431 self.monthNav)), self.innerContainer = createElement("div", "flatpickr-innerContainer"), 29432 self.config.weekNumbers) { 29433 var _a = function() { 29434 self.calendarContainer.classList.add("hasWeeks"); 29435 var weekWrapper = createElement("div", "flatpickr-weekwrapper"); 29436 weekWrapper.appendChild(createElement("span", "flatpickr-weekday", self.l10n.weekAbbreviation)); 29437 var weekNumbers = createElement("div", "flatpickr-weeks"); 29438 return weekWrapper.appendChild(weekNumbers), { 29439 weekWrapper: weekWrapper, 29440 weekNumbers: weekNumbers 29441 }; 29442 }(), weekWrapper = _a.weekWrapper, weekNumbers = _a.weekNumbers; 29443 self.innerContainer.appendChild(weekWrapper), self.weekNumbers = weekNumbers, self.weekWrapper = weekWrapper; 29444 } 29445 self.rContainer = createElement("div", "flatpickr-rContainer"), self.rContainer.appendChild(buildWeekdays()), 29446 self.daysContainer || (self.daysContainer = createElement("div", "flatpickr-days"), 29447 self.daysContainer.tabIndex = -1), buildDays(), self.rContainer.appendChild(self.daysContainer), 29448 self.innerContainer.appendChild(self.rContainer), fragment.appendChild(self.innerContainer); 29449 } 29450 self.config.enableTime && fragment.appendChild(function() { 29451 self.calendarContainer.classList.add("hasTime"), self.config.noCalendar && self.calendarContainer.classList.add("noCalendar"); 29452 var defaults = getDefaultHours(self.config); 29453 self.timeContainer = createElement("div", "flatpickr-time"), self.timeContainer.tabIndex = -1; 29454 var separator = createElement("span", "flatpickr-time-separator", ":"), hourInput = createNumberInput("flatpickr-hour", { 29455 "aria-label": self.l10n.hourAriaLabel 29456 }); 29457 self.hourElement = hourInput.getElementsByTagName("input")[0]; 29458 var minuteInput = createNumberInput("flatpickr-minute", { 29459 "aria-label": self.l10n.minuteAriaLabel 29460 }); 29461 self.minuteElement = minuteInput.getElementsByTagName("input")[0], self.hourElement.tabIndex = self.minuteElement.tabIndex = -1, 29462 self.hourElement.value = pad(self.latestSelectedDateObj ? self.latestSelectedDateObj.getHours() : self.config.time_24hr ? defaults.hours : function(hour) { 29463 switch (hour % 24) { 29464 case 0: 29465 case 12: 29466 return 12; 29467 29468 default: 29469 return hour % 12; 29470 } 29471 }(defaults.hours)), self.minuteElement.value = pad(self.latestSelectedDateObj ? self.latestSelectedDateObj.getMinutes() : defaults.minutes), 29472 self.hourElement.setAttribute("step", self.config.hourIncrement.toString()), self.minuteElement.setAttribute("step", self.config.minuteIncrement.toString()), 29473 self.hourElement.setAttribute("min", self.config.time_24hr ? "0" : "1"), self.hourElement.setAttribute("max", self.config.time_24hr ? "23" : "12"), 29474 self.hourElement.setAttribute("maxlength", "2"), self.minuteElement.setAttribute("min", "0"), 29475 self.minuteElement.setAttribute("max", "59"), self.minuteElement.setAttribute("maxlength", "2"), 29476 self.timeContainer.appendChild(hourIn
29476put), self.timeContainer.appendChild(separator), 29477 self.timeContainer.appendChild(minuteInput), self.config.time_24hr && self.timeContainer.classList.add("time24hr"); 29478 if (self.config.enableSeconds) { 29479 self.timeContainer.classList.add("hasSeconds"); 29480 var secondInput = createNumberInput("flatpickr-second"); 29481 self.secondElement = secondInput.getElementsByTagName("input")[0], self.secondElement.value = pad(self.latestSelectedDateObj ? self.latestSelectedDateObj.getSeconds() : defaults.seconds), 29482 self.secondElement.setAttribute("step", self.minuteElement.getAttribute("step")), 29483 self.secondElement.setAttribute("min", "0"), self.secondElement.setAttribute("max", "59"), 29484 self.secondElement.setAttribute("maxlength", "2"), self.timeContainer.appendChild(createElement("span", "flatpickr-time-separator", ":")), 29485 self.timeContainer.appendChild(secondInput); 29486 } 29487 self.config.time_24hr || (self.amPM = createElement("span", "flatpickr-am-pm", self.l10n.amPM[int(11 < (self.latestSelectedDateObj ? self.hourElement.value : self.config.defaultHour))]), 29488 self.amPM.title = self.l10n.toggleTitle, self.amPM.tabIndex = -1, self.timeContainer.appendChild(self.amPM)); 29489 return self.timeContainer; 29490 }()); 29491 toggleClass(self.calendarContainer, "rangeMode", "range" === self.config.mode), 29492 toggleClass(self.calendarContainer, "animate", !0 === self.config.animate), toggleClass(self.calendarContainer, "multiMonth", 1 < self.config.showMonths), 29493 self.calendarContainer.appendChild(fragment); 29494 var customAppend = void 0 !== self.config.appendTo && void 0 !== self.config.appendTo.nodeType; 29495 if ((self.config.inline || self.config.static) && (self.calendarContainer.classList.add(self.config.inline ? "inline" : "static"), 29496 self.config.inline && (!customAppend && self.element.parentNode ? self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling) : void 0 !== self.config.appendTo && self.config.appendTo.appendChild(self.calendarContainer)), 29497 self.config.static)) { 29498 var wrapper = createElement("div", "flatpickr-wrapper"); 29499 self.element.parentNode && self.element.parentNode.insertBefore(wrapper, self.element), 29500 wrapper.appendChild(self.element), self.altInput && wrapper.appendChild(self.altInput), 29501 wrapper.appendChild(self.calendarContainer); 29502 } 29503 self.config.static || self.config.inline || (void 0 !== self.config.appendTo ? self.config.appendTo : window.document.body).appendChild(self.calendarContainer); 29504 }(), function() { 29505 self.config.wrap && [ "open", "close", "toggle", "clear" ].forEach(function(evt) { 29506 Array.prototype.forEach.call(self.element.querySelectorAll("[data-" + evt + "]"), function(el) { 29507 return bind(el, "click", self[evt]); 29508 }); 29509 }); 29510 if (self.isMobile) return function() { 29511 var inputType = self.config.enableTime ? self.config.noCalendar ? "time" : "datetime-local" : "date"; 29512 self.mobileInput = createElement("input", self.input.className + " flatpickr-mobile"), 29513 self.mobileInput.tabIndex = 1, self.mobileInput.type = inputType, self.mobileInput.disabled = self.input.disabled, 29514 self.mobileInput.required = self.input.required, self.mobileInput.placeholder = self.input.placeholder, 29515 self.mobileFormatStr = "datetime-local" == inputType ? "Y-m-d\\TH:i:S" : "date" == inputType ? "Y-m-d" : "H:i:S", 29516 0 < self.selectedDates.length && (self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr)); 29517 self.config.minDate && (self.mobileInput.min = self.formatDate(self.config.minDate, "Y-m-d")); 29518 self.config.maxDate && (self.mobileInput.max = self.formatDate(self.config.maxDate, "Y-m-d")); 29519 self.input.getAttribute("step") && (self.mobileInput.step = String(self.input.getAttribute("step"))); 29520 self.input.type = "hidden", void 0 !== self.altInput && (self.altInput.type = "hidden"); 29521 try { 29522 self.input.parentNode && self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling); 29523 } catch (_a) {} 29524 bind(self.mobileInput, "change", function(e) { 29525 self.setDate(getEventTarget(e).value, !1, self.mobileFormatStr), triggerEvent("onChange"), 29526 triggerEvent("onClose"); 29527 }); 29528 }(); 29529 var debouncedResize = debounce(onResize, 50);
29530 self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS), self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent) && bind(self.daysContainer, "mouseover", function(e) { 29531 "range" === self.config.mode && onMouseOver(getEventTarget(e)); 29532 }); 29533 bind(self._input, "keydown", onKeyDown), void 0 !== self.calendarContainer && bind(self.calendarContainer, "keydown", onKeyDown); 29534 self.config.inline || self.config.static || bind(window, "resize", debouncedResize); 29535 void 0 !== window.ontouchstart ? bind(window.document, "touchstart", documentClick) : bind(window.document, "mousedown", documentClick); 29536 bind(window.document, "focus", documentClick, { 29537 capture: !0 29538 }), !0 === self.config.clickOpens && (bind(self._input, "focus", self.open), bind(self._input, "click", self.open)); 29539 void 0 !== self.daysContainer && (bind(self.monthNav, "click", onMonthNavClick), 29540 bind(self.monthNav, [ "keyup", "increment" ], onYearInput), bind(self.daysContainer, "click", selectDate)); 29541 if (void 0 !== self.timeContainer && void 0 !== self.minuteElement && void 0 !== self.hourElement) { 29542 bind(self.timeContainer, [ "increment" ], updateTime), bind(self.timeContainer, "blur", updateTime, { 29543 capture: !0 29544 }), bind(self.timeContainer, "click", timeIncrement), bind([ self.hourElement, self.minuteElement ], [ "focus", "click" ], function(e) { 29545 return getEventTarget(e).select(); 29546 }), void 0 !== self.secondElement && bind(self.secondElement, "focus", function() { 29547 return self.secondElement && self.secondElement.select(); 29548 }), void 0 !== self.amPM && bind(self.amPM, "click", function(e) { 29549 updateTime(e); 29550 }); 29551 } 29552 self.config.allowInput && bind(self._input, "blur", onBlur); 29553 }(), (self.selectedDates.length || self.config.noCalendar) && (self.config.enableTime && setHoursFromDate(self.config.noCalendar ? self.latestSelectedDateObj : void 0), 29554 updateValue(!1)), setCalendarWidth(); 29555 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); 29556 !self.isMobile && isSafari && positionCalendar(), triggerEvent("onReady"); 29557 }(), self; 29558 } 29559 function _flatpickr(nodeList, config) { 29560 for (var nodes = Array.prototype.slice.call(nodeList).filter(function(x) { 29561 return x instanceof HTMLElement; 29562 }), instances = [], i = 0; i < nodes.length; i++) { 29563 var node = nodes[i]; 29564 try { 29565 if (null !== node.getAttribute("data-fp-omit")) continue; 29566 void 0 !== node._flatpickr && (node._flatpickr.destroy(), node._flatpickr = void 0), 29567 node._flatpickr = FlatpickrInstance(node, config || {}), instances.push(node._flatpickr); 29568 } catch (e) { 29569 console.error(e); 29570 } 29571 } 29572 return 1 === instances.length ? instances[0] : instances; 29573 } 29574 "undefined" != typeof HTMLElement && "undefined" != typeof HTMLCollection && "undefined" != typeof NodeList && (HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function(config) { 29575 return _flatpickr(this, config); 29576 }, HTMLElement.prototype.flatpickr = function(config) { 29577 return _flatpickr([ this ], config); 29578 }); 29579 var flatpickr = function(selector, config) { 29580 return "string" == typeof selector ? _flatpickr(window.document.querySelectorAll(selector), config) : selector instanceof Node ? _flatpickr([ selector ], config) : _flatpickr(selector, config); 29581 }; 29582 return flatpickr.defaultConfig = {}, flatpickr.l10ns = { 29583 en: __assign({}, english), 29584 default: __assign({}, english) 29585 }, flatpickr.localize = function(l10n) { 29586 flatpickr.l10ns.default = __assign(__assign({}, flatpickr.l10ns.default), l10n); 29587 }, flatpickr.setDefaults = function(config) { 29588 flatpickr.defaultConfig = __assign(__assign({}, flatpickr.defaultConfig), config); 29589 }, flatpickr.parseDate = createDateParser({}), flatpickr.formatDate = createDateFormatter({}), 29590 flatpickr.compareDates = compareDates, "undefined" != typeof jQuery && void 0 !== jQuery.fn && (jQuery.fn.flatpickr = function(config) { 29591 return _flatpickr(this, config); 29592 }), Date.prototype.fp_incr = function(days) { 29593 return new Date(this.getFullYear(), this.getMonth(), this.getDate() + ("string" == typeof days ? parseInt(days, 10) : days)); 29594 }, "undefined" != typeof window && (window.flatpickr = flatpickr), flatpickr; 29595 }, "object" == typeof exports && void 0 !== module ? module.exports = factory() : "function" == typeof define && define.amd ? define(factory) : (global = "undefined" != typeof globalThis ? globalThis : global || self).flatpickr = factory(); 29596 }, {} ],
29597 279: [ function(require, module, exports) { 29598 (function(global) { 29599 !function() { 29600 var h; 29601 function l(a) { 29602 var c = 0; 29603 return function() { 29604 return c < a.length ? { 29605 done: !1, 29606 value: a[c++] 29607 } : { 29608 done: !0 29609 }; 29610 }; 29611 } 29612 var m = "function" == typeof Object.defineProperties ? Object.defineProperty : function(a, c, b) { 29613 return a == Array.prototype || a == Object.prototype || (a[c] = b.value), a; 29614 }; 29615 var w, p = function(a) { 29616 a = [ "object" == typeof globalThis && globalThis, a, "object" == typeof window && window, "object" == typeof self && self, "object" == typeof global && global ]; 29617 for (var c = 0; c < a.length; ++c) { 29618 var b = a[c]; 29619 if (b && b.Math == Math) return b; 29620 } 29621 throw Error("Cannot find global object"); 29622 }(this); 29623 function r(a, c) { 29624 if (c) { 29625 for (var b = p, d = a.split("."), e = 0; e < d.length - 1; e++) { 29626 var f = d[e]; 29627 f in b || (b[f] = {}), b = b[f]; 29628 } 29629 (f = c(e = b[d = d[d.length - 1]])) != e && null != f && m(b, d, { 29630 configurable: !0, 29631 writable: !0, 29632 value: f 29633 }); 29634 } 29635 } 29636 function u(a) { 29637 return (a = { 29638 next: a 29639 })[Symbol.iterator] = function() { 29640 return this; 29641 }, a; 29642 } 29643 function v(a) { 29644 var c = "undefined" != typeof Symbol && Symbol.iterator && a[Symbol.iterator]; 29645 return c ? c.call(a) : { 29646 next: l(a) 29647 }; 29648 } 29649 if (r("Symbol", function(a) { 29650 function b(e, f) { 29651 this.o = e, m(this, "description", { 29652 configurable: !0, 29653 writable: !0, 29654 value: f 29655 }); 29656 } 29657 if (a) return a; 29658 b.prototype.toString = function() { 29659 return this.o; 29660 }; 29661 var d = 0; 29662 return function c(e) { 29663 if (this instanceof c) throw new TypeError("Symbol is not a constructor"); 29664 return new b("jscomp_symbol_" + (e || "") + "_" + d++, e); 29665 }; 29666 }), r("Symbol.iterator", function(a) { 29667 if (a) return a; 29668 a = Symbol("Symbol.iterator"); 29669 for (var c = "Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "), b = 0; b < c.length; b++) { 29670 var d = p[c[b]]; 29671 "function" == typeof d && "function" != typeof d.prototype[a] && m(d.prototype, a, { 29672 configurable: !0, 29673 writable: !0, 29674 value: function() { 29675 return u(l(this)); 29676 } 29677 }); 29678 } 29679 return a; 29680 }), "function" == typeof Object.setPrototypeOf) w = Object.setPrototypeOf; else { 29681 var y; 29682 a: { 29683 var A = {}; 29684 try { 29685 A.__proto__ = { 29686 u: !0 29687 }, y = A.u; 29688 break a; 29689 } catch (a) {} 29690 y = !1; 29691 } 29692 w = y ? function(a, c) { 29693 if (a.__proto__ = c, a.__proto__ !== c) throw new TypeError(a + " is not extensible"); 29694 return a; 29695 } : null; 29696 } 29697 var B = w; 29698 function C() { 29699 this.h = !1, this.f = null, this.m = void 0, this.b = 1, this.l = this.v = 0, this.g = null; 29700 } 29701 function D(a) { 29702 if (a.h) throw new TypeError("Generator is already running"); 29703 a.h = !0; 29704 } 29705 function E(a, c) { 29706 return a.b = 3, { 29707 value: c 29708 }; 29709 } 29710 function F(a) { 29711 this.a = new C(), this.B = a; 29712 } 29713 function G(a, c, b, d) { 29714 try { 29715 var e = c.call(a.a.f, b); 29716 if (!(e instanceof Object)) throw new TypeError("Iterator result " + e + " is not an object"); 29717 if (!e.done) return a.a.h = !1, e; 29718 var f = e.value; 29719 } catch (g) { 29720 return a.a.f = null, a.a.j(g), H(a); 29721 } 29722 return a.a.f = null, d.call(a.a, f), H(a); 29723 } 29724 function H(a) { 29725 for (;a.a.b; ) try { 29726 var c = a.B(a.a); 29727 if (c) return a.a.h = !1, { 29728 value: c.value, 29729 done: !1 29730 }; 29731 } catch (b) { 29732 a.a.m = void 0, a.a.j(b); 29733 } 29734 if (a.a.h = !1, a.a.g) { 29735 if (c = a.a.g, a.a.g = null, c.A) throw c.w; 29736 return { 29737 value: c.return, 29738 done: !0 29739 }; 29740 } 29741 return { 29742 value: void 0, 29743 done: !0 29744 }; 29745 } 29746 function J(a) { 29747 this.next = function(c) { 29748 return a.i(c); 29749 }, this.throw = function(c) { 29750 return a.j(c); 29751 }, this.return = function(c) { 29752 return function(a, c) { 29753 D(a.a); 29754 var b = a.a.f; 29755 return b ? G(a, "return" in b ? b.return : function(d) { 29756 return { 29757 value: d, 29758 done: !0 29759 }; 29760 }, c, a.a.return) : (a.a.return(c), H(a)); 29761 }
29761(a, c); 29762 }, this[Symbol.iterator] = function() { 29763 return this; 29764 }; 29765 } 29766 function K(a, c) { 29767 var b = new J(new F(c)); 29768 return B && B(b, a.prototype), b; 29769 } 29770 if (C.prototype.i = function(a) { 29771 this.m = a; 29772 }, C.prototype.j = function(a) { 29773 this.g = { 29774 w: a, 29775 A: !0 29776 }, this.b = this.v || this.l; 29777 }, C.prototype.return = function(a) { 29778 this.g = { 29779 return: a 29780 }, this.b = this.l; 29781 }, F.prototype.i = function(a) { 29782 return D(this.a), this.a.f ? G(this, this.a.f.next, a, this.a.i) : (this.a.i(a), 29783 H(this)); 29784 }, F.prototype.j = function(a) { 29785 return D(this.a), this.a.f ? G(this, this.a.f.throw, a, this.a.i) : (this.a.j(a), 29786 H(this)); 29787 }, "undefined" != typeof Blob && ("undefined" == typeof FormData || !FormData.prototype.keys)) { 29788 function L(a, c) { 29789 for (var b = 0; b < a.length; b++) c(a[b]); 29790 } 29791 function M(a, c, b) { 29792 return c instanceof Blob ? [ String(a), c, void 0 !== b ? b + "" : "string" == typeof c.name ? c.name : "blob" ] : [ String(a), String(c) ]; 29793 } 29794 function N(a, c) { 29795 if (a.length < c) throw new TypeError(c + " argument required, but only " + a.length + " present."); 29796 } 29797 function O(a) { 29798 var c = v(a); 29799 a = c.next().value; 29800 var b = c.next().value; 29801 return c = c.next().value, b instanceof Blob && (b = new File([ b ], c, { 29802 type: b.type, 29803 lastModified: b.lastModified 29804 })), [ a, b ]; 29805 } 29806 var P = "object" == typeof globalThis ? globalThis : "object" == typeof window ? window : "object" == typeof self ? self : this, Q = P.FormData, R = P.XMLHttpRequest && P.XMLHttpRequest.prototype.send, S = P.Request && P.fetch, T = P.navigator && P.navigator.sendBeacon, U = P.Element && P.Element.prototype, V = P.Symbol && Symbol.toStringTag; 29807 V && (Blob.prototype[V] || (Blob.prototype[V] = "Blob"), "File" in P && !File.prototype[V] && (File.prototype[V] = "File")); 29808 try { 29809 new File([], ""); 29810 } catch (a) { 29811 P.File = function(c, b, d) { 29812 return c = new Blob(c, d), d = d && void 0 !== d.lastModified ? new Date(d.lastModified) : new Date(), 29813 Object.defineProperties(c, { 29814 name: { 29815 value: b 29816 }, 29817 lastModifiedDate: { 29818 value: d 29819 }, 29820 lastModified: { 29821 value: +d 29822 }, 29823 toString: { 29824 value: function() { 29825 return "[object File]"; 29826 } 29827 } 29828 }), V && Object.defineProperty(c, V, { 29829 value: "File" 29830 }), c; 29831 }; 29832 } 29833 function W(a) { 29834 this.c = []; 29835 var c = this; 29836 a && L(a.elements, function(b) { 29837 if (b.name && !b.disabled && "submit" !== b.type && "button" !== b.type && !b.matches("form fieldset[disabled] *")) if ("file" === b.type) {
29838 var d = b.files && b.files.length ? b.files : [ new File([], "", { 29839 type: "application/octet-stream" 29840 }) ]; 29841 L(d, function(e) { 29842 c.append(b.name, e); 29843 }); 29844 } else "select-multiple" === b.type || "select-one" === b.type ? L(b.options, function(e) { 29845 !e.disabled && e.selected && c.append(b.name, e.value); 29846 }) : "checkbox" === b.type || "radio" === b.type ? b.checked && c.append(b.name, b.value) : (d = "textarea" === b.type ? b.value.replace(/\r\n/g, "\n").replace(/\n/g, "\r\n") : b.value, 29847 c.append(b.name, d)); 29848 }); 29849 } 29850 if ((h = W.prototype).append = function(a, c, b) { 29851 N(arguments, 2), this.c.push(M(a, c, b)); 29852 }, h.delete = function(a) { 29853 N(arguments, 1); 29854 var c = []; 29855 a = String(a), L(this.c, function(b) { 29856 b[0] !== a && c.push(b); 29857 }), this.c = c; 29858 }, h.entries = function c() { 29859 var b, d = this; 29860 return K(c, function(e) { 29861 if (1 == e.b && (b = 0), 3 != e.b) return e = b < d.c.length ? E(e, O(d.c[b])) : void (e.b = 0); 29862 b++, e.b = 2; 29863 }); 29864 }, h.forEach = function(c, b) { 29865 N(arguments, 1); 29866 for (var d = v(this), e = d.next(); !e.done; e = d.next()) { 29867 var f = v(e.value); 29868 e = f.next().value, f = f.next().value, c.call(b, f, e, this); 29869 } 29870 }, h.get = function(c) { 29871 N(arguments, 1); 29872 var b = this.c; 29873 c = String(c); 29874 for (var d = 0; d < b.length; d++) if (b[d][0] === c) return O(b[d])[1]; 29875 return null; 29876 }, h.getAll = function(c) { 29877 N(arguments, 1); 29878 var b = []; 29879 return c = String(c), L(this.c, function(d) { 29880 d[0] === c && b.push(O(d)[1]); 29881 }), b; 29882 }, h.has = function(c) { 29883 N(arguments, 1), c = String(c); 29884 for (var b = 0; b < this.c.length; b++) if (this.c[b][0] === c) return !0; 29885 return !1; 29886 }, h.keys = function b() { 29887 var e, f, g, k, d = this; 29888 return K(b, function(t) { 29889 if (1 == t.b && (e = v(d), f = e.next()), 3 != t.b) return f.done ? void (t.b = 0) : (g = f.value, 29890 k = v(g), E(t, k.next().value)); 29891 f = e.next(), t.b = 2; 29892 }); 29893 }, h.set = function(b, d, e) { 29894 N(arguments, 2), b = String(b); 29895 var f = [], g = M(b, d, e), k = !0; 29896 L(this.c, function(q) { 29897 q[0] === b ? k = k && !f.push(g) : f.push(q); 29898 }), k && f.push(g), this.c = f; 29899 }, h.values = function d() { 29900 var f, g, k, q, e = this; 29901 return K(d, function(x) { 29902 if (1 == x.b && (f = v(e), g = f.next()), 3 != x.b) return g.done ? void (x.b = 0) : (k = g.value, 29903 (q = v(k)).next(), E(x, q.next().value)); 29904 g = f.next(), x.b = 2; 29905 }); 29906 }, W.prototype._asNative = function() { 29907 for (var d = new Q(), e = v(this), f = e.next(); !f.done; f = e.next()) { 29908 var g = v(f.value); 29909 f = g.next().value, g = g.next().value, d.append(f, g); 29910 } 29911 return d; 29912 }, W.prototype._blob = function() { 29913 for (var d = "----formdata-polyfill-" + Math.random(), e = [], f = v(this), g = f.next(); !g.done; g = f.next()) { 29914 var k = v(g.value); 29915 g = k.next().value, k = k.next().value, e.push("--" + d + "\r\n"), k instanceof Blob ? e.push('Content-Disposition: form-data; name="' + g + '"; filename="' + k.name + '"\r\nContent-Type: ' + (k.type || "application/octet-stream") + "\r\n\r\n", k, "\r\n") : e.push('Content-Disposition: form-data; name="' + g + '"\r\n\r\n' + k + "\r\n"); 29916 } 29917 return e.push("--" + d + "--"), new Blob(e, { 29918 type: "multipart/form-data; boundary=" + d 29919 }); 29920 }, W.prototype[Symbol.iterator] = function() { 29921 return this.entries(); 29922 }, W.prototype.toString = function() { 29923 return "[object FormData]"; 29924 }, U && !U.matches && (U.matches = U.matchesSelector || U.mozMatchesSelector || U.msMatchesSelector || U.oMatchesSelector || U.webkitMatchesSelector || function(d) { 29925 for (var e = (d = (this.document || this.ownerDocument).querySelectorAll(d)).length; 0 <= --e && d.item(e) !== this; ) ; 29926 return -1 < e; 29927 }), V && (W.prototype[V] = "FormData"), R) { 29928 var X = P.XMLHttpRequest.prototype.setRequestHeader; 29929 P.XMLHttpRequest.prototype.setRequestHeader = function(d, e) { 29930 X.call(this, d, e), "content-type" === d.toLowerCase() && (this.s = !0); 29931 }, P.XMLHttpRequest.prototype.send = function(d) { 29932 d instanceof W && (d = d._blob(), this.s || this.setRequestHeader("Content-Type", d.type)), 29933 R.call(this, d); 29934 }; 29935 } 29936 S && (P.fetch = function(d, e) { 29937 return e && e.body && e.body instanceof W && (e.body = e.body._blob()), S.call(this, d, e); 29938 }), T && (P.navigator.sendBeacon = function(d, e) { 29939 return e instanceof W && (e = e._asNative()), T.call(this, d, e); 29940 }), P.FormData = W; 29941 } 29942 }(); 29943 }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}); 29944 }, {} ],
29945 280: [ function(require, module, exports) { 29946 !function(window, factory) { 29947 "function" == typeof define && define.amd ? define(factory) : "object" == typeof module && module.exports ? module.exports = factory() : window.getSize = factory(); 29948 }(window, function() { 29949 "use strict"; 29950 function getStyleSize(value) { 29951 var num = parseFloat(value); 29952 return -1 == value.indexOf("%") && !isNaN(num) && num; 29953 } 29954 var logError = "undefined" == typeof console ? function() {} : function(message) { 29955 console.error(message); 29956 }, measurements = [ "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "marginLeft", "marginRight", "marginTop", "marginBottom", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth" ], measurementsLength = measurements.length; 29957 function getStyle(elem) { 29958 var style = getComputedStyle(elem); 29959 return style || logError("Style returned " + style + ". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"), 29960 style; 29961 } 29962 var isBoxSizeOuter, isSetup = !1; 29963 function getSize(elem) { 29964 if (function() { 29965 if (!isSetup) { 29966 isSetup = !0; 29967 var div = document.createElement("div"); 29968 div.style.width = "200px", div.style.padding = "1px 2px 3px 4px", div.style.borderStyle = "solid", 29969 div.style.borderWidth = "1px 2px 3px 4px", div.style.boxSizing = "border-box"; 29970 var body = document.body || document.documentElement; 29971 body.appendChild(div); 29972 var style = getStyle(div); 29973 isBoxSizeOuter = 200 == Math.round(getStyleSize(style.width)), getSize.isBoxSizeOuter = isBoxSizeOuter, 29974 body.removeChild(div); 29975 } 29976 }(), "string" == typeof elem && (elem = document.querySelector(elem)), elem && "object" == typeof elem && elem.nodeType) { 29977 var style = getStyle(elem); 29978 if ("none" == style.display) return function() { 29979 for (var size = { 29980 width: 0, 29981 height: 0, 29982 innerWidth: 0, 29983 innerHeight: 0, 29984 outerWidth: 0, 29985 outerHeight: 0 29986 }, i = 0; i < measurementsLength; i++) { 29987 size[measurements[i]] = 0; 29988 } 29989 return size; 29990 }(); 29991 var size = {}; 29992 size.width = elem.offsetWidth, size.height = elem.offsetHeight; 29993 for (var isBorderBox = size.isBorderBox = "border-box" == style.boxSizing, i = 0; i < measurementsLength; i++) { 29994 var measurement = measurements[i], value = style[measurement], num = parseFloat(value); 29995 size[measurement] = isNaN(num) ? 0 : num; 29996 } 29997 var paddingWidth = size.paddingLeft + size.paddingRight, paddingHeight = size.paddingTop + size.paddingBottom, marginWidth = size.marginLeft + size.marginRight, marginHeight = size.marginTop + size.marginBottom, borderWidth = size.borderLeftWidth + size.borderRightWidth, borderHeight = size.borderTopWidth + size.borderBottomWidth, isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter, styleWidth = getStyleSize(style.width); 29998 !1 !== styleWidth && (size.width = styleWidth + (isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth)); 29999 var styleHeight = getStyleSize(style.height); 30000 return !1 !== styleHeight && (size.height = styleHeight + (isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight)), 30001 size.innerWidth = size.width - (paddingWidth + borderWidth), size.innerHe
30001ight = size.height - (paddingHeight + borderHeight), 30002 size.outerWidth = size.width + marginWidth, size.outerHeight = size.height + marginHeight, 30003 size; 30004 } 30005 } 30006 return getSize; 30007 }); 30008 }, {} ], 30009 281: [ function(require, module, exports) { 30010 "use strict"; 30011 module.exports = function(el, onOver, onOut) { 30012 var x, y, pX, pY, mouseOver = !1, focused = !1, h = {}, state = 0, timer = 0, options = { 30013 sensitivity: 7, 30014 interval: 100, 30015 timeout: 0, 30016 handleFocus: !1 30017 }; 30018 function tracker(e) { 30019 x = e.clientX, y = e.clientY; 30020 } 30021 function dispatchOver(e) { 30022 return mouseOver = !0, timer = timer && clearTimeout(timer), el.removeEventListener("mousemove", tracker, !1), 30023 1 !== state && (pX = e.clientX, pY = e.clientY, el.addEventListener("mousemove", tracker, !1), 30024 timer = setTimeout(function() { 30025 !function compare(el, e) { 30026 if (timer = timer && clearTimeout(timer), Math.abs(pX - x) + Math.abs(pY - y) < options.sensitivity) return state = 1, 30027 focused ? void 0 : onOver.call(el, e); 30028 pX = x, pY = y, timer = setTimeout(function() { 30029 compare(el, e); 30030 }, options.interval); 30031 }(el, e); 30032 }, options.interval)), this; 30033 } 30034 function dispatchOut(e) { 30035 return mouseOver = !1, timer = timer && clearTimeout(timer), el.removeEventListener("mousemove", tracker, !1), 30036 1 === state && (timer = setTimeout(function() { 30037 !function(el, e) { 30038 timer = timer && clearTimeout(timer), state = 0, focused || onOut.call(el, e); 30039 }(el, e); 30040 }, options.timeout)), this; 30041 } 30042 function dispatchFocus(e) { 30043 mouseOver || (focused = !0, onOver.call(el, e)); 30044 } 30045 function dispatchBlur(e) { 30046 !mouseOver && focused && (focused = !1, onOut.call(el, e)); 30047 } 30048 function removeFocus() { 30049 el.removeEventListener("focus", dispatchFocus, !1), el.removeEventListener("blur", dispatchBlur, !1); 30050 } 30051 return h.options = function(opt) { 30052 var focusOptionChanged = opt.handleFocus !== options.handleFocus; 30053 return options = Object.assign({}, options, opt), focusOptionChanged && (options.handleFocus ? (el.addEventListener("focus", dispatchFocus, !1), 30054 el.addEventListener("blur", dispatchBlur, !1)) : removeFocus()), h; 30055 }, h.remove = function() { 30056 el && (el.removeEventListener("mouseover", dispatchOver, !1), el.removeEventListener("mouseout", dispatchOut, !1), 30057 removeFocus()); 30058 }, el && (el.addEventListener("mouseover", dispatchOver, !1), el.addEventListener("mouseout", dispatchOut, !1)), 30059 h; 30060 }; 30061 }, {} ], 30062 282: [ function(require, module, exports) { 30063 !function(global, factory) { 30064 "use strict"; 30065 "object" == typeof module && "object" == typeof module.exports ? module.exports = global.document ? factory(global, !0) : function(w) { 30066 if (!w.document) throw new Error("jQuery requires a window with a document"); 30067 return factory(w); 30068 } : factory(global); 30069 }("undefined" != typeof window ? window : this, function(window, noGlobal) { 30070 "use strict"; 30071 var arr = [], getProto = Object.getPrototypeOf, slice = arr.slice, flat = arr.flat ? function(array) { 30072 return arr.flat.call(array); 30073 } : function(array) { 30074 return arr.concat.apply([], array); 30075 }, push = arr.push, indexOf = arr.indexOf, class2type = {}, toString = class2type.toString, hasOwn = class2type.hasOwnProperty, fnToString = hasOwn.toString, ObjectFunctionString = fnToString.call(Object), support = {}, isFunction = function(obj) { 30076 return "function" == typeof obj && "number" != typeof obj.nodeType && "function" != typeof obj.item; 30077 }, isWindow = function(obj) { 30078 return null != obj && obj === obj.window; 30079 }, document = window.document, preservedScriptAttributes = { 30080 type: !0, 30081 src: !0, 30082 nonce: !0, 30083 noModule: !0 30084 }; 30085 function DOMEval(code, node, doc) { 30086 var i, val, script = (doc = doc || document).createElement("script"); 30087 if (script.text = code, node) for (i in preservedScriptAttributes) (val = node[i] || node.getAttribute && node.getAttribute(i)) && script.setAttribute(i, val); 30088 doc.head.appendChild(script).parentNode.removeChild(script); 30089 } 30090 function toType(obj) { 30091 return null == obj ? obj + "" : "object" == typeof obj || "function" == typeof obj ? class2type[toString.call(obj)] || "object" : typeof obj; 30092 } 30093 var jQuery = function(selector, context) { 30094 return new jQuery.fn.init(selector, context); 30095 }; 30096 function isArrayLike(obj) { 30097 var length = !!obj && "length" in obj && obj.length, type = toType(obj); 30098 return !isFunction(obj) && !isWindow(obj) && ("array" === type || 0 === length || "number" == typeof length && 0 < length && length - 1 in obj); 30099 } 30100 jQuery.fn = jQuery.prototype = { 30101 jquery: "3.6.0", 30102 constructor: jQuery, 30103 length: 0, 30104 toArray: function() { 30105 return slice.call(this); 30106 }, 30107 get: function(num) { 30108 return null == num ? slice.call(this) : num < 0 ? this[num + this.length] : this[num]; 30109 }, 30110 pushStack: function(elems) { 30111 var ret = jQuery.merge(this.constructor(), elems);
30112 return ret.prevObject = this, ret; 30113 }, 30114 each: function(callback) { 30115 return jQuery.each(this, callback); 30116 }, 30117 map: function(callback) { 30118 return this.pushStack(jQuery.map(this, function(elem, i) { 30119 return callback.call(elem, i, elem); 30120 })); 30121 }, 30122 slice: function() { 30123 return this.pushStack(slice.apply(this, arguments)); 30124 }, 30125 first: function() { 30126 return this.eq(0); 30127 }, 30128 last: function() { 30129 return this.eq(-1); 30130 }, 30131 even: function() { 30132 return this.pushStack(jQuery.grep(this, function(_elem, i) { 30133 return (i + 1) % 2; 30134 })); 30135 }, 30136 odd: function() { 30137 return this.pushStack(jQuery.grep(this, function(_elem, i) { 30138 return i % 2; 30139 })); 30140 }, 30141 eq: function(i) { 30142 var len = this.length, j = +i + (i < 0 ? len : 0); 30143 return this.pushStack(0 <= j && j < len ? [ this[j] ] : []); 30144 }, 30145 end: function() { 30146 return this.prevObject || this.constructor(); 30147 }, 30148 push: push, 30149 sort: arr.sort, 30150 splice: arr.splice 30151 }, jQuery.extend = jQuery.fn.extend = function() { 30152 var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = !1; 30153 for ("boolean" == typeof target && (deep = target, target = arguments[i] || {}, 30154 i++), "object" == typeof target || isFunction(target) || (target = {}), i === length && (target = this, 30155 i--); i < length; i++) if (null != (options = arguments[i])) for (name in options) copy = options[name], 30156 "__proto__" !== name && target !== copy && (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = Array.isArray(copy))) ? (src = target[name], 30157 clone = copyIsArray && !Array.isArray(src) ? [] : copyIsArray || jQuery.isPlainObject(src) ? src : {}, 30158 copyIsArray = !1, target[name] = jQuery.extend(deep, clone, copy)) : void 0 !== copy && (target[name] = copy)); 30159 return target; 30160 }, jQuery.extend({ 30161 expando: "jQuery" + ("3.6.0" + Math.random()).replace(/\D/g, ""), 30162 isReady: !0, 30163 error: function(msg) { 30164 throw new Error(msg); 30165 }, 30166 noop: function() {}, 30167 isPlainObject: function(obj) { 30168 var proto, Ctor; 30169 return !(!obj || "[object Object]" !== toString.call(obj)) && (!(proto = getProto(obj)) || "function" == typeof (Ctor = hasOwn.call(proto, "constructor") && proto.constructor) && fnToString.call(Ctor) === ObjectFunctionString); 30170 }, 30171 isEmptyObject: function(obj) { 30172 var name; 30173 for (name in obj) return !1; 30174 return !0; 30175 }, 30176 globalEval: function(code, options, doc) { 30177 DOMEval(code, { 30178 nonce: options && options.nonce 30179 }, doc); 30180 }, 30181 each: function(obj, callback) { 30182 var length, i = 0; 30183 if (isArrayLike(obj)) for (length = obj.length; i < length && !1 !== callback.call(obj[i], i, obj[i]); i++) ; else for (i in obj) if (!1 === callback.call(obj[i], i, obj[i])) break; 30184 return obj; 30185 }, 30186 makeArray: function(arr, results) { 30187 var ret = results || []; 30188 return null != arr && (isArrayLike(Object(arr)) ? jQuery.merge(ret, "string" == typeof arr ? [ arr ] : arr) : push.call(ret, arr)), 30189 ret; 30190 }, 30191 inArray: function(elem, arr, i) { 30192 return null == arr ? -1 : indexOf.call(arr, elem, i); 30193 }, 30194 merge: function(first, second) { 30195 for (var len = +second.length, j = 0, i = first.length; j < len; j++) first[i++] = second[j]; 30196 return first.length = i, first; 30197 },
30198 grep: function(elems, callback, invert) { 30199 for (var matches = [], i = 0, length = elems.length, callbackExpect = !invert; i < length; i++) !callback(elems[i], i) != callbackExpect && matches.push(elems[i]); 30200 return matches; 30201 }, 30202 map: function(elems, callback, arg) { 30203 var length, value, i = 0, ret = []; 30204 if (isArrayLike(elems)) for (length = elems.length; i < length; i++) null != (value = callback(elems[i], i, arg)) && ret.push(value); else for (i in elems) null != (value = callback(elems[i], i, arg)) && ret.push(value); 30205 return flat(ret); 30206 }, 30207 guid: 1, 30208 support: support 30209 }), "function" == typeof Symbol && (jQuery.fn[Symbol.iterator] = arr[Symbol.iterator]), 30210 jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function(_i, name) { 30211 class2type["[object " + name + "]"] = name.toLowerCase(); 30212 }); 30213 var Sizzle = function(window) { 30214 function funescape(escape, nonHex) { 30215 var high = "0x" + escape.slice(1) - 65536; 30216 return nonHex || (high < 0 ? String.fromCharCode(65536 + high) : String.fromCharCode(high >> 10 | 55296, 1023 & high | 56320)); 30217 } 30218 function unloadHandler() { 30219 setDocument(); 30220 } 30221 var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, expando = "sizzle" + 1 * new Date(), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), nonnativeSelectorCache = createCache(), sortOrder = function(a, b) { 30222 return a === b && (hasDuplicate = !0), 0; 30223 }, hasOwn = {}.hasOwnProperty, arr = [], pop = arr.pop, pushNative = arr.push, push = arr.push, slice = arr.slice, indexOf = function(list, elem) { 30224 for (var i = 0, len = list.length; i < len; i++) if (list[i] === elem) return i; 30225 return -1; 30226 }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", whitespace = "[\\x20\\t\\r\\n\\f]", identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + "*([*^$|!~]?=)" + whitespace + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|.*)\\)|)", rwhitespace = new RegExp(whitespace + "+", "g"), rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"), rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), rcombinators = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), rdescend = new RegExp(whitespace + "|>"), rpseudo = new RegExp(pseudos), ridentifier = new RegExp("^" + identifier + "$"), matchExpr = { 30227 ID: new RegExp("^#(" + identifier + ")"), 30228 CLASS: new RegExp("^\\.(" + identifier + ")"), 30229 TAG: new RegExp("^(" + identifier + "|[*])"), 30230 ATTR: new RegExp("^" + attributes), 30231 PSEUDO: new RegExp("^" + pseudos), 30232 CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i"), 30233 bool: new RegExp("^(?:" + booleans + ")$", "i"), 30234 needsContext: new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i") 30235 }, rhtml = /HTML$/i, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, runescape = new RegExp("\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g"), rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, fcssescape = function(ch, asCodePoint) { 30236 return asCodePoint ? "\0" === ch ? "�" : ch.slice(0, -1) + "\\" + ch.charCo
30236deAt(ch.length - 1).toString(16) + " " : "\\" + ch; 30237 }, inDisabledFieldset = addCombinator(function(elem) { 30238 return !0 === elem.disabled && "fieldset" === elem.nodeName.toLowerCase(); 30239 }, { 30240 dir: "parentNode", 30241 next: "legend" 30242 }); 30243 try { 30244 push.apply(arr = slice.call(preferredDoc.childNodes), preferredDoc.childNodes), 30245 arr[preferredDoc.childNodes.length].nodeType; 30246 } catch (e) { 30247 push = { 30248 apply: arr.length ? function(target, els) { 30249 pushNative.apply(target, slice.call(els)); 30250 } : function(target, els) { 30251 for (var j = target.length, i = 0; target[j++] = els[i++]; ) ; 30252 target.length = j - 1; 30253 } 30254 }; 30255 } 30256 function Sizzle(selector, context, results, seed) { 30257 var m, i, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument, nodeType = context ? context.nodeType : 9; 30258 if (results = results || [], "string" != typeof selector || !selector || 1 !== nodeType && 9 !== nodeType && 11 !== nodeType) return results; 30259 if (!seed && (setDocument(context), context = context || document, documentIsHTML)) { 30260 if (11 !== nodeType && (match = rquickExpr.exec(selector))) if (m = match[1]) { 30261 if (9 === nodeType) { 30262 if (!(elem = context.getElementById(m))) return results; 30263 if (elem.id === m) return results.push(elem), results; 30264 } else if (newContext && (elem = newContext.getElementById(m)) && contains(context, elem) && elem.id === m) return results.push(elem), 30265 results; 30266 } else { 30267 if (match[2]) return push.apply(results, context.getElementsByTagName(selector)), 30268 results; 30269 if ((m = match[3]) && support.getElementsByClassName && context.getElementsByClassName) return push.apply(results, context.getElementsByClassName(m)), 30270 results; 30271 } 30272 if (support.qsa && !nonnativeSelectorCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector)) && (1 !== nodeType || "object" !== context.nodeName.toLowerCase())) { 30273 if (newSelector = selector, newContext = context, 1 === nodeType && (rdescend.test(selector) || rcombinators.test(selector))) { 30274 for ((newContext = rsibling.test(selector) && testContext(context.parentNode) || context) === context && support.scope || ((nid = context.getAttribute("id")) ? nid = nid.replace(rcssescape, fcssescape) : context.setAttribute("id", nid = expando)), 30275 i = (groups = tokenize(selector)).length; i--; ) groups[i] = (nid ? "#" + nid : ":scope") + " " + toSelector(groups[i]); 30276 newSelector = groups.join(","); 30277 } 30278 try { 30279 return push.apply(results, newContext.querySelectorAll(newSelector)), results; 30280 } catch (qsaError) { 30281 nonnativeSelectorCache(selector, !0); 30282 } finally { 30283 nid === expando && context.removeAttribute("id"); 30284 } 30285 } 30286 } 30287 return select(selector.replace(rtrim, "$1"), context, results, seed); 30288 } 30289 function createCache() { 30290 var keys = []; 30291 return function cache(key, value) { 30292 return keys.push(key + " ") > Expr.cacheLength && delete cache[keys.shift()], cache[key + " "] = value; 30293 }; 30294 } 30295 function markFunction(fn) { 30296 return fn[expando] = !0, fn; 30297 } 30298 function assert(fn) { 30299 var el = document.createElement("fieldset"); 30300 try { 30301 return !!fn(el); 30302 } catch (e) { 30303 return !1; 30304 } finally { 30305 el.parentNode && el.parentNode.removeChild(el), el = null; 30306 } 30307 } 30308 function addHandle(attrs, handler) { 30309 for (var arr = attrs.split("|"), i = arr.length; i--; ) Expr.attrHandle[arr[i]] = handler; 30310 } 30311 function siblingCheck(a, b) { 30312 var cur = b && a, diff = cur && 1 === a.nodeType && 1 === b.nodeType && a.sourceIndex - b.sourceIndex; 30313 if (diff) return diff; 30314 if (cur) for (;cur = cur.nextSibling; ) if (cur === b) return -1; 30315 return a ? 1 : -1; 30316 } 30317 function createInputPseudo(type) { 30318 return function(elem) { 30319 return "input" === elem.nodeName.toLowerCase() && elem.type === type; 30320 }; 30321 } 30322 function createButtonPseudo(type) { 30323 return function(elem) { 30324 var name = elem.nodeName.toLowerCase(); 30325 return ("input" === name || "button" === name) && elem.type === type; 30326 }; 30327 } 30328 function createDisabledPseudo(disabled) { 30329 return function(elem) { 30330 return "form" in elem ? elem.parentNode && !1 === elem.disabled ? "label" in elem ? "label" in elem.parentNode ? elem.parentNode.disabled === disabled : elem.disabled === disabled : elem.isDisabled === disabled || elem.isDisabled !== !disabled && inDisabledFieldset(elem) === disabled : elem.disabled === disabled : "label" in elem && elem.disabled === disabled; 30331 }; 30332 } 30333 function createPositionalPseudo(fn) { 30334 return markFunction(function(argument) { 30335 return argument = +argument, markFunction(function(seed, matches) { 30336 for (var j, matchIndexes = fn([], seed.length, argument), i = matchIndexes.length; i--; ) seed[j = matchIndexes[i]] && (seed[j] = !(matches[j] = seed[j])); 30337 }); 30338 }); 30339 } 30340 function testContext(context) { 30341 return context && void 0 !== context.getElementsByTagName && context; 30342 } 30343 for (i in support = Sizzle.support = {}, isXML = Sizzle.isXML = function(elem) { 30344 var namespace = elem && elem.namespaceURI, docElem = elem && (elem.ownerDocument || elem).documentElement; 30345 return !rhtml.test(namespace || docElem && docElem.nodeName || "HTML"); 30346 }, setDocument = Sizzle.setDocument = function(node) { 30347 var hasCompare, subWindow, doc = node ? node.ownerDocument || node : preferredDoc; 30348 return doc != document && 9 === doc.nodeType && doc.documentElement && (docElem = (document = doc).documentElement, 30349 documentIsHTML = !isXML(document), preferredDoc != document && (subWindow = document.defaultView) && subWindow.top !== subWindow && (subWindow.addEventListener ? subWindow.addEventListener("unload", unloadHandler, !1) : subWindow.attachEvent && subWindow.attachEvent("onunload", unloadHandler)), 30350 support.scope = assert(function(el) { 30351 return docElem.appendChild(el).appendChild(document.createElement("div")), void 0 !== el.querySelectorAll && !el.querySelectorAll(":scope fieldset div").length; 30352 }), support.attributes = assert(function(el) { 30353 return el.className = "i", !el.getAttribute("className"); 30354 }), support.getElementsByTagName = assert(function(el) { 30355 return el.appendChild(document.createComment("")), !el.getElementsByTagName("*").length; 30356 }), support.getElementsByClassName = rnative.test(document.getElementsByClassName), 30357 support.getById = assert(function(el) { 30358 return docElem.appendChild(el).id = expando, !document.getElementsByName || !document.getElementsByName(expando).length; 30359 }), support.getById ? (Expr.filter.ID = function(id) { 30360 var attrId = id.replace(runescape, funescape); 30361 return function(elem) { 30362 return elem.getAttribute("id") === attrId; 30363 }; 30364 }, Expr.find.ID = function(id, context) { 30365 if (void 0 !== context.getElementById && documentIsHTML) { 30366 var elem = context.getElementById(id); 30367 return elem ? [ elem ] : []; 30368 } 30369 }) : (Expr.filter.ID = function(id) { 30370 var attrId = id.replace(runescape, funescape); 30371 return function(elem) { 30372 var node = void 0 !== elem.getAttributeNode && elem.getAttributeNode("id"); 30373 return node && node.value === attrId; 30374 }; 30375 }, Expr.find.ID = function(id, context) { 30376 if (void 0 !== context.getElementById && documentIsHTML) { 30377 var node, i, elems, elem = context.getElementById(id); 30378 if (elem) { 30379 if ((node = elem.getAttributeNode("id")) && node.value === id) return [ elem ]; 30380 for (elems = context.getElementsByName(id), i = 0; elem = elems[i++]; ) if ((node = elem.getAttributeNode("id")) && node.value === id) return [ elem ]; 30381 } 30382 return []; 30383 } 30384 }), Expr.find.TAG = support.getElementsByTagName ? function(tag, context) { 30385 return void 0 !== context.getElementsByTagName ? context.getElementsByTagName(tag) : support.qsa ? context.querySelectorAll(tag) : void 0; 30386 } : function(tag, context) { 30387 var elem, tmp = [], i = 0, results = context.getElementsByTagName(tag); 30388 if ("*" !== tag) return results; 30389 for (;elem = results[i++]; ) 1 === elem.nodeType && tmp.push(elem); 30390 return tmp; 30391 }, Expr.find.CLASS = support.getElementsByClassName && function(className, context) { 30392 if (void 0 !== context.getElementsByClassName && documentIsHTML) return context.getElementsByClassName(className); 30393 }, rbuggyMatches = [], rbuggyQSA = [], (support.qsa = rnative.test(document.querySelectorAll)) && (assert(function(el) { 30394 var input; 30395 docElem.appendChild(el).innerHTML = "<a id='" + expando + "'></a><select id='" + expando + "-\r\\' msallowcapture=''><option selected=''></option></select>", 30396 el.querySelectorAll("[msallowcapture^='']").length && rbuggyQSA.push("[*^$]=" + whitespace + "*(?:''|\"\")"), 30397 el.querySelectorAll("[selected]").length || rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")"), 30398 el.querySelectorAll("[id~=" + expando + "-]").length || rbuggyQSA.push("~="), (input = document.createElement("input")).setAttribute("name", ""), 30399 el.appendChild(input), el.querySelectorAll("[name='']").length || rbuggyQSA.push("\\[" + whitespace + "*name" + whitespace + "*="
30399+ whitespace + "*(?:''|\"\")"), 30400 el.querySelectorAll(":checked").length || rbuggyQSA.push(":checked"), el.querySelectorAll("a#" + expando + "+*").length || rbuggyQSA.push(".#.+[+~]"), 30401 el.querySelectorAll("\\\f"), rbuggyQSA.push("[\\r\\n\\f]"); 30402 }), assert(function(el) { 30403 el.innerHTML = "<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>"; 30404 var input = document.createElement("input"); 30405 input.setAttribute("type", "hidden"), el.appendChild(input).setAttribute("name", "D"), 30406 el.querySelectorAll("[name=d]").length && rbuggyQSA.push("name" + whitespace + "*[*^$|!~]?="), 30407 2 !== el.querySelectorAll(":enabled").length && rbuggyQSA.push(":enabled", ":disabled"), 30408 docElem.appendChild(el).disabled = !0, 2 !== el.querySelectorAll(":disabled").length && rbuggyQSA.push(":enabled", ":disabled"), 30409 el.querySelectorAll("*,:x"), rbuggyQSA.push(",.*:"); 30410 })), (support.matchesSelector = rnative.test(matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector)) && assert(function(el) { 30411 support.disconnectedMatch = matches.call(el, "*"), matches.call(el, "[s!='']:x"), 30412 rbuggyMatches.push("!=", pseudos); 30413 }), rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|")), rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|")), 30414 hasCompare = rnative.test(docElem.compareDocumentPosition), contains = hasCompare || rnative.test(docElem.contains) ? function(a, b) { 30415 var adown = 9 === a.nodeType ? a.documentElement : a, bup = b && b.parentNode; 30416 return a === bup || !(!bup || 1 !== bup.nodeType || !(adown.contains ? adown.contains(bup) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(bup))); 30417 } : function(a, b) { 30418 if (b) for (;b = b.parentNode; ) if (b === a) return !0; 30419 return !1; 30420 }, sortOrder = hasCompare ? function(a, b) { 30421 if (a === b) return hasDuplicate = !0, 0; 30422 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 30423 return compare || (1 & (compare = (a.ownerDocument || a) == (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1) || !support.sortDetached && b.compareDocumentPosition(a) === compare ? a == document || a.ownerDocument == preferredDoc && contains(preferredDoc, a) ? -1 : b == document || b.ownerDocument == preferredDoc && contains(preferredDoc, b) ? 1 : sortInput ? indexOf(sortInput, a) - indexOf(sortInput, b) : 0 : 4 & compare ? -1 : 1); 30424 } : function(a, b) { 30425 if (a === b) return hasDuplicate = !0, 0; 30426 var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; 30427 if (!aup || !bup) return a == document ? -1 : b == document ? 1 : aup ? -1 : bup ? 1 : sortInput ? indexOf(sortInput, a) - indexOf(sortInput, b) : 0; 30428 if (aup === bup) return siblingCheck(a, b); 30429 for (cur = a; cur = cur.parentNode; ) ap.unshift(cur); 30430 for (cur = b; cur = cur.parentNode; ) bp.unshift(cur); 30431 for (;ap[i] === bp[i]; ) i++; 30432 return i ? siblingCheck(ap[i], bp[i]) : ap[i] == preferredDoc ? -1 : bp[i] == preferredDoc ? 1 : 0; 30433 }), document; 30434 }, Sizzle.matches = function(expr, elements) { 30435 return Sizzle(expr, null, null, elements); 30436 }, Sizzle.matchesSelector = function(elem, expr) { 30437 if (setDocument(elem), support.matchesSelector && documentIsHTML && !nonnativeSelectorCache[expr + " "] && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) try { 30438 var ret = matches.call(elem, expr); 30439 if (ret || support.disconnectedMatch || elem.document && 11 !== elem.document.nodeType) return ret; 30440 } catch (e) { 30441 nonnativeSelectorCache(expr, !0); 30442 } 30443 return 0 < Sizzle(expr, document, null, [ elem ]).length; 30444 }, Sizzle.contains = function(context, elem) { 30445 return (context.ownerDocument || context) != document && setDocument(context), contains(context, elem); 30446 }, Sizzle.attr = function(elem, name) { 30447 (elem.ownerDocument || elem) != document && setDocument(elem); 30448 var fn = Expr.attrHandle[name.toLowerCase()], val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : void 0; 30449 return void 0 !== val ? val : support.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null; 30450 }, Sizzle.escape = function(sel) { 30451 return (sel + "").replace(rcssescape, fcssescape); 30452 }, Sizzle.error = function(msg) { 30453 throw new Error("Syntax error, unrecognized expression: " + msg); 30454 }, Sizzle.uniqueSort = function(results) { 30455 var elem, duplicates = [], j = 0, i = 0;
vendor: 6,981 bytes, lines 30456-30547
30456 if (hasDuplicate = !support.detectDuplicates, sortInput = !support.sortStable && results.slice(0), 30457 results.sort(sortOrder), hasDuplicate) { 30458 for (;elem = results[i++]; ) elem === results[i] && (j = duplicates.push(i)); 30459 for (;j--; ) results.splice(duplicates[j], 1); 30460 } 30461 return sortInput = null, results; 30462 }, getText = Sizzle.getText = function(elem) { 30463 var node, ret = "", i = 0, nodeType = elem.nodeType; 30464 if (nodeType) { 30465 if (1 === nodeType || 9 === nodeType || 11 === nodeType) { 30466 if ("string" == typeof elem.textContent) return elem.textContent; 30467 for (elem = elem.firstChild; elem; elem = elem.nextSibling) ret += getText(elem); 30468 } else if (3 === nodeType || 4 === nodeType) return elem.nodeValue; 30469 } else for (;node = elem[i++]; ) ret += getText(node); 30470 return ret; 30471 }, (Expr = Sizzle.selectors = { 30472 cacheLength: 50, 30473 createPseudo: markFunction, 30474 match: matchExpr, 30475 attrHandle: {}, 30476 find: {}, 30477 relative: { 30478 ">": { 30479 dir: "parentNode", 30480 first: !0 30481 }, 30482 " ": { 30483 dir: "parentNode" 30484 }, 30485 "+": { 30486 dir: "previousSibling", 30487 first: !0 30488 }, 30489 "~": { 30490 dir: "previousSibling" 30491 } 30492 }, 30493 preFilter: { 30494 ATTR: function(match) { 30495 return match[1] = match[1].replace(runescape, funescape), match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape), 30496 "~=" === match[2] && (match[3] = " " + match[3] + " "), match.slice(0, 4); 30497 }, 30498 CHILD: function(match) { 30499 return match[1] = match[1].toLowerCase(), "nth" === match[1].slice(0, 3) ? (match[3] || Sizzle.error(match[0]), 30500 match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * ("even" === match[3] || "odd" === match[3])), 30501 match[5] = +(match[7] + match[8] || "odd" === match[3])) : match[3] && Sizzle.error(match[0]), 30502 match; 30503 }, 30504 PSEUDO: function(match) { 30505 var excess, unquoted = !match[6] && match[2]; 30506 return matchExpr.CHILD.test(match[0]) ? null : (match[3] ? match[2] = match[4] || match[5] || "" : unquoted && rpseudo.test(unquoted) && (excess = tokenize(unquoted, !0)) && (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length) && (match[0] = match[0].slice(0, excess), 30507 match[2] = unquoted.slice(0, excess)), match.slice(0, 3)); 30508 } 30509 }, 30510 filter: { 30511 TAG: function(nodeNameSelector) { 30512 var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase(); 30513 return "*" === nodeNameSelector ? function() { 30514 return !0; 30515 } : function(elem) { 30516 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 30517 }; 30518 }, 30519 CLASS: function(className) { 30520 var pattern = classCache[className + " "]; 30521 return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function(elem) { 30522 return pattern.test("string" == typeof elem.className && elem.className || void 0 !== elem.getAttribute && elem.getAttribute("class") || ""); 30523 }); 30524 }, 30525 ATTR: function(name, operator, check) { 30526 return function(elem) { 30527 var result = Sizzle.attr(elem, name); 30528 return null == result ? "!=" === operator : !operator || (result += "", "=" === operator ? result === check : "!=" === operator ? result !== check : "^=" === operator ? check && 0 === result.indexOf(check) : "*=" === operator ? check && -1 < result.indexOf(check) : "$=" === operator ? check && result.slice(-check.length) === check : "~=" === operator ? -1 < (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) : "|=" === operator && (result === check || result.slice(0, check.length + 1) === check + "-")); 30529 }; 30530 }, 30531 CHILD: function(type, what, _argument, first, last) { 30532 var simple = "nth" !== type.slice(0, 3), forward = "last" !== type.slice(-4), ofType = "of-type" === what; 30533 return 1 === first && 0 === last ? function(elem) { 30534 return !!elem.parentNode; 30535 } : function(elem, _context, xml) { 30536 var cache, uniqueCache, outerCache, node, nodeIndex, start, dir = simple != forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = !1; 30537 if (parent) { 30538 if (simple) { 30539 for (;dir; ) { 30540 for (node = elem; node = node[dir]; ) if (ofType ? node.nodeName.toLowerCase() === name : 1 === node.nodeType) return !1; 30541 start = dir = "only" === type && !start && "nextSibling"; 30542 } 30543 return !0; 30544 } 30545 if (start = [ forward ? parent.firstChild : parent.lastChild ], forward && useCache) { 30546 for (diff = (nodeIndex = (cache = (uniqueCache = (outerCache = (node = parent)[expando] || (node[expando] = {}))[node.uniqueID] || (outerCache[node.uniqueID] = {}))[type] || [])[0] === dirruns && cache[1]) && cache[2], 30547 node = nodeIndex && parent.childNodes[nodeIndex]; node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop();
30547 ) if (1 === node.nodeType && ++diff && node === elem) { 30548 uniqueCache[type] = [ dirruns, nodeIndex, diff ]; 30549 break; 30550 } 30551 } else if (useCache && (diff = nodeIndex = (cache = (uniqueCache = (outerCache = (node = elem)[expando] || (node[expando] = {}))[node.uniqueID] || (outerCache[node.uniqueID] = {}))[type] || [])[0] === dirruns && cache[1]), 30552 !1 === diff) for (;(node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) && ((ofType ? node.nodeName.toLowerCase() !== name : 1 !== node.nodeType) || !++diff || (useCache && ((uniqueCache = (outerCache = node[expando] || (node[expando] = {}))[node.uniqueID] || (outerCache[node.uniqueID] = {}))[type] = [ dirruns, diff ]), 30553 node !== elem)); ) ; 30554 return (diff -= last) === first || diff % first == 0 && 0 <= diff / first; 30555 } 30556 }; 30557 }, 30558 PSEUDO: function(pseudo, argument) { 30559 var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error("unsupported pseudo: " + pseudo); 30560 return fn[expando] ? fn(argument) : 1 < fn.length ? (args = [ pseudo, pseudo, "", argument ], 30561 Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(seed, matches) { 30562 for (var idx, matched = fn(seed, argument), i = matched.length; i--; ) seed[idx = indexOf(seed, matched[i])] = !(matches[idx] = matched[i]); 30563 }) : function(elem) { 30564 return fn(elem, 0, args); 30565 }) : fn; 30566 } 30567 }, 30568 pseudos: { 30569 not: markFunction(function(selector) { 30570 var input = [], results = [], matcher = compile(selector.replace(rtrim, "$1")); 30571 return matcher[expando] ? markFunction(function(seed, matches, _context, xml) { 30572 for (var elem, unmatched = matcher(seed, null, xml, []), i = seed.length; i--; ) (elem = unmatched[i]) && (seed[i] = !(matches[i] = elem)); 30573 }) : function(elem, _context, xml) { 30574 return input[0] = elem, matcher(input, null, xml, results), input[0] = null, !results.pop(); 30575 }; 30576 }), 30577 has: markFunction(function(selector) { 30578 return function(elem) { 30579 return 0 < Sizzle(selector, elem).length; 30580 }; 30581 }), 30582 contains: markFunction(function(text) { 30583 return text = text.replace(runescape, funescape), function(elem) { 30584 return -1 < (elem.textContent || getText(elem)).indexOf(text); 30585 }; 30586 }), 30587 lang: markFunction(function(lang) { 30588 return ridentifier.test(lang || "") || Sizzle.error("unsupported lang: " + lang), 30589 lang = lang.replace(runescape, funescape).toLowerCase(), function(elem) { 30590 var elemLang; 30591 do { 30592 if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) return (elemLang = elemLang.toLowerCase()) === lang || 0 === elemLang.indexOf(lang + "-"); 30593 } while ((elem = elem.parentNode) && 1 === elem.nodeType); 30594 return !1; 30595 }; 30596 }), 30597 target: function(elem) { 30598 var hash = window.location && window.location.hash; 30599 return hash && hash.slice(1) === elem.id; 30600 }, 30601 root: function(elem) { 30602 return elem === docElem; 30603 }, 30604 focus: function(elem) { 30605 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); 30606 }, 30607 enabled: createDisabledPseudo(!1), 30608 disabled: createDisabledPseudo(!0), 30609 checked: function(elem) { 30610 var nodeName = elem.nodeName.toLowerCase(); 30611 return "input" === nodeName && !!elem.checked || "option" === nodeName && !!elem.selected; 30612 }, 30613 selected: function(elem) { 30614 return elem.parentNode && elem.parentNode.selectedIndex, !0 === elem.selected; 30615 }, 30616 empty: function(elem) { 30617 for (elem = elem.firstChild; elem; elem = elem.nextSibling) if (elem.nodeType < 6) return !1; 30618 return !0; 30619 }, 30620 parent: function(elem) { 30621 return !Expr.pseudos.empty(elem); 30622 }, 30623 header: function(elem) { 30624 return rheader.test(elem.nodeName); 30625 }, 30626 input: function(elem) { 30627 return rinputs.test(elem.nodeName); 30628 }, 30629 button: function(elem) { 30630 var name = elem.nodeName.toLowerCase(); 30631 return "input" === name && "button" === elem.type || "button" === name; 30632 }, 30633 text: function(elem) { 30634 var attr; 30635 return "input" === elem.nodeName.toLowerCase() && "text" === elem.type && (null == (attr = elem.getAttribute("type")) || "text" === attr.toLowerCase()); 30636 }, 30637 first: createPositionalPseudo(function() { 30638 return [ 0 ]; 30639 }), 30640 last: createPositionalPseudo(function(_matchIndexes, length) { 30641 return [ length - 1 ]; 30642 }), 30643 eq: createPositionalPseudo(function(_matchIndexes, length, argument) { 30644 return [ argument < 0 ? argument + length : argument ]; 30645 }), 30646 even: createPositionalPseudo(function(matchIndexes, length) { 30647 for (var i = 0; i < length; i += 2) matchIndexes.push(i); 30648 return matchIndexes; 30649 }), 30650 odd: createPositionalPseudo(function(matchIndexes, length) { 30651 for (var i = 1; i < length; i += 2) matchIndexes.push(i); 30652 return matchIndexes; 30653 }), 30654 lt: createPositionalPseudo(function(matchIndexes, length, argument) { 30655 for (var i = argument < 0 ? argument + length : length < argument ? length : argument; 0 <= --i; ) matchIndexes.push(i); 30656 return matchIndexes; 30657 }), 30658 gt: createPositionalPseudo(function(matchIndexes, length, argument) { 30659 for (var i = argument < 0 ? argument + length : argument; ++i < length; ) matchIndexes.push(i); 30660 return matchIndexes; 30661 }) 30662 } 30663 }).pseudos.nth = Expr.pseudos.eq, { 30664 radio: !0, 30665 checkbox: !0, 30666 file: !0, 30667 password: !0, 30668 image: !0 30669 }) Expr.pseudos[i] = createInputPseudo(i); 30670 for (i in { 30671 submit: !0, 30672 reset: !0 30673 }) Expr.pseudos[i] = createButtonPseudo(i); 30674 function setFilters() {} 30675 function toSelector(tokens) { 30676 for (var i = 0, len = tokens.length, selector = ""; i < len; i++) selector += tokens[i].value; 30677 return selector; 30678 } 30679 function addCombinator(matcher, combinator, base) { 30680 var dir = combinator.dir, skip = combinator.next, key = skip || dir, checkNonElements = base && "parentNode" === key, doneName = done++; 30681 return combinator.first ? function(elem, context, xml) { 30682 for (;elem = elem[dir]; ) if (1 === elem.nodeType || checkNonElements) return matcher(elem, context, xml); 30683 return !1; 30684 } : function(elem, context, xml) { 30685 var oldCache, uniqueCache, outerCache, newCache = [ dirruns, doneName ]; 30686 if (xml) { 30687 for (;elem = elem[dir]; ) if ((1 === elem.nodeType || checkNonElements) && matcher(elem, context, xml)) return !0; 30688 } else for (;elem = elem[dir]; ) if (1 === elem.nodeType || checkNonElements) if (uniqueCache = (outerCache = elem[expando] || (elem[expando] = {}))[elem.uniqueID] || (outerCache[elem.uniqueID] = {}), 30689 skip && skip === elem.nodeName.toLowerCase()) elem = elem[dir] || elem; else { 30690 if ((oldCache = uniqueCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) return newCache[2] = oldCache[2]; 30691 if ((uniqueCache[key] = newCache)[2] = matcher(elem, context, xml)) return !0; 30692 } 30693 return !1; 30694 }; 30695 } 30696 function elementMatcher(matchers) { 30697 return 1 < matchers.length ? function(elem, context, xml) { 30698 for (var i = matchers.length; i--; ) if (!matchers[i](elem, context, xml)) return !1; 30699 return !0; 30700 } : matchers[0]; 30701 } 30702 function condense(unmatched, map, filter, context, xml) { 30703 for (var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = null != map; i < len; i++) (elem = unmatched[i]) && (filter && !filter(elem, context, xml) || (newUnmatched.push(elem), 30704 mapped && map.push(i))); 30705 return newUnmatched; 30706 } 30707 function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) { 30708 return postFilter && !postFilter[expando] && (postFilter = setMatcher(postFilter)), 30709 postFinder && !postFinder[expando] && (postFinder = setMatcher(postFinder, postSelector)), 30710 markFunction(function(seed, results, context, xml) { 30711 var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, elems = seed || function(selector, contexts, results) { 30712 for (var i = 0, len = contexts.length; i < len; i++) Sizzle(selector, contexts[i], results); 30713 return results; 30714 }(selector || "*", context.nodeType ? [ context ] : context, []), matcherIn = !preFilter || !seed && selector ? elems : condense(elems, preMap, preFilter, context, xml), matcherOut = matcher ? postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results : matcherIn; 30715 if (matcher && matcher(matcherIn, matcherOut, context, xml), postFilter) for (temp = condense(matcherOut, postMap), 30716 postFilter(temp, [], context, xml), i = temp.length; i--; ) (elem = temp[i]) && (matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem)); 30717 if (seed) { 30718 if (postFinder || preFilter) { 30719 if (postFinder) { 30720 for (temp = [], i = matcherOut.length; i--; ) (elem = matcherOut[i]) && temp.push(matcherIn[i] = elem); 30721 postFinder(null, matcherOut = [], temp, xml); 30722 } 30723 for (i = matcherOut.length; i--; ) (elem = matcherOut[i]) && -1 < (temp = postFinder ? indexOf(seed, elem) : preMap[i]) && (seed[temp] = !(results[temp] = elem)); 30724 } 30725 } else matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut), 30726 postFinder ? postFinder(null, results, matcherOut, xml) : push.apply(results, matcherOut); 30727 }); 30728 } 30729 function matcherFromTokens(tokens) { 30730 for (var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, matchContext = addCombinator(function(elem) { 30731 return elem === checkContext; 30732 }, implicitRelative, !0), matchAnyContext = addCombinator(function(elem) { 30733 return -1 < indexOf(checkContext, elem); 30734 }, implicitRelative, !0), matchers = [ function(elem, context, xml) { 30735 var ret = !leadingRelative && (xml || context !== outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml)); 30736 return checkContext = null, ret; 30737 } ]; i < len; i++) if (matcher = Expr.relative[tokens[i].type]) matchers = [ addCombinator(elementMatcher(matchers), matcher) ]; else { 30738 if ((matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches))[expando]) { 30739 for (j = ++i; j < len && !Expr.relative[tokens[j].type]; j++) ; 30740 return setMatcher(1 < i && elementMatcher(matchers), 1 < i && toSelector(tokens.slice(0, i - 1).concat({ 30741 value: " " === tokens[i - 2].type ? "*" : "" 30742 })).replace(rtrim, "$1"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens(tokens = tokens.slice(j)), j < len && toSelector(tokens)); 30743 } 30744 matchers.push(matcher); 30745 } 30746 return elementMatcher(matchers); 30747 } 30748 return setFilters.prototype = Expr.filters = Expr.pseudos, Expr.setFilters = new setFilters(), 30749 tokenize = Sizzle.tokenize = function(selector, parseOnly) { 30750 var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[
30750selector + " "]; 30751 if (cached) return parseOnly ? 0 : cached.slice(0); 30752 for (soFar = selector, groups = [], preFilters = Expr.preFilter; soFar; ) { 30753 for (type in matched && !(match = rcomma.exec(soFar)) || (match && (soFar = soFar.slice(match[0].length) || soFar), 30754 groups.push(tokens = [])), matched = !1, (match = rcombinators.exec(soFar)) && (matched = match.shift(), 30755 tokens.push({ 30756 value: matched, 30757 type: match[0].replace(rtrim, " ") 30758 }), soFar = soFar.slice(matched.length)), Expr.filter) !(match = matchExpr[type].exec(soFar)) || preFilters[type] && !(match = preFilters[type](match)) || (matched = match.shift(), 30759 tokens.push({ 30760 value: matched, 30761 type: type, 30762 matches: match 30763 }), soFar = soFar.slice(matched.length)); 30764 if (!matched) break; 30765 } 30766 return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : tokenCache(selector, groups).slice(0); 30767 }, compile = Sizzle.compile = function(selector, match) { 30768 var i, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + " "]; 30769 if (!cached) { 30770 for (i = (match = match || tokenize(selector)).length; i--; ) (cached = matcherFromTokens(match[i]))[expando] ? setMatchers.push(cached) : elementMatchers.push(cached); 30771 (cached = compilerCache(selector, function(elementMatchers, setMatchers) { 30772 function superMatcher(seed, context, xml, results, outermost) { 30773 var elem, j, matcher, matchedCount = 0, i = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && Expr.find.TAG("*", outermost), dirrunsUnique = dirruns += null == contextBackup ? 1 : Math.random() || .1, len = elems.length; 30774 for (outermost && (outermostContext = context == document || context || outermost); i !== len && null != (elem = elems[i]); i++) { 30775 if (byElement && elem) { 30776 for (j = 0, context || elem.ownerDocument == document || (setDocument(elem), xml = !documentIsHTML); matcher = elementMatchers[j++]; ) if (matcher(elem, context || document, xml)) { 30777 results.push(elem); 30778 break; 30779 } 30780 outermost && (dirruns = dirrunsUnique); 30781 } 30782 bySet && ((elem = !matcher && elem) && matchedCount--, seed && unmatched.push(elem)); 30783 } 30784 if (matchedCount += i, bySet && i !== matchedCount) { 30785 for (j = 0; matcher = setMatchers[j++]; ) matcher(unmatched, setMatched, context, xml); 30786 if (seed) { 30787 if (0 < matchedCount) for (;i--; ) unmatched[i] || setMatched[i] || (setMatched[i] = pop.call(results)); 30788 setMatched = condense(setMatched); 30789 } 30790 push.apply(results, setMatched), outermost && !seed && 0 < setMatched.length && 1 < matchedCount + setMatchers.length && Sizzle.uniqueSort(results); 30791 } 30792 return outermost && (dirruns = dirrunsUnique, outermostContext = contextBackup), 30793 unmatched; 30794 } 30795 var bySet = 0 < setMatchers.length, byElement = 0 < elementMatchers.length; 30796 return bySet ? markFunction(superMatcher) : superMatcher; 30797 }(elementMatchers, setMatchers))).selector = selector; 30798 } 30799 return cached; 30800 }, select = Sizzle.select = function(selector, context, results, seed) { 30801 var i, tokens, token, type, find, compiled = "function" == typeof selector && selector, match = !seed && tokenize(selector = compiled.selector || selector); 30802 if (results = results || [], 1 === match.length) { 30803 if (2 < (tokens = match[0] = match[0].slice(0)).length && "ID" === (token = tokens[0]).type && 9 === context.nodeType && documentIsHTML && Expr.relative[tokens[1].type]) { 30804 if (!(context = (Expr.find.ID(token.matches[0].replace(runescape, funescape), context) || [])[0])) return results; 30805 compiled && (context = context.parentNode), selector = selector.slice(tokens.shift().value.length); 30806 } 30807 for (i = matchExpr.needsContext.test(selector) ? 0 : tokens.length; i-- && (token = tokens[i], 30808 !Expr.relative[type = token.type]); ) if ((find = Expr.find[type]) && (seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testC
30808ontext(context.parentNode) || context))) { 30809 if (tokens.splice(i, 1), !(selector = seed.length && toSelector(tokens))) return push.apply(results, seed), 30810 results; 30811 break; 30812 } 30813 } 30814 return (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, !context || rsibling.test(selector) && testContext(context.parentNode) || context), 30815 results; 30816 }, support.sortStable = expando.split("").sort(sortOrder).join("") === expando, 30817 support.detectDuplicates = !!hasDuplicate, setDocument(), support.sortDetached = assert(function(el) { 30818 return 1 & el.compareDocumentPosition(document.createElement("fieldset")); 30819 }), assert(function(el) { 30820 return el.innerHTML = "<a href='#'></a>", "#" === el.firstChild.getAttribute("href"); 30821 }) || addHandle("type|href|height|width", function(elem, name, isXML) { 30822 if (!isXML) return elem.getAttribute(name, "type" === name.toLowerCase() ? 1 : 2); 30823 }), support.attributes && assert(function(el) { 30824 return el.innerHTML = "<input/>", el.firstChild.setAttribute("value", ""), "" === el.firstChild.getAttribute("value"); 30825 }) || addHandle("value", function(elem, _name, isXML) { 30826 if (!isXML && "input" === elem.nodeName.toLowerCase()) return elem.defaultValue; 30827 }), assert(function(el) { 30828 return null == el.getAttribute("disabled"); 30829 }) || addHandle(booleans, function(elem, name, isXML) { 30830 var val; 30831 if (!isXML) return !0 === elem[name] ? name.toLowerCase() : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null; 30832 }), Sizzle; 30833 }(window); 30834 jQuery.find = Sizzle, jQuery.expr = Sizzle.selectors, jQuery.expr[":"] = jQuery.expr.pseudos, 30835 jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort, jQuery.text = Sizzle.getText, 30836 jQuery.isXMLDoc = Sizzle.isXML, jQuery.contains = Sizzle.contains, jQuery.escapeSelector = Sizzle.escape; 30837 function siblings(n, elem) { 30838 for (var matched = []; n; n = n.nextSibling) 1 === n.nodeType && n !== elem && matched.push(n); 30839 return matched; 30840 } 30841 var dir = function(elem, dir, until) { 30842 for (var matched = [], truncate = void 0 !== until; (elem = elem[dir]) && 9 !== elem.nodeType; ) if (1 === elem.nodeType) { 30843 if (truncate && jQuery(elem).is(until)) break; 30844 matched.push(elem); 30845 } 30846 return matched; 30847 }, rneedsContext = jQuery.expr.match.needsContext; 30848 function nodeName(elem, name) { 30849 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 30850 } 30851 var rsingleTag = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i; 30852 function winnow(elements, qualifier, not) { 30853 return isFunction(qualifier) ? jQuery.grep(elements, function(elem, i) { 30854 return !!qualifier.call(elem, i, elem) !== not; 30855 }) : qualifier.nodeType ? jQuery.grep(elements, function(elem) { 30856 return elem === qualifier !== not; 30857 }) : "string" != typeof qualifier ? jQuery.grep(elements, function(elem) { 30858 return -1 < indexOf.call(qualifier, elem) !== not; 30859 }) : jQuery.filter(qualifier, elements, not); 30860 } 30861 jQuery.filter = function(expr, elems, not) { 30862 var elem = elems[0]; 30863 return not && (expr = ":not(" + expr + ")"), 1 === elems.length && 1 === elem.nodeType ? jQuery.find.matchesSelector(elem, expr) ? [ elem ] : [] : jQuery.find.matches(expr, jQuery.grep(elems, function(elem) { 30864 return 1 === elem.nodeType; 30865 })); 30866 }, jQuery.fn.extend({ 30867 find: function(selector) { 30868 var i, ret, len = this.length, self = this; 30869 if ("string" != typeof selector) return this.pushStack(jQuery(selector).filter(function() { 30870 for (i = 0; i < len;
30870 i++) if (jQuery.contains(self[i], this)) return !0; 30871 })); 30872 for (ret = this.pushStack([]), i = 0; i < len; i++) jQuery.find(selector, self[i], ret); 30873 return 1 < len ? jQuery.uniqueSort(ret) : ret; 30874 }, 30875 filter: function(selector) { 30876 return this.pushStack(winnow(this, selector || [], !1)); 30877 }, 30878 not: function(selector) { 30879 return this.pushStack(winnow(this, selector || [], !0)); 30880 }, 30881 is: function(selector) { 30882 return !!winnow(this, "string" == typeof selector && rneedsContext.test(selector) ? jQuery(selector) : selector || [], !1).length; 30883 } 30884 }); 30885 var rootjQuery, rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/; 30886 (jQuery.fn.init = function(selector, context, root) { 30887 var match, elem; 30888 if (!selector) return this; 30889 if (root = root || rootjQuery, "string" != typeof selector) return selector.nodeType ? (this[0] = selector, 30890 this.length = 1, this) : isFunction(selector) ? void 0 !== root.ready ? root.ready(selector) : selector(jQuery) : jQuery.makeArray(selector, this); 30891 if (!(match = "<" === selector[0] && ">" === selector[selector.length - 1] && 3 <= selector.length ? [ null, selector, null ] : rquickExpr.exec(selector)) || !match[1] && context) return !context || context.jquery ? (context || root).find(selector) : this.constructor(context).find(selector); 30892 if (match[1]) { 30893 if (context = context instanceof jQuery ? context[0] : context, jQuery.merge(this, jQuery.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : document, !0)), 30894 rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) for (match in context) isFunction(this[match]) ? this[match](context[match]) : this.attr(match, context[match]); 30895 return this; 30896 } 30897 return (elem = document.getElementById(match[2])) && (this[0] = elem, this.length = 1), 30898 this; 30899 }).prototype = jQuery.fn, rootjQuery = jQuery(document); 30900 var rparentsprev = /^(?:parents|prev(?:Until|All))/, guaranteedUnique = { 30901 children: !0, 30902 contents: !0, 30903 next: !0, 30904 prev: !0 30905 }; 30906 function sibling(cur, dir) { 30907 for (;(cur = cur[dir]) && 1 !== cur.nodeType; ) ; 30908 return cur; 30909 } 30910 jQuery.fn.extend({ 30911 has: function(target) { 30912 var targets = jQuery(target, this), l = targets.length; 30913 return this.filter(function() { 30914 for (var i = 0; i < l; i++) if (jQuery.contains(this, targets[i])) return !0; 30915 }); 30916 }, 30917 closest: function(selectors, context) { 30918 var cur, i = 0, l = this.length, matched = [], targets = "string" != typeof selectors && jQuery(selectors); 30919 if (!rneedsContext.test(selectors)) for (;i < l; i++) for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) if (cur.nodeType < 11 && (targets ? -1 < targets.index(cur) : 1 === cur.nodeType && jQuery.find.matchesSelector(cur, selectors))) { 30920 matched.push(cur); 30921 break; 30922 } 30923 return this.pushStack(1 < matched.length ? jQuery.uniqueSort(matched) : matched); 30924 }, 30925 index: function(elem) { 30926 return elem ? "string" == typeof elem ? indexOf.call(jQuery(elem), this[0]) : indexOf.call(this, elem.jquery ? elem[0] : elem) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1; 30927 }, 30928 add: function(selector, context) { 30929 return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(), jQuery(selector, context)))); 30930 }, 30931 addBack: function(selector) { 30932 return this.add(null == selector ? this.prevObject : this.prevObject.filter(selector)); 30933 } 30934 }), jQuery.each({ 30935 parent: function(elem) { 30936 var parent = elem.parentNode; 30937 return parent && 11 !== parent.nodeType ? parent : null; 30938 }, 30939 parents: function(elem) { 30940 return dir(elem, "parentNode"); 30941 }, 30942 parentsUntil: function(elem, _i, until) { 30943 return dir(elem, "parentNode", until); 30944 }, 30945 next: function(elem) { 30946 return sibling(elem, "nextSibling"); 30947 }, 30948 prev: function(elem) { 30949 return sibling(elem, "previousSibling"); 30950 }, 30951 nextAll: function(elem) { 30952 return dir(elem, "nextSibling"); 30953 }, 30954 prevAll: function(elem) { 30955 return dir(elem, "previousSibling"); 30956 }, 30957 nextUntil: function(elem, _i, until) { 30958 return dir(elem, "nextSibling", until); 30959 }, 30960 prevUntil: function(elem, _i, until) { 30961 return dir(elem, "previousSibling", until); 30962 }, 30963 siblings: function(elem) { 30964 return siblings((elem.parentNode || {}).firstChild, elem); 30965 }, 30966 children: function(elem) { 30967 return siblings(elem.firstChild); 30968 }, 30969 contents: function(elem) { 30970 return null != elem.contentDocument && getProto(elem.contentDocument) ? elem.contentDocument : (nodeName(elem, "template") && (elem = elem.content || elem), 30971 jQuery.merge([], elem.childNodes)); 30972 } 30973 }, function(name, fn) { 30974 jQuery.fn[name] = function(until, selector) { 30975 var matched = jQuery.map(this, fn, until); 30976 return "Until" !== name.slice(-5) && (selector = until), selector && "string" == typeof selector && (matched = jQuery.filter(selector, matched)), 30977 1 < this.length && (guaranteedUnique[name] || jQuery.uniqueSort(matched), rparentsprev.test(name) && matched.reverse()), 30978 this.pushStack(matched); 30979 }; 30980 }); 30981 var rnothtmlwhite = /[^\x20\t\r\n\f]+/g; 30982 function Identity(v) { 30983 return v; 30984 } 30985 function Thrower(ex) { 30986 throw ex; 30987 } 30988 function adoptValue(value, resolve, reject, noValue) { 30989 var method; 30990 try { 30991 value && isFunction(method = value.promise) ? method.call(value).done(resolve).fail(reject) : value && isFunction(method = value.then) ? method.call(value, resolve, reject) : resolve.apply(void 0, [ value ].slice(noValue)); 30992 } catch (value) { 30993 reject.apply(void 0, [ value ]); 30994 } 30995 } 30996 jQuery.Callbacks = function(options) { 30997 options = "string" == typeof options ? function(options) { 30998 var object = {}; 30999 return jQuery.each(options.match(rnothtmlwhite) || [], function(_, flag) { 31000 object[flag] = !0; 31001 }), object; 31002 }(options) : jQuery.extend({}, options); 31003 function fire() { 31004 for (locked = locked || options.once, fired = firing = !0; queue.length; firingIndex = -1) for (memory = queue.shift(); ++firingIndex < list.length; ) !1 === list[firingIndex].apply(memory[0], memory[1]) && options.stopOnFalse && (firingIndex = list.length, 31005 memory = !1); 31006 options.memory || (memory = !1), firing = !1, locked && (list = memory ? [] : ""); 31007 } 31008 var firing, memory, fired, locked, list = [], queue = [], firingIndex = -1, self = { 31009 add: function() { 31010 return list && (memory && !firing && (firingIndex = list.length - 1, queue.push(memory)), 31011 function add(args) { 31012 jQuery.each(args, function(_, arg) { 31013 isFunction(arg) ? options.unique && self.has(arg) || list.push(arg) : arg && arg.length && "string" !== toType(arg) && add(arg); 31014 }); 31015 }(arguments), memory && !firing && fire()), this; 31016 }, 31017 remove: function() { 31018 return jQuery.each(arguments, function(_, arg) { 31019 for (var index; -1 < (index = jQuery.inArray(arg, list, index)); ) list.splice(index, 1), 31020 index <= firingIndex && firingIndex--; 31021 }), this; 31022 }, 31023 has: function(fn) { 31024 return fn ? -1 < jQuery.inArray(fn, list) : 0 < list.length; 31025 }, 31026 empty: function() { 31027 return list = list && [], this; 31028 }, 31029 disable: function() { 31030 return locked = queue = [], list = memory = "", this; 31031 }, 31032 disabled: function() { 31033 return !list; 31034 }, 31035 lock: function() { 31036 return locked = queue = [], memory || firing || (list = memory = ""), this; 31037 }, 31038 locked: function() { 31039 return !!locked; 31040 },
31041 fireWith: function(context, args) { 31042 return locked || (args = [ context, (args = args || []).slice ? args.slice() : args ], 31043 queue.push(args), firing || fire()), this; 31044 }, 31045 fire: function() { 31046 return self.fireWith(this, arguments), this; 31047 }, 31048 fired: function() { 31049 return !!fired; 31050 } 31051 }; 31052 return self; 31053 }, jQuery.extend({ 31054 Deferred: function(func) { 31055 var tuples = [ [ "notify", "progress", jQuery.Callbacks("memory"), jQuery.Callbacks("memory"), 2 ], [ "resolve", "done", jQuery.Callbacks("once memory"), jQuery.Callbacks("once memory"), 0, "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), jQuery.Callbacks("once memory"), 1, "rejected" ] ], state = "pending", promise = { 31056 state: function() { 31057 return state; 31058 }, 31059 always: function() { 31060 return deferred.done(arguments).fail(arguments), this; 31061 }, 31062 catch: function(fn) { 31063 return promise.then(null, fn); 31064 }, 31065 pipe: function() { 31066 var fns = arguments; 31067 return jQuery.Deferred(function(newDefer) { 31068 jQuery.each(tuples, function(_i, tuple) { 31069 var fn = isFunction(fns[tuple[4]]) && fns[tuple[4]]; 31070 deferred[tuple[1]](function() { 31071 var returned = fn && fn.apply(this, arguments); 31072 returned && isFunction(returned.promise) ? returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject) : newDefer[tuple[0] + "With"](this, fn ? [ returned ] : arguments); 31073 }); 31074 }), fns = null; 31075 }).promise(); 31076 }, 31077 then: function(onFulfilled, onRejected, onProgress) { 31078 var maxDepth = 0; 31079 function resolve(depth, deferred, handler, special) { 31080 return function() { 31081 function mightThrow() { 31082 var returned, then; 31083 if (!(depth < maxDepth)) { 31084 if ((returned = handler.apply(that, args)) === deferred.promise()) throw new TypeError("Thenable self-resolution"); 31085 then = returned && ("object" == typeof returned || "function" == typeof returned) && returned.then, 31086 isFunction(then) ? special ? then.call(returned, resolve(maxDepth, deferred, Identity, special), resolve(maxDepth, deferred, Thrower, special)) : (maxDepth++, 31087 then.call(returned, resolve(maxDepth, deferred, Identity, special), resolve(maxDepth, deferred, Thrower, special), resolve(maxDepth, deferred, Identity, deferred.notifyWith))) : (handler !== Identity && (that = void 0, 31088 args = [ returned ]), (special || deferred.resolveWith)(that, args)); 31089 } 31090 } 31091 var that = this, args = arguments, process = special ? mightThrow : function() { 31092 try { 31093 mightThrow(); 31094 } catch (e) { 31095 jQuery.Deferred.exceptionHook && jQuery.Deferred.exceptionHook(e, process.stackTrace), 31096 maxDepth <= depth + 1 && (handler !== Thrower && (that = void 0, args = [ e ]), 31097 deferred.rejectWith(that, args)); 31098 } 31099 }; 31100 depth ? process() : (jQuery.Deferred.getStackHook && (process.stackTrace = jQuery.Deferred.getStackHook()), 31101 window.setTimeout(process)); 31102 }; 31103 } 31104 return jQuery.Deferred(function(newDefer) { 31105 tuples[0][3].add(resolve(0, newDefer, isFunction(onProgress) ? onProgress : Identity, newDefer.notifyWith)), 31106 tuples[1][3].add(resolve(0, newDefer, isFunction(onFulfilled) ? onFulfilled : Identity)), 31107 tuples[2][3].add(resolve(0, newDefer, isFunction(onRejected) ? onRejected : Thrower)); 31108 }).promise(); 31109 }, 31110 promise: function(obj) { 31111 return null != obj ? jQuery.extend(obj, promise) : promise; 31112 } 31113 }, deferred = {}; 31114 return jQuery.each(tuples, function(i, tuple) { 31115 var list = tuple[2], stateString = tuple[5]; 31116 promise[tuple[1]] = list.add, stateString && list.add(function() { 31117 state = stateString; 31118 }, tuples[3 - i][2].disable, tuples[3 - i][3].disable, tuples[0][2].lock, tuples[0][3].lock), 31119 list.add(tuple[3].fire), deferred[tuple[0]] = function() { 31120 return deferred[tuple[0] + "With"](this === deferred ? void 0 : this, arguments), 31121 this; 31122 }, deferred[tuple[0] + "With"] = list.fireWith; 31123 }), promise.promise(deferred), func && func.call(deferred, deferred), deferred; 31124 }, 31125 when: function(singleValue) { 31126 function updateFunc(i) { 31127 return function(value) { 31128 resolveContexts[i] = this, resolveValues[i] = 1 < arguments.length ? slice.call(arguments) : value, 31129 --remaining || primary.resolveWith(resolveContexts, resolveValues); 31130 }; 31131 } 31132 var remaining = arguments.length, i = remaining, resolveContexts = Array(i), resolveValues = slice.call(arguments), primary = jQuery.Deferred(); 31133 if (remaining <= 1 && (adoptValue(singleValue, primary.done(updateFunc(i)).resolve, primary.reject, !remaining), 31134 "pending" === primary.state() || isFunction(resolveValues[i] && resolveValues[i].then))) return primary.then(); 31135 for (;i--; ) adoptValue(resolveValues[i], updateFunc(i), primary.reject); 31136 return primary.promise(); 31137 } 31138 }); 31139 var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 31140 jQuery.Deferred.exceptionHook = function(error, stack) { 31141 window.console && window.console.warn && error && rerrorNames.test(error.name) && window.console.warn("jQuery.Deferred exception: " + error.message, error.stack, stack); 31142 }, jQuery.readyException = function(error) { 31143 window.setTimeout(function() { 31144 throw error; 31145 }); 31146 }; 31147 var readyList = jQuery.Deferred(); 31148 function completed() { 31149 document.removeEventListener("DOMContentLoaded", completed), window.removeEventListener("load", completed), 31150 jQuery.ready(); 31151 } 31152 jQuery.fn.ready = function(fn) { 31153 return readyList.then(fn).catch(function(error) { 31154 jQuery.readyException(error); 31155 }), this; 31156 }, jQuery.extend({ 31157 isReady: !1, 31158 readyWait: 1, 31159 ready: function(wait) { 31160 (!0 === wait ? --jQuery.readyWait : jQuery.isReady) || (jQuery.isReady = !0) !== wait && 0 < --jQuery.readyWait || readyList.resolveWith(document, [ jQuery ]); 31161 } 31162 }), jQuery.ready.then = readyList.then, "complete" === document.readyState || "loading" !== document.readyState && !document.documentElement.doScroll ? window.setTimeout(jQuery.ready) : (document.addEventListener("DOMContentLoaded", completed), 31163 window.addEventListener("load", completed)); 31164 var access = function(elems, fn, key, value, chainable, emptyGet, raw) { 31165 var i = 0, len = elems.length, bulk = null == key; 31166 if ("object" === toType(key)) for (i in chainable = !0, key) access(elems, fn, i, key[i], !0, emptyGet, raw);
31166 else if (void 0 !== value && (chainable = !0, 31167 isFunction(value) || (raw = !0), bulk && (fn = raw ? (fn.call(elems, value), null) : (bulk = fn, 31168 function(elem, _key, value) { 31169 return bulk.call(jQuery(elem), value); 31170 })), fn)) for (;i < len; i++) fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key))); 31171 return chainable ? elems : bulk ? fn.call(elems) : len ? fn(elems[0], key) : emptyGet; 31172 }, rmsPrefix = /^-ms-/, rdashAlpha = /-([a-z])/g; 31173 function fcamelCase(_all, letter) { 31174 return letter.toUpperCase(); 31175 } 31176 function camelCase(string) { 31177 return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase); 31178 } 31179 function acceptData(owner) { 31180 return 1 === owner.nodeType || 9 === owner.nodeType || !+owner.nodeType; 31181 } 31182 function Data() { 31183 this.expando = jQuery.expando + Data.uid++; 31184 } 31185 Data.uid = 1, Data.prototype = { 31186 cache: function(owner) { 31187 var value = owner[this.expando]; 31188 return value || (value = {}, acceptData(owner) && (owner.nodeType ? owner[this.expando] = value : Object.defineProperty(owner, this.expando, { 31189 value: value, 31190 configurable: !0 31191 }))), value; 31192 }, 31193 set: function(owner, data, value) { 31194 var prop, cache = this.cache(owner); 31195 if ("string" == typeof data) cache[camelCase(data)] = value; else for (prop in data) cache[camelCase(prop)] = data[prop]; 31196 return cache; 31197 }, 31198 get: function(owner, key) { 31199 return void 0 === key ? this.cache(owner) : owner[this.expando] && owner[this.expando][camelCase(key)]; 31200 }, 31201 access: function(owner, key, value) { 31202 return void 0 === key || key && "string" == typeof key && void 0 === value ? this.get(owner, key) : (this.set(owner, key, value), 31203 void 0 !== value ? value : key); 31204 }, 31205 remove: function(owner, key) { 31206 var i, cache = owner[this.expando]; 31207 if (void 0 !== cache) { 31208 if (void 0 !== key) { 31209 i = (key = Array.isArray(key) ? key.map(camelCase) : (key = camelCase(key)) in cache ? [ key ] : key.match(rnothtmlwhite) || []).length; 31210 for (;i--; ) delete cache[key[i]]; 31211 } 31212 void 0 !== key && !jQuery.isEmptyObject(cache) || (owner.nodeType ? owner[this.expando] = void 0 : delete owner[this.expando]); 31213 } 31214 }, 31215 hasData: function(owner) { 31216 var cache = owner[this.expando]; 31217 return void 0 !== cache && !jQuery.isEmptyObject(cache); 31218 } 31219 }; 31220 var dataPriv = new Data(), dataUser = new Data(), rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /[A-Z]/g; 31221 function dataAttr(elem, key, data) { 31222 var name; 31223 if (void 0 === data && 1 === elem.nodeType) if (name = "data-" + key.replace(rmultiDash, "-$&").toLowerCase(), 31224 "string" == typeof (data = elem.getAttribute(name))) { 31225 try { 31226 data = function(data) { 31227 return "true" === data || "false" !== data && ("null" === data ? null : data === +data + "" ? +data : rbrace.test(data) ? JSON.parse(data) : data); 31228 }(data); 31229 } catch (e) {} 31230 dataUser.set(elem, key, data); 31231 } else data = void 0; 31232 return data; 31233 } 31234 jQuery.extend({ 31235 hasData: function(elem) { 31236 return dataUser.hasData(elem) || dataPriv.hasData(elem); 31237 }, 31238 data: function(elem, name, data) { 31239 return dataUser.access(elem, name, data); 31240 }, 31241 removeData: function(elem, name) { 31242 dataUser.remove(elem, name); 31243 }, 31244 _data: function(elem, name, data) { 31245 return dataPriv.access(elem, name, data); 31246 }, 31247 _removeData: function(elem, name) { 31248 dataPriv.remove(elem, name); 31249 } 31250 }), jQuery.fn.extend({ 31251 data: function(key, value) { 31252 var i, name, data, elem = this[0], attrs = elem && elem.attributes; 31253 if (void 0 !== key) return "object" == typeof key ? this.each(function() { 31254 dataUser.set(this, key); 31255 }) : access(this, function(value) { 31256 var data; 31257 if (elem && void 0 === value) return void 0 !== (data = dataUser.get(elem, key)) ? data : void 0 !== (data = dataAttr(elem, key)) ? data : void 0; 31258 this.each(function() { 31259 dataUser.set(this, key, value); 31260 }); 31261 }, null, value, 1 < arguments.length, null, !0); 31262 if (this.length && (data = dataUser.get(elem), 1 === elem.nodeType && !dataPriv.get(elem, "hasDataAttrs"))) { 31263 for (i = attrs.length; i--; ) attrs[i] && 0 === (name = attrs[i].name).indexOf("data-") && (name = camelCase(name.slice(5)), 31264 dataAttr(elem, name, data[name])); 31265 dataPriv.set(elem, "hasDataAttrs", !0); 31266 } 31267 return data; 31268 }, 31269 removeData: function(key) { 31270 return this.each(function() { 31271 dataUser.remove(this, key); 31272 }); 31273 } 31274 }), jQuery.extend({ 31275 queue: function(elem, type, data) { 31276 var queue; 31277 if (elem) return type = (type || "fx") + "queue", queue = dataPriv.get(elem, type), 31278 data && (!queue || Array.isArray(data) ? queue = dataPriv.access(elem, type, jQuery.makeArray(data)) : queue.push(data)), 31279 queue || []; 31280 }, 31281 dequeue: function(elem, type) { 31282 type = type || "fx"; 31283 var queue = jQuery.queue(elem, type), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks(elem, type); 31284 "inprogress" === fn && (fn = queue.shift(), startLength--), fn && ("fx" === type && queue.unshift("inprogress"), 31285 delete hooks.stop, fn.call(elem, function() { 31286 jQuery.dequeue(elem, type); 31287 }, hooks)), !startLength && hooks && hooks.empty.fire(); 31288 }, 31289 _queueHooks: function(elem, type) { 31290 var key = type + "queueHooks"; 31291 return dataPriv.get(elem, key) || dataPriv.access(elem, key, { 31292 empty: jQuery.Callbacks("once memory").add(function() {
31293 dataPriv.remove(elem, [ type + "queue", key ]); 31294 }) 31295 }); 31296 } 31297 }), jQuery.fn.extend({ 31298 queue: function(type, data) { 31299 var setter = 2; 31300 return "string" != typeof type && (data = type, type = "fx", setter--), arguments.length < setter ? jQuery.queue(this[0], type) : void 0 === data ? this : this.each(function() { 31301 var queue = jQuery.queue(this, type, data); 31302 jQuery._queueHooks(this, type), "fx" === type && "inprogress" !== queue[0] && jQuery.dequeue(this, type); 31303 }); 31304 }, 31305 dequeue: function(type) { 31306 return this.each(function() { 31307 jQuery.dequeue(this, type); 31308 }); 31309 }, 31310 clearQueue: function(type) { 31311 return this.queue(type || "fx", []); 31312 }, 31313 promise: function(type, obj) { 31314 function resolve() { 31315 --count || defer.resolveWith(elements, [ elements ]); 31316 } 31317 var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length; 31318 for ("string" != typeof type && (obj = type, type = void 0), type = type || "fx"; i--; ) (tmp = dataPriv.get(elements[i], type + "queueHooks")) && tmp.empty && (count++, 31319 tmp.empty.add(resolve)); 31320 return resolve(), defer.promise(obj); 31321 } 31322 }); 31323 var pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, rcssNum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i"), cssExpand = [ "Top", "Right", "Bottom", "Left" ], documentElement = document.documentElement, isAttached = function(elem) { 31324 return jQuery.contains(elem.ownerDocument, elem); 31325 }, composed = { 31326 composed: !0 31327 }; 31328 documentElement.getRootNode && (isAttached = function(elem) { 31329 return jQuery.contains(elem.ownerDocument, elem) || elem.getRootNode(composed) === elem.ownerDocument; 31330 }); 31331 var isHiddenWithinTree = function(elem, el) { 31332 return "none" === (elem = el || elem).style.display || "" === elem.style.display && isAttached(elem) && "none" === jQuery.css(elem, "display"); 31333 }; 31334 function adjustCSS(elem, prop, valueParts, tween) { 31335 var adjusted, scale, maxIterations = 20, currentValue = tween ? function() { 31336 return tween.cur(); 31337 } : function() { 31338 return jQuery.css(elem, prop, ""); 31339 }, initial = currentValue(), unit = valueParts && valueParts[3] || (jQuery.cssNumber[prop] ? "" : "px"), initialInUnit = elem.nodeType && (jQuery.cssNumber[prop] || "px" !== unit && +initial) && rcssNum.exec(jQuery.css(elem, prop)); 31340 if (initialInUnit && initialInUnit[3] !== unit) { 31341 for (initial /= 2, unit = unit || initialInUnit[3], initialInUnit = +initial || 1; maxIterations--; ) jQuery.style(elem, prop, initialInUnit + unit), 31342 (1 - scale) * (1 - (scale = currentValue() / initial || .5)) <= 0 && (maxIterations = 0), 31343 initialInUnit /= scale; 31344 initialInUnit *= 2, jQuery.style(elem, prop, initialInUnit + unit), valueParts = valueParts || []; 31345 } 31346 return valueParts && (initialInUnit = +initialInUnit || +initial || 0, adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2], 31347 tween && (tween.unit = unit, tween.start = initialInUnit, tween.end = adjusted)), 31348 adjusted; 31349 } 31350 var defaultDisplayMap = {}; 31351 function getDefaultDisplay(elem) { 31352 var temp, doc = elem.ownerDocument, nodeName = elem.nodeName, display = defaultDisplayMap[nodeName]; 31353 return display || (temp = doc.body.appendChild(doc.createElement(nodeName)), display = jQuery.css(temp, "display"),
vendor: 8,044 bytes, lines 31354-31463
31354 temp.parentNode.removeChild(temp), "none" === display && (display = "block"), defaultDisplayMap[nodeName] = display); 31355 } 31356 function showHide(elements, show) { 31357 for (var display, elem, values = [], index = 0, length = elements.length; index < length; index++) (elem = elements[index]).style && (display = elem.style.display, 31358 show ? ("none" === display && (values[index] = dataPriv.get(elem, "display") || null, 31359 values[index] || (elem.style.display = "")), "" === elem.style.display && isHiddenWithinTree(elem) && (values[index] = getDefaultDisplay(elem))) : "none" !== display && (values[index] = "none", 31360 dataPriv.set(elem, "display", display))); 31361 for (index = 0; index < length; index++) null != values[index] && (elements[index].style.display = values[index]); 31362 return elements; 31363 } 31364 jQuery.fn.extend({ 31365 show: function() { 31366 return showHide(this, !0); 31367 }, 31368 hide: function() { 31369 return showHide(this); 31370 }, 31371 toggle: function(state) { 31372 return "boolean" == typeof state ? state ? this.show() : this.hide() : this.each(function() { 31373 isHiddenWithinTree(this) ? jQuery(this).show() : jQuery(this).hide(); 31374 }); 31375 } 31376 }); 31377 var div, input, rcheckableType = /^(?:checkbox|radio)$/i, rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i, rscriptType = /^$|^module$|\/(?:java|ecma)script/i; 31378 div = document.createDocumentFragment().appendChild(document.createElement("div")), 31379 (input = document.createElement("input")).setAttribute("type", "radio"), input.setAttribute("checked", "checked"), 31380 input.setAttribute("name", "t"), div.appendChild(input), support.checkClone = div.cloneNode(!0).cloneNode(!0).lastChild.checked, 31381 div.innerHTML = "<textarea>x</textarea>", support.noCloneChecked = !!div.cloneNode(!0).lastChild.defaultValue, 31382 div.innerHTML = "<option></option>", support.option = !!div.lastChild; 31383 var wrapMap = { 31384 thead: [ 1, "<table>", "</table>" ], 31385 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 31386 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 31387 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 31388 _default: [ 0, "", "" ] 31389 }; 31390 function getAll(context, tag) { 31391 var ret; 31392 return ret = void 0 !== context.getElementsByTagName ? context.getElementsByTagName(tag || "*") : void 0 !== context.querySelectorAll ? context.querySelectorAll(tag || "*") : [], 31393 void 0 === tag || tag && nodeName(context, tag) ? jQuery.merge([ context ], ret) : ret; 31394 } 31395 function setGlobalEval(elems, refElements) { 31396 for (var i = 0, l = elems.length; i < l; i++) dataPriv.set(elems[i], "globalEval", !refElements || dataPriv.get(refElements[i], "globalEval")); 31397 } 31398 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead, 31399 wrapMap.th = wrapMap.td, support.option || (wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ]); 31400 var rhtml = /<|&#?\w+;/; 31401 function buildFragment(elems, context, scripts, selection, ignored) { 31402 for (var elem, tmp, tag, wrap, attached, j, fragment = context.createDocumentFragment(), nodes = [], i = 0, l = elems.length; i < l; i++) if ((elem = elems[i]) || 0 === elem) if ("object" === toType(elem)) jQuery.merge(nodes, elem.nodeType ? [ elem ] : elem); else if (rhtml.test(elem)) { 31403 for (tmp = tmp || fragment.appendChild(context.createElement("div")), tag = (rtagName.exec(elem) || [ "", "" ])[1].toLowerCase(), 31404 wrap = wrapMap[tag] || wrapMap._default, tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2], 31405 j = wrap[0]; j--; ) tmp = tmp.lastChild; 31406 jQuery.merge(nodes, tmp.childNodes), (tmp = fragment.firstChild).textContent = ""; 31407 } else nodes.push(context.createTextNode(elem)); 31408 for (fragment.textContent = "", i = 0; elem = nodes[i++]; ) if (selection && -1 < jQuery.inArray(elem, selection)) ignored && ignored.push(elem); else if (attached = isAttached(elem), 31409 tmp = getAll(fragment.appendChild(elem), "script"), attached && setGlobalEval(tmp), 31410 scripts) for (j = 0; elem = tmp[j++]; ) rscriptType.test(elem.type || "") && scripts.push(elem); 31411 return fragment; 31412 } 31413 var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 31414 function returnTrue() { 31415 return !0; 31416 } 31417 function returnFalse() { 31418 return !1; 31419 } 31420 function expectSync(elem, type) { 31421 return elem === function() { 31422 try { 31423 return document.activeElement; 31424 } catch (err) {} 31425 }() == ("focus" === type); 31426 } 31427 function on(elem, types, selector, data, fn, one) { 31428 var origFn, type; 31429 if ("object" == typeof types) { 31430 for (type in "string" != typeof selector && (data = data || selector, selector = void 0), 31431 types) on(elem, type, selector, data, types[type], one); 31432 return elem; 31433 } 31434 if (null == data && null == fn ? (fn = selector, data = selector = void 0) : null == fn && ("string" == typeof selector ? (fn = data, 31435 data = void 0) : (fn = data, data = selector, selector = void 0)), !1 === fn) fn = returnFalse; else if (!fn) return elem; 31436 return 1 === one && (origFn = fn, (fn = function(event) { 31437 return jQuery().off(event), origFn.apply(this, arguments); 31438 }).guid = origFn.guid || (origFn.guid = jQuery.guid++)), elem.each(function() { 31439 jQuery.event.add(this, types, fn, data, selector); 31440 }); 31441 } 31442 function leverageNative(el, type, expectSync) { 31443 expectSync ? (dataPriv.set(el, type, !1), jQuery.event.add(el, type, { 31444 namespace: !1, 31445 handler: function(event) { 31446 var notAsync, result, saved = dataPriv.get(this, type); 31447 if (1 & event.isTrigger && this[type]) { 31448 if (saved.length) (jQuery.event.special[type] || {}).delegateType && event.stopPropagation(); else if (saved = slice.call(arguments), 31449 dataPriv.set(this, type, saved), notAsync = expectSync(this, type), this[type](), 31450 saved !== (result = dataPriv.get(this, type)) || notAsync ? dataPriv.set(this, type, !1) : result = {}, 31451 saved !== result) return event.stopImmediatePropagation(), event.preventDefault(), 31452 result && result.value; 31453 } else saved.length && (dataPriv.set(this, type, { 31454 value: jQuery.event.trigger(jQuery.extend(saved[0], jQuery.Event.prototype), saved.slice(1), this) 31455 }), event.stopImmediatePropagation()); 31456 } 31457 })) : void 0 === dataPriv.get(el, type) && jQuery.event.add(el, type, returnTrue); 31458 } 31459 jQuery.event = { 31460 global: {}, 31461 add: function(elem, types, handler, data, selector) { 31462 var handleObjIn, eventHandle, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.get(elem); 31463 if (acceptData(elem)) for (handler.handler && (handler = (handleObjIn = handler).handler,
vendor: 4,716 bytes, lines 31464-31506
31464 selector = handleObjIn.selector), selector && jQuery.find.matchesSelector(documentElement, selector), 31465 handler.guid || (handler.guid = jQuery.guid++), (events = elemData.events) || (events = elemData.events = Object.create(null)), 31466 (eventHandle = elemData.handle) || (eventHandle = elemData.handle = function(e) { 31467 return void 0 !== jQuery && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : void 0; 31468 }), t = (types = (types || "").match(rnothtmlwhite) || [ "" ]).length; t--; ) type = origType = (tmp = rtypenamespace.exec(types[t]) || [])[1], 31469 namespaces = (tmp[2] || "").split(".").sort(), type && (special = jQuery.event.special[type] || {}, 31470 type = (selector ? special.delegateType : special.bindType) || type, special = jQuery.event.special[type] || {}, 31471 handleObj = jQuery.extend({ 31472 type: type, 31473 origType: origType, 31474 data: data, 31475 handler: handler, 31476 guid: handler.guid, 31477 selector: selector, 31478 needsContext: selector && jQuery.expr.match.needsContext.test(selector), 31479 namespace: namespaces.join(".") 31480 }, handleObjIn), (handlers = events[type]) || ((handlers = events[type] = []).delegateCount = 0, 31481 special.setup && !1 !== special.setup.call(elem, data, namespaces, eventHandle) || elem.addEventListener && elem.addEventListener(type, eventHandle)), 31482 special.add && (special.add.call(elem, handleObj), handleObj.handler.guid || (handleObj.handler.guid = handler.guid)), 31483 selector ? handlers.splice(handlers.delegateCount++, 0, handleObj) : handlers.push(handleObj), 31484 jQuery.event.global[type] = !0); 31485 }, 31486 remove: function(elem, types, handler, selector, mappedTypes) { 31487 var j, origCount, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.hasData(elem) && dataPriv.get(elem); 31488 if (elemData && (events = elemData.events)) { 31489 for (t = (types = (types || "").match(rnothtmlwhite) || [ "" ]).length; t--; ) if (type = origType = (tmp = rtypenamespace.exec(types[t]) || [])[1], 31490 namespaces = (tmp[2] || "").split(".").sort(), type) { 31491 for (special = jQuery.event.special[type] || {}, handlers = events[type = (selector ? special.delegateType : special.bindType) || type] || [], 31492 tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)"), 31493 origCount = j = handlers.length; j--; ) handleObj = handlers[j], !mappedTypes && origType !== handleObj.origType || handler && handler.guid !== handleObj.guid || tmp && !tmp.test(handleObj.namespace) || selector && selector !== handleObj.selector && ("**" !== selector || !handleObj.selector) || (handlers.splice(j, 1), 31494 handleObj.selector && handlers.delegateCount--, special.remove && special.remove.call(elem, handleObj)); 31495 origCount && !handlers.length && (special.teardown && !1 !== special.teardown.call(elem, namespaces, elemData.handle) || jQuery.removeEvent(elem, type, elemData.handle), 31496 delete events[type]); 31497 } else for (type in events) jQuery.event.remove(elem, type + types[t], handler, selector, !0); 31498 jQuery.isEmptyObject(events) && dataPriv.remove(elem, "handle events"); 31499 } 31500 }, 31501 dispatch: function(nativeEvent) { 31502 var i, j, ret, matched, handleObj, handlerQueue, args = new Array(arguments.length), event = jQuery.event.fix(nativeEvent), handlers = (dataPriv.get(this, "events") || Object.create(null))[event.type] || [], special = jQuery.event.special[event.type] || {}; 31503 for (args[0] = event, i = 1; i < arguments.length; i++) args[i] = arguments[i]; 31504 if (event.delegateTarget = this, !special.preDispatch || !1 !== special.preDispatch.call(this, event)) { 31505 for (handlerQueue = jQuery.event.handlers.call(this, event, handlers), i = 0; (matched = handlerQueue[i++]) && !event.isPropagationStopped(); ) for (event.currentTarget = matched.elem, 31506 j = 0; (handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped();
31506 ) event.rnamespace && !1 !== handleObj.namespace && !event.rnamespace.test(handleObj.namespace) || (event.handleObj = handleObj, 31507 event.data = handleObj.data, void 0 !== (ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args)) && !1 === (event.result = ret) && (event.preventDefault(), 31508 event.stopPropagation())); 31509 return special.postDispatch && special.postDispatch.call(this, event), event.result; 31510 } 31511 }, 31512 handlers: function(event, handlers) { 31513 var i, handleObj, sel, matchedHandlers, matchedSelectors, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; 31514 if (delegateCount && cur.nodeType && !("click" === event.type && 1 <= event.button)) for (;cur !== this; cur = cur.parentNode || this) if (1 === cur.nodeType && ("click" !== event.type || !0 !== cur.disabled)) { 31515 for (matchedHandlers = [], matchedSelectors = {}, i = 0; i < delegateCount; i++) void 0 === matchedSelectors[sel = (handleObj = handlers[i]).selector + " "] && (matchedSelectors[sel] = handleObj.needsContext ? -1 < jQuery(sel, this).index(cur) : jQuery.find(sel, this, null, [ cur ]).length), 31516 matchedSelectors[sel] && matchedHandlers.push(handleObj); 31517 matchedHandlers.length && handlerQueue.push({ 31518 elem: cur, 31519 handlers: matchedHandlers 31520 }); 31521 } 31522 return cur = this, delegateCount < handlers.length && handlerQueue.push({ 31523 elem: cur, 31524 handlers: handlers.slice(delegateCount) 31525 }), handlerQueue; 31526 }, 31527 addProp: function(name, hook) { 31528 Object.defineProperty(jQuery.Event.prototype, name, { 31529 enumerable: !0, 31530 configurable: !0, 31531 get: isFunction(hook) ? function() { 31532 if (this.originalEvent) return hook(this.originalEvent); 31533 } : function() { 31534 if (this.originalEvent) return this.originalEvent[name]; 31535 }, 31536 set: function(value) { 31537 Object.defineProperty(this, name, { 31538 enumerable: !0, 31539 configurable: !0, 31540 writable: !0, 31541 value: value 31542 }); 31543 } 31544 }); 31545 }, 31546 fix: function(originalEvent) { 31547 return originalEvent[jQuery.expando] ? originalEvent : new jQuery.Event(originalEvent); 31548 }, 31549 special: { 31550 load: { 31551 noBubble: !0 31552 }, 31553 click: { 31554 setup: function(data) { 31555 var el = this || data; 31556 return rcheckableType.test(el.type) && el.click && nodeName(el, "input") && leverageNative(el, "click", returnTrue), 31557 !1; 31558 }, 31559 trigger: function(data) { 31560 var el = this || data; 31561 return rcheckableType.test(el.type) && el.click && nodeName(el, "input") && leverageNative(el, "click"), 31562 !0; 31563 }, 31564 _default: function(event) { 31565 var target = event.target; 31566 return rcheckableType.test(target.type) && target.click && nodeName(target, "input") && dataPriv.get(target, "click") || nodeName(target, "a"); 31567 } 31568 }, 31569 beforeunload: { 31570 postDispatch: function(event) { 31571 void 0 !== event.result && event.originalEvent && (event.originalEvent.returnValue = event.result); 31572 } 31573 } 31574 } 31575 }, jQuery.removeEvent = function(elem, type, handle) { 31576 elem.removeEventListener && elem.removeEventListener(type, handle); 31577 }, jQuery.Event = function(src, props) { 31578 if (!(this instanceof jQuery.Event)) return new jQuery.Event(src, props); 31579 src && src.type ? (this.originalEvent = src, this.type = src.type, this.isDefaultPrevented = src.defaultPrevented || void 0 === src.defaultPrevented && !1 === src.returnValue ? returnTrue : returnFalse, 31580 this.target = src.target && 3 === src.target.nodeType ? src.target.parentNode : src.target, 31581 this.currentTarget = src.currentTarget, this.relatedTarget = src.relatedTarget) : this.type = src, 31582 props && jQuery.extend(this, props), this.timeStamp = src && src.timeStamp || Date.now(), 31583 this[jQuery.expando] = !0; 31584 }, jQuery.Event.prototype = { 31585 constructor: jQuery.Event, 31586 isDefaultPrevented: returnFalse, 31587 isPropagationStopped: returnFalse, 31588 isImmediatePropagationStopped: returnFalse, 31589 isSimulated: !1, 31590 preventDefault: function() { 31591 var e = this.originalEvent; 31592 this.isDefaultPrevented = returnTrue, e && !this.isSimulated && e.preventDefault(); 31593 }, 31594 stopPropagation: function() { 31595 var e = this.originalEvent; 31596 this.isPropagationStopped = returnTrue, e && !this.isSimulated && e.stopPropagation(); 31597 }, 31598 stopImmediatePropagation: function() { 31599 var e = this.originalEvent; 31600 this.isImmediatePropagationStopped = returnTrue, e && !this.isSimulated && e.stopImmediatePropagation(), 31601 this.stopPropagation(); 31602 } 31603 }, jQuery.each({ 31604 altKey: !0, 31605 bubbles: !0, 31606 cancelable: !0, 31607 changedTouches: !0, 31608 ctrlKey: !0, 31609 detail: !0, 31610 eventPhase: !0, 31611 metaKey: !0, 31612 pageX: !0, 31613 pageY: !0,
31614 shiftKey: !0, 31615 view: !0, 31616 char: !0, 31617 code: !0, 31618 charCode: !0, 31619 key: !0, 31620 keyCode: !0, 31621 button: !0, 31622 buttons: !0, 31623 clientX: !0, 31624 clientY: !0, 31625 offsetX: !0, 31626 offsetY: !0, 31627 pointerId: !0, 31628 pointerType: !0, 31629 screenX: !0, 31630 screenY: !0, 31631 targetTouches: !0, 31632 toElement: !0, 31633 touches: !0, 31634 which: !0 31635 }, jQuery.event.addProp), jQuery.each({ 31636 focus: "focusin", 31637 blur: "focusout" 31638 }, function(type, delegateType) { 31639 jQuery.event.special[type] = { 31640 setup: function() { 31641 return leverageNative(this, type, expectSync), !1; 31642 }, 31643 trigger: function() { 31644 return leverageNative(this, type), !0; 31645 }, 31646 _default: function() { 31647 return !0; 31648 }, 31649 delegateType: delegateType 31650 }; 31651 }), jQuery.each({ 31652 mouseenter: "mouseover", 31653 mouseleave: "mouseout", 31654 pointerenter: "pointerover", 31655 pointerleave: "pointerout" 31656 }, function(orig, fix) { 31657 jQuery.event.special[orig] = { 31658 delegateType: fix, 31659 bindType: fix, 31660 handle: function(event) { 31661 var ret, related = event.relatedTarget, handleObj = event.handleObj; 31662 return related && (related === this || jQuery.contains(this, related)) || (event.type = handleObj.origType, 31663 ret = handleObj.handler.apply(this, arguments), event.type = fix), ret; 31664 } 31665 }; 31666 }), jQuery.fn.extend({ 31667 on: function(types, selector, data, fn) { 31668 return on(this, types, selector, data, fn); 31669 }, 31670 one: function(types, selector, data, fn) { 31671 return on(this, types, selector, data, fn, 1); 31672 }, 31673 off: function(types, selector, fn) { 31674 var handleObj, type; 31675 if (types && types.preventDefault && types.handleObj) return handleObj = types.handleObj, 31676 jQuery(types.delegateTarget).off(handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler), 31677 this; 31678 if ("object" != typeof types) return !1 !== selector && "function" != typeof selector || (fn = selector, 31679 selector = void 0), !1 === fn && (fn = returnFalse), this.each(function() { 31680 jQuery.event.remove(this, types, fn, selector); 31681 }); 31682 for (type in types) this.off(type, selector, types[type]); 31683 return this; 31684 } 31685 }); 31686 var rnoInnerhtml = /<script|<style|<link/i, rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; 31687 function manipulationTarget(elem, content) { 31688 return nodeName(elem, "table") && nodeName(11 !== content.nodeType ? content : content.firstChild, "tr") && jQuery(elem).children("tbody")[0] || elem; 31689 } 31690 function disableScript(elem) { 31691 return elem.type = (null !== elem.getAttribute("type")) + "/" + elem.type, elem; 31692 } 31693 function restoreScript(elem) { 31694 return "true/" === (elem.type || "").slice(0, 5) ? elem.type = elem.type.slice(5) : elem.removeAttribute("type"), 31695 elem; 31696 } 31697 function cloneCopyEvent(src, dest) { 31698 var i, l, type, udataOld, udataCur, events;
vendor: 7,733 bytes, lines 31699-31806
31699 if (1 === dest.nodeType) { 31700 if (dataPriv.hasData(src) && (events = dataPriv.get(src).events)) for (type in dataPriv.remove(dest, "handle events"), 31701 events) for (i = 0, l = events[type].length; i < l; i++) jQuery.event.add(dest, type, events[type][i]); 31702 dataUser.hasData(src) && (udataOld = dataUser.access(src), udataCur = jQuery.extend({}, udataOld), 31703 dataUser.set(dest, udataCur)); 31704 } 31705 } 31706 function domManip(collection, args, callback, ignored) { 31707 args = flat(args); 31708 var fragment, first, scripts, hasScripts, node, doc, i = 0, l = collection.length, iNoClone = l - 1, value = args[0], valueIsFunction = isFunction(value); 31709 if (valueIsFunction || 1 < l && "string" == typeof value && !support.checkClone && rchecked.test(value)) return collection.each(function(index) { 31710 var self = collection.eq(index); 31711 valueIsFunction && (args[0] = value.call(this, index, self.html())), domManip(self, args, callback, ignored); 31712 }); 31713 if (l && (first = (fragment = buildFragment(args, collection[0].ownerDocument, !1, collection, ignored)).firstChild, 31714 1 === fragment.childNodes.length && (fragment = first), first || ignored)) { 31715 for (hasScripts = (scripts = jQuery.map(getAll(fragment, "script"), disableScript)).length; i < l; i++) node = fragment, 31716 i !== iNoClone && (node = jQuery.clone(node, !0, !0), hasScripts && jQuery.merge(scripts, getAll(node, "script"))), 31717 callback.call(collection[i], node, i); 31718 if (hasScripts) for (doc = scripts[scripts.length - 1].ownerDocument, jQuery.map(scripts, restoreScript), 31719 i = 0; i < hasScripts; i++) node = scripts[i], rscriptType.test(node.type || "") && !dataPriv.access(node, "globalEval") && jQuery.contains(doc, node) && (node.src && "module" !== (node.type || "").toLowerCase() ? jQuery._evalUrl && !node.noModule && jQuery._evalUrl(node.src, { 31720 nonce: node.nonce || node.getAttribute("nonce") 31721 }, doc) : DOMEval(node.textContent.replace(rcleanScript, ""), node, doc)); 31722 } 31723 return collection; 31724 } 31725 function remove(elem, selector, keepData) { 31726 for (var node, nodes = selector ? jQuery.filter(selector, elem) : elem, i = 0; null != (node = nodes[i]); i++) keepData || 1 !== node.nodeType || jQuery.cleanData(getAll(node)), 31727 node.parentNode && (keepData && isAttached(node) && setGlobalEval(getAll(node, "script")), 31728 node.parentNode.removeChild(node)); 31729 return elem; 31730 } 31731 jQuery.extend({ 31732 htmlPrefilter: function(html) { 31733 return html; 31734 }, 31735 clone: function(elem, dataAndEvents, deepDataAndEvents) { 31736 var i, l, srcElements, destElements, src, dest, nodeName, clone = elem.cloneNode(!0), inPage = isAttached(elem); 31737 if (!(support.noCloneChecked || 1 !== elem.nodeType && 11 !== elem.nodeType || jQuery.isXMLDoc(elem))) for (destElements = getAll(clone), 31738 i = 0, l = (srcElements = getAll(elem)).length; i < l; i++) src = srcElements[i], 31739 dest = destElements[i], void 0, "input" === (nodeName = dest.nodeName.toLowerCase()) && rcheckableType.test(src.type) ? dest.checked = src.checked : "input" !== nodeName && "textarea" !== nodeName || (dest.defaultValue = src.defaultValue); 31740 if (dataAndEvents) if (deepDataAndEvents) for (srcElements = srcElements || getAll(elem), 31741 destElements = destElements || getAll(clone), i = 0, l = srcElements.length; i < l; i++) cloneCopyEvent(srcElements[i], destElements[i]); else cloneCopyEvent(elem, clone); 31742 return 0 < (destElements = getAll(clone, "script")).length && setGlobalEval(destElements, !inPage && getAll(elem, "script")), 31743 clone; 31744 }, 31745 cleanData: function(elems) { 31746 for (var data, elem, type, special = jQuery.event.special, i = 0; void 0 !== (elem = elems[i]); i++) if (acceptData(elem)) { 31747 if (data = elem[dataPriv.expando]) { 31748 if (data.events) for (type in data.events) special[type] ? jQuery.event.remove(elem, type) : jQuery.removeEvent(elem, type, data.handle); 31749 elem[dataPriv.expando] = void 0; 31750 } 31751 elem[dataUser.expando] && (elem[dataUser.expando] = void 0); 31752 } 31753 } 31754 }), jQuery.fn.extend({ 31755 detach: function(selector) { 31756 return remove(this, selector, !0); 31757 }, 31758 remove: function(selector) { 31759 return remove(this, selector); 31760 }, 31761 text: function(value) { 31762 return access(this, function(value) { 31763 return void 0 === value ? jQuery.text(this) : this.empty().each(function() { 31764 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || (this.textContent = value); 31765 }); 31766 }, null, value, arguments.length); 31767 }, 31768 append: function() { 31769 return domManip(this, arguments, function(elem) { 31770 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || manipulationTarget(this, elem).appendChild(elem); 31771 }); 31772 }, 31773 prepend: function() { 31774 return domManip(this, arguments, function(elem) { 31775 if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { 31776 var target = manipulationTarget(this, elem); 31777 target.insertBefore(elem, target.firstChild); 31778 } 31779 }); 31780 }, 31781 before: function() { 31782 return domManip(this, arguments, function(elem) { 31783 this.parentNode && this.parentNode.insertBefore(elem, this); 31784 }); 31785 }, 31786 after: function() { 31787 return domManip(this, arguments, function(elem) { 31788 this.parentNode && this.parentNode.insertBefore(elem, this.nextSibling); 31789 }); 31790 }, 31791 empty: function() { 31792 for (var elem, i = 0; null != (elem = this[i]); i++) 1 === elem.nodeType && (jQuery.cleanData(getAll(elem, !1)), 31793 elem.textContent = ""); 31794 return this; 31795 }, 31796 clone: function(dataAndEvents, deepDataAndEvents) { 31797 return dataAndEvents = null != dataAndEvents && dataAndEvents, deepDataAndEvents = null == deepDataAndEvents ? dataAndEvents : deepDataAndEvents, 31798 this.map(function() { 31799 return jQuery.clone(this, dataAndEvents, deepDataAndEvents); 31800 }); 31801 }, 31802 html: function(value) { 31803 return access(this, function(value) { 31804 var elem = this[0] || {}, i = 0, l = this.length; 31805 if (void 0 === value && 1 === elem.nodeType) return elem.innerHTML; 31806 if ("string" == typeof value && !rnoInnerhtml.test(value) && !wrapMap[
31806(rtagName.exec(value) || [ "", "" ])[1].toLowerCase()]) { 31807 value = jQuery.htmlPrefilter(value); 31808 try { 31809 for (;i < l; i++) 1 === (elem = this[i] || {}).nodeType && (jQuery.cleanData(getAll(elem, !1)), 31810 elem.innerHTML = value); 31811 elem = 0; 31812 } catch (e) {} 31813 } 31814 elem && this.empty().append(value); 31815 }, null, value, arguments.length); 31816 }, 31817 replaceWith: function() { 31818 var ignored = []; 31819 return domManip(this, arguments, function(elem) { 31820 var parent = this.parentNode; 31821 jQuery.inArray(this, ignored) < 0 && (jQuery.cleanData(getAll(this)), parent && parent.replaceChild(elem, this)); 31822 }, ignored); 31823 } 31824 }), jQuery.each({ 31825 appendTo: "append", 31826 prependTo: "prepend", 31827 insertBefore: "before", 31828 insertAfter: "after", 31829 replaceAll: "replaceWith" 31830 }, function(name, original) { 31831 jQuery.fn[name] = function(selector) { 31832 for (var elems, ret = [], insert = jQuery(selector), last = insert.length - 1, i = 0; i <= last; i++) elems = i === last ? this : this.clone(!0), 31833 jQuery(insert[i])[original](elems), push.apply(ret, elems.get()); 31834 return this.pushStack(ret); 31835 }; 31836 }); 31837 function swap(elem, options, callback) { 31838 var ret, name, old = {}; 31839 for (name in options) old[name] = elem.style[name], elem.style[name] = options[name]; 31840 for (name in ret = callback.call(elem), options) elem.style[name] = old[name]; 31841 return ret; 31842 } 31843 var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i"), getStyles = function(elem) { 31844 var view = elem.ownerDocument.defaultView; 31845 return view && view.opener || (view = window), view.getComputedStyle(elem); 31846 }, rboxStyle = new RegExp(cssExpand.join("|"), "i"); 31847 function curCSS(elem, name, computed) { 31848 var width, minWidth, maxWidth, ret, style = elem.style; 31849 return (computed = computed || getStyles(elem)) && ("" !== (ret = computed.getPropertyValue(name) || computed[name]) || isAttached(elem) || (ret = jQuery.style(elem, name)), 31850 !support.pixelBoxStyles() && rnumnonpx.test(ret) && rboxStyle.test(name) && (width = style.width, 31851 minWidth = style.minWidth, maxWidth = style.maxWidth, style.minWidth = style.maxWidth = style.width = ret, 31852 ret = computed.width, style.width = width, style.minWidth = minWidth, style.maxWidth = maxWidth)), 31853 void 0 !== ret ? ret + "" : ret; 31854 } 31855 function addGetHookIf(conditionFn, hookFn) { 31856 return { 31857 get: function() { 31858 if (!conditionFn()) return (this.get = hookFn).apply(this, arguments); 31859 delete this.get; 31860 } 31861 }; 31862 } 31863 !function() { 31864 function computeStyleTests() { 31865 if (div) { 31866 container.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0", 31867 div.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%", 31868 documentElement.appendChild(container).appendChild(div); 31869 var divStyle = window.getComputedStyle(div); 31870 pixelPositionVal = "1%" !== divStyle.top, reliableMarginLeftVal = 12 === roundPixelMeasures(divStyle.marginLeft), 31871 div.style.right = "60%", pixelBoxStylesVal = 36 === roundPixelMeasures(divStyle.right), 31872 boxSizingReliableVal = 36 === roundPixelMeasures(divStyle.width), div.style.position = "absolute", 31873 scrollboxSizeVal = 12 === roundPixelMeasures(div.offsetWidth / 3), documentElement.removeChild(container), 31874 div = null; 31875 } 31876 } 31877 function roundPixelMeasures(measure) { 31878 return Math.round(parseFloat(measure)); 31879 } 31880 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, reliableTrDimensionsVal, reliableMarginLeftVal, container = document.createElement("div"), div = document.createElement("div"); 31881 div.style && (div.style.backgroundClip = "content-box", div.cloneNode(!0).style.backgroundClip = "", 31882 support.clearCloneStyle = "content-box" === div.style.backgroundClip, jQuery.extend(support, { 31883 boxSizingReliable: function() { 31884 return computeStyleTests(), boxSizingReliableVal; 31885 }, 31886 pixelBoxStyles: function() { 31887 return computeStyleTests(), pixelBoxStylesVal; 31888 }, 31889 pixelPosition: function() { 31890 return computeStyleTests(), pixelPositionVal; 31891 }, 31892 reliableMarginLeft: function() { 31893 return computeStyleTests(), reliableMarginLeftVal; 31894 }, 31895 scrollboxSize: function() { 31896 return computeStyleTests(), scrollboxSizeVal; 31897 }, 31898 reliableTrDimensions: function() { 31899 var table, tr, trChild, trStyle; 31900 return null == reliableTrDimensionsVal && (table = document.createElement("table"), 31901 tr = document.createElement("tr"), trChild = document.createElement("div"), table.style.cssText = "position:absolute;
vendor: 7,482 bytes, lines 31901-32004
31901left:-11111px;border-collapse:separate", 31902 tr.style.cssText = "border:1px solid", tr.style.height = "1px", trChild.style.height = "9px", 31903 trChild.style.display = "block", documentElement.appendChild(table).appendChild(tr).appendChild(trChild), 31904 trStyle = window.getComputedStyle(tr), reliableTrDimensionsVal = parseInt(trStyle.height, 10) + parseInt(trStyle.borderTopWidth, 10) + parseInt(trStyle.borderBottomWidth, 10) === tr.offsetHeight, 31905 documentElement.removeChild(table)), reliableTrDimensionsVal; 31906 } 31907 })); 31908 }(); 31909 var cssPrefixes = [ "Webkit", "Moz", "ms" ], emptyStyle = document.createElement("div").style, vendorProps = {}; 31910 function finalPropName(name) { 31911 var final = jQuery.cssProps[name] || vendorProps[name]; 31912 return final || (name in emptyStyle ? name : vendorProps[name] = function(name) { 31913 for (var capName = name[0].toUpperCase() + name.slice(1), i = cssPrefixes.length; i--; ) if ((name = cssPrefixes[i] + capName) in emptyStyle) return name; 31914 }(name) || name); 31915 } 31916 var rdisplayswap = /^(none|table(?!-c[ea]).+)/, rcustomProp = /^--/, cssShow = { 31917 position: "absolute", 31918 visibility: "hidden", 31919 display: "block" 31920 }, cssNormalTransform = { 31921 letterSpacing: "0", 31922 fontWeight: "400" 31923 }; 31924 function setPositiveNumber(_elem, value, subtract) { 31925 var matches = rcssNum.exec(value); 31926 return matches ? Math.max(0, matches[2] - (subtract || 0)) + (matches[3] || "px") : value; 31927 } 31928 function boxModelAdjustment(elem, dimension, box, isBorderBox, styles, computedVal) { 31929 var i = "width" === dimension ? 1 : 0, extra = 0, delta = 0; 31930 if (box === (isBorderBox ? "border" : "content")) return 0; 31931 for (;i < 4; i += 2) "margin" === box && (delta += jQuery.css(elem, box + cssExpand[i], !0, styles)), 31932 isBorderBox ? ("content" === box && (delta -= jQuery.css(elem, "padding" + cssExpand[i], !0, styles)), 31933 "margin" !== box && (delta -= jQuery.css(elem, "border" + cssExpand[i] + "Width", !0, styles))) : (delta += jQuery.css(elem, "padding" + cssExpand[i], !0, styles), 31934 "padding" !== box ? delta += jQuery.css(elem, "border" + cssExpand[i] + "Width", !0, styles) : extra += jQuery.css(elem, "border" + cssExpand[i] + "Width", !0, styles)); 31935 return !isBorderBox && 0 <= computedVal && (delta += Math.max(0, Math.ceil(elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - computedVal - delta - extra - .5)) || 0), 31936 delta; 31937 } 31938 function getWidthOrHeight(elem, dimension, extra) { 31939 var styles = getStyles(elem), isBorderBox = (!support.boxSizingReliable() || extra) && "border-box" === jQuery.css(elem, "boxSizing", !1, styles), valueIsBorderBox = isBorderBox, val = curCSS(elem, dimension, styles), offsetProp = "offset" + dimension[0].toUpperCase() + dimension.slice(1); 31940 if (rnumnonpx.test(val)) { 31941 if (!extra) return val; 31942 val = "auto"; 31943 } 31944 return (!support.boxSizingReliable() && isBorderBox || !support.reliableTrDimensions() && nodeName(elem, "tr") || "auto" === val || !parseFloat(val) && "inline" === jQuery.css(elem, "display", !1, styles)) && elem.getClientRects().length && (isBorderBox = "border-box" === jQuery.css(elem, "boxSizing", !1, styles), 31945 (valueIsBorderBox = offsetProp in elem) && (val = elem[offsetProp])), (val = parseFloat(val) || 0) + boxModelAdjustment(elem, dimension, extra || (isBorderBox ? "border" : "content"), valueIsBorderBox, styles, val) + "px"; 31946 } 31947 function Tween(elem, options, prop, end, easing) { 31948 return new Tween.prototype.init(elem, options, prop, end, easing); 31949 } 31950 jQuery.extend({ 31951 cssHooks: { 31952 opacity: { 31953 get: function(elem, computed) { 31954 if (computed) { 31955 var ret = curCSS(elem, "opacity"); 31956 return "" === ret ? "1" : ret; 31957 } 31958 } 31959 } 31960 }, 31961 cssNumber: { 31962 animationIterationCount: !0, 31963 columnCount: !0, 31964 fillOpacity: !0, 31965 flexGrow: !0, 31966 flexShrink: !0, 31967 fontWeight: !0, 31968 gridArea: !0, 31969 gridColumn: !0, 31970 gridColumnEnd: !0, 31971 gridColumnStart: !0, 31972 gridRow: !0, 31973 gridRowEnd: !0, 31974 gridRowStart: !0, 31975 lineHeight: !0, 31976 opacity: !0, 31977 order: !0, 31978 orphans: !0, 31979 widows: !0, 31980 zIndex: !0, 31981 zoom: !0 31982 }, 31983 cssProps: {}, 31984 style: function(elem, name, value, extra) { 31985 if (elem && 3 !== elem.nodeType && 8 !== elem.nodeType && elem.style) { 31986 var ret, type, hooks, origName = camelCase(name), isCustomProp = rcustomProp.test(name), style = elem.style; 31987 if (isCustomProp || (name = finalPropName(origName)), hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName], 31988 void 0 === value) return hooks && "get" in hooks && void 0 !== (ret = hooks.get(elem, !1, extra)) ? ret : style[name]; 31989 "string" === (type = typeof value) && (ret = rcssNum.exec(value)) && ret[1] && (value = adjustCSS(elem, name, ret), 31990 type = "number"), null != value && value == value && ("number" !== type || isCustomProp || (value += ret && ret[3] || (jQuery.cssNumber[origName] ? "" : "px")), 31991 support.clearCloneStyle || "" !== value || 0 !== name.indexOf("background") || (style[name] = "inherit"), 31992 hooks && "set" in hooks && void 0 === (value = hooks.set(elem, value, extra)) || (isCustomProp ? style.setProperty(name, value) : style[name] = value)); 31993 } 31994 }, 31995 css: function(elem, name, extra, styles) { 31996 var val, num, hooks, origName = camelCase(name); 31997 return rcustomProp.test(name) || (name = finalPropName(origName)), (hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName]) && "get" in hooks && (val = hooks.get(elem, !0, extra)), 31998 void 0 === val && (val = curCSS(elem, name, styles)), "normal" === val && name in cssNormalTransform && (val = cssNormalTransform[name]), 31999 "" === extra || extra ? (num = parseFloat(val), !0 === extra || isFinite(num) ? num || 0 : val) : val; 32000 } 32001 }), jQuery.each([ "height", "width" ], function(_i, dimension) { 32002 jQuery.cssHooks[dimension] = { 32003 get: function(elem, computed, extra) { 32004 if (computed) return !rdisplayswap.test(jQuery.css(elem, "dis
vendor: 9,272 bytes, lines 32004-32136
32004play")) || elem.getClientRects().length && elem.getBoundingClientRect().width ? getWidthOrHeight(elem, dimension, extra) : swap(elem, cssShow, function() { 32005 return getWidthOrHeight(elem, dimension, extra); 32006 }); 32007 }, 32008 set: function(elem, value, extra) { 32009 var matches, styles = getStyles(elem), scrollboxSizeBuggy = !support.scrollboxSize() && "absolute" === styles.position, isBorderBox = (scrollboxSizeBuggy || extra) && "border-box" === jQuery.css(elem, "boxSizing", !1, styles), subtract = extra ? boxModelAdjustment(elem, dimension, extra, isBorderBox, styles) : 0; 32010 return isBorderBox && scrollboxSizeBuggy && (subtract -= Math.ceil(elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - parseFloat(styles[dimension]) - boxModelAdjustment(elem, dimension, "border", !1, styles) - .5)), 32011 subtract && (matches = rcssNum.exec(value)) && "px" !== (matches[3] || "px") && (elem.style[dimension] = value, 32012 value = jQuery.css(elem, dimension)), setPositiveNumber(0, value, subtract); 32013 } 32014 }; 32015 }), jQuery.cssHooks.marginLeft = addGetHookIf(support.reliableMarginLeft, function(elem, computed) { 32016 if (computed) return (parseFloat(curCSS(elem, "marginLeft")) || elem.getBoundingClientRect().left - swap(elem, { 32017 marginLeft: 0 32018 }, function() { 32019 return elem.getBoundingClientRect().left; 32020 })) + "px"; 32021 }), jQuery.each({ 32022 margin: "", 32023 padding: "", 32024 border: "Width" 32025 }, function(prefix, suffix) { 32026 jQuery.cssHooks[prefix + suffix] = { 32027 expand: function(value) { 32028 for (var i = 0, expanded = {}, parts = "string" == typeof value ? value.split(" ") : [ value ]; i < 4; i++) expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0]; 32029 return expanded; 32030 } 32031 }, "margin" !== prefix && (jQuery.cssHooks[prefix + suffix].set = setPositiveNumber); 32032 }), jQuery.fn.extend({ 32033 css: function(name, value) { 32034 return access(this, function(elem, name, value) { 32035 var styles, len, map = {}, i = 0; 32036 if (Array.isArray(name)) { 32037 for (styles = getStyles(elem), len = name.length; i < len; i++) map[name[i]] = jQuery.css(elem, name[i], !1, styles); 32038 return map; 32039 } 32040 return void 0 !== value ? jQuery.style(elem, name, value) : jQuery.css(elem, name); 32041 }, name, value, 1 < arguments.length); 32042 } 32043 }), ((jQuery.Tween = Tween).prototype = { 32044 constructor: Tween, 32045 init: function(elem, options, prop, end, easing, unit) { 32046 this.elem = elem, this.prop = prop, this.easing = easing || jQuery.easing._default, 32047 this.options = options, this.start = this.now = this.cur(), this.end = end, this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px"); 32048 }, 32049 cur: function() { 32050 var hooks = Tween.propHooks[this.prop]; 32051 return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this); 32052 }, 32053 run: function(percent) { 32054 var eased, hooks = Tween.propHooks[this.prop]; 32055 return this.options.duration ? this.pos = eased = jQuery.easing[this.easing](percent, this.options.duration * percent, 0, 1, this.options.duration) : this.pos = eased = percent, 32056 this.now = (this.end - this.start) * eased + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), 32057 hooks && hooks.set ? hooks.set(this) : Tween.propHooks._default.set(this), this; 32058 } 32059 }).init.prototype = Tween.prototype, (Tween.propHooks = { 32060 _default: { 32061 get: function(tween) { 32062 var result; 32063 return 1 !== tween.elem.nodeType || null != tween.elem[tween.prop] && null == tween.elem.style[tween.prop] ? tween.elem[tween.prop] : (result = jQuery.css(tween.elem, tween.prop, "")) && "auto" !== result ? result : 0; 32064 }, 32065 set: function(tween) { 32066 jQuery.fx.step[tween.prop] ? jQuery.fx.step[tween.prop](tween) : 1 !== tween.elem.nodeType || !jQuery.cssHooks[tween.prop] && null == tween.elem.style[finalPropName(tween.prop)] ? tween.elem[tween.prop] = tween.now : jQuery.style(tween.elem, tween.prop, tween.now + tween.unit); 32067 } 32068 } 32069 }).scrollTop = Tween.propHooks.scrollLeft = { 32070 set: function(tween) { 32071 tween.elem.nodeType && tween.elem.parentNode && (tween.elem[tween.prop] = tween.now); 32072 } 32073 }, jQuery.easing = { 32074 linear: function(p) { 32075 return p; 32076 }, 32077 swing: function(p) { 32078 return .5 - Math.cos(p * Math.PI) / 2; 32079 }, 32080 _default: "swing" 32081 }, jQuery.fx = Tween.prototype.init, jQuery.fx.step = {}; 32082 var fxNow, inProgress, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/; 32083 function schedule() { 32084 inProgress && (!1 === document.hidden && window.requestAnimationFrame ? window.requestAnimationFrame(schedule) : window.setTimeout(schedule, jQuery.fx.interval), 32085 jQuery.fx.tick()); 32086 } 32087 function createFxNow() { 32088 return window.setTimeout(function() { 32089 fxNow = void 0; 32090 }), fxNow = Date.now(); 32091 } 32092 function genFx(type, includeWidth) { 32093 var which, i = 0, attrs = { 32094 height: type 32095 }; 32096 for (includeWidth = includeWidth ? 1 : 0; i < 4; i += 2 - includeWidth) attrs["margin" + (which = cssExpand[i])] = attrs["padding" + which] = type; 32097 return includeWidth && (attrs.opacity = attrs.width = type), attrs; 32098 } 32099 function createTween(value, prop, animation) { 32100 for (var tween, collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners["*"]), index = 0, length = collection.length; index < length; index++) if (tween = collection[index].call(animation, prop, value)) return tween; 32101 } 32102 function Animation(elem, properties, options) { 32103 var result, stopped, index = 0, length = Animation.prefilters.length, deferred = jQuery.Deferred().always(function() { 32104 delete tick.elem; 32105 }), tick = function() { 32106 if (stopped) return !1; 32107 for (var currentTime = fxNow || createFxNow(), remaining = Math.max(0, animation.startTime + animation.duration - currentTime), percent = 1 - (remaining / animation.duration || 0), index = 0, length = animation.tweens.length; index < length; index++) animation.tweens[index].run(percent); 32108 return deferred.notifyWith(elem, [ animation, percent, remaining ]), percent < 1 && length ? remaining : (length || deferred.notifyWith(elem, [ animation, 1, 0 ]), 32109 deferred.resolveWith(elem, [ animation ]), !1); 32110 }, animation = deferred.promise({ 32111 elem: elem, 32112 props: jQuery.extend({}, properties), 32113 opts: jQuery.extend(!0, { 32114 specialEasing: {}, 32115 easing: jQuery.easing._default 32116 }, options), 32117 originalProperties: properties, 32118 originalOptions: options, 32119 startTime: fxNow || createFxNow(), 32120 duration: options.duration, 32121 tweens: [], 32122 createTween: function(prop, end) { 32123 var tween = jQuery.Tween(elem, animation.opts, prop, end, animation.opts.specialEasing[prop] || animation.opts.easing); 32124 return animation.tweens.push(tween), tween; 32125 }, 32126 stop: function(gotoEnd) { 32127 var index = 0, length = gotoEnd ? animation.tweens.length : 0; 32128 if (stopped) return this; 32129 for (stopped = !0; index < length; index++) animation.tweens[index].run(1); 32130 return gotoEnd ? (deferred.notifyWith(elem, [ animation, 1, 0 ]), deferred.resolveWith(elem, [ animation, gotoEnd ])) : deferred.rejectWith(elem, [ animation, gotoEnd ]), 32131 this; 32132 } 32133 }), props = animation.props; 32134 for (!function(props, specialEasing) { 32135 var index, name, easing, value, hooks; 32136 for (index in props) if (easing = specialEasing[n
vendor: 6,075 bytes, lines 32136-32203
32136ame = camelCase(index)], value = props[index], 32137 Array.isArray(value) && (easing = value[1], value = props[index] = value[0]), index !== name && (props[name] = value, 32138 delete props[index]), (hooks = jQuery.cssHooks[name]) && "expand" in hooks) for (index in value = hooks.expand(value), 32139 delete props[name], value) index in props || (props[index] = value[index], specialEasing[index] = easing); else specialEasing[name] = easing; 32140 }(props, animation.opts.specialEasing); index < length; index++) if (result = Animation.prefilters[index].call(animation, elem, props, animation.opts)) return isFunction(result.stop) && (jQuery._queueHooks(animation.elem, animation.opts.queue).stop = result.stop.bind(result)), 32141 result; 32142 return jQuery.map(props, createTween, animation), isFunction(animation.opts.start) && animation.opts.start.call(elem, animation), 32143 animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always), 32144 jQuery.fx.timer(jQuery.extend(tick, { 32145 elem: elem, 32146 anim: animation, 32147 queue: animation.opts.queue 32148 })), animation; 32149 } 32150 jQuery.Animation = jQuery.extend(Animation, { 32151 tweeners: { 32152 "*": [ function(prop, value) { 32153 var tween = this.createTween(prop, value); 32154 return adjustCSS(tween.elem, prop, rcssNum.exec(value), tween), tween; 32155 } ] 32156 }, 32157 tweener: function(props, callback) { 32158 for (var prop, index = 0, length = (props = isFunction(props) ? (callback = props, 32159 [ "*" ]) : props.match(rnothtmlwhite)).length; index < length; index++) prop = props[index], 32160 Animation.tweeners[prop] = Animation.tweeners[prop] || [], Animation.tweeners[prop].unshift(callback); 32161 }, 32162 prefilters: [ function(elem, props, opts) { 32163 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, isBox = "width" in props || "height" in props, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHiddenWithinTree(elem), dataShow = dataPriv.get(elem, "fxshow"); 32164 for (prop in opts.queue || (null == (hooks = jQuery._queueHooks(elem, "fx")).unqueued && (hooks.unqueued = 0, 32165 oldfire = hooks.empty.fire, hooks.empty.fire = function() { 32166 hooks.unqueued || oldfire(); 32167 }), hooks.unqueued++, anim.always(function() { 32168 anim.always(function() { 32169 hooks.unqueued--, jQuery.queue(elem, "fx").length || hooks.empty.fire(); 32170 }); 32171 })), props) if (value = props[prop], rfxtypes.test(value)) { 32172 if (delete props[prop], toggle = toggle || "toggle" === value, value === (hidden ? "hide" : "show")) { 32173 if ("show" !== value || !dataShow || void 0 === dataShow[prop]) continue; 32174 hidden = !0; 32175 } 32176 orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop); 32177 } 32178 if ((propTween = !jQuery.isEmptyObject(props)) || !jQuery.isEmptyObject(orig)) for (prop in isBox && 1 === elem.nodeType && (opts.overflow = [ style.overflow, style.overflowX, style.overflowY ], 32179 null == (restoreDisplay = dataShow && dataShow.display) && (restoreDisplay = dataPriv.get(elem, "display")), 32180 "none" === (display = jQuery.css(elem, "display")) && (restoreDisplay ? display = restoreDisplay : (showHide([ elem ], !0), 32181 restoreDisplay = elem.style.display || restoreDisplay, display = jQuery.css(elem, "display"), 32182 showHide([ elem ]))), ("inline" === display || "inline-block" === display && null != restoreDisplay) && "none" === jQuery.css(elem, "float") && (propTween || (anim.done(function() { 32183 style.display = restoreDisplay; 32184 }), null == restoreDisplay && (display = style.display, restoreDisplay = "none" === display ? "" : display)), 32185 style.display = "inline-block")), opts.overflow && (style.overflow = "hidden", anim.always(function() { 32186 style.overflow = opts.overflow[0], style.overflowX = opts.overflow[1], style.overflowY = opts.overflow[2]; 32187 })), propTween = !1, orig) propTween || (dataShow ? "hidden" in dataShow && (hidden = dataShow.hidden) : dataShow = dataPriv.access(elem, "fxshow", { 32188 display: restoreDisplay 32189 }), toggle && (dataShow.hidden = !hidden), hidden && showHide([ elem ], !0), anim.done(function() { 32190 for (prop in hidden || showHide([ elem ]), dataPriv.remove(elem, "fxshow"), orig) jQuery.style(elem, prop, orig[prop]); 32191 })), propTween = createTween(hidden ? dataShow[prop] : 0, prop, anim), prop in dataShow || (dataShow[prop] = propTween.start, 32192 hidden && (propTween.end = propTween.start, propTween.start = 0)); 32193 } ], 32194 prefilter: function(callback, prepend) { 32195 prepend ? Animation.prefilters.unshift(callback) : Animation.prefilters.push(callback); 32196 } 32197 }), jQuery.speed = function(speed, easing, fn) { 32198 var opt = speed && "object" == typeof speed ? jQuery.extend({}, speed) : { 32199 complete: fn || !fn && easing || isFunction(speed) && speed, 32200 duration: speed, 32201 easing: fn && easing || easing && !isFunction(easing) && easing 32202 }; 32203 return jQuery.fx.off ? opt.duration = 0 : "number" != typeof opt.duration && (
32203opt.duration in jQuery.fx.speeds ? opt.duration = jQuery.fx.speeds[opt.duration] : opt.duration = jQuery.fx.speeds._default), 32204 null != opt.queue && !0 !== opt.queue || (opt.queue = "fx"), opt.old = opt.complete, 32205 opt.complete = function() { 32206 isFunction(opt.old) && opt.old.call(this), opt.queue && jQuery.dequeue(this, opt.queue); 32207 }, opt; 32208 }, jQuery.fn.extend({ 32209 fadeTo: function(speed, to, easing, callback) { 32210 return this.filter(isHiddenWithinTree).css("opacity", 0).show().end().animate({ 32211 opacity: to 32212 }, speed, easing, callback); 32213 }, 32214 animate: function(prop, speed, easing, callback) { 32215 function doAnimation() { 32216 var anim = Animation(this, jQuery.extend({}, prop), optall); 32217 (empty || dataPriv.get(this, "finish")) && anim.stop(!0); 32218 } 32219 var empty = jQuery.isEmptyObject(prop), optall = jQuery.speed(speed, easing, callback); 32220 return doAnimation.finish = doAnimation, empty || !1 === optall.queue ? this.each(doAnimation) : this.queue(optall.queue, doAnimation); 32221 }, 32222 stop: function(type, clearQueue, gotoEnd) { 32223 function stopQueue(hooks) { 32224 var stop = hooks.stop; 32225 delete hooks.stop, stop(gotoEnd); 32226 } 32227 return "string" != typeof type && (gotoEnd = clearQueue, clearQueue = type, type = void 0), 32228 clearQueue && this.queue(type || "fx", []), this.each(function() { 32229 var dequeue = !0, index = null != type && type + "queueHooks", timers = jQuery.timers, data = dataPriv.get(this); 32230 if (index) data[index] && data[index].stop && stopQueue(data[index]); else for (index in data) data[index] && data[index].stop && rrun.test(index) && stopQueue(data[index]); 32231 for (index = timers.length; index--; ) timers[index].elem !== this || null != type && timers[index].queue !== type || (timers[index].anim.stop(gotoEnd), 32232 dequeue = !1, timers.splice(index, 1)); 32233 !dequeue && gotoEnd || jQuery.dequeue(this, type); 32234 }); 32235 }, 32236 finish: function(type) { 32237 return !1 !== type && (type = type || "fx"), this.each(function() { 32238 var index, data = dataPriv.get(this), queue = data[type + "queue"], hooks = data[type + "queueHooks"], timers = jQuery.timers, length = queue ? queue.length : 0; 32239 for (data.finish = !0, jQuery.queue(this, type, []), hooks && hooks.stop && hooks.stop.call(this, !0), 32240 index = timers.length; index--; ) timers[index].elem === this && timers[index].queue === type && (timers[index].anim.stop(!0), 32241 timers.splice(index, 1)); 32242 for (index = 0; index < length; index++) queue[index] && queue[index].finish && queue[index].finish.call(this); 32243 delete data.finish; 32244 }); 32245 } 32246 }), jQuery.each([ "toggle", "show", "hide" ], function(_i, name) { 32247 var cssFn = jQuery.fn[name]; 32248 jQuery.fn[name] = function(speed, easing, callback) { 32249 return null == speed || "boolean" == typeof speed ? cssFn.apply(this, arguments) : this.animate(genFx(name, !0), speed, easing, callback); 32250 }; 32251 }), jQuery.each({ 32252 slideDown: genFx("show"), 32253 slideUp: genFx("hide"), 32254 slideToggle: genFx("toggle"), 32255 fadeIn: { 32256 opacity: "show" 32257 }, 32258 fadeOut: { 32259 opacity: "hide" 32260 }, 32261 fadeToggle: { 32262 opacity: "toggle" 32263 } 32264 }, function(name, props) { 32265 jQuery.fn[name] = function(speed, easing, callback) { 32266 return this.animate(props, speed, easing, callback); 32267 }; 32268 }), jQuery.timers = [], jQuery.fx.tick = function() { 32269 var timer, i = 0, timers = jQuery.timers; 32270 for (fxNow = Date.now(); i < timers.length; i++) (timer = timers[i])() || timers[i] !== timer || timers.splice(i--, 1); 32271 timers.length || jQuery.fx.stop(), fxNow = void 0; 32272 }, jQuery.fx.timer = function(timer) { 32273 jQuery.timers.push(timer), jQuery.fx.start(); 32274 }, jQuery.fx.interval = 13, jQuery.fx.start = function() { 32275 inProgress || (inProgress = !0, schedule()); 32276 }, jQuery.fx.stop = function() { 32277 inProgress = null; 32278 }, jQuery.fx.speeds = { 32279 slow: 600, 32280 fast: 200, 32281 _default: 400 32282 }
32282, jQuery.fn.delay = function(time, type) { 32283 return time = jQuery.fx && jQuery.fx.speeds[time] || time, type = type || "fx", 32284 this.queue(type, function(next, hooks) { 32285 var timeout = window.setTimeout(next, time); 32286 hooks.stop = function() { 32287 window.clearTimeout(timeout); 32288 }; 32289 }); 32290 }, function() { 32291 var input = document.createElement("input"), opt = document.createElement("select").appendChild(document.createElement("option")); 32292 input.type = "checkbox", support.checkOn = "" !== input.value, support.optSelected = opt.selected, 32293 (input = document.createElement("input")).value = "t", input.type = "radio", support.radioValue = "t" === input.value; 32294 }(); 32295 var boolHook, attrHandle = jQuery.expr.attrHandle; 32296 jQuery.fn.extend({ 32297 attr: function(name, value) { 32298 return access(this, jQuery.attr, name, value, 1 < arguments.length); 32299 }, 32300 removeAttr: function(name) { 32301 return this.each(function() { 32302 jQuery.removeAttr(this, name); 32303 }); 32304 } 32305 }), jQuery.extend({ 32306 attr: function(elem, name, value) { 32307 var ret, hooks, nType = elem.nodeType; 32308 if (3 !== nType && 8 !== nType && 2 !== nType) return void 0 === elem.getAttribute ? jQuery.prop(elem, name, value) : (1 === nType && jQuery.isXMLDoc(elem) || (hooks = jQuery.attrHooks[name.toLowerCase()] || (jQuery.expr.match.bool.test(name) ? boolHook : void 0)), 32309 void 0 !== value ? null === value ? void jQuery.removeAttr(elem, name) : hooks && "set" in hooks && void 0 !== (ret = hooks.set(elem, value, name)) ? ret : (elem.setAttribute(name, value + ""), 32310 value) : hooks && "get" in hooks && null !== (ret = hooks.get(elem, name)) ? ret : null == (ret = jQuery.find.attr(elem, name)) ? void 0 : ret); 32311 }, 32312 attrHooks: { 32313 type: { 32314 set: function(elem, value) { 32315 if (!support.radioValue && "radio" === value && nodeName(elem, "input")) { 32316 var val = elem.value; 32317 return elem.setAttribute("type", value), val && (elem.value = val), value; 32318 } 32319 } 32320 } 32321 }, 32322 removeAttr: function(elem, value) { 32323 var name, i = 0, attrNames = value && value.match(rnothtmlwhite); 32324 if (attrNames && 1 === elem.nodeType) for (;name = attrNames[i++]; ) elem.removeAttribute(name); 32325 } 32326 }), boolHook = { 32327 set: function(elem, value, name) { 32328 return !1 === value ? jQuery.removeAttr(elem, name) : elem.setAttribute(name, name), 32329 name; 32330 } 32331 }, jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(_i, name) { 32332 var getter = attrHandle[name] || jQuery.find.attr; 32333 attrHandle[name] = function(elem, name, isXML) { 32334 var ret, handle, lowercaseName = name.toLowerCase(); 32335 return isXML || (handle = attrHandle[lowercaseName], attrHandle[lowercaseName] = ret, 32336 ret = null != getter(elem, name, isXML) ? lowercaseName : null, attrHandle[lowercaseName] = handle), 32337 ret; 32338 }; 32339 }); 32340 var rfocusable = /^(?:input|select|textarea|button)$/i, rclickable = /^(?:a|area)$/i; 32341 function stripAndCollapse(value) { 32342 return (value.match(rnothtmlwhite) || []).join(" "); 32343 } 32344 function getClass(elem) { 32345 return elem.getAttribute && elem.getAttribute("class") || ""; 32346 } 32347 function classesToArray(value) { 32348 return Array.isArray(value) ? value : "string" == typeof value && value.match(rnothtmlwhite) || []; 32349 } 32350 jQuery.fn.extend({ 32351 prop: function(name, value) { 32352 return access(this, jQuery.prop, name, value, 1 < arguments.length); 32353 }, 32354 removeProp: function(name) { 32355 return this.each(function() { 32356 delete this[jQuery.propFix[name] || name]; 32357 }); 32358 } 32359 }), jQuery.extend({ 32360 prop: function(elem, name, value) { 32361 var ret, hooks, nType = elem.nodeType; 32362 if (3 !== nType && 8 !== nType && 2 !== nType) return 1 === nType && jQuery.isXMLDoc(elem) || (name = jQuery.propFix[name] || name, 32363 hooks = jQuery.propHooks[name]), void 0 !== value ? hooks && "set" in hooks && void 0 !== (ret = hooks.set(elem, value, name)) ? ret : elem[name] = value : hooks && "get" in hooks && null !== (ret = hooks.get(elem, name)) ? ret : elem[name]; 32364 }, 32365 propHooks: { 32366 tabIndex: { 32367 get: function(elem) { 32368 var tabindex = jQuery.find.attr(elem, "tabindex"); 32369 return tabindex ? parseInt(tabindex, 10) : rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href ? 0 : -1; 32370 } 32371 } 32372 }, 32373 propFix: { 32374 for: "htmlFor", 32375 class: "className" 32376 } 32377 }), support.optSelected || (jQuery.propHooks.selected = { 32378 get: function(elem) { 32379 var parent = elem.parentNode; 32380 return parent && parent.parentNode && parent.parentNode.selectedIndex, null; 32381 }, 32382 set: function(elem) { 32383 var parent = elem.parentNode; 32384 parent && (parent.selectedIndex, parent.parentNode && parent.parentNode.selectedIndex); 32385 } 32386 }), jQuery.each([ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { 32387 jQuery.propFix[this.toLowerCase()] = this; 32388 }), jQuery.fn.extend({ 32389 addClass: function(value) { 32390 var classes, elem, cur, curValue, clazz, j, finalValue, i = 0; 32391 if (isFunction(value)) return this.each(function(j) { 32392 jQuery(this).addClass(value.call(this, j, getClass(this))); 32393 }); 32394 if ((classes = classesToArray(value)).length) for (;elem = this[i++]; ) if (curValue = getClass(elem), 32395 cur = 1 === elem.nodeType && " " + stripAndCollapse(curValue) + " ") { 32396 for (j = 0; clazz = classes[j++]; ) cur.indexOf(" " + clazz + " ") < 0 && (cur += clazz + " "); 32397 curValue !== (finalValue = stripAndCollapse(cur)) && elem.setAttribute("class", finalValue); 32398 } 32399 return this; 32400 }, 32401 removeClass: function(value) { 32402 var classes, elem, cur, curValue, clazz, j, finalValue, i = 0; 32403 if (isFunction(value)) return this.each(function(j) { 32404 jQuery(this).removeClass(value.call(this, j, getClass(this))); 32405 }); 32406 if (!arguments.length) return this.attr("class", ""); 32407 if ((classes = classesToArray(value)).length) for (;elem = this[i++]; ) if (curValue = getClass(elem), 32408 cur = 1 === elem.nodeType && " " + stripAndCollapse(curValue) + " ") { 32409 for (j = 0; clazz = classes[j++]; ) for (;-1 < cur.indexOf(" " + clazz + " "); ) cur = cur.replace(" " + clazz + " ", " "); 32410 curValue !== (finalValue = stripAndCollapse(cur)) && elem.setAttribute("class", finalValue); 32411 } 32412 return this; 32413 }, 32414 toggleClass: function(value, stateVal) { 32415 var type = typeof value, isValidValue = "string" == type || Array.isArray(value); 32416 return "boolean" == typeof stateVal && isValidValue ? stateVal ? this.addClass(value) : this.removeClass(value) : isFunction(value) ? this.each(function(i) { 32417 jQuery(this).toggleClass(value.call(this, i, getClass(this), stateVal), stateVal); 32418 }) : this.each(function() { 32419 var className, i, self, classNames; 32420 if (isValidValue) for (i = 0, self = jQuery(this), classNames = classesToArray(value); className = classNames[i++]; ) self.hasClass(className) ? self.removeClass(className) : self.addClass(className); else void 0 !== value && "boolean" != type || ((className = getClass(this)) && dataPriv.set(this, "__className__", className), 32421 this.setAttribute && this.setAttribute("class", className || !1 === value ? "" : dataPriv.get(this, "__className__") || "")); 32422 }); 32423 }, 32424 hasClass: function(selector) { 32425 var className, elem, i = 0; 32426 for (className = " " + selector + " "; elem = this[i++]; ) if (1 === elem.nodeType && -1 < (" " + stripAndCollapse(getClass(elem)) + " ").indexOf(className)) return !0; 32427 return !1; 32428 } 32429 }); 32430 var rreturn = /\r/g; 32431 jQuery.fn.extend({ 32432 val: function(value) { 32433 var hooks, ret, valueIsFunction, elem = this[0]; 32434 return arguments.length ? (valueIsFunction = isFunction(value), this.each(function(i) { 32435 var val; 32436 1 === this.nodeType && (null == (val = valueIsFunction ? value.call(this, i, jQuery(this).val()) : value) ? val = "" : "number" == typeof val ? val += "" : Array.isArray(val) && (val = jQuery.map(val, function(value) { 32437 return null == value ? "" : value + ""; 32438 })), (hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()]) && "set" in hooks && void 0 !== hooks.set(this, val, "value") || (this.value = val)); 32439 })) : elem ? (hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()]) && "get" in hooks && void 0 !== (ret = hooks.get(elem, "value")) ? ret : "string" == typeof (ret = elem.value) ? ret.replace(rreturn, "") : null == ret ? "" : ret : void 0; 32440 } 32441 }), jQuery.extend({ 32442 valHooks: { 32443 option: { 32444 get: function(elem) { 32445 var val = jQuery.find.attr(elem, "value"); 32446 return null != val ? val : stripAndCollapse(jQuery.text(elem)); 32447 } 32448 }, 32449 select: { 32450 get: function(elem) { 32451 var value, option, i, options = elem.options, index = elem.selectedIndex, one = "select-one" === elem.type, values = one ? null : [], max = one ? index + 1 : options.length; 32452 for (i = index < 0 ? max : one ? index : 0; i < max; i++) if (((option = options[i]).selected || i === index) && !option.disabled && (!option.parentNode.disabled || !nodeName(option.parentNode, "optgroup"))) { 32453 if (value = jQuery(option).val(), one) return value; 32454 values.push(value); 32455 } 32456 return values; 32457 }, 32458 set: function(elem, value) { 32459 for (var optionSet, option, options = elem.options, values = jQuery.makeArray(value), i = options.length; i--; ) ((option = options[i]).selected = -1 < jQuery.inArray(jQuery.valHooks.option.get(option), values)) && (optionSet = !0); 32460 return optionSet || (elem.selectedIndex = -1), values; 32461 } 32462 } 32463 } 32464 }), jQuery.each([ "radio", "checkbox" ], function() { 32465 jQuery.valHooks[this] = { 32466 set: function(elem, value) { 32467 if (Array.isArray(value)) return elem.checked = -1 < jQuery.inArray(jQuery(elem).val(), value); 32468 } 32469 }, support.checkOn || (jQuery.valHooks[this].get = function(elem) { 32470 return null === elem.getAttribute("value") ? "on" : elem.value; 32471 }); 32472 }), support.focusin = "onfocusin" in window; 32473 function stopPropagationCallback(e) { 32474 e.stopPropagation(); 32475 } 32476 var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/; 32477 jQuery.extend(jQuery.event, { 32478 trigger: function(event, data, elem, onlyHandlers) { 32479 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, eventPath = [ elem || document ], type = hasOwn.call(event, "type") ? event.type : event, namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : []; 32480 if (cur = lastElement = tmp = elem = elem || document, 3 !== elem.nodeType && 8 !== elem.nodeType && !rfocusMorph.test(type + jQuery.event.triggered) && (-1 < type.indexOf(".") && (type = (namespaces = type.split(".")).shift(), 32481 namespaces.sort()), ontype = type.indexOf(":") < 0 && "on"
32481+ type, (event = event[jQuery.expando] ? event : new jQuery.Event(type, "object" == typeof event && event)).isTrigger = onlyHandlers ? 2 : 3, 32482 event.namespace = namespaces.join("."), event.rnamespace = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, 32483 event.result = void 0, event.target || (event.target = elem), data = null == data ? [ event ] : jQuery.makeArray(data, [ event ]), 32484 special = jQuery.event.special[type] || {}, onlyHandlers || !special.trigger || !1 !== special.trigger.apply(elem, data))) { 32485 if (!onlyHandlers && !special.noBubble && !isWindow(elem)) { 32486 for (bubbleType = special.delegateType || type, rfocusMorph.test(bubbleType + type) || (cur = cur.parentNode); cur; cur = cur.parentNode) eventPath.push(cur), 32487 tmp = cur; 32488 tmp === (elem.ownerDocument || document) && eventPath.push(tmp.defaultView || tmp.parentWindow || window); 32489 } 32490 for (i = 0; (cur = eventPath[i++]) && !event.isPropagationStopped(); ) lastElement = cur, 32491 event.type = 1 < i ? bubbleType : special.bindType || type, (handle = (dataPriv.get(cur, "events") || Object.create(null))[event.type] && dataPriv.get(cur, "handle")) && handle.apply(cur, data), 32492 (handle = ontype && cur[ontype]) && handle.apply && acceptData(cur) && (event.result = handle.apply(cur, data), 32493 !1 === event.result && event.preventDefault()); 32494 return event.type = type, onlyHandlers || event.isDefaultPrevented() || special._default && !1 !== special._default.apply(eventPath.pop(), data) || !acceptData(elem) || ontype && isFunction(elem[type]) && !isWindow(elem) && ((tmp = elem[ontype]) && (elem[ontype] = null), 32495 jQuery.event.triggered = type, event.isPropagationStopped() && lastElement.addEventListener(type, stopPropagationCallback), 32496 elem[type](), event.isPropagationStopped() && lastElement.removeEventListener(type, stopPropagationCallback), 32497 jQuery.event.triggered = void 0, tmp && (elem[ontype] = tmp)), event.result; 32498 } 32499 }, 32500 simulate: function(type, elem, event) { 32501 var e = jQuery.extend(new jQuery.Event(), event, { 32502 type: type, 32503 isSimulated: !0 32504 }); 32505 jQuery.event.trigger(e, null, elem); 32506 } 32507 }), jQuery.fn.extend({ 32508 trigger: function(type, data) { 32509 return this.each(function() { 32510 jQuery.event.trigger(type, data, this); 32511 }); 32512 }, 32513 triggerHandler: function(type, data) { 32514 var elem = this[0]; 32515 if (elem) return jQuery.event.trigger(type, data, elem, !0); 32516 } 32517 }), support.focusin || jQuery.each({ 32518 focus: "focusin", 32519 blur: "focusout" 32520 }, function(orig, fix) { 32521 function handler(event) { 32522 jQuery.event.simulate(fix, event.target, jQuery.event.fix(event)); 32523 } 32524 jQuery.event.special[fix] = { 32525 setup: function() { 32526 var doc = this.ownerDocument || this.document || this, attaches = dataPriv.access(doc, fix); 32527 attaches || doc.addEventListener(orig, handler, !0), dataPriv.access(doc, fix, (attaches || 0) + 1); 32528 }, 32529 teardown: function() { 32530 var doc = this.ownerDocument || this.document || this, attaches = dataPriv.access(doc, fix) - 1; 32531 attaches ? dataPriv.access(doc, fix, attaches
32531) : (doc.removeEventListener(orig, handler, !0), 32532 dataPriv.remove(doc, fix)); 32533 } 32534 }; 32535 }); 32536 var location = window.location, nonce = { 32537 guid: Date.now() 32538 }, rquery = /\?/; 32539 jQuery.parseXML = function(data) { 32540 var xml, parserErrorElem; 32541 if (!data || "string" != typeof data) return null; 32542 try { 32543 xml = new window.DOMParser().parseFromString(data, "text/xml"); 32544 } catch (e) {} 32545 return parserErrorElem = xml && xml.getElementsByTagName("parsererror")[0], xml && !parserErrorElem || jQuery.error("Invalid XML: " + (parserErrorElem ? jQuery.map(parserErrorElem.childNodes, function(el) { 32546 return el.textContent; 32547 }).join("\n") : data)), xml; 32548 }; 32549 var rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; 32550 function buildParams(prefix, obj, traditional, add) { 32551 var name; 32552 if (Array.isArray(obj)) jQuery.each(obj, function(i, v) { 32553 traditional || rbracket.test(prefix) ? add(prefix, v) : buildParams(prefix + "[" + ("object" == typeof v && null != v ? i : "") + "]", v, traditional, add); 32554 }); else if (traditional || "object" !== toType(obj)) add(prefix, obj); else for (name in obj) buildParams(prefix + "[" + name + "]", obj[name], traditional, add); 32555 } 32556 jQuery.param = function(a, traditional) { 32557 function add(key, valueOrFunction) { 32558 var value = isFunction(valueOrFunction) ? valueOrFunction() : valueOrFunction; 32559 s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(null == value ? "" : value); 32560 } 32561 var prefix, s = []; 32562 if (null == a) return ""; 32563 if (Array.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) jQuery.each(a, function() { 32564 add(this.name, this.value); 32565 }); else for (prefix in a) buildParams(prefix, a[prefix], traditional, add); 32566 return s.join("&"); 32567 }, jQuery.fn.extend({ 32568 serialize: function() { 32569 return jQuery.param(this.serializeArray()); 32570 }, 32571 serializeArray: function() { 32572 return this.map(function() { 32573 var elements = jQuery.prop(this, "elements"); 32574 return elements ? jQuery.makeArray(elements) : this; 32575 }).filter(function() { 32576 var type = this.type; 32577 return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !rcheckableType.test(type)); 32578 }).map(function(_i, elem) { 32579 var val = jQuery(this).val(); 32580 return null == val ? null : Array.isArray(val) ? jQuery.map(val, function(val) { 32581 return { 32582 name: elem.name, 32583 value: val.replace(rCRLF, "\r\n") 32584 }; 32585 }) : { 32586 name: elem.name, 32587 value: val.replace(rCRLF, "\r\n") 32588 }; 32589 }).get(); 32590 } 32591 }); 32592 var r20 = /%20/g, rhash = /#.*$/, rantiCache = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)$/gm, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, prefilters = {}, transports = {}, allTypes = "*/".concat("*"), originAnchor = document.createElement("a"); 32593 function addToPrefiltersOrTransports(structure) { 32594 return function(dataTypeExpression, func) { 32595 "string" != typeof dataTypeExpression && (func = dataTypeExpression, dataTypeExpression = "*"); 32596 var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match(rnothtmlwhite) || []; 32597 if (isFunction(func)) for (;dataType = dataTypes[i++]; ) "+" === dataType[0] ? (dataType = dataType.slice(1) || "*", 32598 (structure[dataType] = structure[dataType] || []).unshift(func)) : (structure[dataType] = structure[dataType] || []).push(func); 32599 }; 32600 }
vendor: 19,817 bytes, lines 32601-32882
32601 function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) { 32602 var inspected = {}, seekingTransport = structure === transports; 32603 function inspect(dataType) { 32604 var selected; 32605 return inspected[dataType] = !0, jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) { 32606 var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR); 32607 return "string" != typeof dataTypeOrTransport || seekingTransport || inspected[dataTypeOrTransport] ? seekingTransport ? !(selected = dataTypeOrTransport) : void 0 : (options.dataTypes.unshift(dataTypeOrTransport), 32608 inspect(dataTypeOrTransport), !1); 32609 }), selected; 32610 } 32611 return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*"); 32612 } 32613 function ajaxExtend(target, src) { 32614 var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {}; 32615 for (key in src) void 0 !== src[key] && ((flatOptions[key] ? target : deep = deep || {})[key] = src[key]); 32616 return deep && jQuery.extend(!0, target, deep), target; 32617 } 32618 originAnchor.href = location.href, jQuery.extend({ 32619 active: 0, 32620 lastModified: {}, 32621 etag: {}, 32622 ajaxSettings: { 32623 url: location.href, 32624 type: "GET", 32625 isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(location.protocol), 32626 global: !0, 32627 processData: !0, 32628 async: !0, 32629 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 32630 accepts: { 32631 "*": allTypes, 32632 text: "text/plain", 32633 html: "text/html", 32634 xml: "application/xml, text/xml", 32635 json: "application/json, text/javascript" 32636 }, 32637 contents: { 32638 xml: /\bxml\b/, 32639 html: /\bhtml/, 32640 json: /\bjson\b/ 32641 }, 32642 responseFields: { 32643 xml: "responseXML", 32644 text: "responseText", 32645 json: "responseJSON" 32646 }, 32647 converters: { 32648 "* text": String, 32649 "text html": !0, 32650 "text json": JSON.parse, 32651 "text xml": jQuery.parseXML 32652 }, 32653 flatOptions: { 32654 url: !0, 32655 context: !0 32656 } 32657 }, 32658 ajaxSetup: function(target, settings) { 32659 return settings ? ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) : ajaxExtend(jQuery.ajaxSettings, target); 32660 }, 32661 ajaxPrefilter: addToPrefiltersOrTransports(prefilters), 32662 ajaxTransport: addToPrefiltersOrTransports(transports), 32663 ajax: function(url, options) { 32664 "object" == typeof url && (options = url, url = void 0), options = options || {}; 32665 var transport, cacheURL, responseHeadersString, responseHeaders, timeoutTimer, urlAnchor, completed, fireGlobals, i, uncached, s = jQuery.ajaxSetup({}, options), callbackContext = s.context || s, globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event, deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), statusCode = s.statusCode || {}, requestHeaders = {}, requestHeadersNames = {}, strAbort = "canceled", jqXHR = { 32666 readyState: 0, 32667 getResponseHeader: function(key) { 32668 var match; 32669 if (completed) { 32670 if (!responseHeaders) for (responseHeaders = {}; match = rheaders.exec(responseHeadersString); ) responseHeaders[match[1].toLowerCase() + " "] = (responseHeaders[match[1].toLowerCase() + " "] || []).concat(match[2]); 32671 match = responseHeaders[key.toLowerCase() + " "]; 32672 } 32673 return null == match ? null : match.join(", "); 32674 }, 32675 getAllResponseHeaders: function() { 32676 return completed ? responseHeadersString : null; 32677 }, 32678 setRequestHeader: function(name, value) { 32679 return null == completed && (name = requestHeadersNames[name.toLowerCase()] = requestHeadersNames[name.toLowerCase()] || name, 32680 requestHeaders[name] = value), this; 32681 }, 32682 overrideMimeType: function(type) { 32683 return null == completed && (s.mimeType = type), this; 32684 }, 32685 statusCode: function(map) { 32686 var code; 32687 if (map) if (completed) jqXHR.always(map[jqXHR.status]); else for (code in map) statusCode[code] = [ statusCode[code], map[code] ]; 32688 return this; 32689 }, 32690 abort: function(statusText) { 32691 var finalText = statusText || strAbort; 32692 return transport && transport.abort(finalText), done(0, finalText), this; 32693 } 32694 }; 32695 if (deferred.promise(jqXHR), s.url = ((url || s.url || location.href) + "").replace(rprotocol, location.protocol + "//"), 32696 s.type = options.method || options.type || s.method || s.type, s.dataTypes = (s.dataType || "*").toLowerCase().match(rnothtmlwhite) || [ "" ], 32697 null == s.crossDomain) { 32698 urlAnchor = document.createElement("a"); 32699 try { 32700 urlAnchor.href = s.url, urlAnchor.href = urlAnchor.href, s.crossDomain = originAnchor.protocol + "//" + originAnchor.host != urlAnchor.protocol + "//" + urlAnchor.host; 32701 } catch (e) { 32702 s.crossDomain = !0; 32703 } 32704 } 32705 if (s.data && s.processData && "string" != typeof s.data && (s.data = jQuery.param(s.data, s.traditional)), 32706 inspectPrefiltersOrTransports(prefilters, s, options, jqXHR), completed) return jqXHR; 32707 for (i in (fireGlobals = jQuery.event && s.global) && 0 == jQuery.active++ && jQuery.event.trigger("ajaxStart"), 32708 s.type = s.type.toUpperCase(), s.hasContent = !rnoContent.test(s.type), cacheURL = s.url.replace(rhash, ""), 32709 s.hasContent ? s.data && s.processData && 0 === (s.contentType || "").indexOf("application/x-www-form-urlencoded") && (s.data = s.data.replace(r20, "+")) : (uncached = s.url.slice(cacheURL.length), 32710 s.data && (s.processData || "string" == typeof s.data) && (cacheURL += (rquery.test(cacheURL) ? "&" : "?") + s.data, 32711 delete s.data), !1 === s.cache && (cacheURL = cacheURL.replace(rantiCache, "$1"), 32712 uncached = (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce.guid++ + uncached), 32713 s.url = cacheURL + uncached), s.ifModified && (jQuery.lastModified[cacheURL] && jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]), 32714 jQuery.etag[cacheURL] && jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL])), 32715 (s.data && s.hasContent && !1 !== s.contentType || options.contentType) && jqXHR.setRequestHeader("Content-Type", s.contentType), 32716 jqXHR.setRequestHeader("Accept", s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + ("*" !== s.dataTypes[0] ? ", " + allTypes + "; q=0.01" : "") : s.accepts["*"]), 32717 s.headers) jqXHR.setRequestHeader(i, s.headers[i]); 32718 if (s.beforeSend && (!1 === s.beforeSend.call(callbackContext, jqXHR, s) || completed)) return jqXHR.abort(); 32719 if (strAbort = "abort", completeDeferred.add(s.complete), jqXHR.done(s.success), 32720 jqXHR.fail(s.error), transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR)) { 32721 if (jqXHR.readyState = 1, fireGlobals && globalEventContext.trigger("ajaxSend", [ jqXHR, s ]), 32722 completed) return jqXHR; 32723 s.async && 0 < s.timeout && (timeoutTimer = window.setTimeout(function() { 32724 jqXHR.abort("timeout"); 32725 }, s.timeout)); 32726 try { 32727 completed = !1, transport.send(requestHeaders, done); 32728 } catch (e) { 32729 if (completed) throw e; 32730 done(-1, e); 32731 } 32732 } else done(-1, "No Transport"); 32733 function done(status, nativeStatusText, responses, headers) { 32734 var isSuccess, success, error, response, modified, statusText = nativeStatusText; 32735 completed || (completed = !0, timeoutTimer && window.clearTimeout(timeoutTimer), 32736 transport = void 0, responseHeadersString = headers || "", jqXHR.readyState = 0 < status ? 4 : 0, 32737 isSuccess = 200 <= status && status < 300 || 304 === status, responses && (response = function(s, jqXHR, responses) { 32738 for (var ct, type, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes; "*" === dataTypes[0]; ) dataTypes.shift(), 32739 void 0 === ct && (ct = s.mimeType || jqXHR.getResponseHeader("Content-Type")); 32740 if (ct) for (type in contents) if (contents[type] && contents[type].test(ct)) { 32741 dataTypes.unshift(type); 32742 break; 32743 } 32744 if (dataTypes[0] in responses) finalDataType = dataTypes[0]; else { 32745 for (type in responses) { 32746 if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) { 32747 finalDataType = type; 32748 break; 32749 } 32750 firstDataType = firstDataType || type; 32751 } 32752 finalDataType = finalDataType || firstDataType; 32753 } 32754 if (finalDataType) return finalDataType !== dataTypes[0] && dataTypes.unshift(finalDataType), 32755 responses[finalDataType]; 32756 }(s, jqXHR, responses)), !isSuccess && -1 < jQuery.inArray("script", s.dataTypes) && jQuery.inArray("json", s.dataTypes) < 0 && (s.converters["text script"] = function() {}), 32757 response = function(s, response, jqXHR, isSuccess) { 32758 var conv2, current, conv, tmp, prev, converters = {}, dataTypes = s.dataTypes.slice(); 32759 if (dataTypes[1]) for (conv in s.converters) converters[conv.toLowerCase()] = s.converters[conv]; 32760 for (current = dataTypes.shift(); current; ) if (s.responseFields[current] && (jqXHR[s.responseFields[current]] = response), 32761 !prev && isSuccess && s.dataFilter && (response = s.dataFilter(response, s.dataType)), 32762 prev = current, current = dataTypes.shift()) if ("*" === current) current = prev; else if ("*" !== prev && prev !== current) { 32763 if (!(conv = converters[prev + " " + current] || converters["* " + current])) for (conv2 in converters) if ((tmp = conv2.split(" "))[1] === current && (conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]])) { 32764 !0 === conv ? conv = converters[conv2] : !0 !== converters[conv2] && (current = tmp[0], 32765 dataTypes.unshift(tmp[1])); 32766 break; 32767 } 32768 if (!0 !== conv) if (conv && s.throws) response = conv(response); else try { 32769 response = conv(response); 32770 } catch (e) { 32771 return { 32772 state: "parsererror", 32773 error: conv ? e : "No conversion from " + prev + " to " + current 32774 }; 32775 } 32776 } 32777 return { 32778 state: "success", 32779 data: response 32780 }; 32781 }(s, response, jqXHR, isSuccess), isSuccess ? (s.ifModified && ((modified = jqXHR.getResponseHeader("Last-Modified")) && (jQuery.lastModified[cacheURL] = modified), 32782 (modified = jqXHR.getResponseHeader("etag")) && (jQuery.etag[cacheURL] = modified)), 32783 204 === status || "HEAD" === s.type ? statusText = "nocontent" : 304 === status ? statusText = "notmodified" : (statusText = response.state, 32784 success = response.data, isSuccess = !(error = response.error))) : (error = statusText, 32785 !status && statusText || (statusText = "error", status < 0 && (status = 0))), jqXHR.status = status, 32786 jqXHR.statusText = (nativeStatusText || statusText) + "", isSuccess ? deferred.resolveWith(callbackContext, [ success, statusText, jqXHR ]) : deferred.rejectWith(callbackContext, [ jqXHR, statusText, error ]), 32787 jqXHR.statusCode(statusCode), statusCode = void 0, fireGlobals && globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ]), 32788 completeDeferred.fireWith(callbackContext, [ jqXHR, statusText ]), fireGlobals && (globalEventContext.trigger("ajaxComplete", [ jqXHR, s ]), 32789 --jQuery.active || jQuery.event.trigger("ajaxStop"))); 32790 } 32791 return jqXHR; 32792 }, 32793 getJSON: function(url, data, callback) { 32794 return jQuery.get(url, data, callback, "json"); 32795 }, 32796 getScript: function(url, callback) { 32797 return jQuery.get(url, void 0, callback, "script"); 32798 } 32799 }), jQuery.each([ "get", "post" ], function(_i, method) { 32800 jQuery[method] = function(url, data, callback, type) { 32801 return isFunction(data) && (type = type || callback, callback = data, data = void 0), 32802 jQuery.ajax(jQuery.extend({ 32803 url: url, 32804 type: method, 32805 dataType: type, 32806 data: data, 32807 success: callback 32808 }, jQuery.isPlainObject(url) && url)); 32809 }; 32810 }), jQuery.ajaxPrefilter(function(s) { 32811 var i; 32812 for (i in s.headers) "content-type" === i.toLowerCase() && (s.contentType = s.headers[i] || ""); 32813 }), jQuery._evalUrl = function(url, options, doc) { 32814 return jQuery.ajax({ 32815 url: url, 32816 type: "GET", 32817 dataType: "script", 32818 cache: !0, 32819 async: !1, 32820 global: !1, 32821 converters: { 32822 "text script": function() {} 32823 }, 32824 dataFilter: function(response) { 32825 jQuery.globalEval(response, options, doc); 32826 } 32827 }); 32828 }, jQuery.fn.extend({ 32829 wrapAll: function(html) { 32830 var wrap; 32831 return this[0] && (isFunction(html) && (html = html.call(this[0])), wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(!0), 32832 this[0].parentNode && wrap.insertBefore(this[0]), wrap.map(function() { 32833 for (var elem = this; elem.firstElementChild; ) elem = elem.firstElementChild; 32834 return elem; 32835 }).append(this)), this; 32836 }, 32837 wrapInner: function(html) { 32838 return isFunction(html) ? this.each(function(i) { 32839 jQuery(this).wrapInner(html.call(this, i)); 32840 }) : this.each(function() { 32841 var self = jQuery(this), contents = self.contents(); 32842 contents.length ? contents.wrapAll(html) : self.append(html); 32843 }); 32844 }, 32845 wrap: function(html) { 32846 var htmlIsFunction = isFunction(html); 32847 return this.each(function(i) { 32848 jQuery(this).wrapAll(htmlIsFunction ? html.call(this, i) : html); 32849 }); 32850 }, 32851 unwrap: function(selector) { 32852 return this.parent(selector).not("body").each(function() { 32853 jQuery(this).replaceWith(this.childNodes); 32854 }), this; 32855 } 32856 }), jQuery.expr.pseudos.hidden = function(elem) { 32857 return !jQuery.expr.pseudos.visible(elem); 32858 }, jQuery.expr.pseudos.visible = function(elem) { 32859 return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length); 32860 }, jQuery.ajaxSettings.xhr = function() { 32861 try { 32862 return new window.XMLHttpRequest(); 32863 } catch (e) {} 32864 }; 32865 var xhrSuccessStatus = { 32866 0: 200, 32867 1223: 204 32868 }, xhrSupported = jQuery.ajaxSettings.xhr(); 32869 support.cors = !!xhrSupported && "withCredentials" in xhrSupported, support.ajax = xhrSupported = !!xhrSupported, 32870 jQuery.ajaxTransport(function(options) { 32871 var callback, errorCallback; 32872 if (support.cors || xhrSupported && !options.crossDomain) return { 32873 send: function(headers, complete) { 32874 var i, xhr = options.xhr(); 32875 if (xhr.open(options.type, options.url, options.async, options.username, options.password), 32876 options.xhrFields) for (i in options.xhrFields) xhr[i] = options.xhrFields[i]; 32877 for (i in options.mimeType && xhr.overrideMimeType && xhr.overrideMimeType(options.mimeType), 32878 options.crossDomain || headers["X-Requested-With"] || (headers["X-Requested-With"] = "XMLHttpRequest"), 32879 headers) xhr.setRequestHeader(i, headers[i]); 32880 callback = function(type) { 32881 return function() { 32882 callback && (callback = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.ontimeout = x
vendor: 8,387 bytes, lines 32882-32998
32882hr.onreadystatechange = null, 32883 "abort" === type ? xhr.abort() : "error" === type ? "number" != typeof xhr.status ? complete(0, "error") : complete(xhr.status, xhr.statusText) : complete(xhrSuccessStatus[xhr.status] || xhr.status, xhr.statusText, "text" !== (xhr.responseType || "text") || "string" != typeof xhr.responseText ? { 32884 binary: xhr.response 32885 } : { 32886 text: xhr.responseText 32887 }, xhr.getAllResponseHeaders())); 32888 }; 32889 }, xhr.onload = callback(), errorCallback = xhr.onerror = xhr.ontimeout = callback("error"), 32890 void 0 !== xhr.onabort ? xhr.onabort = errorCallback : xhr.onreadystatechange = function() { 32891 4 === xhr.readyState && window.setTimeout(function() { 32892 callback && errorCallback(); 32893 }); 32894 }, callback = callback("abort"); 32895 try { 32896 xhr.send(options.hasContent && options.data || null); 32897 } catch (e) { 32898 if (callback) throw e; 32899 } 32900 }, 32901 abort: function() { 32902 callback && callback(); 32903 } 32904 }; 32905 }), jQuery.ajaxPrefilter(function(s) { 32906 s.crossDomain && (s.contents.script = !1); 32907 }), jQuery.ajaxSetup({ 32908 accepts: { 32909 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" 32910 }, 32911 contents: { 32912 script: /\b(?:java|ecma)script\b/ 32913 }, 32914 converters: { 32915 "text script": function(text) { 32916 return jQuery.globalEval(text), text; 32917 } 32918 } 32919 }), jQuery.ajaxPrefilter("script", function(s) { 32920 void 0 === s.cache && (s.cache = !1), s.crossDomain && (s.type = "GET"); 32921 }), jQuery.ajaxTransport("script", function(s) { 32922 var script, callback; 32923 if (s.crossDomain || s.scriptAttrs) return { 32924 send: function(_, complete) { 32925 script = jQuery("<script>").attr(s.scriptAttrs || {}).prop({ 32926 charset: s.scriptCharset, 32927 src: s.url 32928 }).on("load error", callback = function(evt) { 32929 script.remove(), callback = null, evt && complete("error" === evt.type ? 404 : 200, evt.type); 32930 }), document.head.appendChild(script[0]); 32931 }, 32932 abort: function() { 32933 callback && callback(); 32934 } 32935 }; 32936 }); 32937 var body, oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; 32938 jQuery.ajaxSetup({ 32939 jsonp: "callback", 32940 jsonpCallback: function() { 32941 var callback = oldCallbacks.pop() || jQuery.expando + "_" + nonce.guid++; 32942 return this[callback] = !0, callback; 32943 } 32944 }), jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) { 32945 var callbackName, overwritten, responseContainer, jsonProp = !1 !== s.jsonp && (rjsonp.test(s.url) ? "url" : "string" == typeof s.data && 0 === (s.contentType || "").indexOf("application/x-www-form-urlencoded") && rjsonp.test(s.data) && "data"); 32946 if (jsonProp || "jsonp" === s.dataTypes[0]) return callbackName = s.jsonpCallback = isFunction(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback, 32947 jsonProp ? s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName) : !1 !== s.jsonp && (s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName), 32948 s.converters["script json"] = function() { 32949 return responseContainer || jQuery.error(callbackName + " was not called"), responseContainer[0]; 32950 }, s.dataTypes[0] = "json", overwritten = window[callbackName], window[callbackName] = function() { 32951 responseContainer = arguments; 32952 }, jqXHR.always(function() { 32953 void 0 === overwritten ? jQuery(window).removeProp(callbackName) : window[callbackName] = overwritten, 32954 s[callbackName] && (s.jsonpCallback = originalSettings.jsonpCallback, oldCallbacks.push(callbackName)), 32955 responseContainer && isFunction(overwritten) && overwritten(responseContainer[0]), 32956 responseContainer = overwritten = void 0; 32957 }), "script"; 32958 }), support.createHTMLDocument = ((body = document.implementation.createHTMLDocument("").body).innerHTML = "<form></form><form></form>", 32959 2 === body.childNodes.length), jQuery.parseHTML = function(data, context, keepScripts) { 32960 return "string" != typeof data ? [] : ("boolean" == typeof context && (keepScripts = context, 32961 context = !1), context || (support.createHTMLDocument ? ((base = (context = document.implementation.createHTMLDocument("")).createElement("base")).href = document.location.href, 32962 context.head.appendChild(base)) : context = document), scripts = !keepScripts && [], 32963 (parsed = rsingleTag.exec(data)) ? [ context.createElement(parsed[1]) ] : (parsed = buildFragment([ data ], context, scripts), 32964 scripts && scripts.length && jQuery(scripts).remove(), jQuery.merge([], parsed.childNodes))); 32965 var base, parsed, scripts; 32966 }, jQuery.fn.load = function(url, params, callback) { 32967 var selector, type, response, self = this, off = url.indexOf(" "); 32968 return -1 < off && (selector = stripAndCollapse(url.slice(off)), url = url.slice(0, off)), 32969 isFunction(params) ? (callback = params, params = void 0) : params && "object" == typeof params && (type = "POST"), 32970 0 < self.length && jQuery.ajax({ 32971 url: url, 32972 type: type || "GET", 32973 dataType: "html", 32974 data: params 32975 }).done(function(responseText) { 32976 response = arguments, self.html(selector ? jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) : responseText); 32977 }).always(callback && function(jqXHR, status) { 32978 self.each(function() { 32979 callback.apply(this, response || [ jqXHR.responseText, status, jqXHR ]); 32980 }); 32981 }), this; 32982 }, jQuery.expr.pseudos.animated = function(elem) { 32983 return jQuery.grep(jQuery.timers, function(fn) { 32984 return elem === fn.elem; 32985 }).length; 32986 }, jQuery.offset = { 32987 setOffset: function(elem, options, i) { 32988 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, position = jQuery.css(elem, "position"), curElem = jQuery(elem), props = {}; 32989 "static" === position && (elem.style.position = "relative"), curOffset = curElem.offset(), 32990 curCSSTop = jQuery.css(elem, "top"), curCSSLeft = jQuery.css(elem, "left"), curLeft = ("absolute" === position || "fixed" === position) && -1 < (curCSSTop + curCSSLeft).indexOf("auto") ? (curTop = (curPosition = curElem.position()).top, 32991 curPosition.left) : (curTop = parseFloat(curCSSTop) || 0, parseFloat(curCSSLeft) || 0), 32992 isFunction(options) && (options = options.call(elem, i, jQuery.extend({}, curOffset))), 32993 null != options.top && (props.top = options.top - curOffset.top + curTop), null != options.left && (props.left = options.left - curOffset.left + curLeft), 32994 "using" in options ? options.using.call(elem, props) : curElem.css(props); 32995 } 32996 }, jQuery.fn.extend({ 32997 offset: function(options) { 32998 if (arguments.length) return void 0 === options ? this
vendor: 4,179 bytes, lines 32998-33064
32998: this.each(function(i) { 32999 jQuery.offset.setOffset(this, options, i); 33000 }); 33001 var rect, win, elem = this[0]; 33002 return elem ? elem.getClientRects().length ? (rect = elem.getBoundingClientRect(), 33003 win = elem.ownerDocument.defaultView, { 33004 top: rect.top + win.pageYOffset, 33005 left: rect.left + win.pageXOffset 33006 }) : { 33007 top: 0, 33008 left: 0 33009 } : void 0; 33010 }, 33011 position: function() { 33012 if (this[0]) { 33013 var offsetParent, offset, doc, elem = this[0], parentOffset = { 33014 top: 0, 33015 left: 0 33016 }; 33017 if ("fixed" === jQuery.css(elem, "position")) offset = elem.getBoundingClientRect(); else { 33018 for (offset = this.offset(), doc = elem.ownerDocument, offsetParent = elem.offsetParent || doc.documentElement; offsetParent && (offsetParent === doc.body || offsetParent === doc.documentElement) && "static" === jQuery.css(offsetParent, "position"); ) offsetParent = offsetParent.parentNode; 33019 offsetParent && offsetParent !== elem && 1 === offsetParent.nodeType && ((parentOffset = jQuery(offsetParent).offset()).top += jQuery.css(offsetParent, "borderTopWidth", !0), 33020 parentOffset.left += jQuery.css(offsetParent, "borderLeftWidth", !0)); 33021 } 33022 return { 33023 top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", !0), 33024 left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", !0) 33025 }; 33026 } 33027 }, 33028 offsetParent: function() { 33029 return this.map(function() { 33030 for (var offsetParent = this.offsetParent; offsetParent && "static" === jQuery.css(offsetParent, "position"); ) offsetParent = offsetParent.offsetParent; 33031 return offsetParent || documentElement; 33032 }); 33033 } 33034 }), jQuery.each({ 33035 scrollLeft: "pageXOffset", 33036 scrollTop: "pageYOffset" 33037 }, function(method, prop) { 33038 var top = "pageYOffset" === prop; 33039 jQuery.fn[method] = function(val) { 33040 return access(this, function(elem, method, val) { 33041 var win; 33042 if (isWindow(elem) ? win = elem : 9 === elem.nodeType && (win = elem.defaultView), 33043 void 0 === val) return win ? win[prop] : elem[method]; 33044 win ? win.scrollTo(top ? win.pageXOffset : val, top ? val : win.pageYOffset) : elem[method] = val; 33045 }, method, val, arguments.length); 33046 }; 33047 }), jQuery.each([ "top", "left" ], function(_i, prop) { 33048 jQuery.cssHooks[prop] = addGetHookIf(support.pixelPosition, function(elem, computed) { 33049 if (computed) return computed = curCSS(elem, prop), rnumnonpx.test(computed) ? jQuery(elem).position()[prop] + "px" : computed; 33050 }); 33051 }), jQuery.each({ 33052 Height: "height", 33053 Width: "width" 33054 }, function(name, type) { 33055 jQuery.each({ 33056 padding: "inner" + name, 33057 content: type, 33058 "": "outer" + name 33059 }, function(defaultExtra, funcName) { 33060 jQuery.fn[funcName] = function(margin, value) { 33061 var chainable = arguments.length && (defaultExtra || "boolean" != typeof margin), extra = defaultExtra || (!0 === margin || !0 === value ? "margin" : "border"); 33062 return access(this, function(elem, type, value) { 33063 var doc; 33064 return isWindow(elem) ? 0 === funcName.indexOf("outer") ? elem["inner" + n
33064ame] : elem.document.documentElement["client" + name] : 9 === elem.nodeType ? (doc = elem.documentElement, 33065 Math.max(elem.body["scroll" + name], doc["scroll" + name], elem.body["offset" + name], doc["offset" + name], doc["client" + name])) : void 0 === value ? jQuery.css(elem, type, extra) : jQuery.style(elem, type, value, extra); 33066 }, type, chainable ? margin : void 0, chainable); 33067 }; 33068 }); 33069 }), jQuery.each([ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function(_i, type) { 33070 jQuery.fn[type] = function(fn) { 33071 return this.on(type, fn); 33072 }; 33073 }), jQuery.fn.extend({ 33074 bind: function(types, data, fn) { 33075 return this.on(types, null, data, fn); 33076 }, 33077 unbind: function(types, fn) { 33078 return this.off(types, null, fn); 33079 }, 33080 delegate: function(selector, types, data, fn) { 33081 return this.on(types, selector, data, fn); 33082 }, 33083 undelegate: function(selector, types, fn) { 33084 return 1 === arguments.length ? this.off(selector, "**") : this.off(types, selector || "**", fn); 33085 }, 33086 hover: function(fnOver, fnOut) { 33087 return this.mouseenter(fnOver).mouseleave(fnOut || fnOver); 33088 } 33089 }), jQuery.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "), function(_i, name) { 33090 jQuery.fn[name] = function(data, fn) { 33091 return 0 < arguments.length ? this.on(name, null, data, fn) : this.trigger(name); 33092 }; 33093 }); 33094 var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; 33095 jQuery.proxy = function(fn, context) { 33096 var tmp, args, proxy; 33097 if ("string" == typeof context && (tmp = fn[context], context = fn, fn = tmp), isFunction(fn)) return args = slice.call(arguments, 2), 33098 (proxy = function() { 33099 return fn.apply(context || this, args.concat(slice.call(arguments))); 33100 }).guid = fn.guid = fn.guid || jQuery.guid++, proxy; 33101 }, jQuery.holdReady = function(hold) { 33102 hold ? jQuery.readyWait++ : jQuery.ready(!0); 33103 }, jQuery.isArray = Array.isArray, jQuery.parseJSON = JSON.parse, jQuery.nodeName = nodeName, 33104 jQuery.isFunction = isFunction, jQuery.isWindow = isWindow, jQuery.camelCase = camelCase, 33105 jQuery.type = toType, jQuery.now = Date.now, jQuery.isNumeric = function(obj) { 33106 var type = jQuery.type(obj); 33107 return ("number" === type || "string" === type) && !isNaN(obj - parseFloat(obj)); 33108 }, jQuery.trim = function(text) { 33109 return null == text ? "" : (text + "").replace(rtrim, ""); 33110 }, "function" == typeof define && define.amd && define("jquery", [], function() { 33111 return jQuery; 33112 }); 33113 var _jQuery = window.jQuery, _$ = window.$; 33114 return jQuery.noConflict = function(deep) { 33115 return window.$ === jQuery && (window.$ = _$), deep && window.jQuery === jQuery && (window.jQuery = _jQuery), 33116 jQuery; 33117 }, void 0 === noGlobal && (window.jQuery = window.$ = jQuery), jQuery; 33118 }); 33119 }, {} ], 33120 283: [ function(require, module, exports) { 33121 !function(window, factory) { 33122 "function" == typeof define && define.amd ? define([ "outlayer/outlayer", "get-size/get-size" ], factory) : "object" == typeof module && module.exports ? module.exports = factory(require("outlayer"), require("get-size")) : window.Masonry = factory(window.Outlayer, window.getSize); 33123 }(window, function(Outlayer, getSize) { 33124 "use strict"; 33125 var Masonry = Outlayer.create("masonry"); 33126 Masonry.compatOptions.fitWidth = "isFitWidth"; 33127 var proto = Masonry.prototype; 33128 return proto._resetLayout = function() {
33129 this.getSize(), this._getMeasurement("columnWidth", "outerWidth"), this._getMeasurement("gutter", "outerWidth"), 33130 this.measureColumns(), this.colYs = []; 33131 for (var i = 0; i < this.cols; i++) this.colYs.push(0); 33132 this.maxY = 0, this.horizontalColIndex = 0; 33133 }, proto.measureColumns = function() { 33134 if (this.getContainerWidth(), !this.columnWidth) { 33135 var firstItem = this.items[0], firstItemElem = firstItem && firstItem.element; 33136 this.columnWidth = firstItemElem && getSize(firstItemElem).outerWidth || this.containerWidth; 33137 } 33138 var columnWidth = this.columnWidth += this.gutter, containerWidth = this.containerWidth + this.gutter, cols = containerWidth / columnWidth, excess = columnWidth - containerWidth % columnWidth; 33139 cols = Math[excess && excess < 1 ? "round" : "floor"](cols), this.cols = Math.max(cols, 1); 33140 }, proto.getContainerWidth = function() { 33141 var container = this._getOption("fitWidth") ? this.element.parentNode : this.element, size = getSize(container); 33142 this.containerWidth = size && size.innerWidth; 33143 }, proto._getItemLayoutPosition = function(item) { 33144 item.getSize(); 33145 var remainder = item.size.outerWidth % this.columnWidth, colSpan = Math[remainder && remainder < 1 ? "round" : "ceil"](item.size.outerWidth / this.columnWidth); 33146 colSpan = Math.min(colSpan, this.cols); 33147 for (var colPosition = this[this.options.horizontalOrder ? "_getHorizontalColPosition" : "_getTopColPosition"](colSpan, item), position = { 33148 x: this.columnWidth * colPosition.col, 33149 y: colPosition.y 33150 }, setHeight = colPosition.y + item.size.outerHeight, setMax = colSpan + colPosition.col, i = colPosition.col; i < setMax; i++) this.colYs[i] = setHeight; 33151 return position; 33152 }, proto._getTopColPosition = function(colSpan) { 33153 var colGroup = this._getTopColGroup(colSpan), minimumY = Math.min.apply(Math, colGroup); 33154 return { 33155 col: colGroup.indexOf(minimumY), 33156 y: minimumY 33157 }; 33158 }, proto._getTopColGroup = function(colSpan) { 33159 if (colSpan < 2) return this.colYs; 33160 for (var colGroup = [], groupCount = this.cols + 1 - colSpan, i = 0; i < groupCount; i++) colGroup[i] = this._getColGroupY(i, colSpan); 33161 return colGroup; 33162 }, proto._getColGroupY = function(col, colSpan) { 33163 if (colSpan < 2) return this.colYs[col]; 33164 var groupColYs = this.colYs.slice(col, col + colSpan); 33165 return Math.max.apply(Math, groupColYs); 33166 }, proto._getHorizontalColPosition = function(colSpan, item) { 33167 var col = this.horizontalColIndex % this.cols; 33168 col = 1 < colSpan && col + colSpan > this.cols ? 0 : col; 33169 var hasSize = item.size.outerWidth && item.size.outerHeight; 33170 return this.horizontalColIndex = hasSize ? col + colSpan : this.horizontalColIndex, 33171 { 33172 col: col, 33173 y: this._getColGroupY(col, colSpan) 33174 }; 33175 }, proto._manageStamp = function(stamp) { 33176 var stampSize = getSize(stamp), offset = this._getElementOffset(stamp), firstX = this._getOption("originLeft") ? offset.left : offset.right, lastX = firstX + stampSize.outerWidth, firstCol = Math.floor(firstX / this.columnWidth); 33177 firstCol = Math.max(0, firstCol); 33178 var lastCol = Math.floor(lastX / this.columnWidth); 33179 lastCol -= lastX % this.columnWidth ? 0 : 1, lastCol = Math.min(this.cols - 1, lastCol); 33180 for (var stampMaxY = (this._getOption("originTop") ? offset.top : offset.bottom) + stampSize.outerHeight, i = firstCol; i <= lastCol; i++) this.colYs[i] = Math.max(stampMaxY, this.colYs[i]); 33181 }, proto._getContainerSize = function() { 33182 this.maxY = Math.max.apply(Math, this.colYs); 33183 var size = { 33184 height: this.maxY 33185 }; 33186 return this._getOption("fitWidth") && (size.width = this._getContainerFitWidth()), 33187 size; 33188 }, proto._getContainerFitWidth = function() { 33189 for (var unusedCols = 0, i = this.cols; --i && 0 === this.colYs[i]; ) unusedCols++; 33190 return (this.cols - unusedCols) * this.columnWidth - this.gutter; 33191 }, proto.needsResizeLayout = function() { 33192 var previousWidth = this.containerWidth; 33193 return this.getContainerWidth(), previousWidth != this.containerWidth; 33194 }, Masonry; 33195 }); 33196 }, {
33197 "get-size": 280, 33198 outlayer: 286 33199 } ], 33200 284: [ function(require, module, exports) { 33201 var factory; 33202 factory = function() { 33203 "use strict"; 33204 var VERSION = "14.0.2"; 33205 function removeElement(el) { 33206 el.parentElement.removeChild(el); 33207 } 33208 function isSet(value) { 33209 return null != value; 33210 } 33211 function preventDefault(e) { 33212 e.preventDefault(); 33213 } 33214 function isNumeric(a) { 33215 return "number" == typeof a && !isNaN(a) && isFinite(a); 33216 } 33217 function addClassFor(element, className, duration) { 33218 0 < duration && (addClass(element, className), setTimeout(function() { 33219 removeClass(element, className); 33220 }, duration)); 33221 } 33222 function limit(a) { 33223 return Math.max(Math.min(a, 100), 0); 33224 } 33225 function asArray(a) { 33226 return Array.isArray(a) ? a : [ a ]; 33227 } 33228 function countDecimals(numStr) { 33229 var pieces = (numStr = String(numStr)).split("."); 33230 return 1 < pieces.length ? pieces[1].length : 0; 33231 } 33232 function addClass(el, className) { 33233 el.classList ? el.classList.add(className) : el.className += " " + className; 33234 } 33235 function removeClass(el, className) { 33236 el.classList ? el.classList.remove(className) : el.className = el.className.replace(new RegExp("(^|\\b)" + className.split(" ").join("|") + "(\\b|$)", "gi"), " "); 33237 } 33238 function getPageOffset(doc) { 33239 var supportPageOffset = void 0 !== window.pageXOffset, isCSS1Compat = "CSS1Compat" === (doc.compatMode || ""); 33240 return { 33241 x: supportPageOffset ? window.pageXOffset : isCSS1Compat ? doc.documentElement.scrollLeft : doc.body.scrollLeft, 33242 y: supportPageOffset ? window.pageYOffset : isCSS1Compat ? doc.documentElement.scrollTop : doc.body.scrollTop 33243 }; 33244 } 33245 function subRangeRatio(pa, pb) { 33246 return 100 / (pb - pa); 33247 } 33248 function fromPercentage(range, value) { 33249 return 100 * value / (range[1] - range[0]); 33250 } 33251 function getJ(value, arr) { 33252 for (var j = 1; value >= arr[j]; ) j += 1; 33253 return j; 33254 } 33255 function toStepping(xVal, xPct, value) { 33256 if (value >= xVal.slice(-1)[0]) return 100; 33257 var j = getJ(value, xVal), va = xVal[j - 1], vb = xVal[j], pa = xPct[j - 1], pb = xPct[j]; 33258 return pa + function(range, value) { 33259 return fromPercentage(range, range[0] < 0 ? value + Math.abs(range[0]) : value - range[0]); 33260 }([ va, vb ], value) / subRangeRatio(pa, pb); 33261 } 33262 function getStep(xPct, xSteps, snap, value) { 33263 if (100 === value) return value; 33264 var j = getJ(value, xPct), a = xPct[j - 1], b = xPct[j]; 33265 return snap ? (b - a) / 2 < value - a ? b : a : xSteps[j - 1] ? xPct[j - 1] + function(value, to) { 33266 return Math.round(value / to) * to; 33267 }(value - xPct[j - 1], xSteps[j - 1]) : value; 33268 } 33269 function handleEntryPoint(index, value, that) { 33270 var percentage; 33271 if ("number" == typeof value && (value = [ value ]), !Array.isArray(value)) throw new Error("noUiSlider (" + VERSION + "): 'range' contains invalid value."); 33272 if (!isNumeric(percentage = "min" === index ? 0 : "max" === index ? 100 : parseFloat(index)) || !isNumeric(value[0])) throw new Error("noUiSlider (" + VERSION + "): 'range' value isn't numeric."); 33273 that.xPct.push(percentage), that.xVal.push(value[0]), percentage ? that.xSteps.push(!isNaN(value[1]) && value[1]) : isNaN(value[1]) || (that.xSteps[0] = value[1]), 33274 that.xHighestCompleteStep.push(0); 33275 } 33276 function handleStepPoint(i, n, that) { 33277 if (n) if (that.xVal[i] !== that.xVal[i + 1]) { 33278 that.xSteps[i] = fromPercentage([ that.xVal[i], that.xVal[i + 1] ], n) / subRangeRatio(that.xPct[i], that.xPct[i + 1]); 33279 var totalSteps = (that.xVal[i + 1] - that.xVal[i]) / that.xNumSteps[i], highe
33279stStep = Math.ceil(Number(totalSteps.toFixed(3)) - 1), step = that.xVal[i] + that.xNumSteps[i] * highestStep; 33280 that.xHighestCompleteStep[i] = step; 33281 } else that.xSteps[i] = that.xHighestCompleteStep[i] = that.xVal[i]; 33282 } 33283 function Spectrum(entry, snap, singleStep) { 33284 var index; 33285 this.xPct = [], this.xVal = [], this.xSteps = [ singleStep || !1 ], this.xNumSteps = [ !1 ], 33286 this.xHighestCompleteStep = [], this.snap = snap; 33287 var ordered = []; 33288 for (index in entry) entry.hasOwnProperty(index) && ordered.push([ entry[index], index ]); 33289 for (ordered.length && "object" == typeof ordered[0][0] ? ordered.sort(function(a, b) { 33290 return a[0][0] - b[0][0]; 33291 }) : ordered.sort(function(a, b) { 33292 return a[0] - b[0]; 33293 }), index = 0; index < ordered.length; index++) handleEntryPoint(ordered[index][1], ordered[index][0], this); 33294 for (this.xNumSteps = this.xSteps.slice(0), index = 0; index < this.xNumSteps.length; index++) handleStepPoint(index, this.xNumSteps[index], this); 33295 } 33296 Spectrum.prototype.getMargin = function(value) { 33297 var step = this.xNumSteps[0]; 33298 if (step && value / step % 1 != 0) throw new Error("noUiSlider (" + VERSION + "): 'limit', 'margin' and 'padding' must be divisible by step."); 33299 return 2 === this.xPct.length && fromPercentage(this.xVal, value); 33300 }, Spectrum.prototype.toStepping = function(value) { 33301 return value = toStepping(this.xVal, this.xPct, value); 33302 }, Spectrum.prototype.fromStepping = function(value) { 33303 return function(xVal, xPct, value) { 33304 if (100 <= value) return xVal.slice(-1)[0]; 33305 var j = getJ(value, xPct), va = xVal[j - 1], vb = xVal[j], pa = xPct[j - 1]; 33306 return function(range, value) { 33307 return value * (range[1] - range[0]) / 100 + range[0]; 33308 }([ va, vb ], (value - pa) * subRangeRatio(pa, xPct[j])); 33309 }(this.xVal, this.xPct, value); 33310 }, Spectrum.prototype.getStep = function(value) { 33311 return value = getStep(this.xPct, this.xSteps, this.snap, value); 33312 }, Spectrum.prototype.getDefaultStep = function(value, isDown, size) { 33313 var j = getJ(value, this.xPct); 33314 return (100 === value || isDown && value === this.xPct[j - 1]) && (j = Math.max(j - 1, 1)), 33315 (this.xVal[j] - this.xVal[j - 1]) / size; 33316 }, Spectrum.prototype.getNearbySteps = function(value) { 33317 var j = getJ(value, this.xPct); 33318 return { 33319 stepBefore: { 33320 startValue: this.xVal[j - 2], 33321 step: this.xNumSteps[j - 2], 33322 highestStep: this.xHighestCompleteStep[j - 2] 33323 }, 33324 thisStep: { 33325 startValue: this.xVal[j - 1], 33326 step: this.xNumSteps[j - 1], 33327 highestStep: this.xHighestCompleteStep[j - 1] 33328 }, 33329 stepAfter: { 33330 startValue: this.xVal[j], 33331 step: this.xNumSteps[j], 33332 highestStep: this.xHighestCompleteStep[j] 33333 } 33334 }; 33335 }, Spectrum.prototype.countStepDecimals = function() { 33336 var stepDecimals = this.xNumSteps.map(countDecimals); 33337 return Math.max.apply(null, stepDecimals); 33338 }, Spectrum.prototype.convert = function(value) { 33339 return this.getStep(this.toStepping(value)); 33340 }; 33341 var defaultFormatter = { 33342 to: function(value) { 33343 return void 0 !== value && value.toFixed(2); 33344 }, 33345 from: Number 33346 }; 33347 function validateFormat(entry) { 33348 if (function(entry) { 33349 return "object" == typeof entry && "function" == typeof entry.to && "function" == typeof entry.from; 33350 }(entry)) return !0; 33351 throw new Error("noUiSlider (" + VERSION + "): 'format' requires 'to' and 'from' methods."); 33352 } 33353 function testStep(parsed, entry) { 33354 if (!isNumeric(entry)) throw new Error("noUiSlider (" + VERSION + "): 'step' is not numeric."); 33355 parsed.singleStep = entry; 33356 } 33357 function testRange(parsed, entry) { 33358 if ("object" != typeof entry || Array.isArray(entry)) throw new Error("noUiSlider (" + VERSION + "): 'range' is not an object."); 33359 if (void 0 === entry.min || void 0 === entry.max) throw new Error("noUiSlider (" + VERSION + "): Missing 'min' or 'max' in 'range'."); 33360 if (entry.min === entry.max) throw new Error("noUiSlider (" + VERSION + "): 'range' 'min' and 'max' cannot be equal."); 33361 parsed.spectrum = new Spectrum(entry, parsed.snap, parsed.singleStep); 33362 } 33363 function testStart(parsed, entry) { 33364 if (entry = asArray(entry), !Array.isArray(entry) || !entry.length) throw new Error("noUiSlider (" + VERSION + "): 'start' option is incorrect."); 33365 parsed.handles = entry.length, parsed.start = entry; 33366 } 33367 function testSnap(parsed, entry) { 33368 if ("boolean" != typeof (parsed.snap = entry)) throw new Error("noUiSlider (" + VERSION + "): 'snap' option must be a boolean."); 33369 } 33370 function testAnimate(parsed, entry) { 33371 if ("boolean" != typeof (parsed.animate = entry)) throw new Error("noUiSlider (" + VERSION + "): 'animate' option must be a boolean."); 33372 } 33373 function testAnimationDuration(parsed, entry) { 33374 if ("number" != typeof (parsed.animationDuration = entry)) throw new Error("noUiSlider (" + VERSION + "): 'animationDuration' option must be a number."); 33375 } 33376 function testConnect(parsed, entry) { 33377 var i, connect = [ !1 ]; 33378 if ("lower" === entry ? entry = [ !0, !1 ] : "upper" === entry && (entry = [ !1, !0 ]), 33379 !0 === entry || !1 === entry) { 33380 for (i = 1; i < parsed.handles; i++) connect.push(entry); 33381 connect.push(!1); 33382 } else { 33383 if (!Array.isArray(entry) || !entry.length || entry.length !== parsed.handles + 1) throw new Error("noUiSlider (" + VERSION + "): 'connect' option doesn't match handle count."); 33384 connect = entry; 33385 } 33386 parsed.connect = connect; 33387 } 33388 function testOrientation(parsed, entry) { 33389 switch (entry) { 33390 case "horizontal": 33391 parsed.ort = 0; 33392 break; 33393 33394 case "vertical": 33395 parsed.ort = 1; 33396 break; 33397 33398 default: 33399 throw new Error("noUiSlider (" + VERSION + "): 'orientation' option is invali
33399d."); 33400 } 33401 } 33402 function testMargin(parsed, entry) { 33403 if (!isNumeric(entry)) throw new Error("noUiSlider (" + VERSION + "): 'margin' option must be numeric."); 33404 if (0 !== entry && (parsed.margin = parsed.spectrum.getMargin(entry), !parsed.margin)) throw new Error("noUiSlider (" + VERSION + "): 'margin' option is only supported on linear sliders."); 33405 } 33406 function testLimit(parsed, entry) { 33407 if (!isNumeric(entry)) throw new Error("noUiSlider (" + VERSION + "): 'limit' option must be numeric."); 33408 if (parsed.limit = parsed.spectrum.getMargin(entry), !parsed.limit || parsed.handles < 2) throw new Error("noUiSlider (" + VERSION + "): 'limit' option is only supported on linear sliders with 2 or more handles."); 33409 } 33410 function testPadding(parsed, entry) { 33411 if (!isNumeric(entry) && !Array.isArray(entry)) throw new Error("noUiSlider (" + VERSION + "): 'padding' option must be numeric or array of exactly 2 numbers."); 33412 if (Array.isArray(entry) && 2 !== entry.length && !isNumeric(entry[0]) && !isNumeric(entry[1])) throw new Error("noUiSlider (" + VERSION + "): 'padding' option must be numeric or array of exactly 2 numbers."); 33413 if (0 !== entry) { 33414 if (Array.isArray(entry) || (entry = [ entry, entry ]), !(parsed.padding = [ parsed.spectrum.getMargin(entry[0]), parsed.spectrum.getMargin(entry[1]) ]) === parsed.padding[0] || !1 === parsed.padding[1]) throw new Error("noUiSlider (" + VERSION + "): 'padding' option is only supported on linear sliders."); 33415 if (parsed.padding[0] < 0 || parsed.padding[1] < 0) throw new Error("noUiSlider (" + VERSION + "): 'padding' option must be a positive number(s)."); 33416 if (100 < parsed.padding[0] + parsed.padding[1]) throw new Error("noUiSlider (" + VERSION + "): 'padding' option must not exceed 100% of the range."); 33417 } 33418 } 33419 function testDirection(parsed, entry) { 33420 switch (entry) { 33421 case "ltr": 33422 parsed.dir = 0; 33423 break; 33424 33425 case "rtl": 33426 parsed.dir = 1; 33427 break; 33428 33429 default: 33430 throw new Error("noUiSlider (" + VERSION + "): 'direction' option was not recognized."); 33431 } 33432 } 33433 function testBehaviour(parsed, entry) { 33434 if ("string" != typeof entry) throw new Error("noUiSlider (" + VERSION + "): 'behaviour' must be a string containing options."); 33435 var tap = 0 <= entry.indexOf("tap"), drag = 0 <= entry.indexOf("drag"), fixed = 0 <= entry.indexOf("fixed"), snap = 0 <= entry.indexOf("snap"), hover = 0 <= entry.indexOf("hover"), unconstrained = 0 <= entry.indexOf("unconstrained"); 33436 if (fixed) { 33437 if (2 !== parsed.handles) throw new Error("noUiSlider (" + VERSION + "): 'fixed' behaviour must be used with 2 handles"); 33438 testMargin(parsed, parsed.start[1] - parsed.start[0]); 33439 } 33440 if (unconstrained && (parsed.margin || parsed.limit)) throw new Error("noUiSlider (" + VERSION + "): 'unconstrained' behaviour cannot be used with margin or limit"); 33441 parsed.events = { 33442 tap: tap || snap, 33443 drag: drag, 33444 fixed: fixed, 33445 snap: snap, 33446 hover: hover, 33447 unconstrained: unconstrained 33448 }; 33449 } 33450 function testTooltips(parsed, entry) { 33451 if (!1 !== entry) if (!0 === entry) { 33452 parsed.tooltips = []; 33453 for (var i = 0; i < parsed.handles; i++) parsed.tooltips.push(!0); 33454 } else { 33455 if (parsed.tooltips = asArray(entry), parsed.tooltips.length !== parsed.handles) throw new Error("noUiSlider (" + VERSION + "): must pass a formatter for all handles."); 33456 parsed.tooltips.forEach(function(formatter) { 33457 if ("boolean" != typeof formatter && ("object" != typeof formatter || "function" != typeof formatter.to)) throw new Error("noUiSlider (" + VERSION + "): 'tooltips' must be passed a formatter or 'false'."); 33458 }); 33459 } 33460 } 33461 function testAriaFormat(parsed, entry) { 33462 validateFormat(parsed.ariaFormat = entry); 33463 } 33464 function testFormat(parsed, entry) { 33465 validateFormat(parsed.format = entry); 33466 } 33467 function testKeyboardSupport(parsed, entry) { 33468 if ("boolean" != typeof (parsed.keyboardSupport = entry)) throw new Error("noUiSlider (" + VERSION + "): 'keyboardSupport' option must be a boolean."); 33469 } 33470 function testDocumentElement(parsed, entry) { 33471 parsed.documentElement = entry; 33472 } 33473 function testCssPrefix(parsed, entry) { 33474 if ("string" != typeof entry && !1 !== entry) throw new Error("noUiSlider (" + VERSION + "): 'cssPrefix' must be a string or `false`."); 33475 parsed.cssPrefix = entry; 33476 }
33477 function testCssClasses(parsed, entry) { 33478 if ("object" != typeof entry) throw new Error("noUiSlider (" + VERSION + "): 'cssClasses' must be an object."); 33479 if ("string" == typeof parsed.cssPrefix) for (var key in parsed.cssClasses = {}, 33480 entry) entry.hasOwnProperty(key) && (parsed.cssClasses[key] = parsed.cssPrefix + entry[key]); else parsed.cssClasses = entry; 33481 } 33482 function testOptions(options) { 33483 var parsed = { 33484 margin: 0, 33485 limit: 0, 33486 padding: 0, 33487 animate: !0, 33488 animationDuration: 300, 33489 ariaFormat: defaultFormatter, 33490 format: defaultFormatter 33491 }, tests = { 33492 step: { 33493 r: !1, 33494 t: testStep 33495 }, 33496 start: { 33497 r: !0, 33498 t: testStart 33499 }, 33500 connect: { 33501 r: !0, 33502 t: testConnect 33503 }, 33504 direction: { 33505 r: !0, 33506 t: testDirection 33507 }, 33508 snap: { 33509 r: !1, 33510 t: testSnap 33511 }, 33512 animate: { 33513 r: !1, 33514 t: testAnimate 33515 }, 33516 animationDuration: { 33517 r: !1, 33518 t: testAnimationDuration 33519 }, 33520 range: { 33521 r: !0, 33522 t: testRange 33523 }, 33524 orientation: { 33525 r: !1, 33526 t: testOrientation 33527 }, 33528 margin: { 33529 r: !1, 33530 t: testMargin 33531 }, 33532 limit: { 33533 r: !1, 33534 t: testLimit 33535 }, 33536 padding: { 33537 r: !1, 33538 t: testPadding 33539 }, 33540 behaviour: { 33541 r: !0, 33542 t: testBehaviour 33543 }, 33544 ariaFormat: { 33545 r: !1, 33546 t: testAriaFormat 33547 }, 33548 format: { 33549 r: !1, 33550 t: testFormat 33551 }, 33552 tooltips: { 33553 r: !1, 33554 t: testTooltips 33555 }, 33556 keyboardSupport: { 33557 r: !0, 33558 t: testKeyboardSupport 33559 }, 33560 documentElement: { 33561 r: !1, 33562 t: testDocumentElement 33563 }, 33564 cssPrefix: { 33565 r: !0, 33566 t: testCssPrefix 33567 }, 33568 cssClasses: { 33569 r: !0,
33570 t: testCssClasses 33571 } 33572 }, defaults = { 33573 connect: !1, 33574 direction: "ltr", 33575 behaviour: "tap", 33576 orientation: "horizontal", 33577 keyboardSupport: !0, 33578 cssPrefix: "noUi-", 33579 cssClasses: { 33580 target: "target", 33581 base: "base", 33582 origin: "origin", 33583 handle: "handle", 33584 handleLower: "handle-lower", 33585 handleUpper: "handle-upper", 33586 touchArea: "touch-area", 33587 horizontal: "horizontal", 33588 vertical: "vertical", 33589 background: "background", 33590 connect: "connect", 33591 connects: "connects", 33592 ltr: "ltr", 33593 rtl: "rtl", 33594 draggable: "draggable", 33595 drag: "state-drag", 33596 tap: "state-tap", 33597 active: "active", 33598 tooltip: "tooltip", 33599 pips: "pips", 33600 pipsHorizontal: "pips-horizontal", 33601 pipsVertical: "pips-vertical", 33602 marker: "marker", 33603 markerHorizontal: "marker-horizontal", 33604 markerVertical: "marker-vertical", 33605 markerNormal: "marker-normal", 33606 markerLarge: "marker-large", 33607 markerSub: "marker-sub", 33608 value: "value", 33609 valueHorizontal: "value-horizontal", 33610 valueVertical: "value-vertical", 33611 valueNormal: "value-normal", 33612 valueLarge: "value-large", 33613 valueSub: "value-sub" 33614 } 33615 }; 33616 options.format && !options.ariaFormat && (options.ariaFormat = options.format), 33617 Object.keys(tests).forEach(function(name) { 33618 if (!isSet(options[name]) && void 0 === defaults[name]) { 33619 if (tests[name].r) throw new Error("noUiSlider (" + VERSION + "): '" + name + "' is required."); 33620 return !0; 33621 } 33622 tests[name].t(parsed, isSet(options[name]) ? options[name] : defaults[name]); 33623 }), parsed.pips = options.pips; 33624 var d = document.createElement("div"), msPrefix = void 0 !== d.style.msTransform, noPrefix = void 0 !== d.style.transform; 33625 parsed.transformRule = noPrefix ? "transform" : msPrefix ? "msTransform" : "webkitTransform"; 33626 return parsed.style = [ [ "left", "top" ], [ "right", "bottom" ] ][parsed.dir][parsed.ort], 33627 parsed; 33628 } 33629 function scope(target, options, originalOptions) { 33630 var scope_Base, scope_Handles, scope_Connects, scope_Pips, scope_Tooltips, scope_Self, behaviour, addTarget, actions = window.navigator.pointerEnabled ? { 33631 start: "pointerdown", 33632 move: "pointermove", 33633 end: "pointerup" 33634 } : window.navigator.msPointerEnabled ? { 33635 start: "MSPointerDown", 33636 move: "MSPointerMove", 33637 end: "MSPointerUp" 33638 } : { 33639 start: "mousedown touchstart", 33640 move: "mousemove touchmove", 33641 end: "mouseup touchend" 33642 }, supportsPassive = window.CSS && CSS.supports && CSS.supports("touch-action", "none") && function() { 33643 var supportsPassive = !1; 33644 try { 33645 var opts = Object.defineProperty({}, "passive", { 33646 get: function() { 33647 supportsPassive = !0; 33648 } 33649 }); 33650 window.addEventListener("test", null, opts); 33651 } catch (e) {} 33652 return supportsPassive; 33653 }(), scope_Target = target, scope_Spectrum = options.spectrum, scope_Values = [], scope_Locations = [], scope_HandleNumbers = [], scope_ActiveHandlesCount = 0, scope_Events = {}, scope_Document = target.ownerDocument, scope_DocumentElement = options.documentElement || scope_Document.documentElement, scope_Body = scope_Document.body, PIPS_NONE = -1, PIPS_NO_VALUE = 0, PIPS_LARGE_VALUE = 1, PIPS_SMALL_VALUE = 2, scope_DirOffset = "rtl" === scope_Document.dir || 1 === options.ort ? 0 : 100; 33654 function addNodeTo(addTarget, className) { 33655 var div = scope_Document.createElement("div"); 33656 return className && addClass(div, className), addTarget.appendChild(div), div; 33657 } 33658 function addOrigin(base, handleNumber) { 33659 var origin = addNodeTo(base, options.cssClasse
33659s.origin), handle = addNodeTo(origin, options.cssClasses.handle); 33660 return addNodeTo(handle, options.cssClasses.touchArea), handle.setAttribute("data-handle", handleNumber), 33661 options.keyboardSupport && (handle.setAttribute("tabindex", "0"), handle.addEventListener("keydown", function(event) { 33662 return function(event, handleNumber) { 33663 if (isSliderDisabled() || isHandleDisabled(handleNumber)) return !1; 33664 var horizontalKeys = [ "Left", "Right" ], verticalKeys = [ "Down", "Up" ]; 33665 options.dir && !options.ort ? horizontalKeys.reverse() : options.ort && !options.dir && verticalKeys.reverse(); 33666 var key = event.key.replace("Arrow", ""), isDown = key === verticalKeys[0] || key === horizontalKeys[0], isUp = key === verticalKeys[1] || key === horizontalKeys[1]; 33667 if (!isDown && !isUp) return !0; 33668 event.preventDefault(); 33669 var direction = isDown ? 0 : 1, step = getNextStepsForHandle(handleNumber)[direction]; 33670 if (null === step) return !1; 33671 !1 === step && (step = scope_Spectrum.getDefaultStep(scope_Locations[handleNumber], isDown, 10)); 33672 return step = Math.max(step, 1e-7), step *= isDown ? -1 : 1, setHandle(handleNumber, scope_Spectrum.toStepping(scope_Values[handleNumber] + step), !0, !0), 33673 fireEvent("slide", handleNumber), fireEvent("update", handleNumber), fireEvent("change", handleNumber), 33674 fireEvent("set", handleNumber), !1; 33675 }(event, handleNumber); 33676 })), handle.setAttribute("role", "slider"), handle.setAttribute("aria-orientation", options.ort ? "vertical" : "horizontal"), 33677 0 === handleNumber ? addClass(handle, options.cssClasses.handleLower) : handleNumber === options.handles - 1 && addClass(handle, options.cssClasses.handleUpper), 33678 origin; 33679 } 33680 function addConnect(base, add) { 33681 return !!add && addNodeTo(base, options.cssClasses.connect); 33682 } 33683 function addTooltip(handle, handleNumber) { 33684 return !!options.tooltips[handleNumber] && addNodeTo(handle.firstChild, options.cssClasses.tooltip); 33685 } 33686 function isSliderDisabled() { 33687 return scope_Target.hasAttribute("disabled"); 33688 } 33689 function isHandleDisabled(handleNumber) { 33690 return scope_Handles[handleNumber].hasAttribute("disabled"); 33691 } 33692 function removeTooltips() { 33693 scope_Tooltips && (removeEvent("update.tooltips"), scope_Tooltips.forEach(function(tooltip) { 33694 tooltip && removeElement(tooltip); 33695 }), scope_Tooltips = null); 33696 } 33697 function tooltips() { 33698 removeTooltips(), scope_Tooltips = scope_Handles.map(addTooltip), bindEvent("update.tooltips", function(values, handleNumber, unencoded) { 33699 if (scope_Tooltips[handleNumber]) { 33700 var formattedValue = values[handleNumber]; 33701 !0 !== options.tooltips[handleNumber] && (formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber])), 33702 scope_Tooltips[handleNumber].innerHTML = formattedValue; 33703 } 33704 }); 33705 } 33706 function addMarking(spread, filterFunc, formatter) { 33707 var element = scope_Document.createElement("div"), valueSizeClasses = []; 33708 valueSizeClasses[PIPS_NO_VALUE] = options.cssClasses.valueNormal, valueSizeClasses[PIPS_LARGE_VALUE] = options.cssClasses.valueLarge, 33709 valueSizeClasses[PIPS_SMALL_VALUE] = options.cssClasses.valueSub; 33710 var markerSizeClasses = []; 33711 markerSizeClasses[PIPS_NO_VALUE] = options.cssClasse
33711s.markerNormal, markerSizeClasses[PIPS_LARGE_VALUE] = options.cssClasses.markerLarge, 33712 markerSizeClasses[PIPS_SMALL_VALUE] = options.cssClasses.markerSub; 33713 var valueOrientationClasses = [ options.cssClasses.valueHorizontal, options.cssClasses.valueVertical ], markerOrientationClasses = [ options.cssClasses.markerHorizontal, options.cssClasses.markerVertical ]; 33714 function getClasses(type, source) { 33715 var a = source === options.cssClasses.value, sizeClasses = a ? valueSizeClasses : markerSizeClasses; 33716 return source + " " + (a ? valueOrientationClasses : markerOrientationClasses)[options.ort] + " " + sizeClasses[type]; 33717 } 33718 return addClass(element, options.cssClasses.pips), addClass(element, 0 === options.ort ? options.cssClasses.pipsHorizontal : options.cssClasses.pipsVertical), 33719 Object.keys(spread).forEach(function(offset) { 33720 !function(offset, value, type) { 33721 if ((type = filterFunc ? filterFunc(value, type) : type) !== PIPS_NONE) { 33722 var node = addNodeTo(element, !1); 33723 node.className = getClasses(type, options.cssClasses.marker), node.style[options.style] = offset + "%", 33724 PIPS_NO_VALUE < type && ((node = addNodeTo(element, !1)).className = getClasses(type, options.cssClasses.value), 33725 node.setAttribute("data-value", value), node.style[options.style] = offset + "%", 33726 node.innerHTML = formatter.to(value)); 33727 } 33728 }(offset, spread[offset][0], spread[offset][1]); 33729 }), element; 33730 } 33731 function removePips() { 33732 scope_Pips && (removeElement(scope_Pips), scope_Pips = null); 33733 } 33734 function pips(grid) { 33735 removePips(); 33736 var mode = grid.mode, density = grid.density || 1, filter = grid.filter || !1, group = function(mode, values, stepped) { 33737 if ("range" === mode || "steps" === mode) return scope_Spectrum.xVal; 33738 if ("count" === mode) { 33739 if (values < 2) throw new Error("noUiSlider (" + VERSION + "): 'values' (>= 2) required for mode 'count'."); 33740 var interval = values - 1, spread = 100 / interval; 33741 for (values = []; interval--; ) values[interval] = interval * spread; 33742 values.push(100), mode = "positions"; 33743 } 33744 return "positions" === mode ? values.map(function(value) { 33745 return scope_Spectrum.fromStepping(stepped ? scope_Spectrum.getStep(value) : value); 33746 }) : "values" === mode ? stepped ? values.map(function(value) { 33747 return scope_Spectrum.fromStepping(scope_Spectrum.getStep(scope_Spectrum.toStepping(value))); 33748 }) : values : void 0; 33749 }(mode, grid.values || !1, grid.stepped || !1), spread = function(density, mode, group) { 33750 var indexes = {}, firstInRange = scope_Spectrum.xVal[0], lastInRange = scope_Spectrum.xVal[scope_Spectrum.xVal.length - 1], ignoreFirst = !1, ignoreLast = !1, prevPct = 0; 33751 return (group = function(array) { 33752 return array.filter(function(a) { 33753 return !this[a] && (this[a] = !0); 33754 }, {}); 33755 }(group.slice().sort(function(a, b) { 33756 return a - b; 33757 })))[0] !== firstInRange && (group.unshift(firstInRange), ignoreFirst = !0), group[group.length - 1] !== lastInRange && (group.push(lastInRange), 33758 ignoreLast = !0), group.forEach(function(current, index) { 33759 var step, i, q, newPct, pctDifference, pctPos, type, steps, realSteps, stepSize, low = current, high = group[index + 1], isSteps = "steps" === mode; 33760 if (isSteps && (step = scope_Spectrum.xNumSteps[index]), step = step || high - low, 33761 !1 !== low && void 0 !== high) for (step = Math.max(step, 1e-7), i = low; i <= high; i = (i + step).toFixed(7) / 1) { 33762 for (steps = (pctDifference = (newPct = scope_Spectrum.toStepping(i)) - prevPct) / density, 33763 stepSize = pctDifference / (realSteps = Math.round(steps)), q = 1; q <= realSteps;
33763 q += 1) indexes[(pctPos = prevPct + q * stepSize).toFixed(5)] = [ scope_Spectrum.fromStepping(pctPos), 0 ]; 33764 type = -1 < group.indexOf(i) ? PIPS_LARGE_VALUE : isSteps ? PIPS_SMALL_VALUE : PIPS_NO_VALUE, 33765 !index && ignoreFirst && (type = 0), i === high && ignoreLast || (indexes[newPct.toFixed(5)] = [ i, type ]), 33766 prevPct = newPct; 33767 } 33768 }), indexes; 33769 }(density, mode, group), format = grid.format || { 33770 to: Math.round 33771 }; 33772 return scope_Pips = scope_Target.appendChild(addMarking(spread, filter, format)); 33773 } 33774 function baseSize() { 33775 var rect = scope_Base.getBoundingClientRect(), alt = "offset" + [ "Width", "Height" ][options.ort]; 33776 return 0 === options.ort ? rect.width || scope_Base[alt] : rect.height || scope_Base[alt]; 33777 } 33778 function attachEvent(events, element, callback, data) { 33779 function method(e) { 33780 return !!(e = function(e, pageOffset, eventTarget) { 33781 var x, y, touch = 0 === e.type.indexOf("touch"), mouse = 0 === e.type.indexOf("mouse"), pointer = 0 === e.type.indexOf("pointer"); 33782 0 === e.type.indexOf("MSPointer") && (pointer = !0); 33783 if (touch) { 33784 var isTouchOnTarget = function(checkTouch) { 33785 return checkTouch.target === eventTarget || eventTarget.contains(checkTouch.target); 33786 }; 33787 if ("touchstart" === e.type) { 33788 var targetTouches = Array.prototype.filter.call(e.touches, isTouchOnTarget); 33789 if (1 < targetTouches.length) return !1; 33790 x = targetTouches[0].pageX, y = targetTouches[0].pageY; 33791 } else { 33792 var targetTouch = Array.prototype.find.call(e.changedTouches, isTouchOnTarget); 33793 if (!targetTouch) return !1; 33794 x = targetTouch.pageX, y = targetTouch.pageY; 33795 } 33796 } 33797 pageOffset = pageOffset || getPageOffset(scope_Document), (mouse || pointer) && (x = e.clientX + pageOffset.x, 33798 y = e.clientY + pageOffset.y); 33799 return e.pageOffset = pageOffset, e.points = [ x, y ], e.cursor = mouse || pointer, 33800 e; 33801 }(e, data.pageOffset, data.target || element)) && (!(isSliderDisabled() && !data.doNotReject) && (!(function(el, className) { 33802 return el.classList ? el.classList.contains(className) : new RegExp("\\b" + className + "\\b").test(el.className); 33803 }(scope_Target, options.cssClasses.tap) && !data.doNotReject) && (!(events === actions.start && void 0 !== e.buttons && 1 < e.buttons) && ((!data.hover || !e.buttons) && (supportsPassive || e.preventDefault(), 33804 e.calcPoint = e.points[options.ort], void callback(e, data)))))); 33805 } 33806 var methods = []; 33807 return events.split(" ").forEach(function(eventName) { 33808 element.addEventListener(eventName, method, !!supportsPassive && { 33809 passive: !0 33810 }), methods.push([ eventName, method ]); 33811 }), methods; 33812 } 33813 function calcPointToPercentage(calcPoint) { 33814 var proposal = 100 * (calcPoint - function(elem, orientation) { 33815 var rect = elem.getBoundingClientRect(), doc = elem.ownerDocument, docElem = doc.documentElement, pageOffset = getPageOffset(doc); 33816 return /webkit.*Chrome.*Mobile/i.test(navigator.userAgent) && (pageOffset.x = 0), 33817 orientation ? rect.top + pageOffset.y - docElem.clientTop : rect.left + pageOffset.x - docElem.clientLeft; 33818 }(scope_Base, options.ort)) / baseSize(); 33819 return proposal = limit(proposal), options.dir ? 100 - proposal : proposal; 33820 } 33821 function documentLeave(event, data) { 33822 "mouseout" === event.type && "HTML" === event.target.nodeName && null === event.relatedTarget && eventEnd(event, data); 33823 } 33824 function eventMove(event, data) { 33825 if (-1 === navigator.appVersion.indexOf("MSIE 9") && 0 === event.buttons && 0 !== data.buttonsProperty) return eventEnd(event, data); 33826 var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint); 33827 moveHandles(0 < movement, 100 * movement / data.baseSize, data.locations, data.handleNumbers); 33828 } 33829 function eventEnd(event, data) { 33830 data.handle && (removeClass(data.handle, options.cssClasse
33830s.active), scope_ActiveHandlesCount -= 1), 33831 data.listeners.forEach(function(c) { 33832 scope_DocumentElement.removeEventListener(c[0], c[1]); 33833 }), 0 === scope_ActiveHandlesCount && (removeClass(scope_Target, options.cssClasses.drag), 33834 setZindex(), event.cursor && (scope_Body.style.cursor = "", scope_Body.removeEventListener("selectstart", preventDefault))), 33835 data.handleNumbers.forEach(function(handleNumber) { 33836 fireEvent("change", handleNumber), fireEvent("set", handleNumber), fireEvent("end", handleNumber); 33837 }); 33838 } 33839 function eventStart(event, data) { 33840 if (data.handleNumbers.some(isHandleDisabled)) return !1; 33841 var handle; 33842 1 === data.handleNumbers.length && (handle = scope_Handles[data.handleNumbers[0]].children[0], 33843 scope_ActiveHandlesCount += 1, addClass(handle, options.cssClasses.active)); 33844 event.stopPropagation(); 33845 var listeners = [], moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, { 33846 target: event.target, 33847 handle: handle, 33848 listeners: listeners, 33849 startCalcPoint: event.calcPoint, 33850 baseSize: baseSize(), 33851 pageOffset: event.pageOffset, 33852 handleNumbers: data.handleNumbers, 33853 buttonsProperty: event.buttons, 33854 locations: scope_Locations.slice() 33855 }), endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, { 33856 target: event.target, 33857 handle: handle, 33858 listeners: listeners, 33859 doNotReject: !0, 33860 handleNumbers: data.handleNumbers 33861 }), outEvent = attachEvent("mouseout", scope_DocumentElement, documentLeave, { 33862 target: event.target, 33863 handle: handle, 33864 listeners: listeners, 33865 doNotReject: !0, 33866 handleNumbers: data.handleNumbers 33867 }); 33868 listeners.push.apply(listeners, moveEvent.concat(endEvent, outEvent)), event.cursor && (scope_Body.style.cursor = getComputedStyle(event.target).cursor, 33869 1 < scope_Handles.length && addClass(scope_Target, options.cssClasses.drag), scope_Body.addEventListener("selectstart", preventDefault, !1)), 33870 data.handleNumbers.forEach(function(handleNumber) { 33871 fireEvent("start", handleNumber); 33872 }); 33873 } 33874 function eventTap(event) { 33875 event.stopPropagation(); 33876 var proposal = calcPointToPercentage(event.calcPoint), handleNumber = function(clickedPosition) { 33877 var smallestDifference = 100, handleNumber = !1; 33878 return scope_Handles.forEach(function(handle, index) { 33879 if (!isHandleDisabled(index)) { 33880 var handlePosition = scope_Locations[index], differenceWithThisHandle = Math.abs(handlePosition - clickedPosition); 33881 (differenceWithThisHandle < smallestDifference || differenceWithThisHandle <= smallestDifference && handlePosition < clickedPosition || 100 === differenceWithThisHandle && 100 === smallestDifference) && (handleNumber = index, 33882 smallestDifference = differenceWithThisHandle); 33883 } 33884 }), handleNumber; 33885 }(proposal); 33886 if (!1 === handleNumber) return !1; 33887 options.events.snap || addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration), 33888 setHandle(handleNumber, proposal, !0, !0), setZindex(), fireEvent("slide", handleNumber, !0), 33889 fireEvent("update", handleNumber, !0), fireEvent("change", handleNumber, !0), fireEvent("set", handleNumber, !0), 33890 options.events.snap && eventStart(event, { 33891 handleNumbers: [ handleNumber ] 33892 }); 33893 } 33894 function eventHover(event) { 33895 var proposal = calcPointToPercentage(event.calcPoint), to = scope_Spectrum.getStep(proposal), value = scope_Spectrum.fromStepping(to);
33896 Object.keys(scope_Events).forEach(function(targetEvent) { 33897 "hover" === targetEvent.split(".")[0] && scope_Events[targetEvent].forEach(function(callback) { 33898 callback.call(scope_Self, value); 33899 }); 33900 }); 33901 } 33902 function bindEvent(namespacedEvent, callback) { 33903 scope_Events[namespacedEvent] = scope_Events[namespacedEvent] || [], scope_Events[namespacedEvent].push(callback), 33904 "update" === namespacedEvent.split(".")[0] && scope_Handles.forEach(function(a, index) { 33905 fireEvent("update", index); 33906 }); 33907 } 33908 function removeEvent(namespacedEvent) { 33909 var event = namespacedEvent && namespacedEvent.split(".")[0], namespace = event && namespacedEvent.substring(event.length); 33910 Object.keys(scope_Events).forEach(function(bind) { 33911 var tEvent = bind.split(".")[0], tNamespace = bind.substring(tEvent.length); 33912 event && event !== tEvent || namespace && namespace !== tNamespace || delete scope_Events[bind]; 33913 }); 33914 } 33915 function fireEvent(eventName, handleNumber, tap) { 33916 Object.keys(scope_Events).forEach(function(targetEvent) { 33917 var eventType = targetEvent.split(".")[0]; 33918 eventName === eventType && scope_Events[targetEvent].forEach(function(callback) { 33919 callback.call(scope_Self, scope_Values.map(options.format.to), handleNumber, scope_Values.slice(), tap || !1, scope_Locations.slice()); 33920 }); 33921 }); 33922 } 33923 function checkHandlePosition(reference, handleNumber, to, lookBackward, lookForward, getValue) { 33924 return 1 < scope_Handles.length && !options.events.unconstrained && (lookBackward && 0 < handleNumber && (to = Math.max(to, reference[handleNumber - 1] + options.margin)), 33925 lookForward && handleNumber < scope_Handles.length - 1 && (to = Math.min(to, reference[handleNumber + 1] - options.margin))), 33926 1 < scope_Handles.length && options.limit && (lookBackward && 0 < handleNumber && (to = Math.min(to, reference[handleNumber - 1] + options.limit)), 33927 lookForward && handleNumber < scope_Handles.length - 1 && (to = Math.max(to, reference[handleNumber + 1] - options.limit))), 33928 options.padding && (0 === handleNumber && (to = Math.max(to, options.padding[0])), 33929 handleNumber === scope_Handles.length - 1 && (to = Math.min(to, 100 - options.padding[1]))), 33930 !((to = limit(to = scope_Spectrum.getStep(to))) === reference[handleNumber] && !getValue) && to; 33931 } 33932 function inRuleOrder(v, a) { 33933 var o = options.ort; 33934 return (o ? a : v) + ", " + (o ? v : a); 33935 } 33936 function moveHandles(upward, proposal, locations, handleNumbers) { 33937 var proposals = locations.slice(), b = [ !upward, upward ], f = [ upward, !upward ]; 33938 handleNumbers = handleNumbers.slice(), upward && handleNumbers.reverse(), 1 < handleNumbers.length ? handleNumbers.forEach(function(handleNumber, o) { 33939 var to = checkHandlePosition(proposals, handleNumber, proposals[handleNumber] + proposal, b[o], f[o], !1); 33940 !1 === to ? proposal = 0 : (proposal = to - proposals[handleNumber], proposals[handleNumber] = to); 33941 }) : b = f = [ !0 ]; 33942 var state = !1; 33943 handleNumbers.forEach(function(handleNumber, o) { 33944 state = setHandle(handleNumber, locations[handleNumber] + proposal, b[o], f[o]) || state; 33945 }), state && handleNumbers.forEach(function(handleNumber) { 33946 fireEvent("update", handleNumber), fireEvent("slide", handleNumber); 33947 }); 33948 } 33949 function transformDirection(a, b) { 33950 return options.dir ? 100 - a - b : a; 33951 } 33952 function setZindex() {
33953 scope_HandleNumbers.forEach(function(handleNumber) { 33954 var dir = 50 < scope_Locations[handleNumber] ? -1 : 1, zIndex = 3 + (scope_Handles.length + dir * handleNumber); 33955 scope_Handles[handleNumber].style.zIndex = zIndex; 33956 }); 33957 } 33958 function setHandle(handleNumber, to, lookBackward, lookForward) { 33959 return !1 !== (to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward, !1)) && (function(handleNumber, to) { 33960 scope_Locations[handleNumber] = to, scope_Values[handleNumber] = scope_Spectrum.fromStepping(to); 33961 var translateRule = "translate(" + inRuleOrder(10 * (transformDirection(to, 0) - scope_DirOffset) + "%", "0") + ")"; 33962 scope_Handles[handleNumber].style[options.transformRule] = translateRule, updateConnect(handleNumber), 33963 updateConnect(handleNumber + 1); 33964 }(handleNumber, to), !0); 33965 } 33966 function updateConnect(index) { 33967 if (scope_Connects[index]) { 33968 var l = 0, h = 100; 33969 0 !== index && (l = scope_Locations[index - 1]), index !== scope_Connects.length - 1 && (h = scope_Locations[index]); 33970 var connectWidth = h - l, translateRule = "translate(" + inRuleOrder(transformDirection(l, connectWidth) + "%", "0") + ")", scaleRule = "scale(" + inRuleOrder(connectWidth / 100, "1") + ")"; 33971 scope_Connects[index].style[options.transformRule] = translateRule + " " + scaleRule; 33972 } 33973 } 33974 function resolveToValue(to, handleNumber) { 33975 return null === to || !1 === to || void 0 === to ? scope_Locations[handleNumber] : ("number" == typeof to && (to = String(to)), 33976 to = options.format.from(to), !1 === (to = scope_Spectrum.toStepping(to)) || isNaN(to) ? scope_Locations[handleNumber] : to); 33977 } 33978 function valueSet(input, fireSetEvent) { 33979 var values = asArray(input), isInit = void 0 === scope_Locations[0]; 33980 fireSetEvent = void 0 === fireSetEvent || !!fireSetEvent, options.animate && !isInit && addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration), 33981 scope_HandleNumbers.forEach(function(handleNumber) { 33982 setHandle(handleNumber, resolveToValue(values[handleNumber], handleNumber), !0, !1); 33983 }), scope_HandleNumbers.forEach(function(handleNumber) { 33984 setHandle(handleNumber, scope_Locations[handleNumber], !0, !0); 33985 }), setZindex(), scope_HandleNumbers.forEach(function(handleNumber) { 33986 fireEvent("update", handleNumber), null !== values[handleNumber] && fireSetEvent && fireEvent("set", handleNumber); 33987 }); 33988 } 33989 function valueGet() { 33990 var values = scope_Values.map(options.format.to); 33991 return 1 === values.length ? values[0] : values; 33992 } 33993 function getNextStepsForHandle(handleNumber) { 33994 var location = scope_Locations[handleNumber], nearbySteps = scope_Spectrum.getNearbySteps(location), value = scope_Values[handleNumber], increment = nearbySteps.thisStep.step, decrement = null; 33995 if (options.snap) return [ value - nearbySteps.stepBefore.startValue || null, nearbySteps.stepAfter.startValue - value || null ]; 33996 !1 !== increment && value + increment > nearbySteps.stepAfter.startValue && (increment = nearbySteps.stepAfter.startValue - value), 33997 decrement = value > nearbySteps.thisStep.startValue ? nearbySteps.thisStep.step : !1 !== nearbySteps.stepBefore.step && value - nearbySteps.stepBefore.highestStep, 33998 100 === location ? increment = null : 0 === location && (decrement = null); 33999 var stepDecimals = scope_Spectrum.countStepDecimals(); 34000 return null !== increment && !1 !== increment && (increment = Number(increment.toFixed(stepDecimals))), 34001 null !== decrement && !1 !== decrement && (decrement = Number(decrement.toFixed(stepDecimals))), 34002 [ decrement, increment ]; 34003 } 34004 return addClass(addTarget = scope_Target, options.cssClasse
34004s.target), 0 === options.dir ? addClass(addTarget, options.cssClasses.ltr) : addClass(addTarget, options.cssClasses.rtl), 34005 0 === options.ort ? addClass(addTarget, options.cssClasses.horizontal) : addClass(addTarget, options.cssClasses.vertical), 34006 scope_Base = addNodeTo(addTarget, options.cssClasses.base), function(connectOptions, base) { 34007 var connectBase = addNodeTo(base, options.cssClasses.connects); 34008 scope_Handles = [], (scope_Connects = []).push(addConnect(connectBase, connectOptions[0])); 34009 for (var i = 0; i < options.handles; i++) scope_Handles.push(addOrigin(base, i)), 34010 scope_HandleNumbers[i] = i, scope_Connects.push(addConnect(connectBase, connectOptions[i + 1])); 34011 }(options.connect, scope_Base), (behaviour = options.events).fixed || scope_Handles.forEach(function(handle, index) { 34012 attachEvent(actions.start, handle.children[0], eventStart, { 34013 handleNumbers: [ index ] 34014 }); 34015 }), behaviour.tap && attachEvent(actions.start, scope_Base, eventTap, {}), behaviour.hover && attachEvent(actions.move, scope_Base, eventHover, { 34016 hover: !0 34017 }), behaviour.drag && scope_Connects.forEach(function(connect, index) { 34018 if (!1 !== connect && 0 !== index && index !== scope_Connects.length - 1) { 34019 var handleBefore = scope_Handles[index - 1], handleAfter = scope_Handles[index], eventHolders = [ connect ]; 34020 addClass(connect, options.cssClasses.draggable), behaviour.fixed && (eventHolders.push(handleBefore.children[0]), 34021 eventHolders.push(handleAfter.children[0])), eventHolders.forEach(function(eventHolder) { 34022 attachEvent(actions.start, eventHolder, eventStart, { 34023 handles: [ handleBefore, handleAfter ], 34024 handleNumbers: [ index - 1, index ] 34025 }); 34026 }); 34027 } 34028 }), valueSet(options.start), options.pips && pips(options.pips), options.tooltips && tooltips(), 34029 bindEvent("update", function(values, handleNumber, unencoded, tap, positions) { 34030 scope_HandleNumbers.forEach(function(index) { 34031 var handle = scope_Handles[index], min = checkHandlePosition(scope_Locations, index, 0, !0, !0, !0), max = checkHandlePosition(scope_Locations, index, 100, !0, !0, !0), now = positions[index], text = options.ariaFormat.to(unencoded[index]); 34032 min = scope_Spectrum.fromStepping(min).toFixed(1), max = scope_Spectrum.fromStepping(max).toFixed(1), 34033 now = scope_Spectrum.fromStepping(now).toFixed(1), handle.children[0].setAttribute("aria-valuemin", min), 34034 handle.children[0].setAttribute("aria-valuemax", max), handle.children[0].setAttribute("aria-valuenow", now), 34035 handle.children[0].setAttribute("aria-valuetext", text); 34036 }); 34037 }), scope_Self = { 34038 destroy: function() { 34039 for (var key in options.cssClasses) options.cssClasses.hasOwnProperty(key) && removeClass(scope_Target, options.cssClasses[key]); 34040 for (;scope_Target.firstChild; ) scope_Target.removeChild(scope_Target.firstChild); 34041 delete scope_Target.noUiSlider; 34042 }, 34043 steps: function() { 34044 return scope_HandleNumbers.map(getNextStepsForHandle); 34045 }, 34046 on: bindEvent, 34047 off: removeEvent, 34048 get: valueGet, 34049 set: valueSet, 34050 setHandle: function(handleNumber, value, fireSetEvent) { 34051 if (!(0 <= (handleNumber = Number(handleNumber)) && handleNumber < scope_HandleNumbers.length)) throw new Error("noUiSlider (" + VERSION + "): invali
34051d handle number, got: " + handleNumber); 34052 setHandle(handleNumber, resolveToValue(value, handleNumber), !0, !0), fireEvent("update", handleNumber), 34053 fireSetEvent && fireEvent("set", handleNumber); 34054 }, 34055 reset: function(fireSetEvent) { 34056 valueSet(options.start, fireSetEvent); 34057 }, 34058 __moveHandles: function(a, b, c) { 34059 moveHandles(a, b, scope_Locations, c); 34060 }, 34061 options: originalOptions, 34062 updateOptions: function(optionsToUpdate, fireSetEvent) { 34063 var v = valueGet(), updateAble = [ "margin", "limit", "padding", "range", "animate", "snap", "step", "format", "pips", "tooltips" ]; 34064 updateAble.forEach(function(name) { 34065 void 0 !== optionsToUpdate[name] && (originalOptions[name] = optionsToUpdate[name]); 34066 }); 34067 var newOptions = testOptions(originalOptions); 34068 updateAble.forEach(function(name) { 34069 void 0 !== optionsToUpdate[name] && (options[name] = newOptions[name]); 34070 }), scope_Spectrum = newOptions.spectrum, options.margin = newOptions.margin, options.limit = newOptions.limit, 34071 options.padding = newOptions.padding, options.pips ? pips(options.pips) : removePips(), 34072 options.tooltips ? tooltips() : removeTooltips(), scope_Locations = [], valueSet(optionsToUpdate.start || v, fireSetEvent); 34073 }, 34074 target: scope_Target, 34075 removePips: removePips, 34076 removeTooltips: removeTooltips, 34077 pips: pips 34078 }; 34079 } 34080 return { 34081 __spectrum: Spectrum, 34082 version: VERSION, 34083 create: function(target, originalOptions) { 34084 if (!target || !target.nodeName) throw new Error("noUiSlider (" + VERSION + "): create requires a single element, got: " + target); 34085 if (target.noUiSlider) throw new Error("noUiSlider (" + VERSION + "): Slider was already initialized."); 34086 var api = scope(target, testOptions(originalOptions), originalOptions); 34087 return target.noUiSlider = api; 34088 } 34089 }; 34090 }, "function" == typeof define && define.amd ? define([], factory) : "object" == typeof exports ? module.exports = factory() : window.noUiSlider = factory(); 34091 }, {} ], 34092 285: [ function(require, module, exports) { 34093 !function(window, factory) { 34094 "function" == typeof define && define.amd ? define([ "ev-emitter/ev-emitter", "get-size/get-size" ], factory) : "object" == typeof module && module.exports ? module.exports = factory(require("ev-emitter"), require("get-size")) : (window.Outlayer = {}, 34095 window.Outlayer.Item = factory(window.EvEmitter, window.getSize)); 34096 }(window, function(EvEmitter, getSize) { 34097 "use strict"; 34098 var docElemStyle = document.documentElement.style, transitionProperty = "string" == typeof docElemStyle.transition ? "transition" : "WebkitTransition", transformProperty = "string" == typeof docElemStyle.transform ? "transform" : "WebkitTransform", transitionEndEvent = { 34099 WebkitTransition: "webkitTransitionEnd", 34100 transition: "transitionend" 34101 }[transitionProperty], vendorProperties = { 34102 transform: transformProperty, 34103 transition: transitionProperty, 34104 transitionDuration: transitionProperty + "Duration", 34105 transitionProperty: transitionProperty + "Property", 34106 transitionDelay: transitionProperty + "Delay" 34107 }; 34108 function Item(element, layout) { 34109 element && (this.element = element, this.layout = layout, this.position = { 34110 x: 0, 34111 y: 0 34112 }, this._create()); 34113 } 34114 var proto = Item.prototype = Object.create(EvEmitter.prototype); 34115 proto.constructor = Item, proto._create = function() { 34116 this._transn = { 34117 ingProperties: {}, 34118 clean: {}, 34119 onEnd: {} 34120 }, this.css({ 34121 position: "absolute" 34122 }); 34123 }, proto.handleEvent = function(event) { 34124 var method = "on" + event.type; 34125 this[method] && this[method](event); 34126 }, proto.getSize = function() { 34127 this.size = getSize(this.element); 34128 }, proto.css = function(style) { 34129 var elemStyle = this.element.style; 34130 for (var prop in style) { 34131 elemStyle[vendorProperties[prop] || prop] = style[prop]; 34132 } 34133 }, proto.getPosition = function() { 34134 var style = getComputedStyle(this.element), isOriginLeft = this.layout._getOption("originLeft"), isOriginTop = this.layout._getOption("originTop"), xValue = style[isOriginLeft ? "left" : "right"], yValue = style[isOriginTop ? "top" : "bottom"], x = parseFloat(xValue), y = parseFloat(yValue), layoutSize = this.layout.size; 34135 -1 != xValue.indexOf("%") && (x = x / 100 * layoutSize.width), -1 != yValue.indexOf("%") && (y = y / 100 * layoutSize.height), 34136 x = isNaN(x) ? 0 : x, y = isNaN(y) ? 0 : y, x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight, 34137 y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom, this.position.x = x, 34138 this.position.y = y; 34139 }, proto.layoutPosition = function() { 34140 var layoutSize = this.layout.size, style = {}, isOriginLeft = this.layout._getOption("originLeft"), isOriginTop = this.layout._getOption("originTop"), xPadding = isOriginLeft ? "paddingLeft" : "paddingRight", xProperty = isOriginLeft ? "left" : "right", xResetProperty = isOriginLeft ? "right" : "left", x = this.position.x + layoutSize[xPadding]; 34141 style[xProperty] = this.getXValue(x), style[xResetProperty] = ""; 34142 var yPadding = isOriginTop ? "paddingTop" : "paddingBottom", yProperty = isOriginTop ? "top" : "bottom", yResetProperty = isOriginTop ? "bottom" : "top", y = this.position.y + layoutSize[yPadding]; 34143 style[yProperty] = this.getYValue(y), style[yResetProperty] = "", this.css(style), 34144 this.emitEvent("layout", [ this ]); 34145 }, proto.getXValue = function(x) { 34146 var isHorizontal = this.layout._getOption("horizontal"); 34147 return this.layout.options.percentPosition && !isHorizontal ? x / this.layout.size.width * 100 + "%" : x + "px"; 34148 }, proto.getYValue = function(y) { 34149 var isHorizontal = this.layout._getOption("horizontal"); 34150 return this.layout.options.percentPosition && isHorizontal ? y / this.layout.size.height * 100 + "%" : y + "px"; 34151 }
34151, proto._transitionTo = function(x, y) { 34152 this.getPosition(); 34153 var curX = this.position.x, curY = this.position.y, didNotMove = x == this.position.x && y == this.position.y; 34154 if (this.setPosition(x, y), !didNotMove || this.isTransitioning) { 34155 var transX = x - curX, transY = y - curY, transitionStyle = {}; 34156 transitionStyle.transform = this.getTranslate(transX, transY), this.transition({ 34157 to: transitionStyle, 34158 onTransitionEnd: { 34159 transform: this.layoutPosition 34160 }, 34161 isCleaning: !0 34162 }); 34163 } else this.layoutPosition(); 34164 }, proto.getTranslate = function(x, y) { 34165 return "translate3d(" + (x = this.layout._getOption("originLeft") ? x : -x) + "px, " + (y = this.layout._getOption("originTop") ? y : -y) + "px, 0)"; 34166 }, proto.goTo = function(x, y) { 34167 this.setPosition(x, y), this.layoutPosition(); 34168 }, proto.moveTo = proto._transitionTo, proto.setPosition = function(x, y) { 34169 this.position.x = parseFloat(x), this.position.y = parseFloat(y); 34170 }, proto._nonTransition = function(args) { 34171 for (var prop in this.css(args.to), args.isCleaning && this._removeStyles(args.to), 34172 args.onTransitionEnd) args.onTransitionEnd[prop].call(this); 34173 }, proto.transition = function(args) { 34174 if (parseFloat(this.layout.options.transitionDuration)) { 34175 var _transition = this._transn; 34176 for (var prop in args.onTransitionEnd) _transition.onEnd[prop] = args.onTransitionEnd[prop]; 34177 for (prop in args.to) _transition.ingProperties[prop] = !0, args.isCleaning && (_transition.clean[prop] = !0); 34178 if (args.from) { 34179 this.css(args.from); 34180 this.element.offsetHeight; 34181 null; 34182 } 34183 this.enableTransition(args.to), this.css(args.to), this.isTransitioning = !0; 34184 } else this._nonTransition(args); 34185 }; 34186 var transitionProps = "opacity," + transformProperty.replace(/([A-Z])/g, function($1) { 34187 return "-" + $1.toLowerCase(); 34188 }); 34189 proto.enableTransition = function() { 34190 if (!this.isTransitioning) { 34191 var duration = this.layout.options.transitionDuration; 34192 duration = "number" == typeof duration ? duration + "ms" : duration, this.css({ 34193 transitionProperty: transitionProps, 34194 transitionDuration: duration, 34195 transitionDelay: this.staggerDelay || 0 34196 }), this.element.addEventListener(transitionEndEvent, this, !1); 34197 } 34198 }, proto.onwebkitTransitionEnd = function(event) { 34199 this.ontransitionend(event); 34200 }, proto.onotransitionend = function(event) { 34201 this.ontransitionend(event); 34202 }; 34203 var dashedVendorProperties = { 34204 "-webkit-transform": "transform" 34205 }; 34206 proto.ontransitionend = function(event) { 34207 if (event.target === this.element) { 34208 var _transition = this._transn, propertyName = dashedVendorProperties[event.propertyName] || event.propertyName; 34209 if (delete _transition.ingProperties[propertyName], function(obj) { 34210 for (var prop in obj) return !1; 34211 return !null; 34212 }(_transition.ingProperties) && this.disableTransition(), propertyName in _transition.clean && (this.element.style[event.propertyName] = "", 34213 delete _transition.clean[propertyName]), propertyName in _transition.onEnd) _transition.onEnd[propertyName].call(this), 34214 delete _transition.onEnd[propertyName]; 34215 this.emitEvent("transitionEnd", [ this ]); 34216 } 34217 }, proto.disableTransition = function() { 34218 this.removeTransitionStyles(), this.element.removeEventListener(transitionEndEvent, this, !1), 34219 this.isTransitioning = !1; 34220 }, proto._removeStyles = function(style) { 34221 var cleanStyle = {}; 34222 for (var prop in style) cleanStyle[prop] = ""; 34223 this.css(cleanStyle); 34224 }; 34225 var cleanTransitionStyle = { 34226 transitionProperty: "", 34227 transitionDuration: "", 34228 transitionDelay: "" 34229 }; 34230 return proto.removeTransitionStyles = function() { 34231 this.css(cleanTransitionStyle); 34232 }, proto.stagger = function(delay) {
34233 delay = isNaN(delay) ? 0 : delay, this.staggerDelay = delay + "ms"; 34234 }, proto.removeElem = function() { 34235 this.element.parentNode.removeChild(this.element), this.css({ 34236 display: "" 34237 }), this.emitEvent("remove", [ this ]); 34238 }, proto.remove = function() { 34239 transitionProperty && parseFloat(this.layout.options.transitionDuration) ? (this.once("transitionEnd", function() { 34240 this.removeElem(); 34241 }), this.hide()) : this.removeElem(); 34242 }, proto.reveal = function() { 34243 delete this.isHidden, this.css({ 34244 display: "" 34245 }); 34246 var options = this.layout.options, onTransitionEnd = {}; 34247 onTransitionEnd[this.getHideRevealTransitionEndProperty("visibleStyle")] = this.onRevealTransitionEnd, 34248 this.transition({ 34249 from: options.hiddenStyle, 34250 to: options.visibleStyle, 34251 isCleaning: !0, 34252 onTransitionEnd: onTransitionEnd 34253 }); 34254 }, proto.onRevealTransitionEnd = function() { 34255 this.isHidden || this.emitEvent("reveal"); 34256 }, proto.getHideRevealTransitionEndProperty = function(styleProperty) { 34257 var optionStyle = this.layout.options[styleProperty]; 34258 if (optionStyle.opacity) return "opacity"; 34259 for (var prop in optionStyle) return prop; 34260 }, proto.hide = function() { 34261 this.isHidden = !0, this.css({ 34262 display: "" 34263 }); 34264 var options = this.layout.options, onTransitionEnd = {}; 34265 onTransitionEnd[this.getHideRevealTransitionEndProperty("hiddenStyle")] = this.onHideTransitionEnd, 34266 this.transition({ 34267 from: options.visibleStyle, 34268 to: options.hiddenStyle, 34269 isCleaning: !0, 34270 onTransitionEnd: onTransitionEnd 34271 }); 34272 }, proto.onHideTransitionEnd = function() { 34273 this.isHidden && (this.css({ 34274 display: "none" 34275 }), this.emitEvent("hide")); 34276 }, proto.destroy = function() { 34277 this.css({ 34278 position: "", 34279 left: "", 34280 right: "", 34281 top: "", 34282 bottom: "", 34283 transition: "", 34284 transform: "" 34285 }); 34286 }, Item; 34287 }); 34288 }, { 34289 "ev-emitter": 276, 34290 "get-size": 280 34291 } ], 34292 286: [ function(require, module, exports) { 34293 !function(window, factory) { 34294 "use strict"; 34295 "function" == typeof define && define.amd ? define([ "ev-emitter/ev-emitter", "get-size/get-size", "fizzy-ui-utils/utils", "./item" ], function(EvEmitter, getSize, utils, Item) { 34296 return factory(window, EvEmitter, getSize, utils, Item); 34297 }) : "object" == typeof module && module.exports ? module.exports = factory(window, require("ev-emitter"), require("get-size"), require("fizzy-ui-utils"), require("./item")) : window.Outlayer = factory(window, window.EvEmitter, window.getSize, window.fizzyUIUtils, window.Outlayer.Item); 34298 }(window, function(window, EvEmitter, getSize, utils, Item) { 34299 "use strict"; 34300 function noop() {} 34301 var console = window.console, jQuery = window.jQuery, GUID = 0, instances = {}; 34302 function Outlayer(element, options) { 34303 var queryElement = utils.getQueryElement(element); 34304 if (queryElement) { 34305 this.element = queryElement, jQuery && (this.$element = jQuery(this.element)), this.options = utils.extend({}, this.constructor.defaults), 34306 this.option(options); 34307 var id = ++GUID; 34308 this.element.outlayerGUID = id, (instances[id] = this)._create(), this._getOption("initLayout") && this.layout(); 34309 } else console && console.error("Bad element for " + this.constructor.namespace + ": " + (queryElement || element)); 34310 } 34311 Outlayer.namespace = "outlayer", Outlayer.Item = Item, Outlayer.defaults = { 34312 containerStyle: { 34313 position: "relative" 34314 }, 34315 initLayout: !0, 34316 originLeft: !0, 34317 originTop: !0, 34318 resize: !0, 34319 resizeContainer: !0, 34320 transitionDuration: "0.4s", 34321 hiddenStyle: { 34322 opacity: 0, 34323 transform: "scale(0.001)" 34324 }, 34325 visibleStyle: { 34326 opacity: 1, 34327 transform: "scale(1)" 34328 } 34329 }; 34330 var proto = Outlayer.prototype; 34331 function subclass(Parent) { 34332 function SubClass() { 34333 Parent.apply(this, arguments); 34334 } 34335 return (SubClass.prototype = Object.create(Parent.prototype)).constructor = SubClass; 34336 } 34337 utils.extend(proto, EvEmitter.prototype), proto.option = function(opts) { 34338 utils.extend(this.options, opts); 34339 }, proto._getOption = function(option) { 34340 var oldOption = this.constructor.compatOptions[option]; 34341 return oldOption && void 0 !== this.options[oldOption] ? this.options[oldOption] : this.options[option]; 34342 }, Outlayer.compatOptions = { 34343 initLayout: "isInitLayout", 34344 horizontal: "isHorizontal", 34345 layoutInstant: "isLayoutInstant", 34346 originLeft: "isOriginLeft", 34347 originTop: "isOriginTop", 34348 resize: "isResizeBound", 34349 resizeContainer: "isResizingContainer" 34350 }, proto._create = function() { 34351 this.reloadItems(), this.stamps = [], this.stamp(this.options.stamp), utils.extend(this.element.style, this.options.containerStyle), 34352 this._getOption("resize") && this.bindResize(); 34353 }, proto.reloadItems = function() { 34354 this.items = this._itemize(this.element.children); 34355 }, proto._itemize = function(elems) { 34356 for (var itemElems = this._filterFindItemElements(elems), Item = this.constructor.Item, items = [], i = 0; i < itemElems.length; i++) { 34357 var item = new Item(itemElems[i], this); 34358 items.push(item); 34359 } 34360 return items; 34361 }, proto._filterFindItemElements = function(elems) { 34362 return utils.filterFindElements(elems, this.options.itemSelector); 34363 }, proto.getItemElements = function() { 34364 return this.items.map(function(item) { 34365 return item.element; 34366 }); 34367 }, proto.layout = function() { 34368 this._resetLayout(), this._manageStamps(); 34369 var layoutInstant = this._getOption("layoutInstant"), isInstant = void 0 !== layoutInstant ? layoutInstant : !this._isLayoutInited; 34370 this.layoutItems(this.items, isInstant), this._isLayoutInited = !0; 34371 }, proto._init = proto.layout, proto._resetLayout = function() {
34372 this.getSize(); 34373 }, proto.getSize = function() { 34374 this.size = getSize(this.element); 34375 }, proto._getMeasurement = function(measurement, size) { 34376 var elem, option = this.options[measurement]; 34377 option ? ("string" == typeof option ? elem = this.element.querySelector(option) : option instanceof HTMLElement && (elem = option), 34378 this[measurement] = elem ? getSize(elem)[size] : option) : this[measurement] = 0; 34379 }, proto.layoutItems = function(items, isInstant) { 34380 items = this._getItemsForLayout(items), this._layoutItems(items, isInstant), this._postLayout(); 34381 }, proto._getItemsForLayout = function(items) { 34382 return items.filter(function(item) { 34383 return !item.isIgnored; 34384 }); 34385 }, proto._layoutItems = function(items, isInstant) { 34386 if (this._emitCompleteOnItems("layout", items), items && items.length) { 34387 var queue = []; 34388 items.forEach(function(item) { 34389 var position = this._getItemLayoutPosition(item); 34390 position.item = item, position.isInstant = isInstant || item.isLayoutInstant, queue.push(position); 34391 }, this), this._processLayoutQueue(queue); 34392 } 34393 }, proto._getItemLayoutPosition = function() { 34394 return { 34395 x: 0, 34396 y: 0 34397 }; 34398 }, proto._processLayoutQueue = function(queue) { 34399 this.updateStagger(), queue.forEach(function(obj, i) { 34400 this._positionItem(obj.item, obj.x, obj.y, obj.isInstant, i); 34401 }, this); 34402 }, proto.updateStagger = function() { 34403 var stagger = this.options.stagger; 34404 if (null != stagger) return this.stagger = function(time) { 34405 if ("number" == typeof time) return time; 34406 var matches = time.match(/(^\d*\.?\d*)(\w*)/), num = matches && matches[1], unit = matches && matches[2]; 34407 if (!num.length) return 0; 34408 num = parseFloat(num); 34409 var mult = msUnits[unit] || 1; 34410 return num * mult; 34411 }(stagger), this.stagger; 34412 this.stagger = 0; 34413 }, proto._positionItem = function(item, x, y, isInstant, i) { 34414 isInstant ? item.goTo(x, y) : (item.stagger(i * this.stagger), item.moveTo(x, y)); 34415 }, proto._postLayout = function() { 34416 this.resizeContainer(); 34417 }, proto.resizeContainer = function() { 34418 if (this._getOption("resizeContainer")) { 34419 var size = this._getContainerSize(); 34420 size && (this._setContainerMeasure(size.width, !0), this._setContainerMeasure(size.height, !1)); 34421 } 34422 }, proto._getContainerSize = noop, proto._setContainerMeasure = function(measure, isWidth) { 34423 if (void 0 !== measure) { 34424 var elemSize = this.size; 34425 elemSize.isBorderBox && (measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight + elemSize.borderLeftWidth + elemSize.borderRightWidth : elemSize.paddingBottom + elemSize.paddingTop + elemSize.borderTopWidth + elemSize.borderBottomWidth), 34426 measure = Math.max(measure, 0), this.element.style[isWidth ? "width" : "height"] = measure + "px"; 34427 } 34428 }, proto._emitCompleteOnItems = function(eventName, items) { 34429 var _this = this; 34430 function onComplete() { 34431 _this.dispatchEvent(eventName + "Complete", null, [ items ]); 34432 } 34433 var count = items.length; 34434 if (items && count) { 34435 var doneCount = 0; 34436 items.forEach(function(item) { 34437 item.once(eventName, tick); 34438 }); 34439 } else onComplete(); 34440 function tick() { 34441 ++doneCount == count && onComplete(); 34442 } 34443 }, proto.dispatchEvent = function(type, event, args) { 34444 var emitArgs = event ? [ event ].concat(args) : args; 34445 if (this.emitEvent(type, emitArgs), jQuery) if (this.$element = this.$element || jQuery(this.element), 34446 event) { 34447 var $event = jQuery.Event(event); 34448 $event.type = type, this.$element.trigger($event, args); 34449 } else this.$element.trigger(type, args); 34450 }, proto.ignore = function(elem) { 34451 var item = this.getItem(elem); 34452 item && (item.isIgnored = !0); 34453 }, proto.unignore = function(elem) { 34454 var item = this.getItem(elem); 34455 item && delete item.isIgnored; 34456 }, proto.stamp = function(elems) { 34457 (elems = this._find(elems)) && (this.stamps = this.stamps.
34457concat(elems), elems.forEach(this.ignore, this)); 34458 }, proto.unstamp = function(elems) { 34459 (elems = this._find(elems)) && elems.forEach(function(elem) { 34460 utils.removeFrom(this.stamps, elem), this.unignore(elem); 34461 }, this); 34462 }, proto._find = function(elems) { 34463 if (elems) return "string" == typeof elems && (elems = this.element.querySelectorAll(elems)), 34464 elems = utils.makeArray(elems); 34465 }, proto._manageStamps = function() { 34466 this.stamps && this.stamps.length && (this._getBoundingRect(), this.stamps.forEach(this._manageStamp, this)); 34467 }, proto._getBoundingRect = function() { 34468 var boundingRect = this.element.getBoundingClientRect(), size = this.size; 34469 this._boundingRect = { 34470 left: boundingRect.left + size.paddingLeft + size.borderLeftWidth, 34471 top: boundingRect.top + size.paddingTop + size.borderTopWidth, 34472 right: boundingRect.right - (size.paddingRight + size.borderRightWidth), 34473 bottom: boundingRect.bottom - (size.paddingBottom + size.borderBottomWidth) 34474 }; 34475 }, proto._manageStamp = noop, proto._getElementOffset = function(elem) { 34476 var boundingRect = elem.getBoundingClientRect(), thisRect = this._boundingRect, size = getSize(elem); 34477 return { 34478 left: boundingRect.left - thisRect.left - size.marginLeft, 34479 top: boundingRect.top - thisRect.top - size.marginTop, 34480 right: thisRect.right - boundingRect.right - size.marginRight, 34481 bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom 34482 }; 34483 }, proto.handleEvent = utils.handleEvent, proto.bindResize = function() { 34484 window.addEventListener("resize", this), this.isResizeBound = !0; 34485 }, proto.unbindResize = function() { 34486 window.removeEventListener("resize", this), this.isResizeBound = !1; 34487 }, proto.onresize = function() { 34488 this.resize(); 34489 }, utils.debounceMethod(Outlayer, "onresize", 100), proto.resize = function() { 34490 this.isResizeBound && this.needsResizeLayout() && this.layout(); 34491 }, proto.needsResizeLayout = function() { 34492 var size = getSize(this.element); 34493 return this.size && size && size.innerWidth !== this.size.innerWidth; 34494 }, proto.addItems = function(elems) { 34495 var items = this._itemize(elems); 34496 return items.length && (this.items = this.items.concat(items)), items; 34497 }, proto.appended = function(elems) { 34498 var items = this.addItems(elems); 34499 items.length && (this.layoutItems(items, !0), this.reveal(items)); 34500 }, proto.prepended = function(elems) { 34501 var items = this._itemize(elems); 34502 if (items.length) { 34503 var previousItems = this.items.slice(0); 34504 this.items = items.concat(previousItems), this._resetLayout(), this._manageStamps(), 34505 this.layoutItems(items, !0), this.reveal(items), this.layoutItems(previousItems); 34506 } 34507 }, proto.reveal = function(items) { 34508 if (this._emitCompleteOnItems("reveal", items), items && items.length) { 34509 var stagger = this.updateStagger(); 34510 items.forEach(function(item, i) { 34511 item.stagger(i * stagger), item.reveal(); 34512 }); 34513 } 34514 }, proto.hide = function(items) { 34515 if (this._emitCompleteOnItems("hide", items), items && items.length) { 34516 var stagger = this.updateStagger(); 34517 items.forEach(function(item, i) { 34518 item.stagger(i * stagger), item.hide(); 34519 }); 34520 } 34521 }, proto.revealItemElements = function(elems) { 34522 var items = this.getItems(elems); 34523 this.reveal(items); 34524 }, proto.hideItemElements = function(elems) { 34525 var items = this.getItems(elems); 34526 this.hide(items); 34527 }, proto.getItem = function(elem) { 34528 for (var i = 0; i < this.items.length; i++) { 34529 var item = this.items[i]; 34530 if (item.element == elem) return item; 34531 } 34532 }, proto.getItems = function(elems) { 34533 elems = utils.makeArray(elems); 34534 var items = [];
34535 return elems.forEach(function(elem) { 34536 var item = this.getItem(elem); 34537 item && items.push(item); 34538 }, this), items; 34539 }, proto.remove = function(elems) { 34540 var removeItems = this.getItems(elems); 34541 this._emitCompleteOnItems("remove", removeItems), removeItems && removeItems.length && removeItems.forEach(function(item) { 34542 item.remove(), utils.removeFrom(this.items, item); 34543 }, this); 34544 }, proto.destroy = function() { 34545 var style = this.element.style; 34546 style.height = "", style.position = "", style.width = "", this.items.forEach(function(item) { 34547 item.destroy(); 34548 }), this.unbindResize(); 34549 var id = this.element.outlayerGUID; 34550 delete instances[id], delete this.element.outlayerGUID, jQuery && jQuery.removeData(this.element, this.constructor.namespace); 34551 }, Outlayer.data = function(elem) { 34552 var id = (elem = utils.getQueryElement(elem)) && elem.outlayerGUID; 34553 return id && instances[id]; 34554 }, Outlayer.create = function(namespace, options) { 34555 var Layout = subclass(Outlayer); 34556 return Layout.defaults = utils.extend({}, Outlayer.defaults), utils.extend(Layout.defaults, options), 34557 Layout.compatOptions = utils.extend({}, Outlayer.compatOptions), Layout.namespace = namespace, 34558 Layout.data = Outlayer.data, Layout.Item = subclass(Item), utils.htmlInit(Layout, namespace), 34559 jQuery && jQuery.bridget && jQuery.bridget(namespace, Layout), Layout; 34560 }; 34561 var msUnits = { 34562 ms: 1, 34563 s: 1e3 34564 }; 34565 return Outlayer.Item = Item, Outlayer; 34566 }); 34567 }, { 34568 "./item": 285, 34569 "ev-emitter": 276, 34570 "fizzy-ui-utils": 277, 34571 "get-size": 280 34572 } ] 34573}, {}, [ 26 ]); 34574//# sourceMappingURL=heifer.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.